@supabase/storage-js 2.87.4-canary.2 → 2.87.4-canary.4

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.
Files changed (206) hide show
  1. package/README.md +2 -106
  2. package/dist/index.cjs +3019 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.d.cts +2601 -0
  5. package/dist/index.d.cts.map +1 -0
  6. package/dist/index.d.mts +2601 -0
  7. package/dist/index.d.mts.map +1 -0
  8. package/dist/index.mjs +2998 -0
  9. package/dist/index.mjs.map +1 -0
  10. package/dist/umd/supabase.js +1 -1
  11. package/package.json +21 -12
  12. package/src/lib/version.ts +1 -1
  13. package/dist/main/StorageClient.d.ts +0 -64
  14. package/dist/main/StorageClient.d.ts.map +0 -1
  15. package/dist/main/StorageClient.js +0 -74
  16. package/dist/main/StorageClient.js.map +0 -1
  17. package/dist/main/index.d.ts +0 -7
  18. package/dist/main/index.d.ts.map +0 -1
  19. package/dist/main/index.js +0 -12
  20. package/dist/main/index.js.map +0 -1
  21. package/dist/main/lib/constants.d.ts +0 -4
  22. package/dist/main/lib/constants.d.ts.map +0 -1
  23. package/dist/main/lib/constants.js +0 -8
  24. package/dist/main/lib/constants.js.map +0 -1
  25. package/dist/main/lib/errors.d.ts +0 -21
  26. package/dist/main/lib/errors.d.ts.map +0 -1
  27. package/dist/main/lib/errors.js +0 -41
  28. package/dist/main/lib/errors.js.map +0 -1
  29. package/dist/main/lib/fetch.d.ts +0 -16
  30. package/dist/main/lib/fetch.d.ts.map +0 -1
  31. package/dist/main/lib/fetch.js +0 -95
  32. package/dist/main/lib/fetch.js.map +0 -1
  33. package/dist/main/lib/helpers.d.ts +0 -28
  34. package/dist/main/lib/helpers.d.ts.map +0 -1
  35. package/dist/main/lib/helpers.js +0 -87
  36. package/dist/main/lib/helpers.js.map +0 -1
  37. package/dist/main/lib/index.d.ts +0 -6
  38. package/dist/main/lib/index.d.ts.map +0 -1
  39. package/dist/main/lib/index.js +0 -9
  40. package/dist/main/lib/index.js.map +0 -1
  41. package/dist/main/lib/types.d.ts +0 -226
  42. package/dist/main/lib/types.d.ts.map +0 -1
  43. package/dist/main/lib/types.js +0 -3
  44. package/dist/main/lib/types.js.map +0 -1
  45. package/dist/main/lib/vectors/StorageVectorsClient.d.ts +0 -505
  46. package/dist/main/lib/vectors/StorageVectorsClient.d.ts.map +0 -1
  47. package/dist/main/lib/vectors/StorageVectorsClient.js +0 -582
  48. package/dist/main/lib/vectors/StorageVectorsClient.js.map +0 -1
  49. package/dist/main/lib/vectors/VectorBucketApi.d.ts +0 -32
  50. package/dist/main/lib/vectors/VectorBucketApi.d.ts.map +0 -1
  51. package/dist/main/lib/vectors/VectorBucketApi.js +0 -102
  52. package/dist/main/lib/vectors/VectorBucketApi.js.map +0 -1
  53. package/dist/main/lib/vectors/VectorDataApi.d.ts +0 -32
  54. package/dist/main/lib/vectors/VectorDataApi.d.ts.map +0 -1
  55. package/dist/main/lib/vectors/VectorDataApi.js +0 -147
  56. package/dist/main/lib/vectors/VectorDataApi.js.map +0 -1
  57. package/dist/main/lib/vectors/VectorIndexApi.d.ts +0 -47
  58. package/dist/main/lib/vectors/VectorIndexApi.d.ts.map +0 -1
  59. package/dist/main/lib/vectors/VectorIndexApi.js +0 -104
  60. package/dist/main/lib/vectors/VectorIndexApi.js.map +0 -1
  61. package/dist/main/lib/vectors/constants.d.ts +0 -5
  62. package/dist/main/lib/vectors/constants.d.ts.map +0 -1
  63. package/dist/main/lib/vectors/constants.js +0 -9
  64. package/dist/main/lib/vectors/constants.js.map +0 -1
  65. package/dist/main/lib/vectors/errors.d.ts +0 -55
  66. package/dist/main/lib/vectors/errors.d.ts.map +0 -1
  67. package/dist/main/lib/vectors/errors.js +0 -76
  68. package/dist/main/lib/vectors/errors.js.map +0 -1
  69. package/dist/main/lib/vectors/fetch.d.ts +0 -57
  70. package/dist/main/lib/vectors/fetch.d.ts.map +0 -1
  71. package/dist/main/lib/vectors/fetch.js +0 -167
  72. package/dist/main/lib/vectors/fetch.js.map +0 -1
  73. package/dist/main/lib/vectors/helpers.d.ts +0 -46
  74. package/dist/main/lib/vectors/helpers.d.ts.map +0 -1
  75. package/dist/main/lib/vectors/helpers.js +0 -74
  76. package/dist/main/lib/vectors/helpers.js.map +0 -1
  77. package/dist/main/lib/vectors/index.d.ts +0 -11
  78. package/dist/main/lib/vectors/index.d.ts.map +0 -1
  79. package/dist/main/lib/vectors/index.js +0 -31
  80. package/dist/main/lib/vectors/index.js.map +0 -1
  81. package/dist/main/lib/vectors/types.d.ts +0 -279
  82. package/dist/main/lib/vectors/types.d.ts.map +0 -1
  83. package/dist/main/lib/vectors/types.js +0 -3
  84. package/dist/main/lib/vectors/types.js.map +0 -1
  85. package/dist/main/lib/version.d.ts +0 -2
  86. package/dist/main/lib/version.d.ts.map +0 -1
  87. package/dist/main/lib/version.js +0 -11
  88. package/dist/main/lib/version.js.map +0 -1
  89. package/dist/main/packages/BlobDownloadBuilder.d.ts +0 -16
  90. package/dist/main/packages/BlobDownloadBuilder.d.ts.map +0 -1
  91. package/dist/main/packages/BlobDownloadBuilder.js +0 -55
  92. package/dist/main/packages/BlobDownloadBuilder.js.map +0 -1
  93. package/dist/main/packages/StorageAnalyticsClient.d.ts +0 -324
  94. package/dist/main/packages/StorageAnalyticsClient.d.ts.map +0 -1
  95. package/dist/main/packages/StorageAnalyticsClient.js +0 -395
  96. package/dist/main/packages/StorageAnalyticsClient.js.map +0 -1
  97. package/dist/main/packages/StorageBucketApi.d.ts +0 -266
  98. package/dist/main/packages/StorageBucketApi.d.ts.map +0 -1
  99. package/dist/main/packages/StorageBucketApi.js +0 -362
  100. package/dist/main/packages/StorageBucketApi.js.map +0 -1
  101. package/dist/main/packages/StorageFileApi.d.ts +0 -680
  102. package/dist/main/packages/StorageFileApi.d.ts.map +0 -1
  103. package/dist/main/packages/StorageFileApi.js +0 -1002
  104. package/dist/main/packages/StorageFileApi.js.map +0 -1
  105. package/dist/main/packages/StreamDownloadBuilder.d.ts +0 -9
  106. package/dist/main/packages/StreamDownloadBuilder.d.ts.map +0 -1
  107. package/dist/main/packages/StreamDownloadBuilder.js +0 -35
  108. package/dist/main/packages/StreamDownloadBuilder.js.map +0 -1
  109. package/dist/module/StorageClient.d.ts +0 -64
  110. package/dist/module/StorageClient.d.ts.map +0 -1
  111. package/dist/module/StorageClient.js +0 -69
  112. package/dist/module/StorageClient.js.map +0 -1
  113. package/dist/module/index.d.ts +0 -7
  114. package/dist/module/index.d.ts.map +0 -1
  115. package/dist/module/index.js +0 -6
  116. package/dist/module/index.js.map +0 -1
  117. package/dist/module/lib/constants.d.ts +0 -4
  118. package/dist/module/lib/constants.d.ts.map +0 -1
  119. package/dist/module/lib/constants.js +0 -5
  120. package/dist/module/lib/constants.js.map +0 -1
  121. package/dist/module/lib/errors.d.ts +0 -21
  122. package/dist/module/lib/errors.d.ts.map +0 -1
  123. package/dist/module/lib/errors.js +0 -34
  124. package/dist/module/lib/errors.js.map +0 -1
  125. package/dist/module/lib/fetch.d.ts +0 -16
  126. package/dist/module/lib/fetch.d.ts.map +0 -1
  127. package/dist/module/lib/fetch.js +0 -88
  128. package/dist/module/lib/fetch.js.map +0 -1
  129. package/dist/module/lib/helpers.d.ts +0 -28
  130. package/dist/module/lib/helpers.d.ts.map +0 -1
  131. package/dist/module/lib/helpers.js +0 -79
  132. package/dist/module/lib/helpers.js.map +0 -1
  133. package/dist/module/lib/index.d.ts +0 -6
  134. package/dist/module/lib/index.d.ts.map +0 -1
  135. package/dist/module/lib/index.js +0 -6
  136. package/dist/module/lib/index.js.map +0 -1
  137. package/dist/module/lib/types.d.ts +0 -226
  138. package/dist/module/lib/types.d.ts.map +0 -1
  139. package/dist/module/lib/types.js +0 -2
  140. package/dist/module/lib/types.js.map +0 -1
  141. package/dist/module/lib/vectors/StorageVectorsClient.d.ts +0 -505
  142. package/dist/module/lib/vectors/StorageVectorsClient.d.ts.map +0 -1
  143. package/dist/module/lib/vectors/StorageVectorsClient.js +0 -576
  144. package/dist/module/lib/vectors/StorageVectorsClient.js.map +0 -1
  145. package/dist/module/lib/vectors/VectorBucketApi.d.ts +0 -32
  146. package/dist/module/lib/vectors/VectorBucketApi.d.ts.map +0 -1
  147. package/dist/module/lib/vectors/VectorBucketApi.js +0 -99
  148. package/dist/module/lib/vectors/VectorBucketApi.js.map +0 -1
  149. package/dist/module/lib/vectors/VectorDataApi.d.ts +0 -32
  150. package/dist/module/lib/vectors/VectorDataApi.d.ts.map +0 -1
  151. package/dist/module/lib/vectors/VectorDataApi.js +0 -144
  152. package/dist/module/lib/vectors/VectorDataApi.js.map +0 -1
  153. package/dist/module/lib/vectors/VectorIndexApi.d.ts +0 -47
  154. package/dist/module/lib/vectors/VectorIndexApi.d.ts.map +0 -1
  155. package/dist/module/lib/vectors/VectorIndexApi.js +0 -101
  156. package/dist/module/lib/vectors/VectorIndexApi.js.map +0 -1
  157. package/dist/module/lib/vectors/constants.d.ts +0 -5
  158. package/dist/module/lib/vectors/constants.d.ts.map +0 -1
  159. package/dist/module/lib/vectors/constants.js +0 -6
  160. package/dist/module/lib/vectors/constants.js.map +0 -1
  161. package/dist/module/lib/vectors/errors.d.ts +0 -55
  162. package/dist/module/lib/vectors/errors.d.ts.map +0 -1
  163. package/dist/module/lib/vectors/errors.js +0 -69
  164. package/dist/module/lib/vectors/errors.js.map +0 -1
  165. package/dist/module/lib/vectors/fetch.d.ts +0 -57
  166. package/dist/module/lib/vectors/fetch.d.ts.map +0 -1
  167. package/dist/module/lib/vectors/fetch.js +0 -161
  168. package/dist/module/lib/vectors/fetch.js.map +0 -1
  169. package/dist/module/lib/vectors/helpers.d.ts +0 -46
  170. package/dist/module/lib/vectors/helpers.d.ts.map +0 -1
  171. package/dist/module/lib/vectors/helpers.js +0 -66
  172. package/dist/module/lib/vectors/helpers.js.map +0 -1
  173. package/dist/module/lib/vectors/index.d.ts +0 -11
  174. package/dist/module/lib/vectors/index.d.ts.map +0 -1
  175. package/dist/module/lib/vectors/index.js +0 -11
  176. package/dist/module/lib/vectors/index.js.map +0 -1
  177. package/dist/module/lib/vectors/types.d.ts +0 -279
  178. package/dist/module/lib/vectors/types.d.ts.map +0 -1
  179. package/dist/module/lib/vectors/types.js +0 -2
  180. package/dist/module/lib/vectors/types.js.map +0 -1
  181. package/dist/module/lib/version.d.ts +0 -2
  182. package/dist/module/lib/version.d.ts.map +0 -1
  183. package/dist/module/lib/version.js +0 -8
  184. package/dist/module/lib/version.js.map +0 -1
  185. package/dist/module/packages/BlobDownloadBuilder.d.ts +0 -16
  186. package/dist/module/packages/BlobDownloadBuilder.d.ts.map +0 -1
  187. package/dist/module/packages/BlobDownloadBuilder.js +0 -53
  188. package/dist/module/packages/BlobDownloadBuilder.js.map +0 -1
  189. package/dist/module/packages/StorageAnalyticsClient.d.ts +0 -324
  190. package/dist/module/packages/StorageAnalyticsClient.d.ts.map +0 -1
  191. package/dist/module/packages/StorageAnalyticsClient.js +0 -392
  192. package/dist/module/packages/StorageAnalyticsClient.js.map +0 -1
  193. package/dist/module/packages/StorageBucketApi.d.ts +0 -266
  194. package/dist/module/packages/StorageBucketApi.d.ts.map +0 -1
  195. package/dist/module/packages/StorageBucketApi.js +0 -359
  196. package/dist/module/packages/StorageBucketApi.js.map +0 -1
  197. package/dist/module/packages/StorageFileApi.d.ts +0 -680
  198. package/dist/module/packages/StorageFileApi.d.ts.map +0 -1
  199. package/dist/module/packages/StorageFileApi.js +0 -999
  200. package/dist/module/packages/StorageFileApi.js.map +0 -1
  201. package/dist/module/packages/StreamDownloadBuilder.d.ts +0 -9
  202. package/dist/module/packages/StreamDownloadBuilder.d.ts.map +0 -1
  203. package/dist/module/packages/StreamDownloadBuilder.js +0 -32
  204. package/dist/module/packages/StreamDownloadBuilder.js.map +0 -1
  205. package/dist/tsconfig.module.tsbuildinfo +0 -1
  206. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -1,576 +0,0 @@
