@dxworks/depinder 0.1.5 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/extractFrameworkVersion.d.ts +2 -0
- package/dist/commands/extractFrameworkVersion.js +238 -0
- package/dist/commands/extractFrameworkVersion.js.map +1 -0
- package/dist/commands/transformBlackDuckReports.d.ts +11 -0
- package/dist/commands/transformBlackDuckReports.js +481 -0
- package/dist/commands/transformBlackDuckReports.js.map +1 -0
- package/dist/depinder.js +5 -1
- package/dist/depinder.js.map +1 -1
- package/dist/plugins/javascript/index.js +108 -15
- package/dist/plugins/javascript/index.js.map +1 -1
- package/dist/utils/npm.d.ts +1 -0
- package/dist/utils/projectMapping.d.ts +41 -0
- package/dist/utils/projectMapping.js +301 -0
- package/dist/utils/projectMapping.js.map +1 -0
- package/package.json +5 -6
|
@@ -0,0 +1,481 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.transformBlackDuckReportsCommand = exports.transformBlackDuckReports = void 0;
|
|
30
|
+
const promises_1 = __importDefault(require("fs/promises"));
|
|
31
|
+
const fsSync = __importStar(require("fs"));
|
|
32
|
+
const path_1 = __importDefault(require("path"));
|
|
33
|
+
const commander_1 = require("commander");
|
|
34
|
+
const sync_1 = require("csv-parse/sync");
|
|
35
|
+
const sync_2 = require("csv-stringify/sync");
|
|
36
|
+
const projectMapping_1 = require("../utils/projectMapping");
|
|
37
|
+
/**
|
|
38
|
+
* Common options for CSV parsing
|
|
39
|
+
*/
|
|
40
|
+
const CSV_PARSE_OPTIONS = { columns: true, skip_empty_lines: true };
|
|
41
|
+
/**
|
|
42
|
+
* Column order for dependencies.csv output
|
|
43
|
+
*/
|
|
44
|
+
const DEPENDENCIES_COLUMN_ORDER = [
|
|
45
|
+
'Component name',
|
|
46
|
+
'Component version name',
|
|
47
|
+
'Component Version Origin Id',
|
|
48
|
+
'License names',
|
|
49
|
+
'License families',
|
|
50
|
+
'Match type',
|
|
51
|
+
'Usage',
|
|
52
|
+
'Operational Risk',
|
|
53
|
+
'Origin name',
|
|
54
|
+
'License Risk',
|
|
55
|
+
'Total Vulnerability Count',
|
|
56
|
+
'Critical and High Vulnerability Count',
|
|
57
|
+
'Critical Vulnerability Count',
|
|
58
|
+
'High Vulnerability Count',
|
|
59
|
+
'Medium Vulnerability Count',
|
|
60
|
+
'Low Vulnerability Count',
|
|
61
|
+
'Release Date',
|
|
62
|
+
'Newer Versions',
|
|
63
|
+
'Commit Activity',
|
|
64
|
+
'Commits in Past 12 Months',
|
|
65
|
+
'Contributors in Past 12 Months',
|
|
66
|
+
'Has License Conflicts',
|
|
67
|
+
'Component Link',
|
|
68
|
+
'Open Hub URL'
|
|
69
|
+
];
|
|
70
|
+
/**
|
|
71
|
+
* Column order for dependencies_sources.csv output
|
|
72
|
+
*/
|
|
73
|
+
const DEPENDENCIES_SOURCES_COLUMN_ORDER = [
|
|
74
|
+
'Component name',
|
|
75
|
+
'Component version name',
|
|
76
|
+
'Component Version Origin Id',
|
|
77
|
+
'Match type',
|
|
78
|
+
'Path',
|
|
79
|
+
'ProjectPath',
|
|
80
|
+
'ProjectPathExists',
|
|
81
|
+
'VerifiedPath',
|
|
82
|
+
'Origin name',
|
|
83
|
+
'License names',
|
|
84
|
+
'License families',
|
|
85
|
+
'License Risk',
|
|
86
|
+
'Critical Vulnerability Count',
|
|
87
|
+
'High Vulnerability Count',
|
|
88
|
+
'Medium Vulnerability Count',
|
|
89
|
+
'Low Vulnerability Count',
|
|
90
|
+
'Total Vulnerability Count',
|
|
91
|
+
'Critical and High Vulnerability Count',
|
|
92
|
+
'Operational Risk',
|
|
93
|
+
'Release Date',
|
|
94
|
+
'Newer Versions',
|
|
95
|
+
'OpenHubURL'
|
|
96
|
+
];
|
|
97
|
+
/**
|
|
98
|
+
* Headers to keep for vulnerability_details.csv output
|
|
99
|
+
*/
|
|
100
|
+
const VULNERABILITY_DETAILS_HEADERS = [
|
|
101
|
+
'Component name',
|
|
102
|
+
'Component version name',
|
|
103
|
+
'Component Version Origin Id',
|
|
104
|
+
'Vulnerability id',
|
|
105
|
+
'Description',
|
|
106
|
+
'Published on',
|
|
107
|
+
'Updated on',
|
|
108
|
+
'Base score',
|
|
109
|
+
'Exploitability',
|
|
110
|
+
'Impact',
|
|
111
|
+
'Vulnerability source',
|
|
112
|
+
'Remediation status',
|
|
113
|
+
'URL',
|
|
114
|
+
'Security Risk',
|
|
115
|
+
'Project path',
|
|
116
|
+
'Overall score',
|
|
117
|
+
'CWE Ids',
|
|
118
|
+
'Solution available',
|
|
119
|
+
'Workaround available',
|
|
120
|
+
'Exploit available',
|
|
121
|
+
'CVSS Version',
|
|
122
|
+
'Match type',
|
|
123
|
+
'Vulnerability tags'
|
|
124
|
+
];
|
|
125
|
+
/**
|
|
126
|
+
* Columns to remove from upgrade guidance CSV
|
|
127
|
+
*/
|
|
128
|
+
const UPGRADE_GUIDANCE_COLUMNS_TO_REMOVE = new Set([
|
|
129
|
+
'Used by',
|
|
130
|
+
'Component Id',
|
|
131
|
+
'Component Version Id',
|
|
132
|
+
'Component Origin Id',
|
|
133
|
+
'Component Origin Version Name',
|
|
134
|
+
'Short Term Recommended Version Id',
|
|
135
|
+
'Long Term Recommended Version Id',
|
|
136
|
+
'Short Term Recommended Component Origin Id',
|
|
137
|
+
'Long Term Recommended Component Origin Id',
|
|
138
|
+
'Knowledgebase Timed Out'
|
|
139
|
+
]);
|
|
140
|
+
/**
|
|
141
|
+
* Safely parses a string to an integer, returning 0 for invalid inputs
|
|
142
|
+
* @param s String to parse
|
|
143
|
+
* @returns Parsed integer or 0 if invalid
|
|
144
|
+
*/
|
|
145
|
+
function safeInt(s) {
|
|
146
|
+
const v = parseInt(s !== null && s !== void 0 ? s : '', 10);
|
|
147
|
+
return isNaN(v) ? 0 : v;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Formats a date string from MM/DD/YY to \tYYYY-MM-DD format for Excel compatibility
|
|
151
|
+
* @param raw Raw date string in MM/DD/YY format
|
|
152
|
+
* @returns Formatted date string or empty string if invalid
|
|
153
|
+
*/
|
|
154
|
+
function formatDateField(raw) {
|
|
155
|
+
if (!raw)
|
|
156
|
+
return '';
|
|
157
|
+
const parts = raw.trim().split('/');
|
|
158
|
+
if (parts.length !== 3)
|
|
159
|
+
return '';
|
|
160
|
+
const [month, day, year] = parts.map(s => parseInt(s, 10));
|
|
161
|
+
if (isNaN(month) || isNaN(day) || isNaN(year))
|
|
162
|
+
return '';
|
|
163
|
+
const fullYear = year < 50 ? 2000 + year : 1900 + year;
|
|
164
|
+
return `\t${fullYear}-${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Normalizes values to string format according to Black Duck report requirements
|
|
168
|
+
* @param val Value to normalize
|
|
169
|
+
* @returns Normalized string value
|
|
170
|
+
*/
|
|
171
|
+
function normalizeValue(val) {
|
|
172
|
+
if (val === true)
|
|
173
|
+
return 'TRUE';
|
|
174
|
+
if (val === false)
|
|
175
|
+
return 'FALSE';
|
|
176
|
+
if (val === null || val === undefined)
|
|
177
|
+
return '';
|
|
178
|
+
if (typeof val === 'number')
|
|
179
|
+
return `${val}`;
|
|
180
|
+
return `${val}`.trim();
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Normalizes match type by removing " Dependency" suffix
|
|
184
|
+
* @param matchType Match type string
|
|
185
|
+
* @returns Normalized match type
|
|
186
|
+
*/
|
|
187
|
+
function normalizeMatchType(matchType) {
|
|
188
|
+
return (matchType || '').replace(/ Dependency/g, '');
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Calculates vulnerability counts from a component record
|
|
192
|
+
* @param component Component record
|
|
193
|
+
* @returns Object with vulnerability counts
|
|
194
|
+
*/
|
|
195
|
+
function calculateVulnerabilityCounts(component) {
|
|
196
|
+
const critical = safeInt(component['Critical Vulnerability Count']);
|
|
197
|
+
const high = safeInt(component['High Vulnerability Count']);
|
|
198
|
+
const medium = safeInt(component['Medium Vulnerability Count']);
|
|
199
|
+
const low = safeInt(component['Low Vulnerability Count']);
|
|
200
|
+
return {
|
|
201
|
+
critical,
|
|
202
|
+
high,
|
|
203
|
+
medium,
|
|
204
|
+
low,
|
|
205
|
+
total: critical + high + medium + low,
|
|
206
|
+
criticalAndHigh: critical + high
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Extracts a single origin name from a potentially comma-separated list
|
|
211
|
+
* @param originName Origin name string that might contain multiple comma-separated values
|
|
212
|
+
* @returns A single origin name if all values are the same, otherwise throws an exception
|
|
213
|
+
*/
|
|
214
|
+
function getSingleOriginName(originName) {
|
|
215
|
+
if (!originName) {
|
|
216
|
+
return '';
|
|
217
|
+
}
|
|
218
|
+
const origins = originName.split(',').map(origin => origin.trim()).filter(origin => origin.length > 0);
|
|
219
|
+
if (origins.length === 0) {
|
|
220
|
+
return '';
|
|
221
|
+
}
|
|
222
|
+
const firstOrigin = origins[0];
|
|
223
|
+
const allSame = origins.every(origin => origin === firstOrigin);
|
|
224
|
+
if (!allSame) {
|
|
225
|
+
throw new Error(`Multiple different origin names found: ${originName}`);
|
|
226
|
+
}
|
|
227
|
+
return firstOrigin;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Transforms components data into dependencies records
|
|
231
|
+
* @param components Raw component records from Black Duck
|
|
232
|
+
* @returns Transformed dependency records
|
|
233
|
+
*/
|
|
234
|
+
function transformDependencies(components) {
|
|
235
|
+
return components.map(component => {
|
|
236
|
+
const counts = calculateVulnerabilityCounts(component);
|
|
237
|
+
const result = {
|
|
238
|
+
'Component name': component['Component name'],
|
|
239
|
+
'Component version name': component['Component version name'],
|
|
240
|
+
'Component Version Origin Id': component['Origin id'] || '',
|
|
241
|
+
'License names': component['License names'],
|
|
242
|
+
'License families': component['License families'],
|
|
243
|
+
'Match type': normalizeMatchType(component['Match type']),
|
|
244
|
+
'Usage': component['Usage'],
|
|
245
|
+
'Operational Risk': component['Operational Risk'],
|
|
246
|
+
'License Risk': component['License Risk'],
|
|
247
|
+
'Total Vulnerability Count': `${counts.total}`,
|
|
248
|
+
'Critical and High Vulnerability Count': `${counts.criticalAndHigh}`,
|
|
249
|
+
'Critical Vulnerability Count': counts.critical > 0 ? `${counts.critical}` : '',
|
|
250
|
+
'High Vulnerability Count': counts.high > 0 ? `${counts.high}` : '',
|
|
251
|
+
'Medium Vulnerability Count': counts.medium > 0 ? `${counts.medium}` : '',
|
|
252
|
+
'Low Vulnerability Count': counts.low > 0 ? `${counts.low}` : '',
|
|
253
|
+
'Release Date': formatDateField(component['Release Date']),
|
|
254
|
+
'Newer Versions': component['Newer Versions'],
|
|
255
|
+
'Open Hub URL': component['Open Hub URL']
|
|
256
|
+
};
|
|
257
|
+
// Handle optional fields
|
|
258
|
+
result['Origin name'] = getSingleOriginName(component['Origin name'] || '');
|
|
259
|
+
result['Commit Activity'] = component['Commit Activity'] || '';
|
|
260
|
+
result['Commits in Past 12 Months'] = component['Commits in Past 12 Months'] || '';
|
|
261
|
+
result['Contributors in Past 12 Months'] = component['Contributors in Past 12 Months'] || '';
|
|
262
|
+
result['Has License Conflicts'] = component['Has License Conflicts'] || '';
|
|
263
|
+
result['Component Link'] = component['Component Link'] || '';
|
|
264
|
+
return result;
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Transforms sources and components data into dependencies_sources records
|
|
269
|
+
* @param sources Raw source records from Black Duck
|
|
270
|
+
* @param components Raw component records from Black Duck
|
|
271
|
+
* @param basePath Optional base path for verifying project paths
|
|
272
|
+
* @returns Transformed dependency source records
|
|
273
|
+
*/
|
|
274
|
+
function transformDependenciesSources(sources, components, basePath, pathMappings) {
|
|
275
|
+
const validSources = sources.filter(src => components.some(c => c['Version id'] === src['Version id']));
|
|
276
|
+
return validSources.map(src => {
|
|
277
|
+
const comp = components.find(c => c['Version id'] === src['Version id']);
|
|
278
|
+
const counts = calculateVulnerabilityCounts(comp);
|
|
279
|
+
// Extract project information from path
|
|
280
|
+
const projectInfo = basePath
|
|
281
|
+
? (0, projectMapping_1.extractProjectInfo)(src['Path'], src['Origin name'], basePath, pathMappings)
|
|
282
|
+
: (0, projectMapping_1.extractProjectInfo)(src['Path'], src['Origin name']);
|
|
283
|
+
return {
|
|
284
|
+
'Component name': src['Component name'],
|
|
285
|
+
'Component version name': src['Component version name'],
|
|
286
|
+
'Component Version Origin Id': src['Origin name id'],
|
|
287
|
+
'Match type': normalizeMatchType(src['Match type']),
|
|
288
|
+
'Path': src['Path'],
|
|
289
|
+
'ProjectPath': projectInfo.projectPath,
|
|
290
|
+
'VerifiedPath': projectInfo.verifiedPath,
|
|
291
|
+
'ProjectPathExists': projectInfo.projectPathExists !== undefined ? String(projectInfo.projectPathExists) : '',
|
|
292
|
+
'Origin name': src['Origin name'],
|
|
293
|
+
'License names': comp['License names'],
|
|
294
|
+
'License families': comp['License families'],
|
|
295
|
+
'License Risk': comp['License Risk'],
|
|
296
|
+
'Critical Vulnerability Count': counts.critical > 0 ? `${counts.critical}` : '',
|
|
297
|
+
'High Vulnerability Count': counts.high > 0 ? `${counts.high}` : '',
|
|
298
|
+
'Medium Vulnerability Count': counts.medium > 0 ? `${counts.medium}` : '',
|
|
299
|
+
'Low Vulnerability Count': counts.low > 0 ? `${counts.low}` : '',
|
|
300
|
+
'Total Vulnerability Count': `${counts.total}`,
|
|
301
|
+
'Critical and High Vulnerability Count': `${counts.criticalAndHigh}`,
|
|
302
|
+
'Operational Risk': comp['Operational Risk'],
|
|
303
|
+
'Release Date': formatDateField(comp['Release Date']),
|
|
304
|
+
'Newer Versions': comp['Newer Versions'],
|
|
305
|
+
'OpenHubURL': comp['Open Hub URL'],
|
|
306
|
+
'Repository': '',
|
|
307
|
+
'Group': ''
|
|
308
|
+
};
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Transforms security records into vulnerability details records
|
|
313
|
+
* @param securityRecords Raw security records from Black Duck
|
|
314
|
+
* @returns Transformed vulnerability detail records
|
|
315
|
+
*/
|
|
316
|
+
function transformVulnerabilityDetails(securityRecords) {
|
|
317
|
+
return securityRecords.map(record => {
|
|
318
|
+
const result = {};
|
|
319
|
+
for (const key of VULNERABILITY_DETAILS_HEADERS) {
|
|
320
|
+
if (key === 'Published on' || key === 'Updated on') {
|
|
321
|
+
result[key] = formatDateField(record[key] || '');
|
|
322
|
+
}
|
|
323
|
+
else if (key === 'Component Version Origin Id') {
|
|
324
|
+
result[key] = normalizeValue(record['Component origin id']);
|
|
325
|
+
}
|
|
326
|
+
else {
|
|
327
|
+
result[key] = normalizeValue(record[key]);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
return result;
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Transforms upgrade guidance CSV content
|
|
335
|
+
* @param upgradeRaw Raw upgrade guidance CSV content
|
|
336
|
+
* @returns Transformed upgrade guidance CSV content
|
|
337
|
+
*/
|
|
338
|
+
function transformUpgradeGuidance(upgradeRaw) {
|
|
339
|
+
const [headerLine, ...lines] = upgradeRaw.trim().split('\n');
|
|
340
|
+
const headers = headerLine.split(',');
|
|
341
|
+
// Replace 'Component Origin External Id' with 'Component Version Origin Id'
|
|
342
|
+
const modifiedHeaders = headers.map(h => h.trim() === 'Component Origin External Id' ? 'Component Version Origin Id' : h);
|
|
343
|
+
const keepIndexes = modifiedHeaders
|
|
344
|
+
.map((h, i) => UPGRADE_GUIDANCE_COLUMNS_TO_REMOVE.has(h.trim()) ? -1 : i)
|
|
345
|
+
.filter(i => i >= 0);
|
|
346
|
+
return [
|
|
347
|
+
keepIndexes.map(i => modifiedHeaders[i]).join(','),
|
|
348
|
+
...lines.map(line => {
|
|
349
|
+
const parts = line.split(',');
|
|
350
|
+
return keepIndexes.map(i => { var _a; return (_a = parts[i]) !== null && _a !== void 0 ? _a : ''; }).join(',');
|
|
351
|
+
})
|
|
352
|
+
].join('\n');
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Formats records according to a specific column order
|
|
356
|
+
* @param records Records to format
|
|
357
|
+
* @param columnOrder Column order to use
|
|
358
|
+
* @returns Formatted records
|
|
359
|
+
*/
|
|
360
|
+
function formatRecordsWithColumnOrder(records, columnOrder) {
|
|
361
|
+
return records.map(row => {
|
|
362
|
+
const formattedRow = {};
|
|
363
|
+
columnOrder.forEach(col => {
|
|
364
|
+
formattedRow[col] = row[col] || '';
|
|
365
|
+
});
|
|
366
|
+
return formattedRow;
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Validates that all required Black Duck report files are present
|
|
371
|
+
* @param entries Directory entries
|
|
372
|
+
* @returns Object with file names or throws error if files are missing
|
|
373
|
+
*/
|
|
374
|
+
function validateRequiredFiles(entries) {
|
|
375
|
+
const componentFile = entries.find(f => f.startsWith('components_'));
|
|
376
|
+
const sourceFile = entries.find(f => f.startsWith('source_'));
|
|
377
|
+
const securityFile = entries.find(f => f.startsWith('security_'));
|
|
378
|
+
const upgradeFile = entries.find(f => f.startsWith('project_version_upgrade_guidance_'));
|
|
379
|
+
const missingFiles = [];
|
|
380
|
+
if (!componentFile)
|
|
381
|
+
missingFiles.push('components_*.csv');
|
|
382
|
+
if (!sourceFile)
|
|
383
|
+
missingFiles.push('source_*.csv');
|
|
384
|
+
if (!securityFile)
|
|
385
|
+
missingFiles.push('security_*.csv');
|
|
386
|
+
if (!upgradeFile)
|
|
387
|
+
missingFiles.push('project_version_upgrade_guidance_*.csv');
|
|
388
|
+
if (missingFiles.length > 0) {
|
|
389
|
+
throw new Error(`Missing required Black Duck CSV files: ${missingFiles.join(', ')}`);
|
|
390
|
+
}
|
|
391
|
+
return {
|
|
392
|
+
componentFile: componentFile,
|
|
393
|
+
sourceFile: sourceFile,
|
|
394
|
+
securityFile: securityFile,
|
|
395
|
+
upgradeFile: upgradeFile
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* Transforms raw Black Duck CSV exports into four cleaned and shareable CSV reports
|
|
400
|
+
* @param reportDir Directory containing Black Duck report files
|
|
401
|
+
* @param options Command options including optional basePath and pathMappings
|
|
402
|
+
*/
|
|
403
|
+
async function transformBlackDuckReports(reportDir, options) {
|
|
404
|
+
try {
|
|
405
|
+
// Find and validate required input files
|
|
406
|
+
const entries = await promises_1.default.readdir(reportDir);
|
|
407
|
+
const { componentFile, sourceFile, securityFile, upgradeFile } = validateRequiredFiles(entries);
|
|
408
|
+
let pathMappings = loadPathMappings(options);
|
|
409
|
+
// Read input files
|
|
410
|
+
const componentsRawData = await promises_1.default.readFile(path_1.default.join(reportDir, componentFile), 'utf-8');
|
|
411
|
+
const sourcesRawData = await promises_1.default.readFile(path_1.default.join(reportDir, sourceFile), 'utf-8');
|
|
412
|
+
const securityRawData = await promises_1.default.readFile(path_1.default.join(reportDir, securityFile), 'utf-8');
|
|
413
|
+
const upgradeRawData = await promises_1.default.readFile(path_1.default.join(reportDir, upgradeFile), 'utf-8');
|
|
414
|
+
// Parse input data
|
|
415
|
+
const components = (0, sync_1.parse)(componentsRawData, CSV_PARSE_OPTIONS);
|
|
416
|
+
const sources = (0, sync_1.parse)(sourcesRawData, CSV_PARSE_OPTIONS);
|
|
417
|
+
const securityRecords = (0, sync_1.parse)(securityRawData, CSV_PARSE_OPTIONS);
|
|
418
|
+
// Transform and write _dependencies_sources.csv
|
|
419
|
+
const dependenciesSourcesRecords = transformDependenciesSources(sources, components, options === null || options === void 0 ? void 0 : options.basePath, pathMappings);
|
|
420
|
+
const emptyVerifiedPaths = dependenciesSourcesRecords.filter(record => record['VerifiedPath'] === '');
|
|
421
|
+
if (emptyVerifiedPaths.length > 0) {
|
|
422
|
+
console.warn(`Found ${emptyVerifiedPaths.length} out of ${dependenciesSourcesRecords.length} dependencies with empty verified paths.`);
|
|
423
|
+
}
|
|
424
|
+
const formattedDependenciesSources = formatRecordsWithColumnOrder(dependenciesSourcesRecords, DEPENDENCIES_SOURCES_COLUMN_ORDER);
|
|
425
|
+
const dependenciesSourcesCSV = (0, sync_2.stringify)(formattedDependenciesSources, { header: true });
|
|
426
|
+
await promises_1.default.writeFile(path_1.default.join(reportDir, '_dependencies_sources.csv'), dependenciesSourcesCSV);
|
|
427
|
+
// Transform and write _dependencies.csv
|
|
428
|
+
const dependencyRecords = transformDependencies(components);
|
|
429
|
+
const formattedDependencies = formatRecordsWithColumnOrder(dependencyRecords, DEPENDENCIES_COLUMN_ORDER);
|
|
430
|
+
const dependenciesCSV = (0, sync_2.stringify)(formattedDependencies, { header: true });
|
|
431
|
+
await promises_1.default.writeFile(path_1.default.join(reportDir, '_dependencies.csv'), dependenciesCSV);
|
|
432
|
+
// Transform and write _vulnerability_details.csv
|
|
433
|
+
const vulnerabilityRecords = transformVulnerabilityDetails(securityRecords);
|
|
434
|
+
const vulnerabilityCSV = (0, sync_2.stringify)(vulnerabilityRecords, { header: true });
|
|
435
|
+
await promises_1.default.writeFile(path_1.default.join(reportDir, '_vulnerability_details.csv'), vulnerabilityCSV);
|
|
436
|
+
// Transform and write _upgrade_guidance.csv
|
|
437
|
+
const upgradeGuidanceCSV = transformUpgradeGuidance(upgradeRawData);
|
|
438
|
+
await promises_1.default.writeFile(path_1.default.join(reportDir, '_upgrade_guidance.csv'), upgradeGuidanceCSV);
|
|
439
|
+
}
|
|
440
|
+
catch (error) {
|
|
441
|
+
if (error instanceof Error) {
|
|
442
|
+
throw new Error(`Failed to transform Black Duck reports: ${error.message}`);
|
|
443
|
+
}
|
|
444
|
+
throw error;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
exports.transformBlackDuckReports = transformBlackDuckReports;
|
|
448
|
+
exports.transformBlackDuckReportsCommand = new commander_1.Command()
|
|
449
|
+
.command('transformBlackDuckReports')
|
|
450
|
+
.description('Transforms Black Duck CSV reports to shareable format')
|
|
451
|
+
.argument('<reportPath>', 'Path to the directory with Black Duck CSVs')
|
|
452
|
+
.option('-b, --basePath <path>', 'Base path for verifying project paths')
|
|
453
|
+
.option('-m, --pathMappings <path>', 'Path to JSON file containing path mappings')
|
|
454
|
+
.action(transformBlackDuckReports);
|
|
455
|
+
function loadPathMappings(options) {
|
|
456
|
+
let pathMappings = undefined;
|
|
457
|
+
if (options === null || options === void 0 ? void 0 : options.pathMappings) {
|
|
458
|
+
try {
|
|
459
|
+
console.log(`Loading path mappings from ${options.pathMappings}`);
|
|
460
|
+
if (!fsSync.existsSync(options.pathMappings)) {
|
|
461
|
+
console.warn(`Path mapping file not found: ${options.pathMappings}`);
|
|
462
|
+
}
|
|
463
|
+
else {
|
|
464
|
+
const fileContent = fsSync.readFileSync(options.pathMappings, 'utf8');
|
|
465
|
+
const mappingData = JSON.parse(fileContent);
|
|
466
|
+
if (!mappingData.pathMappings || !Array.isArray(mappingData.pathMappings)) {
|
|
467
|
+
console.warn(`Invalid path mapping file format: ${options.pathMappings}`);
|
|
468
|
+
}
|
|
469
|
+
else {
|
|
470
|
+
pathMappings = (0, projectMapping_1.createPathMappings)(mappingData.pathMappings);
|
|
471
|
+
console.log(`Loaded ${pathMappings.size} path mappings from ${options.pathMappings}`);
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
catch (error) {
|
|
476
|
+
console.error(`Error loading path mappings: ${error}`);
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
return pathMappings;
|
|
480
|
+
}
|
|
481
|
+
//# sourceMappingURL=transformBlackDuckReports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transformBlackDuckReports.js","sourceRoot":"","sources":["../../src/commands/transformBlackDuckReports.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2DAA6B;AAC7B,2CAA6B;AAC7B,gDAAwB;AACxB,yCAAoC;AACpC,yCAAuC;AACvC,6CAA+C;AAC/C,4DAAgH;AAEhH;;GAEG;AACH,MAAM,iBAAiB,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAW,CAAC;AA6C7E;;GAEG;AACH,MAAM,yBAAyB,GAAG;IAC9B,gBAAgB;IAChB,wBAAwB;IACxB,6BAA6B;IAC7B,eAAe;IACf,kBAAkB;IAClB,YAAY;IACZ,OAAO;IACP,kBAAkB;IAClB,aAAa;IACb,cAAc;IACd,2BAA2B;IAC3B,uCAAuC;IACvC,8BAA8B;IAC9B,0BAA0B;IAC1B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AAC;IACvD,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY,EAAE;QACvB,IAAI;YACA,OAAO,CAAC,GAAG,CAAC,8BAA8B,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;YAElE,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;gBAC1C,OAAO,CAAC,IAAI,CAAC,gCAAgC,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;aACxE;iBAAM;gBACH,MAAM,WAAW,GAAG,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;gBACtE,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;gBAE5C,IAAI,CAAC,WAAW,CAAC,YAAY,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,EAAE;oBACvE,OAAO,CAAC,IAAI,CAAC,qCAAqC,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;iBAC7E;qBAAM;oBACH,YAAY,GAAG,IAAA,mCAAkB,EAAC,WAAW,CAAC,YAAY,CAAC,CAAC;oBAC5D,OAAO,CAAC,GAAG,CAAC,UAAU,YAAY,CAAC,IAAI,uBAAuB,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;iBACzF;aACJ;SACJ;QAAC,OAAO,KAAK,EAAE;YACZ,OAAO,CAAC,KAAK,CAAC,gCAAgC,KAAK,EAAE,CAAC,CAAC;SAC1D;KACJ;IACD,OAAO,YAAY,CAAC;AACxB,CAAC"}
|
package/dist/depinder.js
CHANGED
|
@@ -6,11 +6,15 @@ const utils_1 = require("./utils/utils");
|
|
|
6
6
|
const analyse_1 = require("./commands/analyse");
|
|
7
7
|
const cache_1 = require("./commands/cache");
|
|
8
8
|
const update_1 = require("./commands/update");
|
|
9
|
+
const extractFrameworkVersion_1 = require("./commands/extractFrameworkVersion");
|
|
10
|
+
const transformBlackDuckReports_1 = require("./commands/transformBlackDuckReports");
|
|
9
11
|
exports.mainCommand = new commander_1.Command()
|
|
10
12
|
.name('depinder')
|
|
11
13
|
.description(utils_1._package.description)
|
|
12
14
|
.version(utils_1._package.version, '-v, -version, --version, -V')
|
|
13
15
|
.addCommand(analyse_1.analyseCommand)
|
|
14
16
|
.addCommand(update_1.updateCommand)
|
|
15
|
-
.addCommand(cache_1.cacheCommand)
|
|
17
|
+
.addCommand(cache_1.cacheCommand)
|
|
18
|
+
.addCommand(extractFrameworkVersion_1.extractFrameworkVersionsCommand)
|
|
19
|
+
.addCommand(transformBlackDuckReports_1.transformBlackDuckReportsCommand);
|
|
16
20
|
//# sourceMappingURL=depinder.js.map
|
package/dist/depinder.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"depinder.js","sourceRoot":"","sources":["../src/depinder.ts"],"names":[],"mappings":";;;AAAA,yCAAiC;AACjC,yCAAsC;AACtC,gDAAiD;AACjD,4CAA6C;AAC7C,8CAA+C;
|
|
1
|
+
{"version":3,"file":"depinder.js","sourceRoot":"","sources":["../src/depinder.ts"],"names":[],"mappings":";;;AAAA,yCAAiC;AACjC,yCAAsC;AACtC,gDAAiD;AACjD,4CAA6C;AAC7C,8CAA+C;AAC/C,gFAAkF;AAClF,oFAAqF;AAExE,QAAA,WAAW,GAAG,IAAI,mBAAO,EAAE;KACnC,IAAI,CAAC,UAAU,CAAC;KAChB,WAAW,CAAC,gBAAQ,CAAC,WAAW,CAAC;KACjC,OAAO,CAAC,gBAAQ,CAAC,OAAO,EAAE,6BAA6B,CAAC;KACxD,UAAU,CAAC,wBAAc,CAAC;KAC1B,UAAU,CAAC,sBAAa,CAAC;KACzB,UAAU,CAAC,oBAAY,CAAC;KACxB,UAAU,CAAC,yDAA+B,CAAC;KAC3C,UAAU,CAAC,4DAAgC,CAAC,CAAA"}
|