@@ -3,12 +3,16 @@ import VectorDataApi from './VectorDataApi'
33import { Fetch } from './fetch'
44import VectorBucketApi from './VectorBucketApi'
55import {
6+ ApiResponse ,
67 DeleteVectorsOptions ,
78 GetVectorsOptions ,
89 ListIndexesOptions ,
910 ListVectorsOptions ,
11+ ListVectorBucketsOptions ,
12+ ListVectorBucketsResponse ,
1013 PutVectorsOptions ,
1114 QueryVectorsOptions ,
15+ VectorBucket ,
1216} from './types'
1317
1418/**
@@ -116,6 +120,112 @@ export class StorageVectorsClient extends VectorBucketApi {
116120 from ( vectorBucketName : string ) : VectorBucketScope {
117121 return new VectorBucketScope ( this . url , this . headers , vectorBucketName , this . fetch )
118122 }
123+
124+ /**
125+ *
126+ * @alpha
127+ *
128+ * Creates a new vector bucket
129+ * Vector buckets are containers for vector indexes and their data
130+ *
131+ * **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
132+ *
133+ * @category Vector Buckets
134+ * @param vectorBucketName - Unique name for the vector bucket
135+ * @returns Promise with empty response on success or error
136+ *
137+ * @example
138+ * ```typescript
139+ * const { data, error } = await supabase
140+ * .storage
141+ * .vectors
142+ * .createBucket('embeddings-prod')
143+ * ```
144+ */
145+ async createBucket ( vectorBucketName : string ) : Promise < ApiResponse < undefined > > {
146+ return super . createBucket ( vectorBucketName )
147+ }
148+
149+ /**
150+ *
151+ * @alpha
152+ *
153+ * Retrieves metadata for a specific vector bucket
154+ *
155+ * **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
156+ *
157+ * @category Vector Buckets
158+ * @param vectorBucketName - Name of the vector bucket
159+ * @returns Promise with bucket metadata or error
160+ *
161+ * @example
162+ * ```typescript
163+ * const { data, error } = await supabase
164+ * .storage
165+ * .vectors
166+ * .getBucket('embeddings-prod')
167+ *
168+ * console.log('Bucket created:', data?.vectorBucket.creationTime)
169+ * ```
170+ */
171+ async getBucket ( vectorBucketName : string ) : Promise < ApiResponse < { vectorBucket : VectorBucket } > > {
172+ return super . getBucket ( vectorBucketName )
173+ }
174+
175+ /**
176+ *
177+ * @alpha
178+ *
179+ * Lists all vector buckets with optional filtering and pagination
180+ *
181+ * **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
182+ *
183+ * @category Vector Buckets
184+ * @param options - Optional filters (prefix, maxResults, nextToken)
185+ * @returns Promise with list of buckets or error
186+ *
187+ * @example
188+ * ```typescript
189+ * const { data, error } = await supabase
190+ * .storage
191+ * .vectors
192+ * .listBuckets({ prefix: 'embeddings-' })
193+ *
194+ * data?.vectorBuckets.forEach(bucket => {
195+ * console.log(bucket.vectorBucketName)
196+ * })
197+ * ```
198+ */
199+ async listBuckets (
200+ options : ListVectorBucketsOptions = { }
201+ ) : Promise < ApiResponse < ListVectorBucketsResponse > > {
202+ return super . listBuckets ( options )
203+ }
204+
205+ /**
206+ *
207+ * @alpha
208+ *
209+ * Deletes a vector bucket (bucket must be empty)
210+ * All indexes must be deleted before deleting the bucket
211+ *
212+ * **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
213+ *
214+ * @category Vector Buckets
215+ * @param vectorBucketName - Name of the vector bucket to delete
216+ * @returns Promise with empty response on success or error
217+ *
218+ * @example
219+ * ```typescript
220+ * const { data, error } = await supabase
221+ * .storage
222+ * .vectors
223+ * .deleteBucket('embeddings-old')
224+ * ```
225+ */
226+ async deleteBucket ( vectorBucketName : string ) : Promise < ApiResponse < undefined > > {
227+ return super . deleteBucket ( vectorBucketName )
228+ }
119229}
120230
121231/**
@@ -198,7 +308,7 @@ export class VectorBucketScope extends VectorIndexApi {
198308 *
199309 * @category Vector Buckets
200310 * @param options - Listing options (vectorBucketName is automatically set)
201- * @returns Promise with list of indexes or error
311+ * @returns Promise with response containing indexes array and pagination token or error
202312 *
203313 * @example
204314 * ```typescript
@@ -387,7 +497,7 @@ export class VectorIndexScope extends VectorDataApi {
387497 *
388498 * @category Vector Buckets
389499 * @param options - Vector retrieval options (bucket and index names automatically set)
390- * @returns Promise with array of vectors or error
500+ * @returns Promise with response containing vectors array or error
391501 *
392502 * @example
393503 * ```typescript
@@ -417,7 +527,7 @@ export class VectorIndexScope extends VectorDataApi {
417527 *
418528 * @category Vector Buckets
419529 * @param options - Listing options (bucket and index names automatically set)
420- * @returns Promise with array of vectors and pagination token
530+ * @returns Promise with response containing vectors array and pagination token or error
421531 *
422532 * @example
423533 * ```typescript
@@ -449,7 +559,7 @@ export class VectorIndexScope extends VectorDataApi {
449559 *
450560 * @category Vector Buckets
451561 * @param options - Query options (bucket and index names automatically set)
452- * @returns Promise with array of similar vectors ordered by distance
562+ * @returns Promise with response containing matches array of similar vectors ordered by distance or error
453563 *
454564 * @example
455565 * ```typescript
0 commit comments