@upstash/qstash
Version:
Official Typescript client for QStash
38 lines (35 loc) • 1.34 kB
TypeScript
import { a9 as RouteFunction, aa as WorkflowServeOptions } from './client-C3waRcAY.js';
import 'neverthrow';
type WorkflowBindings = {
QSTASH_TOKEN: string;
QSTASH_URL?: string;
QSTASH_CURRENT_SIGNING_KEY?: string;
QSTASH_NEXT_SIGNING_KEY?: string;
UPSTASH_WORKFLOW_URL?: string;
};
/**
* Cloudflare Pages Function arguments
*/
type PagesHandlerArgs = [{
request: Request;
env: Record<string, string | undefined>;
}];
/**
* Cloudflare Worker arguments
*/
type WorkersHandlerArgs = [Request, Record<string, string | undefined>];
/**
* Serve method to serve a Upstash Workflow in a Nextjs project
*
* See for options https://upstash.com/docs/qstash/workflows/basics/serve
*
* @param routeFunction workflow function
* @param options workflow options
* @returns
*
* @deprecated as of version 2.7.17. Will be removed in qstash-js 3.0.0.
* Please use https://github.com/upstash/workflow-js
* Migration Guide: https://upstash.com/docs/workflow/migration
*/
declare const serve: <TInitialPayload = unknown>(routeFunction: RouteFunction<TInitialPayload>, options?: Omit<WorkflowServeOptions<Response, TInitialPayload>, "onStepFinish">) => ((...args: PagesHandlerArgs | WorkersHandlerArgs) => Promise<Response>);
export { type PagesHandlerArgs, type WorkersHandlerArgs, type WorkflowBindings, serve };