@liuhange/dsh-data-masking 2.0.3 → 3.0.1

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.
Files changed (2) hide show
  1. package/lib/index.js +4 -3
  2. package/package.json +57 -42
package/lib/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { defineTool } from '@deepseek-ai/dsh-tools';
2
2
  import * as fs from 'fs';
3
3
  import * as path from 'path';
4
- import { BusinessRulesLoader, FileFormatAdapter, ReportGenerator, PathValidator, AuditLogger, } from '@liuhange/dsh-data-asset-shared';
4
+ import { BusinessRulesLoader, FileFormatAdapter, ReportGenerator, PathValidator, AuditLogger, RegistrationNavigationEnhancer, } from '@liuhange/dsh-data-asset-shared';
5
5
  import { SensitiveFieldScanner } from './sensitiveFieldScanner.js';
6
6
  import { MaskingStrategyExecutor } from './maskingStrategyExecutor.js';
7
7
  import { AdvancedMaskingExecutor } from './advancedMaskingExecutor.js';
@@ -17,6 +17,7 @@ export function apply(ctx) {
17
17
  const scanner = new SensitiveFieldScanner();
18
18
  const strategyExecutor = new MaskingStrategyExecutor();
19
19
  const advancedExecutor = new AdvancedMaskingExecutor();
20
+ const navEnhancer = new RegistrationNavigationEnhancer();
20
21
  ctx.tools.register(defineTool({
21
22
  name: 'mask_sensitive_data',
22
23
  description: '识别并脱敏数据中的敏感字段(身份证、手机号、银行卡、邮箱),支持高级算法(FPE/k-匿名/差分隐私/哈希)',
@@ -76,7 +77,7 @@ export function apply(ctx) {
76
77
  outputPath,
77
78
  result: 'SUCCESS',
78
79
  });
79
- return `高级脱敏完成(算法: ${algorithm})\n输入: ${fullPath}\n输出: ${outputPath}\n处理行数: ${maskedLines.length}`;
80
+ return navEnhancer.enhance(`高级脱敏完成(算法: ${algorithm})\n输入: ${fullPath}\n输出: ${outputPath}\n处理行数: ${maskedLines.length}`, 'data-masking', '');
80
81
  }
81
82
  const readResult = await formatAdapter.read(fullPath);
82
83
  const lines = readResult.lines;
@@ -107,7 +108,7 @@ export function apply(ctx) {
107
108
  outputPath,
108
109
  result: 'SUCCESS',
109
110
  });
110
- return report;
111
+ return navEnhancer.enhance(report, 'data-masking', '');
111
112
  },
112
113
  }));
113
114
  console.log('[data-masking] 脱敏插件已加载');
package/package.json CHANGED
@@ -1,42 +1,57 @@
1
- {
2
- "name": "@liuhange/dsh-data-masking",
3
- "description": "Data masking plugin: sensitive field identification and graded masking (FULL/PARTIAL/GENERALIZE)",
4
- "version": "2.0.3",
5
- "publishConfig": {
6
- "access": "public"
7
- },
8
- "repository": {
9
- "type": "git",
10
- "url": "git+https://github.com/liuhange789/data-asset-inspector.git",
11
- "directory": "packages/data-asset/data-masking"
12
- },
13
- "type": "module",
14
- "main": "lib/index.js",
15
- "types": "lib/types/index.d.ts",
16
- "exports": {
17
- ".": {
18
- "types": "./lib/types/index.d.ts",
19
- "default": "./lib/index.js"
20
- },
21
- "./invariant": {
22
- "types": "./lib/types/invariant.d.ts",
23
- "default": "./lib/invariant.js"
24
- },
25
- "./src/*": "./src/*",
26
- "./package.json": "./package.json"
27
- },
28
- "files": [
29
- "lib/**/*.js", "lib/types/**/*.d.ts"
30
- ],
31
- "license": "MIT",
32
- "scripts": {
33
- "typecheck": "tsc --noEmit",
34
- "test": "vitest run",
35
- "build": "tsc"
36
- },
37
- "peerDependencies": {
38
- "@deepseek-ai/cordis": "^4.0.0",
39
- "@deepseek-ai/dsh-tools": "0.0.1-rc.1",
40
- "@liuhange/dsh-data-asset-shared": "^2.0.0"
41
- }
42
- }
1
+ {
2
+ "name": "@liuhange/dsh-data-masking",
3
+ "description": "Data masking plugin: sensitive field identification and graded masking (FULL/PARTIAL/GENERALIZE) Also known as @deepseek-ai/dsh-data-masking.",
4
+ "version": "3.0.1",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/liuhange789/data-asset-inspector.git",
11
+ "directory": "packages/data-asset/data-masking"
12
+ },
13
+ "type": "module",
14
+ "main": "lib/index.js",
15
+ "types": "lib/types/index.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "types": "./lib/types/index.d.ts",
19
+ "default": "./lib/index.js"
20
+ },
21
+ "./invariant": {
22
+ "types": "./lib/types/invariant.d.ts",
23
+ "default": "./lib/invariant.js"
24
+ },
25
+ "./src/*": "./src/*",
26
+ "./package.json": "./package.json"
27
+ },
28
+ "files": [
29
+ "lib/**/*.js",
30
+ "lib/types/**/*.d.ts"
31
+ ],
32
+ "license": "MIT",
33
+ "scripts": {
34
+ "typecheck": "tsc --noEmit",
35
+ "test": "vitest run",
36
+ "build": "tsc"
37
+ },
38
+ "peerDependencies": {
39
+ "@deepseek-ai/cordis": "^4.0.0",
40
+ "@deepseek-ai/dsh-tools": "0.0.1-rc.1",
41
+ "@liuhange/dsh-data-asset-shared": "^3.0.0"
42
+ },
43
+ "dsh": {
44
+ "bundle": {
45
+ "patch": true
46
+ }
47
+ },
48
+ "keywords": [
49
+ "deepseek-harness",
50
+ "dsh-plugin",
51
+ "data-asset",
52
+ "data-asset-inspector",
53
+ "shujintong",
54
+ "数据资产"
55
+ ],
56
+ "homepage": "https://github.com/liuhange789/data-asset-inspector#readme"
57
+ }