sendly 3.18.2 → 3.19.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: bade33a147b49cd340671aaf86a187388360ba9c2e8d58fa0d51b6b486620bb8
4
- data.tar.gz: eb35d212b0466da3fe3ae102e80a8314a0fd6081f8a8e1c89e680ad715c7fb7f
3
+ metadata.gz: 9258e29e863797fbc0b0fd1b9bb284aa96bb5c62ae3bda82975569ca300aa283
4
+ data.tar.gz: 832f2ea2e2ad204d5430ff67159a54d1add7b611556d59647193f70eb06536a7
5
5
  SHA512:
6
- metadata.gz: 321cb814654988946c7029a44233383a28caaae97702d374669ad77be6b9c277befc22166fd42f16018f90d723ab4ee1050c1dbccd4483d3e636ea3ccffbf8fa
7
- data.tar.gz: 9f1244a84aa2c84848e83fc74eb15bdcf2aea5ecaebf1e3406796a6d64aeb4e6c081cf81555455e0be89a2cfbed20439225f1301d99bd61d74876236a261e9fb
6
+ metadata.gz: c5a19a1b90bc8241474c5e9b98013384b4c326db89ffc0ecaafe1519f78b112451e1a598ab42a03c7e1eeaa45b3ed829bb4ad940888526245be2bcc895cada3a
7
+ data.tar.gz: 83c2d120131cd432a07877215cf90dc824abb60e0d28feda878e103705ab762c5f8036ad9f5997978509d3621088eb8f37802e77cd27ad773b649ff98f7a1f9c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sendly (3.18.2)
4
+ sendly (3.19.1)
5
5
  faraday (~> 2.0)
6
6
  faraday-retry (~> 2.0)
7
7
 
data/README.md CHANGED
@@ -387,14 +387,14 @@ result = client.enterprise.provision(
387
387
  name: "Acme Insurance - Austin",
388
388
  source_workspace_id: "ws_verified",
389
389
  credit_amount: 5000,
390
- credit_source_workspace_id: "ws_pool",
390
+ credit_source_workspace_id: "SOURCE_WORKSPACE_ID",
391
391
  key_name: "Production",
392
392
  key_type: "live",
393
393
  generate_opt_in_page: true
394
394
  )
395
395
 
396
396
  puts result["workspace"]["id"]
397
- puts result["apiKey"]["rawKey"]
397
+ puts result["key"]["key"]
398
398
  ```
399
399
 
400
400
  Three provisioning modes:
@@ -422,7 +422,7 @@ client.enterprise.workspaces.transfer_credits("ws_dest",
422
422
 
423
423
  key = client.enterprise.workspaces.create_key("ws_xxx",
424
424
  name: "Production", type: "live")
425
- puts key["rawKey"]
425
+ puts key["key"]
426
426
 
427
427
  client.enterprise.workspaces.revoke_key("ws_xxx", "key_abc")
428
428
  ```
data/lib/sendly/client.rb CHANGED
@@ -20,21 +20,26 @@ module Sendly
20
20
  # @return [Integer] Maximum retry attempts
21
21
  attr_reader :max_retries
22
22
 
23
+ # @return [String, nil] Organization ID
24
+ attr_accessor :organization_id
25
+
23
26
  # Create a new Sendly client
24
27
  #
25
28
  # @param api_key [String] Your Sendly API key
26
29
  # @param base_url [String] API base URL (optional)
27
30
  # @param timeout [Integer] Request timeout in seconds (default: 30)
28
31
  # @param max_retries [Integer] Maximum retry attempts (default: 3)
32
+ # @param organization_id [String, nil] Organization ID (optional)
29
33
  #
30
34
  # @example
31
35
  # client = Sendly::Client.new("sk_live_v1_xxx")
32
36
  # client = Sendly::Client.new("sk_live_v1_xxx", timeout: 60, max_retries: 5)
33
- def initialize(api_key:, base_url: nil, timeout: 30, max_retries: 3)
37
+ def initialize(api_key:, base_url: nil, timeout: 30, max_retries: 3, organization_id: nil)
34
38
  @api_key = api_key
35
39
  @base_url = (base_url || Sendly.base_url).chomp("/")
36
40
  @timeout = timeout
37
41
  @max_retries = max_retries
42
+ @organization_id = organization_id || ENV["SENDLY_ORG_ID"]
38
43
 
39
44
  validate_api_key!
40
45
  end
@@ -173,6 +178,7 @@ module Sendly
173
178
  req["Accept"] = "application/json"
174
179
  req["User-Agent"] = "sendly-ruby/#{VERSION}"
175
180
  req["Content-Type"] = "multipart/form-data; boundary=#{boundary}"
181
+ req["X-Organization-Id"] = @organization_id if @organization_id
176
182
  req.body = body.join
177
183
 
178
184
  attempt = 0
@@ -280,6 +286,7 @@ module Sendly
280
286
  req["Content-Type"] = "application/json"
281
287
  req["Accept"] = "application/json"
282
288
  req["User-Agent"] = "sendly-ruby/#{VERSION}"
289
+ req["X-Organization-Id"] = @organization_id if @organization_id
283
290
 
284
291
  req.body = body.to_json if body
285
292
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sendly
4
- VERSION = "3.18.2"
4
+ VERSION = "3.19.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sendly
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.18.2
4
+ version: 3.19.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sendly
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-03-06 00:00:00.000000000 Z
11
+ date: 2026-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday