snyk 1.1135.0 → 1.1137.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/95.index.js +59 -48
- package/dist/cli/95.index.js.map +1 -1
- package/dist/cli/thirdPartyNotice.json +2 -2
- package/help/cli-commands/README.md +1 -1
- package/help/cli-commands/code-test.md +1 -1
- package/help/cli-commands/iac-capture.md +84 -0
- package/help/cli-commands/iac-describe.md +1 -1
- package/help/cli-commands/iac.md +3 -2
- package/help/cli-commands/monitor.md +3 -3
- package/help/cli-commands/sbom.md +1 -1
- package/help/cli-commands/test.md +1 -1
- package/package.json +1 -1
- package/src/generated/sha256sums.txt +10 -10
- package/src/generated/version +1 -1
- package/wrapper_dist/generated/sha256sums.txt +10 -10
- package/wrapper_dist/generated/version +1 -1
package/dist/cli/95.index.js
CHANGED
|
@@ -153984,6 +153984,7 @@ const dep_graph_1 = __webpack_require__(53789);
|
|
|
153984
153984
|
const util_1 = __webpack_require__(46200);
|
|
153985
153985
|
const errors_1 = __webpack_require__(1706);
|
|
153986
153986
|
const parsers_1 = __webpack_require__(75873);
|
|
153987
|
+
const semver = __webpack_require__(50460);
|
|
153987
153988
|
const micromatch = __webpack_require__(65465);
|
|
153988
153989
|
const pathUtil = __webpack_require__(85622);
|
|
153989
153990
|
const parseNpmLockV2Project = (pkgJsonContent, pkgLockContent, options) => {
|
|
@@ -154057,7 +154058,7 @@ const dfsVisit = (depGraphBuilder, node, visitedMap, npmLockPkgs, strictOutOfSyn
|
|
|
154057
154058
|
}
|
|
154058
154059
|
};
|
|
154059
154060
|
const getChildNode = (name, depInfo, pkgs, strictOutOfSync, includeDevDeps, includeOptionalDeps, ancestry, pkgKeysByName) => {
|
|
154060
|
-
let childNodeKey = (0, exports.getChildNodeKey)(name, ancestry, pkgs, pkgKeysByName);
|
|
154061
|
+
let childNodeKey = (0, exports.getChildNodeKey)(name, depInfo.version, ancestry, pkgs, pkgKeysByName);
|
|
154061
154062
|
if (!childNodeKey) {
|
|
154062
154063
|
if (strictOutOfSync) {
|
|
154063
154064
|
throw new errors_1.OutOfSyncError(`${name}@${depInfo.version}`, parsers_1.LockfileType.npm);
|
|
@@ -154106,55 +154107,62 @@ const getChildNode = (name, depInfo, pkgs, strictOutOfSync, includeDevDeps, incl
|
|
|
154106
154107
|
key: childNodeKey,
|
|
154107
154108
|
};
|
|
154108
154109
|
};
|
|
154109
|
-
const getChildNodeKey = (name, ancestry, pkgs, pkgKeysByName) => {
|
|
154110
|
+
const getChildNodeKey = (name, version, ancestry, pkgs, pkgKeysByName) => {
|
|
154111
|
+
// This is a list of all our possible options for the childKey
|
|
154110
154112
|
const candidateKeys = pkgKeysByName.get(name);
|
|
154111
154113
|
// Lockfile missing entry
|
|
154112
154114
|
if (!candidateKeys) {
|
|
154113
154115
|
return undefined;
|
|
154114
154116
|
}
|
|
154115
|
-
//
|
|
154117
|
+
// If we only have one candidate then we just take it
|
|
154116
154118
|
if (candidateKeys.length === 1) {
|
|
154117
154119
|
return candidateKeys[0];
|
|
154118
154120
|
}
|
|
154119
|
-
// If we are
|
|
154120
|
-
|
|
154121
|
-
|
|
154122
|
-
|
|
154123
|
-
|
|
154124
|
-
|
|
154125
|
-
|
|
154126
|
-
|
|
154127
|
-
|
|
154128
|
-
|
|
154129
|
-
|
|
154130
|
-
|
|
154121
|
+
// If we are bundled we assume we are scoped by the bundle root at least
|
|
154122
|
+
// otherwise the ancestry root is the root ignoring the true root
|
|
154123
|
+
const isBundled = ancestry[ancestry.length - 1].inBundle;
|
|
154124
|
+
const rootOperatingIdx = isBundled
|
|
154125
|
+
? ancestry.findIndex((el) => el.inBundle === true) - 1
|
|
154126
|
+
: 1;
|
|
154127
|
+
const ancestryFromRootOperatingIdx = [
|
|
154128
|
+
...ancestry.slice(rootOperatingIdx).map((el) => el.name),
|
|
154129
|
+
name,
|
|
154130
|
+
];
|
|
154131
|
+
// We filter on a number of cases
|
|
154132
|
+
let filteredCandidates = candidateKeys.filter((candidate) => {
|
|
154133
|
+
// This is splitting the candidate that looks like
|
|
154134
|
+
// `node_modules/a/node_modules/b` into ["a", "b"]
|
|
154135
|
+
// To do this we remove the first node_modules substring
|
|
154136
|
+
// and then split on the rest
|
|
154137
|
+
const candidateAncestry = candidate
|
|
154138
|
+
.replace('node_modules/', '')
|
|
154139
|
+
.split('/node_modules/');
|
|
154140
|
+
// Check the ancestry of the candidate is a subset of
|
|
154141
|
+
// the current pkg. If it is not then it can't be a
|
|
154142
|
+
// valid key.
|
|
154143
|
+
const isCandidateAncestryIsSubsetOfPkgAncestry = candidateAncestry.every((pkg) => {
|
|
154144
|
+
return ancestryFromRootOperatingIdx.includes(pkg);
|
|
154131
154145
|
});
|
|
154132
|
-
if (
|
|
154133
|
-
return
|
|
154134
|
-
}
|
|
154135
|
-
|
|
154136
|
-
|
|
154137
|
-
|
|
154138
|
-
|
|
154139
|
-
|
|
154140
|
-
|
|
154141
|
-
// Here we go through parents keys to see if any are the branch point
|
|
154142
|
-
// we could have done this sooner but the above work as good short circuits
|
|
154143
|
-
let keysFilteredByParentKey = onlyLongestKeys;
|
|
154144
|
-
const reversedAncestry = ancestry.reverse();
|
|
154145
|
-
for (let parentIndex = 0; parentIndex < reversedAncestry.length; parentIndex++) {
|
|
154146
|
-
const parentKey = reversedAncestry[parentIndex].key;
|
|
154147
|
-
const possibleFilteredKeys = keysFilteredByParentKey.filter((key) => key.includes(parentKey));
|
|
154148
|
-
if (possibleFilteredKeys.length === 1) {
|
|
154149
|
-
return possibleFilteredKeys[0];
|
|
154150
|
-
}
|
|
154151
|
-
if (possibleFilteredKeys.length === 0) {
|
|
154152
|
-
continue;
|
|
154146
|
+
if (isCandidateAncestryIsSubsetOfPkgAncestry === false) {
|
|
154147
|
+
return false;
|
|
154148
|
+
}
|
|
154149
|
+
// If we are bundled we assume the bundle root is the first value
|
|
154150
|
+
// in the candidates scoping
|
|
154151
|
+
if (isBundled) {
|
|
154152
|
+
const doesBundledPkgShareBundleRoot = candidateAncestry[0] === ancestryFromRootOperatingIdx[0];
|
|
154153
|
+
if (doesBundledPkgShareBundleRoot === false) {
|
|
154154
|
+
return false;
|
|
154153
154155
|
}
|
|
154154
|
-
keysFilteredByParentKey = possibleFilteredKeys;
|
|
154155
154156
|
}
|
|
154157
|
+
// So now we can check semver to filter out some values
|
|
154158
|
+
const candidatePkgVersion = pkgs[candidate].version;
|
|
154159
|
+
const doesVersionSatisfySemver = semver.satisfies(candidatePkgVersion, version);
|
|
154160
|
+
return doesVersionSatisfySemver;
|
|
154161
|
+
});
|
|
154162
|
+
if (filteredCandidates.length === 1) {
|
|
154163
|
+
return filteredCandidates[0];
|
|
154156
154164
|
}
|
|
154157
|
-
|
|
154165
|
+
const ancestry_names = ancestry.map((el) => el.name).concat(name);
|
|
154158
154166
|
while (ancestry_names.length > 0) {
|
|
154159
154167
|
const possible_key = `node_modules/${ancestry_names.join('/node_modules/')}`;
|
|
154160
154168
|
if (pkgs[possible_key]) {
|
|
@@ -154162,16 +154170,19 @@ const getChildNodeKey = (name, ancestry, pkgs, pkgKeysByName) => {
|
|
|
154162
154170
|
}
|
|
154163
154171
|
ancestry_names.shift();
|
|
154164
154172
|
}
|
|
154165
|
-
//
|
|
154166
|
-
|
|
154167
|
-
const
|
|
154168
|
-
|
|
154169
|
-
|
|
154170
|
-
|
|
154171
|
-
|
|
154172
|
-
|
|
154173
|
-
|
|
154174
|
-
|
|
154173
|
+
// Here we go through th eancestry backwards to find the nearest
|
|
154174
|
+
// ancestor package
|
|
154175
|
+
const reversedAncestry = ancestry.reverse();
|
|
154176
|
+
for (let parentIndex = 0; parentIndex < reversedAncestry.length; parentIndex++) {
|
|
154177
|
+
const parentKey = reversedAncestry[parentIndex].key;
|
|
154178
|
+
const possibleFilteredKeys = filteredCandidates.filter((key) => key.includes(parentKey));
|
|
154179
|
+
if (possibleFilteredKeys.length === 1) {
|
|
154180
|
+
return possibleFilteredKeys[0];
|
|
154181
|
+
}
|
|
154182
|
+
if (possibleFilteredKeys.length === 0) {
|
|
154183
|
+
continue;
|
|
154184
|
+
}
|
|
154185
|
+
filteredCandidates = possibleFilteredKeys;
|
|
154175
154186
|
}
|
|
154176
154187
|
return undefined;
|
|
154177
154188
|
};
|