@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,521 @@
|
|
|
1
|
+
import { type ConsumerOptions } from './types.ts';
|
|
2
|
+
export declare const groupOptionsSchema: {
|
|
3
|
+
type: string;
|
|
4
|
+
properties: {
|
|
5
|
+
sessionTimeout: {
|
|
6
|
+
type: string;
|
|
7
|
+
minimum: number;
|
|
8
|
+
};
|
|
9
|
+
rebalanceTimeout: {
|
|
10
|
+
type: string;
|
|
11
|
+
minimum: number;
|
|
12
|
+
};
|
|
13
|
+
heartbeatInterval: {
|
|
14
|
+
type: string;
|
|
15
|
+
minimum: number;
|
|
16
|
+
};
|
|
17
|
+
protocols: {
|
|
18
|
+
type: string;
|
|
19
|
+
items: {
|
|
20
|
+
type: string;
|
|
21
|
+
properties: {
|
|
22
|
+
name: {
|
|
23
|
+
type: string;
|
|
24
|
+
pattern: string;
|
|
25
|
+
};
|
|
26
|
+
version: {
|
|
27
|
+
type: string;
|
|
28
|
+
minimum: number;
|
|
29
|
+
};
|
|
30
|
+
topics: {
|
|
31
|
+
type: string;
|
|
32
|
+
items: {
|
|
33
|
+
type: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
metadata: {
|
|
37
|
+
oneOf: ({
|
|
38
|
+
type: string;
|
|
39
|
+
buffer?: undefined;
|
|
40
|
+
} | {
|
|
41
|
+
buffer: boolean;
|
|
42
|
+
type?: undefined;
|
|
43
|
+
})[];
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
additionalProperties: boolean;
|
|
50
|
+
};
|
|
51
|
+
export declare const consumeOptionsSchema: {
|
|
52
|
+
type: string;
|
|
53
|
+
properties: {
|
|
54
|
+
autocommit: {
|
|
55
|
+
oneOf: ({
|
|
56
|
+
type: string;
|
|
57
|
+
minimum?: undefined;
|
|
58
|
+
} | {
|
|
59
|
+
type: string;
|
|
60
|
+
minimum: number;
|
|
61
|
+
})[];
|
|
62
|
+
};
|
|
63
|
+
minBytes: {
|
|
64
|
+
type: string;
|
|
65
|
+
minimum: number;
|
|
66
|
+
};
|
|
67
|
+
maxBytes: {
|
|
68
|
+
type: string;
|
|
69
|
+
minimum: number;
|
|
70
|
+
};
|
|
71
|
+
maxWaitTime: {
|
|
72
|
+
type: string;
|
|
73
|
+
minimum: number;
|
|
74
|
+
};
|
|
75
|
+
isolationLevel: {
|
|
76
|
+
type: string;
|
|
77
|
+
enum: string[];
|
|
78
|
+
};
|
|
79
|
+
deserializers: {
|
|
80
|
+
type: string;
|
|
81
|
+
properties: {
|
|
82
|
+
key: {
|
|
83
|
+
function: boolean;
|
|
84
|
+
};
|
|
85
|
+
value: {
|
|
86
|
+
function: boolean;
|
|
87
|
+
};
|
|
88
|
+
headerKey: {
|
|
89
|
+
function: boolean;
|
|
90
|
+
};
|
|
91
|
+
headerValue: {
|
|
92
|
+
function: boolean;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
additionalProperties: boolean;
|
|
96
|
+
};
|
|
97
|
+
highWaterMark: {
|
|
98
|
+
type: string;
|
|
99
|
+
minimum: number;
|
|
100
|
+
};
|
|
101
|
+
sessionTimeout: {
|
|
102
|
+
type: string;
|
|
103
|
+
minimum: number;
|
|
104
|
+
};
|
|
105
|
+
rebalanceTimeout: {
|
|
106
|
+
type: string;
|
|
107
|
+
minimum: number;
|
|
108
|
+
};
|
|
109
|
+
heartbeatInterval: {
|
|
110
|
+
type: string;
|
|
111
|
+
minimum: number;
|
|
112
|
+
};
|
|
113
|
+
protocols: {
|
|
114
|
+
type: string;
|
|
115
|
+
items: {
|
|
116
|
+
type: string;
|
|
117
|
+
properties: {
|
|
118
|
+
name: {
|
|
119
|
+
type: string;
|
|
120
|
+
pattern: string;
|
|
121
|
+
};
|
|
122
|
+
version: {
|
|
123
|
+
type: string;
|
|
124
|
+
minimum: number;
|
|
125
|
+
};
|
|
126
|
+
topics: {
|
|
127
|
+
type: string;
|
|
128
|
+
items: {
|
|
129
|
+
type: string;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
metadata: {
|
|
133
|
+
oneOf: ({
|
|
134
|
+
type: string;
|
|
135
|
+
buffer?: undefined;
|
|
136
|
+
} | {
|
|
137
|
+
buffer: boolean;
|
|
138
|
+
type?: undefined;
|
|
139
|
+
})[];
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
topics: {
|
|
145
|
+
type: string;
|
|
146
|
+
items: {
|
|
147
|
+
type: string;
|
|
148
|
+
pattern: string;
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
mode: {
|
|
152
|
+
type: string;
|
|
153
|
+
enum: ("latest" | "earliest" | "committed" | "manual")[];
|
|
154
|
+
};
|
|
155
|
+
fallbackMode: {
|
|
156
|
+
type: string;
|
|
157
|
+
enum: ("latest" | "earliest" | "fail")[];
|
|
158
|
+
};
|
|
159
|
+
offsets: {
|
|
160
|
+
type: string;
|
|
161
|
+
items: {
|
|
162
|
+
type: string;
|
|
163
|
+
properties: {
|
|
164
|
+
topic: {
|
|
165
|
+
type: string;
|
|
166
|
+
pattern: string;
|
|
167
|
+
};
|
|
168
|
+
partition: {
|
|
169
|
+
type: string;
|
|
170
|
+
minimum: number;
|
|
171
|
+
};
|
|
172
|
+
offset: {
|
|
173
|
+
bigint: boolean;
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
required: string[];
|
|
177
|
+
additionalProperties: boolean;
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
required: string[];
|
|
182
|
+
additionalProperties: boolean;
|
|
183
|
+
};
|
|
184
|
+
export declare const consumerOptionsSchema: {
|
|
185
|
+
type: string;
|
|
186
|
+
properties: {
|
|
187
|
+
autocommit: {
|
|
188
|
+
oneOf: ({
|
|
189
|
+
type: string;
|
|
190
|
+
minimum?: undefined;
|
|
191
|
+
} | {
|
|
192
|
+
type: string;
|
|
193
|
+
minimum: number;
|
|
194
|
+
})[];
|
|
195
|
+
};
|
|
196
|
+
minBytes: {
|
|
197
|
+
type: string;
|
|
198
|
+
minimum: number;
|
|
199
|
+
};
|
|
200
|
+
maxBytes: {
|
|
201
|
+
type: string;
|
|
202
|
+
minimum: number;
|
|
203
|
+
};
|
|
204
|
+
maxWaitTime: {
|
|
205
|
+
type: string;
|
|
206
|
+
minimum: number;
|
|
207
|
+
};
|
|
208
|
+
isolationLevel: {
|
|
209
|
+
type: string;
|
|
210
|
+
enum: string[];
|
|
211
|
+
};
|
|
212
|
+
deserializers: {
|
|
213
|
+
type: string;
|
|
214
|
+
properties: {
|
|
215
|
+
key: {
|
|
216
|
+
function: boolean;
|
|
217
|
+
};
|
|
218
|
+
value: {
|
|
219
|
+
function: boolean;
|
|
220
|
+
};
|
|
221
|
+
headerKey: {
|
|
222
|
+
function: boolean;
|
|
223
|
+
};
|
|
224
|
+
headerValue: {
|
|
225
|
+
function: boolean;
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
additionalProperties: boolean;
|
|
229
|
+
};
|
|
230
|
+
highWaterMark: {
|
|
231
|
+
type: string;
|
|
232
|
+
minimum: number;
|
|
233
|
+
};
|
|
234
|
+
sessionTimeout: {
|
|
235
|
+
type: string;
|
|
236
|
+
minimum: number;
|
|
237
|
+
};
|
|
238
|
+
rebalanceTimeout: {
|
|
239
|
+
type: string;
|
|
240
|
+
minimum: number;
|
|
241
|
+
};
|
|
242
|
+
heartbeatInterval: {
|
|
243
|
+
type: string;
|
|
244
|
+
minimum: number;
|
|
245
|
+
};
|
|
246
|
+
protocols: {
|
|
247
|
+
type: string;
|
|
248
|
+
items: {
|
|
249
|
+
type: string;
|
|
250
|
+
properties: {
|
|
251
|
+
name: {
|
|
252
|
+
type: string;
|
|
253
|
+
pattern: string;
|
|
254
|
+
};
|
|
255
|
+
version: {
|
|
256
|
+
type: string;
|
|
257
|
+
minimum: number;
|
|
258
|
+
};
|
|
259
|
+
topics: {
|
|
260
|
+
type: string;
|
|
261
|
+
items: {
|
|
262
|
+
type: string;
|
|
263
|
+
};
|
|
264
|
+
};
|
|
265
|
+
metadata: {
|
|
266
|
+
oneOf: ({
|
|
267
|
+
type: string;
|
|
268
|
+
buffer?: undefined;
|
|
269
|
+
} | {
|
|
270
|
+
buffer: boolean;
|
|
271
|
+
type?: undefined;
|
|
272
|
+
})[];
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
};
|
|
276
|
+
};
|
|
277
|
+
groupId: {
|
|
278
|
+
type: string;
|
|
279
|
+
pattern: string;
|
|
280
|
+
};
|
|
281
|
+
};
|
|
282
|
+
required: string[];
|
|
283
|
+
additionalProperties: boolean;
|
|
284
|
+
};
|
|
285
|
+
export declare const fetchOptionsSchema: {
|
|
286
|
+
type: string;
|
|
287
|
+
properties: {
|
|
288
|
+
autocommit: {
|
|
289
|
+
oneOf: ({
|
|
290
|
+
type: string;
|
|
291
|
+
minimum?: undefined;
|
|
292
|
+
} | {
|
|
293
|
+
type: string;
|
|
294
|
+
minimum: number;
|
|
295
|
+
})[];
|
|
296
|
+
};
|
|
297
|
+
minBytes: {
|
|
298
|
+
type: string;
|
|
299
|
+
minimum: number;
|
|
300
|
+
};
|
|
301
|
+
maxBytes: {
|
|
302
|
+
type: string;
|
|
303
|
+
minimum: number;
|
|
304
|
+
};
|
|
305
|
+
maxWaitTime: {
|
|
306
|
+
type: string;
|
|
307
|
+
minimum: number;
|
|
308
|
+
};
|
|
309
|
+
isolationLevel: {
|
|
310
|
+
type: string;
|
|
311
|
+
enum: string[];
|
|
312
|
+
};
|
|
313
|
+
deserializers: {
|
|
314
|
+
type: string;
|
|
315
|
+
properties: {
|
|
316
|
+
key: {
|
|
317
|
+
function: boolean;
|
|
318
|
+
};
|
|
319
|
+
value: {
|
|
320
|
+
function: boolean;
|
|
321
|
+
};
|
|
322
|
+
headerKey: {
|
|
323
|
+
function: boolean;
|
|
324
|
+
};
|
|
325
|
+
headerValue: {
|
|
326
|
+
function: boolean;
|
|
327
|
+
};
|
|
328
|
+
};
|
|
329
|
+
additionalProperties: boolean;
|
|
330
|
+
};
|
|
331
|
+
highWaterMark: {
|
|
332
|
+
type: string;
|
|
333
|
+
minimum: number;
|
|
334
|
+
};
|
|
335
|
+
sessionTimeout: {
|
|
336
|
+
type: string;
|
|
337
|
+
minimum: number;
|
|
338
|
+
};
|
|
339
|
+
rebalanceTimeout: {
|
|
340
|
+
type: string;
|
|
341
|
+
minimum: number;
|
|
342
|
+
};
|
|
343
|
+
heartbeatInterval: {
|
|
344
|
+
type: string;
|
|
345
|
+
minimum: number;
|
|
346
|
+
};
|
|
347
|
+
protocols: {
|
|
348
|
+
type: string;
|
|
349
|
+
items: {
|
|
350
|
+
type: string;
|
|
351
|
+
properties: {
|
|
352
|
+
name: {
|
|
353
|
+
type: string;
|
|
354
|
+
pattern: string;
|
|
355
|
+
};
|
|
356
|
+
version: {
|
|
357
|
+
type: string;
|
|
358
|
+
minimum: number;
|
|
359
|
+
};
|
|
360
|
+
topics: {
|
|
361
|
+
type: string;
|
|
362
|
+
items: {
|
|
363
|
+
type: string;
|
|
364
|
+
};
|
|
365
|
+
};
|
|
366
|
+
metadata: {
|
|
367
|
+
oneOf: ({
|
|
368
|
+
type: string;
|
|
369
|
+
buffer?: undefined;
|
|
370
|
+
} | {
|
|
371
|
+
buffer: boolean;
|
|
372
|
+
type?: undefined;
|
|
373
|
+
})[];
|
|
374
|
+
};
|
|
375
|
+
};
|
|
376
|
+
};
|
|
377
|
+
};
|
|
378
|
+
node: {
|
|
379
|
+
type: string;
|
|
380
|
+
minimum: number;
|
|
381
|
+
};
|
|
382
|
+
topics: {
|
|
383
|
+
type: string;
|
|
384
|
+
items: {
|
|
385
|
+
type: string;
|
|
386
|
+
properties: {
|
|
387
|
+
topicId: {
|
|
388
|
+
type: string;
|
|
389
|
+
};
|
|
390
|
+
partitions: {
|
|
391
|
+
type: string;
|
|
392
|
+
items: {
|
|
393
|
+
type: string;
|
|
394
|
+
properties: {
|
|
395
|
+
partition: {
|
|
396
|
+
type: string;
|
|
397
|
+
};
|
|
398
|
+
currentLeaderEpoch: {
|
|
399
|
+
type: string;
|
|
400
|
+
};
|
|
401
|
+
fetchOffset: {
|
|
402
|
+
bigint: boolean;
|
|
403
|
+
};
|
|
404
|
+
lastFetchedEpoch: {
|
|
405
|
+
type: string;
|
|
406
|
+
};
|
|
407
|
+
partitionMaxBytes: {
|
|
408
|
+
type: string;
|
|
409
|
+
};
|
|
410
|
+
};
|
|
411
|
+
required: string[];
|
|
412
|
+
};
|
|
413
|
+
};
|
|
414
|
+
};
|
|
415
|
+
required: string[];
|
|
416
|
+
};
|
|
417
|
+
};
|
|
418
|
+
};
|
|
419
|
+
required: string[];
|
|
420
|
+
additionalProperties: boolean;
|
|
421
|
+
};
|
|
422
|
+
export declare const commitOptionsSchema: {
|
|
423
|
+
type: string;
|
|
424
|
+
properties: {
|
|
425
|
+
offsets: {
|
|
426
|
+
type: string;
|
|
427
|
+
items: {
|
|
428
|
+
type: string;
|
|
429
|
+
properties: {
|
|
430
|
+
leaderEpoch: {
|
|
431
|
+
type: string;
|
|
432
|
+
};
|
|
433
|
+
topic: {
|
|
434
|
+
type: string;
|
|
435
|
+
pattern: string;
|
|
436
|
+
};
|
|
437
|
+
partition: {
|
|
438
|
+
type: string;
|
|
439
|
+
minimum: number;
|
|
440
|
+
};
|
|
441
|
+
offset: {
|
|
442
|
+
bigint: boolean;
|
|
443
|
+
};
|
|
444
|
+
};
|
|
445
|
+
required: string[];
|
|
446
|
+
additionalProperties: boolean;
|
|
447
|
+
};
|
|
448
|
+
};
|
|
449
|
+
};
|
|
450
|
+
required: string[];
|
|
451
|
+
additionalProperties: boolean;
|
|
452
|
+
};
|
|
453
|
+
export declare const listCommitsOptionsSchema: {
|
|
454
|
+
type: string;
|
|
455
|
+
properties: {
|
|
456
|
+
topics: {
|
|
457
|
+
type: string;
|
|
458
|
+
items: {
|
|
459
|
+
type: string;
|
|
460
|
+
properties: {
|
|
461
|
+
topic: {
|
|
462
|
+
type: string;
|
|
463
|
+
pattern: string;
|
|
464
|
+
};
|
|
465
|
+
partitions: {
|
|
466
|
+
type: string;
|
|
467
|
+
items: {
|
|
468
|
+
type: string;
|
|
469
|
+
minimum: number;
|
|
470
|
+
};
|
|
471
|
+
};
|
|
472
|
+
};
|
|
473
|
+
required: string[];
|
|
474
|
+
additionalProperties: boolean;
|
|
475
|
+
};
|
|
476
|
+
};
|
|
477
|
+
};
|
|
478
|
+
required: string[];
|
|
479
|
+
additionalProperties: boolean;
|
|
480
|
+
};
|
|
481
|
+
export declare const listOffsetsOptionsSchema: {
|
|
482
|
+
type: string;
|
|
483
|
+
properties: {
|
|
484
|
+
topics: {
|
|
485
|
+
type: string;
|
|
486
|
+
items: {
|
|
487
|
+
type: string;
|
|
488
|
+
pattern: string;
|
|
489
|
+
};
|
|
490
|
+
};
|
|
491
|
+
isolationLevel: {
|
|
492
|
+
type: string;
|
|
493
|
+
enum: string[];
|
|
494
|
+
};
|
|
495
|
+
timestamp: {
|
|
496
|
+
bigint: boolean;
|
|
497
|
+
};
|
|
498
|
+
};
|
|
499
|
+
required: string[];
|
|
500
|
+
additionalProperties: boolean;
|
|
501
|
+
};
|
|
502
|
+
export declare const groupOptionsValidator: import("ajv").ValidateFunction<unknown>;
|
|
503
|
+
export declare const consumeOptionsValidator: import("ajv").ValidateFunction<{
|
|
504
|
+
[x: string]: {};
|
|
505
|
+
}>;
|
|
506
|
+
export declare const consumerOptionsValidator: import("ajv").ValidateFunction<{
|
|
507
|
+
[x: string]: {};
|
|
508
|
+
}>;
|
|
509
|
+
export declare const fetchOptionsValidator: import("ajv").ValidateFunction<{
|
|
510
|
+
[x: string]: {};
|
|
511
|
+
}>;
|
|
512
|
+
export declare const commitOptionsValidator: import("ajv").ValidateFunction<{
|
|
513
|
+
[x: string]: {};
|
|
514
|
+
}>;
|
|
515
|
+
export declare const listCommitsOptionsValidator: import("ajv").ValidateFunction<{
|
|
516
|
+
[x: string]: {};
|
|
517
|
+
}>;
|
|
518
|
+
export declare const listOffsetsOptionsValidator: import("ajv").ValidateFunction<{
|
|
519
|
+
[x: string]: {};
|
|
520
|
+
}>;
|
|
521
|
+
export declare const defaultConsumerOptions: Partial<ConsumerOptions<Buffer, Buffer, Buffer, Buffer>>;
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { FetchIsolationLevels } from "../../apis/enumerations.js";
|
|
2
|
+
import { ajv } from "../../utils.js";
|
|
3
|
+
import { idProperty, topicWithPartitionAndOffsetProperties } from "../base/options.js";
|
|
4
|
+
import { serdeProperties } from "../serde.js";
|
|
5
|
+
import { MessagesStreamFallbackModes, MessagesStreamModes } from "./types.js";
|
|
6
|
+
const groupOptionsProperties = {
|
|
7
|
+
sessionTimeout: { type: 'number', minimum: 0 },
|
|
8
|
+
rebalanceTimeout: { type: 'number', minimum: 0 },
|
|
9
|
+
heartbeatInterval: { type: 'number', minimum: 0 },
|
|
10
|
+
protocols: {
|
|
11
|
+
type: 'array',
|
|
12
|
+
items: {
|
|
13
|
+
type: 'object',
|
|
14
|
+
properties: {
|
|
15
|
+
name: idProperty,
|
|
16
|
+
version: { type: 'number', minimum: 0 },
|
|
17
|
+
topics: {
|
|
18
|
+
type: 'array',
|
|
19
|
+
items: { type: 'string' }
|
|
20
|
+
},
|
|
21
|
+
metadata: { oneOf: [{ type: 'string' }, { buffer: true }] }
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
const consumeOptionsProperties = {
|
|
27
|
+
autocommit: { oneOf: [{ type: 'boolean' }, { type: 'number', minimum: 100 }] },
|
|
28
|
+
minBytes: { type: 'number', minimum: 0 },
|
|
29
|
+
maxBytes: { type: 'number', minimum: 0 },
|
|
30
|
+
maxWaitTime: { type: 'number', minimum: 0 },
|
|
31
|
+
isolationLevel: { type: 'string', enum: Object.keys(FetchIsolationLevels) },
|
|
32
|
+
deserializers: serdeProperties,
|
|
33
|
+
highWaterMark: { type: 'number', minimum: 1 }
|
|
34
|
+
};
|
|
35
|
+
export const groupOptionsSchema = {
|
|
36
|
+
type: 'object',
|
|
37
|
+
properties: groupOptionsProperties,
|
|
38
|
+
additionalProperties: true // This is needed as we might forward options from consume
|
|
39
|
+
};
|
|
40
|
+
export const consumeOptionsSchema = {
|
|
41
|
+
type: 'object',
|
|
42
|
+
properties: {
|
|
43
|
+
topics: { type: 'array', items: idProperty },
|
|
44
|
+
mode: { type: 'string', enum: Object.values(MessagesStreamModes) },
|
|
45
|
+
fallbackMode: { type: 'string', enum: Object.values(MessagesStreamFallbackModes) },
|
|
46
|
+
offsets: {
|
|
47
|
+
type: 'array',
|
|
48
|
+
items: {
|
|
49
|
+
type: 'object',
|
|
50
|
+
properties: topicWithPartitionAndOffsetProperties,
|
|
51
|
+
required: ['topic', 'partition', 'offset'],
|
|
52
|
+
additionalProperties: false
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
...groupOptionsProperties,
|
|
56
|
+
...consumeOptionsProperties
|
|
57
|
+
},
|
|
58
|
+
required: ['topics'],
|
|
59
|
+
additionalProperties: false
|
|
60
|
+
};
|
|
61
|
+
export const consumerOptionsSchema = {
|
|
62
|
+
type: 'object',
|
|
63
|
+
properties: {
|
|
64
|
+
groupId: idProperty,
|
|
65
|
+
...groupOptionsProperties,
|
|
66
|
+
...consumeOptionsProperties
|
|
67
|
+
},
|
|
68
|
+
required: ['groupId'],
|
|
69
|
+
additionalProperties: true
|
|
70
|
+
};
|
|
71
|
+
export const fetchOptionsSchema = {
|
|
72
|
+
type: 'object',
|
|
73
|
+
properties: {
|
|
74
|
+
node: { type: 'number', minimum: 0 },
|
|
75
|
+
topics: {
|
|
76
|
+
type: 'array',
|
|
77
|
+
items: {
|
|
78
|
+
type: 'object',
|
|
79
|
+
properties: {
|
|
80
|
+
topicId: { type: 'string' },
|
|
81
|
+
partitions: {
|
|
82
|
+
type: 'array',
|
|
83
|
+
items: {
|
|
84
|
+
type: 'object',
|
|
85
|
+
properties: {
|
|
86
|
+
partition: { type: 'integer' },
|
|
87
|
+
currentLeaderEpoch: { type: 'integer' },
|
|
88
|
+
fetchOffset: { bigint: true },
|
|
89
|
+
lastFetchedEpoch: { type: 'integer' },
|
|
90
|
+
partitionMaxBytes: { type: 'integer' }
|
|
91
|
+
},
|
|
92
|
+
required: ['partition', 'currentLeaderEpoch', 'fetchOffset', 'lastFetchedEpoch', 'partitionMaxBytes']
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
required: ['topicId', 'partitions']
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
...groupOptionsProperties,
|
|
100
|
+
...consumeOptionsProperties
|
|
101
|
+
},
|
|
102
|
+
required: ['node', 'topics'],
|
|
103
|
+
additionalProperties: false
|
|
104
|
+
};
|
|
105
|
+
export const commitOptionsSchema = {
|
|
106
|
+
type: 'object',
|
|
107
|
+
properties: {
|
|
108
|
+
offsets: {
|
|
109
|
+
type: 'array',
|
|
110
|
+
items: {
|
|
111
|
+
type: 'object',
|
|
112
|
+
properties: {
|
|
113
|
+
...topicWithPartitionAndOffsetProperties,
|
|
114
|
+
leaderEpoch: { type: 'integer' }
|
|
115
|
+
},
|
|
116
|
+
required: ['topic', 'partition', 'offset', 'leaderEpoch'],
|
|
117
|
+
additionalProperties: false
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
required: ['offsets'],
|
|
122
|
+
additionalProperties: false
|
|
123
|
+
};
|
|
124
|
+
export const listCommitsOptionsSchema = {
|
|
125
|
+
type: 'object',
|
|
126
|
+
properties: {
|
|
127
|
+
topics: {
|
|
128
|
+
type: 'array',
|
|
129
|
+
items: {
|
|
130
|
+
type: 'object',
|
|
131
|
+
properties: {
|
|
132
|
+
topic: idProperty,
|
|
133
|
+
partitions: {
|
|
134
|
+
type: 'array',
|
|
135
|
+
items: {
|
|
136
|
+
type: 'number',
|
|
137
|
+
minimum: 0
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
required: ['topic', 'partitions'],
|
|
142
|
+
additionalProperties: false
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
required: ['topics'],
|
|
147
|
+
additionalProperties: false
|
|
148
|
+
};
|
|
149
|
+
export const listOffsetsOptionsSchema = {
|
|
150
|
+
type: 'object',
|
|
151
|
+
properties: {
|
|
152
|
+
topics: { type: 'array', items: idProperty },
|
|
153
|
+
isolationLevel: { type: 'string', enum: Object.keys(FetchIsolationLevels) },
|
|
154
|
+
timestamp: { bigint: true }
|
|
155
|
+
},
|
|
156
|
+
required: ['topics'],
|
|
157
|
+
additionalProperties: false
|
|
158
|
+
};
|
|
159
|
+
export const groupOptionsValidator = ajv.compile(groupOptionsSchema);
|
|
160
|
+
export const consumeOptionsValidator = ajv.compile(consumeOptionsSchema);
|
|
161
|
+
export const consumerOptionsValidator = ajv.compile(consumerOptionsSchema);
|
|
162
|
+
export const fetchOptionsValidator = ajv.compile(fetchOptionsSchema);
|
|
163
|
+
export const commitOptionsValidator = ajv.compile(commitOptionsSchema);
|
|
164
|
+
export const listCommitsOptionsValidator = ajv.compile(listCommitsOptionsSchema);
|
|
165
|
+
export const listOffsetsOptionsValidator = ajv.compile(listOffsetsOptionsSchema);
|
|
166
|
+
export const defaultConsumerOptions = {
|
|
167
|
+
autocommit: true,
|
|
168
|
+
sessionTimeout: 60_000, // One minute
|
|
169
|
+
rebalanceTimeout: 102_000, // Two minutes,
|
|
170
|
+
heartbeatInterval: 3000,
|
|
171
|
+
protocols: [{ name: 'roundrobin', version: 1 }],
|
|
172
|
+
minBytes: 1,
|
|
173
|
+
maxBytes: 1_048_576 * 10, // 10 MB
|
|
174
|
+
maxWaitTime: 5_000,
|
|
175
|
+
isolationLevel: 'READ_COMMITTED',
|
|
176
|
+
highWaterMark: 1024
|
|
177
|
+
};
|