@contrast/reporter
Advanced tools
Comparing version 1.23.2 to 1.24.0
@@ -6,5 +6,8 @@ import BaseReporter, { Core } from './reporters/base'; | ||
} | ||
export interface ReporterOptions { | ||
reporters: string[]; | ||
} | ||
export default function init(core: Core & { | ||
reporter: ReporterBus; | ||
}): ReporterBus; | ||
}, options?: ReporterOptions): ReporterBus; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -23,3 +23,6 @@ "use strict"; | ||
const security_logger_1 = __importDefault(require("./reporters/security-logger")); | ||
function init(core) { | ||
const DEFAULT_OPTIONS = { | ||
reporters: ['sec', 'ui', 'file'], | ||
}; | ||
function init(core, options = DEFAULT_OPTIONS) { | ||
const { logger } = core; | ||
@@ -35,11 +38,11 @@ const reporters = []; | ||
}; | ||
if (core.config.agent.reporters.file) { | ||
if (core.config.agent.reporters.file && options.reporters.includes('file')) { | ||
logger.trace('enabling file reporter'); | ||
reporters.push(new file_1.default(core)); | ||
} | ||
if (core.config.api.enable) { | ||
if (core.config.api.enable && options.reporters.includes('ui')) { | ||
logger.trace('enabling Contrast UI reporter'); | ||
reporters.push(new contrast_ui_1.default(core)); | ||
} | ||
if (core.config.protect.enable) { | ||
if (core.config.protect.enable && options.reporters.includes('sec')) { | ||
logger.trace('enabling security logger'); | ||
@@ -46,0 +49,0 @@ reporters.push(new security_logger_1.default(core)); |
{ | ||
"name": "@contrast/reporter", | ||
"version": "1.23.2", | ||
"version": "1.24.0", | ||
"description": "Subscribes to agent messages and reports them", | ||
@@ -21,3 +21,3 @@ "license": "SEE LICENSE IN LICENSE", | ||
"dependencies": { | ||
"@contrast/common": "1.17.0", | ||
"@contrast/common": "1.18.0", | ||
"axios": "^1.6.5", | ||
@@ -24,0 +24,0 @@ "crc-32": "^1.2.2", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
208632
2898
+ Added@contrast/common@1.18.0(transitive)
- Removed@contrast/common@1.17.0(transitive)
Updated@contrast/common@1.18.0