@cyclonedx/cyclonedx-library 1.0.0-beta.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.
Files changed (169) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +5 -0
  3. package/README.md +152 -0
  4. package/dist.node/_index.node.js +53 -0
  5. package/dist.node/_index.node.js.map +1 -0
  6. package/dist.node/enums/attachmentEncoding.js +26 -0
  7. package/dist.node/enums/attachmentEncoding.js.map +1 -0
  8. package/dist.node/enums/componentScope.js +28 -0
  9. package/dist.node/enums/componentScope.js.map +1 -0
  10. package/dist.node/enums/componentType.js +33 -0
  11. package/dist.node/enums/componentType.js.map +1 -0
  12. package/dist.node/enums/externalReferenceType.js +41 -0
  13. package/dist.node/enums/externalReferenceType.js.map +1 -0
  14. package/dist.node/enums/hashAlogorithm.js +37 -0
  15. package/dist.node/enums/hashAlogorithm.js.map +1 -0
  16. package/dist.node/enums/index.js +40 -0
  17. package/dist.node/enums/index.js.map +1 -0
  18. package/dist.node/factories/index.js +36 -0
  19. package/dist.node/factories/index.js.map +1 -0
  20. package/dist.node/factories/licenseFactory.js +56 -0
  21. package/dist.node/factories/licenseFactory.js.map +1 -0
  22. package/dist.node/helpers/types.js +26 -0
  23. package/dist.node/helpers/types.js.map +1 -0
  24. package/dist.node/models/attachment.js +30 -0
  25. package/dist.node/models/attachment.js.map +1 -0
  26. package/dist.node/models/bom.js +67 -0
  27. package/dist.node/models/bom.js.map +1 -0
  28. package/dist.node/models/bomRef.js +37 -0
  29. package/dist.node/models/bomRef.js.map +1 -0
  30. package/dist.node/models/component.js +96 -0
  31. package/dist.node/models/component.js.map +1 -0
  32. package/dist.node/models/externalReference.js +40 -0
  33. package/dist.node/models/externalReference.js.map +1 -0
  34. package/dist.node/models/hash.js +29 -0
  35. package/dist.node/models/hash.js.map +1 -0
  36. package/dist.node/models/index.js +47 -0
  37. package/dist.node/models/index.js.map +1 -0
  38. package/dist.node/models/license.js +103 -0
  39. package/dist.node/models/license.js.map +1 -0
  40. package/dist.node/models/metadata.js +35 -0
  41. package/dist.node/models/metadata.js.map +1 -0
  42. package/dist.node/models/organizationalContact.js +41 -0
  43. package/dist.node/models/organizationalContact.js.map +1 -0
  44. package/dist.node/models/organizationalEntity.js +31 -0
  45. package/dist.node/models/organizationalEntity.js.map +1 -0
  46. package/dist.node/models/swid.js +58 -0
  47. package/dist.node/models/swid.js.map +1 -0
  48. package/dist.node/models/tool.js +45 -0
  49. package/dist.node/models/tool.js.map +1 -0
  50. package/dist.node/resources.node.js +55 -0
  51. package/dist.node/resources.node.js.map +1 -0
  52. package/dist.node/serialize/_index.node.js +37 -0
  53. package/dist.node/serialize/_index.node.js.map +1 -0
  54. package/dist.node/serialize/baseSerializer.js +56 -0
  55. package/dist.node/serialize/baseSerializer.js.map +1 -0
  56. package/dist.node/serialize/bomRefDiscriminator.js +66 -0
  57. package/dist.node/serialize/bomRefDiscriminator.js.map +1 -0
  58. package/dist.node/serialize/index.js +55 -0
  59. package/dist.node/serialize/index.js.map +1 -0
  60. package/dist.node/serialize/json/index.js +47 -0
  61. package/dist.node/serialize/json/index.js.map +1 -0
  62. package/dist.node/serialize/json/normalize.js +431 -0
  63. package/dist.node/serialize/json/normalize.js.map +1 -0
  64. package/dist.node/serialize/json/types.js +35 -0
  65. package/dist.node/serialize/json/types.js.map +1 -0
  66. package/dist.node/serialize/jsonSerializer.js +55 -0
  67. package/dist.node/serialize/jsonSerializer.js.map +1 -0
  68. package/dist.node/serialize/types.js +21 -0
  69. package/dist.node/serialize/types.js.map +1 -0
  70. package/dist.node/serialize/xml/index.js +47 -0
  71. package/dist.node/serialize/xml/index.js.map +1 -0
  72. package/dist.node/serialize/xml/normalize.js +560 -0
  73. package/dist.node/serialize/xml/normalize.js.map +1 -0
  74. package/dist.node/serialize/xml/types.js +31 -0
  75. package/dist.node/serialize/xml/types.js.map +1 -0
  76. package/dist.node/serialize/xmlBaseSerializer.js +52 -0
  77. package/dist.node/serialize/xmlBaseSerializer.js.map +1 -0
  78. package/dist.node/serialize/xmlSerializer.node.js +30 -0
  79. package/dist.node/serialize/xmlSerializer.node.js.map +1 -0
  80. package/dist.node/spdx.js +35 -0
  81. package/dist.node/spdx.js.map +1 -0
  82. package/dist.node/spec.js +229 -0
  83. package/dist.node/spec.js.map +1 -0
  84. package/dist.node/types/cpe.js +28 -0
  85. package/dist.node/types/cpe.js.map +1 -0
  86. package/dist.node/types/index.js +39 -0
  87. package/dist.node/types/index.js.map +1 -0
  88. package/dist.node/types/integer.js +36 -0
  89. package/dist.node/types/integer.js.map +1 -0
  90. package/dist.node/types/mimeType.js +28 -0
  91. package/dist.node/types/mimeType.js.map +1 -0
  92. package/dist.node/types/urn.js +28 -0
  93. package/dist.node/types/urn.js.map +1 -0
  94. package/dist.web/lib.dev.js +3487 -0
  95. package/dist.web/lib.dev.js.map +1 -0
  96. package/dist.web/lib.js +2 -0
  97. package/dist.web/lib.js.LICENSE.txt +18 -0
  98. package/libs/universal-node-xml/index.d.ts +33 -0
  99. package/libs/universal-node-xml/index.js +42 -0
  100. package/libs/universal-node-xml/stringifiers/helpers.js +17 -0
  101. package/libs/universal-node-xml/stringifiers/xmlbuilder2.js +51 -0
  102. package/package.json +86 -0
  103. package/res/README.md +27 -0
  104. package/res/bom-1.0.SNAPSHOT.xsd +247 -0
  105. package/res/bom-1.1.SNAPSHOT.xsd +731 -0
  106. package/res/bom-1.2-strict.SNAPSHOT.schema.json +1026 -0
  107. package/res/bom-1.2.SNAPSHOT.schema.json +997 -0
  108. package/res/bom-1.2.SNAPSHOT.xsd +1418 -0
  109. package/res/bom-1.3-strict.SNAPSHOT.schema.json +1085 -0
  110. package/res/bom-1.3.SNAPSHOT.schema.json +1054 -0
  111. package/res/bom-1.3.SNAPSHOT.xsd +1631 -0
  112. package/res/bom-1.4.SNAPSHOT.schema.json +1697 -0
  113. package/res/bom-1.4.SNAPSHOT.xsd +2407 -0
  114. package/res/jsf-0.82.SNAPSHOT.schema.json +244 -0
  115. package/res/spdx.SNAPSHOT.schema.json +533 -0
  116. package/res/spdx.SNAPSHOT.xsd +2639 -0
  117. package/src/_index.node.ts +31 -0
  118. package/src/_index.web.ts +27 -0
  119. package/src/enums/attachmentEncoding.ts +22 -0
  120. package/src/enums/componentScope.ts +24 -0
  121. package/src/enums/componentType.ts +29 -0
  122. package/src/enums/externalReferenceType.ts +37 -0
  123. package/src/enums/hashAlogorithm.ts +33 -0
  124. package/src/enums/index.ts +24 -0
  125. package/src/factories/index.ts +20 -0
  126. package/src/factories/licenseFactory.ts +62 -0
  127. package/src/helpers/README.md +3 -0
  128. package/src/helpers/types.ts +28 -0
  129. package/src/models/attachment.ts +37 -0
  130. package/src/models/bom.ts +85 -0
  131. package/src/models/bomRef.ts +41 -0
  132. package/src/models/component.ts +136 -0
  133. package/src/models/externalReference.ts +48 -0
  134. package/src/models/hash.ts +38 -0
  135. package/src/models/index.ts +31 -0
  136. package/src/models/license.ts +133 -0
  137. package/src/models/metadata.ts +50 -0
  138. package/src/models/organizationalContact.ts +49 -0
  139. package/src/models/organizationalEntity.ts +38 -0
  140. package/src/models/swid.ts +71 -0
  141. package/src/models/tool.ts +58 -0
  142. package/src/resources.node.ts +59 -0
  143. package/src/serialize/_index.node.ts +23 -0
  144. package/src/serialize/_index.web.ts +23 -0
  145. package/src/serialize/baseSerializer.ts +52 -0
  146. package/src/serialize/bomRefDiscriminator.ts +69 -0
  147. package/src/serialize/index.ts +35 -0
  148. package/src/serialize/json/index.ts +23 -0
  149. package/src/serialize/json/normalize.ts +450 -0
  150. package/src/serialize/json/types.ts +187 -0
  151. package/src/serialize/jsonSerializer.ts +59 -0
  152. package/src/serialize/types.ts +38 -0
  153. package/src/serialize/xml/index.ts +23 -0
  154. package/src/serialize/xml/normalize.ts +590 -0
  155. package/src/serialize/xml/types.ts +112 -0
  156. package/src/serialize/xmlBaseSerializer.ts +52 -0
  157. package/src/serialize/xmlSerializer.node.ts +35 -0
  158. package/src/serialize/xmlSerializer.web.ts +89 -0
  159. package/src/spdx.ts +48 -0
  160. package/src/spec.ts +289 -0
  161. package/src/types/cpe.ts +33 -0
  162. package/src/types/index.ts +23 -0
  163. package/src/types/integer.ts +50 -0
  164. package/src/types/mimeType.ts +31 -0
  165. package/src/types/urn.ts +33 -0
  166. package/tsconfig.json +108 -0
  167. package/tsconfig.node.json +8 -0
  168. package/tsconfig.web.json +5 -0
  169. package/webpack.config.js +74 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xmlBaseSerializer.js","sourceRoot":"","sources":["../../src/serialize/xmlBaseSerializer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE;;;;;;;;;;;;;;;AAGF,kCAAwD;AACxD,qDAAiD;AAQjD,MAAsB,iBAAkB,SAAQ,+BAAiC;IAM/E,YAAa,iBAAoC;QAC/C,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,cAAc,CAAC,aAAM,CAAC,IAAI,CAAC,EAAE;YACvD,MAAM,IAAI,6BAAsB,CAAC,oCAAoC,CAAC,CAAA;SACvE;QAED,KAAK,EAAE,CAAA;QAVT,uDAA8C;QAW5C,uBAAA,IAAI,wCAAsB,iBAAiB,MAAA,CAAA;IAC7C,CAAC;IAES,UAAU,CAClB,GAAQ,EACR,UAA6B,EAAE;QAE/B,OAAO,uBAAA,IAAI,4CAAmB,CAAC,UAAU,EAAE;aACxC,SAAS,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;IAC5B,CAAC;CACF;AAtBD,8CAsBC"}
