@privacyscrubber/sdk 2.4.4 → 2.4.6
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/README.md +50 -1
- package/browser.js +399 -19
- package/cli.js +119 -11
- package/examples/python-bridge/README.md +3 -3
- package/examples/python-bridge/fastapi_example.py +1 -1
- package/examples/python-bridge/langchain_example.py +1 -1
- package/examples/python-bridge/privacyscrubber/__init__.py +1 -1
- package/examples/python-bridge/privacyscrubber/bridge_daemon.cjs +2 -2
- package/examples/python-bridge/privacyscrubber/cli.py +1 -1
- package/examples/python-bridge/pyproject.toml +1 -1
- package/examples/python-bridge/setup.py +1 -1
- package/index.cjs +1194 -86
- package/index.d.ts +147 -2
- package/index.js +1194 -86
- package/package.json +13 -3
- package/ps-license-manager.js +1 -1
- package/ps-pii-engine.cjs +1 -1
- package/sarif.cjs +14 -2
- package/scrubber-core.cjs +1 -1
- package/vercel-ai.cjs +123 -34
- package/vercel-ai.d.ts +7 -0
- package/benchmark.js +0 -355
- package/examples/python-bridge/bridge_daemon.cjs +0 -260
- package/examples/python-bridge/langchain_adapter.py +0 -20
- package/examples/python-bridge/privacyscrubber.py +0 -36
- package/examples/python-bridge/test_python_bridge.py +0 -320
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.6';
|
|
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 =
|
|
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.
|
|
327
|
+
console.log(`PrivacyScrubber SARIF 2.1.0 Emitter v2.4.6
|
|
316
328
|
Usage: node cli/sarif.js [options] [inputFile]
|
|
317
329
|
|
|
318
330
|
Options:
|