@platformatic/kafka 1.27.0-alpha.3 → 1.27.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 (143) hide show
  1. package/README.md +63 -0
  2. package/dist/apis/admin/create-acls-v2.d.ts +16 -0
  3. package/dist/apis/admin/create-acls-v2.js +55 -0
  4. package/dist/apis/admin/delete-acls-v2.d.ts +21 -0
  5. package/dist/apis/admin/delete-acls-v2.js +84 -0
  6. package/dist/apis/admin/describe-acls-v2.d.ts +17 -0
  7. package/dist/apis/admin/describe-acls-v2.js +66 -0
  8. package/dist/apis/admin/describe-cluster-v0.d.ts +23 -0
  9. package/dist/apis/admin/describe-cluster-v0.js +48 -0
  10. package/dist/apis/admin/describe-log-dirs-v2.d.ts +32 -0
  11. package/dist/apis/admin/describe-log-dirs-v2.js +67 -0
  12. package/dist/apis/admin/describe-log-dirs-v3.d.ts +32 -0
  13. package/dist/apis/admin/describe-log-dirs-v3.js +73 -0
  14. package/dist/apis/admin/index.d.ts +7 -0
  15. package/dist/apis/admin/index.js +7 -0
  16. package/dist/apis/admin/list-transactions-v0.d.ts +18 -0
  17. package/dist/apis/admin/list-transactions-v0.js +43 -0
  18. package/dist/apis/consumer/index.d.ts +8 -0
  19. package/dist/apis/consumer/index.js +8 -0
  20. package/dist/apis/consumer/join-group-v6.d.ts +27 -0
  21. package/dist/apis/consumer/join-group-v6.js +67 -0
  22. package/dist/apis/consumer/join-group-v7.d.ts +27 -0
  23. package/dist/apis/consumer/join-group-v7.js +68 -0
  24. package/dist/apis/consumer/join-group-v8.d.ts +27 -0
  25. package/dist/apis/consumer/join-group-v8.js +70 -0
  26. package/dist/apis/consumer/leave-group-v4.d.ts +22 -0
  27. package/dist/apis/consumer/leave-group-v4.js +56 -0
  28. package/dist/apis/consumer/list-offsets-v5.d.ts +30 -0
  29. package/dist/apis/consumer/list-offsets-v5.js +67 -0
  30. package/dist/apis/consumer/list-offsets-v6.d.ts +30 -0
  31. package/dist/apis/consumer/list-offsets-v6.js +68 -0
  32. package/dist/apis/consumer/list-offsets-v7.d.ts +30 -0
  33. package/dist/apis/consumer/list-offsets-v7.js +68 -0
  34. package/dist/apis/consumer/sync-group-v4.d.ts +18 -0
  35. package/dist/apis/consumer/sync-group-v4.js +43 -0
  36. package/dist/apis/enumerations.d.ts +5 -5
  37. package/dist/apis/producer/add-offsets-to-txn-v1.d.ts +10 -0
  38. package/dist/apis/producer/add-offsets-to-txn-v1.js +33 -0
  39. package/dist/apis/producer/add-offsets-to-txn-v2.d.ts +10 -0
  40. package/dist/apis/producer/add-offsets-to-txn-v2.js +33 -0
  41. package/dist/apis/producer/index.d.ts +3 -0
  42. package/dist/apis/producer/index.js +3 -0
  43. package/dist/apis/producer/init-producer-id-v3.d.ts +21 -0
  44. package/dist/apis/producer/init-producer-id-v3.js +38 -0
  45. package/dist/clients/admin/options.d.ts +9 -9
  46. package/dist/clients/consumer/consumer.js +38 -2
  47. package/dist/clients/consumer/messages-stream.d.ts +2 -2
  48. package/dist/clients/consumer/messages-stream.js +66 -10
  49. package/dist/clients/consumer/options.d.ts +24 -0
  50. package/dist/clients/consumer/options.js +3 -1
  51. package/dist/clients/consumer/types.d.ts +4 -1
  52. package/dist/clients/producer/options.d.ts +2 -18
  53. package/dist/clients/producer/options.js +3 -1
  54. package/dist/clients/producer/producer.js +82 -16
  55. package/dist/clients/producer/types.d.ts +4 -1
  56. package/dist/clients/serde.d.ts +11 -6
  57. package/dist/errors.d.ts +5 -5
  58. package/dist/errors.js +8 -6
  59. package/dist/index.d.ts +1 -0
  60. package/dist/index.js +2 -0
  61. package/dist/network/connection.d.ts +7 -6
  62. package/dist/network/connection.js +1 -1
  63. package/dist/protocol/compression.d.ts +1 -1
  64. package/dist/protocol/compression.js +7 -46
  65. package/dist/protocol/crc32c.d.ts +1 -1
  66. package/dist/protocol/crc32c.js +5 -6
  67. package/dist/protocol/definitions.d.ts +1 -1
  68. package/dist/protocol/definitions.js +1 -1
  69. package/dist/protocol/index.d.ts +0 -2
  70. package/dist/protocol/index.js +0 -2
  71. package/dist/protocol/reader.d.ts +2 -2
  72. package/dist/protocol/reader.js +4 -4
  73. package/dist/protocol/records.d.ts +11 -22
  74. package/dist/protocol/records.js +3 -7
  75. package/dist/protocol/sasl/oauth-bearer.d.ts +3 -3
  76. package/dist/protocol/sasl/plain.d.ts +3 -3
  77. package/dist/protocol/sasl/scram-sha.d.ts +3 -3
  78. package/dist/protocol/sasl/utils.d.ts +3 -3
  79. package/dist/protocol/writer.d.ts +1 -1
  80. package/dist/protocol/writer.js +3 -3
  81. package/dist/registries/abstract.d.ts +22 -0
  82. package/dist/registries/abstract.js +38 -0
  83. package/dist/registries/confluent-schema-registry.d.ts +41 -0
  84. package/dist/registries/confluent-schema-registry.js +222 -0
  85. package/dist/registries/index.d.ts +2 -0
  86. package/dist/registries/index.js +2 -0
  87. package/dist/typescript-4/dist/apis/admin/create-acls-v2.d.ts +16 -0
  88. package/dist/typescript-4/dist/apis/admin/delete-acls-v2.d.ts +21 -0
  89. package/dist/typescript-4/dist/apis/admin/describe-acls-v2.d.ts +17 -0
  90. package/dist/typescript-4/dist/apis/admin/describe-cluster-v0.d.ts +23 -0
  91. package/dist/typescript-4/dist/apis/admin/describe-log-dirs-v2.d.ts +32 -0
  92. package/dist/typescript-4/dist/apis/admin/describe-log-dirs-v3.d.ts +32 -0
  93. package/dist/typescript-4/dist/apis/admin/index.d.ts +7 -0
  94. package/dist/typescript-4/dist/apis/admin/list-transactions-v0.d.ts +18 -0
  95. package/dist/typescript-4/dist/apis/consumer/index.d.ts +8 -0
  96. package/dist/typescript-4/dist/apis/consumer/join-group-v6.d.ts +27 -0
  97. package/dist/typescript-4/dist/apis/consumer/join-group-v7.d.ts +27 -0
  98. package/dist/typescript-4/dist/apis/consumer/join-group-v8.d.ts +27 -0
  99. package/dist/typescript-4/dist/apis/consumer/leave-group-v4.d.ts +22 -0
  100. package/dist/typescript-4/dist/apis/consumer/list-offsets-v5.d.ts +30 -0
  101. package/dist/typescript-4/dist/apis/consumer/list-offsets-v6.d.ts +30 -0
  102. package/dist/typescript-4/dist/apis/consumer/list-offsets-v7.d.ts +30 -0
  103. package/dist/typescript-4/dist/apis/consumer/sync-group-v4.d.ts +18 -0
  104. package/dist/typescript-4/dist/apis/enumerations.d.ts +5 -5
  105. package/dist/typescript-4/dist/apis/producer/add-offsets-to-txn-v1.d.ts +10 -0
  106. package/dist/typescript-4/dist/apis/producer/add-offsets-to-txn-v2.d.ts +10 -0
  107. package/dist/typescript-4/dist/apis/producer/index.d.ts +3 -0
  108. package/dist/typescript-4/dist/apis/producer/init-producer-id-v3.d.ts +21 -0
  109. package/dist/typescript-4/dist/clients/admin/options.d.ts +9 -9
  110. package/dist/typescript-4/dist/clients/consumer/messages-stream.d.ts +2 -2
  111. package/dist/typescript-4/dist/clients/consumer/options.d.ts +24 -0
  112. package/dist/typescript-4/dist/clients/consumer/types.d.ts +4 -1
  113. package/dist/typescript-4/dist/clients/producer/options.d.ts +2 -18
  114. package/dist/typescript-4/dist/clients/producer/types.d.ts +4 -1
  115. package/dist/typescript-4/dist/clients/serde.d.ts +11 -6
  116. package/dist/typescript-4/dist/errors.d.ts +5 -5
  117. package/dist/typescript-4/dist/index.d.ts +2 -1
  118. package/dist/typescript-4/dist/network/connection.d.ts +7 -6
  119. package/dist/typescript-4/dist/protocol/compression.d.ts +1 -1
  120. package/dist/typescript-4/dist/protocol/crc32c.d.ts +1 -1
  121. package/dist/typescript-4/dist/protocol/definitions.d.ts +1 -1
  122. package/dist/typescript-4/dist/protocol/index.d.ts +0 -2
  123. package/dist/typescript-4/dist/protocol/reader.d.ts +2 -2
  124. package/dist/typescript-4/dist/protocol/records.d.ts +11 -22
  125. package/dist/typescript-4/dist/protocol/sasl/oauth-bearer.d.ts +3 -3
  126. package/dist/typescript-4/dist/protocol/sasl/plain.d.ts +3 -3
  127. package/dist/typescript-4/dist/protocol/sasl/scram-sha.d.ts +3 -3
  128. package/dist/typescript-4/dist/protocol/sasl/utils.d.ts +3 -3
  129. package/dist/typescript-4/dist/protocol/writer.d.ts +1 -1
  130. package/dist/typescript-4/dist/registries/abstract.d.ts +22 -0
  131. package/dist/typescript-4/dist/registries/confluent-schema-registry.d.ts +41 -0
  132. package/dist/typescript-4/dist/registries/index.d.ts +2 -0
  133. package/dist/typescript-4/dist/utils.d.ts +3 -2
  134. package/dist/utils.d.ts +2 -1
  135. package/dist/utils.js +3 -0
  136. package/dist/version.js +1 -1
  137. package/package.json +13 -10
  138. package/dist/protocol/dynamic-buffer.d.ts +0 -65
  139. package/dist/protocol/dynamic-buffer.js +0 -563
  140. package/dist/protocol/varint.d.ts +0 -12
  141. package/dist/protocol/varint.js +0 -36
  142. package/dist/typescript-4/dist/protocol/dynamic-buffer.d.ts +0 -65
  143. package/dist/typescript-4/dist/protocol/varint.d.ts +0 -12
