From 9561e4088c54fde9d4e12fec087f2629560d1075 Mon Sep 17 00:00:00 2001 From: Zvi Grinberg Date: Thu, 7 Sep 2023 10:38:07 +0300 Subject: [PATCH 1/3] feat: add mechanism to determine exhort backend URL address based on EXHORT_DEV_MODE Environment Variabe/key value from object Signed-off-by: Zvi Grinberg --- config/config.properties | 1 + generated/backend/AnalysisReport.d.ts | 31 + generated/backend/AnalysisReport.js | 35 + generated/backend/CvssVector.d.ts | 39 + generated/backend/CvssVector.js | 105 +++ generated/backend/DependenciesSummary.d.ts | 29 + generated/backend/DependenciesSummary.js | 35 + .../DependencyAnalysis200Response.d.ts | 30 + .../backend/DependencyAnalysis200Response.js | 35 + generated/backend/DependencyReport.d.ts | 44 ++ generated/backend/DependencyReport.js | 66 ++ .../DependencyReportHighestVulnerability.d.ts | 40 + .../DependencyReportHighestVulnerability.js | 80 ++ .../DependencyReportRecommendation.d.ts | 42 ++ .../backend/DependencyReportRecommendation.js | 54 ++ generated/backend/Issue.d.ts | 37 + generated/backend/Issue.js | 77 ++ generated/backend/PackageRef.d.ts | 39 + generated/backend/PackageRef.js | 51 ++ generated/backend/ProviderStatus.d.ts | 31 + generated/backend/ProviderStatus.js | 49 ++ generated/backend/Remediation.d.ts | 31 + generated/backend/Remediation.js | 42 ++ generated/backend/Summary.d.ts | 33 + generated/backend/Summary.js | 42 ++ .../backend/TransitiveDependencyReport.d.ts | 35 + .../backend/TransitiveDependencyReport.js | 42 ++ generated/backend/VulnerabilitiesSummary.d.ts | 33 + generated/backend/VulnerabilitiesSummary.js | 63 ++ generated/backend/tsconfig.json | 17 + package-lock.json | 714 +++++++++++++++++- package.json | 5 +- src/index.js | 63 +- 33 files changed, 2043 insertions(+), 27 deletions(-) create mode 100644 config/config.properties create mode 100644 generated/backend/AnalysisReport.d.ts create mode 100644 generated/backend/AnalysisReport.js create mode 100644 generated/backend/CvssVector.d.ts create mode 100644 generated/backend/CvssVector.js create mode 100644 generated/backend/DependenciesSummary.d.ts create mode 100644 generated/backend/DependenciesSummary.js create mode 100644 generated/backend/DependencyAnalysis200Response.d.ts create mode 100644 generated/backend/DependencyAnalysis200Response.js create mode 100644 generated/backend/DependencyReport.d.ts create mode 100644 generated/backend/DependencyReport.js create mode 100644 generated/backend/DependencyReportHighestVulnerability.d.ts create mode 100644 generated/backend/DependencyReportHighestVulnerability.js create mode 100644 generated/backend/DependencyReportRecommendation.d.ts create mode 100644 generated/backend/DependencyReportRecommendation.js create mode 100644 generated/backend/Issue.d.ts create mode 100644 generated/backend/Issue.js create mode 100644 generated/backend/PackageRef.d.ts create mode 100644 generated/backend/PackageRef.js create mode 100644 generated/backend/ProviderStatus.d.ts create mode 100644 generated/backend/ProviderStatus.js create mode 100644 generated/backend/Remediation.d.ts create mode 100644 generated/backend/Remediation.js create mode 100644 generated/backend/Summary.d.ts create mode 100644 generated/backend/Summary.js create mode 100644 generated/backend/TransitiveDependencyReport.d.ts create mode 100644 generated/backend/TransitiveDependencyReport.js create mode 100644 generated/backend/VulnerabilitiesSummary.d.ts create mode 100644 generated/backend/VulnerabilitiesSummary.js create mode 100644 generated/backend/tsconfig.json diff --git a/config/config.properties b/config/config.properties new file mode 100644 index 0000000..39940fa --- /dev/null +++ b/config/config.properties @@ -0,0 +1 @@ +EXHORT_DEV_MODE=false diff --git a/generated/backend/AnalysisReport.d.ts b/generated/backend/AnalysisReport.d.ts new file mode 100644 index 0000000..3626ed3 --- /dev/null +++ b/generated/backend/AnalysisReport.d.ts @@ -0,0 +1,31 @@ +/** + * CodeReady Dependency Analytics API + * Vulnerability analysis with Red Hat CodeReady Dependency Analytics + * + * OpenAPI spec version: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { DependencyReport } from '../backend/DependencyReport'; +import { Summary } from '../backend/Summary'; +export declare class AnalysisReport { + 'summary'?: Summary; + 'dependencies'?: Array; + static readonly discriminator: string | undefined; + static readonly attributeTypeMap: Array<{ + name: string; + baseName: string; + type: string; + format: string; + }>; + static getAttributeTypeMap(): { + name: string; + baseName: string; + type: string; + format: string; + }[]; + constructor(); +} diff --git a/generated/backend/AnalysisReport.js b/generated/backend/AnalysisReport.js new file mode 100644 index 0000000..b7792b9 --- /dev/null +++ b/generated/backend/AnalysisReport.js @@ -0,0 +1,35 @@ +/** + * CodeReady Dependency Analytics API + * Vulnerability analysis with Red Hat CodeReady Dependency Analytics + * + * OpenAPI spec version: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +export class AnalysisReport { + 'summary'; + 'dependencies'; + static discriminator = undefined; + static attributeTypeMap = [ + { + "name": "summary", + "baseName": "summary", + "type": "Summary", + "format": "" + }, + { + "name": "dependencies", + "baseName": "dependencies", + "type": "Array", + "format": "" + } + ]; + static getAttributeTypeMap() { + return AnalysisReport.attributeTypeMap; + } + constructor() { + } +} diff --git a/generated/backend/CvssVector.d.ts b/generated/backend/CvssVector.d.ts new file mode 100644 index 0000000..c87a117 --- /dev/null +++ b/generated/backend/CvssVector.d.ts @@ -0,0 +1,39 @@ +/** + * CodeReady Dependency Analytics API + * Vulnerability analysis with Red Hat CodeReady Dependency Analytics + * + * OpenAPI spec version: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +export declare class CvssVector { + 'attackVector'?: string; + 'attackComplexity'?: string; + 'privilegesRequired'?: string; + 'userInteraction'?: string; + 'scope'?: string; + 'confidentialityImpact'?: string; + 'integrityImpact'?: string; + 'availabilityImpact'?: string; + 'exploitCodeMaturity'?: string; + 'remediationLevel'?: string; + 'reportConficende'?: string; + 'cvss'?: string; + static readonly discriminator: string | undefined; + static readonly attributeTypeMap: Array<{ + name: string; + baseName: string; + type: string; + format: string; + }>; + static getAttributeTypeMap(): { + name: string; + baseName: string; + type: string; + format: string; + }[]; + constructor(); +} diff --git a/generated/backend/CvssVector.js b/generated/backend/CvssVector.js new file mode 100644 index 0000000..79bc2cc --- /dev/null +++ b/generated/backend/CvssVector.js @@ -0,0 +1,105 @@ +/** + * CodeReady Dependency Analytics API + * Vulnerability analysis with Red Hat CodeReady Dependency Analytics + * + * OpenAPI spec version: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +export class CvssVector { + 'attackVector'; + 'attackComplexity'; + 'privilegesRequired'; + 'userInteraction'; + 'scope'; + 'confidentialityImpact'; + 'integrityImpact'; + 'availabilityImpact'; + 'exploitCodeMaturity'; + 'remediationLevel'; + 'reportConficende'; + 'cvss'; + static discriminator = undefined; + static attributeTypeMap = [ + { + "name": "attackVector", + "baseName": "attackVector", + "type": "string", + "format": "" + }, + { + "name": "attackComplexity", + "baseName": "attackComplexity", + "type": "string", + "format": "" + }, + { + "name": "privilegesRequired", + "baseName": "privilegesRequired", + "type": "string", + "format": "" + }, + { + "name": "userInteraction", + "baseName": "userInteraction", + "type": "string", + "format": "" + }, + { + "name": "scope", + "baseName": "scope", + "type": "string", + "format": "" + }, + { + "name": "confidentialityImpact", + "baseName": "confidentialityImpact", + "type": "string", + "format": "" + }, + { + "name": "integrityImpact", + "baseName": "integrityImpact", + "type": "string", + "format": "" + }, + { + "name": "availabilityImpact", + "baseName": "availabilityImpact", + "type": "string", + "format": "" + }, + { + "name": "exploitCodeMaturity", + "baseName": "exploitCodeMaturity", + "type": "string", + "format": "" + }, + { + "name": "remediationLevel", + "baseName": "remediationLevel", + "type": "string", + "format": "" + }, + { + "name": "reportConficende", + "baseName": "reportConficende", + "type": "string", + "format": "" + }, + { + "name": "cvss", + "baseName": "cvss", + "type": "string", + "format": "" + } + ]; + static getAttributeTypeMap() { + return CvssVector.attributeTypeMap; + } + constructor() { + } +} diff --git a/generated/backend/DependenciesSummary.d.ts b/generated/backend/DependenciesSummary.d.ts new file mode 100644 index 0000000..eec6655 --- /dev/null +++ b/generated/backend/DependenciesSummary.d.ts @@ -0,0 +1,29 @@ +/** + * CodeReady Dependency Analytics API + * Vulnerability analysis with Red Hat CodeReady Dependency Analytics + * + * OpenAPI spec version: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +export declare class DependenciesSummary { + 'scanned'?: number; + 'transitive'?: number; + static readonly discriminator: string | undefined; + static readonly attributeTypeMap: Array<{ + name: string; + baseName: string; + type: string; + format: string; + }>; + static getAttributeTypeMap(): { + name: string; + baseName: string; + type: string; + format: string; + }[]; + constructor(); +} diff --git a/generated/backend/DependenciesSummary.js b/generated/backend/DependenciesSummary.js new file mode 100644 index 0000000..1533efb --- /dev/null +++ b/generated/backend/DependenciesSummary.js @@ -0,0 +1,35 @@ +/** + * CodeReady Dependency Analytics API + * Vulnerability analysis with Red Hat CodeReady Dependency Analytics + * + * OpenAPI spec version: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +export class DependenciesSummary { + 'scanned'; + 'transitive'; + static discriminator = undefined; + static attributeTypeMap = [ + { + "name": "scanned", + "baseName": "scanned", + "type": "number", + "format": "" + }, + { + "name": "transitive", + "baseName": "transitive", + "type": "number", + "format": "" + } + ]; + static getAttributeTypeMap() { + return DependenciesSummary.attributeTypeMap; + } + constructor() { + } +} diff --git a/generated/backend/DependencyAnalysis200Response.d.ts b/generated/backend/DependencyAnalysis200Response.d.ts new file mode 100644 index 0000000..efcc86f --- /dev/null +++ b/generated/backend/DependencyAnalysis200Response.d.ts @@ -0,0 +1,30 @@ +/** + * CodeReady Dependency Analytics API + * Vulnerability analysis with Red Hat CodeReady Dependency Analytics + * + * OpenAPI spec version: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { AnalysisReport } from '../backend/AnalysisReport'; +export declare class DependencyAnalysis200Response { + 'jsonReport'?: AnalysisReport; + 'htmlReport'?: any; + static readonly discriminator: string | undefined; + static readonly attributeTypeMap: Array<{ + name: string; + baseName: string; + type: string; + format: string; + }>; + static getAttributeTypeMap(): { + name: string; + baseName: string; + type: string; + format: string; + }[]; + constructor(); +} diff --git a/generated/backend/DependencyAnalysis200Response.js b/generated/backend/DependencyAnalysis200Response.js new file mode 100644 index 0000000..31f1f6e --- /dev/null +++ b/generated/backend/DependencyAnalysis200Response.js @@ -0,0 +1,35 @@ +/** + * CodeReady Dependency Analytics API + * Vulnerability analysis with Red Hat CodeReady Dependency Analytics + * + * OpenAPI spec version: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +export class DependencyAnalysis200Response { + 'jsonReport'; + 'htmlReport'; + static discriminator = undefined; + static attributeTypeMap = [ + { + "name": "jsonReport", + "baseName": "json_report", + "type": "AnalysisReport", + "format": "" + }, + { + "name": "htmlReport", + "baseName": "html_report", + "type": "any", + "format": "" + } + ]; + static getAttributeTypeMap() { + return DependencyAnalysis200Response.attributeTypeMap; + } + constructor() { + } +} diff --git a/generated/backend/DependencyReport.d.ts b/generated/backend/DependencyReport.d.ts new file mode 100644 index 0000000..991eb0a --- /dev/null +++ b/generated/backend/DependencyReport.d.ts @@ -0,0 +1,44 @@ +/** + * CodeReady Dependency Analytics API + * Vulnerability analysis with Red Hat CodeReady Dependency Analytics + * + * OpenAPI spec version: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { DependencyReportHighestVulnerability } from '../backend/DependencyReportHighestVulnerability'; +import { DependencyReportRecommendation } from '../backend/DependencyReportRecommendation'; +import { Issue } from '../backend/Issue'; +import { PackageRef } from '../backend/PackageRef'; +import { Remediation } from '../backend/Remediation'; +import { TransitiveDependencyReport } from '../backend/TransitiveDependencyReport'; +export declare class DependencyReport { + 'ref'?: PackageRef; + 'issues'?: Array; + 'transitive'?: Array; + 'recommendation'?: DependencyReportRecommendation; + /** + * Trusted Content remediation related to identified security vulnerabilities + */ + 'remediations'?: { + [key: string]: Remediation; + }; + 'highestVulnerability'?: DependencyReportHighestVulnerability; + static readonly discriminator: string | undefined; + static readonly attributeTypeMap: Array<{ + name: string; + baseName: string; + type: string; + format: string; + }>; + static getAttributeTypeMap(): { + name: string; + baseName: string; + type: string; + format: string; + }[]; + constructor(); +} diff --git a/generated/backend/DependencyReport.js b/generated/backend/DependencyReport.js new file mode 100644 index 0000000..150f1f5 --- /dev/null +++ b/generated/backend/DependencyReport.js @@ -0,0 +1,66 @@ +/** + * CodeReady Dependency Analytics API + * Vulnerability analysis with Red Hat CodeReady Dependency Analytics + * + * OpenAPI spec version: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +export class DependencyReport { + 'ref'; + 'issues'; + 'transitive'; + 'recommendation'; + /** + * Trusted Content remediation related to identified security vulnerabilities + */ + 'remediations'; + 'highestVulnerability'; + static discriminator = undefined; + static attributeTypeMap = [ + { + "name": "ref", + "baseName": "ref", + "type": "PackageRef", + "format": "" + }, + { + "name": "issues", + "baseName": "issues", + "type": "Array", + "format": "" + }, + { + "name": "transitive", + "baseName": "transitive", + "type": "Array", + "format": "" + }, + { + "name": "recommendation", + "baseName": "recommendation", + "type": "DependencyReportRecommendation", + "format": "" + }, + { + "name": "remediations", + "baseName": "remediations", + "type": "{ [key: string]: Remediation; }", + "format": "" + }, + { + "name": "highestVulnerability", + "baseName": "highestVulnerability", + "type": "DependencyReportHighestVulnerability", + "format": "" + } + ]; + static getAttributeTypeMap() { + return DependencyReport.attributeTypeMap; + } + constructor() { + } +} diff --git a/generated/backend/DependencyReportHighestVulnerability.d.ts b/generated/backend/DependencyReportHighestVulnerability.d.ts new file mode 100644 index 0000000..86edffa --- /dev/null +++ b/generated/backend/DependencyReportHighestVulnerability.d.ts @@ -0,0 +1,40 @@ +/** + * CodeReady Dependency Analytics API + * Vulnerability analysis with Red Hat CodeReady Dependency Analytics + * + * OpenAPI spec version: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { CvssVector } from '../backend/CvssVector'; +/** +* Highest vulnerability found for this dependency +*/ +export declare class DependencyReportHighestVulnerability { + 'id'?: string; + 'title'?: string; + 'source'?: string; + 'cvss'?: CvssVector; + 'score'?: number; + 'severity'?: DependencyReportHighestVulnerabilitySeverityEnum; + 'cves'?: Array; + 'unique'?: boolean; + static readonly discriminator: string | undefined; + static readonly attributeTypeMap: Array<{ + name: string; + baseName: string; + type: string; + format: string; + }>; + static getAttributeTypeMap(): { + name: string; + baseName: string; + type: string; + format: string; + }[]; + constructor(); +} +export type DependencyReportHighestVulnerabilitySeverityEnum = "CRITICAL" | "HIGH" | "MEDIUM" | "LOW"; diff --git a/generated/backend/DependencyReportHighestVulnerability.js b/generated/backend/DependencyReportHighestVulnerability.js new file mode 100644 index 0000000..9207e47 --- /dev/null +++ b/generated/backend/DependencyReportHighestVulnerability.js @@ -0,0 +1,80 @@ +/** + * CodeReady Dependency Analytics API + * Vulnerability analysis with Red Hat CodeReady Dependency Analytics + * + * OpenAPI spec version: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/** +* Highest vulnerability found for this dependency +*/ +export class DependencyReportHighestVulnerability { + 'id'; + 'title'; + 'source'; + 'cvss'; + 'score'; + 'severity'; + 'cves'; + 'unique'; + static discriminator = undefined; + static attributeTypeMap = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "title", + "baseName": "title", + "type": "string", + "format": "" + }, + { + "name": "source", + "baseName": "source", + "type": "string", + "format": "" + }, + { + "name": "cvss", + "baseName": "cvss", + "type": "CvssVector", + "format": "" + }, + { + "name": "score", + "baseName": "score", + "type": "number", + "format": "" + }, + { + "name": "severity", + "baseName": "severity", + "type": "DependencyReportHighestVulnerabilitySeverityEnum", + "format": "" + }, + { + "name": "cves", + "baseName": "cves", + "type": "Array", + "format": "" + }, + { + "name": "unique", + "baseName": "unique", + "type": "boolean", + "format": "" + } + ]; + static getAttributeTypeMap() { + return DependencyReportHighestVulnerability.attributeTypeMap; + } + constructor() { + } +} diff --git a/generated/backend/DependencyReportRecommendation.d.ts b/generated/backend/DependencyReportRecommendation.d.ts new file mode 100644 index 0000000..980120c --- /dev/null +++ b/generated/backend/DependencyReportRecommendation.d.ts @@ -0,0 +1,42 @@ +/** + * CodeReady Dependency Analytics API + * Vulnerability analysis with Red Hat CodeReady Dependency Analytics + * + * OpenAPI spec version: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/** +* Trusted Content recommendation that is not related to any security vulnerability +*/ +export declare class DependencyReportRecommendation { + /** + * PackageURL identifier + */ + 'purl'?: string; + /** + * : for Java packages + */ + 'name'?: string; + /** + * Package version + */ + 'version'?: string; + static readonly discriminator: string | undefined; + static readonly attributeTypeMap: Array<{ + name: string; + baseName: string; + type: string; + format: string; + }>; + static getAttributeTypeMap(): { + name: string; + baseName: string; + type: string; + format: string; + }[]; + constructor(); +} diff --git a/generated/backend/DependencyReportRecommendation.js b/generated/backend/DependencyReportRecommendation.js new file mode 100644 index 0000000..c1fb292 --- /dev/null +++ b/generated/backend/DependencyReportRecommendation.js @@ -0,0 +1,54 @@ +/** + * CodeReady Dependency Analytics API + * Vulnerability analysis with Red Hat CodeReady Dependency Analytics + * + * OpenAPI spec version: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/** +* Trusted Content recommendation that is not related to any security vulnerability +*/ +export class DependencyReportRecommendation { + /** + * PackageURL identifier + */ + 'purl'; + /** + * : for Java packages + */ + 'name'; + /** + * Package version + */ + 'version'; + static discriminator = undefined; + static attributeTypeMap = [ + { + "name": "purl", + "baseName": "purl", + "type": "string", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "version", + "baseName": "version", + "type": "string", + "format": "" + } + ]; + static getAttributeTypeMap() { + return DependencyReportRecommendation.attributeTypeMap; + } + constructor() { + } +} diff --git a/generated/backend/Issue.d.ts b/generated/backend/Issue.d.ts new file mode 100644 index 0000000..83cde65 --- /dev/null +++ b/generated/backend/Issue.d.ts @@ -0,0 +1,37 @@ +/** + * CodeReady Dependency Analytics API + * Vulnerability analysis with Red Hat CodeReady Dependency Analytics + * + * OpenAPI spec version: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { CvssVector } from '../backend/CvssVector'; +export declare class Issue { + 'id'?: string; + 'title'?: string; + 'source'?: string; + 'cvss'?: CvssVector; + 'score'?: number; + 'severity'?: IssueSeverityEnum; + 'cves'?: Array; + 'unique'?: boolean; + static readonly discriminator: string | undefined; + static readonly attributeTypeMap: Array<{ + name: string; + baseName: string; + type: string; + format: string; + }>; + static getAttributeTypeMap(): { + name: string; + baseName: string; + type: string; + format: string; + }[]; + constructor(); +} +export type IssueSeverityEnum = "CRITICAL" | "HIGH" | "MEDIUM" | "LOW"; diff --git a/generated/backend/Issue.js b/generated/backend/Issue.js new file mode 100644 index 0000000..a7a9cbc --- /dev/null +++ b/generated/backend/Issue.js @@ -0,0 +1,77 @@ +/** + * CodeReady Dependency Analytics API + * Vulnerability analysis with Red Hat CodeReady Dependency Analytics + * + * OpenAPI spec version: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +export class Issue { + 'id'; + 'title'; + 'source'; + 'cvss'; + 'score'; + 'severity'; + 'cves'; + 'unique'; + static discriminator = undefined; + static attributeTypeMap = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "title", + "baseName": "title", + "type": "string", + "format": "" + }, + { + "name": "source", + "baseName": "source", + "type": "string", + "format": "" + }, + { + "name": "cvss", + "baseName": "cvss", + "type": "CvssVector", + "format": "" + }, + { + "name": "score", + "baseName": "score", + "type": "number", + "format": "" + }, + { + "name": "severity", + "baseName": "severity", + "type": "IssueSeverityEnum", + "format": "" + }, + { + "name": "cves", + "baseName": "cves", + "type": "Array", + "format": "" + }, + { + "name": "unique", + "baseName": "unique", + "type": "boolean", + "format": "" + } + ]; + static getAttributeTypeMap() { + return Issue.attributeTypeMap; + } + constructor() { + } +} diff --git a/generated/backend/PackageRef.d.ts b/generated/backend/PackageRef.d.ts new file mode 100644 index 0000000..a484924 --- /dev/null +++ b/generated/backend/PackageRef.d.ts @@ -0,0 +1,39 @@ +/** + * CodeReady Dependency Analytics API + * Vulnerability analysis with Red Hat CodeReady Dependency Analytics + * + * OpenAPI spec version: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +export declare class PackageRef { + /** + * PackageURL identifier + */ + 'purl'?: string; + /** + * : for Java packages + */ + 'name'?: string; + /** + * Package version + */ + 'version'?: string; + static readonly discriminator: string | undefined; + static readonly attributeTypeMap: Array<{ + name: string; + baseName: string; + type: string; + format: string; + }>; + static getAttributeTypeMap(): { + name: string; + baseName: string; + type: string; + format: string; + }[]; + constructor(); +} diff --git a/generated/backend/PackageRef.js b/generated/backend/PackageRef.js new file mode 100644 index 0000000..93231ee --- /dev/null +++ b/generated/backend/PackageRef.js @@ -0,0 +1,51 @@ +/** + * CodeReady Dependency Analytics API + * Vulnerability analysis with Red Hat CodeReady Dependency Analytics + * + * OpenAPI spec version: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +export class PackageRef { + /** + * PackageURL identifier + */ + 'purl'; + /** + * : for Java packages + */ + 'name'; + /** + * Package version + */ + 'version'; + static discriminator = undefined; + static attributeTypeMap = [ + { + "name": "purl", + "baseName": "purl", + "type": "string", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "version", + "baseName": "version", + "type": "string", + "format": "" + } + ]; + static getAttributeTypeMap() { + return PackageRef.attributeTypeMap; + } + constructor() { + } +} diff --git a/generated/backend/ProviderStatus.d.ts b/generated/backend/ProviderStatus.d.ts new file mode 100644 index 0000000..6de54d7 --- /dev/null +++ b/generated/backend/ProviderStatus.d.ts @@ -0,0 +1,31 @@ +/** + * CodeReady Dependency Analytics API + * Vulnerability analysis with Red Hat CodeReady Dependency Analytics + * + * OpenAPI spec version: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +export declare class ProviderStatus { + 'ok'?: boolean; + 'provider'?: string; + 'status'?: number; + 'message'?: string; + static readonly discriminator: string | undefined; + static readonly attributeTypeMap: Array<{ + name: string; + baseName: string; + type: string; + format: string; + }>; + static getAttributeTypeMap(): { + name: string; + baseName: string; + type: string; + format: string; + }[]; + constructor(); +} diff --git a/generated/backend/ProviderStatus.js b/generated/backend/ProviderStatus.js new file mode 100644 index 0000000..ed739c7 --- /dev/null +++ b/generated/backend/ProviderStatus.js @@ -0,0 +1,49 @@ +/** + * CodeReady Dependency Analytics API + * Vulnerability analysis with Red Hat CodeReady Dependency Analytics + * + * OpenAPI spec version: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +export class ProviderStatus { + 'ok'; + 'provider'; + 'status'; + 'message'; + static discriminator = undefined; + static attributeTypeMap = [ + { + "name": "ok", + "baseName": "ok", + "type": "boolean", + "format": "" + }, + { + "name": "provider", + "baseName": "provider", + "type": "string", + "format": "" + }, + { + "name": "status", + "baseName": "status", + "type": "number", + "format": "" + }, + { + "name": "message", + "baseName": "message", + "type": "string", + "format": "" + } + ]; + static getAttributeTypeMap() { + return ProviderStatus.attributeTypeMap; + } + constructor() { + } +} diff --git a/generated/backend/Remediation.d.ts b/generated/backend/Remediation.d.ts new file mode 100644 index 0000000..13fdb59 --- /dev/null +++ b/generated/backend/Remediation.d.ts @@ -0,0 +1,31 @@ +/** + * CodeReady Dependency Analytics API + * Vulnerability analysis with Red Hat CodeReady Dependency Analytics + * + * OpenAPI spec version: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { PackageRef } from '../backend/PackageRef'; +export declare class Remediation { + 'issueRef'?: string; + 'mavenPackage'?: PackageRef; + 'productStatus'?: string; + static readonly discriminator: string | undefined; + static readonly attributeTypeMap: Array<{ + name: string; + baseName: string; + type: string; + format: string; + }>; + static getAttributeTypeMap(): { + name: string; + baseName: string; + type: string; + format: string; + }[]; + constructor(); +} diff --git a/generated/backend/Remediation.js b/generated/backend/Remediation.js new file mode 100644 index 0000000..8ec0389 --- /dev/null +++ b/generated/backend/Remediation.js @@ -0,0 +1,42 @@ +/** + * CodeReady Dependency Analytics API + * Vulnerability analysis with Red Hat CodeReady Dependency Analytics + * + * OpenAPI spec version: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +export class Remediation { + 'issueRef'; + 'mavenPackage'; + 'productStatus'; + static discriminator = undefined; + static attributeTypeMap = [ + { + "name": "issueRef", + "baseName": "issueRef", + "type": "string", + "format": "" + }, + { + "name": "mavenPackage", + "baseName": "mavenPackage", + "type": "PackageRef", + "format": "" + }, + { + "name": "productStatus", + "baseName": "productStatus", + "type": "string", + "format": "" + } + ]; + static getAttributeTypeMap() { + return Remediation.attributeTypeMap; + } + constructor() { + } +} diff --git a/generated/backend/Summary.d.ts b/generated/backend/Summary.d.ts new file mode 100644 index 0000000..6305c4f --- /dev/null +++ b/generated/backend/Summary.d.ts @@ -0,0 +1,33 @@ +/** + * CodeReady Dependency Analytics API + * Vulnerability analysis with Red Hat CodeReady Dependency Analytics + * + * OpenAPI spec version: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { DependenciesSummary } from '../backend/DependenciesSummary'; +import { ProviderStatus } from '../backend/ProviderStatus'; +import { VulnerabilitiesSummary } from '../backend/VulnerabilitiesSummary'; +export declare class Summary { + 'dependencies'?: DependenciesSummary; + 'vulnerabilities'?: VulnerabilitiesSummary; + 'providerStatuses'?: Array; + static readonly discriminator: string | undefined; + static readonly attributeTypeMap: Array<{ + name: string; + baseName: string; + type: string; + format: string; + }>; + static getAttributeTypeMap(): { + name: string; + baseName: string; + type: string; + format: string; + }[]; + constructor(); +} diff --git a/generated/backend/Summary.js b/generated/backend/Summary.js new file mode 100644 index 0000000..bf91b4d --- /dev/null +++ b/generated/backend/Summary.js @@ -0,0 +1,42 @@ +/** + * CodeReady Dependency Analytics API + * Vulnerability analysis with Red Hat CodeReady Dependency Analytics + * + * OpenAPI spec version: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +export class Summary { + 'dependencies'; + 'vulnerabilities'; + 'providerStatuses'; + static discriminator = undefined; + static attributeTypeMap = [ + { + "name": "dependencies", + "baseName": "dependencies", + "type": "DependenciesSummary", + "format": "" + }, + { + "name": "vulnerabilities", + "baseName": "vulnerabilities", + "type": "VulnerabilitiesSummary", + "format": "" + }, + { + "name": "providerStatuses", + "baseName": "providerStatuses", + "type": "Array", + "format": "" + } + ]; + static getAttributeTypeMap() { + return Summary.attributeTypeMap; + } + constructor() { + } +} diff --git a/generated/backend/TransitiveDependencyReport.d.ts b/generated/backend/TransitiveDependencyReport.d.ts new file mode 100644 index 0000000..4f24c85 --- /dev/null +++ b/generated/backend/TransitiveDependencyReport.d.ts @@ -0,0 +1,35 @@ +/** + * CodeReady Dependency Analytics API + * Vulnerability analysis with Red Hat CodeReady Dependency Analytics + * + * OpenAPI spec version: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Issue } from '../backend/Issue'; +import { PackageRef } from '../backend/PackageRef'; +import { Remediation } from '../backend/Remediation'; +export declare class TransitiveDependencyReport { + 'ref'?: PackageRef; + 'issues'?: Array; + 'remediations'?: { + [key: string]: Remediation; + }; + static readonly discriminator: string | undefined; + static readonly attributeTypeMap: Array<{ + name: string; + baseName: string; + type: string; + format: string; + }>; + static getAttributeTypeMap(): { + name: string; + baseName: string; + type: string; + format: string; + }[]; + constructor(); +} diff --git a/generated/backend/TransitiveDependencyReport.js b/generated/backend/TransitiveDependencyReport.js new file mode 100644 index 0000000..5700b33 --- /dev/null +++ b/generated/backend/TransitiveDependencyReport.js @@ -0,0 +1,42 @@ +/** + * CodeReady Dependency Analytics API + * Vulnerability analysis with Red Hat CodeReady Dependency Analytics + * + * OpenAPI spec version: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +export class TransitiveDependencyReport { + 'ref'; + 'issues'; + 'remediations'; + static discriminator = undefined; + static attributeTypeMap = [ + { + "name": "ref", + "baseName": "ref", + "type": "PackageRef", + "format": "" + }, + { + "name": "issues", + "baseName": "issues", + "type": "Array", + "format": "" + }, + { + "name": "remediations", + "baseName": "remediations", + "type": "{ [key: string]: Remediation; }", + "format": "" + } + ]; + static getAttributeTypeMap() { + return TransitiveDependencyReport.attributeTypeMap; + } + constructor() { + } +} diff --git a/generated/backend/VulnerabilitiesSummary.d.ts b/generated/backend/VulnerabilitiesSummary.d.ts new file mode 100644 index 0000000..1ee53f1 --- /dev/null +++ b/generated/backend/VulnerabilitiesSummary.d.ts @@ -0,0 +1,33 @@ +/** + * CodeReady Dependency Analytics API + * Vulnerability analysis with Red Hat CodeReady Dependency Analytics + * + * OpenAPI spec version: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +export declare class VulnerabilitiesSummary { + 'direct'?: number; + 'total'?: number; + 'critical'?: number; + 'high'?: number; + 'medium'?: number; + 'low'?: number; + static readonly discriminator: string | undefined; + static readonly attributeTypeMap: Array<{ + name: string; + baseName: string; + type: string; + format: string; + }>; + static getAttributeTypeMap(): { + name: string; + baseName: string; + type: string; + format: string; + }[]; + constructor(); +} diff --git a/generated/backend/VulnerabilitiesSummary.js b/generated/backend/VulnerabilitiesSummary.js new file mode 100644 index 0000000..3932765 --- /dev/null +++ b/generated/backend/VulnerabilitiesSummary.js @@ -0,0 +1,63 @@ +/** + * CodeReady Dependency Analytics API + * Vulnerability analysis with Red Hat CodeReady Dependency Analytics + * + * OpenAPI spec version: 3.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +export class VulnerabilitiesSummary { + 'direct'; + 'total'; + 'critical'; + 'high'; + 'medium'; + 'low'; + static discriminator = undefined; + static attributeTypeMap = [ + { + "name": "direct", + "baseName": "direct", + "type": "number", + "format": "" + }, + { + "name": "total", + "baseName": "total", + "type": "number", + "format": "" + }, + { + "name": "critical", + "baseName": "critical", + "type": "number", + "format": "" + }, + { + "name": "high", + "baseName": "high", + "type": "number", + "format": "" + }, + { + "name": "medium", + "baseName": "medium", + "type": "number", + "format": "" + }, + { + "name": "low", + "baseName": "low", + "type": "number", + "format": "" + } + ]; + static getAttributeTypeMap() { + return VulnerabilitiesSummary.attributeTypeMap; + } + constructor() { + } +} diff --git a/generated/backend/tsconfig.json b/generated/backend/tsconfig.json new file mode 100644 index 0000000..99aad9d --- /dev/null +++ b/generated/backend/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "allowJs": true, + "allowSyntheticDefaultImports": true, + "baseUrl": "src", + "declaration": true, + "esModuleInterop": true, + "lib": ["esnext"], + "moduleResolution": "Node", + "noUnusedLocals": false, + "noUnusedParameters": false, + "skipLibCheck": true, + "types": ["node"], + "module": "esnext", + "target": "esnext" + } +} diff --git a/package-lock.json b/package-lock.json index 450f2e4..8c4926f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,9 @@ "dependencies": { "@cyclonedx/cyclonedx-library": "^4.0.0", "fast-xml-parser": "^4.2.4", + "get-root-path": "^2.0.2", "packageurl-js": "^1.0.2", + "properties-reader": "^2.3.0", "yargs": "^17.7.2" }, "bin": { @@ -901,6 +903,14 @@ "node": ">= 8" } }, + "node_modules/app-root-path": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-2.2.1.tgz", + "integrity": "sha512-91IFKeKk7FjfmezPKkwtaRvSpnUc4gDwPAjA1YZ9Gn0q0PPeW+vbeUsZuyDwjI7+QTHhcLen2v25fi/AmhvbJA==", + "engines": { + "node": ">= 6.0.0" + } + }, "node_modules/aproba": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", @@ -926,6 +936,38 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", + "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", + "dependencies": { + "call-bind": "^1.0.2", + "is-array-buffer": "^3.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.2.tgz", + "integrity": "sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw==", + "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1", + "is-array-buffer": "^3.0.2", + "is-shared-array-buffer": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", @@ -945,7 +987,6 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -1018,6 +1059,11 @@ "readable-stream": "^3.4.0" } }, + "node_modules/bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" + }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -1138,7 +1184,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, "dependencies": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.2" @@ -1333,6 +1378,14 @@ "color-support": "bin.js" } }, + "node_modules/colors": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", + "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", + "engines": { + "node": ">=0.1.90" + } + }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -1575,6 +1628,21 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/define-properties": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", + "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", + "dependencies": { + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -1599,6 +1667,11 @@ "node": ">=8" } }, + "node_modules/detect-node": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz", + "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==" + }, "node_modules/diff": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", @@ -1682,6 +1755,87 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, + "node_modules/es-abstract": { + "version": "1.22.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.1.tgz", + "integrity": "sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw==", + "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "arraybuffer.prototype.slice": "^1.0.1", + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "es-set-tostringtag": "^2.0.1", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.5", + "get-intrinsic": "^1.2.1", + "get-symbol-description": "^1.0.0", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has": "^1.0.3", + "has-property-descriptors": "^1.0.0", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.5", + "is-array-buffer": "^3.0.2", + "is-callable": "^1.2.7", + "is-negative-zero": "^2.0.2", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.10", + "is-weakref": "^1.0.2", + "object-inspect": "^1.12.3", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.5.0", + "safe-array-concat": "^1.0.0", + "safe-regex-test": "^1.0.0", + "string.prototype.trim": "^1.2.7", + "string.prototype.trimend": "^1.0.6", + "string.prototype.trimstart": "^1.0.6", + "typed-array-buffer": "^1.0.0", + "typed-array-byte-length": "^1.0.0", + "typed-array-byte-offset": "^1.0.0", + "typed-array-length": "^1.0.4", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", + "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==", + "dependencies": { + "get-intrinsic": "^1.1.3", + "has": "^1.0.3", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -2078,7 +2232,6 @@ "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "dev": true, "dependencies": { "is-callable": "^1.1.3" } @@ -2157,8 +2310,32 @@ "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "node_modules/function.prototype.name": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/gauge": { "version": "3.0.2", @@ -2201,7 +2378,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", - "dev": true, "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", @@ -2212,6 +2388,31 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-root-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-root-path/-/get-root-path-2.0.2.tgz", + "integrity": "sha512-dWjZ4oy14SDt7g11aGUGTiCe1X1Pd3xfEPzDndholvMTKoLnpmKPXlrSq0V9ATjG3N8Ywg5akq0NwFU4zu1aJA==", + "dependencies": { + "app-root-path": "^2.0.1", + "bluebird": "^3.4.7", + "mad-logs": "^3.1.1" + } + }, + "node_modules/get-symbol-description": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", + "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", @@ -2259,11 +2460,24 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "dependencies": { + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/gopd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dev": true, "dependencies": { "get-intrinsic": "^1.1.3" }, @@ -2296,7 +2510,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, "dependencies": { "function-bind": "^1.1.1" }, @@ -2304,6 +2517,14 @@ "node": ">= 0.4.0" } }, + "node_modules/has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -2313,11 +2534,21 @@ "node": ">=8" } }, + "node_modules/has-property-descriptors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "dependencies": { + "get-intrinsic": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -2329,7 +2560,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -2341,7 +2571,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", - "dev": true, "dependencies": { "has-symbols": "^1.0.2" }, @@ -2500,6 +2729,19 @@ "node": ">=12.0.0" } }, + "node_modules/internal-slot": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", + "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", + "dependencies": { + "get-intrinsic": "^1.2.0", + "has": "^1.0.3", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/is-arguments": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", @@ -2516,6 +2758,30 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-array-buffer": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", + "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.0", + "is-typed-array": "^1.1.10" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -2528,11 +2794,39 @@ "node": ">=8" } }, + "node_modules/is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-callable": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", - "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, "engines": { "node": ">= 0.4" }, @@ -2593,6 +2887,17 @@ "node": ">=8" } }, + "node_modules/is-negative-zero": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", + "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-node-process": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/is-node-process/-/is-node-process-1.2.0.tgz", @@ -2608,6 +2913,20 @@ "node": ">=0.12.0" } }, + "node_modules/is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-path-inside": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", @@ -2626,11 +2945,64 @@ "node": ">=8" } }, + "node_modules/is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", + "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-typed-array": { "version": "1.1.10", "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.10.tgz", "integrity": "sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==", - "dev": true, "dependencies": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", @@ -2657,6 +3029,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/isarray": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", @@ -2820,8 +3203,12 @@ "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "node_modules/lodash.find": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.find/-/lodash.find-4.6.0.tgz", + "integrity": "sha512-yaRZoAV3Xq28F1iafWN1+a0rflOej93l1DQUejs3SZ41h2O9UJBoS9aueGjPDgAl4B6tPC0NuuchLKaDQQ3Isg==" }, "node_modules/lodash.get": { "version": "4.4.2", @@ -2829,6 +3216,16 @@ "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==", "dev": true }, + "node_modules/lodash.isfunction": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/lodash.isfunction/-/lodash.isfunction-3.0.9.tgz", + "integrity": "sha512-AirXNj15uRIMMPihnkInB4i3NHeb4iBtNg9WRWuK2o31S+ePwwNmDPaTL3o7dTJ+VXNZim7rFs4rxN4YU1oUJw==" + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" + }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -2860,6 +3257,22 @@ "get-func-name": "^2.0.0" } }, + "node_modules/mad-logs": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/mad-logs/-/mad-logs-3.5.0.tgz", + "integrity": "sha512-Hv5qUc2S87zo2l44E0o1Qzr2wi48jeYz+kHfM5d9FnWSVD/5W6fjrUMG6zpxU+KAzh0QGCK+do81JZ1UDU9wyQ==", + "dependencies": { + "colors": "^1.1.2", + "detect-node": "^2.0.3", + "lodash.find": "^4.6.0", + "lodash.isfunction": "^3.0.8", + "lodash.isstring": "^4.0.1", + "string.prototype.padend": "^3.0.0" + }, + "peerDependencies": { + "lodash": "^4.17.2" + } + }, "node_modules/make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -2964,7 +3377,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "optional": true, "bin": { "mkdirp": "bin/cmd.js" }, @@ -3338,6 +3750,39 @@ "node": ">=0.10.0" } }, + "node_modules/object-inspect": { + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", + "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -3527,6 +3972,21 @@ "node": ">= 0.8.0" } }, + "node_modules/properties-reader": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/properties-reader/-/properties-reader-2.3.0.tgz", + "integrity": "sha512-z597WicA7nDZxK12kZqHr2TcvwNU1GCfA5UwfDY/HDp3hXPoPlb5rlEx9bwGTiJnc0OqbBTkU975jDToth8Gxw==", + "dependencies": { + "mkdirp": "^1.0.4" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "type": "github", + "url": "https://github.com/steveukx/properties?sponsor=1" + } + }, "node_modules/punycode": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", @@ -3622,6 +4082,22 @@ "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==", "dev": true }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz", + "integrity": "sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "functions-have-names": "^1.2.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -3742,6 +4218,28 @@ "integrity": "sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==", "dev": true }, + "node_modules/safe-array-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.1.tgz", + "integrity": "sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q==", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-array-concat/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" + }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -3762,6 +4260,19 @@ } ] }, + "node_modules/safe-regex-test": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", + "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "is-regex": "^1.1.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -3846,6 +4357,19 @@ "node": ">=8" } }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", @@ -3960,6 +4484,64 @@ "node": ">=8" } }, + "node_modules/string.prototype.padend": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.5.tgz", + "integrity": "sha512-DOB27b/2UTTD+4myKUFh+/fXWcu/UDyASIXfg+7VzoCNNGOfWvoyU/x5pvVHr++ztyt/oSYI1BcWBBG/hmlNjA==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trim": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz", + "integrity": "sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz", + "integrity": "sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz", + "integrity": "sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -4121,6 +4703,67 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/typed-array-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz", + "integrity": "sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz", + "integrity": "sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==", + "dependencies": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz", + "integrity": "sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==", + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", + "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", + "dependencies": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "is-typed-array": "^1.1.9" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/typescript": { "version": "5.1.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.3.tgz", @@ -4146,6 +4789,20 @@ "node": ">=8" } }, + "node_modules/unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dependencies": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/universalify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", @@ -4259,18 +4916,31 @@ "node": ">= 8" } }, + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/which-typed-array": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz", - "integrity": "sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==", - "dev": true, + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz", + "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==", "dependencies": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", "for-each": "^0.3.3", "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0", - "is-typed-array": "^1.1.10" + "has-tostringtag": "^1.0.0" }, "engines": { "node": ">= 0.4" diff --git a/package.json b/package.json index a31e7ad..3e43720 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,8 @@ "types": "dist/src/index.d.ts", "files": [ "!*", - "dist/**/*" + "dist/**/*", + "config/**/*" ], "scripts": { "lint": "eslint src test --ext js", @@ -48,7 +49,9 @@ "dependencies": { "@cyclonedx/cyclonedx-library": "^4.0.0", "fast-xml-parser": "^4.2.4", + "get-root-path": "^2.0.2", "packageurl-js": "^1.0.2", + "properties-reader": "^2.3.0", "yargs": "^17.7.2" }, "devDependencies": { diff --git a/src/index.js b/src/index.js index c4f6141..55d7a0e 100644 --- a/src/index.js +++ b/src/index.js @@ -1,19 +1,72 @@ +import {rootPath} from "get-root-path"; +import {EOL} from "os"; import { availableProviders, match } from './provider.js' import {AnalysisReport} from '../generated/backend/AnalysisReport.js' import analysis from './analysis.js' import fs from 'node:fs' import {getCustom} from "./tools.js"; +import path from 'node:path' + +import PropertiesReader from 'properties-reader' export default { AnalysisReport, componentAnalysis, stackAnalysis, validateToken } +export const exhortDevDefaultUrl = 'http://alpha-exhort.apps.sssc-cl01.appeng.rhecoeng.com'; + + +export const exhortDefaultUrl = "https://rhda.rhcloud.com"; + + + +/** This function is used to determine exhort url backend according to the following logic: + * If EXHORT_DEV_MODE = true, then take the value of the EXHORT BACKEND URL of dev/staging environment in such a way: + * take it as environment variable if exists, otherwise, take it from opts object if exists, otherwise, use the hardcoded default of DEV environment. + * If EXHORT_DEV_MODE = false , then select the production url of EXHORT Backend, which is hardcoded. + * EXHORT_DEV_MODE evaluated in the following order and selected when it finds it first: + * 1. Environment Variable + * 2. (key,value) from opts object + * 3. Bundled value in configuration.properties file inside the package + * @param {{}} [opts={}] - optional various options to override default EXHORT_DEV_MODE and DEV_EXHORT_BACKEND_URL. + * @return {string} - The selected exhort backend + * @private + */ +function selectExhortBackend(opts= {}) { + let result + // fs.existsSync() + + + // console.log(path.resolve(rootPath,"config","config.properties")) + + let properties = PropertiesReader(path.join(rootPath,"config","config.properties")); + // let error={} + // console.log(error) + let exhortDevModeBundled = properties.get("EXHORT_DEV_MODE").toString() + let exhortDevMode = getCustom("EXHORT_DEV_MODE",exhortDevModeBundled,opts) + if(exhortDevMode !== null && exhortDevMode.toString() === "true") { + result = getCustom('DEV_EXHORT_BACKEND_URL',exhortDevDefaultUrl,opts); + } + else + { + result = exhortDefaultUrl + } + return result; +} + +/** + * + * @param opts + * @return {string} + */ +export function testSelectExhortBackend(opts) +{ + return selectExhortBackend(opts) +} + /** * @type {string} backend url to send requests to * @private */ -const url = getCustom( - 'EXHORT_BACKEND_URL', - 'http://alpha-exhort.apps.sssc-cl01.appeng.rhecoeng.com' -) +let url /** * Get stack analysis report for a manifest file. @@ -25,6 +78,7 @@ const url = getCustom( * or backend request failed */ async function stackAnalysis(manifest, html = false, opts = {}) { + url = selectExhortBackend(opts) fs.accessSync(manifest, fs.constants.R_OK) // throws error if file unreadable let provider = match(manifest, availableProviders) // throws error if no matching provider return await analysis.requestStack(provider, manifest, url, html, opts) // throws error request sending failed @@ -39,6 +93,7 @@ async function stackAnalysis(manifest, html = false, opts = {}) { * @throws {Error} if no matching provider, failed to get create content, or backend request failed */ async function componentAnalysis(manifestType, data, opts = {}) { + url = selectExhortBackend(opts) let provider = match(manifestType, availableProviders) // throws error if no matching provider return await analysis.requestComponent(provider, data, url, opts) // throws error request sending failed } From 96fe7fe3dd81a0efd72467bc88bb31df7cc3a113 Mon Sep 17 00:00:00 2001 From: Zvi Grinberg Date: Thu, 7 Sep 2023 10:54:38 +0300 Subject: [PATCH 2/3] test: use a more portable format for fake timestamp for npm tests Signed-off-by: Zvi Grinberg --- src/index.js | 1 - test/providers/javascript_npm.test.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 55d7a0e..4177a19 100644 --- a/src/index.js +++ b/src/index.js @@ -1,5 +1,4 @@ import {rootPath} from "get-root-path"; -import {EOL} from "os"; import { availableProviders, match } from './provider.js' import {AnalysisReport} from '../generated/backend/AnalysisReport.js' import analysis from './analysis.js' diff --git a/test/providers/javascript_npm.test.js b/test/providers/javascript_npm.test.js index bf918e8..f5ef5fa 100644 --- a/test/providers/javascript_npm.test.js +++ b/test/providers/javascript_npm.test.js @@ -73,4 +73,4 @@ suite('testing the javascript-npm data provider', () => { }) -}).beforeAll(() => clock = sinon.useFakeTimers(new Date(2023,7,7))).afterAll(()=> clock.restore()); +}).beforeAll(() => clock = sinon.useFakeTimers(new Date('2023-08-07T00:00:00.000Z'))).afterAll(()=> clock.restore()); From 47b3b620cd65f96f90f4c2b2d3a045339c39710c Mon Sep 17 00:00:00 2001 From: Zvi Grinberg Date: Thu, 7 Sep 2023 11:20:05 +0300 Subject: [PATCH 3/3] test: add mechanism to determine exhort backend URL address based on EXHORT_DEV_MODE Environment Variabe/key value from object Signed-off-by: Zvi Grinberg --- test/get-exhort-url.test.js | 116 ++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 test/get-exhort-url.test.js diff --git a/test/get-exhort-url.test.js b/test/get-exhort-url.test.js new file mode 100644 index 0000000..5e769fb --- /dev/null +++ b/test/get-exhort-url.test.js @@ -0,0 +1,116 @@ +import { expect } from 'chai' +import {exhortDefaultUrl, exhortDevDefaultUrl, testSelectExhortBackend} from "../src/index.js" + +suite('testing Select Exhort Backend function when EXHORT_DEV_MODE environment variable is True', () => { + + test('When Dev Mode environment Variable= true, default DEV Exhort Backend Selected ', () => { + let testOpts = { + "EXHORT_DEV_MODE" : "true" + + } + let selectedUrl = testSelectExhortBackend(testOpts); + expect(selectedUrl).not.to.be.equals(exhortDefaultUrl) + expect(selectedUrl).to.be.equals(exhortDevDefaultUrl) + }); + + test('When Dev Mode environment Variable= true, and despite option Dev Mode = false , default DEV Exhort Backend Selected ', () => { + let testOpts = { + "EXHORT_DEV_MODE" : "false" + } + let selectedUrl = testSelectExhortBackend(testOpts); + expect(selectedUrl).not.to.be.equals(exhortDefaultUrl) + expect(selectedUrl).to.be.equals(exhortDevDefaultUrl) + }); + + test('When Dev Mode environment Variable= true, And option DEV_EXHORT_BACKEND_URL contains some url route that client set , default DEV Exhort Backend Not Selected ', () => { + const dummyRoute = "http://dummy-exhort-route"; + let testOpts = { + "DEV_EXHORT_BACKEND_URL" : dummyRoute + } + let selectedUrl = testSelectExhortBackend(testOpts); + expect(selectedUrl).not.to.be.equals(exhortDevDefaultUrl) + expect(selectedUrl).to.be.equals(dummyRoute) + }); + +}).beforeAll(() => process.env["EXHORT_DEV_MODE"] = "true" ).afterAll(() => delete process.env['EXHORT_DEV_MODE']); + +suite('testing Select Exhort Backend function when EXHORT_DEV_MODE environment variable is false', () => { + + test('When Dev Mode environment Variable= true, default DEV Exhort Backend Selected ', () => { + + let testOpts = { + "EXHORT_DEV_MODE" : "false" + } + let selectedUrl = testSelectExhortBackend(testOpts); + expect(selectedUrl).not.to.be.equals(exhortDevDefaultUrl) + expect(selectedUrl).to.be.equals(exhortDefaultUrl) + }); + + test('When Dev Mode environment Variable= false, and despite option Dev Mode = true , default Exhort Backend Selected (production) ', () => { + let dummyRoute = "http://dummy-dev-route-exhirt" + let testOpts = { + "EXHORT_DEV_MODE" : "true", + "DEV_EXHORT_BACKEND_URL" : dummyRoute + } + let selectedUrl = testSelectExhortBackend(testOpts); + expect(selectedUrl).not.to.be.equals(dummyRoute) + expect(selectedUrl).to.be.equals(exhortDefaultUrl) + }); + + test('When Dev Mode environment Variable= false, environment variable DEV_EXHORT_BACKEND_URL=dummy-url , option EXHORT_DEV_MODE=true , default Exhort Backend Selected anyway ', () => { + const dummyRoute = "http://dummy-url" + process.env["DEV_EXHORT_BACKEND_URL"] = dummyRoute + let testOpts = { + "EXHORT_DEV_MODE" : "true", + "DEV_EXHORT_BACKEND_URL" : dummyRoute + } + let selectedUrl = testSelectExhortBackend(testOpts); + delete process.env["DEV_EXHORT_BACKEND_URL"] + expect(selectedUrl).not.to.be.equals(dummyRoute) + expect(selectedUrl).to.be.equals(exhortDefaultUrl) + }); + +}).beforeAll(() => process.env["EXHORT_DEV_MODE"] = "false" ).afterAll(() => delete process.env['EXHORT_DEV_MODE']); + +suite('testing Select Exhort Backend function when EXHORT_DEV_MODE environment variable is not set', () => { + + test('When Dev Mode Option = false, default Exhort Backend Selected (production)', () => { + + let testOpts = { + "EXHORT_DEV_MODE" : "false" + } + let selectedUrl = testSelectExhortBackend(testOpts); + expect(selectedUrl).not.to.be.equals(exhortDevDefaultUrl) + expect(selectedUrl).to.be.equals(exhortDefaultUrl) + }); + + test('When Dev Mode Option Variable= true, default dev Exhort Backend Selected ', () => { + let testOpts = { + "EXHORT_DEV_MODE" : "true" + } + let selectedUrl = testSelectExhortBackend(testOpts); + expect(selectedUrl).not.to.be.equals(exhortDefaultUrl) + expect(selectedUrl).to.be.equals(exhortDevDefaultUrl) + }); + + test('When Dev Mode option = true, option DEV_EXHORT_BACKEND_URL=some dummy-url , then some dummy-url Selected ', () => { + let dummyRoute = "http://dummy-dev-route-exhirt" + process.env["DEV_EXHORT_BACKEND_URL"] = dummyRoute + let testOpts = { + "EXHORT_DEV_MODE" : "true", + "DEV_EXHORT_BACKEND_URL" : dummyRoute + } + let selectedUrl = testSelectExhortBackend(testOpts); + expect(selectedUrl).not.to.be.equals(exhortDefaultUrl) + expect(selectedUrl).to.be.equals(dummyRoute) + delete process.env["DEV_EXHORT_BACKEND_URL"] + }); + + test('When Nothing set, Choose default backend (production) ', () => { + let selectedUrl = testSelectExhortBackend({}); + expect(selectedUrl).to.be.equals(exhortDefaultUrl) + }); + + +}); +