snyk 1.1037.0 → 1.1038.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/dist/cli/917.index.js
CHANGED
|
@@ -4543,15 +4543,15 @@ exports.test = test;
|
|
|
4543
4543
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4544
4544
|
exports.convertEngineToJsonResults = void 0;
|
|
4545
4545
|
const path = __webpack_require__(85622);
|
|
4546
|
-
const format_test_results_1 = __webpack_require__(59744);
|
|
4547
4546
|
const constants_1 = __webpack_require__(68620);
|
|
4547
|
+
const iac_test_result_1 = __webpack_require__(46816);
|
|
4548
4548
|
function convertEngineToJsonResults({ results, projectName, }) {
|
|
4549
4549
|
const vulnerabilityGroups = groupVulnerabilitiesByFile(results); // all vulns groups by file
|
|
4550
4550
|
const resourceGroups = groupResourcesByFile(results); // all resources grouped by file
|
|
4551
4551
|
const filesWithoutIssues = findFilesWithoutIssues(resourceGroups, vulnerabilityGroups); // all resources without issues grouped by file
|
|
4552
4552
|
const output = [];
|
|
4553
4553
|
if (results.errors) {
|
|
4554
|
-
output.push(...
|
|
4554
|
+
output.push(...results.errors.map((e) => iac_test_result_1.mapIacTestError(e)));
|
|
4555
4555
|
}
|
|
4556
4556
|
for (const [file, resources] of Object.entries(filesWithoutIssues)) {
|
|
4557
4557
|
output.push(resourcesToResult(results, projectName, file, resources));
|
|
@@ -5729,17 +5729,14 @@ exports.getPackageJsonPathsContainingSnykDependency = getPackageJsonPathsContain
|
|
|
5729
5729
|
"use strict";
|
|
5730
5730
|
|
|
5731
5731
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5732
|
-
exports.mapIacIssue = exports.mapIacTestResult = void 0;
|
|
5732
|
+
exports.mapIacIssue = exports.mapIacTestError = exports.mapIacTestResult = void 0;
|
|
5733
5733
|
const pick = __webpack_require__(25030);
|
|
5734
|
+
const errors_1 = __webpack_require__(55191);
|
|
5734
5735
|
const IAC_ISSUES_KEY = 'infrastructureAsCodeIssues';
|
|
5735
5736
|
function mapIacTestResult(iacTest) {
|
|
5736
5737
|
var _a;
|
|
5737
|
-
if (iacTest instanceof
|
|
5738
|
-
return
|
|
5739
|
-
ok: false,
|
|
5740
|
-
error: iacTest.message,
|
|
5741
|
-
path: iacTest.path,
|
|
5742
|
-
};
|
|
5738
|
+
if (iacTest instanceof errors_1.CustomError) {
|
|
5739
|
+
return mapIacTestError(iacTest);
|
|
5743
5740
|
}
|
|
5744
5741
|
const infrastructureAsCodeIssues = ((_a = iacTest === null || iacTest === void 0 ? void 0 : iacTest.result) === null || _a === void 0 ? void 0 : _a.cloudConfigResults.map(mapIacIssue)) || [];
|
|
5745
5742
|
const { result: { projectType }, ...filteredIacTest } = iacTest;
|
|
@@ -5751,6 +5748,15 @@ function mapIacTestResult(iacTest) {
|
|
|
5751
5748
|
};
|
|
5752
5749
|
}
|
|
5753
5750
|
exports.mapIacTestResult = mapIacTestResult;
|
|
5751
|
+
function mapIacTestError(error) {
|
|
5752
|
+
return {
|
|
5753
|
+
ok: false,
|
|
5754
|
+
code: error.code,
|
|
5755
|
+
error: error.message,
|
|
5756
|
+
path: error.path,
|
|
5757
|
+
};
|
|
5758
|
+
}
|
|
5759
|
+
exports.mapIacTestError = mapIacTestError;
|
|
5754
5760
|
function mapIacIssue(iacIssue) {
|
|
5755
5761
|
// filters out & renames properties we're getting from registry and don't need for the JSON output.
|
|
5756
5762
|
return {
|