kafka-ts 0.0.1-beta → 0.0.1-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (192) hide show
  1. package/.github/workflows/release.yml +17 -0
  2. package/.prettierrc +3 -2
  3. package/LICENSE +1 -1
  4. package/README.md +48 -35
  5. package/docker-compose.yml +108 -102
  6. package/examples/package-lock.json +28 -27
  7. package/examples/package.json +12 -12
  8. package/examples/src/client.ts +6 -6
  9. package/examples/src/consumer.ts +9 -8
  10. package/examples/src/create-topic.ts +22 -16
  11. package/examples/src/producer.ts +7 -7
  12. package/examples/src/replicator.ts +4 -4
  13. package/examples/src/utils/delay.ts +1 -0
  14. package/examples/src/utils/json.ts +1 -1
  15. package/examples/tsconfig.json +2 -2
  16. package/package.json +22 -15
  17. package/scripts/create-scram-user.sh +5 -0
  18. package/scripts/generate-certs.sh +1 -0
  19. package/scripts/kafka-local.properties +33 -0
  20. package/src/__snapshots__/request-handler.test.ts.snap +9 -718
  21. package/src/api/api-versions.ts +2 -2
  22. package/src/api/create-topics.ts +2 -2
  23. package/src/api/delete-topics.ts +2 -2
  24. package/src/api/fetch.ts +3 -3
  25. package/src/api/find-coordinator.ts +2 -2
  26. package/src/api/heartbeat.ts +2 -2
  27. package/src/api/index.ts +18 -18
  28. package/src/api/init-producer-id.ts +2 -2
  29. package/src/api/join-group.ts +3 -3
  30. package/src/api/leave-group.ts +2 -2
  31. package/src/api/list-offsets.ts +3 -3
  32. package/src/api/metadata.ts +3 -3
  33. package/src/api/offset-commit.ts +2 -2
  34. package/src/api/offset-fetch.ts +2 -2
  35. package/src/api/produce.ts +3 -3
  36. package/src/api/sasl-authenticate.ts +2 -2
  37. package/src/api/sasl-handshake.ts +2 -2
  38. package/src/api/sync-group.ts +2 -2
  39. package/src/broker.ts +83 -11
  40. package/src/client.ts +6 -6
  41. package/src/{request-handler.test.ts → cluster.test.ts} +72 -69
  42. package/src/cluster.ts +7 -7
  43. package/src/connection.ts +17 -15
  44. package/src/consumer/consumer-group.ts +14 -14
  45. package/src/consumer/consumer-metadata.ts +2 -2
  46. package/src/consumer/consumer.ts +84 -82
  47. package/src/consumer/fetch-manager.ts +179 -0
  48. package/src/consumer/fetcher.ts +57 -0
  49. package/src/consumer/offset-manager.ts +6 -6
  50. package/src/consumer/processor.ts +47 -0
  51. package/src/distributors/assignments-to-replicas.test.ts +7 -7
  52. package/src/distributors/assignments-to-replicas.ts +1 -1
  53. package/src/distributors/messages-to-topic-partition-leaders.test.ts +6 -6
  54. package/src/index.ts +4 -3
  55. package/src/metadata.ts +4 -4
  56. package/src/producer/producer.ts +8 -8
  57. package/src/types.ts +2 -0
  58. package/src/utils/api.ts +4 -4
  59. package/src/utils/crypto.ts +14 -0
  60. package/src/utils/debug.ts +2 -2
  61. package/src/utils/decoder.ts +4 -4
  62. package/src/utils/encoder.ts +6 -6
  63. package/src/utils/error.ts +3 -3
  64. package/src/utils/retrier.ts +1 -1
  65. package/src/utils/tracer.ts +7 -4
  66. package/tsconfig.json +16 -16
  67. package/dist/api/api-versions.d.ts +0 -9
  68. package/dist/api/api-versions.js +0 -24
  69. package/dist/api/create-topics.d.ts +0 -38
  70. package/dist/api/create-topics.js +0 -53
  71. package/dist/api/delete-topics.d.ts +0 -18
  72. package/dist/api/delete-topics.js +0 -33
  73. package/dist/api/fetch.d.ts +0 -77
  74. package/dist/api/fetch.js +0 -106
  75. package/dist/api/find-coordinator.d.ts +0 -21
  76. package/dist/api/find-coordinator.js +0 -39
  77. package/dist/api/heartbeat.d.ts +0 -11
  78. package/dist/api/heartbeat.js +0 -27
  79. package/dist/api/index.d.ts +0 -573
  80. package/dist/api/index.js +0 -164
  81. package/dist/api/init-producer-id.d.ts +0 -13
  82. package/dist/api/init-producer-id.js +0 -29
  83. package/dist/api/join-group.d.ts +0 -34
  84. package/dist/api/join-group.js +0 -51
  85. package/dist/api/leave-group.d.ts +0 -19
  86. package/dist/api/leave-group.js +0 -39
  87. package/dist/api/list-offsets.d.ts +0 -29
  88. package/dist/api/list-offsets.js +0 -48
  89. package/dist/api/metadata.d.ts +0 -40
  90. package/dist/api/metadata.js +0 -58
  91. package/dist/api/offset-commit.d.ts +0 -28
  92. package/dist/api/offset-commit.js +0 -48
  93. package/dist/api/offset-fetch.d.ts +0 -33
  94. package/dist/api/offset-fetch.js +0 -57
  95. package/dist/api/produce.d.ts +0 -53
  96. package/dist/api/produce.js +0 -129
  97. package/dist/api/sasl-authenticate.d.ts +0 -11
  98. package/dist/api/sasl-authenticate.js +0 -23
  99. package/dist/api/sasl-handshake.d.ts +0 -6
  100. package/dist/api/sasl-handshake.js +0 -19
  101. package/dist/api/sync-group.d.ts +0 -24
  102. package/dist/api/sync-group.js +0 -36
  103. package/dist/broker.d.ts +0 -29
  104. package/dist/broker.js +0 -60
  105. package/dist/client.d.ts +0 -23
  106. package/dist/client.js +0 -36
  107. package/dist/cluster.d.ts +0 -24
  108. package/dist/cluster.js +0 -72
  109. package/dist/connection.d.ts +0 -25
  110. package/dist/connection.js +0 -155
  111. package/dist/consumer/consumer-group.d.ts +0 -36
  112. package/dist/consumer/consumer-group.js +0 -182
  113. package/dist/consumer/consumer-metadata.d.ts +0 -7
  114. package/dist/consumer/consumer-metadata.js +0 -14
  115. package/dist/consumer/consumer.d.ts +0 -37
  116. package/dist/consumer/consumer.js +0 -178
  117. package/dist/consumer/metadata.d.ts +0 -24
  118. package/dist/consumer/metadata.js +0 -64
  119. package/dist/consumer/offset-manager.d.ts +0 -22
  120. package/dist/consumer/offset-manager.js +0 -56
  121. package/dist/distributors/assignments-to-replicas.d.ts +0 -17
  122. package/dist/distributors/assignments-to-replicas.js +0 -60
  123. package/dist/distributors/assignments-to-replicas.test.d.ts +0 -1
  124. package/dist/distributors/assignments-to-replicas.test.js +0 -40
  125. package/dist/distributors/messages-to-topic-partition-leaders.d.ts +0 -17
  126. package/dist/distributors/messages-to-topic-partition-leaders.js +0 -15
  127. package/dist/distributors/messages-to-topic-partition-leaders.test.d.ts +0 -1
  128. package/dist/distributors/messages-to-topic-partition-leaders.test.js +0 -30
  129. package/dist/examples/src/replicator.js +0 -34
  130. package/dist/examples/src/utils/json.js +0 -5
  131. package/dist/index.d.ts +0 -3
  132. package/dist/index.js +0 -19
  133. package/dist/metadata.d.ts +0 -24
  134. package/dist/metadata.js +0 -89
  135. package/dist/producer/producer.d.ts +0 -19
  136. package/dist/producer/producer.js +0 -111
  137. package/dist/request-handler.d.ts +0 -16
  138. package/dist/request-handler.js +0 -67
  139. package/dist/request-handler.test.d.ts +0 -1
  140. package/dist/request-handler.test.js +0 -340
  141. package/dist/src/api/api-versions.js +0 -18
  142. package/dist/src/api/create-topics.js +0 -46
  143. package/dist/src/api/delete-topics.js +0 -26
  144. package/dist/src/api/fetch.js +0 -95
  145. package/dist/src/api/find-coordinator.js +0 -34
  146. package/dist/src/api/heartbeat.js +0 -22
  147. package/dist/src/api/index.js +0 -38
  148. package/dist/src/api/init-producer-id.js +0 -24
  149. package/dist/src/api/join-group.js +0 -48
  150. package/dist/src/api/leave-group.js +0 -30
  151. package/dist/src/api/list-offsets.js +0 -39
  152. package/dist/src/api/metadata.js +0 -47
  153. package/dist/src/api/offset-commit.js +0 -39
  154. package/dist/src/api/offset-fetch.js +0 -44
  155. package/dist/src/api/produce.js +0 -119
  156. package/dist/src/api/sync-group.js +0 -31
  157. package/dist/src/broker.js +0 -35
  158. package/dist/src/connection.js +0 -21
  159. package/dist/src/consumer/consumer-group.js +0 -131
  160. package/dist/src/consumer/consumer.js +0 -103
  161. package/dist/src/consumer/metadata.js +0 -52
  162. package/dist/src/consumer/offset-manager.js +0 -23
  163. package/dist/src/index.js +0 -19
  164. package/dist/src/producer/producer.js +0 -84
  165. package/dist/src/request-handler.js +0 -57
  166. package/dist/src/request-handler.test.js +0 -321
  167. package/dist/src/types.js +0 -2
  168. package/dist/src/utils/api.js +0 -5
  169. package/dist/src/utils/decoder.js +0 -161
  170. package/dist/src/utils/encoder.js +0 -137
  171. package/dist/src/utils/error.js +0 -10
  172. package/dist/types.d.ts +0 -9
  173. package/dist/types.js +0 -2
  174. package/dist/utils/api.d.ts +0 -9
  175. package/dist/utils/api.js +0 -5
  176. package/dist/utils/debug.d.ts +0 -2
  177. package/dist/utils/debug.js +0 -11
  178. package/dist/utils/decoder.d.ts +0 -29
  179. package/dist/utils/decoder.js +0 -147
  180. package/dist/utils/delay.d.ts +0 -1
  181. package/dist/utils/delay.js +0 -5
  182. package/dist/utils/encoder.d.ts +0 -28
  183. package/dist/utils/encoder.js +0 -122
  184. package/dist/utils/error.d.ts +0 -11
  185. package/dist/utils/error.js +0 -27
  186. package/dist/utils/memo.d.ts +0 -1
  187. package/dist/utils/memo.js +0 -16
  188. package/dist/utils/retrier.d.ts +0 -10
  189. package/dist/utils/retrier.js +0 -22
  190. package/dist/utils/tracer.d.ts +0 -1
  191. package/dist/utils/tracer.js +0 -26
  192. package/examples/node_modules/.package-lock.json +0 -22
