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` 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; }; /**