-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose EventSchemas
in Inngest
instances
#657
Conversation
We'll do this internally later, but storing them means this can also be handled by middleware.
🦋 Changeset detectedLatest commit: 942e3e1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
A user has added the prerelease/inngest label, so this PR will be published to npm with the tag You can install this prerelease version with: npm install inngest@pr-657 The last release was built and published from 942e3e1. |
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @inngest/[email protected] ### Minor Changes - [#704](#704) [`9438960`](9438960) Thanks [@jpwilliams](https://github.com/jpwilliams)! - Refactor `@inngest/test` to have a much simpler public API ## [email protected] ### Patch Changes - [#657](#657) [`7ca9537`](7ca9537) Thanks [@jpwilliams](https://github.com/jpwilliams)! - Expose `EventSchemas` in `Inngest` instances - [#311](#311) [`a53356a`](a53356a) Thanks [@jpwilliams](https://github.com/jpwilliams)! - Add streaming capabilities to `"inngest/cloudflare"` handler Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Summary
Exposes "runtime schemas" on an
Inngest
client, allowing middleware to use it to add custom validation using the schemas passed toEventSchemas
.We'll add this as a top-level option later, but this allows us to explore the functionality while we settle on APIs, default functionality, and supporting many validation libraries.
As an example, here is a custom middleware that makes use of this to add runtime validation to any Zod schemas that exist within your client's
EventSchemas
. It assumes you havezod
installed.# Use this PR to test npm install inngest@pr-657
Checklist
Added a docs PR that references this PRN/AAdded unit/integration testsN/ARelated