@funduck/connectrpc-fastify-nestjs 1.0.0 → 1.0.2

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 CHANGED
@@ -1,4 +1,7 @@
1
1
  # Connectrpc Fastify Wrapper For Nestjs
2
+ !BETA
3
+
4
+ Code is not production ready.
2
5
 
3
6
  ## Description
4
7
 
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var ConnectRPCModule_1;
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.ConnectRPCModule = void 0;
17
+ const connectrpc_fastify_1 = require("@funduck/connectrpc-fastify");
18
+ const common_1 = require("@nestjs/common");
19
+ const core_1 = require("@nestjs/core");
20
+ const platform_fastify_1 = require("@nestjs/platform-fastify");
21
+ const CONNECTRPC_MODULE_OPTIONS = Symbol('CONNECTRPC_MODULE_OPTIONS');
22
+ /**
23
+ * NestJS module for ConnectRPC integration
24
+ *
25
+ * Call registerPlugin() after app initialization and before server starts listening
26
+ *
27
+ */
28
+ let ConnectRPCModule = ConnectRPCModule_1 = class ConnectRPCModule {
29
+ /**
30
+ * Configure the ConnectRPC module with options
31
+ */
32
+ static forRoot(options = {}) {
33
+ if (options.logger) {
34
+ connectrpc_fastify_1.ConnectRPC.setLogger(options.logger);
35
+ }
36
+ return {
37
+ module: ConnectRPCModule_1,
38
+ global: true,
39
+ providers: [
40
+ {
41
+ provide: CONNECTRPC_MODULE_OPTIONS,
42
+ useValue: options,
43
+ },
44
+ ],
45
+ exports: [CONNECTRPC_MODULE_OPTIONS],
46
+ };
47
+ }
48
+ // For injections
49
+ constructor(httpAdapterHost, options) {
50
+ this.httpAdapterHost = httpAdapterHost;
51
+ this.options = options;
52
+ this.logger = ConnectRPCModule_1.logger;
53
+ this.registerPluginCalled = false;
54
+ }
55
+ getServer() {
56
+ const httpAdapter = this.httpAdapterHost.httpAdapter;
57
+ if (!httpAdapter) {
58
+ throw new Error('HTTP Adapter not found');
59
+ }
60
+ // For now, only Fastify is supported
61
+ if (!(httpAdapter instanceof platform_fastify_1.FastifyAdapter)) {
62
+ throw new Error('Only FastifyAdapter is supported');
63
+ }
64
+ const fastifyAdapter = httpAdapter;
65
+ const server = fastifyAdapter.getInstance();
66
+ return server;
67
+ }
68
+ /** This must be called after app is initialized and before server starts listening */
69
+ async registerPlugin() {
70
+ if (this.registerPluginCalled) {
71
+ this.logger.warn('registerPlugin() has already been called');
72
+ return;
73
+ }
74
+ this.registerPluginCalled = true;
75
+ const server = this.getServer();
76
+ if (!server) {
77
+ throw new Error('Fastify server instance not found');
78
+ }
79
+ await connectrpc_fastify_1.ConnectRPC.registerFastifyPlugin(server);
80
+ }
81
+ /** This is called by NestJS after the module has been initialized */
82
+ async onModuleInit() {
83
+ if (!this.registerPluginCalled) {
84
+ throw new Error('ConnectRPCModule.onModuleInit: registerPlugin() has not been called. Please call registerPlugin() after app initialization and before server starts listening.');
85
+ }
86
+ const server = this.getServer();
87
+ // Initialize middlewares first
88
+ await connectrpc_fastify_1.ConnectRPC.initMiddlewares(server, this.options.middlewares || []);
89
+ // Initialize guards after middlewares
90
+ await connectrpc_fastify_1.ConnectRPC.initGuards(server);
91
+ }
92
+ };
93
+ exports.ConnectRPCModule = ConnectRPCModule;
94
+ ConnectRPCModule.logger = new common_1.Logger(ConnectRPCModule_1.name, {
95
+ timestamp: true,
96
+ });
97
+ exports.ConnectRPCModule = ConnectRPCModule = ConnectRPCModule_1 = __decorate([
98
+ (0, common_1.Module)({}),
99
+ __param(0, (0, common_1.Inject)(core_1.HttpAdapterHost)),
100
+ __param(1, (0, common_1.Inject)(CONNECTRPC_MODULE_OPTIONS)),
101
+ __metadata("design:paramtypes", [core_1.HttpAdapterHost, Object])
102
+ ], ConnectRPCModule);
103
+ //# sourceMappingURL=connectrpc.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connectrpc.module.js","sourceRoot":"","sources":["../src/connectrpc.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oEAAyD;AACzD,2CAMwB;AACxB,uCAA+C;AAC/C,+DAA0D;AAG1D,MAAM,yBAAyB,GAAG,MAAM,CAAC,2BAA2B,CAAC,CAAC;AAEtE;;;;;GAKG;AAEI,IAAM,gBAAgB,wBAAtB,MAAM,gBAAgB;IAM3B;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,UAAmC,EAAE;QAClD,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;YACnB,+BAAU,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACvC,CAAC;QACD,OAAO;YACL,MAAM,EAAE,kBAAgB;YACxB,MAAM,EAAE,IAAI;YACZ,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,yBAAyB;oBAClC,QAAQ,EAAE,OAAO;iBAClB;aACF;YACD,OAAO,EAAE,CAAC,yBAAyB,CAAC;SACrC,CAAC;IACJ,CAAC;IAED,iBAAiB;IACjB,YAEE,eAAiD,EAEjD,OAAiD;QAFhC,oBAAe,GAAf,eAAe,CAAiB;QAEhC,YAAO,GAAP,OAAO,CAAyB;QA3BlC,WAAM,GAAG,kBAAgB,CAAC,MAAM,CAAC;Q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CAAC,CAAC;QAEzE,sCAAsC;QACtC,MAAM,+BAAU,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;;AApFU,4CAAgB;AACX,uBAAM,GAAG,IAAI,eAAM,CAAC,kBAAgB,CAAC,IAAI,EAAE;IACzD,SAAS,EAAE,IAAI;CAChB,CAAC,AAFoB,CAEnB;2BAHQ,gBAAgB;IAD5B,IAAA,eAAM,EAAC,EAAE,CAAC;IA6BN,WAAA,IAAA,eAAM,EAAC,sBAAe,CAAC,CAAA;IAEvB,WAAA,IAAA,eAAM,EAAC,yBAAyB,CAAC,CAAA;qCADA,sBAAe;GA7BxC,gBAAgB,CAqF5B"}
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConnectRPCModule = void 0;
4
+ // Export nestjs module
5
+ var connectrpc_module_1 = require("./connectrpc.module");
6
+ Object.defineProperty(exports, "ConnectRPCModule", { enumerable: true, get: function () { return connectrpc_module_1.ConnectRPCModule; } });
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,uBAAuB;AACvB,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA"}
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
3
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,13 +1,15 @@
1
1
  {
2
2
  "name": "@funduck/connectrpc-fastify-nestjs",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "author": "Oleg Milekhin <qlfunduck@gmail.com>",
5
5
  "description": "Wrapper for official @connectrpc/connect and fastify integrated into Nestjs. Simplifies configuration, type safe binding to controller, simplifies use of middlewares and guards.",
6
6
  "main": "dist/src/index.js",
7
7
  "scripts": {
8
8
  "build": "npx rimraf dist; tsc -p tsconfig.build.json",
9
9
  "compile-proto": "cd test && npx buf dep update; npx buf lint; npx buf generate",
10
- "test": "cd test && DEBUG=true npx tsx e2e-demo.ts"
10
+ "test": "npm run compile-proto && cd test && DEBUG=true npx tsx e2e-demo.ts",
11
+ "publish:check": "npm test && npm run build && npm publish --tag latest --access public --dry-run",
12
+ "publish:latest": "npm test && npm run build && npm publish --tag latest --access public"
11
13
  },
12
14
  "license": "MIT",
13
15
  "dependencies": {
@@ -24,6 +26,8 @@
24
26
  "@connectrpc/connect": "^2.1.1",
25
27
  "@connectrpc/connect-node": "^2.1.1",
26
28
  "@types/node": "^25.0.9",
27
- "prettier-plugin-organize-imports": "^4.3.0"
29
+ "prettier-plugin-organize-imports": "^4.3.0",
30
+ "ts-node": "^10.9.2",
31
+ "typescript": "^5.9.3"
28
32
  }
29
33
  }
