mailgun.js 3.7.1 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +335 -1
  3. package/dist/lib/client.d.ts +0 -4
  4. package/dist/lib/domains.d.ts +19 -13
  5. package/dist/lib/domainsCredentials.d.ts +14 -0
  6. package/dist/lib/events.d.ts +3 -3
  7. package/dist/lib/interfaces/DomainCredentials.d.ts +52 -0
  8. package/dist/lib/interfaces/DomainTracking.d.ts +4 -4
  9. package/dist/lib/interfaces/Domains.d.ts +53 -3
  10. package/dist/lib/interfaces/Events.d.ts +66 -2
  11. package/dist/lib/interfaces/MultipleValidation.d.ts +55 -0
  12. package/dist/lib/interfaces/Validate.d.ts +12 -0
  13. package/dist/lib/interfaces/Webhooks.d.ts +5 -1
  14. package/dist/lib/interfaces/lists.d.ts +1 -1
  15. package/dist/lib/multipleValidation.d.ts +10 -0
  16. package/dist/lib/parse.d.ts +0 -6
  17. package/dist/lib/request.d.ts +4 -1
  18. package/dist/lib/validate.d.ts +5 -2
  19. package/dist/lib/webhooks.d.ts +3 -3
  20. package/dist/mailgun.node.js +2 -2
  21. package/dist/mailgun.node.js.LICENSE.txt +1 -1
  22. package/dist/mailgun.web.js +2 -2
  23. package/dist/mailgun.web.js.LICENSE.txt +1 -1
  24. package/lib/client.ts +6 -12
  25. package/lib/domains.ts +82 -26
  26. package/lib/domainsCredentials.ts +88 -0
  27. package/lib/events.ts +6 -6
  28. package/lib/interfaces/DomainCredentials.ts +68 -0
  29. package/lib/interfaces/DomainTracking.ts +4 -4
  30. package/lib/interfaces/Domains.ts +65 -4
  31. package/lib/interfaces/Events.ts +66 -2
  32. package/lib/interfaces/MultipleValidation.ts +62 -0
  33. package/lib/interfaces/Validate.ts +15 -0
  34. package/lib/interfaces/Webhooks.ts +6 -1
  35. package/lib/interfaces/lists.ts +1 -1
  36. package/lib/multipleValidation.ts +37 -0
  37. package/lib/request.ts +75 -34
  38. package/lib/validate.ts +10 -4
  39. package/lib/webhooks.ts +19 -10
  40. package/package.json +6 -6
  41. package/test/client.test.ts +21 -5
  42. package/test/data/emailsValidation1.csv +3 -0
  43. package/test/domains.test.ts +118 -15
  44. package/test/domainsCredentials.test.ts +97 -0
  45. package/test/events.test.ts +15 -24
  46. package/test/multipleValidation.test.ts +159 -0
  47. package/test/validate.test.ts +7 -4
  48. package/test/webhooks.test.ts +6 -6
  49. package/webpack/webpack.dev.config.js +10 -0
  50. package/lib/parse.ts +0 -27
  51. package/test/parse.test.ts +0 -75
