@supabase/storage-js 2.81.2-canary.3 → 2.82.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/README.md +10 -0
- package/dist/main/StorageClient.d.ts +15 -1
- package/dist/main/StorageClient.d.ts.map +1 -1
- package/dist/main/StorageClient.js +15 -1
- package/dist/main/StorageClient.js.map +1 -1
- package/dist/main/lib/vectors/StorageVectorsClient.d.ts +99 -18
- package/dist/main/lib/vectors/StorageVectorsClient.d.ts.map +1 -1
- package/dist/main/lib/vectors/StorageVectorsClient.js +95 -17
- package/dist/main/lib/vectors/StorageVectorsClient.js.map +1 -1
- package/dist/main/lib/vectors/VectorBucketApi.d.ts +35 -7
- package/dist/main/lib/vectors/VectorBucketApi.d.ts.map +1 -1
- package/dist/main/lib/vectors/VectorBucketApi.js +35 -7
- package/dist/main/lib/vectors/VectorBucketApi.js.map +1 -1
- package/dist/main/lib/vectors/VectorDataApi.d.ts +44 -8
- package/dist/main/lib/vectors/VectorDataApi.d.ts.map +1 -1
- package/dist/main/lib/vectors/VectorDataApi.js +44 -8
- package/dist/main/lib/vectors/VectorDataApi.js.map +1 -1
- package/dist/main/lib/vectors/VectorIndexApi.d.ts +43 -8
- package/dist/main/lib/vectors/VectorIndexApi.d.ts.map +1 -1
- package/dist/main/lib/vectors/VectorIndexApi.js +39 -7
- package/dist/main/lib/vectors/VectorIndexApi.js.map +1 -1
- package/dist/main/lib/version.d.ts +1 -1
- package/dist/main/lib/version.d.ts.map +1 -1
- package/dist/main/lib/version.js +1 -1
- package/dist/main/lib/version.js.map +1 -1
- package/dist/main/packages/StorageAnalyticsApi.d.ts +77 -26
- package/dist/main/packages/StorageAnalyticsApi.d.ts.map +1 -1
- package/dist/main/packages/StorageAnalyticsApi.js +77 -26
- package/dist/main/packages/StorageAnalyticsApi.js.map +1 -1
- package/dist/main/packages/StorageBucketApi.d.ts +143 -1
- package/dist/main/packages/StorageBucketApi.d.ts.map +1 -1
- package/dist/main/packages/StorageBucketApi.js +143 -1
- package/dist/main/packages/StorageBucketApi.js.map +1 -1
- package/dist/main/packages/StorageFileApi.d.ts +410 -2
- package/dist/main/packages/StorageFileApi.d.ts.map +1 -1
- package/dist/main/packages/StorageFileApi.js +410 -2
- package/dist/main/packages/StorageFileApi.js.map +1 -1
- package/dist/module/StorageClient.d.ts +15 -1
- package/dist/module/StorageClient.d.ts.map +1 -1
- package/dist/module/StorageClient.js +15 -1
- package/dist/module/StorageClient.js.map +1 -1
- package/dist/module/lib/vectors/StorageVectorsClient.d.ts +99 -18
- package/dist/module/lib/vectors/StorageVectorsClient.d.ts.map +1 -1
- package/dist/module/lib/vectors/StorageVectorsClient.js +95 -17
- package/dist/module/lib/vectors/StorageVectorsClient.js.map +1 -1
- package/dist/module/lib/vectors/VectorBucketApi.d.ts +35 -7
- package/dist/module/lib/vectors/VectorBucketApi.d.ts.map +1 -1
- package/dist/module/lib/vectors/VectorBucketApi.js +35 -7
- package/dist/module/lib/vectors/VectorBucketApi.js.map +1 -1
- package/dist/module/lib/vectors/VectorDataApi.d.ts +44 -8
- package/dist/module/lib/vectors/VectorDataApi.d.ts.map +1 -1
- package/dist/module/lib/vectors/VectorDataApi.js +44 -8
- package/dist/module/lib/vectors/VectorDataApi.js.map +1 -1
- package/dist/module/lib/vectors/VectorIndexApi.d.ts +43 -8
- package/dist/module/lib/vectors/VectorIndexApi.d.ts.map +1 -1
- package/dist/module/lib/vectors/VectorIndexApi.js +39 -7
- package/dist/module/lib/vectors/VectorIndexApi.js.map +1 -1
- package/dist/module/lib/version.d.ts +1 -1
- package/dist/module/lib/version.d.ts.map +1 -1
- package/dist/module/lib/version.js +1 -1
- package/dist/module/lib/version.js.map +1 -1
- package/dist/module/packages/StorageAnalyticsApi.d.ts +77 -26
- package/dist/module/packages/StorageAnalyticsApi.d.ts.map +1 -1
- package/dist/module/packages/StorageAnalyticsApi.js +77 -26
- package/dist/module/packages/StorageAnalyticsApi.js.map +1 -1
- package/dist/module/packages/StorageBucketApi.d.ts +143 -1
- package/dist/module/packages/StorageBucketApi.d.ts.map +1 -1
- package/dist/module/packages/StorageBucketApi.js +143 -1
- package/dist/module/packages/StorageBucketApi.js.map +1 -1
- package/dist/module/packages/StorageFileApi.d.ts +410 -2
- package/dist/module/packages/StorageFileApi.d.ts.map +1 -1
- package/dist/module/packages/StorageFileApi.js +410 -2
- package/dist/module/packages/StorageFileApi.js.map +1 -1
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/umd/supabase.js +1 -1
- package/package.json +1 -1
- package/src/StorageClient.ts +15 -1
- package/src/lib/vectors/StorageVectorsClient.ts +99 -18
- package/src/lib/vectors/VectorBucketApi.ts +35 -7
- package/src/lib/vectors/VectorDataApi.ts +44 -8
- package/src/lib/vectors/VectorIndexApi.ts +43 -8
- package/src/lib/version.ts +1 -1
- package/src/packages/StorageAnalyticsApi.ts +77 -26
- package/src/packages/StorageBucketApi.ts +143 -1
- package/src/packages/StorageFileApi.ts +410 -2
package/src/StorageClient.ts
CHANGED
|
@@ -12,6 +12,7 @@ export class StorageClient extends StorageBucketApi {
|
|
|
12
12
|
/**
|
|
13
13
|
* Creates a client for Storage buckets, files, analytics, and vectors.
|
|
14
14
|
*
|
|
15
|
+
* @category File Buckets
|
|
15
16
|
* @example
|
|
16
17
|
* ```ts
|
|
17
18
|
* import { StorageClient } from '@supabase/storage-js'
|
|
@@ -34,17 +35,27 @@ export class StorageClient extends StorageBucketApi {
|
|
|
34
35
|
/**
|
|
35
36
|
* Perform file operation in a bucket.
|
|
36
37
|
*
|
|
38
|
+
* @category File Buckets
|
|
37
39
|
* @param id The bucket id to operate on.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```typescript
|
|
43
|
+
* const avatars = storage.from('avatars')
|
|
44
|
+
* ```
|
|
38
45
|
*/
|
|
39
46
|
from(id: string): StorageFileApi {
|
|
40
47
|
return new StorageFileApi(this.url, this.headers, id, this.fetch)
|
|
41
48
|
}
|
|
42
49
|
|
|
43
50
|
/**
|
|
51
|
+
*
|
|
52
|
+
* @alpha
|
|
53
|
+
*
|
|
44
54
|
* Access vector storage operations.
|
|
45
55
|
*
|
|
46
|
-
* **
|
|
56
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
47
57
|
*
|
|
58
|
+
* @category Vector Buckets
|
|
48
59
|
* @returns A StorageVectorsClient instance configured with the current storage settings.
|
|
49
60
|
*/
|
|
50
61
|
get vectors(): StorageVectorsClient {
|
|
@@ -57,6 +68,9 @@ export class StorageClient extends StorageBucketApi {
|
|
|
57
68
|
/**
|
|
58
69
|
* Access analytics storage operations using Iceberg tables.
|
|
59
70
|
*
|
|
71
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
72
|
+
*
|
|
73
|
+
* @category Analytics Buckets
|
|
60
74
|
* @returns A StorageAnalyticsApi instance configured with the current storage settings.
|
|
61
75
|
* @example
|
|
62
76
|
* ```typescript
|
|
@@ -12,9 +12,12 @@ import {
|
|
|
12
12
|
} from './types'
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
+
*
|
|
16
|
+
* @alpha
|
|
17
|
+
*
|
|
15
18
|
* Configuration options for the Storage Vectors client
|
|
16
19
|
*
|
|
17
|
-
* **
|
|
20
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
18
21
|
*/
|
|
19
22
|
export interface StorageVectorsClientOptions {
|
|
20
23
|
/**
|
|
@@ -29,10 +32,13 @@ export interface StorageVectorsClientOptions {
|
|
|
29
32
|
}
|
|
30
33
|
|
|
31
34
|
/**
|
|
35
|
+
*
|
|
36
|
+
* @alpha
|
|
37
|
+
*
|
|
32
38
|
* Main client for interacting with S3 Vectors API
|
|
33
39
|
* Provides access to bucket, index, and vector data operations
|
|
34
40
|
*
|
|
35
|
-
* **
|
|
41
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
36
42
|
*
|
|
37
43
|
* **Usage Patterns:**
|
|
38
44
|
*
|
|
@@ -87,24 +93,36 @@ export interface StorageVectorsClientOptions {
|
|
|
87
93
|
*/
|
|
88
94
|
export class StorageVectorsClient extends VectorBucketApi {
|
|
89
95
|
/**
|
|
96
|
+
* @alpha
|
|
97
|
+
*
|
|
90
98
|
* Creates a StorageVectorsClient that can manage buckets, indexes, and vectors.
|
|
91
99
|
*
|
|
92
|
-
* **
|
|
100
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
93
101
|
*
|
|
102
|
+
* @category Vector Buckets
|
|
94
103
|
* @param url - Base URL of the Storage Vectors REST API.
|
|
95
104
|
* @param options.headers - Optional headers (for example `Authorization`) applied to every request.
|
|
96
105
|
* @param options.fetch - Optional custom `fetch` implementation for non-browser runtimes.
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```typescript
|
|
109
|
+
* const client = new StorageVectorsClient(url, options)
|
|
110
|
+
* ```
|
|
97
111
|
*/
|
|
98
112
|
constructor(url: string, options: StorageVectorsClientOptions = {}) {
|
|
99
113
|
super(url, options.headers || {}, options.fetch)
|
|
100
114
|
}
|
|
101
115
|
|
|
102
116
|
/**
|
|
117
|
+
*
|
|
118
|
+
* @alpha
|
|
119
|
+
*
|
|
103
120
|
* Access operations for a specific vector bucket
|
|
104
121
|
* Returns a scoped client for index and vector operations within the bucket
|
|
105
122
|
*
|
|
106
|
-
* **
|
|
123
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
107
124
|
*
|
|
125
|
+
* @category Vector Buckets
|
|
108
126
|
* @param vectorBucketName - Name of the vector bucket
|
|
109
127
|
* @returns Bucket-scoped client with index and vector operations
|
|
110
128
|
*
|
|
@@ -130,18 +148,29 @@ export class StorageVectorsClient extends VectorBucketApi {
|
|
|
130
148
|
}
|
|
131
149
|
|
|
132
150
|
/**
|
|
151
|
+
*
|
|
152
|
+
* @alpha
|
|
153
|
+
*
|
|
133
154
|
* Scoped client for operations within a specific vector bucket
|
|
134
155
|
* Provides index management and access to vector operations
|
|
135
156
|
*
|
|
136
|
-
* **
|
|
157
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
137
158
|
*/
|
|
138
159
|
export class VectorBucketScope extends VectorIndexApi {
|
|
139
160
|
private vectorBucketName: string
|
|
140
161
|
|
|
141
162
|
/**
|
|
163
|
+
* @alpha
|
|
164
|
+
*
|
|
142
165
|
* Creates a helper that automatically scopes all index operations to the provided bucket.
|
|
143
166
|
*
|
|
144
|
-
* **
|
|
167
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
168
|
+
*
|
|
169
|
+
* @category Vector Buckets
|
|
170
|
+
* @example
|
|
171
|
+
* ```typescript
|
|
172
|
+
* const bucket = client.bucket('embeddings-prod')
|
|
173
|
+
* ```
|
|
145
174
|
*/
|
|
146
175
|
constructor(
|
|
147
176
|
url: string,
|
|
@@ -154,11 +183,15 @@ export class VectorBucketScope extends VectorIndexApi {
|
|
|
154
183
|
}
|
|
155
184
|
|
|
156
185
|
/**
|
|
186
|
+
*
|
|
187
|
+
* @alpha
|
|
188
|
+
*
|
|
157
189
|
* Creates a new vector index in this bucket
|
|
158
190
|
* Convenience method that automatically includes the bucket name
|
|
159
191
|
*
|
|
160
|
-
* **
|
|
192
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
161
193
|
*
|
|
194
|
+
* @category Vector Buckets
|
|
162
195
|
* @param options - Index configuration (vectorBucketName is automatically set)
|
|
163
196
|
* @returns Promise with empty response on success or error
|
|
164
197
|
*
|
|
@@ -184,11 +217,15 @@ export class VectorBucketScope extends VectorIndexApi {
|
|
|
184
217
|
}
|
|
185
218
|
|
|
186
219
|
/**
|
|
220
|
+
*
|
|
221
|
+
* @alpha
|
|
222
|
+
*
|
|
187
223
|
* Lists indexes in this bucket
|
|
188
224
|
* Convenience method that automatically includes the bucket name
|
|
189
225
|
*
|
|
190
|
-
* **
|
|
226
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
191
227
|
*
|
|
228
|
+
* @category Vector Buckets
|
|
192
229
|
* @param options - Listing options (vectorBucketName is automatically set)
|
|
193
230
|
* @returns Promise with list of indexes or error
|
|
194
231
|
*
|
|
@@ -206,11 +243,15 @@ export class VectorBucketScope extends VectorIndexApi {
|
|
|
206
243
|
}
|
|
207
244
|
|
|
208
245
|
/**
|
|
246
|
+
*
|
|
247
|
+
* @alpha
|
|
248
|
+
*
|
|
209
249
|
* Retrieves metadata for a specific index in this bucket
|
|
210
250
|
* Convenience method that automatically includes the bucket name
|
|
211
251
|
*
|
|
212
|
-
* **
|
|
252
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
213
253
|
*
|
|
254
|
+
* @category Vector Buckets
|
|
214
255
|
* @param indexName - Name of the index to retrieve
|
|
215
256
|
* @returns Promise with index metadata or error
|
|
216
257
|
*
|
|
@@ -226,11 +267,15 @@ export class VectorBucketScope extends VectorIndexApi {
|
|
|
226
267
|
}
|
|
227
268
|
|
|
228
269
|
/**
|
|
270
|
+
*
|
|
271
|
+
* @alpha
|
|
272
|
+
*
|
|
229
273
|
* Deletes an index from this bucket
|
|
230
274
|
* Convenience method that automatically includes the bucket name
|
|
231
275
|
*
|
|
232
|
-
* **
|
|
276
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
233
277
|
*
|
|
278
|
+
* @category Vector Buckets
|
|
234
279
|
* @param indexName - Name of the index to delete
|
|
235
280
|
* @returns Promise with empty response on success or error
|
|
236
281
|
*
|
|
@@ -245,11 +290,15 @@ export class VectorBucketScope extends VectorIndexApi {
|
|
|
245
290
|
}
|
|
246
291
|
|
|
247
292
|
/**
|
|
293
|
+
*
|
|
294
|
+
* @alpha
|
|
295
|
+
*
|
|
248
296
|
* Access operations for a specific index within this bucket
|
|
249
297
|
* Returns a scoped client for vector data operations
|
|
250
298
|
*
|
|
251
|
-
* **
|
|
299
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
252
300
|
*
|
|
301
|
+
* @category Vector Buckets
|
|
253
302
|
* @param indexName - Name of the index
|
|
254
303
|
* @returns Index-scoped client with vector data operations
|
|
255
304
|
*
|
|
@@ -283,19 +332,31 @@ export class VectorBucketScope extends VectorIndexApi {
|
|
|
283
332
|
}
|
|
284
333
|
|
|
285
334
|
/**
|
|
335
|
+
*
|
|
336
|
+
* @alpha
|
|
337
|
+
*
|
|
286
338
|
* Scoped client for operations within a specific vector index
|
|
287
339
|
* Provides vector data operations (put, get, list, query, delete)
|
|
288
340
|
*
|
|
289
|
-
* **
|
|
341
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
290
342
|
*/
|
|
291
343
|
export class VectorIndexScope extends VectorDataApi {
|
|
292
344
|
private vectorBucketName: string
|
|
293
345
|
private indexName: string
|
|
294
346
|
|
|
295
347
|
/**
|
|
348
|
+
*
|
|
349
|
+
* @alpha
|
|
350
|
+
*
|
|
296
351
|
* Creates a helper that automatically scopes all vector operations to the provided bucket/index names.
|
|
297
352
|
*
|
|
298
|
-
* **
|
|
353
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
354
|
+
*
|
|
355
|
+
* @category Vector Buckets
|
|
356
|
+
* @example
|
|
357
|
+
* ```typescript
|
|
358
|
+
* const index = client.bucket('embeddings-prod').index('documents-openai')
|
|
359
|
+
* ```
|
|
299
360
|
*/
|
|
300
361
|
constructor(
|
|
301
362
|
url: string,
|
|
@@ -310,11 +371,15 @@ export class VectorIndexScope extends VectorDataApi {
|
|
|
310
371
|
}
|
|
311
372
|
|
|
312
373
|
/**
|
|
374
|
+
*
|
|
375
|
+
* @alpha
|
|
376
|
+
*
|
|
313
377
|
* Inserts or updates vectors in this index
|
|
314
378
|
* Convenience method that automatically includes bucket and index names
|
|
315
379
|
*
|
|
316
|
-
* **
|
|
380
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
317
381
|
*
|
|
382
|
+
* @category Vector Buckets
|
|
318
383
|
* @param options - Vector insertion options (bucket and index names automatically set)
|
|
319
384
|
* @returns Promise with empty response on success or error
|
|
320
385
|
*
|
|
@@ -341,11 +406,15 @@ export class VectorIndexScope extends VectorDataApi {
|
|
|
341
406
|
}
|
|
342
407
|
|
|
343
408
|
/**
|
|
409
|
+
*
|
|
410
|
+
* @alpha
|
|
411
|
+
*
|
|
344
412
|
* Retrieves vectors by keys from this index
|
|
345
413
|
* Convenience method that automatically includes bucket and index names
|
|
346
414
|
*
|
|
347
|
-
* **
|
|
415
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
348
416
|
*
|
|
417
|
+
* @category Vector Buckets
|
|
349
418
|
* @param options - Vector retrieval options (bucket and index names automatically set)
|
|
350
419
|
* @returns Promise with array of vectors or error
|
|
351
420
|
*
|
|
@@ -367,11 +436,15 @@ export class VectorIndexScope extends VectorDataApi {
|
|
|
367
436
|
}
|
|
368
437
|
|
|
369
438
|
/**
|
|
439
|
+
*
|
|
440
|
+
* @alpha
|
|
441
|
+
*
|
|
370
442
|
* Lists vectors in this index with pagination
|
|
371
443
|
* Convenience method that automatically includes bucket and index names
|
|
372
444
|
*
|
|
373
|
-
* **
|
|
445
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
374
446
|
*
|
|
447
|
+
* @category Vector Buckets
|
|
375
448
|
* @param options - Listing options (bucket and index names automatically set)
|
|
376
449
|
* @returns Promise with array of vectors and pagination token
|
|
377
450
|
*
|
|
@@ -395,11 +468,15 @@ export class VectorIndexScope extends VectorDataApi {
|
|
|
395
468
|
}
|
|
396
469
|
|
|
397
470
|
/**
|
|
471
|
+
*
|
|
472
|
+
* @alpha
|
|
473
|
+
*
|
|
398
474
|
* Queries for similar vectors in this index
|
|
399
475
|
* Convenience method that automatically includes bucket and index names
|
|
400
476
|
*
|
|
401
|
-
* **
|
|
477
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
402
478
|
*
|
|
479
|
+
* @category Vector Buckets
|
|
403
480
|
* @param options - Query options (bucket and index names automatically set)
|
|
404
481
|
* @returns Promise with array of similar vectors ordered by distance
|
|
405
482
|
*
|
|
@@ -426,11 +503,15 @@ export class VectorIndexScope extends VectorDataApi {
|
|
|
426
503
|
}
|
|
427
504
|
|
|
428
505
|
/**
|
|
506
|
+
*
|
|
507
|
+
* @alpha
|
|
508
|
+
*
|
|
429
509
|
* Deletes vectors by keys from this index
|
|
430
510
|
* Convenience method that automatically includes bucket and index names
|
|
431
511
|
*
|
|
432
|
-
* **
|
|
512
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
433
513
|
*
|
|
514
|
+
* @category Vector Buckets
|
|
434
515
|
* @param options - Deletion options (bucket and index names automatically set)
|
|
435
516
|
* @returns Promise with empty response on success or error
|
|
436
517
|
*
|
|
@@ -10,10 +10,13 @@ import {
|
|
|
10
10
|
} from './types'
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
+
*
|
|
14
|
+
* @alpha
|
|
15
|
+
*
|
|
13
16
|
* API class for managing Vector Buckets
|
|
14
17
|
* Provides methods for creating, reading, listing, and deleting vector buckets
|
|
15
18
|
*
|
|
16
|
-
* **
|
|
19
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
17
20
|
*/
|
|
18
21
|
export default class VectorBucketApi {
|
|
19
22
|
protected url: string
|
|
@@ -22,9 +25,14 @@ export default class VectorBucketApi {
|
|
|
22
25
|
protected shouldThrowOnError = false
|
|
23
26
|
|
|
24
27
|
/**
|
|
28
|
+
*
|
|
29
|
+
* @alpha
|
|
30
|
+
*
|
|
25
31
|
* Creates a new VectorBucketApi instance
|
|
26
32
|
*
|
|
27
|
-
* **
|
|
33
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
34
|
+
*
|
|
35
|
+
* @category Vector Buckets
|
|
28
36
|
* @param url - The base URL for the storage vectors API
|
|
29
37
|
* @param headers - HTTP headers to include in requests
|
|
30
38
|
* @param fetch - Optional custom fetch implementation
|
|
@@ -41,11 +49,15 @@ export default class VectorBucketApi {
|
|
|
41
49
|
}
|
|
42
50
|
|
|
43
51
|
/**
|
|
52
|
+
*
|
|
53
|
+
* @alpha
|
|
54
|
+
*
|
|
44
55
|
* Enable throwing errors instead of returning them in the response
|
|
45
56
|
* When enabled, failed operations will throw instead of returning { data: null, error }
|
|
46
57
|
*
|
|
47
|
-
* **
|
|
58
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
48
59
|
*
|
|
60
|
+
* @category Vector Buckets
|
|
49
61
|
* @returns This instance for method chaining
|
|
50
62
|
* @example
|
|
51
63
|
* ```typescript
|
|
@@ -60,11 +72,15 @@ export default class VectorBucketApi {
|
|
|
60
72
|
}
|
|
61
73
|
|
|
62
74
|
/**
|
|
75
|
+
*
|
|
76
|
+
* @alpha
|
|
77
|
+
*
|
|
63
78
|
* Creates a new vector bucket
|
|
64
79
|
* Vector buckets are containers for vector indexes and their data
|
|
65
80
|
*
|
|
66
|
-
* **
|
|
81
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
67
82
|
*
|
|
83
|
+
* @category Vector Buckets
|
|
68
84
|
* @param vectorBucketName - Unique name for the vector bucket
|
|
69
85
|
* @returns Promise with empty response on success or error
|
|
70
86
|
*
|
|
@@ -102,11 +118,15 @@ export default class VectorBucketApi {
|
|
|
102
118
|
}
|
|
103
119
|
|
|
104
120
|
/**
|
|
121
|
+
*
|
|
122
|
+
* @alpha
|
|
123
|
+
*
|
|
105
124
|
* Retrieves metadata for a specific vector bucket
|
|
106
125
|
* Returns bucket configuration including encryption settings and creation time
|
|
107
126
|
*
|
|
108
|
-
* **
|
|
127
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
109
128
|
*
|
|
129
|
+
* @category Vector Buckets
|
|
110
130
|
* @param vectorBucketName - Name of the vector bucket to retrieve
|
|
111
131
|
* @returns Promise with bucket metadata or error
|
|
112
132
|
*
|
|
@@ -143,11 +163,15 @@ export default class VectorBucketApi {
|
|
|
143
163
|
}
|
|
144
164
|
|
|
145
165
|
/**
|
|
166
|
+
*
|
|
167
|
+
* @alpha
|
|
168
|
+
*
|
|
146
169
|
* Lists vector buckets with optional filtering and pagination
|
|
147
170
|
* Supports prefix-based filtering and paginated results
|
|
148
171
|
*
|
|
149
|
-
* **
|
|
172
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
150
173
|
*
|
|
174
|
+
* @category Vector Buckets
|
|
151
175
|
* @param options - Listing options
|
|
152
176
|
* @param options.prefix - Filter buckets by name prefix
|
|
153
177
|
* @param options.maxResults - Maximum results per page (default: 100)
|
|
@@ -190,11 +214,15 @@ export default class VectorBucketApi {
|
|
|
190
214
|
}
|
|
191
215
|
|
|
192
216
|
/**
|
|
217
|
+
*
|
|
218
|
+
* @alpha
|
|
219
|
+
*
|
|
193
220
|
* Deletes a vector bucket
|
|
194
221
|
* Bucket must be empty before deletion (all indexes must be removed first)
|
|
195
222
|
*
|
|
196
|
-
* **
|
|
223
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
197
224
|
*
|
|
225
|
+
* @category Vector Buckets
|
|
198
226
|
* @param vectorBucketName - Name of the vector bucket to delete
|
|
199
227
|
* @returns Promise with empty response on success or error
|
|
200
228
|
*
|
|
@@ -15,10 +15,13 @@ import {
|
|
|
15
15
|
} from './types'
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
+
*
|
|
19
|
+
* @alpha
|
|
20
|
+
*
|
|
18
21
|
* API class for managing Vector Data within Vector Indexes
|
|
19
22
|
* Provides methods for inserting, querying, listing, and deleting vector embeddings
|
|
20
23
|
*
|
|
21
|
-
* **
|
|
24
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
22
25
|
*/
|
|
23
26
|
export default class VectorDataApi {
|
|
24
27
|
protected url: string
|
|
@@ -27,13 +30,22 @@ export default class VectorDataApi {
|
|
|
27
30
|
protected shouldThrowOnError = false
|
|
28
31
|
|
|
29
32
|
/**
|
|
33
|
+
*
|
|
34
|
+
* @alpha
|
|
35
|
+
*
|
|
30
36
|
* Creates a VectorDataApi bound to a Storage Vectors deployment.
|
|
31
37
|
*
|
|
32
|
-
* **
|
|
38
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
33
39
|
*
|
|
40
|
+
* @category Vector Buckets
|
|
34
41
|
* @param url - Base URL for the Storage Vectors API.
|
|
35
42
|
* @param headers - Default headers (for example authentication tokens).
|
|
36
43
|
* @param fetch - Optional custom `fetch` implementation for non-browser runtimes.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```typescript
|
|
47
|
+
* const client = new VectorDataApi(url, headers)
|
|
48
|
+
* ```
|
|
37
49
|
*/
|
|
38
50
|
constructor(url: string, headers: { [key: string]: string } = {}, fetch?: Fetch) {
|
|
39
51
|
this.url = url.replace(/\/$/, '')
|
|
@@ -42,11 +54,15 @@ export default class VectorDataApi {
|
|
|
42
54
|
}
|
|
43
55
|
|
|
44
56
|
/**
|
|
57
|
+
*
|
|
58
|
+
* @alpha
|
|
59
|
+
*
|
|
45
60
|
* Enable throwing errors instead of returning them in the response
|
|
46
61
|
* When enabled, failed operations will throw instead of returning { data: null, error }
|
|
47
62
|
*
|
|
48
|
-
* **
|
|
63
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
49
64
|
*
|
|
65
|
+
* @category Vector Buckets
|
|
50
66
|
* @returns This instance for method chaining
|
|
51
67
|
* @example
|
|
52
68
|
* ```typescript
|
|
@@ -61,11 +77,15 @@ export default class VectorDataApi {
|
|
|
61
77
|
}
|
|
62
78
|
|
|
63
79
|
/**
|
|
80
|
+
*
|
|
81
|
+
* @alpha
|
|
82
|
+
*
|
|
64
83
|
* Inserts or updates vectors in batch (upsert operation)
|
|
65
84
|
* Accepts 1-500 vectors per request. Larger batches should be split
|
|
66
85
|
*
|
|
67
|
-
* **
|
|
86
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
68
87
|
*
|
|
88
|
+
* @category Vector Buckets
|
|
69
89
|
* @param options - Vector insertion options
|
|
70
90
|
* @param options.vectorBucketName - Name of the parent vector bucket
|
|
71
91
|
* @param options.indexName - Name of the target index
|
|
@@ -120,12 +140,16 @@ export default class VectorDataApi {
|
|
|
120
140
|
}
|
|
121
141
|
|
|
122
142
|
/**
|
|
143
|
+
*
|
|
144
|
+
* @alpha
|
|
145
|
+
*
|
|
123
146
|
* Retrieves vectors by their keys in batch
|
|
124
147
|
* Optionally includes vector data and/or metadata in response
|
|
125
148
|
* Additional permissions required when returning data or metadata
|
|
126
149
|
*
|
|
127
|
-
* **
|
|
150
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
128
151
|
*
|
|
152
|
+
* @category Vector Buckets
|
|
129
153
|
* @param options - Vector retrieval options
|
|
130
154
|
* @param options.vectorBucketName - Name of the parent vector bucket
|
|
131
155
|
* @param options.indexName - Name of the index
|
|
@@ -170,12 +194,16 @@ export default class VectorDataApi {
|
|
|
170
194
|
}
|
|
171
195
|
|
|
172
196
|
/**
|
|
197
|
+
*
|
|
198
|
+
* @alpha
|
|
199
|
+
*
|
|
173
200
|
* Lists/scans vectors in an index with pagination
|
|
174
201
|
* Supports parallel scanning via segment configuration for high-throughput scenarios
|
|
175
202
|
* Additional permissions required when returning data or metadata
|
|
176
203
|
*
|
|
177
|
-
* **
|
|
204
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
178
205
|
*
|
|
206
|
+
* @category Vector Buckets
|
|
179
207
|
* @param options - Vector listing options
|
|
180
208
|
* @param options.vectorBucketName - Name of the parent vector bucket
|
|
181
209
|
* @param options.indexName - Name of the index
|
|
@@ -252,12 +280,16 @@ export default class VectorDataApi {
|
|
|
252
280
|
}
|
|
253
281
|
|
|
254
282
|
/**
|
|
283
|
+
*
|
|
284
|
+
* @alpha
|
|
285
|
+
*
|
|
255
286
|
* Queries for similar vectors using approximate nearest neighbor (ANN) search
|
|
256
287
|
* Returns top-K most similar vectors based on the configured distance metric
|
|
257
288
|
* Supports optional metadata filtering (requires GetVectors permission)
|
|
258
289
|
*
|
|
259
|
-
* **
|
|
290
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
260
291
|
*
|
|
292
|
+
* @category Vector Buckets
|
|
261
293
|
* @param options - Query options
|
|
262
294
|
* @param options.vectorBucketName - Name of the parent vector bucket
|
|
263
295
|
* @param options.indexName - Name of the index
|
|
@@ -313,11 +345,15 @@ export default class VectorDataApi {
|
|
|
313
345
|
}
|
|
314
346
|
|
|
315
347
|
/**
|
|
348
|
+
*
|
|
349
|
+
* @alpha
|
|
350
|
+
*
|
|
316
351
|
* Deletes vectors by their keys in batch
|
|
317
352
|
* Accepts 1-500 keys per request
|
|
318
353
|
*
|
|
319
|
-
* **
|
|
354
|
+
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
320
355
|
*
|
|
356
|
+
* @category Vector Buckets
|
|
321
357
|
* @param options - Vector deletion options
|
|
322
358
|
* @param options.vectorBucketName - Name of the parent vector bucket
|
|
323
359
|
* @param options.indexName - Name of the index
|