@drarzter/kafka-client 0.9.2 → 0.9.3
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 +32 -7
- package/dist/{chunk-Z2DOJQRI.mjs → chunk-TPIP5VV7.mjs} +4 -4
- package/dist/chunk-TPIP5VV7.mjs.map +1 -0
- package/dist/client-CBBUDDtu.d.ts +751 -0
- package/dist/client-D-SxYV2b.d.mts +751 -0
- package/dist/consumer.types-fFCag3VJ.d.mts +958 -0
- package/dist/consumer.types-fFCag3VJ.d.ts +958 -0
- package/dist/core.d.mts +126 -3
- package/dist/core.d.ts +126 -3
- package/dist/core.js +3 -3
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +1 -1
- package/dist/index.d.mts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/otel.d.mts +1 -1
- package/dist/otel.d.ts +1 -1
- package/dist/testing.d.mts +2 -1
- package/dist/testing.d.ts +2 -1
- package/dist/testing.js +3 -3
- package/dist/testing.js.map +1 -1
- package/dist/testing.mjs +3 -3
- package/dist/testing.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-Z2DOJQRI.mjs.map +0 -1
- package/dist/types-4XNxkici.d.mts +0 -1952
- package/dist/types-4XNxkici.d.ts +0 -1952
package/README.md
CHANGED
|
@@ -2129,6 +2129,31 @@ The integration suite spins up a single-node KRaft Kafka container and tests sen
|
|
|
2129
2129
|
|
|
2130
2130
|
Both suites run in CI on every push to `main` and on pull requests.
|
|
2131
2131
|
|
|
2132
|
+
## File naming conventions
|
|
2133
|
+
|
|
2134
|
+
Hyphens within a multi-word name; dot separates the name from its role suffix.
|
|
2135
|
+
|
|
2136
|
+
| Suffix | Role |
|
|
2137
|
+
| --- | --- |
|
|
2138
|
+
| `.types` | Data/option shapes — configs, options, result objects |
|
|
2139
|
+
| `.interface` | Contract interfaces — capability boundaries, polymorphism points |
|
|
2140
|
+
| `.manager` | Stateful manager class |
|
|
2141
|
+
| `.tracker` | Tracking/counting utility |
|
|
2142
|
+
| `.module` | NestJS module |
|
|
2143
|
+
| `.explorer` | NestJS metadata scanner |
|
|
2144
|
+
| `.decorator` | NestJS decorator definitions |
|
|
2145
|
+
| `.health` | Health indicator |
|
|
2146
|
+
| `.constants` | Constant values and DI tokens |
|
|
2147
|
+
| `.mock` | Jest/Vitest spy double |
|
|
2148
|
+
| `.fake` | Standalone fake implementation |
|
|
2149
|
+
| `.container` | Test infrastructure wrapper |
|
|
2150
|
+
| `.spec` | Unit test |
|
|
2151
|
+
| `.integration.spec` | Integration test |
|
|
2152
|
+
|
|
2153
|
+
A suffix is added only when it carries information the name alone does not. When the filename already expresses the role — `handler.ts` is a handler, `pipeline.ts` is a pipeline, `queue.ts` is a queue — no suffix is needed.
|
|
2154
|
+
|
|
2155
|
+
---
|
|
2156
|
+
|
|
2132
2157
|
## Project structure
|
|
2133
2158
|
|
|
2134
2159
|
```text
|
|
@@ -2188,11 +2213,11 @@ src/
|
|
|
2188
2213
|
│ │ │ # backpressure via queueHighWaterMark (pause/resume)
|
|
2189
2214
|
│ │ │
|
|
2190
2215
|
│ │ └── infra/
|
|
2191
|
-
│ │ ├── circuit-breaker.ts
|
|
2216
|
+
│ │ ├── circuit-breaker.manager.ts # CircuitBreakerManager — per groupId:topic:partition state
|
|
2192
2217
|
│ │ │ # machine (CLOSED → OPEN → HALF_OPEN); sliding failure window
|
|
2193
|
-
│ │ ├── metrics
|
|
2218
|
+
│ │ ├── metrics.manager.ts # MetricsManager — in-process counters (processed / retry /
|
|
2194
2219
|
│ │ │ # dlq / dedup) per topic; getMetrics() / resetMetrics()
|
|
2195
|
-
│ │ └── inflight
|
|
2220
|
+
│ │ └── inflight.tracker.ts # InFlightTracker — tracks running handlers for graceful
|
|
2196
2221
|
│ │ # shutdown drain (disconnect waits for all to settle)
|
|
2197
2222
|
│ │
|
|
2198
2223
|
│ └── __tests__/ # Unit tests — mocked @confluentinc/kafka-javascript
|
|
@@ -2252,13 +2277,13 @@ src/
|
|
|
2252
2277
|
│
|
|
2253
2278
|
├── testing/ # Testing utilities — no runtime Kafka deps
|
|
2254
2279
|
│ ├── index.ts # Re-exports createMockKafkaClient, KafkaTestContainer
|
|
2255
|
-
│ ├──
|
|
2280
|
+
│ ├── client.mock.ts # createMockKafkaClient<T>() — jest.fn() on every
|
|
2256
2281
|
│ │ # IKafkaClient method with sensible defaults
|
|
2257
|
-
│ ├── test
|
|
2282
|
+
│ ├── test.container.ts # KafkaTestContainer — thin @testcontainers/kafka wrapper;
|
|
2258
2283
|
│ │ # transaction coordinator warmup, topic pre-creation
|
|
2259
2284
|
│ └── __tests__/
|
|
2260
|
-
│ ├──
|
|
2261
|
-
│ └── test
|
|
2285
|
+
│ ├── client.mock.spec.ts # Mock client method stubs and overrides
|
|
2286
|
+
│ └── test.container.spec.ts # Container start/stop lifecycle
|
|
2262
2287
|
│
|
|
2263
2288
|
├── integration/ # Integration tests — require Docker (testcontainers)
|
|
2264
2289
|
│ ├── global-setup.ts # Start shared Kafka container before all suites
|
|
@@ -1123,7 +1123,7 @@ async function replayDlqTopic(topic2, deps, options = {}) {
|
|
|
1123
1123
|
return { replayed, skipped };
|
|
1124
1124
|
}
|
|
1125
1125
|
|
|
1126
|
-
// src/client/kafka.client/infra/metrics
|
|
1126
|
+
// src/client/kafka.client/infra/metrics.manager.ts
|
|
1127
1127
|
var MetricsManager = class {
|
|
1128
1128
|
constructor(deps) {
|
|
1129
1129
|
this.deps = deps;
|
|
@@ -1216,7 +1216,7 @@ var MetricsManager = class {
|
|
|
1216
1216
|
}
|
|
1217
1217
|
};
|
|
1218
1218
|
|
|
1219
|
-
// src/client/kafka.client/infra/inflight
|
|
1219
|
+
// src/client/kafka.client/infra/inflight.tracker.ts
|
|
1220
1220
|
var InFlightTracker = class {
|
|
1221
1221
|
constructor(warn) {
|
|
1222
1222
|
this.warn = warn;
|
|
@@ -1263,7 +1263,7 @@ var InFlightTracker = class {
|
|
|
1263
1263
|
}
|
|
1264
1264
|
};
|
|
1265
1265
|
|
|
1266
|
-
// src/client/kafka.client/infra/circuit-breaker.ts
|
|
1266
|
+
// src/client/kafka.client/infra/circuit-breaker.manager.ts
|
|
1267
1267
|
var CircuitBreakerManager = class {
|
|
1268
1268
|
constructor(deps) {
|
|
1269
1269
|
this.deps = deps;
|
|
@@ -3576,4 +3576,4 @@ export {
|
|
|
3576
3576
|
KafkaClient,
|
|
3577
3577
|
topic
|
|
3578
3578
|
};
|
|
3579
|
-
//# sourceMappingURL=chunk-
|
|
3579
|
+
//# sourceMappingURL=chunk-TPIP5VV7.mjs.map
|