@@ -0,0 +1,222 @@
1
+ import avro from 'avsc';
2
+ import { createRequire } from 'node:module';
3
+ import { jsonDeserializer, jsonSerializer, stringDeserializer, stringSerializer } from "../clients/serde.js";
4
+ import { ajv, EMPTY_BUFFER, UnsupportedFormatError, UserError } from "../index.js";
5
+ import { getCredential } from "../protocol/sasl/utils.js";
6
+ import { AbstractSchemaRegistry } from "./abstract.js";
7
+ const require = createRequire(import.meta.url);
8
+ /* c8 ignore next 8 */
9
+ export function defaultProtobufTypeMapper(_, type, context) {
10
+ // Confluent Schema Registry convention
11
+ return `${context.topic}-${type}`;
12
+ }
13
+ // TODO(ShogunPanda): Authentication support
14
+ export class ConfluentSchemaRegistry extends AbstractSchemaRegistry {
15
+ #url;
16
+ #schemas;
17
+ #protobufParse;
18
+ #protobufTypeMapper;
19
+ #jsonValidateSend;
20
+ #auth;
21
+ constructor(options) {
22
+ super();
23
+ this.#url = options.url;
24
+ this.#schemas = new Map();
25
+ this.#protobufTypeMapper = options.protobufTypeMapper ?? defaultProtobufTypeMapper;
26
+ this.#jsonValidateSend = options.jsonValidateSend ?? false;
27
+ this.#auth = options.auth;
28
+ }
29
+ getSchemaId(message, type) {
30
+ if (Buffer.isBuffer(message)) {
31
+ if (type !== 'value') {
32
+ return undefined;
33
+ }
34
+ return message.readInt32BE(1);
35
+ }
36
+ return message.metadata?.schemas?.[type];
37
+ }
38
+ get(id) {
39
+ return this.#schemas.get(id);
40
+ }
41
+ async fetchSchema(id, callback) {
42
+ try {
43
+ const requestInit = {};
44
+ if (this.#auth) {
45
+ if (this.#auth.token) {
46
+ const token = await getCredential('token', this.#auth.token);
47
+ requestInit.headers = {
48
+ Authorization: `Bearer ${token}`
49
+ };
50
+ }
51
+ else {
52
+ const username = await getCredential('username', this.#auth.username);
53
+ const password = await getCredential('password', this.#auth.password);
54
+ requestInit.headers = {
55
+ Authorization: `Basic ${Buffer.from(`${username}:${password}`).toString('base64')}`
56
+ };
57
+ }
58
+ }
59
+ const response = await fetch(`${this.#url}/schemas/ids/${id}`, requestInit);
60
+ if (!response.ok) {
61
+ throw new UserError(`Failed to fetch a schema: [HTTP ${response.status}]`, { response: await response.text() });
62
+ }
63
+ const responseBody = await response.json();
64
+ const { schema, schemaType } = responseBody;
65
+ switch (schemaType) {
66
+ case 'AVRO':
67
+ this.#schemas.set(id, { id, type: 'avro', schema: avro.Type.forSchema(JSON.parse(schema)) });
68
+ break;
69
+ case 'PROTOBUF':
70
+ this.#protobufParse ??= this.#loadProtobuf();
71
+ this.#schemas.set(id, { id, type: 'protobuf', schema: this.#protobufParse(schema).root });
72
+ break;
73
+ case 'JSON':
74
+ this.#schemas.set(id, { id, type: 'json', schema: ajv.compile(JSON.parse(schema)) });
75
+ break;
76
+ }
77
+ process.nextTick(callback);
78
+ }
79
+ catch (err) {
80
+ process.nextTick(() => callback(err));
81
+ }
82
+ }
83
+ getSerializers() {
84
+ return {
85
+ key: this.#schemaSerializer.bind(this, 'key', stringSerializer),
86
+ value: this.#schemaSerializer.bind(this, 'value', jsonSerializer),
87
+ headerKey: this.#schemaSerializer.bind(this, 'headerKey', stringSerializer),
88
+ headerValue: this.#schemaSerializer.bind(this, 'headerValue', jsonSerializer)
89
+ };
90
+ }
91
+ getDeserializers() {
92
+ return {
93
+ key: this.#schemaDeserializer.bind(this, 'key', stringDeserializer),
94
+ value: this.#schemaDeserializer.bind(this, 'value', jsonDeserializer),
95
+ headerKey: this.#schemaDeserializer.bind(this, 'headerKey', stringDeserializer),
96
+ headerValue: this.#schemaDeserializer.bind(this, 'headerValue', jsonDeserializer)
97
+ };
98
+ }
99
+ getBeforeSerializationHook() {
100
+ const registry = this;
101
+ return function beforeSerialization(_, type, message, callback) {
102
+ // Extract the schema ID from the message metadata
103
+ const schemaId = registry.getSchemaId(message, type);
104
+ // When no schema ID is found, nothing to do
105
+ if (!schemaId) {
106
+ callback(null);
107
+ return;
108
+ }
109
+ // The schema is already fetch
110
+ if (registry.get(schemaId)) {
111
+ callback(null);
112
+ return;
113
+ }
114
+ registry.fetchSchema(schemaId, callback);
115
+ };
116
+ }
117
+ getBeforeDeserializationHook() {
118
+ const registry = this;
119
+ return function beforeDeserialization(payload, type, _message, callback) {
120
+ // Extract the schema ID from the message metadata
121
+ const schemaId = registry.getSchemaId(payload, type);
122
+ // When no schema ID is found, nothing to do
123
+ if (!schemaId) {
124
+ callback(null);
125
+ return;
126
+ }
127
+ // The schema is already fetch
128
+ if (registry.get(schemaId)) {
129
+ callback(null);
130
+ return;
131
+ }
132
+ registry.fetchSchema(schemaId, callback);
133
+ };
134
+ }
135
+ #schemaSerializer(type, fallbackSerializer, data, headers, message) {
136
+ /* c8 ignore next 3 - Hard to test */
137
+ if (typeof data === 'undefined') {
138
+ return EMPTY_BUFFER;
139
+ }
140
+ if (type === 'headerKey' || type === 'headerValue') {
141
+ message = headers;
142
+ }
143
+ const schemaId = message?.metadata?.schemas?.[type];
144
+ if (!schemaId) {
145
+ return fallbackSerializer(data);
146
+ }
147
+ const schema = this.#schemas.get(schemaId);
148
+ if (!schema) {
149
+ throw new UserError(`Schema with ID ${schemaId} not found.`, { missingSchema: schemaId });
150
+ }
151
+ let encodedMessage;
152
+ switch (schema.type) {
153
+ case 'avro':
154
+ encodedMessage = schema.schema.toBuffer(data);
155
+ break;
156
+ case 'protobuf':
157
+ {
158
+ const typeName = this.#protobufTypeMapper(schemaId, type, message);
159
+ const Type = schema.schema.lookupType(typeName);
160
+ encodedMessage = Buffer.from(Type.encode(Type.create(data)).finish());
161
+ }
162
+ break;
163
+ case 'json':
164
+ if (this.#jsonValidateSend) {
165
+ const validate = schema.schema;
166
+ const valid = validate(data);
167
+ if (!valid) {
168
+ throw new UserError(`JSON Schema validation failed before serialization: ${ajv.errorsText(validate.errors)}`, { type, data, headers, validationErrors: validate.errors });
169
+ }
170
+ }
171
+ encodedMessage = Buffer.from(JSON.stringify(data));
172
+ break;
173
+ }
174
+ const header = Buffer.alloc(5);
175
+ header.writeInt32BE(schemaId, 1);
176
+ return Buffer.concat([header, encodedMessage]);
177
+ }
178
+ #schemaDeserializer(type, fallbackDeserializer, data, headers, message) {
179
+ /* c8 ignore next 3 - Hard to test */
180
+ if (typeof data === 'undefined' || data.length === 0) {
181
+ return EMPTY_BUFFER;
182
+ }
183
+ if (type === 'headerKey' || type === 'headerValue') {
184
+ message = headers;
185
+ }
186
+ const schemaId = this.getSchemaId(data, type);
187
+ if (!schemaId) {
188
+ return fallbackDeserializer(data);
189
+ }
190
+ const schema = this.#schemas.get(schemaId);
191
+ if (!schema) {
192
+ throw new UserError(`Schema with ID ${schemaId} not found.`, { missingSchema: schemaId });
193
+ }
194
+ switch (schema.type) {
195
+ case 'avro':
196
+ return schema.schema.fromBuffer(data.subarray(5));
197
+ case 'protobuf': {
198
+ const typeName = this.#protobufTypeMapper(schemaId, type, message);
199
+ const Type = schema.schema.lookupType(typeName);
200
+ return Type.decode(data.subarray(5));
201
+ }
202
+ case 'json': {
203
+ const parsed = JSON.parse(data.subarray(5).toString('utf-8'));
204
+ const validate = schema.schema;
205
+ const valid = validate(parsed);
206
+ if (!valid) {
207
+ throw new UserError(`JSON Schema validation failed before deserialization: ${ajv.errorsText(validate.errors)}`, { type, data: parsed, headers, validationErrors: validate.errors });
208
+ }
209
+ return parsed;
210
+ }
211
+ }
212
+ }
213
+ #loadProtobuf() {
214
+ try {
215
+ return require('protobufjs').parse;
216
+ /* c8 ignore next 5 - In tests protobufjs is always available */
217
+ }
218
+ catch (e) {
219
+ throw new UnsupportedFormatError('Cannot load protobufjs module, which is an optionalDependency. Please check your local installation.');
220
+ }
221
+ }
222
+ }
@@ -0,0 +1,2 @@
1
+ export * from './abstract.ts';
2
+ export * from './confluent-schema-registry.ts';
@@ -0,0 +1,2 @@
1
+ export * from "./abstract.js";
2
+ export * from "./confluent-schema-registry.js";
@@ -0,0 +1,16 @@
1
+ import { type NullableString } from "../../protocol/definitions";
2
+ import { type Reader } from "../../protocol/reader";
3
+ import { Writer } from "../../protocol/writer";
4
+ import { type Acl } from "../types";
5
+ export type CreateAclsRequest = Parameters<typeof createRequest>;
6
+ export interface CreateAclsResponseResult {
7
+ errorCode: number;
8
+ errorMessage: NullableString;
9
+ }
10
+ export interface CreateAclsResponse {
11
+ throttleTimeMs: number;
12
+ results: CreateAclsResponseResult[];
13
+ }
14
+ export declare function createRequest(creations: Acl[]): Writer;
15
+ export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): CreateAclsResponse;
16
+ export declare const api: import("../definitions").API<[creations: Acl[]], CreateAclsResponse>;
@@ -0,0 +1,21 @@
1
+ import { type NullableString } from "../../protocol/definitions";
2
+ import { type Reader } from "../../protocol/reader";
3
+ import { Writer } from "../../protocol/writer";
4
+ import { type Acl, type AclFilter } from "../types";
5
+ export type DeleteAclsRequest = Parameters<typeof createRequest>;
6
+ export interface DeleteAclsResponseMatchingAcl extends Acl {
7
+ errorCode: number;
8
+ errorMessage: NullableString;
9
+ }
10
+ export interface DeleteAclsResponseFilterResults {
11
+ errorCode: number;
12
+ errorMessage: NullableString;
13
+ matchingAcls: DeleteAclsResponseMatchingAcl[];
14
+ }
15
+ export interface DeleteAclsResponse {
16
+ throttleTimeMs: number;
17
+ filterResults: DeleteAclsResponseFilterResults[];
18
+ }
19
+ export declare function createRequest(filters: AclFilter[]): Writer;
20
+ export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): DeleteAclsResponse;
21
+ export declare const api: import("../definitions").API<[filters: AclFilter[]], DeleteAclsResponse>;
@@ -0,0 +1,17 @@
1
+ import { type NullableString } from "../../protocol/definitions";
2
+ import { type Reader } from "../../protocol/reader";
3
+ import { Writer } from "../../protocol/writer";
4
+ import { type AclPermission, type AclTarget, type AclFilter } from "../types";
5
+ export type DescribeAclsRequest = Parameters<typeof createRequest>;
6
+ export interface DescribeAclsResponseResource extends AclTarget {
7
+ acls: AclPermission[];
8
+ }
9
+ export interface DescribeAclsResponse {
10
+ throttleTimeMs: number;
11
+ errorCode: number;
12
+ errorMessage: NullableString;
13
+ resources: DescribeAclsResponseResource[];
14
+ }
15
+ export declare function createRequest(filter: AclFilter): Writer;
16
+ export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): DescribeAclsResponse;
17
+ export declare const api: import("../definitions").API<[filter: AclFilter], DescribeAclsResponse>;
@@ -0,0 +1,23 @@
1
+ import { type NullableString } from "../../protocol/definitions";
2
+ import { type Reader } from "../../protocol/reader";
3
+ import { Writer } from "../../protocol/writer";
4
+ export type DescribeClusterRequest = Parameters<typeof createRequest>;
5
+ export interface DescribeClusterResponseBroker {
6
+ brokerId: number;
7
+ host: string;
8
+ port: number;
9
+ rack: NullableString;
10
+ }
11
+ export interface DescribeClusterResponse {
12
+ throttleTimeMs: number;
13
+ errorCode: number;
14
+ errorMessage: NullableString;
15
+ endpointType: number;
16
+ clusterId: string;
17
+ controllerId: number;
18
+ brokers: DescribeClusterResponseBroker[];
19
+ clusterAuthorizedOperations: number;
20
+ }
21
+ export declare function createRequest(includeClusterAuthorizedOperations: boolean): Writer;
22
+ export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): DescribeClusterResponse;
23
+ export declare const api: import("../definitions").API<[includeClusterAuthorizedOperations: boolean], DescribeClusterResponse>;
@@ -0,0 +1,32 @@
1
+ import { type Reader } from "../../protocol/reader";
2
+ import { Writer } from "../../protocol/writer";
3
+ export interface DescribeLogDirsRequestTopic {
4
+ name: string;
5
+ partitions: number[];
6
+ }
7
+ export type DescribeLogDirsRequest = Parameters<typeof createRequest>;
8
+ export interface DescribeLogDirsResponsePartition {
9
+ partitionIndex: number;
10
+ partitionSize: bigint;
11
+ offsetLag: bigint;
12
+ isFutureKey: boolean;
13
+ }
14
+ export interface DescribeLogDirsResponseTopic {
15
+ name: string;
16
+ partitions: DescribeLogDirsResponsePartition[];
17
+ }
18
+ export interface DescribeLogDirsResponseResult {
19
+ errorCode: number;
20
+ logDir: string;
21
+ topics: DescribeLogDirsResponseTopic[];
22
+ totalBytes: bigint;
23
+ usableBytes: bigint;
24
+ }
25
+ export interface DescribeLogDirsResponse {
26
+ throttleTimeMs: number;
27
+ errorCode: number;
28
+ results: DescribeLogDirsResponseResult[];
29
+ }
30
+ export declare function createRequest(topics: DescribeLogDirsRequestTopic[]): Writer;
31
+ export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): DescribeLogDirsResponse;
32
+ export declare const api: import("../definitions").API<[topics: DescribeLogDirsRequestTopic[]], DescribeLogDirsResponse>;
@@ -0,0 +1,32 @@
1
+ import { type Reader } from "../../protocol/reader";
2
+ import { Writer } from "../../protocol/writer";
3
+ export interface DescribeLogDirsRequestTopic {
4
+ name: string;
5
+ partitions: number[];
6
+ }
7
+ export type DescribeLogDirsRequest = Parameters<typeof createRequest>;
8
+ export interface DescribeLogDirsResponsePartition {
9
+ partitionIndex: number;
10
+ partitionSize: bigint;
11
+ offsetLag: bigint;
12
+ isFutureKey: boolean;
13
+ }
14
+ export interface DescribeLogDirsResponseTopic {
15
+ name: string;
16
+ partitions: DescribeLogDirsResponsePartition[];
17
+ }
18
+ export interface DescribeLogDirsResponseResult {
19
+ errorCode: number;
20
+ logDir: string;
21
+ topics: DescribeLogDirsResponseTopic[];
22
+ totalBytes: bigint;
23
+ usableBytes: bigint;
24
+ }
25
+ export interface DescribeLogDirsResponse {
26
+ throttleTimeMs: number;
27
+ errorCode: number;
28
+ results: DescribeLogDirsResponseResult[];
29
+ }
30
+ export declare function createRequest(topics: DescribeLogDirsRequestTopic[]): Writer;
31
+ export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): DescribeLogDirsResponse;
32
+ export declare const api: import("../definitions").API<[topics: DescribeLogDirsRequestTopic[]], DescribeLogDirsResponse>;
@@ -5,24 +5,30 @@ export * as alterPartitionV3 from "./alter-partition-v3";
5
5
  export * as alterReplicaLogDirsV2 from "./alter-replica-log-dirs-v2";
