@privacyscrubber/sdk 2.4.5 → 2.4.7

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/sarif.cjs CHANGED
@@ -14,6 +14,18 @@ const fs = require('fs');
14
14
  const path = require('path');
15
15
  const crypto = require('crypto');
16
16
 
17
+ const SARIF_TOOL_VERSION = (() => {
18
+ for (const cand of [path.join(__dirname, 'package.json'), path.join(__dirname, '..', 'package.json')]) {
19
+ try {
20
+ if (fs.existsSync(cand)) {
21
+ const v = JSON.parse(fs.readFileSync(cand, 'utf8')).version;
22
+ if (v) return v;
23
+ }
24
+ } catch (_) {}
25
+ }
26
+ return '2.4.7';
27
+ })();
28
+
17
29
  // ─── PII Entity Type → SARIF Level Mapping ──────────────────────────────
18
30
  const PII_LEVEL_MAP = {
19
31
  passport: 'error',
@@ -238,7 +250,7 @@ function sanitizeResultToFindings(sanitizeResult, sourceText = '', fileUri = 'in
238
250
  function emitSarif(findings, options = {}) {
239
251
  const {
240
252
  toolName = 'PrivacyScrubber',
241
- toolVersion = '2.4.5',
253
+ toolVersion = SARIF_TOOL_VERSION,
242
254
  sarifVersion = '2.1.0',
243
255
  repositoryUri = '',
244
256
  commitSha = '',
@@ -312,7 +324,7 @@ function main() {
312
324
  const args = parseArgs(process.argv.slice(2));
313
325
 
314
326
  if (args.help) {
315
- console.log(`PrivacyScrubber SARIF 2.1.0 Emitter v2.4.5
327
+ console.log(`PrivacyScrubber SARIF 2.1.0 Emitter v2.4.7
316
328
  Usage: node cli/sarif.js [options] [inputFile]
317
329
 
318
330
  Options: