diff --git a/striker-ui-api/src/lib/request_handlers/mail-server/execManageAlerts.ts b/striker-ui-api/src/lib/execManageAlerts.ts similarity index 78% rename from striker-ui-api/src/lib/request_handlers/mail-server/execManageAlerts.ts rename to striker-ui-api/src/lib/execManageAlerts.ts index a611530e..a393d8a7 100644 --- a/striker-ui-api/src/lib/request_handlers/mail-server/execManageAlerts.ts +++ b/striker-ui-api/src/lib/execManageAlerts.ts @@ -1,12 +1,17 @@ import assert from 'assert'; import { spawnSync } from 'child_process'; -import { SERVER_PATHS } from '../../consts'; +import { SERVER_PATHS } from './consts'; -import { stdoutVar } from '../../shell'; +import { stdoutVar } from './shell'; const MAP_TO_FLAG_BUNDLE = { - 'alert-overrides': {}, + 'alert-overrides': { + '--alert-override-alert-level': 'level', + '--alert-override-host-uuid': 'hostUuid', + '--alert-override-recipient-uuid': 'recipientUuid', + '--alert-override-uuid': 'uuid', + }, 'mail-servers': { '--mail-server-address': 'address', '--mail-server-authentication': 'authentication', @@ -17,7 +22,13 @@ const MAP_TO_FLAG_BUNDLE = { '--mail-server-username': 'username', '--mail-server-uuid': 'uuid', }, - recipients: {}, + recipients: { + '--recipient-email': 'email', + '--recipient-language': 'language', + '--recipient-level': 'level', + '--recipient-name': 'name', + '--recipient-uuid': 'uuid', + }, }; export const execManageAlerts = ( diff --git a/striker-ui-api/src/lib/request_handlers/mail-server/createMailServer.ts b/striker-ui-api/src/lib/request_handlers/mail-server/createMailServer.ts index 3b9d80f9..b122a6c8 100644 --- a/striker-ui-api/src/lib/request_handlers/mail-server/createMailServer.ts +++ b/striker-ui-api/src/lib/request_handlers/mail-server/createMailServer.ts @@ -1,6 +1,6 @@ import { RequestHandler } from 'express'; -import { execManageAlerts } from './execManageAlerts'; +import { execManageAlerts } from '../../execManageAlerts'; import { getMailServerRequestBody } from './getMailServerRequestBody'; import { stderr, stdout } from '../../shell'; diff --git a/striker-ui-api/src/lib/request_handlers/mail-server/deleteMailServer.ts b/striker-ui-api/src/lib/request_handlers/mail-server/deleteMailServer.ts index dd552ff3..4323b7c3 100644 --- a/striker-ui-api/src/lib/request_handlers/mail-server/deleteMailServer.ts +++ b/striker-ui-api/src/lib/request_handlers/mail-server/deleteMailServer.ts @@ -1,6 +1,6 @@ import { RequestHandler } from 'express'; -import { execManageAlerts } from './execManageAlerts'; +import { execManageAlerts } from '../../execManageAlerts'; import { stderr } from '../../shell'; export const deleteMailServer: RequestHandler = ( diff --git a/striker-ui-api/src/lib/request_handlers/mail-server/updateMailServer.ts b/striker-ui-api/src/lib/request_handlers/mail-server/updateMailServer.ts index c45bd8cf..0c8cf858 100644 --- a/striker-ui-api/src/lib/request_handlers/mail-server/updateMailServer.ts +++ b/striker-ui-api/src/lib/request_handlers/mail-server/updateMailServer.ts @@ -3,7 +3,7 @@ import { RequestHandler } from 'express'; import { REP_UUID } from '../../consts'; -import { execManageAlerts } from './execManageAlerts'; +import { execManageAlerts } from '../../execManageAlerts'; import { getMailServerRequestBody } from './getMailServerRequestBody'; import { stderr, stdout } from '../../shell';