@opra/nestjs-kafka 1.28.3 → 1.28.5

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.
Files changed (3) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +66 -3
  3. package/package.json +7 -6
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2022 Panates
3
+ Copyright (c) 2020-present Panates®
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,19 +1,82 @@
1
+ <div align="center">
2
+
3
+ <a href="https://oprajs.com">
4
+ <img src="https://oprajs.com/img/opra-header-block.webp" width="880" alt="OPRA — Open Platform for Rich APIs" />
5
+ </a>
6
+
1
7
  # @opra/nestjs-kafka
2
8
 
9
+ NestJS Kafka module for the OPRA framework
10
+
3
11
  [![NPM Version][npm-image]][npm-url]
4
12
  [![NPM Downloads][downloads-image]][downloads-url]
5
13
  [![CI Tests][ci-test-image]][ci-test-url]
6
14
  [![Test Coverage][coveralls-image]][coveralls-url]
7
15
 
16
+ [🌐 Documentation](https://oprajs.com) · [🚀 Getting Started](https://oprajs.com/docs/introduction) · [📦 Packages](https://github.com/panates/opra#packages) · [💬 Issues](https://github.com/panates/opra/issues)
17
+
18
+ </div>
19
+
20
+ ---
21
+
22
+ NestJS Kafka module for the [OPRA](https://oprajs.com) framework. Wire up Kafka consumers in your NestJS application using OPRA's decorator-driven operation model.
23
+
24
+ ## Features
25
+
26
+ - **`OpraKafkaModule`** — Dynamically configurable NestJS module (`forRoot` / `forRootAsync`)
27
+ - Full NestJS dependency injection and provider support
28
+ - Interceptor middleware pipeline
29
+ - Shares the same operation model as your HTTP and WebSocket services
30
+
31
+ ## Installation
8
32
 
9
- ## Support
10
- You can report bugs and discuss features on the [GitHub issues](https://github.com/panates/opra/issues) page.
33
+ ```bash
34
+ npm install @opra/nestjs-kafka
35
+ ```
36
+
37
+ ## Usage
38
+
39
+ ```typescript
40
+ import { Module } from '@nestjs/common';
41
+ import { OpraKafkaModule } from '@opra/nestjs-kafka';
42
+
43
+ @Module({
44
+ imports: [
45
+ OpraKafkaModule.forRoot({
46
+ name: 'MyKafkaAPI',
47
+ client: {
48
+ clientId: 'my-service',
49
+ bootstrapBrokers: ['localhost:9092'],
50
+ },
51
+ consumers: {
52
+ 'my-group': { sessionTimeout: 30000 },
53
+ },
54
+ controllers: [OrdersController],
55
+ providers: [OrdersService],
56
+ }),
57
+ ],
58
+ })
59
+ export class AppModule {}
60
+ ```
61
+
62
+ ### Async configuration
63
+
64
+ ```typescript
65
+ OpraKafkaModule.forRootAsync({
66
+ useFactory: (config: ConfigService) => ({
67
+ client: { bootstrapBrokers: [config.get('KAFKA_BROKER')] },
68
+ controllers: [OrdersController],
69
+ }),
70
+ inject: [ConfigService],
71
+ })
72
+ ```
11
73
 
12
74
  ## Node Compatibility
13
- - node >= 20.x
14
75
 
76
+ - node >= 20.x
15
77
 
16
78
  ## License
79
+
17
80
  Available under [MIT](LICENSE) license.
18
81
 
19
82
  [npm-image]: https://img.shields.io/npm/v/@opra/nestjs-kafka
package/package.json CHANGED
@@ -1,21 +1,22 @@
1
1
  {
2
2
  "name": "@opra/nestjs-kafka",
3
- "version": "1.28.3",
3
+ "version": "1.28.5",
4
4
  "description": "Opra NestJS Kafka Module",
5
5
  "author": "Panates",
6
6
  "license": "MIT",
7
+ "homepage": "https://www.oprajs.com",
7
8
  "dependencies": {
8
- "@jsopen/objects": "^2.2.1",
9
+ "@jsopen/objects": "^2.2.2",
9
10
  "fast-tokenizer": "^1.9.0",
10
11
  "putil-promisify": "^1.10.1",
11
12
  "reflect-metadata": "^0.2.2",
12
13
  "tslib": "^2.8.1"
13
14
  },
14
15
  "peerDependencies": {
15
- "@opra/common": "^1.28.3",
16
- "@opra/core": "^1.28.3",
17
- "@opra/nestjs": "^1.28.3",
18
- "@opra/kafka": "^1.28.3",
16
+ "@opra/common": "^1.28.5",
17
+ "@opra/core": "^1.28.5",
18
+ "@opra/nestjs": "^1.28.5",
19
+ "@opra/kafka": "^1.28.5",
19
20
  "@nestjs/common": "^10.0.0 || ^11.0.0",
20
21
  "@nestjs/core": "^10.0.0 || ^11.0.0",
21
22
  "@nestjs/microservices": "^10.0.0 || ^11.0.0",