@temporary-name/server 1.9.3-alpha.65222302f1b71807a849530b3fe0fa0326d3c1a2 → 1.9.3-alpha.6a735c9469d995338b7d51335ea70485e18a4dca

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 (46) hide show
  1. package/dist/adapters/aws-lambda/index.d.mts +5 -7
  2. package/dist/adapters/aws-lambda/index.d.ts +5 -7
  3. package/dist/adapters/aws-lambda/index.mjs +5 -8
  4. package/dist/adapters/fetch/index.d.mts +8 -86
  5. package/dist/adapters/fetch/index.d.ts +8 -86
  6. package/dist/adapters/fetch/index.mjs +17 -159
  7. package/dist/adapters/node/index.d.mts +9 -64
  8. package/dist/adapters/node/index.d.ts +9 -64
  9. package/dist/adapters/node/index.mjs +15 -124
  10. package/dist/handler/index.d.mts +29 -0
  11. package/dist/handler/index.d.ts +29 -0
  12. package/dist/handler/index.mjs +8 -0
  13. package/dist/helpers/index.mjs +3 -29
  14. package/dist/index.d.mts +384 -288
  15. package/dist/index.d.ts +384 -288
  16. package/dist/index.mjs +516 -409
  17. package/dist/openapi/index.d.mts +18 -53
  18. package/dist/openapi/index.d.ts +18 -53
  19. package/dist/openapi/index.mjs +335 -380
  20. package/dist/shared/server.BCY45g2x.mjs +160 -0
  21. package/dist/shared/server.BETu17rq.mjs +319 -0
  22. package/dist/shared/server.B_oW_rPl.mjs +525 -0
  23. package/dist/shared/server.C1RJffw4.mjs +30 -0
  24. package/dist/shared/server.CjPiuQYH.d.mts +51 -0
  25. package/dist/shared/server.CjPiuQYH.d.ts +51 -0
  26. package/dist/shared/server.CunymBH3.d.mts +39 -0
  27. package/dist/shared/server.DGMnYd7G.d.ts +39 -0
  28. package/dist/shared/server.xNz5cP2B.mjs +321 -0
  29. package/dist/shared/server.zsKBRxsz.d.mts +388 -0
  30. package/dist/shared/server.zsKBRxsz.d.ts +388 -0
  31. package/package.json +13 -30
  32. package/dist/adapters/standard/index.d.mts +0 -42
  33. package/dist/adapters/standard/index.d.ts +0 -42
  34. package/dist/adapters/standard/index.mjs +0 -11
  35. package/dist/plugins/index.d.mts +0 -160
  36. package/dist/plugins/index.d.ts +0 -160
  37. package/dist/plugins/index.mjs +0 -288
  38. package/dist/shared/server.BEHw7Eyx.mjs +0 -247
  39. package/dist/shared/server.BKSOrA6h.d.mts +0 -192
  40. package/dist/shared/server.BKSOrA6h.d.ts +0 -192
  41. package/dist/shared/server.BKh8I1Ny.mjs +0 -239
  42. package/dist/shared/server.BeuTpcmO.d.mts +0 -23
  43. package/dist/shared/server.C1fnTLq0.d.mts +0 -57
  44. package/dist/shared/server.CQyYNJ1H.d.ts +0 -57
  45. package/dist/shared/server.DLsti1Pv.mjs +0 -293
  46. package/dist/shared/server.SLLuK6_v.d.ts +0 -23
package/dist/index.d.ts CHANGED
@@ -1,119 +1,84 @@
1
- import { AnySchema, ErrorMap, Meta, MergedErrorMap, Route, InferSchemaOutput, InferSchemaInput, EnhanceRouteOptions, AnyContractRouter, AnyContractProcedure, ContractProcedureBuilder, Schema, ContractRouter, ContractProcedureDef, ContractProcedure, InferContractRouterErrorMap, InferContractRouterMeta, ErrorFromErrorMap } from '@temporary-name/contract';
2
- export { ContractProcedure, ContractProcedureDef, ContractRouter, ErrorMap, ErrorMapItem, InferSchemaInput, InferSchemaOutput, InputStructure, MergedErrorMap, Meta, OutputStructure, Route, Schema, ValidationError, eventIterator, type, validateORPCError } from '@temporary-name/contract';
3
- import { IntersectPick, ClientContext, MaybeOptionalOptions, HTTPPath, ClientOptions, ClientPromiseResult } from '@temporary-name/shared';
4
- export { AsyncIteratorClass, ClientContext, EventPublisher, EventPublisherOptions, EventPublisherSubscribeIteratorOptions, HTTPMethod, HTTPPath, IntersectPick, ORPCError, Registry, ThrowableError, asyncIteratorToStream as eventIteratorToStream, isDefinedError, onError, onFinish, onStart, onSuccess, safe, streamToAsyncIteratorClass as streamToEventIterator } from '@temporary-name/shared';
5
- import { C as Context, P as Procedure, M as Middleware, O as ORPCErrorConstructorMap, a as MergedInitialContext, b as MergedCurrentContext, c as MapInputMiddleware, d as CreateProcedureClientOptions, e as ProcedureClient, A as AnyMiddleware, L as Lazyable, f as AnyRouter, g as Lazy, h as AnyProcedure, i as ProcedureHandler, R as Router, I as InferRouterInitialContext } from './shared/server.BKSOrA6h.js';
6
- export { H as InferRouterCurrentContexts, G as InferRouterInitialContexts, J as InferRouterInputs, K as InferRouterOutputs, n as LAZY_SYMBOL, o as LazyMeta, v as MiddlewareNextFn, t as MiddlewareNextFnOptions, x as MiddlewareOptions, w as MiddlewareOutputFn, s as MiddlewareResult, k as ORPCErrorConstructorMapItem, j as ORPCErrorConstructorMapItemOptions, E as ProcedureClientInterceptorOptions, B as ProcedureDef, z as ProcedureHandlerOptions, l as createORPCErrorConstructorMap, F as createProcedureClient, r as getLazyMeta, q as isLazy, D as isProcedure, p as lazy, m as mergeCurrentContext, y as middlewareOutputFn, u as unlazy } from './shared/server.BKSOrA6h.js';
1
+ import * as z from '@temporary-name/zod';
2
+ import { SchemaClass, core } from '@temporary-name/zod';
3
+ import * as zod_v4_core from 'zod/v4/core';
4
+ import { $input, $output } from 'zod/v4/core';
5
+ import { ClientContext, Value, Promisable, Client, MaybeOptionalOptions, HTTPEndpoint as HTTPEndpoint$1, IntersectPick, HTTPPath, AsyncIteratorClass, ClientOptions, HTTPMethod } from '@temporary-name/shared';
6
+ export { AsyncIteratorClass, ClientContext, EventPublisher, EventPublisherOptions, EventPublisherSubscribeIteratorOptions, HTTPMethod, HTTPPath, IntersectPick, ORPCError, asyncIteratorToStream as eventIteratorToStream, isDefinedError, onError, onFinish, onStart, onSuccess, streamToAsyncIteratorClass as streamToEventIterator } from '@temporary-name/shared';
7
+ import { C as Context, S as Schemas, I as InferProcedureClientInputs, a as InferSchemaOutput, M as Meta, L as Lazyable, P as Procedure, b as Contract, A as AnyShape, c as MergedSchemas, W as WrapShape, U as UnionToIntersection, d as AnySchema, R as Route, e as Middleware, f as MergedCurrentContext, g as MergedInitialContext, V as ValidatedAuthContext, h as AuthConfig, B as BuildContextWithAuth, i as ProcedureHandler, j as InferHandlerInputs, k as InferSchemaInput, E as EnhanceRouterOptions, l as Router, m as EnhancedRouter, n as MapInputMiddleware, o as ContractDef, p as SchemaIssue, q as Schema, r as AnyMiddleware, s as Lazy, t as AnyProcedure } from './shared/server.zsKBRxsz.js';
8
+ export { a5 as AccessibleLazyRouter, T as AnyContractDef, _ as AnyRouter, aa as ContractProcedureCallbackOptions, Z as ContractRouter, a1 as InferRouterCurrentContexts, $ as InferRouterInitialContext, a0 as InferRouterInitialContexts, a2 as InferRouterInputs, a3 as InferRouterOutputs, ai as InitialSchemas, v as LAZY_SYMBOL, w as LazyMeta, ab as LazyTraverseContractProceduresOptions, J as MiddlewareNextFn, N as MiddlewareOptions, K as MiddlewareOutputFn, H as MiddlewareResult, X as ProcedureDef, Q as ProcedureHandlerOptions, a9 as TraverseContractProcedureCallbackOptions, a8 as TraverseContractProceduresOptions, ag as TypeRest, ae as UnlaziedRouter, a6 as createAccessibleLazyRouter, a7 as enhanceRouter, D as getLazyMeta, a4 as getRouter, ah as initialSchemas, z as isLazy, Y as isProcedure, y as lazy, x as lazyInternal, u as mergeCurrentContext, G as mergeMeta, O as middlewareOutputFn, ad as resolveContractProcedures, ac as traverseContractProcedures, F as unlazy, af as unlazyRouter } from './shared/server.zsKBRxsz.js';
9
+ import * as Draft07 from '@temporary-name/interop/json-schema-typed/draft-07';
10
+ import * as Draft2019 from '@temporary-name/interop/json-schema-typed/draft-2019-09';
11
+ import * as Draft2020 from '@temporary-name/interop/json-schema-typed/draft-2020-12';
12
+ export { a as ZodToJsonSchemaConverter, Z as ZodToJsonSchemaConverterOptions } from './shared/server.CjPiuQYH.js';
13
+ import { JSONSchema } from '@temporary-name/server/openapi';
7
14
  export { getEventMeta, withEventMeta } from '@temporary-name/standard-server';
