fase(5): findings module complete
Some checks failed
ABE Exploratory Testing / explore (push) Has been cancelled
Some checks failed
ABE Exploratory Testing / explore (push) Has been cancelled
This commit is contained in:
25
dist/modules/findings/domain/value-objects/Evidence.js
vendored
Normal file
25
dist/modules/findings/domain/value-objects/Evidence.js
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Evidence = void 0;
|
||||
const ValueObject_1 = require("../../../../shared/domain/ValueObject");
|
||||
class Evidence extends ValueObject_1.ValueObject {
|
||||
static create(props) {
|
||||
return new Evidence(props);
|
||||
}
|
||||
static empty() {
|
||||
return new Evidence({});
|
||||
}
|
||||
get screenshotPath() { return this.props.screenshotPath; }
|
||||
get domSnapshotPath() { return this.props.domSnapshotPath; }
|
||||
get httpLog() { return this.props.httpLog ?? []; }
|
||||
get rawErrors() { return this.props.rawErrors ?? []; }
|
||||
toJSON() {
|
||||
return {
|
||||
screenshotPath: this.props.screenshotPath,
|
||||
domSnapshotPath: this.props.domSnapshotPath,
|
||||
httpLog: this.props.httpLog,
|
||||
rawErrors: this.props.rawErrors,
|
||||
};
|
||||
}
|
||||
}
|
||||
exports.Evidence = Evidence;
|
||||
21
dist/modules/findings/domain/value-objects/FindingStatus.js
vendored
Normal file
21
dist/modules/findings/domain/value-objects/FindingStatus.js
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FindingStatus = void 0;
|
||||
const ValueObject_1 = require("../../../../shared/domain/ValueObject");
|
||||
class FindingStatus extends ValueObject_1.ValueObject {
|
||||
static open() { return new FindingStatus({ value: 'open' }); }
|
||||
static investigating() { return new FindingStatus({ value: 'investigating' }); }
|
||||
static resolved() { return new FindingStatus({ value: 'resolved' }); }
|
||||
static closed() { return new FindingStatus({ value: 'closed' }); }
|
||||
static fromString(s) {
|
||||
if (!FindingStatus.VALUES.includes(s)) {
|
||||
throw new Error(`Invalid finding status: ${s}`);
|
||||
}
|
||||
return new FindingStatus({ value: s });
|
||||
}
|
||||
get value() { return this.props.value; }
|
||||
isOpen() { return this.props.value === 'open'; }
|
||||
isResolved() { return this.props.value === 'resolved'; }
|
||||
}
|
||||
exports.FindingStatus = FindingStatus;
|
||||
FindingStatus.VALUES = ['open', 'investigating', 'resolved', 'closed'];
|
||||
32
dist/modules/findings/domain/value-objects/FindingType.js
vendored
Normal file
32
dist/modules/findings/domain/value-objects/FindingType.js
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FindingType = void 0;
|
||||
const ValueObject_1 = require("../../../../shared/domain/ValueObject");
|
||||
class FindingType extends ValueObject_1.ValueObject {
|
||||
static fromString(s) {
|
||||
if (!FindingType.TYPES.includes(s)) {
|
||||
throw new Error(`Invalid finding type: ${s}`);
|
||||
}
|
||||
return new FindingType({ value: s });
|
||||
}
|
||||
get value() { return this.props.value; }
|
||||
}
|
||||
exports.FindingType = FindingType;
|
||||
FindingType.TYPES = [
|
||||
'http_error',
|
||||
'js_exception',
|
||||
'console_error',
|
||||
'navigation_fail',
|
||||
'element_missing',
|
||||
'timeout',
|
||||
'validation_bypass',
|
||||
'server_error_on_fuzz',
|
||||
'xss_reflection',
|
||||
'visual_regression',
|
||||
'accessibility_violation',
|
||||
'mobile_layout_issue',
|
||||
'performance_degradation',
|
||||
'offline_handling_missing',
|
||||
'slow_network_no_feedback',
|
||||
'external_service_crash',
|
||||
];
|
||||
19
dist/modules/findings/domain/value-objects/Severity.js
vendored
Normal file
19
dist/modules/findings/domain/value-objects/Severity.js
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Severity = void 0;
|
||||
const ValueObject_1 = require("../../../../shared/domain/ValueObject");
|
||||
class Severity extends ValueObject_1.ValueObject {
|
||||
static low() { return new Severity({ value: 'low' }); }
|
||||
static medium() { return new Severity({ value: 'medium' }); }
|
||||
static high() { return new Severity({ value: 'high' }); }
|
||||
static critical() { return new Severity({ value: 'critical' }); }
|
||||
static fromString(s) {
|
||||
if (!Severity.LEVELS.includes(s)) {
|
||||
throw new Error(`Invalid severity: ${s}`);
|
||||
}
|
||||
return new Severity({ value: s });
|
||||
}
|
||||
get value() { return this.props.value; }
|
||||
}
|
||||
exports.Severity = Severity;
|
||||
Severity.LEVELS = ['low', 'medium', 'high', 'critical'];
|
||||
Reference in New Issue
Block a user