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

feat(framework): Expose Workflow resource type in public API #6983

Merged
merged 3 commits into from
Nov 13, 2024

Conversation

rifont
Copy link
Contributor

@rifont rifont commented Nov 13, 2024

What changed? Why was the change needed?

  • Expose Workflow resource type in public API
    • This typing is useful for library and plugin authors to create generic Novu Framework integrations with type inference

closes #6954

Screenshots

Intelliense of exposed Workflow type
image

Expand for optional sections

Related enterprise PR

Special notes for your reviewer

Copy link

linear bot commented Nov 13, 2024

Copy link

netlify bot commented Nov 13, 2024

Deploy Preview for novu-stg-vite-dashboard-poc ready!

Name Link
🔨 Latest commit c174ddb
🔍 Latest deploy log https://app.netlify.com/sites/novu-stg-vite-dashboard-poc/deploys/67348d044a39f1000834dac9
😎 Deploy Preview https://deploy-preview-6983--novu-stg-vite-dashboard-poc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

pkg-pr-new bot commented Nov 13, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/novuhq/novu/@novu/framework@6983

commit: c174ddb

* @property `trigger` - The function to trigger the workflow.
* @property `discover` - The function to discover the workflow definition.
*/
export type Workflow<T_Payload = never> = {
Copy link
Contributor Author

@rifont rifont Nov 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is never a case where T_Payload is inferrable without access to the payloadSchema, so we make it as such. This prevents using an inferred Workflow payload type without a corresponding payloadSchema.

@rifont rifont merged commit c86094d into next Nov 13, 2024
44 checks passed
@rifont rifont deleted the nv-4718-bug-report-novuframework-240-breaking-imports branch November 13, 2024 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 Bug Report: @novu/framework: 2.4.0 Breaking imports
2 participants