@supabase/storage-js 2.116.0-canary.0 → 2.116.0-canary.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -777,7 +777,7 @@ const { data, error } = await index.queryVectors({
777
777
  })
778
778
 
779
779
  if (data) {
780
- data.matches.forEach((match) => {
780
+ data.vectors.forEach((match) => {
781
781
  console.log(`${match.key}: distance=${match.distance}`)
782
782
  console.log('Metadata:', match.metadata)
783
783
  })
@@ -996,11 +996,36 @@ const { data, error } = await index.queryVectors({
996
996
  })
997
997
 
998
998
  // Results ordered by similarity
999
- data?.matches.forEach((match) => {
999
+ data?.vectors.forEach((match) => {
1000
1000
  console.log(`${match.key}: distance=${match.distance}`)
1001
1001
  })
1002
1002
  ```
1003
1003
 
1004
+ S3 vector buckets support deep queries with `topK` up to 10,000, returning at most 100 vectors per response. Pass the response's `nextToken` with the same query to retrieve the next page:
1005
+
1006
+ ```typescript
1007
+ const query = {
1008
+ queryVector: { float32: embedding },
1009
+ topK: 1000,
1010
+ returnDistance: true,
1011
+ }
1012
+
1013
+ let nextToken: string | undefined
1014
+
1015
+ do {
1016
+ const { data, error } = await index.queryVectors({ ...query, nextToken })
1017
+ if (error) throw error
1018
+
1019
+ for (const vector of data.vectors) {
1020
+ console.log(`${vector.key}: distance=${vector.distance}`)
1021
+ }
1022
+
1023
+ nextToken = data.nextToken
1024
+ } while (nextToken)
1025
+ ```
1026
+
1027
+ The pgvector backend supports `topK` up to 100 and does not support `nextToken` pagination.
1028
+
1004
1029
  **Filter Syntax:**
1005
1030
  The `filter` parameter accepts arbitrary JSON for metadata filtering. Non-filterable keys (configured at index creation) cannot be used in filters but can still be returned.
1006
1031
 
package/dist/index.cjs CHANGED
@@ -1629,7 +1629,7 @@ var StorageFileApi = class extends BaseApiClient {
1629
1629
 
1630
1630
  //#endregion
1631
1631
  //#region src/lib/version.ts
1632
- const version = "2.116.0-canary.0";
1632
+ const version = "2.116.0-canary.2";
1633
1633
 
1634
1634
  //#endregion
1635
1635
  //#region src/lib/constants.ts
@@ -1992,8 +1992,8 @@ var StorageBucketApi = class extends BaseApiClient {
1992
1992
  * is overwritten. Send at least one rule. Call {@link deleteBucketLifecycle}
1993
1993
  * to remove the policy.
1994
1994
  *
1995
- * Each rule currently supports only `noncurrentVersionExpiration`. Set
1996
- * `filter` to `{}`. Prefix filters, tag filters, and current-object
1995
+ * Each rule currently supports only `noncurrentVersionExpiration`. `filter`
1996
+ * is required and must be `{}`. Prefix filters, tag filters, and current-object
1997
1997
  * expiration are rejected. Rule IDs must be unique. Omit `id` and the
1998
1998
  * server generates one.
1999
1999
  *
@@ -3154,7 +3154,7 @@ var VectorIndexScope = class extends VectorDataApi {
3154
3154
  * @category Storage
3155
3155
  * @subcategory Vector Buckets
3156
3156
  * @param options - Query options (bucket and index names automatically set)
3157
- * @returns Promise with response containing matches array of similar vectors ordered by distance or error
3157
+ * @returns Promise with response containing vectors ordered by distance, an optional pagination token, or an error
3158
3158
  *
3159
3159
  * @example Query similar vectors
3160
3160
  * ```typescript