kit-rb 0.3.0 → 0.3.1
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 +15 -1
- data/README.md +8 -0
- data/docs/TASKS.md +1 -1
- data/lib/kit/configuration.rb +3 -2
- data/lib/kit/connection.rb +1 -1
- data/lib/kit/version.rb +1 -1
- data/sig/kit-rb.rbs +3 -2
- metadata +9 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 42b307eda9b14ab7bdabb1d966e5aba3dadd6bcd8633bfba23ea7dc98e5666fa
|
|
4
|
+
data.tar.gz: 0e537baf7538b197928df6cb66acaad1e02fca60f8b67cec80408a0f6f1f2c3d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 25ab9b37e0df8ccbf9e14ad35f016e74a0cce0532c7d6bccac1ff89f209da6e21400d5b8b23395dc9999daa9f93b39c1fa0f69c0ab47b3d0b61d30f7ec48769b
|
|
7
|
+
data.tar.gz: e2ca310dcd9e907b8b834460c4f01e792df15a4d6ba715b1888cd0e4f23b3c784a0c967b1944641821aaa2ca8f86af2a8195c43ba7cc4c96487f0a0c38a11432
|
data/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,19 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.3.1] - 2026-09-06
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- `write_timeout` (default 30 s) alongside `open_timeout`/`read_timeout`.
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
- The `http` dependency is `>= 5.2, < 7.0`: http 6.x is supported.
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
- The write timeout was never set, so on http 5 it fell back to http.rb's
|
|
19
|
+
0.25 s default and a large request body (a bulk batch) could time out
|
|
20
|
+
while being sent.
|
|
21
|
+
|
|
9
22
|
## [0.3.0] - 2026-09-06
|
|
10
23
|
|
|
11
24
|
The hardening pass (`docs/TASKS.md`): two real-API bugs fixed, the surface
|
|
@@ -123,7 +136,8 @@ vertical slice. Not yet feature-complete — resources land in 0.1.0 per docs/DE
|
|
|
123
136
|
429/5xx retry with backoff.
|
|
124
137
|
- RBS signatures for the public surface.
|
|
125
138
|
|
|
126
|
-
[Unreleased]: https://github.com/linyiru/kit-rb/compare/v0.3.
|
|
139
|
+
[Unreleased]: https://github.com/linyiru/kit-rb/compare/v0.3.1...HEAD
|
|
140
|
+
[0.3.1]: https://github.com/linyiru/kit-rb/compare/v0.3.0...v0.3.1
|
|
127
141
|
[0.3.0]: https://github.com/linyiru/kit-rb/compare/v0.2.0...v0.3.0
|
|
128
142
|
[0.2.0]: https://github.com/linyiru/kit-rb/compare/v0.1.0...v0.2.0
|
|
129
143
|
[0.1.0]: https://github.com/linyiru/kit-rb/compare/7ce3329...v0.1.0
|
data/README.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# kit-rb
|
|
2
2
|
|
|
3
|
+
[](https://rubygems.org/gems/kit-rb)
|
|
4
|
+
[](https://rubygems.org/gems/kit-rb)
|
|
5
|
+
[](https://github.com/linyiru/kit-rb/actions/workflows/main.yml)
|
|
6
|
+
[](https://github.com/linyiru/kit-rb/actions/workflows/contract-drift.yml)
|
|
7
|
+
[](https://www.ruby-lang.org/)
|
|
8
|
+
[](sig/kit-rb.rbs)
|
|
9
|
+
[](LICENSE.txt)
|
|
10
|
+
|
|
3
11
|
A modern, fully-typed Ruby client for the **Kit** (formerly ConvertKit) **API v4**.
|
|
4
12
|
|
|
5
13
|
The gem is named `kit-rb`; the public namespace is the clean `Kit`.
|
data/docs/TASKS.md
CHANGED
|
@@ -41,7 +41,7 @@ Legend: `[ ]` todo · `[x]` done (commit noted).
|
|
|
41
41
|
- [x] One `HTTP::Client` per request: no persistent connections. Client is now built once per Connection; true keep-alive (`HTTP.persistent`) is deliberately not used because it is not thread-safe while `Kit::Client` is documented as shareable. (`perf: build the http.rb client once per Connection`)
|
|
42
42
|
- [x] Stale P0/P1 comments in `auth/oauth.rb`, `resources/account.rb`, `sig/kit-rb.rbs`; unused `Auth::OAuth::*_URL` constants; template comments in the gemspec. (`chore: drop stale phase comments, dead constants, and gemspec boilerplate`)
|
|
43
43
|
- [x] README / DESIGN.md claim 81 operations; the spec has 83. (`docs: document the hardening pass in README, DESIGN and CHANGELOG`)
|
|
44
|
-
- [x] CI matrix lacks Ruby 3.5; no Dependabot; no branch coverage. (`ci: test on Ruby 3.5, add Dependabot, enforce branch coverage`)
|
|
44
|
+
- [x] CI matrix lacks Ruby 3.5; no Dependabot; no branch coverage. (`ci: test on Ruby 3.5, add Dependabot, enforce branch coverage`; then `ci: run Ruby head as an allowed-to-fail job` — '3.5' resolved to 3.5.0-preview1 where ffi does not build, so the next Ruby is tracked via `head` and cannot fail the run)
|
|
45
45
|
- [x] RBS: 22 methods take `**untyped`; tighten the fixed-key bodies (broadcasts, sequences, sequence emails, snippets, purchases). List query params stay `**params`. (`refactor: explicit keyword bodies for create/update methods`)
|
|
46
46
|
- [x] OpenAPI contract test covers only list envelopes; extend to single-object envelopes and request bodies. (`test: contract-check object envelopes, request bodies, and 204s against the spec`)
|
|
47
47
|
- [x] `rake contract:fetch` is manual; add a scheduled drift check. (`ci: weekly OpenAPI drift check`)
|
data/lib/kit/configuration.rb
CHANGED
|
@@ -4,16 +4,17 @@ module Kit
|
|
|
4
4
|
# Immutable per-client configuration. Exactly one credential (api_key or
|
|
5
5
|
# access_token) must be supplied; the matching auth strategy is selected here.
|
|
6
6
|
class Configuration
|
|
7
|
-
attr_reader :auth, :base_url, :open_timeout, :read_timeout,
|
|
7
|
+
attr_reader :auth, :base_url, :open_timeout, :read_timeout, :write_timeout,
|
|
8
8
|
:max_retries, :retry_backoff, :max_backoff
|
|
9
9
|
|
|
10
10
|
def initialize(api_key: nil, access_token: nil, base_url: DEFAULT_BASE_URL,
|
|
11
|
-
open_timeout: 10, read_timeout: 30,
|
|
11
|
+
open_timeout: 10, read_timeout: 30, write_timeout: 30,
|
|
12
12
|
max_retries: 2, retry_backoff: 0.5, max_backoff: 30)
|
|
13
13
|
@auth = build_auth(api_key, access_token)
|
|
14
14
|
@base_url = base_url
|
|
15
15
|
@open_timeout = open_timeout
|
|
16
16
|
@read_timeout = read_timeout
|
|
17
|
+
@write_timeout = write_timeout # http 5 would otherwise default to 0.25 s
|
|
17
18
|
@max_retries = max_retries # 0 disables automatic retries
|
|
18
19
|
@retry_backoff = retry_backoff # base seconds for exponential backoff
|
|
19
20
|
@max_backoff = max_backoff # cap on any single sleep
|
data/lib/kit/connection.rb
CHANGED
|
@@ -23,7 +23,7 @@ module Kit
|
|
|
23
23
|
# and a Client is documented as shareable — so it is not used.)
|
|
24
24
|
@client = HTTP
|
|
25
25
|
.headers(default_headers)
|
|
26
|
-
.timeout(connect: @config.open_timeout, read: @config.read_timeout)
|
|
26
|
+
.timeout(connect: @config.open_timeout, read: @config.read_timeout, write: @config.write_timeout)
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
# Issues a request and returns the parsed JSON body (a Hash) on success.
|
data/lib/kit/version.rb
CHANGED
data/sig/kit-rb.rbs
CHANGED
|
@@ -163,10 +163,11 @@ module Kit
|
|
|
163
163
|
attr_reader base_url: String
|
|
164
164
|
attr_reader open_timeout: Integer
|
|
165
165
|
attr_reader read_timeout: Integer
|
|
166
|
+
attr_reader write_timeout: Integer
|
|
166
167
|
attr_reader max_retries: Integer
|
|
167
168
|
attr_reader retry_backoff: Float
|
|
168
169
|
attr_reader max_backoff: Numeric
|
|
169
|
-
def initialize: (?api_key: String?, ?access_token: String?, ?base_url: String, ?open_timeout: Integer, ?read_timeout: Integer, ?max_retries: Integer, ?retry_backoff: Float, ?max_backoff: Numeric) -> void
|
|
170
|
+
def initialize: (?api_key: String?, ?access_token: String?, ?base_url: String, ?open_timeout: Integer, ?read_timeout: Integer, ?write_timeout: Integer, ?max_retries: Integer, ?retry_backoff: Float, ?max_backoff: Numeric) -> void
|
|
170
171
|
end
|
|
171
172
|
|
|
172
173
|
class Connection
|
|
@@ -649,7 +650,7 @@ module Kit
|
|
|
649
650
|
|
|
650
651
|
class Client
|
|
651
652
|
attr_reader config: Configuration
|
|
652
|
-
def initialize: (?api_key: String?, ?access_token: String?, ?base_url: String, ?open_timeout: Integer, ?read_timeout: Integer, ?max_retries: Integer, ?retry_backoff: Float, ?max_backoff: Numeric) -> void
|
|
653
|
+
def initialize: (?api_key: String?, ?access_token: String?, ?base_url: String, ?open_timeout: Integer, ?read_timeout: Integer, ?write_timeout: Integer, ?max_retries: Integer, ?retry_backoff: Float, ?max_backoff: Numeric) -> void
|
|
653
654
|
def account: () -> Resources::Account
|
|
654
655
|
def subscribers: () -> Resources::Subscribers
|
|
655
656
|
def tags: () -> Resources::Tags
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kit-rb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Lawrence Lin
|
|
@@ -13,16 +13,22 @@ dependencies:
|
|
|
13
13
|
name: http
|
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
|
15
15
|
requirements:
|
|
16
|
-
- - "
|
|
16
|
+
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
18
|
version: '5.2'
|
|
19
|
+
- - "<"
|
|
20
|
+
- !ruby/object:Gem::Version
|
|
21
|
+
version: '7.0'
|
|
19
22
|
type: :runtime
|
|
20
23
|
prerelease: false
|
|
21
24
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
25
|
requirements:
|
|
23
|
-
- - "
|
|
26
|
+
- - ">="
|
|
24
27
|
- !ruby/object:Gem::Version
|
|
25
28
|
version: '5.2'
|
|
29
|
+
- - "<"
|
|
30
|
+
- !ruby/object:Gem::Version
|
|
31
|
+
version: '7.0'
|
|
26
32
|
description: kit-rb wraps the Kit v4 REST API with API-key and OAuth 2.0 auth, cursor
|
|
27
33
|
pagination, typed errors, and immutable value objects.
|
|
28
34
|
email:
|