@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.
- package/LICENSE +201 -0
- package/NOTICE +5 -0
- package/README.md +152 -0
- package/dist.node/_index.node.js +53 -0
- package/dist.node/_index.node.js.map +1 -0
- package/dist.node/enums/attachmentEncoding.js +26 -0
- package/dist.node/enums/attachmentEncoding.js.map +1 -0
- package/dist.node/enums/componentScope.js +28 -0
- package/dist.node/enums/componentScope.js.map +1 -0
- package/dist.node/enums/componentType.js +33 -0
- package/dist.node/enums/componentType.js.map +1 -0
- package/dist.node/enums/externalReferenceType.js +41 -0
- package/dist.node/enums/externalReferenceType.js.map +1 -0
- package/dist.node/enums/hashAlogorithm.js +37 -0
- package/dist.node/enums/hashAlogorithm.js.map +1 -0
- package/dist.node/enums/index.js +40 -0
- package/dist.node/enums/index.js.map +1 -0
- package/dist.node/factories/index.js +36 -0
- package/dist.node/factories/index.js.map +1 -0
- package/dist.node/factories/licenseFactory.js +56 -0
- package/dist.node/factories/licenseFactory.js.map +1 -0
- package/dist.node/helpers/types.js +26 -0
- package/dist.node/helpers/types.js.map +1 -0
- package/dist.node/models/attachment.js +30 -0
- package/dist.node/models/attachment.js.map +1 -0
- package/dist.node/models/bom.js +67 -0
- package/dist.node/models/bom.js.map +1 -0
- package/dist.node/models/bomRef.js +37 -0
- package/dist.node/models/bomRef.js.map +1 -0
- package/dist.node/models/component.js +96 -0
- package/dist.node/models/component.js.map +1 -0
- package/dist.node/models/externalReference.js +40 -0
- package/dist.node/models/externalReference.js.map +1 -0
- package/dist.node/models/hash.js +29 -0
- package/dist.node/models/hash.js.map +1 -0
- package/dist.node/models/index.js +47 -0
- package/dist.node/models/index.js.map +1 -0
- package/dist.node/models/license.js +103 -0
- package/dist.node/models/license.js.map +1 -0
- package/dist.node/models/metadata.js +35 -0
- package/dist.node/models/metadata.js.map +1 -0
- package/dist.node/models/organizationalContact.js +41 -0
- package/dist.node/models/organizationalContact.js.map +1 -0
- package/dist.node/models/organizationalEntity.js +31 -0
- package/dist.node/models/organizationalEntity.js.map +1 -0
- package/dist.node/models/swid.js +58 -0
- package/dist.node/models/swid.js.map +1 -0
- package/dist.node/models/tool.js +45 -0
- package/dist.node/models/tool.js.map +1 -0
- package/dist.node/resources.node.js +55 -0
- package/dist.node/resources.node.js.map +1 -0
- package/dist.node/serialize/_index.node.js +37 -0
- package/dist.node/serialize/_index.node.js.map +1 -0
- package/dist.node/serialize/baseSerializer.js +56 -0
- package/dist.node/serialize/baseSerializer.js.map +1 -0
- package/dist.node/serialize/bomRefDiscriminator.js +66 -0
- package/dist.node/serialize/bomRefDiscriminator.js.map +1 -0
- package/dist.node/serialize/index.js +55 -0
- package/dist.node/serialize/index.js.map +1 -0
- package/dist.node/serialize/json/index.js +47 -0
- package/dist.node/serialize/json/index.js.map +1 -0
- package/dist.node/serialize/json/normalize.js +431 -0
- package/dist.node/serialize/json/normalize.js.map +1 -0
- package/dist.node/serialize/json/types.js +35 -0
- package/dist.node/serialize/json/types.js.map +1 -0
- package/dist.node/serialize/jsonSerializer.js +55 -0
- package/dist.node/serialize/jsonSerializer.js.map +1 -0
- package/dist.node/serialize/types.js +21 -0
- package/dist.node/serialize/types.js.map +1 -0
- package/dist.node/serialize/xml/index.js +47 -0
- package/dist.node/serialize/xml/index.js.map +1 -0
- package/dist.node/serialize/xml/normalize.js +560 -0
- package/dist.node/serialize/xml/normalize.js.map +1 -0
- package/dist.node/serialize/xml/types.js +31 -0
- package/dist.node/serialize/xml/types.js.map +1 -0
- package/dist.node/serialize/xmlBaseSerializer.js +52 -0
- package/dist.node/serialize/xmlBaseSerializer.js.map +1 -0
- package/dist.node/serialize/xmlSerializer.node.js +30 -0
- package/dist.node/serialize/xmlSerializer.node.js.map +1 -0
- package/dist.node/spdx.js +35 -0
- package/dist.node/spdx.js.map +1 -0
- package/dist.node/spec.js +229 -0
- package/dist.node/spec.js.map +1 -0
- package/dist.node/types/cpe.js +28 -0
- package/dist.node/types/cpe.js.map +1 -0
- package/dist.node/types/index.js +39 -0
- package/dist.node/types/index.js.map +1 -0
- package/dist.node/types/integer.js +36 -0
- package/dist.node/types/integer.js.map +1 -0
- package/dist.node/types/mimeType.js +28 -0
- package/dist.node/types/mimeType.js.map +1 -0
- package/dist.node/types/urn.js +28 -0
- package/dist.node/types/urn.js.map +1 -0
- package/dist.web/lib.dev.js +3487 -0
- package/dist.web/lib.dev.js.map +1 -0
- package/dist.web/lib.js +2 -0
- package/dist.web/lib.js.LICENSE.txt +18 -0
- package/libs/universal-node-xml/index.d.ts +33 -0
- package/libs/universal-node-xml/index.js +42 -0
- package/libs/universal-node-xml/stringifiers/helpers.js +17 -0
- package/libs/universal-node-xml/stringifiers/xmlbuilder2.js +51 -0
- package/package.json +86 -0
- package/res/README.md +27 -0
- package/res/bom-1.0.SNAPSHOT.xsd +247 -0
- package/res/bom-1.1.SNAPSHOT.xsd +731 -0
- package/res/bom-1.2-strict.SNAPSHOT.schema.json +1026 -0
- package/res/bom-1.2.SNAPSHOT.schema.json +997 -0
- package/res/bom-1.2.SNAPSHOT.xsd +1418 -0
- package/res/bom-1.3-strict.SNAPSHOT.schema.json +1085 -0
- package/res/bom-1.3.SNAPSHOT.schema.json +1054 -0
- package/res/bom-1.3.SNAPSHOT.xsd +1631 -0
- package/res/bom-1.4.SNAPSHOT.schema.json +1697 -0
- package/res/bom-1.4.SNAPSHOT.xsd +2407 -0
- package/res/jsf-0.82.SNAPSHOT.schema.json +244 -0
- package/res/spdx.SNAPSHOT.schema.json +533 -0
- package/res/spdx.SNAPSHOT.xsd +2639 -0
- package/src/_index.node.ts +31 -0
- package/src/_index.web.ts +27 -0
- package/src/enums/attachmentEncoding.ts +22 -0
- package/src/enums/componentScope.ts +24 -0
- package/src/enums/componentType.ts +29 -0
- package/src/enums/externalReferenceType.ts +37 -0
- package/src/enums/hashAlogorithm.ts +33 -0
- package/src/enums/index.ts +24 -0
- package/src/factories/index.ts +20 -0
- package/src/factories/licenseFactory.ts +62 -0
- package/src/helpers/README.md +3 -0
- package/src/helpers/types.ts +28 -0
- package/src/models/attachment.ts +37 -0
- package/src/models/bom.ts +85 -0
- package/src/models/bomRef.ts +41 -0
- package/src/models/component.ts +136 -0
- package/src/models/externalReference.ts +48 -0
- package/src/models/hash.ts +38 -0
- package/src/models/index.ts +31 -0
- package/src/models/license.ts +133 -0
- package/src/models/metadata.ts +50 -0
- package/src/models/organizationalContact.ts +49 -0
- package/src/models/organizationalEntity.ts +38 -0
- package/src/models/swid.ts +71 -0
- package/src/models/tool.ts +58 -0
- package/src/resources.node.ts +59 -0
- package/src/serialize/_index.node.ts +23 -0
- package/src/serialize/_index.web.ts +23 -0
- package/src/serialize/baseSerializer.ts +52 -0
- package/src/serialize/bomRefDiscriminator.ts +69 -0
- package/src/serialize/index.ts +35 -0
- package/src/serialize/json/index.ts +23 -0
- package/src/serialize/json/normalize.ts +450 -0
- package/src/serialize/json/types.ts +187 -0
- package/src/serialize/jsonSerializer.ts +59 -0
- package/src/serialize/types.ts +38 -0
- package/src/serialize/xml/index.ts +23 -0
- package/src/serialize/xml/normalize.ts +590 -0
- package/src/serialize/xml/types.ts +112 -0
- package/src/serialize/xmlBaseSerializer.ts +52 -0
- package/src/serialize/xmlSerializer.node.ts +35 -0
- package/src/serialize/xmlSerializer.web.ts +89 -0
- package/src/spdx.ts +48 -0
- package/src/spec.ts +289 -0
- package/src/types/cpe.ts +33 -0
- package/src/types/index.ts +23 -0
- package/src/types/integer.ts +50 -0
- package/src/types/mimeType.ts +31 -0
- package/src/types/urn.ts +33 -0
- package/tsconfig.json +108 -0
- package/tsconfig.node.json +8 -0
- package/tsconfig.web.json +5 -0
- package/webpack.config.js +74 -0
|
@@ -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.Metadata = void 0;
|
|
22
|
+
const tool_1 = require("./tool");
|
|
23
|
+
const organizationalContact_1 = require("./organizationalContact");
|
|
24
|
+
class Metadata {
|
|
25
|
+
constructor(op = {}) {
|
|
26
|
+
this.timestamp = op.timestamp;
|
|
27
|
+
this.tools = op.tools ?? new tool_1.ToolRepository();
|
|
28
|
+
this.authors = op.authors ?? new organizationalContact_1.OrganizationalContactRepository();
|
|
29
|
+
this.component = op.component;
|
|
30
|
+
this.manufacture = op.manufacture;
|
|
31
|
+
this.supplier = op.supplier;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.Metadata = Metadata;
|
|
35
|
+
//# sourceMappingURL=metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../src/models/metadata.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE;;;AAGF,iCAAuC;AAEvC,mEAAyE;AAWzE,MAAa,QAAQ;IAQnB,YAAa,KAAyB,EAAE;QACtC,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC,SAAS,CAAA;QAC7B,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC,KAAK,IAAI,IAAI,qBAAc,EAAE,CAAA;QAC7C,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC,OAAO,IAAI,IAAI,uDAA+B,EAAE,CAAA;QAClE,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC,SAAS,CAAA;QAC7B,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC,WAAW,CAAA;QACjC,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC,QAAQ,CAAA;IAC7B,CAAC;CACF;AAhBD,4BAgBC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
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.OrganizationalContactRepository = exports.OrganizationalContact = void 0;
|
|
22
|
+
class OrganizationalContact {
|
|
23
|
+
constructor(op = {}) {
|
|
24
|
+
this.name = op.name;
|
|
25
|
+
this.email = op.email;
|
|
26
|
+
this.phone = op.phone;
|
|
27
|
+
}
|
|
28
|
+
compare(other) {
|
|
29
|
+
return (this.name ?? '').localeCompare(other.name ?? '') ||
|
|
30
|
+
(this.email ?? '').localeCompare(other.email ?? '') ||
|
|
31
|
+
(this.phone ?? '').localeCompare(other.phone ?? '');
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.OrganizationalContact = OrganizationalContact;
|
|
35
|
+
class OrganizationalContactRepository extends Set {
|
|
36
|
+
static compareItems(a, b) {
|
|
37
|
+
return a.compare(b);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.OrganizationalContactRepository = OrganizationalContactRepository;
|
|
41
|
+
//# sourceMappingURL=organizationalContact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organizationalContact.js","sourceRoot":"","sources":["../../src/models/organizationalContact.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE;;;AAQF,MAAa,qBAAqB;IAKhC,YAAa,KAAyB,EAAE;QACtC,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,IAAI,CAAA;QACnB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC,KAAK,CAAA;QACrB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC,KAAK,CAAA;IACvB,CAAC;IAED,OAAO,CAAE,KAA4B;QAEnC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC;YACtD,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;YACnD,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,CAAA;IACvD,CAAC;CACF;AAjBD,sDAiBC;AAED,MAAa,+BAAgC,SAAQ,GAA0B;IAC7E,MAAM,CAAC,YAAY,CAAE,CAAwB,EAAE,CAAwB;QACrE,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IACrB,CAAC;CACF;AAJD,0EAIC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
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.OrganizationalEntity = void 0;
|
|
22
|
+
const organizationalContact_1 = require("./organizationalContact");
|
|
23
|
+
class OrganizationalEntity {
|
|
24
|
+
constructor(op = {}) {
|
|
25
|
+
this.name = op.name;
|
|
26
|
+
this.url = op.url ?? new Set();
|
|
27
|
+
this.contact = op.contact ?? new organizationalContact_1.OrganizationalContactRepository();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.OrganizationalEntity = OrganizationalEntity;
|
|
31
|
+
//# sourceMappingURL=organizationalEntity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organizationalEntity.js","sourceRoot":"","sources":["../../src/models/organizationalEntity.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE;;;AAEF,mEAAyE;AAQzE,MAAa,oBAAoB;IAK/B,YAAa,KAAyB,EAAE;QACtC,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,IAAI,CAAA;QACnB,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,IAAI,IAAI,GAAG,EAAE,CAAA;QAC9B,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC,OAAO,IAAI,IAAI,uDAA+B,EAAE,CAAA;IACpE,CAAC;CACF;AAVD,oDAUC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
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 __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
21
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
22
|
+
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");
|
|
23
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
24
|
+
};
|
|
25
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
26
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
27
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
28
|
+
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");
|
|
29
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
30
|
+
};
|
|
31
|
+
var _SWID_tagVersion;
|
|
32
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
+
exports.SWID = void 0;
|
|
34
|
+
const types_1 = require("../types");
|
|
35
|
+
class SWID {
|
|
36
|
+
constructor(tagId, name, op = {}) {
|
|
37
|
+
_SWID_tagVersion.set(this, void 0);
|
|
38
|
+
this.tagId = tagId;
|
|
39
|
+
this.name = name;
|
|
40
|
+
this.version = op.version;
|
|
41
|
+
this.patch = op.patch;
|
|
42
|
+
this.text = op.text;
|
|
43
|
+
this.url = op.url;
|
|
44
|
+
this.tagVersion = op.tagVersion;
|
|
45
|
+
}
|
|
46
|
+
get tagVersion() {
|
|
47
|
+
return __classPrivateFieldGet(this, _SWID_tagVersion, "f");
|
|
48
|
+
}
|
|
49
|
+
set tagVersion(value) {
|
|
50
|
+
if (value !== undefined && !(0, types_1.isNonNegativeInteger)(value)) {
|
|
51
|
+
throw new TypeError('Not NonNegativeInteger nor undefined');
|
|
52
|
+
}
|
|
53
|
+
__classPrivateFieldSet(this, _SWID_tagVersion, value, "f");
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.SWID = SWID;
|
|
57
|
+
_SWID_tagVersion = new WeakMap();
|
|
58
|
+
//# sourceMappingURL=swid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swid.js","sourceRoot":"","sources":["../../src/models/swid.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE;;;;;;;;;;;;;;;AAEF,oCAAmE;AAcnE,MAAa,IAAI;IAcf,YAAa,KAAa,EAAE,IAAY,EAAE,KAAyB,EAAE;QALrE,mCAAgC;QAM9B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC,OAAO,CAAA;QACzB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC,KAAK,CAAA;QACrB,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,IAAI,CAAA;QACnB,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,CAAA;QACjB,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC,UAAU,CAAA;IACjC,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,uBAAA,IAAI,wBAAY,CAAA;IACzB,CAAC;IAKD,IAAI,UAAU,CAAE,KAAqC;QACnD,IAAI,KAAK,KAAK,SAAS,IAAI,CAAC,IAAA,4BAAoB,EAAC,KAAK,CAAC,EAAE;YACvD,MAAM,IAAI,SAAS,CAAC,sCAAsC,CAAC,CAAA;SAC5D;QACD,uBAAA,IAAI,oBAAe,KAAK,MAAA,CAAA;IAC1B,CAAC;CACF;AArCD,oBAqCC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
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.ToolRepository = exports.Tool = void 0;
|
|
22
|
+
const hash_1 = require("./hash");
|
|
23
|
+
const externalReference_1 = require("./externalReference");
|
|
24
|
+
class Tool {
|
|
25
|
+
constructor(op = {}) {
|
|
26
|
+
this.vendor = op.vendor;
|
|
27
|
+
this.name = op.name;
|
|
28
|
+
this.version = op.version;
|
|
29
|
+
this.hashes = op.hashes ?? new hash_1.HashRepository();
|
|
30
|
+
this.externalReferences = op.externalReferences ?? new externalReference_1.ExternalReferenceRepository();
|
|
31
|
+
}
|
|
32
|
+
compare(other) {
|
|
33
|
+
return (this.vendor ?? '').localeCompare(other.vendor ?? '') ||
|
|
34
|
+
(this.name ?? '').localeCompare(other.name ?? '') ||
|
|
35
|
+
(this.version ?? '').localeCompare(other.version ?? '');
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.Tool = Tool;
|
|
39
|
+
class ToolRepository extends Set {
|
|
40
|
+
static compareItems(a, b) {
|
|
41
|
+
return a.compare(b);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.ToolRepository = ToolRepository;
|
|
45
|
+
//# sourceMappingURL=tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool.js","sourceRoot":"","sources":["../../src/models/tool.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE;;;AAEF,iCAAuC;AACvC,2DAAiE;AAUjE,MAAa,IAAI;IAOf,YAAa,KAAyB,EAAE;QACtC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC,MAAM,CAAA;QACvB,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,IAAI,CAAA;QACnB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC,OAAO,CAAA;QACzB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC,MAAM,IAAI,IAAI,qBAAc,EAAE,CAAA;QAC/C,IAAI,CAAC,kBAAkB,GAAG,EAAE,CAAC,kBAAkB,IAAI,IAAI,+CAA2B,EAAE,CAAA;IACtF,CAAC;IAED,OAAO,CAAE,KAAW;QAElB,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC;YAC1D,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC;YACjD,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC,CAAA;IAC3D,CAAC;CACF;AArBD,oBAqBC;AAED,MAAa,cAAe,SAAQ,GAAS;IAC3C,MAAM,CAAC,YAAY,CAAE,CAAO,EAAE,CAAO;QACnC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IACrB,CAAC;CACF;AAJD,wCAIC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
21
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.FILES = exports.ROOT = void 0;
|
|
25
|
+
const path_1 = __importDefault(require("path"));
|
|
26
|
+
const spec_1 = require("./spec");
|
|
27
|
+
exports.ROOT = path_1.default.resolve(__dirname, '..', 'res');
|
|
28
|
+
exports.FILES = Object.freeze({
|
|
29
|
+
CDX: Object.freeze({
|
|
30
|
+
XML_SCHEMA: Object.freeze(Object.fromEntries([
|
|
31
|
+
[spec_1.Version.v1dot0, path_1.default.resolve(exports.ROOT, 'bom-1.0.SNAPSHOT.xsd')],
|
|
32
|
+
[spec_1.Version.v1dot1, path_1.default.resolve(exports.ROOT, 'bom-1.1.SNAPSHOT.xsd')],
|
|
33
|
+
[spec_1.Version.v1dot2, path_1.default.resolve(exports.ROOT, 'bom-1.2.SNAPSHOT.xsd')],
|
|
34
|
+
[spec_1.Version.v1dot3, path_1.default.resolve(exports.ROOT, 'bom-1.3.SNAPSHOT.xsd')],
|
|
35
|
+
[spec_1.Version.v1dot4, path_1.default.resolve(exports.ROOT, 'bom-1.4.SNAPSHOT.xsd')]
|
|
36
|
+
])),
|
|
37
|
+
JSON_SCHEMA: Object.freeze(Object.fromEntries([
|
|
38
|
+
[spec_1.Version.v1dot2, path_1.default.resolve(exports.ROOT, 'bom-1.2.SNAPSHOT.schema.json')],
|
|
39
|
+
[spec_1.Version.v1dot3, path_1.default.resolve(exports.ROOT, 'bom-1.3.SNAPSHOT.schema.json')],
|
|
40
|
+
[spec_1.Version.v1dot4, path_1.default.resolve(exports.ROOT, 'bom-1.4.SNAPSHOT.schema.json')]
|
|
41
|
+
])),
|
|
42
|
+
JSON_STRICT_SCHEMA: Object.freeze(Object.fromEntries([
|
|
43
|
+
[spec_1.Version.v1dot2, path_1.default.resolve(exports.ROOT, 'bom-1.2-strict.SNAPSHOT.schema.json')],
|
|
44
|
+
[spec_1.Version.v1dot3, path_1.default.resolve(exports.ROOT, 'bom-1.3-strict.SNAPSHOT.schema.json')]
|
|
45
|
+
]))
|
|
46
|
+
}),
|
|
47
|
+
SPDX: Object.freeze({
|
|
48
|
+
XML_SCHEMA: path_1.default.resolve(exports.ROOT, 'spdx.SNAPSHOT.xsd'),
|
|
49
|
+
JSON_SCHEMA: path_1.default.resolve(exports.ROOT, 'spdx.SNAPSHOT.schema.json')
|
|
50
|
+
}),
|
|
51
|
+
JSF: Object.freeze({
|
|
52
|
+
JSON_SCHEMA: path_1.default.resolve(exports.ROOT, 'jsf-0.82.SNAPSHOT.schema.json')
|
|
53
|
+
})
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=resources.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resources.node.js","sourceRoot":"","sources":["../src/resources.node.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE;;;;;;AAEF,gDAAuB;AAEvB,iCAAgC;AAGnB,QAAA,IAAI,GAAG,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,CAAC,CAAA;AAG3C,QAAA,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC;IACjC,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC;YAC3C,CAAC,cAAO,CAAC,MAAM,EAAE,cAAI,CAAC,OAAO,CAAC,YAAI,EAAE,sBAAsB,CAAC,CAAC;YAC5D,CAAC,cAAO,CAAC,MAAM,EAAE,cAAI,CAAC,OAAO,CAAC,YAAI,EAAE,sBAAsB,CAAC,CAAC;YAC5D,CAAC,cAAO,CAAC,MAAM,EAAE,cAAI,CAAC,OAAO,CAAC,YAAI,EAAE,sBAAsB,CAAC,CAAC;YAC5D,CAAC,cAAO,CAAC,MAAM,EAAE,cAAI,CAAC,OAAO,CAAC,YAAI,EAAE,sBAAsB,CAAC,CAAC;YAC5D,CAAC,cAAO,CAAC,MAAM,EAAE,cAAI,CAAC,OAAO,CAAC,YAAI,EAAE,sBAAsB,CAAC,CAAC;SAC7D,CAAkC,CAAC;QACpC,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC;YAG5C,CAAC,cAAO,CAAC,MAAM,EAAE,cAAI,CAAC,OAAO,CAAC,YAAI,EAAE,8BAA8B,CAAC,CAAC;YACpE,CAAC,cAAO,CAAC,MAAM,EAAE,cAAI,CAAC,OAAO,CAAC,YAAI,EAAE,8BAA8B,CAAC,CAAC;YACpE,CAAC,cAAO,CAAC,MAAM,EAAE,cAAI,CAAC,OAAO,CAAC,YAAI,EAAE,8BAA8B,CAAC,CAAC;SACrE,CAAkC,CAAC;QACpC,kBAAkB,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC;YAGnD,CAAC,cAAO,CAAC,MAAM,EAAE,cAAI,CAAC,OAAO,CAAC,YAAI,EAAE,qCAAqC,CAAC,CAAC;YAC3E,CAAC,cAAO,CAAC,MAAM,EAAE,cAAI,CAAC,OAAO,CAAC,YAAI,EAAE,qCAAqC,CAAC,CAAC;SAE5E,CAAkC,CAAC;KACrC,CAAC;IACF,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC;QAClB,UAAU,EAAE,cAAI,CAAC,OAAO,CAAC,YAAI,EAAE,mBAAmB,CAAC;QACnD,WAAW,EAAE,cAAI,CAAC,OAAO,CAAC,YAAI,EAAE,2BAA2B,CAAC;KAC7D,CAAC;IACF,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC;QACjB,WAAW,EAAE,cAAI,CAAC,OAAO,CAAC,YAAI,EAAE,+BAA+B,CAAC;KACjE,CAAC;CACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
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("./index"), exports);
|
|
36
|
+
__exportStar(require("./xmlSerializer.node"), exports);
|
|
37
|
+
//# sourceMappingURL=_index.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_index.node.js","sourceRoot":"","sources":["../../src/serialize/_index.node.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE;;;;;;;;;;;;;;;;AAEF,0CAAuB;AAEvB,uDAAoC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
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 __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
21
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
22
|
+
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");
|
|
23
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
24
|
+
};
|
|
25
|
+
var _BaseSerializer_instances, _BaseSerializer_getAllBomRefs;
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.BaseSerializer = void 0;
|
|
28
|
+
const bomRefDiscriminator_1 = require("./bomRefDiscriminator");
|
|
29
|
+
class BaseSerializer {
|
|
30
|
+
constructor() {
|
|
31
|
+
_BaseSerializer_instances.add(this);
|
|
32
|
+
}
|
|
33
|
+
serialize(bom, options) {
|
|
34
|
+
const bomRefDiscriminator = new bomRefDiscriminator_1.BomRefDiscriminator(__classPrivateFieldGet(this, _BaseSerializer_instances, "m", _BaseSerializer_getAllBomRefs).call(this, bom));
|
|
35
|
+
try {
|
|
36
|
+
bomRefDiscriminator.discriminate();
|
|
37
|
+
const normalized = this._normalize(bom, options);
|
|
38
|
+
return this._serialize(normalized, options);
|
|
39
|
+
}
|
|
40
|
+
finally {
|
|
41
|
+
bomRefDiscriminator.reset();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.BaseSerializer = BaseSerializer;
|
|
46
|
+
_BaseSerializer_instances = new WeakSet(), _BaseSerializer_getAllBomRefs = function _BaseSerializer_getAllBomRefs(bom) {
|
|
47
|
+
const bomRefs = new Set();
|
|
48
|
+
if (bom.metadata.component !== undefined) {
|
|
49
|
+
bomRefs.add(bom.metadata.component.bomRef);
|
|
50
|
+
}
|
|
51
|
+
for (const { bomRef } of bom.components) {
|
|
52
|
+
bomRefs.add(bomRef);
|
|
53
|
+
}
|
|
54
|
+
return bomRefs.values();
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=baseSerializer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"baseSerializer.js","sourceRoot":"","sources":["../../src/serialize/baseSerializer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE;;;;;;;;;AAGF,+DAA2D;AAG3D,MAAsB,cAAc;IAApC;;IA4BA,CAAC;IA3BC,SAAS,CAAE,GAAQ,EAAE,OAA+C;QAClE,MAAM,mBAAmB,GAAG,IAAI,yCAAmB,CAAC,uBAAA,IAAI,gEAAe,MAAnB,IAAI,EAAgB,GAAG,CAAC,CAAC,CAAA;QAC7E,IAAI;YAGF,mBAAmB,CAAC,YAAY,EAAE,CAAA;YAElC,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;YAChD,OAAO,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;SAC5C;gBAAS;YACR,mBAAmB,CAAC,KAAK,EAAE,CAAA;SAC5B;IACH,CAAC;CAeF;AA5BD,wCA4BC;kHAbiB,GAAQ;IACtB,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAA;IACjC,IAAI,GAAG,CAAC,QAAQ,CAAC,SAAS,KAAK,SAAS,EAAE;QACxC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;KAC3C;IACD,KAAK,MAAM,EAAE,MAAM,EAAE,IAAI,GAAG,CAAC,UAAU,EAAE;QACvC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;KACpB;IACD,OAAO,OAAO,CAAC,MAAM,EAAE,CAAA;AACzB,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
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 _BomRefDiscriminator_instances, _BomRefDiscriminator_originalValues, _BomRefDiscriminator_prefix, _BomRefDiscriminator_makeUniqueId;
|
|
32
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
+
exports.BomRefDiscriminator = void 0;
|
|
34
|
+
class BomRefDiscriminator {
|
|
35
|
+
constructor(bomRefs, prefix = 'BomRef') {
|
|
36
|
+
_BomRefDiscriminator_instances.add(this);
|
|
37
|
+
_BomRefDiscriminator_originalValues.set(this, void 0);
|
|
38
|
+
_BomRefDiscriminator_prefix.set(this, void 0);
|
|
39
|
+
__classPrivateFieldSet(this, _BomRefDiscriminator_originalValues, new Map(Array.from(bomRefs).map(ref => [ref, ref.value])), "f");
|
|
40
|
+
__classPrivateFieldSet(this, _BomRefDiscriminator_prefix, prefix, "f");
|
|
41
|
+
}
|
|
42
|
+
[(_BomRefDiscriminator_originalValues = new WeakMap(), _BomRefDiscriminator_prefix = new WeakMap(), _BomRefDiscriminator_instances = new WeakSet(), Symbol.iterator)]() {
|
|
43
|
+
return __classPrivateFieldGet(this, _BomRefDiscriminator_originalValues, "f").keys();
|
|
44
|
+
}
|
|
45
|
+
discriminate() {
|
|
46
|
+
const knownRefValues = new Set();
|
|
47
|
+
for (const [bomRef] of __classPrivateFieldGet(this, _BomRefDiscriminator_originalValues, "f")) {
|
|
48
|
+
let value = bomRef.value;
|
|
49
|
+
if (value === undefined || knownRefValues.has(value)) {
|
|
50
|
+
value = __classPrivateFieldGet(this, _BomRefDiscriminator_instances, "m", _BomRefDiscriminator_makeUniqueId).call(this);
|
|
51
|
+
bomRef.value = value;
|
|
52
|
+
}
|
|
53
|
+
knownRefValues.add(value);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
reset() {
|
|
57
|
+
for (const [bomRef, originalValue] of __classPrivateFieldGet(this, _BomRefDiscriminator_originalValues, "f")) {
|
|
58
|
+
bomRef.value = originalValue;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.BomRefDiscriminator = BomRefDiscriminator;
|
|
63
|
+
_BomRefDiscriminator_makeUniqueId = function _BomRefDiscriminator_makeUniqueId() {
|
|
64
|
+
return `${__classPrivateFieldGet(this, _BomRefDiscriminator_prefix, "f")}${Math.random().toString(32).substring(1)}${Math.random().toString(32).substring(1)}`;
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=bomRefDiscriminator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bomRefDiscriminator.js","sourceRoot":"","sources":["../../src/serialize/bomRefDiscriminator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE;;;;;;;;;;;;;;;AAIF,MAAa,mBAAmB;IAK9B,YAAa,OAAyB,EAAE,SAAiB,QAAQ;;QAJjE,sDAAiE;QAEjE,8CAAwB;QAGtB,uBAAA,IAAI,uCAAmB,IAAI,GAAG,CAC5B,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CACjD,MAAA,CAAA;QACD,uBAAA,IAAI,+BAAW,MAAM,MAAA,CAAA;IACvB,CAAC;IAED,oJAAC,MAAM,CAAC,QAAQ,EAAC;QACf,OAAO,uBAAA,IAAI,2CAAgB,CAAC,IAAI,EAAE,CAAA;IACpC,CAAC;IAED,YAAY;QACV,MAAM,cAAc,GAAG,IAAI,GAAG,EAAU,CAAA;QACxC,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,uBAAA,IAAI,2CAAgB,EAAE;YAC3C,IAAI,KAAK,GAAG,MAAM,CAAC,KAAK,CAAA;YACxB,IAAI,KAAK,KAAK,SAAS,IAAI,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;gBACpD,KAAK,GAAG,uBAAA,IAAI,yEAAc,MAAlB,IAAI,CAAgB,CAAA;gBAC5B,MAAM,CAAC,KAAK,GAAG,KAAK,CAAA;aACrB;YACD,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;SAC1B;IACH,CAAC;IAED,KAAK;QACH,KAAK,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,IAAI,uBAAA,IAAI,2CAAgB,EAAE;YAC1D,MAAM,CAAC,KAAK,GAAG,aAAa,CAAA;SAC7B;IACH,CAAC;CAeF;AA/CD,kDA+CC;;IARG,OAAO,GACL,uBAAA,IAAI,mCACN,GACE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CACxC,GACE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CACxC,EAAE,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
32
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
33
|
+
}) : function(o, v) {
|
|
34
|
+
o["default"] = v;
|
|
35
|
+
});
|
|
36
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
37
|
+
if (mod && mod.__esModule) return mod;
|
|
38
|
+
var result = {};
|
|
39
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
40
|
+
__setModuleDefault(result, mod);
|
|
41
|
+
return result;
|
|
42
|
+
};
|
|
43
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
44
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
45
|
+
};
|
|
46
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
+
exports.XML = exports.JSON = exports.Types = void 0;
|
|
48
|
+
exports.Types = __importStar(require("./types"));
|
|
49
|
+
__exportStar(require("./baseSerializer"), exports);
|
|
50
|
+
__exportStar(require("./bomRefDiscriminator"), exports);
|
|
51
|
+
exports.JSON = __importStar(require("./json"));
|
|
52
|
+
__exportStar(require("./jsonSerializer"), exports);
|
|
53
|
+
exports.XML = __importStar(require("./xml"));
|
|
54
|
+
__exportStar(require("./xmlBaseSerializer"), exports);
|
|
55
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/serialize/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIF,iDAAgC;AAEhC,mDAAgC;AAGhC,wDAAqC;AAErC,+CAA8B;AAC9B,mDAAgC;AAGhC,6CAA4B;AAC5B,sDAAmC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
32
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
33
|
+
}) : function(o, v) {
|
|
34
|
+
o["default"] = v;
|
|
35
|
+
});
|
|
36
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
37
|
+
if (mod && mod.__esModule) return mod;
|
|
38
|
+
var result = {};
|
|
39
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
40
|
+
__setModuleDefault(result, mod);
|
|
41
|
+
return result;
|
|
42
|
+
};
|
|
43
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
+
exports.Normalize = exports.Types = void 0;
|
|
45
|
+
exports.Types = __importStar(require("./types"));
|
|
46
|
+
exports.Normalize = __importStar(require("./normalize"));
|
|
47
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/serialize/json/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,iDAAgC;AAEhC,yDAAwC"}
|