@funduck/connectrpc-fastify-nestjs 1.0.8 → 1.0.9
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 +6 -5
- package/dist/examples/auth.middleware.d.ts +11 -0
- package/dist/examples/auth.middleware.js +58 -0
- package/dist/examples/auth.middleware.js.map +1 -0
- package/dist/examples/exception.interceptor.d.ts +6 -0
- package/dist/examples/exception.interceptor.js +80 -0
- package/dist/examples/exception.interceptor.js.map +1 -0
- package/dist/examples/types.d.ts +16 -0
- package/dist/examples/types.js +26 -0
- package/dist/examples/types.js.map +1 -0
- package/dist/src/connectrpc.module.js.map +1 -0
- package/dist/src/index.js.map +1 -0
- package/dist/{interfaces.js.map → src/interfaces.js.map} +1 -1
- package/package.json +3 -3
- package/dist/connectrpc.module.js.map +0 -1
- package/dist/index.js.map +0 -1
- /package/dist/{connectrpc.module.d.ts → src/connectrpc.module.d.ts} +0 -0
- /package/dist/{connectrpc.module.js → src/connectrpc.module.js} +0 -0
- /package/dist/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/{index.js → src/index.js} +0 -0
- /package/dist/{interfaces.d.ts → src/interfaces.d.ts} +0 -0
- /package/dist/{interfaces.js → src/interfaces.js} +0 -0
package/README.md
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
# Connectrpc Fastify Wrapper For Nestjs
|
|
2
2
|
<img src="./coverage/badge.svg" alt="Coverage Badge" />
|
|
3
3
|
|
|
4
|
-
[github](https://github.com/funduck/connectrpc-fastify-nestjs)
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Code is not production ready.
|
|
4
|
+
Repo on [github](https://github.com/funduck/connectrpc-fastify-nestjs)
|
|
5
|
+
Package on [npm](https://www.npmjs.com/package/@funduck/connectrpc-fastify-nestjs)
|
|
6
|
+
Related [base repo without Nestjs](https://github.com/funduck/connectrpc-fastify)
|
|
9
7
|
|
|
10
8
|
## Description
|
|
11
9
|
|
|
@@ -165,5 +163,8 @@ export async function bootstrap() {
|
|
|
165
163
|
}
|
|
166
164
|
```
|
|
167
165
|
|
|
166
|
+
### More examples
|
|
167
|
+
See `test/demo` and `examples` directories for more examples.
|
|
168
|
+
|
|
168
169
|
## Feedback
|
|
169
170
|
Please use [Discussions](https://github.com/funduck/connectrpc-fastify-nestjs/discussions) or email me.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Middleware } from '@funduck/connectrpc-fastify';
|
|
2
|
+
import { FastifyReply, FastifyRequest } from 'fastify';
|
|
3
|
+
import { AccessToken, BaseError, RequestId } from './types';
|
|
4
|
+
export declare const accessTokenKey: import("@connectrpc/connect").ContextKey<AccessToken>;
|
|
5
|
+
export declare const requestIdKey: import("@connectrpc/connect").ContextKey<RequestId>;
|
|
6
|
+
export declare const errorKey: import("@connectrpc/connect").ContextKey<BaseError>;
|
|
7
|
+
export declare class AuthMiddleware implements Middleware {
|
|
8
|
+
private authService;
|
|
9
|
+
constructor();
|
|
10
|
+
use(req: FastifyRequest['raw'], res: FastifyReply['raw'], next: () => void): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AuthMiddleware = exports.errorKey = exports.requestIdKey = exports.accessTokenKey = void 0;
|
|
13
|
+
const connect_1 = require("@connectrpc/connect");
|
|
14
|
+
const connectrpc_fastify_1 = require("@funduck/connectrpc-fastify");
|
|
15
|
+
const common_1 = require("@nestjs/common");
|
|
16
|
+
const node_crypto_1 = require("node:crypto");
|
|
17
|
+
const types_1 = require("./types");
|
|
18
|
+
exports.accessTokenKey = (0, connect_1.createContextKey)(undefined);
|
|
19
|
+
exports.requestIdKey = (0, connect_1.createContextKey)(undefined);
|
|
20
|
+
exports.errorKey = (0, connect_1.createContextKey)(undefined);
|
|
21
|
+
let AuthMiddleware = class AuthMiddleware {
|
|
22
|
+
constructor() {
|
|
23
|
+
connectrpc_fastify_1.ConnectRPC.registerMiddleware(this);
|
|
24
|
+
}
|
|
25
|
+
async use(req, res, next) {
|
|
26
|
+
const context = (0, connectrpc_fastify_1.getCustomContextValues)(req);
|
|
27
|
+
try {
|
|
28
|
+
// Generating or extracting request ID
|
|
29
|
+
const reqId = req.headers['x-request-id'] || (0, node_crypto_1.randomUUID)();
|
|
30
|
+
const requestId = new types_1.RequestId(reqId);
|
|
31
|
+
context.set(exports.requestIdKey, requestId);
|
|
32
|
+
// Extracting access token
|
|
33
|
+
const accessToken = await this.authService.extractAccessToken(req.headers['authorization']);
|
|
34
|
+
if (!accessToken) {
|
|
35
|
+
throw new types_1.BaseError('Access token is missing', common_1.HttpStatus.UNAUTHORIZED);
|
|
36
|
+
}
|
|
37
|
+
// Saving access token to context, so it can be used in handlers
|
|
38
|
+
context.set(exports.accessTokenKey, accessToken);
|
|
39
|
+
}
|
|
40
|
+
catch (err) {
|
|
41
|
+
// Saving error to context, so it can be handled by ExceptionInterceptor
|
|
42
|
+
context.set(exports.errorKey, err);
|
|
43
|
+
}
|
|
44
|
+
finally {
|
|
45
|
+
next();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
exports.AuthMiddleware = AuthMiddleware;
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, common_1.Inject)(types_1.AuthService),
|
|
52
|
+
__metadata("design:type", types_1.AuthService)
|
|
53
|
+
], AuthMiddleware.prototype, "authService", void 0);
|
|
54
|
+
exports.AuthMiddleware = AuthMiddleware = __decorate([
|
|
55
|
+
(0, common_1.Injectable)(),
|
|
56
|
+
__metadata("design:paramtypes", [])
|
|
57
|
+
], AuthMiddleware);
|
|
58
|
+
//# sourceMappingURL=auth.middleware.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.middleware.js","sourceRoot":"","sources":["../../examples/auth.middleware.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAAuD;AACvD,oEAIqC;AACrC,2CAAgE;AAGhE,6CAAyC;AACzC,mCAAyE;AAE5D,QAAA,cAAc,GAAG,IAAA,0BAAgB,EAAc,SAAS,CAAC,CAAC;AAC1D,QAAA,YAAY,GAAG,IAAA,0BAAgB,EAAY,SAAS,CAAC,CAAC;AACtD,QAAA,QAAQ,GAAG,IAAA,0BAAgB,EAAY,SAAS,CAAC,CAAC;AAGxD,IAAM,cAAc,GAApB,MAAM,cAAc;IAIzB;QACE,+BAAU,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,GAAG,CACP,GAA0B,EAC1B,GAAwB,EACxB,IAAgB;QAEhB,MAAM,OAAO,GAAG,IAAA,2CAAsB,EAAC,GAAG,CAAE,CAAC;QAE7C,IAAI,CAAC;YACH,sCAAsC;YACtC,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,IAAA,wBAAU,GAAE,CAAC;YAC1D,MAAM,SAAS,GAAG,IAAI,iBAAS,CAAC,KAAe,CAAC,CAAC;YACjD,OAAO,CAAC,GAAG,CAAC,oBAAY,EAAE,SAAS,CAAC,CAAC;YAErC,0BAA0B;YAC1B,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,kBAAkB,CAC3D,GAAG,CAAC,OAAO,CAAC,eAAe,CAAW,CACvC,CAAC;YACF,IAAI,CAAC,WAAW,EAAE,CAAC;gBACjB,MAAM,IAAI,iBAAS,CAAC,yBAAyB,EAAE,mBAAU,CAAC,YAAY,CAAC,CAAC;YAC1E,CAAC;YAED,gEAAgE;YAChE,OAAO,CAAC,GAAG,CAAC,sBAAc,EAAE,WAAW,CAAC,CAAC;QAC3C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,wEAAwE;YACxE,OAAO,CAAC,GAAG,CAAC,gBAAQ,EAAE,GAAG,CAAC,CAAC;QAC7B,CAAC;gBAAS,CAAC;YACT,IAAI,EAAE,CAAC;QACT,CAAC;IACH,CAAC;CACF,CAAA;AAtCY,wCAAc;AAEjB;IADP,IAAA,eAAM,EAAC,mBAAW,CAAC;8BACC,mBAAW;mDAAC;yBAFtB,cAAc;IAD1B,IAAA,mBAAU,GAAE;;GACA,cAAc,CAsC1B"}
|
|
@@ -0,0 +1,80 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ExceptionInterceptor = void 0;
|
|
13
|
+
const connect_1 = require("@connectrpc/connect");
|
|
14
|
+
const connectrpc_fastify_1 = require("@funduck/connectrpc-fastify");
|
|
15
|
+
const common_1 = require("@nestjs/common");
|
|
16
|
+
const auth_middleware_1 = require("./auth.middleware");
|
|
17
|
+
const types_1 = require("./types");
|
|
18
|
+
let ExceptionInterceptor = class ExceptionInterceptor {
|
|
19
|
+
constructor() {
|
|
20
|
+
connectrpc_fastify_1.ConnectRPC.registerInterceptor(this);
|
|
21
|
+
}
|
|
22
|
+
use(next) {
|
|
23
|
+
return async (req) => {
|
|
24
|
+
try {
|
|
25
|
+
// Check if we already have an error in context (set by middleware)
|
|
26
|
+
const err = req.contextValues.get(auth_middleware_1.errorKey);
|
|
27
|
+
if (err) {
|
|
28
|
+
throw err;
|
|
29
|
+
}
|
|
30
|
+
// Process the request
|
|
31
|
+
const result = await next(req);
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
// Map NestJS/HTTP errors to ConnectRPC codes
|
|
36
|
+
let code;
|
|
37
|
+
switch (err instanceof types_1.BaseError
|
|
38
|
+
? err.httpCode
|
|
39
|
+
: common_1.HttpStatus.INTERNAL_SERVER_ERROR) {
|
|
40
|
+
case common_1.HttpStatus.BAD_REQUEST:
|
|
41
|
+
code = connect_1.Code.InvalidArgument;
|
|
42
|
+
break;
|
|
43
|
+
case common_1.HttpStatus.UNAUTHORIZED:
|
|
44
|
+
code = connect_1.Code.Unauthenticated;
|
|
45
|
+
break;
|
|
46
|
+
case common_1.HttpStatus.FORBIDDEN:
|
|
47
|
+
code = connect_1.Code.PermissionDenied;
|
|
48
|
+
break;
|
|
49
|
+
case common_1.HttpStatus.NOT_FOUND:
|
|
50
|
+
code = connect_1.Code.NotFound;
|
|
51
|
+
break;
|
|
52
|
+
case common_1.HttpStatus.CONFLICT:
|
|
53
|
+
code = connect_1.Code.AlreadyExists;
|
|
54
|
+
break;
|
|
55
|
+
case common_1.HttpStatus.TOO_MANY_REQUESTS:
|
|
56
|
+
code = connect_1.Code.ResourceExhausted;
|
|
57
|
+
break;
|
|
58
|
+
case common_1.HttpStatus.INTERNAL_SERVER_ERROR:
|
|
59
|
+
default:
|
|
60
|
+
code = connect_1.Code.Internal;
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
this.logger.error(err, {
|
|
64
|
+
requestId: req.contextValues.get(auth_middleware_1.requestIdKey)?.value,
|
|
65
|
+
});
|
|
66
|
+
throw new connect_1.ConnectError(err.message, code);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
exports.ExceptionInterceptor = ExceptionInterceptor;
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, common_1.Inject)(common_1.Logger),
|
|
74
|
+
__metadata("design:type", common_1.Logger)
|
|
75
|
+
], ExceptionInterceptor.prototype, "logger", void 0);
|
|
76
|
+
exports.ExceptionInterceptor = ExceptionInterceptor = __decorate([
|
|
77
|
+
(0, common_1.Injectable)(),
|
|
78
|
+
__metadata("design:paramtypes", [])
|
|
79
|
+
], ExceptionInterceptor);
|
|
80
|
+
//# sourceMappingURL=exception.interceptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exception.interceptor.js","sourceRoot":"","sources":["../../examples/exception.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAAyD;AACzD,oEAA6E;AAC7E,2CAAwE;AACxE,uDAA2D;AAC3D,mCAAoC;AAG7B,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAI/B;QACE,+BAAU,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IAED,GAAG,CAAC,IAAW;QACb,OAAO,KAAK,EAAE,GAAG,EAAE,EAAE;YACnB,IAAI,CAAC;gBACH,mEAAmE;gBACnE,MAAM,GAAG,GAAG,GAAG,CAAC,aAAa,CAAC,GAAG,C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I,sBAAY,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YAC5C,CAAC;QACH,CAAC,CAAC;IACJ,CAAC;CACF,CAAA;AA7DY,oDAAoB;AAEvB;IADP,IAAA,eAAM,EAAC,eAAM,CAAC;8BACC,eAAM;oDAAC;+BAFZ,oBAAoB;IADhC,IAAA,mBAAU,GAAE;;GACA,oBAAoB,CA6DhC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare class BaseError {
|
|
2
|
+
message: string;
|
|
3
|
+
httpCode: number;
|
|
4
|
+
constructor(message: string, httpCode: number);
|
|
5
|
+
}
|
|
6
|
+
export declare class RequestId {
|
|
7
|
+
value: string;
|
|
8
|
+
constructor(value: string);
|
|
9
|
+
}
|
|
10
|
+
export declare class AccessToken {
|
|
11
|
+
token: string;
|
|
12
|
+
constructor(token: string);
|
|
13
|
+
}
|
|
14
|
+
export declare abstract class AuthService {
|
|
15
|
+
abstract extractAccessToken(authorizationHeader: string | undefined): Promise<AccessToken | null>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthService = exports.AccessToken = exports.RequestId = exports.BaseError = void 0;
|
|
4
|
+
class BaseError {
|
|
5
|
+
constructor(message, httpCode) {
|
|
6
|
+
this.message = message;
|
|
7
|
+
this.httpCode = httpCode;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.BaseError = BaseError;
|
|
11
|
+
class RequestId {
|
|
12
|
+
constructor(value) {
|
|
13
|
+
this.value = value;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.RequestId = RequestId;
|
|
17
|
+
class AccessToken {
|
|
18
|
+
constructor(token) {
|
|
19
|
+
this.token = token;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.AccessToken = AccessToken;
|
|
23
|
+
class AuthService {
|
|
24
|
+
}
|
|
25
|
+
exports.AuthService = AuthService;
|
|
26
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../examples/types.ts"],"names":[],"mappings":";;;AAAA,MAAa,SAAS;IACpB,YACS,OAAe,EACf,QAAgB;QADhB,YAAO,GAAP,OAAO,CAAQ;QACf,aAAQ,GAAR,QAAQ,CAAQ;IACtB,CAAC;CACL;AALD,8BAKC;AAED,MAAa,SAAS;IACpB,YAAmB,KAAa;QAAb,UAAK,GAAL,KAAK,CAAQ;IAAG,CAAC;CACrC;AAFD,8BAEC;AAED,MAAa,WAAW;IACtB,YAAmB,KAAa;QAAb,UAAK,GAAL,KAAK,CAAQ;IAAG,CAAC;CACrC;AAFD,kCAEC;AAED,MAAsB,WAAW;CAIhC;AAJD,kCAIC"}
|
|
@@ -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,iBA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AAoB,EAAE,CAAC;YAC/B,MAAM,IAAI,KAAK,CACb,gKAAgK,CACjK,CAAC;QACJ,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QAEhC,+BAA+B;QAC/B,MAAM,+BAAU,CAAC,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC;IAC3E,CAAC;;AAnFU,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,CAoF5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,4BAIC;AAJD,SAAgB,QAAQ;IACtB,OAAO,CAAC,KAAK,CACX,iFAAiF,CAClF,CAAC;AACJ,CAAC;AAED,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/interfaces.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@funduck/connectrpc-fastify-nestjs",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
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.",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"license": "MIT",
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"@funduck/connectrpc-fastify": "^1.0.
|
|
19
|
+
"@funduck/connectrpc-fastify": "^1.0.21",
|
|
20
20
|
"@nestjs/common": "^11.1.12",
|
|
21
21
|
"@nestjs/core": "^11.1.12",
|
|
22
22
|
"@nestjs/platform-fastify": "^11.1.12",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@bufbuild/protoc-gen-es": "^2.10.2",
|
|
29
29
|
"@connectrpc/connect": "^2.1.1",
|
|
30
30
|
"@connectrpc/connect-node": "^2.1.1",
|
|
31
|
-
"@funduck/connectrpc-fastify": "^1.0.
|
|
31
|
+
"@funduck/connectrpc-fastify": "^1.0.21",
|
|
32
32
|
"@nestjs/common": "^11.1.12",
|
|
33
33
|
"@nestjs/core": "^11.1.12",
|
|
34
34
|
"@nestjs/platform-fastify": "^11.1.12",
|
|
@@ -1 +0,0 @@
|
|
|
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;oB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AAM,+BAAU,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACjD,CAAC;IAED,qEAAqE;IACrE,KAAK,CAAC,YAAY;QAChB,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC/B,MAAM,IAAI,KAAK,CACb,gKAAgK,CACjK,CAAC;QACJ,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QAEhC,+BAA+B;QAC/B,MAAM,+BAAU,CAAC,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC;IAC3E,CAAC;;AAnFU,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,CAoF5B"}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,4BAIC;AAJD,SAAgB,QAAQ;IACtB,OAAO,CAAC,KAAK,CACX,iFAAiF,CAClF,CAAC;AACJ,CAAC;AAED,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|