@supabase/storage-js 2.84.1-canary.1 → 2.85.1-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/README.md +74 -7
  2. package/dist/main/lib/helpers.d.ts +16 -0
  3. package/dist/main/lib/helpers.d.ts.map +1 -1
  4. package/dist/main/lib/helpers.js +41 -1
  5. package/dist/main/lib/helpers.js.map +1 -1
  6. package/dist/main/lib/vectors/StorageVectorsClient.d.ts +108 -14
  7. package/dist/main/lib/vectors/StorageVectorsClient.d.ts.map +1 -1
  8. package/dist/main/lib/vectors/StorageVectorsClient.js +124 -4
  9. package/dist/main/lib/vectors/StorageVectorsClient.js.map +1 -1
  10. package/dist/main/lib/version.d.ts +1 -1
  11. package/dist/main/lib/version.js +1 -1
  12. package/dist/main/packages/StorageAnalyticsClient.d.ts +142 -5
  13. package/dist/main/packages/StorageAnalyticsClient.d.ts.map +1 -1
  14. package/dist/main/packages/StorageAnalyticsClient.js +160 -4
  15. package/dist/main/packages/StorageAnalyticsClient.js.map +1 -1
  16. package/dist/main/packages/StorageBucketApi.d.ts +4 -4
  17. package/dist/main/packages/StorageBucketApi.js +4 -4
  18. package/dist/main/packages/StorageFileApi.d.ts +12 -12
  19. package/dist/main/packages/StorageFileApi.js +12 -12
  20. package/dist/module/lib/helpers.d.ts +16 -0
  21. package/dist/module/lib/helpers.d.ts.map +1 -1
  22. package/dist/module/lib/helpers.js +39 -0
  23. package/dist/module/lib/helpers.js.map +1 -1
  24. package/dist/module/lib/vectors/StorageVectorsClient.d.ts +108 -14
  25. package/dist/module/lib/vectors/StorageVectorsClient.d.ts.map +1 -1
  26. package/dist/module/lib/vectors/StorageVectorsClient.js +124 -4
  27. package/dist/module/lib/vectors/StorageVectorsClient.js.map +1 -1
  28. package/dist/module/lib/version.d.ts +1 -1
  29. package/dist/module/lib/version.js +1 -1
  30. package/dist/module/packages/StorageAnalyticsClient.d.ts +142 -5
  31. package/dist/module/packages/StorageAnalyticsClient.d.ts.map +1 -1
  32. package/dist/module/packages/StorageAnalyticsClient.js +162 -6
  33. package/dist/module/packages/StorageAnalyticsClient.js.map +1 -1
  34. package/dist/module/packages/StorageBucketApi.d.ts +4 -4
  35. package/dist/module/packages/StorageBucketApi.js +4 -4
  36. package/dist/module/packages/StorageFileApi.d.ts +12 -12
  37. package/dist/module/packages/StorageFileApi.js +12 -12
  38. package/dist/tsconfig.module.tsbuildinfo +1 -1
  39. package/dist/tsconfig.tsbuildinfo +1 -1
  40. package/dist/umd/supabase.js +1 -1
  41. package/package.json +2 -1
  42. package/src/lib/helpers.ts +44 -0
  43. package/src/lib/vectors/StorageVectorsClient.ts +114 -4
  44. package/src/lib/version.ts +1 -1
  45. package/src/packages/StorageAnalyticsClient.ts +166 -6
  46. package/src/packages/StorageBucketApi.ts +4 -4
  47. package/src/packages/StorageFileApi.ts +12 -12
@@ -1,3 +1,4 @@
1
+ import { IcebergRestCatalog } from 'iceberg-js';
1
2
  import { StorageError } from '../lib/errors';
2
3
  import { Fetch } from '../lib/fetch';
3
4
  import { AnalyticBucket } from '../lib/types';
