Skip to content

Commit

Permalink
Added support for API v2.4
Browse files Browse the repository at this point in the history
Added support for new completion callback options
Added support for parked mail exchangers detection
Added support for specifying a custom wait time while submitting and retrieving email verification jobs
Breaking change: renamed WaitingStrategy into WaitOptions and refactored the latter so that it now allows to adjust the underlying polling wait times
Breaking change: the default job submission and retrieval behavior is now to wait for the completion of jobs (but it is possible to change that through the new WaitOptions class)
  • Loading branch information
verifalia committed Mar 2, 2023
1 parent a6ba894 commit 8b298f0
Show file tree
Hide file tree
Showing 216 changed files with 3,117 additions and 1,587 deletions.
361 changes: 229 additions & 132 deletions browser/amd/verifalia.js

Large diffs are not rendered by default.

360 changes: 229 additions & 131 deletions browser/cjs/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion browser/esm/VerifaliaRestClient.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* https://verifalia.com/
* [email protected]
*
* Copyright (c) 2005-2021 Cobisi Research
* Copyright (c) 2005-2023 Cobisi Research
*
* Cobisi Research
* Via Della Costituzione, 31
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: 1 addition & 1 deletion browser/esm/VerifaliaRestClientConfiguration.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* https://verifalia.com/
* [email protected]
*
* Copyright (c) 2005-2021 Cobisi Research
* Copyright (c) 2005-2023 Cobisi Research
*
* Cobisi Research
* Via Della Costituzione, 31
Expand Down
2 changes: 1 addition & 1 deletion browser/esm/common/CancellationToken.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* https://verifalia.com/
* [email protected]
*
* Copyright (c) 2005-2021 Cobisi Research
* Copyright (c) 2005-2023 Cobisi Research
*
* Cobisi Research
* Via Della Costituzione, 31
Expand Down
2 changes: 1 addition & 1 deletion browser/esm/common/DateUtils.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* https://verifalia.com/
* [email protected]
*
* Copyright (c) 2005-2021 Cobisi Research
* Copyright (c) 2005-2023 Cobisi Research
*
* Cobisi Research
* Via Della Costituzione, 31
Expand Down
2 changes: 1 addition & 1 deletion browser/esm/common/filters/DateBetweenPredicate.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* https://verifalia.com/
* [email protected]
*
* Copyright (c) 2005-2021 Cobisi Research
* Copyright (c) 2005-2023 Cobisi Research
*
* Cobisi Research
* Via Della Costituzione, 31
Expand Down
2 changes: 1 addition & 1 deletion browser/esm/common/filters/DateEqualityPredicate.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* https://verifalia.com/
* [email protected]
*
* Copyright (c) 2005-2021 Cobisi Research
* Copyright (c) 2005-2023 Cobisi Research
*
* Cobisi Research
* Via Della Costituzione, 31
Expand Down
2 changes: 1 addition & 1 deletion browser/esm/common/filters/DateFilterPredicate.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* https://verifalia.com/
* [email protected]
*
* Copyright (c) 2005-2021 Cobisi Research
* Copyright (c) 2005-2023 Cobisi Research
*
* Cobisi Research
* Via Della Costituzione, 31
Expand Down
2 changes: 1 addition & 1 deletion browser/esm/common/filters/FilterPredicate.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* https://verifalia.com/
* [email protected]
*
* Copyright (c) 2005-2021 Cobisi Research
* Copyright (c) 2005-2023 Cobisi Research
*
* Cobisi Research
* Via Della Costituzione, 31
Expand Down
2 changes: 1 addition & 1 deletion browser/esm/common/filters/FilterPredicateFragment.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* https://verifalia.com/
* [email protected]
*
* Copyright (c) 2005-2021 Cobisi Research
* Copyright (c) 2005-2023 Cobisi Research
*
* Cobisi Research
* Via Della Costituzione, 31
Expand Down
2 changes: 1 addition & 1 deletion browser/esm/common/models/ListSegment.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* https://verifalia.com/
* [email protected]
*
* Copyright (c) 2005-2021 Cobisi Research
* Copyright (c) 2005-2023 Cobisi Research
*
* Cobisi Research
* Via Della Costituzione, 31
Expand Down
2 changes: 1 addition & 1 deletion browser/esm/common/models/ListSegmentMeta.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* https://verifalia.com/
* [email protected]
*
* Copyright (c) 2005-2021 Cobisi Research
* Copyright (c) 2005-2023 Cobisi Research
*
* Cobisi Research
* Via Della Costituzione, 31
Expand Down
2 changes: 1 addition & 1 deletion browser/esm/common/models/ListingCursor.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* https://verifalia.com/
* [email protected]
*
* Copyright (c) 2005-2021 Cobisi Research
* Copyright (c) 2005-2023 Cobisi Research
*
* Cobisi Research
* Via Della Costituzione, 31
Expand Down
2 changes: 1 addition & 1 deletion browser/esm/common/models/ListingOptions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* https://verifalia.com/
* [email protected]
*
* Copyright (c) 2005-2021 Cobisi Research
* Copyright (c) 2005-2023 Cobisi Research
*
* Cobisi Research
* Via Della Costituzione, 31
Expand Down
2 changes: 1 addition & 1 deletion browser/esm/credits/CreditsRestClient.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* https://verifalia.com/
* [email protected]
*
* Copyright (c) 2005-2021 Cobisi Research
* Copyright (c) 2005-2023 Cobisi Research
*
* Cobisi Research
* Via Della Costituzione, 31
Expand Down
2 changes: 1 addition & 1 deletion browser/esm/credits/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { __awaiter, __asyncGenerator, __await } from 'tslib';
* https://verifalia.com/
* [email protected]
*
* Copyright (c) 2005-2021 Cobisi Research
* Copyright (c) 2005-2023 Cobisi Research
*
* Cobisi Research
* Via Della Costituzione, 31
Expand Down
2 changes: 1 addition & 1 deletion browser/esm/credits/functions/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* https://verifalia.com/
* [email protected]
*
* Copyright (c) 2005-2021 Cobisi Research
* Copyright (c) 2005-2023 Cobisi Research
*
* Cobisi Research
* Via Della Costituzione, 31
Expand Down
2 changes: 1 addition & 1 deletion browser/esm/credits/models/Balance.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* https://verifalia.com/
* [email protected]
*
* Copyright (c) 2005-2021 Cobisi Research
* Copyright (c) 2005-2023 Cobisi Research
*
* Cobisi Research
* Via Della Costituzione, 31
Expand Down
2 changes: 1 addition & 1 deletion browser/esm/credits/models/DailyUsage.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* https://verifalia.com/
* [email protected]
*
* Copyright (c) 2005-2021 Cobisi Research
* Copyright (c) 2005-2023 Cobisi Research
*
* Cobisi Research
* Via Della Costituzione, 31
Expand Down
2 changes: 1 addition & 1 deletion browser/esm/credits/models/DailyUsageListSegment.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* https://verifalia.com/
* [email protected]
*
* Copyright (c) 2005-2021 Cobisi Research
* Copyright (c) 2005-2023 Cobisi Research
*
* Cobisi Research
* Via Della Costituzione, 31
Expand Down
2 changes: 1 addition & 1 deletion browser/esm/credits/models/DailyUsageListingOptions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* https://verifalia.com/
* [email protected]
*
* Copyright (c) 2005-2021 Cobisi Research
* Copyright (c) 2005-2023 Cobisi Research
*
* Cobisi Research
* Via Della Costituzione, 31
Expand Down
3 changes: 2 additions & 1 deletion browser/esm/diagnostics/Logger.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* https://verifalia.com/
* [email protected]
*
* Copyright (c) 2005-2021 Cobisi Research
* Copyright (c) 2005-2023 Cobisi Research
*
* Cobisi Research
* Via Della Costituzione, 31
Expand All @@ -30,6 +30,7 @@
* THE SOFTWARE.
*/
export declare class Logger {
private _debugger;
constructor(namespace: string);
log(formatter: any, ...args: any[]): void;
}
Expand Down
2 changes: 1 addition & 1 deletion browser/esm/diagnostics/Logger.d.ts.map

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

