@hiiretail/gcp-infra-generators 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. package/dist/generators/common-resources/monitoring/templates/alerts/generic-infra.yaml +37 -2
  2. package/dist/node_modules/.package-lock.json +40 -41
  3. package/dist/node_modules/@google-cloud/storage/build/cjs/src/bucket.js +5 -5
  4. package/dist/node_modules/@google-cloud/storage/build/cjs/src/file.d.ts +1 -0
  5. package/dist/node_modules/@google-cloud/storage/build/cjs/src/file.js +10 -1
  6. package/dist/node_modules/@google-cloud/storage/build/cjs/src/storage.js +1 -1
  7. package/dist/node_modules/@google-cloud/storage/build/cjs/src/transfer-manager.d.ts +4 -4
  8. package/dist/node_modules/@google-cloud/storage/build/cjs/src/transfer-manager.js +4 -4
  9. package/dist/node_modules/@google-cloud/storage/build/cjs/src/util.d.ts +1 -1
  10. package/dist/node_modules/@google-cloud/storage/build/cjs/src/util.js +2 -2
  11. package/dist/node_modules/@google-cloud/storage/build/esm/src/bucket.js +5 -5
  12. package/dist/node_modules/@google-cloud/storage/build/esm/src/file.d.ts +1 -0
  13. package/dist/node_modules/@google-cloud/storage/build/esm/src/file.js +10 -1
  14. package/dist/node_modules/@google-cloud/storage/build/esm/src/storage.js +1 -1
  15. package/dist/node_modules/@google-cloud/storage/build/esm/src/transfer-manager.d.ts +4 -4
  16. package/dist/node_modules/@google-cloud/storage/build/esm/src/transfer-manager.js +4 -4
  17. package/dist/node_modules/@google-cloud/storage/build/esm/src/util.d.ts +1 -1
  18. package/dist/node_modules/@google-cloud/storage/build/esm/src/util.js +2 -2
  19. package/dist/node_modules/@google-cloud/storage/package.json +5 -5
  20. package/dist/package.json +2 -2
  21. package/package.json +2 -2
  22. package/dist/node_modules/@google-cloud/storage/CHANGELOG.md +0 -1769
@@ -217,6 +217,7 @@ export type DownloadResponse = [Buffer];
217
217
  export type DownloadCallback = (err: RequestError | null, contents: Buffer) => void;
218
218
  export interface DownloadOptions extends CreateReadStreamOptions {
219
219
  destination?: string;
220
+ encryptionKey?: string | Buffer;
220
221
  }
