broadcast-ruby 0.11.0 โ†’ 0.12.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 046bdebddc0d68f63776039530a40783734df10ca736d3f8212f598f72927c12
4
- data.tar.gz: 5f1e53c5af9d8654410849eaf485e3f45657e02fb30cb575254585e49eda88e6
3
+ metadata.gz: fb053f3cf4c48c55c7ea1f4726c73812de80e1a2dd97b0a80ba4bd4948e15a06
4
+ data.tar.gz: fadde8872a91a8570d8b538ccfb9a8ffeb7cec7e534a9b52d4a47d1eb720a692
5
5
  SHA512:
6
- metadata.gz: 718ae1afd1950d245ae33084763e96fcc9c186ca56ebe6e4f44a8109b944bf8674d87ca9357ac9782c6ebac6ee4f8e46a6a92a86053c1dc73099c13fa5a1fb8d
7
- data.tar.gz: d61a1d23973470942c06de04d732b01d0df32e3ab098f88ac7b82d68b68a142535de1ab93085f53cf0b18a4981f1c52b0d77c91c3217db2a566d774d9e0be10b
6
+ metadata.gz: cfad85e945cf6caf51a385121854be78858569d41e92f8bf4590394553717dc27d1beb378d8f7d189ab27188dbcab21d74041a2cae851d2c2d922838436b06e3
7
+ data.tar.gz: d9914cc148094332e3b666947ae496669587c4580119bd3aa47f9470337119223ea1a87c6714b96872c826dc27b45c9cf5a72fdd03993eeba3ac3011a6414005
data/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.12.0] - 2026-11-11
8
+
9
+ ### Added
10
+
11
+ - `client.channels` (`client.discovery.channels`): the channels the token can reach, `GET /api/v1/channels`
12
+ (Broadcast 3.1). Every channel for an admin token, its own channel for a channel token, with `token_type`.
13
+
7
14
  ## [0.11.0] - 2026-11-07
8
15
 
9
16
  ### Removed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- broadcast-ruby (0.11.0)
4
+ broadcast-ruby (0.12.0)
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.11.0)
180
+ broadcast-ruby (0.12.0)
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
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Official Ruby client for [Broadcast](https://sendbroadcast.net), the self-hosted email marketing platform.
4
4
 
5
- Works with any Broadcast instance โ€” self-hosted or SaaS. Covers **104/104 API operations**, verified against the API's generated OpenAPI document.
5
+ Works with any self-hosted Broadcast instance. Covers **123/123 API operations** of Broadcast 3.1, verified against the API's generated OpenAPI document.
6
6
 
7
7
  ๐Ÿ“– **[Ruby SDK documentation](https://sendbroadcast.net/docs/ruby-sdk)** ยท [API reference](https://sendbroadcast.net/docs/api-authentication) ยท [All docs](https://sendbroadcast.net/docs)
8
8
 
@@ -1231,6 +1231,14 @@ client.with_channel(2) do
1231
1231
  end
1232
1232
  ```
1233
1233
 
1234
+ To find the channel ids, list the channels the token can reach (Broadcast 3.1 or later):
1235
+
1236
+ ```ruby
1237
+ client.channels['channels'].each do |channel|
1238
+ client.with_channel(channel['id']) { client.subscribers.list }
1239
+ end
1240
+ ```
1241
+
1234
1242
  `with_channel` overrides the config-level value inside the block. Per-call `broadcast_channel_id:` always wins over both. The override is thread-local, so it's safe to share a `Client` instance across threads.
1235
1243
 
1236
1244
  ---
@@ -81,6 +81,10 @@ module Broadcast
81
81
  discovery.openapi
82
82
  end
83
83
 
84
+ def channels
85
+ discovery.channels
86
+ end
87
+
84
88
  # --- Resource sub-clients ---
85
89
 
86
90
  def subscribers
@@ -19,6 +19,15 @@ module Broadcast
19
19
  get('/api/v1/status')
20
20
  end
21
21
 
22
+ # The channels this token can reach (Broadcast 3.1 or later): every
23
+ # channel for an admin token, its own channel for a channel token.
24
+ # Returns a Hash with `token_type` and `channels` (each `id`, `name`,
25
+ # `slug`, `active`). An admin token then names one with #with_channel or
26
+ # `broadcast_channel_id:`. A plugin developer token is refused.
27
+ def channels
28
+ get('/api/v1/channels')
29
+ end
30
+
22
31
  # Full capability manifest: platform version, token permissions, channel
23
32
  # status, the endpoint list the token can reach, rate limit, and usage tips.
24
33
  def prime
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Broadcast
4
- VERSION = '0.11.0'
4
+ VERSION = '0.12.0'
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.11.0
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Chiu