@cyclonedx/cyclonedx-library 9.0.0 → 9.2.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/README.md +1 -0
- package/dist.d/_helpers/sortable.d.ts.map +1 -1
- package/dist.d/_helpers/stringable.d.ts +2 -2
- package/dist.d/enums/externalReferenceType.d.ts +4 -0
- package/dist.d/enums/externalReferenceType.d.ts.map +1 -1
- package/dist.d/enums/hashAlogorithm.d.ts +3 -1
- package/dist.d/enums/hashAlogorithm.d.ts.map +1 -1
- package/dist.d/factories/fromNodePackageJson.node.d.ts.map +1 -1
- package/dist.d/serialize/json/normalize.d.ts.map +1 -1
- package/dist.d/serialize/xml/normalize.d.ts.map +1 -1
- package/dist.d/spec/consts.d.ts +2 -0
- package/dist.d/spec/consts.d.ts.map +1 -1
- package/dist.d/spec/enums.d.ts +1 -0
- package/dist.d/spec/enums.d.ts.map +1 -1
- package/dist.d/validation/jsonValidator.node.d.ts.map +1 -1
- package/dist.node/_helpers/sortable.js.map +1 -1
- package/dist.node/enums/externalReferenceType.js +4 -0
- package/dist.node/enums/externalReferenceType.js.map +1 -1
- package/dist.node/enums/hashAlogorithm.js +2 -0
- package/dist.node/enums/hashAlogorithm.js.map +1 -1
- package/dist.node/factories/fromNodePackageJson.node.js.map +1 -1
- package/dist.node/resources.node.js +6 -0
- package/dist.node/resources.node.js.map +1 -1
- package/dist.node/serialize/json/normalize.js +1 -0
- package/dist.node/serialize/json/normalize.js.map +1 -1
- package/dist.node/serialize/xml/normalize.js +1 -0
- package/dist.node/serialize/xml/normalize.js.map +1 -1
- package/dist.node/spec/consts.js +92 -1
- package/dist.node/spec/consts.js.map +1 -1
- package/dist.node/spec/enums.js +1 -0
- package/dist.node/spec/enums.js.map +1 -1
- package/dist.node/validation/jsonValidator.node.js +1 -0
- package/dist.node/validation/jsonValidator.node.js.map +1 -1
- package/dist.web/lib.dev.js +101 -1
- package/dist.web/lib.dev.js.map +1 -1
- package/dist.web/lib.js +1 -1
- package/dist.web/lib.js.map +1 -1
- package/package.json +9 -7
- package/res/schema/README.md +3 -1
- package/res/schema/bom-1.4.SNAPSHOT.schema.json +2 -2
- package/res/schema/bom-1.4.SNAPSHOT.xsd +1 -1
- package/res/schema/bom-1.5.SNAPSHOT.schema.json +2 -2
- package/res/schema/bom-1.5.SNAPSHOT.xsd +3 -3
- package/res/schema/bom-1.6.SNAPSHOT.schema.json +4 -4
- package/res/schema/bom-1.6.SNAPSHOT.xsd +6 -6
- package/res/schema/bom-1.7.SNAPSHOT.schema.json +6700 -0
- package/res/schema/bom-1.7.SNAPSHOT.xsd +9742 -0
- package/res/schema/cryptography-defs.SNAPSHOT.schema.json +576 -0
- package/src/_helpers/sortable.ts +1 -0
- package/src/_helpers/uri.ts +1 -1
- package/src/enums/externalReferenceType.ts +4 -0
- package/src/enums/hashAlogorithm.ts +2 -0
- package/src/factories/fromNodePackageJson.node.ts +2 -0
- package/src/resources.node.ts +6 -0
- package/src/serialize/json/normalize.ts +1 -0
- package/src/serialize/xml/normalize.ts +1 -0
- package/src/serialize/xmlSerializer.web.ts +1 -1
- package/src/spec/consts.ts +117 -0
- package/src/spec/enums.ts +1 -0
- package/src/validation/jsonValidator.node.ts +1 -0
- package/tsconfig.d.tsbuildinfo +1 -1
- package/tsconfig.node.tsbuildinfo +1 -1
- package/dist.d/_helpers/stringable.d.ts.map +0 -1
- package/dist.node/_helpers/stringable.js +0 -21
- package/dist.node/_helpers/stringable.js.map +0 -1
- /package/src/_helpers/{stringable.ts → stringable.d.ts} +0 -0
|
@@ -78,7 +78,7 @@ export class XmlSerializer extends XmlBaseSerializer {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
if (typeof children === 'string' || typeof children === 'number') {
|
|
81
|
-
node.textContent = children.toString()
|
|
81
|
+
node.textContent = children.toString() /* eslint-disable-line no-param-reassign -- ack */
|
|
82
82
|
return
|
|
83
83
|
}
|
|
84
84
|
|
package/src/spec/consts.ts
CHANGED
|
@@ -17,6 +17,8 @@ SPDX-License-Identifier: Apache-2.0
|
|
|
17
17
|
Copyright (c) OWASP Foundation. All Rights Reserved.
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
+
/* eslint-disable max-lines -- ack */
|
|
21
|
+
|
|
20
22
|
import { ComponentType } from '../enums/componentType'
|
|
21
23
|
import { ExternalReferenceType } from '../enums/externalReferenceType'
|
|
22
24
|
import { HashAlgorithm } from '../enums/hashAlogorithm'
|
|
@@ -434,7 +436,122 @@ export const Spec1dot6: Readonly<_SpecProtocol> = Object.freeze(new _Spec(
|
|
|
434
436
|
true
|
|
435
437
|
))
|
|
436
438
|
|
|
439
|
+
|
|
440
|
+
/** Specification v1.7 */
|
|
441
|
+
export const Spec1dot7: Readonly<_SpecProtocol> = Object.freeze(new _Spec(
|
|
442
|
+
Version.v1dot7,
|
|
443
|
+
[
|
|
444
|
+
Format.XML,
|
|
445
|
+
Format.JSON
|
|
446
|
+
],
|
|
447
|
+
[
|
|
448
|
+
ComponentType.Application,
|
|
449
|
+
ComponentType.Framework,
|
|
450
|
+
ComponentType.Library,
|
|
451
|
+
ComponentType.Container,
|
|
452
|
+
ComponentType.Platform,
|
|
453
|
+
ComponentType.OperatingSystem,
|
|
454
|
+
ComponentType.Device,
|
|
455
|
+
ComponentType.DeviceDriver,
|
|
456
|
+
ComponentType.Firmware,
|
|
457
|
+
ComponentType.File,
|
|
458
|
+
ComponentType.MachineLearningModel,
|
|
459
|
+
ComponentType.Data,
|
|
460
|
+
ComponentType.CryptographicAsset
|
|
461
|
+
],
|
|
462
|
+
[
|
|
463
|
+
HashAlgorithm.MD5,
|
|
464
|
+
HashAlgorithm['SHA-1'],
|
|
465
|
+
HashAlgorithm['SHA-256'],
|
|
466
|
+
HashAlgorithm['SHA-384'],
|
|
467
|
+
HashAlgorithm['SHA-512'],
|
|
468
|
+
HashAlgorithm['SHA3-256'],
|
|
469
|
+
HashAlgorithm['SHA3-384'],
|
|
470
|
+
HashAlgorithm['SHA3-512'],
|
|
471
|
+
HashAlgorithm['BLAKE2b-256'],
|
|
472
|
+
HashAlgorithm['BLAKE2b-384'],
|
|
473
|
+
HashAlgorithm['BLAKE2b-512'],
|
|
474
|
+
HashAlgorithm.BLAKE3,
|
|
475
|
+
HashAlgorithm['Streebog-256'],
|
|
476
|
+
HashAlgorithm['Streebog-512'],
|
|
477
|
+
],
|
|
478
|
+
/^([a-fA-F0-9]{32})$|^([a-fA-F0-9]{40})$|^([a-fA-F0-9]{64})$|^([a-fA-F0-9]{96})$|^([a-fA-F0-9]{128})$/,
|
|
479
|
+
[
|
|
480
|
+
ExternalReferenceType.VCS,
|
|
481
|
+
ExternalReferenceType.IssueTracker,
|
|
482
|
+
ExternalReferenceType.Website,
|
|
483
|
+
ExternalReferenceType.Advisories,
|
|
484
|
+
ExternalReferenceType.BOM,
|
|
485
|
+
ExternalReferenceType.MailingList,
|
|
486
|
+
ExternalReferenceType.Social,
|
|
487
|
+
ExternalReferenceType.Chat,
|
|
488
|
+
ExternalReferenceType.Documentation,
|
|
489
|
+
ExternalReferenceType.Support,
|
|
490
|
+
ExternalReferenceType.SourceDistribution,
|
|
491
|
+
ExternalReferenceType.Distribution,
|
|
492
|
+
ExternalReferenceType.DistributionIntake,
|
|
493
|
+
ExternalReferenceType.License,
|
|
494
|
+
ExternalReferenceType.BuildMeta,
|
|
495
|
+
ExternalReferenceType.BuildSystem,
|
|
496
|
+
ExternalReferenceType.ReleaseNotes,
|
|
497
|
+
ExternalReferenceType.SecurityContact,
|
|
498
|
+
ExternalReferenceType.ModelCard,
|
|
499
|
+
ExternalReferenceType.Log,
|
|
500
|
+
ExternalReferenceType.Configuration,
|
|
501
|
+
ExternalReferenceType.Evidence,
|
|
502
|
+
ExternalReferenceType.Formulation,
|
|
503
|
+
ExternalReferenceType.Attestation,
|
|
504
|
+
ExternalReferenceType.ThreatModel,
|
|
505
|
+
ExternalReferenceType.AdversaryModel,
|
|
506
|
+
ExternalReferenceType.RiskAssessment,
|
|
507
|
+
ExternalReferenceType.VulnerabilityAssertion,
|
|
508
|
+
ExternalReferenceType.ExploitabilityStatement,
|
|
509
|
+
ExternalReferenceType.PentestReport,
|
|
510
|
+
ExternalReferenceType.StaticAnalysisReport,
|
|
511
|
+
ExternalReferenceType.DynamicAnalysisReport,
|
|
512
|
+
ExternalReferenceType.RuntimeAnalysisReport,
|
|
513
|
+
ExternalReferenceType.ComponentAnalysisReport,
|
|
514
|
+
ExternalReferenceType.MaturityReport,
|
|
515
|
+
ExternalReferenceType.CertificationReport,
|
|
516
|
+
ExternalReferenceType.CodifiedInfrastructure,
|
|
517
|
+
ExternalReferenceType.QualityMetrics,
|
|
518
|
+
ExternalReferenceType.POAM,
|
|
519
|
+
ExternalReferenceType.ElectronicSignature,
|
|
520
|
+
ExternalReferenceType.DigitalSignature,
|
|
521
|
+
ExternalReferenceType.RFC9116,
|
|
522
|
+
ExternalReferenceType.Citation,
|
|
523
|
+
ExternalReferenceType.Patent,
|
|
524
|
+
ExternalReferenceType.PatentAssertion,
|
|
525
|
+
ExternalReferenceType.PatentFamily,
|
|
526
|
+
ExternalReferenceType.RFC9116,
|
|
527
|
+
ExternalReferenceType.Other
|
|
528
|
+
],
|
|
529
|
+
true,
|
|
530
|
+
true,
|
|
531
|
+
false,
|
|
532
|
+
true,
|
|
533
|
+
true,
|
|
534
|
+
[
|
|
535
|
+
VulnerabilityRatingMethod.CVSSv2,
|
|
536
|
+
VulnerabilityRatingMethod.CVSSv3,
|
|
537
|
+
VulnerabilityRatingMethod.CVSSv31,
|
|
538
|
+
VulnerabilityRatingMethod.CVSSv4,
|
|
539
|
+
VulnerabilityRatingMethod.OWASP,
|
|
540
|
+
VulnerabilityRatingMethod.SSVC,
|
|
541
|
+
VulnerabilityRatingMethod.Other
|
|
542
|
+
],
|
|
543
|
+
true,
|
|
544
|
+
true,
|
|
545
|
+
true,
|
|
546
|
+
true,
|
|
547
|
+
true,
|
|
548
|
+
true,
|
|
549
|
+
true,
|
|
550
|
+
true
|
|
551
|
+
))
|
|
552
|
+
|
|
437
553
|
export const SpecVersionDict: Readonly<Partial<Record<Version, Readonly<_SpecProtocol>>>> = Object.freeze({
|
|
554
|
+
[Version.v1dot7]: Spec1dot7,
|
|
438
555
|
[Version.v1dot6]: Spec1dot6,
|
|
439
556
|
[Version.v1dot5]: Spec1dot5,
|
|
440
557
|
[Version.v1dot4]: Spec1dot4,
|
package/src/spec/enums.ts
CHANGED
|
@@ -43,6 +43,7 @@ abstract class BaseJsonValidator extends BaseValidator {
|
|
|
43
43
|
try {
|
|
44
44
|
this.#validatorCache = await makeValidator(this.#getSchemaFilePath(), {
|
|
45
45
|
'http://cyclonedx.org/schema/spdx.SNAPSHOT.schema.json': FILES.SPDX.JSON_SCHEMA,
|
|
46
|
+
'http://cyclonedx.org/schema/cryptography-defs.SNAPSHOT.schema.json': FILES.CryptoDefs.JSON_SCHEMA,
|
|
46
47
|
'http://cyclonedx.org/schema/jsf-0.82.SNAPSHOT.schema.json': FILES.JSF.JSON_SCHEMA
|
|
47
48
|
})
|
|
48
49
|
} catch (err) {
|
package/tsconfig.d.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["./src/index.common.ts","./src/index.node.ts","./src/index.web.ts","./src/resources.node.ts","./src/spdx.ts"],"version":"5.9.
|
|
1
|
+
{"root":["./src/index.common.ts","./src/index.node.ts","./src/index.web.ts","./src/resources.node.ts","./src/spdx.ts"],"version":"5.9.3"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["./src/index.node.ts","./src/_optPlug.node/__jsonValidators/ajv.ts","./src/_optPlug.node/__xmlStringifiers/xmlbuilder2.ts","./src/_optPlug.node/__xmlValidators/libxmljs2.ts"],"version":"5.9.
|
|
1
|
+
{"root":["./src/index.node.ts","./src/_optPlug.node/__jsonValidators/ajv.ts","./src/_optPlug.node/__xmlStringifiers/xmlbuilder2.ts","./src/_optPlug.node/__xmlValidators/libxmljs2.ts"],"version":"5.9.3"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stringable.d.ts","sourceRoot":"","sources":["../../src/_helpers/stringable.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,MAAM,CAAA;CACvB"}
|
|
@@ -1,21 +0,0 @@
|
|
|
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
|
-
*/
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
//# sourceMappingURL=stringable.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stringable.js","sourceRoot":"","sources":["../../src/_helpers/stringable.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE"}
|
|
File without changes
|