@workers-community/workers-types 4.20260426.1 → 4.20260430.1
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/index.d.ts +16 -4
- package/index.ts +16 -4
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -2425,7 +2425,7 @@ interface R2ListOptions {
|
|
|
2425
2425
|
startAfter?: string;
|
|
2426
2426
|
include?: ("httpMetadata" | "customMetadata")[];
|
|
2427
2427
|
}
|
|
2428
|
-
|
|
2428
|
+
interface R2Bucket {
|
|
2429
2429
|
head(key: string): Promise<R2Object | null>;
|
|
2430
2430
|
get(
|
|
2431
2431
|
key: string,
|
|
@@ -13658,16 +13658,28 @@ declare namespace CloudflareWorkersModule {
|
|
|
13658
13658
|
attempt: number;
|
|
13659
13659
|
config: WorkflowStepConfig;
|
|
13660
13660
|
};
|
|
13661
|
+
export interface RollbackContext<T> {
|
|
13662
|
+
error: Error;
|
|
13663
|
+
output: NonNullable<T> | undefined;
|
|
13664
|
+
stepName: string;
|
|
13665
|
+
}
|
|
13666
|
+
export interface StepPromise<T> extends Promise<T> {
|
|
13667
|
+
rollback(fn: (ctx: RollbackContext<T>) => Promise<void>): StepPromise<T>;
|
|
13668
|
+
rollback(
|
|
13669
|
+
config: WorkflowStepConfig,
|
|
13670
|
+
fn: (ctx: RollbackContext<T>) => Promise<void>,
|
|
13671
|
+
): StepPromise<T>;
|
|
13672
|
+
}
|
|
13661
13673
|
export abstract class WorkflowStep {
|
|
13662
13674
|
do<T extends Rpc.Serializable<T>>(
|
|
13663
13675
|
name: string,
|
|
13664
13676
|
callback: (ctx: WorkflowStepContext) => Promise<T>,
|
|
13665
|
-
):
|
|
13677
|
+
): StepPromise<T>;
|
|
13666
13678
|
do<T extends Rpc.Serializable<T>>(
|
|
13667
13679
|
name: string,
|
|
13668
13680
|
config: WorkflowStepConfig,
|
|
13669
13681
|
callback: (ctx: WorkflowStepContext) => Promise<T>,
|
|
13670
|
-
):
|
|
13682
|
+
): StepPromise<T>;
|
|
13671
13683
|
sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;
|
|
13672
13684
|
sleepUntil: (name: string, timestamp: Date | number) => Promise<void>;
|
|
13673
13685
|
waitForEvent<T extends Rpc.Serializable<T>>(
|
|
@@ -13676,7 +13688,7 @@ declare namespace CloudflareWorkersModule {
|
|
|
13676
13688
|
type: string;
|
|
13677
13689
|
timeout?: WorkflowTimeoutDuration | number;
|
|
13678
13690
|
},
|
|
13679
|
-
):
|
|
13691
|
+
): StepPromise<WorkflowStepEvent<T>>;
|
|
13680
13692
|
}
|
|
13681
13693
|
export type WorkflowInstanceStatus =
|
|
13682
13694
|
| "queued"
|
package/index.ts
CHANGED
|
@@ -2428,7 +2428,7 @@ export interface R2ListOptions {
|
|
|
2428
2428
|
startAfter?: string;
|
|
2429
2429
|
include?: ("httpMetadata" | "customMetadata")[];
|
|
2430
2430
|
}
|
|
2431
|
-
export
|
|
2431
|
+
export interface R2Bucket {
|
|
2432
2432
|
head(key: string): Promise<R2Object | null>;
|
|
2433
2433
|
get(
|
|
2434
2434
|
key: string,
|
|
@@ -13629,16 +13629,28 @@ export declare namespace CloudflareWorkersModule {
|
|
|
13629
13629
|
attempt: number;
|
|
13630
13630
|
config: WorkflowStepConfig;
|
|
13631
13631
|
};
|
|
13632
|
+
export interface RollbackContext<T> {
|
|
13633
|
+
error: Error;
|
|
13634
|
+
output: NonNullable<T> | undefined;
|
|
13635
|
+
stepName: string;
|
|
13636
|
+
}
|
|
13637
|
+
export interface StepPromise<T> extends Promise<T> {
|
|
13638
|
+
rollback(fn: (ctx: RollbackContext<T>) => Promise<void>): StepPromise<T>;
|
|
13639
|
+
rollback(
|
|
13640
|
+
config: WorkflowStepConfig,
|
|
13641
|
+
fn: (ctx: RollbackContext<T>) => Promise<void>,
|
|
13642
|
+
): StepPromise<T>;
|
|
13643
|
+
}
|
|
13632
13644
|
export abstract class WorkflowStep {
|
|
13633
13645
|
do<T extends Rpc.Serializable<T>>(
|
|
13634
13646
|
name: string,
|
|
13635
13647
|
callback: (ctx: WorkflowStepContext) => Promise<T>,
|
|
13636
|
-
):
|
|
13648
|
+
): StepPromise<T>;
|
|
13637
13649
|
do<T extends Rpc.Serializable<T>>(
|
|
13638
13650
|
name: string,
|
|
13639
13651
|
config: WorkflowStepConfig,
|
|
13640
13652
|
callback: (ctx: WorkflowStepContext) => Promise<T>,
|
|
13641
|
-
):
|
|
13653
|
+
): StepPromise<T>;
|
|
13642
13654
|
sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;
|
|
13643
13655
|
sleepUntil: (name: string, timestamp: Date | number) => Promise<void>;
|
|
13644
13656
|
waitForEvent<T extends Rpc.Serializable<T>>(
|
|
@@ -13647,7 +13659,7 @@ export declare namespace CloudflareWorkersModule {
|
|
|
13647
13659
|
type: string;
|
|
13648
13660
|
timeout?: WorkflowTimeoutDuration | number;
|
|
13649
13661
|
},
|
|
13650
|
-
):
|
|
13662
|
+
): StepPromise<WorkflowStepEvent<T>>;
|
|
13651
13663
|
}
|
|
13652
13664
|
export type WorkflowInstanceStatus =
|
|
13653
13665
|
| "queued"
|