@@ -0,0 +1,30 @@
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
+ exports.XmlSerializer = void 0;
22
+ const xmlBaseSerializer_1 = require("./xmlBaseSerializer");
23
+ const universal_node_xml_1 = require("../../libs/universal-node-xml");
24
+ class XmlSerializer extends xmlBaseSerializer_1.XmlBaseSerializer {
25
+ _serialize(normalizedBom, options = {}) {
26
+ return (0, universal_node_xml_1.stringifyFallback)(normalizedBom, options);
27
+ }
28
+ }
29
+ exports.XmlSerializer = XmlSerializer;
30
+ //# sourceMappingURL=xmlSerializer.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xmlSerializer.node.js","sourceRoot":"","sources":["../../src/serialize/xmlSerializer.node.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE;;;AAGF,2DAAuD;AAEvD,sEAAiE;AAKjE,MAAa,aAAc,SAAQ,qCAAiB;IACxC,UAAU,CAClB,aAAgC,EAChC,UAA6B,EAAE;QAE/B,OAAO,IAAA,sCAAiB,EAAC,aAAa,EAAE,OAAO,CAAC,CAAA;IAClD,CAAC;CACF;AAPD,sCAOC"}
@@ -0,0 +1,35 @@
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
+ exports.fixupSpdxId = exports.isSupportedSpdxId = void 0;
22
+ const spdx_SNAPSHOT_schema_json_1 = require("../res/spdx.SNAPSHOT.schema.json");
23
+ const spdxIds = new Set(spdx_SNAPSHOT_schema_json_1.enum);
24
+ const spdxLowerToActual = new Map(spdx_SNAPSHOT_schema_json_1.enum.map(spdxId => [spdxId.toLowerCase(), spdxId]));
25
+ function isSupportedSpdxId(value) {
26
+ return spdxIds.has(value);
27
+ }
28
+ exports.isSupportedSpdxId = isSupportedSpdxId;
29
+ function fixupSpdxId(value) {
30
+ return typeof value === 'string' && value.length > 0
31
+ ? spdxLowerToActual.get(value.toLowerCase())
32
+ : undefined;
33
+ }
34
+ exports.fixupSpdxId = fixupSpdxId;
35
+ //# sourceMappingURL=spdx.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spdx.js","sourceRoot":"","sources":["../src/spdx.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE;;;AAIF,gFAAsE;AAWtE,MAAM,OAAO,GAAwB,IAAI,GAAG,CAAC,gCAAa,CAAC,CAAA;AAE3D,MAAM,iBAAiB,GAAgC,IAAI,GAAG,CAC5D,gCAAa,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,MAAM,CAAC,CAAC,CAC5D,CAAA;AAED,SAAgB,iBAAiB,CAAE,KAAmB;IACpD,OAAO,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;AAC3B,CAAC;AAFD,8CAEC;AAGD,SAAgB,WAAW,CAAE,KAAmB;IAC9C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;QAClD,CAAC,CAAC,iBAAiB,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;QAC5C,CAAC,CAAC,SAAS,CAAA;AACf,CAAC;AAJD,kCAIC"}
@@ -0,0 +1,229 @@
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
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
21
+ if (kind === "m") throw new TypeError("Private method is not writable");
22
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
23
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
24
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
25
+ };
26
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
27
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
28
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
29
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
30
+ };
31
+ var _Spec_version, _Spec_formats, _Spec_componentTypes, _Spec_hashAlgorithms, _Spec_hashValuePattern, _Spec_externalReferenceTypes, _Spec_supportsDependencyGraph, _Spec_supportsToolReferences;
32
+ Object.defineProperty(exports, "__esModule", { value: true });
33
+ exports.SpecVersionDict = exports.Spec1dot4 = exports.Spec1dot3 = exports.Spec1dot2 = exports.UnsupportedFormatError = exports.Format = exports.Version = void 0;
34
+ const enums_1 = require("./enums");
35
+ var Version;
36
+ (function (Version) {
37
+ Version["v1dot0"] = "1.0";
38
+ Version["v1dot1"] = "1.1";
39
+ Version["v1dot2"] = "1.2";
40
+ Version["v1dot3"] = "1.3";
41
+ Version["v1dot4"] = "1.4";
42
+ })(Version = exports.Version || (exports.Version = {}));
43
+ var Format;
44
+ (function (Format) {
45
+ Format["XML"] = "xml";
46
+ Format["JSON"] = "json";
47
+ })(Format = exports.Format || (exports.Format = {}));
48
+ class UnsupportedFormatError extends Error {
49
+ }
50
+ exports.UnsupportedFormatError = UnsupportedFormatError;
51
+ class Spec {
52
+ constructor(version, formats, componentTypes, hashAlgorithms, hashValuePattern, externalReferenceTypes, supportsDependencyGraph, supportsToolReferences) {
53
+ _Spec_version.set(this, void 0);
54
+ _Spec_formats.set(this, void 0);
55
+ _Spec_componentTypes.set(this, void 0);
56
+ _Spec_hashAlgorithms.set(this, void 0);
57
+ _Spec_hashValuePattern.set(this, void 0);
58
+ _Spec_externalReferenceTypes.set(this, void 0);
59
+ _Spec_supportsDependencyGraph.set(this, void 0);
60
+ _Spec_supportsToolReferences.set(this, void 0);
61
+ __classPrivateFieldSet(this, _Spec_version, version, "f");
62
+ __classPrivateFieldSet(this, _Spec_formats, new Set(formats), "f");
63
+ __classPrivateFieldSet(this, _Spec_componentTypes, new Set(componentTypes), "f");
64
+ __classPrivateFieldSet(this, _Spec_hashAlgorithms, new Set(hashAlgorithms), "f");
65
+ __classPrivateFieldSet(this, _Spec_hashValuePattern, hashValuePattern, "f");
66
+ __classPrivateFieldSet(this, _Spec_externalReferenceTypes, new Set(externalReferenceTypes), "f");
67
+ __classPrivateFieldSet(this, _Spec_supportsDependencyGraph, supportsDependencyGraph, "f");
68
+ __classPrivateFieldSet(this, _Spec_supportsToolReferences, supportsToolReferences, "f");
69
+ }
70
+ get version() {
71
+ return __classPrivateFieldGet(this, _Spec_version, "f");
72
+ }
73
+ supportsFormat(f) {
74
+ return __classPrivateFieldGet(this, _Spec_formats, "f").has(f);
75
+ }
76
+ supportsComponentType(ct) {
77
+ return __classPrivateFieldGet(this, _Spec_componentTypes, "f").has(ct);
78
+ }
79
+ supportsHashAlgorithm(ha) {
80
+ return __classPrivateFieldGet(this, _Spec_hashAlgorithms, "f").has(ha);
81
+ }
82
+ supportsHashValue(hv) {
83
+ return typeof hv === 'string' &&
84
+ __classPrivateFieldGet(this, _Spec_hashValuePattern, "f").test(hv);
85
+ }
86
+ supportsExternalReferenceType(ert) {
87
+ return __classPrivateFieldGet(this, _Spec_externalReferenceTypes, "f").has(ert);
88
+ }
89
+ get supportsDependencyGraph() {
90
+ return __classPrivateFieldGet(this, _Spec_supportsDependencyGraph, "f");
91
+ }
92
+ get supportsToolReferences() {
93
+ return __classPrivateFieldGet(this, _Spec_supportsToolReferences, "f");
94
+ }
95
+ }
96
+ _Spec_version = new WeakMap(), _Spec_formats = new WeakMap(), _Spec_componentTypes = new WeakMap(), _Spec_hashAlgorithms = new WeakMap(), _Spec_hashValuePattern = new WeakMap(), _Spec_externalReferenceTypes = new WeakMap(), _Spec_supportsDependencyGraph = new WeakMap(), _Spec_supportsToolReferences = new WeakMap();
97
+ exports.Spec1dot2 = Object.freeze(new Spec(Version.v1dot2, [
98
+ Format.XML,
99
+ Format.JSON
100
+ ], [
101
+ enums_1.ComponentType.Application,
102
+ enums_1.ComponentType.Framework,
103
+ enums_1.ComponentType.Library,
104
+ enums_1.ComponentType.Container,
105
+ enums_1.ComponentType.OperatingSystem,
106
+ enums_1.ComponentType.Device,
107
+ enums_1.ComponentType.Firmware,
108
+ enums_1.ComponentType.File
109
+ ], [
110
+ enums_1.HashAlgorithm.MD5,
111
+ enums_1.HashAlgorithm['SHA-1'],
112
+ enums_1.HashAlgorithm['SHA-256'],
113
+ enums_1.HashAlgorithm['SHA-384'],
114
+ enums_1.HashAlgorithm['SHA-512'],
115
+ enums_1.HashAlgorithm['SHA3-256'],
116
+ enums_1.HashAlgorithm['SHA3-384'],
117
+ enums_1.HashAlgorithm['SHA3-512'],
118
+ enums_1.HashAlgorithm['BLAKE2b-256'],
119
+ enums_1.HashAlgorithm['BLAKE2b-384'],
120
+ enums_1.HashAlgorithm['BLAKE2b-512'],
121
+ enums_1.HashAlgorithm.BLAKE3
122
+ ], /^([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})$/, [
123
+ enums_1.ExternalReferenceType.VCS,
124
+ enums_1.ExternalReferenceType.IssueTracker,
125
+ enums_1.ExternalReferenceType.Website,
126
+ enums_1.ExternalReferenceType.Advisories,
127
+ enums_1.ExternalReferenceType.BOM,
128
+ enums_1.ExternalReferenceType.MailingList,
129
+ enums_1.ExternalReferenceType.Social,
130
+ enums_1.ExternalReferenceType.Chat,
131
+ enums_1.ExternalReferenceType.Documentation,
132
+ enums_1.ExternalReferenceType.Support,
133
+ enums_1.ExternalReferenceType.Distribution,
134
+ enums_1.ExternalReferenceType.License,
135
+ enums_1.ExternalReferenceType.BuildMeta,
136
+ enums_1.ExternalReferenceType.BuildSystem,
137
+ enums_1.ExternalReferenceType.Other
138
+ ], true, false));
139
+ exports.Spec1dot3 = Object.freeze(new Spec(Version.v1dot3, [
140
+ Format.XML,
141
+ Format.JSON
142
+ ], [
143
+ enums_1.ComponentType.Application,
144
+ enums_1.ComponentType.Framework,
145
+ enums_1.ComponentType.Library,
146
+ enums_1.ComponentType.Container,
147
+ enums_1.ComponentType.OperatingSystem,
148
+ enums_1.ComponentType.Device,
149
+ enums_1.ComponentType.Firmware,
150
+ enums_1.ComponentType.File
151
+ ], [
152
+ enums_1.HashAlgorithm.MD5,
153
+ enums_1.HashAlgorithm['SHA-1'],
154
+ enums_1.HashAlgorithm['SHA-256'],
155
+ enums_1.HashAlgorithm['SHA-384'],
156
+ enums_1.HashAlgorithm['SHA-512'],
157
+ enums_1.HashAlgorithm['SHA3-256'],
158
+ enums_1.HashAlgorithm['SHA3-384'],
159
+ enums_1.HashAlgorithm['SHA3-512'],
160
+ enums_1.HashAlgorithm['BLAKE2b-256'],
161
+ enums_1.HashAlgorithm['BLAKE2b-384'],
162
+ enums_1.HashAlgorithm['BLAKE2b-512'],
163
+ enums_1.HashAlgorithm.BLAKE3
164
+ ], /^([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})$/, [
165
+ enums_1.ExternalReferenceType.VCS,
166
+ enums_1.ExternalReferenceType.IssueTracker,
167
+ enums_1.ExternalReferenceType.Website,
168
+ enums_1.ExternalReferenceType.Advisories,
169
+ enums_1.ExternalReferenceType.BOM,
170
+ enums_1.ExternalReferenceType.MailingList,
171
+ enums_1.ExternalReferenceType.Social,
172
+ enums_1.ExternalReferenceType.Chat,
173
+ enums_1.ExternalReferenceType.Documentation,
174
+ enums_1.ExternalReferenceType.Support,
175
+ enums_1.ExternalReferenceType.Distribution,
176
+ enums_1.ExternalReferenceType.License,
177
+ enums_1.ExternalReferenceType.BuildMeta,
178
+ enums_1.ExternalReferenceType.BuildSystem,
179
+ enums_1.ExternalReferenceType.Other
180
+ ], true, false));
181
+ exports.Spec1dot4 = Object.freeze(new Spec(Version.v1dot4, [
182
+ Format.XML,
183
+ Format.JSON
184
+ ], [
185
+ enums_1.ComponentType.Application,
186
+ enums_1.ComponentType.Framework,
187
+ enums_1.ComponentType.Library,
188
+ enums_1.ComponentType.Container,
189
+ enums_1.ComponentType.OperatingSystem,
190
+ enums_1.ComponentType.Device,
191
+ enums_1.ComponentType.Firmware,
192
+ enums_1.ComponentType.File
193
+ ], [
194
+ enums_1.HashAlgorithm.MD5,
195
+ enums_1.HashAlgorithm['SHA-1'],
196
+ enums_1.HashAlgorithm['SHA-256'],
197
+ enums_1.HashAlgorithm['SHA-384'],
198
+ enums_1.HashAlgorithm['SHA-512'],
199
+ enums_1.HashAlgorithm['SHA3-256'],
200
+ enums_1.HashAlgorithm['SHA3-384'],
201
+ enums_1.HashAlgorithm['SHA3-512'],
202
+ enums_1.HashAlgorithm['BLAKE2b-256'],
203
+ enums_1.HashAlgorithm['BLAKE2b-384'],
204
+ enums_1.HashAlgorithm['BLAKE2b-512'],
205
+ enums_1.HashAlgorithm.BLAKE3
206
+ ], /^([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})$/, [
207
+ enums_1.ExternalReferenceType.VCS,
208
+ enums_1.ExternalReferenceType.IssueTracker,
209
+ enums_1.ExternalReferenceType.Website,
210
+ enums_1.ExternalReferenceType.Advisories,
211
+ enums_1.ExternalReferenceType.BOM,
212
+ enums_1.ExternalReferenceType.MailingList,
213
+ enums_1.ExternalReferenceType.Social,
214
+ enums_1.ExternalReferenceType.Chat,
215
+ enums_1.ExternalReferenceType.Documentation,
216
+ enums_1.ExternalReferenceType.Support,
217
+ enums_1.ExternalReferenceType.Distribution,
218
+ enums_1.ExternalReferenceType.License,
219
+ enums_1.ExternalReferenceType.BuildMeta,
220
+ enums_1.ExternalReferenceType.BuildSystem,
221
+ enums_1.ExternalReferenceType.ReleaseNotes,
222
+ enums_1.ExternalReferenceType.Other
223
+ ], true, true));
224
+ exports.SpecVersionDict = Object.freeze(Object.fromEntries([
225
+ [Version.v1dot2, exports.Spec1dot2],
226
+ [Version.v1dot3, exports.Spec1dot3],
227
+ [Version.v1dot4, exports.Spec1dot4]
228
+ ]));
229
+ //# sourceMappingURL=spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spec.js","sourceRoot":"","sources":["../src/spec.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE;;;;;;;;;;;;;;;AAEF,mCAA6E;AAG7E,IAAY,OAMX;AAND,WAAY,OAAO;IACjB,yBAAc,CAAA;IACd,yBAAc,CAAA;IACd,yBAAc,CAAA;IACd,yBAAc,CAAA;IACd,yBAAc,CAAA;AAChB,CAAC,EANW,OAAO,GAAP,eAAO,KAA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Y;IAClC,6BAAqB,CAAC,OAAO;IAC7B,6BAAqB,CAAC,UAAU;IAChC,6BAAqB,CAAC,GAAG;IACzB,6BAAqB,CAAC,WAAW;IACjC,6BAAqB,CAAC,MAAM;IAC5B,6BAAqB,CAAC,IAAI;IAC1B,6BAAqB,CAAC,aAAa;IACnC,6BAAqB,CAAC,OAAO;IAC7B,6BAAqB,CAAC,YAAY;IAClC,6BAAqB,CAAC,OAAO;IAC7B,6BAAqB,CAAC,SAAS;IAC/B,6BAAqB,CAAC,WAAW;IACjC,6BAAqB,CAAC,YAAY;IAClC,6BAAqB,CAAC,KAAK;CAC5B,EACD,IAAI,EACJ,IAAI,CACL,CAAC,CAAA;AAEW,QAAA,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC;IAC9D,CAAC,OAAO,CAAC,MAAM,EAAE,iBAAS,CAAC;IAC3B,CAAC,OAAO,CAAC,MAAM,EAAE,iBAAS,CAAC;IAC3B,CAAC,OAAO,CAAC,MAAM,EAAE,iBAAS,CAAC;CAC5B,CAA8C,CAAC,CAAA"}
@@ -0,0 +1,28 @@
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
+ exports.isCPE = void 0;
22
+ const cpePattern = /^([c][pP][eE]:\/[AHOaho]?(:[A-Za-z0-9\._\-~%]*){0,6})$|^(cpe:2\.3:[aho\*\-](:(((\?*|\*?)([a-zA-Z0-9\-\._]|(\\[\\\*\?!"#$$%&'\(\)\+,\/:;<=>@\[\]\^`\{\|}~]))+(\?*|\*?))|[\*\-])){5}(:(([a-zA-Z]{2,3}(-([a-zA-Z]{2}|[0-9]{3}))?)|[\*\-]))(:(((\?*|\*?)([a-zA-Z0-9\-\._]|(\\[\\\*\?!"#$$%&'\(\)\+,\/:;<=>@\[\]\^`\{\|}~]))+(\?*|\*?))|[\*\-])){4})$/;
23
+ function isCPE(value) {
24
+ return typeof value === 'string' &&
25
+ cpePattern.test(value);
26
+ }
27
+ exports.isCPE = isCPE;
28
+ //# sourceMappingURL=cpe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cpe.js","sourceRoot":"","sources":["../../src/types/cpe.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE;;;AAUF,MAAM,UAAU,GAAG,gXAAgX,CAAA;AAEnY,SAAgB,KAAK,CAAE,KAAU;IAC/B,OAAO,OAAO,KAAK,KAAK,QAAQ;QAC1B,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAC9B,CAAC;AAHD,sBAGC"}
@@ -0,0 +1,39 @@
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
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ var desc = Object.getOwnPropertyDescriptor(m, k);
23
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
24
+ desc = { enumerable: true, get: function() { return m[k]; } };
25
+ }
26
+ Object.defineProperty(o, k2, desc);
27
+ }) : (function(o, m, k, k2) {
28
+ if (k2 === undefined) k2 = k;
29
+ o[k2] = m[k];
30
+ }));
31
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
32
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
33
+ };
34
+ Object.defineProperty(exports, "__esModule", { value: true });
35
+ __exportStar(require("./cpe"), exports);
36
+ __exportStar(require("./integer"), exports);
37
+ __exportStar(require("./mimeType"), exports);
38
+ __exportStar(require("./urn"), exports);
39
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE;;;;;;;;;;;;;;;;AAEF,wCAAqB;AACrB,4CAAyB;AACzB,6CAA0B;AAC1B,wCAAqB"}
@@ -0,0 +1,36 @@
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
+ exports.isPositiveInteger = exports.isNonNegativeInteger = exports.isInteger = void 0;
22
+ function isInteger(value) {
23
+ return Number.isInteger(value);
24
+ }
25
+ exports.isInteger = isInteger;
26
+ function isNonNegativeInteger(value) {
27
+ return isInteger(value) &&
28
+ value >= 0;
29
+ }
30
+ exports.isNonNegativeInteger = isNonNegativeInteger;
31
+ function isPositiveInteger(value) {
32
+ return isInteger(value) &&
33
+ value > 0;
34
+ }
35
+ exports.isPositiveInteger = isPositiveInteger;
36
+ //# sourceMappingURL=integer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integer.js","sourceRoot":"","sources":["../../src/types/integer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE;;;AAQF,SAAgB,SAAS,CAAE,KAAU;IACnC,OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;AAChC,CAAC;AAFD,8BAEC;AAQD,SAAgB,oBAAoB,CAAE,KAAU;IAC9C,OAAO,SAAS,CAAC,KAAK,CAAC;QACrB,KAAK,IAAI,CAAC,CAAA;AACd,CAAC;AAHD,oDAGC;AAQD,SAAgB,iBAAiB,CAAE,KAAU;IAC3C,OAAO,SAAS,CAAC,KAAK,CAAC;QACjB,KAAK,GAAG,CAAC,CAAA;AACjB,CAAC;AAHD,8CAGC"}
@@ -0,0 +1,28 @@
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
+ exports.isMimeType = void 0;
22
+ const mimeTypePattern = /^[-+a-z0-9.]+\/[-+a-z0-9.]+$/;
23
+ function isMimeType(value) {
24
+ return typeof value === 'string' &&
25
+ mimeTypePattern.test(value);
26
+ }
27
+ exports.isMimeType = isMimeType;
28
+ //# sourceMappingURL=mimeType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mimeType.js","sourceRoot":"","sources":["../../src/types/mimeType.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE;;;AAQF,MAAM,eAAe,GAAG,8BAA8B,CAAA;AAEtD,SAAgB,UAAU,CAAE,KAAU;IACpC,OAAO,OAAO,KAAK,KAAK,QAAQ;QAC1B,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AACnC,CAAC;AAHD,gCAGC"}
@@ -0,0 +1,28 @@
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
+ exports.isUrnUuid = void 0;
22
+ const urnUuidPattern = /^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
23
+ function isUrnUuid(value) {
24
+ return typeof value === 'string' &&
25
+ urnUuidPattern.test(value);
26
+ }
27
+ exports.isUrnUuid = isUrnUuid;
28
+ //# sourceMappingURL=urn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"urn.js","sourceRoot":"","sources":["../../src/types/urn.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE;;;AAUF,MAAM,cAAc,GAAG,yEAAyE,CAAA;AAEhG,SAAgB,SAAS,CAAE,KAAU;IACnC,OAAO,OAAO,KAAK,KAAK,QAAQ;QAC3B,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AACjC,CAAC;AAHD,8BAGC"}