Skip to content

Commit

Permalink
- Added support for Verifalia API v2.6
Browse files Browse the repository at this point in the history
- Added support for multiple CAPTCHA - Bot detection services.
- Added support for bearer token authentication and Multi-Factor authentication.
- Improved error handling: added support for parsing RFC-9457 `problem+json` responses and returning problem details in errors.
- Breaking change: the `invoke()` method in the `MultiplexedRestClient` class has been changed to accept instances of the new `RestRequest` class; if you're not using the `MultiplexedRestClient` class directly in your code, you won't be impacted by this change.
- Breaking change: the logic for `Authenticator` has been updated to accommodate bearer authentication and multi-factor authentication / TOTP; if you're not using a custom authentication method in your code, you won't be impacted by this change.
- Improved documentation.
  • Loading branch information
verifalia committed Apr 28, 2024
1 parent 3dec56d commit dc9b9a6
Show file tree
Hide file tree
Showing 152 changed files with 7,330 additions and 898 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
.rpt2_cache
package-lock.json
package-lock.json
.idea
251 changes: 182 additions & 69 deletions README.md

Large diffs are not rendered by default.

595 changes: 515 additions & 80 deletions browser/amd/verifalia.js

Large diffs are not rendered by default.

595 changes: 515 additions & 80 deletions browser/cjs/index.js

Large diffs are not rendered by default.

44 changes: 44 additions & 0 deletions browser/esm/RestRequest-90d7ab0c.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// (c) Verifalia - email verification service - https://verifalia.com
/**
* @license
* Verifalia - Email list cleaning and real-time email verification service
* https://verifalia.com/
* [email protected]
*
* Copyright (c) 2005-2024 Cobisi Research
*
* Cobisi Research
* Via Della Costituzione, 31
* 35010 Vigonza
* Italy - European Union
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
class RestRequest {
constructor(method, resource, params, data, configOverride) {
this.method = method;
this.resource = resource;
this.params = params;
this.data = data;
this.configOverride = configOverride;
}
}

export { RestRequest as R };
2 changes: 1 addition & 1 deletion browser/esm/VerifaliaRestClient.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export declare class VerifaliaRestClient {
* Default Verifalia base URIs for client-certificate authentication.
*/
private _baseCcaUris;
private _restClientfactory;
private readonly _restClientFactory;
/**
* Allows to manage the credits for the Verifalia account.
*/
Expand Down
2 changes: 1 addition & 1 deletion browser/esm/VerifaliaRestClient.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions browser/esm/VerifaliaRestClientConfiguration.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
*/
/// <reference types="node" />
import { KeyObject } from "tls";
import { Authenticator } from "./rest/security/Authenticator";
export interface VerifaliaRestClientConfiguration {
/**
* The username or the browser app key to use while authenticating to the Verifalia API, if
Expand Down Expand Up @@ -76,5 +77,6 @@ export interface VerifaliaRestClientConfiguration {
* Shared passphrase used for a single private key and/or a PFX.
*/
passphrase?: string;
authenticator?: Authenticator;
}
//# sourceMappingURL=VerifaliaRestClientConfiguration.d.ts.map
2 changes: 1 addition & 1 deletion browser/esm/VerifaliaRestClientConfiguration.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions browser/esm/credits/functions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// (c) Verifalia - email verification service - https://verifalia.com
import { __awaiter, __asyncGenerator, __await } from 'tslib';
import { R as RestRequest } from '../RestRequest-90d7ab0c.js';

