@orpc/server 0.0.0-next.7134cf9 → 0.0.0-next.73a87c7

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 CHANGED
@@ -117,6 +117,14 @@ export const createPlanet = os
117
117
  export const router = { planet: { list: listPlanet, find: findPlanet, create: createPlanet } }
118
118
  ```
119
119
 
120
+ ## Sponsors
121
+
122
+ <p align="center">
123
+ <a href="https://cdn.jsdelivr.net/gh/unnoq/unnoq/sponsors.svg">
124
+ <img src='https://cdn.jsdelivr.net/gh/unnoq/unnoq/sponsors.svg'/>
125
+ </a>
126
+ </p>
127
+
120
128
  ## License
121
129
 
122
130
  Distributed under the MIT License. See [LICENSE](https://github.com/unnoq/orpc/blob/main/LICENSE) for more information.
@@ -1,7 +1,7 @@
1
- export { R as RPCHandler } from '../../shared/server.Del5OmaY.mjs';
1
+ export { R as RPCHandler } from '../../shared/server.BOmJF1-i.mjs';
2
2
  import '@orpc/client/standard';
3
3
  import '@orpc/standard-server-fetch';
4
- import '../../shared/server.BY9sDlwl.mjs';
4
+ import '../../shared/server.BzWRcqEr.mjs';
5
5
  import '@orpc/client';
6
6
  import '@orpc/shared';
7
7
  import '../../shared/server.Dba3Iiyp.mjs';
@@ -1,8 +1,8 @@
1
- export { R as RPCHandler } from '../../shared/server.Del5OmaY.mjs';
1
+ export { R as RPCHandler } from '../../shared/server.BOmJF1-i.mjs';
2
2
  import { value } from '@orpc/shared';
3
3
  import '@orpc/client/standard';
4
4
  import '@orpc/standard-server-fetch';
5
- import '../../shared/server.BY9sDlwl.mjs';
5
+ import '../../shared/server.BzWRcqEr.mjs';
6
6
  import '@orpc/client';
7
7
  import '../../shared/server.Dba3Iiyp.mjs';
8
8
  import '../../shared/server.BtxZnWJ9.mjs';
@@ -1,8 +1,8 @@
1
- export { R as RPCHandler } from '../../shared/server.Del5OmaY.mjs';
1
+ export { R as RPCHandler } from '../../shared/server.BOmJF1-i.mjs';
2
2
  import { value } from '@orpc/shared';
3
3
  import '@orpc/client/standard';
4
4
  import '@orpc/standard-server-fetch';
5
- import '../../shared/server.BY9sDlwl.mjs';
5
+ import '../../shared/server.BzWRcqEr.mjs';
6
6
  import '@orpc/client';
7
7
  import '../../shared/server.Dba3Iiyp.mjs';
8
8
  import '../../shared/server.BtxZnWJ9.mjs';
@@ -1,6 +1,6 @@
1
1
  import { StandardRPCJsonSerializer, StandardRPCSerializer } from '@orpc/client/standard';
2
2
  import { toStandardLazyRequest, sendStandardResponse } from '@orpc/standard-server-node';
3
- import { S as StandardHandler, b as StandardRPCMatcher, a as StandardRPCCodec } from '../../shared/server.BY9sDlwl.mjs';
3
+ import { S as StandardHandler, b as StandardRPCMatcher, a as StandardRPCCodec } from '../../shared/server.BzWRcqEr.mjs';
4
4
  import '@orpc/client';
5
5
  import '@orpc/shared';
6
6
  import '../../shared/server.Dba3Iiyp.mjs';
@@ -1,4 +1,4 @@
1
- export { S as StandardHandler, a as StandardRPCCodec, b as StandardRPCMatcher } from '../../shared/server.BY9sDlwl.mjs';
1
+ export { S as StandardHandler, a as StandardRPCCodec, b as StandardRPCMatcher } from '../../shared/server.BzWRcqEr.mjs';
2
2
  import '@orpc/client';
3
3
  import '@orpc/shared';
4
4
  import '../../shared/server.Dba3Iiyp.mjs';
@@ -1,6 +1,6 @@
1
1
  import { StandardRPCJsonSerializer, StandardRPCSerializer } from '@orpc/client/standard';
2
2
  import { toStandardLazyRequest, toFetchResponse } from '@orpc/standard-server-fetch';
3
- import { S as StandardHandler, b as StandardRPCMatcher, a as StandardRPCCodec } from './server.BY9sDlwl.mjs';
3
+ import { S as StandardHandler, b as StandardRPCMatcher, a as StandardRPCCodec } from './server.BzWRcqEr.mjs';
4
4
 
5
5
  class RPCHandler {
6
6
  standardHandler;
@@ -28,24 +28,24 @@ class StandardHandler {
28
28
  return await intercept(
29
29
  this.options.interceptors ?? [],
30
30
  interceptorOptions,
31
- async (interceptorOptions2) => {
32
- const method = interceptorOptions2.request.method;
33
- const url = interceptorOptions2.request.url;
34
- const pathname = `/${trim(url.pathname.replace(interceptorOptions2.prefix ?? "", ""), "/")}`;
31
+ async ({ request: request2, context, prefix }) => {
32
+ const method = request2.method;
33
+ const url = request2.url;
34
+ const pathname = `/${trim(url.pathname.replace(prefix ?? "", ""), "/")}`;
35
35
  const match = await this.matcher.match(method, pathname);
36
36
  if (!match) {
37
37
  return { matched: false, response: void 0 };
38
38
  }
39
39
  const client = createProcedureClient(match.procedure, {
40
- context: interceptorOptions2.context,
40
+ context,
41
41
  path: match.path,
42
42
  interceptors: this.options.clientInterceptors
43
43
  });
44
44
  isDecoding = true;
45
- const input = await this.codec.decode(request, match.params, match.procedure);
45
+ const input = await this.codec.decode(request2, match.params, match.procedure);
46
46
  isDecoding = false;
47
- const lastEventId = Array.isArray(request.headers["last-event-id"]) ? request.headers["last-event-id"].at(-1) : request.headers["last-event-id"];
48
- const output = await client(input, { signal: request.signal, lastEventId });
47
+ const lastEventId = Array.isArray(request2.headers["last-event-id"]) ? request2.headers["last-event-id"].at(-1) : request2.headers["last-event-id"];
48
+ const output = await client(input, { signal: request2.signal, lastEventId });
49
49
  const response = this.codec.encode(output, match.procedure);
50
50
  return {
51
51
  matched: true,
@@ -54,7 +54,7 @@ class StandardHandler {
54
54
  }
55
55
  );
56
56
  } catch (e) {
57
- const error = isDecoding ? new ORPCError("BAD_REQUEST", {
57
+ const error = isDecoding && !(e instanceof ORPCError) ? new ORPCError("BAD_REQUEST", {
58
58
  message: `Malformed request. Ensure the request body is properly formatted and the 'Content-Type' header is set correctly.`,
59
59
  cause: e
60
60
  }) : toORPCError(e);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orpc/server",
3
3
  "type": "module",
4
- "version": "0.0.0-next.7134cf9",
4
+ "version": "0.0.0-next.73a87c7",
5
5
  "license": "MIT",
6
6
  "homepage": "https://orpc.unnoq.com",
7
7
  "repository": {
@@ -58,12 +58,12 @@
58
58
  "next": ">=14.0.0"
59
59
  },
60
60
  "dependencies": {
61
- "@orpc/client": "0.0.0-next.7134cf9",
62
- "@orpc/contract": "0.0.0-next.7134cf9",
63
- "@orpc/shared": "0.0.0-next.7134cf9",
64
- "@orpc/standard-server": "0.0.0-next.7134cf9",
65
- "@orpc/standard-server-node": "0.0.0-next.7134cf9",
66
- "@orpc/standard-server-fetch": "0.0.0-next.7134cf9"
61
+ "@orpc/client": "0.0.0-next.73a87c7",
62
+ "@orpc/contract": "0.0.0-next.73a87c7",
63
+ "@orpc/standard-server": "0.0.0-next.73a87c7",
64
+ "@orpc/shared": "0.0.0-next.73a87c7",
65
+ "@orpc/standard-server-fetch": "0.0.0-next.73a87c7",
66
+ "@orpc/standard-server-node": "0.0.0-next.73a87c7"
67
67
  },
68
68
  "devDependencies": {
69
69
  "light-my-request": "^6.5.1"