temp-disposable-email 1.13.3 โ 1.16.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/README.md +61 -57
- package/dist/cjs/api.d.ts +3 -3
- package/dist/cjs/api.d.ts.map +1 -1
- package/dist/cjs/api.js +61 -18
- package/dist/cjs/api.js.map +1 -1
- package/dist/cjs/index.d.ts +6 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +10 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api.d.ts +3 -3
- package/dist/esm/api.d.ts.map +1 -1
- package/dist/esm/api.js +61 -18
- package/dist/esm/api.js.map +1 -1
- package/dist/esm/index.d.ts +6 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +11 -2
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,62 +1,47 @@
|
|
|
1
|
-
<h1 align="center">Temp Disposable Email
|
|
1
|
+
<h1 align="center">Temp Disposable Email ๐ง</h1>
|
|
2
|
+
<p align="center"> A lightweight, efficient npm package for creating and managing temporary disposable email accounts. </p>
|
|
3
|
+
|
|
2
4
|
<p align="center">
|
|
3
|
-
<a href="#feature"
|
|
4
|
-
<a href="#install"
|
|
5
|
-
<a href="#usage"
|
|
6
|
-
<a href="#example"
|
|
7
|
-
<a href="#doc"
|
|
5
|
+
<a href="#feature">โจ Features</a> |
|
|
6
|
+
<a href="#install">๐ Install</a> |
|
|
7
|
+
<a href="#usage">๐ Usage </a>|
|
|
8
|
+
<a href="#example">๐ง Examples </a>|
|
|
9
|
+
<a href="#doc">๐ API Documentation</a>
|
|
8
10
|
</p>
|
|
9
|
-
|
|
10
|
-
<div align="center">
|
|
11
|
-
<span style="display: inline-block; margin-right: 10px;">
|
|
12
|
-
<a href="https://www.npmjs.com/package/gmail-tester">
|
|
13
|
-
<img src="https://badge.fury.io/js/temp-disposable-email.svg" alt="npm version" />
|
|
14
|
-
</a>
|
|
15
|
-
</span>
|
|
16
|
-
<span style="display: inline-block; margin-right: 10px;">
|
|
17
|
-
<img src="https://img.shields.io/npm/d18m/temp-disposable-email" alt="NPM Downloads" />
|
|
18
|
-
</span>
|
|
19
|
-
<span style="display: inline-block; margin-right: 10px;">
|
|
20
|
-
<a href="https://opensource.org/licenses/MIT">
|
|
21
|
-
<img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT" />
|
|
22
|
-
</a>
|
|
23
|
-
</span>
|
|
24
|
-
<span style="display: inline-block;">
|
|
25
|
-
<a href="https://github.com/pirasanthan-jesugeevegan/temp-disposable-email">
|
|
26
|
-
<img src="https://img.shields.io/github/stars/pirasanthan-jesugeevegan/temp-disposable-email?style=social" alt="GitHub stars" />
|
|
27
|
-
</a>
|
|
28
|
-
</span>
|
|
29
|
-
</div>
|
|
11
|
+
<div align="center"> <a href="https://www.npmjs.com/package/temp-disposable-email"> <img src="https://badge.fury.io/js/temp-disposable-email.svg" alt="npm version" /> </a> <img src="https://img.shields.io/npm/d18m/temp-disposable-email" alt="NPM Downloads" /> <a href="https://opensource.org/licenses/MIT"> <img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT" /> </a> <a href="https://github.com/pirasanthan-jesugeevegan/temp-disposable-email"> <img src="https://img.shields.io/github/stars/pirasanthan-jesugeevegan/temp-disposable-email?style=social" alt="GitHub stars" /> </a> </div>
|
|
30
12
|
|
|
31
13
|
---
|
|
32
14
|
|
|
33
|
-
This npm package provides a simple interface for temp email. You can use it to create disposable email accounts, retrieve messages, and delete accounts when done. It includes polling functionality to wait for messages in the inbox and fetch their content.
|
|
34
|
-
|
|
35
15
|
<p id="feature"></p>
|
|
36
16
|
|
|
37
|
-
|
|
17
|
+
## โจ Features
|
|
38
18
|
|
|
39
|
-
- **Create Inbox**: Generate a unique, random email address and create an inbox.
|
|
40
|
-
- **Fetch Latest Messages**: Retrieve the latest messages from the inbox.
|
|
41
|
-
- **Read Message Content**: Get the content (HTML and text) of a specific message.
|
|
42
|
-
- **
|
|
43
|
-
- **Delete Account**: Remove the temporary account after usage
|
|
19
|
+
- ๐ฌ **Create Inbox**: Generate a unique, random email address and create an inbox.
|
|
20
|
+
- ๐ **Fetch Latest Messages**: Retrieve the latest messages from the inbox.
|
|
21
|
+
- ๐ **Read Message Content**: Get the content (HTML and text) of a specific message.
|
|
22
|
+
- ๐งน **Clean Up**: Automatically delete messages and accounts post-test to keep your environment neat.
|
|
44
23
|
|
|
45
24
|
<p id="install"></p>
|
|
46
25
|
|
|
47
|
-
|
|
26
|
+
## ๐ Installation
|
|
48
27
|
|
|
49
|
-
|
|
28
|
+
Install the package using npm:
|
|
50
29
|
|
|
51
30
|
```bash
|
|
52
31
|
npm install temp-disposable-email --save-dev
|
|
53
32
|
```
|
|
54
33
|
|
|
34
|
+
Install the package using yarn:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
yarn add temp-disposable-email --dev
|
|
38
|
+
```
|
|
39
|
+
|
|
55
40
|
<p id="usage"></p>
|
|
56
41
|
|
|
57
|
-
|
|
42
|
+
## ๐ Usage
|
|
58
43
|
|
|
59
|
-
|
|
44
|
+
### 1๏ธโฃ Importing the package
|
|
60
45
|
|
|
61
46
|
To use the package, import the functions in your TypeScript or JavaScript project:
|
|
62
47
|
|
|
@@ -72,7 +57,7 @@ import { generateEmail, getRecentEmail } from 'temp-disposable-email';
|
|
|
72
57
|
const { generateEmail, getRecentEmail } = require('temp-disposable-email');
|
|
73
58
|
```
|
|
74
59
|
|
|
75
|
-
|
|
60
|
+
### 2๏ธโฃ Create an Inbox
|
|
76
61
|
|
|
77
62
|
This function creates a new disposable email account using a random prefix or a specified one.
|
|
78
63
|
|
|
@@ -89,7 +74,7 @@ console.log('Created email address:', emailAddress);
|
|
|
89
74
|
|
|
90
75
|
- `Promise<object>`: An object containing email details like `emailAddress`, and `accountId`.
|
|
91
76
|
|
|
92
|
-
|
|
77
|
+
### 3๏ธโฃ Fetch Recent Email
|
|
93
78
|
|
|
94
79
|
This function retrieves the latest message from the created inbox. You can specify polling options (timeout, interval, logging) for periodic checks when no message is immediately available.
|
|
95
80
|
|
|
@@ -108,23 +93,23 @@ console.log('Message received:', message);
|
|
|
108
93
|
|
|
109
94
|
#### Returns
|
|
110
95
|
|
|
111
|
-
- `Promise<object | null>`: An object containing email details like `from`, `to`, `subject`, `intro`, `text`, `html`, `createdAt`, and `
|
|
96
|
+
- `Promise<object | null>`: An object containing email details like `from`, `to`, `subject`, `intro`, `text`, `html`, `createdAt`, `updatedAt` and `attachments`.
|
|
112
97
|
|
|
113
98
|
<p id="example"></p>
|
|
114
99
|
|
|
115
|
-
|
|
100
|
+
## ๐ง Examples
|
|
116
101
|
|
|
117
|
-
|
|
102
|
+
### **Playwright Example**
|
|
118
103
|
|
|
119
104
|
For using temp-disposable-email with Playwright, see the example in the [Playwright folder](https://github.com/pirasanthan-jesugeevegan/temp-disposable-email/tree/master/examples/playwright).
|
|
120
105
|
|
|
121
|
-
|
|
106
|
+
### **Cypress Example**
|
|
122
107
|
|
|
123
108
|
For using temp-disposable-email with Cypress.
|
|
124
109
|
|
|
125
110
|
#### Import package
|
|
126
111
|
|
|
127
|
-
import package in your support/commands.{ts|js}
|
|
112
|
+
import package in your `support/commands.{ts|js}`
|
|
128
113
|
|
|
129
114
|
```typescript
|
|
130
115
|
import 'temp-disposable-email/cypress';
|
|
@@ -166,7 +151,7 @@ it('[Custom Command] - Sign up - Check email content and subject', () => {
|
|
|
166
151
|
});
|
|
167
152
|
```
|
|
168
153
|
|
|
169
|
-
###
|
|
154
|
+
### **Node Example**
|
|
170
155
|
|
|
171
156
|
Here's a complete example of creating an inbox, retrieving a message, and deleting the account:
|
|
172
157
|
|
|
@@ -196,7 +181,7 @@ run();
|
|
|
196
181
|
|
|
197
182
|
<p id="doc"></p>
|
|
198
183
|
|
|
199
|
-
## API Documentation
|
|
184
|
+
## ๐ API Documentation
|
|
200
185
|
|
|
201
186
|
### `generateEmail(prefix?: string): Promise<string>`
|
|
202
187
|
|
|
@@ -205,22 +190,41 @@ run();
|
|
|
205
190
|
- `prefix` (Optional): A custom prefix for the email address.
|
|
206
191
|
- **Returns**: A promise that resolves to the generated email address.
|
|
207
192
|
|
|
193
|
+
```json
|
|
194
|
+
{
|
|
195
|
+
emailAddress: string;
|
|
196
|
+
accountId: string;
|
|
197
|
+
}
|
|
198
|
+
```
|
|
199
|
+
|
|
208
200
|
### `getRecentEmail(options?: GetEmailOptions): Promise<any | null>`
|
|
209
201
|
|
|
210
202
|
- **Description**: Retrieves the latest message from the inbox, polling if necessary.
|
|
211
203
|
- **Parameters**:
|
|
212
204
|
- `options` (Optional): Polling configuration for waiting for messages. See GetEmailOptions.
|
|
205
|
+
- `maxWaitTime` (Optional): The maximum time to wait for messages (in milliseconds).
|
|
206
|
+
- `waitInterval` (Optional): The interval between polling attempts (in milliseconds).
|
|
207
|
+
- `logPolling` (Optional): Whether to log each polling attempt for debugging purposes.
|
|
208
|
+
- `deleteAfterRead` (Optional): Whether to delete messages after reading
|
|
213
209
|
- **Returns**: A promise that resolves to the message content (or `null` if no messages are found).
|
|
214
210
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
211
|
+
```json
|
|
212
|
+
{
|
|
213
|
+
from: { address: string };
|
|
214
|
+
to: { address: string }[];
|
|
215
|
+
subject: string;
|
|
216
|
+
intro: string;
|
|
217
|
+
text: string;
|
|
218
|
+
html: string[];
|
|
219
|
+
createdAt: string;
|
|
220
|
+
updatedAt: string;
|
|
221
|
+
attachments: {
|
|
222
|
+
title: string;
|
|
223
|
+
data: Buffer;
|
|
224
|
+
}[];
|
|
225
|
+
}
|
|
226
|
+
```
|
|
223
227
|
|
|
224
|
-
## License
|
|
228
|
+
## ๐ License
|
|
225
229
|
|
|
226
230
|
This project is licensed under the MIT License.
|
package/dist/cjs/api.d.ts
CHANGED
|
@@ -73,7 +73,7 @@ interface EmailResource {
|
|
|
73
73
|
updatedAt: string;
|
|
74
74
|
accountId: string;
|
|
75
75
|
}
|
|
76
|
-
export declare const authenticate: (
|
|
76
|
+
export declare const authenticate: (_email: string, _password: string) => Promise<void>;
|
|
77
77
|
export declare const getAuthHeaders: () => {
|
|
78
78
|
accept: string;
|
|
79
79
|
Authorization: string;
|
|
@@ -86,7 +86,7 @@ export declare const deleteMessage: (messageId: string) => Promise<number>;
|
|
|
86
86
|
export declare const createAccount: (payload: {
|
|
87
87
|
address: string;
|
|
88
88
|
password: string;
|
|
89
|
-
}) => Promise<EmailAccount>;
|
|
90
|
-
export declare const deleteAccount: (accountId: string) => Promise<
|
|
89
|
+
}, maxRetries?: number, delayMs?: number) => Promise<EmailAccount>;
|
|
90
|
+
export declare const deleteAccount: (accountId: string) => Promise<void>;
|
|
91
91
|
export {};
|
|
92
92
|
//# sourceMappingURL=api.d.ts.map
|
package/dist/cjs/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":"AAGA,UAAU,YAAY;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":"AAGA,UAAU,YAAY;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,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Y,CAiBtB,CAAC;AAGF,eAAO,MAAM,aAAa,cAAqB,MAAM,KAAG,OAAO,CAAC,IAAI,CASnE,CAAC"}
|
package/dist/cjs/api.js
CHANGED
|
@@ -6,12 +6,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.deleteAccount = exports.createAccount = exports.deleteMessage = exports.getMessageAttachments = exports.getMessagesContent = exports.getMessages = exports.getDomains = exports.getAuthHeaders = exports.authenticate = void 0;
|
|
7
7
|
const axios_1 = __importDefault(require("axios"));
|
|
8
8
|
const _1 = require(".");
|
|
9
|
+
// Store token and credentials globally
|
|
9
10
|
let token = null;
|
|
11
|
+
let email;
|
|
12
|
+
let password;
|
|
10
13
|
const apiClient = axios_1.default.create({
|
|
11
14
|
baseURL: 'https://api.mail.tm',
|
|
12
15
|
headers: { accept: 'application/json' },
|
|
13
16
|
});
|
|
14
|
-
|
|
17
|
+
// Function to authenticate and get a new token
|
|
18
|
+
const authenticate = async (_email, _password) => {
|
|
19
|
+
email = _email;
|
|
20
|
+
password = _password;
|
|
15
21
|
const response = await apiClient.post('/token', { address: email, password }, {
|
|
16
22
|
headers: {
|
|
17
23
|
accept: 'application/json',
|
|
@@ -21,6 +27,7 @@ const authenticate = async (email, password) => {
|
|
|
21
27
|
token = response.data.token;
|
|
22
28
|
};
|
|
23
29
|
exports.authenticate = authenticate;
|
|
30
|
+
// Function to get auth headers
|
|
24
31
|
const getAuthHeaders = () => {
|
|
25
32
|
if (!token) {
|
|
26
33
|
throw new Error('Authentication required. Token not found.');
|
|
@@ -31,6 +38,22 @@ const getAuthHeaders = () => {
|
|
|
31
38
|
};
|
|
32
39
|
};
|
|
33
40
|
exports.getAuthHeaders = getAuthHeaders;
|
|
41
|
+
// Axios interceptor to handle 401 errors and refresh token
|
|
42
|
+
apiClient.interceptors.response.use((response) => response, async (error) => {
|
|
43
|
+
if (error.response?.status === 401 && token) {
|
|
44
|
+
try {
|
|
45
|
+
await (0, exports.authenticate)(email, password); // Get a new token
|
|
46
|
+
error.config.headers = (0, exports.getAuthHeaders)(); // Update headers with new token
|
|
47
|
+
return apiClient.request(error.config); // Retry request
|
|
48
|
+
}
|
|
49
|
+
catch (authError) {
|
|
50
|
+
console.error('Failed to refresh token:', authError);
|
|
51
|
+
throw new Error('Authentication failed. Please check credentials.');
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return Promise.reject(error);
|
|
55
|
+
});
|
|
56
|
+
// Function to fetch domains
|
|
34
57
|
const getDomains = async () => {
|
|
35
58
|
try {
|
|
36
59
|
const { data } = await apiClient.get('/domains', {
|
|
@@ -39,11 +62,12 @@ const getDomains = async () => {
|
|
|
39
62
|
return data;
|
|
40
63
|
}
|
|
41
64
|
catch (error) {
|
|
42
|
-
console.error('Error fetching domains:', error);
|
|
43
|
-
throw new Error('Failed to fetch
|
|
65
|
+
console.error('Error fetching domains:', error.response?.data);
|
|
66
|
+
throw new Error('Failed to fetch domains. Please try again later.');
|
|
44
67
|
}
|
|
45
68
|
};
|
|
46
69
|
exports.getDomains = getDomains;
|
|
70
|
+
// Function to fetch messages
|
|
47
71
|
const getMessages = async () => {
|
|
48
72
|
while (true) {
|
|
49
73
|
try {
|
|
@@ -57,13 +81,14 @@ const getMessages = async () => {
|
|
|
57
81
|
await (0, _1.delay)(10 * 1000);
|
|
58
82
|
}
|
|
59
83
|
else {
|
|
60
|
-
console.error('Error fetching messages:', error);
|
|
84
|
+
console.error('Error fetching messages:', error.response?.data);
|
|
61
85
|
throw new Error('Failed to fetch messages. Please try again later.');
|
|
62
86
|
}
|
|
63
87
|
}
|
|
64
88
|
}
|
|
65
89
|
};
|
|
66
90
|
exports.getMessages = getMessages;
|
|
91
|
+
// Function to fetch message content
|
|
67
92
|
const getMessagesContent = async (messageId) => {
|
|
68
93
|
try {
|
|
69
94
|
const { data } = await apiClient.get(`/messages/${messageId}`, {
|
|
@@ -72,24 +97,27 @@ const getMessagesContent = async (messageId) => {
|
|
|
72
97
|
return data;
|
|
73
98
|
}
|
|
74
99
|
catch (error) {
|
|
75
|
-
console.error(`Error fetching message content for ID ${messageId}:`, error.
|
|
100
|
+
console.error(`Error fetching message content for ID ${messageId}:`, error.response?.data);
|
|
76
101
|
throw new Error('Failed to fetch message content. Please try again later.');
|
|
77
102
|
}
|
|
78
103
|
};
|
|
79
104
|
exports.getMessagesContent = getMessagesContent;
|
|
105
|
+
// Function to fetch message attachments
|
|
80
106
|
const getMessageAttachments = async (messageId, attachmentsId) => {
|
|
81
107
|
try {
|
|
82
108
|
const { data } = await apiClient.get(`/messages/${messageId}/attachment/${attachmentsId}`, {
|
|
109
|
+
responseType: 'arraybuffer',
|
|
83
110
|
headers: (0, exports.getAuthHeaders)(),
|
|
84
111
|
});
|
|
85
112
|
return data;
|
|
86
113
|
}
|
|
87
114
|
catch (error) {
|
|
88
|
-
console.error(`Error fetching message attachment for ID ${messageId}:`, error);
|
|
89
|
-
throw new Error('Failed to fetch message
|
|
115
|
+
console.error(`Error fetching message attachment for ID ${messageId}:`, error.response?.data);
|
|
116
|
+
throw new Error('Failed to fetch message attachment. Please try again later.');
|
|
90
117
|
}
|
|
91
118
|
};
|
|
92
119
|
exports.getMessageAttachments = getMessageAttachments;
|
|
120
|
+
// Function to delete a message
|
|
93
121
|
const deleteMessage = async (messageId) => {
|
|
94
122
|
try {
|
|
95
123
|
const { status } = await apiClient.delete(`/messages/${messageId}`, {
|
|
@@ -98,28 +126,43 @@ const deleteMessage = async (messageId) => {
|
|
|
98
126
|
return status;
|
|
99
127
|
}
|
|
100
128
|
catch (error) {
|
|
101
|
-
console.error(`Error deleting message for ID ${messageId}:`, error);
|
|
102
|
-
throw new Error('Failed to
|
|
129
|
+
console.error(`Error deleting message for ID ${messageId}:`, error.response?.data);
|
|
130
|
+
throw new Error('Failed to delete message. Please try again later.');
|
|
103
131
|
}
|
|
104
132
|
};
|
|
105
133
|
exports.deleteMessage = deleteMessage;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
134
|
+
// Function to create an email account
|
|
135
|
+
const createAccount = async (payload, maxRetries = 5, delayMs = 6000) => {
|
|
136
|
+
for (let attempt = 1; attempt <= maxRetries; attempt++) {
|
|
137
|
+
try {
|
|
138
|
+
const { data } = await apiClient.post('/accounts', payload, {
|
|
139
|
+
headers: { accept: 'application/json' },
|
|
140
|
+
});
|
|
141
|
+
return data;
|
|
142
|
+
}
|
|
143
|
+
catch (error) {
|
|
144
|
+
if (attempt < maxRetries) {
|
|
145
|
+
await (0, _1.delay)(delayMs);
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
console.error('Max retries reached. Could not create account.');
|
|
149
|
+
throw new Error('Failed to create account after multiple attempts.');
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
throw new Error('Unexpected error in createAccount function.');
|
|
111
154
|
};
|
|
112
155
|
exports.createAccount = createAccount;
|
|
156
|
+
// Function to delete an account
|
|
113
157
|
const deleteAccount = async (accountId) => {
|
|
114
158
|
try {
|
|
115
|
-
|
|
159
|
+
await apiClient.delete(`/accounts/${accountId}`, {
|
|
116
160
|
headers: (0, exports.getAuthHeaders)(),
|
|
117
161
|
});
|
|
118
|
-
|
|
162
|
+
console.log(`Account ${accountId} deleted successfully.`);
|
|
119
163
|
}
|
|
120
164
|
catch (error) {
|
|
121
|
-
console.
|
|
122
|
-
throw new Error('Failed to fetch message content. Please try again later.');
|
|
165
|
+
console.warn(`Failed to delete account ${accountId}, ignoring error.`);
|
|
123
166
|
}
|
|
124
167
|
};
|
|
125
168
|
exports.deleteAccount = deleteAccount;
|
package/dist/cjs/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":";;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAkD;AAClD,wBAA0B;AA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,CAAC;gBACzB,MAAM,IAAA,QAAK,EAAC,OAAO,CAAC,CAAC;YACvB,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;gBAChE,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;YACvE,CAAC;QACH,CAAC;IACH,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;AACjE,CAAC,CAAC;AArBW,QAAA,aAAa,iBAqBxB;AAEF,gCAAgC;AACzB,MAAM,aAAa,GAAG,KAAK,EAAE,SAAiB,EAAiB,EAAE;IACtE,IAAI,CAAC;QACH,MAAM,SAAS,CAAC,MAAM,CAAC,aAAa,SAAS,EAAE,EAAE;YAC/C,OAAO,EAAE,IAAA,sBAAc,GAAE;SAC1B,CAAC,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,WAAW,SAAS,wBAAwB,CAAC,CAAC;IAC5D,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,IAAI,CAAC,4BAA4B,SAAS,mBAAmB,CAAC,CAAC;IACzE,CAAC;AACH,CAAC,CAAC;AATW,QAAA,aAAa,iBASxB"}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -15,6 +15,11 @@ export interface MessageContent {
|
|
|
15
15
|
html: string[];
|
|
16
16
|
createdAt: string;
|
|
17
17
|
updatedAt: string;
|
|
18
|
+
attachments: Attachment[];
|
|
19
|
+
}
|
|
20
|
+
interface Attachment {
|
|
21
|
+
title: string;
|
|
22
|
+
data: Buffer;
|
|
18
23
|
}
|
|
19
24
|
export interface GetEmailOptions {
|
|
20
25
|
maxWaitTime?: number;
|
|
@@ -71,4 +76,5 @@ export declare const getRecentEmail: (options?: GetEmailOptions) => Promise<Mess
|
|
|
71
76
|
* console.log(verificationCode); // Output: "123456"
|
|
72
77
|
*/
|
|
73
78
|
export declare const getVerificationCode: (text: string | undefined) => Promise<string>;
|
|
79
|
+
export {};
|
|
74
80
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB;AACD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1B,EAAE,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB;AACD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1B,EAAE,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B;AACD,UAAU,UAAU;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AACD,MAAM,WAAW,eAAe;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,eAAO,MAAM,KAAK,OAAQ,MAAM,KAAG,OAAO,CAAC,IAAI,CACI,CAAC;AAIpD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,aAAa,iBACV,MAAM,KACnB,OAAO,CAAC,cAAc,CA2BxB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,cAAc,aACf,eAAe,KACxB,OAAO,CAAC,cAAc,GAAG,IAAI,CAgF/B,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AAEH,eAAO,MAAM,mBAAmB,SACxB,MAAM,GAAG,SAAS,KACvB,OAAO,CAAC,MAAM,CAOhB,CAAC"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -79,7 +79,15 @@ const getRecentEmail = async (options) => {
|
|
|
79
79
|
const sortedMessages = messages.sort((a, b) => new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime());
|
|
80
80
|
const messageId = sortedMessages[0].id;
|
|
81
81
|
logger(`Found ${messageId}`);
|
|
82
|
-
const { from, to, subject, intro, text, html, createdAt, updatedAt } = await (0, api_2.getMessagesContent)(messageId);
|
|
82
|
+
const { from, to, subject, intro, text, html, createdAt, updatedAt, hasAttachments, attachments, } = await (0, api_2.getMessagesContent)(messageId);
|
|
83
|
+
const attachmentArray = [];
|
|
84
|
+
if (hasAttachments) {
|
|
85
|
+
for (const { id, filename } of attachments) {
|
|
86
|
+
logger(`Fetching attachment ID: ${id}`);
|
|
87
|
+
const attachmentData = await (0, api_1.getMessageAttachments)(messageId, id);
|
|
88
|
+
attachmentArray.push({ title: filename, data: attachmentData });
|
|
89
|
+
}
|
|
90
|
+
}
|
|
83
91
|
if (deleteAfterRead) {
|
|
84
92
|
await (0, api_2.deleteMessage)(messageId);
|
|
85
93
|
}
|
|
@@ -93,6 +101,7 @@ const getRecentEmail = async (options) => {
|
|
|
93
101
|
html,
|
|
94
102
|
createdAt,
|
|
95
103
|
updatedAt,
|
|
104
|
+
attachments: attachmentArray,
|
|
96
105
|
};
|
|
97
106
|
}
|
|
98
107
|
await new Promise((resolve) => setTimeout(resolve, waitInterval));
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,+
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,+BAA4D;AAC5D,+BAOe;AAEf,IAAI,SAAiB,CAAC;AA4Bf,MAAM,KAAK,GAAG,CAAC,EAAU,EAAiB,EAAE,CACjD,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AADvC,QAAA,KAAK,SACkC;AACpD,MAAM,kBAAkB,GAAG,GAAW,EAAE,CACtC,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAE9C;;;;;;;;;;;;;GAaG;AACI,MAAM,aAAa,GAAG,KAAK,EAChC,WAAoB,EACK,EAAE;IAC3B,MAAM,eAAe,GAAG,MAAM,IAAA,gBAAU,GAAE,CAAC;IAC3C,MAAM,OAAO,GAAG,eAAe;SAC5B,MAAM,CAAC,CAAC,MAA6B,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC;SAC1D,GAAG,CAAC,CAAC,MAA0B,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACtD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAEnE,MAAM,YAAY,GAAG,GAA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AS,CAAC,CAAC;YACjC,CAAC;YACD,MAAM,IAAA,mBAAa,EAAC,SAAS,CAAC,CAAC;YAE/B,OAAO;gBACL,IAAI,EAAE,IAAI;gBACV,EAAE,EAAE,EAAE;gBACN,OAAO;gBACP,KAAK;gBACL,IAAI;gBACJ,IAAI;gBACJ,SAAS;gBACT,SAAS;gBACT,WAAW,EAAE,eAAe;aAC7B,CAAC;QACJ,CAAC;QACD,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC;QAClE,MAAM,CAAC,kCAAkC,YAAY,GAAG,IAAI,aAAa,CAAC,CAAC;IAC7E,CAAC;IACD,MAAM,CACJ,sBACE,WAAW,GAAG,IAChB,sCAAsC,CACvC,CAAC;IACF,MAAM,IAAA,mBAAa,EAAC,SAAS,CAAC,CAAC;IAE/B,MAAM,IAAI,KAAK,CACb,gCAAgC,WAAW,GAAG,IAAI,kBAAkB,CACrE,CAAC;AACJ,CAAC,CAAC;AAlFW,QAAA,cAAc,kBAkFzB;AAEF;;;;;;;;;;;;;;GAcG;AAEI,MAAM,mBAAmB,GAAG,KAAK,EACtC,IAAwB,EACP,EAAE;IACnB,OAAO,CAAC,GAAG,CAAC,4DAA4D,CAAC,CAAC;IAC1E,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IACzC,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;AAC/E,CAAC,CAAC;AATW,QAAA,mBAAmB,uBAS9B"}
|
package/dist/esm/api.d.ts
CHANGED
|
@@ -73,7 +73,7 @@ interface EmailResource {
|
|
|
73
73
|
updatedAt: string;
|
|
74
74
|
accountId: string;
|
|
75
75
|
}
|
|
76
|
-
export declare const authenticate: (
|
|
76
|
+
export declare const authenticate: (_email: string, _password: string) => Promise<void>;
|
|
77
77
|
export declare const getAuthHeaders: () => {
|
|
78
78
|
accept: string;
|
|
79
79
|
Authorization: string;
|
|
@@ -86,7 +86,7 @@ export declare const deleteMessage: (messageId: string) => Promise<number>;
|
|
|
86
86
|
export declare const createAccount: (payload: {
|
|
87
87
|
address: string;
|
|
88
88
|
password: string;
|
|
89
|
-
}) => Promise<EmailAccount>;
|
|
90
|
-
export declare const deleteAccount: (accountId: string) => Promise<
|
|
89
|
+
}, maxRetries?: number, delayMs?: number) => Promise<EmailAccount>;
|
|
90
|
+
export declare const deleteAccount: (accountId: string) => Promise<void>;
|
|
91
91
|
export {};
|
|
92
92
|
//# sourceMappingURL=api.d.ts.map
|
package/dist/esm/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":"AAGA,UAAU,YAAY;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":"AAGA,UAAU,YAAY;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,aAAa;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,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1,17 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
import { delay } from '.';
|
|
3
|
+
// Store token and credentials globally
|
|
3
4
|
let token = null;
|
|
5
|
+
let email;
|
|
6
|
+
let password;
|
|
4
7
|
const apiClient = axios.create({
|
|
5
8
|
baseURL: 'https://api.mail.tm',
|
|
6
9
|
headers: { accept: 'application/json' },
|
|
7
10
|
});
|
|
8
|
-
|
|
11
|
+
// Function to authenticate and get a new token
|
|
12
|
+
export const authenticate = async (_email, _password) => {
|
|
13
|
+
email = _email;
|
|
14
|
+
password = _password;
|
|
9
15
|
const response = await apiClient.post('/token', { address: email, password }, {
|
|
10
16
|
headers: {
|
|
11
17
|
accept: 'application/json',
|
|
@@ -14,6 +20,7 @@ export const authenticate = async (email, password) => {
|
|
|
14
20
|
});
|
|
15
21
|
token = response.data.token;
|
|
16
22
|
};
|
|
23
|
+
// Function to get auth headers
|
|
17
24
|
export const getAuthHeaders = () => {
|
|
18
25
|
if (!token) {
|
|
19
26
|
throw new Error('Authentication required. Token not found.');
|
|
@@ -23,6 +30,22 @@ export const getAuthHeaders = () => {
|
|
|
23
30
|
Authorization: `Bearer ${token}`,
|
|
24
31
|
};
|
|
25
32
|
};
|
|
33
|
+
// Axios interceptor to handle 401 errors and refresh token
|
|
34
|
+
apiClient.interceptors.response.use((response) => response, async (error) => {
|
|
35
|
+
if (error.response?.status === 401 && token) {
|
|
36
|
+
try {
|
|
37
|
+
await authenticate(email, password); // Get a new token
|
|
38
|
+
error.config.headers = getAuthHeaders(); // Update headers with new token
|
|
39
|
+
return apiClient.request(error.config); // Retry request
|
|
40
|
+
}
|
|
41
|
+
catch (authError) {
|
|
42
|
+
console.error('Failed to refresh token:', authError);
|
|
43
|
+
throw new Error('Authentication failed. Please check credentials.');
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return Promise.reject(error);
|
|
47
|
+
});
|
|
48
|
+
// Function to fetch domains
|
|
26
49
|
export const getDomains = async () => {
|
|
27
50
|
try {
|
|
28
51
|
const { data } = await apiClient.get('/domains', {
|
|
@@ -31,10 +54,11 @@ export const getDomains = async () => {
|
|
|
31
54
|
return data;
|
|
32
55
|
}
|
|
33
56
|
catch (error) {
|
|
34
|
-
console.error('Error fetching domains:', error);
|
|
35
|
-
throw new Error('Failed to fetch
|
|
57
|
+
console.error('Error fetching domains:', error.response?.data);
|
|
58
|
+
throw new Error('Failed to fetch domains. Please try again later.');
|
|
36
59
|
}
|
|
37
60
|
};
|
|
61
|
+
// Function to fetch messages
|
|
38
62
|
export const getMessages = async () => {
|
|
39
63
|
while (true) {
|
|
40
64
|
try {
|
|
@@ -48,12 +72,13 @@ export const getMessages = async () => {
|
|
|
48
72
|
await delay(10 * 1000);
|
|
49
73
|
}
|
|
50
74
|
else {
|
|
51
|
-
console.error('Error fetching messages:', error);
|
|
75
|
+
console.error('Error fetching messages:', error.response?.data);
|
|
52
76
|
throw new Error('Failed to fetch messages. Please try again later.');
|
|
53
77
|
}
|
|
54
78
|
}
|
|
55
79
|
}
|
|
56
80
|
};
|
|
81
|
+
// Function to fetch message content
|
|
57
82
|
export const getMessagesContent = async (messageId) => {
|
|
58
83
|
try {
|
|
59
84
|
const { data } = await apiClient.get(`/messages/${messageId}`, {
|
|
@@ -62,22 +87,25 @@ export const getMessagesContent = async (messageId) => {
|
|
|
62
87
|
return data;
|
|
63
88
|
}
|
|
64
89
|
catch (error) {
|
|
65
|
-
console.error(`Error fetching message content for ID ${messageId}:`, error.
|
|
90
|
+
console.error(`Error fetching message content for ID ${messageId}:`, error.response?.data);
|
|
66
91
|
throw new Error('Failed to fetch message content. Please try again later.');
|
|
67
92
|
}
|
|
68
93
|
};
|
|
94
|
+
// Function to fetch message attachments
|
|
69
95
|
export const getMessageAttachments = async (messageId, attachmentsId) => {
|
|
70
96
|
try {
|
|
71
97
|
const { data } = await apiClient.get(`/messages/${messageId}/attachment/${attachmentsId}`, {
|
|
98
|
+
responseType: 'arraybuffer',
|
|
72
99
|
headers: getAuthHeaders(),
|
|
73
100
|
});
|
|
74
101
|
return data;
|
|
75
102
|
}
|
|
76
103
|
catch (error) {
|
|
77
|
-
console.error(`Error fetching message attachment for ID ${messageId}:`, error);
|
|
78
|
-
throw new Error('Failed to fetch message
|
|
104
|
+
console.error(`Error fetching message attachment for ID ${messageId}:`, error.response?.data);
|
|
105
|
+
throw new Error('Failed to fetch message attachment. Please try again later.');
|
|
79
106
|
}
|
|
80
107
|
};
|
|
108
|
+
// Function to delete a message
|
|
81
109
|
export const deleteMessage = async (messageId) => {
|
|
82
110
|
try {
|
|
83
111
|
const { status } = await apiClient.delete(`/messages/${messageId}`, {
|
|
@@ -86,26 +114,41 @@ export const deleteMessage = async (messageId) => {
|
|
|
86
114
|
return status;
|
|
87
115
|
}
|
|
88
116
|
catch (error) {
|
|
89
|
-
console.error(`Error deleting message for ID ${messageId}:`, error);
|
|
90
|
-
throw new Error('Failed to
|
|
117
|
+
console.error(`Error deleting message for ID ${messageId}:`, error.response?.data);
|
|
118
|
+
throw new Error('Failed to delete message. Please try again later.');
|
|
91
119
|
}
|
|
92
120
|
};
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
121
|
+
// Function to create an email account
|
|
122
|
+
export const createAccount = async (payload, maxRetries = 5, delayMs = 6000) => {
|
|
123
|
+
for (let attempt = 1; attempt <= maxRetries; attempt++) {
|
|
124
|
+
try {
|
|
125
|
+
const { data } = await apiClient.post('/accounts', payload, {
|
|
126
|
+
headers: { accept: 'application/json' },
|
|
127
|
+
});
|
|
128
|
+
return data;
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
if (attempt < maxRetries) {
|
|
132
|
+
await delay(delayMs);
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
console.error('Max retries reached. Could not create account.');
|
|
136
|
+
throw new Error('Failed to create account after multiple attempts.');
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
throw new Error('Unexpected error in createAccount function.');
|
|
98
141
|
};
|
|
142
|
+
// Function to delete an account
|
|
99
143
|
export const deleteAccount = async (accountId) => {
|
|
100
144
|
try {
|
|
101
|
-
|
|
145
|
+
await apiClient.delete(`/accounts/${accountId}`, {
|
|
102
146
|
headers: getAuthHeaders(),
|
|
103
147
|
});
|
|
104
|
-
|
|
148
|
+
console.log(`Account ${accountId} deleted successfully.`);
|
|
105
149
|
}
|
|
106
150
|
catch (error) {
|
|
107
|
-
console.
|
|
108
|
-
throw new Error('Failed to fetch message content. Please try again later.');
|
|
151
|
+
console.warn(`Failed to delete account ${accountId}, ignoring error.`);
|
|
109
152
|
}
|
|
110
153
|
};
|
|
111
154
|
//# sourceMappingURL=api.js.map
|
package/dist/esm/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC;AAmF1B,uCAAuC;AACvC,IAAI,KAAK,GAAkB,IAAI,CAAC;AAChC,IAAI,KAAa,CAAC;AAClB,IAAI,QAAgB,CAAC;AAErB,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC;IAC7B,OAAO,EAAE,qBAAqB;IAC9B,OAAO,EAAE,EAAE,MAAM,EAAE,kBAAkB,EAAE;CACxC,CAAC,CAAC;AAEH,+CAA+C;AAC/C,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAC/B,MAAc,EACd,SAAiB,EACF,EAAE;IACjB,KAAK,GAAG,MAAM,CAAC;IACf,QAAQ,GAAG,SAAS,CAAC;IACrB,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC,IAAI,CACnC,QAAQ,EACR,EAAE,OAAO,EAAE,KAAK,EAAE,Q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AmB,CAAC,CAAC;IACzE,CAAC;AACH,CAAC,CAAC"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -15,6 +15,11 @@ export interface MessageContent {
|
|
|
15
15
|
html: string[];
|
|
16
16
|
createdAt: string;
|
|
17
17
|
updatedAt: string;
|
|
18
|
+
attachments: Attachment[];
|
|
19
|
+
}
|
|
20
|
+
interface Attachment {
|
|
21
|
+
title: string;
|
|
22
|
+
data: Buffer;
|
|
18
23
|
}
|
|
19
24
|
export interface GetEmailOptions {
|
|
20
25
|
maxWaitTime?: number;
|
|
@@ -71,4 +76,5 @@ export declare const getRecentEmail: (options?: GetEmailOptions) => Promise<Mess
|
|
|
71
76
|
* console.log(verificationCode); // Output: "123456"
|
|
72
77
|
*/
|
|
73
78
|
export declare const getVerificationCode: (text: string | undefined) => Promise<string>;
|
|
79
|
+
export {};
|
|
74
80
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB;AACD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1B,EAAE,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB;AACD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1B,EAAE,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B;AACD,UAAU,UAAU;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AACD,MAAM,WAAW,eAAe;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,eAAO,MAAM,KAAK,OAAQ,MAAM,KAAG,OAAO,CAAC,IAAI,CACI,CAAC;AAIpD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,aAAa,iBACV,MAAM,KACnB,OAAO,CAAC,cAAc,CA2BxB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,cAAc,aACf,eAAe,KACxB,OAAO,CAAC,cAAc,GAAG,IAAI,CAgF/B,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AAEH,eAAO,MAAM,mBAAmB,SACxB,MAAM,GAAG,SAAS,KACvB,OAAO,CAAC,MAAM,CAOhB,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { authenticate } from './api';
|
|
1
|
+
import { authenticate, getMessageAttachments } from './api';
|
|
2
2
|
import { createAccount, deleteAccount, deleteMessage, getDomains, getMessages, getMessagesContent, } from './api';
|
|
3
3
|
let accountId;
|
|
4
4
|
export const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
@@ -74,7 +74,15 @@ export const getRecentEmail = async (options) => {
|
|
|
74
74
|
const sortedMessages = messages.sort((a, b) => new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime());
|
|
75
75
|
const messageId = sortedMessages[0].id;
|
|
76
76
|
logger(`Found ${messageId}`);
|
|
77
|
-
const { from, to, subject, intro, text, html, createdAt, updatedAt } = await getMessagesContent(messageId);
|
|
77
|
+
const { from, to, subject, intro, text, html, createdAt, updatedAt, hasAttachments, attachments, } = await getMessagesContent(messageId);
|
|
78
|
+
const attachmentArray = [];
|
|
79
|
+
if (hasAttachments) {
|
|
80
|
+
for (const { id, filename } of attachments) {
|
|
81
|
+
logger(`Fetching attachment ID: ${id}`);
|
|
82
|
+
const attachmentData = await getMessageAttachments(messageId, id);
|
|
83
|
+
attachmentArray.push({ title: filename, data: attachmentData });
|
|
84
|
+
}
|
|
85
|
+
}
|
|
78
86
|
if (deleteAfterRead) {
|
|
79
87
|
await deleteMessage(messageId);
|
|
80
88
|
}
|
|
@@ -88,6 +96,7 @@ export const getRecentEmail = async (options) => {
|
|
|
88
96
|
html,
|
|
89
97
|
createdAt,
|
|
90
98
|
updatedAt,
|
|
99
|
+
attachments: attachmentArray,
|
|
91
100
|
};
|
|
92
101
|
}
|
|
93
102
|
await new Promise((resolve) => setTimeout(resolve, waitInterval));
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAC;AAC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