@@ -2,7 +2,7 @@ import { DEFAULT_HEADERS } from '../lib/constants'
22import { isStorageError , StorageError } from '../lib/errors'
33import { Fetch , get , post , put , remove } from '../lib/fetch'
44import { resolveFetch } from '../lib/helpers'
5- import { Bucket } from '../lib/types'
5+ import { Bucket , BucketType } from '../lib/types'
66
77export default class StorageBucketApi {
88 protected url : string
@@ -96,15 +96,16 @@ export default class StorageBucketApi {
9696 * The default value is null, which allows files with all mime types to be uploaded.
9797 * Each mime type specified can be a wildcard, e.g. image/*, or a specific mime type, e.g. image/png.
9898 * @returns newly created bucket id
99- * @param options.icebergCatalog (private-beta) specifies whether this bucket can be used as an Iceberg data lake.
99+ * @param options.type (private-beta) specifies the bucket type. see `BucketType` for more details.
100+ * - default bucket type is `STANDARD`
100101 */
101102 async createBucket (
102103 id : string ,
103104 options : {
104105 public : boolean
105106 fileSizeLimit ?: number | string | null
106107 allowedMimeTypes ?: string [ ] | null
107- icebergCatalog ?: boolean | null
108+ type ?: BucketType
108109 } = {
109110 public : false ,
110111 }
@@ -125,10 +126,10 @@ export default class StorageBucketApi {
125126 {
126127 id,
127128 name : id ,
129+ type : options . type ,
128130 public : options . public ,
129131 file_size_limit : options . fileSizeLimit ,
130132 allowed_mime_types : options . allowedMimeTypes ,
131- iceberg_catalog : options . icebergCatalog ,
132133 } ,
133134 { headers : this . headers }
134135 )
@@ -153,15 +154,13 @@ export default class StorageBucketApi {
153154 * @param options.allowedMimeTypes specifies the allowed mime types that this bucket can accept during upload.
154155 * The default value is null, which allows files with all mime types to be uploaded.
155156 * Each mime type specified can be a wildcard, e.g. image/*, or a specific mime type, e.g. image/png.
156- * @param options.icebergCatalog (private-beta) specifies whether this bucket can be used as an Iceberg data lake.
157157 */
158158 async updateBucket (
159159 id : string ,
160160 options : {
161161 public : boolean
162162 fileSizeLimit ?: number | string | null
163163 allowedMimeTypes ?: string [ ] | null
164- icebergCatalog ?: boolean | null
165164 }
166165 ) : Promise <
167166 | {
@@ -183,7 +182,6 @@ export default class StorageBucketApi {
183182 public : options . public ,
184183 file_size_limit : options . fileSizeLimit ,
185184 allowed_mime_types : options . allowedMimeTypes ,
186- iceberg_catalog : options . icebergCatalog ,
187185 } ,
188186 { headers : this . headers }
189187 )
0 commit comments