@supabase/storage-js 2.100.0-rc.0 → 2.100.1
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/index.cjs +152 -38
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +145 -23
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +145 -23
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +152 -38
- package/dist/index.mjs.map +1 -1
- package/dist/umd/supabase.js +1 -1
- package/package.json +1 -1
- package/src/StorageClient.ts +2 -2
- package/src/lib/common/BaseApiClient.ts +1 -1
- package/src/lib/common/fetch.ts +19 -34
- package/src/lib/version.ts +1 -1
- package/src/packages/StorageAnalyticsClient.ts +12 -1
- package/src/packages/StorageBucketApi.ts +36 -0
- package/src/packages/StorageFileApi.ts +77 -2
- package/src/packages/StorageVectorsClient.ts +18 -18
package/dist/index.mjs
CHANGED
|
@@ -260,25 +260,17 @@ const _getErrorMessage = (err) => {
|
|
|
260
260
|
* @param namespace - Error namespace ('storage' or 'vectors')
|
|
261
261
|
*/
|
|
262
262
|
const handleError = async (error, reject, options, namespace) => {
|
|
263
|
-
if (error && typeof error === "object" &&
|
|
263
|
+
if (error !== null && typeof error === "object" && typeof error.json === "function") {
|
|
264
264
|
const responseError = error;
|
|
265
|
-
|
|
266
|
-
if (
|
|
265
|
+
let status = parseInt(responseError.status, 10);
|
|
266
|
+
if (!Number.isFinite(status)) status = 500;
|
|
267
|
+
responseError.json().then((err) => {
|
|
267
268
|
const statusCode = (err === null || err === void 0 ? void 0 : err.statusCode) || (err === null || err === void 0 ? void 0 : err.code) || status + "";
|
|
268
269
|
reject(new StorageApiError(_getErrorMessage(err), status, statusCode, namespace));
|
|
269
270
|
}).catch(() => {
|
|
270
|
-
if (namespace === "vectors") {
|
|
271
|
-
const statusCode = status + "";
|
|
272
|
-
reject(new StorageApiError(responseError.statusText || `HTTP ${status} error`, status, statusCode, namespace));
|
|
273
|
-
} else {
|
|
274
|
-
const statusCode = status + "";
|
|
275
|
-
reject(new StorageApiError(responseError.statusText || `HTTP ${status} error`, status, statusCode, namespace));
|
|
276
|
-
}
|
|
277
|
-
});
|
|
278
|
-
else {
|
|
279
271
|
const statusCode = status + "";
|
|
280
272
|
reject(new StorageApiError(responseError.statusText || `HTTP ${status} error`, status, statusCode, namespace));
|
|
281
|
-
}
|
|
273
|
+
});
|
|
282
274
|
} else reject(new StorageUnknownError(_getErrorMessage(error), error, namespace));
|
|
283
275
|
};
|
|
284
276
|
/**
|
|
@@ -415,7 +407,7 @@ var BaseApiClient = class {
|
|
|
415
407
|
* @param operation - Async function that performs the API call
|
|
416
408
|
* @returns Promise with { data, error } tuple
|
|
417
409
|
*
|
|
418
|
-
* @example
|
|
410
|
+
* @example Handling an operation
|
|
419
411
|
* ```typescript
|
|
420
412
|
* async listBuckets() {
|
|
421
413
|
* return this.handleOperation(async () => {
|
|
@@ -621,6 +613,13 @@ var StorageFileApi = class extends BaseApiClient {
|
|
|
621
613
|
* contentType: 'image/png'
|
|
622
614
|
* })
|
|
623
615
|
* ```
|
|
616
|
+
*
|
|
617
|
+
* @remarks
|
|
618
|
+
* - RLS policy permissions required:
|
|
619
|
+
* - `buckets` table permissions: none
|
|
620
|
+
* - `objects` table permissions: only `insert` when you are uploading new files and `select`, `insert` and `update` when you are upserting files
|
|
621
|
+
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
622
|
+
* - For React Native, using either `Blob`, `File` or `FormData` does not work as intended. Upload file using `ArrayBuffer` from base64 file data instead, see example below.
|
|
624
623
|
*/
|
|
625
624
|
async upload(path, fileBody, fileOptions) {
|
|
626
625
|
return this.uploadOrUpdate("POST", path, fileBody, fileOptions);
|
|
@@ -655,6 +654,12 @@ var StorageFileApi = class extends BaseApiClient {
|
|
|
655
654
|
* "error": null
|
|
656
655
|
* }
|
|
657
656
|
* ```
|
|
657
|
+
*
|
|
658
|
+
* @remarks
|
|
659
|
+
* - RLS policy permissions required:
|
|
660
|
+
* - `buckets` table permissions: none
|
|
661
|
+
* - `objects` table permissions: none
|
|
662
|
+
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
658
663
|
*/
|
|
659
664
|
async uploadToSignedUrl(path, token, fileBody, fileOptions) {
|
|
660
665
|
var _this3 = this;
|
|
@@ -664,7 +669,7 @@ var StorageFileApi = class extends BaseApiClient {
|
|
|
664
669
|
url.searchParams.set("token", token);
|
|
665
670
|
return _this3.handleOperation(async () => {
|
|
666
671
|
let body;
|
|
667
|
-
const options = _objectSpread2({
|
|
672
|
+
const options = _objectSpread2(_objectSpread2({}, DEFAULT_FILE_OPTIONS), fileOptions);
|
|
668
673
|
const headers = _objectSpread2(_objectSpread2({}, _this3.headers), { "x-upsert": String(options.upsert) });
|
|
669
674
|
if (typeof Blob !== "undefined" && fileBody instanceof Blob) {
|
|
670
675
|
body = new FormData();
|
|
@@ -713,6 +718,12 @@ var StorageFileApi = class extends BaseApiClient {
|
|
|
713
718
|
* "error": null
|
|
714
719
|
* }
|
|
715
720
|
* ```
|
|
721
|
+
*
|
|
722
|
+
* @remarks
|
|
723
|
+
* - RLS policy permissions required:
|
|
724
|
+
* - `buckets` table permissions: none
|
|
725
|
+
* - `objects` table permissions: `insert`
|
|
726
|
+
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
716
727
|
*/
|
|
717
728
|
async createSignedUploadUrl(path, options) {
|
|
718
729
|
var _this4 = this;
|
|
@@ -774,6 +785,13 @@ var StorageFileApi = class extends BaseApiClient {
|
|
|
774
785
|
* contentType: 'image/png'
|
|
775
786
|
* })
|
|
776
787
|
* ```
|
|
788
|
+
*
|
|
789
|
+
* @remarks
|
|
790
|
+
* - RLS policy permissions required:
|
|
791
|
+
* - `buckets` table permissions: none
|
|
792
|
+
* - `objects` table permissions: `update` and `select`
|
|
793
|
+
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
794
|
+
* - For React Native, using either `Blob`, `File` or `FormData` does not work as intended. Update file using `ArrayBuffer` from base64 file data instead, see example below.
|
|
777
795
|
*/
|
|
778
796
|
async update(path, fileBody, fileOptions) {
|
|
779
797
|
return this.uploadOrUpdate("PUT", path, fileBody, fileOptions);
|
|
@@ -804,6 +822,12 @@ var StorageFileApi = class extends BaseApiClient {
|
|
|
804
822
|
* "error": null
|
|
805
823
|
* }
|
|
806
824
|
* ```
|
|
825
|
+
*
|
|
826
|
+
* @remarks
|
|
827
|
+
* - RLS policy permissions required:
|
|
828
|
+
* - `buckets` table permissions: none
|
|
829
|
+
* - `objects` table permissions: `update` and `select`
|
|
830
|
+
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
807
831
|
*/
|
|
808
832
|
async move(fromPath, toPath, options) {
|
|
809
833
|
var _this6 = this;
|
|
@@ -842,6 +866,12 @@ var StorageFileApi = class extends BaseApiClient {
|
|
|
842
866
|
* "error": null
|
|
843
867
|
* }
|
|
844
868
|
* ```
|
|
869
|
+
*
|
|
870
|
+
* @remarks
|
|
871
|
+
* - RLS policy permissions required:
|
|
872
|
+
* - `buckets` table permissions: none
|
|
873
|
+
* - `objects` table permissions: `insert` and `select`
|
|
874
|
+
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
845
875
|
*/
|
|
846
876
|
async copy(fromPath, toPath, options) {
|
|
847
877
|
var _this7 = this;
|
|
@@ -904,6 +934,12 @@ var StorageFileApi = class extends BaseApiClient {
|
|
|
904
934
|
* download: true,
|
|
905
935
|
* })
|
|
906
936
|
* ```
|
|
937
|
+
*
|
|
938
|
+
* @remarks
|
|
939
|
+
* - RLS policy permissions required:
|
|
940
|
+
* - `buckets` table permissions: none
|
|
941
|
+
* - `objects` table permissions: `select`
|
|
942
|
+
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
907
943
|
*/
|
|
908
944
|
async createSignedUrl(path, expiresIn, options) {
|
|
909
945
|
var _this8 = this;
|
|
@@ -953,6 +989,12 @@ var StorageFileApi = class extends BaseApiClient {
|
|
|
953
989
|
* "error": null
|
|
954
990
|
* }
|
|
955
991
|
* ```
|
|
992
|
+
*
|
|
993
|
+
* @remarks
|
|
994
|
+
* - RLS policy permissions required:
|
|
995
|
+
* - `buckets` table permissions: none
|
|
996
|
+
* - `objects` table permissions: `select`
|
|
997
|
+
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
956
998
|
*/
|
|
957
999
|
async createSignedUrls(paths, expiresIn, options) {
|
|
958
1000
|
var _this9 = this;
|
|
@@ -1022,6 +1064,12 @@ var StorageFileApi = class extends BaseApiClient {
|
|
|
1022
1064
|
* .from('avatars')
|
|
1023
1065
|
* .download('folder/avatar1.png', {}, { signal: controller.signal })
|
|
1024
1066
|
* ```
|
|
1067
|
+
*
|
|
1068
|
+
* @remarks
|
|
1069
|
+
* - RLS policy permissions required:
|
|
1070
|
+
* - `buckets` table permissions: none
|
|
1071
|
+
* - `objects` table permissions: `select`
|
|
1072
|
+
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
1025
1073
|
*/
|
|
1026
1074
|
download(path, options, parameters) {
|
|
1027
1075
|
const renderPath = typeof (options === null || options === void 0 ? void 0 : options.transform) !== "undefined" ? "render/image/authenticated" : "object";
|
|
@@ -1150,6 +1198,13 @@ var StorageFileApi = class extends BaseApiClient {
|
|
|
1150
1198
|
* download: true,
|
|
1151
1199
|
* })
|
|
1152
1200
|
* ```
|
|
1201
|
+
*
|
|
1202
|
+
* @remarks
|
|
1203
|
+
* - The bucket needs to be set to public, either via [updateBucket()](/docs/reference/javascript/storage-updatebucket) or by going to Storage on [supabase.com/dashboard](https://supabase.com/dashboard), clicking the overflow menu on a bucket and choosing "Make public"
|
|
1204
|
+
* - RLS policy permissions required:
|
|
1205
|
+
* - `buckets` table permissions: none
|
|
1206
|
+
* - `objects` table permissions: none
|
|
1207
|
+
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
1153
1208
|
*/
|
|
1154
1209
|
getPublicUrl(path, options) {
|
|
1155
1210
|
const _path = this._getFinalPath(path);
|
|
@@ -1188,6 +1243,12 @@ var StorageFileApi = class extends BaseApiClient {
|
|
|
1188
1243
|
* "error": null
|
|
1189
1244
|
* }
|
|
1190
1245
|
* ```
|
|
1246
|
+
*
|
|
1247
|
+
* @remarks
|
|
1248
|
+
* - RLS policy permissions required:
|
|
1249
|
+
* - `buckets` table permissions: none
|
|
1250
|
+
* - `objects` table permissions: `delete` and `select`
|
|
1251
|
+
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
1191
1252
|
*/
|
|
1192
1253
|
async remove(paths) {
|
|
1193
1254
|
var _this12 = this;
|
|
@@ -1241,7 +1302,7 @@ var StorageFileApi = class extends BaseApiClient {
|
|
|
1241
1302
|
* })
|
|
1242
1303
|
* ```
|
|
1243
1304
|
*
|
|
1244
|
-
* Response
|
|
1305
|
+
* Response:
|
|
1245
1306
|
* ```json
|
|
1246
1307
|
* {
|
|
1247
1308
|
* "data": [
|
|
@@ -1278,6 +1339,12 @@ var StorageFileApi = class extends BaseApiClient {
|
|
|
1278
1339
|
* search: 'jon'
|
|
1279
1340
|
* })
|
|
1280
1341
|
* ```
|
|
1342
|
+
*
|
|
1343
|
+
* @remarks
|
|
1344
|
+
* - RLS policy permissions required:
|
|
1345
|
+
* - `buckets` table permissions: none
|
|
1346
|
+
* - `objects` table permissions: `select`
|
|
1347
|
+
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
1281
1348
|
*/
|
|
1282
1349
|
async list(path, options, parameters) {
|
|
1283
1350
|
var _this13 = this;
|
|
@@ -1365,7 +1432,7 @@ var StorageFileApi = class extends BaseApiClient {
|
|
|
1365
1432
|
|
|
1366
1433
|
//#endregion
|
|
1367
1434
|
//#region src/lib/version.ts
|
|
1368
|
-
const version = "2.100.
|
|
1435
|
+
const version = "2.100.1";
|
|
1369
1436
|
|
|
1370
1437
|
//#endregion
|
|
1371
1438
|
//#region src/lib/constants.ts
|
|
@@ -1414,6 +1481,12 @@ var StorageBucketApi = class extends BaseApiClient {
|
|
|
1414
1481
|
* search: 'prod'
|
|
1415
1482
|
* })
|
|
1416
1483
|
* ```
|
|
1484
|
+
*
|
|
1485
|
+
* @remarks
|
|
1486
|
+
* - RLS policy permissions required:
|
|
1487
|
+
* - `buckets` table permissions: `select`
|
|
1488
|
+
* - `objects` table permissions: none
|
|
1489
|
+
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
1417
1490
|
*/
|
|
1418
1491
|
async listBuckets(options) {
|
|
1419
1492
|
var _this = this;
|
|
@@ -1454,6 +1527,12 @@ var StorageBucketApi = class extends BaseApiClient {
|
|
|
1454
1527
|
* "error": null
|
|
1455
1528
|
* }
|
|
1456
1529
|
* ```
|
|
1530
|
+
*
|
|
1531
|
+
* @remarks
|
|
1532
|
+
* - RLS policy permissions required:
|
|
1533
|
+
* - `buckets` table permissions: `select`
|
|
1534
|
+
* - `objects` table permissions: none
|
|
1535
|
+
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
1457
1536
|
*/
|
|
1458
1537
|
async getBucket(id) {
|
|
1459
1538
|
var _this2 = this;
|
|
@@ -1497,6 +1576,12 @@ var StorageBucketApi = class extends BaseApiClient {
|
|
|
1497
1576
|
* "error": null
|
|
1498
1577
|
* }
|
|
1499
1578
|
* ```
|
|
1579
|
+
*
|
|
1580
|
+
* @remarks
|
|
1581
|
+
* - RLS policy permissions required:
|
|
1582
|
+
* - `buckets` table permissions: `insert`
|
|
1583
|
+
* - `objects` table permissions: none
|
|
1584
|
+
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
1500
1585
|
*/
|
|
1501
1586
|
async createBucket(id, options = { public: false }) {
|
|
1502
1587
|
var _this3 = this;
|
|
@@ -1545,6 +1630,12 @@ var StorageBucketApi = class extends BaseApiClient {
|
|
|
1545
1630
|
* "error": null
|
|
1546
1631
|
* }
|
|
1547
1632
|
* ```
|
|
1633
|
+
*
|
|
1634
|
+
* @remarks
|
|
1635
|
+
* - RLS policy permissions required:
|
|
1636
|
+
* - `buckets` table permissions: `select` and `update`
|
|
1637
|
+
* - `objects` table permissions: none
|
|
1638
|
+
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
1548
1639
|
*/
|
|
1549
1640
|
async updateBucket(id, options) {
|
|
1550
1641
|
var _this4 = this;
|
|
@@ -1581,6 +1672,12 @@ var StorageBucketApi = class extends BaseApiClient {
|
|
|
1581
1672
|
* "error": null
|
|
1582
1673
|
* }
|
|
1583
1674
|
* ```
|
|
1675
|
+
*
|
|
1676
|
+
* @remarks
|
|
1677
|
+
* - RLS policy permissions required:
|
|
1678
|
+
* - `buckets` table permissions: `select`
|
|
1679
|
+
* - `objects` table permissions: `select` and `delete`
|
|
1680
|
+
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
1584
1681
|
*/
|
|
1585
1682
|
async emptyBucket(id) {
|
|
1586
1683
|
var _this5 = this;
|
|
@@ -1612,6 +1709,12 @@ var StorageBucketApi = class extends BaseApiClient {
|
|
|
1612
1709
|
* "error": null
|
|
1613
1710
|
* }
|
|
1614
1711
|
* ```
|
|
1712
|
+
*
|
|
1713
|
+
* @remarks
|
|
1714
|
+
* - RLS policy permissions required:
|
|
1715
|
+
* - `buckets` table permissions: `select` and `delete`
|
|
1716
|
+
* - `objects` table permissions: none
|
|
1717
|
+
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
1615
1718
|
*/
|
|
1616
1719
|
async deleteBucket(id) {
|
|
1617
1720
|
var _this6 = this;
|
|
@@ -1651,7 +1754,7 @@ var StorageAnalyticsClient = class extends BaseApiClient {
|
|
|
1651
1754
|
* @param headers - HTTP headers to include in requests
|
|
1652
1755
|
* @param fetch - Optional custom fetch implementation
|
|
1653
1756
|
*
|
|
1654
|
-
* @example
|
|
1757
|
+
* @example Creating a StorageAnalyticsClient instance
|
|
1655
1758
|
* ```typescript
|
|
1656
1759
|
* const client = new StorageAnalyticsClient(url, headers)
|
|
1657
1760
|
* ```
|
|
@@ -1694,6 +1797,10 @@ var StorageAnalyticsClient = class extends BaseApiClient {
|
|
|
1694
1797
|
* "error": null
|
|
1695
1798
|
* }
|
|
1696
1799
|
* ```
|
|
1800
|
+
*
|
|
1801
|
+
* @remarks
|
|
1802
|
+
* - Creates a new analytics bucket using Iceberg tables
|
|
1803
|
+
* - Analytics buckets are optimized for analytical queries and data processing
|
|
1697
1804
|
*/
|
|
1698
1805
|
async createBucket(name) {
|
|
1699
1806
|
var _this = this;
|
|
@@ -1746,6 +1853,10 @@ var StorageAnalyticsClient = class extends BaseApiClient {
|
|
|
1746
1853
|
* "error": null
|
|
1747
1854
|
* }
|
|
1748
1855
|
* ```
|
|
1856
|
+
*
|
|
1857
|
+
* @remarks
|
|
1858
|
+
* - Retrieves the details of all Analytics Storage buckets within an existing project
|
|
1859
|
+
* - Only returns buckets of type 'ANALYTICS'
|
|
1749
1860
|
*/
|
|
1750
1861
|
async listBuckets(options) {
|
|
1751
1862
|
var _this2 = this;
|
|
@@ -1791,6 +1902,9 @@ var StorageAnalyticsClient = class extends BaseApiClient {
|
|
|
1791
1902
|
* "error": null
|
|
1792
1903
|
* }
|
|
1793
1904
|
* ```
|
|
1905
|
+
*
|
|
1906
|
+
* @remarks
|
|
1907
|
+
* - Deletes an analytics bucket
|
|
1794
1908
|
*/
|
|
1795
1909
|
async deleteBucket(bucketName) {
|
|
1796
1910
|
var _this3 = this;
|
|
@@ -2165,7 +2279,7 @@ var StorageVectorsClient = class extends VectorBucketApi {
|
|
|
2165
2279
|
* @param options.headers - Optional headers (for example `Authorization`) applied to every request.
|
|
2166
2280
|
* @param options.fetch - Optional custom `fetch` implementation for non-browser runtimes.
|
|
2167
2281
|
*
|
|
2168
|
-
* @example
|
|
2282
|
+
* @example Creating a StorageVectorsClient instance
|
|
2169
2283
|
* ```typescript
|
|
2170
2284
|
* const client = new StorageVectorsClient(url, options)
|
|
2171
2285
|
* ```
|
|
@@ -2186,7 +2300,7 @@ var StorageVectorsClient = class extends VectorBucketApi {
|
|
|
2186
2300
|
* @param vectorBucketName - Name of the vector bucket
|
|
2187
2301
|
* @returns Bucket-scoped client with index and vector operations
|
|
2188
2302
|
*
|
|
2189
|
-
* @example
|
|
2303
|
+
* @example Accessing a vector bucket
|
|
2190
2304
|
* ```typescript
|
|
2191
2305
|
* const bucket = supabase.storage.vectors.from('embeddings-prod')
|
|
2192
2306
|
* ```
|
|
@@ -2207,7 +2321,7 @@ var StorageVectorsClient = class extends VectorBucketApi {
|
|
|
2207
2321
|
* @param vectorBucketName - Unique name for the vector bucket
|
|
2208
2322
|
* @returns Promise with empty response on success or error
|
|
2209
2323
|
*
|
|
2210
|
-
* @example
|
|
2324
|
+
* @example Creating a vector bucket
|
|
2211
2325
|
* ```typescript
|
|
2212
2326
|
* const { data, error } = await supabase
|
|
2213
2327
|
* .storage
|
|
@@ -2231,7 +2345,7 @@ var StorageVectorsClient = class extends VectorBucketApi {
|
|
|
2231
2345
|
* @param vectorBucketName - Name of the vector bucket
|
|
2232
2346
|
* @returns Promise with bucket metadata or error
|
|
2233
2347
|
*
|
|
2234
|
-
* @example
|
|
2348
|
+
* @example Get bucket metadata
|
|
2235
2349
|
* ```typescript
|
|
2236
2350
|
* const { data, error } = await supabase
|
|
2237
2351
|
* .storage
|
|
@@ -2257,7 +2371,7 @@ var StorageVectorsClient = class extends VectorBucketApi {
|
|
|
2257
2371
|
* @param options - Optional filters (prefix, maxResults, nextToken)
|
|
2258
2372
|
* @returns Promise with list of buckets or error
|
|
2259
2373
|
*
|
|
2260
|
-
* @example
|
|
2374
|
+
* @example List vector buckets
|
|
2261
2375
|
* ```typescript
|
|
2262
2376
|
* const { data, error } = await supabase
|
|
2263
2377
|
* .storage
|
|
@@ -2286,7 +2400,7 @@ var StorageVectorsClient = class extends VectorBucketApi {
|
|
|
2286
2400
|
* @param vectorBucketName - Name of the vector bucket to delete
|
|
2287
2401
|
* @returns Promise with empty response on success or error
|
|
2288
2402
|
*
|
|
2289
|
-
* @example
|
|
2403
|
+
* @example Delete a vector bucket
|
|
2290
2404
|
* ```typescript
|
|
2291
2405
|
* const { data, error } = await supabase
|
|
2292
2406
|
* .storage
|
|
@@ -2317,7 +2431,7 @@ var VectorBucketScope = class extends VectorIndexApi {
|
|
|
2317
2431
|
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
2318
2432
|
*
|
|
2319
2433
|
* @category Vector Buckets
|
|
2320
|
-
* @example
|
|
2434
|
+
* @example Creating a vector bucket scope
|
|
2321
2435
|
* ```typescript
|
|
2322
2436
|
* const bucket = supabase.storage.vectors.from('embeddings-prod')
|
|
2323
2437
|
* ```
|
|
@@ -2339,7 +2453,7 @@ var VectorBucketScope = class extends VectorIndexApi {
|
|
|
2339
2453
|
* @param options - Index configuration (vectorBucketName is automatically set)
|
|
2340
2454
|
* @returns Promise with empty response on success or error
|
|
2341
2455
|
*
|
|
2342
|
-
* @example
|
|
2456
|
+
* @example Creating a vector index
|
|
2343
2457
|
* ```typescript
|
|
2344
2458
|
* const bucket = supabase.storage.vectors.from('embeddings-prod')
|
|
2345
2459
|
* await bucket.createIndex({
|
|
@@ -2370,7 +2484,7 @@ var VectorBucketScope = class extends VectorIndexApi {
|
|
|
2370
2484
|
* @param options - Listing options (vectorBucketName is automatically set)
|
|
2371
2485
|
* @returns Promise with response containing indexes array and pagination token or error
|
|
2372
2486
|
*
|
|
2373
|
-
* @example
|
|
2487
|
+
* @example List indexes
|
|
2374
2488
|
* ```typescript
|
|
2375
2489
|
* const bucket = supabase.storage.vectors.from('embeddings-prod')
|
|
2376
2490
|
* const { data } = await bucket.listIndexes({ prefix: 'documents-' })
|
|
@@ -2393,7 +2507,7 @@ var VectorBucketScope = class extends VectorIndexApi {
|
|
|
2393
2507
|
* @param indexName - Name of the index to retrieve
|
|
2394
2508
|
* @returns Promise with index metadata or error
|
|
2395
2509
|
*
|
|
2396
|
-
* @example
|
|
2510
|
+
* @example Get index metadata
|
|
2397
2511
|
* ```typescript
|
|
2398
2512
|
* const bucket = supabase.storage.vectors.from('embeddings-prod')
|
|
2399
2513
|
* const { data } = await bucket.getIndex('documents-openai')
|
|
@@ -2417,7 +2531,7 @@ var VectorBucketScope = class extends VectorIndexApi {
|
|
|
2417
2531
|
* @param indexName - Name of the index to delete
|
|
2418
2532
|
* @returns Promise with empty response on success or error
|
|
2419
2533
|
*
|
|
2420
|
-
* @example
|
|
2534
|
+
* @example Delete an index
|
|
2421
2535
|
* ```typescript
|
|
2422
2536
|
* const bucket = supabase.storage.vectors.from('embeddings-prod')
|
|
2423
2537
|
* await bucket.deleteIndex('old-index')
|
|
@@ -2440,7 +2554,7 @@ var VectorBucketScope = class extends VectorIndexApi {
|
|
|
2440
2554
|
* @param indexName - Name of the index
|
|
2441
2555
|
* @returns Index-scoped client with vector data operations
|
|
2442
2556
|
*
|
|
2443
|
-
* @example
|
|
2557
|
+
* @example Accessing an index
|
|
2444
2558
|
* ```typescript
|
|
2445
2559
|
* const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')
|
|
2446
2560
|
*
|
|
@@ -2481,7 +2595,7 @@ var VectorIndexScope = class extends VectorDataApi {
|
|
|
2481
2595
|
* **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
|
|
2482
2596
|
*
|
|
2483
2597
|
* @category Vector Buckets
|
|
2484
|
-
* @example
|
|
2598
|
+
* @example Creating a vector index scope
|
|
2485
2599
|
* ```typescript
|
|
2486
2600
|
* const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')
|
|
2487
2601
|
* ```
|
|
@@ -2504,7 +2618,7 @@ var VectorIndexScope = class extends VectorDataApi {
|
|
|
2504
2618
|
* @param options - Vector insertion options (bucket and index names automatically set)
|
|
2505
2619
|
* @returns Promise with empty response on success or error
|
|
2506
2620
|
*
|
|
2507
|
-
* @example
|
|
2621
|
+
* @example Insert vectors into an index
|
|
2508
2622
|
* ```typescript
|
|
2509
2623
|
* const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')
|
|
2510
2624
|
* await index.putVectors({
|
|
@@ -2538,7 +2652,7 @@ var VectorIndexScope = class extends VectorDataApi {
|
|
|
2538
2652
|
* @param options - Vector retrieval options (bucket and index names automatically set)
|
|
2539
2653
|
* @returns Promise with response containing vectors array or error
|
|
2540
2654
|
*
|
|
2541
|
-
* @example
|
|
2655
|
+
* @example Get vectors by keys
|
|
2542
2656
|
* ```typescript
|
|
2543
2657
|
* const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')
|
|
2544
2658
|
* const { data } = await index.getVectors({
|
|
@@ -2567,7 +2681,7 @@ var VectorIndexScope = class extends VectorDataApi {
|
|
|
2567
2681
|
* @param options - Listing options (bucket and index names automatically set)
|
|
2568
2682
|
* @returns Promise with response containing vectors array and pagination token or error
|
|
2569
2683
|
*
|
|
2570
|
-
* @example
|
|
2684
|
+
* @example List vectors with pagination
|
|
2571
2685
|
* ```typescript
|
|
2572
2686
|
* const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')
|
|
2573
2687
|
* const { data } = await index.listVectors({
|
|
@@ -2596,7 +2710,7 @@ var VectorIndexScope = class extends VectorDataApi {
|
|
|
2596
2710
|
* @param options - Query options (bucket and index names automatically set)
|
|
2597
2711
|
* @returns Promise with response containing matches array of similar vectors ordered by distance or error
|
|
2598
2712
|
*
|
|
2599
|
-
* @example
|
|
2713
|
+
* @example Query similar vectors
|
|
2600
2714
|
* ```typescript
|
|
2601
2715
|
* const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')
|
|
2602
2716
|
* const { data } = await index.queryVectors({
|
|
@@ -2628,7 +2742,7 @@ var VectorIndexScope = class extends VectorDataApi {
|
|
|
2628
2742
|
* @param options - Deletion options (bucket and index names automatically set)
|
|
2629
2743
|
* @returns Promise with empty response on success or error
|
|
2630
2744
|
*
|
|
2631
|
-
* @example
|
|
2745
|
+
* @example Delete vectors by keys
|
|
2632
2746
|
* ```typescript
|
|
2633
2747
|
* const index = supabase.storage.vectors.from('embeddings-prod').index('documents-openai')
|
|
2634
2748
|
* await index.deleteVectors({
|
|
@@ -2652,7 +2766,7 @@ var StorageClient = class extends StorageBucketApi {
|
|
|
2652
2766
|
* Creates a client for Storage buckets, files, analytics, and vectors.
|
|
2653
2767
|
*
|
|
2654
2768
|
* @category File Buckets
|
|
2655
|
-
* @example
|
|
2769
|
+
* @example Creating a Storage client
|
|
2656
2770
|
* ```ts
|
|
2657
2771
|
* import { StorageClient } from '@supabase/storage-js'
|
|
2658
2772
|
*
|
|
@@ -2671,7 +2785,7 @@ var StorageClient = class extends StorageBucketApi {
|
|
|
2671
2785
|
* @category File Buckets
|
|
2672
2786
|
* @param id The bucket id to operate on.
|
|
2673
2787
|
*
|
|
2674
|
-
* @example
|
|
2788
|
+
* @example Accessing a bucket
|
|
2675
2789
|
* ```typescript
|
|
2676
2790
|
* const avatars = supabase.storage.from('avatars')
|
|
2677
2791
|
* ```
|