@platformatic/kafka 1.23.0 → 1.24.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/alter-client-quotas-v1.d.ts +4 -4
- package/dist/apis/admin/alter-configs-v2.d.ts +3 -2
- package/dist/apis/admin/alter-partition-reassignments-v0.js +1 -1
- package/dist/apis/admin/create-acls-v3.d.ts +3 -11
- package/dist/apis/admin/create-partitions-v3.d.ts +2 -2
- package/dist/apis/admin/delete-acls-v3.d.ts +4 -19
- package/dist/apis/admin/delete-acls-v3.js +6 -6
- package/dist/apis/admin/describe-acls-v3.d.ts +5 -13
- package/dist/apis/admin/describe-acls-v3.js +9 -9
- package/dist/apis/admin/describe-client-quotas-v0.d.ts +5 -5
- package/dist/apis/admin/describe-configs-v4.d.ts +7 -6
- package/dist/apis/admin/describe-configs-v4.js +1 -1
- package/dist/apis/admin/incremental-alter-configs-v1.d.ts +12 -5
- package/dist/apis/admin/incremental-alter-configs-v1.js +3 -1
- package/dist/apis/admin/list-groups-v4.d.ts +2 -2
- package/dist/apis/admin/list-groups-v5.d.ts +2 -2
- package/dist/apis/admin/offset-delete-v0.js +3 -3
- package/dist/apis/callbacks.d.ts +3 -1
- package/dist/apis/consumer/offset-commit-v9.d.ts +2 -2
- package/dist/apis/consumer/offset-fetch-v8.d.ts +2 -2
- package/dist/apis/consumer/offset-fetch-v9.d.ts +2 -2
- package/dist/apis/definitions.d.ts +2 -2
- package/dist/apis/enumerations.d.ts +134 -42
- package/dist/apis/enumerations.js +42 -6
- package/dist/apis/index.d.ts +1 -0
- package/dist/apis/index.js +1 -0
- package/dist/apis/producer/add-offsets-to-txn-v3.d.ts +10 -0
- package/dist/apis/producer/add-offsets-to-txn-v3.js +34 -0
- package/dist/apis/producer/add-partitions-to-txn-v3.d.ts +34 -0
- package/dist/apis/producer/add-partitions-to-txn-v3.js +67 -0
- package/dist/apis/producer/add-partitions-to-txn-v4.d.ts +34 -0
- package/dist/apis/producer/add-partitions-to-txn-v4.js +79 -0
- package/dist/apis/producer/end-txn-v3.d.ts +10 -0
- package/dist/apis/producer/end-txn-v3.js +34 -0
- package/dist/apis/producer/index.d.ts +5 -0
- package/dist/apis/producer/index.js +5 -0
- package/dist/apis/producer/txn-offset-commit-v3.d.ts +29 -0
- package/dist/apis/producer/txn-offset-commit-v3.js +74 -0
- package/dist/apis/types.d.ts +16 -0
- package/dist/apis/types.js +1 -0
- package/dist/clients/admin/admin.d.ts +31 -1
- package/dist/clients/admin/admin.js +732 -50
- package/dist/clients/admin/options.d.ts +577 -0
- package/dist/clients/admin/options.js +359 -2
- package/dist/clients/admin/types.d.ts +105 -3
- package/dist/clients/base/base.js +29 -26
- package/dist/clients/base/options.d.ts +2 -5
- package/dist/clients/base/options.js +0 -1
- package/dist/clients/base/types.d.ts +8 -2
- package/dist/clients/consumer/consumer.d.ts +58 -2
- package/dist/clients/consumer/consumer.js +116 -47
- package/dist/clients/consumer/messages-stream.d.ts +1 -0
- package/dist/clients/consumer/messages-stream.js +48 -17
- package/dist/clients/consumer/options.d.ts +6 -6
- package/dist/clients/consumer/options.js +3 -3
- package/dist/clients/consumer/types.d.ts +26 -3
- package/dist/clients/index.d.ts +1 -1
- package/dist/clients/index.js +1 -1
- package/dist/clients/producer/options.d.ts +12 -3
- package/dist/clients/producer/options.js +1 -0
- package/dist/clients/producer/producer.d.ts +19 -2
- package/dist/clients/producer/producer.js +335 -37
- package/dist/clients/producer/transaction.d.ts +30 -0
- package/dist/clients/producer/transaction.js +172 -0
- package/dist/clients/producer/types.d.ts +2 -0
- package/dist/diagnostic.d.ts +5 -0
- package/dist/diagnostic.js +5 -0
- package/dist/errors.js +1 -0
- package/dist/network/connection-pool.js +4 -4
- package/dist/network/connection.js +3 -2
- package/dist/protocol/records.d.ts +12 -0
- package/dist/protocol/records.js +6 -4
- package/dist/protocol/sasl/oauth-bearer.js +4 -4
- package/dist/protocol/sasl/plain.js +2 -2
- package/dist/protocol/sasl/scram-sha.js +8 -8
- package/dist/protocol/sasl/utils.js +5 -5
- package/dist/symbols.d.ts +8 -0
- package/dist/symbols.js +8 -0
- package/dist/typescript-4/dist/apis/admin/alter-client-quotas-v1.d.ts +4 -4
- package/dist/typescript-4/dist/apis/admin/alter-configs-v2.d.ts +3 -2
- package/dist/typescript-4/dist/apis/admin/create-acls-v3.d.ts +3 -11
- package/dist/typescript-4/dist/apis/admin/create-partitions-v3.d.ts +2 -2
- package/dist/typescript-4/dist/apis/admin/delete-acls-v3.d.ts +4 -19
- package/dist/typescript-4/dist/apis/admin/describe-acls-v3.d.ts +5 -13
- package/dist/typescript-4/dist/apis/admin/describe-client-quotas-v0.d.ts +5 -5
- package/dist/typescript-4/dist/apis/admin/describe-configs-v4.d.ts +7 -6
- package/dist/typescript-4/dist/apis/admin/incremental-alter-configs-v1.d.ts +13 -6
- package/dist/typescript-4/dist/apis/admin/list-groups-v4.d.ts +2 -2
- package/dist/typescript-4/dist/apis/admin/list-groups-v5.d.ts +2 -2
- package/dist/typescript-4/dist/apis/callbacks.d.ts +3 -1
- package/dist/typescript-4/dist/apis/consumer/offset-commit-v9.d.ts +2 -2
- package/dist/typescript-4/dist/apis/consumer/offset-fetch-v8.d.ts +2 -2
- package/dist/typescript-4/dist/apis/consumer/offset-fetch-v9.d.ts +2 -2
- package/dist/typescript-4/dist/apis/definitions.d.ts +2 -2
- package/dist/typescript-4/dist/apis/enumerations.d.ts +134 -42
- package/dist/typescript-4/dist/apis/index.d.ts +1 -0
- package/dist/typescript-4/dist/apis/producer/add-offsets-to-txn-v3.d.ts +10 -0
- package/dist/typescript-4/dist/apis/producer/add-partitions-to-txn-v3.d.ts +34 -0
- package/dist/typescript-4/dist/apis/producer/add-partitions-to-txn-v4.d.ts +34 -0
- package/dist/typescript-4/dist/apis/producer/end-txn-v3.d.ts +10 -0
- package/dist/typescript-4/dist/apis/producer/index.d.ts +5 -0
- package/dist/typescript-4/dist/apis/producer/txn-offset-commit-v3.d.ts +29 -0
- package/dist/typescript-4/dist/apis/types.d.ts +14 -0
- package/dist/typescript-4/dist/clients/admin/admin.d.ts +31 -1
- package/dist/typescript-4/dist/clients/admin/options.d.ts +577 -0
- package/dist/typescript-4/dist/clients/admin/types.d.ts +105 -3
- package/dist/typescript-4/dist/clients/base/options.d.ts +2 -5
- package/dist/typescript-4/dist/clients/base/types.d.ts +8 -2
- package/dist/typescript-4/dist/clients/consumer/consumer.d.ts +58 -2
- package/dist/typescript-4/dist/clients/consumer/messages-stream.d.ts +1 -0
- package/dist/typescript-4/dist/clients/consumer/options.d.ts +6 -6
- package/dist/typescript-4/dist/clients/consumer/types.d.ts +27 -4
- package/dist/typescript-4/dist/clients/index.d.ts +1 -1
- package/dist/typescript-4/dist/clients/producer/options.d.ts +12 -3
- package/dist/typescript-4/dist/clients/producer/producer.d.ts +19 -2
- package/dist/typescript-4/dist/clients/producer/transaction.d.ts +30 -0
- package/dist/typescript-4/dist/clients/producer/types.d.ts +2 -0
- package/dist/typescript-4/dist/diagnostic.d.ts +5 -0
- package/dist/typescript-4/dist/protocol/records.d.ts +12 -0
- package/dist/typescript-4/dist/symbols.d.ts +9 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { type AlterClientQuotasRequestEntry } from "../../apis/admin/alter-client-quotas-v1";
|
|
2
|
+
import { type CreatePartitionsRequestTopic } from "../../apis/admin/create-partitions-v3";
|
|
2
3
|
import { type CreateTopicsRequestTopicConfig } from "../../apis/admin/create-topics-v7";
|
|
4
|
+
import { type AlterConfigsRequestResource } from "../../apis/admin/alter-configs-v2";
|
|
5
|
+
import { type DescribeConfigsRequestResource, type DescribeConfigsResponseConfig } from "../../apis/admin/describe-configs-v4";
|
|
3
6
|
import { type DescribeClientQuotasRequestComponent } from "../../apis/admin/describe-client-quotas-v0";
|
|
4
7
|
import { type DescribeLogDirsRequestTopic, type DescribeLogDirsResponse, type DescribeLogDirsResponseResult } from "../../apis/admin/describe-log-dirs-v4";
|
|
5
|
-
import { type
|
|
8
|
+
import { type IncrementalAlterConfigsRequestResource } from "../../apis/admin/incremental-alter-configs-v1";
|
|
9
|
+
import { type FetchIsolationLevelValue, type ConfigResourceTypeValue, type ConsumerGroupStateValue } from "../../apis/enumerations";
|
|
6
10
|
import { type Nullable, type NullableString } from "../../protocol/definitions";
|
|
7
11
|
import { type BaseOptions } from "../base/types";
|
|
8
12
|
import { type ExtendedGroupProtocolSubscription, type GroupAssignment } from "../consumer/types";
|
|
13
|
+
import { type Acl, type AclFilter } from "../../apis/types";
|
|
9
14
|
export interface BrokerAssignment {
|
|
10
15
|
partition: number;
|
|
11
16
|
brokers: number[];
|
|
@@ -27,7 +32,7 @@ export interface GroupMember {
|
|
|
27
32
|
}
|
|
28
33
|
export interface GroupBase {
|
|
29
34
|
id: string;
|
|
30
|
-
state:
|
|
35
|
+
state: ConsumerGroupStateValue;
|
|
31
36
|
groupType: string;
|
|
32
37
|
protocolType: string;
|
|
33
38
|
}
|
|
@@ -50,8 +55,12 @@ export interface ListTopicsOptions {
|
|
|
50
55
|
export interface DeleteTopicsOptions {
|
|
51
56
|
topics: string[];
|
|
52
57
|
}
|
|
58
|
+
export interface CreatePartitionsOptions {
|
|
59
|
+
topics: CreatePartitionsRequestTopic[];
|
|
60
|
+
validateOnly?: boolean;
|
|
61
|
+
}
|
|
53
62
|
export interface ListGroupsOptions {
|
|
54
|
-
states?:
|
|
63
|
+
states?: ConsumerGroupStateValue[];
|
|
55
64
|
types?: string[];
|
|
56
65
|
}
|
|
57
66
|
export interface DescribeGroupsOptions {
|
|
@@ -85,4 +94,97 @@ export interface BrokerLogDirDescription {
|
|
|
85
94
|
throttleTimeMs: DescribeLogDirsResponse['throttleTimeMs'];
|
|
86
95
|
results: Omit<DescribeLogDirsResponseResult, 'errorCode'>[];
|
|
87
96
|
}
|
|
97
|
+
interface GroupWithTopicPartitions {
|
|
98
|
+
groupId: string;
|
|
99
|
+
topics?: Nullable<{
|
|
100
|
+
name: string;
|
|
101
|
+
partitionIndexes: number[];
|
|
102
|
+
}[]>;
|
|
103
|
+
}
|
|
104
|
+
export interface ListConsumerGroupOffsetsOptions {
|
|
105
|
+
groups: (string | GroupWithTopicPartitions)[];
|
|
106
|
+
requireStable?: boolean;
|
|
107
|
+
}
|
|
108
|
+
interface ListConsumerGroupOffsetsPartition {
|
|
109
|
+
partitionIndex: number;
|
|
110
|
+
committedOffset: bigint;
|
|
111
|
+
committedLeaderEpoch: number;
|
|
112
|
+
metadata: NullableString;
|
|
113
|
+
}
|
|
114
|
+
interface ListConsumerGroupOffsetsTopic {
|
|
115
|
+
name: string;
|
|
116
|
+
partitions: ListConsumerGroupOffsetsPartition[];
|
|
117
|
+
}
|
|
118
|
+
export interface ListConsumerGroupOffsetsGroup {
|
|
119
|
+
groupId: string;
|
|
120
|
+
topics: ListConsumerGroupOffsetsTopic[];
|
|
121
|
+
}
|
|
122
|
+
interface PartitionOffset {
|
|
123
|
+
partition: number;
|
|
124
|
+
offset: bigint;
|
|
125
|
+
}
|
|
126
|
+
interface AlterConsumerGroupOffsetsTopic {
|
|
127
|
+
name: string;
|
|
128
|
+
partitionOffsets: PartitionOffset[];
|
|
129
|
+
}
|
|
130
|
+
export interface AlterConsumerGroupOffsetsOptions {
|
|
131
|
+
groupId: string;
|
|
132
|
+
topics: AlterConsumerGroupOffsetsTopic[];
|
|
133
|
+
}
|
|
134
|
+
export interface DeleteConsumerGroupOffsetsOptions {
|
|
135
|
+
groupId: string;
|
|
136
|
+
topics: {
|
|
137
|
+
name: string;
|
|
138
|
+
partitionIndexes: number[];
|
|
139
|
+
}[];
|
|
140
|
+
}
|
|
141
|
+
export interface DescribeConfigsOptions {
|
|
142
|
+
resources: DescribeConfigsRequestResource[];
|
|
143
|
+
includeSynonyms?: boolean;
|
|
144
|
+
includeDocumentation?: boolean;
|
|
145
|
+
}
|
|
146
|
+
export interface ConfigDescription {
|
|
147
|
+
resourceType: ConfigResourceTypeValue;
|
|
148
|
+
resourceName: string;
|
|
149
|
+
configs: DescribeConfigsResponseConfig[];
|
|
150
|
+
}
|
|
151
|
+
export interface AlterConfigsOptions {
|
|
152
|
+
resources: AlterConfigsRequestResource[];
|
|
153
|
+
validateOnly?: boolean;
|
|
154
|
+
}
|
|
155
|
+
export interface IncrementalAlterConfigsOptions {
|
|
156
|
+
resources: IncrementalAlterConfigsRequestResource[];
|
|
157
|
+
validateOnly?: boolean;
|
|
158
|
+
}
|
|
159
|
+
export interface CreateAclsOptions {
|
|
160
|
+
creations: Acl[];
|
|
161
|
+
}
|
|
162
|
+
export interface DescribeAclsOptions {
|
|
163
|
+
filter: AclFilter;
|
|
164
|
+
}
|
|
165
|
+
export interface DeleteAclsOptions {
|
|
166
|
+
filters: AclFilter[];
|
|
167
|
+
}
|
|
168
|
+
export interface PartitionTimestamp {
|
|
169
|
+
partitionIndex: number;
|
|
170
|
+
timestamp: bigint;
|
|
171
|
+
}
|
|
172
|
+
export interface TopicOffsetRequest {
|
|
173
|
+
name: string;
|
|
174
|
+
partitions: PartitionTimestamp[];
|
|
175
|
+
}
|
|
176
|
+
export interface ListOffsetsOptions {
|
|
177
|
+
topics: TopicOffsetRequest[];
|
|
178
|
+
isolationLevel?: Nullable<FetchIsolationLevelValue>;
|
|
179
|
+
}
|
|
180
|
+
export interface ListedOffsetsPartition {
|
|
181
|
+
partitionIndex: number;
|
|
182
|
+
timestamp: bigint;
|
|
183
|
+
offset: bigint;
|
|
184
|
+
leaderEpoch: number;
|
|
185
|
+
}
|
|
186
|
+
export interface ListedOffsetsTopic {
|
|
187
|
+
name: string;
|
|
188
|
+
partitions: ListedOffsetsPartition[];
|
|
189
|
+
}
|
|
88
190
|
export {};
|
|
@@ -92,7 +92,7 @@ export declare const baseOptionsSchema: {
|
|
|
92
92
|
properties: {
|
|
93
93
|
mechanism: {
|
|
94
94
|
type: string;
|
|
95
|
-
enum:
|
|
95
|
+
enum: ("PLAIN" | "SCRAM-SHA-256" | "SCRAM-SHA-512" | "OAUTHBEARER" | "GSSAPI")[];
|
|
96
96
|
};
|
|
97
97
|
username: {
|
|
98
98
|
oneOf: ({
|
|
@@ -185,14 +185,11 @@ export declare const metadataOptionsSchema: {
|
|
|
185
185
|
minimum: number;
|
|
186
186
|
};
|
|
187
187
|
};
|
|
188
|
-
required: string[];
|
|
189
188
|
additionalProperties: boolean;
|
|
190
189
|
};
|
|
191
190
|
export declare const baseOptionsValidator: import("ajv").ValidateFunction<{
|
|
192
191
|
[x: string]: {};
|
|
193
192
|
}>;
|
|
194
|
-
export declare const metadataOptionsValidator: import("ajv").ValidateFunction<
|
|
195
|
-
[x: string]: {};
|
|
196
|
-
}>;
|
|
193
|
+
export declare const metadataOptionsValidator: import("ajv").ValidateFunction<unknown>;
|
|
197
194
|
export declare const defaultPort = 9092;
|
|
198
195
|
export declare const defaultBaseOptions: Partial<BaseOptions>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Broker, type ConnectionOptions } from "../../network/connection";
|
|
2
|
+
import { type NullableString } from "../../protocol/definitions";
|
|
2
3
|
import { type Metrics } from "../metrics";
|
|
3
4
|
export interface TopicWithPartitionAndOffset {
|
|
4
5
|
topic: string;
|
|
@@ -9,6 +10,8 @@ export interface ClusterPartitionMetadata {
|
|
|
9
10
|
leader: number;
|
|
10
11
|
leaderEpoch: number;
|
|
11
12
|
replicas: number[];
|
|
13
|
+
isr: number[];
|
|
14
|
+
offlineReplicas: number[];
|
|
12
15
|
}
|
|
13
16
|
export interface ClusterTopicMetadata {
|
|
14
17
|
id: string;
|
|
@@ -16,9 +19,12 @@ export interface ClusterTopicMetadata {
|
|
|
16
19
|
partitionsCount: number;
|
|
17
20
|
lastUpdate: number;
|
|
18
21
|
}
|
|
22
|
+
export interface BrokerWithRack extends Broker {
|
|
23
|
+
rack: NullableString;
|
|
24
|
+
}
|
|
19
25
|
export interface ClusterMetadata {
|
|
20
26
|
id: string;
|
|
21
|
-
brokers: Map<number,
|
|
27
|
+
brokers: Map<number, BrokerWithRack>;
|
|
22
28
|
controllerId: number;
|
|
23
29
|
topics: Map<string, ClusterTopicMetadata>;
|
|
24
30
|
lastUpdate: number;
|
|
@@ -35,7 +41,7 @@ export interface BaseOptions extends ConnectionOptions {
|
|
|
35
41
|
metrics?: Metrics;
|
|
36
42
|
}
|
|
37
43
|
export interface MetadataOptions {
|
|
38
|
-
topics
|
|
44
|
+
topics?: string[];
|
|
39
45
|
autocreateTopics?: boolean;
|
|
40
46
|
forceUpdate?: boolean;
|
|
41
47
|
metadataMaxAge?: number;
|
|
@@ -4,7 +4,7 @@ import { type ConnectionPool } from "../../network/connection-pool";
|
|
|
4
4
|
import { Base, kFetchConnections } from "../base/base";
|
|
5
5
|
import { MessagesStream } from "./messages-stream";
|
|
6
6
|
import { TopicsMap } from "./topics-map";
|
|
7
|
-
import { type CommitOptions, type ConsumeOptions, type ConsumerOptions, type FetchOptions, type GetLagOptions, type GroupAssignment, type GroupOptions, type ListCommitsOptions, type ListOffsetsOptions, type Offsets, type OffsetsWithTimestamps } from "./types";
|
|
7
|
+
import { type CommitOptions, type ConsumeOptions, type ConsumerGroupJoinPayload, type ConsumerGroupLeavePayload, type ConsumerGroupRebalancePayload, type ConsumerHeartbeatErrorPayload, type ConsumerHeartbeatPayload, type ConsumerOptions, type FetchOptions, type GetLagOptions, type GroupAssignment, type GroupOptions, type ListCommitsOptions, type ListOffsetsOptions, type Offsets, type OffsetsWithTimestamps } from "./types";
|
|
8
8
|
export declare class Consumer<Key = Buffer, Value = Buffer, HeaderKey = Buffer, HeaderValue = Buffer> extends Base<ConsumerOptions<Key, Value, HeaderKey, HeaderValue>> {
|
|
9
9
|
#private;
|
|
10
10
|
groupId: string;
|
|
@@ -16,6 +16,62 @@ export declare class Consumer<Key = Buffer, Value = Buffer, HeaderKey = Buffer,
|
|
|
16
16
|
constructor(options: ConsumerOptions<Key, Value, HeaderKey, HeaderValue>);
|
|
17
17
|
get streamsCount(): number;
|
|
18
18
|
get lastHeartbeat(): Date | null;
|
|
19
|
+
get coordinatorId(): number | null;
|
|
20
|
+
addListener(event: 'consumer:group:join', listener: (payload: ConsumerGroupJoinPayload) => void): this;
|
|
21
|
+
addListener(event: 'consumer:group:leave', listener: (payload: ConsumerGroupLeavePayload) => void): this;
|
|
22
|
+
addListener(event: 'consumer:group:rejoin', listener: () => void): this;
|
|
23
|
+
addListener(event: 'consumer:group:rebalance', listener: (payload: ConsumerGroupRebalancePayload) => void): this;
|
|
24
|
+
addListener(event: 'consumer:heartbeat:start', listener: (payload?: ConsumerHeartbeatPayload) => void): this;
|
|
25
|
+
addListener(event: 'consumer:heartbeat:cancel', listener: (payload: ConsumerHeartbeatPayload) => void): this;
|
|
26
|
+
addListener(event: 'consumer:heartbeat:end', listener: (payload?: ConsumerHeartbeatPayload) => void): this;
|
|
27
|
+
addListener(event: 'consumer:heartbeat:error', listener: (payload: ConsumerHeartbeatErrorPayload) => void): this;
|
|
28
|
+
addListener(event: 'consumer:lag', listener: (lag: Offsets) => void): this;
|
|
29
|
+
addListener(event: 'consumer:lag:error', listener: (error: Error) => void): this;
|
|
30
|
+
addListener(event: 'error', listener: (error: Error) => void): this;
|
|
31
|
+
on(event: 'consumer:group:join', listener: (payload: ConsumerGroupJoinPayload) => void): this;
|
|
32
|
+
on(event: 'consumer:group:leave', listener: (payload: ConsumerGroupLeavePayload) => void): this;
|
|
33
|
+
on(event: 'consumer:group:rejoin', listener: () => void): this;
|
|
34
|
+
on(event: 'consumer:group:rebalance', listener: (payload: ConsumerGroupRebalancePayload) => void): this;
|
|
35
|
+
on(event: 'consumer:heartbeat:start', listener: (payload?: ConsumerHeartbeatPayload) => void): this;
|
|
36
|
+
on(event: 'consumer:heartbeat:cancel', listener: (payload: ConsumerHeartbeatPayload) => void): this;
|
|
37
|
+
on(event: 'consumer:heartbeat:end', listener: (payload?: ConsumerHeartbeatPayload) => void): this;
|
|
38
|
+
on(event: 'consumer:heartbeat:error', listener: (payload: ConsumerHeartbeatErrorPayload) => void): this;
|
|
39
|
+
on(event: 'consumer:lag', listener: (lag: Offsets) => void): this;
|
|
40
|
+
on(event: 'consumer:lag:error', listener: (error: Error) => void): this;
|
|
41
|
+
on(event: 'error', listener: (error: Error) => void): this;
|
|
42
|
+
once(event: 'consumer:group:join', listener: (payload: ConsumerGroupJoinPayload) => void): this;
|
|
43
|
+
once(event: 'consumer:group:leave', listener: (payload: ConsumerGroupLeavePayload) => void): this;
|
|
44
|
+
once(event: 'consumer:group:rejoin', listener: () => void): this;
|
|
45
|
+
once(event: 'consumer:group:rebalance', listener: (payload: ConsumerGroupRebalancePayload) => void): this;
|
|
46
|
+
once(event: 'consumer:heartbeat:start', listener: (payload?: ConsumerHeartbeatPayload) => void): this;
|
|
47
|
+
once(event: 'consumer:heartbeat:cancel', listener: (payload: ConsumerHeartbeatPayload) => void): this;
|
|
48
|
+
once(event: 'consumer:heartbeat:end', listener: (payload?: ConsumerHeartbeatPayload) => void): this;
|
|
49
|
+
once(event: 'consumer:heartbeat:error', listener: (payload: ConsumerHeartbeatErrorPayload) => void): this;
|
|
50
|
+
once(event: 'consumer:lag', listener: (lag: Offsets) => void): this;
|
|
51
|
+
once(event: 'consumer:lag:error', listener: (error: Error) => void): this;
|
|
52
|
+
once(event: 'error', listener: (error: Error) => void): this;
|
|
53
|
+
prependListener(event: 'consumer:group:join', listener: (payload: ConsumerGroupJoinPayload) => void): this;
|
|
54
|
+
prependListener(event: 'consumer:group:leave', listener: (payload: ConsumerGroupLeavePayload) => void): this;
|
|
55
|
+
prependListener(event: 'consumer:group:rejoin', listener: () => void): this;
|
|
56
|
+
prependListener(event: 'consumer:group:rebalance', listener: (payload: ConsumerGroupRebalancePayload) => void): this;
|
|
57
|
+
prependListener(event: 'consumer:heartbeat:start', listener: (payload?: ConsumerHeartbeatPayload) => void): this;
|
|
58
|
+
prependListener(event: 'consumer:heartbeat:cancel', listener: (payload: ConsumerHeartbeatPayload) => void): this;
|
|
59
|
+
prependListener(event: 'consumer:heartbeat:end', listener: (payload?: ConsumerHeartbeatPayload) => void): this;
|
|
60
|
+
prependListener(event: 'consumer:heartbeat:error', listener: (payload: ConsumerHeartbeatErrorPayload) => void): this;
|
|
61
|
+
prependListener(event: 'consumer:lag', listener: (lag: Offsets) => void): this;
|
|
62
|
+
prependListener(event: 'consumer:lag:error', listener: (error: Error) => void): this;
|
|
63
|
+
prependListener(event: 'error', listener: (error: Error) => void): this;
|
|
64
|
+
prependOnceListener(event: 'consumer:group:join', listener: (payload: ConsumerGroupJoinPayload) => void): this;
|
|
65
|
+
prependOnceListener(event: 'consumer:group:leave', listener: (payload: ConsumerGroupLeavePayload) => void): this;
|
|
66
|
+
prependOnceListener(event: 'consumer:group:rejoin', listener: () => void): this;
|
|
67
|
+
prependOnceListener(event: 'consumer:group:rebalance', listener: (payload: ConsumerGroupRebalancePayload) => void): this;
|
|
68
|
+
prependOnceListener(event: 'consumer:heartbeat:start', listener: (payload?: ConsumerHeartbeatPayload) => void): this;
|
|
69
|
+
prependOnceListener(event: 'consumer:heartbeat:cancel', listener: (payload: ConsumerHeartbeatPayload) => void): this;
|
|
70
|
+
prependOnceListener(event: 'consumer:heartbeat:end', listener: (payload?: ConsumerHeartbeatPayload) => void): this;
|
|
71
|
+
prependOnceListener(event: 'consumer:heartbeat:error', listener: (payload: ConsumerHeartbeatErrorPayload) => void): this;
|
|
72
|
+
prependOnceListener(event: 'consumer:lag', listener: (lag: Offsets) => void): this;
|
|
73
|
+
prependOnceListener(event: 'consumer:lag:error', listener: (error: Error) => void): this;
|
|
74
|
+
prependOnceListener(event: 'error', listener: (error: Error) => void): this;
|
|
19
75
|
close(force: boolean | CallbackWithPromise<void>, callback?: CallbackWithPromise<void>): void;
|
|
20
76
|
close(force?: boolean): Promise<void>;
|
|
21
77
|
isActive(): boolean;
|
|
@@ -38,7 +94,7 @@ export declare class Consumer<Key = Buffer, Value = Buffer, HeaderKey = Buffer,
|
|
|
38
94
|
findGroupCoordinator(callback: CallbackWithPromise<number>): void;
|
|
39
95
|
findGroupCoordinator(): Promise<number>;
|
|
40
96
|
joinGroup(options: GroupOptions, callback: CallbackWithPromise<string>): void;
|
|
41
|
-
joinGroup(options
|
|
97
|
+
joinGroup(options?: GroupOptions): Promise<string>;
|
|
42
98
|
leaveGroup(force?: boolean | CallbackWithPromise<void>, callback?: CallbackWithPromise<void>): void;
|
|
43
99
|
leaveGroup(force?: boolean): Promise<void>;
|
|
44
100
|
}
|
|
@@ -11,6 +11,7 @@ export declare class MessagesStream<Key, Value, HeaderKey, HeaderValue> extends
|
|
|
11
11
|
#private;
|
|
12
12
|
[kInstance]: number;
|
|
13
13
|
constructor(consumer: Consumer<Key, Value, HeaderKey, HeaderValue>, options: ConsumeOptions<Key, Value, HeaderKey, HeaderValue>);
|
|
14
|
+
get consumer(): Consumer<Key, Value, HeaderKey, HeaderValue>;
|
|
14
15
|
get offsetsToFetch(): Map<string, bigint>;
|
|
15
16
|
get offsetsToCommit(): Map<string, CommitOptionsPartition>;
|
|
16
17
|
get offsetsCommitted(): Map<string, bigint>;
|
|
@@ -99,7 +99,7 @@ export declare const consumeOptionsProperties: {
|
|
|
99
99
|
};
|
|
100
100
|
isolationLevel: {
|
|
101
101
|
type: string;
|
|
102
|
-
enum:
|
|
102
|
+
enum: (0 | 1)[];
|
|
103
103
|
};
|
|
104
104
|
deserializers: {
|
|
105
105
|
type: string;
|
|
@@ -209,7 +209,7 @@ export declare const consumeOptionsSchema: {
|
|
|
209
209
|
};
|
|
210
210
|
isolationLevel: {
|
|
211
211
|
type: string;
|
|
212
|
-
enum:
|
|
212
|
+
enum: (0 | 1)[];
|
|
213
213
|
};
|
|
214
214
|
deserializers: {
|
|
215
215
|
type: string;
|
|
@@ -360,7 +360,7 @@ export declare const consumerOptionsSchema: {
|
|
|
360
360
|
};
|
|
361
361
|
isolationLevel: {
|
|
362
362
|
type: string;
|
|
363
|
-
enum:
|
|
363
|
+
enum: (0 | 1)[];
|
|
364
364
|
};
|
|
365
365
|
deserializers: {
|
|
366
366
|
type: string;
|
|
@@ -471,7 +471,7 @@ export declare const fetchOptionsSchema: {
|
|
|
471
471
|
};
|
|
472
472
|
isolationLevel: {
|
|
473
473
|
type: string;
|
|
474
|
-
enum:
|
|
474
|
+
enum: (0 | 1)[];
|
|
475
475
|
};
|
|
476
476
|
deserializers: {
|
|
477
477
|
type: string;
|
|
@@ -673,7 +673,7 @@ export declare const listOffsetsOptionsSchema: {
|
|
|
673
673
|
};
|
|
674
674
|
isolationLevel: {
|
|
675
675
|
type: string;
|
|
676
|
-
enum:
|
|
676
|
+
enum: (0 | 1)[];
|
|
677
677
|
};
|
|
678
678
|
timestamp: {
|
|
679
679
|
bigint: boolean;
|
|
@@ -743,6 +743,6 @@ export declare const defaultConsumerOptions: {
|
|
|
743
743
|
minBytes: number;
|
|
744
744
|
maxBytes: number;
|
|
745
745
|
maxWaitTime: number;
|
|
746
|
-
isolationLevel:
|
|
746
|
+
isolationLevel: 1;
|
|
747
747
|
highWaterMark: number;
|
|
748
748
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type FetchRequestTopic } from "../../apis/consumer/fetch-v17";
|
|
2
|
-
import { type
|
|
2
|
+
import { type GroupProtocols } from "../../apis/enumerations";
|
|
3
3
|
import { type KafkaRecord, type Message } from "../../protocol/records";
|
|
4
4
|
import { type BaseOptions, type ClusterMetadata, type TopicWithPartitionAndOffset } from "../base/types";
|
|
5
5
|
import { type Deserializers } from "../serde";
|
|
@@ -62,7 +62,7 @@ export interface ConsumeBaseOptions<Key, Value, HeaderKey, HeaderValue> {
|
|
|
62
62
|
minBytes?: number;
|
|
63
63
|
maxBytes?: number;
|
|
64
64
|
maxWaitTime?: number;
|
|
65
|
-
isolationLevel?:
|
|
65
|
+
isolationLevel?: number;
|
|
66
66
|
deserializers?: Partial<Deserializers<Key, Value, HeaderKey, HeaderValue>>;
|
|
67
67
|
highWaterMark?: number;
|
|
68
68
|
}
|
|
@@ -95,6 +95,29 @@ export interface ListOffsetsOptions {
|
|
|
95
95
|
topics: string[];
|
|
96
96
|
partitions?: Record<string, number[]>;
|
|
97
97
|
timestamp?: bigint;
|
|
98
|
-
isolationLevel?:
|
|
98
|
+
isolationLevel?: number;
|
|
99
99
|
}
|
|
100
|
-
export type GetLagOptions = Omit<ListOffsetsOptions, 'timestamp' | 'isolationLevel'>;
|
|
100
|
+
export type GetLagOptions = Omit<ListOffsetsOptions, 'timestamp' | 'isolationLevel'>;
|
|
101
|
+
export interface ConsumerGroupJoinPayload {
|
|
102
|
+
groupId: string;
|
|
103
|
+
memberId: string;
|
|
104
|
+
generationId?: number;
|
|
105
|
+
isLeader?: boolean;
|
|
106
|
+
assignments?: GroupAssignment[];
|
|
107
|
+
}
|
|
108
|
+
export interface ConsumerGroupLeavePayload {
|
|
109
|
+
groupId: string;
|
|
110
|
+
memberId: string | null;
|
|
111
|
+
generationId?: number;
|
|
112
|
+
}
|
|
113
|
+
export interface ConsumerGroupRebalancePayload {
|
|
114
|
+
groupId: string;
|
|
115
|
+
}
|
|
116
|
+
export interface ConsumerHeartbeatPayload {
|
|
117
|
+
groupId?: string;
|
|
118
|
+
memberId?: string | null;
|
|
119
|
+
generationId?: number;
|
|
120
|
+
}
|
|
121
|
+
export interface ConsumerHeartbeatErrorPayload extends ConsumerHeartbeatPayload {
|
|
122
|
+
error: Error;
|
|
123
|
+
}
|
|
@@ -8,10 +8,13 @@ export declare const produceOptionsProperties: {
|
|
|
8
8
|
idempotent: {
|
|
9
9
|
type: string;
|
|
10
10
|
};
|
|
11
|
+
transactionalId: {
|
|
12
|
+
type: string;
|
|
13
|
+
};
|
|
11
14
|
acks: {
|
|
12
15
|
type: string;
|
|
13
16
|
enumeration: {
|
|
14
|
-
allowed:
|
|
17
|
+
allowed: (0 | 1 | -1)[];
|
|
15
18
|
errorMessage: string;
|
|
16
19
|
};
|
|
17
20
|
};
|
|
@@ -44,10 +47,13 @@ export declare const produceOptionsSchema: {
|
|
|
44
47
|
idempotent: {
|
|
45
48
|
type: string;
|
|
46
49
|
};
|
|
50
|
+
transactionalId: {
|
|
51
|
+
type: string;
|
|
52
|
+
};
|
|
47
53
|
acks: {
|
|
48
54
|
type: string;
|
|
49
55
|
enumeration: {
|
|
50
|
-
allowed:
|
|
56
|
+
allowed: (0 | 1 | -1)[];
|
|
51
57
|
errorMessage: string;
|
|
52
58
|
};
|
|
53
59
|
};
|
|
@@ -84,10 +90,13 @@ export declare const sendOptionsSchema: {
|
|
|
84
90
|
idempotent: {
|
|
85
91
|
type: string;
|
|
86
92
|
};
|
|
93
|
+
transactionalId: {
|
|
94
|
+
type: string;
|
|
95
|
+
};
|
|
87
96
|
acks: {
|
|
88
97
|
type: string;
|
|
89
98
|
enumeration: {
|
|
90
|
-
allowed:
|
|
99
|
+
allowed: (0 | 1 | -1)[];
|
|
91
100
|
errorMessage: string;
|
|
92
101
|
};
|
|
93
102
|
};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { type CallbackWithPromise } from "../../apis/callbacks";
|
|
2
|
+
import { type Message } from "../../protocol/records";
|
|
3
|
+
import { kTransaction, kTransactionAddOffsets, kTransactionAddPartitions, kTransactionCancel, kTransactionCommitOffset, kTransactionEnd, kTransactionFindCoordinator } from "../../symbols";
|
|
2
4
|
import { Base } from "../base/base";
|
|
5
|
+
import { Transaction } from "./transaction";
|
|
3
6
|
import { type ProduceOptions, type ProduceResult, type ProducerInfo, type ProducerOptions, type SendOptions } from "./types";
|
|
4
7
|
export declare function noopSerializer(data?: Buffer): Buffer | undefined;
|
|
5
8
|
export declare class Producer<Key = Buffer, Value = Buffer, HeaderKey = Buffer, HeaderValue = Buffer> extends Base<ProducerOptions<Key, Value, HeaderKey, HeaderValue>> {
|
|
@@ -7,10 +10,24 @@ export declare class Producer<Key = Buffer, Value = Buffer, HeaderKey = Buffer,
|
|
|
7
10
|
constructor(options: ProducerOptions<Key, Value, HeaderKey, HeaderValue>);
|
|
8
11
|
get producerId(): bigint | undefined;
|
|
9
12
|
get producerEpoch(): number | undefined;
|
|
13
|
+
get transaction(): Transaction<Key, Value, HeaderKey, HeaderValue> | undefined;
|
|
14
|
+
get coordinatorId(): number;
|
|
10
15
|
close(callback: CallbackWithPromise<void>): void;
|
|
11
16
|
close(): Promise<void>;
|
|
12
17
|
initIdempotentProducer(options: ProduceOptions<Key, Value, HeaderKey, HeaderValue>, callback: CallbackWithPromise<ProducerInfo>): void;
|
|
13
18
|
initIdempotentProducer(options: ProduceOptions<Key, Value, HeaderKey, HeaderValue>): Promise<ProducerInfo>;
|
|
14
|
-
send(options: SendOptions<Key, Value, HeaderKey, HeaderValue
|
|
15
|
-
|
|
19
|
+
send(options: SendOptions<Key, Value, HeaderKey, HeaderValue> & {
|
|
20
|
+
[kTransaction]?: number;
|
|
21
|
+
}, callback: CallbackWithPromise<ProduceResult>): void;
|
|
22
|
+
send(options: SendOptions<Key, Value, HeaderKey, HeaderValue> & {
|
|
23
|
+
[kTransaction]?: number;
|
|
24
|
+
}): Promise<ProduceResult>;
|
|
25
|
+
beginTransaction(options: ProduceOptions<Key, Value, HeaderKey, HeaderValue>, callback: CallbackWithPromise<Transaction<Key, Value, HeaderKey, HeaderValue>>): void;
|
|
26
|
+
beginTransaction(options?: ProduceOptions<Key, Value, HeaderKey, HeaderValue>): Promise<Transaction<Key, Value, HeaderKey, HeaderValue>>;
|
|
27
|
+
[kTransactionFindCoordinator](callback: CallbackWithPromise<void>): void;
|
|
28
|
+
[kTransactionAddPartitions](transactionId: number, topicsPartitions: Map<string, Set<number>>, callback: CallbackWithPromise<void>): void;
|
|
29
|
+
[kTransactionAddOffsets](transactionId: number, groupId: string, callback: CallbackWithPromise<void>): void;
|
|
30
|
+
[kTransactionCommitOffset]<MessageKey = Buffer, MessageValue = Buffer, MessageHeaderKey = Buffer, MessageHeaderValue = Buffer>(transactionId: number, message: Message<MessageKey, MessageValue, MessageHeaderKey, MessageHeaderValue>, callback: CallbackWithPromise<void>): void;
|
|
31
|
+
[kTransactionEnd](transactionId: number, commit: boolean, callback: CallbackWithPromise<void>): void;
|
|
32
|
+
[kTransactionCancel](transactionId: number, callback: CallbackWithPromise<void>): void;
|
|
16
33
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type CallbackWithPromise } from "../../apis/callbacks";
|
|
2
|
+
import { type Callback } from "../../apis/definitions";
|
|
3
|
+
import { type Message, type MessageRecord } from "../../protocol/records";
|
|
4
|
+
import { kInstance, kTransactionPrepare } from "../../symbols";
|
|
5
|
+
import { type ClusterMetadata } from "../base/types";
|
|
6
|
+
import { type Consumer } from "../consumer/consumer";
|
|
7
|
+
import { type Producer } from "./producer";
|
|
8
|
+
import { type ProduceOptions, type ProduceResult, type SendOptions } from "./types";
|
|
9
|
+
export declare class Transaction<Key = Buffer, Value = Buffer, HeaderKey = Buffer, HeaderValue = Buffer> {
|
|
10
|
+
#private;
|
|
11
|
+
id: string;
|
|
12
|
+
[kInstance]: number;
|
|
13
|
+
constructor(producer: Producer<Key, Value, HeaderKey, HeaderValue>);
|
|
14
|
+
get completed(): boolean;
|
|
15
|
+
[kTransactionPrepare](transactionalId: string | undefined, options: ProduceOptions<Key, Value, HeaderKey, HeaderValue>, callback: Callback<Transaction<Key, Value, HeaderKey, HeaderValue>>): void;
|
|
16
|
+
send(options: SendOptions<Key, Value, HeaderKey, HeaderValue>, callback: CallbackWithPromise<ProduceResult>): void;
|
|
17
|
+
send(options: SendOptions<Key, Value, HeaderKey, HeaderValue>): Promise<ProduceResult>;
|
|
18
|
+
addPartitions(metadata: ClusterMetadata, messages: MessageRecord[], callback: CallbackWithPromise<void>): void;
|
|
19
|
+
addPartitions(metadata: ClusterMetadata, messages: MessageRecord[]): Promise<void>;
|
|
20
|
+
addConsumer<MessageKey = Buffer, MessageValue = Buffer, MessageHeaderKey = Buffer, MessageHeaderValue = Buffer>(consumer: Consumer<MessageKey, MessageValue, MessageHeaderKey, MessageHeaderValue>, callback: CallbackWithPromise<void>): void;
|
|
21
|
+
addConsumer<MessageKey = Buffer, MessageValue = Buffer, MessageHeaderKey = Buffer, MessageHeaderValue = Buffer>(consumer: Consumer<MessageKey, MessageValue, MessageHeaderKey, MessageHeaderValue>): Promise<void>;
|
|
22
|
+
addOffset<MessageKey = Buffer, MessageValue = Buffer, MessageHeaderKey = Buffer, MessageHeaderValue = Buffer>(message: Message<MessageKey, MessageValue, MessageHeaderKey, MessageHeaderValue>, callback: CallbackWithPromise<void>): void;
|
|
23
|
+
addOffset<MessageKey = Buffer, MessageValue = Buffer, MessageHeaderKey = Buffer, MessageHeaderValue = Buffer>(message: Message<MessageKey, MessageValue, MessageHeaderKey, MessageHeaderValue>): Promise<void>;
|
|
24
|
+
commit(callback: CallbackWithPromise<void>): void;
|
|
25
|
+
commit(): Promise<void>;
|
|
26
|
+
abort(callback: CallbackWithPromise<void>): void;
|
|
27
|
+
abort(): Promise<void>;
|
|
28
|
+
cancel(callback: CallbackWithPromise<void>): void;
|
|
29
|
+
cancel(): Promise<void>;
|
|
30
|
+
}
|
|
@@ -5,6 +5,7 @@ import { type Serializers } from "../serde";
|
|
|
5
5
|
export interface ProducerInfo {
|
|
6
6
|
producerId: bigint;
|
|
7
7
|
producerEpoch: number;
|
|
8
|
+
transactionalId?: string;
|
|
8
9
|
}
|
|
9
10
|
export interface ProduceResult {
|
|
10
11
|
offsets?: TopicWithPartitionAndOffset[];
|
|
@@ -22,6 +23,7 @@ export interface ProduceOptions<Key, Value, HeaderKey, HeaderValue> {
|
|
|
22
23
|
repeatOnStaleMetadata?: boolean;
|
|
23
24
|
}
|
|
24
25
|
export type ProducerOptions<Key, Value, HeaderKey, HeaderValue> = BaseOptions & ProduceOptions<Key, Value, HeaderKey, HeaderValue> & {
|
|
26
|
+
transactionalId?: string;
|
|
25
27
|
serializers?: Partial<Serializers<Key, Value, HeaderKey, HeaderValue>>;
|
|
26
28
|
};
|
|
27
29
|
export type SendOptions<Key, Value, HeaderKey, HeaderValue> = {
|
|
@@ -42,8 +42,13 @@ export declare const adminTopicsChannel: TracingChannelWithName<ClientDiagnostic
|
|
|
42
42
|
export declare const adminGroupsChannel: TracingChannelWithName<ClientDiagnosticEvent<Base<import("./index").BaseOptions>, Record<string, unknown>>>;
|
|
43
43
|
export declare const adminClientQuotasChannel: TracingChannelWithName<ClientDiagnosticEvent<Base<import("./index").BaseOptions>, Record<string, unknown>>>;
|
|
44
44
|
export declare const adminLogDirsChannel: TracingChannelWithName<ClientDiagnosticEvent<Base<import("./index").BaseOptions>, Record<string, unknown>>>;
|
|
45
|
+
export declare const adminConsumerGroupOffsetsChannel: TracingChannelWithName<ClientDiagnosticEvent<Base<import("./index").BaseOptions>, Record<string, unknown>>>;
|
|
46
|
+
export declare const adminConfigsChannel: TracingChannelWithName<ClientDiagnosticEvent<Base<import("./index").BaseOptions>, Record<string, unknown>>>;
|
|
47
|
+
export declare const adminAclsChannel: TracingChannelWithName<ClientDiagnosticEvent<Base<import("./index").BaseOptions>, Record<string, unknown>>>;
|
|
48
|
+
export declare const adminOffsetsChannel: TracingChannelWithName<ClientDiagnosticEvent<Base<import("./index").BaseOptions>, Record<string, unknown>>>;
|
|
45
49
|
export declare const producerInitIdempotentChannel: TracingChannelWithName<ClientDiagnosticEvent<Base<import("./index").BaseOptions>, Record<string, unknown>>>;
|
|
46
50
|
export declare const producerSendsChannel: TracingChannelWithName<ClientDiagnosticEvent<Base<import("./index").BaseOptions>, Record<string, unknown>>>;
|
|
51
|
+
export declare const producerTransactionsChannel: TracingChannelWithName<ClientDiagnosticEvent<Base<import("./index").BaseOptions>, Record<string, unknown>>>;
|
|
47
52
|
export declare const consumerGroupChannel: TracingChannelWithName<ClientDiagnosticEvent<Base<import("./index").BaseOptions>, Record<string, unknown>>>;
|
|
48
53
|
export declare const consumerHeartbeatChannel: TracingChannelWithName<ClientDiagnosticEvent<Base<import("./index").BaseOptions>, Record<string, unknown>>>;
|
|
49
54
|
export declare const consumerReceivesChannel: TracingChannelWithName<ClientDiagnosticEvent<Base<import("./index").BaseOptions>, Record<string, unknown>>>;
|
|
@@ -3,6 +3,11 @@ import { type CompressionAlgorithmValue } from "./compression";
|
|
|
3
3
|
import { type NullableString } from "./definitions";
|
|
4
4
|
import { Reader } from "./reader";
|
|
5
5
|
import { Writer } from "./writer";
|
|
6
|
+
export declare const CURRENT_RECORD_VERSION = 2;
|
|
7
|
+
export declare const IS_COMPRESSED = 7;
|
|
8
|
+
export declare const IS_TRANSACTIONAL: number;
|
|
9
|
+
export declare const IS_CONTROL: number;
|
|
10
|
+
export declare const BATCH_HEAD: number;
|
|
6
11
|
export interface MessageBase<Key = Buffer, Value = Buffer> {
|
|
7
12
|
key?: Key;
|
|
8
13
|
value?: Value;
|
|
@@ -13,9 +18,16 @@ export interface MessageBase<Key = Buffer, Value = Buffer> {
|
|
|
13
18
|
export interface MessageToProduce<Key = Buffer, Value = Buffer, HeaderKey = Buffer, HeaderValue = Buffer> extends MessageBase<Key, Value> {
|
|
14
19
|
headers?: Map<HeaderKey, HeaderValue> | Record<string, HeaderValue>;
|
|
15
20
|
}
|
|
21
|
+
export interface MessageConsumerMetadata {
|
|
22
|
+
coordinatorId: number;
|
|
23
|
+
groupId: string;
|
|
24
|
+
generationId: number;
|
|
25
|
+
memberId: string;
|
|
26
|
+
}
|
|
16
27
|
export interface Message<Key = Buffer, Value = Buffer, HeaderKey = Buffer, HeaderValue = Buffer> extends Required<MessageBase<Key, Value>> {
|
|
17
28
|
headers: Map<HeaderKey, HeaderValue>;
|
|
18
29
|
offset: bigint;
|
|
30
|
+
metadata: Record<string, unknown>;
|
|
19
31
|
commit(callback?: (error?: Error) => void): void | Promise<void>;
|
|
20
32
|
}
|
|
21
33
|
export interface MessageRecord {
|
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
export declare const kInstance: unique symbol;
|
|
2
2
|
export declare const kRefreshOffsetsAndFetch: unique symbol;
|
|
3
|
-
export declare const kAutocommit: unique symbol;
|
|
3
|
+
export declare const kAutocommit: unique symbol;
|
|
4
|
+
export declare const kTransaction: unique symbol;
|
|
5
|
+
export declare const kTransactionPrepare: unique symbol;
|
|
6
|
+
export declare const kTransactionAddPartitions: unique symbol;
|
|
7
|
+
export declare const kTransactionAddOffsets: unique symbol;
|
|
8
|
+
export declare const kTransactionCommitOffset: unique symbol;
|
|
9
|
+
export declare const kTransactionEnd: unique symbol;
|
|
10
|
+
export declare const kTransactionCancel: unique symbol;
|
|
11
|
+
export declare const kTransactionFindCoordinator: unique symbol;
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@platformatic/kafka";
|
|
2
|
-
export const version = "1.
|
|
2
|
+
export const version = "1.24.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformatic/kafka",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.24.0",
|
|
4
4
|
"description": "Modern and performant client for Apache Kafka",
|
|
5
5
|
"homepage": "https://github.com/platformatic/kafka",
|
|
6
6
|
"author": "Platformatic Inc. <oss@platformatic.dev> (https://platformatic.dev)",
|