@upstash/workflow 0.2.8 → 0.2.10-hono-generics

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 CHANGED
@@ -1,10 +1,15 @@
1
1
  import {
2
2
  SDK_TELEMETRY,
3
3
  serveBase
4
- } from "./chunk-BPUSHNSD.mjs";
4
+ } from "./chunk-IPXJZU3K.mjs";
5
5
 
6
6
  // platforms/solidjs.ts
7
7
  var serve = (routeFunction, options) => {
8
+ const telemetry = {
9
+ sdk: SDK_TELEMETRY,
10
+ framework: "solidjs",
11
+ runtime: process.versions.bun ? `bun@${process.versions.bun}/node@${process.version}` : `node@${process.version}`
12
+ };
8
13
  const handler = async (event) => {
9
14
  const method = event.request.method;
10
15
  if (method.toUpperCase() !== "POST") {
@@ -12,15 +17,7 @@ var serve = (routeFunction, options) => {
12
17
  status: 405
13
18
  });
14
19
  }
15
- const { handler: serveHandler } = serveBase(
16
- routeFunction,
17
- {
18
- sdk: SDK_TELEMETRY,
19
- framework: "solidjs",
20
- runtime: process.versions.bun ? `bun@${process.versions.bun}/node@${process.version}` : `node@${process.version}`
21
- },
22
- options
23
- );
20
+ const { handler: serveHandler } = serveBase(routeFunction, telemetry, options);
24
21
  return await serveHandler(event.request);
25
22
  };
26
23
  return { POST: handler };
package/svelte.d.mts CHANGED
@@ -1,12 +1,17 @@
1
+ import * as _sveltejs_kit from '@sveltejs/kit';
1
2
  import { RequestHandler } from '@sveltejs/kit';
2
- import { R as RouteFunction, k as PublicServeOptions } from './types-B62AnIU3.mjs';
3
+ import { R as RouteFunction, k as PublicServeOptions, t as InvokableWorkflow } from './types-CYhDXnf8.mjs';
4
+ import { s as serveManyBase } from './serve-many-BVDpPsF-.mjs';
3
5
  import '@upstash/qstash';
4
6
  import 'zod';
5
7
  import 'ai';
6
8
  import '@ai-sdk/openai';
7
9
 
10
+ type RequireEnv<T> = T & {
11
+ env: PublicServeOptions["env"];
12
+ };
8
13
  /**
9
- * Serve method to serve a Upstash Workflow in a Nextjs project
14
+ * Serve method to serve a Upstash Workflow in a Svelte project
10
15
  *
11
16
  * See for options https://upstash.com/docs/qstash/workflows/basics/serve
12
17
  *
@@ -14,10 +19,12 @@ import '@ai-sdk/openai';
14
19
  * @param options workflow options
15
20
  * @returns
16
21
  */
17
- declare const serve: <TInitialPayload = unknown>(routeFunction: RouteFunction<TInitialPayload>, options: PublicServeOptions<TInitialPayload> & {
18
- env: PublicServeOptions["env"];
19
- }) => {
22
+ declare const serve: <TInitialPayload = unknown, TResult = unknown>(routeFunction: RouteFunction<TInitialPayload, TResult>, options: RequireEnv<PublicServeOptions<TInitialPayload>>) => {
20
23
  POST: RequestHandler;
21
24
  };
25
+ declare const createWorkflow: <TInitialPayload, TResult>(routeFunction: RouteFunction<TInitialPayload, TResult>, options: RequireEnv<PublicServeOptions<TInitialPayload>>) => InvokableWorkflow<TInitialPayload, TResult>;
26
+ declare const serveMany: (workflows: Parameters<typeof serveManyBase>[0]["workflows"], options?: Parameters<typeof serveManyBase>[0]["options"]) => {
27
+ POST: (event: _sveltejs_kit.RequestEvent<Partial<Record<string, string>>, string | null>) => Promise<any>;
28
+ };
22
29
 
23
- export { serve };
30
+ export { createWorkflow, serve, serveMany };
package/svelte.d.ts CHANGED
@@ -1,12 +1,17 @@
1
+ import * as _sveltejs_kit from '@sveltejs/kit';
1
2
  import { RequestHandler } from '@sveltejs/kit';
2
- import { R as RouteFunction, k as PublicServeOptions } from './types-B62AnIU3.js';
3
+ import { R as RouteFunction, k as PublicServeOptions, t as InvokableWorkflow } from './types-CYhDXnf8.js';
4
+ import { s as serveManyBase } from './serve-many-e4zufyXN.js';
3
5
  import '@upstash/qstash';
4
6
  import 'zod';
5
7
  import 'ai';
6
8
  import '@ai-sdk/openai';
7
9
 
10
+ type RequireEnv<T> = T & {
11
+ env: PublicServeOptions["env"];
12
+ };
8
13
  /**
9
- * Serve method to serve a Upstash Workflow in a Nextjs project
14
+ * Serve method to serve a Upstash Workflow in a Svelte project
10
15
  *
11
16
  * See for options https://upstash.com/docs/qstash/workflows/basics/serve
12
17
  *
@@ -14,10 +19,12 @@ import '@ai-sdk/openai';
14
19
  * @param options workflow options
15
20
  * @returns
16
21
  */
17
- declare const serve: <TInitialPayload = unknown>(routeFunction: RouteFunction<TInitialPayload>, options: PublicServeOptions<TInitialPayload> & {
18
- env: PublicServeOptions["env"];
19
- }) => {
22
+ declare const serve: <TInitialPayload = unknown, TResult = unknown>(routeFunction: RouteFunction<TInitialPayload, TResult>, options: RequireEnv<PublicServeOptions<TInitialPayload>>) => {
20
23
  POST: RequestHandler;
21
24
  };
25
+ declare const createWorkflow: <TInitialPayload, TResult>(routeFunction: RouteFunction<TInitialPayload, TResult>, options: RequireEnv<PublicServeOptions<TInitialPayload>>) => InvokableWorkflow<TInitialPayload, TResult>;
26
+ declare const serveMany: (workflows: Parameters<typeof serveManyBase>[0]["workflows"], options?: Parameters<typeof serveManyBase>[0]["options"]) => {
27
+ POST: (event: _sveltejs_kit.RequestEvent<Partial<Record<string, string>>, string | null>) => Promise<any>;
28
+ };
22
29
 
23
- export { serve };
30
+ export { createWorkflow, serve, serveMany };