@funduck/connectrpc-fastify-nestjs 1.0.2 → 1.0.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/dist/connectrpc.module.d.ts +26 -0
- package/dist/index.d.ts +2 -0
- package/dist/interfaces.d.ts +11 -0
- package/package.json +8 -8
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DynamicModule, Logger, OnModuleInit } from '@nestjs/common';
|
|
2
|
+
import { HttpAdapterHost } from '@nestjs/core';
|
|
3
|
+
import type { ConnectRPCModuleOptions } from './interfaces';
|
|
4
|
+
/**
|
|
5
|
+
* NestJS module for ConnectRPC integration
|
|
6
|
+
*
|
|
7
|
+
* Call registerPlugin() after app initialization and before server starts listening
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
export declare class ConnectRPCModule implements OnModuleInit {
|
|
11
|
+
private readonly httpAdapterHost;
|
|
12
|
+
private readonly options;
|
|
13
|
+
static readonly logger: Logger;
|
|
14
|
+
private readonly logger;
|
|
15
|
+
/**
|
|
16
|
+
* Configure the ConnectRPC module with options
|
|
17
|
+
*/
|
|
18
|
+
static forRoot(options?: ConnectRPCModuleOptions): DynamicModule;
|
|
19
|
+
constructor(httpAdapterHost: HttpAdapterHost, options: ConnectRPCModuleOptions);
|
|
20
|
+
private getServer;
|
|
21
|
+
private registerPluginCalled;
|
|
22
|
+
/** This must be called after app is initialized and before server starts listening */
|
|
23
|
+
registerPlugin(): Promise<void>;
|
|
24
|
+
/** This is called by NestJS after the module has been initialized */
|
|
25
|
+
onModuleInit(): Promise<void>;
|
|
26
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Logger, MiddlewareConfigUnion } from '@funduck/connectrpc-fastify';
|
|
2
|
+
/**
|
|
3
|
+
* Options for configuring ConnectRPC module
|
|
4
|
+
*/
|
|
5
|
+
export interface ConnectRPCModuleOptions {
|
|
6
|
+
logger?: Logger;
|
|
7
|
+
/**
|
|
8
|
+
* Middleware configurations to apply to ConnectRPC routes
|
|
9
|
+
*/
|
|
10
|
+
middlewares?: MiddlewareConfigUnion[];
|
|
11
|
+
}
|
package/package.json
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@funduck/connectrpc-fastify-nestjs",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
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
|
-
"main": "dist/
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
7
8
|
"scripts": {
|
|
8
9
|
"build": "npx rimraf dist; tsc -p tsconfig.build.json",
|
|
9
10
|
"compile-proto": "cd test && npx buf dep update; npx buf lint; npx buf generate",
|
|
10
11
|
"test": "npm run compile-proto && cd test && DEBUG=true npx tsx e2e-demo.ts",
|
|
11
12
|
"publish:check": "npm test && npm run build && npm publish --tag latest --access public --dry-run",
|
|
12
|
-
"publish:latest": "npm
|
|
13
|
+
"publish:latest": "npm publish --tag latest --access public"
|
|
13
14
|
},
|
|
14
15
|
"license": "MIT",
|
|
15
|
-
"
|
|
16
|
-
"@
|
|
17
|
-
"@funduck/connectrpc-fastify": "^1.0.4",
|
|
16
|
+
"peerDependencies": {
|
|
17
|
+
"@funduck/connectrpc-fastify": "^1.0.11",
|
|
18
18
|
"@nestjs/common": "^11.1.12",
|
|
19
19
|
"@nestjs/core": "^11.1.12",
|
|
20
|
-
"@nestjs/platform-fastify": "^11.1.12"
|
|
21
|
-
"fastify": "^5.6.2"
|
|
20
|
+
"@nestjs/platform-fastify": "^11.1.12"
|
|
22
21
|
},
|
|
23
22
|
"devDependencies": {
|
|
24
23
|
"@bufbuild/buf": "^1.64.0",
|
|
24
|
+
"@bufbuild/protobuf": "^2.10.2",
|
|
25
25
|
"@bufbuild/protoc-gen-es": "^2.10.2",
|
|
26
26
|
"@connectrpc/connect": "^2.1.1",
|
|
27
27
|
"@connectrpc/connect-node": "^2.1.1",
|