temp-disposable-email 1.11.5 → 1.11.6
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 +10 -0
- package/cypress.config.ts +1 -0
- package/dist/cjs/utils/getVerificationCode.d.ts +1 -1
- package/dist/cjs/utils/getVerificationCode.d.ts.map +1 -1
- package/dist/cjs/utils/getVerificationCode.js +1 -2
- package/dist/cjs/utils/getVerificationCode.js.map +1 -1
- package/dist/esm/utils/getVerificationCode.d.ts +1 -1
- package/dist/esm/utils/getVerificationCode.d.ts.map +1 -1
- package/dist/esm/utils/getVerificationCode.js +1 -2
- package/dist/esm/utils/getVerificationCode.js.map +1 -1
- package/package.json +2 -2
- package/src/utils/getVerificationCode.ts +3 -4
package/README.md
CHANGED
|
@@ -129,6 +129,16 @@ console.log('Account deleted');
|
|
|
129
129
|
|
|
130
130
|
## Example Workflow
|
|
131
131
|
|
|
132
|
+
### Playwright Example
|
|
133
|
+
|
|
134
|
+
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).
|
|
135
|
+
|
|
136
|
+
### Cypress Example
|
|
137
|
+
|
|
138
|
+
For using temp-disposable-email with Cypress, see the example in the [Cypress folder](https://github.com/pirasanthan-jesugeevegan/temp-disposable-email/tree/master/examples/cypress).
|
|
139
|
+
|
|
140
|
+
### Node Example
|
|
141
|
+
|
|
132
142
|
Here's a complete example of creating an inbox, retrieving a message, and deleting the account:
|
|
133
143
|
|
|
134
144
|
```typescript
|
package/cypress.config.ts
CHANGED
|
@@ -13,5 +13,5 @@
|
|
|
13
13
|
* const verificationCode = await getVerificationCode(emailContent);
|
|
14
14
|
* console.log(verificationCode); // Output: "123456"
|
|
15
15
|
*/
|
|
16
|
-
export declare const getVerificationCode: (text: string) => Promise<string
|
|
16
|
+
export declare const getVerificationCode: (text: string | undefined) => Promise<string>;
|
|
17
17
|
//# sourceMappingURL=getVerificationCode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getVerificationCode.d.ts","sourceRoot":"","sources":["../../../src/utils/getVerificationCode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,eAAO,MAAM,mBAAmB,SACxB,MAAM,
|
|
1
|
+
{"version":3,"file":"getVerificationCode.d.ts","sourceRoot":"","sources":["../../../src/utils/getVerificationCode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,eAAO,MAAM,mBAAmB,SACxB,MAAM,GAAG,SAAS,KACvB,OAAO,CAAC,MAAM,CAOhB,CAAC"}
|
|
@@ -22,8 +22,7 @@ const getVerificationCode = async (text) => {
|
|
|
22
22
|
if (matches) {
|
|
23
23
|
return matches[0];
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
return null;
|
|
25
|
+
throw new Error('No verification code found in the provided email content.');
|
|
27
26
|
};
|
|
28
27
|
exports.getVerificationCode = getVerificationCode;
|
|
29
28
|
//# sourceMappingURL=getVerificationCode.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getVerificationCode.js","sourceRoot":"","sources":["../../../src/utils/getVerificationCode.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEI,MAAM,mBAAmB,GAAG,KAAK,EACtC,
|
|
1
|
+
{"version":3,"file":"getVerificationCode.js","sourceRoot":"","sources":["../../../src/utils/getVerificationCode.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;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"}
|
|
@@ -13,5 +13,5 @@
|
|
|
13
13
|
* const verificationCode = await getVerificationCode(emailContent);
|
|
14
14
|
* console.log(verificationCode); // Output: "123456"
|
|
15
15
|
*/
|
|
16
|
-
export declare const getVerificationCode: (text: string) => Promise<string
|
|
16
|
+
export declare const getVerificationCode: (text: string | undefined) => Promise<string>;
|
|
17
17
|
//# sourceMappingURL=getVerificationCode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getVerificationCode.d.ts","sourceRoot":"","sources":["../../../src/utils/getVerificationCode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,eAAO,MAAM,mBAAmB,SACxB,MAAM,
|
|
1
|
+
{"version":3,"file":"getVerificationCode.d.ts","sourceRoot":"","sources":["../../../src/utils/getVerificationCode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,eAAO,MAAM,mBAAmB,SACxB,MAAM,GAAG,SAAS,KACvB,OAAO,CAAC,MAAM,CAOhB,CAAC"}
|
|
@@ -19,7 +19,6 @@ export const getVerificationCode = async (text) => {
|
|
|
19
19
|
if (matches) {
|
|
20
20
|
return matches[0];
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
return null;
|
|
22
|
+
throw new Error('No verification code found in the provided email content.');
|
|
24
23
|
};
|
|
25
24
|
//# sourceMappingURL=getVerificationCode.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getVerificationCode.js","sourceRoot":"","sources":["../../../src/utils/getVerificationCode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,EACtC,
|
|
1
|
+
{"version":3,"file":"getVerificationCode.js","sourceRoot":"","sources":["../../../src/utils/getVerificationCode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,CAAC,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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "temp-disposable-email",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.6",
|
|
4
4
|
"description": "Generating Temporary email address for testing, retrieving email from the temporary email address",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"axios": "^1.7.8",
|
|
43
43
|
"dotenv": "^16.4.5",
|
|
44
|
-
"temp-disposable-email": "^1.
|
|
44
|
+
"temp-disposable-email": "^1.11.5",
|
|
45
45
|
"tslib": "^2.8.1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
@@ -15,13 +15,12 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
export const getVerificationCode = async (
|
|
18
|
-
text: string
|
|
19
|
-
): Promise<string
|
|
18
|
+
text: string | undefined
|
|
19
|
+
): Promise<string> => {
|
|
20
20
|
console.log('Extracting the verification code from the email content...');
|
|
21
21
|
const matches = text.match(/\b\d{5,}\b/);
|
|
22
22
|
if (matches) {
|
|
23
23
|
return matches[0];
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
return null;
|
|
25
|
+
throw new Error('No verification code found in the provided email content.');
|
|
27
26
|
};
|