nope/modules/mod-MQTT-Interface/assembly/manual-assembly.ts
2020-09-08 16:59:06 +02:00

74 lines
1.9 KiB
TypeScript

/**
* @author Martin Karkowski
* @email m.karkowski@zema.de
* @create date 2018-06-11 01:49:04
* @modify date 2020-09-08 16:26:47
* @desc [description]
*/
import * as mqtt from 'mqtt';
import { IModuleDescription } from '../../mod-Assembly-Builder/type/interfaces';
import { ITopicMatcher } from '../../mod-Publish-And-Subscribe-System/type/interfaces';
import { MQTTConverter } from '../src/mqtt-converter';
import { ExternalMQTTServerWithConverter } from '../src/mqtt-interface-with-converter';
import { MQTTMatcher } from '../src/mqtt-matching';
import * as MQTT from '../type/types';
export const TYPES = {
MQTTMatcher: MQTT.TYPES.MQTTMatcher,
MQTTInterface: Symbol('MQTTExternalBroker'),
MQTTConverter: MQTT.TYPES.MQTTConverter,
};
export const DESCRIPTION: IModuleDescription<typeof TYPES> = {
AUTOSTART: {
broker: [
]
},
DEFAULT_INSTANCES: ['broker'],
NAME: 'MQTT',
PROVIDED_CLASSES: [
{
selector: TYPES.MQTTMatcher,
type: MQTTMatcher,
options: {
scope: 'inSingletonScope',
},
},
{
selector: TYPES.MQTTInterface,
type: ExternalMQTTServerWithConverter,
options: {
scope: 'inSingletonScope',
},
},
{
selector: TYPES.MQTTConverter,
type: MQTTConverter,
options: {
scope: 'inSingletonScope',
},
},
{
selector: MQTT.TYPES.MQTTLibrary,
type: mqtt,
options: {
toConstant: true
},
},
],
PROVIDED_FUNCTIONS: [],
REQURIES: ["PUBSUB", "CONVERTER"],
TYPES,
ACTIVATIONHANDLERS: []
}
export default DESCRIPTION;
/** Export the Type */
export type Matcher = ITopicMatcher;
export type MQTTInterface = ExternalMQTTServerWithConverter;