diff --git a/CHANGELOG.md b/CHANGELOG.md index 9207ee3a7..920e2a56d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ [1]: https://www.npmjs.com/package/@google-cloud/storage?activeTab=versions +## [7.10.1](https://github.com/googleapis/nodejs-storage/compare/v7.10.0...v7.10.1) (2024-04-22) + + +### Bug Fixes + +* Change copyoptions type ([#2439](https://github.com/googleapis/nodejs-storage/issues/2439)) ([2ebd7ac](https://github.com/googleapis/nodejs-storage/commit/2ebd7aca6c474147e5a1d1fb2a96b7d052a08a21)) +* Expand types of custom metadata within FileMetadata ([#2442](https://github.com/googleapis/nodejs-storage/issues/2442)) ([1d434a9](https://github.com/googleapis/nodejs-storage/commit/1d434a905392b00bb48ebbb812034e062ed27dd2)) + ## [7.10.0](https://github.com/googleapis/nodejs-storage/compare/v7.9.0...v7.10.0) (2024-04-15) diff --git a/package.json b/package.json index d21deaf1a..fd23f6f93 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/storage", "description": "Cloud Storage Client Library for Node.js", - "version": "7.10.0", + "version": "7.10.1", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/samples/package.json b/samples/package.json index 018c785b7..edf1724aa 100644 --- a/samples/package.json +++ b/samples/package.json @@ -17,7 +17,7 @@ }, "dependencies": { "@google-cloud/pubsub": "^4.0.0", - "@google-cloud/storage": "^7.10.0", + "@google-cloud/storage": "^7.10.1", "node-fetch": "^2.6.7", "uuid": "^8.0.0", "yargs": "^16.0.0" diff --git a/src/file.ts b/src/file.ts index 8edb2c602..e4438a7d8 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 | boolean | number | null; + }; predefinedAcl?: string; token?: string; userProject?: string; @@ -470,7 +472,7 @@ export interface FileMetadata extends BaseMetadata { md5Hash?: string; mediaLink?: string; metadata?: { - [key: string]: string; + [key: string]: string | boolean | number | null; }; metageneration?: string | number; name?: string; 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(); };