@google-cloud/containeranalysis 6.7.2 → 6.9.0
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.
- package/README.md +2 -4
- package/build/protos/grafeas/v1/cvss.proto +95 -0
- package/build/protos/grafeas/v1/vulnerability.proto +8 -2
- package/build/protos/protos.d.ts +599 -6
- package/build/protos/protos.js +1 -91275
- package/build/protos/protos.json +264 -27
- package/build/src/v1/container_analysis_client.d.ts +2 -2
- package/build/src/v1/container_analysis_client.js +102 -52
- package/build/src/v1beta1/container_analysis_v1_beta1_client.d.ts +2 -2
- package/build/src/v1beta1/container_analysis_v1_beta1_client.js +100 -51
- package/build/src/v1beta1/grafeas_v1_beta1_client.d.ts +78 -78
- package/build/src/v1beta1/grafeas_v1_beta1_client.js +261 -128
- package/package.json +3 -3
|
@@ -109,17 +109,26 @@ class ContainerAnalysisClient {
|
|
|
109
109
|
constructor(opts, gaxInstance) {
|
|
110
110
|
// Ensure that options include all the required fields.
|
|
111
111
|
const staticMembers = this.constructor;
|
|
112
|
-
if (opts?.universe_domain &&
|
|
112
|
+
if (opts?.universe_domain &&
|
|
113
|
+
opts?.universeDomain &&
|
|
114
|
+
opts?.universe_domain !== opts?.universeDomain) {
|
|
113
115
|
throw new Error('Please set either universe_domain or universeDomain, but not both.');
|
|
114
116
|
}
|
|
115
|
-
const universeDomainEnvVar =
|
|
116
|
-
|
|
117
|
+
const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
|
|
118
|
+
? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
|
|
119
|
+
: undefined;
|
|
120
|
+
this._universeDomain =
|
|
121
|
+
opts?.universeDomain ??
|
|
122
|
+
opts?.universe_domain ??
|
|
123
|
+
universeDomainEnvVar ??
|
|
124
|
+
'googleapis.com';
|
|
117
125
|
this._servicePath = 'containeranalysis.' + this._universeDomain;
|
|
118
126
|
const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
|
|
119
127
|
this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
|
|
120
128
|
const port = opts?.port || staticMembers.port;
|
|
121
129
|
const clientConfig = opts?.clientConfig ?? {};
|
|
122
|
-
const fallback = opts?.fallback ??
|
|
130
|
+
const fallback = opts?.fallback ??
|
|
131
|
+
(typeof window !== 'undefined' && typeof window?.fetch === 'function');
|
|
123
132
|
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
|
|
124
133
|
// Request numeric enum values if REST transport is used.
|
|
125
134
|
opts.numericEnums = true;
|
|
@@ -148,10 +157,7 @@ class ContainerAnalysisClient {
|
|
|
148
157
|
this.auth.defaultScopes = staticMembers.scopes;
|
|
149
158
|
}
|
|
150
159
|
// Determine the client header string.
|
|
151
|
-
const clientHeader = [
|
|
152
|
-
`gax/${this._gaxModule.version}`,
|
|
153
|
-
`gapic/${version}`,
|
|
154
|
-
];
|
|
160
|
+
const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
|
|
155
161
|
if (typeof process === 'object' && 'versions' in process) {
|
|
156
162
|
clientHeader.push(`gl-node/${process.versions.node}`);
|
|
157
163
|
}
|
|
@@ -204,15 +210,22 @@ class ContainerAnalysisClient {
|
|
|
204
210
|
}
|
|
205
211
|
// Put together the "service stub" for
|
|
206
212
|
// google.devtools.containeranalysis.v1.ContainerAnalysis.
|
|
207
|
-
this.containerAnalysisStub = this._gaxGrpc.createStub(this._opts.fallback
|
|
208
|
-
this._protos.lookupService('google.devtools.containeranalysis.v1.ContainerAnalysis')
|
|
209
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
210
|
-
|
|
213
|
+
this.containerAnalysisStub = this._gaxGrpc.createStub(this._opts.fallback
|
|
214
|
+
? this._protos.lookupService('google.devtools.containeranalysis.v1.ContainerAnalysis')
|
|
215
|
+
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
216
|
+
this._protos.google.devtools.containeranalysis.v1
|
|
217
|
+
.ContainerAnalysis, this._opts, this._providedCustomServicePath);
|
|
211
218
|
// Iterate over each of the methods that the service provides
|
|
212
219
|
// and create an API call method for each.
|
|
213
|
-
const containerAnalysisStubMethods = [
|
|
220
|
+
const containerAnalysisStubMethods = [
|
|
221
|
+
'setIamPolicy',
|
|
222
|
+
'getIamPolicy',
|
|
223
|
+
'testIamPermissions',
|
|
224
|
+
'getVulnerabilityOccurrencesSummary',
|
|
225
|
+
'exportSboM',
|
|
226
|
+
];
|
|
214
227
|
for (const methodName of containerAnalysisStubMethods) {
|
|
215
|
-
const callPromise = this.containerAnalysisStub.then(stub => (...args) => {
|
|
228
|
+
const callPromise = this.containerAnalysisStub.then((stub) => (...args) => {
|
|
216
229
|
if (this._terminated) {
|
|
217
230
|
return Promise.reject('The client has already been closed.');
|
|
218
231
|
}
|
|
@@ -233,7 +246,8 @@ class ContainerAnalysisClient {
|
|
|
233
246
|
* @returns {string} The DNS address for this service.
|
|
234
247
|
*/
|
|
235
248
|
static get servicePath() {
|
|
236
|
-
if (typeof process === 'object' &&
|
|
249
|
+
if (typeof process === 'object' &&
|
|
250
|
+
typeof process.emitWarning === 'function') {
|
|
237
251
|
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
|
238
252
|
}
|
|
239
253
|
return 'containeranalysis.googleapis.com';
|
|
@@ -244,7 +258,8 @@ class ContainerAnalysisClient {
|
|
|
244
258
|
* @returns {string} The DNS address for this service.
|
|
245
259
|
*/
|
|
246
260
|
static get apiEndpoint() {
|
|
247
|
-
if (typeof process === 'object' &&
|
|
261
|
+
if (typeof process === 'object' &&
|
|
262
|
+
typeof process.emitWarning === 'function') {
|
|
248
263
|
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
|
249
264
|
}
|
|
250
265
|
return 'containeranalysis.googleapis.com';
|
|
@@ -272,9 +287,7 @@ class ContainerAnalysisClient {
|
|
|
272
287
|
* @returns {string[]} List of default scopes.
|
|
273
288
|
*/
|
|
274
289
|
static get scopes() {
|
|
275
|
-
return [
|
|
276
|
-
'https://www.googleapis.com/auth/cloud-platform'
|
|
277
|
-
];
|
|
290
|
+
return ['https://www.googleapis.com/auth/cloud-platform'];
|
|
278
291
|
}
|
|
279
292
|
/**
|
|
280
293
|
* Return the project ID used by this class.
|
|
@@ -300,10 +313,13 @@ class ContainerAnalysisClient {
|
|
|
300
313
|
options = options || {};
|
|
301
314
|
options.otherArgs = options.otherArgs || {};
|
|
302
315
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
303
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
304
|
-
|
|
316
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
317
|
+
this._gaxModule.routingHeader.fromParams({
|
|
318
|
+
resource: request.resource ?? '',
|
|
319
|
+
});
|
|
320
|
+
this.initialize().catch((err) => {
|
|
321
|
+
throw err;
|
|
305
322
|
});
|
|
306
|
-
this.initialize().catch(err => { throw err; });
|
|
307
323
|
this._log.info('setIamPolicy request %j', request);
|
|
308
324
|
const wrappedCallback = callback
|
|
309
325
|
? (error, response, options, rawResponse) => {
|
|
@@ -311,12 +327,16 @@ class ContainerAnalysisClient {
|
|
|
311
327
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
312
328
|
}
|
|
313
329
|
: undefined;
|
|
314
|
-
return this.innerApiCalls
|
|
330
|
+
return this.innerApiCalls
|
|
331
|
+
.setIamPolicy(request, options, wrappedCallback)
|
|
315
332
|
?.then(([response, options, rawResponse]) => {
|
|
316
333
|
this._log.info('setIamPolicy response %j', response);
|
|
317
334
|
return [response, options, rawResponse];
|
|
318
|
-
})
|
|
319
|
-
|
|
335
|
+
})
|
|
336
|
+
.catch((error) => {
|
|
337
|
+
if (error &&
|
|
338
|
+
'statusDetails' in error &&
|
|
339
|
+
error.statusDetails instanceof Array) {
|
|
320
340
|
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
321
341
|
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
322
342
|
}
|
|
@@ -336,10 +356,13 @@ class ContainerAnalysisClient {
|
|
|
336
356
|
options = options || {};
|
|
337
357
|
options.otherArgs = options.otherArgs || {};
|
|
338
358
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
339
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
340
|
-
|
|
359
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
360
|
+
this._gaxModule.routingHeader.fromParams({
|
|
361
|
+
resource: request.resource ?? '',
|
|
362
|
+
});
|
|
363
|
+
this.initialize().catch((err) => {
|
|
364
|
+
throw err;
|
|
341
365
|
});
|
|
342
|
-
this.initialize().catch(err => { throw err; });
|
|
343
366
|
this._log.info('getIamPolicy request %j', request);
|
|
344
367
|
const wrappedCallback = callback
|
|
345
368
|
? (error, response, options, rawResponse) => {
|
|
@@ -347,12 +370,16 @@ class ContainerAnalysisClient {
|
|
|
347
370
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
348
371
|
}
|
|
349
372
|
: undefined;
|
|
350
|
-
return this.innerApiCalls
|
|
373
|
+
return this.innerApiCalls
|
|
374
|
+
.getIamPolicy(request, options, wrappedCallback)
|
|
351
375
|
?.then(([response, options, rawResponse]) => {
|
|
352
376
|
this._log.info('getIamPolicy response %j', response);
|
|
353
377
|
return [response, options, rawResponse];
|
|
354
|
-
})
|
|
355
|
-
|
|
378
|
+
})
|
|
379
|
+
.catch((error) => {
|
|
380
|
+
if (error &&
|
|
381
|
+
'statusDetails' in error &&
|
|
382
|
+
error.statusDetails instanceof Array) {
|
|
356
383
|
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
357
384
|
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
358
385
|
}
|
|
@@ -372,10 +399,13 @@ class ContainerAnalysisClient {
|
|
|
372
399
|
options = options || {};
|
|
373
400
|
options.otherArgs = options.otherArgs || {};
|
|
374
401
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
375
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
376
|
-
|
|
402
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
403
|
+
this._gaxModule.routingHeader.fromParams({
|
|
404
|
+
resource: request.resource ?? '',
|
|
405
|
+
});
|
|
406
|
+
this.initialize().catch((err) => {
|
|
407
|
+
throw err;
|
|
377
408
|
});
|
|
378
|
-
this.initialize().catch(err => { throw err; });
|
|
379
409
|
this._log.info('testIamPermissions request %j', request);
|
|
380
410
|
const wrappedCallback = callback
|
|
381
411
|
? (error, response, options, rawResponse) => {
|
|
@@ -383,12 +413,16 @@ class ContainerAnalysisClient {
|
|
|
383
413
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
384
414
|
}
|
|
385
415
|
: undefined;
|
|
386
|
-
return this.innerApiCalls
|
|
416
|
+
return this.innerApiCalls
|
|
417
|
+
.testIamPermissions(request, options, wrappedCallback)
|
|
387
418
|
?.then(([response, options, rawResponse]) => {
|
|
388
419
|
this._log.info('testIamPermissions response %j', response);
|
|
389
420
|
return [response, options, rawResponse];
|
|
390
|
-
})
|
|
391
|
-
|
|
421
|
+
})
|
|
422
|
+
.catch((error) => {
|
|
423
|
+
if (error &&
|
|
424
|
+
'statusDetails' in error &&
|
|
425
|
+
error.statusDetails instanceof Array) {
|
|
392
426
|
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
393
427
|
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
394
428
|
}
|
|
@@ -408,10 +442,13 @@ class ContainerAnalysisClient {
|
|
|
408
442
|
options = options || {};
|
|
409
443
|
options.otherArgs = options.otherArgs || {};
|
|
410
444
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
411
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
412
|
-
|
|
445
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
446
|
+
this._gaxModule.routingHeader.fromParams({
|
|
447
|
+
parent: request.parent ?? '',
|
|
448
|
+
});
|
|
449
|
+
this.initialize().catch((err) => {
|
|
450
|
+
throw err;
|
|
413
451
|
});
|
|
414
|
-
this.initialize().catch(err => { throw err; });
|
|
415
452
|
this._log.info('getVulnerabilityOccurrencesSummary request %j', request);
|
|
416
453
|
const wrappedCallback = callback
|
|
417
454
|
? (error, response, options, rawResponse) => {
|
|
@@ -419,12 +456,16 @@ class ContainerAnalysisClient {
|
|
|
419
456
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
420
457
|
}
|
|
421
458
|
: undefined;
|
|
422
|
-
return this.innerApiCalls
|
|
459
|
+
return this.innerApiCalls
|
|
460
|
+
.getVulnerabilityOccurrencesSummary(request, options, wrappedCallback)
|
|
423
461
|
?.then(([response, options, rawResponse]) => {
|
|
424
462
|
this._log.info('getVulnerabilityOccurrencesSummary response %j', response);
|
|
425
463
|
return [response, options, rawResponse];
|
|
426
|
-
})
|
|
427
|
-
|
|
464
|
+
})
|
|
465
|
+
.catch((error) => {
|
|
466
|
+
if (error &&
|
|
467
|
+
'statusDetails' in error &&
|
|
468
|
+
error.statusDetails instanceof Array) {
|
|
428
469
|
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
429
470
|
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
430
471
|
}
|
|
@@ -444,10 +485,13 @@ class ContainerAnalysisClient {
|
|
|
444
485
|
options = options || {};
|
|
445
486
|
options.otherArgs = options.otherArgs || {};
|
|
446
487
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
447
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
448
|
-
|
|
488
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
489
|
+
this._gaxModule.routingHeader.fromParams({
|
|
490
|
+
name: request.name ?? '',
|
|
491
|
+
});
|
|
492
|
+
this.initialize().catch((err) => {
|
|
493
|
+
throw err;
|
|
449
494
|
});
|
|
450
|
-
this.initialize().catch(err => { throw err; });
|
|
451
495
|
this._log.info('exportSBOM request %j', request);
|
|
452
496
|
const wrappedCallback = callback
|
|
453
497
|
? (error, response, options, rawResponse) => {
|
|
@@ -455,12 +499,16 @@ class ContainerAnalysisClient {
|
|
|
455
499
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
456
500
|
}
|
|
457
501
|
: undefined;
|
|
458
|
-
return this.innerApiCalls
|
|
502
|
+
return this.innerApiCalls
|
|
503
|
+
.exportSboM(request, options, wrappedCallback)
|
|
459
504
|
?.then(([response, options, rawResponse]) => {
|
|
460
505
|
this._log.info('exportSBOM response %j', response);
|
|
461
506
|
return [response, options, rawResponse];
|
|
462
|
-
})
|
|
463
|
-
|
|
507
|
+
})
|
|
508
|
+
.catch((error) => {
|
|
509
|
+
if (error &&
|
|
510
|
+
'statusDetails' in error &&
|
|
511
|
+
error.statusDetails instanceof Array) {
|
|
464
512
|
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
465
513
|
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
466
514
|
}
|
|
@@ -524,7 +572,8 @@ class ContainerAnalysisClient {
|
|
|
524
572
|
* @returns {string} A string representing the project.
|
|
525
573
|
*/
|
|
526
574
|
matchProjectFromOccurrenceName(occurrenceName) {
|
|
527
|
-
return this.pathTemplates.occurrencePathTemplate.match(occurrenceName)
|
|
575
|
+
return this.pathTemplates.occurrencePathTemplate.match(occurrenceName)
|
|
576
|
+
.project;
|
|
528
577
|
}
|
|
529
578
|
/**
|
|
530
579
|
* Parse the occurrence from Occurrence resource.
|
|
@@ -534,7 +583,8 @@ class ContainerAnalysisClient {
|
|
|
534
583
|
* @returns {string} A string representing the occurrence.
|
|
535
584
|
*/
|
|
536
585
|
matchOccurrenceFromOccurrenceName(occurrenceName) {
|
|
537
|
-
return this.pathTemplates.occurrencePathTemplate.match(occurrenceName)
|
|
586
|
+
return this.pathTemplates.occurrencePathTemplate.match(occurrenceName)
|
|
587
|
+
.occurrence;
|
|
538
588
|
}
|
|
539
589
|
/**
|
|
540
590
|
* Return a fully-qualified project resource name string.
|
|
@@ -565,7 +615,7 @@ class ContainerAnalysisClient {
|
|
|
565
615
|
*/
|
|
566
616
|
close() {
|
|
567
617
|
if (this.containerAnalysisStub && !this._terminated) {
|
|
568
|
-
return this.containerAnalysisStub.then(stub => {
|
|
618
|
+
return this.containerAnalysisStub.then((stub) => {
|
|
569
619
|
this._log.info('ending gRPC channel');
|
|
570
620
|
this._terminated = true;
|
|
571
621
|
stub.close();
|
|
@@ -253,7 +253,7 @@ export declare class ContainerAnalysisV1Beta1Client {
|
|
|
253
253
|
*/
|
|
254
254
|
generatePackagesSummary(request?: protos.google.devtools.containeranalysis.v1beta1.IGeneratePackagesSummaryRequest, options?: CallOptions): Promise<[
|
|
255
255
|
protos.google.devtools.containeranalysis.v1beta1.IPackagesSummaryResponse,
|
|
256
|
-
protos.google.devtools.containeranalysis.v1beta1.IGeneratePackagesSummaryRequest | undefined,
|
|
256
|
+
(protos.google.devtools.containeranalysis.v1beta1.IGeneratePackagesSummaryRequest | undefined),
|
|
257
257
|
{} | undefined
|
|
258
258
|
]>;
|
|
259
259
|
generatePackagesSummary(request: protos.google.devtools.containeranalysis.v1beta1.IGeneratePackagesSummaryRequest, options: CallOptions, callback: Callback<protos.google.devtools.containeranalysis.v1beta1.IPackagesSummaryResponse, protos.google.devtools.containeranalysis.v1beta1.IGeneratePackagesSummaryRequest | null | undefined, {} | null | undefined>): void;
|
|
@@ -277,7 +277,7 @@ export declare class ContainerAnalysisV1Beta1Client {
|
|
|
277
277
|
*/
|
|
278
278
|
exportSBOM(request?: protos.google.devtools.containeranalysis.v1beta1.IExportSBOMRequest, options?: CallOptions): Promise<[
|
|
279
279
|
protos.google.devtools.containeranalysis.v1beta1.IExportSBOMResponse,
|
|
280
|
-
protos.google.devtools.containeranalysis.v1beta1.IExportSBOMRequest | undefined,
|
|
280
|
+
(protos.google.devtools.containeranalysis.v1beta1.IExportSBOMRequest | undefined),
|
|
281
281
|
{} | undefined
|
|
282
282
|
]>;
|
|
283
283
|
exportSBOM(request: protos.google.devtools.containeranalysis.v1beta1.IExportSBOMRequest, options: CallOptions, callback: Callback<protos.google.devtools.containeranalysis.v1beta1.IExportSBOMResponse, protos.google.devtools.containeranalysis.v1beta1.IExportSBOMRequest | null | undefined, {} | null | undefined>): void;
|
|
@@ -106,18 +106,28 @@ class ContainerAnalysisV1Beta1Client {
|
|
|
106
106
|
*/
|
|
107
107
|
constructor(opts, gaxInstance) {
|
|
108
108
|
// Ensure that options include all the required fields.
|
|
109
|
-
const staticMembers = this
|
|
110
|
-
|
|
109
|
+
const staticMembers = this
|
|
110
|
+
.constructor;
|
|
111
|
+
if (opts?.universe_domain &&
|
|
112
|
+
opts?.universeDomain &&
|
|
113
|
+
opts?.universe_domain !== opts?.universeDomain) {
|
|
111
114
|
throw new Error('Please set either universe_domain or universeDomain, but not both.');
|
|
112
115
|
}
|
|
113
|
-
const universeDomainEnvVar =
|
|
114
|
-
|
|
116
|
+
const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
|
|
117
|
+
? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
|
|
118
|
+
: undefined;
|
|
119
|
+
this._universeDomain =
|
|
120
|
+
opts?.universeDomain ??
|
|
121
|
+
opts?.universe_domain ??
|
|
122
|
+
universeDomainEnvVar ??
|
|
123
|
+
'googleapis.com';
|
|
115
124
|
this._servicePath = 'containeranalysis.' + this._universeDomain;
|
|
116
125
|
const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
|
|
117
126
|
this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
|
|
118
127
|
const port = opts?.port || staticMembers.port;
|
|
119
128
|
const clientConfig = opts?.clientConfig ?? {};
|
|
120
|
-
const fallback = opts?.fallback ??
|
|
129
|
+
const fallback = opts?.fallback ??
|
|
130
|
+
(typeof window !== 'undefined' && typeof window?.fetch === 'function');
|
|
121
131
|
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
|
|
122
132
|
// Request numeric enum values if REST transport is used.
|
|
123
133
|
opts.numericEnums = true;
|
|
@@ -146,10 +156,7 @@ class ContainerAnalysisV1Beta1Client {
|
|
|
146
156
|
this.auth.defaultScopes = staticMembers.scopes;
|
|
147
157
|
}
|
|
148
158
|
// Determine the client header string.
|
|
149
|
-
const clientHeader = [
|
|
150
|
-
`gax/${this._gaxModule.version}`,
|
|
151
|
-
`gapic/${version}`,
|
|
152
|
-
];
|
|
159
|
+
const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
|
|
153
160
|
if (typeof process === 'object' && 'versions' in process) {
|
|
154
161
|
clientHeader.push(`gl-node/${process.versions.node}`);
|
|
155
162
|
}
|
|
@@ -194,15 +201,22 @@ class ContainerAnalysisV1Beta1Client {
|
|
|
194
201
|
}
|
|
195
202
|
// Put together the "service stub" for
|
|
196
203
|
// google.devtools.containeranalysis.v1beta1.ContainerAnalysisV1Beta1.
|
|
197
|
-
this.containerAnalysisV1Beta1Stub = this._gaxGrpc.createStub(this._opts.fallback
|
|
198
|
-
this._protos.lookupService('google.devtools.containeranalysis.v1beta1.ContainerAnalysisV1Beta1')
|
|
199
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
200
|
-
|
|
204
|
+
this.containerAnalysisV1Beta1Stub = this._gaxGrpc.createStub(this._opts.fallback
|
|
205
|
+
? this._protos.lookupService('google.devtools.containeranalysis.v1beta1.ContainerAnalysisV1Beta1')
|
|
206
|
+
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
207
|
+
this._protos.google.devtools.containeranalysis.v1beta1
|
|
208
|
+
.ContainerAnalysisV1Beta1, this._opts, this._providedCustomServicePath);
|
|
201
209
|
// Iterate over each of the methods that the service provides
|
|
202
210
|
// and create an API call method for each.
|
|
203
|
-
const containerAnalysisV1Beta1StubMethods = [
|
|
211
|
+
const containerAnalysisV1Beta1StubMethods = [
|
|
212
|
+
'setIamPolicy',
|
|
213
|
+
'getIamPolicy',
|
|
214
|
+
'testIamPermissions',
|
|
215
|
+
'generatePackagesSummary',
|
|
216
|
+
'exportSboM',
|
|
217
|
+
];
|
|
204
218
|
for (const methodName of containerAnalysisV1Beta1StubMethods) {
|
|
205
|
-
const callPromise = this.containerAnalysisV1Beta1Stub.then(stub => (...args) => {
|
|
219
|
+
const callPromise = this.containerAnalysisV1Beta1Stub.then((stub) => (...args) => {
|
|
206
220
|
if (this._terminated) {
|
|
207
221
|
return Promise.reject('The client has already been closed.');
|
|
208
222
|
}
|
|
@@ -223,7 +237,8 @@ class ContainerAnalysisV1Beta1Client {
|
|
|
223
237
|
* @returns {string} The DNS address for this service.
|
|
224
238
|
*/
|
|
225
239
|
static get servicePath() {
|
|
226
|
-
if (typeof process === 'object' &&
|
|
240
|
+
if (typeof process === 'object' &&
|
|
241
|
+
typeof process.emitWarning === 'function') {
|
|
227
242
|
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
|
228
243
|
}
|
|
229
244
|
return 'containeranalysis.googleapis.com';
|
|
@@ -234,7 +249,8 @@ class ContainerAnalysisV1Beta1Client {
|
|
|
234
249
|
* @returns {string} The DNS address for this service.
|
|
235
250
|
*/
|
|
236
251
|
static get apiEndpoint() {
|
|
237
|
-
if (typeof process === 'object' &&
|
|
252
|
+
if (typeof process === 'object' &&
|
|
253
|
+
typeof process.emitWarning === 'function') {
|
|
238
254
|
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
|
239
255
|
}
|
|
240
256
|
return 'containeranalysis.googleapis.com';
|
|
@@ -262,9 +278,7 @@ class ContainerAnalysisV1Beta1Client {
|
|
|
262
278
|
* @returns {string[]} List of default scopes.
|
|
263
279
|
*/
|
|
264
280
|
static get scopes() {
|
|
265
|
-
return [
|
|
266
|
-
'https://www.googleapis.com/auth/cloud-platform'
|
|
267
|
-
];
|
|
281
|
+
return ['https://www.googleapis.com/auth/cloud-platform'];
|
|
268
282
|
}
|
|
269
283
|
/**
|
|
270
284
|
* Return the project ID used by this class.
|
|
@@ -290,10 +304,13 @@ class ContainerAnalysisV1Beta1Client {
|
|
|
290
304
|
options = options || {};
|
|
291
305
|
options.otherArgs = options.otherArgs || {};
|
|
292
306
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
293
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
294
|
-
|
|
307
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
308
|
+
this._gaxModule.routingHeader.fromParams({
|
|
309
|
+
resource: request.resource ?? '',
|
|
310
|
+
});
|
|
311
|
+
this.initialize().catch((err) => {
|
|
312
|
+
throw err;
|
|
295
313
|
});
|
|
296
|
-
this.initialize().catch(err => { throw err; });
|
|
297
314
|
this._log.info('setIamPolicy request %j', request);
|
|
298
315
|
const wrappedCallback = callback
|
|
299
316
|
? (error, response, options, rawResponse) => {
|
|
@@ -301,12 +318,16 @@ class ContainerAnalysisV1Beta1Client {
|
|
|
301
318
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
302
319
|
}
|
|
303
320
|
: undefined;
|
|
304
|
-
return this.innerApiCalls
|
|
321
|
+
return this.innerApiCalls
|
|
322
|
+
.setIamPolicy(request, options, wrappedCallback)
|
|
305
323
|
?.then(([response, options, rawResponse]) => {
|
|
306
324
|
this._log.info('setIamPolicy response %j', response);
|
|
307
325
|
return [response, options, rawResponse];
|
|
308
|
-
})
|
|
309
|
-
|
|
326
|
+
})
|
|
327
|
+
.catch((error) => {
|
|
328
|
+
if (error &&
|
|
329
|
+
'statusDetails' in error &&
|
|
330
|
+
error.statusDetails instanceof Array) {
|
|
310
331
|
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
311
332
|
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
312
333
|
}
|
|
@@ -326,10 +347,13 @@ class ContainerAnalysisV1Beta1Client {
|
|
|
326
347
|
options = options || {};
|
|
327
348
|
options.otherArgs = options.otherArgs || {};
|
|
328
349
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
329
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
330
|
-
|
|
350
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
351
|
+
this._gaxModule.routingHeader.fromParams({
|
|
352
|
+
resource: request.resource ?? '',
|
|
353
|
+
});
|
|
354
|
+
this.initialize().catch((err) => {
|
|
355
|
+
throw err;
|
|
331
356
|
});
|
|
332
|
-
this.initialize().catch(err => { throw err; });
|
|
333
357
|
this._log.info('getIamPolicy request %j', request);
|
|
334
358
|
const wrappedCallback = callback
|
|
335
359
|
? (error, response, options, rawResponse) => {
|
|
@@ -337,12 +361,16 @@ class ContainerAnalysisV1Beta1Client {
|
|
|
337
361
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
338
362
|
}
|
|
339
363
|
: undefined;
|
|
340
|
-
return this.innerApiCalls
|
|
364
|
+
return this.innerApiCalls
|
|
365
|
+
.getIamPolicy(request, options, wrappedCallback)
|
|
341
366
|
?.then(([response, options, rawResponse]) => {
|
|
342
367
|
this._log.info('getIamPolicy response %j', response);
|
|
343
368
|
return [response, options, rawResponse];
|
|
344
|
-
})
|
|
345
|
-
|
|
369
|
+
})
|
|
370
|
+
.catch((error) => {
|
|
371
|
+
if (error &&
|
|
372
|
+
'statusDetails' in error &&
|
|
373
|
+
error.statusDetails instanceof Array) {
|
|
346
374
|
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
347
375
|
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
348
376
|
}
|
|
@@ -362,10 +390,13 @@ class ContainerAnalysisV1Beta1Client {
|
|
|
362
390
|
options = options || {};
|
|
363
391
|
options.otherArgs = options.otherArgs || {};
|
|
364
392
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
365
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
366
|
-
|
|
393
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
394
|
+
this._gaxModule.routingHeader.fromParams({
|
|
395
|
+
resource: request.resource ?? '',
|
|
396
|
+
});
|
|
397
|
+
this.initialize().catch((err) => {
|
|
398
|
+
throw err;
|
|
367
399
|
});
|
|
368
|
-
this.initialize().catch(err => { throw err; });
|
|
369
400
|
this._log.info('testIamPermissions request %j', request);
|
|
370
401
|
const wrappedCallback = callback
|
|
371
402
|
? (error, response, options, rawResponse) => {
|
|
@@ -373,12 +404,16 @@ class ContainerAnalysisV1Beta1Client {
|
|
|
373
404
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
374
405
|
}
|
|
375
406
|
: undefined;
|
|
376
|
-
return this.innerApiCalls
|
|
407
|
+
return this.innerApiCalls
|
|
408
|
+
.testIamPermissions(request, options, wrappedCallback)
|
|
377
409
|
?.then(([response, options, rawResponse]) => {
|
|
378
410
|
this._log.info('testIamPermissions response %j', response);
|
|
379
411
|
return [response, options, rawResponse];
|
|
380
|
-
})
|
|
381
|
-
|
|
412
|
+
})
|
|
413
|
+
.catch((error) => {
|
|
414
|
+
if (error &&
|
|
415
|
+
'statusDetails' in error &&
|
|
416
|
+
error.statusDetails instanceof Array) {
|
|
382
417
|
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
383
418
|
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
384
419
|
}
|
|
@@ -398,10 +433,13 @@ class ContainerAnalysisV1Beta1Client {
|
|
|
398
433
|
options = options || {};
|
|
399
434
|
options.otherArgs = options.otherArgs || {};
|
|
400
435
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
401
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
402
|
-
|
|
436
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
437
|
+
this._gaxModule.routingHeader.fromParams({
|
|
438
|
+
name: request.name ?? '',
|
|
439
|
+
});
|
|
440
|
+
this.initialize().catch((err) => {
|
|
441
|
+
throw err;
|
|
403
442
|
});
|
|
404
|
-
this.initialize().catch(err => { throw err; });
|
|
405
443
|
this._log.info('generatePackagesSummary request %j', request);
|
|
406
444
|
const wrappedCallback = callback
|
|
407
445
|
? (error, response, options, rawResponse) => {
|
|
@@ -409,12 +447,16 @@ class ContainerAnalysisV1Beta1Client {
|
|
|
409
447
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
410
448
|
}
|
|
411
449
|
: undefined;
|
|
412
|
-
return this.innerApiCalls
|
|
450
|
+
return this.innerApiCalls
|
|
451
|
+
.generatePackagesSummary(request, options, wrappedCallback)
|
|
413
452
|
?.then(([response, options, rawResponse]) => {
|
|
414
453
|
this._log.info('generatePackagesSummary response %j', response);
|
|
415
454
|
return [response, options, rawResponse];
|
|
416
|
-
})
|
|
417
|
-
|
|
455
|
+
})
|
|
456
|
+
.catch((error) => {
|
|
457
|
+
if (error &&
|
|
458
|
+
'statusDetails' in error &&
|
|
459
|
+
error.statusDetails instanceof Array) {
|
|
418
460
|
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
419
461
|
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
420
462
|
}
|
|
@@ -434,10 +476,13 @@ class ContainerAnalysisV1Beta1Client {
|
|
|
434
476
|
options = options || {};
|
|
435
477
|
options.otherArgs = options.otherArgs || {};
|
|
436
478
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
437
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
438
|
-
|
|
479
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
480
|
+
this._gaxModule.routingHeader.fromParams({
|
|
481
|
+
name: request.name ?? '',
|
|
482
|
+
});
|
|
483
|
+
this.initialize().catch((err) => {
|
|
484
|
+
throw err;
|
|
439
485
|
});
|
|
440
|
-
this.initialize().catch(err => { throw err; });
|
|
441
486
|
this._log.info('exportSBOM request %j', request);
|
|
442
487
|
const wrappedCallback = callback
|
|
443
488
|
? (error, response, options, rawResponse) => {
|
|
@@ -445,12 +490,16 @@ class ContainerAnalysisV1Beta1Client {
|
|
|
445
490
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
446
491
|
}
|
|
447
492
|
: undefined;
|
|
448
|
-
return this.innerApiCalls
|
|
493
|
+
return this.innerApiCalls
|
|
494
|
+
.exportSboM(request, options, wrappedCallback)
|
|
449
495
|
?.then(([response, options, rawResponse]) => {
|
|
450
496
|
this._log.info('exportSBOM response %j', response);
|
|
451
497
|
return [response, options, rawResponse];
|
|
452
|
-
})
|
|
453
|
-
|
|
498
|
+
})
|
|
499
|
+
.catch((error) => {
|
|
500
|
+
if (error &&
|
|
501
|
+
'statusDetails' in error &&
|
|
502
|
+
error.statusDetails instanceof Array) {
|
|
454
503
|
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
455
504
|
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
456
505
|
}
|
|
@@ -465,7 +514,7 @@ class ContainerAnalysisV1Beta1Client {
|
|
|
465
514
|
*/
|
|
466
515
|
close() {
|
|
467
516
|
if (this.containerAnalysisV1Beta1Stub && !this._terminated) {
|
|
468
|
-
return this.containerAnalysisV1Beta1Stub.then(stub => {
|
|
517
|
+
return this.containerAnalysisV1Beta1Stub.then((stub) => {
|
|
469
518
|
this._log.info('ending gRPC channel');
|
|
470
519
|
this._terminated = true;
|
|
471
520
|
stub.close();
|