Skip to content

Preview: typed webhook events, migration guide - #60

Closed
chrisdengso wants to merge 1 commit into
mainfrom
claude/clever-ride-hfy18x
Closed

chrisdengso wants to merge 1 commit into
mainfrom
claude/clever-ride-hfy18x

Conversation

@chrisdengso

Copy link
Copy Markdown
Contributor

Summary

Draft preview, for review only. These files are the output of the moderation-api/sdk-generator branch claude/clever-ride-hfy18x (customize.py and scripts/webhook-types.py) on the v5.1.0 spec. Do not merge by hand: the next generation writes the same files, and close this PR when it does.

  • src/webhook-events.ts (new): typed webhook events; WebhookEvent is a union keyed on type.
  • src/webhook-signature.ts: validateWebhook returns the typed union; payloads are not validated, so new types or fields never fail a delivery.
  • README.md: handling events, snake_case webhook payloads vs camelCase client models, open enums, evaluation.flaggedFields.
  • MIGRATION.md (new): 4.x → 5.x guide.

evaluation.flaggedFields arrives with the next generation after moderation-api/api adds evaluation.flagged_fields.

Validation

  • tsc --noEmit -p .: pass. npm run lint: pass.

Generated by Claude Code

Output of sdk-generator's customize step and scripts/webhook-types.py on
this spec. The next generation writes the same files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PrKr9p824q6HazZFYbqcoQ

Copy link
Copy Markdown
Contributor Author

Closing: #61 (the regular generation) now has the same webhook-events.ts, webhook-signature.ts and MIGRATION.md, as this PR planned.


Generated by Claude Code

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.

2 participants