6
6
  export * as alterUserScramCredentialsV0 from "./alter-user-scram-credentials-v0";
7
7
  export * as consumerGroupDescribeV0 from "./consumer-group-describe-v0";
8
+ export * as createAclsV2 from "./create-acls-v2";
8
9
  export * as createAclsV3 from "./create-acls-v3";
9
10
  export * as createDelegationTokenV3 from "./create-delegation-token-v3";
10
11
  export * as createPartitionsV1 from "./create-partitions-v1";
11
12
  export * as createPartitionsV2 from "./create-partitions-v2";
12
13
  export * as createPartitionsV3 from "./create-partitions-v3";
13
14
  export * as createTopicsV7 from "./create-topics-v7";
15
+ export * as deleteAclsV2 from "./delete-acls-v2";
14
16
  export * as deleteAclsV3 from "./delete-acls-v3";
15
17
  export * as deleteGroupsV2 from "./delete-groups-v2";
16
18
  export * as deleteRecordsV2 from "./delete-records-v2";
17
19
  export * as deleteTopicsV6 from "./delete-topics-v6";
20
+ export * as describeAclsV2 from "./describe-acls-v2";
18
21
  export * as describeAclsV3 from "./describe-acls-v3";
19
22
  export * as describeClientQuotasV0 from "./describe-client-quotas-v0";
