@upstash/workflow 0.2.22-rc → 0.3.0-rc
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/README.md +39 -0
- package/astro.d.mts +3 -5
- package/astro.d.ts +3 -5
- package/astro.js +126 -397
- package/astro.mjs +1 -1
- package/{chunk-CAQSUCHB.mjs → chunk-AGYYZKP7.mjs} +94 -400
- package/cloudflare.d.mts +3 -5
- package/cloudflare.d.ts +3 -5
- package/cloudflare.js +126 -397
- package/cloudflare.mjs +1 -1
- package/express.d.mts +3 -5
- package/express.d.ts +3 -5
- package/express.js +128 -398
- package/express.mjs +3 -2
- package/h3.d.mts +3 -5
- package/h3.d.ts +3 -5
- package/h3.js +136 -410
- package/h3.mjs +11 -14
- package/hono.d.mts +4 -6
- package/hono.d.ts +4 -6
- package/hono.js +126 -397
- package/hono.mjs +1 -1
- package/index.d.mts +11 -5
- package/index.d.ts +11 -5
- package/index.js +130 -433
- package/index.mjs +5 -6
- package/nextjs.d.mts +4 -6
- package/nextjs.d.ts +4 -6
- package/nextjs.js +128 -398
- package/nextjs.mjs +3 -2
- package/package.json +1 -1
- package/{serve-many-BNusWYgt.d.mts → serve-many-DEwKPF6H.d.mts} +1 -1
- package/{serve-many-CXqQP3RI.d.ts → serve-many-DVtHRxeg.d.ts} +1 -1
- package/solidjs.d.mts +1 -3
- package/solidjs.d.ts +1 -3
- package/solidjs.js +126 -397
- package/solidjs.mjs +1 -1
- package/svelte.d.mts +4 -6
- package/svelte.d.ts +4 -6
- package/svelte.js +126 -397
- package/svelte.mjs +1 -1
- package/tanstack.d.mts +3 -5
- package/tanstack.d.ts +3 -5
- package/tanstack.js +126 -397
- package/tanstack.mjs +1 -1
- package/{types-Q3dM0UlR.d.ts → types-DESkn7K9.d.mts} +15 -306
- package/{types-Q3dM0UlR.d.mts → types-DESkn7K9.d.ts} +15 -306
package/h3.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
SDK_TELEMETRY,
|
|
3
3
|
serveBase,
|
|
4
4
|
serveManyBase
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-AGYYZKP7.mjs";
|
|
6
6
|
|
|
7
7
|
// node_modules/defu/dist/defu.mjs
|
|
8
8
|
function isPlainObject(value) {
|
|
@@ -80,21 +80,16 @@ function hasProp(obj, prop) {
|
|
|
80
80
|
return false;
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
var __defProp$2 = Object.defineProperty;
|
|
84
|
-
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
85
|
-
var __publicField$2 = (obj, key, value) => {
|
|
86
|
-
__defNormalProp$2(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
87
|
-
return value;
|
|
88
|
-
};
|
|
89
83
|
var H3Error = class extends Error {
|
|
84
|
+
static __h3_error__ = true;
|
|
85
|
+
statusCode = 500;
|
|
86
|
+
fatal = false;
|
|
87
|
+
unhandled = false;
|
|
88
|
+
statusMessage;
|
|
89
|
+
data;
|
|
90
|
+
cause;
|
|
90
91
|
constructor(message, opts = {}) {
|
|
91
92
|
super(message, opts);
|
|
92
|
-
__publicField$2(this, "statusCode", 500);
|
|
93
|
-
__publicField$2(this, "fatal", false);
|
|
94
|
-
__publicField$2(this, "unhandled", false);
|
|
95
|
-
__publicField$2(this, "statusMessage");
|
|
96
|
-
__publicField$2(this, "data");
|
|
97
|
-
__publicField$2(this, "cause");
|
|
98
93
|
if (opts.cause && !this.cause) {
|
|
99
94
|
this.cause = opts.cause;
|
|
100
95
|
}
|
|
@@ -113,7 +108,6 @@ var H3Error = class extends Error {
|
|
|
113
108
|
return obj;
|
|
114
109
|
}
|
|
115
110
|
};
|
|
116
|
-
__publicField$2(H3Error, "__h3_error__", true);
|
|
117
111
|
function createError(input) {
|
|
118
112
|
if (typeof input === "string") {
|
|
119
113
|
return new H3Error(input);
|
|
@@ -236,6 +230,9 @@ function readRawBody(event, encoding = "utf8") {
|
|
|
236
230
|
if (_resolved instanceof URLSearchParams) {
|
|
237
231
|
return Buffer.from(_resolved.toString());
|
|
238
232
|
}
|
|
233
|
+
if (_resolved instanceof FormData) {
|
|
234
|
+
return new Response(_resolved).bytes().then((uint8arr) => Buffer.from(uint8arr));
|
|
235
|
+
}
|
|
239
236
|
return Buffer.from(_resolved);
|
|
240
237
|
});
|
|
241
238
|
return encoding ? promise2.then((buff) => buff.toString(encoding)) : promise2;
|
package/hono.d.mts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { Context } from 'hono';
|
|
2
|
-
import { R as RouteFunction, n as PublicServeOptions, y as InvokableWorkflow } from './types-
|
|
2
|
+
import { R as RouteFunction, n as PublicServeOptions, y as InvokableWorkflow } from './types-DESkn7K9.mjs';
|
|
3
3
|
import { Variables } from 'hono/types';
|
|
4
|
-
import { s as serveManyBase } from './serve-many-
|
|
4
|
+
import { s as serveManyBase } from './serve-many-DEwKPF6H.mjs';
|
|
5
5
|
import '@upstash/qstash';
|
|
6
6
|
import 'zod';
|
|
7
|
-
import 'ai';
|
|
8
|
-
import '@ai-sdk/openai';
|
|
9
7
|
|
|
10
8
|
type WorkflowBindings = {
|
|
11
9
|
QSTASH_TOKEN: string;
|
|
@@ -23,11 +21,11 @@ type WorkflowBindings = {
|
|
|
23
21
|
* @param options workflow options
|
|
24
22
|
* @returns
|
|
25
23
|
*/
|
|
26
|
-
declare const serve: <TInitialPayload = unknown, TBindings extends WorkflowBindings = WorkflowBindings, TVariables extends Variables =
|
|
24
|
+
declare const serve: <TInitialPayload = unknown, TBindings extends WorkflowBindings = WorkflowBindings, TVariables extends Variables = Variables, TResult = unknown>(routeFunction: RouteFunction<TInitialPayload, TResult>, options?: PublicServeOptions<TInitialPayload>) => ((context: Context<{
|
|
27
25
|
Bindings: TBindings;
|
|
28
26
|
Variables: TVariables;
|
|
29
27
|
}>) => Promise<Response>);
|
|
30
|
-
declare const createWorkflow: <TInitialPayload = unknown, TResult = unknown, TBindings extends WorkflowBindings = WorkflowBindings, TVariables extends Variables =
|
|
28
|
+
declare const createWorkflow: <TInitialPayload = unknown, TResult = unknown, TBindings extends WorkflowBindings = WorkflowBindings, TVariables extends Variables = Variables>(...params: Parameters<typeof serve<TInitialPayload, TBindings, TVariables, TResult>>) => InvokableWorkflow<TInitialPayload, TResult>;
|
|
31
29
|
declare const serveMany: (workflows: Parameters<typeof serveManyBase>[0]["workflows"], options?: Parameters<typeof serveManyBase>[0]["options"]) => (context: Context<{
|
|
32
30
|
Bindings: WorkflowBindings;
|
|
33
31
|
Variables: object;
|
package/hono.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { Context } from 'hono';
|
|
2
|
-
import { R as RouteFunction, n as PublicServeOptions, y as InvokableWorkflow } from './types-
|
|
2
|
+
import { R as RouteFunction, n as PublicServeOptions, y as InvokableWorkflow } from './types-DESkn7K9.js';
|
|
3
3
|
import { Variables } from 'hono/types';
|
|
4
|
-
import { s as serveManyBase } from './serve-many-
|
|
4
|
+
import { s as serveManyBase } from './serve-many-DVtHRxeg.js';
|
|
5
5
|
import '@upstash/qstash';
|
|
6
6
|
import 'zod';
|
|
7
|
-
import 'ai';
|
|
8
|
-
import '@ai-sdk/openai';
|
|
9
7
|
|
|
10
8
|
type WorkflowBindings = {
|
|
11
9
|
QSTASH_TOKEN: string;
|
|
@@ -23,11 +21,11 @@ type WorkflowBindings = {
|
|
|
23
21
|
* @param options workflow options
|
|
24
22
|
* @returns
|
|
25
23
|
*/
|
|
26
|
-
declare const serve: <TInitialPayload = unknown, TBindings extends WorkflowBindings = WorkflowBindings, TVariables extends Variables =
|
|
24
|
+
declare const serve: <TInitialPayload = unknown, TBindings extends WorkflowBindings = WorkflowBindings, TVariables extends Variables = Variables, TResult = unknown>(routeFunction: RouteFunction<TInitialPayload, TResult>, options?: PublicServeOptions<TInitialPayload>) => ((context: Context<{
|
|
27
25
|
Bindings: TBindings;
|
|
28
26
|
Variables: TVariables;
|
|
29
27
|
}>) => Promise<Response>);
|
|
30
|
-
declare const createWorkflow: <TInitialPayload = unknown, TResult = unknown, TBindings extends WorkflowBindings = WorkflowBindings, TVariables extends Variables =
|
|
28
|
+
declare const createWorkflow: <TInitialPayload = unknown, TResult = unknown, TBindings extends WorkflowBindings = WorkflowBindings, TVariables extends Variables = Variables>(...params: Parameters<typeof serve<TInitialPayload, TBindings, TVariables, TResult>>) => InvokableWorkflow<TInitialPayload, TResult>;
|
|
31
29
|
declare const serveMany: (workflows: Parameters<typeof serveManyBase>[0]["workflows"], options?: Parameters<typeof serveManyBase>[0]["options"]) => (context: Context<{
|
|
32
30
|
Bindings: WorkflowBindings;
|
|
33
31
|
Variables: object;
|