From 89ee124b71c2e0d01885b85671b1b21f8be7afff Mon Sep 17 00:00:00 2001 From: Vishwaraj Anand Date: Wed, 17 Apr 2024 13:11:58 +0000 Subject: [PATCH 1/3] fix: change copyoptions type --- src/file.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/file.ts b/src/file.ts index 8edb2c602..3525dfdea 100644 --- a/src/file.ts +++ b/src/file.ts @@ -361,7 +361,9 @@ export interface CopyOptions { contentType?: string; contentDisposition?: string; destinationKmsKeyName?: string; - metadata?: FileMetadata; + metadata?: { + [key: string]: string; + }; predefinedAcl?: string; token?: string; userProject?: string; From 458b3a4128f8e1e4c8901cbb96afc0961e1d02d4 Mon Sep 17 00:00:00 2001 From: Vishwaraj Anand Date: Fri, 19 Apr 2024 09:23:44 +0000 Subject: [PATCH 2/3] fix: added test --- test/file.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/file.ts b/test/file.ts index d0cc0c2ba..bd95ad26d 100644 --- a/test/file.ts +++ b/test/file.ts @@ -545,12 +545,17 @@ describe('File', () => { it('should accept an options object', done => { const newFile = new File(BUCKET, 'name'); + const METADATA = { + metadataKey: 'metadataValue', + }; const options = { option: true, + metadata: METADATA, }; file.request = (reqOpts: DecorateRequestOptions) => { assert.deepStrictEqual(reqOpts.json, options); + assert.strictEqual(reqOpts.json.metadata, METADATA); done(); }; From 6a4118be7a8f8b33ce6a88ce666e68c2561ddc93 Mon Sep 17 00:00:00 2001 From: Vishwaraj Anand Date: Sun, 21 Apr 2024 19:01:41 +0530 Subject: [PATCH 3/3] chore: address pr comments --- src/file.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/file.ts b/src/file.ts index f765a7296..e4438a7d8 100644 --- a/src/file.ts +++ b/src/file.ts @@ -362,7 +362,7 @@ export interface CopyOptions { contentDisposition?: string; destinationKmsKeyName?: string; metadata?: { - [key: string]: string; + [key: string]: string | boolean | number | null; }; predefinedAcl?: string; token?: string;