23
+ export * as describeClusterV0 from "./describe-cluster-v0";
20
24
  export * as describeClusterV1 from "./describe-cluster-v1";
21
25
  export * as describeConfigsV2 from "./describe-configs-v2";
22
26
  export * as describeConfigsV3 from "./describe-configs-v3";
23
27
  export * as describeConfigsV4 from "./describe-configs-v4";
24
28
  export * as describeDelegationTokenV3 from "./describe-delegation-token-v3";
25
29
  export * as describeGroupsV5 from "./describe-groups-v5";
30
+ export * as describeLogDirsV2 from "./describe-log-dirs-v2";
31
+ export * as describeLogDirsV3 from "./describe-log-dirs-v3";
26
32
  export * as describeLogDirsV4 from "./describe-log-dirs-v4";
27
33
  export * as describeProducersV0 from "./describe-producers-v0";
28
34
  export * as describeQuorumV2 from "./describe-quorum-v2";
@@ -35,6 +41,7 @@ export * as incrementalAlterConfigsV1 from "./incremental-alter-configs-v1";
35
41
  export * as listGroupsV4 from "./list-groups-v4";
36
42
  export * as listGroupsV5 from "./list-groups-v5";
37
43
  export * as listPartitionReassignmentsV0 from "./list-partition-reassignments-v0";
