@sebastienrousseau/crypto-cbom 0.0.7 → 0.0.9

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/dist/audit.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { CbomAuditResult, CryptoAsset, CycloneDxCbom, QuantumResistanceLevel } from "./types";
1
+ import { CbomAuditResult, CryptoAsset, CycloneDxCbom, SpdxCbom, QuantumResistanceLevel } from "./types";
2
2
  export declare const AUDIT_DISCLAIMER = "Heuristic cryptographic posture score derived from algorithm names; it is not a DORA or CRA compliance assessment.";
3
3
  export declare function classifyPrimitive(primitive: string): QuantumResistanceLevel;
4
- export declare function auditCbom(input: CycloneDxCbom | CryptoAsset[]): CbomAuditResult;
4
+ export declare function auditCbom(input: CycloneDxCbom | SpdxCbom | CryptoAsset[]): CbomAuditResult;
5
5
  //# sourceMappingURL=audit.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../src/audit.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,eAAe,EACf,WAAW,EACX,aAAa,EACb,sBAAsB,EACvB,MAAM,SAAS,CAAC;AAGjB,eAAO,MAAM,gBAAgB,uHACyF,CAAC;AAgBvH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,sBAAsB,CAO3E;AAkGD,wBAAgB,SAAS,CACvB,KAAK,EAAE,aAAa,GAAG,WAAW,EAAE,GACnC,eAAe,CA+BjB"}
1
+ {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../src/audit.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,eAAe,EACf,WAAW,EACX,aAAa,EACb,QAAQ,EACR,sBAAsB,EACvB,MAAM,SAAS,CAAC;AAGjB,eAAO,MAAM,gBAAgB,uHACyF,CAAC;AAgBvH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,sBAAsB,CAO3E;AA0GD,wBAAgB,SAAS,CACvB,KAAK,EAAE,aAAa,GAAG,QAAQ,GAAG,WAAW,EAAE,GAC9C,eAAe,CA+BjB"}
package/dist/audit.js CHANGED
@@ -21,6 +21,12 @@ function classifyPrimitive(primitive) {
21
21
  function toAssets(input) {
22
22
  if (Array.isArray(input))
23
23
  return input;
24
+ if ("elements" in input) {
25
+ return input.elements.map((e) => ({
26
+ name: e.name,
27
+ resistanceLevel: classifyPrimitive(e.algorithm || e.name),
28
+ }));
29
+ }
24
30
  return input.components.map((c) => ({
25
31
  name: c.name,
26
32
  resistanceLevel: classifyPrimitive(c["crypto-properties"]?.algorithmProperties?.primitive || c.name),
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@sebastienrousseau/crypto-cbom",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "description": "Cryptographic Bill of Materials (CBOM) generator and auditor compliant with CycloneDX 1.6, SPDX 3.0, EU DORA Articles 9/13, and CRA Article 14.",
5
5
  "author": "Sebastien Rousseau <sebastienrousseau@users.noreply.github.com>",
6
6
  "license": "MIT OR Apache-2.0",
7
7
  "homepage": "https://crypto-service.co",
8
8
  "repository": {
9
- "directory": "packages/crypto-cbom",
10
9
  "type": "git",
11
- "url": "git@github.com:sebastienrousseau/crypto-service.git"
10
+ "url": "git+https://github.com/sebastienrousseau/crypto-service.git",
11
+ "directory": "packages/crypto-cbom"
12
12
  },
13
13
  "bugs": {
14
14
  "url": "https://github.com/sebastienrousseau/crypto-service/issues"
@@ -16,8 +16,17 @@
16
16
  "engines": {
17
17
  "node": ">=22.0.0"
18
18
  },
19
+ "type": "commonjs",
19
20
  "main": "./dist/index.js",
20
21
  "types": "./dist/index.d.ts",
22
+ "exports": {
23
+ ".": {
24
+ "types": "./dist/index.d.ts",
25
+ "require": "./dist/index.js",
26
+ "default": "./dist/index.js"
27
+ },
28
+ "./package.json": "./package.json"
29
+ },
21
30
  "sideEffects": false,
22
31
  "bin": {
23
32
  "crypto-cbom": "./dist/cli.js"
@@ -28,17 +37,18 @@
28
37
  "dist/**/*.d.ts.map"
29
38
  ],
30
39
  "dependencies": {
31
- "@sebastienrousseau/crypto-lib": "0.0.7"
40
+ "@sebastienrousseau/crypto-lib": "0.0.9"
32
41
  },
33
42
  "devDependencies": {
34
- "@types/chai": "^4.3.7",
43
+ "@types/chai": "^5.2.3",
35
44
  "@types/chai-as-promised": "^8.0.2",
36
- "@types/mocha": "^10.0.2",
37
- "@types/node": "^26.4.1",
45
+ "@types/mocha": "^10.0.10",
46
+ "@types/node": "^26.6.3",
38
47
  "c8": "^12.0.0",
39
- "chai": "^4.5.0",
40
- "chai-as-promised": "^7.1.2",
41
- "mocha": "^10.8.2",
48
+ "chai": "^6.3.0",
49
+ "chai-as-promised": "^8.0.2",
50
+ "fast-check": "^4.10.2",
51
+ "mocha": "^12.0.3",
42
52
  "rimraf": "^6.1.3",
43
53
  "ts-node": "^10.9.2",
44
54
  "typedoc": "^0.28.20",
@@ -50,8 +60,8 @@
50
60
  "scripts": {
51
61
  "build": "tsc --build tsconfig.json",
52
62
  "clean": "rimraf ./coverage ./dist ./docs",
53
- "lint": "eslint --ext .ts src __tests__",
54
- "lint:fix": "eslint --cache --fix --ext .ts src __tests__",
63
+ "lint": "eslint src __tests__",
64
+ "lint:fix": "eslint --cache --fix src __tests__",
55
65
  "format": "prettier --write src/**/*.ts",
56
66
  "format:check": "prettier --check \"src/**/*.ts\"",
57
67
  "test": "c8 --check-coverage --lines 100 --branches 100 --functions 100 --reporter=lcov --reporter=text mocha --config=.mocharc.cjs",