@platformatic/kafka 0.1.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/LICENSE +201 -0
- package/README.md +270 -0
- package/dist/apis/admin/alter-client-quotas.d.ts +33 -0
- package/dist/apis/admin/alter-client-quotas.js +64 -0
- package/dist/apis/admin/alter-configs.d.ts +26 -0
- package/dist/apis/admin/alter-configs.js +57 -0
- package/dist/apis/admin/alter-partition-reassignments.d.ts +30 -0
- package/dist/apis/admin/alter-partition-reassignments.js +68 -0
- package/dist/apis/admin/alter-partition.d.ts +39 -0
- package/dist/apis/admin/alter-partition.js +87 -0
- package/dist/apis/admin/alter-replica-log-dirs.d.ts +26 -0
- package/dist/apis/admin/alter-replica-log-dirs.js +55 -0
- package/dist/apis/admin/alter-user-scram-credentials.d.ts +27 -0
- package/dist/apis/admin/alter-user-scram-credentials.js +60 -0
- package/dist/apis/admin/consumer-group-describe.d.ts +41 -0
- package/dist/apis/admin/consumer-group-describe.js +103 -0
- package/dist/apis/admin/create-acls.d.ts +24 -0
- package/dist/apis/admin/create-acls.js +55 -0
- package/dist/apis/admin/create-delegation-token.d.ts +24 -0
- package/dist/apis/admin/create-delegation-token.js +54 -0
- package/dist/apis/admin/create-partitions.d.ts +24 -0
- package/dist/apis/admin/create-partitions.js +54 -0
- package/dist/apis/admin/create-topics.d.ts +42 -0
- package/dist/apis/admin/create-topics.js +86 -0
- package/dist/apis/admin/delete-acls.d.ts +36 -0
- package/dist/apis/admin/delete-acls.js +82 -0
- package/dist/apis/admin/delete-groups.d.ts +14 -0
- package/dist/apis/admin/delete-groups.js +40 -0
- package/dist/apis/admin/delete-records.d.ts +27 -0
- package/dist/apis/admin/delete-records.js +59 -0
- package/dist/apis/admin/delete-topics.d.ts +21 -0
- package/dist/apis/admin/delete-topics.js +50 -0
- package/dist/apis/admin/describe-acls.d.ts +25 -0
- package/dist/apis/admin/describe-acls.js +66 -0
- package/dist/apis/admin/describe-client-quotas.d.ts +30 -0
- package/dist/apis/admin/describe-client-quotas.js +57 -0
- package/dist/apis/admin/describe-cluster.d.ts +23 -0
- package/dist/apis/admin/describe-cluster.js +50 -0
- package/dist/apis/admin/describe-configs.d.ts +38 -0
- package/dist/apis/admin/describe-configs.js +85 -0
- package/dist/apis/admin/describe-delegation-token.d.ts +31 -0
- package/dist/apis/admin/describe-delegation-token.js +62 -0
- package/dist/apis/admin/describe-groups.d.ts +28 -0
- package/dist/apis/admin/describe-groups.js +67 -0
- package/dist/apis/admin/describe-log-dirs.d.ts +32 -0
- package/dist/apis/admin/describe-log-dirs.js +75 -0
- package/dist/apis/admin/describe-producers.d.ts +33 -0
- package/dist/apis/admin/describe-producers.js +70 -0
- package/dist/apis/admin/describe-quorum.d.ts +50 -0
- package/dist/apis/admin/describe-quorum.js +116 -0
- package/dist/apis/admin/describe-topic-partitions.d.ts +42 -0
- package/dist/apis/admin/describe-topic-partitions.js +94 -0
- package/dist/apis/admin/describe-transactions.d.ts +24 -0
- package/dist/apis/admin/describe-transactions.js +59 -0
- package/dist/apis/admin/describe-user-scram-credentials.d.ts +26 -0
- package/dist/apis/admin/describe-user-scram-credentials.js +62 -0
- package/dist/apis/admin/envelope.d.ts +10 -0
- package/dist/apis/admin/envelope.js +32 -0
- package/dist/apis/admin/expire-delegation-token.d.ts +11 -0
- package/dist/apis/admin/expire-delegation-token.js +29 -0
- package/dist/apis/admin/incremental-alter-configs.d.ts +27 -0
- package/dist/apis/admin/incremental-alter-configs.js +58 -0
- package/dist/apis/admin/index.d.ts +37 -0
- package/dist/apis/admin/index.js +37 -0
- package/dist/apis/admin/list-groups.d.ts +18 -0
- package/dist/apis/admin/list-groups.js +43 -0
- package/dist/apis/admin/list-partition-reassignments.d.ts +27 -0
- package/dist/apis/admin/list-partition-reassignments.js +56 -0
- package/dist/apis/admin/list-transactions.d.ts +18 -0
- package/dist/apis/admin/list-transactions.js +45 -0
- package/dist/apis/admin/offset-delete.d.ts +26 -0
- package/dist/apis/admin/offset-delete.js +59 -0
- package/dist/apis/admin/renew-delegation-token.d.ts +11 -0
- package/dist/apis/admin/renew-delegation-token.js +29 -0
- package/dist/apis/admin/unregister-broker.d.ts +12 -0
- package/dist/apis/admin/unregister-broker.js +28 -0
- package/dist/apis/admin/update-features.d.ts +23 -0
- package/dist/apis/admin/update-features.js +60 -0
- package/dist/apis/consumer/consumer-group-heartbeat.d.ts +27 -0
- package/dist/apis/consumer/consumer-group-heartbeat.js +70 -0
- package/dist/apis/consumer/fetch.d.ts +46 -0
- package/dist/apis/consumer/fetch.js +121 -0
- package/dist/apis/consumer/heartbeat.d.ts +11 -0
- package/dist/apis/consumer/heartbeat.js +34 -0
- package/dist/apis/consumer/index.d.ts +9 -0
- package/dist/apis/consumer/index.js +9 -0
- package/dist/apis/consumer/join-group.d.ts +27 -0
- package/dist/apis/consumer/join-group.js +71 -0
- package/dist/apis/consumer/leave-group.d.ts +22 -0
- package/dist/apis/consumer/leave-group.js +57 -0
- package/dist/apis/consumer/list-offsets.d.ts +30 -0
- package/dist/apis/consumer/list-offsets.js +68 -0
- package/dist/apis/consumer/offset-commit.d.ts +29 -0
- package/dist/apis/consumer/offset-commit.js +68 -0
- package/dist/apis/consumer/offset-fetch.d.ts +37 -0
- package/dist/apis/consumer/offset-fetch.js +81 -0
- package/dist/apis/consumer/sync-group.d.ts +18 -0
- package/dist/apis/consumer/sync-group.js +49 -0
- package/dist/apis/definitions.d.ts +16 -0
- package/dist/apis/definitions.js +12 -0
- package/dist/apis/enumerations.d.ts +114 -0
- package/dist/apis/enumerations.js +78 -0
- package/dist/apis/index.d.ts +8 -0
- package/dist/apis/index.js +10 -0
- package/dist/apis/metadata/api-versions.d.ts +17 -0
- package/dist/apis/metadata/api-versions.js +41 -0
- package/dist/apis/metadata/find-coordinator.d.ts +19 -0
- package/dist/apis/metadata/find-coordinator.js +50 -0
- package/dist/apis/metadata/index.d.ts +3 -0
- package/dist/apis/metadata/index.js +3 -0
- package/dist/apis/metadata/metadata.d.ts +37 -0
- package/dist/apis/metadata/metadata.js +92 -0
- package/dist/apis/producer/add-offsets-to-txn.d.ts +10 -0
- package/dist/apis/producer/add-offsets-to-txn.js +34 -0
- package/dist/apis/producer/add-partitions-to-txn.d.ts +34 -0
- package/dist/apis/producer/add-partitions-to-txn.js +79 -0
- package/dist/apis/producer/end-txn.d.ts +10 -0
- package/dist/apis/producer/end-txn.js +34 -0
- package/dist/apis/producer/index.d.ts +6 -0
- package/dist/apis/producer/index.js +6 -0
- package/dist/apis/producer/init-producer-id.d.ts +21 -0
- package/dist/apis/producer/init-producer-id.js +38 -0
- package/dist/apis/producer/produce.d.ts +29 -0
- package/dist/apis/producer/produce.js +104 -0
- package/dist/apis/producer/txn-offset-commit.d.ts +29 -0
- package/dist/apis/producer/txn-offset-commit.js +77 -0
- package/dist/apis/security/index.d.ts +2 -0
- package/dist/apis/security/index.js +2 -0
- package/dist/apis/security/sasl-authenticate.d.ts +15 -0
- package/dist/apis/security/sasl-authenticate.js +30 -0
- package/dist/apis/security/sasl-handshake.d.ts +10 -0
- package/dist/apis/security/sasl-handshake.js +28 -0
- package/dist/apis/telemetry/get-telemetry-subscriptions.d.ts +18 -0
- package/dist/apis/telemetry/get-telemetry-subscriptions.js +46 -0
- package/dist/apis/telemetry/index.d.ts +3 -0
- package/dist/apis/telemetry/index.js +3 -0
- package/dist/apis/telemetry/list-client-metrics-resources.d.ts +14 -0
- package/dist/apis/telemetry/list-client-metrics-resources.js +32 -0
- package/dist/apis/telemetry/push-telemetry.d.ts +10 -0
- package/dist/apis/telemetry/push-telemetry.js +36 -0
- package/dist/clients/admin/admin.d.ts +18 -0
- package/dist/clients/admin/admin.js +322 -0
- package/dist/clients/admin/index.d.ts +3 -0
- package/dist/clients/admin/index.js +3 -0
- package/dist/clients/admin/options.d.ts +135 -0
- package/dist/clients/admin/options.js +81 -0
- package/dist/clients/admin/types.d.ts +56 -0
- package/dist/clients/admin/types.js +1 -0
- package/dist/clients/base/base.d.ts +48 -0
- package/dist/clients/base/base.js +242 -0
- package/dist/clients/base/index.d.ts +3 -0
- package/dist/clients/base/index.js +3 -0
- package/dist/clients/base/options.d.ts +115 -0
- package/dist/clients/base/options.js +59 -0
- package/dist/clients/base/types.d.ts +38 -0
- package/dist/clients/base/types.js +1 -0
- package/dist/clients/callbacks.d.ts +8 -0
- package/dist/clients/callbacks.js +42 -0
- package/dist/clients/consumer/consumer.d.ts +33 -0
- package/dist/clients/consumer/consumer.js +767 -0
- package/dist/clients/consumer/index.d.ts +5 -0
- package/dist/clients/consumer/index.js +5 -0
- package/dist/clients/consumer/messages-stream.d.ts +56 -0
- package/dist/clients/consumer/messages-stream.js +404 -0
- package/dist/clients/consumer/options.d.ts +521 -0
- package/dist/clients/consumer/options.js +177 -0
- package/dist/clients/consumer/topics-map.d.ts +8 -0
- package/dist/clients/consumer/topics-map.js +48 -0
- package/dist/clients/consumer/types.d.ts +74 -0
- package/dist/clients/consumer/types.js +11 -0
- package/dist/clients/index.d.ts +6 -0
- package/dist/clients/index.js +6 -0
- package/dist/clients/producer/index.d.ts +3 -0
- package/dist/clients/producer/index.js +3 -0
- package/dist/clients/producer/options.d.ts +122 -0
- package/dist/clients/producer/options.js +47 -0
- package/dist/clients/producer/producer.d.ts +13 -0
- package/dist/clients/producer/producer.js +272 -0
- package/dist/clients/producer/types.d.ts +29 -0
- package/dist/clients/producer/types.js +1 -0
- package/dist/clients/serde.d.ts +40 -0
- package/dist/clients/serde.js +49 -0
- package/dist/errors.d.ts +67 -0
- package/dist/errors.js +160 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +10 -0
- package/dist/network/connection-pool.d.ts +11 -0
- package/dist/network/connection-pool.js +101 -0
- package/dist/network/connection.d.ts +49 -0
- package/dist/network/connection.js +319 -0
- package/dist/network/index.d.ts +2 -0
- package/dist/network/index.js +2 -0
- package/dist/protocol/apis.d.ts +2 -0
- package/dist/protocol/apis.js +191 -0
- package/dist/protocol/compression.d.ts +70 -0
- package/dist/protocol/compression.js +114 -0
- package/dist/protocol/crc32c.d.ts +2 -0
- package/dist/protocol/crc32c.js +83 -0
- package/dist/protocol/definitions.d.ts +12 -0
- package/dist/protocol/definitions.js +11 -0
- package/dist/protocol/dynamic-buffer.d.ts +65 -0
- package/dist/protocol/dynamic-buffer.js +557 -0
- package/dist/protocol/errors.d.ts +8 -0
- package/dist/protocol/errors.js +908 -0
- package/dist/protocol/index.d.ts +14 -0
- package/dist/protocol/index.js +14 -0
- package/dist/protocol/murmur2.d.ts +1 -0
- package/dist/protocol/murmur2.js +55 -0
- package/dist/protocol/reader.d.ts +58 -0
- package/dist/protocol/reader.js +296 -0
- package/dist/protocol/records.d.ts +110 -0
- package/dist/protocol/records.js +149 -0
- package/dist/protocol/sasl/plain.d.ts +3 -0
- package/dist/protocol/sasl/plain.js +3 -0
- package/dist/protocol/sasl/scram-sha.d.ts +28 -0
- package/dist/protocol/sasl/scram-sha.js +104 -0
- package/dist/protocol/varint.d.ts +12 -0
- package/dist/protocol/varint.js +36 -0
- package/dist/protocol/writer.d.ts +48 -0
- package/dist/protocol/writer.js +223 -0
- package/dist/utils.d.ts +20 -0
- package/dist/utils.js +127 -0
- package/package.json +75 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export * as alterClientQuotasV1 from './alter-client-quotas.ts';
|
|
2
|
+
export * as alterConfigsV2 from './alter-configs.ts';
|
|
3
|
+
export * as alterPartitionReassignmentsV0 from './alter-partition-reassignments.ts';
|
|
4
|
+
export * as alterPartitionV3 from './alter-partition.ts';
|
|
5
|
+
export * as alterReplicaLogDirsV2 from './alter-replica-log-dirs.ts';
|
|
6
|
+
export * as alterUserScramCredentialsV0 from './alter-user-scram-credentials.ts';
|
|
7
|
+
export * as consumerGroupDescribeV0 from './consumer-group-describe.ts';
|
|
8
|
+
export * as createAclsV3 from './create-acls.ts';
|
|
9
|
+
export * as createDelegationTokenV3 from './create-delegation-token.ts';
|
|
10
|
+
export * as createPartitionsV3 from './create-partitions.ts';
|
|
11
|
+
export * as createTopicsV7 from './create-topics.ts';
|
|
12
|
+
export * as deleteAclsV3 from './delete-acls.ts';
|
|
13
|
+
export * as deleteGroupsV2 from './delete-groups.ts';
|
|
14
|
+
export * as deleteRecordsV2 from './delete-records.ts';
|
|
15
|
+
export * as deleteTopicsV6 from './delete-topics.ts';
|
|
16
|
+
export * as describeAclsV3 from './describe-acls.ts';
|
|
17
|
+
export * as describeClientQuotasV0 from './describe-client-quotas.ts';
|
|
18
|
+
export * as describeClusterV1 from './describe-cluster.ts';
|
|
19
|
+
export * as describeConfigsV4 from './describe-configs.ts';
|
|
20
|
+
export * as describeDelegationTokenV3 from './describe-delegation-token.ts';
|
|
21
|
+
export * as describeGroupsV5 from './describe-groups.ts';
|
|
22
|
+
export * as describeLogDirsV4 from './describe-log-dirs.ts';
|
|
23
|
+
export * as describeProducersV0 from './describe-producers.ts';
|
|
24
|
+
export * as describeQuorumV2 from './describe-quorum.ts';
|
|
25
|
+
export * as describeTopicPartitionsV0 from './describe-topic-partitions.ts';
|
|
26
|
+
export * as describeTransactionsV0 from './describe-transactions.ts';
|
|
27
|
+
export * as describeUserScramCredentialsV0 from './describe-user-scram-credentials.ts';
|
|
28
|
+
export * as envelopeV0 from './envelope.ts';
|
|
29
|
+
export * as expireDelegationTokenV2 from './expire-delegation-token.ts';
|
|
30
|
+
export * as incrementalAlterConfigsV1 from './incremental-alter-configs.ts';
|
|
31
|
+
export * as listGroupsV5 from './list-groups.ts';
|
|
32
|
+
export * as listPartitionReassignmentsV0 from './list-partition-reassignments.ts';
|
|
33
|
+
export * as listTransactionsV1 from './list-transactions.ts';
|
|
34
|
+
export * as offsetDeleteV0 from './offset-delete.ts';
|
|
35
|
+
export * as renewDelegationTokenV2 from './renew-delegation-token.ts';
|
|
36
|
+
export * as unregisterBrokerV0 from './unregister-broker.ts';
|
|
37
|
+
export * as updateFeaturesV1 from './update-features.ts';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export * as alterClientQuotasV1 from "./alter-client-quotas.js";
|
|
2
|
+
export * as alterConfigsV2 from "./alter-configs.js";
|
|
3
|
+
export * as alterPartitionReassignmentsV0 from "./alter-partition-reassignments.js";
|
|
4
|
+
export * as alterPartitionV3 from "./alter-partition.js";
|
|
5
|
+
export * as alterReplicaLogDirsV2 from "./alter-replica-log-dirs.js";
|
|
6
|
+
export * as alterUserScramCredentialsV0 from "./alter-user-scram-credentials.js";
|
|
7
|
+
export * as consumerGroupDescribeV0 from "./consumer-group-describe.js";
|
|
8
|
+
export * as createAclsV3 from "./create-acls.js";
|
|
9
|
+
export * as createDelegationTokenV3 from "./create-delegation-token.js";
|
|
10
|
+
export * as createPartitionsV3 from "./create-partitions.js";
|
|
11
|
+
export * as createTopicsV7 from "./create-topics.js";
|
|
12
|
+
export * as deleteAclsV3 from "./delete-acls.js";
|
|
13
|
+
export * as deleteGroupsV2 from "./delete-groups.js";
|
|
14
|
+
export * as deleteRecordsV2 from "./delete-records.js";
|
|
15
|
+
export * as deleteTopicsV6 from "./delete-topics.js";
|
|
16
|
+
export * as describeAclsV3 from "./describe-acls.js";
|
|
17
|
+
export * as describeClientQuotasV0 from "./describe-client-quotas.js";
|
|
18
|
+
export * as describeClusterV1 from "./describe-cluster.js";
|
|
19
|
+
export * as describeConfigsV4 from "./describe-configs.js";
|
|
20
|
+
export * as describeDelegationTokenV3 from "./describe-delegation-token.js";
|
|
21
|
+
export * as describeGroupsV5 from "./describe-groups.js";
|
|
22
|
+
export * as describeLogDirsV4 from "./describe-log-dirs.js";
|
|
23
|
+
export * as describeProducersV0 from "./describe-producers.js";
|
|
24
|
+
export * as describeQuorumV2 from "./describe-quorum.js";
|
|
25
|
+
export * as describeTopicPartitionsV0 from "./describe-topic-partitions.js";
|
|
26
|
+
export * as describeTransactionsV0 from "./describe-transactions.js";
|
|
27
|
+
export * as describeUserScramCredentialsV0 from "./describe-user-scram-credentials.js";
|
|
28
|
+
export * as envelopeV0 from "./envelope.js";
|
|
29
|
+
export * as expireDelegationTokenV2 from "./expire-delegation-token.js";
|
|
30
|
+
export * as incrementalAlterConfigsV1 from "./incremental-alter-configs.js";
|
|
31
|
+
export * as listGroupsV5 from "./list-groups.js";
|
|
32
|
+
export * as listPartitionReassignmentsV0 from "./list-partition-reassignments.js";
|
|
33
|
+
export * as listTransactionsV1 from "./list-transactions.js";
|
|
34
|
+
export * as offsetDeleteV0 from "./offset-delete.js";
|
|
35
|
+
export * as renewDelegationTokenV2 from "./renew-delegation-token.js";
|
|
36
|
+
export * as unregisterBrokerV0 from "./unregister-broker.js";
|
|
37
|
+
export * as updateFeaturesV1 from "./update-features.js";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type Reader } from '../../protocol/reader.ts';
|
|
2
|
+
import { Writer } from '../../protocol/writer.ts';
|
|
3
|
+
import { type ConsumerGroupState } from '../enumerations.ts';
|
|
4
|
+
export type ListGroupsRequest = Parameters<typeof createRequest>;
|
|
5
|
+
export interface ListGroupsResponseGroup {
|
|
6
|
+
groupId: string;
|
|
7
|
+
protocolType: string;
|
|
8
|
+
groupState: string;
|
|
9
|
+
groupType: string;
|
|
10
|
+
}
|
|
11
|
+
export interface ListGroupsResponse {
|
|
12
|
+
throttleTimeMs: number;
|
|
13
|
+
errorCode: number;
|
|
14
|
+
groups: ListGroupsResponseGroup[];
|
|
15
|
+
}
|
|
16
|
+
export declare function createRequest(statesFilter: ConsumerGroupState[], typesFilter: string[]): Writer;
|
|
17
|
+
export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): ListGroupsResponse;
|
|
18
|
+
export declare const api: import("../definitions.ts").API<[statesFilter: ("PREPARING_REBALANCE" | "COMPLETING_REBALANCE" | "STABLE" | "DEAD" | "EMPTY")[], typesFilter: string[]], ListGroupsResponse>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ResponseError } from "../../errors.js";
|
|
2
|
+
import { Writer } from "../../protocol/writer.js";
|
|
3
|
+
import { createAPI } from "../definitions.js";
|
|
4
|
+
/*
|
|
5
|
+
ListGroups Request (Version: 5) => [states_filter] [types_filter] TAG_BUFFER
|
|
6
|
+
states_filter => COMPACT_STRING
|
|
7
|
+
types_filter => COMPACT_STRING
|
|
8
|
+
*/
|
|
9
|
+
export function createRequest(statesFilter, typesFilter) {
|
|
10
|
+
return Writer.create()
|
|
11
|
+
.appendArray(statesFilter, (w, s) => w.appendString(s), true, false)
|
|
12
|
+
.appendArray(typesFilter, (w, t) => w.appendString(t), true, false)
|
|
13
|
+
.appendTaggedFields();
|
|
14
|
+
}
|
|
15
|
+
/*
|
|
16
|
+
ListGroups Response (Version: 5) => throttle_time_ms error_code [groups] TAG_BUFFER
|
|
17
|
+
throttle_time_ms => INT32
|
|
18
|
+
error_code => INT16
|
|
19
|
+
groups => group_id protocol_type group_state group_type TAG_BUFFER
|
|
20
|
+
group_id => COMPACT_STRING
|
|
21
|
+
protocol_type => COMPACT_STRING
|
|
22
|
+
group_state => COMPACT_STRING
|
|
23
|
+
group_type => COMPACT_STRING
|
|
24
|
+
*/
|
|
25
|
+
export function parseResponse(_correlationId, apiKey, apiVersion, reader) {
|
|
26
|
+
const response = {
|
|
27
|
+
throttleTimeMs: reader.readInt32(),
|
|
28
|
+
errorCode: reader.readInt16(),
|
|
29
|
+
groups: reader.readArray(r => {
|
|
30
|
+
return {
|
|
31
|
+
groupId: r.readNullableString(),
|
|
32
|
+
protocolType: r.readString(),
|
|
33
|
+
groupState: r.readString(),
|
|
34
|
+
groupType: r.readString()
|
|
35
|
+
};
|
|
36
|
+
})
|
|
37
|
+
};
|
|
38
|
+
if (response.errorCode !== 0) {
|
|
39
|
+
throw new ResponseError(apiKey, apiVersion, { '': response.errorCode }, response);
|
|
40
|
+
}
|
|
41
|
+
return response;
|
|
42
|
+
}
|
|
43
|
+
export const api = createAPI(16, 5, createRequest, parseResponse);
|
|
@@ -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 ListPartitionReassignmentsRequestTopic {
|
|
5
|
+
name: string;
|
|
6
|
+
partitionIndexes: number[];
|
|
7
|
+
}
|
|
8
|
+
export type ListPartitionReassignmentsRequest = Parameters<typeof createRequest>;
|
|
9
|
+
export interface ListPartitionReassignmentsResponsePartition {
|
|
10
|
+
partitionIndex: number;
|
|
11
|
+
replicas: number[];
|
|
12
|
+
addingReplicas: number[];
|
|
13
|
+
removingReplicas: number[];
|
|
14
|
+
}
|
|
15
|
+
export interface ListPartitionReassignmentsResponseTopic {
|
|
16
|
+
name: string;
|
|
17
|
+
partitions: ListPartitionReassignmentsResponsePartition[];
|
|
18
|
+
}
|
|
19
|
+
export interface ListPartitionReassignmentsResponse {
|
|
20
|
+
throttleTimeMs: number;
|
|
21
|
+
errorCode: number;
|
|
22
|
+
errorMessage: NullableString;
|
|
23
|
+
topics: ListPartitionReassignmentsResponseTopic[];
|
|
24
|
+
}
|
|
25
|
+
export declare function createRequest(timeoutMs: number, topics: ListPartitionReassignmentsRequestTopic[]): Writer;
|
|
26
|
+
export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): ListPartitionReassignmentsResponse;
|
|
27
|
+
export declare const api: import("../definitions.ts").API<[timeoutMs: number, topics: ListPartitionReassignmentsRequestTopic[]], ListPartitionReassignmentsResponse>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ResponseError } from "../../errors.js";
|
|
2
|
+
import { Writer } from "../../protocol/writer.js";
|
|
3
|
+
import { createAPI } from "../definitions.js";
|
|
4
|
+
/*
|
|
5
|
+
ListPartitionReassignments Request (Version: 0) => timeout_ms [topics] TAG_BUFFER
|
|
6
|
+
timeout_ms => INT32
|
|
7
|
+
topics => name [partition_indexes] TAG_BUFFER
|
|
8
|
+
name => COMPACT_STRING
|
|
9
|
+
partition_indexes => INT32
|
|
10
|
+
*/
|
|
11
|
+
export function createRequest(timeoutMs, topics) {
|
|
12
|
+
return Writer.create()
|
|
13
|
+
.appendInt32(timeoutMs)
|
|
14
|
+
.appendArray(topics, (w, t) => {
|
|
15
|
+
w.appendString(t.name).appendArray(t.partitionIndexes, (w, p) => w.appendInt32(p), true, false);
|
|
16
|
+
})
|
|
17
|
+
.appendTaggedFields();
|
|
18
|
+
}
|
|
19
|
+
/*
|
|
20
|
+
ListPartitionReassignments Response (Version: 0) => throttle_time_ms error_code error_message [topics] TAG_BUFFER
|
|
21
|
+
throttle_time_ms => INT32
|
|
22
|
+
error_code => INT16
|
|
23
|
+
error_message => COMPACT_NULLABLE_STRING
|
|
24
|
+
topics => name [partitions] TAG_BUFFER
|
|
25
|
+
name => COMPACT_STRING
|
|
26
|
+
partitions => partition_index [replicas] [adding_replicas] [removing_replicas] TAG_BUFFER
|
|
27
|
+
partition_index => INT32
|
|
28
|
+
replicas => INT32
|
|
29
|
+
adding_replicas => INT32
|
|
30
|
+
removing_replicas => INT32
|
|
31
|
+
*/
|
|
32
|
+
export function parseResponse(_correlationId, apiKey, apiVersion, reader) {
|
|
33
|
+
const response = {
|
|
34
|
+
throttleTimeMs: reader.readInt32(),
|
|
35
|
+
errorCode: reader.readInt16(),
|
|
36
|
+
errorMessage: reader.readNullableString(),
|
|
37
|
+
topics: reader.readArray(r => {
|
|
38
|
+
return {
|
|
39
|
+
name: r.readString(),
|
|
40
|
+
partitions: r.readArray(r => {
|
|
41
|
+
return {
|
|
42
|
+
partitionIndex: r.readInt32(),
|
|
43
|
+
replicas: r.readArray(r => r.readInt32(), true, false),
|
|
44
|
+
addingReplicas: r.readArray(r => r.readInt32(), true, false),
|
|
45
|
+
removingReplicas: r.readArray(r => r.readInt32(), true, false)
|
|
46
|
+
};
|
|
47
|
+
})
|
|
48
|
+
};
|
|
49
|
+
})
|
|
50
|
+
};
|
|
51
|
+
if (response.errorCode !== 0) {
|
|
52
|
+
throw new ResponseError(apiKey, apiVersion, { '': response.errorCode }, response);
|
|
53
|
+
}
|
|
54
|
+
return response;
|
|
55
|
+
}
|
|
56
|
+
export const api = createAPI(46, 0, createRequest, parseResponse);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type Reader } from '../../protocol/reader.ts';
|
|
2
|
+
import { Writer } from '../../protocol/writer.ts';
|
|
3
|
+
import { type TransactionState } from '../enumerations.ts';
|
|
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[], durationFilter: bigint): Writer;
|
|
17
|
+
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>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ResponseError } from "../../errors.js";
|
|
2
|
+
import { Writer } from "../../protocol/writer.js";
|
|
3
|
+
import { createAPI } from "../definitions.js";
|
|
4
|
+
/*
|
|
5
|
+
ListTransactions Request (Version: 1) => [state_filters] [producer_id_filters] duration_filter TAG_BUFFER
|
|
6
|
+
state_filters => COMPACT_STRING
|
|
7
|
+
producer_id_filters => INT64
|
|
8
|
+
duration_filter => INT64
|
|
9
|
+
*/
|
|
10
|
+
export function createRequest(stateFilters, producerIdFilters, durationFilter) {
|
|
11
|
+
return Writer.create()
|
|
12
|
+
.appendArray(stateFilters, (w, t) => w.appendString(t), true, false)
|
|
13
|
+
.appendArray(producerIdFilters, (w, p) => w.appendInt64(p), true, false)
|
|
14
|
+
.appendInt64(durationFilter)
|
|
15
|
+
.appendTaggedFields();
|
|
16
|
+
}
|
|
17
|
+
/*
|
|
18
|
+
ListTransactions Response (Version: 1) => throttle_time_ms error_code [unknown_state_filters] [transaction_states] TAG_BUFFER
|
|
19
|
+
throttle_time_ms => INT32
|
|
20
|
+
error_code => INT16
|
|
21
|
+
unknown_state_filters => COMPACT_STRING
|
|
22
|
+
transaction_states => transactional_id producer_id transaction_state TAG_BUFFER
|
|
23
|
+
transactional_id => COMPACT_STRING
|
|
24
|
+
producer_id => INT64
|
|
25
|
+
transaction_state => COMPACT_STRING
|
|
26
|
+
*/
|
|
27
|
+
export function parseResponse(_correlationId, apiKey, apiVersion, reader) {
|
|
28
|
+
const response = {
|
|
29
|
+
throttleTimeMs: reader.readInt32(),
|
|
30
|
+
errorCode: reader.readInt16(),
|
|
31
|
+
unknownStateFilters: reader.readArray(r => r.readString(), true, false),
|
|
32
|
+
transactionStates: reader.readArray(r => {
|
|
33
|
+
return {
|
|
34
|
+
transactionalId: r.readString(),
|
|
35
|
+
producerId: r.readInt64(),
|
|
36
|
+
transactionState: r.readString()
|
|
37
|
+
};
|
|
38
|
+
})
|
|
39
|
+
};
|
|
40
|
+
if (response.errorCode !== 0) {
|
|
41
|
+
throw new ResponseError(apiKey, apiVersion, { '': response.errorCode }, response);
|
|
42
|
+
}
|
|
43
|
+
return response;
|
|
44
|
+
}
|
|
45
|
+
export const api = createAPI(66, 1, createRequest, parseResponse);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type Reader } from '../../protocol/reader.ts';
|
|
2
|
+
import { Writer } from '../../protocol/writer.ts';
|
|
3
|
+
export interface OffsetDeleteRequestPartition {
|
|
4
|
+
partitionIndex: number;
|
|
5
|
+
}
|
|
6
|
+
export interface OffsetDeleteRequestTopic {
|
|
7
|
+
name: string;
|
|
8
|
+
partitions: OffsetDeleteRequestPartition[];
|
|
9
|
+
}
|
|
10
|
+
export type OffsetDeleteRequest = Parameters<typeof createRequest>;
|
|
11
|
+
export interface OffsetDeleteResponsePartition {
|
|
12
|
+
partitionIndex: number;
|
|
13
|
+
errorCode: number;
|
|
14
|
+
}
|
|
15
|
+
export interface OffsetDeleteResponseTopic {
|
|
16
|
+
name: string;
|
|
17
|
+
partitions: OffsetDeleteResponsePartition[];
|
|
18
|
+
}
|
|
19
|
+
export interface OffsetDeleteResponse {
|
|
20
|
+
errorCode: number;
|
|
21
|
+
throttleTimeMs: number;
|
|
22
|
+
topics: OffsetDeleteResponseTopic[];
|
|
23
|
+
}
|
|
24
|
+
export declare function createRequest(groupId: string, topics: OffsetDeleteRequestTopic[]): Writer;
|
|
25
|
+
export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): OffsetDeleteResponse;
|
|
26
|
+
export declare const api: import("../definitions.ts").API<[groupId: string, topics: OffsetDeleteRequestTopic[]], OffsetDeleteResponse>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ResponseError } from "../../errors.js";
|
|
2
|
+
import { Writer } from "../../protocol/writer.js";
|
|
3
|
+
import { createAPI } from "../definitions.js";
|
|
4
|
+
/*
|
|
5
|
+
OffsetDelete Request (Version: 0) => group_id [topics]
|
|
6
|
+
group_id => STRING
|
|
7
|
+
topics => name [partitions]
|
|
8
|
+
name => STRING
|
|
9
|
+
partitions => partition_index
|
|
10
|
+
partition_index => INT32
|
|
11
|
+
*/
|
|
12
|
+
export function createRequest(groupId, topics) {
|
|
13
|
+
return Writer.create()
|
|
14
|
+
.appendString(groupId, false)
|
|
15
|
+
.appendArray(topics, (w, t) => {
|
|
16
|
+
w.appendString(t.name, false).appendArray(t.partitions, (w, p) => w.appendInt32(p.partitionIndex), false, false);
|
|
17
|
+
}, false, false);
|
|
18
|
+
}
|
|
19
|
+
/*
|
|
20
|
+
OffsetDelete Response (Version: 0) => error_code throttle_time_ms [topics]
|
|
21
|
+
error_code => INT16
|
|
22
|
+
throttle_time_ms => INT32
|
|
23
|
+
topics => name [partitions]
|
|
24
|
+
name => STRING
|
|
25
|
+
partitions => partition_index error_code
|
|
26
|
+
partition_index => INT32
|
|
27
|
+
error_code => INT16
|
|
28
|
+
*/
|
|
29
|
+
export function parseResponse(_correlationId, apiKey, apiVersion, reader) {
|
|
30
|
+
const errors = [];
|
|
31
|
+
const errorCode = reader.readInt16();
|
|
32
|
+
if (errorCode !== 0) {
|
|
33
|
+
errors.push(['', errorCode]);
|
|
34
|
+
}
|
|
35
|
+
const response = {
|
|
36
|
+
errorCode,
|
|
37
|
+
throttleTimeMs: reader.readInt32(),
|
|
38
|
+
topics: reader.readArray((r, i) => {
|
|
39
|
+
return {
|
|
40
|
+
name: r.readString(),
|
|
41
|
+
partitions: r.readArray((r, j) => {
|
|
42
|
+
const partition = {
|
|
43
|
+
partitionIndex: r.readInt32(),
|
|
44
|
+
errorCode: r.readInt16()
|
|
45
|
+
};
|
|
46
|
+
if (partition.errorCode !== 0) {
|
|
47
|
+
errors.push([`/topics/${i}/partitions/${j}`, partition.errorCode]);
|
|
48
|
+
}
|
|
49
|
+
return partition;
|
|
50
|
+
})
|
|
51
|
+
};
|
|
52
|
+
})
|
|
53
|
+
};
|
|
54
|
+
if (errors.length) {
|
|
55
|
+
throw new ResponseError(apiKey, apiVersion, Object.fromEntries(errors), response);
|
|
56
|
+
}
|
|
57
|
+
return response;
|
|
58
|
+
}
|
|
59
|
+
export const api = createAPI(47, 0, createRequest, parseResponse, false, false);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Reader } from '../../protocol/reader.ts';
|
|
2
|
+
import { Writer } from '../../protocol/writer.ts';
|
|
3
|
+
export type RenewDelegationTokenRequest = Parameters<typeof createRequest>;
|
|
4
|
+
export interface RenewDelegationTokenResponse {
|
|
5
|
+
errorCode: number;
|
|
6
|
+
expiryTimestampMs: bigint;
|
|
7
|
+
throttleTimeMs: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function createRequest(hmac: Buffer, renewPeriodMs: bigint): Writer;
|
|
10
|
+
export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): RenewDelegationTokenResponse;
|
|
11
|
+
export declare const api: import("../definitions.ts").API<[hmac: Buffer<ArrayBufferLike>, renewPeriodMs: bigint], RenewDelegationTokenResponse>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ResponseError } from "../../errors.js";
|
|
2
|
+
import { Writer } from "../../protocol/writer.js";
|
|
3
|
+
import { createAPI } from "../definitions.js";
|
|
4
|
+
/*
|
|
5
|
+
RenewDelegationToken Request (Version: 2) => hmac renew_period_ms TAG_BUFFER
|
|
6
|
+
hmac => COMPACT_BYTES
|
|
7
|
+
renew_period_ms => INT64
|
|
8
|
+
*/
|
|
9
|
+
export function createRequest(hmac, renewPeriodMs) {
|
|
10
|
+
return Writer.create().appendBytes(hmac).appendInt64(renewPeriodMs).appendTaggedFields();
|
|
11
|
+
}
|
|
12
|
+
/*
|
|
13
|
+
RenewDelegationToken Response (Version: 2) => error_code expiry_timestamp_ms throttle_time_ms TAG_BUFFER
|
|
14
|
+
error_code => INT16
|
|
15
|
+
expiry_timestamp_ms => INT64
|
|
16
|
+
throttle_time_ms => INT32
|
|
17
|
+
*/
|
|
18
|
+
export function parseResponse(_correlationId, apiKey, apiVersion, reader) {
|
|
19
|
+
const response = {
|
|
20
|
+
errorCode: reader.readInt16(),
|
|
21
|
+
expiryTimestampMs: reader.readInt64(),
|
|
22
|
+
throttleTimeMs: reader.readInt32()
|
|
23
|
+
};
|
|
24
|
+
if (response.errorCode !== 0) {
|
|
25
|
+
throw new ResponseError(apiKey, apiVersion, { '': response.errorCode }, response);
|
|
26
|
+
}
|
|
27
|
+
return response;
|
|
28
|
+
}
|
|
29
|
+
export const api = createAPI(39, 2, createRequest, parseResponse);
|
|
@@ -0,0 +1,12 @@
|
|
|
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 type UnregisterBrokerRequest = Parameters<typeof createRequest>;
|
|
5
|
+
export interface UnregisterBrokerResponse {
|
|
6
|
+
throttleTimeMs: number;
|
|
7
|
+
errorCode: number;
|
|
8
|
+
errorMessage: NullableString;
|
|
9
|
+
}
|
|
10
|
+
export declare function createRequest(brokerId: number): Writer;
|
|
11
|
+
export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): UnregisterBrokerResponse;
|
|
12
|
+
export declare const api: import("../definitions.ts").API<[brokerId: number], UnregisterBrokerResponse>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ResponseError } from "../../errors.js";
|
|
2
|
+
import { Writer } from "../../protocol/writer.js";
|
|
3
|
+
import { createAPI } from "../definitions.js";
|
|
4
|
+
/*
|
|
5
|
+
UnregisterBroker Request (Version: 0) => broker_id TAG_BUFFER
|
|
6
|
+
broker_id => INT32
|
|
7
|
+
*/
|
|
8
|
+
export function createRequest(brokerId) {
|
|
9
|
+
return Writer.create().appendInt32(brokerId).appendTaggedFields();
|
|
10
|
+
}
|
|
11
|
+
/*
|
|
12
|
+
UnregisterBroker Response (Version: 0) => throttle_time_ms error_code error_message TAG_BUFFER
|
|
13
|
+
throttle_time_ms => INT32
|
|
14
|
+
error_code => INT16
|
|
15
|
+
error_message => COMPACT_NULLABLE_STRING
|
|
16
|
+
*/
|
|
17
|
+
export function parseResponse(_correlationId, apiKey, apiVersion, reader) {
|
|
18
|
+
const response = {
|
|
19
|
+
throttleTimeMs: reader.readInt32(),
|
|
20
|
+
errorCode: reader.readInt16(),
|
|
21
|
+
errorMessage: reader.readNullableString()
|
|
22
|
+
};
|
|
23
|
+
if (response.errorCode !== 0) {
|
|
24
|
+
throw new ResponseError(apiKey, apiVersion, { '': response.errorCode }, response);
|
|
25
|
+
}
|
|
26
|
+
return response;
|
|
27
|
+
}
|
|
28
|
+
export const api = createAPI(64, 0, createRequest, parseResponse);
|
|
@@ -0,0 +1,23 @@
|
|
|
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 UpdateFeaturesRequestFeature {
|
|
5
|
+
feature: string;
|
|
6
|
+
maxVersionLevel: number;
|
|
7
|
+
upgradeType: number;
|
|
8
|
+
}
|
|
9
|
+
export type UpdateFeaturesRequest = Parameters<typeof createRequest>;
|
|
10
|
+
export interface UpdateFeaturesResponseResult {
|
|
11
|
+
feature: string;
|
|
12
|
+
errorCode: number;
|
|
13
|
+
errorMessage: NullableString;
|
|
14
|
+
}
|
|
15
|
+
export interface UpdateFeaturesResponse {
|
|
16
|
+
throttleTimeMs: number;
|
|
17
|
+
errorCode: number;
|
|
18
|
+
errorMessage: NullableString;
|
|
19
|
+
results: UpdateFeaturesResponseResult[];
|
|
20
|
+
}
|
|
21
|
+
export declare function createRequest(timeoutMs: number, featureUpdates: UpdateFeaturesRequestFeature[], validateOnly: boolean): Writer;
|
|
22
|
+
export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): UpdateFeaturesResponse;
|
|
23
|
+
export declare const api: import("../definitions.ts").API<[timeoutMs: number, featureUpdates: UpdateFeaturesRequestFeature[], validateOnly: boolean], UpdateFeaturesResponse>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ResponseError } from "../../errors.js";
|
|
2
|
+
import { Writer } from "../../protocol/writer.js";
|
|
3
|
+
import { createAPI } from "../definitions.js";
|
|
4
|
+
/*
|
|
5
|
+
UpdateFeatures Request (Version: 1) => timeout_ms [feature_updates] validate_only TAG_BUFFER
|
|
6
|
+
timeout_ms => INT32
|
|
7
|
+
feature_updates => feature max_version_level upgrade_type TAG_BUFFER
|
|
8
|
+
feature => COMPACT_STRING
|
|
9
|
+
max_version_level => INT16
|
|
10
|
+
upgrade_type => INT8
|
|
11
|
+
validate_only => BOOLEAN
|
|
12
|
+
*/
|
|
13
|
+
export function createRequest(timeoutMs, featureUpdates, validateOnly) {
|
|
14
|
+
return Writer.create()
|
|
15
|
+
.appendInt32(timeoutMs)
|
|
16
|
+
.appendArray(featureUpdates, (w, f) => {
|
|
17
|
+
w.appendString(f.feature).appendInt16(f.maxVersionLevel).appendInt8(f.upgradeType);
|
|
18
|
+
})
|
|
19
|
+
.appendBoolean(validateOnly)
|
|
20
|
+
.appendTaggedFields();
|
|
21
|
+
}
|
|
22
|
+
/*
|
|
23
|
+
UpdateFeatures Response (Version: 1) => throttle_time_ms error_code error_message [results] TAG_BUFFER
|
|
24
|
+
throttle_time_ms => INT32
|
|
25
|
+
error_code => INT16
|
|
26
|
+
error_message => COMPACT_NULLABLE_STRING
|
|
27
|
+
results => feature error_code error_message TAG_BUFFER
|
|
28
|
+
feature => COMPACT_STRING
|
|
29
|
+
error_code => INT16
|
|
30
|
+
error_message => COMPACT_NULLABLE_STRING
|
|
31
|
+
*/
|
|
32
|
+
export function parseResponse(_correlationId, apiKey, apiVersion, reader) {
|
|
33
|
+
const errors = [];
|
|
34
|
+
const throttleTimeMs = reader.readInt32();
|
|
35
|
+
const errorCode = reader.readInt16();
|
|
36
|
+
if (errorCode !== 0) {
|
|
37
|
+
errors.push(['', errorCode]);
|
|
38
|
+
}
|
|
39
|
+
const response = {
|
|
40
|
+
throttleTimeMs,
|
|
41
|
+
errorCode,
|
|
42
|
+
errorMessage: reader.readNullableString(),
|
|
43
|
+
results: reader.readArray((r, i) => {
|
|
44
|
+
const result = {
|
|
45
|
+
feature: r.readString(),
|
|
46
|
+
errorCode: r.readInt16(),
|
|
47
|
+
errorMessage: r.readNullableString()
|
|
48
|
+
};
|
|
49
|
+
if (result.errorCode !== 0) {
|
|
50
|
+
errors.push([`/results/${i}`, result.errorCode]);
|
|
51
|
+
}
|
|
52
|
+
return result;
|
|
53
|
+
})
|
|
54
|
+
};
|
|
55
|
+
if (errors.length) {
|
|
56
|
+
throw new ResponseError(apiKey, apiVersion, Object.fromEntries(errors), response);
|
|
57
|
+
}
|
|
58
|
+
return response;
|
|
59
|
+
}
|
|
60
|
+
export const api = createAPI(57, 1, createRequest, parseResponse);
|
|
@@ -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[];
|
|
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;
|
|
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>;
|
|
@@ -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: 0) => group_id member_id member_epoch instance_id rack_id rebalance_timeout_ms [subscribed_topic_names] 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
|
+
server_assignor => COMPACT_NULLABLE_STRING
|
|
14
|
+
topic_partitions => topic_id [partitions] TAG_BUFFER
|
|
15
|
+
topic_id => UUID
|
|
16
|
+
partitions => INT32
|
|
17
|
+
*/
|
|
18
|
+
export function createRequest(groupId, memberId, memberEpoch, instanceId, rackId, rebalanceTimeoutMs, subscribedTopicNames, serverAssignor, topicPartitions) {
|
|
19
|
+
return Writer.create()
|
|
20
|
+
.appendString(groupId)
|
|
21
|
+
.appendString(memberId)
|
|
22
|
+
.appendInt32(memberEpoch)
|
|
23
|
+
.appendString(instanceId)
|
|
24
|
+
.appendString(rackId)
|
|
25
|
+
.appendInt32(rebalanceTimeoutMs)
|
|
26
|
+
.appendArray(subscribedTopicNames, (w, t) => w.appendString(t), true, false)
|
|
27
|
+
.appendString(serverAssignor)
|
|
28
|
+
.appendArray(topicPartitions, (w, t) => {
|
|
29
|
+
return w.appendUUID(t.topicId).appendArray(t.partitions, (w, p) => w.appendInt32(p), true, false);
|
|
30
|
+
})
|
|
31
|
+
.appendTaggedFields();
|
|
32
|
+
}
|
|
33
|
+
/*
|
|
34
|
+
ConsumerGroupHeartbeat Response (Version: 0) => throttle_time_ms error_code error_message member_id member_epoch heartbeat_interval_ms assignment TAG_BUFFER
|
|
35
|
+
throttle_time_ms => INT32
|
|
36
|
+
error_code => INT16
|
|
37
|
+
error_message => COMPACT_NULLABLE_STRING
|
|
38
|
+
member_id => COMPACT_NULLABLE_STRING
|
|
39
|
+
member_epoch => INT32
|
|
40
|
+
heartbeat_interval_ms => INT32
|
|
41
|
+
assignment => [topic_partitions] TAG_BUFFER
|
|
42
|
+
topic_partitions => topic_id [partitions] TAG_BUFFER
|
|
43
|
+
topic_id => UUID
|
|
44
|
+
partitions => INT32
|
|
45
|
+
*/
|
|
46
|
+
export function parseResponse(_correlationId, apiKey, apiVersion, reader) {
|
|
47
|
+
const response = {
|
|
48
|
+
throttleTimeMs: reader.readInt32(),
|
|
49
|
+
errorCode: reader.readInt16(),
|
|
50
|
+
errorMessage: reader.readNullableString(),
|
|
51
|
+
memberId: reader.readNullableString(),
|
|
52
|
+
memberEpoch: reader.readInt32(),
|
|
53
|
+
heartbeatIntervalMs: reader.readInt32(),
|
|
54
|
+
assignment: reader.readArray(r => {
|
|
55
|
+
return {
|
|
56
|
+
topicPartitions: r.readArray(r => {
|
|
57
|
+
return {
|
|
58
|
+
topicId: r.readUUID(),
|
|
59
|
+
partitions: r.readArray(r => r.readInt32(), true, false)
|
|
60
|
+
};
|
|
61
|
+
})
|
|
62
|
+
};
|
|
63
|
+
})
|
|
64
|
+
};
|
|
65
|
+
if (response.errorCode !== 0) {
|
|
66
|
+
throw new ResponseError(apiKey, apiVersion, { '': response.errorCode }, response);
|
|
67
|
+
}
|
|
68
|
+
return response;
|
|
69
|
+
}
|
|
70
|
+
export const api = createAPI(68, 0, createRequest, parseResponse);
|