seam 2.136.0 → 2.138.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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +6 -0
- data/lib/seam/http_single_workspace.rb +0 -4
- data/lib/seam/http_without_workspace.rb +7 -12
- data/lib/seam/parse_options.rb +45 -1
- data/lib/seam/request.rb +1 -3
- data/lib/seam/version.rb +1 -1
- data/lib/seam.rb +0 -5
- metadata +2 -3
- data/lib/seam/lts_version.rb +0 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a900e1dbd5b83ee9c188064f4dd1cbb4ae3c0b70c7fb022b99441248d6e1f053
|
|
4
|
+
data.tar.gz: '04182a6dd0f06b10d1198d5a71ffda24e2bacec06a4b60d75d2df7c36e7ab8e1'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e62a991868e5415256b134dcc34161535f088b8e285e2129644e210dade3a9a365f7e812c51b201f327bc4a1c61490dbbe1d806485f540d56e3921011b45c3d2
|
|
7
|
+
data.tar.gz: 66a2f9eb59caeb846ed98d48a6717a2a9a411361455a53d294daeb6b402048c58796da36dbb62fb7b7bef4a305092d30ed354443811dcca133d10bd0af78ac6c
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -121,6 +121,9 @@ Obtain one from the Seam Console.
|
|
|
121
121
|
A workspace ID must be provided when using this method and all requests will be scoped to that workspace.
|
|
122
122
|
|
|
123
123
|
```ruby
|
|
124
|
+
# Set the `SEAM_PERSONAL_ACCESS_TOKEN` and `SEAM_WORKSPACE_ID` environment variables
|
|
125
|
+
seam = Seam.new
|
|
126
|
+
|
|
124
127
|
# Pass as an option to the constructor
|
|
125
128
|
seam = Seam.new(
|
|
126
129
|
personal_access_token: "your-personal-access-token",
|
|
@@ -327,6 +330,9 @@ A Personal Access Token is scoped to a Seam Console user.
|
|
|
327
330
|
Obtain one from the Seam Console.
|
|
328
331
|
|
|
329
332
|
```ruby
|
|
333
|
+
# Set the `SEAM_PERSONAL_ACCESS_TOKEN` environment variable
|
|
334
|
+
seam = Seam::Http::WithoutWorkspace.new
|
|
335
|
+
|
|
330
336
|
# Pass as a keyword argument to the constructor
|
|
331
337
|
seam = Seam::Http::WithoutWorkspace.new(
|
|
332
338
|
personal_access_token: "your-personal-access-token"
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
require_relative "request"
|
|
4
4
|
require_relative "parse_options"
|
|
5
|
-
require_relative "lts_version"
|
|
6
5
|
require_relative "version"
|
|
7
6
|
require_relative "auth"
|
|
8
7
|
require_relative "resources/index"
|
|
@@ -14,22 +13,18 @@ module Seam
|
|
|
14
13
|
class WithoutWorkspace
|
|
15
14
|
attr_reader :client, :defaults
|
|
16
15
|
|
|
17
|
-
def initialize(personal_access_token
|
|
16
|
+
def initialize(personal_access_token: nil, endpoint: nil, wait_for_action_attempt: true, timeout: nil,
|
|
18
17
|
faraday_options: {}, faraday_retry_options: {})
|
|
19
18
|
@wait_for_action_attempt = wait_for_action_attempt
|
|
20
19
|
@defaults = {"wait_for_action_attempt" => wait_for_action_attempt}
|
|
21
|
-
@endpoint = Http::Options.get_endpoint(endpoint)
|
|
22
|
-
@auth_headers = Http::Auth.get_auth_headers_for_without_workspace_personal_access_token(personal_access_token)
|
|
23
|
-
@client = Http::Request.create_faraday_client(@endpoint, @auth_headers, faraday_options,
|
|
24
|
-
faraday_retry_options, timeout: timeout)
|
|
25
|
-
end
|
|
26
20
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
options = Http::Options.parse_without_workspace_options(personal_access_token: personal_access_token,
|
|
22
|
+
endpoint: endpoint)
|
|
23
|
+
@endpoint = options[:endpoint]
|
|
24
|
+
@auth_headers = options[:auth_headers]
|
|
30
25
|
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
@client = Http::Request.create_faraday_client(@endpoint, @auth_headers, faraday_options,
|
|
27
|
+
faraday_retry_options, timeout: timeout)
|
|
33
28
|
end
|
|
34
29
|
|
|
35
30
|
def workspaces
|
data/lib/seam/parse_options.rb
CHANGED
|
@@ -7,7 +7,9 @@ module Seam
|
|
|
7
7
|
module Http
|
|
8
8
|
module Options
|
|
9
9
|
def self.parse_options(api_key: nil, personal_access_token: nil, workspace_id: nil, endpoint: nil)
|
|
10
|
-
api_key ||=
|
|
10
|
+
api_key ||= get_api_key_from_env(personal_access_token)
|
|
11
|
+
personal_access_token ||= get_personal_access_token_from_env(api_key)
|
|
12
|
+
workspace_id ||= ENV["SEAM_WORKSPACE_ID"]
|
|
11
13
|
|
|
12
14
|
auth_headers = Http::Auth.get_auth_headers(
|
|
13
15
|
api_key: api_key,
|
|
@@ -18,6 +20,48 @@ module Seam
|
|
|
18
20
|
|
|
19
21
|
{auth_headers: auth_headers, endpoint: endpoint}
|
|
20
22
|
end
|
|
23
|
+
|
|
24
|
+
def self.parse_without_workspace_options(personal_access_token: nil, endpoint: nil)
|
|
25
|
+
personal_access_token ||= ENV["SEAM_PERSONAL_ACCESS_TOKEN"]
|
|
26
|
+
|
|
27
|
+
if personal_access_token.nil?
|
|
28
|
+
raise SeamInvalidOptionsError.new(
|
|
29
|
+
"Must specify a personal_access_token. " \
|
|
30
|
+
"Attempted reading configuration from the environment, " \
|
|
31
|
+
"but the environment variable SEAM_PERSONAL_ACCESS_TOKEN is not set."
|
|
32
|
+
)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
auth_headers = Http::Auth.get_auth_headers_for_without_workspace_personal_access_token(personal_access_token)
|
|
36
|
+
endpoint = Http::Options.get_endpoint(endpoint)
|
|
37
|
+
|
|
38
|
+
{auth_headers: auth_headers, endpoint: endpoint}
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# A personal access token passed as an option takes precedence over the
|
|
42
|
+
# environment, so the environment is not consulted when one is given.
|
|
43
|
+
def self.get_api_key_from_env(personal_access_token)
|
|
44
|
+
return nil unless personal_access_token.nil?
|
|
45
|
+
|
|
46
|
+
api_key = ENV["SEAM_API_KEY"]
|
|
47
|
+
|
|
48
|
+
if api_key && ENV["SEAM_PERSONAL_ACCESS_TOKEN"]
|
|
49
|
+
raise SeamInvalidOptionsError.new(
|
|
50
|
+
"Both SEAM_API_KEY and SEAM_PERSONAL_ACCESS_TOKEN environment variables are defined. " \
|
|
51
|
+
"Please use only one authentication method."
|
|
52
|
+
)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
api_key
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# An api_key, whether passed as an option or read from the environment,
|
|
59
|
+
# takes precedence, so the environment is not consulted when one is set.
|
|
60
|
+
def self.get_personal_access_token_from_env(api_key)
|
|
61
|
+
return nil unless api_key.nil?
|
|
62
|
+
|
|
63
|
+
ENV["SEAM_PERSONAL_ACCESS_TOKEN"]
|
|
64
|
+
end
|
|
21
65
|
end
|
|
22
66
|
end
|
|
23
67
|
end
|
data/lib/seam/request.rb
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
require "faraday"
|
|
4
4
|
require "faraday/retry"
|
|
5
5
|
require_relative "defaults"
|
|
6
|
-
require_relative "lts_version"
|
|
7
6
|
require_relative "version"
|
|
8
7
|
require_relative "paginator"
|
|
9
8
|
|
|
@@ -43,8 +42,7 @@ module Seam
|
|
|
43
42
|
"User-Agent" => "seam-ruby/#{Seam::VERSION}",
|
|
44
43
|
"Content-Type" => "application/json",
|
|
45
44
|
:"seam-sdk-name" => "seamapi/ruby",
|
|
46
|
-
:"seam-sdk-version" => Seam::VERSION
|
|
47
|
-
:"seam-lts-version" => Seam::LTS_VERSION
|
|
45
|
+
:"seam-sdk-version" => Seam::VERSION
|
|
48
46
|
}
|
|
49
47
|
end
|
|
50
48
|
|
data/lib/seam/version.rb
CHANGED
data/lib/seam.rb
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require_relative "seam/lts_version"
|
|
4
3
|
require_relative "seam/http"
|
|
5
4
|
require_relative "seam/http_without_workspace"
|
|
6
5
|
require_relative "seam/webhook"
|
|
@@ -19,8 +18,4 @@ module Seam
|
|
|
19
18
|
def self.from_personal_access_token(personal_access_token, workspace_id, endpoint: nil, wait_for_action_attempt: true, timeout: nil)
|
|
20
19
|
Seam::Http.from_personal_access_token(personal_access_token, workspace_id, endpoint: endpoint, wait_for_action_attempt: wait_for_action_attempt, timeout: timeout)
|
|
21
20
|
end
|
|
22
|
-
|
|
23
|
-
def self.lts_version
|
|
24
|
-
Seam::LTS_VERSION
|
|
25
|
-
end
|
|
26
21
|
end
|
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.
|
|
4
|
+
version: 2.138.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-
|
|
11
|
+
date: 2026-08-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -198,7 +198,6 @@ files:
|
|
|
198
198
|
- lib/seam/http.rb
|
|
199
199
|
- lib/seam/http_single_workspace.rb
|
|
200
200
|
- lib/seam/http_without_workspace.rb
|
|
201
|
-
- lib/seam/lts_version.rb
|
|
202
201
|
- lib/seam/options.rb
|
|
203
202
|
- lib/seam/paginator.rb
|
|
204
203
|
- lib/seam/parse_options.rb
|