cve-lite-cli 1.26.0-beta.1 → 1.27.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.
@@ -140,3 +140,14 @@ export function isLikelyBlockedAdvisoryRequestError(message) {
140
140
  }
141
141
  return /^(401|403|407|408|451)\b/.test(finalCause);
142
142
  }
143
+ export function getNetworkErrorHint(error, errorMessage) {
144
+ if (isSslCertificateError(error))
145
+ return sslCertificateErrorHint();
146
+ if (isRateLimitError(errorMessage))
147
+ return rateLimitAdvisoryRequestHint();
148
+ if (isServerError(errorMessage))
149
+ return serverAdvisoryRequestHint();
150
+ if (isLikelyBlockedAdvisoryRequestError(errorMessage))
151
+ return blockedAdvisoryRequestHint();
152
+ return fetchErrorCaCertHint();
153
+ }
@@ -0,0 +1,4 @@
1
+ import { createHash } from "node:crypto";
2
+ export function sarifFingerprintHash(key) {
3
+ return createHash("sha256").update(key).digest("hex").slice(0, 16);
4
+ }
@@ -1,5 +1,11 @@
1
1
  import { chalk } from "./chalk.js";
2
+ import { severityOrder } from "../constants.js";
3
+ import { normalizeSeverity } from "../osv/severity.js";
2
4
  export const SEVERITY_ORDER = ["critical", "high", "medium", "low", "unknown", "none"];
5
+ export function reachesFailOn(findings, failOn) {
6
+ const failLevel = normalizeSeverity(failOn);
7
+ return findings.some((f) => severityOrder[f.severity] >= severityOrder[failLevel]);
8
+ }
3
9
  export function formatSeverityLabel(severity) {
4
10
  const lower = severity.toLowerCase();
5
11
  if (lower === "critical")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cve-lite-cli",
3
- "version": "1.26.0-beta.1",
3
+ "version": "1.27.0",
4
4
  "description": "Developer-friendly CLI for scanning JS/TS projects for dependency vulnerabilities using local lockfiles and OSV",
5
5
  "type": "module",
6
6
  "bin": {
@@ -15,6 +15,7 @@
15
15
  "lint:tests": "node scripts/check-test-hygiene.mjs",
16
16
  "pretest": "node scripts/check-test-hygiene.mjs",
17
17
  "test": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js --passWithNoTests",
18
+ "build:fixture-db": "node scripts/build-fixture-db.mjs",
18
19
  "test:watch": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js --watch --passWithNoTests"
19
20
  },
20
21
  "dependencies": {