@orpc/server 2.0.0-beta.4 → 2.0.0-beta.40

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 (60) hide show
  1. package/README.md +97 -94
  2. package/dist/adapters/aws-lambda/index.d.mts +50 -0
  3. package/dist/adapters/aws-lambda/index.d.ts +50 -0
  4. package/dist/adapters/aws-lambda/index.mjs +39 -0
  5. package/dist/adapters/crossws/index.d.mts +21 -12
  6. package/dist/adapters/crossws/index.d.ts +21 -12
  7. package/dist/adapters/crossws/index.mjs +14 -10
  8. package/dist/adapters/fastify/index.d.mts +42 -0
  9. package/dist/adapters/fastify/index.d.ts +42 -0
  10. package/dist/adapters/fastify/index.mjs +39 -0
  11. package/dist/adapters/fetch/index.d.mts +21 -114
  12. package/dist/adapters/fetch/index.d.ts +21 -114
  13. package/dist/adapters/fetch/index.mjs +20 -182
  14. package/dist/adapters/message-port/index.d.mts +23 -20
  15. package/dist/adapters/message-port/index.d.ts +23 -20
  16. package/dist/adapters/message-port/index.mjs +31 -34
  17. package/dist/adapters/node/index.d.mts +19 -96
  18. package/dist/adapters/node/index.d.ts +19 -96
  19. package/dist/adapters/node/index.mjs +19 -157
  20. package/dist/adapters/standard/index.d.mts +91 -17
  21. package/dist/adapters/standard/index.d.ts +91 -17
  22. package/dist/adapters/standard/index.mjs +4 -4
  23. package/dist/adapters/standard-peer/index.d.mts +6 -11
  24. package/dist/adapters/standard-peer/index.d.ts +6 -11
  25. package/dist/adapters/standard-peer/index.mjs +10 -2
  26. package/dist/adapters/websocket/index.d.mts +45 -29
  27. package/dist/adapters/websocket/index.d.ts +45 -29
  28. package/dist/adapters/websocket/index.mjs +37 -28
  29. package/dist/extensions/callable.d.mts +5 -5
  30. package/dist/extensions/callable.d.ts +5 -5
  31. package/dist/extensions/callable.mjs +2 -2
  32. package/dist/helpers/index.d.mts +23 -6
  33. package/dist/helpers/index.d.ts +23 -6
  34. package/dist/helpers/index.mjs +13 -5
  35. package/dist/index.d.mts +332 -37
  36. package/dist/index.d.ts +332 -37
  37. package/dist/index.mjs +131 -49
  38. package/dist/plugins/index.d.mts +243 -31
  39. package/dist/plugins/index.d.ts +243 -31
  40. package/dist/plugins/index.mjs +527 -30
  41. package/dist/shared/server.1ExWFMze.mjs +69 -0
  42. package/dist/shared/{server.CjOb6ItT.mjs → server.24nXyhbl.mjs} +1 -1
  43. package/dist/shared/{server.DBANIheG.d.ts → server.B5K1CViq.d.mts} +24 -13
  44. package/dist/shared/{server.BsNNjG5J.d.mts → server.BpmUhems.d.mts} +32 -20
  45. package/dist/shared/{server.BL22TloH.d.mts → server.BsujoJoF.d.mts} +38 -59
  46. package/dist/shared/{server.BL22TloH.d.ts → server.BsujoJoF.d.ts} +38 -59
  47. package/dist/shared/{server.BwHnWUuN.mjs → server.BynNaBBA.mjs} +24 -19
  48. package/dist/shared/{server.GDpX6Df8.mjs → server.C0lFtoHU.mjs} +162 -68
  49. package/dist/shared/server.C7xllBNN.d.mts +34 -0
  50. package/dist/shared/server.CFqSIFnT.d.mts +14 -0
  51. package/dist/shared/{server.Pa0F03f_.d.ts → server.CRwPbhLO.d.ts} +32 -20
  52. package/dist/shared/{server.DJIkub_t.d.mts → server.Cxranw-8.d.ts} +24 -13
  53. package/dist/shared/server.D0dr-F8u.d.ts +34 -0
  54. package/dist/shared/{server.CrlKQucM.mjs → server.Djb_ebJT.mjs} +25 -53
  55. package/dist/shared/server.RRVK1xTV.d.ts +14 -0
  56. package/package.json +47 -14
  57. package/dist/shared/server.CX4vUnDk.mjs +0 -11
  58. package/dist/shared/server.Cj5lgPuG.d.mts +0 -66
  59. package/dist/shared/server.D_QauotT.mjs +0 -30
  60. package/dist/shared/server.d_2NS3g5.d.ts +0 -66
@@ -0,0 +1,69 @@
1
+ import { ORPCError } from '@orpc/client';
2
+ import { toArray } from '@orpc/shared';
3
+ import { flattenStandardHeader } from '@standard-server/core';
4
+ import { toFetchHeaders, toStandardBody } from '@standard-server/fetch';
5
+
6
+ class RequestLimitHandlerPlugin {
7
+ name = "~request-limit";
8
+ /**
9
+ * Should limit the original batch request body instead of sub-requests.
10
+ */
11
+ after = ["~batch"];
12
+ /**
13
+ * Should limit the final body size instead of the compressed one.
14
+ */
15
+ before = ["~request-compression"];
16
+ maxBodySize;
17
+ constructor(options) {
18
+ this.maxBodySize = options.maxBodySize;
19
+ }
20
+ init(options) {
21
+ const maxBodySize = this.maxBodySize;
22
+ const routingInterceptor = async ({ next, ...interceptorOptions }) => {
23
+ return next({
24
+ ...interceptorOptions,
25
+ request: {
26
+ ...interceptorOptions.request,
27
+ async resolveBody(hint) {
28
+ const contentLength = Number(
29
+ flattenStandardHeader(interceptorOptions.request.headers["content-length"])
30
+ );
31
+ if (Number.isFinite(contentLength) && contentLength > maxBodySize) {
32
+ throw new ORPCError("PAYLOAD_TOO_LARGE");
33
+ }
34
+ const stream = await interceptorOptions.request.resolveBody("octet-stream");
35
+ if (!(stream instanceof ReadableStream)) {
36
+ return stream;
37
+ }
38
+ let currentBodySize = 0;
39
+ const limitedStream = stream.pipeThrough(
40
+ new TransformStream({
41
+ transform(chunk, controller) {
42
+ currentBodySize += chunk.byteLength;
43
+ if (currentBodySize > maxBodySize) {
44
+ controller.error(new ORPCError("PAYLOAD_TOO_LARGE"));
45
+ return;
46
+ }
47
+ controller.enqueue(chunk);
48
+ }
49
+ })
50
+ );
51
+ const response = new Response(limitedStream, {
52
+ headers: toFetchHeaders(interceptorOptions.request.headers)
53
+ });
54
+ return toStandardBody(response, { hint });
55
+ }
56
+ }
57
+ });
58
+ };
59
+ return {
60
+ ...options,
61
+ routingInterceptors: [
62
+ routingInterceptor,
63
+ ...toArray(options.routingInterceptors)
64
+ ]
65
+ };
66
+ }
67
+ }
68
+
69
+ export { RequestLimitHandlerPlugin as R };
@@ -1,5 +1,5 @@
1
1
  import { resolveMetaPlugins, mergeErrorMap, getHiddenMetaPlugins } from '@orpc/contract';
