diff --git a/CHANGELOG.md b/CHANGELOG.md index bbc4f8dc1..5b728be56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [2.2.1] - 2022-10-13 + +### Fixed + - Fixed Typescript definitions for custom authentication mechanisms #1459 + ## [2.2.0] - 2022-08-16 ### Added diff --git a/docs/CustomAuthenticationMechanism.md b/docs/CustomAuthenticationMechanism.md index f02eced77..e4ecbfc27 100644 --- a/docs/CustomAuthenticationMechanism.md +++ b/docs/CustomAuthenticationMechanism.md @@ -24,13 +24,17 @@ configure your brokers. A custom authentication mechanism needs to fulfill the following interface: ```ts +type SaslAuthenticateArgs = { + request: SaslAuthenticationRequest + response?: SaslAuthenticationResponse +} + type AuthenticationProviderArgs = { host: string port: number logger: Logger saslAuthenticate: ( - request: SaslAuthenticationRequest, - response?: SaslAuthenticationResponse + args: SaslAuthenticateArgs ) => Promise } diff --git a/package.json b/package.json index 55f75ff79..2d2f3f9d5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kafkajs", - "version": "2.2.0", + "version": "2.2.1", "description": "A modern Apache Kafka client for node.js", "author": "Tulio Ornelas ", "main": "index.js", diff --git a/types/index.d.ts b/types/index.d.ts index c046a0188..26bcbfea3 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -28,13 +28,17 @@ export type Authenticator = { authenticate: () => Promise } +export type SaslAuthenticateArgs = { + request: SaslAuthenticationRequest + response?: SaslAuthenticationResponse +} + export type AuthenticationProviderArgs = { host: string port: number logger: Logger saslAuthenticate: ( - request: SaslAuthenticationRequest, - response?: SaslAuthenticationResponse + args: SaslAuthenticateArgs ) => Promise } @@ -259,7 +263,7 @@ export interface ReplicaAssignment { } export interface PartitionReassignment { - topic: string, + topic: string partitionAssignment: Array } @@ -694,7 +698,10 @@ export type Broker = { topics: PartitionReassignment[] timeout?: number }): Promise - listPartitionReassignments(request: { topics?: TopicPartitions[]; timeout?: number }): Promise + listPartitionReassignments(request: { + topics?: TopicPartitions[] + timeout?: number + }): Promise } interface MessageSetEntry {