mailgun.js 5.2.2 → 6.0.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,22 @@
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
+ ## [6.0.0](https://github.com/mailgun/mailgun.js/compare/v5.2.2...v6.0.0) (2022-05-06)
6
+
7
+
8
+ ### ⚠ BREAKING CHANGES
9
+
10
+ * Update ip-pools client responses body shapes. Refactor of request.ts file
11
+
12
+ ### Breaking changes
13
+
14
+ * Update ip-pools client responses body shapes. Refactor of request.ts file ([0595d62](https://github.com/mailgun/mailgun.js/commits/0595d62eeba66caa98b19b048425385db982d2f0))
15
+
16
+
17
+ ### Other changes
18
+
19
+ * Add tests ([8590989](https://github.com/mailgun/mailgun.js/commits/859098970b21b84a1085cb8cf967db769f28ed0f))
20
+
5
21
  ### [5.2.2](https://github.com/mailgun/mailgun.js/compare/v5.2.1...v5.2.2) (2022-04-22)
6
22
 
7
23
 
@@ -0,0 +1,14 @@
1
+ import * as NodeFormData from 'form-data';
2
+ import { InputFormData } from './interfaces/IFormData';
3
+ declare class FormDataBuilder {
4
+ private FormDataConstructor;
5
+ constructor(FormDataConstructor: InputFormData);
6
+ createFormData(data: any): NodeFormData | FormData;
7
+ private isNodeFormData;
8
+ private getAttachmentOptions;
9
+ private addMimeDataToFD;
10
+ private addFilesToFD;
11
+ private isStream;
12
+ private addCommonPropertyToFD;
13
+ }
14
+ export default FormDataBuilder;
@@ -1,11 +1,11 @@
1
- export interface DomainCredentialsQuery {
1
+ export declare type DomainCredentialsQuery = {
2
2
  limit: number;
3
3
  skip: number;
4
- }
5
- export interface DomainCredentials {
4
+ };
5
+ export declare type DomainCredentials = {
6
6
  login: string;
7
7
  password: string;
8
- }
8
+ };
9
9
  export interface DomainCredentialsItem {
10
10
  created_at: string;
11
11
  login: string;
@@ -41,9 +41,9 @@ export interface DeletedDomainCredentialsResponse {
41
41
  spec: string;
42
42
  };
43
43
  }
44
- export interface UpdateDomainCredentialsData {
44
+ export declare type UpdateDomainCredentialsData = {
45
45
  password: string;
46
- }
46
+ };
47
47
  export interface IDomainCredentials {
48
48
  list(domain: string, query: DomainCredentialsQuery): Promise<DomainCredentialsList>;
49
49
  create(domain: string, data: DomainCredentials): Promise<DomainCredentialsResult>;
@@ -4,16 +4,16 @@ export declare enum Resolution {
4
4
  DAY = "day",
5
5
  MONTH = "month"
6
6
  }
7
- export interface DomainTagsQuery {
7
+ export declare type DomainTagsQuery = {
8
8
  limit: number;
9
- }
10
- export interface DomainTagsStatisticQuery {
9
+ };
10
+ export declare type DomainTagsStatisticQuery = {
11
11
  event: string;
12
12
  start?: number;
13
13
  end?: number;
14
14
  resolution?: Resolution;
15
15
  duration?: string;
16
- }
16
+ };
17
17
  export interface DomainTagsItemInfo {
18
18
  tag: string;
19
19
  description: string;
@@ -9,37 +9,37 @@ export declare enum Pages {
9
9
  NEXT = "next",
10
10
  PREV = "prev"
11
11
  }
12
- export interface DomainTemplateData {
12
+ export declare type DomainTemplateData = {
13
13
  name: string;
14
14
  description: string;
15
15
  template: string;
16
16
  tag?: string;
17
17
  engine?: string;
18
18
  comment?: string;
19
- }
20
- export interface DomainTemplateVersionData {
19
+ };
20
+ export declare type DomainTemplateVersionData = {
21
21
  template: string;
22
22
  tag: string;
23
23
  engine?: string;
24
24
  comment?: string;
25
25
  active?: YesNo;
26
- }
27
- export interface DomainTemplateUpdateData {
26
+ };
27
+ export declare type DomainTemplateUpdateData = {
28
28
  description: string;
29
- }
30
- export interface DomainTemplateUpdateVersionData {
29
+ };
30
+ export declare type DomainTemplateUpdateVersionData = {
31
31
  template?: string;
32
32
  comment?: string;
33
33
  active?: YesNo;
34
- }
35
- export interface DomainTemplatesQuery {
34
+ };
35
+ export declare type DomainTemplatesQuery = {
36
36
  page: Pages;
37
37
  limit: number;
38
38
  p: string;
39
- }
40
- export interface TemplateQuery {
39
+ };
40
+ export declare type TemplateQuery = {
41
41
  active: YesNo;
42
- }
42
+ };
43
43
  export interface ShortTemplateVersion {
44
44
  tag: string;
45
45
  engine: string;
@@ -35,14 +35,14 @@ export interface UpdateDomainTrackingResponse {
35
35
  status: number;
36
36
  body: UpdatedOpenTracking;
37
37
  }
38
- export interface OpenTrackingInfo {
38
+ export declare type OpenTrackingInfo = {
39
39
  active: 'yes' | 'no' | 'true' | 'false';
40
- }
41
- export interface ClickTrackingInfo {
40
+ };
41
+ export declare type ClickTrackingInfo = {
42
42
  active: 'yes' | 'no' | 'true' | 'false' | 'htmlonly';
43
- }
44
- export interface UnsubscribeTrackingInfo {
43
+ };
44
+ export declare type UnsubscribeTrackingInfo = {
45
45
  active: 'yes' | 'no' | 'true' | 'false';
46
46
  html_footer: string;
47
47
  text_footer: string;
48
- }
48
+ };
@@ -1,9 +1,9 @@
1
- export interface DomainsQuery {
1
+ export declare type DomainsQuery = {
2
2
  authority?: string;
3
3
  state?: 'active' | 'unverified' | 'disabled';
4
4
  limit?: number;
5
5
  skip?: number;
6
- }
6
+ };
7
7
  export interface DomainInfo {
8
8
  name: string;
9
9
  smtp_password: string;
@@ -44,7 +44,7 @@ export interface DNSRecord {
44
44
  valid: string;
45
45
  value: string;
46
46
  }
47
- export interface DomainResponseData {
47
+ export declare type DomainResponseData = {
48
48
  status: number;
49
49
  body: {
50
50
  domain: DomainData;
@@ -52,7 +52,7 @@ export interface DomainResponseData {
52
52
  receiving_dns_records: DNSRecord[];
53
53
  sending_dns_records: DNSRecord[];
54
54
  };
55
- }
55
+ };
56
56
  export interface DomainListResponseData {
57
57
  status: number;
58
58
  body: {
@@ -67,10 +67,10 @@ export interface DestroyedDomainResponse {
67
67
  status: number;
68
68
  body: MessageResponse;
69
69
  }
70
- export interface ConnectionSettings {
70
+ export declare type ConnectionSettings = {
71
71
  require_tls: boolean;
72
72
  skip_verification: boolean;
73
- }
73
+ };
74
74
  export interface ConnectionSettingsResponse {
75
75
  body: {
76
76
  connection: ConnectionSettings;
@@ -10,10 +10,46 @@ export interface IpPoolListResponse {
10
10
  ip_pools: IpPool;
11
11
  message: string;
12
12
  };
13
+ status: number;
13
14
  }
14
- export interface IpPoolUpdateData {
15
+ export interface IpPoolListResult {
16
+ ip_pools: IpPool;
17
+ message: string;
18
+ status: number;
19
+ }
20
+ export declare type IpPoolUpdateData = {
15
21
  name: string;
16
22
  description: string;
17
- add_ip: string;
18
- remove_ip: string;
19
- }
23
+ ips: string[];
24
+ };
25
+ export declare type IpPoolMessageResponse = {
26
+ body: {
27
+ message: string;
28
+ };
29
+ status: number;
30
+ };
31
+ export declare type IpPoolMessageResult = {
32
+ message: string;
33
+ status: number;
34
+ };
35
+ export declare type IpPoolDeleteData = {
36
+ ip?: string;
37
+ pool_id?: string;
38
+ };
39
+ export declare type IpPoolCreateData = {
40
+ name: string;
41
+ description?: string;
42
+ ips?: string[];
43
+ };
44
+ export declare type IpPoolCreateResponse = {
45
+ body: {
46
+ message: string;
47
+ pool_id: string;
48
+ };
49
+ status: number;
50
+ };
51
+ export declare type IpPoolCreateResult = {
52
+ status: number;
53
+ message: string;
54
+ pool_id: string;
55
+ };
@@ -1,6 +1,13 @@
1
1
  import Options from './Options';
2
- interface RequestOptions extends Options {
2
+ export interface OnCallEmptyHeaders {
3
+ [key: string]: undefined;
4
+ }
5
+ export interface RequestOptions extends Options {
3
6
  headers: any;
4
7
  timeout: number;
5
8
  }
6
- export default RequestOptions;
9
+ export interface OnCallRequestOptions {
10
+ timeout?: number;
11
+ headers?: HeadersInit | OnCallEmptyHeaders;
12
+ [key: string]: unknown | undefined;
13
+ }
@@ -51,9 +51,9 @@ export declare enum SuppressionModels {
51
51
  export interface PagesListAccumulator {
52
52
  [index: string]: ParsedPage;
53
53
  }
54
- export interface SuppressionListQuery {
54
+ export declare type SuppressionListQuery = {
55
55
  limit?: number;
56
- }
56
+ };
57
57
  export interface SuppressionListResponse {
58
58
  body: {
59
59
  items: BounceData[] | ComplaintData[] | UnsubscribeData[] | WhiteListData[];
@@ -79,14 +79,14 @@ export interface SuppressionDestroyResult {
79
79
  address: string;
80
80
  status: number;
81
81
  }
82
- export interface SuppressionCreationData {
82
+ export declare type SuppressionCreationData = {
83
83
  address: string;
84
84
  code?: number;
85
85
  error?: string;
86
86
  domain?: string;
87
87
  tag?: string;
88
88
  created_at?: string;
89
- }
89
+ };
90
90
  export interface SuppressionCreationResponse {
91
91
  body: {
92
92
  message: string;
@@ -1,3 +1,6 @@
1
+ export declare type ValidationQuery = {
2
+ address: string;
3
+ };
1
4
  export interface ValidationResult {
2
5
  address: string;
3
6
  is_disposable_address: boolean;
@@ -15,10 +15,10 @@ export interface WebhookList {
15
15
  urls: string[];
16
16
  };
17
17
  }
18
- export interface WebhooksQuery {
18
+ export declare type WebhooksQuery = {
19
19
  limit?: number;
20
20
  skip?: number;
21
- }
21
+ };
22
22
  export interface ValidationResponse {
23
23
  code: number;
24
24
  message: string;
@@ -1,15 +1,15 @@
1
- export interface ListsQuery {
1
+ export declare type ListsQuery = {
2
2
  address?: string;
3
3
  limit?: number;
4
4
  skip?: number;
5
- }
6
- export interface CreateUpdateList {
5
+ };
6
+ export declare type CreateUpdateList = {
7
7
  address: string;
8
8
  name?: string;
9
9
  description?: string;
10
10
  access_level?: 'readonly' | 'members' | 'everyone';
11
11
  reply_preference?: 'list' | 'sender';
12
- }
12
+ };
13
13
  export interface DestroyedList {
14
14
  address: string;
15
15
  message: string;
@@ -5,18 +5,18 @@ export interface MailListMember {
5
5
  subscribed: boolean;
6
6
  vars: string | any;
7
7
  }
8
- export interface MailListMembersQuery {
8
+ export declare type MailListMembersQuery = {
9
9
  subscribed?: 'yes' | 'no';
10
10
  limit?: number;
11
- }
12
- export interface MultipleMembersData {
11
+ };
12
+ export declare type MultipleMembersData = {
13
13
  members: Array<MailListMember>;
14
14
  upsert: 'yes' | 'no';
15
- }
16
- export interface MultipleMembersReqData {
15
+ };
16
+ export declare type MultipleMembersReqData = {
17
17
  members: string;
18
18
  upsert: 'yes' | 'no';
19
- }
19
+ };
20
20
  export interface CreateUpdateMailListMembers {
21
21
  address: string;
22
22
  name?: string;
@@ -24,13 +24,13 @@ export interface CreateUpdateMailListMembers {
24
24
  subscribed?: 'yes' | 'no' | boolean;
25
25
  upsert?: 'yes' | 'no';
26
26
  }
27
- export interface CreateUpdateMailListMembersReq {
27
+ export declare type CreateUpdateMailListMembersReq = {
28
28
  address: string;
29
29
  name?: string;
30
30
  vars?: string;
31
31
  subscribed?: 'yes' | 'no' | boolean;
32
32
  upsert?: 'yes' | 'no';
33
- }
33
+ };
34
34
  export interface DeletedMember {
35
35
  member: {
36
36
  address: string;
@@ -13,13 +13,13 @@ export interface DestroyRouteResponse {
13
13
  id: string;
14
14
  message: string;
15
15
  }
16
- export interface CreateUpdateRouteData {
16
+ export declare type CreateUpdateRouteData = {
17
17
  priority?: number;
18
18
  description?: string;
19
19
  expression: string;
20
20
  action: string[];
21
- }
22
- export interface RoutesListQuery {
21
+ };
22
+ export declare type RoutesListQuery = {
23
23
  limit?: number;
24
24
  skip?: number;
25
- }
25
+ };
package/ip-pools.d.ts CHANGED
@@ -1,21 +1,11 @@
1
1
  import Request from './request';
2
- import { IpPool, IpPoolUpdateData } from './interfaces/IpPools';
2
+ import { IpPoolCreateData, IpPoolCreateResult, IpPoolDeleteData, IpPoolListResult, IpPoolMessageResult, IpPoolUpdateData } from './interfaces/IpPools';
3
3
  export default class IpPoolsClient {
4
4
  request: Request;
5
5
  constructor(request: Request);
6
- list(query: any): Promise<IpPool[]>;
7
- create(data: {
8
- name: string;
9
- description?: string;
10
- ips?: string[];
11
- }): Promise<{
12
- message: string;
13
- pool_id: string;
14
- }>;
15
- update(poolId: string, data: IpPoolUpdateData): Promise<any>;
16
- delete(poolId: string, data: {
17
- id: string;
18
- pool_id: string;
19
- }): Promise<any>;
6
+ list(): Promise<IpPoolListResult>;
7
+ create(data: IpPoolCreateData): Promise<IpPoolCreateResult>;
8
+ update(poolId: string, data: IpPoolUpdateData): Promise<IpPoolMessageResult>;
9
+ delete(poolId: string, data: IpPoolDeleteData): Promise<IpPoolMessageResult>;
20
10
  private parseIpPoolsResponse;
21
11
  }
package/ips.d.ts CHANGED
@@ -3,7 +3,7 @@ import { IpData, IpsListResponseBody } from './interfaces/Ips';
3
3
  export default class IpsClient {
4
4
  request: MgRequest;
5
5
  constructor(request: MgRequest);
6
- list(query: any): Promise<IpsListResponseBody | IpData>;
7
- get(ip: string): Promise<IpsListResponseBody | IpData>;
6
+ list(query: any): Promise<IpsListResponseBody>;
7
+ get(ip: string): Promise<IpData>;
8
8
  private parseIpsResponse;
9
9
  }