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

🐛 Bug Report: ITriggerPayload type doesn't accept any JSON serializable object #3538

Open
2 tasks done
leonardbinet opened this issue May 30, 2023 · 1 comment
Open
2 tasks done
Assignees
Labels

Comments

@leonardbinet
Copy link

📜 Description

In documentation:
Screenshot 2023-05-30 at 12 26 08

But the ITriggerPayload is actually more restrictive:
Screenshot 2023-05-30 at 12 24 16
Screenshot 2023-05-30 at 12 24 21

and doesn't allow lists of objects

👟 Reproduction steps

import { ITriggerPayload } from '@novu/node'

export const myPayload: ITriggerPayload = {
  myList: [
    {
      myInnerString: 'string'
    }
  ]
}

and see type error in IDE

👍 Expected behavior

no type error in IDE

👎 Actual Behavior with Screenshots

Screenshot 2023-05-30 at 12 24 21

📃 Provide any additional context for the Bug.

You might want to use microsoft/TypeScript#1897 (comment)

export type JSONPrimitive = string | number | boolean | null;
export type JSONValue = JSONPrimitive | JSONObject | JSONArray;
export type JSONObject = { [member: string]: JSONValue };
export interface JSONArray extends Array<JSONValue> {}

👀 Have you spent some time to check if this bug has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to submit PR?

Yes I am willing to submit a PR!

@p-fernandez
Copy link
Contributor

Good catch! I assigned you the issue so you can submit a PR. We recently moved ITriggerPayload so you will have to apply the change in the Shared library (@novu/shared).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants