@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,8 +1,9 @@
1
1
  import { __awaiter } from "tslib";
2
+ import { IcebergRestCatalog } from 'iceberg-js';
2
3
  import { DEFAULT_HEADERS } from '../lib/constants';
3
- import { isStorageError } from '../lib/errors';
4
+ import { isStorageError, StorageError } from '../lib/errors';
4
5
  import { get, post, remove } from '../lib/fetch';
5
- import { resolveFetch } from '../lib/helpers';
6
+ import { isValidBucketName, resolveFetch } from '../lib/helpers';
6
7
  /**
7
8
  * Client class for managing Analytics Buckets using Iceberg tables
8
9
  * Provides methods for creating, listing, and deleting analytics buckets
@@ -56,7 +57,7 @@ export default class StorageAnalyticsClient {
56
57
  *
57
58
  * @category Analytics Buckets
58
59
  * @param name A unique name for the bucket you are creating
59
- * @returns Promise with newly created bucket name or error
60
+ * @returns Promise with response containing newly created analytics bucket or error
60
61
  *
61
62
  * @example Create analytics bucket
62
63
  * ```js
@@ -109,10 +110,10 @@ export default class StorageAnalyticsClient {
109
110
  * @param options Query parameters for listing buckets
110
111
  * @param options.limit Maximum number of buckets to return
111
112
  * @param options.offset Number of buckets to skip
112
- * @param options.sortColumn Column to sort by ('id', 'name', 'created_at', 'updated_at')
113
+ * @param options.sortColumn Column to sort by ('name', 'created_at', 'updated_at')
113
114
  * @param options.sortOrder Sort order ('asc' or 'desc')
114
115
  * @param options.search Search term to filter bucket names
115
- * @returns Promise with list of analytics buckets or error
116
+ * @returns Promise with response containing array of analytics buckets or error
116
117
  *
117
118
  * @example List analytics buckets
118
119
  * ```js
@@ -185,7 +186,7 @@ export default class StorageAnalyticsClient {
185
186
  *
186
187
  * @category Analytics Buckets
187
188
  * @param bucketName The unique identifier of the bucket you would like to delete
188
- * @returns Promise with success message or error
189
+ * @returns Promise with response containing success message or error
189
190
  *
190
191
  * @example Delete analytics bucket
191
192
  * ```js
@@ -222,5 +223,160 @@ export default class StorageAnalyticsClient {
222
223
  }
223
224
  });
224
225
  }
226
+ /**
227
+ * @alpha
228
+ *
229
+ * Get an Iceberg REST Catalog client configured for a specific analytics bucket
230
+ * Use this to perform advanced table and namespace operations within the bucket
231
+ * The returned client provides full access to the Apache Iceberg REST Catalog API
232
+ *
233
+ * **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
234
+ *
235
+ * @category Analytics Buckets
236
+ * @param bucketName - The name of the analytics bucket (warehouse) to connect to
237
+ * @returns Configured IcebergRestCatalog instance for advanced Iceberg operations
238
+ *
239
+ * @example Get catalog and create table
240
+ * ```js
241
+ * // First, create an analytics bucket
242
+ * const { data: bucket, error: bucketError } = await supabase
243
+ * .storage
244
+ * .analytics
245
+ * .createBucket('analytics-data')
246
+ *
247
+ * // Get the Iceberg catalog for that bucket
248
+ * const catalog = supabase.storage.analytics.from('analytics-data')
249
+ *
250
+ * // Create a namespace
251
+ * await catalog.createNamespace({ namespace: ['default'] })
252
+ *
253
+ * // Create a table with schema
254
+ * await catalog.createTable(
255
+ * { namespace: ['default'] },
256
+ * {
257
+ * name: 'events',
258
+ * schema: {
259
+ * type: 'struct',
260
+ * fields: [
261
+ * { id: 1, name: 'id', type: 'long', required: true },
262
+ * { id: 2, name: 'timestamp', type: 'timestamp', required: true },
263
+ * { id: 3, name: 'user_id', type: 'string', required: false }
264
+ * ],
265
+ * 'schema-id': 0,
266
+ * 'identifier-field-ids': [1]
267
+ * },
268
+ * 'partition-spec': {
269
+ * 'spec-id': 0,
270
+ * fields: []
271
+ * },
272
+ * 'write-order': {
273
+ * 'order-id': 0,
274
+ * fields: []
275
+ * },
276
+ * properties: {
277
+ * 'write.format.default': 'parquet'
278
+ * }
279
+ * }
280
+ * )
281
+ * ```
282
+ *
283
+ * @example List tables in namespace
284
+ * ```js
285
+ * const catalog = supabase.storage.analytics.from('analytics-data')
286
+ *
287
+ * // List all tables in the default namespace
288
+ * const tables = await catalog.listTables({ namespace: ['default'] })
289
+ * console.log(tables) // [{ namespace: ['default'], name: 'events' }]
290
+ * ```
291
+ *
292
+ * @example Working with namespaces
293
+ * ```js
294
+ * const catalog = supabase.storage.analytics.from('analytics-data')
295
+ *
296
+ * // List all namespaces
297
+ * const namespaces = await catalog.listNamespaces()
298
+ *
299
+ * // Create namespace with properties
300
+ * await catalog.createNamespace(
301
+ * { namespace: ['production'] },
302
+ * { properties: { owner: 'data-team', env: 'prod' } }
303
+ * )
304
+ * ```
305
+ *
306
+ * @example Cleanup operations
307
+ * ```js
308
+ * const catalog = supabase.storage.analytics.from('analytics-data')
309
+ *
310
+ * // Drop table with purge option (removes all data)
311
+ * await catalog.dropTable(
312
+ * { namespace: ['default'], name: 'events' },
313
+ * { purge: true }
314
+ * )
315
+ *
316
+ * // Drop namespace (must be empty)
317
+ * await catalog.dropNamespace({ namespace: ['default'] })
318
+ * ```
319
+ *
320
+ * @example Error handling with catalog operations
321
+ * ```js
322
+ * import { IcebergError } from 'iceberg-js'
323
+ *
324
+ * const catalog = supabase.storage.analytics.from('analytics-data')
325
+ *
326
+ * try {
327
+ * await catalog.dropTable({ namespace: ['default'], name: 'events' }, { purge: true })
328
+ * } catch (error) {
329
+ * // Handle 404 errors (resource not found)
330
+ * const is404 =
331
+ * (error instanceof IcebergError && error.status === 404) ||
332
+ * error?.status === 404 ||
333
+ * error?.details?.error?.code === 404
334
+ *
335
+ * if (is404) {
336
+ * console.log('Table does not exist')
337
+ * } else {
338
+ * throw error // Re-throw other errors
339
+ * }
340
+ * }
341
+ * ```
342
+ *
343
+ * @remarks
344
+ * This method provides a bridge between Supabase's bucket management and the standard
345
+ * Apache Iceberg REST Catalog API. The bucket name maps to the Iceberg warehouse parameter.
346
+ * All authentication and configuration is handled automatically using your Supabase credentials.
347
+ *
348
+ * **Error Handling**: Operations may throw `IcebergError` from the iceberg-js library.
349
+ * Always handle 404 errors gracefully when checking for resource existence.
350
+ *
351
+ * **Cleanup Operations**: When using `dropTable`, the `purge: true` option permanently
352
+ * deletes all table data. Without it, the table is marked as deleted but data remains.
353
+ *
354
+ * **Library Dependency**: The returned catalog is an instance of `IcebergRestCatalog`
355
+ * from iceberg-js. For complete API documentation and advanced usage, refer to the
356
+ * [iceberg-js documentation](https://supabase.github.io/iceberg-js/).
357
+ *
358
+ * For advanced Iceberg operations beyond bucket management, you can also install and use
359
+ * the `iceberg-js` package directly with manual configuration.
360
+ */
361
+ from(bucketName) {
362
+ // Validate bucket name using same rules as Supabase Storage API backend
363
+ if (!isValidBucketName(bucketName)) {
364
+ throw new StorageError('Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines ' +
365
+ 'and should avoid the use of any other characters.');
366
+ }
367
+ // Construct the Iceberg REST Catalog URL
368
+ // The base URL is /storage/v1/iceberg
369
+ // Note: IcebergRestCatalog from iceberg-js automatically adds /v1/ prefix to API paths
370
+ // so we should NOT append /v1 here (it would cause double /v1/v1/ in the URL)
371
+ return new IcebergRestCatalog({
372
+ baseUrl: this.url,
373
+ catalogName: bucketName, // Maps to the warehouse parameter in Supabase's implementation
374
+ auth: {
375
+ type: 'custom',
376
+ getHeaders: () => __awaiter(this, void 0, void 0, function* () { return this.headers; }),
377
+ },
378
+ fetch: this.fetch,
379
+ });
380
+ }
225
381
  }
