@cyclonedx/cyclonedx-library 9.2.0 → 9.4.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 (182) hide show
  1. package/dist.d/builders/fromNodePackageJson.node.d.ts +17 -18
  2. package/dist.d/builders/fromNodePackageJson.node.d.ts.map +1 -1
  3. package/dist.d/builders/index.node.d.ts +1 -0
  4. package/dist.d/builders/index.node.d.ts.map +1 -1
  5. package/dist.d/contrib/bom/index.d.ts +20 -0
  6. package/dist.d/contrib/bom/index.d.ts.map +1 -0
  7. package/dist.d/contrib/bom/utils.d.ts +23 -0
  8. package/dist.d/contrib/bom/utils.d.ts.map +1 -0
  9. package/dist.d/contrib/fromNodePackageJson/_helpers/gitUrl.d.ts.map +1 -0
  10. package/dist.d/contrib/fromNodePackageJson/_helpers/packageJson.d.ts.map +1 -0
  11. package/dist.d/contrib/fromNodePackageJson/builders.d.ts +52 -0
  12. package/dist.d/contrib/fromNodePackageJson/builders.d.ts.map +1 -0
  13. package/dist.d/contrib/fromNodePackageJson/factories.d.ts +50 -0
  14. package/dist.d/contrib/fromNodePackageJson/factories.d.ts.map +1 -0
  15. package/dist.d/contrib/fromNodePackageJson/index.node.d.ts +31 -0
  16. package/dist.d/contrib/fromNodePackageJson/index.node.d.ts.map +1 -0
  17. package/dist.d/{types/nodePackageJson.d.ts → contrib/fromNodePackageJson/types.d.ts} +1 -1
  18. package/dist.d/contrib/fromNodePackageJson/types.d.ts.map +1 -0
  19. package/dist.d/contrib/fromNodePackageJson/utils.d.ts +29 -0
  20. package/dist.d/contrib/fromNodePackageJson/utils.d.ts.map +1 -0
  21. package/dist.d/contrib/index.common.d.ts +24 -0
  22. package/dist.d/contrib/index.common.d.ts.map +1 -0
  23. package/dist.d/contrib/index.node.d.ts +25 -0
  24. package/dist.d/contrib/index.node.d.ts.map +1 -0
  25. package/dist.d/contrib/index.web.d.ts +24 -0
  26. package/dist.d/contrib/index.web.d.ts.map +1 -0
  27. package/dist.d/contrib/license/_helpers/mime.node.d.ts.map +1 -0
  28. package/dist.d/contrib/license/factories.d.ts +34 -0
  29. package/dist.d/contrib/license/factories.d.ts.map +1 -0
  30. package/dist.d/contrib/license/index.common.d.ts +20 -0
  31. package/dist.d/contrib/license/index.common.d.ts.map +1 -0
  32. package/dist.d/contrib/license/index.node.d.ts +21 -0
  33. package/dist.d/contrib/license/index.node.d.ts.map +1 -0
  34. package/dist.d/contrib/license/index.web.d.ts +20 -0
  35. package/dist.d/contrib/license/index.web.d.ts.map +1 -0
  36. package/dist.d/contrib/license/utils.node.d.ts +55 -0
  37. package/dist.d/contrib/license/utils.node.d.ts.map +1 -0
  38. package/dist.d/contrib/packageUrl/factories.d.ts +27 -0
  39. package/dist.d/contrib/packageUrl/factories.d.ts.map +1 -0
  40. package/dist.d/contrib/packageUrl/index.d.ts +20 -0
  41. package/dist.d/contrib/packageUrl/index.d.ts.map +1 -0
  42. package/dist.d/factories/fromNodePackageJson.node.d.ts +8 -24
  43. package/dist.d/factories/fromNodePackageJson.node.d.ts.map +1 -1
  44. package/dist.d/factories/index.common.d.ts +2 -0
  45. package/dist.d/factories/index.common.d.ts.map +1 -1
  46. package/dist.d/factories/index.node.d.ts +1 -0
  47. package/dist.d/factories/index.node.d.ts.map +1 -1
  48. package/dist.d/factories/license.d.ts +7 -14
  49. package/dist.d/factories/license.d.ts.map +1 -1
  50. package/dist.d/factories/packageUrl.d.ts +7 -7
  51. package/dist.d/factories/packageUrl.d.ts.map +1 -1
  52. package/dist.d/index.node.d.ts +4 -0
  53. package/dist.d/index.node.d.ts.map +1 -1
  54. package/dist.d/index.web.d.ts +3 -0
  55. package/dist.d/index.web.d.ts.map +1 -1
  56. package/dist.d/types/index.d.ts +19 -1
  57. package/dist.d/types/index.d.ts.map +1 -1
  58. package/dist.d/utils/bomUtility.d.ts +5 -2
  59. package/dist.d/utils/bomUtility.d.ts.map +1 -1
  60. package/dist.d/utils/index.common.d.ts +1 -0
  61. package/dist.d/utils/index.common.d.ts.map +1 -1
  62. package/dist.d/utils/index.node.d.ts +2 -0
  63. package/dist.d/utils/index.node.d.ts.map +1 -1
  64. package/dist.d/utils/licenseUtility.node.d.ts +32 -26
  65. package/dist.d/utils/licenseUtility.node.d.ts.map +1 -1
  66. package/dist.d/utils/npmjsUtility.node.d.ts +8 -5
  67. package/dist.d/utils/npmjsUtility.node.d.ts.map +1 -1
  68. package/dist.node/builders/fromNodePackageJson.node.js +3 -84
  69. package/dist.node/builders/fromNodePackageJson.node.js.map +1 -1
  70. package/dist.node/builders/index.node.js.map +1 -1
  71. package/dist.node/contrib/bom/index.js +56 -0
  72. package/dist.node/contrib/bom/index.js.map +1 -0
  73. package/dist.node/contrib/bom/utils.js +35 -0
  74. package/dist.node/contrib/bom/utils.js.map +1 -0
  75. package/dist.node/contrib/fromNodePackageJson/_helpers/gitUrl.js.map +1 -0
  76. package/dist.node/contrib/fromNodePackageJson/_helpers/packageJson.js.map +1 -0
  77. package/dist.node/contrib/fromNodePackageJson/builders.js +110 -0
  78. package/dist.node/contrib/fromNodePackageJson/builders.js.map +1 -0
  79. package/dist.node/contrib/fromNodePackageJson/factories.js +146 -0
  80. package/dist.node/contrib/fromNodePackageJson/factories.js.map +1 -0
  81. package/dist.node/contrib/fromNodePackageJson/index.node.js +59 -0
  82. package/dist.node/contrib/fromNodePackageJson/index.node.js.map +1 -0
  83. package/dist.node/{types/nodePackageJson.js → contrib/fromNodePackageJson/types.js} +1 -1
  84. package/dist.node/contrib/fromNodePackageJson/types.js.map +1 -0
  85. package/dist.node/contrib/fromNodePackageJson/utils.js +43 -0
  86. package/dist.node/contrib/fromNodePackageJson/utils.js.map +1 -0
  87. package/dist.node/contrib/index.common.js +57 -0
  88. package/dist.node/contrib/index.common.js.map +1 -0
  89. package/dist.node/contrib/index.node.js +61 -0
  90. package/dist.node/contrib/index.node.js.map +1 -0
  91. package/dist.node/contrib/license/_helpers/mime.node.js.map +1 -0
  92. package/dist.node/contrib/license/factories.js +65 -0
  93. package/dist.node/contrib/license/factories.js.map +1 -0
  94. package/dist.node/contrib/license/index.common.js +56 -0
  95. package/dist.node/contrib/license/index.common.js.map +1 -0
  96. package/dist.node/contrib/license/index.node.js +60 -0
  97. package/dist.node/contrib/license/index.node.js.map +1 -0
  98. package/dist.node/contrib/license/utils.node.js +59 -0
  99. package/dist.node/contrib/license/utils.node.js.map +1 -0
  100. package/dist.node/contrib/packageUrl/factories.js +68 -0
  101. package/dist.node/contrib/packageUrl/factories.js.map +1 -0
  102. package/dist.node/contrib/packageUrl/index.js +56 -0
  103. package/dist.node/contrib/packageUrl/index.js.map +1 -0
  104. package/dist.node/factories/fromNodePackageJson.node.js +3 -120
  105. package/dist.node/factories/fromNodePackageJson.node.js.map +1 -1
  106. package/dist.node/factories/index.common.js.map +1 -1
  107. package/dist.node/factories/index.node.js.map +1 -1
  108. package/dist.node/factories/license.js +2 -41
  109. package/dist.node/factories/license.js.map +1 -1
  110. package/dist.node/factories/packageUrl.js +2 -44
  111. package/dist.node/factories/packageUrl.js.map +1 -1
  112. package/dist.node/index.node.js +2 -1
  113. package/dist.node/index.node.js.map +1 -1
  114. package/dist.node/types/index.js +4 -1
  115. package/dist.node/types/index.js.map +1 -1
  116. package/dist.node/utils/bomUtility.js +3 -14
  117. package/dist.node/utils/bomUtility.js.map +1 -1
  118. package/dist.node/utils/index.common.js.map +1 -1
  119. package/dist.node/utils/index.node.js.map +1 -1
  120. package/dist.node/utils/licenseUtility.node.js +2 -35
  121. package/dist.node/utils/licenseUtility.node.js.map +1 -1
  122. package/dist.node/utils/npmjsUtility.node.js +4 -22
  123. package/dist.node/utils/npmjsUtility.node.js.map +1 -1
  124. package/dist.web/lib.dev.js +622 -140
  125. package/dist.web/lib.dev.js.map +1 -1
  126. package/dist.web/lib.js +1 -1
  127. package/dist.web/lib.js.map +1 -1
  128. package/package.json +25 -3
  129. package/res/schema/README.md +3 -1
  130. package/src/builders/fromNodePackageJson.node.ts +10 -115
  131. package/src/builders/index.node.ts +1 -0
  132. package/src/contrib/README.md +20 -0
  133. package/src/contrib/bom/index.ts +20 -0
  134. package/src/contrib/bom/utils.ts +37 -0
  135. package/src/contrib/fromNodePackageJson/_helpers/README.md +6 -0
  136. package/src/contrib/fromNodePackageJson/builders.ts +150 -0
  137. package/src/contrib/fromNodePackageJson/factories.ts +186 -0
  138. package/src/contrib/fromNodePackageJson/index.node.ts +34 -0
  139. package/src/contrib/fromNodePackageJson/utils.ts +89 -0
  140. package/src/contrib/index.common.ts +25 -0
  141. package/src/contrib/index.node.ts +31 -0
  142. package/src/contrib/index.web.ts +30 -0
  143. package/src/contrib/license/_helpers/README.md +6 -0
  144. package/src/contrib/license/factories.ts +75 -0
  145. package/src/contrib/license/index.common.ts +22 -0
  146. package/src/contrib/license/index.node.ts +28 -0
  147. package/src/contrib/license/index.web.ts +28 -0
  148. package/src/contrib/license/utils.node.ts +104 -0
  149. package/src/contrib/packageUrl/factories.ts +92 -0
  150. package/src/contrib/packageUrl/index.ts +20 -0
  151. package/src/factories/fromNodePackageJson.node.ts +9 -161
  152. package/src/factories/index.common.ts +2 -0
  153. package/src/factories/index.node.ts +1 -0
  154. package/src/factories/license.ts +8 -56
  155. package/src/factories/packageUrl.ts +8 -73
  156. package/src/index.common.ts +1 -0
  157. package/src/index.node.ts +7 -0
  158. package/src/index.web.ts +6 -0
  159. package/src/types/index.ts +31 -2
  160. package/src/utils/bomUtility.ts +6 -16
  161. package/src/utils/index.common.ts +1 -0
  162. package/src/utils/index.node.ts +2 -0
  163. package/src/utils/licenseUtility.node.ts +32 -72
  164. package/src/utils/npmjsUtility.node.ts +8 -63
  165. package/dist.d/_helpers/gitUrl.d.ts.map +0 -1
  166. package/dist.d/_helpers/mime.node.d.ts.map +0 -1
  167. package/dist.d/_helpers/packageJson.d.ts.map +0 -1
  168. package/dist.d/types/nodePackageJson.d.ts.map +0 -1
  169. package/dist.node/_helpers/gitUrl.js.map +0 -1
  170. package/dist.node/_helpers/mime.node.js.map +0 -1
  171. package/dist.node/_helpers/packageJson.js.map +0 -1
  172. package/dist.node/types/nodePackageJson.js.map +0 -1
  173. /package/dist.d/{_helpers → contrib/fromNodePackageJson/_helpers}/gitUrl.d.ts +0 -0
  174. /package/dist.d/{_helpers → contrib/fromNodePackageJson/_helpers}/packageJson.d.ts +0 -0
  175. /package/dist.d/{_helpers → contrib/license/_helpers}/mime.node.d.ts +0 -0
  176. /package/dist.node/{_helpers → contrib/fromNodePackageJson/_helpers}/gitUrl.js +0 -0
  177. /package/dist.node/{_helpers → contrib/fromNodePackageJson/_helpers}/packageJson.js +0 -0
  178. /package/dist.node/{_helpers → contrib/license/_helpers}/mime.node.js +0 -0
  179. /package/src/{_helpers → contrib/fromNodePackageJson/_helpers}/gitUrl.ts +0 -0
  180. /package/src/{_helpers → contrib/fromNodePackageJson/_helpers}/packageJson.ts +0 -0
  181. /package/src/{types/nodePackageJson.ts → contrib/fromNodePackageJson/types.ts} +0 -0
  182. /package/src/{_helpers → contrib/license/_helpers}/mime.node.ts +0 -0