1
- import { __awaiter } from "tslib";
2
- import VectorIndexApi from './VectorIndexApi';
3
- import VectorDataApi from './VectorDataApi';
4
- import VectorBucketApi from './VectorBucketApi';
5
- /**
6
- *
7
- * @alpha
8
- *
9
- * Main client for interacting with S3 Vectors API
10
- * Provides access to bucket, index, and vector data operations
11
- *
12
- * **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
13
- *
14
- * **Usage Patterns:**
15
- *
16
- * ```typescript
17
- * const { data, error } = await supabase
18
- * .storage
19
- * .vectors
20
- * .createBucket('embeddings-prod')
21
- *
22
- * // Access index operations via buckets
23
- * const bucket = supabase.storage.vectors.from('embeddings-prod')
24
- * await bucket.createIndex({
25
- * indexName: 'documents',
26
- * dataType: 'float32',
27
- * dimension: 1536,
28
- * distanceMetric: 'cosine'
29
- * })
30
- *
31
- * // Access vector operations via index
32
- * const index = bucket.index('documents')
33
- * await index.putVectors({
34
- * vectors: [
35
- * { key: 'doc-1', data: { float32: [...] }, metadata: { title: 'Intro' } }
36
- * ]
37
- * })
38
- *
39
- * // Query similar vectors
40
- * const { data } = await index.queryVectors({
41
- * queryVector: { float32: [...] },
42
- * topK: 5,
43
- * returnDistance: true
44
- * })
45
- * ```
46
- */
47
- export class StorageVectorsClient extends VectorBucketApi {
48
- /**
49
- * @alpha
50
- *
51
- * Creates a StorageVectorsClient that can manage buckets, indexes, and vectors.
52
- *
53
- * **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
54
- *
55
- * @category Vector Buckets
56
- * @param url - Base URL of the Storage Vectors REST API.
57
- * @param options.headers - Optional headers (for example `Authorization`) applied to every request.
58
- * @param options.fetch - Optional custom `fetch` implementation for non-browser runtimes.
59
- *
60
- * @example
61
- * ```typescript
62
- * const client = new StorageVectorsClient(url, options)
63
- * ```
64
- */
65
- constructor(url, options = {}) {
66
- super(url, options.headers || {}, options.fetch);
67
- }
68
- /**
69
- *
70
- * @alpha
71
- *
72
- * Access operations for a specific vector bucket
73
- * Returns a scoped client for index and vector operations within the bucket
74
- *
75
- * **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
76
- *
77
- * @category Vector Buckets
78
- * @param vectorBucketName - Name of the vector bucket
79
- * @returns Bucket-scoped client with index and vector operations
80
- *
81
- * @example
82
- * ```typescript
83
- * const bucket = supabase.storage.vectors.from('embeddings-prod')
84
- * ```
85
- */
86
- from(vectorBucketName) {
87
- return new VectorBucketScope(this.url, this.headers, vectorBucketName, this.fetch);
88
- }
89
- /**
90
- *
91
- * @alpha
92
- *
93
- * Creates a new vector bucket
94
- * Vector buckets are containers for vector indexes and their data
95
- *
96
- * **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
97
- *
98
- * @category Vector Buckets
99
- * @param vectorBucketName - Unique name for the vector bucket
100
- * @returns Promise with empty response on success or error
101
- *
102
- * @example
103
- * ```typescript
104
- * const { data, error } = await supabase
105
- * .storage
106
- * .vectors
107
- * .createBucket('embeddings-prod')
108
- * ```
109
- */
110
- createBucket(vectorBucketName) {
111
- const _super = Object.create(null, {
112
- createBucket: { get: () => super.createBucket }
113
- });
114
- return __awaiter(this, void 0, void 0, function* () {
115
- return _super.createBucket.call(this, vectorBucketName);
116
- });
117
- }
118
- /**
119
- *
120
- * @alpha
121
- *
122
- * Retrieves metadata for a specific vector bucket
123
- *
124
- * **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
125
- *
126
- * @category Vector Buckets
127
- * @param vectorBucketName - Name of the vector bucket
128
- * @returns Promise with bucket metadata or error
129
- *
130
- * @example
131
- * ```typescript
132
- * const { data, error } = await supabase
133
- * .storage
134
- * .vectors
135
- * .getBucket('embeddings-prod')
136
- *
137
- * console.log('Bucket created:', data?.vectorBucket.creationTime)
138
- * ```
139
- */
140
- getBucket(vectorBucketName) {
141
- const _super = Object.create(null, {
142
- getBucket: { get: () => super.getBucket }
143
- });
144
- return __awaiter(this, void 0, void 0, function* () {
145
- return _super.getBucket.call(this, vectorBucketName);
146
- });
147
- }
148
- /**
149
- *
150
- * @alpha
151
- *
152
- * Lists all vector buckets with optional filtering and pagination
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 options - Optional filters (prefix, maxResults, nextToken)
158
- * @returns Promise with list of buckets or error
159
- *
160
- * @example
161
- * ```typescript
162
- * const { data, error } = await supabase
163
- * .storage
164
- * .vectors
165
- * .listBuckets({ prefix: 'embeddings-' })
166
- *
167
- * data?.vectorBuckets.forEach(bucket => {
168
- * console.log(bucket.vectorBucketName)
169
- * })
170
- * ```
171
- */
172
- listBuckets() {
173
- const _super = Object.create(null, {
174
- listBuckets: { get: () => super.listBuckets }
175
- });
176
- return __awaiter(this, arguments, void 0, function* (options = {}) {
177
- return _super.listBuckets.call(this, options);
178
- });
179
- }
180
- /**
181
- *
182
- * @alpha
183
- *
184
- * Deletes a vector bucket (bucket must be empty)
185
- * All indexes must be deleted before deleting the bucket
186
- *
187
- * **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
188
- *
189
- * @category Vector Buckets
190
- * @param vectorBucketName - Name of the vector bucket to delete
191
- * @returns Promise with empty response on success or error
192
- *
193
- * @example
194
- * ```typescript
195
- * const { data, error } = await supabase
196
- * .storage
197
- * .vectors
198
- * .deleteBucket('embeddings-old')
199
- * ```
200
- */
201
- deleteBucket(vectorBucketName) {
202
- const _super = Object.create(null, {
203
- deleteBucket: { get: () => super.deleteBucket }
204
- });
205
- return __awaiter(this, void 0, void 0, function* () {
206
- return _super.deleteBucket.call(this, vectorBucketName);
207
- });
208
- }
209
- }
210
- /**
211
- *
212
- * @alpha
213
- *
214
- * Scoped client for operations within a specific vector bucket
215
- * Provides index management and access to vector operations
216
- *
217
- * **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
218
- */
219
- export class VectorBucketScope extends VectorIndexApi {
220
- /**
221
- * @alpha
222
- *
223
- * Creates a helper that automatically scopes all index operations to the provided bucket.
224
- *
225
- * **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
226
- *
227
- * @category Vector Buckets
228
- * @example
229
- * ```typescript
230
- * const bucket = supabase.storage.vectors.from('embeddings-prod')
231
- * ```
232
- */
233
- constructor(url, headers, vectorBucketName, fetch) {
234
- super(url, headers, fetch);
235
- this.vectorBucketName = vectorBucketName;
236
- }
237
- /**
238
- *
239
- * @alpha
240
- *
241
- * Creates a new vector index in this bucket
242
- * Convenience method that automatically includes the bucket name
243
- *
244
- * **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
245
- *
246
- * @category Vector Buckets
247
- * @param options - Index configuration (vectorBucketName is automatically set)
248
- * @returns Promise with empty response on success or error
249
- *
250
- * @example
251
- * ```typescript
252
- * const bucket = supabase.storage.vectors.from('embeddings-prod')
253
- * await bucket.createIndex({
254
- * indexName: 'documents-openai',
255
- * dataType: 'float32',
256
- * dimension: 1536,
257
- * distanceMetric: 'cosine',
258
- * metadataConfiguration: {
259
- * nonFilterableMetadataKeys: ['raw_text']
260
- * }
261
- * })
262
- * ```
263
- */
264
- createIndex(options) {
265
- const _super = Object.create(null, {
266
- createIndex: { get: () => super.createIndex }
267
- });
268
- return __awaiter(this, void 0, void 0, function* () {
269
- return _super.createIndex.call(this, Object.assign(Object.assign({}, options), { vectorBucketName: this.vectorBucketName }));
270
- });
271
- }
272
- /**
273
- *
274
- * @alpha
275
- *
276
- * Lists indexes in this bucket
277
- * Convenience method that automatically includes the bucket name
278
- *
279
- * **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
280
- *
281
- * @category Vector Buckets
282
- * @param options - Listing options (vectorBucketName is automatically set)
283
- * @returns Promise with response containing indexes array and pagination token or error
284
- *
285
- * @example
286
- * ```typescript
287
- * const bucket = supabase.storage.vectors.from('embeddings-prod')
288
- * const { data } = await bucket.listIndexes({ prefix: 'documents-' })
289
- * ```
290
- */
291
- listIndexes() {
292
- const _super = Object.create(null, {
293
- listIndexes: { get: () => super.listIndexes }
294
- });
295
- return __awaiter(this, arguments, void 0, function* (options = {}) {
296
- return _super.listIndexes.call(this, Object.assign(Object.assign({}, options), { vectorBucketName: this.vectorBucketName }));
297
- });
298
- }
299
- /**
300
- *
301
- * @alpha
302
- *
303
- * Retrieves metadata for a specific index in this bucket
304
- * Convenience method that automatically includes the bucket name
305
- *
306
- * **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
307
- *
308
- * @category Vector Buckets
309
- * @param indexName - Name of the index to retrieve
310
- * @returns Promise with index metadata or error
311
- *
312
- * @example
313
- * ```typescript
314
- * const bucket = supabase.storage.vectors.from('embeddings-prod')
315
- * const { data } = await bucket.getIndex('documents-openai')
316
- * console.log('Dimension:', data?.index.dimension)
317
- * ```
318
- */
319
- getIndex(indexName) {
320
- const _super = Object.create(null, {
321
- getIndex: { get: () => super.getIndex }
322
- });
323
- return __awaiter(this, void 0, void 0, function* () {
324
- return _super.getIndex.call(this, this.vectorBucketName, indexName);
325
- });
326
- }
327
- /**
328
- *
329
- * @alpha
330
- *
331
- * Deletes an index from this bucket
332
- * Convenience method that automatically includes the bucket name
333
- *
334
- * **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
335
- *
336
- * @category Vector Buckets
337
- * @param indexName - Name of the index to delete
338
- * @returns Promise with empty response on success or error
339
- *
340
- * @example
341
- * ```typescript
342
- * const bucket = supabase.storage.vectors.from('embeddings-prod')
343
- * await bucket.deleteIndex('old-index')
344
- * ```
345
- */
346
- deleteIndex(indexName) {
347
- const _super = Object.create(null, {
348
- deleteIndex: { get: () => super.deleteIndex }
349
- });
350
- return __awaiter(this, void 0, void 0, function* () {
351
- return _super.deleteIndex.call(this, this.vectorBucketName, indexName);
352
- });
353
- }
354
- /**
355
- *
356
- * @alpha
357
- *
358
- * Access operations for a specific index within this bucket
359
- * Returns a scoped client for vector data operations
360
- *
361
- * **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
362
- *
363
- * @category Vector Buckets
364
- * @param indexName - Name of the index
365
- * @returns Index-scoped client with vector data operations
366
- *
367
- * @example
368
- * ```typescript
369
- * const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')
370
- *
371
- * // Insert vectors
372
- * await index.putVectors({
373
- * vectors: [
374
- * { key: 'doc-1', data: { float32: [...] }, metadata: { title: 'Intro' } }
375
- * ]
376
- * })
377
- *
378
- * // Query similar vectors
379
- * const { data } = await index.queryVectors({
380
- * queryVector: { float32: [...] },
381
- * topK: 5
382
- * })
383
- * ```
384
- */
385
- index(indexName) {
386
- return new VectorIndexScope(this.url, this.headers, this.vectorBucketName, indexName, this.fetch);
387
- }
388
- }
389
- /**
390
- *
391
- * @alpha
392
- *
393
- * Scoped client for operations within a specific vector index
394
- * Provides vector data operations (put, get, list, query, delete)
395
- *
396
- * **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
397
- */
398
- export class VectorIndexScope extends VectorDataApi {
399
- /**
400
- *
401
- * @alpha
402
- *
403
- * Creates a helper that automatically scopes all vector operations to the provided bucket/index names.
404
- *
405
- * **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
406
- *
407
- * @category Vector Buckets
408
- * @example
409
- * ```typescript
410
- * const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')
411
- * ```
412
- */
413
- constructor(url, headers, vectorBucketName, indexName, fetch) {
414
- super(url, headers, fetch);
415
- this.vectorBucketName = vectorBucketName;
416
- this.indexName = indexName;
417
- }
418
- /**
419
- *
420
- * @alpha
421
- *
422
- * Inserts or updates vectors in this index
423
- * Convenience method that automatically includes bucket and index names
424
- *
425
- * **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
426
- *
427
- * @category Vector Buckets
428
- * @param options - Vector insertion options (bucket and index names automatically set)
429
- * @returns Promise with empty response on success or error
430
- *
431
- * @example
432
- * ```typescript
433
- * const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')
434
- * await index.putVectors({
435
- * vectors: [
436
- * {
437
- * key: 'doc-1',
438
- * data: { float32: [0.1, 0.2, ...] },
439
- * metadata: { title: 'Introduction', page: 1 }
440
- * }
441
- * ]
442
- * })
443
- * ```
444
- */
445
- putVectors(options) {
446
- const _super = Object.create(null, {
447
- putVectors: { get: () => super.putVectors }
448
- });
449
- return __awaiter(this, void 0, void 0, function* () {
450
- return _super.putVectors.call(this, Object.assign(Object.assign({}, options), { vectorBucketName: this.vectorBucketName, indexName: this.indexName }));
451
- });
452
- }
453
- /**
454
- *
455
- * @alpha
456
- *
457
- * Retrieves vectors by keys from this index
458
- * Convenience method that automatically includes bucket and index names
459
- *
460
- * **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
461
- *
462
- * @category Vector Buckets
463
- * @param options - Vector retrieval options (bucket and index names automatically set)
464
- * @returns Promise with response containing vectors array or error
465
- *
466
- * @example
467
- * ```typescript
468
- * const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')
469
- * const { data } = await index.getVectors({
470
- * keys: ['doc-1', 'doc-2'],
471
- * returnMetadata: true
472
- * })
473
- * ```
474
- */
475
- getVectors(options) {
476
- const _super = Object.create(null, {
477
- getVectors: { get: () => super.getVectors }
478
- });
479
- return __awaiter(this, void 0, void 0, function* () {
480
- return _super.getVectors.call(this, Object.assign(Object.assign({}, options), { vectorBucketName: this.vectorBucketName, indexName: this.indexName }));
481
- });
482
- }
483
- /**
484
- *
485
- * @alpha
486
- *
487
- * Lists vectors in this index with pagination
488
- * Convenience method that automatically includes bucket and index names
489
- *
490
- * **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
491
- *
492
- * @category Vector Buckets
493
- * @param options - Listing options (bucket and index names automatically set)
494
- * @returns Promise with response containing vectors array and pagination token or error
495
- *
496
- * @example
497
- * ```typescript
498
- * const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')
499
- * const { data } = await index.listVectors({
500
- * maxResults: 500,
501
- * returnMetadata: true
502
- * })
503
- * ```
504
- */
505
- listVectors() {
506
- const _super = Object.create(null, {
507
- listVectors: { get: () => super.listVectors }
508
- });
509
- return __awaiter(this, arguments, void 0, function* (options = {}) {
510
- return _super.listVectors.call(this, Object.assign(Object.assign({}, options), { vectorBucketName: this.vectorBucketName, indexName: this.indexName }));
511
- });
512
- }
513
- /**
514
- *
515
- * @alpha
516
- *
517
- * Queries for similar vectors in this index
518
- * Convenience method that automatically includes bucket and index names
519
- *
520
- * **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
521
- *
522
- * @category Vector Buckets
523
- * @param options - Query options (bucket and index names automatically set)
524
- * @returns Promise with response containing matches array of similar vectors ordered by distance or error
525
- *
526
- * @example
527
- * ```typescript
528
- * const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')
529
- * const { data } = await index.queryVectors({
530
- * queryVector: { float32: [0.1, 0.2, ...] },
531
- * topK: 5,
532
- * filter: { category: 'technical' },
533
- * returnDistance: true,
534
- * returnMetadata: true
535
- * })
536
- * ```
537
- */
538
- queryVectors(options) {
539
- const _super = Object.create(null, {
540
- queryVectors: { get: () => super.queryVectors }
541
- });
542
- return __awaiter(this, void 0, void 0, function* () {
543
- return _super.queryVectors.call(this, Object.assign(Object.assign({}, options), { vectorBucketName: this.vectorBucketName, indexName: this.indexName }));
544
- });
545
- }
546
- /**
547
- *
548
- * @alpha
549
- *
550
- * Deletes vectors by keys from this index
551
- * Convenience method that automatically includes bucket and index names
552
- *
553
- * **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
554
- *
555
- * @category Vector Buckets
556
- * @param options - Deletion options (bucket and index names automatically set)
557
- * @returns Promise with empty response on success or error
558
- *
559
- * @example
560
- * ```typescript
561
- * const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')
562
- * await index.deleteVectors({
563
- * keys: ['doc-1', 'doc-2', 'doc-3']
564
- * })
565
- * ```
566
- */
567
- deleteVectors(options) {
568
- const _super = Object.create(null, {
569
- deleteVectors: { get: () => super.deleteVectors }
570
- });
571
- return __awaiter(this, void 0, void 0, function* () {
572
- return _super.deleteVectors.call(this, Object.assign(Object.assign({}, options), { vectorBucketName: this.vectorBucketName, indexName: this.indexName }));
573
- });
574
- }
575
- }
576
- //# sourceMappingURL=StorageVectorsClient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StorageVectorsClient.js","sourceRoot":"","sources":["../../../../src/lib/v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orBucket, ListVectorBucketsOptions, ListVectorBucketsResponse } from './types';
3
- /**
4
- * @hidden
5
- * Base implementation for vector bucket operations.
6
- * Use {@link StorageVectorsClient} via `supabase.storage.vectors` instead.
7
- */
8
- export default class VectorBucketApi {
9
- protected url: string;
10
- protected headers: {
11
- [key: string]: string;
12
- };
13
- protected fetch: Fetch;
14
- protected shouldThrowOnError: boolean;
15
- /** Creates a new VectorBucketApi instance */
16
- constructor(url: string, headers?: {
17
- [key: string]: string;
18
- }, fetch?: Fetch);
19
- /** Enable throwing errors instead of returning them in the response */
20
- throwOnError(): this;
21
- /** Creates a new vector bucket */
22
- createBucket(vectorBucketName: string): Promise<ApiResponse<undefined>>;
23
- /** Retrieves metadata for a specific vector bucket */
24
- getBucket(vectorBucketName: string): Promise<ApiResponse<{
25
- vectorBucket: VectorBucket;
26
- }>>;
27
- /** Lists vector buckets with optional filtering and pagination */
28
- listBuckets(options?: ListVectorBucketsOptions): Promise<ApiResponse<ListVectorBucketsResponse>>;
29
- /** Deletes a vector bucket (must be empty first) */
30
- deleteBucket(vectorBucketName: string): Promise<ApiResponse<undefined>>;
31
- }
32
- //# sourceMappingURL=VectorBucketApi.d.ts.map
@@ -1 +0,0 @@
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;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,eAAe;IAClC,SAAS,CAAC,GAAG,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;IAC5C,SAAS,CAAC,KAAK,EAAE,KAAK,CAAA;IACtB,SAAS,CAAC,kBAAkB,UAAQ;IAEpC,6CAA6C;gBACjC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAO,EAAE,KAAK,CAAC,EAAE,KAAK;IAM/E,uEAAuE;IAChE,YAAY,IAAI,IAAI;IAK3B,kCAAkC;IAC5B,YAAY,CAAC,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IAoB7E,sDAAsD;IAChD,SAAS,CAAC,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;QAAE,YAAY,EAAE,YAAY,CAAA;KAAE,CAAC,CAAC;IAoB/F,kEAAkE;IAC5D,WAAW,CACf,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,WAAW,CAAC,yBAAyB,CAAC,CAAC;IAiBlD,oDAAoD;IAC9C,YAAY,CAAC,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;CAmB9E"}