@cloudflare/workers-types 4.20240718.0 → 4.20240725.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/2021-11-03/index.d.ts +82 -12
- package/2021-11-03/index.ts +82 -12
- package/2022-01-31/index.d.ts +82 -18
- package/2022-01-31/index.ts +82 -18
- package/2022-03-21/index.d.ts +82 -18
- package/2022-03-21/index.ts +82 -18
- package/2022-08-04/index.d.ts +82 -18
- package/2022-08-04/index.ts +82 -18
- package/2022-10-31/index.d.ts +82 -18
- package/2022-10-31/index.ts +82 -18
- package/2022-11-30/index.d.ts +82 -18
- package/2022-11-30/index.ts +82 -18
- package/2023-03-01/index.d.ts +82 -18
- package/2023-03-01/index.ts +82 -18
- package/2023-07-01/index.d.ts +82 -18
- package/2023-07-01/index.ts +82 -18
- package/experimental/index.d.ts +82 -18
- package/experimental/index.ts +82 -18
- package/index.d.ts +82 -12
- package/index.ts +82 -12
- package/oldest/index.d.ts +82 -12
- package/oldest/index.ts +82 -12
- package/package.json +1 -1
package/2022-03-21/index.d.ts
CHANGED
|
@@ -1621,12 +1621,6 @@ declare class Request<
|
|
|
1621
1621
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
|
|
1622
1622
|
*/
|
|
1623
1623
|
get keepalive(): boolean;
|
|
1624
|
-
/**
|
|
1625
|
-
* Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching.
|
|
1626
|
-
*
|
|
1627
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/cache)
|
|
1628
|
-
*/
|
|
1629
|
-
get cache(): string | undefined;
|
|
1630
1624
|
}
|
|
1631
1625
|
interface RequestInit<Cf = CfProperties> {
|
|
1632
1626
|
/* A string to set request's method. */
|
|
@@ -1639,8 +1633,6 @@ interface RequestInit<Cf = CfProperties> {
|
|
|
1639
1633
|
redirect?: string;
|
|
1640
1634
|
fetcher?: Fetcher | null;
|
|
1641
1635
|
cf?: Cf;
|
|
1642
|
-
/* A string indicating how the request will interact with the browser's cache to set request's cache. */
|
|
1643
|
-
cache?: string;
|
|
1644
1636
|
/* A cryptographic hash of the resource to be fetched by request. Sets request's integrity. */
|
|
1645
1637
|
integrity?: string;
|
|
1646
1638
|
/* An AbortSignal to set request's signal. */
|
|
@@ -4643,7 +4635,7 @@ declare abstract class D1PreparedStatement {
|
|
|
4643
4635
|
bind(...values: unknown[]): D1PreparedStatement;
|
|
4644
4636
|
first<T = unknown>(colName: string): Promise<T | null>;
|
|
4645
4637
|
first<T = Record<string, unknown>>(): Promise<T | null>;
|
|
4646
|
-
run(): Promise<
|
|
4638
|
+
run<T = Record<string, unknown>>(): Promise<D1Result<T>>;
|
|
4647
4639
|
all<T = Record<string, unknown>>(): Promise<D1Result<T>>;
|
|
4648
4640
|
raw<T = unknown[]>(options: {
|
|
4649
4641
|
columnNames: true;
|
|
@@ -4699,6 +4691,12 @@ interface ForwardableEmailMessage extends EmailMessage {
|
|
|
4699
4691
|
* @returns A promise that resolves when the email message is forwarded.
|
|
4700
4692
|
*/
|
|
4701
4693
|
forward(rcptTo: string, headers?: Headers): Promise<void>;
|
|
4694
|
+
/**
|
|
4695
|
+
* Reply to the sender of this email message with a new EmailMessage object.
|
|
4696
|
+
* @param message The reply message.
|
|
4697
|
+
* @returns A promise that resolves when the email message is replied.
|
|
4698
|
+
*/
|
|
4699
|
+
reply(message: EmailMessage): Promise<void>;
|
|
4702
4700
|
}
|
|
4703
4701
|
/**
|
|
4704
4702
|
* A binding that allows a Worker to send email messages.
|
|
@@ -5106,11 +5104,23 @@ type VectorizeVectorMetadataFilter = {
|
|
|
5106
5104
|
* Distance metrics determine how other "similar" vectors are determined.
|
|
5107
5105
|
*/
|
|
5108
5106
|
type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
|
|
5109
|
-
|
|
5107
|
+
/**
|
|
5108
|
+
* Metadata return levels for a Vectorize query.
|
|
5109
|
+
*
|
|
5110
|
+
* Default to "none".
|
|
5111
|
+
*
|
|
5112
|
+
* @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.
|
|
5113
|
+
* @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).
|
|
5114
|
+
* @property none No indexed metadata will be returned.
|
|
5115
|
+
*/
|
|
5116
|
+
type VectorizeMetadataRetrievalLevel = "all" | "indexed" | "none";
|
|
5117
|
+
interface VectorizeQueryOptions<
|
|
5118
|
+
MetadataReturn extends boolean | VectorizeMetadataRetrievalLevel = boolean,
|
|
5119
|
+
> {
|
|
5110
5120
|
topK?: number;
|
|
5111
5121
|
namespace?: string;
|
|
5112
5122
|
returnValues?: boolean;
|
|
5113
|
-
returnMetadata?:
|
|
5123
|
+
returnMetadata?: MetadataReturn;
|
|
5114
5124
|
filter?: VectorizeVectorMetadataFilter;
|
|
5115
5125
|
}
|
|
5116
5126
|
/**
|
|
@@ -5149,7 +5159,7 @@ interface VectorizeVector {
|
|
|
5149
5159
|
values: VectorFloatArray | number[];
|
|
5150
5160
|
/** The namespace this vector belongs to. */
|
|
5151
5161
|
namespace?: string;
|
|
5152
|
-
/** Metadata associated with the vector. Includes the values of
|
|
5162
|
+
/** Metadata associated with the vector. Includes the values of other fields and potentially additional details. */
|
|
5153
5163
|
metadata?: Record<string, VectorizeVectorMetadata>;
|
|
5154
5164
|
}
|
|
5155
5165
|
/**
|
|
@@ -5161,7 +5171,7 @@ type VectorizeMatch = Pick<Partial<VectorizeVector>, "values"> &
|
|
|
5161
5171
|
score: number;
|
|
5162
5172
|
};
|
|
5163
5173
|
/**
|
|
5164
|
-
* A set of
|
|
5174
|
+
* A set of matching {@link VectorizeMatch} for a particular query.
|
|
5165
5175
|
*/
|
|
5166
5176
|
interface VectorizeMatches {
|
|
5167
5177
|
matches: VectorizeMatch[];
|
|
@@ -5170,6 +5180,9 @@ interface VectorizeMatches {
|
|
|
5170
5180
|
/**
|
|
5171
5181
|
* Results of an operation that performed a mutation on a set of vectors.
|
|
5172
5182
|
* Here, `ids` is a list of vectors that were successfully processed.
|
|
5183
|
+
*
|
|
5184
|
+
* This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released.
|
|
5185
|
+
* See {@link VectorizeAsyncMutation} for its post-beta equivalent.
|
|
5173
5186
|
*/
|
|
5174
5187
|
interface VectorizeVectorMutation {
|
|
5175
5188
|
/* List of ids of vectors that were successfully processed. */
|
|
@@ -5178,14 +5191,19 @@ interface VectorizeVectorMutation {
|
|
|
5178
5191
|
count: number;
|
|
5179
5192
|
}
|
|
5180
5193
|
/**
|
|
5181
|
-
*
|
|
5182
|
-
*
|
|
5183
|
-
* Here, `mutationId` is the identifier for the last mutation processed by Vectorize.
|
|
5194
|
+
* Result type indicating a mutation on the Vectorize Index.
|
|
5195
|
+
* Actual mutations are processed async where the `mutationId` is the unique identifier for the operation.
|
|
5184
5196
|
*/
|
|
5185
|
-
interface
|
|
5186
|
-
|
|
5197
|
+
interface VectorizeAsyncMutation {
|
|
5198
|
+
/** The unique identifier for the async mutation operation containing the changeset. */
|
|
5187
5199
|
mutationId: string;
|
|
5188
5200
|
}
|
|
5201
|
+
/**
|
|
5202
|
+
* A Vectorize Vector Search Index for querying vectors/embeddings.
|
|
5203
|
+
*
|
|
5204
|
+
* This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released.
|
|
5205
|
+
* See {@link Vectorize} for its new implementation.
|
|
5206
|
+
*/
|
|
5189
5207
|
declare abstract class VectorizeIndex {
|
|
5190
5208
|
/**
|
|
5191
5209
|
* Get information about the currently bound index.
|
|
@@ -5227,6 +5245,52 @@ declare abstract class VectorizeIndex {
|
|
|
5227
5245
|
*/
|
|
5228
5246
|
public getByIds(ids: string[]): Promise<VectorizeVector[]>;
|
|
5229
5247
|
}
|
|
5248
|
+
/**
|
|
5249
|
+
* A Vectorize Vector Search Index for querying vectors/embeddings.
|
|
5250
|
+
*
|
|
5251
|
+
* Mutations in this version are async, returning a mutation id.
|
|
5252
|
+
*/
|
|
5253
|
+
declare abstract class Vectorize {
|
|
5254
|
+
/**
|
|
5255
|
+
* Get information about the currently bound index.
|
|
5256
|
+
* @returns A promise that resolves with information about the current index.
|
|
5257
|
+
*/
|
|
5258
|
+
public describe(): Promise<VectorizeIndexDetails>;
|
|
5259
|
+
/**
|
|
5260
|
+
* Use the provided vector to perform a similarity search across the index.
|
|
5261
|
+
* @param vector Input vector that will be used to drive the similarity search.
|
|
5262
|
+
* @param options Configuration options to massage the returned data.
|
|
5263
|
+
* @returns A promise that resolves with matched and scored vectors.
|
|
5264
|
+
*/
|
|
5265
|
+
public query(
|
|
5266
|
+
vector: VectorFloatArray | number[],
|
|
5267
|
+
options: VectorizeQueryOptions<VectorizeMetadataRetrievalLevel>,
|
|
5268
|
+
): Promise<VectorizeMatches>;
|
|
5269
|
+
/**
|
|
5270
|
+
* Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
|
|
5271
|
+
* @param vectors List of vectors that will be inserted.
|
|
5272
|
+
* @returns A promise that resolves with a unique identifier of a mutation containing the insert changeset.
|
|
5273
|
+
*/
|
|
5274
|
+
public insert(vectors: VectorizeVector[]): Promise<VectorizeAsyncMutation>;
|
|
5275
|
+
/**
|
|
5276
|
+
* Upsert a list of vectors into the index dataset. If a provided id exists, it will be replaced with the new values.
|
|
5277
|
+
* @param vectors List of vectors that will be upserted.
|
|
5278
|
+
* @returns A promise that resolves with a unique identifier of a mutation containing the upsert changeset.
|
|
5279
|
+
*/
|
|
5280
|
+
public upsert(vectors: VectorizeVector[]): Promise<VectorizeAsyncMutation>;
|
|
5281
|
+
/**
|
|
5282
|
+
* Delete a list of vectors with a matching id.
|
|
5283
|
+
* @param ids List of vector ids that should be deleted.
|
|
5284
|
+
* @returns A promise that resolves with a unique identifier of a mutation containing the delete changeset.
|
|
5285
|
+
*/
|
|
5286
|
+
public deleteByIds(ids: string[]): Promise<VectorizeAsyncMutation>;
|
|
5287
|
+
/**
|
|
5288
|
+
* Get a list of vectors with a matching id.
|
|
5289
|
+
* @param ids List of vector ids that should be returned.
|
|
5290
|
+
* @returns A promise that resolves with the raw unscored vectors matching the id set.
|
|
5291
|
+
*/
|
|
5292
|
+
public getByIds(ids: string[]): Promise<VectorizeVector[]>;
|
|
5293
|
+
}
|
|
5230
5294
|
/**
|
|
5231
5295
|
* The interface for "version_metadata" binding
|
|
5232
5296
|
* providing metadata about the Worker Version using this binding.
|
package/2022-03-21/index.ts
CHANGED
|
@@ -1626,12 +1626,6 @@ export declare class Request<
|
|
|
1626
1626
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
|
|
1627
1627
|
*/
|
|
1628
1628
|
get keepalive(): boolean;
|
|
1629
|
-
/**
|
|
1630
|
-
* Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching.
|
|
1631
|
-
*
|
|
1632
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/cache)
|
|
1633
|
-
*/
|
|
1634
|
-
get cache(): string | undefined;
|
|
1635
1629
|
}
|
|
1636
1630
|
export interface RequestInit<Cf = CfProperties> {
|
|
1637
1631
|
/* A string to set request's method. */
|
|
@@ -1644,8 +1638,6 @@ export interface RequestInit<Cf = CfProperties> {
|
|
|
1644
1638
|
redirect?: string;
|
|
1645
1639
|
fetcher?: Fetcher | null;
|
|
1646
1640
|
cf?: Cf;
|
|
1647
|
-
/* A string indicating how the request will interact with the browser's cache to set request's cache. */
|
|
1648
|
-
cache?: string;
|
|
1649
1641
|
/* A cryptographic hash of the resource to be fetched by request. Sets request's integrity. */
|
|
1650
1642
|
integrity?: string;
|
|
1651
1643
|
/* An AbortSignal to set request's signal. */
|
|
@@ -4665,7 +4657,7 @@ export declare abstract class D1PreparedStatement {
|
|
|
4665
4657
|
bind(...values: unknown[]): D1PreparedStatement;
|
|
4666
4658
|
first<T = unknown>(colName: string): Promise<T | null>;
|
|
4667
4659
|
first<T = Record<string, unknown>>(): Promise<T | null>;
|
|
4668
|
-
run(): Promise<
|
|
4660
|
+
run<T = Record<string, unknown>>(): Promise<D1Result<T>>;
|
|
4669
4661
|
all<T = Record<string, unknown>>(): Promise<D1Result<T>>;
|
|
4670
4662
|
raw<T = unknown[]>(options: {
|
|
4671
4663
|
columnNames: true;
|
|
@@ -4721,6 +4713,12 @@ export interface ForwardableEmailMessage extends EmailMessage {
|
|
|
4721
4713
|
* @returns A promise that resolves when the email message is forwarded.
|
|
4722
4714
|
*/
|
|
4723
4715
|
forward(rcptTo: string, headers?: Headers): Promise<void>;
|
|
4716
|
+
/**
|
|
4717
|
+
* Reply to the sender of this email message with a new EmailMessage object.
|
|
4718
|
+
* @param message The reply message.
|
|
4719
|
+
* @returns A promise that resolves when the email message is replied.
|
|
4720
|
+
*/
|
|
4721
|
+
reply(message: EmailMessage): Promise<void>;
|
|
4724
4722
|
}
|
|
4725
4723
|
/**
|
|
4726
4724
|
* A binding that allows a Worker to send email messages.
|
|
@@ -5066,11 +5064,23 @@ export type VectorizeVectorMetadataFilter = {
|
|
|
5066
5064
|
* Distance metrics determine how other "similar" vectors are determined.
|
|
5067
5065
|
*/
|
|
5068
5066
|
export type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
|
|
5069
|
-
|
|
5067
|
+
/**
|
|
5068
|
+
* Metadata return levels for a Vectorize query.
|
|
5069
|
+
*
|
|
5070
|
+
* Default to "none".
|
|
5071
|
+
*
|
|
5072
|
+
* @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.
|
|
5073
|
+
* @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).
|
|
5074
|
+
* @property none No indexed metadata will be returned.
|
|
5075
|
+
*/
|
|
5076
|
+
export type VectorizeMetadataRetrievalLevel = "all" | "indexed" | "none";
|
|
5077
|
+
export interface VectorizeQueryOptions<
|
|
5078
|
+
MetadataReturn extends boolean | VectorizeMetadataRetrievalLevel = boolean,
|
|
5079
|
+
> {
|
|
5070
5080
|
topK?: number;
|
|
5071
5081
|
namespace?: string;
|
|
5072
5082
|
returnValues?: boolean;
|
|
5073
|
-
returnMetadata?:
|
|
5083
|
+
returnMetadata?: MetadataReturn;
|
|
5074
5084
|
filter?: VectorizeVectorMetadataFilter;
|
|
5075
5085
|
}
|
|
5076
5086
|
/**
|
|
@@ -5109,7 +5119,7 @@ export interface VectorizeVector {
|
|
|
5109
5119
|
values: VectorFloatArray | number[];
|
|
5110
5120
|
/** The namespace this vector belongs to. */
|
|
5111
5121
|
namespace?: string;
|
|
5112
|
-
/** Metadata associated with the vector. Includes the values of
|
|
5122
|
+
/** Metadata associated with the vector. Includes the values of other fields and potentially additional details. */
|
|
5113
5123
|
metadata?: Record<string, VectorizeVectorMetadata>;
|
|
5114
5124
|
}
|
|
5115
5125
|
/**
|
|
@@ -5121,7 +5131,7 @@ export type VectorizeMatch = Pick<Partial<VectorizeVector>, "values"> &
|
|
|
5121
5131
|
score: number;
|
|
5122
5132
|
};
|
|
5123
5133
|
/**
|
|
5124
|
-
* A set of
|
|
5134
|
+
* A set of matching {@link VectorizeMatch} for a particular query.
|
|
5125
5135
|
*/
|
|
5126
5136
|
export interface VectorizeMatches {
|
|
5127
5137
|
matches: VectorizeMatch[];
|
|
@@ -5130,6 +5140,9 @@ export interface VectorizeMatches {
|
|
|
5130
5140
|
/**
|
|
5131
5141
|
* Results of an operation that performed a mutation on a set of vectors.
|
|
5132
5142
|
* Here, `ids` is a list of vectors that were successfully processed.
|
|
5143
|
+
*
|
|
5144
|
+
* This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released.
|
|
5145
|
+
* See {@link VectorizeAsyncMutation} for its post-beta equivalent.
|
|
5133
5146
|
*/
|
|
5134
5147
|
export interface VectorizeVectorMutation {
|
|
5135
5148
|
/* List of ids of vectors that were successfully processed. */
|
|
@@ -5138,14 +5151,19 @@ export interface VectorizeVectorMutation {
|
|
|
5138
5151
|
count: number;
|
|
5139
5152
|
}
|
|
5140
5153
|
/**
|
|
5141
|
-
*
|
|
5142
|
-
*
|
|
5143
|
-
* Here, `mutationId` is the identifier for the last mutation processed by Vectorize.
|
|
5154
|
+
* Result type indicating a mutation on the Vectorize Index.
|
|
5155
|
+
* Actual mutations are processed async where the `mutationId` is the unique identifier for the operation.
|
|
5144
5156
|
*/
|
|
5145
|
-
export interface
|
|
5146
|
-
|
|
5157
|
+
export interface VectorizeAsyncMutation {
|
|
5158
|
+
/** The unique identifier for the async mutation operation containing the changeset. */
|
|
5147
5159
|
mutationId: string;
|
|
5148
5160
|
}
|
|
5161
|
+
/**
|
|
5162
|
+
* A Vectorize Vector Search Index for querying vectors/embeddings.
|
|
5163
|
+
*
|
|
5164
|
+
* This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released.
|
|
5165
|
+
* See {@link Vectorize} for its new implementation.
|
|
5166
|
+
*/
|
|
5149
5167
|
export declare abstract class VectorizeIndex {
|
|
5150
5168
|
/**
|
|
5151
5169
|
* Get information about the currently bound index.
|
|
@@ -5187,6 +5205,52 @@ export declare abstract class VectorizeIndex {
|
|
|
5187
5205
|
*/
|
|
5188
5206
|
public getByIds(ids: string[]): Promise<VectorizeVector[]>;
|
|
5189
5207
|
}
|
|
5208
|
+
/**
|
|
5209
|
+
* A Vectorize Vector Search Index for querying vectors/embeddings.
|
|
5210
|
+
*
|
|
5211
|
+
* Mutations in this version are async, returning a mutation id.
|
|
5212
|
+
*/
|
|
5213
|
+
export declare abstract class Vectorize {
|
|
5214
|
+
/**
|
|
5215
|
+
* Get information about the currently bound index.
|
|
5216
|
+
* @returns A promise that resolves with information about the current index.
|
|
5217
|
+
*/
|
|
5218
|
+
public describe(): Promise<VectorizeIndexDetails>;
|
|
5219
|
+
/**
|
|
5220
|
+
* Use the provided vector to perform a similarity search across the index.
|
|
5221
|
+
* @param vector Input vector that will be used to drive the similarity search.
|
|
5222
|
+
* @param options Configuration options to massage the returned data.
|
|
5223
|
+
* @returns A promise that resolves with matched and scored vectors.
|
|
5224
|
+
*/
|
|
5225
|
+
public query(
|
|
5226
|
+
vector: VectorFloatArray | number[],
|
|
5227
|
+
options: VectorizeQueryOptions<VectorizeMetadataRetrievalLevel>,
|
|
5228
|
+
): Promise<VectorizeMatches>;
|
|
5229
|
+
/**
|
|
5230
|
+
* Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
|
|
5231
|
+
* @param vectors List of vectors that will be inserted.
|
|
5232
|
+
* @returns A promise that resolves with a unique identifier of a mutation containing the insert changeset.
|
|
5233
|
+
*/
|
|
5234
|
+
public insert(vectors: VectorizeVector[]): Promise<VectorizeAsyncMutation>;
|
|
5235
|
+
/**
|
|
5236
|
+
* Upsert a list of vectors into the index dataset. If a provided id exists, it will be replaced with the new values.
|
|
5237
|
+
* @param vectors List of vectors that will be upserted.
|
|
5238
|
+
* @returns A promise that resolves with a unique identifier of a mutation containing the upsert changeset.
|
|
5239
|
+
*/
|
|
5240
|
+
public upsert(vectors: VectorizeVector[]): Promise<VectorizeAsyncMutation>;
|
|
5241
|
+
/**
|
|
5242
|
+
* Delete a list of vectors with a matching id.
|
|
5243
|
+
* @param ids List of vector ids that should be deleted.
|
|
5244
|
+
* @returns A promise that resolves with a unique identifier of a mutation containing the delete changeset.
|
|
5245
|
+
*/
|
|
5246
|
+
public deleteByIds(ids: string[]): Promise<VectorizeAsyncMutation>;
|
|
5247
|
+
/**
|
|
5248
|
+
* Get a list of vectors with a matching id.
|
|
5249
|
+
* @param ids List of vector ids that should be returned.
|
|
5250
|
+
* @returns A promise that resolves with the raw unscored vectors matching the id set.
|
|
5251
|
+
*/
|
|
5252
|
+
public getByIds(ids: string[]): Promise<VectorizeVector[]>;
|
|
5253
|
+
}
|
|
5190
5254
|
/**
|
|
5191
5255
|
* The interface for "version_metadata" binding
|
|
5192
5256
|
* providing metadata about the Worker Version using this binding.
|
package/2022-08-04/index.d.ts
CHANGED
|
@@ -1621,12 +1621,6 @@ declare class Request<
|
|
|
1621
1621
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
|
|
1622
1622
|
*/
|
|
1623
1623
|
get keepalive(): boolean;
|
|
1624
|
-
/**
|
|
1625
|
-
* Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching.
|
|
1626
|
-
*
|
|
1627
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/cache)
|
|
1628
|
-
*/
|
|
1629
|
-
get cache(): string | undefined;
|
|
1630
1624
|
}
|
|
1631
1625
|
interface RequestInit<Cf = CfProperties> {
|
|
1632
1626
|
/* A string to set request's method. */
|
|
@@ -1639,8 +1633,6 @@ interface RequestInit<Cf = CfProperties> {
|
|
|
1639
1633
|
redirect?: string;
|
|
1640
1634
|
fetcher?: Fetcher | null;
|
|
1641
1635
|
cf?: Cf;
|
|
1642
|
-
/* A string indicating how the request will interact with the browser's cache to set request's cache. */
|
|
1643
|
-
cache?: string;
|
|
1644
1636
|
/* A cryptographic hash of the resource to be fetched by request. Sets request's integrity. */
|
|
1645
1637
|
integrity?: string;
|
|
1646
1638
|
/* An AbortSignal to set request's signal. */
|
|
@@ -4644,7 +4636,7 @@ declare abstract class D1PreparedStatement {
|
|
|
4644
4636
|
bind(...values: unknown[]): D1PreparedStatement;
|
|
4645
4637
|
first<T = unknown>(colName: string): Promise<T | null>;
|
|
4646
4638
|
first<T = Record<string, unknown>>(): Promise<T | null>;
|
|
4647
|
-
run(): Promise<
|
|
4639
|
+
run<T = Record<string, unknown>>(): Promise<D1Result<T>>;
|
|
4648
4640
|
all<T = Record<string, unknown>>(): Promise<D1Result<T>>;
|
|
4649
4641
|
raw<T = unknown[]>(options: {
|
|
4650
4642
|
columnNames: true;
|
|
@@ -4700,6 +4692,12 @@ interface ForwardableEmailMessage extends EmailMessage {
|
|
|
4700
4692
|
* @returns A promise that resolves when the email message is forwarded.
|
|
4701
4693
|
*/
|
|
4702
4694
|
forward(rcptTo: string, headers?: Headers): Promise<void>;
|
|
4695
|
+
/**
|
|
4696
|
+
* Reply to the sender of this email message with a new EmailMessage object.
|
|
4697
|
+
* @param message The reply message.
|
|
4698
|
+
* @returns A promise that resolves when the email message is replied.
|
|
4699
|
+
*/
|
|
4700
|
+
reply(message: EmailMessage): Promise<void>;
|
|
4703
4701
|
}
|
|
4704
4702
|
/**
|
|
4705
4703
|
* A binding that allows a Worker to send email messages.
|
|
@@ -5107,11 +5105,23 @@ type VectorizeVectorMetadataFilter = {
|
|
|
5107
5105
|
* Distance metrics determine how other "similar" vectors are determined.
|
|
5108
5106
|
*/
|
|
5109
5107
|
type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
|
|
5110
|
-
|
|
5108
|
+
/**
|
|
5109
|
+
* Metadata return levels for a Vectorize query.
|
|
5110
|
+
*
|
|
5111
|
+
* Default to "none".
|
|
5112
|
+
*
|
|
5113
|
+
* @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.
|
|
5114
|
+
* @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).
|
|
5115
|
+
* @property none No indexed metadata will be returned.
|
|
5116
|
+
*/
|
|
5117
|
+
type VectorizeMetadataRetrievalLevel = "all" | "indexed" | "none";
|
|
5118
|
+
interface VectorizeQueryOptions<
|
|
5119
|
+
MetadataReturn extends boolean | VectorizeMetadataRetrievalLevel = boolean,
|
|
5120
|
+
> {
|
|
5111
5121
|
topK?: number;
|
|
5112
5122
|
namespace?: string;
|
|
5113
5123
|
returnValues?: boolean;
|
|
5114
|
-
returnMetadata?:
|
|
5124
|
+
returnMetadata?: MetadataReturn;
|
|
5115
5125
|
filter?: VectorizeVectorMetadataFilter;
|
|
5116
5126
|
}
|
|
5117
5127
|
/**
|
|
@@ -5150,7 +5160,7 @@ interface VectorizeVector {
|
|
|
5150
5160
|
values: VectorFloatArray | number[];
|
|
5151
5161
|
/** The namespace this vector belongs to. */
|
|
5152
5162
|
namespace?: string;
|
|
5153
|
-
/** Metadata associated with the vector. Includes the values of
|
|
5163
|
+
/** Metadata associated with the vector. Includes the values of other fields and potentially additional details. */
|
|
5154
5164
|
metadata?: Record<string, VectorizeVectorMetadata>;
|
|
5155
5165
|
}
|
|
5156
5166
|
/**
|
|
@@ -5162,7 +5172,7 @@ type VectorizeMatch = Pick<Partial<VectorizeVector>, "values"> &
|
|
|
5162
5172
|
score: number;
|
|
5163
5173
|
};
|
|
5164
5174
|
/**
|
|
5165
|
-
* A set of
|
|
5175
|
+
* A set of matching {@link VectorizeMatch} for a particular query.
|
|
5166
5176
|
*/
|
|
5167
5177
|
interface VectorizeMatches {
|
|
5168
5178
|
matches: VectorizeMatch[];
|
|
@@ -5171,6 +5181,9 @@ interface VectorizeMatches {
|
|
|
5171
5181
|
/**
|
|
5172
5182
|
* Results of an operation that performed a mutation on a set of vectors.
|
|
5173
5183
|
* Here, `ids` is a list of vectors that were successfully processed.
|
|
5184
|
+
*
|
|
5185
|
+
* This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released.
|
|
5186
|
+
* See {@link VectorizeAsyncMutation} for its post-beta equivalent.
|
|
5174
5187
|
*/
|
|
5175
5188
|
interface VectorizeVectorMutation {
|
|
5176
5189
|
/* List of ids of vectors that were successfully processed. */
|
|
@@ -5179,14 +5192,19 @@ interface VectorizeVectorMutation {
|
|
|
5179
5192
|
count: number;
|
|
5180
5193
|
}
|
|
5181
5194
|
/**
|
|
5182
|
-
*
|
|
5183
|
-
*
|
|
5184
|
-
* Here, `mutationId` is the identifier for the last mutation processed by Vectorize.
|
|
5195
|
+
* Result type indicating a mutation on the Vectorize Index.
|
|
5196
|
+
* Actual mutations are processed async where the `mutationId` is the unique identifier for the operation.
|
|
5185
5197
|
*/
|
|
5186
|
-
interface
|
|
5187
|
-
|
|
5198
|
+
interface VectorizeAsyncMutation {
|
|
5199
|
+
/** The unique identifier for the async mutation operation containing the changeset. */
|
|
5188
5200
|
mutationId: string;
|
|
5189
5201
|
}
|
|
5202
|
+
/**
|
|
5203
|
+
* A Vectorize Vector Search Index for querying vectors/embeddings.
|
|
5204
|
+
*
|
|
5205
|
+
* This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released.
|
|
5206
|
+
* See {@link Vectorize} for its new implementation.
|
|
5207
|
+
*/
|
|
5190
5208
|
declare abstract class VectorizeIndex {
|
|
5191
5209
|
/**
|
|
5192
5210
|
* Get information about the currently bound index.
|
|
@@ -5228,6 +5246,52 @@ declare abstract class VectorizeIndex {
|
|
|
5228
5246
|
*/
|
|
5229
5247
|
public getByIds(ids: string[]): Promise<VectorizeVector[]>;
|
|
5230
5248
|
}
|
|
5249
|
+
/**
|
|
5250
|
+
* A Vectorize Vector Search Index for querying vectors/embeddings.
|
|
5251
|
+
*
|
|
5252
|
+
* Mutations in this version are async, returning a mutation id.
|
|
5253
|
+
*/
|
|
5254
|
+
declare abstract class Vectorize {
|
|
5255
|
+
/**
|
|
5256
|
+
* Get information about the currently bound index.
|
|
5257
|
+
* @returns A promise that resolves with information about the current index.
|
|
5258
|
+
*/
|
|
5259
|
+
public describe(): Promise<VectorizeIndexDetails>;
|
|
5260
|
+
/**
|
|
5261
|
+
* Use the provided vector to perform a similarity search across the index.
|
|
5262
|
+
* @param vector Input vector that will be used to drive the similarity search.
|
|
5263
|
+
* @param options Configuration options to massage the returned data.
|
|
5264
|
+
* @returns A promise that resolves with matched and scored vectors.
|
|
5265
|
+
*/
|
|
5266
|
+
public query(
|
|
5267
|
+
vector: VectorFloatArray | number[],
|
|
5268
|
+
options: VectorizeQueryOptions<VectorizeMetadataRetrievalLevel>,
|
|
5269
|
+
): Promise<VectorizeMatches>;
|
|
5270
|
+
/**
|
|
5271
|
+
* Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
|
|
5272
|
+
* @param vectors List of vectors that will be inserted.
|
|
5273
|
+
* @returns A promise that resolves with a unique identifier of a mutation containing the insert changeset.
|
|
5274
|
+
*/
|
|
5275
|
+
public insert(vectors: VectorizeVector[]): Promise<VectorizeAsyncMutation>;
|
|
5276
|
+
/**
|
|
5277
|
+
* Upsert a list of vectors into the index dataset. If a provided id exists, it will be replaced with the new values.
|
|
5278
|
+
* @param vectors List of vectors that will be upserted.
|
|
5279
|
+
* @returns A promise that resolves with a unique identifier of a mutation containing the upsert changeset.
|
|
5280
|
+
*/
|
|
5281
|
+
public upsert(vectors: VectorizeVector[]): Promise<VectorizeAsyncMutation>;
|
|
5282
|
+
/**
|
|
5283
|
+
* Delete a list of vectors with a matching id.
|
|
5284
|
+
* @param ids List of vector ids that should be deleted.
|
|
5285
|
+
* @returns A promise that resolves with a unique identifier of a mutation containing the delete changeset.
|
|
5286
|
+
*/
|
|
5287
|
+
public deleteByIds(ids: string[]): Promise<VectorizeAsyncMutation>;
|
|
5288
|
+
/**
|
|
5289
|
+
* Get a list of vectors with a matching id.
|
|
5290
|
+
* @param ids List of vector ids that should be returned.
|
|
5291
|
+
* @returns A promise that resolves with the raw unscored vectors matching the id set.
|
|
5292
|
+
*/
|
|
5293
|
+
public getByIds(ids: string[]): Promise<VectorizeVector[]>;
|
|
5294
|
+
}
|
|
5231
5295
|
/**
|
|
5232
5296
|
* The interface for "version_metadata" binding
|
|
5233
5297
|
* providing metadata about the Worker Version using this binding.
|