@adamlonsdale/backstage-plugin-armorcode-backend
Version:
Welcome to the backstage-plugin-armorcode-backend backend plugin!
1,317 lines (1,268 loc) • 58.7 kB
JavaScript
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var backendCommon = require('@backstage/backend-common');
var express = require('express');
var Router = require('express-promise-router');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var express__default = /*#__PURE__*/_interopDefaultLegacy(express);
var Router__default = /*#__PURE__*/_interopDefaultLegacy(Router);
class ApiError extends Error {
constructor(request, response, message) {
super(message);
this.name = "ApiError";
this.url = response.url;
this.status = response.status;
this.statusText = response.statusText;
this.body = response.body;
this.request = request;
}
}
class CancelError extends Error {
constructor(message) {
super(message);
this.name = "CancelError";
}
get isCancelled() {
return true;
}
}
class CancelablePromise {
constructor(executor) {
this._isResolved = false;
this._isRejected = false;
this._isCancelled = false;
this._cancelHandlers = [];
this._promise = new Promise((resolve, reject) => {
this._resolve = resolve;
this._reject = reject;
const onResolve = (value) => {
var _a;
if (this._isResolved || this._isRejected || this._isCancelled) {
return;
}
this._isResolved = true;
(_a = this._resolve) == null ? void 0 : _a.call(this, value);
};
const onReject = (reason) => {
var _a;
if (this._isResolved || this._isRejected || this._isCancelled) {
return;
}
this._isRejected = true;
(_a = this._reject) == null ? void 0 : _a.call(this, reason);
};
const onCancel = (cancelHandler) => {
if (this._isResolved || this._isRejected || this._isCancelled) {
return;
}
this._cancelHandlers.push(cancelHandler);
};
Object.defineProperty(onCancel, "isResolved", {
get: () => this._isResolved
});
Object.defineProperty(onCancel, "isRejected", {
get: () => this._isRejected
});
Object.defineProperty(onCancel, "isCancelled", {
get: () => this._isCancelled
});
return executor(onResolve, onReject, onCancel);
});
}
then(onFulfilled, onRejected) {
return this._promise.then(onFulfilled, onRejected);
}
catch(onRejected) {
return this._promise.catch(onRejected);
}
finally(onFinally) {
return this._promise.finally(onFinally);
}
cancel() {
var _a;
if (this._isResolved || this._isRejected || this._isCancelled) {
return;
}
this._isCancelled = true;
if (this._cancelHandlers.length) {
try {
for (const cancelHandler of this._cancelHandlers) {
cancelHandler();
}
} catch (error) {
console.warn("Cancellation threw an error", error);
return;
}
}
this._cancelHandlers.length = 0;
(_a = this._reject) == null ? void 0 : _a.call(this, new CancelError("Request aborted"));
}
get isCancelled() {
return this._isCancelled;
}
}
const OpenAPI = {
BASE: "https://app.armorcode.com",
VERSION: "1.0",
WITH_CREDENTIALS: false,
CREDENTIALS: "include",
TOKEN: void 0,
USERNAME: void 0,
PASSWORD: void 0,
HEADERS: void 0,
ENCODE_PATH: void 0
};
var ActionResponseDto;
((ActionResponseDto2) => {
((operation2) => {
operation2["READ"] = "READ";
operation2["WRITE"] = "WRITE";
operation2["DELETE"] = "DELETE";
})(ActionResponseDto2.operation || (ActionResponseDto2.operation = {}));
((method2) => {
method2["GET"] = "GET";
method2["HEAD"] = "HEAD";
method2["POST"] = "POST";
method2["PUT"] = "PUT";
method2["PATCH"] = "PATCH";
method2["DELETE"] = "DELETE";
method2["OPTIONS"] = "OPTIONS";
method2["TRACE"] = "TRACE";
})(ActionResponseDto2.method || (ActionResponseDto2.method = {}));
})(ActionResponseDto || (ActionResponseDto = {}));
var AlertSummary;
((AlertSummary2) => {
((severity2) => {
severity2["CRITICAL"] = "CRITICAL";
severity2["HIGH"] = "HIGH";
severity2["MEDIUM"] = "MEDIUM";
severity2["LOW"] = "LOW";
severity2["INFO"] = "INFO";
})(AlertSummary2.severity || (AlertSummary2.severity = {}));
((status2) => {
status2["OPEN"] = "OPEN";
status2["PROGRESS"] = "PROGRESS";
status2["CLOSED"] = "CLOSED";
})(AlertSummary2.status || (AlertSummary2.status = {}));
})(AlertSummary || (AlertSummary = {}));
var AuditLogResponseDto;
((AuditLogResponseDto2) => {
((revisionType2) => {
revisionType2["LOGGED_IN"] = "LOGGED_IN";
revisionType2["LOGGED_OUT"] = "LOGGED_OUT";
revisionType2["SESSION_TIME_OUT"] = "SESSION_TIME_OUT";
revisionType2["CREATED"] = "CREATED";
revisionType2["UPDATED"] = "UPDATED";
revisionType2["DELETED"] = "DELETED";
revisionType2["ADDED"] = "ADDED";
revisionType2["REMOVED"] = "REMOVED";
revisionType2["REQUESTED"] = "REQUESTED";
revisionType2["DOWNLOADED"] = "DOWNLOADED";
})(AuditLogResponseDto2.revisionType || (AuditLogResponseDto2.revisionType = {}));
((auditLogLevel2) => {
auditLogLevel2["ALL"] = "ALL";
auditLogLevel2["TENANT_LEVEL"] = "TENANT_LEVEL";
auditLogLevel2["BUSINESS_UNIT_LEVEL"] = "BUSINESS_UNIT_LEVEL";
})(AuditLogResponseDto2.auditLogLevel || (AuditLogResponseDto2.auditLogLevel = {}));
})(AuditLogResponseDto || (AuditLogResponseDto = {}));
var BulkFindingUpdateRequest;
((BulkFindingUpdateRequest2) => {
((status2) => {
status2["OPEN"] = "OPEN";
status2["CONFIRMED"] = "CONFIRMED";
status2["ACCEPTRISK"] = "ACCEPTRISK";
status2["FALSEPOSITIVE"] = "FALSEPOSITIVE";
status2["MITIGATED"] = "MITIGATED";
})(BulkFindingUpdateRequest2.status || (BulkFindingUpdateRequest2.status = {}));
((severity2) => {
severity2["INFO"] = "INFO";
severity2["LOW"] = "LOW";
severity2["MEDIUM"] = "MEDIUM";
severity2["HIGH"] = "HIGH";
severity2["CRITICAL"] = "CRITICAL";
severity2["UNKNOWN"] = "UNKNOWN";
})(BulkFindingUpdateRequest2.severity || (BulkFindingUpdateRequest2.severity = {}));
((scope2) => {
scope2["FINDING"] = "FINDING";
scope2["SUBPRODUCT"] = "SUBPRODUCT";
scope2["PRODUCT"] = "PRODUCT";
scope2["BUSINESS_UNIT"] = "BUSINESS_UNIT";
})(BulkFindingUpdateRequest2.scope || (BulkFindingUpdateRequest2.scope = {}));
((ticketSystemType2) => {
ticketSystemType2["JIRA"] = "JIRA";
ticketSystemType2["AZURE_BOARD"] = "AZURE_BOARD";
ticketSystemType2["SERVICE_NOW"] = "SERVICE_NOW";
ticketSystemType2["FRESHSERVICE"] = "FRESHSERVICE";
ticketSystemType2["GITHUB_ISSUES"] = "GITHUB_ISSUES";
ticketSystemType2["PAGERDUTY"] = "PAGERDUTY";
ticketSystemType2["SHORTCUT"] = "SHORTCUT";
ticketSystemType2["GITLAB_ISSUES"] = "GITLAB_ISSUES";
})(BulkFindingUpdateRequest2.ticketSystemType || (BulkFindingUpdateRequest2.ticketSystemType = {}));
})(BulkFindingUpdateRequest || (BulkFindingUpdateRequest = {}));
var BusinessUnitTeamResponseDto;
((BusinessUnitTeamResponseDto2) => {
((level2) => {
level2["TENANT"] = "TENANT";
level2["BUSINESS_UNIT"] = "BUSINESS_UNIT";
})(BusinessUnitTeamResponseDto2.level || (BusinessUnitTeamResponseDto2.level = {}));
})(BusinessUnitTeamResponseDto || (BusinessUnitTeamResponseDto = {}));
var CoreConfigurationJpaDto;
((CoreConfigurationJpaDto2) => {
((operationalStatus2) => {
operationalStatus2["ACTIVE"] = "ACTIVE";
operationalStatus2["INACTIVE"] = "INACTIVE";
operationalStatus2["PARTIAL"] = "PARTIAL";
operationalStatus2["CONFIG_ERROR"] = "CONFIG_ERROR";
operationalStatus2["NOT_CONFIGURED"] = "NOT_CONFIGURED";
})(CoreConfigurationJpaDto2.operationalStatus || (CoreConfigurationJpaDto2.operationalStatus = {}));
((scanStatus2) => {
scanStatus2["PASSED"] = "PASSED";
scanStatus2["RUNNING"] = "RUNNING";
scanStatus2["FAILED"] = "FAILED";
})(CoreConfigurationJpaDto2.scanStatus || (CoreConfigurationJpaDto2.scanStatus = {}));
((toolType2) => {
toolType2["PULL"] = "PULL";
toolType2["PUSH"] = "PUSH";
toolType2["SCAN_UPLOAD"] = "SCAN_UPLOAD";
toolType2["WEBHOOK"] = "WEBHOOK";
})(CoreConfigurationJpaDto2.toolType || (CoreConfigurationJpaDto2.toolType = {}));
((lastToolScanStatus2) => {
lastToolScanStatus2["PASSED"] = "PASSED";
lastToolScanStatus2["RUNNING"] = "RUNNING";
lastToolScanStatus2["FAILED"] = "FAILED";
})(CoreConfigurationJpaDto2.lastToolScanStatus || (CoreConfigurationJpaDto2.lastToolScanStatus = {}));
((lastExecutionStatus2) => {
lastExecutionStatus2["UPLOADED"] = "UPLOADED";
lastExecutionStatus2["FAILED"] = "FAILED";
lastExecutionStatus2["NO_NEW_REPORTS"] = "NO_NEW_REPORTS";
lastExecutionStatus2["REPORT_GENERATION_IN_PROGRESS"] = "REPORT_GENERATION_IN_PROGRESS";
})(CoreConfigurationJpaDto2.lastExecutionStatus || (CoreConfigurationJpaDto2.lastExecutionStatus = {}));
})(CoreConfigurationJpaDto || (CoreConfigurationJpaDto = {}));
var CoreExecutionLogJpaDto;
((CoreExecutionLogJpaDto2) => {
((status2) => {
status2["UPLOADED"] = "UPLOADED";
status2["FAILED"] = "FAILED";
status2["NO_NEW_REPORTS"] = "NO_NEW_REPORTS";
status2["REPORT_GENERATION_IN_PROGRESS"] = "REPORT_GENERATION_IN_PROGRESS";
})(CoreExecutionLogJpaDto2.status || (CoreExecutionLogJpaDto2.status = {}));
})(CoreExecutionLogJpaDto || (CoreExecutionLogJpaDto = {}));
var DescribeAlertResponse;
((DescribeAlertResponse2) => {
((severity2) => {
severity2["CRITICAL"] = "CRITICAL";
severity2["HIGH"] = "HIGH";
severity2["MEDIUM"] = "MEDIUM";
severity2["LOW"] = "LOW";
severity2["INFO"] = "INFO";
})(DescribeAlertResponse2.severity || (DescribeAlertResponse2.severity = {}));
((status2) => {
status2["OPEN"] = "OPEN";
status2["PROGRESS"] = "PROGRESS";
status2["CLOSED"] = "CLOSED";
})(DescribeAlertResponse2.status || (DescribeAlertResponse2.status = {}));
})(DescribeAlertResponse || (DescribeAlertResponse = {}));
var DescribeFindingResponse;
((DescribeFindingResponse2) => {
((severity2) => {
severity2["INFO"] = "INFO";
severity2["LOW"] = "LOW";
severity2["MEDIUM"] = "MEDIUM";
severity2["HIGH"] = "HIGH";
severity2["CRITICAL"] = "CRITICAL";
severity2["UNKNOWN"] = "UNKNOWN";
})(DescribeFindingResponse2.severity || (DescribeFindingResponse2.severity = {}));
((analysisType2) => {
analysisType2["STATIC"] = "STATIC";
analysisType2["DYNAMIC"] = "DYNAMIC";
})(DescribeFindingResponse2.analysisType || (DescribeFindingResponse2.analysisType = {}));
((toolSeverity2) => {
toolSeverity2["INFO"] = "INFO";
toolSeverity2["LOW"] = "LOW";
toolSeverity2["MEDIUM"] = "MEDIUM";
toolSeverity2["HIGH"] = "HIGH";
toolSeverity2["CRITICAL"] = "CRITICAL";
toolSeverity2["UNKNOWN"] = "UNKNOWN";
})(DescribeFindingResponse2.toolSeverity || (DescribeFindingResponse2.toolSeverity = {}));
})(DescribeFindingResponse || (DescribeFindingResponse = {}));
var DescribeToolConfigurationResponse;
((DescribeToolConfigurationResponse2) => {
((operationalStatus2) => {
operationalStatus2["ACTIVE"] = "ACTIVE";
operationalStatus2["INACTIVE"] = "INACTIVE";
operationalStatus2["PARTIAL"] = "PARTIAL";
operationalStatus2["CONFIG_ERROR"] = "CONFIG_ERROR";
operationalStatus2["NOT_CONFIGURED"] = "NOT_CONFIGURED";
})(DescribeToolConfigurationResponse2.operationalStatus || (DescribeToolConfigurationResponse2.operationalStatus = {}));
})(DescribeToolConfigurationResponse || (DescribeToolConfigurationResponse = {}));
var FindingSummary;
((FindingSummary2) => {
((severity2) => {
severity2["INFO"] = "INFO";
severity2["LOW"] = "LOW";
severity2["MEDIUM"] = "MEDIUM";
severity2["HIGH"] = "HIGH";
severity2["CRITICAL"] = "CRITICAL";
severity2["UNKNOWN"] = "UNKNOWN";
})(FindingSummary2.severity || (FindingSummary2.severity = {}));
((toolSeverity2) => {
toolSeverity2["INFO"] = "INFO";
toolSeverity2["LOW"] = "LOW";
toolSeverity2["MEDIUM"] = "MEDIUM";
toolSeverity2["HIGH"] = "HIGH";
toolSeverity2["CRITICAL"] = "CRITICAL";
toolSeverity2["UNKNOWN"] = "UNKNOWN";
})(FindingSummary2.toolSeverity || (FindingSummary2.toolSeverity = {}));
((analysisType2) => {
analysisType2["STATIC"] = "STATIC";
analysisType2["DYNAMIC"] = "DYNAMIC";
})(FindingSummary2.analysisType || (FindingSummary2.analysisType = {}));
})(FindingSummary || (FindingSummary = {}));
var FindingUpdateRequest;
((FindingUpdateRequest2) => {
((status2) => {
status2["OPEN"] = "OPEN";
status2["CONFIRMED"] = "CONFIRMED";
status2["ACCEPTRISK"] = "ACCEPTRISK";
status2["FALSEPOSITIVE"] = "FALSEPOSITIVE";
status2["MITIGATED"] = "MITIGATED";
})(FindingUpdateRequest2.status || (FindingUpdateRequest2.status = {}));
((severity2) => {
severity2["INFO"] = "INFO";
severity2["LOW"] = "LOW";
severity2["MEDIUM"] = "MEDIUM";
severity2["HIGH"] = "HIGH";
severity2["CRITICAL"] = "CRITICAL";
severity2["UNKNOWN"] = "UNKNOWN";
})(FindingUpdateRequest2.severity || (FindingUpdateRequest2.severity = {}));
((scope2) => {
scope2["FINDING"] = "FINDING";
scope2["SUBPRODUCT"] = "SUBPRODUCT";
scope2["PRODUCT"] = "PRODUCT";
scope2["BUSINESS_UNIT"] = "BUSINESS_UNIT";
})(FindingUpdateRequest2.scope || (FindingUpdateRequest2.scope = {}));
((ticketSystemType2) => {
ticketSystemType2["JIRA"] = "JIRA";
ticketSystemType2["AZURE_BOARD"] = "AZURE_BOARD";
ticketSystemType2["SERVICE_NOW"] = "SERVICE_NOW";
ticketSystemType2["FRESHSERVICE"] = "FRESHSERVICE";
ticketSystemType2["GITHUB_ISSUES"] = "GITHUB_ISSUES";
ticketSystemType2["PAGERDUTY"] = "PAGERDUTY";
ticketSystemType2["SHORTCUT"] = "SHORTCUT";
ticketSystemType2["GITLAB_ISSUES"] = "GITLAB_ISSUES";
})(FindingUpdateRequest2.ticketSystemType || (FindingUpdateRequest2.ticketSystemType = {}));
})(FindingUpdateRequest || (FindingUpdateRequest = {}));
var JiraConfigurationDto;
((JiraConfigurationDto2) => {
((ticketSystemType2) => {
ticketSystemType2["JIRA"] = "JIRA";
ticketSystemType2["AZURE_BOARD"] = "AZURE_BOARD";
ticketSystemType2["SERVICE_NOW"] = "SERVICE_NOW";
ticketSystemType2["FRESHSERVICE"] = "FRESHSERVICE";
ticketSystemType2["GITHUB_ISSUES"] = "GITHUB_ISSUES";
ticketSystemType2["PAGERDUTY"] = "PAGERDUTY";
ticketSystemType2["SHORTCUT"] = "SHORTCUT";
ticketSystemType2["GITLAB_ISSUES"] = "GITLAB_ISSUES";
})(JiraConfigurationDto2.ticketSystemType || (JiraConfigurationDto2.ticketSystemType = {}));
((operationalStatus2) => {
operationalStatus2["ACTIVE"] = "ACTIVE";
operationalStatus2["INACTIVE"] = "INACTIVE";
operationalStatus2["PARTIAL"] = "PARTIAL";
operationalStatus2["CONFIG_ERROR"] = "CONFIG_ERROR";
operationalStatus2["NOT_CONFIGURED"] = "NOT_CONFIGURED";
})(JiraConfigurationDto2.operationalStatus || (JiraConfigurationDto2.operationalStatus = {}));
})(JiraConfigurationDto || (JiraConfigurationDto = {}));
var ListProductRequest;
((ListProductRequest2) => {
((environmentName2) => {
environmentName2["PRODUCTION"] = "PRODUCTION";
environmentName2["STAGING"] = "STAGING";
})(ListProductRequest2.environmentName || (ListProductRequest2.environmentName = {}));
})(ListProductRequest || (ListProductRequest = {}));
var ListToolConfigRequest;
((ListToolConfigRequest2) => {
((toolType2) => {
toolType2["PULL"] = "PULL";
toolType2["PUSH"] = "PUSH";
toolType2["SCAN_UPLOAD"] = "SCAN_UPLOAD";
toolType2["WEBHOOK"] = "WEBHOOK";
})(ListToolConfigRequest2.toolType || (ListToolConfigRequest2.toolType = {}));
})(ListToolConfigRequest || (ListToolConfigRequest = {}));
var ProductJpaDto;
((ProductJpaDto2) => {
((confidentialityRequirement2) => {
confidentialityRequirement2["LOW"] = "Low";
confidentialityRequirement2["MEDIUM"] = "Medium";
confidentialityRequirement2["HIGH"] = "High";
confidentialityRequirement2["NOT_DEFINED"] = "Not Defined";
})(ProductJpaDto2.confidentialityRequirement || (ProductJpaDto2.confidentialityRequirement = {}));
((confidentiality2) => {
confidentiality2["ALL"] = "All";
confidentiality2["ONE"] = "One";
confidentiality2["TWO"] = "Two";
confidentiality2["NONE"] = "None";
})(ProductJpaDto2.confidentiality || (ProductJpaDto2.confidentiality = {}));
((availabilityRequirement2) => {
availabilityRequirement2["LOW"] = "Low";
availabilityRequirement2["MEDIUM"] = "Medium";
availabilityRequirement2["HIGH"] = "High";
availabilityRequirement2["NOT_DEFINED"] = "Not Defined";
})(ProductJpaDto2.availabilityRequirement || (ProductJpaDto2.availabilityRequirement = {}));
((availability2) => {
availability2["NONE"] = "None";
availability2["LOW"] = "Low";
availability2["HIGH"] = "High";
availability2["NOT_DEFINED"] = "Not Defined";
})(ProductJpaDto2.availability || (ProductJpaDto2.availability = {}));
((attackingVector2) => {
attackingVector2["NETWORK"] = "Network";
attackingVector2["LOCAL"] = "Local";
})(ProductJpaDto2.attackingVector || (ProductJpaDto2.attackingVector = {}));
})(ProductJpaDto || (ProductJpaDto = {}));
var ProductReqDto;
((ProductReqDto2) => {
((confidentialityRequirement2) => {
confidentialityRequirement2["LOW"] = "Low";
confidentialityRequirement2["MEDIUM"] = "Medium";
confidentialityRequirement2["HIGH"] = "High";
confidentialityRequirement2["NOT_DEFINED"] = "Not Defined";
})(ProductReqDto2.confidentialityRequirement || (ProductReqDto2.confidentialityRequirement = {}));
((confidentiality2) => {
confidentiality2["ALL"] = "All";
confidentiality2["ONE"] = "One";
confidentiality2["TWO"] = "Two";
confidentiality2["NONE"] = "None";
})(ProductReqDto2.confidentiality || (ProductReqDto2.confidentiality = {}));
((availabilityRequirement2) => {
availabilityRequirement2["LOW"] = "Low";
availabilityRequirement2["MEDIUM"] = "Medium";
availabilityRequirement2["HIGH"] = "High";
availabilityRequirement2["NOT_DEFINED"] = "Not Defined";
})(ProductReqDto2.availabilityRequirement || (ProductReqDto2.availabilityRequirement = {}));
((availability2) => {
availability2["NONE"] = "None";
availability2["LOW"] = "Low";
availability2["HIGH"] = "High";
availability2["NOT_DEFINED"] = "Not Defined";
})(ProductReqDto2.availability || (ProductReqDto2.availability = {}));
((attackingVector2) => {
attackingVector2["NETWORK"] = "Network";
attackingVector2["LOCAL"] = "Local";
})(ProductReqDto2.attackingVector || (ProductReqDto2.attackingVector = {}));
})(ProductReqDto || (ProductReqDto = {}));
var ProductResponseDto;
((ProductResponseDto2) => {
((confidentialityRequirement2) => {
confidentialityRequirement2["LOW"] = "Low";
confidentialityRequirement2["MEDIUM"] = "Medium";
confidentialityRequirement2["HIGH"] = "High";
confidentialityRequirement2["NOT_DEFINED"] = "Not Defined";
})(ProductResponseDto2.confidentialityRequirement || (ProductResponseDto2.confidentialityRequirement = {}));
((confidentiality2) => {
confidentiality2["ALL"] = "All";
confidentiality2["ONE"] = "One";
confidentiality2["TWO"] = "Two";
confidentiality2["NONE"] = "None";
})(ProductResponseDto2.confidentiality || (ProductResponseDto2.confidentiality = {}));
((availabilityRequirement2) => {
availabilityRequirement2["LOW"] = "Low";
availabilityRequirement2["MEDIUM"] = "Medium";
availabilityRequirement2["HIGH"] = "High";
availabilityRequirement2["NOT_DEFINED"] = "Not Defined";
})(ProductResponseDto2.availabilityRequirement || (ProductResponseDto2.availabilityRequirement = {}));
((availability2) => {
availability2["NONE"] = "None";
availability2["LOW"] = "Low";
availability2["HIGH"] = "High";
availability2["NOT_DEFINED"] = "Not Defined";
})(ProductResponseDto2.availability || (ProductResponseDto2.availability = {}));
((attackingVector2) => {
attackingVector2["NETWORK"] = "Network";
attackingVector2["LOCAL"] = "Local";
})(ProductResponseDto2.attackingVector || (ProductResponseDto2.attackingVector = {}));
})(ProductResponseDto || (ProductResponseDto = {}));
var ProductUpdateReqDto;
((ProductUpdateReqDto2) => {
((confidentialityRequirement2) => {
confidentialityRequirement2["LOW"] = "Low";
confidentialityRequirement2["MEDIUM"] = "Medium";
confidentialityRequirement2["HIGH"] = "High";
confidentialityRequirement2["NOT_DEFINED"] = "Not Defined";
})(ProductUpdateReqDto2.confidentialityRequirement || (ProductUpdateReqDto2.confidentialityRequirement = {}));
((confidentiality2) => {
confidentiality2["ALL"] = "All";
confidentiality2["ONE"] = "One";
confidentiality2["TWO"] = "Two";
confidentiality2["NONE"] = "None";
})(ProductUpdateReqDto2.confidentiality || (ProductUpdateReqDto2.confidentiality = {}));
((availabilityRequirement2) => {
availabilityRequirement2["LOW"] = "Low";
availabilityRequirement2["MEDIUM"] = "Medium";
availabilityRequirement2["HIGH"] = "High";
availabilityRequirement2["NOT_DEFINED"] = "Not Defined";
})(ProductUpdateReqDto2.availabilityRequirement || (ProductUpdateReqDto2.availabilityRequirement = {}));
((availability2) => {
availability2["NONE"] = "None";
availability2["LOW"] = "Low";
availability2["HIGH"] = "High";
availability2["NOT_DEFINED"] = "Not Defined";
})(ProductUpdateReqDto2.availability || (ProductUpdateReqDto2.availability = {}));
((attackingVector2) => {
attackingVector2["NETWORK"] = "Network";
attackingVector2["LOCAL"] = "Local";
})(ProductUpdateReqDto2.attackingVector || (ProductUpdateReqDto2.attackingVector = {}));
})(ProductUpdateReqDto || (ProductUpdateReqDto = {}));
var ProposeFindingActionData;
((ProposeFindingActionData2) => {
((action2) => {
action2["PROPOSE_ACTION"] = "PROPOSE_ACTION";
action2["PROPOSE_BASIC_CHANGE"] = "PROPOSE_BASIC_CHANGE";
action2["PROPOSE_ASSIGNEE"] = "PROPOSE_ASSIGNEE";
action2["PROPOSE_DUE_DATE"] = "PROPOSE_DUE_DATE";
action2["PROPOSE_CATEGORY"] = "PROPOSE_CATEGORY";
action2["PROPOSE_SEVERITY"] = "PROPOSE_SEVERITY";
})(ProposeFindingActionData2.action || (ProposeFindingActionData2.action = {}));
})(ProposeFindingActionData || (ProposeFindingActionData = {}));
var S3UploadFileRequest;
((S3UploadFileRequest2) => {
((scanTool2) => {
scanTool2["JFROG_XRAY"] = "JFROG_XRAY";
scanTool2["SONARQUBE"] = "SONARQUBE";
scanTool2["ZAP"] = "ZAP";
scanTool2["BANDIT"] = "BANDIT";
scanTool2["BURPSUITE"] = "BURPSUITE";
scanTool2["DEPENDENCY_CHECK"] = "DEPENDENCY_CHECK";
scanTool2["ESLINT"] = "ESLINT";
scanTool2["BLACKDUCK_HUB"] = "BLACKDUCK_HUB";
scanTool2["GOSEC_SCANNER"] = "GOSEC_SCANNER";
scanTool2["QUALYS"] = "QUALYS";
scanTool2["QUALYS_WEBAPP"] = "QUALYS_WEBAPP";
scanTool2["QUALYS_INFRASTRUCTURE"] = "QUALYS_INFRASTRUCTURE";
scanTool2["ACUNETIX"] = "ACUNETIX";
scanTool2["APPSPIDER"] = "APPSPIDER";
scanTool2["AQUA"] = "AQUA";
scanTool2["AWS_PROWLER"] = "AWS_PROWLER";
scanTool2["AWS_SECURITY_HUB"] = "AWS_SECURITY_HUB";
scanTool2["BRAKEMAN"] = "BRAKEMAN";
scanTool2["BUGCROWD"] = "BUGCROWD";
scanTool2["CLAIR"] = "CLAIR";
scanTool2["COBALT"] = "COBALT";
scanTool2["CONTRAST_SECURITY"] = "CONTRAST_SECURITY";
scanTool2["GITLEAKS"] = "GITLEAKS";
scanTool2["MOZILLA_OBSERVATORY"] = "MOZILLA_OBSERVATORY";
scanTool2["NESSUS"] = "NESSUS";
scanTool2["NETSPARKER"] = "NETSPARKER";
scanTool2["NIKTO"] = "NIKTO";
scanTool2["NMAP"] = "NMAP";
scanTool2["OPENVAS_CSV"] = "OPENVAS_CSV";
scanTool2["TRUSTWAVE"] = "TRUSTWAVE";
scanTool2["WHITESOURCE"] = "WHITESOURCE";
scanTool2["WEBINSPECT"] = "WEBINSPECT";
scanTool2["VERACODE"] = "VERACODE";
scanTool2["APPSCAN"] = "APPSCAN";
scanTool2["HACKERONE"] = "HACKERONE";
scanTool2["NOW_SECURE"] = "NOW_SECURE";
scanTool2["CHECKMARX"] = "CHECKMARX";
scanTool2["FORTIFY"] = "FORTIFY";
scanTool2["COVERITY"] = "COVERITY";
scanTool2["SNYK"] = "SNYK";
scanTool2["SHIFTLEFT"] = "SHIFTLEFT";
scanTool2["PRISMA_CLOUD_TWISTLOCK"] = "PRISMA_CLOUD_TWISTLOCK";
scanTool2["METASPLOIT"] = "METASPLOIT";
scanTool2["DEPENDENCY_TRACK"] = "DEPENDENCY_TRACK";
scanTool2["CYCLONE_DX"] = "CYCLONE_DX";
scanTool2["RAPID7_NEXPOSE"] = "RAPID7_NEXPOSE";
scanTool2["DETECT_SECRETS"] = "DETECT_SECRETS";
scanTool2["DEPENDABOT"] = "DEPENDABOT";
scanTool2["GITHUB_CODE_SCAN"] = "GITHUB_CODE_SCAN";
scanTool2["SONARCLOUD"] = "SONARCLOUD";
scanTool2["PRISMA_CLOUD_REDLOCK"] = "PRISMA_CLOUD_REDLOCK";
scanTool2["GOOGLE_CLOUD_REGISTRY"] = "GOOGLE_CLOUD_REGISTRY";
scanTool2["LACEWORK"] = "LACEWORK";
scanTool2["AVOCADO"] = "AVOCADO";
scanTool2["FINITESTATE"] = "FINITESTATE";
})(S3UploadFileRequest2.scanTool || (S3UploadFileRequest2.scanTool = {}));
((triggerby2) => {
triggerby2["PUSH_UPLOAD"] = "PUSH_UPLOAD";
triggerby2["MANUAL_TRIGGER"] = "MANUAL_TRIGGER";
triggerby2["SCHEDULED"] = "SCHEDULED";
triggerby2["UI_UPLOAD"] = "UI_UPLOAD";
triggerby2["WEBHOOK"] = "WEBHOOK";
})(S3UploadFileRequest2.triggerby || (S3UploadFileRequest2.triggerby = {}));
((toolType2) => {
toolType2["PULL"] = "PULL";
toolType2["PUSH"] = "PUSH";
toolType2["SCAN_UPLOAD"] = "SCAN_UPLOAD";
toolType2["WEBHOOK"] = "WEBHOOK";
})(S3UploadFileRequest2.toolType || (S3UploadFileRequest2.toolType = {}));
})(S3UploadFileRequest || (S3UploadFileRequest = {}));
var S3UploadUrlRequest;
((S3UploadUrlRequest2) => {
((triggerby2) => {
triggerby2["PUSH_UPLOAD"] = "PUSH_UPLOAD";
triggerby2["MANUAL_TRIGGER"] = "MANUAL_TRIGGER";
triggerby2["SCHEDULED"] = "SCHEDULED";
triggerby2["UI_UPLOAD"] = "UI_UPLOAD";
triggerby2["WEBHOOK"] = "WEBHOOK";
})(S3UploadUrlRequest2.triggerby || (S3UploadUrlRequest2.triggerby = {}));
((toolType2) => {
toolType2["PULL"] = "PULL";
toolType2["PUSH"] = "PUSH";
toolType2["SCAN_UPLOAD"] = "SCAN_UPLOAD";
toolType2["WEBHOOK"] = "WEBHOOK";
})(S3UploadUrlRequest2.toolType || (S3UploadUrlRequest2.toolType = {}));
})(S3UploadUrlRequest || (S3UploadUrlRequest = {}));
var ScanReportJpaDto;
((ScanReportJpaDto2) => {
((status2) => {
status2["INITIATED"] = "INITIATED";
status2["COMPLETED"] = "COMPLETED";
status2["PROCESSING"] = "PROCESSING";
status2["IMPORTING"] = "IMPORTING";
status2["FAILED"] = "FAILED";
})(ScanReportJpaDto2.status || (ScanReportJpaDto2.status = {}));
((triggerby2) => {
triggerby2["PUSH_UPLOAD"] = "PUSH_UPLOAD";
triggerby2["MANUAL_TRIGGER"] = "MANUAL_TRIGGER";
triggerby2["SCHEDULED"] = "SCHEDULED";
triggerby2["UI_UPLOAD"] = "UI_UPLOAD";
triggerby2["WEBHOOK"] = "WEBHOOK";
})(ScanReportJpaDto2.triggerby || (ScanReportJpaDto2.triggerby = {}));
})(ScanReportJpaDto || (ScanReportJpaDto = {}));
var SlackMappingJpaDto;
((SlackMappingJpaDto2) => {
((type2) => {
type2["RUNBOOK"] = "RUNBOOK";
type2["TEAM"] = "TEAM";
type2["SAVED_SEARCH"] = "SAVED_SEARCH";
type2["OTHERS"] = "OTHERS";
})(SlackMappingJpaDto2.type || (SlackMappingJpaDto2.type = {}));
})(SlackMappingJpaDto || (SlackMappingJpaDto = {}));
var SlackMappingResponseDto;
((SlackMappingResponseDto2) => {
((type2) => {
type2["RUNBOOK"] = "RUNBOOK";
type2["TEAM"] = "TEAM";
type2["SAVED_SEARCH"] = "SAVED_SEARCH";
type2["OTHERS"] = "OTHERS";
})(SlackMappingResponseDto2.type || (SlackMappingResponseDto2.type = {}));
})(SlackMappingResponseDto || (SlackMappingResponseDto = {}));
var SubProductEsDto;
((SubProductEsDto2) => {
((risk2) => {
risk2["INFO"] = "INFO";
risk2["LOW"] = "LOW";
risk2["MEDIUM"] = "MEDIUM";
risk2["HIGH"] = "HIGH";
risk2["CRITICAL"] = "CRITICAL";
risk2["UNKNOWN"] = "UNKNOWN";
})(SubProductEsDto2.risk || (SubProductEsDto2.risk = {}));
((confidentialityRequirement2) => {
confidentialityRequirement2["LOW"] = "Low";
confidentialityRequirement2["MEDIUM"] = "Medium";
confidentialityRequirement2["HIGH"] = "High";
confidentialityRequirement2["NOT_DEFINED"] = "Not Defined";
})(SubProductEsDto2.confidentialityRequirement || (SubProductEsDto2.confidentialityRequirement = {}));
((confidentiality2) => {
confidentiality2["ALL"] = "All";
confidentiality2["ONE"] = "One";
confidentiality2["TWO"] = "Two";
confidentiality2["NONE"] = "None";
})(SubProductEsDto2.confidentiality || (SubProductEsDto2.confidentiality = {}));
((availabilityRequirement2) => {
availabilityRequirement2["LOW"] = "Low";
availabilityRequirement2["MEDIUM"] = "Medium";
availabilityRequirement2["HIGH"] = "High";
availabilityRequirement2["NOT_DEFINED"] = "Not Defined";
})(SubProductEsDto2.availabilityRequirement || (SubProductEsDto2.availabilityRequirement = {}));
((availability2) => {
availability2["NONE"] = "None";
availability2["LOW"] = "Low";
availability2["HIGH"] = "High";
availability2["NOT_DEFINED"] = "Not Defined";
})(SubProductEsDto2.availability || (SubProductEsDto2.availability = {}));
((attackingVector2) => {
attackingVector2["NETWORK"] = "Network";
attackingVector2["LOCAL"] = "Local";
})(SubProductEsDto2.attackingVector || (SubProductEsDto2.attackingVector = {}));
})(SubProductEsDto || (SubProductEsDto = {}));
var SubProductJpaDto;
((SubProductJpaDto2) => {
((repoType2) => {
repoType2["GITHUB"] = "GITHUB";
repoType2["GITLAB"] = "GITLAB";
repoType2["BITBUCKET"] = "BITBUCKET";
repoType2["SVN"] = "SVN";
repoType2["AZURE_REPOS"] = "AZURE_REPOS";
repoType2["OTHER"] = "other";
})(SubProductJpaDto2.repoType || (SubProductJpaDto2.repoType = {}));
((confidentialityRequirement2) => {
confidentialityRequirement2["LOW"] = "Low";
confidentialityRequirement2["MEDIUM"] = "Medium";
confidentialityRequirement2["HIGH"] = "High";
confidentialityRequirement2["NOT_DEFINED"] = "Not Defined";
})(SubProductJpaDto2.confidentialityRequirement || (SubProductJpaDto2.confidentialityRequirement = {}));
((confidentiality2) => {
confidentiality2["ALL"] = "All";
confidentiality2["ONE"] = "One";
confidentiality2["TWO"] = "Two";
confidentiality2["NONE"] = "None";
})(SubProductJpaDto2.confidentiality || (SubProductJpaDto2.confidentiality = {}));
((availabilityRequirement2) => {
availabilityRequirement2["LOW"] = "Low";
availabilityRequirement2["MEDIUM"] = "Medium";
availabilityRequirement2["HIGH"] = "High";
availabilityRequirement2["NOT_DEFINED"] = "Not Defined";
})(SubProductJpaDto2.availabilityRequirement || (SubProductJpaDto2.availabilityRequirement = {}));
((availability2) => {
availability2["NONE"] = "None";
availability2["LOW"] = "Low";
availability2["HIGH"] = "High";
availability2["NOT_DEFINED"] = "Not Defined";
})(SubProductJpaDto2.availability || (SubProductJpaDto2.availability = {}));
((attackingVector2) => {
attackingVector2["NETWORK"] = "Network";
attackingVector2["LOCAL"] = "Local";
})(SubProductJpaDto2.attackingVector || (SubProductJpaDto2.attackingVector = {}));
})(SubProductJpaDto || (SubProductJpaDto = {}));
var SubProductReqDto;
((SubProductReqDto2) => {
((repoType2) => {
repoType2["GITHUB"] = "GITHUB";
repoType2["GITLAB"] = "GITLAB";
repoType2["BITBUCKET"] = "BITBUCKET";
repoType2["SVN"] = "SVN";
repoType2["AZURE_REPOS"] = "AZURE_REPOS";
repoType2["OTHER"] = "other";
})(SubProductReqDto2.repoType || (SubProductReqDto2.repoType = {}));
((confidentialityRequirement2) => {
confidentialityRequirement2["LOW"] = "Low";
confidentialityRequirement2["MEDIUM"] = "Medium";
confidentialityRequirement2["HIGH"] = "High";
confidentialityRequirement2["NOT_DEFINED"] = "Not Defined";
})(SubProductReqDto2.confidentialityRequirement || (SubProductReqDto2.confidentialityRequirement = {}));
((confidentiality2) => {
confidentiality2["ALL"] = "All";
confidentiality2["ONE"] = "One";
confidentiality2["TWO"] = "Two";
confidentiality2["NONE"] = "None";
})(SubProductReqDto2.confidentiality || (SubProductReqDto2.confidentiality = {}));
((availabilityRequirement2) => {
availabilityRequirement2["LOW"] = "Low";
availabilityRequirement2["MEDIUM"] = "Medium";
availabilityRequirement2["HIGH"] = "High";
availabilityRequirement2["NOT_DEFINED"] = "Not Defined";
})(SubProductReqDto2.availabilityRequirement || (SubProductReqDto2.availabilityRequirement = {}));
((availability2) => {
availability2["NONE"] = "None";
availability2["LOW"] = "Low";
availability2["HIGH"] = "High";
availability2["NOT_DEFINED"] = "Not Defined";
})(SubProductReqDto2.availability || (SubProductReqDto2.availability = {}));
((attackingVector2) => {
attackingVector2["NETWORK"] = "Network";
attackingVector2["LOCAL"] = "Local";
})(SubProductReqDto2.attackingVector || (SubProductReqDto2.attackingVector = {}));
})(SubProductReqDto || (SubProductReqDto = {}));
var SubProductResponseDto;
((SubProductResponseDto2) => {
((repoType2) => {
repoType2["GITHUB"] = "GITHUB";
repoType2["GITLAB"] = "GITLAB";
repoType2["BITBUCKET"] = "BITBUCKET";
repoType2["SVN"] = "SVN";
repoType2["AZURE_REPOS"] = "AZURE_REPOS";
repoType2["OTHER"] = "other";
})(SubProductResponseDto2.repoType || (SubProductResponseDto2.repoType = {}));
((confidentialityRequirement2) => {
confidentialityRequirement2["LOW"] = "Low";
confidentialityRequirement2["MEDIUM"] = "Medium";
confidentialityRequirement2["HIGH"] = "High";
confidentialityRequirement2["NOT_DEFINED"] = "Not Defined";
})(SubProductResponseDto2.confidentialityRequirement || (SubProductResponseDto2.confidentialityRequirement = {}));
((confidentiality2) => {
confidentiality2["ALL"] = "All";
confidentiality2["ONE"] = "One";
confidentiality2["TWO"] = "Two";
confidentiality2["NONE"] = "None";
})(SubProductResponseDto2.confidentiality || (SubProductResponseDto2.confidentiality = {}));
((availabilityRequirement2) => {
availabilityRequirement2["LOW"] = "Low";
availabilityRequirement2["MEDIUM"] = "Medium";
availabilityRequirement2["HIGH"] = "High";
availabilityRequirement2["NOT_DEFINED"] = "Not Defined";
})(SubProductResponseDto2.availabilityRequirement || (SubProductResponseDto2.availabilityRequirement = {}));
((availability2) => {
availability2["NONE"] = "None";
availability2["LOW"] = "Low";
availability2["HIGH"] = "High";
availability2["NOT_DEFINED"] = "Not Defined";
})(SubProductResponseDto2.availability || (SubProductResponseDto2.availability = {}));
((attackingVector2) => {
attackingVector2["NETWORK"] = "Network";
attackingVector2["LOCAL"] = "Local";
})(SubProductResponseDto2.attackingVector || (SubProductResponseDto2.attackingVector = {}));
})(SubProductResponseDto || (SubProductResponseDto = {}));
var SubProductUpdateReqDto;
((SubProductUpdateReqDto2) => {
((repoType2) => {
repoType2["GITHUB"] = "GITHUB";
repoType2["GITLAB"] = "GITLAB";
repoType2["BITBUCKET"] = "BITBUCKET";
repoType2["SVN"] = "SVN";
repoType2["AZURE_REPOS"] = "AZURE_REPOS";
repoType2["OTHER"] = "other";
})(SubProductUpdateReqDto2.repoType || (SubProductUpdateReqDto2.repoType = {}));
((confidentialityRequirement2) => {
confidentialityRequirement2["LOW"] = "Low";
confidentialityRequirement2["MEDIUM"] = "Medium";
confidentialityRequirement2["HIGH"] = "High";
confidentialityRequirement2["NOT_DEFINED"] = "Not Defined";
})(SubProductUpdateReqDto2.confidentialityRequirement || (SubProductUpdateReqDto2.confidentialityRequirement = {}));
((confidentiality2) => {
confidentiality2["ALL"] = "All";
confidentiality2["ONE"] = "One";
confidentiality2["TWO"] = "Two";
confidentiality2["NONE"] = "None";
})(SubProductUpdateReqDto2.confidentiality || (SubProductUpdateReqDto2.confidentiality = {}));
((availabilityRequirement2) => {
availabilityRequirement2["LOW"] = "Low";
availabilityRequirement2["MEDIUM"] = "Medium";
availabilityRequirement2["HIGH"] = "High";
availabilityRequirement2["NOT_DEFINED"] = "Not Defined";
})(SubProductUpdateReqDto2.availabilityRequirement || (SubProductUpdateReqDto2.availabilityRequirement = {}));
((availability2) => {
availability2["NONE"] = "None";
availability2["LOW"] = "Low";
availability2["HIGH"] = "High";
availability2["NOT_DEFINED"] = "Not Defined";
})(SubProductUpdateReqDto2.availability || (SubProductUpdateReqDto2.availability = {}));
((attackingVector2) => {
attackingVector2["NETWORK"] = "Network";
attackingVector2["LOCAL"] = "Local";
})(SubProductUpdateReqDto2.attackingVector || (SubProductUpdateReqDto2.attackingVector = {}));
})(SubProductUpdateReqDto || (SubProductUpdateReqDto = {}));
var TeamJpaDto;
((TeamJpaDto2) => {
((level2) => {
level2["TENANT"] = "TENANT";
level2["BUSINESS_UNIT"] = "BUSINESS_UNIT";
})(TeamJpaDto2.level || (TeamJpaDto2.level = {}));
})(TeamJpaDto || (TeamJpaDto = {}));
var TeamResponseDto;
((TeamResponseDto2) => {
((level2) => {
level2["TENANT"] = "TENANT";
level2["BUSINESS_UNIT"] = "BUSINESS_UNIT";
})(TeamResponseDto2.level || (TeamResponseDto2.level = {}));
})(TeamResponseDto || (TeamResponseDto = {}));
var TeamStatsResponse;
((TeamStatsResponse2) => {
((risk2) => {
risk2["INFO"] = "INFO";
risk2["LOW"] = "LOW";
risk2["MEDIUM"] = "MEDIUM";
risk2["HIGH"] = "HIGH";
risk2["CRITICAL"] = "CRITICAL";
risk2["UNKNOWN"] = "UNKNOWN";
})(TeamStatsResponse2.risk || (TeamStatsResponse2.risk = {}));
})(TeamStatsResponse || (TeamStatsResponse = {}));
var ToolProject;
((ToolProject2) => {
((projectStatus2) => {
projectStatus2["ACTIVE"] = "ACTIVE";
projectStatus2["INACTIVE"] = "INACTIVE";
})(ToolProject2.projectStatus || (ToolProject2.projectStatus = {}));
})(ToolProject || (ToolProject = {}));
var UpdateAlertRequest;
((UpdateAlertRequest2) => {
((severity2) => {
severity2["CRITICAL"] = "CRITICAL";
severity2["HIGH"] = "HIGH";
severity2["MEDIUM"] = "MEDIUM";
severity2["LOW"] = "LOW";
severity2["INFO"] = "INFO";
})(UpdateAlertRequest2.severity || (UpdateAlertRequest2.severity = {}));
})(UpdateAlertRequest || (UpdateAlertRequest = {}));
var UpdateFindingTagsBulkRequestDto;
((UpdateFindingTagsBulkRequestDto2) => {
((scope2) => {
scope2["FINDING"] = "FINDING";
scope2["SUBPRODUCT"] = "SUBPRODUCT";
scope2["PRODUCT"] = "PRODUCT";
scope2["BUSINESS_UNIT"] = "BUSINESS_UNIT";
})(UpdateFindingTagsBulkRequestDto2.scope || (UpdateFindingTagsBulkRequestDto2.scope = {}));
((updateType2) => {
updateType2["RULE_BASED"] = "RULE_BASED";
updateType2["TAG_BASED"] = "TAG_BASED";
})(UpdateFindingTagsBulkRequestDto2.updateType || (UpdateFindingTagsBulkRequestDto2.updateType = {}));
})(UpdateFindingTagsBulkRequestDto || (UpdateFindingTagsBulkRequestDto = {}));
var UserOrganisationMappingJpaDto;
((UserOrganisationMappingJpaDto2) => {
((accessLevel2) => {
accessLevel2["TEAM"] = "TEAM";
accessLevel2["TENANT"] = "TENANT";
accessLevel2["BUSINESS_UNIT"] = "BUSINESS_UNIT";
})(UserOrganisationMappingJpaDto2.accessLevel || (UserOrganisationMappingJpaDto2.accessLevel = {}));
})(UserOrganisationMappingJpaDto || (UserOrganisationMappingJpaDto = {}));
var UserResourceMappingJpaDto;
((UserResourceMappingJpaDto2) => {
((accessLevel2) => {
accessLevel2["TEAM"] = "TEAM";
accessLevel2["TENANT"] = "TENANT";
accessLevel2["BUSINESS_UNIT"] = "BUSINESS_UNIT";
})(UserResourceMappingJpaDto2.accessLevel || (UserResourceMappingJpaDto2.accessLevel = {}));
})(UserResourceMappingJpaDto || (UserResourceMappingJpaDto = {}));
const isDefined = (value) => {
return value !== void 0 && value !== null;
};
const isString = (value) => {
return typeof value === "string";
};
const isStringWithValue = (value) => {
return isString(value) && value !== "";
};
const isBlob = (value) => {
return typeof value === "object" && typeof value.type === "string" && typeof value.stream === "function" && typeof value.arrayBuffer === "function" && typeof value.constructor === "function" && typeof value.constructor.name === "string" && /^(Blob|File)$/.test(value.constructor.name) && /^(Blob|File)$/.test(value[Symbol.toStringTag]);
};
const isFormData = (value) => {
return value instanceof FormData;
};
const base64 = (str) => {
try {
return btoa(str);
} catch (err) {
return Buffer.from(str).toString("base64");
}
};
const getQueryString = (params) => {
const qs = [];
const append = (key, value) => {
qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
};
const process = (key, value) => {
if (isDefined(value)) {
if (Array.isArray(value)) {
value.forEach((v) => {
process(key, v);
});
} else if (typeof value === "object") {
Object.entries(value).forEach(([k, v]) => {
process(`${key}[${k}]`, v);
});
} else {
append(key, value);
}
}
};
Object.entries(params).forEach(([key, value]) => {
process(key, value);
});
if (qs.length > 0) {
return `?${qs.join("&")}`;
}
return "";
};
const getUrl = (config, options) => {
const encoder = config.ENCODE_PATH || encodeURI;
const path = options.url.replace("{api-version}", config.VERSION).replace(/{(.*?)}/g, (substring, group) => {
var _a;
if ((_a = options.path) == null ? void 0 : _a.hasOwnProperty(group)) {
return encoder(String(options.path[group]));
}
return substring;
});
const url = `${config.BASE}${path}`;
if (options.query) {
return `${url}${getQueryString(options.query)}`;
}
return url;
};
const getFormData = (options) => {
if (options.formData) {
const formData = new FormData();
const process = (key, value) => {
if (isString(value) || isBlob(value)) {
formData.append(key, value);
} else {
formData.append(key, JSON.stringify(value));
}
};
Object.entries(options.formData).filter(([_, value]) => isDefined(value)).forEach(([key, value]) => {
if (Array.isArray(value)) {
value.forEach((v) => process(key, v));
} else {
process(key, value);
}
});
return formData;
}
return void 0;
};
const resolve = async (options, resolver) => {
if (typeof resolver === "function") {
return resolver(options);
}
return resolver;
};
const getHeaders = async (config, options) => {
const token = await resolve(options, config.TOKEN);
const username = await resolve(options, config.USERNAME);
const password = await resolve(options, config.PASSWORD);
const additionalHeaders = await resolve(options, config.HEADERS);
const headers = Object.entries({
Accept: "application/json",
...additionalHeaders,
...options.headers
}).filter(([_, value]) => isDefined(value)).reduce((headers2, [key, value]) => ({
...headers2,
[key]: String(value)
}), {});
if (isStringWithValue(token)) {
headers["Authorization"] = `Bearer ${token}`;
}
if (isStringWithValue(username) && isStringWithValue(password)) {
const credentials = base64(`${username}:${password}`);
headers["Authorization"] = `Basic ${credentials}`;
}
if (options.body) {
if (options.mediaType) {
headers["Content-Type"] = options.mediaType;
} else if (isBlob(options.body)) {
headers["Content-Type"] = options.body.type || "application/octet-stream";
} else if (isString(options.body)) {
headers["Content-Type"] = "text/plain";
} else if (!isFormData(options.body)) {
headers["Content-Type"] = "application/json";
}
}
return new Headers(headers);
};
const getRequestBody = (options) => {
var _a;
if (options.body) {
if ((_a = options.mediaType) == null ? void 0 : _a.includes("/json")) {
return JSON.stringify(options.body);
} else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) {
return options.body;
} else {
return JSON.stringify(options.body);
}
}
return void 0;
};
const sendRequest = async (config, options, url, body, formData, headers, onCancel) => {
const controller = new AbortController();
const request2 = {
headers,
body: body != null ? body : formData,
method: options.method,
signal: controller.signal
};
if (config.WITH_CREDENTIALS) {
request2.credentials = config.CREDENTIALS;
}
onCancel(() => controller.abort());
return await fetch(url, request2);
};
const getResponseHeader = (response, responseHeader) => {
if (responseHeader) {
const content = response.headers.get(responseHeader);
if (isString(content)) {
return content;
}
}
return void 0;
};
const getResponseBody = async (response) => {
if (response.status !== 204) {
try {
const contentType = response.headers.get("Content-Type");
if (contentType) {
const isJSON = contentType.toLowerCase().startsWith("application/json");
if (isJSON) {
return await response.json();
} else {
return await response.text();
}
}
} catch (error) {
console.error(error);
}
}
return void 0;
};
const catchErrorCodes = (options, result) => {
const errors = {
400: "Bad Request",
401: "Unauthorized",
403: "Forbidden",
404: "Not Found",
500: "Internal Server Error",
502: "Bad Gateway",
503: "Service Unavailable",
...options.errors
};
const error = errors[result.status];
if (error) {
throw new ApiError(options, result, error);
}
if (!result.ok) {
throw new ApiError(options, result, "Generic Error");
}
};
const request = (config, options) => {
return new CancelablePromise(async (resolve2, reject, onCancel) => {
try {
const url = getUrl(config, options);
const formData = getFormData(options);
const body = getRequestBody(options);
const headers = await getHeaders(config, options);
if (!onCancel.isCancelled) {
const response = await sendRequest(config, options, url, body, formData, headers, onCancel);
const responseBody = await getResponseBody(response);
const responseHeader = getResponseHeader(response, options.responseHeader);
const result = {
url,
ok: response.ok,
status: response.status,
statusText: response.statusText,
body: responseHeader != null ? responseHeader : responseBody
};
catchErrorCodes(options, result);
resolve2(result.body);
}
} catch (error) {
reject(error);
}
});
};
class FindingsService {
static describeFinding(findingId) {
return request(OpenAPI, {
method: "GET",
url: "/user/findings/{findingId}",
path: {
"findingId": findingId
}
});
}
static updateFindingStatus(findingId, requestBody) {
return request(OpenAPI, {
method: "PUT",
url: "/user/findings/{findingId}",
path: {
"findingId": findingId
},
body: requestBody,
mediaType: "application/json"
});
}
static bulkUpdateFindingStatus(requestBody) {
return request(OpenAPI, {
method: "PUT",
url: "/user/findings/update",
body: requestBody,
mediaType: "application/json"
});
}
static updateFindingTags(requestBody) {
return request(OpenAPI, {
method: "PUT",
url: "/user/findings/findingTags",
body: requestBody,
mediaType: "application/json"
});
}
static underReview(requestBody) {
return request(OpenAPI, {
method: "POST",
url: "/user/findings/under-review",
body: requestBody,
mediaType: "application/json"
});
}
static findingStatsByTeamName(requestBody) {
return request(OpenAPI, {
method: "POST",
url: "/user/findings/stat/team",
body: requestBody,
mediaType: "application/json"
});
}
static findingStatsByProductName(requestBody) {
return request(OpenAPI, {
method: "POST",
url: "/user/findings/stat/product",
body: requestBody,
mediaType: "application/json"
});
}
static findingStatsByProductId(requestBody) {
return request(OpenAPI, {
method: "POST",
url: "/user/findings/findingStats/by-appsec-status",
body: requestBody,
mediaType: "application/json"
});
}
static getFindingsFilters(requestBody) {
return request(OpenAPI, {
method: "POST",
url: "/user/findings/findings-filters",
body: requestBody,
mediaType: "application/json"
});
}
static devOpsCycleDetails(requestBody) {
return request(OpenAPI, {
method: "POST",
url: "/user/findings/details",
body: requestBody,
mediaType: "application/json"
});
}
static listFindings(requestBody) {
return request(OpenAPI, {
method: "POST",
url: "/user/findings/",
body: requestBody,
mediaType: "application/json"
});
}
}
class ProductControllerService {
static getAllProduct() {
return request(OpenAPI, {
method: "GET",
url: "/user/product"
});
}
static update2(requestBody) {
return request(OpenAPI, {
method: "PUT",
url: "/user/product",
body: requestBody,
mediaType: "application/json"
});
}
static postProduct(requestBody) {
return request(OpenAPI, {
method: "POST",
url: "/user/product",
body: requestBody,
mediaType: "application/json"
});
}
static bulkUploadProducts(formData) {
return request(OpenAPI, {
method: "POST",
url: "/user/product/upload",
formData,
mediaType: "multipart/form-data"
});
}
static getGlobalProductFilter() {
return request(OpenAPI, {
method: "GET",
url: "/user/product/filter"