mailchannels-sdk 0.7.2 → 0.7.4

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.
@@ -1,22 +1,23 @@
1
- import { FetchOptions } from 'ofetch';
1
+ import { FetchOptions } from "ofetch";
2
2
 
3
+ //#region src/client.d.ts
3
4
  declare class MailChannelsClient {
4
- #private;
5
- private static BASE_URL;
6
- constructor(key: string);
7
- protected _fetch<T>(path: string, options?: FetchOptions<"json">): Promise<T>;
8
- post<T>(path: string, options?: Omit<FetchOptions<"json">, "method">): Promise<T>;
9
- get<T>(path: string, options?: Omit<FetchOptions<"json">, "method">): Promise<T>;
10
- delete<T>(path: string, options?: Omit<FetchOptions<"json">, "method">): Promise<T>;
11
- put<T>(path: string, options?: Omit<FetchOptions<"json">, "method">): Promise<T>;
12
- patch<T>(path: string, options?: Omit<FetchOptions<"json">, "method">): Promise<T>;
5
+ #private;
6
+ private static BASE_URL;
7
+ constructor(key: string);
8
+ protected _fetch<T>(path: string, options?: FetchOptions<"json">): Promise<T>;
9
+ post<T>(path: string, options?: Omit<FetchOptions<"json">, "method">): Promise<T>;
10
+ get<T>(path: string, options?: Omit<FetchOptions<"json">, "method">): Promise<T>;
11
+ delete<T>(path: string, options?: Omit<FetchOptions<"json">, "method">): Promise<T>;
12
+ put<T>(path: string, options?: Omit<FetchOptions<"json">, "method">): Promise<T>;
13
+ patch<T>(path: string, options?: Omit<FetchOptions<"json">, "method">): Promise<T>;
13
14
  }
14
-
15
+ //#endregion
16
+ //#region src/types/responses.d.ts
15
17
  interface ErrorResponse {
16
18
  message: string;
17
19
  statusCode: number | null;
18
20
  }
19
-
20
21
  interface SuccessResponse {
21
22
  /**
22
23
  * Whether the operation was successful.
@@ -27,8 +28,7 @@ interface SuccessResponse {
27
28
  */
28
29
  error: ErrorResponse | null;
29
30
  }
