|
| 1 | +import type { ICredentialType, INodeProperties } from 'n8n-workflow'; |
| 2 | + |
| 3 | +export class Kafka implements ICredentialType { |
| 4 | + name = 'kafka'; |
| 5 | + |
| 6 | + displayName = 'Kafka'; |
| 7 | + |
| 8 | + documentationUrl = 'kafka'; |
| 9 | + |
| 10 | + properties: INodeProperties[] = [ |
| 11 | + { |
| 12 | + displayName: 'Client ID', |
| 13 | + name: 'clientId', |
| 14 | + type: 'string', |
| 15 | + default: '', |
| 16 | + placeholder: 'my-app', |
| 17 | + 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>', |
| 18 | + }, |
| 19 | + { |
| 20 | + displayName: 'Brokers', |
| 21 | + name: 'brokers', |
| 22 | + type: 'string', |
| 23 | + default: '', |
| 24 | + placeholder: 'kafka1:9092,kafka2:9092', |
| 25 | + }, |
| 26 | + { |
| 27 | + displayName: 'SSL', |
| 28 | + name: 'ssl', |
| 29 | + type: 'boolean', |
| 30 | + default: true, |
| 31 | + }, |
| 32 | + { |
| 33 | + displayName: 'Authentication', |
| 34 | + name: 'authentication', |
| 35 | + type: 'boolean', |
| 36 | + default: false, |
| 37 | + }, |
| 38 | + { |
| 39 | + displayName: 'Username', |
| 40 | + name: 'username', |
| 41 | + type: 'string', |
| 42 | + displayOptions: { |
| 43 | + show: { |
| 44 | + authentication: [true], |
| 45 | + }, |
| 46 | + }, |
| 47 | + default: '', |
| 48 | + description: 'Optional username if authenticated is required', |
| 49 | + }, |
| 50 | + { |
| 51 | + displayName: 'Password', |
| 52 | + name: 'password', |
| 53 | + type: 'string', |
| 54 | + displayOptions: { |
| 55 | + show: { |
| 56 | + authentication: [true], |
| 57 | + }, |
| 58 | + }, |
| 59 | + typeOptions: { |
| 60 | + password: true, |
| 61 | + }, |
| 62 | + default: '', |
| 63 | + description: 'Optional password if authenticated is required', |
| 64 | + }, |
| 65 | + { |
| 66 | + displayName: 'SASL Mechanism', |
| 67 | + name: 'saslMechanism', |
| 68 | + type: 'options', |
| 69 | + displayOptions: { |
| 70 | + show: { |
| 71 | + authentication: [true], |
| 72 | + }, |
| 73 | + }, |
| 74 | + options: [ |
| 75 | + { |
| 76 | + name: 'Plain', |
| 77 | + value: 'plain', |
| 78 | + }, |
| 79 | + { |
| 80 | + name: 'scram-sha-256', |
| 81 | + value: 'scram-sha-256', |
| 82 | + }, |
| 83 | + { |
| 84 | + name: 'scram-sha-512', |
| 85 | + value: 'scram-sha-512', |
| 86 | + }, |
| 87 | + ], |
| 88 | + default: 'plain', |
| 89 | + }, |
| 90 | + ]; |
| 91 | +} |
0 commit comments