seam 2.133.1 → 2.134.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: 9cd822a95811c14500048401893ba903d42e4a5431bcfe6a038955beca50e22e
4
- data.tar.gz: a4d7c7e7059b9cfb3a3a61395e9bb38d9f0768f3a8f389e3082d77ae3824e0ed
3
+ metadata.gz: f3ffafcdfdbb5c40dc150484a2e283d55bf1cdd7685f0158a660c303c9719553
4
+ data.tar.gz: b9300c82c89d2c4b8056fdcb0b1cbb87c50c4df006de3fd8b06831b01d42930e
5
5
  SHA512:
6
- metadata.gz: 7b3078763143b252d99050c2397f6c71bd242d7971b95a514f104f3293a98a82b5369bde44e973051b4d36cd35491a542370bb8ba456813cbc418fe0a885981b
7
- data.tar.gz: e2137dc8e0fa70965c73b9c92249ad067e5dfb0395bb8a4c7ed8346e7d6f7848dfff3ccf90e4e41268c4e634e5a643dbef6735274f9daab310736f3ff13a72b7
6
+ metadata.gz: f0c5dc998b88e2b814f86a386bdfe02ef41e31d95f07963a54e7ccbb8bb245ae8911896580f507d785abfef25f14b9d504ac1c437857390047174a4a0f6fc715
7
+ data.tar.gz: 7b37c256db254e40232840de248352a00c84d9bda655e244708784a405d498446f4ae4b91d4544323419e6f535781ba965a65b712b434da978814a09476bc743
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- seam (2.133.1)
4
+ seam (2.134.0)
5
5
  faraday (~> 2.7)
6
6
  faraday-retry (~> 2.2)
7
7
  svix (~> 1.30)
