@cloudflare/workers-types 4.20260305.0 → 4.20260306.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/2021-11-03/index.d.ts +29 -14
- package/2021-11-03/index.ts +29 -14
- package/2022-01-31/index.d.ts +29 -14
- package/2022-01-31/index.ts +29 -14
- package/2022-03-21/index.d.ts +29 -14
- package/2022-03-21/index.ts +29 -14
- package/2022-08-04/index.d.ts +29 -14
- package/2022-08-04/index.ts +29 -14
- package/2022-10-31/index.d.ts +29 -14
- package/2022-10-31/index.ts +29 -14
- package/2022-11-30/index.d.ts +29 -14
- package/2022-11-30/index.ts +29 -14
- package/2023-03-01/index.d.ts +29 -14
- package/2023-03-01/index.ts +29 -14
- package/2023-07-01/index.d.ts +29 -14
- package/2023-07-01/index.ts +29 -14
- package/experimental/index.d.ts +34 -18
- package/experimental/index.ts +34 -18
- package/index.d.ts +29 -14
- package/index.ts +29 -14
- package/latest/index.d.ts +29 -14
- package/latest/index.ts +29 -14
- package/oldest/index.d.ts +29 -14
- package/oldest/index.ts +29 -14
- package/package.json +1 -1
package/2023-03-01/index.d.ts
CHANGED
|
@@ -3600,6 +3600,12 @@ interface WebSocket extends EventTarget<WebSocketEventMap> {
|
|
|
3600
3600
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
|
|
3601
3601
|
*/
|
|
3602
3602
|
extensions: string | null;
|
|
3603
|
+
/**
|
|
3604
|
+
* The **`WebSocket.binaryType`** property controls the type of binary data being received over the WebSocket connection.
|
|
3605
|
+
*
|
|
3606
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/binaryType)
|
|
3607
|
+
*/
|
|
3608
|
+
binaryType: "blob" | "arraybuffer";
|
|
3603
3609
|
}
|
|
3604
3610
|
declare const WebSocketPair: {
|
|
3605
3611
|
new (): {
|
|
@@ -3848,21 +3854,17 @@ declare abstract class Performance {
|
|
|
3848
3854
|
get timeOrigin(): number;
|
|
3849
3855
|
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
|
|
3850
3856
|
now(): number;
|
|
3857
|
+
/**
|
|
3858
|
+
* The **`toJSON()`** method of the Performance interface is a Serialization; it returns a JSON representation of the Performance object.
|
|
3859
|
+
*
|
|
3860
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/toJSON)
|
|
3861
|
+
*/
|
|
3862
|
+
toJSON(): object;
|
|
3851
3863
|
}
|
|
3852
3864
|
// AI Search V2 API Error Interfaces
|
|
3853
3865
|
interface AiSearchInternalError extends Error {}
|
|
3854
3866
|
interface AiSearchNotFoundError extends Error {}
|
|
3855
3867
|
interface AiSearchNameNotSetError extends Error {}
|
|
3856
|
-
// Filter types (shared with AutoRAG for compatibility)
|
|
3857
|
-
type ComparisonFilter = {
|
|
3858
|
-
key: string;
|
|
3859
|
-
type: "eq" | "ne" | "gt" | "gte" | "lt" | "lte";
|
|
3860
|
-
value: string | number | boolean;
|
|
3861
|
-
};
|
|
3862
|
-
type CompoundFilter = {
|
|
3863
|
-
type: "and" | "or";
|
|
3864
|
-
filters: ComparisonFilter[];
|
|
3865
|
-
};
|
|
3866
3868
|
// AI Search V2 Request Types
|
|
3867
3869
|
type AiSearchSearchRequest = {
|
|
3868
3870
|
messages: Array<{
|
|
@@ -3876,7 +3878,7 @@ type AiSearchSearchRequest = {
|
|
|
3876
3878
|
match_threshold?: number;
|
|
3877
3879
|
/** Maximum number of results (1-50, default 10) */
|
|
3878
3880
|
max_num_results?: number;
|
|
3879
|
-
filters?:
|
|
3881
|
+
filters?: VectorizeVectorMetadataFilter;
|
|
3880
3882
|
/** Context expansion (0-3, default 0) */
|
|
3881
3883
|
context_expansion?: number;
|
|
3882
3884
|
[key: string]: unknown;
|
|
@@ -3910,7 +3912,7 @@ type AiSearchChatCompletionsRequest = {
|
|
|
3910
3912
|
retrieval_type?: "vector" | "keyword" | "hybrid";
|
|
3911
3913
|
match_threshold?: number;
|
|
3912
3914
|
max_num_results?: number;
|
|
3913
|
-
filters?:
|
|
3915
|
+
filters?: VectorizeVectorMetadataFilter;
|
|
3914
3916
|
context_expansion?: number;
|
|
3915
3917
|
[key: string]: unknown;
|
|
3916
3918
|
};
|
|
@@ -9741,6 +9743,15 @@ interface AutoRAGUnauthorizedError extends Error {}
|
|
|
9741
9743
|
* @see AiSearchNameNotSetError
|
|
9742
9744
|
*/
|
|
9743
9745
|
interface AutoRAGNameNotSetError extends Error {}
|
|
9746
|
+
type ComparisonFilter = {
|
|
9747
|
+
key: string;
|
|
9748
|
+
type: "eq" | "ne" | "gt" | "gte" | "lt" | "lte";
|
|
9749
|
+
value: string | number | boolean;
|
|
9750
|
+
};
|
|
9751
|
+
type CompoundFilter = {
|
|
9752
|
+
type: "and" | "or";
|
|
9753
|
+
filters: ComparisonFilter[];
|
|
9754
|
+
};
|
|
9744
9755
|
/**
|
|
9745
9756
|
* @deprecated AutoRAG has been replaced by AI Search.
|
|
9746
9757
|
* Use AiSearchSearchRequest with the new API instead.
|
|
@@ -11960,15 +11971,18 @@ declare namespace CloudflareWorkersModule {
|
|
|
11960
11971
|
timestamp: Date;
|
|
11961
11972
|
type: string;
|
|
11962
11973
|
};
|
|
11974
|
+
export type WorkflowStepContext = {
|
|
11975
|
+
attempt: number;
|
|
11976
|
+
};
|
|
11963
11977
|
export abstract class WorkflowStep {
|
|
11964
11978
|
do<T extends Rpc.Serializable<T>>(
|
|
11965
11979
|
name: string,
|
|
11966
|
-
callback: () => Promise<T>,
|
|
11980
|
+
callback: (ctx: WorkflowStepContext) => Promise<T>,
|
|
11967
11981
|
): Promise<T>;
|
|
11968
11982
|
do<T extends Rpc.Serializable<T>>(
|
|
11969
11983
|
name: string,
|
|
11970
11984
|
config: WorkflowStepConfig,
|
|
11971
|
-
callback: () => Promise<T>,
|
|
11985
|
+
callback: (ctx: WorkflowStepContext) => Promise<T>,
|
|
11972
11986
|
): Promise<T>;
|
|
11973
11987
|
sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;
|
|
11974
11988
|
sleepUntil: (name: string, timestamp: Date | number) => Promise<void>;
|
|
@@ -12066,6 +12080,7 @@ type ConversionOptions = {
|
|
|
12066
12080
|
convertOGImage?: boolean;
|
|
12067
12081
|
};
|
|
12068
12082
|
hostname?: string;
|
|
12083
|
+
cssSelector?: string;
|
|
12069
12084
|
};
|
|
12070
12085
|
docx?: {
|
|
12071
12086
|
images?: EmbeddedImageConversionOptions;
|
package/2023-03-01/index.ts
CHANGED
|
@@ -3609,6 +3609,12 @@ export interface WebSocket extends EventTarget<WebSocketEventMap> {
|
|
|
3609
3609
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
|
|
3610
3610
|
*/
|
|
3611
3611
|
extensions: string | null;
|
|
3612
|
+
/**
|
|
3613
|
+
* The **`WebSocket.binaryType`** property controls the type of binary data being received over the WebSocket connection.
|
|
3614
|
+
*
|
|
3615
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/binaryType)
|
|
3616
|
+
*/
|
|
3617
|
+
binaryType: "blob" | "arraybuffer";
|
|
3612
3618
|
}
|
|
3613
3619
|
export declare const WebSocketPair: {
|
|
3614
3620
|
new (): {
|
|
@@ -3857,21 +3863,17 @@ export declare abstract class Performance {
|
|
|
3857
3863
|
get timeOrigin(): number;
|
|
3858
3864
|
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
|
|
3859
3865
|
now(): number;
|
|
3866
|
+
/**
|
|
3867
|
+
* The **`toJSON()`** method of the Performance interface is a Serialization; it returns a JSON representation of the Performance object.
|
|
3868
|
+
*
|
|
3869
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/toJSON)
|
|
3870
|
+
*/
|
|
3871
|
+
toJSON(): object;
|
|
3860
3872
|
}
|
|
3861
3873
|
// AI Search V2 API Error Interfaces
|
|
3862
3874
|
export interface AiSearchInternalError extends Error {}
|
|
3863
3875
|
export interface AiSearchNotFoundError extends Error {}
|
|
3864
3876
|
export interface AiSearchNameNotSetError extends Error {}
|
|
3865
|
-
// Filter types (shared with AutoRAG for compatibility)
|
|
3866
|
-
export type ComparisonFilter = {
|
|
3867
|
-
key: string;
|
|
3868
|
-
type: "eq" | "ne" | "gt" | "gte" | "lt" | "lte";
|
|
3869
|
-
value: string | number | boolean;
|
|
3870
|
-
};
|
|
3871
|
-
export type CompoundFilter = {
|
|
3872
|
-
type: "and" | "or";
|
|
3873
|
-
filters: ComparisonFilter[];
|
|
3874
|
-
};
|
|
3875
3877
|
// AI Search V2 Request Types
|
|
3876
3878
|
export type AiSearchSearchRequest = {
|
|
3877
3879
|
messages: Array<{
|
|
@@ -3885,7 +3887,7 @@ export type AiSearchSearchRequest = {
|
|
|
3885
3887
|
match_threshold?: number;
|
|
3886
3888
|
/** Maximum number of results (1-50, default 10) */
|
|
3887
3889
|
max_num_results?: number;
|
|
3888
|
-
filters?:
|
|
3890
|
+
filters?: VectorizeVectorMetadataFilter;
|
|
3889
3891
|
/** Context expansion (0-3, default 0) */
|
|
3890
3892
|
context_expansion?: number;
|
|
3891
3893
|
[key: string]: unknown;
|
|
@@ -3919,7 +3921,7 @@ export type AiSearchChatCompletionsRequest = {
|
|
|
3919
3921
|
retrieval_type?: "vector" | "keyword" | "hybrid";
|
|
3920
3922
|
match_threshold?: number;
|
|
3921
3923
|
max_num_results?: number;
|
|
3922
|
-
filters?:
|
|
3924
|
+
filters?: VectorizeVectorMetadataFilter;
|
|
3923
3925
|
context_expansion?: number;
|
|
3924
3926
|
[key: string]: unknown;
|
|
3925
3927
|
};
|
|
@@ -9753,6 +9755,15 @@ export interface AutoRAGUnauthorizedError extends Error {}
|
|
|
9753
9755
|
* @see AiSearchNameNotSetError
|
|
9754
9756
|
*/
|
|
9755
9757
|
export interface AutoRAGNameNotSetError extends Error {}
|
|
9758
|
+
export type ComparisonFilter = {
|
|
9759
|
+
key: string;
|
|
9760
|
+
type: "eq" | "ne" | "gt" | "gte" | "lt" | "lte";
|
|
9761
|
+
value: string | number | boolean;
|
|
9762
|
+
};
|
|
9763
|
+
export type CompoundFilter = {
|
|
9764
|
+
type: "and" | "or";
|
|
9765
|
+
filters: ComparisonFilter[];
|
|
9766
|
+
};
|
|
9756
9767
|
/**
|
|
9757
9768
|
* @deprecated AutoRAG has been replaced by AI Search.
|
|
9758
9769
|
* Use AiSearchSearchRequest with the new API instead.
|
|
@@ -11928,15 +11939,18 @@ export declare namespace CloudflareWorkersModule {
|
|
|
11928
11939
|
timestamp: Date;
|
|
11929
11940
|
type: string;
|
|
11930
11941
|
};
|
|
11942
|
+
export type WorkflowStepContext = {
|
|
11943
|
+
attempt: number;
|
|
11944
|
+
};
|
|
11931
11945
|
export abstract class WorkflowStep {
|
|
11932
11946
|
do<T extends Rpc.Serializable<T>>(
|
|
11933
11947
|
name: string,
|
|
11934
|
-
callback: () => Promise<T>,
|
|
11948
|
+
callback: (ctx: WorkflowStepContext) => Promise<T>,
|
|
11935
11949
|
): Promise<T>;
|
|
11936
11950
|
do<T extends Rpc.Serializable<T>>(
|
|
11937
11951
|
name: string,
|
|
11938
11952
|
config: WorkflowStepConfig,
|
|
11939
|
-
callback: () => Promise<T>,
|
|
11953
|
+
callback: (ctx: WorkflowStepContext) => Promise<T>,
|
|
11940
11954
|
): Promise<T>;
|
|
11941
11955
|
sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;
|
|
11942
11956
|
sleepUntil: (name: string, timestamp: Date | number) => Promise<void>;
|
|
@@ -12024,6 +12038,7 @@ export type ConversionOptions = {
|
|
|
12024
12038
|
convertOGImage?: boolean;
|
|
12025
12039
|
};
|
|
12026
12040
|
hostname?: string;
|
|
12041
|
+
cssSelector?: string;
|
|
12027
12042
|
};
|
|
12028
12043
|
docx?: {
|
|
12029
12044
|
images?: EmbeddedImageConversionOptions;
|
package/2023-07-01/index.d.ts
CHANGED
|
@@ -3600,6 +3600,12 @@ interface WebSocket extends EventTarget<WebSocketEventMap> {
|
|
|
3600
3600
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
|
|
3601
3601
|
*/
|
|
3602
3602
|
extensions: string | null;
|
|
3603
|
+
/**
|
|
3604
|
+
* The **`WebSocket.binaryType`** property controls the type of binary data being received over the WebSocket connection.
|
|
3605
|
+
*
|
|
3606
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/binaryType)
|
|
3607
|
+
*/
|
|
3608
|
+
binaryType: "blob" | "arraybuffer";
|
|
3603
3609
|
}
|
|
3604
3610
|
declare const WebSocketPair: {
|
|
3605
3611
|
new (): {
|
|
@@ -3848,21 +3854,17 @@ declare abstract class Performance {
|
|
|
3848
3854
|
get timeOrigin(): number;
|
|
3849
3855
|
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
|
|
3850
3856
|
now(): number;
|
|
3857
|
+
/**
|
|
3858
|
+
* The **`toJSON()`** method of the Performance interface is a Serialization; it returns a JSON representation of the Performance object.
|
|
3859
|
+
*
|
|
3860
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/toJSON)
|
|
3861
|
+
*/
|
|
3862
|
+
toJSON(): object;
|
|
3851
3863
|
}
|
|
3852
3864
|
// AI Search V2 API Error Interfaces
|
|
3853
3865
|
interface AiSearchInternalError extends Error {}
|
|
3854
3866
|
interface AiSearchNotFoundError extends Error {}
|
|
3855
3867
|
interface AiSearchNameNotSetError extends Error {}
|
|
3856
|
-
// Filter types (shared with AutoRAG for compatibility)
|
|
3857
|
-
type ComparisonFilter = {
|
|
3858
|
-
key: string;
|
|
3859
|
-
type: "eq" | "ne" | "gt" | "gte" | "lt" | "lte";
|
|
3860
|
-
value: string | number | boolean;
|
|
3861
|
-
};
|
|
3862
|
-
type CompoundFilter = {
|
|
3863
|
-
type: "and" | "or";
|
|
3864
|
-
filters: ComparisonFilter[];
|
|
3865
|
-
};
|
|
3866
3868
|
// AI Search V2 Request Types
|
|
3867
3869
|
type AiSearchSearchRequest = {
|
|
3868
3870
|
messages: Array<{
|
|
@@ -3876,7 +3878,7 @@ type AiSearchSearchRequest = {
|
|
|
3876
3878
|
match_threshold?: number;
|
|
3877
3879
|
/** Maximum number of results (1-50, default 10) */
|
|
3878
3880
|
max_num_results?: number;
|
|
3879
|
-
filters?:
|
|
3881
|
+
filters?: VectorizeVectorMetadataFilter;
|
|
3880
3882
|
/** Context expansion (0-3, default 0) */
|
|
3881
3883
|
context_expansion?: number;
|
|
3882
3884
|
[key: string]: unknown;
|
|
@@ -3910,7 +3912,7 @@ type AiSearchChatCompletionsRequest = {
|
|
|
3910
3912
|
retrieval_type?: "vector" | "keyword" | "hybrid";
|
|
3911
3913
|
match_threshold?: number;
|
|
3912
3914
|
max_num_results?: number;
|
|
3913
|
-
filters?:
|
|
3915
|
+
filters?: VectorizeVectorMetadataFilter;
|
|
3914
3916
|
context_expansion?: number;
|
|
3915
3917
|
[key: string]: unknown;
|
|
3916
3918
|
};
|
|
@@ -9741,6 +9743,15 @@ interface AutoRAGUnauthorizedError extends Error {}
|
|
|
9741
9743
|
* @see AiSearchNameNotSetError
|
|
9742
9744
|
*/
|
|
9743
9745
|
interface AutoRAGNameNotSetError extends Error {}
|
|
9746
|
+
type ComparisonFilter = {
|
|
9747
|
+
key: string;
|
|
9748
|
+
type: "eq" | "ne" | "gt" | "gte" | "lt" | "lte";
|
|
9749
|
+
value: string | number | boolean;
|
|
9750
|
+
};
|
|
9751
|
+
type CompoundFilter = {
|
|
9752
|
+
type: "and" | "or";
|
|
9753
|
+
filters: ComparisonFilter[];
|
|
9754
|
+
};
|
|
9744
9755
|
/**
|
|
9745
9756
|
* @deprecated AutoRAG has been replaced by AI Search.
|
|
9746
9757
|
* Use AiSearchSearchRequest with the new API instead.
|
|
@@ -11960,15 +11971,18 @@ declare namespace CloudflareWorkersModule {
|
|
|
11960
11971
|
timestamp: Date;
|
|
11961
11972
|
type: string;
|
|
11962
11973
|
};
|
|
11974
|
+
export type WorkflowStepContext = {
|
|
11975
|
+
attempt: number;
|
|
11976
|
+
};
|
|
11963
11977
|
export abstract class WorkflowStep {
|
|
11964
11978
|
do<T extends Rpc.Serializable<T>>(
|
|
11965
11979
|
name: string,
|
|
11966
|
-
callback: () => Promise<T>,
|
|
11980
|
+
callback: (ctx: WorkflowStepContext) => Promise<T>,
|
|
11967
11981
|
): Promise<T>;
|
|
11968
11982
|
do<T extends Rpc.Serializable<T>>(
|
|
11969
11983
|
name: string,
|
|
11970
11984
|
config: WorkflowStepConfig,
|
|
11971
|
-
callback: () => Promise<T>,
|
|
11985
|
+
callback: (ctx: WorkflowStepContext) => Promise<T>,
|
|
11972
11986
|
): Promise<T>;
|
|
11973
11987
|
sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;
|
|
11974
11988
|
sleepUntil: (name: string, timestamp: Date | number) => Promise<void>;
|
|
@@ -12066,6 +12080,7 @@ type ConversionOptions = {
|
|
|
12066
12080
|
convertOGImage?: boolean;
|
|
12067
12081
|
};
|
|
12068
12082
|
hostname?: string;
|
|
12083
|
+
cssSelector?: string;
|
|
12069
12084
|
};
|
|
12070
12085
|
docx?: {
|
|
12071
12086
|
images?: EmbeddedImageConversionOptions;
|
package/2023-07-01/index.ts
CHANGED
|
@@ -3609,6 +3609,12 @@ export interface WebSocket extends EventTarget<WebSocketEventMap> {
|
|
|
3609
3609
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
|
|
3610
3610
|
*/
|
|
3611
3611
|
extensions: string | null;
|
|
3612
|
+
/**
|
|
3613
|
+
* The **`WebSocket.binaryType`** property controls the type of binary data being received over the WebSocket connection.
|
|
3614
|
+
*
|
|
3615
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/binaryType)
|
|
3616
|
+
*/
|
|
3617
|
+
binaryType: "blob" | "arraybuffer";
|
|
3612
3618
|
}
|
|
3613
3619
|
export declare const WebSocketPair: {
|
|
3614
3620
|
new (): {
|
|
@@ -3857,21 +3863,17 @@ export declare abstract class Performance {
|
|
|
3857
3863
|
get timeOrigin(): number;
|
|
3858
3864
|
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
|
|
3859
3865
|
now(): number;
|
|
3866
|
+
/**
|
|
3867
|
+
* The **`toJSON()`** method of the Performance interface is a Serialization; it returns a JSON representation of the Performance object.
|
|
3868
|
+
*
|
|
3869
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/toJSON)
|
|
3870
|
+
*/
|
|
3871
|
+
toJSON(): object;
|
|
3860
3872
|
}
|
|
3861
3873
|
// AI Search V2 API Error Interfaces
|
|
3862
3874
|
export interface AiSearchInternalError extends Error {}
|
|
3863
3875
|
export interface AiSearchNotFoundError extends Error {}
|
|
3864
3876
|
export interface AiSearchNameNotSetError extends Error {}
|
|
3865
|
-
// Filter types (shared with AutoRAG for compatibility)
|
|
3866
|
-
export type ComparisonFilter = {
|
|
3867
|
-
key: string;
|
|
3868
|
-
type: "eq" | "ne" | "gt" | "gte" | "lt" | "lte";
|
|
3869
|
-
value: string | number | boolean;
|
|
3870
|
-
};
|
|
3871
|
-
export type CompoundFilter = {
|
|
3872
|
-
type: "and" | "or";
|
|
3873
|
-
filters: ComparisonFilter[];
|
|
3874
|
-
};
|
|
3875
3877
|
// AI Search V2 Request Types
|
|
3876
3878
|
export type AiSearchSearchRequest = {
|
|
3877
3879
|
messages: Array<{
|
|
@@ -3885,7 +3887,7 @@ export type AiSearchSearchRequest = {
|
|
|
3885
3887
|
match_threshold?: number;
|
|
3886
3888
|
/** Maximum number of results (1-50, default 10) */
|
|
3887
3889
|
max_num_results?: number;
|
|
3888
|
-
filters?:
|
|
3890
|
+
filters?: VectorizeVectorMetadataFilter;
|
|
3889
3891
|
/** Context expansion (0-3, default 0) */
|
|
3890
3892
|
context_expansion?: number;
|
|
3891
3893
|
[key: string]: unknown;
|
|
@@ -3919,7 +3921,7 @@ export type AiSearchChatCompletionsRequest = {
|
|
|
3919
3921
|
retrieval_type?: "vector" | "keyword" | "hybrid";
|
|
3920
3922
|
match_threshold?: number;
|
|
3921
3923
|
max_num_results?: number;
|
|
3922
|
-
filters?:
|
|
3924
|
+
filters?: VectorizeVectorMetadataFilter;
|
|
3923
3925
|
context_expansion?: number;
|
|
3924
3926
|
[key: string]: unknown;
|
|
3925
3927
|
};
|
|
@@ -9753,6 +9755,15 @@ export interface AutoRAGUnauthorizedError extends Error {}
|
|
|
9753
9755
|
* @see AiSearchNameNotSetError
|
|
9754
9756
|
*/
|
|
9755
9757
|
export interface AutoRAGNameNotSetError extends Error {}
|
|
9758
|
+
export type ComparisonFilter = {
|
|
9759
|
+
key: string;
|
|
9760
|
+
type: "eq" | "ne" | "gt" | "gte" | "lt" | "lte";
|
|
9761
|
+
value: string | number | boolean;
|
|
9762
|
+
};
|
|
9763
|
+
export type CompoundFilter = {
|
|
9764
|
+
type: "and" | "or";
|
|
9765
|
+
filters: ComparisonFilter[];
|
|
9766
|
+
};
|
|
9756
9767
|
/**
|
|
9757
9768
|
* @deprecated AutoRAG has been replaced by AI Search.
|
|
9758
9769
|
* Use AiSearchSearchRequest with the new API instead.
|
|
@@ -11928,15 +11939,18 @@ export declare namespace CloudflareWorkersModule {
|
|
|
11928
11939
|
timestamp: Date;
|
|
11929
11940
|
type: string;
|
|
11930
11941
|
};
|
|
11942
|
+
export type WorkflowStepContext = {
|
|
11943
|
+
attempt: number;
|
|
11944
|
+
};
|
|
11931
11945
|
export abstract class WorkflowStep {
|
|
11932
11946
|
do<T extends Rpc.Serializable<T>>(
|
|
11933
11947
|
name: string,
|
|
11934
|
-
callback: () => Promise<T>,
|
|
11948
|
+
callback: (ctx: WorkflowStepContext) => Promise<T>,
|
|
11935
11949
|
): Promise<T>;
|
|
11936
11950
|
do<T extends Rpc.Serializable<T>>(
|
|
11937
11951
|
name: string,
|
|
11938
11952
|
config: WorkflowStepConfig,
|
|
11939
|
-
callback: () => Promise<T>,
|
|
11953
|
+
callback: (ctx: WorkflowStepContext) => Promise<T>,
|
|
11940
11954
|
): Promise<T>;
|
|
11941
11955
|
sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;
|
|
11942
11956
|
sleepUntil: (name: string, timestamp: Date | number) => Promise<void>;
|
|
@@ -12024,6 +12038,7 @@ export type ConversionOptions = {
|
|
|
12024
12038
|
convertOGImage?: boolean;
|
|
12025
12039
|
};
|
|
12026
12040
|
hostname?: string;
|
|
12041
|
+
cssSelector?: string;
|
|
12027
12042
|
};
|
|
12028
12043
|
docx?: {
|
|
12029
12044
|
images?: EmbeddedImageConversionOptions;
|
package/experimental/index.d.ts
CHANGED
|
@@ -293,6 +293,7 @@ declare namespace WebAssembly {
|
|
|
293
293
|
interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|
294
294
|
DOMException: typeof DOMException;
|
|
295
295
|
WorkerGlobalScope: typeof WorkerGlobalScope;
|
|
296
|
+
EventTarget: typeof EventTarget;
|
|
296
297
|
btoa(data: string): string;
|
|
297
298
|
atob(data: string): string;
|
|
298
299
|
setTimeout(callback: (...args: any[]) => void, msDelay?: number): number;
|
|
@@ -3717,6 +3718,12 @@ interface WebSocket extends EventTarget<WebSocketEventMap> {
|
|
|
3717
3718
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
|
|
3718
3719
|
*/
|
|
3719
3720
|
extensions: string | null;
|
|
3721
|
+
/**
|
|
3722
|
+
* The **`WebSocket.binaryType`** property controls the type of binary data being received over the WebSocket connection.
|
|
3723
|
+
*
|
|
3724
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/binaryType)
|
|
3725
|
+
*/
|
|
3726
|
+
binaryType: "blob" | "arraybuffer";
|
|
3720
3727
|
}
|
|
3721
3728
|
declare const WebSocketPair: {
|
|
3722
3729
|
new (): {
|
|
@@ -4242,6 +4249,12 @@ declare abstract class Performance extends EventTarget {
|
|
|
4242
4249
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/setResourceTimingBufferSize)
|
|
4243
4250
|
*/
|
|
4244
4251
|
setResourceTimingBufferSize(size: number): void;
|
|
4252
|
+
/**
|
|
4253
|
+
* The **`toJSON()`** method of the Performance interface is a Serialization; it returns a JSON representation of the Performance object.
|
|
4254
|
+
*
|
|
4255
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/toJSON)
|
|
4256
|
+
*/
|
|
4257
|
+
toJSON(): object;
|
|
4245
4258
|
get nodeTiming(): PerformanceNodeTiming;
|
|
4246
4259
|
eventLoopUtilization(): PerformanceEventLoopUtilization;
|
|
4247
4260
|
markResourceTiming(): void;
|
|
@@ -4261,7 +4274,7 @@ interface PerformanceNodeTiming extends PerformanceEntry {
|
|
|
4261
4274
|
readonly loopExit: number;
|
|
4262
4275
|
readonly idleTime: number;
|
|
4263
4276
|
readonly uvMetricsInfo: UvMetricsInfo;
|
|
4264
|
-
toJSON():
|
|
4277
|
+
toJSON(): object;
|
|
4265
4278
|
}
|
|
4266
4279
|
interface UvMetricsInfo {
|
|
4267
4280
|
loopCount: number;
|
|
@@ -4281,7 +4294,7 @@ declare class PerformanceMark extends PerformanceEntry {
|
|
|
4281
4294
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMark/detail)
|
|
4282
4295
|
*/
|
|
4283
4296
|
get detail(): any;
|
|
4284
|
-
toJSON():
|
|
4297
|
+
toJSON(): object;
|
|
4285
4298
|
}
|
|
4286
4299
|
/**
|
|
4287
4300
|
* **`PerformanceMeasure`** is an _abstract_ interface for PerformanceEntry objects with an PerformanceEntry.entryType of `'measure'`.
|
|
@@ -4295,7 +4308,7 @@ declare abstract class PerformanceMeasure extends PerformanceEntry {
|
|
|
4295
4308
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMeasure/detail)
|
|
4296
4309
|
*/
|
|
4297
4310
|
get detail(): any;
|
|
4298
|
-
toJSON():
|
|
4311
|
+
toJSON(): object;
|
|
4299
4312
|
}
|
|
4300
4313
|
interface PerformanceMarkOptions {
|
|
4301
4314
|
detail?: any;
|
|
@@ -4367,7 +4380,7 @@ declare abstract class PerformanceEntry {
|
|
|
4367
4380
|
*
|
|
4368
4381
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/toJSON)
|
|
4369
4382
|
*/
|
|
4370
|
-
toJSON():
|
|
4383
|
+
toJSON(): object;
|
|
4371
4384
|
}
|
|
4372
4385
|
/**
|
|
4373
4386
|
* The **`PerformanceResourceTiming`** interface enables retrieval and analysis of detailed network timing data regarding the loading of an application's resources.
|
|
@@ -4534,16 +4547,6 @@ interface EventCounts {
|
|
|
4534
4547
|
interface AiSearchInternalError extends Error {}
|
|
4535
4548
|
interface AiSearchNotFoundError extends Error {}
|
|
4536
4549
|
interface AiSearchNameNotSetError extends Error {}
|
|
4537
|
-
// Filter types (shared with AutoRAG for compatibility)
|
|
4538
|
-
type ComparisonFilter = {
|
|
4539
|
-
key: string;
|
|
4540
|
-
type: "eq" | "ne" | "gt" | "gte" | "lt" | "lte";
|
|
4541
|
-
value: string | number | boolean;
|
|
4542
|
-
};
|
|
4543
|
-
type CompoundFilter = {
|
|
4544
|
-
type: "and" | "or";
|
|
4545
|
-
filters: ComparisonFilter[];
|
|
4546
|
-
};
|
|
4547
4550
|
// AI Search V2 Request Types
|
|
4548
4551
|
type AiSearchSearchRequest = {
|
|
4549
4552
|
messages: Array<{
|
|
@@ -4557,7 +4560,7 @@ type AiSearchSearchRequest = {
|
|
|
4557
4560
|
match_threshold?: number;
|
|
4558
4561
|
/** Maximum number of results (1-50, default 10) */
|
|
4559
4562
|
max_num_results?: number;
|
|
4560
|
-
filters?:
|
|
4563
|
+
filters?: VectorizeVectorMetadataFilter;
|
|
4561
4564
|
/** Context expansion (0-3, default 0) */
|
|
4562
4565
|
context_expansion?: number;
|
|
4563
4566
|
[key: string]: unknown;
|
|
@@ -4591,7 +4594,7 @@ type AiSearchChatCompletionsRequest = {
|
|
|
4591
4594
|
retrieval_type?: "vector" | "keyword" | "hybrid";
|
|
4592
4595
|
match_threshold?: number;
|
|
4593
4596
|
max_num_results?: number;
|
|
4594
|
-
filters?:
|
|
4597
|
+
filters?: VectorizeVectorMetadataFilter;
|
|
4595
4598
|
context_expansion?: number;
|
|
4596
4599
|
[key: string]: unknown;
|
|
4597
4600
|
};
|
|
@@ -10422,6 +10425,15 @@ interface AutoRAGUnauthorizedError extends Error {}
|
|
|
10422
10425
|
* @see AiSearchNameNotSetError
|
|
10423
10426
|
*/
|
|
10424
10427
|
interface AutoRAGNameNotSetError extends Error {}
|
|
10428
|
+
type ComparisonFilter = {
|
|
10429
|
+
key: string;
|
|
10430
|
+
type: "eq" | "ne" | "gt" | "gte" | "lt" | "lte";
|
|
10431
|
+
value: string | number | boolean;
|
|
10432
|
+
};
|
|
10433
|
+
type CompoundFilter = {
|
|
10434
|
+
type: "and" | "or";
|
|
10435
|
+
filters: ComparisonFilter[];
|
|
10436
|
+
};
|
|
10425
10437
|
/**
|
|
10426
10438
|
* @deprecated AutoRAG has been replaced by AI Search.
|
|
10427
10439
|
* Use AiSearchSearchRequest with the new API instead.
|
|
@@ -12641,15 +12653,18 @@ declare namespace CloudflareWorkersModule {
|
|
|
12641
12653
|
timestamp: Date;
|
|
12642
12654
|
type: string;
|
|
12643
12655
|
};
|
|
12656
|
+
export type WorkflowStepContext = {
|
|
12657
|
+
attempt: number;
|
|
12658
|
+
};
|
|
12644
12659
|
export abstract class WorkflowStep {
|
|
12645
12660
|
do<T extends Rpc.Serializable<T>>(
|
|
12646
12661
|
name: string,
|
|
12647
|
-
callback: () => Promise<T>,
|
|
12662
|
+
callback: (ctx: WorkflowStepContext) => Promise<T>,
|
|
12648
12663
|
): Promise<T>;
|
|
12649
12664
|
do<T extends Rpc.Serializable<T>>(
|
|
12650
12665
|
name: string,
|
|
12651
12666
|
config: WorkflowStepConfig,
|
|
12652
|
-
callback: () => Promise<T>,
|
|
12667
|
+
callback: (ctx: WorkflowStepContext) => Promise<T>,
|
|
12653
12668
|
): Promise<T>;
|
|
12654
12669
|
sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;
|
|
12655
12670
|
sleepUntil: (name: string, timestamp: Date | number) => Promise<void>;
|
|
@@ -12747,6 +12762,7 @@ type ConversionOptions = {
|
|
|
12747
12762
|
convertOGImage?: boolean;
|
|
12748
12763
|
};
|
|
12749
12764
|
hostname?: string;
|
|
12765
|
+
cssSelector?: string;
|
|
12750
12766
|
};
|
|
12751
12767
|
docx?: {
|
|
12752
12768
|
images?: EmbeddedImageConversionOptions;
|