@upstash/workflow 0.2.8 → 0.2.9
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/astro.mjs
CHANGED
|
@@ -1,24 +1,52 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SDK_TELEMETRY,
|
|
3
|
-
serveBase
|
|
4
|
-
|
|
3
|
+
serveBase,
|
|
4
|
+
serveManyBase
|
|
5
|
+
} from "./chunk-IPXJZU3K.mjs";
|
|
5
6
|
|
|
6
7
|
// platforms/astro.ts
|
|
8
|
+
var telemetry = {
|
|
9
|
+
sdk: SDK_TELEMETRY,
|
|
10
|
+
framework: "astro",
|
|
11
|
+
runtime: process.versions.bun ? `bun@${process.versions.bun}/node@${process.version}` : `node@${process.version}`
|
|
12
|
+
};
|
|
7
13
|
function serve(routeFunction, options) {
|
|
8
14
|
const POST = (apiContext) => {
|
|
9
15
|
const { handler } = serveBase(
|
|
10
16
|
(workflowContext) => routeFunction(workflowContext, apiContext),
|
|
11
|
-
|
|
12
|
-
sdk: SDK_TELEMETRY,
|
|
13
|
-
framework: "astro",
|
|
14
|
-
runtime: process.versions.bun ? `bun@${process.versions.bun}/node@${process.version}` : `node@${process.version}`
|
|
15
|
-
},
|
|
17
|
+
telemetry,
|
|
16
18
|
options
|
|
17
19
|
);
|
|
18
20
|
return handler(apiContext.request);
|
|
19
21
|
};
|
|
20
22
|
return { POST };
|
|
21
23
|
}
|
|
24
|
+
var createWorkflow = (...params) => {
|
|
25
|
+
const [routeFunction, options = {}] = params;
|
|
26
|
+
return {
|
|
27
|
+
workflowId: void 0,
|
|
28
|
+
// @ts-expect-error because astro route function has another parameeter,
|
|
29
|
+
// the RouteFunction type can't cover this. We need to make RouteFunction
|
|
30
|
+
// accept more variables than simply the context. Until then, ignoring the
|
|
31
|
+
// error here. Tested the usage in astro project and it's fine. TODO.
|
|
32
|
+
routeFunction,
|
|
33
|
+
options
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
var serveMany = (workflows, options) => {
|
|
37
|
+
return {
|
|
38
|
+
POST: serveManyBase({
|
|
39
|
+
workflows,
|
|
40
|
+
getUrl(...params) {
|
|
41
|
+
return params[0].request.url;
|
|
42
|
+
},
|
|
43
|
+
serveMethod: (...params) => serve(...params).POST,
|
|
44
|
+
options
|
|
45
|
+
}).handler
|
|
46
|
+
};
|
|
47
|
+
};
|
|
22
48
|
export {
|
|
23
|
-
|
|
49
|
+
createWorkflow,
|
|
50
|
+
serve,
|
|
51
|
+
serveMany
|
|
24
52
|
};
|