From 8c6344bcdcdd4e278379c7e15e67342d5761b0e7 Mon Sep 17 00:00:00 2001 From: Ralph Rouhana Date: Mon, 24 Nov 2025 20:23:29 -0500 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74013=20Add=20?= =?UTF-8?q?@zerobounce/zero-bounce-sdk=20type=20definitions=20by=20@ralphr?= =?UTF-8?q?123?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/zerobounce__zero-bounce-sdk/.npmignore | 5 + types/zerobounce__zero-bounce-sdk/index.d.ts | 352 ++++++++++++++++++ .../zerobounce__zero-bounce-sdk/package.json | 17 + .../zerobounce__zero-bounce-sdk/tsconfig.json | 20 + .../zerobounce__zero-bounce-sdk-tests.ts | 84 +++++ 5 files changed, 478 insertions(+) create mode 100644 types/zerobounce__zero-bounce-sdk/.npmignore create mode 100644 types/zerobounce__zero-bounce-sdk/index.d.ts create mode 100644 types/zerobounce__zero-bounce-sdk/package.json create mode 100644 types/zerobounce__zero-bounce-sdk/tsconfig.json create mode 100644 types/zerobounce__zero-bounce-sdk/zerobounce__zero-bounce-sdk-tests.ts diff --git a/types/zerobounce__zero-bounce-sdk/.npmignore b/types/zerobounce__zero-bounce-sdk/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/zerobounce__zero-bounce-sdk/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/zerobounce__zero-bounce-sdk/index.d.ts b/types/zerobounce__zero-bounce-sdk/index.d.ts new file mode 100644 index 00000000000000..ffc1dfd60df066 --- /dev/null +++ b/types/zerobounce__zero-bounce-sdk/index.d.ts @@ -0,0 +1,352 @@ +declare namespace ZeroBounceSDK { +interface EmailBatchItem { + email_address: string; +} + +interface SendFilePayload { + /** csv or txt file. Byte array contents for the submitted file. The content's header is type of "text/csv". */ + file: File | Blob; + + /** The column index of the email address in the file. Index starts from 1 */ + email_address_column: number; + + /** The URL will be used to call back when the validation is completed */ + return_url?: string; + + /** The column index of the first name column */ + first_name_column?: number; + + /** The column index of the last name column */ + last_name_column?: number; + + /** The column index of the gender column */ + gender_column?: number; + + /** The column index of the IP address the email signed up from */ + ip_address_column?: number; + + /** Whether the first row from the submitted file is a header row */ + has_header_row?: boolean; + + /** Whether to remove duplicate emails (default: true). Returns 400 error if >50% duplicates removed */ + remove_duplicate?: boolean; +} + +interface FileErrorResponse { + /** Indicates the file upload failed */ + success: false; + /** Error message describing the failure */ + error_message: string; +} + +type SendFileResponse = + | { + /** Indicates the file was successfully accepted */ + success: true; + /** Success message */ + message: string; + /** Name of the uploaded file */ + file_name: string; + /** Unique identifier for the uploaded file */ + file_id: string; + } + | FileErrorResponse; + +type FileStatusResponse = + | { + /** Indicates the request was successful */ + success: true; + /** Unique identifier for the file */ + file_id: string; + /** Name of the file */ + file_name: string; + /** Upload date in ISO 8601 format */ + upload_date: string; + /** Current status of the file processing */ + file_status: string; + /** Percentage of file processing completed */ + complete_percentage: string; + /** Return URL provided when calling sendfile API, if any */ + return_url?: string; + } + | FileErrorResponse; + +interface GuessFormatPayload { + domain: string; + first_name?: string; + middle_name?: string; + last_name?: string; +} + +type GetFileResponse = Blob; + +/** + * Response from the delete file endpoint + */ +type DeleteFileResponse = + | { + /** Indicates the file was successfully deleted */ + success: true; + /** Success message */ + message: string; + /** Name of the deleted file */ + file_name: string; + /** Unique identifier of the deleted file */ + file_id: string; + } + | FileErrorResponse; + +/** + * Response from the ZeroBounce email validation API + */ +interface ValidateEmailResponse { + /** The email address being validated */ + address: string; + + /** Validation status: valid, invalid, catch-all, unknown, spamtrap, abuse, or do_not_mail */ + status: + | "valid" + | "invalid" + | "catch-all" + | "unknown" + | "spamtrap" + | "abuse" + | "do_not_mail"; + + /** Detailed sub-status providing additional context about the validation result */ + sub_status: + | "alternate" + | "antispam_system" + | "greylisted" + | "mail_server_temporary_error" + | "forcible_disconnect" + | "mail_server_did_not_respond" + | "timeout_exceeded" + | "failed_smtp_connection" + | "mailbox_quota_exceeded" + | "exception_occurred" + | "possible_trap" + | "role_based" + | "global_suppression" + | "mailbox_not_found" + | "no_dns_entries" + | "failed_syntax_check" + | "possible_typo" + | "unroutable_ip_address" + | "leading_period_removed" + | "does_not_accept_mail" + | "alias_address" + | "role_based_catch_all" + | "disposable" + | "toxic" + | "accept_all"; + + /** The portion of the email address before the "@" symbol */ + account: string; + + /** The portion of the email address after the "@" symbol */ + domain: string; + + /** Suggested correction for an email typo, if detected */ + did_you_mean: string | null; + + /** Age of the email domain in days, or null if unavailable */ + domain_age_days: number | null; + + /** Last activity date bucket: 30, 60, 90, 180, 365, or 365+ days */ + active_in_days: "30" | "60" | "90" | "180" | "365" | "365+" | null; + + /** Whether the email comes from a free provider */ + free_email: boolean; + + /** Whether the domain has an MX record */ + mx_found: boolean; + + /** The preferred MX record of the domain */ + mx_record: string; + + /** The SMTP provider of the email (BETA feature) */ + smtp_provider: string | null; + + /** First name of the email owner, if available */ + firstname: string | null; + + /** Last name of the email owner, if available */ + lastname: string | null; + + /** Gender of the email owner, if available */ + gender: string | null; + + /** City associated with the IP address passed in */ + city: string | null; + + /** Region/state associated with the IP address passed in */ + region: string | null; + + /** Zipcode associated with the IP address passed in */ + zipcode: string | null; + + /** Country associated with the IP address passed in */ + country: string | null; + + /** UTC timestamp when the email was validated */ + processed_at: string; +} + +/** + * Response from the ZeroBounce API usage endpoint + */ +interface ApiUsageResponse { + /** Total number of times the API has been called */ + total: number; + + /** Total valid email addresses returned by the API */ + status_valid: number; + + /** Total invalid email addresses returned by the API */ + status_invalid: number; + + /** Total catch-all email addresses returned by the API */ + status_catch_all: number; + + /** Total do not mail email addresses returned by the API */ + status_do_not_mail: number; + + /** Total spamtrap email addresses returned by the API */ + status_spamtrap: number; + + /** Total unknown email addresses returned by the API */ + status_unknown: number; + + /** Total number of times the API has a sub status of "toxic" */ + sub_status_toxic: number; + + /** Total number of times the API has a sub status of "disposable" */ + sub_status_disposable: number; + + /** Total number of times the API has a sub status of "role_based" */ + sub_status_role_based: number; + + /** Total number of times the API has a sub status of "possible_trap" */ + sub_status_possible_trap: number; + + /** Total number of times the API has a sub status of "global_suppression" */ + sub_status_global_suppression: number; + + /** Total number of times the API has a sub status of "timeout_exceeded" */ + sub_status_timeout_exceeded: number; + + /** Total number of times the API has a sub status of "mail_server_temporary_error" */ + sub_status_mail_server_temporary_error: number; + + /** Total number of times the API has a sub status of "mail_server_did_not_respond" */ + sub_status_mail_server_did_not_respond: number; + + /** Total number of times the API has a sub status of "greylisted" */ + sub_status_greylisted: number; + + /** Total number of times the API has a sub status of "antispam_system" */ + sub_status_antispam_system: number; + + /** Total number of times the API has a sub status of "does_not_accept_mail" */ + sub_status_does_not_accept_mail: number; + + /** Total number of times the API has a sub status of "exception_occurred" */ + sub_status_exception_occurred: number; + + /** Total number of times the API has a sub status of "failed_syntax_check" */ + sub_status_failed_syntax_check: number; + + /** Total number of times the API has a sub status of "mailbox_not_found" */ + sub_status_mailbox_not_found: number; + + /** Total number of times the API has a sub status of "unroutable_ip_address" */ + sub_status_unroutable_ip_address: number; + + /** Total number of times the API has a sub status of "possible_typo" */ + sub_status_possible_typo: number; + + /** Total number of times the API has a sub status of "no_dns_entries" */ + sub_status_no_dns_entries: number; + + /** Total role based catch alls the API has a sub status of "role_based_catch_all" */ + sub_status_role_based_catch_all: number; + + /** Total number of times the API has a sub status of "mailbox_quota_exceeded" */ + sub_status_mailbox_quota_exceeded: number; + + /** Total forcible disconnects the API has a sub status of "forcible_disconnect" */ + sub_status_forcible_disconnect: number; + + /** Total failed SMTP connections the API has a sub status of "failed_smtp_connection" */ + sub_status_failed_smtp_connection: number; + + /** Total number times the API has a sub status "mx_forward" */ + sub_status_mx_forward: number; + + /** Start date of query (format: yyyy/mm/dd) */ + start_date: string; + + /** End date of query (format: yyyy/mm/dd) */ + end_date: string; +} + +interface EmailActivityResponse { + found: boolean; + active_in_days: string; +} + +interface ValidateBatchResponse { + email_batch: ReadonlyArray; + errors: ReadonlyArray<{ error: string }>; +} + +/** + * Response from the guess format endpoint + */ +interface GuessFormatResponse { + /** The guessed email address format */ + email: string; + + /** Confidence level of the guessed email format */ + email_confidence: "high" | "medium" | "low"; + + /** The domain used for the guess */ + domain: string; + + /** Company name associated with the domain, if available */ + company_name: string; + + /** Suggested correction if a typo was detected */ + did_you_mean: string; + + /** Reason for failure if the guess was unsuccessful */ + failure_reason: string; +} +} + +declare class ZeroBounceSDK { + constructor(); + init(apiKey: string): void; + getCredits(): Promise<{ Credits: string }>; + validateEmail( + email: string, + ipAddress?: string, + ): Promise; + getApiUsage(startDate: string, endDate: string): Promise; + validateBatch( + emailBatch: ReadonlyArray, + ): Promise; + getEmailActivity(email: string): Promise; + sendFile(payload: ZeroBounceSDK.SendFilePayload): Promise; + sendScoringFile(payload: ZeroBounceSDK.SendFilePayload): Promise; + getFileStatus(fileId: string): Promise; + getScoringFileStatus(fileId: string): Promise; + getFile(fileId: string): Promise; + getScoringFile(fileId: string): Promise; + deleteFile(fileId: string): Promise; + deleteScoringFile(fileId: string): Promise; + guessFormat(payload: ZeroBounceSDK.GuessFormatPayload): Promise; +} + +export = ZeroBounceSDK; diff --git a/types/zerobounce__zero-bounce-sdk/package.json b/types/zerobounce__zero-bounce-sdk/package.json new file mode 100644 index 00000000000000..6afe58d638080e --- /dev/null +++ b/types/zerobounce__zero-bounce-sdk/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/zerobounce__zero-bounce-sdk", + "version": "1.1.9999", + "projects": [ + "https://github.com/zerobounce/zero-bounce-javascript#readme" + ], + "devDependencies": { + "@types/zerobounce__zero-bounce-sdk": "workspace:." + }, + "owners": [ + { + "name": "Ralph Rouhana", + "githubUsername": "ralphr123" + } + ] +} diff --git a/types/zerobounce__zero-bounce-sdk/tsconfig.json b/types/zerobounce__zero-bounce-sdk/tsconfig.json new file mode 100644 index 00000000000000..c288ae6477eb9d --- /dev/null +++ b/types/zerobounce__zero-bounce-sdk/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "node16", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "zerobounce__zero-bounce-sdk-tests.ts" + ] +} diff --git a/types/zerobounce__zero-bounce-sdk/zerobounce__zero-bounce-sdk-tests.ts b/types/zerobounce__zero-bounce-sdk/zerobounce__zero-bounce-sdk-tests.ts new file mode 100644 index 00000000000000..fa6e90130e8667 --- /dev/null +++ b/types/zerobounce__zero-bounce-sdk/zerobounce__zero-bounce-sdk-tests.ts @@ -0,0 +1,84 @@ +import ZeroBounceSDK from "@zerobounce/zero-bounce-sdk"; + +const sdk = new ZeroBounceSDK(); + +// $ExpectType void +sdk.init("test-api-key"); + +// $ExpectType Promise<{ Credits: string; }> +sdk.getCredits(); + +// $ExpectType Promise +sdk.validateEmail("test@example.com"); + +// $ExpectType Promise +sdk.validateEmail("test@example.com", "192.168.1.1"); + +// $ExpectType Promise +sdk.getApiUsage("2024-01-01", "2024-12-31"); + +// $ExpectType Promise +sdk.validateBatch([ + { email_address: "test1@example.com" }, + { email_address: "test2@example.com" } +]); + +// $ExpectType Promise +sdk.getEmailActivity("test@example.com"); + +// $ExpectType Promise +sdk.sendFile({ + file: new File([], "test.csv"), + email_address_column: 1 +}); + +// $ExpectType Promise +sdk.sendFile({ + file: new Blob(["email\ntest@example.com"], { type: "text/csv" }), + email_address_column: 1, + return_url: "https://example.com/callback", + first_name_column: 2, + last_name_column: 3, + gender_column: 4, + ip_address_column: 5, + has_header_row: true, + remove_duplicate: false +}); + +// $ExpectType Promise +sdk.sendScoringFile({ + file: new File([], "test.csv"), + email_address_column: 1, + has_header_row: true +}); + +// $ExpectType Promise +sdk.getFileStatus("file-123"); + +// $ExpectType Promise +sdk.getScoringFileStatus("file-456"); + +// $ExpectType Promise +sdk.getFile("file-123"); + +// $ExpectType Promise +sdk.getScoringFile("file-456"); + +// $ExpectType Promise +sdk.deleteFile("file-123"); + +// $ExpectType Promise +sdk.deleteScoringFile("file-456"); + +// $ExpectType Promise +sdk.guessFormat({ + domain: "example.com" +}); + +// $ExpectType Promise +sdk.guessFormat({ + domain: "example.com", + first_name: "John", + middle_name: "Michael", + last_name: "Doe" +}); \ No newline at end of file From 79f291c6f8dc21d599c0e09ddcb70439002faf16 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Tue, 25 Nov 2025 01:24:15 +0000 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=A4=96=20dprint=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/zerobounce__zero-bounce-sdk/index.d.ts | 584 +++++++++--------- .../zerobounce__zero-bounce-sdk-tests.ts | 14 +- 2 files changed, 299 insertions(+), 299 deletions(-) diff --git a/types/zerobounce__zero-bounce-sdk/index.d.ts b/types/zerobounce__zero-bounce-sdk/index.d.ts index ffc1dfd60df066..21e7f9753197d0 100644 --- a/types/zerobounce__zero-bounce-sdk/index.d.ts +++ b/types/zerobounce__zero-bounce-sdk/index.d.ts @@ -1,352 +1,352 @@ declare namespace ZeroBounceSDK { -interface EmailBatchItem { - email_address: string; -} + interface EmailBatchItem { + email_address: string; + } -interface SendFilePayload { - /** csv or txt file. Byte array contents for the submitted file. The content's header is type of "text/csv". */ - file: File | Blob; + interface SendFilePayload { + /** csv or txt file. Byte array contents for the submitted file. The content's header is type of "text/csv". */ + file: File | Blob; - /** The column index of the email address in the file. Index starts from 1 */ - email_address_column: number; + /** The column index of the email address in the file. Index starts from 1 */ + email_address_column: number; - /** The URL will be used to call back when the validation is completed */ - return_url?: string; + /** The URL will be used to call back when the validation is completed */ + return_url?: string; - /** The column index of the first name column */ - first_name_column?: number; + /** The column index of the first name column */ + first_name_column?: number; - /** The column index of the last name column */ - last_name_column?: number; + /** The column index of the last name column */ + last_name_column?: number; - /** The column index of the gender column */ - gender_column?: number; + /** The column index of the gender column */ + gender_column?: number; - /** The column index of the IP address the email signed up from */ - ip_address_column?: number; + /** The column index of the IP address the email signed up from */ + ip_address_column?: number; - /** Whether the first row from the submitted file is a header row */ - has_header_row?: boolean; + /** Whether the first row from the submitted file is a header row */ + has_header_row?: boolean; - /** Whether to remove duplicate emails (default: true). Returns 400 error if >50% duplicates removed */ - remove_duplicate?: boolean; -} - -interface FileErrorResponse { - /** Indicates the file upload failed */ - success: false; - /** Error message describing the failure */ - error_message: string; -} - -type SendFileResponse = - | { - /** Indicates the file was successfully accepted */ - success: true; - /** Success message */ - message: string; - /** Name of the uploaded file */ - file_name: string; - /** Unique identifier for the uploaded file */ - file_id: string; + /** Whether to remove duplicate emails (default: true). Returns 400 error if >50% duplicates removed */ + remove_duplicate?: boolean; } - | FileErrorResponse; - -type FileStatusResponse = - | { - /** Indicates the request was successful */ - success: true; - /** Unique identifier for the file */ - file_id: string; - /** Name of the file */ - file_name: string; - /** Upload date in ISO 8601 format */ - upload_date: string; - /** Current status of the file processing */ - file_status: string; - /** Percentage of file processing completed */ - complete_percentage: string; - /** Return URL provided when calling sendfile API, if any */ - return_url?: string; + + interface FileErrorResponse { + /** Indicates the file upload failed */ + success: false; + /** Error message describing the failure */ + error_message: string; } - | FileErrorResponse; -interface GuessFormatPayload { - domain: string; - first_name?: string; - middle_name?: string; - last_name?: string; -} + type SendFileResponse = + | { + /** Indicates the file was successfully accepted */ + success: true; + /** Success message */ + message: string; + /** Name of the uploaded file */ + file_name: string; + /** Unique identifier for the uploaded file */ + file_id: string; + } + | FileErrorResponse; + + type FileStatusResponse = + | { + /** Indicates the request was successful */ + success: true; + /** Unique identifier for the file */ + file_id: string; + /** Name of the file */ + file_name: string; + /** Upload date in ISO 8601 format */ + upload_date: string; + /** Current status of the file processing */ + file_status: string; + /** Percentage of file processing completed */ + complete_percentage: string; + /** Return URL provided when calling sendfile API, if any */ + return_url?: string; + } + | FileErrorResponse; + + interface GuessFormatPayload { + domain: string; + first_name?: string; + middle_name?: string; + last_name?: string; + } -type GetFileResponse = Blob; - -/** - * Response from the delete file endpoint - */ -type DeleteFileResponse = - | { - /** Indicates the file was successfully deleted */ - success: true; - /** Success message */ - message: string; - /** Name of the deleted file */ - file_name: string; - /** Unique identifier of the deleted file */ - file_id: string; + type GetFileResponse = Blob; + + /** + * Response from the delete file endpoint + */ + type DeleteFileResponse = + | { + /** Indicates the file was successfully deleted */ + success: true; + /** Success message */ + message: string; + /** Name of the deleted file */ + file_name: string; + /** Unique identifier of the deleted file */ + file_id: string; + } + | FileErrorResponse; + + /** + * Response from the ZeroBounce email validation API + */ + interface ValidateEmailResponse { + /** The email address being validated */ + address: string; + + /** Validation status: valid, invalid, catch-all, unknown, spamtrap, abuse, or do_not_mail */ + status: + | "valid" + | "invalid" + | "catch-all" + | "unknown" + | "spamtrap" + | "abuse" + | "do_not_mail"; + + /** Detailed sub-status providing additional context about the validation result */ + sub_status: + | "alternate" + | "antispam_system" + | "greylisted" + | "mail_server_temporary_error" + | "forcible_disconnect" + | "mail_server_did_not_respond" + | "timeout_exceeded" + | "failed_smtp_connection" + | "mailbox_quota_exceeded" + | "exception_occurred" + | "possible_trap" + | "role_based" + | "global_suppression" + | "mailbox_not_found" + | "no_dns_entries" + | "failed_syntax_check" + | "possible_typo" + | "unroutable_ip_address" + | "leading_period_removed" + | "does_not_accept_mail" + | "alias_address" + | "role_based_catch_all" + | "disposable" + | "toxic" + | "accept_all"; + + /** The portion of the email address before the "@" symbol */ + account: string; + + /** The portion of the email address after the "@" symbol */ + domain: string; + + /** Suggested correction for an email typo, if detected */ + did_you_mean: string | null; + + /** Age of the email domain in days, or null if unavailable */ + domain_age_days: number | null; + + /** Last activity date bucket: 30, 60, 90, 180, 365, or 365+ days */ + active_in_days: "30" | "60" | "90" | "180" | "365" | "365+" | null; + + /** Whether the email comes from a free provider */ + free_email: boolean; + + /** Whether the domain has an MX record */ + mx_found: boolean; + + /** The preferred MX record of the domain */ + mx_record: string; + + /** The SMTP provider of the email (BETA feature) */ + smtp_provider: string | null; + + /** First name of the email owner, if available */ + firstname: string | null; + + /** Last name of the email owner, if available */ + lastname: string | null; + + /** Gender of the email owner, if available */ + gender: string | null; + + /** City associated with the IP address passed in */ + city: string | null; + + /** Region/state associated with the IP address passed in */ + region: string | null; + + /** Zipcode associated with the IP address passed in */ + zipcode: string | null; + + /** Country associated with the IP address passed in */ + country: string | null; + + /** UTC timestamp when the email was validated */ + processed_at: string; } - | FileErrorResponse; - -/** - * Response from the ZeroBounce email validation API - */ -interface ValidateEmailResponse { - /** The email address being validated */ - address: string; - - /** Validation status: valid, invalid, catch-all, unknown, spamtrap, abuse, or do_not_mail */ - status: - | "valid" - | "invalid" - | "catch-all" - | "unknown" - | "spamtrap" - | "abuse" - | "do_not_mail"; - - /** Detailed sub-status providing additional context about the validation result */ - sub_status: - | "alternate" - | "antispam_system" - | "greylisted" - | "mail_server_temporary_error" - | "forcible_disconnect" - | "mail_server_did_not_respond" - | "timeout_exceeded" - | "failed_smtp_connection" - | "mailbox_quota_exceeded" - | "exception_occurred" - | "possible_trap" - | "role_based" - | "global_suppression" - | "mailbox_not_found" - | "no_dns_entries" - | "failed_syntax_check" - | "possible_typo" - | "unroutable_ip_address" - | "leading_period_removed" - | "does_not_accept_mail" - | "alias_address" - | "role_based_catch_all" - | "disposable" - | "toxic" - | "accept_all"; - - /** The portion of the email address before the "@" symbol */ - account: string; - - /** The portion of the email address after the "@" symbol */ - domain: string; - - /** Suggested correction for an email typo, if detected */ - did_you_mean: string | null; - - /** Age of the email domain in days, or null if unavailable */ - domain_age_days: number | null; - - /** Last activity date bucket: 30, 60, 90, 180, 365, or 365+ days */ - active_in_days: "30" | "60" | "90" | "180" | "365" | "365+" | null; - - /** Whether the email comes from a free provider */ - free_email: boolean; - - /** Whether the domain has an MX record */ - mx_found: boolean; - - /** The preferred MX record of the domain */ - mx_record: string; - - /** The SMTP provider of the email (BETA feature) */ - smtp_provider: string | null; - - /** First name of the email owner, if available */ - firstname: string | null; - - /** Last name of the email owner, if available */ - lastname: string | null; - - /** Gender of the email owner, if available */ - gender: string | null; - - /** City associated with the IP address passed in */ - city: string | null; - - /** Region/state associated with the IP address passed in */ - region: string | null; - - /** Zipcode associated with the IP address passed in */ - zipcode: string | null; - - /** Country associated with the IP address passed in */ - country: string | null; - - /** UTC timestamp when the email was validated */ - processed_at: string; -} -/** - * Response from the ZeroBounce API usage endpoint - */ -interface ApiUsageResponse { - /** Total number of times the API has been called */ - total: number; + /** + * Response from the ZeroBounce API usage endpoint + */ + interface ApiUsageResponse { + /** Total number of times the API has been called */ + total: number; - /** Total valid email addresses returned by the API */ - status_valid: number; + /** Total valid email addresses returned by the API */ + status_valid: number; - /** Total invalid email addresses returned by the API */ - status_invalid: number; + /** Total invalid email addresses returned by the API */ + status_invalid: number; - /** Total catch-all email addresses returned by the API */ - status_catch_all: number; + /** Total catch-all email addresses returned by the API */ + status_catch_all: number; - /** Total do not mail email addresses returned by the API */ - status_do_not_mail: number; + /** Total do not mail email addresses returned by the API */ + status_do_not_mail: number; - /** Total spamtrap email addresses returned by the API */ - status_spamtrap: number; + /** Total spamtrap email addresses returned by the API */ + status_spamtrap: number; - /** Total unknown email addresses returned by the API */ - status_unknown: number; + /** Total unknown email addresses returned by the API */ + status_unknown: number; - /** Total number of times the API has a sub status of "toxic" */ - sub_status_toxic: number; + /** Total number of times the API has a sub status of "toxic" */ + sub_status_toxic: number; - /** Total number of times the API has a sub status of "disposable" */ - sub_status_disposable: number; + /** Total number of times the API has a sub status of "disposable" */ + sub_status_disposable: number; - /** Total number of times the API has a sub status of "role_based" */ - sub_status_role_based: number; + /** Total number of times the API has a sub status of "role_based" */ + sub_status_role_based: number; - /** Total number of times the API has a sub status of "possible_trap" */ - sub_status_possible_trap: number; + /** Total number of times the API has a sub status of "possible_trap" */ + sub_status_possible_trap: number; - /** Total number of times the API has a sub status of "global_suppression" */ - sub_status_global_suppression: number; + /** Total number of times the API has a sub status of "global_suppression" */ + sub_status_global_suppression: number; - /** Total number of times the API has a sub status of "timeout_exceeded" */ - sub_status_timeout_exceeded: number; + /** Total number of times the API has a sub status of "timeout_exceeded" */ + sub_status_timeout_exceeded: number; - /** Total number of times the API has a sub status of "mail_server_temporary_error" */ - sub_status_mail_server_temporary_error: number; + /** Total number of times the API has a sub status of "mail_server_temporary_error" */ + sub_status_mail_server_temporary_error: number; - /** Total number of times the API has a sub status of "mail_server_did_not_respond" */ - sub_status_mail_server_did_not_respond: number; + /** Total number of times the API has a sub status of "mail_server_did_not_respond" */ + sub_status_mail_server_did_not_respond: number; - /** Total number of times the API has a sub status of "greylisted" */ - sub_status_greylisted: number; + /** Total number of times the API has a sub status of "greylisted" */ + sub_status_greylisted: number; - /** Total number of times the API has a sub status of "antispam_system" */ - sub_status_antispam_system: number; + /** Total number of times the API has a sub status of "antispam_system" */ + sub_status_antispam_system: number; - /** Total number of times the API has a sub status of "does_not_accept_mail" */ - sub_status_does_not_accept_mail: number; + /** Total number of times the API has a sub status of "does_not_accept_mail" */ + sub_status_does_not_accept_mail: number; - /** Total number of times the API has a sub status of "exception_occurred" */ - sub_status_exception_occurred: number; + /** Total number of times the API has a sub status of "exception_occurred" */ + sub_status_exception_occurred: number; - /** Total number of times the API has a sub status of "failed_syntax_check" */ - sub_status_failed_syntax_check: number; + /** Total number of times the API has a sub status of "failed_syntax_check" */ + sub_status_failed_syntax_check: number; - /** Total number of times the API has a sub status of "mailbox_not_found" */ - sub_status_mailbox_not_found: number; + /** Total number of times the API has a sub status of "mailbox_not_found" */ + sub_status_mailbox_not_found: number; - /** Total number of times the API has a sub status of "unroutable_ip_address" */ - sub_status_unroutable_ip_address: number; + /** Total number of times the API has a sub status of "unroutable_ip_address" */ + sub_status_unroutable_ip_address: number; - /** Total number of times the API has a sub status of "possible_typo" */ - sub_status_possible_typo: number; + /** Total number of times the API has a sub status of "possible_typo" */ + sub_status_possible_typo: number; - /** Total number of times the API has a sub status of "no_dns_entries" */ - sub_status_no_dns_entries: number; + /** Total number of times the API has a sub status of "no_dns_entries" */ + sub_status_no_dns_entries: number; - /** Total role based catch alls the API has a sub status of "role_based_catch_all" */ - sub_status_role_based_catch_all: number; + /** Total role based catch alls the API has a sub status of "role_based_catch_all" */ + sub_status_role_based_catch_all: number; - /** Total number of times the API has a sub status of "mailbox_quota_exceeded" */ - sub_status_mailbox_quota_exceeded: number; + /** Total number of times the API has a sub status of "mailbox_quota_exceeded" */ + sub_status_mailbox_quota_exceeded: number; - /** Total forcible disconnects the API has a sub status of "forcible_disconnect" */ - sub_status_forcible_disconnect: number; + /** Total forcible disconnects the API has a sub status of "forcible_disconnect" */ + sub_status_forcible_disconnect: number; - /** Total failed SMTP connections the API has a sub status of "failed_smtp_connection" */ - sub_status_failed_smtp_connection: number; + /** Total failed SMTP connections the API has a sub status of "failed_smtp_connection" */ + sub_status_failed_smtp_connection: number; - /** Total number times the API has a sub status "mx_forward" */ - sub_status_mx_forward: number; + /** Total number times the API has a sub status "mx_forward" */ + sub_status_mx_forward: number; - /** Start date of query (format: yyyy/mm/dd) */ - start_date: string; + /** Start date of query (format: yyyy/mm/dd) */ + start_date: string; - /** End date of query (format: yyyy/mm/dd) */ - end_date: string; -} + /** End date of query (format: yyyy/mm/dd) */ + end_date: string; + } -interface EmailActivityResponse { - found: boolean; - active_in_days: string; -} + interface EmailActivityResponse { + found: boolean; + active_in_days: string; + } -interface ValidateBatchResponse { - email_batch: ReadonlyArray; - errors: ReadonlyArray<{ error: string }>; -} + interface ValidateBatchResponse { + email_batch: ReadonlyArray; + errors: ReadonlyArray<{ error: string }>; + } -/** - * Response from the guess format endpoint - */ -interface GuessFormatResponse { - /** The guessed email address format */ - email: string; + /** + * Response from the guess format endpoint + */ + interface GuessFormatResponse { + /** The guessed email address format */ + email: string; - /** Confidence level of the guessed email format */ - email_confidence: "high" | "medium" | "low"; + /** Confidence level of the guessed email format */ + email_confidence: "high" | "medium" | "low"; - /** The domain used for the guess */ - domain: string; + /** The domain used for the guess */ + domain: string; - /** Company name associated with the domain, if available */ - company_name: string; + /** Company name associated with the domain, if available */ + company_name: string; - /** Suggested correction if a typo was detected */ - did_you_mean: string; + /** Suggested correction if a typo was detected */ + did_you_mean: string; - /** Reason for failure if the guess was unsuccessful */ - failure_reason: string; -} + /** Reason for failure if the guess was unsuccessful */ + failure_reason: string; + } } declare class ZeroBounceSDK { - constructor(); - init(apiKey: string): void; - getCredits(): Promise<{ Credits: string }>; - validateEmail( - email: string, - ipAddress?: string, - ): Promise; - getApiUsage(startDate: string, endDate: string): Promise; - validateBatch( - emailBatch: ReadonlyArray, - ): Promise; - getEmailActivity(email: string): Promise; - sendFile(payload: ZeroBounceSDK.SendFilePayload): Promise; - sendScoringFile(payload: ZeroBounceSDK.SendFilePayload): Promise; - getFileStatus(fileId: string): Promise; - getScoringFileStatus(fileId: string): Promise; - getFile(fileId: string): Promise; - getScoringFile(fileId: string): Promise; - deleteFile(fileId: string): Promise; - deleteScoringFile(fileId: string): Promise; - guessFormat(payload: ZeroBounceSDK.GuessFormatPayload): Promise; + constructor(); + init(apiKey: string): void; + getCredits(): Promise<{ Credits: string }>; + validateEmail( + email: string, + ipAddress?: string, + ): Promise; + getApiUsage(startDate: string, endDate: string): Promise; + validateBatch( + emailBatch: ReadonlyArray, + ): Promise; + getEmailActivity(email: string): Promise; + sendFile(payload: ZeroBounceSDK.SendFilePayload): Promise; + sendScoringFile(payload: ZeroBounceSDK.SendFilePayload): Promise; + getFileStatus(fileId: string): Promise; + getScoringFileStatus(fileId: string): Promise; + getFile(fileId: string): Promise; + getScoringFile(fileId: string): Promise; + deleteFile(fileId: string): Promise; + deleteScoringFile(fileId: string): Promise; + guessFormat(payload: ZeroBounceSDK.GuessFormatPayload): Promise; } export = ZeroBounceSDK; diff --git a/types/zerobounce__zero-bounce-sdk/zerobounce__zero-bounce-sdk-tests.ts b/types/zerobounce__zero-bounce-sdk/zerobounce__zero-bounce-sdk-tests.ts index fa6e90130e8667..3aa68e67be833b 100644 --- a/types/zerobounce__zero-bounce-sdk/zerobounce__zero-bounce-sdk-tests.ts +++ b/types/zerobounce__zero-bounce-sdk/zerobounce__zero-bounce-sdk-tests.ts @@ -20,7 +20,7 @@ sdk.getApiUsage("2024-01-01", "2024-12-31"); // $ExpectType Promise sdk.validateBatch([ { email_address: "test1@example.com" }, - { email_address: "test2@example.com" } + { email_address: "test2@example.com" }, ]); // $ExpectType Promise @@ -29,7 +29,7 @@ sdk.getEmailActivity("test@example.com"); // $ExpectType Promise sdk.sendFile({ file: new File([], "test.csv"), - email_address_column: 1 + email_address_column: 1, }); // $ExpectType Promise @@ -42,14 +42,14 @@ sdk.sendFile({ gender_column: 4, ip_address_column: 5, has_header_row: true, - remove_duplicate: false + remove_duplicate: false, }); // $ExpectType Promise sdk.sendScoringFile({ file: new File([], "test.csv"), email_address_column: 1, - has_header_row: true + has_header_row: true, }); // $ExpectType Promise @@ -72,7 +72,7 @@ sdk.deleteScoringFile("file-456"); // $ExpectType Promise sdk.guessFormat({ - domain: "example.com" + domain: "example.com", }); // $ExpectType Promise @@ -80,5 +80,5 @@ sdk.guessFormat({ domain: "example.com", first_name: "John", middle_name: "Michael", - last_name: "Doe" -}); \ No newline at end of file + last_name: "Doe", +}); From 10f9017e6298f45fe9dcf341f0b7325cff73b684 Mon Sep 17 00:00:00 2001 From: sidorko Date: Tue, 25 Nov 2025 13:17:42 +0300 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74063=20[teleg?= =?UTF-8?q?ram-web-app]=20add=20support=20for=20Bot=20API=209.1=20by=20@si?= =?UTF-8?q?dorko?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: KnorpelSenf --- types/telegram-web-app/index.d.ts | 27 ++++++++++++++----- types/telegram-web-app/package.json | 2 +- .../telegram-web-app-tests.ts | 2 ++ 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/types/telegram-web-app/index.d.ts b/types/telegram-web-app/index.d.ts index 79ea147d6a4aec..e867c2977e6b14 100644 --- a/types/telegram-web-app/index.d.ts +++ b/types/telegram-web-app/index.d.ts @@ -350,6 +350,13 @@ export interface WebApp { * called and the invoice status will be passed as the first argument. */ openInvoice(url: string, callback: (status: "paid" | "cancelled" | "failed" | "pending") => void): void; + /** + * **Bot API 9.1+** + * + * A method that hides the on-screen keyboard, if it is currently visible. + * Does nothing if the keyboard is not active. + */ + hideKeyboard(): void; /** * A method that shows a native popup described by the params argument of * the type PopupParams. The Web App will receive the event popupClosed when @@ -795,23 +802,31 @@ export interface BackButton { */ isVisible: boolean; /** - * A method that sets the button press event handler. An alias for - * Telegram.WebApp.onEvent('backButtonClicked', callback) + * **Bot API 6.1+** + * + * A method that sets the button press event handler. + * An alias for `Telegram.WebApp.onEvent('backButtonClicked', callback)` */ onClick(callback: () => void): BackButton; /** - * A method that removes the button press event handler. An alias for - * Telegram.WebApp.offEvent('backButtonClicked', callback) + * **Bot API 6.1+** + * + * A method that removes the button press event handler. + * An alias for `Telegram.WebApp.offEvent('backButtonClicked', callback)` */ offClick(callback: () => void): BackButton; /** + * **Bot API 6.1+** + * * A method to make the button active and visible. */ - show(): void; + show(): BackButton; /** + * **Bot API 6.1+** + * * A method to hide the button. */ - hide(): void; + hide(): BackButton; } /** diff --git a/types/telegram-web-app/package.json b/types/telegram-web-app/package.json index 6e079b07cc7638..db11de3f7ed09c 100644 --- a/types/telegram-web-app/package.json +++ b/types/telegram-web-app/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/telegram-web-app", - "version": "9.0.9999", + "version": "9.1.9999", "nonNpm": "conflict", "nonNpmDescription": "telegram-web-app", "projects": ["https://telegram.org/js/telegram-web-app.js"], diff --git a/types/telegram-web-app/telegram-web-app-tests.ts b/types/telegram-web-app/telegram-web-app-tests.ts index b0aeedd3de9c13..b490fbe5e40b3a 100644 --- a/types/telegram-web-app/telegram-web-app-tests.ts +++ b/types/telegram-web-app/telegram-web-app-tests.ts @@ -27,6 +27,8 @@ app.onEvent("viewportChanged", (e) => { else console.log("Changing, currently at ", app.viewportHeight); }); +app.hideKeyboard(); + app.showPopup( { message: "Hello", From c303b673ad62dd854c4d4df110c4133450420e53 Mon Sep 17 00:00:00 2001 From: sidorko Date: Tue, 25 Nov 2025 13:21:54 +0300 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74128=20[teleg?= =?UTF-8?q?ram-web-app]=20Add=20new=20owner=20sidorko=20by=20@sidorko?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/telegram-web-app/package.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/telegram-web-app/package.json b/types/telegram-web-app/package.json index db11de3f7ed09c..61b68b9a953f99 100644 --- a/types/telegram-web-app/package.json +++ b/types/telegram-web-app/package.json @@ -20,6 +20,10 @@ { "name": "deptyped", "githubUsername": "deptyped" + }, + { + "name": "sidorko", + "githubUsername": "sidorko" } ] }