@xliic/cicd-core-node
Advanced tools
Comparing version 5.25.0 to 5.25.1
@@ -224,11 +224,22 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
if (options.apiTags.length > 0) { | ||
const { logger: log, apiTags } = options; | ||
if (apiTags.length > 0) { | ||
const platformTagsCategories = yield (0, api_1.getPlatformTagsCategories)(options); | ||
const apiTags = yield (0, api_1.getPlatformTags)(options); | ||
const missingCategoriesName = getMissingCategoryNames(options.apiTags, platformTagsCategories); | ||
const platformApiTags = yield (0, api_1.getPlatformTags)(options); | ||
const missingCategoriesName = getMissingCategoryNames(apiTags, platformTagsCategories); | ||
if (missingCategoriesName.length > 0) { | ||
throw new error_1.TaskError(`Categories: [${missingCategoriesName}] specified in the configuration do not exist on the platform`); | ||
} | ||
let missingTags = getMissingTags(options.apiTags, apiTags); | ||
console.log(`"Missing tags: [${tagsToString(missingTags)}]`); | ||
let needMultiple = [ | ||
...new Set(apiTags | ||
.filter((t) => apiTags.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.`); | ||
} | ||
let missingTags = getMissingTags(apiTags, platformApiTags); | ||
log.debug(`"Missing tags: [${tagsToString(missingTags)}]`); | ||
if (missingTags.length > 0) { | ||
@@ -240,13 +251,3 @@ const needAllow = platformTagsCategories.filter((c) => missingTags.map((t) => t.categoryName).includes(c.name) && | ||
} | ||
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`); | ||
log.info(`Tags: [${tagsToString(missingTags)}] specified in the configuration do not exist on the platform, trying to create`); | ||
for (const tag of missingTags) { | ||
@@ -253,0 +254,0 @@ yield (0, api_1.saveTag)(tag, options); |
{ | ||
"name": "@xliic/cicd-core-node", | ||
"version": "5.25.0", | ||
"version": "5.25.1", | ||
"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
3009
132943