# Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] ## [5.1.1] - 2026-12-03 ### Security - Development dependencies updated so `npm audit` reports nothing (the publish workflow fails on any advisory): `jest`, `babel-jest` and `jest-environment-jsdom` 30.5.2, `cross-spawn` 7.1.2, `terser` 5.51.4, `ws` 8.23.1, and a `glob` override to `^14.0.7`. The `test-exclude` override that pinned `minimatch` to 3.x is gone: `test-exclude` 7 imports `minimatch` by name, so every copy is now 11.x. None of these ship in the package; the SDK has no runtime dependencies. ## [5.1.0] - 2026-12-03 (tagged, never published to npm; shipped in 5.1.1) ### Added - `validateEmail` accepts `awaitDomainInfo` (sent as `await=true|false`, only when set, on GET and POST; never on `validateBatch`). It only takes effect with `domainInfo` and can add up to about 30 seconds. - The validate result declares `domain_detected_services` (`DomainDetectedServices` with `integrations` and `services`, each a list of `DetectedService` with `name`, `key` and `category`); its types are checked like every other field. ### Fixed - The documented values were wrong in released docs: `domain_website_exists` is `"true"`, `"false"` or `"unchecked"`; `domain_registrant_company_name` is a company name, `"not_found"` or `"unchecked"`. ## [5.0.2] - 2026-11-18 ### Changed - Documentation only, no code changes: the README and `documentation.md` link the README and LICENSE by full GitHub URL, so the links work on npmjs.com and on the zerobounce.net documentation page that renders `documentation.md`. ## [5.0.1] - 2026-11-18 ### Fixed - `validateEmail` returned a message-only body (`{"message": "bad"}`, one beside a `success` that is no flag, or one beside `address` and `status` both null) as a result; it now rejects with `ZBApiError`, status 200, carrying the message, as the other calls do. The only message-only answer still returned is the greylist one, a body whose only key is `Message`. ## [5.0.0] - 2026-11-17 ### Breaking Compared with 4.0.0, the version on npm (4.0.1 was tagged but never published there, see below). Callers should expect a rejection, or a refused `init`, where 4.0.0 resolved or accepted: - `init` refuses more API keys: a key with a Unicode space (U+00A0 included), a control character, a C1 control character (U+0080 to U+009F), a lone surrogate, an invisible or default-ignorable character (U+200B, U+202E, U+180B, U+2800 and others), or made only of combining marks. An ordinary space in the middle of the key is still allowed. - `init` refuses more base URLs (`apiBaseURL`, `listEvaluatorBaseURL`, `inboxPlacementBaseURL`, `emailFinderBaseURL`, `domainSearchBaseURL`, and `ZeroBounceWarmup`'s): one that carries a username, a password, a query or a fragment; one with a control, whitespace, invisible, bidirectional or backslash character, a lone surrogate, or a non-ASCII or `%` host; and one that is not `https://` followed by a host, apart from `http://` for `127.0.0.1`, `localhost` and `[::1]`, which is new (4.0.0 refused every `http://` URL); and one whose path has a dot segment (`.` or `..`) or an encoded slash (`%2f`, `%5c`). The error does not include the URL. - A `success` flag decides failure on every JSON call: a body whose `success` is `false`, `"false"` or `0` in any of its duplicate top-level keys rejects with status 200. A `success` that is not a flag (`null`, `2`, `"yes"`, `0.4`, an object) no longer hides a message-only or error body; it is read as if absent. - A 2xx body that is a message only, `{}`, or a message beside documented fields that are all null rejects on every typed call except validate's greylist answer, the filter calls, Inbox Placement and the list-evaluator result; `getCredits` is no longer an exception (`{"message":"x"}` rejects with the text `x`). The email finder and domain search calls reject a message-only body whatever its values. - A field of a typed result with another JSON type than `zeroBounceSDK.d.ts` declares, a body that is not the declared shape (a number, string, array, `null` where an object is declared), a body nested deeper than 512 levels, a body that starts with a byte order mark or is not strict JSON, a `score` that is not a safe integer, and a list of `message` values holding anything but strings all reject with a `ZBApiError` with status 200 (a list of strings is joined with `"\n"` into one string). - `getFileStatus` and `getScoringFileStatus` reject a body with no non-null known field, including `{"foo":1}` and `{"message":"m","file_id":null}` (4.0.0 returned them); `{"file_status":"Processing"}` and `{"success":true}` stay results. - `ZeroBounceWarmup` rejects a 2xx answer served as `text/html` (a proxy or challenge page) with a `ZBApiError`, even when its body parses as JSON; 4.0.0 returned such a body as the result. - `getCredits` returns `Credits` as a string: `{"Credits":2375323}` resolves to `{ Credits: "2375323" }`; `{"Credits":null}` and `{}` reject. - The four bulk downloads and `ZeroBounceWarmup.downloadSeeds` and `downloadStatistics` reject any JSON body or JSON media type and an HTML page (also one that starts with spaces, tabs, a byte order mark or U+00A0) with a `ZBApiError` carrying the HTTP status. - A connection failure rejects with `ZBApiError` and `statusCode` 0 (Warmup included). - `ZeroBounceWarmup.addSendingAccount` rejects a non-boolean `weekdays_only` and a `timezone_offset` of `NaN`; `validateBatch` rejects a non-boolean `activityData` or `verifyPlus` (the 4.0.1 change, for 4.0.0 callers). - The API key is no longer a property of the client (`_api_key`); code that read it that way gets `undefined`. - **Behaviour change:** `sendFile`, `sendScoringFile`, `sendListEvaluatorFile`, `sendEmailFinderFile`, `sendDomainSearchFile` and every `…FileStream` sender accept only a `Blob`/`File`, or a `Buffer`/`Uint8Array` (wrapped into a Blob under the given file name, `file.csv` when none is given). A file path string, a stream or any other object is refused with `ZBApiError` before anything is sent; before, a `Buffer` or `Uint8Array` passed to a `send…File` method was sent as a text field holding its content, another object as a text field ("[object Object]"), and a `Buffer` passed to a `…FileStream` sender threw a `TypeError` from `FormData.append`. - **Behaviour change:** a form value (`return_url`, column fields, ...) or a file name containing CR, LF or NUL is refused with `ZBApiError` ("the form field "return_url" must not contain a line break or a NUL character.") before the request is sent. - **Behaviour change:** a 3xx answer is reported with its own status ("ZeroBounce returned a redirect, which this client does not follow."); requests use `redirect: "manual"` and still never follow it. Before, requests used `redirect: "error"` and a redirect rejected with a plain `Error` ("TypeError: fetch failed") that had no `statusCode`. - **Warmup transport and redirects:** `ZeroBounceWarmup` sends `redirect: "manual"`, so a 3xx rejects with its status and a browser's opaque redirect with status 0 and "ZeroBounce returned a redirect, which this client does not follow." (4.0.0 sent `redirect: "error"`, so the redirect surfaced as a "fetch failed"). A response with status 0 now rejects as a transport failure; 4.0.0 resolved `null`. A connection failure (also while the body is read) rejects with `ZBApiError` and `statusCode` 0 and keeps its cause text (the code and message, redacted); in 4.0.0 `src/warmup.js` threw a plain `Error` with no `statusCode`. - **Downloads that start with `<`:** a file download (`getFile`, `getScoringFile`, the finder and domain-search files, Warmup `downloadSeeds`) whose content starts with `<` after its padding is an HTML page and rejects, whatever its tags (`