@opra/nestjs-rabbitmq 1.20.0 → 1.21.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/cjs/constants.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OPRA_RMQ_MODULE_CONFIG = void 0;
4
- exports.OPRA_RMQ_MODULE_CONFIG = 'OPRA_RMQ_MODULE_CONFIG';
3
+ exports.OPRA_RMQ_MODULE_OPTIONS = void 0;
4
+ exports.OPRA_RMQ_MODULE_OPTIONS = 'OPRA_RMQ_MODULE_OPTIONS';
@@ -23,7 +23,7 @@ let OpraRabbitmqCoreModule = OpraRabbitmqCoreModule_1 = class OpraRabbitmqCoreMo
23
23
  providers: [
24
24
  ...(moduleOptions?.providers || []),
25
25
  {
26
- provide: constants_js_1.OPRA_RMQ_MODULE_CONFIG,
26
+ provide: constants_js_1.OPRA_RMQ_MODULE_OPTIONS,
27
27
  useValue: {
28
28
  ...moduleOptions,
29
29
  logger: moduleOptions.logger || new common_1.Logger(moduleOptions.name),
@@ -40,7 +40,7 @@ let OpraRabbitmqCoreModule = OpraRabbitmqCoreModule_1 = class OpraRabbitmqCoreMo
40
40
  providers: [
41
41
  ...(moduleOptions?.providers || []),
42
42
  {
43
- provide: constants_js_1.OPRA_RMQ_MODULE_CONFIG,
43
+ provide: constants_js_1.OPRA_RMQ_MODULE_OPTIONS,
44
44
  inject: moduleOptions.inject,
45
45
  useFactory: async (...args) => {
46
46
  const result = await moduleOptions.useFactory(...args);
@@ -55,11 +55,11 @@ let OpraRabbitmqCoreModule = OpraRabbitmqCoreModule_1 = class OpraRabbitmqCoreMo
55
55
  const token = moduleOptions.id || rabbitmq_1.RabbitmqAdapter;
56
56
  const adapterProvider = {
57
57
  provide: token,
58
- inject: [nestjs_1.MQControllerFactory, core_1.ModuleRef, constants_js_1.OPRA_RMQ_MODULE_CONFIG],
58
+ inject: [nestjs_1.MQControllerFactory, core_1.ModuleRef, constants_js_1.OPRA_RMQ_MODULE_OPTIONS],
59
59
  useFactory: async (controllerFactory, moduleRef, config) => {
60
60
  const controllers = controllerFactory
61
61
  .exploreControllers()
62
- .map(x => x.wrapper.instance.constructor);
62
+ .map(x => x.wrapper.instance);
63
63
  const document = await common_2.ApiDocumentFactory.createDocument({
64
64
  info: config.info,
65
65
  types: config.types,
@@ -131,7 +131,7 @@ exports.OpraRabbitmqCoreModule = OpraRabbitmqCoreModule = OpraRabbitmqCoreModule
131
131
  (0, common_1.Module)({}),
132
132
  (0, common_1.Global)(),
133
133
  tslib_1.__param(1, (0, common_1.Inject)(opraRabbitmqNestjsAdapterToken)),
134
- tslib_1.__param(2, (0, common_1.Inject)(constants_js_1.OPRA_RMQ_MODULE_CONFIG)),
134
+ tslib_1.__param(2, (0, common_1.Inject)(constants_js_1.OPRA_RMQ_MODULE_OPTIONS)),
135
135
  tslib_1.__metadata("design:paramtypes", [nestjs_1.MQControllerFactory,
136
136
  rabbitmq_1.RabbitmqAdapter, Object])
137
137
  ], OpraRabbitmqCoreModule);
package/esm/constants.js CHANGED
@@ -1 +1 @@
1
- export const OPRA_RMQ_MODULE_CONFIG = 'OPRA_RMQ_MODULE_CONFIG';
1
+ export const OPRA_RMQ_MODULE_OPTIONS = 'OPRA_RMQ_MODULE_OPTIONS';
@@ -6,7 +6,7 @@ import { ModuleRef } from '@nestjs/core';
6
6
  import { ApiDocumentFactory } from '@opra/common';
7
7
  import { MQControllerFactory } from '@opra/nestjs';
8
8
  import { RabbitmqAdapter } from '@opra/rabbitmq';
9
- import { OPRA_RMQ_MODULE_CONFIG } from './constants.js';
9
+ import { OPRA_RMQ_MODULE_OPTIONS } from './constants.js';
10
10
  const opraRabbitmqNestjsAdapterToken = Symbol('OpraRabbitmqNestjsAdapter');
11
11
  let OpraRabbitmqCoreModule = OpraRabbitmqCoreModule_1 = class OpraRabbitmqCoreModule {
12
12
  constructor(controllerFactory, adapter, config) {
@@ -20,7 +20,7 @@ let OpraRabbitmqCoreModule = OpraRabbitmqCoreModule_1 = class OpraRabbitmqCoreMo
20
20
  providers: [
21
21
  ...(moduleOptions?.providers || []),
22
22
  {
23
- provide: OPRA_RMQ_MODULE_CONFIG,
23
+ provide: OPRA_RMQ_MODULE_OPTIONS,
24
24
  useValue: {
25
25
  ...moduleOptions,
26
26
  logger: moduleOptions.logger || new Logger(moduleOptions.name),
@@ -37,7 +37,7 @@ let OpraRabbitmqCoreModule = OpraRabbitmqCoreModule_1 = class OpraRabbitmqCoreMo
37
37
  providers: [
38
38
  ...(moduleOptions?.providers || []),
39
39
  {
40
- provide: OPRA_RMQ_MODULE_CONFIG,
40
+ provide: OPRA_RMQ_MODULE_OPTIONS,
41
41
  inject: moduleOptions.inject,
42
42
  useFactory: async (...args) => {
43
43
  const result = await moduleOptions.useFactory(...args);
@@ -52,11 +52,11 @@ let OpraRabbitmqCoreModule = OpraRabbitmqCoreModule_1 = class OpraRabbitmqCoreMo
52
52
  const token = moduleOptions.id || RabbitmqAdapter;
53
53
  const adapterProvider = {
54
54
  provide: token,
55
- inject: [MQControllerFactory, ModuleRef, OPRA_RMQ_MODULE_CONFIG],
55
+ inject: [MQControllerFactory, ModuleRef, OPRA_RMQ_MODULE_OPTIONS],
56
56
  useFactory: async (controllerFactory, moduleRef, config) => {
57
57
  const controllers = controllerFactory
58
58
  .exploreControllers()
59
- .map(x => x.wrapper.instance.constructor);
59
+ .map(x => x.wrapper.instance);
60
60
  const document = await ApiDocumentFactory.createDocument({
61
61
  info: config.info,
62
62
  types: config.types,
@@ -127,7 +127,7 @@ OpraRabbitmqCoreModule = OpraRabbitmqCoreModule_1 = __decorate([
127
127
  Module({}),
128
128
  Global(),
129
129
  __param(1, Inject(opraRabbitmqNestjsAdapterToken)),
130
- __param(2, Inject(OPRA_RMQ_MODULE_CONFIG)),
130
+ __param(2, Inject(OPRA_RMQ_MODULE_OPTIONS)),
131
131
  __metadata("design:paramtypes", [MQControllerFactory,
132
132
  RabbitmqAdapter, Object])
133
133
  ], OpraRabbitmqCoreModule);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opra/nestjs-rabbitmq",
3
- "version": "1.20.0",
3
+ "version": "1.21.0",
4
4
  "description": "Opra NestJS RabbitMQ Module",
5
5
  "author": "Panates",
6
6
  "license": "MIT",
@@ -9,10 +9,10 @@
9
9
  "tslib": "^2.8.1"
10
10
  },
11
11
  "peerDependencies": {
12
- "@opra/common": "^1.20.0",
13
- "@opra/core": "^1.20.0",
14
- "@opra/nestjs": "^1.20.0",
15
- "@opra/rabbitmq": "^1.20.0",
12
+ "@opra/common": "^1.21.0",
13
+ "@opra/core": "^1.21.0",
14
+ "@opra/nestjs": "^1.21.0",
15
+ "@opra/rabbitmq": "^1.21.0",
16
16
  "@nestjs/common": "^10.0.0 || ^11.0.0",
17
17
  "@nestjs/core": "^10.0.0 || ^11.0.0",
18
18
  "@nestjs/microservices": "^10.0.0 || ^11.0.0",
@@ -1 +1 @@
1
- export declare const OPRA_RMQ_MODULE_CONFIG = "OPRA_RMQ_MODULE_CONFIG";
1
+ export declare const OPRA_RMQ_MODULE_OPTIONS = "OPRA_RMQ_MODULE_OPTIONS";
@@ -5,8 +5,8 @@ import type { OpraRabbitmqModule } from './opra-rabbitmq.module.js';
5
5
  export declare class OpraRabbitmqCoreModule implements OnModuleInit, OnApplicationBootstrap, OnApplicationShutdown {
6
6
  private controllerFactory;
7
7
  protected adapter: RabbitmqAdapter;
8
- protected config: OpraRabbitmqModule.ApiConfig;
9
- constructor(controllerFactory: MQControllerFactory, adapter: RabbitmqAdapter, config: OpraRabbitmqModule.ApiConfig);
8
+ protected config: OpraRabbitmqModule.ModuleOptions;
9
+ constructor(controllerFactory: MQControllerFactory, adapter: RabbitmqAdapter, config: OpraRabbitmqModule.ModuleOptions);
10
10
  static forRoot(moduleOptions: OpraRabbitmqModule.ModuleOptions): DynamicModule;
11
11
  static forRootAsync(moduleOptions: OpraRabbitmqModule.AsyncModuleOptions): DynamicModule;
12
12
  protected static _getDynamicModule(moduleOptions: OpraRabbitmqModule.ModuleOptions | OpraRabbitmqModule.AsyncModuleOptions): DynamicModule;
@@ -1,5 +1,5 @@
1
1
  import { type DynamicModule, Logger, type Type } from '@nestjs/common';
2
- import { ApiDocumentFactory } from '@opra/common';
2
+ import type { ApiDocumentFactory } from '@opra/common';
3
3
  import type { RabbitmqAdapter } from '@opra/rabbitmq';
4
4
  export declare namespace OpraRabbitmqModule {
5
5
  export interface ModuleOptions extends BaseModuleOptions, ApiConfig {