8
15
 
9
- declare class DecoratedProcedure<TInitialContext extends Context, TCurrentContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta> extends Procedure<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta> {
16
+ type ProcedureClient<TClientContext extends ClientContext, TSchemas extends Schemas> = Client<TClientContext, InferProcedureClientInputs<TSchemas>, InferSchemaOutput<TSchemas['outputSchema']>>;
17
+ type CreateProcedureClientOptions<TInitialContext extends Context, TClientContext extends ClientContext> = {
10
18
  /**
11
- * Adds type-safe custom errors.
12
- * The provided errors are spared-merged with any existing errors.
13
- *
14
- * @see {@link https://orpc.unnoq.com/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
15
- */
16
- errors<U extends ErrorMap>(errors: U): DecoratedProcedure<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, MergedErrorMap<TErrorMap, U>, TMeta>;
17
- /**
18
- * Sets or updates the metadata.
19
- * The provided metadata is spared-merged with any existing metadata.
20
- *
21
- * @see {@link https://orpc.unnoq.com/docs/metadata Metadata Docs}
22
- */
23
- meta(meta: TMeta): DecoratedProcedure<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta>;
24
- /**
25
- * Sets or updates the route definition.
26
- * The provided route is spared-merged with any existing route.
27
- * This option is typically relevant when integrating with OpenAPI.
28
- *
29
- * @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
30
- * @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
31
- */
32
- route(route: Route): DecoratedProcedure<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta>;
33
- /**
34
- * Uses a middleware to modify the context or improve the pipeline.
35
- *
36
- * @info Supports both normal middleware and inline middleware implementations.
37
- * @info Pass second argument to map the input.
38
- * @note The current context must be satisfy middleware dependent-context
39
- * @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
40
- */
41
- use<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, UInContext extends Context = TCurrentContext>(middleware: Middleware<UInContext | TCurrentContext, UOutContext, InferSchemaOutput<TInputSchema>, InferSchemaInput<TOutputSchema>, ORPCErrorConstructorMap<TErrorMap>, TMeta>): DecoratedProcedure<MergedInitialContext<TInitialContext, UInContext, TCurrentContext>, MergedCurrentContext<TCurrentContext, UOutContext>, TInputSchema, TOutputSchema, TErrorMap, TMeta>;
42
- /**
43
- * Uses a middleware to modify the context or improve the pipeline.
44
- *
45
- * @info Supports both normal middleware and inline middleware implementations.
46
- * @info Pass second argument to map the input.
47
- * @note The current context must be satisfy middleware dependent-context
48
- * @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
19
+ * This is helpful for logging and analytics.
49
20
  */
50
- use<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, UInput, UInContext extends Context = TCurrentContext>(middleware: Middleware<UInContext | TCurrentContext, UOutContext, UInput, InferSchemaInput<TOutputSchema>, ORPCErrorConstructorMap<TErrorMap>, TMeta>, mapInput: MapInputMiddleware<InferSchemaOutput<TInputSchema>, UInput>): DecoratedProcedure<MergedInitialContext<TInitialContext, UInContext, TCurrentContext>, MergedCurrentContext<TCurrentContext, UOutContext>, TInputSchema, TOutputSchema, TErrorMap, TMeta>;
21
+ path?: readonly string[];
22
+ } & (object extends TInitialContext ? {
23
+ context?: Value<Promisable<TInitialContext>, [clientContext: TClientContext]>;
24
+ } : {
25
+ context: Value<Promisable<TInitialContext>, [clientContext: TClientContext]>;
26
+ });
27
+ /**
28
+ * Create Server-side client from a procedure.
29
+ *
30
+ * @see {@link https://orpc.unnoq.com/docs/client/server-side Server-side Client Docs}
31
+ */
32
+ declare function createProcedureClient<TInitialContext extends Context, TSchemas extends Schemas, TMeta extends Meta, TClientContext extends ClientContext>(lazyableProcedure: Lazyable<Procedure<TInitialContext, any, TSchemas, TMeta>>, ...rest: MaybeOptionalOptions<CreateProcedureClientOptions<TInitialContext, TClientContext>>): ProcedureClient<TClientContext, TSchemas>;
33
+
34
+ declare class DecoratedProcedure<TInitialContext extends Context, TCurrentContext extends Context, TSchemas extends Schemas, TMeta extends Meta> extends Procedure<TInitialContext, TCurrentContext, TSchemas, TMeta> {
51
35
  /**
52
36
  * Make this procedure callable (works like a function while still being a procedure).
53
37
  *
54
38
  * @see {@link https://orpc.unnoq.com/docs/client/server-side Server-side Client Docs}
55
39
  */
56
- callable<TClientContext extends ClientContext>(...rest: MaybeOptionalOptions<CreateProcedureClientOptions<TInitialContext, TOutputSchema, TErrorMap, TMeta, TClientContext>>): DecoratedProcedure<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta> & ProcedureClient<TClientContext, TInputSchema, TOutputSchema, TErrorMap>;
40
+ callable<TClientContext extends ClientContext>(...rest: MaybeOptionalOptions<CreateProcedureClientOptions<TInitialContext, TClientContext>>): DecoratedProcedure<TInitialContext, TCurrentContext, TSchemas, TMeta> & ProcedureClient<TClientContext, TSchemas>;
57
41
  }
58
42
 
59
- declare function getRouter<T extends Lazyable<AnyRouter | undefined>>(router: T, path: readonly string[]): T extends Lazy<any> ? Lazy<AnyRouter | undefined> : Lazyable<AnyRouter | undefined>;
60
- 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> & {
61
- [K in keyof T]: T[K] extends Lazyable<AnyRouter> ? AccessibleLazyRouter<T[K]> : never;
62
- };
63
- declare function createAccessibleLazyRouter<T extends Lazy<AnyRouter | undefined>>(lazied: T): AccessibleLazyRouter<T>;
64
- 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> : {
65
- [K in keyof T]: T[K] extends Lazyable<AnyRouter> ? EnhancedRouter<T[K], TInitialContext, TCurrentContext, TErrorMap> : never;
66
- };
67
- interface EnhanceRouterOptions<TErrorMap extends ErrorMap> extends EnhanceRouteOptions {
68
- middlewares: readonly AnyMiddleware[];
69
- errorMap: TErrorMap;
70
- dedupeLeadingMiddlewares: boolean;
71
- }
72
- 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>;
73
- interface TraverseContractProceduresOptions {
74
- router: AnyContractRouter | AnyRouter;
75
- path: readonly string[];
76
- }
77
- interface TraverseContractProcedureCallbackOptions {
78
- contract: AnyContractProcedure | AnyProcedure;
79
- path: readonly string[];
80
- }
81
- /**
82
- * @deprecated Use `TraverseContractProcedureCallbackOptions` instead.
83
- */
84
- type ContractProcedureCallbackOptions = TraverseContractProcedureCallbackOptions;
85
- interface LazyTraverseContractProceduresOptions {
86
- router: Lazy<AnyRouter>;
87
- path: readonly string[];
88
- }
89
- declare function traverseContractProcedures(options: TraverseContractProceduresOptions, callback: (options: TraverseContractProcedureCallbackOptions) => void, lazyOptions?: LazyTraverseContractProceduresOptions[]): LazyTraverseContractProceduresOptions[];
90
- declare function resolveContractProcedures(options: TraverseContractProceduresOptions, callback: (options: TraverseContractProcedureCallbackOptions) => void): Promise<void>;
91
- type UnlaziedRouter<T extends AnyRouter> = T extends AnyProcedure ? T : {
92
- [K in keyof T]: T[K] extends Lazyable<infer U extends AnyRouter> ? UnlaziedRouter<U> : never;
93
- };
94
- declare function unlazyRouter<T extends AnyRouter>(router: T): Promise<UnlaziedRouter<T>>;
95
-
96
- declare class ProcedureBuilder<TInitialContext extends Context, TCurrentContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta, TGateName extends string> extends ContractProcedureBuilder<TInputSchema, TOutputSchema, TErrorMap, TMeta> {
43
+ declare class ProcedureBuilder<TInitialContext extends Context, TCurrentContext extends Context, TSchemas extends Schemas, TMeta extends Meta, TGateName extends string> extends Contract<BuilderDef<TSchemas, TMeta>> {
44
+ z: SchemaClass<TGateName>;
45
+ constructor(def: BuilderDef<TSchemas, TMeta>);
97
46
  /**
98
- * This property holds the defined options.
47
+ * Sets or updates the metadata for the contract.
48
+ * The provided metadata is spared-merged with any existing metadata in the contract.
49
+ *
50
+ * @see {@link https://orpc.unnoq.com/docs/metadata Metadata Docs}
99
51
  */
100
- '~orpc': BuilderDef<TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
101
- constructor(def: BuilderDef<TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName>);
102
- errors: <U extends ErrorMap>(errors: U) => ProcedureBuilder<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, MergedErrorMap<TErrorMap, U>, TMeta, TGateName>;
103
- meta: (meta: TMeta) => ProcedureBuilder<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
104
- route: (route: Route) => ProcedureBuilder<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
52
+ meta(meta: TMeta): ProcedureBuilder<TInitialContext, TCurrentContext, TSchemas, TMeta, TGateName>;
53
+ endpoint<U extends AnyShape[]>(strings: TemplateStringsArray, ...values: [...U]): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
54
+ pathSchema: WrapShape<UnionToIntersection<U>>;
55
+ }>, TMeta, TGateName>;
56
+ endpoint<U extends AnySchema | AnyShape = core.$ZodType<Record<string, never>, Record<string, never>>>(endpoint: HTTPEndpoint$1, schema?: U): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
57
+ pathSchema: WrapShape<U>;
58
+ }>, TMeta, TGateName>;
105
59
  /**
106
- * Defines the input validation schema.
60
+ * Sets or updates the route definition for the contract.
61
+ * The provided route is spared-merged with any existing route in the contract.
62
+ * This option is typically relevant when integrating with OpenAPI.
107
63
  *
108
- * @see {@link https://orpc.unnoq.com/docs/procedure#input-output-validation Input Validation Docs}
64
+ * @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
65
+ * @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
109
66
  */
110
- input<USchema extends AnySchema>(schema: USchema): ProcedureBuilder<TInitialContext, TCurrentContext, USchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
67
+ endpointOpts(route: Route): ProcedureBuilder<TInitialContext, TCurrentContext, TSchemas, TMeta, TGateName>;
68
+ query<U extends AnySchema | AnyShape>(schema: U): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
69
+ querySchema: WrapShape<U>;
70
+ }>, TMeta, TGateName>;
71
+ body<U extends AnySchema | AnyShape>(schema: U): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
72
+ bodySchema: WrapShape<U>;
73
+ }>, TMeta, TGateName>;
111
74
  /**
112
75
  * Defines the output validation schema.
113
76
  *
114
77
  * @see {@link https://orpc.unnoq.com/docs/procedure#input-output-validation Output Validation Docs}
115
78
  */
