| 1 | import type { FlaskBaseResponse } from "@/types/flask.d" |
| 2 | import type { NucleiReport, ScanHostPayload } from "@/types/webVulnerabilityAssessment.d" |
| 3 | import { HttpClient } from "../httpClient" |
| 4 | |
| 5 | export default { |
| 6 | getAllReports() { |
| 7 | return HttpClient.get<FlaskBaseResponse & { reports: NucleiReport[] }>(`/nuclei/all_reports`) |
| 8 | }, |
| 9 | getReport(host: string, reportPage: string) { |
| 10 | return HttpClient.get<FlaskBaseResponse & { markdown: string }>(`/nuclei/report/${host}/${reportPage}`) |
| 11 | }, |
| 12 | scan(payload: ScanHostPayload) { |
| 13 | return HttpClient.post<FlaskBaseResponse>(`/nuclei/scan`, payload) |
| 14 | }, |
| 15 | deleteReport(host: string) { |
| 16 | return HttpClient.delete<FlaskBaseResponse>(`/nuclei/delete_report/${host}`) |
| 17 | } |
| 18 | } |