@clearoutio/clearout
Advanced tools
Comparing version 1.1.4 to 1.1.5
@@ -14,3 +14,3 @@ { | ||
], | ||
"program": "${workspaceFolder}/co_app.js" | ||
"program": "${workspaceFolder}/app.js" | ||
}, | ||
@@ -24,3 +24,3 @@ { | ||
], | ||
"program": "${workspaceFolder}/co_app.mjs" | ||
"program": "${workspaceFolder}/app.mjs" | ||
}, | ||
@@ -27,0 +27,0 @@ { |
@@ -77,4 +77,14 @@ const FormData = require('form-data') | ||
} | ||
// Cancel Bulk Finder List | ||
async cancelBulkFinderList(params) { | ||
try { | ||
const result = await this._client.getClient().then(client => client.cancelBulkFinderList(null, { list_id: params.list_id })) | ||
return helpers.handleResult(result) | ||
} catch (error) { | ||
throw helpers.handleError(error) | ||
} | ||
} | ||
} | ||
module.exports = EmailFinder |
@@ -69,2 +69,12 @@ const FormData = require('form-data') | ||
// Cancel Bulk Verify List | ||
async cancelBulkVerifyList(params) { | ||
try { | ||
const result = await this._client.getClient().then(client => client.cancelBulkVerifyList(null, { list_id: params.list_id })) | ||
return helpers.handleResult(result) | ||
} catch (error) { | ||
throw helpers.handleError(error) | ||
} | ||
} | ||
// Catch-All Verify | ||
@@ -71,0 +81,0 @@ async verifyCatchAllEmails(params) { |
@@ -15,2 +15,4 @@ const OpenAPIClientAxios = require('openapi-client-axios').default | ||
'Authorization': api_token, | ||
'Cache-Control': 'no-cache', | ||
'content-type': 'application/json;charset=UTF-8', | ||
} | ||
@@ -17,0 +19,0 @@ } |
{ | ||
"name": "@clearoutio/clearout", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"author": "Clearout <us@clearout.io> (https://clearout.io)", | ||
@@ -20,2 +20,4 @@ "deprecated": false, | ||
"email validation", | ||
"email verifier", | ||
"email validator", | ||
"email finder", | ||
@@ -30,2 +32,3 @@ "email discovery", | ||
"cleaning", | ||
"real time", | ||
"real time validation" | ||
@@ -32,0 +35,0 @@ ], |
@@ -1,7 +0,13 @@ | ||
# Clearout - A Node.js library | ||
# Clearout - An Official Email Verification and Email Finding Node.js Library | ||
The clearout node library provide convenient access to the Clearout REST API from applications written in server-side JavaScript to perform real-time, bulk email validation, email discovery. This programmatic interface will allow you to easily integrate into your use cases. Clearout infrastructure has been configured to retain **high throughput, security and high precision accuracy.** As long as credits are available in the account, you can perform clearout bulk verification or find support for any size list. | ||
The Clearout node library is a wrapper of the [Clearout REST API](https://docs.clearout.io/api-overview.html) and allows developers to write applications in server-side JavaScript to perform real-time, bulk email verification and discovery. This programmatic interface will allow you to easily integrate into your use cases such as | ||
- Avoid capturing bad email addresses in your forms, chats, or anywhere else where email is accepted. | ||
- Bulk email verification to remove invalid, dead and fake emails from your email lists | ||
- Email finder to build pre-verified & accurate B2B leads for cold outreach | ||
Clearout infrastructure has been designed to retain **high throughput, security and precision accuracy.** Bulk email verification or email finder support lists of any size, as long as credits are available in account | ||
## Documentation | ||
See the <a href="https://docs.clearout.io/api-overview.html" target="_blank"><span style="font-size:16px">Clearout API docs</span></a> to know RESTFul endpoints | ||
See the [`Clearout API docs`](https://docs.clearout.io/api-overview.html) to know RESTFul endpoints | ||
@@ -21,3 +27,3 @@ ## Requirements | ||
## Usage | ||
The package needs to be initialized with your Clearout's server app API token, which is available in the [`Clearout Apps Dashboard`](https://app.clearout.io/dashboard/apps). If you dont find server app, please create one and copy the API token | ||
The package needs to be initialized with your Clearout's server app API token, which is available in the [`Clearout Apps Dashboard`](https://app.clearout.io/dashboard/apps). If you don't find server app, please create one and copy the API token | ||
@@ -72,3 +78,3 @@ **Using as commonJS module with `Promise`:** | ||
| `timeout` | 130,000 ms (Email Verifier) <br/> 30,000 ms (Email Finder) | Maximum time each request can take in milliseconds | | ||
| `ignore_result` | `false` | Ignore result file even if its not downladed. Used when invoking list removal | | ||
| `ignore_result` | `false` | Ignore the result file, even if it's not downloaded. Used when invoking list removal | | ||
| `ignore_duplicate_file` | `'false'` | Whether to allow duplicate file upload based on file name and size. | | ||
@@ -78,3 +84,3 @@ | ||
### Error Handling | ||
All service methods return promise and throw an exception in case if the response status is failed, So the recommend approach would be to call service method in `try...catch` block | ||
All service methods return promise and throw an exception in case if the response status is failed, hence the recommended approach would be to call service method within a `try...catch` block | ||
@@ -98,3 +104,3 @@ ```js | ||
### Email Verification Service | ||
`clearout.emailVerifier` is ready to use object to host following methods that can be used to verify email address in real-time or to verify millions of email addresses from bulk file | ||
`clearout.emailVerifier` is a ready-to-use object that contains the methods for verifying email addresses in real-time and verifying millions of email addresses from a file | ||
@@ -104,9 +110,9 @@ | ||
| ------- | --------- | ----------- | -- | | ||
| `verify({email[, timeout]})` | `email:String` - Email address to verify <br/><br/> `timeout:Number` - Overriable optional param with default value 130000 ms | Object with verified result | Instant email verification method to return the current status of email address | | ||
| `bulkVerify({file[, optimize, ignore_duplicate_file]})` | `file:String` - Absolute filepath that contain email addresses to be upload<br/><br/> `optimize:String` - Can either be 'highest_accuracy' or 'fastest_turnaround'. If not specified default would be 'highest_accuracy' <br/> <br/> `ignore_duplicate_file:String` - Whether to allow file with the same name and size that match with your recent upload. If not specified by default 'false' | Object with list_id | Verify bulk email addresses through file upload | | ||
| `verify({email[, timeout]})` | `email:String` - Email address to verify <br/><br/> `timeout:Number` - Overridable optional param with default value 130000 ms | Object with verified result | Instant email verification method to return the current status of email address | | ||
| `bulkVerify({file[, optimize, ignore_duplicate_file]})` | `file:String` - Absolute file path containing email addresses to be uploaded<br/><br/> `optimize:String` - Can either be 'highest_accuracy' or 'fastest_turnaround'. If not specified, the default would be 'highest_accuracy' <br/> <br/> `ignore_duplicate_file:String` - Whether to allow files with the same name and size that match with your recent upload. If not specified by default 'false' | Object with list_id | Verify bulk email addresses through file upload | | ||
| `getBulkVerifyProgressStatus({list_id})` | `list_id:String ` - List id to know the current progress status | Object with list progress status | To know the current progress status of bulk verify request | ||
| `downloadBulkVerifyResult({list_id})` | `list_id:String` - List id to download the result | Object with downloaded URL of verified result | Download verified result of the list | | ||
| `removeBulkVerifyList({list_id[, ignore_result]})` | `list_id:String` - List id to remove <br/> <br/> `ignore_result:Boolean` - Overridable optional param with default true | Object with removed list details | Remove bulk verified list | | ||
| `downloadBulkVerifyResult({list_id})` | `list_id:String` - List id to download the result | Object with downloaded URL of verified result | Download verified result of the email list | | ||
| `removeBulkVerifyList({list_id[, ignore_result]})` | `list_id:String` - List id to remove <br/> <br/> `ignore_result:Boolean` - Overridable optional param with default true | Object with removed list details | Remove bulk verified email list | | ||
| `isCatchAllEmail({email[,timeout]})` | `email:String` - Email address to verify <br/><br/> `timeout:Number` - Overridable optional param with default 90,000 ms | Object with email address catch all status | To know email address is accept all email type of not | | ||
| `isDisposableEmail({email[, timeout]})` | `email:String` - Email address to verify, <br/><br/> `timeout:Number` - Overridable optional param with default 90,000 ms | Object with email address disposable status | To know email address is diposable or temporary | | ||
| `isDisposableEmail({email[, timeout]})` | `email:String` - Email address to verify, <br/><br/> `timeout:Number` - Overridable optional param with default 90,000 ms | Object with email address disposable status | To know email address is disposable or temporary | | ||
| `isBusinessEmail({email[, timeout]})` | `email:String` - Email address to verify <br/><br/> `timeout:Number` - Overridable optional param with default 90,000 ms | Object with email address business status | To know email address belong to work or business | | ||
@@ -119,3 +125,3 @@ | `isFreeEmail({email[, timeout]})` | `email:String` - Email address to verify, <br/> <br/> `timeout:Number` - Overridable optional param with default 90,000 ms | Object with email address free account status | To know email address belong to free email service providers | | ||
### Email Finder Service | ||
`clearout.emailFinder` is ready to use object to host following methods that can be used to find an email address in real-time or to find email addresses of prospects from bulk file | ||
`clearout.emailFinder` is ready to use object that has the following methods for finding an email address in real-time or to find email addresses of prospects from bulk file | ||
@@ -125,5 +131,5 @@ | ||
| ------------------- | ------------------ | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| `find({name,domain[, timeout,queue]})` | `name:String` - Person name<br/> `domain:String` - Person company name / domain<br/> <br/> `timeout:Number` - Overridable optional param with default 30,000 ms<br/> <br/> `queue:Boolean` - Flag to indicate whether email discovery can be performed in background even after the request timed out | Object with found email address or request queue id if request not fullfilled with in timeout | Instantly discover email address of any person giving their name and domain or company name | | ||
| `find({name,domain[, timeout,queue]})` | `name:String` - Person name<br/> `domain:String` - Person company name / domain<br/> <br/> `timeout:Number` - Overridable optional param with default 30,000 ms<br/> <br/> `queue:Boolean` - Flag to indicate whether email discovery can be performed in background even after the request timed out | Object with found email address or request queue id if request not fulfilled with in timeout | Instantly discover email address of any person giving their name and domain or company name | | ||
| `getStatus({qid})` | `qid:String` - Queue ID received as part of the instant email finder response object | Object with found email address or progress status | To know the email finder request status in queue | | ||
| `bulkFind({file,[, ignore_duplicate_file]})` | `file:FileObject` - Absolute filepath that contain person name and company name / domain to be upload <br/><br/> `ignore_duplicate_file:String` - Whether to allow file with the same name and size that match with your recent upload. If not specified by default 'false' | Object with file list id | File bulk email addresses through file upload | | ||
| `bulkFind({file,[, ignore_duplicate_file]})` | `file:FileObject` - Absolute file path that contains person name and company name / domain to be uploaded <br/><br/> `ignore_duplicate_file:String` - Whether to allow files with the same name and size that match with your recent upload. If not specified by default 'false' | Object with file list id | File bulk email addresses through file upload | | ||
| `getBulkFindProgressStatus({list_id})` | `list_id:String` - List id for which to know the current progress status | Object with bulk find email status | To know the current progress status of bulk email find request | | ||
@@ -182,3 +188,3 @@ | `downloadBulkFindResult({list_id})` | `list_id:String` - List id for result download | Object with downloaded URL of email finder result | Download email finder result of the list | | ||
Contributions welcome! Please reach out to `us@clearout.io` | ||
Contributions are welcome! Please reach out to `us@clearout.io` | ||
@@ -185,0 +191,0 @@ ## MIT License |
@@ -48,2 +48,7 @@ const _ = require('lodash') | ||
// Bulk Email Finder Cancel | ||
async cancelBulkFinderList({ list_id }) { | ||
return await this._clearoutOpenApiClient.emailFinder.cancelBulkFinderList({ list_id }) | ||
}, | ||
/** | ||
@@ -50,0 +55,0 @@ * @private |
@@ -42,2 +42,7 @@ const _ = require('lodash') | ||
// Bulk Verify Cancel | ||
async cancelBulkVerifyList({ list_id }) { | ||
return await this._clearoutOpenApiClient.emailVerify.cancelBulkVerifyList({ list_id }) | ||
}, | ||
// Catch-All Verify | ||
@@ -44,0 +49,0 @@ async isCatchAllEmail({ email, timeout }) { |
@@ -63,3 +63,2 @@ const config = require('config') | ||
.then(data => { | ||
// console.log(data) | ||
expect(data).toHaveProperty('list_id') | ||
@@ -85,3 +84,2 @@ }) | ||
.then(data => { | ||
// console.log(data); | ||
return expect(data).toHaveProperty('progress_status') | ||
@@ -107,3 +105,2 @@ }) | ||
.then(data => { | ||
// console.log(data); | ||
return expect(data).toHaveProperty('url') | ||
@@ -113,2 +110,26 @@ }) | ||
test('Bulk email Finder validation - list cancel', () => { | ||
const clearout = new Clearout(config.api_token, config.config); | ||
var file_name = 'ef_single_person.csv' | ||
return clearout.emailFinder.bulkFind({ | ||
file: DATA_FILEPATH + file_name, | ||
ignore_duplicate_file: 'true' | ||
}) | ||
.then(data => { | ||
expect(data).toHaveProperty('list_id') | ||
let params = { list_id: data.list_id } | ||
return params | ||
}) | ||
.then(async (params) => { | ||
await new Promise((resolve) => setTimeout(resolve, 5000)); | ||
return await clearout.emailFinder.cancelBulkFinderList(params) | ||
}) | ||
.then(data => { | ||
expect(data).toHaveProperty('list_id') | ||
return expect(data.name).toBe(file_name) | ||
}).catch(error => { | ||
return expect(error.code).toBe(1116) | ||
}) | ||
}) | ||
test('Bulk email finder - list removal with ignore result as true', () => { | ||
@@ -115,0 +136,0 @@ const clearout = new Clearout(config.api_token, config.config); |
@@ -27,3 +27,5 @@ const config = require('config') | ||
}) | ||
.then(data => expect(data).toHaveProperty('list_id')) | ||
.then(data => { | ||
expect(data).toHaveProperty('list_id') | ||
}) | ||
}) | ||
@@ -97,2 +99,27 @@ | ||
test('Bulk email verification - list cancel', () => { | ||
const clearout = new Clearout(config.api_token, config.config); | ||
var file_name = 'ev_yahoo_emails.csv' | ||
return clearout.emailVerifier.bulkVerify({ | ||
file: DATA_FILEPATH + file_name, | ||
optimize: 'highest_accuracy', | ||
ignore_duplicate_file: 'true' | ||
}) | ||
.then(data => { | ||
expect(data).toHaveProperty('list_id') | ||
let params = { list_id: data.list_id } | ||
return params | ||
}) | ||
.then(async (params) => { | ||
await new Promise((resolve) => setTimeout(resolve, 5000)); | ||
return await clearout.emailVerifier.cancelBulkVerifyList(params) | ||
}) | ||
.then(data => { | ||
expect(data).toHaveProperty('list_id') | ||
return expect(data.name).toBe(file_name) | ||
}).catch(error => { | ||
return expect(error.code).toBe(1116) | ||
}) | ||
}) | ||
test('Catch-All email verify', () => { | ||
@@ -99,0 +126,0 @@ //console.log(config.api_token) |
Sorry, the diff of this file is not supported yet
149620
30
1076
203