@orpc/nest 0.0.0-next.f7af1c4 → 0.0.0-next.f8cfaa5
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 +3 -0
- package/dist/index.mjs +8 -7
- package/package.json +19 -17
package/README.md
CHANGED
|
@@ -17,6 +17,9 @@
|
|
|
17
17
|
<a href="https://discord.gg/TXEbwRBvQn">
|
|
18
18
|
<img alt="Discord" src="https://img.shields.io/discord/1308966753044398161?color=7389D8&label&logo=discord&logoColor=ffffff" />
|
|
19
19
|
</a>
|
|
20
|
+
<a href="https://deepwiki.com/unnoq/orpc">
|
|
21
|
+
<img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki">
|
|
22
|
+
</a>
|
|
20
23
|
</div>
|
|
21
24
|
|
|
22
25
|
<h3 align="center">Typesafe APIs Made Simple 🪄</h3>
|
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,11 +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(req.body ?? fallbackStandardBody());
|
|
161
|
+
const standardRequest = "raw" in req ? StandardServerFastify.toStandardLazyRequest(req, res) : StandardServerNode.toStandardLazyRequest(req, res);
|
|
165
162
|
const standardResponse = await (async () => {
|
|
166
163
|
let isDecoding = false;
|
|
167
164
|
try {
|
|
@@ -182,7 +179,11 @@ let ImplementInterceptor = class {
|
|
|
182
179
|
return codec.encodeError(error);
|
|
183
180
|
}
|
|
184
181
|
})();
|
|
185
|
-
|
|
182
|
+
if ("raw" in res) {
|
|
183
|
+
await StandardServerFastify.sendStandardResponse(res, standardResponse, this.config);
|
|
184
|
+
} else {
|
|
185
|
+
await StandardServerNode.sendStandardResponse(res, standardResponse, this.config);
|
|
186
|
+
}
|
|
186
187
|
})
|
|
187
188
|
);
|
|
188
189
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orpc/nest",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.0-next.
|
|
4
|
+
"version": "0.0.0-next.f8cfaa5",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://orpc.unnoq.com",
|
|
7
7
|
"repository": {
|
|
@@ -39,28 +39,30 @@
|
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@orpc/
|
|
43
|
-
"@orpc/
|
|
44
|
-
"@orpc/openapi": "0.0.0-next.
|
|
45
|
-
"@orpc/openapi-client": "0.0.0-next.
|
|
46
|
-
"@orpc/server": "0.0.0-next.
|
|
47
|
-
"@orpc/shared": "0.0.0-next.
|
|
48
|
-
"@orpc/standard-server": "0.0.0-next.
|
|
49
|
-
"@orpc/standard-server-
|
|
42
|
+
"@orpc/client": "0.0.0-next.f8cfaa5",
|
|
43
|
+
"@orpc/contract": "0.0.0-next.f8cfaa5",
|
|
44
|
+
"@orpc/openapi": "0.0.0-next.f8cfaa5",
|
|
45
|
+
"@orpc/openapi-client": "0.0.0-next.f8cfaa5",
|
|
46
|
+
"@orpc/server": "0.0.0-next.f8cfaa5",
|
|
47
|
+
"@orpc/shared": "0.0.0-next.f8cfaa5",
|
|
48
|
+
"@orpc/standard-server": "0.0.0-next.f8cfaa5",
|
|
49
|
+
"@orpc/standard-server-fastify": "0.0.0-next.f8cfaa5",
|
|
50
|
+
"@orpc/standard-server-node": "0.0.0-next.f8cfaa5"
|
|
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.9",
|
|
55
|
+
"@nestjs/core": "^11.1.9",
|
|
56
|
+
"@nestjs/platform-express": "^11.1.9",
|
|
57
|
+
"@nestjs/platform-fastify": "^11.1.9",
|
|
58
|
+
"@nestjs/testing": "^11.1.9",
|
|
57
59
|
"@ts-rest/core": "^3.52.1",
|
|
58
|
-
"@types/express": "^5.0.
|
|
60
|
+
"@types/express": "^5.0.5",
|
|
59
61
|
"express": "^5.0.0",
|
|
60
|
-
"fastify": "^5.6.
|
|
62
|
+
"fastify": "^5.6.2",
|
|
61
63
|
"rxjs": "^7.8.1",
|
|
62
64
|
"supertest": "^7.1.4",
|
|
63
|
-
"zod": "^4.1.
|
|
65
|
+
"zod": "^4.1.12"
|
|
64
66
|
},
|
|
65
67
|
"scripts": {
|
|
66
68
|
"build": "unbuild",
|