@@ -1,5 +1,5 @@
1
- import { createApi } from "../utils/api.js";
2
- import { KafkaTSApiError } from "../utils/error.js";
1
+ import { createApi } from '../utils/api.js';
2
+ import { KafkaTSApiError } from '../utils/error.js';
3
3
 
4
4
  export const API_VERSIONS = createApi({
5
5
  apiKey: 18,
@@ -1,5 +1,5 @@
1
- import { createApi } from "../utils/api";
2
- import { KafkaTSApiError } from "../utils/error";
1
+ import { createApi } from '../utils/api';
2
+ import { KafkaTSApiError } from '../utils/error';
3
3
 
4
4
  export const CREATE_TOPICS = createApi({
5
5
  apiKey: 19,
@@ -1,5 +1,5 @@
1
- import { createApi } from "../utils/api";
2
- import { KafkaTSApiError } from "../utils/error";
1
+ import { createApi } from '../utils/api';
2
+ import { KafkaTSApiError } from '../utils/error';
3
3
 
4
4
  export const DELETE_TOPICS = createApi({
5
5
  apiKey: 20,
package/src/api/fetch.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { createApi } from "../utils/api";
2
- import { Decoder } from "../utils/decoder";
3
- import { KafkaTSApiError } from "../utils/error";
1
+ import { createApi } from '../utils/api';
2
+ import { Decoder } from '../utils/decoder';
3
+ import { KafkaTSApiError } from '../utils/error';
4
4
 
5
5
  export const enum IsolationLevel {
6
6
  READ_UNCOMMITTED = 0,
@@ -1,5 +1,5 @@
1
- import { createApi } from "../utils/api";
2
- import { KafkaTSApiError } from "../utils/error";
1
+ import { createApi } from '../utils/api';
2
+ import { KafkaTSApiError } from '../utils/error';
3
3
 
4
4
  export const KEY_TYPE = {
5
5
  GROUP: 0,
@@ -1,5 +1,5 @@
1
- import { createApi } from "../utils/api";
2
- import { KafkaTSApiError } from "../utils/error";
1
+ import { createApi } from '../utils/api';
2
+ import { KafkaTSApiError } from '../utils/error';
3
3
 
4
4
  export const HEARTBEAT = createApi({
5
5
  apiKey: 12,
package/src/api/index.ts CHANGED
@@ -1,21 +1,21 @@
1
- import { Api } from "../utils/api";
2
- import { API_VERSIONS } from "./api-versions";
3
- import { CREATE_TOPICS } from "./create-topics";
4
- import { DELETE_TOPICS } from "./delete-topics";
5
- import { FETCH } from "./fetch";
6
- import { FIND_COORDINATOR } from "./find-coordinator";
7
- import { HEARTBEAT } from "./heartbeat";
8
- import { INIT_PRODUCER_ID } from "./init-producer-id";
9
- import { JOIN_GROUP } from "./join-group";
10
- import { LEAVE_GROUP } from "./leave-group";
11
- import { LIST_OFFSETS } from "./list-offsets";
12
- import { METADATA } from "./metadata";
13
- import { OFFSET_COMMIT } from "./offset-commit";
14
- import { OFFSET_FETCH } from "./offset-fetch";
15
- import { PRODUCE } from "./produce";
16
- import { SASL_AUTHENTICATE } from "./sasl-authenticate";
17
- import { SASL_HANDSHAKE } from "./sasl-handshake";
18
- import { SYNC_GROUP } from "./sync-group";
1
+ import { Api } from '../utils/api';
2
+ import { API_VERSIONS } from './api-versions';
3
+ import { CREATE_TOPICS } from './create-topics';
4
+ import { DELETE_TOPICS } from './delete-topics';
5
+ import { FETCH } from './fetch';
6
+ import { FIND_COORDINATOR } from './find-coordinator';
7
+ import { HEARTBEAT } from './heartbeat';
8
+ import { INIT_PRODUCER_ID } from './init-producer-id';
9
+ import { JOIN_GROUP } from './join-group';
10
+ import { LEAVE_GROUP } from './leave-group';
11
+ import { LIST_OFFSETS } from './list-offsets';
12
+ import { METADATA } from './metadata';
13
+ import { OFFSET_COMMIT } from './offset-commit';
14
+ import { OFFSET_FETCH } from './offset-fetch';
15
+ import { PRODUCE } from './produce';
16
+ import { SASL_AUTHENTICATE } from './sasl-authenticate';
17
+ import { SASL_HANDSHAKE } from './sasl-handshake';
18
+ import { SYNC_GROUP } from './sync-group';
19
19
 
20
20
  export const API = {
21
21
  API_VERSIONS,
@@ -1,5 +1,5 @@
1
- import { createApi } from "../utils/api";
2
- import { KafkaTSApiError } from "../utils/error";
1
+ import { createApi } from '../utils/api';
2
+ import { KafkaTSApiError } from '../utils/error';
3
3
 
4
4
  export const INIT_PRODUCER_ID = createApi({
5
5
  apiKey: 22,
@@ -1,6 +1,6 @@
1
- import { createApi } from "../utils/api";
2
- import { Encoder } from "../utils/encoder";
3
- import { KafkaTSApiError } from "../utils/error";
1
+ import { createApi } from '../utils/api';
2
+ import { Encoder } from '../utils/encoder';
3
+ import { KafkaTSApiError } from '../utils/error';
4
4
 
5
5
  export const JOIN_GROUP = createApi({
6
6
  apiKey: 11,
@@ -1,5 +1,5 @@
1
- import { createApi } from "../utils/api";
2
- import { KafkaTSApiError } from "../utils/error";
1
+ import { createApi } from '../utils/api';
2
+ import { KafkaTSApiError } from '../utils/error';
3
3
 
4
4
  export const LEAVE_GROUP = createApi({
5
5
  apiKey: 13,
@@ -1,6 +1,6 @@
1
- import { createApi } from "../utils/api";
2
- import { KafkaTSApiError } from "../utils/error";
3
- import { IsolationLevel } from "./fetch";
1
+ import { createApi } from '../utils/api';
2
+ import { KafkaTSApiError } from '../utils/error';
3
+ import { IsolationLevel } from './fetch';
4
4
 
5
5
  export const LIST_OFFSETS = createApi({
6
6
  apiKey: 2,
@@ -1,7 +1,7 @@
1
- import { createApi } from "../utils/api";
2
- import { KafkaTSApiError } from "../utils/error";
1
+ import { createApi } from '../utils/api';
2
+ import { KafkaTSApiError } from '../utils/error';
3
3
 
4
- export type Metadata = ReturnType<(typeof METADATA)["response"]>;
4
+ export type Metadata = ReturnType<(typeof METADATA)['response']>;
5
5
 
6
6
  export const METADATA = createApi({
7
7
  apiKey: 3,
@@ -1,5 +1,5 @@
1
- import { createApi } from "../utils/api";
2
- import { KafkaTSApiError } from "../utils/error";
1
+ import { createApi } from '../utils/api';
2
+ import { KafkaTSApiError } from '../utils/error';
3
3
 
4
4
  export const OFFSET_COMMIT = createApi({
5
5
  apiKey: 8,
@@ -1,5 +1,5 @@
1
- import { createApi } from "../utils/api";
2
- import { KafkaTSApiError } from "../utils/error";
1
+ import { createApi } from '../utils/api';
2
+ import { KafkaTSApiError } from '../utils/error';
3
3
 
4
4
  export const OFFSET_FETCH = createApi({
5
5
  apiKey: 9,
@@ -1,6 +1,6 @@
1
- import { createApi } from "../utils/api.js";
2
- import { Encoder } from "../utils/encoder.js";
3
- import { KafkaTSApiError } from "../utils/error.js";
1
+ import { createApi } from '../utils/api.js';
2
+ import { Encoder } from '../utils/encoder.js';
3
+ import { KafkaTSApiError } from '../utils/error.js';
4
4
 
5
5
  export const PRODUCE = createApi({
6
6
  apiKey: 0,
@@ -1,5 +1,5 @@
1
- import { createApi } from "../utils/api";
2
- import { KafkaTSApiError } from "../utils/error";
1
+ import { createApi } from '../utils/api';
2
+ import { KafkaTSApiError } from '../utils/error';
3
3
 
4
4
  export const SASL_AUTHENTICATE = createApi({
5
5
  apiKey: 36,
@@ -1,5 +1,5 @@
1
- import { createApi } from "../utils/api";
2
- import { KafkaTSApiError } from "../utils/error";
1
+ import { createApi } from '../utils/api';
2
+ import { KafkaTSApiError } from '../utils/error';
3
3
 
4
4
  export const SASL_HANDSHAKE = createApi({
5
5
  apiKey: 17,
@@ -1,5 +1,5 @@
1
- import { createApi } from "../utils/api";
2
- import { KafkaTSApiError } from "../utils/error";
1
+ import { createApi } from '../utils/api';
2
+ import { KafkaTSApiError } from '../utils/error';
3
3
 
4
4
  export type Assignment = { [topic: string]: number[] };
5
5
 
package/src/broker.ts CHANGED
@@ -1,11 +1,16 @@
1
- import { TcpSocketConnectOpts } from "net";
2
- import { TLSSocketOptions } from "tls";
3
- import { API } from "./api";
4
- import { Connection, SendRequest } from "./connection";
5
- import { KafkaTSError } from "./utils/error";
6
- import { memo } from "./utils/memo";
1
+ import { TcpSocketConnectOpts } from 'net';
2
+ import { TLSSocketOptions } from 'tls';
3
+ import { API } from './api';
4
+ import { Connection, SendRequest } from './connection';
5
+ import { base64Decode, base64Encode, generateNonce, hash, hmac, saltPassword, xor } from './utils/crypto';
6
+ import { KafkaTSError } from './utils/error';
7
+ import { memo } from './utils/memo';
7
8
 
8
- export type SASLOptions = { mechanism: "PLAIN"; username: string; password: string };
9
+ export type SASLOptions = {
10
+ mechanism: 'PLAIN' | 'SCRAM-SHA-256';
11
+ username: string;
12
+ password: string;
13
+ };
9
14
 
10
15
  type BrokerOptions = {
11
16
  clientId: string | null;
@@ -64,11 +69,78 @@ export class Broker {
64
69
  }
65
70
 
66
71
  private async saslAuthenticate() {
67
- if (this.options.sasl?.mechanism !== "PLAIN") {
72
+ if (!this.options.sasl) {
68
73
  return;
69
74
  }
70
- const { username, password } = this.options.sasl;
71
- const authBytes = [null, username, password].join("\u0000");
72
- await this.sendRequest(API.SASL_AUTHENTICATE, { authBytes: Buffer.from(authBytes) });
75
+
76
+ const { mechanism } = this.options.sasl;
77
+ const authenticate = { PLAIN: plainProvider, 'SCRAM-SHA-256': scramSha256Provider }[mechanism as string];
78
+ if (!authenticate) {
79
+ throw new KafkaTSError(`SASL mechanism ${mechanism} is not supported`);
80
+ }
81
+
82
+ await authenticate({
83
+ ...this.options.sasl,
84
+ sendRequest: this.sendRequest.bind(this),
85
+ });
73
86
  }
74
87
  }
88
+
89
+ const plainProvider = async ({
90
+ username,
91
+ password,
92
+ sendRequest,
93
+ }: {
94
+ username: string;
95
+ password: string;
96
+ sendRequest: SendRequest;
97
+ }) => {
98
+ const authBytes = [null, username, password].join('\u0000');
99
+ await sendRequest(API.SASL_AUTHENTICATE, { authBytes: Buffer.from(authBytes) });
100
+ };
101
+
102
+ const scramSha256Provider = async ({
103
+ username,
104
+ password,
105
+ sendRequest,
106
+ }: {
107
+ username: string;
108
+ password: string;
109
+ sendRequest: SendRequest;
110
+ }) => {
111
+ const nonce = generateNonce();
112
+ const firstMessage = `n=${username},r=${nonce}`;
113
+
114
+ const { authBytes } = await sendRequest(API.SASL_AUTHENTICATE, { authBytes: Buffer.from(`n,,${firstMessage}`) });
115
+ if (!authBytes) {
116
+ throw new KafkaTSError('No auth response');
117
+ }
118
+
119
+ const response = Object.fromEntries(
120
+ authBytes
121
+ .toString()
122
+ .split(',')
123
+ .map((pair) => pair.split('=')),
124
+ ) as { r: string; s: string; i: string };
125
+
126
+ const rnonce = response.r;
127
+ if (!rnonce.startsWith(nonce)) {
128
+ throw new KafkaTSError('Invalid nonce');
129
+ }
130
+ const iterations = parseInt(response.i);
131
+ const salt = base64Decode(response.s);
132
+
133
+ const saltedPassword = await saltPassword(password, salt, iterations, 32, 'sha256');
134
+ const clientKey = hmac(saltedPassword, 'Client Key');
135
+ const clientKeyHash = hash(clientKey);
136
+
137
+ let finalMessage = `c=${base64Encode('n,,')},r=${rnonce}`;
138
+
139
+ const fullMessage = `${firstMessage},${authBytes.toString()},${finalMessage}`;
140
+ const clientSignature = hmac(clientKeyHash, fullMessage);
141
+ const clientProof = base64Encode(xor(clientKey, clientSignature));
142
+
143
+ finalMessage += `,p=${clientProof}`;
144
+
145
+ await sendRequest(API.SASL_AUTHENTICATE, { authBytes: Buffer.from(finalMessage) });
146
+ };
package/src/client.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { TcpSocketConnectOpts } from "net";
2
- import { TLSSocketOptions } from "tls";
3
- import { SASLOptions } from "./broker";
4
- import { Cluster } from "./cluster";
5
- import { Consumer, ConsumerOptions } from "./consumer/consumer";
6
- import { Producer, ProducerOptions } from "./producer/producer";
1
+ import { TcpSocketConnectOpts } from 'net';
2
+ import { TLSSocketOptions } from 'tls';
3
+ import { SASLOptions } from './broker';
4
+ import { Cluster } from './cluster';
5
+ import { Consumer, ConsumerOptions } from './consumer/consumer';
6
+ import { Producer, ProducerOptions } from './producer/producer';
7
7
 
8
8
  type ClientOptions = {
9
9
  clientId?: string | null;