37 lines
752 B
TypeScript
37 lines
752 B
TypeScript
import mqtt from "mqtt";
|
|
|
|
export type MQTTConfig = {
|
|
|
|
/**
|
|
* The URL to broker.
|
|
* Example: mqtt://localhost:1882
|
|
*/
|
|
brokerURL: string;
|
|
|
|
/**
|
|
* Path to file containing a username of MQTT user.
|
|
*/
|
|
username: string;
|
|
|
|
/**
|
|
* Path to file containing a password of MQTT user.
|
|
*/
|
|
password: string;
|
|
|
|
/**
|
|
* Optional client ID used to connect to MQTT (visible in MQTT broker logs).
|
|
* Default: tauron-scrapper
|
|
*/
|
|
clientId?: string;
|
|
|
|
/**
|
|
* Optional prefix under which the messages will be published.
|
|
* Default: tauron
|
|
*/
|
|
prefix?: string;
|
|
|
|
/**
|
|
* Optional configuration of published messages (i.e. QoS, whether the message should be retained etc.).
|
|
*/
|
|
publishOptions?: mqtt.IClientPublishOptions;
|
|
} |