@upstash/workflow 0.2.21 → 0.2.22

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.
@@ -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];
@@ -1223,6 +1231,9 @@ type DetailedFinishCondition = {
1223
1231
  } | {
1224
1232
  condition: "non-retryable-error";
1225
1233
  result: WorkflowNonRetryableError;
1234
+ } | {
1235
+ condition: "retry-after-error";
1236
+ result: WorkflowRetryAfterError;
1226
1237
  } | {
1227
1238
  condition: "failure-callback";
1228
1239
  result: string | void;
@@ -1628,4 +1639,4 @@ type InvokableWorkflow<TInitialPayload, TResult> = {
1628
1639
  workflowId?: string;
1629
1640
  };
1630
1641
 
1631
- export { type AsyncStepFunction as A, type WorkflowLoggerOptions as B, type CallResponse as C, type DetailedFinishCondition as D, type ExclusiveValidationOptions as E, type FinishCondition as F, WorkflowLogger as G, type HeaderParams as H, type InvokeWorkflowRequest as I, 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, WorkflowTool as f, WorkflowContext as g, type WorkflowClient as h, type WorkflowReceiver as i, StepTypes as j, type Step as k, type SyncStepFunction as l, type StepFunction as m, type PublicServeOptions as n, type FailureFunctionPayload as o, type RequiredExceptFields as p, type WaitRequest as q, type WaitStepResponse as r, type NotifyStepResponse as s, type Duration as t, type WaitEventOptions as u, type StringifyBody as v, type CallSettings as w, type InvokeStepResponse as x, type InvokableWorkflow as y, type LogLevel as z };
1642
+ 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];
@@ -1223,6 +1231,9 @@ type DetailedFinishCondition = {
1223
1231
  } | {
1224
1232
  condition: "non-retryable-error";
1225
1233
  result: WorkflowNonRetryableError;
1234
+ } | {
1235
+ condition: "retry-after-error";
1236
+ result: WorkflowRetryAfterError;
1226
1237
  } | {
1227
1238
  condition: "failure-callback";
1228
1239
  result: string | void;
@@ -1628,4 +1639,4 @@ type InvokableWorkflow<TInitialPayload, TResult> = {
1628
1639
  workflowId?: string;
1629
1640
  };
1630
1641
 
1631
- export { type AsyncStepFunction as A, type WorkflowLoggerOptions as B, type CallResponse as C, type DetailedFinishCondition as D, type ExclusiveValidationOptions as E, type FinishCondition as F, WorkflowLogger as G, type HeaderParams as H, type InvokeWorkflowRequest as I, 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, WorkflowTool as f, WorkflowContext as g, type WorkflowClient as h, type WorkflowReceiver as i, StepTypes as j, type Step as k, type SyncStepFunction as l, type StepFunction as m, type PublicServeOptions as n, type FailureFunctionPayload as o, type RequiredExceptFields as p, type WaitRequest as q, type WaitStepResponse as r, type NotifyStepResponse as s, type Duration as t, type WaitEventOptions as u, type StringifyBody as v, type CallSettings as w, type InvokeStepResponse as x, type InvokableWorkflow as y, type LogLevel as z };
1642
+ 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 };