seam 2.135.0 → 2.136.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 +17 -7
- data/lib/seam/auth.rb +1 -1
- data/lib/seam/{http_multi_workspace.rb → http_without_workspace.rb} +4 -3
- data/lib/seam/version.rb +1 -1
- data/lib/seam.rb +1 -1
- 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: 506d30f07fafa716408338a2bcb0b94aea070710c4b71fedb131b79a63a280d2
|
|
4
|
+
data.tar.gz: 2c4bc6c73eb5abb62e19d411c107da8d2b1d66aaabd137d31f4155588fa1b2c4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eb904b8d5e40221534a27639eda8c2bdd314319099cd9bff08ea84e1024f3292d918c73abb0c243dd2701bb491a7b36fc2b321ae69f7ad7fe02320b1c1a7772b
|
|
7
|
+
data.tar.gz: 4ae995b4d293fd9b9580dcd9af6c67d69217be1db61a626b2c5fe9e353cecf6d0c319f4183fc4d3ba7a279a5995fde42ad930f82d89bae2d6b8dee8fd36c5dd5
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -32,7 +32,8 @@ accurate and fully typed.
|
|
|
32
32
|
- [Resume pagination](#resume-pagination)
|
|
33
33
|
- [Iterate over all resources](#iterate-over-all-resources)
|
|
34
34
|
- [Return all resources across all pages as a list](#return-all-resources-across-all-pages-as-a-list)
|
|
35
|
-
- [
|
|
35
|
+
- [Requests without a Workspace in scope](#requests-without-a-workspace-in-scope)
|
|
36
|
+
- [Personal Access Token](#personal-access-token-1)
|
|
36
37
|
- [Webhooks](#webhooks)
|
|
37
38
|
- [Advanced Usage](#advanced-usage)
|
|
38
39
|
- [Additional Options](#additional-options)
|
|
@@ -314,18 +315,27 @@ paginator = seam.create_paginator(seam.devices.method(:list), {limit: 20})
|
|
|
314
315
|
all_devices = paginator.flatten_to_list
|
|
315
316
|
```
|
|
316
317
|
|
|
317
|
-
###
|
|
318
|
+
### Requests without a Workspace in scope
|
|
318
319
|
|
|
319
|
-
Some Seam API endpoints
|
|
320
|
+
Some Seam API endpoints do not require a workspace in scope.
|
|
321
|
+
The `Seam::Http::WithoutWorkspace` client is not bound to a specific workspace
|
|
322
|
+
and may use those endpoints with a personal access token authentication method.
|
|
320
323
|
|
|
321
|
-
|
|
324
|
+
#### Personal Access Token
|
|
325
|
+
|
|
326
|
+
A Personal Access Token is scoped to a Seam Console user.
|
|
327
|
+
Obtain one from the Seam Console.
|
|
322
328
|
|
|
323
329
|
```ruby
|
|
324
|
-
# Pass as
|
|
325
|
-
seam = Seam::Http::
|
|
330
|
+
# Pass as a keyword argument to the constructor
|
|
331
|
+
seam = Seam::Http::WithoutWorkspace.new(
|
|
332
|
+
personal_access_token: "your-personal-access-token"
|
|
333
|
+
)
|
|
326
334
|
|
|
327
335
|
# Use the factory method
|
|
328
|
-
seam = Seam::Http::
|
|
336
|
+
seam = Seam::Http::WithoutWorkspace.from_personal_access_token(
|
|
337
|
+
"your-personal-access-token"
|
|
338
|
+
)
|
|
329
339
|
|
|
330
340
|
# List workspaces authorized for this Personal Access Token
|
|
331
341
|
workspaces = seam.workspaces.list
|
data/lib/seam/auth.rb
CHANGED
|
@@ -86,7 +86,7 @@ module Seam
|
|
|
86
86
|
}
|
|
87
87
|
end
|
|
88
88
|
|
|
89
|
-
def self.
|
|
89
|
+
def self.get_auth_headers_for_without_workspace_personal_access_token(personal_access_token)
|
|
90
90
|
if Auth.jwt?(personal_access_token)
|
|
91
91
|
raise SeamInvalidTokenError.new(
|
|
92
92
|
"A JWT cannot be used as a personal_access_token"
|
|
@@ -11,7 +11,7 @@ require_relative "routes/routes"
|
|
|
11
11
|
|
|
12
12
|
module Seam
|
|
13
13
|
module Http
|
|
14
|
-
class
|
|
14
|
+
class WithoutWorkspace
|
|
15
15
|
attr_reader :client, :defaults
|
|
16
16
|
|
|
17
17
|
def initialize(personal_access_token:, endpoint: nil, wait_for_action_attempt: true, timeout: nil,
|
|
@@ -19,7 +19,7 @@ module Seam
|
|
|
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
|
-
@auth_headers = Http::Auth.
|
|
22
|
+
@auth_headers = Http::Auth.get_auth_headers_for_without_workspace_personal_access_token(personal_access_token)
|
|
23
23
|
@client = Http::Request.create_faraday_client(@endpoint, @auth_headers, faraday_options,
|
|
24
24
|
faraday_retry_options, timeout: timeout)
|
|
25
25
|
end
|
|
@@ -36,7 +36,8 @@ 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,
|
|
39
|
+
def self.from_personal_access_token(personal_access_token, endpoint: nil, wait_for_action_attempt: true,
|
|
40
|
+
timeout: nil, faraday_options: {}, faraday_retry_options: {})
|
|
40
41
|
new(
|
|
41
42
|
personal_access_token: personal_access_token,
|
|
42
43
|
endpoint: endpoint,
|
data/lib/seam/version.rb
CHANGED
data/lib/seam.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: seam
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.136.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Seam Labs, Inc.
|
|
@@ -196,8 +196,8 @@ files:
|
|
|
196
196
|
- lib/seam/defaults.rb
|
|
197
197
|
- lib/seam/helpers/action_attempt.rb
|
|
198
198
|
- lib/seam/http.rb
|
|
199
|
-
- lib/seam/http_multi_workspace.rb
|
|
200
199
|
- lib/seam/http_single_workspace.rb
|
|
200
|
+
- lib/seam/http_without_workspace.rb
|
|
201
201
|
- lib/seam/lts_version.rb
|
|
202
202
|
- lib/seam/options.rb
|
|
203
203
|
- lib/seam/paginator.rb
|