zerobounce-sdk 2.1.8 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +172 -19
- data/README.md +477 -410
- data/lib/zerobounce/api_key.rb +21 -0
- data/lib/zerobounce/api_urls.rb +9 -0
- data/lib/zerobounce/base_request.rb +260 -8
- data/lib/zerobounce/client.rb +30 -0
- data/lib/zerobounce/configuration.rb +24 -3
- data/lib/zerobounce/error.rb +20 -0
- data/lib/zerobounce/get_file_helper.rb +6 -8
- data/lib/zerobounce/priority3.rb +351 -0
- data/lib/zerobounce/request.rb +84 -42
- data/lib/zerobounce/response_error.rb +117 -0
- data/lib/zerobounce/validate_sub_status.rb +1 -0
- data/lib/zerobounce/version.rb +1 -1
- data/lib/zerobounce/warmup.rb +471 -0
- data/lib/zerobounce.rb +112 -26
- metadata +46 -41
- data/.dockerignore +0 -17
- data/.env.example +0 -3
- data/.github/auto_assign.yml +0 -5
- data/.github/dependabot.yml +0 -35
- data/.github/workflows/auto_assign_ci.yaml +0 -21
- data/.github/workflows/codeql.yml +0 -105
- data/.github/workflows/publish.yml +0 -131
- data/.github/workflows/sdk_ci.yml +0 -29
- data/.gitignore +0 -70
- data/.rspec +0 -2
- data/.ruby-version +0 -1
- data/CODE_OF_CONDUCT.md +0 -69
- data/CONTRIBUTING.md +0 -112
- data/Dockerfile +0 -17
- data/Gemfile +0 -13
- data/Gemfile.lock +0 -135
- data/LICENSE.txt +0 -21
- data/Rakefile +0 -26
- data/SECURITY.md +0 -21
- data/bin/bundle +0 -105
- data/bin/console +0 -7
- data/bin/setup +0 -6
- data/data/zerobounce-ai-scoring.csv +0 -31
- data/data/zerobounce-batch-validation.csv +0 -31
- data/documentation.md +0 -530
- data/files/scoring.csv +0 -1
- data/files/validation.csv +0 -1
- data/files/zerobounce-ai-scoring.csv +0 -31
- data/files/zerobounce-batch-validation.csv +0 -31
- data/lib/zerobounce/mock_request.rb +0 -86
- data/zerobounce.gemspec +0 -49
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a38febb2edd021c081aefb3df14db686a54ef1f41142f6559fd95069ad97219c
|
|
4
|
+
data.tar.gz: 13f9d5846f1ba7ac10c4afb082197f4d7b0efcbfa3bee2bb25310b82f27b2979
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4d0c27a41276b918ba70daa8e62dc9b7bff1fe4f067ffe5119b33cd1ab891b0249a3f83eb53cc6fa237388de13a47e7edce9c3ade36f38a85dde9031f741fdef
|
|
7
|
+
data.tar.gz: 4b7c4ba9febcbf1a45d5b1f8028d35ac6128d374c827973130aa7e040992df988ab6c36ecd13a6974ba7c170d2ee30a4df0967af541baccff8ceebeeb2e5a8fe
|
data/CHANGELOG.md
CHANGED
|
@@ -1,33 +1,186 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Changelog
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
## [3.0.0] - 2026-11-12
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
### Breaking
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
- **Breaking:** boolean options are parsed strictly. `true`/`false`, `'true'`/`'false'` (any case) and `1`/`0` are accepted; anything else raises `ArgumentError` naming the option before a request is sent. Up to 2.2.0 any truthy value was sent as `true`, so `activity_data: 'false'` sent `true`. Affects `validate` (`activity_data`, `verify_plus`, `domain_info`, `greylist_processing`), `validate_batch`, `validate_file_send`/`scoring_file_send` (`has_header_row`, `allow_phase_2`), `GetFileOptions#activity_data`, `send_email_finder_file`, `send_domain_search_file`, and the S3/SFTP jobs (`has_header_row`, `remove_duplicates`); a `nil` `has_header_row` on an S3/SFTP job, which 2.2.0 sent as `false`, now raises.
|
|
13
|
+
- **Breaking:** an API key with surrounding whitespace or control characters (for example one read from a file with its newline) raises `ArgumentError` before any request, from `Zerobounce.configure`'s key, `Zerobounce.with_api_key` and `Zerobounce::Client.new`, as `Zerobounce::Warmup.new` already did. 2.2.0 sent it as it was.
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
* Update ruby and bundler version
|
|
15
|
+
### Fixed
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
- `validate` returns the greylist answer `{"Message": "Greylist validation still in progress..."}` as its result (GET and `use_post: true`). 2.2.0 raised `RuntimeError` for it, so `greylist_processing: true` could never be used to pick up a result later.
|
|
18
|
+
- A 2xx `{"error_message": "..."}` with no `success` field raises. 2.2.0 returned it as the result, and `credits` returned `0` for it.
|
|
19
|
+
- `find_email`, `find_domain` and `guessformat` raise for a body made only of message fields (`detail`, `error_message`, `message`, as well as `Message`); 2.2.0 returned `{"detail": ...}` and `{"error_message": ...}` as results.
|
|
20
|
+
- `validate_file_get`, `scoring_file_get` and the email finder and domain search downloads raise `Empty response from ZeroBounce (HTTP 200)` for an empty body instead of returning `""`.
|
|
21
|
+
- `validate_file_check`, `validate_file_delete` and the scoring equivalents no longer raise an empty message for `{"error": ""}`; an empty `error` is not an error.
|
|
22
|
+
- `Zerobounce::Client#inspect` and `Zerobounce::Warmup#inspect` no longer show the API key.
|
|
17
23
|
|
|
18
|
-
|
|
19
|
-
* Update rubocop dev dependencies and fixed failures.
|
|
20
|
-
* Updated minimum ruby version to 2.5.
|
|
24
|
+
### Changed
|
|
21
25
|
|
|
22
|
-
|
|
26
|
+
- Errors reported on a 2xx response raise `Zerobounce::ApiResponseError` with `#status_code` set to the HTTP status (usually 200). `ApiResponseError` is now a subclass of `RuntimeError` (it was a `StandardError`), so `rescue RuntimeError` catches these errors as before.
|
|
27
|
+
- The license file is named `LICENSE` (it was `LICENSE.txt`), and the gem ships only that one license file.
|
|
28
|
+
- The gemspec has a fuller summary and description, and `source_code_uri`, `changelog_uri` and `homepage_uri` metadata.
|
|
29
|
+
- Development only (nothing ships to gem users): `benchmark` is a development dependency, because it left Ruby 4.0's default gems and RuboCop needs it.
|
|
23
30
|
|
|
24
|
-
|
|
25
|
-
* Added changelog file.
|
|
31
|
+
### Removed
|
|
26
32
|
|
|
27
|
-
|
|
33
|
+
- `Zerobounce::MockRequest` and the `TEST=unit` switch are gone. With `TEST=unit` set in the environment, the gem answered every call with canned responses instead of calling the API, which could silently fake results in an application's own test or CI setup. Nothing in the gem's specs used it.
|
|
28
34
|
|
|
29
|
-
|
|
35
|
+
## [2.2.0] - 2026-11-11
|
|
30
36
|
|
|
31
|
-
|
|
37
|
+
### Breaking
|
|
32
38
|
|
|
33
|
-
|
|
39
|
+
These change behaviour that 2.1.8 callers can rely on. Check each before upgrading.
|
|
40
|
+
|
|
41
|
+
- **Breaking:** Ruby 3.0 or later is required (`required_ruby_version` was `>= 2.5`, which CI never tested). On Ruby 2.5 to 2.7 the `Zerobounce::Warmup` methods that send query parameters (such as `get_sending_account` and `statistics`) and `list_inbox_placement_tests` with filters raise `ArgumentError` (unknown keyword), and on 2.5 and 2.6 a successful `validate_file_get` or `scoring_file_get` download raises `NoMethodError` (`StringIO#set_encoding_by_bom`); the offline spec suite passes on 3.0. Bundler on an older Ruby keeps resolving 2.1.8.
|
|
42
|
+
- **Breaking:** the gem no longer loads a `.env` file, and `dotenv` is no longer a runtime dependency. Up to 2.1.8, building the configuration (on the first `Zerobounce.configure`, `Zerobounce.config` or API call) called `Dotenv.load`, which read `.env` from the process's current directory and copied every variable in it that was not already set into `ENV` - not only the `ZEROBOUNCE_*` ones. The `ZEROBOUNCE_*` environment variables are still read. To keep using a `.env` file, add `dotenv` to your own Gemfile and `require 'dotenv/load'` before the gem is first configured.
|
|
43
|
+
- **Breaking:** `validate_batch` returns the whole response Hash (`email_batch` and `errors`) instead of the `email_batch` Array, and an error for one address no longer raises: it is listed in `errors`. An account-level error (HTTP 200 with an error for the address `all`, such as an invalid API key or no credits) still raises. Migrate `Zerobounce.validate_batch(emails)` to `Zerobounce.validate_batch(emails)['email_batch']`, and check `['errors']`.
|
|
44
|
+
- **Breaking:** `{"success": false}` on an HTTP 200 raises a `RuntimeError` with the API's message instead of being returned as the result. Up to 2.1.8 `validate_file_check`, `validate_file_delete`, `scoring_file_check` and `scoring_file_delete` returned it (the API answers an unknown file id, and for a while a just-uploaded one, that way); code that tested `result['success']` must rescue instead. The main-API calls apply the same rule.
|
|
45
|
+
- **Breaking:** `api_root_url` and `bulk_api_root_url` (and `ZEROBOUNCE_API_URL` / `ZEROBOUNCE_BULK_API_URL`) must be `https://` URLs; anything else raises `ArgumentError` before a request is sent. Up to 2.1.8 an `http://` URL (for example a local mock server) was used as given. The new base URLs below have the same rule. Redirects are no longer followed either: a 3xx raises its `RestClient` exception (such as `RestClient::Found`) with the message `ZeroBounce answered with a redirect (HTTP 302), which is not followed`, where 2.1.8 followed a redirect on a `GET` request (and a 303 on any request).
|
|
46
|
+
|
|
47
|
+
### Added
|
|
48
|
+
|
|
49
|
+
- `validate` options `timeout` (3-60 seconds), `activity_data`, `verify_plus`, `domain_info`, `greylist_processing`, `callback_url` and `use_post` (form-encoded `POST /validate`). An option left out is not sent; booleans go on the wire as the strings `true`/`false`. `callback_url` is where the greylist retry posts its result, so it is rejected without `greylist_processing`, and when blank, before any request is sent.
|
|
50
|
+
- `validate_batch` options `timeout` (10-120 seconds, sent as a JSON string, the only form the API accepts), `activity_data`, and `verify_plus`.
|
|
51
|
+
- `score_email` for `GET` and `POST /scoring`.
|
|
52
|
+
- Bulk email finder and bulk domain search (`send_email_finder_file`, `send_domain_search_file` and their status, get and delete calls). `has_header_row` is sent when it is false, and a name column of `0` is sent when passed; `domain_column` must be 1 or more, and the email finder needs `first_name_column` or `full_name_column`.
|
|
53
|
+
- The list evaluator: `send_list_evaluator_file`, `get_list_evaluator_result` (on the list evaluator's own base URL, with the file id encoded as one path segment and a blank id rejected before sending) and `send_evaluated_file`, which takes the evaluator's file id as a form field.
|
|
54
|
+
- Filters: `add_filter`, `list_filters` and `delete_filter`. Their success is a bare `{"Message": "..."}` body and is returned; an invalid or drained key, which they answer with an HTTP 200 and `{"Error": "..."}`, raises.
|
|
55
|
+
- S3 and SFTP/FTP jobs on the bulkapi host **without** `/v2`: `list_s3_files`, `validate_s3_file`, `score_s3_file`, `email_finder_s3_file`, `domain_search_s3_file`, `export_s3_file`, `validate_sftp_file`, `score_sftp_file`, `email_finder_sftp_file`, `domain_search_sftp_file` and `export_sftp_file`. Every job requires `file_name` and `return_url` and raises `ArgumentError` without them (the live API rejects such a job, although its docs list `file_name` as optional for `validate_sftp_file`). `validate_s3_file` and `score_s3_file` take `file_name:` and `has_header_row:` (default `false`) as keywords; the other jobs take them as the first two positional arguments. `export_s3_file`'s `export_bucket` is optional (left out, the export goes to the bucket in your ZeroBounce settings), and so is `export_sftp_file`'s `export_path`.
|
|
56
|
+
- The Inbox Placement Tester. The API key goes in an `Authorization: Bearer` header, not a query parameter; bodies are camelCase JSON and unset fields are left out; the listing is `GET /tests`, with `page_size` (1-100), `created_after` and `created_before`; `create_inbox_placement_test` checks `name` (at most 64 characters), `test_type` (1, 2 or 3) and `sender_email` (required for type 1) before spending inbox-test credits; and its errors, reported under `detail`, are raised with that text.
|
|
57
|
+
- `Zerobounce::Client`, which holds one API key for `validate`, `credits` and `validate_batch` without touching `Zerobounce.config`, so threads can use different keys. For any other call, wrap it in `Zerobounce.with_api_key(key) { ... }`, which sets a key for the current thread only.
|
|
58
|
+
- `Configuration` gains `bulk_root_url` (`ZEROBOUNCE_BULK_ROOT_URL`), `list_evaluator_root_url` (`ZEROBOUNCE_LIST_EVALUATOR_URL`) and `inbox_placement_root_url` (`ZEROBOUNCE_INBOX_PLACEMENT_URL`). `bulk_root_url` is the root for the S3 and SFTP/FTP jobs; left unset it is derived from `bulk_api_root_url` with the `/v2` stripped. The other two are separate base URLs, so overriding `bulk_api_root_url` alone leaves them pointing at the live API.
|
|
59
|
+
- `Zerobounce::ValidateSubStatus::AI_AGENT_MAILBOX` (`ai_agent_mailbox`).
|
|
60
|
+
- `Zerobounce::Warmup`, a client for the Warmup API. It is a separate product with its own host (`https://warmup-api.zerobounce.net`), its own team-scoped key sent in an `API-Key` header, and all 26 documented endpoints, including the seed-list and statistics CSV downloads.
|
|
61
|
+
- `Zerobounce::ApiResponseError`, which carries the HTTP status through `#status_code`. The Warmup client raises it.
|
|
62
|
+
- An opt-in live API suite (`ruby -Ilib live/live_api.rb`). It lives outside `spec/`, so `rspec` and CI never load it. Its default tier makes only free calls and submits no job; it spends credits or submits jobs only with `ZEROBOUNCE_LIVE_SPEND=1`, and changes the account only with `ZEROBOUNCE_LIVE_CHANGES=1`.
|
|
63
|
+
|
|
64
|
+
### Changed
|
|
65
|
+
|
|
66
|
+
- An HTTP error status still raises the `RestClient` exception for that status (`RestClient::NotFound` and so on, with `#http_code` and `#response`), but its message is now the API's short error text, for example `File not found`, instead of RestClient's status line (`404 Not Found`). An HTML error page becomes a one-line message naming its title.
|
|
67
|
+
- Error messages taken from the API have a repeated `Error:` / `[Error]:` prefix removed.
|
|
68
|
+
- `find_email`'s `first_name` is optional: without a name the API answers with the domain's format. It is still the first positional argument, so existing calls are unchanged.
|
|
69
|
+
- API requests time out after 120 seconds (connect and read; up to 2.1.8 Net::HTTP's 60-second defaults applied).
|
|
70
|
+
- Validation-client requests send `User-Agent: ZerobounceRubyGem/2.2.0`, the value of `Configuration#headers[:user_agent]`. Up to 2.1.8 that value was set but never sent, and requests carried RestClient's default user agent.
|
|
71
|
+
- The packaged gem contains only `lib/`, `README.md`, the licence files and `CHANGELOG.md`. Up to 2.1.8 it packaged every git-tracked file outside `spec/`, including the CI workflows, `Dockerfile`, the sample CSVs and `documentation.md`.
|
|
72
|
+
|
|
73
|
+
### Fixed
|
|
74
|
+
|
|
75
|
+
- `validate_file_check`, `validate_file_delete`, `scoring_file_check` and `scoring_file_delete` returned the raw body as a `String` when the API typed its JSON `application/json; charset=utf-8`, because the content type was compared with `==`; an `{"error": ...}` payload then read as a success. The media type is now matched on its own, ignoring the parameters after the semicolon, on every call.
|
|
76
|
+
- An HTML page served with HTTP 200 (such as a Cloudflare "Access denied" page) raises a short error. Up to 2.1.8 it came back as the result: a raw `RestClient::Response` from the main-API `GET` calls, and the page text from the bulk status and delete calls and from `validate_file_get` and `scoring_file_get`.
|
|
77
|
+
- An empty or non-JSON body raises a short error, instead of a `JSON::ParserError` or the raw response.
|
|
78
|
+
- An empty or blank API key is rejected before a request is sent; up to 2.1.8 only a missing (`nil`) key was.
|
|
79
|
+
|
|
80
|
+
### Security
|
|
81
|
+
|
|
82
|
+
- Redirects are not followed, so a 3xx response cannot send the API key to another host.
|
|
83
|
+
- Error messages are redacted of the API key the request used - the global one, a `Zerobounce::Client`'s, or one set with `with_api_key` - in plain and URL-encoded form. A low-level error (an unparseable URL quotes the whole query string, key included) is re-raised with the redacted message and without the original attached as `#cause`, which `#full_message` would otherwise print. The `RestClient` exception for an HTTP error status still holds the request, URL included, in `#response`, as it did up to 2.1.8; do not log that object.
|
|
84
|
+
- `Zerobounce::Configuration#inspect` shows `[FILTERED]` in place of the API key.
|
|
85
|
+
- A Warmup API key with surrounding whitespace or control characters is rejected, because the transport would otherwise quote it unredacted in its own error; a Warmup base URL must be `https://`; and the Warmup SMTP test masks the username and password out of every error it raises.
|
|
86
|
+
|
|
87
|
+
## [2.1.8] - 2026-08-14
|
|
88
|
+
|
|
89
|
+
### Fixed
|
|
90
|
+
|
|
91
|
+
- `Gemfile.lock` matches the gemspec version, so a frozen install can resolve the gem.
|
|
92
|
+
|
|
93
|
+
## [2.1.6] - 2026-06-18
|
|
94
|
+
|
|
95
|
+
### Fixed
|
|
96
|
+
|
|
97
|
+
- `validate_batch` posts to `api.zerobounce.net` instead of `bulkapi.zerobounce.net`.
|
|
98
|
+
|
|
99
|
+
## [2.1.5] - 2026-06-10
|
|
100
|
+
|
|
101
|
+
### Added
|
|
102
|
+
|
|
103
|
+
- `catchall_domain` on validation results.
|
|
104
|
+
|
|
105
|
+
## [2.1.1] - 2026-04-08
|
|
106
|
+
|
|
107
|
+
### Security
|
|
108
|
+
|
|
109
|
+
- Development and transitive dependency floors were raised for REXML, Addressable, and YARD.
|
|
110
|
+
|
|
111
|
+
## [2.1.0] - 2026-04-08
|
|
112
|
+
|
|
113
|
+
### Added
|
|
114
|
+
|
|
115
|
+
- Optional bulk get-file parameters, including download type and activity data.
|
|
116
|
+
|
|
117
|
+
## [2.0.12] - 2026-03-03
|
|
118
|
+
|
|
119
|
+
### Changed
|
|
120
|
+
|
|
121
|
+
- License the project under MIT.
|
|
122
|
+
|
|
123
|
+
## [2.0.1] - 2026-03-03
|
|
124
|
+
|
|
125
|
+
### Security
|
|
126
|
+
|
|
127
|
+
- Uploaded file paths must stay under the current directory.
|
|
128
|
+
|
|
129
|
+
## [2.0.0] - 2026-03-03
|
|
130
|
+
|
|
131
|
+
### Changed
|
|
132
|
+
|
|
133
|
+
- Release the 2.0 line of the gem.
|
|
134
|
+
|
|
135
|
+
## [1.3.0] - 2025-10-22
|
|
136
|
+
|
|
137
|
+
### Added
|
|
138
|
+
|
|
139
|
+
- `find_email` and `find_domain`.
|
|
140
|
+
|
|
141
|
+
### Deprecated
|
|
142
|
+
|
|
143
|
+
- `guessformat`. Use `find_email` or `find_domain`.
|
|
144
|
+
|
|
145
|
+
## [0.3.0] - 2023-09-18
|
|
146
|
+
|
|
147
|
+
### Changed
|
|
148
|
+
|
|
149
|
+
- Ruby and Bundler version requirements.
|
|
150
|
+
|
|
151
|
+
## [0.2.0] - 2023-09-12
|
|
152
|
+
|
|
153
|
+
### Changed
|
|
154
|
+
|
|
155
|
+
- Faraday requirements, and the minimum Ruby version is 2.5.
|
|
156
|
+
|
|
157
|
+
## [0.1.2] - 2023-04-18
|
|
158
|
+
|
|
159
|
+
### Fixed
|
|
160
|
+
|
|
161
|
+
- Error-body detection no longer depends on a quote immediately after the colon.
|
|
162
|
+
|
|
163
|
+
## [0.1.1] - 2023-04-12
|
|
164
|
+
|
|
165
|
+
### Fixed
|
|
166
|
+
|
|
167
|
+
- Removed safe-navigation calls so the client runs on older Ruby.
|
|
168
|
+
|
|
169
|
+
## [0.1.0] - 2023-04-07
|
|
170
|
+
|
|
171
|
+
### Added
|
|
172
|
+
|
|
173
|
+
- Initial client for ZeroBounce API v2.
|
|
174
|
+
|
|
175
|
+
[Unreleased]: https://github.com/zerobounce/zero-bounce-ruby/compare/v3.0.0...HEAD
|
|
176
|
+
[3.0.0]: https://github.com/zerobounce/zero-bounce-ruby/compare/v2.2.0...v3.0.0
|
|
177
|
+
[2.2.0]: https://github.com/zerobounce/zero-bounce-ruby/compare/v2.1.8...v2.2.0
|
|
178
|
+
[2.1.8]: https://github.com/zerobounce/zero-bounce-ruby/compare/v2.1.6...v2.1.8
|
|
179
|
+
[2.1.6]: https://github.com/zerobounce/zero-bounce-ruby/compare/v2.1.5...v2.1.6
|
|
180
|
+
[2.1.5]: https://github.com/zerobounce/zero-bounce-ruby/compare/v2.1.1...v2.1.5
|
|
181
|
+
[2.1.1]: https://github.com/zerobounce/zero-bounce-ruby/compare/v2.1.0...v2.1.1
|
|
182
|
+
[2.1.0]: https://github.com/zerobounce/zero-bounce-ruby/compare/v2.0.12...v2.1.0
|
|
183
|
+
[2.0.12]: https://github.com/zerobounce/zero-bounce-ruby/compare/v2.0.1...v2.0.12
|
|
184
|
+
[2.0.1]: https://github.com/zerobounce/zero-bounce-ruby/compare/v2.0.0...v2.0.1
|
|
185
|
+
[2.0.0]: https://github.com/zerobounce/zero-bounce-ruby/compare/v1.3.0...v2.0.0
|
|
186
|
+
[1.3.0]: https://github.com/zerobounce/zero-bounce-ruby/releases/tag/v1.3.0
|