temp-disposable-email 1.16.2 → 2.0.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/.eslintrc.json +28 -0
- package/.prettierignore +6 -0
- package/.prettierrc.json +10 -0
- package/README.md +40 -6
- package/dist/cjs/api.d.ts +5 -4
- package/dist/cjs/api.d.ts.map +1 -1
- package/dist/cjs/api.js +30 -15
- package/dist/cjs/api.js.map +1 -1
- package/dist/cjs/cypress.d.ts +20 -0
- package/dist/cjs/cypress.d.ts.map +1 -1
- package/dist/cjs/cypress.js +3 -0
- package/dist/cjs/cypress.js.map +1 -1
- package/dist/cjs/index.d.ts +7 -4
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +54 -39
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/playwright.d.ts +27 -0
- package/dist/cjs/playwright.d.ts.map +1 -0
- package/dist/cjs/playwright.js +29 -0
- package/dist/cjs/playwright.js.map +1 -0
- package/dist/esm/api.d.ts +5 -4
- package/dist/esm/api.d.ts.map +1 -1
- package/dist/esm/api.js +30 -15
- package/dist/esm/api.js.map +1 -1
- package/dist/esm/cypress.d.ts +20 -0
- package/dist/esm/cypress.d.ts.map +1 -1
- package/dist/esm/cypress.js +4 -1
- package/dist/esm/cypress.js.map +1 -1
- package/dist/esm/index.d.ts +7 -4
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +56 -39
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/playwright.d.ts +27 -0
- package/dist/esm/playwright.d.ts.map +1 -0
- package/dist/esm/playwright.js +25 -0
- package/dist/esm/playwright.js.map +1 -0
- package/package.json +14 -1
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"parser": "@typescript-eslint/parser",
|
|
3
|
+
"extends": [
|
|
4
|
+
"eslint:recommended",
|
|
5
|
+
"plugin:@typescript-eslint/recommended"
|
|
6
|
+
],
|
|
7
|
+
"parserOptions": {
|
|
8
|
+
"ecmaVersion": 2020,
|
|
9
|
+
"sourceType": "module"
|
|
10
|
+
},
|
|
11
|
+
"env": {
|
|
12
|
+
"node": true,
|
|
13
|
+
"es6": true
|
|
14
|
+
},
|
|
15
|
+
"rules": {
|
|
16
|
+
"no-console": "off",
|
|
17
|
+
"@typescript-eslint/no-explicit-any": "warn",
|
|
18
|
+
"@typescript-eslint/no-unused-vars": [
|
|
19
|
+
"error",
|
|
20
|
+
{
|
|
21
|
+
"argsIgnorePattern": "^_",
|
|
22
|
+
"varsIgnorePattern": "^_",
|
|
23
|
+
"caughtErrors": "all",
|
|
24
|
+
"caughtErrorsIgnorePattern": "^_"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
}
|
package/.prettierignore
ADDED
package/.prettierrc.json
ADDED
package/README.md
CHANGED
|
@@ -101,7 +101,28 @@ console.log('Message received:', message);
|
|
|
101
101
|
|
|
102
102
|
### **Playwright Example**
|
|
103
103
|
|
|
104
|
-
For using temp-disposable-email with Playwright,
|
|
104
|
+
For using temp-disposable-email with Playwright, you can use it directly or with fixtures.
|
|
105
|
+
|
|
106
|
+
#### Using Playwright Fixtures (Recommended)
|
|
107
|
+
|
|
108
|
+
```typescript
|
|
109
|
+
import { test, expect } from 'temp-disposable-email/playwright';
|
|
110
|
+
|
|
111
|
+
test('sign up flow', async ({ page, emailHelper }) => {
|
|
112
|
+
const { emailAddress, accountId } = await emailHelper.generateEmail();
|
|
113
|
+
|
|
114
|
+
// Your test code...
|
|
115
|
+
|
|
116
|
+
const email = await emailHelper.getRecentEmail({
|
|
117
|
+
accountId,
|
|
118
|
+
maxWaitTime: 50000
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
const code = await emailHelper.getVerificationCode(email?.text);
|
|
122
|
+
});
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
For complete examples, see the [Playwright folder](https://github.com/pirasanthan-jesugeevegan/temp-disposable-email/tree/master/examples/playwright).
|
|
105
126
|
|
|
106
127
|
### **Cypress Example**
|
|
107
128
|
|
|
@@ -109,19 +130,29 @@ For using temp-disposable-email with Cypress.
|
|
|
109
130
|
|
|
110
131
|
#### Import package
|
|
111
132
|
|
|
112
|
-
|
|
133
|
+
Import the package in your `support/commands.{ts|js}`:
|
|
113
134
|
|
|
114
135
|
```typescript
|
|
115
136
|
import 'temp-disposable-email/cypress';
|
|
116
137
|
```
|
|
117
138
|
|
|
118
|
-
|
|
139
|
+
#### TypeScript Setup
|
|
140
|
+
|
|
141
|
+
Add the type reference at the top of your test files:
|
|
142
|
+
|
|
143
|
+
```typescript
|
|
144
|
+
/// <reference types="temp-disposable-email/cypress" />
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
#### Example Test
|
|
148
|
+
|
|
149
|
+
See the complete example in the [Cypress folder](https://github.com/pirasanthan-jesugeevegan/temp-disposable-email/tree/master/examples/cypress).
|
|
119
150
|
|
|
120
151
|
```typescript
|
|
121
152
|
it('[Custom Command] - Sign up - Check email content and subject', () => {
|
|
122
153
|
// Create a dynamic email address
|
|
123
154
|
cy.generateEmail(`cypress_${Math.random().toString().substr(2, 9)}`).then(
|
|
124
|
-
({ emailAddress }) => {
|
|
155
|
+
({ emailAddress, accountId }) => {
|
|
125
156
|
// Navigate to the sign-up page
|
|
126
157
|
cy.visit('https://app.postdrop.io/signup');
|
|
127
158
|
|
|
@@ -135,6 +166,7 @@ it('[Custom Command] - Sign up - Check email content and subject', () => {
|
|
|
135
166
|
cy.contains('h1', 'Thanks for signing up!').should('be.visible');
|
|
136
167
|
// Fetch the verification email
|
|
137
168
|
cy.getRecentEmail({
|
|
169
|
+
accountId, // Pass accountId for proper cleanup
|
|
138
170
|
maxWaitTime: 80000,
|
|
139
171
|
waitInterval: 1000,
|
|
140
172
|
deleteAfterRead: true,
|
|
@@ -153,7 +185,7 @@ it('[Custom Command] - Sign up - Check email content and subject', () => {
|
|
|
153
185
|
|
|
154
186
|
### **Node Example**
|
|
155
187
|
|
|
156
|
-
Here's a complete example of creating an inbox, retrieving a message, and
|
|
188
|
+
Here's a complete example of creating an inbox, retrieving a message, and cleaning up:
|
|
157
189
|
|
|
158
190
|
```typescript
|
|
159
191
|
import { generateEmail, getRecentEmail } from 'temp-disposable-email';
|
|
@@ -161,11 +193,12 @@ import { generateEmail, getRecentEmail } from 'temp-disposable-email';
|
|
|
161
193
|
async function run() {
|
|
162
194
|
try {
|
|
163
195
|
// Create a new inbox
|
|
164
|
-
const { emailAddress } = await generateEmail();
|
|
196
|
+
const { emailAddress, accountId } = await generateEmail();
|
|
165
197
|
console.log('Created email:', emailAddress);
|
|
166
198
|
|
|
167
199
|
// Get the first available message from the inbox
|
|
168
200
|
const message = await getRecentEmail({
|
|
201
|
+
accountId, // Pass accountId for automatic cleanup
|
|
169
202
|
maxWaitTime: 50000,
|
|
170
203
|
waitInterval: 3000,
|
|
171
204
|
logPolling: true,
|
|
@@ -202,6 +235,7 @@ run();
|
|
|
202
235
|
- **Description**: Retrieves the latest message from the inbox, polling if necessary.
|
|
203
236
|
- **Parameters**:
|
|
204
237
|
- `options` (Optional): Polling configuration for waiting for messages. See GetEmailOptions.
|
|
238
|
+
- `accountId` (Optional): Account ID for cleanup after reading. **Recommended** to prevent resource leaks.
|
|
205
239
|
- `maxWaitTime` (Optional): The maximum time to wait for messages (in milliseconds).
|
|
206
240
|
- `waitInterval` (Optional): The interval between polling attempts (in milliseconds).
|
|
207
241
|
- `logPolling` (Optional): Whether to log each polling attempt for debugging purposes.
|
package/dist/cjs/api.d.ts
CHANGED
|
@@ -79,14 +79,15 @@ export declare const getAuthHeaders: () => {
|
|
|
79
79
|
Authorization: string;
|
|
80
80
|
};
|
|
81
81
|
export declare const getDomains: () => Promise<ListOfDomains[]>;
|
|
82
|
-
export declare const getMessages: () => Promise<EmailObject[]>;
|
|
82
|
+
export declare const getMessages: (maxRetries?: number, retryDelay?: number) => Promise<EmailObject[]>;
|
|
83
83
|
export declare const getMessagesContent: (messageId: string) => Promise<EmailResource>;
|
|
84
|
-
export declare const getMessageAttachments: (messageId: string, attachmentsId: string) => Promise<
|
|
85
|
-
export declare const deleteMessage: (messageId: string) => Promise<
|
|
84
|
+
export declare const getMessageAttachments: (messageId: string, attachmentsId: string) => Promise<Buffer>;
|
|
85
|
+
export declare const deleteMessage: (messageId: string) => Promise<number>;
|
|
86
86
|
export declare const createAccount: (payload: {
|
|
87
87
|
address: string;
|
|
88
88
|
password: string;
|
|
89
|
-
},
|
|
89
|
+
}, domain?: string, // Domain to use for fallback email generation
|
|
90
|
+
maxRetries?: number, delayMs?: number, infiniteRetry?: boolean) => Promise<EmailAccount>;
|
|
90
91
|
export declare const deleteAccount: (accountId: string) => Promise<void>;
|
|
91
92
|
export {};
|
|
92
93
|
//# 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;AAED,UAAU,aAAa;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,OAAO;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,WAAW;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,E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eAAO,MAAM,cAAc;;;CAQ1B,CAAC;AAoBF,eAAO,MAAM,UAAU,QAAa,OAAO,CAAC,aAAa,EAAE,CAS1D,CAAC;AAGF,eAAO,MAAM,WAAW,GACtB,mBAAc,EACd,mBAAkB,KACjB,OAAO,CAAC,WAAW,EAAE,CA4BvB,CAAC;AAGF,eAAO,MAAM,kBAAkB,GAC7B,WAAW,MAAM,KAChB,OAAO,CAAC,aAAa,CASvB,CAAC;AAGF,eAAO,MAAM,qBAAqB,GAChC,WAAW,MAAM,EACjB,eAAe,MAAM,KACpB,OAAO,CAAC,MAAM,CAehB,CAAC;AAGF,eAAO,MAAM,aAAa,GAAU,WAAW,MAAM,KAAG,OAAO,CAAC,MAAM,CAUrE,CAAC;AAGF,eAAO,MAAM,aAAa,GACxB,SAAS;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,EAC9C,SAAS,MAAM,EAAE,8CAA8C;AAC/D,mBAAe,EACf,gBAAc,EACd,uBAAqB,KACpB,OAAO,CAAC,YAAY,CA2CtB,CAAC;AAGF,eAAO,MAAM,aAAa,GAAU,WAAW,MAAM,KAAG,OAAO,CAAC,IAAI,CAQnE,CAAC"}
|
package/dist/cjs/api.js
CHANGED
|
@@ -41,7 +41,7 @@ apiClient.interceptors.response.use((response) => response, async (error) => {
|
|
|
41
41
|
error.config.headers = (0, exports.getAuthHeaders)(); // Update headers with new token
|
|
42
42
|
return apiClient.request(error.config); // Retry request
|
|
43
43
|
}
|
|
44
|
-
catch (
|
|
44
|
+
catch (_authError) {
|
|
45
45
|
throw new Error('Authentication failed. Please check credentials.');
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -55,29 +55,37 @@ const getDomains = async () => {
|
|
|
55
55
|
});
|
|
56
56
|
return data;
|
|
57
57
|
}
|
|
58
|
-
catch (
|
|
58
|
+
catch (_error) {
|
|
59
59
|
throw new Error('Failed to fetch domains. Please try again later.');
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
62
|
exports.getDomains = getDomains;
|
|
63
|
-
// Function to fetch messages
|
|
64
|
-
const getMessages = async () => {
|
|
65
|
-
|
|
63
|
+
// Function to fetch messages with retry logic and timeout
|
|
64
|
+
const getMessages = async (maxRetries = 5, retryDelay = 10000) => {
|
|
65
|
+
let attempt = 0;
|
|
66
|
+
while (attempt < maxRetries) {
|
|
66
67
|
try {
|
|
67
68
|
const { data } = await apiClient.get('/messages?page=1', {
|
|
68
69
|
headers: (0, exports.getAuthHeaders)(),
|
|
69
70
|
});
|
|
70
71
|
return data;
|
|
72
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
71
73
|
}
|
|
72
74
|
catch (error) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
attempt++;
|
|
76
|
+
if (error.response?.status === 429 && attempt < maxRetries) {
|
|
77
|
+
console.warn(`Rate limited. Retrying in ${retryDelay / 1000}s... (Attempt ${attempt}/${maxRetries})`);
|
|
78
|
+
await (0, _1.delay)(retryDelay);
|
|
79
|
+
}
|
|
80
|
+
else if (attempt >= maxRetries) {
|
|
81
|
+
throw new Error(`Failed to fetch messages after ${maxRetries} attempts. Please try again later.`);
|
|
75
82
|
}
|
|
76
83
|
else {
|
|
77
84
|
throw new Error('Failed to fetch messages. Please try again later.');
|
|
78
85
|
}
|
|
79
86
|
}
|
|
80
87
|
}
|
|
88
|
+
throw new Error('Failed to fetch messages after maximum retries.');
|
|
81
89
|
};
|
|
82
90
|
exports.getMessages = getMessages;
|
|
83
91
|
// Function to fetch message content
|
|
@@ -88,7 +96,7 @@ const getMessagesContent = async (messageId) => {
|
|
|
88
96
|
});
|
|
89
97
|
return data;
|
|
90
98
|
}
|
|
91
|
-
catch (
|
|
99
|
+
catch (_error) {
|
|
92
100
|
throw new Error('Failed to fetch message content. Please try again later.');
|
|
93
101
|
}
|
|
94
102
|
};
|
|
@@ -102,7 +110,7 @@ const getMessageAttachments = async (messageId, attachmentsId) => {
|
|
|
102
110
|
});
|
|
103
111
|
return data;
|
|
104
112
|
}
|
|
105
|
-
catch (
|
|
113
|
+
catch (_error) {
|
|
106
114
|
throw new Error('Failed to fetch message attachment. Please try again later.');
|
|
107
115
|
}
|
|
108
116
|
};
|
|
@@ -115,14 +123,15 @@ const deleteMessage = async (messageId) => {
|
|
|
115
123
|
});
|
|
116
124
|
return status;
|
|
117
125
|
}
|
|
118
|
-
catch (
|
|
119
|
-
console.warn(`Error deleting message for ID ${messageId}
|
|
126
|
+
catch (_error) {
|
|
127
|
+
console.warn(`Error deleting message for ID ${messageId}`);
|
|
128
|
+
return 0;
|
|
120
129
|
}
|
|
121
130
|
};
|
|
122
131
|
exports.deleteMessage = deleteMessage;
|
|
123
132
|
// Function to create an email account
|
|
124
|
-
const createAccount = async (payload,
|
|
125
|
-
delayMs = 6000, infiniteRetry = false // Optional: Keep retrying forever
|
|
133
|
+
const createAccount = async (payload, domain, // Domain to use for fallback email generation
|
|
134
|
+
maxRetries = 10, delayMs = 6000, infiniteRetry = false // Optional: Keep retrying forever
|
|
126
135
|
) => {
|
|
127
136
|
let attempt = 1;
|
|
128
137
|
while (attempt <= maxRetries || infiniteRetry) {
|
|
@@ -131,18 +140,24 @@ delayMs = 6000, infiniteRetry = false // Optional: Keep retrying forever
|
|
|
131
140
|
headers: { accept: 'application/json' },
|
|
132
141
|
});
|
|
133
142
|
return data;
|
|
143
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
134
144
|
}
|
|
135
145
|
catch (error) {
|
|
136
146
|
const status = error.response?.status;
|
|
137
147
|
const isNetworkError = error.code === 'ECONNABORTED' || !error.response;
|
|
138
148
|
if (status === 409 || status === 422) {
|
|
139
|
-
|
|
149
|
+
// Use provided domain or extract from original address
|
|
150
|
+
const domainToUse = domain || payload.address.split('@')[1];
|
|
151
|
+
payload.address = `${Date.now()}-${Math.floor(Math.random() * 100000)}@${domainToUse}`;
|
|
152
|
+
console.warn(`Address already exists or invalid. Retrying with: ${payload.address}`);
|
|
140
153
|
}
|
|
141
154
|
else if (status === 429) {
|
|
155
|
+
console.warn(`Rate limited. Waiting 30 seconds before retry... (Attempt ${attempt}/${maxRetries})`);
|
|
142
156
|
await (0, _1.delay)(30000);
|
|
143
157
|
}
|
|
144
158
|
else if (status === 500 || isNetworkError) {
|
|
145
159
|
const waitTime = Math.min(30000, delayMs * attempt);
|
|
160
|
+
console.warn(`Server error or network issue. Waiting ${waitTime / 1000}s... (Attempt ${attempt}/${maxRetries})`);
|
|
146
161
|
await (0, _1.delay)(waitTime);
|
|
147
162
|
}
|
|
148
163
|
else {
|
|
@@ -161,7 +176,7 @@ const deleteAccount = async (accountId) => {
|
|
|
161
176
|
headers: (0, exports.getAuthHeaders)(),
|
|
162
177
|
});
|
|
163
178
|
}
|
|
164
|
-
catch (
|
|
179
|
+
catch (_error) {
|
|
165
180
|
console.warn(`Failed to delete account ${accountId}, ignoring error.`);
|
|
166
181
|
}
|
|
167
182
|
};
|
package/dist/cjs/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAkD;AAClD,wBAA0B;AAmF1B,uCAAuC;AACvC,IAAI,KAAK,GAAkB,IAAI,CAAC;AAChC,IAAI,KAAa,CAAC;AAClB,IAAI,QAAgB,CAAC;AAErB,MAAM,SAAS,GAAG,eAAK,CAAC,MAAM,CAAC;IAC7B,OAAO,EAAE,qBAAqB;IAC9B,OAAO,EAAE,EAAE,MAAM,EAAE,kBAAkB,EAAE;CACxC,CAAC,CAAC;AAEH,+CAA+C;AACxC,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,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,E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B,CAAC,CAAC;IACzE,CAAC;AACH,CAAC,CAAC;AARW,QAAA,aAAa,iBAQxB"}
|
package/dist/cjs/cypress.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ declare global {
|
|
|
21
21
|
* Retrieves the latest message from the inbox.
|
|
22
22
|
*
|
|
23
23
|
* @param {GetEmailOptions} [options] - Optional settings for polling and deletion.
|
|
24
|
+
* @param {string} [options.accountId] - Account ID to cleanup after reading.
|
|
24
25
|
* @param {number} [options.maxWaitTime=30000] - Maximum time to wait for messages (in milliseconds). Default is 30 seconds.
|
|
25
26
|
* @param {number} [options.waitInterval=2000] - Time interval between polling attempts (in milliseconds). Default is 2 seconds.
|
|
26
27
|
* @param {boolean} [options.logPolling=false] - Whether to log polling attempts. Default is `false`.
|
|
@@ -56,6 +57,25 @@ declare global {
|
|
|
56
57
|
}
|
|
57
58
|
*/
|
|
58
59
|
getRecentEmail(options: GetEmailOptions): Chainable<MessageContent | null>;
|
|
60
|
+
/**
|
|
61
|
+
* Extracts a verification code from email content.
|
|
62
|
+
*
|
|
63
|
+
* This function scans the given text for a sequence of 5 or more
|
|
64
|
+
* consecutive digits and returns the first valid verification code.
|
|
65
|
+
*
|
|
66
|
+
* @param {string} text - The content of the email, typically the body or HTML.
|
|
67
|
+
* @returns {Promise<string>} The first verification code found.
|
|
68
|
+
*
|
|
69
|
+
* @throws {Error} If no valid verification code is found.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* cy.getRecentEmail().then((email) => {
|
|
73
|
+
* cy.getVerificationCode(email?.text).then((code) => {
|
|
74
|
+
* cy.log(code); // Output: "123456"
|
|
75
|
+
* });
|
|
76
|
+
* });
|
|
77
|
+
*/
|
|
78
|
+
getVerificationCode(text?: string): Chainable<string>;
|
|
59
79
|
}
|
|
60
80
|
}
|
|
61
81
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cypress.d.ts","sourceRoot":"","sources":["../../src/cypress.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EAEd,eAAe,
|
|
1
|
+
{"version":3,"file":"cypress.d.ts","sourceRoot":"","sources":["../../src/cypress.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EAEd,eAAe,EAGf,cAAc,EACf,MAAM,SAAS,CAAC;AAcjB,OAAO,CAAC,MAAM,CAAC;IAEb,UAAU,OAAO,CAAC;QAChB,UAAU,SAAS;YACjB;;;;;;;;;;;;;eAaG;YACH,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,cAAc,CAAC,CAAC;YAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAsCG;YACH,cAAc,CACZ,OAAO,EAAE,eAAe,GACvB,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;YAEpC;;;;;;;;;;;;;;;;;eAiBG;YACH,mBAAmB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;SACvD;KACF;CACF"}
|
package/dist/cjs/cypress.js
CHANGED
|
@@ -7,4 +7,7 @@ Cypress.Commands.add('generateEmail', function (prefix) {
|
|
|
7
7
|
Cypress.Commands.add('getRecentEmail', function (options) {
|
|
8
8
|
return cy.wrap((0, index_1.getRecentEmail)(options));
|
|
9
9
|
});
|
|
10
|
+
Cypress.Commands.add('getVerificationCode', function (text) {
|
|
11
|
+
return cy.wrap((0, index_1.getVerificationCode)(text));
|
|
12
|
+
});
|
|
10
13
|
//# sourceMappingURL=cypress.js.map
|
package/dist/cjs/cypress.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cypress.js","sourceRoot":"","sources":["../../src/cypress.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"cypress.js","sourceRoot":"","sources":["../../src/cypress.ts"],"names":[],"mappings":";;AAAA,mCAOiB;AAEjB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,eAAe,EAAE,UAAU,MAAe;IAC7D,OAAO,EAAE,CAAC,IAAI,CAAC,IAAA,qBAAa,EAAC,MAAM,CAAC,CAAC,CAAC;AACxC,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,gBAAgB,EAAE,UAAU,OAAwB;IACvE,OAAO,EAAE,CAAC,IAAI,CAAC,IAAA,sBAAc,EAAC,OAAO,CAAC,CAAC,CAAC;AAC1C,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,qBAAqB,EAAE,UAAU,IAAa;IACjE,OAAO,EAAE,CAAC,IAAI,CAAC,IAAA,2BAAmB,EAAC,IAAI,CAAC,CAAC,CAAC;AAC5C,CAAC,CAAC,CAAC"}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export interface MessageContent {
|
|
|
17
17
|
updatedAt: string;
|
|
18
18
|
attachments: Attachment[];
|
|
19
19
|
}
|
|
20
|
-
interface Attachment {
|
|
20
|
+
export interface Attachment {
|
|
21
21
|
title: string;
|
|
22
22
|
data: Buffer;
|
|
23
23
|
}
|
|
@@ -26,8 +26,10 @@ export interface GetEmailOptions {
|
|
|
26
26
|
waitInterval?: number;
|
|
27
27
|
logPolling?: boolean;
|
|
28
28
|
deleteAfterRead?: boolean;
|
|
29
|
+
accountId?: string;
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
+
declare const delay: (ms: number) => Promise<void>;
|
|
32
|
+
export { delay };
|
|
31
33
|
/**
|
|
32
34
|
* Creates a new email inbox with a unique address.
|
|
33
35
|
*
|
|
@@ -47,6 +49,7 @@ export declare const generateEmail: (emailPrefix?: string) => Promise<GeneratedE
|
|
|
47
49
|
* Retrieves the latest message from the inbox.
|
|
48
50
|
*
|
|
49
51
|
* @param {GetEmailOptions} [options] - Optional settings for polling and deletion.
|
|
52
|
+
* @param {string} [options.accountId] - Account ID to cleanup after reading. If not provided, account won't be deleted.
|
|
50
53
|
* @param {number} [options.maxWaitTime=30000] - Maximum time to wait for messages (in milliseconds). Default is 30 seconds.
|
|
51
54
|
* @param {number} [options.waitInterval=2000] - Time interval between polling attempts (in milliseconds). Default is 2 seconds.
|
|
52
55
|
* @param {boolean} [options.logPolling=false] - Whether to log polling attempts. Default is `false`.
|
|
@@ -56,7 +59,8 @@ export declare const generateEmail: (emailPrefix?: string) => Promise<GeneratedE
|
|
|
56
59
|
* @throws {Error} If no messages are available within the polling timeout or authentication fails.
|
|
57
60
|
*
|
|
58
61
|
* @example
|
|
59
|
-
* const
|
|
62
|
+
* const { accountId } = await generateEmail();
|
|
63
|
+
* const message = await getRecentEmail({ accountId, maxWaitTime: 5000, waitInterval: 1000, logPolling: true });
|
|
60
64
|
* console.log(message.subject); // Outputs: "Hello!"
|
|
61
65
|
*/
|
|
62
66
|
export declare const getRecentEmail: (options?: GetEmailOptions) => Promise<MessageContent | null>;
|
|
@@ -76,5 +80,4 @@ export declare const getRecentEmail: (options?: GetEmailOptions) => Promise<Mess
|
|
|
76
80
|
* console.log(verificationCode); // Output: "123456"
|
|
77
81
|
*/
|
|
78
82
|
export declare const getVerificationCode: (text: string | undefined) => Promise<string>;
|
|
79
|
-
export {};
|
|
80
83
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAUA,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,MAAM,WAAW,UAAU;IACzB,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;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,KAAK,GAAI,IAAI,MAAM,KAAG,OAAO,CAAC,IAAI,CACW,CAAC;AAKpD,OAAO,EAAE,KAAK,EAAE,CAAC;AAEjB;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,aAAa,GACxB,cAAc,MAAM,KACnB,OAAO,CAAC,cAAc,CA+BxB,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,cAAc,GACzB,UAAU,eAAe,KACxB,OAAO,CAAC,cAAc,GAAG,IAAI,CA4F/B,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AAEH,eAAO,MAAM,mBAAmB,GAC9B,MAAM,MAAM,GAAG,SAAS,KACvB,OAAO,CAAC,MAAM,CAYhB,CAAC"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getVerificationCode = exports.getRecentEmail = exports.generateEmail = exports.delay = void 0;
|
|
4
4
|
const api_1 = require("./api");
|
|
5
5
|
const api_2 = require("./api");
|
|
6
|
-
let accountId;
|
|
7
6
|
const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
8
7
|
exports.delay = delay;
|
|
9
8
|
const generateRandomName = () => Math.random().toString(36).substring(2, 15);
|
|
@@ -30,19 +29,21 @@ const generateEmail = async (emailPrefix) => {
|
|
|
30
29
|
throw new Error('No available domains.');
|
|
31
30
|
const emailAddress = `${emailPrefix || generateRandomName()}@${domains[0]}`;
|
|
32
31
|
const password = generateRandomName();
|
|
32
|
+
// eslint-disable-next-line no-constant-condition
|
|
33
33
|
while (true) {
|
|
34
34
|
try {
|
|
35
35
|
const accountResponse = await (0, api_2.createAccount)({
|
|
36
36
|
address: emailAddress,
|
|
37
37
|
password,
|
|
38
|
-
}
|
|
39
|
-
|
|
38
|
+
}, domains[0] // Pass the first active domain for fallback
|
|
39
|
+
);
|
|
40
40
|
await (0, api_1.authenticate)(emailAddress, password);
|
|
41
41
|
return { emailAddress, accountId: accountResponse.id };
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
42
43
|
}
|
|
43
44
|
catch (error) {
|
|
44
45
|
if (error.response?.status === 429) {
|
|
45
|
-
await
|
|
46
|
+
await delay(5 * 1000);
|
|
46
47
|
}
|
|
47
48
|
else {
|
|
48
49
|
throw error;
|
|
@@ -55,6 +56,7 @@ exports.generateEmail = generateEmail;
|
|
|
55
56
|
* Retrieves the latest message from the inbox.
|
|
56
57
|
*
|
|
57
58
|
* @param {GetEmailOptions} [options] - Optional settings for polling and deletion.
|
|
59
|
+
* @param {string} [options.accountId] - Account ID to cleanup after reading. If not provided, account won't be deleted.
|
|
58
60
|
* @param {number} [options.maxWaitTime=30000] - Maximum time to wait for messages (in milliseconds). Default is 30 seconds.
|
|
59
61
|
* @param {number} [options.waitInterval=2000] - Time interval between polling attempts (in milliseconds). Default is 2 seconds.
|
|
60
62
|
* @param {boolean} [options.logPolling=false] - Whether to log polling attempts. Default is `false`.
|
|
@@ -64,52 +66,62 @@ exports.generateEmail = generateEmail;
|
|
|
64
66
|
* @throws {Error} If no messages are available within the polling timeout or authentication fails.
|
|
65
67
|
*
|
|
66
68
|
* @example
|
|
67
|
-
* const
|
|
69
|
+
* const { accountId } = await generateEmail();
|
|
70
|
+
* const message = await getRecentEmail({ accountId, maxWaitTime: 5000, waitInterval: 1000, logPolling: true });
|
|
68
71
|
* console.log(message.subject); // Outputs: "Hello!"
|
|
69
72
|
*/
|
|
70
73
|
const getRecentEmail = async (options) => {
|
|
71
|
-
const { maxWaitTime = 30000, waitInterval = 2000, logPolling = false, deleteAfterRead = false, } = options || {};
|
|
74
|
+
const { maxWaitTime = 30000, waitInterval = 2000, logPolling = false, deleteAfterRead = false, accountId, } = options || {};
|
|
72
75
|
const startTime = Date.now();
|
|
73
76
|
const logger = (message) => logPolling && console.log(message);
|
|
74
77
|
logger(`Polling started with a timeout of ${maxWaitTime / 1000}sec and interval of ${waitInterval / 1000}sec.`);
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
const
|
|
88
|
-
|
|
78
|
+
try {
|
|
79
|
+
while (Date.now() - startTime < maxWaitTime) {
|
|
80
|
+
const messages = await (0, api_2.getMessages)();
|
|
81
|
+
if (messages.length > 0) {
|
|
82
|
+
logger(`Found ${messages.length} message(s), fetching details...`);
|
|
83
|
+
// Sort by newest first (descending order)
|
|
84
|
+
const sortedMessages = messages.sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime());
|
|
85
|
+
const messageId = sortedMessages[0].id;
|
|
86
|
+
logger(`Found ${messageId}`);
|
|
87
|
+
const { from, to, subject, intro, text, html, createdAt, updatedAt, hasAttachments, attachments, } = await (0, api_2.getMessagesContent)(messageId);
|
|
88
|
+
const attachmentArray = [];
|
|
89
|
+
if (hasAttachments) {
|
|
90
|
+
for (const { id, filename } of attachments) {
|
|
91
|
+
logger(`Fetching attachment ID: ${id}`);
|
|
92
|
+
const attachmentData = await (0, api_1.getMessageAttachments)(messageId, id);
|
|
93
|
+
attachmentArray.push({ title: filename, data: attachmentData });
|
|
94
|
+
}
|
|
89
95
|
}
|
|
96
|
+
if (deleteAfterRead) {
|
|
97
|
+
await (0, api_2.deleteMessage)(messageId);
|
|
98
|
+
logger(`Deleted message ${messageId}`);
|
|
99
|
+
}
|
|
100
|
+
return {
|
|
101
|
+
from: from,
|
|
102
|
+
to: to,
|
|
103
|
+
subject,
|
|
104
|
+
intro,
|
|
105
|
+
text,
|
|
106
|
+
html,
|
|
107
|
+
createdAt,
|
|
108
|
+
updatedAt,
|
|
109
|
+
attachments: attachmentArray,
|
|
110
|
+
};
|
|
90
111
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
112
|
+
await new Promise((resolve) => setTimeout(resolve, waitInterval));
|
|
113
|
+
logger(`No messages found, waiting for ${waitInterval / 1000} seconds...`);
|
|
114
|
+
}
|
|
115
|
+
logger(`Waiting timeout of ${maxWaitTime / 1000} seconds reached. No messages found.`);
|
|
116
|
+
throw new Error(`No messages available within ${maxWaitTime / 1000} seconds timeout`);
|
|
117
|
+
}
|
|
118
|
+
finally {
|
|
119
|
+
// Cleanup account if accountId is provided
|
|
120
|
+
if (accountId) {
|
|
94
121
|
await (0, api_2.deleteAccount)(accountId);
|
|
95
|
-
|
|
96
|
-
from: from,
|
|
97
|
-
to: to,
|
|
98
|
-
subject,
|
|
99
|
-
intro,
|
|
100
|
-
text,
|
|
101
|
-
html,
|
|
102
|
-
createdAt,
|
|
103
|
-
updatedAt,
|
|
104
|
-
attachments: attachmentArray,
|
|
105
|
-
};
|
|
122
|
+
logger(`Deleted account ${accountId}`);
|
|
106
123
|
}
|
|
107
|
-
await new Promise((resolve) => setTimeout(resolve, waitInterval));
|
|
108
|
-
logger(`No messages found, waiting for ${waitInterval / 1000} seconds...`);
|
|
109
124
|
}
|
|
110
|
-
logger(`Waiting timeout of ${maxWaitTime / 1000} seconds reached. No messages found.`);
|
|
111
|
-
await (0, api_2.deleteAccount)(accountId);
|
|
112
|
-
throw new Error(`No messages available within ${maxWaitTime / 1000} seconds timeout`);
|
|
113
125
|
};
|
|
114
126
|
exports.getRecentEmail = getRecentEmail;
|
|
115
127
|
/**
|
|
@@ -129,6 +141,9 @@ exports.getRecentEmail = getRecentEmail;
|
|
|
129
141
|
*/
|
|
130
142
|
const getVerificationCode = async (text) => {
|
|
131
143
|
console.log('Extracting the verification code from the email content...');
|
|
144
|
+
if (!text) {
|
|
145
|
+
throw new Error('No text provided to extract verification code from.');
|
|
146
|
+
}
|
|
132
147
|
const matches = text.match(/\b\d{5,}\b/);
|
|
133
148
|
if (matches) {
|
|
134
149
|
return matches[0];
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,+BAA4D;AAC5D,+BAOe;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,+BAA4D;AAC5D,+BAOe;AA6Bf,MAAM,KAAK,GAAG,CAAC,EAAU,EAAiB,EAAE,CAC1C,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAK3C,sBAAK;AAJd,MAAM,kBAAkB,GAAG,GAAW,EAAE,CACtC,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAK9C;;;;;;;;;;;;;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,Q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