@supabase/storage-js 2.84.0 → 2.84.1-canary.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/dist/main/StorageClient.d.ts +1 -15
- package/dist/main/StorageClient.d.ts.map +1 -1
- package/dist/main/StorageClient.js +1 -15
- package/dist/main/StorageClient.js.map +1 -1
- package/dist/main/lib/vectors/StorageVectorsClient.d.ts +18 -47
- package/dist/main/lib/vectors/StorageVectorsClient.d.ts.map +1 -1
- package/dist/main/lib/vectors/StorageVectorsClient.js +18 -47
- package/dist/main/lib/vectors/StorageVectorsClient.js.map +1 -1
- package/dist/main/lib/vectors/VectorBucketApi.d.ts +9 -153
- package/dist/main/lib/vectors/VectorBucketApi.d.ts.map +1 -1
- package/dist/main/lib/vectors/VectorBucketApi.js +9 -153
- package/dist/main/lib/vectors/VectorBucketApi.js.map +1 -1
- package/dist/main/lib/vectors/VectorDataApi.d.ts +10 -258
- package/dist/main/lib/vectors/VectorDataApi.d.ts.map +1 -1
- package/dist/main/lib/vectors/VectorDataApi.js +10 -258
- package/dist/main/lib/vectors/VectorDataApi.js.map +1 -1
- package/dist/main/lib/vectors/VectorIndexApi.d.ts +9 -177
- package/dist/main/lib/vectors/VectorIndexApi.d.ts.map +1 -1
- package/dist/main/lib/vectors/VectorIndexApi.js +9 -176
- 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/StorageAnalyticsClient.d.ts +6 -2
- package/dist/main/packages/StorageAnalyticsClient.d.ts.map +1 -1
- package/dist/main/packages/StorageAnalyticsClient.js +6 -2
- package/dist/main/packages/StorageAnalyticsClient.js.map +1 -1
- package/dist/module/StorageClient.d.ts +1 -15
- package/dist/module/StorageClient.d.ts.map +1 -1
- package/dist/module/StorageClient.js +1 -15
- package/dist/module/StorageClient.js.map +1 -1
- package/dist/module/lib/vectors/StorageVectorsClient.d.ts +18 -47
- package/dist/module/lib/vectors/StorageVectorsClient.d.ts.map +1 -1
- package/dist/module/lib/vectors/StorageVectorsClient.js +18 -47
- package/dist/module/lib/vectors/StorageVectorsClient.js.map +1 -1
- package/dist/module/lib/vectors/VectorBucketApi.d.ts +9 -153
- package/dist/module/lib/vectors/VectorBucketApi.d.ts.map +1 -1
- package/dist/module/lib/vectors/VectorBucketApi.js +9 -153
- package/dist/module/lib/vectors/VectorBucketApi.js.map +1 -1
- package/dist/module/lib/vectors/VectorDataApi.d.ts +10 -258
- package/dist/module/lib/vectors/VectorDataApi.d.ts.map +1 -1
- package/dist/module/lib/vectors/VectorDataApi.js +10 -258
- package/dist/module/lib/vectors/VectorDataApi.js.map +1 -1
- package/dist/module/lib/vectors/VectorIndexApi.d.ts +9 -177
- package/dist/module/lib/vectors/VectorIndexApi.d.ts.map +1 -1
- package/dist/module/lib/vectors/VectorIndexApi.js +9 -176
- 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/StorageAnalyticsClient.d.ts +6 -2
- package/dist/module/packages/StorageAnalyticsClient.d.ts.map +1 -1
- package/dist/module/packages/StorageAnalyticsClient.js +6 -2
- package/dist/module/packages/StorageAnalyticsClient.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 +1 -15
- package/src/lib/vectors/StorageVectorsClient.ts +18 -47
- package/src/lib/vectors/VectorBucketApi.ts +9 -153
- package/src/lib/vectors/VectorDataApi.ts +10 -258
- package/src/lib/vectors/VectorIndexApi.ts +9 -177
- package/src/lib/version.ts +1 -1
- package/src/packages/StorageAnalyticsClient.ts +6 -2
|
@@ -32,7 +32,7 @@ export declare class StorageClient extends StorageBucketApi {
|
|
|
32
32
|
*
|
|
33
33
|
* @example
|
|
34
34
|
* ```typescript
|
|
35
|
-
* const avatars = storage.from('avatars')
|
|
35
|
+
* const avatars = supabase.storage.from('avatars')
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
38
38
|
from(id: string): StorageFileApi;
|
|
@@ -58,20 +58,6 @@ export declare class StorageClient extends StorageBucketApi {
|
|
|
58
58
|
*
|
|
59
59
|
* @category Analytics Buckets
|
|
60
60
|
* @returns A StorageAnalyticsClient instance configured with the current storage settings.
|
|
61
|
-
* @example
|
|
62
|
-
* ```typescript
|
|
63
|
-
* const client = createClient(url, key)
|
|
64
|
-
* const analytics = client.storage.analytics
|
|
65
|
-
*
|
|
66
|
-
* // Create an analytics bucket
|
|
67
|
-
* await analytics.createBucket('my-analytics-bucket')
|
|
68
|
-
*
|
|
69
|
-
* // List all analytics buckets
|
|
70
|
-
* const { data: buckets } = await analytics.listBuckets()
|
|
71
|
-
*
|
|
72
|
-
* // Delete an analytics bucket
|
|
73
|
-
* await analytics.deleteBucket('old-analytics-bucket')
|
|
74
|
-
* ```
|
|
75
61
|
*/
|
|
76
62
|
get analytics(): StorageAnalyticsClient;
|
|
77
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorageClient.d.ts","sourceRoot":"","sources":["../../src/StorageClient.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,2BAA2B,CAAA;AACtD,OAAO,gBAAgB,MAAM,6BAA6B,CAAA;AAC1D,OAAO,sBAAsB,MAAM,mCAAmC,CAAA;AACtE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AAEpD,MAAM,WAAW,oBAAoB;IACnC,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;AAED,qBAAa,aAAc,SAAQ,gBAAgB;IACjD;;;;;;;;;;;;;OAaG;gBAED,GAAG,EAAE,MAAM,EACX,OAAO,GAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAO,EACvC,KAAK,CAAC,EAAE,KAAK,EACb,IAAI,CAAC,EAAE,oBAAoB;IAK7B;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc;IAIhC;;;;;;;;;;OAUG;IACH,IAAI,OAAO,IAAI,oBAAoB,CAKlC;IAED
|
|
1
|
+
{"version":3,"file":"StorageClient.d.ts","sourceRoot":"","sources":["../../src/StorageClient.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,2BAA2B,CAAA;AACtD,OAAO,gBAAgB,MAAM,6BAA6B,CAAA;AAC1D,OAAO,sBAAsB,MAAM,mCAAmC,CAAA;AACtE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AAEpD,MAAM,WAAW,oBAAoB;IACnC,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;AAED,qBAAa,aAAc,SAAQ,gBAAgB;IACjD;;;;;;;;;;;;;OAaG;gBAED,GAAG,EAAE,MAAM,EACX,OAAO,GAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAO,EACvC,KAAK,CAAC,EAAE,KAAK,EACb,IAAI,CAAC,EAAE,oBAAoB;IAK7B;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc;IAIhC;;;;;;;;;;OAUG;IACH,IAAI,OAAO,IAAI,oBAAoB,CAKlC;IAED;;;;;;;;;;OAUG;IACH,IAAI,SAAS,IAAI,sBAAsB,CAEtC;CACF"}
|
|
@@ -32,7 +32,7 @@ class StorageClient extends StorageBucketApi_1.default {
|
|
|
32
32
|
*
|
|
33
33
|
* @example
|
|
34
34
|
* ```typescript
|
|
35
|
-
* const avatars = storage.from('avatars')
|
|
35
|
+
* const avatars = supabase.storage.from('avatars')
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
38
38
|
from(id) {
|
|
@@ -65,20 +65,6 @@ class StorageClient extends StorageBucketApi_1.default {
|
|
|
65
65
|
*
|
|
66
66
|
* @category Analytics Buckets
|
|
67
67
|
* @returns A StorageAnalyticsClient instance configured with the current storage settings.
|
|
68
|
-
* @example
|
|
69
|
-
* ```typescript
|
|
70
|
-
* const client = createClient(url, key)
|
|
71
|
-
* const analytics = client.storage.analytics
|
|
72
|
-
*
|
|
73
|
-
* // Create an analytics bucket
|
|
74
|
-
* await analytics.createBucket('my-analytics-bucket')
|
|
75
|
-
*
|
|
76
|
-
* // List all analytics buckets
|
|
77
|
-
* const { data: buckets } = await analytics.listBuckets()
|
|
78
|
-
*
|
|
79
|
-
* // Delete an analytics bucket
|
|
80
|
-
* await analytics.deleteBucket('old-analytics-bucket')
|
|
81
|
-
* ```
|
|
82
68
|
*/
|
|
83
69
|
get analytics() {
|
|
84
70
|
return new StorageAnalyticsClient_1.default(this.url + '/iceberg', this.headers, this.fetch);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorageClient.js","sourceRoot":"","sources":["../../src/StorageClient.ts"],"names":[],"mappings":";;;;AAAA,uFAAsD;AACtD,2FAA0D;AAC1D,uGAAsE;AAEtE,2CAAoD;AAMpD,MAAa,aAAc,SAAQ,0BAAgB;IACjD;;;;;;;;;;;;;OAaG;IACH,YACE,GAAW,EACX,UAAqC,EAAE,EACvC,KAAa,EACb,IAA2B;QAE3B,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,CAAA;IAClC,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAU;QACb,OAAO,IAAI,wBAAc,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;IACnE,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,OAAO;QACT,OAAO,IAAI,8BAAoB,CAAC,IAAI,CAAC,GAAG,GAAG,SAAS,EAAE;YACpD,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC,CAAA;IACJ,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"StorageClient.js","sourceRoot":"","sources":["../../src/StorageClient.ts"],"names":[],"mappings":";;;;AAAA,uFAAsD;AACtD,2FAA0D;AAC1D,uGAAsE;AAEtE,2CAAoD;AAMpD,MAAa,aAAc,SAAQ,0BAAgB;IACjD;;;;;;;;;;;;;OAaG;IACH,YACE,GAAW,EACX,UAAqC,EAAE,EACvC,KAAa,EACb,IAA2B;QAE3B,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,CAAA;IAClC,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAU;QACb,OAAO,IAAI,wBAAc,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;IACnE,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,OAAO;QACT,OAAO,IAAI,8BAAoB,CAAC,IAAI,CAAC,GAAG,GAAG,SAAS,EAAE;YACpD,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC,CAAA;IACJ,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,SAAS;QACX,OAAO,IAAI,gCAAsB,CAAC,IAAI,CAAC,GAAG,GAAG,UAAU,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;IACpF,CAAC;CACF;AAvED,sCAuEC"}
|
|
@@ -35,32 +35,14 @@ export interface StorageVectorsClientOptions {
|
|
|
35
35
|
*
|
|
36
36
|
* **Usage Patterns:**
|
|
37
37
|
*
|
|
38
|
-
* 1. **Via StorageClient (recommended for most use cases):**
|
|
39
38
|
* ```typescript
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* // Use vector operations
|
|
46
|
-
* await vectors.createBucket('embeddings-prod')
|
|
47
|
-
* const bucket = vectors.from('embeddings-prod')
|
|
48
|
-
* await bucket.createIndex({ ... })
|
|
49
|
-
* ```
|
|
50
|
-
*
|
|
51
|
-
* 2. **Standalone (for vector-only applications):**
|
|
52
|
-
* ```typescript
|
|
53
|
-
* import { StorageVectorsClient } from '@supabase/storage-js'
|
|
54
|
-
*
|
|
55
|
-
* const vectorsClient = new StorageVectorsClient('https://api.example.com', {
|
|
56
|
-
* headers: { 'Authorization': 'Bearer token' }
|
|
57
|
-
* })
|
|
58
|
-
*
|
|
59
|
-
* // Access bucket operations
|
|
60
|
-
* await vectorsClient.createBucket('embeddings-prod')
|
|
39
|
+
* const { data, error } = await supabase
|
|
40
|
+
* .storage
|
|
41
|
+
* .vectors
|
|
42
|
+
* .createBucket('embeddings-prod')
|
|
61
43
|
*
|
|
62
44
|
* // Access index operations via buckets
|
|
63
|
-
* const bucket =
|
|
45
|
+
* const bucket = supabase.storage.vectors.from('embeddings-prod')
|
|
64
46
|
* await bucket.createIndex({
|
|
65
47
|
* indexName: 'documents',
|
|
66
48
|
* dataType: 'float32',
|
|
@@ -118,18 +100,7 @@ export declare class StorageVectorsClient extends VectorBucketApi {
|
|
|
118
100
|
*
|
|
119
101
|
* @example
|
|
120
102
|
* ```typescript
|
|
121
|
-
* const bucket =
|
|
122
|
-
*
|
|
123
|
-
* // Create an index in this bucket
|
|
124
|
-
* await bucket.createIndex({
|
|
125
|
-
* indexName: 'documents-openai',
|
|
126
|
-
* dataType: 'float32',
|
|
127
|
-
* dimension: 1536,
|
|
128
|
-
* distanceMetric: 'cosine'
|
|
129
|
-
* })
|
|
130
|
-
*
|
|
131
|
-
* // List indexes in this bucket
|
|
132
|
-
* const { data } = await bucket.listIndexes()
|
|
103
|
+
* const bucket = supabase.storage.vectors.from('embeddings-prod')
|
|
133
104
|
* ```
|
|
134
105
|
*/
|
|
135
106
|
from(vectorBucketName: string): VectorBucketScope;
|
|
@@ -155,7 +126,7 @@ export declare class VectorBucketScope extends VectorIndexApi {
|
|
|
155
126
|
* @category Vector Buckets
|
|
156
127
|
* @example
|
|
157
128
|
* ```typescript
|
|
158
|
-
* const bucket =
|
|
129
|
+
* const bucket = supabase.storage.vectors.from('embeddings-prod')
|
|
159
130
|
* ```
|
|
160
131
|
*/
|
|
161
132
|
constructor(url: string, headers: {
|
|
@@ -176,7 +147,7 @@ export declare class VectorBucketScope extends VectorIndexApi {
|
|
|
176
147
|
*
|
|
177
148
|
* @example
|
|
178
149
|
* ```typescript
|
|
179
|
-
* const bucket =
|
|
150
|
+
* const bucket = supabase.storage.vectors.from('embeddings-prod')
|
|
180
151
|
* await bucket.createIndex({
|
|
181
152
|
* indexName: 'documents-openai',
|
|
182
153
|
* dataType: 'float32',
|
|
@@ -204,7 +175,7 @@ export declare class VectorBucketScope extends VectorIndexApi {
|
|
|
204
175
|
*
|
|
205
176
|
* @example
|
|
206
177
|
* ```typescript
|
|
207
|
-
* const bucket =
|
|
178
|
+
* const bucket = supabase.storage.vectors.from('embeddings-prod')
|
|
208
179
|
* const { data } = await bucket.listIndexes({ prefix: 'documents-' })
|
|
209
180
|
* ```
|
|
210
181
|
*/
|
|
@@ -224,7 +195,7 @@ export declare class VectorBucketScope extends VectorIndexApi {
|
|
|
224
195
|
*
|
|
225
196
|
* @example
|
|
226
197
|
* ```typescript
|
|
227
|
-
* const bucket =
|
|
198
|
+
* const bucket = supabase.storage.vectors.from('embeddings-prod')
|
|
228
199
|
* const { data } = await bucket.getIndex('documents-openai')
|
|
229
200
|
* console.log('Dimension:', data?.index.dimension)
|
|
230
201
|
* ```
|
|
@@ -247,7 +218,7 @@ export declare class VectorBucketScope extends VectorIndexApi {
|
|
|
247
218
|
*
|
|
248
219
|
* @example
|
|
249
220
|
* ```typescript
|
|
250
|
-
* const bucket =
|
|
221
|
+
* const bucket = supabase.storage.vectors.from('embeddings-prod')
|
|
251
222
|
* await bucket.deleteIndex('old-index')
|
|
252
223
|
* ```
|
|
253
224
|
*/
|
|
@@ -267,7 +238,7 @@ export declare class VectorBucketScope extends VectorIndexApi {
|
|
|
267
238
|
*
|
|
268
239
|
* @example
|
|
269
240
|
* ```typescript
|
|
270
|
-
* const index =
|
|
241
|
+
* const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')
|
|
271
242
|
*
|
|
272
243
|
* // Insert vectors
|
|
273
244
|
* await index.putVectors({
|
|
@@ -308,7 +279,7 @@ export declare class VectorIndexScope extends VectorDataApi {
|
|
|
308
279
|
* @category Vector Buckets
|
|
309
280
|
* @example
|
|
310
281
|
* ```typescript
|
|
311
|
-
* const index =
|
|
282
|
+
* const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')
|
|
312
283
|
* ```
|
|
313
284
|
*/
|
|
314
285
|
constructor(url: string, headers: {
|
|
@@ -329,7 +300,7 @@ export declare class VectorIndexScope extends VectorDataApi {
|
|
|
329
300
|
*
|
|
330
301
|
* @example
|
|
331
302
|
* ```typescript
|
|
332
|
-
* const index =
|
|
303
|
+
* const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')
|
|
333
304
|
* await index.putVectors({
|
|
334
305
|
* vectors: [
|
|
335
306
|
* {
|
|
@@ -357,7 +328,7 @@ export declare class VectorIndexScope extends VectorDataApi {
|
|
|
357
328
|
*
|
|
358
329
|
* @example
|
|
359
330
|
* ```typescript
|
|
360
|
-
* const index =
|
|
331
|
+
* const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')
|
|
361
332
|
* const { data } = await index.getVectors({
|
|
362
333
|
* keys: ['doc-1', 'doc-2'],
|
|
363
334
|
* returnMetadata: true
|
|
@@ -380,7 +351,7 @@ export declare class VectorIndexScope extends VectorDataApi {
|
|
|
380
351
|
*
|
|
381
352
|
* @example
|
|
382
353
|
* ```typescript
|
|
383
|
-
* const index =
|
|
354
|
+
* const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')
|
|
384
355
|
* const { data } = await index.listVectors({
|
|
385
356
|
* maxResults: 500,
|
|
386
357
|
* returnMetadata: true
|
|
@@ -403,7 +374,7 @@ export declare class VectorIndexScope extends VectorDataApi {
|
|
|
403
374
|
*
|
|
404
375
|
* @example
|
|
405
376
|
* ```typescript
|
|
406
|
-
* const index =
|
|
377
|
+
* const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')
|
|
407
378
|
* const { data } = await index.queryVectors({
|
|
408
379
|
* queryVector: { float32: [0.1, 0.2, ...] },
|
|
409
380
|
* topK: 5,
|
|
@@ -429,7 +400,7 @@ export declare class VectorIndexScope extends VectorDataApi {
|
|
|
429
400
|
*
|
|
430
401
|
* @example
|
|
431
402
|
* ```typescript
|
|
432
|
-
* const index =
|
|
403
|
+
* const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')
|
|
433
404
|
* await index.deleteVectors({
|
|
434
405
|
* keys: ['doc-1', 'doc-2', 'doc-3']
|
|
435
406
|
* })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorageVectorsClient.d.ts","sourceRoot":"","sources":["../../../../src/lib/vectors/StorageVectorsClient.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,EAAE,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACrE,OAAO,aAAa,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,eAAe,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,SAAS,CAAA;AAEhB;;;;;;;GAOG;AACH,MAAM,WAAW,2BAA2B;I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S1E;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACY,YAAY,CACzB,OAAO,EAAE,IAAI,CAAC,mBAAmB,EAAE,kBAAkB,GAAG,WAAW,CAAC;IAStE;;;;;;;;;;;;;;;;;;;;OAoBG;IACY,aAAa,CAC1B,OAAO,EAAE,IAAI,CAAC,oBAAoB,EAAE,kBAAkB,GAAG,WAAW,CAAC;CAQxE"}
|
|
@@ -16,32 +16,14 @@ const VectorBucketApi_1 = tslib_1.__importDefault(require("./VectorBucketApi"));
|
|
|
16
16
|
*
|
|
17
17
|
* **Usage Patterns:**
|
|
18
18
|
*
|
|
19
|
-
* 1. **Via StorageClient (recommended for most use cases):**
|
|
20
19
|
* ```typescript
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* // Use vector operations
|
|
27
|
-
* await vectors.createBucket('embeddings-prod')
|
|
28
|
-
* const bucket = vectors.from('embeddings-prod')
|
|
29
|
-
* await bucket.createIndex({ ... })
|
|
30
|
-
* ```
|
|
31
|
-
*
|
|
32
|
-
* 2. **Standalone (for vector-only applications):**
|
|
33
|
-
* ```typescript
|
|
34
|
-
* import { StorageVectorsClient } from '@supabase/storage-js'
|
|
35
|
-
*
|
|
36
|
-
* const vectorsClient = new StorageVectorsClient('https://api.example.com', {
|
|
37
|
-
* headers: { 'Authorization': 'Bearer token' }
|
|
38
|
-
* })
|
|
39
|
-
*
|
|
40
|
-
* // Access bucket operations
|
|
41
|
-
* await vectorsClient.createBucket('embeddings-prod')
|
|
20
|
+
* const { data, error } = await supabase
|
|
21
|
+
* .storage
|
|
22
|
+
* .vectors
|
|
23
|
+
* .createBucket('embeddings-prod')
|
|
42
24
|
*
|
|
43
25
|
* // Access index operations via buckets
|
|
44
|
-
* const bucket =
|
|
26
|
+
* const bucket = supabase.storage.vectors.from('embeddings-prod')
|
|
45
27
|
* await bucket.createIndex({
|
|
46
28
|
* indexName: 'documents',
|
|
47
29
|
* dataType: 'float32',
|
|
@@ -101,18 +83,7 @@ class StorageVectorsClient extends VectorBucketApi_1.default {
|
|
|
101
83
|
*
|
|
102
84
|
* @example
|
|
103
85
|
* ```typescript
|
|
104
|
-
* const bucket =
|
|
105
|
-
*
|
|
106
|
-
* // Create an index in this bucket
|
|
107
|
-
* await bucket.createIndex({
|
|
108
|
-
* indexName: 'documents-openai',
|
|
109
|
-
* dataType: 'float32',
|
|
110
|
-
* dimension: 1536,
|
|
111
|
-
* distanceMetric: 'cosine'
|
|
112
|
-
* })
|
|
113
|
-
*
|
|
114
|
-
* // List indexes in this bucket
|
|
115
|
-
* const { data } = await bucket.listIndexes()
|
|
86
|
+
* const bucket = supabase.storage.vectors.from('embeddings-prod')
|
|
116
87
|
* ```
|
|
117
88
|
*/
|
|
118
89
|
from(vectorBucketName) {
|
|
@@ -140,7 +111,7 @@ class VectorBucketScope extends VectorIndexApi_1.default {
|
|
|
140
111
|
* @category Vector Buckets
|
|
141
112
|
* @example
|
|
142
113
|
* ```typescript
|
|
143
|
-
* const bucket =
|
|
114
|
+
* const bucket = supabase.storage.vectors.from('embeddings-prod')
|
|
144
115
|
* ```
|
|
145
116
|
*/
|
|
146
117
|
constructor(url, headers, vectorBucketName, fetch) {
|
|
@@ -162,7 +133,7 @@ class VectorBucketScope extends VectorIndexApi_1.default {
|
|
|
162
133
|
*
|
|
163
134
|
* @example
|
|
164
135
|
* ```typescript
|
|
165
|
-
* const bucket =
|
|
136
|
+
* const bucket = supabase.storage.vectors.from('embeddings-prod')
|
|
166
137
|
* await bucket.createIndex({
|
|
167
138
|
* indexName: 'documents-openai',
|
|
168
139
|
* dataType: 'float32',
|
|
@@ -197,7 +168,7 @@ class VectorBucketScope extends VectorIndexApi_1.default {
|
|
|
197
168
|
*
|
|
198
169
|
* @example
|
|
199
170
|
* ```typescript
|
|
200
|
-
* const bucket =
|
|
171
|
+
* const bucket = supabase.storage.vectors.from('embeddings-prod')
|
|
201
172
|
* const { data } = await bucket.listIndexes({ prefix: 'documents-' })
|
|
202
173
|
* ```
|
|
203
174
|
*/
|
|
@@ -224,7 +195,7 @@ class VectorBucketScope extends VectorIndexApi_1.default {
|
|
|
224
195
|
*
|
|
225
196
|
* @example
|
|
226
197
|
* ```typescript
|
|
227
|
-
* const bucket =
|
|
198
|
+
* const bucket = supabase.storage.vectors.from('embeddings-prod')
|
|
228
199
|
* const { data } = await bucket.getIndex('documents-openai')
|
|
229
200
|
* console.log('Dimension:', data?.index.dimension)
|
|
230
201
|
* ```
|
|
@@ -252,7 +223,7 @@ class VectorBucketScope extends VectorIndexApi_1.default {
|
|
|
252
223
|
*
|
|
253
224
|
* @example
|
|
254
225
|
* ```typescript
|
|
255
|
-
* const bucket =
|
|
226
|
+
* const bucket = supabase.storage.vectors.from('embeddings-prod')
|
|
256
227
|
* await bucket.deleteIndex('old-index')
|
|
257
228
|
* ```
|
|
258
229
|
*/
|
|
@@ -279,7 +250,7 @@ class VectorBucketScope extends VectorIndexApi_1.default {
|
|
|
279
250
|
*
|
|
280
251
|
* @example
|
|
281
252
|
* ```typescript
|
|
282
|
-
* const index =
|
|
253
|
+
* const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')
|
|
283
254
|
*
|
|
284
255
|
* // Insert vectors
|
|
285
256
|
* await index.putVectors({
|
|
@@ -321,7 +292,7 @@ class VectorIndexScope extends VectorDataApi_1.default {
|
|
|
321
292
|
* @category Vector Buckets
|
|
322
293
|
* @example
|
|
323
294
|
* ```typescript
|
|
324
|
-
* const index =
|
|
295
|
+
* const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')
|
|
325
296
|
* ```
|
|
326
297
|
*/
|
|
327
298
|
constructor(url, headers, vectorBucketName, indexName, fetch) {
|
|
@@ -344,7 +315,7 @@ class VectorIndexScope extends VectorDataApi_1.default {
|
|
|
344
315
|
*
|
|
345
316
|
* @example
|
|
346
317
|
* ```typescript
|
|
347
|
-
* const index =
|
|
318
|
+
* const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')
|
|
348
319
|
* await index.putVectors({
|
|
349
320
|
* vectors: [
|
|
350
321
|
* {
|
|
@@ -379,7 +350,7 @@ class VectorIndexScope extends VectorDataApi_1.default {
|
|
|
379
350
|
*
|
|
380
351
|
* @example
|
|
381
352
|
* ```typescript
|
|
382
|
-
* const index =
|
|
353
|
+
* const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')
|
|
383
354
|
* const { data } = await index.getVectors({
|
|
384
355
|
* keys: ['doc-1', 'doc-2'],
|
|
385
356
|
* returnMetadata: true
|
|
@@ -409,7 +380,7 @@ class VectorIndexScope extends VectorDataApi_1.default {
|
|
|
409
380
|
*
|
|
410
381
|
* @example
|
|
411
382
|
* ```typescript
|
|
412
|
-
* const index =
|
|
383
|
+
* const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')
|
|
413
384
|
* const { data } = await index.listVectors({
|
|
414
385
|
* maxResults: 500,
|
|
415
386
|
* returnMetadata: true
|
|
@@ -439,7 +410,7 @@ class VectorIndexScope extends VectorDataApi_1.default {
|
|
|
439
410
|
*
|
|
440
411
|
* @example
|
|
441
412
|
* ```typescript
|
|
442
|
-
* const index =
|
|
413
|
+
* const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')
|
|
443
414
|
* const { data } = await index.queryVectors({
|
|
444
415
|
* queryVector: { float32: [0.1, 0.2, ...] },
|
|
445
416
|
* topK: 5,
|
|
@@ -472,7 +443,7 @@ class VectorIndexScope extends VectorDataApi_1.default {
|
|
|
472
443
|
*
|
|
473
444
|
* @example
|
|
474
445
|
* ```typescript
|
|
475
|
-
* const index =
|
|
446
|
+
* const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')
|
|
476
447
|
* await index.deleteVectors({
|
|
477
448
|
* keys: ['doc-1', 'doc-2', 'doc-3']
|
|
478
449
|
* })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorageVectorsClient.js","sourceRoot":"","sources":["../../../../src/lib/vectors/StorageVectorsClient.ts"],"names":[],"mappings":";;;;AAAA,8EAAqE;AACrE,4EAA2C;AAE3C,gFAA+C;AA8B/C
|
|
1
|
+
{"version":3,"file":"StorageVectorsClient.js","sourceRoot":"","sources":["../../../../src/lib/vectors/StorageVectorsClient.ts"],"names":[],"mappings":";;;;AAAA,8EAAqE;AACrE,4EAA2C;AAE3C,gFAA+C;AA8B/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,MAAa,oBAAqB,SAAQ,yBAAe;IACvD;;;;;;;;;;;;;;;;OAgBG;IACH,YAAY,GAAW,EAAE,UAAuC,EAAE;QAChE,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC,OAAO,IAAI,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,CAAA;IAClD,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,IAAI,CAAC,gBAAwB;QAC3B,OAAO,IAAI,iBAAiB,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;IACpF,CAAC;CACF;AA3CD,oDA2CC;AAED;;;;;;;;GAQG;AACH,MAAa,iBAAkB,SAAQ,wBAAc;IAGnD;;;;;;;;;;;;OAYG;IACH,YACE,GAAW,EACX,OAAkC,EAClC,gBAAwB,EACxB,KAAa;QAEb,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,CAAC,CAAA;QAC1B,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAA;IAC1C,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACY,WAAW,CAAC,OAAqD;;;;;YAC9E,OAAO,OAAM,WAAW,4CACnB,OAAO,KACV,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,KACvC;QACJ,CAAC;KAAA;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACY,WAAW;;;;qEAAC,UAAwD,EAAE;YACnF,OAAO,OAAM,WA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AM,UAAU,4CAClB,OAAO,KACV,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,EACvC,SAAS,EAAE,IAAI,CAAC,SAAS,KACzB;QACJ,CAAC;KAAA;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACY,WAAW;;;;qEACxB,UAAsE,EAAE;YAExE,OAAO,OAAM,WAAW,4CACnB,OAAO,KACV,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,EACvC,SAAS,EAAE,IAAI,CAAC,SAAS,KACzB;QACJ,CAAC;KAAA;IAED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACY,YAAY,CACzB,OAAoE;;;;;YAEpE,OAAO,OAAM,YAAY,4CACpB,OAAO,KACV,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,EACvC,SAAS,EAAE,IAAI,CAAC,SAAS,KACzB;QACJ,CAAC;KAAA;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACY,aAAa,CAC1B,OAAqE;;;;;YAErE,OAAO,OAAM,aAAa,4CACrB,OAAO,KACV,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,EACvC,SAAS,EAAE,IAAI,CAAC,SAAS,KACzB;QACJ,CAAC;KAAA;CACF;AAhMD,4CAgMC"}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { Fetch } from './fetch';
|
|
2
2
|
import { ApiResponse, VectorBucket, ListVectorBucketsOptions, ListVectorBucketsResponse } from './types';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* API class for managing Vector Buckets
|
|
8
|
-
* Provides methods for creating, reading, listing, and deleting vector buckets
|
|
9
|
-
*
|
|
10
|
-
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
4
|
+
* @hidden
|
|
5
|
+
* Base implementation for vector bucket operations.
|
|
6
|
+
* Use {@link StorageVectorsClient} via `supabase.storage.vectors` instead.
|
|
11
7
|
*/
|
|
12
8
|
export default class VectorBucketApi {
|
|
13
9
|
protected url: string;
|
|
@@ -16,161 +12,21 @@ export default class VectorBucketApi {
|
|
|
16
12
|
};
|
|
17
13
|
protected fetch: Fetch;
|
|
18
14
|
protected shouldThrowOnError: boolean;
|
|
19
|
-
/**
|
|
20
|
-
*
|
|
21
|
-
* @alpha
|
|
22
|
-
*
|
|
23
|
-
* Creates a new VectorBucketApi instance
|
|
24
|
-
*
|
|
25
|
-
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
26
|
-
*
|
|
27
|
-
* @category Vector Buckets
|
|
28
|
-
* @param url - The base URL for the storage vectors API
|
|
29
|
-
* @param headers - HTTP headers to include in requests
|
|
30
|
-
* @param fetch - Optional custom fetch implementation
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* ```typescript
|
|
34
|
-
* const client = new VectorBucketApi(url, headers)
|
|
35
|
-
* ```
|
|
36
|
-
*/
|
|
15
|
+
/** Creates a new VectorBucketApi instance */
|
|
37
16
|
constructor(url: string, headers?: {
|
|
38
17
|
[key: string]: string;
|
|
39
18
|
}, fetch?: Fetch);
|
|
40
|
-
/**
|
|
41
|
-
*
|
|
42
|
-
* @alpha
|
|
43
|
-
*
|
|
44
|
-
* Enable throwing errors instead of returning them in the response
|
|
45
|
-
* When enabled, failed operations will throw instead of returning { data: null, error }
|
|
46
|
-
*
|
|
47
|
-
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
48
|
-
*
|
|
49
|
-
* @category Vector Buckets
|
|
50
|
-
* @returns This instance for method chaining
|
|
51
|
-
* @example
|
|
52
|
-
* ```typescript
|
|
53
|
-
* const client = new VectorBucketApi(url, headers)
|
|
54
|
-
* client.throwOnError()
|
|
55
|
-
* const { data } = await client.createBucket('my-bucket') // throws on error
|
|
56
|
-
* ```
|
|
57
|
-
*/
|
|
19
|
+
/** Enable throwing errors instead of returning them in the response */
|
|
58
20
|
throwOnError(): this;
|
|
59
|
-
/**
|
|
60
|
-
*
|
|
61
|
-
* @alpha
|
|
62
|
-
*
|
|
63
|
-
* Creates a new vector bucket
|
|
64
|
-
* Vector buckets are containers for vector indexes and their data
|
|
65
|
-
*
|
|
66
|
-
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
67
|
-
*
|
|
68
|
-
* @category Vector Buckets
|
|
69
|
-
* @param vectorBucketName - Unique name for the vector bucket
|
|
70
|
-
* @returns Promise with empty response on success or error
|
|
71
|
-
*
|
|
72
|
-
* @throws {StorageVectorsApiError} With code:
|
|
73
|
-
* - `S3VectorConflictException` if bucket already exists (HTTP 409)
|
|
74
|
-
* - `S3VectorMaxBucketsExceeded` if quota exceeded (HTTP 400)
|
|
75
|
-
* - `InternalError` for server errors (HTTP 500)
|
|
76
|
-
*
|
|
77
|
-
* @example
|
|
78
|
-
* ```typescript
|
|
79
|
-
* const { data, error } = await client.createBucket('embeddings-prod')
|
|
80
|
-
* if (error) {
|
|
81
|
-
* console.error('Failed to create bucket:', error.message)
|
|
82
|
-
* }
|
|
83
|
-
* ```
|
|
84
|
-
*/
|
|
21
|
+
/** Creates a new vector bucket */
|
|
85
22
|
createBucket(vectorBucketName: string): Promise<ApiResponse<undefined>>;
|
|
86
|
-
/**
|
|
87
|
-
*
|
|
88
|
-
* @alpha
|
|
89
|
-
*
|
|
90
|
-
* Retrieves metadata for a specific vector bucket
|
|
91
|
-
* Returns bucket configuration including encryption settings and creation time
|
|
92
|
-
*
|
|
93
|
-
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
94
|
-
*
|
|
95
|
-
* @category Vector Buckets
|
|
96
|
-
* @param vectorBucketName - Name of the vector bucket to retrieve
|
|
97
|
-
* @returns Promise with bucket metadata or error
|
|
98
|
-
*
|
|
99
|
-
* @throws {StorageVectorsApiError} With code:
|
|
100
|
-
* - `S3VectorNotFoundException` if bucket doesn't exist (HTTP 404)
|
|
101
|
-
* - `InternalError` for server errors (HTTP 500)
|
|
102
|
-
*
|
|
103
|
-
* @example
|
|
104
|
-
* ```typescript
|
|
105
|
-
* const { data, error } = await client.getBucket('embeddings-prod')
|
|
106
|
-
* if (data) {
|
|
107
|
-
* console.log('Bucket created at:', new Date(data.vectorBucket.creationTime! * 1000))
|
|
108
|
-
* }
|
|
109
|
-
* ```
|
|
110
|
-
*/
|
|
23
|
+
/** Retrieves metadata for a specific vector bucket */
|
|
111
24
|
getBucket(vectorBucketName: string): Promise<ApiResponse<{
|
|
112
25
|
vectorBucket: VectorBucket;
|
|
113
26
|
}>>;
|
|
114
|
-
/**
|
|
115
|
-
*
|
|
116
|
-
* @alpha
|
|
117
|
-
*
|
|
118
|
-
* Lists vector buckets with optional filtering and pagination
|
|
119
|
-
* Supports prefix-based filtering and paginated results
|
|
120
|
-
*
|
|
121
|
-
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
122
|
-
*
|
|
123
|
-
* @category Vector Buckets
|
|
124
|
-
* @param options - Listing options
|
|
125
|
-
* @param options.prefix - Filter buckets by name prefix
|
|
126
|
-
* @param options.maxResults - Maximum results per page (default: 100)
|
|
127
|
-
* @param options.nextToken - Pagination token from previous response
|
|
128
|
-
* @returns Promise with list of buckets and pagination token
|
|
129
|
-
*
|
|
130
|
-
* @throws {StorageVectorsApiError} With code:
|
|
131
|
-
* - `InternalError` for server errors (HTTP 500)
|
|
132
|
-
*
|
|
133
|
-
* @example
|
|
134
|
-
* ```typescript
|
|
135
|
-
* // List all buckets with prefix 'prod-'
|
|
136
|
-
* const { data, error } = await client.listBuckets({ prefix: 'prod-' })
|
|
137
|
-
* if (data) {
|
|
138
|
-
* console.log('Found buckets:', data.buckets.length)
|
|
139
|
-
* // Fetch next page if available
|
|
140
|
-
* if (data.nextToken) {
|
|
141
|
-
* const next = await client.listBuckets({ nextToken: data.nextToken })
|
|
142
|
-
* }
|
|
143
|
-
* }
|
|
144
|
-
* ```
|
|
145
|
-
*/
|
|
27
|
+
/** Lists vector buckets with optional filtering and pagination */
|
|
146
28
|
listBuckets(options?: ListVectorBucketsOptions): Promise<ApiResponse<ListVectorBucketsResponse>>;
|
|
147
|
-
/**
|
|
148
|
-
*
|
|
149
|
-
* @alpha
|
|
150
|
-
*
|
|
151
|
-
* Deletes a vector bucket
|
|
152
|
-
* Bucket must be empty before deletion (all indexes must be removed first)
|
|
153
|
-
*
|
|
154
|
-
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
155
|
-
*
|
|
156
|
-
* @category Vector Buckets
|
|
157
|
-
* @param vectorBucketName - Name of the vector bucket to delete
|
|
158
|
-
* @returns Promise with empty response on success or error
|
|
159
|
-
*
|
|
160
|
-
* @throws {StorageVectorsApiError} With code:
|
|
161
|
-
* - `S3VectorBucketNotEmpty` if bucket contains indexes (HTTP 400)
|
|
162
|
-
* - `S3VectorNotFoundException` if bucket doesn't exist (HTTP 404)
|
|
163
|
-
* - `InternalError` for server errors (HTTP 500)
|
|
164
|
-
*
|
|
165
|
-
* @example
|
|
166
|
-
* ```typescript
|
|
167
|
-
* // Delete all indexes first, then delete bucket
|
|
168
|
-
* const { error } = await client.deleteBucket('old-bucket')
|
|
169
|
-
* if (error?.statusCode === 'S3VectorBucketNotEmpty') {
|
|
170
|
-
* console.error('Must delete all indexes first')
|
|
171
|
-
* }
|
|
172
|
-
* ```
|
|
173
|
-
*/
|
|
29
|
+
/** Deletes a vector bucket (must be empty first) */
|
|
174
30
|
deleteBucket(vectorBucketName: string): Promise<ApiResponse<undefined>>;
|
|
175
31
|
}
|
|
176
32
|
//# sourceMappingURL=VectorBucketApi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VectorBucketApi.d.ts","sourceRoot":"","sources":["../../../../src/lib/vectors/VectorBucketApi.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAQ,MAAM,SAAS,CAAA;AAErC,OAAO,EACL,WAAW,EACX,YAAY,EACZ,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,SAAS,CAAA;AAEhB
|
|
1
|
+
{"version":3,"file":"VectorBucketApi.d.ts","sour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