feat(webhooks): support enabledEvents + multiple endpoints per mode - #62
Merged
Merged
Conversation
Adopt vatlify OpenAPI #2163 into the webhook-endpoints resource. - WebhookEndpoint resource gains enabledEvents (string[]), hydrated on read - create() accepts optional enabledEvents (omit => all events at registration; [] => dormant); update() accepts it as a full-set replacement (omit preserves) - new Vatly\API\Types\WebhookSubscriptionEventName constants (31 subscribable public event names; webhook.setup excluded as it is always sent) - multiplicity: up to five endpoints per mode, URLs unique within storefront+mode (duplicate/6th => 422); corrected the old one-per-mode language in docs, endpoint doc comments, and the vendored openapi.yaml - tests for hydration, create/update passthrough, and the new enum - CHANGELOG updated
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adopts vatlify OpenAPI #2163 into the webhook-endpoints resource. This extends the existing resource (create/get/page/update/delete on
VatlyApiClient::$webhookEndpoints) with the #2163 delta — it does not rebuild it.Changes
WebhookEndpoint->enabledEvents(string[]) — the endpoint's persisted subscription set, now in the spec'srequiredset and hydrated on every read.create()accepts an optionalenabledEvents. Per the spec: omit it → Vatly subscribes to all events available at registration (not auto-updated later);[]→ dormant endpoint. Doc comment updated.update()accepts an optionalenabledEventsas a full-set replacement: omitting preserves the current set;[]→ dormant. New names are never added automatically.Vatly\API\Types\WebhookSubscriptionEventName— new constant class of the 31 subscribable public event names (mirrorsWebhookEventName's style).webhook.setupis excluded — it is always sent and not subscribable.422. Corrected inWebhookEndpointEndpointdoc comments,docs/WebhookEndpoints.md, and the vendoredopenapi.yaml(paths +WebhookEndpoint/CreateWebhookEndpointRequest/UpdateWebhookEndpointRequestschemas, plus the newWebhookSubscriptionEventNameschema).Tests / checks
enabledEvents, create + update passthrough (including empty-list dormant + full-set replacement), and the new enum.php -d memory_limit=1G vendor/bin/phpstan): No errors.Do not merge — for review.