verimu 0.0.19 → 0.0.21

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/index.d.cts CHANGED
@@ -128,6 +128,14 @@ interface UsageSnippet {
128
128
  calledSymbol?: string;
129
129
  /** Confidence score in [0, 1] */
130
130
  confidence: number;
131
+ /**
132
+ * Which lines within `code` to highlight in the UI.
133
+ * Both values are 0-indexed offsets into the `code` string's lines
134
+ * (i.e. relative to `startLine`, not to the source file).
135
+ * Example: if startLine=6 and the match is on source line 10,
136
+ * highlight = [4, 4] (single-line) or [4, 6] (multi-line range).
137
+ */
138
+ highlight: [startOffset: number, endOffset: number];
131
139
  }
132
140
  /** Usage-context outcome for one vulnerability */
133
141
  interface UsageContextVulnerabilityFinding {
@@ -261,6 +269,8 @@ interface VerimuConfig {
261
269
  skipCveCheck?: boolean;
262
270
  /** Optional context lines around usage snippets (default: 4, clamped to 0..20) */
263
271
  numContextLines?: number;
272
+ /** Optional group name to associate this project with others in the dashboard */
273
+ groupName?: string;
264
274
  }
265
275
  /** Input for the pure `generateSbom()` function */
266
276
  interface GenerateSbomInput {
@@ -402,6 +412,7 @@ interface UpsertProjectResponse {
402
412
  ecosystem: string;
403
413
  repository_url: string | null;
404
414
  platform: string | null;
415
+ group_name: string | null;
405
416
  };
406
417
  created: boolean;
407
418
  }
@@ -457,6 +468,7 @@ declare class VerimuApiClient {
457
468
  ecosystem: Ecosystem;
458
469
  repositoryUrl?: string;
459
470
  platform?: string;
471
+ groupName?: string;
460
472
  }): Promise<UpsertProjectResponse>;
461
473
  /**
462
474
  * Upload a software inventory artifact payload to a project and trigger CVE scanning.
package/dist/index.d.ts CHANGED
@@ -128,6 +128,14 @@ interface UsageSnippet {
128
128
  calledSymbol?: string;
129
129
  /** Confidence score in [0, 1] */
130
130
  confidence: number;
131
+ /**
132
+ * Which lines within `code` to highlight in the UI.
133
+ * Both values are 0-indexed offsets into the `code` string's lines
134
+ * (i.e. relative to `startLine`, not to the source file).
135
+ * Example: if startLine=6 and the match is on source line 10,
136
+ * highlight = [4, 4] (single-line) or [4, 6] (multi-line range).
137
+ */
138
+ highlight: [startOffset: number, endOffset: number];
131
139
  }
132
140
  /** Usage-context outcome for one vulnerability */
133
141
  interface UsageContextVulnerabilityFinding {
@@ -261,6 +269,8 @@ interface VerimuConfig {
261
269
  skipCveCheck?: boolean;
262
270
  /** Optional context lines around usage snippets (default: 4, clamped to 0..20) */
263
271
  numContextLines?: number;
272
+ /** Optional group name to associate this project with others in the dashboard */
273
+ groupName?: string;
264
274
  }
265
275
  /** Input for the pure `generateSbom()` function */
266
276
  interface GenerateSbomInput {
@@ -402,6 +412,7 @@ interface UpsertProjectResponse {
402
412
  ecosystem: string;
403
413
  repository_url: string | null;
404
414
  platform: string | null;
415
+ group_name: string | null;
405
416
  };
406
417
  created: boolean;
407
418
  }
@@ -457,6 +468,7 @@ declare class VerimuApiClient {
457
468
  ecosystem: Ecosystem;
458
469
  repositoryUrl?: string;
459
470
  platform?: string;
471
+ groupName?: string;
460
472
  }): Promise<UpsertProjectResponse>;
461
473
  /**
462
474
  * Upload a software inventory artifact payload to a project and trigger CVE scanning.
package/dist/index.mjs CHANGED
@@ -14426,9 +14426,10 @@ var NpmScanner = class {
14426
14426
  if (lockfile.packages) {
14427
14427
  for (const [pkgPath, pkgInfo] of Object.entries(lockfile.packages)) {
14428
14428
  if (pkgPath === "") continue;
14429
+ if (!pkgPath.startsWith("node_modules/")) continue;
14430
+ if (pkgInfo.link) continue;
14429
14431
  const name = this.extractPackageName(pkgPath);
14430
14432
  if (!name || !pkgInfo.version) continue;
14431
- if (pkgInfo.link) continue;
14432
14433
  deps.push({
14433
14434
  name,
14434
14435
  version: pkgInfo.version,
@@ -17026,7 +17027,8 @@ var VerimuApiClient = class {
17026
17027
  name: opts.name,
17027
17028
  ecosystem: this.mapEcosystem(opts.ecosystem),
17028
17029
  repository_url: opts.repositoryUrl ?? null,
17029
- platform: opts.platform ?? null
17030
+ platform: opts.platform ?? null,
17031
+ group_name: opts.groupName ?? null
17030
17032
  })
17031
17033
  });
17032
17034
  if (!res.ok) {
@@ -17178,6 +17180,8 @@ function buildSnippet(params) {
17178
17180
  const startLine = Math.max(1, centerLine - numContextLines);
17179
17181
  const endLine = Math.min(lines.length || 1, centerLine + numContextLines);
17180
17182
  const code = lines.slice(startLine - 1, endLine).join("\n");
17183
+ const highlightOffset = centerLine - startLine;
17184
+ const highlight = [highlightOffset, highlightOffset];
17181
17185
  return {
17182
17186
  filePath: relative(projectPath, filePath).split(sep).join("/"),
17183
17187
  startLine,
@@ -17185,7 +17189,8 @@ function buildSnippet(params) {
17185
17189
  code,
17186
17190
  matchKind,
17187
17191
  calledSymbol,
17188
- confidence
17192
+ confidence,
17193
+ highlight
17189
17194
  };
17190
17195
  }
17191
17196
  function dedupeSnippets(snippets) {
@@ -18944,7 +18949,8 @@ async function uploadToVerimu(report, config) {
18944
18949
  const projectName = basename(config.projectPath);
18945
18950
  const upsertRes = await client.upsertProject({
18946
18951
  name: projectName,
18947
- ecosystem: report.project.ecosystem
18952
+ ecosystem: report.project.ecosystem,
18953
+ groupName: config.groupName
18948
18954
  });
18949
18955
  const projectId = upsertRes.project.id;
18950
18956
  const scanRes = await client.uploadSbom(projectId, buildUploadPayload(report));