116
- output<USchema extends AnySchema>(schema: USchema): ProcedureBuilder<TInitialContext, TCurrentContext, TInputSchema, USchema, TErrorMap, TMeta, TGateName>;
79
+ output<U extends AnySchema | AnyShape>(schema: U): ProcedureBuilder<TInitialContext, TCurrentContext, MergedSchemas<TSchemas, {
80
+ outputSchema: WrapShape<U>;
81
+ }>, TMeta, TGateName>;
117
82
  /**
118
83
  * Uses a middleware to modify the context or improve the pipeline.
119
84
  *
@@ -121,18 +86,20 @@ declare class ProcedureBuilder<TInitialContext extends Context, TCurrentContext
121
86
  * @note The current context must be satisfy middleware dependent-context
122
87
  * @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
123
88
  */
124
- use<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, UInContext extends Context = TCurrentContext>(middleware: Middleware<UInContext | TCurrentContext, UOutContext, unknown, unknown, ORPCErrorConstructorMap<TErrorMap>, TMeta>): ProcedureBuilder<MergedInitialContext<TInitialContext, UInContext, TCurrentContext>, MergedCurrentContext<TCurrentContext, UOutContext>, TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
89
+ use<UOutContext extends IntersectPick<TCurrentContext, UOutContext>>(middleware: Middleware<TCurrentContext, UOutContext, unknown, unknown, TMeta>): ProcedureBuilder<TInitialContext, MergedCurrentContext<TCurrentContext, UOutContext>, TSchemas, TMeta, TGateName>;
90
+ use<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, UInContext extends Context = TCurrentContext>(middleware: Middleware<UInContext, UOutContext, unknown, unknown, TMeta>): ProcedureBuilder<MergedInitialContext<TInitialContext, UInContext, TCurrentContext>, MergedCurrentContext<TCurrentContext, UOutContext>, TSchemas, TMeta, TGateName>;
91
+ useAuth<TAuthContext extends ValidatedAuthContext = false>(config: AuthConfig<TAuthContext, TCurrentContext, TMeta>): ProcedureBuilder<TInitialContext, BuildContextWithAuth<TCurrentContext, TAuthContext>, TSchemas, TMeta, TGateName>;
125
92
  useGating<const TInferredGateName extends string>(gates: TInferredGateName[], isGateEnabled: (gate: TInferredGateName, ctx: TCurrentContext) => boolean): BuilderWithMiddlewares<MergedInitialContext<TInitialContext, Context, TCurrentContext>, MergedCurrentContext<TCurrentContext, {
126
93
  isGateEnabled: typeof isGateEnabled;
127
- }>, TInputSchema, TOutputSchema, TErrorMap, TMeta, TInferredGateName>;
94
+ }>, TSchemas, TMeta, TInferredGateName>;
128
95
  /**
129
96
  * Defines the handler of the procedure.
130
97
  *
131
98
  * @see {@link https://orpc.unnoq.com/docs/procedure Procedure Docs}
132
99
  */
133
- handler<UFuncOutput>(handler: ProcedureHandler<TCurrentContext, InferSchemaOutput<TInputSchema>, UFuncOutput, TErrorMap, TMeta>): DecoratedProcedure<TInitialContext, TCurrentContext, TInputSchema, Schema<UFuncOutput, UFuncOutput>, TErrorMap, TMeta>;
100
+ handler(handler: ProcedureHandler<TCurrentContext, InferHandlerInputs<TSchemas>, InferSchemaInput<TSchemas['outputSchema']>, TMeta>): DecoratedProcedure<TInitialContext, TCurrentContext, TSchemas, TMeta>;
134
101
  }
