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