@upstash/workflow 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.mjs ADDED
@@ -0,0 +1,18 @@
1
+ import {
2
+ Client,
3
+ QStashWorkflowAbort,
4
+ QStashWorkflowError,
5
+ StepTypes,
6
+ WorkflowContext,
7
+ WorkflowLogger,
8
+ serve
9
+ } from "./chunk-JDMP6KKR.mjs";
10
+ export {
11
+ Client,
12
+ QStashWorkflowAbort,
13
+ QStashWorkflowError,
14
+ StepTypes,
15
+ WorkflowContext,
16
+ WorkflowLogger,
17
+ serve
18
+ };
package/nextjs.d.mts ADDED
@@ -0,0 +1,18 @@
1
+ import { NextApiHandler } from 'next';
2
+ import { NextResponse } from 'next/server';
3
+ import { R as RouteFunction, W as WorkflowServeOptions } from './types-CfN1Epuj.mjs';
4
+ import '@upstash/qstash';
5
+
6
+ /**
7
+ * Serve method to serve a Upstash Workflow in a Nextjs project
8
+ *
9
+ * See for options https://upstash.com/docs/qstash/workflows/basics/serve
10
+ *
11
+ * @param routeFunction workflow function
12
+ * @param options workflow options
13
+ * @returns
14
+ */
15
+ declare const serve: <TInitialPayload = unknown>(routeFunction: RouteFunction<TInitialPayload>, options?: Omit<WorkflowServeOptions<NextResponse, TInitialPayload>, "onStepFinish">) => ((request: Request) => Promise<NextResponse>);
16
+ declare const servePagesRouter: <TInitialPayload = unknown>(routeFunction: RouteFunction<TInitialPayload>, options?: Omit<WorkflowServeOptions<Response, TInitialPayload>, "onStepFinish">) => NextApiHandler;
17
+
18
+ export { serve, servePagesRouter };
package/nextjs.d.ts ADDED
@@ -0,0 +1,18 @@
1
+ import { NextApiHandler } from 'next';
2
+ import { NextResponse } from 'next/server';
3
+ import { R as RouteFunction, W as WorkflowServeOptions } from './types-CfN1Epuj.js';
4
+ import '@upstash/qstash';
5
+
6
+ /**
7
+ * Serve method to serve a Upstash Workflow in a Nextjs project
8
+ *
9
+ * See for options https://upstash.com/docs/qstash/workflows/basics/serve
10
+ *
11
+ * @param routeFunction workflow function
12
+ * @param options workflow options
13
+ * @returns
14
+ */
15
+ declare const serve: <TInitialPayload = unknown>(routeFunction: RouteFunction<TInitialPayload>, options?: Omit<WorkflowServeOptions<NextResponse, TInitialPayload>, "onStepFinish">) => ((request: Request) => Promise<NextResponse>);
16
+ declare const servePagesRouter: <TInitialPayload = unknown>(routeFunction: RouteFunction<TInitialPayload>, options?: Omit<WorkflowServeOptions<Response, TInitialPayload>, "onStepFinish">) => NextApiHandler;
17
+
18
+ export { serve, servePagesRouter };