@orpc/server 0.0.0-next.e82d760 → 0.0.0-next.e8416db

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 (65) hide show
  1. package/README.md +11 -6
  2. package/dist/adapters/aws-lambda/index.d.mts +9 -8
  3. package/dist/adapters/aws-lambda/index.d.ts +9 -8
  4. package/dist/adapters/aws-lambda/index.mjs +6 -5
  5. package/dist/adapters/bun-ws/index.d.mts +14 -13
  6. package/dist/adapters/bun-ws/index.d.ts +14 -13
  7. package/dist/adapters/bun-ws/index.mjs +17 -16
  8. package/dist/adapters/crossws/index.d.mts +10 -7
  9. package/dist/adapters/crossws/index.d.ts +10 -7
  10. package/dist/adapters/crossws/index.mjs +9 -10
  11. package/dist/adapters/fastify/index.d.mts +53 -0
  12. package/dist/adapters/fastify/index.d.ts +53 -0
  13. package/dist/adapters/fastify/index.mjs +54 -0
  14. package/dist/adapters/fetch/index.d.mts +57 -11
  15. package/dist/adapters/fetch/index.d.ts +57 -11
  16. package/dist/adapters/fetch/index.mjs +74 -4
  17. package/dist/adapters/message-port/index.d.mts +42 -13
  18. package/dist/adapters/message-port/index.d.ts +42 -13
  19. package/dist/adapters/message-port/index.mjs +32 -18
  20. package/dist/adapters/node/index.d.mts +34 -12
  21. package/dist/adapters/node/index.d.ts +34 -12
  22. package/dist/adapters/node/index.mjs +70 -13
  23. package/dist/adapters/standard/index.d.mts +8 -13
  24. package/dist/adapters/standard/index.d.ts +8 -13
  25. package/dist/adapters/standard/index.mjs +3 -2
  26. package/dist/adapters/standard-peer/index.d.mts +18 -0
  27. package/dist/adapters/standard-peer/index.d.ts +18 -0
  28. package/dist/adapters/standard-peer/index.mjs +7 -0
  29. package/dist/adapters/websocket/index.d.mts +20 -15
  30. package/dist/adapters/websocket/index.d.ts +20 -15
  31. package/dist/adapters/websocket/index.mjs +13 -15
  32. package/dist/adapters/ws/index.d.mts +13 -10
  33. package/dist/adapters/ws/index.d.ts +13 -10
  34. package/dist/adapters/ws/index.mjs +13 -15
  35. package/dist/helpers/index.d.mts +149 -0
  36. package/dist/helpers/index.d.ts +149 -0
  37. package/dist/helpers/index.mjs +198 -0
  38. package/dist/hibernation/index.d.mts +13 -13
  39. package/dist/hibernation/index.d.ts +13 -13
  40. package/dist/hibernation/index.mjs +8 -8
  41. package/dist/index.d.mts +105 -136
  42. package/dist/index.d.ts +105 -136
  43. package/dist/index.mjs +37 -33
  44. package/dist/plugins/index.d.mts +25 -9
  45. package/dist/plugins/index.d.ts +25 -9
  46. package/dist/plugins/index.mjs +86 -58
  47. package/dist/shared/{server.-ACo36I0.d.ts → server.7cEtMB30.d.ts} +3 -3
  48. package/dist/shared/server.B8gYOD5g.d.mts +12 -0
  49. package/dist/shared/{server.Dq8xr7PQ.d.mts → server.BqadksTP.d.mts} +3 -3
  50. package/dist/shared/{server.CB8Snncu.mjs → server.Bxx6tqNe.mjs} +74 -41
  51. package/dist/shared/server.C8_sRzQB.d.mts +42 -0
  52. package/dist/shared/server.ChUyt5-i.d.mts +32 -0
  53. package/dist/shared/server.ChyoA9XY.d.ts +42 -0
  54. package/dist/shared/{server.DLJzqnSX.mjs → server.Ds4HPpvH.mjs} +114 -73
  55. package/dist/shared/server.EfTOZ2Q7.d.ts +12 -0
  56. package/dist/shared/{server.BW-nUGgA.mjs → server.TEVCLCFC.mjs} +3 -0
  57. package/dist/shared/server.UVMTOWrk.mjs +26 -0
  58. package/dist/shared/{server.DD2C4ujN.d.mts → server.qKsRrdxW.d.mts} +14 -13
  59. package/dist/shared/{server.DD2C4ujN.d.ts → server.qKsRrdxW.d.ts} +14 -13
  60. package/dist/shared/server.yoEB3Fx4.d.ts +32 -0
  61. package/package.json +34 -13
  62. package/dist/shared/server.BPAWobQg.d.ts +0 -12
  63. package/dist/shared/server.Bd52nNaH.d.mts +0 -12
  64. package/dist/shared/server.BliFSTnG.d.mts +0 -10
  65. package/dist/shared/server.IG2MjhrD.d.ts +0 -10
