@platformatic/kafka 1.19.0 → 1.21.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/dist/apis/admin/create-partitions-v1.d.ts +24 -0
- package/dist/apis/admin/create-partitions-v1.js +53 -0
- package/dist/apis/admin/create-partitions-v2.d.ts +24 -0
- package/dist/apis/admin/create-partitions-v2.js +54 -0
- package/dist/apis/admin/describe-configs-v2.d.ts +38 -0
- package/dist/apis/admin/describe-configs-v2.js +84 -0
- package/dist/apis/admin/describe-configs-v3.d.ts +38 -0
- package/dist/apis/admin/describe-configs-v3.js +84 -0
- package/dist/apis/admin/index.d.ts +4 -0
- package/dist/apis/admin/index.js +4 -0
- package/dist/apis/callbacks.js +1 -0
- package/dist/apis/consumer/fetch-v12.d.ts +46 -0
- package/dist/apis/consumer/fetch-v12.js +123 -0
- package/dist/apis/consumer/fetch-v13.d.ts +46 -0
- package/dist/apis/consumer/fetch-v13.js +123 -0
- package/dist/apis/consumer/fetch-v14.d.ts +46 -0
- package/dist/apis/consumer/fetch-v14.js +123 -0
- package/dist/apis/consumer/index.d.ts +4 -0
- package/dist/apis/consumer/index.js +4 -0
- package/dist/apis/consumer/offset-for-leader-epoch-v4.d.ts +29 -0
- package/dist/apis/consumer/offset-for-leader-epoch-v4.js +65 -0
- package/dist/apis/metadata/index.d.ts +3 -0
- package/dist/apis/metadata/index.js +3 -0
- package/dist/apis/metadata/metadata-v10.d.ts +37 -0
- package/dist/apis/metadata/metadata-v10.js +96 -0
- package/dist/apis/metadata/metadata-v11.d.ts +37 -0
- package/dist/apis/metadata/metadata-v11.js +96 -0
- package/dist/apis/metadata/metadata-v9.d.ts +37 -0
- package/dist/apis/metadata/metadata-v9.js +96 -0
- package/dist/apis/producer/index.d.ts +2 -0
- package/dist/apis/producer/index.js +2 -0
- package/dist/apis/producer/produce-v7.d.ts +29 -0
- package/dist/apis/producer/produce-v7.js +88 -0
- package/dist/apis/producer/produce-v8.d.ts +29 -0
- package/dist/apis/producer/produce-v8.js +101 -0
- package/dist/clients/admin/admin.js +16 -12
- package/dist/clients/admin/types.d.ts +4 -4
- package/dist/clients/base/base.d.ts +1 -2
- package/dist/clients/base/base.js +100 -98
- package/dist/clients/base/index.d.ts +1 -1
- package/dist/clients/base/index.js +1 -1
- package/dist/clients/consumer/consumer.js +5 -3
- package/dist/clients/consumer/messages-stream.d.ts +8 -0
- package/dist/clients/consumer/messages-stream.js +30 -1
- package/dist/clients/producer/producer.js +2 -2
- package/dist/network/connection.js +2 -2
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -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,53 @@
|
|
|
1
|
+
import { ResponseError } from "../../errors.js";
|
|
2
|
+
import { Writer } from "../../protocol/writer.js";
|
|
3
|
+
import { createAPI } from "../definitions.js";
|
|
4
|
+
/*
|
|
5
|
+
CreatePartitions Request (Version: 1) => [topics] timeout_ms validate_only TAG_BUFFER
|
|
6
|
+
topics => name count [assignments] TAG_BUFFER
|
|
7
|
+
name => 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, false)
|
|
18
|
+
.appendInt32(t.count)
|
|
19
|
+
.appendArray(t.assignments, (w, a) => w.appendArray(a.brokerIds, (w, b) => w.appendInt32(b), false, false), false, false);
|
|
20
|
+
}, false, false)
|
|
21
|
+
.appendInt32(timeoutMs)
|
|
22
|
+
.appendBoolean(validateOnly);
|
|
23
|
+
}
|
|
24
|
+
/*
|
|
25
|
+
CreatePartitions Response (Version: 1) => throttle_time_ms [results] TAG_BUFFER
|
|
26
|
+
throttle_time_ms => INT32
|
|
27
|
+
results => name error_code error_message TAG_BUFFER
|
|
28
|
+
name => STRING
|
|
29
|
+
error_code => INT16
|
|
30
|
+
error_message => NULLABLE_STRING
|
|
31
|
+
*/
|
|
32
|
+
export function parseResponse(_correlationId, apiKey, apiVersion, reader) {
|
|
33
|
+
const errors = [];
|
|
34
|
+
const response = {
|
|
35
|
+
throttleTimeMs: reader.readInt32(),
|
|
36
|
+
results: reader.readArray((r, i) => {
|
|
37
|
+
const result = {
|
|
38
|
+
name: r.readString(false),
|
|
39
|
+
errorCode: r.readInt16(),
|
|
40
|
+
errorMessage: r.readNullableString(false)
|
|
41
|
+
};
|
|
42
|
+
if (result.errorCode !== 0) {
|
|
43
|
+
errors.push([`/results/${i}`, result.errorCode]);
|
|
44
|
+
}
|
|
45
|
+
return result;
|
|
46
|
+
}, false, false)
|
|
47
|
+
};
|
|
48
|
+
if (errors.length) {
|
|
49
|
+
throw new ResponseError(apiKey, apiVersion, Object.fromEntries(errors), response);
|
|
50
|
+
}
|
|
51
|
+
return response;
|
|
52
|
+
}
|
|
53
|
+
export const api = createAPI(37, 1, createRequest, parseResponse, false, false);
|
|
@@ -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: 2) => [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: 2) => 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, 2, createRequest, parseResponse);
|
|
@@ -0,0 +1,38 @@
|
|
|
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 DescribeConfigsRequestResource {
|
|
5
|
+
resourceType: number;
|
|
6
|
+
resourceName: string;
|
|
7
|
+
configurationKeys: string[];
|
|
8
|
+
}
|
|
9
|
+
export type DescribeConfigsRequest = Parameters<typeof createRequest>;
|
|
10
|
+
export interface DescribeConfigsResponseSynonym {
|
|
11
|
+
name: string;
|
|
12
|
+
value: NullableString;
|
|
13
|
+
source: number;
|
|
14
|
+
}
|
|
15
|
+
export interface DescribeConfigsResponseConfig {
|
|
16
|
+
name: string;
|
|
17
|
+
value: NullableString;
|
|
18
|
+
readOnly: boolean;
|
|
19
|
+
configSource: number;
|
|
20
|
+
isSensitive: boolean;
|
|
21
|
+
synonyms: DescribeConfigsResponseSynonym[];
|
|
22
|
+
configType: number;
|
|
23
|
+
documentation: NullableString;
|
|
24
|
+
}
|
|
25
|
+
export interface DescribeConfigsResponseResult {
|
|
26
|
+
errorCode: number;
|
|
27
|
+
errorMessage: NullableString;
|
|
28
|
+
resourceType: number;
|
|
29
|
+
resourceName: string;
|
|
30
|
+
configs: DescribeConfigsResponseConfig[];
|
|
31
|
+
}
|
|
32
|
+
export interface DescribeConfigsResponse {
|
|
33
|
+
throttleTimeMs: number;
|
|
34
|
+
results: DescribeConfigsResponseResult[];
|
|
35
|
+
}
|
|
36
|
+
export declare function createRequest(resources: DescribeConfigsRequestResource[], includeSynonyms: boolean, includeDocumentation: boolean): Writer;
|
|
37
|
+
export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): DescribeConfigsResponse;
|
|
38
|
+
export declare const api: import("../definitions.ts").API<[resources: DescribeConfigsRequestResource[], includeSynonyms: boolean, includeDocumentation: boolean], DescribeConfigsResponse>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { ResponseError } from "../../errors.js";
|
|
2
|
+
import { Writer } from "../../protocol/writer.js";
|
|
3
|
+
import { createAPI } from "../definitions.js";
|
|
4
|
+
/*
|
|
5
|
+
DescribeConfigs Request (Version: 2) => [resources] include_synonyms include_documentation TAG_BUFFER
|
|
6
|
+
resources => resource_type resource_name [configuration_keys] TAG_BUFFER
|
|
7
|
+
resource_type => INT8
|
|
8
|
+
resource_name => STRING
|
|
9
|
+
configuration_keys => STRING
|
|
10
|
+
include_synonyms => BOOLEAN
|
|
11
|
+
include_documentation => BOOLEAN
|
|
12
|
+
*/
|
|
13
|
+
export function createRequest(resources, includeSynonyms, includeDocumentation) {
|
|
14
|
+
return Writer.create()
|
|
15
|
+
.appendArray(resources, (w, r) => {
|
|
16
|
+
w.appendInt8(r.resourceType)
|
|
17
|
+
.appendString(r.resourceName, false)
|
|
18
|
+
.appendArray(r.configurationKeys, (w, c) => w.appendString(c, false), false, false);
|
|
19
|
+
}, false, false)
|
|
20
|
+
.appendBoolean(includeSynonyms)
|
|
21
|
+
.appendBoolean(includeDocumentation);
|
|
22
|
+
}
|
|
23
|
+
/*
|
|
24
|
+
DescribeConfigs Response (Version: 2) => throttle_time_ms [results] TAG_BUFFER
|
|
25
|
+
throttle_time_ms => INT32
|
|
26
|
+
results => error_code error_message resource_type resource_name [configs] TAG_BUFFER
|
|
27
|
+
error_code => INT16
|
|
28
|
+
error_message => NULLABLE_STRING
|
|
29
|
+
resource_type => INT8
|
|
30
|
+
resource_name => STRING
|
|
31
|
+
configs => name value read_only config_source is_sensitive [synonyms] config_type documentation TAG_BUFFER
|
|
32
|
+
name => STRING
|
|
33
|
+
value => NULLABLE_STRING
|
|
34
|
+
read_only => BOOLEAN
|
|
35
|
+
config_source => INT8
|
|
36
|
+
is_sensitive => BOOLEAN
|
|
37
|
+
synonyms => name value source TAG_BUFFER
|
|
38
|
+
name => STRING
|
|
39
|
+
value => NULLABLE_STRING
|
|
40
|
+
source => INT8
|
|
41
|
+
config_type => INT8
|
|
42
|
+
documentation => NULLABLE_STRING
|
|
43
|
+
*/
|
|
44
|
+
export function parseResponse(_correlationId, apiKey, apiVersion, reader) {
|
|
45
|
+
const errors = [];
|
|
46
|
+
const response = {
|
|
47
|
+
throttleTimeMs: reader.readInt32(),
|
|
48
|
+
results: reader.readArray((r, i) => {
|
|
49
|
+
const errorCode = r.readInt16();
|
|
50
|
+
if (errorCode !== 0) {
|
|
51
|
+
errors.push([`/results/${i}`, errorCode]);
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
errorCode,
|
|
55
|
+
errorMessage: r.readNullableString(false),
|
|
56
|
+
resourceType: r.readInt8(),
|
|
57
|
+
resourceName: r.readString(false),
|
|
58
|
+
configs: r.readArray(r => {
|
|
59
|
+
return {
|
|
60
|
+
name: r.readString(false),
|
|
61
|
+
value: r.readNullableString(false),
|
|
62
|
+
readOnly: r.readBoolean(),
|
|
63
|
+
configSource: r.readInt8(),
|
|
64
|
+
isSensitive: r.readBoolean(),
|
|
65
|
+
synonyms: r.readArray(r => {
|
|
66
|
+
return {
|
|
67
|
+
name: r.readString(false),
|
|
68
|
+
value: r.readNullableString(false),
|
|
69
|
+
source: r.readInt8()
|
|
70
|
+
};
|
|
71
|
+
}, false, false),
|
|
72
|
+
configType: r.readInt8(),
|
|
73
|
+
documentation: r.readNullableString(false)
|
|
74
|
+
};
|
|
75
|
+
}, false, false)
|
|
76
|
+
};
|
|
77
|
+
}, false, false)
|
|
78
|
+
};
|
|
79
|
+
if (errors.length) {
|
|
80
|
+
throw new ResponseError(apiKey, apiVersion, Object.fromEntries(errors), response);
|
|
81
|
+
}
|
|
82
|
+
return response;
|
|
83
|
+
}
|
|
84
|
+
export const api = createAPI(32, 2, createRequest, parseResponse, false, false);
|
|
@@ -0,0 +1,38 @@
|
|
|
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 DescribeConfigsRequestResource {
|
|
5
|
+
resourceType: number;
|
|
6
|
+
resourceName: string;
|
|
7
|
+
configurationKeys: string[];
|
|
8
|
+
}
|
|
9
|
+
export type DescribeConfigsRequest = Parameters<typeof createRequest>;
|
|
10
|
+
export interface DescribeConfigsResponseSynonym {
|
|
11
|
+
name: string;
|
|
12
|
+
value: NullableString;
|
|
13
|
+
source: number;
|
|
14
|
+
}
|
|
15
|
+
export interface DescribeConfigsResponseConfig {
|
|
16
|
+
name: string;
|
|
17
|
+
value: NullableString;
|
|
18
|
+
readOnly: boolean;
|
|
19
|
+
configSource: number;
|
|
20
|
+
isSensitive: boolean;
|
|
21
|
+
synonyms: DescribeConfigsResponseSynonym[];
|
|
22
|
+
configType: number;
|
|
23
|
+
documentation: NullableString;
|
|
24
|
+
}
|
|
25
|
+
export interface DescribeConfigsResponseResult {
|
|
26
|
+
errorCode: number;
|
|
27
|
+
errorMessage: NullableString;
|
|
28
|
+
resourceType: number;
|
|
29
|
+
resourceName: string;
|
|
30
|
+
configs: DescribeConfigsResponseConfig[];
|
|
31
|
+
}
|
|
32
|
+
export interface DescribeConfigsResponse {
|
|
33
|
+
throttleTimeMs: number;
|
|
34
|
+
results: DescribeConfigsResponseResult[];
|
|
35
|
+
}
|
|
36
|
+
export declare function createRequest(resources: DescribeConfigsRequestResource[], includeSynonyms: boolean, includeDocumentation: boolean): Writer;
|
|
37
|
+
export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): DescribeConfigsResponse;
|
|
38
|
+
export declare const api: import("../definitions.ts").API<[resources: DescribeConfigsRequestResource[], includeSynonyms: boolean, includeDocumentation: boolean], DescribeConfigsResponse>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { ResponseError } from "../../errors.js";
|
|
2
|
+
import { Writer } from "../../protocol/writer.js";
|
|
3
|
+
import { createAPI } from "../definitions.js";
|
|
4
|
+
/*
|
|
5
|
+
DescribeConfigs Request (Version: 3) => [resources] include_synonyms include_documentation TAG_BUFFER
|
|
6
|
+
resources => resource_type resource_name [configuration_keys] TAG_BUFFER
|
|
7
|
+
resource_type => INT8
|
|
8
|
+
resource_name => STRING
|
|
9
|
+
configuration_keys => STRING
|
|
10
|
+
include_synonyms => BOOLEAN
|
|
11
|
+
include_documentation => BOOLEAN
|
|
12
|
+
*/
|
|
13
|
+
export function createRequest(resources, includeSynonyms, includeDocumentation) {
|
|
14
|
+
return Writer.create()
|
|
15
|
+
.appendArray(resources, (w, r) => {
|
|
16
|
+
w.appendInt8(r.resourceType)
|
|
17
|
+
.appendString(r.resourceName, false)
|
|
18
|
+
.appendArray(r.configurationKeys, (w, c) => w.appendString(c, false), false, false);
|
|
19
|
+
}, false, false)
|
|
20
|
+
.appendBoolean(includeSynonyms)
|
|
21
|
+
.appendBoolean(includeDocumentation);
|
|
22
|
+
}
|
|
23
|
+
/*
|
|
24
|
+
DescribeConfigs Response (Version: 3) => throttle_time_ms [results] TAG_BUFFER
|
|
25
|
+
throttle_time_ms => INT32
|
|
26
|
+
results => error_code error_message resource_type resource_name [configs] TAG_BUFFER
|
|
27
|
+
error_code => INT16
|
|
28
|
+
error_message => NULLABLE_STRING
|
|
29
|
+
resource_type => INT8
|
|
30
|
+
resource_name => STRING
|
|
31
|
+
configs => name value read_only config_source is_sensitive [synonyms] config_type documentation TAG_BUFFER
|
|
32
|
+
name => STRING
|
|
33
|
+
value => NULLABLE_STRING
|
|
34
|
+
read_only => BOOLEAN
|
|
35
|
+
config_source => INT8
|
|
36
|
+
is_sensitive => BOOLEAN
|
|
37
|
+
synonyms => name value source TAG_BUFFER
|
|
38
|
+
name => STRING
|
|
39
|
+
value => NULLABLE_STRING
|
|
40
|
+
source => INT8
|
|
41
|
+
config_type => INT8
|
|
42
|
+
documentation => NULLABLE_STRING
|
|
43
|
+
*/
|
|
44
|
+
export function parseResponse(_correlationId, apiKey, apiVersion, reader) {
|
|
45
|
+
const errors = [];
|
|
46
|
+
const response = {
|
|
47
|
+
throttleTimeMs: reader.readInt32(),
|
|
48
|
+
results: reader.readArray((r, i) => {
|
|
49
|
+
const errorCode = r.readInt16();
|
|
50
|
+
if (errorCode !== 0) {
|
|
51
|
+
errors.push([`/results/${i}`, errorCode]);
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
errorCode,
|
|
55
|
+
errorMessage: r.readNullableString(false),
|
|
56
|
+
resourceType: r.readInt8(),
|
|
57
|
+
resourceName: r.readString(false),
|
|
58
|
+
configs: r.readArray(r => {
|
|
59
|
+
return {
|
|
60
|
+
name: r.readString(false),
|
|
61
|
+
value: r.readNullableString(false),
|
|
62
|
+
readOnly: r.readBoolean(),
|
|
63
|
+
configSource: r.readInt8(),
|
|
64
|
+
isSensitive: r.readBoolean(),
|
|
65
|
+
synonyms: r.readArray(r => {
|
|
66
|
+
return {
|
|
67
|
+
name: r.readString(false),
|
|
68
|
+
value: r.readNullableString(false),
|
|
69
|
+
source: r.readInt8()
|
|
70
|
+
};
|
|
71
|
+
}, false, false),
|
|
72
|
+
configType: r.readInt8(),
|
|
73
|
+
documentation: r.readNullableString(false)
|
|
74
|
+
};
|
|
75
|
+
}, false, false)
|
|
76
|
+
};
|
|
77
|
+
}, false, false)
|
|
78
|
+
};
|
|
79
|
+
if (errors.length) {
|
|
80
|
+
throw new ResponseError(apiKey, apiVersion, Object.fromEntries(errors), response);
|
|
81
|
+
}
|
|
82
|
+
return response;
|
|
83
|
+
}
|
|
84
|
+
export const api = createAPI(32, 3, createRequest, parseResponse, false, false);
|
|
@@ -7,6 +7,8 @@ export * as alterUserScramCredentialsV0 from './alter-user-scram-credentials-v0.
|
|
|
7
7
|
export * as consumerGroupDescribeV0 from './consumer-group-describe-v0.ts';
|
|
8
8
|
export * as createAclsV3 from './create-acls-v3.ts';
|
|
9
9
|
export * as createDelegationTokenV3 from './create-delegation-token-v3.ts';
|
|
10
|
+
export * as createPartitionsV1 from './create-partitions-v1.ts';
|
|
11
|
+
export * as createPartitionsV2 from './create-partitions-v2.ts';
|
|
10
12
|
export * as createPartitionsV3 from './create-partitions-v3.ts';
|
|
11
13
|
export * as createTopicsV7 from './create-topics-v7.ts';
|
|
12
14
|
export * as deleteAclsV3 from './delete-acls-v3.ts';
|
|
@@ -16,6 +18,8 @@ export * as deleteTopicsV6 from './delete-topics-v6.ts';
|
|
|
16
18
|
export * as describeAclsV3 from './describe-acls-v3.ts';
|
|
17
19
|
export * as describeClientQuotasV0 from './describe-client-quotas-v0.ts';
|
|
18
20
|
export * as describeClusterV1 from './describe-cluster-v1.ts';
|
|
21
|
+
export * as describeConfigsV2 from './describe-configs-v2.ts';
|
|
22
|
+
export * as describeConfigsV3 from './describe-configs-v3.ts';
|
|
19
23
|
export * as describeConfigsV4 from './describe-configs-v4.ts';
|
|
20
24
|
export * as describeDelegationTokenV3 from './describe-delegation-token-v3.ts';
|
|
21
25
|
export * as describeGroupsV5 from './describe-groups-v5.ts';
|
package/dist/apis/admin/index.js
CHANGED
|
@@ -7,6 +7,8 @@ export * as alterUserScramCredentialsV0 from "./alter-user-scram-credentials-v0.
|
|
|
7
7
|
export * as consumerGroupDescribeV0 from "./consumer-group-describe-v0.js";
|
|
8
8
|
export * as createAclsV3 from "./create-acls-v3.js";
|
|
9
9
|
export * as createDelegationTokenV3 from "./create-delegation-token-v3.js";
|
|
10
|
+
export * as createPartitionsV1 from "./create-partitions-v1.js";
|
|
11
|
+
export * as createPartitionsV2 from "./create-partitions-v2.js";
|
|
10
12
|
export * as createPartitionsV3 from "./create-partitions-v3.js";
|
|
11
13
|
export * as createTopicsV7 from "./create-topics-v7.js";
|
|
12
14
|
export * as deleteAclsV3 from "./delete-acls-v3.js";
|
|
@@ -16,6 +18,8 @@ export * as deleteTopicsV6 from "./delete-topics-v6.js";
|
|
|
16
18
|
export * as describeAclsV3 from "./describe-acls-v3.js";
|
|
17
19
|
export * as describeClientQuotasV0 from "./describe-client-quotas-v0.js";
|
|
18
20
|
export * as describeClusterV1 from "./describe-cluster-v1.js";
|
|
21
|
+
export * as describeConfigsV2 from "./describe-configs-v2.js";
|
|
22
|
+
export * as describeConfigsV3 from "./describe-configs-v3.js";
|
|
19
23
|
export * as describeConfigsV4 from "./describe-configs-v4.js";
|
|
20
24
|
export * as describeDelegationTokenV3 from "./describe-delegation-token-v3.js";
|
|
21
25
|
export * as describeGroupsV5 from "./describe-groups-v5.js";
|
package/dist/apis/callbacks.js
CHANGED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Reader } from '../../protocol/reader.ts';
|
|
2
|
+
import { type RecordsBatch } from '../../protocol/records.ts';
|
|
3
|
+
import { Writer } from '../../protocol/writer.ts';
|
|
4
|
+
export interface FetchRequestPartition {
|
|
5
|
+
partition: number;
|
|
6
|
+
currentLeaderEpoch: number;
|
|
7
|
+
fetchOffset: bigint;
|
|
8
|
+
lastFetchedEpoch: number;
|
|
9
|
+
partitionMaxBytes: number;
|
|
10
|
+
}
|
|
11
|
+
export interface FetchRequestTopic {
|
|
12
|
+
topicId: string;
|
|
13
|
+
partitions: FetchRequestPartition[];
|
|
14
|
+
}
|
|
15
|
+
export interface FetchRequestForgottenTopicsData {
|
|
16
|
+
topic: string;
|
|
17
|
+
partitions: number[];
|
|
18
|
+
}
|
|
19
|
+
export type FetchRequest = Parameters<typeof createRequest>;
|
|
20
|
+
export interface FetchResponsePartitionAbortedTransaction {
|
|
21
|
+
producerId: bigint;
|
|
22
|
+
firstOffset: bigint;
|
|
23
|
+
}
|
|
24
|
+
export interface FetchResponsePartition {
|
|
25
|
+
partitionIndex: number;
|
|
26
|
+
errorCode: number;
|
|
27
|
+
highWatermark: bigint;
|
|
28
|
+
lastStableOffset: bigint;
|
|
29
|
+
logStartOffset: bigint;
|
|
30
|
+
abortedTransactions: FetchResponsePartitionAbortedTransaction[];
|
|
31
|
+
preferredReadReplica: number;
|
|
32
|
+
records?: RecordsBatch[];
|
|
33
|
+
}
|
|
34
|
+
export interface FetchResponseTopic {
|
|
35
|
+
topicId: string;
|
|
36
|
+
partitions: FetchResponsePartition[];
|
|
37
|
+
}
|
|
38
|
+
export type FetchResponse = {
|
|
39
|
+
throttleTimeMs: number;
|
|
40
|
+
errorCode: number;
|
|
41
|
+
sessionId: number;
|
|
42
|
+
responses: FetchResponseTopic[];
|
|
43
|
+
};
|
|
44
|
+
export declare function createRequest(maxWaitMs: number, minBytes: number, maxBytes: number, isolationLevel: number, sessionId: number, sessionEpoch: number, topics: FetchRequestTopic[], forgottenTopicsData: FetchRequestForgottenTopicsData[], rackId: string): Writer;
|
|
45
|
+
export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): FetchResponse;
|
|
46
|
+
export declare const api: import("../definitions.ts").API<[maxWaitMs: number, minBytes: number, maxBytes: number, isolationLevel: number, sessionId: number, sessionEpoch: number, topics: FetchRequestTopic[], forgottenTopicsData: FetchRequestForgottenTopicsData[], rackId: string], FetchResponse>;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { ResponseError } from "../../errors.js";
|
|
2
|
+
import { Reader } from "../../protocol/reader.js";
|
|
3
|
+
import { readRecordsBatches } from "../../protocol/records.js";
|
|
4
|
+
import { Writer } from "../../protocol/writer.js";
|
|
5
|
+
import { createAPI } from "../definitions.js";
|
|
6
|
+
/*
|
|
7
|
+
Fetch Request (Version: 12) => replica_id max_wait_ms min_bytes max_bytes isolation_level session_id session_epoch [topics] [forgotten_topics_data] rack_id TAG_BUFFER
|
|
8
|
+
replica_id => INT32
|
|
9
|
+
max_wait_ms => INT32
|
|
10
|
+
min_bytes => INT32
|
|
11
|
+
max_bytes => INT32
|
|
12
|
+
isolation_level => INT8
|
|
13
|
+
session_id => INT32
|
|
14
|
+
session_epoch => INT32
|
|
15
|
+
topics => topic_id [partitions] TAG_BUFFER
|
|
16
|
+
topic => COMPACT_STRING
|
|
17
|
+
partitions => partition current_leader_epoch fetch_offset last_fetched_epoch log_start_offset partition_max_bytes TAG_BUFFER
|
|
18
|
+
partition => INT32
|
|
19
|
+
current_leader_epoch => INT32
|
|
20
|
+
fetch_offset => INT64
|
|
21
|
+
last_fetched_epoch => INT32
|
|
22
|
+
log_start_offset => INT64
|
|
23
|
+
partition_max_bytes => INT32
|
|
24
|
+
forgotten_topics_data => topic_id [partitions] TAG_BUFFER
|
|
25
|
+
topic_id => UUID
|
|
26
|
+
partitions => INT32
|
|
27
|
+
rack_id => COMPACT_STRING
|
|
28
|
+
*/
|
|
29
|
+
export function createRequest(maxWaitMs, minBytes, maxBytes, isolationLevel, sessionId, sessionEpoch, topics, forgottenTopicsData, rackId) {
|
|
30
|
+
return Writer.create()
|
|
31
|
+
.appendInt32(-1)
|
|
32
|
+
.appendInt32(maxWaitMs)
|
|
33
|
+
.appendInt32(minBytes)
|
|
34
|
+
.appendInt32(maxBytes)
|
|
35
|
+
.appendInt8(isolationLevel)
|
|
36
|
+
.appendInt32(sessionId)
|
|
37
|
+
.appendInt32(sessionEpoch)
|
|
38
|
+
.appendArray(topics, (w, t) => {
|
|
39
|
+
w.appendString(t.topicId).appendArray(t.partitions, (w, p) => {
|
|
40
|
+
w.appendInt32(p.partition)
|
|
41
|
+
.appendInt32(p.currentLeaderEpoch)
|
|
42
|
+
.appendInt64(p.fetchOffset)
|
|
43
|
+
.appendInt32(p.lastFetchedEpoch)
|
|
44
|
+
.appendInt64(-1n)
|
|
45
|
+
.appendInt32(p.partitionMaxBytes);
|
|
46
|
+
});
|
|
47
|
+
})
|
|
48
|
+
.appendArray(forgottenTopicsData, (w, t) => {
|
|
49
|
+
w.appendUUID(t.topic).appendArray(t.partitions, (w, p) => {
|
|
50
|
+
w.appendInt32(p);
|
|
51
|
+
}, true, false);
|
|
52
|
+
})
|
|
53
|
+
.appendString(rackId)
|
|
54
|
+
.appendTaggedFields();
|
|
55
|
+
}
|
|
56
|
+
/*
|
|
57
|
+
Fetch Response (Version: 12) => throttle_time_ms error_code session_id [responses] TAG_BUFFER
|
|
58
|
+
throttle_time_ms => INT32
|
|
59
|
+
error_code => INT16
|
|
60
|
+
session_id => INT32
|
|
61
|
+
responses => topic_id [partitions] TAG_BUFFER
|
|
62
|
+
topic => COMPACT_STRING
|
|
63
|
+
partitions => partition_index error_code high_watermark last_stable_offset log_start_offset [aborted_transactions] preferred_read_replica records TAG_BUFFER
|
|
64
|
+
partition_index => INT32
|
|
65
|
+
error_code => INT16
|
|
66
|
+
high_watermark => INT64
|
|
67
|
+
last_stable_offset => INT64
|
|
68
|
+
log_start_offset => INT64
|
|
69
|
+
aborted_transactions => producer_id first_offset TAG_BUFFER
|
|
70
|
+
producer_id => INT64
|
|
71
|
+
first_offset => INT64
|
|
72
|
+
preferred_read_replica => INT32
|
|
73
|
+
records => COMPACT_RECORDS
|
|
74
|
+
*/
|
|
75
|
+
export function parseResponse(_correlationId, apiKey, apiVersion, reader) {
|
|
76
|
+
const errors = [];
|
|
77
|
+
const throttleTimeMs = reader.readInt32();
|
|
78
|
+
const errorCode = reader.readInt16();
|
|
79
|
+
if (errorCode !== 0) {
|
|
80
|
+
errors.push(['', errorCode]);
|
|
81
|
+
}
|
|
82
|
+
const response = {
|
|
83
|
+
throttleTimeMs,
|
|
84
|
+
errorCode,
|
|
85
|
+
sessionId: reader.readInt32(),
|
|
86
|
+
responses: reader.readArray((r, i) => {
|
|
87
|
+
return {
|
|
88
|
+
topicId: r.readString(),
|
|
89
|
+
partitions: r.readArray((r, j) => {
|
|
90
|
+
const partition = {
|
|
91
|
+
partitionIndex: r.readInt32(),
|
|
92
|
+
errorCode: r.readInt16(),
|
|
93
|
+
highWatermark: r.readInt64(),
|
|
94
|
+
lastStableOffset: r.readInt64(),
|
|
95
|
+
logStartOffset: r.readInt64(),
|
|
96
|
+
abortedTransactions: r.readArray(r => {
|
|
97
|
+
return {
|
|
98
|
+
producerId: r.readInt64(),
|
|
99
|
+
firstOffset: r.readInt64()
|
|
100
|
+
};
|
|
101
|
+
}),
|
|
102
|
+
preferredReadReplica: r.readInt32()
|
|
103
|
+
};
|
|
104
|
+
if (partition.errorCode !== 0) {
|
|
105
|
+
errors.push([`/responses/${i}/partitions/${j}`, partition.errorCode]);
|
|
106
|
+
}
|
|
107
|
+
// We need to reduce the size by one to follow the COMPACT_RECORDS specification.
|
|
108
|
+
const recordsSize = r.readUnsignedVarInt() - 1;
|
|
109
|
+
if (recordsSize > 0) {
|
|
110
|
+
partition.records = readRecordsBatches(Reader.from(r.buffer.subarray(r.position, r.position + recordsSize)));
|
|
111
|
+
r.skip(recordsSize);
|
|
112
|
+
}
|
|
113
|
+
return partition;
|
|
114
|
+
})
|
|
115
|
+
};
|
|
116
|
+
})
|
|
117
|
+
};
|
|
118
|
+
if (errors.length) {
|
|
119
|
+
throw new ResponseError(apiKey, apiVersion, Object.fromEntries(errors), response);
|
|
120
|
+
}
|
|
121
|
+
return response;
|
|
122
|
+
}
|
|
123
|
+
export const api = createAPI(1, 12, createRequest, parseResponse);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Reader } from '../../protocol/reader.ts';
|
|
2
|
+
import { type RecordsBatch } from '../../protocol/records.ts';
|
|
3
|
+
import { Writer } from '../../protocol/writer.ts';
|
|
4
|
+
export interface FetchRequestPartition {
|
|
5
|
+
partition: number;
|
|
6
|
+
currentLeaderEpoch: number;
|
|
7
|
+
fetchOffset: bigint;
|
|
8
|
+
lastFetchedEpoch: number;
|
|
9
|
+
partitionMaxBytes: number;
|
|
10
|
+
}
|
|
11
|
+
export interface FetchRequestTopic {
|
|
12
|
+
topicId: string;
|
|
13
|
+
partitions: FetchRequestPartition[];
|
|
14
|
+
}
|
|
15
|
+
export interface FetchRequestForgottenTopicsData {
|
|
16
|
+
topic: string;
|
|
17
|
+
partitions: number[];
|
|
18
|
+
}
|
|
19
|
+
export type FetchRequest = Parameters<typeof createRequest>;
|
|
20
|
+
export interface FetchResponsePartitionAbortedTransaction {
|
|
21
|
+
producerId: bigint;
|
|
22
|
+
firstOffset: bigint;
|
|
23
|
+
}
|
|
24
|
+
export interface FetchResponsePartition {
|
|
25
|
+
partitionIndex: number;
|
|
26
|
+
errorCode: number;
|
|
27
|
+
highWatermark: bigint;
|
|
28
|
+
lastStableOffset: bigint;
|
|
29
|
+
logStartOffset: bigint;
|
|
30
|
+
abortedTransactions: FetchResponsePartitionAbortedTransaction[];
|
|
31
|
+
preferredReadReplica: number;
|
|
32
|
+
records?: RecordsBatch[];
|
|
33
|
+
}
|
|
34
|
+
export interface FetchResponseTopic {
|
|
35
|
+
topicId: string;
|
|
36
|
+
partitions: FetchResponsePartition[];
|
|
37
|
+
}
|
|
38
|
+
export type FetchResponse = {
|
|
39
|
+
throttleTimeMs: number;
|
|
40
|
+
errorCode: number;
|
|
41
|
+
sessionId: number;
|
|
42
|
+
responses: FetchResponseTopic[];
|
|
43
|
+
};
|
|
44
|
+
export declare function createRequest(maxWaitMs: number, minBytes: number, maxBytes: number, isolationLevel: number, sessionId: number, sessionEpoch: number, topics: FetchRequestTopic[], forgottenTopicsData: FetchRequestForgottenTopicsData[], rackId: string): Writer;
|
|
45
|
+
export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): FetchResponse;
|
|
46
|
+
export declare const api: import("../definitions.ts").API<[maxWaitMs: number, minBytes: number, maxBytes: number, isolationLevel: number, sessionId: number, sessionEpoch: number, topics: FetchRequestTopic[], forgottenTopicsData: FetchRequestForgottenTopicsData[], rackId: string], FetchResponse>;
|