@opra/nestjs-kafka 1.26.2 → 1.26.4
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 +25 -2
- package/opra-kafka.module.d.ts +31 -2
- package/opra-kafka.module.js +11 -2
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @opra/nestjs-kafka
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[![NPM Version][npm-image]][npm-url]
|
|
4
|
+
[![NPM Downloads][downloads-image]][downloads-url]
|
|
5
|
+
[![CI Tests][ci-test-image]][ci-test-url]
|
|
6
|
+
[![Test Coverage][coveralls-image]][coveralls-url]
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## Support
|
|
10
|
+
You can report bugs and discuss features on the [GitHub issues](https://github.com/panates/opra/issues) page.
|
|
11
|
+
|
|
12
|
+
## Node Compatibility
|
|
13
|
+
- node >= 20.x
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## License
|
|
17
|
+
Available under [MIT](LICENSE) license.
|
|
18
|
+
|
|
19
|
+
[npm-image]: https://img.shields.io/npm/v/@opra/nestjs-kafka
|
|
20
|
+
[npm-url]: https://npmjs.org/package/@opra/nestjs-kafka
|
|
21
|
+
[downloads-image]: https://img.shields.io/npm/dm/@opra/nestjs-kafka.svg
|
|
22
|
+
[downloads-url]: https://npmjs.org/package/@opra/nestjs-kafka
|
|
23
|
+
[ci-test-image]: https://github.com/panates/opra/actions/workflows/test.yml/badge.svg
|
|
24
|
+
[ci-test-url]: https://github.com/panates/opra/actions/workflows/test.yml
|
|
25
|
+
[coveralls-image]: https://coveralls.io/repos/github/panates/opra/badge.svg?branch=main
|
|
26
|
+
[coveralls-url]: https://coveralls.io/github/panates/opra?branch=main
|
package/opra-kafka.module.d.ts
CHANGED
|
@@ -2,33 +2,62 @@ import { type DynamicModule, Logger, type Type } from '@nestjs/common';
|
|
|
2
2
|
import { ApiDocumentFactory } from '@opra/common';
|
|
3
3
|
import type { KafkaAdapter } from '@opra/kafka';
|
|
4
4
|
export declare namespace OpraKafkaModule {
|
|
5
|
+
/**
|
|
6
|
+
* Synchronous configuration options for OpraKafkaModule.
|
|
7
|
+
*/
|
|
5
8
|
export interface ModuleOptions extends BaseModuleOptions, ApiConfig {
|
|
6
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Asynchronous configuration options for OpraKafkaModule.
|
|
12
|
+
*/
|
|
7
13
|
export interface AsyncModuleOptions extends BaseModuleOptions {
|
|
14
|
+
/** Providers to be injected into the factory function */
|
|
8
15
|
inject?: any[];
|
|
16
|
+
/** Factory function that returns the ApiConfig object asynchronously */
|
|
9
17
|
useFactory?: (...args: any[]) => Promise<ApiConfig> | ApiConfig;
|
|
10
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Base configuration options for the module.
|
|
21
|
+
*/
|
|
11
22
|
interface BaseModuleOptions extends Pick<DynamicModule, 'imports' | 'providers' | 'exports' | 'controllers' | 'global'> {
|
|
23
|
+
/** Module ID */
|
|
12
24
|
id?: any;
|
|
25
|
+
/** Interceptor list for the Kafka adapter */
|
|
13
26
|
interceptors?: (KafkaAdapter.InterceptorFunction | KafkaAdapter.IKafkaInterceptor | Type<KafkaAdapter.IKafkaInterceptor>)[];
|
|
14
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* OPRA Kafka API configuration details.
|
|
30
|
+
*/
|
|
15
31
|
export interface ApiConfig extends Pick<ApiDocumentFactory.InitArguments, 'types' | 'references' | 'info'>, Pick<KafkaAdapter.Config, 'client' | 'consumers' | 'logExtra' | 'defaults'> {
|
|
32
|
+
/** API name */
|
|
16
33
|
name: string;
|
|
34
|
+
/** API description */
|
|
17
35
|
description?: string;
|
|
36
|
+
/** API scope */
|
|
18
37
|
scope?: string;
|
|
38
|
+
/** Logger to be used */
|
|
19
39
|
logger?: Logger;
|
|
20
40
|
}
|
|
21
41
|
export {};
|
|
22
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* OpraKafkaModule
|
|
45
|
+
*
|
|
46
|
+
* Module that integrates OPRA Kafka support into the NestJS application.
|
|
47
|
+
*/
|
|
23
48
|
export declare class OpraKafkaModule {
|
|
24
49
|
/**
|
|
50
|
+
* Configures the module synchronously and imports it at the root level.
|
|
25
51
|
*
|
|
26
|
-
* @param options
|
|
52
|
+
* @param options - Module configuration options.
|
|
53
|
+
* @returns {DynamicModule} NestJS dynamic module.
|
|
27
54
|
*/
|
|
28
55
|
static forRoot(options: OpraKafkaModule.ModuleOptions): DynamicModule;
|
|
29
56
|
/**
|
|
57
|
+
* Configures the module asynchronously and imports it at the root level.
|
|
30
58
|
*
|
|
31
|
-
* @param options
|
|
59
|
+
* @param options - Asynchronous module configuration options.
|
|
60
|
+
* @returns {DynamicModule} NestJS dynamic module.
|
|
32
61
|
*/
|
|
33
62
|
static forRootAsync(options: OpraKafkaModule.AsyncModuleOptions): DynamicModule;
|
|
34
63
|
}
|
package/opra-kafka.module.js
CHANGED
|
@@ -2,10 +2,17 @@ var OpraKafkaModule_1;
|
|
|
2
2
|
import { __decorate } from "tslib";
|
|
3
3
|
import { Module } from '@nestjs/common';
|
|
4
4
|
import { OpraKafkaCoreModule } from './opra-kafka-core.module.js';
|
|
5
|
+
/**
|
|
6
|
+
* OpraKafkaModule
|
|
7
|
+
*
|
|
8
|
+
* Module that integrates OPRA Kafka support into the NestJS application.
|
|
9
|
+
*/
|
|
5
10
|
let OpraKafkaModule = OpraKafkaModule_1 = class OpraKafkaModule {
|
|
6
11
|
/**
|
|
12
|
+
* Configures the module synchronously and imports it at the root level.
|
|
7
13
|
*
|
|
8
|
-
* @param options
|
|
14
|
+
* @param options - Module configuration options.
|
|
15
|
+
* @returns {DynamicModule} NestJS dynamic module.
|
|
9
16
|
*/
|
|
10
17
|
static forRoot(options) {
|
|
11
18
|
return {
|
|
@@ -14,8 +21,10 @@ let OpraKafkaModule = OpraKafkaModule_1 = class OpraKafkaModule {
|
|
|
14
21
|
};
|
|
15
22
|
}
|
|
16
23
|
/**
|
|
24
|
+
* Configures the module asynchronously and imports it at the root level.
|
|
17
25
|
*
|
|
18
|
-
* @param options
|
|
26
|
+
* @param options - Asynchronous module configuration options.
|
|
27
|
+
* @returns {DynamicModule} NestJS dynamic module.
|
|
19
28
|
*/
|
|
20
29
|
static forRootAsync(options) {
|
|
21
30
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opra/nestjs-kafka",
|
|
3
|
-
"version": "1.26.
|
|
3
|
+
"version": "1.26.4",
|
|
4
4
|
"description": "Opra NestJS Kafka Module",
|
|
5
5
|
"author": "Panates",
|
|
6
6
|
"license": "MIT",
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
"tslib": "^2.8.1"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@opra/common": "^1.26.
|
|
16
|
-
"@opra/core": "^1.26.
|
|
17
|
-
"@opra/nestjs": "^1.26.
|
|
18
|
-
"@opra/kafka": "^1.26.
|
|
15
|
+
"@opra/common": "^1.26.4",
|
|
16
|
+
"@opra/core": "^1.26.4",
|
|
17
|
+
"@opra/nestjs": "^1.26.4",
|
|
18
|
+
"@opra/kafka": "^1.26.4",
|
|
19
19
|
"@nestjs/common": "^10.0.0 || ^11.0.0",
|
|
20
20
|
"@nestjs/core": "^10.0.0 || ^11.0.0",
|
|
21
21
|
"@nestjs/microservices": "^10.0.0 || ^11.0.0",
|