@orpc/server 0.0.0-next.cc4cb21 → 0.0.0-next.d0e429d

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.
@@ -2,7 +2,7 @@ import {
2
2
  RPCCodec,
3
3
  RPCMatcher,
4
4
  StandardHandler
5
- } from "./chunk-EWOWWNDI.js";
5
+ } from "./chunk-NTHCS5CK.js";
6
6
 
7
7
  // src/adapters/fetch/rpc-handler.ts
8
8
  import { toFetchResponse, toStandardRequest } from "@orpc/standard-server-fetch";
@@ -13,15 +13,15 @@ var RPCHandler = class {
13
13
  const codec = options?.codec ?? new RPCCodec();
14
14
  this.standardHandler = new StandardHandler(router, matcher, codec, options);
15
15
  }
16
- async handle(request, ...rest) {
16
+ async handle(request, ...[options]) {
17
17
  const standardRequest = toStandardRequest(request);
18
- const result = await this.standardHandler.handle(standardRequest, ...rest);
18
+ const result = await this.standardHandler.handle(standardRequest, options);
19
19
  if (!result.matched) {
20
20
  return result;
21
21
  }
22
22
  return {
23
23
  matched: true,
24
- response: toFetchResponse(result.response)
24
+ response: toFetchResponse(result.response, options)
25
25
  };
26
26
  }
27
27
  };
@@ -29,4 +29,4 @@ var RPCHandler = class {
29
29
  export {
30
30
  RPCHandler
31
31
  };
32
- //# sourceMappingURL=chunk-XT6IYOIS.js.map
32
+ //# sourceMappingURL=chunk-AJXRPY6I.js.map
@@ -179,4 +179,4 @@ export {
179
179
  RPCCodec,
180
180
  RPCMatcher
181
181
  };
182
- //# sourceMappingURL=chunk-EWOWWNDI.js.map
182
+ //# sourceMappingURL=chunk-NTHCS5CK.js.map
package/dist/fetch.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  RPCHandler
3
- } from "./chunk-XT6IYOIS.js";
4
- import "./chunk-EWOWWNDI.js";
3
+ } from "./chunk-AJXRPY6I.js";
4
+ import "./chunk-NTHCS5CK.js";
5
5
  import "./chunk-MHVECKBC.js";
6
6
  import "./chunk-TXHKQO7N.js";
7
7
  export {
package/dist/hono.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  RPCHandler
3
- } from "./chunk-XT6IYOIS.js";
4
- import "./chunk-EWOWWNDI.js";
3
+ } from "./chunk-AJXRPY6I.js";
4
+ import "./chunk-NTHCS5CK.js";
5
5
  import "./chunk-MHVECKBC.js";
6
6
  import "./chunk-TXHKQO7N.js";
7
7
 
package/dist/next.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  RPCHandler
3
- } from "./chunk-XT6IYOIS.js";
4
- import "./chunk-EWOWWNDI.js";
3
+ } from "./chunk-AJXRPY6I.js";
4
+ import "./chunk-NTHCS5CK.js";
5
5
  import "./chunk-MHVECKBC.js";
6
6
  import "./chunk-TXHKQO7N.js";
7
7
 
package/dist/node.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  RPCCodec,
3
3
  RPCMatcher,
4
4
  StandardHandler
5
- } from "./chunk-EWOWWNDI.js";
5
+ } from "./chunk-NTHCS5CK.js";
6
6
  import "./chunk-MHVECKBC.js";
7
7
  import "./chunk-TXHKQO7N.js";
8
8
 
@@ -15,13 +15,13 @@ var RPCHandler = class {
15
15
  const matcher = options?.matcher ?? new RPCMatcher();
16
16
  this.standardHandler = new StandardHandler(router, matcher, codec, options);
17
17
  }
18
- async handle(req, res, ...rest) {
18
+ async handle(req, res, ...[options]) {
19
19
  const standardRequest = toStandardRequest(req, res);
20
- const result = await this.standardHandler.handle(standardRequest, ...rest);
20
+ const result = await this.standardHandler.handle(standardRequest, options);
21
21
  if (!result.matched) {
22
22
  return { matched: false };
23
23
  }
24
- await sendStandardResponse(res, result.response);
24
+ await sendStandardResponse(res, result.response, options);
25
25
  return { matched: true };
26
26
  }
27
27
  };
@@ -1,4 +1,5 @@
1
1
  import type { MaybeOptionalOptions } from '@orpc/shared';
2
+ import type { ToFetchResponseOptions } from '@orpc/standard-server-fetch';
2
3
  import type { Context } from '../../context';
3
4
  import type { Router } from '../../router';
4
5
  import type { RPCHandlerOptions, StandardHandleOptions } from '../standard';
@@ -6,6 +7,6 @@ import type { FetchHandler, FetchHandleResult } from './types';
6
7
  export declare class RPCHandler<T extends Context> implements FetchHandler<T> {
7
8
  private readonly standardHandler;
8
9
  constructor(router: Router<T, any>, options?: NoInfer<RPCHandlerOptions<T>>);
9
- handle(request: Request, ...rest: MaybeOptionalOptions<StandardHandleOptions<T>>): Promise<FetchHandleResult>;
10
+ handle(request: Request, ...[options]: MaybeOptionalOptions<StandardHandleOptions<T> & ToFetchResponseOptions>): Promise<FetchHandleResult>;
10
11
  }
