Skip to content

Commit

Permalink
feat(framework): Expose Workflow resource type in public API (#6983)
Browse files Browse the repository at this point in the history
  • Loading branch information
rifont authored Nov 13, 2024
1 parent 8590fa2 commit c86094d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/framework/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export { Client } from './client';
export { NovuRequestHandler, type ServeHandlerOptions } from './handler';
export { workflow } from './resources';
export type { Workflow } from './types';
export { CronExpression } from './constants';
12 changes: 9 additions & 3 deletions packages/framework/src/types/discover.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,16 @@ export type DiscoverWorkflowOutput = {
description?: string;
};

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type Workflow<T_Payload = any> = {
/**
* A workflow resource.
*
* @property `id` - The unique identifier for the workflow.
* @property `trigger` - The function to trigger the workflow.
* @property `discover` - The function to discover the workflow definition.
*/
export type Workflow<T_Payload = never> = {
/**
* The unique identifier of the workflow.
* The unique identifier for the workflow.
*/
id: string;
/**
Expand Down

0 comments on commit c86094d

Please sign in to comment.