Skip to content
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

Revert "Do not allow objectish [] event data; only actual objects" #660

Merged
merged 2 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/quiet-kids-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"inngest": patch
---

Revert not allowing objectish (`[]`) values in `event.data`
7 changes: 0 additions & 7 deletions packages/inngest/src/components/EventSchemas.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 } };
Expand Down
4 changes: 2 additions & 2 deletions packages/inngest/src/components/EventSchemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import {
export type StandardEventSchema = {
name?: string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
data?: Record<string, unknown>;
data?: Record<string, any>;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
user?: Record<string, unknown>;
user?: Record<string, any>;
};

/**
Expand Down
Loading