qubrics-sdk 3.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 5e812f9dae708098f275ececf14149bd5423ac23694278e1f420bb3f35be02ed
4
+ data.tar.gz: 521c8ff7ece0dd4d40aa9cbdd6aabb2eec0f073752d652ac946a3fd17bf709a1
5
+ SHA512:
6
+ metadata.gz: a9fe408d59affafdbff0bf804d227aba16e1c415bef68f66825c7711f70a6f9babaa0a47efc1176d695cfa070a5b4430778fce0f21c96f76f6f83628604b138c
7
+ data.tar.gz: 9eafeef92030afdda91fe3cd16da81aee75478ee02b0fdb8da84e5699842c060b0f9faddfb7e56de4869b645648251fbdd67440ceea2b868a0fc28e12b0baff3
data/CHANGELOG.md ADDED
@@ -0,0 +1,70 @@
1
+ # Changelog
2
+
3
+ ## 3.0.0
4
+
5
+ ### Changed
6
+
7
+ * Load the SDK with `require 'qubrics/sdk'` and use `Qubrics::SDK`.
8
+ * Requires `qubrics-core` 2.x, `qubrics-sending` 2.x, `qubrics-mailbox` 3.x and `qubrics-management` 3.x.
9
+ * Calendar operations and models are excluded from the surface clients.
10
+
11
+ ## [2.0.0](https://github.com/Sendmux/sendmux-sdk/compare/ruby-sdk/v1.3.0...ruby-sdk/v2.0.0) (2026-09-19)
12
+
13
+
14
+ ### Changed
15
+
16
+ * **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)).
17
+
18
+ ### Dependencies
19
+
20
+ * `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.
21
+
22
+ ### ⚠ BREAKING CHANGES
23
+
24
+ * **ruby-sdk:** adopt Mailbox 2 producer floor
25
+ * **ruby-sdk:** adopt Management 2 producer floor
26
+
27
+ ### Bug Fixes
28
+
29
+ * prepare mailbox SDK major releases ([dc01472](https://github.com/Sendmux/sendmux-sdk/commit/dc014724f7f6eb6b93293e6acbcc1a36c5060ebb))
30
+ * **ruby-sdk:** adopt Mailbox 2 producer floor ([051a621](https://github.com/Sendmux/sendmux-sdk/commit/051a6215f1ef2a8400696baba9a84d8b8d9d9aae))
31
+ * **ruby-sdk:** adopt Management 2 producer floor ([3c4fe75](https://github.com/Sendmux/sendmux-sdk/commit/3c4fe755c8be1b3afcd9b25aeb0aa4bb65be8556))
32
+ * **ruby-sdk:** require released sending 1.5.0 ([eaf5a80](https://github.com/Sendmux/sendmux-sdk/commit/eaf5a80d19abaca9db21e9c093a8713ad972d934))
33
+
34
+ ## [1.3.0](https://github.com/Sendmux/sendmux-sdk/compare/ruby-sdk/v1.2.0...ruby-sdk/v1.3.0) (2026-09-10)
35
+
36
+
37
+ ### Features
38
+
39
+ * add REST OAuth clients and CLI token lifecycle ([cc4a3aa](https://github.com/Sendmux/sendmux-sdk/commit/cc4a3aa6110378641418a94455ed5b9a986e65ff))
40
+
41
+ ## [1.2.0](https://github.com/Sendmux/sendmux-sdk/compare/ruby-sdk/v1.1.0...ruby-sdk/v1.2.0) (2026-09-08)
42
+
43
+
44
+ ### Features
45
+
46
+ * **ruby-sdk:** require connection-capable client versions ([175f89f](https://github.com/Sendmux/sendmux-sdk/commit/175f89f9dbe72bb84a4c65b6db77d0223ce80d3f))
47
+
48
+ ## [1.1.0](https://github.com/Sendmux/sendmux-sdk/compare/ruby-sdk/v1.0.0...ruby-sdk/v1.1.0) (2026-07-01)
49
+
50
+
51
+ ### Features
52
+
53
+ * allow owner-approved agent tokens for sending ([9d1cb7d](https://github.com/Sendmux/sendmux-sdk/commit/9d1cb7df3df5aef1f59a4990dc087178ba3a7b21))
54
+
55
+
56
+ ### Bug Fixes
57
+
58
+ * **ruby-release:** require current component versions ([0e609e7](https://github.com/Sendmux/sendmux-sdk/commit/0e609e72630e05c29f93121dbac23946d0be7fe3))
59
+ * **ruby-release:** require current component versions ([6c4a97f](https://github.com/Sendmux/sendmux-sdk/commit/6c4a97f544aecde91e91e9649ddc9c824081eeb4))
60
+
61
+ ## 1.0.0 (2026-06-02)
62
+
63
+
64
+ ### Features
65
+
66
+ * **ruby:** add generated SDK packages ([f097fdf](https://github.com/Sendmux/sendmux-sdk/commit/f097fdf6afcbc2a048d9fdb1c9a669fff2a7ca4f))
67
+
68
+ ## 1.0.0
69
+
70
+ - Initial Ruby umbrella package.
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Sendmux
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,194 @@
1
+ # qubrics-sdk
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/qubrics-sdk.svg)](https://rubygems.org/gems/qubrics-sdk)
4
+ [![CI](https://github.com/qubrics/qubrics-sdk/actions/workflows/ci.yml/badge.svg)](https://github.com/qubrics/qubrics-sdk/actions/workflows/ci.yml)
5
+ [![Licence: MIT](https://img.shields.io/badge/licence-MIT-blue.svg)](https://github.com/qubrics/qubrics-sdk/blob/main/LICENSE)
6
+
7
+ Umbrella Ruby SDK package for Qubrics.
8
+
9
+ ## Documentation
10
+
11
+ - Ruby SDK guide: https://qubrics.com/docs/sdks/ruby
12
+ - Source: https://github.com/qubrics/qubrics-sdk/tree/main/packages/ruby/sdk
13
+ - Changelog: https://github.com/qubrics/qubrics-sdk/blob/main/packages/ruby/sdk/CHANGELOG.md
14
+
15
+ ## Requirements
16
+
17
+ - Ruby 3.1 or newer.
18
+ - A send-capable `smx_mbx_` key or owner-approved Sending-resource `smx_agent_` token for sending clients.
19
+ - A mailbox-scoped key beginning with `smx_mbx_` or scoped token beginning with `smx_agent_` for mailbox clients.
20
+ - A root key beginning with `smx_root_` for management clients.
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://qubrics.com/docs/developer-tools/oauth).
23
+
24
+ ## Installation
25
+
26
+ ```sh
27
+ gem install qubrics-sdk
28
+ ```
29
+
30
+ Or add it to your Gemfile:
31
+
32
+ ```ruby
33
+ gem "qubrics-sdk", "~> 3.0"
34
+ ```
35
+
36
+ ## Result model migration
37
+
38
+ The `qubrics-management` and `qubrics-mailbox` clients use the result classes
39
+ shown below. The umbrella helpers return the same clients, so results from
40
+ `Qubrics::SDK.management(...)` and `Qubrics::SDK.mailbox(...)` follow
41
+ [the Management migration steps](../management/README.md#provider-model-migration)
42
+ and [the Mailbox migration steps](../mailbox/README.md#thread-message-model-migration).
43
+ If you check sending-account or thread-message result classes, read `variables`
44
+ from sending-account list entries, or build thread-message fixtures by hand,
45
+ update that code to use the models below. Code that only reads other result
46
+ fields keeps working.
47
+
48
+ 1. `management_list_providers` returns `ProviderListItem` entries instead of
49
+ `ProviderItem`. List entries don't expose `variables`; detail results remain
50
+ `ProviderItem` and require a variables hash, which is empty when none are
51
+ set. Update list-specific class checks to use the class loaded by the
52
+ umbrella entry point, and fetch the detail when you need an account's
53
+ variables:
54
+
55
+ ```ruby
56
+ require "qubrics/sdk"
57
+
58
+ def provider_list_item?(item)
59
+ # Before: item.is_a?(Qubrics::Management::Generated::ProviderItem)
60
+ item.is_a?(Qubrics::Management::Generated::ProviderListItem)
61
+ end
62
+
63
+ def provider_variables(management, public_id)
64
+ detail = management.sending_accounts.management_get_provider(public_id).data
65
+ detail.variables
66
+ end
67
+ ```
68
+
69
+ Pass the client returned by `Qubrics::SDK.management(...)` as `management`
70
+ and the account's `id` as `public_id`. Don't convert a list entry into
71
+ `ProviderItem` or substitute an empty variables hash for the account's actual
72
+ variables. Update hand-built detail fixtures to include `variables: {}` when
73
+ no variables are set.
74
+
75
+ 2. `mailbox_list_thread_messages` returns
76
+ `MailboxThreadMessageSummaryCursorListResponse` instead of
77
+ `MailboxMessageSummaryCursorListResponse`: its `meta` is
78
+ `MailboxThreadMessagesMeta`, whose `thread_id` is required and whose
79
+ `sync_state` is an optional string. Update thread-message class checks and
80
+ add the thread identity to every thread-message result you construct:
81
+
82
+ ```ruby
83
+ def thread_message_list?(response)
84
+ # Before: response.is_a?(Qubrics::Mailbox::Generated::MailboxMessageSummaryCursorListResponse)
85
+ response.is_a?(Qubrics::Mailbox::Generated::MailboxThreadMessageSummaryCursorListResponse)
86
+ end
87
+
88
+ def thread_message_fixture(thread_id)
89
+ # Before: meta: { request_id: "req_fixture" }
90
+ Qubrics::Mailbox::Generated::MailboxThreadMessageSummaryCursorListResponse.build_from_hash(
91
+ ok: true,
92
+ meta: { request_id: "req_fixture", thread_id: thread_id },
93
+ data: [],
94
+ pagination: { has_more: false }
95
+ )
96
+ end
97
+ ```
98
+
99
+ Ordinary `mailbox_list_messages` results remain
100
+ `MailboxMessageSummaryCursorListResponse` and have no thread identity. The
101
+ other Mailbox list families replace the generic `ResponseMeta` with typed
102
+ metadata whose `request_id` is unchanged and whose new fields are optional.
103
+
104
+ 3. Run your application's tests with the updated bundle. Verify that list
105
+ handling accepts `ProviderListItem` and only detail handling reads
106
+ `variables`. A constructed thread-message result without `meta.thread_id`
107
+ fails with `ArgumentError: thread_id cannot be nil`.
108
+
109
+ Update `qubrics-sdk`, `qubrics-mailbox`, `qubrics-management`, the bundle lock,
110
+ and affected call sites or fixtures together. To roll back, restore those gem
111
+ requirements, lock, and call-site changes together.
112
+
113
+ ## OAuth access tokens
114
+
115
+ 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.
116
+
117
+ ```ruby
118
+ require "qubrics/sdk"
119
+
120
+ client = Qubrics::SDK.management(
121
+ access_token: -> { ENV.fetch("QUBRICS_ACCESS_TOKEN") }
122
+ )
123
+ ```
124
+
125
+ ## Usage
126
+
127
+ Use the umbrella gem when you want all Ruby SDK surfaces in one install.
128
+
129
+ ```ruby
130
+ require "qubrics/sdk"
131
+
132
+ sending = Qubrics::SDK.sending(
133
+ api_key: ENV.fetch("QUBRICS_MAILBOX_KEY")
134
+ )
135
+
136
+ mailbox = Qubrics::SDK.mailbox(
137
+ api_key: ENV.fetch("QUBRICS_MAILBOX_KEY")
138
+ )
139
+
140
+ management = Qubrics::SDK.management(
141
+ api_key: ENV.fetch("QUBRICS_ROOT_KEY")
142
+ )
143
+
144
+ puts sending.emails.class
145
+ puts mailbox.mailbox_api.class
146
+ puts management.mailboxes.class
147
+ ```
148
+
149
+ `Qubrics::Sdk` is available as an alias for `Qubrics::SDK`.
150
+
151
+ ### Surface clients
152
+
153
+ The umbrella package installs and re-exports:
154
+
155
+ - `qubrics-core`
156
+ - `qubrics-sending`
157
+ - `qubrics-mailbox`
158
+ - `qubrics-management`
159
+
160
+ The helper methods return the same clients exposed by the surface gems:
161
+
162
+ - `Qubrics::SDK.sending(...)` returns `Qubrics::Sending::Client`.
163
+ - `Qubrics::SDK.mailbox(...)` returns `Qubrics::Mailbox::Client`.
164
+ - `Qubrics::SDK.management(...)` returns `Qubrics::Management::Client`.
165
+
166
+ ### Retries, pagination, and errors
167
+
168
+ Pass `Qubrics::Core::RetryOptions` through any umbrella helper. Use `Qubrics::Core.each_cursor` and `Qubrics::Core::Headers` with the generated operation methods exactly as you would with the surface gems.
169
+
170
+ ```ruby
171
+ retry_options = Qubrics::Core::RetryOptions.new(max_attempts: 4)
172
+
173
+ management = Qubrics::SDK.management(
174
+ api_key: ENV.fetch("QUBRICS_ROOT_KEY"),
175
+ retry_options: retry_options
176
+ )
177
+
178
+ pager = Qubrics::Core.each_cursor(lambda do |opts|
179
+ management.mailboxes.management_list_mailboxes(opts.merge(limit: 50))
180
+ end)
181
+
182
+ pager.each { |mailbox| puts mailbox.id }
183
+ ```
184
+
185
+ Generated API errors are mapped to `Qubrics::Core::ApiError`.
186
+
187
+ ## Support
188
+
189
+ - Documentation: https://qubrics.com/docs
190
+ - Contact: contact@qubrics.com
191
+
192
+ ## Licence
193
+
194
+ MIT licence. See https://github.com/qubrics/qubrics-sdk/blob/main/LICENSE.
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Qubrics
4
+ module SDK
5
+ VERSION = '3.0.0'
6
+ end
7
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'qubrics/core'
4
+ require 'qubrics/mailbox'
5
+ require 'qubrics/management'
6
+ require 'qubrics/sending'
7
+ require 'qubrics/sdk/version'
8
+
9
+ module Qubrics
10
+ module SDK
11
+ def self.sending(api_key: nil, access_token: nil, base_url: nil, retry_options: nil)
12
+ Qubrics::Sending::Client.new(api_key: api_key, access_token: access_token,
13
+ base_url: base_url, retry_options: retry_options)
14
+ end
15
+
16
+ def self.mailbox(api_key: nil, access_token: nil, base_url: nil, retry_options: nil)
17
+ Qubrics::Mailbox::Client.new(api_key: api_key, access_token: access_token,
18
+ base_url: base_url, retry_options: retry_options)
19
+ end
20
+
21
+ def self.management(api_key: nil, access_token: nil, base_url: nil,
22
+ retry_options: nil)
23
+ Qubrics::Management::Client.new(api_key: api_key, access_token: access_token,
24
+ base_url: base_url, retry_options: retry_options)
25
+ end
26
+ end
27
+
28
+ Sdk = SDK
29
+ end
metadata ADDED
@@ -0,0 +1,127 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: qubrics-sdk
3
+ version: !ruby/object:Gem::Version
4
+ version: 3.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Qubrics
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 2026-11-19 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: qubrics-core
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: 2.0.0
19
+ - - "<"
20
+ - !ruby/object:Gem::Version
21
+ version: '3.0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: 2.0.0
29
+ - - "<"
30
+ - !ruby/object:Gem::Version
31
+ version: '3.0'
32
+ - !ruby/object:Gem::Dependency
33
+ name: qubrics-mailbox
34
+ requirement: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: 3.0.0
39
+ - - "<"
40
+ - !ruby/object:Gem::Version
41
+ version: '4.0'
42
+ type: :runtime
43
+ prerelease: false
44
+ version_requirements: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: 3.0.0
49
+ - - "<"
50
+ - !ruby/object:Gem::Version
51
+ version: '4.0'
52
+ - !ruby/object:Gem::Dependency
53
+ name: qubrics-management
54
+ requirement: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ version: 3.0.0
59
+ - - "<"
60
+ - !ruby/object:Gem::Version
61
+ version: '4.0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: 3.0.0
69
+ - - "<"
70
+ - !ruby/object:Gem::Version
71
+ version: '4.0'
72
+ - !ruby/object:Gem::Dependency
73
+ name: qubrics-sending
74
+ requirement: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: 2.0.0
79
+ - - "<"
80
+ - !ruby/object:Gem::Version
81
+ version: '3.0'
82
+ type: :runtime
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: 2.0.0
89
+ - - "<"
90
+ - !ruby/object:Gem::Version
91
+ version: '3.0'
92
+ email:
93
+ - contact@qubrics.com
94
+ executables: []
95
+ extensions: []
96
+ extra_rdoc_files: []
97
+ files:
98
+ - CHANGELOG.md
99
+ - LICENSE
100
+ - README.md
101
+ - lib/qubrics/sdk.rb
102
+ - lib/qubrics/sdk/version.rb
103
+ homepage: https://github.com/qubrics/qubrics-sdk
104
+ licenses:
105
+ - MIT
106
+ metadata:
107
+ homepage_uri: https://github.com/qubrics/qubrics-sdk
108
+ source_code_uri: https://github.com/qubrics/qubrics-sdk/tree/main/packages/ruby/sdk
109
+ changelog_uri: https://github.com/qubrics/qubrics-sdk/blob/main/packages/ruby/sdk/CHANGELOG.md
110
+ rdoc_options: []
111
+ require_paths:
112
+ - lib
113
+ required_ruby_version: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '3.1'
118
+ required_rubygems_version: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
123
+ requirements: []
124
+ rubygems_version: 3.6.2
125
+ specification_version: 4
126
+ summary: Umbrella Ruby SDK for Qubrics.
127
+ test_files: []