seatlayer 0.4.0 → 0.5.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/CHANGELOG.md +8 -0
- data/lib/seatlayer/performance_groups.rb +105 -0
- data/lib/seatlayer/version.rb +1 -1
- data/lib/seatlayer.rb +4 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0ab55cb5752c5ddc06db43cfb1653248cebf2b0bd6c8b06be7b308653ca7f5cf
|
|
4
|
+
data.tar.gz: 44ec1f8c5e9f9da17e76c7e5913d1d1929ed4ca8be31d2fed6d24fc9d8521fe9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f1252c05e9535563f4459383151d4dd8b8d9699766fbbce0fe453f21e020b310fe6d315f176aa071b3282af1f390a9cc1fd78b3d1efbdbe12d8f67f71249375f
|
|
7
|
+
data.tar.gz: 11f5318bd9b583d2b818446569d7f6b33285966a5dd7544045a03e2dad82a3325c685b51ae290a754a60182c067122eb8bb0999c03b0fe3403919eb21cfd1178
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.5.0 — 2026-08-21
|
|
6
|
+
|
|
7
|
+
- Added `performance_groups`, the trusted server resource for fixed two-to-eight
|
|
8
|
+
performance runs. It creates and activates groups, mints one-time browser
|
|
9
|
+
access, retrieves authoritative group holds, and confirms bookings with
|
|
10
|
+
stable action and order references. Browser-only group routes remain outside
|
|
11
|
+
this secret-key SDK.
|
|
12
|
+
|
|
5
13
|
- Added `templates.instantiate_template` and the ticket-release lifecycle on
|
|
6
14
|
`events` (`list_ticket_releases`, `update_ticket_releases`, and
|
|
7
15
|
`close_ticket_release`). Template instantiation sends `{}` when no overrides
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module SeatLayer
|
|
4
|
+
# Fixed multi-performance runs. This is a secret-key surface: mint the
|
|
5
|
+
# browser token here, then give that token (never this client) to the
|
|
6
|
+
# PerformanceGroupPicker in the browser SDK.
|
|
7
|
+
class PerformanceGroups < Resource
|
|
8
|
+
# One page of fixed runs.
|
|
9
|
+
def list(workspace_id: nil, external_ref: nil, state: nil, limit: nil, cursor: nil)
|
|
10
|
+
@client.get("/v1/performance-groups", compact({ "workspaceId" => workspace_id,
|
|
11
|
+
"externalRef" => external_ref,
|
|
12
|
+
"state" => state, "limit" => limit,
|
|
13
|
+
"cursor" => cursor }))
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Create a draft from two to eight compatible assigned-seat events. The
|
|
17
|
+
# server validates compatibility and exactly replays a request with the
|
|
18
|
+
# same idempotency key.
|
|
19
|
+
def create(name:, event_keys:, external_ref: UNSET, idempotency_key: nil)
|
|
20
|
+
body = { "name" => name, "eventKeys" => event_keys }
|
|
21
|
+
body.merge!(supplied({ "externalRef" => external_ref }))
|
|
22
|
+
@client.post("/v1/performance-groups", body, idempotency_key: idempotency_key,
|
|
23
|
+
retry_policy: :header_replay)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def retrieve(performance_group_key)
|
|
27
|
+
@client.get(path(performance_group_key))
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Only a draft can be deleted. Activated runs retain their audit identity.
|
|
31
|
+
def delete(performance_group_key)
|
|
32
|
+
@client.delete(path(performance_group_key))
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Starts lifecycle coordination. When its response contains a non-terminal
|
|
36
|
+
# lifecycle operation, poll +retrieve_lifecycle+ until it completes.
|
|
37
|
+
def activate(performance_group_key, expected_revision:)
|
|
38
|
+
@client.post(path(performance_group_key, "/activate"),
|
|
39
|
+
{ "expectedRevision" => expected_revision })
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Stops new group sales. Poll +retrieve_lifecycle+ while the close remains pending.
|
|
43
|
+
def close(performance_group_key, expected_revision:)
|
|
44
|
+
@client.post(path(performance_group_key, "/close"),
|
|
45
|
+
{ "expectedRevision" => expected_revision })
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def retrieve_lifecycle(performance_group_key, operation_id)
|
|
49
|
+
@client.get(path(performance_group_key, "/lifecycle/#{encode(operation_id)}"))
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Reveals a one-time, origin-bound browser bearer. It intentionally remains
|
|
53
|
+
# single-attempt: a retry could create a token whose only reveal is lost.
|
|
54
|
+
def create_buyer_access_session(performance_group_key, allowed_origin:, include_public:,
|
|
55
|
+
channel_ids_by_event: nil, expires_in_seconds: nil,
|
|
56
|
+
max_quantity: UNSET, buyer_ref: UNSET, partner_ref: UNSET)
|
|
57
|
+
body = compact({ "allowedOrigin" => allowed_origin, "includePublic" => include_public,
|
|
58
|
+
"channelIdsByEvent" => channel_ids_by_event,
|
|
59
|
+
"expiresInSeconds" => expires_in_seconds })
|
|
60
|
+
body.merge!(supplied({ "maxQuantity" => max_quantity, "buyerRef" => buyer_ref,
|
|
61
|
+
"partnerRef" => partner_ref }))
|
|
62
|
+
@client.post(path(performance_group_key, "/buyer-access-sessions"), body)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Token records only: the bearer value is never returned again.
|
|
66
|
+
def list_buyer_access_sessions(performance_group_key, limit: nil)
|
|
67
|
+
@client.get(path(performance_group_key, "/buyer-access-sessions"), { "limit" => limit })
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def revoke_buyer_access_session(performance_group_key, session_id)
|
|
71
|
+
@client.delete(path(performance_group_key, "/buyer-access-sessions/#{encode(session_id)}"))
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Read the trusted server projection before charging; do not price from
|
|
75
|
+
# client input or the picker state.
|
|
76
|
+
def retrieve_hold(performance_group_key, operation_id)
|
|
77
|
+
@client.get(path(performance_group_key, "/holds/#{encode(operation_id)}"))
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Confirm external payment for a committed hold. Keep both identifiers
|
|
81
|
+
# stable, and poll +retrieve_booking+ if the response is +book_pending+.
|
|
82
|
+
def book_hold(performance_group_key, operation_id, book_action_id:, booking_ref:)
|
|
83
|
+
@client.post(path(performance_group_key, "/holds/#{encode(operation_id)}/book"),
|
|
84
|
+
{ "bookActionId" => book_action_id,
|
|
85
|
+
"bookingRef" => normalise_booking_ref(booking_ref) })
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
def retrieve_booking(performance_group_key, action_id)
|
|
89
|
+
@client.get(path(performance_group_key, "/bookings/#{encode(action_id)}"))
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
private
|
|
93
|
+
|
|
94
|
+
def path(performance_group_key, suffix = "")
|
|
95
|
+
"/v1/performance-groups/#{encode(performance_group_key)}#{suffix}"
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
def normalise_booking_ref(booking_ref)
|
|
99
|
+
value = booking_ref&.strip
|
|
100
|
+
return value unless value.nil? || value.empty?
|
|
101
|
+
|
|
102
|
+
raise ArgumentError, "booking_ref is required and must be a non-empty stable reference"
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
end
|
data/lib/seatlayer/version.rb
CHANGED
data/lib/seatlayer.rb
CHANGED
|
@@ -6,6 +6,7 @@ require_relative "seatlayer/http_client"
|
|
|
6
6
|
require_relative "seatlayer/resources"
|
|
7
7
|
require_relative "seatlayer/inventory"
|
|
8
8
|
require_relative "seatlayer/channels"
|
|
9
|
+
require_relative "seatlayer/performance_groups"
|
|
9
10
|
require_relative "seatlayer/webhook"
|
|
10
11
|
|
|
11
12
|
# Official Ruby server SDK for the SeatLayer reserved-seating API.
|
|
@@ -19,7 +20,8 @@ require_relative "seatlayer/webhook"
|
|
|
19
20
|
module SeatLayer
|
|
20
21
|
# The SeatLayer client.
|
|
21
22
|
class Client
|
|
22
|
-
attr_reader :charts, :events, :inventory, :channels, :
|
|
23
|
+
attr_reader :charts, :events, :inventory, :channels, :performance_groups, :sessions,
|
|
24
|
+
:webhooks, :workspaces, :templates
|
|
23
25
|
|
|
24
26
|
def initialize(secret_key, base_url: HTTPClient::DEFAULT_BASE_URL,
|
|
25
27
|
max_retries: HTTPClient::DEFAULT_MAX_RETRIES,
|
|
@@ -31,6 +33,7 @@ module SeatLayer
|
|
|
31
33
|
@events = Events.new(@http)
|
|
32
34
|
@inventory = Inventory.new(@http)
|
|
33
35
|
@channels = Channels.new(@http)
|
|
36
|
+
@performance_groups = PerformanceGroups.new(@http)
|
|
34
37
|
@sessions = Sessions.new(@http)
|
|
35
38
|
@templates = Templates.new(@http)
|
|
36
39
|
@webhooks = Webhooks.new(@http)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: seatlayer
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- SeatLayer
|
|
@@ -25,6 +25,7 @@ files:
|
|
|
25
25
|
- lib/seatlayer/errors.rb
|
|
26
26
|
- lib/seatlayer/http_client.rb
|
|
27
27
|
- lib/seatlayer/inventory.rb
|
|
28
|
+
- lib/seatlayer/performance_groups.rb
|
|
28
29
|
- lib/seatlayer/resources.rb
|
|
29
30
|
- lib/seatlayer/version.rb
|
|
30
31
|
- lib/seatlayer/webhook.rb
|