44
+ export * as listTransactionsV0 from "./list-transactions-v0";
38
45
  export * as listTransactionsV1 from "./list-transactions-v1";
39
46
  export * as offsetDeleteV0 from "./offset-delete-v0";
40
47
  export * as renewDelegationTokenV2 from "./renew-delegation-token-v2";
@@ -0,0 +1,18 @@
1
+ import { type Reader } from "../../protocol/reader";
2
+ import { Writer } from "../../protocol/writer";
3
+ import { type TransactionState } from "../enumerations";
4
+ export type ListTransactionsRequest = Parameters<typeof createRequest>;
5
+ export interface ListTransactionsResponseTransactionState {
6
+ transactionalId: string;
7
+ producerId: bigint;
8
+ transactionState: string;
9
+ }
10
+ export interface ListTransactionsResponse {
11
+ throttleTimeMs: number;
12
+ errorCode: number;
13
+ unknownStateFilters: string[];
14
+ transactionStates: ListTransactionsResponseTransactionState[];
15
+ }
16
+ export declare function createRequest(stateFilters: TransactionState[], producerIdFilters: bigint[]): Writer;
17
+ export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): ListTransactionsResponse;
18
+ export declare const api: import("../definitions").API<[stateFilters: ("EMPTY" | "ONGOING" | "PREPARE_ABORT" | "COMMITTING" | "ABORTING" | "COMPLETE_COMMIT" | "COMPLETE_ABORT")[], producerIdFilters: bigint[]], ListTransactionsResponse>;
@@ -6,8 +6,15 @@ export * as fetchV15 from "./fetch-v15";
6
6
  export * as fetchV16 from "./fetch-v16";
