@orpc/server 0.0.0-next.fd13879 → 0.0.0-next.fd1ee2a

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 (59) hide show
  1. package/README.md +6 -8
  2. package/dist/adapters/aws-lambda/index.d.mts +46 -0
  3. package/dist/adapters/aws-lambda/index.d.ts +46 -0
  4. package/dist/adapters/aws-lambda/index.mjs +41 -0
  5. package/dist/adapters/bun-ws/index.d.mts +12 -11
  6. package/dist/adapters/bun-ws/index.d.ts +12 -11
  7. package/dist/adapters/bun-ws/index.mjs +16 -20
  8. package/dist/adapters/crossws/index.d.mts +8 -5
  9. package/dist/adapters/crossws/index.d.ts +8 -5
  10. package/dist/adapters/crossws/index.mjs +13 -17
  11. package/dist/adapters/fetch/index.d.mts +7 -6
  12. package/dist/adapters/fetch/index.d.ts +7 -6
  13. package/dist/adapters/fetch/index.mjs +3 -3
  14. package/dist/adapters/message-port/index.d.mts +31 -0
  15. package/dist/adapters/message-port/index.d.ts +31 -0
  16. package/dist/adapters/message-port/index.mjs +41 -0
  17. package/dist/adapters/node/index.d.mts +7 -6
  18. package/dist/adapters/node/index.d.ts +7 -6
  19. package/dist/adapters/node/index.mjs +3 -3
  20. package/dist/adapters/standard/index.d.mts +8 -13
  21. package/dist/adapters/standard/index.d.ts +8 -13
  22. package/dist/adapters/standard/index.mjs +3 -2
  23. package/dist/adapters/standard-peer/index.d.mts +14 -0
  24. package/dist/adapters/standard-peer/index.d.ts +14 -0
  25. package/dist/adapters/standard-peer/index.mjs +7 -0
  26. package/dist/adapters/websocket/index.d.mts +36 -9
  27. package/dist/adapters/websocket/index.d.ts +36 -9
  28. package/dist/adapters/websocket/index.mjs +51 -20
  29. package/dist/adapters/ws/index.d.mts +11 -8
  30. package/dist/adapters/ws/index.d.ts +11 -8
  31. package/dist/adapters/ws/index.mjs +15 -14
  32. package/dist/hibernation/index.d.mts +44 -0
  33. package/dist/hibernation/index.d.ts +44 -0
  34. package/dist/hibernation/index.mjs +65 -0
  35. package/dist/index.d.mts +21 -47
  36. package/dist/index.d.ts +21 -47
  37. package/dist/index.mjs +23 -8
  38. package/dist/plugins/index.d.mts +13 -13
  39. package/dist/plugins/index.d.ts +13 -13
  40. package/dist/plugins/index.mjs +14 -6
  41. package/dist/shared/server.C6Q5sqYw.mjs +20 -0
  42. package/dist/shared/server.CC8z0B3U.d.mts +32 -0
  43. package/dist/shared/{server.4FnxLwwr.mjs → server.CIL9uKTN.mjs} +13 -5
  44. package/dist/shared/server.CNZgPgce.d.ts +12 -0
  45. package/dist/shared/server.Cu-7se50.d.mts +12 -0
  46. package/dist/shared/server.Cwq7K86l.d.mts +42 -0
  47. package/dist/shared/{server.YZzrREz9.d.ts → server.DHgXKx3q.d.mts} +8 -8
  48. package/dist/shared/server.DOwaI1le.d.ts +32 -0
  49. package/dist/shared/{server.eWLxY3lq.d.mts → server.DVBSOxWU.d.ts} +8 -8
  50. package/dist/shared/{server.BVwwTHyO.mjs → server.DZ5BIITo.mjs} +1 -1
  51. package/dist/shared/{server.DG7Tamti.mjs → server.NeumLVdS.mjs} +13 -10
  52. package/dist/shared/server.a_VzWVCm.d.ts +42 -0
  53. package/dist/shared/{server.DPWk5pjW.d.mts → server.wMv480px.d.mts} +7 -7
  54. package/dist/shared/{server.DPWk5pjW.d.ts → server.wMv480px.d.ts} +7 -7
  55. package/package.json +33 -12
  56. package/dist/shared/server.BRoxSiSC.d.mts +0 -12
  57. package/dist/shared/server.BjiJH9Vo.d.ts +0 -10
  58. package/dist/shared/server.Cy1vfSiG.d.ts +0 -12
  59. package/dist/shared/server.QUe9N8P4.d.mts +0 -10
@@ -1,6 +1,6 @@
1
- import { value, isAsyncIteratorObject } from '@orpc/shared';
2
- import { parseBatchRequest, toBatchResponse } from '@orpc/standard-server/batch';
1
+ import { value, isAsyncIteratorObject, clone } from '@orpc/shared';
3
2
  import { flattenHeader } from '@orpc/standard-server';
3
+ import { parseBatchRequest, toBatchResponse } from '@orpc/standard-server/batch';
4
4
  import { ORPCError } from '@orpc/client';
5
5
  export { S as StrictGetMethodPlugin } from '../shared/server.BW-nUGgA.mjs';
6
6
  import '@orpc/contract';
