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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a162f45f8175f25dc05e677013062f320dc8e3b494d7fc8e7bd998b9b3a72a1b
4
- data.tar.gz: cd4c78b1b42fb6019a6013863501c3091ea49019ca7dbfc7551f0c26c8b0633e
3
+ metadata.gz: 42b307eda9b14ab7bdabb1d966e5aba3dadd6bcd8633bfba23ea7dc98e5666fa
4
+ data.tar.gz: 0e537baf7538b197928df6cb66acaad1e02fca60f8b67cec80408a0f6f1f2c3d
5
5
  SHA512:
6
- metadata.gz: c9c8a1a2e81b6fedce1c815a9cbf2fd02df62aea031c50df3fd06aba94c380164f0290115060f16029617b811ee145efb45b3b95d93803907e96fda9283e8956
7
- data.tar.gz: 0eb5b408eb466cdf4fd4c19de9d50c7e23ad36d4e743e9c8c920b4523c502abd346dd87e74c8f79a345f341e8bb3a2bfa4378cf16d4e9acfb2bc99bca1b0f073
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.0...HEAD
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
+ [![Gem Version](https://img.shields.io/gem/v/kit-rb?logo=rubygems&logoColor=white)](https://rubygems.org/gems/kit-rb)
4
+ [![Gem Downloads](https://img.shields.io/gem/dt/kit-rb?logo=rubygems&logoColor=white)](https://rubygems.org/gems/kit-rb)
5
+ [![CI](https://github.com/linyiru/kit-rb/actions/workflows/main.yml/badge.svg)](https://github.com/linyiru/kit-rb/actions/workflows/main.yml)
6
+ [![OpenAPI drift](https://github.com/linyiru/kit-rb/actions/workflows/contract-drift.yml/badge.svg)](https://github.com/linyiru/kit-rb/actions/workflows/contract-drift.yml)
7
+ [![Ruby](https://img.shields.io/badge/ruby-%3E%3D%203.2-CC342D?logo=ruby&logoColor=white)](https://www.ruby-lang.org/)
8
+ [![RBS + Steep](https://img.shields.io/badge/types-RBS%20%2B%20Steep-blue)](sig/kit-rb.rbs)
9
+ [![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](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`)
@@ -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
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kit
4
- VERSION = "0.3.0"
4
+ VERSION = "0.3.1"
5
5
  end
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.0
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: