From 0b54dbaf7dbe5050f39d0a432b1740978cad20e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 25 Nov 2022 14:00:13 +0100 Subject: [PATCH] fix the SaslConfig type to compile with the updated library MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/healthy-crabs-collect.md | 5 +++++ plugins/kafka-backend/src/types/types.ts | 21 ++++++++++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 .changeset/healthy-crabs-collect.md diff --git a/.changeset/healthy-crabs-collect.md b/.changeset/healthy-crabs-collect.md new file mode 100644 index 0000000000..5dc90f9b80 --- /dev/null +++ b/.changeset/healthy-crabs-collect.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-kafka-backend': patch +--- + +Internal tweak to adapt to `kafkajs` 2.2.3 diff --git a/plugins/kafka-backend/src/types/types.ts b/plugins/kafka-backend/src/types/types.ts index 1fb9701334..f5ffd6b6c7 100644 --- a/plugins/kafka-backend/src/types/types.ts +++ b/plugins/kafka-backend/src/types/types.ts @@ -25,8 +25,19 @@ export interface ClusterDetails { export type SslConfig = ConnectionOptions | boolean; -export type SaslConfig = { - mechanism: 'plain' | 'scram-sha-256' | 'scram-sha-512'; - username: string; - password: string; -}; +export type SaslConfig = + | { + mechanism: 'plain'; + username: string; + password: string; + } + | { + mechanism: 'scram-sha-256'; + username: string; + password: string; + } + | { + mechanism: 'scram-sha-512'; + username: string; + password: string; + };