data/README.md CHANGED
@@ -37,6 +37,7 @@ accurate and fully typed.
37
37
  - [Advanced Usage](#advanced-usage)
38
38
  - [Additional Options](#additional-options)
39
39
  - [Setting the endpoint](#setting-the-endpoint)
40
+ - [Setting the request timeout](#setting-the-request-timeout)
40
41
  - [Configuring the Faraday Client](#configuring-the-faraday-client)
41
42
  - [Using the Faraday Client](#using-the-faraday-client)
42
43
  - [Overriding the Client](#overriding-the-client)
@@ -381,6 +382,7 @@ the constructor takes some advanced options that affect behavior.
381
382
  seam = Seam.new(
382
383
  api_key: "your-api-key",
383
384
  endpoint: "https://example.com",
385
+ timeout: 30,
384
386
  faraday_options: {},
385
387
  faraday_retry_options: {}
386
388
  )
@@ -392,6 +394,7 @@ these options may be passed in as keyword arguments.
392
394
  ```ruby
393
395
  seam = Seam.from_api_key("some-api-key",
394
396
  endpoint: "https://example.com",
397
+ timeout: 30,
395
398
  faraday_options: {},
396
399
  faraday_retry_options: {})
397
400
  ```
@@ -403,6 +406,27 @@ e.g., testing or proxy setups. This option corresponds to the [Faraday](https://
403
406
 
404
407
  Either pass the `endpoint` option, or set the `SEAM_ENDPOINT` environment variable.
405
408
 
409
+ #### Setting the request timeout
410
+
411
+ Requests time out after 30 seconds by default.
412
+ Pass the `timeout` option, in seconds, to override this:
413
+
414
+ ```ruby
415
+ seam = Seam.new(api_key: "your-api-key", timeout: 60)
416
+ ```
417
+
418
+ The value sets both the Faraday `timeout` and `open_timeout`.
419
+ Either may be set independently via `faraday_options`, which takes precedence:
420
+
421
+ ```ruby
422
+ seam = Seam.new(
423
+ api_key: "your-api-key",
424
+ faraday_options: {request: {timeout: 60, open_timeout: 5}}
425
+ )
426
+ ```
427
+
428
+ A request that exceeds the timeout raises `Faraday::TimeoutError`.
429
+
406
430
  #### Configuring the Faraday Client
407
431
 
408
432
  The Faraday client and retry behavior may be configured with custom initiation options
@@ -2,4 +2,6 @@
2
2
 
3
3
  module Seam
4
4
  DEFAULT_ENDPOINT = "https://connect.getseam.com"
5
+
6
+ DEFAULT_TIMEOUT = 30
5
7
  end
data/lib/seam/http.rb CHANGED
@@ -8,13 +8,14 @@ module Seam
8
8
  Http::SingleWorkspace.new(**args)
9
9
  end
10
10
 
11
- def self.from_api_key(api_key, endpoint: nil, wait_for_action_attempt: true)
12
- Http::SingleWorkspace.from_api_key(api_key, endpoint: endpoint, wait_for_action_attempt: wait_for_action_attempt)
11
+ def self.from_api_key(api_key, endpoint: nil, wait_for_action_attempt: true, timeout: nil)
12
+ Http::SingleWorkspace.from_api_key(api_key, endpoint: endpoint, wait_for_action_attempt: wait_for_action_attempt,
13
+ timeout: timeout)
13
14
  end
14
15
 
15
- def self.from_personal_access_token(personal_access_token, workspace_id, endpoint: nil, wait_for_action_attempt: true)
16
+ def self.from_personal_access_token(personal_access_token, workspace_id, endpoint: nil, wait_for_action_attempt: true, timeout: nil)
16
17
  Http::SingleWorkspace.from_personal_access_token(personal_access_token, workspace_id, endpoint: endpoint,
17
- wait_for_action_attempt: wait_for_action_attempt)
18
+ wait_for_action_attempt: wait_for_action_attempt, timeout: timeout)
18
19
  end
19
20
 
20
21
  class ApiError < StandardError
@@ -14,14 +14,14 @@ module Seam
14
14
  class MultiWorkspace
15
15
  attr_reader :client, :defaults
16
16
 
17
- def initialize(personal_access_token:, endpoint: nil, wait_for_action_attempt: true, faraday_options: {},
18
- faraday_retry_options: {})
17
+ def initialize(personal_access_token:, endpoint: nil, wait_for_action_attempt: true, timeout: nil,
18
+ faraday_options: {}, faraday_retry_options: {})
19
19
  @wait_for_action_attempt = wait_for_action_attempt
20
20
  @defaults = {"wait_for_action_attempt" => wait_for_action_attempt}
21
21
  @endpoint = Http::Options.get_endpoint(endpoint)
22
22
  @auth_headers = Http::Auth.get_auth_headers_for_multi_workspace_personal_access_token(personal_access_token)
23
23
  @client = Http::Request.create_faraday_client(@endpoint, @auth_headers, faraday_options,
24
- faraday_retry_options)
24
+ faraday_retry_options, timeout: timeout)
25
25
  end
26
26
 
27
27
  def self.lts_version
@@ -36,11 +36,12 @@ module Seam
36
36
  @workspaces ||= WorkspacesProxy.new(Seam::Clients::Workspaces.new(client: @client, defaults: @defaults))
37
37
  end
38
38
 
39
- def self.from_personal_access_token(personal_access_token, endpoint: nil, wait_for_action_attempt: true, faraday_options: {}, faraday_retry_options: {})
39
+ def self.from_personal_access_token(personal_access_token, endpoint: nil, wait_for_action_attempt: true, timeout: nil, faraday_options: {}, faraday_retry_options: {})
40
40
  new(
41
41
  personal_access_token: personal_access_token,
42
42
  endpoint: endpoint,
43
43
  wait_for_action_attempt: wait_for_action_attempt,
44
+ timeout: timeout,
44
45
  faraday_options: faraday_options,
45
46
  faraday_retry_options: faraday_retry_options
46
47
  )
@@ -17,7 +17,7 @@ module Seam
17
17
  attr_reader :client, :defaults
18
18
 
19
19
  def initialize(client: nil, api_key: nil, personal_access_token: nil, workspace_id: nil, endpoint: nil,
20
- wait_for_action_attempt: true, faraday_options: {}, faraday_retry_options: {})
20
+ wait_for_action_attempt: true, timeout: nil, faraday_options: {}, faraday_retry_options: {})
21
21
  @defaults = Seam::DeepHashAccessor.new({"wait_for_action_attempt" => wait_for_action_attempt})
22
22
 
23
23
  # A client carries its own endpoint and authorization, so the auth
@@ -28,7 +28,8 @@ module Seam
28
28
  @endpoint = options[:endpoint]
29
29
  @auth_headers = options[:auth_headers]
30
30
 
31
- Http::Request.create_faraday_client(@endpoint, @auth_headers, faraday_options, faraday_retry_options)
31
+ Http::Request.create_faraday_client(@endpoint, @auth_headers, faraday_options, faraday_retry_options,
32
+ timeout: timeout)
32
33
  end
33
34
 
34
35
  initialize_routes(client: @client, defaults: @defaults)
@@ -42,14 +43,14 @@ module Seam
42
43
  Paginator.new(request, params)
43
44
  end
44
45
 
45
- def self.from_api_key(api_key, endpoint: nil, wait_for_action_attempt: true, faraday_options: {}, faraday_retry_options: {})
46
+ def self.from_api_key(api_key, endpoint: nil, wait_for_action_attempt: true, timeout: nil, faraday_options: {}, faraday_retry_options: {})
46
47
  new(api_key: api_key, endpoint: endpoint, wait_for_action_attempt: wait_for_action_attempt,
47
- faraday_options: faraday_options, faraday_retry_options: faraday_retry_options)
48
+ timeout: timeout, faraday_options: faraday_options, faraday_retry_options: faraday_retry_options)
48
49
  end
49
50
 
50
- def self.from_personal_access_token(personal_access_token, workspace_id, endpoint: nil, wait_for_action_attempt: true, faraday_options: {}, faraday_retry_options: {})
51
+ def self.from_personal_access_token(personal_access_token, workspace_id, endpoint: nil, wait_for_action_attempt: true, timeout: nil, faraday_options: {}, faraday_retry_options: {})
51
52
  new(personal_access_token: personal_access_token, workspace_id: workspace_id, endpoint: endpoint,
52
- wait_for_action_attempt: wait_for_action_attempt, faraday_options: faraday_options, faraday_retry_options: faraday_retry_options)
53
+ wait_for_action_attempt: wait_for_action_attempt, timeout: timeout, faraday_options: faraday_options, faraday_retry_options: faraday_retry_options)
53
54
  end
54
55
  end
55
56
  end
data/lib/seam/options.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "default_endpoint"
3
+ require_relative "defaults"
4
4
 
5
5
  module Seam
6
6
  module Http
data/lib/seam/request.rb CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  require "faraday"
4
4
  require "faraday/retry"
5
+ require_relative "defaults"
5
6
  require_relative "lts_version"
6
7
  require_relative "version"
7
8
  require_relative "paginator"
@@ -9,10 +10,15 @@ require_relative "paginator"
9
10
  module Seam
10
11
  module Http
11
12
  module Request
12
- def self.create_faraday_client(endpoint, auth_headers, faraday_options = {}, faraday_retry_options = {})
13
+ def self.create_faraday_client(endpoint, auth_headers, faraday_options = {}, faraday_retry_options = {},
14
+ timeout: nil)
15
+ timeout ||= Seam::DEFAULT_TIMEOUT
16
+
13
17
  default_options = {
14
18
  url: endpoint,
15
- headers: auth_headers.merge(default_headers)
19
+ headers: auth_headers.merge(default_headers),
20
+ # open_timeout bounds the connect phase, which timeout does not cover.
21
+ request: {timeout: timeout, open_timeout: timeout}
16
22
  }
17
23
 
18
24
  options = deep_merge(default_options, faraday_options)
data/lib/seam/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Seam
4
- VERSION = "2.133.1"
4
+ VERSION = "2.134.0"
5
5
  end
data/lib/seam.rb CHANGED
@@ -11,12 +11,13 @@ module Seam
11
11
  Seam::Http.new(**args)
12
12
  end
13
13
 
14
- def self.from_api_key(api_key, endpoint: nil, wait_for_action_attempt: true)
15
- Seam::Http.from_api_key(api_key, endpoint: endpoint, wait_for_action_attempt: wait_for_action_attempt)
14
+ def self.from_api_key(api_key, endpoint: nil, wait_for_action_attempt: true, timeout: nil)
15
+ Seam::Http.from_api_key(api_key, endpoint: endpoint, wait_for_action_attempt: wait_for_action_attempt,
16
+ timeout: timeout)
16
17
  end
17
18
 
18
- def self.from_personal_access_token(personal_access_token, workspace_id, endpoint: nil, wait_for_action_attempt: true)
19
- Seam::Http.from_personal_access_token(personal_access_token, workspace_id, endpoint: endpoint, wait_for_action_attempt: wait_for_action_attempt)
19
+ def self.from_personal_access_token(personal_access_token, workspace_id, endpoint: nil, wait_for_action_attempt: true, timeout: nil)
20
+ Seam::Http.from_personal_access_token(personal_access_token, workspace_id, endpoint: endpoint, wait_for_action_attempt: wait_for_action_attempt, timeout: timeout)
20
21
  end
21
22
 
22
23
  def self.lts_version
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seam
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.133.1
4
+ version: 2.134.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seam Labs, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-08-06 00:00:00.000000000 Z
11
+ date: 2026-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -193,7 +193,7 @@ files:
193
193
  - lib/seam/auth.rb
194
194
  - lib/seam/base_resource.rb
195
195
  - lib/seam/deep_hash_accessor.rb
196
- - lib/seam/default_endpoint.rb
196
+ - lib/seam/defaults.rb
197
197
  - lib/seam/helpers/action_attempt.rb
198
198
  - lib/seam/http.rb
199
199
  - lib/seam/http_multi_workspace.rb