From 0dc4079a3dba9b4818b47b93efb472775299336b Mon Sep 17 00:00:00 2001 From: navin10sharma <3096611+navin10sharma@users.noreply.github.com> Date: Sun, 23 Aug 2026 13:35:28 +0530 Subject: [PATCH 1/3] feat(events): add configuration binding --- CHANGELOG.md | 5 +++++ README.md | 2 +- src/Resources/Events.php | 36 +++++++++++++++++++++++++++++++ tests/ClientTest.php | 46 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 88 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3342fb8..4fda76e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ## Unreleased +- Added exact immutable Event configuration binding reads and compare-and-set + attach/detach through `Events::retrieveConfigurationBinding()` and + `Events::updateConfigurationBinding()`. Updates remain deliberately + single-attempt. + - Added `templates->instantiateTemplate()` and the ticket-release lifecycle on `events` (`listTicketReleases`, `updateTicketReleases`, and `closeTicketRelease`). Template instantiation sends `{}` when no overrides diff --git a/README.md b/README.md index b62f496..b1ecf24 100644 --- a/README.md +++ b/README.md @@ -290,7 +290,7 @@ suite runs without a network. | --- | --- | | `charts` | `list` `listAll` `create` `retrieve` `update` `delete` `copy` `archive` `unarchive` `publish` | | `templates` | `instantiateTemplate` | -| `events` | `list` `listAll` `create` `retrieve` `update` `delete` `updateChart` `close` `reopen` `archive` `retrieveHoldTtl` `updateHoldTtl` `listTicketReleases` `updateTicketReleases` `closeTicketRelease` `retrieveReport` `retrieveLog` | +| `events` | `list` `listAll` `create` `retrieve` `retrieveConfigurationBinding` `updateConfigurationBinding` `update` `delete` `updateChart` `close` `reopen` `archive` `retrieveHoldTtl` `updateHoldTtl` `listTicketReleases` `updateTicketReleases` `closeTicketRelease` `retrieveReport` `retrieveLog` | | `channels` | `listChannels` `createChannel` `updateChannel` `updateAssignments` `listAllocation` `retrieveAccessPreview` `retrieveReport` `pause` `unpause` `archive` `createBuyerAccessSession` `listBuyerAccessSessions` `revokeBuyerAccessSession` | | `inventory` | `hold` `holdBestAvailable` `bookBestAvailable` `extendHold` `retrieveHold` `release` `book` `boxOfficeBook` `unbook` `block` `unblock` `unblockAll` `retrieveAvailability` `updateAvailability` `listBookings` `retrieveBooking` | | `sessions` | `createManageSession` `revokeManageSession` `createDesignerSession` `revokeDesignerSession` | diff --git a/src/Resources/Events.php b/src/Resources/Events.php index c96e37d..a968f88 100644 --- a/src/Resources/Events.php +++ b/src/Resources/Events.php @@ -116,6 +116,42 @@ public function retrieve(string $eventKey): array return (array) $this->http->get('/v1/events/' . HttpClient::encode($eventKey)); } + /** Read the Event's exact immutable configuration binding and audit history. + * + * @return array + */ + public function retrieveConfigurationBinding(string $eventKey): array + { + /** @var array */ + return (array) $this->http->get( + '/v1/events/' . HttpClient::encode($eventKey) . '/event-configuration', + ); + } + + /** + * Bind an exact published version, or pass null to detach. + * + * This compare-and-set mutation remains single-attempt because the public + * operation does not promise exact response replay. + * + * @param array{id: string, version: int}|null $configuration + * @return array + */ + public function updateConfigurationBinding( + string $eventKey, + int $expectedRevision, + ?array $configuration, + ): array { + /** @var array */ + return (array) $this->http->put( + '/v1/events/' . HttpClient::encode($eventKey) . '/event-configuration', + [ + 'expectedRevision' => $expectedRevision, + 'configuration' => $configuration, + ], + ); + } + /** * @param array $fields * @return array diff --git a/tests/ClientTest.php b/tests/ClientTest.php index a4c4e3a..ba579dd 100644 --- a/tests/ClientTest.php +++ b/tests/ClientTest.php @@ -101,6 +101,52 @@ public function testPercentEncodesPathParameters(): void self::assertSame('https://api.seatlayer.io/v1/events/ev%2F..%2Fadmin', $this->call(0)['url']); } + public function testEventConfigurationBindingRoutesAndBodies(): void + { + $binding = [ + 'configuration' => ['id' => 'ec_touring', 'version' => 3], + 'revision' => 7, + 'changedBy' => 'api-key:key_1', + 'changedAt' => 123, + 'audit' => [[ + 'id' => 'eca_1', + 'from' => null, + 'to' => ['id' => 'ec_touring', 'version' => 3], + 'revision' => 7, + 'actor' => 'api-key:key_1', + 'createdAt' => 123, + ]], + ]; + $sdk = $this->client([ + ['status' => 200, 'body' => $binding], + ['status' => 200, 'body' => $binding], + ['status' => 200, 'body' => [...$binding, 'configuration' => null, 'revision' => 8]], + ]); + + $retrieved = $sdk->events->retrieveConfigurationBinding('ev / main'); + self::assertSame(['id' => 'ec_touring', 'version' => 3], $retrieved['audit'][0]['to']); + $sdk->events->updateConfigurationBinding( + 'ev / main', + 6, + ['id' => 'ec_touring', 'version' => 3], + ); + $sdk->events->updateConfigurationBinding('ev / main', 7, null); + + $url = 'https://api.seatlayer.io/v1/events/ev%20%2F%20main/event-configuration'; + self::assertSame([$url, $url, $url], array_column($this->calls, 'url')); + self::assertSame('GET', $this->call(0)['method']); + self::assertSame([ + 'expectedRevision' => 6, + 'configuration' => ['id' => 'ec_touring', 'version' => 3], + ], json_decode((string) $this->call(1)['body'], true)); + self::assertSame([ + 'expectedRevision' => 7, + 'configuration' => null, + ], json_decode((string) $this->call(2)['body'], true)); + self::assertArrayNotHasKey('Idempotency-Key', $this->call(1)['headers']); + self::assertArrayNotHasKey('Idempotency-Key', $this->call(2)['headers']); + } + public function testTemplateInstantiationUsesAnObjectBodyAndReplaysItsResponse(): void { $sdk = $this->client([ From 40ad11d377caf4a1409af503400c49e0ccde01e1 Mon Sep 17 00:00:00 2001 From: navin10sharma <3096611+navin10sharma@users.noreply.github.com> Date: Sun, 23 Aug 2026 14:30:31 +0530 Subject: [PATCH 2/3] chore(release): prepare v0.5.0 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fda76e..901d6f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## Unreleased +## 0.5.0 — 2026-08-23 - Added exact immutable Event configuration binding reads and compare-and-set attach/detach through `Events::retrieveConfigurationBinding()` and From 78aeb03c1c5d4d3386f5022ed24b2a55079d2c66 Mon Sep 17 00:00:00 2001 From: navin10sharma <3096611+navin10sharma@users.noreply.github.com> Date: Sun, 23 Aug 2026 14:34:02 +0530 Subject: [PATCH 3/3] chore(release): move configuration binding to v0.6.0 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c88f89b..4e6d3f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 0.5.0 — 2026-08-23 +## 0.6.0 — 2026-08-23 - Added exact immutable Event configuration binding reads and compare-and-set attach/detach through `Events::retrieveConfigurationBinding()` and