@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,24 @@
|
|
|
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 CreatePartitionsRequestAssignment {
|
|
5
|
+
brokerIds: number[];
|
|
6
|
+
}
|
|
7
|
+
export interface CreatePartitionsRequestTopic {
|
|
8
|
+
name: string;
|
|
9
|
+
count: number;
|
|
10
|
+
assignments: CreatePartitionsRequestAssignment[];
|
|
11
|
+
}
|
|
12
|
+
export type CreatePartitionsRequest = Parameters<typeof createRequest>;
|
|
13
|
+
export interface CreatePartitionsResponseResult {
|
|
14
|
+
name: string;
|
|
15
|
+
errorCode: number;
|
|
16
|
+
errorMessage: NullableString;
|
|
17
|
+
}
|
|
18
|
+
export interface CreatePartitionsResponse {
|
|
19
|
+
throttleTimeMs: number;
|
|
20
|
+
results: CreatePartitionsResponseResult[];
|
|
21
|
+
}
|
|
22
|
+
export declare function createRequest(topics: CreatePartitionsRequestTopic[], timeoutMs: number, validateOnly: boolean): Writer;
|
|
23
|
+
export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): CreatePartitionsResponse;
|
|
24
|
+
export declare const api: import("../definitions.ts").API<[topics: CreatePartitionsRequestTopic[], timeoutMs: number, validateOnly: boolean], CreatePartitionsResponse>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ResponseError } from "../../errors.js";
|
|
2
|
+
import { Writer } from "../../protocol/writer.js";
|
|
3
|
+
import { createAPI } from "../definitions.js";
|
|
4
|
+
/*
|
|
5
|
+
CreatePartitions Request (Version: 3) => [topics] timeout_ms validate_only TAG_BUFFER
|
|
6
|
+
topics => name count [assignments] TAG_BUFFER
|
|
7
|
+
name => COMPACT_STRING
|
|
8
|
+
count => INT32
|
|
9
|
+
assignments => [broker_ids] TAG_BUFFER
|
|
10
|
+
broker_ids => INT32
|
|
11
|
+
timeout_ms => INT32
|
|
12
|
+
validate_only => BOOLEAN
|
|
13
|
+
*/
|
|
14
|
+
export function createRequest(topics, timeoutMs, validateOnly) {
|
|
15
|
+
return Writer.create()
|
|
16
|
+
.appendArray(topics, (w, t) => {
|
|
17
|
+
w.appendString(t.name)
|
|
18
|
+
.appendInt32(t.count)
|
|
19
|
+
.appendArray(t.assignments, (w, a) => w.appendArray(a.brokerIds, (w, b) => w.appendInt32(b), true, false));
|
|
20
|
+
})
|
|
21
|
+
.appendInt32(timeoutMs)
|
|
22
|
+
.appendBoolean(validateOnly)
|
|
23
|
+
.appendTaggedFields();
|
|
24
|
+
}
|
|
25
|
+
/*
|
|
26
|
+
CreatePartitions Response (Version: 3) => throttle_time_ms [results] TAG_BUFFER
|
|
27
|
+
throttle_time_ms => INT32
|
|
28
|
+
results => name error_code error_message TAG_BUFFER
|
|
29
|
+
name => COMPACT_STRING
|
|
30
|
+
error_code => INT16
|
|
31
|
+
error_message => COMPACT_NULLABLE_STRING
|
|
32
|
+
*/
|
|
33
|
+
export function parseResponse(_correlationId, apiKey, apiVersion, reader) {
|
|
34
|
+
const errors = [];
|
|
35
|
+
const response = {
|
|
36
|
+
throttleTimeMs: reader.readInt32(),
|
|
37
|
+
results: reader.readArray((r, i) => {
|
|
38
|
+
const result = {
|
|
39
|
+
name: r.readString(),
|
|
40
|
+
errorCode: r.readInt16(),
|
|
41
|
+
errorMessage: r.readNullableString()
|
|
42
|
+
};
|
|
43
|
+
if (result.errorCode !== 0) {
|
|
44
|
+
errors.push([`/results/${i}`, result.errorCode]);
|
|
45
|
+
}
|
|
46
|
+
return result;
|
|
47
|
+
})
|
|
48
|
+
};
|
|
49
|
+
if (errors.length) {
|
|
50
|
+
throw new ResponseError(apiKey, apiVersion, Object.fromEntries(errors), response);
|
|
51
|
+
}
|
|
52
|
+
return response;
|
|
53
|
+
}
|
|
54
|
+
export const api = createAPI(37, 3, createRequest, parseResponse);
|
|
@@ -0,0 +1,42 @@
|
|
|
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 CreateTopicsRequestTopicAssignment {
|
|
5
|
+
partitionIndex: number;
|
|
6
|
+
brokerIds: number[];
|
|
7
|
+
}
|
|
8
|
+
export interface CreateTopicsRequestTopicConfig {
|
|
9
|
+
name: string;
|
|
10
|
+
value?: NullableString;
|
|
11
|
+
}
|
|
12
|
+
export interface CreateTopicsRequestTopic {
|
|
13
|
+
name: string;
|
|
14
|
+
numPartitions: number;
|
|
15
|
+
replicationFactor: number;
|
|
16
|
+
assignments: CreateTopicsRequestTopicAssignment[];
|
|
17
|
+
configs: CreateTopicsRequestTopicConfig[];
|
|
18
|
+
}
|
|
19
|
+
export type CreateTopicsRequest = Parameters<typeof createRequest>;
|
|
20
|
+
export interface CreateTopicsResponseTopicConfig {
|
|
21
|
+
name: string;
|
|
22
|
+
value: NullableString;
|
|
23
|
+
readOnly: boolean;
|
|
24
|
+
configSource: number;
|
|
25
|
+
isSensitive: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface CreateTopicsResponseTopic {
|
|
28
|
+
name: string;
|
|
29
|
+
topicId: string;
|
|
30
|
+
errorCode: number;
|
|
31
|
+
errorMessage: NullableString;
|
|
32
|
+
numPartitions: number;
|
|
33
|
+
replicationFactor: number;
|
|
34
|
+
configs: CreateTopicsResponseTopicConfig[];
|
|
35
|
+
}
|
|
36
|
+
export interface CreateTopicsResponse {
|
|
37
|
+
throttleTimeMs: number;
|
|
38
|
+
topics: CreateTopicsResponseTopic[];
|
|
39
|
+
}
|
|
40
|
+
export declare function createRequest(topics: CreateTopicsRequestTopic[], timeoutMs: number, validateOnly: boolean): Writer;
|
|
41
|
+
export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): CreateTopicsResponse;
|
|
42
|
+
export declare const api: import("../definitions.ts").API<[topics: CreateTopicsRequestTopic[], timeoutMs: number, validateOnly: boolean], CreateTopicsResponse>;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { ResponseError } from "../../errors.js";
|
|
2
|
+
import { Writer } from "../../protocol/writer.js";
|
|
3
|
+
import { createAPI } from "../definitions.js";
|
|
4
|
+
/*
|
|
5
|
+
CreateTopics Request (Version: 7) => [topics] timeout_ms validate_only TAG_BUFFER
|
|
6
|
+
topics => name num_partitions replication_factor [assignments] [configs] TAG_BUFFER
|
|
7
|
+
name => COMPACT_STRING
|
|
8
|
+
num_partitions => INT32
|
|
9
|
+
replication_factor => INT16
|
|
10
|
+
assignments => partition_index [broker_ids] TAG_BUFFER
|
|
11
|
+
partition_index => INT32
|
|
12
|
+
broker_ids => INT32
|
|
13
|
+
configs => name value TAG_BUFFER
|
|
14
|
+
name => COMPACT_STRING
|
|
15
|
+
value => COMPACT_NULLABLE_STRING
|
|
16
|
+
timeout_ms => INT32
|
|
17
|
+
validate_only => BOOLEAN
|
|
18
|
+
*/
|
|
19
|
+
export function createRequest(topics, timeoutMs, validateOnly) {
|
|
20
|
+
return Writer.create()
|
|
21
|
+
.appendArray(topics, (w, topic) => {
|
|
22
|
+
w.appendString(topic.name)
|
|
23
|
+
.appendInt32(topic.numPartitions)
|
|
24
|
+
.appendInt16(topic.replicationFactor)
|
|
25
|
+
.appendArray(topic.assignments, (w, assignment) => {
|
|
26
|
+
w.appendInt32(assignment.partitionIndex).appendArray(assignment.brokerIds, (w, b) => w.appendInt32(b), true, false);
|
|
27
|
+
})
|
|
28
|
+
.appendArray(topic.configs, (w, config) => {
|
|
29
|
+
w.appendString(config.name).appendString(config.value);
|
|
30
|
+
});
|
|
31
|
+
})
|
|
32
|
+
.appendInt32(timeoutMs)
|
|
33
|
+
.appendBoolean(validateOnly)
|
|
34
|
+
.appendTaggedFields();
|
|
35
|
+
}
|
|
36
|
+
/*
|
|
37
|
+
CreateTopics Response (Version: 7) => throttle_time_ms [topics] TAG_BUFFER
|
|
38
|
+
throttle_time_ms => INT32
|
|
39
|
+
topics => name topic_id error_code error_message num_partitions replication_factor [configs] TAG_BUFFER
|
|
40
|
+
name => COMPACT_STRING
|
|
41
|
+
topic_id => UUID
|
|
42
|
+
error_code => INT16
|
|
43
|
+
error_message => COMPACT_NULLABLE_STRING
|
|
44
|
+
num_partitions => INT32
|
|
45
|
+
replication_factor => INT16
|
|
46
|
+
configs => name value read_only config_source is_sensitive TAG_BUFFER
|
|
47
|
+
name => COMPACT_STRING
|
|
48
|
+
value => COMPACT_NULLABLE_STRING
|
|
49
|
+
read_only => BOOLEAN
|
|
50
|
+
config_source => INT8
|
|
51
|
+
is_sensitive => BOOLEAN
|
|
52
|
+
*/
|
|
53
|
+
export function parseResponse(_correlationId, apiKey, apiVersion, reader) {
|
|
54
|
+
const errors = [];
|
|
55
|
+
const response = {
|
|
56
|
+
throttleTimeMs: reader.readInt32(),
|
|
57
|
+
topics: reader.readArray((r, i) => {
|
|
58
|
+
const topic = {
|
|
59
|
+
name: r.readString(),
|
|
60
|
+
topicId: r.readUUID(),
|
|
61
|
+
errorCode: r.readInt16(),
|
|
62
|
+
errorMessage: r.readNullableString(),
|
|
63
|
+
numPartitions: r.readInt32(),
|
|
64
|
+
replicationFactor: r.readInt16(),
|
|
65
|
+
configs: r.readArray(r => {
|
|
66
|
+
return {
|
|
67
|
+
name: r.readString(),
|
|
68
|
+
value: r.readNullableString(),
|
|
69
|
+
readOnly: r.readBoolean(),
|
|
70
|
+
configSource: r.readInt8(),
|
|
71
|
+
isSensitive: r.readBoolean()
|
|
72
|
+
};
|
|
73
|
+
})
|
|
74
|
+
};
|
|
75
|
+
if (topic.errorCode !== 0) {
|
|
76
|
+
errors.push([`/topics/${i}`, topic.errorCode]);
|
|
77
|
+
}
|
|
78
|
+
return topic;
|
|
79
|
+
})
|
|
80
|
+
};
|
|
81
|
+
if (errors.length) {
|
|
82
|
+
throw new ResponseError(apiKey, apiVersion, Object.fromEntries(errors), response);
|
|
83
|
+
}
|
|
84
|
+
return response;
|
|
85
|
+
}
|
|
86
|
+
export const api = createAPI(19, 7, createRequest, parseResponse);
|
|
@@ -0,0 +1,36 @@
|
|
|
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 DeleteAclsRequestFilter {
|
|
5
|
+
resourceTypeFilter: number;
|
|
6
|
+
resourceNameFilter?: NullableString;
|
|
7
|
+
patternTypeFilter: number;
|
|
8
|
+
principalFilter?: NullableString;
|
|
9
|
+
hostFilter?: NullableString;
|
|
10
|
+
operation: number;
|
|
11
|
+
permissionType: number;
|
|
12
|
+
}
|
|
13
|
+
export type DeleteAclsRequest = Parameters<typeof createRequest>;
|
|
14
|
+
export interface DeleteAclsResponseMatchingAcl {
|
|
15
|
+
errorCode: number;
|
|
16
|
+
errorMessage: NullableString;
|
|
17
|
+
resourceType: number;
|
|
18
|
+
resourceName: string;
|
|
19
|
+
patternType: number;
|
|
20
|
+
principal: string;
|
|
21
|
+
host: string;
|
|
22
|
+
operation: number;
|
|
23
|
+
permissionType: number;
|
|
24
|
+
}
|
|
25
|
+
export interface DeleteAclsResponseFilterResults {
|
|
26
|
+
errorCode: number;
|
|
27
|
+
errorMessage: NullableString;
|
|
28
|
+
matchingAcls: DeleteAclsResponseMatchingAcl[];
|
|
29
|
+
}
|
|
30
|
+
export interface DeleteAclsResponse {
|
|
31
|
+
throttleTimeMs: number;
|
|
32
|
+
filterResults: DeleteAclsResponseFilterResults[];
|
|
33
|
+
}
|
|
34
|
+
export declare function createRequest(filters: DeleteAclsRequestFilter[]): Writer;
|
|
35
|
+
export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): DeleteAclsResponse;
|
|
36
|
+
export declare const api: import("../definitions.ts").API<[filters: DeleteAclsRequestFilter[]], DeleteAclsResponse>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { ResponseError } from "../../errors.js";
|
|
2
|
+
import { Writer } from "../../protocol/writer.js";
|
|
3
|
+
import { createAPI } from "../definitions.js";
|
|
4
|
+
/*
|
|
5
|
+
DeleteAcls Request (Version: 3) => [filters] TAG_BUFFER
|
|
6
|
+
filters => resource_type_filter resource_name_filter pattern_type_filter principal_filter host_filter operation permission_type TAG_BUFFER
|
|
7
|
+
resource_type_filter => INT8
|
|
8
|
+
resource_name_filter => COMPACT_NULLABLE_STRING
|
|
9
|
+
pattern_type_filter => INT8
|
|
10
|
+
principal_filter => COMPACT_NULLABLE_STRING
|
|
11
|
+
host_filter => COMPACT_NULLABLE_STRING
|
|
12
|
+
operation => INT8
|
|
13
|
+
permission_type => INT8
|
|
14
|
+
*/
|
|
15
|
+
export function createRequest(filters) {
|
|
16
|
+
return Writer.create()
|
|
17
|
+
.appendArray(filters, (w, f) => {
|
|
18
|
+
w.appendInt8(f.resourceTypeFilter)
|
|
19
|
+
.appendString(f.resourceNameFilter)
|
|
20
|
+
.appendInt8(f.patternTypeFilter)
|
|
21
|
+
.appendString(f.principalFilter)
|
|
22
|
+
.appendString(f.hostFilter)
|
|
23
|
+
.appendInt8(f.operation)
|
|
24
|
+
.appendInt8(f.permissionType);
|
|
25
|
+
})
|
|
26
|
+
.appendTaggedFields();
|
|
27
|
+
}
|
|
28
|
+
/*
|
|
29
|
+
DeleteAcls Response (Version: 3) => throttle_time_ms [filter_results] TAG_BUFFER
|
|
30
|
+
throttle_time_ms => INT32
|
|
31
|
+
filter_results => error_code error_message [matching_acls] TAG_BUFFER
|
|
32
|
+
error_code => INT16
|
|
33
|
+
error_message => COMPACT_NULLABLE_STRING
|
|
34
|
+
matching_acls => error_code error_message resource_type resource_name pattern_type principal host operation permission_type TAG_BUFFER
|
|
35
|
+
error_code => INT16
|
|
36
|
+
error_message => COMPACT_NULLABLE_STRING
|
|
37
|
+
resource_type => INT8
|
|
38
|
+
resource_name => COMPACT_STRING
|
|
39
|
+
pattern_type => INT8
|
|
40
|
+
principal => COMPACT_STRING
|
|
41
|
+
host => COMPACT_STRING
|
|
42
|
+
operation => INT8
|
|
43
|
+
permission_type => INT8
|
|
44
|
+
*/
|
|
45
|
+
export function parseResponse(_correlationId, apiKey, apiVersion, reader) {
|
|
46
|
+
const errors = [];
|
|
47
|
+
const response = {
|
|
48
|
+
throttleTimeMs: reader.readInt32(),
|
|
49
|
+
filterResults: reader.readArray((r, i) => {
|
|
50
|
+
const errorCode = r.readInt16();
|
|
51
|
+
if (errorCode !== 0) {
|
|
52
|
+
errors.push([`/filter_results/${i}`, errorCode]);
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
errorCode,
|
|
56
|
+
errorMessage: r.readNullableString(),
|
|
57
|
+
matchingAcls: r.readArray((r, j) => {
|
|
58
|
+
const errorCode = r.readInt16();
|
|
59
|
+
if (errorCode !== 0) {
|
|
60
|
+
errors.push([`/filter_results/${i}/matching_acls/${j}`, errorCode]);
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
errorCode,
|
|
64
|
+
errorMessage: r.readNullableString(),
|
|
65
|
+
resourceType: r.readInt8(),
|
|
66
|
+
resourceName: r.readString(),
|
|
67
|
+
patternType: r.readInt8(),
|
|
68
|
+
principal: r.readString(),
|
|
69
|
+
host: r.readString(),
|
|
70
|
+
operation: r.readInt8(),
|
|
71
|
+
permissionType: r.readInt8()
|
|
72
|
+
};
|
|
73
|
+
})
|
|
74
|
+
};
|
|
75
|
+
})
|
|
76
|
+
};
|
|
77
|
+
if (errors.length) {
|
|
78
|
+
throw new ResponseError(apiKey, apiVersion, Object.fromEntries(errors), response);
|
|
79
|
+
}
|
|
80
|
+
return response;
|
|
81
|
+
}
|
|
82
|
+
export const api = createAPI(31, 3, createRequest, parseResponse);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Reader } from '../../protocol/reader.ts';
|
|
2
|
+
import { Writer } from '../../protocol/writer.ts';
|
|
3
|
+
export type DeleteGroupsRequest = Parameters<typeof createRequest>;
|
|
4
|
+
export interface DeleteGroupsResponseGroup {
|
|
5
|
+
groupId: string;
|
|
6
|
+
errorCode: number;
|
|
7
|
+
}
|
|
8
|
+
export interface DeleteGroupsResponse {
|
|
9
|
+
throttleTimeMs: number;
|
|
10
|
+
results: DeleteGroupsResponseGroup[];
|
|
11
|
+
}
|
|
12
|
+
export declare function createRequest(groupsNames: string[]): Writer;
|
|
13
|
+
export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): DeleteGroupsResponse;
|
|
14
|
+
export declare const api: import("../definitions.ts").API<[groupsNames: string[]], DeleteGroupsResponse>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ResponseError } from "../../errors.js";
|
|
2
|
+
import { Writer } from "../../protocol/writer.js";
|
|
3
|
+
import { createAPI } from "../definitions.js";
|
|
4
|
+
/*
|
|
5
|
+
DeleteGroups Request (Version: 2) => [groups_names] TAG_BUFFER
|
|
6
|
+
groups_names => COMPACT_STRING
|
|
7
|
+
*/
|
|
8
|
+
export function createRequest(groupsNames) {
|
|
9
|
+
return Writer.create()
|
|
10
|
+
.appendArray(groupsNames, (w, r) => w.appendString(r), true, false)
|
|
11
|
+
.appendTaggedFields();
|
|
12
|
+
}
|
|
13
|
+
/*
|
|
14
|
+
DeleteGroups Response (Version: 2) => throttle_time_ms [results] TAG_BUFFER
|
|
15
|
+
throttle_time_ms => INT32
|
|
16
|
+
results => group_id error_code TAG_BUFFER
|
|
17
|
+
group_id => COMPACT_STRING
|
|
18
|
+
error_code => INT16
|
|
19
|
+
*/
|
|
20
|
+
export function parseResponse(_correlationId, apiKey, apiVersion, reader) {
|
|
21
|
+
const errors = [];
|
|
22
|
+
const response = {
|
|
23
|
+
throttleTimeMs: reader.readInt32(),
|
|
24
|
+
results: reader.readArray((r, i) => {
|
|
25
|
+
const group = {
|
|
26
|
+
groupId: r.readString(),
|
|
27
|
+
errorCode: r.readInt16()
|
|
28
|
+
};
|
|
29
|
+
if (group.errorCode !== 0) {
|
|
30
|
+
errors.push([`/results/${i}`, group.errorCode]);
|
|
31
|
+
}
|
|
32
|
+
return group;
|
|
33
|
+
})
|
|
34
|
+
};
|
|
35
|
+
if (errors.length) {
|
|
36
|
+
throw new ResponseError(apiKey, apiVersion, Object.fromEntries(errors), response);
|
|
37
|
+
}
|
|
38
|
+
return response;
|
|
39
|
+
}
|
|
40
|
+
export const api = createAPI(42, 2, createRequest, parseResponse);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type Reader } from '../../protocol/reader.ts';
|
|
2
|
+
import { Writer } from '../../protocol/writer.ts';
|
|
3
|
+
export interface DeleteRecordsRequestPartitions {
|
|
4
|
+
partitionIndex: number;
|
|
5
|
+
offset: bigint;
|
|
6
|
+
}
|
|
7
|
+
export interface DeleteRecordsRequestTopics {
|
|
8
|
+
name: string;
|
|
9
|
+
partitions: DeleteRecordsRequestPartitions[];
|
|
10
|
+
}
|
|
11
|
+
export type DeleteRecordsRequest = Parameters<typeof createRequest>;
|
|
12
|
+
export interface DeleteRecordsResponsePartition {
|
|
13
|
+
partitionIndex: number;
|
|
14
|
+
lowWatermark: bigint;
|
|
15
|
+
errorCode: number;
|
|
16
|
+
}
|
|
17
|
+
export interface DeleteRecordsResponseTopic {
|
|
18
|
+
name: string;
|
|
19
|
+
partitions: DeleteRecordsResponsePartition[];
|
|
20
|
+
}
|
|
21
|
+
export interface DeleteRecordsResponse {
|
|
22
|
+
throttleTimeMs: number;
|
|
23
|
+
topics: DeleteRecordsResponseTopic[];
|
|
24
|
+
}
|
|
25
|
+
export declare function createRequest(topics: DeleteRecordsRequestTopics[], timeoutMs: number): Writer;
|
|
26
|
+
export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): DeleteRecordsResponse;
|
|
27
|
+
export declare const api: import("../definitions.ts").API<[topics: DeleteRecordsRequestTopics[], timeoutMs: number], DeleteRecordsResponse>;
|
|
@@ -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
|
+
DeleteRecords Request (Version: 2) => [topics] timeout_ms TAG_BUFFER
|
|
6
|
+
topics => name [partitions] TAG_BUFFER
|
|
7
|
+
name => COMPACT_STRING
|
|
8
|
+
partitions => partition_index offset TAG_BUFFER
|
|
9
|
+
partition_index => INT32
|
|
10
|
+
offset => INT64
|
|
11
|
+
timeout_ms => INT32
|
|
12
|
+
*/
|
|
13
|
+
export function createRequest(topics, timeoutMs) {
|
|
14
|
+
return Writer.create()
|
|
15
|
+
.appendArray(topics, (w, t) => {
|
|
16
|
+
w.appendString(t.name).appendArray(t.partitions, (w, p) => {
|
|
17
|
+
w.appendInt32(p.partitionIndex).appendInt64(p.offset);
|
|
18
|
+
});
|
|
19
|
+
})
|
|
20
|
+
.appendInt32(timeoutMs)
|
|
21
|
+
.appendTaggedFields();
|
|
22
|
+
}
|
|
23
|
+
/*
|
|
24
|
+
DeleteRecords Response (Version: 2) => throttle_time_ms [topics] TAG_BUFFER
|
|
25
|
+
throttle_time_ms => INT32
|
|
26
|
+
topics => name [partitions] TAG_BUFFER
|
|
27
|
+
name => COMPACT_STRING
|
|
28
|
+
partitions => partition_index low_watermark error_code TAG_BUFFER
|
|
29
|
+
partition_index => INT32
|
|
30
|
+
low_watermark => INT64
|
|
31
|
+
error_code => INT16
|
|
32
|
+
*/
|
|
33
|
+
export function parseResponse(_correlationId, apiKey, apiVersion, reader) {
|
|
34
|
+
const errors = [];
|
|
35
|
+
const response = {
|
|
36
|
+
throttleTimeMs: reader.readInt32(),
|
|
37
|
+
topics: reader.readArray((r, i) => {
|
|
38
|
+
return {
|
|
39
|
+
name: r.readString(),
|
|
40
|
+
partitions: r.readArray((r, j) => {
|
|
41
|
+
const partition = {
|
|
42
|
+
partitionIndex: r.readInt32(),
|
|
43
|
+
lowWatermark: r.readInt64(),
|
|
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(21, 2, createRequest, parseResponse);
|
|
@@ -0,0 +1,21 @@
|
|
|
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 DeleteTopicsRequestTopic {
|
|
5
|
+
name: string;
|
|
6
|
+
topicId?: NullableString;
|
|
7
|
+
}
|
|
8
|
+
export type DeleteTopicsRequest = Parameters<typeof createRequest>;
|
|
9
|
+
export interface DeleteTopicsResponseResponse {
|
|
10
|
+
name: NullableString;
|
|
11
|
+
topicId: string;
|
|
12
|
+
errorCode: number;
|
|
13
|
+
errorMessage: NullableString;
|
|
14
|
+
}
|
|
15
|
+
export interface DeleteTopicsResponse {
|
|
16
|
+
throttleTimeMs: number;
|
|
17
|
+
responses: DeleteTopicsResponseResponse[];
|
|
18
|
+
}
|
|
19
|
+
export declare function createRequest(topics: DeleteTopicsRequestTopic[], timeoutMs: number): Writer;
|
|
20
|
+
export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): DeleteTopicsResponse;
|
|
21
|
+
export declare const api: import("../definitions.ts").API<[topics: DeleteTopicsRequestTopic[], timeoutMs: number], DeleteTopicsResponse>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ResponseError } from "../../errors.js";
|
|
2
|
+
import { Writer } from "../../protocol/writer.js";
|
|
3
|
+
import { createAPI } from "../definitions.js";
|
|
4
|
+
/*
|
|
5
|
+
DeleteTopics Request (Version: 6) => [topics] timeout_ms TAG_BUFFER
|
|
6
|
+
topics => name topic_id TAG_BUFFER
|
|
7
|
+
name => COMPACT_NULLABLE_STRING
|
|
8
|
+
topic_id => UUID
|
|
9
|
+
timeout_ms => INT32
|
|
10
|
+
*/
|
|
11
|
+
export function createRequest(topics, timeoutMs) {
|
|
12
|
+
return Writer.create()
|
|
13
|
+
.appendArray(topics, (w, topic) => {
|
|
14
|
+
w.appendString(topic.name).appendUUID(topic.topicId);
|
|
15
|
+
})
|
|
16
|
+
.appendInt32(timeoutMs)
|
|
17
|
+
.appendTaggedFields();
|
|
18
|
+
}
|
|
19
|
+
/*
|
|
20
|
+
DeleteTopics Response (Version: 6) => throttle_time_ms [responses] TAG_BUFFER
|
|
21
|
+
throttle_time_ms => INT32
|
|
22
|
+
responses => name topic_id error_code error_message TAG_BUFFER
|
|
23
|
+
name => COMPACT_NULLABLE_STRING
|
|
24
|
+
topic_id => UUID
|
|
25
|
+
error_code => INT16
|
|
26
|
+
error_message => COMPACT_NULLABLE_STRING
|
|
27
|
+
*/
|
|
28
|
+
export function parseResponse(_correlationId, apiKey, apiVersion, reader) {
|
|
29
|
+
const errors = [];
|
|
30
|
+
const response = {
|
|
31
|
+
throttleTimeMs: reader.readInt32(),
|
|
32
|
+
responses: reader.readArray((r, i) => {
|
|
33
|
+
const topicResponse = {
|
|
34
|
+
name: r.readNullableString(),
|
|
35
|
+
topicId: r.readUUID(),
|
|
36
|
+
errorCode: r.readInt16(),
|
|
37
|
+
errorMessage: r.readNullableString()
|
|
38
|
+
};
|
|
39
|
+
if (topicResponse.errorCode !== 0) {
|
|
40
|
+
errors.push([`/responses/${i}`, topicResponse.errorCode]);
|
|
41
|
+
}
|
|
42
|
+
return topicResponse;
|
|
43
|
+
})
|
|
44
|
+
};
|
|
45
|
+
if (errors.length) {
|
|
46
|
+
throw new ResponseError(apiKey, apiVersion, Object.fromEntries(errors), response);
|
|
47
|
+
}
|
|
48
|
+
return response;
|
|
49
|
+
}
|
|
50
|
+
export const api = createAPI(20, 6, createRequest, parseResponse);
|
|
@@ -0,0 +1,25 @@
|
|
|
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 DescribeAclsRequest = Parameters<typeof createRequest>;
|
|
5
|
+
export interface DescribeAclsResponseAcl {
|
|
6
|
+
principal: string;
|
|
7
|
+
host: string;
|
|
8
|
+
operation: number;
|
|
9
|
+
permissionType: number;
|
|
10
|
+
}
|
|
11
|
+
export interface DescribeAclsResponseResource {
|
|
12
|
+
resourceType: number;
|
|
13
|
+
resourceName: string;
|
|
14
|
+
patternType: number;
|
|
15
|
+
acls: DescribeAclsResponseAcl[];
|
|
16
|
+
}
|
|
17
|
+
export interface DescribeAclsResponse {
|
|
18
|
+
throttleTimeMs: number;
|
|
19
|
+
errorCode: number;
|
|
20
|
+
errorMessage: NullableString;
|
|
21
|
+
resources: DescribeAclsResponseResource[];
|
|
22
|
+
}
|
|
23
|
+
export declare function createRequest(resourceTypeFilter: number, resourceNameFilter: NullableString, patternTypeFilter: number, principalFilter: NullableString, hostFilter: NullableString, operation: number, permissionType: number): Writer;
|
|
24
|
+
export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): DescribeAclsResponse;
|
|
25
|
+
export declare const api: import("../definitions.ts").API<[resourceTypeFilter: number, resourceNameFilter: NullableString, patternTypeFilter: number, principalFilter: NullableString, hostFilter: NullableString, operation: number, permissionType: number], DescribeAclsResponse>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { ResponseError } from "../../errors.js";
|
|
2
|
+
import { Writer } from "../../protocol/writer.js";
|
|
3
|
+
import { createAPI } from "../definitions.js";
|
|
4
|
+
/*
|
|
5
|
+
DescribeAcls Request (Version: 3) => resource_type_filter resource_name_filter pattern_type_filter principal_filter host_filter operation permission_type TAG_BUFFER
|
|
6
|
+
resource_type_filter => INT8
|
|
7
|
+
resource_name_filter => COMPACT_NULLABLE_STRING
|
|
8
|
+
pattern_type_filter => INT8
|
|
9
|
+
principal_filter => COMPACT_NULLABLE_STRING
|
|
10
|
+
host_filter => COMPACT_NULLABLE_STRING
|
|
11
|
+
operation => INT8
|
|
12
|
+
permission_type => INT8
|
|
13
|
+
*/
|
|
14
|
+
export function createRequest(resourceTypeFilter, resourceNameFilter, patternTypeFilter, principalFilter, hostFilter, operation, permissionType) {
|
|
15
|
+
return Writer.create()
|
|
16
|
+
.appendInt8(resourceTypeFilter)
|
|
17
|
+
.appendString(resourceNameFilter)
|
|
18
|
+
.appendInt8(patternTypeFilter)
|
|
19
|
+
.appendString(principalFilter)
|
|
20
|
+
.appendString(hostFilter)
|
|
21
|
+
.appendInt8(operation)
|
|
22
|
+
.appendInt8(permissionType)
|
|
23
|
+
.appendTaggedFields();
|
|
24
|
+
}
|
|
25
|
+
/*
|
|
26
|
+
DescribeAcls Response (Version: 3) => throttle_time_ms error_code error_message [resources] TAG_BUFFER
|
|
27
|
+
throttle_time_ms => INT32
|
|
28
|
+
error_code => INT16
|
|
29
|
+
error_message => COMPACT_NULLABLE_STRING
|
|
30
|
+
resources => resource_type resource_name pattern_type [acls] TAG_BUFFER
|
|
31
|
+
resource_type => INT8
|
|
32
|
+
resource_name => COMPACT_STRING
|
|
33
|
+
pattern_type => INT8
|
|
34
|
+
acls => principal host operation permission_type TAG_BUFFER
|
|
35
|
+
principal => COMPACT_STRING
|
|
36
|
+
host => COMPACT_STRING
|
|
37
|
+
operation => INT8
|
|
38
|
+
permission_type => INT8
|
|
39
|
+
*/
|
|
40
|
+
export function parseResponse(_correlationId, apiKey, apiVersion, reader) {
|
|
41
|
+
const response = {
|
|
42
|
+
throttleTimeMs: reader.readInt32(),
|
|
43
|
+
errorCode: reader.readInt16(),
|
|
44
|
+
errorMessage: reader.readNullableString(),
|
|
45
|
+
resources: reader.readArray(r => {
|
|
46
|
+
return {
|
|
47
|
+
resourceType: r.readInt8(),
|
|
48
|
+
resourceName: r.readString(),
|
|
49
|
+
patternType: r.readInt8(),
|
|
50
|
+
acls: r.readArray(r => {
|
|
51
|
+
return {
|
|
52
|
+
principal: r.readString(),
|
|
53
|
+
host: r.readString(),
|
|
54
|
+
operation: r.readInt8(),
|
|
55
|
+
permissionType: r.readInt8()
|
|
56
|
+
};
|
|
57
|
+
})
|
|
58
|
+
};
|
|
59
|
+
})
|
|
60
|
+
};
|
|
61
|
+
if (response.errorCode) {
|
|
62
|
+
throw new ResponseError(apiKey, apiVersion, { '': response.errorCode }, response);
|
|
63
|
+
}
|
|
64
|
+
return response;
|
|
65
|
+
}
|
|
66
|
+
export const api = createAPI(29, 3, createRequest, parseResponse);
|
|
@@ -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 DescribeClientQuotasRequestComponent {
|
|
5
|
+
entityType: string;
|
|
6
|
+
matchType: number;
|
|
7
|
+
match: string | null;
|
|
8
|
+
}
|
|
9
|
+
export type DescribeClientQuotasRequest = Parameters<typeof createRequest>;
|
|
10
|
+
export interface DescribeClientQuotasResponseValue {
|
|
11
|
+
key: string;
|
|
12
|
+
value: number;
|
|
13
|
+
}
|
|
14
|
+
export interface DescribeClientQuotasResponseEntity {
|
|
15
|
+
entityType: string;
|
|
16
|
+
entityName: NullableString;
|
|
17
|
+
}
|
|
18
|
+
export interface DescribeClientQuotasResponseEntry {
|
|
19
|
+
entity: DescribeClientQuotasResponseEntity[];
|
|
20
|
+
values: DescribeClientQuotasResponseValue[];
|
|
21
|
+
}
|
|
22
|
+
export interface DescribeClientQuotasResponse {
|
|
23
|
+
throttleTimeMs: number;
|
|
24
|
+
errorCode: number;
|
|
25
|
+
errorMessage: NullableString;
|
|
26
|
+
entries: DescribeClientQuotasResponseEntry[];
|
|
27
|
+
}
|
|
28
|
+
export declare function createRequest(components: DescribeClientQuotasRequestComponent[], strict: boolean): Writer;
|
|
29
|
+
export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): DescribeClientQuotasResponse;
|
|
30
|
+
export declare const api: import("../definitions.ts").API<[components: DescribeClientQuotasRequestComponent[], strict: boolean], DescribeClientQuotasResponse>;
|