broadcast-ruby 0.4.0 → 0.4.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: 7866007085ed5d19620669069bdfeb9e7babaad5d08b2198d76e19620ce68bde
4
- data.tar.gz: '082d0663d0a5a2501f445f0f7152e6b6a56467d1e0a61d0ae96e45b3137380d0'
3
+ metadata.gz: 6a0fbeb95adead9eca90faa48afb7e5cd463c7caa23d9e0a217abd2fd4f27350
4
+ data.tar.gz: abc65de39dfaf74dc17a5f5021f4c2b7a9b24821b3bd9bd87582811153d2901e
5
5
  SHA512:
6
- metadata.gz: bd9d8c35c4bdcea360c59609be5e366bcd066084328db6380e7f3995cc49e7121937b053c6e09c36d94262d54cfc4d4bb978dcae93a58410407a3da78a6d9182
7
- data.tar.gz: c4d0c47df97790a337dc35b882fea9254c1ae8f41d19784f71bebecb253c6b00740356be0cb5b1b7edf2d2c9965f84556f1fcc31fc350dd1e6214adda167fc63
6
+ metadata.gz: e0b60c030234703fce2c09b864519a227ae7ebf34a60f32e5b5ae92b7650199ef548949d85fa2e190b788527168004c066b29adccf032716b3a968127b35d69b
7
+ data.tar.gz: 9be0806cdda4c12ab34b5cb03fc2a4e8daee603e90318a469b64be5015a532ec771b6c28cf58a2b3e41cd612c02b2af036345375689107aeb79da9feb699dd6a
data/CHANGELOG.md CHANGED
@@ -4,6 +4,29 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.4.1] - 2026-08-16
8
+
9
+ ### Fixed — sequence enrolment never worked
10
+
11
+ `Sequences#add_subscriber` and `#remove_subscriber` sent the subscriber
12
+ attributes flat, but the API reads them with `params.require(:subscriber)`.
13
+ Every call was rejected:
14
+
15
+ Broadcast::APIError: param is missing or the value is empty or invalid: subscriber
16
+
17
+ Both now nest the attributes under a `subscriber` key.
18
+
19
+ ### Added
20
+
21
+ - `Discovery#openapi` for `GET /api/v1/openapi`, which returns the
22
+ installation's own OpenAPI document.
23
+
24
+ This was invisible to the test suite because the tests asserted the shape the
25
+ code already sent (`hash_including('email' => ...)` at the top level) rather
26
+ than the shape the server requires — so they encoded the bug instead of
27
+ catching it. Found only by a real enrolment against a live instance; the tests
28
+ now pin the nested payload.
29
+
7
30
  ## [0.4.0] - 2026-08-14
8
31
 
9
32
  ### Fixed — ActionMailer delivery
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- broadcast-ruby (0.4.0)
4
+ broadcast-ruby (0.4.1)
5
5
  base64
6
6
 
7
7
  GEM
@@ -177,7 +177,7 @@ CHECKSUMS
177
177
  ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383
178
178
  base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
179
179
  bigdecimal (4.0.1) sha256=8b07d3d065a9f921c80ceaea7c9d4ae596697295b584c296fe599dd0ad01c4a7
180
- broadcast-ruby (0.4.0)
180
+ broadcast-ruby (0.4.1)
181
181
  builder (3.3.0) sha256=497918d2f9dca528fdca4b88d84e4ef4387256d984b8154e9d5d3fe5a9c8835f
182
182
  concurrent-ruby (1.3.6) sha256=6b56837e1e7e5292f9864f34b69c5a2cbc75c0cf5338f1ce9903d10fa762d5ab
183
183
  connection_pool (3.0.2) sha256=33fff5ba71a12d2aa26cb72b1db8bba2a1a01823559fb01d29eb74c286e62e0a
@@ -77,6 +77,10 @@ module Broadcast
77
77
  discovery.skill
78
78
  end
79
79
 
80
+ def openapi
81
+ discovery.openapi
82
+ end
83
+
80
84
  # --- Resource sub-clients ---
81
85
 
82
86
  def subscribers
@@ -31,6 +31,18 @@ module Broadcast
31
31
  def skill
32
32
  @client.request(:get, '/api/v1/skill', nil, raw: true)
33
33
  end
34
+
35
+ # This installation's own OpenAPI document, as YAML. Returns a String,
36
+ # not a Hash — the endpoint serves application/yaml.
37
+ #
38
+ # The server URL in the document is rewritten by the installation to the
39
+ # host that served it, so the result feeds a client generator or an API
40
+ # explorer without hand-editing. Worth preferring over a spec copied from
41
+ # anywhere else: a 2.28 install serves the 2.28 surface, so the document
42
+ # cannot drift from the routes it describes.
43
+ def openapi
44
+ @client.request(:get, '/api/v1/openapi', nil, raw: true)
45
+ end
34
46
  end
35
47
  end
36
48
  end
@@ -26,12 +26,17 @@ module Broadcast
26
26
 
27
27
  # --- Subscriber enrollment ---
28
28
 
29
+ # Both of these nest the attributes under `subscriber`, because the API
30
+ # reads them with `params.require(:subscriber)`. Sent flat they are
31
+ # rejected outright with "param is missing or the value is empty or
32
+ # invalid: subscriber".
29
33
  def add_subscriber(sequence_id, **attrs)
30
- post("/api/v1/sequences/#{sequence_id}/add_subscriber", attrs)
34
+ post("/api/v1/sequences/#{sequence_id}/add_subscriber", { subscriber: attrs })
31
35
  end
32
36
 
33
37
  def remove_subscriber(sequence_id, email:)
34
- @client.request(:delete, "/api/v1/sequences/#{sequence_id}/remove_subscriber", { email: email })
38
+ @client.request(:delete, "/api/v1/sequences/#{sequence_id}/remove_subscriber",
39
+ { subscriber: { email: email } })
35
40
  end
36
41
 
37
42
  def list_subscribers(sequence_id, page: 1)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Broadcast
4
- VERSION = '0.4.0'
4
+ VERSION = '0.4.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: broadcast-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Chiu