@cyclonedx/cyclonedx-library 1.13.0 → 1.13.2
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.d/_helpers/packageJson.d.ts +3 -0
- package/dist.d/_helpers/packageJson.d.ts.map +1 -1
- package/dist.d/models/bom.d.ts +0 -1
- package/dist.d/models/bom.d.ts.map +1 -1
- package/dist.d/utils/bomUtility.d.ts +5 -0
- package/dist.d/utils/bomUtility.d.ts.map +1 -1
- package/dist.node/_helpers/packageJson.js +6 -3
- package/dist.node/_helpers/packageJson.js.map +1 -1
- package/dist.node/models/bom.js.map +1 -1
- package/dist.node/utils/bomUtility.js +18 -0
- package/dist.node/utils/bomUtility.js.map +1 -1
- package/dist.web/lib.dev.js +18 -0
- package/dist.web/lib.dev.js.map +1 -1
- package/dist.web/lib.js.map +1 -1
- package/package.json +1 -1
- package/src/_helpers/packageJson.ts +9 -3
- package/src/models/bom.ts +0 -1
- package/src/utils/bomUtility.ts +6 -0
package/README.md
CHANGED
|
@@ -72,6 +72,8 @@ written in _TypeScript_ and compiled for the target.
|
|
|
72
72
|
* `Reference`, `ReferenceRepository`
|
|
73
73
|
* `Source`
|
|
74
74
|
* `Vulnerability`, `VulnerabilityRepository`
|
|
75
|
+
* Utilities for the following use cases:
|
|
76
|
+
* Generate valid random SerialNumbers for `Bom.serialNumber`
|
|
75
77
|
* Factories for the following use cases:
|
|
76
78
|
* Create data models from any license descriptor string
|
|
77
79
|
* Create `PackageURL` from `Component` data models
|
|
@@ -85,7 +87,7 @@ written in _TypeScript_ and compiled for the target.
|
|
|
85
87
|
* Normalizers that convert data models to JSON structures
|
|
86
88
|
* Normalizers that convert data models to XML structures
|
|
87
89
|
* Universal serializer that converts `Bom` data models to JSON string
|
|
88
|
-
* Serializer that converts `Bom` data models to XML string:
|
|
90
|
+
* Specific Serializer that converts `Bom` data models to XML string:
|
|
89
91
|
* Specific to _WebBrowsers_: implementation utilizes browser-specific document generators and printers.
|
|
90
92
|
* Specific to _Node.js_: implementation plugs/requires/utilizes one of the following _optional_ libraries
|
|
91
93
|
* [xmlbuilder2](https://www.npmjs.com/package/xmlbuilder2)
|
|
@@ -19,6 +19,9 @@ Copyright (c) OWASP Foundation. All Rights Reserved.
|
|
|
19
19
|
/**
|
|
20
20
|
* Split name and group from a package's name.
|
|
21
21
|
* Returns a tuple: [name, ?group]
|
|
22
|
+
*
|
|
23
|
+
* Based on [PackageJson spec](https://nodejs.org/api/packages.html#name) there are no restrictions on it.
|
|
24
|
+
* Having multiple slashes(`/`) is basically no issue.
|
|
22
25
|
*/
|
|
23
26
|
export declare function splitNameGroup(data: string): [string, string?];
|
|
24
27
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageJson.d.ts","sourceRoot":"","sources":["../../src/_helpers/packageJson.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF
|
|
1
|
+
{"version":3,"file":"packageJson.d.ts","sourceRoot":"","sources":["../../src/_helpers/packageJson.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAE,IAAI,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAO/D;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,KAAK,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,GAAG,CAAC,EAAE,MAAM,CAAA;KACb,CAAC,CAAA;IACF,MAAM,CAAC,EAAE,MAAM,GAAG;QAChB,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,KAAK,CAAC,EAAE,MAAM,CAAA;KACf,CAAA;IACD,IAAI,CAAC,EAAE,MAAM,GAAG;QACd,GAAG,CAAC,EAAE,MAAM,CAAA;KACb,CAAA;IACD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,GAAG;QACpB,GAAG,CAAC,EAAE,MAAM,CAAA;QACZ,SAAS,CAAC,EAAE,MAAM,CAAA;KACnB,CAAA;CAEF"}
|
package/dist.d/models/bom.d.ts
CHANGED
|
@@ -34,7 +34,6 @@ export declare class Bom {
|
|
|
34
34
|
vulnerabilities: VulnerabilityRepository;
|
|
35
35
|
/**
|
|
36
36
|
* @throws {@link TypeError} if `op.version` is neither {@link PositiveInteger} nor `undefined`
|
|
37
|
-
* @throws {@link TypeError} if `op.serialNumber` is neither {@link UrnUuid} nor `undefined`
|
|
38
37
|
*/
|
|
39
38
|
constructor(op?: OptionalBomProperties);
|
|
40
39
|
get version(): PositiveInteger;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bom.d.ts","sourceRoot":"","sources":["../../src/models/bom.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AAEzD,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,GAAG,CAAC,UAAU,CAAC,CAAA;IAC1B,UAAU,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC,CAAA;IAC9B,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,CAAA;IACxB,eAAe,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAA;IACxC,YAAY,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAA;CACnC;AAED,qBAAa,GAAG;;IACd,QAAQ,EAAE,QAAQ,CAAA;IAClB,UAAU,EAAE,mBAAmB,CAAA;IAC/B,eAAe,EAAE,uBAAuB,CAAA;IAcxC
|
|
1
|
+
{"version":3,"file":"bom.d.ts","sourceRoot":"","sources":["../../src/models/bom.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AAEzD,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,GAAG,CAAC,UAAU,CAAC,CAAA;IAC1B,UAAU,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC,CAAA;IAC9B,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,CAAA;IACxB,eAAe,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAA;IACxC,YAAY,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAA;CACnC;AAED,qBAAa,GAAG;;IACd,QAAQ,EAAE,QAAQ,CAAA;IAClB,UAAU,EAAE,mBAAmB,CAAA;IAC/B,eAAe,EAAE,uBAAuB,CAAA;IAcxC;;OAEG;gBACU,EAAE,GAAE,qBAA0B;IAQ3C,IAAI,OAAO,IAAK,eAAe,CAE9B;IAED;;OAEG;IACH,IAAI,OAAO,CAAE,KAAK,EAAE,eAAe,EAKlC;IAED,IAAI,YAAY,IAAK,MAAM,GAAG,SAAS,CAEtC;IAED,IAAI,YAAY,CAAE,KAAK,EAAE,MAAM,GAAG,SAAS,EAI1C;CACF"}
|
|
@@ -16,5 +16,10 @@ limitations under the License.
|
|
|
16
16
|
SPDX-License-Identifier: Apache-2.0
|
|
17
17
|
Copyright (c) OWASP Foundation. All Rights Reserved.
|
|
18
18
|
*/
|
|
19
|
+
/**
|
|
20
|
+
* Generate valid random SerialNumbers for {@link Models.Bom.serialNumber | Models.Bom.serialNumber}.
|
|
21
|
+
*
|
|
22
|
+
* @since 1.13.0
|
|
23
|
+
*/
|
|
19
24
|
export declare function randomSerialNumber(): string;
|
|
20
25
|
//# sourceMappingURL=bomUtility.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bomUtility.d.ts","sourceRoot":"","sources":["../../src/utils/bomUtility.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;
|
|
1
|
+
{"version":3,"file":"bomUtility.d.ts","sourceRoot":"","sources":["../../src/utils/bomUtility.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAK,MAAM,CAc5C"}
|
|
@@ -20,9 +20,12 @@ Copyright (c) OWASP Foundation. All Rights Reserved.
|
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.splitNameGroup = void 0;
|
|
22
22
|
function splitNameGroup(data) {
|
|
23
|
-
|
|
24
|
-
? data.
|
|
25
|
-
:
|
|
23
|
+
const delimGroup = data[0] === '@'
|
|
24
|
+
? data.indexOf('/', 2)
|
|
25
|
+
: 0;
|
|
26
|
+
return delimGroup > 0
|
|
27
|
+
? [data.slice(delimGroup + 1), data.slice(0, delimGroup)]
|
|
28
|
+
: [data, undefined];
|
|
26
29
|
}
|
|
27
30
|
exports.splitNameGroup = splitNameGroup;
|
|
28
31
|
//# sourceMappingURL=packageJson.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageJson.js","sourceRoot":"","sources":["../../src/_helpers/packageJson.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE;;;
|
|
1
|
+
{"version":3,"file":"packageJson.js","sourceRoot":"","sources":["../../src/_helpers/packageJson.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE;;;AASF,SAAgB,cAAc,CAAE,IAAY;IAC1C,MAAM,UAAU,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG;QAChC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QACtB,CAAC,CAAC,CAAC,CAAA;IACL,OAAO,UAAU,GAAG,CAAC;QACnB,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;QACzD,CAAC,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;AACvB,CAAC;AAPD,wCAOC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bom.js","sourceRoot":"","sources":["../../src/models/bom.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE;;;;;;;;;;;;;;;AAGF,oCAA4C;AAC5C,2CAAiD;AACjD,yCAAqC;AACrC,mDAAyD;AAUzD,MAAa,GAAG;
|
|
1
|
+
{"version":3,"file":"bom.js","sourceRoot":"","sources":["../../src/models/bom.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE;;;;;;;;;;;;;;;AAGF,oCAA4C;AAC5C,2CAAiD;AACjD,yCAAqC;AACrC,mDAAyD;AAUzD,MAAa,GAAG;IAoBd,YAAa,KAA4B,EAAE;QAd3C,uBAA4B,CAAC,EAAA;QAG7B,oCAAsB;QAYpB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC,QAAQ,IAAI,IAAI,mBAAQ,EAAE,CAAA;QAC7C,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC,UAAU,IAAI,IAAI,+BAAmB,EAAE,CAAA;QAC5D,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAA;QACzC,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC,eAAe,IAAI,IAAI,uCAAuB,EAAE,CAAA;QAC1E,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC,YAAY,CAAA;IACrC,CAAC;IAED,IAAI,OAAO;QACT,OAAO,uBAAA,IAAI,oBAAS,CAAA;IACtB,CAAC;IAKD,IAAI,OAAO,CAAE,KAAsB;QACjC,IAAI,CAAC,IAAA,yBAAiB,EAAC,KAAK,CAAC,EAAE;YAC7B,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAA;SAC3C;QACD,uBAAA,IAAI,gBAAY,KAAK,MAAA,CAAA;IACvB,CAAC;IAED,IAAI,YAAY;QACd,OAAO,uBAAA,IAAI,yBAAc,CAAA;IAC3B,CAAC;IAED,IAAI,YAAY,CAAE,KAAyB;QACzC,uBAAA,IAAI,qBAAiB,KAAK,KAAK,EAAE;YAC/B,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,KAAK,MAAA,CAAA;IACX,CAAC;CACF;AAnDD,kBAmDC"}
|
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
This file is part of CycloneDX JavaScript Library.
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
|
16
|
+
|
|
17
|
+
SPDX-License-Identifier: Apache-2.0
|
|
18
|
+
Copyright (c) OWASP Foundation. All Rights Reserved.
|
|
19
|
+
*/
|
|
2
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
21
|
exports.randomSerialNumber = void 0;
|
|
4
22
|
function randomSerialNumber() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bomUtility.js","sourceRoot":"","sources":["../../src/utils/bomUtility.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"bomUtility.js","sourceRoot":"","sources":["../../src/utils/bomUtility.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE;;;AAOF,SAAgB,kBAAkB;IAChC,MAAM,CAAC,GAAG;QACR,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC;QAClC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC;QAClC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC;QAElC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,GAAG,MAAM;QAE3C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,GAAG,MAAM;QAC3C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC;QAClC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC;QAClC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC;KACnC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAA;IAC3C,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;AAChF,CAAC;AAdD,gDAcC"}
|
package/dist.web/lib.dev.js
CHANGED
|
@@ -4665,6 +4665,24 @@ exports.isUrnUuid = isUrnUuid;
|
|
|
4665
4665
|
/***/ ((__unused_webpack_module, exports) => {
|
|
4666
4666
|
|
|
4667
4667
|
|
|
4668
|
+
/*!
|
|
4669
|
+
This file is part of CycloneDX JavaScript Library.
|
|
4670
|
+
|
|
4671
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4672
|
+
you may not use this file except in compliance with the License.
|
|
4673
|
+
You may obtain a copy of the License at
|
|
4674
|
+
|
|
4675
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
4676
|
+
|
|
4677
|
+
Unless required by applicable law or agreed to in writing, software
|
|
4678
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
4679
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4680
|
+
See the License for the specific language governing permissions and
|
|
4681
|
+
limitations under the License.
|
|
4682
|
+
|
|
4683
|
+
SPDX-License-Identifier: Apache-2.0
|
|
4684
|
+
Copyright (c) OWASP Foundation. All Rights Reserved.
|
|
4685
|
+
*/
|
|
4668
4686
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4669
4687
|
exports.randomSerialNumber = void 0;
|
|
4670
4688
|
function randomSerialNumber() {
|