@platformatic/kafka 1.29.0 → 1.31.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.
- package/README.md +1 -1
- package/dist/apis/admin/alter-partition-reassignments-v0.d.ts +2 -2
- package/dist/apis/admin/alter-partition-reassignments-v0.js +1 -1
- package/dist/apis/admin/alter-partition-reassignments-v1.d.ts +30 -0
- package/dist/apis/admin/alter-partition-reassignments-v1.js +71 -0
- package/dist/apis/admin/index.d.ts +2 -0
- package/dist/apis/admin/index.js +2 -0
- package/dist/apis/admin/list-transactions-v0.d.ts +3 -2
- package/dist/apis/admin/list-transactions-v0.js +1 -1
- package/dist/apis/admin/list-transactions-v1.d.ts +3 -2
- package/dist/apis/admin/list-transactions-v1.js +1 -1
- package/dist/apis/admin/list-transactions-v2.d.ts +20 -0
- package/dist/apis/admin/list-transactions-v2.js +49 -0
- package/dist/apis/callbacks.js +1 -1
- package/dist/apis/consumer/consumer-group-heartbeat-v0.d.ts +2 -2
- package/dist/apis/consumer/consumer-group-heartbeat-v0.js +1 -1
- package/dist/apis/consumer/consumer-group-heartbeat-v1.d.ts +27 -0
- package/dist/apis/consumer/consumer-group-heartbeat-v1.js +70 -0
- package/dist/apis/consumer/index.d.ts +1 -0
- package/dist/apis/consumer/index.js +1 -0
- package/dist/clients/admin/admin.d.ts +3 -1
- package/dist/clients/admin/admin.js +63 -35
- package/dist/clients/admin/options.d.ts +22 -0
- package/dist/clients/admin/options.js +15 -1
- package/dist/clients/admin/types.d.ts +11 -1
- package/dist/clients/base/base.d.ts +4 -1
- package/dist/clients/base/base.js +17 -2
- package/dist/clients/base/index.d.ts +1 -1
- package/dist/clients/base/index.js +1 -1
- package/dist/clients/base/options.d.ts +1 -0
- package/dist/clients/base/options.js +1 -0
- package/dist/clients/base/types.d.ts +1 -0
- package/dist/clients/consumer/consumer.d.ts +4 -1
- package/dist/clients/consumer/consumer.js +46 -5
- package/dist/clients/consumer/messages-stream.d.ts +1 -0
- package/dist/clients/consumer/messages-stream.js +65 -15
- package/dist/clients/consumer/options.d.ts +3 -0
- package/dist/clients/consumer/options.js +3 -0
- package/dist/clients/consumer/types.d.ts +3 -0
- package/dist/clients/producer/producer.js +13 -3
- package/dist/errors.js +9 -1
- package/dist/network/connection-pool.d.ts +2 -0
- package/dist/network/connection-pool.js +11 -2
- package/dist/network/connection.d.ts +3 -0
- package/dist/network/connection.js +34 -4
- package/dist/registries/abstract.js +4 -0
- package/dist/typescript-4/dist/apis/admin/alter-partition-reassignments-v0.d.ts +2 -2
- package/dist/typescript-4/dist/apis/admin/alter-partition-reassignments-v1.d.ts +30 -0
- package/dist/typescript-4/dist/apis/admin/index.d.ts +2 -0
- package/dist/typescript-4/dist/apis/admin/list-transactions-v0.d.ts +3 -2
- package/dist/typescript-4/dist/apis/admin/list-transactions-v1.d.ts +3 -2
- package/dist/typescript-4/dist/apis/admin/list-transactions-v2.d.ts +20 -0
- package/dist/typescript-4/dist/apis/consumer/consumer-group-heartbeat-v0.d.ts +2 -2
- package/dist/typescript-4/dist/apis/consumer/consumer-group-heartbeat-v1.d.ts +27 -0
- package/dist/typescript-4/dist/apis/consumer/index.d.ts +1 -0
- package/dist/typescript-4/dist/clients/admin/admin.d.ts +3 -1
- package/dist/typescript-4/dist/clients/admin/options.d.ts +22 -0
- package/dist/typescript-4/dist/clients/admin/types.d.ts +11 -1
- package/dist/typescript-4/dist/clients/base/base.d.ts +4 -1
- package/dist/typescript-4/dist/clients/base/index.d.ts +1 -1
- package/dist/typescript-4/dist/clients/base/options.d.ts +1 -0
- package/dist/typescript-4/dist/clients/base/types.d.ts +1 -0
- package/dist/typescript-4/dist/clients/consumer/consumer.d.ts +4 -1
- package/dist/typescript-4/dist/clients/consumer/messages-stream.d.ts +1 -0
- package/dist/typescript-4/dist/clients/consumer/options.d.ts +3 -0
- package/dist/typescript-4/dist/clients/consumer/types.d.ts +3 -0
- package/dist/typescript-4/dist/network/connection-pool.d.ts +2 -0
- package/dist/typescript-4/dist/network/connection.d.ts +3 -0
- package/dist/version.js +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ A modern, high-performance, pure TypeScript/JavaScript type safe client for Apac
|
|
|
16
16
|
|
|
17
17
|
## Supported Kafka Version
|
|
18
18
|
|
|
19
|
-
Supported Kafka version are from **3.5.0** to **4.
|
|
19
|
+
Supported Kafka version are from **3.5.0** to **4.1.0** and equivalent, edges included.
|
|
20
20
|
|
|
21
21
|
## Supported KIPs
|
|
22
22
|
|
|
@@ -25,6 +25,6 @@ export interface AlterPartitionReassignmentsResponse {
|
|
|
25
25
|
errorMessage: NullableString;
|
|
26
26
|
responses: AlterPartitionReassignmentsResponseResponse[];
|
|
27
27
|
}
|
|
28
|
-
export declare function createRequest(timeoutMs: number, topics: AlterPartitionReassignmentsRequestTopic[]): Writer;
|
|
28
|
+
export declare function createRequest(timeoutMs: number, _allowReplicationFactorChange: boolean, topics: AlterPartitionReassignmentsRequestTopic[]): Writer;
|
|
29
29
|
export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): AlterPartitionReassignmentsResponse;
|
|
30
|
-
export declare const api: import("../definitions.ts").API<[timeoutMs: number, topics: AlterPartitionReassignmentsRequestTopic[]], AlterPartitionReassignmentsResponse>;
|
|
30
|
+
export declare const api: import("../definitions.ts").API<[timeoutMs: number, _allowReplicationFactorChange: boolean, topics: AlterPartitionReassignmentsRequestTopic[]], AlterPartitionReassignmentsResponse>;
|
|
@@ -10,7 +10,7 @@ import { createAPI } from "../definitions.js";
|
|
|
10
10
|
partition_index => INT32
|
|
11
11
|
replicas => INT32
|
|
12
12
|
*/
|
|
13
|
-
export function createRequest(timeoutMs, topics) {
|
|
13
|
+
export function createRequest(timeoutMs, _allowReplicationFactorChange, topics) {
|
|
14
14
|
return Writer.create()
|
|
15
15
|
.appendInt32(timeoutMs)
|
|
16
16
|
.appendArray(topics, (w, t) => {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type NullableString } from '../../protocol/definitions.ts';
|
|
2
|
+
import { type Reader } from '../../protocol/reader.ts';
|
|
3
|
+
import { Writer } from '../../protocol/writer.ts';
|
|
4
|
+
export interface AlterPartitionReassignmentsRequestPartition {
|
|
5
|
+
partitionIndex: number;
|
|
6
|
+
replicas: number[];
|
|
7
|
+
}
|
|
8
|
+
export interface AlterPartitionReassignmentsRequestTopic {
|
|
9
|
+
name: string;
|
|
10
|
+
partitions: AlterPartitionReassignmentsRequestPartition[];
|
|
11
|
+
}
|
|
12
|
+
export type AlterPartitionReassignmentsRequest = Parameters<typeof createRequest>;
|
|
13
|
+
export interface AlterPartitionReassignmentsResponsePartition {
|
|
14
|
+
partitionIndex: number;
|
|
15
|
+
errorCode: number;
|
|
16
|
+
errorMessage: NullableString;
|
|
17
|
+
}
|
|
18
|
+
export interface AlterPartitionReassignmentsResponseResponse {
|
|
19
|
+
name: string;
|
|
20
|
+
partitions: AlterPartitionReassignmentsResponsePartition[];
|
|
21
|
+
}
|
|
22
|
+
export interface AlterPartitionReassignmentsResponse {
|
|
23
|
+
throttleTimeMs: number;
|
|
24
|
+
errorCode: number;
|
|
25
|
+
errorMessage: NullableString;
|
|
26
|
+
responses: AlterPartitionReassignmentsResponseResponse[];
|
|
27
|
+
}
|
|
28
|
+
export declare function createRequest(timeoutMs: number, allowReplicationFactorChange: boolean, topics: AlterPartitionReassignmentsRequestTopic[]): Writer;
|
|
29
|
+
export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): AlterPartitionReassignmentsResponse;
|
|
30
|
+
export declare const api: import("../definitions.ts").API<[timeoutMs: number, allowReplicationFactorChange: boolean, topics: AlterPartitionReassignmentsRequestTopic[]], AlterPartitionReassignmentsResponse>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ResponseError } from "../../errors.js";
|
|
2
|
+
import { Writer } from "../../protocol/writer.js";
|
|
3
|
+
import { createAPI } from "../definitions.js";
|
|
4
|
+
/*
|
|
5
|
+
AlterPartitionReassignments Request (Version: 1) => timeout_ms allow_replication_factor_change [topics] TAG_BUFFER
|
|
6
|
+
timeout_ms => INT32
|
|
7
|
+
allow_replication_factor_change => BOOLEAN
|
|
8
|
+
topics => name [partitions] TAG_BUFFER
|
|
9
|
+
name => COMPACT_STRING
|
|
10
|
+
partitions => partition_index [replicas] TAG_BUFFER
|
|
11
|
+
partition_index => INT32
|
|
12
|
+
replicas => INT32
|
|
13
|
+
*/
|
|
14
|
+
export function createRequest(timeoutMs, allowReplicationFactorChange, topics) {
|
|
15
|
+
return Writer.create()
|
|
16
|
+
.appendInt32(timeoutMs)
|
|
17
|
+
.appendBoolean(allowReplicationFactorChange)
|
|
18
|
+
.appendArray(topics, (w, t) => {
|
|
19
|
+
w.appendString(t.name).appendArray(t.partitions, (w, p) => {
|
|
20
|
+
w.appendInt32(p.partitionIndex).appendArray(p.replicas, (w, r) => w.appendInt32(r), true, false);
|
|
21
|
+
});
|
|
22
|
+
})
|
|
23
|
+
.appendTaggedFields();
|
|
24
|
+
}
|
|
25
|
+
/*
|
|
26
|
+
AlterPartitionReassignments Response (Version: 1) => throttle_time_ms error_code error_message [responses] TAG_BUFFER
|
|
27
|
+
throttle_time_ms => INT32
|
|
28
|
+
error_code => INT16
|
|
29
|
+
error_message => COMPACT_NULLABLE_STRING
|
|
30
|
+
responses => name [partitions] TAG_BUFFER
|
|
31
|
+
name => COMPACT_STRING
|
|
32
|
+
partitions => partition_index error_code error_message TAG_BUFFER
|
|
33
|
+
partition_index => INT32
|
|
34
|
+
error_code => INT16
|
|
35
|
+
error_message => COMPACT_NULLABLE_STRING
|
|
36
|
+
*/
|
|
37
|
+
export function parseResponse(_correlationId, apiKey, apiVersion, reader) {
|
|
38
|
+
const errors = [];
|
|
39
|
+
const throttleTimeMs = reader.readInt32();
|
|
40
|
+
const errorCode = reader.readInt16();
|
|
41
|
+
const errorMessage = reader.readNullableString();
|
|
42
|
+
if (errorCode !== 0) {
|
|
43
|
+
errors.push(['', [errorCode, errorMessage]]);
|
|
44
|
+
}
|
|
45
|
+
const response = {
|
|
46
|
+
throttleTimeMs,
|
|
47
|
+
errorCode,
|
|
48
|
+
errorMessage,
|
|
49
|
+
responses: reader.readArray((r, i) => {
|
|
50
|
+
return {
|
|
51
|
+
name: r.readString(),
|
|
52
|
+
partitions: r.readArray((r, j) => {
|
|
53
|
+
const partition = {
|
|
54
|
+
partitionIndex: r.readInt32(),
|
|
55
|
+
errorCode: r.readInt16(),
|
|
56
|
+
errorMessage: r.readNullableString()
|
|
57
|
+
};
|
|
58
|
+
if (partition.errorCode !== 0) {
|
|
59
|
+
errors.push([`responses/${i}/partitions/${j}`, [partition.errorCode, partition.errorMessage]]);
|
|
60
|
+
}
|
|
61
|
+
return partition;
|
|
62
|
+
})
|
|
63
|
+
};
|
|
64
|
+
})
|
|
65
|
+
};
|
|
66
|
+
if (errors.length) {
|
|
67
|
+
throw new ResponseError(apiKey, apiVersion, Object.fromEntries(errors), response);
|
|
68
|
+
}
|
|
69
|
+
return response;
|
|
70
|
+
}
|
|
71
|
+
export const api = createAPI(45, 1, createRequest, parseResponse);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * as alterClientQuotasV1 from './alter-client-quotas-v1.ts';
|
|
2
2
|
export * as alterConfigsV2 from './alter-configs-v2.ts';
|
|
3
3
|
export * as alterPartitionReassignmentsV0 from './alter-partition-reassignments-v0.ts';
|
|
4
|
+
export * as alterPartitionReassignmentsV1 from './alter-partition-reassignments-v1.ts';
|
|
4
5
|
export * as alterPartitionV3 from './alter-partition-v3.ts';
|
|
5
6
|
export * as alterReplicaLogDirsV2 from './alter-replica-log-dirs-v2.ts';
|
|
6
7
|
export * as alterUserScramCredentialsV0 from './alter-user-scram-credentials-v0.ts';
|
|
@@ -43,6 +44,7 @@ export * as listGroupsV5 from './list-groups-v5.ts';
|
|
|
43
44
|
export * as listPartitionReassignmentsV0 from './list-partition-reassignments-v0.ts';
|
|
44
45
|
export * as listTransactionsV0 from './list-transactions-v0.ts';
|
|
45
46
|
export * as listTransactionsV1 from './list-transactions-v1.ts';
|
|
47
|
+
export * as listTransactionsV2 from './list-transactions-v2.ts';
|
|
46
48
|
export * as offsetDeleteV0 from './offset-delete-v0.ts';
|
|
47
49
|
export * as renewDelegationTokenV2 from './renew-delegation-token-v2.ts';
|
|
48
50
|
export * as unregisterBrokerV0 from './unregister-broker-v0.ts';
|
package/dist/apis/admin/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * as alterClientQuotasV1 from "./alter-client-quotas-v1.js";
|
|
2
2
|
export * as alterConfigsV2 from "./alter-configs-v2.js";
|
|
3
3
|
export * as alterPartitionReassignmentsV0 from "./alter-partition-reassignments-v0.js";
|
|
4
|
+
export * as alterPartitionReassignmentsV1 from "./alter-partition-reassignments-v1.js";
|
|
4
5
|
export * as alterPartitionV3 from "./alter-partition-v3.js";
|
|
5
6
|
export * as alterReplicaLogDirsV2 from "./alter-replica-log-dirs-v2.js";
|
|
6
7
|
export * as alterUserScramCredentialsV0 from "./alter-user-scram-credentials-v0.js";
|
|
@@ -43,6 +44,7 @@ export * as listGroupsV5 from "./list-groups-v5.js";
|
|
|
43
44
|
export * as listPartitionReassignmentsV0 from "./list-partition-reassignments-v0.js";
|
|
44
45
|
export * as listTransactionsV0 from "./list-transactions-v0.js";
|
|
45
46
|
export * as listTransactionsV1 from "./list-transactions-v1.js";
|
|
47
|
+
export * as listTransactionsV2 from "./list-transactions-v2.js";
|
|
46
48
|
export * as offsetDeleteV0 from "./offset-delete-v0.js";
|
|
47
49
|
export * as renewDelegationTokenV2 from "./renew-delegation-token-v2.js";
|
|
48
50
|
export * as unregisterBrokerV0 from "./unregister-broker-v0.js";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type NullableString } from '../../protocol/definitions.ts';
|
|
1
2
|
import { type Reader } from '../../protocol/reader.ts';
|
|
2
3
|
import { Writer } from '../../protocol/writer.ts';
|
|
3
4
|
import { type TransactionState } from '../enumerations.ts';
|
|
@@ -13,6 +14,6 @@ export interface ListTransactionsResponse {
|
|
|
13
14
|
unknownStateFilters: string[];
|
|
14
15
|
transactionStates: ListTransactionsResponseTransactionState[];
|
|
15
16
|
}
|
|
16
|
-
export declare function createRequest(stateFilters: TransactionState[], producerIdFilters: bigint[], _durationFilter: bigint): Writer;
|
|
17
|
+
export declare function createRequest(stateFilters: TransactionState[], producerIdFilters: bigint[], _durationFilter: bigint, _transactionalIdPattern: NullableString): Writer;
|
|
17
18
|
export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): ListTransactionsResponse;
|
|
18
|
-
export declare const api: import("../definitions.ts").API<[stateFilters: ("EMPTY" | "ONGOING" | "PREPARE_ABORT" | "COMMITTING" | "ABORTING" | "COMPLETE_COMMIT" | "COMPLETE_ABORT")[], producerIdFilters: bigint[], _durationFilter: bigint], ListTransactionsResponse>;
|
|
19
|
+
export declare const api: import("../definitions.ts").API<[stateFilters: ("EMPTY" | "ONGOING" | "PREPARE_ABORT" | "COMMITTING" | "ABORTING" | "COMPLETE_COMMIT" | "COMPLETE_ABORT")[], producerIdFilters: bigint[], _durationFilter: bigint, _transactionalIdPattern: NullableString], ListTransactionsResponse>;
|
|
@@ -6,7 +6,7 @@ import { createAPI } from "../definitions.js";
|
|
|
6
6
|
state_filters => COMPACT_STRING
|
|
7
7
|
producer_id_filters => INT64
|
|
8
8
|
*/
|
|
9
|
-
export function createRequest(stateFilters, producerIdFilters, _durationFilter) {
|
|
9
|
+
export function createRequest(stateFilters, producerIdFilters, _durationFilter, _transactionalIdPattern) {
|
|
10
10
|
return Writer.create()
|
|
11
11
|
.appendArray(stateFilters, (w, t) => w.appendString(t), true, false)
|
|
12
12
|
.appendArray(producerIdFilters, (w, p) => w.appendInt64(p), true, false)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type NullableString } from '../../protocol/definitions.ts';
|
|
1
2
|
import { type Reader } from '../../protocol/reader.ts';
|
|
2
3
|
import { Writer } from '../../protocol/writer.ts';
|
|
3
4
|
import { type TransactionState } from '../enumerations.ts';
|
|
@@ -13,6 +14,6 @@ export interface ListTransactionsResponse {
|
|
|
13
14
|
unknownStateFilters: string[];
|
|
14
15
|
transactionStates: ListTransactionsResponseTransactionState[];
|
|
15
16
|
}
|
|
16
|
-
export declare function createRequest(stateFilters: TransactionState[], producerIdFilters: bigint[], durationFilter: bigint): Writer;
|
|
17
|
+
export declare function createRequest(stateFilters: TransactionState[], producerIdFilters: bigint[], durationFilter: bigint, _transactionalIdPattern: NullableString): Writer;
|
|
17
18
|
export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): ListTransactionsResponse;
|
|
18
|
-
export declare const api: import("../definitions.ts").API<[stateFilters: ("EMPTY" | "ONGOING" | "PREPARE_ABORT" | "COMMITTING" | "ABORTING" | "COMPLETE_COMMIT" | "COMPLETE_ABORT")[], producerIdFilters: bigint[], durationFilter: bigint], ListTransactionsResponse>;
|
|
19
|
+
export declare const api: import("../definitions.ts").API<[stateFilters: ("EMPTY" | "ONGOING" | "PREPARE_ABORT" | "COMMITTING" | "ABORTING" | "COMPLETE_COMMIT" | "COMPLETE_ABORT")[], producerIdFilters: bigint[], durationFilter: bigint, _transactionalIdPattern: NullableString], ListTransactionsResponse>;
|
|
@@ -7,7 +7,7 @@ import { createAPI } from "../definitions.js";
|
|
|
7
7
|
producer_id_filters => INT64
|
|
8
8
|
duration_filter => INT64
|
|
9
9
|
*/
|
|
10
|
-
export function createRequest(stateFilters, producerIdFilters, durationFilter) {
|
|
10
|
+
export function createRequest(stateFilters, producerIdFilters, durationFilter, _transactionalIdPattern) {
|
|
11
11
|
return Writer.create()
|
|
12
12
|
.appendArray(stateFilters, (w, t) => w.appendString(t), true, false)
|
|
13
13
|
.appendArray(producerIdFilters, (w, p) => w.appendInt64(p), true, false)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type NullableString } from '../../protocol/definitions.ts';
|
|
2
|
+
import { type Reader } from '../../protocol/reader.ts';
|
|
3
|
+
import { Writer } from '../../protocol/writer.ts';
|
|
4
|
+
import { type TransactionState } from '../enumerations.ts';
|
|
5
|
+
export type ListTransactionsRequest = Parameters<typeof createRequest>;
|
|
6
|
+
export interface ListTransactionsResponseTransactionState {
|
|
7
|
+
transactionalId: string;
|
|
8
|
+
producerId: bigint;
|
|
9
|
+
transactionState: string;
|
|
10
|
+
}
|
|
11
|
+
export interface ListTransactionsResponse {
|
|
12
|
+
throttleTimeMs: number;
|
|
13
|
+
errorCode: number;
|
|
14
|
+
errorMessage: NullableString;
|
|
15
|
+
unknownStateFilters: string[];
|
|
16
|
+
transactionStates: ListTransactionsResponseTransactionState[];
|
|
17
|
+
}
|
|
18
|
+
export declare function createRequest(stateFilters: TransactionState[], producerIdFilters: bigint[], durationFilter: bigint, transactionalIdPattern: NullableString): Writer;
|
|
19
|
+
export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): ListTransactionsResponse;
|
|
20
|
+
export declare const api: import("../definitions.ts").API<[stateFilters: ("EMPTY" | "ONGOING" | "PREPARE_ABORT" | "COMMITTING" | "ABORTING" | "COMPLETE_COMMIT" | "COMPLETE_ABORT")[], producerIdFilters: bigint[], durationFilter: bigint, transactionalIdPattern: NullableString], ListTransactionsResponse>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ResponseError } from "../../errors.js";
|
|
2
|
+
import { Writer } from "../../protocol/writer.js";
|
|
3
|
+
import { createAPI } from "../definitions.js";
|
|
4
|
+
/*
|
|
5
|
+
ListTransactions Request (Version: 2) => [state_filters] [producer_id_filters] duration_filter transactional_id_pattern TAG_BUFFER
|
|
6
|
+
state_filters => COMPACT_STRING
|
|
7
|
+
producer_id_filters => INT64
|
|
8
|
+
duration_filter => INT64
|
|
9
|
+
transactional_id_pattern => COMPACT_NULLABLE_STRING
|
|
10
|
+
*/
|
|
11
|
+
export function createRequest(stateFilters, producerIdFilters, durationFilter, transactionalIdPattern) {
|
|
12
|
+
return Writer.create()
|
|
13
|
+
.appendArray(stateFilters, (w, t) => w.appendString(t), true, false)
|
|
14
|
+
.appendArray(producerIdFilters, (w, p) => w.appendInt64(p), true, false)
|
|
15
|
+
.appendInt64(durationFilter)
|
|
16
|
+
.appendString(transactionalIdPattern)
|
|
17
|
+
.appendTaggedFields();
|
|
18
|
+
}
|
|
19
|
+
/*
|
|
20
|
+
ListTransactions Response (Version: 2) => throttle_time_ms error_code error_message [unknown_state_filters] [transaction_states] TAG_BUFFER
|
|
21
|
+
throttle_time_ms => INT32
|
|
22
|
+
error_code => INT16
|
|
23
|
+
error_message => COMPACT_NULLABLE_STRING
|
|
24
|
+
unknown_state_filters => COMPACT_STRING
|
|
25
|
+
transaction_states => transactional_id producer_id transaction_state TAG_BUFFER
|
|
26
|
+
transactional_id => COMPACT_STRING
|
|
27
|
+
producer_id => INT64
|
|
28
|
+
transaction_state => COMPACT_STRING
|
|
29
|
+
*/
|
|
30
|
+
export function parseResponse(_correlationId, apiKey, apiVersion, reader) {
|
|
31
|
+
const response = {
|
|
32
|
+
throttleTimeMs: reader.readInt32(),
|
|
33
|
+
errorCode: reader.readInt16(),
|
|
34
|
+
errorMessage: reader.readNullableString(),
|
|
35
|
+
unknownStateFilters: reader.readArray(r => r.readString(), true, false),
|
|
36
|
+
transactionStates: reader.readArray(r => {
|
|
37
|
+
return {
|
|
38
|
+
transactionalId: r.readString(),
|
|
39
|
+
producerId: r.readInt64(),
|
|
40
|
+
transactionState: r.readString()
|
|
41
|
+
};
|
|
42
|
+
})
|
|
43
|
+
};
|
|
44
|
+
if (response.errorCode !== 0) {
|
|
45
|
+
throw new ResponseError(apiKey, apiVersion, { '/': [response.errorCode, response.errorMessage] }, response);
|
|
46
|
+
}
|
|
47
|
+
return response;
|
|
48
|
+
}
|
|
49
|
+
export const api = createAPI(66, 2, createRequest, parseResponse);
|
package/dist/apis/callbacks.js
CHANGED
|
@@ -35,7 +35,7 @@ export function runConcurrentCallbacks(errorMessage, collection, operation, call
|
|
|
35
35
|
}
|
|
36
36
|
remaining--;
|
|
37
37
|
if (remaining === 0) {
|
|
38
|
-
callback(hasErrors ? new MultipleErrors(errorMessage, errors) : null, results);
|
|
38
|
+
callback(hasErrors ? new MultipleErrors(errorMessage, errors.filter(Boolean)) : null, results);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
if (remaining === 0) {
|
|
@@ -22,6 +22,6 @@ export interface ConsumerGroupHeartbeatResponse {
|
|
|
22
22
|
heartbeatIntervalMs: number;
|
|
23
23
|
assignment: ConsumerGroupHeartbeatResponseAssignment | null;
|
|
24
24
|
}
|
|
25
|
-
export declare function createRequest(groupId: string, memberId: string, memberEpoch: number, instanceId: NullableString, rackId: NullableString, rebalanceTimeoutMs: number, subscribedTopicNames: string[] | null, serverAssignor: NullableString, topicPartitions: ConsumerGroupHeartbeatRequestTopicPartition[]): Writer;
|
|
25
|
+
export declare function createRequest(groupId: string, memberId: string, memberEpoch: number, instanceId: NullableString, rackId: NullableString, rebalanceTimeoutMs: number, subscribedTopicNames: string[] | null, _subscribedTopicRegex: NullableString, serverAssignor: NullableString, topicPartitions: ConsumerGroupHeartbeatRequestTopicPartition[]): Writer;
|
|
26
26
|
export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): ConsumerGroupHeartbeatResponse;
|
|
27
|
-
export declare const api: import("../definitions.ts").API<[groupId: string, memberId: string, memberEpoch: number, instanceId: NullableString, rackId: NullableString, rebalanceTimeoutMs: number, subscribedTopicNames: string[] | null, serverAssignor: NullableString, topicPartitions: ConsumerGroupHeartbeatRequestTopicPartition[]], ConsumerGroupHeartbeatResponse>;
|
|
27
|
+
export declare const api: import("../definitions.ts").API<[groupId: string, memberId: string, memberEpoch: number, instanceId: NullableString, rackId: NullableString, rebalanceTimeoutMs: number, subscribedTopicNames: string[] | null, _subscribedTopicRegex: NullableString, serverAssignor: NullableString, topicPartitions: ConsumerGroupHeartbeatRequestTopicPartition[]], ConsumerGroupHeartbeatResponse>;
|
|
@@ -15,7 +15,7 @@ import { createAPI } from "../definitions.js";
|
|
|
15
15
|
topic_id => UUID
|
|
16
16
|
partitions => INT32
|
|
17
17
|
*/
|
|
18
|
-
export function createRequest(groupId, memberId, memberEpoch, instanceId, rackId, rebalanceTimeoutMs, subscribedTopicNames, serverAssignor, topicPartitions) {
|
|
18
|
+
export function createRequest(groupId, memberId, memberEpoch, instanceId, rackId, rebalanceTimeoutMs, subscribedTopicNames, _subscribedTopicRegex, serverAssignor, topicPartitions) {
|
|
19
19
|
return Writer.create()
|
|
20
20
|
.appendString(groupId)
|
|
21
21
|
.appendString(memberId)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type NullableString } from '../../protocol/definitions.ts';
|
|
2
|
+
import { type Reader } from '../../protocol/reader.ts';
|
|
3
|
+
import { Writer } from '../../protocol/writer.ts';
|
|
4
|
+
export interface ConsumerGroupHeartbeatRequestTopicPartition {
|
|
5
|
+
topicId: string;
|
|
6
|
+
partitions: number[];
|
|
7
|
+
}
|
|
8
|
+
export type ConsumerGroupHeartbeatRequest = Parameters<typeof createRequest>;
|
|
9
|
+
export interface ConsumerGroupHeartbeatResponseAssignmentTopicPartition {
|
|
10
|
+
topicId: string;
|
|
11
|
+
partitions: number[];
|
|
12
|
+
}
|
|
13
|
+
export interface ConsumerGroupHeartbeatResponseAssignment {
|
|
14
|
+
topicPartitions: ConsumerGroupHeartbeatResponseAssignmentTopicPartition[];
|
|
15
|
+
}
|
|
16
|
+
export interface ConsumerGroupHeartbeatResponse {
|
|
17
|
+
throttleTimeMs: number;
|
|
18
|
+
errorCode: number;
|
|
19
|
+
errorMessage: NullableString;
|
|
20
|
+
memberId: NullableString;
|
|
21
|
+
memberEpoch: number;
|
|
22
|
+
heartbeatIntervalMs: number;
|
|
23
|
+
assignment: ConsumerGroupHeartbeatResponseAssignment | null;
|
|
24
|
+
}
|
|
25
|
+
export declare function createRequest(groupId: string, memberId: string, memberEpoch: number, instanceId: NullableString, rackId: NullableString, rebalanceTimeoutMs: number, subscribedTopicNames: string[] | null, subscribedTopicRegex: NullableString, serverAssignor: NullableString, topicPartitions: ConsumerGroupHeartbeatRequestTopicPartition[]): Writer;
|
|
26
|
+
export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): ConsumerGroupHeartbeatResponse;
|
|
27
|
+
export declare const api: import("../definitions.ts").API<[groupId: string, memberId: string, memberEpoch: number, instanceId: NullableString, rackId: NullableString, rebalanceTimeoutMs: number, subscribedTopicNames: string[] | null, subscribedTopicRegex: NullableString, serverAssignor: NullableString, topicPartitions: ConsumerGroupHeartbeatRequestTopicPartition[]], ConsumerGroupHeartbeatResponse>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { ResponseError } from "../../errors.js";
|
|
2
|
+
import { Writer } from "../../protocol/writer.js";
|
|
3
|
+
import { createAPI } from "../definitions.js";
|
|
4
|
+
/*
|
|
5
|
+
ConsumerGroupHeartbeat Request (Version: 1) => group_id member_id member_epoch instance_id rack_id rebalance_timeout_ms [subscribed_topic_names] subscribed_topic_regex server_assignor [topic_partitions] TAG_BUFFER
|
|
6
|
+
group_id => COMPACT_STRING
|
|
7
|
+
member_id => COMPACT_STRING
|
|
8
|
+
member_epoch => INT32
|
|
9
|
+
instance_id => COMPACT_NULLABLE_STRING
|
|
10
|
+
rack_id => COMPACT_NULLABLE_STRING
|
|
11
|
+
rebalance_timeout_ms => INT32
|
|
12
|
+
subscribed_topic_names => COMPACT_STRING
|
|
13
|
+
subscribed_topic_regex => COMPACT_NULLABLE_STRING
|
|
14
|
+
server_assignor => COMPACT_NULLABLE_STRING
|
|
15
|
+
topic_partitions => topic_id [partitions] TAG_BUFFER
|
|
16
|
+
topic_id => UUID
|
|
17
|
+
partitions => INT32
|
|
18
|
+
*/
|
|
19
|
+
export function createRequest(groupId, memberId, memberEpoch, instanceId, rackId, rebalanceTimeoutMs, subscribedTopicNames, subscribedTopicRegex, serverAssignor, topicPartitions) {
|
|
20
|
+
return Writer.create()
|
|
21
|
+
.appendString(groupId)
|
|
22
|
+
.appendString(memberId)
|
|
23
|
+
.appendInt32(memberEpoch)
|
|
24
|
+
.appendString(instanceId)
|
|
25
|
+
.appendString(rackId)
|
|
26
|
+
.appendInt32(rebalanceTimeoutMs)
|
|
27
|
+
.appendArray(subscribedTopicNames, (w, t) => w.appendString(t), true, false)
|
|
28
|
+
.appendString(subscribedTopicRegex)
|
|
29
|
+
.appendString(serverAssignor)
|
|
30
|
+
.appendArray(topicPartitions, (w, t) => {
|
|
31
|
+
return w.appendUUID(t.topicId).appendArray(t.partitions, (w, p) => w.appendInt32(p), true, false);
|
|
32
|
+
})
|
|
33
|
+
.appendTaggedFields();
|
|
34
|
+
}
|
|
35
|
+
/*
|
|
36
|
+
ConsumerGroupHeartbeat Response (Version: 1) => throttle_time_ms error_code error_message member_id member_epoch heartbeat_interval_ms assignment TAG_BUFFER
|
|
37
|
+
throttle_time_ms => INT32
|
|
38
|
+
error_code => INT16
|
|
39
|
+
error_message => COMPACT_NULLABLE_STRING
|
|
40
|
+
member_id => COMPACT_NULLABLE_STRING
|
|
41
|
+
member_epoch => INT32
|
|
42
|
+
heartbeat_interval_ms => INT32
|
|
43
|
+
assignment => [topic_partitions] TAG_BUFFER
|
|
44
|
+
topic_partitions => topic_id [partitions] TAG_BUFFER
|
|
45
|
+
topic_id => UUID
|
|
46
|
+
partitions => INT32
|
|
47
|
+
*/
|
|
48
|
+
export function parseResponse(_correlationId, apiKey, apiVersion, reader) {
|
|
49
|
+
const response = {
|
|
50
|
+
throttleTimeMs: reader.readInt32(),
|
|
51
|
+
errorCode: reader.readInt16(),
|
|
52
|
+
errorMessage: reader.readNullableString(),
|
|
53
|
+
memberId: reader.readNullableString(),
|
|
54
|
+
memberEpoch: reader.readInt32(),
|
|
55
|
+
heartbeatIntervalMs: reader.readInt32(),
|
|
56
|
+
assignment: reader.readNullableStruct(() => ({
|
|
57
|
+
topicPartitions: reader.readArray(r => {
|
|
58
|
+
return {
|
|
59
|
+
topicId: r.readUUID(),
|
|
60
|
+
partitions: r.readArray(r => r.readInt32(), true, false)
|
|
61
|
+
};
|
|
62
|
+
})
|
|
63
|
+
}))
|
|
64
|
+
};
|
|
65
|
+
if (response.errorCode !== 0) {
|
|
66
|
+
throw new ResponseError(apiKey, apiVersion, { '/': [response.errorCode, response.errorMessage] }, response);
|
|
67
|
+
}
|
|
68
|
+
return response;
|
|
69
|
+
}
|
|
70
|
+
export const api = createAPI(68, 1, createRequest, parseResponse);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * as consumerGroupHeartbeatV0 from './consumer-group-heartbeat-v0.ts';
|
|
2
|
+
export * as consumerGroupHeartbeatV1 from './consumer-group-heartbeat-v1.ts';
|
|
2
3
|
export * as fetchV12 from './fetch-v12.ts';
|
|
3
4
|
export * as fetchV13 from './fetch-v13.ts';
|
|
4
5
|
export * as fetchV14 from './fetch-v14.ts';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * as consumerGroupHeartbeatV0 from "./consumer-group-heartbeat-v0.js";
|
|
2
|
+
export * as consumerGroupHeartbeatV1 from "./consumer-group-heartbeat-v1.js";
|
|
2
3
|
export * as fetchV12 from "./fetch-v12.js";
|
|
3
4
|
export * as fetchV13 from "./fetch-v13.js";
|
|
4
5
|
export * as fetchV14 from "./fetch-v14.js";
|
|
@@ -5,7 +5,7 @@ import { type CallbackWithPromise } from '../../apis/callbacks.ts';
|
|
|
5
5
|
import { type Callback } from '../../apis/definitions.ts';
|
|
6
6
|
import { type Acl } from '../../apis/types.ts';
|
|
7
7
|
import { Base } from '../base/base.ts';
|
|
8
|
-
import { type AdminListOffsetsOptions, type AdminOptions, type AlterClientQuotasOptions, type AlterConfigsOptions, type AlterConsumerGroupOffsetsOptions, type BrokerLogDirDescription, type ConfigDescription, type CreateAclsOptions, type CreatedTopic, type CreatePartitionsOptions, type CreateTopicsOptions, type DeleteAclsOptions, type DeleteConsumerGroupOffsetsOptions, type DeleteRecordsOptions, type DeleteGroupsOptions, type DeleteTopicsOptions, type DeletedRecordsTopic, type DescribeAclsOptions, type DescribeClientQuotasOptions, type DescribeConfigsOptions, type DescribeGroupsOptions, type DescribeLogDirsOptions, type Group, type GroupBase, type IncrementalAlterConfigsOptions, type ListConsumerGroupOffsetsGroup, type ListConsumerGroupOffsetsOptions, type ListedOffsetsTopic, type ListGroupsOptions, type ListTopicsOptions, type RemoveMembersFromConsumerGroupOptions } from './types.ts';
|
|
8
|
+
import { type AdminListOffsetsOptions, type AdminOptions, type AlterClientQuotasOptions, type AlterConfigsOptions, type AlterConsumerGroupOffsetsOptions, type BrokerLogDirDescription, type ConfigDescription, type CreateAclsOptions, type CreatedTopic, type CreatePartitionsOptions, type CreateTopicsOptions, type DeleteAclsOptions, type DeleteConsumerGroupOffsetsOptions, type DeleteRecordsOptions, type DeleteGroupsOptions, type DeleteTopicsOptions, type DeletedRecordsTopic, type DescribeAclsOptions, type DescribeClientQuotasOptions, type DescribeConfigsOptions, type DescribeGroupsOptions, type DescribeLogDirsOptions, type FindCoordinatorOptions, type FindCoordinatorResult, type Group, type GroupBase, type IncrementalAlterConfigsOptions, type ListConsumerGroupOffsetsGroup, type ListConsumerGroupOffsetsOptions, type ListedOffsetsTopic, type ListGroupsOptions, type ListTopicsOptions, type RemoveMembersFromConsumerGroupOptions } from './types.ts';
|
|
9
9
|
export declare class Admin extends Base<AdminOptions> {
|
|
10
10
|
#private;
|
|
11
11
|
constructor(options: AdminOptions);
|
|
@@ -21,6 +21,8 @@ export declare class Admin extends Base<AdminOptions> {
|
|
|
21
21
|
listGroups(options?: ListGroupsOptions): Promise<Map<string, GroupBase>>;
|
|
22
22
|
describeGroups(options: DescribeGroupsOptions, callback: CallbackWithPromise<Map<string, Group>>): void;
|
|
23
23
|
describeGroups(options: DescribeGroupsOptions): Promise<Map<string, Group>>;
|
|
24
|
+
findCoordinator(options: FindCoordinatorOptions, callback: CallbackWithPromise<FindCoordinatorResult[]>): void;
|
|
25
|
+
findCoordinator(options: FindCoordinatorOptions): Promise<FindCoordinatorResult[]>;
|
|
24
26
|
deleteGroups(options: DeleteGroupsOptions, callback: CallbackWithPromise<void>): void;
|
|
25
27
|
deleteGroups(options: DeleteGroupsOptions): Promise<void>;
|
|
26
28
|
removeMembersFromConsumerGroup(options: RemoveMembersFromConsumerGroupOptions, callback: CallbackWithPromise<void>): void;
|