UNPKG

@message-queue-toolkit/core

Version:

Useful utilities, interfaces and base classes for message queue handling. Supports AMQP and SQS with a common abstraction on top currently

24 lines 900 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.EventRegistry = void 0; class EventRegistry { supportedEvents; supportedEventTypes; supportedEventMap = {}; constructor(supportedEvents) { this.supportedEvents = supportedEvents; this.supportedEventTypes = new Set(); for (const supportedEvent of supportedEvents) { this.supportedEventMap[supportedEvent.consumerSchema.shape.type.value] = supportedEvent; this.supportedEventTypes.add(supportedEvent.consumerSchema.shape.type.value); } } getEventDefinitionByTypeName = (eventTypeName) => { return this.supportedEventMap[eventTypeName]; }; isSupportedEvent(eventTypeName) { return this.supportedEventTypes.has(eventTypeName); } } exports.EventRegistry = EventRegistry; //# sourceMappingURL=EventRegistry.js.map