Skip to content

Commit

Permalink
fix: allow null on bucket constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
fenos committed Apr 11, 2023
1 parent 88928fd commit a6beed6
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/packages/StorageBucketApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,17 @@ export default class StorageBucketApi {
*
* @param id A unique identifier for the bucket you are creating.
* @param options.public The visibility of the bucket. Public buckets don't require an authorization token to download objects, but still require a valid token for all other operations. By default, buckets are private.
* @param options.fileSizeLimit specifies the file size limit that this bucket can accept during upload
* @param options.allowedMimeTypes specifies the allowed mime types that this bucket can accept during upload
* @param options.fileSizeLimit specifies the file size limit that this bucket can accept during upload, pass null to remove the constraint
* @param options.allowedMimeTypes specifies the allowed mime types that this bucket can accept during upload, pass null to remove the constraint
* @returns newly created bucket id
*/
async createBucket(
id: string,
options: { public: boolean; fileSizeLimit?: number | string; allowedMimeTypes?: string[] } = {
options: {
public: boolean
fileSizeLimit?: number | string | null
allowedMimeTypes?: string[] | null
} = {
public: false,
}
): Promise<
Expand Down Expand Up @@ -121,12 +125,16 @@ export default class StorageBucketApi {
*
* @param id A unique identifier for the bucket you are updating.
* @param options.public The visibility of the bucket. Public buckets don't require an authorization token to download objects, but still require a valid token for all other operations.
* @param options.fileSizeLimit specifies the file size limit that this bucket can accept during upload
* @param options.allowedMimeTypes specifies the allowed mime types that this bucket can accept during upload
* @param options.fileSizeLimit specifies the file size limit that this bucket can accept during upload, pass null to remove the constraint
* @param options.allowedMimeTypes specifies the allowed mime types that this bucket can accept during upload, pass null to remove the constraint
*/
async updateBucket(
id: string,
options: { public: boolean; fileSizeLimit?: number | string; allowedMimeTypes?: string[] }
options: {
public: boolean
fileSizeLimit?: number | string | null
allowedMimeTypes?: string[] | null
}
): Promise<
| {
data: { message: string }
Expand Down

0 comments on commit a6beed6

Please sign in to comment.