From 44f6599bd590a5dfa33fd12165d55261c59af003 Mon Sep 17 00:00:00 2001 From: Jack Williams <1736957+jpwilliams@users.noreply.github.com> Date: Tue, 23 Jul 2024 20:10:59 +0000 Subject: [PATCH 1/2] Revert "Do not allow objectish `[]` event data; only actual objects (#655)" This reverts commit 12df4209a972123e2a46ec2aaef3f5df8f3881b5. --- packages/inngest/src/components/EventSchemas.test.ts | 7 ------- packages/inngest/src/components/EventSchemas.ts | 4 ++-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/packages/inngest/src/components/EventSchemas.test.ts b/packages/inngest/src/components/EventSchemas.test.ts index f238c55a1..7289f8927 100644 --- a/packages/inngest/src/components/EventSchemas.test.ts +++ b/packages/inngest/src/components/EventSchemas.test.ts @@ -144,13 +144,6 @@ describe("EventSchemas", () => { }>(); }); - test("cannot set objectish type for data", () => { - // @ts-expect-error Data must be object type or any - new EventSchemas().fromRecord<{ - "test.event": { data: [] }; - }>(); - }); - test("can set event with matching 'name'", () => { const schemas = new EventSchemas().fromRecord<{ "test.event": { name: "test.event"; data: { foo: string } }; diff --git a/packages/inngest/src/components/EventSchemas.ts b/packages/inngest/src/components/EventSchemas.ts index 4b79e8e0b..031b210a6 100644 --- a/packages/inngest/src/components/EventSchemas.ts +++ b/packages/inngest/src/components/EventSchemas.ts @@ -23,9 +23,9 @@ import { export type StandardEventSchema = { name?: string; // eslint-disable-next-line @typescript-eslint/no-explicit-any - data?: Record; + data?: Record; // eslint-disable-next-line @typescript-eslint/no-explicit-any - user?: Record; + user?: Record; }; /** From dfe88c5ccddbd47d657d27b04ad5fe03c035a14e Mon Sep 17 00:00:00 2001 From: Jack Williams Date: Tue, 23 Jul 2024 21:23:08 +0100 Subject: [PATCH 2/2] Create quiet-kids-build.md --- .changeset/quiet-kids-build.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/quiet-kids-build.md diff --git a/.changeset/quiet-kids-build.md b/.changeset/quiet-kids-build.md new file mode 100644 index 000000000..1c9920369 --- /dev/null +++ b/.changeset/quiet-kids-build.md @@ -0,0 +1,5 @@ +--- +"inngest": patch +--- + +Revert not allowing objectish (`[]`) values in `event.data`