30
-
31
- type DataResponse$1<T> = {
31
+ type DataResponse<T> = {
32
32
  /**
33
33
  * The response data.
34
34
  */
@@ -47,7 +47,8 @@ type DataResponse$1<T> = {
47
47
  */
48
48
  error: ErrorResponse;
49
49
  };
50
-
50
+ //#endregion
51
+ //#region src/types/emails/send.d.ts
51
52
  interface EmailsSendRecipient {
52
53
  /**
53
54
  * The email address of the recipient.
@@ -58,7 +59,6 @@ interface EmailsSendRecipient {
58
59
  */
59
60
  name?: string;
60
61
  }
61
-
62
62
  interface EmailsSendAttachment {
63
63
  /**
64
64
  * The attachment data, encoded in base64.
@@ -73,7 +73,6 @@ interface EmailsSendAttachment {
73
73
  */
74
74
  type: string;
75
75
  }
76
-
77
76
  interface EmailsSendTracking {
78
77
  /**
79
78
  * Track when a recipient clicks a link in your email.
@@ -86,7 +85,6 @@ interface EmailsSendTracking {
86
85
  */
87
86
  open?: boolean;
88
87
  }
89
-
90
88
  interface EmailsSendOptionsBase {
91
89
  /**
92
90
  * An array of attachments to be sent with the email.
@@ -235,39 +233,34 @@ interface EmailsSendOptionsBase {
235
233
  */
236
234
  transactional?: boolean;
237
235
  }
238
-
239
- type EmailsSendOptions = EmailsSendOptionsBase & (
240
- | {
241
- /**
242
- * The HTML content of the email.
243
- * @example
244
- * '<p>Hello World</p>'
245
- */
246
- html: string;
247
- /**
248
- * The plain text content of the email (optional when html is provided).
249
- * @example
250
- * 'Hello World'
251
- */
252
- text?: string;
253
- }
254
- | {
255
- /**
256
- * The HTML content of the email (optional when text is provided).
257
- * @example
258
- * '<p>Hello World</p>'
259
- */
260
- html?: string;
261
- /**
262
- * The plain text content of the email.
263
- * @example
264
- * 'Hello World'
265
- */
266
- text: string;
267
- }
268
- );
269
-
270
- type EmailsSendResponse = SuccessResponse & DataResponse$1<{
236
+ type EmailsSendOptions = EmailsSendOptionsBase & ({
237
+ /**
238
+ * The HTML content of the email.
239
+ * @example
240
+ * '<p>Hello World</p>'
241
+ */
242
+ html: string;
243
+ /**
244
+ * The plain text content of the email (optional when html is provided).
245
+ * @example
246
+ * 'Hello World'
247
+ */
248
+ text?: string;
249
+ } | {
250
+ /**
251
+ * The HTML content of the email (optional when text is provided).
252
+ * @example
253
+ * '<p>Hello World</p>'
254
+ */
255
+ html?: string;
256
+ /**
257
+ * The plain text content of the email.
258
+ * @example
259
+ * 'Hello World'
260
+ */
261
+ text: string;
262
+ });
263
+ type EmailsSendResponse = SuccessResponse & DataResponse<{
271
264
  /**
272
265
  * Fully rendered message if `dryRun` was set to `true`. A string representation of a rendered message, one per personalization in the request.
273
266
  */
@@ -295,18 +288,20 @@ type EmailsSendResponse = SuccessResponse & DataResponse$1<{
295
288
  status: "sent" | "failed";
296
289
  }[];
297
290
  }>;
298
-
291
+ //#endregion
292
+ //#region src/types/emails/send-async.d.ts
299
293
  type EmailsSendAsyncResponse = DataResponse<{
300
294
  /**
301
295
  * ISO 8601 timestamp when the request was queued for processing.
302
296
  */
303
- queuedAt: string[];
297
+ queuedAt: string;
304
298
  /**
305
299
  * Unique identifier for tracking this async request. Will be included in all webhook events for this request.
306
300
  */
307
301
  requestId: string;
308
302
  }>;
309
-
303
+ //#endregion
304
+ //#region src/types/emails/create-dkim-key.d.ts
310
305
  interface EmailsCreateDkimKeyOptions {
311
306
  /**
312
307
  * Algorithm used for the new key pair Currently, only RSA is supported.
@@ -323,9 +318,7 @@ interface EmailsCreateDkimKeyOptions {
323
318
  */
324
319
  selector: string;
325
320
  }
326
-
327
321
  type EmailsDkimKeyStatus = "active" | "retired" | "revoked" | "rotated";
328
-
329
322
  interface EmailsDkimKey {
330
323
  /**
331
324
  * Algorithm used for the key pair.
@@ -373,9 +366,9 @@ interface EmailsDkimKey {
373
366
  */
374
367
  statusModifiedAt?: string;
375
368
  }
376
-
377
- type EmailsCreateDkimKeyResponse = DataResponse$1<EmailsDkimKey>;
378
-
369
+ type EmailsCreateDkimKeyResponse = DataResponse<EmailsDkimKey>;
370
+ //#endregion
371
+ //#region src/types/emails/check-domain.d.ts
379
372
  interface EmailsCheckDomainDkim {
380
373
  /**
381
374
  * Domain used for DKIM signing.
@@ -390,7 +383,6 @@ interface EmailsCheckDomainDkim {
390
383
  */
391
384
  selector?: string;
392
385
  }
393
-
394
386
  interface EmailsCheckDomainOptions {
395
387
  /**
396
388
  * Each item may include DKIM `domain`, `selector` and `privateKey`. Up to 10 items are allowed. The absence or presence of these fields affects how DKIM settings are validated:
@@ -411,10 +403,8 @@ interface EmailsCheckDomainOptions {
411
403
  */
412
404
  senderId?: string;
413
405
  }
414
-
415
406
  type EmailsCheckDomainVerdict = "passed" | "failed" | "soft failed" | "temporary error" | "permanent error" | "neutral" | "none" | "unknown";
416
-
417
- type EmailsCheckDomainResponse = DataResponse$1<{
407
+ type EmailsCheckDomainResponse = DataResponse<{
418
408
  dkim: {
419
409
  domain: string;
420
410
  /**
@@ -467,7 +457,8 @@ type EmailsCheckDomainResponse = DataResponse$1<{
467
457
  };
468
458
  references?: string[];
469
459
  }>;
470
-
460
+ //#endregion
461
+ //#region src/types/emails/get-dkim-keys.d.ts
471
462
  interface EmailsGetDkimKeysOptions {
472
463
  /**
473
464
  * Selector to filter keys by. Must be a maximum of 63 characters.
@@ -493,11 +484,10 @@ interface EmailsGetDkimKeysOptions {
493
484
  */
494
485
  includeDnsRecord?: boolean;
495
486
  }
496
-
497
487
  type Optional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
498
-
499
- type EmailsGetDkimKeysResponse = DataResponse$1<Optional<EmailsDkimKey, "dnsRecords">[]>;
500
-
488
+ type EmailsGetDkimKeysResponse = DataResponse<Optional<EmailsDkimKey, "dnsRecords">[]>;
489
+ //#endregion
490
+ //#region src/types/emails/update-dkim-key.d.ts
501
491
  interface EmailsUpdateDkimKeyOptions {
502
492
  /**
503
493
  * Selector of the DKIM key pair to update. Must be a maximum of 63 characters.
@@ -511,7 +501,8 @@ interface EmailsUpdateDkimKeyOptions {
511
501
  */
512
502
  status: Exclude<EmailsDkimKey["status"], "active">;
513
503
  }
514
-
504
+ //#endregion
505
+ //#region src/types/emails/rotate-dkim-key.d.ts
515
506
  interface EmailsRotateDkimKeyOptions {
516
507
  newKey: {
517
508
  /**
@@ -520,134 +511,137 @@ interface EmailsRotateDkimKeyOptions {
520
511
  selector: string;
521
512
  };
522
513
  }
523
-
524
- type EmailsRotateDkimKeyResponse = DataResponse$1<{
514
+ type EmailsRotateDkimKeyResponse = DataResponse<{
525
515
  new: EmailsDkimKey;
526
516
  rotated: EmailsDkimKey;
527
517
  }>;
528
-
518
+ //#endregion
519
+ //#region src/modules/emails.d.ts
529
520
  declare class Emails {
530
- protected mailchannels: MailChannelsClient;
531
- constructor(mailchannels: MailChannelsClient);
532
- private _sendEmail;
533
- /**
534
- * Sends an email message to one or more recipients.
535
- * @param options - The email options to send.
536
- * @param dryRun - When set to `true`, the message will not be sent. Instead, the fully rendered message will be returned in the `data` property of the response. The default value is `false`.
537
- * @example
538
- * ```ts
539
- * const mailchannels = new MailChannels('your-api-key')
540
- * const { success, data, error } = await mailchannels.emails.send({
541
- * to: 'to@example.com',
542
- * from: 'from@example.com',
543
- * subject: 'Test',
544
- * html: 'Test'
545
- * })
546
- * ```
547
- */
548
- send(options: EmailsSendOptions, dryRun?: boolean): Promise<EmailsSendResponse>;
549
- /**
550
- * Queues an email message for asynchronous processing and returns immediately with a request ID.
551
- *
552
- * The email will be processed in the background, and you'll receive webhook events for all delivery status updates (e.g. `dropped`, `processed`, `delivered`, `hard-bounced`). These webhook events are identical to those sent for the synchronous /send endpoint.
553
- *
554
- * Use this endpoint when you need to send emails without waiting for processing to complete. This can improve your application's response time, especially when sending to multiple recipients.
555
- * @param options - The email options to send.
556
- * @example
557
- * ```ts
558
- * const mailchannels = new MailChannels('your-api-key')
559
- * const { data, error } = await mailchannels.emails.sendAsync({
560
- * to: 'to@example.com',
561
- * from: 'from@example.com',
562
- * subject: 'Test',
563
- * html: 'Test'
564
- * })
565
- * ```
566
- */
567
- sendAsync(options: EmailsSendOptions): Promise<EmailsSendAsyncResponse>;
568
- /**
569
- * Validates a domain's email authentication setup by retrieving its DKIM, SPF, and Domain Lockdown status. This endpoint checks whether the domain is properly configured for secure email delivery.
570
- * @param options - The domain options to check.
571
- * @example
572
- * ```ts
573
- * const mailchannels = new MailChannels('your-api-key')
574
- * const { data, error } = await mailchannels.emails.checkDomain({
575
- * dkim: [{
576
- * domain: 'example.com',
577
- * privateKey: 'your-private-key',
578
- * selector: 'mailchannels'
579
- * }],
580
- * domain: 'example.com',
581
- * senderId: 'sender-id'
582
- * })
583
- * ```
584
- */
585
- checkDomain(options: EmailsCheckDomainOptions): Promise<EmailsCheckDomainResponse>;
586
- /**
587
- * Create a DKIM key pair for a specified domain and selector using the specified algorithm and key length, for the current customer.
588
- * @param domain - The domain to create the DKIM key for.
589
- * @param options - DKIM key creation options.
590
- * @example
591
- * ```ts
592
- * const mailchannels = new MailChannels('your-api-key')
593
- * const { data, error } = await mailchannels.emails.createDkimKey('example.com', {
594
- * selector: 'mailchannels'
595
- * })
596
- * ```
597
- */
598
- createDkimKey(domain: string, options: EmailsCreateDkimKeyOptions): Promise<EmailsCreateDkimKeyResponse>;
599
- /**
600
- * Search for DKIM keys by domain, with optional filters. If selector is provided, at most one key will be returned.
601
- * @param domain - The domain to search DKIM keys for.
602
- * @param options - The options to filter DKIM keys by.
603
- * @example
604
- * ```ts
605
- * const mailchannels = new MailChannels('your-api-key')
606
- * const { data, error } = await mailchannels.getDkimKeys('example.com', {
607
- * includeDnsRecord: true
608
- * })
609
- * ```
610
- */
611
- getDkimKeys(domain: string, options?: EmailsGetDkimKeysOptions): Promise<EmailsGetDkimKeysResponse>;
612
- /**
613
- * Update fields of an existing DKIM key pair for the specified domain and selector, for the current customer. Currently, only the `status` field can be updated.
614
- * @param domain - The domain the DKIM key belongs to.
615
- * @param options - The options to update the DKIM key.
616
- * @example
617
- * ```ts
618
- * const mailchannels = new MailChannels('your-api-key')
619
- * const { success, error } = await mailchannels.emails.updateDkimKey('example.com', {
620
- * selector: 'mailchannels',
621
- * status: 'retired'
622
- * })
623
- */
624
- updateDkimKey(domain: string, options: EmailsUpdateDkimKeyOptions): Promise<SuccessResponse>;
625
- /**
626
- * Rotate an active DKIM key pair. Mark the original key as `rotated`, and create a new key pair with the required new key selector, reusing the same algorithm and key length. The rotated key remains valid for signing for a 3-day grace period, and is automatically changed to `retired` 2 weeks after rotation. Publish the new key to its DNS TXT record before rotated key expires for signing as emails sent with an unpublished key will fail DKIM validation by receiving providers. After the grace period, only the new key is valid for signing if published.
627
- * @param domain - The domain the DKIM key belongs to.
628
- * @param selector - The selector of the DKIM key to rotate.
629
- * @param options - The options to rotate the DKIM key.
630
- * @param options.newKey.selector - The selector for the new key pair. Must be a maximum of 63 characters.
631
- * @example
632
- * ```ts
633
- * const mailchannels = new MailChannels('your-api-key')
634
- * const { data, error } = await mailchannels.emails.rotateDkimKey('example.com', 'mailchannels', {
635
- * newKey: {
636
- * selector: 'new-selector'
637
- * }
638
- * })
639
- * ```
640
- */
641
- rotateDkimKey(domain: string, selector: string, options: EmailsRotateDkimKeyOptions): Promise<EmailsRotateDkimKeyResponse>;
521
+ protected mailchannels: MailChannelsClient;
522
+ constructor(mailchannels: MailChannelsClient);
523
+ private _sendEmail;
524
+ /**
525
+ * Sends an email message to one or more recipients.
526
+ * @param options - The email options to send.
527
+ * @param dryRun - When set to `true`, the message will not be sent. Instead, the fully rendered message will be returned in the `data` property of the response. The default value is `false`.
528
+ * @example
529
+ * ```ts
530
+ * const mailchannels = new MailChannels('your-api-key')
531
+ * const { success, data, error } = await mailchannels.emails.send({
532
+ * to: 'to@example.com',
533
+ * from: 'from@example.com',
534
+ * subject: 'Test',
535
+ * html: 'Test'
536
+ * })
537
+ * ```
538
+ */
539
+ send(options: EmailsSendOptions, dryRun?: boolean): Promise<EmailsSendResponse>;
540
+ /**
541
+ * Queues an email message for asynchronous processing and returns immediately with a request ID.
542
+ *
543
+ * The email will be processed in the background, and you'll receive webhook events for all delivery status updates (e.g. `dropped`, `processed`, `delivered`, `hard-bounced`). These webhook events are identical to those sent for the synchronous /send endpoint.
544
+ *
545
+ * Use this endpoint when you need to send emails without waiting for processing to complete. This can improve your application's response time, especially when sending to multiple recipients.
546
+ * @param options - The email options to send.
547
+ * @example
548
+ * ```ts
549
+ * const mailchannels = new MailChannels('your-api-key')
550
+ * const { data, error } = await mailchannels.emails.sendAsync({
551
+ * to: 'to@example.com',
552
+ * from: 'from@example.com',
553
+ * subject: 'Test',
554
+ * html: 'Test'
555
+ * })
556
+ * ```
557
+ */
558
+ sendAsync(options: EmailsSendOptions): Promise<EmailsSendAsyncResponse>;
559
+ /**
560
+ * Validates a domain's email authentication setup by retrieving its DKIM, SPF, and Domain Lockdown status. This endpoint checks whether the domain is properly configured for secure email delivery.
561
+ * @param options - The domain options to check.
562
+ * @example
563
+ * ```ts
564
+ * const mailchannels = new MailChannels('your-api-key')
565
+ * const { data, error } = await mailchannels.emails.checkDomain({
566
+ * dkim: [{
567
+ * domain: 'example.com',
568
+ * privateKey: 'your-private-key',
569
+ * selector: 'mailchannels'
570
+ * }],
571
+ * domain: 'example.com',
572
+ * senderId: 'sender-id'
573
+ * })
574
+ * ```
575
+ */
576
+ checkDomain(options: EmailsCheckDomainOptions): Promise<EmailsCheckDomainResponse>;
577
+ /**
578
+ * Create a DKIM key pair for a specified domain and selector using the specified algorithm and key length, for the current customer.
579
+ * @param domain - The domain to create the DKIM key for.
580
+ * @param options - DKIM key creation options.
581
+ * @example
582
+ * ```ts
583
+ * const mailchannels = new MailChannels('your-api-key')
584
+ * const { data, error } = await mailchannels.emails.createDkimKey('example.com', {
585
+ * selector: 'mailchannels'
586
+ * })
587
+ * ```
588
+ */
589
+ createDkimKey(domain: string, options: EmailsCreateDkimKeyOptions): Promise<EmailsCreateDkimKeyResponse>;
590
+ /**
591
+ * Search for DKIM keys by domain, with optional filters. If selector is provided, at most one key will be returned.
592
+ * @param domain - The domain to search DKIM keys for.
593
+ * @param options - The options to filter DKIM keys by.
594
+ * @example
595
+ * ```ts
596
+ * const mailchannels = new MailChannels('your-api-key')
597
+ * const { data, error } = await mailchannels.getDkimKeys('example.com', {
598
+ * includeDnsRecord: true
599
+ * })
600
+ * ```
601
+ */
602
+ getDkimKeys(domain: string, options?: EmailsGetDkimKeysOptions): Promise<EmailsGetDkimKeysResponse>;
603
+ /**
604
+ * Update fields of an existing DKIM key pair for the specified domain and selector, for the current customer. Currently, only the `status` field can be updated.
605
+ * @param domain - The domain the DKIM key belongs to.
606
+ * @param options - The options to update the DKIM key.
607
+ * @example
608
+ * ```ts
609
+ * const mailchannels = new MailChannels('your-api-key')
610
+ * const { success, error } = await mailchannels.emails.updateDkimKey('example.com', {
611
+ * selector: 'mailchannels',
612
+ * status: 'retired'
613
+ * })
614
+ */
615
+ updateDkimKey(domain: string, options: EmailsUpdateDkimKeyOptions): Promise<SuccessResponse>;
616
+ /**
617
+ * Rotate an active DKIM key pair. Mark the original key as `rotated`, and create a new key pair with the required new key selector, reusing the same algorithm and key length. The rotated key remains valid for signing for a 3-day grace period, and is automatically changed to `retired` 2 weeks after rotation. Publish the new key to its DNS TXT record before rotated key expires for signing as emails sent with an unpublished key will fail DKIM validation by receiving providers. After the grace period, only the new key is valid for signing if published.
618
+ * @param domain - The domain the DKIM key belongs to.
619
+ * @param selector - The selector of the DKIM key to rotate.
620
+ * @param options - The options to rotate the DKIM key.
621
+ * @param options.newKey.selector - The selector for the new key pair. Must be a maximum of 63 characters.
622
+ * @example
623
+ * ```ts
624
+ * const mailchannels = new MailChannels('your-api-key')
625
+ * const { data, error } = await mailchannels.emails.rotateDkimKey('example.com', 'mailchannels', {
626
+ * newKey: {
627
+ * selector: 'new-selector'
628
+ * }
629
+ * })
630
+ * ```
631
+ */
632
+ rotateDkimKey(domain: string, selector: string, options: EmailsRotateDkimKeyOptions): Promise<EmailsRotateDkimKeyResponse>;
642
633
  }
643
-
644
- type WebhooksListResponse = DataResponse$1<string[]>;
645
-
646
- type WebhooksSigningKeyResponse = DataResponse$1<{
634
+ //#endregion
635
+ //#region src/types/webhooks/list.d.ts
636
+ type WebhooksListResponse = DataResponse<string[]>;
637
+ //#endregion
638
+ //#region src/types/webhooks/signing-key.d.ts
639
+ type WebhooksSigningKeyResponse = DataResponse<{
647
640
  key: string;
648
641
  }>;
649
-
650
- type WebhooksValidateResponse = DataResponse$1<{
642
+ //#endregion
643
+ //#region src/types/webhooks/validate.d.ts
644
+ type WebhooksValidateResponse = DataResponse<{
651
645
  /**
652
646
  * Indicates whether all webhook validations passed.
653
647
  */
@@ -679,60 +673,62 @@ type WebhooksValidateResponse = DataResponse$1<{
679
673
  } | null;
680
674
  }[];
681
675
  }>;
682
-
676
+ //#endregion
677
+ //#region src/modules/webhooks.d.ts
683
678
  declare class Webhooks {
684
- protected mailchannels: MailChannelsClient;
685
- constructor(mailchannels: MailChannelsClient);
686
- /**
687
- * Enrolls the customer to receive event notifications via webhooks.
688
- * @param endpoint - The URL to receive event notifications. Must be no longer than `8000` characters.
689
- * @example
690
- * ```ts
691
- * const mailchannels = new MailChannels('your-api-key')
692
- * const { success, error } = mailchannels.webhooks.enroll('https://example.com/api/webhooks/mailchannels')
693
- * ```
694
- */
695
- enroll(endpoint: string): Promise<SuccessResponse>;
696
- /**
697
- * Retrieves all registered webhook endpoints associated with the customer.
698
- * @example
699
- * ```ts
700
- * const mailchannels = new MailChannels('your-api-key')
701
- * const { data, error } = await mailchannels.webhooks.list()
702
- * ```
703
- */
704
- list(): Promise<WebhooksListResponse>;
705
- /**
706
- * Deletes all registered webhook endpoints for the customer.
707
- * @example
708
- * ```ts
709
- * const mailchannels = new MailChannels('your-api-key')
710
- * const { success, error } = await mailchannels.webhooks.delete()
711
- * ```
712
- */
713
- delete(): Promise<SuccessResponse>;
714
- /**
715
- * Retrieves the public key used to verify signatures on incoming webhook payloads.
716
- * @param id - The ID of the key.
717
- * @example
718
- * ```ts
719
- * const mailchannels = new MailChannels('your-api-key')
720
- * const { data, error } = await mailchannels.webhooks.getSigningKey('key-id')
721
- * ```
722
- */
723
- getSigningKey(id: string): Promise<WebhooksSigningKeyResponse>;
724
- /**
725
- * Validates whether your enrolled webhook(s) respond with an HTTP `2xx` status code. Sends a test request to each webhook containing your customer handle, a hardcoded event type (`test`), a hardcoded sender email (`test@mailchannels.com`), a timestamp, a request ID (provided or generated), and an SMTP ID. The response includes the HTTP status code and body returned by each webhook.
726
- * @param requestId - Optional identifier in the webhook payload. If not provided, a value will be automatically generated. Must not exceed 28 characters.
727
- * @example
728
- * ```ts
729
- * const mailchannels = new MailChannels('your-api-key')
730
- * const { data, error } = await mailchannels.webhooks.validate('optional-request-id')
731
- * ```
732
- */
733
- validate(requestId?: string): Promise<WebhooksValidateResponse>;
679
+ protected mailchannels: MailChannelsClient;
680
+ constructor(mailchannels: MailChannelsClient);
681
+ /**
682
+ * Enrolls the customer to receive event notifications via webhooks.
683
+ * @param endpoint - The URL to receive event notifications. Must be no longer than `8000` characters.
684
+ * @example
685
+ * ```ts
686
+ * const mailchannels = new MailChannels('your-api-key')
687
+ * const { success, error } = mailchannels.webhooks.enroll('https://example.com/api/webhooks/mailchannels')
688
+ * ```
689
+ */
690
+ enroll(endpoint: string): Promise<SuccessResponse>;
691
+ /**
692
+ * Retrieves all registered webhook endpoints associated with the customer.
693
+ * @example
694
+ * ```ts
695
+ * const mailchannels = new MailChannels('your-api-key')
696
+ * const { data, error } = await mailchannels.webhooks.list()
697
+ * ```
698
+ */
699
+ list(): Promise<WebhooksListResponse>;
700
+ /**
701
+ * Deletes all registered webhook endpoints for the customer.
702
+ * @example
703
+ * ```ts
704
+ * const mailchannels = new MailChannels('your-api-key')
705
+ * const { success, error } = await mailchannels.webhooks.delete()
706
+ * ```
707
+ */
708
+ delete(): Promise<SuccessResponse>;
709
+ /**
710
+ * Retrieves the public key used to verify signatures on incoming webhook payloads.
711
+ * @param id - The ID of the key.
712
+ * @example
713
+ * ```ts
714
+ * const mailchannels = new MailChannels('your-api-key')
715
+ * const { data, error } = await mailchannels.webhooks.getSigningKey('key-id')
716
+ * ```
717
+ */
718
+ getSigningKey(id: string): Promise<WebhooksSigningKeyResponse>;
719
+ /**
720
+ * Validates whether your enrolled webhook(s) respond with an HTTP `2xx` status code. Sends a test request to each webhook containing your customer handle, a hardcoded event type (`test`), a hardcoded sender email (`test@mailchannels.com`), a timestamp, a request ID (provided or generated), and an SMTP ID. The response includes the HTTP status code and body returned by each webhook.
721
+ * @param requestId - Optional identifier in the webhook payload. If not provided, a value will be automatically generated. Must not exceed 28 characters.
722
+ * @example
723
+ * ```ts
724
+ * const mailchannels = new MailChannels('your-api-key')
725
+ * const { data, error } = await mailchannels.webhooks.validate('optional-request-id')
726
+ * ```
727
+ */
728
+ validate(requestId?: string): Promise<WebhooksValidateResponse>;
734
729
  }
735
-
730
+ //#endregion
731
+ //#region src/types/sub-accounts/create.d.ts
736
732
  interface SubAccountsAccount {
737
733
  /**
738
734
  * The name of the company associated with the sub-account.
@@ -747,9 +743,9 @@ interface SubAccountsAccount {
747
743
  */
748
744
  handle: string;
749
745
  }
750
-
751
- type SubAccountsCreateResponse = DataResponse$1<SubAccountsAccount>;
752
-
746
+ type SubAccountsCreateResponse = DataResponse<SubAccountsAccount>;
747
+ //#endregion
748
+ //#region src/types/sub-accounts/list.d.ts
753
749
  interface SubAccountsListOptions {
754
750
  /**
755
751
  * Possible values are `1` to `1000`.
@@ -762,9 +758,9 @@ interface SubAccountsListOptions {
762
758
  */
763
759
  offset?: number;
764
760
  }
765
-
766
- type SubAccountsListResponse = DataResponse$1<SubAccountsAccount[]>;
767
-
761
+ type SubAccountsListResponse = DataResponse<SubAccountsAccount[]>;
762
+ //#endregion
763
+ //#region src/types/sub-accounts/api-key.d.ts
768
764
  interface SubAccountsApiKey {
769
765
  /**
770
766
  * The API key ID for the sub-account.
@@ -775,9 +771,7 @@ interface SubAccountsApiKey {
775
771
  */
776
772
  value: string;
777
773
  }
778
-
779
- type SubAccountsCreateApiKeyResponse = DataResponse$1<SubAccountsApiKey>;
780
-
774
+ type SubAccountsCreateApiKeyResponse = DataResponse<SubAccountsApiKey>;
781
775
  interface SubAccountsListApiKeyOptions {
782
776
  /**
783
777
  * The maximum number of API keys included in the response. Possible values are `1` to `1000`.
@@ -790,9 +784,9 @@ interface SubAccountsListApiKeyOptions {
790
784
  */
791
785
  offset?: number;
792
786
  }
793
-
794
- type SubAccountsListApiKeyResponse = DataResponse$1<SubAccountsApiKey[]>;
795
-
787
+ type SubAccountsListApiKeyResponse = DataResponse<SubAccountsApiKey[]>;
788
+ //#endregion
789
+ //#region src/types/sub-accounts/smtp-password.d.ts
796
790
  interface SubAccountsSmtpPassword {
797
791
  /**
798
792
  * Whether the SMTP password is enabled.
@@ -807,17 +801,16 @@ interface SubAccountsSmtpPassword {
807
801
  */
808
802
  value: string;
809
803
  }
810
-
811
- type SubAccountsCreateSmtpPasswordResponse = DataResponse$1<SubAccountsSmtpPassword>;
812
-
813
- type SubAccountsListSmtpPasswordResponse = DataResponse$1<SubAccountsSmtpPassword[]>;
814
-
804
+ type SubAccountsCreateSmtpPasswordResponse = DataResponse<SubAccountsSmtpPassword>;
805
+ type SubAccountsListSmtpPasswordResponse = DataResponse<SubAccountsSmtpPassword[]>;
806
+ //#endregion
807
+ //#region src/types/sub-accounts/limit.d.ts
815
808
  interface SubAccountsLimit {
816
809
  sends: number;
817
810
  }
818
-
819
- type SubAccountsLimitResponse = DataResponse$1<SubAccountsLimit>;
820
-
811
+ type SubAccountsLimitResponse = DataResponse<SubAccountsLimit>;
812
+ //#endregion
813
+ //#region src/types/sub-accounts/usage.d.ts
821
814
  interface SubAccountsUsage {
822
815
  /**
823
816
  * The end date of the current billing period (ISO 8601 format).
@@ -834,170 +827,171 @@ interface SubAccountsUsage {
834
827
  */
835
828
  total: number;
836
829
  }
837
-
838
- type SubAccountsUsageResponse = DataResponse$1<SubAccountsUsage>;
839
-
830
+ type SubAccountsUsageResponse = DataResponse<SubAccountsUsage>;
831
+ //#endregion
832
+ //#region src/modules/sub-accounts.d.ts
840
833
  declare class SubAccounts {
841
- protected mailchannels: MailChannelsClient;
842
- private static readonly COMPANY_PATTERN;
843
- private static readonly HANDLE_PATTERN;
844
- constructor(mailchannels: MailChannelsClient);
845
- /**
846
- * Creates a new sub-account under the parent account. Each sub-account must have a unique handle composed solely of lowercase alphanumeric characters. If no handle is provided, a random handle will be generated. Note that Sub-accounts are only available to parent accounts on 100K and higher plans.
847
- * @param companyName - The name of the company associated with the sub-account. This name is used for display purposes only and does not affect the functionality of the sub-account. The length must be between 3 and 128 characters.
848
- * @param handle - A unique name for the sub-account to be created. The length must be between 3 and 128 characters, and it may contain only lowercase letters and numbers. If not provided, a random handle will be generated.
849
- * @example
850
- * ```ts
851
- * const mailchannels = new MailChannels('your-api-key')
852
- * const { data, error } = await mailchannels.subAccounts.create('My Company', 'validhandle123')
853
- * ```
854
- */
855
- create(companyName: string, handle?: string): Promise<SubAccountsCreateResponse>;
856
- /**
857
- * Retrieves all sub-accounts associated with the parent account. The response is paginated with a default limit of 1000 sub-accounts per page and an offset of 0.
858
- * @param options - The options to filter the list of sub-accounts.
859
- * @example
860
- * ```ts
861
- * const mailchannels = new MailChannels('your-api-key')
862
- * const { data, error } = await mailchannels.subAccounts.list()
863
- * ```
864
- */
865
- list(options?: SubAccountsListOptions): Promise<SubAccountsListResponse>;
866
- /**
867
- * Deletes the sub-account identified by its handle.
868
- * @param handle - Handle of sub-account to be deleted.
869
- * ```ts
870
- * const mailchannels = new MailChannels('your-api-key')
871
- * const { success, error } = await mailchannels.subAccounts.delete('validhandle123')
872
- * ```
873
- */
874
- delete(handle: string): Promise<SuccessResponse>;
875
- /**
876
- * Suspends the sub-account identified by its handle. This action disables the account, preventing it from sending any emails until it is reactivated.
877
- * @param handle - Handle of sub-account to be suspended.
878
- * @example
879
- * ```ts
880
- * const mailchannels = new MailChannels('your-api-key')
881
- * const { success, error } = await mailchannels.subAccounts.suspend('validhandle123')
882
- * ```
883
- */
884
- suspend(handle: string): Promise<SuccessResponse>;
885
- /**
886
- * Activates a suspended sub-account identified by its handle, restoring its ability to send emails.
887
- * @param handle - Handle of sub-account to be activated.
888
- * @example
889
- * ```ts
890
- * const mailchannels = new MailChannels('your-api-key')
891
- * const { success, error } = await mailchannels.subAccounts.activate('validhandle123')
892
- * ```
893
- */
894
- activate(handle: string): Promise<SuccessResponse>;
895
- /**
896
- * Creates a new API key for the specified sub-account.
897
- * @param handle - Handle of the sub-account to create API key for.
898
- * @example
899
- * ```ts
900
- * const mailchannels = new MailChannels('your-api-key')
901
- * const { data, error } = await mailchannels.subAccounts.createApiKey('validhandle123')
902
- * ```
903
- */
904
- createApiKey(handle: string): Promise<SubAccountsCreateApiKeyResponse>;
905
- /**
906
- * Retrieves details of all API keys associated with the specified sub-account. For security reasons, the full API key is not returned; only the key ID and a partially redacted version are provided.
907
- * @param handle - Handle of the sub-account to retrieve the API key for.
908
- * @param options - The options to filter the list of API keys.
909
- * @example
910
- * ```ts
911
- * const mailchannels = new MailChannels('your-api-key')
912
- * const { data, error } = await mailchannels.subAccounts.listApiKeys('validhandle123')
913
- * ```
914
- */
915
- listApiKeys(handle: string, options?: SubAccountsListApiKeyOptions): Promise<SubAccountsListApiKeyResponse>;
916
- /**
917
- * Deletes the API key identified by its ID for the specified sub-account.
918
- * @param handle - Handle of the sub-account for which the API key should be deleted.
919
- * @param id - The ID of the API key to delete.
920
- * @example
921
- * ```ts
922
- * const mailchannels = new MailChannels('your-api-key')
923
- * const { success, error } = await mailchannels.subAccounts.deleteApiKey('validhandle123', 1)
924
- * ```
925
- */
926
- deleteApiKey(handle: string, id: number): Promise<SuccessResponse>;
927
- /**
928
- * Creates a new SMTP password for the specified sub-account.
929
- * @param handle - Handle of the sub-account to create SMTP password for.
930
- * @example
931
- * ```ts
932
- * const mailchannels = new MailChannels('your-api-key')
933
- * const { data, error } = await mailchannels.subAccounts.createSmtpPassword('validhandle123')
934
- * ```
935
- */
936
- createSmtpPassword(handle: string): Promise<SubAccountsCreateSmtpPasswordResponse>;
937
- /**
938
- * Retrieves details of all SMTP passwords associated with the specified sub-account. For security, the full SMTP password is not returned; only the password ID and a partially redacted version are provided.
939
- * @param handle - Handle of the sub-account to retrieve the SMTP password for.
940
- * @example
941
- * ```ts
942
- * const mailchannels = new MailChannels('your-api-key')
943
- * const { data, error } = await mailchannels.subAccounts.listSmtpPasswords('validhandle123')
944
- * ```
945
- */
946
- listSmtpPasswords(handle: string): Promise<SubAccountsListSmtpPasswordResponse>;
947
- /**
948
- * Deletes the SMTP password identified by its ID for the specified sub-account.
949
- * @param handle - Handle of the sub-account for which the SMTP password should be deleted.
950
- * @param id - The ID of the SMTP password to delete.
951
- * @example
952
- * ```ts
953
- * const mailchannels = new MailChannels('your-api-key')
954
- * const { success, error } = await mailchannels.subAccounts.deleteSmtpPassword('validhandle123', 1)
955
- * ```
956
- */
957
- deleteSmtpPassword(handle: string, id: number): Promise<SuccessResponse>;
958
- /**
959
- * Retrieves the limit of a specified sub-account. A value of `-1` indicates that the sub-account inherits the parent account's limit, allowing the sub-account to utilize any remaining capacity within the parent account's allocation.
960
- * @param handle - Handle of the sub-account to retrieve the limit for.
961
- * @example
962
- * ```ts
963
- * const mailchannels = new MailChannels('your-api-key')
964
- * const { data, error } = await mailchannels.subAccounts.getLimit('validhandle123')
965
- * ```
966
- */
967
- getLimit(handle: string): Promise<SubAccountsLimitResponse>;
968
- /**
969
- * Sets the limit for the specified sub-account.
970
- * @param handle - Handle of the sub-account to set limit for.
971
- * @param limit - The limits to set for the sub-account. The minimum allowed sends is `0`
972
- * @example
973
- * ```ts
974
- * const mailchannels = new MailChannels('your-api-key')
975
- * const { success, error } = await mailchannels.subAccounts.setLimit('validhandle123', { sends: 1000 })
976
- * ```
977
- */
978
- setLimit(handle: string, limit: SubAccountsLimit): Promise<SuccessResponse>;
979
- /**
980
- * Deletes the limit for the specified sub-account. After a successful deletion, the specified sub-account will be limited to the parent account's limit.
981
- * @param handle - Handle of the sub-account to delete limit for.
982
- * @example
983
- * ```ts
984
- * const mailchannels = new MailChannels('your-api-key')
985
- * const { success, error } = await mailchannels.subAccounts.deleteLimit('validhandle123')
986
- * ```
987
- */
988
- deleteLimit(handle: string): Promise<SuccessResponse>;
989
- /**
990
- * Retrieves usage statistics for the specified sub-account during the current billing period.
991
- * @param handle - Handle of the sub-account to query usage stats for.
992
- * @example
993
- * ```ts
994
- * const mailchannels = new MailChannels('your-api-key')
995
- * const { data, error } = await mailchannels.subAccounts.getUsage('validhandle123')
996
- * ```
997
- */
998
- getUsage(handle: string): Promise<SubAccountsUsageResponse>;
834
+ protected mailchannels: MailChannelsClient;
835
+ private static readonly COMPANY_PATTERN;
836
+ private static readonly HANDLE_PATTERN;
837
+ constructor(mailchannels: MailChannelsClient);
838
+ /**
839
+ * Creates a new sub-account under the parent account. Each sub-account must have a unique handle composed solely of lowercase alphanumeric characters. If no handle is provided, a random handle will be generated. Note that Sub-accounts are only available to parent accounts on 100K and higher plans.
840
+ * @param companyName - The name of the company associated with the sub-account. This name is used for display purposes only and does not affect the functionality of the sub-account. The length must be between 3 and 128 characters.
841
+ * @param handle - A unique name for the sub-account to be created. The length must be between 3 and 128 characters, and it may contain only lowercase letters and numbers. If not provided, a random handle will be generated.
842
+ * @example
843
+ * ```ts
844
+ * const mailchannels = new MailChannels('your-api-key')
845
+ * const { data, error } = await mailchannels.subAccounts.create('My Company', 'validhandle123')
846
+ * ```
847
+ */
848
+ create(companyName: string, handle?: string): Promise<SubAccountsCreateResponse>;
849
+ /**
850
+ * Retrieves all sub-accounts associated with the parent account. The response is paginated with a default limit of 1000 sub-accounts per page and an offset of 0.
851
+ * @param options - The options to filter the list of sub-accounts.
852
+ * @example
853
+ * ```ts
854
+ * const mailchannels = new MailChannels('your-api-key')
855
+ * const { data, error } = await mailchannels.subAccounts.list()
856
+ * ```
857
+ */
858
+ list(options?: SubAccountsListOptions): Promise<SubAccountsListResponse>;
859
+ /**
860
+ * Deletes the sub-account identified by its handle.
861
+ * @param handle - Handle of sub-account to be deleted.
862
+ * ```ts
863
+ * const mailchannels = new MailChannels('your-api-key')
864
+ * const { success, error } = await mailchannels.subAccounts.delete('validhandle123')
865
+ * ```
866
+ */
867
+ delete(handle: string): Promise<SuccessResponse>;
868
+ /**
869
+ * Suspends the sub-account identified by its handle. This action disables the account, preventing it from sending any emails until it is reactivated.
870
+ * @param handle - Handle of sub-account to be suspended.
871
+ * @example
872
+ * ```ts
873
+ * const mailchannels = new MailChannels('your-api-key')
874
+ * const { success, error } = await mailchannels.subAccounts.suspend('validhandle123')
875
+ * ```
876
+ */
877
+ suspend(handle: string): Promise<SuccessResponse>;
878
+ /**
879
+ * Activates a suspended sub-account identified by its handle, restoring its ability to send emails.
880
+ * @param handle - Handle of sub-account to be activated.
881
+ * @example
882
+ * ```ts
883
+ * const mailchannels = new MailChannels('your-api-key')
884
+ * const { success, error } = await mailchannels.subAccounts.activate('validhandle123')
885
+ * ```
886
+ */
887
+ activate(handle: string): Promise<SuccessResponse>;
888
+ /**
889
+ * Creates a new API key for the specified sub-account.
890
+ * @param handle - Handle of the sub-account to create API key for.
891
+ * @example
892
+ * ```ts
893
+ * const mailchannels = new MailChannels('your-api-key')
894
+ * const { data, error } = await mailchannels.subAccounts.createApiKey('validhandle123')
895
+ * ```
896
+ */
897
+ createApiKey(handle: string): Promise<SubAccountsCreateApiKeyResponse>;
898
+ /**
899
+ * Retrieves details of all API keys associated with the specified sub-account. For security reasons, the full API key is not returned; only the key ID and a partially redacted version are provided.
900
+ * @param handle - Handle of the sub-account to retrieve the API key for.
901
+ * @param options - The options to filter the list of API keys.
902
+ * @example
903
+ * ```ts
904
+ * const mailchannels = new MailChannels('your-api-key')
905
+ * const { data, error } = await mailchannels.subAccounts.listApiKeys('validhandle123')
906
+ * ```
907
+ */
908
+ listApiKeys(handle: string, options?: SubAccountsListApiKeyOptions): Promise<SubAccountsListApiKeyResponse>;
909
+ /**
910
+ * Deletes the API key identified by its ID for the specified sub-account.
911
+ * @param handle - Handle of the sub-account for which the API key should be deleted.
912
+ * @param id - The ID of the API key to delete.
913
+ * @example
914
+ * ```ts
915
+ * const mailchannels = new MailChannels('your-api-key')
916
+ * const { success, error } = await mailchannels.subAccounts.deleteApiKey('validhandle123', 1)
917
+ * ```
918
+ */
919
+ deleteApiKey(handle: string, id: number): Promise<SuccessResponse>;
920
+ /**
921
+ * Creates a new SMTP password for the specified sub-account.
922
+ * @param handle - Handle of the sub-account to create SMTP password for.
923
+ * @example
924
+ * ```ts
925
+ * const mailchannels = new MailChannels('your-api-key')
926
+ * const { data, error } = await mailchannels.subAccounts.createSmtpPassword('validhandle123')
927
+ * ```
928
+ */
929
+ createSmtpPassword(handle: string): Promise<SubAccountsCreateSmtpPasswordResponse>;
930
+ /**
931
+ * Retrieves details of all SMTP passwords associated with the specified sub-account. For security, the full SMTP password is not returned; only the password ID and a partially redacted version are provided.
932
+ * @param handle - Handle of the sub-account to retrieve the SMTP password for.
933
+ * @example
934
+ * ```ts
935
+ * const mailchannels = new MailChannels('your-api-key')
936
+ * const { data, error } = await mailchannels.subAccounts.listSmtpPasswords('validhandle123')
937
+ * ```
938
+ */
939
+ listSmtpPasswords(handle: string): Promise<SubAccountsListSmtpPasswordResponse>;
940
+ /**
941
+ * Deletes the SMTP password identified by its ID for the specified sub-account.
942
+ * @param handle - Handle of the sub-account for which the SMTP password should be deleted.
943
+ * @param id - The ID of the SMTP password to delete.
944
+ * @example
945
+ * ```ts
946
+ * const mailchannels = new MailChannels('your-api-key')
947
+ * const { success, error } = await mailchannels.subAccounts.deleteSmtpPassword('validhandle123', 1)
948
+ * ```
949
+ */
950
+ deleteSmtpPassword(handle: string, id: number): Promise<SuccessResponse>;
951
+ /**
952
+ * Retrieves the limit of a specified sub-account. A value of `-1` indicates that the sub-account inherits the parent account's limit, allowing the sub-account to utilize any remaining capacity within the parent account's allocation.
953
+ * @param handle - Handle of the sub-account to retrieve the limit for.
954
+ * @example
955
+ * ```ts
956
+ * const mailchannels = new MailChannels('your-api-key')
957
+ * const { data, error } = await mailchannels.subAccounts.getLimit('validhandle123')
958
+ * ```
959
+ */
960
+ getLimit(handle: string): Promise<SubAccountsLimitResponse>;
961
+ /**
962
+ * Sets the limit for the specified sub-account.
963
+ * @param handle - Handle of the sub-account to set limit for.
964
+ * @param limit - The limits to set for the sub-account. The minimum allowed sends is `0`
965
+ * @example
966
+ * ```ts
967
+ * const mailchannels = new MailChannels('your-api-key')
968
+ * const { success, error } = await mailchannels.subAccounts.setLimit('validhandle123', { sends: 1000 })
969
+ * ```
970
+ */
971
+ setLimit(handle: string, limit: SubAccountsLimit): Promise<SuccessResponse>;
972
+ /**
973
+ * Deletes the limit for the specified sub-account. After a successful deletion, the specified sub-account will be limited to the parent account's limit.
974
+ * @param handle - Handle of the sub-account to delete limit for.
975
+ * @example
976
+ * ```ts
977
+ * const mailchannels = new MailChannels('your-api-key')
978
+ * const { success, error } = await mailchannels.subAccounts.deleteLimit('validhandle123')
979
+ * ```
980
+ */
981
+ deleteLimit(handle: string): Promise<SuccessResponse>;
982
+ /**
983
+ * Retrieves usage statistics for the specified sub-account during the current billing period.
984
+ * @param handle - Handle of the sub-account to query usage stats for.
985
+ * @example
986
+ * ```ts
987
+ * const mailchannels = new MailChannels('your-api-key')
988
+ * const { data, error } = await mailchannels.subAccounts.getUsage('validhandle123')
989
+ * ```
990
+ */
991
+ getUsage(handle: string): Promise<SubAccountsUsageResponse>;
999
992
  }
1000
-
993
+ //#endregion
994
+ //#region src/types/metrics/engagement.d.ts
1001
995
  interface MetricsEngagement {
1002
996
  /**
1003
997
  * A series of metrics aggregations bucketed by time interval (e.g. hour, day).
@@ -1015,9 +1009,9 @@ interface MetricsEngagement {
1015
1009
  openTrackingDelivered: number;
1016
1010
  startTime: string;
1017
1011
  }
1018
-
1019
- type MetricsEngagementResponse = DataResponse$1<MetricsEngagement>;
1020
-
1012
+ type MetricsEngagementResponse = DataResponse<MetricsEngagement>;
1013
+ //#endregion
1014
+ //#region src/types/metrics/performance.d.ts
1021
1015
  interface MetricsPerformance {
1022
1016
  /**
1023
1017
  * Count of messages bounced during the specified time range.
@@ -1048,9 +1042,9 @@ interface MetricsPerformance {
1048
1042
  */
1049
1043
  startTime: string;
1050
1044
  }
1051
-
1052
- type MetricsPerformanceResponse = DataResponse$1<MetricsPerformance>;
1053
-
1045
+ type MetricsPerformanceResponse = DataResponse<MetricsPerformance>;
1046
+ //#endregion
1047
+ //#region src/types/metrics/recipient-behaviour.d.ts
1054
1048
  interface MetricsRecipientBehaviour {
1055
1049
  /**
1056
1050
  * A series of metrics aggregations bucketed by time interval (e.g. hour, day).
@@ -1076,9 +1070,9 @@ interface MetricsRecipientBehaviour {
1076
1070
  */
1077
1071
  unsubscribed: number;
1078
1072
  }
1079
-
1080
- type MetricsRecipientBehaviourResponse = DataResponse$1<MetricsRecipientBehaviour>;
1081
-
1073
+ type MetricsRecipientBehaviourResponse = DataResponse<MetricsRecipientBehaviour>;
1074
+ //#endregion
1075
+ //#region src/types/metrics/volume.d.ts
1082
1076
  interface MetricsVolume {
1083
1077
  /**
1084
1078
  * A series of metrics aggregations bucketed by time interval (e.g. hour, day).
@@ -1109,10 +1103,10 @@ interface MetricsVolume {
1109
1103
  */
1110
1104
  startTime: string;
1111
1105
  }
1112
-
1113
- type MetricsVolumeResponse = DataResponse$1<MetricsVolume>;
1114
-
1115
- type MetricsUsageResponse = DataResponse$1<{
1106
+ type MetricsVolumeResponse = DataResponse<MetricsVolume>;
1107
+ //#endregion
1108
+ //#region src/types/metrics/usage.d.ts
1109
+ type MetricsUsageResponse = DataResponse<{
1116
1110
  /**
1117
1111
  * The end date of the current billing period (ISO 8601 format).
1118
1112
  * @example "2025-04-11"
@@ -1128,9 +1122,9 @@ type MetricsUsageResponse = DataResponse$1<{
1128
1122
  */
1129
1123
  total: number;
1130
1124
  }>;
1131
-
1125
+ //#endregion
1126
+ //#region src/types/metrics/senders.d.ts
1132
1127
  type MetricsSendersType = "sub-accounts" | "campaigns";
1133
-
1134
1128
  interface MetricsSendersOptions {
1135
1129
  /**
1136
1130
  * The beginning of the time range for retrieving top senders metrics (inclusive). Formats: `YYYY-MM-DD` or `YYYY-MM-DDTHH:MM:SSZ`. Defaults to one month ago if not provided.
@@ -1158,7 +1152,6 @@ interface MetricsSendersOptions {
1158
1152
  */
1159
1153
  sortOrder?: "asc" | "desc";
1160
1154
  }
1161
-
1162
1155
  interface MetricsSenders {
1163
1156
  endTime: string;
1164
1157
  limit: number;
@@ -1179,9 +1172,9 @@ interface MetricsSenders {
1179
1172
  */
1180
1173
  total: number;
1181
1174
  }
1182
-
1183
- type MetricsSendersResponse = DataResponse$1<MetricsSenders>;
1184
-
1175
+ type MetricsSendersResponse = DataResponse<MetricsSenders>;
1176
+ //#endregion
1177
+ //#region src/types/metrics/index.d.ts
1185
1178
  interface MetricsBucket {
1186
1179
  /**
1187
1180
  * The number of events or occurrences aggregated within this time period.
@@ -1192,7 +1185,6 @@ interface MetricsBucket {
1192
1185
  */
1193
1186
  periodStart: string;
1194
1187
  }
1195
-
1196
1188
  interface MetricsOptions {
1197
1189
  /**
1198
1190
  * The beginning of the time range for retrieving message metrics (inclusive). Formats: `YYYY-MM-DD` or `YYYY-MM-DDTHH:MM:SSZ`. Defaults to one month ago if not provided.
@@ -1214,74 +1206,75 @@ interface MetricsOptions {
1214
1206
  */
1215
1207
  interval?: "hour" | "day" | "week" | "month";
1216
1208
  }
1217
-
1209
+ //#endregion
1210
+ //#region src/modules/metrics.d.ts
1218
1211
  declare class Metrics {
1219
- protected mailchannels: MailChannelsClient;
1220
- constructor(mailchannels: MailChannelsClient);
1221
- /**
1222
- * Retrieve engagement metrics for messages sent from your account, including counts of open and click events. Supports optional filters for time range, and campaign ID.
1223
- * @param options - Options to filter and customize the engagement metrics retrieval.
1224
- * @example
1225
- * ```ts
1226
- * const mailchannels = new MailChannels('your-api-key')
1227
- * const { data, error } = await mailchannels.metrics.engagement()
1228
- * ```
1229
- */
1230
- engagement(options?: MetricsOptions): Promise<MetricsEngagementResponse>;
1231
- /**
1232
- * Retrieve performance metrics for messages sent from your account, including counts of processed, delivered, hard-bounced events. Supports optional filters for time range, and campaign ID.
1233
- * @param options - Options to filter and customize the performance metrics retrieval.
1234
- * @example
1235
- * ```ts
1236
- * const mailchannels = new MailChannels('your-api-key')
1237
- * const { data, error } = await mailchannels.metrics.performance()
1238
- * ```
1239
- */
1240
- performance(options?: MetricsOptions): Promise<MetricsPerformanceResponse>;
1241
- /**
1242
- * Retrieve recipient behaviour metrics for messages sent from your account, including counts of unsubscribed events. Supports optional filters for time range, and campaign ID.
1243
- * @param options - Options to filter and customize the recipient behaviour metrics retrieval.
1244
- * @example
1245
- * ```ts
1246
- * const mailchannels = new MailChannels('your-api-key')
1247
- * const { data, error } = await mailchannels.metrics.recipientBehaviour()
1248
- * ```
1249
- */
1250
- recipientBehaviour(options?: MetricsOptions): Promise<MetricsRecipientBehaviourResponse>;
1251
- /**
1252
- * Retrieve volume metrics for messages sent from your account, including counts of processed, delivered and dropped events. Supports optional filters for time range and campaign ID.
1253
- * @param options - Options to filter and customize the volume metrics retrieval.
1254
- * @example
1255
- * ```ts
1256
- * const mailchannels = new MailChannels('your-api-key')
1257
- * const { data, error } = await mailchannels.metrics.volume()
1258
- * ```
1259
- */
1260
- volume(options?: MetricsOptions): Promise<MetricsVolumeResponse>;
1261
- /**
1262
- * Retrieves usage statistics during the current billing period.
1263
- * @example
1264
- * ```ts
1265
- * const mailchannels = new MailChannels('your-api-key')
1266
- * const { data, error } = await mailchannels.metrics.usage()
1267
- * ```
1268
- */
1269
- usage(): Promise<MetricsUsageResponse>;
1270
- /**
1271
- * Retrieves a list of senders, either sub-accounts or campaigns, with their associated message metrics. Sorted by total # of sent messages (processed + dropped). Supports optional filter for time range, and optional settings for limit, offset, and sort order. Note: senders without any messages in the given time range will not be included in the results. The default time range is from one month ago to now, and the default sort order is descending.
1272
- * @param type - The type of senders to retrieve metrics for. Can be either `sub-accounts` or `campaigns`.
1273
- * @param options - Optional filter options for time range, limit, offset, and sort order.
1274
- * @example
1275
- * ```ts
1276
- * const mailchannels = new MailChannels('your-api-key')
1277
- * const { data, error } = await mailchannels.metrics.senders('campaigns')
1278
- * ```
1279
- */
1280
- senders(type: MetricsSendersType, options?: MetricsSendersOptions): Promise<MetricsSendersResponse>;
1212
+ protected mailchannels: MailChannelsClient;
1213
+ constructor(mailchannels: MailChannelsClient);
1214
+ /**
1215
+ * Retrieve engagement metrics for messages sent from your account, including counts of open and click events. Supports optional filters for time range, and campaign ID.
1216
+ * @param options - Options to filter and customize the engagement metrics retrieval.
1217
+ * @example
1218
+ * ```ts
1219
+ * const mailchannels = new MailChannels('your-api-key')
1220
+ * const { data, error } = await mailchannels.metrics.engagement()
1221
+ * ```
1222
+ */
1223
+ engagement(options?: MetricsOptions): Promise<MetricsEngagementResponse>;
1224
+ /**
1225
+ * Retrieve performance metrics for messages sent from your account, including counts of processed, delivered, hard-bounced events. Supports optional filters for time range, and campaign ID.
1226
+ * @param options - Options to filter and customize the performance metrics retrieval.
1227
+ * @example
1228
+ * ```ts
1229
+ * const mailchannels = new MailChannels('your-api-key')
1230
+ * const { data, error } = await mailchannels.metrics.performance()
1231
+ * ```
1232
+ */
1233
+ performance(options?: MetricsOptions): Promise<MetricsPerformanceResponse>;
1234
+ /**
1235
+ * Retrieve recipient behaviour metrics for messages sent from your account, including counts of unsubscribed events. Supports optional filters for time range, and campaign ID.
1236
+ * @param options - Options to filter and customize the recipient behaviour metrics retrieval.
1237
+ * @example
1238
+ * ```ts
1239
+ * const mailchannels = new MailChannels('your-api-key')
1240
+ * const { data, error } = await mailchannels.metrics.recipientBehaviour()
1241
+ * ```
1242
+ */
1243
+ recipientBehaviour(options?: MetricsOptions): Promise<MetricsRecipientBehaviourResponse>;
1244
+ /**
1245
+ * Retrieve volume metrics for messages sent from your account, including counts of processed, delivered and dropped events. Supports optional filters for time range and campaign ID.
1246
+ * @param options - Options to filter and customize the volume metrics retrieval.
1247
+ * @example
1248
+ * ```ts
1249
+ * const mailchannels = new MailChannels('your-api-key')
1250
+ * const { data, error } = await mailchannels.metrics.volume()
1251
+ * ```
1252
+ */
1253
+ volume(options?: MetricsOptions): Promise<MetricsVolumeResponse>;
1254
+ /**
1255
+ * Retrieves usage statistics during the current billing period.
1256
+ * @example
1257
+ * ```ts
1258
+ * const mailchannels = new MailChannels('your-api-key')
1259
+ * const { data, error } = await mailchannels.metrics.usage()
1260
+ * ```
1261
+ */
1262
+ usage(): Promise<MetricsUsageResponse>;
1263
+ /**
1264
+ * Retrieves a list of senders, either sub-accounts or campaigns, with their associated message metrics. Sorted by total # of sent messages (processed + dropped). Supports optional filter for time range, and optional settings for limit, offset, and sort order. Note: senders without any messages in the given time range will not be included in the results. The default time range is from one month ago to now, and the default sort order is descending.
1265
+ * @param type - The type of senders to retrieve metrics for. Can be either `sub-accounts` or `campaigns`.
1266
+ * @param options - Optional filter options for time range, limit, offset, and sort order.
1267
+ * @example
1268
+ * ```ts
1269
+ * const mailchannels = new MailChannels('your-api-key')
1270
+ * const { data, error } = await mailchannels.metrics.senders('campaigns')
1271
+ * ```
1272
+ */
1273
+ senders(type: MetricsSendersType, options?: MetricsSendersOptions): Promise<MetricsSendersResponse>;
1281
1274
  }
1282
-
1275
+ //#endregion
1276
+ //#region src/types/suppressions/create.d.ts
1283
1277
  type SuppressionsTypes = "transactional" | "non-transactional";
1284
-
1285
1278
  interface SuppressionsCreateOptions {
1286
1279
  /**
1287
1280
  * If true, the parent account creates suppression entries for all associated sub-accounts. This field is only applicable to parent accounts. Sub-accounts cannot create entries for other sub-accounts.
@@ -1307,9 +1300,9 @@ interface SuppressionsCreateOptions {
1307
1300
  types?: SuppressionsTypes[];
1308
1301
  }[];
1309
1302
  }
1310
-
1303
+ //#endregion
1304
+ //#region src/types/suppressions/list.d.ts
1311
1305
  type SuppressionsSource = "api" | "unsubscribe_link" | "list_unsubscribe" | "hard_bounce" | "spam_complaint" | "all";
1312
-
1313
1306
  interface SuppressionsListOptions {
1314
1307
  /**
1315
1308
  * The email address of the suppression entry to search for. If provided, the search will return the suppression entry associated with this recipient. If not provided, the search will return all suppression entries for the account.
@@ -1338,7 +1331,6 @@ interface SuppressionsListOptions {
1338
1331
  */
1339
1332
  offset?: number;
1340
1333
  }
1341
-
1342
1334
  interface SuppressionsListEntry {
1343
1335
  createdAt: string;
1344
1336
  notes?: string;
@@ -1350,48 +1342,48 @@ interface SuppressionsListEntry {
1350
1342
  source: SuppressionsSource;
1351
1343
  types: SuppressionsTypes[];
1352
1344
  }
1353
-
1354
- type SuppressionsListResponse = DataResponse$1<SuppressionsListEntry[]>;
1355
-
1345
+ type SuppressionsListResponse = DataResponse<SuppressionsListEntry[]>;
1346
+ //#endregion
1347
+ //#region src/modules/suppressions.d.ts
1356
1348
  declare class Suppressions {
1357
- protected mailchannels: MailChannelsClient;
1358
- constructor(mailchannels: MailChannelsClient);
1359
- /**
1360
- * Creates suppression entries for the specified account. Parent accounts can create suppression entries for all associated sub-accounts. If `types` is not provided, it defaults to `non-transactional`. The operation is atomic, meaning all entries are successfully added or none are added if an error occurs.
1361
- * @param options - The details of the suppression entries to create.
1362
- * @example
1363
- * ```ts
1364
- * const mailchannels = new MailChannels('your-api-key')
1365
- * const { success, error } = await mailchannels.suppressions.create({
1366
- * // ...
1367
- * });
1368
- */
1369
- create(options: SuppressionsCreateOptions): Promise<SuccessResponse>;
1370
- /**
1371
- * Deletes suppression entry associated with the account based on the specified recipient and source.
1372
- * @param recipient - The email address of the suppression entry to delete.
1373
- * @param source - The source of the suppression entry to be deleted. If source is not provided, it defaults to `api`. If source is set to `all`, all suppression entries related to the specified recipient will be deleted.
1374
- * @example
1375
- * ```ts
1376
- * const mailchannels = new MailChannels('your-api-key')
1377
- * const { success, error } = await mailchannels.suppressions.delete('name@example.com', 'api');
1378
- * ```
1379
- */
1380
- delete(recipient: string, source?: SuppressionsSource): Promise<SuccessResponse>;
1381
- /**
1382
- * Retrieve suppression entries associated with the specified account. Supports filtering by recipient, source and creation date range. The response is paginated, with a default limit of `1000` entries per page and an offset of `0`.
1383
- * @example
1384
- * ```ts
1385
- * const mailchannels = new MailChannels('your-api-key')
1386
- * const { data, error } = await mailchannels.suppressions.list();
1387
- * ```
1388
- * @param options - Options to filter and customize the suppression entries retrieval.
1389
- */
1390
- list(options?: SuppressionsListOptions): Promise<SuppressionsListResponse>;
1349
+ protected mailchannels: MailChannelsClient;
1350
+ constructor(mailchannels: MailChannelsClient);
1351
+ /**
1352
+ * Creates suppression entries for the specified account. Parent accounts can create suppression entries for all associated sub-accounts. If `types` is not provided, it defaults to `non-transactional`. The operation is atomic, meaning all entries are successfully added or none are added if an error occurs.
1353
+ * @param options - The details of the suppression entries to create.
1354
+ * @example
1355
+ * ```ts
1356
+ * const mailchannels = new MailChannels('your-api-key')
1357
+ * const { success, error } = await mailchannels.suppressions.create({
1358
+ * // ...
1359
+ * });
1360
+ */
1361
+ create(options: SuppressionsCreateOptions): Promise<SuccessResponse>;
1362
+ /**
1363
+ * Deletes suppression entry associated with the account based on the specified recipient and source.
1364
+ * @param recipient - The email address of the suppression entry to delete.
1365
+ * @param source - The source of the suppression entry to be deleted. If source is not provided, it defaults to `api`. If source is set to `all`, all suppression entries related to the specified recipient will be deleted.
1366
+ * @example
1367
+ * ```ts
1368
+ * const mailchannels = new MailChannels('your-api-key')
1369
+ * const { success, error } = await mailchannels.suppressions.delete('name@example.com', 'api');
1370
+ * ```
1371
+ */
1372
+ delete(recipient: string, source?: SuppressionsSource): Promise<SuccessResponse>;
1373
+ /**
1374
+ * Retrieve suppression entries associated with the specified account. Supports filtering by recipient, source and creation date range. The response is paginated, with a default limit of `1000` entries per page and an offset of `0`.
1375
+ * @example
1376
+ * ```ts
1377
+ * const mailchannels = new MailChannels('your-api-key')
1378
+ * const { data, error } = await mailchannels.suppressions.list();
1379
+ * ```
1380
+ * @param options - Options to filter and customize the suppression entries retrieval.
1381
+ */
1382
+ list(options?: SuppressionsListOptions): Promise<SuppressionsListResponse>;
1391
1383
  }
1392
-
1384
+ //#endregion
1385
+ //#region src/types/lists/entry.d.ts
1393
1386
  type ListNames = "blocklist" | "safelist" | "blacklist" | "whitelist";
1394
-
1395
1387
  interface ListEntryOptions {
1396
1388
  /**
1397
1389
  * This can be a `blocklist`, `safelist`, `blacklist`, or `whitelist`.
@@ -1402,17 +1394,15 @@ interface ListEntryOptions {
1402
1394
  */
1403
1395
  item: string;
1404
1396
  }
1405
-
1406
1397
  interface ListEntry {
1407
1398
  action: Extract<ListNames, "blocklist" | "safelist">;
1408
1399
  item: string;
1409
1400
  type: "domain" | "email_address" | "ip_address";
1410
1401
  }
1411
-
1412
- type ListEntryResponse = DataResponse$1<ListEntry>;
1413
-
1414
- type ListEntriesResponse = DataResponse$1<ListEntry[]>;
1415
-
1402
+ type ListEntryResponse = DataResponse<ListEntry>;
1403
+ type ListEntriesResponse = DataResponse<ListEntry[]>;
1404
+ //#endregion
1405
+ //#region src/types/domains/provision.d.ts
1416
1406
  interface DomainsData {
1417
1407
  /**
1418
1408
  * The domain name.
@@ -1473,8 +1463,7 @@ interface DomainsData {
1473
1463
  */
1474
1464
  subscriptionHandle: string;
1475
1465
  }
1476
-
1477
- interface DomainsProvisionOptions {
1466
+ interface DomainsProvisionOptions extends DomainsData {
1478
1467
  /**
1479
1468
  * If present and set to true, the domain will be associated with the api-key that created it. This means that this api-key must be used for inbound-api actions involving this domain (for example adding safe/block list entries, etc).
1480
1469
  */
@@ -1484,12 +1473,9 @@ interface DomainsProvisionOptions {
1484
1473
  */
1485
1474
  overwrite?: boolean;
1486
1475
  }
1487
-
1488
- type DomainsBulkProvisionOptions = DomainsProvisionOptions & Pick<DomainsData, "subscriptionHandle">;
1489
-
1490
- type DomainsProvisionResponse = DataResponse$1<DomainsData>;
1491
-
1492
- type DomainsBulkProvisionResponse = DataResponse$1<{
1476
+ type DomainsBulkProvisionOptions = Pick<DomainsProvisionOptions, "subscriptionHandle" | "associateKey" | "overwrite">;
1477
+ type DomainsProvisionResponse = DataResponse<DomainsData>;
1478
+ type DomainsBulkProvisionResponse = DataResponse<{
1493
1479
  /**
1494
1480
  * Domains that were successfully provisioned or updated.
1495
1481
  */
@@ -1513,7 +1499,8 @@ type DomainsBulkProvisionResponse = DataResponse$1<{
1513
1499
  comment?: string;
1514
1500
  }[];
1515
1501
  }>;
1516
-
1502
+ //#endregion
1503
+ //#region src/types/domains/list.d.ts
1517
1504
  interface DomainsListOptions {
1518
1505
  /**
1519
1506
  * A list of domains to fetch. If this parameter is present, only domains whose name matches an item in this list are returned.
@@ -1530,8 +1517,7 @@ interface DomainsListOptions {
1530
1517
  */
1531
1518
  offset?: number;
1532
1519
  }
1533
-
1534
- type DomainsListResponse = DataResponse$1<{
1520
+ type DomainsListResponse = DataResponse<{
1535
1521
  /**
1536
1522
  * A list of domains.
1537
1523
  */
@@ -1541,16 +1527,17 @@ type DomainsListResponse = DataResponse$1<{
1541
1527
  */
1542
1528
  total: number;
1543
1529
  }>;
1544
-
1530
+ //#endregion
1531
+ //#region src/types/domains/create-login-link.d.ts
1545
1532
  interface DomainsCreateLoginLink {
1546
1533
  /**
1547
1534
  * If a user browses to this URL, they will be automatically logged in as a domain admin.
1548
1535
  */
1549
1536
  link: string;
1550
1537
  }
1551
-
1552
- type DomainsCreateLoginLinkResponse = DataResponse$1<DomainsCreateLoginLink>;
1553
-
1538
+ type DomainsCreateLoginLinkResponse = DataResponse<DomainsCreateLoginLink>;
1539
+ //#endregion
1540
+ //#region src/types/domains/downstream-addresses.d.ts
1554
1541
  interface DomainsListDownstreamAddressesOptions {
1555
1542
  /**
1556
1543
  * The number of records to return.
@@ -1563,7 +1550,6 @@ interface DomainsListDownstreamAddressesOptions {
1563
1550
  */
1564
1551
  offset?: number;
1565
1552
  }
1566
-
1567
1553
  interface DomainsDownstreamAddress {
1568
1554
  /**
1569
1555
  * TCP port on which the downstream mail server is listening.
@@ -1582,9 +1568,9 @@ interface DomainsDownstreamAddress {
1582
1568
  */
1583
1569
  weight: number;
1584
1570
  }
1585
-
1586
- type DomainsListDownstreamAddressesResponse = DataResponse$1<DomainsDownstreamAddress[]>;
1587
-
1571
+ type DomainsListDownstreamAddressesResponse = DataResponse<DomainsDownstreamAddress[]>;
1572
+ //#endregion
1573
+ //#region src/types/domains/bulk-create-login-links.d.ts
1588
1574
  interface DomainsBulkCreateLoginLinkResult {
1589
1575
  /**
1590
1576
  * The domain the request was for.
@@ -1600,213 +1586,214 @@ interface DomainsBulkCreateLoginLinkResult {
1600
1586
  */
1601
1587
  loginLink: string;
1602
1588
  }
1603
-
1604
1589
  interface DomainsBulkCreateLoginLinks {
1605
1590
  successes: DomainsBulkCreateLoginLinkResult[];
1606
1591
  errors: Omit<DomainsBulkCreateLoginLinkResult, "loginLink">[];
1607
1592
  }
1608
-
1609
- type DomainsBulkCreateLoginLinksResponse = DataResponse$1<DomainsBulkCreateLoginLinks>;
1610
-
1593
+ type DomainsBulkCreateLoginLinksResponse = DataResponse<DomainsBulkCreateLoginLinks>;
1594
+ //#endregion
1595
+ //#region src/modules/domains.d.ts
1611
1596
  declare class Domains {
1612
- protected mailchannels: MailChannelsClient;
1613
- constructor(mailchannels: MailChannelsClient);
1614
- /**
1615
- * Provision a single domain to use MailChannels Inbound.
1616
- * @param options - The provision options and domain data.
1617
- * @example
1618
- * ```ts
1619
- * const mailchannels = new MailChannels('your-api-key')
1620
- * const { data, error } = await mailchannels.domains.provision({
1621
- * domain: 'example.com',
1622
- * subscriptionHandle: 'your-subscription-handle'
1623
- * })
1624
- * ```
1625
- */
1626
- provision(options: DomainsProvisionOptions & DomainsData): Promise<DomainsProvisionResponse>;
1627
- /**
1628
- * Provision up to 1000 domains to use MailChannels Inbound.
1629
- * @param options - The options to provision the domains.
1630
- * @param domains - A list of domain data to provision.
1631
- * @example
1632
- * ```ts
1633
- * const mailchannels = new MailChannels('your-api-key')
1634
- * const { data, error } = await mailchannels.domains.bulkProvision({
1635
- * subscriptionHandle: 'your-subscription-handle'
1636
- * }, [
1637
- * {
1638
- * domain: 'example.com',
1639
- * admins: ['support@example.com']
1640
- * },
1641
- * {
1642
- * domain: 'example2.com'
1643
- * }
1644
- * ])
1645
- * ```
1646
- */
1647
- bulkProvision(options: DomainsBulkProvisionOptions, domains: Omit<DomainsData, "subscriptionHandle">[]): Promise<DomainsBulkProvisionResponse>;
1648
- /**
1649
- * Fetch a list of all domains associated with this API key.
1650
- * @param options - The options to filter the list of domains.
1651
- * @example
1652
- * ```ts
1653
- * const mailchannels = new MailChannels('your-api-key')
1654
- * const { data, error } = await mailchannels.domains.list()
1655
- * ```
1656
- */
1657
- list(options?: DomainsListOptions): Promise<DomainsListResponse>;
1658
- /**
1659
- * De-provision a domain to cease protecting it with MailChannels Inbound.
1660
- * @param domain - The domain name to be removed.
1661
- * @example
1662
- * ```ts
1663
- * const mailchannels = new MailChannels('your-api-key')
1664
- * const { success, error } = await mailchannels.domains.delete('example.com')
1665
- * ```
1666
- */
1667
- delete(domain: string): Promise<SuccessResponse>;
1668
- /**
1669
- * Add an entry to a domain blocklist or safelist.
1670
- * @param domain - The domain name.
1671
- * @param options - The options to add a list entry.
1672
- * @example
1673
- * ```ts
1674
- * const mailchannels = new MailChannels('your-api-key')
1675
- * const { data, error } = await mailchannels.domains.addListEntry('example.com', {
1676
- * listName: 'safelist',
1677
- * item: 'name@domain.com'
1678
- * })
1679
- * ```
1680
- */
1681
- addListEntry(domain: string, options: ListEntryOptions): Promise<ListEntryResponse>;
1682
- /**
1683
- * Get domain list entries.
1684
- * @param domain - The domain name.
1685
- * @param listName - The name of the list to fetch. This can be a `blocklist`, `safelist`, `blacklist`, or `whitelist`.
1686
- * @example
1687
- * ```ts
1688
- * const mailchannels = new MailChannels('your-api-key')
1689
- * const { data, error } = await mailchannels.domains.listEntries('example.com', 'safelist')
1690
- * ```
1691
- */
1692
- listEntries(domain: string, listName: ListNames): Promise<ListEntriesResponse>;
1693
- /**
1694
- * Delete item from domain list.
1695
- * @param email - The domain name whose list will be modified.
1696
- * @param options - The options for the list entry to delete.
1697
- * @example
1698
- * ```ts
1699
- * const mailchannels = new MailChannels('your-api-key')
1700
- * const { success, error } = await mailchannels.domains.deleteListEntry('example.com', {
1701
- * listName: 'safelist',
1702
- * item: 'name@domain.com'
1703
- * })
1704
- * ```
1705
- */
1706
- deleteListEntry(domain: string, options: ListEntryOptions): Promise<SuccessResponse>;
1707
- /**
1708
- * Generate a link that allows a user to log in as a domain administrator.
1709
- * @param domain - The domain name.
1710
- * @example
1711
- * ```ts
1712
- * const mailchannels = new MailChannels('your-api-key')
1713
- * const { data, error } = await mailchannels.domains.createLoginLink('example.com')
1714
- * ```
1715
- */
1716
- createLoginLink(domain: string): Promise<DomainsCreateLoginLinkResponse>;
1717
- /**
1718
- * Sets the list of downstream addresses for the domain. This action deletes any existing downstream address for the domain before creating new ones. If the `records` parameter is an empty array, all downstream address records will be deleted.
1719
- * @param domain - The domain name.
1720
- * @param records - The list of records to set for the domain. A maximum of 10 records can be set.
1721
- * @example
1722
- * ```ts
1723
- * const mailchannels = new MailChannels('your-api-key')
1724
- * const { success, error } = await mailchannels.domains.setDownstreamAddress('example.com', [
1725
- * {
1726
- * port: 25,
1727
- * priority: 10,
1728
- * target: 'example.com.',
1729
- * weight: 10
1730
- * }
1731
- * ])
1732
- * ```
1733
- */
1734
- setDownstreamAddress(domain: string, records?: DomainsDownstreamAddress[]): Promise<SuccessResponse>;
1735
- /**
1736
- * Retrieve stored downstream addresses for the domain.
1737
- * @param domain - The domain name.
1738
- * @param options - The options to filter the list of downstream addresses.
1739
- * @example
1740
- * ```ts
1741
- * const mailchannels = new MailChannels('your-api-key')
1742
- * const { data, error } = await mailchannels.domains.listDownstreamAddresses('example.com')
1743
- * ```
1744
- */
1745
- listDownstreamAddresses(domain: string, options?: DomainsListDownstreamAddressesOptions): Promise<DomainsListDownstreamAddressesResponse>;
1746
- /**
1747
- * Update the API key that is associated with a domain.
1748
- * @param domain - The domain name.
1749
- * @param key - The new API key to associate with this domain.
1750
- * @example
1751
- * ```ts
1752
- * const mailchannels = new MailChannels('your-api-key')
1753
- * const { success, error } = await mailchannels.domains.updateApiKey('example.com', 'your-api-key')
1754
- * ```
1755
- */
1756
- updateApiKey(domain: string, key: string): Promise<SuccessResponse>;
1757
- /**
1758
- * Generate a batch of links that allow a user to log in as a domain administrator to their different domains.
1759
- * @param domains - The list of domain names. Maximum of `1000` links per request.
1760
- * @example
1761
- * ```ts
1762
- * const mailchannels = new MailChannels('your-api-key')
1763
- * const { data, error } = await mailchannels.domains.bulkCreateLoginLinks(['example.com', 'example2.com'])
1764
- * ```
1765
- */
1766
- bulkCreateLoginLinks(domains: string[]): Promise<DomainsBulkCreateLoginLinksResponse>;
1597
+ protected mailchannels: MailChannelsClient;
1598
+ constructor(mailchannels: MailChannelsClient);
1599
+ /**
1600
+ * Provision a single domain to use MailChannels Inbound.
1601
+ * @param options - The provision options and domain data.
1602
+ * @example
1603
+ * ```ts
1604
+ * const mailchannels = new MailChannels('your-api-key')
1605
+ * const { data, error } = await mailchannels.domains.provision({
1606
+ * domain: 'example.com',
1607
+ * subscriptionHandle: 'your-subscription-handle'
1608
+ * })
1609
+ * ```
1610
+ */
1611
+ provision(options: DomainsProvisionOptions): Promise<DomainsProvisionResponse>;
1612
+ /**
1613
+ * Provision up to 1000 domains to use MailChannels Inbound.
1614
+ * @param options - The options to provision the domains.
1615
+ * @param domains - A list of domain data to provision.
1616
+ * @example
1617
+ * ```ts
1618
+ * const mailchannels = new MailChannels('your-api-key')
1619
+ * const { data, error } = await mailchannels.domains.bulkProvision({
1620
+ * subscriptionHandle: 'your-subscription-handle'
1621
+ * }, [
1622
+ * {
1623
+ * domain: 'example.com',
1624
+ * admins: ['support@example.com']
1625
+ * },
1626
+ * {
1627
+ * domain: 'example2.com'
1628
+ * }
1629
+ * ])
1630
+ * ```
1631
+ */
1632
+ bulkProvision(options: DomainsBulkProvisionOptions, domains: Omit<DomainsData, "subscriptionHandle">[]): Promise<DomainsBulkProvisionResponse>;
1633
+ /**
1634
+ * Fetch a list of all domains associated with this API key.
1635
+ * @param options - The options to filter the list of domains.
1636
+ * @example
1637
+ * ```ts
1638
+ * const mailchannels = new MailChannels('your-api-key')
1639
+ * const { data, error } = await mailchannels.domains.list()
1640
+ * ```
1641
+ */
1642
+ list(options?: DomainsListOptions): Promise<DomainsListResponse>;
1643
+ /**
1644
+ * De-provision a domain to cease protecting it with MailChannels Inbound.
1645
+ * @param domain - The domain name to be removed.
1646
+ * @example
1647
+ * ```ts
1648
+ * const mailchannels = new MailChannels('your-api-key')
1649
+ * const { success, error } = await mailchannels.domains.delete('example.com')
1650
+ * ```
1651
+ */
1652
+ delete(domain: string): Promise<SuccessResponse>;
1653
+ /**
1654
+ * Add an entry to a domain blocklist or safelist.
1655
+ * @param domain - The domain name.
1656
+ * @param options - The options to add a list entry.
1657
+ * @example
1658
+ * ```ts
1659
+ * const mailchannels = new MailChannels('your-api-key')
1660
+ * const { data, error } = await mailchannels.domains.addListEntry('example.com', {
1661
+ * listName: 'safelist',
1662
+ * item: 'name@domain.com'
1663
+ * })
1664
+ * ```
1665
+ */
1666
+ addListEntry(domain: string, options: ListEntryOptions): Promise<ListEntryResponse>;
1667
+ /**
1668
+ * Get domain list entries.
1669
+ * @param domain - The domain name.
1670
+ * @param listName - The name of the list to fetch. This can be a `blocklist`, `safelist`, `blacklist`, or `whitelist`.
1671
+ * @example
1672
+ * ```ts
1673
+ * const mailchannels = new MailChannels('your-api-key')
1674
+ * const { data, error } = await mailchannels.domains.listEntries('example.com', 'safelist')
1675
+ * ```
1676
+ */
1677
+ listEntries(domain: string, listName: ListNames): Promise<ListEntriesResponse>;
1678
+ /**
1679
+ * Delete item from domain list.
1680
+ * @param email - The domain name whose list will be modified.
1681
+ * @param options - The options for the list entry to delete.
1682
+ * @example
1683
+ * ```ts
1684
+ * const mailchannels = new MailChannels('your-api-key')
1685
+ * const { success, error } = await mailchannels.domains.deleteListEntry('example.com', {
1686
+ * listName: 'safelist',
1687
+ * item: 'name@domain.com'
1688
+ * })
1689
+ * ```
1690
+ */
1691
+ deleteListEntry(domain: string, options: ListEntryOptions): Promise<SuccessResponse>;
1692
+ /**
1693
+ * Generate a link that allows a user to log in as a domain administrator.
1694
+ * @param domain - The domain name.
1695
+ * @example
1696
+ * ```ts
1697
+ * const mailchannels = new MailChannels('your-api-key')
1698
+ * const { data, error } = await mailchannels.domains.createLoginLink('example.com')
1699
+ * ```
1700
+ */
1701
+ createLoginLink(domain: string): Promise<DomainsCreateLoginLinkResponse>;
1702
+ /**
1703
+ * Sets the list of downstream addresses for the domain. This action deletes any existing downstream address for the domain before creating new ones. If the `records` parameter is an empty array, all downstream address records will be deleted.
1704
+ * @param domain - The domain name.
1705
+ * @param records - The list of records to set for the domain. A maximum of 10 records can be set.
1706
+ * @example
1707
+ * ```ts
1708
+ * const mailchannels = new MailChannels('your-api-key')
1709
+ * const { success, error } = await mailchannels.domains.setDownstreamAddress('example.com', [
1710
+ * {
1711
+ * port: 25,
1712
+ * priority: 10,
1713
+ * target: 'example.com.',
1714
+ * weight: 10
1715
+ * }
1716
+ * ])
1717
+ * ```
1718
+ */
1719
+ setDownstreamAddress(domain: string, records: DomainsDownstreamAddress[]): Promise<SuccessResponse>;
1720
+ /**
1721
+ * Retrieve stored downstream addresses for the domain.
1722
+ * @param domain - The domain name.
1723
+ * @param options - The options to filter the list of downstream addresses.
1724
+ * @example
1725
+ * ```ts
1726
+ * const mailchannels = new MailChannels('your-api-key')
1727
+ * const { data, error } = await mailchannels.domains.listDownstreamAddresses('example.com')
1728
+ * ```
1729
+ */
1730
+ listDownstreamAddresses(domain: string, options?: DomainsListDownstreamAddressesOptions): Promise<DomainsListDownstreamAddressesResponse>;
1731
+ /**
1732
+ * Update the API key that is associated with a domain.
1733
+ * @param domain - The domain name.
1734
+ * @param key - The new API key to associate with this domain.
1735
+ * @example
1736
+ * ```ts
1737
+ * const mailchannels = new MailChannels('your-api-key')
1738
+ * const { success, error } = await mailchannels.domains.updateApiKey('example.com', 'your-api-key')
1739
+ * ```
1740
+ */
1741
+ updateApiKey(domain: string, key: string): Promise<SuccessResponse>;
1742
+ /**
1743
+ * Generate a batch of links that allow a user to log in as a domain administrator to their different domains.
1744
+ * @param domains - The list of domain names. Maximum of `1000` links per request.
1745
+ * @example
1746
+ * ```ts
1747
+ * const mailchannels = new MailChannels('your-api-key')
1748
+ * const { data, error } = await mailchannels.domains.bulkCreateLoginLinks(['example.com', 'example2.com'])
1749
+ * ```
1750
+ */
1751
+ bulkCreateLoginLinks(domains: string[]): Promise<DomainsBulkCreateLoginLinksResponse>;
1767
1752
  }
1768
-
1753
+ //#endregion
1754
+ //#region src/modules/lists.d.ts
1769
1755
  declare class Lists {
1770
- protected mailchannels: MailChannelsClient;
1771
- constructor(mailchannels: MailChannelsClient);
1772
- /**
1773
- * Add item to account-level list
1774
- * @param options - The options for the list entry to add.
1775
- * @example
1776
- * ```ts
1777
- * const mailchannels = new MailChannels('your-api-key')
1778
- * const { data, error } = await mailchannels.lists.addListEntry({
1779
- * listName: 'safelist',
1780
- * item: 'name@domain.com'
1781
- * })
1782
- * ```
1783
- */
1784
- addListEntry(options: ListEntryOptions): Promise<ListEntryResponse>;
1785
- /**
1786
- * Get account-level list entries.
1787
- * @param listName - The name of the list to fetch. This can be a `blocklist`, `safelist`, `blacklist`, or `whitelist`.
1788
- * @example
1789
- * ```ts
1790
- * const mailchannels = new MailChannels('your-api-key')
1791
- * const { data, error } = await mailchannels.lists.listEntries('safelist')
1792
- * ```
1793
- */
1794
- listEntries(listName: ListNames): Promise<ListEntriesResponse>;
1795
- /**
1796
- * Delete item from account-level list.
1797
- * @param options - The options for the list entry to delete.
1798
- * @example
1799
- * ```ts
1800
- * const mailchannels = new MailChannels('your-api-key')
1801
- * const { success, error } = await mailchannels.lists.deleteListEntry({
1802
- * listName: 'safelist',
1803
- * item: 'name@domain.com'
1804
- * })
1805
- * ```
1806
- */
1807
- deleteListEntry(options: ListEntryOptions): Promise<SuccessResponse>;
1756
+ protected mailchannels: MailChannelsClient;
1757
+ constructor(mailchannels: MailChannelsClient);
1758
+ /**
1759
+ * Add item to account-level list
1760
+ * @param options - The options for the list entry to add.
1761
+ * @example
1762
+ * ```ts
1763
+ * const mailchannels = new MailChannels('your-api-key')
1764
+ * const { data, error } = await mailchannels.lists.addListEntry({
1765
+ * listName: 'safelist',
1766
+ * item: 'name@domain.com'
1767
+ * })
1768
+ * ```
1769
+ */
1770
+ addListEntry(options: ListEntryOptions): Promise<ListEntryResponse>;
1771
+ /**
1772
+ * Get account-level list entries.
1773
+ * @param listName - The name of the list to fetch. This can be a `blocklist`, `safelist`, `blacklist`, or `whitelist`.
1774
+ * @example
1775
+ * ```ts
1776
+ * const mailchannels = new MailChannels('your-api-key')
1777
+ * const { data, error } = await mailchannels.lists.listEntries('safelist')
1778
+ * ```
1779
+ */
1780
+ listEntries(listName: ListNames): Promise<ListEntriesResponse>;
1781
+ /**
1782
+ * Delete item from account-level list.
1783
+ * @param options - The options for the list entry to delete.
1784
+ * @example
1785
+ * ```ts
1786
+ * const mailchannels = new MailChannels('your-api-key')
1787
+ * const { success, error } = await mailchannels.lists.deleteListEntry({
1788
+ * listName: 'safelist',
1789
+ * item: 'name@domain.com'
1790
+ * })
1791
+ * ```
1792
+ */
1793
+ deleteListEntry(options: ListEntryOptions): Promise<SuccessResponse>;
1808
1794
  }
1809
-
1795
+ //#endregion
1796
+ //#region src/types/users/create.d.ts
1810
1797
  interface UsersCreateOptions {
1811
1798
  /**
1812
1799
  * Flag to indicate if the user is a domain admin or a regular user.
@@ -1829,8 +1816,7 @@ interface UsersCreateOptions {
1829
1816
  safelist?: string[];
1830
1817
  };
1831
1818
  }
1832
-
1833
- type UsersCreateResponse = DataResponse$1<{
1819
+ type UsersCreateResponse = DataResponse<{
1834
1820
  email: string;
1835
1821
  roles: string[];
1836
1822
  filter?: boolean;
@@ -1840,65 +1826,67 @@ type UsersCreateResponse = DataResponse$1<{
1840
1826
  action: "safelist" | "blocklist";
1841
1827
  }[];
1842
1828
  }>;
1843
-
1829
+ //#endregion
1830
+ //#region src/modules/users.d.ts
1844
1831
  declare class Users {
1845
- protected mailchannels: MailChannelsClient;
1846
- constructor(mailchannels: MailChannelsClient);
1847
- /**
1848
- * Create a recipient user.
1849
- * @param email - The email address of the user to create.
1850
- * @param options - The options for the user to create.
1851
- * @example
1852
- * ```ts
1853
- * const mailchannels = new MailChannels('your-api-key')
1854
- * const { data, error } = await mailchannels.users.create("name@example.com", {
1855
- * admin: true
1856
- * })
1857
- * ```
1858
- */
1859
- create(email: string, options?: UsersCreateOptions): Promise<UsersCreateResponse>;
1860
- /**
1861
- * Add item to recipient user list
1862
- * @param email - The email address of the recipient whose list will be modified.
1863
- * @param options - The options for the list entry to add.
1864
- * @example
1865
- * ```ts
1866
- * const mailchannels = new MailChannels('your-api-key')
1867
- * const { data, error } = await mailchannels.users.addListEntry('name@example.com', {
1868
- * listName: 'safelist',
1869
- * item: 'name@domain.com'
1870
- * })
1871
- * ```
1872
- */
1873
- addListEntry(email: string, options: ListEntryOptions): Promise<ListEntryResponse>;
1874
- /**
1875
- * Get recipient list entries.
1876
- * @param email - The email address of the recipient whose list will be fetched.
1877
- * @param listName - The name of the list to fetch. This can be a `blocklist`, `safelist`, `blacklist`, or `whitelist`.
1878
- * @example
1879
- * ```ts
1880
- * const mailchannels = new MailChannels('your-api-key')
1881
- * const { data, error } = await mailchannels.users.listEntries('name@example.com', 'safelist')
1882
- * ```
1883
- */
1884
- listEntries(email: string, listName: ListNames): Promise<ListEntriesResponse>;
1885
- /**
1886
- * Delete item from recipient list.
1887
- * @param email - The email address of the recipient whose list will be modified.
1888
- * @param options - The options for the list entry to delete.
1889
- * @example
1890
- * ```ts
1891
- * const mailchannels = new MailChannels('your-api-key')
1892
- * const { success, error } = await mailchannels.users.deleteListEntry('name@example.com', {
1893
- * listName: 'safelist',
1894
- * item: 'name@domain.com'
1895
- * })
1896
- * ```
1897
- */
1898
- deleteListEntry(email: string, options: ListEntryOptions): Promise<SuccessResponse>;
1832
+ protected mailchannels: MailChannelsClient;
1833
+ constructor(mailchannels: MailChannelsClient);
1834
+ /**
1835
+ * Create a recipient user.
1836
+ * @param email - The email address of the user to create.
1837
+ * @param options - The options for the user to create.
1838
+ * @example
1839
+ * ```ts
1840
+ * const mailchannels = new MailChannels('your-api-key')
1841
+ * const { data, error } = await mailchannels.users.create("name@example.com", {
1842
+ * admin: true
1843
+ * })
1844
+ * ```
1845
+ */
1846
+ create(email: string, options?: UsersCreateOptions): Promise<UsersCreateResponse>;
1847
+ /**
1848
+ * Add item to recipient user list
1849
+ * @param email - The email address of the recipient whose list will be modified.
1850
+ * @param options - The options for the list entry to add.
1851
+ * @example
1852
+ * ```ts
1853
+ * const mailchannels = new MailChannels('your-api-key')
1854
+ * const { data, error } = await mailchannels.users.addListEntry('name@example.com', {
1855
+ * listName: 'safelist',
1856
+ * item: 'name@domain.com'
1857
+ * })
1858
+ * ```
1859
+ */
1860
+ addListEntry(email: string, options: ListEntryOptions): Promise<ListEntryResponse>;
1861
+ /**
1862
+ * Get recipient list entries.
1863
+ * @param email - The email address of the recipient whose list will be fetched.
1864
+ * @param listName - The name of the list to fetch. This can be a `blocklist`, `safelist`, `blacklist`, or `whitelist`.
1865
+ * @example
1866
+ * ```ts
1867
+ * const mailchannels = new MailChannels('your-api-key')
1868
+ * const { data, error } = await mailchannels.users.listEntries('name@example.com', 'safelist')
1869
+ * ```
1870
+ */
1871
+ listEntries(email: string, listName: ListNames): Promise<ListEntriesResponse>;
1872
+ /**
1873
+ * Delete item from recipient list.
1874
+ * @param email - The email address of the recipient whose list will be modified.
1875
+ * @param options - The options for the list entry to delete.
1876
+ * @example
1877
+ * ```ts
1878
+ * const mailchannels = new MailChannels('your-api-key')
1879
+ * const { success, error } = await mailchannels.users.deleteListEntry('name@example.com', {
1880
+ * listName: 'safelist',
1881
+ * item: 'name@domain.com'
1882
+ * })
1883
+ * ```
1884
+ */
1885
+ deleteListEntry(email: string, options: ListEntryOptions): Promise<SuccessResponse>;
1899
1886
  }
1900
-
1901
- type ServiceSubscriptionsResponse = DataResponse$1<{
1887
+ //#endregion
1888
+ //#region src/types/service/subscriptions.d.ts
1889
+ type ServiceSubscriptionsResponse = DataResponse<{
1902
1890
  active: boolean;
1903
1891
  activeAccountsCount: number;
1904
1892
  handle: string;
@@ -1911,7 +1899,8 @@ type ServiceSubscriptionsResponse = DataResponse$1<{
1911
1899
  name: string;
1912
1900
  };
1913
1901
  }[]>;
1914
-
1902
+ //#endregion
1903
+ //#region src/types/service/report.d.ts
1915
1904
  interface ServiceReportOptions {
1916
1905
  /**
1917
1906
  * The report type. It can be either `false_negative` or `false_positive`.
@@ -1936,54 +1925,55 @@ interface ServiceReportOptions {
1936
1925
  name: string;
1937
1926
  };
1938
1927
  }
1939
-
1928
+ //#endregion
1929
+ //#region src/modules/service.d.ts
1940
1930
  declare class Service {
1941
- protected mailchannels: MailChannelsClient;
1942
- constructor(mailchannels: MailChannelsClient);
1943
- /**
1944
- * Retrieve the condition of the service
1945
- * @example
1946
- * ```ts
1947
- * const mailchannels = new MailChannels('your-api-key')
1948
- * const { success, error } = await mailchannels.service.status()
1949
- * ```
1950
- */
1951
- status(): Promise<SuccessResponse>;
1952
- /**
1953
- * Get a list of your subscriptions to MailChannels Inbound
1954
- * @example
1955
- * ```ts
1956
- * const mailchannels = new MailChannels('your-api-key')
1957
- * const { data, error } = await mailchannels.service.subscriptions()
1958
- * ```
1959
- */
1960
- subscriptions(): Promise<ServiceSubscriptionsResponse>;
1961
- /**
1962
- * Submit a false negative or false positive report.
1963
- * @param options - The report options
1964
- * @example
1965
- * ```ts
1966
- * const mailchannels = new MailChannels('your-api-key')
1967
- * const { success, error } = await mailchannels.service.report({
1968
- * // ...
1969
- * })
1970
- * ```
1971
- */
1972
- report(options: ServiceReportOptions): Promise<SuccessResponse>;
1931
+ protected mailchannels: MailChannelsClient;
1932
+ constructor(mailchannels: MailChannelsClient);
1933
+ /**
1934
+ * Retrieve the condition of the service
1935
+ * @example
1936
+ * ```ts
1937
+ * const mailchannels = new MailChannels('your-api-key')
1938
+ * const { success, error } = await mailchannels.service.status()
1939
+ * ```
1940
+ */
1941
+ status(): Promise<SuccessResponse>;
1942
+ /**
1943
+ * Get a list of your subscriptions to MailChannels Inbound
1944
+ * @example
1945
+ * ```ts
1946
+ * const mailchannels = new MailChannels('your-api-key')
1947
+ * const { data, error } = await mailchannels.service.subscriptions()
1948
+ * ```
1949
+ */
1950
+ subscriptions(): Promise<ServiceSubscriptionsResponse>;
1951
+ /**
1952
+ * Submit a false negative or false positive report.
1953
+ * @param options - The report options
1954
+ * @example
1955
+ * ```ts
1956
+ * const mailchannels = new MailChannels('your-api-key')
1957
+ * const { success, error } = await mailchannels.service.report({
1958
+ * // ...
1959
+ * })
1960
+ * ```
1961
+ */
1962
+ report(options: ServiceReportOptions): Promise<SuccessResponse>;
1973
1963
  }
1974
-
1964
+ //#endregion
1965
+ //#region src/mailchannels.d.ts
1975
1966
  declare class MailChannels extends MailChannelsClient {
1976
- readonly emails: Emails;
1977
- readonly webhooks: Webhooks;
1978
- readonly subAccounts: SubAccounts;
1979
- readonly metrics: Metrics;
1980
- readonly suppressions: Suppressions;
1981
- readonly domains: Domains;
1982
- readonly lists: Lists;
1983
- readonly users: Users;
1984
- readonly service: Service;
1985
- constructor(key: string);
1967
+ readonly emails: Emails;
1968
+ readonly webhooks: Webhooks;
1969
+ readonly subAccounts: SubAccounts;
1970
+ readonly metrics: Metrics;
1971
+ readonly suppressions: Suppressions;
1972
+ readonly domains: Domains;
1973
+ readonly lists: Lists;
1974
+ readonly users: Users;
1975
+ readonly service: Service;
1976
+ constructor(key: string);
1986
1977
  }
1987
-
1988
- export { Domains, Emails, Lists, MailChannels, MailChannelsClient, Metrics, Service, SubAccounts, Suppressions, Users, Webhooks };
1989
- export type { DataResponse$1 as DataResponse, DomainsBulkCreateLoginLinkResult, DomainsBulkCreateLoginLinks, DomainsBulkCreateLoginLinksResponse, DomainsBulkProvisionOptions, DomainsBulkProvisionResponse, DomainsCreateLoginLink, DomainsCreateLoginLinkResponse, DomainsData, DomainsDownstreamAddress, DomainsListDownstreamAddressesOptions, DomainsListDownstreamAddressesResponse, DomainsListOptions, DomainsListResponse, DomainsProvisionOptions, DomainsProvisionResponse, EmailsCheckDomainDkim, EmailsCheckDomainOptions, EmailsCheckDomainResponse, EmailsCheckDomainVerdict, EmailsCreateDkimKeyOptions, EmailsCreateDkimKeyResponse, EmailsDkimKey, EmailsDkimKeyStatus, EmailsGetDkimKeysOptions, EmailsGetDkimKeysResponse, EmailsRotateDkimKeyOptions, EmailsRotateDkimKeyResponse, EmailsSendAsyncResponse, EmailsSendAttachment, EmailsSendOptions, EmailsSendOptionsBase, EmailsSendRecipient, EmailsSendResponse, EmailsSendTracking, EmailsUpdateDkimKeyOptions, ErrorResponse, ListEntriesResponse, ListEntry, ListEntryOptions, ListEntryResponse, ListNames, MetricsBucket, MetricsEngagement, MetricsEngagementResponse, MetricsOptions, MetricsPerformance, MetricsPerformanceResponse, MetricsRecipientBehaviour, MetricsRecipientBehaviourResponse, MetricsSenders, MetricsSendersOptions, MetricsSendersResponse, MetricsSendersType, MetricsUsageResponse, MetricsVolume, MetricsVolumeResponse, Optional, ServiceReportOptions, ServiceSubscriptionsResponse, SubAccountsAccount, SubAccountsApiKey, SubAccountsCreateApiKeyResponse, SubAccountsCreateResponse, SubAccountsCreateSmtpPasswordResponse, SubAccountsLimit, SubAccountsLimitResponse, SubAccountsListApiKeyOptions, SubAccountsListApiKeyResponse, SubAccountsListOptions, SubAccountsListResponse, SubAccountsListSmtpPasswordResponse, SubAccountsSmtpPassword, SubAccountsUsage, SubAccountsUsageResponse, SuccessResponse, SuppressionsCreateOptions, SuppressionsListEntry, SuppressionsListOptions, SuppressionsListResponse, SuppressionsSource, SuppressionsTypes, UsersCreateOptions, UsersCreateResponse, WebhooksListResponse, WebhooksSigningKeyResponse, WebhooksValidateResponse };
1978
+ //#endregion
1979
+ export { DataResponse, Domains, DomainsBulkCreateLoginLinks, DomainsBulkCreateLoginLinksResponse, DomainsBulkProvisionOptions, DomainsBulkProvisionResponse, DomainsCreateLoginLink, DomainsCreateLoginLinkResponse, DomainsData, DomainsDownstreamAddress, DomainsListDownstreamAddressesOptions, DomainsListDownstreamAddressesResponse, DomainsListOptions, DomainsListResponse, DomainsProvisionOptions, DomainsProvisionResponse, Emails, EmailsCheckDomainOptions, EmailsCheckDomainResponse, EmailsCheckDomainVerdict, EmailsCreateDkimKeyOptions, EmailsCreateDkimKeyResponse, EmailsDkimKey, EmailsDkimKeyStatus, EmailsGetDkimKeysOptions, EmailsGetDkimKeysResponse, EmailsRotateDkimKeyOptions, EmailsRotateDkimKeyResponse, EmailsSendAsyncResponse, EmailsSendAttachment, EmailsSendOptions, EmailsSendRecipient, EmailsSendResponse, EmailsSendTracking, EmailsUpdateDkimKeyOptions, ErrorResponse, ListEntriesResponse, ListEntry, ListEntryOptions, ListEntryResponse, ListNames, Lists, MailChannels, MailChannelsClient, Metrics, MetricsBucket, MetricsEngagement, MetricsEngagementResponse, MetricsOptions, MetricsPerformance, MetricsPerformanceResponse, MetricsRecipientBehaviour, MetricsRecipientBehaviourResponse, MetricsSenders, MetricsSendersOptions, MetricsSendersResponse, MetricsSendersType, MetricsUsageResponse, MetricsVolume, MetricsVolumeResponse, Service, ServiceReportOptions, ServiceSubscriptionsResponse, SubAccounts, SubAccountsAccount, SubAccountsApiKey, SubAccountsCreateApiKeyResponse, SubAccountsCreateResponse, SubAccountsCreateSmtpPasswordResponse, SubAccountsLimit, SubAccountsLimitResponse, SubAccountsListApiKeyOptions, SubAccountsListApiKeyResponse, SubAccountsListOptions, SubAccountsListResponse, SubAccountsListSmtpPasswordResponse, SubAccountsSmtpPassword, SubAccountsUsage, SubAccountsUsageResponse, SuccessResponse, Suppressions, SuppressionsCreateOptions, SuppressionsListEntry, SuppressionsListOptions, SuppressionsListResponse, SuppressionsSource, SuppressionsTypes, Users, UsersCreateOptions, UsersCreateResponse, Webhooks, WebhooksListResponse, WebhooksSigningKeyResponse, WebhooksValidateResponse };