@gabliam/amqp
Version:
amqp plugin for gabliam
13 lines (12 loc) • 986 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.RabbitConsumer = exports.RabbitListener = exports.RabbitController = void 0;
/* eslint-disable @typescript-eslint/no-redeclare */
const core_1 = require("@gabliam/core");
const constants_1 = require("../constants");
exports.RabbitController = (0, core_1.makeDecorator)(constants_1.METADATA_KEY.RabbitController, undefined, (cls) => {
(0, core_1.injectable)()(cls);
(0, core_1.Register)({ type: constants_1.TYPE.RabbitController, id: cls })(cls);
}, true, constants_1.ERRORS_MSGS.DUPLICATED_CONTROLLER_DECORATOR);
exports.RabbitListener = (0, core_1.makePropDecorator)(constants_1.METADATA_KEY.RabbitHandler, (queue, options) => (Object.assign(Object.assign({ queue }, options), { type: 'Listener' })));
exports.RabbitConsumer = (0, core_1.makePropDecorator)(constants_1.METADATA_KEY.RabbitHandler, (queue, options) => (Object.assign(Object.assign({ queue }, options), { type: 'Consumer' })));