seam 2.133.0 → 2.133.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: bb7fca448b6ccc8cda4ea8b19365646faea00d731221a22ac5bcc04a9448965c
4
- data.tar.gz: cadee3c19b14602929d12e388fc9af7e88294734ece88b64eb4d81ed0159f206
3
+ metadata.gz: 9cd822a95811c14500048401893ba903d42e4a5431bcfe6a038955beca50e22e
4
+ data.tar.gz: a4d7c7e7059b9cfb3a3a61395e9bb38d9f0768f3a8f389e3082d77ae3824e0ed
5
5
  SHA512:
6
- metadata.gz: 610f1ddc0fa62ef6957bbdcad5ddc093f1a4a29a7d758f2df29eae8e8eee7dc323a59efff675f140a0e2d6d4f7c6fe3041610b6b379fedc09241ba35c420242d
7
- data.tar.gz: 195a1e34533e3d32b846b42aad0aba9e61e5fed7f208b98074fbbf517fa611956781ad526cbb0faae8068f45d00670c839ee8d0cf779b651a6415ee0a77dc2f1
6
+ metadata.gz: 7b3078763143b252d99050c2397f6c71bd242d7971b95a514f104f3293a98a82b5369bde44e973051b4d36cd35491a542370bb8ba456813cbc418fe0a885981b
7
+ data.tar.gz: e2137dc8e0fa70965c73b9c92249ad067e5dfb0395bb8a4c7ed8346e7d6f7848dfff3ccf90e4e41268c4e634e5a643dbef6735274f9daab310736f3ff13a72b7
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- seam (2.133.0)
4
+ seam (2.133.1)
5
5
  faraday (~> 2.7)
6
6
  faraday-retry (~> 2.2)
7
7
  svix (~> 1.30)
data/Rakefile CHANGED
@@ -5,10 +5,7 @@ require "rspec/core/rake_task"
5
5
  require "standard/rake"
6
6
 
7
7
  RSpec::Core::RakeTask.new(:spec) do |t|
8
- t.pattern = [
9
- "spec/**/*_spec.rb",
10
- "lib/seam/*_spec.rb"
11
- ]
8
+ t.pattern = "spec/**/*_spec.rb"
12
9
  end
13
10
 
14
11
  task default: %i[lint test]
@@ -13,6 +13,10 @@ module Seam
13
13
  instance_variable_get(:"@#{key}")
14
14
  end
15
15
 
16
+ def to_h
17
+ @data
18
+ end
19
+
16
20
  private
17
21
 
18
22
  def create_accessor_methods
@@ -6,14 +6,23 @@ module Seam
6
6
  module Helpers
7
7
  module ActionAttempt
8
8
  def self.decide_and_wait(action_attempt, client, wait_for_action_attempt)
9
- if wait_for_action_attempt == true
10
- return wait_until_finished(action_attempt, client)
11
- elsif wait_for_action_attempt.is_a?(Hash)
12
- return wait_until_finished(action_attempt, client, timeout: wait_for_action_attempt[:timeout],
13
- polling_interval: wait_for_action_attempt[:polling_interval])
14
- end
9
+ return wait_until_finished(action_attempt, client) if wait_for_action_attempt == true
15
10
 
16
- action_attempt
11
+ options = wait_options(wait_for_action_attempt)
12
+ return action_attempt if options.nil?
13
+
14
+ wait_until_finished(action_attempt, client, timeout: options[:timeout],
15
+ polling_interval: options[:polling_interval])
16
+ end
17
+
18
+ # The client wraps its defaults in a DeepHashAccessor, so the hash form of
19
+ # this option reaches here as an accessor when it comes from the client
20
+ # and as a plain Hash when it comes from the method call.
21
+ def self.wait_options(wait_for_action_attempt)
22
+ case wait_for_action_attempt
23
+ when Hash then wait_for_action_attempt
24
+ when Seam::DeepHashAccessor then wait_for_action_attempt.to_h
25
+ end
17
26
  end
18
27
 
19
28
  def self.wait_until_finished(action_attempt, client, timeout: nil, polling_interval: nil)
data/lib/seam/http.rb CHANGED
@@ -8,11 +8,11 @@ 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: false)
11
+ def self.from_api_key(api_key, endpoint: nil, wait_for_action_attempt: true)
12
12
  Http::SingleWorkspace.from_api_key(api_key, endpoint: endpoint, wait_for_action_attempt: wait_for_action_attempt)
