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 +4 -4
- data/Gemfile.lock +1 -1
- data/Rakefile +1 -4
- data/lib/seam/deep_hash_accessor.rb +4 -0
- data/lib/seam/helpers/action_attempt.rb +16 -7
- data/lib/seam/http.rb +2 -2
- data/lib/seam/http_single_workspace.rb +13 -8
- data/lib/seam/version.rb +1 -1
- data/lib/seam.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9cd822a95811c14500048401893ba903d42e4a5431bcfe6a038955beca50e22e
|
|
4
|
+
data.tar.gz: a4d7c7e7059b9cfb3a3a61395e9bb38d9f0768f3a8f389e3082d77ae3824e0ed
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7b3078763143b252d99050c2397f6c71bd242d7971b95a514f104f3293a98a82b5369bde44e973051b4d36cd35491a542370bb8ba456813cbc418fe0a885981b
|
|
7
|
+
data.tar.gz: e2137dc8e0fa70965c73b9c92249ad067e5dfb0395bb8a4c7ed8346e7d6f7848dfff3ccf90e4e41268c4e634e5a643dbef6735274f9daab310736f3ff13a72b7
|
data/Gemfile.lock
CHANGED
data/Rakefile
CHANGED
|
@@ -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
|
-
|
|
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:
|
|
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:
|
|
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
|
-
|
|
27
|
-
|
|
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:
|
|
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:
|
|
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
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:
|
|
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:
|
|
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.
|
|
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-
|
|
11
|
+
date: 2026-08-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|