2020-09-01 08:40:18 -07:00
|
|
|
import {
|
|
|
|
ICredentialType,
|
2021-06-12 09:39:55 -07:00
|
|
|
INodeProperties,
|
2020-09-01 08:40:18 -07:00
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
|
|
|
export class Mqtt implements ICredentialType {
|
|
|
|
name = 'mqtt';
|
|
|
|
displayName = 'MQTT';
|
2020-09-14 04:06:28 -07:00
|
|
|
documentationUrl = 'mqtt';
|
2021-06-12 09:39:55 -07:00
|
|
|
properties: INodeProperties[] = [
|
2020-09-01 08:40:18 -07:00
|
|
|
{
|
|
|
|
displayName: 'Protocol',
|
|
|
|
name: 'protocol',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'options',
|
2020-10-01 05:01:39 -07:00
|
|
|
options: [
|
2020-09-01 08:40:18 -07:00
|
|
|
{
|
|
|
|
name: 'mqtt',
|
|
|
|
value: 'mqtt',
|
|
|
|
},
|
2021-06-25 01:27:06 -07:00
|
|
|
{
|
|
|
|
name: 'mqtts',
|
|
|
|
value: 'mqtts',
|
|
|
|
},
|
2020-09-01 08:40:18 -07:00
|
|
|
{
|
|
|
|
name: 'ws',
|
|
|
|
value: 'ws',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'mqtt',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Host',
|
|
|
|
name: 'host',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2020-09-01 08:40:18 -07:00
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Port',
|
|
|
|
name: 'port',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'number',
|
2020-09-01 08:40:18 -07:00
|
|
|
default: 1883,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Username',
|
|
|
|
name: 'username',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2020-09-01 08:40:18 -07:00
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Password',
|
|
|
|
name: 'password',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2020-09-01 08:40:18 -07:00
|
|
|
typeOptions: {
|
|
|
|
password: true,
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
2021-04-30 18:23:25 -07:00
|
|
|
{
|
|
|
|
displayName: 'Clean Session',
|
|
|
|
name: 'clean',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'boolean',
|
2021-04-30 18:23:25 -07:00
|
|
|
default: true,
|
|
|
|
description: `Set to false to receive QoS 1 and 2 messages while offline.`,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Client ID',
|
|
|
|
name: 'clientId',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2021-04-30 18:23:25 -07:00
|
|
|
default: '',
|
|
|
|
description: 'Client ID. If left empty, one is autogenrated for you',
|
|
|
|
},
|
2020-09-01 08:40:18 -07:00
|
|
|
];
|
|
|
|
}
|