13
13
  end
14
14
 
15
- def self.from_personal_access_token(personal_access_token, workspace_id, endpoint: nil, wait_for_action_attempt: false)
15
+ def self.from_personal_access_token(personal_access_token, workspace_id, endpoint: nil, wait_for_action_attempt: true)
16
16
  Http::SingleWorkspace.from_personal_access_token(personal_access_token, workspace_id, endpoint: endpoint,
17
17
  wait_for_action_attempt: wait_for_action_attempt)
18
18
  end
@@ -18,13 +18,18 @@ module Seam
18
18
 
19
19
  def initialize(client: nil, api_key: nil, personal_access_token: nil, workspace_id: nil, endpoint: nil,
20
20
  wait_for_action_attempt: true, faraday_options: {}, faraday_retry_options: {})
21
- options = Http::Options.parse_options(api_key: api_key, personal_access_token: personal_access_token,
22
- workspace_id: workspace_id, endpoint: endpoint)
23
- @endpoint = options[:endpoint]
24
- @auth_headers = options[:auth_headers]
25
21
  @defaults = Seam::DeepHashAccessor.new({"wait_for_action_attempt" => wait_for_action_attempt})
26
- @client = client || Http::Request.create_faraday_client(@endpoint, @auth_headers, faraday_options,
27
- faraday_retry_options)
22
+
23
+ # A client carries its own endpoint and authorization, so the auth
24
+ # options are only parsed when one has to be built.
25
+ @client = client || begin
26
+ options = Http::Options.parse_options(api_key: api_key, personal_access_token: personal_access_token,
27
+ workspace_id: workspace_id, endpoint: endpoint)
28
+ @endpoint = options[:endpoint]
29
+ @auth_headers = options[:auth_headers]
30
+
31
+ Http::Request.create_faraday_client(@endpoint, @auth_headers, faraday_options, faraday_retry_options)
32
+ end
28
33
 
29
34
  initialize_routes(client: @client, defaults: @defaults)
30
35
  end
@@ -37,12 +42,12 @@ module Seam
37
42
  Paginator.new(request, params)
38
43
  end
39
44
 
40
- def self.from_api_key(api_key, endpoint: nil, wait_for_action_attempt: false, faraday_options: {}, faraday_retry_options: {})
45
+ def self.from_api_key(api_key, endpoint: nil, wait_for_action_attempt: true, faraday_options: {}, faraday_retry_options: {})
41
46
  new(api_key: api_key, endpoint: endpoint, wait_for_action_attempt: wait_for_action_attempt,
42
47
  faraday_options: faraday_options, faraday_retry_options: faraday_retry_options)
43
48
  end
44
49
 
45
- def self.from_personal_access_token(personal_access_token, workspace_id, endpoint: nil, wait_for_action_attempt: false, faraday_options: {}, faraday_retry_options: {})
50
+ def self.from_personal_access_token(personal_access_token, workspace_id, endpoint: nil, wait_for_action_attempt: true, faraday_options: {}, faraday_retry_options: {})
46
51
  new(personal_access_token: personal_access_token, workspace_id: workspace_id, endpoint: endpoint,
47
52
  wait_for_action_attempt: wait_for_action_attempt, faraday_options: faraday_options, faraday_retry_options: faraday_retry_options)
48
53
  end
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.0"
4
+ VERSION = "2.133.1"
5
5
  end
data/lib/seam.rb CHANGED
@@ -11,11 +11,11 @@ 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: false)
14
+ def self.from_api_key(api_key, endpoint: nil, wait_for_action_attempt: true)
15
15
  Seam::Http.from_api_key(api_key, endpoint: endpoint, wait_for_action_attempt: wait_for_action_attempt)
16
16
  end
17
17
 
18
- def self.from_personal_access_token(personal_access_token, workspace_id, endpoint: nil, wait_for_action_attempt: false)
18
+ def self.from_personal_access_token(personal_access_token, workspace_id, endpoint: nil, wait_for_action_attempt: true)
19
19
  Seam::Http.from_personal_access_token(personal_access_token, workspace_id, endpoint: endpoint, wait_for_action_attempt: wait_for_action_attempt)
20
20
  end
21
21
 
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.0
4
+ version: 2.133.1
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-07-29 00:00:00.000000000 Z
11
+ date: 2026-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday