@finda-co/novu-framework
Version:
The Code-First Notifications Workflow SDK.
39 lines (36 loc) • 1.25 kB
text/typescript
import { H3Event, EventHandlerRequest } from 'h3';
import { S as ServeHandlerOptions } from '../index-CbB8FSnY.cjs';
export { C as Client, N as NovuRequestHandler, w as workflow } from '../index-CbB8FSnY.cjs';
export { C as CronExpression, W as Workflow } from '../health-check.types-D8gbU9cU.cjs';
import { S as SupportedFrameworkName } from '../server.types-BRWsA1CA.cjs';
import 'json-schema-to-ts';
import 'zod';
declare const frameworkName: SupportedFrameworkName;
/**
* In h3, serve and register any declared workflows with Novu, making
* them available to be triggered by events.
*
* @example
* ```ts
* import { createApp, eventHandler, toNodeListener } from "h3";
* import { serve } from "@novu/framework/h3";
* import { createServer } from "node:http";
* import { myWorkflow } from "./src/novu/workflows";
*
* const app = createApp();
* app.use(
* "/api/novu",
* eventHandler(
* serve({
* workflows: [myWorkflow],
* })
* )
* );
*
* createServer(toNodeListener(app)).listen(process.env.PORT || 4000);
* ```
*
* @public
*/
declare const serve: (options: ServeHandlerOptions) => (event: H3Event<EventHandlerRequest>) => Promise<Promise<void>>;
export { ServeHandlerOptions, frameworkName, serve };