@sailboat-computer/event-bus
Version:
Standardized event bus for sailboat computer v3 with resilience features and offline capabilities
68 lines • 2.06 kB
JavaScript
;
/**
* Event bus types
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.AlertType = exports.AlertSeverityMapping = exports.common = exports.AlertSeverity = exports.EventCategory = exports.EventPriority = void 0;
const sailboat_types_1 = require("@sailboat-computer/sailboat-types");
Object.defineProperty(exports, "common", { enumerable: true, get: function () { return sailboat_types_1.common; } });
// Define constants for the string literal types
const EventPriority = {
LOW: 'event_low',
NORMAL: 'event_normal',
HIGH: 'event_high',
CRITICAL: 'event_critical'
};
exports.EventPriority = EventPriority;
const EventCategory = {
DATA: 'category_data',
ALERT: 'category_alert',
CONFIGURATION: 'category_configuration',
SYSTEM: 'category_system',
USER_ACTION: 'category_user_action'
};
exports.EventCategory = EventCategory;
const AlertSeverity = {
INFO: 'system_info',
WARNING: 'system_warning',
ALARM: 'system_alarm',
CRITICAL: 'system_critical',
EMERGENCY: 'system_emergency'
};
exports.AlertSeverity = AlertSeverity;
/**
* Mapping between our severity levels and common-types AlertSeverity
*/
exports.AlertSeverityMapping = {
INFO: AlertSeverity.INFO,
WARNING: AlertSeverity.WARNING,
ERROR: AlertSeverity.ALARM,
CRITICAL: AlertSeverity.CRITICAL
};
/**
* Alert types
*/
var AlertType;
(function (AlertType) {
/**
* Failed publishes alert
*/
AlertType["FAILED_PUBLISHES"] = "failed_publishes";
/**
* Dead letter queue size alert
*/
AlertType["DEAD_LETTER_QUEUE_SIZE"] = "dead_letter_queue_size";
/**
* Reconnection attempts alert
*/
AlertType["RECONNECTION_ATTEMPTS"] = "reconnection_attempts";
/**
* Processing time alert
*/
AlertType["PROCESSING_TIME"] = "processing_time";
/**
* Connection status alert
*/
AlertType["CONNECTION_STATUS"] = "connection_status";
})(AlertType || (exports.AlertType = AlertType = {}));
//# sourceMappingURL=types.js.map