@mitre/hdf-schema 3.0.0 → 3.1.0-rc.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.
- package/LICENSE.md +55 -0
- package/README.md +96 -41
- package/dist/go/hdf.go +148 -104
- package/dist/helpers.js +4 -44
- package/dist/index.d.ts +26 -1
- package/dist/index.js +26 -1
- package/dist/schemas/hdf-amendments.schema.json +178 -53
- package/dist/schemas/hdf-baseline.schema.json +181 -56
- package/dist/schemas/hdf-comparison.schema.json +523 -108
- package/dist/schemas/hdf-evidence-package.schema.json +175 -50
- package/dist/schemas/hdf-plan.schema.json +181 -56
- package/dist/schemas/hdf-results.schema.json +502 -87
- package/dist/schemas/hdf-system.schema.json +190 -65
- package/dist/ts/hdf-amendments.d.ts +43 -15
- package/dist/ts/hdf-amendments.js +18 -7
- package/dist/ts/hdf-amendments.ts +44 -15
- package/dist/ts/hdf-results.d.ts +91 -37
- package/dist/ts/hdf-results.js +40 -20
- package/dist/ts/hdf-results.ts +91 -36
- package/package.json +44 -44
- package/dist/python/hdf_amendments.py +0 -695
- package/dist/python/hdf_baseline.py +0 -782
- package/dist/python/hdf_comparison.py +0 -1771
- package/dist/python/hdf_evidence_package.py +0 -593
- package/dist/python/hdf_plan.py +0 -363
- package/dist/python/hdf_results.py +0 -2163
- package/dist/python/hdf_system.py +0 -904
- package/src/schemas/hdf-amendments.schema.json +0 -97
- package/src/schemas/hdf-baseline.schema.json +0 -190
- package/src/schemas/hdf-comparison.schema.json +0 -107
- package/src/schemas/hdf-evidence-package.schema.json +0 -227
- package/src/schemas/hdf-plan.schema.json +0 -92
- package/src/schemas/hdf-results.schema.json +0 -304
- package/src/schemas/hdf-system.schema.json +0 -136
- package/src/schemas/primitives/amendments.schema.json +0 -155
- package/src/schemas/primitives/common.schema.json +0 -814
- package/src/schemas/primitives/comparison.schema.json +0 -809
- package/src/schemas/primitives/component.schema.json +0 -518
- package/src/schemas/primitives/data-flow.schema.json +0 -158
- package/src/schemas/primitives/extensions.schema.json +0 -342
- package/src/schemas/primitives/parameter.schema.json +0 -128
- package/src/schemas/primitives/plan.schema.json +0 -128
- package/src/schemas/primitives/platform.schema.json +0 -32
- package/src/schemas/primitives/result.schema.json +0 -133
- package/src/schemas/primitives/runner.schema.json +0 -83
- package/src/schemas/primitives/statistics.schema.json +0 -71
- package/src/schemas/primitives/system.schema.json +0 -132
- package/src/schemas/primitives/target.schema.json +0 -523
package/dist/helpers.js
CHANGED
|
@@ -142,50 +142,10 @@ export function createSourceLocation(ref, line) {
|
|
|
142
142
|
return { ref, line };
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
* critical=0.9 (CVSS 9.0), high=0.7 (CVSS 7.0), medium=0.5 (CVSS 5.0),
|
|
150
|
-
* low=0.3 (CVSS 3.0), informational=0.0 (CVSS 0.0)
|
|
151
|
-
*
|
|
152
|
-
* Each value is the floor of its band, preserving sub-band precision:
|
|
153
|
-
* 0.9-1.0=critical, 0.7-0.8=high, 0.4-0.6=medium, 0.1-0.3=low, 0.0=informational
|
|
154
|
-
*
|
|
155
|
-
* @param {string} severity - Severity level
|
|
156
|
-
* @returns {number} Impact score between 0.0 and 1.0
|
|
157
|
-
*/
|
|
158
|
-
export function severityToImpact(severity) {
|
|
159
|
-
const normalized = severity.toLowerCase();
|
|
160
|
-
switch (normalized) {
|
|
161
|
-
case 'critical':
|
|
162
|
-
return 0.9;
|
|
163
|
-
case 'high':
|
|
164
|
-
return 0.7;
|
|
165
|
-
case 'medium':
|
|
166
|
-
return 0.5;
|
|
167
|
-
case 'low':
|
|
168
|
-
return 0.3;
|
|
169
|
-
case 'informational':
|
|
170
|
-
case 'info':
|
|
171
|
-
return 0.0;
|
|
172
|
-
default:
|
|
173
|
-
return 0.5;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* Map an impact score to a severity string
|
|
179
|
-
* @param {number} impact - Impact score (0.0 to 1.0)
|
|
180
|
-
* @returns {string} Severity level
|
|
181
|
-
*/
|
|
182
|
-
export function impactToSeverity(impact) {
|
|
183
|
-
if (impact >= 0.9) return 'critical';
|
|
184
|
-
if (impact >= 0.7) return 'high';
|
|
185
|
-
if (impact >= 0.4) return 'medium';
|
|
186
|
-
if (impact > 0.0) return 'low';
|
|
187
|
-
return 'informational';
|
|
188
|
-
}
|
|
145
|
+
// Re-export severity mapping from @mitre/hdf-utilities (canonical location).
|
|
146
|
+
// Kept here for backwards compatibility — consumers importing from
|
|
147
|
+
// @mitre/hdf-schema/helpers still get these functions.
|
|
148
|
+
export { severityToImpact, impactToSeverity } from '@mitre/hdf-utilities';
|
|
189
149
|
|
|
190
150
|
/**
|
|
191
151
|
* Compute the effective status of a requirement from its results and impact.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Main entry point for @mitre/hdf-schema
|
|
3
|
-
* Re-exports all types from generated TypeScript definitions
|
|
3
|
+
* Re-exports all types from generated TypeScript definitions, plus the
|
|
4
|
+
* 21 source schemas as named JS-object exports.
|
|
4
5
|
*/
|
|
5
6
|
|
|
7
|
+
// Inlined source schemas (with $refs intact — consumers register them
|
|
8
|
+
// individually with their JSON Schema validator to resolve cross-refs).
|
|
9
|
+
export declare const hdfAmendmentsSchema: Readonly<Record<string, unknown>>;
|
|
10
|
+
export declare const hdfBaselineSchema: Readonly<Record<string, unknown>>;
|
|
11
|
+
export declare const hdfComparisonSchema: Readonly<Record<string, unknown>>;
|
|
12
|
+
export declare const hdfEvidencePackageSchema: Readonly<Record<string, unknown>>;
|
|
13
|
+
export declare const hdfPlanSchema: Readonly<Record<string, unknown>>;
|
|
14
|
+
export declare const hdfResultsSchema: Readonly<Record<string, unknown>>;
|
|
15
|
+
export declare const hdfSystemSchema: Readonly<Record<string, unknown>>;
|
|
16
|
+
export declare const amendmentsSchema: Readonly<Record<string, unknown>>;
|
|
17
|
+
export declare const commonSchema: Readonly<Record<string, unknown>>;
|
|
18
|
+
export declare const comparisonSchema: Readonly<Record<string, unknown>>;
|
|
19
|
+
export declare const componentSchema: Readonly<Record<string, unknown>>;
|
|
20
|
+
export declare const dataFlowSchema: Readonly<Record<string, unknown>>;
|
|
21
|
+
export declare const extensionsSchema: Readonly<Record<string, unknown>>;
|
|
22
|
+
export declare const parameterSchema: Readonly<Record<string, unknown>>;
|
|
23
|
+
export declare const planSchema: Readonly<Record<string, unknown>>;
|
|
24
|
+
export declare const platformSchema: Readonly<Record<string, unknown>>;
|
|
25
|
+
export declare const resultSchema: Readonly<Record<string, unknown>>;
|
|
26
|
+
export declare const runnerSchema: Readonly<Record<string, unknown>>;
|
|
27
|
+
export declare const statisticsSchema: Readonly<Record<string, unknown>>;
|
|
28
|
+
export declare const systemSchema: Readonly<Record<string, unknown>>;
|
|
29
|
+
export declare const targetSchema: Readonly<Record<string, unknown>>;
|
|
30
|
+
|
|
6
31
|
// Re-export all types from hdf-results (includes most common types)
|
|
7
32
|
export * from './ts/hdf-results.js';
|
|
8
33
|
|