226
382
  //# sourceMappingURL=StorageAnalyticsClient.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StorageAnalyticsClient.js","sourceRoot":"","sources":["../../../src/packages/StorageAnalyticsClient.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,cAAc,EAAgB,MAAM,eAAe,CAAA;AAC5D,OAAO,EAAS,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAG7C;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,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,eAAe,GAAK,OAAO,CAAE,CAAA;QACjD,IAAI,CAAC,KAAK,GAAG,YAAY,CAAC,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,IAA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AClC,EAAE,EACF,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAC1B,CAAA;gBACD,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAA;YAC9B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC;oBAC5B,MAAM,KAAK,CAAA;gBACb,CAAC;gBACD,IAAI,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;oBAC1B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAA;gBAC9B,CAAC;gBAED,MAAM,KAAK,CAAA;YACb,CAAC;QACH,CAAC;KAAA;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsIG;IACH,IAAI,CAAC,UAAkB;QACrB,wEAAwE;QACxE,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,EAAE,CAAC;YACnC,MAAM,IAAI,YAAY,CACpB,mGAAmG;gBACjG,mDAAmD,CACtD,CAAA;QACH,CAAC;QAED,yCAAyC;QACzC,sCAAsC;QACtC,uFAAuF;QACvF,8EAA8E;QAC9E,OAAO,IAAI,kBAAkB,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,gDAAC,OAAA,IAAI,CAAC,OAAO,CAAA,GAAA;aACrC;YACD,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC,CAAA;IACJ,CAAC;CACF"}
