@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/astro.d.mts +8 -3
- package/astro.d.ts +8 -3
- package/astro.js +393 -82
- package/astro.mjs +36 -8
- package/{chunk-BPUSHNSD.mjs → chunk-IPXJZU3K.mjs} +1226 -943
- package/cloudflare.d.mts +9 -4
- package/cloudflare.d.ts +9 -4
- package/cloudflare.js +392 -88
- package/cloudflare.mjs +35 -14
- package/express.d.mts +7 -3
- package/express.d.ts +7 -3
- package/express.js +400 -92
- package/express.mjs +43 -18
- package/h3.d.mts +9 -7
- package/h3.d.ts +9 -7
- package/h3.js +397 -95
- package/h3.mjs +40 -21
- package/hono.d.mts +10 -4
- package/hono.d.ts +10 -4
- package/hono.js +391 -90
- package/hono.mjs +34 -16
- package/index.d.mts +47 -33
- package/index.d.ts +47 -33
- package/index.js +315 -92
- package/index.mjs +32 -30
- package/nextjs.d.mts +14 -5
- package/nextjs.d.ts +14 -5
- package/nextjs.js +408 -77
- package/nextjs.mjs +63 -17
- package/package.json +1 -1
- package/serve-many-BVDpPsF-.d.mts +13 -0
- package/serve-many-e4zufyXN.d.ts +13 -0
- package/solidjs.d.mts +3 -3
- package/solidjs.d.ts +3 -3
- package/solidjs.js +289 -71
- package/solidjs.mjs +7 -10
- package/svelte.d.mts +13 -6
- package/svelte.d.ts +13 -6
- package/svelte.js +391 -88
- package/svelte.mjs +34 -14
- package/{types-B62AnIU3.d.mts → types-CYhDXnf8.d.mts} +74 -8
- package/{types-B62AnIU3.d.ts → types-CYhDXnf8.d.ts} +74 -8
package/solidjs.mjs
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SDK_TELEMETRY,
|
|
3
3
|
serveBase
|
|
4
|
-
} from "./chunk-
|
|
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-
|
|
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
|
|
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-
|
|
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
|
|
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 };
|