@workers-community/workers-types 4.20250529.0 → 4.20250601.0

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.
Files changed (3) hide show
  1. package/index.d.ts +21 -0
  2. package/index.ts +20 -0
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -6209,6 +6209,7 @@ declare module "cloudflare:workers" {
6209
6209
  | number;
6210
6210
  export type WorkflowDelayDuration = WorkflowSleepDuration;
6211
6211
  export type WorkflowTimeoutDuration = WorkflowSleepDuration;
6212
+ export type WorkflowRetentionDuration = WorkflowSleepDuration;
6212
6213
  export type WorkflowBackoff = "constant" | "linear" | "exponential";
6213
6214
  export type WorkflowStepConfig = {
6214
6215
  retries?: {
@@ -6823,6 +6824,18 @@ declare abstract class Workflow<PARAMS = unknown> {
6823
6824
  batch: WorkflowInstanceCreateOptions<PARAMS>[],
6824
6825
  ): Promise<WorkflowInstance[]>;
6825
6826
  }
6827
+ type WorkflowDurationLabel =
6828
+ | "second"
6829
+ | "minute"
6830
+ | "hour"
6831
+ | "day"
6832
+ | "week"
6833
+ | "month"
6834
+ | "year";
6835
+ type WorkflowSleepDuration =
6836
+ | `${number} ${WorkflowDurationLabel}${"s" | ""}`
6837
+ | number;
6838
+ type WorkflowRetentionDuration = WorkflowSleepDuration;
6826
6839
  interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6827
6840
  /**
6828
6841
  * An id for your Workflow instance. Must be unique within the Workflow.
@@ -6832,6 +6845,14 @@ interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6832
6845
  * The event payload the Workflow instance is triggered with
6833
6846
  */
6834
6847
  params?: PARAMS;
6848
+ /**
6849
+ * The retention policy for Workflow instance.
6850
+ * Defaults to the maximum retention period available for the owner's account.
6851
+ */
6852
+ retention?: {
6853
+ successRetention?: WorkflowRetentionDuration;
6854
+ errorRetention?: WorkflowRetentionDuration;
6855
+ };
6835
6856
  }
6836
6857
  type InstanceStatus = {
6837
6858
  status:
package/index.ts CHANGED
@@ -6678,6 +6678,18 @@ export declare abstract class Workflow<PARAMS = unknown> {
6678
6678
  batch: WorkflowInstanceCreateOptions<PARAMS>[],
6679
6679
  ): Promise<WorkflowInstance[]>;
6680
6680
  }
6681
+ export type WorkflowDurationLabel =
6682
+ | "second"
6683
+ | "minute"
6684
+ | "hour"
6685
+ | "day"
6686
+ | "week"
6687
+ | "month"
6688
+ | "year";
6689
+ export type WorkflowSleepDuration =
6690
+ | `${number} ${WorkflowDurationLabel}${"s" | ""}`
6691
+ | number;
6692
+ export type WorkflowRetentionDuration = WorkflowSleepDuration;
6681
6693
  export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6682
6694
  /**
6683
6695
  * An id for your Workflow instance. Must be unique within the Workflow.
@@ -6687,6 +6699,14 @@ export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6687
6699
  * The event payload the Workflow instance is triggered with
6688
6700
  */
6689
6701
  params?: PARAMS;
6702
+ /**
6703
+ * The retention policy for Workflow instance.
6704
+ * Defaults to the maximum retention period available for the owner's account.
6705
+ */
6706
+ retention?: {
6707
+ successRetention?: WorkflowRetentionDuration;
6708
+ errorRetention?: WorkflowRetentionDuration;
6709
+ };
6690
6710
  }
6691
6711
  export type InstanceStatus = {
6692
6712
  status:
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "author": "Workers Community",
9
9
  "license": "MIT OR Apache-2.0",
10
- "version": "4.20250529.0",
10
+ "version": "4.20250601.0",
11
11
  "exports": {
12
12
  ".": {
13
13
  "types": "./index.d.ts",