@cyclonedx/cdxgen 10.3.5 → 10.4.1

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 (54) hide show
  1. package/README.md +2 -4
  2. package/analyzer.js +19 -21
  3. package/bin/cdxgen.js +78 -77
  4. package/bin/evinse.js +26 -26
  5. package/bin/repl.js +56 -62
  6. package/bin/verify.js +9 -9
  7. package/binary.js +55 -54
  8. package/cbomutils.js +6 -6
  9. package/db.js +17 -17
  10. package/display.js +30 -30
  11. package/display.test.js +2 -2
  12. package/docker.js +93 -90
  13. package/docker.test.js +30 -30
  14. package/envcontext.js +15 -15
  15. package/envcontext.test.js +1 -1
  16. package/evinser.js +94 -93
  17. package/evinser.test.js +24 -24
  18. package/index.js +522 -482
  19. package/package.json +8 -16
  20. package/piptree.js +6 -6
  21. package/postgen.js +2 -5
  22. package/postgen.test.js +5 -5
  23. package/protobom.js +37 -7
  24. package/protobom.test.js +6 -6
  25. package/server.js +16 -16
  26. package/types/analyzer.d.ts +7 -4
  27. package/types/analyzer.d.ts.map +1 -1
  28. package/types/binary.d.ts +12 -8
  29. package/types/binary.d.ts.map +1 -1
  30. package/types/cbomutils.d.ts +1 -1
  31. package/types/db.d.ts +22 -9
  32. package/types/db.d.ts.map +1 -1
  33. package/types/display.d.ts +1 -1
  34. package/types/docker.d.ts +52 -32
  35. package/types/docker.d.ts.map +1 -1
  36. package/types/envcontext.d.ts +40 -40
  37. package/types/evinser.d.ts +3436 -717
  38. package/types/evinser.d.ts.map +1 -1
  39. package/types/index.d.ts +66 -40
  40. package/types/index.d.ts.map +1 -1
  41. package/types/jest.config.d.ts +2 -2
  42. package/types/piptree.d.ts +6 -2
  43. package/types/postgen.d.ts +1 -1
  44. package/types/postgen.d.ts.map +1 -1
  45. package/types/protobom.d.ts +7 -3
  46. package/types/protobom.d.ts.map +1 -1
  47. package/types/server.d.ts +1 -1
  48. package/types/utils.d.ts +521 -303
  49. package/types/utils.d.ts.map +1 -1
  50. package/types/validator.d.ts +1 -1
  51. package/types/validator.d.ts.map +1 -1
  52. package/utils.js +748 -676
  53. package/utils.test.js +720 -674
  54. package/validator.js +20 -17
package/types/utils.d.ts CHANGED
@@ -4,7 +4,11 @@
4
4
  * @param {string} dirPath Root directory for search
5
5
  * @param {string} pattern Glob pattern (eg: *.gradle)
6
6
  */
7
- export function getAllFiles(dirPath: string, pattern: string, options?: {}): string[];
7
+ export function getAllFiles(
8
+ dirPath: string,
9
+ pattern: string,
10
+ options?: {},
11
+ ): string[];
8
12
  /**
9
13
  * Method to get files matching a pattern
10
14
  *
@@ -12,14 +16,42 @@ export function getAllFiles(dirPath: string, pattern: string, options?: {}): str
12
16
  * @param {string} pattern Glob pattern (eg: *.gradle)
13
17
  * @param {Array} ignoreList Directory patterns to ignore
14
18
  */
15
- export function getAllFilesWithIgnore(dirPath: string, pattern: string, ignoreList: any[]): string[];
19
+ export function getAllFilesWithIgnore(
20
+ dirPath: string,
21
+ pattern: string,
22
+ ignoreList: any[],
23
+ ): string[];
24
+ /**
25
+ * Return the current timestamp in YYYY-MM-DDTHH:MM:SSZ format.
26
+ *
27
+ * @returns {string} ISO formatted timestamp, without milliseconds.
28
+ */
29
+ export function getTimestamp(): string;
30
+ /**
31
+ * Method to determine if a license is a valid SPDX license expression
32
+ *
33
+ * @param {string} license License string
34
+ * @returns {boolean} true if the license is a valid SPDX license expression
35
+ * @see https://spdx.dev/learn/handling-license-info/
36
+ **/
37
+ export function isSpdxLicenseExpression(license: string): boolean;
38
+ /**
39
+ * Convert the array of licenses to a CycloneDX 1.5 compliant license array.
40
+ * This should return an array containing:
41
+ * - one or more SPDX license if no expression is present
42
+ * - the first license expression if at least one is present
43
+ *
44
+ * @param {Array} licenses Array of licenses
45
+ * @returns {Array} CycloneDX 1.5 compliant license array
46
+ */
47
+ export function adjustLicenseInformation(licenses: any[]): any[];
16
48
  /**
17
49
  * Performs a lookup + validation of the license specified in the
18
50
  * package. If the license is a valid SPDX license ID, set the 'id'
19
51
  * and url of the license object, otherwise, set the 'name' of the license
20
52
  * object.
21
53
  */
22
- export function getLicenses(pkg: any): any;
54
+ export function getLicenses(pkg: any): any[];
23
55
  /**
24
56
  * Method to retrieve known license by known-licenses.json
25
57
  *
@@ -38,8 +70,11 @@ export function addLicenseText(pkg: any, l: any, licenseContent: any): void;
38
70
  * Read the file from the given path to the license text object and includes
39
71
  * content-type attribute, if not default. Returns the license text object.
40
72
  */
