@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
|
@@ -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,4 +1,4 @@
|
|
|
1
|
-
import { allowedFetchIsolationLevels, allowedGroupProtocols } from "../../apis/enumerations.js";
|
|
1
|
+
import { allowedFetchIsolationLevels, allowedGroupProtocols, FetchIsolationLevels } from "../../apis/enumerations.js";
|
|
2
2
|
import { ajv } from "../../utils.js";
|
|
3
3
|
import { idProperty, topicWithPartitionAndOffsetProperties } from "../base/options.js";
|
|
4
4
|
import { serdeProperties } from "../serde.js";
|
|
@@ -58,7 +58,7 @@ export const consumeOptionsProperties = {
|
|
|
58
58
|
minBytes: { type: 'number', minimum: 0 },
|
|
59
59
|
maxBytes: { type: 'number', minimum: 0 },
|
|
60
60
|
maxWaitTime: { type: 'number', minimum: 0 },
|
|
61
|
-
isolationLevel: { type: '
|
|
61
|
+
isolationLevel: { type: 'number', enum: allowedFetchIsolationLevels },
|
|
62
62
|
deserializers: serdeProperties,
|
|
63
63
|
highWaterMark: { type: 'number', minimum: 1 }
|
|
64
64
|
};
|
|
@@ -240,6 +240,6 @@ export const defaultConsumerOptions = {
|
|
|
240
240
|
minBytes: 1,
|
|
241
241
|
maxBytes: 1_048_576 * 10, // 10 MB
|
|
242
242
|
maxWaitTime: 5_000,
|
|
243
|
-
isolationLevel:
|
|
243
|
+
isolationLevel: FetchIsolationLevels.READ_COMMITTED,
|
|
244
244
|
highWaterMark: 1024
|
|
245
245
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type FetchRequestTopic } from '../../apis/consumer/fetch-v17.ts';
|
|
2
|
-
import { type
|
|
2
|
+
import { type GroupProtocols } from '../../apis/enumerations.ts';
|
|
3
3
|
import { type KafkaRecord, type Message } from '../../protocol/records.ts';
|
|
4
4
|
import { type BaseOptions, type ClusterMetadata, type TopicWithPartitionAndOffset } from '../base/types.ts';
|
|
5
5
|
import { type Deserializers } from '../serde.ts';
|
|
@@ -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
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
|
+
}
|
package/dist/clients/index.d.ts
CHANGED
package/dist/clients/index.js
CHANGED
|
@@ -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.ts';
|
|
2
|
+
import { type Message } from '../../protocol/records.ts';
|
|
3
|
+
import { kTransaction, kTransactionAddOffsets, kTransactionAddPartitions, kTransactionCancel, kTransactionCommitOffset, kTransactionEnd, kTransactionFindCoordinator } from '../../symbols.ts';
|
|
2
4
|
import { Base } from '../base/base.ts';
|
|
5
|
+
import { Transaction } from './transaction.ts';
|
|
3
6
|
import { type ProduceOptions, type ProduceResult, type ProducerInfo, type ProducerOptions, type SendOptions } from './types.ts';
|
|
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
|
}
|