41 changes: 21 additions & 20 deletions browser/esm/email-validations/EmailValidationsRestClient.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* https://verifalia.com/
* [email protected]
*
* Copyright (c) 2005-2021 Cobisi Research
* Copyright (c) 2005-2023 Cobisi Research
*
* Cobisi Research
* Via Della Costituzione, 31
Expand Down Expand Up @@ -35,7 +35,7 @@ import { RestClientFactory } from "../rest/RestClientFactory";
import { Validation } from "./models/Validation";
import { ValidationRequestEntry } from "./models/ValidationRequestEntry";
import { ValidationRequest } from "./models/ValidationRequest";
import { WaitingStrategy } from "./WaitingStrategy";
import { WaitOptions } from "./WaitOptions";
import { CancellationToken } from "../common/CancellationToken";
import { FileValidationRequest } from "./models/FileValidationRequest";
import { ValidationOverviewListingOptions } from "./models/ValidationOverviewListingOptions";
Expand All @@ -45,23 +45,23 @@ export declare class EmailValidationsRestClient {
private readonly _restClientFactory;
constructor(restClientFactory: RestClientFactory);
/**
* Submits one or more email addresses for validation. By default, this method does not wait for
* the completion of the email validation job: pass a `WaitingStrategy` (or `true`, to wait
* until the job is completed) to request a different waiting behavior.
* Submits one or more email addresses for validation.
* By default, this method waits for the completion of the email validation job: pass a `WaitOptions`
* to request a different waiting behavior.
* This method accepts a wide range of input types, including:
* - `string` and `string[]`
* - `ValidationRequestEntry` and `ValidationRequestEntry[]`
* - `ValidationRequest`
* - `FileValidationRequest`
*
* Here is the simplest case, showing how to validate one email address:
* Here is the simplest case, showing how to verify an email address:
* ```ts
* // Option 1 - async/await
*
* const verifalia = new VerifaliaRestClient(...);
* const result = await verifalia
* .emailValidations
* .submit('[email protected]', true);
* .submit('[email protected]');
*
* console.log(result.entries[0].classification); // 'Deliverable'
*
Expand All @@ -70,7 +70,7 @@ export declare class EmailValidationsRestClient {
* const verifalia = new VerifaliaRestClient(...);
* verifalia
* .emailValidations
* .submit('[email protected]', true)
* .submit('[email protected]')
* .then(result => {
* console.log(result.entries[0].classification); // 'Deliverable'
* });
Expand All @@ -83,7 +83,7 @@ export declare class EmailValidationsRestClient {
* const verifalia = new VerifaliaRestClient(...);
* const result = await verifalia
* .emailValidations
* .submit([ '[email protected]', '[email protected]' ], true);
* .submit([ '[email protected]', '[email protected]' ]);
*
* result.entries.forEach((item) => {
* console.log(`${item.inputData}: ${item.classification}`);
Expand All @@ -94,7 +94,7 @@ export declare class EmailValidationsRestClient {
* const verifalia = new VerifaliaRestClient(...);
* verifalia
* .emailValidations
* .submit([ '[email protected]', '[email protected]' ], true);
* .submit([ '[email protected]', '[email protected]' ]);
* .then(result => {
* result.entries.forEach((item) => {
* console.log(`${item.inputData}: ${item.classification}`);
Expand All @@ -106,15 +106,15 @@ export declare class EmailValidationsRestClient {
*
* @param request An object with one or more email addresses to validate. Can be of type `string`, `string[]`,
* `ValidationRequestEntry`, `ValidationRequestEntry[]`, `ValidationRequest`, `FileValidationRequest`.
* @param waitingStrategy The strategy which rules out how to wait for the completion of the
* email validation. Can be `true` to wait for the completion or an instance of `WaitingStrategy` for
* advanced scenarios and progress tracking.
* @param waitOptions Optional configuration settings for waiting on the completion of an email validation job.
* Can be `undefined` (or `null`) to wait for the completion using the default settings, `WaitOptions.noWait` to
* avoid waiting or an instance of `WaitOptions` for advanced scenarios and progress tracking.
*/
submit(request: FileValidationRequest | NonFileValidationRequest, waitingStrategy?: WaitingStrategy | boolean, cancellationToken?: CancellationToken): Promise<Validation | null>;
submit(request: FileValidationRequest | NonFileValidationRequest, waitOptions?: WaitOptions | null, cancellationToken?: CancellationToken): Promise<Validation | null>;
/**
* Returns an email validation job previously submitted for processing. By default, this method does
* not wait for the eventual completion of the email validation job: pass a `WaitingStrategy` (or `true`,
* to wait until the job is completed) to request a different waiting behavior.
* Returns an email validation job previously submitted for processing.
* By default, this method waits for the completion of the email validation job: pass a `WaitOptions`
* to request a different waiting behavior.
*
* Here is how to retrieve an email validation job, given its ID:
* ```ts
Expand All @@ -127,10 +127,11 @@ export declare class EmailValidationsRestClient {
* This method returns a `Promise` which can be awaited and can be cancelled through a `CancellationToken`.
*
* @param id The ID of the email validation job to retrieve.
* @param waitingStrategy The strategy which rules out how to wait for the completion of the email
* validation.
* @param waitOptions Optional configuration settings for waiting on the completion of an email validation job.
* Can be `undefined` (or `null`) to wait for the completion using the default settings, `WaitOptions.noWait` to
* avoid waiting or an instance of `WaitOptions` for advanced scenarios and progress tracking.
*/
get(id: string, waitingStrategy?: WaitingStrategy | boolean, cancellationToken?: CancellationToken): Promise<Validation | null>;
get(id: string, waitOptions?: WaitOptions | null, cancellationToken?: CancellationToken): Promise<Validation | null>;
/**
* Deletes an email validation job previously submitted for processing.
*
Expand Down

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

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* https://verifalia.com/
* [email protected]
*
* Copyright (c) 2005-2021 Cobisi Research
* Copyright (c) 2005-2023 Cobisi Research
*
* Cobisi Research
* Via Della Costituzione, 31
Expand Down Expand Up @@ -33,13 +33,39 @@ import { ValidationOverview } from "./models/ValidationOverview";
import { CancellationToken } from "../common/CancellationToken";
declare type ProgressCallback = (value: ValidationOverview) => void;
/**
* Defines a strategy used to wait for the completion of an email verification job in Verifalia.
* Provides optional configuration settings for waiting on the completion of an email validation job.
*/
export declare class WaitingStrategy {
waitForCompletion: boolean;
export declare class WaitOptions {
/**
* Indicates that the library should automatically wait for the email validation to complete, using
* the default wait times.
*/
static default: WaitOptions;
/**
* Indicates that the library should not wait for the email validation to complete.
*/
static noWait: WaitOptions;
/**
* If set, defines a function which receives completion progress updates for an email validation job.
*/
progress: ProgressCallback | null;
constructor(waitForCompletion: boolean, progress?: ProgressCallback | null);
/**
* Defines how much time to ask the Verifalia API to wait for the completion of the job on the server side,
* during the initial job submission request. Expressed in milliseconds, with a default of 30 seconds.
*/
submissionWaitTime: number;
/**
* Defines how much time to ask the Verifalia API to wait for the completion of the job on the server side,
* during any of the polling requests. Expressed in milliseconds, with a default of 30 seconds.
*/
pollWaitTime: number;
/**
* Waits for the next polling interval of the specified validationOverview.
*
* @param validationOverview The validation overview to wait against.
* @param cancellationToken The eventual cancellation token for the waiting.
*/
waitForNextPoll(validationOverview: ValidationOverview, cancellationToken?: CancellationToken): Promise<void>;
}
export {};
//# sourceMappingURL=WaitingStrategy.d.ts.map
//# sourceMappingURL=WaitOptions.d.ts.map
1 change: 1 addition & 0 deletions browser/esm/email-validations/WaitOptions.d.ts.map

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

1 change: 0 additions & 1 deletion browser/esm/email-validations/WaitingStrategy.d.ts.map

This file was deleted.

Loading

0 comments on commit 8b298f0

Please sign in to comment.