@openemail/sdk 0.0.6 → 0.0.8

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 +2 -2
  2. package/index.cjs +2565 -525
  3. package/index.d.cts +4694 -617
  4. package/index.d.ts +4694 -617
  5. package/index.js +2461 -526
  6. package/package.json +2 -2
package/index.cjs CHANGED
@@ -2,11 +2,136 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ const APP_HOST_STATUSES = {
6
+ NONE: 'none',
7
+ PENDING: 'pending',
8
+ ACTIVE: 'active',
9
+ FAILED: 'failed'
10
+ };
11
+
5
12
  const AUDIENCE_MEMBER_STATUSES = {
6
13
  SUBSCRIBED: 'subscribed',
7
14
  UNSUBSCRIBED: 'unsubscribed'
8
15
  };
9
16
 
17
+ const PLAN_IDS = {
18
+ FREE: 'free',
19
+ STARTER: 'starter',
20
+ BUSINESS: 'business',
21
+ ENTERPRISE: 'enterprise'
22
+ };
23
+ const PAID_PLAN_IDS = {
24
+ STARTER: 'starter',
25
+ BUSINESS: 'business',
26
+ ENTERPRISE: 'enterprise'
27
+ };
28
+ const BILLING_INTERVALS = {
29
+ MONTH: 'month',
30
+ YEAR: 'year'
31
+ };
32
+ const BILLING_THEMES = {
33
+ LIGHT: 'light',
34
+ DARK: 'dark'
35
+ };
36
+ const BILLING_USAGE_WINDOWS = {
37
+ ALL: 'all'
38
+ };
39
+ const BILLING_ALERT_KINDS = {
40
+ PAYMENT_FAILED: 'payment_failed',
41
+ PAY_AS_YOU_GO_PAUSED: 'pay_as_you_go_paused',
42
+ SENDING_PAUSED: 'sending_paused',
43
+ SPEND_LIMIT_REACHED: 'spend_limit_reached',
44
+ AI_USED_UP: 'ai_used_up',
45
+ PLAN_ENDING: 'plan_ending',
46
+ SENDS_NEARLY_USED: 'sends_nearly_used',
47
+ SPEND_NEARLY_REACHED: 'spend_nearly_reached',
48
+ UPCOMING_CHARGE: 'upcoming_charge'
49
+ };
50
+ const BILLING_ALERT_SEVERITIES = {
51
+ BLOCKED: 'blocked',
52
+ WARNING: 'warning',
53
+ INFO: 'info'
54
+ };
55
+ const BILLING_ALERT_TARGETS = {
56
+ BILLING: 'billing',
57
+ USAGE: 'usage'
58
+ };
59
+ const BILLING_INVOICE_SORTS = {
60
+ NEWEST: 'newest',
61
+ OLDEST: 'oldest'
62
+ };
63
+ const BILLING_INVOICE_STATUSES = {
64
+ DRAFT: 'draft',
65
+ PENDING: 'pending',
66
+ PAID: 'paid',
67
+ REFUNDED: 'refunded',
68
+ PARTIALLY_REFUNDED: 'partially_refunded',
69
+ VOID: 'void'
70
+ };
71
+ const BILLING_INVOICE_STARTS = {
72
+ READY: 'ready',
73
+ STARTED: 'started',
74
+ REFUSED: 'refused'
75
+ };
76
+ const PAY_AS_YOU_GO_LIMITS_CENTS = [1_000, 2_500, 5_000, 10_000, 25_000, 50_000, 100_000, 250_000, 500_000];
77
+
78
+ const BRAND_IMAGE_VARIANTS = {
79
+ MARK: 'mark',
80
+ WORDMARK: 'wordmark',
81
+ WORDMARK_DARK: 'wordmark-dark',
82
+ LOGIN_BACKGROUND: 'login-background'
83
+ };
84
+ const BRAND_IMAGE_TYPES = {
85
+ SVG: 'image/svg+xml',
86
+ PNG: 'image/png',
87
+ JPEG: 'image/jpeg',
88
+ WEBP: 'image/webp',
89
+ GIF: 'image/gif'
90
+ };
91
+ const BRAND_FONT_IDS = {
92
+ SYSTEM: 'system',
93
+ ARIAL: 'arial',
94
+ HELVETICA: 'helvetica',
95
+ VERDANA: 'verdana',
96
+ TAHOMA: 'tahoma',
97
+ TREBUCHET_MS: 'trebuchet-ms',
98
+ GEORGIA: 'georgia',
99
+ TIMES_NEW_ROMAN: 'times-new-roman',
100
+ COURIER_NEW: 'courier-new',
101
+ DM_SANS: 'dm-sans',
102
+ INTER: 'inter',
103
+ ROBOTO: 'roboto',
104
+ OPEN_SANS: 'open-sans',
105
+ LATO: 'lato',
106
+ MONTSERRAT: 'montserrat',
107
+ POPPINS: 'poppins',
108
+ NUNITO: 'nunito',
109
+ WORK_SANS: 'work-sans',
110
+ SOURCE_SANS_3: 'source-sans-3',
111
+ IBM_PLEX_SANS: 'ibm-plex-sans',
112
+ MERRIWEATHER: 'merriweather',
113
+ PLAYFAIR_DISPLAY: 'playfair-display',
114
+ INSTRUMENT_SERIF: 'instrument-serif',
115
+ JETBRAINS_MONO: 'jetbrains-mono',
116
+ DM_MONO: 'dm-mono',
117
+ GEIST_MONO: 'geist-mono'
118
+ };
119
+ const LOGIN_BACKGROUND_KINDS = {
120
+ PRESET: 'preset',
121
+ COLOR: 'color',
122
+ IMAGE: 'image'
123
+ };
124
+ const LOGIN_BACKGROUND_PRESETS = {
125
+ DUSK: 'dusk',
126
+ MIST: 'mist',
127
+ SAND: 'sand',
128
+ NIGHT: 'night'
129
+ };
130
+ const LOGIN_LOGOS = {
131
+ DARK: 'dark',
132
+ LIGHT: 'light'
133
+ };
134
+
10
135
  const BROADCAST_STATUSES = {
11
136
  SCHEDULED: 'scheduled',
12
137
  QUEUED: 'queued',
@@ -28,7 +153,61 @@ const BROADCAST_RECIPIENT_FILTERS = {
28
153
  UNSUBSCRIBED: 'unsubscribed'
29
154
  };
30
155
 
31
- var version = "0.0.6";
156
+ const CALENDAR_RESPONSES = {
157
+ ACCEPTED: 'ACCEPTED',
158
+ DECLINED: 'DECLINED',
159
+ TENTATIVE: 'TENTATIVE'
160
+ };
161
+ const CALENDAR_TRANSPARENCIES = {
162
+ OPAQUE: 'OPAQUE',
163
+ TRANSPARENT: 'TRANSPARENT'
164
+ };
165
+ const CALENDAR_VISIBILITIES = {
166
+ PUBLIC: 'PUBLIC',
167
+ PRIVATE: 'PRIVATE',
168
+ CONFIDENTIAL: 'CONFIDENTIAL'
169
+ };
170
+ const CALENDAR_REMINDER_ACTIONS = {
171
+ DISPLAY: 'DISPLAY',
172
+ EMAIL: 'EMAIL',
173
+ AUDIO: 'AUDIO'
174
+ };
175
+ const CALENDAR_FEED_MODES = {
176
+ FULL: 'full',
177
+ BUSY: 'busy'
178
+ };
179
+ const CALENDAR_COLORS = {
180
+ BLUE: 'blue',
181
+ SKY: 'sky',
182
+ TEAL: 'teal',
183
+ GREEN: 'green',
184
+ LIME: 'lime',
185
+ YELLOW: 'yellow',
186
+ ORANGE: 'orange',
187
+ RED: 'red',
188
+ PINK: 'pink',
189
+ PURPLE: 'purple',
190
+ GRAY: 'gray'
191
+ };
192
+ const CALENDAR_SUBSCRIPTION_STATUSES = {
193
+ ACTIVE: 'active',
194
+ FAILING: 'failing',
195
+ STOPPED: 'stopped'
196
+ };
197
+ const CALENDAR_SUBSCRIPTION_ERRORS = {
198
+ UNREACHABLE: 'unreachable',
199
+ TOO_LARGE: 'too-large',
200
+ NOT_A_CALENDAR: 'not-a-calendar',
201
+ TOO_MANY_EVENTS: 'too-many-events'
202
+ };
203
+
204
+ const CHAT_SORTS = {
205
+ NEWEST: 'newest',
206
+ OLDEST: 'oldest',
207
+ TITLE: 'title'
208
+ };
209
+
210
+ var version = "0.0.8";
32
211
 
33
212
  const BUILD_BASE_URL = 'https://api.openemail.uk';
34
213
 
@@ -83,9 +262,17 @@ const CLIENT_MESSAGES = {
83
262
  NO_FETCH: 'No global fetch is available. Pass one as { fetch }, or run on Node 20+, Bun, Deno, Cloudflare Workers or a browser.',
84
263
  EMPTY_SEGMENT: 'An id must not be empty.',
85
264
  FILENAME_REQUIRED: 'A file name is required. Pass it as { filename }, the name the file is stored and downloaded under.',
86
- DOT_SEGMENT: 'is not a usable id: a path segment made only of dots is removed by URL parsers, so the request would reach a different endpoint.'
265
+ DOT_SEGMENT: 'is not a usable id: a path segment made only of dots is removed by URL parsers, so the request would reach a different endpoint.',
266
+ PATH_SHAPE: 'is not a usable request path. Pass a path on the API that begins with a single "/", such as "/threads". Anything else could send the request, and the credential it carries, to another host.',
267
+ OFF_ORIGIN: 'leaves the API origin, so the request was not sent. Pass a path on the API that begins with a single "/", such as "/threads".'
87
268
  };
269
+ const DOT_ONLY_SEGMENT = /^\.+$/;
88
270
 
271
+ const CONTACT_SOURCES = {
272
+ MANUAL: 'manual',
273
+ AUTO: 'auto',
274
+ FORM: 'form'
275
+ };
89
276
  const PEOPLE_SORTS = {
90
277
  RECENT: 'recent',
91
278
  NAME: 'name',
@@ -107,6 +294,47 @@ const CONTACT_PHOTO_TYPES = {
107
294
  WEBP: 'image/webp',
108
295
  GIF: 'image/gif'
109
296
  };
297
+ const CONTACT_CARD_LABELS = {
298
+ HOME: 'home',
299
+ WORK: 'work',
300
+ MOBILE: 'mobile',
301
+ MAIN: 'main',
302
+ FAX: 'fax',
303
+ PAGER: 'pager',
304
+ OTHER: 'other'
305
+ };
306
+
307
+ const DNS_CONNECTION_STATUSES = {
308
+ ACTIVE: 'active',
309
+ NEEDS_REAUTH: 'needs-reauth',
310
+ REVOKED: 'revoked',
311
+ ERROR: 'error'
312
+ };
313
+ const DNS_PROVISION_STATES = {
314
+ UNMANAGED: 'unmanaged',
315
+ READY: 'ready',
316
+ AWAITING_SYNC: 'awaiting-sync',
317
+ AWAITING_SIGNING: 'awaiting-signing',
318
+ CONFLICT: 'conflict',
319
+ BLOCKED: 'blocked'
320
+ };
321
+ const DNS_ZONE_RESOLUTION_KINDS = {
322
+ RESOLVED: 'resolved',
323
+ AMBIGUOUS: 'ambiguous',
324
+ NONE: 'none',
325
+ UNUSABLE: 'unusable'
326
+ };
327
+ const DNS_SYNC_PURPOSES = {
328
+ DMARC: 'dmarc',
329
+ TRACKING: 'tracking',
330
+ STORAGE: 'storage',
331
+ BIMI: 'bimi',
332
+ APP_HOST: 'app-host'
333
+ };
334
+ const DNS_SYNC_OUTCOMES = {
335
+ SYNCED: 'synced',
336
+ REFUSED: 'refused'
337
+ };
110
338
 
111
339
  const DOMAIN_RECORD_STATUSES = {
112
340
  FOUND: 'found',
@@ -119,6 +347,61 @@ const DOMAIN_DMARC_STAGES = {
119
347
  QUARANTINE: 'quarantine',
120
348
  REJECT: 'reject'
121
349
  };
350
+ const DOMAIN_DMARC_POLICIES = {
351
+ NONE: 'none',
352
+ QUARANTINE: 'quarantine',
353
+ REJECT: 'reject'
354
+ };
355
+ const DOMAIN_LOGO_MARK_KINDS = {
356
+ VERIFIED: 'verified',
357
+ COMMON: 'common',
358
+ UNKNOWN: 'unknown'
359
+ };
360
+ const DOMAIN_LOGO_RECORD_OUTCOMES = {
361
+ PUBLISHED: 'published',
362
+ MANUAL: 'manual',
363
+ BLOCKED: 'blocked',
364
+ BUSY: 'busy',
365
+ FAILED: 'failed'
366
+ };
367
+ const DOMAIN_ADDRESS_DESTINATIONS = {
368
+ MAILBOX: 'mailbox',
369
+ FORWARD: 'forward'
370
+ };
371
+ const ADDRESS_FORWARD_STATUSES = {
372
+ LIVE: 'live',
373
+ PENDING: 'pending',
374
+ REFUSED: 'refused',
375
+ PAUSED: 'paused'
376
+ };
377
+ const ADDRESS_FORWARD_CONSENT_STATUSES = {
378
+ SENT: 'sent',
379
+ ALREADY_CONFIRMED: 'already-confirmed',
380
+ REVOKED: 'revoked',
381
+ TOO_SOON: 'too-soon',
382
+ SEND_FAILED: 'send-failed'
383
+ };
384
+ const ADDRESS_MEMBER_VIAS = {
385
+ OWNER: 'owner',
386
+ EVERY_ADDRESS: 'every-address',
387
+ WHOLE_DOMAIN: 'whole-domain',
388
+ DIRECT: 'direct'
389
+ };
390
+ const MAIL_APP_SECURITIES = {
391
+ SSL_TLS: 'ssl-tls'
392
+ };
393
+ const MAIL_APP_PROTOCOLS = {
394
+ IMAP: 'imap',
395
+ SMTP: 'smtp',
396
+ POP3: 'pop3',
397
+ CALDAV: 'caldav',
398
+ CARDDAV: 'carddav'
399
+ };
400
+ const APP_PASSWORD_ORIGINS = {
401
+ SETTINGS: 'settings',
402
+ SETUP_LINK: 'setup-link',
403
+ API: 'api'
404
+ };
122
405
 
123
406
  const MESSAGE_ENCRYPTION_FORMATS = {
124
407
  PGP_MIME: 'pgp-mime',
@@ -161,6 +444,25 @@ const ERROR_NAMES = {
161
444
  NETWORK: 'OpenEmailNetworkError',
162
445
  TIMEOUT: 'TimeoutError'};
163
446
 
447
+ const EXPORT_STATUSES = {
448
+ QUEUED: 'queued',
449
+ RUNNING: 'running',
450
+ READY: 'ready',
451
+ FAILED: 'failed',
452
+ EXPIRED: 'expired'
453
+ };
454
+ const EXPORT_PHASES = {
455
+ PLANNING: 'planning',
456
+ MAIL: 'mail',
457
+ RECORDS: 'records',
458
+ FINISHING: 'finishing'
459
+ };
460
+ const EXPORT_REFUSALS = {
461
+ NOT_PERMITTED: 'not-permitted',
462
+ MAILBOX_LOGIN: 'mailbox-login',
463
+ TWO_FACTOR_REQUIRED: 'two-factor-required'
464
+ };
465
+
164
466
  const FILE_SORTS = {
165
467
  NEWEST: 'newest',
166
468
  OLDEST: 'oldest',
@@ -190,6 +492,109 @@ const FILE_VISIBILITIES = {
190
492
  PRIVATE: 'private'
191
493
  };
192
494
 
495
+ const FORM_STATUSES = {
496
+ DRAFT: 'draft',
497
+ LIVE: 'live',
498
+ PAUSED: 'paused'
499
+ };
500
+ const FORM_SUBMISSION_STATUSES = {
501
+ PENDING: 'pending',
502
+ ADDED: 'added'
503
+ };
504
+ const FORM_FIELD_TYPES = {
505
+ EMAIL: 'email',
506
+ TEXT: 'text',
507
+ TEXTAREA: 'textarea',
508
+ NUMBER: 'number',
509
+ PHONE: 'phone',
510
+ URL: 'url',
511
+ DATE: 'date',
512
+ SELECT: 'select',
513
+ RADIO: 'radio',
514
+ CHECKBOXES: 'checkboxes',
515
+ CHECKBOX: 'checkbox',
516
+ CONSENT: 'consent',
517
+ AUDIENCES: 'audiences',
518
+ HIDDEN: 'hidden',
519
+ HEADING: 'heading',
520
+ PARAGRAPH: 'paragraph',
521
+ DIVIDER: 'divider'
522
+ };
523
+ const FORM_STARTER_SLUGS = {
524
+ BLANK: 'blank',
525
+ NEWSLETTER: 'newsletter',
526
+ WAITLIST: 'waitlist',
527
+ EVENT: 'event',
528
+ EARLY_ACCESS: 'early-access',
529
+ CONTACT: 'contact'
530
+ };
531
+ const FORM_CONFIRM_SOURCES = {
532
+ LINK: 'link',
533
+ APPROVAL: 'approval'
534
+ };
535
+ const FORM_CONTACT_FIELDS = {
536
+ EMAIL: 'email',
537
+ FIRST_NAME: 'firstName',
538
+ LAST_NAME: 'lastName',
539
+ NAME: 'name'
540
+ };
541
+ const FORM_FIELD_WIDTHS = {
542
+ FULL: 'full',
543
+ HALF: 'half'
544
+ };
545
+ const FORM_FONTS = {
546
+ SYSTEM: 'system',
547
+ SANS: 'sans',
548
+ SERIF: 'serif',
549
+ MONO: 'mono'
550
+ };
551
+ const FORM_RADII = {
552
+ NONE: 'none',
553
+ SM: 'sm',
554
+ MD: 'md',
555
+ LG: 'lg',
556
+ FULL: 'full'
557
+ };
558
+ const FORM_WIDTHS = {
559
+ NARROW: 'narrow',
560
+ NORMAL: 'normal',
561
+ WIDE: 'wide'
562
+ };
563
+ const FORM_LAYOUTS = {
564
+ CARD: 'card',
565
+ PLAIN: 'plain'
566
+ };
567
+ const FORM_ALIGNS = {
568
+ LEFT: 'left',
569
+ CENTER: 'center'
570
+ };
571
+ const FORM_SUCCESS_ACTIONS = {
572
+ MESSAGE: 'message',
573
+ REDIRECT: 'redirect'
574
+ };
575
+ const FORM_SENDER_ISSUES = {
576
+ MISSING: 'missing',
577
+ NOT_SENDABLE: 'not_sendable',
578
+ NOT_ALLOWED: 'not_allowed'
579
+ };
580
+ const FORM_FIELD_ERRORS = {
581
+ REQUIRED: 'required',
582
+ EMAIL: 'email',
583
+ NUMBER: 'number',
584
+ MIN: 'min',
585
+ MAX: 'max',
586
+ TOO_SHORT: 'too_short',
587
+ TOO_LONG: 'too_long',
588
+ URL: 'url',
589
+ DATE: 'date',
590
+ PHONE: 'phone',
591
+ OPTION: 'option'
592
+ };
593
+ const FORM_SUBSCRIBE_OUTCOMES = {
594
+ ADDED: 'added',
595
+ PENDING: 'pending'
596
+ };
597
+
193
598
  const HTTP_METHODS = {
194
599
  GET: 'GET',
195
600
  POST: 'POST',
@@ -221,6 +626,21 @@ const RETRY = {
221
626
  };
222
627
  const IDEMPOTENCY_KEY_PREFIX = 'oe-';
223
628
 
629
+ const IMPORT_FORMATS = {
630
+ GMAIL: 'gmail',
631
+ OPENEMAIL: 'openemail',
632
+ THUNDERBIRD: 'thunderbird',
633
+ PROTON: 'proton',
634
+ MBOX: 'mbox',
635
+ EML: 'eml'
636
+ };
637
+ const PROVIDER_IMPORT_PROVIDERS = {
638
+ RESEND: 'resend',
639
+ SENDGRID: 'sendgrid',
640
+ POSTMARK: 'postmark',
641
+ MAILGUN: 'mailgun',
642
+ MAILCHIMP: 'mailchimp'
643
+ };
224
644
  const PROVIDER_IMPORT_RESOURCES = {
225
645
  SUPPRESSIONS: 'suppressions',
226
646
  AUDIENCES: 'audiences',
@@ -243,6 +663,74 @@ const PROVIDER_IMPORT_DOMAIN_STATES = {
243
663
  VERIFIED: 'verified'
244
664
  };
245
665
 
666
+ const KNOWLEDGE_KINDS = {
667
+ NOTE: 'note',
668
+ FILE: 'file',
669
+ LINK: 'link'
670
+ };
671
+ const KNOWLEDGE_LEVELS = {
672
+ WORKSPACE: 'workspace',
673
+ DOMAIN: 'domain',
674
+ ADDRESS: 'address'
675
+ };
676
+ const KNOWLEDGE_STATUSES = {
677
+ QUEUED: 'queued',
678
+ PROCESSING: 'processing',
679
+ READY: 'ready',
680
+ FAILED: 'failed'
681
+ };
682
+ const KNOWLEDGE_FAILURES = {
683
+ UNSUPPORTED: 'unsupported',
684
+ EMPTY: 'empty',
685
+ TOO_LARGE: 'too_large',
686
+ FETCH_FAILED: 'fetch_failed',
687
+ BLOCKED_URL: 'blocked_url',
688
+ CONVERSION_FAILED: 'conversion_failed',
689
+ INDEX_FAILED: 'index_failed',
690
+ OVER_ALLOWANCE: 'over_allowance',
691
+ MISSING_FILE: 'missing_file'
692
+ };
693
+ const KNOWLEDGE_ORIGINS = {
694
+ APP: 'app',
695
+ API: 'api',
696
+ ASSISTANT: 'assistant',
697
+ MCP: 'mcp'
698
+ };
699
+ const KNOWLEDGE_REFRESH_DAY_CHOICES = {
700
+ DAY: 1,
701
+ WEEK: 7,
702
+ MONTH: 30
703
+ };
704
+ const KNOWLEDGE_SUGGESTION_KINDS = {
705
+ LEARNED: 'learned',
706
+ QUESTION: 'question'
707
+ };
708
+ const KNOWLEDGE_SUGGESTION_STATUSES = {
709
+ PENDING: 'pending',
710
+ ACCEPTED: 'accepted',
711
+ DISMISSED: 'dismissed'
712
+ };
713
+ const KNOWLEDGE_FLAG_KINDS = {
714
+ DUPLICATE: 'duplicate',
715
+ CONFLICT: 'conflict'
716
+ };
717
+ const KNOWLEDGE_FLAG_STATUSES = {
718
+ OPEN: 'open',
719
+ DISMISSED: 'dismissed'
720
+ };
721
+ const KNOWLEDGE_CONNECTOR_KINDS = {
722
+ SITE: 'site',
723
+ SITEMAP: 'sitemap',
724
+ FEED: 'feed',
725
+ ZENDESK: 'zendesk'
726
+ };
727
+ const KNOWLEDGE_CONNECTOR_STATUSES = {
728
+ QUEUED: 'queued',
729
+ SYNCING: 'syncing',
730
+ READY: 'ready',
731
+ FAILED: 'failed'
732
+ };
733
+
246
734
  const LANGUAGES = [
247
735
  { code: 'en', label: 'English', native: 'English', flag: '🇬🇧', rtl: false },
248
736
  { code: 'es', label: 'Spanish', native: 'Español', flag: '🇪🇸', rtl: false },
@@ -469,6 +957,47 @@ const LANGUAGE_ALIASES = [
469
957
  ];
470
958
  const LANGUAGE_SUBTAG_PATTERN = /[-_]/;
471
959
 
960
+ const THREAD_SUMMARY_STATES = {
961
+ READY: 'ready',
962
+ PENDING: 'pending',
963
+ NONE: 'none'
964
+ };
965
+ const REPLY_SUGGESTION_STATES = {
966
+ READY: 'ready',
967
+ PENDING: 'pending',
968
+ NONE: 'none'
969
+ };
970
+ const MAIL_SERVICES = {
971
+ OPENEMAIL: 'openemail',
972
+ GMAIL: 'gmail',
973
+ OUTLOOK: 'outlook',
974
+ ICLOUD: 'icloud',
975
+ YAHOO: 'yahoo',
976
+ PROTON: 'proton',
977
+ ZOHO: 'zoho',
978
+ FASTMAIL: 'fastmail',
979
+ RESEND: 'resend',
980
+ SENDGRID: 'sendgrid',
981
+ MAILGUN: 'mailgun',
982
+ POSTMARK: 'postmark',
983
+ MAILCHIMP: 'mailchimp',
984
+ BREVO: 'brevo',
985
+ SPARKPOST: 'sparkpost',
986
+ HUBSPOT: 'hubspot',
987
+ AMAZON_SES: 'amazon-ses'
988
+ };
989
+
990
+ const THREAD_NOTE_COLORS = {
991
+ DEFAULT: 'default',
992
+ RED: 'red',
993
+ ORANGE: 'orange',
994
+ YELLOW: 'yellow',
995
+ GREEN: 'green',
996
+ BLUE: 'blue',
997
+ PURPLE: 'purple',
998
+ PINK: 'pink'
999
+ };
1000
+
472
1001
  const PAGINATION = {
473
1002
  MAX_LIMIT: 100,
474
1003
  DEFAULT_LIMIT: 25
@@ -512,11 +1041,14 @@ const QUERY_KEYS = {
512
1041
  AUDIENCE_IDS: 'audienceIds',
513
1042
  AUDIENCE_ID: 'audienceId',
514
1043
  BROADCAST_ID: 'broadcastId',
1044
+ BROADCAST_IDS: 'broadcastIds',
515
1045
  EMAIL: 'email',
1046
+ WITHOUT_EMAIL: 'withoutEmail',
516
1047
  BLOCKED: 'blocked',
517
1048
  DATE_FROM: 'dateFrom',
518
1049
  DATE_TO: 'dateTo',
519
1050
  FROM_CONTACTS: 'fromContacts',
1051
+ SEMANTIC: 'semantic',
520
1052
  REASON: 'reason',
521
1053
  KIND: 'kind',
522
1054
  ENDPOINT_IDS: 'endpointIds',
@@ -524,124 +1056,42 @@ const QUERY_KEYS = {
524
1056
  SINCE: 'since',
525
1057
  UNTIL: 'until',
526
1058
  FAILED_ONLY: 'failedOnly',
527
- FILENAME: 'filename'
528
- };
529
- const LIST_SEPARATOR = ',';
530
-
531
- const PATHS = {
532
- PING: '/ping',
533
- KEYS: '/keys',
534
- KEYS_REQUESTS: '/keys/requests',
535
- KEYS_ACTIVITY: '/keys/activity',
536
- KEYS_SELF: '/keys/self',
537
- KEYS_SELF_ROTATE: '/keys/self/rotate',
538
- ADDRESSES: '/addresses',
539
- LANGUAGES: '/languages',
540
- EMAILS: '/emails',
541
- EMAILS_BATCH: '/emails/batch',
542
- EMAILS_TRANSLATE: '/emails/translate',
543
- THREADS: '/threads',
544
- DRAFTS: '/drafts',
545
- LABELS: '/labels',
546
- LABELS_COLORS: '/labels/colors',
547
- CONTACTS: '/contacts',
548
- CONTACTS_PEOPLE: '/contacts/people',
549
- CONTACTS_BATCH_DELETE: '/contacts/batch-delete',
550
- AUDIENCES: '/audiences',
551
- AUDIENCES_GROWTH: '/audiences/growth',
552
- BROADCASTS: '/broadcasts',
553
- BROADCASTS_PREVIEW: '/broadcasts/preview',
554
- DOMAINS: '/domains',
555
- WEBHOOKS: '/webhooks',
556
- WEBHOOKS_DELIVERIES: '/webhooks/deliveries',
557
- WEBHOOKS_ACTIVITY: '/webhooks/activity',
558
- IMPORTS: '/imports',
559
- PROVIDER_IMPORTS: '/provider-imports',
560
- PROVIDER_IMPORTS_INSPECT: '/provider-imports/inspect',
561
- TEMPLATES: '/templates',
562
- TEMPLATES_FONTS: '/templates/fonts',
563
- TEMPLATES_RENDER: '/templates/render',
564
- TEMPLATES_STARTERS: '/templates/starters',
565
- RULES: '/rules',
566
- RULES_RUNS: '/rules/runs',
567
- RULES_REORDER: '/rules/reorder',
568
- TRACKING: '/tracking',
569
- TRACKING_STATS: '/tracking/stats',
570
- CALENDAR_EVENTS: '/calendar/events',
571
- SETTINGS: '/settings',
572
- SECURITY_STEP_UP: '/security/step-up',
573
- SECURITY_STEP_UP_VERIFY: '/security/step-up/verify',
574
- ROLES: '/roles',
575
- ROLES_PERMISSIONS: '/roles/permissions',
576
- MEMBERS: '/members',
577
- MEMBERS_INVITATIONS: '/members/invitations',
578
- SUPPRESSIONS: '/suppressions',
579
- FILES: '/files',
580
- FILES_STATS: '/files/stats',
581
- FILES_BATCH_DELETE: '/files/batch-delete',
582
- TEMP_MAIL_DOMAINS: '/temp-mail/domains',
583
- TEMP_MAIL_INBOXES: '/temp-mail/inboxes'
584
- };
585
- const SEGMENTS = {
586
- ACTIVITY: 'activity',
1059
+ FILENAME: 'filename',
1060
+ DOMAIN: 'domain',
1061
+ SCHEDULED_FROM: 'scheduledFrom',
1062
+ SCHEDULED_TO: 'scheduledTo',
587
1063
  ADDRESSES: 'addresses',
588
- ANALYTICS: 'analytics',
589
- ATTACHMENTS: 'attachments',
590
- AUDIENCES: 'audiences',
591
- BATCH: 'batch',
592
- BATCH_REMOVE: 'batch-remove',
593
- BLOCK: 'block',
594
- CANCEL: 'cancel',
595
- CHUNKS: 'chunks',
596
- CLICKS: 'clicks',
597
- CONTACTS: 'contacts',
598
- CONTENT: 'content',
599
- DELIVERIES: 'deliveries',
600
- DUPLICATE: 'duplicate',
601
- EMPTY: 'empty',
602
- EVENTS: 'events',
603
- EXTEND: 'extend',
604
- FAILURES: 'failures',
605
- FILES: 'files',
606
- ICS: 'ics',
607
- IMPORT: 'import',
608
- LINKS: 'links',
609
- MESSAGES: 'messages',
610
- OPENS: 'opens',
611
- PHOTO: 'photo',
612
- PREVIEW: 'preview',
613
- REPLAY: 'replay',
614
- REQUESTS: 'requests',
615
- RESEND: 'resend',
616
- RESTORE: 'restore',
617
- REVOKE: 'revoke',
618
- ROTATE: 'rotate',
619
- ROTATE_SECRET: 'rotate-secret',
620
- RECIPIENTS: 'recipients',
621
- SEND: 'send',
1064
+ OFFSET: 'offset',
1065
+ REFRESH: 'refresh',
1066
+ CONFIRM: 'confirm',
1067
+ USERNAME: 'username',
1068
+ SCOPE: 'scope',
1069
+ LEVEL: 'level',
1070
+ PINNED: 'pinned',
1071
+ TITLE: 'title',
1072
+ ITEM_ID: 'itemId',
622
1073
  SENDS: 'sends',
623
- STATS: 'stats',
624
- SNOOZE: 'snooze',
625
- START: 'start',
626
- TEST: 'test',
627
- THREADS: 'threads',
628
- TRACKING: 'tracking',
629
- TRASH: 'trash',
630
- UNSNOOZE: 'unsnooze',
631
- UPLOAD: 'upload',
632
- VERIFY: 'verify',
633
- VERSIONS: 'versions'
1074
+ DOMAINS: 'domains',
1075
+ PEOPLE: 'people',
1076
+ AI_ACTIONS: 'aiActions',
1077
+ INTERVAL: 'interval'
634
1078
  };
1079
+ const LIST_SEPARATOR = ',';
635
1080
 
1081
+ const DOCS_PATHS = {
1082
+ SDK_CHANGELOG: '/docs/sdk/changelog'};
1083
+
1084
+ const APP_ORIGIN = 'https://openemail.uk';
636
1085
  const VERSION = version;
637
1086
  const NPM_REGISTRY_URL = 'https://registry.npmjs.org/@openemail/sdk';
638
1087
  const UPDATE_NOTICE = {
639
1088
  ENV_DISABLE: 'OPENEMAIL_DISABLE_UPDATE_NOTICE',
640
1089
  TIMEOUT_MS: 2_000,
641
1090
  PACKAGE: '@openemail/sdk',
642
- CHANGELOG_URL: 'https://openemail.uk/docs/sdk/changelog',
1091
+ CHANGELOG_URL: `${APP_ORIGIN}${DOCS_PATHS.SDK_CHANGELOG}`,
643
1092
  ICON: 'ℹ'
644
1093
  };
1094
+ const VERSION_TAG_PREFIX = /^v/;
645
1095
 
646
1096
  const RULE_FIELDS = {
647
1097
  FROM: 'from',
@@ -723,7 +1173,23 @@ const API_SCOPES = {
723
1173
  SETTINGS_WRITE: 'settings:write',
724
1174
  KEYS_WRITE: 'keys:write',
725
1175
  KEYS_READ: 'keys:read',
726
- KEYS_MANAGE: 'keys:manage'
1176
+ KEYS_MANAGE: 'keys:manage',
1177
+ FORMS_READ: 'forms:read',
1178
+ FORMS_WRITE: 'forms:write',
1179
+ KNOWLEDGE_READ: 'knowledge:read',
1180
+ KNOWLEDGE_WRITE: 'knowledge:write',
1181
+ BILLING_READ: 'billing:read',
1182
+ BILLING_WRITE: 'billing:write',
1183
+ ACCOUNT_READ: 'account:read',
1184
+ ACCOUNT_WRITE: 'account:write'
1185
+ };
1186
+ const CONSOLE_PERMISSIONS = {
1187
+ ADDRESSES_ALL: 'addresses:all',
1188
+ API_KEYS_READ: 'api-keys:read',
1189
+ API_KEYS_WRITE: 'api-keys:write',
1190
+ BILLING_READ: 'billing:read',
1191
+ BILLING_WRITE: 'billing:write',
1192
+ WORKSPACE_MANAGE: 'workspace:manage'
727
1193
  };
728
1194
 
729
1195
  const STEP_UP_METHODS = {
@@ -746,6 +1212,14 @@ const SUPPRESSION_REASONS = {
746
1212
  MANUAL: 'manual'
747
1213
  };
748
1214
 
1215
+ const TEMPLATE_IMAGE_TYPES = {
1216
+ PNG: 'image/png',
1217
+ JPEG: 'image/jpeg',
1218
+ WEBP: 'image/webp',
1219
+ GIF: 'image/gif',
1220
+ SVG: 'image/svg+xml'
1221
+ };
1222
+
749
1223
  const THREAD_SORTS = {
750
1224
  NEWEST: 'newest',
751
1225
  OLDEST: 'oldest',
@@ -753,6 +1227,38 @@ const THREAD_SORTS = {
753
1227
  SUBJECT: 'subject'
754
1228
  };
755
1229
 
1230
+ const BIMI_STATUSES = {
1231
+ PRESENT: 'present',
1232
+ PARTIAL: 'partial',
1233
+ ABSENT: 'absent',
1234
+ INVALID: 'invalid'
1235
+ };
1236
+ const DELIVERABILITY_CHECK_IDS = {
1237
+ MX: 'mx',
1238
+ SPF: 'spf',
1239
+ DKIM: 'dkim',
1240
+ DMARC: 'dmarc',
1241
+ BIMI: 'bimi'
1242
+ };
1243
+ const DELIVERABILITY_CHECK_STATUSES = {
1244
+ PASS: 'pass',
1245
+ WARN: 'warn',
1246
+ FAIL: 'fail',
1247
+ ABSENT: 'absent'
1248
+ };
1249
+ const DELIVERABILITY_GRADES = {
1250
+ A: 'A',
1251
+ B: 'B',
1252
+ C: 'C',
1253
+ D: 'D',
1254
+ F: 'F'
1255
+ };
1256
+ const PLAN_BLOCKERS = {
1257
+ DOMAINS: 'domains',
1258
+ PEOPLE: 'people',
1259
+ SENDS: 'sends'
1260
+ };
1261
+
756
1262
  const WEBHOOK_EVENTS = {
757
1263
  EMAIL_RECEIVED: 'email.received',
758
1264
  EMAIL_REPLIED: 'email.replied',
@@ -775,7 +1281,9 @@ const WEBHOOK_EVENTS = {
775
1281
  SUPPRESSION_ADDED: 'suppression.added',
776
1282
  SUPPRESSION_REMOVED: 'suppression.removed',
777
1283
  FILE_UPLOADED: 'file.uploaded',
778
- FILE_DELETED: 'file.deleted'
1284
+ FILE_DELETED: 'file.deleted',
1285
+ FORM_SUBMITTED: 'form.submitted',
1286
+ FORM_CONFIRMED: 'form.confirmed'
779
1287
  };
780
1288
  const WEBHOOK_REPLAY_ERROR_CODES = {
781
1289
  RESOURCE_NOT_FOUND: 'resource_not_found',
@@ -798,6 +1306,7 @@ const WEBHOOK_SIGNATURE = {
798
1306
  VALUE_SEPARATOR: '=',
799
1307
  TOLERANCE_SECONDS: 300
800
1308
  };
1309
+ const HMAC_SIGN_USAGES = ['sign'];
801
1310
  const WEBHOOK_MESSAGES = {
802
1311
  MISSING_HEADER: 'Missing the X-OpenEmail-Signature header.',
803
1312
  MALFORMED_HEADER: 'X-OpenEmail-Signature is not in the form t=<seconds>,v1=<hex>.',
@@ -806,6 +1315,95 @@ const WEBHOOK_MESSAGES = {
806
1315
  NO_WEBCRYPTO: 'No WebCrypto is available. Verifying a webhook signature needs globalThis.crypto.subtle, which Node 20+, Bun, Deno, Cloudflare Workers and browsers over HTTPS all provide.'
807
1316
  };
808
1317
 
1318
+ const REWRITE_TARGETS = {
1319
+ SUBJECT: 'subject',
1320
+ BODY: 'body'
1321
+ };
1322
+ const REWRITE_ACTIONS = {
1323
+ SHORTEN: 'shorten',
1324
+ LENGTHEN: 'lengthen',
1325
+ REPHRASE: 'rephrase',
1326
+ FORMAL: 'formal',
1327
+ CASUAL: 'casual',
1328
+ CUSTOM: 'custom'
1329
+ };
1330
+
1331
+ const SUBSCRIPTION_STATUSES = {
1332
+ ACTIVE: 'active',
1333
+ UNSUBSCRIBED: 'unsubscribed'
1334
+ };
1335
+ const SUBSCRIPTION_SORTS = {
1336
+ RECENT: 'recent',
1337
+ MOST: 'most',
1338
+ UNREAD: 'unread',
1339
+ NAME: 'name'
1340
+ };
1341
+ const SUBSCRIPTION_DESTINATIONS = {
1342
+ ARCHIVE: 'archive',
1343
+ BIN: 'bin',
1344
+ LABEL: 'label'
1345
+ };
1346
+ const UNSUBSCRIBE_METHODS = {
1347
+ ONE_CLICK: 'one-click',
1348
+ EMAIL: 'email',
1349
+ LINK: 'link'
1350
+ };
1351
+
1352
+ const EMAIL_NOTIFICATION_CATEGORIES = {
1353
+ ACCOUNT: 'account',
1354
+ BILLING: 'billing',
1355
+ ACTIVITY: 'activity',
1356
+ PRODUCT: 'product'
1357
+ };
1358
+ const USERNAME_STATUSES = {
1359
+ AVAILABLE: 'available',
1360
+ CURRENT: 'current',
1361
+ TAKEN: 'taken',
1362
+ RESERVED: 'reserved',
1363
+ INVALID: 'invalid',
1364
+ TOO_SHORT: 'too_short',
1365
+ TOO_LONG: 'too_long'
1366
+ };
1367
+ const CONNECTED_APP_KINDS = {
1368
+ APP: 'app',
1369
+ CLI: 'cli'
1370
+ };
1371
+ const CONNECTED_APP_STATUSES = {
1372
+ ACTIVE: 'active',
1373
+ EXPIRED: 'expired',
1374
+ NEEDS_APPROVAL: 'needs-approval',
1375
+ ACCESS_LOST: 'access-lost'
1376
+ };
1377
+
1378
+ const WORKSPACE_KINDS = {
1379
+ BUSINESS: 'business',
1380
+ PERSONAL: 'personal'
1381
+ };
1382
+
1383
+ const SETTINGS_TIME_FORMATS = {
1384
+ H12: '12h',
1385
+ H24: '24h'
1386
+ };
1387
+ const SETTINGS_DATE_FORMATS = {
1388
+ DMY: 'dmy',
1389
+ MDY: 'mdy',
1390
+ YMD: 'ymd'
1391
+ };
1392
+ const SETTINGS_WEEK_STARTS = {
1393
+ MONDAY: 'monday',
1394
+ SUNDAY: 'sunday'
1395
+ };
1396
+ const SETTINGS_COLOR_THEMES = {
1397
+ LIGHT: 'light',
1398
+ DARK: 'dark',
1399
+ SYSTEM: 'system'
1400
+ };
1401
+ const SETTINGS_IMAGE_COMPRESSIONS = {
1402
+ LOW: 'low',
1403
+ MEDIUM: 'medium',
1404
+ ORIGINAL: 'original'
1405
+ };
1406
+
809
1407
  const PAGE_LIMITS = PAGINATION;
810
1408
  const WEBHOOK_SIGNATURE_HEADERS = WEBHOOK_HEADERS;
811
1409
 
@@ -819,32 +1417,325 @@ const LOOPBACK_IPV6_ADDRESS = '[::1]';
819
1417
  const UNSPECIFIED_HOSTNAMES = ['0.0.0.0', '::', '[::]'];
820
1418
  const LOCAL_HOSTS = [...LOOPBACK_HOSTNAMES, LOOPBACK_IPV4_ADDRESS, ...UNSPECIFIED_HOSTNAMES];
821
1419
  const ENDPOINT_SCHEME_PATTERN = /^[a-z][a-z0-9+.-]*:\/\//i;
1420
+ const TRAILING_SLASHES = /\/+$/;
822
1421
 
823
1422
  const RETRYABLE_STATUSES = new Set(RETRY.STATUSES);
824
1423
  const RETRYABLE_METHODS = new Set(RETRY.METHODS);
825
1424
 
826
- ({
827
- scopes: [API_SCOPES.KEYS_MANAGE]});
828
-
829
- ({
830
- scopes: [API_SCOPES.KEYS_MANAGE]});
831
-
832
- ({
833
- scopes: [API_SCOPES.KEYS_READ]});
834
-
835
- ({
836
- scopes: [API_SCOPES.KEYS_READ]});
837
-
838
- ({
839
- scopes: [API_SCOPES.KEYS_READ]});
840
-
841
- ({
842
- scopes: [API_SCOPES.KEYS_READ]});
843
-
844
- ({
845
- scopes: [API_SCOPES.KEYS_READ]});
846
-
847
- ({
1425
+ const API_PATHS = {
1426
+ PING: '/ping',
1427
+ LANGUAGES: '/languages',
1428
+ EMAILS: '/emails',
1429
+ EMAILS_BATCH: '/emails/batch',
1430
+ EMAILS_TRANSLATE: '/emails/translate',
1431
+ EMAILS_CHECK: '/emails/check',
1432
+ EMAILS_COMPOSE: '/emails/compose',
1433
+ EMAILS_REWRITE: '/emails/rewrite',
1434
+ EMAILS_SUBJECT: '/emails/subject',
1435
+ EMAIL: '/emails/:id',
1436
+ EMAIL_CANCEL: '/emails/:id/cancel',
1437
+ EMAIL_EVENTS: '/emails/:id/events',
1438
+ EMAIL_TRACKING: '/emails/:id/tracking',
1439
+ TRACKING: '/tracking',
1440
+ TRACKING_STATS: '/tracking/stats',
1441
+ TRACKED: '/tracking/:id',
1442
+ TRACKED_OPENS: '/tracking/:id/opens',
1443
+ TRACKED_CLICKS: '/tracking/:id/clicks',
1444
+ TEMPLATES: '/templates',
1445
+ TEMPLATE_FONTS: '/templates/fonts',
1446
+ TEMPLATE_STARTERS: '/templates/starters',
1447
+ TEMPLATE_STARTER: '/templates/starters/:slug',
1448
+ TEMPLATE_RENDER: '/templates/render',
1449
+ TEMPLATE_IMAGES: '/templates/images',
1450
+ TEMPLATES_DESIGN: '/templates/design',
1451
+ TEMPLATE_REDESIGN: '/templates/:id/redesign',
1452
+ TEMPLATE: '/templates/:id',
1453
+ TEMPLATE_DUPLICATE: '/templates/:id/duplicate',
1454
+ TEMPLATE_CONTENT: '/templates/:id/content',
1455
+ TEMPLATE_VERSIONS: '/templates/:id/versions',
1456
+ TEMPLATE_VERSION: '/templates/:id/versions/:version',
1457
+ TEMPLATE_VERSION_RESTORE: '/templates/:id/versions/:version/restore',
1458
+ TEMPLATE_PREVIEW: '/templates/:id/preview',
1459
+ TEMPLATE_ANALYTICS: '/templates/:id/analytics',
1460
+ TEMPLATE_SENDS: '/templates/:id/sends',
1461
+ TEMPLATE_SEND: '/templates/:id/send',
1462
+ RULES: '/rules',
1463
+ RULE_RUNS: '/rules/runs',
1464
+ RULES_REORDER: '/rules/reorder',
1465
+ RULE: '/rules/:id',
1466
+ RULE_TEST: '/rules/:id/test',
1467
+ THREADS: '/threads',
1468
+ THREAD: '/threads/:id',
1469
+ THREAD_TRASH: '/threads/:id/trash',
1470
+ THREAD_SNOOZE: '/threads/:id/snooze',
1471
+ THREAD_UNSNOOZE: '/threads/:id/unsnooze',
1472
+ THREAD_MESSAGE_ATTACHMENTS: '/threads/:id/messages/:messageId/attachments',
1473
+ THREADS_COUNTS: '/threads/counts',
1474
+ THREAD_RESTORE: '/threads/:id/restore',
1475
+ THREAD_SUMMARY: '/threads/:id/summary',
1476
+ THREAD_REPLY_SUGGESTIONS: '/threads/:id/reply-suggestions',
1477
+ THREAD_EVENT: '/threads/:id/event',
1478
+ THREAD_NOTES: '/threads/:id/notes',
1479
+ THREAD_NOTES_REORDER: '/threads/:id/notes/reorder',
1480
+ THREAD_NOTE: '/threads/:id/notes/:noteId',
1481
+ THREAD_UNSUBSCRIBE: '/threads/:id/unsubscribe',
1482
+ DRAFTS: '/drafts',
1483
+ DRAFT: '/drafts/:id',
1484
+ LABELS: '/labels',
1485
+ LABEL_COLORS: '/labels/colors',
1486
+ LABEL: '/labels/:id',
1487
+ CONTACTS: '/contacts',
1488
+ CONTACTS_PEOPLE: '/contacts/people',
1489
+ CONTACTS_BATCH_DELETE: '/contacts/batch-delete',
1490
+ CONTACT_CARDS: '/contacts/cards',
1491
+ CONTACT_CARD: '/contacts/cards/:id',
1492
+ CONTACT: '/contacts/:email',
1493
+ CONTACT_PHOTO: '/contacts/:email/photo',
1494
+ CONTACT_BLOCK: '/contacts/:email/block',
1495
+ CONTACT_THREADS: '/contacts/:email/threads',
1496
+ CONTACT_ACTIVITY: '/contacts/:email/activity',
1497
+ CONTACT_AUDIENCES: '/contacts/:email/audiences',
1498
+ AUDIENCES: '/audiences',
1499
+ AUDIENCES_GROWTH: '/audiences/growth',
1500
+ AUDIENCE: '/audiences/:id',
1501
+ AUDIENCE_CONTACTS: '/audiences/:id/contacts',
1502
+ AUDIENCE_CONTACT: '/audiences/:id/contacts/:email',
1503
+ AUDIENCE_CONTACTS_BATCH: '/audiences/:id/contacts/batch',
1504
+ AUDIENCE_CONTACTS_BATCH_REMOVE: '/audiences/:id/contacts/batch-remove',
1505
+ AUDIENCE_IMPORT: '/audiences/:id/import',
1506
+ AUDIENCE_EMPTY: '/audiences/:id/empty',
1507
+ FORMS: '/forms',
1508
+ FORM_STARTERS: '/forms/starters',
1509
+ FORM_STARTER: '/forms/starters/:slug',
1510
+ FORM: '/forms/:id',
1511
+ FORM_PUBLISH: '/forms/:id/publish',
1512
+ FORM_PAUSE: '/forms/:id/pause',
1513
+ FORM_RESUME: '/forms/:id/resume',
1514
+ FORM_DUPLICATE: '/forms/:id/duplicate',
1515
+ FORM_ANALYTICS: '/forms/:id/analytics',
1516
+ FORM_SUBMISSIONS: '/forms/:id/submissions',
1517
+ FORM_SUBMISSIONS_BATCH_REMOVE: '/forms/:id/submissions/batch-remove',
1518
+ FORM_SUBMISSION: '/forms/:id/submissions/:submissionId',
1519
+ FORM_SUBMISSION_APPROVE: '/forms/:id/submissions/:submissionId/approve',
1520
+ FORM_SUBMISSION_RESEND: '/forms/:id/submissions/:submissionId/resend',
1521
+ FORMS_DESIGN: '/forms/design',
1522
+ FORM_REDESIGN: '/forms/:id/redesign',
1523
+ BROADCASTS: '/broadcasts',
1524
+ BROADCASTS_PREVIEW: '/broadcasts/preview',
1525
+ BROADCASTS_ANALYTICS: '/broadcasts/analytics',
1526
+ BROADCAST: '/broadcasts/:id',
1527
+ BROADCAST_RECIPIENTS: '/broadcasts/:id/recipients',
1528
+ BROADCAST_RECIPIENT: '/broadcasts/:id/recipients/:emailId',
1529
+ BROADCAST_STATS: '/broadcasts/:id/stats',
1530
+ BROADCAST_CANCEL: '/broadcasts/:id/cancel',
1531
+ DOMAINS: '/domains',
1532
+ DOMAIN: '/domains/:id',
1533
+ DOMAIN_VERIFY: '/domains/:id/verify',
1534
+ DOMAIN_LOGO: '/domains/:id/logo',
1535
+ DOMAIN_LOGO_CERTIFICATE: '/domains/:id/logo/certificate',
1536
+ DOMAIN_ADDRESSES: '/domains/:id/addresses',
1537
+ DOMAIN_ADDRESS: '/domains/:id/addresses/:addressId',
1538
+ DOMAIN_ADDRESS_PHOTO: '/domains/:id/addresses/:addressId/photo',
1539
+ DOMAIN_ADDRESS_FORWARDS: '/domains/:id/addresses/:addressId/forwards',
1540
+ DOMAIN_ADDRESS_FORWARD: '/domains/:id/addresses/:addressId/forwards/:forwardId',
1541
+ DOMAIN_ADDRESS_FORWARD_RESEND: '/domains/:id/addresses/:addressId/forwards/:forwardId/resend',
1542
+ DOMAIN_ADDRESS_MEMBERS: '/domains/:id/addresses/:addressId/members',
1543
+ DOMAIN_ADDRESS_LOGIN: '/domains/:id/addresses/:addressId/login',
1544
+ DOMAIN_ADDRESS_MAIL_APPS: '/domains/:id/addresses/:addressId/mail-apps',
1545
+ DOMAIN_ADDRESS_APP_PASSWORDS: '/domains/:id/addresses/:addressId/app-passwords',
1546
+ DOMAIN_ADDRESS_APP_PASSWORD: '/domains/:id/addresses/:addressId/app-passwords/:passwordId',
1547
+ DOMAIN_ADDRESS_MAIL_APP_SETUP: '/domains/:id/addresses/:addressId/mail-app-setup',
1548
+ DOMAIN_DNS: '/domains/:id/dns',
1549
+ DOMAIN_DNS_SYNC: '/domains/:id/dns/sync',
1550
+ DNS_CONNECTIONS: '/dns-connections',
1551
+ DNS_CONNECTION: '/dns-connections/:id',
1552
+ APP_HOST: '/app-host',
1553
+ APP_HOST_VERIFY: '/app-host/verify',
1554
+ BRANDING: '/branding',
1555
+ BRANDING_IMAGE: '/branding/images/:variant',
1556
+ ADDRESSES: '/addresses',
1557
+ WEBHOOKS: '/webhooks',
1558
+ WEBHOOKS_DELIVERIES: '/webhooks/deliveries',
1559
+ WEBHOOKS_ACTIVITY: '/webhooks/activity',
1560
+ WEBHOOKS_EVENTS: '/webhooks/events',
1561
+ WEBHOOKS_STATS: '/webhooks/stats',
1562
+ WEBHOOK: '/webhooks/:id',
1563
+ WEBHOOK_ROTATE_SECRET: '/webhooks/:id/rotate-secret',
1564
+ WEBHOOK_TEST: '/webhooks/:id/test',
1565
+ WEBHOOK_DELIVERIES: '/webhooks/:id/deliveries',
1566
+ WEBHOOK_DELIVERY: '/webhooks/:id/deliveries/:deliveryId',
1567
+ WEBHOOK_DELIVERY_REPLAY: '/webhooks/:id/deliveries/:deliveryId/replay',
1568
+ WEBHOOK_ACTIVITY: '/webhooks/:id/activity',
1569
+ IMPORTS: '/imports',
1570
+ IMPORT: '/imports/:id',
1571
+ IMPORT_UPLOAD: '/imports/:id/upload',
1572
+ IMPORT_FILE_CHUNK: '/imports/:id/files/:file/chunks/:chunk',
1573
+ IMPORT_START: '/imports/:id/start',
1574
+ IMPORT_CANCEL: '/imports/:id/cancel',
1575
+ IMPORT_FAILURES: '/imports/:id/failures',
1576
+ PROVIDER_IMPORTS: '/provider-imports',
1577
+ PROVIDER_IMPORTS_INSPECT: '/provider-imports/inspect',
1578
+ PROVIDER_IMPORT: '/provider-imports/:id',
1579
+ PROVIDER_IMPORT_CANCEL: '/provider-imports/:id/cancel',
1580
+ CALENDAR_EVENTS: '/calendar/events',
1581
+ CALENDAR_EVENT: '/calendar/events/:id',
1582
+ CALENDAR_EVENT_ICS: '/calendar/events/:id/ics',
1583
+ CALENDAR_EVENT_CANCEL: '/calendar/events/:id/cancel',
1584
+ CALENDAR_EVENT_RESPOND: '/calendar/events/:id/respond',
1585
+ CALENDAR_EVENT_DECLINE_PROPOSAL: '/calendar/events/:id/decline-proposal',
1586
+ CALENDAR_FEEDS: '/calendar/feeds',
1587
+ CALENDAR_FEED: '/calendar/feeds/:id',
1588
+ CALENDAR_FEED_RESET: '/calendar/feeds/:id/reset',
1589
+ CALENDAR_SUBSCRIPTIONS: '/calendar/subscriptions',
1590
+ CALENDAR_SUBSCRIPTION: '/calendar/subscriptions/:id',
1591
+ CALENDAR_SUBSCRIPTION_REFRESH: '/calendar/subscriptions/:id/refresh',
1592
+ SETTINGS: '/settings',
1593
+ ROLES: '/roles',
1594
+ ROLE_PERMISSIONS: '/roles/permissions',
1595
+ ROLE: '/roles/:id',
1596
+ MEMBERS: '/members',
1597
+ MEMBER: '/members/:userId',
1598
+ MEMBER_ADDRESSES: '/members/:userId/addresses',
1599
+ MEMBER_ADDRESS: '/members/:userId/addresses/:addressId',
1600
+ MEMBER_DOMAINS: '/members/:userId/domains',
1601
+ MEMBER_DOMAIN: '/members/:userId/domains/:domainId',
1602
+ MEMBER_INVITATIONS: '/members/invitations',
1603
+ MEMBER_INVITATION: '/members/invitations/:invitationId',
1604
+ MEMBER_INVITATION_RESEND: '/members/invitations/:invitationId/resend',
1605
+ KEYS: '/keys',
1606
+ KEYS_REQUESTS: '/keys/requests',
1607
+ KEYS_ACTIVITY: '/keys/activity',
1608
+ KEYS_STATS: '/keys/stats',
1609
+ KEY_SELF: '/keys/self',
1610
+ KEY_SELF_ROTATE: '/keys/self/rotate',
1611
+ KEY: '/keys/:id',
1612
+ KEY_ROTATE: '/keys/:id/rotate',
1613
+ KEY_REVOKE: '/keys/:id/revoke',
1614
+ KEY_REQUESTS: '/keys/:id/requests',
1615
+ KEY_ACTIVITY: '/keys/:id/activity',
1616
+ SUPPRESSIONS: '/suppressions',
1617
+ SUPPRESSION: '/suppressions/:id',
1618
+ FILES: '/files',
1619
+ FILES_STATS: '/files/stats',
1620
+ FILES_BATCH_DELETE: '/files/batch-delete',
1621
+ FILE: '/files/:id',
1622
+ FILE_CONTENT: '/files/:id/content',
1623
+ FILE_LINKS: '/files/:id/links',
1624
+ FILE_LINK: '/files/:id/links/:linkId',
1625
+ KNOWLEDGE: '/knowledge',
1626
+ KNOWLEDGE_LEVELS: '/knowledge/levels',
1627
+ KNOWLEDGE_USAGE: '/knowledge/usage',
1628
+ KNOWLEDGE_SEARCH: '/knowledge/search',
1629
+ KNOWLEDGE_NOTES: '/knowledge/notes',
1630
+ KNOWLEDGE_LINKS: '/knowledge/links',
1631
+ KNOWLEDGE_FILES: '/knowledge/files',
1632
+ KNOWLEDGE_ITEM: '/knowledge/:id',
1633
+ KNOWLEDGE_ITEM_REFRESH: '/knowledge/:id/refresh',
1634
+ KNOWLEDGE_SUGGESTIONS: '/knowledge/suggestions',
1635
+ KNOWLEDGE_SUGGESTION_ACCEPT: '/knowledge/suggestions/:id/accept',
1636
+ KNOWLEDGE_SUGGESTION_DISMISS: '/knowledge/suggestions/:id/dismiss',
1637
+ KNOWLEDGE_FLAGS: '/knowledge/flags',
1638
+ KNOWLEDGE_FLAG_DISMISS: '/knowledge/flags/:id/dismiss',
1639
+ KNOWLEDGE_CONNECTORS: '/knowledge/connectors',
1640
+ KNOWLEDGE_CONNECTOR: '/knowledge/connectors/:id',
1641
+ KNOWLEDGE_CONNECTOR_SYNC: '/knowledge/connectors/:id/sync',
1642
+ KNOWLEDGE_DRAFTS: '/knowledge/drafts',
1643
+ KNOWLEDGE_STATS: '/knowledge/stats',
1644
+ SECURITY_STEP_UP: '/security/step-up',
1645
+ SECURITY_STEP_UP_VERIFY: '/security/step-up/verify',
1646
+ SENDER: '/senders/:email',
1647
+ SENDER_RESEARCH: '/senders/:email/research',
1648
+ ANALYTICS_MAILBOX: '/analytics/mailbox',
1649
+ ANALYTICS_SENDING: '/analytics/sending',
1650
+ CHATS: '/chats',
1651
+ CHAT: '/chats/:id',
1652
+ MAILBOX_EXPORTS: '/exports',
1653
+ MAILBOX_EXPORTS_PREVIEW: '/exports/preview',
1654
+ MAILBOX_EXPORT: '/exports/:id',
1655
+ MAILBOX_EXPORT_CONTENT: '/exports/:id/content',
1656
+ ENCRYPTION_KEYS: '/encryption/keys',
1657
+ ENCRYPTION_KEYS_LOOKUP: '/encryption/keys/lookup',
1658
+ BILLING: '/billing',
1659
+ BILLING_PLANS: '/billing/plans',
1660
+ BILLING_USAGE: '/billing/usage',
1661
+ BILLING_ALERTS: '/billing/alerts',
1662
+ BILLING_COUNTRIES: '/billing/countries',
1663
+ BILLING_PAY_AS_YOU_GO: '/billing/pay-as-you-go',
1664
+ BILLING_PAY_AS_YOU_GO_LIMIT: '/billing/pay-as-you-go/limit',
1665
+ BILLING_PAY_AS_YOU_GO_CONFIRM: '/billing/pay-as-you-go/confirm',
1666
+ BILLING_CHECKOUT: '/billing/checkout',
1667
+ BILLING_PORTAL: '/billing/portal',
1668
+ BILLING_INVOICES: '/billing/invoices',
1669
+ BILLING_INVOICE: '/billing/invoices/:orderId',
1670
+ BILLING_INVOICE_DETAILS: '/billing/invoices/:orderId/details',
1671
+ SUPPORT: '/support',
1672
+ TOOLS_DMARC: '/tools/dmarc',
1673
+ TOOLS_BIMI: '/tools/bimi',
1674
+ TOOLS_DELIVERABILITY: '/tools/deliverability',
1675
+ TOOLS_VERIFICATION_CODE: '/tools/verification-code',
1676
+ TOOLS_COST: '/tools/cost',
1677
+ SUBSCRIPTIONS: '/subscriptions',
1678
+ SUBSCRIPTION_UNSUBSCRIBE: '/subscriptions/:id/unsubscribe',
1679
+ SUBSCRIPTION_MOVE: '/subscriptions/:id/move',
1680
+ SUBSCRIPTION_DOMAINS: '/subscriptions/domains',
1681
+ SUBSCRIPTION_DOMAIN_UNSUBSCRIBE: '/subscriptions/domains/:domain/unsubscribe',
1682
+ WORKSPACES: '/workspaces',
1683
+ WORKSPACES_ACTIVE: '/workspaces/active',
1684
+ WORKSPACE: '/workspaces/:id',
1685
+ ACCOUNT_NOTIFICATIONS: '/account/notifications',
1686
+ ACCOUNT_NOTIFICATION_EMAIL: '/account/notifications/email/:category',
1687
+ ACCOUNT_NOTIFICATION_PUSH: '/account/notifications/push/:workspaceId',
1688
+ ACCOUNT_PHOTO: '/account/photo',
1689
+ ACCOUNT_USERNAME: '/account/username',
1690
+ ACCOUNT_USERNAME_AVAILABILITY: '/account/username/availability',
1691
+ ACCOUNT_CONNECTED_APPS: '/account/connected-apps',
1692
+ ACCOUNT_CONNECTED_APP: '/account/connected-apps/:clientId',
1693
+ ACCOUNT_INVITATIONS: '/account/invitations',
1694
+ ACCOUNT_INVITATION_ACCEPT: '/account/invitations/:invitationId/accept',
1695
+ ACCOUNT_INVITATION_DECLINE: '/account/invitations/:invitationId/decline',
1696
+ TEMP_MAIL_DOMAINS: '/temp-mail/domains',
1697
+ TEMP_MAIL_INBOXES: '/temp-mail/inboxes',
1698
+ TEMP_MAIL_INBOX: '/temp-mail/inboxes/:id',
1699
+ TEMP_MAIL_INBOX_EXTEND: '/temp-mail/inboxes/:id/extend',
1700
+ TEMP_MAIL_MESSAGES: '/temp-mail/inboxes/:id/messages',
1701
+ TEMP_MAIL_MESSAGE: '/temp-mail/inboxes/:id/messages/:messageId',
1702
+ TEMP_MAIL_MESSAGE_ATTACHMENTS: '/temp-mail/inboxes/:id/messages/:messageId/attachments',
1703
+ SUBSCRIBE_FORM: '/subscribe/:formId'};
1704
+
1705
+ const PATH_PARAM = /:([A-Za-z0-9_]+)(?:\{[^}]*\})?/g;
1706
+ const OPTIONAL_PATH_PARAM = /\/:([A-Za-z0-9_]+)\?/g;
1707
+ const fillPath = (pattern, params) => {
1708
+ const values = params;
1709
+ return pattern
1710
+ .replace(OPTIONAL_PATH_PARAM, (_, name) => {
1711
+ const value = values[name];
1712
+ return value === undefined || value === '' ? '' : `/${encodeURIComponent(String(value))}`;
1713
+ })
1714
+ .replace(PATH_PARAM, (_, name) => encodeURIComponent(String(values[name] ?? '')));
1715
+ };
1716
+
1717
+ ({
1718
+ scopes: [API_SCOPES.KEYS_MANAGE]});
1719
+
1720
+ ({
1721
+ scopes: [API_SCOPES.KEYS_MANAGE]});
1722
+
1723
+ ({
1724
+ scopes: [API_SCOPES.KEYS_READ]});
1725
+
1726
+ ({
1727
+ scopes: [API_SCOPES.KEYS_READ]});
1728
+
1729
+ ({
1730
+ scopes: [API_SCOPES.KEYS_READ]});
1731
+
1732
+ ({
1733
+ scopes: [API_SCOPES.KEYS_READ]});
1734
+
1735
+ ({
1736
+ scopes: [API_SCOPES.KEYS_READ]});
1737
+
1738
+ ({
848
1739
  scopes: [API_SCOPES.KEYS_READ]});
849
1740
 
850
1741
  ({
@@ -972,8 +1863,10 @@ class OpenEmailApiError extends Error {
972
1863
  docUrl;
973
1864
  requestId;
974
1865
  retryAfterSeconds;
1866
+ fields;
1867
+ body;
975
1868
  constructor(props) {
976
- const { message, status, type, code, param, docUrl, requestId, retryAfterSeconds } = props;
1869
+ const { message, status, type, code, param, docUrl, requestId, retryAfterSeconds, fields, body } = props;
977
1870
  super(message);
978
1871
  this.name = ERROR_NAMES.API;
979
1872
  this.status = status;
@@ -983,6 +1876,8 @@ class OpenEmailApiError extends Error {
983
1876
  this.docUrl = docUrl;
984
1877
  this.requestId = requestId;
985
1878
  this.retryAfterSeconds = retryAfterSeconds;
1879
+ this.fields = fields;
1880
+ this.body = body;
986
1881
  }
987
1882
  get isAuth() {
988
1883
  return this.type === ERROR_TYPES.AUTHENTICATION_ERROR;
@@ -1032,7 +1927,7 @@ class OpenEmailNetworkError extends Error {
1032
1927
  let checked = false;
1033
1928
  const Parts = (value) => value
1034
1929
  .trim()
1035
- .replace(/^v/, '')
1930
+ .replace(VERSION_TAG_PREFIX, '')
1036
1931
  .split('.')
1037
1932
  .map(part => Number.parseInt(part, 10));
1038
1933
  const IsNewer = (candidate, current) => {
@@ -1095,20 +1990,18 @@ const Backoff = (attempt) => {
1095
1990
  return Math.round(ceiling * (0.5 + Math.random() * 0.5));
1096
1991
  };
1097
1992
 
1098
- const PATH_SHAPE = 'is not a usable request path. Pass a path on the API that begins with a single "/", such as "/threads". Anything else could send the request, and the credential it carries, to another host.';
1099
- const OFF_ORIGIN = 'leaves the API origin, so the request was not sent. Pass a path on the API that begins with a single "/", such as "/threads".';
1100
1993
  const ApiUrl = (baseUrl, path) => {
1101
1994
  if (typeof path !== 'string' || !path.startsWith('/') || path.startsWith('//') || path.startsWith('/\\')) {
1102
- throw new Error(`${JSON.stringify(path)} ${PATH_SHAPE}`);
1995
+ throw new Error(`${JSON.stringify(path)} ${CLIENT_MESSAGES.PATH_SHAPE}`);
1103
1996
  }
1104
- const url = `${baseUrl.replace(/\/+$/, '')}${path}`;
1997
+ const url = `${baseUrl.replace(TRAILING_SLASHES, '')}${path}`;
1105
1998
  let origin = null;
1106
1999
  try {
1107
2000
  origin = new URL(url).origin;
1108
2001
  }
1109
2002
  catch { }
1110
2003
  if (origin === null || origin !== new URL(baseUrl).origin)
1111
- throw new Error(`${JSON.stringify(path)} ${OFF_ORIGIN}`);
2004
+ throw new Error(`${JSON.stringify(path)} ${CLIENT_MESSAGES.OFF_ORIGIN}`);
1112
2005
  return url;
1113
2006
  };
1114
2007
 
@@ -1226,6 +2119,11 @@ const ReadPayload = (body) => {
1226
2119
  return typeof error === 'object' && error !== null ? error : {};
1227
2120
  };
1228
2121
  const Text = (value) => typeof value === 'string' && value.length > 0 ? value : undefined;
2122
+ const IsFieldProblem = (value) => typeof value === 'object'
2123
+ && value !== null
2124
+ && typeof value.key === 'string'
2125
+ && typeof value.error === 'string';
2126
+ const Fields = (value) => Array.isArray(value) ? value.filter(IsFieldProblem) : undefined;
1229
2127
  const ToErrorProps = (response, body, rawText, retryAfterSeconds) => {
1230
2128
  const payload = ReadPayload(body);
1231
2129
  return {
@@ -1237,14 +2135,16 @@ const ToErrorProps = (response, body, rawText, retryAfterSeconds) => {
1237
2135
  param: Text(payload.param),
1238
2136
  docUrl: Text(payload.docUrl),
1239
2137
  requestId: Text(payload.requestId) ?? response.headers.get(HEADER_KEYS.REQUEST_ID) ?? undefined,
1240
- retryAfterSeconds
2138
+ retryAfterSeconds,
2139
+ fields: Fields(payload.fields),
2140
+ body
1241
2141
  };
1242
2142
  };
1243
2143
 
1244
2144
  const Substitute = (url) => {
1245
2145
  const suggestion = new URL(url.href);
1246
2146
  suggestion.hostname = url.hostname.startsWith('[') ? LOOPBACK_IPV6_ADDRESS : LOOPBACK_IPV4_ADDRESS;
1247
- return suggestion.href.replace(/\/+$/, '');
2147
+ return suggestion.href.replace(TRAILING_SLASHES, '');
1248
2148
  };
1249
2149
  const UnspecifiedHostMessage = (baseUrl, url) => `${JSON.stringify(baseUrl)} names ${url.hostname}, an address a server listens on, not one to send requests to. For a server on this machine, use ${Substitute(url)}.`;
1250
2150
 
@@ -1269,7 +2169,7 @@ const ParseBaseUrl = (value) => {
1269
2169
  }
1270
2170
  };
1271
2171
  const ValidBaseUrl = (value) => {
1272
- const trimmed = value.trim().replace(/\/+$/, '');
2172
+ const trimmed = value.trim().replace(TRAILING_SLASHES, '');
1273
2173
  const parsed = ParseBaseUrl(trimmed);
1274
2174
  if (!parsed)
1275
2175
  throw new Error(`${JSON.stringify(value)} ${CLIENT_MESSAGES.BASE_URL_SHAPE}`);
@@ -1465,75 +2365,9 @@ const FetchList = async (transport, path, options = {}, query) => {
1465
2365
  return (payload?.data ?? []);
1466
2366
  };
1467
2367
 
1468
- const Segment = (value) => {
1469
- if (typeof value !== 'string' || value.length === 0)
1470
- throw new Error(CLIENT_MESSAGES.EMPTY_SEGMENT);
1471
- if (/^\.+$/.test(value))
1472
- throw new Error(`${JSON.stringify(value)} ${CLIENT_MESSAGES.DOT_SEGMENT}`);
1473
- return encodeURIComponent(value);
1474
- };
1475
- const EmailPath = (id) => `${PATHS.EMAILS}/${Segment(id)}`;
1476
- const EmailChildPath = (id, segment) => `${EmailPath(id)}/${segment}`;
1477
- const ThreadPath = (id) => `${PATHS.THREADS}/${Segment(id)}`;
1478
- const ThreadChildPath = (id, segment) => `${ThreadPath(id)}/${segment}`;
1479
- const ThreadMessageAttachmentsPath = (id, messageId) => `${ThreadPath(id)}/${SEGMENTS.MESSAGES}/${Segment(messageId)}/${SEGMENTS.ATTACHMENTS}`;
1480
- const DraftPath = (id) => `${PATHS.DRAFTS}/${Segment(id)}`;
1481
- const LabelPath = (id) => `${PATHS.LABELS}/${Segment(id)}`;
1482
- const ContactPath = (email) => `${PATHS.CONTACTS}/${Segment(email)}`;
1483
- const ContactChildPath = (email, segment) => `${ContactPath(email)}/${segment}`;
1484
- const AudiencePath = (id) => `${PATHS.AUDIENCES}/${Segment(id)}`;
1485
- const AudienceChildPath = (id, segment) => `${AudiencePath(id)}/${segment}`;
1486
- const AudienceContactsPath = (id) => `${AudiencePath(id)}/${SEGMENTS.CONTACTS}`;
1487
- const AudienceContactsChildPath = (id, segment) => `${AudienceContactsPath(id)}/${segment}`;
1488
- const AudienceContactPath = (id, email) => `${AudienceContactsPath(id)}/${Segment(email)}`;
1489
- const BroadcastPath = (id) => `${PATHS.BROADCASTS}/${Segment(id)}`;
1490
- const BroadcastChildPath = (id, segment) => `${BroadcastPath(id)}/${segment}`;
1491
- const BroadcastRecipientPath = (id, emailId) => `${BroadcastChildPath(id, SEGMENTS.RECIPIENTS)}/${Segment(emailId)}`;
1492
- const DomainPath = (id) => `${PATHS.DOMAINS}/${Segment(id)}`;
1493
- const DomainChildPath = (id, segment) => `${DomainPath(id)}/${segment}`;
1494
- const DomainAddressesPath = (id) => `${DomainPath(id)}/${SEGMENTS.ADDRESSES}`;
1495
- const DomainAddressPath = (id, addressId) => `${DomainAddressesPath(id)}/${Segment(addressId)}`;
1496
- const WebhookPath = (id) => `${PATHS.WEBHOOKS}/${Segment(id)}`;
1497
- const WebhookChildPath = (id, segment) => `${WebhookPath(id)}/${segment}`;
1498
- const WebhookDeliveryPath = (id, deliveryId) => `${WebhookChildPath(id, SEGMENTS.DELIVERIES)}/${Segment(deliveryId)}`;
1499
- const WebhookDeliveryReplayPath = (id, deliveryId) => `${WebhookDeliveryPath(id, deliveryId)}/${SEGMENTS.REPLAY}`;
1500
- const KeyPath = (id) => `${PATHS.KEYS}/${Segment(id)}`;
1501
- const KeyChildPath = (id, segment) => `${KeyPath(id)}/${segment}`;
1502
- const ImportPath = (id) => `${PATHS.IMPORTS}/${Segment(id)}`;
1503
- const ProviderImportPath = (id) => `${PATHS.PROVIDER_IMPORTS}/${Segment(id)}`;
1504
- const ProviderImportChildPath = (id, segment) => `${ProviderImportPath(id)}/${segment}`;
1505
- const ImportChildPath = (id, segment) => `${ImportPath(id)}/${segment}`;
1506
- const ImportChunkPath = (id, file, chunk) => `${ImportPath(id)}/${SEGMENTS.FILES}/${Segment(String(file))}/${SEGMENTS.CHUNKS}/${Segment(String(chunk))}`;
1507
- const TemplatePath = (idOrSlug) => `${PATHS.TEMPLATES}/${Segment(idOrSlug)}`;
1508
- const TemplateChildPath = (idOrSlug, segment) => `${TemplatePath(idOrSlug)}/${segment}`;
1509
- const TemplateStarterPath = (slug) => `${PATHS.TEMPLATES_STARTERS}/${Segment(slug)}`;
1510
- const TemplateVersionPath = (idOrSlug, version) => `${TemplateChildPath(idOrSlug, SEGMENTS.VERSIONS)}/${Segment(String(version))}`;
1511
- const TemplateVersionChildPath = (idOrSlug, version, segment) => `${TemplateVersionPath(idOrSlug, version)}/${segment}`;
1512
- const RulePath = (id) => `${PATHS.RULES}/${Segment(id)}`;
1513
- const RuleChildPath = (id, segment) => `${RulePath(id)}/${segment}`;
1514
- const TrackingPath = (id) => `${PATHS.TRACKING}/${Segment(id)}`;
1515
- const TrackingChildPath = (id, segment) => `${TrackingPath(id)}/${segment}`;
1516
- const CalendarEventPath = (id) => `${PATHS.CALENDAR_EVENTS}/${Segment(id)}`;
1517
- const CalendarEventIcsPath = (id) => `${CalendarEventPath(id)}/${SEGMENTS.ICS}`;
1518
- const RolePath = (id) => `${PATHS.ROLES}/${Segment(id)}`;
1519
- const MemberPath = (userId) => `${PATHS.MEMBERS}/${Segment(userId)}`;
1520
- const MemberAddressesPath = (userId) => `${MemberPath(userId)}/${SEGMENTS.ADDRESSES}`;
1521
- const MemberAddressPath = (userId, addressId) => `${MemberAddressesPath(userId)}/${Segment(addressId)}`;
1522
- const MemberInvitationPath = (id) => `${PATHS.MEMBERS_INVITATIONS}/${Segment(id)}`;
1523
- const MemberInvitationResendPath = (id) => `${MemberInvitationPath(id)}/${SEGMENTS.RESEND}`;
1524
- const SuppressionPath = (id) => `${PATHS.SUPPRESSIONS}/${Segment(id)}`;
1525
- const FilePath = (id) => `${PATHS.FILES}/${Segment(id)}`;
1526
- const FileChildPath = (id, segment) => `${FilePath(id)}/${segment}`;
1527
- const FileLinkPath = (id, linkId) => `${FileChildPath(id, SEGMENTS.LINKS)}/${Segment(linkId)}`;
1528
- const TempInboxPath = (id) => `${PATHS.TEMP_MAIL_INBOXES}/${Segment(id)}`;
1529
- const TempInboxExtendPath = (id) => `${TempInboxPath(id)}/${SEGMENTS.EXTEND}`;
1530
- const TempMessagesPath = (id) => `${TempInboxPath(id)}/${SEGMENTS.MESSAGES}`;
1531
- const TempMessagePath = (id, messageId) => `${TempMessagesPath(id)}/${Segment(messageId)}`;
1532
- const TempMessageAttachmentsPath = (id, messageId) => `${TempMessagePath(id, messageId)}/${SEGMENTS.ATTACHMENTS}`;
1533
-
1534
2368
  const Addresses = (transport) => {
1535
2369
  const page = async (options = {}) => {
1536
- const envelope = await transport.request(PATHS.ADDRESSES, {
2370
+ const envelope = await transport.request(API_PATHS.ADDRESSES, {
1537
2371
  query: { [QUERY_KEYS.LIMIT]: options.limit, [CURSOR_STYLES.CURSOR.PARAM]: options.cursor },
1538
2372
  signal: options.signal,
1539
2373
  apiKey: options.apiKey
@@ -1550,18 +2384,56 @@ const Addresses = (transport) => {
1550
2384
  return {
1551
2385
  list: page,
1552
2386
  listAll: async (options = {}) => {
2387
+ let cursor = options.cursor;
1553
2388
  let current = await page(options);
1554
2389
  const addresses = [...current.addresses];
1555
- while (current.hasMore && current.nextCursor) {
1556
- current = await page({ ...options, cursor: current.nextCursor });
2390
+ while (current.hasMore && current.nextCursor && current.nextCursor !== cursor) {
2391
+ cursor = current.nextCursor;
2392
+ current = await page({ ...options, cursor });
1557
2393
  addresses.push(...current.addresses);
1558
2394
  }
1559
2395
  return { unrestricted: current.unrestricted, addresses, domains: current.domains };
1560
2396
  },
1561
- iterate: (options = {}) => IteratePages(transport, PATHS.ADDRESSES, CURSOR_STYLES.CURSOR, options)
2397
+ iterate: (options = {}) => IteratePages(transport, API_PATHS.ADDRESSES, CURSOR_STYLES.CURSOR, options)
1562
2398
  };
1563
2399
  };
1564
2400
 
2401
+ const AppHost = (transport) => ({
2402
+ get: (options = {}) => transport.request(API_PATHS.APP_HOST, { signal: options.signal, apiKey: options.apiKey }),
2403
+ set: (body, options = {}) => transport.request(API_PATHS.APP_HOST, {
2404
+ method: HTTP_METHODS.PUT,
2405
+ body,
2406
+ repeatable: true,
2407
+ signal: options.signal,
2408
+ apiKey: options.apiKey
2409
+ }),
2410
+ verify: (options = {}) => transport.request(API_PATHS.APP_HOST_VERIFY, {
2411
+ method: HTTP_METHODS.POST,
2412
+ repeatable: true,
2413
+ signal: options.signal,
2414
+ apiKey: options.apiKey
2415
+ }),
2416
+ delete: (options = {}) => transport.request(API_PATHS.APP_HOST, {
2417
+ method: HTTP_METHODS.DELETE,
2418
+ repeatable: true,
2419
+ signal: options.signal,
2420
+ apiKey: options.apiKey
2421
+ })
2422
+ });
2423
+
2424
+ const AssertSegment = (value) => {
2425
+ if ((typeof value !== 'string' && typeof value !== 'number') || String(value).length === 0)
2426
+ throw new Error(CLIENT_MESSAGES.EMPTY_SEGMENT);
2427
+ if (DOT_ONLY_SEGMENT.test(String(value)))
2428
+ throw new Error(`${JSON.stringify(String(value))} ${CLIENT_MESSAGES.DOT_SEGMENT}`);
2429
+ };
2430
+ const RequestPath = (pattern, params) => {
2431
+ const values = params;
2432
+ for (const [, name] of pattern.matchAll(PATH_PARAM))
2433
+ AssertSegment(values[name]);
2434
+ return fillPath(pattern, params);
2435
+ };
2436
+
1565
2437
  const MemberQuery = (options) => ({
1566
2438
  [QUERY_KEYS.Q]: options.q,
1567
2439
  [QUERY_KEYS.SOURCE]: options.source,
@@ -1576,70 +2448,162 @@ const GrowthQuery = (options) => ({
1576
2448
  [QUERY_KEYS.OFFSET_MINUTES]: options.offsetMinutes
1577
2449
  });
1578
2450
  const Audiences = (transport) => ({
1579
- list: (options = {}) => FetchPage(transport, PATHS.AUDIENCES, CURSOR_STYLES.CURSOR, options),
1580
- listAll: (options = {}) => CollectAll(transport, PATHS.AUDIENCES, CURSOR_STYLES.CURSOR, options),
1581
- iterate: (options = {}) => IteratePages(transport, PATHS.AUDIENCES, CURSOR_STYLES.CURSOR, options),
1582
- growth: (options = {}) => transport.request(PATHS.AUDIENCES_GROWTH, {
2451
+ list: (options = {}) => FetchPage(transport, API_PATHS.AUDIENCES, CURSOR_STYLES.CURSOR, options),
2452
+ listAll: (options = {}) => CollectAll(transport, API_PATHS.AUDIENCES, CURSOR_STYLES.CURSOR, options),
2453
+ iterate: (options = {}) => IteratePages(transport, API_PATHS.AUDIENCES, CURSOR_STYLES.CURSOR, options),
2454
+ growth: (options = {}) => transport.request(API_PATHS.AUDIENCES_GROWTH, {
1583
2455
  query: GrowthQuery(options),
1584
2456
  signal: options.signal,
1585
2457
  apiKey: options.apiKey
1586
2458
  }),
1587
- get: (id, options = {}) => transport.request(AudiencePath(id), { signal: options.signal, apiKey: options.apiKey }),
1588
- create: (body, options = {}) => transport.request(PATHS.AUDIENCES, {
2459
+ get: (id, options = {}) => transport.request(RequestPath(API_PATHS.AUDIENCE, { id }), { signal: options.signal, apiKey: options.apiKey }),
2460
+ create: (body, options = {}) => transport.request(API_PATHS.AUDIENCES, {
1589
2461
  method: HTTP_METHODS.POST,
1590
2462
  body,
1591
2463
  signal: options.signal,
1592
2464
  apiKey: options.apiKey
1593
2465
  }),
1594
- update: (id, patch, options = {}) => transport.request(AudiencePath(id), {
2466
+ update: (id, patch, options = {}) => transport.request(RequestPath(API_PATHS.AUDIENCE, { id }), {
1595
2467
  method: HTTP_METHODS.PATCH,
1596
2468
  body: patch,
1597
2469
  repeatable: true,
1598
2470
  signal: options.signal,
1599
2471
  apiKey: options.apiKey
1600
2472
  }),
1601
- delete: (id, options = {}) => transport.request(AudiencePath(id), {
2473
+ delete: (id, options = {}) => transport.request(RequestPath(API_PATHS.AUDIENCE, { id }), {
1602
2474
  method: HTTP_METHODS.DELETE,
1603
2475
  signal: options.signal,
1604
2476
  apiKey: options.apiKey
1605
2477
  }),
1606
- empty: (id, options = {}) => transport.request(AudienceChildPath(id, SEGMENTS.EMPTY), {
2478
+ empty: (id, options = {}) => transport.request(RequestPath(API_PATHS.AUDIENCE_EMPTY, { id }), {
1607
2479
  method: HTTP_METHODS.POST,
1608
2480
  signal: options.signal,
1609
2481
  apiKey: options.apiKey
1610
2482
  }),
1611
- listContacts: (id, options = {}) => FetchPage(transport, AudienceContactsPath(id), CURSOR_STYLES.CURSOR, options, MemberQuery(options)),
1612
- listAllContacts: (id, options = {}) => CollectAll(transport, AudienceContactsPath(id), CURSOR_STYLES.CURSOR, options, MemberQuery(options)),
1613
- iterateContacts: (id, options = {}) => IteratePages(transport, AudienceContactsPath(id), CURSOR_STYLES.CURSOR, options, MemberQuery(options)),
1614
- addContact: (id, body, options = {}) => transport.request(AudienceContactsPath(id), {
2483
+ listContacts: (id, options = {}) => FetchPage(transport, RequestPath(API_PATHS.AUDIENCE_CONTACTS, { id }), CURSOR_STYLES.CURSOR, options, MemberQuery(options)),
2484
+ listAllContacts: (id, options = {}) => CollectAll(transport, RequestPath(API_PATHS.AUDIENCE_CONTACTS, { id }), CURSOR_STYLES.CURSOR, options, MemberQuery(options)),
2485
+ iterateContacts: (id, options = {}) => IteratePages(transport, RequestPath(API_PATHS.AUDIENCE_CONTACTS, { id }), CURSOR_STYLES.CURSOR, options, MemberQuery(options)),
2486
+ addContact: (id, body, options = {}) => transport.request(RequestPath(API_PATHS.AUDIENCE_CONTACTS, { id }), {
1615
2487
  method: HTTP_METHODS.POST,
1616
2488
  body,
1617
2489
  repeatable: true,
1618
2490
  signal: options.signal,
1619
2491
  apiKey: options.apiKey
1620
2492
  }),
1621
- removeContact: (id, email, options = {}) => transport.request(AudienceContactPath(id, email), {
2493
+ removeContact: (id, email, options = {}) => transport.request(RequestPath(API_PATHS.AUDIENCE_CONTACT, { id, email }), {
1622
2494
  method: HTTP_METHODS.DELETE,
1623
2495
  signal: options.signal,
1624
2496
  apiKey: options.apiKey
1625
2497
  }),
1626
- addContacts: (id, body, options = {}) => transport.request(AudienceContactsChildPath(id, SEGMENTS.BATCH), {
2498
+ addContacts: (id, body, options = {}) => transport.request(RequestPath(API_PATHS.AUDIENCE_CONTACTS_BATCH, { id }), {
2499
+ method: HTTP_METHODS.POST,
2500
+ body,
2501
+ repeatable: true,
2502
+ signal: options.signal,
2503
+ apiKey: options.apiKey
2504
+ }),
2505
+ removeContacts: (id, body, options = {}) => transport.request(RequestPath(API_PATHS.AUDIENCE_CONTACTS_BATCH_REMOVE, { id }), {
1627
2506
  method: HTTP_METHODS.POST,
1628
2507
  body,
1629
2508
  repeatable: true,
1630
2509
  signal: options.signal,
1631
2510
  apiKey: options.apiKey
1632
2511
  }),
1633
- removeContacts: (id, body, options = {}) => transport.request(AudienceContactsChildPath(id, SEGMENTS.BATCH_REMOVE), {
2512
+ importContacts: (id, body, options = {}) => transport.request(RequestPath(API_PATHS.AUDIENCE_IMPORT, { id }), {
1634
2513
  method: HTTP_METHODS.POST,
1635
2514
  body,
1636
2515
  repeatable: true,
1637
2516
  signal: options.signal,
1638
2517
  apiKey: options.apiKey
2518
+ })
2519
+ });
2520
+
2521
+ const Billing = (transport) => ({
2522
+ get: (options = {}) => transport.request(API_PATHS.BILLING, { signal: options.signal, apiKey: options.apiKey }),
2523
+ listPlans: (options = {}) => transport.request(API_PATHS.BILLING_PLANS, { signal: options.signal, apiKey: options.apiKey }),
2524
+ getUsage: (options = {}) => transport.request(API_PATHS.BILLING_USAGE, {
2525
+ query: { [QUERY_KEYS.DAYS]: options.days },
2526
+ signal: options.signal,
2527
+ apiKey: options.apiKey
2528
+ }),
2529
+ listAlerts: (options = {}) => transport.request(API_PATHS.BILLING_ALERTS, { signal: options.signal, apiKey: options.apiKey }),
2530
+ listCountries: (options = {}) => transport.request(API_PATHS.BILLING_COUNTRIES, { signal: options.signal, apiKey: options.apiKey }),
2531
+ getPayAsYouGo: (options = {}) => transport.request(API_PATHS.BILLING_PAY_AS_YOU_GO, { signal: options.signal, apiKey: options.apiKey }),
2532
+ setPayAsYouGo: (body, options = {}) => transport.request(API_PATHS.BILLING_PAY_AS_YOU_GO, {
2533
+ method: HTTP_METHODS.PATCH,
2534
+ body,
2535
+ signal: options.signal,
2536
+ apiKey: options.apiKey
2537
+ }),
2538
+ setPayAsYouGoLimit: (body, options = {}) => transport.request(API_PATHS.BILLING_PAY_AS_YOU_GO_LIMIT, {
2539
+ method: HTTP_METHODS.PUT,
2540
+ body,
2541
+ signal: options.signal,
2542
+ apiKey: options.apiKey
2543
+ }),
2544
+ confirmPayAsYouGo: (options = {}) => transport.request(API_PATHS.BILLING_PAY_AS_YOU_GO_CONFIRM, {
2545
+ method: HTTP_METHODS.POST,
2546
+ signal: options.signal,
2547
+ apiKey: options.apiKey
2548
+ }),
2549
+ startCheckout: (body, options = {}) => transport.request(API_PATHS.BILLING_CHECKOUT, {
2550
+ method: HTTP_METHODS.POST,
2551
+ body,
2552
+ signal: options.signal,
2553
+ apiKey: options.apiKey
1639
2554
  }),
1640
- importContacts: (id, body, options = {}) => transport.request(AudienceChildPath(id, SEGMENTS.IMPORT), {
2555
+ openPortal: (body = {}, options = {}) => transport.request(API_PATHS.BILLING_PORTAL, {
1641
2556
  method: HTTP_METHODS.POST,
1642
2557
  body,
2558
+ signal: options.signal,
2559
+ apiKey: options.apiKey
2560
+ }),
2561
+ listInvoices: (options = {}) => transport.request(API_PATHS.BILLING_INVOICES, {
2562
+ query: {
2563
+ [QUERY_KEYS.PAGE]: options.page,
2564
+ [QUERY_KEYS.LIMIT]: options.limit,
2565
+ [QUERY_KEYS.SORT]: options.sort,
2566
+ [QUERY_KEYS.SEARCH]: options.search
2567
+ },
2568
+ signal: options.signal,
2569
+ apiKey: options.apiKey
2570
+ }),
2571
+ getInvoice: (orderId, options = {}) => transport.request(RequestPath(API_PATHS.BILLING_INVOICE, { orderId }), {
2572
+ signal: options.signal,
2573
+ apiKey: options.apiKey
2574
+ }),
2575
+ saveInvoiceDetails: (orderId, body, options = {}) => transport.request(RequestPath(API_PATHS.BILLING_INVOICE_DETAILS, { orderId }), {
2576
+ method: HTTP_METHODS.PUT,
2577
+ body,
2578
+ signal: options.signal,
2579
+ apiKey: options.apiKey
2580
+ })
2581
+ });
2582
+
2583
+ const ImageType = (data, options) => {
2584
+ if (options.contentType)
2585
+ return options.contentType;
2586
+ return typeof Blob !== 'undefined' && data instanceof Blob && data.type ? data.type : undefined;
2587
+ };
2588
+ const Branding = (transport) => ({
2589
+ get: (options = {}) => transport.request(API_PATHS.BRANDING, { signal: options.signal, apiKey: options.apiKey }),
2590
+ update: (body, options = {}) => transport.request(API_PATHS.BRANDING, {
2591
+ method: HTTP_METHODS.PATCH,
2592
+ body,
2593
+ repeatable: true,
2594
+ signal: options.signal,
2595
+ apiKey: options.apiKey
2596
+ }),
2597
+ uploadImage: (variant, data, options = {}) => transport.request(RequestPath(API_PATHS.BRANDING_IMAGE, { variant }), {
2598
+ method: HTTP_METHODS.PUT,
2599
+ raw: data,
2600
+ contentType: ImageType(data, options),
2601
+ repeatable: true,
2602
+ signal: options.signal,
2603
+ apiKey: options.apiKey
2604
+ }),
2605
+ removeImage: (variant, options = {}) => transport.request(RequestPath(API_PATHS.BRANDING_IMAGE, { variant }), {
2606
+ method: HTTP_METHODS.DELETE,
1643
2607
  repeatable: true,
1644
2608
  signal: options.signal,
1645
2609
  apiKey: options.apiKey
@@ -1683,25 +2647,39 @@ const TemplateSendToWire = (body) => ({
1683
2647
  bcc: Many(body.bcc),
1684
2648
  scheduledAt: Instant(body.scheduledAt)
1685
2649
  });
2650
+ const EmailUpdateToWire = (patch) => ({
2651
+ ...patch,
2652
+ to: Many(patch.to),
2653
+ cc: Many(patch.cc),
2654
+ bcc: Many(patch.bcc),
2655
+ scheduledAt: Instant(patch.scheduledAt)
2656
+ });
1686
2657
  const ToInstant = Instant;
1687
2658
 
1688
- const ListQuery$a = (options) => ({
2659
+ const ListQuery$d = (options) => ({
1689
2660
  [QUERY_KEYS.AUDIENCE_ID]: options.audienceId
1690
2661
  });
1691
2662
  const RecipientQuery = (options) => ({
1692
2663
  [QUERY_KEYS.FILTER]: options.filter,
1693
2664
  [QUERY_KEYS.Q]: options.q
1694
2665
  });
1695
- const RecipientsPath = (id) => BroadcastChildPath(id, SEGMENTS.RECIPIENTS);
2666
+ const RecipientsPath = (id) => RequestPath(API_PATHS.BROADCAST_RECIPIENTS, { id });
2667
+ const AnalyticsQuery = (options) => ({
2668
+ [QUERY_KEYS.BROADCAST_IDS]: options.broadcastIds?.join(LIST_SEPARATOR),
2669
+ [QUERY_KEYS.DAYS]: options.days,
2670
+ [QUERY_KEYS.MINUTES]: options.minutes,
2671
+ [QUERY_KEYS.GRAIN]: options.grain,
2672
+ [QUERY_KEYS.OFFSET_MINUTES]: options.offsetMinutes
2673
+ });
1696
2674
  const Broadcasts = (transport) => ({
1697
- preview: (body, options = {}) => transport.request(PATHS.BROADCASTS_PREVIEW, {
2675
+ preview: (body, options = {}) => transport.request(API_PATHS.BROADCASTS_PREVIEW, {
1698
2676
  method: HTTP_METHODS.POST,
1699
2677
  body: { audienceIds: body.audienceIds },
1700
2678
  repeatable: true,
1701
2679
  signal: options.signal,
1702
2680
  apiKey: options.apiKey
1703
2681
  }),
1704
- send: (body, options = {}) => transport.request(PATHS.BROADCASTS, {
2682
+ send: (body, options = {}) => transport.request(API_PATHS.BROADCASTS, {
1705
2683
  method: HTTP_METHODS.POST,
1706
2684
  body: { ...body, scheduledAt: ToInstant(body.scheduledAt) },
1707
2685
  idempotent: true,
@@ -1710,26 +2688,33 @@ const Broadcasts = (transport) => ({
1710
2688
  signal: options.signal,
1711
2689
  apiKey: options.apiKey
1712
2690
  }),
1713
- list: (options = {}) => FetchPage(transport, PATHS.BROADCASTS, CURSOR_STYLES.CURSOR, options, ListQuery$a(options)),
1714
- listAll: (options = {}) => CollectAll(transport, PATHS.BROADCASTS, CURSOR_STYLES.CURSOR, options, ListQuery$a(options)),
1715
- iterate: (options = {}) => IteratePages(transport, PATHS.BROADCASTS, CURSOR_STYLES.CURSOR, options, ListQuery$a(options)),
1716
- get: (id, options = {}) => transport.request(BroadcastPath(id), { signal: options.signal, apiKey: options.apiKey }),
2691
+ list: (options = {}) => FetchPage(transport, API_PATHS.BROADCASTS, CURSOR_STYLES.CURSOR, options, ListQuery$d(options)),
2692
+ listAll: (options = {}) => CollectAll(transport, API_PATHS.BROADCASTS, CURSOR_STYLES.CURSOR, options, ListQuery$d(options)),
2693
+ iterate: (options = {}) => IteratePages(transport, API_PATHS.BROADCASTS, CURSOR_STYLES.CURSOR, options, ListQuery$d(options)),
2694
+ get: (id, options = {}) => transport.request(RequestPath(API_PATHS.BROADCAST, { id }), { signal: options.signal, apiKey: options.apiKey }),
1717
2695
  listRecipients: (id, options = {}) => FetchPage(transport, RecipientsPath(id), CURSOR_STYLES.CURSOR, options, RecipientQuery(options)),
1718
2696
  listAllRecipients: (id, options = {}) => CollectAll(transport, RecipientsPath(id), CURSOR_STYLES.CURSOR, options, RecipientQuery(options)),
1719
2697
  iterateRecipients: (id, options = {}) => IteratePages(transport, RecipientsPath(id), CURSOR_STYLES.CURSOR, options, RecipientQuery(options)),
1720
- getRecipient: (id, emailId, options = {}) => transport.request(BroadcastRecipientPath(id, emailId), {
2698
+ getRecipient: (id, emailId, options = {}) => transport.request(RequestPath(API_PATHS.BROADCAST_RECIPIENT, { id, emailId }), {
1721
2699
  signal: options.signal,
1722
2700
  apiKey: options.apiKey
1723
2701
  }),
1724
- stats: (id, options = {}) => transport.request(BroadcastChildPath(id, SEGMENTS.STATS), {
2702
+ stats: (id, options = {}) => transport.request(RequestPath(API_PATHS.BROADCAST_STATS, { id }), {
1725
2703
  query: {
1726
2704
  [QUERY_KEYS.GRAIN]: options.grain,
1727
- [QUERY_KEYS.OFFSET_MINUTES]: options.offsetMinutes
2705
+ [QUERY_KEYS.OFFSET_MINUTES]: options.offsetMinutes,
2706
+ [QUERY_KEYS.DAYS]: options.days,
2707
+ [QUERY_KEYS.MINUTES]: options.minutes
1728
2708
  },
1729
2709
  signal: options.signal,
1730
2710
  apiKey: options.apiKey
1731
2711
  }),
1732
- cancel: (id, options = {}) => transport.request(BroadcastChildPath(id, SEGMENTS.CANCEL), {
2712
+ analytics: (options = {}) => transport.request(API_PATHS.BROADCASTS_ANALYTICS, {
2713
+ query: AnalyticsQuery(options),
2714
+ signal: options.signal,
2715
+ apiKey: options.apiKey
2716
+ }),
2717
+ cancel: (id, options = {}) => transport.request(RequestPath(API_PATHS.BROADCAST_CANCEL, { id }), {
1733
2718
  method: HTTP_METHODS.POST,
1734
2719
  repeatable: true,
1735
2720
  signal: options.signal,
@@ -1742,22 +2727,111 @@ const RangeQuery = (options) => ({
1742
2727
  [QUERY_KEYS.TO]: ToInstant(options.to),
1743
2728
  [QUERY_KEYS.TIMEZONE]: options.timezone
1744
2729
  });
2730
+ const EventWire = (body) => ({
2731
+ ...body,
2732
+ start: ToInstant(body.start),
2733
+ end: ToInstant(body.end)
2734
+ });
2735
+ const AnswerWire = (body) => ({
2736
+ ...body,
2737
+ ...(body.proposedStart !== undefined ? { proposedStart: ToInstant(body.proposedStart) } : {}),
2738
+ ...(body.proposedEnd !== undefined ? { proposedEnd: ToInstant(body.proposedEnd) } : {})
2739
+ });
1745
2740
  const Calendar = (transport) => ({
1746
- listEvents: (options) => FetchPage(transport, PATHS.CALENDAR_EVENTS, CURSOR_STYLES.CURSOR, options, RangeQuery(options)),
1747
- listAllEvents: (options) => CollectAll(transport, PATHS.CALENDAR_EVENTS, CURSOR_STYLES.CURSOR, options, RangeQuery(options)),
1748
- iterateEvents: (options) => IteratePages(transport, PATHS.CALENDAR_EVENTS, CURSOR_STYLES.CURSOR, options, RangeQuery(options)),
1749
- getEvent: (id, options = {}) => transport.request(CalendarEventPath(id), { signal: options.signal, apiKey: options.apiKey }),
1750
- getEventIcs: (id, options = {}) => transport.request(CalendarEventIcsPath(id), {
2741
+ listEvents: (options) => FetchPage(transport, API_PATHS.CALENDAR_EVENTS, CURSOR_STYLES.CURSOR, options, RangeQuery(options)),
2742
+ listAllEvents: (options) => CollectAll(transport, API_PATHS.CALENDAR_EVENTS, CURSOR_STYLES.CURSOR, options, RangeQuery(options)),
2743
+ iterateEvents: (options) => IteratePages(transport, API_PATHS.CALENDAR_EVENTS, CURSOR_STYLES.CURSOR, options, RangeQuery(options)),
2744
+ getEvent: (id, options = {}) => transport.request(RequestPath(API_PATHS.CALENDAR_EVENT, { id }), { signal: options.signal, apiKey: options.apiKey }),
2745
+ getEventIcs: (id, options = {}) => transport.request(RequestPath(API_PATHS.CALENDAR_EVENT_ICS, { id }), {
1751
2746
  accept: CONTENT_TYPES.CALENDAR,
1752
2747
  signal: options.signal,
1753
2748
  apiKey: options.apiKey
2749
+ }),
2750
+ createEvent: (body, options = {}) => transport.request(API_PATHS.CALENDAR_EVENTS, {
2751
+ method: HTTP_METHODS.POST,
2752
+ body: EventWire(body),
2753
+ signal: options.signal,
2754
+ apiKey: options.apiKey
2755
+ }),
2756
+ updateEvent: (id, patch, options = {}) => transport.request(RequestPath(API_PATHS.CALENDAR_EVENT, { id }), {
2757
+ method: HTTP_METHODS.PATCH,
2758
+ body: EventWire(patch),
2759
+ signal: options.signal,
2760
+ apiKey: options.apiKey
2761
+ }),
2762
+ deleteEvent: (id, options = {}) => transport.request(RequestPath(API_PATHS.CALENDAR_EVENT, { id }), {
2763
+ method: HTTP_METHODS.DELETE,
2764
+ signal: options.signal,
2765
+ apiKey: options.apiKey
2766
+ }),
2767
+ cancelEvent: (id, body = {}, options = {}) => transport.request(RequestPath(API_PATHS.CALENDAR_EVENT_CANCEL, { id }), {
2768
+ method: HTTP_METHODS.POST,
2769
+ body,
2770
+ signal: options.signal,
2771
+ apiKey: options.apiKey
2772
+ }),
2773
+ respondToEvent: (id, body, options = {}) => transport.request(RequestPath(API_PATHS.CALENDAR_EVENT_RESPOND, { id }), {
2774
+ method: HTTP_METHODS.POST,
2775
+ body: AnswerWire(body),
2776
+ signal: options.signal,
2777
+ apiKey: options.apiKey
2778
+ }),
2779
+ declineProposal: (id, body, options = {}) => transport.request(RequestPath(API_PATHS.CALENDAR_EVENT_DECLINE_PROPOSAL, { id }), {
2780
+ method: HTTP_METHODS.POST,
2781
+ body,
2782
+ signal: options.signal,
2783
+ apiKey: options.apiKey
2784
+ }),
2785
+ listFeeds: (options = {}) => FetchList(transport, API_PATHS.CALENDAR_FEEDS, options),
2786
+ createFeed: (body, options = {}) => transport.request(API_PATHS.CALENDAR_FEEDS, {
2787
+ method: HTTP_METHODS.POST,
2788
+ body,
2789
+ signal: options.signal,
2790
+ apiKey: options.apiKey
2791
+ }),
2792
+ resetFeed: (id, options = {}) => transport.request(RequestPath(API_PATHS.CALENDAR_FEED_RESET, { id }), {
2793
+ method: HTTP_METHODS.POST,
2794
+ signal: options.signal,
2795
+ apiKey: options.apiKey
2796
+ }),
2797
+ deleteFeed: (id, options = {}) => transport.request(RequestPath(API_PATHS.CALENDAR_FEED, { id }), {
2798
+ method: HTTP_METHODS.DELETE,
2799
+ signal: options.signal,
2800
+ apiKey: options.apiKey
2801
+ }),
2802
+ listSubscriptions: (options = {}) => FetchList(transport, API_PATHS.CALENDAR_SUBSCRIPTIONS, options),
2803
+ createSubscription: (body, options = {}) => transport.request(API_PATHS.CALENDAR_SUBSCRIPTIONS, {
2804
+ method: HTTP_METHODS.POST,
2805
+ body,
2806
+ signal: options.signal,
2807
+ apiKey: options.apiKey
2808
+ }),
2809
+ updateSubscription: (id, patch, options = {}) => transport.request(RequestPath(API_PATHS.CALENDAR_SUBSCRIPTION, { id }), {
2810
+ method: HTTP_METHODS.PATCH,
2811
+ body: patch,
2812
+ signal: options.signal,
2813
+ apiKey: options.apiKey
2814
+ }),
2815
+ refreshSubscription: (id, options = {}) => transport.request(RequestPath(API_PATHS.CALENDAR_SUBSCRIPTION_REFRESH, { id }), {
2816
+ method: HTTP_METHODS.POST,
2817
+ signal: options.signal,
2818
+ apiKey: options.apiKey
2819
+ }),
2820
+ deleteSubscription: (id, options = {}) => transport.request(RequestPath(API_PATHS.CALENDAR_SUBSCRIPTION, { id }), {
2821
+ method: HTTP_METHODS.DELETE,
2822
+ signal: options.signal,
2823
+ apiKey: options.apiKey
1754
2824
  })
1755
2825
  });
1756
2826
 
1757
- const ListQuery$9 = (options) => ({
2827
+ const ListQuery$c = (options) => ({
1758
2828
  [QUERY_KEYS.SOURCE]: options.source,
1759
2829
  [QUERY_KEYS.Q]: options.q
1760
2830
  });
2831
+ const CardQuery = (options) => ({
2832
+ [QUERY_KEYS.EMAIL]: options.email,
2833
+ [QUERY_KEYS.WITHOUT_EMAIL]: options.withoutEmail === undefined ? undefined : String(options.withoutEmail)
2834
+ });
1761
2835
  const PeopleQuery = (options) => ({
1762
2836
  [QUERY_KEYS.Q]: options.q,
1763
2837
  [QUERY_KEYS.EMAIL]: options.email,
@@ -1773,35 +2847,35 @@ const ActivityQuery = (options) => ({
1773
2847
  [QUERY_KEYS.GRAIN]: options.grain,
1774
2848
  [QUERY_KEYS.OFFSET_MINUTES]: options.offsetMinutes
1775
2849
  });
1776
- const PhotoType = (data, options) => {
2850
+ const PhotoType$2 = (data, options) => {
1777
2851
  if (options.contentType)
1778
2852
  return options.contentType;
1779
2853
  return typeof Blob !== 'undefined' && data instanceof Blob && data.type ? data.type : undefined;
1780
2854
  };
1781
2855
  const Contacts = (transport) => ({
1782
- list: (options = {}) => FetchPage(transport, PATHS.CONTACTS, CURSOR_STYLES.CURSOR, options, ListQuery$9(options)),
1783
- listAll: (options = {}) => CollectAll(transport, PATHS.CONTACTS, CURSOR_STYLES.CURSOR, options, ListQuery$9(options)),
1784
- iterate: (options = {}) => IteratePages(transport, PATHS.CONTACTS, CURSOR_STYLES.CURSOR, options, ListQuery$9(options)),
1785
- get: (email, options = {}) => transport.request(ContactPath(email), { signal: options.signal, apiKey: options.apiKey }),
1786
- create: (body, options = {}) => transport.request(PATHS.CONTACTS, {
2856
+ list: (options = {}) => FetchPage(transport, API_PATHS.CONTACTS, CURSOR_STYLES.CURSOR, options, ListQuery$c(options)),
2857
+ listAll: (options = {}) => CollectAll(transport, API_PATHS.CONTACTS, CURSOR_STYLES.CURSOR, options, ListQuery$c(options)),
2858
+ iterate: (options = {}) => IteratePages(transport, API_PATHS.CONTACTS, CURSOR_STYLES.CURSOR, options, ListQuery$c(options)),
2859
+ get: (email, options = {}) => transport.request(RequestPath(API_PATHS.CONTACT, { email }), { signal: options.signal, apiKey: options.apiKey }),
2860
+ create: (body, options = {}) => transport.request(API_PATHS.CONTACTS, {
1787
2861
  method: HTTP_METHODS.POST,
1788
2862
  body,
1789
2863
  signal: options.signal,
1790
2864
  apiKey: options.apiKey
1791
2865
  }),
1792
- update: (email, patch, options = {}) => transport.request(ContactPath(email), {
2866
+ update: (email, patch, options = {}) => transport.request(RequestPath(API_PATHS.CONTACT, { email }), {
1793
2867
  method: HTTP_METHODS.PATCH,
1794
2868
  body: patch,
1795
2869
  repeatable: true,
1796
2870
  signal: options.signal,
1797
2871
  apiKey: options.apiKey
1798
2872
  }),
1799
- delete: (email, options = {}) => transport.request(ContactPath(email), {
2873
+ delete: (email, options = {}) => transport.request(RequestPath(API_PATHS.CONTACT, { email }), {
1800
2874
  method: HTTP_METHODS.DELETE,
1801
2875
  signal: options.signal,
1802
2876
  apiKey: options.apiKey
1803
2877
  }),
1804
- setAudiences: (email, body, options = {}) => transport.request(ContactChildPath(email, SEGMENTS.AUDIENCES), {
2878
+ setAudiences: (email, body, options = {}) => transport.request(RequestPath(API_PATHS.CONTACT_AUDIENCES, { email }), {
1805
2879
  method: HTTP_METHODS.PUT,
1806
2880
  body,
1807
2881
  repeatable: true,
@@ -1809,7 +2883,7 @@ const Contacts = (transport) => ({
1809
2883
  apiKey: options.apiKey
1810
2884
  }),
1811
2885
  listPeople: async (options = {}) => {
1812
- const payload = await transport.request(PATHS.CONTACTS_PEOPLE, {
2886
+ const payload = await transport.request(API_PATHS.CONTACTS_PEOPLE, {
1813
2887
  query: {
1814
2888
  ...PeopleQuery(options),
1815
2889
  [QUERY_KEYS.LIMIT]: options.limit,
@@ -1827,144 +2901,301 @@ const Contacts = (transport) => ({
1827
2901
  seen: payload?.seen === true
1828
2902
  };
1829
2903
  },
1830
- listAllPeople: (options = {}) => CollectAll(transport, PATHS.CONTACTS_PEOPLE, CURSOR_STYLES.CURSOR, options, PeopleQuery(options)),
1831
- iteratePeople: (options = {}) => IteratePages(transport, PATHS.CONTACTS_PEOPLE, CURSOR_STYLES.CURSOR, options, PeopleQuery(options)),
1832
- save: (email, body = {}, options = {}) => transport.request(ContactPath(email), {
2904
+ listAllPeople: (options = {}) => CollectAll(transport, API_PATHS.CONTACTS_PEOPLE, CURSOR_STYLES.CURSOR, options, PeopleQuery(options)),
2905
+ iteratePeople: (options = {}) => IteratePages(transport, API_PATHS.CONTACTS_PEOPLE, CURSOR_STYLES.CURSOR, options, PeopleQuery(options)),
2906
+ save: (email, body = {}, options = {}) => transport.request(RequestPath(API_PATHS.CONTACT, { email }), {
1833
2907
  method: HTTP_METHODS.PUT,
1834
2908
  body,
1835
2909
  repeatable: true,
1836
2910
  signal: options.signal,
1837
2911
  apiKey: options.apiKey
1838
2912
  }),
1839
- deleteMany: (emails, options = {}) => transport.request(PATHS.CONTACTS_BATCH_DELETE, {
2913
+ deleteMany: (emails, options = {}) => transport.request(API_PATHS.CONTACTS_BATCH_DELETE, {
1840
2914
  method: HTTP_METHODS.POST,
1841
2915
  body: { emails },
1842
2916
  repeatable: true,
1843
2917
  signal: options.signal,
1844
2918
  apiKey: options.apiKey
1845
2919
  }),
1846
- setPhoto: (email, data, options = {}) => transport.request(ContactChildPath(email, SEGMENTS.PHOTO), {
2920
+ setPhoto: (email, data, options = {}) => transport.request(RequestPath(API_PATHS.CONTACT_PHOTO, { email }), {
1847
2921
  method: HTTP_METHODS.PUT,
1848
2922
  raw: data,
1849
- contentType: PhotoType(data, options),
2923
+ contentType: PhotoType$2(data, options),
1850
2924
  repeatable: true,
1851
2925
  signal: options.signal,
1852
2926
  apiKey: options.apiKey
1853
2927
  }),
1854
- removePhoto: (email, options = {}) => transport.request(ContactChildPath(email, SEGMENTS.PHOTO), {
2928
+ removePhoto: (email, options = {}) => transport.request(RequestPath(API_PATHS.CONTACT_PHOTO, { email }), {
1855
2929
  method: HTTP_METHODS.DELETE,
1856
2930
  repeatable: true,
1857
2931
  signal: options.signal,
1858
2932
  apiKey: options.apiKey
1859
2933
  }),
1860
- block: (email, options = {}) => transport.request(ContactChildPath(email, SEGMENTS.BLOCK), {
2934
+ block: (email, options = {}) => transport.request(RequestPath(API_PATHS.CONTACT_BLOCK, { email }), {
1861
2935
  method: HTTP_METHODS.POST,
1862
2936
  repeatable: true,
1863
2937
  signal: options.signal,
1864
2938
  apiKey: options.apiKey
1865
2939
  }),
1866
- unblock: (email, options = {}) => transport.request(ContactChildPath(email, SEGMENTS.BLOCK), {
2940
+ unblock: (email, options = {}) => transport.request(RequestPath(API_PATHS.CONTACT_BLOCK, { email }), {
1867
2941
  method: HTTP_METHODS.DELETE,
1868
2942
  repeatable: true,
1869
2943
  signal: options.signal,
1870
2944
  apiKey: options.apiKey
1871
2945
  }),
1872
- listThreads: (email, options = {}) => FetchPage(transport, ContactChildPath(email, SEGMENTS.THREADS), CURSOR_STYLES.CURSOR, options, ThreadQuery(options)),
1873
- listAllThreads: (email, options = {}) => CollectAll(transport, ContactChildPath(email, SEGMENTS.THREADS), CURSOR_STYLES.CURSOR, options, ThreadQuery(options)),
1874
- iterateThreads: (email, options = {}) => IteratePages(transport, ContactChildPath(email, SEGMENTS.THREADS), CURSOR_STYLES.CURSOR, options, ThreadQuery(options)),
1875
- activity: (email, options = {}) => transport.request(ContactChildPath(email, SEGMENTS.ACTIVITY), {
2946
+ listThreads: (email, options = {}) => FetchPage(transport, RequestPath(API_PATHS.CONTACT_THREADS, { email }), CURSOR_STYLES.CURSOR, options, ThreadQuery(options)),
2947
+ listAllThreads: (email, options = {}) => CollectAll(transport, RequestPath(API_PATHS.CONTACT_THREADS, { email }), CURSOR_STYLES.CURSOR, options, ThreadQuery(options)),
2948
+ iterateThreads: (email, options = {}) => IteratePages(transport, RequestPath(API_PATHS.CONTACT_THREADS, { email }), CURSOR_STYLES.CURSOR, options, ThreadQuery(options)),
2949
+ activity: (email, options = {}) => transport.request(RequestPath(API_PATHS.CONTACT_ACTIVITY, { email }), {
1876
2950
  query: ActivityQuery(options),
1877
2951
  signal: options.signal,
1878
2952
  apiKey: options.apiKey
2953
+ }),
2954
+ listCards: (options = {}) => FetchPage(transport, API_PATHS.CONTACT_CARDS, CURSOR_STYLES.CURSOR, options, CardQuery(options)),
2955
+ listAllCards: (options = {}) => CollectAll(transport, API_PATHS.CONTACT_CARDS, CURSOR_STYLES.CURSOR, options, CardQuery(options)),
2956
+ iterateCards: (options = {}) => IteratePages(transport, API_PATHS.CONTACT_CARDS, CURSOR_STYLES.CURSOR, options, CardQuery(options)),
2957
+ getCard: (id, options = {}) => transport.request(RequestPath(API_PATHS.CONTACT_CARD, { id }), { signal: options.signal, apiKey: options.apiKey }),
2958
+ createCard: (body, options = {}) => transport.request(API_PATHS.CONTACT_CARDS, {
2959
+ method: HTTP_METHODS.POST,
2960
+ body,
2961
+ signal: options.signal,
2962
+ apiKey: options.apiKey
2963
+ }),
2964
+ updateCard: (id, patch, options = {}) => transport.request(RequestPath(API_PATHS.CONTACT_CARD, { id }), {
2965
+ method: HTTP_METHODS.PATCH,
2966
+ body: patch,
2967
+ repeatable: true,
2968
+ signal: options.signal,
2969
+ apiKey: options.apiKey
2970
+ }),
2971
+ deleteCard: (id, options = {}) => transport.request(RequestPath(API_PATHS.CONTACT_CARD, { id }), {
2972
+ method: HTTP_METHODS.DELETE,
2973
+ signal: options.signal,
2974
+ apiKey: options.apiKey
1879
2975
  })
1880
2976
  });
1881
2977
 
2978
+ const PhotoType$1 = (data, options) => {
2979
+ if (options.contentType)
2980
+ return options.contentType;
2981
+ return typeof Blob !== 'undefined' && data instanceof Blob && data.type ? data.type : undefined;
2982
+ };
1882
2983
  const Domains = (transport) => ({
1883
- list: (options = {}) => FetchPage(transport, PATHS.DOMAINS, CURSOR_STYLES.CURSOR, options),
1884
- listAll: (options = {}) => CollectAll(transport, PATHS.DOMAINS, CURSOR_STYLES.CURSOR, options),
1885
- iterate: (options = {}) => IteratePages(transport, PATHS.DOMAINS, CURSOR_STYLES.CURSOR, options),
1886
- get: (id, options = {}) => transport.request(DomainPath(id), { signal: options.signal, apiKey: options.apiKey }),
1887
- create: (body, options = {}) => transport.request(PATHS.DOMAINS, {
2984
+ list: (options = {}) => FetchPage(transport, API_PATHS.DOMAINS, CURSOR_STYLES.CURSOR, options),
2985
+ listAll: (options = {}) => CollectAll(transport, API_PATHS.DOMAINS, CURSOR_STYLES.CURSOR, options),
2986
+ iterate: (options = {}) => IteratePages(transport, API_PATHS.DOMAINS, CURSOR_STYLES.CURSOR, options),
2987
+ get: (id, options = {}) => transport.request(RequestPath(API_PATHS.DOMAIN, { id }), { signal: options.signal, apiKey: options.apiKey }),
2988
+ create: (body, options = {}) => transport.request(API_PATHS.DOMAINS, {
1888
2989
  method: HTTP_METHODS.POST,
1889
2990
  body,
1890
2991
  signal: options.signal,
1891
2992
  apiKey: options.apiKey
1892
2993
  }),
1893
- verify: (id, options = {}) => transport.request(DomainChildPath(id, SEGMENTS.VERIFY), {
2994
+ verify: (id, options = {}) => transport.request(RequestPath(API_PATHS.DOMAIN_VERIFY, { id }), {
1894
2995
  method: HTTP_METHODS.POST,
1895
2996
  repeatable: true,
1896
2997
  signal: options.signal,
1897
2998
  apiKey: options.apiKey
1898
2999
  }),
1899
- update: (id, patch, options = {}) => transport.request(DomainPath(id), {
3000
+ update: (id, patch, options = {}) => transport.request(RequestPath(API_PATHS.DOMAIN, { id }), {
1900
3001
  method: HTTP_METHODS.PATCH,
1901
3002
  body: patch,
1902
3003
  repeatable: true,
1903
3004
  signal: options.signal,
1904
3005
  apiKey: options.apiKey
1905
3006
  }),
1906
- delete: (id, options = {}) => transport.request(DomainPath(id), {
3007
+ delete: (id, options = {}) => transport.request(RequestPath(API_PATHS.DOMAIN, { id }), {
1907
3008
  method: HTTP_METHODS.DELETE,
1908
3009
  signal: options.signal,
1909
3010
  apiKey: options.apiKey
1910
3011
  }),
1911
- listAddresses: (id, options = {}) => FetchPage(transport, DomainAddressesPath(id), CURSOR_STYLES.CURSOR, options),
1912
- listAllAddresses: (id, options = {}) => CollectAll(transport, DomainAddressesPath(id), CURSOR_STYLES.CURSOR, options),
1913
- iterateAddresses: (id, options = {}) => IteratePages(transport, DomainAddressesPath(id), CURSOR_STYLES.CURSOR, options),
1914
- createAddress: (id, body, options = {}) => transport.request(DomainAddressesPath(id), {
1915
- method: HTTP_METHODS.POST,
3012
+ getLogo: (id, options = {}) => transport.request(RequestPath(API_PATHS.DOMAIN_LOGO, { id }), { signal: options.signal, apiKey: options.apiKey }),
3013
+ setLogo: (id, body, options = {}) => transport.request(RequestPath(API_PATHS.DOMAIN_LOGO, { id }), {
3014
+ method: HTTP_METHODS.PUT,
1916
3015
  body,
1917
3016
  repeatable: true,
1918
3017
  signal: options.signal,
1919
3018
  apiKey: options.apiKey
1920
3019
  }),
1921
- getAddress: (id, addressId, options = {}) => transport.request(DomainAddressPath(id, addressId), { signal: options.signal, apiKey: options.apiKey }),
1922
- updateAddress: (id, addressId, patch, options = {}) => transport.request(DomainAddressPath(id, addressId), {
3020
+ removeLogo: (id, options = {}) => transport.request(RequestPath(API_PATHS.DOMAIN_LOGO, { id }), {
3021
+ method: HTTP_METHODS.DELETE,
3022
+ repeatable: true,
3023
+ signal: options.signal,
3024
+ apiKey: options.apiKey
3025
+ }),
3026
+ setLogoCertificate: (id, body, options = {}) => transport.request(RequestPath(API_PATHS.DOMAIN_LOGO_CERTIFICATE, { id }), {
3027
+ method: HTTP_METHODS.PUT,
3028
+ body,
3029
+ repeatable: true,
3030
+ signal: options.signal,
3031
+ apiKey: options.apiKey
3032
+ }),
3033
+ removeLogoCertificate: (id, options = {}) => transport.request(RequestPath(API_PATHS.DOMAIN_LOGO_CERTIFICATE, { id }), {
3034
+ method: HTTP_METHODS.DELETE,
3035
+ repeatable: true,
3036
+ signal: options.signal,
3037
+ apiKey: options.apiKey
3038
+ }),
3039
+ listAddresses: (id, options = {}) => FetchPage(transport, RequestPath(API_PATHS.DOMAIN_ADDRESSES, { id }), CURSOR_STYLES.CURSOR, options),
3040
+ listAllAddresses: (id, options = {}) => CollectAll(transport, RequestPath(API_PATHS.DOMAIN_ADDRESSES, { id }), CURSOR_STYLES.CURSOR, options),
3041
+ iterateAddresses: (id, options = {}) => IteratePages(transport, RequestPath(API_PATHS.DOMAIN_ADDRESSES, { id }), CURSOR_STYLES.CURSOR, options),
3042
+ createAddress: (id, body, options = {}) => transport.request(RequestPath(API_PATHS.DOMAIN_ADDRESSES, { id }), {
3043
+ method: HTTP_METHODS.POST,
3044
+ body,
3045
+ repeatable: true,
3046
+ signal: options.signal,
3047
+ apiKey: options.apiKey
3048
+ }),
3049
+ getAddress: (id, addressId, options = {}) => transport.request(RequestPath(API_PATHS.DOMAIN_ADDRESS, { id, addressId }), { signal: options.signal, apiKey: options.apiKey }),
3050
+ updateAddress: (id, addressId, patch, options = {}) => transport.request(RequestPath(API_PATHS.DOMAIN_ADDRESS, { id, addressId }), {
3051
+ method: HTTP_METHODS.PATCH,
3052
+ body: patch,
3053
+ repeatable: true,
3054
+ signal: options.signal,
3055
+ apiKey: options.apiKey
3056
+ }),
3057
+ setAddressPhoto: (id, addressId, data, options = {}) => transport.request(RequestPath(API_PATHS.DOMAIN_ADDRESS_PHOTO, { id, addressId }), {
3058
+ method: HTTP_METHODS.PUT,
3059
+ raw: data,
3060
+ contentType: PhotoType$1(data, options),
3061
+ repeatable: true,
3062
+ signal: options.signal,
3063
+ apiKey: options.apiKey
3064
+ }),
3065
+ removeAddressPhoto: (id, addressId, options = {}) => transport.request(RequestPath(API_PATHS.DOMAIN_ADDRESS_PHOTO, { id, addressId }), {
3066
+ method: HTTP_METHODS.DELETE,
3067
+ repeatable: true,
3068
+ signal: options.signal,
3069
+ apiKey: options.apiKey
3070
+ }),
3071
+ deleteAddress: (id, addressId, options = {}) => transport.request(RequestPath(API_PATHS.DOMAIN_ADDRESS, { id, addressId }), {
3072
+ method: HTTP_METHODS.DELETE,
3073
+ signal: options.signal,
3074
+ apiKey: options.apiKey
3075
+ }),
3076
+ listAddressForwards: (id, addressId, options = {}) => transport.request(RequestPath(API_PATHS.DOMAIN_ADDRESS_FORWARDS, { id, addressId }), { signal: options.signal, apiKey: options.apiKey }),
3077
+ addAddressForwards: (id, addressId, body, options = {}) => transport.request(RequestPath(API_PATHS.DOMAIN_ADDRESS_FORWARDS, { id, addressId }), {
3078
+ method: HTTP_METHODS.POST,
3079
+ body,
3080
+ signal: options.signal,
3081
+ apiKey: options.apiKey
3082
+ }),
3083
+ updateAddressForward: (id, addressId, forwardId, patch, options = {}) => transport.request(RequestPath(API_PATHS.DOMAIN_ADDRESS_FORWARD, { id, addressId, forwardId }), {
1923
3084
  method: HTTP_METHODS.PATCH,
1924
3085
  body: patch,
1925
3086
  repeatable: true,
1926
3087
  signal: options.signal,
1927
3088
  apiKey: options.apiKey
1928
3089
  }),
1929
- deleteAddress: (id, addressId, options = {}) => transport.request(DomainAddressPath(id, addressId), {
3090
+ deleteAddressForward: (id, addressId, forwardId, options = {}) => transport.request(RequestPath(API_PATHS.DOMAIN_ADDRESS_FORWARD, { id, addressId, forwardId }), {
3091
+ method: HTTP_METHODS.DELETE,
3092
+ signal: options.signal,
3093
+ apiKey: options.apiKey
3094
+ }),
3095
+ resendAddressForwardConsent: (id, addressId, forwardId, options = {}) => transport.request(RequestPath(API_PATHS.DOMAIN_ADDRESS_FORWARD_RESEND, { id, addressId, forwardId }), {
3096
+ method: HTTP_METHODS.POST,
3097
+ signal: options.signal,
3098
+ apiKey: options.apiKey
3099
+ }),
3100
+ listAddressMembers: (id, addressId, options = {}) => transport.request(RequestPath(API_PATHS.DOMAIN_ADDRESS_MEMBERS, { id, addressId }), { signal: options.signal, apiKey: options.apiKey }),
3101
+ getAddressLogin: (id, addressId, options = {}) => transport.request(RequestPath(API_PATHS.DOMAIN_ADDRESS_LOGIN, { id, addressId }), { signal: options.signal, apiKey: options.apiKey }),
3102
+ setAddressLogin: (id, addressId, body, options = {}) => transport.request(RequestPath(API_PATHS.DOMAIN_ADDRESS_LOGIN, { id, addressId }), {
3103
+ method: HTTP_METHODS.PUT,
3104
+ body,
3105
+ signal: options.signal,
3106
+ apiKey: options.apiKey
3107
+ }),
3108
+ deleteAddressLogin: (id, addressId, options = {}) => transport.request(RequestPath(API_PATHS.DOMAIN_ADDRESS_LOGIN, { id, addressId }), {
1930
3109
  method: HTTP_METHODS.DELETE,
1931
3110
  signal: options.signal,
1932
3111
  apiKey: options.apiKey
3112
+ }),
3113
+ getMailAppSettings: (id, addressId, options = {}) => transport.request(RequestPath(API_PATHS.DOMAIN_ADDRESS_MAIL_APPS, { id, addressId }), { signal: options.signal, apiKey: options.apiKey }),
3114
+ updateMailAppSettings: (id, addressId, patch, options = {}) => transport.request(RequestPath(API_PATHS.DOMAIN_ADDRESS_MAIL_APPS, { id, addressId }), {
3115
+ method: HTTP_METHODS.PATCH,
3116
+ body: patch,
3117
+ repeatable: true,
3118
+ signal: options.signal,
3119
+ apiKey: options.apiKey
3120
+ }),
3121
+ listAppPasswords: (id, addressId, options = {}) => transport.request(RequestPath(API_PATHS.DOMAIN_ADDRESS_APP_PASSWORDS, { id, addressId }), { signal: options.signal, apiKey: options.apiKey }),
3122
+ createAppPassword: (id, addressId, body, options = {}) => transport.request(RequestPath(API_PATHS.DOMAIN_ADDRESS_APP_PASSWORDS, { id, addressId }), {
3123
+ method: HTTP_METHODS.POST,
3124
+ body,
3125
+ signal: options.signal,
3126
+ apiKey: options.apiKey
3127
+ }),
3128
+ updateAppPassword: (id, addressId, passwordId, patch, options = {}) => transport.request(RequestPath(API_PATHS.DOMAIN_ADDRESS_APP_PASSWORD, { id, addressId, passwordId }), {
3129
+ method: HTTP_METHODS.PATCH,
3130
+ body: patch,
3131
+ repeatable: true,
3132
+ signal: options.signal,
3133
+ apiKey: options.apiKey
3134
+ }),
3135
+ deleteAppPassword: (id, addressId, passwordId, options = {}) => transport.request(RequestPath(API_PATHS.DOMAIN_ADDRESS_APP_PASSWORD, { id, addressId, passwordId }), {
3136
+ method: HTTP_METHODS.DELETE,
3137
+ signal: options.signal,
3138
+ apiKey: options.apiKey
3139
+ }),
3140
+ sendMailAppSetup: (id, addressId, body, options = {}) => transport.request(RequestPath(API_PATHS.DOMAIN_ADDRESS_MAIL_APP_SETUP, { id, addressId }), {
3141
+ method: HTTP_METHODS.POST,
3142
+ body,
3143
+ signal: options.signal,
3144
+ apiKey: options.apiKey
3145
+ }),
3146
+ getDns: (id, options = {}) => transport.request(RequestPath(API_PATHS.DOMAIN_DNS, { id }), {
3147
+ query: { [QUERY_KEYS.REFRESH]: options.refresh },
3148
+ signal: options.signal,
3149
+ apiKey: options.apiKey
3150
+ }),
3151
+ setDnsZone: (id, body, options = {}) => transport.request(RequestPath(API_PATHS.DOMAIN_DNS, { id }), {
3152
+ method: HTTP_METHODS.PUT,
3153
+ body,
3154
+ signal: options.signal,
3155
+ apiKey: options.apiKey
3156
+ }),
3157
+ syncDns: (id, body = {}, options = {}) => transport.request(RequestPath(API_PATHS.DOMAIN_DNS_SYNC, { id }), {
3158
+ method: HTTP_METHODS.POST,
3159
+ body,
3160
+ signal: options.signal,
3161
+ apiKey: options.apiKey
1933
3162
  })
1934
3163
  });
1935
3164
 
1936
- const ListQuery$8 = (options) => ({ [QUERY_KEYS.QUERY]: options.query });
3165
+ const ListQuery$b = (options) => ({ [QUERY_KEYS.QUERY]: options.query });
1937
3166
  const Drafts = (transport) => ({
1938
- list: (options = {}) => FetchPage(transport, PATHS.DRAFTS, CURSOR_STYLES.PAGE_TOKEN, options, ListQuery$8(options)),
1939
- listAll: (options = {}) => CollectAll(transport, PATHS.DRAFTS, CURSOR_STYLES.PAGE_TOKEN, options, ListQuery$8(options)),
1940
- iterate: (options = {}) => IteratePages(transport, PATHS.DRAFTS, CURSOR_STYLES.PAGE_TOKEN, options, ListQuery$8(options)),
1941
- get: (id, options = {}) => transport.request(DraftPath(id), { signal: options.signal, apiKey: options.apiKey }),
1942
- create: (body, options = {}) => transport.request(PATHS.DRAFTS, {
3167
+ list: (options = {}) => FetchPage(transport, API_PATHS.DRAFTS, CURSOR_STYLES.PAGE_TOKEN, options, ListQuery$b(options)),
3168
+ listAll: (options = {}) => CollectAll(transport, API_PATHS.DRAFTS, CURSOR_STYLES.PAGE_TOKEN, options, ListQuery$b(options)),
3169
+ iterate: (options = {}) => IteratePages(transport, API_PATHS.DRAFTS, CURSOR_STYLES.PAGE_TOKEN, options, ListQuery$b(options)),
3170
+ get: (id, options = {}) => transport.request(RequestPath(API_PATHS.DRAFT, { id }), { signal: options.signal, apiKey: options.apiKey }),
3171
+ create: (body, options = {}) => transport.request(API_PATHS.DRAFTS, {
1943
3172
  method: HTTP_METHODS.POST,
1944
3173
  body,
1945
3174
  signal: options.signal,
1946
3175
  apiKey: options.apiKey
1947
3176
  }),
1948
- update: (id, body, options = {}) => transport.request(DraftPath(id), {
3177
+ update: (id, body, options = {}) => transport.request(RequestPath(API_PATHS.DRAFT, { id }), {
1949
3178
  method: HTTP_METHODS.PATCH,
1950
3179
  body,
1951
3180
  signal: options.signal,
1952
3181
  apiKey: options.apiKey
1953
3182
  }),
1954
- delete: (id, options = {}) => transport.request(DraftPath(id), {
3183
+ delete: (id, options = {}) => transport.request(RequestPath(API_PATHS.DRAFT, { id }), {
1955
3184
  method: HTTP_METHODS.DELETE,
1956
3185
  signal: options.signal,
1957
3186
  apiKey: options.apiKey
1958
3187
  })
1959
3188
  });
1960
3189
 
1961
- const ListQuery$7 = (options) => ({
3190
+ const ListQuery$a = (options) => ({
1962
3191
  [QUERY_KEYS.STATUS]: Array.isArray(options.status) ? options.status.join(LIST_SEPARATOR) : options.status,
1963
3192
  [QUERY_KEYS.FROM]: options.from,
1964
- [QUERY_KEYS.BROADCAST_ID]: options.broadcastId
3193
+ [QUERY_KEYS.BROADCAST_ID]: options.broadcastId,
3194
+ [QUERY_KEYS.SCHEDULED_FROM]: options.scheduledFrom === undefined ? undefined : ToInstant(options.scheduledFrom),
3195
+ [QUERY_KEYS.SCHEDULED_TO]: options.scheduledTo === undefined ? undefined : ToInstant(options.scheduledTo)
1965
3196
  });
1966
3197
  const Emails = (transport) => ({
1967
- send: (body, options = {}) => transport.request(PATHS.EMAILS, {
3198
+ send: (body, options = {}) => transport.request(API_PATHS.EMAILS, {
1968
3199
  method: HTTP_METHODS.POST,
1969
3200
  body: EmailToWire(body),
1970
3201
  idempotent: true,
@@ -1974,7 +3205,7 @@ const Emails = (transport) => ({
1974
3205
  apiKey: options.apiKey
1975
3206
  }),
1976
3207
  sendBatch: async (emails, options = {}) => {
1977
- const result = await transport.request(PATHS.EMAILS_BATCH, {
3208
+ const result = await transport.request(API_PATHS.EMAILS_BATCH, {
1978
3209
  method: HTTP_METHODS.POST,
1979
3210
  body: { emails: emails.map(EmailToWire) },
1980
3211
  idempotent: true,
@@ -1985,44 +3216,66 @@ const Emails = (transport) => ({
1985
3216
  });
1986
3217
  return { items: result.data, sent: result.sent, failed: result.failed };
1987
3218
  },
1988
- translate: (body, options = {}) => transport.request(PATHS.EMAILS_TRANSLATE, {
3219
+ translate: (body, options = {}) => transport.request(API_PATHS.EMAILS_TRANSLATE, {
1989
3220
  method: HTTP_METHODS.POST,
1990
3221
  body,
1991
3222
  signal: options.signal,
1992
3223
  apiKey: options.apiKey
1993
3224
  }),
1994
- list: (options = {}) => FetchPage(transport, PATHS.EMAILS, CURSOR_STYLES.CURSOR, options, ListQuery$7(options)),
1995
- listAll: (options = {}) => CollectAll(transport, PATHS.EMAILS, CURSOR_STYLES.CURSOR, options, ListQuery$7(options)),
1996
- iterate: (options = {}) => IteratePages(transport, PATHS.EMAILS, CURSOR_STYLES.CURSOR, options, ListQuery$7(options)),
1997
- get: (id, options = {}) => transport.request(EmailPath(id), { signal: options.signal, apiKey: options.apiKey }),
1998
- listEvents: (id, options = {}) => FetchPage(transport, EmailChildPath(id, SEGMENTS.EVENTS), CURSOR_STYLES.CURSOR, options),
1999
- listAllEvents: (id, options = {}) => CollectAll(transport, EmailChildPath(id, SEGMENTS.EVENTS), CURSOR_STYLES.CURSOR, options),
2000
- iterateEvents: (id, options = {}) => IteratePages(transport, EmailChildPath(id, SEGMENTS.EVENTS), CURSOR_STYLES.CURSOR, options),
2001
- getTracking: (id, options = {}) => transport.request(EmailChildPath(id, SEGMENTS.TRACKING), { signal: options.signal, apiKey: options.apiKey }),
2002
- cancel: (id, options = {}) => transport.request(EmailChildPath(id, SEGMENTS.CANCEL), {
3225
+ check: (body, options = {}) => transport.request(API_PATHS.EMAILS_CHECK, {
3226
+ method: HTTP_METHODS.POST,
3227
+ body,
3228
+ signal: options.signal,
3229
+ apiKey: options.apiKey
3230
+ }),
3231
+ list: (options = {}) => FetchPage(transport, API_PATHS.EMAILS, CURSOR_STYLES.CURSOR, options, ListQuery$a(options)),
3232
+ listAll: (options = {}) => CollectAll(transport, API_PATHS.EMAILS, CURSOR_STYLES.CURSOR, options, ListQuery$a(options)),
3233
+ iterate: (options = {}) => IteratePages(transport, API_PATHS.EMAILS, CURSOR_STYLES.CURSOR, options, ListQuery$a(options)),
3234
+ get: (id, options = {}) => transport.request(RequestPath(API_PATHS.EMAIL, { id }), { signal: options.signal, apiKey: options.apiKey }),
3235
+ listEvents: (id, options = {}) => FetchPage(transport, RequestPath(API_PATHS.EMAIL_EVENTS, { id }), CURSOR_STYLES.CURSOR, options),
3236
+ listAllEvents: (id, options = {}) => CollectAll(transport, RequestPath(API_PATHS.EMAIL_EVENTS, { id }), CURSOR_STYLES.CURSOR, options),
3237
+ iterateEvents: (id, options = {}) => IteratePages(transport, RequestPath(API_PATHS.EMAIL_EVENTS, { id }), CURSOR_STYLES.CURSOR, options),
3238
+ getTracking: (id, options = {}) => transport.request(RequestPath(API_PATHS.EMAIL_TRACKING, { id }), { signal: options.signal, apiKey: options.apiKey }),
3239
+ cancel: (id, options = {}) => transport.request(RequestPath(API_PATHS.EMAIL_CANCEL, { id }), {
2003
3240
  method: HTTP_METHODS.POST,
2004
3241
  repeatable: true,
2005
3242
  signal: options.signal,
2006
3243
  apiKey: options.apiKey
2007
3244
  }),
2008
- reschedule: (id, scheduledAt, options = {}) => transport.request(EmailPath(id), {
3245
+ reschedule: (id, scheduledAt, options = {}) => transport.request(RequestPath(API_PATHS.EMAIL, { id }), {
2009
3246
  method: HTTP_METHODS.PATCH,
2010
3247
  body: { scheduledAt: ToInstant(scheduledAt) },
2011
3248
  repeatable: true,
2012
3249
  signal: options.signal,
2013
3250
  apiKey: options.apiKey
3251
+ }),
3252
+ update: (id, patch, options = {}) => transport.request(RequestPath(API_PATHS.EMAIL, { id }), {
3253
+ method: HTTP_METHODS.PATCH,
3254
+ body: EmailUpdateToWire(patch),
3255
+ repeatable: true,
3256
+ signal: options.signal,
3257
+ apiKey: options.apiKey
3258
+ }),
3259
+ compose: (body, options = {}) => transport.request(API_PATHS.EMAILS_COMPOSE, {
3260
+ method: HTTP_METHODS.POST,
3261
+ body,
3262
+ signal: options.signal,
3263
+ apiKey: options.apiKey
3264
+ }),
3265
+ rewrite: (body, options = {}) => transport.request(API_PATHS.EMAILS_REWRITE, {
3266
+ method: HTTP_METHODS.POST,
3267
+ body,
3268
+ signal: options.signal,
3269
+ apiKey: options.apiKey
3270
+ }),
3271
+ suggestSubject: (body, options = {}) => transport.request(API_PATHS.EMAILS_SUBJECT, {
3272
+ method: HTTP_METHODS.POST,
3273
+ body,
3274
+ signal: options.signal,
3275
+ apiKey: options.apiKey
2014
3276
  })
2015
3277
  });
2016
3278
 
2017
- const ListQuery$6 = (options) => ({
2018
- [QUERY_KEYS.Q]: options.q,
2019
- [QUERY_KEYS.KIND]: options.kind,
2020
- [QUERY_KEYS.DIRECTION]: options.direction,
2021
- [QUERY_KEYS.ADDRESS]: options.address,
2022
- [QUERY_KEYS.SINCE]: ToInstant(options.since),
2023
- [QUERY_KEYS.UNTIL]: ToInstant(options.until),
2024
- [QUERY_KEYS.SORT]: options.sort
2025
- });
2026
3279
  const UploadName = (options) => {
2027
3280
  const filename = typeof options?.filename === 'string' ? options.filename.trim() : '';
2028
3281
  if (!filename)
@@ -2039,33 +3292,49 @@ const UploadTimeout = (transport, options) => {
2039
3292
  return options.timeoutMs;
2040
3293
  return transport.timeoutMs > 0 ? Math.max(transport.timeoutMs, DEFAULTS.UPLOAD_TIMEOUT_MS) : transport.timeoutMs;
2041
3294
  };
3295
+
3296
+ const ListQuery$9 = (options) => ({
3297
+ [QUERY_KEYS.Q]: options.q,
3298
+ [QUERY_KEYS.KIND]: options.kind,
3299
+ [QUERY_KEYS.DIRECTION]: options.direction,
3300
+ [QUERY_KEYS.ADDRESS]: options.address,
3301
+ [QUERY_KEYS.SINCE]: ToInstant(options.since),
3302
+ [QUERY_KEYS.UNTIL]: ToInstant(options.until),
3303
+ [QUERY_KEYS.SORT]: options.sort
3304
+ });
2042
3305
  const Files = (transport) => ({
2043
- list: (options = {}) => FetchPage(transport, PATHS.FILES, CURSOR_STYLES.CURSOR, options, ListQuery$6(options)),
2044
- listAll: (options = {}) => CollectAll(transport, PATHS.FILES, CURSOR_STYLES.CURSOR, options, ListQuery$6(options)),
2045
- iterate: (options = {}) => IteratePages(transport, PATHS.FILES, CURSOR_STYLES.CURSOR, options, ListQuery$6(options)),
2046
- get: (id, options = {}) => transport.request(FilePath(id), { signal: options.signal, apiKey: options.apiKey }),
2047
- stats: (options = {}) => transport.request(PATHS.FILES_STATS, { signal: options.signal, apiKey: options.apiKey }),
2048
- download: (id, options = {}) => transport.request(FileChildPath(id, SEGMENTS.CONTENT), {
3306
+ list: (options = {}) => FetchPage(transport, API_PATHS.FILES, CURSOR_STYLES.CURSOR, options, ListQuery$9(options)),
3307
+ listAll: (options = {}) => CollectAll(transport, API_PATHS.FILES, CURSOR_STYLES.CURSOR, options, ListQuery$9(options)),
3308
+ iterate: (options = {}) => IteratePages(transport, API_PATHS.FILES, CURSOR_STYLES.CURSOR, options, ListQuery$9(options)),
3309
+ get: (id, options = {}) => transport.request(RequestPath(API_PATHS.FILE, { id }), { signal: options.signal, apiKey: options.apiKey }),
3310
+ stats: (options = {}) => transport.request(API_PATHS.FILES_STATS, { signal: options.signal, apiKey: options.apiKey }),
3311
+ download: (id, options = {}) => transport.request(RequestPath(API_PATHS.FILE_CONTENT, { id }), {
2049
3312
  binary: true,
2050
3313
  signal: options.signal,
2051
3314
  apiKey: options.apiKey
2052
3315
  }),
2053
- listLinks: (id, options = {}) => FetchPage(transport, FileChildPath(id, SEGMENTS.LINKS), CURSOR_STYLES.CURSOR, options),
2054
- listAllLinks: (id, options = {}) => CollectAll(transport, FileChildPath(id, SEGMENTS.LINKS), CURSOR_STYLES.CURSOR, options),
2055
- iterateLinks: (id, options = {}) => IteratePages(transport, FileChildPath(id, SEGMENTS.LINKS), CURSOR_STYLES.CURSOR, options),
2056
- createLink: (id, options = {}) => transport.request(FileChildPath(id, SEGMENTS.LINKS), {
3316
+ listLinks: (id, options = {}) => FetchPage(transport, RequestPath(API_PATHS.FILE_LINKS, { id }), CURSOR_STYLES.CURSOR, options),
3317
+ listAllLinks: (id, options = {}) => CollectAll(transport, RequestPath(API_PATHS.FILE_LINKS, { id }), CURSOR_STYLES.CURSOR, options),
3318
+ iterateLinks: (id, options = {}) => IteratePages(transport, RequestPath(API_PATHS.FILE_LINKS, { id }), CURSOR_STYLES.CURSOR, options),
3319
+ createLink: (id, options = {}) => transport.request(RequestPath(API_PATHS.FILE_LINKS, { id }), {
2057
3320
  method: HTTP_METHODS.POST,
2058
3321
  body: options.domain ? { domain: options.domain } : {},
2059
3322
  signal: options.signal,
2060
3323
  apiKey: options.apiKey
2061
3324
  }),
2062
- revokeLink: (id, linkId, options = {}) => transport.request(FileLinkPath(id, linkId), {
3325
+ revokeLink: (id, linkId, options = {}) => transport.request(RequestPath(API_PATHS.FILE_LINK, { id, linkId }), {
3326
+ method: HTTP_METHODS.DELETE,
3327
+ repeatable: true,
3328
+ signal: options.signal,
3329
+ apiKey: options.apiKey
3330
+ }),
3331
+ revokeAllLinks: (id, options = {}) => transport.request(RequestPath(API_PATHS.FILE_LINKS, { id }), {
2063
3332
  method: HTTP_METHODS.DELETE,
2064
3333
  repeatable: true,
2065
3334
  signal: options.signal,
2066
3335
  apiKey: options.apiKey
2067
3336
  }),
2068
- upload: (data, options) => transport.request(PATHS.FILES, {
3337
+ upload: (data, options) => transport.request(API_PATHS.FILES, {
2069
3338
  method: HTTP_METHODS.POST,
2070
3339
  query: { [QUERY_KEYS.FILENAME]: UploadName(options) },
2071
3340
  raw: data,
@@ -2074,12 +3343,12 @@ const Files = (transport) => ({
2074
3343
  signal: options.signal,
2075
3344
  apiKey: options.apiKey
2076
3345
  }),
2077
- delete: (id, options = {}) => transport.request(FilePath(id), {
3346
+ delete: (id, options = {}) => transport.request(RequestPath(API_PATHS.FILE, { id }), {
2078
3347
  method: HTTP_METHODS.DELETE,
2079
3348
  signal: options.signal,
2080
3349
  apiKey: options.apiKey
2081
3350
  }),
2082
- deleteMany: (ids, options = {}) => transport.request(PATHS.FILES_BATCH_DELETE, {
3351
+ deleteMany: (ids, options = {}) => transport.request(API_PATHS.FILES_BATCH_DELETE, {
2083
3352
  method: HTTP_METHODS.POST,
2084
3353
  body: { ids },
2085
3354
  signal: options.signal,
@@ -2087,7 +3356,116 @@ const Files = (transport) => ({
2087
3356
  })
2088
3357
  });
2089
3358
 
2090
- const ListQuery$5 = (options) => ({ addressId: options.addressId });
3359
+ const SubmissionQuery = (options) => ({
3360
+ [QUERY_KEYS.Q]: options.q,
3361
+ [QUERY_KEYS.STATUS]: options.status
3362
+ });
3363
+ const WindowQuery$3 = (options) => ({
3364
+ [QUERY_KEYS.DAYS]: options.days,
3365
+ [QUERY_KEYS.MINUTES]: options.minutes,
3366
+ [QUERY_KEYS.GRAIN]: options.grain,
3367
+ [QUERY_KEYS.OFFSET_MINUTES]: options.offsetMinutes
3368
+ });
3369
+ const Forms = (transport) => ({
3370
+ list: (options = {}) => FetchPage(transport, API_PATHS.FORMS, CURSOR_STYLES.CURSOR, options),
3371
+ listAll: (options = {}) => CollectAll(transport, API_PATHS.FORMS, CURSOR_STYLES.CURSOR, options),
3372
+ iterate: (options = {}) => IteratePages(transport, API_PATHS.FORMS, CURSOR_STYLES.CURSOR, options),
3373
+ create: (body, options = {}) => transport.request(API_PATHS.FORMS, {
3374
+ method: HTTP_METHODS.POST,
3375
+ body,
3376
+ signal: options.signal,
3377
+ apiKey: options.apiKey
3378
+ }),
3379
+ design: (body, options = {}) => transport.request(API_PATHS.FORMS_DESIGN, {
3380
+ method: HTTP_METHODS.POST,
3381
+ body,
3382
+ signal: options.signal,
3383
+ apiKey: options.apiKey
3384
+ }),
3385
+ redesign: (id, body, options = {}) => transport.request(RequestPath(API_PATHS.FORM_REDESIGN, { id }), {
3386
+ method: HTTP_METHODS.POST,
3387
+ body,
3388
+ signal: options.signal,
3389
+ apiKey: options.apiKey
3390
+ }),
3391
+ listStarters: (options = {}) => FetchList(transport, API_PATHS.FORM_STARTERS, options),
3392
+ getStarter: (slug, options = {}) => transport.request(RequestPath(API_PATHS.FORM_STARTER, { slug }), { signal: options.signal, apiKey: options.apiKey }),
3393
+ get: (id, options = {}) => transport.request(RequestPath(API_PATHS.FORM, { id }), { signal: options.signal, apiKey: options.apiKey }),
3394
+ update: (id, patch, options = {}) => transport.request(RequestPath(API_PATHS.FORM, { id }), {
3395
+ method: HTTP_METHODS.PATCH,
3396
+ body: patch,
3397
+ repeatable: true,
3398
+ signal: options.signal,
3399
+ apiKey: options.apiKey
3400
+ }),
3401
+ delete: (id, options = {}) => transport.request(RequestPath(API_PATHS.FORM, { id }), {
3402
+ method: HTTP_METHODS.DELETE,
3403
+ signal: options.signal,
3404
+ apiKey: options.apiKey
3405
+ }),
3406
+ publish: (id, options = {}) => transport.request(RequestPath(API_PATHS.FORM_PUBLISH, { id }), {
3407
+ method: HTTP_METHODS.POST,
3408
+ repeatable: true,
3409
+ signal: options.signal,
3410
+ apiKey: options.apiKey
3411
+ }),
3412
+ pause: (id, options = {}) => transport.request(RequestPath(API_PATHS.FORM_PAUSE, { id }), {
3413
+ method: HTTP_METHODS.POST,
3414
+ repeatable: true,
3415
+ signal: options.signal,
3416
+ apiKey: options.apiKey
3417
+ }),
3418
+ resume: (id, options = {}) => transport.request(RequestPath(API_PATHS.FORM_RESUME, { id }), {
3419
+ method: HTTP_METHODS.POST,
3420
+ repeatable: true,
3421
+ signal: options.signal,
3422
+ apiKey: options.apiKey
3423
+ }),
3424
+ duplicate: (id, options = {}) => transport.request(RequestPath(API_PATHS.FORM_DUPLICATE, { id }), {
3425
+ method: HTTP_METHODS.POST,
3426
+ signal: options.signal,
3427
+ apiKey: options.apiKey
3428
+ }),
3429
+ analytics: (id, options = {}) => transport.request(RequestPath(API_PATHS.FORM_ANALYTICS, { id }), {
3430
+ query: WindowQuery$3(options),
3431
+ signal: options.signal,
3432
+ apiKey: options.apiKey
3433
+ }),
3434
+ listSubmissions: (id, options = {}) => FetchPage(transport, RequestPath(API_PATHS.FORM_SUBMISSIONS, { id }), CURSOR_STYLES.CURSOR, options, SubmissionQuery(options)),
3435
+ listAllSubmissions: (id, options = {}) => CollectAll(transport, RequestPath(API_PATHS.FORM_SUBMISSIONS, { id }), CURSOR_STYLES.CURSOR, options, SubmissionQuery(options)),
3436
+ iterateSubmissions: (id, options = {}) => IteratePages(transport, RequestPath(API_PATHS.FORM_SUBMISSIONS, { id }), CURSOR_STYLES.CURSOR, options, SubmissionQuery(options)),
3437
+ getSubmission: (id, submissionId, options = {}) => transport.request(RequestPath(API_PATHS.FORM_SUBMISSION, { id, submissionId }), { signal: options.signal, apiKey: options.apiKey }),
3438
+ deleteSubmission: (id, submissionId, options = {}) => transport.request(RequestPath(API_PATHS.FORM_SUBMISSION, { id, submissionId }), {
3439
+ method: HTTP_METHODS.DELETE,
3440
+ signal: options.signal,
3441
+ apiKey: options.apiKey
3442
+ }),
3443
+ deleteSubmissions: (id, submissionIds, options = {}) => transport.request(RequestPath(API_PATHS.FORM_SUBMISSIONS_BATCH_REMOVE, { id }), {
3444
+ method: HTTP_METHODS.POST,
3445
+ body: { ids: submissionIds },
3446
+ signal: options.signal,
3447
+ apiKey: options.apiKey
3448
+ }),
3449
+ approveSubmission: (id, submissionId, options = {}) => transport.request(RequestPath(API_PATHS.FORM_SUBMISSION_APPROVE, { id, submissionId }), {
3450
+ method: HTTP_METHODS.POST,
3451
+ repeatable: true,
3452
+ signal: options.signal,
3453
+ apiKey: options.apiKey
3454
+ }),
3455
+ resendConfirmation: (id, submissionId, options = {}) => transport.request(RequestPath(API_PATHS.FORM_SUBMISSION_RESEND, { id, submissionId }), {
3456
+ method: HTTP_METHODS.POST,
3457
+ signal: options.signal,
3458
+ apiKey: options.apiKey
3459
+ }),
3460
+ subscribe: (formId, values, options = {}) => transport.request(RequestPath(API_PATHS.SUBSCRIBE_FORM, { formId }), {
3461
+ method: HTTP_METHODS.POST,
3462
+ body: values,
3463
+ anonymous: true,
3464
+ signal: options.signal
3465
+ })
3466
+ });
3467
+
3468
+ const ListQuery$8 = (options) => ({ addressId: options.addressId });
2091
3469
  const SizeOf = (data) => data instanceof Blob ? data.size : data.byteLength;
2092
3470
  const SliceOf = (data, start, end) => {
2093
3471
  if (data instanceof Blob)
@@ -2097,48 +3475,48 @@ const SliceOf = (data, start, end) => {
2097
3475
  return new Uint8Array(data, start, end - start);
2098
3476
  };
2099
3477
  const Imports = (transport) => {
2100
- const create = (body, options = {}) => transport.request(PATHS.IMPORTS, {
3478
+ const create = (body, options = {}) => transport.request(API_PATHS.IMPORTS, {
2101
3479
  method: HTTP_METHODS.POST,
2102
3480
  body,
2103
3481
  signal: options.signal,
2104
3482
  apiKey: options.apiKey
2105
3483
  });
2106
- const uploadChunk = (id, file, chunk, data, options = {}) => transport.request(ImportChunkPath(id, file, chunk), {
3484
+ const uploadChunk = (id, file, chunk, data, options = {}) => transport.request(RequestPath(API_PATHS.IMPORT_FILE_CHUNK, { id, file, chunk }), {
2107
3485
  method: HTTP_METHODS.PUT,
2108
3486
  raw: data,
2109
3487
  repeatable: true,
2110
3488
  signal: options.signal,
2111
3489
  apiKey: options.apiKey
2112
3490
  });
2113
- const start = (id, options = {}) => transport.request(ImportChildPath(id, SEGMENTS.START), {
3491
+ const start = (id, options = {}) => transport.request(RequestPath(API_PATHS.IMPORT_START, { id }), {
2114
3492
  method: HTTP_METHODS.POST,
2115
3493
  repeatable: true,
2116
3494
  signal: options.signal,
2117
3495
  apiKey: options.apiKey
2118
3496
  });
2119
3497
  return {
2120
- list: (options = {}) => FetchPage(transport, PATHS.IMPORTS, CURSOR_STYLES.CURSOR, options, ListQuery$5(options)),
2121
- listAll: (options = {}) => CollectAll(transport, PATHS.IMPORTS, CURSOR_STYLES.CURSOR, options, ListQuery$5(options)),
2122
- iterate: (options = {}) => IteratePages(transport, PATHS.IMPORTS, CURSOR_STYLES.CURSOR, options, ListQuery$5(options)),
2123
- get: (id, options = {}) => transport.request(ImportPath(id), { signal: options.signal, apiKey: options.apiKey }),
3498
+ list: (options = {}) => FetchPage(transport, API_PATHS.IMPORTS, CURSOR_STYLES.CURSOR, options, ListQuery$8(options)),
3499
+ listAll: (options = {}) => CollectAll(transport, API_PATHS.IMPORTS, CURSOR_STYLES.CURSOR, options, ListQuery$8(options)),
3500
+ iterate: (options = {}) => IteratePages(transport, API_PATHS.IMPORTS, CURSOR_STYLES.CURSOR, options, ListQuery$8(options)),
3501
+ get: (id, options = {}) => transport.request(RequestPath(API_PATHS.IMPORT, { id }), { signal: options.signal, apiKey: options.apiKey }),
2124
3502
  create,
2125
- uploadState: (id, options = {}) => transport.request(ImportChildPath(id, SEGMENTS.UPLOAD), {
3503
+ uploadState: (id, options = {}) => transport.request(RequestPath(API_PATHS.IMPORT_UPLOAD, { id }), {
2126
3504
  signal: options.signal,
2127
3505
  apiKey: options.apiKey
2128
3506
  }),
2129
3507
  uploadChunk,
2130
3508
  start,
2131
- cancel: (id, options = {}) => transport.request(ImportChildPath(id, SEGMENTS.CANCEL), {
3509
+ cancel: (id, options = {}) => transport.request(RequestPath(API_PATHS.IMPORT_CANCEL, { id }), {
2132
3510
  method: HTTP_METHODS.POST,
2133
3511
  signal: options.signal,
2134
3512
  apiKey: options.apiKey
2135
3513
  }),
2136
- listFailures: (id, options = {}) => transport.request(ImportChildPath(id, SEGMENTS.FAILURES), {
3514
+ listFailures: (id, options = {}) => transport.request(RequestPath(API_PATHS.IMPORT_FAILURES, { id }), {
2137
3515
  query: { after: options.after, limit: options.limit },
2138
3516
  signal: options.signal,
2139
3517
  apiKey: options.apiKey
2140
3518
  }),
2141
- deleteUpload: (id, options = {}) => transport.request(ImportChildPath(id, SEGMENTS.UPLOAD), {
3519
+ deleteUpload: (id, options = {}) => transport.request(RequestPath(API_PATHS.IMPORT_UPLOAD, { id }), {
2142
3520
  method: HTTP_METHODS.DELETE,
2143
3521
  signal: options.signal,
2144
3522
  apiKey: options.apiKey
@@ -2185,72 +3563,214 @@ const WorkspaceActivityQuery$1 = (options) => ({
2185
3563
  [QUERY_KEYS.KEY_IDS]: options.keyIds?.join(LIST_SEPARATOR)
2186
3564
  });
2187
3565
  const Keys = (transport) => ({
2188
- list: (options = {}) => FetchPage(transport, PATHS.KEYS, CURSOR_STYLES.CURSOR, options),
2189
- listAll: (options = {}) => CollectAll(transport, PATHS.KEYS, CURSOR_STYLES.CURSOR, options),
2190
- iterate: (options = {}) => IteratePages(transport, PATHS.KEYS, CURSOR_STYLES.CURSOR, options),
2191
- get: (id, options = {}) => transport.request(KeyPath(id), { signal: options.signal, apiKey: options.apiKey }),
2192
- create: (body, options = {}) => transport.request(PATHS.KEYS, {
3566
+ list: (options = {}) => FetchPage(transport, API_PATHS.KEYS, CURSOR_STYLES.CURSOR, options),
3567
+ listAll: (options = {}) => CollectAll(transport, API_PATHS.KEYS, CURSOR_STYLES.CURSOR, options),
3568
+ iterate: (options = {}) => IteratePages(transport, API_PATHS.KEYS, CURSOR_STYLES.CURSOR, options),
3569
+ get: (id, options = {}) => transport.request(RequestPath(API_PATHS.KEY, { id }), { signal: options.signal, apiKey: options.apiKey }),
3570
+ create: (body, options = {}) => transport.request(API_PATHS.KEYS, {
2193
3571
  method: HTTP_METHODS.POST,
2194
3572
  body,
2195
3573
  signal: options.signal,
2196
3574
  apiKey: options.apiKey
2197
3575
  }),
2198
- update: (id, patch, options = {}) => transport.request(KeyPath(id), {
3576
+ update: (id, patch, options = {}) => transport.request(RequestPath(API_PATHS.KEY, { id }), {
2199
3577
  method: HTTP_METHODS.PATCH,
2200
3578
  body: patch,
2201
3579
  repeatable: true,
2202
3580
  signal: options.signal,
2203
3581
  apiKey: options.apiKey
2204
3582
  }),
2205
- delete: (id, options = {}) => transport.request(KeyPath(id), {
3583
+ delete: (id, options = {}) => transport.request(RequestPath(API_PATHS.KEY, { id }), {
2206
3584
  method: HTTP_METHODS.DELETE,
2207
3585
  signal: options.signal,
2208
3586
  apiKey: options.apiKey
2209
3587
  }),
2210
- rotate: (id, options = {}) => transport.request(KeyChildPath(id, SEGMENTS.ROTATE), {
3588
+ rotate: (id, options = {}) => transport.request(RequestPath(API_PATHS.KEY_ROTATE, { id }), {
2211
3589
  method: HTTP_METHODS.POST,
2212
3590
  signal: options.signal,
2213
3591
  apiKey: options.apiKey
2214
3592
  }),
2215
- revoke: (id, body = {}, options = {}) => transport.request(KeyChildPath(id, SEGMENTS.REVOKE), {
3593
+ revoke: (id, body = {}, options = {}) => transport.request(RequestPath(API_PATHS.KEY_REVOKE, { id }), {
2216
3594
  method: HTTP_METHODS.POST,
2217
3595
  body,
2218
3596
  repeatable: true,
2219
3597
  signal: options.signal,
2220
3598
  apiKey: options.apiKey
2221
3599
  }),
2222
- listRequests: (id, options = {}) => FetchPage(transport, KeyChildPath(id, SEGMENTS.REQUESTS), CURSOR_STYLES.CURSOR, options, RequestQuery(options)),
2223
- listAllRequests: (id, options = {}) => CollectAll(transport, KeyChildPath(id, SEGMENTS.REQUESTS), CURSOR_STYLES.CURSOR, options, RequestQuery(options)),
2224
- iterateRequests: (id, options = {}) => IteratePages(transport, KeyChildPath(id, SEGMENTS.REQUESTS), CURSOR_STYLES.CURSOR, options, RequestQuery(options)),
2225
- listActivity: (id, options = {}) => FetchPage(transport, KeyChildPath(id, SEGMENTS.ACTIVITY), CURSOR_STYLES.CURSOR, options, WindowQuery$2(options)),
2226
- listAllActivity: (id, options = {}) => CollectAll(transport, KeyChildPath(id, SEGMENTS.ACTIVITY), CURSOR_STYLES.CURSOR, options, WindowQuery$2(options)),
2227
- iterateActivity: (id, options = {}) => IteratePages(transport, KeyChildPath(id, SEGMENTS.ACTIVITY), CURSOR_STYLES.CURSOR, options, WindowQuery$2(options)),
2228
- listWorkspaceRequests: (options = {}) => FetchPage(transport, PATHS.KEYS_REQUESTS, CURSOR_STYLES.CURSOR, options, WorkspaceRequestQuery(options)),
2229
- listAllWorkspaceRequests: (options = {}) => CollectAll(transport, PATHS.KEYS_REQUESTS, CURSOR_STYLES.CURSOR, options, WorkspaceRequestQuery(options)),
2230
- iterateWorkspaceRequests: (options = {}) => IteratePages(transport, PATHS.KEYS_REQUESTS, CURSOR_STYLES.CURSOR, options, WorkspaceRequestQuery(options)),
2231
- listWorkspaceActivity: (options = {}) => FetchPage(transport, PATHS.KEYS_ACTIVITY, CURSOR_STYLES.CURSOR, options, WorkspaceActivityQuery$1(options)),
2232
- listAllWorkspaceActivity: (options = {}) => CollectAll(transport, PATHS.KEYS_ACTIVITY, CURSOR_STYLES.CURSOR, options, WorkspaceActivityQuery$1(options)),
2233
- iterateWorkspaceActivity: (options = {}) => IteratePages(transport, PATHS.KEYS_ACTIVITY, CURSOR_STYLES.CURSOR, options, WorkspaceActivityQuery$1(options))
3600
+ listRequests: (id, options = {}) => FetchPage(transport, RequestPath(API_PATHS.KEY_REQUESTS, { id }), CURSOR_STYLES.CURSOR, options, RequestQuery(options)),
3601
+ listAllRequests: (id, options = {}) => CollectAll(transport, RequestPath(API_PATHS.KEY_REQUESTS, { id }), CURSOR_STYLES.CURSOR, options, RequestQuery(options)),
3602
+ iterateRequests: (id, options = {}) => IteratePages(transport, RequestPath(API_PATHS.KEY_REQUESTS, { id }), CURSOR_STYLES.CURSOR, options, RequestQuery(options)),
3603
+ listActivity: (id, options = {}) => FetchPage(transport, RequestPath(API_PATHS.KEY_ACTIVITY, { id }), CURSOR_STYLES.CURSOR, options, WindowQuery$2(options)),
3604
+ listAllActivity: (id, options = {}) => CollectAll(transport, RequestPath(API_PATHS.KEY_ACTIVITY, { id }), CURSOR_STYLES.CURSOR, options, WindowQuery$2(options)),
3605
+ iterateActivity: (id, options = {}) => IteratePages(transport, RequestPath(API_PATHS.KEY_ACTIVITY, { id }), CURSOR_STYLES.CURSOR, options, WindowQuery$2(options)),
3606
+ listWorkspaceRequests: (options = {}) => FetchPage(transport, API_PATHS.KEYS_REQUESTS, CURSOR_STYLES.CURSOR, options, WorkspaceRequestQuery(options)),
3607
+ listAllWorkspaceRequests: (options = {}) => CollectAll(transport, API_PATHS.KEYS_REQUESTS, CURSOR_STYLES.CURSOR, options, WorkspaceRequestQuery(options)),
3608
+ iterateWorkspaceRequests: (options = {}) => IteratePages(transport, API_PATHS.KEYS_REQUESTS, CURSOR_STYLES.CURSOR, options, WorkspaceRequestQuery(options)),
3609
+ listWorkspaceActivity: (options = {}) => FetchPage(transport, API_PATHS.KEYS_ACTIVITY, CURSOR_STYLES.CURSOR, options, WorkspaceActivityQuery$1(options)),
3610
+ listAllWorkspaceActivity: (options = {}) => CollectAll(transport, API_PATHS.KEYS_ACTIVITY, CURSOR_STYLES.CURSOR, options, WorkspaceActivityQuery$1(options)),
3611
+ iterateWorkspaceActivity: (options = {}) => IteratePages(transport, API_PATHS.KEYS_ACTIVITY, CURSOR_STYLES.CURSOR, options, WorkspaceActivityQuery$1(options)),
3612
+ stats: (options = {}) => transport.request(API_PATHS.KEYS_STATS, {
3613
+ query: {
3614
+ ...WindowQuery$2(options),
3615
+ [QUERY_KEYS.KEY_IDS]: options.keyIds?.join(LIST_SEPARATOR),
3616
+ [QUERY_KEYS.GRAIN]: options.grain,
3617
+ [QUERY_KEYS.OFFSET_MINUTES]: options.offsetMinutes
3618
+ },
3619
+ signal: options.signal,
3620
+ apiKey: options.apiKey
3621
+ })
3622
+ });
3623
+
3624
+ const ListQuery$7 = (options) => ({
3625
+ [QUERY_KEYS.SCOPE]: options.scope,
3626
+ [QUERY_KEYS.LEVEL]: options.level,
3627
+ [QUERY_KEYS.KIND]: options.kind,
3628
+ [QUERY_KEYS.STATUS]: options.status,
3629
+ [QUERY_KEYS.PINNED]: options.pinned,
3630
+ [QUERY_KEYS.Q]: options.q
3631
+ });
3632
+ const SuggestionQuery = (options) => ({
3633
+ [QUERY_KEYS.KIND]: options.kind,
3634
+ [QUERY_KEYS.STATUS]: options.status
3635
+ });
3636
+ const Knowledge = (transport) => ({
3637
+ list: (options = {}) => FetchPage(transport, API_PATHS.KNOWLEDGE, CURSOR_STYLES.CURSOR, options, ListQuery$7(options)),
3638
+ listAll: (options = {}) => CollectAll(transport, API_PATHS.KNOWLEDGE, CURSOR_STYLES.CURSOR, options, ListQuery$7(options)),
3639
+ iterate: (options = {}) => IteratePages(transport, API_PATHS.KNOWLEDGE, CURSOR_STYLES.CURSOR, options, ListQuery$7(options)),
3640
+ levels: (options = {}) => FetchList(transport, API_PATHS.KNOWLEDGE_LEVELS, options),
3641
+ usage: (options = {}) => transport.request(API_PATHS.KNOWLEDGE_USAGE, { signal: options.signal, apiKey: options.apiKey }),
3642
+ search: (body, options = {}) => transport.request(API_PATHS.KNOWLEDGE_SEARCH, {
3643
+ method: HTTP_METHODS.POST,
3644
+ body,
3645
+ repeatable: true,
3646
+ signal: options.signal,
3647
+ apiKey: options.apiKey
3648
+ }),
3649
+ createNote: (body, options = {}) => transport.request(API_PATHS.KNOWLEDGE_NOTES, {
3650
+ method: HTTP_METHODS.POST,
3651
+ body,
3652
+ signal: options.signal,
3653
+ apiKey: options.apiKey
3654
+ }),
3655
+ addLink: (body, options = {}) => transport.request(API_PATHS.KNOWLEDGE_LINKS, {
3656
+ method: HTTP_METHODS.POST,
3657
+ body,
3658
+ signal: options.signal,
3659
+ apiKey: options.apiKey
3660
+ }),
3661
+ uploadFile: (data, options) => transport.request(API_PATHS.KNOWLEDGE_FILES, {
3662
+ method: HTTP_METHODS.POST,
3663
+ query: {
3664
+ [QUERY_KEYS.FILENAME]: UploadName(options),
3665
+ [QUERY_KEYS.SCOPE]: options.scope,
3666
+ [QUERY_KEYS.TITLE]: options.title
3667
+ },
3668
+ raw: data,
3669
+ contentType: UploadType(data, options),
3670
+ timeoutMs: UploadTimeout(transport, options),
3671
+ signal: options.signal,
3672
+ apiKey: options.apiKey
3673
+ }),
3674
+ get: (id, options = {}) => transport.request(RequestPath(API_PATHS.KNOWLEDGE_ITEM, { id }), { signal: options.signal, apiKey: options.apiKey }),
3675
+ update: (id, patch, options = {}) => transport.request(RequestPath(API_PATHS.KNOWLEDGE_ITEM, { id }), {
3676
+ method: HTTP_METHODS.PATCH,
3677
+ body: patch,
3678
+ repeatable: true,
3679
+ signal: options.signal,
3680
+ apiKey: options.apiKey
3681
+ }),
3682
+ delete: (id, options = {}) => transport.request(RequestPath(API_PATHS.KNOWLEDGE_ITEM, { id }), {
3683
+ method: HTTP_METHODS.DELETE,
3684
+ signal: options.signal,
3685
+ apiKey: options.apiKey
3686
+ }),
3687
+ refresh: (id, options = {}) => transport.request(RequestPath(API_PATHS.KNOWLEDGE_ITEM_REFRESH, { id }), {
3688
+ method: HTTP_METHODS.POST,
3689
+ repeatable: true,
3690
+ signal: options.signal,
3691
+ apiKey: options.apiKey
3692
+ }),
3693
+ stats: (options = {}) => transport.request(API_PATHS.KNOWLEDGE_STATS, {
3694
+ query: { [QUERY_KEYS.DAYS]: options.days },
3695
+ signal: options.signal,
3696
+ apiKey: options.apiKey
3697
+ }),
3698
+ listSuggestions: (options = {}) => FetchPage(transport, API_PATHS.KNOWLEDGE_SUGGESTIONS, CURSOR_STYLES.CURSOR, options, SuggestionQuery(options)),
3699
+ listAllSuggestions: (options = {}) => CollectAll(transport, API_PATHS.KNOWLEDGE_SUGGESTIONS, CURSOR_STYLES.CURSOR, options, SuggestionQuery(options)),
3700
+ iterateSuggestions: (options = {}) => IteratePages(transport, API_PATHS.KNOWLEDGE_SUGGESTIONS, CURSOR_STYLES.CURSOR, options, SuggestionQuery(options)),
3701
+ acceptSuggestion: (id, body = {}, options = {}) => transport.request(RequestPath(API_PATHS.KNOWLEDGE_SUGGESTION_ACCEPT, { id }), {
3702
+ method: HTTP_METHODS.POST,
3703
+ body,
3704
+ signal: options.signal,
3705
+ apiKey: options.apiKey
3706
+ }),
3707
+ dismissSuggestion: (id, options = {}) => transport.request(RequestPath(API_PATHS.KNOWLEDGE_SUGGESTION_DISMISS, { id }), {
3708
+ method: HTTP_METHODS.POST,
3709
+ signal: options.signal,
3710
+ apiKey: options.apiKey
3711
+ }),
3712
+ listFlags: (options = {}) => FetchList(transport, API_PATHS.KNOWLEDGE_FLAGS, options, {
3713
+ [QUERY_KEYS.ITEM_ID]: options.itemId,
3714
+ [QUERY_KEYS.LIMIT]: options.limit
3715
+ }),
3716
+ dismissFlag: (id, options = {}) => transport.request(RequestPath(API_PATHS.KNOWLEDGE_FLAG_DISMISS, { id }), {
3717
+ method: HTTP_METHODS.POST,
3718
+ repeatable: true,
3719
+ signal: options.signal,
3720
+ apiKey: options.apiKey
3721
+ }),
3722
+ listConnectors: (options = {}) => FetchList(transport, API_PATHS.KNOWLEDGE_CONNECTORS, options),
3723
+ addConnector: (body, options = {}) => transport.request(API_PATHS.KNOWLEDGE_CONNECTORS, {
3724
+ method: HTTP_METHODS.POST,
3725
+ body,
3726
+ signal: options.signal,
3727
+ apiKey: options.apiKey
3728
+ }),
3729
+ getConnector: (id, options = {}) => transport.request(RequestPath(API_PATHS.KNOWLEDGE_CONNECTOR, { id }), { signal: options.signal, apiKey: options.apiKey }),
3730
+ updateConnector: (id, patch, options = {}) => transport.request(RequestPath(API_PATHS.KNOWLEDGE_CONNECTOR, { id }), {
3731
+ method: HTTP_METHODS.PATCH,
3732
+ body: patch,
3733
+ repeatable: true,
3734
+ signal: options.signal,
3735
+ apiKey: options.apiKey
3736
+ }),
3737
+ deleteConnector: (id, options = {}) => transport.request(RequestPath(API_PATHS.KNOWLEDGE_CONNECTOR, { id }), {
3738
+ method: HTTP_METHODS.DELETE,
3739
+ signal: options.signal,
3740
+ apiKey: options.apiKey
3741
+ }),
3742
+ syncConnector: (id, options = {}) => transport.request(RequestPath(API_PATHS.KNOWLEDGE_CONNECTOR_SYNC, { id }), {
3743
+ method: HTTP_METHODS.POST,
3744
+ repeatable: true,
3745
+ signal: options.signal,
3746
+ apiKey: options.apiKey
3747
+ }),
3748
+ draftFromThread: (body, options = {}) => transport.request(API_PATHS.KNOWLEDGE_DRAFTS, {
3749
+ method: HTTP_METHODS.POST,
3750
+ body,
3751
+ signal: options.signal,
3752
+ apiKey: options.apiKey
3753
+ })
2234
3754
  });
2235
3755
 
2236
3756
  const ProviderImports = (transport) => ({
2237
- inspect: (apiKey, options = {}) => transport.request(PATHS.PROVIDER_IMPORTS_INSPECT, {
3757
+ inspect: (apiKey, options = {}) => transport.request(API_PATHS.PROVIDER_IMPORTS_INSPECT, {
2238
3758
  method: HTTP_METHODS.POST,
2239
- body: { apiKey },
3759
+ body: options.provider === undefined ? { apiKey } : { apiKey, provider: options.provider },
2240
3760
  signal: options.signal,
2241
3761
  apiKey: options.apiKey
2242
3762
  }),
2243
- create: (body, options = {}) => transport.request(PATHS.PROVIDER_IMPORTS, {
3763
+ create: (body, options = {}) => transport.request(API_PATHS.PROVIDER_IMPORTS, {
2244
3764
  method: HTTP_METHODS.POST,
2245
3765
  body,
2246
3766
  signal: options.signal,
2247
3767
  apiKey: options.apiKey
2248
3768
  }),
2249
- list: (options = {}) => FetchPage(transport, PATHS.PROVIDER_IMPORTS, CURSOR_STYLES.CURSOR, options),
2250
- listAll: (options = {}) => CollectAll(transport, PATHS.PROVIDER_IMPORTS, CURSOR_STYLES.CURSOR, options),
2251
- iterate: (options = {}) => IteratePages(transport, PATHS.PROVIDER_IMPORTS, CURSOR_STYLES.CURSOR, options),
2252
- get: (id, options = {}) => transport.request(ProviderImportPath(id), { signal: options.signal, apiKey: options.apiKey }),
2253
- cancel: (id, options = {}) => transport.request(ProviderImportChildPath(id, SEGMENTS.CANCEL), {
3769
+ list: (options = {}) => FetchPage(transport, API_PATHS.PROVIDER_IMPORTS, CURSOR_STYLES.CURSOR, options),
3770
+ listAll: (options = {}) => CollectAll(transport, API_PATHS.PROVIDER_IMPORTS, CURSOR_STYLES.CURSOR, options),
3771
+ iterate: (options = {}) => IteratePages(transport, API_PATHS.PROVIDER_IMPORTS, CURSOR_STYLES.CURSOR, options),
3772
+ get: (id, options = {}) => transport.request(RequestPath(API_PATHS.PROVIDER_IMPORT, { id }), { signal: options.signal, apiKey: options.apiKey }),
3773
+ cancel: (id, options = {}) => transport.request(RequestPath(API_PATHS.PROVIDER_IMPORT_CANCEL, { id }), {
2254
3774
  method: HTTP_METHODS.POST,
2255
3775
  signal: options.signal,
2256
3776
  apiKey: options.apiKey
@@ -2258,25 +3778,25 @@ const ProviderImports = (transport) => ({
2258
3778
  });
2259
3779
 
2260
3780
  const Labels = (transport) => ({
2261
- list: (options = {}) => FetchPage(transport, PATHS.LABELS, CURSOR_STYLES.CURSOR, options),
2262
- listAll: (options = {}) => CollectAll(transport, PATHS.LABELS, CURSOR_STYLES.CURSOR, options),
2263
- iterate: (options = {}) => IteratePages(transport, PATHS.LABELS, CURSOR_STYLES.CURSOR, options),
2264
- listColors: (options = {}) => FetchList(transport, PATHS.LABELS_COLORS, options),
2265
- get: (id, options = {}) => transport.request(LabelPath(id), { signal: options.signal, apiKey: options.apiKey }),
2266
- create: (body, options = {}) => transport.request(PATHS.LABELS, {
3781
+ list: (options = {}) => FetchPage(transport, API_PATHS.LABELS, CURSOR_STYLES.CURSOR, options),
3782
+ listAll: (options = {}) => CollectAll(transport, API_PATHS.LABELS, CURSOR_STYLES.CURSOR, options),
3783
+ iterate: (options = {}) => IteratePages(transport, API_PATHS.LABELS, CURSOR_STYLES.CURSOR, options),
3784
+ listColors: (options = {}) => FetchList(transport, API_PATHS.LABEL_COLORS, options),
3785
+ get: (id, options = {}) => transport.request(RequestPath(API_PATHS.LABEL, { id }), { signal: options.signal, apiKey: options.apiKey }),
3786
+ create: (body, options = {}) => transport.request(API_PATHS.LABELS, {
2267
3787
  method: HTTP_METHODS.POST,
2268
3788
  body,
2269
3789
  signal: options.signal,
2270
3790
  apiKey: options.apiKey
2271
3791
  }),
2272
- update: (id, patch, options = {}) => transport.request(LabelPath(id), {
3792
+ update: (id, patch, options = {}) => transport.request(RequestPath(API_PATHS.LABEL, { id }), {
2273
3793
  method: HTTP_METHODS.PATCH,
2274
3794
  body: patch,
2275
3795
  repeatable: true,
2276
3796
  signal: options.signal,
2277
3797
  apiKey: options.apiKey
2278
3798
  }),
2279
- delete: (id, options = {}) => transport.request(LabelPath(id), {
3799
+ delete: (id, options = {}) => transport.request(RequestPath(API_PATHS.LABEL, { id }), {
2280
3800
  method: HTTP_METHODS.DELETE,
2281
3801
  signal: options.signal,
2282
3802
  apiKey: options.apiKey
@@ -2284,13 +3804,13 @@ const Labels = (transport) => ({
2284
3804
  });
2285
3805
 
2286
3806
  const Languages = (transport) => ({
2287
- list: (options = {}) => FetchList(transport, PATHS.LANGUAGES, options)
3807
+ list: (options = {}) => FetchList(transport, API_PATHS.LANGUAGES, options)
2288
3808
  });
2289
3809
 
2290
3810
  const Me = (transport) => ({
2291
- get: (options = {}) => transport.request(PATHS.KEYS_SELF, { signal: options.signal, apiKey: options.apiKey }),
2292
- ping: (options = {}) => transport.request(PATHS.PING, { signal: options.signal, apiKey: options.apiKey }),
2293
- rotate: (options = {}) => transport.request(PATHS.KEYS_SELF_ROTATE, {
3811
+ get: (options = {}) => transport.request(API_PATHS.KEY_SELF, { signal: options.signal, apiKey: options.apiKey }),
3812
+ ping: (options = {}) => transport.request(API_PATHS.PING, { signal: options.signal, apiKey: options.apiKey }),
3813
+ rotate: (options = {}) => transport.request(API_PATHS.KEY_SELF_ROTATE, {
2294
3814
  method: HTTP_METHODS.POST,
2295
3815
  signal: options.signal,
2296
3816
  apiKey: options.apiKey
@@ -2298,49 +3818,61 @@ const Me = (transport) => ({
2298
3818
  });
2299
3819
 
2300
3820
  const Members = (transport) => ({
2301
- list: (options = {}) => FetchPage(transport, PATHS.MEMBERS, CURSOR_STYLES.CURSOR, options),
2302
- listAll: (options = {}) => CollectAll(transport, PATHS.MEMBERS, CURSOR_STYLES.CURSOR, options),
2303
- iterate: (options = {}) => IteratePages(transport, PATHS.MEMBERS, CURSOR_STYLES.CURSOR, options),
2304
- get: (userId, options = {}) => transport.request(MemberPath(userId), { signal: options.signal, apiKey: options.apiKey }),
2305
- add: (body, options = {}) => transport.request(PATHS.MEMBERS, {
3821
+ list: (options = {}) => FetchPage(transport, API_PATHS.MEMBERS, CURSOR_STYLES.CURSOR, options),
3822
+ listAll: (options = {}) => CollectAll(transport, API_PATHS.MEMBERS, CURSOR_STYLES.CURSOR, options),
3823
+ iterate: (options = {}) => IteratePages(transport, API_PATHS.MEMBERS, CURSOR_STYLES.CURSOR, options),
3824
+ get: (userId, options = {}) => transport.request(RequestPath(API_PATHS.MEMBER, { userId }), { signal: options.signal, apiKey: options.apiKey }),
3825
+ add: (body, options = {}) => transport.request(API_PATHS.MEMBERS, {
2306
3826
  method: HTTP_METHODS.POST,
2307
3827
  body,
2308
3828
  signal: options.signal,
2309
3829
  apiKey: options.apiKey
2310
3830
  }),
2311
- update: (userId, patch, options = {}) => transport.request(MemberPath(userId), {
3831
+ update: (userId, patch, options = {}) => transport.request(RequestPath(API_PATHS.MEMBER, { userId }), {
2312
3832
  method: HTTP_METHODS.PATCH,
2313
3833
  body: patch,
2314
3834
  repeatable: true,
2315
3835
  signal: options.signal,
2316
3836
  apiKey: options.apiKey
2317
3837
  }),
2318
- remove: (userId, options = {}) => transport.request(MemberPath(userId), {
3838
+ remove: (userId, options = {}) => transport.request(RequestPath(API_PATHS.MEMBER, { userId }), {
2319
3839
  method: HTTP_METHODS.DELETE,
2320
3840
  signal: options.signal,
2321
3841
  apiKey: options.apiKey
2322
3842
  }),
2323
- grantAddress: (userId, body, options = {}) => transport.request(MemberAddressesPath(userId), {
3843
+ grantAddress: (userId, body, options = {}) => transport.request(RequestPath(API_PATHS.MEMBER_ADDRESSES, { userId }), {
2324
3844
  method: HTTP_METHODS.POST,
2325
3845
  body,
2326
3846
  repeatable: true,
2327
3847
  signal: options.signal,
2328
3848
  apiKey: options.apiKey
2329
3849
  }),
2330
- revokeAddress: (userId, addressId, options = {}) => transport.request(MemberAddressPath(userId, addressId), {
3850
+ revokeAddress: (userId, addressId, options = {}) => transport.request(RequestPath(API_PATHS.MEMBER_ADDRESS, { userId, addressId }), {
2331
3851
  method: HTTP_METHODS.DELETE,
2332
3852
  signal: options.signal,
2333
3853
  apiKey: options.apiKey
2334
3854
  }),
2335
- listInvitations: (options = {}) => FetchPage(transport, PATHS.MEMBERS_INVITATIONS, CURSOR_STYLES.CURSOR, options),
2336
- listAllInvitations: (options = {}) => CollectAll(transport, PATHS.MEMBERS_INVITATIONS, CURSOR_STYLES.CURSOR, options),
2337
- iterateInvitations: (options = {}) => IteratePages(transport, PATHS.MEMBERS_INVITATIONS, CURSOR_STYLES.CURSOR, options),
2338
- revokeInvitation: (invitationId, options = {}) => transport.request(MemberInvitationPath(invitationId), {
3855
+ grantDomain: (userId, body, options = {}) => transport.request(RequestPath(API_PATHS.MEMBER_DOMAINS, { userId }), {
3856
+ method: HTTP_METHODS.POST,
3857
+ body,
3858
+ repeatable: true,
3859
+ signal: options.signal,
3860
+ apiKey: options.apiKey
3861
+ }),
3862
+ revokeDomain: (userId, domainId, options = {}) => transport.request(RequestPath(API_PATHS.MEMBER_DOMAIN, { userId, domainId }), {
3863
+ method: HTTP_METHODS.DELETE,
3864
+ signal: options.signal,
3865
+ apiKey: options.apiKey
3866
+ }),
3867
+ listInvitations: (options = {}) => FetchPage(transport, API_PATHS.MEMBER_INVITATIONS, CURSOR_STYLES.CURSOR, options),
3868
+ listAllInvitations: (options = {}) => CollectAll(transport, API_PATHS.MEMBER_INVITATIONS, CURSOR_STYLES.CURSOR, options),
3869
+ iterateInvitations: (options = {}) => IteratePages(transport, API_PATHS.MEMBER_INVITATIONS, CURSOR_STYLES.CURSOR, options),
3870
+ revokeInvitation: (invitationId, options = {}) => transport.request(RequestPath(API_PATHS.MEMBER_INVITATION, { invitationId }), {
2339
3871
  method: HTTP_METHODS.DELETE,
2340
3872
  signal: options.signal,
2341
3873
  apiKey: options.apiKey
2342
3874
  }),
2343
- resendInvitation: (invitationId, options = {}) => transport.request(MemberInvitationResendPath(invitationId), {
3875
+ resendInvitation: (invitationId, options = {}) => transport.request(RequestPath(API_PATHS.MEMBER_INVITATION_RESEND, { invitationId }), {
2344
3876
  method: HTTP_METHODS.POST,
2345
3877
  signal: options.signal,
2346
3878
  apiKey: options.apiKey
@@ -2348,33 +3880,33 @@ const Members = (transport) => ({
2348
3880
  });
2349
3881
 
2350
3882
  const Roles = (transport) => ({
2351
- list: (options = {}) => FetchPage(transport, PATHS.ROLES, CURSOR_STYLES.CURSOR, options),
2352
- listAll: (options = {}) => CollectAll(transport, PATHS.ROLES, CURSOR_STYLES.CURSOR, options),
2353
- iterate: (options = {}) => IteratePages(transport, PATHS.ROLES, CURSOR_STYLES.CURSOR, options),
2354
- get: (id, options = {}) => transport.request(RolePath(id), { signal: options.signal, apiKey: options.apiKey }),
2355
- create: (body, options = {}) => transport.request(PATHS.ROLES, {
3883
+ list: (options = {}) => FetchPage(transport, API_PATHS.ROLES, CURSOR_STYLES.CURSOR, options),
3884
+ listAll: (options = {}) => CollectAll(transport, API_PATHS.ROLES, CURSOR_STYLES.CURSOR, options),
3885
+ iterate: (options = {}) => IteratePages(transport, API_PATHS.ROLES, CURSOR_STYLES.CURSOR, options),
3886
+ get: (id, options = {}) => transport.request(RequestPath(API_PATHS.ROLE, { id }), { signal: options.signal, apiKey: options.apiKey }),
3887
+ create: (body, options = {}) => transport.request(API_PATHS.ROLES, {
2356
3888
  method: HTTP_METHODS.POST,
2357
3889
  body,
2358
3890
  signal: options.signal,
2359
3891
  apiKey: options.apiKey
2360
3892
  }),
2361
- update: (id, patch, options = {}) => transport.request(RolePath(id), {
3893
+ update: (id, patch, options = {}) => transport.request(RequestPath(API_PATHS.ROLE, { id }), {
2362
3894
  method: HTTP_METHODS.PATCH,
2363
3895
  body: patch,
2364
3896
  repeatable: true,
2365
3897
  signal: options.signal,
2366
3898
  apiKey: options.apiKey
2367
3899
  }),
2368
- delete: (id, options = {}) => transport.request(RolePath(id), {
3900
+ delete: (id, options = {}) => transport.request(RequestPath(API_PATHS.ROLE, { id }), {
2369
3901
  method: HTTP_METHODS.DELETE,
2370
3902
  query: { [QUERY_KEYS.REASSIGN_TO]: options.reassignTo },
2371
3903
  signal: options.signal,
2372
3904
  apiKey: options.apiKey
2373
3905
  }),
2374
- listPermissions: (options = {}) => FetchList(transport, PATHS.ROLES_PERMISSIONS, options)
3906
+ listPermissions: (options = {}) => FetchList(transport, API_PATHS.ROLE_PERMISSIONS, options)
2375
3907
  });
2376
3908
 
2377
- const ListQuery$4 = (options) => ({
3909
+ const ListQuery$6 = (options) => ({
2378
3910
  [QUERY_KEYS.ENABLED]: options.enabled === undefined ? undefined : String(options.enabled)
2379
3911
  });
2380
3912
  const RunsQuery = (options) => ({
@@ -2382,29 +3914,29 @@ const RunsQuery = (options) => ({
2382
3914
  [QUERY_KEYS.THREAD_ID]: options.threadId
2383
3915
  });
2384
3916
  const Rules = (transport) => ({
2385
- list: (options = {}) => FetchPage(transport, PATHS.RULES, CURSOR_STYLES.CURSOR, options, ListQuery$4(options)),
2386
- listAll: (options = {}) => CollectAll(transport, PATHS.RULES, CURSOR_STYLES.CURSOR, options, ListQuery$4(options)),
2387
- iterate: (options = {}) => IteratePages(transport, PATHS.RULES, CURSOR_STYLES.CURSOR, options, ListQuery$4(options)),
2388
- get: (id, options = {}) => transport.request(RulePath(id), { signal: options.signal, apiKey: options.apiKey }),
2389
- create: (body, options = {}) => transport.request(PATHS.RULES, {
3917
+ list: (options = {}) => FetchPage(transport, API_PATHS.RULES, CURSOR_STYLES.CURSOR, options, ListQuery$6(options)),
3918
+ listAll: (options = {}) => CollectAll(transport, API_PATHS.RULES, CURSOR_STYLES.CURSOR, options, ListQuery$6(options)),
3919
+ iterate: (options = {}) => IteratePages(transport, API_PATHS.RULES, CURSOR_STYLES.CURSOR, options, ListQuery$6(options)),
3920
+ get: (id, options = {}) => transport.request(RequestPath(API_PATHS.RULE, { id }), { signal: options.signal, apiKey: options.apiKey }),
3921
+ create: (body, options = {}) => transport.request(API_PATHS.RULES, {
2390
3922
  method: HTTP_METHODS.POST,
2391
3923
  body,
2392
3924
  signal: options.signal,
2393
3925
  apiKey: options.apiKey
2394
3926
  }),
2395
- update: (id, patch, options = {}) => transport.request(RulePath(id), {
3927
+ update: (id, patch, options = {}) => transport.request(RequestPath(API_PATHS.RULE, { id }), {
2396
3928
  method: HTTP_METHODS.PATCH,
2397
3929
  body: patch,
2398
3930
  signal: options.signal,
2399
3931
  apiKey: options.apiKey
2400
3932
  }),
2401
- delete: (id, options = {}) => transport.request(RulePath(id), {
3933
+ delete: (id, options = {}) => transport.request(RequestPath(API_PATHS.RULE, { id }), {
2402
3934
  method: HTTP_METHODS.DELETE,
2403
3935
  signal: options.signal,
2404
3936
  apiKey: options.apiKey
2405
3937
  }),
2406
3938
  reorder: async (ruleIds, options = {}) => {
2407
- const envelope = await transport.request(PATHS.RULES_REORDER, {
3939
+ const envelope = await transport.request(API_PATHS.RULES_REORDER, {
2408
3940
  method: HTTP_METHODS.POST,
2409
3941
  body: { ruleIds },
2410
3942
  repeatable: true,
@@ -2413,27 +3945,27 @@ const Rules = (transport) => ({
2413
3945
  });
2414
3946
  return envelope?.data ?? [];
2415
3947
  },
2416
- test: (id, body = {}, options = {}) => transport.request(RuleChildPath(id, SEGMENTS.TEST), {
3948
+ test: (id, body = {}, options = {}) => transport.request(RequestPath(API_PATHS.RULE_TEST, { id }), {
2417
3949
  method: HTTP_METHODS.POST,
2418
3950
  body,
2419
3951
  repeatable: true,
2420
3952
  signal: options.signal,
2421
3953
  apiKey: options.apiKey
2422
3954
  }),
2423
- listRuns: (options = {}) => FetchPage(transport, PATHS.RULES_RUNS, CURSOR_STYLES.CURSOR, options, RunsQuery(options)),
2424
- listAllRuns: (options = {}) => CollectAll(transport, PATHS.RULES_RUNS, CURSOR_STYLES.CURSOR, options, RunsQuery(options)),
2425
- iterateRuns: (options = {}) => IteratePages(transport, PATHS.RULES_RUNS, CURSOR_STYLES.CURSOR, options, RunsQuery(options))
3955
+ listRuns: (options = {}) => FetchPage(transport, API_PATHS.RULE_RUNS, CURSOR_STYLES.CURSOR, options, RunsQuery(options)),
3956
+ listAllRuns: (options = {}) => CollectAll(transport, API_PATHS.RULE_RUNS, CURSOR_STYLES.CURSOR, options, RunsQuery(options)),
3957
+ iterateRuns: (options = {}) => IteratePages(transport, API_PATHS.RULE_RUNS, CURSOR_STYLES.CURSOR, options, RunsQuery(options))
2426
3958
  });
2427
3959
 
2428
3960
  const Security = (transport) => ({
2429
- stepUpStatus: (options = {}) => transport.request(PATHS.SECURITY_STEP_UP, { signal: options.signal, apiKey: options.apiKey }),
2430
- beginStepUp: (body = {}, options = {}) => transport.request(PATHS.SECURITY_STEP_UP, {
3961
+ stepUpStatus: (options = {}) => transport.request(API_PATHS.SECURITY_STEP_UP, { signal: options.signal, apiKey: options.apiKey }),
3962
+ beginStepUp: (body = {}, options = {}) => transport.request(API_PATHS.SECURITY_STEP_UP, {
2431
3963
  method: HTTP_METHODS.POST,
2432
3964
  body,
2433
3965
  signal: options.signal,
2434
3966
  apiKey: options.apiKey
2435
3967
  }),
2436
- verifyStepUp: (body, options = {}) => transport.request(PATHS.SECURITY_STEP_UP_VERIFY, {
3968
+ verifyStepUp: (body, options = {}) => transport.request(API_PATHS.SECURITY_STEP_UP_VERIFY, {
2437
3969
  method: HTTP_METHODS.POST,
2438
3970
  body,
2439
3971
  signal: options.signal,
@@ -2442,12 +3974,12 @@ const Security = (transport) => ({
2442
3974
  });
2443
3975
 
2444
3976
  const Settings = (transport) => ({
2445
- get: (options = {}) => transport.request(PATHS.SETTINGS, {
3977
+ get: (options = {}) => transport.request(API_PATHS.SETTINGS, {
2446
3978
  query: { [QUERY_KEYS.ADDRESS]: options.address },
2447
3979
  signal: options.signal,
2448
3980
  apiKey: options.apiKey
2449
3981
  }),
2450
- update: (patch, options = {}) => transport.request(PATHS.SETTINGS, {
3982
+ update: (patch, options = {}) => transport.request(API_PATHS.SETTINGS, {
2451
3983
  method: HTTP_METHODS.PATCH,
2452
3984
  query: { [QUERY_KEYS.ADDRESS]: options.address },
2453
3985
  body: patch,
@@ -2457,23 +3989,23 @@ const Settings = (transport) => ({
2457
3989
  })
2458
3990
  });
2459
3991
 
2460
- const ListQuery$3 = (options) => ({
3992
+ const ListQuery$5 = (options) => ({
2461
3993
  [QUERY_KEYS.Q]: options.q,
2462
3994
  [QUERY_KEYS.REASON]: options.reason
2463
3995
  });
2464
3996
  const Suppressions = (transport) => ({
2465
- list: (options = {}) => FetchPage(transport, PATHS.SUPPRESSIONS, CURSOR_STYLES.CURSOR, options, ListQuery$3(options)),
2466
- listAll: (options = {}) => CollectAll(transport, PATHS.SUPPRESSIONS, CURSOR_STYLES.CURSOR, options, ListQuery$3(options)),
2467
- iterate: (options = {}) => IteratePages(transport, PATHS.SUPPRESSIONS, CURSOR_STYLES.CURSOR, options, ListQuery$3(options)),
2468
- get: (id, options = {}) => transport.request(SuppressionPath(id), { signal: options.signal, apiKey: options.apiKey }),
2469
- add: (body, options = {}) => transport.request(PATHS.SUPPRESSIONS, {
3997
+ list: (options = {}) => FetchPage(transport, API_PATHS.SUPPRESSIONS, CURSOR_STYLES.CURSOR, options, ListQuery$5(options)),
3998
+ listAll: (options = {}) => CollectAll(transport, API_PATHS.SUPPRESSIONS, CURSOR_STYLES.CURSOR, options, ListQuery$5(options)),
3999
+ iterate: (options = {}) => IteratePages(transport, API_PATHS.SUPPRESSIONS, CURSOR_STYLES.CURSOR, options, ListQuery$5(options)),
4000
+ get: (id, options = {}) => transport.request(RequestPath(API_PATHS.SUPPRESSION, { id }), { signal: options.signal, apiKey: options.apiKey }),
4001
+ add: (body, options = {}) => transport.request(API_PATHS.SUPPRESSIONS, {
2470
4002
  method: HTTP_METHODS.POST,
2471
4003
  body,
2472
4004
  repeatable: true,
2473
4005
  signal: options.signal,
2474
4006
  apiKey: options.apiKey
2475
4007
  }),
2476
- remove: (id, options = {}) => transport.request(SuppressionPath(id), {
4008
+ remove: (id, options = {}) => transport.request(RequestPath(API_PATHS.SUPPRESSION, { id }), {
2477
4009
  method: HTTP_METHODS.DELETE,
2478
4010
  signal: options.signal,
2479
4011
  apiKey: options.apiKey
@@ -2481,7 +4013,7 @@ const Suppressions = (transport) => ({
2481
4013
  });
2482
4014
 
2483
4015
  const MessagePage = async (transport, inboxId, options) => {
2484
- const envelope = await transport.request(TempMessagesPath(inboxId), {
4016
+ const envelope = await transport.request(RequestPath(API_PATHS.TEMP_MAIL_MESSAGES, { id: inboxId }), {
2485
4017
  query: { [QUERY_KEYS.LIMIT]: options.limit, [QUERY_KEYS.CURSOR]: options.cursor },
2486
4018
  inboxToken: options.inboxToken,
2487
4019
  signal: options.signal
@@ -2506,26 +4038,26 @@ const IterateMessages = async function* (transport, inboxId, options) {
2506
4038
  }
2507
4039
  };
2508
4040
  const TempMail = (transport) => ({
2509
- listDomains: async (options = {}) => (await transport.request(PATHS.TEMP_MAIL_DOMAINS, {
4041
+ listDomains: async (options = {}) => (await transport.request(API_PATHS.TEMP_MAIL_DOMAINS, {
2510
4042
  anonymous: true,
2511
4043
  signal: options.signal
2512
4044
  }))?.data ?? [],
2513
- create: (body = {}, options = {}) => transport.request(PATHS.TEMP_MAIL_INBOXES, {
4045
+ create: (body = {}, options = {}) => transport.request(API_PATHS.TEMP_MAIL_INBOXES, {
2514
4046
  method: HTTP_METHODS.POST,
2515
4047
  body,
2516
4048
  anonymous: true,
2517
4049
  signal: options.signal
2518
4050
  }),
2519
- get: (inboxId, options = {}) => transport.request(TempInboxPath(inboxId), {
4051
+ get: (inboxId, options = {}) => transport.request(RequestPath(API_PATHS.TEMP_MAIL_INBOX, { id: inboxId }), {
2520
4052
  inboxToken: options.inboxToken,
2521
4053
  signal: options.signal
2522
4054
  }),
2523
- extend: (inboxId, options = {}) => transport.request(TempInboxExtendPath(inboxId), {
4055
+ extend: (inboxId, options = {}) => transport.request(RequestPath(API_PATHS.TEMP_MAIL_INBOX_EXTEND, { id: inboxId }), {
2524
4056
  method: HTTP_METHODS.POST,
2525
4057
  inboxToken: options.inboxToken,
2526
4058
  signal: options.signal
2527
4059
  }),
2528
- delete: (inboxId, options = {}) => transport.request(TempInboxPath(inboxId), {
4060
+ delete: (inboxId, options = {}) => transport.request(RequestPath(API_PATHS.TEMP_MAIL_INBOX, { id: inboxId }), {
2529
4061
  method: HTTP_METHODS.DELETE,
2530
4062
  inboxToken: options.inboxToken,
2531
4063
  signal: options.signal
@@ -2538,22 +4070,22 @@ const TempMail = (transport) => ({
2538
4070
  return all;
2539
4071
  },
2540
4072
  iterateMessages: (inboxId, options = {}) => IterateMessages(transport, inboxId, options),
2541
- getMessage: (inboxId, messageId, options = {}) => transport.request(TempMessagePath(inboxId, messageId), {
4073
+ getMessage: (inboxId, messageId, options = {}) => transport.request(RequestPath(API_PATHS.TEMP_MAIL_MESSAGE, { id: inboxId, messageId }), {
2542
4074
  inboxToken: options.inboxToken,
2543
4075
  signal: options.signal
2544
4076
  }),
2545
- deleteMessage: (inboxId, messageId, options = {}) => transport.request(TempMessagePath(inboxId, messageId), {
4077
+ deleteMessage: (inboxId, messageId, options = {}) => transport.request(RequestPath(API_PATHS.TEMP_MAIL_MESSAGE, { id: inboxId, messageId }), {
2546
4078
  method: HTTP_METHODS.DELETE,
2547
4079
  inboxToken: options.inboxToken,
2548
4080
  signal: options.signal
2549
4081
  }),
2550
- listAttachments: async (inboxId, messageId, options = {}) => (await transport.request(TempMessageAttachmentsPath(inboxId, messageId), {
4082
+ listAttachments: async (inboxId, messageId, options = {}) => (await transport.request(RequestPath(API_PATHS.TEMP_MAIL_MESSAGE_ATTACHMENTS, { id: inboxId, messageId }), {
2551
4083
  inboxToken: options.inboxToken,
2552
4084
  signal: options.signal
2553
4085
  }))?.data ?? []
2554
4086
  });
2555
4087
 
2556
- const ListQuery$2 = (options) => ({
4088
+ const ListQuery$4 = (options) => ({
2557
4089
  [QUERY_KEYS.STATUS]: options.status,
2558
4090
  [QUERY_KEYS.SEARCH]: options.search,
2559
4091
  [QUERY_KEYS.SORT]: options.sort
@@ -2566,84 +4098,85 @@ const WindowQuery$1 = (options) => ({
2566
4098
  [QUERY_KEYS.OFFSET_MINUTES]: options.offsetMinutes
2567
4099
  });
2568
4100
  const Templates = (transport) => ({
2569
- list: (options = {}) => FetchPage(transport, PATHS.TEMPLATES, CURSOR_STYLES.CURSOR, options, ListQuery$2(options)),
2570
- listAll: (options = {}) => CollectAll(transport, PATHS.TEMPLATES, CURSOR_STYLES.CURSOR, options, ListQuery$2(options)),
2571
- iterate: (options = {}) => IteratePages(transport, PATHS.TEMPLATES, CURSOR_STYLES.CURSOR, options, ListQuery$2(options)),
2572
- listStarters: (options = {}) => FetchList(transport, PATHS.TEMPLATES_STARTERS, options),
2573
- listFonts: (options = {}) => FetchList(transport, PATHS.TEMPLATES_FONTS, options),
2574
- getStarter: (slug, options = {}) => transport.request(TemplateStarterPath(slug), { signal: options.signal, apiKey: options.apiKey }),
2575
- render: (body, options = {}) => transport.request(PATHS.TEMPLATES_RENDER, {
4101
+ list: (options = {}) => FetchPage(transport, API_PATHS.TEMPLATES, CURSOR_STYLES.CURSOR, options, ListQuery$4(options)),
4102
+ listAll: (options = {}) => CollectAll(transport, API_PATHS.TEMPLATES, CURSOR_STYLES.CURSOR, options, ListQuery$4(options)),
4103
+ iterate: (options = {}) => IteratePages(transport, API_PATHS.TEMPLATES, CURSOR_STYLES.CURSOR, options, ListQuery$4(options)),
4104
+ listStarters: (options = {}) => FetchList(transport, API_PATHS.TEMPLATE_STARTERS, options),
4105
+ listFonts: (options = {}) => FetchList(transport, API_PATHS.TEMPLATE_FONTS, options),
4106
+ getStarter: (slug, options = {}) => transport.request(RequestPath(API_PATHS.TEMPLATE_STARTER, { slug }), { signal: options.signal, apiKey: options.apiKey }),
4107
+ render: (body, options = {}) => transport.request(API_PATHS.TEMPLATE_RENDER, {
2576
4108
  method: HTTP_METHODS.POST,
2577
4109
  body,
2578
4110
  repeatable: true,
2579
4111
  signal: options.signal,
2580
4112
  apiKey: options.apiKey
2581
4113
  }),
2582
- get: (idOrSlug, options = {}) => transport.request(TemplatePath(idOrSlug), { signal: options.signal, apiKey: options.apiKey }),
2583
- create: (body, options = {}) => transport.request(PATHS.TEMPLATES, {
4114
+ get: (idOrSlug, options = {}) => transport.request(RequestPath(API_PATHS.TEMPLATE, { id: idOrSlug }), { signal: options.signal, apiKey: options.apiKey }),
4115
+ create: (body, options = {}) => transport.request(API_PATHS.TEMPLATES, {
2584
4116
  method: HTTP_METHODS.POST,
2585
4117
  body,
2586
4118
  signal: options.signal,
2587
4119
  apiKey: options.apiKey
2588
4120
  }),
2589
- update: (idOrSlug, patch, options = {}) => transport.request(TemplatePath(idOrSlug), {
4121
+ update: (idOrSlug, patch, options = {}) => transport.request(RequestPath(API_PATHS.TEMPLATE, { id: idOrSlug }), {
2590
4122
  method: HTTP_METHODS.PATCH,
2591
4123
  body: patch,
2592
4124
  signal: options.signal,
2593
4125
  apiKey: options.apiKey
2594
4126
  }),
2595
- delete: (idOrSlug, options = {}) => transport.request(TemplatePath(idOrSlug), {
4127
+ delete: (idOrSlug, options = {}) => transport.request(RequestPath(API_PATHS.TEMPLATE, { id: idOrSlug }), {
2596
4128
  method: HTTP_METHODS.DELETE,
2597
4129
  signal: options.signal,
2598
4130
  apiKey: options.apiKey
2599
4131
  }),
2600
- duplicate: (idOrSlug, body = {}, options = {}) => transport.request(TemplateChildPath(idOrSlug, SEGMENTS.DUPLICATE), {
4132
+ duplicate: (idOrSlug, body = {}, options = {}) => transport.request(RequestPath(API_PATHS.TEMPLATE_DUPLICATE, { id: idOrSlug }), {
2601
4133
  method: HTTP_METHODS.POST,
2602
4134
  body,
2603
4135
  signal: options.signal,
2604
4136
  apiKey: options.apiKey
2605
4137
  }),
2606
- replaceContent: (idOrSlug, body, options = {}) => transport.request(TemplateChildPath(idOrSlug, SEGMENTS.CONTENT), {
4138
+ replaceContent: (idOrSlug, body, options = {}) => transport.request(RequestPath(API_PATHS.TEMPLATE_CONTENT, { id: idOrSlug }), {
2607
4139
  method: HTTP_METHODS.POST,
2608
4140
  body,
2609
4141
  signal: options.signal,
2610
4142
  apiKey: options.apiKey
2611
4143
  }),
2612
- listVersions: (idOrSlug, options = {}) => FetchPage(transport, TemplateChildPath(idOrSlug, SEGMENTS.VERSIONS), CURSOR_STYLES.CURSOR, options),
2613
- listAllVersions: (idOrSlug, options = {}) => CollectAll(transport, TemplateChildPath(idOrSlug, SEGMENTS.VERSIONS), CURSOR_STYLES.CURSOR, options),
2614
- iterateVersions: (idOrSlug, options = {}) => IteratePages(transport, TemplateChildPath(idOrSlug, SEGMENTS.VERSIONS), CURSOR_STYLES.CURSOR, options),
2615
- getVersion: (idOrSlug, version, options = {}) => transport.request(TemplateVersionPath(idOrSlug, version), { signal: options.signal, apiKey: options.apiKey }),
2616
- deleteVersion: (idOrSlug, version, options = {}) => transport.request(TemplateVersionPath(idOrSlug, version), {
4144
+ listVersions: (idOrSlug, options = {}) => FetchPage(transport, RequestPath(API_PATHS.TEMPLATE_VERSIONS, { id: idOrSlug }), CURSOR_STYLES.CURSOR, options),
4145
+ listAllVersions: (idOrSlug, options = {}) => CollectAll(transport, RequestPath(API_PATHS.TEMPLATE_VERSIONS, { id: idOrSlug }), CURSOR_STYLES.CURSOR, options),
4146
+ iterateVersions: (idOrSlug, options = {}) => IteratePages(transport, RequestPath(API_PATHS.TEMPLATE_VERSIONS, { id: idOrSlug }), CURSOR_STYLES.CURSOR, options),
4147
+ getVersion: (idOrSlug, version, options = {}) => transport.request(RequestPath(API_PATHS.TEMPLATE_VERSION, { id: idOrSlug, version }), { signal: options.signal, apiKey: options.apiKey }),
4148
+ deleteVersion: (idOrSlug, version, options = {}) => transport.request(RequestPath(API_PATHS.TEMPLATE_VERSION, { id: idOrSlug, version }), {
2617
4149
  method: HTTP_METHODS.DELETE,
2618
4150
  signal: options.signal,
2619
4151
  apiKey: options.apiKey
2620
4152
  }),
2621
- restoreVersion: (idOrSlug, version, body = {}, options = {}) => transport.request(TemplateVersionChildPath(idOrSlug, version, SEGMENTS.RESTORE), {
4153
+ restoreVersion: (idOrSlug, version, body = {}, options = {}) => transport.request(RequestPath(API_PATHS.TEMPLATE_VERSION_RESTORE, { id: idOrSlug, version }), {
2622
4154
  method: HTTP_METHODS.POST,
2623
4155
  body,
2624
4156
  signal: options.signal,
2625
4157
  apiKey: options.apiKey
2626
4158
  }),
2627
- publish: (idOrSlug, options = {}) => transport.request(TemplateChildPath(idOrSlug, SEGMENTS.VERSIONS), {
4159
+ publish: (idOrSlug, options = {}) => transport.request(RequestPath(API_PATHS.TEMPLATE_VERSIONS, { id: idOrSlug }), {
2628
4160
  method: HTTP_METHODS.POST,
4161
+ ...(options.expectedVersion === undefined ? {} : { body: { expectedVersion: options.expectedVersion } }),
2629
4162
  repeatable: true,
2630
4163
  signal: options.signal,
2631
4164
  apiKey: options.apiKey
2632
4165
  }),
2633
- preview: (idOrSlug, body = {}, options = {}) => transport.request(TemplateChildPath(idOrSlug, SEGMENTS.PREVIEW), {
4166
+ preview: (idOrSlug, body = {}, options = {}) => transport.request(RequestPath(API_PATHS.TEMPLATE_PREVIEW, { id: idOrSlug }), {
2634
4167
  method: HTTP_METHODS.POST,
2635
4168
  body,
2636
4169
  repeatable: true,
2637
4170
  signal: options.signal,
2638
4171
  apiKey: options.apiKey
2639
4172
  }),
2640
- getAnalytics: (idOrSlug, options = {}) => transport.request(TemplateChildPath(idOrSlug, SEGMENTS.ANALYTICS), {
4173
+ getAnalytics: (idOrSlug, options = {}) => transport.request(RequestPath(API_PATHS.TEMPLATE_ANALYTICS, { id: idOrSlug }), {
2641
4174
  query: WindowQuery$1(options),
2642
4175
  signal: options.signal,
2643
4176
  apiKey: options.apiKey
2644
4177
  }),
2645
4178
  listSends: async (idOrSlug, options = {}) => {
2646
- const envelope = await transport.request(TemplateChildPath(idOrSlug, SEGMENTS.SENDS), {
4179
+ const envelope = await transport.request(RequestPath(API_PATHS.TEMPLATE_SENDS, { id: idOrSlug }), {
2647
4180
  query: {
2648
4181
  ...WindowQuery$1(options),
2649
4182
  [QUERY_KEYS.PAGE]: options.page,
@@ -2665,7 +4198,7 @@ const Templates = (transport) => ({
2665
4198
  pageSize: envelope?.pageSize ?? 0
2666
4199
  };
2667
4200
  },
2668
- send: (idOrSlug, body, options = {}) => transport.request(TemplateChildPath(idOrSlug, SEGMENTS.SEND), {
4201
+ send: (idOrSlug, body, options = {}) => transport.request(RequestPath(API_PATHS.TEMPLATE_SEND, { id: idOrSlug }), {
2669
4202
  method: HTTP_METHODS.POST,
2670
4203
  body: TemplateSendToWire(body),
2671
4204
  idempotent: true,
@@ -2673,84 +4206,160 @@ const Templates = (transport) => ({
2673
4206
  repeatable: true,
2674
4207
  signal: options.signal,
2675
4208
  apiKey: options.apiKey
4209
+ }),
4210
+ listImages: (options = {}) => FetchPage(transport, API_PATHS.TEMPLATE_IMAGES, CURSOR_STYLES.CURSOR, options),
4211
+ listAllImages: (options = {}) => CollectAll(transport, API_PATHS.TEMPLATE_IMAGES, CURSOR_STYLES.CURSOR, options),
4212
+ iterateImages: (options = {}) => IteratePages(transport, API_PATHS.TEMPLATE_IMAGES, CURSOR_STYLES.CURSOR, options),
4213
+ uploadImage: (data, options = {}) => transport.request(API_PATHS.TEMPLATE_IMAGES, {
4214
+ method: HTTP_METHODS.POST,
4215
+ raw: data,
4216
+ contentType: options.contentType ?? (typeof Blob !== 'undefined' && data instanceof Blob && data.type ? data.type : undefined),
4217
+ signal: options.signal,
4218
+ apiKey: options.apiKey
4219
+ }),
4220
+ design: (body, options = {}) => transport.request(API_PATHS.TEMPLATES_DESIGN, {
4221
+ method: HTTP_METHODS.POST,
4222
+ body,
4223
+ signal: options.signal,
4224
+ apiKey: options.apiKey
4225
+ }),
4226
+ redesign: (idOrSlug, body, options = {}) => transport.request(RequestPath(API_PATHS.TEMPLATE_REDESIGN, { id: idOrSlug }), {
4227
+ method: HTTP_METHODS.POST,
4228
+ body,
4229
+ signal: options.signal,
4230
+ apiKey: options.apiKey
2676
4231
  })
2677
4232
  });
2678
4233
 
2679
- const ListQuery$1 = (options) => ({
4234
+ const ListQuery$3 = (options) => ({
2680
4235
  [QUERY_KEYS.FOLDER]: options.folder,
2681
4236
  [QUERY_KEYS.QUERY]: options.query,
2682
4237
  [QUERY_KEYS.LABEL_IDS]: Array.isArray(options.labelIds) ? options.labelIds.join(LIST_SEPARATOR) : options.labelIds,
2683
4238
  [QUERY_KEYS.SORT]: options.sort,
2684
4239
  [QUERY_KEYS.DATE_FROM]: options.dateFrom === undefined ? undefined : ToInstant(options.dateFrom),
2685
4240
  [QUERY_KEYS.DATE_TO]: options.dateTo === undefined ? undefined : ToInstant(options.dateTo),
2686
- [QUERY_KEYS.FROM_CONTACTS]: options.fromContacts === undefined ? undefined : String(options.fromContacts)
4241
+ [QUERY_KEYS.FROM_CONTACTS]: options.fromContacts === undefined ? undefined : String(options.fromContacts),
4242
+ [QUERY_KEYS.SEMANTIC]: options.semantic === undefined ? undefined : String(options.semantic),
4243
+ [QUERY_KEYS.ADDRESS]: options.address
2687
4244
  });
2688
4245
  const Threads = (transport) => ({
2689
- list: (options = {}) => FetchPage(transport, PATHS.THREADS, CURSOR_STYLES.PAGE_TOKEN, options, ListQuery$1(options)),
2690
- listAll: (options = {}) => CollectAll(transport, PATHS.THREADS, CURSOR_STYLES.PAGE_TOKEN, options, ListQuery$1(options)),
2691
- iterate: (options = {}) => IteratePages(transport, PATHS.THREADS, CURSOR_STYLES.PAGE_TOKEN, options, ListQuery$1(options)),
2692
- get: (id, options = {}) => transport.request(ThreadPath(id), { signal: options.signal, apiKey: options.apiKey }),
2693
- update: (id, patch, options = {}) => transport.request(ThreadPath(id), {
4246
+ list: (options = {}) => FetchPage(transport, API_PATHS.THREADS, CURSOR_STYLES.PAGE_TOKEN, options, ListQuery$3(options)),
4247
+ listAll: (options = {}) => CollectAll(transport, API_PATHS.THREADS, CURSOR_STYLES.PAGE_TOKEN, options, ListQuery$3(options)),
4248
+ iterate: (options = {}) => IteratePages(transport, API_PATHS.THREADS, CURSOR_STYLES.PAGE_TOKEN, options, ListQuery$3(options)),
4249
+ get: (id, options = {}) => transport.request(RequestPath(API_PATHS.THREAD, { id }), { signal: options.signal, apiKey: options.apiKey }),
4250
+ update: (id, patch, options = {}) => transport.request(RequestPath(API_PATHS.THREAD, { id }), {
2694
4251
  method: HTTP_METHODS.PATCH,
2695
4252
  body: patch,
2696
4253
  repeatable: true,
2697
4254
  signal: options.signal,
2698
4255
  apiKey: options.apiKey
2699
4256
  }),
2700
- trash: (id, options = {}) => transport.request(ThreadChildPath(id, SEGMENTS.TRASH), {
4257
+ trash: (id, options = {}) => transport.request(RequestPath(API_PATHS.THREAD_TRASH, { id }), {
2701
4258
  method: HTTP_METHODS.POST,
2702
4259
  repeatable: true,
2703
4260
  signal: options.signal,
2704
4261
  apiKey: options.apiKey
2705
4262
  }),
2706
- snooze: (id, wakeAt, options = {}) => transport.request(ThreadChildPath(id, SEGMENTS.SNOOZE), {
4263
+ snooze: (id, wakeAt, options = {}) => transport.request(RequestPath(API_PATHS.THREAD_SNOOZE, { id }), {
2707
4264
  method: HTTP_METHODS.POST,
2708
4265
  body: { wakeAt: ToInstant(wakeAt) },
2709
4266
  repeatable: true,
2710
4267
  signal: options.signal,
2711
4268
  apiKey: options.apiKey
2712
4269
  }),
2713
- unsnooze: (id, options = {}) => transport.request(ThreadChildPath(id, SEGMENTS.UNSNOOZE), {
4270
+ unsnooze: (id, options = {}) => transport.request(RequestPath(API_PATHS.THREAD_UNSNOOZE, { id }), {
4271
+ method: HTTP_METHODS.POST,
4272
+ repeatable: true,
4273
+ signal: options.signal,
4274
+ apiKey: options.apiKey
4275
+ }),
4276
+ listAttachments: (id, messageId, options = {}) => FetchList(transport, RequestPath(API_PATHS.THREAD_MESSAGE_ATTACHMENTS, { id, messageId }), options),
4277
+ getEvent: (id, options = {}) => transport.request(RequestPath(API_PATHS.THREAD_EVENT, { id }), { signal: options.signal, apiKey: options.apiKey }),
4278
+ listNotes: (id, options = {}) => FetchList(transport, RequestPath(API_PATHS.THREAD_NOTES, { id }), options),
4279
+ createNote: (id, body, options = {}) => transport.request(RequestPath(API_PATHS.THREAD_NOTES, { id }), {
4280
+ method: HTTP_METHODS.POST,
4281
+ body,
4282
+ signal: options.signal,
4283
+ apiKey: options.apiKey
4284
+ }),
4285
+ updateNote: (id, noteId, patch, options = {}) => transport.request(RequestPath(API_PATHS.THREAD_NOTE, { id, noteId }), {
4286
+ method: HTTP_METHODS.PATCH,
4287
+ body: patch,
4288
+ repeatable: true,
4289
+ signal: options.signal,
4290
+ apiKey: options.apiKey
4291
+ }),
4292
+ deleteNote: (id, noteId, options = {}) => transport.request(RequestPath(API_PATHS.THREAD_NOTE, { id, noteId }), {
4293
+ method: HTTP_METHODS.DELETE,
4294
+ signal: options.signal,
4295
+ apiKey: options.apiKey
4296
+ }),
4297
+ reorderNotes: (id, ids, options = {}) => transport.request(RequestPath(API_PATHS.THREAD_NOTES_REORDER, { id }), {
4298
+ method: HTTP_METHODS.POST,
4299
+ body: { ids },
4300
+ repeatable: true,
4301
+ signal: options.signal,
4302
+ apiKey: options.apiKey
4303
+ }).then(payload => payload?.data ?? []),
4304
+ counts: (options = {}) => transport.request(API_PATHS.THREADS_COUNTS, {
4305
+ query: { [QUERY_KEYS.ADDRESS]: options.address },
4306
+ signal: options.signal,
4307
+ apiKey: options.apiKey
4308
+ }),
4309
+ summary: (id, options = {}) => transport.request(RequestPath(API_PATHS.THREAD_SUMMARY, { id }), { signal: options.signal, apiKey: options.apiKey }),
4310
+ replySuggestions: (id, options = {}) => transport.request(RequestPath(API_PATHS.THREAD_REPLY_SUGGESTIONS, { id }), { signal: options.signal, apiKey: options.apiKey }),
4311
+ restore: (id, options = {}) => transport.request(RequestPath(API_PATHS.THREAD_RESTORE, { id }), {
2714
4312
  method: HTTP_METHODS.POST,
2715
4313
  repeatable: true,
2716
4314
  signal: options.signal,
2717
4315
  apiKey: options.apiKey
2718
4316
  }),
2719
- listAttachments: (id, messageId, options = {}) => FetchList(transport, ThreadMessageAttachmentsPath(id, messageId), options)
4317
+ delete: (id, options = {}) => transport.request(RequestPath(API_PATHS.THREAD, { id }), {
4318
+ method: HTTP_METHODS.DELETE,
4319
+ signal: options.signal,
4320
+ apiKey: options.apiKey
4321
+ }),
4322
+ unsubscribe: (id, options = {}) => transport.request(RequestPath(API_PATHS.THREAD_UNSUBSCRIBE, { id }), {
4323
+ method: HTTP_METHODS.POST,
4324
+ signal: options.signal,
4325
+ apiKey: options.apiKey
4326
+ })
2720
4327
  });
2721
4328
 
2722
4329
  const Flag = (value) => value === undefined ? undefined : String(value);
2723
4330
  const HitQuery = (options) => ({
2724
4331
  [QUERY_KEYS.INCLUDE_MACHINE]: Flag(options.includeMachine)
2725
4332
  });
2726
- const ListQuery = (options) => ({
4333
+ const ListQuery$2 = (options) => ({
2727
4334
  [QUERY_KEYS.OPENED]: Flag(options.opened),
2728
4335
  [QUERY_KEYS.CLICKED]: Flag(options.clicked),
2729
4336
  [QUERY_KEYS.DAYS]: options.days,
2730
4337
  [QUERY_KEYS.MINUTES]: options.minutes,
2731
- [QUERY_KEYS.GRAIN]: options.grain
4338
+ [QUERY_KEYS.GRAIN]: options.grain,
4339
+ [QUERY_KEYS.ADDRESS]: options.address
2732
4340
  });
2733
4341
  const Tracking = (transport) => ({
2734
- list: (options = {}) => FetchPage(transport, PATHS.TRACKING, CURSOR_STYLES.CURSOR, options, ListQuery(options)),
2735
- listAll: (options = {}) => CollectAll(transport, PATHS.TRACKING, CURSOR_STYLES.CURSOR, options, ListQuery(options)),
2736
- iterate: (options = {}) => IteratePages(transport, PATHS.TRACKING, CURSOR_STYLES.CURSOR, options, ListQuery(options)),
2737
- getStats: (options = {}) => transport.request(PATHS.TRACKING_STATS, {
4342
+ list: (options = {}) => FetchPage(transport, API_PATHS.TRACKING, CURSOR_STYLES.CURSOR, options, ListQuery$2(options)),
4343
+ listAll: (options = {}) => CollectAll(transport, API_PATHS.TRACKING, CURSOR_STYLES.CURSOR, options, ListQuery$2(options)),
4344
+ iterate: (options = {}) => IteratePages(transport, API_PATHS.TRACKING, CURSOR_STYLES.CURSOR, options, ListQuery$2(options)),
4345
+ getStats: (options = {}) => transport.request(API_PATHS.TRACKING_STATS, {
2738
4346
  query: {
2739
4347
  [QUERY_KEYS.DAYS]: options.days,
2740
4348
  [QUERY_KEYS.MINUTES]: options.minutes,
2741
4349
  [QUERY_KEYS.GRAIN]: options.grain,
2742
- [QUERY_KEYS.OFFSET_MINUTES]: options.offsetMinutes
4350
+ [QUERY_KEYS.OFFSET_MINUTES]: options.offsetMinutes,
4351
+ [QUERY_KEYS.ADDRESS]: options.address
2743
4352
  },
2744
4353
  signal: options.signal,
2745
4354
  apiKey: options.apiKey
2746
4355
  }),
2747
- get: (id, options = {}) => transport.request(TrackingPath(id), { signal: options.signal, apiKey: options.apiKey }),
2748
- listOpens: (id, options = {}) => FetchPage(transport, TrackingChildPath(id, SEGMENTS.OPENS), CURSOR_STYLES.CURSOR, options, HitQuery(options)),
2749
- listAllOpens: (id, options = {}) => CollectAll(transport, TrackingChildPath(id, SEGMENTS.OPENS), CURSOR_STYLES.CURSOR, options, HitQuery(options)),
2750
- iterateOpens: (id, options = {}) => IteratePages(transport, TrackingChildPath(id, SEGMENTS.OPENS), CURSOR_STYLES.CURSOR, options, HitQuery(options)),
2751
- listClicks: (id, options = {}) => FetchPage(transport, TrackingChildPath(id, SEGMENTS.CLICKS), CURSOR_STYLES.CURSOR, options, HitQuery(options)),
2752
- listAllClicks: (id, options = {}) => CollectAll(transport, TrackingChildPath(id, SEGMENTS.CLICKS), CURSOR_STYLES.CURSOR, options, HitQuery(options)),
2753
- iterateClicks: (id, options = {}) => IteratePages(transport, TrackingChildPath(id, SEGMENTS.CLICKS), CURSOR_STYLES.CURSOR, options, HitQuery(options))
4356
+ get: (id, options = {}) => transport.request(RequestPath(API_PATHS.TRACKED, { id }), { signal: options.signal, apiKey: options.apiKey }),
4357
+ listOpens: (id, options = {}) => FetchPage(transport, RequestPath(API_PATHS.TRACKED_OPENS, { id }), CURSOR_STYLES.CURSOR, options, HitQuery(options)),
4358
+ listAllOpens: (id, options = {}) => CollectAll(transport, RequestPath(API_PATHS.TRACKED_OPENS, { id }), CURSOR_STYLES.CURSOR, options, HitQuery(options)),
4359
+ iterateOpens: (id, options = {}) => IteratePages(transport, RequestPath(API_PATHS.TRACKED_OPENS, { id }), CURSOR_STYLES.CURSOR, options, HitQuery(options)),
4360
+ listClicks: (id, options = {}) => FetchPage(transport, RequestPath(API_PATHS.TRACKED_CLICKS, { id }), CURSOR_STYLES.CURSOR, options, HitQuery(options)),
4361
+ listAllClicks: (id, options = {}) => CollectAll(transport, RequestPath(API_PATHS.TRACKED_CLICKS, { id }), CURSOR_STYLES.CURSOR, options, HitQuery(options)),
4362
+ iterateClicks: (id, options = {}) => IteratePages(transport, RequestPath(API_PATHS.TRACKED_CLICKS, { id }), CURSOR_STYLES.CURSOR, options, HitQuery(options))
2754
4363
  });
2755
4364
 
2756
4365
  const WindowQuery = (options) => ({
@@ -2770,56 +4379,350 @@ const WorkspaceActivityQuery = (options) => ({
2770
4379
  [QUERY_KEYS.ENDPOINT_IDS]: options.endpointIds?.join(LIST_SEPARATOR)
2771
4380
  });
2772
4381
  const Webhooks = (transport) => ({
2773
- list: (options = {}) => FetchPage(transport, PATHS.WEBHOOKS, CURSOR_STYLES.CURSOR, options),
2774
- listAll: (options = {}) => CollectAll(transport, PATHS.WEBHOOKS, CURSOR_STYLES.CURSOR, options),
2775
- iterate: (options = {}) => IteratePages(transport, PATHS.WEBHOOKS, CURSOR_STYLES.CURSOR, options),
2776
- get: (id, options = {}) => transport.request(WebhookPath(id), { signal: options.signal, apiKey: options.apiKey }),
2777
- create: (body, options = {}) => transport.request(PATHS.WEBHOOKS, {
4382
+ list: (options = {}) => FetchPage(transport, API_PATHS.WEBHOOKS, CURSOR_STYLES.CURSOR, options),
4383
+ listAll: (options = {}) => CollectAll(transport, API_PATHS.WEBHOOKS, CURSOR_STYLES.CURSOR, options),
4384
+ iterate: (options = {}) => IteratePages(transport, API_PATHS.WEBHOOKS, CURSOR_STYLES.CURSOR, options),
4385
+ get: (id, options = {}) => transport.request(RequestPath(API_PATHS.WEBHOOK, { id }), { signal: options.signal, apiKey: options.apiKey }),
4386
+ create: (body, options = {}) => transport.request(API_PATHS.WEBHOOKS, {
2778
4387
  method: HTTP_METHODS.POST,
2779
4388
  body,
2780
4389
  signal: options.signal,
2781
4390
  apiKey: options.apiKey
2782
4391
  }),
2783
- update: (id, patch, options = {}) => transport.request(WebhookPath(id), {
4392
+ update: (id, patch, options = {}) => transport.request(RequestPath(API_PATHS.WEBHOOK, { id }), {
2784
4393
  method: HTTP_METHODS.PATCH,
2785
4394
  body: patch,
2786
4395
  repeatable: true,
2787
4396
  signal: options.signal,
2788
4397
  apiKey: options.apiKey
2789
4398
  }),
2790
- delete: (id, options = {}) => transport.request(WebhookPath(id), {
4399
+ delete: (id, options = {}) => transport.request(RequestPath(API_PATHS.WEBHOOK, { id }), {
4400
+ method: HTTP_METHODS.DELETE,
4401
+ signal: options.signal,
4402
+ apiKey: options.apiKey
4403
+ }),
4404
+ rotateSecret: (id, options = {}) => transport.request(RequestPath(API_PATHS.WEBHOOK_ROTATE_SECRET, { id }), {
4405
+ method: HTTP_METHODS.POST,
4406
+ signal: options.signal,
4407
+ apiKey: options.apiKey
4408
+ }),
4409
+ test: (id, options = {}) => transport.request(RequestPath(API_PATHS.WEBHOOK_TEST, { id }), {
4410
+ method: HTTP_METHODS.POST,
4411
+ signal: options.signal,
4412
+ apiKey: options.apiKey
4413
+ }),
4414
+ listDeliveries: (id, options = {}) => FetchPage(transport, RequestPath(API_PATHS.WEBHOOK_DELIVERIES, { id }), CURSOR_STYLES.CURSOR, options, DeliveryQuery(options)),
4415
+ listAllDeliveries: (id, options = {}) => CollectAll(transport, RequestPath(API_PATHS.WEBHOOK_DELIVERIES, { id }), CURSOR_STYLES.CURSOR, options, DeliveryQuery(options)),
4416
+ iterateDeliveries: (id, options = {}) => IteratePages(transport, RequestPath(API_PATHS.WEBHOOK_DELIVERIES, { id }), CURSOR_STYLES.CURSOR, options, DeliveryQuery(options)),
4417
+ listWorkspaceDeliveries: (options = {}) => FetchPage(transport, API_PATHS.WEBHOOKS_DELIVERIES, CURSOR_STYLES.CURSOR, options, WorkspaceDeliveryQuery(options)),
4418
+ listAllWorkspaceDeliveries: (options = {}) => CollectAll(transport, API_PATHS.WEBHOOKS_DELIVERIES, CURSOR_STYLES.CURSOR, options, WorkspaceDeliveryQuery(options)),
4419
+ iterateWorkspaceDeliveries: (options = {}) => IteratePages(transport, API_PATHS.WEBHOOKS_DELIVERIES, CURSOR_STYLES.CURSOR, options, WorkspaceDeliveryQuery(options)),
4420
+ listActivity: (id, options = {}) => FetchPage(transport, RequestPath(API_PATHS.WEBHOOK_ACTIVITY, { id }), CURSOR_STYLES.CURSOR, options, WindowQuery(options)),
4421
+ listAllActivity: (id, options = {}) => CollectAll(transport, RequestPath(API_PATHS.WEBHOOK_ACTIVITY, { id }), CURSOR_STYLES.CURSOR, options, WindowQuery(options)),
4422
+ iterateActivity: (id, options = {}) => IteratePages(transport, RequestPath(API_PATHS.WEBHOOK_ACTIVITY, { id }), CURSOR_STYLES.CURSOR, options, WindowQuery(options)),
4423
+ listWorkspaceActivity: (options = {}) => FetchPage(transport, API_PATHS.WEBHOOKS_ACTIVITY, CURSOR_STYLES.CURSOR, options, WorkspaceActivityQuery(options)),
4424
+ listAllWorkspaceActivity: (options = {}) => CollectAll(transport, API_PATHS.WEBHOOKS_ACTIVITY, CURSOR_STYLES.CURSOR, options, WorkspaceActivityQuery(options)),
4425
+ iterateWorkspaceActivity: (options = {}) => IteratePages(transport, API_PATHS.WEBHOOKS_ACTIVITY, CURSOR_STYLES.CURSOR, options, WorkspaceActivityQuery(options)),
4426
+ getDelivery: (id, deliveryId, options = {}) => transport.request(RequestPath(API_PATHS.WEBHOOK_DELIVERY, { id, deliveryId }), {
4427
+ signal: options.signal,
4428
+ apiKey: options.apiKey
4429
+ }),
4430
+ replayDelivery: (id, deliveryId, options = {}) => transport.request(RequestPath(API_PATHS.WEBHOOK_DELIVERY_REPLAY, { id, deliveryId }), {
4431
+ method: HTTP_METHODS.POST,
4432
+ signal: options.signal,
4433
+ apiKey: options.apiKey
4434
+ }),
4435
+ listEvents: (options = {}) => transport.request(API_PATHS.WEBHOOKS_EVENTS, {
4436
+ signal: options.signal,
4437
+ apiKey: options.apiKey
4438
+ }),
4439
+ stats: (options = {}) => transport.request(API_PATHS.WEBHOOKS_STATS, {
4440
+ query: {
4441
+ ...WindowQuery(options),
4442
+ [QUERY_KEYS.ENDPOINT_IDS]: options.endpointIds?.join(LIST_SEPARATOR),
4443
+ [QUERY_KEYS.GRAIN]: options.grain,
4444
+ [QUERY_KEYS.OFFSET_MINUTES]: options.offsetMinutes
4445
+ },
4446
+ signal: options.signal,
4447
+ apiKey: options.apiKey
4448
+ })
4449
+ });
4450
+
4451
+ const Tools = (transport) => ({
4452
+ checkDmarc: (domain, options = {}) => transport.request(API_PATHS.TOOLS_DMARC, {
4453
+ query: { [QUERY_KEYS.DOMAIN]: domain },
4454
+ signal: options.signal,
4455
+ apiKey: options.apiKey
4456
+ }),
4457
+ checkBimi: (domain, options = {}) => transport.request(API_PATHS.TOOLS_BIMI, {
4458
+ query: { [QUERY_KEYS.DOMAIN]: domain },
4459
+ signal: options.signal,
4460
+ apiKey: options.apiKey
4461
+ }),
4462
+ checkDeliverability: (domain, options = {}) => transport.request(API_PATHS.TOOLS_DELIVERABILITY, {
4463
+ query: { [QUERY_KEYS.DOMAIN]: domain },
4464
+ signal: options.signal,
4465
+ apiKey: options.apiKey
4466
+ }),
4467
+ readVerificationCode: (body, options = {}) => transport.request(API_PATHS.TOOLS_VERIFICATION_CODE, {
4468
+ method: HTTP_METHODS.POST,
4469
+ body,
4470
+ signal: options.signal,
4471
+ apiKey: options.apiKey
4472
+ }),
4473
+ estimateCost: (options = {}) => transport.request(API_PATHS.TOOLS_COST, {
4474
+ query: {
4475
+ [QUERY_KEYS.SENDS]: options.sends,
4476
+ [QUERY_KEYS.DOMAINS]: options.domains,
4477
+ [QUERY_KEYS.PEOPLE]: options.people,
4478
+ [QUERY_KEYS.AI_ACTIONS]: options.aiActions,
4479
+ [QUERY_KEYS.INTERVAL]: options.interval
4480
+ },
4481
+ signal: options.signal,
4482
+ apiKey: options.apiKey
4483
+ })
4484
+ });
4485
+
4486
+ const Support = (transport) => ({
4487
+ send: (body, options = {}) => transport.request(API_PATHS.SUPPORT, {
4488
+ method: HTTP_METHODS.POST,
4489
+ body,
4490
+ signal: options.signal,
4491
+ apiKey: options.apiKey
4492
+ })
4493
+ });
4494
+
4495
+ const Encryption = (transport) => ({
4496
+ listKeys: (options = {}) => FetchList(transport, API_PATHS.ENCRYPTION_KEYS, options),
4497
+ publishKey: (body, options = {}) => transport.request(API_PATHS.ENCRYPTION_KEYS, {
4498
+ method: HTTP_METHODS.POST,
4499
+ body,
4500
+ signal: options.signal,
4501
+ apiKey: options.apiKey
4502
+ }),
4503
+ lookupKeys: (options) => FetchList(transport, API_PATHS.ENCRYPTION_KEYS_LOOKUP, options, {
4504
+ [QUERY_KEYS.ADDRESSES]: options.addresses.join(LIST_SEPARATOR)
4505
+ })
4506
+ });
4507
+
4508
+ const Senders = (transport) => ({
4509
+ get: (email, options = {}) => transport.request(RequestPath(API_PATHS.SENDER, { email }), { signal: options.signal, apiKey: options.apiKey }),
4510
+ research: (email, options = {}) => transport.request(RequestPath(API_PATHS.SENDER_RESEARCH, { email }), {
4511
+ method: HTTP_METHODS.POST,
4512
+ repeatable: true,
4513
+ signal: options.signal,
4514
+ apiKey: options.apiKey
4515
+ })
4516
+ });
4517
+
4518
+ const ListQuery$1 = (options) => ({
4519
+ [QUERY_KEYS.Q]: options.q,
4520
+ [QUERY_KEYS.SORT]: options.sort
4521
+ });
4522
+ const Chats = (transport) => ({
4523
+ list: (options = {}) => FetchPage(transport, API_PATHS.CHATS, CURSOR_STYLES.CURSOR, options, ListQuery$1(options)),
4524
+ listAll: (options = {}) => CollectAll(transport, API_PATHS.CHATS, CURSOR_STYLES.CURSOR, options, ListQuery$1(options)),
4525
+ iterate: (options = {}) => IteratePages(transport, API_PATHS.CHATS, CURSOR_STYLES.CURSOR, options, ListQuery$1(options)),
4526
+ get: (id, options = {}) => transport.request(RequestPath(API_PATHS.CHAT, { id }), { signal: options.signal, apiKey: options.apiKey }),
4527
+ rename: (id, title, options = {}) => transport.request(RequestPath(API_PATHS.CHAT, { id }), {
4528
+ method: HTTP_METHODS.PATCH,
4529
+ body: { title },
4530
+ repeatable: true,
4531
+ signal: options.signal,
4532
+ apiKey: options.apiKey
4533
+ }),
4534
+ delete: (id, options = {}) => transport.request(RequestPath(API_PATHS.CHAT, { id }), {
2791
4535
  method: HTTP_METHODS.DELETE,
2792
4536
  signal: options.signal,
2793
4537
  apiKey: options.apiKey
4538
+ })
4539
+ });
4540
+
4541
+ const MailboxQuery = (options) => ({
4542
+ [QUERY_KEYS.FROM]: options.from === undefined ? undefined : ToInstant(options.from),
4543
+ [QUERY_KEYS.TO]: options.to === undefined ? undefined : ToInstant(options.to),
4544
+ [QUERY_KEYS.OFFSET_MINUTES]: options.offsetMinutes,
4545
+ [QUERY_KEYS.GRAIN]: options.grain,
4546
+ [QUERY_KEYS.ADDRESS]: options.address
4547
+ });
4548
+ const SendingQuery = (options) => ({
4549
+ [QUERY_KEYS.DAYS]: options.days,
4550
+ [QUERY_KEYS.MINUTES]: options.minutes,
4551
+ [QUERY_KEYS.OFFSET_MINUTES]: options.offsetMinutes,
4552
+ [QUERY_KEYS.GRAIN]: options.grain,
4553
+ [QUERY_KEYS.ADDRESS]: options.address
4554
+ });
4555
+ const Analytics = (transport) => ({
4556
+ mailbox: (options = {}) => transport.request(API_PATHS.ANALYTICS_MAILBOX, {
4557
+ query: MailboxQuery(options),
4558
+ signal: options.signal,
4559
+ apiKey: options.apiKey
4560
+ }),
4561
+ sending: (options = {}) => transport.request(API_PATHS.ANALYTICS_SENDING, {
4562
+ query: SendingQuery(options),
4563
+ signal: options.signal,
4564
+ apiKey: options.apiKey
4565
+ })
4566
+ });
4567
+
4568
+ const ListQuery = (options) => ({
4569
+ [QUERY_KEYS.STATUS]: options.status,
4570
+ [QUERY_KEYS.Q]: options.q,
4571
+ [QUERY_KEYS.SORT]: options.sort,
4572
+ [QUERY_KEYS.LIMIT]: options.limit,
4573
+ [QUERY_KEYS.OFFSET]: options.offset,
4574
+ [QUERY_KEYS.ADDRESS]: options.address
4575
+ });
4576
+ const Subscriptions = (transport) => ({
4577
+ list: (options = {}) => transport.request(API_PATHS.SUBSCRIPTIONS, {
4578
+ query: ListQuery(options),
4579
+ signal: options.signal,
4580
+ apiKey: options.apiKey
4581
+ }),
4582
+ listDomains: (options = {}) => transport.request(API_PATHS.SUBSCRIPTION_DOMAINS, {
4583
+ query: ListQuery(options),
4584
+ signal: options.signal,
4585
+ apiKey: options.apiKey
4586
+ }),
4587
+ unsubscribe: (id, body = {}, options = {}) => transport.request(RequestPath(API_PATHS.SUBSCRIPTION_UNSUBSCRIBE, { id }), {
4588
+ method: HTTP_METHODS.POST,
4589
+ body,
4590
+ signal: options.signal,
4591
+ apiKey: options.apiKey
4592
+ }),
4593
+ unsubscribeDomain: (domain, body = {}, options = {}) => transport.request(RequestPath(API_PATHS.SUBSCRIPTION_DOMAIN_UNSUBSCRIBE, { domain }), {
4594
+ method: HTTP_METHODS.POST,
4595
+ body,
4596
+ signal: options.signal,
4597
+ apiKey: options.apiKey
4598
+ }),
4599
+ move: (id, body, options = {}) => transport.request(RequestPath(API_PATHS.SUBSCRIPTION_MOVE, { id }), {
4600
+ method: HTTP_METHODS.POST,
4601
+ body,
4602
+ repeatable: true,
4603
+ signal: options.signal,
4604
+ apiKey: options.apiKey
4605
+ })
4606
+ });
4607
+
4608
+ const Exports = (transport) => ({
4609
+ preview: (options = {}) => transport.request(API_PATHS.MAILBOX_EXPORTS_PREVIEW, { signal: options.signal, apiKey: options.apiKey }),
4610
+ list: (options = {}) => transport.request(API_PATHS.MAILBOX_EXPORTS, {
4611
+ query: { [QUERY_KEYS.LIMIT]: options.limit, [QUERY_KEYS.OFFSET]: options.offset },
4612
+ signal: options.signal,
4613
+ apiKey: options.apiKey
2794
4614
  }),
2795
- rotateSecret: (id, options = {}) => transport.request(WebhookChildPath(id, SEGMENTS.ROTATE_SECRET), {
4615
+ get: (id, options = {}) => transport.request(RequestPath(API_PATHS.MAILBOX_EXPORT, { id }), { signal: options.signal, apiKey: options.apiKey }),
4616
+ start: (options = {}) => transport.request(API_PATHS.MAILBOX_EXPORTS, {
2796
4617
  method: HTTP_METHODS.POST,
2797
4618
  signal: options.signal,
2798
4619
  apiKey: options.apiKey
2799
4620
  }),
2800
- test: (id, options = {}) => transport.request(WebhookChildPath(id, SEGMENTS.TEST), {
4621
+ download: (id, options = {}) => transport.request(RequestPath(API_PATHS.MAILBOX_EXPORT_CONTENT, { id }), {
4622
+ binary: true,
4623
+ signal: options.signal,
4624
+ apiKey: options.apiKey
4625
+ })
4626
+ });
4627
+
4628
+ const DnsConnections = (transport) => ({
4629
+ list: (options = {}) => transport.request(API_PATHS.DNS_CONNECTIONS, { signal: options.signal, apiKey: options.apiKey }),
4630
+ get: (id, options = {}) => transport.request(RequestPath(API_PATHS.DNS_CONNECTION, { id }), { signal: options.signal, apiKey: options.apiKey }),
4631
+ delete: (id, options = {}) => transport.request(RequestPath(API_PATHS.DNS_CONNECTION, { id }), {
4632
+ method: HTTP_METHODS.DELETE,
4633
+ signal: options.signal,
4634
+ apiKey: options.apiKey
4635
+ })
4636
+ });
4637
+
4638
+ const Workspaces = (transport) => ({
4639
+ list: (options = {}) => transport.request(API_PATHS.WORKSPACES, { signal: options.signal, apiKey: options.apiKey }),
4640
+ create: (body, options = {}) => transport.request(API_PATHS.WORKSPACES, {
2801
4641
  method: HTTP_METHODS.POST,
4642
+ body,
4643
+ signal: options.signal,
4644
+ apiKey: options.apiKey
4645
+ }),
4646
+ getActive: (options = {}) => transport.request(API_PATHS.WORKSPACES_ACTIVE, { signal: options.signal, apiKey: options.apiKey }),
4647
+ setActive: (workspaceId, options = {}) => transport.request(API_PATHS.WORKSPACES_ACTIVE, {
4648
+ method: HTTP_METHODS.PUT,
4649
+ body: { workspaceId },
4650
+ repeatable: true,
4651
+ signal: options.signal,
4652
+ apiKey: options.apiKey
4653
+ }),
4654
+ delete: (id, options) => transport.request(RequestPath(API_PATHS.WORKSPACE, { id }), {
4655
+ method: HTTP_METHODS.DELETE,
4656
+ query: { [QUERY_KEYS.CONFIRM]: options.confirm },
4657
+ signal: options.signal,
4658
+ apiKey: options.apiKey
4659
+ })
4660
+ });
4661
+
4662
+ const PhotoType = (data, options) => {
4663
+ if (options.contentType)
4664
+ return options.contentType;
4665
+ return typeof Blob !== 'undefined' && data instanceof Blob && data.type ? data.type : undefined;
4666
+ };
4667
+ const Account = (transport) => ({
4668
+ getNotifications: (options = {}) => transport.request(API_PATHS.ACCOUNT_NOTIFICATIONS, { signal: options.signal, apiKey: options.apiKey }),
4669
+ setEmailNotification: (category, body, options = {}) => transport.request(RequestPath(API_PATHS.ACCOUNT_NOTIFICATION_EMAIL, { category }), {
4670
+ method: HTTP_METHODS.PUT,
4671
+ body: { enabled: body.enabled },
4672
+ repeatable: true,
4673
+ signal: options.signal,
4674
+ apiKey: options.apiKey
4675
+ }),
4676
+ setPushMuted: (workspaceId, body, options = {}) => transport.request(RequestPath(API_PATHS.ACCOUNT_NOTIFICATION_PUSH, { workspaceId }), {
4677
+ method: HTTP_METHODS.PUT,
4678
+ body: { muted: body.muted },
4679
+ repeatable: true,
4680
+ signal: options.signal,
4681
+ apiKey: options.apiKey
4682
+ }),
4683
+ setPhoto: (data, options = {}) => transport.request(API_PATHS.ACCOUNT_PHOTO, {
4684
+ method: HTTP_METHODS.PUT,
4685
+ raw: data,
4686
+ contentType: PhotoType(data, options),
4687
+ repeatable: true,
4688
+ signal: options.signal,
4689
+ apiKey: options.apiKey
4690
+ }),
4691
+ removePhoto: (options = {}) => transport.request(API_PATHS.ACCOUNT_PHOTO, {
4692
+ method: HTTP_METHODS.DELETE,
4693
+ repeatable: true,
4694
+ signal: options.signal,
4695
+ apiKey: options.apiKey
4696
+ }),
4697
+ getUsername: (options = {}) => transport.request(API_PATHS.ACCOUNT_USERNAME, { signal: options.signal, apiKey: options.apiKey }),
4698
+ checkUsername: (username, options = {}) => transport.request(API_PATHS.ACCOUNT_USERNAME_AVAILABILITY, {
4699
+ query: { [QUERY_KEYS.USERNAME]: username },
4700
+ signal: options.signal,
4701
+ apiKey: options.apiKey
4702
+ }),
4703
+ setUsername: (username, options = {}) => transport.request(API_PATHS.ACCOUNT_USERNAME, {
4704
+ method: HTTP_METHODS.PUT,
4705
+ body: { username },
4706
+ signal: options.signal,
4707
+ apiKey: options.apiKey
4708
+ }),
4709
+ listConnectedApps: (options = {}) => FetchList(transport, API_PATHS.ACCOUNT_CONNECTED_APPS, options),
4710
+ revokeConnectedApp: (clientId, options = {}) => transport.request(RequestPath(API_PATHS.ACCOUNT_CONNECTED_APP, { clientId }), {
4711
+ method: HTTP_METHODS.DELETE,
2802
4712
  signal: options.signal,
2803
4713
  apiKey: options.apiKey
2804
4714
  }),
2805
- listDeliveries: (id, options = {}) => FetchPage(transport, WebhookChildPath(id, SEGMENTS.DELIVERIES), CURSOR_STYLES.CURSOR, options, DeliveryQuery(options)),
2806
- listAllDeliveries: (id, options = {}) => CollectAll(transport, WebhookChildPath(id, SEGMENTS.DELIVERIES), CURSOR_STYLES.CURSOR, options, DeliveryQuery(options)),
2807
- iterateDeliveries: (id, options = {}) => IteratePages(transport, WebhookChildPath(id, SEGMENTS.DELIVERIES), CURSOR_STYLES.CURSOR, options, DeliveryQuery(options)),
2808
- listWorkspaceDeliveries: (options = {}) => FetchPage(transport, PATHS.WEBHOOKS_DELIVERIES, CURSOR_STYLES.CURSOR, options, WorkspaceDeliveryQuery(options)),
2809
- listAllWorkspaceDeliveries: (options = {}) => CollectAll(transport, PATHS.WEBHOOKS_DELIVERIES, CURSOR_STYLES.CURSOR, options, WorkspaceDeliveryQuery(options)),
2810
- iterateWorkspaceDeliveries: (options = {}) => IteratePages(transport, PATHS.WEBHOOKS_DELIVERIES, CURSOR_STYLES.CURSOR, options, WorkspaceDeliveryQuery(options)),
2811
- listActivity: (id, options = {}) => FetchPage(transport, WebhookChildPath(id, SEGMENTS.ACTIVITY), CURSOR_STYLES.CURSOR, options, WindowQuery(options)),
2812
- listAllActivity: (id, options = {}) => CollectAll(transport, WebhookChildPath(id, SEGMENTS.ACTIVITY), CURSOR_STYLES.CURSOR, options, WindowQuery(options)),
2813
- iterateActivity: (id, options = {}) => IteratePages(transport, WebhookChildPath(id, SEGMENTS.ACTIVITY), CURSOR_STYLES.CURSOR, options, WindowQuery(options)),
2814
- listWorkspaceActivity: (options = {}) => FetchPage(transport, PATHS.WEBHOOKS_ACTIVITY, CURSOR_STYLES.CURSOR, options, WorkspaceActivityQuery(options)),
2815
- listAllWorkspaceActivity: (options = {}) => CollectAll(transport, PATHS.WEBHOOKS_ACTIVITY, CURSOR_STYLES.CURSOR, options, WorkspaceActivityQuery(options)),
2816
- iterateWorkspaceActivity: (options = {}) => IteratePages(transport, PATHS.WEBHOOKS_ACTIVITY, CURSOR_STYLES.CURSOR, options, WorkspaceActivityQuery(options)),
2817
- getDelivery: (id, deliveryId, options = {}) => transport.request(WebhookDeliveryPath(id, deliveryId), {
4715
+ listInvitations: (options = {}) => FetchList(transport, API_PATHS.ACCOUNT_INVITATIONS, options),
4716
+ acceptInvitation: (invitationId, options = {}) => transport.request(RequestPath(API_PATHS.ACCOUNT_INVITATION_ACCEPT, { invitationId }), {
4717
+ method: HTTP_METHODS.POST,
4718
+ body: options.activate === undefined ? {} : { activate: options.activate },
4719
+ repeatable: true,
2818
4720
  signal: options.signal,
2819
4721
  apiKey: options.apiKey
2820
4722
  }),
2821
- replayDelivery: (id, deliveryId, options = {}) => transport.request(WebhookDeliveryReplayPath(id, deliveryId), {
4723
+ declineInvitation: (invitationId, options = {}) => transport.request(RequestPath(API_PATHS.ACCOUNT_INVITATION_DECLINE, { invitationId }), {
2822
4724
  method: HTTP_METHODS.POST,
4725
+ repeatable: true,
2823
4726
  signal: options.signal,
2824
4727
  apiKey: options.apiKey
2825
4728
  })
@@ -2841,8 +4744,12 @@ class OpenEmail {
2841
4744
  labels;
2842
4745
  contacts;
2843
4746
  audiences;
4747
+ billing;
4748
+ forms;
2844
4749
  broadcasts;
2845
4750
  domains;
4751
+ appHost;
4752
+ branding;
2846
4753
  rules;
2847
4754
  webhooks;
2848
4755
  imports;
@@ -2853,7 +4760,19 @@ class OpenEmail {
2853
4760
  members;
2854
4761
  suppressions;
2855
4762
  files;
4763
+ knowledge;
2856
4764
  tempMail;
4765
+ exports;
4766
+ chats;
4767
+ encryption;
4768
+ support;
4769
+ tools;
4770
+ senders;
4771
+ analytics;
4772
+ subscriptions;
4773
+ dnsConnections;
4774
+ workspaces;
4775
+ account;
2857
4776
  constructor(configuration) {
2858
4777
  const options = typeof configuration === 'string' ? { apiKey: configuration } : configuration;
2859
4778
  AssertCredential(options.apiKey, options.accessToken, true);
@@ -2874,8 +4793,12 @@ class OpenEmail {
2874
4793
  this.labels = Labels(this.transport);
2875
4794
  this.contacts = Contacts(this.transport);
2876
4795
  this.audiences = Audiences(this.transport);
4796
+ this.billing = Billing(this.transport);
4797
+ this.forms = Forms(this.transport);
2877
4798
  this.broadcasts = Broadcasts(this.transport);
2878
4799
  this.domains = Domains(this.transport);
4800
+ this.appHost = AppHost(this.transport);
4801
+ this.branding = Branding(this.transport);
2879
4802
  this.rules = Rules(this.transport);
2880
4803
  this.webhooks = Webhooks(this.transport);
2881
4804
  this.imports = Imports(this.transport);
@@ -2886,7 +4809,19 @@ class OpenEmail {
2886
4809
  this.members = Members(this.transport);
2887
4810
  this.suppressions = Suppressions(this.transport);
2888
4811
  this.files = Files(this.transport);
4812
+ this.knowledge = Knowledge(this.transport);
2889
4813
  this.tempMail = TempMail(this.transport);
4814
+ this.exports = Exports(this.transport);
4815
+ this.chats = Chats(this.transport);
4816
+ this.encryption = Encryption(this.transport);
4817
+ this.support = Support(this.transport);
4818
+ this.tools = Tools(this.transport);
4819
+ this.senders = Senders(this.transport);
4820
+ this.analytics = Analytics(this.transport);
4821
+ this.subscriptions = Subscriptions(this.transport);
4822
+ this.dnsConnections = DnsConnections(this.transport);
4823
+ this.workspaces = Workspaces(this.transport);
4824
+ this.account = Account(this.transport);
2890
4825
  }
2891
4826
  get raw() {
2892
4827
  return this.transport;
@@ -2920,7 +4855,7 @@ const HostnameOf = (authority) => {
2920
4855
  const NormaliseEndpoint = (value) => {
2921
4856
  if (!value)
2922
4857
  return undefined;
2923
- const trimmed = value.trim().replace(/\/+$/, '');
4858
+ const trimmed = value.trim().replace(TRAILING_SLASHES, '');
2924
4859
  if (trimmed.length === 0)
2925
4860
  return undefined;
2926
4861
  if (ENDPOINT_SCHEME_PATTERN.test(trimmed))
@@ -3007,7 +4942,7 @@ const VerifyWebhookSignature = async (props) => {
3007
4942
  throw new Error(WEBHOOK_MESSAGES.OUT_OF_TOLERANCE.replace('{{drift}}', String(drift)).replace('{{tolerance}}', String(tolerance)));
3008
4943
  }
3009
4944
  const encoder = new TextEncoder();
3010
- const key = await subtle.importKey('raw', encoder.encode(secret), { name: 'HMAC', hash: 'SHA-256' }, false, ['sign']);
4945
+ const key = await subtle.importKey('raw', encoder.encode(secret), { name: 'HMAC', hash: 'SHA-256' }, false, HMAC_SIGN_USAGES);
3011
4946
  const expected = Hex(await subtle.sign('HMAC', key, encoder.encode(`${parsed.timestamp}.${payload}`)));
3012
4947
  if (!parsed.signatures.some(candidate => Equal(expected, candidate)))
3013
4948
  throw new Error(WEBHOOK_MESSAGES.MISMATCH);
@@ -3038,27 +4973,27 @@ const DefaultClient = new Proxy({}, {
3038
4973
  });
3039
4974
 
3040
4975
  const Key = (value) => value.trim().toLowerCase();
3041
- const BY_CODE = new Map(LANGUAGES.map(language => [Key(language.code), language]));
3042
- const BY_LABEL = new Map(LANGUAGES.map(language => [Key(language.label), language]));
3043
- const BY_NATIVE = new Map(LANGUAGES.map(language => [Key(language.native), language]));
3044
- const ALIASES = new Map(LANGUAGE_ALIASES.map(([alias, code]) => [Key(alias), Key(code)]));
3045
- const LanguageByCode = (code) => code ? BY_CODE.get(Key(code)) : undefined;
4976
+ const byCode = new Map(LANGUAGES.map(language => [Key(language.code), language]));
4977
+ const byLabel = new Map(LANGUAGES.map(language => [Key(language.label), language]));
4978
+ const byNative = new Map(LANGUAGES.map(language => [Key(language.native), language]));
4979
+ const aliasCodes = new Map(LANGUAGE_ALIASES.map(([alias, code]) => [Key(alias), Key(code)]));
4980
+ const LanguageByCode = (code) => code ? byCode.get(Key(code)) : undefined;
3046
4981
  const ResolveLanguage = (input) => {
3047
4982
  if (!input)
3048
4983
  return undefined;
3049
4984
  const key = Key(input);
3050
4985
  if (!key)
3051
4986
  return undefined;
3052
- const aliased = ALIASES.get(key);
4987
+ const aliased = aliasCodes.get(key);
3053
4988
  if (aliased)
3054
- return BY_CODE.get(aliased);
3055
- const direct = BY_CODE.get(key) ?? BY_LABEL.get(key) ?? BY_NATIVE.get(key);
4989
+ return byCode.get(aliased);
4990
+ const direct = byCode.get(key) ?? byLabel.get(key) ?? byNative.get(key);
3056
4991
  if (direct)
3057
4992
  return direct;
3058
4993
  const base = key.split(LANGUAGE_SUBTAG_PATTERN)[0];
3059
4994
  if (!base || base === key)
3060
4995
  return undefined;
3061
- return BY_CODE.get(ALIASES.get(base) ?? base);
4996
+ return byCode.get(aliasCodes.get(base) ?? base);
3062
4997
  };
3063
4998
  const IsRtlLanguage = (code) => ResolveLanguage(code)?.rtl === true;
3064
4999
 
@@ -3078,43 +5013,148 @@ const resolveLanguage = ResolveLanguage;
3078
5013
  const languageByCode = LanguageByCode;
3079
5014
  const isRtlLanguage = IsRtlLanguage;
3080
5015
 
5016
+ exports.ADDRESS_FORWARD_CONSENT_STATUSES = ADDRESS_FORWARD_CONSENT_STATUSES;
5017
+ exports.ADDRESS_FORWARD_STATUSES = ADDRESS_FORWARD_STATUSES;
5018
+ exports.ADDRESS_MEMBER_VIAS = ADDRESS_MEMBER_VIAS;
3081
5019
  exports.API_SCOPES = API_SCOPES;
5020
+ exports.APP_HOST_STATUSES = APP_HOST_STATUSES;
5021
+ exports.APP_PASSWORD_ORIGINS = APP_PASSWORD_ORIGINS;
3082
5022
  exports.AUDIENCE_MEMBER_STATUSES = AUDIENCE_MEMBER_STATUSES;
5023
+ exports.BILLING_ALERT_KINDS = BILLING_ALERT_KINDS;
5024
+ exports.BILLING_ALERT_SEVERITIES = BILLING_ALERT_SEVERITIES;
5025
+ exports.BILLING_ALERT_TARGETS = BILLING_ALERT_TARGETS;
5026
+ exports.BILLING_INTERVALS = BILLING_INTERVALS;
5027
+ exports.BILLING_INVOICE_SORTS = BILLING_INVOICE_SORTS;
5028
+ exports.BILLING_INVOICE_STARTS = BILLING_INVOICE_STARTS;
5029
+ exports.BILLING_INVOICE_STATUSES = BILLING_INVOICE_STATUSES;
5030
+ exports.BILLING_THEMES = BILLING_THEMES;
5031
+ exports.BILLING_USAGE_WINDOWS = BILLING_USAGE_WINDOWS;
5032
+ exports.BIMI_STATUSES = BIMI_STATUSES;
5033
+ exports.BRAND_FONT_IDS = BRAND_FONT_IDS;
5034
+ exports.BRAND_IMAGE_TYPES = BRAND_IMAGE_TYPES;
5035
+ exports.BRAND_IMAGE_VARIANTS = BRAND_IMAGE_VARIANTS;
3083
5036
  exports.BROADCAST_RECIPIENT_FILTERS = BROADCAST_RECIPIENT_FILTERS;
3084
5037
  exports.BROADCAST_STATUSES = BROADCAST_STATUSES;
5038
+ exports.CALENDAR_COLORS = CALENDAR_COLORS;
5039
+ exports.CALENDAR_FEED_MODES = CALENDAR_FEED_MODES;
5040
+ exports.CALENDAR_REMINDER_ACTIONS = CALENDAR_REMINDER_ACTIONS;
5041
+ exports.CALENDAR_RESPONSES = CALENDAR_RESPONSES;
5042
+ exports.CALENDAR_SUBSCRIPTION_ERRORS = CALENDAR_SUBSCRIPTION_ERRORS;
5043
+ exports.CALENDAR_SUBSCRIPTION_STATUSES = CALENDAR_SUBSCRIPTION_STATUSES;
5044
+ exports.CALENDAR_TRANSPARENCIES = CALENDAR_TRANSPARENCIES;
5045
+ exports.CALENDAR_VISIBILITIES = CALENDAR_VISIBILITIES;
5046
+ exports.CHAT_SORTS = CHAT_SORTS;
5047
+ exports.CONNECTED_APP_KINDS = CONNECTED_APP_KINDS;
5048
+ exports.CONNECTED_APP_STATUSES = CONNECTED_APP_STATUSES;
5049
+ exports.CONSOLE_PERMISSIONS = CONSOLE_PERMISSIONS;
3085
5050
  exports.CONTACT_BLOCK_LISTS = CONTACT_BLOCK_LISTS;
5051
+ exports.CONTACT_CARD_LABELS = CONTACT_CARD_LABELS;
3086
5052
  exports.CONTACT_PHOTO_TYPES = CONTACT_PHOTO_TYPES;
5053
+ exports.CONTACT_SOURCES = CONTACT_SOURCES;
3087
5054
  exports.CONTACT_THREAD_SORTS = CONTACT_THREAD_SORTS;
3088
5055
  exports.CREDENTIAL_KINDS = CREDENTIAL_KINDS;
5056
+ exports.DELIVERABILITY_CHECK_IDS = DELIVERABILITY_CHECK_IDS;
5057
+ exports.DELIVERABILITY_CHECK_STATUSES = DELIVERABILITY_CHECK_STATUSES;
5058
+ exports.DELIVERABILITY_GRADES = DELIVERABILITY_GRADES;
5059
+ exports.DNS_CONNECTION_STATUSES = DNS_CONNECTION_STATUSES;
5060
+ exports.DNS_PROVISION_STATES = DNS_PROVISION_STATES;
5061
+ exports.DNS_SYNC_OUTCOMES = DNS_SYNC_OUTCOMES;
5062
+ exports.DNS_SYNC_PURPOSES = DNS_SYNC_PURPOSES;
5063
+ exports.DNS_ZONE_RESOLUTION_KINDS = DNS_ZONE_RESOLUTION_KINDS;
5064
+ exports.DOMAIN_ADDRESS_DESTINATIONS = DOMAIN_ADDRESS_DESTINATIONS;
5065
+ exports.DOMAIN_DMARC_POLICIES = DOMAIN_DMARC_POLICIES;
3089
5066
  exports.DOMAIN_DMARC_STAGES = DOMAIN_DMARC_STAGES;
5067
+ exports.DOMAIN_LOGO_MARK_KINDS = DOMAIN_LOGO_MARK_KINDS;
5068
+ exports.DOMAIN_LOGO_RECORD_OUTCOMES = DOMAIN_LOGO_RECORD_OUTCOMES;
3090
5069
  exports.DOMAIN_RECORD_STATUSES = DOMAIN_RECORD_STATUSES;
5070
+ exports.EMAIL_NOTIFICATION_CATEGORIES = EMAIL_NOTIFICATION_CATEGORIES;
3091
5071
  exports.ERROR_TYPES = ERROR_TYPES;
5072
+ exports.EXPORT_PHASES = EXPORT_PHASES;
5073
+ exports.EXPORT_REFUSALS = EXPORT_REFUSALS;
5074
+ exports.EXPORT_STATUSES = EXPORT_STATUSES;
3092
5075
  exports.FILE_DIRECTIONS = FILE_DIRECTIONS;
3093
5076
  exports.FILE_KINDS = FILE_KINDS;
3094
5077
  exports.FILE_SORTS = FILE_SORTS;
3095
5078
  exports.FILE_USAGES = FILE_USAGES;
3096
5079
  exports.FILE_VISIBILITIES = FILE_VISIBILITIES;
5080
+ exports.FORM_ALIGNS = FORM_ALIGNS;
5081
+ exports.FORM_CONFIRM_SOURCES = FORM_CONFIRM_SOURCES;
5082
+ exports.FORM_CONTACT_FIELDS = FORM_CONTACT_FIELDS;
5083
+ exports.FORM_FIELD_ERRORS = FORM_FIELD_ERRORS;
5084
+ exports.FORM_FIELD_TYPES = FORM_FIELD_TYPES;
5085
+ exports.FORM_FIELD_WIDTHS = FORM_FIELD_WIDTHS;
5086
+ exports.FORM_FONTS = FORM_FONTS;
5087
+ exports.FORM_LAYOUTS = FORM_LAYOUTS;
5088
+ exports.FORM_RADII = FORM_RADII;
5089
+ exports.FORM_SENDER_ISSUES = FORM_SENDER_ISSUES;
5090
+ exports.FORM_STARTER_SLUGS = FORM_STARTER_SLUGS;
5091
+ exports.FORM_STATUSES = FORM_STATUSES;
5092
+ exports.FORM_SUBMISSION_STATUSES = FORM_SUBMISSION_STATUSES;
5093
+ exports.FORM_SUBSCRIBE_OUTCOMES = FORM_SUBSCRIBE_OUTCOMES;
5094
+ exports.FORM_SUCCESS_ACTIONS = FORM_SUCCESS_ACTIONS;
5095
+ exports.FORM_WIDTHS = FORM_WIDTHS;
5096
+ exports.IMPORT_FORMATS = IMPORT_FORMATS;
5097
+ exports.KNOWLEDGE_CONNECTOR_KINDS = KNOWLEDGE_CONNECTOR_KINDS;
5098
+ exports.KNOWLEDGE_CONNECTOR_STATUSES = KNOWLEDGE_CONNECTOR_STATUSES;
5099
+ exports.KNOWLEDGE_FAILURES = KNOWLEDGE_FAILURES;
5100
+ exports.KNOWLEDGE_FLAG_KINDS = KNOWLEDGE_FLAG_KINDS;
5101
+ exports.KNOWLEDGE_FLAG_STATUSES = KNOWLEDGE_FLAG_STATUSES;
5102
+ exports.KNOWLEDGE_KINDS = KNOWLEDGE_KINDS;
5103
+ exports.KNOWLEDGE_LEVELS = KNOWLEDGE_LEVELS;
5104
+ exports.KNOWLEDGE_ORIGINS = KNOWLEDGE_ORIGINS;
5105
+ exports.KNOWLEDGE_REFRESH_DAY_CHOICES = KNOWLEDGE_REFRESH_DAY_CHOICES;
5106
+ exports.KNOWLEDGE_STATUSES = KNOWLEDGE_STATUSES;
5107
+ exports.KNOWLEDGE_SUGGESTION_KINDS = KNOWLEDGE_SUGGESTION_KINDS;
5108
+ exports.KNOWLEDGE_SUGGESTION_STATUSES = KNOWLEDGE_SUGGESTION_STATUSES;
3097
5109
  exports.LANGUAGES = LANGUAGES;
5110
+ exports.LOGIN_BACKGROUND_KINDS = LOGIN_BACKGROUND_KINDS;
5111
+ exports.LOGIN_BACKGROUND_PRESETS = LOGIN_BACKGROUND_PRESETS;
5112
+ exports.LOGIN_LOGOS = LOGIN_LOGOS;
5113
+ exports.MAIL_APP_PROTOCOLS = MAIL_APP_PROTOCOLS;
5114
+ exports.MAIL_APP_SECURITIES = MAIL_APP_SECURITIES;
5115
+ exports.MAIL_SERVICES = MAIL_SERVICES;
3098
5116
  exports.MESSAGE_ENCRYPTION_FORMATS = MESSAGE_ENCRYPTION_FORMATS;
3099
5117
  exports.OpenEmail = OpenEmail;
3100
5118
  exports.OpenEmailApiError = OpenEmailApiError;
3101
5119
  exports.OpenEmailNetworkError = OpenEmailNetworkError;
3102
5120
  exports.PAGE_LIMITS = PAGE_LIMITS;
5121
+ exports.PAID_PLAN_IDS = PAID_PLAN_IDS;
5122
+ exports.PAY_AS_YOU_GO_LIMITS_CENTS = PAY_AS_YOU_GO_LIMITS_CENTS;
3103
5123
  exports.PEOPLE_SORTS = PEOPLE_SORTS;
5124
+ exports.PLAN_BLOCKERS = PLAN_BLOCKERS;
5125
+ exports.PLAN_IDS = PLAN_IDS;
3104
5126
  exports.PROVIDER_IMPORT_DOMAIN_STATES = PROVIDER_IMPORT_DOMAIN_STATES;
5127
+ exports.PROVIDER_IMPORT_PROVIDERS = PROVIDER_IMPORT_PROVIDERS;
3105
5128
  exports.PROVIDER_IMPORT_RESOURCES = PROVIDER_IMPORT_RESOURCES;
3106
5129
  exports.PROVIDER_IMPORT_STATUSES = PROVIDER_IMPORT_STATUSES;
5130
+ exports.REPLY_SUGGESTION_STATES = REPLY_SUGGESTION_STATES;
5131
+ exports.REWRITE_ACTIONS = REWRITE_ACTIONS;
5132
+ exports.REWRITE_TARGETS = REWRITE_TARGETS;
3107
5133
  exports.RULE_ACTIONS = RULE_ACTIONS;
3108
5134
  exports.RULE_FIELDS = RULE_FIELDS;
3109
5135
  exports.RULE_OPERATORS = RULE_OPERATORS;
5136
+ exports.SETTINGS_COLOR_THEMES = SETTINGS_COLOR_THEMES;
5137
+ exports.SETTINGS_DATE_FORMATS = SETTINGS_DATE_FORMATS;
5138
+ exports.SETTINGS_IMAGE_COMPRESSIONS = SETTINGS_IMAGE_COMPRESSIONS;
5139
+ exports.SETTINGS_TIME_FORMATS = SETTINGS_TIME_FORMATS;
5140
+ exports.SETTINGS_WEEK_STARTS = SETTINGS_WEEK_STARTS;
3110
5141
  exports.STEP_UP_ERROR_CODES = STEP_UP_ERROR_CODES;
3111
5142
  exports.STEP_UP_METHODS = STEP_UP_METHODS;
5143
+ exports.SUBSCRIPTION_DESTINATIONS = SUBSCRIPTION_DESTINATIONS;
5144
+ exports.SUBSCRIPTION_SORTS = SUBSCRIPTION_SORTS;
5145
+ exports.SUBSCRIPTION_STATUSES = SUBSCRIPTION_STATUSES;
3112
5146
  exports.SUPPRESSION_REASONS = SUPPRESSION_REASONS;
5147
+ exports.TEMPLATE_IMAGE_TYPES = TEMPLATE_IMAGE_TYPES;
5148
+ exports.THREAD_NOTE_COLORS = THREAD_NOTE_COLORS;
3113
5149
  exports.THREAD_SORTS = THREAD_SORTS;
5150
+ exports.THREAD_SUMMARY_STATES = THREAD_SUMMARY_STATES;
5151
+ exports.UNSUBSCRIBE_METHODS = UNSUBSCRIBE_METHODS;
5152
+ exports.USERNAME_STATUSES = USERNAME_STATUSES;
3114
5153
  exports.VERSION = VERSION;
3115
5154
  exports.WEBHOOK_EVENTS = WEBHOOK_EVENTS;
3116
5155
  exports.WEBHOOK_REPLAY_ERROR_CODES = WEBHOOK_REPLAY_ERROR_CODES;
3117
5156
  exports.WEBHOOK_SIGNATURE_HEADERS = WEBHOOK_SIGNATURE_HEADERS;
5157
+ exports.WORKSPACE_KINDS = WORKSPACE_KINDS;
3118
5158
  exports.createClient = createClient;
3119
5159
  exports.createOpenEmail = createOpenEmail;
3120
5160
  exports.createTempMail = createTempMail;