@@ -1,22 +0,0 @@
1
- import { GenService, GenServiceMethods } from '@bufbuild/protobuf/codegenv2';
2
- import { FastifyInstance } from 'fastify';
3
- import { Guard, Logger, Middleware, MiddlewareConfigUnion, Service } from './interfaces';
4
- declare class ConnectRPCClass {
5
- setLogger(customLogger: Logger): void;
6
- registerMiddleware(self: Middleware, options?: {
7
- allowMultipleInstances?: boolean;
8
- }): void;
9
- registerController<T extends GenServiceMethods>(self: Service<GenService<T>>, service: GenService<T>, options?: {
10
- allowMultipleInstances?: boolean;
11
- }): void;
12
- registerGuard(self: Guard, options?: {
13
- allowMultipleInstances?: boolean;
14
- }): void;
15
- registerFastifyPlugin(server: FastifyInstance): Promise<void>;
16
- private _middlewaresInitialized;
17
- initMiddlewares(server: FastifyInstance, middlewareConfigs: MiddlewareConfigUnion[]): Promise<void>;
18
- private _guardsInitialized;
19
- initGuards(server: FastifyInstance): Promise<void>;
20
- }
21
- export declare const ConnectRPC: ConnectRPCClass;
22
- export {};
@@ -1,46 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ConnectRPC = void 0;
4
- const fastify_plugin_1 = require("./fastify-plugin");
5
- const guards_1 = require("./guards");
6
- const helpers_1 = require("./helpers");
7
- const middlewares_1 = require("./middlewares");
8
- const stores_1 = require("./stores");
9
- class ConnectRPCClass {
10
- setLogger(customLogger) {
11
- (0, helpers_1.setLogger)(customLogger);
12
- }
13
- registerMiddleware(self, options) {
14
- stores_1.MiddlewareStore.registerInstance(self, options);
15
- }
16
- registerController(self, service, options) {
17
- stores_1.ControllersStore.registerInstance(self, service, options);
18
- }
19
- registerGuard(self, options) {
20
- stores_1.GuardsStore.registerInstance(self, options);
21
- }
22
- registerFastifyPlugin(server) {
23
- return (0, fastify_plugin_1.registerFastifyPlugin)(server);
24
- }
25
- _middlewaresInitialized = false;
26
- initMiddlewares(server, middlewareConfigs) {
27
- if (this._middlewaresInitialized) {
28
- throw new Error('Middlewares have already been initialized!');
29
- }
30
- if (this._guardsInitialized) {
31
- throw new Error('Middlewares must be initialized before guards!');
32
- }
33
- this._middlewaresInitialized = true;
34
- return (0, middlewares_1.initMiddlewares)(server, middlewareConfigs);
35
- }
36
- _guardsInitialized = false;
37
- initGuards(server) {
38
- if (this._guardsInitialized) {
39
- throw new Error('Guards have already been initialized!');
40
- }
41
- this._guardsInitialized = true;
42
- return (0, guards_1.initGuards)(server);
43
- }
44
- }
45
- exports.ConnectRPC = new ConnectRPCClass();
46
- //# sourceMappingURL=connectrpc.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"connectrpc.js","sourceRoot":"","sources":["../../src/connectrpc.ts"],"names":[],"mappings":";;;AAEA,qDAAyD;AACzD,qCAAsC;AACtC,uCAAsC;AAQtC,+CAAgD;AAChD,qCAA0E;AAE1E,MAAM,eAAe;IACnB,SAAS,CAAC,YAAoB;QAC5B,IAAA,mBAAS,EAAC,YAAY,CAAC,CAAC;IAC1B,CAAC;IAED,kBAAkB,CAChB,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ExecutionContext, Type } from './interfaces';
3
- export declare class ManualExecutionContext implements ExecutionContext {
4
- readonly request: FastifyRequest['raw'];
5
- readonly response: FastifyReply['raw'];
6
- readonly next: <T = any>() => T;
7
- readonly args: any[];
8
- readonly constructorRef: Type<any> | null;
9
- readonly handler: Function | null;
10
- constructor(request: FastifyRequest['raw'], response: FastifyReply['raw'], next: <T = any>() => T, args: any[], constructorRef?: Type<any> | null, handler?: Function | null);
11
- getClass<T = any>(): Type<T>;
12
- getHandler(): Function;
13
- getArgs<T extends Array<any> = any[]>(): T;
14
- getArgByIndex<T = any>(index: number): T;
15
- switchToHttp(): this & {
16
- getRequest: () => import("node:http").IncomingMessage;
17
- getResponse: () => import("node:http").ServerResponse<import("node:http").IncomingMessage>;
18
- getNext: () => <T = any>() => T;
19
- };
20
- switchToRpc(): void;
21
- switchToWs(): void;
22
- }
@@ -1,46 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ManualExecutionContext = void 0;
4
- class ManualExecutionContext {
5
- request;
6
- response;
7
- next;
8
- args;
9
- constructorRef;
10
- handler;
11
- constructor(request, response, next, args, constructorRef = null, handler = null) {
12
- this.request = request;
13
- this.response = response;
14
- this.next = next;
15
- this.args = args;
16
- this.constructorRef = constructorRef;
17
- this.handler = handler;
18
- }
19
- getClass() {
20
- return this.constructorRef;
21
- }
22
- getHandler() {
23
- return this.handler;
24
- }
25
- getArgs() {
26
- return this.args;
27
- }
28
- getArgByIndex(index) {
29
- return this.args[index];
30
- }
31
- switchToHttp() {
32
- return Object.assign(this, {
33
- getRequest: () => this.request,
34
- getResponse: () => this.response,
35
- getNext: () => this.next,
36
- });
37
- }
38
- switchToRpc() {
39
- throw new Error('Context switching to RPC is not supported.');
40
- }
41
- switchToWs() {
42
- throw new Error('Context switching to WebSockets is not supported.');
43
- }
44
- }
45
- exports.ManualExecutionContext = ManualExecutionContext;
46
- //# sourceMappingURL=execution-context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"execution-context.js","sourceRoot":"","sources":["../../src/execution-context.ts"],"names":[],"mappings":";;;AAGA,MAAa,sBAAsB;IAEtB;IACA;IACA;IACA;IACA;IACA;IANX,YACW,OAA8B,EAC9B,QAA6B,EAC7B,IAAsB,EACtB,IAAW,EACX,iBAAmC,IAAI,EACvC,UAA2B,IAAI;QAL/B,YAAO,GAAP,OAAO,CAAuB;QAC9B,aAAQ,GAAR,QAAQ,CAAqB;QAC7B,SAAI,GAAJ,IAAI,CAAkB;QACtB,SAAI,GAAJ,IAAI,CAAO;QACX,mBAAc,GAAd,cAAc,CAAyB;QACvC,YAAO,GAAP,OAAO,CAAwB;IACvC,CAAC;IAEJ,QAAQ;QACN,OAAO,IAAI,CAAC,cAAe,CAAC;IAC9B,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,OAAQ,CAAC;IACvB,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,IAAS,CAAC;IACxB,CAAC;IAED,aAAa,CAAU,KAAa;QAClC,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAM,CAAC;IAC/B,CAAC;IAED,YAAY;QACV,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;YACzB,UAAU,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO;YAC9B,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ;YAChC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI;SACzB,CAAC,CAAC;IACL,CAAC;IAED,WAAW;QACT,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;IAChE,CAAC;IAED,UAAU;QACR,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACvE,CAAC;CACF;AAzCD,wDAyCC"}
@@ -1,5 +0,0 @@
1
- import { Compression } from '@connectrpc/connect/protocol';
2
- import { FastifyInstance } from 'fastify';
3
- export declare function registerFastifyPlugin(server: FastifyInstance, options?: {
4
- acceptCompression?: Compression[];
5
- }): Promise<void>;
@@ -1,57 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.registerFastifyPlugin = registerFastifyPlugin;
4
- const connect_fastify_1 = require("@connectrpc/connect-fastify");
5
- const guards_1 = require("./guards");
6
- const helpers_1 = require("./helpers");
7
- const stores_1 = require("./stores");
8
- async function registerFastifyPlugin(server, options = {}) {
9
- const implementations = new Map();
10
- for (const { instance, service } of stores_1.ControllersStore.values()) {
11
- const guards = (0, guards_1.getGuards)(instance);
12
- if (guards.length > 0) {
13
- helpers_1.logger.log(`Found ${guards.length} guards on controller ${instance.constructor.name}`);
14
- }
15
- const methodMappings = (0, helpers_1.discoverMethodMappings)(instance.__proto__, service);
16
- const implementation = {};
17
- for (const methodDesc of service.methods) {
18
- const { name } = methodDesc;
19
- const methodName = name[0].toLowerCase() + name.slice(1);
20
- const controllerMethodName = methodMappings[name];
21
- if (controllerMethodName) {
22
- const controllerMethod = instance[controllerMethodName];
23
- if (controllerMethod) {
24
- const bindedMethod = controllerMethod.bind(instance);
25
- implementation[methodName] = (...args) => {
26
- return bindedMethod(...args);
27
- };
28
- stores_1.RouteMetadataStore.registerRoute(service.typeName, name, instance.constructor, controllerMethod, controllerMethodName, instance);
29
- helpers_1.logger.log(`Binding ${instance.constructor.name}.${controllerMethodName} to ${service.typeName}.${name}`);
30
- }
31
- else {
32
- helpers_1.logger.warn(`Method ${controllerMethodName} not found in ${instance.constructor.name}`);
33
- }
34
- }
35
- }
36
- implementations.set(service, implementation);
37
- }
38
- const routes = (router) => {
39
- for (const [service, implementation] of implementations.entries()) {
40
- router.service(service, implementation);
41
- helpers_1.logger.log(`Registered {/${service.typeName}} route`);
42
- }
43
- };
44
- if (routes.length === 0) {
45
- helpers_1.logger.warn('No controllers found to register');
46
- return;
47
- }
48
- await server.register(connect_fastify_1.fastifyConnectPlugin, {
49
- grpc: false,
50
- grpcWeb: false,
51
- connect: true,
52
- acceptCompression: options.acceptCompression ?? [],
53
- routes: routes,
54
- });
55
- helpers_1.logger.log('Ready');
56
- }
57
- //# sourceMappingURL=fastify-plugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fastify-plugin.js","sourceRoot":"","sources":["../../src/fastify-plugin.ts"],"names":[],"mappings":";;AASA,sDAyFC;AAhGD,iEAAmE;AAGnE,qCAAqC;AACrC,uCAA2D;AAC3D,qCAAgE;AAEzD,KAAK,UAAU,qBAAqB,CACzC,MAAuB,EACvB,UAEI,EAAE;IAGN,MAAM,eAAe,GAAG,IAAI,GAAG,EAAwB,CAAC;IAExD,KAAK,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,yBAAgB,CAAC,MAAM,EAAE,EAAE,CAAC;QAC9D,MAAM,MAAM,GAAG,IAAA,kBAAS,EAAC,QAAQ,CAAC,CAAC;QACnC,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtB,gBAAM,CAAC,GAAG,CACR,SAAS,MAAM,CAAC,MAAM,yBAAyB,QAAQ,CAAC,WAAW,CAAC,IAAI,EAAE,CAC3E,CAAC;QACJ,CAAC;QAED,MAAM,cAAc,GAAG,IAAA,gCAAsB,EAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAG3E,MAAM,cAAc,GAAQ,EAAE,CAAC;QAG/B,KAAK,MAAM,UAAU,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YACzC,MAAM,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC;YAC5B,MAAM,UAAU,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAGzD,MAAM,oBAAoB,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;YAElD,IAAI,oBAAoB,EAAE,CAAC;gBACzB,MAAM,gBAAgB,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC;gBAExD,IAAI,gBAAgB,EAAE,CAAC;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,KAAK;QACX,OAAO,EAAE,KAAK;QACd,OAAO,EAAE,IAAI;QACb,iBAAiB,EAAE,OAAO,CAAC,iBAAiB,IAAI,EAAE;QAClD,MAAM,EAAE,MAAM;KACf,CAAC,CAAC;IAEH,gBAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACtB,CAAC"}
@@ -1,8 +0,0 @@
1
- import { FastifyInstance } from 'fastify';
2
- import { ExecutionContext, Guard } from './interfaces';
3
- export declare class ManualGuardExecutor {
4
- executeGuard(guard: Guard, context: ExecutionContext): Promise<boolean>;
5
- executeGuards(guards: Guard[], context: ExecutionContext): Promise<boolean>;
6
- }
7
- export declare function getGuards(controller: any): Guard[];
8
- export declare function initGuards(server: FastifyInstance): Promise<void>;
@@ -1,72 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ManualGuardExecutor = void 0;
4
- exports.getGuards = getGuards;
5
- exports.initGuards = initGuards;
6
- const execution_context_1 = require("./execution-context");
7
- const helpers_1 = require("./helpers");
8
- const stores_1 = require("./stores");
9
- class ManualGuardExecutor {
10
- async executeGuard(guard, context) {
11
- const result = guard.canActivate(context);
12
- if (typeof result === 'boolean') {
13
- return result;
14
- }
15
- return await result;
16
- }
17
- async executeGuards(guards, context) {
18
- for (const guard of guards) {
19
- const canActivate = await this.executeGuard(guard, context);
20
- if (!canActivate) {
21
- return false;
22
- }
23
- }
24
- return true;
25
- }
26
- }
27
- exports.ManualGuardExecutor = ManualGuardExecutor;
28
- function getGuards(controller) {
29
- return stores_1.GuardsStore.getAllGuards();
30
- }
31
- async function initGuards(server) {
32
- const guardExecutor = new ManualGuardExecutor();
33
- server.addHook('preHandler', async (request, reply) => {
34
- const url = request.url;
35
- const match = url.match(/^\/([^/]+)\/([^/]+)$/);
36
- if (!match) {
37
- return;
38
- }
39
- const routeMetadata = stores_1.RouteMetadataStore.getRouteMetadata(url);
40
- if (!routeMetadata) {
41
- helpers_1.logger.warn(`No route metadata found for ${url}`);
42
- return;
43
- }
44
- const { controllerClass, controllerMethod, controllerMethodName, instance, } = routeMetadata;
45
- const guards = getGuards(instance);
46
- if (guards.length === 0) {
47
- return;
48
- }
49
- const executionContext = new execution_context_1.ManualExecutionContext(request.raw, reply.raw, (() => undefined), [], controllerClass, controllerMethod);
50
- try {
51
- const canActivate = await guardExecutor.executeGuards(guards, executionContext);
52
- if (!canActivate) {
53
- reply.code(403).send({
54
- code: 'permission_denied',
55
- message: 'Forbidden',
56
- });
57
- throw new Error('Guard rejected the request');
58
- }
59
- }
60
- catch (error) {
61
- if (!reply.sent) {
62
- reply.code(403).send({
63
- code: 'permission_denied',
64
- message: error instanceof Error ? error.message : 'Forbidden',
65
- });
66
- }
67
- throw error;
68
- }
69
- });
70
- helpers_1.logger.log('Guards middleware initialized');
71
- }
72
- //# sourceMappingURL=guards.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"guards.js","sourceRoot":"","sources":["../../src/guards.ts"],"names":[],"mappings":";;;AAoCA,8BAKC;AAKD,gCAmFC;AAhID,2DAA6D;AAC7D,uCAAmC;AAEnC,qCAA2D;AAE3D,MAAa,mBAAmB;IAC9B,KAAK,CAAC,YAAY,CAChB,KAAY,EACZ,OAAyB;QAEzB,MAAM,MAAM,GAAG,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAG1C,IAAI,OAAO,MAAM,KAAK,SAAS,EAAE,CAAC;YAChC,OAAO,MAAM,CAAC;QAChB,CAAC;QAGD,OAAO,MAAM,MAAM,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,aAAa,CACjB,MAAe,EACf,OAAyB;QAEzB,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YAC5D,IAAI,CAAC,WAAW,EAAE,CAAC;gBACjB,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;QACD,OAAO,IA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AC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;oBACnB,IAAI,EAAE,mBAAmB;oBACzB,OAAO,EAAE,WAAW;iBACrB,CAAC,CAAC;gBACH,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;YAChD,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAEf,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;gBAChB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;oBACnB,IAAI,EAAE,mBAAmB;oBACzB,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW;iBAC9D,CAAC,CAAC;YACL,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC,CACF,CAAC;IAEF,gBAAM,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;AAC9C,CAAC"}
@@ -1,7 +0,0 @@
1
- import { GenService } from '@bufbuild/protobuf/codegenv2';
2
- import { FastifyReply, FastifyRequest } from 'fastify';
3
- import { Logger } from './interfaces';
4
- export declare function discoverMethodMappings(prototype: any, service: GenService<any>): Record<string, string>;
5
- export declare function convertMiddlewareToHook(middlewareInstance: any): (request: FastifyRequest, reply: FastifyReply) => Promise<void>;
6
- export declare let logger: Logger;
7
- export declare function setLogger(customLogger: Logger): void;
@@ -1,63 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.logger = void 0;
4
- exports.discoverMethodMappings = discoverMethodMappings;
5
- exports.convertMiddlewareToHook = convertMiddlewareToHook;
6
- exports.setLogger = setLogger;
7
- function discoverMethodMappings(prototype, service) {
8
- const methodMappings = {};
9
- const serviceMethods = Array.isArray(service.methods) ? service.methods : [];
10
- const controllerMethods = Object.getOwnPropertyNames(prototype).filter((name) => name !== 'constructor' && typeof prototype[name] === 'function');
11
- for (const methodDesc of serviceMethods) {
12
- const serviceMethodName = methodDesc.name;
13
- const localName = methodDesc.localName;
14
- let controllerMethodName = controllerMethods.find((name) => name === localName);
15
- if (!controllerMethodName) {
16
- controllerMethodName = controllerMethods.find((name) => name.toLowerCase() === serviceMethodName.toLowerCase());
17
- }
18
- if (controllerMethodName) {
19
- methodMappings[serviceMethodName] = controllerMethodName;
20
- }
21
- }
22
- return methodMappings;
23
- }
24
- function convertMiddlewareToHook(middlewareInstance) {
25
- return async (request, reply) => {
26
- return new Promise((resolve, reject) => {
27
- try {
28
- middlewareInstance.use(request.raw, reply.raw, (err) => {
29
- if (err) {
30
- reject(err);
31
- }
32
- else {
33
- resolve();
34
- }
35
- });
36
- }
37
- catch (error) {
38
- reject(error);
39
- }
40
- });
41
- };
42
- }
43
- exports.logger = {
44
- log: (...args) => {
45
- console.info(...args);
46
- },
47
- error: (...args) => {
48
- console.error(...args);
49
- },
50
- warn: (...args) => {
51
- console.warn(...args);
52
- },
53
- debug: (...args) => {
54
- console.debug(...args);
55
- },
56
- verbose: (...args) => {
57
- console.log(...args);
58
- },
59
- };
60
- function setLogger(customLogger) {
61
- exports.logger = customLogger;
62
- }
63
- //# sourceMappingURL=helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":";;;AAOA,wDAsCC;AAKD,0DAmBC;AAoBD,8BAEC;AApFD,SAAgB,sBAAsB,CACpC,SAAS,EACT,OAAwB;IAExB,MAAM,cAAc,GAA2B,EAAE,CAAC;IAGlD,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;IAG7E,MAAM,iBAAiB,GAAG,MAAM,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC,MAAM,CACpE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,aAAa,IAAI,OA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ACJ,CAAC;AAEU,QAAA,MAAM,GAAW;IAC1B,GAAG,EAAE,CAAC,GAAG,IAAW,EAAE,EAAE;QACtB,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;IACxB,CAAC;IACD,KAAK,EAAE,CAAC,GAAG,IAAW,EAAE,EAAE;QACxB,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;IACzB,CAAC;IACD,IAAI,EAAE,CAAC,GAAG,IAAW,EAAE,EAAE;QACvB,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;IACxB,CAAC;IACD,KAAK,EAAE,CAAC,GAAG,IAAW,EAAE,EAAE;QACxB,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;IACzB,CAAC;IACD,OAAO,EAAE,CAAC,GAAG,IAAW,EAAE,EAAE;QAC1B,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;IACvB,CAAC;CACF,CAAC;AAEF,SAAgB,SAAS,CAAC,YAAoB;IAC5C,cAAM,GAAG,YAAY,CAAC;AACxB,CAAC"}
@@ -1,6 +0,0 @@
1
- export declare function printMsg(): void;
2
- export { ConnectRPC } from './connectrpc';
3
- export { middlewareConfig } from './interfaces';
4
- export type { ExecutionContext, Guard, Logger, Middleware, MiddlewareConfig, MiddlewareConfigUnion, Service, } from './interfaces';
5
- export { initGuards } from './guards';
6
- export type { OmitConnectrpcFields } from './types';
package/dist/src/index.js DELETED
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.initGuards = exports.middlewareConfig = exports.ConnectRPC = void 0;
4
- exports.printMsg = printMsg;
5
- function printMsg() {
6
- console.log('Thanks for using connectrpc-fastify!');
7
- }
8
- var connectrpc_1 = require("./connectrpc");
9
- Object.defineProperty(exports, "ConnectRPC", { enumerable: true, get: function () { return connectrpc_1.ConnectRPC; } });
10
- var interfaces_1 = require("./interfaces");
11
- Object.defineProperty(exports, "middlewareConfig", { enumerable: true, get: function () { return interfaces_1.middlewareConfig; } });
12
- var guards_1 = require("./guards");
13
- Object.defineProperty(exports, "initGuards", { enumerable: true, get: function () { return guards_1.initGuards; } });
14
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,4BAEC;AAFD,SAAgB,QAAQ;IACtB,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;AACtD,CAAC;AAED,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AAEnB,2CAAgD;AAAvC,8GAAA,gBAAgB,OAAA;AAYzB,mCAAsC;AAA7B,oGAAA,UAAU,OAAA"}