2
- import { P as Procedure } from './server.CrlKQucM.mjs';
2
+ import { P as Procedure } from './server.Djb_ebJT.mjs';
3
3
 
4
4
  class DecoratedProcedure extends Procedure {
5
5
  meta(...plugins) {
@@ -1,7 +1,7 @@
1
1
  import { AnyORPCError } from '@orpc/client';
2
- import { OrderablePlugin, Interceptor, Promisable } from '@orpc/shared';
3
- import { StandardLazyRequest, StandardResponse } from '@standardserver/core';
4
- import { C as Context, c as ProcedureClientInterceptor, A as AnyProcedure } from './server.BL22TloH.js';
2
+ import { OrderablePlugin, Value, Promisable, Interceptor } from '@orpc/shared';
3
+ import { StandardLazyRequest, StandardResponse } from '@standard-server/core';
4
+ import { C as Context, c as ProcedureClientInterceptor, A as AnyProcedure } from './server.BsujoJoF.mjs';
5
5
  import { Schema, ErrorMap } from '@orpc/contract';
6
6
 
7
7
  interface StandardHandlerPlugin<T extends Context> extends OrderablePlugin {
@@ -36,6 +36,17 @@ declare class CompositeStandardHandlerPlugin<T extends Context> implements Stand
36
36
 
37
37
  interface StandardHandlerHandleOptions<T extends Context> {
38
38
  prefix?: `/${string}` | undefined;
39
+ /**
40
+ * The initial context, or a function (sync or async) that receives the request and returns it.
41
+ * The function only runs once the request passes the prefix check.
42
+ */
43
+ context: Value<Promisable<T>, [request: StandardLazyRequest]>;
44
+ }
45
+ /**
46
+ * `StandardHandlerHandleOptions` after the context has been resolved,
47
+ * this is what interceptors and codecs receive.
48
+ */
49
+ interface ResolvedStandardHandlerHandleOptions<T extends Context> extends Omit<StandardHandlerHandleOptions<T>, 'context'> {
39
50
  context: T;
40
51
  }
41
52
  type StandardHandlerHandleResult = {
@@ -45,11 +56,11 @@ type StandardHandlerHandleResult = {
45
56
  matched: false;
46
57
  response?: undefined;
47
58
  };
48
- interface StandardHandlerInterceptorOptions<T extends Context> extends StandardHandlerCodecResolvedProcedure, StandardHandlerHandleOptions<T> {
59
+ interface StandardHandlerInterceptorOptions<T extends Context> extends StandardHandlerCodecResolvedProcedure, ResolvedStandardHandlerHandleOptions<T> {
49
60
  request: StandardLazyRequest;
50
61
  }
51
62
  type StandardHandlerInterceptor<T extends Context> = Interceptor<StandardHandlerInterceptorOptions<T>, Promise<StandardResponse>>;
52
- interface StandardHandlerRoutingInterceptorOptions<T extends Context> extends StandardHandlerHandleOptions<T> {
63
+ interface StandardHandlerRoutingInterceptorOptions<T extends Context> extends ResolvedStandardHandlerHandleOptions<T> {
53
64
  request: StandardLazyRequest;
54
65
  }
55
66
  type StandardHandlerRoutingInterceptor<T extends Context> = Interceptor<StandardHandlerRoutingInterceptorOptions<T>, Promise<StandardHandlerHandleResult>>;
@@ -73,7 +84,7 @@ interface StandardHandlerOptions<TContext extends Context> {
73
84
  * ClientInterceptor equivalent with createRouterClient.interceptors / createProcedure.interceptors
74
85
  * useful for error handling, logging, metrics, etc. (not counting encoding/decoding)
75
86
  */
76
- clientInterceptors?: ProcedureClientInterceptor<TContext, Schema<unknown>, ErrorMap, any>[];
87
+ clientInterceptors?: ProcedureClientInterceptor<TContext, Schema<unknown>, ErrorMap>[];
77
88
  plugins?: StandardHandlerPlugin<TContext>[];
78
89
  }
79
90
  declare class StandardHandler<T extends Context> {
@@ -82,9 +93,9 @@ declare class StandardHandler<T extends Context> {
82
93
  private readonly interceptors;
83
94
  private readonly clientInterceptors;
84
95
  constructor(codec: StandardHandlerCodec<T>, options: StandardHandlerOptions<T>);
85
- handle(request: StandardLazyRequest, { context, prefix }: StandardHandlerHandleOptions<T>): Promise<StandardHandlerHandleResult>;
96
+ handle(request: StandardLazyRequest, options: StandardHandlerHandleOptions<T>): Promise<StandardHandlerHandleResult>;
86
97
  }
87
- declare class OtelHandlerPlugin implements StandardHandlerPlugin<any> {
98
+ declare class TracingHandlerPlugin implements StandardHandlerPlugin<any> {
88
99
  name: string;
89
100
  init(options: StandardHandlerOptions<any>): StandardHandlerOptions<any>;
90
101
  }
@@ -95,10 +106,10 @@ interface StandardHandlerCodecResolvedProcedure {
95
106
  decodeInput: () => Promise<unknown>;
96
107
  }
97
108
  interface StandardHandlerCodec<T extends Context> {
98
- resolveProcedure(request: StandardLazyRequest, options: StandardHandlerHandleOptions<T>): Promisable<StandardHandlerCodecResolvedProcedure | undefined>;
99
- encodeOutput(output: unknown, procedure: AnyProcedure, path: string[], options: StandardHandlerHandleOptions<T>): Promisable<StandardResponse>;
100
- encodeError(error: AnyORPCError, procedure: AnyProcedure, path: string[], options: StandardHandlerHandleOptions<T>): Promisable<StandardResponse>;
109
+ resolveProcedure(request: StandardLazyRequest, options: ResolvedStandardHandlerHandleOptions<T>): Promisable<StandardHandlerCodecResolvedProcedure | undefined>;
110
+ encodeOutput(output: unknown, procedure: AnyProcedure, path: string[], options: ResolvedStandardHandlerHandleOptions<T>): Promisable<StandardResponse>;
111
+ encodeError(error: AnyORPCError, procedure: AnyProcedure, path: string[], options: ResolvedStandardHandlerHandleOptions<T>): Promisable<StandardResponse>;
101
112
  }
102
113
 
103
- export { CompositeStandardHandlerPlugin as C, OtelHandlerPlugin as O, StandardHandler as S };
104
- export type { StandardHandlerOptions as a, StandardHandlerHandleOptions as b, StandardHandlerCodec as c, StandardHandlerCodecResolvedProcedure as d, StandardHandlerPlugin as e, StandardHandlerRoutingInterceptorOptions as f, StandardHandlerInterceptorOptions as g, StandardHandlerHandleResult as h, StandardHandlerInterceptor as i, StandardHandlerRoutingInterceptor as j };
114
+ export { CompositeStandardHandlerPlugin as C, StandardHandler as S, TracingHandlerPlugin as T };
115
+ export type { ResolvedStandardHandlerHandleOptions as R, StandardHandlerHandleOptions as a, StandardHandlerPlugin as b, StandardHandlerOptions as c, StandardHandlerRoutingInterceptorOptions as d, StandardHandlerInterceptorOptions as e, StandardHandlerCodec as f, StandardHandlerCodecResolvedProcedure as g, StandardHandlerHandleResult as h, StandardHandlerInterceptor as i, StandardHandlerRoutingInterceptor as j };
@@ -1,10 +1,10 @@
1
1
  import { RouterContract, ProcedureContract, ORPCErrorFromErrorMap, ThrowableError, InferSchemaInput, InferSchemaOutput } from '@orpc/contract';
2
- import { C as Context, a as Procedure, L as Lazyable, M as MergedContext } from './server.BL22TloH.mjs';
2
+ import { C as Context, a as Procedure, L as Lazyable, M as MergedContext } from './server.BsujoJoF.mjs';
3
3
 
4
- type Router<TInitialContext extends Context> = Procedure<TInitialContext, any, any, any, any, any> | {
4
+ type Router<TInitialContext extends Context> = Procedure<TInitialContext, any, any, any, any> | {
5
5
  [k: string]: Lazyable<Router<TInitialContext>>;
6
6
  };
7
- type ContractedRouter<T extends RouterContract, TInitialContext extends Context> = T extends ProcedureContract<infer $InputSchema, infer $OutputSchema, infer $ErrorMap> ? Procedure<TInitialContext, any, $InputSchema, $OutputSchema, $ErrorMap, never> : {
7
+ type ContractedRouter<T extends RouterContract, TInitialContext extends Context> = T extends ProcedureContract<infer $InputSchema, infer $OutputSchema, infer $ErrorMap> ? Procedure<TInitialContext, any, $InputSchema, $OutputSchema, $ErrorMap> : {
8
8
  [K in keyof T]: T[K] extends RouterContract ? Lazyable<ContractedRouter<T[K], TInitialContext>> : never;
9
9
  };
10
10
  type AnyRouter = Router<any>;
@@ -12,50 +12,62 @@ type InferRouterInitialContext<T extends AnyRouter> = T extends Router<infer $>
12
12
  /**
13
13
  * Infer all initial context of the router.
14
14
  *
15
- * @info A procedure is a router too.
16
- * @see {@link https://orpc.dev/docs/router#utilities Router Utilities Docs}
15
+ * @remarks
16
+ * **Note**: A procedure is a router too.
17
+ *
18
+ * @see {@link https://orpc.dev/docs/router#infer-router-initial-contexts | Router - Infer Router Initial Contexts}
17
19
  */
18
- type InferRouterInitialContexts<T extends AnyRouter> = T extends Procedure<infer UInitialContext, any, any, any, any, any> ? UInitialContext : {
20
+ type InferRouterInitialContexts<T extends AnyRouter> = T extends Procedure<infer UInitialContext, any, any, any, any> ? UInitialContext : {
19
21
  [K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterInitialContexts<U> : never;
20
22
  };
21
23
  /**
22
24
  * Infer all current context of the router.
23
25
  *
24
- * @info A procedure is a router too.
25
- * @see {@link https://orpc.dev/docs/router#utilities Router Utilities Docs}
26
+ * @remarks
27
+ * **Note**: A procedure is a router too.
28
+ *
29
+ * @see {@link https://orpc.dev/docs/router#infer-router-final-contexts | Router - Infer Router Final Contexts}
26
30
  */
27
- type InferRouterFinalContexts<T extends AnyRouter> = T extends Procedure<infer UInitialContext, infer UInjectedContext, any, any, any, any> ? MergedContext<UInitialContext, UInjectedContext> : {
31
+ type InferRouterFinalContexts<T extends AnyRouter> = T extends Procedure<infer UInitialContext, infer UInjectedContext, any, any, any> ? MergedContext<UInitialContext, UInjectedContext> : {
28
32
  [K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterFinalContexts<U> : never;
29
33
  };
30
34
  /**
31
- * Infer all router inputs
35
+ * Infer all router inputs.
36
+ *
37
+ * @remarks
38
+ * **Note**: A procedure is a router too.
32
39
  *
33
- * @info A procedure is a router too.
34
- * @see {@link https://orpc.dev/docs/router#utilities Router Utilities Docs}
40
+ * @see {@link https://orpc.dev/docs/router#infer-router-inputs | Router - Infer Router Inputs}
35
41
  */
36
- type InferRouterInputs<T extends AnyRouter> = T extends Procedure<any, any, infer UInputSchema, any, any, any> ? InferSchemaInput<UInputSchema> : {
42
+ type InferRouterInputs<T extends AnyRouter> = T extends Procedure<any, any, infer UInputSchema, any, any> ? InferSchemaInput<UInputSchema> : {
37
43
  [K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterInputs<U> : never;
38
44
  };
39
45
  /**
40
- * Infer all router outputs
46
+ * Infer all router outputs.
41
47
  *
42
- * @info A procedure is a router too.
43
- * @see {@link https://orpc.dev/docs/router#utilities Router Utilities Docs}
48
+ * @remarks
49
+ * **Note**: A procedure is a router too.
50
+ *
51
+ * @see {@link https://orpc.dev/docs/router#infer-router-outputs | Router - Infer Router Outputs}
44
52
  */
45
- type InferRouterOutputs<T extends AnyRouter> = T extends Procedure<any, any, any, infer UOutputSchema, any, any> ? InferSchemaOutput<UOutputSchema> : {
53
+ type InferRouterOutputs<T extends AnyRouter> = T extends Procedure<any, any, any, infer UOutputSchema, any> ? InferSchemaOutput<UOutputSchema> : {
46
54
  [K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterOutputs<U> : never;
47
55
  };
48
56
  /**
49
57
  * Infer the union of throwable errors for entire router.
58
+ *
59
+ * @see {@link https://orpc.dev/docs/router#infer-router-error | Router - Infer Router Error}
50
60
  */
51
- type InferRouterError<T extends AnyRouter> = T extends Procedure<any, any, any, any, infer UErrorMap, infer UReturnedError> ? ORPCErrorFromErrorMap<UErrorMap> | UReturnedError | ThrowableError : {
61
+ type InferRouterError<T extends AnyRouter> = T extends Procedure<any, any, any, any, infer UErrorMap> ? ORPCErrorFromErrorMap<UErrorMap> | ThrowableError : {
52
62
  [K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterError<U> : never;
53
63
  }[keyof T];
54
64
  /**
55
65
  * Infer throwable errors for each procedure, preserving the router shape.
66
+ *
67
+ * @see {@link https://orpc.dev/docs/router#infer-router-errors | Router - Infer Router Errors}
56
68
  */
57
- type InferRouterErrors<T extends AnyRouter> = T extends Procedure<any, any, any, any, infer UErrorMap, infer UReturnedError> ? ORPCErrorFromErrorMap<UErrorMap> | UReturnedError | ThrowableError : {
69
+ type InferRouterErrors<T extends AnyRouter> = T extends Procedure<any, any, any, any, infer UErrorMap> ? ORPCErrorFromErrorMap<UErrorMap> | ThrowableError : {
58
70
  [K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? InferRouterErrors<U> : never;
59
71
  };
60
72
 
61
- export type { AnyRouter as A, ContractedRouter as C, InferRouterInitialContext as I, Router as R, InferRouterError as a, InferRouterErrors as b, InferRouterFinalContexts as c, InferRouterInitialContexts as d, InferRouterInputs as e, InferRouterOutputs as f };
73
+ export type { AnyRouter as A, ContractedRouter as C, InferRouterInitialContext as I, Router as R, InferRouterFinalContexts as a, InferRouterError as b, InferRouterErrors as c, InferRouterInitialContexts as d, InferRouterInputs as e, InferRouterOutputs as f };
@@ -1,5 +1,5 @@
1
- import { ORPCErrorCode, ORPCErrorOptions, ORPCError, AnyORPCError, ClientContext, Client } from '@orpc/client';
2
- import { ErrorMap, ErrorMapItem, InferSchemaInput, AnyMetaPlugin, AnySchema, ProcedureContractDefinition, Meta, InferSchemaOutput, ORPCErrorFromErrorMap } from '@orpc/contract';
1
+ import { ClientContext, Client } from '@orpc/client';
2
+ import { ErrorMap, AnyMetaPlugin, ORPCErrorConstructorMap, AnySchema, ProcedureContractDefinition, Meta, InferSchemaOutput, ORPCErrorFromErrorMap, InferSchemaInput } from '@orpc/contract';
3
3
  import { MaybeOptionalOptions, Promisable, Interceptor, PromiseWithError, ThrowableError, Value } from '@orpc/shared';
4
4
 
5
5
  interface Context {
@@ -8,40 +8,6 @@ interface Context {
8
8
  type MergedInitialContext<TInitial extends Context, TOutContext extends Context, TInContext extends Context> = Exclude<keyof TInContext, keyof TInitial | keyof TOutContext> extends never ? TInitial : TInitial & Omit<TInContext, keyof TInitial | keyof TOutContext>;
9
9
  type MergedContext<TCurrent extends Context, TOutContext extends Context> = keyof TOutContext extends never ? TCurrent : Omit<TCurrent, keyof TOutContext> & TOutContext;
10
10
 
11
- type ORPCErrorConstructorMapItemOptions<TData> = Omit<ORPCErrorOptions<TData>, 'status'>;
12
- interface ORPCErrorConstructorMapItem<TCode extends ORPCErrorCode, TInData> {
13
- (...rest: MaybeOptionalOptions<ORPCErrorConstructorMapItemOptions<TInData>>): ORPCError<TCode, TInData>;
14
- }
15
- type ORPCErrorConstructorMap<T extends ErrorMap> = {
16
- [K in keyof T]: K extends ORPCErrorCode ? T[K] extends ErrorMapItem<infer UInputSchema> ? ORPCErrorConstructorMapItem<K, InferSchemaInput<UInputSchema>> : never : never;
17
- };
18
- /**
19
- * Creates a map of ORPC error constructors.
20
- *
21
- * The returned object is a `Proxy` that allows access to arbitrary error codes:
22
- * - If the code exists in the provided `errorMap`, the corresponding constructor
23
- * will create a **defined** `ORPCError`.
24
- * - If the code does not exist, a fallback `ORPCError` constructor is returned.
25
- *
26
- * The `in` operator can be used to check whether an error code is explicitly
27
- * defined in the map.
28
- *
29
- * @example
30
- * ```ts
31
- * const errorMap = createORPCErrorConstructorMap({
32
- * NOT_FOUND: {
33
- * status: 404,
34
- * message: 'Not Found',
35
- * },
36
- * })
37
- *
38
- * if ('NOT_FOUND' in errorMap) {
39
- * const error = errorMap.NOT_FOUND()
40
- * }
41
- * ```
42
- */
43
- declare function createORPCErrorConstructorMap<T extends ErrorMap>(errorMap: T): ORPCErrorConstructorMap<T>;
44
-
45
11
  type MiddlewareResult<TOutContext extends Context, TOutput> = Promisable<{
46
12
  output: TOutput;
47
13
  context: TOutContext;
@@ -94,7 +60,7 @@ interface ProcedureHandlerOptions<TCurrentContext extends Context, TInput, TErro
94
60
  context: TCurrentContext;
95
61
  input: TInput;
96
62
  path: string[];
97
- procedure: Procedure<Context, Context, AnySchema, AnySchema, ErrorMap, any>;
63
+ procedure: Procedure<Context, Context, AnySchema, AnySchema, ErrorMap>;
98
64
  signal?: AbortSignal | undefined;
99
65
  lastEventId?: string | undefined;
100
66
  errors: TErrorConstructorMap;
@@ -119,32 +85,45 @@ interface OrderedMiddleware {
119
85
  outputSchemasLengthAtUse?: number | undefined;
120
86
  middleware: AnyMiddleware;
121
87
  }
122
- interface ProcedureDefinition<TInitialContext extends Context, TInjectedContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TReturnedError extends AnyORPCError> extends ProcedureContractDefinition<TInputSchema, TOutputSchema, TErrorMap> {
123
- __TInitialContext?: (type: TInitialContext) => unknown;
124
- __TInjectedContext?: (type: TInjectedContext) => unknown;
125
- __TReturnedError?: () => TReturnedError;
88
+ interface ProcedureConfig {
89
+ /**
90
+ * When enabled, input schemas are not validated at runtime.
91
+ * Schemas are still used for type inference and OpenAPI generation.
92
+ *
93
+ * @remarks
94
+ * **Warning**: Do not disable validation for schemas that transform values.
95
+ *
96
+ * @default false
97
+ */
98
+ disableInputValidation?: boolean | undefined;
126
99
  /**
127
- * When enabled, errors returned (not thrown) by the handler are passed through as-is,
128
- * rather than being transformed into inferrable errors.
100
+ * When enabled, output schemas are not validated at runtime.
101
+ * Schemas are still used for type inference and OpenAPI generation.
102
+ *
103
+ * Useful when output schemas exist only for specification generation.
129
104
  *
130
- * This is intended for the contract-first approach, where the procedure adheres to an
131
- * external contract and returned errors should not affect the inferred contract types.
105
+ * @remarks
106
+ * **Warning**: Do not disable validation for schemas that transform values.
132
107
  *
133
108
  * @default false
134
109
  */
135
- opaqueReturnedErrors?: boolean | undefined;
110
+ disableOutputValidation?: boolean | undefined;
111
+ }
112
+ interface ProcedureDefinition<TInitialContext extends Context, TInjectedContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap> extends ProcedureContractDefinition<TInputSchema, TOutputSchema, TErrorMap>, ProcedureConfig {
113
+ __TInitialContext?: (type: TInitialContext) => unknown;
114
+ __TInjectedContext?: (type: TInjectedContext) => unknown;
136
115
  orderedMiddlewares: OrderedMiddleware[];
137
116
  handler: ProcedureHandler<any, any, any, any>;
138
117
  }
139
- declare class Procedure<TInitialContext extends Context, TInjectedContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TReturnedError extends AnyORPCError> {
140
- '~orpc': ProcedureDefinition<TInitialContext, TInjectedContext, TInputSchema, TOutputSchema, TErrorMap, TReturnedError>;
141
- constructor(def: ProcedureDefinition<TInitialContext, TInjectedContext, TInputSchema, TOutputSchema, TErrorMap, TReturnedError>);
118
+ declare class Procedure<TInitialContext extends Context, TInjectedContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap> {
119
+ '~orpc': ProcedureDefinition<TInitialContext, TInjectedContext, TInputSchema, TOutputSchema, TErrorMap>;
120
+ constructor(def: ProcedureDefinition<TInitialContext, TInjectedContext, TInputSchema, TOutputSchema, TErrorMap>);
142
121
  /**
143
- * Checks if the given instance satisfies the {@see Procedure} class/interface.
122
+ * Checks if the given instance satisfies the {@link Procedure} class/interface.
144
123
  */
145
124
  static [Symbol.hasInstance](instance: unknown): boolean;
146
125
  }
147
- type AnyProcedure = Procedure<any, any, any, any, any, any>;
126
+ type AnyProcedure = Procedure<any, any, any, any, any>;
148
127
 
149
128
  interface LazyDefinition<T> {
150
129
  meta: Meta;
@@ -157,7 +136,7 @@ declare class Lazy<T> {
157
136
  '~orpc': LazyDefinition<T>;
158
137
  constructor(def: LazyDefinition<T>);
159
138
  /**
160
- * Checks if the given instance satisfies the {@see Lazy} class/interface.
139
+ * Checks if the given instance satisfies the {@link Lazy} class/interface.
161
140
  */
162
141
  static [Symbol.hasInstance](instance: unknown): boolean;
163
142
  }
@@ -166,19 +145,19 @@ declare function unlazy<T extends Lazyable<any>>(maybeLazy: T): Promise<{
166
145
  default: T extends Lazy<infer U> ? U : T;
167
146
  }>;
168
147
 
169
- type ProcedureClient<TClientContext extends ClientContext, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TReturnedORPCError extends AnyORPCError> = Client<TClientContext, InferSchemaInput<TInputSchema>, InferSchemaOutput<TOutputSchema>, ORPCErrorFromErrorMap<TErrorMap> | TReturnedORPCError | ThrowableError>;
148
+ type ProcedureClient<TClientContext extends ClientContext, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap> = Client<TClientContext, InferSchemaInput<TInputSchema>, InferSchemaOutput<TOutputSchema>, ORPCErrorFromErrorMap<TErrorMap> | ThrowableError>;
170
149
  interface ProcedureClientInterceptorOptions<TInitialContext extends Context, TErrorMap extends ErrorMap> extends ProcedureHandlerOptions<TInitialContext, unknown, ORPCErrorConstructorMap<TErrorMap>> {
171
150
  }
172
- type ProcedureClientInterceptor<TInitialContext extends Context, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TReturnedError extends AnyORPCError> = Interceptor<ProcedureClientInterceptorOptions<TInitialContext, TErrorMap>, PromiseWithError<InferSchemaOutput<TOutputSchema>, ORPCErrorFromErrorMap<TErrorMap> | TReturnedError | ThrowableError>>;
173
- type ProcedureClientOptions<TInitialContext extends Context, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TReturnedError extends AnyORPCError, TClientContext extends ClientContext> = {
151
+ type ProcedureClientInterceptor<TInitialContext extends Context, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap> = Interceptor<ProcedureClientInterceptorOptions<TInitialContext, TErrorMap>, PromiseWithError<InferSchemaOutput<TOutputSchema>, ORPCErrorFromErrorMap<TErrorMap> | ThrowableError>>;
152
+ type ProcedureClientOptions<TInitialContext extends Context, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TClientContext extends ClientContext> = {
174
153
  path?: string[];
175
- interceptors?: ProcedureClientInterceptor<TInitialContext, TOutputSchema, TErrorMap, TReturnedError>[];
154
+ interceptors?: ProcedureClientInterceptor<TInitialContext, TOutputSchema, TErrorMap>[];
176
155
  } & (object extends TInitialContext ? {
177
156
  context?: Value<Promisable<TInitialContext>, [clientContext: TClientContext]>;
178
157
  } : {
179
158
  context: Value<Promisable<TInitialContext>, [clientContext: TClientContext]>;
180
159
  });
181
- declare function createProcedureClient<TInitialContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TReturnedError extends AnyORPCError, TClientContext extends ClientContext = object>(lazyableProcedure: Lazyable<Procedure<TInitialContext, any, TInputSchema, TOutputSchema, TErrorMap, TReturnedError>>, ...rest: MaybeOptionalOptions<ProcedureClientOptions<TInitialContext, TOutputSchema, TErrorMap, TReturnedError, TClientContext>>): ProcedureClient<TClientContext, TInputSchema, TOutputSchema, TErrorMap, TReturnedError>;
160
+ declare function createProcedureClient<TInitialContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TClientContext extends ClientContext = object>(lazyableProcedure: Lazyable<Procedure<TInitialContext, any, TInputSchema, TOutputSchema, TErrorMap>>, ...rest: MaybeOptionalOptions<ProcedureClientOptions<TInitialContext, TOutputSchema, TErrorMap, TClientContext>>): ProcedureClient<TClientContext, TInputSchema, TOutputSchema, TErrorMap>;
182
161
 
183
- export { Procedure as a, Lazy as g, createORPCErrorConstructorMap as w, createProcedureClient as x, unlazy as y };
184
- export type { AnyProcedure as A, Context as C, Lazyable as L, MergedContext as M, ORPCErrorConstructorMap as O, ProcedureClientOptions as P, ProcedureClient as b, ProcedureClientInterceptor as c, Middleware as d, MergedInitialContext as e, AnyMiddleware as f, ProcedureHandler as h, OrderedMiddleware as i, LazyDefinition as j, MiddlewareDefinition as k, MiddlewareDone as l, MiddlewareDoneOptions as m, MiddlewareNext as n, MiddlewareNextOptions as o, MiddlewareOptions as p, MiddlewareResult as q, ORPCErrorConstructorMapItem as r, ORPCErrorConstructorMapItemOptions as s, ProcedureClientInterceptorOptions as t, ProcedureDefinition as u, ProcedureHandlerOptions as v };
162
+ export { Procedure as a, Lazy as h, createProcedureClient as u, unlazy as v };
163
+ export type { AnyProcedure as A, Context as C, Lazyable as L, MergedContext as M, OrderedMiddleware as O, ProcedureClientOptions as P, ProcedureClient as b, ProcedureClientInterceptor as c, Middleware as d, MergedInitialContext as e, ProcedureConfig as f, AnyMiddleware as g, ProcedureHandler as i, LazyDefinition as j, MiddlewareDefinition as k, MiddlewareDone as l, MiddlewareDoneOptions as m, MiddlewareNext as n, MiddlewareNextOptions as o, MiddlewareOptions as p, MiddlewareResult as q, ProcedureClientInterceptorOptions as r, ProcedureDefinition as s, ProcedureHandlerOptions as t };
@@ -1,5 +1,5 @@
1
- import { ORPCErrorCode, ORPCErrorOptions, ORPCError, AnyORPCError, ClientContext, Client } from '@orpc/client';
2
- import { ErrorMap, ErrorMapItem, InferSchemaInput, AnyMetaPlugin, AnySchema, ProcedureContractDefinition, Meta, InferSchemaOutput, ORPCErrorFromErrorMap } from '@orpc/contract';
1
+ import { ClientContext, Client } from '@orpc/client';
2
+ import { ErrorMap, AnyMetaPlugin, ORPCErrorConstructorMap, AnySchema, ProcedureContractDefinition, Meta, InferSchemaOutput, ORPCErrorFromErrorMap, InferSchemaInput } from '@orpc/contract';
3
3
  import { MaybeOptionalOptions, Promisable, Interceptor, PromiseWithError, ThrowableError, Value } from '@orpc/shared';
4
4
 
5
5
  interface Context {
@@ -8,40 +8,6 @@ interface Context {
8
8
  type MergedInitialContext<TInitial extends Context, TOutContext extends Context, TInContext extends Context> = Exclude<keyof TInContext, keyof TInitial | keyof TOutContext> extends never ? TInitial : TInitial & Omit<TInContext, keyof TInitial | keyof TOutContext>;
9
9
  type MergedContext<TCurrent extends Context, TOutContext extends Context> = keyof TOutContext extends never ? TCurrent : Omit<TCurrent, keyof TOutContext> & TOutContext;
10
10
 
11
- type ORPCErrorConstructorMapItemOptions<TData> = Omit<ORPCErrorOptions<TData>, 'status'>;
12
- interface ORPCErrorConstructorMapItem<TCode extends ORPCErrorCode, TInData> {
13
- (...rest: MaybeOptionalOptions<ORPCErrorConstructorMapItemOptions<TInData>>): ORPCError<TCode, TInData>;
14
- }
15
- type ORPCErrorConstructorMap<T extends ErrorMap> = {
16
- [K in keyof T]: K extends ORPCErrorCode ? T[K] extends ErrorMapItem<infer UInputSchema> ? ORPCErrorConstructorMapItem<K, InferSchemaInput<UInputSchema>> : never : never;
17
- };
18
- /**
19
- * Creates a map of ORPC error constructors.
20
- *
21
- * The returned object is a `Proxy` that allows access to arbitrary error codes:
22
- * - If the code exists in the provided `errorMap`, the corresponding constructor
23
- * will create a **defined** `ORPCError`.
24
- * - If the code does not exist, a fallback `ORPCError` constructor is returned.
25
- *
26
- * The `in` operator can be used to check whether an error code is explicitly
27
- * defined in the map.
28
- *
29
- * @example
30
- * ```ts
31
- * const errorMap = createORPCErrorConstructorMap({
32
- * NOT_FOUND: {
33
- * status: 404,
34
- * message: 'Not Found',
35
- * },
36
- * })
37
- *
38
- * if ('NOT_FOUND' in errorMap) {
39
- * const error = errorMap.NOT_FOUND()
40
- * }
41
- * ```
42
- */
43
- declare function createORPCErrorConstructorMap<T extends ErrorMap>(errorMap: T): ORPCErrorConstructorMap<T>;
44
-
45
11
  type MiddlewareResult<TOutContext extends Context, TOutput> = Promisable<{
46
12
  output: TOutput;
47
13
  context: TOutContext;
@@ -94,7 +60,7 @@ interface ProcedureHandlerOptions<TCurrentContext extends Context, TInput, TErro
94
60
  context: TCurrentContext;
95
61
  input: TInput;
96
62
  path: string[];
97
- procedure: Procedure<Context, Context, AnySchema, AnySchema, ErrorMap, any>;
63
+ procedure: Procedure<Context, Context, AnySchema, AnySchema, ErrorMap>;
98
64
  signal?: AbortSignal | undefined;
99
65
  lastEventId?: string | undefined;
100
66
  errors: TErrorConstructorMap;
@@ -119,32 +85,45 @@ interface OrderedMiddleware {
119
85
  outputSchemasLengthAtUse?: number | undefined;
120
86
  middleware: AnyMiddleware;
121
87
  }
122
- interface ProcedureDefinition<TInitialContext extends Context, TInjectedContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TReturnedError extends AnyORPCError> extends ProcedureContractDefinition<TInputSchema, TOutputSchema, TErrorMap> {
123
- __TInitialContext?: (type: TInitialContext) => unknown;
124
- __TInjectedContext?: (type: TInjectedContext) => unknown;
125
- __TReturnedError?: () => TReturnedError;
88
+ interface ProcedureConfig {
89
+ /**
90
+ * When enabled, input schemas are not validated at runtime.
91
+ * Schemas are still used for type inference and OpenAPI generation.
92
+ *
93
+ * @remarks
94
+ * **Warning**: Do not disable validation for schemas that transform values.
95
+ *
96
+ * @default false
97
+ */
98
+ disableInputValidation?: boolean | undefined;
126
99
  /**
127
- * When enabled, errors returned (not thrown) by the handler are passed through as-is,
128
- * rather than being transformed into inferrable errors.
100
+ * When enabled, output schemas are not validated at runtime.
101
+ * Schemas are still used for type inference and OpenAPI generation.
102
+ *
103
+ * Useful when output schemas exist only for specification generation.
129
104
  *
130
- * This is intended for the contract-first approach, where the procedure adheres to an
131
- * external contract and returned errors should not affect the inferred contract types.
105
+ * @remarks
106
+ * **Warning**: Do not disable validation for schemas that transform values.
132
107
  *
133
108
  * @default false
134
109
  */
135
- opaqueReturnedErrors?: boolean | undefined;
110
+ disableOutputValidation?: boolean | undefined;
111
+ }
112
+ interface ProcedureDefinition<TInitialContext extends Context, TInjectedContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap> extends ProcedureContractDefinition<TInputSchema, TOutputSchema, TErrorMap>, ProcedureConfig {
113
+ __TInitialContext?: (type: TInitialContext) => unknown;
114
+ __TInjectedContext?: (type: TInjectedContext) => unknown;
136
115
  orderedMiddlewares: OrderedMiddleware[];
137
116
  handler: ProcedureHandler<any, any, any, any>;
138
117
  }
139
- declare class Procedure<TInitialContext extends Context, TInjectedContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TReturnedError extends AnyORPCError> {
140
- '~orpc': ProcedureDefinition<TInitialContext, TInjectedContext, TInputSchema, TOutputSchema, TErrorMap, TReturnedError>;
141
- constructor(def: ProcedureDefinition<TInitialContext, TInjectedContext, TInputSchema, TOutputSchema, TErrorMap, TReturnedError>);
118
+ declare class Procedure<TInitialContext extends Context, TInjectedContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap> {
119
+ '~orpc': ProcedureDefinition<TInitialContext, TInjectedContext, TInputSchema, TOutputSchema, TErrorMap>;
120
+ constructor(def: ProcedureDefinition<TInitialContext, TInjectedContext, TInputSchema, TOutputSchema, TErrorMap>);
142
121
  /**
143
- * Checks if the given instance satisfies the {@see Procedure} class/interface.
122
+ * Checks if the given instance satisfies the {@link Procedure} class/interface.
144
123
  */
145
124
  static [Symbol.hasInstance](instance: unknown): boolean;
146
125
  }
147
- type AnyProcedure = Procedure<any, any, any, any, any, any>;
126
+ type AnyProcedure = Procedure<any, any, any, any, any>;
148
127
 
149
128
  interface LazyDefinition<T> {
150
129
  meta: Meta;
@@ -157,7 +136,7 @@ declare class Lazy<T> {
157
136
  '~orpc': LazyDefinition<T>;
158
137
  constructor(def: LazyDefinition<T>);
159
138
  /**
160
- * Checks if the given instance satisfies the {@see Lazy} class/interface.
139
+ * Checks if the given instance satisfies the {@link Lazy} class/interface.
161
140
  */
162
141
  static [Symbol.hasInstance](instance: unknown): boolean;
163
142
  }
@@ -166,19 +145,19 @@ declare function unlazy<T extends Lazyable<any>>(maybeLazy: T): Promise<{
166
145
  default: T extends Lazy<infer U> ? U : T;
167
146
  }>;
168
147
 
169
- type ProcedureClient<TClientContext extends ClientContext, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TReturnedORPCError extends AnyORPCError> = Client<TClientContext, InferSchemaInput<TInputSchema>, InferSchemaOutput<TOutputSchema>, ORPCErrorFromErrorMap<TErrorMap> | TReturnedORPCError | ThrowableError>;
148
+ type ProcedureClient<TClientContext extends ClientContext, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap> = Client<TClientContext, InferSchemaInput<TInputSchema>, InferSchemaOutput<TOutputSchema>, ORPCErrorFromErrorMap<TErrorMap> | ThrowableError>;
170
149
  interface ProcedureClientInterceptorOptions<TInitialContext extends Context, TErrorMap extends ErrorMap> extends ProcedureHandlerOptions<TInitialContext, unknown, ORPCErrorConstructorMap<TErrorMap>> {
171
150
  }
172
- type ProcedureClientInterceptor<TInitialContext extends Context, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TReturnedError extends AnyORPCError> = Interceptor<ProcedureClientInterceptorOptions<TInitialContext, TErrorMap>, PromiseWithError<InferSchemaOutput<TOutputSchema>, ORPCErrorFromErrorMap<TErrorMap> | TReturnedError | ThrowableError>>;
173
- type ProcedureClientOptions<TInitialContext extends Context, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TReturnedError extends AnyORPCError, TClientContext extends ClientContext> = {
151
+ type ProcedureClientInterceptor<TInitialContext extends Context, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap> = Interceptor<ProcedureClientInterceptorOptions<TInitialContext, TErrorMap>, PromiseWithError<InferSchemaOutput<TOutputSchema>, ORPCErrorFromErrorMap<TErrorMap> | ThrowableError>>;
152
+ type ProcedureClientOptions<TInitialContext extends Context, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TClientContext extends ClientContext> = {
174
153
  path?: string[];
175
- interceptors?: ProcedureClientInterceptor<TInitialContext, TOutputSchema, TErrorMap, TReturnedError>[];
154
+ interceptors?: ProcedureClientInterceptor<TInitialContext, TOutputSchema, TErrorMap>[];
176
155
  } & (object extends TInitialContext ? {
177
156
  context?: Value<Promisable<TInitialContext>, [clientContext: TClientContext]>;
178
157
  } : {
179
158
  context: Value<Promisable<TInitialContext>, [clientContext: TClientContext]>;
180
159
  });
181
- declare function createProcedureClient<TInitialContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TReturnedError extends AnyORPCError, TClientContext extends ClientContext = object>(lazyableProcedure: Lazyable<Procedure<TInitialContext, any, TInputSchema, TOutputSchema, TErrorMap, TReturnedError>>, ...rest: MaybeOptionalOptions<ProcedureClientOptions<TInitialContext, TOutputSchema, TErrorMap, TReturnedError, TClientContext>>): ProcedureClient<TClientContext, TInputSchema, TOutputSchema, TErrorMap, TReturnedError>;
160
+ declare function createProcedureClient<TInitialContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TClientContext extends ClientContext = object>(lazyableProcedure: Lazyable<Procedure<TInitialContext, any, TInputSchema, TOutputSchema, TErrorMap>>, ...rest: MaybeOptionalOptions<ProcedureClientOptions<TInitialContext, TOutputSchema, TErrorMap, TClientContext>>): ProcedureClient<TClientContext, TInputSchema, TOutputSchema, TErrorMap>;
182
161
 
183
- export { Procedure as a, Lazy as g, createORPCErrorConstructorMap as w, createProcedureClient as x, unlazy as y };
184
- export type { AnyProcedure as A, Context as C, Lazyable as L, MergedContext as M, ORPCErrorConstructorMap as O, ProcedureClientOptions as P, ProcedureClient as b, ProcedureClientInterceptor as c, Middleware as d, MergedInitialContext as e, AnyMiddleware as f, ProcedureHandler as h, OrderedMiddleware as i, LazyDefinition as j, MiddlewareDefinition as k, MiddlewareDone as l, MiddlewareDoneOptions as m, MiddlewareNext as n, MiddlewareNextOptions as o, MiddlewareOptions as p, MiddlewareResult as q, ORPCErrorConstructorMapItem as r, ORPCErrorConstructorMapItemOptions as s, ProcedureClientInterceptorOptions as t, ProcedureDefinition as u, ProcedureHandlerOptions as v };
162
+ export { Procedure as a, Lazy as h, createProcedureClient as u, unlazy as v };
163
+ export type { AnyProcedure as A, Context as C, Lazyable as L, MergedContext as M, OrderedMiddleware as O, ProcedureClientOptions as P, ProcedureClient as b, ProcedureClientInterceptor as c, Middleware as d, MergedInitialContext as e, ProcedureConfig as f, AnyMiddleware as g, ProcedureHandler as i, LazyDefinition as j, MiddlewareDefinition as k, MiddlewareDone as l, MiddlewareDoneOptions as m, MiddlewareNext as n, MiddlewareNextOptions as o, MiddlewareOptions as p, MiddlewareResult as q, ProcedureClientInterceptorOptions as r, ProcedureDefinition as s, ProcedureHandlerOptions as t };