mailpit-api 1.0.2 → 1.0.4
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/dist/cjs/index.d.ts +46 -2
- package/dist/cjs/index.js +1 -1
- package/dist/mjs/index.d.ts +46 -2
- package/dist/mjs/index.js +1 -1
- package/package.json +7 -7
- package/src/index.ts +47 -3
package/dist/cjs/index.d.ts
CHANGED
|
@@ -87,7 +87,51 @@ export interface MailpitMessageSummaryResponse {
|
|
|
87
87
|
];
|
|
88
88
|
}
|
|
89
89
|
export interface MailpitMessagesSummaryResponse {
|
|
90
|
-
messages: [
|
|
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
|
+
];
|
|
130
|
+
messages_count: number;
|
|
131
|
+
start: number;
|
|
132
|
+
tags: [string];
|
|
133
|
+
total: number;
|
|
134
|
+
unread: number;
|
|
91
135
|
}
|
|
92
136
|
export interface MailpitMessageHeadersResponse {
|
|
93
137
|
[key: string]: string;
|
|
@@ -238,7 +282,7 @@ export declare class MailpitClient {
|
|
|
238
282
|
spamAssassinCheck(id?: string): Promise<MailpitSpamAssassinResponse>;
|
|
239
283
|
listMessages(start?: number, limit?: number): Promise<MailpitMessagesSummaryResponse>;
|
|
240
284
|
setReadStatus(readStatus: MailpitReadStatusRequest): Promise<string>;
|
|
241
|
-
deleteMessages(deleteRequest
|
|
285
|
+
deleteMessages(deleteRequest?: MailpitDeleteRequest): Promise<string>;
|
|
242
286
|
searchMessages(search: MailpitSearchRequest): Promise<MailpitMessagesSummaryResponse>;
|
|
243
287
|
deleteMessagesBySearch(search: MailpitSearchDeleteRequest): Promise<string>;
|
|
244
288
|
getTags(): Promise<[string]>;
|
package/dist/cjs/index.js
CHANGED
|
@@ -141,7 +141,7 @@ class MailpitClient {
|
|
|
141
141
|
// See https://mailpit.axllent.org/docs/usage/search-filters/
|
|
142
142
|
deleteMessagesBySearch(search) {
|
|
143
143
|
return __awaiter(this, void 0, void 0, function* () {
|
|
144
|
-
return this.handleRequest(() => this.axiosInstance.delete(`/api/v1/search`, {
|
|
144
|
+
return this.handleRequest(() => this.axiosInstance.delete(`/api/v1/search`, { params: search }));
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
147
|
// Tags
|
package/dist/mjs/index.d.ts
CHANGED
|
@@ -87,7 +87,51 @@ export interface MailpitMessageSummaryResponse {
|
|
|
87
87
|
];
|
|
88
88
|
}
|
|
89
89
|
export interface MailpitMessagesSummaryResponse {
|
|
90
|
-
messages: [
|
|
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
|
+
];
|
|
130
|
+
messages_count: number;
|
|
131
|
+
start: number;
|
|
132
|
+
tags: [string];
|
|
133
|
+
total: number;
|
|
134
|
+
unread: number;
|
|
91
135
|
}
|
|
92
136
|
export interface MailpitMessageHeadersResponse {
|
|
93
137
|
[key: string]: string;
|
|
@@ -238,7 +282,7 @@ export declare class MailpitClient {
|
|
|
238
282
|
spamAssassinCheck(id?: string): Promise<MailpitSpamAssassinResponse>;
|
|
239
283
|
listMessages(start?: number, limit?: number): Promise<MailpitMessagesSummaryResponse>;
|
|
240
284
|
setReadStatus(readStatus: MailpitReadStatusRequest): Promise<string>;
|
|
241
|
-
deleteMessages(deleteRequest
|
|
285
|
+
deleteMessages(deleteRequest?: MailpitDeleteRequest): Promise<string>;
|
|
242
286
|
searchMessages(search: MailpitSearchRequest): Promise<MailpitMessagesSummaryResponse>;
|
|
243
287
|
deleteMessagesBySearch(search: MailpitSearchDeleteRequest): Promise<string>;
|
|
244
288
|
getTags(): Promise<[string]>;
|
package/dist/mjs/index.js
CHANGED
|
@@ -92,7 +92,7 @@ export class MailpitClient {
|
|
|
92
92
|
}
|
|
93
93
|
// See https://mailpit.axllent.org/docs/usage/search-filters/
|
|
94
94
|
async deleteMessagesBySearch(search) {
|
|
95
|
-
return this.handleRequest(() => this.axiosInstance.delete(`/api/v1/search`, {
|
|
95
|
+
return this.handleRequest(() => this.axiosInstance.delete(`/api/v1/search`, { params: search }));
|
|
96
96
|
}
|
|
97
97
|
// Tags
|
|
98
98
|
async getTags() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mailpit-api",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "A NodeJS client library, written in TypeScript, to interact with the Mailpit API.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,19 +32,19 @@
|
|
|
32
32
|
"author": "Matthew Spahr",
|
|
33
33
|
"license": "MIT",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"axios": "^1.7.
|
|
35
|
+
"axios": "^1.7.8"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@eslint/js": "^8.57.0",
|
|
39
|
-
"@types/node": "^20.14.
|
|
39
|
+
"@types/node": "^20.14.15",
|
|
40
40
|
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
41
41
|
"@typescript-eslint/parser": "^7.18.0",
|
|
42
42
|
"eslint": "^8.57.0",
|
|
43
|
-
"globals": "^15.
|
|
43
|
+
"globals": "^15.13.0",
|
|
44
44
|
"jest": "^29.7.0",
|
|
45
|
-
"prettier": "3.
|
|
46
|
-
"tsx": "^4.
|
|
47
|
-
"typescript": "^5.
|
|
45
|
+
"prettier": "3.4.1",
|
|
46
|
+
"tsx": "^4.19.2",
|
|
47
|
+
"typescript": "^5.7.2",
|
|
48
48
|
"typescript-eslint": "^7.18.0"
|
|
49
49
|
}
|
|
50
50
|
}
|
package/src/index.ts
CHANGED
|
@@ -92,7 +92,51 @@ export interface MailpitMessageSummaryResponse {
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
export interface MailpitMessagesSummaryResponse {
|
|
95
|
-
messages: [
|
|
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
|
+
];
|
|
135
|
+
messages_count: number;
|
|
136
|
+
start: number;
|
|
137
|
+
tags: [string];
|
|
138
|
+
total: number;
|
|
139
|
+
unread: number;
|
|
96
140
|
}
|
|
97
141
|
|
|
98
142
|
export interface MailpitMessageHeadersResponse {
|
|
@@ -412,7 +456,7 @@ export class MailpitClient {
|
|
|
412
456
|
}
|
|
413
457
|
|
|
414
458
|
public async deleteMessages(
|
|
415
|
-
deleteRequest
|
|
459
|
+
deleteRequest?: MailpitDeleteRequest,
|
|
416
460
|
): Promise<string> {
|
|
417
461
|
return this.handleRequest(() =>
|
|
418
462
|
this.axiosInstance.delete<string>(`/api/v1/messages`, {
|
|
@@ -437,7 +481,7 @@ export class MailpitClient {
|
|
|
437
481
|
search: MailpitSearchDeleteRequest,
|
|
438
482
|
): Promise<string> {
|
|
439
483
|
return this.handleRequest(() =>
|
|
440
|
-
this.axiosInstance.delete<string>(`/api/v1/search`, {
|
|
484
|
+
this.axiosInstance.delete<string>(`/api/v1/search`, { params: search }),
|
|
441
485
|
);
|
|
442
486
|
}
|
|
443
487
|
|