@cloudflare/workers-types 0.20240712.0 → 0.20250124.2
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 +1408 -183
- package/2021-11-03/index.ts +1345 -179
- package/2022-01-31/index.d.ts +1429 -204
- package/2022-01-31/index.ts +1366 -200
- package/2022-03-21/index.d.ts +1431 -205
- package/2022-03-21/index.ts +1368 -201
- package/2022-08-04/index.d.ts +1431 -205
- package/2022-08-04/index.ts +1368 -201
- package/2022-10-31/index.d.ts +1435 -205
- package/2022-10-31/index.ts +1372 -201
- package/2022-11-30/index.d.ts +1435 -205
- package/2022-11-30/index.ts +1372 -201
- package/2023-03-01/index.d.ts +1435 -205
- package/2023-03-01/index.ts +1372 -201
- package/2023-07-01/index.d.ts +1435 -205
- package/2023-07-01/index.ts +1372 -201
- package/experimental/index.d.ts +1446 -212
- package/experimental/index.ts +1383 -208
- package/index.d.ts +1408 -183
- package/index.ts +1345 -179
- package/oldest/index.d.ts +1408 -183
- package/oldest/index.ts +1345 -179
- package/package.json +1 -1
package/2022-11-30/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ and limitations under the License.
|
|
|
14
14
|
***************************************************************************** */
|
|
15
15
|
/* eslint-disable */
|
|
16
16
|
// noinspection JSUnusedGlobalSymbols
|
|
17
|
+
declare var onmessage: never;
|
|
17
18
|
/**
|
|
18
19
|
* An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API.
|
|
19
20
|
*
|
|
@@ -227,7 +228,7 @@ interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|
|
227
228
|
structuredClone<T>(value: T, options?: StructuredSerializeOptions): T;
|
|
228
229
|
reportError(error: any): void;
|
|
229
230
|
fetch(
|
|
230
|
-
input: RequestInfo,
|
|
231
|
+
input: RequestInfo | URL,
|
|
231
232
|
init?: RequestInit<RequestInitCfProperties>,
|
|
232
233
|
): Promise<Response>;
|
|
233
234
|
self: ServiceWorkerGlobalScope;
|
|
@@ -235,6 +236,7 @@ interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|
|
235
236
|
caches: CacheStorage;
|
|
236
237
|
scheduler: Scheduler;
|
|
237
238
|
performance: Performance;
|
|
239
|
+
Cloudflare: Cloudflare;
|
|
238
240
|
readonly origin: string;
|
|
239
241
|
Event: typeof Event;
|
|
240
242
|
ExtendableEvent: typeof ExtendableEvent;
|
|
@@ -364,7 +366,7 @@ declare function structuredClone<T>(
|
|
|
364
366
|
declare function reportError(error: any): void;
|
|
365
367
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/fetch) */
|
|
366
368
|
declare function fetch(
|
|
367
|
-
input: RequestInfo,
|
|
369
|
+
input: RequestInfo | URL,
|
|
368
370
|
init?: RequestInit<RequestInitCfProperties>,
|
|
369
371
|
): Promise<Response>;
|
|
370
372
|
declare const self: ServiceWorkerGlobalScope;
|
|
@@ -391,12 +393,14 @@ declare const scheduler: Scheduler;
|
|
|
391
393
|
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
|
|
392
394
|
*/
|
|
393
395
|
declare const performance: Performance;
|
|
396
|
+
declare const Cloudflare: Cloudflare;
|
|
394
397
|
declare const origin: string;
|
|
395
398
|
declare const navigator: Navigator;
|
|
396
399
|
interface TestController {}
|
|
397
400
|
interface ExecutionContext {
|
|
398
401
|
waitUntil(promise: Promise<any>): void;
|
|
399
402
|
passThroughOnException(): void;
|
|
403
|
+
props: any;
|
|
400
404
|
}
|
|
401
405
|
type ExportedHandlerFetchHandler<Env = unknown, CfHostMetadata = unknown> = (
|
|
402
406
|
request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>,
|
|
@@ -413,6 +417,11 @@ type ExportedHandlerTraceHandler<Env = unknown> = (
|
|
|
413
417
|
env: Env,
|
|
414
418
|
ctx: ExecutionContext,
|
|
415
419
|
) => void | Promise<void>;
|
|
420
|
+
type ExportedHandlerTailStreamHandler<Env = unknown> = (
|
|
421
|
+
event: TailStream.TailEvent,
|
|
422
|
+
env: Env,
|
|
423
|
+
ctx: ExecutionContext,
|
|
424
|
+
) => TailStream.TailEventHandlerType | Promise<TailStream.TailEventHandlerType>;
|
|
416
425
|
type ExportedHandlerScheduledHandler<Env = unknown> = (
|
|
417
426
|
controller: ScheduledController,
|
|
418
427
|
env: Env,
|
|
@@ -436,6 +445,7 @@ interface ExportedHandler<
|
|
|
436
445
|
fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata>;
|
|
437
446
|
tail?: ExportedHandlerTailHandler<Env>;
|
|
438
447
|
trace?: ExportedHandlerTraceHandler<Env>;
|
|
448
|
+
tailStream?: ExportedHandlerTailStreamHandler<Env>;
|
|
439
449
|
scheduled?: ExportedHandlerScheduledHandler<Env>;
|
|
440
450
|
test?: ExportedHandlerTestHandler<Env>;
|
|
441
451
|
email?: EmailExportedHandler<Env>;
|
|
@@ -459,8 +469,9 @@ declare abstract class Navigator {
|
|
|
459
469
|
| string
|
|
460
470
|
| (ArrayBuffer | ArrayBufferView)
|
|
461
471
|
| Blob
|
|
472
|
+
| FormData
|
|
462
473
|
| URLSearchParams
|
|
463
|
-
|
|
|
474
|
+
| URLSearchParams,
|
|
464
475
|
): boolean;
|
|
465
476
|
readonly userAgent: string;
|
|
466
477
|
readonly gpu: GPU;
|
|
@@ -481,9 +492,12 @@ interface AlarmInvocationInfo {
|
|
|
481
492
|
readonly isRetry: boolean;
|
|
482
493
|
readonly retryCount: number;
|
|
483
494
|
}
|
|
495
|
+
interface Cloudflare {
|
|
496
|
+
readonly compatibilityFlags: Record<string, boolean>;
|
|
497
|
+
}
|
|
484
498
|
interface DurableObject {
|
|
485
499
|
fetch(request: Request): Response | Promise<Response>;
|
|
486
|
-
alarm?(): void | Promise<void>;
|
|
500
|
+
alarm?(alarmInfo?: AlarmInvocationInfo): void | Promise<void>;
|
|
487
501
|
webSocketMessage?(
|
|
488
502
|
ws: WebSocket,
|
|
489
503
|
message: string | ArrayBuffer,
|
|
@@ -556,6 +570,7 @@ interface DurableObjectState {
|
|
|
556
570
|
setHibernatableWebSocketEventTimeout(timeoutMs?: number): void;
|
|
557
571
|
getHibernatableWebSocketEventTimeout(): number | null;
|
|
558
572
|
getTags(ws: WebSocket): string[];
|
|
573
|
+
abort(reason?: string): void;
|
|
559
574
|
}
|
|
560
575
|
interface DurableObjectTransaction {
|
|
561
576
|
get<T = unknown>(
|
|
@@ -622,7 +637,11 @@ interface DurableObjectStorage {
|
|
|
622
637
|
): Promise<void>;
|
|
623
638
|
deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
|
|
624
639
|
sync(): Promise<void>;
|
|
640
|
+
sql: SqlStorage;
|
|
625
641
|
transactionSync<T>(closure: () => T): T;
|
|
642
|
+
getCurrentBookmark(): Promise<string>;
|
|
643
|
+
getBookmarkForTime(timestamp: number | Date): Promise<string>;
|
|
644
|
+
onNextSessionRestoreBookmark(bookmark: string): Promise<string>;
|
|
626
645
|
}
|
|
627
646
|
interface DurableObjectListOptions {
|
|
628
647
|
start?: string;
|
|
@@ -993,14 +1012,17 @@ declare abstract class CacheStorage {
|
|
|
993
1012
|
*/
|
|
994
1013
|
declare abstract class Cache {
|
|
995
1014
|
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#delete) */
|
|
996
|
-
delete(
|
|
1015
|
+
delete(
|
|
1016
|
+
request: RequestInfo | URL,
|
|
1017
|
+
options?: CacheQueryOptions,
|
|
1018
|
+
): Promise<boolean>;
|
|
997
1019
|
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#match) */
|
|
998
1020
|
match(
|
|
999
|
-
request: RequestInfo,
|
|
1021
|
+
request: RequestInfo | URL,
|
|
1000
1022
|
options?: CacheQueryOptions,
|
|
1001
1023
|
): Promise<Response | undefined>;
|
|
1002
1024
|
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#put) */
|
|
1003
|
-
put(request: RequestInfo, response: Response): Promise<void>;
|
|
1025
|
+
put(request: RequestInfo | URL, response: Response): Promise<void>;
|
|
1004
1026
|
}
|
|
1005
1027
|
interface CacheQueryOptions {
|
|
1006
1028
|
ignoreMethod?: boolean;
|
|
@@ -1423,20 +1445,44 @@ interface Element {
|
|
|
1423
1445
|
hasAttribute(name: string): boolean;
|
|
1424
1446
|
setAttribute(name: string, value: string): Element;
|
|
1425
1447
|
removeAttribute(name: string): Element;
|
|
1426
|
-
before(
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1448
|
+
before(
|
|
1449
|
+
content: string | ReadableStream | Response,
|
|
1450
|
+
options?: ContentOptions,
|
|
1451
|
+
): Element;
|
|
1452
|
+
after(
|
|
1453
|
+
content: string | ReadableStream | Response,
|
|
1454
|
+
options?: ContentOptions,
|
|
1455
|
+
): Element;
|
|
1456
|
+
prepend(
|
|
1457
|
+
content: string | ReadableStream | Response,
|
|
1458
|
+
options?: ContentOptions,
|
|
1459
|
+
): Element;
|
|
1460
|
+
append(
|
|
1461
|
+
content: string | ReadableStream | Response,
|
|
1462
|
+
options?: ContentOptions,
|
|
1463
|
+
): Element;
|
|
1464
|
+
replace(
|
|
1465
|
+
content: string | ReadableStream | Response,
|
|
1466
|
+
options?: ContentOptions,
|
|
1467
|
+
): Element;
|
|
1431
1468
|
remove(): Element;
|
|
1432
1469
|
removeAndKeepContent(): Element;
|
|
1433
|
-
setInnerContent(
|
|
1470
|
+
setInnerContent(
|
|
1471
|
+
content: string | ReadableStream | Response,
|
|
1472
|
+
options?: ContentOptions,
|
|
1473
|
+
): Element;
|
|
1434
1474
|
onEndTag(handler: (tag: EndTag) => void | Promise<void>): void;
|
|
1435
1475
|
}
|
|
1436
1476
|
interface EndTag {
|
|
1437
1477
|
name: string;
|
|
1438
|
-
before(
|
|
1439
|
-
|
|
1478
|
+
before(
|
|
1479
|
+
content: string | ReadableStream | Response,
|
|
1480
|
+
options?: ContentOptions,
|
|
1481
|
+
): EndTag;
|
|
1482
|
+
after(
|
|
1483
|
+
content: string | ReadableStream | Response,
|
|
1484
|
+
options?: ContentOptions,
|
|
1485
|
+
): EndTag;
|
|
1440
1486
|
remove(): EndTag;
|
|
1441
1487
|
}
|
|
1442
1488
|
interface Comment {
|
|
@@ -1451,9 +1497,18 @@ interface Text {
|
|
|
1451
1497
|
readonly text: string;
|
|
1452
1498
|
readonly lastInTextNode: boolean;
|
|
1453
1499
|
readonly removed: boolean;
|
|
1454
|
-
before(
|
|
1455
|
-
|
|
1456
|
-
|
|
1500
|
+
before(
|
|
1501
|
+
content: string | ReadableStream | Response,
|
|
1502
|
+
options?: ContentOptions,
|
|
1503
|
+
): Text;
|
|
1504
|
+
after(
|
|
1505
|
+
content: string | ReadableStream | Response,
|
|
1506
|
+
options?: ContentOptions,
|
|
1507
|
+
): Text;
|
|
1508
|
+
replace(
|
|
1509
|
+
content: string | ReadableStream | Response,
|
|
1510
|
+
options?: ContentOptions,
|
|
1511
|
+
): Text;
|
|
1457
1512
|
remove(): Text;
|
|
1458
1513
|
}
|
|
1459
1514
|
interface DocumentEnd {
|
|
@@ -1535,28 +1590,34 @@ declare abstract class Body {
|
|
|
1535
1590
|
*
|
|
1536
1591
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
|
|
1537
1592
|
*/
|
|
1538
|
-
declare
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1593
|
+
declare var Response: {
|
|
1594
|
+
prototype: Response;
|
|
1595
|
+
new (body?: BodyInit | null, init?: ResponseInit): Response;
|
|
1596
|
+
redirect(url: string, status?: number): Response;
|
|
1597
|
+
json(any: any, maybeInit?: ResponseInit | Response): Response;
|
|
1598
|
+
};
|
|
1599
|
+
/**
|
|
1600
|
+
* This Fetch API interface represents the response to a request.
|
|
1601
|
+
*
|
|
1602
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
|
|
1603
|
+
*/
|
|
1604
|
+
interface Response extends Body {
|
|
1544
1605
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */
|
|
1545
1606
|
clone(): Response;
|
|
1546
1607
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status) */
|
|
1547
|
-
|
|
1608
|
+
status: number;
|
|
1548
1609
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/statusText) */
|
|
1549
|
-
|
|
1610
|
+
statusText: string;
|
|
1550
1611
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/headers) */
|
|
1551
|
-
|
|
1612
|
+
headers: Headers;
|
|
1552
1613
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/ok) */
|
|
1553
|
-
|
|
1614
|
+
ok: boolean;
|
|
1554
1615
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirected) */
|
|
1555
|
-
|
|
1616
|
+
redirected: boolean;
|
|
1556
1617
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) */
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1618
|
+
url: string;
|
|
1619
|
+
webSocket: WebSocket | null;
|
|
1620
|
+
cf: any | undefined;
|
|
1560
1621
|
}
|
|
1561
1622
|
interface ResponseInit {
|
|
1562
1623
|
status?: number;
|
|
@@ -1568,18 +1629,26 @@ interface ResponseInit {
|
|
|
1568
1629
|
}
|
|
1569
1630
|
type RequestInfo<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> =
|
|
1570
1631
|
| Request<CfHostMetadata, Cf>
|
|
1571
|
-
| string
|
|
1572
|
-
| URL;
|
|
1632
|
+
| string;
|
|
1573
1633
|
/**
|
|
1574
1634
|
* This Fetch API interface represents a resource request.
|
|
1575
1635
|
*
|
|
1576
1636
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
|
|
1577
1637
|
*/
|
|
1578
|
-
declare
|
|
1579
|
-
|
|
1580
|
-
Cf = CfProperties<CfHostMetadata
|
|
1581
|
-
>
|
|
1582
|
-
|
|
1638
|
+
declare var Request: {
|
|
1639
|
+
prototype: Request;
|
|
1640
|
+
new <CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>>(
|
|
1641
|
+
input: RequestInfo<CfProperties> | URL,
|
|
1642
|
+
init?: RequestInit<Cf>,
|
|
1643
|
+
): Request<CfHostMetadata, Cf>;
|
|
1644
|
+
};
|
|
1645
|
+
/**
|
|
1646
|
+
* This Fetch API interface represents a resource request.
|
|
1647
|
+
*
|
|
1648
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
|
|
1649
|
+
*/
|
|
1650
|
+
interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>>
|
|
1651
|
+
extends Body {
|
|
1583
1652
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone) */
|
|
1584
1653
|
clone(): Request<CfHostMetadata, Cf>;
|
|
1585
1654
|
/**
|
|
@@ -1587,45 +1656,45 @@ declare class Request<
|
|
|
1587
1656
|
*
|
|
1588
1657
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/method)
|
|
1589
1658
|
*/
|
|
1590
|
-
|
|
1659
|
+
method: string;
|
|
1591
1660
|
/**
|
|
1592
1661
|
* Returns the URL of request as a string.
|
|
1593
1662
|
*
|
|
1594
1663
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/url)
|
|
1595
1664
|
*/
|
|
1596
|
-
|
|
1665
|
+
url: string;
|
|
1597
1666
|
/**
|
|
1598
1667
|
* Returns a Headers object consisting of the headers associated with request. Note that headers added in the network layer by the user agent will not be accounted for in this object, e.g., the "Host" header.
|
|
1599
1668
|
*
|
|
1600
1669
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/headers)
|
|
1601
1670
|
*/
|
|
1602
|
-
|
|
1671
|
+
headers: Headers;
|
|
1603
1672
|
/**
|
|
1604
1673
|
* Returns the redirect mode associated with request, which is a string indicating how redirects for the request will be handled during fetching. A request will follow redirects by default.
|
|
1605
1674
|
*
|
|
1606
1675
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/redirect)
|
|
1607
1676
|
*/
|
|
1608
|
-
|
|
1609
|
-
|
|
1677
|
+
redirect: string;
|
|
1678
|
+
fetcher: Fetcher | null;
|
|
1610
1679
|
/**
|
|
1611
1680
|
* Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler.
|
|
1612
1681
|
*
|
|
1613
1682
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/signal)
|
|
1614
1683
|
*/
|
|
1615
|
-
|
|
1616
|
-
|
|
1684
|
+
signal: AbortSignal;
|
|
1685
|
+
cf: Cf | undefined;
|
|
1617
1686
|
/**
|
|
1618
1687
|
* Returns request's subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. [SRI]
|
|
1619
1688
|
*
|
|
1620
1689
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/integrity)
|
|
1621
1690
|
*/
|
|
1622
|
-
|
|
1691
|
+
integrity: string;
|
|
1623
1692
|
/**
|
|
1624
1693
|
* Returns a boolean indicating whether or not request can outlive the global in which it was created.
|
|
1625
1694
|
*
|
|
1626
1695
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
|
|
1627
1696
|
*/
|
|
1628
|
-
|
|
1697
|
+
keepalive: boolean;
|
|
1629
1698
|
}
|
|
1630
1699
|
interface RequestInit<Cf = CfProperties> {
|
|
1631
1700
|
/* A string to set request's method. */
|
|
@@ -1651,7 +1720,7 @@ type Fetcher<
|
|
|
1651
1720
|
> = (T extends Rpc.EntrypointBranded
|
|
1652
1721
|
? Rpc.Provider<T, Reserved | "fetch" | "connect">
|
|
1653
1722
|
: unknown) & {
|
|
1654
|
-
fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
|
|
1723
|
+
fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
|
|
1655
1724
|
connect(address: SocketAddress | string, options?: SocketOptions): Socket;
|
|
1656
1725
|
};
|
|
1657
1726
|
interface FetcherPutOptions {
|
|
@@ -1873,6 +1942,7 @@ interface R2MultipartUpload {
|
|
|
1873
1942
|
uploadPart(
|
|
1874
1943
|
partNumber: number,
|
|
1875
1944
|
value: ReadableStream | (ArrayBuffer | ArrayBufferView) | string | Blob,
|
|
1945
|
+
options?: R2UploadPartOptions,
|
|
1876
1946
|
): Promise<R2UploadedPart>;
|
|
1877
1947
|
abort(): Promise<void>;
|
|
1878
1948
|
complete(uploadedParts: R2UploadedPart[]): Promise<R2Object>;
|
|
@@ -1893,6 +1963,7 @@ declare abstract class R2Object {
|
|
|
1893
1963
|
readonly customMetadata?: Record<string, string>;
|
|
1894
1964
|
readonly range?: R2Range;
|
|
1895
1965
|
readonly storageClass: string;
|
|
1966
|
+
readonly ssecKeyMd5?: string;
|
|
1896
1967
|
writeHttpMetadata(headers: Headers): void;
|
|
1897
1968
|
}
|
|
1898
1969
|
interface R2ObjectBody extends R2Object {
|
|
@@ -1925,6 +1996,7 @@ interface R2Conditional {
|
|
|
1925
1996
|
interface R2GetOptions {
|
|
1926
1997
|
onlyIf?: R2Conditional | Headers;
|
|
1927
1998
|
range?: R2Range | Headers;
|
|
1999
|
+
ssecKey?: ArrayBuffer | string;
|
|
1928
2000
|
}
|
|
1929
2001
|
interface R2PutOptions {
|
|
1930
2002
|
onlyIf?: R2Conditional | Headers;
|
|
@@ -1936,11 +2008,13 @@ interface R2PutOptions {
|
|
|
1936
2008
|
sha384?: ArrayBuffer | string;
|
|
1937
2009
|
sha512?: ArrayBuffer | string;
|
|
1938
2010
|
storageClass?: string;
|
|
2011
|
+
ssecKey?: ArrayBuffer | string;
|
|
1939
2012
|
}
|
|
1940
2013
|
interface R2MultipartOptions {
|
|
1941
2014
|
httpMetadata?: R2HTTPMetadata | Headers;
|
|
1942
2015
|
customMetadata?: Record<string, string>;
|
|
1943
2016
|
storageClass?: string;
|
|
2017
|
+
ssecKey?: ArrayBuffer | string;
|
|
1944
2018
|
}
|
|
1945
2019
|
interface R2Checksums {
|
|
1946
2020
|
readonly md5?: ArrayBuffer;
|
|
@@ -1977,6 +2051,9 @@ type R2Objects = {
|
|
|
1977
2051
|
truncated: false;
|
|
1978
2052
|
}
|
|
1979
2053
|
);
|
|
2054
|
+
interface R2UploadPartOptions {
|
|
2055
|
+
ssecKey?: ArrayBuffer | string;
|
|
2056
|
+
}
|
|
1980
2057
|
declare abstract class ScheduledEvent extends ExtendableEvent {
|
|
1981
2058
|
readonly scheduledTime: number;
|
|
1982
2059
|
readonly cron: string;
|
|
@@ -2387,6 +2464,8 @@ interface TraceItem {
|
|
|
2387
2464
|
readonly dispatchNamespace?: string;
|
|
2388
2465
|
readonly scriptTags?: string[];
|
|
2389
2466
|
readonly outcome: string;
|
|
2467
|
+
readonly executionModel: string;
|
|
2468
|
+
readonly truncated: boolean;
|
|
2390
2469
|
}
|
|
2391
2470
|
interface TraceItemAlarmEventInfo {
|
|
2392
2471
|
readonly scheduledTime: Date;
|
|
@@ -2526,6 +2605,10 @@ declare class URL {
|
|
|
2526
2605
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/canParse_static) */
|
|
2527
2606
|
static canParse(url: string, base?: string): boolean;
|
|
2528
2607
|
static parse(url: string, base?: string): URL | null;
|
|
2608
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL_static) */
|
|
2609
|
+
static createObjectURL(object: File | Blob): string;
|
|
2610
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/revokeObjectURL_static) */
|
|
2611
|
+
static revokeObjectURL(object_url: string): void;
|
|
2529
2612
|
}
|
|
2530
2613
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams) */
|
|
2531
2614
|
declare class URLSearchParams {
|
|
@@ -2699,8 +2782,24 @@ type WebSocketEventMap = {
|
|
|
2699
2782
|
*
|
|
2700
2783
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
|
2701
2784
|
*/
|
|
2702
|
-
declare
|
|
2703
|
-
|
|
2785
|
+
declare var WebSocket: {
|
|
2786
|
+
prototype: WebSocket;
|
|
2787
|
+
new (url: string, protocols?: string[] | string): WebSocket;
|
|
2788
|
+
readonly READY_STATE_CONNECTING: number;
|
|
2789
|
+
readonly CONNECTING: number;
|
|
2790
|
+
readonly READY_STATE_OPEN: number;
|
|
2791
|
+
readonly OPEN: number;
|
|
2792
|
+
readonly READY_STATE_CLOSING: number;
|
|
2793
|
+
readonly CLOSING: number;
|
|
2794
|
+
readonly READY_STATE_CLOSED: number;
|
|
2795
|
+
readonly CLOSED: number;
|
|
2796
|
+
};
|
|
2797
|
+
/**
|
|
2798
|
+
* Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
|
2799
|
+
*
|
|
2800
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
|
2801
|
+
*/
|
|
2802
|
+
interface WebSocket extends EventTarget<WebSocketEventMap> {
|
|
2704
2803
|
accept(): void;
|
|
2705
2804
|
/**
|
|
2706
2805
|
* Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
|
|
@@ -2716,38 +2815,30 @@ declare class WebSocket extends EventTarget<WebSocketEventMap> {
|
|
|
2716
2815
|
close(code?: number, reason?: string): void;
|
|
2717
2816
|
serializeAttachment(attachment: any): void;
|
|
2718
2817
|
deserializeAttachment(): any | null;
|
|
2719
|
-
static readonly READY_STATE_CONNECTING: number;
|
|
2720
|
-
static readonly CONNECTING: number;
|
|
2721
|
-
static readonly READY_STATE_OPEN: number;
|
|
2722
|
-
static readonly OPEN: number;
|
|
2723
|
-
static readonly READY_STATE_CLOSING: number;
|
|
2724
|
-
static readonly CLOSING: number;
|
|
2725
|
-
static readonly READY_STATE_CLOSED: number;
|
|
2726
|
-
static readonly CLOSED: number;
|
|
2727
2818
|
/**
|
|
2728
2819
|
* Returns the state of the WebSocket object's connection. It can have the values described below.
|
|
2729
2820
|
*
|
|
2730
2821
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/readyState)
|
|
2731
2822
|
*/
|
|
2732
|
-
|
|
2823
|
+
readyState: number;
|
|
2733
2824
|
/**
|
|
2734
2825
|
* Returns the URL that was used to establish the WebSocket connection.
|
|
2735
2826
|
*
|
|
2736
2827
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/url)
|
|
2737
2828
|
*/
|
|
2738
|
-
|
|
2829
|
+
url: string | null;
|
|
2739
2830
|
/**
|
|
2740
2831
|
* Returns the subprotocol selected by the server, if any. It can be used in conjunction with the array form of the constructor's second argument to perform subprotocol negotiation.
|
|
2741
2832
|
*
|
|
2742
2833
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol)
|
|
2743
2834
|
*/
|
|
2744
|
-
|
|
2835
|
+
protocol: string | null;
|
|
2745
2836
|
/**
|
|
2746
2837
|
* Returns the extensions selected by the server, if any.
|
|
2747
2838
|
*
|
|
2748
2839
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
|
|
2749
2840
|
*/
|
|
2750
|
-
|
|
2841
|
+
extensions: string | null;
|
|
2751
2842
|
}
|
|
2752
2843
|
declare const WebSocketPair: {
|
|
2753
2844
|
new (): {
|
|
@@ -2755,6 +2846,37 @@ declare const WebSocketPair: {
|
|
|
2755
2846
|
1: WebSocket;
|
|
2756
2847
|
};
|
|
2757
2848
|
};
|
|
2849
|
+
interface SqlStorage {
|
|
2850
|
+
exec<T extends Record<string, SqlStorageValue>>(
|
|
2851
|
+
query: string,
|
|
2852
|
+
...bindings: any[]
|
|
2853
|
+
): SqlStorageCursor<T>;
|
|
2854
|
+
get databaseSize(): number;
|
|
2855
|
+
Cursor: typeof SqlStorageCursor;
|
|
2856
|
+
Statement: typeof SqlStorageStatement;
|
|
2857
|
+
}
|
|
2858
|
+
declare abstract class SqlStorageStatement {}
|
|
2859
|
+
type SqlStorageValue = ArrayBuffer | string | number | null;
|
|
2860
|
+
declare abstract class SqlStorageCursor<
|
|
2861
|
+
T extends Record<string, SqlStorageValue>,
|
|
2862
|
+
> {
|
|
2863
|
+
next():
|
|
2864
|
+
| {
|
|
2865
|
+
done?: false;
|
|
2866
|
+
value: T;
|
|
2867
|
+
}
|
|
2868
|
+
| {
|
|
2869
|
+
done: true;
|
|
2870
|
+
value?: never;
|
|
2871
|
+
};
|
|
2872
|
+
toArray(): T[];
|
|
2873
|
+
one(): T;
|
|
2874
|
+
raw<U extends SqlStorageValue[]>(): IterableIterator<U>;
|
|
2875
|
+
columnNames: string[];
|
|
2876
|
+
get rowsRead(): number;
|
|
2877
|
+
get rowsWritten(): number;
|
|
2878
|
+
[Symbol.iterator](): IterableIterator<T>;
|
|
2879
|
+
}
|
|
2758
2880
|
interface Socket {
|
|
2759
2881
|
get readable(): ReadableStream;
|
|
2760
2882
|
get writable(): WritableStream;
|
|
@@ -3292,7 +3414,7 @@ interface GPUOrigin3DDict {
|
|
|
3292
3414
|
z?: number;
|
|
3293
3415
|
}
|
|
3294
3416
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource) */
|
|
3295
|
-
declare class EventSource {
|
|
3417
|
+
declare class EventSource extends EventTarget {
|
|
3296
3418
|
constructor(url: string, init?: EventSourceEventSourceInit);
|
|
3297
3419
|
/**
|
|
3298
3420
|
* Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
|
|
@@ -3391,10 +3513,10 @@ declare abstract class BaseAiSentenceSimilarity {
|
|
|
3391
3513
|
inputs: AiSentenceSimilarityInput;
|
|
3392
3514
|
postProcessedOutputs: AiSentenceSimilarityOutput;
|
|
3393
3515
|
}
|
|
3394
|
-
type
|
|
3516
|
+
type AiAutomaticSpeechRecognitionInput = {
|
|
3395
3517
|
audio: number[];
|
|
3396
3518
|
};
|
|
3397
|
-
type
|
|
3519
|
+
type AiAutomaticSpeechRecognitionOutput = {
|
|
3398
3520
|
text?: string;
|
|
3399
3521
|
words?: {
|
|
3400
3522
|
word: string;
|
|
@@ -3403,9 +3525,9 @@ type AiSpeechRecognitionOutput = {
|
|
|
3403
3525
|
}[];
|
|
3404
3526
|
vtt?: string;
|
|
3405
3527
|
};
|
|
3406
|
-
declare abstract class
|
|
3407
|
-
inputs:
|
|
3408
|
-
postProcessedOutputs:
|
|
3528
|
+
declare abstract class BaseAiAutomaticSpeechRecognition {
|
|
3529
|
+
inputs: AiAutomaticSpeechRecognitionInput;
|
|
3530
|
+
postProcessedOutputs: AiAutomaticSpeechRecognitionOutput;
|
|
3409
3531
|
}
|
|
3410
3532
|
type AiSummarizationInput = {
|
|
3411
3533
|
input_text: string;
|
|
@@ -3441,16 +3563,36 @@ declare abstract class BaseAiTextEmbeddings {
|
|
|
3441
3563
|
postProcessedOutputs: AiTextEmbeddingsOutput;
|
|
3442
3564
|
}
|
|
3443
3565
|
type RoleScopedChatInput = {
|
|
3444
|
-
role:
|
|
3566
|
+
role:
|
|
3567
|
+
| "user"
|
|
3568
|
+
| "assistant"
|
|
3569
|
+
| "system"
|
|
3570
|
+
| "tool"
|
|
3571
|
+
| (string & NonNullable<unknown>);
|
|
3445
3572
|
content: string;
|
|
3573
|
+
name?: string;
|
|
3574
|
+
};
|
|
3575
|
+
type AiTextGenerationToolLegacyInput = {
|
|
3576
|
+
name: string;
|
|
3577
|
+
description: string;
|
|
3578
|
+
parameters?: {
|
|
3579
|
+
type: "object" | (string & NonNullable<unknown>);
|
|
3580
|
+
properties: {
|
|
3581
|
+
[key: string]: {
|
|
3582
|
+
type: string;
|
|
3583
|
+
description?: string;
|
|
3584
|
+
};
|
|
3585
|
+
};
|
|
3586
|
+
required: string[];
|
|
3587
|
+
};
|
|
3446
3588
|
};
|
|
3447
3589
|
type AiTextGenerationToolInput = {
|
|
3448
|
-
type: "function";
|
|
3590
|
+
type: "function" | (string & NonNullable<unknown>);
|
|
3449
3591
|
function: {
|
|
3450
3592
|
name: string;
|
|
3451
3593
|
description: string;
|
|
3452
3594
|
parameters?: {
|
|
3453
|
-
type: "object";
|
|
3595
|
+
type: "object" | (string & NonNullable<unknown>);
|
|
3454
3596
|
properties: {
|
|
3455
3597
|
[key: string]: {
|
|
3456
3598
|
type: string;
|
|
@@ -3461,6 +3603,10 @@ type AiTextGenerationToolInput = {
|
|
|
3461
3603
|
};
|
|
3462
3604
|
};
|
|
3463
3605
|
};
|
|
3606
|
+
type AiTextGenerationFunctionsInput = {
|
|
3607
|
+
name: string;
|
|
3608
|
+
code: string;
|
|
3609
|
+
};
|
|
3464
3610
|
type AiTextGenerationInput = {
|
|
3465
3611
|
prompt?: string;
|
|
3466
3612
|
raw?: boolean;
|
|
@@ -3474,7 +3620,11 @@ type AiTextGenerationInput = {
|
|
|
3474
3620
|
frequency_penalty?: number;
|
|
3475
3621
|
presence_penalty?: number;
|
|
3476
3622
|
messages?: RoleScopedChatInput[];
|
|
3477
|
-
tools?:
|
|
3623
|
+
tools?:
|
|
3624
|
+
| AiTextGenerationToolInput[]
|
|
3625
|
+
| AiTextGenerationToolLegacyInput[]
|
|
3626
|
+
| (object & NonNullable<unknown>);
|
|
3627
|
+
functions?: AiTextGenerationFunctionsInput[];
|
|
3478
3628
|
};
|
|
3479
3629
|
type AiTextGenerationOutput =
|
|
3480
3630
|
| {
|
|
@@ -3489,15 +3639,33 @@ declare abstract class BaseAiTextGeneration {
|
|
|
3489
3639
|
inputs: AiTextGenerationInput;
|
|
3490
3640
|
postProcessedOutputs: AiTextGenerationOutput;
|
|
3491
3641
|
}
|
|
3642
|
+
type AiTextToSpeechInput = {
|
|
3643
|
+
prompt: string;
|
|
3644
|
+
lang?: string;
|
|
3645
|
+
};
|
|
3646
|
+
type AiTextToSpeechOutput =
|
|
3647
|
+
| Uint8Array
|
|
3648
|
+
| {
|
|
3649
|
+
audio: string;
|
|
3650
|
+
};
|
|
3651
|
+
declare abstract class BaseAiTextToSpeech {
|
|
3652
|
+
inputs: AiTextToSpeechInput;
|
|
3653
|
+
postProcessedOutputs: AiTextToSpeechOutput;
|
|
3654
|
+
}
|
|
3492
3655
|
type AiTextToImageInput = {
|
|
3493
3656
|
prompt: string;
|
|
3657
|
+
negative_prompt?: string;
|
|
3658
|
+
height?: number;
|
|
3659
|
+
width?: number;
|
|
3494
3660
|
image?: number[];
|
|
3661
|
+
image_b64?: string;
|
|
3495
3662
|
mask?: number[];
|
|
3496
3663
|
num_steps?: number;
|
|
3497
3664
|
strength?: number;
|
|
3498
3665
|
guidance?: number;
|
|
3666
|
+
seed?: number;
|
|
3499
3667
|
};
|
|
3500
|
-
type AiTextToImageOutput = Uint8Array
|
|
3668
|
+
type AiTextToImageOutput = ReadableStream<Uint8Array>;
|
|
3501
3669
|
declare abstract class BaseAiTextToImage {
|
|
3502
3670
|
inputs: AiTextToImageInput;
|
|
3503
3671
|
postProcessedOutputs: AiTextToImageOutput;
|
|
@@ -3514,126 +3682,613 @@ declare abstract class BaseAiTranslation {
|
|
|
3514
3682
|
inputs: AiTranslationInput;
|
|
3515
3683
|
postProcessedOutputs: AiTranslationOutput;
|
|
3516
3684
|
}
|
|
3685
|
+
type Ai_Cf_Openai_Whisper_Input =
|
|
3686
|
+
| string
|
|
3687
|
+
| {
|
|
3688
|
+
/**
|
|
3689
|
+
* An array of integers that represent the audio data constrained to 8-bit unsigned integer values
|
|
3690
|
+
*/
|
|
3691
|
+
audio: number[];
|
|
3692
|
+
};
|
|
3693
|
+
interface Ai_Cf_Openai_Whisper_Output {
|
|
3694
|
+
/**
|
|
3695
|
+
* The transcription
|
|
3696
|
+
*/
|
|
3697
|
+
text: string;
|
|
3698
|
+
word_count?: number;
|
|
3699
|
+
words?: {
|
|
3700
|
+
word?: string;
|
|
3701
|
+
/**
|
|
3702
|
+
* The second this word begins in the recording
|
|
3703
|
+
*/
|
|
3704
|
+
start?: number;
|
|
3705
|
+
/**
|
|
3706
|
+
* The ending second when the word completes
|
|
3707
|
+
*/
|
|
3708
|
+
end?: number;
|
|
3709
|
+
}[];
|
|
3710
|
+
vtt?: string;
|
|
3711
|
+
}
|
|
3712
|
+
declare abstract class Base_Ai_Cf_Openai_Whisper {
|
|
3713
|
+
inputs: Ai_Cf_Openai_Whisper_Input;
|
|
3714
|
+
postProcessedOutputs: Ai_Cf_Openai_Whisper_Output;
|
|
3715
|
+
}
|
|
3716
|
+
type Ai_Cf_Openai_Whisper_Tiny_En_Input =
|
|
3717
|
+
| string
|
|
3718
|
+
| {
|
|
3719
|
+
/**
|
|
3720
|
+
* An array of integers that represent the audio data constrained to 8-bit unsigned integer values
|
|
3721
|
+
*/
|
|
3722
|
+
audio: number[];
|
|
3723
|
+
};
|
|
3724
|
+
interface Ai_Cf_Openai_Whisper_Tiny_En_Output {
|
|
3725
|
+
/**
|
|
3726
|
+
* The transcription
|
|
3727
|
+
*/
|
|
3728
|
+
text: string;
|
|
3729
|
+
word_count?: number;
|
|
3730
|
+
words?: {
|
|
3731
|
+
word?: string;
|
|
3732
|
+
/**
|
|
3733
|
+
* The second this word begins in the recording
|
|
3734
|
+
*/
|
|
3735
|
+
start?: number;
|
|
3736
|
+
/**
|
|
3737
|
+
* The ending second when the word completes
|
|
3738
|
+
*/
|
|
3739
|
+
end?: number;
|
|
3740
|
+
}[];
|
|
3741
|
+
vtt?: string;
|
|
3742
|
+
}
|
|
3743
|
+
declare abstract class Base_Ai_Cf_Openai_Whisper_Tiny_En {
|
|
3744
|
+
inputs: Ai_Cf_Openai_Whisper_Tiny_En_Input;
|
|
3745
|
+
postProcessedOutputs: Ai_Cf_Openai_Whisper_Tiny_En_Output;
|
|
3746
|
+
}
|
|
3747
|
+
interface Ai_Cf_Openai_Whisper_Large_V3_Turbo_Input {
|
|
3748
|
+
/**
|
|
3749
|
+
* Base64 encoded value of the audio data.
|
|
3750
|
+
*/
|
|
3751
|
+
audio: string;
|
|
3752
|
+
/**
|
|
3753
|
+
* Supported tasks are 'translate' or 'transcribe'.
|
|
3754
|
+
*/
|
|
3755
|
+
task?: string;
|
|
3756
|
+
/**
|
|
3757
|
+
* The language of the audio being transcribed or translated.
|
|
3758
|
+
*/
|
|
3759
|
+
language?: string;
|
|
3760
|
+
/**
|
|
3761
|
+
* Preprocess the audio with a voice activity detection model.
|
|
3762
|
+
*/
|
|
3763
|
+
vad_filter?: string;
|
|
3764
|
+
/**
|
|
3765
|
+
* A text prompt to help provide context to the model on the contents of the audio.
|
|
3766
|
+
*/
|
|
3767
|
+
initial_prompt?: string;
|
|
3768
|
+
/**
|
|
3769
|
+
* The prefix it appended the the beginning of the output of the transcription and can guide the transcription result.
|
|
3770
|
+
*/
|
|
3771
|
+
prefix?: string;
|
|
3772
|
+
}
|
|
3773
|
+
interface Ai_Cf_Openai_Whisper_Large_V3_Turbo_Output {
|
|
3774
|
+
transcription_info?: {
|
|
3775
|
+
/**
|
|
3776
|
+
* The language of the audio being transcribed or translated.
|
|
3777
|
+
*/
|
|
3778
|
+
language?: string;
|
|
3779
|
+
/**
|
|
3780
|
+
* The confidence level or probability of the detected language being accurate, represented as a decimal between 0 and 1.
|
|
3781
|
+
*/
|
|
3782
|
+
language_probability?: number;
|
|
3783
|
+
/**
|
|
3784
|
+
* The total duration of the original audio file, in seconds.
|
|
3785
|
+
*/
|
|
3786
|
+
duration?: number;
|
|
3787
|
+
/**
|
|
3788
|
+
* The duration of the audio after applying Voice Activity Detection (VAD) to remove silent or irrelevant sections, in seconds.
|
|
3789
|
+
*/
|
|
3790
|
+
duration_after_vad?: number;
|
|
3791
|
+
};
|
|
3792
|
+
/**
|
|
3793
|
+
* The complete transcription of the audio.
|
|
3794
|
+
*/
|
|
3795
|
+
text: string;
|
|
3796
|
+
/**
|
|
3797
|
+
* The total number of words in the transcription.
|
|
3798
|
+
*/
|
|
3799
|
+
word_count?: number;
|
|
3800
|
+
segments?: {
|
|
3801
|
+
/**
|
|
3802
|
+
* The starting time of the segment within the audio, in seconds.
|
|
3803
|
+
*/
|
|
3804
|
+
start?: number;
|
|
3805
|
+
/**
|
|
3806
|
+
* The ending time of the segment within the audio, in seconds.
|
|
3807
|
+
*/
|
|
3808
|
+
end?: number;
|
|
3809
|
+
/**
|
|
3810
|
+
* The transcription of the segment.
|
|
3811
|
+
*/
|
|
3812
|
+
text?: string;
|
|
3813
|
+
/**
|
|
3814
|
+
* The temperature used in the decoding process, controlling randomness in predictions. Lower values result in more deterministic outputs.
|
|
3815
|
+
*/
|
|
3816
|
+
temperature?: number;
|
|
3817
|
+
/**
|
|
3818
|
+
* The average log probability of the predictions for the words in this segment, indicating overall confidence.
|
|
3819
|
+
*/
|
|
3820
|
+
avg_logprob?: number;
|
|
3821
|
+
/**
|
|
3822
|
+
* The compression ratio of the input to the output, measuring how much the text was compressed during the transcription process.
|
|
3823
|
+
*/
|
|
3824
|
+
compression_ratio?: number;
|
|
3825
|
+
/**
|
|
3826
|
+
* The probability that the segment contains no speech, represented as a decimal between 0 and 1.
|
|
3827
|
+
*/
|
|
3828
|
+
no_speech_prob?: number;
|
|
3829
|
+
words?: {
|
|
3830
|
+
/**
|
|
3831
|
+
* The individual word transcribed from the audio.
|
|
3832
|
+
*/
|
|
3833
|
+
word?: string;
|
|
3834
|
+
/**
|
|
3835
|
+
* The starting time of the word within the audio, in seconds.
|
|
3836
|
+
*/
|
|
3837
|
+
start?: number;
|
|
3838
|
+
/**
|
|
3839
|
+
* The ending time of the word within the audio, in seconds.
|
|
3840
|
+
*/
|
|
3841
|
+
end?: number;
|
|
3842
|
+
}[];
|
|
3843
|
+
};
|
|
3844
|
+
/**
|
|
3845
|
+
* The transcription in WebVTT format, which includes timing and text information for use in subtitles.
|
|
3846
|
+
*/
|
|
3847
|
+
vtt?: string;
|
|
3848
|
+
}
|
|
3849
|
+
declare abstract class Base_Ai_Cf_Openai_Whisper_Large_V3_Turbo {
|
|
3850
|
+
inputs: Ai_Cf_Openai_Whisper_Large_V3_Turbo_Input;
|
|
3851
|
+
postProcessedOutputs: Ai_Cf_Openai_Whisper_Large_V3_Turbo_Output;
|
|
3852
|
+
}
|
|
3853
|
+
interface Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Input {
|
|
3854
|
+
/**
|
|
3855
|
+
* A text description of the image you want to generate.
|
|
3856
|
+
*/
|
|
3857
|
+
prompt: string;
|
|
3858
|
+
/**
|
|
3859
|
+
* The number of diffusion steps; higher values can improve quality but take longer.
|
|
3860
|
+
*/
|
|
3861
|
+
steps?: number;
|
|
3862
|
+
}
|
|
3863
|
+
interface Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Output {
|
|
3864
|
+
/**
|
|
3865
|
+
* The generated image in Base64 format.
|
|
3866
|
+
*/
|
|
3867
|
+
image?: string;
|
|
3868
|
+
}
|
|
3869
|
+
declare abstract class Base_Ai_Cf_Black_Forest_Labs_Flux_1_Schnell {
|
|
3870
|
+
inputs: Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Input;
|
|
3871
|
+
postProcessedOutputs: Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Output;
|
|
3872
|
+
}
|
|
3873
|
+
type Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Input = Prompt | Messages;
|
|
3874
|
+
interface Prompt {
|
|
3875
|
+
/**
|
|
3876
|
+
* The input text prompt for the model to generate a response.
|
|
3877
|
+
*/
|
|
3878
|
+
prompt: string;
|
|
3879
|
+
image?: number[] | (string & NonNullable<unknown>);
|
|
3880
|
+
/**
|
|
3881
|
+
* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
|
|
3882
|
+
*/
|
|
3883
|
+
raw?: boolean;
|
|
3884
|
+
/**
|
|
3885
|
+
* If true, the response will be streamed back incrementally using SSE, Server Sent Events.
|
|
3886
|
+
*/
|
|
3887
|
+
stream?: boolean;
|
|
3888
|
+
/**
|
|
3889
|
+
* The maximum number of tokens to generate in the response.
|
|
3890
|
+
*/
|
|
3891
|
+
max_tokens?: number;
|
|
3892
|
+
/**
|
|
3893
|
+
* Controls the randomness of the output; higher values produce more random results.
|
|
3894
|
+
*/
|
|
3895
|
+
temperature?: number;
|
|
3896
|
+
/**
|
|
3897
|
+
* Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
|
|
3898
|
+
*/
|
|
3899
|
+
top_p?: number;
|
|
3900
|
+
/**
|
|
3901
|
+
* Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
|
|
3902
|
+
*/
|
|
3903
|
+
top_k?: number;
|
|
3904
|
+
/**
|
|
3905
|
+
* Random seed for reproducibility of the generation.
|
|
3906
|
+
*/
|
|
3907
|
+
seed?: number;
|
|
3908
|
+
/**
|
|
3909
|
+
* Penalty for repeated tokens; higher values discourage repetition.
|
|
3910
|
+
*/
|
|
3911
|
+
repetition_penalty?: number;
|
|
3912
|
+
/**
|
|
3913
|
+
* Decreases the likelihood of the model repeating the same lines verbatim.
|
|
3914
|
+
*/
|
|
3915
|
+
frequency_penalty?: number;
|
|
3916
|
+
/**
|
|
3917
|
+
* Increases the likelihood of the model introducing new topics.
|
|
3918
|
+
*/
|
|
3919
|
+
presence_penalty?: number;
|
|
3920
|
+
/**
|
|
3921
|
+
* Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model.
|
|
3922
|
+
*/
|
|
3923
|
+
lora?: string;
|
|
3924
|
+
}
|
|
3925
|
+
interface Messages {
|
|
3926
|
+
/**
|
|
3927
|
+
* An array of message objects representing the conversation history.
|
|
3928
|
+
*/
|
|
3929
|
+
messages: {
|
|
3930
|
+
/**
|
|
3931
|
+
* The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
|
|
3932
|
+
*/
|
|
3933
|
+
role: string;
|
|
3934
|
+
/**
|
|
3935
|
+
* The content of the message as a string.
|
|
3936
|
+
*/
|
|
3937
|
+
content: string;
|
|
3938
|
+
}[];
|
|
3939
|
+
image?: number[] | string;
|
|
3940
|
+
functions?: {
|
|
3941
|
+
name: string;
|
|
3942
|
+
code: string;
|
|
3943
|
+
}[];
|
|
3944
|
+
/**
|
|
3945
|
+
* A list of tools available for the assistant to use.
|
|
3946
|
+
*/
|
|
3947
|
+
tools?: (
|
|
3948
|
+
| {
|
|
3949
|
+
/**
|
|
3950
|
+
* The name of the tool. More descriptive the better.
|
|
3951
|
+
*/
|
|
3952
|
+
name: string;
|
|
3953
|
+
/**
|
|
3954
|
+
* A brief description of what the tool does.
|
|
3955
|
+
*/
|
|
3956
|
+
description: string;
|
|
3957
|
+
/**
|
|
3958
|
+
* Schema defining the parameters accepted by the tool.
|
|
3959
|
+
*/
|
|
3960
|
+
parameters: {
|
|
3961
|
+
/**
|
|
3962
|
+
* The type of the parameters object (usually 'object').
|
|
3963
|
+
*/
|
|
3964
|
+
type: string;
|
|
3965
|
+
/**
|
|
3966
|
+
* List of required parameter names.
|
|
3967
|
+
*/
|
|
3968
|
+
required?: string[];
|
|
3969
|
+
/**
|
|
3970
|
+
* Definitions of each parameter.
|
|
3971
|
+
*/
|
|
3972
|
+
properties: {
|
|
3973
|
+
[k: string]: {
|
|
3974
|
+
/**
|
|
3975
|
+
* The data type of the parameter.
|
|
3976
|
+
*/
|
|
3977
|
+
type: string;
|
|
3978
|
+
/**
|
|
3979
|
+
* A description of the expected parameter.
|
|
3980
|
+
*/
|
|
3981
|
+
description: string;
|
|
3982
|
+
};
|
|
3983
|
+
};
|
|
3984
|
+
};
|
|
3985
|
+
}
|
|
3986
|
+
| {
|
|
3987
|
+
/**
|
|
3988
|
+
* Specifies the type of tool (e.g., 'function').
|
|
3989
|
+
*/
|
|
3990
|
+
type: string;
|
|
3991
|
+
/**
|
|
3992
|
+
* Details of the function tool.
|
|
3993
|
+
*/
|
|
3994
|
+
function: {
|
|
3995
|
+
/**
|
|
3996
|
+
* The name of the function.
|
|
3997
|
+
*/
|
|
3998
|
+
name: string;
|
|
3999
|
+
/**
|
|
4000
|
+
* A brief description of what the function does.
|
|
4001
|
+
*/
|
|
4002
|
+
description: string;
|
|
4003
|
+
/**
|
|
4004
|
+
* Schema defining the parameters accepted by the function.
|
|
4005
|
+
*/
|
|
4006
|
+
parameters: {
|
|
4007
|
+
/**
|
|
4008
|
+
* The type of the parameters object (usually 'object').
|
|
4009
|
+
*/
|
|
4010
|
+
type: string;
|
|
4011
|
+
/**
|
|
4012
|
+
* List of required parameter names.
|
|
4013
|
+
*/
|
|
4014
|
+
required?: string[];
|
|
4015
|
+
/**
|
|
4016
|
+
* Definitions of each parameter.
|
|
4017
|
+
*/
|
|
4018
|
+
properties: {
|
|
4019
|
+
[k: string]: {
|
|
4020
|
+
/**
|
|
4021
|
+
* The data type of the parameter.
|
|
4022
|
+
*/
|
|
4023
|
+
type: string;
|
|
4024
|
+
/**
|
|
4025
|
+
* A description of the expected parameter.
|
|
4026
|
+
*/
|
|
4027
|
+
description: string;
|
|
4028
|
+
};
|
|
4029
|
+
};
|
|
4030
|
+
};
|
|
4031
|
+
};
|
|
4032
|
+
}
|
|
4033
|
+
)[];
|
|
4034
|
+
/**
|
|
4035
|
+
* If true, the response will be streamed back incrementally.
|
|
4036
|
+
*/
|
|
4037
|
+
stream?: boolean;
|
|
4038
|
+
/**
|
|
4039
|
+
* The maximum number of tokens to generate in the response.
|
|
4040
|
+
*/
|
|
4041
|
+
max_tokens?: number;
|
|
4042
|
+
/**
|
|
4043
|
+
* Controls the randomness of the output; higher values produce more random results.
|
|
4044
|
+
*/
|
|
4045
|
+
temperature?: number;
|
|
4046
|
+
/**
|
|
4047
|
+
* Controls the creativity of the AI's responses by adjusting how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
|
|
4048
|
+
*/
|
|
4049
|
+
top_p?: number;
|
|
4050
|
+
/**
|
|
4051
|
+
* Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
|
|
4052
|
+
*/
|
|
4053
|
+
top_k?: number;
|
|
4054
|
+
/**
|
|
4055
|
+
* Random seed for reproducibility of the generation.
|
|
4056
|
+
*/
|
|
4057
|
+
seed?: number;
|
|
4058
|
+
/**
|
|
4059
|
+
* Penalty for repeated tokens; higher values discourage repetition.
|
|
4060
|
+
*/
|
|
4061
|
+
repetition_penalty?: number;
|
|
4062
|
+
/**
|
|
4063
|
+
* Decreases the likelihood of the model repeating the same lines verbatim.
|
|
4064
|
+
*/
|
|
4065
|
+
frequency_penalty?: number;
|
|
4066
|
+
/**
|
|
4067
|
+
* Increases the likelihood of the model introducing new topics.
|
|
4068
|
+
*/
|
|
4069
|
+
presence_penalty?: number;
|
|
4070
|
+
}
|
|
4071
|
+
type Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Output =
|
|
4072
|
+
| {
|
|
4073
|
+
/**
|
|
4074
|
+
* The generated text response from the model
|
|
4075
|
+
*/
|
|
4076
|
+
response?: string;
|
|
4077
|
+
/**
|
|
4078
|
+
* An array of tool calls requests made during the response generation
|
|
4079
|
+
*/
|
|
4080
|
+
tool_calls?: {
|
|
4081
|
+
/**
|
|
4082
|
+
* The arguments passed to be passed to the tool call request
|
|
4083
|
+
*/
|
|
4084
|
+
arguments?: object;
|
|
4085
|
+
/**
|
|
4086
|
+
* The name of the tool to be called
|
|
4087
|
+
*/
|
|
4088
|
+
name?: string;
|
|
4089
|
+
}[];
|
|
4090
|
+
}
|
|
4091
|
+
| ReadableStream;
|
|
4092
|
+
declare abstract class Base_Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct {
|
|
4093
|
+
inputs: Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Input;
|
|
4094
|
+
postProcessedOutputs: Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Output;
|
|
4095
|
+
}
|
|
4096
|
+
interface AiModels {
|
|
4097
|
+
"@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
|
|
4098
|
+
"@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
|
|
4099
|
+
"@cf/runwayml/stable-diffusion-v1-5-inpainting": BaseAiTextToImage;
|
|
4100
|
+
"@cf/runwayml/stable-diffusion-v1-5-img2img": BaseAiTextToImage;
|
|
4101
|
+
"@cf/lykon/dreamshaper-8-lcm": BaseAiTextToImage;
|
|
4102
|
+
"@cf/bytedance/stable-diffusion-xl-lightning": BaseAiTextToImage;
|
|
4103
|
+
"@cf/baai/bge-base-en-v1.5": BaseAiTextEmbeddings;
|
|
4104
|
+
"@cf/baai/bge-small-en-v1.5": BaseAiTextEmbeddings;
|
|
4105
|
+
"@cf/baai/bge-large-en-v1.5": BaseAiTextEmbeddings;
|
|
4106
|
+
"@cf/microsoft/resnet-50": BaseAiImageClassification;
|
|
4107
|
+
"@cf/facebook/detr-resnet-50": BaseAiObjectDetection;
|
|
4108
|
+
"@cf/meta/llama-2-7b-chat-int8": BaseAiTextGeneration;
|
|
4109
|
+
"@cf/mistral/mistral-7b-instruct-v0.1": BaseAiTextGeneration;
|
|
4110
|
+
"@cf/meta/llama-2-7b-chat-fp16": BaseAiTextGeneration;
|
|
4111
|
+
"@hf/thebloke/llama-2-13b-chat-awq": BaseAiTextGeneration;
|
|
4112
|
+
"@hf/thebloke/mistral-7b-instruct-v0.1-awq": BaseAiTextGeneration;
|
|
4113
|
+
"@hf/thebloke/zephyr-7b-beta-awq": BaseAiTextGeneration;
|
|
4114
|
+
"@hf/thebloke/openhermes-2.5-mistral-7b-awq": BaseAiTextGeneration;
|
|
4115
|
+
"@hf/thebloke/neural-chat-7b-v3-1-awq": BaseAiTextGeneration;
|
|
4116
|
+
"@hf/thebloke/llamaguard-7b-awq": BaseAiTextGeneration;
|
|
4117
|
+
"@hf/thebloke/deepseek-coder-6.7b-base-awq": BaseAiTextGeneration;
|
|
4118
|
+
"@hf/thebloke/deepseek-coder-6.7b-instruct-awq": BaseAiTextGeneration;
|
|
4119
|
+
"@cf/deepseek-ai/deepseek-math-7b-instruct": BaseAiTextGeneration;
|
|
4120
|
+
"@cf/defog/sqlcoder-7b-2": BaseAiTextGeneration;
|
|
4121
|
+
"@cf/openchat/openchat-3.5-0106": BaseAiTextGeneration;
|
|
4122
|
+
"@cf/tiiuae/falcon-7b-instruct": BaseAiTextGeneration;
|
|
4123
|
+
"@cf/thebloke/discolm-german-7b-v1-awq": BaseAiTextGeneration;
|
|
4124
|
+
"@cf/qwen/qwen1.5-0.5b-chat": BaseAiTextGeneration;
|
|
4125
|
+
"@cf/qwen/qwen1.5-7b-chat-awq": BaseAiTextGeneration;
|
|
4126
|
+
"@cf/qwen/qwen1.5-14b-chat-awq": BaseAiTextGeneration;
|
|
4127
|
+
"@cf/tinyllama/tinyllama-1.1b-chat-v1.0": BaseAiTextGeneration;
|
|
4128
|
+
"@cf/microsoft/phi-2": BaseAiTextGeneration;
|
|
4129
|
+
"@cf/qwen/qwen1.5-1.8b-chat": BaseAiTextGeneration;
|
|
4130
|
+
"@cf/mistral/mistral-7b-instruct-v0.2-lora": BaseAiTextGeneration;
|
|
4131
|
+
"@hf/nousresearch/hermes-2-pro-mistral-7b": BaseAiTextGeneration;
|
|
4132
|
+
"@hf/nexusflow/starling-lm-7b-beta": BaseAiTextGeneration;
|
|
4133
|
+
"@hf/google/gemma-7b-it": BaseAiTextGeneration;
|
|
4134
|
+
"@cf/meta-llama/llama-2-7b-chat-hf-lora": BaseAiTextGeneration;
|
|
4135
|
+
"@cf/google/gemma-2b-it-lora": BaseAiTextGeneration;
|
|
4136
|
+
"@cf/google/gemma-7b-it-lora": BaseAiTextGeneration;
|
|
4137
|
+
"@hf/mistral/mistral-7b-instruct-v0.2": BaseAiTextGeneration;
|
|
4138
|
+
"@cf/meta/llama-3-8b-instruct": BaseAiTextGeneration;
|
|
4139
|
+
"@cf/fblgit/una-cybertron-7b-v2-bf16": BaseAiTextGeneration;
|
|
4140
|
+
"@cf/meta/llama-3-8b-instruct-awq": BaseAiTextGeneration;
|
|
4141
|
+
"@hf/meta-llama/meta-llama-3-8b-instruct": BaseAiTextGeneration;
|
|
4142
|
+
"@cf/meta/llama-3.1-8b-instruct": BaseAiTextGeneration;
|
|
4143
|
+
"@cf/meta/llama-3.1-8b-instruct-fp8": BaseAiTextGeneration;
|
|
4144
|
+
"@cf/meta/llama-3.1-8b-instruct-awq": BaseAiTextGeneration;
|
|
4145
|
+
"@cf/meta/llama-3.2-3b-instruct": BaseAiTextGeneration;
|
|
4146
|
+
"@cf/meta/llama-3.2-1b-instruct": BaseAiTextGeneration;
|
|
4147
|
+
"@cf/meta/llama-3.3-70b-instruct-fp8-fast": BaseAiTextGeneration;
|
|
4148
|
+
"@cf/meta/m2m100-1.2b": BaseAiTranslation;
|
|
4149
|
+
"@cf/facebook/bart-large-cnn": BaseAiSummarization;
|
|
4150
|
+
"@cf/unum/uform-gen2-qwen-500m": BaseAiImageToText;
|
|
4151
|
+
"@cf/llava-hf/llava-1.5-7b-hf": BaseAiImageToText;
|
|
4152
|
+
"@cf/openai/whisper": Base_Ai_Cf_Openai_Whisper;
|
|
4153
|
+
"@cf/openai/whisper-tiny-en": Base_Ai_Cf_Openai_Whisper_Tiny_En;
|
|
4154
|
+
"@cf/openai/whisper-large-v3-turbo": Base_Ai_Cf_Openai_Whisper_Large_V3_Turbo;
|
|
4155
|
+
"@cf/black-forest-labs/flux-1-schnell": Base_Ai_Cf_Black_Forest_Labs_Flux_1_Schnell;
|
|
4156
|
+
"@cf/meta/llama-3.2-11b-vision-instruct": Base_Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct;
|
|
4157
|
+
}
|
|
4158
|
+
type AiOptions = {
|
|
4159
|
+
gateway?: GatewayOptions;
|
|
4160
|
+
prefix?: string;
|
|
4161
|
+
extraHeaders?: object;
|
|
4162
|
+
};
|
|
4163
|
+
type AiModelsSearchParams = {
|
|
4164
|
+
author?: string;
|
|
4165
|
+
hide_experimental?: boolean;
|
|
4166
|
+
page?: number;
|
|
4167
|
+
per_page?: number;
|
|
4168
|
+
search?: string;
|
|
4169
|
+
source?: number;
|
|
4170
|
+
task?: string;
|
|
4171
|
+
};
|
|
4172
|
+
type AiModelsSearchObject = {
|
|
4173
|
+
id: string;
|
|
4174
|
+
source: number;
|
|
4175
|
+
name: string;
|
|
4176
|
+
description: string;
|
|
4177
|
+
task: {
|
|
4178
|
+
id: string;
|
|
4179
|
+
name: string;
|
|
4180
|
+
description: string;
|
|
4181
|
+
};
|
|
4182
|
+
tags: string[];
|
|
4183
|
+
properties: {
|
|
4184
|
+
property_id: string;
|
|
4185
|
+
value: string;
|
|
4186
|
+
}[];
|
|
4187
|
+
};
|
|
4188
|
+
interface InferenceUpstreamError extends Error {}
|
|
4189
|
+
interface AiInternalError extends Error {}
|
|
4190
|
+
type AiModelListType = Record<string, any>;
|
|
4191
|
+
declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
|
|
4192
|
+
aiGatewayLogId: string | null;
|
|
4193
|
+
gateway(gatewayId: string): AiGateway;
|
|
4194
|
+
run<Name extends keyof AiModelList>(
|
|
4195
|
+
model: Name,
|
|
4196
|
+
inputs: AiModelList[Name]["inputs"],
|
|
4197
|
+
options?: AiOptions,
|
|
4198
|
+
): Promise<AiModelList[Name]["postProcessedOutputs"]>;
|
|
4199
|
+
public models(params?: AiModelsSearchParams): Promise<AiModelsSearchObject[]>;
|
|
4200
|
+
}
|
|
3517
4201
|
type GatewayOptions = {
|
|
3518
4202
|
id: string;
|
|
4203
|
+
cacheKey?: string;
|
|
3519
4204
|
cacheTtl?: number;
|
|
3520
4205
|
skipCache?: boolean;
|
|
3521
4206
|
metadata?: Record<string, number | string | boolean | null | bigint>;
|
|
4207
|
+
collectLog?: boolean;
|
|
3522
4208
|
};
|
|
3523
|
-
type
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
4209
|
+
type AiGatewayPatchLog = {
|
|
4210
|
+
score?: number | null;
|
|
4211
|
+
feedback?: -1 | 1 | null;
|
|
4212
|
+
metadata?: Record<string, number | string | boolean | null | bigint> | null;
|
|
3527
4213
|
};
|
|
3528
|
-
type
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
| "
|
|
3557
|
-
| "
|
|
3558
|
-
| "
|
|
3559
|
-
| "
|
|
3560
|
-
| "
|
|
3561
|
-
| "
|
|
3562
|
-
| "
|
|
3563
|
-
| "
|
|
3564
|
-
| "
|
|
3565
|
-
| "
|
|
3566
|
-
| "
|
|
3567
|
-
| "
|
|
3568
|
-
| "
|
|
3569
|
-
| "
|
|
3570
|
-
| "
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
): Promise<
|
|
3602
|
-
|
|
3603
|
-
model: BaseAiSpeechRecognitionModels,
|
|
3604
|
-
inputs: BaseAiSpeechRecognition["inputs"],
|
|
3605
|
-
options?: AiOptions,
|
|
3606
|
-
): Promise<BaseAiSpeechRecognition["postProcessedOutputs"]>;
|
|
3607
|
-
run(
|
|
3608
|
-
model: BaseAiImageClassificationModels,
|
|
3609
|
-
inputs: BaseAiImageClassification["inputs"],
|
|
3610
|
-
options?: AiOptions,
|
|
3611
|
-
): Promise<BaseAiImageClassification["postProcessedOutputs"]>;
|
|
3612
|
-
run(
|
|
3613
|
-
model: BaseAiObjectDetectionModels,
|
|
3614
|
-
inputs: BaseAiObjectDetection["inputs"],
|
|
3615
|
-
options?: AiOptions,
|
|
3616
|
-
): Promise<BaseAiObjectDetection["postProcessedOutputs"]>;
|
|
3617
|
-
run(
|
|
3618
|
-
model: BaseAiTextGenerationModels,
|
|
3619
|
-
inputs: BaseAiTextGeneration["inputs"],
|
|
3620
|
-
options?: AiOptions,
|
|
3621
|
-
): Promise<BaseAiTextGeneration["postProcessedOutputs"]>;
|
|
3622
|
-
run(
|
|
3623
|
-
model: BaseAiTranslationModels,
|
|
3624
|
-
inputs: BaseAiTranslation["inputs"],
|
|
3625
|
-
options?: AiOptions,
|
|
3626
|
-
): Promise<BaseAiTranslation["postProcessedOutputs"]>;
|
|
3627
|
-
run(
|
|
3628
|
-
model: BaseAiSummarizationModels,
|
|
3629
|
-
inputs: BaseAiSummarization["inputs"],
|
|
3630
|
-
options?: AiOptions,
|
|
3631
|
-
): Promise<BaseAiSummarization["postProcessedOutputs"]>;
|
|
4214
|
+
type AiGatewayLog = {
|
|
4215
|
+
id: string;
|
|
4216
|
+
provider: string;
|
|
4217
|
+
model: string;
|
|
4218
|
+
model_type?: string;
|
|
4219
|
+
path: string;
|
|
4220
|
+
duration: number;
|
|
4221
|
+
request_type?: string;
|
|
4222
|
+
request_content_type?: string;
|
|
4223
|
+
status_code: number;
|
|
4224
|
+
response_content_type?: string;
|
|
4225
|
+
success: boolean;
|
|
4226
|
+
cached: boolean;
|
|
4227
|
+
tokens_in?: number;
|
|
4228
|
+
tokens_out?: number;
|
|
4229
|
+
metadata?: Record<string, number | string | boolean | null | bigint>;
|
|
4230
|
+
step?: number;
|
|
4231
|
+
cost?: number;
|
|
4232
|
+
custom_cost?: boolean;
|
|
4233
|
+
request_size: number;
|
|
4234
|
+
request_head?: string;
|
|
4235
|
+
request_head_complete: boolean;
|
|
4236
|
+
response_size: number;
|
|
4237
|
+
response_head?: string;
|
|
4238
|
+
response_head_complete: boolean;
|
|
4239
|
+
created_at: Date;
|
|
4240
|
+
};
|
|
4241
|
+
type AIGatewayProviders =
|
|
4242
|
+
| "workers-ai"
|
|
4243
|
+
| "anthropic"
|
|
4244
|
+
| "aws-bedrock"
|
|
4245
|
+
| "azure-openai"
|
|
4246
|
+
| "google-vertex-ai"
|
|
4247
|
+
| "huggingface"
|
|
4248
|
+
| "openai"
|
|
4249
|
+
| "perplexity-ai"
|
|
4250
|
+
| "replicate"
|
|
4251
|
+
| "groq"
|
|
4252
|
+
| "cohere"
|
|
4253
|
+
| "google-ai-studio"
|
|
4254
|
+
| "mistral"
|
|
4255
|
+
| "grok"
|
|
4256
|
+
| "openrouter";
|
|
4257
|
+
type AIGatewayHeaders = {
|
|
4258
|
+
"cf-aig-metadata":
|
|
4259
|
+
| Record<string, number | string | boolean | null | bigint>
|
|
4260
|
+
| string;
|
|
4261
|
+
"cf-aig-custom-cost":
|
|
4262
|
+
| {
|
|
4263
|
+
per_token_in?: number;
|
|
4264
|
+
per_token_out?: number;
|
|
4265
|
+
}
|
|
4266
|
+
| {
|
|
4267
|
+
total_cost?: number;
|
|
4268
|
+
}
|
|
4269
|
+
| string;
|
|
4270
|
+
"cf-aig-cache-ttl": number | string;
|
|
4271
|
+
"cf-aig-skip-cache": boolean | string;
|
|
4272
|
+
"cf-aig-cache-key": string;
|
|
4273
|
+
"cf-aig-collect-log": boolean | string;
|
|
4274
|
+
Authorization: string;
|
|
4275
|
+
"Content-Type": string;
|
|
4276
|
+
[key: string]: string | number | boolean | object;
|
|
4277
|
+
};
|
|
4278
|
+
type AIGatewayUniversalRequest = {
|
|
4279
|
+
provider: AIGatewayProviders | string; // eslint-disable-line
|
|
4280
|
+
endpoint: string;
|
|
4281
|
+
headers: Partial<AIGatewayHeaders>;
|
|
4282
|
+
query: unknown;
|
|
4283
|
+
};
|
|
4284
|
+
interface AiGatewayInternalError extends Error {}
|
|
4285
|
+
interface AiGatewayLogNotFound extends Error {}
|
|
4286
|
+
declare abstract class AiGateway {
|
|
4287
|
+
patchLog(logId: string, data: AiGatewayPatchLog): Promise<void>;
|
|
4288
|
+
getLog(logId: string): Promise<AiGatewayLog>;
|
|
3632
4289
|
run(
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
options?: AiOptions,
|
|
3636
|
-
): Promise<BaseAiImageToText["postProcessedOutputs"]>;
|
|
4290
|
+
data: AIGatewayUniversalRequest | AIGatewayUniversalRequest[],
|
|
4291
|
+
): Promise<Response>;
|
|
3637
4292
|
}
|
|
3638
4293
|
interface BasicImageTransformations {
|
|
3639
4294
|
/**
|
|
@@ -4639,7 +5294,7 @@ declare abstract class D1PreparedStatement {
|
|
|
4639
5294
|
bind(...values: unknown[]): D1PreparedStatement;
|
|
4640
5295
|
first<T = unknown>(colName: string): Promise<T | null>;
|
|
4641
5296
|
first<T = Record<string, unknown>>(): Promise<T | null>;
|
|
4642
|
-
run(): Promise<
|
|
5297
|
+
run<T = Record<string, unknown>>(): Promise<D1Result<T>>;
|
|
4643
5298
|
all<T = Record<string, unknown>>(): Promise<D1Result<T>>;
|
|
4644
5299
|
raw<T = unknown[]>(options: {
|
|
4645
5300
|
columnNames: true;
|
|
@@ -4695,6 +5350,12 @@ interface ForwardableEmailMessage extends EmailMessage {
|
|
|
4695
5350
|
* @returns A promise that resolves when the email message is forwarded.
|
|
4696
5351
|
*/
|
|
4697
5352
|
forward(rcptTo: string, headers?: Headers): Promise<void>;
|
|
5353
|
+
/**
|
|
5354
|
+
* Reply to the sender of this email message with a new EmailMessage object.
|
|
5355
|
+
* @param message The reply message.
|
|
5356
|
+
* @returns A promise that resolves when the email message is replied.
|
|
5357
|
+
*/
|
|
5358
|
+
reply(message: EmailMessage): Promise<void>;
|
|
4698
5359
|
}
|
|
4699
5360
|
/**
|
|
4700
5361
|
* A binding that allows a Worker to send email messages.
|
|
@@ -4764,6 +5425,128 @@ interface Hyperdrive {
|
|
|
4764
5425
|
*/
|
|
4765
5426
|
readonly database: string;
|
|
4766
5427
|
}
|
|
5428
|
+
// Copyright (c) 2024 Cloudflare, Inc.
|
|
5429
|
+
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
|
5430
|
+
// https://opensource.org/licenses/Apache-2.0
|
|
5431
|
+
type ImageInfoResponse =
|
|
5432
|
+
| {
|
|
5433
|
+
format: "image/svg+xml";
|
|
5434
|
+
}
|
|
5435
|
+
| {
|
|
5436
|
+
format: string;
|
|
5437
|
+
fileSize: number;
|
|
5438
|
+
width: number;
|
|
5439
|
+
height: number;
|
|
5440
|
+
};
|
|
5441
|
+
type ImageTransform = {
|
|
5442
|
+
fit?: "scale-down" | "contain" | "pad" | "squeeze" | "cover" | "crop";
|
|
5443
|
+
gravity?:
|
|
5444
|
+
| "left"
|
|
5445
|
+
| "right"
|
|
5446
|
+
| "top"
|
|
5447
|
+
| "bottom"
|
|
5448
|
+
| "center"
|
|
5449
|
+
| "auto"
|
|
5450
|
+
| "entropy"
|
|
5451
|
+
| "face"
|
|
5452
|
+
| {
|
|
5453
|
+
x?: number;
|
|
5454
|
+
y?: number;
|
|
5455
|
+
mode: "remainder" | "box-center";
|
|
5456
|
+
};
|
|
5457
|
+
trim?: {
|
|
5458
|
+
top?: number;
|
|
5459
|
+
bottom?: number;
|
|
5460
|
+
left?: number;
|
|
5461
|
+
right?: number;
|
|
5462
|
+
width?: number;
|
|
5463
|
+
height?: number;
|
|
5464
|
+
border?:
|
|
5465
|
+
| boolean
|
|
5466
|
+
| {
|
|
5467
|
+
color?: string;
|
|
5468
|
+
tolerance?: number;
|
|
5469
|
+
keep?: number;
|
|
5470
|
+
};
|
|
5471
|
+
};
|
|
5472
|
+
width?: number;
|
|
5473
|
+
height?: number;
|
|
5474
|
+
background?: string;
|
|
5475
|
+
rotate?: number;
|
|
5476
|
+
sharpen?: number;
|
|
5477
|
+
blur?: number;
|
|
5478
|
+
contrast?: number;
|
|
5479
|
+
brightness?: number;
|
|
5480
|
+
gamma?: number;
|
|
5481
|
+
border?: {
|
|
5482
|
+
color?: string;
|
|
5483
|
+
width?: number;
|
|
5484
|
+
top?: number;
|
|
5485
|
+
bottom?: number;
|
|
5486
|
+
left?: number;
|
|
5487
|
+
right?: number;
|
|
5488
|
+
};
|
|
5489
|
+
zoom?: number;
|
|
5490
|
+
};
|
|
5491
|
+
type ImageOutputOptions = {
|
|
5492
|
+
format:
|
|
5493
|
+
| "image/jpeg"
|
|
5494
|
+
| "image/png"
|
|
5495
|
+
| "image/gif"
|
|
5496
|
+
| "image/webp"
|
|
5497
|
+
| "image/avif"
|
|
5498
|
+
| "rgb"
|
|
5499
|
+
| "rgba";
|
|
5500
|
+
quality?: number;
|
|
5501
|
+
background?: string;
|
|
5502
|
+
};
|
|
5503
|
+
interface ImagesBinding {
|
|
5504
|
+
/**
|
|
5505
|
+
* Get image metadata (type, width and height)
|
|
5506
|
+
* @throws {@link ImagesError} with code 9412 if input is not an image
|
|
5507
|
+
* @param stream The image bytes
|
|
5508
|
+
*/
|
|
5509
|
+
info(stream: ReadableStream<Uint8Array>): Promise<ImageInfoResponse>;
|
|
5510
|
+
/**
|
|
5511
|
+
* Begin applying a series of transformations to an image
|
|
5512
|
+
* @param stream The image bytes
|
|
5513
|
+
* @returns A transform handle
|
|
5514
|
+
*/
|
|
5515
|
+
input(stream: ReadableStream<Uint8Array>): ImageTransformer;
|
|
5516
|
+
}
|
|
5517
|
+
interface ImageTransformer {
|
|
5518
|
+
/**
|
|
5519
|
+
* Apply transform next, returning a transform handle.
|
|
5520
|
+
* You can then apply more transformations or retrieve the output.
|
|
5521
|
+
* @param transform
|
|
5522
|
+
*/
|
|
5523
|
+
transform(transform: ImageTransform): ImageTransformer;
|
|
5524
|
+
/**
|
|
5525
|
+
* Retrieve the image that results from applying the transforms to the
|
|
5526
|
+
* provided input
|
|
5527
|
+
* @param options Options that apply to the output e.g. output format
|
|
5528
|
+
*/
|
|
5529
|
+
output(options: ImageOutputOptions): Promise<ImageTransformationResult>;
|
|
5530
|
+
}
|
|
5531
|
+
interface ImageTransformationResult {
|
|
5532
|
+
/**
|
|
5533
|
+
* The image as a response, ready to store in cache or return to users
|
|
5534
|
+
*/
|
|
5535
|
+
response(): Response;
|
|
5536
|
+
/**
|
|
5537
|
+
* The content type of the returned image
|
|
5538
|
+
*/
|
|
5539
|
+
contentType(): string;
|
|
5540
|
+
/**
|
|
5541
|
+
* The bytes of the response
|
|
5542
|
+
*/
|
|
5543
|
+
image(): ReadableStream<Uint8Array>;
|
|
5544
|
+
}
|
|
5545
|
+
interface ImagesError extends Error {
|
|
5546
|
+
readonly code: number;
|
|
5547
|
+
readonly message: string;
|
|
5548
|
+
readonly stack?: string;
|
|
5549
|
+
}
|
|
4767
5550
|
type Params<P extends string = any> = Record<P, string | string[]>;
|
|
4768
5551
|
type EventContext<Env, P extends string, Data> = {
|
|
4769
5552
|
request: Request<unknown, IncomingRequestCfProperties<unknown>>;
|
|
@@ -4810,6 +5593,30 @@ type PagesPluginFunction<
|
|
|
4810
5593
|
declare module "assets:*" {
|
|
4811
5594
|
export const onRequest: PagesFunction;
|
|
4812
5595
|
}
|
|
5596
|
+
// Copyright (c) 2022-2023 Cloudflare, Inc.
|
|
5597
|
+
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
|
5598
|
+
// https://opensource.org/licenses/Apache-2.0
|
|
5599
|
+
declare abstract class PipelineTransform {
|
|
5600
|
+
/**
|
|
5601
|
+
* transformJson recieves an array of javascript objects which can be
|
|
5602
|
+
* mutated and returned to the pipeline
|
|
5603
|
+
* @param data The data to be mutated
|
|
5604
|
+
* @returns A promise containing the mutated data
|
|
5605
|
+
*/
|
|
5606
|
+
public transformJson(data: object[]): Promise<object[]>;
|
|
5607
|
+
}
|
|
5608
|
+
// Copyright (c) 2022-2023 Cloudflare, Inc.
|
|
5609
|
+
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
|
5610
|
+
// https://opensource.org/licenses/Apache-2.0
|
|
5611
|
+
interface Pipeline {
|
|
5612
|
+
/**
|
|
5613
|
+
* send takes an array of javascript objects which are
|
|
5614
|
+
* then received by the pipeline for processing
|
|
5615
|
+
*
|
|
5616
|
+
* @param data The data to be sent
|
|
5617
|
+
*/
|
|
5618
|
+
send(data: object[]): Promise<void>;
|
|
5619
|
+
}
|
|
4813
5620
|
// PubSubMessage represents an incoming PubSub message.
|
|
4814
5621
|
// The message includes metadata about the broker, the client, and the payload
|
|
4815
5622
|
// itself.
|
|
@@ -4870,6 +5677,7 @@ declare namespace Rpc {
|
|
|
4870
5677
|
export const __RPC_TARGET_BRAND: "__RPC_TARGET_BRAND";
|
|
4871
5678
|
export const __WORKER_ENTRYPOINT_BRAND: "__WORKER_ENTRYPOINT_BRAND";
|
|
4872
5679
|
export const __DURABLE_OBJECT_BRAND: "__DURABLE_OBJECT_BRAND";
|
|
5680
|
+
export const __WORKFLOW_ENTRYPOINT_BRAND: "__WORKFLOW_ENTRYPOINT_BRAND";
|
|
4873
5681
|
export interface RpcTargetBranded {
|
|
4874
5682
|
[__RPC_TARGET_BRAND]: never;
|
|
4875
5683
|
}
|
|
@@ -4879,13 +5687,20 @@ declare namespace Rpc {
|
|
|
4879
5687
|
export interface DurableObjectBranded {
|
|
4880
5688
|
[__DURABLE_OBJECT_BRAND]: never;
|
|
4881
5689
|
}
|
|
5690
|
+
export interface WorkflowEntrypointBranded {
|
|
5691
|
+
[__WORKFLOW_ENTRYPOINT_BRAND]: never;
|
|
5692
|
+
}
|
|
4882
5693
|
export type EntrypointBranded =
|
|
4883
5694
|
| WorkerEntrypointBranded
|
|
4884
|
-
| DurableObjectBranded
|
|
5695
|
+
| DurableObjectBranded
|
|
5696
|
+
| WorkflowEntrypointBranded;
|
|
4885
5697
|
// Types that can be used through `Stub`s
|
|
4886
5698
|
export type Stubable = RpcTargetBranded | ((...args: any[]) => any);
|
|
4887
5699
|
// Types that can be passed over RPC
|
|
4888
|
-
type
|
|
5700
|
+
// The reason for using a generic type here is to build a serializable subset of structured
|
|
5701
|
+
// cloneable composite types. This allows types defined with the "interface" keyword to pass the
|
|
5702
|
+
// serializable check as well. Otherwise, only types defined with the "type" keyword would pass.
|
|
5703
|
+
type Serializable<T> =
|
|
4889
5704
|
// Structured cloneables
|
|
4890
5705
|
| void
|
|
4891
5706
|
| undefined
|
|
@@ -4901,11 +5716,14 @@ declare namespace Rpc {
|
|
|
4901
5716
|
| Error
|
|
4902
5717
|
| RegExp
|
|
4903
5718
|
// Structured cloneable composites
|
|
4904
|
-
| Map<
|
|
4905
|
-
|
|
4906
|
-
|
|
5719
|
+
| Map<
|
|
5720
|
+
T extends Map<infer U, unknown> ? Serializable<U> : never,
|
|
5721
|
+
T extends Map<unknown, infer U> ? Serializable<U> : never
|
|
5722
|
+
>
|
|
5723
|
+
| Set<T extends Set<infer U> ? Serializable<U> : never>
|
|
5724
|
+
| ReadonlyArray<T extends ReadonlyArray<infer U> ? Serializable<U> : never>
|
|
4907
5725
|
| {
|
|
4908
|
-
[
|
|
5726
|
+
[K in keyof T]: K extends number | string ? Serializable<T[K]> : never;
|
|
4909
5727
|
}
|
|
4910
5728
|
// Special types
|
|
4911
5729
|
| ReadableStream<Uint8Array>
|
|
@@ -4935,7 +5753,7 @@ declare namespace Rpc {
|
|
|
4935
5753
|
: T extends ReadonlyArray<infer V>
|
|
4936
5754
|
? ReadonlyArray<Stubify<V>>
|
|
4937
5755
|
: T extends {
|
|
4938
|
-
[key: string | number]:
|
|
5756
|
+
[key: string | number]: any;
|
|
4939
5757
|
}
|
|
4940
5758
|
? {
|
|
4941
5759
|
[K in keyof T]: Stubify<T[K]>;
|
|
@@ -4978,7 +5796,7 @@ declare namespace Rpc {
|
|
|
4978
5796
|
// Intersecting with `(Maybe)Provider` allows pipelining.
|
|
4979
5797
|
type Result<R> = R extends Stubable
|
|
4980
5798
|
? Promise<Stub<R>> & Provider<R>
|
|
4981
|
-
: R extends Serializable
|
|
5799
|
+
: R extends Serializable<R>
|
|
4982
5800
|
? Promise<Stubify<R> & MaybeDisposable<R>> & MaybeProvider<R>
|
|
4983
5801
|
: never;
|
|
4984
5802
|
// Type for method or property on an RPC interface.
|
|
@@ -5038,7 +5856,7 @@ declare module "cloudflare:workers" {
|
|
|
5038
5856
|
protected env: Env;
|
|
5039
5857
|
constructor(ctx: DurableObjectState, env: Env);
|
|
5040
5858
|
fetch?(request: Request): Response | Promise<Response>;
|
|
5041
|
-
alarm?(): void | Promise<void>;
|
|
5859
|
+
alarm?(alarmInfo?: AlarmInvocationInfo): void | Promise<void>;
|
|
5042
5860
|
webSocketMessage?(
|
|
5043
5861
|
ws: WebSocket,
|
|
5044
5862
|
message: string | ArrayBuffer,
|
|
@@ -5051,6 +5869,60 @@ declare module "cloudflare:workers" {
|
|
|
5051
5869
|
): void | Promise<void>;
|
|
5052
5870
|
webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>;
|
|
5053
5871
|
}
|
|
5872
|
+
export type WorkflowDurationLabel =
|
|
5873
|
+
| "second"
|
|
5874
|
+
| "minute"
|
|
5875
|
+
| "hour"
|
|
5876
|
+
| "day"
|
|
5877
|
+
| "week"
|
|
5878
|
+
| "month"
|
|
5879
|
+
| "year";
|
|
5880
|
+
export type WorkflowSleepDuration =
|
|
5881
|
+
| `${number} ${WorkflowDurationLabel}${"s" | ""}`
|
|
5882
|
+
| number;
|
|
5883
|
+
export type WorkflowDelayDuration = WorkflowSleepDuration;
|
|
5884
|
+
export type WorkflowTimeoutDuration = WorkflowSleepDuration;
|
|
5885
|
+
export type WorkflowBackoff = "constant" | "linear" | "exponential";
|
|
5886
|
+
export type WorkflowStepConfig = {
|
|
5887
|
+
retries?: {
|
|
5888
|
+
limit: number;
|
|
5889
|
+
delay: WorkflowDelayDuration | number;
|
|
5890
|
+
backoff?: WorkflowBackoff;
|
|
5891
|
+
};
|
|
5892
|
+
timeout?: WorkflowTimeoutDuration | number;
|
|
5893
|
+
};
|
|
5894
|
+
export type WorkflowEvent<T> = {
|
|
5895
|
+
payload: Readonly<T>;
|
|
5896
|
+
timestamp: Date;
|
|
5897
|
+
instanceId: string;
|
|
5898
|
+
};
|
|
5899
|
+
export abstract class WorkflowStep {
|
|
5900
|
+
do<T extends Rpc.Serializable<T>>(
|
|
5901
|
+
name: string,
|
|
5902
|
+
callback: () => Promise<T>,
|
|
5903
|
+
): Promise<T>;
|
|
5904
|
+
do<T extends Rpc.Serializable<T>>(
|
|
5905
|
+
name: string,
|
|
5906
|
+
config: WorkflowStepConfig,
|
|
5907
|
+
callback: () => Promise<T>,
|
|
5908
|
+
): Promise<T>;
|
|
5909
|
+
sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;
|
|
5910
|
+
sleepUntil: (name: string, timestamp: Date | number) => Promise<void>;
|
|
5911
|
+
}
|
|
5912
|
+
export abstract class WorkflowEntrypoint<
|
|
5913
|
+
Env = unknown,
|
|
5914
|
+
T extends Rpc.Serializable<T> | unknown = unknown,
|
|
5915
|
+
> implements Rpc.WorkflowEntrypointBranded
|
|
5916
|
+
{
|
|
5917
|
+
[Rpc.__WORKFLOW_ENTRYPOINT_BRAND]: never;
|
|
5918
|
+
protected ctx: ExecutionContext;
|
|
5919
|
+
protected env: Env;
|
|
5920
|
+
constructor(ctx: ExecutionContext, env: Env);
|
|
5921
|
+
run(
|
|
5922
|
+
event: Readonly<WorkflowEvent<T>>,
|
|
5923
|
+
step: WorkflowStep,
|
|
5924
|
+
): Promise<unknown>;
|
|
5925
|
+
}
|
|
5054
5926
|
}
|
|
5055
5927
|
declare module "cloudflare:sockets" {
|
|
5056
5928
|
function _connect(
|
|
@@ -5059,6 +5931,198 @@ declare module "cloudflare:sockets" {
|
|
|
5059
5931
|
): Socket;
|
|
5060
5932
|
export { _connect as connect };
|
|
5061
5933
|
}
|
|
5934
|
+
declare namespace TailStream {
|
|
5935
|
+
interface Header {
|
|
5936
|
+
readonly name: string;
|
|
5937
|
+
readonly value: string;
|
|
5938
|
+
}
|
|
5939
|
+
interface FetchEventInfo {
|
|
5940
|
+
readonly type: "fetch";
|
|
5941
|
+
readonly method: string;
|
|
5942
|
+
readonly url: string;
|
|
5943
|
+
readonly cfJson: string;
|
|
5944
|
+
readonly headers: Header[];
|
|
5945
|
+
}
|
|
5946
|
+
interface JsRpcEventInfo {
|
|
5947
|
+
readonly type: "jsrpc";
|
|
5948
|
+
readonly methodName: string;
|
|
5949
|
+
}
|
|
5950
|
+
interface ScheduledEventInfo {
|
|
5951
|
+
readonly type: "scheduled";
|
|
5952
|
+
readonly scheduledTime: Date;
|
|
5953
|
+
readonly cron: string;
|
|
5954
|
+
}
|
|
5955
|
+
interface AlarmEventInfo {
|
|
5956
|
+
readonly type: "alarm";
|
|
5957
|
+
readonly scheduledTime: Date;
|
|
5958
|
+
}
|
|
5959
|
+
interface QueueEventInfo {
|
|
5960
|
+
readonly type: "queue";
|
|
5961
|
+
readonly queueName: string;
|
|
5962
|
+
readonly batchSize: number;
|
|
5963
|
+
}
|
|
5964
|
+
interface EmailEventInfo {
|
|
5965
|
+
readonly type: "email";
|
|
5966
|
+
readonly mailFrom: string;
|
|
5967
|
+
readonly rcptTo: string;
|
|
5968
|
+
readonly rawSize: number;
|
|
5969
|
+
}
|
|
5970
|
+
interface TraceEventInfo {
|
|
5971
|
+
readonly type: "trace";
|
|
5972
|
+
readonly traces: (string | null)[];
|
|
5973
|
+
}
|
|
5974
|
+
interface HibernatableWebSocketEventInfoMessage {
|
|
5975
|
+
readonly type: "message";
|
|
5976
|
+
}
|
|
5977
|
+
interface HibernatableWebSocketEventInfoError {
|
|
5978
|
+
readonly type: "error";
|
|
5979
|
+
}
|
|
5980
|
+
interface HibernatableWebSocketEventInfoClose {
|
|
5981
|
+
readonly type: "close";
|
|
5982
|
+
readonly code: number;
|
|
5983
|
+
readonly wasClean: boolean;
|
|
5984
|
+
}
|
|
5985
|
+
interface HibernatableWebSocketEventInfo {
|
|
5986
|
+
readonly type: "hibernatableWebSocket";
|
|
5987
|
+
readonly info:
|
|
5988
|
+
| HibernatableWebSocketEventInfoClose
|
|
5989
|
+
| HibernatableWebSocketEventInfoError
|
|
5990
|
+
| HibernatableWebSocketEventInfoMessage;
|
|
5991
|
+
}
|
|
5992
|
+
interface Resume {
|
|
5993
|
+
readonly type: "resume";
|
|
5994
|
+
readonly attachment?: any;
|
|
5995
|
+
}
|
|
5996
|
+
interface CustomEventInfo {
|
|
5997
|
+
readonly type: "custom";
|
|
5998
|
+
}
|
|
5999
|
+
interface FetchResponseInfo {
|
|
6000
|
+
readonly type: "fetch";
|
|
6001
|
+
readonly statusCode: number;
|
|
6002
|
+
}
|
|
6003
|
+
type EventOutcome =
|
|
6004
|
+
| "ok"
|
|
6005
|
+
| "canceled"
|
|
6006
|
+
| "exception"
|
|
6007
|
+
| "unknown"
|
|
6008
|
+
| "killSwitch"
|
|
6009
|
+
| "daemonDown"
|
|
6010
|
+
| "exceededCpu"
|
|
6011
|
+
| "exceededMemory"
|
|
6012
|
+
| "loadShed"
|
|
6013
|
+
| "responseStreamDisconnected"
|
|
6014
|
+
| "scriptNotFound";
|
|
6015
|
+
interface ScriptVersion {
|
|
6016
|
+
readonly id: string;
|
|
6017
|
+
readonly tag?: string;
|
|
6018
|
+
readonly message?: string;
|
|
6019
|
+
}
|
|
6020
|
+
interface Trigger {
|
|
6021
|
+
readonly traceId: string;
|
|
6022
|
+
readonly invocationId: string;
|
|
6023
|
+
readonly spanId: string;
|
|
6024
|
+
}
|
|
6025
|
+
interface Onset {
|
|
6026
|
+
readonly type: "onset";
|
|
6027
|
+
readonly dispatchNamespace?: string;
|
|
6028
|
+
readonly entrypoint?: string;
|
|
6029
|
+
readonly scriptName?: string;
|
|
6030
|
+
readonly scriptTags?: string[];
|
|
6031
|
+
readonly scriptVersion?: ScriptVersion;
|
|
6032
|
+
readonly trigger?: Trigger;
|
|
6033
|
+
readonly info:
|
|
6034
|
+
| FetchEventInfo
|
|
6035
|
+
| JsRpcEventInfo
|
|
6036
|
+
| ScheduledEventInfo
|
|
6037
|
+
| AlarmEventInfo
|
|
6038
|
+
| QueueEventInfo
|
|
6039
|
+
| EmailEventInfo
|
|
6040
|
+
| TraceEventInfo
|
|
6041
|
+
| HibernatableWebSocketEventInfo
|
|
6042
|
+
| Resume
|
|
6043
|
+
| CustomEventInfo;
|
|
6044
|
+
}
|
|
6045
|
+
interface Outcome {
|
|
6046
|
+
readonly type: "outcome";
|
|
6047
|
+
readonly outcome: EventOutcome;
|
|
6048
|
+
readonly cpuTime: number;
|
|
6049
|
+
readonly wallTime: number;
|
|
6050
|
+
}
|
|
6051
|
+
interface Hibernate {
|
|
6052
|
+
readonly type: "hibernate";
|
|
6053
|
+
}
|
|
6054
|
+
interface SpanOpen {
|
|
6055
|
+
readonly type: "spanOpen";
|
|
6056
|
+
readonly op?: string;
|
|
6057
|
+
readonly info?: FetchEventInfo | JsRpcEventInfo | Attribute[];
|
|
6058
|
+
}
|
|
6059
|
+
interface SpanClose {
|
|
6060
|
+
readonly type: "spanClose";
|
|
6061
|
+
readonly outcome: EventOutcome;
|
|
6062
|
+
}
|
|
6063
|
+
interface DiagnosticChannelEvent {
|
|
6064
|
+
readonly type: "diagnosticChannel";
|
|
6065
|
+
readonly channel: string;
|
|
6066
|
+
readonly message: any;
|
|
6067
|
+
}
|
|
6068
|
+
interface Exception {
|
|
6069
|
+
readonly type: "exception";
|
|
6070
|
+
readonly name: string;
|
|
6071
|
+
readonly message: string;
|
|
6072
|
+
readonly stack?: string;
|
|
6073
|
+
}
|
|
6074
|
+
interface Log {
|
|
6075
|
+
readonly type: "log";
|
|
6076
|
+
readonly level: "debug" | "error" | "info" | "log" | "warn";
|
|
6077
|
+
readonly message: string;
|
|
6078
|
+
}
|
|
6079
|
+
interface Return {
|
|
6080
|
+
readonly type: "return";
|
|
6081
|
+
readonly info?: FetchResponseInfo | Attribute[];
|
|
6082
|
+
}
|
|
6083
|
+
interface Link {
|
|
6084
|
+
readonly type: "link";
|
|
6085
|
+
readonly label?: string;
|
|
6086
|
+
readonly traceId: string;
|
|
6087
|
+
readonly invocationId: string;
|
|
6088
|
+
readonly spanId: string;
|
|
6089
|
+
}
|
|
6090
|
+
interface Attribute {
|
|
6091
|
+
readonly type: "attribute";
|
|
6092
|
+
readonly name: string;
|
|
6093
|
+
readonly value: string | string[] | boolean | boolean[] | number | number[];
|
|
6094
|
+
}
|
|
6095
|
+
type Mark =
|
|
6096
|
+
| DiagnosticChannelEvent
|
|
6097
|
+
| Exception
|
|
6098
|
+
| Log
|
|
6099
|
+
| Return
|
|
6100
|
+
| Link
|
|
6101
|
+
| Attribute[];
|
|
6102
|
+
interface TailEvent {
|
|
6103
|
+
readonly traceId: string;
|
|
6104
|
+
readonly invocationId: string;
|
|
6105
|
+
readonly spanId: string;
|
|
6106
|
+
readonly timestamp: Date;
|
|
6107
|
+
readonly sequence: number;
|
|
6108
|
+
readonly event: Onset | Outcome | Hibernate | SpanOpen | SpanClose | Mark;
|
|
6109
|
+
}
|
|
6110
|
+
type TailEventHandler = (event: TailEvent) => void | Promise<void>;
|
|
6111
|
+
type TailEventHandlerName =
|
|
6112
|
+
| "onset"
|
|
6113
|
+
| "outcome"
|
|
6114
|
+
| "hibernate"
|
|
6115
|
+
| "spanOpen"
|
|
6116
|
+
| "spanClose"
|
|
6117
|
+
| "diagnosticChannel"
|
|
6118
|
+
| "exception"
|
|
6119
|
+
| "log"
|
|
6120
|
+
| "return"
|
|
6121
|
+
| "link"
|
|
6122
|
+
| "attribute";
|
|
6123
|
+
type TailEventHandlerObject = Record<TailEventHandlerName, TailEventHandler>;
|
|
6124
|
+
type TailEventHandlerType = TailEventHandler | TailEventHandlerObject;
|
|
6125
|
+
}
|
|
5062
6126
|
// Copyright (c) 2022-2023 Cloudflare, Inc.
|
|
5063
6127
|
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
|
5064
6128
|
// https://opensource.org/licenses/Apache-2.0
|
|
@@ -5102,11 +6166,21 @@ type VectorizeVectorMetadataFilter = {
|
|
|
5102
6166
|
* Distance metrics determine how other "similar" vectors are determined.
|
|
5103
6167
|
*/
|
|
5104
6168
|
type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
|
|
6169
|
+
/**
|
|
6170
|
+
* Metadata return levels for a Vectorize query.
|
|
6171
|
+
*
|
|
6172
|
+
* Default to "none".
|
|
6173
|
+
*
|
|
6174
|
+
* @property all Full metadata for the vector return set, including all fields (including those un-indexed) without truncation. This is a more expensive retrieval, as it requires additional fetching & reading of un-indexed data.
|
|
6175
|
+
* @property indexed Return all metadata fields configured for indexing in the vector return set. This level of retrieval is "free" in that no additional overhead is incurred returning this data. However, note that indexed metadata is subject to truncation (especially for larger strings).
|
|
6176
|
+
* @property none No indexed metadata will be returned.
|
|
6177
|
+
*/
|
|
6178
|
+
type VectorizeMetadataRetrievalLevel = "all" | "indexed" | "none";
|
|
5105
6179
|
interface VectorizeQueryOptions {
|
|
5106
6180
|
topK?: number;
|
|
5107
6181
|
namespace?: string;
|
|
5108
6182
|
returnValues?: boolean;
|
|
5109
|
-
returnMetadata?: boolean;
|
|
6183
|
+
returnMetadata?: boolean | VectorizeMetadataRetrievalLevel;
|
|
5110
6184
|
filter?: VectorizeVectorMetadataFilter;
|
|
5111
6185
|
}
|
|
5112
6186
|
/**
|
|
@@ -5122,6 +6196,9 @@ type VectorizeIndexConfig =
|
|
|
5122
6196
|
};
|
|
5123
6197
|
/**
|
|
5124
6198
|
* Metadata about an existing index.
|
|
6199
|
+
*
|
|
6200
|
+
* This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released.
|
|
6201
|
+
* See {@link VectorizeIndexInfo} for its post-beta equivalent.
|
|
5125
6202
|
*/
|
|
5126
6203
|
interface VectorizeIndexDetails {
|
|
5127
6204
|
/** The unique ID of the index */
|
|
@@ -5135,6 +6212,19 @@ interface VectorizeIndexDetails {
|
|
|
5135
6212
|
/** The number of records containing vectors within the index. */
|
|
5136
6213
|
vectorsCount: number;
|
|
5137
6214
|
}
|
|
6215
|
+
/**
|
|
6216
|
+
* Metadata about an existing index.
|
|
6217
|
+
*/
|
|
6218
|
+
interface VectorizeIndexInfo {
|
|
6219
|
+
/** The number of records containing vectors within the index. */
|
|
6220
|
+
vectorCount: number;
|
|
6221
|
+
/** Number of dimensions the index has been configured for. */
|
|
6222
|
+
dimensions: number;
|
|
6223
|
+
/** ISO 8601 datetime of the last processed mutation on in the index. All changes before this mutation will be reflected in the index state. */
|
|
6224
|
+
processedUpToDatetime: number;
|
|
6225
|
+
/** UUIDv4 of the last mutation processed by the index. All changes before this mutation will be reflected in the index state. */
|
|
6226
|
+
processedUpToMutation: number;
|
|
6227
|
+
}
|
|
5138
6228
|
/**
|
|
5139
6229
|
* Represents a single vector value set along with its associated metadata.
|
|
5140
6230
|
*/
|
|
@@ -5145,7 +6235,7 @@ interface VectorizeVector {
|
|
|
5145
6235
|
values: VectorFloatArray | number[];
|
|
5146
6236
|
/** The namespace this vector belongs to. */
|
|
5147
6237
|
namespace?: string;
|
|
5148
|
-
/** Metadata associated with the vector. Includes the values of
|
|
6238
|
+
/** Metadata associated with the vector. Includes the values of other fields and potentially additional details. */
|
|
5149
6239
|
metadata?: Record<string, VectorizeVectorMetadata>;
|
|
5150
6240
|
}
|
|
5151
6241
|
/**
|
|
@@ -5157,7 +6247,7 @@ type VectorizeMatch = Pick<Partial<VectorizeVector>, "values"> &
|
|
|
5157
6247
|
score: number;
|
|
5158
6248
|
};
|
|
5159
6249
|
/**
|
|
5160
|
-
* A set of
|
|
6250
|
+
* A set of matching {@link VectorizeMatch} for a particular query.
|
|
5161
6251
|
*/
|
|
5162
6252
|
interface VectorizeMatches {
|
|
5163
6253
|
matches: VectorizeMatch[];
|
|
@@ -5166,6 +6256,9 @@ interface VectorizeMatches {
|
|
|
5166
6256
|
/**
|
|
5167
6257
|
* Results of an operation that performed a mutation on a set of vectors.
|
|
5168
6258
|
* Here, `ids` is a list of vectors that were successfully processed.
|
|
6259
|
+
*
|
|
6260
|
+
* This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released.
|
|
6261
|
+
* See {@link VectorizeAsyncMutation} for its post-beta equivalent.
|
|
5169
6262
|
*/
|
|
5170
6263
|
interface VectorizeVectorMutation {
|
|
5171
6264
|
/* List of ids of vectors that were successfully processed. */
|
|
@@ -5174,14 +6267,19 @@ interface VectorizeVectorMutation {
|
|
|
5174
6267
|
count: number;
|
|
5175
6268
|
}
|
|
5176
6269
|
/**
|
|
5177
|
-
*
|
|
5178
|
-
*
|
|
5179
|
-
* Here, `mutationId` is the identifier for the last mutation processed by Vectorize.
|
|
6270
|
+
* Result type indicating a mutation on the Vectorize Index.
|
|
6271
|
+
* Actual mutations are processed async where the `mutationId` is the unique identifier for the operation.
|
|
5180
6272
|
*/
|
|
5181
|
-
interface
|
|
5182
|
-
|
|
6273
|
+
interface VectorizeAsyncMutation {
|
|
6274
|
+
/** The unique identifier for the async mutation operation containing the changeset. */
|
|
5183
6275
|
mutationId: string;
|
|
5184
6276
|
}
|
|
6277
|
+
/**
|
|
6278
|
+
* A Vectorize Vector Search Index for querying vectors/embeddings.
|
|
6279
|
+
*
|
|
6280
|
+
* This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released.
|
|
6281
|
+
* See {@link Vectorize} for its new implementation.
|
|
6282
|
+
*/
|
|
5185
6283
|
declare abstract class VectorizeIndex {
|
|
5186
6284
|
/**
|
|
5187
6285
|
* Get information about the currently bound index.
|
|
@@ -5196,7 +6294,7 @@ declare abstract class VectorizeIndex {
|
|
|
5196
6294
|
*/
|
|
5197
6295
|
public query(
|
|
5198
6296
|
vector: VectorFloatArray | number[],
|
|
5199
|
-
options
|
|
6297
|
+
options?: VectorizeQueryOptions,
|
|
5200
6298
|
): Promise<VectorizeMatches>;
|
|
5201
6299
|
/**
|
|
5202
6300
|
* Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
|
|
@@ -5223,6 +6321,62 @@ declare abstract class VectorizeIndex {
|
|
|
5223
6321
|
*/
|
|
5224
6322
|
public getByIds(ids: string[]): Promise<VectorizeVector[]>;
|
|
5225
6323
|
}
|
|
6324
|
+
/**
|
|
6325
|
+
* A Vectorize Vector Search Index for querying vectors/embeddings.
|
|
6326
|
+
*
|
|
6327
|
+
* Mutations in this version are async, returning a mutation id.
|
|
6328
|
+
*/
|
|
6329
|
+
declare abstract class Vectorize {
|
|
6330
|
+
/**
|
|
6331
|
+
* Get information about the currently bound index.
|
|
6332
|
+
* @returns A promise that resolves with information about the current index.
|
|
6333
|
+
*/
|
|
6334
|
+
public describe(): Promise<VectorizeIndexInfo>;
|
|
6335
|
+
/**
|
|
6336
|
+
* Use the provided vector to perform a similarity search across the index.
|
|
6337
|
+
* @param vector Input vector that will be used to drive the similarity search.
|
|
6338
|
+
* @param options Configuration options to massage the returned data.
|
|
6339
|
+
* @returns A promise that resolves with matched and scored vectors.
|
|
6340
|
+
*/
|
|
6341
|
+
public query(
|
|
6342
|
+
vector: VectorFloatArray | number[],
|
|
6343
|
+
options?: VectorizeQueryOptions,
|
|
6344
|
+
): Promise<VectorizeMatches>;
|
|
6345
|
+
/**
|
|
6346
|
+
* Use the provided vector-id to perform a similarity search across the index.
|
|
6347
|
+
* @param vectorId Id for a vector in the index against which the index should be queried.
|
|
6348
|
+
* @param options Configuration options to massage the returned data.
|
|
6349
|
+
* @returns A promise that resolves with matched and scored vectors.
|
|
6350
|
+
*/
|
|
6351
|
+
public queryById(
|
|
6352
|
+
vectorId: string,
|
|
6353
|
+
options?: VectorizeQueryOptions,
|
|
6354
|
+
): Promise<VectorizeMatches>;
|
|
6355
|
+
/**
|
|
6356
|
+
* Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
|
|
6357
|
+
* @param vectors List of vectors that will be inserted.
|
|
6358
|
+
* @returns A promise that resolves with a unique identifier of a mutation containing the insert changeset.
|
|
6359
|
+
*/
|
|
6360
|
+
public insert(vectors: VectorizeVector[]): Promise<VectorizeAsyncMutation>;
|
|
6361
|
+
/**
|
|
6362
|
+
* Upsert a list of vectors into the index dataset. If a provided id exists, it will be replaced with the new values.
|
|
6363
|
+
* @param vectors List of vectors that will be upserted.
|
|
6364
|
+
* @returns A promise that resolves with a unique identifier of a mutation containing the upsert changeset.
|
|
6365
|
+
*/
|
|
6366
|
+
public upsert(vectors: VectorizeVector[]): Promise<VectorizeAsyncMutation>;
|
|
6367
|
+
/**
|
|
6368
|
+
* Delete a list of vectors with a matching id.
|
|
6369
|
+
* @param ids List of vector ids that should be deleted.
|
|
6370
|
+
* @returns A promise that resolves with a unique identifier of a mutation containing the delete changeset.
|
|
6371
|
+
*/
|
|
6372
|
+
public deleteByIds(ids: string[]): Promise<VectorizeAsyncMutation>;
|
|
6373
|
+
/**
|
|
6374
|
+
* Get a list of vectors with a matching id.
|
|
6375
|
+
* @param ids List of vector ids that should be returned.
|
|
6376
|
+
* @returns A promise that resolves with the raw unscored vectors matching the id set.
|
|
6377
|
+
*/
|
|
6378
|
+
public getByIds(ids: string[]): Promise<VectorizeVector[]>;
|
|
6379
|
+
}
|
|
5226
6380
|
/**
|
|
5227
6381
|
* The interface for "version_metadata" binding
|
|
5228
6382
|
* providing metadata about the Worker Version using this binding.
|
|
@@ -5273,3 +6427,79 @@ interface DispatchNamespace {
|
|
|
5273
6427
|
options?: DynamicDispatchOptions,
|
|
5274
6428
|
): Fetcher;
|
|
5275
6429
|
}
|
|
6430
|
+
declare module "cloudflare:workflows" {
|
|
6431
|
+
/**
|
|
6432
|
+
* NonRetryableError allows for a user to throw a fatal error
|
|
6433
|
+
* that makes a Workflow instance fail immediately without triggering a retry
|
|
6434
|
+
*/
|
|
6435
|
+
export class NonRetryableError extends Error {
|
|
6436
|
+
public constructor(message: string, name?: string);
|
|
6437
|
+
}
|
|
6438
|
+
}
|
|
6439
|
+
declare abstract class Workflow<PARAMS = unknown> {
|
|
6440
|
+
/**
|
|
6441
|
+
* Get a handle to an existing instance of the Workflow.
|
|
6442
|
+
* @param id Id for the instance of this Workflow
|
|
6443
|
+
* @returns A promise that resolves with a handle for the Instance
|
|
6444
|
+
*/
|
|
6445
|
+
public get(id: string): Promise<WorkflowInstance>;
|
|
6446
|
+
/**
|
|
6447
|
+
* Create a new instance and return a handle to it. If a provided id exists, an error will be thrown.
|
|
6448
|
+
* @param options Options when creating an instance including id and params
|
|
6449
|
+
* @returns A promise that resolves with a handle for the Instance
|
|
6450
|
+
*/
|
|
6451
|
+
public create(
|
|
6452
|
+
options?: WorkflowInstanceCreateOptions<PARAMS>,
|
|
6453
|
+
): Promise<WorkflowInstance>;
|
|
6454
|
+
}
|
|
6455
|
+
interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
|
|
6456
|
+
/**
|
|
6457
|
+
* An id for your Workflow instance. Must be unique within the Workflow.
|
|
6458
|
+
*/
|
|
6459
|
+
id?: string;
|
|
6460
|
+
/**
|
|
6461
|
+
* The event payload the Workflow instance is triggered with
|
|
6462
|
+
*/
|
|
6463
|
+
params?: PARAMS;
|
|
6464
|
+
}
|
|
6465
|
+
type InstanceStatus = {
|
|
6466
|
+
status:
|
|
6467
|
+
| "queued" // means that instance is waiting to be started (see concurrency limits)
|
|
6468
|
+
| "running"
|
|
6469
|
+
| "paused"
|
|
6470
|
+
| "errored"
|
|
6471
|
+
| "terminated" // user terminated the instance while it was running
|
|
6472
|
+
| "complete"
|
|
6473
|
+
| "waiting" // instance is hibernating and waiting for sleep or event to finish
|
|
6474
|
+
| "waitingForPause" // instance is finishing the current work to pause
|
|
6475
|
+
| "unknown";
|
|
6476
|
+
error?: string;
|
|
6477
|
+
output?: object;
|
|
6478
|
+
};
|
|
6479
|
+
interface WorkflowError {
|
|
6480
|
+
code?: number;
|
|
6481
|
+
message: string;
|
|
6482
|
+
}
|
|
6483
|
+
declare abstract class WorkflowInstance {
|
|
6484
|
+
public id: string;
|
|
6485
|
+
/**
|
|
6486
|
+
* Pause the instance.
|
|
6487
|
+
*/
|
|
6488
|
+
public pause(): Promise<void>;
|
|
6489
|
+
/**
|
|
6490
|
+
* Resume the instance. If it is already running, an error will be thrown.
|
|
6491
|
+
*/
|
|
6492
|
+
public resume(): Promise<void>;
|
|
6493
|
+
/**
|
|
6494
|
+
* Terminate the instance. If it is errored, terminated or complete, an error will be thrown.
|
|
6495
|
+
*/
|
|
6496
|
+
public terminate(): Promise<void>;
|
|
6497
|
+
/**
|
|
6498
|
+
* Restart the instance.
|
|
6499
|
+
*/
|
|
6500
|
+
public restart(): Promise<void>;
|
|
6501
|
+
/**
|
|
6502
|
+
* Returns the current status of the instance.
|
|
6503
|
+
*/
|
|
6504
|
+
public status(): Promise<InstanceStatus>;
|
|
6505
|
+
}
|