mailgun.js 5.1.0 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [5.2.0](https://github.com/mailgun/mailgun.js/compare/v5.1.0...v5.2.0) (2022-04-11)
6
+
7
+
8
+ ### Features
9
+
10
+ * Add validation methods to mailing list client ([224790c](https://github.com/mailgun/mailgun.js/commits/224790c4c20466a2203856d703b51e7d4a03a195))
11
+
5
12
  ## [5.1.0](https://github.com/mailgun/mailgun.js/compare/v5.0.5...v5.1.0) (2022-04-08)
6
13
 
7
14
 
@@ -14,6 +14,50 @@ export interface DestroyedList {
14
14
  address: string;
15
15
  message: string;
16
16
  }
17
+ export interface StartValidationResult {
18
+ status: number;
19
+ id: string;
20
+ message: string;
21
+ }
22
+ export interface ValidationResponse {
23
+ status: string;
24
+ download_url: {
25
+ csv: string;
26
+ json: string;
27
+ };
28
+ id: string;
29
+ quantity: number;
30
+ records_processed: number;
31
+ summary: {
32
+ result: {
33
+ catch_all: number;
34
+ deliverable: number;
35
+ do_not_send: number;
36
+ undeliverable: number;
37
+ unknown: number;
38
+ };
39
+ risk: {
40
+ high: number;
41
+ low: number;
42
+ medium: number;
43
+ unknown: number;
44
+ };
45
+ };
46
+ }
47
+ export interface ValidationApiResponse extends ValidationResponse {
48
+ created_at: number;
49
+ }
50
+ export interface ValidationResultData extends ValidationResponse {
51
+ created_at: Date;
52
+ }
53
+ export interface ValidationResult {
54
+ status: number;
55
+ validationResult: ValidationResultData;
56
+ }
57
+ export interface CancelValidationResult {
58
+ status: number;
59
+ message: string;
60
+ }
17
61
  export interface MailingList {
18
62
  access_level: string;
19
63
  address: string;
package/lists.d.ts CHANGED
@@ -1,14 +1,18 @@
1
1
  import Request from './request';
2
- import { ListsQuery, CreateUpdateList, DestroyedList, MailingList } from './interfaces/lists';
2
+ import { ListsQuery, CreateUpdateList, DestroyedList, MailingList, StartValidationResult, ValidationResult, CancelValidationResult } from './interfaces/lists';
3
3
  import { IMailListsMembers } from './interfaces/mailListMembers';
4
4
  export default class ListsClient {
5
5
  baseRoute: string;
6
6
  request: Request;
7
7
  members: IMailListsMembers;
8
8
  constructor(request: Request, members: IMailListsMembers);
9
+ private parseValidationResult;
9
10
  list(query?: ListsQuery): Promise<MailingList[]>;
10
11
  get(mailListAddress: string): Promise<MailingList>;
11
12
  create(data: CreateUpdateList): Promise<MailingList>;
12
13
  update(mailListAddress: string, data: CreateUpdateList): Promise<MailingList>;
13
14
  destroy(mailListAddress: string): Promise<DestroyedList>;
15
+ validate(mailListAddress: string): Promise<StartValidationResult>;
16
+ validationResult(mailListAddress: string): Promise<ValidationResult>;
17
+ cancelValidation(mailListAddress: string): Promise<CancelValidationResult>;
14
18
  }