/**
* @license
Expand Down Expand Up @@ -40,7 +41,7 @@ import { __awaiter, __asyncGenerator, __await } from 'tslib';
*/
const getCreditsBalance = (restClientFactory, cancellationToken) => __awaiter(void 0, void 0, void 0, function* () {
const restClient = restClientFactory.build();
return yield (yield restClient.invoke("GET", '/credits/balance', undefined, undefined, undefined, cancellationToken)).deserialize();
return yield (yield restClient.invoke(new RestRequest('GET', '/credits/balance'), cancellationToken)).deserialize();
});
/**
* Lists the daily usages of the credits for the Verifalia account.
Expand Down Expand Up @@ -72,7 +73,7 @@ function listCreditsDailyUsages(restClientFactory, options, cancellationToken) {
}
}
}
const response = yield __await(restClient.invoke('GET', `/credits/daily-usage`, params, undefined, undefined, cancellationToken));
const response = yield __await(restClient.invoke(new RestRequest('GET', `/credits/daily-usage`, params), cancellationToken));
// TODO: Check the response status code
listSegment = yield __await(response.deserialize());
for (const item of listSegment.data) {
Expand Down
2 changes: 1 addition & 1 deletion browser/esm/credits/functions/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 17 additions & 1 deletion browser/esm/email-validations/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,5 +254,21 @@ const ValidationPriority_Normal = 127;
* The highest possible relative processing priority (speed) for a validation job.
*/
const ValidationPriority_Highest = 255;
/**
* hCaptcha.
*/
const CaptchaProvider_HCaptcha = 'hCaptcha';
/**
* Google reCAPTCHA v2.
*/
const CaptchaProvider_ReCaptchaV2 = 'reCaptcha_v2';
/**
* Google reCAPTCHA v3.
*/
const CaptchaProvider_ReCaptchaV3 = 'reCaptcha_v3';
/**
* Cloudflare Turnstile.
*/
const CaptchaProvider_Turnstile = 'Turnstile';