@@ -26,7 +26,8 @@ class BatchHandlerPlugin {
26
26
  init(options) {
27
27
  options.rootInterceptors ??= [];
28
28
  options.rootInterceptors.unshift(async (options2) => {
29
- if (options2.request.headers["x-orpc-batch"] !== "1") {
29
+ const xHeader = flattenHeader(options2.request.headers["x-orpc-batch"]);
30
+ if (xHeader === void 0) {
30
31
  return options2.next();
31
32
  }
32
33
  let isParsing = false;
@@ -69,9 +70,10 @@ class BatchHandlerPlugin {
69
70
  await Promise.race(responses);
70
71
  const status = await value(this.successStatus, responses, options2);
71
72
  const headers = await value(this.headers, responses, options2);
72
- const response = toBatchResponse({
73
+ const response = await toBatchResponse({
73
74
  status,
74
75
  headers,
76
+ mode: xHeader === "buffered" ? "buffered" : "streaming",
75
77
  body: async function* () {
76
78
  const promises = [...responses];
77
79
  while (true) {
@@ -190,7 +192,7 @@ class ResponseHeadersPlugin {
190
192
  if (!result.matched) {
191
193
  return result;
192
194
  }
193
- const responseHeaders = result.response.headers;
195
+ const responseHeaders = clone(result.response.headers);
194
196
  for (const [key, value] of resHeaders) {
195
197
  if (Array.isArray(responseHeaders[key])) {
196
198
  responseHeaders[key].push(value);
@@ -200,7 +202,13 @@ class ResponseHeadersPlugin {
200
202
  responseHeaders[key] = value;
201
203
  }
202
204
  }
203
- return result;
205
+ return {
206
+ ...result,
207
+ response: {
208
+ ...result.response,
209
+ headers: responseHeaders
210
+ }
211
+ };
204
212
  });
205
213
  }
206
214
  }
@@ -0,0 +1,20 @@
1
+ import '@orpc/client';
2
+ import '@orpc/shared';
3
+ import '@orpc/standard-server';
4
+ import '@orpc/contract';
5
+ import '@orpc/client/standard';
6
+ import { r as resolveFriendlyStandardHandleOptions } from './server.DZ5BIITo.mjs';
7
+
8
+ async function handleStandardServerPeerMessage(handler, peer, message, options) {
9
+ const [id, request] = await peer.message(message);
10
+ if (!request) {
11
+ return;
12
+ }
13
+ const { response } = await handler.handle(
14
+ { ...request, body: () => Promise.resolve(request.body) },
15
+ resolveFriendlyStandardHandleOptions(options)
16
+ );
17
+ await peer.response(id, response ?? { status: 404, headers: {}, body: "No procedure matched" });
18
+ }
19
+
20
+ export { handleStandardServerPeerMessage as h };
@@ -0,0 +1,32 @@
1
+ import { StandardRPCJsonSerializerOptions } from '@orpc/client/standard';
2
+ import { b as AnyRouter, C as Context, R as Router } from './server.wMv480px.mjs';
3
+ import { i as StandardMatcher, h as StandardMatchResult, e as StandardHandlerOptions, f as StandardHandler } from './server.DHgXKx3q.mjs';
4
+ import { HTTPPath } from '@orpc/client';
5
+ import { Value } from '@orpc/shared';
6
+ import { T as TraverseContractProcedureCallbackOptions } from './server.Cwq7K86l.mjs';
7
+
8
+ interface StandardRPCMatcherOptions {
9
+ /**
10
+ * Filter procedures. Return `false` to exclude a procedure from matching.
11
+ *
12
+ * @default true
13
+ */
14
+ filter?: Value<boolean, [options: TraverseContractProcedureCallbackOptions]>;
15
+ }
16
+ declare class StandardRPCMatcher implements StandardMatcher {
17
+ private readonly filter;
18
+ private readonly tree;
19
+ private pendingRouters;
20
+ constructor(options?: StandardRPCMatcherOptions);
21
+ init(router: AnyRouter, path?: readonly string[]): void;
22
+ match(_method: string, pathname: HTTPPath): Promise<StandardMatchResult>;
23
+ }
24
+
25
+ interface StandardRPCHandlerOptions<T extends Context> extends StandardHandlerOptions<T>, StandardRPCJsonSerializerOptions, StandardRPCMatcherOptions {
26
+ }
27
+ declare class StandardRPCHandler<T extends Context> extends StandardHandler<T> {
28
+ constructor(router: Router<any, T>, options?: StandardRPCHandlerOptions<T>);
29
+ }
30
+
31
+ export { StandardRPCHandler as a, StandardRPCMatcher as c };
32
+ export type { StandardRPCHandlerOptions as S, StandardRPCMatcherOptions as b };
@@ -1,8 +1,8 @@
1
1
  import { toHttpPath, StandardRPCJsonSerializer, StandardRPCSerializer } from '@orpc/client/standard';
2
2
  import { ORPCError, toORPCError } from '@orpc/client';
3
- import { toArray, intercept, parseEmptyableJSON } from '@orpc/shared';
3
+ import { toArray, intercept, parseEmptyableJSON, NullProtoObj, value } from '@orpc/shared';
4
4
  import { flattenHeader } from '@orpc/standard-server';
5
- import { c as createProcedureClient, t as traverseContractProcedures, i as isProcedure, u as unlazy, g as getRouter, a as createContractedProcedure } from './server.DG7Tamti.mjs';
5
+ import { c as createProcedureClient, t as traverseContractProcedures, i as isProcedure, u as unlazy, g as getRouter, a as createContractedProcedure } from './server.NeumLVdS.mjs';
6
6
 
7
7
  class CompositeStandardHandlerPlugin {
8
8
  plugins;
@@ -112,10 +112,18 @@ class StandardRPCCodec {
112
112
  }
113
113
 
114
114
  class StandardRPCMatcher {
115
- tree = {};
115
+ filter;
116
+ tree = new NullProtoObj();
116
117
  pendingRouters = [];
118
+ constructor(options = {}) {
119
+ this.filter = options.filter ?? true;
120
+ }
117
121
  init(router, path = []) {
118
- const laziedOptions = traverseContractProcedures({ router, path }, ({ path: path2, contract }) => {
122
+ const laziedOptions = traverseContractProcedures({ router, path }, (traverseOptions) => {
123
+ if (!value(this.filter, traverseOptions)) {
124
+ return;
125
+ }
126
+ const { path: path2, contract } = traverseOptions;
119
127
  const httpPath = toHttpPath(path2);
120
128
  if (isProcedure(contract)) {
121
129
  this.tree[httpPath] = {
@@ -177,7 +185,7 @@ class StandardRPCHandler extends StandardHandler {
177
185
  constructor(router, options = {}) {
178
186
  const jsonSerializer = new StandardRPCJsonSerializer(options);
179
187
  const serializer = new StandardRPCSerializer(jsonSerializer);
180
- const matcher = new StandardRPCMatcher();
188
+ const matcher = new StandardRPCMatcher(options);
181
189
  const codec = new StandardRPCCodec(serializer);
182
190
  super(router, matcher, codec, options);
183
191
  }
@@ -0,0 +1,12 @@
1
+ import { C as Context } from './server.wMv480px.js';
2
+ import { b as StandardHandleOptions } from './server.DVBSOxWU.js';
3
+
4
+ type FriendlyStandardHandleOptions<T extends Context> = Omit<StandardHandleOptions<T>, 'context'> & (Record<never, never> extends T ? {
5
+ context?: T;
6
+ } : {
7
+ context: T;
8
+ });
9
+ declare function resolveFriendlyStandardHandleOptions<T extends Context>(options: FriendlyStandardHandleOptions<T>): StandardHandleOptions<T>;
10
+
11
+ export { resolveFriendlyStandardHandleOptions as r };
12
+ export type { FriendlyStandardHandleOptions as F };
@@ -0,0 +1,12 @@
1
+ import { C as Context } from './server.wMv480px.mjs';
2
+ import { b as StandardHandleOptions } from './server.DHgXKx3q.mjs';
3
+
4
+ type FriendlyStandardHandleOptions<T extends Context> = Omit<StandardHandleOptions<T>, 'context'> & (Record<never, never> extends T ? {
5
+ context?: T;
6
+ } : {
7
+ context: T;
8
+ });
9
+ declare function resolveFriendlyStandardHandleOptions<T extends Context>(options: FriendlyStandardHandleOptions<T>): StandardHandleOptions<T>;
10
+
11
+ export { resolveFriendlyStandardHandleOptions as r };
12
+ export type { FriendlyStandardHandleOptions as F };
@@ -0,0 +1,42 @@
1
+ import { ErrorMap, EnhanceRouteOptions, MergedErrorMap, AnyContractRouter, AnyContractProcedure } from '@orpc/contract';
2
+ import { a as AnyMiddleware, L as Lazyable, b as AnyRouter, C as Context, c as Lazy, A as AnyProcedure, P as Procedure, M as MergedInitialContext } from './server.wMv480px.mjs';
3
+
4
+ declare function getRouter<T extends Lazyable<AnyRouter | undefined>>(router: T, path: readonly string[]): T extends Lazy<any> ? Lazy<AnyRouter | undefined> : Lazyable<AnyRouter | undefined>;
5
+ type AccessibleLazyRouter<T extends Lazyable<AnyRouter | undefined>> = T extends Lazy<infer U extends AnyRouter | undefined | Lazy<AnyRouter | undefined>> ? AccessibleLazyRouter<U> : T extends AnyProcedure | undefined ? Lazy<T> : Lazy<T> & {
6
+ [K in keyof T]: T[K] extends Lazyable<AnyRouter> ? AccessibleLazyRouter<T[K]> : never;
7
+ };
8
+ declare function createAccessibleLazyRouter<T extends Lazy<AnyRouter | undefined>>(lazied: T): AccessibleLazyRouter<T>;
9
+ type EnhancedRouter<T extends Lazyable<AnyRouter>, TInitialContext extends Context, TCurrentContext extends Context, TErrorMap extends ErrorMap> = T extends Lazy<infer U extends AnyRouter> ? AccessibleLazyRouter<EnhancedRouter<U, TInitialContext, TCurrentContext, TErrorMap>> : T extends Procedure<infer UInitialContext, infer UCurrentContext, infer UInputSchema, infer UOutputSchema, infer UErrorMap, infer UMeta> ? Procedure<MergedInitialContext<TInitialContext, UInitialContext, TCurrentContext>, UCurrentContext, UInputSchema, UOutputSchema, MergedErrorMap<TErrorMap, UErrorMap>, UMeta> : {
10
+ [K in keyof T]: T[K] extends Lazyable<AnyRouter> ? EnhancedRouter<T[K], TInitialContext, TCurrentContext, TErrorMap> : never;
11
+ };
12
+ interface EnhanceRouterOptions<TErrorMap extends ErrorMap> extends EnhanceRouteOptions {
13
+ middlewares: readonly AnyMiddleware[];
14
+ errorMap: TErrorMap;
15
+ dedupeLeadingMiddlewares: boolean;
16
+ }
17
+ declare function enhanceRouter<T extends Lazyable<AnyRouter>, TInitialContext extends Context, TCurrentContext extends Context, TErrorMap extends ErrorMap>(router: T, options: EnhanceRouterOptions<TErrorMap>): EnhancedRouter<T, TInitialContext, TCurrentContext, TErrorMap>;
18
+ interface TraverseContractProceduresOptions {
19
+ router: AnyContractRouter | AnyRouter;
20
+ path: readonly string[];
21
+ }
22
+ interface TraverseContractProcedureCallbackOptions {
23
+ contract: AnyContractProcedure | AnyProcedure;
24
+ path: readonly string[];
25
+ }
26
+ /**
27
+ * @deprecated Use `TraverseContractProcedureCallbackOptions` instead.
28
+ */
29
+ type ContractProcedureCallbackOptions = TraverseContractProcedureCallbackOptions;
30
+ interface LazyTraverseContractProceduresOptions {
31
+ router: Lazy<AnyRouter>;
32
+ path: readonly string[];
33
+ }
34
+ declare function traverseContractProcedures(options: TraverseContractProceduresOptions, callback: (options: TraverseContractProcedureCallbackOptions) => void, lazyOptions?: LazyTraverseContractProceduresOptions[]): LazyTraverseContractProceduresOptions[];
35
+ declare function resolveContractProcedures(options: TraverseContractProceduresOptions, callback: (options: TraverseContractProcedureCallbackOptions) => void): Promise<void>;
36
+ type UnlaziedRouter<T extends AnyRouter> = T extends AnyProcedure ? T : {
37
+ [K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? UnlaziedRouter<U> : never;
38
+ };
39
+ declare function unlazyRouter<T extends AnyRouter>(router: T): Promise<UnlaziedRouter<T>>;
40
+
41
+ export { createAccessibleLazyRouter as c, enhanceRouter as e, getRouter as g, resolveContractProcedures as r, traverseContractProcedures as t, unlazyRouter as u };
42
+ export type { AccessibleLazyRouter as A, ContractProcedureCallbackOptions as C, EnhanceRouterOptions as E, LazyTraverseContractProceduresOptions as L, TraverseContractProcedureCallbackOptions as T, UnlaziedRouter as U, EnhancedRouter as a, TraverseContractProceduresOptions as b };
@@ -1,8 +1,8 @@
1
1
  import { HTTPPath, ORPCError } from '@orpc/client';
2
- import { Meta, InferSchemaOutput, AnySchema, ErrorFromErrorMap } from '@orpc/contract';
3
- import { Interceptor, ThrowableError } from '@orpc/shared';
2
+ import { Meta } from '@orpc/contract';
3
+ import { Interceptor } from '@orpc/shared';
4
4
  import { StandardResponse, StandardLazyRequest } from '@orpc/standard-server';
5
- import { C as Context, R as Router, f as AnyRouter, h as AnyProcedure, F as ProcedureClientInterceptorOptions } from './server.DPWk5pjW.js';
5
+ import { C as Context, R as Router, b as AnyRouter, A as AnyProcedure, d as ProcedureClientInterceptorOptions } from './server.wMv480px.mjs';
6
6
 
7
7
  interface StandardHandlerPlugin<T extends Context> {
8
8
  order?: number;
@@ -49,16 +49,16 @@ interface StandardHandlerOptions<TContext extends Context> {
49
49
  /**
50
50
  * Interceptors at the request level, helpful when you want catch errors
51
51
  */
52
- interceptors?: Interceptor<StandardHandlerInterceptorOptions<TContext>, StandardHandleResult, ThrowableError>[];
52
+ interceptors?: Interceptor<StandardHandlerInterceptorOptions<TContext>, Promise<StandardHandleResult>>[];
53
53
  /**
54
54
  * Interceptors at the root level, helpful when you want override the request/response
55
55
  */
56
- rootInterceptors?: Interceptor<StandardHandlerInterceptorOptions<TContext>, StandardHandleResult, ThrowableError>[];
56
+ rootInterceptors?: Interceptor<StandardHandlerInterceptorOptions<TContext>, Promise<StandardHandleResult>>[];
57
57
  /**
58
58
  *
59
59
  * Interceptors for procedure client.
60
60
  */
61
- clientInterceptors?: Interceptor<ProcedureClientInterceptorOptions<TContext, Record<never, never>, Meta>, InferSchemaOutput<AnySchema>, ErrorFromErrorMap<Record<never, never>>>[];
61
+ clientInterceptors?: Interceptor<ProcedureClientInterceptorOptions<TContext, Record<never, never>, Meta>, Promise<unknown>>[];
62
62
  }
63
63
  declare class StandardHandler<T extends Context> {
64
64
  private readonly matcher;
@@ -70,5 +70,5 @@ declare class StandardHandler<T extends Context> {
70
70
  handle(request: StandardLazyRequest, options: StandardHandleOptions<T>): Promise<StandardHandleResult>;
71
71
  }
72
72
 
73
- export { CompositeStandardHandlerPlugin as C, StandardHandler as i };
74
- export type { StandardHandlerInterceptorOptions as S, StandardHandlerPlugin as a, StandardHandlerOptions as b, StandardCodec as c, StandardParams as d, StandardMatcher as e, StandardMatchResult as f, StandardHandleOptions as g, StandardHandleResult as h };
73
+ export { CompositeStandardHandlerPlugin as C, StandardHandler as f };
74
+ export type { StandardCodec as S, StandardParams as a, StandardHandleOptions as b, StandardHandleResult as c, StandardHandlerInterceptorOptions as d, StandardHandlerOptions as e, StandardHandlerPlugin as g, StandardMatchResult as h, StandardMatcher as i };
@@ -0,0 +1,32 @@
1
+ import { StandardRPCJsonSerializerOptions } from '@orpc/client/standard';
2
+ import { b as AnyRouter, C as Context, R as Router } from './server.wMv480px.js';
3
+ import { i as StandardMatcher, h as StandardMatchResult, e as StandardHandlerOptions, f as StandardHandler } from './server.DVBSOxWU.js';
4
+ import { HTTPPath } from '@orpc/client';
5
+ import { Value } from '@orpc/shared';
6
+ import { T as TraverseContractProcedureCallbackOptions } from './server.a_VzWVCm.js';
7
+
8
+ interface StandardRPCMatcherOptions {
9
+ /**
10
+ * Filter procedures. Return `false` to exclude a procedure from matching.
11
+ *
12
+ * @default true
13
+ */
14
+ filter?: Value<boolean, [options: TraverseContractProcedureCallbackOptions]>;
15
+ }
16
+ declare class StandardRPCMatcher implements StandardMatcher {
17
+ private readonly filter;
18
+ private readonly tree;
19
+ private pendingRouters;
20
+ constructor(options?: StandardRPCMatcherOptions);
21
+ init(router: AnyRouter, path?: readonly string[]): void;
22
+ match(_method: string, pathname: HTTPPath): Promise<StandardMatchResult>;
23
+ }
24
+
25
+ interface StandardRPCHandlerOptions<T extends Context> extends StandardHandlerOptions<T>, StandardRPCJsonSerializerOptions, StandardRPCMatcherOptions {
26
+ }
27
+ declare class StandardRPCHandler<T extends Context> extends StandardHandler<T> {
28
+ constructor(router: Router<any, T>, options?: StandardRPCHandlerOptions<T>);
29
+ }
30
+
31
+ export { StandardRPCHandler as a, StandardRPCMatcher as c };
32
+ export type { StandardRPCHandlerOptions as S, StandardRPCMatcherOptions as b };
@@ -1,8 +1,8 @@
1
1
  import { HTTPPath, ORPCError } from '@orpc/client';
2
- import { Meta, InferSchemaOutput, AnySchema, ErrorFromErrorMap } from '@orpc/contract';
3
- import { Interceptor, ThrowableError } from '@orpc/shared';
2
+ import { Meta } from '@orpc/contract';
3
+ import { Interceptor } from '@orpc/shared';
4
4
  import { StandardResponse, StandardLazyRequest } from '@orpc/standard-server';
5
- import { C as Context, R as Router, f as AnyRouter, h as AnyProcedure, F as ProcedureClientInterceptorOptions } from './server.DPWk5pjW.mjs';
5
+ import { C as Context, R as Router, b as AnyRouter, A as AnyProcedure, d as ProcedureClientInterceptorOptions } from './server.wMv480px.js';
6
6
 
7
7
  interface StandardHandlerPlugin<T extends Context> {
8
8
  order?: number;
@@ -49,16 +49,16 @@ interface StandardHandlerOptions<TContext extends Context> {
49
49
  /**
50
50
  * Interceptors at the request level, helpful when you want catch errors
51
51
  */
52
- interceptors?: Interceptor<StandardHandlerInterceptorOptions<TContext>, StandardHandleResult, ThrowableError>[];
52
+ interceptors?: Interceptor<StandardHandlerInterceptorOptions<TContext>, Promise<StandardHandleResult>>[];
53
53
  /**
54
54
  * Interceptors at the root level, helpful when you want override the request/response
55
55
  */
56
- rootInterceptors?: Interceptor<StandardHandlerInterceptorOptions<TContext>, StandardHandleResult, ThrowableError>[];
56
+ rootInterceptors?: Interceptor<StandardHandlerInterceptorOptions<TContext>, Promise<StandardHandleResult>>[];
57
57
  /**
58
58
  *
59
59
  * Interceptors for procedure client.
60
60
  */
61
- clientInterceptors?: Interceptor<ProcedureClientInterceptorOptions<TContext, Record<never, never>, Meta>, InferSchemaOutput<AnySchema>, ErrorFromErrorMap<Record<never, never>>>[];
61
+ clientInterceptors?: Interceptor<ProcedureClientInterceptorOptions<TContext, Record<never, never>, Meta>, Promise<unknown>>[];
62
62
  }
63
63
  declare class StandardHandler<T extends Context> {
64
64
  private readonly matcher;
@@ -70,5 +70,5 @@ declare class StandardHandler<T extends Context> {
70
70
  handle(request: StandardLazyRequest, options: StandardHandleOptions<T>): Promise<StandardHandleResult>;
71
71
  }
72
72
 
73
- export { CompositeStandardHandlerPlugin as C, StandardHandler as i };
74
- export type { StandardHandlerInterceptorOptions as S, StandardHandlerPlugin as a, StandardHandlerOptions as b, StandardCodec as c, StandardParams as d, StandardMatcher as e, StandardMatchResult as f, StandardHandleOptions as g, StandardHandleResult as h };
73
+ export { CompositeStandardHandlerPlugin as C, StandardHandler as f };
74
+ export type { StandardCodec as S, StandardParams as a, StandardHandleOptions as b, StandardHandleResult as c, StandardHandlerInterceptorOptions as d, StandardHandlerOptions as e, StandardHandlerPlugin as g, StandardMatchResult as h, StandardMatcher as i };
@@ -1,7 +1,7 @@
1
1
  function resolveFriendlyStandardHandleOptions(options) {
2
2
  return {
3
3
  ...options,
4
- context: options?.context ?? {}
4
+ context: options.context ?? {}
5
5
  // Context only optional if all fields are optional
6
6
  };
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import { isContractProcedure, ValidationError, mergePrefix, mergeErrorMap, enhanceRoute } from '@orpc/contract';
2
+ import { resolveMaybeOptionalOptions, toArray, value, intercept } from '@orpc/shared';
2
3
  import { fallbackORPCErrorStatus, ORPCError } from '@orpc/client';
3
- import { value, intercept } from '@orpc/shared';
4
4
 
5
5
  const LAZY_SYMBOL = Symbol("ORPC_LAZY_SYMBOL");
6
6
  function lazy(loader, meta = {}) {
@@ -71,14 +71,15 @@ function createORPCErrorConstructorMap(errors) {
71
71
  if (typeof code !== "string") {
72
72
  return Reflect.get(target, code);
73
73
  }
74
- const item = (...[options]) => {
74
+ const item = (...rest) => {
75
+ const options = resolveMaybeOptionalOptions(rest);
75
76
  const config = errors[code];
76
77
  return new ORPCError(code, {
77
78
  defined: Boolean(config),
78
79
  status: config?.status,
79
- message: options?.message ?? config?.message,
80
- data: options?.data,
81
- cause: options?.cause
80
+ message: options.message ?? config?.message,
81
+ data: options.data,
82
+ cause: options.cause
82
83
  });
83
84
  };
84
85
  return item;
@@ -106,16 +107,17 @@ function middlewareOutputFn(output) {
106
107
  return { output, context: {} };
107
108
  }
108
109
 
109
- function createProcedureClient(lazyableProcedure, ...[options]) {
110
+ function createProcedureClient(lazyableProcedure, ...rest) {
111
+ const options = resolveMaybeOptionalOptions(rest);
110
112
  return async (...[input, callerOptions]) => {
111
- const path = options?.path ?? [];
113
+ const path = toArray(options.path);
112
114
  const { default: procedure } = await unlazy(lazyableProcedure);
113
115
  const clientContext = callerOptions?.context ?? {};
114
- const context = await value(options?.context ?? {}, clientContext);
116
+ const context = await value(options.context ?? {}, clientContext);
115
117
  const errors = createORPCErrorConstructorMap(procedure["~orpc"].errorMap);
116
118
  try {
117
119
  return await intercept(
118
- options?.interceptors ?? [],
120
+ toArray(options.interceptors),
119
121
  {
120
122
  context,
121
123
  input,
@@ -361,7 +363,8 @@ function createContractedProcedure(procedure, contract) {
361
363
  });
362
364
  }
363
365
  function call(procedure, input, ...rest) {
364
- return createProcedureClient(procedure, ...rest)(input);
366
+ const options = resolveMaybeOptionalOptions(rest);
367
+ return createProcedureClient(procedure, options)(input, options);
365
368
  }
366
369
 
367
370
  export { LAZY_SYMBOL as L, Procedure as P, createContractedProcedure as a, addMiddleware as b, createProcedureClient as c, isLazy as d, enhanceRouter as e, createAssertedLazyProcedure as f, getRouter as g, createORPCErrorConstructorMap as h, isProcedure as i, getLazyMeta as j, middlewareOutputFn as k, lazy as l, mergeCurrentContext as m, isStartWithMiddlewares as n, mergeMiddlewares as o, call as p, getHiddenRouterContract as q, createAccessibleLazyRouter as r, setHiddenRouterContract as s, traverseContractProcedures as t, unlazy as u, validateORPCError as v, resolveContractProcedures as w, unlazyRouter as x };
@@ -0,0 +1,42 @@
1
+ import { ErrorMap, EnhanceRouteOptions, MergedErrorMap, AnyContractRouter, AnyContractProcedure } from '@orpc/contract';
2
+ import { a as AnyMiddleware, L as Lazyable, b as AnyRouter, C as Context, c as Lazy, A as AnyProcedure, P as Procedure, M as MergedInitialContext } from './server.wMv480px.js';
3
+
4
+ declare function getRouter<T extends Lazyable<AnyRouter | undefined>>(router: T, path: readonly string[]): T extends Lazy<any> ? Lazy<AnyRouter | undefined> : Lazyable<AnyRouter | undefined>;
5
+ type AccessibleLazyRouter<T extends Lazyable<AnyRouter | undefined>> = T extends Lazy<infer U extends AnyRouter | undefined | Lazy<AnyRouter | undefined>> ? AccessibleLazyRouter<U> : T extends AnyProcedure | undefined ? Lazy<T> : Lazy<T> & {
6
+ [K in keyof T]: T[K] extends Lazyable<AnyRouter> ? AccessibleLazyRouter<T[K]> : never;
7
+ };
8
+ declare function createAccessibleLazyRouter<T extends Lazy<AnyRouter | undefined>>(lazied: T): AccessibleLazyRouter<T>;
9
+ type EnhancedRouter<T extends Lazyable<AnyRouter>, TInitialContext extends Context, TCurrentContext extends Context, TErrorMap extends ErrorMap> = T extends Lazy<infer U extends AnyRouter> ? AccessibleLazyRouter<EnhancedRouter<U, TInitialContext, TCurrentContext, TErrorMap>> : T extends Procedure<infer UInitialContext, infer UCurrentContext, infer UInputSchema, infer UOutputSchema, infer UErrorMap, infer UMeta> ? Procedure<MergedInitialContext<TInitialContext, UInitialContext, TCurrentContext>, UCurrentContext, UInputSchema, UOutputSchema, MergedErrorMap<TErrorMap, UErrorMap>, UMeta> : {
10
+ [K in keyof T]: T[K] extends Lazyable<AnyRouter> ? EnhancedRouter<T[K], TInitialContext, TCurrentContext, TErrorMap> : never;
11
+ };
12
+ interface EnhanceRouterOptions<TErrorMap extends ErrorMap> extends EnhanceRouteOptions {
13
+ middlewares: readonly AnyMiddleware[];
14
+ errorMap: TErrorMap;
15
+ dedupeLeadingMiddlewares: boolean;
16
+ }
17
+ declare function enhanceRouter<T extends Lazyable<AnyRouter>, TInitialContext extends Context, TCurrentContext extends Context, TErrorMap extends ErrorMap>(router: T, options: EnhanceRouterOptions<TErrorMap>): EnhancedRouter<T, TInitialContext, TCurrentContext, TErrorMap>;
18
+ interface TraverseContractProceduresOptions {
19
+ router: AnyContractRouter | AnyRouter;
20
+ path: readonly string[];
21
+ }
22
+ interface TraverseContractProcedureCallbackOptions {
23
+ contract: AnyContractProcedure | AnyProcedure;
24
+ path: readonly string[];
25
+ }
26
+ /**
27
+ * @deprecated Use `TraverseContractProcedureCallbackOptions` instead.
28
+ */
29
+ type ContractProcedureCallbackOptions = TraverseContractProcedureCallbackOptions;
30
+ interface LazyTraverseContractProceduresOptions {
31
+ router: Lazy<AnyRouter>;
32
+ path: readonly string[];
33
+ }
34
+ declare function traverseContractProcedures(options: TraverseContractProceduresOptions, callback: (options: TraverseContractProcedureCallbackOptions) => void, lazyOptions?: LazyTraverseContractProceduresOptions[]): LazyTraverseContractProceduresOptions[];
35
+ declare function resolveContractProcedures(options: TraverseContractProceduresOptions, callback: (options: TraverseContractProcedureCallbackOptions) => void): Promise<void>;
36
+ type UnlaziedRouter<T extends AnyRouter> = T extends AnyProcedure ? T : {
37
+ [K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? UnlaziedRouter<U> : never;
38
+ };
39
+ declare function unlazyRouter<T extends AnyRouter>(router: T): Promise<UnlaziedRouter<T>>;
40
+
41
+ export { createAccessibleLazyRouter as c, enhanceRouter as e, getRouter as g, resolveContractProcedures as r, traverseContractProcedures as t, unlazyRouter as u };
42
+ export type { AccessibleLazyRouter as A, ContractProcedureCallbackOptions as C, EnhanceRouterOptions as E, LazyTraverseContractProceduresOptions as L, TraverseContractProcedureCallbackOptions as T, UnlaziedRouter as U, EnhancedRouter as a, TraverseContractProceduresOptions as b };
@@ -1,6 +1,6 @@
1
1
  import { ORPCErrorCode, ORPCErrorOptions, ORPCError, HTTPPath, ClientContext, Client } from '@orpc/client';
2
2
  import { ErrorMap, ErrorMapItem, InferSchemaInput, AnySchema, Meta, ContractProcedureDef, InferSchemaOutput, ErrorFromErrorMap, AnyContractRouter, ContractProcedure } from '@orpc/contract';
3
- import { MaybeOptionalOptions, Promisable, Interceptor, Value } from '@orpc/shared';
3
+ import { MaybeOptionalOptions, Promisable, Interceptor, PromiseWithError, Value } from '@orpc/shared';
4
4
 
5
5
  type Context = Record<PropertyKey, any>;
6
6
  type MergedInitialContext<TInitial extends Context, TAdditional extends Context, TCurrent extends Context> = TInitial & Omit<TAdditional, keyof TCurrent>;
@@ -127,18 +127,18 @@ type CreateProcedureClientOptions<TInitialContext extends Context, TOutputSchema
127
127
  * This is helpful for logging and analytics.
128
128
  */
129
129
  path?: readonly string[];
130
- interceptors?: Interceptor<ProcedureClientInterceptorOptions<TInitialContext, TErrorMap, TMeta>, InferSchemaOutput<TOutputSchema>, ErrorFromErrorMap<TErrorMap>>[];
130
+ interceptors?: Interceptor<ProcedureClientInterceptorOptions<TInitialContext, TErrorMap, TMeta>, PromiseWithError<InferSchemaOutput<TOutputSchema>, ErrorFromErrorMap<TErrorMap>>>[];
131
131
  } & (Record<never, never> extends TInitialContext ? {
132
- context?: Value<TInitialContext, [clientContext: TClientContext]>;
132
+ context?: Value<Promisable<TInitialContext>, [clientContext: TClientContext]>;
133
133
  } : {
134
- context: Value<TInitialContext, [clientContext: TClientContext]>;
134
+ context: Value<Promisable<TInitialContext>, [clientContext: TClientContext]>;
135
135
  });
136
136
  /**
137
137
  * Create Server-side client from a procedure.
138
138
  *
139
139
  * @see {@link https://orpc.unnoq.com/docs/client/server-side Server-side Client Docs}
140
140
  */
141
- declare function createProcedureClient<TInitialContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta, TClientContext extends ClientContext>(lazyableProcedure: Lazyable<Procedure<TInitialContext, any, TInputSchema, TOutputSchema, TErrorMap, TMeta>>, ...[options]: MaybeOptionalOptions<CreateProcedureClientOptions<TInitialContext, TOutputSchema, TErrorMap, TMeta, TClientContext>>): ProcedureClient<TClientContext, TInputSchema, TOutputSchema, TErrorMap>;
141
+ declare function createProcedureClient<TInitialContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta, TClientContext extends ClientContext>(lazyableProcedure: Lazyable<Procedure<TInitialContext, any, TInputSchema, TOutputSchema, TErrorMap, TMeta>>, ...rest: MaybeOptionalOptions<CreateProcedureClientOptions<TInitialContext, TOutputSchema, TErrorMap, TMeta, TClientContext>>): ProcedureClient<TClientContext, TInputSchema, TOutputSchema, TErrorMap>;
142
142
 
143
143
  /**
144
144
  * Represents a router, which defines a hierarchical structure of procedures.
@@ -188,5 +188,5 @@ type InferRouterOutputs<T extends AnyRouter> = T extends Procedure<any, any, any
188
188
  [K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterOutputs<U> : never;
189
189
  };
190
190
 
191
- export { isProcedure as E, createProcedureClient as G, Procedure as P, createORPCErrorConstructorMap as l, mergeCurrentContext as m, LAZY_SYMBOL as n, lazy as p, isLazy as q, getLazyMeta as r, unlazy as u, validateORPCError as v, middlewareOutputFn as z };
192
- export type { AnyMiddleware as A, ProcedureHandlerOptions as B, Context as C, ProcedureDef as D, ProcedureClientInterceptorOptions as F, InferRouterInitialContexts as H, InferRouterInitialContext as I, InferRouterCurrentContexts as J, InferRouterInputs as K, Lazyable as L, Middleware as M, InferRouterOutputs as N, ORPCErrorConstructorMap as O, Router as R, MergedInitialContext as a, MergedCurrentContext as b, MapInputMiddleware as c, CreateProcedureClientOptions as d, ProcedureClient as e, AnyRouter as f, Lazy as g, AnyProcedure as h, ProcedureHandler as i, ORPCErrorConstructorMapItemOptions as j, ORPCErrorConstructorMapItem as k, LazyMeta as o, MiddlewareResult as s, MiddlewareNextFnOptions as t, MiddlewareNextFn as w, MiddlewareOutputFn as x, MiddlewareOptions as y };
191
+ export { middlewareOutputFn as B, isProcedure as F, createProcedureClient as G, Procedure as P, mergeCurrentContext as m, createORPCErrorConstructorMap as n, LAZY_SYMBOL as o, lazy as q, isLazy as r, getLazyMeta as s, unlazy as u, validateORPCError as v };
192
+ export type { AnyProcedure as A, Context as C, ProcedureHandlerOptions as D, ProcedureDef as E, InferRouterInitialContexts as H, InferRouterInitialContext as I, InferRouterCurrentContexts as J, InferRouterInputs as K, Lazyable as L, MergedInitialContext as M, InferRouterOutputs as N, ORPCErrorConstructorMap as O, Router as R, AnyMiddleware as a, AnyRouter as b, Lazy as c, ProcedureClientInterceptorOptions as d, Middleware as e, MergedCurrentContext as f, MapInputMiddleware as g, CreateProcedureClientOptions as h, ProcedureClient as i, ProcedureHandler as j, ORPCErrorConstructorMapItemOptions as k, ORPCErrorConstructorMapItem as l, LazyMeta as p, MiddlewareResult as t, MiddlewareNextFnOptions as w, MiddlewareNextFn as x, MiddlewareOutputFn as y, MiddlewareOptions as z };
@@ -1,6 +1,6 @@
1
1
  import { ORPCErrorCode, ORPCErrorOptions, ORPCError, HTTPPath, ClientContext, Client } from '@orpc/client';
2
2
  import { ErrorMap, ErrorMapItem, InferSchemaInput, AnySchema, Meta, ContractProcedureDef, InferSchemaOutput, ErrorFromErrorMap, AnyContractRouter, ContractProcedure } from '@orpc/contract';
3
- import { MaybeOptionalOptions, Promisable, Interceptor, Value } from '@orpc/shared';
3
+ import { MaybeOptionalOptions, Promisable, Interceptor, PromiseWithError, Value } from '@orpc/shared';
4
4
 
5
5
  type Context = Record<PropertyKey, any>;
6
6
  type MergedInitialContext<TInitial extends Context, TAdditional extends Context, TCurrent extends Context> = TInitial & Omit<TAdditional, keyof TCurrent>;
@@ -127,18 +127,18 @@ type CreateProcedureClientOptions<TInitialContext extends Context, TOutputSchema
127
127
  * This is helpful for logging and analytics.
128
128
  */
129
129
  path?: readonly string[];
130
- interceptors?: Interceptor<ProcedureClientInterceptorOptions<TInitialContext, TErrorMap, TMeta>, InferSchemaOutput<TOutputSchema>, ErrorFromErrorMap<TErrorMap>>[];
130
+ interceptors?: Interceptor<ProcedureClientInterceptorOptions<TInitialContext, TErrorMap, TMeta>, PromiseWithError<InferSchemaOutput<TOutputSchema>, ErrorFromErrorMap<TErrorMap>>>[];
131
131
  } & (Record<never, never> extends TInitialContext ? {
132
- context?: Value<TInitialContext, [clientContext: TClientContext]>;
132
+ context?: Value<Promisable<TInitialContext>, [clientContext: TClientContext]>;
133
133
  } : {
134
- context: Value<TInitialContext, [clientContext: TClientContext]>;
134
+ context: Value<Promisable<TInitialContext>, [clientContext: TClientContext]>;
135
135
  });
136
136
  /**
137
137
  * Create Server-side client from a procedure.
138
138
  *
139
139
  * @see {@link https://orpc.unnoq.com/docs/client/server-side Server-side Client Docs}
140
140
  */
141
- declare function createProcedureClient<TInitialContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta, TClientContext extends ClientContext>(lazyableProcedure: Lazyable<Procedure<TInitialContext, any, TInputSchema, TOutputSchema, TErrorMap, TMeta>>, ...[options]: MaybeOptionalOptions<CreateProcedureClientOptions<TInitialContext, TOutputSchema, TErrorMap, TMeta, TClientContext>>): ProcedureClient<TClientContext, TInputSchema, TOutputSchema, TErrorMap>;
141
+ declare function createProcedureClient<TInitialContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta, TClientContext extends ClientContext>(lazyableProcedure: Lazyable<Procedure<TInitialContext, any, TInputSchema, TOutputSchema, TErrorMap, TMeta>>, ...rest: MaybeOptionalOptions<CreateProcedureClientOptions<TInitialContext, TOutputSchema, TErrorMap, TMeta, TClientContext>>): ProcedureClient<TClientContext, TInputSchema, TOutputSchema, TErrorMap>;
142
142
 
143
143
  /**
144
144
  * Represents a router, which defines a hierarchical structure of procedures.
@@ -188,5 +188,5 @@ type InferRouterOutputs<T extends AnyRouter> = T extends Procedure<any, any, any
188
188
  [K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterOutputs<U> : never;
189
189
  };
190
190
 
191
- export { isProcedure as E, createProcedureClient as G, Procedure as P, createORPCErrorConstructorMap as l, mergeCurrentContext as m, LAZY_SYMBOL as n, lazy as p, isLazy as q, getLazyMeta as r, unlazy as u, validateORPCError as v, middlewareOutputFn as z };
192
- export type { AnyMiddleware as A, ProcedureHandlerOptions as B, Context as C, ProcedureDef as D, ProcedureClientInterceptorOptions as F, InferRouterInitialContexts as H, InferRouterInitialContext as I, InferRouterCurrentContexts as J, InferRouterInputs as K, Lazyable as L, Middleware as M, InferRouterOutputs as N, ORPCErrorConstructorMap as O, Router as R, MergedInitialContext as a, MergedCurrentContext as b, MapInputMiddleware as c, CreateProcedureClientOptions as d, ProcedureClient as e, AnyRouter as f, Lazy as g, AnyProcedure as h, ProcedureHandler as i, ORPCErrorConstructorMapItemOptions as j, ORPCErrorConstructorMapItem as k, LazyMeta as o, MiddlewareResult as s, MiddlewareNextFnOptions as t, MiddlewareNextFn as w, MiddlewareOutputFn as x, MiddlewareOptions as y };
191
+ export { middlewareOutputFn as B, isProcedure as F, createProcedureClient as G, Procedure as P, mergeCurrentContext as m, createORPCErrorConstructorMap as n, LAZY_SYMBOL as o, lazy as q, isLazy as r, getLazyMeta as s, unlazy as u, validateORPCError as v };
192
+ export type { AnyProcedure as A, Context as C, ProcedureHandlerOptions as D, ProcedureDef as E, InferRouterInitialContexts as H, InferRouterInitialContext as I, InferRouterCurrentContexts as J, InferRouterInputs as K, Lazyable as L, MergedInitialContext as M, InferRouterOutputs as N, ORPCErrorConstructorMap as O, Router as R, AnyMiddleware as a, AnyRouter as b, Lazy as c, ProcedureClientInterceptorOptions as d, Middleware as e, MergedCurrentContext as f, MapInputMiddleware as g, CreateProcedureClientOptions as h, ProcedureClient as i, ProcedureHandler as j, ORPCErrorConstructorMapItemOptions as k, ORPCErrorConstructorMapItem as l, LazyMeta as p, MiddlewareResult as t, MiddlewareNextFnOptions as w, MiddlewareNextFn as x, MiddlewareOutputFn as y, MiddlewareOptions as z };
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.fd13879",
4
+ "version": "0.0.0-next.fd1ee2a",
5
5
  "license": "MIT",
6
6
  "homepage": "https://orpc.unnoq.com",
7
7
  "repository": {
@@ -24,11 +24,21 @@
24
24
  "import": "./dist/plugins/index.mjs",
25
25
  "default": "./dist/plugins/index.mjs"
26
26
  },
27
+ "./hibernation": {
28
+ "types": "./dist/hibernation/index.d.mts",
29
+ "import": "./dist/hibernation/index.mjs",
30
+ "default": "./dist/hibernation/index.mjs"
31
+ },
27
32
  "./standard": {
28
33
  "types": "./dist/adapters/standard/index.d.mts",
29
34
  "import": "./dist/adapters/standard/index.mjs",
30
35
  "default": "./dist/adapters/standard/index.mjs"
31
36
  },
37
+ "./standard-peer": {
38
+ "types": "./dist/adapters/standard-peer/index.d.mts",
39
+ "import": "./dist/adapters/standard-peer/index.mjs",
40
+ "default": "./dist/adapters/standard-peer/index.mjs"
41
+ },
32
42
  "./fetch": {
33
43
  "types": "./dist/adapters/fetch/index.d.mts",
34
44
  "import": "./dist/adapters/fetch/index.mjs",
@@ -39,6 +49,11 @@
39
49
  "import": "./dist/adapters/node/index.mjs",
40
50
  "default": "./dist/adapters/node/index.mjs"
41
51
  },
52
+ "./aws-lambda": {
53
+ "types": "./dist/adapters/aws-lambda/index.d.mts",
54
+ "import": "./dist/adapters/aws-lambda/index.mjs",
55
+ "default": "./dist/adapters/aws-lambda/index.mjs"
56
+ },
42
57
  "./websocket": {
43
58
  "types": "./dist/adapters/websocket/index.d.mts",
44
59
  "import": "./dist/adapters/websocket/index.mjs",
@@ -58,6 +73,11 @@
58
73
  "types": "./dist/adapters/bun-ws/index.d.mts",
59
74
  "import": "./dist/adapters/bun-ws/index.mjs",
60
75
  "default": "./dist/adapters/bun-ws/index.mjs"
76
+ },
77
+ "./message-port": {
78
+ "types": "./dist/adapters/message-port/index.d.mts",
79
+ "import": "./dist/adapters/message-port/index.mjs",
80
+ "default": "./dist/adapters/message-port/index.mjs"
61
81
  }
62
82
  },
63
83
  "files": [
@@ -76,20 +96,21 @@
76
96
  }
77
97
  },
78
98
  "dependencies": {
79
- "@orpc/client": "0.0.0-next.fd13879",
80
- "@orpc/standard-server": "0.0.0-next.fd13879",
81
- "@orpc/contract": "0.0.0-next.fd13879",
82
- "@orpc/shared": "0.0.0-next.fd13879",
83
- "@orpc/standard-server-fetch": "0.0.0-next.fd13879",
84
- "@orpc/standard-server-peer": "0.0.0-next.fd13879",
85
- "@orpc/standard-server-node": "0.0.0-next.fd13879"
99
+ "@orpc/contract": "0.0.0-next.fd1ee2a",
100
+ "@orpc/client": "0.0.0-next.fd1ee2a",
101
+ "@orpc/shared": "0.0.0-next.fd1ee2a",
102
+ "@orpc/standard-server": "0.0.0-next.fd1ee2a",
103
+ "@orpc/standard-server-aws-lambda": "0.0.0-next.fd1ee2a",
104
+ "@orpc/standard-server-fetch": "0.0.0-next.fd1ee2a",
105
+ "@orpc/standard-server-peer": "0.0.0-next.fd1ee2a",
106
+ "@orpc/standard-server-node": "0.0.0-next.fd1ee2a"
86
107
  },
87
108
  "devDependencies": {
88
109
  "@types/ws": "^8.18.1",
89
- "crossws": "^0.3.4",
90
- "next": "^15.3.0",
91
- "supertest": "^7.1.0",
92
- "ws": "^8.18.1"
110
+ "crossws": "^0.4.1",
111
+ "next": "^15.4.1",
112
+ "supertest": "^7.1.3",
113
+ "ws": "^8.18.3"
93
114
  },
94
115
  "scripts": {
95
116
  "build": "unbuild",