7
7
  export * as fetchV17 from "./fetch-v17";
8
8
  export * as heartbeatV4 from "./heartbeat-v4";
9
+ export * as joinGroupV6 from "./join-group-v6";
10
+ export * as joinGroupV7 from "./join-group-v7";
11
+ export * as joinGroupV8 from "./join-group-v8";
9
12
  export * as joinGroupV9 from "./join-group-v9";
13
+ export * as leaveGroupV4 from "./leave-group-v4";
10
14
  export * as leaveGroupV5 from "./leave-group-v5";
15
+ export * as listOffsetsV5 from "./list-offsets-v5";
16
+ export * as listOffsetsV6 from "./list-offsets-v6";
17
+ export * as listOffsetsV7 from "./list-offsets-v7";
11
18
  export * as listOffsetsV8 from "./list-offsets-v8";
12
19
  export * as listOffsetsV9 from "./list-offsets-v9";
13
20
  export * as offsetCommitV8 from "./offset-commit-v8";
@@ -15,4 +22,5 @@ export * as offsetCommitV9 from "./offset-commit-v9";
15
22
  export * as offsetFetchV8 from "./offset-fetch-v8";
16
23
  export * as offsetFetchV9 from "./offset-fetch-v9";
17
24
  export * as offsetForLeaderEpochV4 from "./offset-for-leader-epoch-v4";