package/CHANGELOG.md CHANGED
@@ -2,6 +2,37 @@
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
+ ### [4.0.1](https://github.com/mailgun/mailgun.js/compare/v4.0.0...v4.0.1) (2021-11-25)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * Fixes handling of mime messages ([#213](https://github.com/mailgun/mailgun.js/issues/213)) ([ad43490](https://github.com/mailgun/mailgun.js/commits/ad43490a562b95cb77e38cb66f71ef13a4da8331))
11
+
12
+ ## [4.0.0](https://github.com/mailgun/mailgun.js/compare/v3.7.3...v4.0.0) (2021-11-18)
13
+
14
+
15
+ ### ⚠ BREAKING CHANGES
16
+
17
+ * updated signature of unlinkIpPoll method
18
+
19
+ * feature: Update events client to use v3 of API
20
+
21
+ * feature: Update webhooks to use v3 of API
22
+
23
+ * breaking: Update validation to use v4 of API
24
+ * removed parse client functionality.
25
+ Changed mg.validate.get response
26
+ Added multiple email addresses validation
27
+
28
+ * other: Update domain credentials responses to add status code
29
+
30
+ * Update endpoints for service methods (#209) ([59f812d](https://github.com/mailgun/mailgun.js/commits/59f812dcf771a5d7ed812424bb5dfaef0f52ff62)), closes [#209](https://github.com/mailgun/mailgun.js/issues/209)
31
+
32
+ ### [3.7.3](https://github.com/mailgun/mailgun.js/compare/v3.7.2...v3.7.3) (2021-11-10)
33
+
34
+ ### [3.7.2](https://github.com/mailgun/mailgun-js/compare/v3.7.1...v3.7.2) (2021-10-28)
35
+
5
36
  ### [3.7.1](https://github.com/mailgun/mailgun-js/compare/v3.7.0...v3.7.1) (2021-10-28)
6
37
 
7
38
 
package/README.md CHANGED
@@ -104,6 +104,19 @@ The following service methods are available to instantiated clients. The example
104
104
  - [get](#get-5)
105
105
  - [parse](#parse)
106
106
  - [get](#get-6)
107
+ - [lists](#lists)
108
+ - [list](#list-4)
109
+ - [get](#get-7)
110
+ - [create](#create-5)
111
+ - [update](#update-2)
112
+ - [destroy](#destroy-3)
113
+ - [mailListMembers](#maillistmembers)
114
+ - [listMembers](#listmember)
115
+ - [getMember](#getmember)
116
+ - [createMember](#createmember)
117
+ - [createMembers](#createmembers)
118
+ - [updateMember](#updatemember)
119
+ - [destroyMember](#destroymember)
107
120
  - [Browser Demo](#browser-demo)
108
121
  - [Development](#development)
109
122
  - [Requirements](#requirements)
@@ -1363,6 +1376,327 @@ Promise Returns: response body
1363
1376
  }
1364
1377
  ```
1365
1378
 
1379
+ ### lists
1380
+
1381
+ A client to manage mailing lists.
1382
+
1383
+ #### list
1384
+
1385
+ `mg.lists.list()`
1386
+
1387
+ Example:
1388
+
1389
+ ```js
1390
+ mg.lists.list()
1391
+ .then(data => console.log(data)) // logs response body
1392
+ .catch(err => console.log(err)); // logs any error
1393
+ ```
1394
+
1395
+ Promise Returns: response body
1396
+
1397
+ ```
1398
+ [
1399
+ {
1400
+ access_level: 'readonly',
1401
+ address: 'noreply@sample.com',
1402
+ created_at: 'Wed, 27 Oct 2021 21:59:21 -0000',
1403
+ description: '',
1404
+ members_count: 0,
1405
+ name: '',
1406
+ reply_preference: 'list'
1407
+ }
1408
+ ]
1409
+ ```
1410
+
1411
+ #### get
1412
+
1413
+ `mg.lists.get(mailListAddress)`
1414
+
1415
+ Example:
1416
+
1417
+ ```js
1418
+ mg.lists.get('noreply@sample.com')
1419
+ .then(data => console.log(data)) // logs response body
1420
+ .catch(err => console.log(err)); // logs any error
1421
+ ```
1422
+
1423
+ Promise Returns: response body
1424
+
1425
+ ```
1426
+ {
1427
+ access_level: 'readonly',
1428
+ address: 'noreply@sample.com',
1429
+ created_at: 'Thu, 28 Oct 2021 00:16:56 -0000',
1430
+ description: '',
1431
+ members_count: 0,
1432
+ name: '',
1433
+ reply_preference: 'list'
1434
+ }
1435
+ ```
1436
+
1437
+ #### create
1438
+
1439
+ `mg.lists.create(data)`
1440
+
1441
+ Example:
1442
+
1443
+ ```js
1444
+ mg.lists.create({
1445
+ address: 'reply@sample.com',
1446
+ name: 'Reply Address', // optional, modifiable on website
1447
+ description: 'Mailing lists for repliable address', // optional, modifiable on website
1448
+ access_level: 'readonly', // optional, modifiable on website
1449
+ reply_preference: 'list', // optional, modifiable on website
1450
+ })
1451
+ .then(data => console.log(data)) // logs response body
1452
+ .catch(err => console.log(err)); // logs any error
1453
+ ```
1454
+
1455
+ Promise Returns: response body
1456
+
1457
+ ```
1458
+ {
1459
+ access_level: 'readonly',
1460
+ address: 'reply@sample.com',
1461
+ created_at: 'Thu, 28 Oct 2021 03:12:17 -0000',
1462
+ description: 'Mailing lists for repliable address',
1463
+ members_count: 0,
1464
+ name: 'Reply Address',
1465
+ reply_preference: 'list'
1466
+ }
1467
+ ```
1468
+
1469
+ #### update
1470
+
1471
+ `mg.lists.update(mailListAddress)`
1472
+
1473
+ Example:
1474
+
1475
+ ```js
1476
+ mg.lists.update('reply@sample.com', {
1477
+ address: 'foo@sample.com',
1478
+ name: 'Foo', // optional, modifiable on website
1479
+ description: 'Foo bar bat', // optional, modifiable on website
1480
+ access_level: 'members', // optional, modifiable on website
1481
+ reply_preference: 'sender', // optional, modifiable on website
1482
+ })
1483
+ .then(data => console.log(data)) // logs response body
1484
+ .catch(err => console.log(err)); // logs any error
1485
+ ```
1486
+
1487
+ Promise Returns: response body
1488
+
1489
+ ```
1490
+ {
1491
+ access_level: 'members',
1492
+ address: 'foo@sample.com',
1493
+ created_at: 'Thu, 28 Oct 2021 03:21:15 -0000',
1494
+ description: 'Foo bar bat',
1495
+ members_count: 0,
1496
+ name: 'Foo',
1497
+ reply_preference: 'sender'
1498
+ }
1499
+ ```
1500
+
1501
+ #### destroy
1502
+
1503
+ `mg.lists.destroy(mailListAddress)`
1504
+
1505
+ Example:
1506
+
1507
+ ```js
1508
+ mg.lists.destroy('foo@sample.com')
1509
+ .then(data => console.log(data)) // logs response body
1510
+ .catch(err => console.log(err)); // logs any error
1511
+ ```
1512
+
1513
+ Promise Returns: response body
1514
+
1515
+ ```
1516
+ {
1517
+ address: 'foo@sample.com',
1518
+ message: 'Mailing list has been removed'
1519
+ }
1520
+ ```
1521
+
1522
+ ### mailListMembers
1523
+
1524
+ A client to manage members within a specific mailing list.
1525
+
1526
+ #### listMembers
1527
+
1528
+ `mg.lists.members.listMembers(mailListAddress)`
1529
+
1530
+ Example:
1531
+
1532
+ ```js
1533
+ mg.lists.members.listMembers('reply@sample.com')
1534
+ .then(data => console.log(data)) // logs response body
1535
+ .catch(err => console.log(err)); // logs any error
1536
+ ```
1537
+
1538
+ Promise Returns: response body
1539
+
1540
+ ```
1541
+ [
1542
+ {
1543
+ address: 'foo@bar.com',
1544
+ name: 'Jane Doe',
1545
+ subscribed: true,
1546
+ vars: { age: 50 }
1547
+ }
1548
+ ]
1549
+ ```
1550
+
1551
+ #### getMember
1552
+
1553
+ `mg.lists.members.getMember(mailListAddress, mailListMemberAddress)`
1554
+
1555
+ Example:
1556
+
1557
+ ```js
1558
+ mg.lists.members.getMember('reply@sample.com', 'foo@bar.com')
1559
+ .then(data => console.log(data)) // logs response body
1560
+ .catch(err => console.log(err)); // logs any error
1561
+ ```
1562
+
1563
+ Promise Returns: response body
1564
+
1565
+ ```
1566
+ {
1567
+ address: 'foo@bar.com',
1568
+ name: 'Jane Doe',
1569
+ subscribed: true,
1570
+ vars: { age: 50 }
1571
+ }
1572
+ ```
1573
+
1574
+ #### createMember
1575
+
1576
+ `mg.lists.members.createMember(mailListAddress, data)`
1577
+
1578
+ Example:
1579
+
1580
+ ```js
1581
+ mg.lists.members.createMember('reply@sample.com', {
1582
+ address: 'bat@bar.com',
1583
+ name: 'John Smith', // optional, modifiable on website
1584
+ vars: {hobby: "chess"}, // optional, modifiable on website
1585
+ subscribed: 'no', // optional, modifiable on website
1586
+ upsert: 'yes', // optional, choose yes to insert if not exist, or update it exist
1587
+ })
1588
+ .then(data => console.log(data)) // logs response body
1589
+ .catch(err => console.log(err)); // logs any error
1590
+ ```
1591
+
1592
+ Promise Returns: response body
1593
+
1594
+ ```
1595
+ {
1596
+ address: 'bat@bar.com',
1597
+ name: 'John Smith',
1598
+ subscribed: false,
1599
+ vars: { hobby: 'chess' }
1600
+ }
1601
+ ```
1602
+
1603
+ #### createMembers
1604
+
1605
+ `mg.lists.members.createMembers(mailListAddress, data)`
1606
+
1607
+ Example:
1608
+
1609
+ ```js
1610
+ mg.lists.members.createMembers('reply@sample.com', {
1611
+ members: [
1612
+ {
1613
+ address: "bot1@foobar.com",
1614
+ name: "Bot1 Superbot",
1615
+ vars: {location: "loc1"},
1616
+ subscribed: true,
1617
+ },
1618
+ {
1619
+ address: "bot2@foobar.com",
1620
+ name: "Bot2 Superbot",
1621
+ vars: {location: "loc2"},
1622
+ subscribed: false,
1623
+ },
1624
+ ],
1625
+ upsert: "yes",
1626
+ })
1627
+ .then(data => console.log(data)) // logs response body
1628
+ .catch(err => console.log(err)); // logs any error
1629
+ ```
1630
+
1631
+ Promise Returns: response body
1632
+
1633
+ ```
1634
+ {
1635
+ list: {
1636
+ access_level: 'readonly',
1637
+ address: 'reply@sample.com',
1638
+ created_at: 'Thu, 28 Oct 2021 03:21:15 -0000',
1639
+ description: 'For reply purpose',
1640
+ members_count: 2,
1641
+ name: 'Reply',
1642
+ reply_preference: 'list'
1643
+ },
1644
+ message: 'Mailing list has been updated',
1645
+ 'task-id': '575b943c37a211ec8a520242ac11000a'
1646
+ }
1647
+ ```
1648
+
1649
+ #### updateMember
1650
+
1651
+ `mg.lists.members.updateMember(mailListAddress, mailListMemberAddress, data)`
1652
+
1653
+ Example:
1654
+
1655
+ ```js
1656
+ mg.lists.members.updateMember('reply@sample.com', 'bot1@foobar.com', {
1657
+ address: 'bot0@barfoo.com',
1658
+ name: 'Bot0 Normalbot', // optional, modifiable on website
1659
+ vars: {location: "space"},
1660
+ subscribed: false,
1661
+ })
1662
+ .then(data => console.log(data)) // logs response body
1663
+ .catch(err => console.log(err)); // logs any error
1664
+ ```
1665
+
1666
+ Promise Returns: response body
1667
+
1668
+ ```
1669
+ {
1670
+ address: 'bot0@barfoo.com',
1671
+ name: 'Bot0 Normalbot',
1672
+ subscribed: false,
1673
+ vars: { location: 'space' }
1674
+ }
1675
+ ```
1676
+
1677
+ #### destroyMember
1678
+
1679
+ `mg.lists.members.destroyMember(mailListAddress, mailListMemberAddress)`
1680
+
1681
+ Example:
1682
+
1683
+ ```js
1684
+ mg.lists.members.destroyMember('reply@sample.com', 'bot2@foobar.com')
1685
+ .then(data => console.log(data)) // logs response body
1686
+ .catch(err => console.log(err)); // logs any error
1687
+ ```
1688
+
1689
+ Promise Returns: response body
1690
+
1691
+ ```
1692
+ {
1693
+ member: { address: 'bot2@foobar.com' },
1694
+ message: 'Mailing list member has been deleted'
1695
+ }
1696
+ ```
1697
+
1698
+
1699
+
1366
1700
  ## Browser Demo
1367
1701
 
1368
1702
  ![image](https://cloud.githubusercontent.com/assets/399776/10718632/e8fe56e4-7b34-11e5-84c8-cfcfde978711.png)
@@ -1424,7 +1758,7 @@ git pull
1424
1758
 
1425
1759
  Next, run ```npm run release```.
1426
1760
 
1427
- After that, ```run npm login``` and ```npm publish``` to publish changes on npm.
1761
+ After that, run ```npm login``` and ```npm publish``` to publish changes on npm.
1428
1762
 
1429
1763
  ## TODO
1430
1764
  - add browser demo to heroku
@@ -1,4 +1,3 @@
1
- import Request from './request';
2
1
  import Options from './interfaces/Options';
3
2
  import DomainClient from './domains';
4
3
  import EventClient from './events';
@@ -8,7 +7,6 @@ import WebhookClient from './webhooks';
8
7
  import MessagesClient from './messages';
9
8
  import RoutesClient from './routes';
10
9
  import ValidateClient from './validate';
11
- import ParseClient from './parse';
12
10
  import IpsClient from './ips';
13
11
  import IpPoolsClient from './ip-pools';
14
12
  import ListsClient from './lists';
@@ -22,9 +20,7 @@ export default class Client {
22
20
  suppressions: SuppressionClient;
23
21
  messages: MessagesClient;
24
22
  routes: RoutesClient;
25
- public_request: Request;
26
23
  validate: ValidateClient;
27
- parse: ParseClient;
28
24
  ips: IpsClient;
29
25
  ip_pools: IpPoolsClient;
30
26
  lists: ListsClient;
@@ -1,8 +1,9 @@
1
- import { DomainResponseData, DestroyedDomain, DestroyedDomainResponse, DomainsQuery, DomainInfo, DomainListResponseData, DomainShortData, DNSRecord } from './interfaces/Domains';
1
+ import { DomainsQuery, DomainInfo, DomainShortData, DNSRecord, ConnectionSettings, UpdatedConnectionSettings, DKIMAuthorityInfo, UpdatedDKIMAuthority, DKIMSelectorInfo, UpdatedDKIMSelectorResponse, WebPrefixInfo, UpdatedWebPrefixResponse, ReplacementForPool, MessageResponse } from './interfaces/Domains';
2
2
  import APIResponse from './interfaces/ApiResponse';
3
3
  import Request from './request';
4
- import { DomainTrackingResponse, DomainTrackingData, OpenTrackingInfo, ClickTrackingInfo, UnsubscribeTrackingInfo, UpdateDomainTrackingResponse, UpdatedOpenTracking } from './interfaces/DomainTracking';
5
- declare class Domain {
4
+ import { DomainTrackingData, OpenTrackingInfo, ClickTrackingInfo, UnsubscribeTrackingInfo, UpdatedOpenTracking } from './interfaces/DomainTracking';
5
+ import DomainCredentialsClient from './domainsCredentials';
6
+ export declare class Domain {
6
7
  name: string;
7
8
  require_tls: boolean;
8
9
  skip_verification: boolean;
@@ -19,22 +20,27 @@ declare class Domain {
19
20
  }
20
21
  export default class DomainClient {
21
22
  request: Request;
22
- constructor(request: Request);
23
- _parseMessage(response: DestroyedDomainResponse): DestroyedDomain;
24
- _parseDomainList(response: DomainListResponseData): Domain[];
25
- _parseDomain(response: DomainResponseData): Domain;
26
- _parseTrackingSettings(response: DomainTrackingResponse): DomainTrackingData;
27
- _parseTrackingUpdate(response: UpdateDomainTrackingResponse): UpdatedOpenTracking;
28
- list(query: DomainsQuery): Promise<Domain[]>;
23
+ domainCredentials: DomainCredentialsClient;
24
+ constructor(request: Request, domainCredentialsClient: DomainCredentialsClient);
25
+ private _parseMessage;
26
+ private _parseDomainList;
27
+ private _parseDomain;
28
+ private _parseTrackingSettings;
29
+ private _parseTrackingUpdate;
30
+ list(query?: DomainsQuery): Promise<Domain[]>;
29
31
  get(domain: string): Promise<Domain>;
30
32
  create(data: DomainInfo): Promise<Domain>;
31
- destroy(domain: string): Promise<DestroyedDomain>;
33
+ destroy(domain: string): Promise<MessageResponse>;
34
+ getConnection(domain: string): Promise<ConnectionSettings>;
35
+ updateConnection(domain: string, data: ConnectionSettings): Promise<UpdatedConnectionSettings>;
32
36
  getTracking(domain: string): Promise<DomainTrackingData>;
33
37
  updateTracking(domain: string, type: string, data: OpenTrackingInfo | ClickTrackingInfo | UnsubscribeTrackingInfo): Promise<UpdatedOpenTracking>;
34
38
  getIps(domain: string): Promise<string[]>;
35
39
  assignIp(domain: string, ip: string): Promise<APIResponse>;
36
40
  deleteIp(domain: string, ip: string): Promise<APIResponse>;
37
41
  linkIpPool(domain: string, pool_id: string): Promise<APIResponse>;
38
- unlinkIpPoll(domain: string, pool_id: string, ip: string): Promise<APIResponse>;
42
+ unlinkIpPoll(domain: string, replacement: ReplacementForPool): Promise<APIResponse>;
43
+ updateDKIMAuthority(domain: string, data: DKIMAuthorityInfo): Promise<UpdatedDKIMAuthority>;
44
+ updateDKIMSelector(domain: string, data: DKIMSelectorInfo): Promise<UpdatedDKIMSelectorResponse>;
45
+ updateWebPrefix(domain: string, data: WebPrefixInfo): Promise<UpdatedWebPrefixResponse>;
39
46
  }
40
- export {};
@@ -0,0 +1,14 @@
1
+ import Request from './request';
2
+ import { DomainCredentials, DomainCredentialsList, DomainCredentialsQuery, DomainCredentialsResult, IDomainCredentials, UpdateDomainCredentialsData } from './interfaces/DomainCredentials';
3
+ export default class DomainCredentialsClient implements IDomainCredentials {
4
+ baseRoute: string;
5
+ request: Request;
6
+ constructor(request: Request);
7
+ private _parseDomainCredentialsList;
8
+ private _parseMessageResponse;
9
+ private _parseDeletedResponse;
10
+ list(domain: string, query?: DomainCredentialsQuery): Promise<DomainCredentialsList>;
11
+ create(domain: string, data: DomainCredentials): Promise<DomainCredentialsResult>;
12
+ update(domain: string, credentialsLogin: string, data: UpdateDomainCredentialsData): Promise<DomainCredentialsResult>;
13
+ destroy(domain: string, credentialsLogin: string): Promise<DomainCredentialsResult>;
14
+ }
@@ -1,13 +1,13 @@
1
- import { EventsList, EventsPage, EventsResponse, PagesList } from './interfaces/Events';
1
+ import { EventsList, EventsPage, EventsResponse, ParsedPagesList } from './interfaces/Events';
2
2
  import Request from './request';
3
3
  export default class EventClient {
4
4
  request: Request;
5
5
  constructor(request: Request);
6
6
  _parsePageNumber(url: string): string;
7
7
  _parsePage(id: string, url: string): EventsPage;
8
- _parsePageLinks(response: EventsResponse): PagesList;
8
+ _parsePageLinks(response: EventsResponse): ParsedPagesList;
9
9
  _parseEventList(response: EventsResponse): EventsList;
10
- get(domain: string, query: {
10
+ get(domain: string, query?: {
11
11
  page: string;
12
12
  }): Promise<EventsList>;
13
13
  }
@@ -0,0 +1,52 @@
1
+ export interface DomainCredentialsQuery {
2
+ limit: number;
3
+ skip: number;
4
+ }
5
+ export interface DomainCredentials {
6
+ login: string;
7
+ password: string;
8
+ }
9
+ export interface DomainCredentialsItem {
10
+ created_at: string;
11
+ login: string;
12
+ mailbox: string;
13
+ size_bytes: number | null;
14
+ }
15
+ export interface DomainCredentialsResponseData {
16
+ status: number;
17
+ body: {
18
+ items: DomainCredentialsItem[];
19
+ total_count: number;
20
+ };
21
+ }
22
+ export interface DomainCredentialsList {
23
+ items: DomainCredentialsItem[];
24
+ totalCount: number;
25
+ }
26
+ export interface DomainCredentialsResult {
27
+ status: number;
28
+ message: string;
29
+ spec?: string;
30
+ }
31
+ export interface CreatedUpdatedDomainCredentialsResponse {
32
+ status: number;
33
+ body: {
34
+ message: string;
35
+ };
36
+ }
37
+ export interface DeletedDomainCredentialsResponse {
38
+ status: number;
39
+ body: {
40
+ message: string;
41
+ spec: string;
42
+ };
43
+ }
44
+ export interface UpdateDomainCredentialsData {
45
+ password: string;
46
+ }
47
+ export interface IDomainCredentials {
48
+ list(domain: string, query: DomainCredentialsQuery): Promise<DomainCredentialsList>;
49
+ create(domain: string, data: DomainCredentials): Promise<DomainCredentialsResult>;
50
+ update(domain: string, credentialsLogin: string, data: UpdateDomainCredentialsData): Promise<DomainCredentialsResult>;
51
+ destroy(domain: string, credentialsLogin: string): Promise<DomainCredentialsResult>;
52
+ }
@@ -18,7 +18,7 @@ export interface DomainTrackingResponse {
18
18
  };
19
19
  }
20
20
  export interface UpdatedOpenTracking {
21
- message: 'Domain tracking settings have been updated';
21
+ message: string;
22
22
  open?: {
23
23
  active: boolean;
24
24
  };
@@ -36,13 +36,13 @@ export interface UpdateDomainTrackingResponse {
36
36
  body: UpdatedOpenTracking;
37
37
  }
38
38
  export interface OpenTrackingInfo {
39
- active: 'yes' | 'no';
39
+ active: 'yes' | 'no' | 'true' | 'false';
40
40
  }
41
41
  export interface ClickTrackingInfo {
42
- active: 'yes' | 'no' | 'htmlonly';
42
+ active: 'yes' | 'no' | 'true' | 'false' | 'htmlonly';
43
43
  }
44
44
  export interface UnsubscribeTrackingInfo {
45
- active: boolean;
45
+ active: 'yes' | 'no' | 'true' | 'false';
46
46
  html_footer: string;
47
47
  text_footer: string;
48
48
  }
@@ -9,7 +9,7 @@ export interface DomainInfo {
9
9
  smtp_password: string;
10
10
  spam_action?: 'disabled' | 'block' | 'tag';
11
11
  wildcard?: boolean;
12
- force_dkim_authority?: true;
12
+ force_dkim_authority?: boolean | 'true' | 'false';
13
13
  dkim_key_size?: 1024 | 2048;
14
14
  ips?: '';
15
15
  pool_id?: '';
@@ -60,12 +60,62 @@ export interface DomainListResponseData {
60
60
  total_count: number;
61
61
  };
62
62
  }
63
- export interface DestroyedDomain {
63
+ export interface MessageResponse {
64
64
  message: string;
65
65
  }
66
66
  export interface DestroyedDomainResponse {
67
67
  status: number;
68
+ body: MessageResponse;
69
+ }
70
+ export interface ConnectionSettings {
71
+ require_tls: boolean;
72
+ skip_verification: boolean;
73
+ }
74
+ export interface ConnectionSettingsResponse {
68
75
  body: {
69
- message: string;
76
+ connection: ConnectionSettings;
70
77
  };
78
+ status: number;
79
+ }
80
+ export interface UpdatedConnectionSettings {
81
+ message: string;
82
+ require_tls: boolean;
83
+ skip_verification: boolean;
84
+ }
85
+ export interface UpdatedConnectionSettingsRes {
86
+ body: UpdatedConnectionSettings;
87
+ status: number;
88
+ }
89
+ export interface DKIMAuthorityInfo {
90
+ self: boolean | 'yes' | 'no' | 'true' | 'false';
91
+ }
92
+ export interface UpdatedDKIMAuthority {
93
+ changed: boolean;
94
+ message: string;
95
+ sending_dns_records: DNSRecord[];
96
+ }
97
+ export interface UpdatedDKIMAuthorityResponse {
98
+ body: UpdatedDKIMAuthority;
99
+ status: 200;
100
+ }
101
+ export interface DKIMSelectorInfo {
102
+ dkimSelector: string;
103
+ }
104
+ export interface UpdatedDKIMSelectorResponse {
105
+ body: MessageResponse;
106
+ status: number;
107
+ }
108
+ export interface WebPrefixInfo {
109
+ webPrefix: string;
110
+ }
111
+ export interface UpdatedWebPrefix {
112
+ message: string;
113
+ }
114
+ export interface UpdatedWebPrefixResponse {
115
+ body: MessageResponse;
116
+ status: number;
117
+ }
118
+ export interface ReplacementForPool {
119
+ pool_id?: string;
120
+ ip?: string;
71
121
  }