Skip to content

Export Siren's full typed taxonomy; add missing webhook events#5

Open
alexstandiford wants to merge 1 commit into
mainfrom
rocky/sdk-taxonomy
Open

Export Siren's full typed taxonomy; add missing webhook events#5
alexstandiford wants to merge 1 commit into
mainfrom
rocky/sdk-taxonomy

Conversation

@alexstandiford

Copy link
Copy Markdown
Contributor

What

Charter 761 (SDKs speak the taxonomy) — the SDK becomes the typed carrier of Siren's domain vocabulary so integrations reach for SDK types instead of magic strings (doctrine: global-taxonomy-and-sdk-doctrine).

  • New src/taxonomy.ts, exported from the package root: EventSlug (built-in ingestion slugs sale/refund/site-visited) and status vocabularies ConversionStatus, TransactionStatus, ObligationStatus, PayoutStatus, FulfillmentStatus, OpportunityStatus, ApiKeyStatus, WebhookSubscriptionStatus — each a const object + string-union type, same pattern as the existing WebhookEventType.
  • WebhookEventType: 4 missing events addedcredit.issued, credit.redeemed, currency.created, currency.deleted. The Siren service registers dispatchers for all four (lib/Webhooks/Service/Initializer.php) but the SDK and openapi.yaml never listed them. Both updated.
  • test/taxonomy.test.ts pins every vocabulary to the canonical set mined from the service (webhook dispatchers + REST IsAny validations). The stale 28-count assertion in test/webhooks.test.ts updated to 32.
  • README webhook example now dispatches on WebhookEventType constants instead of raw strings; taxonomy documented under Features.

Source of truth

Vocabularies mined from Novatorius/siren (the taxonomy owner): webhook dispatcher slugs, event factory slugs, and per-domain REST status validations.

Noted upstream inconsistency (encoded as-is, flagged for founder): obligation machine paths write complete while the management REST surface accepts fulfilled — both included in ObligationStatus.

Verification

  • npm test: 69 tests green (was 58; +11 taxonomy pins)
  • npm run typecheck clean; npm run build clean

🤖 Generated with Claude Code

https://claude.ai/code/session_0138jQKyzwyDfEbbAeMmYNnL

…ok events

Siren owns its domain vocabulary (global-taxonomy-and-sdk-doctrine); this SDK
is the typed carrier of it so integrations never hand-roll magic strings.

- Add EventSlug (built-in ingestion slugs) and status vocabularies:
  ConversionStatus, TransactionStatus, ObligationStatus, PayoutStatus,
  FulfillmentStatus, OpportunityStatus, ApiKeyStatus,
  WebhookSubscriptionStatus (src/taxonomy.ts, exported from the root).
- WebhookEventType: add credit.issued, credit.redeemed, currency.created,
  currency.deleted — dispatched by the service but missing from the SDK and
  openapi.yaml.
- Pin the canonical vocabularies in test/taxonomy.test.ts (mirrors the
  service's dispatchers and REST validations).
- README: use WebhookEventType constants in the webhook example instead of
  raw strings; document the taxonomy exports.

Charter 761 (SDKs speak the taxonomy).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0138jQKyzwyDfEbbAeMmYNnL
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