@orpc/nest 1.10.1 → 1.10.3

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.
Files changed (2) hide show
  1. package/dist/index.mjs +8 -9
  2. package/package.json +17 -15
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 { toStandardLazyRequest, sendStandardResponse } from '@orpc/standard-server-node';
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 nodeReq = "raw" in req ? req.raw : req;
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
- await sendStandardResponse(nodeRes, standardResponse, this.config);
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.1",
4
+ "version": "1.10.3",
5
5
  "license": "MIT",
6
6
  "homepage": "https://orpc.unnoq.com",
7
7
  "repository": {
@@ -39,23 +39,25 @@
39
39
  }
40
40
  },
41
41
  "dependencies": {
42
- "@orpc/client": "1.10.1",
43
- "@orpc/contract": "1.10.1",
44
- "@orpc/openapi": "1.10.1",
45
- "@orpc/openapi-client": "1.10.1",
46
- "@orpc/standard-server": "1.10.1",
47
- "@orpc/standard-server-node": "1.10.1",
48
- "@orpc/shared": "1.10.1",
49
- "@orpc/server": "1.10.1"
42
+ "@orpc/client": "1.10.3",
43
+ "@orpc/contract": "1.10.3",
44
+ "@orpc/openapi-client": "1.10.3",
45
+ "@orpc/openapi": "1.10.3",
46
+ "@orpc/server": "1.10.3",
47
+ "@orpc/shared": "1.10.3",
48
+ "@orpc/standard-server": "1.10.3",
49
+ "@orpc/standard-server-fastify": "1.10.3",
50
+ "@orpc/standard-server-node": "1.10.3"
50
51
  },
51
52
  "devDependencies": {
52
- "@nestjs/common": "^11.1.7",
53
- "@nestjs/core": "^11.1.7",
54
- "@nestjs/platform-express": "^11.1.7",
55
- "@nestjs/platform-fastify": "^11.1.7",
56
- "@nestjs/testing": "^11.1.7",
53
+ "@fastify/cookie": "^11.0.2",
54
+ "@nestjs/common": "^11.1.8",
55
+ "@nestjs/core": "^11.1.8",
56
+ "@nestjs/platform-express": "^11.1.8",
57
+ "@nestjs/platform-fastify": "^11.1.8",
58
+ "@nestjs/testing": "^11.1.8",
57
59
  "@ts-rest/core": "^3.52.1",
58
- "@types/express": "^5.0.3",
60
+ "@types/express": "^5.0.5",
59
61
  "express": "^5.0.0",
60
62
  "fastify": "^5.6.1",
61
63
  "rxjs": "^7.8.1",