@platformatic/kafka 2.11.0 → 2.12.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/README.md +6 -0
- package/dist/apis/definitions.d.ts +1 -1
- package/dist/apis/producer/produce-v10.d.ts +1 -0
- package/dist/apis/producer/produce-v10.js +26 -1
- package/dist/apis/producer/produce-v11.d.ts +1 -0
- package/dist/apis/producer/produce-v11.js +26 -1
- package/dist/apis/producer/produce-v7.d.ts +1 -0
- package/dist/apis/producer/produce-v7.js +23 -1
- package/dist/apis/producer/produce-v8.d.ts +1 -0
- package/dist/apis/producer/produce-v8.js +23 -1
- package/dist/apis/producer/produce-v9.d.ts +1 -0
- package/dist/apis/producer/produce-v9.js +26 -1
- package/dist/apis/producer/utils.d.ts +11 -0
- package/dist/apis/producer/utils.js +31 -0
- package/dist/clients/admin/admin.js +10 -13
- package/dist/clients/base/base.d.ts +1 -1
- package/dist/clients/base/base.js +6 -6
- package/dist/clients/base/options.d.ts +4 -0
- package/dist/clients/base/options.js +2 -1
- package/dist/clients/base/types.d.ts +1 -0
- package/dist/clients/consumer/consumer-protocol.d.ts +32 -0
- package/dist/clients/consumer/consumer-protocol.js +114 -0
- package/dist/clients/consumer/consumer.d.ts +3 -2
- package/dist/clients/consumer/consumer.js +305 -93
- package/dist/clients/consumer/index.d.ts +2 -0
- package/dist/clients/consumer/index.js +2 -0
- package/dist/clients/consumer/messages-stream.d.ts +4 -2
- package/dist/clients/consumer/messages-stream.js +126 -16
- package/dist/clients/consumer/partitions-assigners.d.ts +3 -0
- package/dist/clients/consumer/partitions-assigners.js +259 -0
- package/dist/clients/consumer/types.d.ts +11 -0
- package/dist/clients/producer/producer.d.ts +1 -1
- package/dist/clients/producer/producer.js +1 -1
- package/dist/errors.js +12 -1
- package/dist/network/connection.d.ts +1 -1
- package/dist/network/connection.js +83 -40
- package/dist/protocol/compression.d.ts +6 -0
- package/dist/protocol/compression.js +14 -1
- package/dist/protocol/records.d.ts +1 -0
- package/dist/protocol/records.js +40 -17
- package/dist/registries/confluent-schema-registry.d.ts +2 -1
- package/dist/registries/confluent-schema-registry.js +2 -1
- package/dist/symbols.d.ts +1 -0
- package/dist/symbols.js +1 -0
- package/dist/typescript-4/dist/apis/definitions.d.ts +1 -1
- package/dist/typescript-4/dist/apis/producer/produce-v10.d.ts +1 -0
- package/dist/typescript-4/dist/apis/producer/produce-v11.d.ts +1 -0
- package/dist/typescript-4/dist/apis/producer/produce-v7.d.ts +1 -0
- package/dist/typescript-4/dist/apis/producer/produce-v8.d.ts +1 -0
- package/dist/typescript-4/dist/apis/producer/produce-v9.d.ts +1 -0
- package/dist/typescript-4/dist/apis/producer/utils.d.ts +11 -0
- package/dist/typescript-4/dist/clients/base/base.d.ts +1 -1
- package/dist/typescript-4/dist/clients/base/options.d.ts +4 -0
- package/dist/typescript-4/dist/clients/base/types.d.ts +1 -0
- package/dist/typescript-4/dist/clients/consumer/consumer-protocol.d.ts +32 -0
- package/dist/typescript-4/dist/clients/consumer/consumer.d.ts +3 -2
- package/dist/typescript-4/dist/clients/consumer/index.d.ts +2 -0
- package/dist/typescript-4/dist/clients/consumer/messages-stream.d.ts +4 -2
- package/dist/typescript-4/dist/clients/consumer/partitions-assigners.d.ts +4 -1
- package/dist/typescript-4/dist/clients/consumer/types.d.ts +11 -0
- package/dist/typescript-4/dist/clients/producer/producer.d.ts +1 -1
- package/dist/typescript-4/dist/network/connection.d.ts +1 -1
- package/dist/typescript-4/dist/protocol/compression.d.ts +7 -1
- package/dist/typescript-4/dist/protocol/records.d.ts +1 -0
- package/dist/typescript-4/dist/registries/confluent-schema-registry.d.ts +2 -1
- package/dist/typescript-4/dist/symbols.d.ts +1 -0
- package/dist/version.js +1 -1
- package/package.json +5 -2
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { DynamicBuffer } from '@platformatic/dynamic-buffer';
|
|
2
2
|
export type SyncCompressionPhase = (data: Buffer | DynamicBuffer) => Buffer;
|
|
3
|
+
export type AsyncCompressionPhase = (data: Buffer | DynamicBuffer) => Promise<Buffer>;
|
|
3
4
|
export type CompressionOperation = (data: Buffer) => Buffer;
|
|
4
5
|
export interface CompressionAlgorithmSpecification {
|
|
6
|
+
compress?: AsyncCompressionPhase;
|
|
5
7
|
compressSync: SyncCompressionPhase;
|
|
6
8
|
decompressSync: SyncCompressionPhase;
|
|
7
9
|
bitmask: number;
|
|
@@ -17,6 +19,7 @@ export declare const CompressionAlgorithms: {
|
|
|
17
19
|
export declare const allowedCompressionsAlgorithms: CompressionAlgorithmValue[];
|
|
18
20
|
export type CompressionAlgorithm = keyof typeof CompressionAlgorithms;
|
|
19
21
|
export type CompressionAlgorithmValue = (typeof CompressionAlgorithms)[keyof typeof CompressionAlgorithms];
|
|
22
|
+
declare function gzipAsync(data: Buffer | DynamicBuffer): Promise<Buffer>;
|
|
20
23
|
export declare const compressionsAlgorithms: {
|
|
21
24
|
readonly none: {
|
|
22
25
|
readonly compressSync: (data: Buffer | DynamicBuffer) => Buffer;
|
|
@@ -25,6 +28,7 @@ export declare const compressionsAlgorithms: {
|
|
|
25
28
|
readonly available: true;
|
|
26
29
|
};
|
|
27
30
|
readonly gzip: {
|
|
31
|
+
readonly compress: typeof gzipAsync;
|
|
28
32
|
readonly compressSync: (data: Buffer | DynamicBuffer) => Buffer;
|
|
29
33
|
readonly decompressSync: (data: Buffer | DynamicBuffer) => Buffer;
|
|
30
34
|
readonly bitmask: 1;
|
|
@@ -56,6 +60,7 @@ export declare const compressionsAlgorithmsByBitmask: {
|
|
|
56
60
|
readonly bitmask: 0;
|
|
57
61
|
readonly available: true;
|
|
58
62
|
} | {
|
|
63
|
+
readonly compress: typeof gzipAsync;
|
|
59
64
|
readonly compressSync: (data: Buffer | DynamicBuffer) => Buffer;
|
|
60
65
|
readonly decompressSync: (data: Buffer | DynamicBuffer) => Buffer;
|
|
61
66
|
readonly bitmask: 1;
|
|
@@ -76,4 +81,5 @@ export declare const compressionsAlgorithmsByBitmask: {
|
|
|
76
81
|
readonly bitmask: 4;
|
|
77
82
|
readonly available: boolean;
|
|
78
83
|
};
|
|
79
|
-
};
|
|
84
|
+
};
|
|
85
|
+
export {};
|
|
@@ -123,5 +123,6 @@ export declare const messageSchema: {
|
|
|
123
123
|
export declare function createRecord(message: MessageRecord, offsetDelta: number, firstTimestamp: bigint): Writer;
|
|
124
124
|
export declare function readRecord(reader: Reader): KafkaRecord;
|
|
125
125
|
export declare function createRecordsBatch(messages: MessageRecord[], options?: Partial<CreateRecordsBatchOptions>): Writer;
|
|
126
|
+
export declare function createRecordsBatchAsync(messages: MessageRecord[], options?: Partial<CreateRecordsBatchOptions>): Promise<Writer>;
|
|
126
127
|
export declare function readRecordsBatch(reader: Reader): RecordsBatch;
|
|
127
128
|
export declare function readRecordsBatches(reader: Reader): RecordsBatch[];
|
|
@@ -4,7 +4,8 @@ import { type ConnectionOptions as TLSConnectionOptions } from 'node:tls';
|
|
|
4
4
|
import { type Root } from 'protobufjs';
|
|
5
5
|
import { type Callback } from "../apis/definitions";
|
|
6
6
|
import { type BeforeDeserializationHook, type BeforeHookPayloadType, type BeforeSerializationHook, type Deserializers, type Serializers } from "../clients/serde";
|
|
7
|
-
import {
|
|
7
|
+
import { UserError } from "../errors";
|
|
8
|
+
import { type CredentialProvider } from "../network/connection";
|
|
8
9
|
import { type MessageToConsume, type MessageToProduce } from "../protocol/records";
|
|
9
10
|
import { AbstractSchemaRegistry } from "./abstract";
|
|
10
11
|
type ConfluentSchemaRegistryMessageToProduce = MessageToProduce<unknown, unknown, unknown, unknown>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const kInstance: unique symbol;
|
|
2
2
|
export declare const kRefreshOffsetsAndFetch: unique symbol;
|
|
3
3
|
export declare const kAutocommit: unique symbol;
|
|
4
|
+
export declare const kUpdateCommittedOffset: unique symbol;
|
|
4
5
|
export declare const kGetFetchNode: unique symbol;
|
|
5
6
|
export declare const kDeserializationError: unique symbol;
|
|
6
7
|
export declare const kTransaction: unique symbol;
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@platformatic/kafka";
|
|
2
|
-
export const version = "2.
|
|
2
|
+
export const version = "2.12.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformatic/kafka",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.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)",
|
|
@@ -60,7 +60,8 @@
|
|
|
60
60
|
"cronometro": "^5.3.0",
|
|
61
61
|
"eslint": "^9.35.0",
|
|
62
62
|
"fast-jwt": "^6.0.2",
|
|
63
|
-
"hwp": "^0.
|
|
63
|
+
"hwp": "^0.5.0",
|
|
64
|
+
"import-in-the-middle": "^3.4.0",
|
|
64
65
|
"json5": "^2.2.3",
|
|
65
66
|
"kafkajs": "^2.2.4",
|
|
66
67
|
"kerberos": "^2.2.2",
|
|
@@ -100,6 +101,8 @@
|
|
|
100
101
|
"test:all": "npm test && npm run test:regression:all",
|
|
101
102
|
"test:compat": "./scripts/node --test --test-reporter=cleaner-spec-reporter 'test/integration/*.compat-test.ts'",
|
|
102
103
|
"test:memory": "NODE_OPTIONS='--expose-gc' ./scripts/node --test --test-reporter=cleaner-spec-reporter 'test/**/*.memory-test.ts'",
|
|
104
|
+
"test:e2e:redpanda": "./scripts/node --test --test-reporter=cleaner-spec-reporter 'test/e2e/redpanda.e2e-test.ts'",
|
|
105
|
+
"test:e2e:eventhubs": "./scripts/node --test --test-reporter=cleaner-spec-reporter 'test/e2e/eventhubs.e2e-test.ts'",
|
|
103
106
|
"test:docker:up": "docker-compose up -d --wait",
|
|
104
107
|
"test:docker:down": "docker-compose down",
|
|
105
108
|
"regression:baseline:compare": "npm run test:performance",
|