@novu/framework
Version:
The Code-First Notifications Workflow SDK.
40 lines (37 loc) • 1.3 kB
text/typescript
import * as h3 from 'h3';
import { H3Event } from 'h3';
import { S as ServeHandlerOptions } from '../index-S0QKfWxm.cjs';
export { C as Client, N as NovuRequestHandler, w as workflow } from '../index-S0QKfWxm.cjs';
export { C as CronExpression, S as SeverityLevelEnum, W as Workflow, p as providerSchemas } from '../health-check.types-D_KcRiM_.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<h3.EventHandlerRequest>) => Promise<Promise<void>>;
export { ServeHandlerOptions, frameworkName, serve };