@novu/framework
Version:
The Code-First Notifications Workflow SDK.
32 lines (29 loc) • 1.28 kB
text/typescript
import { RequestEvent } from '@sveltejs/kit';
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;
/**
* Using SvelteKit, serve and register any declared workflows with Novu,
* making them available to be triggered by events.
*
* @example
* ```ts
* // app/routes/api/novu/+server.ts
* import { serve } from "@novu/framework/sveltekit";
* import { myWorkflow } from "./src/novu/workflows"; // Your workflows
*
* const handler = serve({ workflows: [myWorkflow] });
*
* export { handler as action, handler as loader };
* ```
*/
declare const serve: (options: ServeHandlerOptions) => ((event: RequestEvent) => Promise<Response>) & {
GET: (event: RequestEvent) => Promise<Response>;
POST: (event: RequestEvent) => Promise<Response>;
OPTIONS: (event: RequestEvent) => Promise<Response>;
};
export { ServeHandlerOptions, frameworkName, serve };