11
12
  //# sourceMappingURL=rpc-handler.d.ts.map
@@ -1,4 +1,5 @@
1
1
  import type { MaybeOptionalOptions } from '@orpc/shared';
2
+ import type { ToFetchResponseOptions } from '@orpc/standard-server-fetch';
2
3
  import type { Context } from '../../context';
3
4
  import type { StandardHandleOptions } from '../standard';
4
5
  export type FetchHandleResult = {
@@ -9,6 +10,6 @@ export type FetchHandleResult = {
9
10
  response: undefined;
10
11
  };
11
12
  export interface FetchHandler<T extends Context> {
12
- handle(request: Request, ...rest: MaybeOptionalOptions<StandardHandleOptions<T>>): Promise<FetchHandleResult>;
13
+ handle(request: Request, ...rest: MaybeOptionalOptions<StandardHandleOptions<T> & ToFetchResponseOptions>): Promise<FetchHandleResult>;
13
14
  }
14
15
  //# sourceMappingURL=types.d.ts.map
@@ -1,4 +1,5 @@
1
1
  import type { MaybeOptionalOptions } from '@orpc/shared';
2
+ import type { SendStandardResponseOptions } from '@orpc/standard-server-node';
2
3
  import type { Context } from '../../context';
3
4
  import type { Router } from '../../router';
4
5
  import type { RPCHandlerOptions, StandardHandleOptions } from '../standard';
@@ -6,6 +7,6 @@ import type { NodeHttpHandler, NodeHttpHandleResult, NodeHttpRequest, NodeHttpRe
6
7
  export declare class RPCHandler<T extends Context> implements NodeHttpHandler<T> {
7
8
  private readonly standardHandler;
8
9
  constructor(router: Router<T, any>, options?: NoInfer<RPCHandlerOptions<T>>);
9
- handle(req: NodeHttpRequest, res: NodeHttpResponse, ...rest: MaybeOptionalOptions<StandardHandleOptions<T>>): Promise<NodeHttpHandleResult>;
10
+ handle(req: NodeHttpRequest, res: NodeHttpResponse, ...[options]: MaybeOptionalOptions<StandardHandleOptions<T> & SendStandardResponseOptions>): Promise<NodeHttpHandleResult>;
10
11
  }
11
12
  //# sourceMappingURL=rpc-handler.d.ts.map
@@ -1,4 +1,5 @@
1
1
  import type { MaybeOptionalOptions } from '@orpc/shared';
2
+ import type { SendStandardResponseOptions } from '@orpc/standard-server-node';
2
3
  import type { IncomingMessage, ServerResponse } from 'node:http';
3
4
  import type { Http2ServerRequest, Http2ServerResponse } from 'node:http2';
4
5
  import type { Context } from '../../context';
@@ -17,6 +18,6 @@ export type NodeHttpHandleResult = {
17
18
  matched: false;
18
19
  };
19
20
  export interface NodeHttpHandler<T extends Context> {
20
- handle(req: NodeHttpRequest, res: NodeHttpResponse, ...rest: MaybeOptionalOptions<StandardHandleOptions<T>>): Promise<NodeHttpHandleResult>;
21
+ handle(req: NodeHttpRequest, res: NodeHttpResponse, ...rest: MaybeOptionalOptions<StandardHandleOptions<T> & SendStandardResponseOptions>): Promise<NodeHttpHandleResult>;
21
22
  }
22
23
  //# sourceMappingURL=types.d.ts.map
package/dist/standard.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  RPCCodec,
3
3
  RPCMatcher,
4
4
  StandardHandler
5
- } from "./chunk-EWOWWNDI.js";
5
+ } from "./chunk-NTHCS5CK.js";
6
6
  import "./chunk-MHVECKBC.js";
7
7
  import "./chunk-TXHKQO7N.js";
8
8
  export {
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.cc4cb21",
4
+ "version": "0.0.0-next.d0e429d",
5
5
  "license": "MIT",
6
6
  "homepage": "https://orpc.unnoq.com",
7
7
  "repository": {
@@ -63,12 +63,12 @@
63
63
  "next": ">=14.0.0"
64
64
  },
65
65
  "dependencies": {
66
- "@orpc/contract": "0.0.0-next.cc4cb21",
67
- "@orpc/shared": "0.0.0-next.cc4cb21",
68
- "@orpc/standard-server": "0.0.0-next.cc4cb21",
69
- "@orpc/client": "0.0.0-next.cc4cb21",
70
- "@orpc/standard-server-node": "0.0.0-next.cc4cb21",
71
- "@orpc/standard-server-fetch": "0.0.0-next.cc4cb21"
66
+ "@orpc/client": "0.0.0-next.d0e429d",
67
+ "@orpc/contract": "0.0.0-next.d0e429d",
68
+ "@orpc/shared": "0.0.0-next.d0e429d",
69
+ "@orpc/standard-server": "0.0.0-next.d0e429d",
70
+ "@orpc/standard-server-fetch": "0.0.0-next.d0e429d",
71
+ "@orpc/standard-server-node": "0.0.0-next.d0e429d"
72
72
  },
73
73
  "devDependencies": {
74
74
  "light-my-request": "^6.5.1"