@upstash/workflow 0.2.11 → 0.2.13
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 +2 -2
- package/astro.d.ts +2 -2
- package/astro.js +1264 -1071
- package/astro.mjs +1 -1
- package/{chunk-WQAJ2RSZ.mjs → chunk-XVNSBBDC.mjs} +897 -702
- package/cloudflare.d.mts +2 -2
- package/cloudflare.d.ts +2 -2
- package/cloudflare.js +1264 -1071
- package/cloudflare.mjs +1 -1
- package/express.d.mts +2 -2
- package/express.d.ts +2 -2
- package/express.js +1267 -1074
- package/express.mjs +1 -1
- package/h3.d.mts +2 -2
- package/h3.d.ts +2 -2
- package/h3.js +1264 -1071
- package/h3.mjs +1 -1
- package/hono.d.mts +2 -2
- package/hono.d.ts +2 -2
- package/hono.js +1265 -1072
- package/hono.mjs +2 -2
- package/index.d.mts +16 -6
- package/index.d.ts +16 -6
- package/index.js +1238 -1038
- package/index.mjs +10 -3
- package/nextjs.d.mts +2 -2
- package/nextjs.d.ts +2 -2
- package/nextjs.js +1264 -1071
- package/nextjs.mjs +1 -1
- package/package.json +1 -1
- package/{serve-many-Fuovl7gl.d.mts → serve-many-BF71QZHQ.d.mts} +1 -1
- package/{serve-many-DNnLsDIp.d.ts → serve-many-BMlN2PAB.d.ts} +1 -1
- package/solidjs.d.mts +1 -1
- package/solidjs.d.ts +1 -1
- package/solidjs.js +1235 -1042
- package/solidjs.mjs +1 -1
- package/svelte.d.mts +2 -2
- package/svelte.d.ts +2 -2
- package/svelte.js +1264 -1071
- package/svelte.mjs +1 -1
- package/{types-DS9q8FyV.d.ts → types-C1WIgVLA.d.mts} +110 -82
- package/{types-DS9q8FyV.d.mts → types-C1WIgVLA.d.ts} +110 -82
package/hono.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
SDK_TELEMETRY,
|
|
3
3
|
serveBase,
|
|
4
4
|
serveManyBase
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-XVNSBBDC.mjs";
|
|
6
6
|
|
|
7
7
|
// platforms/hono.ts
|
|
8
8
|
var telemetry = {
|
|
@@ -11,7 +11,7 @@ var telemetry = {
|
|
|
11
11
|
};
|
|
12
12
|
var serve = (routeFunction, options) => {
|
|
13
13
|
const handler = async (context) => {
|
|
14
|
-
const environment = context.env;
|
|
14
|
+
const environment = context.env ? context.env : typeof process === "undefined" ? {} : process.env;
|
|
15
15
|
const request = context.req.raw;
|
|
16
16
|
const { handler: serveHandler } = serveBase(routeFunction, telemetry, {
|
|
17
17
|
// when hono is used without cf workers, it sends a DebugHTTPServer
|
package/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { R as RouteFunction, W as WorkflowServeOptions, E as ExclusiveValidationOptions, T as Telemetry, S as StepType, a as RawStep, N as NotifyResponse, b as Waiter, c as Step } from './types-
|
|
2
|
-
export { A as AsyncStepFunction, C as CallResponse, r as CallSettings, D as Duration, l as FailureFunctionPayload, F as FinishCondition, H as HeaderParams, t as InvokableWorkflow, s as InvokeStepResponse, I as InvokeWorkflowRequest, L as LazyInvokeStepParams, u as LogLevel, p as NotifyStepResponse, P as ParallelCallState, k as PublicServeOptions, m as RequiredExceptFields, j as StepFunction, h as StepTypes, i as SyncStepFunction, q as WaitEventOptions, n as WaitRequest, o as WaitStepResponse, f as WorkflowClient, e as WorkflowContext, w as WorkflowLogger, v as WorkflowLoggerOptions, g as WorkflowReceiver, d as WorkflowTool } from './types-
|
|
3
|
-
import { HTTPMethods, State, FlowControl, Client as Client$1, QstashError } from '@upstash/qstash';
|
|
1
|
+
import { R as RouteFunction, W as WorkflowServeOptions, E as ExclusiveValidationOptions, T as Telemetry, S as StepType, a as RawStep, N as NotifyResponse, b as Waiter, c as Step } from './types-C1WIgVLA.mjs';
|
|
2
|
+
export { A as AsyncStepFunction, C as CallResponse, r as CallSettings, D as Duration, l as FailureFunctionPayload, F as FinishCondition, H as HeaderParams, t as InvokableWorkflow, s as InvokeStepResponse, I as InvokeWorkflowRequest, L as LazyInvokeStepParams, u as LogLevel, p as NotifyStepResponse, P as ParallelCallState, k as PublicServeOptions, m as RequiredExceptFields, j as StepFunction, h as StepTypes, i as SyncStepFunction, q as WaitEventOptions, n as WaitRequest, o as WaitStepResponse, f as WorkflowClient, e as WorkflowContext, w as WorkflowLogger, v as WorkflowLoggerOptions, g as WorkflowReceiver, d as WorkflowTool } from './types-C1WIgVLA.mjs';
|
|
3
|
+
import { HTTPMethods, State, FlowControl, PublishRequest, Client as Client$1, QstashError } from '@upstash/qstash';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import 'ai';
|
|
6
6
|
import '@ai-sdk/openai';
|
|
@@ -154,7 +154,11 @@ type WaitEventGroup = {
|
|
|
154
154
|
type AsOptional<TType> = TType | {
|
|
155
155
|
[P in keyof TType]?: never;
|
|
156
156
|
};
|
|
157
|
-
type StepLog = BaseStepLog & AsOptional<CallUrlGroup> & AsOptional<CallResponseStatusGroup> & AsOptional<InvokedWorkflowGroup> & AsOptional<
|
|
157
|
+
type StepLog = BaseStepLog & AsOptional<CallUrlGroup> & AsOptional<CallResponseStatusGroup> & AsOptional<InvokedWorkflowGroup> & AsOptional<{
|
|
158
|
+
sleepFor: number;
|
|
159
|
+
}> & AsOptional<{
|
|
160
|
+
sleepUntil: number;
|
|
161
|
+
}> & AsOptional<WaitEventGroup>;
|
|
158
162
|
type StepLogGroup = {
|
|
159
163
|
/**
|
|
160
164
|
* Log which belongs to a single step
|
|
@@ -179,7 +183,7 @@ type StepLogGroup = {
|
|
|
179
183
|
*/
|
|
180
184
|
steps: {
|
|
181
185
|
messageId: string;
|
|
182
|
-
state: "STEP_PROGRESS" | "STEP_RETRY" | "STEP_FAILED";
|
|
186
|
+
state: "STEP_PROGRESS" | "STEP_RETRY" | "STEP_FAILED" | "STEP_CANCELED";
|
|
183
187
|
}[];
|
|
184
188
|
/**
|
|
185
189
|
* Log which belongs to the next step
|
|
@@ -419,15 +423,21 @@ declare class Client {
|
|
|
419
423
|
* with `wfr_`.
|
|
420
424
|
* @param retries retry to use in the initial request. in the rest of
|
|
421
425
|
* the workflow, `retries` option of the `serve` will be used.
|
|
426
|
+
* @param flowControl Settings for controlling the number of active requests
|
|
427
|
+
* and number of requests per second with the same key.
|
|
428
|
+
* @param delay Delay for the workflow run. This is used to delay the
|
|
429
|
+
* execution of the workflow run. The delay is in seconds or can be passed
|
|
430
|
+
* as a string with a time unit (e.g. "1h", "30m", "15s").
|
|
422
431
|
* @returns workflow run id
|
|
423
432
|
*/
|
|
424
|
-
trigger({ url, body, headers, workflowRunId, retries, flowControl, }: {
|
|
433
|
+
trigger({ url, body, headers, workflowRunId, retries, flowControl, delay, }: {
|
|
425
434
|
url: string;
|
|
426
435
|
body?: unknown;
|
|
427
436
|
headers?: Record<string, string>;
|
|
428
437
|
workflowRunId?: string;
|
|
429
438
|
retries?: number;
|
|
430
439
|
flowControl?: FlowControl;
|
|
440
|
+
delay?: PublishRequest["delay"];
|
|
431
441
|
}): Promise<{
|
|
432
442
|
workflowRunId: string;
|
|
433
443
|
}>;
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { R as RouteFunction, W as WorkflowServeOptions, E as ExclusiveValidationOptions, T as Telemetry, S as StepType, a as RawStep, N as NotifyResponse, b as Waiter, c as Step } from './types-
|
|
2
|
-
export { A as AsyncStepFunction, C as CallResponse, r as CallSettings, D as Duration, l as FailureFunctionPayload, F as FinishCondition, H as HeaderParams, t as InvokableWorkflow, s as InvokeStepResponse, I as InvokeWorkflowRequest, L as LazyInvokeStepParams, u as LogLevel, p as NotifyStepResponse, P as ParallelCallState, k as PublicServeOptions, m as RequiredExceptFields, j as StepFunction, h as StepTypes, i as SyncStepFunction, q as WaitEventOptions, n as WaitRequest, o as WaitStepResponse, f as WorkflowClient, e as WorkflowContext, w as WorkflowLogger, v as WorkflowLoggerOptions, g as WorkflowReceiver, d as WorkflowTool } from './types-
|
|
3
|
-
import { HTTPMethods, State, FlowControl, Client as Client$1, QstashError } from '@upstash/qstash';
|
|
1
|
+
import { R as RouteFunction, W as WorkflowServeOptions, E as ExclusiveValidationOptions, T as Telemetry, S as StepType, a as RawStep, N as NotifyResponse, b as Waiter, c as Step } from './types-C1WIgVLA.js';
|
|
2
|
+
export { A as AsyncStepFunction, C as CallResponse, r as CallSettings, D as Duration, l as FailureFunctionPayload, F as FinishCondition, H as HeaderParams, t as InvokableWorkflow, s as InvokeStepResponse, I as InvokeWorkflowRequest, L as LazyInvokeStepParams, u as LogLevel, p as NotifyStepResponse, P as ParallelCallState, k as PublicServeOptions, m as RequiredExceptFields, j as StepFunction, h as StepTypes, i as SyncStepFunction, q as WaitEventOptions, n as WaitRequest, o as WaitStepResponse, f as WorkflowClient, e as WorkflowContext, w as WorkflowLogger, v as WorkflowLoggerOptions, g as WorkflowReceiver, d as WorkflowTool } from './types-C1WIgVLA.js';
|
|
3
|
+
import { HTTPMethods, State, FlowControl, PublishRequest, Client as Client$1, QstashError } from '@upstash/qstash';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import 'ai';
|
|
6
6
|
import '@ai-sdk/openai';
|
|
@@ -154,7 +154,11 @@ type WaitEventGroup = {
|
|
|
154
154
|
type AsOptional<TType> = TType | {
|
|
155
155
|
[P in keyof TType]?: never;
|
|
156
156
|
};
|
|
157
|
-
type StepLog = BaseStepLog & AsOptional<CallUrlGroup> & AsOptional<CallResponseStatusGroup> & AsOptional<InvokedWorkflowGroup> & AsOptional<
|
|
157
|
+
type StepLog = BaseStepLog & AsOptional<CallUrlGroup> & AsOptional<CallResponseStatusGroup> & AsOptional<InvokedWorkflowGroup> & AsOptional<{
|
|
158
|
+
sleepFor: number;
|
|
159
|
+
}> & AsOptional<{
|
|
160
|
+
sleepUntil: number;
|
|
161
|
+
}> & AsOptional<WaitEventGroup>;
|
|
158
162
|
type StepLogGroup = {
|
|
159
163
|
/**
|
|
160
164
|
* Log which belongs to a single step
|
|
@@ -179,7 +183,7 @@ type StepLogGroup = {
|
|
|
179
183
|
*/
|
|
180
184
|
steps: {
|
|
181
185
|
messageId: string;
|
|
182
|
-
state: "STEP_PROGRESS" | "STEP_RETRY" | "STEP_FAILED";
|
|
186
|
+
state: "STEP_PROGRESS" | "STEP_RETRY" | "STEP_FAILED" | "STEP_CANCELED";
|
|
183
187
|
}[];
|
|
184
188
|
/**
|
|
185
189
|
* Log which belongs to the next step
|
|
@@ -419,15 +423,21 @@ declare class Client {
|
|
|
419
423
|
* with `wfr_`.
|
|
420
424
|
* @param retries retry to use in the initial request. in the rest of
|
|
421
425
|
* the workflow, `retries` option of the `serve` will be used.
|
|
426
|
+
* @param flowControl Settings for controlling the number of active requests
|
|
427
|
+
* and number of requests per second with the same key.
|
|
428
|
+
* @param delay Delay for the workflow run. This is used to delay the
|
|
429
|
+
* execution of the workflow run. The delay is in seconds or can be passed
|
|
430
|
+
* as a string with a time unit (e.g. "1h", "30m", "15s").
|
|
422
431
|
* @returns workflow run id
|
|
423
432
|
*/
|
|
424
|
-
trigger({ url, body, headers, workflowRunId, retries, flowControl, }: {
|
|
433
|
+
trigger({ url, body, headers, workflowRunId, retries, flowControl, delay, }: {
|
|
425
434
|
url: string;
|
|
426
435
|
body?: unknown;
|
|
427
436
|
headers?: Record<string, string>;
|
|
428
437
|
workflowRunId?: string;
|
|
429
438
|
retries?: number;
|
|
430
439
|
flowControl?: FlowControl;
|
|
440
|
+
delay?: PublishRequest["delay"];
|
|
431
441
|
}): Promise<{
|
|
432
442
|
workflowRunId: string;
|
|
433
443
|
}>;
|