221
222
  export interface CreateReadStreamOptions {
222
223
  userProject?: string;
@@ -1467,6 +1467,9 @@ class File extends ServiceObject {
1467
1467
  transformStreams.push(zlib.createGzip());
1468
1468
  }
1469
1469
  const emitStream = new PassThroughShim();
1470
+ // If `writeStream` is destroyed before the `writing` event, `emitStream` will not have any listeners. This prevents an unhandled error.
1471
+ const noop = () => { };
1472
+ emitStream.on('error', noop);
1470
1473
  let hashCalculatingStream = null;
1471
1474
  if (crc32c || md5) {
1472
1475
  const crc32cInstance = options.resumeCRC32C
@@ -1499,6 +1502,8 @@ class File extends ServiceObject {
1499
1502
  else {
1500
1503
  this.startResumableUpload_(fileWriteStream, options);
1501
1504
  }
1505
+ // remove temporary noop listener as we now create a pipeline that handles the errors
1506
+ emitStream.removeListener('error', noop);
1502
1507
  pipeline(emitStream, ...transformStreams, fileWriteStream, async (e) => {
1503
1508
  if (e) {
1504
1509
  return pipelineCallback(e);
@@ -1633,6 +1638,10 @@ class File extends ServiceObject {
1633
1638
  });
1634
1639
  const destination = options.destination;
1635
1640
  delete options.destination;
1641
+ if (options.encryptionKey) {
1642
+ this.setEncryptionKey(options.encryptionKey);
1643
+ delete options.encryptionKey;
1644
+ }
1636
1645
  const fileStream = this.createReadStream(options);
1637
1646
  let receivedData = false;
1638
1647
  if (destination) {
@@ -2186,7 +2195,7 @@ class File extends ServiceObject {
2186
2195
  * @param {boolean} [config.virtualHostedStyle=false] Use virtual hosted-style
2187
2196
  * URLs (e.g. 'https://mybucket.storage.googleapis.com/...') instead of path-style
2188
2197
  * (e.g. 'https://storage.googleapis.com/mybucket/...'). Virtual hosted-style URLs
2189
- * should generally be preferred instaed of path-style URL.
2198
+ * should generally be preferred instead of path-style URL.
2190
2199
  * Currently defaults to `false` for path-style, although this may change in a
2191
2200
  * future major-version release.
2192
2201
  * @param {string} [config.cname] The cname for this bucket, i.e.,
@@ -595,7 +595,7 @@ export class Storage extends Service {
595
595
  * For more information, see {@link https://cloud.google.com/storage/docs/locations| Bucket Locations}.
596
596
  * @property {boolean} [dra=false] Specify the storage class as Durable Reduced
597
597
  * Availability.
598
- * @property {boolean} [enableObjectRetention=false] Specifiy whether or not object retention should be enabled on this bucket.
598
+ * @property {boolean} [enableObjectRetention=false] Specify whether or not object retention should be enabled on this bucket.
599
599
  * @property {object} [hierarchicalNamespace.enabled=false] Specify whether or not to enable hierarchical namespace on this bucket.
600
600
  * @property {string} [location] Specify the bucket's location. If specifying
601
601
  * a dual-region, the `customPlacementConfig` property should be set in conjunction.
@@ -84,7 +84,7 @@ export declare class TransferManager {
84
84
  * @typedef {object} UploadManyFilesOptions
85
85
  * @property {number} [concurrencyLimit] The number of concurrently executing promises
86
86
  * to use when uploading the files.
87
- * @property {Function} [customDestinationBuilder] A fuction that will take the current path of a local file
87
+ * @property {Function} [customDestinationBuilder] A function that will take the current path of a local file
88
88
  * and return a string representing a custom path to be used to upload the file to GCS.
89
89
  * @property {boolean} [skipIfExists] Do not upload the file if it already exists in
90
90
  * the bucket. This will set the precondition ifGenerationMatch = 0.
@@ -209,7 +209,7 @@ export declare class TransferManager {
209
209
  * @property {number} [concurrencyLimit] The number of concurrently executing promises
210
210
  * to use when uploading the file.
211
211
  * @property {number} [chunkSizeBytes] The size in bytes of each chunk to be uploaded.
212
- * @property {string} [uploadName] Name of the file when saving to GCS. If ommitted the name is taken from the file path.
212
+ * @property {string} [uploadName] Name of the file when saving to GCS. If omitted the name is taken from the file path.
213
213
  * @property {number} [maxQueueSize] The number of chunks to be uploaded to hold in memory concurrently. If not specified
214
214
  * defaults to the specified concurrency limit.
215
215
  * @property {string} [uploadId] If specified attempts to resume a previous upload.
@@ -222,14 +222,14 @@ export declare class TransferManager {
222
222
  *
223
223
  */
224
224
  /**
225
- * Upload a large file in chunks utilizing parallel upload opertions. If the upload fails, an uploadId and
225
+ * Upload a large file in chunks utilizing parallel upload operations. If the upload fails, an uploadId and
226
226
  * map containing all the successfully uploaded parts will be returned to the caller. These arguments can be used to
227
227
  * resume the upload.
228
228
  *
229
229
  * @param {string} [filePath] The path of the file to be uploaded
230
230
  * @param {UploadFileInChunksOptions} [options] Configuration options.
231
231
  * @param {MultiPartHelperGenerator} [generator] A function that will return a type that implements the MPU interface. Most users will not need to use this.
232
- * @returns {Promise<void>} If successful a promise resolving to void, otherwise a error containing the message, uploadid, and parts map.
232
+ * @returns {Promise<void>} If successful a promise resolving to void, otherwise a error containing the message, uploadId, and parts map.
233
233
  *
234
234
  * @example
235
235
  * ```
@@ -286,7 +286,7 @@ export class TransferManager {
286
286
  * @typedef {object} UploadManyFilesOptions
287
287
  * @property {number} [concurrencyLimit] The number of concurrently executing promises
288
288
  * to use when uploading the files.
289
- * @property {Function} [customDestinationBuilder] A fuction that will take the current path of a local file
289
+ * @property {Function} [customDestinationBuilder] A function that will take the current path of a local file
290
290
  * and return a string representing a custom path to be used to upload the file to GCS.
291
291
  * @property {boolean} [skipIfExists] Do not upload the file if it already exists in
292
292
  * the bucket. This will set the precondition ifGenerationMatch = 0.
@@ -555,7 +555,7 @@ export class TransferManager {
555
555
  * @property {number} [concurrencyLimit] The number of concurrently executing promises
556
556
  * to use when uploading the file.
557
557
  * @property {number} [chunkSizeBytes] The size in bytes of each chunk to be uploaded.
558
- * @property {string} [uploadName] Name of the file when saving to GCS. If ommitted the name is taken from the file path.
558
+ * @property {string} [uploadName] Name of the file when saving to GCS. If omitted the name is taken from the file path.
559
559
  * @property {number} [maxQueueSize] The number of chunks to be uploaded to hold in memory concurrently. If not specified
560
560
  * defaults to the specified concurrency limit.
561
561
  * @property {string} [uploadId] If specified attempts to resume a previous upload.
@@ -568,14 +568,14 @@ export class TransferManager {
568
568
  *
569
569
  */
570
570
  /**
571
- * Upload a large file in chunks utilizing parallel upload opertions. If the upload fails, an uploadId and
571
+ * Upload a large file in chunks utilizing parallel upload operations. If the upload fails, an uploadId and
572
572
  * map containing all the successfully uploaded parts will be returned to the caller. These arguments can be used to
573
573
  * resume the upload.
574
574
  *
575
575
  * @param {string} [filePath] The path of the file to be uploaded
576
576
  * @param {UploadFileInChunksOptions} [options] Configuration options.
577
577
  * @param {MultiPartHelperGenerator} [generator] A function that will return a type that implements the MPU interface. Most users will not need to use this.
578
- * @returns {Promise<void>} If successful a promise resolving to void, otherwise a error containing the message, uploadid, and parts map.
578
+ * @returns {Promise<void>} If successful a promise resolving to void, otherwise a error containing the message, uploadId, and parts map.
579
579
  *
580
580
  * @example
581
581
  * ```
@@ -61,7 +61,7 @@ export declare function convertObjKeysToSnakeCase(obj: object): object;
61
61
  * @param {boolean} includeTime flag to include hours, minutes, seconds in output.
62
62
  * @param {string} dateDelimiter delimiter between date components.
63
63
  * @param {string} timeDelimiter delimiter between time components.
64
- * @returns {string} UTC ISO format of provided date obect.
64
+ * @returns {string} UTC ISO format of provided date object.
65
65
  */
66
66
  export declare function formatAsUTCISO(dateTimeToFormat: Date, includeTime?: boolean, dateDelimiter?: string, timeDelimiter?: string): string;
67
67
  /**
@@ -120,7 +120,7 @@ export function convertObjKeysToSnakeCase(obj) {
120
120
  * @param {boolean} includeTime flag to include hours, minutes, seconds in output.
121
121
  * @param {string} dateDelimiter delimiter between date components.
122
122
  * @param {string} timeDelimiter delimiter between time components.
123
- * @returns {string} UTC ISO format of provided date obect.
123
+ * @returns {string} UTC ISO format of provided date object.
124
124
  */
125
125
  export function formatAsUTCISO(dateTimeToFormat, includeTime = false, dateDelimiter = '', timeDelimiter = '') {
126
126
  const year = dateTimeToFormat.getUTCFullYear();
@@ -208,7 +208,7 @@ export class PassThroughShim extends PassThrough {
208
208
  this.emit('writing');
209
209
  this.shouldEmitWriting = false;
210
210
  }
211
- // Per the nodejs documention, callback must be invoked on the next tick
211
+ // Per the nodejs documentation, callback must be invoked on the next tick
212
212
  process.nextTick(() => {
213
213
  super._write(chunk, encoding, callback);
214
214
  });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@google-cloud/storage",
3
3
  "description": "Cloud Storage Client Library for Node.js",
4
- "version": "7.16.0",
4
+ "version": "7.17.0",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Google Inc.",
7
7
  "engines": {
@@ -93,7 +93,7 @@
93
93
  "@babel/core": "^7.22.11",
94
94
  "@google-cloud/pubsub": "^4.0.0",
95
95
  "@grpc/grpc-js": "^1.0.3",
96
- "@grpc/proto-loader": "^0.7.0",
96
+ "@grpc/proto-loader": "^0.8.0",
97
97
  "@types/async-retry": "^1.4.3",
98
98
  "@types/duplexify": "^3.6.4",
99
99
  "@types/mime": "^3.0.0",
@@ -108,11 +108,11 @@
108
108
  "@types/uuid": "^8.0.0",
109
109
  "@types/yargs": "^17.0.10",
110
110
  "c8": "^9.0.0",
111
- "form-data": "^4.0.0",
111
+ "form-data": "^4.0.4",
112
112
  "gapic-tools": "^0.4.0",
113
113
  "gts": "^5.0.0",
114
- "jsdoc": "^4.0.0",
115
- "jsdoc-fresh": "^3.0.0",
114
+ "jsdoc": "^4.0.4",
115
+ "jsdoc-fresh": "^4.0.0",
116
116
  "jsdoc-region-tag": "^3.0.0",
117
117
  "linkinator": "^3.0.0",
118
118
  "mocha": "^9.2.2",
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hiiretail/gcp-infra-generators",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Infrastructure as code generator for GCP.",
5
5
  "scripts": {
6
6
  "build": "node esbuild.js && npm run build:deps",
@@ -23,7 +23,7 @@
23
23
  "cli"
24
24
  ],
25
25
  "dependencies": {
26
- "@google-cloud/storage": "^7.16.0",
26
+ "@google-cloud/storage": "^7.17.0",
27
27
  "axios": "^1.11.0",
28
28
  "chalk": "^4.1.2",
29
29
  "commander": "^14.0.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hiiretail/gcp-infra-generators",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Infrastructure as code generator for GCP.",
5
5
  "scripts": {
6
6
  "build": "node esbuild.js && npm run build:deps",
@@ -23,7 +23,7 @@
23
23
  "cli"
24
24
  ],
25
25
  "dependencies": {
26
- "@google-cloud/storage": "^7.16.0",
26
+ "@google-cloud/storage": "^7.17.0",
27
27
  "axios": "^1.11.0",
28
28
  "chalk": "^4.1.2",
29
29
  "commander": "^14.0.0",