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