@google-cloud/storage
Advanced tools
Comparing version 6.2.3 to 6.3.0
@@ -241,2 +241,66 @@ /// <reference types="node" /> | ||
/** | ||
* @callback Crc32cGeneratorToStringCallback | ||
* A method returning the CRC32C as a base64-encoded string. | ||
* | ||
* @returns {string} | ||
* | ||
* @example | ||
* Hashing the string 'data' should return 'rth90Q==' | ||
* | ||
* ```js | ||
* const buffer = Buffer.from('data'); | ||
* crc32c.update(buffer); | ||
* crc32c.toString(); // 'rth90Q==' | ||
* ``` | ||
**/ | ||
/** | ||
* @callback Crc32cGeneratorValidateCallback | ||
* A method validating a base64-encoded CRC32C string. | ||
* | ||
* @param {string} [value] base64-encoded CRC32C string to validate | ||
* @returns {boolean} | ||
* | ||
* @example | ||
* Should return `true` if the value matches, `false` otherwise | ||
* | ||
* ```js | ||
* const buffer = Buffer.from('data'); | ||
* crc32c.update(buffer); | ||
* crc32c.validate('DkjKuA=='); // false | ||
* crc32c.validate('rth90Q=='); // true | ||
* ``` | ||
**/ | ||
/** | ||
* @callback Crc32cGeneratorUpdateCallback | ||
* A method for passing `Buffer`s for CRC32C generation. | ||
* | ||
* @param {Buffer} [data] data to update CRC32C value with | ||
* @returns {undefined} | ||
* | ||
* @example | ||
* Hashing buffers from 'some ' and 'text\n' | ||
* | ||
* ```js | ||
* const buffer1 = Buffer.from('some '); | ||
* crc32c.update(buffer1); | ||
* | ||
* const buffer2 = Buffer.from('text\n'); | ||
* crc32c.update(buffer2); | ||
* | ||
* crc32c.toString(); // 'DkjKuA==' | ||
* ``` | ||
**/ | ||
/** | ||
* @typedef {object} CRC32CValidator | ||
* @property {Crc32cGeneratorToStringCallback} | ||
* @property {Crc32cGeneratorValidateCallback} | ||
* @property {Crc32cGeneratorUpdateCallback} | ||
*/ | ||
/** | ||
* A function that generates a CRC32C Validator. Defaults to {@link CRC32C} | ||
* | ||
* @name Bucket#crc32cGenerator | ||
* @type {CRC32CValidator} | ||
*/ | ||
/** | ||
* Get and set IAM policies for your bucket. | ||
@@ -243,0 +307,0 @@ * |
@@ -35,3 +35,3 @@ /// <reference types="node" /> | ||
*/ | ||
validate: (o: string) => boolean; | ||
validate: (value: string) => boolean; | ||
/** | ||
@@ -53,3 +53,3 @@ * A method for passing `Buffer`s for CRC32C generation. | ||
*/ | ||
update: (b: Buffer) => void; | ||
update: (data: Buffer) => void; | ||
} | ||
@@ -56,0 +56,0 @@ /** A function that generates a CRC32C Validator */ |
@@ -166,3 +166,2 @@ /// <reference types="node" /> | ||
/** | ||
* @const {string} | ||
* @private | ||
@@ -328,2 +327,64 @@ */ | ||
/** | ||
* @callback Crc32cGeneratorToStringCallback | ||
* A method returning the CRC32C as a base64-encoded string. | ||
* | ||
* @returns {string} | ||
* | ||
* @example | ||
* Hashing the string 'data' should return 'rth90Q==' | ||
* | ||
* ```js | ||
* const buffer = Buffer.from('data'); | ||
* crc32c.update(buffer); | ||
* crc32c.toString(); // 'rth90Q==' | ||
* ``` | ||
**/ | ||
/** | ||
* @callback Crc32cGeneratorValidateCallback | ||
* A method validating a base64-encoded CRC32C string. | ||
* | ||
* @param {string} [value] base64-encoded CRC32C string to validate | ||
* @returns {boolean} | ||
* | ||
* @example | ||
* Should return `true` if the value matches, `false` otherwise | ||
* | ||
* ```js | ||
* const buffer = Buffer.from('data'); | ||
* crc32c.update(buffer); | ||
* crc32c.validate('DkjKuA=='); // false | ||
* crc32c.validate('rth90Q=='); // true | ||
* ``` | ||
**/ | ||
/** | ||
* @callback Crc32cGeneratorUpdateCallback | ||
* A method for passing `Buffer`s for CRC32C generation. | ||
* | ||
* @param {Buffer} [data] data to update CRC32C value with | ||
* @returns {undefined} | ||
* | ||
* @example | ||
* Hashing buffers from 'some ' and 'text\n' | ||
* | ||
* ```js | ||
* const buffer1 = Buffer.from('some '); | ||
* crc32c.update(buffer1); | ||
* | ||
* const buffer2 = Buffer.from('text\n'); | ||
* crc32c.update(buffer2); | ||
* | ||
* crc32c.toString(); // 'DkjKuA==' | ||
* ``` | ||
**/ | ||
/** | ||
* @typedef {object} CRC32CValidator | ||
* @property {Crc32cGeneratorToStringCallback} | ||
* @property {Crc32cGeneratorValidateCallback} | ||
* @property {Crc32cGeneratorUpdateCallback} | ||
*/ | ||
/** | ||
* @callback Crc32cGeneratorCallback | ||
* @returns {CRC32CValidator} | ||
*/ | ||
/** | ||
* @typedef {object} FileOptions Options passed to the File constructor. | ||
@@ -337,2 +398,3 @@ * @property {string} [encryptionKey] A custom encryption key. | ||
* billed for all requests made from File object. | ||
* @property {Crc32cGeneratorCallback} [callback] A function that generates a CRC32C Validator. Defaults to {@link CRC32C} | ||
*/ | ||
@@ -339,0 +401,0 @@ /** |
@@ -67,2 +67,9 @@ /// <reference types="node" /> | ||
} | ||
/** | ||
* Custom placement configuration. | ||
* Initially used for dual-region buckets. | ||
**/ | ||
export interface CustomPlacementConfig { | ||
dataLocations?: string[]; | ||
} | ||
export interface CreateBucketRequest { | ||
@@ -72,2 +79,3 @@ archive?: boolean; | ||
cors?: Cors[]; | ||
customPlacementConfig?: CustomPlacementConfig; | ||
dra?: boolean; | ||
@@ -369,2 +377,64 @@ location?: string; | ||
/** | ||
* @callback Crc32cGeneratorToStringCallback | ||
* A method returning the CRC32C as a base64-encoded string. | ||
* | ||
* @returns {string} | ||
* | ||
* @example | ||
* Hashing the string 'data' should return 'rth90Q==' | ||
* | ||
* ```js | ||
* const buffer = Buffer.from('data'); | ||
* crc32c.update(buffer); | ||
* crc32c.toString(); // 'rth90Q==' | ||
* ``` | ||
**/ | ||
/** | ||
* @callback Crc32cGeneratorValidateCallback | ||
* A method validating a base64-encoded CRC32C string. | ||
* | ||
* @param {string} [value] base64-encoded CRC32C string to validate | ||
* @returns {boolean} | ||
* | ||
* @example | ||
* Should return `true` if the value matches, `false` otherwise | ||
* | ||
* ```js | ||
* const buffer = Buffer.from('data'); | ||
* crc32c.update(buffer); | ||
* crc32c.validate('DkjKuA=='); // false | ||
* crc32c.validate('rth90Q=='); // true | ||
* ``` | ||
**/ | ||
/** | ||
* @callback Crc32cGeneratorUpdateCallback | ||
* A method for passing `Buffer`s for CRC32C generation. | ||
* | ||
* @param {Buffer} [data] data to update CRC32C value with | ||
* @returns {undefined} | ||
* | ||
* @example | ||
* Hashing buffers from 'some ' and 'text\n' | ||
* | ||
* ```js | ||
* const buffer1 = Buffer.from('some '); | ||
* crc32c.update(buffer1); | ||
* | ||
* const buffer2 = Buffer.from('text\n'); | ||
* crc32c.update(buffer2); | ||
* | ||
* crc32c.toString(); // 'DkjKuA==' | ||
* ``` | ||
**/ | ||
/** | ||
* @typedef {object} CRC32CValidator | ||
* @property {Crc32cGeneratorToStringCallback} | ||
* @property {Crc32cGeneratorValidateCallback} | ||
* @property {Crc32cGeneratorUpdateCallback} | ||
*/ | ||
/** | ||
* @callback Crc32cGeneratorCallback | ||
* @returns {CRC32CValidator} | ||
*/ | ||
/** | ||
* @typedef {object} StorageOptions | ||
@@ -419,2 +489,3 @@ * @property {string} [projectId] The project ID from the Google Developer's | ||
* @property {boolean} [useAuthWithCustomEndpoint = false] Controls whether or not to use authentication when using a custom endpoint. | ||
* @property {Crc32cGeneratorCallback} [callback] A function that generates a CRC32C Validator. Defaults to {@link CRC32C} | ||
*/ | ||
@@ -421,0 +492,0 @@ /** |
@@ -254,2 +254,64 @@ "use strict"; | ||
/** | ||
* @callback Crc32cGeneratorToStringCallback | ||
* A method returning the CRC32C as a base64-encoded string. | ||
* | ||
* @returns {string} | ||
* | ||
* @example | ||
* Hashing the string 'data' should return 'rth90Q==' | ||
* | ||
* ```js | ||
* const buffer = Buffer.from('data'); | ||
* crc32c.update(buffer); | ||
* crc32c.toString(); // 'rth90Q==' | ||
* ``` | ||
**/ | ||
/** | ||
* @callback Crc32cGeneratorValidateCallback | ||
* A method validating a base64-encoded CRC32C string. | ||
* | ||
* @param {string} [value] base64-encoded CRC32C string to validate | ||
* @returns {boolean} | ||
* | ||
* @example | ||
* Should return `true` if the value matches, `false` otherwise | ||
* | ||
* ```js | ||
* const buffer = Buffer.from('data'); | ||
* crc32c.update(buffer); | ||
* crc32c.validate('DkjKuA=='); // false | ||
* crc32c.validate('rth90Q=='); // true | ||
* ``` | ||
**/ | ||
/** | ||
* @callback Crc32cGeneratorUpdateCallback | ||
* A method for passing `Buffer`s for CRC32C generation. | ||
* | ||
* @param {Buffer} [data] data to update CRC32C value with | ||
* @returns {undefined} | ||
* | ||
* @example | ||
* Hashing buffers from 'some ' and 'text\n' | ||
* | ||
* ```js | ||
* const buffer1 = Buffer.from('some '); | ||
* crc32c.update(buffer1); | ||
* | ||
* const buffer2 = Buffer.from('text\n'); | ||
* crc32c.update(buffer2); | ||
* | ||
* crc32c.toString(); // 'DkjKuA==' | ||
* ``` | ||
**/ | ||
/** | ||
* @typedef {object} CRC32CValidator | ||
* @property {Crc32cGeneratorToStringCallback} | ||
* @property {Crc32cGeneratorValidateCallback} | ||
* @property {Crc32cGeneratorUpdateCallback} | ||
*/ | ||
/** | ||
* @callback Crc32cGeneratorCallback | ||
* @returns {CRC32CValidator} | ||
*/ | ||
/** | ||
* @typedef {object} StorageOptions | ||
@@ -304,2 +366,3 @@ * @property {string} [projectId] The project ID from the Google Developer's | ||
* @property {boolean} [useAuthWithCustomEndpoint = false] Controls whether or not to use authentication when using a custom endpoint. | ||
* @property {Crc32cGeneratorCallback} [callback] A function that generates a CRC32C Validator. Defaults to {@link CRC32C} | ||
*/ | ||
@@ -485,6 +548,8 @@ /** | ||
* @property {Cors[]} [cors=[]] Specify the CORS configuration to use. | ||
* @property {CustomPlacementConfig} [customPlacementConfig={}] Specify the bucket's regions for dual-region buckets. | ||
* For more information, see {@link https://cloud.google.com/storage/docs/locations| Bucket Locations}. | ||
* @property {boolean} [dra=false] Specify the storage class as Durable Reduced | ||
* Availability. | ||
* @property {string} [location] Specify the bucket's location(s). If specifying | ||
* a dual-region, can be specified as a string `"US-CENTRAL1+US-WEST1"`. | ||
* @property {string} [location] Specify the bucket's location. If specifying | ||
* a dual-region, the `customPlacementConfig` property should be set in conjunction. | ||
* For more information, see {@link https://cloud.google.com/storage/docs/locations| Bucket Locations}. | ||
@@ -598,3 +663,6 @@ * @property {boolean} [multiRegional=false] Specify the storage class as | ||
} | ||
const body = Object.assign({}, metadata, { name }); | ||
const body = { | ||
...metadata, | ||
name, | ||
}; | ||
const storageClasses = { | ||
@@ -609,3 +677,4 @@ archive: 'ARCHIVE', | ||
}; | ||
Object.keys(storageClasses).forEach(storageClass => { | ||
const storageClassKeys = Object.keys(storageClasses); | ||
for (const storageClass of storageClassKeys) { | ||
if (body[storageClass]) { | ||
@@ -618,3 +687,3 @@ if (metadata.storageClass && metadata.storageClass !== storageClass) { | ||
} | ||
}); | ||
} | ||
if (body.requesterPays) { | ||
@@ -621,0 +690,0 @@ body.billing = { |
{ | ||
"name": "@google-cloud/storage", | ||
"description": "Cloud Storage Client Library for Node.js", | ||
"version": "6.2.3", | ||
"version": "6.3.0", | ||
"license": "Apache-2.0", | ||
@@ -77,3 +77,3 @@ "author": "Google Inc.", | ||
"@grpc/grpc-js": "^1.0.3", | ||
"@grpc/proto-loader": "^0.6.0", | ||
"@grpc/proto-loader": "^0.7.0", | ||
"@types/async-retry": "^1.4.3", | ||
@@ -80,0 +80,0 @@ "@types/compressible": "^2.0.0", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
788201
16002