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.
- package/README.md +1 -1
- package/dist/mailchannels.d.mts +872 -882
- package/dist/mailchannels.mjs +2037 -2309
- package/package.json +12 -16
- package/dist/mailchannels.d.ts +0 -1989
package/dist/mailchannels.d.mts
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { FetchOptions } from
|
|
1
|
+
import { FetchOptions } from "ofetch";
|
|
2
2
|
|
|
3
|
+
//#region src/client.d.ts
|
|
3
4
|
declare class MailChannelsClient {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
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
|
-
|
|
645
|
-
|
|
646
|
-
|
|
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
|
-
|
|
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
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
812
|
-
|
|
813
|
-
|
|
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
|
-
|
|
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
|
-
|
|
839
|
-
|
|
830
|
+
type SubAccountsUsageResponse = DataResponse<SubAccountsUsage>;
|
|
831
|
+
//#endregion
|
|
832
|
+
//#region src/modules/sub-accounts.d.ts
|
|
840
833
|
declare class SubAccounts {
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1114
|
-
|
|
1115
|
-
type MetricsUsageResponse = DataResponse
|
|
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
|
-
|
|
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
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
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
|
-
|
|
1355
|
-
|
|
1345
|
+
type SuppressionsListResponse = DataResponse<SuppressionsListEntry[]>;
|
|
1346
|
+
//#endregion
|
|
1347
|
+
//#region src/modules/suppressions.d.ts
|
|
1356
1348
|
declare class Suppressions {
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
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
|
|
1413
|
-
|
|
1414
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1610
|
-
|
|
1593
|
+
type DomainsBulkCreateLoginLinksResponse = DataResponse<DomainsBulkCreateLoginLinks>;
|
|
1594
|
+
//#endregion
|
|
1595
|
+
//#region src/modules/domains.d.ts
|
|
1611
1596
|
declare class Domains {
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
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
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
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
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
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
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
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 };
|