@orpc/nest 1.10.0 → 1.10.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/dist/index.mjs +8 -9
- package/package.json +16 -14
package/dist/index.mjs
CHANGED
|
@@ -7,7 +7,8 @@ import { getRouter, unlazy, isProcedure, createProcedureClient, ORPCError } from
|
|
|
7
7
|
export { ORPCError, implement, onError, onFinish, onStart, onSuccess } from '@orpc/server';
|
|
8
8
|
import { toArray, get } from '@orpc/shared';
|
|
9
9
|
import { flattenHeader } from '@orpc/standard-server';
|
|
10
|
-
import
|
|
10
|
+
import * as StandardServerFastify from '@orpc/standard-server-fastify';
|
|
11
|
+
import * as StandardServerNode from '@orpc/standard-server-node';
|
|
11
12
|
import { mergeMap } from 'rxjs';
|
|
12
13
|
import { toHttpPath } from '@orpc/client/standard';
|
|
13
14
|
|
|
@@ -157,13 +158,7 @@ let ImplementInterceptor = class {
|
|
|
157
158
|
}
|
|
158
159
|
const req = ctx.switchToHttp().getRequest();
|
|
159
160
|
const res = ctx.switchToHttp().getResponse();
|
|
160
|
-
const
|
|
161
|
-
const nodeRes = "raw" in res ? res.raw : res;
|
|
162
|
-
const standardRequest = toStandardLazyRequest(nodeReq, nodeRes);
|
|
163
|
-
const fallbackStandardBody = standardRequest.body.bind(standardRequest);
|
|
164
|
-
standardRequest.body = () => Promise.resolve(
|
|
165
|
-
req.body === void 0 ? fallbackStandardBody() : req.body
|
|
166
|
-
);
|
|
161
|
+
const standardRequest = "raw" in req ? StandardServerFastify.toStandardLazyRequest(req, res) : StandardServerNode.toStandardLazyRequest(req, res);
|
|
167
162
|
const standardResponse = await (async () => {
|
|
168
163
|
let isDecoding = false;
|
|
169
164
|
try {
|
|
@@ -184,7 +179,11 @@ let ImplementInterceptor = class {
|
|
|
184
179
|
return codec.encodeError(error);
|
|
185
180
|
}
|
|
186
181
|
})();
|
|
187
|
-
|
|
182
|
+
if ("raw" in res) {
|
|
183
|
+
await StandardServerFastify.sendStandardResponse(res, standardResponse, this.config);
|
|
184
|
+
} else {
|
|
185
|
+
await StandardServerNode.sendStandardResponse(res, standardResponse, this.config);
|
|
186
|
+
}
|
|
188
187
|
})
|
|
189
188
|
);
|
|
190
189
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orpc/nest",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.10.
|
|
4
|
+
"version": "1.10.2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://orpc.unnoq.com",
|
|
7
7
|
"repository": {
|
|
@@ -39,21 +39,23 @@
|
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@orpc/client": "1.10.
|
|
43
|
-
"@orpc/contract": "1.10.
|
|
44
|
-
"@orpc/openapi": "1.10.
|
|
45
|
-
"@orpc/
|
|
46
|
-
"@orpc/
|
|
47
|
-
"@orpc/
|
|
48
|
-
"@orpc/standard-server": "1.10.
|
|
49
|
-
"@orpc/standard-server-
|
|
42
|
+
"@orpc/client": "1.10.2",
|
|
43
|
+
"@orpc/contract": "1.10.2",
|
|
44
|
+
"@orpc/openapi": "1.10.2",
|
|
45
|
+
"@orpc/openapi-client": "1.10.2",
|
|
46
|
+
"@orpc/shared": "1.10.2",
|
|
47
|
+
"@orpc/server": "1.10.2",
|
|
48
|
+
"@orpc/standard-server": "1.10.2",
|
|
49
|
+
"@orpc/standard-server-fastify": "1.10.2",
|
|
50
|
+
"@orpc/standard-server-node": "1.10.2"
|
|
50
51
|
},
|
|
51
52
|
"devDependencies": {
|
|
52
|
-
"@
|
|
53
|
-
"@nestjs/
|
|
54
|
-
"@nestjs/
|
|
55
|
-
"@nestjs/platform-
|
|
56
|
-
"@nestjs/
|
|
53
|
+
"@fastify/cookie": "^11.0.2",
|
|
54
|
+
"@nestjs/common": "^11.1.7",
|
|
55
|
+
"@nestjs/core": "^11.1.7",
|
|
56
|
+
"@nestjs/platform-express": "^11.1.7",
|
|
57
|
+
"@nestjs/platform-fastify": "^11.1.7",
|
|
58
|
+
"@nestjs/testing": "^11.1.7",
|
|
57
59
|
"@ts-rest/core": "^3.52.1",
|
|
58
60
|
"@types/express": "^5.0.3",
|
|
59
61
|
"express": "^5.0.0",
|