@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/express.mjs
CHANGED
|
@@ -3,8 +3,9 @@ import {
|
|
|
3
3
|
__commonJS,
|
|
4
4
|
__require,
|
|
5
5
|
__toESM,
|
|
6
|
-
serveBase
|
|
7
|
-
|
|
6
|
+
serveBase,
|
|
7
|
+
serveManyBase
|
|
8
|
+
} from "./chunk-IPXJZU3K.mjs";
|
|
8
9
|
|
|
9
10
|
// node_modules/depd/index.js
|
|
10
11
|
var require_depd = __commonJS({
|
|
@@ -23670,9 +23671,14 @@ var import_express = __toESM(require_express2());
|
|
|
23670
23671
|
var isEmptyRequest = (req) => {
|
|
23671
23672
|
return req.headers["content-type"] === "application/json" && req.headers["content-length"] === "0";
|
|
23672
23673
|
};
|
|
23673
|
-
|
|
23674
|
-
|
|
23675
|
-
|
|
23674
|
+
var telemetry = {
|
|
23675
|
+
sdk: SDK_TELEMETRY,
|
|
23676
|
+
framework: "express",
|
|
23677
|
+
runtime: process.versions.bun ? `bun@${process.versions.bun}/node@${process.version}` : `node@${process.version}`
|
|
23678
|
+
};
|
|
23679
|
+
function createExpressHandler(params) {
|
|
23680
|
+
const [routeFunction, options] = params;
|
|
23681
|
+
return async (request_, res) => {
|
|
23676
23682
|
if (request_.method.toUpperCase() !== "POST") {
|
|
23677
23683
|
res.status(405).json("Only POST requests are allowed in workflows");
|
|
23678
23684
|
return;
|
|
@@ -23695,26 +23701,45 @@ function serve(routeFunction, options) {
|
|
|
23695
23701
|
headers: new Headers(request_.headers),
|
|
23696
23702
|
body: requestBody
|
|
23697
23703
|
});
|
|
23698
|
-
const { handler: serveHandler } = serveBase(
|
|
23699
|
-
|
|
23700
|
-
|
|
23701
|
-
|
|
23702
|
-
framework: "express",
|
|
23703
|
-
runtime: process.versions.bun ? `bun@${process.versions.bun}/node@${process.version}` : `node@${process.version}`
|
|
23704
|
-
},
|
|
23705
|
-
{
|
|
23706
|
-
...options,
|
|
23707
|
-
useJSONContent: true
|
|
23708
|
-
}
|
|
23709
|
-
);
|
|
23704
|
+
const { handler: serveHandler } = serveBase(routeFunction, telemetry, {
|
|
23705
|
+
...options,
|
|
23706
|
+
useJSONContent: true
|
|
23707
|
+
});
|
|
23710
23708
|
const response = await serveHandler(webRequest);
|
|
23711
23709
|
res.status(response.status).json(await response.json());
|
|
23712
23710
|
};
|
|
23711
|
+
}
|
|
23712
|
+
function serve(routeFunction, options) {
|
|
23713
|
+
const router = (0, import_express.Router)();
|
|
23714
|
+
const handler = createExpressHandler([routeFunction, options]);
|
|
23713
23715
|
router.all("*", handler);
|
|
23714
23716
|
return router;
|
|
23715
23717
|
}
|
|
23718
|
+
var createWorkflow = (...params) => {
|
|
23719
|
+
const [routeFunction, options = {}] = params;
|
|
23720
|
+
return {
|
|
23721
|
+
routeFunction,
|
|
23722
|
+
options,
|
|
23723
|
+
workflowId: void 0
|
|
23724
|
+
};
|
|
23725
|
+
};
|
|
23726
|
+
var serveMany = (workflows, options) => {
|
|
23727
|
+
const router = (0, import_express.Router)();
|
|
23728
|
+
const { handler } = serveManyBase({
|
|
23729
|
+
workflows,
|
|
23730
|
+
getUrl(...params) {
|
|
23731
|
+
return params[0].url;
|
|
23732
|
+
},
|
|
23733
|
+
serveMethod: (...params) => createExpressHandler(params),
|
|
23734
|
+
options
|
|
23735
|
+
});
|
|
23736
|
+
router.all("*", handler);
|
|
23737
|
+
return router;
|
|
23738
|
+
};
|
|
23716
23739
|
export {
|
|
23717
|
-
|
|
23740
|
+
createWorkflow,
|
|
23741
|
+
serve,
|
|
23742
|
+
serveMany
|
|
23718
23743
|
};
|
|
23719
23744
|
/*! Bundled license information:
|
|
23720
23745
|
|
package/h3.d.mts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import * as h3 from 'h3';
|
|
2
|
-
import { R as RouteFunction, k as PublicServeOptions } from './types-
|
|
2
|
+
import { R as RouteFunction, k as PublicServeOptions, t as InvokableWorkflow } from './types-CYhDXnf8.mjs';
|
|
3
|
+
import { s as serveManyBase } from './serve-many-BVDpPsF-.mjs';
|
|
3
4
|
import '@upstash/qstash';
|
|
4
5
|
import 'zod';
|
|
5
6
|
import 'ai';
|
|
6
7
|
import '@ai-sdk/openai';
|
|
7
8
|
|
|
8
|
-
declare const serve: <TInitialPayload = unknown>(routeFunction: RouteFunction<TInitialPayload>, options?: PublicServeOptions<TInitialPayload>) => {
|
|
9
|
-
handler: h3.EventHandler<h3.EventHandlerRequest, Promise<Response
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
declare const serve: <TInitialPayload = unknown, TResult = unknown>(routeFunction: RouteFunction<TInitialPayload, TResult>, options?: PublicServeOptions<TInitialPayload>) => {
|
|
10
|
+
handler: h3.EventHandler<h3.EventHandlerRequest, Promise<Response>>;
|
|
11
|
+
};
|
|
12
|
+
declare const createWorkflow: <TInitialPayload, TResult>(routeFunction: RouteFunction<TInitialPayload, TResult>, options?: PublicServeOptions<TInitialPayload> | undefined) => InvokableWorkflow<TInitialPayload, TResult>;
|
|
13
|
+
declare const serveMany: (workflows: Parameters<typeof serveManyBase>[0]["workflows"], options?: Parameters<typeof serveManyBase>[0]["options"]) => {
|
|
14
|
+
handler: (event: h3.H3Event<h3.EventHandlerRequest>) => Promise<any>;
|
|
13
15
|
};
|
|
14
16
|
|
|
15
|
-
export { serve };
|
|
17
|
+
export { createWorkflow, serve, serveMany };
|
package/h3.d.ts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import * as h3 from 'h3';
|
|
2
|
-
import { R as RouteFunction, k as PublicServeOptions } from './types-
|
|
2
|
+
import { R as RouteFunction, k as PublicServeOptions, t as InvokableWorkflow } from './types-CYhDXnf8.js';
|
|
3
|
+
import { s as serveManyBase } from './serve-many-e4zufyXN.js';
|
|
3
4
|
import '@upstash/qstash';
|
|
4
5
|
import 'zod';
|
|
5
6
|
import 'ai';
|
|
6
7
|
import '@ai-sdk/openai';
|
|
7
8
|
|
|
8
|
-
declare const serve: <TInitialPayload = unknown>(routeFunction: RouteFunction<TInitialPayload>, options?: PublicServeOptions<TInitialPayload>) => {
|
|
9
|
-
handler: h3.EventHandler<h3.EventHandlerRequest, Promise<Response
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
declare const serve: <TInitialPayload = unknown, TResult = unknown>(routeFunction: RouteFunction<TInitialPayload, TResult>, options?: PublicServeOptions<TInitialPayload>) => {
|
|
10
|
+
handler: h3.EventHandler<h3.EventHandlerRequest, Promise<Response>>;
|
|
11
|
+
};
|
|
12
|
+
declare const createWorkflow: <TInitialPayload, TResult>(routeFunction: RouteFunction<TInitialPayload, TResult>, options?: PublicServeOptions<TInitialPayload> | undefined) => InvokableWorkflow<TInitialPayload, TResult>;
|
|
13
|
+
declare const serveMany: (workflows: Parameters<typeof serveManyBase>[0]["workflows"], options?: Parameters<typeof serveManyBase>[0]["options"]) => {
|
|
14
|
+
handler: (event: h3.H3Event<h3.EventHandlerRequest>) => Promise<any>;
|
|
13
15
|
};
|
|
14
16
|
|
|
15
|
-
export { serve };
|
|
17
|
+
export { createWorkflow, serve, serveMany };
|