@xliic/cicd-core-node
Advanced tools
Comparing version 5.4.0 to 5.5.0
@@ -182,4 +182,5 @@ "use strict"; | ||
function readTechnicalCollection(technicalName, options) { | ||
var _a; | ||
var _a, _b; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const log = options.logger; | ||
try { | ||
@@ -194,2 +195,5 @@ const response = yield (0, got_1.default)(`api/v1/collections/technicalName`, Object.assign(Object.assign({}, gotOptions("POST", options)), { json: { technicalName } })); | ||
} | ||
if (err instanceof got_1.HTTPError && ((_b = err === null || err === void 0 ? void 0 : err.response) === null || _b === void 0 ? void 0 : _b.statusCode) === 403) { | ||
log.error(`Failed to read API Collection. Please check if you have permissions top access collection with technical name: ${technicalName}`); | ||
} | ||
return handleHttpError(err, options); | ||
@@ -208,3 +212,5 @@ } | ||
function createTechnicalCollection(technicalName, name, options) { | ||
var _a; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const log = options.logger; | ||
const sharing = { | ||
@@ -215,4 +221,14 @@ isShared: options.shareEveryone === types_1.SharingType.ReadOnly || | ||
}; | ||
const { body } = yield (0, got_1.default)("api/v1/collections", Object.assign(Object.assign({}, gotOptions("POST", options)), { json: Object.assign({ technicalName: technicalName, name: name, source: options.cicdName }, sharing) })); | ||
return body.desc.id; | ||
try { | ||
const { body } = yield (0, got_1.default)("api/v1/collections", Object.assign(Object.assign({}, gotOptions("POST", options)), { json: Object.assign({ technicalName: technicalName, name: name, source: options.cicdName }, sharing) })); | ||
return body.desc.id; | ||
} | ||
catch (err) { | ||
if (err instanceof got_1.HTTPError && | ||
((_a = err === null || err === void 0 ? void 0 : err.response) === null || _a === void 0 ? void 0 : _a.statusCode) === 403 && | ||
sharing.isShared) { | ||
log.error("Failed to create shared API collection. Please check if you have permission to create shared collections."); | ||
} | ||
throw err; | ||
} | ||
}); | ||
@@ -219,0 +235,0 @@ } |
{ | ||
"name": "@xliic/cicd-core-node", | ||
"version": "5.4.0", | ||
"version": "5.5.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
104730
2421