@@ -13,7 +13,6 @@ type ORPCErrorConstructorMap<T extends ErrorMap> = {
13
13
  [K in keyof T]: K extends ORPCErrorCode ? T[K] extends ErrorMapItem<infer UInputSchema> ? ORPCErrorConstructorMapItem<K, InferSchemaInput<UInputSchema>> : never : never;
14
14
  };
15
15
  declare function createORPCErrorConstructorMap<T extends ErrorMap>(errors: T): ORPCErrorConstructorMap<T>;
16
- declare function validateORPCError(map: ErrorMap, error: ORPCError<any, any>): Promise<ORPCError<string, unknown>>;
17
16
 
18
17
  declare const LAZY_SYMBOL: unique symbol;
19
18
  interface LazyMeta {
@@ -29,7 +28,9 @@ interface Lazy<T> {
29
28
  }
30
29
  type Lazyable<T> = T | Lazy<T>;
31
30
  /**
32
- * Create a lazy thing.
31
+ * Creates a lazy-loaded item.
32
+ *
33
+ * @warning The `prefix` in `meta` only holds metadata and does not apply the prefix to the lazy router, use `os.prefix(...).lazy(...)` instead.
33
34
  */
34
35
  declare function lazy<T>(loader: () => Promise<{
35
36
  default: T;
@@ -62,7 +63,7 @@ interface ProcedureDef<TInitialContext extends Context, TCurrentContext extends
62
63
  /**
63
64
  * This class represents a procedure.
64
65
  *
65
- * @see {@link https://orpc.unnoq.com/docs/procedure Procedure Docs}
66
+ * @see {@link https://orpc.dev/docs/procedure Procedure Docs}
66
67
  */
67
68
  declare class Procedure<TInitialContext extends Context, TCurrentContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta> {
68
69
  /**
@@ -101,7 +102,7 @@ interface MiddlewareOptions<TInContext extends Context, TOutput, TErrorConstruct
101
102
  /**
102
103
  * A function that represents a middleware.
103
104
  *
104
- * @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
105
+ * @see {@link https://orpc.dev/docs/middleware Middleware Docs}
105
106
  */
106
107
  interface Middleware<TInContext extends Context, TOutContext extends Context, TInput, TOutput, TErrorConstructorMap extends ORPCErrorConstructorMap<any>, TMeta extends Meta> {
107
108
  (options: MiddlewareOptions<TInContext, TOutput, TErrorConstructorMap, TMeta>, input: TInput, output: MiddlewareOutputFn<TOutput>): Promisable<MiddlewareResult<TOutContext, TOutput>>;
@@ -136,15 +137,15 @@ type CreateProcedureClientOptions<TInitialContext extends Context, TOutputSchema
136
137
  /**
137
138
  * Create Server-side client from a procedure.
138
139
  *
139
- * @see {@link https://orpc.unnoq.com/docs/client/server-side Server-side Client Docs}
140
+ * @see {@link https://orpc.dev/docs/client/server-side Server-side Client Docs}
140
141
  */
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>;
142
+ 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
143
 
143
144
  /**
144
145
  * Represents a router, which defines a hierarchical structure of procedures.
145
146
  *
146
147
  * @info A procedure is a router too.
147
- * @see {@link https://orpc.unnoq.com/docs/contract-first/define-contract#contract-router Contract Router Docs}
148
+ * @see {@link https://orpc.dev/docs/contract-first/define-contract#contract-router Contract Router Docs}
148
149
  */
149
150
  type Router<T extends AnyContractRouter, TInitialContext extends Context> = T extends ContractProcedure<infer UInputSchema, infer UOutputSchema, infer UErrorMap, infer UMeta> ? Procedure<TInitialContext, any, UInputSchema, UOutputSchema, UErrorMap, UMeta> : {
150
151
  [K in keyof T]: T[K] extends AnyContractRouter ? Lazyable<Router<T[K], TInitialContext>> : never;
@@ -155,7 +156,7 @@ type InferRouterInitialContext<T extends AnyRouter> = T extends Router<any, infe
155
156
  * Infer all initial context of the router.
156
157
  *
157
158
  * @info A procedure is a router too.
158
- * @see {@link https://orpc.unnoq.com/docs/router#utilities Router Utilities Docs}
159
+ * @see {@link https://orpc.dev/docs/router#utilities Router Utilities Docs}
159
160
  */
160
161
  type InferRouterInitialContexts<T extends AnyRouter> = T extends Procedure<infer UInitialContext, any, any, any, any, any> ? UInitialContext : {
161
162
  [K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterInitialContexts<U> : never;
@@ -164,7 +165,7 @@ type InferRouterInitialContexts<T extends AnyRouter> = T extends Procedure<infer
164
165
  * Infer all current context of the router.
165
166
  *
166
167
  * @info A procedure is a router too.
167
- * @see {@link https://orpc.unnoq.com/docs/router#utilities Router Utilities Docs}
168
+ * @see {@link https://orpc.dev/docs/router#utilities Router Utilities Docs}
168
169
  */
169
170
  type InferRouterCurrentContexts<T extends AnyRouter> = T extends Procedure<any, infer UCurrentContext, any, any, any, any> ? UCurrentContext : {
170
171
  [K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterCurrentContexts<U> : never;
@@ -173,7 +174,7 @@ type InferRouterCurrentContexts<T extends AnyRouter> = T extends Procedure<any,
173
174
  * Infer all router inputs
174
175
  *
175
176
  * @info A procedure is a router too.
176
- * @see {@link https://orpc.unnoq.com/docs/router#utilities Router Utilities Docs}
177
+ * @see {@link https://orpc.dev/docs/router#utilities Router Utilities Docs}
177
178
  */
178
179
  type InferRouterInputs<T extends AnyRouter> = T extends Procedure<any, any, infer UInputSchema, any, any, any> ? InferSchemaInput<UInputSchema> : {
179
180
  [K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterInputs<U> : never;
@@ -182,11 +183,11 @@ type InferRouterInputs<T extends AnyRouter> = T extends Procedure<any, any, infe
182
183
  * Infer all router outputs
183
184
  *
184
185
  * @info A procedure is a router too.
185
- * @see {@link https://orpc.unnoq.com/docs/router#utilities Router Utilities Docs}
186
+ * @see {@link https://orpc.dev/docs/router#utilities Router Utilities Docs}
186
187
  */
187
188
  type InferRouterOutputs<T extends AnyRouter> = T extends Procedure<any, any, any, infer UOutputSchema, any, any> ? InferSchemaOutput<UOutputSchema> : {
188
189
  [K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterOutputs<U> : never;
189
190
  };
190
191
 
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 };
192
+ export { isProcedure as E, createProcedureClient as F, 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, middlewareOutputFn as z };
193
+ export type { AnyProcedure as A, ProcedureHandlerOptions as B, Context as C, ProcedureDef as D, InferRouterInitialContexts as G, InferRouterCurrentContexts as H, InferRouterInitialContext as I, InferRouterInputs as J, InferRouterOutputs as K, Lazyable as L, MergedInitialContext as M, 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 v, MiddlewareNextFn as w, MiddlewareOutputFn as x, MiddlewareOptions as y };
@@ -13,7 +13,6 @@ type ORPCErrorConstructorMap<T extends ErrorMap> = {
13
13
  [K in keyof T]: K extends ORPCErrorCode ? T[K] extends ErrorMapItem<infer UInputSchema> ? ORPCErrorConstructorMapItem<K, InferSchemaInput<UInputSchema>> : never : never;
14
14
  };
15
15
  declare function createORPCErrorConstructorMap<T extends ErrorMap>(errors: T): ORPCErrorConstructorMap<T>;
16
- declare function validateORPCError(map: ErrorMap, error: ORPCError<any, any>): Promise<ORPCError<string, unknown>>;
17
16
 
18
17
  declare const LAZY_SYMBOL: unique symbol;
19
18
  interface LazyMeta {
@@ -29,7 +28,9 @@ interface Lazy<T> {
29
28
  }
30
29
  type Lazyable<T> = T | Lazy<T>;
31
30
  /**
32
- * Create a lazy thing.
31
+ * Creates a lazy-loaded item.
32
+ *
33
+ * @warning The `prefix` in `meta` only holds metadata and does not apply the prefix to the lazy router, use `os.prefix(...).lazy(...)` instead.
33
34
  */
34
35
  declare function lazy<T>(loader: () => Promise<{
35
36
  default: T;
@@ -62,7 +63,7 @@ interface ProcedureDef<TInitialContext extends Context, TCurrentContext extends
62
63
  /**
63
64
  * This class represents a procedure.
64
65
  *
65
- * @see {@link https://orpc.unnoq.com/docs/procedure Procedure Docs}
66
+ * @see {@link https://orpc.dev/docs/procedure Procedure Docs}
66
67
  */
67
68
  declare class Procedure<TInitialContext extends Context, TCurrentContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta> {
68
69
  /**
@@ -101,7 +102,7 @@ interface MiddlewareOptions<TInContext extends Context, TOutput, TErrorConstruct
101
102
  /**
102
103
  * A function that represents a middleware.
103
104
  *
104
- * @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
105
+ * @see {@link https://orpc.dev/docs/middleware Middleware Docs}
105
106
  */
106
107
  interface Middleware<TInContext extends Context, TOutContext extends Context, TInput, TOutput, TErrorConstructorMap extends ORPCErrorConstructorMap<any>, TMeta extends Meta> {
107
108
  (options: MiddlewareOptions<TInContext, TOutput, TErrorConstructorMap, TMeta>, input: TInput, output: MiddlewareOutputFn<TOutput>): Promisable<MiddlewareResult<TOutContext, TOutput>>;
@@ -136,15 +137,15 @@ type CreateProcedureClientOptions<TInitialContext extends Context, TOutputSchema
136
137
  /**
137
138
  * Create Server-side client from a procedure.
138
139
  *
139
- * @see {@link https://orpc.unnoq.com/docs/client/server-side Server-side Client Docs}
140
+ * @see {@link https://orpc.dev/docs/client/server-side Server-side Client Docs}
140
141
  */
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>;
142
+ 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
143
 
143
144
  /**
144
145
  * Represents a router, which defines a hierarchical structure of procedures.
145
146
  *
146
147
  * @info A procedure is a router too.
147
- * @see {@link https://orpc.unnoq.com/docs/contract-first/define-contract#contract-router Contract Router Docs}
148
+ * @see {@link https://orpc.dev/docs/contract-first/define-contract#contract-router Contract Router Docs}
148
149
  */
149
150
  type Router<T extends AnyContractRouter, TInitialContext extends Context> = T extends ContractProcedure<infer UInputSchema, infer UOutputSchema, infer UErrorMap, infer UMeta> ? Procedure<TInitialContext, any, UInputSchema, UOutputSchema, UErrorMap, UMeta> : {
150
151
  [K in keyof T]: T[K] extends AnyContractRouter ? Lazyable<Router<T[K], TInitialContext>> : never;
@@ -155,7 +156,7 @@ type InferRouterInitialContext<T extends AnyRouter> = T extends Router<any, infe
155
156
  * Infer all initial context of the router.
156
157
  *
157
158
  * @info A procedure is a router too.
158
- * @see {@link https://orpc.unnoq.com/docs/router#utilities Router Utilities Docs}
159
+ * @see {@link https://orpc.dev/docs/router#utilities Router Utilities Docs}
159
160
  */
160
161
  type InferRouterInitialContexts<T extends AnyRouter> = T extends Procedure<infer UInitialContext, any, any, any, any, any> ? UInitialContext : {
161
162
  [K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterInitialContexts<U> : never;
@@ -164,7 +165,7 @@ type InferRouterInitialContexts<T extends AnyRouter> = T extends Procedure<infer
164
165
  * Infer all current context of the router.
165
166
  *
166
167
  * @info A procedure is a router too.
167
- * @see {@link https://orpc.unnoq.com/docs/router#utilities Router Utilities Docs}
168
+ * @see {@link https://orpc.dev/docs/router#utilities Router Utilities Docs}
168
169
  */
169
170
  type InferRouterCurrentContexts<T extends AnyRouter> = T extends Procedure<any, infer UCurrentContext, any, any, any, any> ? UCurrentContext : {
170
171
  [K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterCurrentContexts<U> : never;
@@ -173,7 +174,7 @@ type InferRouterCurrentContexts<T extends AnyRouter> = T extends Procedure<any,
173
174
  * Infer all router inputs
174
175
  *
175
176
  * @info A procedure is a router too.
176
- * @see {@link https://orpc.unnoq.com/docs/router#utilities Router Utilities Docs}
177
+ * @see {@link https://orpc.dev/docs/router#utilities Router Utilities Docs}
177
178
  */
178
179
  type InferRouterInputs<T extends AnyRouter> = T extends Procedure<any, any, infer UInputSchema, any, any, any> ? InferSchemaInput<UInputSchema> : {
179
180
  [K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterInputs<U> : never;
@@ -182,11 +183,11 @@ type InferRouterInputs<T extends AnyRouter> = T extends Procedure<any, any, infe
182
183
  * Infer all router outputs
183
184
  *
184
185
  * @info A procedure is a router too.
185
- * @see {@link https://orpc.unnoq.com/docs/router#utilities Router Utilities Docs}
186
+ * @see {@link https://orpc.dev/docs/router#utilities Router Utilities Docs}
186
187
  */
187
188
  type InferRouterOutputs<T extends AnyRouter> = T extends Procedure<any, any, any, infer UOutputSchema, any, any> ? InferSchemaOutput<UOutputSchema> : {
188
189
  [K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterOutputs<U> : never;
189
190
  };
190
191
 
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 };
192
+ export { isProcedure as E, createProcedureClient as F, 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, middlewareOutputFn as z };
193
+ export type { AnyProcedure as A, ProcedureHandlerOptions as B, Context as C, ProcedureDef as D, InferRouterInitialContexts as G, InferRouterCurrentContexts as H, InferRouterInitialContext as I, InferRouterInputs as J, InferRouterOutputs as K, Lazyable as L, MergedInitialContext as M, 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 v, MiddlewareNextFn as w, MiddlewareOutputFn as x, MiddlewareOptions as y };
@@ -0,0 +1,32 @@
1
+ import { StandardRPCJsonSerializerOptions } from '@orpc/client/standard';
2
+ import { b as AnyRouter, C as Context, R as Router } from './server.qKsRrdxW.js';
3
+ import { i as StandardMatcher, h as StandardMatchResult, e as StandardHandlerOptions, f as StandardHandler } from './server.7cEtMB30.js';
4
+ import { HTTPPath } from '@orpc/client';
5
+ import { Value } from '@orpc/shared';
6
+ import { T as TraverseContractProcedureCallbackOptions } from './server.ChyoA9XY.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 };
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@orpc/server",
3
3
  "type": "module",
4
- "version": "0.0.0-next.e82d760",
4
+ "version": "0.0.0-next.e8416db",
5
5
  "license": "MIT",
6
- "homepage": "https://orpc.unnoq.com",
6
+ "homepage": "https://orpc.dev",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/unnoq/orpc.git",
@@ -19,6 +19,11 @@
19
19
  "import": "./dist/index.mjs",
20
20
  "default": "./dist/index.mjs"
21
21
  },
22
+ "./helpers": {
23
+ "types": "./dist/helpers/index.d.mts",
24
+ "import": "./dist/helpers/index.mjs",
25
+ "default": "./dist/helpers/index.mjs"
26
+ },
22
27
  "./plugins": {
23
28
  "types": "./dist/plugins/index.d.mts",
24
29
  "import": "./dist/plugins/index.mjs",
@@ -34,6 +39,11 @@
34
39
  "import": "./dist/adapters/standard/index.mjs",
35
40
  "default": "./dist/adapters/standard/index.mjs"
36
41
  },
42
+ "./standard-peer": {
43
+ "types": "./dist/adapters/standard-peer/index.d.mts",
44
+ "import": "./dist/adapters/standard-peer/index.mjs",
45
+ "default": "./dist/adapters/standard-peer/index.mjs"
46
+ },
37
47
  "./fetch": {
38
48
  "types": "./dist/adapters/fetch/index.d.mts",
39
49
  "import": "./dist/adapters/fetch/index.mjs",
@@ -44,6 +54,11 @@
44
54
  "import": "./dist/adapters/node/index.mjs",
45
55
  "default": "./dist/adapters/node/index.mjs"
46
56
  },
57
+ "./fastify": {
58
+ "types": "./dist/adapters/fastify/index.d.mts",
59
+ "import": "./dist/adapters/fastify/index.mjs",
60
+ "default": "./dist/adapters/fastify/index.mjs"
61
+ },
47
62
  "./aws-lambda": {
48
63
  "types": "./dist/adapters/aws-lambda/index.d.mts",
49
64
  "import": "./dist/adapters/aws-lambda/index.mjs",
@@ -91,21 +106,27 @@
91
106
  }
92
107
  },
93
108
  "dependencies": {
94
- "@orpc/contract": "0.0.0-next.e82d760",
95
- "@orpc/standard-server": "0.0.0-next.e82d760",
96
- "@orpc/client": "0.0.0-next.e82d760",
97
- "@orpc/shared": "0.0.0-next.e82d760",
98
- "@orpc/standard-server-aws-lambda": "0.0.0-next.e82d760",
99
- "@orpc/standard-server-node": "0.0.0-next.e82d760",
100
- "@orpc/standard-server-fetch": "0.0.0-next.e82d760",
101
- "@orpc/standard-server-peer": "0.0.0-next.e82d760"
109
+ "cookie": "^1.0.2",
110
+ "@orpc/client": "0.0.0-next.e8416db",
111
+ "@orpc/shared": "0.0.0-next.e8416db",
112
+ "@orpc/contract": "0.0.0-next.e8416db",
113
+ "@orpc/standard-server": "0.0.0-next.e8416db",
114
+ "@orpc/standard-server-aws-lambda": "0.0.0-next.e8416db",
115
+ "@orpc/interop": "0.0.0-next.e8416db",
116
+ "@orpc/standard-server-fastify": "0.0.0-next.e8416db",
117
+ "@orpc/standard-server-fetch": "0.0.0-next.e8416db",
118
+ "@orpc/standard-server-node": "0.0.0-next.e8416db",
119
+ "@orpc/standard-server-peer": "0.0.0-next.e8416db"
102
120
  },
103
121
  "devDependencies": {
122
+ "@tanstack/router-core": "^1.139.12",
104
123
  "@types/ws": "^8.18.1",
105
124
  "crossws": "^0.4.1",
106
- "next": "^15.3.4",
107
- "supertest": "^7.1.0",
108
- "ws": "^8.18.1"
125
+ "fastify": "^5.6.2",
126
+ "next": "^16.0.7",
127
+ "supertest": "^7.1.4",
128
+ "ws": "^8.18.3",
129
+ "zod": "^4.1.12"
109
130
  },
110
131
  "scripts": {
111
132
  "build": "unbuild",
@@ -1,12 +0,0 @@
1
- import { StandardRPCJsonSerializerOptions } from '@orpc/client/standard';
2
- import { C as Context, R as Router } from './server.DD2C4ujN.js';
3
- import { b as StandardHandlerOptions, i as StandardHandler } from './server.-ACo36I0.js';
4
-
5
- interface StandardRPCHandlerOptions<T extends Context> extends StandardHandlerOptions<T>, StandardRPCJsonSerializerOptions {
6
- }
7
- declare class StandardRPCHandler<T extends Context> extends StandardHandler<T> {
8
- constructor(router: Router<any, T>, options?: StandardRPCHandlerOptions<T>);
9
- }
10
-
11
- export { StandardRPCHandler as a };
12
- export type { StandardRPCHandlerOptions as S };
@@ -1,12 +0,0 @@
1
- import { StandardRPCJsonSerializerOptions } from '@orpc/client/standard';
2
- import { C as Context, R as Router } from './server.DD2C4ujN.mjs';
3
- import { b as StandardHandlerOptions, i as StandardHandler } from './server.Dq8xr7PQ.mjs';
4
-
5
- interface StandardRPCHandlerOptions<T extends Context> extends StandardHandlerOptions<T>, StandardRPCJsonSerializerOptions {
6
- }
7
- declare class StandardRPCHandler<T extends Context> extends StandardHandler<T> {
8
- constructor(router: Router<any, T>, options?: StandardRPCHandlerOptions<T>);
9
- }
10
-
11
- export { StandardRPCHandler as a };
12
- export type { StandardRPCHandlerOptions as S };
@@ -1,10 +0,0 @@
1
- import { C as Context } from './server.DD2C4ujN.mjs';
2
- import { g as StandardHandleOptions } from './server.Dq8xr7PQ.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
-
10
- export type { FriendlyStandardHandleOptions as F };
@@ -1,10 +0,0 @@
1
- import { C as Context } from './server.DD2C4ujN.js';
2
- import { g as StandardHandleOptions } from './server.-ACo36I0.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
-
10
- export type { FriendlyStandardHandleOptions as F };