@@ -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
@@ -38,7 +38,7 @@ export default class StorageBucketApi {
38
38
  * @param options.sortColumn Column to sort by ('id', 'name', 'created_at', 'updated_at')
39
39
  * @param options.sortOrder Sort order ('asc' or 'desc')
40
40
  * @param options.search Search term to filter bucket names
41
- * @returns Promise with list of buckets or error
41
+ * @returns Promise with response containing array of buckets or error
42
42
  *
43
43
  * @example List buckets
44
44
  * ```js
@@ -85,7 +85,7 @@ export default class StorageBucketApi {
85
85
  *
86
86
  * @category File Buckets
87
87
  * @param id The unique identifier of the bucket you would like to retrieve.
88
- * @returns Promise with bucket details or error
88
+ * @returns Promise with response containing bucket details or error
89
89
  *
90
90
  * @example Get bucket
91
91
  * ```js
@@ -144,7 +144,7 @@ export default class StorageBucketApi {
144
144
  * Each mime type specified can be a wildcard, e.g. image/*, or a specific mime type, e.g. image/png.
145
145
  * @param options.type (private-beta) specifies the bucket type. see `BucketType` for more details.
146
146
  * - default bucket type is `STANDARD`
147
- * @returns Promise with newly created bucket id or error
147
+ * @returns Promise with response containing newly created bucket name or error
148
148
  *
149
149
  * @example Create bucket
150
150
  * ```js
@@ -205,7 +205,7 @@ export default class StorageBucketApi {
205
205
  * @param options.allowedMimeTypes specifies the allowed mime types that this bucket can accept during upload.
206
206
  * The default value is null, which allows files with all mime types to be uploaded.
207
207
  * Each mime type specified can be a wildcard, e.g. image/*, or a specific mime type, e.g. image/png.
208
- * @returns Promise with success message or error
208
+ * @returns Promise with response containing success message or error
209
209
  *
210
210
  * @example Update bucket
211
211
  * ```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