@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.
@@ -1610,8 +1610,6 @@ interface RequestInit<Cf = CfProperties> {
1610
1610
  redirect?: string;
1611
1611
  fetcher?: Fetcher | null;
1612
1612
  cf?: Cf;
1613
- /* A string indicating how the request will interact with the browser's cache to set request's cache. */
1614
- cache?: string;
1615
1613
  /* A cryptographic hash of the resource to be fetched by request. Sets request's integrity. */
1616
1614
  integrity?: string;
1617
1615
  /* An AbortSignal to set request's signal. */
@@ -4587,7 +4585,7 @@ declare abstract class D1PreparedStatement {
4587
4585
  bind(...values: unknown[]): D1PreparedStatement;
4588
4586
  first<T = unknown>(colName: string): Promise<T | null>;
4589
4587
  first<T = Record<string, unknown>>(): Promise<T | null>;
4590
- run(): Promise<D1Response>;
4588
+ run<T = Record<string, unknown>>(): Promise<D1Result<T>>;
4591
4589
  all<T = Record<string, unknown>>(): Promise<D1Result<T>>;
4592
4590
  raw<T = unknown[]>(options: {
4593
4591
  columnNames: true;
@@ -4643,6 +4641,12 @@ interface ForwardableEmailMessage extends EmailMessage {
4643
4641
  * @returns A promise that resolves when the email message is forwarded.
4644
4642
  */
4645
4643
  forward(rcptTo: string, headers?: Headers): Promise<void>;
4644
+ /**
4645
+ * Reply to the sender of this email message with a new EmailMessage object.
4646
+ * @param message The reply message.
4647
+ * @returns A promise that resolves when the email message is replied.
4648
+ */
4649
+ reply(message: EmailMessage): Promise<void>;
4646
4650
  }
4647
4651
  /**
4648
4652
  * A binding that allows a Worker to send email messages.
@@ -5050,11 +5054,23 @@ type VectorizeVectorMetadataFilter = {
5050
5054
  * Distance metrics determine how other "similar" vectors are determined.
5051
5055
  */
5052
5056
  type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
5053
- interface VectorizeQueryOptions {
5057
+ /**
5058
+ * Metadata return levels for a Vectorize query.
5059
+ *
5060
+ * Default to "none".
5061
+ *
5062
+ * @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.
5063
+ * @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).
5064
+ * @property none No indexed metadata will be returned.
5065
+ */
5066
+ type VectorizeMetadataRetrievalLevel = "all" | "indexed" | "none";
5067
+ interface VectorizeQueryOptions<
5068
+ MetadataReturn extends boolean | VectorizeMetadataRetrievalLevel = boolean,
5069
+ > {
5054
5070
  topK?: number;
5055
5071
  namespace?: string;
5056
5072
  returnValues?: boolean;
5057
- returnMetadata?: boolean;
5073
+ returnMetadata?: MetadataReturn;
5058
5074
  filter?: VectorizeVectorMetadataFilter;
5059
5075
  }
5060
5076
  /**
@@ -5093,7 +5109,7 @@ interface VectorizeVector {
5093
5109
  values: VectorFloatArray | number[];
5094
5110
  /** The namespace this vector belongs to. */
5095
5111
  namespace?: string;
5096
- /** Metadata associated with the vector. Includes the values of the other fields and potentially additional details. */
5112
+ /** Metadata associated with the vector. Includes the values of other fields and potentially additional details. */
5097
5113
  metadata?: Record<string, VectorizeVectorMetadata>;
5098
5114
  }
5099
5115
  /**
@@ -5105,7 +5121,7 @@ type VectorizeMatch = Pick<Partial<VectorizeVector>, "values"> &
5105
5121
  score: number;
5106
5122
  };
5107
5123
  /**
5108
- * A set of vector {@link VectorizeMatch} for a particular query.
5124
+ * A set of matching {@link VectorizeMatch} for a particular query.
5109
5125
  */
5110
5126
  interface VectorizeMatches {
5111
5127
  matches: VectorizeMatch[];
@@ -5114,6 +5130,9 @@ interface VectorizeMatches {
5114
5130
  /**
5115
5131
  * Results of an operation that performed a mutation on a set of vectors.
5116
5132
  * Here, `ids` is a list of vectors that were successfully processed.
5133
+ *
5134
+ * This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released.
5135
+ * See {@link VectorizeAsyncMutation} for its post-beta equivalent.
5117
5136
  */
5118
5137
  interface VectorizeVectorMutation {
5119
5138
  /* List of ids of vectors that were successfully processed. */
@@ -5122,14 +5141,19 @@ interface VectorizeVectorMutation {
5122
5141
  count: number;
5123
5142
  }
5124
5143
  /**
5125
- * Results of an operation that performed a mutation on a set of vectors
5126
- * with the v2 version of Vectorize.
5127
- * Here, `mutationId` is the identifier for the last mutation processed by Vectorize.
5144
+ * Result type indicating a mutation on the Vectorize Index.
5145
+ * Actual mutations are processed async where the `mutationId` is the unique identifier for the operation.
5128
5146
  */
5129
- interface VectorizeVectorMutationV2 {
5130
- /* The identifier for the last mutation processed by Vectorize. */
5147
+ interface VectorizeAsyncMutation {
5148
+ /** The unique identifier for the async mutation operation containing the changeset. */
5131
5149
  mutationId: string;
5132
5150
  }
5151
+ /**
5152
+ * A Vectorize Vector Search Index for querying vectors/embeddings.
5153
+ *
5154
+ * This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released.
5155
+ * See {@link Vectorize} for its new implementation.
5156
+ */
5133
5157
  declare abstract class VectorizeIndex {
5134
5158
  /**
5135
5159
  * Get information about the currently bound index.
@@ -5171,6 +5195,52 @@ declare abstract class VectorizeIndex {
5171
5195
  */
5172
5196
  public getByIds(ids: string[]): Promise<VectorizeVector[]>;
5173
5197
  }
5198
+ /**
5199
+ * A Vectorize Vector Search Index for querying vectors/embeddings.
5200
+ *
5201
+ * Mutations in this version are async, returning a mutation id.
5202
+ */
5203
+ declare abstract class Vectorize {
5204
+ /**
5205
+ * Get information about the currently bound index.
5206
+ * @returns A promise that resolves with information about the current index.
5207
+ */
5208
+ public describe(): Promise<VectorizeIndexDetails>;
5209
+ /**
5210
+ * Use the provided vector to perform a similarity search across the index.
5211
+ * @param vector Input vector that will be used to drive the similarity search.
5212
+ * @param options Configuration options to massage the returned data.
5213
+ * @returns A promise that resolves with matched and scored vectors.
5214
+ */
5215
+ public query(
5216
+ vector: VectorFloatArray | number[],
5217
+ options: VectorizeQueryOptions<VectorizeMetadataRetrievalLevel>,
5218
+ ): Promise<VectorizeMatches>;
5219
+ /**
5220
+ * Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
5221
+ * @param vectors List of vectors that will be inserted.
5222
+ * @returns A promise that resolves with a unique identifier of a mutation containing the insert changeset.
5223
+ */
5224
+ public insert(vectors: VectorizeVector[]): Promise<VectorizeAsyncMutation>;
5225
+ /**
5226
+ * Upsert a list of vectors into the index dataset. If a provided id exists, it will be replaced with the new values.
5227
+ * @param vectors List of vectors that will be upserted.
5228
+ * @returns A promise that resolves with a unique identifier of a mutation containing the upsert changeset.
5229
+ */
5230
+ public upsert(vectors: VectorizeVector[]): Promise<VectorizeAsyncMutation>;
5231
+ /**
5232
+ * Delete a list of vectors with a matching id.
5233
+ * @param ids List of vector ids that should be deleted.
5234
+ * @returns A promise that resolves with a unique identifier of a mutation containing the delete changeset.
5235
+ */
5236
+ public deleteByIds(ids: string[]): Promise<VectorizeAsyncMutation>;
5237
+ /**
5238
+ * Get a list of vectors with a matching id.
5239
+ * @param ids List of vector ids that should be returned.
5240
+ * @returns A promise that resolves with the raw unscored vectors matching the id set.
5241
+ */
5242
+ public getByIds(ids: string[]): Promise<VectorizeVector[]>;
5243
+ }
5174
5244
  /**
5175
5245
  * The interface for "version_metadata" binding
5176
5246
  * providing metadata about the Worker Version using this binding.
@@ -1615,8 +1615,6 @@ export interface RequestInit<Cf = CfProperties> {
1615
1615
  redirect?: string;
1616
1616
  fetcher?: Fetcher | null;
1617
1617
  cf?: Cf;
1618
- /* A string indicating how the request will interact with the browser's cache to set request's cache. */
1619
- cache?: string;
1620
1618
  /* A cryptographic hash of the resource to be fetched by request. Sets request's integrity. */
1621
1619
  integrity?: string;
1622
1620
  /* An AbortSignal to set request's signal. */
@@ -4609,7 +4607,7 @@ export declare abstract class D1PreparedStatement {
4609
4607
  bind(...values: unknown[]): D1PreparedStatement;
4610
4608
  first<T = unknown>(colName: string): Promise<T | null>;
4611
4609
  first<T = Record<string, unknown>>(): Promise<T | null>;
4612
- run(): Promise<D1Response>;
4610
+ run<T = Record<string, unknown>>(): Promise<D1Result<T>>;
4613
4611
  all<T = Record<string, unknown>>(): Promise<D1Result<T>>;
4614
4612
  raw<T = unknown[]>(options: {
4615
4613
  columnNames: true;
@@ -4665,6 +4663,12 @@ export interface ForwardableEmailMessage extends EmailMessage {
4665
4663
  * @returns A promise that resolves when the email message is forwarded.
4666
4664
  */
4667
4665
  forward(rcptTo: string, headers?: Headers): Promise<void>;
4666
+ /**
4667
+ * Reply to the sender of this email message with a new EmailMessage object.
4668
+ * @param message The reply message.
4669
+ * @returns A promise that resolves when the email message is replied.
4670
+ */
4671
+ reply(message: EmailMessage): Promise<void>;
4668
4672
  }
4669
4673
  /**
4670
4674
  * A binding that allows a Worker to send email messages.
@@ -5010,11 +5014,23 @@ export type VectorizeVectorMetadataFilter = {
5010
5014
  * Distance metrics determine how other "similar" vectors are determined.
5011
5015
  */
5012
5016
  export type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
5013
- export interface VectorizeQueryOptions {
5017
+ /**
5018
+ * Metadata return levels for a Vectorize query.
5019
+ *
5020
+ * Default to "none".
5021
+ *
5022
+ * @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.
5023
+ * @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).
5024
+ * @property none No indexed metadata will be returned.
5025
+ */
5026
+ export type VectorizeMetadataRetrievalLevel = "all" | "indexed" | "none";
5027
+ export interface VectorizeQueryOptions<
5028
+ MetadataReturn extends boolean | VectorizeMetadataRetrievalLevel = boolean,
5029
+ > {
5014
5030
  topK?: number;
5015
5031
  namespace?: string;
5016
5032
  returnValues?: boolean;
5017
- returnMetadata?: boolean;
5033
+ returnMetadata?: MetadataReturn;
5018
5034
  filter?: VectorizeVectorMetadataFilter;
5019
5035
  }
5020
5036
  /**
@@ -5053,7 +5069,7 @@ export interface VectorizeVector {
5053
5069
  values: VectorFloatArray | number[];
5054
5070
  /** The namespace this vector belongs to. */
5055
5071
  namespace?: string;
5056
- /** Metadata associated with the vector. Includes the values of the other fields and potentially additional details. */
5072
+ /** Metadata associated with the vector. Includes the values of other fields and potentially additional details. */
5057
5073
  metadata?: Record<string, VectorizeVectorMetadata>;
5058
5074
  }
5059
5075
  /**
@@ -5065,7 +5081,7 @@ export type VectorizeMatch = Pick<Partial<VectorizeVector>, "values"> &
5065
5081
  score: number;
5066
5082
  };
5067
5083
  /**
5068
- * A set of vector {@link VectorizeMatch} for a particular query.
5084
+ * A set of matching {@link VectorizeMatch} for a particular query.
5069
5085
  */
5070
5086
  export interface VectorizeMatches {
5071
5087
  matches: VectorizeMatch[];
@@ -5074,6 +5090,9 @@ export interface VectorizeMatches {
5074
5090
  /**
5075
5091
  * Results of an operation that performed a mutation on a set of vectors.
5076
5092
  * Here, `ids` is a list of vectors that were successfully processed.
5093
+ *
5094
+ * This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released.
5095
+ * See {@link VectorizeAsyncMutation} for its post-beta equivalent.
5077
5096
  */
5078
5097
  export interface VectorizeVectorMutation {
5079
5098
  /* List of ids of vectors that were successfully processed. */
@@ -5082,14 +5101,19 @@ export interface VectorizeVectorMutation {
5082
5101
  count: number;
5083
5102
  }
5084
5103
  /**
5085
- * Results of an operation that performed a mutation on a set of vectors
5086
- * with the v2 version of Vectorize.
5087
- * Here, `mutationId` is the identifier for the last mutation processed by Vectorize.
5104
+ * Result type indicating a mutation on the Vectorize Index.
5105
+ * Actual mutations are processed async where the `mutationId` is the unique identifier for the operation.
5088
5106
  */
5089
- export interface VectorizeVectorMutationV2 {
5090
- /* The identifier for the last mutation processed by Vectorize. */
5107
+ export interface VectorizeAsyncMutation {
5108
+ /** The unique identifier for the async mutation operation containing the changeset. */
5091
5109
  mutationId: string;
5092
5110
  }
5111
+ /**
5112
+ * A Vectorize Vector Search Index for querying vectors/embeddings.
5113
+ *
5114
+ * This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released.
5115
+ * See {@link Vectorize} for its new implementation.
5116
+ */
5093
5117
  export declare abstract class VectorizeIndex {
5094
5118
  /**
5095
5119
  * Get information about the currently bound index.
@@ -5131,6 +5155,52 @@ export declare abstract class VectorizeIndex {
5131
5155
  */
5132
5156
  public getByIds(ids: string[]): Promise<VectorizeVector[]>;
5133
5157
  }
5158
+ /**
5159
+ * A Vectorize Vector Search Index for querying vectors/embeddings.
5160
+ *
5161
+ * Mutations in this version are async, returning a mutation id.
5162
+ */
5163
+ export declare abstract class Vectorize {
5164
+ /**
5165
+ * Get information about the currently bound index.
5166
+ * @returns A promise that resolves with information about the current index.
5167
+ */
5168
+ public describe(): Promise<VectorizeIndexDetails>;
5169
+ /**
5170
+ * Use the provided vector to perform a similarity search across the index.
5171
+ * @param vector Input vector that will be used to drive the similarity search.
5172
+ * @param options Configuration options to massage the returned data.
5173
+ * @returns A promise that resolves with matched and scored vectors.
5174
+ */
5175
+ public query(
5176
+ vector: VectorFloatArray | number[],
5177
+ options: VectorizeQueryOptions<VectorizeMetadataRetrievalLevel>,
5178
+ ): Promise<VectorizeMatches>;
5179
+ /**
5180
+ * Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
5181
+ * @param vectors List of vectors that will be inserted.
5182
+ * @returns A promise that resolves with a unique identifier of a mutation containing the insert changeset.
5183
+ */
5184
+ public insert(vectors: VectorizeVector[]): Promise<VectorizeAsyncMutation>;
5185
+ /**
5186
+ * Upsert a list of vectors into the index dataset. If a provided id exists, it will be replaced with the new values.
5187
+ * @param vectors List of vectors that will be upserted.
5188
+ * @returns A promise that resolves with a unique identifier of a mutation containing the upsert changeset.
5189
+ */
5190
+ public upsert(vectors: VectorizeVector[]): Promise<VectorizeAsyncMutation>;
5191
+ /**
5192
+ * Delete a list of vectors with a matching id.
5193
+ * @param ids List of vector ids that should be deleted.
5194
+ * @returns A promise that resolves with a unique identifier of a mutation containing the delete changeset.
5195
+ */
5196
+ public deleteByIds(ids: string[]): Promise<VectorizeAsyncMutation>;
5197
+ /**
5198
+ * Get a list of vectors with a matching id.
5199
+ * @param ids List of vector ids that should be returned.
5200
+ * @returns A promise that resolves with the raw unscored vectors matching the id set.
5201
+ */
5202
+ public getByIds(ids: string[]): Promise<VectorizeVector[]>;
5203
+ }
5134
5204
  /**
5135
5205
  * The interface for "version_metadata" binding
5136
5206
  * providing metadata about the Worker Version using this binding.
@@ -1604,12 +1604,6 @@ declare class Request<
1604
1604
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
1605
1605
  */
1606
1606
  get keepalive(): boolean;
1607
- /**
1608
- * Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching.
1609
- *
1610
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/cache)
1611
- */
1612
- get cache(): string | undefined;
1613
1607
  }
1614
1608
  interface RequestInit<Cf = CfProperties> {
1615
1609
  /* A string to set request's method. */
@@ -1622,8 +1616,6 @@ interface RequestInit<Cf = CfProperties> {
1622
1616
  redirect?: string;
1623
1617
  fetcher?: Fetcher | null;
1624
1618
  cf?: Cf;
1625
- /* A string indicating how the request will interact with the browser's cache to set request's cache. */
1626
- cache?: string;
1627
1619
  /* A cryptographic hash of the resource to be fetched by request. Sets request's integrity. */
1628
1620
  integrity?: string;
1629
1621
  /* An AbortSignal to set request's signal. */
@@ -4619,7 +4611,7 @@ declare abstract class D1PreparedStatement {
4619
4611
  bind(...values: unknown[]): D1PreparedStatement;
4620
4612
  first<T = unknown>(colName: string): Promise<T | null>;
4621
4613
  first<T = Record<string, unknown>>(): Promise<T | null>;
4622
- run(): Promise<D1Response>;
4614
+ run<T = Record<string, unknown>>(): Promise<D1Result<T>>;
4623
4615
  all<T = Record<string, unknown>>(): Promise<D1Result<T>>;
4624
4616
  raw<T = unknown[]>(options: {
4625
4617
  columnNames: true;
@@ -4675,6 +4667,12 @@ interface ForwardableEmailMessage extends EmailMessage {
4675
4667
  * @returns A promise that resolves when the email message is forwarded.
4676
4668
  */
4677
4669
  forward(rcptTo: string, headers?: Headers): Promise<void>;
4670
+ /**
4671
+ * Reply to the sender of this email message with a new EmailMessage object.
4672
+ * @param message The reply message.
4673
+ * @returns A promise that resolves when the email message is replied.
4674
+ */
4675
+ reply(message: EmailMessage): Promise<void>;
4678
4676
  }
4679
4677
  /**
4680
4678
  * A binding that allows a Worker to send email messages.
@@ -5082,11 +5080,23 @@ type VectorizeVectorMetadataFilter = {
5082
5080
  * Distance metrics determine how other "similar" vectors are determined.
5083
5081
  */
5084
5082
  type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
5085
- interface VectorizeQueryOptions {
5083
+ /**
5084
+ * Metadata return levels for a Vectorize query.
5085
+ *
5086
+ * Default to "none".
5087
+ *
5088
+ * @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.
5089
+ * @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).
5090
+ * @property none No indexed metadata will be returned.
5091
+ */
5092
+ type VectorizeMetadataRetrievalLevel = "all" | "indexed" | "none";
5093
+ interface VectorizeQueryOptions<
5094
+ MetadataReturn extends boolean | VectorizeMetadataRetrievalLevel = boolean,
5095
+ > {
5086
5096
  topK?: number;
5087
5097
  namespace?: string;
5088
5098
  returnValues?: boolean;
5089
- returnMetadata?: boolean;
5099
+ returnMetadata?: MetadataReturn;
5090
5100
  filter?: VectorizeVectorMetadataFilter;
5091
5101
  }
5092
5102
  /**
@@ -5125,7 +5135,7 @@ interface VectorizeVector {
5125
5135
  values: VectorFloatArray | number[];
5126
5136
  /** The namespace this vector belongs to. */
5127
5137
  namespace?: string;
5128
- /** Metadata associated with the vector. Includes the values of the other fields and potentially additional details. */
5138
+ /** Metadata associated with the vector. Includes the values of other fields and potentially additional details. */
5129
5139
  metadata?: Record<string, VectorizeVectorMetadata>;
5130
5140
  }
5131
5141
  /**
@@ -5137,7 +5147,7 @@ type VectorizeMatch = Pick<Partial<VectorizeVector>, "values"> &
5137
5147
  score: number;
5138
5148
  };
5139
5149
  /**
5140
- * A set of vector {@link VectorizeMatch} for a particular query.
5150
+ * A set of matching {@link VectorizeMatch} for a particular query.
5141
5151
  */
5142
5152
  interface VectorizeMatches {
5143
5153
  matches: VectorizeMatch[];
@@ -5146,6 +5156,9 @@ interface VectorizeMatches {
5146
5156
  /**
5147
5157
  * Results of an operation that performed a mutation on a set of vectors.
5148
5158
  * Here, `ids` is a list of vectors that were successfully processed.
5159
+ *
5160
+ * This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released.
5161
+ * See {@link VectorizeAsyncMutation} for its post-beta equivalent.
5149
5162
  */
5150
5163
  interface VectorizeVectorMutation {
5151
5164
  /* List of ids of vectors that were successfully processed. */
@@ -5154,14 +5167,19 @@ interface VectorizeVectorMutation {
5154
5167
  count: number;
5155
5168
  }
5156
5169
  /**
5157
- * Results of an operation that performed a mutation on a set of vectors
5158
- * with the v2 version of Vectorize.
5159
- * Here, `mutationId` is the identifier for the last mutation processed by Vectorize.
5170
+ * Result type indicating a mutation on the Vectorize Index.
5171
+ * Actual mutations are processed async where the `mutationId` is the unique identifier for the operation.
5160
5172
  */
5161
- interface VectorizeVectorMutationV2 {
5162
- /* The identifier for the last mutation processed by Vectorize. */
5173
+ interface VectorizeAsyncMutation {
5174
+ /** The unique identifier for the async mutation operation containing the changeset. */
5163
5175
  mutationId: string;
5164
5176
  }
5177
+ /**
5178
+ * A Vectorize Vector Search Index for querying vectors/embeddings.
5179
+ *
5180
+ * This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released.
5181
+ * See {@link Vectorize} for its new implementation.
5182
+ */
5165
5183
  declare abstract class VectorizeIndex {
5166
5184
  /**
5167
5185
  * Get information about the currently bound index.
@@ -5203,6 +5221,52 @@ declare abstract class VectorizeIndex {
5203
5221
  */
5204
5222
  public getByIds(ids: string[]): Promise<VectorizeVector[]>;
5205
5223
  }
5224
+ /**
5225
+ * A Vectorize Vector Search Index for querying vectors/embeddings.
5226
+ *
5227
+ * Mutations in this version are async, returning a mutation id.
5228
+ */
5229
+ declare abstract class Vectorize {
5230
+ /**
5231
+ * Get information about the currently bound index.
5232
+ * @returns A promise that resolves with information about the current index.
5233
+ */
5234
+ public describe(): Promise<VectorizeIndexDetails>;
5235
+ /**
5236
+ * Use the provided vector to perform a similarity search across the index.
5237
+ * @param vector Input vector that will be used to drive the similarity search.
5238
+ * @param options Configuration options to massage the returned data.
5239
+ * @returns A promise that resolves with matched and scored vectors.
5240
+ */
5241
+ public query(
5242
+ vector: VectorFloatArray | number[],
5243
+ options: VectorizeQueryOptions<VectorizeMetadataRetrievalLevel>,
5244
+ ): Promise<VectorizeMatches>;
5245
+ /**
5246
+ * Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
5247
+ * @param vectors List of vectors that will be inserted.
5248
+ * @returns A promise that resolves with a unique identifier of a mutation containing the insert changeset.
5249
+ */
5250
+ public insert(vectors: VectorizeVector[]): Promise<VectorizeAsyncMutation>;
5251
+ /**
5252
+ * Upsert a list of vectors into the index dataset. If a provided id exists, it will be replaced with the new values.
5253
+ * @param vectors List of vectors that will be upserted.
5254
+ * @returns A promise that resolves with a unique identifier of a mutation containing the upsert changeset.
5255
+ */
5256
+ public upsert(vectors: VectorizeVector[]): Promise<VectorizeAsyncMutation>;
5257
+ /**
5258
+ * Delete a list of vectors with a matching id.
5259
+ * @param ids List of vector ids that should be deleted.
5260
+ * @returns A promise that resolves with a unique identifier of a mutation containing the delete changeset.
5261
+ */
5262
+ public deleteByIds(ids: string[]): Promise<VectorizeAsyncMutation>;
5263
+ /**
5264
+ * Get a list of vectors with a matching id.
5265
+ * @param ids List of vector ids that should be returned.
5266
+ * @returns A promise that resolves with the raw unscored vectors matching the id set.
5267
+ */
5268
+ public getByIds(ids: string[]): Promise<VectorizeVector[]>;
5269
+ }
5206
5270
  /**
5207
5271
  * The interface for "version_metadata" binding
5208
5272
  * providing metadata about the Worker Version using this binding.
@@ -1609,12 +1609,6 @@ export declare class Request<
1609
1609
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
1610
1610
  */
1611
1611
  get keepalive(): boolean;
1612
- /**
1613
- * Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching.
1614
- *
1615
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/cache)
1616
- */
1617
- get cache(): string | undefined;
1618
1612
  }
1619
1613
  export interface RequestInit<Cf = CfProperties> {
1620
1614
  /* A string to set request's method. */
@@ -1627,8 +1621,6 @@ export interface RequestInit<Cf = CfProperties> {
1627
1621
  redirect?: string;
1628
1622
  fetcher?: Fetcher | null;
1629
1623
  cf?: Cf;
1630
- /* A string indicating how the request will interact with the browser's cache to set request's cache. */
1631
- cache?: string;
1632
1624
  /* A cryptographic hash of the resource to be fetched by request. Sets request's integrity. */
1633
1625
  integrity?: string;
1634
1626
  /* An AbortSignal to set request's signal. */
@@ -4641,7 +4633,7 @@ export declare abstract class D1PreparedStatement {
4641
4633
  bind(...values: unknown[]): D1PreparedStatement;
4642
4634
  first<T = unknown>(colName: string): Promise<T | null>;
4643
4635
  first<T = Record<string, unknown>>(): Promise<T | null>;
4644
- run(): Promise<D1Response>;
4636
+ run<T = Record<string, unknown>>(): Promise<D1Result<T>>;
4645
4637
  all<T = Record<string, unknown>>(): Promise<D1Result<T>>;
4646
4638
  raw<T = unknown[]>(options: {
4647
4639
  columnNames: true;
@@ -4697,6 +4689,12 @@ export interface ForwardableEmailMessage extends EmailMessage {
4697
4689
  * @returns A promise that resolves when the email message is forwarded.
4698
4690
  */
4699
4691
  forward(rcptTo: string, headers?: Headers): Promise<void>;
4692
+ /**
4693
+ * Reply to the sender of this email message with a new EmailMessage object.
4694
+ * @param message The reply message.
4695
+ * @returns A promise that resolves when the email message is replied.
4696
+ */
4697
+ reply(message: EmailMessage): Promise<void>;
4700
4698
  }
4701
4699
  /**
4702
4700
  * A binding that allows a Worker to send email messages.
@@ -5042,11 +5040,23 @@ export type VectorizeVectorMetadataFilter = {
5042
5040
  * Distance metrics determine how other "similar" vectors are determined.
5043
5041
  */
5044
5042
  export type VectorizeDistanceMetric = "euclidean" | "cosine" | "dot-product";
5045
- export interface VectorizeQueryOptions {
5043
+ /**
5044
+ * Metadata return levels for a Vectorize query.
5045
+ *
5046
+ * Default to "none".
5047
+ *
5048
+ * @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.
5049
+ * @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).
5050
+ * @property none No indexed metadata will be returned.
5051
+ */
5052
+ export type VectorizeMetadataRetrievalLevel = "all" | "indexed" | "none";
5053
+ export interface VectorizeQueryOptions<
5054
+ MetadataReturn extends boolean | VectorizeMetadataRetrievalLevel = boolean,
5055
+ > {
5046
5056
  topK?: number;
5047
5057
  namespace?: string;
5048
5058
  returnValues?: boolean;
5049
- returnMetadata?: boolean;
5059
+ returnMetadata?: MetadataReturn;
5050
5060
  filter?: VectorizeVectorMetadataFilter;
5051
5061
  }
5052
5062
  /**
@@ -5085,7 +5095,7 @@ export interface VectorizeVector {
5085
5095
  values: VectorFloatArray | number[];
5086
5096
  /** The namespace this vector belongs to. */
5087
5097
  namespace?: string;
5088
- /** Metadata associated with the vector. Includes the values of the other fields and potentially additional details. */
5098
+ /** Metadata associated with the vector. Includes the values of other fields and potentially additional details. */
5089
5099
  metadata?: Record<string, VectorizeVectorMetadata>;
5090
5100
  }
5091
5101
  /**
@@ -5097,7 +5107,7 @@ export type VectorizeMatch = Pick<Partial<VectorizeVector>, "values"> &
5097
5107
  score: number;
5098
5108
  };
5099
5109
  /**
5100
- * A set of vector {@link VectorizeMatch} for a particular query.
5110
+ * A set of matching {@link VectorizeMatch} for a particular query.
5101
5111
  */
5102
5112
  export interface VectorizeMatches {
5103
5113
  matches: VectorizeMatch[];
@@ -5106,6 +5116,9 @@ export interface VectorizeMatches {
5106
5116
  /**
5107
5117
  * Results of an operation that performed a mutation on a set of vectors.
5108
5118
  * Here, `ids` is a list of vectors that were successfully processed.
5119
+ *
5120
+ * This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released.
5121
+ * See {@link VectorizeAsyncMutation} for its post-beta equivalent.
5109
5122
  */
5110
5123
  export interface VectorizeVectorMutation {
5111
5124
  /* List of ids of vectors that were successfully processed. */
@@ -5114,14 +5127,19 @@ export interface VectorizeVectorMutation {
5114
5127
  count: number;
5115
5128
  }
5116
5129
  /**
5117
- * Results of an operation that performed a mutation on a set of vectors
5118
- * with the v2 version of Vectorize.
5119
- * Here, `mutationId` is the identifier for the last mutation processed by Vectorize.
5130
+ * Result type indicating a mutation on the Vectorize Index.
5131
+ * Actual mutations are processed async where the `mutationId` is the unique identifier for the operation.
5120
5132
  */
5121
- export interface VectorizeVectorMutationV2 {
5122
- /* The identifier for the last mutation processed by Vectorize. */
5133
+ export interface VectorizeAsyncMutation {
5134
+ /** The unique identifier for the async mutation operation containing the changeset. */
5123
5135
  mutationId: string;
5124
5136
  }
5137
+ /**
5138
+ * A Vectorize Vector Search Index for querying vectors/embeddings.
5139
+ *
5140
+ * This type is exclusively for the Vectorize **beta** and will be deprecated once Vectorize RC is released.
5141
+ * See {@link Vectorize} for its new implementation.
5142
+ */
5125
5143
  export declare abstract class VectorizeIndex {
5126
5144
  /**
5127
5145
  * Get information about the currently bound index.
@@ -5163,6 +5181,52 @@ export declare abstract class VectorizeIndex {
5163
5181
  */
5164
5182
  public getByIds(ids: string[]): Promise<VectorizeVector[]>;
5165
5183
  }
5184
+ /**
5185
+ * A Vectorize Vector Search Index for querying vectors/embeddings.
5186
+ *
5187
+ * Mutations in this version are async, returning a mutation id.
5188
+ */
5189
+ export declare abstract class Vectorize {
5190
+ /**
5191
+ * Get information about the currently bound index.
5192
+ * @returns A promise that resolves with information about the current index.
5193
+ */
5194
+ public describe(): Promise<VectorizeIndexDetails>;
5195
+ /**
5196
+ * Use the provided vector to perform a similarity search across the index.
5197
+ * @param vector Input vector that will be used to drive the similarity search.
5198
+ * @param options Configuration options to massage the returned data.
5199
+ * @returns A promise that resolves with matched and scored vectors.
5200
+ */
5201
+ public query(
5202
+ vector: VectorFloatArray | number[],
5203
+ options: VectorizeQueryOptions<VectorizeMetadataRetrievalLevel>,
5204
+ ): Promise<VectorizeMatches>;
5205
+ /**
5206
+ * Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
5207
+ * @param vectors List of vectors that will be inserted.
5208
+ * @returns A promise that resolves with a unique identifier of a mutation containing the insert changeset.
5209
+ */
5210
+ public insert(vectors: VectorizeVector[]): Promise<VectorizeAsyncMutation>;
5211
+ /**
5212
+ * Upsert a list of vectors into the index dataset. If a provided id exists, it will be replaced with the new values.
5213
+ * @param vectors List of vectors that will be upserted.
5214
+ * @returns A promise that resolves with a unique identifier of a mutation containing the upsert changeset.
5215
+ */
5216
+ public upsert(vectors: VectorizeVector[]): Promise<VectorizeAsyncMutation>;
5217
+ /**
5218
+ * Delete a list of vectors with a matching id.
5219
+ * @param ids List of vector ids that should be deleted.
5220
+ * @returns A promise that resolves with a unique identifier of a mutation containing the delete changeset.
5221
+ */
5222
+ public deleteByIds(ids: string[]): Promise<VectorizeAsyncMutation>;
5223
+ /**
5224
+ * Get a list of vectors with a matching id.
5225
+ * @param ids List of vector ids that should be returned.
5226
+ * @returns A promise that resolves with the raw unscored vectors matching the id set.
5227
+ */
5228
+ public getByIds(ids: string[]): Promise<VectorizeVector[]>;
5229
+ }
5166
5230
  /**
5167
5231
  * The interface for "version_metadata" binding
5168
5232
  * providing metadata about the Worker Version using this binding.