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 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
@@ -1,6 +1,7 @@
1
1
  import { defineConfig } from 'cypress';
2
2
 
3
3
  export default defineConfig({
4
+ defaultCommandTimeout: 60000,
4
5
  e2e: {
5
6
  specPattern: 'examples/cypress/e2e/**/*.cy.ts',
6
7
  supportFile: 'examples/cypress/support/e2e.ts',
@@ -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 | null>;
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,KACX,OAAO,CAAC,MAAM,GAAG,IAAI,CAQvB,CAAC"}
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
- console.warn('No verification code found in the provided email content.');
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,IAAY,EACY,EAAE;IAC1B,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,OAAO,CAAC,IAAI,CAAC,2DAA2D,CAAC,CAAC;IAC1E,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAVW,QAAA,mBAAmB,uBAU9B"}
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 | null>;
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,KACX,OAAO,CAAC,MAAM,GAAG,IAAI,CAQvB,CAAC"}
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
- console.warn('No verification code found in the provided email content.');
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,IAAY,EACY,EAAE;IAC1B,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,OAAO,CAAC,IAAI,CAAC,2DAA2D,CAAC,CAAC;IAC1E,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
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.5",
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.6.4",
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 | null> => {
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
- console.warn('No verification code found in the provided email content.');
26
- return null;
25
+ throw new Error('No verification code found in the provided email content.');
27
26
  };