135
- declare class BuilderWithMiddlewares<TInitialContext extends Context, TCurrentContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta, TGateName extends string> extends ProcedureBuilder<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName> {
102
+ declare class BuilderWithMiddlewares<TInitialContext extends Context, TCurrentContext extends Context, TSchemas extends Schemas, TMeta extends Meta, TGateName extends string> extends ProcedureBuilder<TInitialContext, TCurrentContext, TSchemas, TMeta, TGateName> {
136
103
  /**
137
104
  * Prefixes all procedures in the router.
138
105
  * The provided prefix is post-appended to any existing router prefix.
@@ -141,224 +108,346 @@ declare class BuilderWithMiddlewares<TInitialContext extends Context, TCurrentCo
141
108
  *
142
109
  * @see {@link https://orpc.unnoq.com/docs/openapi/routing#route-prefixes OpenAPI Route Prefixes Docs}
143
110
  */
144
- prefix(prefix: HTTPPath): RouterBuilder<TInitialContext, TCurrentContext, TErrorMap, TMeta>;
111
+ prefix(prefix: HTTPPath): BuilderWithMiddlewares<TInitialContext, TCurrentContext, TSchemas, TMeta, TGateName>;
145
112
  /**
146
113
  * Adds tags to all procedures in the router.
147
114
  * This helpful when you want to group procedures together in the OpenAPI specification.
148
115
  *
149
116
  * @see {@link https://orpc.unnoq.com/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
150
117
  */
151
- tag(...tags: string[]): RouterBuilder<TInitialContext, TCurrentContext, TErrorMap, TMeta>;
118
+ tag(...tags: string[]): RouterBuilder<TInitialContext, TCurrentContext, TMeta>;
152
119
  /**
153
120
  * Applies all of the previously defined options to the specified router.
154
121
  *
155
122
  * @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
156
123
  */
157
- router<U extends Router<ContractRouter<TMeta>, TCurrentContext>>(router: U): EnhancedRouter<U, TInitialContext, TCurrentContext, TErrorMap>;
158
- /**
159
- * Create a lazy router
160
- * And applies all of the previously defined options to the specified router.
161
- *
162
- * @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
163
- */
164
- lazyRoute<U extends Router<ContractRouter<TMeta>, TCurrentContext>>(loader: () => Promise<{
165
- default: U;
166
- }>): EnhancedRouter<Lazy<U>, TInitialContext, TCurrentContext, TErrorMap>;
124
+ router<U extends Router<TCurrentContext>>(router: U): EnhancedRouter<U, TInitialContext, TCurrentContext>;
167
125
  }
168
- interface RouterBuilder<TInitialContext extends Context, TCurrentContext extends Context, TErrorMap extends ErrorMap, TMeta extends Meta> extends Pick<BuilderWithMiddlewares<TInitialContext, TCurrentContext, any, any, TErrorMap, TMeta, any>, 'prefix' | 'tag' | 'router' | 'lazyRoute'> {
126
+ interface RouterBuilder<TInitialContext extends Context, TCurrentContext extends Context, TMeta extends Meta> extends Pick<BuilderWithMiddlewares<TInitialContext, TCurrentContext, any, TMeta, any>, 'prefix' | 'tag' | 'router'> {
169
127
  /**
170
128
  * This property holds the defined options.
171
129
  */
172
- '~orpc': EnhanceRouterOptions<TErrorMap>;
130
+ '~orpc': EnhanceRouterOptions;
173
131
  }
174
132
 
175
- interface DecoratedMiddleware<TInContext extends Context, TOutContext extends Context, TInput, TOutput, TErrorConstructorMap extends ORPCErrorConstructorMap<any>, TMeta extends Meta> extends Middleware<TInContext, TOutContext, TInput, TOutput, TErrorConstructorMap, TMeta> {
133
+ interface DecoratedMiddleware<TInContext extends Context, TOutContext extends Context, TInput, TOutput, TMeta extends Meta> extends Middleware<TInContext, TOutContext, TInput, TOutput, TMeta> {
176
134
  /**
177
135
  * Change the expected input type by providing a map function.
178
136
  */
179
- mapInput<UInput>(map: MapInputMiddleware<UInput, TInput>): DecoratedMiddleware<TInContext, TOutContext, UInput, TOutput, TErrorConstructorMap, TMeta>;
180
- /**
181
- * Concatenates two middlewares.
182
- *
183
- * @info Pass second argument to map the input.
184
- * @see {@link https://orpc.unnoq.com/docs/middleware#concatenation Middleware Concatenation Docs}
185
- */
186
- concat<UOutContext extends IntersectPick<MergedCurrentContext<TInContext, TOutContext>, UOutContext>, UInput extends TInput, UInContext extends Context = MergedCurrentContext<TInContext, TOutContext>>(middleware: Middleware<UInContext | MergedCurrentContext<TInContext, TOutContext>, UOutContext, UInput, TOutput, TErrorConstructorMap, TMeta>): DecoratedMiddleware<MergedInitialContext<TInContext, UInContext, MergedCurrentContext<TInContext, TOutContext>>, MergedCurrentContext<TOutContext, UOutContext>, UInput, TOutput, TErrorConstructorMap, TMeta>;
187
- /**
188
- * Concatenates two middlewares.
189
- *
190
- * @info Pass second argument to map the input.
191
- * @see {@link https://orpc.unnoq.com/docs/middleware#concatenation Middleware Concatenation Docs}
192
- */
193
- concat<UOutContext extends IntersectPick<MergedCurrentContext<TInContext, TOutContext>, UOutContext>, UInput extends TInput, UMappedInput, UInContext extends Context = MergedCurrentContext<TInContext, TOutContext>>(middleware: Middleware<UInContext | MergedCurrentContext<TInContext, TOutContext>, UOutContext, UMappedInput, TOutput, TErrorConstructorMap, TMeta>, mapInput: MapInputMiddleware<UInput, UMappedInput>): DecoratedMiddleware<MergedInitialContext<TInContext, UInContext, MergedCurrentContext<TInContext, TOutContext>>, MergedCurrentContext<TOutContext, UOutContext>, UInput, TOutput, TErrorConstructorMap, TMeta>;
137
+ mapInput<UInput>(map: MapInputMiddleware<UInput, TInput>): DecoratedMiddleware<TInContext, TOutContext, UInput, TOutput, TMeta>;
194
138
  }
195
- declare function decorateMiddleware<TInContext extends Context, TOutContext extends Context, TInput, TOutput, TErrorConstructorMap extends ORPCErrorConstructorMap<any>, TMeta extends Meta>(middleware: Middleware<TInContext, TOutContext, TInput, TOutput, TErrorConstructorMap, TMeta>): DecoratedMiddleware<TInContext, TOutContext, TInput, TOutput, TErrorConstructorMap, TMeta>;
139
+ declare function decorateMiddleware<TInContext extends Context, TOutContext extends Context, TInput, TOutput, TMeta extends Meta>(middleware: Middleware<TInContext, TOutContext, TInput, TOutput, TMeta>): DecoratedMiddleware<TInContext, TOutContext, TInput, TOutput, TMeta>;
196
140
 
197
- interface BuilderDef<TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta, TGateName extends string> extends ContractProcedureDef<TInputSchema, TOutputSchema, TErrorMap, TMeta>, EnhanceRouterOptions<TErrorMap> {
198
- middlewares: readonly AnyMiddleware[];
199
- inputValidationIndex: number;
200
- outputValidationIndex: number;
141
+ interface BuilderDef<TSchemas extends Schemas, TMeta extends Meta> extends ContractDef<TSchemas, TMeta>, EnhanceRouterOptions {
201
142
  }
202
- declare class Builder<TInitialContext extends Context, TCurrentContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta, TGateName extends string> extends BuilderWithMiddlewares<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName> {
143
+ declare class Builder<TInitialContext extends Context, TCurrentContext extends Context, TSchemas extends Schemas, TMeta extends Meta, TGateName extends string> extends BuilderWithMiddlewares<TInitialContext, TCurrentContext, TSchemas, TMeta, TGateName> {
203
144
  /**
204
145
  * Set or override the initial context.
205
146
  *
206
147
  * @see {@link https://orpc.unnoq.com/docs/context Context Docs}
207
148
  */
208
- $context<U extends Context>(): Builder<U & Record<never, never>, U, TInputSchema, TOutputSchema, TErrorMap, TMeta, TGateName>;
149
+ $context<U extends Context>(): Builder<U, U, TSchemas, TMeta, TGateName>;
209
150
  /**
210
151
  * Creates a middleware.
211
152
  *
212
153
  * @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
213
154
  */
214
155
  middleware<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, TInput, TOutput = any>(// = any here is important to make middleware can be used in any output by default
215
- middleware: Middleware<TInitialContext, UOutContext, TInput, TOutput, ORPCErrorConstructorMap<TErrorMap>, TMeta>): DecoratedMiddleware<TInitialContext, UOutContext, TInput, TOutput, any, TMeta>;
216
- }
217
- type ApiBuilder<TMeta extends Meta> = Builder<Record<never, never>, Record<never, never>, Schema<unknown, unknown>, Schema<unknown, unknown>, Record<never, never>, TMeta, never>;
218
- interface ApiBuilderOpts<TMeta extends Meta> {
219
- meta?: TMeta;
156
+ middleware: Middleware<TInitialContext, UOutContext, TInput, TOutput, TMeta>): DecoratedMiddleware<TInitialContext, UOutContext, TInput, TOutput, TMeta>;
220
157
  }
221
- declare function createApiBuilder<TMeta extends Meta = Record<never, never>>(opts?: ApiBuilderOpts<TMeta>): ApiBuilder<TMeta>;
222
- declare const os: ApiBuilder<Record<never, never>>;
158
+ declare const baseApi: Builder<{}, {}, {
159
+ pathSchema: z.KrustyObject<{}, zod_v4_core.$strict, z.KrustyInternals<string>>;
160
+ querySchema: z.KrustyObject<{}, zod_v4_core.$strict, z.KrustyInternals<string>>;
161
+ bodySchema: z.KrustyObject<{}, zod_v4_core.$strict, z.KrustyInternals<string>>;
162
+ outputSchema: z.KrustyUnknown<z.KrustyInternals<string>>;
163
+ }, Record<never, never>, never>;
223
164
 
224
- /**
225
- * Like `DecoratedProcedure`, but removed all method that can change the contract.
226
- */
227
- interface ImplementedProcedure<TInitialContext extends Context, TCurrentContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta> extends Procedure<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta> {
228
- /**
229
- * Uses a middleware to modify the context or improve the pipeline.
230
- *
231
- * @info Supports both normal middleware and inline middleware implementations.
232
- * @info Pass second argument to map the input.
233
- * @note The current context must be satisfy middleware dependent-context
234
- * @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
235
- */
236
- use<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, UInContext extends Context = TCurrentContext>(middleware: Middleware<UInContext | TCurrentContext, UOutContext, InferSchemaOutput<TInputSchema>, InferSchemaInput<TOutputSchema>, ORPCErrorConstructorMap<TErrorMap>, TMeta>): ImplementedProcedure<MergedInitialContext<TInitialContext, UInContext, TCurrentContext>, MergedCurrentContext<TCurrentContext, UOutContext>, TInputSchema, TOutputSchema, TErrorMap, TMeta>;
237
- /**
238
- * Uses a middleware to modify the context or improve the pipeline.
239
- *
240
- * @info Supports both normal middleware and inline middleware implementations.
241
- * @info Pass second argument to map the input.
242
- * @note The current context must be satisfy middleware dependent-context
243
- * @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
244
- */
245
- use<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, UInput, UInContext extends Context = TCurrentContext>(middleware: Middleware<UInContext | TCurrentContext, UOutContext, UInput, InferSchemaInput<TOutputSchema>, ORPCErrorConstructorMap<TErrorMap>, TMeta>, mapInput: MapInputMiddleware<InferSchemaOutput<TInputSchema>, UInput>): ImplementedProcedure<MergedInitialContext<TInitialContext, UInContext, TCurrentContext>, MergedCurrentContext<TCurrentContext, UOutContext>, TInputSchema, TOutputSchema, TErrorMap, TMeta>;
165
+ interface ValidationErrorOptions extends ErrorOptions {
166
+ message: string;
167
+ issues: readonly SchemaIssue[];
246
168
  /**
247
- * Make this procedure callable (works like a function while still being a procedure).
248
- *
249
- * @see {@link https://orpc.unnoq.com/docs/client/server-side Server-side Client Docs}
169
+ * @todo require this field in v2
250
170
  */
251
- callable<TClientContext extends ClientContext>(...rest: MaybeOptionalOptions<CreateProcedureClientOptions<TInitialContext, TOutputSchema, TErrorMap, TMeta, TClientContext>>): ImplementedProcedure<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta> & ProcedureClient<TClientContext, TInputSchema, TOutputSchema, TErrorMap>;
171
+ data?: unknown;
252
172
  }
253
173
  /**
254
- * Like `ProcedureBuilderWithoutHandler`, but removed all method that can change the contract.
174
+ * This errors usually used for ORPCError.cause when the error is a validation error.
175
+ *
176
+ * @see {@link https://orpc.unnoq.com/docs/advanced/validation-errors Validation Errors Docs}
255
177
  */
256
- interface ProcedureImplementer<TInitialContext extends Context, TCurrentContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta> {
257
- '~orpc': BuilderDef<TInputSchema, TOutputSchema, TErrorMap, TMeta, string>;
258
- /**
259
- * Uses a middleware to modify the context or improve the pipeline.
260
- *
261
- * @info Supports both normal middleware and inline middleware implementations.
262
- * @info Pass second argument to map the input.
263
- * @note The current context must be satisfy middleware dependent-context
264
- * @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
265
- */
266
- 'use'<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, UInContext extends Context = TCurrentContext>(middleware: Middleware<UInContext | TCurrentContext, UOutContext, InferSchemaOutput<TInputSchema>, InferSchemaInput<TOutputSchema>, ORPCErrorConstructorMap<TErrorMap>, TMeta>): ProcedureImplementer<MergedInitialContext<TInitialContext, UInContext, TCurrentContext>, MergedCurrentContext<TCurrentContext, UOutContext>, TInputSchema, TOutputSchema, TErrorMap, TMeta>;
267
- /**
268
- * Uses a middleware to modify the context or improve the pipeline.
269
- *
270
- * @info Supports both normal middleware and inline middleware implementations.
271
- * @info Pass second argument to map the input.
272
- * @note The current context must be satisfy middleware dependent-context
273
- * @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
274
- */
275
- 'use'<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, UInput, UInContext extends Context = TCurrentContext>(middleware: Middleware<UInContext | TCurrentContext, UOutContext, UInput, InferSchemaInput<TOutputSchema>, ORPCErrorConstructorMap<TErrorMap>, TMeta>, mapInput: MapInputMiddleware<InferSchemaOutput<TInputSchema>, UInput>): ProcedureImplementer<MergedInitialContext<TInitialContext, UInContext, TCurrentContext>, MergedCurrentContext<TCurrentContext, UOutContext>, TInputSchema, TOutputSchema, TErrorMap, TMeta>;
276
- /**
277
- * Defines the handler of the procedure.
278
- *
279
- * @see {@link https://orpc.unnoq.com/docs/procedure Procedure Docs}
280
- */
281
- 'handler'(handler: ProcedureHandler<TCurrentContext, InferSchemaOutput<TInputSchema>, InferSchemaInput<TOutputSchema>, TErrorMap, TMeta>): ImplementedProcedure<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, TErrorMap, TMeta>;
178
+ declare class ValidationError extends Error {
179
+ readonly issues: readonly SchemaIssue[];
180
+ readonly data: unknown;
181
+ constructor(options: ValidationErrorOptions);
282
182
  }
283
183
 
284
- interface RouterImplementerWithMiddlewares<T extends AnyContractRouter, TInitialContext extends Context, TCurrentContext extends Context> {
285
- /**
286
- * Uses a middleware to modify the context or improve the pipeline.
287
- *
288
- * @info Supports both normal middleware and inline middleware implementations.
289
- * @note The current context must be satisfy middleware dependent-context
290
- * @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
291
- */
292
- use<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, UInContext extends Context = TCurrentContext>(middleware: Middleware<UInContext | TCurrentContext, UOutContext, unknown, unknown, ORPCErrorConstructorMap<InferContractRouterErrorMap<T>>, InferContractRouterMeta<T>>): ImplementerInternalWithMiddlewares<T, MergedInitialContext<TInitialContext, UInContext, TCurrentContext>, MergedCurrentContext<TCurrentContext, UOutContext>>;
293
- /**
294
- * Applies all of the previously defined options to the specified router.
295
- * And enforces the router match the contract.
296
- *
297
- * @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
298
- */
299
- router<U extends Router<T, TCurrentContext>>(router: U): EnhancedRouter<U, TInitialContext, TCurrentContext, Record<never, never>>;
300
- /**
301
- * Create a lazy router
302
- * And applies all of the previously defined options to the specified router.
303
- * And enforces the router match the contract.
304
- *
305
- * @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
306
- */
307
- lazyRoute<U extends Router<T, TInitialContext>>(loader: () => Promise<{
308
- default: U;
309
- }>): EnhancedRouter<Lazy<U>, TInitialContext, TCurrentContext, Record<never, never>>;
184
+ interface EventIteratorSchemaDetails {
185
+ yields: AnySchema;
186
+ returns?: AnySchema;
310
187
  }
311
- type ImplementerInternalWithMiddlewares<TContract extends AnyContractRouter, TInitialContext extends Context, TCurrentContext extends Context> = TContract extends ContractProcedure<infer UInputSchema, infer UOutputSchema, infer UErrorMap, infer UMeta> ? ProcedureImplementer<TInitialContext, TCurrentContext, UInputSchema, UOutputSchema, UErrorMap, UMeta> : RouterImplementerWithMiddlewares<TContract, TInitialContext, TCurrentContext> & {
312
- [K in keyof TContract]: TContract[K] extends AnyContractRouter ? ImplementerInternalWithMiddlewares<TContract[K], TInitialContext, TCurrentContext> : never;
313
- };
188
+ /**
189
+ * Define schema for an event iterator.
190
+ *
191
+ * @see {@link https://orpc.unnoq.com/docs/event-iterator#validate-event-iterator Validate Event Iterator Docs}
192
+ */
193
+ declare function eventIterator<TYieldIn, TYieldOut, TReturnIn = unknown, TReturnOut = unknown>(yields: Schema<TYieldIn, TYieldOut>, returns?: Schema<TReturnIn, TReturnOut>): Schema<AsyncIteratorObject<TYieldIn, TReturnIn, void>, AsyncIteratorClass<TYieldOut, TReturnOut, void>>;
194
+ declare function getEventIteratorSchemaDetails(schema: AnySchema | undefined): undefined | EventIteratorSchemaDetails;
314
195
 
315
- interface RouterImplementer<T extends AnyContractRouter, TInitialContext extends Context, TCurrentContext extends Context> {
316
- /**
317
- * Creates a middleware.
318
- *
319
- * @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
320
- */
321
- middleware<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, TInput, TOutput = any>(// = any here is important to make middleware can be used in any output by default
322
- middleware: Middleware<TInitialContext, UOutContext, TInput, TOutput, ORPCErrorConstructorMap<InferContractRouterErrorMap<T>>, InferContractRouterMeta<T>>): DecoratedMiddleware<TInitialContext, UOutContext, TInput, TOutput, any, InferContractRouterMeta<T>>;
323
- /**
324
- * Uses a middleware to modify the context or improve the pipeline.
325
- *
326
- * @info Supports both normal middleware and inline middleware implementations.
327
- * @note The current context must be satisfy middleware dependent-context
328
- * @see {@link https://orpc.unnoq.com/docs/middleware Middleware Docs}
329
- */
330
- use<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, UInContext extends Context = TCurrentContext>(middleware: Middleware<UInContext | TCurrentContext, UOutContext, unknown, unknown, ORPCErrorConstructorMap<InferContractRouterErrorMap<T>>, InferContractRouterMeta<T>>): ImplementerInternalWithMiddlewares<T, MergedInitialContext<TInitialContext, UInContext, TCurrentContext>, MergedCurrentContext<TCurrentContext, UOutContext>>;
331
- /**
332
- * Applies all of the previously defined options to the specified router.
333
- * And enforces the router match the contract.
334
- *
335
- * @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
336
- */
337
- router<U extends Router<T, TCurrentContext>>(router: U): EnhancedRouter<U, TInitialContext, TCurrentContext, Record<never, never>>;
338
- /**
339
- * Create a lazy router
340
- * And applies all of the previously defined options to the specified router.
341
- * And enforces the router match the contract.
342
- *
343
- * @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
344
- */
345
- lazyRoute<U extends Router<T, TCurrentContext>>(loader: () => Promise<{
346
- default: U;
347
- }>): EnhancedRouter<Lazy<U>, TInitialContext, TCurrentContext, Record<never, never>>;
196
+ type JsonSchema = Draft2020.JSONSchema | Draft2019.JSONSchema | Draft07.JSONSchema;
197
+ declare enum JsonSchemaXNativeType {
198
+ BigInt = "bigint",
199
+ RegExp = "regexp",
200
+ Date = "date",
201
+ Url = "url",
202
+ Set = "set",
203
+ Map = "map"
348
204
  }
349
- type ImplementerInternal<TContract extends AnyContractRouter, TInitialContext extends Context, TCurrentContext extends Context> = TContract extends ContractProcedure<infer UInputSchema, infer UOutputSchema, infer UErrorMap, infer UMeta> ? ProcedureImplementer<TInitialContext, TCurrentContext, UInputSchema, UOutputSchema, UErrorMap, UMeta> : RouterImplementer<TContract, TInitialContext, TCurrentContext> & {
350
- [K in keyof TContract]: TContract[K] extends AnyContractRouter ? ImplementerInternal<TContract[K], TInitialContext, TCurrentContext> : never;
351
- };
352
- declare function implementerInternal<T extends AnyContractRouter, TInitialContext extends Context, TCurrentContext extends Context>(contract: T, middlewares: AnyMiddleware[]): ImplementerInternal<T, TInitialContext, TCurrentContext>;
353
- type Implementer<TContract extends AnyContractRouter, TInitialContext extends Context, TCurrentContext extends Context> = {
354
- /**
355
- * Set or override the initial context.
356
- *
357
- * @see {@link https://orpc.unnoq.com/docs/context Context Docs}
358
- */
359
- $context<U extends Context>(): Implementer<TContract, U & Record<never, never>, U>;
360
- } & ImplementerInternal<TContract, TInitialContext, TCurrentContext>;
361
- declare function implement<T extends AnyContractRouter, TContext extends Context = Record<never, never>>(contract: T): Implementer<T, TContext, TContext>;
205
+
206
+ interface experimental_JsonSchemaCoerceOptions {
207
+ components?: Record<string, JsonSchema>;
208
+ }
209
+ declare class experimental_JsonSchemaCoercer {
210
+ #private;
211
+ coerce(schema: JsonSchema, value: unknown, options?: experimental_JsonSchemaCoerceOptions): unknown;
212
+ }
213
+
214
+ /**
215
+ * Zod registry for customizing generated JSON schema, can use both for .input and .output
216
+ *
217
+ * @example
218
+ * ```ts
219
+ * import { JSON_SCHEMA_REGISTRY } from '@temporary-name/zod/zod4'
220
+ *
221
+ * const user = z.object({
222
+ * name: z.string(),
223
+ * age: z.number(),
224
+ * })
225
+ *
226
+ * JSON_SCHEMA_REGISTRY.add(user, {
227
+ * examples: [{ name: 'John', age: 20 }],
228
+ * })
229
+ * ```
230
+ */
231
+ declare const JSON_SCHEMA_REGISTRY: zod_v4_core.$ZodRegistry<{
232
+ $anchor?: string;
233
+ $comment?: string;
234
+ $defs?: Record<string, JSONSchema>;
235
+ $dynamicAnchor?: string;
236
+ $dynamicRef?: string;
237
+ $id?: string;
238
+ $ref?: string;
239
+ $schema?: string;
240
+ $vocabulary?: Record<string, string>;
241
+ additionalItems?: JSONSchema;
242
+ additionalProperties?: JSONSchema;
243
+ allOf?: (JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[]) | undefined;
244
+ anyOf?: (JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[]) | undefined;
245
+ const?: typeof $input | typeof $output | undefined;
246
+ contains?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
247
+ contentEncoding?: "7bit" | "8bit" | "base64" | "binary" | "ietf-token" | "quoted-printable" | "x-token";
248
+ contentMediaType?: string;
249
+ contentSchema?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
250
+ default?: typeof $input | typeof $output | undefined;
251
+ definitions?: Record<string, JSONSchema>;
252
+ dependencies?: Record<string, (string[] | readonly string[]) | JSONSchema>;
253
+ dependentRequired?: Record<string, string[] | readonly string[]>;
254
+ dependentSchemas?: Record<string, JSONSchema>;
255
+ deprecated?: boolean;
256
+ description?: string;
257
+ else?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
258
+ enum?: ((typeof $input | typeof $output)[] | readonly (typeof $input | typeof $output)[]) | undefined;
259
+ examples?: ((typeof $input | typeof $output)[] | readonly (typeof $input | typeof $output)[]) | undefined;
260
+ exclusiveMaximum?: number;
261
+ exclusiveMinimum?: number;
262
+ format?: string;
263
+ if?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
264
+ items?: JSONSchema;
265
+ maxContains?: number;
266
+ maximum?: number;
267
+ maxItems?: number;
268
+ maxLength?: number;
269
+ maxProperties?: number;
270
+ minContains?: number;
271
+ minimum?: number;
272
+ minItems?: number;
273
+ minLength?: number;
274
+ minProperties?: number;
275
+ multipleOf?: number;
276
+ not?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
277
+ oneOf?: (JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[]) | undefined;
278
+ pattern?: string;
279
+ patternProperties?: Record<string, JSONSchema>;
280
+ prefixItems?: (JSONSchema<any, JSONSchema.TypeValue>[] | readonly JSONSchema<any, JSONSchema.TypeValue>[]) | JSONSchema;
281
+ properties?: Record<string, JSONSchema>;
282
+ propertyNames?: JSONSchema;
283
+ readOnly?: boolean;
284
+ required?: string[] | readonly string[];
285
+ then?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
286
+ title?: string;
287
+ type?: JSONSchema.TypeValue | undefined;
288
+ unevaluatedItems?: JSONSchema;
289
+ unevaluatedProperties?: JSONSchema;
290
+ uniqueItems?: boolean;
291
+ writeOnly?: boolean;
292
+ }, zod_v4_core.$ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>>>;
293
+ /**
294
+ * Zod registry for customizing generated JSON schema, only useful for .input
295
+ *
296
+ * @example
297
+ * ```ts
298
+ * import { JSON_SCHEMA_INPUT_REGISTRY } from '@temporary-name/zod/zod4'
299
+ *
300
+ * const user = z.object({
301
+ * name: z.string(),
302
+ * age: z.string().transform(v => Number(v)),
303
+ * })
304
+ *
305
+ * JSON_SCHEMA_REGISTRY.add(user, {
306
+ * examples: [{ name: 'John', age: "20" }],
307
+ * })
308
+ * ```
309
+ */
310
+ declare const JSON_SCHEMA_INPUT_REGISTRY: zod_v4_core.$ZodRegistry<{
311
+ $anchor?: string;
312
+ $comment?: string;
313
+ $defs?: Record<string, JSONSchema>;
314
+ $dynamicAnchor?: string;
315
+ $dynamicRef?: string;
316
+ $id?: string;
317
+ $ref?: string;
318
+ $schema?: string;
319
+ $vocabulary?: Record<string, string>;
320
+ additionalItems?: JSONSchema;
321
+ additionalProperties?: JSONSchema;
322
+ allOf?: (JSONSchema<typeof $input, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input, JSONSchema.TypeValue>[]) | undefined;
323
+ anyOf?: (JSONSchema<typeof $input, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input, JSONSchema.TypeValue>[]) | undefined;
324
+ const?: typeof $input | undefined;
325
+ contains?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
326
+ contentEncoding?: "7bit" | "8bit" | "base64" | "binary" | "ietf-token" | "quoted-printable" | "x-token";
327
+ contentMediaType?: string;
328
+ contentSchema?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
329
+ default?: typeof $input | undefined;
330
+ definitions?: Record<string, JSONSchema>;
331
+ dependencies?: Record<string, (string[] | readonly string[]) | JSONSchema>;
332
+ dependentRequired?: Record<string, string[] | readonly string[]>;
333
+ dependentSchemas?: Record<string, JSONSchema>;
334
+ deprecated?: boolean;
335
+ description?: string;
336
+ else?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
337
+ enum?: ((typeof $input)[] | readonly (typeof $input)[]) | undefined;
338
+ examples?: ((typeof $input)[] | readonly (typeof $input)[]) | undefined;
339
+ exclusiveMaximum?: number;
340
+ exclusiveMinimum?: number;
341
+ format?: string;
342
+ if?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
343
+ items?: JSONSchema;
344
+ maxContains?: number;
345
+ maximum?: number;
346
+ maxItems?: number;
347
+ maxLength?: number;
348
+ maxProperties?: number;
349
+ minContains?: number;
350
+ minimum?: number;
351
+ minItems?: number;
352
+ minLength?: number;
353
+ minProperties?: number;
354
+ multipleOf?: number;
355
+ not?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
356
+ oneOf?: (JSONSchema<typeof $input, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input, JSONSchema.TypeValue>[]) | undefined;
357
+ pattern?: string;
358
+ patternProperties?: Record<string, JSONSchema>;
359
+ prefixItems?: (JSONSchema<any, JSONSchema.TypeValue>[] | readonly JSONSchema<any, JSONSchema.TypeValue>[]) | JSONSchema;
360
+ properties?: Record<string, JSONSchema>;
361
+ propertyNames?: JSONSchema;
362
+ readOnly?: boolean;
363
+ required?: string[] | readonly string[];
364
+ then?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
365
+ title?: string;
366
+ type?: JSONSchema.TypeValue | undefined;
367
+ unevaluatedItems?: JSONSchema;
368
+ unevaluatedProperties?: JSONSchema;
369
+ uniqueItems?: boolean;
370
+ writeOnly?: boolean;
371
+ }, zod_v4_core.$ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>>>;
372
+ /**
373
+ * Zod registry for customizing generated JSON schema, only useful for .input
374
+ *
375
+ * @example
376
+ * ```ts
377
+ * import { JSON_SCHEMA_OUTPUT_REGISTRY } from '@temporary-name/zod/zod4'
378
+ *
379
+ * const user = z.object({
380
+ * name: z.string(),
381
+ * age: z.string().transform(v => Number(v)),
382
+ * })
383
+ *
384
+ * JSON_SCHEMA_OUTPUT_REGISTRY.add(user, {
385
+ * examples: [{ name: 'John', age: 20 }],
386
+ * })
387
+ * ```
388
+ */
389
+ declare const JSON_SCHEMA_OUTPUT_REGISTRY: zod_v4_core.$ZodRegistry<{
390
+ $anchor?: string;
391
+ $comment?: string;
392
+ $defs?: Record<string, JSONSchema>;
393
+ $dynamicAnchor?: string;
394
+ $dynamicRef?: string;
395
+ $id?: string;
396
+ $ref?: string;
397
+ $schema?: string;
398
+ $vocabulary?: Record<string, string>;
399
+ additionalItems?: JSONSchema;
400
+ additionalProperties?: JSONSchema;
401
+ allOf?: (JSONSchema<typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $output, JSONSchema.TypeValue>[]) | undefined;
402
+ anyOf?: (JSONSchema<typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $output, JSONSchema.TypeValue>[]) | undefined;
403
+ const?: typeof $output | undefined;
404
+ contains?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
405
+ contentEncoding?: "7bit" | "8bit" | "base64" | "binary" | "ietf-token" | "quoted-printable" | "x-token";
406
+ contentMediaType?: string;
407
+ contentSchema?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
408
+ default?: typeof $output | undefined;
409
+ definitions?: Record<string, JSONSchema>;
410
+ dependencies?: Record<string, (string[] | readonly string[]) | JSONSchema>;
411
+ dependentRequired?: Record<string, string[] | readonly string[]>;
412
+ dependentSchemas?: Record<string, JSONSchema>;
413
+ deprecated?: boolean;
414
+ description?: string;
415
+ else?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
416
+ enum?: ((typeof $output)[] | readonly (typeof $output)[]) | undefined;
417
+ examples?: ((typeof $output)[] | readonly (typeof $output)[]) | undefined;
418
+ exclusiveMaximum?: number;
419
+ exclusiveMinimum?: number;
420
+ format?: string;
421
+ if?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
422
+ items?: JSONSchema;
423
+ maxContains?: number;
424
+ maximum?: number;
425
+ maxItems?: number;
426
+ maxLength?: number;
427
+ maxProperties?: number;
428
+ minContains?: number;
429
+ minimum?: number;
430
+ minItems?: number;
431
+ minLength?: number;
432
+ minProperties?: number;
433
+ multipleOf?: number;
434
+ not?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
435
+ oneOf?: (JSONSchema<typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $output, JSONSchema.TypeValue>[]) | undefined;
436
+ pattern?: string;
437
+ patternProperties?: Record<string, JSONSchema>;
438
+ prefixItems?: (JSONSchema<any, JSONSchema.TypeValue>[] | readonly JSONSchema<any, JSONSchema.TypeValue>[]) | JSONSchema;
439
+ properties?: Record<string, JSONSchema>;
440
+ propertyNames?: JSONSchema;
441
+ readOnly?: boolean;
442
+ required?: string[] | readonly string[];
443
+ then?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
444
+ title?: string;
445
+ type?: JSONSchema.TypeValue | undefined;
446
+ unevaluatedItems?: JSONSchema;
447
+ unevaluatedProperties?: JSONSchema;
448
+ uniqueItems?: boolean;
449
+ writeOnly?: boolean;
450
+ }, zod_v4_core.$ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>>>;
362
451
 
363
452
  declare function isStartWithMiddlewares(middlewares: readonly AnyMiddleware[], compare: readonly AnyMiddleware[]): boolean;
364
453
  declare function mergeMiddlewares(first: readonly AnyMiddleware[], second: readonly AnyMiddleware[], options: {
@@ -367,10 +456,6 @@ declare function mergeMiddlewares(first: readonly AnyMiddleware[], second: reado
367
456
  declare function addMiddleware(middlewares: readonly AnyMiddleware[], addition: AnyMiddleware): AnyMiddleware[];
368
457
 
369
458
  declare function createAssertedLazyProcedure(lazied: Lazy<any>): Lazy<AnyProcedure>;
370
- /**
371
- * Create a new procedure that ensure the contract is applied to the procedure.
372
- */
373
- declare function createContractedProcedure(procedure: AnyProcedure, contract: AnyContractProcedure): AnyProcedure;
374
459
  /**
375
460
  * Directly call a procedure without creating a client.
376
461
  *
@@ -381,20 +466,31 @@ declare function createContractedProcedure(procedure: AnyProcedure, contract: An
381
466
  * ```
382
467
  *
383
468
  */
384
- declare function call<TInitialContext extends Context, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta>(procedure: Lazyable<Procedure<TInitialContext, any, TInputSchema, TOutputSchema, TErrorMap, TMeta>>, input: InferSchemaInput<TInputSchema>, ...rest: MaybeOptionalOptions<CreateProcedureClientOptions<TInitialContext, TOutputSchema, TErrorMap, TMeta, Record<never, never>> & Omit<ClientOptions<Record<never, never>>, 'context'>>): ClientPromiseResult<InferSchemaOutput<TOutputSchema>, ErrorFromErrorMap<TErrorMap>>;
469
+ declare function call<TInitialContext extends Context, TSchemas extends Schemas, TMeta extends Meta>(procedure: Lazyable<Procedure<TInitialContext, any, TSchemas, TMeta>>, input: InferProcedureClientInputs<TSchemas>, ...rest: MaybeOptionalOptions<CreateProcedureClientOptions<TInitialContext, {}> & Omit<ClientOptions<{}>, 'context'>>): Promise<InferSchemaOutput<TSchemas['outputSchema']>>;
385
470
 
386
- type RouterClient<TRouter extends AnyRouter, TClientContext extends ClientContext = Record<never, never>> = TRouter extends Procedure<any, any, infer UInputSchema, infer UOutputSchema, infer UErrorMap, any> ? ProcedureClient<TClientContext, UInputSchema, UOutputSchema, UErrorMap> : {
387
- [K in keyof TRouter]: TRouter[K] extends Lazyable<infer U extends AnyRouter> ? RouterClient<U, TClientContext> : never;
388
- };
471
+ declare function isSchemaIssue(issue: unknown): issue is SchemaIssue;
472
+
473
+ type HTTPEndpoint = `${HTTPMethod} ${HTTPPath}`;
474
+ declare const endpointRegex: RegExp;
389
475
  /**
390
- * Create Server-side client from a router.
391
- *
392
- * @see {@link https://orpc.unnoq.com/docs/client/server-side Server-side Client Docs}
476
+ * @internal
393
477
  */
394
- declare function createRouterClient<T extends AnyRouter, TClientContext extends ClientContext>(router: Lazyable<T | undefined>, ...rest: MaybeOptionalOptions<CreateProcedureClientOptions<InferRouterInitialContext<T>, Schema<unknown, unknown>, ErrorMap, Meta, TClientContext>>): RouterClient<T, TClientContext>;
395
-
396
- declare function setHiddenRouterContract<T extends Lazyable<AnyRouter>>(router: T, contract: AnyContractRouter): T;
397
- declare function getHiddenRouterContract(router: Lazyable<AnyRouter | AnyContractRouter>): AnyContractRouter | undefined;
478
+ declare function standardizeHTTPPath(path: HTTPPath): HTTPPath;
479
+ /**
480
+ * @internal
481
+ */
482
+ declare function getDynamicParams(path: HTTPPath | undefined): {
483
+ raw: string;
484
+ name: string;
485
+ }[] | undefined;
486
+ /**
487
+ * @internal
488
+ */
489
+ declare function parseEndpointDefinition(stringsOrEndpoint: TemplateStringsArray | HTTPEndpoint, values: AnyShape[] | [AnySchema | AnyShape] | []): {
490
+ method: HTTPMethod;
491
+ path: HTTPPath;
492
+ pathSchema: AnySchema;
493
+ };
398
494
 
399
- export { AnyMiddleware, AnyProcedure, AnyRouter, Builder, BuilderWithMiddlewares, Context, CreateProcedureClientOptions, DecoratedProcedure, InferRouterInitialContext, Lazy, Lazyable, MapInputMiddleware, MergedCurrentContext, MergedInitialContext, Middleware, ORPCErrorConstructorMap, Procedure, ProcedureBuilder, ProcedureClient, ProcedureHandler, Router, addMiddleware, call, createAccessibleLazyRouter, createApiBuilder, createAssertedLazyProcedure, createContractedProcedure, createRouterClient, decorateMiddleware, enhanceRouter, getHiddenRouterContract, getRouter, implement, implementerInternal, isStartWithMiddlewares, mergeMiddlewares, os, resolveContractProcedures, setHiddenRouterContract, traverseContractProcedures, unlazyRouter };
400
- export type { AccessibleLazyRouter, ApiBuilder, BuilderDef, ContractProcedureCallbackOptions, DecoratedMiddleware, EnhanceRouterOptions, EnhancedRouter, ImplementedProcedure, Implementer, ImplementerInternal, ImplementerInternalWithMiddlewares, LazyTraverseContractProceduresOptions, ProcedureImplementer, RouterBuilder, RouterClient, RouterImplementer, RouterImplementerWithMiddlewares, TraverseContractProcedureCallbackOptions, TraverseContractProceduresOptions, UnlaziedRouter };
495
+ export { AnyMiddleware, AnyProcedure, AnySchema, AnyShape, BuildContextWithAuth, Builder, BuilderWithMiddlewares, Context, Contract, ContractDef, DecoratedProcedure, EnhanceRouterOptions, EnhancedRouter, InferHandlerInputs, InferProcedureClientInputs, InferSchemaInput, InferSchemaOutput, JSON_SCHEMA_INPUT_REGISTRY, JSON_SCHEMA_OUTPUT_REGISTRY, JSON_SCHEMA_REGISTRY, JsonSchemaXNativeType, Lazy, Lazyable, MapInputMiddleware, MergedCurrentContext, MergedInitialContext, MergedSchemas, Meta, Middleware, Procedure, ProcedureBuilder, ProcedureHandler, Router, Schema, SchemaIssue, Schemas, UnionToIntersection, ValidationError, WrapShape, addMiddleware, baseApi, call, createAssertedLazyProcedure, createProcedureClient, decorateMiddleware, endpointRegex, eventIterator, experimental_JsonSchemaCoercer, getDynamicParams, getEventIteratorSchemaDetails, isSchemaIssue, isStartWithMiddlewares, mergeMiddlewares, parseEndpointDefinition, standardizeHTTPPath };
496
+ export type { BuilderDef, CreateProcedureClientOptions, DecoratedMiddleware, EventIteratorSchemaDetails, HTTPEndpoint, JsonSchema, ProcedureClient, RouterBuilder, ValidationErrorOptions, experimental_JsonSchemaCoerceOptions };