@opra/nestjs 1.19.7 → 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/augmentation/nestjs.augmentation.js +6 -0
- package/cjs/index.js +1 -0
- package/cjs/rpc-controller.factory.js +1 -1
- package/cjs/ws-controller.factory.js +12 -0
- package/esm/augmentation/nestjs.augmentation.js +7 -1
- package/esm/index.js +1 -0
- package/esm/rpc-controller.factory.js +1 -1
- package/esm/ws-controller.factory.js +8 -0
- package/package.json +3 -3
- package/types/index.d.cts +1 -0
- package/types/index.d.ts +1 -0
- package/types/ws-controller.factory.d.ts +4 -0
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const common_1 = require("@nestjs/common");
|
|
4
4
|
const external_exception_filter_js_1 = require("@nestjs/core/exceptions/external-exception-filter.js");
|
|
5
5
|
const common_2 = require("@opra/common");
|
|
6
|
+
var WSControllerDecoratorFactory = common_2.classes.WSControllerDecoratorFactory;
|
|
6
7
|
const { MQControllerDecoratorFactory } = common_2.classes;
|
|
7
8
|
const oldCatchMethod = external_exception_filter_js_1.ExternalExceptionFilter.prototype.catch;
|
|
8
9
|
external_exception_filter_js_1.ExternalExceptionFilter.prototype.catch = function (exception, host) {
|
|
@@ -17,3 +18,8 @@ MQControllerDecoratorFactory.augment((decorator, decoratorChain) => {
|
|
|
17
18
|
(0, common_1.Controller)()(target);
|
|
18
19
|
});
|
|
19
20
|
});
|
|
21
|
+
WSControllerDecoratorFactory.augment((decorator, decoratorChain) => {
|
|
22
|
+
decoratorChain.push((_, target) => {
|
|
23
|
+
(0, common_1.Controller)()(target);
|
|
24
|
+
});
|
|
25
|
+
});
|
package/cjs/index.js
CHANGED
|
@@ -9,3 +9,4 @@ tslib_1.__exportStar(require("./mq-controller.factory.js"), exports);
|
|
|
9
9
|
tslib_1.__exportStar(require("./opra-nest-utils.js"), exports);
|
|
10
10
|
tslib_1.__exportStar(require("./rpc-controller.factory.js"), exports);
|
|
11
11
|
tslib_1.__exportStar(require("./rpc-params.factory.js"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./ws-controller.factory.js"), exports);
|
|
@@ -59,7 +59,7 @@ let RpcControllerFactory = class RpcControllerFactory {
|
|
|
59
59
|
});
|
|
60
60
|
this.registerContextProvider(opraContext, contextId);
|
|
61
61
|
const contextInstance = await this.injector.loadPerContext(instance, moduleRef, moduleRef.providers, contextId);
|
|
62
|
-
const contextCallback = this.externalContextCreator.create(contextInstance, contextInstance[methodName], methodName, constants_js_1.PARAM_ARGS_METADATA, paramsFactory, contextId, wrapper.id, options, opraContext.
|
|
62
|
+
const contextCallback = this.externalContextCreator.create(contextInstance, contextInstance[methodName], methodName, constants_js_1.PARAM_ARGS_METADATA, paramsFactory, contextId, wrapper.id, options, opraContext.transport);
|
|
63
63
|
return contextCallback(opraContext);
|
|
64
64
|
};
|
|
65
65
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WSControllerFactory = void 0;
|
|
4
|
+
const common_1 = require("@opra/common");
|
|
5
|
+
const rpc_controller_factory_js_1 = require("./rpc-controller.factory.js");
|
|
6
|
+
class WSControllerFactory extends rpc_controller_factory_js_1.RpcControllerFactory {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this._metadataKey = common_1.WS_CONTROLLER_METADATA;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.WSControllerFactory = WSControllerFactory;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Controller } from '@nestjs/common';
|
|
2
2
|
import { ExternalExceptionFilter } from '@nestjs/core/exceptions/external-exception-filter.js';
|
|
3
|
-
import { classes } from '@opra/common';
|
|
3
|
+
import { classes, } from '@opra/common';
|
|
4
|
+
var WSControllerDecoratorFactory = classes.WSControllerDecoratorFactory;
|
|
4
5
|
const { MQControllerDecoratorFactory } = classes;
|
|
5
6
|
const oldCatchMethod = ExternalExceptionFilter.prototype.catch;
|
|
6
7
|
ExternalExceptionFilter.prototype.catch = function (exception, host) {
|
|
@@ -15,3 +16,8 @@ MQControllerDecoratorFactory.augment((decorator, decoratorChain) => {
|
|
|
15
16
|
Controller()(target);
|
|
16
17
|
});
|
|
17
18
|
});
|
|
19
|
+
WSControllerDecoratorFactory.augment((decorator, decoratorChain) => {
|
|
20
|
+
decoratorChain.push((_, target) => {
|
|
21
|
+
Controller()(target);
|
|
22
|
+
});
|
|
23
|
+
});
|
package/esm/index.js
CHANGED
|
@@ -56,7 +56,7 @@ let RpcControllerFactory = class RpcControllerFactory {
|
|
|
56
56
|
});
|
|
57
57
|
this.registerContextProvider(opraContext, contextId);
|
|
58
58
|
const contextInstance = await this.injector.loadPerContext(instance, moduleRef, moduleRef.providers, contextId);
|
|
59
|
-
const contextCallback = this.externalContextCreator.create(contextInstance, contextInstance[methodName], methodName, PARAM_ARGS_METADATA, paramsFactory, contextId, wrapper.id, options, opraContext.
|
|
59
|
+
const contextCallback = this.externalContextCreator.create(contextInstance, contextInstance[methodName], methodName, PARAM_ARGS_METADATA, paramsFactory, contextId, wrapper.id, options, opraContext.transport);
|
|
60
60
|
return contextCallback(opraContext);
|
|
61
61
|
};
|
|
62
62
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { WS_CONTROLLER_METADATA } from '@opra/common';
|
|
2
|
+
import { RpcControllerFactory } from './rpc-controller.factory.js';
|
|
3
|
+
export class WSControllerFactory extends RpcControllerFactory {
|
|
4
|
+
constructor() {
|
|
5
|
+
super(...arguments);
|
|
6
|
+
this._metadataKey = WS_CONTROLLER_METADATA;
|
|
7
|
+
}
|
|
8
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opra/nestjs",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.21.0",
|
|
4
4
|
"description": "Opra NestJS module",
|
|
5
5
|
"author": "Panates",
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"tslib": "^2.8.1"
|
|
11
11
|
},
|
|
12
12
|
"peerDependencies": {
|
|
13
|
-
"@opra/common": "^1.
|
|
14
|
-
"@opra/core": "^1.
|
|
13
|
+
"@opra/common": "^1.21.0",
|
|
14
|
+
"@opra/core": "^1.21.0",
|
|
15
15
|
"@nestjs/common": "^10.0.0 || ^11.0.0",
|
|
16
16
|
"@nestjs/core": "^10.0.0 || ^11.0.0",
|
|
17
17
|
"@nestjs/microservices": "^10.0.0 || ^11.0.0"
|
package/types/index.d.cts
CHANGED
package/types/index.d.ts
CHANGED