2023-01-27 03:22:44 -08:00
import type { ICredentialType , INodeProperties } from 'n8n-workflow' ;
2020-10-29 07:42:54 -07:00
export class Kafka implements ICredentialType {
name = 'kafka' ;
2022-12-02 12:54:28 -08:00
2020-10-29 07:42:54 -07:00
displayName = 'Kafka' ;
2022-12-02 12:54:28 -08:00
2020-10-29 07:42:54 -07:00
documentationUrl = 'kafka' ;
2022-12-02 12:54:28 -08:00
2021-06-12 09:39:55 -07:00
properties : INodeProperties [ ] = [
2020-10-29 07:42:54 -07:00
{
displayName : 'Client ID' ,
name : 'clientId' ,
2021-06-12 09:39:55 -07:00
type : 'string' ,
2020-10-29 07:42:54 -07:00
default : '' ,
2020-10-29 07:44:11 -07:00
placeholder : 'my-app' ,
2022-09-05 04:11:25 -07:00
hint : 'Will not affect the connection, but will be used to identify the client in the Kafka server logs. Read more <a href="https://kafka.apache.org/documentation/#design_quotasgroups">here</a>' ,
2020-10-29 07:42:54 -07:00
} ,
{
displayName : 'Brokers' ,
name : 'brokers' ,
2021-06-12 09:39:55 -07:00
type : 'string' ,
2020-10-29 07:42:54 -07:00
default : '' ,
2020-10-29 07:44:11 -07:00
placeholder : 'kafka1:9092,kafka2:9092' ,
2020-10-29 07:42:54 -07:00
} ,
{
displayName : 'SSL' ,
name : 'ssl' ,
2021-06-12 09:39:55 -07:00
type : 'boolean' ,
2020-10-29 07:42:54 -07:00
default : true ,
} ,
2021-03-11 05:25:02 -08:00
{
displayName : 'Authentication' ,
name : 'authentication' ,
2021-06-12 09:39:55 -07:00
type : 'boolean' ,
2021-03-11 05:25:02 -08:00
default : false ,
} ,
2020-10-29 07:44:11 -07:00
{
displayName : 'Username' ,
name : 'username' ,
2021-06-12 09:39:55 -07:00
type : 'string' ,
2021-03-11 05:25:02 -08:00
displayOptions : {
show : {
2022-07-24 08:36:17 -07:00
authentication : [ true ] ,
2021-03-11 05:25:02 -08:00
} ,
} ,
2020-10-29 07:44:11 -07:00
default : '' ,
2022-04-13 23:32:27 -07:00
description : 'Optional username if authenticated is required' ,
2020-10-29 07:44:11 -07:00
} ,
{
displayName : 'Password' ,
name : 'password' ,
2021-06-12 09:39:55 -07:00
type : 'string' ,
2021-03-11 05:25:02 -08:00
displayOptions : {
show : {
2022-07-24 08:36:17 -07:00
authentication : [ true ] ,
2021-03-11 05:25:02 -08:00
} ,
} ,
2020-10-29 07:44:11 -07:00
typeOptions : {
password : true ,
} ,
default : '' ,
2022-04-13 23:32:27 -07:00
description : 'Optional password if authenticated is required' ,
2020-10-29 07:44:11 -07:00
} ,
2021-03-11 05:25:02 -08:00
{
2022-04-13 23:32:27 -07:00
displayName : 'SASL Mechanism' ,
2021-03-11 05:25:02 -08:00
name : 'saslMechanism' ,
2021-06-12 09:39:55 -07:00
type : 'options' ,
2021-03-11 05:25:02 -08:00
displayOptions : {
show : {
2022-07-24 08:36:17 -07:00
authentication : [ true ] ,
2021-03-11 05:25:02 -08:00
} ,
} ,
options : [
{
2022-04-13 23:32:27 -07:00
name : 'Plain' ,
2021-03-11 05:25:02 -08:00
value : 'plain' ,
} ,
{
name : 'scram-sha-256' ,
value : 'scram-sha-256' ,
} ,
{
name : 'scram-sha-512' ,
value : 'scram-sha-512' ,
} ,
] ,
default : 'plain' ,
} ,
2020-10-29 07:42:54 -07:00
] ;
}