mailpit-api 1.0.4 → 1.0.5

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.
@@ -30,27 +30,21 @@ export interface MailpitConfigurationResponse {
30
30
  };
31
31
  }
32
32
  export interface MailpitMessageSummaryResponse {
33
- Attachments: [
34
- {
35
- ContentID: string;
36
- ContentType: string;
37
- FileName: string;
38
- PartID: string;
39
- Size: number;
40
- }
41
- ];
42
- Bcc: [
43
- {
44
- Address: string;
45
- Name: string;
46
- }
47
- ];
48
- Cc: [
49
- {
50
- Address: string;
51
- Name: string;
52
- }
53
- ];
33
+ Attachments: {
34
+ ContentID: string;
35
+ ContentType: string;
36
+ FileName: string;
37
+ PartID: string;
38
+ Size: number;
39
+ }[];
40
+ Bcc: {
41
+ Address: string;
42
+ Name: string;
43
+ }[];
44
+ Cc: {
45
+ Address: string;
46
+ Name: string;
47
+ }[];
54
48
  Date: string;
55
49
  From: {
56
50
  Address: string;
@@ -58,78 +52,62 @@ export interface MailpitMessageSummaryResponse {
58
52
  };
59
53
  HTML: string;
60
54
  ID: string;
61
- Inline: [
62
- {
63
- ContentID: string;
64
- ContentType: string;
65
- FileName: string;
66
- PartID: string;
67
- Size: number;
68
- }
69
- ];
55
+ Inline: {
56
+ ContentID: string;
57
+ ContentType: string;
58
+ FileName: string;
59
+ PartID: string;
60
+ Size: number;
61
+ }[];
70
62
  MessageID: string;
71
- ReplyTo: [
72
- {
73
- Address: string;
74
- Name: string;
75
- }
76
- ];
63
+ ReplyTo: {
64
+ Address: string;
65
+ Name: string;
66
+ }[];
77
67
  ReturnPath: string;
78
68
  Size: number;
79
69
  Subject: string;
80
- Tags: [string];
70
+ Tags: string[];
81
71
  Text: string;
82
- To: [
83
- {
84
- Address: string;
85
- Name: string;
86
- }
87
- ];
72
+ To: {
73
+ Address: string;
74
+ Name: string;
75
+ }[];
88
76
  }
89
77
  export interface MailpitMessagesSummaryResponse {
90
- messages: [
91
- {
92
- Attachments: number;
93
- Size: number;
94
- Snippet: string;
95
- Subject: string;
96
- Tags: [string];
97
- ID: string;
98
- MessageID: string;
99
- Read: boolean;
100
- Bcc: [
101
- {
102
- Address: string;
103
- Name: string;
104
- }
105
- ];
106
- Cc: [
107
- {
108
- Address: string;
109
- Name: string;
110
- }
111
- ];
112
- From: {
113
- Address: string;
114
- Name: string;
115
- };
116
- ReplyTo: [
117
- {
118
- Address: string;
119
- Name: string;
120
- }
121
- ];
122
- To: [
123
- {
124
- Address: string;
125
- Name: string;
126
- }
127
- ];
128
- }
129
- ];
78
+ messages: {
79
+ Attachments: number;
80
+ Size: number;
81
+ Snippet: string;
82
+ Subject: string;
83
+ Tags: string[];
84
+ ID: string;
85
+ MessageID: string;
86
+ Read: boolean;
87
+ Bcc: {
88
+ Address: string;
89
+ Name: string;
90
+ }[];
91
+ Cc: {
92
+ Address: string;
93
+ Name: string;
94
+ }[];
95
+ From: {
96
+ Address: string;
97
+ Name: string;
98
+ };
99
+ ReplyTo: {
100
+ Address: string;
101
+ Name: string;
102
+ }[];
103
+ To: {
104
+ Address: string;
105
+ Name: string;
106
+ }[];
107
+ }[];
130
108
  messages_count: number;
131
109
  start: number;
132
- tags: [string];
110
+ tags: string[];
133
111
  total: number;
134
112
  unread: number;
135
113
  }
@@ -137,19 +115,15 @@ export interface MailpitMessageHeadersResponse {
137
115
  [key: string]: string;
138
116
  }
139
117
  export interface MailpitSendRequest {
140
- Attachments: [
141
- {
142
- Content: string;
143
- Filename: string;
144
- }
145
- ];
146
- Bcc: [string];
147
- Cc: [
148
- {
149
- Email: string;
150
- Name: string;
151
- }
152
- ];
118
+ Attachments: {
119
+ Content: string;
120
+ Filename: string;
121
+ }[];
122
+ Bcc: string[];
123
+ Cc: {
124
+ Email: string;
125
+ Name: string;
126
+ }[];
153
127
  From: {
154
128
  Email: string;
155
129
  Name: string;
@@ -158,21 +132,17 @@ export interface MailpitSendRequest {
158
132
  Headers: {
159
133
  [key: string]: string;
160
134
  };
161
- ReplyTo: [
162
- {
163
- Email: string;
164
- Name: string;
165
- }
166
- ];
135
+ ReplyTo: {
136
+ Email: string;
137
+ Name: string;
138
+ }[];
167
139
  Subject: string;
168
- Tags: [string];
140
+ Tags: string[];
169
141
  Text: string;
170
- To: [
171
- {
172
- Email: string;
173
- Name: string;
174
- }
175
- ];
142
+ To: {
143
+ Email: string;
144
+ Name: string;
145
+ }[];
176
146
  }
177
147
  export interface MailpitSendMessageConfirmationResponse {
178
148
  ID: string;
@@ -188,65 +158,57 @@ export interface MailpitHTMLCheckResponse {
188
158
  Tests: number;
189
159
  Unsupported: number;
190
160
  };
191
- Warnings: [
192
- {
193
- Category: "css" | "html";
194
- Description: string;
195
- Keywords: string;
196
- NotesByNumber: {
197
- [key: string]: string;
198
- };
199
- Results: [
200
- {
201
- Family: string;
202
- Name: string;
203
- NoteNumber: string;
204
- Platform: string;
205
- Support: "yes" | "no" | "partial";
206
- Version: string;
207
- }
208
- ];
209
- Score: {
210
- Found: number;
211
- Partial: number;
212
- Supported: number;
213
- Unsupported: number;
214
- };
215
- Slug: string;
216
- Tags: [string];
217
- Title: string;
218
- URL: string;
219
- }
220
- ];
161
+ Warnings: {
162
+ Category: "css" | "html";
163
+ Description: string;
164
+ Keywords: string;
165
+ NotesByNumber: {
166
+ [key: string]: string;
167
+ };
168
+ Results: {
169
+ Family: string;
170
+ Name: string;
171
+ NoteNumber: string;
172
+ Platform: string;
173
+ Support: "yes" | "no" | "partial";
174
+ Version: string;
175
+ }[];
176
+ Score: {
177
+ Found: number;
178
+ Partial: number;
179
+ Supported: number;
180
+ Unsupported: number;
181
+ };
182
+ Slug: string;
183
+ Tags: string[];
184
+ Title: string;
185
+ URL: string;
186
+ }[];
221
187
  }
222
188
  export interface MailpitLinkCheckResponse {
223
189
  Errors: number;
224
- Links: [
225
- {
226
- Status: string;
227
- StatusCode: number;
228
- URL: string;
229
- }
230
- ];
190
+ Links: {
191
+ Status: string;
192
+ StatusCode: number;
193
+ URL: string;
194
+ }[];
231
195
  }
232
196
  export interface MailpitSpamAssassinResponse {
233
197
  Errors: number;
234
198
  IsSpam: boolean;
235
- Rules: [
236
- {
237
- Description: string;
238
- Name: string;
239
- Score: number;
240
- }
241
- ];
199
+ Rules: {
200
+ Description: string;
201
+ Name: string;
202
+ Score: number;
203
+ }[];
242
204
  Score: number;
243
205
  }
244
206
  export interface MailpitReadStatusRequest {
245
- IDs: [string];
207
+ IDs: string[];
246
208
  Read: boolean;
247
209
  }
248
210
  export interface MailpitDeleteRequest {
249
- IDs: [string];
211
+ IDs: string[];
250
212
  }
251
213
  export interface MailpitSearchRequest {
252
214
  query: string;
@@ -259,8 +221,8 @@ export interface MailpitSearchDeleteRequest {
259
221
  tz?: string;
260
222
  }
261
223
  export interface MailpitSetTagsRequest {
262
- IDs: [string];
263
- Tags: [string];
224
+ IDs: string[];
225
+ Tags: string[];
264
226
  }
265
227
  export declare class MailpitClient {
266
228
  private axiosInstance;
@@ -285,7 +247,7 @@ export declare class MailpitClient {
285
247
  deleteMessages(deleteRequest?: MailpitDeleteRequest): Promise<string>;
286
248
  searchMessages(search: MailpitSearchRequest): Promise<MailpitMessagesSummaryResponse>;
287
249
  deleteMessagesBySearch(search: MailpitSearchDeleteRequest): Promise<string>;
288
- getTags(): Promise<[string]>;
250
+ getTags(): Promise<string[]>;
289
251
  setTags(request: MailpitSetTagsRequest): Promise<string>;
290
252
  renameTag(tag: string, newTagName: string): Promise<string>;
291
253
  deleteTag(tag: string): Promise<string>;
@@ -30,27 +30,21 @@ export interface MailpitConfigurationResponse {
30
30
  };
31
31
  }
32
32
  export interface MailpitMessageSummaryResponse {
33
- Attachments: [
34
- {
35
- ContentID: string;
36
- ContentType: string;
37
- FileName: string;
38
- PartID: string;
39
- Size: number;
40
- }
41
- ];
42
- Bcc: [
43
- {
44
- Address: string;
45
- Name: string;
46
- }
47
- ];
48
- Cc: [
49
- {
50
- Address: string;
51
- Name: string;
52
- }
53
- ];
33
+ Attachments: {
34
+ ContentID: string;
35
+ ContentType: string;
36
+ FileName: string;
37
+ PartID: string;
38
+ Size: number;
39
+ }[];
40
+ Bcc: {
41
+ Address: string;
42
+ Name: string;
43
+ }[];
44
+ Cc: {
45
+ Address: string;
46
+ Name: string;
47
+ }[];
54
48
  Date: string;
55
49
  From: {
56
50
  Address: string;
@@ -58,78 +52,62 @@ export interface MailpitMessageSummaryResponse {
58
52
  };
59
53
  HTML: string;
60
54
  ID: string;
61
- Inline: [
62
- {
63
- ContentID: string;
64
- ContentType: string;
65
- FileName: string;
66
- PartID: string;
67
- Size: number;
68
- }
69
- ];
55
+ Inline: {
56
+ ContentID: string;
57
+ ContentType: string;
58
+ FileName: string;
59
+ PartID: string;
60
+ Size: number;
61
+ }[];
70
62
  MessageID: string;
71
- ReplyTo: [
72
- {
73
- Address: string;
74
- Name: string;
75
- }
76
- ];
63
+ ReplyTo: {
64
+ Address: string;
65
+ Name: string;
66
+ }[];
77
67
  ReturnPath: string;
78
68
  Size: number;
79
69
  Subject: string;
80
- Tags: [string];
70
+ Tags: string[];
81
71
  Text: string;
82
- To: [
83
- {
84
- Address: string;
85
- Name: string;
86
- }
87
- ];
72
+ To: {
73
+ Address: string;
74
+ Name: string;
75
+ }[];
88
76
  }
89
77
  export interface MailpitMessagesSummaryResponse {
90
- messages: [
91
- {
92
- Attachments: number;
93
- Size: number;
94
- Snippet: string;
95
- Subject: string;
96
- Tags: [string];
97
- ID: string;
98
- MessageID: string;
99
- Read: boolean;
100
- Bcc: [
101
- {
102
- Address: string;
103
- Name: string;
104
- }
105
- ];
106
- Cc: [
107
- {
108
- Address: string;
109
- Name: string;
110
- }
111
- ];
112
- From: {
113
- Address: string;
114
- Name: string;
115
- };
116
- ReplyTo: [
117
- {
118
- Address: string;
119
- Name: string;
120
- }
121
- ];
122
- To: [
123
- {
124
- Address: string;
125
- Name: string;
126
- }
127
- ];
128
- }
129
- ];
78
+ messages: {
79
+ Attachments: number;
80
+ Size: number;
81
+ Snippet: string;
82
+ Subject: string;
83
+ Tags: string[];
84
+ ID: string;
85
+ MessageID: string;
86
+ Read: boolean;
87
+ Bcc: {
88
+ Address: string;
89
+ Name: string;
90
+ }[];
91
+ Cc: {
92
+ Address: string;
93
+ Name: string;
94
+ }[];
95
+ From: {
96
+ Address: string;
97
+ Name: string;
98
+ };
99
+ ReplyTo: {
100
+ Address: string;
101
+ Name: string;
102
+ }[];
103
+ To: {
104
+ Address: string;
105
+ Name: string;
106
+ }[];
107
+ }[];
130
108
  messages_count: number;
131
109
  start: number;
132
- tags: [string];
110
+ tags: string[];
133
111
  total: number;
134
112
  unread: number;
135
113
  }
@@ -137,19 +115,15 @@ export interface MailpitMessageHeadersResponse {
137
115
  [key: string]: string;
138
116
  }
139
117
  export interface MailpitSendRequest {
140
- Attachments: [
141
- {
142
- Content: string;
143
- Filename: string;
144
- }
145
- ];
146
- Bcc: [string];
147
- Cc: [
148
- {
149
- Email: string;
150
- Name: string;
151
- }
152
- ];
118
+ Attachments: {
119
+ Content: string;
120
+ Filename: string;
121
+ }[];
122
+ Bcc: string[];
123
+ Cc: {
124
+ Email: string;
125
+ Name: string;
126
+ }[];
153
127
  From: {
154
128
  Email: string;
155
129
  Name: string;
@@ -158,21 +132,17 @@ export interface MailpitSendRequest {
158
132
  Headers: {
159
133
  [key: string]: string;
160
134
  };
161
- ReplyTo: [
162
- {
163
- Email: string;
164
- Name: string;
165
- }
166
- ];
135
+ ReplyTo: {
136
+ Email: string;
137
+ Name: string;
138
+ }[];
167
139
  Subject: string;
168
- Tags: [string];
140
+ Tags: string[];
169
141
  Text: string;
170
- To: [
171
- {
172
- Email: string;
173
- Name: string;
174
- }
175
- ];
142
+ To: {
143
+ Email: string;
144
+ Name: string;
145
+ }[];
176
146
  }
177
147
  export interface MailpitSendMessageConfirmationResponse {
178
148
  ID: string;
@@ -188,65 +158,57 @@ export interface MailpitHTMLCheckResponse {
188
158
  Tests: number;
189
159
  Unsupported: number;
190
160
  };
191
- Warnings: [
192
- {
193
- Category: "css" | "html";
194
- Description: string;
195
- Keywords: string;
196
- NotesByNumber: {
197
- [key: string]: string;
198
- };
199
- Results: [
200
- {
201
- Family: string;
202
- Name: string;
203
- NoteNumber: string;
204
- Platform: string;
205
- Support: "yes" | "no" | "partial";
206
- Version: string;
207
- }
208
- ];
209
- Score: {
210
- Found: number;
211
- Partial: number;
212
- Supported: number;
213
- Unsupported: number;
214
- };
215
- Slug: string;
216
- Tags: [string];
217
- Title: string;
218
- URL: string;
219
- }
220
- ];
161
+ Warnings: {
162
+ Category: "css" | "html";
163
+ Description: string;
164
+ Keywords: string;
165
+ NotesByNumber: {
166
+ [key: string]: string;
167
+ };
168
+ Results: {
169
+ Family: string;
170
+ Name: string;
171
+ NoteNumber: string;
172
+ Platform: string;
173
+ Support: "yes" | "no" | "partial";
174
+ Version: string;
175
+ }[];
176
+ Score: {
177
+ Found: number;
178
+ Partial: number;
179
+ Supported: number;
180
+ Unsupported: number;
181
+ };
182
+ Slug: string;
183
+ Tags: string[];
184
+ Title: string;
185
+ URL: string;
186
+ }[];
221
187
  }
222
188
  export interface MailpitLinkCheckResponse {
223
189
  Errors: number;
224
- Links: [
225
- {
226
- Status: string;
227
- StatusCode: number;
228
- URL: string;
229
- }
230
- ];
190
+ Links: {
191
+ Status: string;
192
+ StatusCode: number;
193
+ URL: string;
194
+ }[];
231
195
  }
232
196
  export interface MailpitSpamAssassinResponse {
233
197
  Errors: number;
234
198
  IsSpam: boolean;
235
- Rules: [
236
- {
237
- Description: string;
238
- Name: string;
239
- Score: number;
240
- }
241
- ];
199
+ Rules: {
200
+ Description: string;
201
+ Name: string;
202
+ Score: number;
203
+ }[];
242
204
  Score: number;
243
205
  }
244
206
  export interface MailpitReadStatusRequest {
245
- IDs: [string];
207
+ IDs: string[];
246
208
  Read: boolean;
247
209
  }
248
210
  export interface MailpitDeleteRequest {
249
- IDs: [string];
211
+ IDs: string[];
250
212
  }
251
213
  export interface MailpitSearchRequest {
252
214
  query: string;
@@ -259,8 +221,8 @@ export interface MailpitSearchDeleteRequest {
259
221
  tz?: string;
260
222
  }
261
223
  export interface MailpitSetTagsRequest {
262
- IDs: [string];
263
- Tags: [string];
224
+ IDs: string[];
225
+ Tags: string[];
264
226
  }
265
227
  export declare class MailpitClient {
266
228
  private axiosInstance;
@@ -285,7 +247,7 @@ export declare class MailpitClient {
285
247
  deleteMessages(deleteRequest?: MailpitDeleteRequest): Promise<string>;
286
248
  searchMessages(search: MailpitSearchRequest): Promise<MailpitMessagesSummaryResponse>;
287
249
  deleteMessagesBySearch(search: MailpitSearchDeleteRequest): Promise<string>;
288
- getTags(): Promise<[string]>;
250
+ getTags(): Promise<string[]>;
289
251
  setTags(request: MailpitSetTagsRequest): Promise<string>;
290
252
  renameTag(tag: string, newTagName: string): Promise<string>;
291
253
  deleteTag(tag: string): Promise<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mailpit-api",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "A NodeJS client library, written in TypeScript, to interact with the Mailpit API.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,7 +16,8 @@
16
16
  },
17
17
  "scripts": {
18
18
  "test": "echo \"TODO: Add tests\" && exit 0",
19
- "build": "rm -fr dist/* && tsc -p tsconfig.json && tsc -p tsconfig-cjs.json && ./fixup_type"
19
+ "build": "rm -fr dist/* && tsc -p tsconfig.json && tsc -p tsconfig-cjs.json && ./fixup_type",
20
+ "pretty": "npx prettier . --write"
20
21
  },
21
22
  "keywords": [
22
23
  "mailpit-api",
@@ -42,7 +43,7 @@
42
43
  "eslint": "^8.57.0",
43
44
  "globals": "^15.13.0",
44
45
  "jest": "^29.7.0",
45
- "prettier": "3.4.1",
46
+ "prettier": "3.4.2",
46
47
  "tsx": "^4.19.2",
47
48
  "typescript": "^5.7.2",
48
49
  "typescript-eslint": "^7.18.0"
package/src/index.ts CHANGED
@@ -34,27 +34,21 @@ export interface MailpitConfigurationResponse {
34
34
  }
35
35
 
36
36
  export interface MailpitMessageSummaryResponse {
37
- Attachments: [
38
- {
39
- ContentID: string;
40
- ContentType: string;
41
- FileName: string;
42
- PartID: string;
43
- Size: number;
44
- },
45
- ];
46
- Bcc: [
47
- {
48
- Address: string;
49
- Name: string;
50
- },
51
- ];
52
- Cc: [
53
- {
54
- Address: string;
55
- Name: string;
56
- },
57
- ];
37
+ Attachments: {
38
+ ContentID: string;
39
+ ContentType: string;
40
+ FileName: string;
41
+ PartID: string;
42
+ Size: number;
43
+ }[];
44
+ Bcc: {
45
+ Address: string;
46
+ Name: string;
47
+ }[];
48
+ Cc: {
49
+ Address: string;
50
+ Name: string;
51
+ }[];
58
52
  Date: string;
59
53
  From: {
60
54
  Address: string;
@@ -62,79 +56,63 @@ export interface MailpitMessageSummaryResponse {
62
56
  };
63
57
  HTML: string;
64
58
  ID: string;
65
- Inline: [
66
- {
67
- ContentID: string;
68
- ContentType: string;
69
- FileName: string;
70
- PartID: string;
71
- Size: number;
72
- },
73
- ];
59
+ Inline: {
60
+ ContentID: string;
61
+ ContentType: string;
62
+ FileName: string;
63
+ PartID: string;
64
+ Size: number;
65
+ }[];
74
66
  MessageID: string;
75
- ReplyTo: [
76
- {
77
- Address: string;
78
- Name: string;
79
- },
80
- ];
67
+ ReplyTo: {
68
+ Address: string;
69
+ Name: string;
70
+ }[];
81
71
  ReturnPath: string;
82
72
  Size: number;
83
73
  Subject: string;
84
- Tags: [string];
74
+ Tags: string[];
85
75
  Text: string;
86
- To: [
87
- {
88
- Address: string;
89
- Name: string;
90
- },
91
- ];
76
+ To: {
77
+ Address: string;
78
+ Name: string;
79
+ }[];
92
80
  }
93
81
 
94
82
  export interface MailpitMessagesSummaryResponse {
95
- messages: [
96
- {
97
- Attachments: number;
98
- Size: number;
99
- Snippet: string;
100
- Subject: string;
101
- Tags: [string];
102
- ID: string;
103
- MessageID: string;
104
- Read: boolean;
105
- Bcc: [
106
- {
107
- Address: string;
108
- Name: string;
109
- },
110
- ];
111
- Cc: [
112
- {
113
- Address: string;
114
- Name: string;
115
- },
116
- ];
117
- From: {
118
- Address: string;
119
- Name: string;
120
- };
121
- ReplyTo: [
122
- {
123
- Address: string;
124
- Name: string;
125
- },
126
- ];
127
- To: [
128
- {
129
- Address: string;
130
- Name: string;
131
- },
132
- ];
133
- },
134
- ];
83
+ messages: {
84
+ Attachments: number;
85
+ Size: number;
86
+ Snippet: string;
87
+ Subject: string;
88
+ Tags: string[];
89
+ ID: string;
90
+ MessageID: string;
91
+ Read: boolean;
92
+ Bcc: {
93
+ Address: string;
94
+ Name: string;
95
+ }[];
96
+ Cc: {
97
+ Address: string;
98
+ Name: string;
99
+ }[];
100
+ From: {
101
+ Address: string;
102
+ Name: string;
103
+ };
104
+ ReplyTo: {
105
+ Address: string;
106
+ Name: string;
107
+ }[];
108
+ To: {
109
+ Address: string;
110
+ Name: string;
111
+ }[];
112
+ }[];
135
113
  messages_count: number;
136
114
  start: number;
137
- tags: [string];
115
+ tags: string[];
138
116
  total: number;
139
117
  unread: number;
140
118
  }
@@ -144,19 +122,15 @@ export interface MailpitMessageHeadersResponse {
144
122
  }
145
123
 
146
124
  export interface MailpitSendRequest {
147
- Attachments: [
148
- {
149
- Content: string;
150
- Filename: string;
151
- },
152
- ];
153
- Bcc: [string];
154
- Cc: [
155
- {
156
- Email: string;
157
- Name: string;
158
- },
159
- ];
125
+ Attachments: {
126
+ Content: string;
127
+ Filename: string;
128
+ }[];
129
+ Bcc: string[];
130
+ Cc: {
131
+ Email: string;
132
+ Name: string;
133
+ }[];
160
134
  From: {
161
135
  Email: string;
162
136
  Name: string;
@@ -165,21 +139,17 @@ export interface MailpitSendRequest {
165
139
  Headers: {
166
140
  [key: string]: string;
167
141
  };
168
- ReplyTo: [
169
- {
170
- Email: string;
171
- Name: string;
172
- },
173
- ];
142
+ ReplyTo: {
143
+ Email: string;
144
+ Name: string;
145
+ }[];
174
146
  Subject: string;
175
- Tags: [string];
147
+ Tags: string[];
176
148
  Text: string;
177
- To: [
178
- {
179
- Email: string;
180
- Name: string;
181
- },
182
- ];
149
+ To: {
150
+ Email: string;
151
+ Name: string;
152
+ }[];
183
153
  }
184
154
 
185
155
  export interface MailpitSendMessageConfirmationResponse {
@@ -197,69 +167,61 @@ export interface MailpitHTMLCheckResponse {
197
167
  Tests: number;
198
168
  Unsupported: number;
199
169
  };
200
- Warnings: [
201
- {
202
- Category: "css" | "html";
203
- Description: string;
204
- Keywords: string;
205
- NotesByNumber: {
206
- [key: string]: string;
207
- };
208
- Results: [
209
- {
210
- Family: string;
211
- Name: string;
212
- NoteNumber: string;
213
- Platform: string;
214
- Support: "yes" | "no" | "partial";
215
- Version: string;
216
- },
217
- ];
218
- Score: {
219
- Found: number;
220
- Partial: number;
221
- Supported: number;
222
- Unsupported: number;
223
- };
224
- Slug: string;
225
- Tags: [string];
226
- Title: string;
227
- URL: string;
228
- },
229
- ];
170
+ Warnings: {
171
+ Category: "css" | "html";
172
+ Description: string;
173
+ Keywords: string;
174
+ NotesByNumber: {
175
+ [key: string]: string;
176
+ };
177
+ Results: {
178
+ Family: string;
179
+ Name: string;
180
+ NoteNumber: string;
181
+ Platform: string;
182
+ Support: "yes" | "no" | "partial";
183
+ Version: string;
184
+ }[];
185
+ Score: {
186
+ Found: number;
187
+ Partial: number;
188
+ Supported: number;
189
+ Unsupported: number;
190
+ };
191
+ Slug: string;
192
+ Tags: string[];
193
+ Title: string;
194
+ URL: string;
195
+ }[];
230
196
  }
231
197
 
232
198
  export interface MailpitLinkCheckResponse {
233
199
  Errors: number;
234
- Links: [
235
- {
236
- Status: string;
237
- StatusCode: number;
238
- URL: string;
239
- },
240
- ];
200
+ Links: {
201
+ Status: string;
202
+ StatusCode: number;
203
+ URL: string;
204
+ }[];
241
205
  }
242
206
 
243
207
  export interface MailpitSpamAssassinResponse {
244
208
  Errors: number;
245
209
  IsSpam: boolean;
246
- Rules: [
247
- {
248
- Description: string;
249
- Name: string;
250
- Score: number;
251
- },
252
- ];
210
+ Rules: {
211
+ Description: string;
212
+ Name: string;
213
+ Score: number;
214
+ }[];
253
215
  Score: number;
254
216
  }
255
217
 
256
218
  export interface MailpitReadStatusRequest {
257
- IDs: [string];
219
+ IDs: string[];
258
220
  Read: boolean;
259
221
  }
260
222
 
261
223
  export interface MailpitDeleteRequest {
262
- IDs: [string];
224
+ IDs: string[];
263
225
  }
264
226
 
265
227
  export interface MailpitSearchRequest {
@@ -275,8 +237,8 @@ export interface MailpitSearchDeleteRequest {
275
237
  }
276
238
 
277
239
  export interface MailpitSetTagsRequest {
278
- IDs: [string];
279
- Tags: [string];
240
+ IDs: string[];
241
+ Tags: string[];
280
242
  }
281
243
 
282
244
  export class MailpitClient {
@@ -486,9 +448,9 @@ export class MailpitClient {
486
448
  }
487
449
 
488
450
  // Tags
489
- public async getTags(): Promise<[string]> {
451
+ public async getTags(): Promise<string[]> {
490
452
  return this.handleRequest(() =>
491
- this.axiosInstance.get<[string]>(`/api/v1/tags`),
453
+ this.axiosInstance.get<string[]>(`/api/v1/tags`),
492
454
  );
493
455
  }
494
456