inngest
Version:
Official SDK for Inngest.com. Inngest is the reliability layer for modern applications. Inngest combines durable execution, events, and queues into a zero-infra platform with built-in observability.
71 lines • 2.47 kB
TypeScript
/**
* An adapter for DigitalOcean Functions to serve and register any declared
* functions with Inngest, making them available to be triggered by events.
*
* @example
* ```ts
* import { serve } from "inngest/digitalocean";
* import { inngest } from "./src/inngest/client";
* import fnA from "./src/inngest/fnA"; // Your own function
*
* const main = serve({
* client: inngest,
* functions: [fnA],
* // Your digitalocean hostname. This is required otherwise your functions won't work.
* serveHost: "https://faas-sfo3-your-url.doserverless.co",
* // And your DO path, also required.
* servePath: "/api/v1/web/fn-your-uuid/inngest",
* });
*
* // IMPORTANT: Makes the function available as a module in the project.
* // This is required for any functions that require external dependencies.
* module.exports.main = main;
* ```
*
* @module
*/
import { type ActionResponse, type ServeHandlerOptions } from "./components/InngestCommHandler.js";
import { type SupportedFrameworkName } from "./types.js";
type HTTP = {
headers: Record<string, string>;
method: string;
path: string;
};
type Main = {
http?: HTTP;
[data: string]: unknown;
} | undefined;
/**
* The name of the framework, used to identify the framework in Inngest
* dashboards and during testing.
*/
export declare const frameworkName: SupportedFrameworkName;
/**
* In DigitalOcean Functions, serve and register any declared functions with
* Inngest, making them available to be triggered by events.
*
* @example
* ```ts
* import { serve } from "inngest/digitalocean";
* import { inngest } from "./src/inngest/client";
* import fnA from "./src/inngest/fnA"; // Your own function
*
* const main = serve({
* client: inngest,
* functions: [fnA],
* // Your digitalocean hostname. This is required otherwise your functions won't work.
* serveHost: "https://faas-sfo3-your-url.doserverless.co",
* // And your DO path, also required.
* servePath: "/api/v1/web/fn-your-uuid/inngest",
* });
*
* // IMPORTANT: Makes the function available as a module in the project.
* // This is required for any functions that require external dependencies.
* module.exports.main = main;
* ```
*
* @public
*/
export declare const serve: (options: ServeHandlerOptions & Required<Pick<NonNullable<ServeHandlerOptions>, "serveHost">>) => ((main?: Main) => Promise<ActionResponse<string>>);
export {};
//# sourceMappingURL=digitalocean.d.ts.map