25
+ export * as syncGroupV4 from "./sync-group-v4";
18
26
  export * as syncGroupV5 from "./sync-group-v5";
@@ -0,0 +1,27 @@
1
+ import { type NullableString } from "../../protocol/definitions";
2
+ import { type Reader } from "../../protocol/reader";
3
+ import { Writer } from "../../protocol/writer";
4
+ export interface JoinGroupRequestProtocol {
5
+ name: string;
6
+ metadata?: Buffer | null;
7
+ }
8
+ export type JoinGroupRequest = Parameters<typeof createRequest>;
9
+ export interface JoinGroupResponseMember {
10
+ memberId: string;
11
+ groupInstanceId?: NullableString;
12
+ metadata: Buffer | null;
13
+ }
14
+ export interface JoinGroupResponse {
15
+ throttleTimeMs: number;
16
+ errorCode: number;
17
+ generationId: number;
18
+ protocolType: NullableString;
19
+ protocolName: NullableString;
20
+ leader: string;
21
+ skipAssignment: boolean;
22
+ memberId: NullableString;
23
+ members: JoinGroupResponseMember[];
24
+ }
25
+ export declare function createRequest(groupId: string, sessionTimeoutMs: number, rebalanceTimeoutMs: number, memberId: string, groupInstanceId: NullableString, protocolType: string, protocols: JoinGroupRequestProtocol[]): Writer;
26
+ export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): JoinGroupResponse;
27
+ export declare const api: import("../definitions").API<[groupId: string, sessionTimeoutMs: number, rebalanceTimeoutMs: number, memberId: string, groupInstanceId: NullableString, protocolType: string, protocols: JoinGroupRequestProtocol[]], JoinGroupResponse>;
@@ -0,0 +1,27 @@
1
+ import { type NullableString } from "../../protocol/definitions";
2
+ import { type Reader } from "../../protocol/reader";
3
+ import { Writer } from "../../protocol/writer";
4
+ export interface JoinGroupRequestProtocol {
5
+ name: string;
6
+ metadata?: Buffer | null;
7
+ }
8
+ export type JoinGroupRequest = Parameters<typeof createRequest>;
9
+ export interface JoinGroupResponseMember {
10
+ memberId: string;
11
+ groupInstanceId?: NullableString;
12
+ metadata: Buffer | null;
13
+ }
14
+ export interface JoinGroupResponse {
15
+ throttleTimeMs: number;
16
+ errorCode: number;
17
+ generationId: number;
18
+ protocolType: NullableString;
19
+ protocolName: NullableString;
20
+ leader: string;
21
+ skipAssignment: boolean;
22
+ memberId: NullableString;
23
+ members: JoinGroupResponseMember[];
24
+ }
25
+ export declare function createRequest(groupId: string, sessionTimeoutMs: number, rebalanceTimeoutMs: number, memberId: string, groupInstanceId: NullableString, protocolType: string, protocols: JoinGroupRequestProtocol[]): Writer;
26
+ export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): JoinGroupResponse;
27
+ export declare const api: import("../definitions").API<[groupId: string, sessionTimeoutMs: number, rebalanceTimeoutMs: number, memberId: string, groupInstanceId: NullableString, protocolType: string, protocols: JoinGroupRequestProtocol[]], JoinGroupResponse>;
@@ -0,0 +1,27 @@
1
+ import { type NullableString } from "../../protocol/definitions";
2
+ import { type Reader } from "../../protocol/reader";
3
+ import { Writer } from "../../protocol/writer";
4
+ export interface JoinGroupRequestProtocol {
5
+ name: string;
6
+ metadata?: Buffer | null;
7
+ }
8
+ export type JoinGroupRequest = Parameters<typeof createRequest>;
9
+ export interface JoinGroupResponseMember {
10
+ memberId: string;
11
+ groupInstanceId?: NullableString;
12
+ metadata: Buffer | null;
13
+ }
14
+ export interface JoinGroupResponse {
15
+ throttleTimeMs: number;
16
+ errorCode: number;
17
+ generationId: number;
18
+ protocolType: NullableString;
19
+ protocolName: NullableString;
20
+ leader: string;
21
+ skipAssignment: boolean;
22
+ memberId: NullableString;
23
+ members: JoinGroupResponseMember[];
24
+ }
25
+ export declare function createRequest(groupId: string, sessionTimeoutMs: number, rebalanceTimeoutMs: number, memberId: string, groupInstanceId: NullableString, protocolType: string, protocols: JoinGroupRequestProtocol[], reason?: NullableString): Writer;
26
+ export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): JoinGroupResponse;
27
+ export declare const api: import("../definitions").API<[groupId: string, sessionTimeoutMs: number, rebalanceTimeoutMs: number, memberId: string, groupInstanceId: NullableString, protocolType: string, protocols: JoinGroupRequestProtocol[], reason?: NullableString], JoinGroupResponse>;
@@ -0,0 +1,22 @@
1
+ import { type NullableString } from "../../protocol/definitions";
2
+ import { type Reader } from "../../protocol/reader";
3
+ import { Writer } from "../../protocol/writer";
4
+ export interface LeaveGroupRequestMember {
5
+ memberId: string;
6
+ groupInstanceId?: NullableString;
7
+ reason?: NullableString;
8
+ }
9
+ export type LeaveGroupRequest = Parameters<typeof createRequest>;
10
+ export interface LeaveGroupResponseMember {
11
+ memberId: NullableString;
12
+ groupInstanceId: NullableString;
13
+ errorCode: number;
14
+ }
15
+ export interface LeaveGroupResponse {
16
+ throttleTimeMs: number;
17
+ errorCode: number;
18
+ members: LeaveGroupResponseMember[];
19
+ }
20
+ export declare function createRequest(groupId: string, members: LeaveGroupRequestMember[]): Writer;
21
+ export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): LeaveGroupResponse;
22
+ export declare const api: import("../definitions").API<[groupId: string, members: LeaveGroupRequestMember[]], LeaveGroupResponse>;
@@ -0,0 +1,30 @@
1
+ import { type Reader } from "../../protocol/reader";
2
+ import { Writer } from "../../protocol/writer";
3
+ export interface ListOffsetsRequestPartition {
4
+ partitionIndex: number;
5
+ currentLeaderEpoch: number;
6
+ timestamp: bigint;
7
+ }
8
+ export interface ListOffsetsRequestTopic {
9
+ name: string;
10
+ partitions: ListOffsetsRequestPartition[];
11
+ }
12
+ export type ListOffsetsRequest = Parameters<typeof createRequest>;
13
+ export interface ListOffsetResponsePartition {
14
+ partitionIndex: number;
15
+ errorCode: number;
16
+ timestamp: bigint;
17
+ offset: bigint;
18
+ leaderEpoch: number;
19
+ }
20
+ export interface ListOffsetResponseTopic {
21
+ name: string;
22
+ partitions: ListOffsetResponsePartition[];
23
+ }
24
+ export interface ListOffsetsResponse {
25
+ throttleTimeMs: number;
26
+ topics: ListOffsetResponseTopic[];
27
+ }
28
+ export declare function createRequest(replica: number, isolationLevel: number, topics: ListOffsetsRequestTopic[]): Writer;
29
+ export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): ListOffsetsResponse;
30
+ export declare const api: import("../definitions").API<[replica: number, isolationLevel: number, topics: ListOffsetsRequestTopic[]], ListOffsetsResponse>;
@@ -0,0 +1,30 @@
1
+ import { type Reader } from "../../protocol/reader";
2
+ import { Writer } from "../../protocol/writer";
3
+ export interface ListOffsetsRequestPartition {
4
+ partitionIndex: number;
5
+ currentLeaderEpoch: number;
6
+ timestamp: bigint;
7
+ }
8
+ export interface ListOffsetsRequestTopic {
9
+ name: string;
10
+ partitions: ListOffsetsRequestPartition[];
11
+ }
12
+ export type ListOffsetsRequest = Parameters<typeof createRequest>;
13
+ export interface ListOffsetResponsePartition {
14
+ partitionIndex: number;
15
+ errorCode: number;
16
+ timestamp: bigint;
17
+ offset: bigint;
18
+ leaderEpoch: number;
19
+ }
20
+ export interface ListOffsetResponseTopic {
21
+ name: string;
22
+ partitions: ListOffsetResponsePartition[];
23
+ }
24
+ export interface ListOffsetsResponse {
25
+ throttleTimeMs: number;
26
+ topics: ListOffsetResponseTopic[];
27
+ }
28
+ export declare function createRequest(replica: number, isolationLevel: number, topics: ListOffsetsRequestTopic[]): Writer;
29
+ export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): ListOffsetsResponse;
30
+ export declare const api: import("../definitions").API<[replica: number, isolationLevel: number, topics: ListOffsetsRequestTopic[]], ListOffsetsResponse>;
@@ -0,0 +1,30 @@
1
+ import { type Reader } from "../../protocol/reader";
2
+ import { Writer } from "../../protocol/writer";
3
+ export interface ListOffsetsRequestPartition {
4
+ partitionIndex: number;
5
+ currentLeaderEpoch: number;
6
+ timestamp: bigint;
7
+ }
8
+ export interface ListOffsetsRequestTopic {
9
+ name: string;
10
+ partitions: ListOffsetsRequestPartition[];
11
+ }
12
+ export type ListOffsetsRequest = Parameters<typeof createRequest>;
13
+ export interface ListOffsetResponsePartition {
14
+ partitionIndex: number;
15
+ errorCode: number;
16
+ timestamp: bigint;
17
+ offset: bigint;
18
+ leaderEpoch: number;
19
+ }
20
+ export interface ListOffsetResponseTopic {
21
+ name: string;
22
+ partitions: ListOffsetResponsePartition[];
23
+ }
24
+ export interface ListOffsetsResponse {
25
+ throttleTimeMs: number;
26
+ topics: ListOffsetResponseTopic[];
27
+ }
28
+ export declare function createRequest(replica: number, isolationLevel: number, topics: ListOffsetsRequestTopic[]): Writer;
29
+ export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): ListOffsetsResponse;
30
+ export declare const api: import("../definitions").API<[replica: number, isolationLevel: number, topics: ListOffsetsRequestTopic[]], ListOffsetsResponse>;