@drarzter/kafka-client 0.5.5 → 0.5.6
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/{chunk-Z3O5GTS7.mjs → chunk-6B72MJPU.mjs} +565 -495
- package/dist/chunk-6B72MJPU.mjs.map +1 -0
- package/dist/core.d.mts +9 -34
- package/dist/core.d.ts +9 -34
- package/dist/core.js +564 -494
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +1 -1
- package/dist/{envelope-BpyKN_WL.d.mts → envelope-LeO5e3ob.d.mts} +4 -1
- package/dist/{envelope-BpyKN_WL.d.ts → envelope-LeO5e3ob.d.ts} +4 -1
- package/dist/index.d.mts +17 -13
- package/dist/index.d.ts +17 -13
- package/dist/index.js +603 -543
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +40 -50
- package/dist/index.mjs.map +1 -1
- package/dist/otel.d.mts +1 -1
- package/dist/otel.d.ts +1 -1
- package/dist/otel.js.map +1 -1
- package/dist/otel.mjs.map +1 -1
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +6 -6
- package/dist/testing.js.map +1 -1
- package/dist/testing.mjs +6 -6
- package/dist/testing.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-Z3O5GTS7.mjs.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
import { KafkaClient } from './core.js';
|
|
2
2
|
export { KafkaProcessingError, KafkaRetryExhaustedError, KafkaValidationError } from './core.js';
|
|
3
|
-
import { T as TopicMapConstraint, C as ClientId, G as GroupId, K as KafkaInstrumentation, S as SchemaLike,
|
|
4
|
-
export { B as BatchMessageItem,
|
|
3
|
+
import { T as TopicMapConstraint, C as ClientId, G as GroupId, K as KafkaInstrumentation, a as KafkaClientOptions, S as SchemaLike, b as ConsumerOptions, c as TopicDescriptor } from './envelope-LeO5e3ob.js';
|
|
4
|
+
export { B as BatchMessageItem, d as BatchMeta, e as ConsumerHandle, f as ConsumerInterceptor, E as EnvelopeHeaderOptions, g as EventEnvelope, H as HEADER_CORRELATION_ID, h as HEADER_EVENT_ID, i as HEADER_SCHEMA_VERSION, j as HEADER_TIMESTAMP, k as HEADER_TRACEPARENT, I as IKafkaClient, l as InferSchema, m as KafkaLogger, M as MessageHeaders, n as MessageLostContext, R as RetryOptions, o as SendOptions, p as SubscribeRetryOptions, q as TTopicMessageMap, r as TopicsFrom, s as TransactionContext, t as buildEnvelopeHeaders, u as decodeHeaders, v as extractEnvelope, w as getEnvelopeContext, x as runWithEnvelopeContext, y as topic } from './envelope-LeO5e3ob.js';
|
|
5
5
|
import { DynamicModule, OnModuleInit } from '@nestjs/common';
|
|
6
6
|
import { DiscoveryService, ModuleRef } from '@nestjs/core';
|
|
7
7
|
|
|
8
|
-
/**
|
|
9
|
-
interface
|
|
8
|
+
/** Shared configuration fields for both `register()` and `registerAsync()`. */
|
|
9
|
+
interface KafkaModuleBaseOptions {
|
|
10
10
|
/** Optional name for multi-client setups. Must match `@InjectKafkaClient(name)`. */
|
|
11
11
|
name?: string;
|
|
12
|
+
/** If true, makes KAFKA_CLIENT available globally without importing KafkaModule in every feature module. */
|
|
13
|
+
isGlobal?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/** Synchronous configuration for `KafkaModule.register()`. */
|
|
16
|
+
interface KafkaModuleOptions extends KafkaModuleBaseOptions {
|
|
12
17
|
/** Unique Kafka client identifier. */
|
|
13
18
|
clientId: ClientId;
|
|
14
19
|
/** Consumer group identifier. */
|
|
15
20
|
groupId: GroupId;
|
|
16
21
|
/** List of Kafka broker addresses. */
|
|
17
22
|
brokers: string[];
|
|
18
|
-
/** If true, makes KAFKA_CLIENT available globally without importing KafkaModule in every feature module. */
|
|
19
|
-
isGlobal?: boolean;
|
|
20
23
|
/** Auto-create topics via admin on first use (send/consume). Useful for development. */
|
|
21
24
|
autoCreateTopics?: boolean;
|
|
22
25
|
/** When `true`, string topic keys are validated against any schema previously registered via a TopicDescriptor. Default: `true`. */
|
|
@@ -25,14 +28,13 @@ interface KafkaModuleOptions {
|
|
|
25
28
|
numPartitions?: number;
|
|
26
29
|
/** Client-wide instrumentation hooks (e.g. OTel). Applied to both send and consume paths. */
|
|
27
30
|
instrumentation?: KafkaInstrumentation[];
|
|
31
|
+
/** Called when a message is dropped without being sent to a DLQ. @see `KafkaClientOptions.onMessageLost` */
|
|
32
|
+
onMessageLost?: KafkaClientOptions["onMessageLost"];
|
|
33
|
+
/** Called whenever a consumer group rebalance occurs. @see `KafkaClientOptions.onRebalance` */
|
|
34
|
+
onRebalance?: KafkaClientOptions["onRebalance"];
|
|
28
35
|
}
|
|
29
36
|
/** Async configuration for `KafkaModule.registerAsync()` with dependency injection. */
|
|
30
|
-
interface KafkaModuleAsyncOptions {
|
|
31
|
-
name?: string;
|
|
32
|
-
/** If true, makes KAFKA_CLIENT available globally without importing KafkaModule in every feature module. */
|
|
33
|
-
isGlobal?: boolean;
|
|
34
|
-
/** Auto-create topics via admin on first use (send/consume). Useful for development. */
|
|
35
|
-
autoCreateTopics?: boolean;
|
|
37
|
+
interface KafkaModuleAsyncOptions extends KafkaModuleBaseOptions {
|
|
36
38
|
imports?: any[];
|
|
37
39
|
useFactory: (...args: any[]) => KafkaModuleOptions | Promise<KafkaModuleOptions>;
|
|
38
40
|
inject?: any[];
|
|
@@ -46,6 +48,8 @@ declare class KafkaModule {
|
|
|
46
48
|
static register<T extends TopicMapConstraint<T>>(options: KafkaModuleOptions): DynamicModule;
|
|
47
49
|
/** Register a Kafka client with async/factory-based options. */
|
|
48
50
|
static registerAsync<T extends TopicMapConstraint<T>>(asyncOptions: KafkaModuleAsyncOptions): DynamicModule;
|
|
51
|
+
private static buildClient;
|
|
52
|
+
private static buildDestroyProvider;
|
|
49
53
|
}
|
|
50
54
|
|
|
51
55
|
/** Default DI token for the Kafka client. */
|
|
@@ -97,4 +101,4 @@ declare class KafkaHealthIndicator {
|
|
|
97
101
|
check<T extends TopicMapConstraint<T>>(client: KafkaClient<T>): Promise<KafkaHealthResult>;
|
|
98
102
|
}
|
|
99
103
|
|
|
100
|
-
export { ClientId, ConsumerOptions, GroupId, InjectKafkaClient, KAFKA_CLIENT, KAFKA_SUBSCRIBER_METADATA, KafkaClient, KafkaExplorer, KafkaHealthIndicator, type KafkaHealthResult, KafkaInstrumentation, KafkaModule, type KafkaModuleAsyncOptions, type KafkaModuleOptions, type KafkaSubscriberMetadata, SchemaLike, SubscribeTo, TopicDescriptor, TopicMapConstraint, getKafkaClientToken };
|
|
104
|
+
export { ClientId, ConsumerOptions, GroupId, InjectKafkaClient, KAFKA_CLIENT, KAFKA_SUBSCRIBER_METADATA, KafkaClient, KafkaClientOptions, KafkaExplorer, KafkaHealthIndicator, type KafkaHealthResult, KafkaInstrumentation, KafkaModule, type KafkaModuleAsyncOptions, type KafkaModuleOptions, type KafkaSubscriberMetadata, SchemaLike, SubscribeTo, TopicDescriptor, TopicMapConstraint, getKafkaClientToken };
|