seam 2.136.0 → 2.137.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: 506d30f07fafa716408338a2bcb0b94aea070710c4b71fedb131b79a63a280d2
4
- data.tar.gz: 2c4bc6c73eb5abb62e19d411c107da8d2b1d66aaabd137d31f4155588fa1b2c4
3
+ metadata.gz: 127b82c7a575d44523d96d4f7abeb7f6e2c08a0ef31f0578fe1e215a197cbbd5
4
+ data.tar.gz: b7f55dea5261cbb03284de35dd1a1905db3f7caeacf31d64a25082882b5a1349
5
5
  SHA512:
6
- metadata.gz: eb904b8d5e40221534a27639eda8c2bdd314319099cd9bff08ea84e1024f3292d918c73abb0c243dd2701bb491a7b36fc2b321ae69f7ad7fe02320b1c1a7772b
7
- data.tar.gz: 4ae995b4d293fd9b9580dcd9af6c67d69217be1db61a626b2c5fe9e353cecf6d0c319f4183fc4d3ba7a279a5995fde42ad930f82d89bae2d6b8dee8fd36c5dd5
6
+ metadata.gz: 33585716bb7d6d70c7936e5abd084414574eb9204a0ad728b57e94790972b5cc4a552ba145cf95c43d718eaae3febafd6ca3c52ebae88eba889f516e8d2af489
7
+ data.tar.gz: 153856dcd1afc01426ca4a6f00951c3231ae265963c1978c6ec5017d7b9e3a61269e91621f3d46ff01a50257422a8ec95d73a85d9739c6a8c82a93af0d13c50f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- seam (2.136.0)
4
+ seam (2.137.0)
5
5
  faraday (~> 2.7)
6
6
  faraday-retry (~> 2.2)
7
7
  svix (~> 1.30)
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"
@@ -14,12 +14,16 @@ module Seam
14
14
  class WithoutWorkspace
15
15
  attr_reader :client, :defaults
16
16
 
17
- def initialize(personal_access_token:, endpoint: nil, wait_for_action_attempt: true, timeout: nil,
17
+ def initialize(personal_access_token: nil, endpoint: nil, wait_for_action_attempt: true, timeout: nil,
18
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
- @endpoint = Http::Options.get_endpoint(endpoint)
22
- @auth_headers = Http::Auth.get_auth_headers_for_without_workspace_personal_access_token(personal_access_token)
21
+
22
+ options = Http::Options.parse_without_workspace_options(personal_access_token: personal_access_token,
23
+ endpoint: endpoint)
24
+ @endpoint = options[:endpoint]
25
+ @auth_headers = options[:auth_headers]
26
+
23
27
  @client = Http::Request.create_faraday_client(@endpoint, @auth_headers, faraday_options,
24
28
  faraday_retry_options, timeout: timeout)
25
29
  end
@@ -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 ||= ENV["SEAM_API_KEY"] if personal_access_token.nil?
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/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Seam
4
- VERSION = "2.136.0"
4
+ VERSION = "2.137.0"
5
5
  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.136.0
4
+ version: 2.137.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-12 00:00:00.000000000 Z
11
+ date: 2026-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday