inngest@3.31.1
·
487 commits
to main
since this release
Patch Changes
-
#817
446be1bThanks @jpwilliams! -serve()andconnect()now have looser typing forclientandfunctions, resulting in easier use of multipleinngestpackages in a single process -
#823
f1d2385Thanks @jpwilliams! - Allow wildcard event typing with.fromRecord()The following schema is now valid:
export const schemas = new EventSchemas().fromRecord<{ "app/blog.post.*": | { name: "app/blog.post.created"; data: { postId: string; authorId: string; createdAt: string; }; } | { name: "app/blog.post.published"; data: { postId: string; authorId: string; publishedAt: string; }; }; }>();
When creating a function, this allows you to appropriately type narrow the event to pull out the correct data:
inngest.createFunction( { id: "my-fn" }, { event: "app/blog.post.*" }, async ({ event }) => { if (event.name === "app/blog.post.created") { console.log("Blog post created at:", event.data.createdAt); } else if (event.name === "app/blog.post.published") { console.log("Blog post published at:", event.data.publishedAt); } }, );
-
#825
661ed7bThanks @jpwilliams! - If nofunctionsare provided toinngest.connect(), it will now use any functions that have been created with the client instead -
Updated dependencies [
fadd94a]:- @inngest/ai@0.0.3