@@ -54,7 +55,7 @@ export default class StorageAnalyticsClient {
54
55
  *
55
56
  * @category Analytics Buckets
56
57
  * @param name A unique name for the bucket you are creating
57
- * @returns Promise with newly created bucket name or error
58
+ * @returns Promise with response containing newly created analytics bucket or error
58
59
  *
59
60
  * @example Create analytics bucket
60
61
  * ```js
@@ -97,10 +98,10 @@ export default class StorageAnalyticsClient {
97
98
  * @param options Query parameters for listing buckets
98
99
  * @param options.limit Maximum number of buckets to return
99
100
  * @param options.offset Number of buckets to skip
100
- * @param options.sortColumn Column to sort by ('id', 'name', 'created_at', 'updated_at')
101
+ * @param options.sortColumn Column to sort by ('name', 'created_at', 'updated_at')
101
102
  * @param options.sortOrder Sort order ('asc' or 'desc')
102
103
  * @param options.search Search term to filter bucket names
103
- * @returns Promise with list of analytics buckets or error
104
+ * @returns Promise with response containing array of analytics buckets or error
104
105
  *
105
106
  * @example List analytics buckets
106
107
  * ```js
@@ -134,7 +135,7 @@ export default class StorageAnalyticsClient {
134
135
  listBuckets(options?: {
135
136
  limit?: number;
136
137
  offset?: number;
137
- sortColumn?: 'id' | 'name' | 'created_at' | 'updated_at';
138
+ sortColumn?: 'name' | 'created_at' | 'updated_at';
138
139
  sortOrder?: 'asc' | 'desc';
139
140
  search?: string;
140
141
  }): Promise<{
@@ -155,7 +156,7 @@ export default class StorageAnalyticsClient {
155
156
  *
156
157
  * @category Analytics Buckets
157
158
  * @param bucketName The unique identifier of the bucket you would like to delete
158
- * @returns Promise with success message or error
159
+ * @returns Promise with response containing success message or error
159
160
  *
160
161
  * @example Delete analytics bucket
161
162
  * ```js
@@ -184,5 +185,141 @@ export default class StorageAnalyticsClient {
184
185
  data: null;
185
186
  error: StorageError;
186
187
  }>;
188
+ /**
189
+ * @alpha
190
+ *
191
+ * Get an Iceberg REST Catalog client configured for a specific analytics bucket
192
+ * Use this to perform advanced table and namespace operations within the bucket
193
+ * The returned client provides full access to the Apache Iceberg REST Catalog API
194
+ *
195
+ * **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
196
+ *
197
+ * @category Analytics Buckets
198
+ * @param bucketName - The name of the analytics bucket (warehouse) to connect to
199
+ * @returns Configured IcebergRestCatalog instance for advanced Iceberg operations
200
+ *
201
+ * @example Get catalog and create table
202
+ * ```js
203
+ * // First, create an analytics bucket
204
+ * const { data: bucket, error: bucketError } = await supabase
205
+ * .storage
206
+ * .analytics
207
+ * .createBucket('analytics-data')
208
+ *
209
+ * // Get the Iceberg catalog for that bucket
210
+ * const catalog = supabase.storage.analytics.from('analytics-data')
211
+ *
212
+ * // Create a namespace
213
+ * await catalog.createNamespace({ namespace: ['default'] })
214
+ *
215
+ * // Create a table with schema
216
+ * await catalog.createTable(
217
+ * { namespace: ['default'] },
218
+ * {
219
+ * name: 'events',
220
+ * schema: {
221
+ * type: 'struct',
222
+ * fields: [
223
+ * { id: 1, name: 'id', type: 'long', required: true },
224
+ * { id: 2, name: 'timestamp', type: 'timestamp', required: true },
225
+ * { id: 3, name: 'user_id', type: 'string', required: false }
226
+ * ],
227
+ * 'schema-id': 0,
228
+ * 'identifier-field-ids': [1]
229
+ * },
230
+ * 'partition-spec': {
231
+ * 'spec-id': 0,
232
+ * fields: []
233
+ * },
234
+ * 'write-order': {
235
+ * 'order-id': 0,
236
+ * fields: []
237
+ * },
238
+ * properties: {
239
+ * 'write.format.default': 'parquet'
240
+ * }
241
+ * }
242
+ * )
243
+ * ```
244
+ *
245
+ * @example List tables in namespace
246
+ * ```js
247
+ * const catalog = supabase.storage.analytics.from('analytics-data')
248
+ *
249
+ * // List all tables in the default namespace
250
+ * const tables = await catalog.listTables({ namespace: ['default'] })
251
+ * console.log(tables) // [{ namespace: ['default'], name: 'events' }]
252
+ * ```
253
+ *
254
+ * @example Working with namespaces
255
+ * ```js
256
+ * const catalog = supabase.storage.analytics.from('analytics-data')
257
+ *
258
+ * // List all namespaces
259
+ * const namespaces = await catalog.listNamespaces()
260
+ *
261
+ * // Create namespace with properties
262
+ * await catalog.createNamespace(
263
+ * { namespace: ['production'] },
264
+ * { properties: { owner: 'data-team', env: 'prod' } }
265
+ * )
266
+ * ```
267
+ *
268
+ * @example Cleanup operations
269
+ * ```js
270
+ * const catalog = supabase.storage.analytics.from('analytics-data')
271
+ *
272
+ * // Drop table with purge option (removes all data)
273
+ * await catalog.dropTable(
274
+ * { namespace: ['default'], name: 'events' },
275
+ * { purge: true }
276
+ * )
277
+ *
278
+ * // Drop namespace (must be empty)
279
+ * await catalog.dropNamespace({ namespace: ['default'] })
280
+ * ```
281
+ *
282
+ * @example Error handling with catalog operations
283
+ * ```js
284
+ * import { IcebergError } from 'iceberg-js'
285
+ *
286
+ * const catalog = supabase.storage.analytics.from('analytics-data')
287
+ *
288
+ * try {
289
+ * await catalog.dropTable({ namespace: ['default'], name: 'events' }, { purge: true })
290
+ * } catch (error) {
291
+ * // Handle 404 errors (resource not found)
292
+ * const is404 =
293
+ * (error instanceof IcebergError && error.status === 404) ||
294
+ * error?.status === 404 ||
295
+ * error?.details?.error?.code === 404
296
+ *
297
+ * if (is404) {
298
+ * console.log('Table does not exist')
299
+ * } else {
300
+ * throw error // Re-throw other errors
301
+ * }
302
+ * }
303
+ * ```
304
+ *
305
+ * @remarks
306
+ * This method provides a bridge between Supabase's bucket management and the standard
307
+ * Apache Iceberg REST Catalog API. The bucket name maps to the Iceberg warehouse parameter.
308
+ * All authentication and configuration is handled automatically using your Supabase credentials.
309
+ *
310
+ * **Error Handling**: Operations may throw `IcebergError` from the iceberg-js library.
311
+ * Always handle 404 errors gracefully when checking for resource existence.
312
+ *
313
+ * **Cleanup Operations**: When using `dropTable`, the `purge: true` option permanently
314
+ * deletes all table data. Without it, the table is marked as deleted but data remains.
315
+ *
316
+ * **Library Dependency**: The returned catalog is an instance of `IcebergRestCatalog`
317
+ * from iceberg-js. For complete API documentation and advanced usage, refer to the
318
+ * [iceberg-js documentation](https://supabase.github.io/iceberg-js/).
319
+ *
320
+ * For advanced Iceberg operations beyond bucket management, you can also install and use
321
+ * the `iceberg-js` package directly with manual configuration.
322
+ */
323
+ from(bucketName: string): IcebergRestCatalog;
187
324
  }
188
325
  //# sourceMappingURL=StorageAnalyticsClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"StorageAnalyticsClient.d.ts","sourceRoot":"","sources":["../../../src/packages/StorageAnalyticsClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5D,OAAO,EAAE,KAAK,EAAqB,MAAM,cAAc,CAAA;AAEvD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE7C;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,sBAAsB;IACzC,SAAS,CAAC,GAAG,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE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A;QACd,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,UAAU,CAAC,EAAE,MAAM,GAAG,YAAY,GAAG,YAAY,CAAA;QACjD,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;QAC1B,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,GAAG,OAAO,CACP;QACE,IAAI,EAAE,cAAc,EAAE,CAAA;QACtB,KAAK,EAAE,IAAI,CAAA;KACZ,GACD;QACE,IAAI,EAAE,IAAI,CAAA;QACV,KAAK,EAAE,YAAY,CAAA;KACpB,CACJ;IA4BD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACG,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAC3C;QACE,IAAI,EAAE;YAAE,OAAO,EAAE,MAAM,CAAA;SAAE,CAAA;QACzB,KAAK,EAAE,IAAI,CAAA;KACZ,GACD;QACE,IAAI,EAAE,IAAI,CAAA;QACV,KAAK,EAAE,YAAY,CAAA;KACpB,CACJ;IAqBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsIG;IACH,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,kBAAkB;CAuB7C"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
+ const iceberg_js_1 = require("iceberg-js");
4
5
  const constants_1 = require("../lib/constants");
5
6
  const errors_1 = require("../lib/errors");
6
7
  const fetch_1 = require("../lib/fetch");
@@ -58,7 +59,7 @@ class StorageAnalyticsClient {
58
59
  *
59
60
  * @category Analytics Buckets
60
61
  * @param name A unique name for the bucket you are creating
61
- * @returns Promise with newly created bucket name or error
62
+ * @returns Promise with response containing newly created analytics bucket or error
62
63
  *
63
64
  * @example Create analytics bucket
64
65
  * ```js
@@ -111,10 +112,10 @@ class StorageAnalyticsClient {
111
112
  * @param options Query parameters for listing buckets
112
113
  * @param options.limit Maximum number of buckets to return
113
114
  * @param options.offset Number of buckets to skip
114
- * @param options.sortColumn Column to sort by ('id', 'name', 'created_at', 'updated_at')
115
+ * @param options.sortColumn Column to sort by ('name', 'created_at', 'updated_at')
115
116
  * @param options.sortOrder Sort order ('asc' or 'desc')
116
117
  * @param options.search Search term to filter bucket names
117
- * @returns Promise with list of analytics buckets or error
118
+ * @returns Promise with response containing array of analytics buckets or error
118
119
  *
119
120
  * @example List analytics buckets
120
121
  * ```js
@@ -187,7 +188,7 @@ class StorageAnalyticsClient {
187
188
  *
188
189
  * @category Analytics Buckets
189
190
  * @param bucketName The unique identifier of the bucket you would like to delete
190
- * @returns Promise with success message or error
191
+ * @returns Promise with response containing success message or error
191
192
  *
192
193
  * @example Delete analytics bucket
193
194
  * ```js
@@ -224,6 +225,161 @@ class StorageAnalyticsClient {
224
225
  }
225
226
  });
226
227
  }
228
+ /**
229
+ * @alpha
230
+ *
231
+ * Get an Iceberg REST Catalog client configured for a specific analytics bucket
232
+ * Use this to perform advanced table and namespace operations within the bucket
233
+ * The returned client provides full access to the Apache Iceberg REST Catalog API
234
+ *
235
+ * **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
236
+ *
237
+ * @category Analytics Buckets
238
+ * @param bucketName - The name of the analytics bucket (warehouse) to connect to
239
+ * @returns Configured IcebergRestCatalog instance for advanced Iceberg operations
240
+ *
241
+ * @example Get catalog and create table
242
+ * ```js
243
+ * // First, create an analytics bucket
244
+ * const { data: bucket, error: bucketError } = await supabase
245
+ * .storage
246
+ * .analytics
247
+ * .createBucket('analytics-data')
248
+ *
249
+ * // Get the Iceberg catalog for that bucket
250
+ * const catalog = supabase.storage.analytics.from('analytics-data')
251
+ *
252
+ * // Create a namespace
253
+ * await catalog.createNamespace({ namespace: ['default'] })
254
+ *
255
+ * // Create a table with schema
256
+ * await catalog.createTable(
257
+ * { namespace: ['default'] },
258
+ * {
259
+ * name: 'events',
260
+ * schema: {
261
+ * type: 'struct',
262
+ * fields: [
263
+ * { id: 1, name: 'id', type: 'long', required: true },
264
+ * { id: 2, name: 'timestamp', type: 'timestamp', required: true },
265
+ * { id: 3, name: 'user_id', type: 'string', required: false }
266
+ * ],
267
+ * 'schema-id': 0,
268
+ * 'identifier-field-ids': [1]
269
+ * },
270
+ * 'partition-spec': {
271
+ * 'spec-id': 0,
272
+ * fields: []
273
+ * },
274
+ * 'write-order': {
275
+ * 'order-id': 0,
276
+ * fields: []
277
+ * },
278
+ * properties: {
279
+ * 'write.format.default': 'parquet'
280
+ * }
281
+ * }
282
+ * )
283
+ * ```
284
+ *
285
+ * @example List tables in namespace
286
+ * ```js
287
+ * const catalog = supabase.storage.analytics.from('analytics-data')
288
+ *
289
+ * // List all tables in the default namespace
290
+ * const tables = await catalog.listTables({ namespace: ['default'] })
291
+ * console.log(tables) // [{ namespace: ['default'], name: 'events' }]
292
+ * ```
293
+ *
294
+ * @example Working with namespaces
295
+ * ```js
296
+ * const catalog = supabase.storage.analytics.from('analytics-data')
297
+ *
298
+ * // List all namespaces
299
+ * const namespaces = await catalog.listNamespaces()
300
+ *
301
+ * // Create namespace with properties
302
+ * await catalog.createNamespace(
303
+ * { namespace: ['production'] },
304
+ * { properties: { owner: 'data-team', env: 'prod' } }
305
+ * )
306
+ * ```
307
+ *
308
+ * @example Cleanup operations
309
+ * ```js
310
+ * const catalog = supabase.storage.analytics.from('analytics-data')
311
+ *
312
+ * // Drop table with purge option (removes all data)
313
+ * await catalog.dropTable(
314
+ * { namespace: ['default'], name: 'events' },
315
+ * { purge: true }
316
+ * )
317
+ *
318
+ * // Drop namespace (must be empty)
319
+ * await catalog.dropNamespace({ namespace: ['default'] })
320
+ * ```
321
+ *
322
+ * @example Error handling with catalog operations
323
+ * ```js
324
+ * import { IcebergError } from 'iceberg-js'
325
+ *
326
+ * const catalog = supabase.storage.analytics.from('analytics-data')
327
+ *
328
+ * try {
329
+ * await catalog.dropTable({ namespace: ['default'], name: 'events' }, { purge: true })
330
+ * } catch (error) {
331
+ * // Handle 404 errors (resource not found)
332
+ * const is404 =
333
+ * (error instanceof IcebergError && error.status === 404) ||
334
+ * error?.status === 404 ||
335
+ * error?.details?.error?.code === 404
336
+ *
337
+ * if (is404) {
338
+ * console.log('Table does not exist')
339
+ * } else {
340
+ * throw error // Re-throw other errors
341
+ * }
342
+ * }
343
+ * ```
344
+ *
345
+ * @remarks
346
+ * This method provides a bridge between Supabase's bucket management and the standard
347
+ * Apache Iceberg REST Catalog API. The bucket name maps to the Iceberg warehouse parameter.
348
+ * All authentication and configuration is handled automatically using your Supabase credentials.
349
+ *
350
+ * **Error Handling**: Operations may throw `IcebergError` from the iceberg-js library.
351
+ * Always handle 404 errors gracefully when checking for resource existence.
352
+ *
353
+ * **Cleanup Operations**: When using `dropTable`, the `purge: true` option permanently
354
+ * deletes all table data. Without it, the table is marked as deleted but data remains.
355
+ *
356
+ * **Library Dependency**: The returned catalog is an instance of `IcebergRestCatalog`
357
+ * from iceberg-js. For complete API documentation and advanced usage, refer to the
358
+ * [iceberg-js documentation](https://supabase.github.io/iceberg-js/).
359
+ *
360
+ * For advanced Iceberg operations beyond bucket management, you can also install and use
361
+ * the `iceberg-js` package directly with manual configuration.
362
+ */
363
+ from(bucketName) {
364
+ // Validate bucket name using same rules as Supabase Storage API backend
365
+ if (!(0, helpers_1.isValidBucketName)(bucketName)) {
366
+ throw new errors_1.StorageError('Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines ' +
367
+ 'and should avoid the use of any other characters.');
368
+ }
369
+ // Construct the Iceberg REST Catalog URL
370
+ // The base URL is /storage/v1/iceberg
371
+ // Note: IcebergRestCatalog from iceberg-js automatically adds /v1/ prefix to API paths
372
+ // so we should NOT append /v1 here (it would cause double /v1/v1/ in the URL)
373
+ return new iceberg_js_1.IcebergRestCatalog({
374
+ baseUrl: this.url,
375
+ catalogName: bucketName, // Maps to the warehouse parameter in Supabase's implementation
376
+ auth: {
377
+ type: 'custom',
378
+ getHeaders: () => tslib_1.__awaiter(this, void 0, void 0, function* () { return this.headers; }),
379
+ },
380
+ fetch: this.fetch,
381
+ });
382
+ }
227
383
  }
228
384
  exports.default = StorageAnalyticsClient;
229
385
  //# sourceMappingURL=StorageAnalyticsClient.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StorageAnalyticsClient.js","sourceRoot":"","sources":["../../../src/packages/StorageAnalyticsClient.ts"],"names":[],"mappings":";;;AAAA,gDAAkD;AAClD,0CAA4D;AAC5D,wCAAuD;AACvD,4CAA6C;AAG7C;;;GAGG;AACH,MAAqB,sBAAsB;IAMzC;;;;;;;;;;;;;;;;OAgBG;IACH,YAAY,GAAW,EAAE,UAAqC,EAAE,EAAE,KAAa;QAnBrE,uBAAkB,GAAG,KAAK,CAAA;QAoBlC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;QACjC,IAAI,CAAC,OAAO,mCAAQ,2BAAe,GAAK,OAAO,CAAE,CAAA;QACjD,IAAI,CAAC,KAAK,GAAG,IAAA,sBAAY,EAAC,KAAK,CAAC,CAAA;IAClC,CAAC;IAED;;;;;;;;;;OAUG;IACI,YAAY;QACjB,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAA;QAC9B,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACG,YAAY,CAAC,IAAY;;YAU7B,IAAI,CAAC;gBACH,MAAM,IAAI,GAAG,MAAM,IAAA,YAAI,EAAC,IAAI,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,GAAG,SAAS,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAA;gBAC9F,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAA;YA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AK,CAAA;YACb,CAAC;QACH,CAAC;KAAA;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsIG;IACH,IAAI,CAAC,UAAkB;QACrB,wEAAwE;QACxE,IAAI,CAAC,IAAA,2BAAiB,EAAC,UAAU,CAAC,EAAE,CAAC;YACnC,MAAM,IAAI,qBAAY,CACpB,mGAAmG;gBACjG,mDAAmD,CACtD,CAAA;QACH,CAAC;QAED,yCAAyC;QACzC,sCAAsC;QACtC,uFAAuF;QACvF,8EAA8E;QAC9E,OAAO,IAAI,+BAAkB,CAAC;YAC5B,OAAO,EAAE,IAAI,CAAC,GAAG;YACjB,WAAW,EAAE,UAAU,EAAE,+DAA+D;YACxF,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE,GAAS,EAAE,wDAAC,OAAA,IAAI,CAAC,OAAO,CAAA,GAAA;aACrC;YACD,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC,CAAA;IACJ,CAAC;CACF;AA5ZD,yCA4ZC"}
@@ -28,7 +28,7 @@ export default class StorageBucketApi {
28
28
  * @param options.sortColumn Column to sort by ('id', 'name', 'created_at', 'updated_at')
29
29
  * @param options.sortOrder Sort order ('asc' or 'desc')
30
30
  * @param options.search Search term to filter bucket names
31
- * @returns Promise with list of buckets or error
31
+ * @returns Promise with response containing array of buckets or error
32
32
  *
33
33
  * @example List buckets
34
34
  * ```js
@@ -62,7 +62,7 @@ export default class StorageBucketApi {
62
62
  *
63
63
  * @category File Buckets
64
64
  * @param id The unique identifier of the bucket you would like to retrieve.
65
- * @returns Promise with bucket details or error
65
+ * @returns Promise with response containing bucket details or error
66
66
  *
67
67
  * @example Get bucket
68
68
  * ```js
@@ -111,7 +111,7 @@ export default class StorageBucketApi {
111
111
  * Each mime type specified can be a wildcard, e.g. image/*, or a specific mime type, e.g. image/png.
112
112
  * @param options.type (private-beta) specifies the bucket type. see `BucketType` for more details.
113
113
  * - default bucket type is `STANDARD`
114
- * @returns Promise with newly created bucket id or error
114
+ * @returns Promise with response containing newly created bucket name or error
115
115
  *
116
116
  * @example Create bucket
117
117
  * ```js
@@ -158,7 +158,7 @@ export default class StorageBucketApi {
158
158
  * @param options.allowedMimeTypes specifies the allowed mime types that this bucket can accept during upload.
159
159
  * The default value is null, which allows files with all mime types to be uploaded.
160
160
  * Each mime type specified can be a wildcard, e.g. image/*, or a specific mime type, e.g. image/png.
161
- * @returns Promise with success message or error
161
+ * @returns Promise with response containing success message or error
162
162
  *
163
163
  * @example Update bucket
164
164
  * ```js
@@ -40,7 +40,7 @@ class StorageBucketApi {
40
40
  * @param options.sortColumn Column to sort by ('id', 'name', 'created_at', 'updated_at')
41
41
  * @param options.sortOrder Sort order ('asc' or 'desc')
42
42
  * @param options.search Search term to filter bucket names
43
- * @returns Promise with list of buckets or error
43
+ * @returns Promise with response containing array of buckets or error
44
44
  *
45
45
  * @example List buckets
46
46
  * ```js
@@ -87,7 +87,7 @@ class StorageBucketApi {
87
87
  *
88
88
  * @category File Buckets
89
89
  * @param id The unique identifier of the bucket you would like to retrieve.
90
- * @returns Promise with bucket details or error
90
+ * @returns Promise with response containing bucket details or error
91
91
  *
92
92
  * @example Get bucket
93
93
  * ```js
@@ -146,7 +146,7 @@ class StorageBucketApi {
146
146
  * Each mime type specified can be a wildcard, e.g. image/*, or a specific mime type, e.g. image/png.
147
147
  * @param options.type (private-beta) specifies the bucket type. see `BucketType` for more details.
148
148
  * - default bucket type is `STANDARD`
149
- * @returns Promise with newly created bucket id or error
149
+ * @returns Promise with response containing newly created bucket name or error
150
150
  *
151
151
  * @example Create bucket
152
152
  * ```js
@@ -207,7 +207,7 @@ class StorageBucketApi {
207
207
  * @param options.allowedMimeTypes specifies the allowed mime types that this bucket can accept during upload.
208
208
  * The default value is null, which allows files with all mime types to be uploaded.
209
209
  * Each mime type specified can be a wildcard, e.g. image/*, or a specific mime type, e.g. image/png.
210
- * @returns Promise with success message or error
210
+ * @returns Promise with response containing success message or error
211
211
  *
212
212
  * @example Update bucket
213
213
  * ```js
@@ -35,7 +35,7 @@ export default class StorageFileApi {
35
35
  * @param path The file path, including the file name. Should be of the format `folder/subfolder/filename.png`. The bucket must already exist before attempting to upload.
36
36
  * @param fileBody The body of the file to be stored in the bucket.
37
37
  * @param fileOptions Optional file upload options including cacheControl, contentType, upsert, and metadata.
38
- * @returns Promise with file path and id or error
38
+ * @returns Promise with response containing file path, id, and fullPath or error
39
39
  *
40
40
  * @example Upload file
41
41
  * ```js
@@ -91,7 +91,7 @@ export default class StorageFileApi {
91
91
  * @param token The token generated from `createSignedUploadUrl`
92
92
  * @param fileBody The body of the file to be stored in the bucket.
93
93
  * @param fileOptions Optional file upload options including cacheControl and contentType.
94
- * @returns Promise with file path and full path or error
94
+ * @returns Promise with response containing file path and fullPath or error
95
95
  *
96
96
  * @example Upload to a signed URL
97
97
  * ```js
@@ -130,7 +130,7 @@ export default class StorageFileApi {
130
130
  * @category File Buckets
131
131
  * @param path The file path, including the current file name. For example `folder/image.png`.
132
132
  * @param options.upsert If set to true, allows the file to be overwritten if it already exists.
133
- * @returns Promise with signed upload URL, token, and path or error
133
+ * @returns Promise with response containing signed upload URL, token, and path or error
134
134
  *
135
135
  * @example Create Signed Upload URL
136
136
  * ```js
@@ -172,7 +172,7 @@ export default class StorageFileApi {
172
172
  * @param path The relative file path. Should be of the format `folder/subfolder/filename.png`. The bucket must already exist before attempting to update.
173
173
  * @param fileBody The body of the file to be stored in the bucket.
174
174
  * @param fileOptions Optional file upload options including cacheControl, contentType, upsert, and metadata.
175
- * @returns Promise with file path and id or error
175
+ * @returns Promise with response containing file path, id, and fullPath or error
176
176
  *
177
177
  * @example Update file
178
178
  * ```js
@@ -227,7 +227,7 @@ export default class StorageFileApi {
227
227
  * @param fromPath The original file path, including the current file name. For example `folder/image.png`.
228
228
  * @param toPath The new file path, including the new file name. For example `folder/image-new.png`.
229
229
  * @param options The destination options.
230
- * @returns Promise with success message or error
230
+ * @returns Promise with response containing success message or error
231
231
  *
232
232
  * @example Move file
233
233
  * ```js
@@ -263,7 +263,7 @@ export default class StorageFileApi {
263
263
  * @param fromPath The original file path, including the current file name. For example `folder/image.png`.
264
264
  * @param toPath The new file path, including the new file name. For example `folder/image-copy.png`.
265
265
  * @param options The destination options.
266
- * @returns Promise with copied file path or error
266
+ * @returns Promise with response containing copied file path or error
267
267
  *
268
268
  * @example Copy file
269
269
  * ```js
@@ -300,7 +300,7 @@ export default class StorageFileApi {
300
300
  * @param expiresIn The number of seconds until the signed URL expires. For example, `60` for a URL which is valid for one minute.
301
301
  * @param options.download triggers the file as a download if set to true. Set this parameter as the name of the file if you want to trigger the download with a different filename.
302
302
  * @param options.transform Transform the asset before serving it to the client.
303
- * @returns Promise with signed URL or error
303
+ * @returns Promise with response containing signed URL or error
304
304
  *
305
305
  * @example Create Signed URL
306
306
  * ```js
@@ -362,7 +362,7 @@ export default class StorageFileApi {
362
362
  * @param paths The file paths to be downloaded, including the current file names. For example `['folder/image.png', 'folder2/image2.png']`.
363
363
  * @param expiresIn The number of seconds until the signed URLs expire. For example, `60` for URLs which are valid for one minute.
364
364
  * @param options.download triggers the file as a download if set to true. Set this parameter as the name of the file if you want to trigger the download with a different filename.
365
- * @returns Promise with array of signed URLs or error
365
+ * @returns Promise with response containing array of objects with signedUrl, path, and error or error
366
366
  *
367
367
  * @example Create Signed URLs
368
368
  * ```js
@@ -452,7 +452,7 @@ export default class StorageFileApi {
452
452
  *
453
453
  * @category File Buckets
454
454
  * @param path The file path, including the file name. For example `folder/image.png`.
455
- * @returns Promise with file metadata or error
455
+ * @returns Promise with response containing file metadata or error
456
456
  *
457
457
  * @example Get file info
458
458
  * ```js
@@ -474,7 +474,7 @@ export default class StorageFileApi {
474
474
  *
475
475
  * @category File Buckets
476
476
  * @param path The file path, including the file name. For example `folder/image.png`.
477
- * @returns Promise with boolean indicating file existence or error
477
+ * @returns Promise with response containing boolean indicating file existence or error
478
478
  *
479
479
  * @example Check file existence
480
480
  * ```js
@@ -554,7 +554,7 @@ export default class StorageFileApi {
554
554
  *
555
555
  * @category File Buckets
556
556
  * @param paths An array of files to delete, including the path and file name. For example [`'folder/image.png'`].
557
- * @returns Promise with list of deleted files or error
557
+ * @returns Promise with response containing array of deleted file objects or error
558
558
  *
559
559
  * @example Delete file
560
560
  * ```js
@@ -595,7 +595,7 @@ export default class StorageFileApi {
595
595
  * @param path The folder path.
596
596
  * @param options Search options including limit (defaults to 100), offset, sortBy, and search
597
597
  * @param parameters Optional fetch parameters including signal for cancellation
598
- * @returns Promise with list of files or error
598
+ * @returns Promise with response containing array of files or error
599
599
  *
600
600
  * @example List files in a bucket
601
601
  * ```js