@socketsecurity/cli 0.14.31 → 0.14.33
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.
|
@@ -43,7 +43,7 @@ var arborist = {};
|
|
|
43
43
|
var ttyServer$1 = {};
|
|
44
44
|
|
|
45
45
|
var name = "@socketsecurity/cli";
|
|
46
|
-
var version = "0.14.
|
|
46
|
+
var version = "0.14.33";
|
|
47
47
|
var description = "CLI tool for Socket.dev";
|
|
48
48
|
var homepage = "http://github.com/SocketDev/socket-cli";
|
|
49
49
|
var license = "MIT";
|
|
@@ -883,20 +883,16 @@ async function getPackagesAlerts(safeArb, _registry, pkgs, output) {
|
|
|
883
883
|
});
|
|
884
884
|
// Before we ask about problematic issues, check to see if they
|
|
885
885
|
// already existed in the old version if they did, be quiet.
|
|
886
|
-
const
|
|
887
|
-
if (
|
|
886
|
+
const existing = pkgs.find(p => p.existing?.startsWith(`${name}@`))?.existing;
|
|
887
|
+
if (existing) {
|
|
888
888
|
const oldArtifact =
|
|
889
889
|
// eslint-disable-next-line no-await-in-loop
|
|
890
|
-
(await batchScan([
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
// oldIssue => oldIssue.type === type
|
|
897
|
-
// ) === undefined
|
|
898
|
-
// )
|
|
899
|
-
// }
|
|
890
|
+
(await batchScan([existing]).next()).value;
|
|
891
|
+
if (oldArtifact?.alerts?.length) {
|
|
892
|
+
alerts = alerts.filter(({
|
|
893
|
+
type
|
|
894
|
+
}) => !oldArtifact.alerts?.find(a => a.type === type));
|
|
895
|
+
}
|
|
900
896
|
}
|
|
901
897
|
}
|
|
902
898
|
}
|
|
@@ -959,23 +955,31 @@ function walk(diff_, needInfoOn = []) {
|
|
|
959
955
|
if (!diff) {
|
|
960
956
|
continue;
|
|
961
957
|
}
|
|
962
|
-
|
|
963
|
-
|
|
958
|
+
const {
|
|
959
|
+
action
|
|
960
|
+
} = diff;
|
|
961
|
+
if (action) {
|
|
962
|
+
const oldNode = diff.actual;
|
|
963
|
+
const oldPkgid = oldNode?.pkgid;
|
|
964
|
+
const pkgNode = diff.ideal;
|
|
965
|
+
const pkgid = pkgNode?.pkgid;
|
|
966
|
+
let existing;
|
|
964
967
|
let keep = false;
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
if (!sameVersion) {
|
|
968
|
-
existing = diff.actual.pkgid;
|
|
968
|
+
if (action === 'CHANGE') {
|
|
969
|
+
if (pkgNode?.package.version !== oldNode?.package.version) {
|
|
969
970
|
keep = true;
|
|
971
|
+
if (oldNode?.package.name && oldNode.package.name === pkgNode?.package.name) {
|
|
972
|
+
existing = oldPkgid;
|
|
973
|
+
}
|
|
970
974
|
}
|
|
971
975
|
} else {
|
|
972
|
-
keep =
|
|
976
|
+
keep = action !== 'REMOVE';
|
|
973
977
|
}
|
|
974
|
-
if (keep &&
|
|
978
|
+
if (keep && pkgid && pkgNode.resolved && (!oldNode || oldNode.resolved)) {
|
|
975
979
|
needInfoOn.push({
|
|
976
980
|
existing,
|
|
977
|
-
pkgid
|
|
978
|
-
repository_url: toRepoUrl(
|
|
981
|
+
pkgid,
|
|
982
|
+
repository_url: toRepoUrl(pkgNode.resolved)
|
|
979
983
|
});
|
|
980
984
|
}
|
|
981
985
|
}
|
|
@@ -42,7 +42,7 @@ var arborist = {};
|
|
|
42
42
|
var ttyServer$1 = {};
|
|
43
43
|
|
|
44
44
|
var name = "@socketsecurity/cli";
|
|
45
|
-
var version = "0.14.
|
|
45
|
+
var version = "0.14.33";
|
|
46
46
|
var description = "CLI tool for Socket.dev";
|
|
47
47
|
var homepage = "http://github.com/SocketDev/socket-cli";
|
|
48
48
|
var license = "MIT";
|
|
@@ -882,20 +882,16 @@ async function getPackagesAlerts(safeArb, _registry, pkgs, output) {
|
|
|
882
882
|
});
|
|
883
883
|
// Before we ask about problematic issues, check to see if they
|
|
884
884
|
// already existed in the old version if they did, be quiet.
|
|
885
|
-
const
|
|
886
|
-
if (
|
|
885
|
+
const existing = pkgs.find(p => p.existing?.startsWith(`${name}@`))?.existing;
|
|
886
|
+
if (existing) {
|
|
887
887
|
const oldArtifact =
|
|
888
888
|
// eslint-disable-next-line no-await-in-loop
|
|
889
|
-
(await batchScan([
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
// oldIssue => oldIssue.type === type
|
|
896
|
-
// ) === undefined
|
|
897
|
-
// )
|
|
898
|
-
// }
|
|
889
|
+
(await batchScan([existing]).next()).value;
|
|
890
|
+
if (oldArtifact?.alerts?.length) {
|
|
891
|
+
alerts = alerts.filter(({
|
|
892
|
+
type
|
|
893
|
+
}) => !oldArtifact.alerts?.find(a => a.type === type));
|
|
894
|
+
}
|
|
899
895
|
}
|
|
900
896
|
}
|
|
901
897
|
}
|
|
@@ -958,23 +954,31 @@ function walk(diff_, needInfoOn = []) {
|
|
|
958
954
|
if (!diff) {
|
|
959
955
|
continue;
|
|
960
956
|
}
|
|
961
|
-
|
|
962
|
-
|
|
957
|
+
const {
|
|
958
|
+
action
|
|
959
|
+
} = diff;
|
|
960
|
+
if (action) {
|
|
961
|
+
const oldNode = diff.actual;
|
|
962
|
+
const oldPkgid = oldNode?.pkgid;
|
|
963
|
+
const pkgNode = diff.ideal;
|
|
964
|
+
const pkgid = pkgNode?.pkgid;
|
|
965
|
+
let existing;
|
|
963
966
|
let keep = false;
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
if (!sameVersion) {
|
|
967
|
-
existing = diff.actual.pkgid;
|
|
967
|
+
if (action === 'CHANGE') {
|
|
968
|
+
if (pkgNode?.package.version !== oldNode?.package.version) {
|
|
968
969
|
keep = true;
|
|
970
|
+
if (oldNode?.package.name && oldNode.package.name === pkgNode?.package.name) {
|
|
971
|
+
existing = oldPkgid;
|
|
972
|
+
}
|
|
969
973
|
}
|
|
970
974
|
} else {
|
|
971
|
-
keep =
|
|
975
|
+
keep = action !== 'REMOVE';
|
|
972
976
|
}
|
|
973
|
-
if (keep &&
|
|
977
|
+
if (keep && pkgid && pkgNode.resolved && (!oldNode || oldNode.resolved)) {
|
|
974
978
|
needInfoOn.push({
|
|
975
979
|
existing,
|
|
976
|
-
pkgid
|
|
977
|
-
repository_url: toRepoUrl(
|
|
980
|
+
pkgid,
|
|
981
|
+
repository_url: toRepoUrl(pkgNode.resolved)
|
|
978
982
|
});
|
|
979
983
|
}
|
|
980
984
|
}
|