sendmux-sdk 1.2.0 → 2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c0a7b63890c063922c8dbfb6cfc97c9404dae0a2cbe2d70c4f6409866c88cc82
4
- data.tar.gz: c285b043fa70c67bbb894436edaf6f1d2e56da9a5a57a071e9e57f62c92f4787
3
+ metadata.gz: 7dcb0b49df13606f8a0893b33221e3e563f3028673cfdf97edf9f820a994dedd
4
+ data.tar.gz: a1c6532322a68eb8e49af0d347b48ab3a221986c2c062875bc99e0e3e2cffb8e
5
5
  SHA512:
6
- metadata.gz: 7864615f39d0583eeb20fc1a5b863a3c168af7d2d846896f3a55bc19fe8e0f280a4ba7a52695a99933b06ed1c8224fa9111c15c5a7de97c102307126e00ff12f
7
- data.tar.gz: 444e9f2be34859ecd207421963719efe35b6dd479c7986860f6ae8428cf3e2fa405984c8a43daf9474c9d983d5c16158ede40ecc9e439913673f79240e9405d5
6
+ metadata.gz: 5aad2012a60e96a508071bdb4f6381efc155c9a37a8a15f7a6a4f58a6926a4e5046e73c8f297ab600b225d53ba5d791cdb7e6127225616a25c0cd445b8ed29b1
7
+ data.tar.gz: 79f9bc773762d9b138d1d7f7abf15bca4a128572ec6e45486e0f06c0ad634c0f4cd42aab1342e12307f35884eed80b3e1a25df8cfd5a25b1285d90cba8fccbb3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.0.0](https://github.com/Sendmux/sendmux-sdk/compare/ruby-sdk/v1.3.0...ruby-sdk/v2.0.0) (2026-09-19)
4
+
5
+
6
+ ### Changed
7
+
8
+ * **Breaking:** the umbrella now requires `sendmux-management >= 2.0.0, < 3.0` and `sendmux-mailbox >= 2.0.0, < 3.0`, so `Sendmux::SDK.management(...)` and `Sendmux::SDK.mailbox(...)` return the 2.0 result classes: sending-account list entries are `ProviderListItem` (no `variables`) while `management_get_provider` returns `ProviderItem` with a required `variables` hash, and `mailbox_list_thread_messages` returns `MailboxThreadMessageSummaryCursorListResponse` whose `meta.thread_id` is required. Code that only reads results keeps working; class checks and constructed fixtures must follow [Migrate from 1.x to 2.0](README.md#migrate-from-1x-to-20) ([3c4fe75](https://github.com/Sendmux/sendmux-sdk/commit/3c4fe755c8be1b3afcd9b25aeb0aa4bb65be8556), [051a621](https://github.com/Sendmux/sendmux-sdk/commit/051a6215f1ef2a8400696baba9a84d8b8d9d9aae)).
9
+
10
+ ### Dependencies
11
+
12
+ * `sendmux-mailbox >= 2.0.0, < 3.0` (was `>= 1.4.0, < 2.0`), `sendmux-management >= 2.0.0, < 3.0` (was `>= 1.3.0, < 2.0`), `sendmux-sending >= 1.5.0, < 2.0` (was `>= 1.4.0, < 2.0`; [eaf5a80](https://github.com/Sendmux/sendmux-sdk/commit/eaf5a80d19abaca9db21e9c093a8713ad972d934)); `sendmux-core >= 1.3.0, < 2.0` unchanged.
13
+
14
+ ### ⚠ BREAKING CHANGES
15
+
16
+ * **ruby-sdk:** adopt Mailbox 2 producer floor
17
+ * **ruby-sdk:** adopt Management 2 producer floor
18
+
19
+ ### Bug Fixes
20
+
21
+ * prepare mailbox SDK major releases ([dc01472](https://github.com/Sendmux/sendmux-sdk/commit/dc014724f7f6eb6b93293e6acbcc1a36c5060ebb))
22
+ * **ruby-sdk:** adopt Mailbox 2 producer floor ([051a621](https://github.com/Sendmux/sendmux-sdk/commit/051a6215f1ef2a8400696baba9a84d8b8d9d9aae))
23
+ * **ruby-sdk:** adopt Management 2 producer floor ([3c4fe75](https://github.com/Sendmux/sendmux-sdk/commit/3c4fe755c8be1b3afcd9b25aeb0aa4bb65be8556))
24
+ * **ruby-sdk:** require released sending 1.5.0 ([eaf5a80](https://github.com/Sendmux/sendmux-sdk/commit/eaf5a80d19abaca9db21e9c093a8713ad972d934))
25
+
26
+ ## [1.3.0](https://github.com/Sendmux/sendmux-sdk/compare/ruby-sdk/v1.2.0...ruby-sdk/v1.3.0) (2026-09-10)
27
+
28
+
29
+ ### Features
30
+
31
+ * add REST OAuth clients and CLI token lifecycle ([cc4a3aa](https://github.com/Sendmux/sendmux-sdk/commit/cc4a3aa6110378641418a94455ed5b9a986e65ff))
32
+
3
33
  ## [1.2.0](https://github.com/Sendmux/sendmux-sdk/compare/ruby-sdk/v1.1.0...ruby-sdk/v1.2.0) (2026-09-08)
4
34
 
5
35
 
data/README.md CHANGED
@@ -19,6 +19,8 @@ Umbrella Ruby SDK package for Sendmux.
19
19
  - A mailbox-scoped key beginning with `smx_mbx_` or scoped token beginning with `smx_agent_` for mailbox clients.
20
20
  - A root key beginning with `smx_root_` for management clients.
21
21
 
22
+ For OAuth, use a REST access token with the scopes and mailbox access required by the operation. See [OAuth for REST APIs](https://sendmux.ai/docs/developer-tools/oauth).
23
+
22
24
  ## Installation
23
25
 
24
26
  ```sh
@@ -28,7 +30,98 @@ gem install sendmux-sdk
28
30
  Or add it to your Gemfile:
29
31
 
30
32
  ```ruby
31
- gem "sendmux-sdk", "~> 1.0"
33
+ gem "sendmux-sdk", "~> 2.0"
34
+ ```
35
+
36
+ ## Migrate from 1.x to 2.0
37
+
38
+ `sendmux-sdk` 2.0 requires `sendmux-management >= 2.0.0, < 3.0` and
39
+ `sendmux-mailbox >= 2.0.0, < 3.0`, so it carries their two result-class changes;
40
+ `sendmux-sending` (now `>= 1.5.0, < 2.0`) and `sendmux-core` carry no breaking
41
+ change. The helper methods still return the surface gems' clients, so results
42
+ from `Sendmux::SDK.management(...)` and `Sendmux::SDK.mailbox(...)` follow
43
+ [the Management migration steps](../management/README.md#migrate-from-1x-to-20)
44
+ and [the Mailbox migration steps](../mailbox/README.md#migrate-from-1x-to-20).
45
+ If you check sending-account or thread-message result classes, read `variables`
46
+ from sending-account list entries, or build thread-message fixtures by hand,
47
+ update that code when upgrading to 2.0. Code that only reads other result
48
+ fields keeps working.
49
+
50
+ 1. `management_list_providers` returns `ProviderListItem` entries instead of
51
+ `ProviderItem`. List entries don't expose `variables`; detail results remain
52
+ `ProviderItem` and require a variables hash, which is empty when none are
53
+ set. Update list-specific class checks to use the class loaded by the
54
+ umbrella entry point, and fetch the detail when you need an account's
55
+ variables:
56
+
57
+ ```ruby
58
+ require "sendmux/sdk"
59
+
60
+ def provider_list_item?(item)
61
+ # Before: item.is_a?(Sendmux::Management::Generated::ProviderItem)
62
+ item.is_a?(Sendmux::Management::Generated::ProviderListItem)
63
+ end
64
+
65
+ def provider_variables(management, public_id)
66
+ detail = management.sending_accounts.management_get_provider(public_id).data
67
+ detail.variables
68
+ end
69
+ ```
70
+
71
+ Pass the client returned by `Sendmux::SDK.management(...)` as `management`
72
+ and the account's `id` as `public_id`. Don't convert a list entry into
73
+ `ProviderItem` or substitute an empty variables hash for the account's actual
74
+ variables. Update hand-built detail fixtures to include `variables: {}` when
75
+ no variables are set.
76
+
77
+ 2. `mailbox_list_thread_messages` returns
78
+ `MailboxThreadMessageSummaryCursorListResponse` instead of
79
+ `MailboxMessageSummaryCursorListResponse`: its `meta` is
80
+ `MailboxThreadMessagesMeta`, whose `thread_id` is required and whose
81
+ `sync_state` is an optional string. Update thread-message class checks and
82
+ add the thread identity to every thread-message result you construct:
83
+
84
+ ```ruby
85
+ def thread_message_list?(response)
86
+ # Before: response.is_a?(Sendmux::Mailbox::Generated::MailboxMessageSummaryCursorListResponse)
87
+ response.is_a?(Sendmux::Mailbox::Generated::MailboxThreadMessageSummaryCursorListResponse)
88
+ end
89
+
90
+ def thread_message_fixture(thread_id)
91
+ # Before: meta: { request_id: "req_fixture" }
92
+ Sendmux::Mailbox::Generated::MailboxThreadMessageSummaryCursorListResponse.build_from_hash(
93
+ ok: true,
94
+ meta: { request_id: "req_fixture", thread_id: thread_id },
95
+ data: [],
96
+ pagination: { has_more: false }
97
+ )
98
+ end
99
+ ```
100
+
101
+ Ordinary `mailbox_list_messages` results remain
102
+ `MailboxMessageSummaryCursorListResponse` and have no thread identity. The
103
+ other Mailbox list families replace the generic `ResponseMeta` with typed
104
+ metadata whose `request_id` is unchanged and whose new fields are optional.
105
+
106
+ 3. Run your application's tests with the updated bundle. Verify that list
107
+ handling accepts `ProviderListItem` and only detail handling reads
108
+ `variables`. A constructed thread-message result without `meta.thread_id`
109
+ fails with `ArgumentError: thread_id cannot be nil`.
110
+
111
+ Update `sendmux-sdk`, `sendmux-mailbox`, `sendmux-management`, the bundle lock,
112
+ and affected call sites or fixtures together. To roll back, restore those gem
113
+ requirements, lock, and call-site changes together.
114
+
115
+ ## OAuth access tokens
116
+
117
+ Pass either `api_key:` or `access_token:`. `access_token:` accepts a bare token string or a callable; the callable is evaluated once per authenticated request. Your application owns token storage, expiry checks and refresh coordination.
118
+
119
+ ```ruby
120
+ require "sendmux/sdk"
121
+
122
+ client = Sendmux::SDK.management(
123
+ access_token: -> { ENV.fetch("SENDMUX_ACCESS_TOKEN") }
124
+ )
32
125
  ```
33
126
 
34
127
  ## Usage
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sendmux
4
4
  module SDK
5
- VERSION = '1.2.0'
5
+ VERSION = '2.0.0'
6
6
  end
7
7
  end
data/lib/sendmux/sdk.rb CHANGED
@@ -8,16 +8,20 @@ require 'sendmux/sdk/version'
8
8
 
9
9
  module Sendmux
10
10
  module SDK
11
- def self.sending(api_key:, base_url: Sendmux::Sending::DEFAULT_BASE_URL, retry_options: nil)
12
- Sendmux::Sending::Client.new(api_key: api_key, base_url: base_url, retry_options: retry_options)
11
+ def self.sending(api_key: nil, access_token: nil, base_url: Sendmux::Sending::DEFAULT_BASE_URL, retry_options: nil)
12
+ Sendmux::Sending::Client.new(api_key: api_key, access_token: access_token,
13
+ base_url: base_url, retry_options: retry_options)
13
14
  end
14
15
 
15
- def self.mailbox(api_key:, base_url: Sendmux::Mailbox::DEFAULT_BASE_URL, retry_options: nil)
16
- Sendmux::Mailbox::Client.new(api_key: api_key, base_url: base_url, retry_options: retry_options)
16
+ def self.mailbox(api_key: nil, access_token: nil, base_url: Sendmux::Mailbox::DEFAULT_BASE_URL, retry_options: nil)
17
+ Sendmux::Mailbox::Client.new(api_key: api_key, access_token: access_token,
18
+ base_url: base_url, retry_options: retry_options)
17
19
  end
18
20
 
19
- def self.management(api_key:, base_url: Sendmux::Management::DEFAULT_BASE_URL, retry_options: nil)
20
- Sendmux::Management::Client.new(api_key: api_key, base_url: base_url, retry_options: retry_options)
21
+ def self.management(api_key: nil, access_token: nil, base_url: Sendmux::Management::DEFAULT_BASE_URL,
22
+ retry_options: nil)
23
+ Sendmux::Management::Client.new(api_key: api_key, access_token: access_token,
24
+ base_url: base_url, retry_options: retry_options)
21
25
  end
22
26
  end
23
27
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sendmux-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sendmux
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2026-09-08 00:00:00.000000000 Z
10
+ date: 2026-09-19 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: sendmux-core
@@ -15,7 +15,7 @@ dependencies:
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: 1.2.0
18
+ version: 1.3.0
19
19
  - - "<"
20
20
  - !ruby/object:Gem::Version
21
21
  version: '2.0'
@@ -25,7 +25,7 @@ dependencies:
25
25
  requirements:
26
26
  - - ">="
27
27
  - !ruby/object:Gem::Version
28
- version: 1.2.0
28
+ version: 1.3.0
29
29
  - - "<"
30
30
  - !ruby/object:Gem::Version
31
31
  version: '2.0'
@@ -35,47 +35,47 @@ dependencies:
35
35
  requirements:
36
36
  - - ">="
37
37
  - !ruby/object:Gem::Version
38
- version: 1.3.0
38
+ version: 2.0.0
39
39
  - - "<"
40
40
  - !ruby/object:Gem::Version
41
- version: '2.0'
41
+ version: '3.0'
42
42
  type: :runtime
43
43
  prerelease: false
44
44
  version_requirements: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - ">="
47
47
  - !ruby/object:Gem::Version
48
- version: 1.3.0
48
+ version: 2.0.0
49
49
  - - "<"
50
50
  - !ruby/object:Gem::Version
51
- version: '2.0'
51
+ version: '3.0'
52
52
  - !ruby/object:Gem::Dependency
53
53
  name: sendmux-management
54
54
  requirement: !ruby/object:Gem::Requirement
55
55
  requirements:
56
56
  - - ">="
57
57
  - !ruby/object:Gem::Version
58
- version: 1.2.0
58
+ version: 2.0.0
59
59
  - - "<"
60
60
  - !ruby/object:Gem::Version
61
- version: '2.0'
61
+ version: '3.0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 1.2.0
68
+ version: 2.0.0
69
69
  - - "<"
70
70
  - !ruby/object:Gem::Version
71
- version: '2.0'
71
+ version: '3.0'
72
72
  - !ruby/object:Gem::Dependency
73
73
  name: sendmux-sending
74
74
  requirement: !ruby/object:Gem::Requirement
75
75
  requirements:
76
76
  - - ">="
77
77
  - !ruby/object:Gem::Version
78
- version: 1.3.0
78
+ version: 1.5.0
79
79
  - - "<"
80
80
  - !ruby/object:Gem::Version
81
81
  version: '2.0'
@@ -85,7 +85,7 @@ dependencies:
85
85
  requirements:
86
86
  - - ">="
87
87
  - !ruby/object:Gem::Version
88
- version: 1.3.0
88
+ version: 1.5.0
89
89
  - - "<"
90
90
  - !ruby/object:Gem::Version
91
91
  version: '2.0'