UNPKG

@meshwatch/backend-core

Version:

Meshwatch backend core services.

42 lines (41 loc) 2.28 kB
import { CreateAlertDTO } from '@meshwatch/types'; import { DynamoDBClient } from '../../shared'; import BaseService, { ServiceResponse } from '../../shared/services'; export declare const ALERT_ANY_MONITOR_SCHEDULER = "alert-any-monitor"; export declare class AlertService extends BaseService { private alertDatasource; private monitorDatasource; constructor(dynamoClient?: DynamoDBClient); listAlerts: (userId: string) => Promise<ServiceResponse<import("@meshwatch/types/dist/common").WithCreated<CreateAlertDTO & { scheduler: string; } & { id: string; }>[] | import("@meshwatch/types").Boom<import("../../shared/validation/types").FormErrors<undefined>>>>; deleteAlert: (userId: string, alertId: string) => Promise<ServiceResponse<import("@meshwatch/types/dist/common").WithCreated<CreateAlertDTO & { scheduler: string; } & { id: string; }> | import("@meshwatch/types").Boom<import("../../shared/validation/types").FormErrors<import("@meshwatch/types/dist/common").WithCreated<CreateAlertDTO & { scheduler: string; } & { id: string; }>>>>>; updateAlert: (userId: string, alertId: string, payload: CreateAlertDTO) => Promise<ServiceResponse<import("@meshwatch/types/dist/common").WithCreated<CreateAlertDTO & { scheduler: string; } & { id: string; }> | import("@meshwatch/types").Boom<import("../../shared/validation/types").FormErrors<import("@meshwatch/types/dist/common").WithCreated<CreateAlertDTO & { scheduler: string; } & { id: string; }>>>> | ServiceResponse<import("@meshwatch/types").Boom<import("../../shared/validation/types").FormErrors<import("../../shared/validation/types").FormErrors<CreateAlertDTO>>>>>; createAlert: (userId: string, payload: CreateAlertDTO) => Promise<ServiceResponse<import("@meshwatch/types/dist/common").WithCreated<CreateAlertDTO & { scheduler: string; } & { id: string; }> | import("@meshwatch/types").Boom<import("../../shared/validation/types").FormErrors<CreateAlertDTO>>>>; private getAlertById; private getSchedulerByMonitorIdentifier; } declare const alertService: AlertService; export default alertService;