41
- export function readLicenseText(licenseFilepath: any, licenseContentType: any): {
42
- content: string;
73
+ export function readLicenseText(
74
+ licenseFilepath: any,
75
+ licenseContentType: any,
76
+ ): {
77
+ content: string;
43
78
  };
44
79
  export function getSwiftPackageMetadata(pkgList: any): Promise<any[]>;
45
80
  /**
@@ -54,16 +89,22 @@ export function getNpmMetadata(pkgList: any[]): Promise<any[]>;
54
89
  * @param {string} pkgJsonFile package.json file
55
90
  * @param {boolean} simple Return a simpler representation of the component by skipping extended attributes and license fetch.
56
91
  */
57
- export function parsePkgJson(pkgJsonFile: string, simple?: boolean): Promise<any[]>;
92
+ export function parsePkgJson(
93
+ pkgJsonFile: string,
94
+ simple?: boolean,
95
+ ): Promise<any[]>;
58
96
  /**
59
97
  * Parse nodejs package lock file
60
98
  *
61
99
  * @param {string} pkgLockFile package-lock.json file
62
100
  * @param {object} options Command line options
63
101
  */
64
- export function parsePkgLock(pkgLockFile: string, options?: object): Promise<{
65
- pkgList: any;
66
- dependenciesList: any;
102
+ export function parsePkgLock(
103
+ pkgLockFile: string,
104
+ options?: object,
105
+ ): Promise<{
106
+ pkgList: any;
107
+ dependenciesList: any;
67
108
  }>;
68
109
  /**
69
110
  * Given a lock file this method would return an Object with the identiy as the key and parsed name and value
@@ -80,8 +121,8 @@ export function yarnLockToIdentMap(lockData: string): {};
80
121
  * @param {string} yarnLockFile yarn.lock file
81
122
  */
82
123
  export function parseYarnLock(yarnLockFile: string): Promise<{
83
- pkgList: any[];
84
- dependenciesList: any[];
124
+ pkgList: any[];
125
+ dependenciesList: any[];
85
126
  }>;
86
127
  /**
87
128
  * Parse nodejs shrinkwrap deps file
@@ -95,16 +136,22 @@ export function parseNodeShrinkwrap(swFile: string): Promise<any[]>;
95
136
  * @param {string} pnpmLock pnpm-lock.yaml file
96
137
  * @param {object} parentComponent parent component
97
138
  */
98
- export function parsePnpmLock(pnpmLock: string, parentComponent?: object): Promise<{
99
- pkgList?: undefined;
100
- dependenciesList?: undefined;
101
- } | {
102
- pkgList: any[];
103
- dependenciesList: {
139
+ export function parsePnpmLock(
140
+ pnpmLock: string,
141
+ parentComponent?: object,
142
+ ): Promise<
143
+ | {
144
+ pkgList?: undefined;
145
+ dependenciesList?: undefined;
146
+ }
147
+ | {
148
+ pkgList: any[];
149
+ dependenciesList: {
104
150
  ref: string;
105
151
  dependsOn: string[];
106
- }[];
107
- }>;
152
+ }[];
153
+ }
154
+ >;
108
155
  /**
109
156
  * Parse bower json file
110
157
  *
@@ -123,42 +170,44 @@ export function parseMinJs(minJsFile: string): Promise<any[]>;
123
170
  * @param {string} pom file to parse
124
171
  */
125
172
  export function parsePom(pomFile: any): {
126
- group: any;
127
- name: any;
128
- version: any;
129
- qualifiers: {
130
- type: string;
131
- };
132
- properties: {
133
- name: string;
173
+ group: any;
174
+ name: any;
175
+ version: any;
176
+ qualifiers: {
177
+ type: string;
178
+ };
179
+ properties: {
180
+ name: string;
181
+ value: any;
182
+ }[];
183
+ evidence: {
184
+ identity: {
185
+ field: string;
186
+ confidence: number;
187
+ methods: {
188
+ technique: string;
189
+ confidence: number;
134
190
  value: any;
135
- }[];
136
- evidence: {
137
- identity: {
138
- field: string;
139
- confidence: number;
140
- methods: {
141
- technique: string;
142
- confidence: number;
143
- value: any;
144
- }[];
145
- };
191
+ }[];
146
192
  };
193
+ };
147
194
  }[];
148
195
  /**
149
196
  * Parse maven tree output
150
197
  * @param {string} rawOutput Raw string output
151
198
  */
152
- export function parseMavenTree(rawOutput: string): {
153
- pkgList?: undefined;
154
- dependenciesList?: undefined;
155
- } | {
156
- pkgList: any[];
157
- dependenciesList: {
199
+ export function parseMavenTree(rawOutput: string):
200
+ | {
201
+ pkgList?: undefined;
202
+ dependenciesList?: undefined;
203
+ }
204
+ | {
205
+ pkgList: any[];
206
+ dependenciesList: {
158
207
  ref: string;
159
208
  dependsOn: any;
160
- }[];
161
- };
209
+ }[];
210
+ };
162
211
  /**
163
212
  * Parse gradle dependencies output
164
213
  * @param {string} rawOutput Raw string output
@@ -166,23 +215,30 @@ export function parseMavenTree(rawOutput: string): {
166
215
  * @param {string} rootProjectName Root project name
167
216
  * @param {string} rootProjectVersion Root project version
168
217
  */
169
- export function parseGradleDep(rawOutput: string, rootProjectGroup?: string, rootProjectName?: string, rootProjectVersion?: string): {
170
- pkgList: {
218
+ export function parseGradleDep(
219
+ rawOutput: string,
220
+ rootProjectGroup?: string,
221
+ rootProjectName?: string,
222
+ rootProjectVersion?: string,
223
+ ):
224
+ | {
225
+ pkgList: {
171
226
  group: any;
172
227
  name: any;
173
228
  version: any;
174
229
  qualifiers: {
175
- type: string;
230
+ type: string;
176
231
  };
177
- }[];
178
- dependenciesList: {
232
+ }[];
233
+ dependenciesList: {
179
234
  ref: string;
180
235
  dependsOn: any;
181
- }[];
182
- } | {
183
- pkgList?: undefined;
184
- dependenciesList?: undefined;
185
- };
236
+ }[];
237
+ }
238
+ | {
239
+ pkgList?: undefined;
240
+ dependenciesList?: undefined;
241
+ };
186
242
  /**
187
243
  * Parse clojure cli dependencies output
188
244
  * @param {string} rawOutput Raw string output
@@ -200,8 +256,8 @@ export function parseLeinMap(node: any, keys_cache: any, deps: any): any;
200
256
  * @param {string} rawOutput Raw string output
201
257
  */
202
258
  export function parseGradleProjects(rawOutput: string): {
203
- rootProject: string;
204
- projects: any[];
259
+ rootProject: string;
260
+ projects: any[];
205
261
  };
206
262
  /**
207
263
  * Parse gradle properties output
@@ -209,13 +265,13 @@ export function parseGradleProjects(rawOutput: string): {
209
265
  * @param {string} rawOutput Raw string output
210
266
  */
211
267
  export function parseGradleProperties(rawOutput: string): {
212
- rootProject: string;
213
- projects: any[];
214
- metadata: {
215
- group: string;
216
- version: string;
217
- properties: any[];
218
- };
268
+ rootProject: string;
269
+ projects: any[];
270
+ metadata: {
271
+ group: string;
272
+ version: string;
273
+ properties: any[];
274
+ };
219
275
  };
220
276
  /**
221
277
  * Execute gradle properties command and return parsed output
@@ -224,7 +280,11 @@ export function parseGradleProperties(rawOutput: string): {
224
280
  * @param {string} rootPath Root directory
225
281
  * @param {string} subProject Sub project name
226
282
  */
227
- export function executeGradleProperties(dir: string, rootPath: string, subProject: string): {};
283
+ export function executeGradleProperties(
284
+ dir: string,
285
+ rootPath: string,
286
+ subProject: string,
287
+ ): {};
228
288
  /**
229
289
  * Parse bazel action graph output
230
290
  * @param {string} rawOutput Raw string output
@@ -262,7 +322,10 @@ export function guessLicenseId(content: any): any;
262
322
  * @param {Array} pkgList Package list
263
323
  * @param {Object} jarNSMapping Jar Namespace mapping object
264
324
  */
265
- export function getMvnMetadata(pkgList: any[], jarNSMapping?: any): Promise<any[]>;
325
+ export function getMvnMetadata(
326
+ pkgList: any[],
327
+ jarNSMapping?: any,
328
+ ): Promise<any[]>;
266
329
  /**
267
330
  * Method to compose URL of pom.xml
268
331
  *
@@ -273,7 +336,12 @@ export function getMvnMetadata(pkgList: any[], jarNSMapping?: any): Promise<any[
273
336
  *
274
337
  * @return {String} fullUrl
275
338
  */
276
- export function composePomXmlUrl({ urlPrefix, group, name, version }: string): string;
339
+ export function composePomXmlUrl({
340
+ urlPrefix,
341
+ group,
342
+ name,
343
+ version,
344
+ }: string): string;
277
345
  /**
278
346
  * Method to fetch pom.xml data and parse it to JSON
279
347
  *
@@ -284,7 +352,12 @@ export function composePomXmlUrl({ urlPrefix, group, name, version }: string): s
284
352
  *
285
353
  * @return {Object|undefined}
286
354
  */
287
- export function fetchPomXmlAsJson({ urlPrefix, group, name, version }: string): any | undefined;
355
+ export function fetchPomXmlAsJson({
356
+ urlPrefix,
357
+ group,
358
+ name,
359
+ version,
360
+ }: string): any | undefined;
288
361
  /**
289
362
  * Method to fetch pom.xml data
290
363
  *
@@ -295,7 +368,12 @@ export function fetchPomXmlAsJson({ urlPrefix, group, name, version }: string):
295
368
  *
296
369
  * @return {Promise<String>}
297
370
  */
298
- export function fetchPomXml({ urlPrefix, group, name, version }: string): Promise<string>;
371
+ export function fetchPomXml({
372
+ urlPrefix,
373
+ group,
374
+ name,
375
+ version,
376
+ }: string): Promise<string>;
299
377
  /**
300
378
  * Method extract single or multiple license entries that might appear in pom.xml
301
379
  *
@@ -312,15 +390,20 @@ export function parseLicenseEntryOrArrayFromPomXml(license: any | any[]): any[];
312
390
  *
313
391
  * @return {Promise<String>} License ID
314
392
  */
315
- export function extractLicenseCommentFromPomXml({ urlPrefix, group, name, version }: string): Promise<string>;
393
+ export function extractLicenseCommentFromPomXml({
394
+ urlPrefix,
395
+ group,
396
+ name,
397
+ version,
398
+ }: string): Promise<string>;
316
399
  /**
317
400
  * Method to parse python requires_dist attribute found in pypi setup.py
318
401
  *
319
402
  * @param requires_dist string
320
403
  */
321
404
  export function parsePyRequiresDist(dist_string: any): {
322
- name: string;
323
- version: string;
405
+ name: string;
406
+ version: string;
324
407
  };
325
408
  /**
326
409
  * Method to mimic pip version solver using node-semver
@@ -328,14 +411,20 @@ export function parsePyRequiresDist(dist_string: any): {
328
411
  * @param {Array} versionsList List of version numbers available
329
412
  * @param {*} versionSpecifiers pip version specifier
330
413
  */
331
- export function guessPypiMatchingVersion(versionsList: any[], versionSpecifiers: any): any;
414
+ export function guessPypiMatchingVersion(
415
+ versionsList: any[],
416
+ versionSpecifiers: any,
417
+ ): any;
332
418
  /**
333
419
  * Method to retrieve metadata for python packages by querying pypi
334
420
  *
335
421
  * @param {Array} pkgList Package list
336
422
  * @param {Boolean} fetchDepsInfo Fetch dependencies info from pypi
337
423
  */
338
- export function getPyMetadata(pkgList: any[], fetchDepsInfo: boolean): Promise<any[]>;
424
+ export function getPyMetadata(
425
+ pkgList: any[],
426
+ fetchDepsInfo: boolean,
427
+ ): Promise<any[]>;
339
428
  /**
340
429
  * Method to parse bdist_wheel metadata
341
430
  *
@@ -360,21 +449,30 @@ export function parsePyProjectToml(tomlFile: string): {};
360
449
  * @param {Object} lockData JSON data from poetry.lock
361
450
  * @param {string} lockFile Lock file name for evidence
362
451
  */
363
- export function parsePoetrylockData(lockData: any, lockFile: string): Promise<any[] | {
364
- pkgList: any[];
365
- rootList: any[];
366
- dependenciesList: {
452
+ export function parsePoetrylockData(
453
+ lockData: any,
454
+ lockFile: string,
455
+ ): Promise<
456
+ | any[]
457
+ | {
458
+ pkgList: any[];
459
+ rootList: any[];
460
+ dependenciesList: {
367
461
  ref: string;
368
462
  dependsOn: any[];
369
- }[];
370
- }>;
463
+ }[];
464
+ }
465
+ >;
371
466
  /**
372
467
  * Method to parse requirements.txt data
373
468
  *
374
469
  * @param {Object} reqData Requirements.txt data
375
470
  * @param {Boolean} fetchDepsInfo Fetch dependencies info from pypi
376
471
  */
377
- export function parseReqFile(reqData: any, fetchDepsInfo: boolean): Promise<any[]>;
472
+ export function parseReqFile(
473
+ reqData: any,
474
+ fetchDepsInfo: boolean,
475
+ ): Promise<any[]>;
378
476
  /**
379
477
  * Method to find python modules by parsing the imports and then checking with PyPI to obtain the latest version
380
478
  *
@@ -382,14 +480,18 @@ export function parseReqFile(reqData: any, fetchDepsInfo: boolean): Promise<any[
382
480
  * @param {Array} epkgList Existing package list
383
481
  * @returns List of packages
384
482
  */
385
- export function getPyModules(src: string, epkgList: any[], options: any): Promise<{
386
- allImports: {};
387
- pkgList: any;
388
- dependenciesList: {
389
- ref: string;
390
- dependsOn: any[];
391
- }[];
392
- modList: any;
483
+ export function getPyModules(
484
+ src: string,
485
+ epkgList: any[],
486
+ options: any,
487
+ ): Promise<{
488
+ allImports: {};
489
+ pkgList: any;
490
+ dependenciesList: {
491
+ ref: string;
492
+ dependsOn: any[];
493
+ }[];
494
+ modList: any;
393
495
  }>;
394
496
  /**
395
497
  * Method to parse setup.py data
@@ -402,7 +504,9 @@ export function parseSetupPyFile(setupPyData: any): Promise<any[]>;
402
504
  * @param {Object} repoMetadata Repo metadata with group and name
403
505
  * @return {String|undefined} github api url (or undefined - if not enough data)
404
506
  */
405
- export function repoMetadataToGitHubApiUrl(repoMetadata: any): string | undefined;
507
+ export function repoMetadataToGitHubApiUrl(
508
+ repoMetadata: any,
509
+ ): string | undefined;
406
510
  /**
407
511
  * Method to split GitHub url into its parts
408
512
  * @param {String} repoUrl Repository url
@@ -415,7 +519,10 @@ export function getGithubUrlParts(repoUrl: string): [string];
415
519
  * @param {Object} repoMetadata Object containing group and package name strings
416
520
  * @return {String|undefined} github api url (or undefined - if not a GitHub repo)
417
521
  */
418
- export function toGitHubApiUrl(repoUrl: string, repoMetadata: any): string | undefined;
522
+ export function toGitHubApiUrl(
523
+ repoUrl: string,
524
+ repoMetadata: any,
525
+ ): string | undefined;
419
526
  /**
420
527
  * Method to retrieve repo license by querying github api
421
528
  *
@@ -423,14 +530,22 @@ export function toGitHubApiUrl(repoUrl: string, repoMetadata: any): string | und
423
530
  * @param {Object} repoMetadata Object containing group and package name strings
424
531
  * @return {Promise<String>} SPDX license id
425
532
  */
426
- export function getRepoLicense(repoUrl: string, repoMetadata: any): Promise<string>;
533
+ export function getRepoLicense(
534
+ repoUrl: string,
535
+ repoMetadata: any,
536
+ ): Promise<string>;
427
537
  /**
428
538
  * Method to get go pkg license from go.dev site.
429
539
  *
430
540
  * @param {Object} repoMetadata Repo metadata
431
541
  */
432
542
  export function getGoPkgLicense(repoMetadata: any): Promise<any>;
433
- export function getGoPkgComponent(group: any, name: any, version: any, hash: any): Promise<{}>;
543
+ export function getGoPkgComponent(
544
+ group: any,
545
+ name: any,
546
+ version: any,
547
+ hash: any,
548
+ ): Promise<{}>;
434
549
  export function parseGoModData(goModData: any, gosumMap: any): Promise<any[]>;
435
550
  /**
436
551
  * Parse go list output
@@ -438,9 +553,12 @@ export function parseGoModData(goModData: any, gosumMap: any): Promise<any[]>;
438
553
  * @param {string} rawOutput Output from go list invocation
439
554
  * @returns Object with parent component and List of packages
440
555
  */
441
- export function parseGoListDep(rawOutput: string, gosumMap: any): Promise<{
442
- parentComponent: {};
443
- pkgList: {}[];
556
+ export function parseGoListDep(
557
+ rawOutput: string,
558
+ gosumMap: any,
559
+ ): Promise<{
560
+ parentComponent: {};
561
+ pkgList: {}[];
444
562
  }>;
445
563
  /**
446
564
  * Parse go mod graph
@@ -452,12 +570,18 @@ export function parseGoListDep(rawOutput: string, gosumMap: any): Promise<{
452
570
  *
453
571
  * @returns Object containing List of packages and dependencies
454
572
  */
455
- export function parseGoModGraph(rawOutput: string, goModFile: string, gosumMap: any, epkgList?: any[], parentComponent?: {}): Promise<{
456
- pkgList: any[];
457
- dependenciesList: {
458
- ref: string;
459
- dependsOn: any[];
460
- }[];
573
+ export function parseGoModGraph(
574
+ rawOutput: string,
575
+ goModFile: string,
576
+ gosumMap: any,
577
+ epkgList?: any[],
578
+ parentComponent?: {},
579
+ ): Promise<{
580
+ pkgList: any[];
581
+ dependenciesList: {
582
+ ref: string;
583
+ dependsOn: any[];
584
+ }[];
461
585
  }>;
462
586
  /**
463
587
  * Parse go mod why output
@@ -491,21 +615,28 @@ export function parseGemspecData(gemspecData: string): Promise<any[]>;
491
615
  * @param {object} gemLockData Gemfile.lock data
492
616
  * @param {string} lockFile Lock file
493
617
  */
494
- export function parseGemfileLockData(gemLockData: object, lockFile: string): Promise<any[] | {
495
- pkgList: any[];
496
- dependenciesList: {
618
+ export function parseGemfileLockData(
619
+ gemLockData: object,
620
+ lockFile: string,
621
+ ): Promise<
622
+ | any[]
623
+ | {
624
+ pkgList: any[];
625
+ dependenciesList: {
497
626
  ref: string;
498
627
  dependsOn: any[];
499
- }[];
500
- rootList?: undefined;
501
- } | {
502
- pkgList: any[];
503
- dependenciesList: {
628
+ }[];
629
+ rootList?: undefined;
630
+ }
631
+ | {
632
+ pkgList: any[];
633
+ dependenciesList: {
504
634
  ref: string;
505
635
  dependsOn: any[];
506
- }[];
507
- rootList: any[];
508
- }>;
636
+ }[];
637
+ rootList: any[];
638
+ }
639
+ >;
509
640
  /**
510
641
  * Method to retrieve metadata for rust packages by querying crates
511
642
  *
@@ -535,7 +666,10 @@ export function getDartMetadata(pkgList: any[]): Promise<any[]>;
535
666
  *
536
667
  * @returns {array} Package list
537
668
  */
538
- export function parseCargoTomlData(cargoTomlFile: string, simple?: boolean): any[];
669
+ export function parseCargoTomlData(
670
+ cargoTomlFile: string,
671
+ simple?: boolean,
672
+ ): any[];
539
673
  /**
540
674
  * Parse a Cargo.lock file to find components within the Rust project.
541
675
  *
@@ -546,19 +680,23 @@ export function parseCargoTomlData(cargoTomlFile: string, simple?: boolean): any
546
680
  */
547
681
  export function parseCargoData(cargoLockFile: string, simple?: boolean): any[];
548
682
  export function parseCargoDependencyData(cargoLockData: any): {
549
- ref: string;
550
- dependsOn: any;
683
+ ref: string;
684
+ dependsOn: any;
551
685
  }[];
552
686
  export function parseCargoAuditableData(cargoData: any): Promise<any[]>;
553
687
  export function parsePubLockData(pubLockData: any): Promise<any[]>;
554
688
  export function parsePubYamlData(pubYamlData: any): any[];
555
689
  export function parseHelmYamlData(helmData: any): any[];
556
- export function recurseImageNameLookup(keyValueObj: any, pkgList: any, imgList: any): any;
690
+ export function recurseImageNameLookup(
691
+ keyValueObj: any,
692
+ pkgList: any,
693
+ imgList: any,
694
+ ): any;
557
695
  export function parseContainerFile(fileContents: any): {
558
- image: any;
696
+ image: any;
559
697
  }[];
560
698
  export function parseBitbucketPipelinesFile(fileContents: any): {
561
- image: any;
699
+ image: any;
562
700
  }[];
563
701
  export function parseContainerSpecData(dcData: any): any[];
564
702
  export function identifyFlow(processingObj: any): string;
@@ -576,18 +714,27 @@ export function parseNupkg(nupkgFile: any): Promise<any[]>;
576
714
  export function parseNuspecData(nupkgFile: any, nuspecData: any): any[];
577
715
  export function parseCsPkgData(pkgData: any): any[];
578
716
  export function parseCsProjData(csProjData: any, projFile: any): any[];
579
- export function parseCsProjAssetsData(csProjData: any, assetsJsonFile: any): {
580
- pkgList: any[];
581
- dependenciesList: any[];
717
+ export function parseCsProjAssetsData(
718
+ csProjData: any,
719
+ assetsJsonFile: any,
720
+ ): {
721
+ pkgList: any[];
722
+ dependenciesList: any[];
582
723
  };
583
- export function parseCsPkgLockData(csLockData: any, pkgLockFile: any): {
584
- pkgList: any[];
585
- dependenciesList: any[];
586
- rootList: any[];
724
+ export function parseCsPkgLockData(
725
+ csLockData: any,
726
+ pkgLockFile: any,
727
+ ): {
728
+ pkgList: any[];
729
+ dependenciesList: any[];
730
+ rootList: any[];
587
731
  };
588
- export function parsePaketLockData(paketLockData: any, pkgLockFile: any): {
589
- pkgList: any[];
590
- dependenciesList: any[];
732
+ export function parsePaketLockData(
733
+ paketLockData: any,
734
+ pkgLockFile: any,
735
+ ): {
736
+ pkgList: any[];
737
+ dependenciesList: any[];
591
738
  };
592
739
  /**
593
740
  * Parse composer lock file
@@ -595,8 +742,13 @@ export function parsePaketLockData(paketLockData: any, pkgLockFile: any): {
595
742
  * @param {string} pkgLockFile composer.lock file
596
743
  * @param {array} rootRequires require section from composer.json
597
744
  */
598
- export function parseComposerLock(pkgLockFile: string, rootRequires: any[]): any[] | {
599
- pkgList: {
745
+ export function parseComposerLock(
746
+ pkgLockFile: string,
747
+ rootRequires: any[],
748
+ ):
749
+ | any[]
750
+ | {
751
+ pkgList: {
600
752
  group: string;
601
753
  name: string;
602
754
  purl: string;
@@ -607,26 +759,26 @@ export function parseComposerLock(pkgLockFile: string, rootRequires: any[]): any
607
759
  description: any;
608
760
  scope: string;
609
761
  properties: {
610
- name: string;
611
- value: string;
762
+ name: string;
763
+ value: string;
612
764
  }[];
613
765
  evidence: {
614
- identity: {
615
- field: string;
616
- confidence: number;
617
- methods: {
618
- technique: string;
619
- confidence: number;
620
- value: string;
621
- }[];
622
- };
766
+ identity: {
767
+ field: string;
768
+ confidence: number;
769
+ methods: {
770
+ technique: string;
771
+ confidence: number;
772
+ value: string;
773
+ }[];
774
+ };
623
775
  };
624
- }[];
625
- dependenciesList: {
776
+ }[];
777
+ dependenciesList: {
626
778
  ref: string;
627
779
  dependsOn: any[];
628
- }[];
629
- rootList: {
780
+ }[];
781
+ rootList: {
630
782
  group: string;
631
783
  name: string;
632
784
  purl: string;
@@ -637,28 +789,28 @@ export function parseComposerLock(pkgLockFile: string, rootRequires: any[]): any
637
789
  description: any;
638
790
  scope: string;
639
791
  properties: {
640
- name: string;
641
- value: string;
792
+ name: string;
793
+ value: string;
642
794
  }[];
643
795
  evidence: {
644
- identity: {
645
- field: string;
646
- confidence: number;
647
- methods: {
648
- technique: string;
649
- confidence: number;
650
- value: string;
651
- }[];
652
- };
796
+ identity: {
797
+ field: string;
798
+ confidence: number;
799
+ methods: {
800
+ technique: string;
801
+ confidence: number;
802
+ value: string;
803
+ }[];
804
+ };
653
805
  };
654
- }[];
655
- };
806
+ }[];
807
+ };
656
808
  export function parseSbtTree(sbtTreeFile: any): {
657
- pkgList: any[];
658
- dependenciesList: {
659
- ref: string;
660
- dependsOn: any;
661
- }[];
809
+ pkgList: any[];
810
+ dependenciesList: {
811
+ ref: string;
812
+ dependsOn: any;
813
+ }[];
662
814
  };
663
815
  /**
664
816
  * Parse sbt lock file
@@ -666,26 +818,26 @@ export function parseSbtTree(sbtTreeFile: any): {
666
818
  * @param {string} pkgLockFile build.sbt.lock file
667
819
  */
668
820
  export function parseSbtLock(pkgLockFile: string): {
669
- group: any;
670
- name: any;
671
- version: any;
672
- _integrity: string;
673
- scope: string;
674
- properties: {
675
- name: string;
821
+ group: any;
822
+ name: any;
823
+ version: any;
824
+ _integrity: string;
825
+ scope: string;
826
+ properties: {
827
+ name: string;
828
+ value: string;
829
+ }[];
830
+ evidence: {
831
+ identity: {
832
+ field: string;
833
+ confidence: number;
834
+ methods: {
835
+ technique: string;
836
+ confidence: number;
676
837
  value: string;
677
- }[];
678
- evidence: {
679
- identity: {
680
- field: string;
681
- confidence: number;
682
- methods: {
683
- technique: string;
684
- confidence: number;
685
- value: string;
686
- }[];
687
- };
838
+ }[];
688
839
  };
840
+ };
689
841
  }[];
690
842
  /**
691
843
  * Method to execute dpkg --listfiles to determine the files provided by a given package
@@ -730,60 +882,75 @@ export function executeEqueryList(pkgName: string): string[];
730
882
  * @param {Array} results Query Results
731
883
  * @param {Boolean} enhance Optionally enhance results by invoking additional package manager commands
732
884
  */
733
- export function convertOSQueryResults(queryCategory: any, queryObj: any, results: any[], enhance?: boolean): {
734
- name: any;
735
- group: string;
736
- version: any;
737
- description: any;
738
- publisher: any;
739
- "bom-ref": string;
740
- purl: string;
741
- scope: any;
742
- type: any;
885
+ export function convertOSQueryResults(
886
+ queryCategory: any,
887
+ queryObj: any,
888
+ results: any[],
889
+ enhance?: boolean,
890
+ ): {
891
+ name: any;
892
+ group: string;
893
+ version: any;
894
+ description: any;
895
+ publisher: any;
896
+ "bom-ref": string;
897
+ purl: string;
898
+ scope: any;
899
+ type: any;
743
900
  }[];
744
901
  /**
745
902
  * Parse swift dependency tree output json object
746
903
  * @param {string} jsonObject Swift dependencies json object
747
904
  * @param {string} pkgFile Package.swift file
748
905
  */
749
- export function parseSwiftJsonTreeObject(pkgList: any, dependenciesList: any, jsonObject: string, pkgFile: string): string;
906
+ export function parseSwiftJsonTreeObject(
907
+ pkgList: any,
908
+ dependenciesList: any,
909
+ jsonObject: string,
910
+ pkgFile: string,
911
+ ): string;
750
912
  /**
751
913
  * Parse swift dependency tree output
752
914
  * @param {string} rawOutput Swift dependencies json output
753
915
  * @param {string} pkgFile Package.swift file
754
916
  */
755
- export function parseSwiftJsonTree(rawOutput: string, pkgFile: string): {
756
- pkgList?: undefined;
757
- dependenciesList?: undefined;
758
- } | {
759
- pkgList: any[];
760
- dependenciesList: any[];
761
- };
917
+ export function parseSwiftJsonTree(
918
+ rawOutput: string,
919
+ pkgFile: string,
920
+ ):
921
+ | {
922
+ pkgList?: undefined;
923
+ dependenciesList?: undefined;
924
+ }
925
+ | {
926
+ pkgList: any[];
927
+ dependenciesList: any[];
928
+ };
762
929
  /**
763
930
  * Parse swift package resolved file
764
931
  * @param {string} resolvedFile Package.resolved file
765
932
  */
766
933
  export function parseSwiftResolved(resolvedFile: string): {
934
+ name: string;
935
+ group: string;
936
+ version: string;
937
+ purl: string;
938
+ "bom-ref": string;
939
+ properties: {
767
940
  name: string;
768
- group: string;
769
- version: string;
770
- purl: string;
771
- "bom-ref": string;
772
- properties: {
773
- name: string;
941
+ value: string;
942
+ }[];
943
+ evidence: {
944
+ identity: {
945
+ field: string;
946
+ confidence: number;
947
+ methods: {
948
+ technique: string;
949
+ confidence: number;
774
950
  value: string;
775
- }[];
776
- evidence: {
777
- identity: {
778
- field: string;
779
- confidence: number;
780
- methods: {
781
- technique: string;
782
- confidence: number;
783
- value: string;
784
- }[];
785
- };
951
+ }[];
786
952
  };
953
+ };
787
954
  }[];
788
955
  /**
789
956
  * Collect maven dependencies
@@ -793,8 +960,18 @@ export function parseSwiftResolved(resolvedFile: string): {
793
960
  * @param {boolean} cleanup Remove temporary directories
794
961
  * @param {boolean} includeCacheDir Include maven and gradle cache directories
795
962
  */
796
- export function collectMvnDependencies(mavenCmd: string, basePath: string, cleanup?: boolean, includeCacheDir?: boolean): Promise<{}>;
797
- export function collectGradleDependencies(gradleCmd: any, basePath: any, cleanup?: boolean, includeCacheDir?: boolean): Promise<{}>;
963
+ export function collectMvnDependencies(
964
+ mavenCmd: string,
965
+ basePath: string,
966
+ cleanup?: boolean,
967
+ includeCacheDir?: boolean,
968
+ ): Promise<{}>;
969
+ export function collectGradleDependencies(
970
+ gradleCmd: any,
971
+ basePath: any,
972
+ cleanup?: boolean,
973
+ includeCacheDir?: boolean,
974
+ ): Promise<{}>;
798
975
  /**
799
976
  * Method to collect class names from all jars in a directory
800
977
  *
@@ -805,35 +982,35 @@ export function collectGradleDependencies(gradleCmd: any, basePath: any, cleanup
805
982
  */
806
983
  export function collectJarNS(jarPath: string, pomPathMap?: object): Promise<{}>;
807
984
  export function convertJarNSToPackages(jarNSMapping: any): {
808
- name: any;
809
- group: any;
810
- version: any;
811
- description: any;
812
- purl: string;
813
- "bom-ref": string;
814
- evidence: {
815
- identity: {
816
- field: string;
817
- confidence: number;
818
- methods: {
819
- technique: string;
820
- confidence: number;
821
- value: any;
822
- }[];
823
- };
824
- };
825
- properties: {
826
- name: string;
985
+ name: any;
986
+ group: any;
987
+ version: any;
988
+ description: any;
989
+ purl: string;
990
+ "bom-ref": string;
991
+ evidence: {
992
+ identity: {
993
+ field: string;
994
+ confidence: number;
995
+ methods: {
996
+ technique: string;
997
+ confidence: number;
827
998
  value: any;
828
- }[];
999
+ }[];
1000
+ };
1001
+ };
1002
+ properties: {
1003
+ name: string;
1004
+ value: any;
1005
+ }[];
829
1006
  }[];
830
1007
  export function parsePomXml(pomXmlData: any): {
831
- artifactId: any;
832
- groupId: any;
833
- version: any;
834
- description: any;
835
- url: any;
836
- scm: any;
1008
+ artifactId: any;
1009
+ groupId: any;
1010
+ version: any;
1011
+ description: any;
1012
+ url: any;
1013
+ scm: any;
837
1014
  };
838
1015
  export function parseJarManifest(jarMetadata: any): {};
839
1016
  export function parsePomProperties(pomProperties: any): {};
@@ -862,7 +1039,11 @@ export function checksumFile(hashName: string, path: string): Promise<string>;
862
1039
  *
863
1040
  * @return pkgList Package list
864
1041
  */
865
- export function extractJarArchive(jarFile: string, tempDir: string, jarNSMapping?: object): Promise<any[]>;
1042
+ export function extractJarArchive(
1043
+ jarFile: string,
1044
+ tempDir: string,
1045
+ jarNSMapping?: object,
1046
+ ): Promise<any[]>;
866
1047
  /**
867
1048
  * Determine the version of SBT used in compilation of this project.
868
1049
  * By default it looks into a standard SBT location i.e.
@@ -892,7 +1073,10 @@ export function addPlugin(projectPath: string, plugin: string): string;
892
1073
  * @param {string} projectPath Path to the SBT project
893
1074
  * @param {string} originalPluginsFile Location of the original plugins file, if any
894
1075
  */
895
- export function cleanupPlugin(projectPath: string, originalPluginsFile: string): boolean;
1076
+ export function cleanupPlugin(
1077
+ projectPath: string,
1078
+ originalPluginsFile: string,
1079
+ ): boolean;
896
1080
  /**
897
1081
  * Returns a default location of the plugins file.
898
1082
  *
@@ -908,7 +1092,11 @@ export function sbtPluginsPath(projectPath: string): string;
908
1092
  *
909
1093
  * @returns File contents
910
1094
  */
911
- export function readZipEntry(zipFile: string, filePattern: string, contentEncoding?: string): Promise<any>;
1095
+ export function readZipEntry(
1096
+ zipFile: string,
1097
+ filePattern: string,
1098
+ contentEncoding?: string,
1099
+ ): Promise<any>;
912
1100
  /**
913
1101
  * Method to get the classes and relevant sources in a jar file
914
1102
  *
@@ -945,7 +1133,12 @@ export function executeAtom(src: any, args: any): boolean;
945
1133
  * @param {string} slicesFile
946
1134
  * @returns List of imported modules
947
1135
  */
948
- export function findAppModules(src: string, language: string, methodology?: string, slicesFile?: string): any;
1136
+ export function findAppModules(
1137
+ src: string,
1138
+ language: string,
1139
+ methodology?: string,
1140
+ slicesFile?: string,
1141
+ ): any;
949
1142
  /**
950
1143
  * Execute pip freeze by creating a virtual env in a temp directory and construct the dependency tree
951
1144
  *
@@ -954,39 +1147,43 @@ export function findAppModules(src: string, language: string, methodology?: stri
954
1147
  * @param {string} tempVenvDir Temp venv dir
955
1148
  * @returns List of packages from the virtual env
956
1149
  */
957
- export function getPipFrozenTree(basePath: string, reqOrSetupFile: string, tempVenvDir: string): {
958
- pkgList: {
959
- name: any;
960
- version: any;
961
- purl: string;
962
- "bom-ref": string;
963
- evidence: {
964
- identity: {
965
- field: string;
966
- confidence: number;
967
- methods: {
968
- technique: string;
969
- confidence: number;
970
- value: any;
971
- }[];
972
- };
973
- };
974
- }[];
975
- rootList: {
976
- name: any;
977
- version: any;
978
- }[];
979
- dependenciesList: {
980
- ref: string;
981
- dependsOn: any;
982
- }[];
983
- frozen: boolean;
1150
+ export function getPipFrozenTree(
1151
+ basePath: string,
1152
+ reqOrSetupFile: string,
1153
+ tempVenvDir: string,
1154
+ ): {
1155
+ pkgList: {
1156
+ name: any;
1157
+ version: any;
1158
+ purl: string;
1159
+ "bom-ref": string;
1160
+ evidence: {
1161
+ identity: {
1162
+ field: string;
1163
+ confidence: number;
1164
+ methods: {
1165
+ technique: string;
1166
+ confidence: number;
1167
+ value: any;
1168
+ }[];
1169
+ };
1170
+ };
1171
+ }[];
1172
+ rootList: {
1173
+ name: any;
1174
+ version: any;
1175
+ }[];
1176
+ dependenciesList: {
1177
+ ref: string;
1178
+ dependsOn: any;
1179
+ }[];
1180
+ frozen: boolean;
984
1181
  };
985
1182
  export function parsePackageJsonName(name: any): {
986
- scope: any;
987
- fullName: string;
988
- projectName: string;
989
- moduleName: string;
1183
+ scope: any;
1184
+ fullName: string;
1185
+ projectName: string;
1186
+ moduleName: string;
990
1187
  };
991
1188
  /**
992
1189
  * Method to add occurrence evidence for components based on import statements. Currently useful for js
@@ -995,19 +1192,32 @@ export function parsePackageJsonName(name: any): {
995
1192
  * @param {object} allImports Import statements object with package name as key and an object with file and location details
996
1193
  * @param {object} allExports Exported modules if available from node_modules
997
1194
  */
998
- export function addEvidenceForImports(pkgList: any[], allImports: object, allExports: object, deep: any): Promise<any[]>;
1195
+ export function addEvidenceForImports(
1196
+ pkgList: any[],
1197
+ allImports: object,
1198
+ allExports: object,
1199
+ deep: any,
1200
+ ): Promise<any[]>;
999
1201
  export function componentSorter(a: any, b: any): any;
1000
- export function parseCmakeDotFile(dotFile: any, pkgType: any, options?: {}): {
1001
- parentComponent: {};
1002
- pkgList: any[];
1003
- dependenciesList: {
1004
- ref: string;
1005
- dependsOn: any[];
1006
- }[];
1202
+ export function parseCmakeDotFile(
1203
+ dotFile: any,
1204
+ pkgType: any,
1205
+ options?: {},
1206
+ ): {
1207
+ parentComponent: {};
1208
+ pkgList: any[];
1209
+ dependenciesList: {
1210
+ ref: string;
1211
+ dependsOn: any[];
1212
+ }[];
1007
1213
  };
1008
- export function parseCmakeLikeFile(cmakeListFile: any, pkgType: any, options?: {}): {
1009
- parentComponent: {};
1010
- pkgList: any[];
1214
+ export function parseCmakeLikeFile(
1215
+ cmakeListFile: any,
1216
+ pkgType: any,
1217
+ options?: {},
1218
+ ): {
1219
+ parentComponent: {};
1220
+ pkgList: any[];
1011
1221
  };
1012
1222
  export function getOSPackageForFile(afile: any, osPkgsList: any): any;
1013
1223
  /**
@@ -1018,13 +1228,18 @@ export function getOSPackageForFile(afile: any, osPkgsList: any): any;
1018
1228
  * @param {array} osPkgsList Array of OS pacakges represented as components
1019
1229
  * @param {array} epkgList Existing packages list
1020
1230
  */
1021
- export function getCppModules(src: string, options: object, osPkgsList: any[], epkgList: any[]): {
1022
- parentComponent: {};
1023
- pkgList: any[];
1024
- dependenciesList: {
1025
- ref: any;
1026
- dependsOn: any[];
1027
- }[];
1231
+ export function getCppModules(
1232
+ src: string,
1233
+ options: object,
1234
+ osPkgsList: any[],
1235
+ epkgList: any[],
1236
+ ): {
1237
+ parentComponent: {};
1238
+ pkgList: any[];
1239
+ dependenciesList: {
1240
+ ref: any;
1241
+ dependsOn: any[];
1242
+ }[];
1028
1243
  };
1029
1244
  /**
1030
1245
  * NOT IMPLEMENTED YET.
@@ -1040,9 +1255,12 @@ export function parseCUsageSlice(sliceData: any): {};
1040
1255
  *
1041
1256
  * @param {Array} pkgList Package list
1042
1257
  */
1043
- export function getNugetMetadata(pkgList: any[], dependencies?: any): Promise<{
1044
- pkgList: any[];
1045
- dependencies: any[];
1258
+ export function getNugetMetadata(
1259
+ pkgList: any[],
1260
+ dependencies?: any,
1261
+ ): Promise<{
1262
+ pkgList: any[];
1263
+ dependencies: any[];
1046
1264
  }>;
1047
1265
  export function addEvidenceForDotnet(pkgList: any, slicesFile: any): any;
1048
1266
  export const dirNameStr: string;
@@ -1072,4 +1290,4 @@ export let LEIN_CMD: string;
1072
1290
  export let SWIFT_CMD: string;
1073
1291
  export const cdxgenAgent: any;
1074
1292
  export const RUBY_PLATFORM_PREFIXES: string[];
1075
- //# sourceMappingURL=utils.d.ts.map
1293
+ //# sourceMappingURL=utils.d.ts.map