@upstash/workflow 0.2.22-rc → 0.2.23-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 +2 -2
- package/astro.d.ts +2 -2
- package/astro.js +302 -130
- package/astro.mjs +1 -1
- package/{chunk-CAQSUCHB.mjs → chunk-KAGTWBLF.mjs} +271 -100
- package/cloudflare.d.mts +2 -2
- package/cloudflare.d.ts +2 -2
- package/cloudflare.js +302 -130
- package/cloudflare.mjs +1 -1
- package/express.d.mts +2 -2
- package/express.d.ts +2 -2
- package/express.js +304 -131
- package/express.mjs +3 -2
- package/h3.d.mts +2 -2
- package/h3.d.ts +2 -2
- package/h3.js +302 -130
- package/h3.mjs +1 -1
- package/hono.d.mts +2 -2
- package/hono.d.ts +2 -2
- package/hono.js +302 -130
- package/hono.mjs +1 -1
- package/index.d.mts +10 -2
- package/index.d.ts +10 -2
- package/index.js +306 -132
- package/index.mjs +5 -3
- package/nextjs.d.mts +2 -2
- package/nextjs.d.ts +2 -2
- package/nextjs.js +304 -131
- package/nextjs.mjs +3 -2
- package/package.json +1 -1
- package/{serve-many-BNusWYgt.d.mts → serve-many-B5Vbacm6.d.mts} +1 -1
- package/{serve-many-CXqQP3RI.d.ts → serve-many-BCV7INWe.d.ts} +1 -1
- package/solidjs.d.mts +1 -1
- package/solidjs.d.ts +1 -1
- package/solidjs.js +302 -130
- package/solidjs.mjs +1 -1
- package/svelte.d.mts +2 -2
- package/svelte.d.ts +2 -2
- package/svelte.js +302 -130
- package/svelte.mjs +1 -1
- package/tanstack.d.mts +2 -2
- package/tanstack.d.ts +2 -2
- package/tanstack.js +302 -130
- package/tanstack.mjs +1 -1
- package/{types-Q3dM0UlR.d.ts → types-BD06btU6.d.mts} +32 -6
- package/{types-Q3dM0UlR.d.mts → types-BD06btU6.d.ts} +32 -6
package/tanstack.mjs
CHANGED
|
@@ -38,6 +38,14 @@ declare class WorkflowNonRetryableError extends WorkflowAbort {
|
|
|
38
38
|
*/
|
|
39
39
|
constructor(message?: string);
|
|
40
40
|
}
|
|
41
|
+
declare class WorkflowRetryAfterError extends WorkflowAbort {
|
|
42
|
+
retryAfter: number | Duration;
|
|
43
|
+
/**
|
|
44
|
+
* @param retryAfter time in seconds after which the workflow should be retried
|
|
45
|
+
* @param message error message to be displayed
|
|
46
|
+
*/
|
|
47
|
+
constructor(message: string, retryAfter: number | Duration);
|
|
48
|
+
}
|
|
41
49
|
|
|
42
50
|
declare const LOG_LEVELS: readonly ["DEBUG", "INFO", "SUBMIT", "WARN", "ERROR"];
|
|
43
51
|
type LogLevel = (typeof LOG_LEVELS)[number];
|
|
@@ -89,7 +97,8 @@ declare abstract class BaseLazyStep<TResult = unknown> {
|
|
|
89
97
|
readonly stepName: string;
|
|
90
98
|
abstract readonly stepType: StepType;
|
|
91
99
|
protected abstract readonly allowUndefinedOut: boolean;
|
|
92
|
-
|
|
100
|
+
protected readonly context: WorkflowContext;
|
|
101
|
+
constructor(context: WorkflowContext, stepName: string);
|
|
93
102
|
/**
|
|
94
103
|
* plan step to submit when step will run parallel with other
|
|
95
104
|
* steps (parallel call state `first`)
|
|
@@ -112,11 +121,12 @@ declare abstract class BaseLazyStep<TResult = unknown> {
|
|
|
112
121
|
*
|
|
113
122
|
* will be called when returning the steps to the context from auto executor
|
|
114
123
|
*
|
|
115
|
-
* @param
|
|
124
|
+
* @param step step
|
|
116
125
|
* @returns parsed out field
|
|
117
126
|
*/
|
|
118
|
-
parseOut(
|
|
119
|
-
protected safeParseOut(out: string): TResult;
|
|
127
|
+
parseOut(step: Step): TResult;
|
|
128
|
+
protected safeParseOut(out: string, step: Step): TResult;
|
|
129
|
+
protected handleUndefinedOut(step: Step): TResult;
|
|
120
130
|
protected static tryParsing(stepOut: unknown): any;
|
|
121
131
|
getBody({ step }: GetBodyParams): string;
|
|
122
132
|
getHeaders({ context, telemetry, invokeCount, step }: GetHeaderParams): HeadersResponse;
|
|
@@ -124,6 +134,17 @@ declare abstract class BaseLazyStep<TResult = unknown> {
|
|
|
124
134
|
messageId: string;
|
|
125
135
|
}[]>;
|
|
126
136
|
}
|
|
137
|
+
type Webhook = {
|
|
138
|
+
webhookUrl: string;
|
|
139
|
+
eventId: string;
|
|
140
|
+
};
|
|
141
|
+
type WaitForWebhookResponse = {
|
|
142
|
+
timeout: false;
|
|
143
|
+
request: Request;
|
|
144
|
+
} | {
|
|
145
|
+
timeout: true;
|
|
146
|
+
request: undefined;
|
|
147
|
+
};
|
|
127
148
|
|
|
128
149
|
declare class AutoExecutor {
|
|
129
150
|
private context;
|
|
@@ -1096,6 +1117,8 @@ declare class WorkflowContext<TInitialPayload = unknown> {
|
|
|
1096
1117
|
*/
|
|
1097
1118
|
notify(stepName: string, eventId: string, eventData: unknown): Promise<NotifyStepResponse>;
|
|
1098
1119
|
invoke<TInitialPayload, TResult>(stepName: string, settings: LazyInvokeStepParams<TInitialPayload, TResult>): Promise<InvokeStepResponse<TResult>>;
|
|
1120
|
+
createWebhook(stepName: string): Promise<Webhook>;
|
|
1121
|
+
waitForWebhook(stepName: string, webhook: Webhook, timeout: Duration): Promise<WaitForWebhookResponse>;
|
|
1099
1122
|
/**
|
|
1100
1123
|
* Cancel the current workflow run
|
|
1101
1124
|
*
|
|
@@ -1132,7 +1155,7 @@ type WorkflowClient = {
|
|
|
1132
1155
|
type WorkflowReceiver = {
|
|
1133
1156
|
verify: InstanceType<typeof Receiver>["verify"];
|
|
1134
1157
|
};
|
|
1135
|
-
declare const StepTypes: readonly ["Initial", "Run", "SleepFor", "SleepUntil", "Call", "Wait", "Notify", "Invoke"];
|
|
1158
|
+
declare const StepTypes: readonly ["Initial", "Run", "SleepFor", "SleepUntil", "Call", "Wait", "Notify", "Invoke", "CreateWebhook", "WaitForWebhook"];
|
|
1136
1159
|
type StepType = (typeof StepTypes)[number];
|
|
1137
1160
|
type ThirdPartyCallFields<TBody = unknown> = {
|
|
1138
1161
|
/**
|
|
@@ -1223,6 +1246,9 @@ type DetailedFinishCondition = {
|
|
|
1223
1246
|
} | {
|
|
1224
1247
|
condition: "non-retryable-error";
|
|
1225
1248
|
result: WorkflowNonRetryableError;
|
|
1249
|
+
} | {
|
|
1250
|
+
condition: "retry-after-error";
|
|
1251
|
+
result: WorkflowRetryAfterError;
|
|
1226
1252
|
} | {
|
|
1227
1253
|
condition: "failure-callback";
|
|
1228
1254
|
result: string | void;
|
|
@@ -1628,4 +1654,4 @@ type InvokableWorkflow<TInitialPayload, TResult> = {
|
|
|
1628
1654
|
workflowId?: string;
|
|
1629
1655
|
};
|
|
1630
1656
|
|
|
1631
|
-
export { type AsyncStepFunction as A, type
|
|
1657
|
+
export { type AsyncStepFunction as A, type LogLevel as B, type CallResponse as C, type DetailedFinishCondition as D, type ExclusiveValidationOptions as E, type FinishCondition as F, type WorkflowLoggerOptions as G, type HeaderParams as H, type InvokeWorkflowRequest as I, WorkflowLogger as J, type LazyInvokeStepParams as L, type NotifyResponse as N, type ParallelCallState as P, type RouteFunction as R, type StepType as S, type Telemetry as T, type WorkflowServeOptions as W, type RawStep as a, type Waiter as b, WorkflowError as c, WorkflowAbort as d, WorkflowNonRetryableError as e, WorkflowRetryAfterError as f, WorkflowTool as g, WorkflowContext as h, type WorkflowClient as i, type WorkflowReceiver as j, StepTypes as k, type Step as l, type SyncStepFunction as m, type StepFunction as n, type PublicServeOptions as o, type FailureFunctionPayload as p, type RequiredExceptFields as q, type WaitRequest as r, type WaitStepResponse as s, type NotifyStepResponse as t, type Duration as u, type WaitEventOptions as v, type StringifyBody as w, type CallSettings as x, type InvokeStepResponse as y, type InvokableWorkflow as z };
|
|
@@ -38,6 +38,14 @@ declare class WorkflowNonRetryableError extends WorkflowAbort {
|
|
|
38
38
|
*/
|
|
39
39
|
constructor(message?: string);
|
|
40
40
|
}
|
|
41
|
+
declare class WorkflowRetryAfterError extends WorkflowAbort {
|
|
42
|
+
retryAfter: number | Duration;
|
|
43
|
+
/**
|
|
44
|
+
* @param retryAfter time in seconds after which the workflow should be retried
|
|
45
|
+
* @param message error message to be displayed
|
|
46
|
+
*/
|
|
47
|
+
constructor(message: string, retryAfter: number | Duration);
|
|
48
|
+
}
|
|
41
49
|
|
|
42
50
|
declare const LOG_LEVELS: readonly ["DEBUG", "INFO", "SUBMIT", "WARN", "ERROR"];
|
|
43
51
|
type LogLevel = (typeof LOG_LEVELS)[number];
|
|
@@ -89,7 +97,8 @@ declare abstract class BaseLazyStep<TResult = unknown> {
|
|
|
89
97
|
readonly stepName: string;
|
|
90
98
|
abstract readonly stepType: StepType;
|
|
91
99
|
protected abstract readonly allowUndefinedOut: boolean;
|
|
92
|
-
|
|
100
|
+
protected readonly context: WorkflowContext;
|
|
101
|
+
constructor(context: WorkflowContext, stepName: string);
|
|
93
102
|
/**
|
|
94
103
|
* plan step to submit when step will run parallel with other
|
|
95
104
|
* steps (parallel call state `first`)
|
|
@@ -112,11 +121,12 @@ declare abstract class BaseLazyStep<TResult = unknown> {
|
|
|
112
121
|
*
|
|
113
122
|
* will be called when returning the steps to the context from auto executor
|
|
114
123
|
*
|
|
115
|
-
* @param
|
|
124
|
+
* @param step step
|
|
116
125
|
* @returns parsed out field
|
|
117
126
|
*/
|
|
118
|
-
parseOut(
|
|
119
|
-
protected safeParseOut(out: string): TResult;
|
|
127
|
+
parseOut(step: Step): TResult;
|
|
128
|
+
protected safeParseOut(out: string, step: Step): TResult;
|
|
129
|
+
protected handleUndefinedOut(step: Step): TResult;
|
|
120
130
|
protected static tryParsing(stepOut: unknown): any;
|
|
121
131
|
getBody({ step }: GetBodyParams): string;
|
|
122
132
|
getHeaders({ context, telemetry, invokeCount, step }: GetHeaderParams): HeadersResponse;
|
|
@@ -124,6 +134,17 @@ declare abstract class BaseLazyStep<TResult = unknown> {
|
|
|
124
134
|
messageId: string;
|
|
125
135
|
}[]>;
|
|
126
136
|
}
|
|
137
|
+
type Webhook = {
|
|
138
|
+
webhookUrl: string;
|
|
139
|
+
eventId: string;
|
|
140
|
+
};
|
|
141
|
+
type WaitForWebhookResponse = {
|
|
142
|
+
timeout: false;
|
|
143
|
+
request: Request;
|
|
144
|
+
} | {
|
|
145
|
+
timeout: true;
|
|
146
|
+
request: undefined;
|
|
147
|
+
};
|
|
127
148
|
|
|
128
149
|
declare class AutoExecutor {
|
|
129
150
|
private context;
|
|
@@ -1096,6 +1117,8 @@ declare class WorkflowContext<TInitialPayload = unknown> {
|
|
|
1096
1117
|
*/
|
|
1097
1118
|
notify(stepName: string, eventId: string, eventData: unknown): Promise<NotifyStepResponse>;
|
|
1098
1119
|
invoke<TInitialPayload, TResult>(stepName: string, settings: LazyInvokeStepParams<TInitialPayload, TResult>): Promise<InvokeStepResponse<TResult>>;
|
|
1120
|
+
createWebhook(stepName: string): Promise<Webhook>;
|
|
1121
|
+
waitForWebhook(stepName: string, webhook: Webhook, timeout: Duration): Promise<WaitForWebhookResponse>;
|
|
1099
1122
|
/**
|
|
1100
1123
|
* Cancel the current workflow run
|
|
1101
1124
|
*
|
|
@@ -1132,7 +1155,7 @@ type WorkflowClient = {
|
|
|
1132
1155
|
type WorkflowReceiver = {
|
|
1133
1156
|
verify: InstanceType<typeof Receiver>["verify"];
|
|
1134
1157
|
};
|
|
1135
|
-
declare const StepTypes: readonly ["Initial", "Run", "SleepFor", "SleepUntil", "Call", "Wait", "Notify", "Invoke"];
|
|
1158
|
+
declare const StepTypes: readonly ["Initial", "Run", "SleepFor", "SleepUntil", "Call", "Wait", "Notify", "Invoke", "CreateWebhook", "WaitForWebhook"];
|
|
1136
1159
|
type StepType = (typeof StepTypes)[number];
|
|
1137
1160
|
type ThirdPartyCallFields<TBody = unknown> = {
|
|
1138
1161
|
/**
|
|
@@ -1223,6 +1246,9 @@ type DetailedFinishCondition = {
|
|
|
1223
1246
|
} | {
|
|
1224
1247
|
condition: "non-retryable-error";
|
|
1225
1248
|
result: WorkflowNonRetryableError;
|
|
1249
|
+
} | {
|
|
1250
|
+
condition: "retry-after-error";
|
|
1251
|
+
result: WorkflowRetryAfterError;
|
|
1226
1252
|
} | {
|
|
1227
1253
|
condition: "failure-callback";
|
|
1228
1254
|
result: string | void;
|
|
@@ -1628,4 +1654,4 @@ type InvokableWorkflow<TInitialPayload, TResult> = {
|
|
|
1628
1654
|
workflowId?: string;
|
|
1629
1655
|
};
|
|
1630
1656
|
|
|
1631
|
-
export { type AsyncStepFunction as A, type
|
|
1657
|
+
export { type AsyncStepFunction as A, type LogLevel as B, type CallResponse as C, type DetailedFinishCondition as D, type ExclusiveValidationOptions as E, type FinishCondition as F, type WorkflowLoggerOptions as G, type HeaderParams as H, type InvokeWorkflowRequest as I, WorkflowLogger as J, type LazyInvokeStepParams as L, type NotifyResponse as N, type ParallelCallState as P, type RouteFunction as R, type StepType as S, type Telemetry as T, type WorkflowServeOptions as W, type RawStep as a, type Waiter as b, WorkflowError as c, WorkflowAbort as d, WorkflowNonRetryableError as e, WorkflowRetryAfterError as f, WorkflowTool as g, WorkflowContext as h, type WorkflowClient as i, type WorkflowReceiver as j, StepTypes as k, type Step as l, type SyncStepFunction as m, type StepFunction as n, type PublicServeOptions as o, type FailureFunctionPayload as p, type RequiredExceptFields as q, type WaitRequest as r, type WaitStepResponse as s, type NotifyStepResponse as t, type Duration as u, type WaitEventOptions as v, type StringifyBody as w, type CallSettings as x, type InvokeStepResponse as y, type InvokableWorkflow as z };
|