temp-disposable-email 1.7.0 → 1.9.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/CHANGELOG.md CHANGED
@@ -1,45 +1,50 @@
1
- # [1.7.0](https://github.com/pirasanthan-jesugeevegan/temp-disposable-email/compare/v1.6.0...v1.7.0) (2024-11-28)
1
+ # [1.9.0](https://github.com/pirasanthan-jesugeevegan/temp-disposable-email/compare/v1.8.0...v1.9.0) (2024-11-28)
2
2
 
3
3
 
4
4
  ### Features
5
5
 
6
- * update package configuration for CommonJS and ES module support, add new tsconfig for CommonJS ([d322290](https://github.com/pirasanthan-jesugeevegan/temp-disposable-email/commit/d322290fd9c192792b16de2547211b716123a9d4))
6
+ * update README with detailed package features, installation, usage, and API documentation ([06772db](https://github.com/pirasanthan-jesugeevegan/temp-disposable-email/commit/06772dbc82f6df4383d75e51078b8915f6f6c6df))
7
7
 
8
8
 
9
9
 
10
- # [1.6.0](https://github.com/pirasanthan-jesugeevegan/temp-disposable-email/compare/v1.5.0...v1.6.0) (2024-11-28)
10
+ # [1.8.0](https://github.com/pirasanthan-jesugeevegan/temp-disposable-email/compare/v1.6.4...v1.8.0) (2024-11-28)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * add skipLibCheck and exclude examples from TypeScript configuration ([5c220fd](https://github.com/pirasanthan-jesugeevegan/temp-disposable-email/commit/5c220fd8cc3a3abb8ff693c1410c29c29067f4ab))
11
16
 
12
17
 
13
18
  ### Features
14
19
 
15
- * update package version to 1.4.0, add tslib dependency, and modify tsconfig settings ([a6fc115](https://github.com/pirasanthan-jesugeevegan/temp-disposable-email/commit/a6fc115fa263909fbe346f0f86ae95c18b1bea08))
20
+ * add Cypress configuration and support for temporary email testing ([77b26a6](https://github.com/pirasanthan-jesugeevegan/temp-disposable-email/commit/77b26a680378d693e29dc8b5a984e686742f65e0))
16
21
 
17
22
 
18
23
 
19
- # [1.5.0](https://github.com/pirasanthan-jesugeevegan/temp-disposable-email/compare/v1.4.0...v1.5.0) (2024-11-28)
24
+ ## [1.6.4](https://github.com/pirasanthan-jesugeevegan/temp-disposable-email/compare/v1.6.3...v1.6.4) (2024-11-28)
20
25
 
21
26
 
22
- ### Features
27
+ ### Bug Fixes
23
28
 
24
- * change TypeScript module to 'nodenext' in tsconfig.json ([f62b842](https://github.com/pirasanthan-jesugeevegan/temp-disposable-email/commit/f62b842afe237c5c63a0931568ad46552f92d936))
29
+ * update BASE_URL in constant and simplify publish workflow ([35e4615](https://github.com/pirasanthan-jesugeevegan/temp-disposable-email/commit/35e4615498dad384b75ac226d3bd7fa82bc64ba9))
25
30
 
26
31
 
27
32
 
28
- # [1.4.0](https://github.com/pirasanthan-jesugeevegan/temp-disposable-email/compare/v1.3.0...v1.4.0) (2024-11-28)
33
+ ## [1.6.3](https://github.com/pirasanthan-jesugeevegan/temp-disposable-email/compare/v1.6.2...v1.6.3) (2024-11-28)
29
34
 
30
35
 
31
- ### Features
36
+ ### Bug Fixes
32
37
 
33
- * update TypeScript target to ES6 in tsconfig.json ([0edc477](https://github.com/pirasanthan-jesugeevegan/temp-disposable-email/commit/0edc477af52df30c15b251239d6befcb757f2ed3))
38
+ * update publish workflow to set BASE_URL and build before publishing ([3f0e0dd](https://github.com/pirasanthan-jesugeevegan/temp-disposable-email/commit/3f0e0dd22b43b36d3f7ffd2e4389da3f8f7ac3d4))
34
39
 
35
40
 
36
41
 
37
- # [1.3.0](https://github.com/pirasanthan-jesugeevegan/temp-disposable-email/compare/v1.2.0...v1.3.0) (2024-11-28)
42
+ ## [1.6.2](https://github.com/pirasanthan-jesugeevegan/temp-disposable-email/compare/v1.6.1...v1.6.2) (2024-11-28)
38
43
 
39
44
 
40
- ### Features
45
+ ### Bug Fixes
41
46
 
42
- * update TypeScript configuration to use ESNext module and add skipLibCheck option ([0ffa53a](https://github.com/pirasanthan-jesugeevegan/temp-disposable-email/commit/0ffa53aa3851d622b3a0bad5b2024b797966be8d))
47
+ * downgrade version to 1.6.0 in package-lock.json and update BASE_URL handling ([919c24e](https://github.com/pirasanthan-jesugeevegan/temp-disposable-email/commit/919c24e563a7541f2a4163f79f49bd6e545f9dd6))
43
48
 
44
49
 
45
50
 
package/README.md CHANGED
@@ -1 +1,155 @@
1
- # temp-disposable-email
1
+ # Temp Disposable Email
2
+
3
+ <span align="center">
4
+
5
+ [![npm version](https://badge.fury.io/js/temp-disposable-email.svg)](https://www.npmjs.com/package/gmail-tester)
6
+ ![NPM Downloads](https://img.shields.io/npm/d18m/temp-disposable-email)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8
+ ![GitHub stars](https://img.shields.io/github/stars/pirasanthan-jesugeevegan/temp-disposable-email?style=social)
9
+
10
+ </span>
11
+
12
+ 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.
13
+
14
+ ## Features
15
+
16
+ - **Create Inbox**: Generate a unique, random email address and create an inbox.
17
+ - **Fetch Messages**: Retrieve the latest messages from the inbox.
18
+ - **Read Message Content**: Get the content (HTML and text) of a specific message.
19
+ - **Delete Messages**: Delete a specific message from the inbox.
20
+ - **Delete Account**: Remove the temporary account after usage
21
+
22
+ ## Installation
23
+
24
+ You can install this package via npm:
25
+
26
+ ```bash
27
+ npm install temp-disposable-email
28
+ ```
29
+
30
+ ## Usage
31
+
32
+ ### 1\. Importing the package
33
+
34
+ To use the package, import the functions in your TypeScript or JavaScript project:
35
+
36
+ ```typescript
37
+ import { createInbox, getMessage, deleteAccount } from 'temp-disposable-email';
38
+ ```
39
+
40
+ ### 2\. Create an Inbox
41
+
42
+ This function creates a new disposable email account using a random username or a specified one. It also authenticates and generates a token for accessing messages.
43
+
44
+ ```typescript
45
+ const email = await createInbox(); // or pass a custom username
46
+ console.log('Created email address:', email);
47
+ ```
48
+
49
+ #### Parameters
50
+
51
+ - `username` (Optional): The username for the new email address. If not provided, a random username will be generated.
52
+
53
+ #### Returns
54
+
55
+ - `Promise<string>`: The generated email address.
56
+
57
+ ### 3\. Fetch Recent Email
58
+
59
+ 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.
60
+
61
+ ```typescript
62
+ const message = await getRecentEmail();
63
+ console.log('Message received:', message);
64
+ ```
65
+
66
+ #### Parameters
67
+
68
+ - `options` (Optional): Polling options that can include:
69
+ - `maxWaitTime`: Maximum polling time in milliseconds (default: 30,000ms).
70
+ - `waitInterval`: Interval between polling attempts in milliseconds (default: 2,000ms).
71
+ - `logPolling`: Enable or disable logging of polling attempts (default: false).
72
+ - `deleteAfterRead`: Whether to delete the latest message after reading, helpful for parallel run
73
+
74
+ #### Returns
75
+
76
+ - `Promise<object | null>`: An object containing email details like `from`, `to`, `subject`, `intro`, `text`, and `html`.
77
+
78
+ ### 4\. Delete the Created Account
79
+
80
+ Once you're done with the email inbox, you can delete the account to clean up resources.
81
+
82
+ ```typescript
83
+ await deleteAccount();
84
+ console.log('Account deleted');
85
+ ```
86
+
87
+ #### Returns
88
+
89
+ - `Promise<void>`: Resolves when the account is successfully deleted.
90
+
91
+ ## Example Workflow
92
+
93
+ Here's a complete example of creating an inbox, retrieving a message, and deleting the account:
94
+
95
+ ```typescript
96
+ import { createInbox, getMessage, deleteAccount } from 'temp-disposable-email';
97
+
98
+ async function run() {
99
+ try {
100
+ // Create a new inbox
101
+ const email = await createInbox();
102
+ console.log('Created email:', email);
103
+
104
+ // Get the first available message from the inbox
105
+ const message = await getMessage({
106
+ maxWaitTime: 50000,
107
+ waitInterval: 3000,
108
+ logPolling: true,
109
+ });
110
+ console.log('Received message:', message);
111
+
112
+ // Delete the inbox
113
+ await deleteAccount();
114
+ console.log('Account deleted successfully');
115
+ } catch (error) {
116
+ console.error('Error:', error.message);
117
+ }
118
+ }
119
+
120
+ run();
121
+ ```
122
+
123
+ ## API Documentation
124
+
125
+ ### `createInbox(username?: string): Promise<string>`
126
+
127
+ - **Description**: Creates a disposable inbox with a randomly generated or provided username.
128
+ - **Parameters**:
129
+ - `username` (Optional): A custom username for the email address.
130
+ - **Returns**: A promise that resolves to the generated email address.
131
+
132
+ ### `getRecentEmail(options?: GetEmailOptions): Promise<any | null>`
133
+
134
+ - **Description**: Retrieves the latest message from the inbox, polling if necessary.
135
+ - **Parameters**:
136
+ - `options` (Optional): Polling configuration for waiting for messages. See GetEmailOptions.
137
+ - **Returns**: A promise that resolves to the message content (or `null` if no messages are found).
138
+
139
+ ### `deleteAccount(): Promise<void>`
140
+
141
+ - **Description**: Deletes the inbox and its associated account.
142
+ - **Returns**: A promise that resolves when the account is successfully deleted.
143
+
144
+ ## Get Email Options
145
+
146
+ You can configure polling behavior by passing an options object to `getMessage`. The available options are:
147
+
148
+ - `maxWaitTime` (Optional): The maximum time to wait for messages (in milliseconds).
149
+ - `waitInterval` (Optional): The interval between polling attempts (in milliseconds).
150
+ - `logPolling` (Optional): Whether to log each polling attempt for debugging purposes.
151
+ - `deleteAfterRead` (Optional): Whether to delete messages after reading
152
+
153
+ ## License
154
+
155
+ This project is licensed under the MIT License.
@@ -0,0 +1,12 @@
1
+ import { defineConfig } from 'cypress';
2
+
3
+ export default defineConfig({
4
+ e2e: {
5
+ specPattern: 'examples/cypress/e2e/**/*.cy.ts',
6
+ supportFile: 'examples/cypress/support/e2e.ts',
7
+ fixturesFolder: 'examples/cypress/fixtures',
8
+ setupNodeEvents(on, config) {
9
+ // implement node event listeners here
10
+ },
11
+ },
12
+ });
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EACL,cAAc,EACd,aAAa,EACb,cAAc,EACd,eAAe,GAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EACL,cAAc,EACd,aAAa,EACb,cAAc,EACd,eAAe,GAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC"}
package/dist/cjs/index.js CHANGED
@@ -1,6 +1,41 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  Object.defineProperty(exports, "__esModule", { value: true });
3
36
  exports.getVerificationCode = exports.deleteMessage = exports.getRecentEmail = exports.deleteAccount = exports.createInbox = void 0;
37
+ const dotenv = __importStar(require("dotenv"));
38
+ dotenv.config();
4
39
  var accountService_1 = require("./services/accountService");
5
40
  Object.defineProperty(exports, "createInbox", { enumerable: true, get: function () { return accountService_1.createInbox; } });
6
41
  Object.defineProperty(exports, "deleteAccount", { enumerable: true, get: function () { return accountService_1.deleteAccount; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,4DAAuE;AAA9D,6GAAA,WAAW,OAAA;AAAE,+GAAA,aAAa,OAAA;AACnC,4DAKmC;AAJjC,gHAAA,cAAc,OAAA;AACd,+GAAA,aAAa,OAAA;AAIf,mEAAkE;AAAzD,0HAAA,mBAAmB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,4DAAuE;AAA9D,6GAAA,WAAW,OAAA;AAAE,+GAAA,aAAa,OAAA;AACnC,4DAKmC;AAJjC,gHAAA,cAAc,OAAA;AACd,+GAAA,aAAa,OAAA;AAIf,mEAAkE;AAAzD,0HAAA,mBAAmB,OAAA"}
@@ -1,2 +1,2 @@
1
- export declare const BASE_URL: string;
1
+ export declare const BASE_URL = "https://api.mail.tm";
2
2
  //# sourceMappingURL=constant.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constant.d.ts","sourceRoot":"","sources":["../../../src/utils/constant.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ,QAAkC,CAAC"}
1
+ {"version":3,"file":"constant.d.ts","sourceRoot":"","sources":["../../../src/utils/constant.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,wBAAwB,CAAC"}
@@ -1,40 +1,5 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
2
  Object.defineProperty(exports, "__esModule", { value: true });
36
3
  exports.BASE_URL = void 0;
37
- const dotenv = __importStar(require("dotenv"));
38
- dotenv.config();
39
- exports.BASE_URL = process.env?.['BASE_URL'] || '';
4
+ exports.BASE_URL = 'https://api.mail.tm';
40
5
  //# sourceMappingURL=constant.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constant.js","sourceRoot":"","sources":["../../../src/utils/constant.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAEH,QAAA,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC"}
1
+ {"version":3,"file":"constant.js","sourceRoot":"","sources":["../../../src/utils/constant.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG,qBAAqB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EACL,cAAc,EACd,aAAa,EACb,cAAc,EACd,eAAe,GAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EACL,cAAc,EACd,aAAa,EACb,cAAc,EACd,eAAe,GAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC"}
package/dist/esm/index.js CHANGED
@@ -1,3 +1,5 @@
1
+ import * as dotenv from 'dotenv';
2
+ dotenv.config();
1
3
  export { createInbox, deleteAccount } from './services/accountService';
2
4
  export { getRecentEmail, deleteMessage, } from './services/messageService';
3
5
  export { getVerificationCode } from './utils/getVerificationCode';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EACL,cAAc,EACd,aAAa,GAGd,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EACL,cAAc,EACd,aAAa,GAGd,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const BASE_URL: string;
1
+ export declare const BASE_URL = "https://api.mail.tm";
2
2
  //# sourceMappingURL=constant.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constant.d.ts","sourceRoot":"","sources":["../../../src/utils/constant.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ,QAAkC,CAAC"}
1
+ {"version":3,"file":"constant.d.ts","sourceRoot":"","sources":["../../../src/utils/constant.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,wBAAwB,CAAC"}
@@ -1,4 +1,2 @@
1
- import * as dotenv from 'dotenv';
2
- dotenv.config();
3
- export const BASE_URL = process.env?.['BASE_URL'] || '';
1
+ export const BASE_URL = 'https://api.mail.tm';
4
2
  //# sourceMappingURL=constant.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constant.js","sourceRoot":"","sources":["../../../src/utils/constant.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,MAAM,CAAC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC"}
1
+ {"version":3,"file":"constant.js","sourceRoot":"","sources":["../../../src/utils/constant.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,qBAAqB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "temp-disposable-email",
3
- "version": "1.7.0",
3
+ "version": "1.9.0",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.js",
6
6
  "exports": {
@@ -39,9 +39,11 @@
39
39
  "dependencies": {
40
40
  "axios": "^1.7.8",
41
41
  "dotenv": "^16.4.5",
42
+ "temp-disposable-email": "^1.6.4",
42
43
  "tslib": "^2.8.1"
43
44
  },
44
45
  "devDependencies": {
46
+ "@types/cypress": "^1.1.6",
45
47
  "@types/jest": "^29.5.14",
46
48
  "@types/node": "^22.10.0",
47
49
  "axios-mock-adapter": "^2.1.0",
package/src/index.ts CHANGED
@@ -1,3 +1,6 @@
1
+ import * as dotenv from 'dotenv';
2
+ dotenv.config();
3
+
1
4
  export { createInbox, deleteAccount } from './services/accountService';
2
5
  export {
3
6
  getRecentEmail,
@@ -1,4 +1 @@
1
- import * as dotenv from 'dotenv';
2
- dotenv.config();
3
-
4
- export const BASE_URL = process.env?.['BASE_URL'] || '';
1
+ export const BASE_URL = 'https://api.mail.tm';
package/tsconfig.cjs.json CHANGED
@@ -8,8 +8,9 @@
8
8
  "outDir": "./dist/cjs",
9
9
  "declaration": true,
10
10
  "declarationMap": true,
11
- "sourceMap": true
11
+ "sourceMap": true,
12
+ "skipLibCheck": true
12
13
  },
13
14
  "include": ["src/**/*"],
14
- "exclude": ["node_modules"]
15
+ "exclude": ["node_modules", "examples"]
15
16
  }
package/tsconfig.json CHANGED
@@ -8,8 +8,9 @@
8
8
  "outDir": "./dist/esm",
9
9
  "declaration": true,
10
10
  "declarationMap": true,
11
- "sourceMap": true
11
+ "sourceMap": true,
12
+ "skipLibCheck": true
12
13
  },
13
14
  "include": ["src/**/*"],
14
- "exclude": ["node_modules"]
15
+ "exclude": ["node_modules", "examples"]
15
16
  }