@liuhange/dsh-data-asset-registration-helper 3.0.0 → 3.1.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.
- package/lib/index.js +11 -1
- package/lib/tripleAuditAndSevenStep.js +21 -0
- package/package.json +22 -6
package/lib/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import { checkDisallowedScenarios } from './disallowedScenarioChecker.js';
|
|
|
2
2
|
import { matchAgency } from './agencyMatcher.js';
|
|
3
3
|
import { generateRegistrationReport } from './registrationReportGenerator.js';
|
|
4
4
|
import { validateRegistrationArgs } from './invariant.js';
|
|
5
|
+
import { promptTripleAuditStandard, promptSevenStepFlow } from './tripleAuditAndSevenStep.js';
|
|
5
6
|
export const name = '@liuhange/dsh-data-asset-registration-helper';
|
|
6
7
|
export const inject = ['tools'];
|
|
7
8
|
export function apply(ctx) {
|
|
@@ -61,7 +62,16 @@ export function apply(ctx) {
|
|
|
61
62
|
agencyMatch = matchAgency(validated.dataType, validated.region, registrationConfig.agencies);
|
|
62
63
|
}
|
|
63
64
|
const report = generateRegistrationReport(validated.assetName, precheck, agencyMatch, policyDocuments);
|
|
64
|
-
|
|
65
|
+
const tripleAuditConfig = registrationConfig.tripleAuditStandard;
|
|
66
|
+
const tripleAudit = tripleAuditConfig ? promptTripleAuditStandard(tripleAuditConfig) : null;
|
|
67
|
+
const sevenStepConfig = registrationConfig.sevenStepFlow;
|
|
68
|
+
const sevenStep = sevenStepConfig ? promptSevenStepFlow(sevenStepConfig) : null;
|
|
69
|
+
const enrichedReport = {
|
|
70
|
+
...report,
|
|
71
|
+
tripleAuditStandard: tripleAudit,
|
|
72
|
+
sevenStepFlow: sevenStep,
|
|
73
|
+
};
|
|
74
|
+
return JSON.stringify(enrichedReport, null, 2);
|
|
65
75
|
}
|
|
66
76
|
catch (e) {
|
|
67
77
|
const err = e;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export function promptTripleAuditStandard(config) {
|
|
2
|
+
return {
|
|
3
|
+
enabled: config.enabled,
|
|
4
|
+
standards: config.enabled ? config.standards : [],
|
|
5
|
+
promptMessage: config.enabled ? config.promptMessage : '',
|
|
6
|
+
policyRef: config.policyRef,
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export function promptSevenStepFlow(config) {
|
|
10
|
+
if (!config.enabled) {
|
|
11
|
+
return { enabled: false, steps: [], totalMaxDays: 0, policyRef: config.policyRef };
|
|
12
|
+
}
|
|
13
|
+
const totalMaxDays = config.steps.reduce((sum, s) => sum + (s.durationDays ?? 0), 0);
|
|
14
|
+
return {
|
|
15
|
+
enabled: true,
|
|
16
|
+
steps: config.steps,
|
|
17
|
+
totalMaxDays,
|
|
18
|
+
policyRef: config.policyRef,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=tripleAuditAndSevenStep.js.map
|
package/package.json
CHANGED
|
@@ -1,18 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liuhange/dsh-data-asset-registration-helper",
|
|
3
3
|
"description": "Registration helper plugin: disallowed scenario check + ownership dispute check + agency matching + registration workflow guidance",
|
|
4
|
-
"version": "3.
|
|
5
|
-
"publishConfig": {
|
|
6
|
-
|
|
4
|
+
"version": "3.1.0",
|
|
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-asset-registration-helper"
|
|
12
|
+
},
|
|
7
13
|
"type": "module",
|
|
8
14
|
"main": "lib/index.js",
|
|
9
15
|
"types": "lib/types/index.d.ts",
|
|
10
16
|
"exports": {
|
|
11
|
-
".": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./lib/types/index.d.ts",
|
|
19
|
+
"default": "./lib/index.js"
|
|
20
|
+
},
|
|
12
21
|
"./src/*": "./src/*",
|
|
13
22
|
"./package.json": "./package.json"
|
|
14
23
|
},
|
|
15
|
-
"files": [
|
|
24
|
+
"files": [
|
|
25
|
+
"lib/**/*.js",
|
|
26
|
+
"lib/types/**/*.d.ts"
|
|
27
|
+
],
|
|
16
28
|
"license": "MIT",
|
|
17
29
|
"scripts": {
|
|
18
30
|
"typecheck": "tsc --noEmit",
|
|
@@ -24,5 +36,9 @@
|
|
|
24
36
|
"@deepseek-ai/dsh-tools": "0.0.1-rc.1",
|
|
25
37
|
"@liuhange/dsh-data-asset-shared": "^3.0.0"
|
|
26
38
|
},
|
|
27
|
-
"dsh": {
|
|
39
|
+
"dsh": {
|
|
40
|
+
"bundle": {
|
|
41
|
+
"patch": true
|
|
42
|
+
}
|
|
43
|
+
}
|
|
28
44
|
}
|