@google-cloud/containeranalysis 6.1.0 → 6.3.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 +3 -2
- package/build/protos/google/devtools/containeranalysis/v1/containeranalysis.proto +81 -8
- package/build/protos/google/devtools/containeranalysis/v1beta1/containeranalysis.proto +32 -0
- package/build/protos/grafeas/v1/common.proto +31 -0
- package/build/protos/grafeas/v1/grafeas.proto +5 -0
- package/build/protos/grafeas/v1/secret.proto +90 -0
- package/build/protos/protos.d.ts +1036 -33
- package/build/protos/protos.js +3787 -789
- package/build/protos/protos.json +383 -56
- package/build/src/v1/container_analysis_client.d.ts +38 -11
- package/build/src/v1/container_analysis_client.js +104 -74
- package/build/src/v1/container_analysis_client_config.json +4 -0
- package/build/src/v1/container_analysis_proto_list.json +1 -0
- package/build/src/v1/gapic_metadata.json +10 -0
- package/build/src/v1/grafeas_proto_list.json +1 -0
- package/build/src/v1beta1/container_analysis_v1_beta1_client.d.ts +2 -2
- package/build/src/v1beta1/container_analysis_v1_beta1_client.js +69 -73
- package/build/src/v1beta1/grafeas_v1_beta1_client.d.ts +78 -78
- package/build/src/v1beta1/grafeas_v1_beta1_client.js +174 -198
- package/package.json +4 -4
- package/CHANGELOG.md +0 -560
|
@@ -243,8 +243,8 @@ export declare class ContainerAnalysisClient {
|
|
|
243
243
|
* @param {Object} request
|
|
244
244
|
* The request object that will be sent.
|
|
245
245
|
* @param {string} request.parent
|
|
246
|
-
* Required. The name of the project to get a vulnerability summary for in the
|
|
247
|
-
* `projects/[PROJECT_ID]`.
|
|
246
|
+
* Required. The name of the project to get a vulnerability summary for in the
|
|
247
|
+
* form of `projects/[PROJECT_ID]`.
|
|
248
248
|
* @param {string} request.filter
|
|
249
249
|
* The filter expression.
|
|
250
250
|
* @param {object} [options]
|
|
@@ -258,11 +258,38 @@ export declare class ContainerAnalysisClient {
|
|
|
258
258
|
*/
|
|
259
259
|
getVulnerabilityOccurrencesSummary(request?: protos.google.devtools.containeranalysis.v1.IGetVulnerabilityOccurrencesSummaryRequest, options?: CallOptions): Promise<[
|
|
260
260
|
protos.google.devtools.containeranalysis.v1.IVulnerabilityOccurrencesSummary,
|
|
261
|
-
|
|
261
|
+
protos.google.devtools.containeranalysis.v1.IGetVulnerabilityOccurrencesSummaryRequest | undefined,
|
|
262
262
|
{} | undefined
|
|
263
263
|
]>;
|
|
264
264
|
getVulnerabilityOccurrencesSummary(request: protos.google.devtools.containeranalysis.v1.IGetVulnerabilityOccurrencesSummaryRequest, options: CallOptions, callback: Callback<protos.google.devtools.containeranalysis.v1.IVulnerabilityOccurrencesSummary, protos.google.devtools.containeranalysis.v1.IGetVulnerabilityOccurrencesSummaryRequest | null | undefined, {} | null | undefined>): void;
|
|
265
265
|
getVulnerabilityOccurrencesSummary(request: protos.google.devtools.containeranalysis.v1.IGetVulnerabilityOccurrencesSummaryRequest, callback: Callback<protos.google.devtools.containeranalysis.v1.IVulnerabilityOccurrencesSummary, protos.google.devtools.containeranalysis.v1.IGetVulnerabilityOccurrencesSummaryRequest | null | undefined, {} | null | undefined>): void;
|
|
266
|
+
/**
|
|
267
|
+
* Generates an SBOM for the given resource.
|
|
268
|
+
*
|
|
269
|
+
* @param {Object} request
|
|
270
|
+
* The request object that will be sent.
|
|
271
|
+
* @param {string} request.name
|
|
272
|
+
* Required. The name of the resource in the form of
|
|
273
|
+
* `projects/[PROJECT_ID]/resources/[RESOURCE_URL]`.
|
|
274
|
+
* @param {google.devtools.containeranalysis.v1.ExportSBOMRequest.CloudStorageLocation} [request.cloudStorageLocation]
|
|
275
|
+
* Optional. Empty placeholder to denote that this is a Google Cloud Storage
|
|
276
|
+
* export request.
|
|
277
|
+
* @param {object} [options]
|
|
278
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
279
|
+
* @returns {Promise} - The promise which resolves to an array.
|
|
280
|
+
* The first element of the array is an object representing {@link protos.google.devtools.containeranalysis.v1.ExportSBOMResponse|ExportSBOMResponse}.
|
|
281
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
|
282
|
+
* for more details and examples.
|
|
283
|
+
* @example <caption>include:samples/generated/v1/container_analysis.export_s_b_o_m.js</caption>
|
|
284
|
+
* region_tag:containeranalysis_v1_generated_ContainerAnalysis_ExportSBOM_async
|
|
285
|
+
*/
|
|
286
|
+
exportSBOM(request?: protos.google.devtools.containeranalysis.v1.IExportSBOMRequest, options?: CallOptions): Promise<[
|
|
287
|
+
protos.google.devtools.containeranalysis.v1.IExportSBOMResponse,
|
|
288
|
+
protos.google.devtools.containeranalysis.v1.IExportSBOMRequest | undefined,
|
|
289
|
+
{} | undefined
|
|
290
|
+
]>;
|
|
291
|
+
exportSBOM(request: protos.google.devtools.containeranalysis.v1.IExportSBOMRequest, options: CallOptions, callback: Callback<protos.google.devtools.containeranalysis.v1.IExportSBOMResponse, protos.google.devtools.containeranalysis.v1.IExportSBOMRequest | null | undefined, {} | null | undefined>): void;
|
|
292
|
+
exportSBOM(request: protos.google.devtools.containeranalysis.v1.IExportSBOMRequest, callback: Callback<protos.google.devtools.containeranalysis.v1.IExportSBOMResponse, protos.google.devtools.containeranalysis.v1.IExportSBOMRequest | null | undefined, {} | null | undefined>): void;
|
|
266
293
|
/**
|
|
267
294
|
* Return a fully-qualified note resource name string.
|
|
268
295
|
*
|
|
@@ -334,13 +361,13 @@ export declare class ContainerAnalysisClient {
|
|
|
334
361
|
*/
|
|
335
362
|
close(): Promise<void>;
|
|
336
363
|
/**
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
364
|
+
* Returns an instance of a @google-cloud/grafeas client, configured to
|
|
365
|
+
* connect to Google Cloud's Container Analysis API. For documentation
|
|
366
|
+
* on this client, see:
|
|
367
|
+
* <a href="https://googleapis.dev/nodejs/grafeas/latest/index.html">https://googleapis.dev/nodejs/grafeas/latest/index.html</a>
|
|
368
|
+
*
|
|
369
|
+
* @returns {GrafeasClient} - An instance of a Grafeas client.
|
|
370
|
+
*
|
|
371
|
+
*/
|
|
345
372
|
getGrafeasClient(): import("@google-cloud/grafeas/build/src/v1").GrafeasClient;
|
|
346
373
|
}
|
|
@@ -109,26 +109,17 @@ 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 &&
|
|
113
|
-
opts?.universeDomain &&
|
|
114
|
-
opts?.universe_domain !== opts?.universeDomain) {
|
|
112
|
+
if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) {
|
|
115
113
|
throw new Error('Please set either universe_domain or universeDomain, but not both.');
|
|
116
114
|
}
|
|
117
|
-
const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
|
|
118
|
-
|
|
119
|
-
: undefined;
|
|
120
|
-
this._universeDomain =
|
|
121
|
-
opts?.universeDomain ??
|
|
122
|
-
opts?.universe_domain ??
|
|
123
|
-
universeDomainEnvVar ??
|
|
124
|
-
'googleapis.com';
|
|
115
|
+
const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined;
|
|
116
|
+
this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com';
|
|
125
117
|
this._servicePath = 'containeranalysis.' + this._universeDomain;
|
|
126
118
|
const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
|
|
127
119
|
this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
|
|
128
120
|
const port = opts?.port || staticMembers.port;
|
|
129
121
|
const clientConfig = opts?.clientConfig ?? {};
|
|
130
|
-
const fallback = opts?.fallback ??
|
|
131
|
-
(typeof window !== 'undefined' && typeof window?.fetch === 'function');
|
|
122
|
+
const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function');
|
|
132
123
|
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
|
|
133
124
|
// Request numeric enum values if REST transport is used.
|
|
134
125
|
opts.numericEnums = true;
|
|
@@ -157,7 +148,10 @@ class ContainerAnalysisClient {
|
|
|
157
148
|
this.auth.defaultScopes = staticMembers.scopes;
|
|
158
149
|
}
|
|
159
150
|
// Determine the client header string.
|
|
160
|
-
const clientHeader = [
|
|
151
|
+
const clientHeader = [
|
|
152
|
+
`gax/${this._gaxModule.version}`,
|
|
153
|
+
`gapic/${version}`,
|
|
154
|
+
];
|
|
161
155
|
if (typeof process === 'object' && 'versions' in process) {
|
|
162
156
|
clientHeader.push(`gl-node/${process.versions.node}`);
|
|
163
157
|
}
|
|
@@ -210,19 +204,13 @@ class ContainerAnalysisClient {
|
|
|
210
204
|
}
|
|
211
205
|
// Put together the "service stub" for
|
|
212
206
|
// google.devtools.containeranalysis.v1.ContainerAnalysis.
|
|
213
|
-
this.containerAnalysisStub = this._gaxGrpc.createStub(this._opts.fallback
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
.ContainerAnalysis, this._opts, this._providedCustomServicePath);
|
|
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
|
+
this._protos.google.devtools.containeranalysis.v1.ContainerAnalysis, this._opts, this._providedCustomServicePath);
|
|
218
211
|
// Iterate over each of the methods that the service provides
|
|
219
212
|
// and create an API call method for each.
|
|
220
|
-
const containerAnalysisStubMethods = [
|
|
221
|
-
'setIamPolicy',
|
|
222
|
-
'getIamPolicy',
|
|
223
|
-
'testIamPermissions',
|
|
224
|
-
'getVulnerabilityOccurrencesSummary',
|
|
225
|
-
];
|
|
213
|
+
const containerAnalysisStubMethods = ['setIamPolicy', 'getIamPolicy', 'testIamPermissions', 'getVulnerabilityOccurrencesSummary', 'exportSboM'];
|
|
226
214
|
for (const methodName of containerAnalysisStubMethods) {
|
|
227
215
|
const callPromise = this.containerAnalysisStub.then(stub => (...args) => {
|
|
228
216
|
if (this._terminated) {
|
|
@@ -245,8 +233,7 @@ class ContainerAnalysisClient {
|
|
|
245
233
|
* @returns {string} The DNS address for this service.
|
|
246
234
|
*/
|
|
247
235
|
static get servicePath() {
|
|
248
|
-
if (typeof process === 'object' &&
|
|
249
|
-
typeof process.emitWarning === 'function') {
|
|
236
|
+
if (typeof process === 'object' && typeof process.emitWarning === 'function') {
|
|
250
237
|
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
|
251
238
|
}
|
|
252
239
|
return 'containeranalysis.googleapis.com';
|
|
@@ -257,8 +244,7 @@ class ContainerAnalysisClient {
|
|
|
257
244
|
* @returns {string} The DNS address for this service.
|
|
258
245
|
*/
|
|
259
246
|
static get apiEndpoint() {
|
|
260
|
-
if (typeof process === 'object' &&
|
|
261
|
-
typeof process.emitWarning === 'function') {
|
|
247
|
+
if (typeof process === 'object' && typeof process.emitWarning === 'function') {
|
|
262
248
|
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
|
263
249
|
}
|
|
264
250
|
return 'containeranalysis.googleapis.com';
|
|
@@ -286,7 +272,9 @@ class ContainerAnalysisClient {
|
|
|
286
272
|
* @returns {string[]} List of default scopes.
|
|
287
273
|
*/
|
|
288
274
|
static get scopes() {
|
|
289
|
-
return [
|
|
275
|
+
return [
|
|
276
|
+
'https://www.googleapis.com/auth/cloud-platform'
|
|
277
|
+
];
|
|
290
278
|
}
|
|
291
279
|
/**
|
|
292
280
|
* Return the project ID used by this class.
|
|
@@ -312,13 +300,10 @@ class ContainerAnalysisClient {
|
|
|
312
300
|
options = options || {};
|
|
313
301
|
options.otherArgs = options.otherArgs || {};
|
|
314
302
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
315
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
316
|
-
|
|
317
|
-
resource: request.resource ?? '',
|
|
318
|
-
});
|
|
319
|
-
this.initialize().catch(err => {
|
|
320
|
-
throw err;
|
|
303
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
|
304
|
+
'resource': request.resource ?? '',
|
|
321
305
|
});
|
|
306
|
+
this.initialize().catch(err => { throw err; });
|
|
322
307
|
this._log.info('setIamPolicy request %j', request);
|
|
323
308
|
const wrappedCallback = callback
|
|
324
309
|
? (error, response, options, rawResponse) => {
|
|
@@ -326,11 +311,16 @@ class ContainerAnalysisClient {
|
|
|
326
311
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
327
312
|
}
|
|
328
313
|
: undefined;
|
|
329
|
-
return this.innerApiCalls
|
|
330
|
-
.setIamPolicy(request, options, wrappedCallback)
|
|
314
|
+
return this.innerApiCalls.setIamPolicy(request, options, wrappedCallback)
|
|
331
315
|
?.then(([response, options, rawResponse]) => {
|
|
332
316
|
this._log.info('setIamPolicy response %j', response);
|
|
333
317
|
return [response, options, rawResponse];
|
|
318
|
+
}).catch((error) => {
|
|
319
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
|
320
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
321
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
322
|
+
}
|
|
323
|
+
throw error;
|
|
334
324
|
});
|
|
335
325
|
}
|
|
336
326
|
getIamPolicy(request, optionsOrCallback, callback) {
|
|
@@ -346,13 +336,10 @@ class ContainerAnalysisClient {
|
|
|
346
336
|
options = options || {};
|
|
347
337
|
options.otherArgs = options.otherArgs || {};
|
|
348
338
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
349
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
350
|
-
|
|
351
|
-
resource: request.resource ?? '',
|
|
352
|
-
});
|
|
353
|
-
this.initialize().catch(err => {
|
|
354
|
-
throw err;
|
|
339
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
|
340
|
+
'resource': request.resource ?? '',
|
|
355
341
|
});
|
|
342
|
+
this.initialize().catch(err => { throw err; });
|
|
356
343
|
this._log.info('getIamPolicy request %j', request);
|
|
357
344
|
const wrappedCallback = callback
|
|
358
345
|
? (error, response, options, rawResponse) => {
|
|
@@ -360,11 +347,16 @@ class ContainerAnalysisClient {
|
|
|
360
347
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
361
348
|
}
|
|
362
349
|
: undefined;
|
|
363
|
-
return this.innerApiCalls
|
|
364
|
-
.getIamPolicy(request, options, wrappedCallback)
|
|
350
|
+
return this.innerApiCalls.getIamPolicy(request, options, wrappedCallback)
|
|
365
351
|
?.then(([response, options, rawResponse]) => {
|
|
366
352
|
this._log.info('getIamPolicy response %j', response);
|
|
367
353
|
return [response, options, rawResponse];
|
|
354
|
+
}).catch((error) => {
|
|
355
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
|
356
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
357
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
358
|
+
}
|
|
359
|
+
throw error;
|
|
368
360
|
});
|
|
369
361
|
}
|
|
370
362
|
testIamPermissions(request, optionsOrCallback, callback) {
|
|
@@ -380,13 +372,10 @@ class ContainerAnalysisClient {
|
|
|
380
372
|
options = options || {};
|
|
381
373
|
options.otherArgs = options.otherArgs || {};
|
|
382
374
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
383
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
384
|
-
|
|
385
|
-
resource: request.resource ?? '',
|
|
386
|
-
});
|
|
387
|
-
this.initialize().catch(err => {
|
|
388
|
-
throw err;
|
|
375
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
|
376
|
+
'resource': request.resource ?? '',
|
|
389
377
|
});
|
|
378
|
+
this.initialize().catch(err => { throw err; });
|
|
390
379
|
this._log.info('testIamPermissions request %j', request);
|
|
391
380
|
const wrappedCallback = callback
|
|
392
381
|
? (error, response, options, rawResponse) => {
|
|
@@ -394,11 +383,16 @@ class ContainerAnalysisClient {
|
|
|
394
383
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
395
384
|
}
|
|
396
385
|
: undefined;
|
|
397
|
-
return this.innerApiCalls
|
|
398
|
-
.testIamPermissions(request, options, wrappedCallback)
|
|
386
|
+
return this.innerApiCalls.testIamPermissions(request, options, wrappedCallback)
|
|
399
387
|
?.then(([response, options, rawResponse]) => {
|
|
400
388
|
this._log.info('testIamPermissions response %j', response);
|
|
401
389
|
return [response, options, rawResponse];
|
|
390
|
+
}).catch((error) => {
|
|
391
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
|
392
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
393
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
394
|
+
}
|
|
395
|
+
throw error;
|
|
402
396
|
});
|
|
403
397
|
}
|
|
404
398
|
getVulnerabilityOccurrencesSummary(request, optionsOrCallback, callback) {
|
|
@@ -414,13 +408,10 @@ class ContainerAnalysisClient {
|
|
|
414
408
|
options = options || {};
|
|
415
409
|
options.otherArgs = options.otherArgs || {};
|
|
416
410
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
417
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
418
|
-
|
|
419
|
-
parent: request.parent ?? '',
|
|
420
|
-
});
|
|
421
|
-
this.initialize().catch(err => {
|
|
422
|
-
throw err;
|
|
411
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
|
412
|
+
'parent': request.parent ?? '',
|
|
423
413
|
});
|
|
414
|
+
this.initialize().catch(err => { throw err; });
|
|
424
415
|
this._log.info('getVulnerabilityOccurrencesSummary request %j', request);
|
|
425
416
|
const wrappedCallback = callback
|
|
426
417
|
? (error, response, options, rawResponse) => {
|
|
@@ -428,11 +419,52 @@ class ContainerAnalysisClient {
|
|
|
428
419
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
429
420
|
}
|
|
430
421
|
: undefined;
|
|
431
|
-
return this.innerApiCalls
|
|
432
|
-
.getVulnerabilityOccurrencesSummary(request, options, wrappedCallback)
|
|
422
|
+
return this.innerApiCalls.getVulnerabilityOccurrencesSummary(request, options, wrappedCallback)
|
|
433
423
|
?.then(([response, options, rawResponse]) => {
|
|
434
424
|
this._log.info('getVulnerabilityOccurrencesSummary response %j', response);
|
|
435
425
|
return [response, options, rawResponse];
|
|
426
|
+
}).catch((error) => {
|
|
427
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
|
428
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
429
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
430
|
+
}
|
|
431
|
+
throw error;
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
exportSBOM(request, optionsOrCallback, callback) {
|
|
435
|
+
request = request || {};
|
|
436
|
+
let options;
|
|
437
|
+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
438
|
+
callback = optionsOrCallback;
|
|
439
|
+
options = {};
|
|
440
|
+
}
|
|
441
|
+
else {
|
|
442
|
+
options = optionsOrCallback;
|
|
443
|
+
}
|
|
444
|
+
options = options || {};
|
|
445
|
+
options.otherArgs = options.otherArgs || {};
|
|
446
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
447
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
|
448
|
+
'name': request.name ?? '',
|
|
449
|
+
});
|
|
450
|
+
this.initialize().catch(err => { throw err; });
|
|
451
|
+
this._log.info('exportSBOM request %j', request);
|
|
452
|
+
const wrappedCallback = callback
|
|
453
|
+
? (error, response, options, rawResponse) => {
|
|
454
|
+
this._log.info('exportSBOM response %j', response);
|
|
455
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
456
|
+
}
|
|
457
|
+
: undefined;
|
|
458
|
+
return this.innerApiCalls.exportSboM(request, options, wrappedCallback)
|
|
459
|
+
?.then(([response, options, rawResponse]) => {
|
|
460
|
+
this._log.info('exportSBOM response %j', response);
|
|
461
|
+
return [response, options, rawResponse];
|
|
462
|
+
}).catch((error) => {
|
|
463
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
|
464
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
465
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
466
|
+
}
|
|
467
|
+
throw error;
|
|
436
468
|
});
|
|
437
469
|
}
|
|
438
470
|
// --------------------
|
|
@@ -492,8 +524,7 @@ class ContainerAnalysisClient {
|
|
|
492
524
|
* @returns {string} A string representing the project.
|
|
493
525
|
*/
|
|
494
526
|
matchProjectFromOccurrenceName(occurrenceName) {
|
|
495
|
-
return this.pathTemplates.occurrencePathTemplate.match(occurrenceName)
|
|
496
|
-
.project;
|
|
527
|
+
return this.pathTemplates.occurrencePathTemplate.match(occurrenceName).project;
|
|
497
528
|
}
|
|
498
529
|
/**
|
|
499
530
|
* Parse the occurrence from Occurrence resource.
|
|
@@ -503,8 +534,7 @@ class ContainerAnalysisClient {
|
|
|
503
534
|
* @returns {string} A string representing the occurrence.
|
|
504
535
|
*/
|
|
505
536
|
matchOccurrenceFromOccurrenceName(occurrenceName) {
|
|
506
|
-
return this.pathTemplates.occurrencePathTemplate.match(occurrenceName)
|
|
507
|
-
.occurrence;
|
|
537
|
+
return this.pathTemplates.occurrencePathTemplate.match(occurrenceName).occurrence;
|
|
508
538
|
}
|
|
509
539
|
/**
|
|
510
540
|
* Return a fully-qualified project resource name string.
|
|
@@ -544,14 +574,14 @@ class ContainerAnalysisClient {
|
|
|
544
574
|
return Promise.resolve();
|
|
545
575
|
}
|
|
546
576
|
/**
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
577
|
+
* Returns an instance of a @google-cloud/grafeas client, configured to
|
|
578
|
+
* connect to Google Cloud's Container Analysis API. For documentation
|
|
579
|
+
* on this client, see:
|
|
580
|
+
* <a href="https://googleapis.dev/nodejs/grafeas/latest/index.html">https://googleapis.dev/nodejs/grafeas/latest/index.html</a>
|
|
581
|
+
*
|
|
582
|
+
* @returns {GrafeasClient} - An instance of a Grafeas client.
|
|
583
|
+
*
|
|
584
|
+
*/
|
|
555
585
|
getGrafeasClient() {
|
|
556
586
|
return new grafeas_1.GrafeasClient(this._opts);
|
|
557
587
|
}
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"../../protos/grafeas/v1/package.proto",
|
|
16
16
|
"../../protos/grafeas/v1/provenance.proto",
|
|
17
17
|
"../../protos/grafeas/v1/sbom.proto",
|
|
18
|
+
"../../protos/grafeas/v1/secret.proto",
|
|
18
19
|
"../../protos/grafeas/v1/severity.proto",
|
|
19
20
|
"../../protos/grafeas/v1/slsa_provenance.proto",
|
|
20
21
|
"../../protos/grafeas/v1/slsa_provenance_zero_two.proto",
|
|
@@ -29,6 +29,11 @@
|
|
|
29
29
|
"methods": [
|
|
30
30
|
"getVulnerabilityOccurrencesSummary"
|
|
31
31
|
]
|
|
32
|
+
},
|
|
33
|
+
"ExportSBOM": {
|
|
34
|
+
"methods": [
|
|
35
|
+
"exportSBOM"
|
|
36
|
+
]
|
|
32
37
|
}
|
|
33
38
|
}
|
|
34
39
|
},
|
|
@@ -54,6 +59,11 @@
|
|
|
54
59
|
"methods": [
|
|
55
60
|
"getVulnerabilityOccurrencesSummary"
|
|
56
61
|
]
|
|
62
|
+
},
|
|
63
|
+
"ExportSBOM": {
|
|
64
|
+
"methods": [
|
|
65
|
+
"exportSBOM"
|
|
66
|
+
]
|
|
57
67
|
}
|
|
58
68
|
}
|
|
59
69
|
}
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"../../protos/grafeas/v1/package.proto",
|
|
16
16
|
"../../protos/grafeas/v1/provenance.proto",
|
|
17
17
|
"../../protos/grafeas/v1/sbom.proto",
|
|
18
|
+
"../../protos/grafeas/v1/secret.proto",
|
|
18
19
|
"../../protos/grafeas/v1/severity.proto",
|
|
19
20
|
"../../protos/grafeas/v1/slsa_provenance.proto",
|
|
20
21
|
"../../protos/grafeas/v1/slsa_provenance_zero_two.proto",
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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;
|