import { Logger } from "../common/Logger";
export {};
import { Alert, AlertsData } from '../common/models/Alert';
import { EventEmitter } from "events";
import { Core } from "../Core";
import { AlertDevice, AlertDevicesData } from "../common/models/AlertDevice";
import { AlertTemplate, AlertTemplatesData } from "../common/models/AlertTemplate";
import { AlertFilter, AlertFiltersData } from "../common/models/AlertFilter";
import { GenericService } from "./GenericService";
declare class AlertsService extends GenericService {
    private _alertEventHandler;
    private _alertHandlerToken;
    private readonly delayToSendReceiptReceived;
    private readonly delayToSendReceiptRead;
    private delayInfoLoggued;
    static getClassName(): string;
    getClassName(): string;
    static getAccessorName(): string;
    getAccessorName(): string;
    constructor(_core: Core, _eventEmitter: EventEmitter, logger: Logger, _startConfig: {
        start_up: boolean;
        optional: boolean;
    });
    start(_options: any): Promise<void>;
    stop(): Promise<void>;
    init(useRestAtStartup: boolean): Promise<void>;
    private attachHandlers;
    reconnect(): Promise<void>;
    /**
     * @private
     * @method markAlertMessageAsReceived
     * @instance
     * @async
     * @category Mark as Received / Read
     * @param {string} jid The Jid of the sender</param>
     * @param {string} messageXmppId the Xmpp Id of the alert message</param>
     * @description
     *    Mark as Received the specified alert message   <br>
     * @return {Promise<any>} the result of the operation.
     */
    markAlertMessageAsReceived(jid: string, messageXmppId: string): Promise<any>;
    /**
     * @public
     * @nodered true
     * @method markAlertMessageAsRead
     * @instance
     * @async
     * @category Mark as Received / Read
     * @param {string} jid The Jid of the sender
     * @param {string} messageXmppId the Xmpp Id of the alert message
     * @description
     *    Mark as Read the specified alert message   <br>
     * @return {Promise<any>} the result of the operation.
     */
    markAlertMessageAsRead(jid: string, messageXmppId: string): Promise<any>;
    /**
     * @public
     * @nodered true
     * @method createDevice
     * @instance
     * @async
     * @category DEVICE
     * @param {AlertDevice} device Device to create.
     * @description
     *    Create a device which can receive Alerts(notifications) from the server   <br>
     *    AlertDevice.jid_im cannot be specified, it's always the Jid of the current user. <br>
     *    if AlertDevice.jid_resource cannot be specified, it's always the Jid_resource of the current user. <br>
     *    if AlertDevice.type is not specified, automatically it's set to "desktop" <br>
     * @return {Promise<AlertDevice>} the result of the operation.
     */
    createDevice(device: AlertDevice): Promise<AlertDevice>;
    /**
     * @public
     * @nodered true
     * @method updateDevice
     * @instance
     * @async
     * @category DEVICE
     * @param {AlertDevice} device Device to Update.
     * @description
     *    Update a device which can receive Alerts(notifications) from the server <br>
     *    AlertDevice.CompanyId cannot be specified, it's always the Compnay of the current user <br>
     *    AlertDevice.Jid_im cannot be specified, it's always the Jid of the current user: Contacts.GetCurrentContactJid() <br>
     *    AlertDevice.Jid_resource cannot be specified, it's always the Jid_resource of the current user: Application.GetResourceId() <br>
     *    if AlertDevice.Type is not specified, automatically it's set to "desktop"     <br>
     * @return {Promise<AlertDevice>} the result of the operation.   <br>
     */
    updateDevice(device: AlertDevice): Promise<AlertDevice>;
    private createOrUpdateDevice;
    /**
     * @public
     * @nodered true
     * @method deleteDevice
     * @instance
     * @async
     * @category DEVICE
     * @param {AlertDevice} device Device to delete.
     * @description
     *    Delete a device (using its id) <br>
     * @return {Promise<AlertDevice>} the result of the operation.
     */
    deleteDevice(device: AlertDevice): Promise<AlertDevice>;
    /**
     * @public
     * @nodered true
     * @method getDevice
     * @instance
     * @async
     * @category DEVICE
     * @param {string} deviceId Id of the device.
     * @description
     *    Get a device using its Id <br>
     * @return {Promise<AlertDevice>} the result of the operation.
     */
    getDevice(deviceId: string): Promise<AlertDevice>;
    /**
     * @public
     * @nodered true
     * @method getDevices
     * @instance
     * @async
     * @category DEVICE
     * @param {string} companyId Allows to filter device list on the companyId provided in this option. (optional) If companyId is not provided, the devices linked to all the companies that the administrator manage are returned.
     * @param {string} userId Allows to filter device list on the userId provided in this option. (optional) If the user has no admin rights, this filter is forced to the logged in user's id (i.e. the user can only list is own devices).
     * @param {string} deviceName Allows to filter device list on the name provided in this option. (optional) The filtering is case insensitive and on partial name match: all devices containing the provided name value will be returned(whatever the position of the match). Ex: if filtering is done on My, devices with the following names are match the filter 'My device', 'My phone', 'This is my device', ...
     * @param {string} type Allows to filter device list on the type provided in this option. (optional, exact match, case sensitive).
     * @param {string} tag Allows to filter device list on the tag provided in this option. (optional, exact match, case sensitive).
     * @param {number} offset=0 Allow to specify the position of first device to retrieve (default value is 0 for the first device). Warning: if offset > total, no results are returned.
     * @param {number} limit=100 Allow to specify the number of devices to retrieve.
     * @description
     *    Get list of devices   <br>
     * @return {Promise<AlertDevicesData>} the result of the operation.
     */
    getDevices(companyId: string, userId: string, deviceName: string, type: string, tag: string, offset?: number, limit?: number): Promise<AlertDevicesData>;
    /**
     * @public
     * @nodered true
     * @method getDevicesTags
     * @instance
     * @async
     * @category DEVICE
     * @param {string} companyId Allows to list the tags set for devices associated to the companyIds provided in this option. (optional) If companyId is not provided, the tags being set for devices linked to all the companies that the administrator manage are returned.
     * @description
     *    Get list of all tags being assigned to devices of the compagnies managed by the administrator <br>
     * @return {Promise<any>} the result of the operation.
     */
    getDevicesTags(companyId: string): Promise<any>;
    /**
     * @public
     * @nodered true
     * @method renameDevicesTags
     * @instance
     * @async
     * @category DEVICE
     * @param {string} tag 	tag to rename.
     * @param {string} companyId Allows to rename a tag for the devices being in the companyIds provided in this option. <br>
     * If companyId is not provided, the tag is renamed for all the devices linked to all the companies that the administrator manage.
     * @param {string} newTagName New tag name. (Body Parameters)
     * @description
     * This API can be used to rename a tag being assigned to some devices of the companies managed by the administrator.
     * @return {Promise<any>} the result of the operation.
     */
    renameDevicesTags(newTagName: string, tag: string, companyId: string): Promise<any>;
    /**
     * @public
     * @nodered true
     * @method deleteDevicesTags
     * @instance
     * @async
     * @category DEVICE
     * @param {string} tag 	tag to rename.
     * @param {string} companyId Allows to remove a tag from the devices being in the companyIds provided in this option.. <br>
     * If companyId is not provided, the tag is deleted from all the devices linked to all the companies that the administrator manage.
     * @description
     * This API can be used to remove a tag being assigned to some devices of the companies managed by the administrator.
     * @return {Promise<any>} the result of the operation.
     */
    deleteDevicesTags(tag: string, companyId: string): Promise<any>;
    /**
     * @public
     * @nodered true
     * @method getstatsTags
     * @instance
     * @async
     * @category DEVICE
     * @param {string} companyId Allows to compute the tags statistics for the devices associated to the companyIds provided in this option.  <br>
     * if companyId is not provided, the tags statistics are computed for all the devices being in all the companies managed by the logged in administrator.
     * @description
     * This API can be used to list all the tags being assigned to the devices of the companies managed by the administrator, with the number of devices for each tags.
     * @return {Promise<any>} the result of the operation.
     */
    getstatsTags(companyId: string): Promise<any>;
    /**
     * @public
     * @nodered true
     * @method createTemplate
     * @instance
     * @async
     * @category TEMPLATE
     * @param {AlertTemplate} template Template to create.
     * @description
     *    Create a template <br>
     * @return {Promise<AlertTemplate>} the result of the operation.
     */
    createTemplate(template: AlertTemplate): Promise<AlertTemplate>;
    /**
     * @public
     * @nodered true
     * @method updateTemplate
     * @instance
     * @async
     * @category TEMPLATE
     * @param {AlertTemplate} template Template to Update.
     * @description
     *    Update a template  <br>
     * @return {Promise<AlertTemplate>} the result of the operation.
     */
    updateTemplate(template: AlertTemplate): Promise<AlertTemplate>;
    private createOrUpdateTemplate;
    /**
     * @public
     * @nodered true
     * @method deleteTemplate
     * @instance
     * @async
     * @category TEMPLATE
     * @param {AlertTemplate} template Template to Delete.
     * @description
     *    Delete a template <br>
     * @return {Promise<AlertTemplate>} the result of the operation.
     */
    deleteTemplate(template: AlertTemplate): Promise<AlertTemplate>;
    /**
     * @public
     * @nodered true
     * @method getTemplate
     * @instance
     * @async
     * @category TEMPLATE
     * @param {string} templateId Id of the template.
     * @description
     *    Get an template by id <br>
     * @return {Promise<AlertTemplate>} the result of the operation.
     */
    getTemplate(templateId: string): Promise<AlertTemplate>;
    /**
     * @public
     * @nodered true
     * @method getTemplates
     * @instance
     * @async
     * @category TEMPLATE
     * @param {string} companyId Id of the company (optional).
     * @param {number} offset=0 Offset to use to retrieve templates - if offset > total, no result is returned.
     * @param {number} limit=100 Limit of templates to retrieve (100 by default).
     * @description
     *    Get templates <br>
     * @return {Promise<AlertTemplatesData>} the result of the operation.
     */
    getTemplates(companyId: string, offset?: number, limit?: number): Promise<AlertTemplatesData>;
    /**
     * @public
     * @nodered true
     * @method createFilter
     * @instance
     * @async
     * @category FILTERS
     * @param {AlertFilter} filter Filter to create.
     * @description
     *    Create a filter <br>
     * @return {Promise<AlertFilter>} the result of the operation.
     */
    createFilter(filter: AlertFilter): Promise<AlertFilter>;
    /**
     * @public
     * @method updateFilter
     * @instance
     * @async
     * @category FILTERS
     * @param {AlertFilter} filter Filter to Update.
     * @description
     *    Update a filter <br>
     * @return {Promise<AlertFilter>} the result of the operation.
     */
    updateFilter(filter: AlertFilter): Promise<AlertFilter>;
    createOrUpdateFilter(create: boolean, filter: AlertFilter): Promise<AlertFilter>;
    /**
     * @public
     * @nodered true
     * @method deleteFilter
     * @instance
     * @async
     * @category FILTERS
     * @param {AlertFilter} filter Filter to Delete.
     * @description
     *    Delete a filter <br>
     * @return {Promise<AlertFilter>} the result of the operation.
     */
    deleteFilter(filter: AlertFilter): Promise<AlertFilter>;
    /**
     * @public
     * @nodered true
     * @method getFilter
     * @instance
     * @async
     * @category FILTERS
     * @param {string} filterId Id of the Filter.
     * @description
     *    Get an filter by id <br>
     * @return {Promise<AlertFilter>} the result of the operation.
     */
    getFilter(filterId: string): Promise<AlertFilter>;
    /**
     * @public
     * @nodered true
     * @method getFilters
     * @instance
     * @async
     * @category FILTERS
     * @param {number} offset=0 Offset to use to retrieve filters - if offset > total, no result is returned.
     * @param {number} limit=100 Limit of filters to retrieve (100 by default).
     * @description
     *    Get filters : have required role(s) superadmin, admin <br>
     * @return {Promise<AlertFiltersData>} the result of the operation.
     */
    getFilters(offset?: number, limit?: number): Promise<AlertFiltersData>;
    /**
     * @public
     * @nodered true
     * @method createAlert
     * @instance
     * @async
     * @category CREATE / UPDATE / DELETE / GET / FEEDBACK ALERTS
     * @param {Alert} alert Alert to send.
     * @description
     *    To create an alert. The alert will be sent using the StartDate of the Alert object (so it's possible to set it in future). <br>
     *    The alert will be received by devices according the filter id and the company id used.   <br>
     *    The content of the alert is based on the template id.   <br>
     * @return {Promise<Alert>} the result of the operation.
     */
    createAlert(alert: Alert): Promise<Alert>;
    /**
     * @public
     * @nodered true
     * @method updateAlert
     * @instance
     * @async
     * @category CREATE / UPDATE / DELETE / GET / FEEDBACK ALERTS
     * @param {Alert} alert Alert to update.
     * @description
     *    To update an existing alert. The alert will be sent using the StartDate of the Alert object (so it's possible to set it in future). <br>
     *    The alert will be received by devices according the filter id and the company id used.   <br>
     *    The content of the alert is based on the template id.   <br>
     *    Note : if no expirationDate is provided, then the validity is one day from the API call. <br>
     * @return {Promise<Alert>} the result of the operation.
     
     */
    updateAlert(alert: Alert): Promise<Alert>;
    createOrUpdateAlert(create: boolean, alert: Alert): Promise<Alert>;
    /**
     * @public
     * @nodered true
     * @method deleteAlert
     * @instance
     * @async
     * @category CREATE / UPDATE / DELETE / GET / FEEDBACK ALERTS
     * @param {Alert} alert Alert to Delete.
     * @description
     *    Delete an alert   <br>
     *    All the data related to this notification are deleted, including the reports <br>
     * @return {Promise<Alert>} the result of the operation.
     */
    deleteAlert(alert: Alert): Promise<Alert>;
    /**
     * @public
     * @nodered true
     * @method getAlert
     * @instance
     * @async
     * @category CREATE / UPDATE / DELETE / GET / FEEDBACK ALERTS
     * @param {string} alertId Id of the alert.
     * @description
     *    Get an alert by id <br>
     * @return {Promise<Alert>} the result of the operation.
     */
    getAlert(alertId: string): Promise<Alert>;
    /**
     * @public
     * @nodered true
     * @method getAlerts
     * @instance
     * @async
     * @category CREATE / UPDATE / DELETE / GET / FEEDBACK ALERTS
     * @param {number} offset=0 Offset to use to retrieve Alerts - if offset > total, no result is returned.
     * @param {number} limit=100 Limit of Alerts to retrieve (100 by default).
     * @description
     *    Get alerts : required role(s) superadmin,support,admin <br>
     * @return {Promise<AlertsData>} the result of the operation.
     */
    getAlerts(offset?: number, limit?: number): Promise<AlertsData>;
    /**
     * @public
     * @nodered true
     * @method sendAlertFeedback
     * @instance
     * @async
     * @category CREATE / UPDATE / DELETE / GET / FEEDBACK ALERTS
     * @param {string} deviceId Id of the device.
     * @param {string} alertId Id of the alert.
     * @param {string} answerId Id of the answer.
     * @description
     *    To send a feedback from an alert.   <br>
     *    To be used by end-user who has received the alert   <br>
     * @return {Promise<any>} the result of the operation.
     */
    sendAlertFeedback(deviceId: string, alertId: string, answerId: string): Promise<any>;
    /**
     * @public
     * @nodered true
     * @method getAlertFeedbackSentForANotificationMessage
     * @instance
     * @async
     * @category CREATE / UPDATE / DELETE / GET / FEEDBACK ALERTS
     * @param {string} notificationHistoryId notification history unique identifier. notificationHistoryId corresponds to the id in the history Array of the messages sent for the related notification..
     * @description
     *    This API allows to list the feedback sent by the devices for a given notification message (identified by its notification history's id). <br>
     * @return {Promise<any>} the result of the operation.
     * {
     * fromCreationDate optionnel 	Date-Time Allows to filter feedback submitted from provided date (ISO 8601 format). <br>
     * toCreationDate optionnel 	Date-Time Allows to filter feedback submitted until provided date (ISO 8601 format). <br>
     * format optionnel 	String Allows to retrieve more or less feedback details in response. <br>
     * - small: id notificationId notificationHistoryId device.id creationDate <br>
     * - medium: id notificationId notificationHistoryId device.id device.name creationDate data <br>
     * - full: id notificationId companyId notificationHistoryId device.id device.name device.type device.userId device.jid_im device.jid_resource creationDate data (default value : small. Possible values : small, medium, full) <br>
     * limit optionnel 	Number Allow to specify the number of feedback to retrieve. (default value : 100) <br>
     * offset optionnel 	Number Allow to specify the position of first feedback to retrieve (first feedback if not specified). Warning: if offset > total, no results are returned. (default value : 0) <br>
     * sortField optionnel 	String Sort feedback list based on the creationDate field (date when the feedback submitted by the device has been received by Rainbow servers). (default value : creationDate. Possible values : creationDate) <br>
     * sortOrder optionnel 	Number Specify order when sorting feedback list. (default value : 1. Possible values : -1, 1) <br>
     * }
     */
    getAlertFeedbackSentForANotificationMessage(notificationHistoryId: string): Promise<any>;
    /**
     * @public
     * @nodered true
     * @method getAlertFeedbackSentForAnAlert
     * @instance
     * @async
     * @category CREATE / UPDATE / DELETE / GET / FEEDBACK ALERTS
     * @param {string} alertId Id of the alert.
     * @description
     *    This API allows to list the feedback sent by the devices for a given notification. <br>
     * @return {Promise<any>} the result of the operation.
     * {
     * fromCreationDate optionnel 	Date-Time Allows to filter feedback submitted from provided date (ISO 8601 format). <br>
     * toCreationDate optionnel 	Date-Time Allows to filter feedback submitted until provided date (ISO 8601 format). <br>
     * format optionnel 	String Allows to retrieve more or less feedback details in response. <br>
     * - small: id notificationId notificationHistoryId device.id creationDate <br>
     * - medium: id notificationId notificationHistoryId device.id device.name creationDate data <br>
     * - full: id notificationId companyId notificationHistoryId device.id device.name device.type device.userId device.jid_im device.jid_resource creationDate data (default value : small. Possible values : small, medium, full) <br>
     * limit optionnel 	Number Allow to specify the number of feedback to retrieve. (default value : 100) <br>
     * offset optionnel 	Number Allow to specify the position of first feedback to retrieve (first feedback if not specified). Warning: if offset > total, no results are returned. (default value : 0) <br>
     * sortField optionnel 	String Sort feedback list based on the creationDate field (date when the feedback submitted by the device has been received by Rainbow servers). (default value : creationDate. Possible values : creationDate) <br>
     * sortOrder optionnel 	Number Specify order when sorting feedback list. (default value : 1. Possible values : -1, 1) <br>
     * }
     */
    getAlertFeedbackSentForAnAlert(alertId: string): Promise<any>;
    /**
     * @public
     * @nodered true
     * @method getAlertStatsFeedbackSentForANotificationMessage
     * @instance
     * @async
     * @category CREATE / UPDATE / DELETE / GET / FEEDBACK ALERTS
     * @param {string} notificationHistoryId notification history unique identifier. notificationHistoryId corresponds to the id in the history Array of the messages sent for the related notification.
     * @description
     *    This API can be used to list all distinct feedback data submitted by the devices for a given notification message (identified by its notification history's id), with the number of devices for each distinct submitted feedback data. <br>
     * @return {Promise<any>} the result of the operation.
     * {
     *   stats 	Object[] List of feedback data submitted by the devices for this given notification message <br>
     *      data 	String data submitted by the devices <br>
     *      count 	String Number of devices having submitted this given data <br>
     * }
     */
    getAlertStatsFeedbackSentForANotificationMessage(notificationHistoryId: string): Promise<any>;
    /**
     * @public
     * @nodered true
     * @method getReportSummary
     * @instance
     * @async
     * @category REPORTS
     * @param {string} alertId Id of the alert.
     * @description
     *    Allow to retrieve the list of summary reports of an alert (initial alert plus alerts update if any). <br>
     * @return {Promise<any>} the result of the operation.
     */
    getReportSummary(alertId: string): Promise<any>;
    /**
     * @public
     * @nodered true
     * @method getReportDetails
     * @instance
     * @async
     * @category REPORTS
     * @param {string} alertId Id of the alert.
     * @description
     *    Allow to retrieve detail the list of detail reports of a alert (initial alert plus alerts update if any). <br>
     * @return {Promise<any>} the result of the operation.
     */
    getReportDetails(alertId: string): Promise<any>;
    /**
     * @public
     * @nodered true
     * @method getReportComplete
     * @instance
     * @async
     * @category REPORTS
     * @param {string} alertId Id of the alert.
     * @description
     *    Allows to get the fileDescriptor storing the detailed CSV report of the notification. <br>
     * <br>
     *  The detailed CSV report is generated when one of the APIs getReportSummary or GET getReportDetails is called while the state of the notification message process has reached a final state: <br>
     * <br>
     *  completed: all the devices targeted by the notification have been notified and have acknowledged the reception of the message, <br>
     *  expired: some devices targeted by the notification haven't acknowledged the reception of the message but the notification expiration date has been reached, <br>
     *  cancelled: some devices targeted by the notification haven't acknowledged the reception of the message but the notification status has been set to terminated.<br>
     * <br>
     *  The generated detailed CSV report is stored in Rainbow filestorage backend. The fileDescriptor identifier returned by this API can then be used to download it using the Rainbow filestorage API GET /api/rainbow/fileserver/v1.0/files/:fileId <br>
     *  The detailed CSV report contains the following columns: <br>
     *  DeviceName,DeviceID,Domain_Username,IpAddress,MacAddress,sent,received,read,feedback,notificationId. <br>
     * @return {Promise<any>} the result of the operation.
     */
    getReportComplete(alertId: string): Promise<any>;
}
export { AlertsService };
