@xliic/cicd-core-node
Advanced tools
Comparing version 5.25.0-rc0 to 5.25.0
@@ -31,3 +31,3 @@ "use strict"; | ||
yield (0, util_1.checkMissingsTags)(options); | ||
const [filesGrouped, deleted] = yield runAudit(options, platformConfig); | ||
const [filesGrouped, deleted, collectionInfo] = yield runAudit(options, platformConfig); | ||
const files = new Map([ | ||
@@ -39,3 +39,3 @@ ...filesGrouped.discovery.entries(), | ||
displayReport(files, options); | ||
const jsonReport = (0, util_1.getJsonReport)(filesGrouped, deleted); | ||
const jsonReport = (0, util_1.getJsonReport)(filesGrouped, deleted, collectionInfo); | ||
if (options.writeJsonReportTo !== undefined && | ||
@@ -105,3 +105,3 @@ options.writeJsonReportTo !== "") { | ||
const [openapiFilenames, errors] = yield (0, discovery_1.discoverOpenApiFiles)(options); | ||
const [discovered, deleted] = yield (0, discovery_1.auditDiscoveredFiles)(openapiFilenames, options, platformConfig); | ||
const [discovered, deleted, collectionInfo] = yield (0, discovery_1.auditDiscoveredFiles)(openapiFilenames, options, platformConfig); | ||
const discovery = new Map([...errors, ...discovered]); | ||
@@ -116,2 +116,3 @@ if (options.config.mappedFiles) { | ||
deleted, | ||
collectionInfo, | ||
]; | ||
@@ -125,2 +126,3 @@ } | ||
deleted, | ||
collectionInfo, | ||
]; | ||
@@ -127,0 +129,0 @@ }); |
@@ -1,3 +0,3 @@ | ||
import { AuditOptions, ScanOptions, FileAuditMap, TaskOptions, FileScanMap, ApiErrors, Api, PlatformConfig, DeletedMap } from "./types"; | ||
export declare function auditDiscoveredFiles(openapiFilenames: string[], options: AuditOptions, platformConfig: PlatformConfig): Promise<[FileAuditMap, DeletedMap]>; | ||
import { AuditOptions, ScanOptions, FileAuditMap, TaskOptions, FileScanMap, ApiErrors, Api, PlatformConfig, DeletedMap, DiscoveryCollectionInfo } from "./types"; | ||
export declare function auditDiscoveredFiles(openapiFilenames: string[], options: AuditOptions, platformConfig: PlatformConfig): Promise<[FileAuditMap, DeletedMap, DiscoveryCollectionInfo]>; | ||
export declare function scanDiscoveredFiles(openapiFilenames: string[], options: ScanOptions, platformConfig: PlatformConfig): Promise<FileScanMap>; | ||
@@ -4,0 +4,0 @@ export declare function discoverOpenApiFiles(options: TaskOptions): Promise<[string[], Map<string, ApiErrors>]>; |
@@ -28,3 +28,8 @@ "use strict"; | ||
const audited = yield (0, audit_results_1.readAuditResults)(fileMap, options.config.failureConditions, platformConfig.gates, options); | ||
return [audited, deleted]; | ||
const collectionInfo = { | ||
collectionId, | ||
technicalName: technicalCollectionName, | ||
name: collectionName, | ||
}; | ||
return [audited, deleted, collectionInfo]; | ||
}); | ||
@@ -31,0 +36,0 @@ } |
@@ -270,2 +270,3 @@ export declare type Result<R, E> = [R, undefined] | [undefined, E]; | ||
deleted: JsonAuditReportDeleted; | ||
discoveryCollection: DiscoveryCollectionInfo; | ||
}; | ||
@@ -288,2 +289,7 @@ } | ||
} | ||
export declare type DiscoveryCollectionInfo = { | ||
collectionId: string; | ||
name: string; | ||
technicalName: string; | ||
}; | ||
export {}; |
@@ -1,2 +0,2 @@ | ||
import { InternalAuditResult, JsonAuditReport, JsonReport, Logger, PlatformConfig, Reference, Tag, TagsCategory, TaskOptions, DeletedMap, JsonAuditReportDeleted } from "./types"; | ||
import { InternalAuditResult, JsonAuditReport, JsonReport, Logger, PlatformConfig, Reference, Tag, TagsCategory, TaskOptions, DeletedMap, JsonAuditReportDeleted, DiscoveryCollectionInfo } from "./types"; | ||
export declare function makeSafeName(name: string): string; | ||
@@ -9,3 +9,3 @@ export declare function makeCollectionName(repo: string, reference: Reference, nameTemplate: string, log: Logger): string; | ||
export declare function getErrorMessage(errors: any): string; | ||
export declare function getJsonReport(audit: InternalAuditResult, deleted: DeletedMap): JsonReport; | ||
export declare function getJsonReport(audit: InternalAuditResult, deleted: DeletedMap, collectionInfo: DiscoveryCollectionInfo): JsonReport; | ||
export declare function getJsonAuditReport(result: InternalAuditResult): JsonAuditReport; | ||
@@ -12,0 +12,0 @@ export declare function getJsonDeletedReport(deleted: DeletedMap): JsonAuditReportDeleted; |
@@ -144,3 +144,3 @@ "use strict"; | ||
exports.getErrorMessage = getErrorMessage; | ||
function getJsonReport(audit, deleted) { | ||
function getJsonReport(audit, deleted, collectionInfo) { | ||
return { | ||
@@ -150,2 +150,3 @@ audit: { | ||
deleted: getJsonDeletedReport(deleted), | ||
discoveryCollection: collectionInfo, | ||
}, | ||
@@ -240,2 +241,12 @@ }; | ||
} | ||
let needMultiple = [ | ||
...new Set(missingTags | ||
.filter((t) => missingTags.filter((t2) => t.categoryName === t2.categoryName) | ||
.length > 1) | ||
.map((t) => t.categoryName) | ||
.filter((t) => platformTagsCategories.find((c) => c.name === t && c.isExclusive))), | ||
]; | ||
if (needMultiple.length > 0) { | ||
throw new error_1.TaskError(`Unable to add tags, please check that categories: [${needMultiple}] have setting 'Allow applying multiple tags from the category' enabled or specify only one tag for this category.`); | ||
} | ||
options.logger.info(`Tags: [${tagsToString(missingTags)}] specified in the configuration do not exist on the platform, trying to create`); | ||
@@ -242,0 +253,0 @@ for (const tag of missingTags) { |
{ | ||
"name": "@xliic/cicd-core-node", | ||
"version": "5.25.0-rc0", | ||
"version": "5.25.0", | ||
"description": "Performs API contract security audit to get a detailed analysis of the possible vulnerabilities and other issues in the API contract.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
132962
3008
1