mailgun.js 9.0.1 → 9.1.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,36 @@
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
+ ### [9.1.1](https://github.com/mailgun/mailgun.js/compare/v9.1.0...v9.1.1) (2023-06-23)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * Creating one unsubscribe with the tag property ([6f27372](https://github.com/mailgun/mailgun.js/commits/6f2737229d14977093e4f8076c053be77002322c))
11
+ * Replace models map by object to remove eslint warning ([1faada1](https://github.com/mailgun/mailgun.js/commits/1faada106b50bb05ddac0b5af1b139264059a12b))
12
+
13
+
14
+ ### Other changes
15
+
16
+ * Readme update ([3ccc575](https://github.com/mailgun/mailgun.js/commits/3ccc57535ac6d4eda46b12b5cad398c4eb11ff9d))
17
+
18
+ ## [9.1.0](https://github.com/mailgun/mailgun.js/compare/v9.0.1...v9.1.0) (2023-06-16)
19
+
20
+
21
+ ### Features
22
+
23
+ * Add tags property for unsubscribe data type ([3a02a50](https://github.com/mailgun/mailgun.js/commits/3a02a50bc824ed2393075a262399f3e660cf771c))
24
+
25
+
26
+ ### Other changes
27
+
28
+ * Add issues template ([c7e8515](https://github.com/mailgun/mailgun.js/commits/c7e85152f7cc725a15612385c090a4f794461a78))
29
+ * Add to release commit TS docs files ([7c7376e](https://github.com/mailgun/mailgun.js/commits/7c7376e1fd3802e79c5259b74418aa8063e4e2f7))
30
+ * Freshest docs ([5258cda](https://github.com/mailgun/mailgun.js/commits/5258cda2b1864e4f71681db1549df8b90daa8ca6))
31
+ * Rename issue template file ([4f7857d](https://github.com/mailgun/mailgun.js/commits/4f7857db8b0e331c89d2e6e3a19aa47c87bf3e39))
32
+ * Update readme with a link to docs ([371a46f](https://github.com/mailgun/mailgun.js/commits/371a46f8c20d5418d6389df769eabd4e957f7732))
33
+ * Update typedoc to use markdown ([393c6f1](https://github.com/mailgun/mailgun.js/commits/393c6f186cd2416c0e2802aa50848bf6556a1a15))
34
+
5
35
  ### [9.0.1](https://github.com/mailgun/mailgun.js/compare/v9.0.0...v9.0.1) (2023-06-06)
6
36
 
7
37
 
@@ -5,7 +5,7 @@ import { IBounce, IComplaint, ISuppressionClient, IUnsubscribe, IWhiteList } fro
5
5
  import { SuppressionList, SuppressionListResponse, SuppressionDataType, SuppressionCreationData, SuppressionCreationResult, SuppressionListQuery, SuppressionDestroyResult } from '../../Types/Suppressions';
6
6
  export default class SuppressionClient extends NavigationThruPages<SuppressionList> implements ISuppressionClient {
7
7
  request: Request;
8
- models: Map<string, any>;
8
+ models: object;
9
9
  constructor(request: Request);
10
10
  protected parseList(response: SuppressionListResponse, Model: {
11
11
  new (data: SuppressionDataType): IBounce | IComplaint | IUnsubscribe | IWhiteList;
@@ -14,7 +14,8 @@ export default class SuppressionClient extends NavigationThruPages<SuppressionLi
14
14
  new (dataType: SuppressionDataType): T;
15
15
  }): T;
16
16
  private createWhiteList;
17
- private checkType;
17
+ private createUnsubscribe;
18
+ private getModel;
18
19
  private prepareResponse;
19
20
  list(domain: string, type: string, query?: SuppressionListQuery): Promise<SuppressionList>;
20
21
  get(domain: string, type: string, address: string): Promise<IBounce | IComplaint | IUnsubscribe | IWhiteList>;
package/README.md CHANGED
@@ -73,7 +73,7 @@ Starting from version **9.0.0.** Interfaces and Enums can be imported in the nex
73
73
  ```
74
74
 
75
75
  ### Generated docs
76
- The list of all available Types, Interfaces and Enums is auto-generated and located in the docs/ folder.
76
+ The list of all available Types, Interfaces and Enums is auto-generated and located in the [docs](./docs/modules.md) folder.
77
77
 
78
78
  ## Methods
79
79
 
@@ -101,9 +101,23 @@ The following service methods are available to instantiated clients. The example
101
101
  - [getAccount](#getaccount)
102
102
  - [suppressions](#suppressions)
103
103
  - [list](#list-1)
104
+ - [Bounces Example](#bounces-example)
105
+ - [Unsubscribes Example](#unsubscribes-example)
106
+ - [Complaints Example](#complaints-example)
104
107
  - [get](#get-2)
108
+ - [Bounces Example](#bounces-example-1)
109
+ - [Unsubscribes Example](#unsubscribes-example-1)
110
+ - [Complaints Example](#complaints-example-1)
105
111
  - [create](#create-2)
112
+ - [Bounces Example](#bounces-example-2)
113
+ - [Unsubscribes Example](#unsubscribes-example-2)
114
+ - [Unsubscribe from one tag](#unsubscribe-from-one-tag)
115
+ - [Unsubscribe from particular tags](#unsubscribe-from-particular-tags)
116
+ - [Complaints Example](#complaints-example-2)
106
117
  - [destroy](#destroy-1)
118
+ - [Bounces Example](#bounces-example-3)
119
+ - [Unsubscribes Example](#unsubscribes-example-3)
120
+ - [Complaints Example](#complaints-example-3)
107
121
  - [webhooks](#webhooks)
108
122
  - [list](#list-2)
109
123
  - [get](#get-3)
@@ -924,7 +938,7 @@ Method naming conventions:
924
938
 
925
939
  `mg.suppressions.list(domain, suppressionType, query?)`
926
940
 
927
- - Bounces Example:
941
+ - #### Bounces Example:
928
942
 
929
943
  ```js
930
944
  mg.suppressions.list('foobar.example.com', 'bounces')
@@ -932,7 +946,7 @@ Method naming conventions:
932
946
  .catch(err => console.error(err)); // logs any error
933
947
  ```
934
948
 
935
- - Unsubscribes Example:
949
+ - #### Unsubscribes Example:
936
950
 
937
951
  ```js
938
952
  mg.suppressions.list('foobar.example.com', 'unsubscribes')
@@ -940,7 +954,7 @@ Method naming conventions:
940
954
  .catch(err => console.error(err)); // logs any error
941
955
  ```
942
956
 
943
- - Complaints Example:
957
+ - #### Complaints Example:
944
958
 
945
959
  ```js
946
960
  mg.suppressions.list('foobar.example.com', 'complaints')
@@ -973,7 +987,7 @@ Method naming conventions:
973
987
 
974
988
  `mg.suppressions.get(domain, suppressionType, address)`
975
989
 
976
- - Bounces Example:
990
+ - #### Bounces Example:
977
991
 
978
992
  ```js
979
993
  mg.suppressions.get('foobar.example.com', 'bounces', 'address@example.com')
@@ -981,7 +995,7 @@ Method naming conventions:
981
995
  .catch(err => console.error(err)); // logs any error
982
996
  ```
983
997
 
984
- - Unsubscribes Example:
998
+ - #### Unsubscribes Example:
985
999
 
986
1000
  ```js
987
1001
  mg.suppressions.get('foobar.example.com', 'unsubscribes', 'address@example.com')
@@ -989,7 +1003,7 @@ Method naming conventions:
989
1003
  .catch(err => console.error(err)); // logs any error
990
1004
  ```
991
1005
 
992
- - Complaints Example:
1006
+ - #### Complaints Example:
993
1007
 
994
1008
  ```js
995
1009
  mg.suppressions.get('foobar.example.com', 'complaints', 'address@example.com')
@@ -1011,7 +1025,7 @@ Method naming conventions:
1011
1025
  - #### create
1012
1026
  `mg.suppressions.create(domain, suppressionType, data || data[])`
1013
1027
 
1014
- - Bounces Example:
1028
+ - #### Bounces Example:
1015
1029
  ```JS
1016
1030
  mg.suppressions.create('foobar.example.com', 'bounces', [{address: 'bob@example.com'}])
1017
1031
  .then(msg => console.log(msg)) // logs response data
@@ -1029,16 +1043,16 @@ Method naming conventions:
1029
1043
 
1030
1044
  Promise returns:
1031
1045
 
1032
- ```JSON
1046
+ ```js
1033
1047
  {
1034
1048
  message: "1 address has been added to the bounces table"
1035
1049
  }
1036
1050
  ```
1037
1051
 
1038
- - Unsubscribes Example:
1052
+ - #### Unsubscribes Example:
1039
1053
 
1040
1054
  ```js
1041
- mg.suppressions.create('foobar.example.com', 'unsubscribes', [{address: 'bob@example.com'}])
1055
+ mg.suppressions.create('foobar.example.com', 'unsubscribes', {address: 'bob@example.com'})
1042
1056
  .then(msg => console.log(msg)) // logs response data
1043
1057
  .catch(err => console.error(err)); // logs any error
1044
1058
  ```
@@ -1049,6 +1063,7 @@ Method naming conventions:
1049
1063
  |:-----------|:-----------------------------------------------------------------------------------------------------------------|
1050
1064
  | address | Valid email address |
1051
1065
  | tag | Tag to unsubscribe from, use * to unsubscribe an address from all domain’s correspondence (optional, default: *) |
1066
+ | tags | Array with tags to unsubscribe from |
1052
1067
  | created_at | Timestamp of a bounce event in RFC2822 format (optional, default: current time) |
1053
1068
 
1054
1069
  Promise returns:
@@ -1058,8 +1073,34 @@ Method naming conventions:
1058
1073
  message: "1 address has been added to the unsubscribes table"
1059
1074
  }
1060
1075
  ```
1076
+ - #### Unsubscribe from one tag
1077
+ ```js
1078
+ mg.suppressions.create('foobar.example.com', 'unsubscribes', {address: 'bob@example.com', tag: 'your_tag_to_unsubscribe']})
1079
+ .then(msg => console.log(msg)) // logs response data
1080
+ .catch(err => console.error(err)); // logs any error
1081
+ ```
1082
+ Promise returns:
1083
+
1084
+ ```JS
1085
+ {
1086
+ message: "1 address has been added to the unsubscribes table"
1087
+ }
1088
+ ```
1089
+ - #### Unsubscribe from particular tags
1090
+ ```js
1091
+ mg.suppressions.create('foobar.example.com', 'unsubscribes', [{address: 'bob@example.com', tags: ['your_tag_to_unsubscribe', 'another_tag_to_unsubscribe']}])
1092
+ .then(msg => console.log(msg)) // logs response data
1093
+ .catch(err => console.error(err)); // logs any error
1094
+ ```
1095
+ Promise returns:
1096
+
1097
+ ```JS
1098
+ {
1099
+ message: "1 address has been added to the unsubscribes table"
1100
+ }
1101
+ ```
1061
1102
 
1062
- - Complaints Example:
1103
+ - #### Complaints Example:
1063
1104
 
1064
1105
  ```js
1065
1106
  mg.suppressions.create('foobar.example.com', 'complaints', [{address: 'bob@example.com'}])
@@ -1085,7 +1126,7 @@ Method naming conventions:
1085
1126
  - #### destroy
1086
1127
  `mg.suppressions.destroy(domain, suppressionType, address)`
1087
1128
 
1088
- - Bounces Example:
1129
+ - #### Bounces Example:
1089
1130
 
1090
1131
  ```JS
1091
1132
  mg.suppressions.destroy('foobar.example.com', 'bounces', 'bob@example.com')
@@ -1104,7 +1145,7 @@ Method naming conventions:
1104
1145
  }
1105
1146
  ```
1106
1147
 
1107
- - Unsubscribes Example:
1148
+ - #### Unsubscribes Example:
1108
1149
 
1109
1150
  ```js
1110
1151
  mg.suppressions.destroy('foobar.example.com', 'unsubscribes', 'bob@example.com')
@@ -1123,7 +1164,7 @@ Method naming conventions:
1123
1164
  }
1124
1165
  ```
1125
1166
 
1126
- - Complaints Example:
1167
+ - #### Complaints Example:
1127
1168
 
1128
1169
  ```js
1129
1170
  mg.suppressions.destroy('foobar.example.com', 'complaints', 'bob@example.com')
@@ -43,6 +43,7 @@ export type SuppressionCreationData = {
43
43
  domain?: string;
44
44
  tag?: string;
45
45
  created_at?: string;
46
+ tags?: string[];
46
47
  };
47
48
  export type SuppressionCreationResponse = {
48
49
  body: {