diff --git a/src/internal/client.ts b/src/internal/client.ts index a8c132be..b0326a7e 100644 --- a/src/internal/client.ts +++ b/src/internal/client.ts @@ -986,7 +986,8 @@ export class TypedClient { await this.makeRequestAsyncOmit({ method, bucketName, query }, '', [200, 204], '') } - setBucketReplication(bucketName: string, replicationConfig: ReplicationConfigOpts, callback: NoResultCallback): void + setBucketReplication(bucketName: string, replicationConfig: ReplicationConfigOpts): void + async setBucketReplication(bucketName: string, replicationConfig: ReplicationConfigOpts): Promise async setBucketReplication(bucketName: string, replicationConfig: ReplicationConfigOpts) { if (!isValidBucketName(bucketName)) { throw new errors.InvalidBucketNameError('Invalid bucket name: ' + bucketName) @@ -1020,7 +1021,8 @@ export class TypedClient { await this.makeRequestAsyncOmit({ method, bucketName, query, headers }, payload) } - getBucketReplication(bucketName: string, callback: ResultCallback): void + getBucketReplication(bucketName: string): void + async getBucketReplication(bucketName: string): Promise async getBucketReplication(bucketName: string) { if (!isValidBucketName(bucketName)) { throw new errors.InvalidBucketNameError('Invalid bucket name: ' + bucketName) @@ -1071,12 +1073,7 @@ export class TypedClient { return parseObjectLegalHoldConfig(strRes) } - setObjectLegalHold( - bucketName: string, - objectName: string, - setOpts?: PutObjectLegalHoldOptions, - callback?: NoResultCallback, - ): void + setObjectLegalHold(bucketName: string, objectName: string, setOpts?: PutObjectLegalHoldOptions): void async setObjectLegalHold( bucketName: string, objectName: string, diff --git a/src/internal/type.ts b/src/internal/type.ts index 90c86792..6dbb5399 100644 --- a/src/internal/type.ts +++ b/src/internal/type.ts @@ -195,7 +195,9 @@ export type ResultCallback = (error: Error | null, result: T) => void export type GetObjectLegalHoldOptions = { versionId: string } - +/** + * @deprecated keep for backward compatible, use `LEGAL_HOLD_STATUS` instead + */ export type LegalHoldStatus = LEGAL_HOLD_STATUS export type PutObjectLegalHoldOptions = {