@@ -16,28 +16,27 @@ limitations under the License.
16
16
  SPDX-License-Identifier: Apache-2.0
17
17
  Copyright (c) OWASP Foundation. All Rights Reserved.
18
18
  */
19
- import { ComponentType } from '../enums/componentType';
20
- import type * as Factories from '../factories/index.node';
21
- import { Component } from '../models/component';
22
- import { Tool } from '../models/tool';
23
- import type { NodePackageJson } from '../types/nodePackageJson';
24
19
  /**
25
- * Node-specific ToolBuilder.
20
+ * Node-specifics.
21
+ *
22
+ * Intended to run on normalized data structures
23
+ * based on [PackageJson spec](https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/package.json)
24
+ * and explained by [PackageJson description](https://docs.npmjs.com/cli/v9/configuring-npm/package-json).
25
+ * Normalization should be done downstream, for example via [`normalize-package-data`](https://www.npmjs.com/package/normalize-package-data).
26
26
  */
27
- export declare class ToolBuilder {
28
- #private;
29
- constructor(extRefFactory: ToolBuilder['extRefFactory']);
30
- get extRefFactory(): Factories.FromNodePackageJson.ExternalReferenceFactory;
31
- makeTool(data: NodePackageJson): Tool | undefined;
27
+ import { ComponentBuilder as _ComponentBuilder, ToolBuilder as _ToolBuilder } from '../contrib/fromNodePackageJson/builders';
28
+ /**
29
+ * Deprecated — Alias of {@link Contrib.FromNodePackageJson.Builders.ToolBuilder}.
30
+ *
31
+ * @deprecated Use `Contrib.FromNodePackageJson.Builders.ToolBuilder` instead.
32
+ */
33
+ export declare class ToolBuilder extends _ToolBuilder {
32
34
  }
33
35
  /**
34
- * Node-specific ComponentBuilder.
36
+ * Deprecated — Alias of {@link Contrib.FromNodePackageJson.Builders.ComponentBuilder}.
37
+ *
38
+ * @deprecated Use `Contrib.FromNodePackageJson.Builders.ComponentBuilder` instead.
35
39
  */
36
- export declare class ComponentBuilder {
37
- #private;
38
- constructor(extRefFactory: ComponentBuilder['extRefFactory'], licenseFactory: ComponentBuilder['licenseFactory']);
39
- get extRefFactory(): Factories.FromNodePackageJson.ExternalReferenceFactory;
40
- get licenseFactory(): Factories.LicenseFactory;
41
- makeComponent(data: NodePackageJson, type?: ComponentType): Component | undefined;
40
+ export declare class ComponentBuilder extends _ComponentBuilder {
42
41
  }
43
42
  //# sourceMappingURL=fromNodePackageJson.node.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fromNodePackageJson.node.d.ts","sourceRoot":"","sources":["../../src/builders/fromNodePackageJson.node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAYF,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AACtD,OAAO,KAAK,KAAK,SAAS,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAG/C,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AACrC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAE/D;;GAEG;AACH,qBAAa,WAAW;;gBAGT,aAAa,EAAE,WAAW,CAAC,eAAe,CAAC;IAIxD,IAAI,aAAa,IAAK,SAAS,CAAC,mBAAmB,CAAC,wBAAwB,CAE3E;IAID,QAAQ,CAAE,IAAI,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS;CAcnD;AAED;;GAEG;AACH,qBAAa,gBAAgB;;gBAKzB,aAAa,EAAE,gBAAgB,CAAC,eAAe,CAAC,EAChD,cAAc,EAAE,gBAAgB,CAAC,gBAAgB,CAAC;IAMpD,IAAI,aAAa,IAAK,SAAS,CAAC,mBAAmB,CAAC,wBAAwB,CAE3E;IAED,IAAI,cAAc,IAAK,SAAS,CAAC,cAAc,CAE9C;IAED,aAAa,CAAE,IAAI,EAAE,eAAe,EAAE,IAAI,GAAE,aAAqC,GAAG,SAAS,GAAG,SAAS;CAwD1G"}
1
+ {"version":3,"file":"fromNodePackageJson.node.d.ts","sourceRoot":"","sources":["../../src/builders/fromNodePackageJson.node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF;;;;;;;GAOG;AAEH,OAAO,EAAC,gBAAgB,IAAI,iBAAiB,EAAE,WAAW,IAAI,YAAY,EAAC,MAAM,yCAAyC,CAAA;AAG1H;;;;GAIG;AACH,qBAAa,WAAY,SAAQ,YAAY;CAAG;AAEhD;;;;GAIG;AACH,qBAAa,gBAAiB,SAAQ,iBAAiB;CAAG"}
@@ -16,5 +16,6 @@ limitations under the License.
16
16
  SPDX-License-Identifier: Apache-2.0
17
17
  Copyright (c) OWASP Foundation. All Rights Reserved.
18
18
  */
19
+ /** @deprecated next */
19
20
  export * as FromNodePackageJson from './fromNodePackageJson.node';
20
21
  //# sourceMappingURL=index.node.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.node.d.ts","sourceRoot":"","sources":["../../src/builders/index.node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF,OAAO,KAAK,mBAAmB,MAAM,4BAA4B,CAAA"}
1
+ {"version":3,"file":"index.node.d.ts","sourceRoot":"","sources":["../../src/builders/index.node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF,uBAAuB;AACvB,OAAO,KAAK,mBAAmB,MAAM,4BAA4B,CAAA"}
@@ -0,0 +1,20 @@
1
+ /*!
2
+ This file is part of CycloneDX JavaScript Library.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+
16
+ SPDX-License-Identifier: Apache-2.0
17
+ Copyright (c) OWASP Foundation. All Rights Reserved.
18
+ */
19
+ export * as Utils from './utils';
20
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/contrib/bom/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF,OAAO,KAAK,KAAK,MAAM,SAAS,CAAA"}
@@ -0,0 +1,23 @@
1
+ /*!
2
+ This file is part of CycloneDX JavaScript Library.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+
16
+ SPDX-License-Identifier: Apache-2.0
17
+ Copyright (c) OWASP Foundation. All Rights Reserved.
18
+ */
19
+ /**
20
+ * Generate valid random SerialNumbers for {@link Models.Bom.serialNumber | Models.Bom.serialNumber}.
21
+ */
22
+ export declare function randomSerialNumber(): string;
23
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/contrib/bom/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF;;GAEG;AACH,wBAAgB,kBAAkB,IAAK,MAAM,CAc5C"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gitUrl.d.ts","sourceRoot":"","sources":["../../../../src/contrib/fromNodePackageJson/_helpers/gitUrl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AASF;;GAEG;AACH,wBAAgB,qBAAqB,CAAE,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,GAAG,GAAG,MAAM,GAAG,SAAS,CA0B1F"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packageJson.d.ts","sourceRoot":"","sources":["../../../../src/contrib/fromNodePackageJson/_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"}
@@ -0,0 +1,52 @@
1
+ /*!
2
+ This file is part of CycloneDX JavaScript Library.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+
16
+ SPDX-License-Identifier: Apache-2.0
17
+ Copyright (c) OWASP Foundation. All Rights Reserved.
18
+ */
19
+ /**
20
+ * Node-specifics.
21
+ *
22
+ * Intended to run on normalized data structures
23
+ * based on [PackageJson spec](https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/package.json)
24
+ * and explained by [PackageJson description](https://docs.npmjs.com/cli/v9/configuring-npm/package-json).
25
+ * Normalization should be done downstream, for example via [`normalize-package-data`](https://www.npmjs.com/package/normalize-package-data).
26
+ */
27
+ import { ComponentType } from '../../enums/componentType';
28
+ import { Component } from '../../models/component';
29
+ import { Tool } from '../../models/tool';
30
+ import type { LicenseFactory } from '../license/factories';
31
+ import type { ExternalReferenceFactory } from './factories';
32
+ import type { NodePackageJson } from './types';
33
+ /**
34
+ * Node-specific ToolBuilder.
35
+ */
36
+ export declare class ToolBuilder {
37
+ #private;
38
+ constructor(extRefFactory: ToolBuilder['extRefFactory']);
39
+ get extRefFactory(): ExternalReferenceFactory;
40
+ makeTool(data: NodePackageJson): Tool | undefined;
41
+ }
42
+ /**
43
+ * Node-specific ComponentBuilder.
44
+ */
45
+ export declare class ComponentBuilder {
46
+ #private;
47
+ constructor(extRefFactory: ComponentBuilder['extRefFactory'], licenseFactory: ComponentBuilder['licenseFactory']);
48
+ get extRefFactory(): ExternalReferenceFactory;
49
+ get licenseFactory(): LicenseFactory;
50
+ makeComponent(data: NodePackageJson, type?: ComponentType): Component | undefined;
51
+ }
52
+ //# sourceMappingURL=builders.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builders.d.ts","sourceRoot":"","sources":["../../../src/contrib/fromNodePackageJson/builders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAGlD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C;;GAEG;AACH,qBAAa,WAAW;;gBAGT,aAAa,EAAE,WAAW,CAAC,eAAe,CAAC;IAIxD,IAAI,aAAa,IAAK,wBAAwB,CAE7C;IAID,QAAQ,CAAE,IAAI,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS;CAcnD;AAED;;GAEG;AACH,qBAAa,gBAAgB;;gBAKzB,aAAa,EAAE,gBAAgB,CAAC,eAAe,CAAC,EAChD,cAAc,EAAE,gBAAgB,CAAC,gBAAgB,CAAC;IAMpD,IAAI,aAAa,IAAK,wBAAwB,CAE7C;IAED,IAAI,cAAc,IAAK,cAAc,CAEpC;IAED,aAAa,CAAE,IAAI,EAAE,eAAe,EAAE,IAAI,GAAE,aAAqC,GAAG,SAAS,GAAG,SAAS;CAwD1G"}
@@ -0,0 +1,50 @@
1
+ /*!
2
+ This file is part of CycloneDX JavaScript Library.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+
16
+ SPDX-License-Identifier: Apache-2.0
17
+ Copyright (c) OWASP Foundation. All Rights Reserved.
18
+ */
19
+ /**
20
+ * Node-specifics.
21
+ *
22
+ * Intended to run on normalized data structures
23
+ * based on [PackageJson spec](https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/package.json)
24
+ * and explained by [PackageJson description](https://docs.npmjs.com/cli/v9/configuring-npm/package-json).
25
+ * Normalization should be done downstream, for example via [`normalize-package-data`](https://www.npmjs.com/package/normalize-package-data).
26
+ */
27
+ import type { PackageURL } from 'packageurl-js';
28
+ import type { Component } from '../../models/component';
29
+ import { ExternalReference } from '../../models/externalReference';
30
+ import { PackageUrlFactory as PlainPackageUrlFactory } from '../packageUrl/factories';
31
+ import type { NodePackageJson } from './types';
32
+ /**
33
+ * Node-specific ExternalReferenceFactory.
34
+ */
35
+ export declare class ExternalReferenceFactory {
36
+ makeExternalReferences(data: NodePackageJson): ExternalReference[];
37
+ makeVcs(data: NodePackageJson): ExternalReference | undefined;
38
+ makeHomepage(data: NodePackageJson): ExternalReference | undefined;
39
+ makeIssueTracker(data: NodePackageJson): ExternalReference | undefined;
40
+ makeDist(data: NodePackageJson): ExternalReference | undefined;
41
+ }
42
+ /**
43
+ * Node-specific PackageUrlFactory.
44
+ * @see {@link https://github.com/package-url/purl-spec/blob/master/PURL-TYPES.rst#npm}
45
+ */
46
+ export declare class PackageUrlFactory extends PlainPackageUrlFactory<'npm'> {
47
+ #private;
48
+ makeFromComponent(component: Component, sort?: boolean): PackageURL | undefined;
49
+ }
50
+ //# sourceMappingURL=factories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factories.d.ts","sourceRoot":"","sources":["../../../src/contrib/fromNodePackageJson/factories.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAM/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAElE,OAAO,EAAE,iBAAiB,IAAI,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AAErF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAG9C;;GAEG;AACH,qBAAa,wBAAwB;IACnC,sBAAsB,CAAE,IAAI,EAAE,eAAe,GAAG,iBAAiB,EAAE;IAWnE,OAAO,CAAE,IAAI,EAAE,eAAe,GAAG,iBAAiB,GAAG,SAAS;IAuB9D,YAAY,CAAE,IAAI,EAAE,eAAe,GAAG,iBAAiB,GAAG,SAAS;IAUnE,gBAAgB,CAAE,IAAI,EAAE,eAAe,GAAG,iBAAiB,GAAG,SAAS;IAiBvE,QAAQ,CAAC,IAAI,EAAE,eAAe,GAAG,iBAAiB,GAAG,SAAS;CAwB/D;AAED;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,sBAAsB,CAAC,KAAK,CAAC;;IAEzD,iBAAiB,CAAE,SAAS,EAAE,SAAS,EAAE,IAAI,GAAE,OAAe,GAAG,UAAU,GAAG,SAAS;CA8CjG"}
@@ -0,0 +1,31 @@
1
+ /*!
2
+ This file is part of CycloneDX JavaScript Library.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+
16
+ SPDX-License-Identifier: Apache-2.0
17
+ Copyright (c) OWASP Foundation. All Rights Reserved.
18
+ */
19
+ /**
20
+ * Node-specifics.
21
+ *
22
+ * Intended to run on normalized data structures
23
+ * based on [PackageJson spec](https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/package.json)
24
+ * and explained by [PackageJson description](https://docs.npmjs.com/cli/v9/configuring-npm/package-json).
25
+ * Normalization should be done downstream, for example via [`normalize-package-data`](https://www.npmjs.com/package/normalize-package-data).
26
+ */
27
+ export * as Builders from './builders';
28
+ export * as Factories from './factories';
29
+ export * as Types from './types';
30
+ export * as Utils from './utils';
31
+ //# sourceMappingURL=index.node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.node.d.ts","sourceRoot":"","sources":["../../../src/contrib/fromNodePackageJson/index.node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF;;;;;;;GAOG;AAEH,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAA;AACtC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAA;AAChC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAA"}
@@ -66,4 +66,4 @@ export declare function isNodePackageJson(value: any): value is NodePackageJson;
66
66
  * @alpha
67
67
  */
68
68
  export declare function assertNodePackageJson(value: any): asserts value is NodePackageJson;
69
- //# sourceMappingURL=nodePackageJson.d.ts.map
69
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/contrib/fromNodePackageJson/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B,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,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,GAAG,CAAC,EAAE,MAAM,CAAA;QACZ,SAAS,CAAC,EAAE,MAAM,CAAA;KACnB,CAAA;IAED,IAAI,CAAC,EAAE,GAAG,CAAA;CACX;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAE,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,eAAe,CAOvE;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAE,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,KAAK,IAAI,eAAe,CAOnF"}
@@ -0,0 +1,29 @@
1
+ /*!
2
+ This file is part of CycloneDX JavaScript Library.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+
16
+ SPDX-License-Identifier: Apache-2.0
17
+ Copyright (c) OWASP Foundation. All Rights Reserved.
18
+ */
19
+ import { HashAlgorithm } from '../../enums/hashAlogorithm';
20
+ /**
21
+ * @throws {@link RangeError} if value is unparsable
22
+ */
23
+ export declare function parsePackageIntegrity(integrity: string): [HashAlgorithm, string];
24
+ /**
25
+ * The default registry is `https://registry.npmjs.org`.
26
+ * @see {@link https://github.com/package-url/purl-spec/blob/master/PURL-TYPES.rst#npm}
27
+ */
28
+ export declare const defaultRegistryMatcher: RegExp;
29
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/contrib/fromNodePackageJson/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF,OAAO,EAAC,aAAa,EAAC,MAAM,4BAA4B,CAAA;AAgDxD;;GAEG;AACH,wBAAgB,qBAAqB,CAAE,SAAS,EAAE,MAAM,GAAG,CAAC,aAAa,EAAE,MAAM,CAAC,CAWjF;AAGD;;;GAGG;AACH,eAAO,MAAM,sBAAsB,QAA6C,CAAA"}
@@ -0,0 +1,24 @@
1
+ /*!
2
+ This file is part of CycloneDX JavaScript Library.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+
16
+ SPDX-License-Identifier: Apache-2.0
17
+ Copyright (c) OWASP Foundation. All Rights Reserved.
18
+ */
19
+ /**
20
+ * Some features in this library are marked as contrib. These are community-provided extensions and are not part of the official standard. They are optional and may evolve independently from the core.
21
+ */
22
+ export * as Bom from './bom';
23
+ export * as PackageUrl from './packageUrl';
24
+ //# sourceMappingURL=index.common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.common.d.ts","sourceRoot":"","sources":["../../src/contrib/index.common.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF;;GAEG;AAEH,OAAO,KAAK,GAAG,MAAM,OAAO,CAAA;AAC5B,OAAO,KAAK,UAAU,MAAM,cAAc,CAAA"}
@@ -0,0 +1,25 @@
1
+ /*!
2
+ This file is part of CycloneDX JavaScript Library.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+
16
+ SPDX-License-Identifier: Apache-2.0
17
+ Copyright (c) OWASP Foundation. All Rights Reserved.
18
+ */
19
+ /**
20
+ * Some features in this library are marked as contrib. These are community-provided extensions and are not part of the official standard. They are optional and may evolve independently from the core.
21
+ */
22
+ export * from './index.common';
23
+ export * as FromNodePackageJson from './fromNodePackageJson/index.node';
24
+ export * as License from './license/index.node';
25
+ //# sourceMappingURL=index.node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.node.d.ts","sourceRoot":"","sources":["../../src/contrib/index.node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF;;GAEG;AAEH,cAAc,gBAAgB,CAAA;AAI9B,OAAO,KAAK,mBAAmB,MAAM,kCAAkC,CAAA;AACvE,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAA"}
@@ -0,0 +1,24 @@
1
+ /*!
2
+ This file is part of CycloneDX JavaScript Library.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+
16
+ SPDX-License-Identifier: Apache-2.0
17
+ Copyright (c) OWASP Foundation. All Rights Reserved.
18
+ */
19
+ /**
20
+ * Some features in this library are marked as contrib. These are community-provided extensions and are not part of the official standard. They are optional and may evolve independently from the core.
21
+ */
22
+ export * from './index.common';
23
+ export * as License from './license/index.web';
24
+ //# sourceMappingURL=index.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../src/contrib/index.web.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF;;GAEG;AAEH,cAAc,gBAAgB,CAAA;AAI9B,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mime.node.d.ts","sourceRoot":"","sources":["../../../../src/contrib/license/_helpers/mime.node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAIF,KAAK,QAAQ,GAAG,MAAM,CAAA;AA8BtB,wBAAgB,2BAA2B,CAAE,QAAQ,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAKnF"}
@@ -0,0 +1,34 @@
1
+ /*!
2
+ This file is part of CycloneDX JavaScript Library.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+
16
+ SPDX-License-Identifier: Apache-2.0
17
+ Copyright (c) OWASP Foundation. All Rights Reserved.
18
+ */
19
+ import type { DisjunctiveLicense, License } from '../../models/license';
20
+ import { LicenseExpression, NamedLicense, SpdxLicense } from '../../models/license';
21
+ export declare class LicenseFactory {
22
+ makeFromString(value: string): License;
23
+ /**
24
+ * @throws {@link RangeError} if expression is not eligible
25
+ */
26
+ makeExpression(value: string | any): LicenseExpression;
27
+ makeDisjunctive(value: string): DisjunctiveLicense;
28
+ /**
29
+ * @throws {@link RangeError} if value is not supported SPDX id
30
+ */
31
+ makeSpdxLicense(value: string | any): SpdxLicense;
32
+ makeNamedLicense(value: string | any): NamedLicense;
33
+ }
34
+ //# sourceMappingURL=factories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factories.d.ts","sourceRoot":"","sources":["../../../src/contrib/license/factories.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF,OAAO,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AACvE,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAGnF,qBAAa,cAAc;IACzB,cAAc,CAAE,KAAK,EAAE,MAAM,GAAG,OAAO;IAgBvC;;OAEG;IACH,cAAc,CAAE,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,iBAAiB;IAQvD,eAAe,CAAE,KAAK,EAAE,MAAM,GAAG,kBAAkB;IAQnD;;OAEG;IACH,eAAe,CAAE,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,WAAW;IASlD,gBAAgB,CAAE,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,YAAY;CAGrD"}
@@ -0,0 +1,20 @@
1
+ /*!
2
+ This file is part of CycloneDX JavaScript Library.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+
16
+ SPDX-License-Identifier: Apache-2.0
17
+ Copyright (c) OWASP Foundation. All Rights Reserved.
18
+ */
19
+ export * as Factories from './factories';
20
+ //# sourceMappingURL=index.common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.common.d.ts","sourceRoot":"","sources":["../../../src/contrib/license/index.common.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF,OAAO,KAAK,SAAS,MAAM,aAAa,CAAA"}
@@ -0,0 +1,21 @@
1
+ /*!
2
+ This file is part of CycloneDX JavaScript Library.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+
16
+ SPDX-License-Identifier: Apache-2.0
17
+ Copyright (c) OWASP Foundation. All Rights Reserved.
18
+ */
19
+ export * from './index.common';
20
+ export * as Utils from './utils.node';
21
+ //# sourceMappingURL=index.node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.node.d.ts","sourceRoot":"","sources":["../../../src/contrib/license/index.node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF,cAAc,gBAAgB,CAAA;AAI9B,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA"}
@@ -0,0 +1,20 @@
1
+ /*!
2
+ This file is part of CycloneDX JavaScript Library.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+
16
+ SPDX-License-Identifier: Apache-2.0
17
+ Copyright (c) OWASP Foundation. All Rights Reserved.
18
+ */
19
+ export * from './index.common';
20
+ //# sourceMappingURL=index.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../src/contrib/license/index.web.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF,cAAc,gBAAgB,CAAA"}
@@ -0,0 +1,55 @@
1
+ /*!
2
+ This file is part of CycloneDX JavaScript Library.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+
16
+ SPDX-License-Identifier: Apache-2.0
17
+ Copyright (c) OWASP Foundation. All Rights Reserved.
18
+ */
19
+ /**
20
+ * This module tries to be as compatible as possible, it only uses basic methods that are known to be working in all FileSystem abstraction-layers.
21
+ * In addition, we use type parameters for all `PathLike`s, so downstream users can utilize their implementations accordingly.
22
+ *
23
+ * @module
24
+ */
25
+ import type { Stats } from 'node:fs';
26
+ import { Attachment } from '../../models/attachment';
27
+ export interface FsUtils<P extends string> {
28
+ readdirSync: (path: P) => P[];
29
+ readFileSync: (path: P) => Buffer;
30
+ statSync: (path: P) => Stats;
31
+ }
32
+ export interface PathUtils<P extends string> {
33
+ join: (...paths: P[]) => P;
34
+ }
35
+ export interface FileAttachment<P extends string> {
36
+ filePath: P;
37
+ file: P;
38
+ text: Attachment;
39
+ }
40
+ export type ErrorReporter = (e: Error) => any;
41
+ export declare class LicenseEvidenceGatherer<P extends string = string> {
42
+ #private;
43
+ /**
44
+ * `fs` and `path` can be supplied, if any compatibility-layer or drop-in replacement is used.
45
+ *
46
+ * @param options.fs - If omitted, the native `node:fs` is used.
47
+ * @param options.path - If omitted, the native `node:path` is used.
48
+ */
49
+ constructor(options?: {
50
+ fs?: FsUtils<P>;
51
+ path?: PathUtils<P>;
52
+ });
53
+ getFileAttachments(prefixPath: P, onError?: ErrorReporter): Generator<FileAttachment<P>>;
54
+ }
55
+ //# sourceMappingURL=utils.node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.node.d.ts","sourceRoot":"","sources":["../../../src/contrib/license/utils.node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAGpC,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAGpD,MAAM,WAAW,OAAO,CAAC,CAAC,SAAS,MAAM;IACvC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC,KAAM,CAAC,EAAE,CAAA;IAC9B,YAAY,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAA;IACjC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,KAAK,CAAA;CAC7B;AAED,MAAM,WAAW,SAAS,CAAC,CAAC,SAAS,MAAM;IACzC,IAAI,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,CAAA;CAC3B;AAED,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,MAAM;IAC9C,QAAQ,EAAE,CAAC,CAAA;IACX,IAAI,EAAE,CAAC,CAAA;IACP,IAAI,EAAE,UAAU,CAAA;CACjB;AAID,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,EAAC,KAAK,KAAK,GAAG,CAAA;AAE5C,qBAAa,uBAAuB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;;IAK5D;;;;;OAKG;gBACU,OAAO,GAAE;QAAE,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;QAAC,IAAI,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAA;KAAO;IAQjE,kBAAkB,CAAE,UAAU,EAAE,CAAC,EAAE,OAAO,GAAE,aAAoB,GAAG,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;CA6BlG"}
@@ -0,0 +1,27 @@
1
+ /*!
2
+ This file is part of CycloneDX JavaScript Library.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+
16
+ SPDX-License-Identifier: Apache-2.0
17
+ Copyright (c) OWASP Foundation. All Rights Reserved.
18
+ */
19
+ import { PackageURL } from 'packageurl-js';
20
+ import type { Component } from '../../models/component';
21
+ export declare class PackageUrlFactory<PurlType extends PackageURL['type'] = PackageURL['type']> {
22
+ #private;
23
+ constructor(type: PurlType);
24
+ get type(): PurlType;
25
+ makeFromComponent(component: Component, sort?: boolean): PackageURL | undefined;
26
+ }
27
+ //# sourceMappingURL=factories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factories.d.ts","sourceRoot":"","sources":["../../../src/contrib/packageUrl/factories.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF,OAAO,EAAE,UAAU,EAAsB,MAAM,eAAe,CAAA;AAG9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAEvD,qBAAa,iBAAiB,CAAC,QAAQ,SAAS,UAAU,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC;;gBAGxE,IAAI,EAAE,QAAQ;IAI3B,IAAI,IAAI,IAAK,QAAQ,CAEpB;IAGD,iBAAiB,CAAE,SAAS,EAAE,SAAS,EAAE,IAAI,GAAE,OAAe,GAAG,UAAU,GAAG,SAAS;CAuDxF"}