@@ -166,19 +166,19 @@ export class StorageApi {
166
166
/**
167
167
* Renames an existing file.
168
168
*
169
- * @param bucketName The bucket which contains the file.
169
+ * @param bucketId The bucket which contains the file.
170
170
* @param fromPath The original file path, including the current file name. For example `folder/image.png`.
171
171
* @param toPath The new file path, including the new file name. For example `folder/image-copy.png`.
172
172
*/
173
173
async renameFile (
174
- bucketName : string ,
174
+ bucketId : string ,
175
175
fromPath : string ,
176
176
toPath : string
177
177
) : Promise < { data : { message : string } | null ; error : Error | null } > {
178
178
try {
179
179
const data = await post (
180
180
`${ this . url } /object/rename` ,
181
- { bucketName , sourceKey : fromPath , destinationKey : toPath } ,
181
+ { bucketId , sourceKey : fromPath , destinationKey : toPath } ,
182
182
{ headers : this . headers }
183
183
)
184
184
return { data, error : null }
@@ -246,16 +246,16 @@ export class StorageApi {
246
246
/**
247
247
* Deletes multiple files within the same bucket
248
248
*
249
- * @param bucketName The bucket which contains the files.
249
+ * @param bucketId The bucket which contains the files.
250
250
* @param paths An array of files to be deletes, including the path and file name. For example [`folder/image.png`].
251
251
*/
252
252
async deleteFiles (
253
- bucketName : string ,
253
+ bucketId : string ,
254
254
paths : string [ ]
255
255
) : Promise < { data : FileObject [ ] | null ; error : Error | null } > {
256
256
try {
257
257
const data = await remove (
258
- `${ this . url } /object/${ bucketName } ` ,
258
+ `${ this . url } /object/${ bucketId } ` ,
259
259
{ prefixes : paths } ,
260
260
{ headers : this . headers }
261
261
)
@@ -297,18 +297,18 @@ export class StorageApi {
297
297
298
298
/**
299
299
* Lists all the files within a bucket.
300
- * @param bucketName The bucket which contains the files.
300
+ * @param bucketId The bucket which contains the files.
301
301
* @param path The folder path.
302
302
* @param options Search options.
303
303
*/
304
304
async listFiles (
305
- bucketName : string ,
305
+ bucketId : string ,
306
306
path ?: string ,
307
307
options ?: SearchOptions
308
308
) : Promise < { data : FileObject [ ] | null ; error : Error | null } > {
309
309
try {
310
310
const body = { ...DEFAULT_SEARCH_OPTIONS , ...options , prefix : path || '' }
311
- const data = await post ( `${ this . url } /search/${ bucketName } ` , body , { headers : this . headers } )
311
+ const data = await post ( `${ this . url } /search/${ bucketId } ` , body , { headers : this . headers } )
312
312
return { data, error : null }
313
313
} catch ( error ) {
314
314
return { data : null , error }
0 commit comments