@zdavison/nestjs-rpc-toolkit 0.0.18 → 0.0.19
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/dist/bin/bootstrap.js
CHANGED
|
@@ -114,7 +114,7 @@ class RpcPackageInitializer {
|
|
|
114
114
|
"generate:types": "ts-node scripts/generate-all-rpc-types.ts"
|
|
115
115
|
},
|
|
116
116
|
dependencies: {
|
|
117
|
-
"@zdavison/nestjs-rpc-toolkit": "^0.0.
|
|
117
|
+
"@zdavison/nestjs-rpc-toolkit": "^0.0.19",
|
|
118
118
|
"@nestjs/common": "^11.0.0",
|
|
119
119
|
"@nestjs/microservices": "^11.0.0"
|
|
120
120
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-controller.decorator.d.ts","sourceRoot":"","sources":["../../src/decorators/rpc-controller.decorator.ts"],"names":[],"mappings":"AAGA,OAAO,kBAAkB,CAAC;AAE1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,cAAc,
|
|
1
|
+
{"version":3,"file":"rpc-controller.decorator.d.ts","sourceRoot":"","sources":["../../src/decorators/rpc-controller.decorator.ts"],"names":[],"mappings":"AAGA,OAAO,kBAAkB,CAAC;AAE1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,cAAc,CA+C7D"}
|
|
@@ -39,8 +39,6 @@ require("reflect-metadata");
|
|
|
39
39
|
*/
|
|
40
40
|
function RpcController(prefix) {
|
|
41
41
|
return function (target) {
|
|
42
|
-
// Apply the NestJS Controller decorator
|
|
43
|
-
(0, common_1.Controller)()(target);
|
|
44
42
|
// Set RPC-specific metadata for pattern generation
|
|
45
43
|
let modulePrefix = prefix;
|
|
46
44
|
if (!modulePrefix) {
|
|
@@ -49,6 +47,13 @@ function RpcController(prefix) {
|
|
|
49
47
|
.replace(/(Service|Application|Handler|Repository)$/, '')
|
|
50
48
|
.toLowerCase();
|
|
51
49
|
}
|
|
50
|
+
// Check if @Controller has already been applied (look for the 'path' metadata that @Controller sets)
|
|
51
|
+
const existingPath = Reflect.getMetadata('path', target);
|
|
52
|
+
// Only apply @Controller if it hasn't been applied yet
|
|
53
|
+
if (existingPath === undefined) {
|
|
54
|
+
// Apply the NestJS Controller decorator with the inferred/provided prefix
|
|
55
|
+
(0, common_1.Controller)(modulePrefix)(target);
|
|
56
|
+
}
|
|
52
57
|
Reflect.defineMetadata('rpc:module', modulePrefix, target);
|
|
53
58
|
// Process any pending @RpcMethod decorators that were applied before @RpcController
|
|
54
59
|
const pendingMethods = Reflect.getMetadata('rpc:pending-methods', target) || [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-controller.decorator.js","sourceRoot":"","sources":["../../src/decorators/rpc-controller.decorator.ts"],"names":[],"mappings":";;AAqCA,
|
|
1
|
+
{"version":3,"file":"rpc-controller.decorator.js","sourceRoot":"","sources":["../../src/decorators/rpc-controller.decorator.ts"],"names":[],"mappings":";;AAqCA,sCA+CC;AApFD,2CAA4C;AAC5C,yDAA6E;AAC7E,sDAAqE;AACrE,4BAA0B;AAE1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,SAAgB,aAAa,CAAC,MAAe;IAC3C,OAAO,UAAU,MAAW;QAC1B,mDAAmD;QACnD,IAAI,YAAY,GAAG,MAAM,CAAC;QAC1B,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,yGAAyG;YACzG,YAAY,GAAG,MAAM,CAAC,IAAI;iBACvB,OAAO,CAAC,2CAA2C,EAAE,EAAE,CAAC;iBACxD,WAAW,EAAE,CAAC;QACnB,CAAC;QAED,qGAAqG;QACrG,MAAM,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAEzD,u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