export { DeduplicationMode_Off, DeduplicationMode_Relaxed, DeduplicationMode_Safe, QualityLevelName_Extreme, QualityLevelName_High, QualityLevelName_Standard, ValidationEntryClassification_Deliverable, ValidationEntryClassification_Risky, ValidationEntryClassification_Undeliverable, ValidationEntryClassification_Unknown, ValidationEntryStatus_AtSignNotFound, ValidationEntryStatus_CatchAllConnectionFailure, ValidationEntryStatus_CatchAllValidationTimeout, ValidationEntryStatus_DnsConnectionFailure, ValidationEntryStatus_DnsQueryTimeout, ValidationEntryStatus_DomainDoesNotExist, ValidationEntryStatus_DomainHasNullMx, ValidationEntryStatus_DomainIsMisconfigured, ValidationEntryStatus_DomainIsWellKnownDea, ValidationEntryStatus_DomainPartCompliancyFailure, ValidationEntryStatus_DoubleDotSequence, ValidationEntryStatus_Duplicate, ValidationEntryStatus_InvalidAddressLength, ValidationEntryStatus_InvalidCharacterInSequence, ValidationEntryStatus_InvalidEmptyQuotedWord, ValidationEntryStatus_InvalidFoldingWhiteSpaceSequence, ValidationEntryStatus_InvalidLocalPartLength, ValidationEntryStatus_InvalidWordBoundaryStart, ValidationEntryStatus_IspSpecificSyntaxFailure, ValidationEntryStatus_LocalEndPointRejected, ValidationEntryStatus_LocalPartIsWellKnownRoleAccount, ValidationEntryStatus_LocalSenderAddressRejected, ValidationEntryStatus_MailExchangerIsHoneypot, ValidationEntryStatus_MailExchangerIsParked, ValidationEntryStatus_MailExchangerIsWellKnownDea, ValidationEntryStatus_MailboxConnectionFailure, ValidationEntryStatus_MailboxDoesNotExist, ValidationEntryStatus_MailboxIsDea, ValidationEntryStatus_MailboxTemporarilyUnavailable, ValidationEntryStatus_MailboxValidationTimeout, ValidationEntryStatus_OverrideMatch, ValidationEntryStatus_ServerDoesNotSupportInternationalMailboxes, ValidationEntryStatus_ServerIsCatchAll, ValidationEntryStatus_ServerTemporaryUnavailable, ValidationEntryStatus_SmtpConnectionFailure, ValidationEntryStatus_SmtpConnectionTimeout, ValidationEntryStatus_SmtpDialogError, ValidationEntryStatus_Success, ValidationEntryStatus_UnacceptableDomainLiteral, ValidationEntryStatus_UnbalancedCommentParenthesis, ValidationEntryStatus_UnexpectedQuotedPairSequence, ValidationEntryStatus_UnhandledException, ValidationEntryStatus_UnmatchedQuotedPair, ValidationPriority_Highest, ValidationPriority_Lowest, ValidationPriority_Normal, ValidationStatus_Completed, ValidationStatus_Deleted, ValidationStatus_Expired, ValidationStatus_InProgress };
export { CaptchaProvider_HCaptcha, CaptchaProvider_ReCaptchaV2, CaptchaProvider_ReCaptchaV3, CaptchaProvider_Turnstile, DeduplicationMode_Off, DeduplicationMode_Relaxed, DeduplicationMode_Safe, QualityLevelName_Extreme, QualityLevelName_High, QualityLevelName_Standard, ValidationEntryClassification_Deliverable, ValidationEntryClassification_Risky, ValidationEntryClassification_Undeliverable, ValidationEntryClassification_Unknown, ValidationEntryStatus_AtSignNotFound, ValidationEntryStatus_CatchAllConnectionFailure, ValidationEntryStatus_CatchAllValidationTimeout, ValidationEntryStatus_DnsConnectionFailure, ValidationEntryStatus_DnsQueryTimeout, ValidationEntryStatus_DomainDoesNotExist, ValidationEntryStatus_DomainHasNullMx, ValidationEntryStatus_DomainIsMisconfigured, ValidationEntryStatus_DomainIsWellKnownDea, ValidationEntryStatus_DomainPartCompliancyFailure, ValidationEntryStatus_DoubleDotSequence, ValidationEntryStatus_Duplicate, ValidationEntryStatus_InvalidAddressLength, ValidationEntryStatus_InvalidCharacterInSequence, ValidationEntryStatus_InvalidEmptyQuotedWord, ValidationEntryStatus_InvalidFoldingWhiteSpaceSequence, ValidationEntryStatus_InvalidLocalPartLength, ValidationEntryStatus_InvalidWordBoundaryStart, ValidationEntryStatus_IspSpecificSyntaxFailure, ValidationEntryStatus_LocalEndPointRejected, ValidationEntryStatus_LocalPartIsWellKnownRoleAccount, ValidationEntryStatus_LocalSenderAddressRejected, ValidationEntryStatus_MailExchangerIsHoneypot, ValidationEntryStatus_MailExchangerIsParked, ValidationEntryStatus_MailExchangerIsWellKnownDea, ValidationEntryStatus_MailboxConnectionFailure, ValidationEntryStatus_MailboxDoesNotExist, ValidationEntryStatus_MailboxIsDea, ValidationEntryStatus_MailboxTemporarilyUnavailable, ValidationEntryStatus_MailboxValidationTimeout, ValidationEntryStatus_OverrideMatch, ValidationEntryStatus_ServerDoesNotSupportInternationalMailboxes, ValidationEntryStatus_ServerIsCatchAll, ValidationEntryStatus_ServerTemporaryUnavailable, ValidationEntryStatus_SmtpConnectionFailure, ValidationEntryStatus_SmtpConnectionTimeout, ValidationEntryStatus_SmtpDialogError, ValidationEntryStatus_Success, ValidationEntryStatus_UnacceptableDomainLiteral, ValidationEntryStatus_UnbalancedCommentParenthesis, ValidationEntryStatus_UnexpectedQuotedPairSequence, ValidationEntryStatus_UnhandledException, ValidationEntryStatus_UnmatchedQuotedPair, ValidationPriority_Highest, ValidationPriority_Lowest, ValidationPriority_Normal, ValidationStatus_Completed, ValidationStatus_Deleted, ValidationStatus_Expired, ValidationStatus_InProgress };
16 changes: 16 additions & 0 deletions browser/esm/email-validations/constants/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,4 +253,20 @@ export declare const ValidationPriority_Normal = 127;
* The highest possible relative processing priority (speed) for a validation job.
*/
export declare const ValidationPriority_Highest = 255;
/**
* hCaptcha.
*/
export declare const CaptchaProvider_HCaptcha = "hCaptcha";
/**
* Google reCAPTCHA v2.
*/
export declare const CaptchaProvider_ReCaptchaV2 = "reCaptcha_v2";
/**
* Google reCAPTCHA v3.
*/
export declare const CaptchaProvider_ReCaptchaV3 = "reCaptcha_v3";
/**
* Cloudflare Turnstile.
*/
export declare const CaptchaProvider_Turnstile = "Turnstile";
//# sourceMappingURL=index.d.ts.map
Loading

0 comments on commit dc9b9a6

Please sign in to comment.