@stratum-hq/compliance 0.1.2 → 0.1.3
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 +3 -1
- package/dist/finding.d.ts +1 -0
- package/dist/finding.d.ts.map +1 -1
- package/dist/finding.js +4 -0
- package/dist/finding.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A content-free compliance **kernel** for [Stratum](https://github.com/stratum-hq/Stratum): the pure mechanics and type shapes any compliance product needs, with none of the content. Zero runtime dependencies, no database, no network, no provider, and no built-in catalog.
|
|
4
4
|
|
|
5
|
-
Read the documentation at [docs.stratum-hq.org](https://docs.stratum-hq.org/).
|
|
5
|
+
Read the documentation at [docs.stratum-hq.org/packages/compliance](https://docs.stratum-hq.org/packages/compliance/).
|
|
6
6
|
|
|
7
7
|
It gives you three things:
|
|
8
8
|
|
|
@@ -76,6 +76,7 @@ The rules:
|
|
|
76
76
|
- `fail` **opens** a finding, unless one is already active (`open` / `remediating`) or the risk was formally `accepted`.
|
|
77
77
|
- `pass` **resolves** an active finding (`open` / `remediating`), and leaves an `accepted` finding untouched; otherwise there is nothing to resolve.
|
|
78
78
|
- `na` and `error` are always no-ops.
|
|
79
|
+
- Any other outcome throws a `TypeError`.
|
|
79
80
|
|
|
80
81
|
Map `{ type: "open" }` and `{ type: "resolve" }` onto your own inserts and updates. The state machine has no opinion about storage.
|
|
81
82
|
|
|
@@ -100,6 +101,7 @@ Everything here is a pure function or a type. No side effects, no IO, no global
|
|
|
100
101
|
|
|
101
102
|
## Links
|
|
102
103
|
|
|
104
|
+
- Documentation: https://docs.stratum-hq.org/packages/compliance/
|
|
103
105
|
- GitHub: https://github.com/stratum-hq/Stratum
|
|
104
106
|
|
|
105
107
|
## License
|
package/dist/finding.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export type FindingAction = {
|
|
|
19
19
|
* - `pass` resolves an active finding (`open` / `remediating`), and leaves an
|
|
20
20
|
* `accepted` finding untouched; there is nothing to resolve otherwise.
|
|
21
21
|
* - `na` and `error` never change a finding.
|
|
22
|
+
* - Any other outcome throws a `TypeError`.
|
|
22
23
|
*/
|
|
23
24
|
export declare function reconcileFinding(newOutcome: ControlOutcome, currentState: FindingState): FindingAction;
|
|
24
25
|
//# sourceMappingURL=finding.d.ts.map
|
package/dist/finding.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"finding.d.ts","sourceRoot":"","sources":["../src/finding.ts"],"names":[],"mappings":"AAQA,kDAAkD;AAClD,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC;AAE9D,gFAAgF;AAChF,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,aAAa,GACb,UAAU,GACV,UAAU,GACV,MAAM,CAAC;AAEX,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAErB
|
|
1
|
+
{"version":3,"file":"finding.d.ts","sourceRoot":"","sources":["../src/finding.ts"],"names":[],"mappings":"AAQA,kDAAkD;AAClD,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC;AAE9D,gFAAgF;AAChF,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,aAAa,GACb,UAAU,GACV,UAAU,GACV,MAAM,CAAC;AAEX,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAErB;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,cAAc,EAC1B,YAAY,EAAE,YAAY,GACzB,aAAa,CA4Bf"}
|
package/dist/finding.js
CHANGED
|
@@ -18,6 +18,7 @@ exports.reconcileFinding = reconcileFinding;
|
|
|
18
18
|
* - `pass` resolves an active finding (`open` / `remediating`), and leaves an
|
|
19
19
|
* `accepted` finding untouched; there is nothing to resolve otherwise.
|
|
20
20
|
* - `na` and `error` never change a finding.
|
|
21
|
+
* - Any other outcome throws a `TypeError`.
|
|
21
22
|
*/
|
|
22
23
|
function reconcileFinding(newOutcome, currentState) {
|
|
23
24
|
switch (newOutcome) {
|
|
@@ -36,6 +37,9 @@ function reconcileFinding(newOutcome, currentState) {
|
|
|
36
37
|
case "na":
|
|
37
38
|
case "error":
|
|
38
39
|
return { type: "noop" };
|
|
40
|
+
default:
|
|
41
|
+
// Unreachable for typed callers; guards untyped input such as parsed JSON.
|
|
42
|
+
throw new TypeError(`reconcileFinding: unknown control outcome ${JSON.stringify(newOutcome)}; expected one of pass, fail, na, error`);
|
|
39
43
|
}
|
|
40
44
|
}
|
|
41
45
|
//# sourceMappingURL=finding.js.map
|
package/dist/finding.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"finding.js","sourceRoot":"","sources":["../src/finding.ts"],"names":[],"mappings":";AAAA,yBAAyB;AACzB,EAAE;AACF,0EAA0E;AAC1E,yEAAyE;AACzE,+EAA+E;AAC/E,+EAA+E;AAC/E,eAAe;;
|
|
1
|
+
{"version":3,"file":"finding.js","sourceRoot":"","sources":["../src/finding.ts"],"names":[],"mappings":";AAAA,yBAAyB;AACzB,EAAE;AACF,0EAA0E;AAC1E,yEAAyE;AACzE,+EAA+E;AAC/E,+EAA+E;AAC/E,eAAe;;AA8Bf,4CA+BC;AA3CD;;;;;;;;;;;GAWG;AACH,SAAgB,gBAAgB,CAC9B,UAA0B,EAC1B,YAA0B;IAE1B,QAAQ,UAAU,EAAE,CAAC;QACnB,KAAK,MAAM;YACT,IACE,YAAY,KAAK,MAAM;gBACvB,YAAY,KAAK,aAAa;gBAC9B,YAAY,KAAK,UAAU,EAC3B,CAAC;gBACD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;YAC1B,CAAC;YACD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAE1B,KAAK,MAAM;YACT,IAAI,YAAY,KAAK,MAAM,IAAI,YAAY,KAAK,aAAa,EAAE,CAAC;gBAC9D,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;YAC7B,CAAC;YACD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAE1B,KAAK,IAAI,CAAC;QACV,KAAK,OAAO;YACV,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAE1B;YACE,2EAA2E;YAC3E,MAAM,IAAI,SAAS,CACjB,6CAA6C,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,yCAAyC,CACjH,CAAC;IACN,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stratum-hq/compliance",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Content-free compliance kernel for Stratum: baseline coverage scoring, a finding state machine, and a control type vocabulary",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"compliance",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"license": "MIT",
|
|
45
45
|
"author": "Christian Crank",
|
|
46
|
-
"homepage": "https://docs.stratum-hq.org/",
|
|
46
|
+
"homepage": "https://docs.stratum-hq.org/packages/compliance/",
|
|
47
47
|
"bugs": "https://github.com/stratum-hq/Stratum/issues",
|
|
48
48
|
"engines": {
|
|
49
49
|
"node": ">=20.0.0"
|