Skip to content

feat(webhooks): support enabledEvents + multiple endpoints per mode - #62

Merged
sandervanhooft merged 2 commits into
mainfrom
sync/webhook-endpoint-events
Sep 11, 2026
Merged

sandervanhooft merged 2 commits into
mainfrom
sync/webhook-endpoint-events

Conversation

@sandervanhooft

Copy link
Copy Markdown
Member

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's required set and hydrated on every read.
  • create() accepts an optional enabledEvents. 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 optional enabledEvents as 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 (mirrors WebhookEventName's style). webhook.setup is excluded — it is always sent and not subscribable.
  • Multiplicity: the old "at most one endpoint per mode" is gone → up to five per mode, URLs unique within storefront + mode, duplicate/6th → 422. Corrected in WebhookEndpointEndpoint doc comments, docs/WebhookEndpoints.md, and the vendored openapi.yaml (paths + WebhookEndpoint / CreateWebhookEndpointRequest / UpdateWebhookEndpointRequest schemas, plus the new WebhookSubscriptionEventName schema).

Tests / checks

  • New/updated tests: resource hydration incl. enabledEvents, create + update passthrough (including empty-list dormant + full-set replacement), and the new enum.
  • Full suite: 281 tests, 1411 assertions — OK.
  • PHPStan level 5 (php -d memory_limit=1G vendor/bin/phpstan): No errors.
  • php-cs-fixer: no changes (files conform).

Do not merge — for review.

sandervanhooft and others added 2 commits September 11, 2026 15:56
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
@sandervanhooft
sandervanhooft merged commit 36a0f33 into main Sep 11, 2026
12 checks passed
@sandervanhooft
sandervanhooft deleted the sync/webhook-endpoint-events branch September 11, 2026 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant