@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/solidjs.mjs ADDED
@@ -0,0 +1,21 @@
1
+ import {
2
+ serve
3
+ } from "./chunk-JDMP6KKR.mjs";
4
+
5
+ // platforms/solidjs.ts
6
+ var serve2 = (routeFunction, options) => {
7
+ const handler = async (event) => {
8
+ const method = event.request.method;
9
+ if (method.toUpperCase() !== "POST") {
10
+ return new Response("Only POST requests are allowed in worklfows", {
11
+ status: 405
12
+ });
13
+ }
14
+ const serveHandler = serve(routeFunction, options);
15
+ return await serveHandler(event.request);
16
+ };
17
+ return handler;
18
+ };
19
+ export {
20
+ serve2 as serve
21
+ };
package/svelte.d.mts ADDED
@@ -0,0 +1,18 @@
1
+ import { RequestHandler } from '@sveltejs/kit';
2
+ import { R as RouteFunction, W as WorkflowServeOptions } from './types-CfN1Epuj.mjs';
3
+ import '@upstash/qstash';
4
+
5
+ /**
6
+ * Serve method to serve a Upstash Workflow in a Nextjs project
7
+ *
8
+ * See for options https://upstash.com/docs/qstash/workflows/basics/serve
9
+ *
10
+ * @param routeFunction workflow function
11
+ * @param options workflow options
12
+ * @returns
13
+ */
14
+ declare const serve: <TInitialPayload = unknown>(routeFunction: RouteFunction<TInitialPayload>, options: Omit<WorkflowServeOptions<Response, TInitialPayload>, "onStepFinish"> & {
15
+ env: WorkflowServeOptions["env"];
16
+ }) => RequestHandler;
17
+
18
+ export { serve };
package/svelte.d.ts ADDED
@@ -0,0 +1,18 @@
1
+ import { RequestHandler } from '@sveltejs/kit';
2
+ import { R as RouteFunction, W as WorkflowServeOptions } from './types-CfN1Epuj.js';
3
+ import '@upstash/qstash';
4
+
5
+ /**
6
+ * Serve method to serve a Upstash Workflow in a Nextjs project
7
+ *
8
+ * See for options https://upstash.com/docs/qstash/workflows/basics/serve
9
+ *
10
+ * @param routeFunction workflow function
11
+ * @param options workflow options
12
+ * @returns
13
+ */
14
+ declare const serve: <TInitialPayload = unknown>(routeFunction: RouteFunction<TInitialPayload>, options: Omit<WorkflowServeOptions<Response, TInitialPayload>, "onStepFinish"> & {
15
+ env: WorkflowServeOptions["env"];
16
+ }) => RequestHandler;
17
+
18
+ export { serve };