From 4a3d65f99f4b01749568b2894bae566ed239b076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Thu, 2 Jul 2026 11:04:46 +0200 Subject: [PATCH] Change: Allow Filter instances for ReportCommand params too Passing a Filter instance besides a filter string is possible to for all filter params in the ReportCommand. --- src/gmp/commands/report.ts | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/gmp/commands/report.ts b/src/gmp/commands/report.ts index 218e6606ee..45be70e1fe 100644 --- a/src/gmp/commands/report.ts +++ b/src/gmp/commands/report.ts @@ -19,25 +19,20 @@ interface ReportCommandImportParams { xml_file?: string; } -interface ReportCommandAddAssetsParams { +interface ReportCommandAssetsParams { id: string; - filter?: string; -} - -interface ReportCommandARemoveAssetsParams { - id: string; - filter?: string; + filter?: Filter | string; } interface ReportCommandAlertParams { alert_id: string; report_id: string; - filter: string; + filter?: Filter | string; } interface ReportCommandGetParams { id?: string; - filter?: string; + filter?: Filter | string; details?: boolean; ignorePagination?: boolean; lean?: boolean; @@ -97,7 +92,7 @@ class ReportCommand extends EntityCommand { }); } - addAssets({id, filter = ''}: ReportCommandAddAssetsParams) { + addAssets({id, filter = ''}: ReportCommandAssetsParams) { return this.httpPostWithTransform({ cmd: 'create_asset', report_id: id, @@ -105,7 +100,7 @@ class ReportCommand extends EntityCommand { }); } - removeAssets({id, filter = ''}: ReportCommandARemoveAssetsParams) { + removeAssets({id, filter = ''}: ReportCommandAssetsParams) { return this.httpPostWithTransform({ cmd: 'delete_asset', report_id: id, @@ -131,7 +126,11 @@ class ReportCommand extends EntityCommand { filter, details = true, ...options - }: {filter?: string; details?: boolean; [key: string]: unknown} = {}, + }: { + filter?: Filter | string; + details?: boolean; + [key: string]: unknown; + } = {}, ) { const response = await this.httpGetWithTransform( {