@cloudflare/workers-types 4.20240909.0 → 4.20240919.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.
- package/2021-11-03/index.d.ts +84 -20
- package/2021-11-03/index.ts +73 -22
- package/2022-01-31/index.d.ts +84 -20
- package/2022-01-31/index.ts +73 -22
- package/2022-03-21/index.d.ts +84 -20
- package/2022-03-21/index.ts +73 -22
- package/2022-08-04/index.d.ts +84 -20
- package/2022-08-04/index.ts +73 -22
- package/2022-10-31/index.d.ts +84 -20
- package/2022-10-31/index.ts +73 -22
- package/2022-11-30/index.d.ts +84 -20
- package/2022-11-30/index.ts +73 -22
- package/2023-03-01/index.d.ts +84 -20
- package/2023-03-01/index.ts +73 -22
- package/2023-07-01/index.d.ts +84 -20
- package/2023-07-01/index.ts +73 -22
- package/experimental/index.d.ts +84 -19
- package/experimental/index.ts +73 -21
- package/index.d.ts +84 -20
- package/index.ts +73 -22
- package/oldest/index.d.ts +84 -20
- package/oldest/index.ts +73 -22
- package/package.json +1 -1
package/2023-03-01/index.d.ts
CHANGED
|
@@ -1548,7 +1548,11 @@ declare abstract class Body {
|
|
|
1548
1548
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
|
|
1549
1549
|
*/
|
|
1550
1550
|
declare class Response extends Body {
|
|
1551
|
-
constructor(
|
|
1551
|
+
constructor(
|
|
1552
|
+
body?: BodyInit | null,
|
|
1553
|
+
init?: ResponseInit,
|
|
1554
|
+
webSocket?: WebSocket,
|
|
1555
|
+
);
|
|
1552
1556
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirect_static) */
|
|
1553
1557
|
static redirect(url: string, status?: number): Response;
|
|
1554
1558
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/json_static) */
|
|
@@ -1575,7 +1579,7 @@ interface ResponseInit {
|
|
|
1575
1579
|
statusText?: string;
|
|
1576
1580
|
headers?: HeadersInit;
|
|
1577
1581
|
cf?: any;
|
|
1578
|
-
webSocket?: WebSocket
|
|
1582
|
+
webSocket?: WebSocket;
|
|
1579
1583
|
encodeBody?: "automatic" | "manual";
|
|
1580
1584
|
}
|
|
1581
1585
|
type RequestInfo<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> =
|
|
@@ -2283,15 +2287,15 @@ declare class TransformStream<I = any, O = any> {
|
|
|
2283
2287
|
}
|
|
2284
2288
|
declare class FixedLengthStream extends IdentityTransformStream {
|
|
2285
2289
|
constructor(
|
|
2286
|
-
|
|
2287
|
-
|
|
2290
|
+
expectedLength: number | bigint,
|
|
2291
|
+
queuingStrategy?: IdentityTransformStreamQueuingStrategy,
|
|
2288
2292
|
);
|
|
2289
2293
|
}
|
|
2290
2294
|
declare class IdentityTransformStream extends TransformStream<
|
|
2291
2295
|
ArrayBuffer | ArrayBufferView,
|
|
2292
2296
|
Uint8Array
|
|
2293
2297
|
> {
|
|
2294
|
-
constructor(
|
|
2298
|
+
constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy);
|
|
2295
2299
|
}
|
|
2296
2300
|
interface IdentityTransformStreamQueuingStrategy {
|
|
2297
2301
|
highWaterMark?: number | bigint;
|
|
@@ -2769,21 +2773,24 @@ declare const WebSocketPair: {
|
|
|
2769
2773
|
};
|
|
2770
2774
|
};
|
|
2771
2775
|
interface SqlStorage {
|
|
2772
|
-
exec
|
|
2773
|
-
|
|
2776
|
+
exec<T extends Record<string, SqlStorageValue>>(
|
|
2777
|
+
query: string,
|
|
2778
|
+
...bindings: any[]
|
|
2779
|
+
): SqlStorageCursor<T>;
|
|
2774
2780
|
get databaseSize(): number;
|
|
2775
2781
|
Cursor: typeof SqlStorageCursor;
|
|
2776
2782
|
Statement: typeof SqlStorageStatement;
|
|
2777
2783
|
}
|
|
2778
2784
|
declare abstract class SqlStorageStatement {}
|
|
2779
|
-
|
|
2780
|
-
|
|
2785
|
+
type SqlStorageValue = ArrayBuffer | string | number | null;
|
|
2786
|
+
declare abstract class SqlStorageCursor<
|
|
2787
|
+
T extends Record<string, SqlStorageValue>,
|
|
2788
|
+
> {
|
|
2789
|
+
raw<U extends SqlStorageValue[]>(): IterableIterator<U>;
|
|
2781
2790
|
get columnNames(): string[];
|
|
2782
2791
|
get rowsRead(): number;
|
|
2783
2792
|
get rowsWritten(): number;
|
|
2784
|
-
[Symbol.iterator](): IterableIterator<
|
|
2785
|
-
Record<string, (ArrayBuffer | string | number) | null>
|
|
2786
|
-
>;
|
|
2793
|
+
[Symbol.iterator](): IterableIterator<T>;
|
|
2787
2794
|
}
|
|
2788
2795
|
interface Socket {
|
|
2789
2796
|
get readable(): ReadableStream;
|
|
@@ -3322,7 +3329,7 @@ interface GPUOrigin3DDict {
|
|
|
3322
3329
|
z?: number;
|
|
3323
3330
|
}
|
|
3324
3331
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource) */
|
|
3325
|
-
declare class EventSource {
|
|
3332
|
+
declare class EventSource extends EventTarget {
|
|
3326
3333
|
constructor(url: string, init?: EventSourceEventSourceInit);
|
|
3327
3334
|
/**
|
|
3328
3335
|
* Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
|
|
@@ -5587,12 +5594,69 @@ interface DispatchNamespace {
|
|
|
5587
5594
|
): Fetcher;
|
|
5588
5595
|
}
|
|
5589
5596
|
/**
|
|
5590
|
-
* NonRetryableError allows for a
|
|
5591
|
-
*
|
|
5597
|
+
* NonRetryableError allows for a user to throw a fatal error
|
|
5598
|
+
* that makes a Workflow instance fail immediately without triggering a retry
|
|
5592
5599
|
*/
|
|
5593
|
-
declare
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5600
|
+
declare module "cloudflare:workflows" {
|
|
5601
|
+
export abstract class NonRetryableError extends Error {
|
|
5602
|
+
/**
|
|
5603
|
+
* `__brand` is used to differentiate between `NonRetryableError` and `Error`
|
|
5604
|
+
* and is omitted from the constructor because users should not set it
|
|
5605
|
+
*/
|
|
5606
|
+
public constructor(message: string, name?: string);
|
|
5607
|
+
}
|
|
5608
|
+
}
|
|
5609
|
+
declare abstract class Workflow {
|
|
5610
|
+
/**
|
|
5611
|
+
* Get a handle to an existing instance of the Workflow.
|
|
5612
|
+
* @param id Id for the instance of this Workflow
|
|
5613
|
+
* @returns A promise that resolves with a handle for the Instance
|
|
5614
|
+
*/
|
|
5615
|
+
public get(id: string): Promise<Instance>;
|
|
5616
|
+
/**
|
|
5617
|
+
* Create a new instance and return a handle to it. If a provided id exists, an error will be thrown.
|
|
5618
|
+
* @param id Id to create the instance of this Workflow with
|
|
5619
|
+
* @param params The payload to send over to this instance
|
|
5620
|
+
* @returns A promise that resolves with a handle for the Instance
|
|
5621
|
+
*/
|
|
5622
|
+
public create(id: string, params: object): Promise<Instance>;
|
|
5623
|
+
}
|
|
5624
|
+
type InstanceStatus = {
|
|
5625
|
+
status:
|
|
5626
|
+
| "queued"
|
|
5627
|
+
| "running"
|
|
5628
|
+
| "paused"
|
|
5629
|
+
| "errored"
|
|
5630
|
+
| "terminated"
|
|
5631
|
+
| "complete"
|
|
5632
|
+
| "unknown";
|
|
5633
|
+
error?: string;
|
|
5634
|
+
output?: object;
|
|
5635
|
+
};
|
|
5636
|
+
interface WorkflowError {
|
|
5637
|
+
code?: number;
|
|
5638
|
+
message: string;
|
|
5639
|
+
}
|
|
5640
|
+
declare abstract class Instance {
|
|
5641
|
+
public id: string;
|
|
5642
|
+
/**
|
|
5643
|
+
* Pause the instance.
|
|
5644
|
+
*/
|
|
5645
|
+
public pause(): Promise<void>;
|
|
5646
|
+
/**
|
|
5647
|
+
* Resume the instance. If it is already running, an error will be thrown.
|
|
5648
|
+
*/
|
|
5649
|
+
public resume(): Promise<void>;
|
|
5650
|
+
/**
|
|
5651
|
+
* Abort the instance. If it is errored, terminated or complete, an error will be thrown.
|
|
5652
|
+
*/
|
|
5653
|
+
public abort(): Promise<void>;
|
|
5654
|
+
/**
|
|
5655
|
+
* Restart the instance.
|
|
5656
|
+
*/
|
|
5657
|
+
public restart(): Promise<void>;
|
|
5658
|
+
/**
|
|
5659
|
+
* Returns the current status of the instance.
|
|
5660
|
+
*/
|
|
5661
|
+
public status(): Promise<InstanceStatus>;
|
|
5598
5662
|
}
|
package/2023-03-01/index.ts
CHANGED
|
@@ -1553,7 +1553,11 @@ export declare abstract class Body {
|
|
|
1553
1553
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
|
|
1554
1554
|
*/
|
|
1555
1555
|
export declare class Response extends Body {
|
|
1556
|
-
constructor(
|
|
1556
|
+
constructor(
|
|
1557
|
+
body?: BodyInit | null,
|
|
1558
|
+
init?: ResponseInit,
|
|
1559
|
+
webSocket?: WebSocket,
|
|
1560
|
+
);
|
|
1557
1561
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirect_static) */
|
|
1558
1562
|
static redirect(url: string, status?: number): Response;
|
|
1559
1563
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/json_static) */
|
|
@@ -1580,7 +1584,7 @@ export interface ResponseInit {
|
|
|
1580
1584
|
statusText?: string;
|
|
1581
1585
|
headers?: HeadersInit;
|
|
1582
1586
|
cf?: any;
|
|
1583
|
-
webSocket?: WebSocket
|
|
1587
|
+
webSocket?: WebSocket;
|
|
1584
1588
|
encodeBody?: "automatic" | "manual";
|
|
1585
1589
|
}
|
|
1586
1590
|
export type RequestInfo<
|
|
@@ -2289,15 +2293,15 @@ export declare class TransformStream<I = any, O = any> {
|
|
|
2289
2293
|
}
|
|
2290
2294
|
export declare class FixedLengthStream extends IdentityTransformStream {
|
|
2291
2295
|
constructor(
|
|
2292
|
-
|
|
2293
|
-
|
|
2296
|
+
expectedLength: number | bigint,
|
|
2297
|
+
queuingStrategy?: IdentityTransformStreamQueuingStrategy,
|
|
2294
2298
|
);
|
|
2295
2299
|
}
|
|
2296
2300
|
export declare class IdentityTransformStream extends TransformStream<
|
|
2297
2301
|
ArrayBuffer | ArrayBufferView,
|
|
2298
2302
|
Uint8Array
|
|
2299
2303
|
> {
|
|
2300
|
-
constructor(
|
|
2304
|
+
constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy);
|
|
2301
2305
|
}
|
|
2302
2306
|
export interface IdentityTransformStreamQueuingStrategy {
|
|
2303
2307
|
highWaterMark?: number | bigint;
|
|
@@ -2778,21 +2782,24 @@ export declare const WebSocketPair: {
|
|
|
2778
2782
|
};
|
|
2779
2783
|
};
|
|
2780
2784
|
export interface SqlStorage {
|
|
2781
|
-
exec
|
|
2782
|
-
|
|
2785
|
+
exec<T extends Record<string, SqlStorageValue>>(
|
|
2786
|
+
query: string,
|
|
2787
|
+
...bindings: any[]
|
|
2788
|
+
): SqlStorageCursor<T>;
|
|
2783
2789
|
get databaseSize(): number;
|
|
2784
2790
|
Cursor: typeof SqlStorageCursor;
|
|
2785
2791
|
Statement: typeof SqlStorageStatement;
|
|
2786
2792
|
}
|
|
2787
2793
|
export declare abstract class SqlStorageStatement {}
|
|
2788
|
-
export
|
|
2789
|
-
|
|
2794
|
+
export type SqlStorageValue = ArrayBuffer | string | number | null;
|
|
2795
|
+
export declare abstract class SqlStorageCursor<
|
|
2796
|
+
T extends Record<string, SqlStorageValue>,
|
|
2797
|
+
> {
|
|
2798
|
+
raw<U extends SqlStorageValue[]>(): IterableIterator<U>;
|
|
2790
2799
|
get columnNames(): string[];
|
|
2791
2800
|
get rowsRead(): number;
|
|
2792
2801
|
get rowsWritten(): number;
|
|
2793
|
-
[Symbol.iterator](): IterableIterator<
|
|
2794
|
-
Record<string, (ArrayBuffer | string | number) | null>
|
|
2795
|
-
>;
|
|
2802
|
+
[Symbol.iterator](): IterableIterator<T>;
|
|
2796
2803
|
}
|
|
2797
2804
|
export interface Socket {
|
|
2798
2805
|
get readable(): ReadableStream;
|
|
@@ -3331,7 +3338,7 @@ export interface GPUOrigin3DDict {
|
|
|
3331
3338
|
z?: number;
|
|
3332
3339
|
}
|
|
3333
3340
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource) */
|
|
3334
|
-
export declare class EventSource {
|
|
3341
|
+
export declare class EventSource extends EventTarget {
|
|
3335
3342
|
constructor(url: string, init?: EventSourceEventSourceInit);
|
|
3336
3343
|
/**
|
|
3337
3344
|
* Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
|
|
@@ -5501,13 +5508,57 @@ export interface DispatchNamespace {
|
|
|
5501
5508
|
options?: DynamicDispatchOptions,
|
|
5502
5509
|
): Fetcher;
|
|
5503
5510
|
}
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
|
|
5511
|
+
export declare abstract class Workflow {
|
|
5512
|
+
/**
|
|
5513
|
+
* Get a handle to an existing instance of the Workflow.
|
|
5514
|
+
* @param id Id for the instance of this Workflow
|
|
5515
|
+
* @returns A promise that resolves with a handle for the Instance
|
|
5516
|
+
*/
|
|
5517
|
+
public get(id: string): Promise<Instance>;
|
|
5518
|
+
/**
|
|
5519
|
+
* Create a new instance and return a handle to it. If a provided id exists, an error will be thrown.
|
|
5520
|
+
* @param id Id to create the instance of this Workflow with
|
|
5521
|
+
* @param params The payload to send over to this instance
|
|
5522
|
+
* @returns A promise that resolves with a handle for the Instance
|
|
5523
|
+
*/
|
|
5524
|
+
public create(id: string, params: object): Promise<Instance>;
|
|
5525
|
+
}
|
|
5526
|
+
export type InstanceStatus = {
|
|
5527
|
+
status:
|
|
5528
|
+
| "queued"
|
|
5529
|
+
| "running"
|
|
5530
|
+
| "paused"
|
|
5531
|
+
| "errored"
|
|
5532
|
+
| "terminated"
|
|
5533
|
+
| "complete"
|
|
5534
|
+
| "unknown";
|
|
5535
|
+
error?: string;
|
|
5536
|
+
output?: object;
|
|
5537
|
+
};
|
|
5538
|
+
export interface WorkflowError {
|
|
5539
|
+
code?: number;
|
|
5540
|
+
message: string;
|
|
5541
|
+
}
|
|
5542
|
+
export declare abstract class Instance {
|
|
5543
|
+
public id: string;
|
|
5544
|
+
/**
|
|
5545
|
+
* Pause the instance.
|
|
5546
|
+
*/
|
|
5547
|
+
public pause(): Promise<void>;
|
|
5548
|
+
/**
|
|
5549
|
+
* Resume the instance. If it is already running, an error will be thrown.
|
|
5550
|
+
*/
|
|
5551
|
+
public resume(): Promise<void>;
|
|
5552
|
+
/**
|
|
5553
|
+
* Abort the instance. If it is errored, terminated or complete, an error will be thrown.
|
|
5554
|
+
*/
|
|
5555
|
+
public abort(): Promise<void>;
|
|
5556
|
+
/**
|
|
5557
|
+
* Restart the instance.
|
|
5558
|
+
*/
|
|
5559
|
+
public restart(): Promise<void>;
|
|
5560
|
+
/**
|
|
5561
|
+
* Returns the current status of the instance.
|
|
5562
|
+
*/
|
|
5563
|
+
public status(): Promise<InstanceStatus>;
|
|
5513
5564
|
}
|
package/2023-07-01/index.d.ts
CHANGED
|
@@ -1548,7 +1548,11 @@ declare abstract class Body {
|
|
|
1548
1548
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
|
|
1549
1549
|
*/
|
|
1550
1550
|
declare class Response extends Body {
|
|
1551
|
-
constructor(
|
|
1551
|
+
constructor(
|
|
1552
|
+
body?: BodyInit | null,
|
|
1553
|
+
init?: ResponseInit,
|
|
1554
|
+
webSocket?: WebSocket,
|
|
1555
|
+
);
|
|
1552
1556
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirect_static) */
|
|
1553
1557
|
static redirect(url: string, status?: number): Response;
|
|
1554
1558
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/json_static) */
|
|
@@ -1575,7 +1579,7 @@ interface ResponseInit {
|
|
|
1575
1579
|
statusText?: string;
|
|
1576
1580
|
headers?: HeadersInit;
|
|
1577
1581
|
cf?: any;
|
|
1578
|
-
webSocket?: WebSocket
|
|
1582
|
+
webSocket?: WebSocket;
|
|
1579
1583
|
encodeBody?: "automatic" | "manual";
|
|
1580
1584
|
}
|
|
1581
1585
|
type RequestInfo<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> =
|
|
@@ -2283,15 +2287,15 @@ declare class TransformStream<I = any, O = any> {
|
|
|
2283
2287
|
}
|
|
2284
2288
|
declare class FixedLengthStream extends IdentityTransformStream {
|
|
2285
2289
|
constructor(
|
|
2286
|
-
|
|
2287
|
-
|
|
2290
|
+
expectedLength: number | bigint,
|
|
2291
|
+
queuingStrategy?: IdentityTransformStreamQueuingStrategy,
|
|
2288
2292
|
);
|
|
2289
2293
|
}
|
|
2290
2294
|
declare class IdentityTransformStream extends TransformStream<
|
|
2291
2295
|
ArrayBuffer | ArrayBufferView,
|
|
2292
2296
|
Uint8Array
|
|
2293
2297
|
> {
|
|
2294
|
-
constructor(
|
|
2298
|
+
constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy);
|
|
2295
2299
|
}
|
|
2296
2300
|
interface IdentityTransformStreamQueuingStrategy {
|
|
2297
2301
|
highWaterMark?: number | bigint;
|
|
@@ -2769,21 +2773,24 @@ declare const WebSocketPair: {
|
|
|
2769
2773
|
};
|
|
2770
2774
|
};
|
|
2771
2775
|
interface SqlStorage {
|
|
2772
|
-
exec
|
|
2773
|
-
|
|
2776
|
+
exec<T extends Record<string, SqlStorageValue>>(
|
|
2777
|
+
query: string,
|
|
2778
|
+
...bindings: any[]
|
|
2779
|
+
): SqlStorageCursor<T>;
|
|
2774
2780
|
get databaseSize(): number;
|
|
2775
2781
|
Cursor: typeof SqlStorageCursor;
|
|
2776
2782
|
Statement: typeof SqlStorageStatement;
|
|
2777
2783
|
}
|
|
2778
2784
|
declare abstract class SqlStorageStatement {}
|
|
2779
|
-
|
|
2780
|
-
|
|
2785
|
+
type SqlStorageValue = ArrayBuffer | string | number | null;
|
|
2786
|
+
declare abstract class SqlStorageCursor<
|
|
2787
|
+
T extends Record<string, SqlStorageValue>,
|
|
2788
|
+
> {
|
|
2789
|
+
raw<U extends SqlStorageValue[]>(): IterableIterator<U>;
|
|
2781
2790
|
get columnNames(): string[];
|
|
2782
2791
|
get rowsRead(): number;
|
|
2783
2792
|
get rowsWritten(): number;
|
|
2784
|
-
[Symbol.iterator](): IterableIterator<
|
|
2785
|
-
Record<string, (ArrayBuffer | string | number) | null>
|
|
2786
|
-
>;
|
|
2793
|
+
[Symbol.iterator](): IterableIterator<T>;
|
|
2787
2794
|
}
|
|
2788
2795
|
interface Socket {
|
|
2789
2796
|
get readable(): ReadableStream;
|
|
@@ -3322,7 +3329,7 @@ interface GPUOrigin3DDict {
|
|
|
3322
3329
|
z?: number;
|
|
3323
3330
|
}
|
|
3324
3331
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource) */
|
|
3325
|
-
declare class EventSource {
|
|
3332
|
+
declare class EventSource extends EventTarget {
|
|
3326
3333
|
constructor(url: string, init?: EventSourceEventSourceInit);
|
|
3327
3334
|
/**
|
|
3328
3335
|
* Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
|
|
@@ -5587,12 +5594,69 @@ interface DispatchNamespace {
|
|
|
5587
5594
|
): Fetcher;
|
|
5588
5595
|
}
|
|
5589
5596
|
/**
|
|
5590
|
-
* NonRetryableError allows for a
|
|
5591
|
-
*
|
|
5597
|
+
* NonRetryableError allows for a user to throw a fatal error
|
|
5598
|
+
* that makes a Workflow instance fail immediately without triggering a retry
|
|
5592
5599
|
*/
|
|
5593
|
-
declare
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5600
|
+
declare module "cloudflare:workflows" {
|
|
5601
|
+
export abstract class NonRetryableError extends Error {
|
|
5602
|
+
/**
|
|
5603
|
+
* `__brand` is used to differentiate between `NonRetryableError` and `Error`
|
|
5604
|
+
* and is omitted from the constructor because users should not set it
|
|
5605
|
+
*/
|
|
5606
|
+
public constructor(message: string, name?: string);
|
|
5607
|
+
}
|
|
5608
|
+
}
|
|
5609
|
+
declare abstract class Workflow {
|
|
5610
|
+
/**
|
|
5611
|
+
* Get a handle to an existing instance of the Workflow.
|
|
5612
|
+
* @param id Id for the instance of this Workflow
|
|
5613
|
+
* @returns A promise that resolves with a handle for the Instance
|
|
5614
|
+
*/
|
|
5615
|
+
public get(id: string): Promise<Instance>;
|
|
5616
|
+
/**
|
|
5617
|
+
* Create a new instance and return a handle to it. If a provided id exists, an error will be thrown.
|
|
5618
|
+
* @param id Id to create the instance of this Workflow with
|
|
5619
|
+
* @param params The payload to send over to this instance
|
|
5620
|
+
* @returns A promise that resolves with a handle for the Instance
|
|
5621
|
+
*/
|
|
5622
|
+
public create(id: string, params: object): Promise<Instance>;
|
|
5623
|
+
}
|
|
5624
|
+
type InstanceStatus = {
|
|
5625
|
+
status:
|
|
5626
|
+
| "queued"
|
|
5627
|
+
| "running"
|
|
5628
|
+
| "paused"
|
|
5629
|
+
| "errored"
|
|
5630
|
+
| "terminated"
|
|
5631
|
+
| "complete"
|
|
5632
|
+
| "unknown";
|
|
5633
|
+
error?: string;
|
|
5634
|
+
output?: object;
|
|
5635
|
+
};
|
|
5636
|
+
interface WorkflowError {
|
|
5637
|
+
code?: number;
|
|
5638
|
+
message: string;
|
|
5639
|
+
}
|
|
5640
|
+
declare abstract class Instance {
|
|
5641
|
+
public id: string;
|
|
5642
|
+
/**
|
|
5643
|
+
* Pause the instance.
|
|
5644
|
+
*/
|
|
5645
|
+
public pause(): Promise<void>;
|
|
5646
|
+
/**
|
|
5647
|
+
* Resume the instance. If it is already running, an error will be thrown.
|
|
5648
|
+
*/
|
|
5649
|
+
public resume(): Promise<void>;
|
|
5650
|
+
/**
|
|
5651
|
+
* Abort the instance. If it is errored, terminated or complete, an error will be thrown.
|
|
5652
|
+
*/
|
|
5653
|
+
public abort(): Promise<void>;
|
|
5654
|
+
/**
|
|
5655
|
+
* Restart the instance.
|
|
5656
|
+
*/
|
|
5657
|
+
public restart(): Promise<void>;
|
|
5658
|
+
/**
|
|
5659
|
+
* Returns the current status of the instance.
|
|
5660
|
+
*/
|
|
5661
|
+
public status(): Promise<InstanceStatus>;
|
|
5598
5662
|
}
|
package/2023-07-01/index.ts
CHANGED
|
@@ -1553,7 +1553,11 @@ export declare abstract class Body {
|
|
|
1553
1553
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
|
|
1554
1554
|
*/
|
|
1555
1555
|
export declare class Response extends Body {
|
|
1556
|
-
constructor(
|
|
1556
|
+
constructor(
|
|
1557
|
+
body?: BodyInit | null,
|
|
1558
|
+
init?: ResponseInit,
|
|
1559
|
+
webSocket?: WebSocket,
|
|
1560
|
+
);
|
|
1557
1561
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirect_static) */
|
|
1558
1562
|
static redirect(url: string, status?: number): Response;
|
|
1559
1563
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/json_static) */
|
|
@@ -1580,7 +1584,7 @@ export interface ResponseInit {
|
|
|
1580
1584
|
statusText?: string;
|
|
1581
1585
|
headers?: HeadersInit;
|
|
1582
1586
|
cf?: any;
|
|
1583
|
-
webSocket?: WebSocket
|
|
1587
|
+
webSocket?: WebSocket;
|
|
1584
1588
|
encodeBody?: "automatic" | "manual";
|
|
1585
1589
|
}
|
|
1586
1590
|
export type RequestInfo<
|
|
@@ -2289,15 +2293,15 @@ export declare class TransformStream<I = any, O = any> {
|
|
|
2289
2293
|
}
|
|
2290
2294
|
export declare class FixedLengthStream extends IdentityTransformStream {
|
|
2291
2295
|
constructor(
|
|
2292
|
-
|
|
2293
|
-
|
|
2296
|
+
expectedLength: number | bigint,
|
|
2297
|
+
queuingStrategy?: IdentityTransformStreamQueuingStrategy,
|
|
2294
2298
|
);
|
|
2295
2299
|
}
|
|
2296
2300
|
export declare class IdentityTransformStream extends TransformStream<
|
|
2297
2301
|
ArrayBuffer | ArrayBufferView,
|
|
2298
2302
|
Uint8Array
|
|
2299
2303
|
> {
|
|
2300
|
-
constructor(
|
|
2304
|
+
constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy);
|
|
2301
2305
|
}
|
|
2302
2306
|
export interface IdentityTransformStreamQueuingStrategy {
|
|
2303
2307
|
highWaterMark?: number | bigint;
|
|
@@ -2778,21 +2782,24 @@ export declare const WebSocketPair: {
|
|
|
2778
2782
|
};
|
|
2779
2783
|
};
|
|
2780
2784
|
export interface SqlStorage {
|
|
2781
|
-
exec
|
|
2782
|
-
|
|
2785
|
+
exec<T extends Record<string, SqlStorageValue>>(
|
|
2786
|
+
query: string,
|
|
2787
|
+
...bindings: any[]
|
|
2788
|
+
): SqlStorageCursor<T>;
|
|
2783
2789
|
get databaseSize(): number;
|
|
2784
2790
|
Cursor: typeof SqlStorageCursor;
|
|
2785
2791
|
Statement: typeof SqlStorageStatement;
|
|
2786
2792
|
}
|
|
2787
2793
|
export declare abstract class SqlStorageStatement {}
|
|
2788
|
-
export
|
|
2789
|
-
|
|
2794
|
+
export type SqlStorageValue = ArrayBuffer | string | number | null;
|
|
2795
|
+
export declare abstract class SqlStorageCursor<
|
|
2796
|
+
T extends Record<string, SqlStorageValue>,
|
|
2797
|
+
> {
|
|
2798
|
+
raw<U extends SqlStorageValue[]>(): IterableIterator<U>;
|
|
2790
2799
|
get columnNames(): string[];
|
|
2791
2800
|
get rowsRead(): number;
|
|
2792
2801
|
get rowsWritten(): number;
|
|
2793
|
-
[Symbol.iterator](): IterableIterator<
|
|
2794
|
-
Record<string, (ArrayBuffer | string | number) | null>
|
|
2795
|
-
>;
|
|
2802
|
+
[Symbol.iterator](): IterableIterator<T>;
|
|
2796
2803
|
}
|
|
2797
2804
|
export interface Socket {
|
|
2798
2805
|
get readable(): ReadableStream;
|
|
@@ -3331,7 +3338,7 @@ export interface GPUOrigin3DDict {
|
|
|
3331
3338
|
z?: number;
|
|
3332
3339
|
}
|
|
3333
3340
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource) */
|
|
3334
|
-
export declare class EventSource {
|
|
3341
|
+
export declare class EventSource extends EventTarget {
|
|
3335
3342
|
constructor(url: string, init?: EventSourceEventSourceInit);
|
|
3336
3343
|
/**
|
|
3337
3344
|
* Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
|
|
@@ -5501,13 +5508,57 @@ export interface DispatchNamespace {
|
|
|
5501
5508
|
options?: DynamicDispatchOptions,
|
|
5502
5509
|
): Fetcher;
|
|
5503
5510
|
}
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
|
|
5511
|
+
export declare abstract class Workflow {
|
|
5512
|
+
/**
|
|
5513
|
+
* Get a handle to an existing instance of the Workflow.
|
|
5514
|
+
* @param id Id for the instance of this Workflow
|
|
5515
|
+
* @returns A promise that resolves with a handle for the Instance
|
|
5516
|
+
*/
|
|
5517
|
+
public get(id: string): Promise<Instance>;
|
|
5518
|
+
/**
|
|
5519
|
+
* Create a new instance and return a handle to it. If a provided id exists, an error will be thrown.
|
|
5520
|
+
* @param id Id to create the instance of this Workflow with
|
|
5521
|
+
* @param params The payload to send over to this instance
|
|
5522
|
+
* @returns A promise that resolves with a handle for the Instance
|
|
5523
|
+
*/
|
|
5524
|
+
public create(id: string, params: object): Promise<Instance>;
|
|
5525
|
+
}
|
|
5526
|
+
export type InstanceStatus = {
|
|
5527
|
+
status:
|
|
5528
|
+
| "queued"
|
|
5529
|
+
| "running"
|
|
5530
|
+
| "paused"
|
|
5531
|
+
| "errored"
|
|
5532
|
+
| "terminated"
|
|
5533
|
+
| "complete"
|
|
5534
|
+
| "unknown";
|
|
5535
|
+
error?: string;
|
|
5536
|
+
output?: object;
|
|
5537
|
+
};
|
|
5538
|
+
export interface WorkflowError {
|
|
5539
|
+
code?: number;
|
|
5540
|
+
message: string;
|
|
5541
|
+
}
|
|
5542
|
+
export declare abstract class Instance {
|
|
5543
|
+
public id: string;
|
|
5544
|
+
/**
|
|
5545
|
+
* Pause the instance.
|
|
5546
|
+
*/
|
|
5547
|
+
public pause(): Promise<void>;
|
|
5548
|
+
/**
|
|
5549
|
+
* Resume the instance. If it is already running, an error will be thrown.
|
|
5550
|
+
*/
|
|
5551
|
+
public resume(): Promise<void>;
|
|
5552
|
+
/**
|
|
5553
|
+
* Abort the instance. If it is errored, terminated or complete, an error will be thrown.
|
|
5554
|
+
*/
|
|
5555
|
+
public abort(): Promise<void>;
|
|
5556
|
+
/**
|
|
5557
|
+
* Restart the instance.
|
|
5558
|
+
*/
|
|
5559
|
+
public restart(): Promise<void>;
|
|
5560
|
+
/**
|
|
5561
|
+
* Returns the current status of the instance.
|
|
5562
|
+
*/
|
|
5563
|
+
public status(): Promise<InstanceStatus>;
|
|
5513
5564
|
}
|