Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement β†’
Sign In

@orpc/contract

Package Overview
Dependencies
Maintainers
1
Versions
1076
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@orpc/contract - npm Package Compare versions

Comparing version
0.0.0-next.75f1e0e
to
0.0.0-next.7605f6c
+43
dist/plugins/index.d.mts
import { ClientContext } from '@orpc/client';
import { StandardLinkPlugin, StandardLinkOptions } from '@orpc/client/standard';
import { A as AnyContractRouter } from '../shared/contract.TuRtB1Ca.mjs';
import '@orpc/shared';
import '@standard-schema/spec';
import 'openapi-types';
declare class RequestValidationPluginError extends Error {
}
/**
* A link plugin that validates client requests against your contract schema,
* ensuring that data sent to your server matches the expected types defined in your contract.
*
* @throws {ORPCError} with code `BAD_REQUEST` (same as server side) if input doesn't match the expected schema
* @see {@link https://orpc.dev/docs/plugins/request-validation Request Validation Plugin Docs}
*/
declare class RequestValidationPlugin<T extends ClientContext> implements StandardLinkPlugin<T> {
private readonly contract;
constructor(contract: AnyContractRouter);
init(options: StandardLinkOptions<T>): void;
}
/**
* A link plugin that validates server responses against your contract schema,
* ensuring that data returned from your server matches the expected types defined in your contract.
*
* - Throws `ValidationError` if output doesn't match the expected schema
* - Converts mismatched defined errors to normal `ORPCError` instances
*
* @see {@link https://orpc.dev/docs/plugins/response-validation Response Validation Plugin Docs}
*/
declare class ResponseValidationPlugin<T extends ClientContext> implements StandardLinkPlugin<T> {
private readonly contract;
constructor(contract: AnyContractRouter);
/**
* run before (validate after) retry plugin, because validation failed can't be retried
* run before (validate after) durable iterator plugin, because we expect durable iterator to validation (if user use it)
*/
order: number;
init(options: StandardLinkOptions<T>): void;
}
export { RequestValidationPlugin, RequestValidationPluginError, ResponseValidationPlugin };
import { ClientContext } from '@orpc/client';
import { StandardLinkPlugin, StandardLinkOptions } from '@orpc/client/standard';
import { A as AnyContractRouter } from '../shared/contract.TuRtB1Ca.js';
import '@orpc/shared';
import '@standard-schema/spec';
import 'openapi-types';
declare class RequestValidationPluginError extends Error {
}
/**
* A link plugin that validates client requests against your contract schema,
* ensuring that data sent to your server matches the expected types defined in your contract.
*
* @throws {ORPCError} with code `BAD_REQUEST` (same as server side) if input doesn't match the expected schema
* @see {@link https://orpc.dev/docs/plugins/request-validation Request Validation Plugin Docs}
*/
declare class RequestValidationPlugin<T extends ClientContext> implements StandardLinkPlugin<T> {
private readonly contract;
constructor(contract: AnyContractRouter);
init(options: StandardLinkOptions<T>): void;
}
/**
* A link plugin that validates server responses against your contract schema,
* ensuring that data returned from your server matches the expected types defined in your contract.
*
* - Throws `ValidationError` if output doesn't match the expected schema
* - Converts mismatched defined errors to normal `ORPCError` instances
*
* @see {@link https://orpc.dev/docs/plugins/response-validation Response Validation Plugin Docs}
*/
declare class ResponseValidationPlugin<T extends ClientContext> implements StandardLinkPlugin<T> {
private readonly contract;
constructor(contract: AnyContractRouter);
/**
* run before (validate after) retry plugin, because validation failed can't be retried
* run before (validate after) durable iterator plugin, because we expect durable iterator to validation (if user use it)
*/
order: number;
init(options: StandardLinkOptions<T>): void;
}
export { RequestValidationPlugin, RequestValidationPluginError, ResponseValidationPlugin };
import { ORPCError } from '@orpc/client';
import { get } from '@orpc/shared';
import { i as isContractProcedure, V as ValidationError, v as validateORPCError } from '../shared/contract.D_dZrO__.mjs';
class RequestValidationPluginError extends Error {
}
class RequestValidationPlugin {
constructor(contract) {
this.contract = contract;
}
init(options) {
options.interceptors ??= [];
options.interceptors.push(async ({ next, path, input }) => {
const procedure = get(this.contract, path);
if (!isContractProcedure(procedure)) {
throw new RequestValidationPluginError(`No valid procedure found at path "${path.join(".")}", this may happen when the contract router is not properly configured.`);
}
const inputSchema = procedure["~orpc"].inputSchema;
if (inputSchema) {
const result = await inputSchema["~standard"].validate(input);
if (result.issues) {
throw new ORPCError("BAD_REQUEST", {
message: "Input validation failed",
data: {
issues: result.issues
},
cause: new ValidationError({
message: "Input validation failed",
issues: result.issues,
data: input
})
});
}
}
return await next();
});
}
}
class ResponseValidationPlugin {
constructor(contract) {
this.contract = contract;
}
/**
* run before (validate after) retry plugin, because validation failed can't be retried
* run before (validate after) durable iterator plugin, because we expect durable iterator to validation (if user use it)
*/
order = 12e5;
init(options) {
options.interceptors ??= [];
options.interceptors.push(async ({ next, path }) => {
const procedure = get(this.contract, path);
if (!isContractProcedure(procedure)) {
throw new Error(`[ResponseValidationPlugin] no valid procedure found at path "${path.join(".")}", this may happen when the contract router is not properly configured.`);
}
try {
const output = await next();
const outputSchema = procedure["~orpc"].outputSchema;
if (!outputSchema) {
return output;
}
const result = await outputSchema["~standard"].validate(output);
if (result.issues) {
throw new ValidationError({
message: "Server response output does not match expected schema",
issues: result.issues,
data: output
});
}
return result.value;
} catch (e) {
if (e instanceof ORPCError) {
throw await validateORPCError(procedure["~orpc"].errorMap, e);
}
throw e;
}
});
}
}
export { RequestValidationPlugin, RequestValidationPluginError, ResponseValidationPlugin };
import { fallbackORPCErrorStatus, ORPCError, isORPCErrorStatus } from '@orpc/client';
class ValidationError extends Error {
issues;
data;
constructor(options) {
super(options.message, options);
this.issues = options.issues;
this.data = options.data;
}
}
function mergeErrorMap(errorMap1, errorMap2) {
return { ...errorMap1, ...errorMap2 };
}
async function validateORPCError(map, error) {
const { code, status, message, data, cause, defined } = error;
const config = map?.[error.code];
if (!config || fallbackORPCErrorStatus(error.code, config.status) !== error.status) {
return defined ? new ORPCError(code, { defined: false, status, message, data, cause }) : error;
}
if (!config.data) {
return defined ? error : new ORPCError(code, { defined: true, status, message, data, cause });
}
const validated = await config.data["~standard"].validate(error.data);
if (validated.issues) {
return defined ? new ORPCError(code, { defined: false, status, message, data, cause }) : error;
}
return new ORPCError(code, { defined: true, status, message, data: validated.value, cause });
}
class ContractProcedure {
/**
* This property holds the defined options for the contract procedure.
*/
"~orpc";
constructor(def) {
if (def.route?.successStatus && isORPCErrorStatus(def.route.successStatus)) {
throw new Error("[ContractProcedure] Invalid successStatus.");
}
if (Object.values(def.errorMap).some((val) => val && val.status && !isORPCErrorStatus(val.status))) {
throw new Error("[ContractProcedure] Invalid error status code.");
}
this["~orpc"] = def;
}
}
function isContractProcedure(item) {
if (item instanceof ContractProcedure) {
return true;
}
return (typeof item === "object" || typeof item === "function") && item !== null && "~orpc" in item && typeof item["~orpc"] === "object" && item["~orpc"] !== null && "errorMap" in item["~orpc"] && "route" in item["~orpc"] && "meta" in item["~orpc"];
}
export { ContractProcedure as C, ValidationError as V, isContractProcedure as i, mergeErrorMap as m, validateORPCError as v };
import { ORPCErrorCode, ORPCError, HTTPMethod, HTTPPath } from '@orpc/client';
import { Promisable, IsEqual, ThrowableError } from '@orpc/shared';
import { StandardSchemaV1 } from '@standard-schema/spec';
import { OpenAPIV3_1 } from 'openapi-types';
type Schema<TInput, TOutput> = StandardSchemaV1<TInput, TOutput>;
type AnySchema = Schema<any, any>;
type SchemaIssue = StandardSchemaV1.Issue;
type InferSchemaInput<T extends AnySchema> = T extends StandardSchemaV1<infer UInput, any> ? UInput : never;
type InferSchemaOutput<T extends AnySchema> = T extends StandardSchemaV1<any, infer UOutput> ? UOutput : never;
type TypeRest<TInput, TOutput> = [map: (input: TInput) => Promisable<TOutput>] | (IsEqual<TInput, TOutput> extends true ? [] : never);
/**
* The schema for things can be trust without validation.
* If the TInput and TOutput are different, you need pass a map function.
*
* @see {@link https://orpc.dev/docs/procedure#type-utility Type Utility Docs}
*/
declare function type<TInput, TOutput = TInput>(...[map]: TypeRest<TInput, TOutput>): Schema<TInput, TOutput>;
interface ValidationErrorOptions extends ErrorOptions {
message: string;
issues: readonly SchemaIssue[];
/**
* @todo require this field in v2
*/
data?: unknown;
}
/**
* This errors usually used for ORPCError.cause when the error is a validation error.
*
* @see {@link https://orpc.dev/docs/advanced/validation-errors Validation Errors Docs}
*/
declare class ValidationError extends Error {
readonly issues: readonly SchemaIssue[];
readonly data: unknown;
constructor(options: ValidationErrorOptions);
}
interface ErrorMapItem<TDataSchema extends AnySchema> {
status?: number;
message?: string;
data?: TDataSchema;
}
type ErrorMap = {
[key in ORPCErrorCode]?: ErrorMapItem<AnySchema>;
};
type MergedErrorMap<T1 extends ErrorMap, T2 extends ErrorMap> = Omit<T1, keyof T2> & T2;
declare function mergeErrorMap<T1 extends ErrorMap, T2 extends ErrorMap>(errorMap1: T1, errorMap2: T2): MergedErrorMap<T1, T2>;
type ORPCErrorFromErrorMap<TErrorMap extends ErrorMap> = {
[K in keyof TErrorMap]: K extends string ? TErrorMap[K] extends ErrorMapItem<infer TDataSchema extends Schema<unknown, unknown>> ? ORPCError<K, InferSchemaOutput<TDataSchema>> : never : never;
}[keyof TErrorMap];
type ErrorFromErrorMap<TErrorMap extends ErrorMap> = ORPCErrorFromErrorMap<TErrorMap> | ThrowableError;
declare function validateORPCError(map: ErrorMap, error: ORPCError<any, any>): Promise<ORPCError<string, unknown>>;
type Meta = Record<string, any>;
declare function mergeMeta<T extends Meta>(meta1: T, meta2: T): T;
type InputStructure = 'compact' | 'detailed';
type OutputStructure = 'compact' | 'detailed';
interface Route {
/**
* The HTTP method of the procedure.
* This option is typically relevant when integrating with OpenAPI.
*
* @see {@link https://orpc.dev/docs/openapi/routing OpenAPI Routing Docs}
*/
method?: HTTPMethod;
/**
* The HTTP path of the procedure.
* This option is typically relevant when integrating with OpenAPI.
*
* @see {@link https://orpc.dev/docs/openapi/routing OpenAPI Routing Docs}
*/
path?: HTTPPath;
/**
* The operation ID of the endpoint.
* This option is typically relevant when integrating with OpenAPI.
*
* @default Concatenation of router segments
*/
operationId?: string;
/**
* The summary of the procedure.
* This option is typically relevant when integrating with OpenAPI.
*
* @see {@link https://orpc.dev/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
*/
summary?: string;
/**
* The description of the procedure.
* This option is typically relevant when integrating with OpenAPI.
*
* @see {@link https://orpc.dev/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
*/
description?: string;
/**
* Marks the procedure as deprecated.
* This option is typically relevant when integrating with OpenAPI.
*
* @see {@link https://orpc.dev/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
*/
deprecated?: boolean;
/**
* The tags of the procedure.
* This option is typically relevant when integrating with OpenAPI.
*
* @see {@link https://orpc.dev/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
*/
tags?: readonly string[];
/**
* The status code of the response when the procedure is successful.
* The status code must be in the 200-399 range.
* This option is typically relevant when integrating with OpenAPI.
*
* @see {@link https://orpc.dev/docs/openapi/routing OpenAPI Routing Docs}
* @default 200
*/
successStatus?: number;
/**
* The description of the response when the procedure is successful.
* This option is typically relevant when integrating with OpenAPI.
*
* @see {@link https://orpc.dev/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
* @default 'OK'
*/
successDescription?: string;
/**
* Determines how the input should be structured based on `params`, `query`, `headers`, and `body`.
*
* @option 'compact'
* Combines `params` and either `query` or `body` (depending on the HTTP method) into a single object.
*
* @option 'detailed'
* Keeps each part of the request (`params`, `query`, `headers`, and `body`) as separate fields in the input object.
*
* Example:
* ```ts
* const input = {
* params: { id: 1 },
* query: { search: 'hello' },
* headers: { 'Content-Type': 'application/json' },
* body: { name: 'John' },
* }
* ```
*
* @see {@link https://orpc.dev/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
* @default 'compact'
*/
inputStructure?: InputStructure;
/**
* Determines how the response should be structured based on the output.
*
* @option 'compact'
* The output data is directly returned as the response body.
*
* @option 'detailed'
* Return an object with optional properties:
* - `status`: The response status (must be in 200-399 range) if not set fallback to `successStatus`.
* - `headers`: Custom headers to merge with the response headers (`Record<string, string | string[] | undefined>`)
* - `body`: The response body.
*
* Example:
* ```ts
* const output = {
* status: 201,
* headers: { 'x-custom-header': 'value' },
* body: { message: 'Hello, world!' },
* };
* ```
*
* @see {@link https://orpc.dev/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
* @default 'compact'
*/
outputStructure?: OutputStructure;
/**
* Override entire auto-generated OpenAPI Operation Object Specification.
*
* @see {@link https://orpc.dev/docs/openapi/openapi-specification#operation-metadata Operation Metadata Docs}
*/
spec?: OpenAPIV3_1.OperationObject | ((current: OpenAPIV3_1.OperationObject) => OpenAPIV3_1.OperationObject);
}
declare function mergeRoute(a: Route, b: Route): Route;
declare function prefixRoute(route: Route, prefix: HTTPPath): Route;
declare function unshiftTagRoute(route: Route, tags: readonly string[]): Route;
declare function mergePrefix(a: HTTPPath | undefined, b: HTTPPath): HTTPPath;
declare function mergeTags(a: readonly string[] | undefined, b: readonly string[]): readonly string[];
interface EnhanceRouteOptions {
prefix?: HTTPPath;
tags?: readonly string[];
}
declare function enhanceRoute(route: Route, options: EnhanceRouteOptions): Route;
interface ContractProcedureDef<TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta> {
meta: TMeta;
route: Route;
inputSchema?: TInputSchema;
outputSchema?: TOutputSchema;
errorMap: TErrorMap;
}
/**
* This class represents a contract procedure.
*
* @see {@link https://orpc.dev/docs/contract-first/define-contract#procedure-contract Contract Procedure Docs}
*/
declare class ContractProcedure<TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta> {
/**
* This property holds the defined options for the contract procedure.
*/
'~orpc': ContractProcedureDef<TInputSchema, TOutputSchema, TErrorMap, TMeta>;
constructor(def: ContractProcedureDef<TInputSchema, TOutputSchema, TErrorMap, TMeta>);
}
type AnyContractProcedure = ContractProcedure<any, any, any, any>;
declare function isContractProcedure(item: unknown): item is AnyContractProcedure;
/**
* Represents a contract router, which defines a hierarchical structure of contract procedures.
*
* @info A contract procedure is a contract router too.
* @see {@link https://orpc.dev/docs/contract-first/define-contract#contract-router Contract Router Docs}
*/
type ContractRouter<TMeta extends Meta> = ContractProcedure<any, any, any, TMeta> | {
[k: string]: ContractRouter<TMeta>;
};
type AnyContractRouter = ContractRouter<any>;
/**
* Infer all inputs of the contract router.
*
* @info A contract procedure is a contract router too.
* @see {@link https://orpc.dev/docs/contract-first/define-contract#utilities Contract Utilities Docs}
*/
type InferContractRouterInputs<T extends AnyContractRouter> = T extends ContractProcedure<infer UInputSchema, any, any, any> ? InferSchemaInput<UInputSchema> : {
[K in keyof T]: T[K] extends AnyContractRouter ? InferContractRouterInputs<T[K]> : never;
};
/**
* Infer all outputs of the contract router.
*
* @info A contract procedure is a contract router too.
* @see {@link https://orpc.dev/docs/contract-first/define-contract#utilities Contract Utilities Docs}
*/
type InferContractRouterOutputs<T extends AnyContractRouter> = T extends ContractProcedure<any, infer UOutputSchema, any, any> ? InferSchemaOutput<UOutputSchema> : {
[K in keyof T]: T[K] extends AnyContractRouter ? InferContractRouterOutputs<T[K]> : never;
};
/**
* Infer all errors of the contract router.
*
* @info A contract procedure is a contract router too.
* @see {@link https://orpc.dev/docs/contract-first/define-contract#utilities Contract Utilities Docs}
*/
type InferContractRouterErrorMap<T extends AnyContractRouter> = T extends ContractProcedure<any, any, infer UErrorMap, any> ? UErrorMap : {
[K in keyof T]: T[K] extends AnyContractRouter ? InferContractRouterErrorMap<T[K]> : never;
}[keyof T];
type InferContractRouterMeta<T extends AnyContractRouter> = T extends ContractRouter<infer UMeta> ? UMeta : never;
export { ContractProcedure as C, type as D, ValidationError as j, mergeErrorMap as m, mergeMeta as n, isContractProcedure as p, mergeRoute as q, prefixRoute as r, mergePrefix as s, mergeTags as t, unshiftTagRoute as u, validateORPCError as v, enhanceRoute as w };
export type { AnyContractRouter as A, InferContractRouterMeta as B, ErrorMap as E, InputStructure as I, MergedErrorMap as M, OutputStructure as O, Route as R, Schema as S, TypeRest as T, ValidationErrorOptions as V, EnhanceRouteOptions as a, AnySchema as b, Meta as c, ContractRouter as d, ContractProcedureDef as e, InferSchemaInput as f, InferSchemaOutput as g, ErrorFromErrorMap as h, SchemaIssue as i, ErrorMapItem as k, ORPCErrorFromErrorMap as l, AnyContractProcedure as o, InferContractRouterInputs as x, InferContractRouterOutputs as y, InferContractRouterErrorMap as z };
import { ORPCErrorCode, ORPCError, HTTPMethod, HTTPPath } from '@orpc/client';
import { Promisable, IsEqual, ThrowableError } from '@orpc/shared';
import { StandardSchemaV1 } from '@standard-schema/spec';
import { OpenAPIV3_1 } from 'openapi-types';
type Schema<TInput, TOutput> = StandardSchemaV1<TInput, TOutput>;
type AnySchema = Schema<any, any>;
type SchemaIssue = StandardSchemaV1.Issue;
type InferSchemaInput<T extends AnySchema> = T extends StandardSchemaV1<infer UInput, any> ? UInput : never;
type InferSchemaOutput<T extends AnySchema> = T extends StandardSchemaV1<any, infer UOutput> ? UOutput : never;
type TypeRest<TInput, TOutput> = [map: (input: TInput) => Promisable<TOutput>] | (IsEqual<TInput, TOutput> extends true ? [] : never);
/**
* The schema for things can be trust without validation.
* If the TInput and TOutput are different, you need pass a map function.
*
* @see {@link https://orpc.dev/docs/procedure#type-utility Type Utility Docs}
*/
declare function type<TInput, TOutput = TInput>(...[map]: TypeRest<TInput, TOutput>): Schema<TInput, TOutput>;
interface ValidationErrorOptions extends ErrorOptions {
message: string;
issues: readonly SchemaIssue[];
/**
* @todo require this field in v2
*/
data?: unknown;
}
/**
* This errors usually used for ORPCError.cause when the error is a validation error.
*
* @see {@link https://orpc.dev/docs/advanced/validation-errors Validation Errors Docs}
*/
declare class ValidationError extends Error {
readonly issues: readonly SchemaIssue[];
readonly data: unknown;
constructor(options: ValidationErrorOptions);
}
interface ErrorMapItem<TDataSchema extends AnySchema> {
status?: number;
message?: string;
data?: TDataSchema;
}
type ErrorMap = {
[key in ORPCErrorCode]?: ErrorMapItem<AnySchema>;
};
type MergedErrorMap<T1 extends ErrorMap, T2 extends ErrorMap> = Omit<T1, keyof T2> & T2;
declare function mergeErrorMap<T1 extends ErrorMap, T2 extends ErrorMap>(errorMap1: T1, errorMap2: T2): MergedErrorMap<T1, T2>;
type ORPCErrorFromErrorMap<TErrorMap extends ErrorMap> = {
[K in keyof TErrorMap]: K extends string ? TErrorMap[K] extends ErrorMapItem<infer TDataSchema extends Schema<unknown, unknown>> ? ORPCError<K, InferSchemaOutput<TDataSchema>> : never : never;
}[keyof TErrorMap];
type ErrorFromErrorMap<TErrorMap extends ErrorMap> = ORPCErrorFromErrorMap<TErrorMap> | ThrowableError;
declare function validateORPCError(map: ErrorMap, error: ORPCError<any, any>): Promise<ORPCError<string, unknown>>;
type Meta = Record<string, any>;
declare function mergeMeta<T extends Meta>(meta1: T, meta2: T): T;
type InputStructure = 'compact' | 'detailed';
type OutputStructure = 'compact' | 'detailed';
interface Route {
/**
* The HTTP method of the procedure.
* This option is typically relevant when integrating with OpenAPI.
*
* @see {@link https://orpc.dev/docs/openapi/routing OpenAPI Routing Docs}
*/
method?: HTTPMethod;
/**
* The HTTP path of the procedure.
* This option is typically relevant when integrating with OpenAPI.
*
* @see {@link https://orpc.dev/docs/openapi/routing OpenAPI Routing Docs}
*/
path?: HTTPPath;
/**
* The operation ID of the endpoint.
* This option is typically relevant when integrating with OpenAPI.
*
* @default Concatenation of router segments
*/
operationId?: string;
/**
* The summary of the procedure.
* This option is typically relevant when integrating with OpenAPI.
*
* @see {@link https://orpc.dev/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
*/
summary?: string;
/**
* The description of the procedure.
* This option is typically relevant when integrating with OpenAPI.
*
* @see {@link https://orpc.dev/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
*/
description?: string;
/**
* Marks the procedure as deprecated.
* This option is typically relevant when integrating with OpenAPI.
*
* @see {@link https://orpc.dev/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
*/
deprecated?: boolean;
/**
* The tags of the procedure.
* This option is typically relevant when integrating with OpenAPI.
*
* @see {@link https://orpc.dev/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
*/
tags?: readonly string[];
/**
* The status code of the response when the procedure is successful.
* The status code must be in the 200-399 range.
* This option is typically relevant when integrating with OpenAPI.
*
* @see {@link https://orpc.dev/docs/openapi/routing OpenAPI Routing Docs}
* @default 200
*/
successStatus?: number;
/**
* The description of the response when the procedure is successful.
* This option is typically relevant when integrating with OpenAPI.
*
* @see {@link https://orpc.dev/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
* @default 'OK'
*/
successDescription?: string;
/**
* Determines how the input should be structured based on `params`, `query`, `headers`, and `body`.
*
* @option 'compact'
* Combines `params` and either `query` or `body` (depending on the HTTP method) into a single object.
*
* @option 'detailed'
* Keeps each part of the request (`params`, `query`, `headers`, and `body`) as separate fields in the input object.
*
* Example:
* ```ts
* const input = {
* params: { id: 1 },
* query: { search: 'hello' },
* headers: { 'Content-Type': 'application/json' },
* body: { name: 'John' },
* }
* ```
*
* @see {@link https://orpc.dev/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
* @default 'compact'
*/
inputStructure?: InputStructure;
/**
* Determines how the response should be structured based on the output.
*
* @option 'compact'
* The output data is directly returned as the response body.
*
* @option 'detailed'
* Return an object with optional properties:
* - `status`: The response status (must be in 200-399 range) if not set fallback to `successStatus`.
* - `headers`: Custom headers to merge with the response headers (`Record<string, string | string[] | undefined>`)
* - `body`: The response body.
*
* Example:
* ```ts
* const output = {
* status: 201,
* headers: { 'x-custom-header': 'value' },
* body: { message: 'Hello, world!' },
* };
* ```
*
* @see {@link https://orpc.dev/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
* @default 'compact'
*/
outputStructure?: OutputStructure;
/**
* Override entire auto-generated OpenAPI Operation Object Specification.
*
* @see {@link https://orpc.dev/docs/openapi/openapi-specification#operation-metadata Operation Metadata Docs}
*/
spec?: OpenAPIV3_1.OperationObject | ((current: OpenAPIV3_1.OperationObject) => OpenAPIV3_1.OperationObject);
}
declare function mergeRoute(a: Route, b: Route): Route;
declare function prefixRoute(route: Route, prefix: HTTPPath): Route;
declare function unshiftTagRoute(route: Route, tags: readonly string[]): Route;
declare function mergePrefix(a: HTTPPath | undefined, b: HTTPPath): HTTPPath;
declare function mergeTags(a: readonly string[] | undefined, b: readonly string[]): readonly string[];
interface EnhanceRouteOptions {
prefix?: HTTPPath;
tags?: readonly string[];
}
declare function enhanceRoute(route: Route, options: EnhanceRouteOptions): Route;
interface ContractProcedureDef<TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta> {
meta: TMeta;
route: Route;
inputSchema?: TInputSchema;
outputSchema?: TOutputSchema;
errorMap: TErrorMap;
}
/**
* This class represents a contract procedure.
*
* @see {@link https://orpc.dev/docs/contract-first/define-contract#procedure-contract Contract Procedure Docs}
*/
declare class ContractProcedure<TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta> {
/**
* This property holds the defined options for the contract procedure.
*/
'~orpc': ContractProcedureDef<TInputSchema, TOutputSchema, TErrorMap, TMeta>;
constructor(def: ContractProcedureDef<TInputSchema, TOutputSchema, TErrorMap, TMeta>);
}
type AnyContractProcedure = ContractProcedure<any, any, any, any>;
declare function isContractProcedure(item: unknown): item is AnyContractProcedure;
/**
* Represents a contract router, which defines a hierarchical structure of contract procedures.
*
* @info A contract procedure is a contract router too.
* @see {@link https://orpc.dev/docs/contract-first/define-contract#contract-router Contract Router Docs}
*/
type ContractRouter<TMeta extends Meta> = ContractProcedure<any, any, any, TMeta> | {
[k: string]: ContractRouter<TMeta>;
};
type AnyContractRouter = ContractRouter<any>;
/**
* Infer all inputs of the contract router.
*
* @info A contract procedure is a contract router too.
* @see {@link https://orpc.dev/docs/contract-first/define-contract#utilities Contract Utilities Docs}
*/
type InferContractRouterInputs<T extends AnyContractRouter> = T extends ContractProcedure<infer UInputSchema, any, any, any> ? InferSchemaInput<UInputSchema> : {
[K in keyof T]: T[K] extends AnyContractRouter ? InferContractRouterInputs<T[K]> : never;
};
/**
* Infer all outputs of the contract router.
*
* @info A contract procedure is a contract router too.
* @see {@link https://orpc.dev/docs/contract-first/define-contract#utilities Contract Utilities Docs}
*/
type InferContractRouterOutputs<T extends AnyContractRouter> = T extends ContractProcedure<any, infer UOutputSchema, any, any> ? InferSchemaOutput<UOutputSchema> : {
[K in keyof T]: T[K] extends AnyContractRouter ? InferContractRouterOutputs<T[K]> : never;
};
/**
* Infer all errors of the contract router.
*
* @info A contract procedure is a contract router too.
* @see {@link https://orpc.dev/docs/contract-first/define-contract#utilities Contract Utilities Docs}
*/
type InferContractRouterErrorMap<T extends AnyContractRouter> = T extends ContractProcedure<any, any, infer UErrorMap, any> ? UErrorMap : {
[K in keyof T]: T[K] extends AnyContractRouter ? InferContractRouterErrorMap<T[K]> : never;
}[keyof T];
type InferContractRouterMeta<T extends AnyContractRouter> = T extends ContractRouter<infer UMeta> ? UMeta : never;
export { ContractProcedure as C, type as D, ValidationError as j, mergeErrorMap as m, mergeMeta as n, isContractProcedure as p, mergeRoute as q, prefixRoute as r, mergePrefix as s, mergeTags as t, unshiftTagRoute as u, validateORPCError as v, enhanceRoute as w };
export type { AnyContractRouter as A, InferContractRouterMeta as B, ErrorMap as E, InputStructure as I, MergedErrorMap as M, OutputStructure as O, Route as R, Schema as S, TypeRest as T, ValidationErrorOptions as V, EnhanceRouteOptions as a, AnySchema as b, Meta as c, ContractRouter as d, ContractProcedureDef as e, InferSchemaInput as f, InferSchemaOutput as g, ErrorFromErrorMap as h, SchemaIssue as i, ErrorMapItem as k, ORPCErrorFromErrorMap as l, AnyContractProcedure as o, InferContractRouterInputs as x, InferContractRouterOutputs as y, InferContractRouterErrorMap as z };
+69
-281

@@ -1,243 +0,10 @@

import { ORPCErrorCode, ORPCError, HTTPMethod, HTTPPath, ClientContext, Client } from '@orpc/client';
import { HTTPPath, HTTPMethod, ClientContext, Client } from '@orpc/client';
export { HTTPMethod, HTTPPath, ORPCError } from '@orpc/client';
import { Promisable, IsEqual, ThrowableError } from '@orpc/shared';
export { Registry, ThrowableError } from '@orpc/shared';
import { StandardSchemaV1 } from '@standard-schema/spec';
import { OpenAPIV3_1 } from 'openapi-types';
import { E as ErrorMap, a as EnhanceRouteOptions, A as AnyContractRouter, C as ContractProcedure, M as MergedErrorMap, b as AnySchema, c as Meta, R as Route, d as ContractRouter, e as ContractProcedureDef, S as Schema, I as InputStructure, O as OutputStructure, f as InferSchemaInput, g as InferSchemaOutput, h as ErrorFromErrorMap, i as SchemaIssue } from './shared/contract.TuRtB1Ca.mjs';
export { o as AnyContractProcedure, k as ErrorMapItem, z as InferContractRouterErrorMap, x as InferContractRouterInputs, B as InferContractRouterMeta, y as InferContractRouterOutputs, l as ORPCErrorFromErrorMap, T as TypeRest, j as ValidationError, V as ValidationErrorOptions, w as enhanceRoute, p as isContractProcedure, m as mergeErrorMap, n as mergeMeta, s as mergePrefix, q as mergeRoute, t as mergeTags, r as prefixRoute, D as type, u as unshiftTagRoute, v as validateORPCError } from './shared/contract.TuRtB1Ca.mjs';
import { AsyncIteratorClass } from '@orpc/shared';
export { AsyncIteratorClass, Registry, ThrowableError } from '@orpc/shared';
export { OpenAPIV3_1 as OpenAPI } from 'openapi-types';
import '@standard-schema/spec';
type Schema<TInput, TOutput> = StandardSchemaV1<TInput, TOutput>;
type AnySchema = Schema<any, any>;
type SchemaIssue = StandardSchemaV1.Issue;
type InferSchemaInput<T extends AnySchema> = T extends StandardSchemaV1<infer UInput, any> ? UInput : never;
type InferSchemaOutput<T extends AnySchema> = T extends StandardSchemaV1<any, infer UOutput> ? UOutput : never;
type TypeRest<TInput, TOutput> = [map: (input: TInput) => Promisable<TOutput>] | (IsEqual<TInput, TOutput> extends true ? [] : never);
/**
* The schema for things can be trust without validation.
* If the TInput and TOutput are different, you need pass a map function.
*
* @see {@link https://orpc.unnoq.com/docs/procedure#type-utility Type Utility Docs}
*/
declare function type<TInput, TOutput = TInput>(...[map]: TypeRest<TInput, TOutput>): Schema<TInput, TOutput>;
interface ValidationErrorOptions extends ErrorOptions {
message: string;
issues: readonly SchemaIssue[];
}
/**
* This errors usually used for ORPCError.cause when the error is a validation error.
*
* @see {@link https://orpc.unnoq.com/docs/advanced/validation-errors Validation Errors Docs}
*/
declare class ValidationError extends Error {
readonly issues: readonly SchemaIssue[];
constructor(options: ValidationErrorOptions);
}
interface ErrorMapItem<TDataSchema extends AnySchema> {
status?: number;
message?: string;
data?: TDataSchema;
}
type ErrorMap = {
[key in ORPCErrorCode]?: ErrorMapItem<AnySchema>;
};
type MergedErrorMap<T1 extends ErrorMap, T2 extends ErrorMap> = Omit<T1, keyof T2> & T2;
declare function mergeErrorMap<T1 extends ErrorMap, T2 extends ErrorMap>(errorMap1: T1, errorMap2: T2): MergedErrorMap<T1, T2>;
type ORPCErrorFromErrorMap<TErrorMap extends ErrorMap> = {
[K in keyof TErrorMap]: K extends string ? TErrorMap[K] extends ErrorMapItem<infer TDataSchema extends Schema<unknown, unknown>> ? ORPCError<K, InferSchemaOutput<TDataSchema>> : never : never;
}[keyof TErrorMap];
type ErrorFromErrorMap<TErrorMap extends ErrorMap> = ORPCErrorFromErrorMap<TErrorMap> | ThrowableError;
type Meta = Record<string, any>;
declare function mergeMeta<T extends Meta>(meta1: T, meta2: T): T;
type InputStructure = 'compact' | 'detailed';
type OutputStructure = 'compact' | 'detailed';
interface Route {
/**
* The HTTP method of the procedure.
* This option is typically relevant when integrating with OpenAPI.
*
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
*/
method?: HTTPMethod;
/**
* The HTTP path of the procedure.
* This option is typically relevant when integrating with OpenAPI.
*
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
*/
path?: HTTPPath;
/**
* The summary of the procedure.
* This option is typically relevant when integrating with OpenAPI.
*
* @see {@link https://orpc.unnoq.com/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
*/
summary?: string;
/**
* The description of the procedure.
* This option is typically relevant when integrating with OpenAPI.
*
* @see {@link https://orpc.unnoq.com/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
*/
description?: string;
/**
* Marks the procedure as deprecated.
* This option is typically relevant when integrating with OpenAPI.
*
* @see {@link https://orpc.unnoq.com/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
*/
deprecated?: boolean;
/**
* The tags of the procedure.
* This option is typically relevant when integrating with OpenAPI.
*
* @see {@link https://orpc.unnoq.com/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
*/
tags?: readonly string[];
/**
* The status code of the response when the procedure is successful.
* The status code must be in the 200-399 range.
* This option is typically relevant when integrating with OpenAPI.
*
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
* @default 200
*/
successStatus?: number;
/**
* The description of the response when the procedure is successful.
* This option is typically relevant when integrating with OpenAPI.
*
* @see {@link https://orpc.unnoq.com/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
* @default 'OK'
*/
successDescription?: string;
/**
* Determines how the input should be structured based on `params`, `query`, `headers`, and `body`.
*
* @option 'compact'
* Combines `params` and either `query` or `body` (depending on the HTTP method) into a single object.
*
* @option 'detailed'
* Keeps each part of the request (`params`, `query`, `headers`, and `body`) as separate fields in the input object.
*
* Example:
* ```ts
* const input = {
* params: { id: 1 },
* query: { search: 'hello' },
* headers: { 'Content-Type': 'application/json' },
* body: { name: 'John' },
* }
* ```
*
* @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
* @default 'compact'
*/
inputStructure?: InputStructure;
/**
* Determines how the response should be structured based on the output.
*
* @option 'compact'
* The output data is directly returned as the response body.
*
* @option 'detailed'
* Return an object with optional properties:
* - `status`: The response status (must be in 200-399 range) if not set fallback to `successStatus`.
* - `headers`: Custom headers to merge with the response headers (`Record<string, string | string[] | undefined>`)
* - `body`: The response body.
*
* Example:
* ```ts
* const output = {
* status: 201,
* headers: { 'x-custom-header': 'value' },
* body: { message: 'Hello, world!' },
* };
* ```
*
* @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
* @default 'compact'
*/
outputStructure?: OutputStructure;
/**
* Override entire auto-generated OpenAPI Operation Object Specification.
*
* @see {@link https://orpc.unnoq.com/docs/openapi/openapi-specification#operation-metadata Operation Metadata Docs}
*/
spec?: OpenAPIV3_1.OperationObject;
}
declare function mergeRoute(a: Route, b: Route): Route;
declare function prefixRoute(route: Route, prefix: HTTPPath): Route;
declare function unshiftTagRoute(route: Route, tags: readonly string[]): Route;
declare function mergePrefix(a: HTTPPath | undefined, b: HTTPPath): HTTPPath;
declare function mergeTags(a: readonly string[] | undefined, b: readonly string[]): readonly string[];
interface EnhanceRouteOptions {
prefix?: HTTPPath;
tags?: readonly string[];
}
declare function enhanceRoute(route: Route, options: EnhanceRouteOptions): Route;
interface ContractProcedureDef<TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta> {
meta: TMeta;
route: Route;
inputSchema?: TInputSchema;
outputSchema?: TOutputSchema;
errorMap: TErrorMap;
}
/**
* This class represents a contract procedure.
*
* @see {@link https://orpc.unnoq.com/docs/contract-first/define-contract#procedure-contract Contract Procedure Docs}
*/
declare class ContractProcedure<TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta> {
/**
* This property holds the defined options for the contract procedure.
*/
'~orpc': ContractProcedureDef<TInputSchema, TOutputSchema, TErrorMap, TMeta>;
constructor(def: ContractProcedureDef<TInputSchema, TOutputSchema, TErrorMap, TMeta>);
}
type AnyContractProcedure = ContractProcedure<any, any, any, any>;
declare function isContractProcedure(item: unknown): item is AnyContractProcedure;
/**
* Represents a contract router, which defines a hierarchical structure of contract procedures.
*
* @info A contract procedure is a contract router too.
* @see {@link https://orpc.unnoq.com/docs/contract-first/define-contract#contract-router Contract Router Docs}
*/
type ContractRouter<TMeta extends Meta> = ContractProcedure<any, any, any, TMeta> | {
[k: string]: ContractRouter<TMeta>;
};
type AnyContractRouter = ContractRouter<any>;
/**
* Infer all inputs of the contract router.
*
* @info A contract procedure is a contract router too.
* @see {@link https://orpc.unnoq.com/docs/contract-first/define-contract#utilities Contract Utilities Docs}
*/
type InferContractRouterInputs<T extends AnyContractRouter> = T extends ContractProcedure<infer UInputSchema, any, any, any> ? InferSchemaInput<UInputSchema> : {
[K in keyof T]: T[K] extends AnyContractRouter ? InferContractRouterInputs<T[K]> : never;
};
/**
* Infer all outputs of the contract router.
*
* @info A contract procedure is a contract router too.
* @see {@link https://orpc.unnoq.com/docs/contract-first/define-contract#utilities Contract Utilities Docs}
*/
type InferContractRouterOutputs<T extends AnyContractRouter> = T extends ContractProcedure<any, infer UOutputSchema, any, any> ? InferSchemaOutput<UOutputSchema> : {
[K in keyof T]: T[K] extends AnyContractRouter ? InferContractRouterOutputs<T[K]> : never;
};
/**
* Infer all errors of the contract router.
*
* @info A contract procedure is a contract router too.
* @see {@link https://orpc.unnoq.com/docs/contract-first/define-contract#utilities Contract Utilities Docs}
*/
type InferContractRouterErrorMap<T extends AnyContractRouter> = T extends ContractProcedure<any, any, infer UErrorMap, any> ? UErrorMap : {
[K in keyof T]: T[K] extends AnyContractRouter ? InferContractRouterErrorMap<T[K]> : never;
}[keyof T];
type InferContractRouterMeta<T extends AnyContractRouter> = T extends ContractRouter<infer UMeta> ? UMeta : never;
declare function getContractRouter(router: AnyContractRouter, path: readonly string[]): AnyContractRouter | undefined;

@@ -257,5 +24,20 @@ type EnhancedContractRouter<T extends AnyContractRouter, TErrorMap extends ErrorMap> = T extends ContractProcedure<infer UInputSchema, infer UOutputSchema, infer UErrors, infer UMeta> ? ContractProcedure<UInputSchema, UOutputSchema, MergedErrorMap<TErrorMap, UErrors>, UMeta> : {

*
* @see {@link https://orpc.unnoq.com/docs/contract-first/router-to-contract#minify-export-the-contract-router-for-the-client Router to Contract Docs}
* @see {@link https://orpc.dev/docs/contract-first/router-to-contract#minify-export-the-contract-router-for-the-client Router to Contract Docs}
*/
declare function minifyContractRouter(router: AnyContractRouter): AnyContractRouter;
type PopulatedContractRouterPaths<T extends AnyContractRouter> = T extends ContractProcedure<infer UInputSchema, infer UOutputSchema, infer UErrors, infer UMeta> ? ContractProcedure<UInputSchema, UOutputSchema, UErrors, UMeta> : {
[K in keyof T]: T[K] extends AnyContractRouter ? PopulatedContractRouterPaths<T[K]> : never;
};
interface PopulateContractRouterPathsOptions {
path?: readonly string[];
}
/**
* Automatically populates missing route paths using the router's nested keys.
*
* Constructs paths by joining router keys with `/`.
* Useful for NestJS integration that require explicit route paths.
*
* @see {@link https://orpc.dev/docs/openapi/integrations/implement-contract-in-nest#define-your-contract NestJS Implement Contract Docs}
*/
declare function populateContractRouterPaths<T extends AnyContractRouter>(router: T, options?: PopulateContractRouterPathsOptions): PopulatedContractRouterPaths<T>;

@@ -267,3 +49,3 @@ interface ContractProcedureBuilder<TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta> extends ContractProcedure<TInputSchema, TOutputSchema, TErrorMap, TMeta> {

*
* @see {@link https://orpc.unnoq.com/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
* @see {@link https://orpc.dev/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
*/

@@ -275,3 +57,3 @@ errors<U extends ErrorMap>(errors: U): ContractProcedureBuilder<TInputSchema, TOutputSchema, MergedErrorMap<TErrorMap, U>, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/metadata Metadata Docs}
* @see {@link https://orpc.dev/docs/metadata Metadata Docs}
*/

@@ -284,4 +66,4 @@ meta(meta: TMeta): ContractProcedureBuilder<TInputSchema, TOutputSchema, TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
* @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
* @see {@link https://orpc.dev/docs/openapi/routing OpenAPI Routing Docs}
* @see {@link https://orpc.dev/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
*/

@@ -292,3 +74,3 @@ route(route: Route): ContractProcedureBuilder<TInputSchema, TOutputSchema, TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/procedure#input-output-validation Input Validation Docs}
* @see {@link https://orpc.dev/docs/procedure#input-output-validation Input Validation Docs}
*/

@@ -299,3 +81,3 @@ input<U extends AnySchema>(schema: U): ContractProcedureBuilderWithInput<U, TOutputSchema, TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/procedure#input-output-validation Output Validation Docs}
* @see {@link https://orpc.dev/docs/procedure#input-output-validation Output Validation Docs}
*/

@@ -309,3 +91,3 @@ output<U extends AnySchema>(schema: U): ContractProcedureBuilderWithOutput<TInputSchema, U, TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
* @see {@link https://orpc.dev/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
*/

@@ -317,3 +99,3 @@ errors<U extends ErrorMap>(errors: U): ContractProcedureBuilderWithInput<TInputSchema, TOutputSchema, MergedErrorMap<TErrorMap, U>, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/metadata Metadata Docs}
* @see {@link https://orpc.dev/docs/metadata Metadata Docs}
*/

@@ -326,4 +108,4 @@ meta(meta: TMeta): ContractProcedureBuilderWithInput<TInputSchema, TOutputSchema, TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
* @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
* @see {@link https://orpc.dev/docs/openapi/routing OpenAPI Routing Docs}
* @see {@link https://orpc.dev/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
*/

@@ -334,3 +116,3 @@ route(route: Route): ContractProcedureBuilderWithInput<TInputSchema, TOutputSchema, TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/procedure#input-output-validation Output Validation Docs}
* @see {@link https://orpc.dev/docs/procedure#input-output-validation Output Validation Docs}
*/

@@ -344,3 +126,3 @@ output<U extends AnySchema>(schema: U): ContractProcedureBuilderWithInputOutput<TInputSchema, U, TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
* @see {@link https://orpc.dev/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
*/

@@ -352,3 +134,3 @@ errors<U extends ErrorMap>(errors: U): ContractProcedureBuilderWithOutput<TInputSchema, TOutputSchema, MergedErrorMap<TErrorMap, U>, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/metadata Metadata Docs}
* @see {@link https://orpc.dev/docs/metadata Metadata Docs}
*/

@@ -361,4 +143,4 @@ meta(meta: TMeta): ContractProcedureBuilderWithOutput<TInputSchema, TOutputSchema, TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
* @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
* @see {@link https://orpc.dev/docs/openapi/routing OpenAPI Routing Docs}
* @see {@link https://orpc.dev/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
*/

@@ -369,3 +151,3 @@ route(route: Route): ContractProcedureBuilderWithOutput<TInputSchema, TOutputSchema, TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/procedure#input-output-validation Input Validation Docs}
* @see {@link https://orpc.dev/docs/procedure#input-output-validation Input Validation Docs}
*/

@@ -379,3 +161,3 @@ input<U extends AnySchema>(schema: U): ContractProcedureBuilderWithInputOutput<U, TOutputSchema, TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
* @see {@link https://orpc.dev/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
*/

@@ -387,3 +169,3 @@ errors<U extends ErrorMap>(errors: U): ContractProcedureBuilderWithInputOutput<TInputSchema, TOutputSchema, MergedErrorMap<TErrorMap, U>, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/metadata Metadata Docs}
* @see {@link https://orpc.dev/docs/metadata Metadata Docs}
*/

@@ -396,4 +178,4 @@ meta(meta: TMeta): ContractProcedureBuilderWithInputOutput<TInputSchema, TOutputSchema, TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
* @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
* @see {@link https://orpc.dev/docs/openapi/routing OpenAPI Routing Docs}
* @see {@link https://orpc.dev/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
*/

@@ -411,3 +193,3 @@ route(route: Route): ContractProcedureBuilderWithInputOutput<TInputSchema, TOutputSchema, TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
* @see {@link https://orpc.dev/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
*/

@@ -421,3 +203,3 @@ 'errors'<U extends ErrorMap>(errors: U): ContractRouterBuilder<MergedErrorMap<TErrorMap, U>, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/openapi/routing#route-prefixes OpenAPI Route Prefixes Docs}
* @see {@link https://orpc.dev/docs/openapi/routing#route-prefixes OpenAPI Route Prefixes Docs}
*/

@@ -429,3 +211,3 @@ 'prefix'(prefix: HTTPPath): ContractRouterBuilder<TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
* @see {@link https://orpc.dev/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
*/

@@ -436,3 +218,3 @@ 'tag'(...tags: string[]): ContractRouterBuilder<TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
* @see {@link https://orpc.dev/docs/router#extending-router Extending Router Docs}
*/

@@ -453,3 +235,3 @@ 'router'<T extends ContractRouter<TMeta>>(router: T): EnhancedContractRouter<T, TErrorMap>;

*
* @see {@link https://orpc.unnoq.com/docs/metadata Metadata Docs}
* @see {@link https://orpc.dev/docs/metadata Metadata Docs}
*/

@@ -461,11 +243,17 @@ $meta<U extends Meta>(initialMeta: U): ContractBuilder<TInputSchema, TOutputSchema, TErrorMap, U & Record<never, never>>;

*
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
* @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
* @see {@link https://orpc.dev/docs/openapi/routing OpenAPI Routing Docs}
* @see {@link https://orpc.dev/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
*/
$route(initialRoute: Route): ContractBuilder<TInputSchema, TOutputSchema, TErrorMap, TMeta>;
/**
* Sets or overrides the initial input schema.
*
* @see {@link https://orpc.dev/docs/procedure#initial-configuration Initial Procedure Configuration Docs}
*/
$input<U extends AnySchema>(initialInputSchema?: U): ContractBuilder<U, TOutputSchema, TErrorMap, TMeta>;
/**
* Adds type-safe custom errors to the contract.
* The provided errors are spared-merged with any existing errors in the contract.
*
* @see {@link https://orpc.unnoq.com/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
* @see {@link https://orpc.dev/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
*/

@@ -477,3 +265,3 @@ errors<U extends ErrorMap>(errors: U): ContractBuilder<TInputSchema, TOutputSchema, MergedErrorMap<TErrorMap, U>, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/metadata Metadata Docs}
* @see {@link https://orpc.dev/docs/metadata Metadata Docs}
*/

@@ -486,4 +274,4 @@ meta(meta: TMeta): ContractProcedureBuilder<TInputSchema, TOutputSchema, TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
* @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
* @see {@link https://orpc.dev/docs/openapi/routing OpenAPI Routing Docs}
* @see {@link https://orpc.dev/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
*/

@@ -494,3 +282,3 @@ route(route: Route): ContractProcedureBuilder<TInputSchema, TOutputSchema, TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/procedure#input-output-validation Input Validation Docs}
* @see {@link https://orpc.dev/docs/procedure#input-output-validation Input Validation Docs}
*/

@@ -501,3 +289,3 @@ input<U extends AnySchema>(schema: U): ContractProcedureBuilderWithInput<U, TOutputSchema, TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/procedure#input-output-validation Output Validation Docs}
* @see {@link https://orpc.dev/docs/procedure#input-output-validation Output Validation Docs}
*/

@@ -511,3 +299,3 @@ output<U extends AnySchema>(schema: U): ContractProcedureBuilderWithOutput<TInputSchema, U, TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/openapi/routing#route-prefixes OpenAPI Route Prefixes Docs}
* @see {@link https://orpc.dev/docs/openapi/routing#route-prefixes OpenAPI Route Prefixes Docs}
*/

@@ -519,3 +307,3 @@ prefix(prefix: HTTPPath): ContractRouterBuilder<TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
* @see {@link https://orpc.dev/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
*/

@@ -526,3 +314,3 @@ tag(...tags: string[]): ContractRouterBuilder<TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
* @see {@link https://orpc.dev/docs/router#extending-router Extending Router Docs}
*/

@@ -549,5 +337,5 @@ router<T extends ContractRouter<TMeta>>(router: T): EnhancedContractRouter<T, TErrorMap>;

*
* @see {@link https://orpc.unnoq.com/docs/event-iterator#validate-event-iterator Validate Event Iterator Docs}
* @see {@link https://orpc.dev/docs/event-iterator#validate-event-iterator Validate Event Iterator Docs}
*/
declare function eventIterator<TYieldIn, TYieldOut, TReturnIn = unknown, TReturnOut = unknown>(yields: Schema<TYieldIn, TYieldOut>, returns?: Schema<TReturnIn, TReturnOut>): Schema<AsyncIteratorObject<TYieldIn, TReturnIn, void>, AsyncIteratorObject<TYieldOut, TReturnOut, void>>;
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>>;
declare function getEventIteratorSchemaDetails(schema: AnySchema | undefined): undefined | EventIteratorSchemaDetails;

@@ -558,3 +346,3 @@

*
* @see {@link https://orpc.unnoq.com/docs/client/rpc-link#custom-request-method RPCLink Custom Request Method}
* @see {@link https://orpc.dev/docs/client/rpc-link#custom-request-method RPCLink Custom Request Method}
*/

@@ -571,3 +359,3 @@ declare function inferRPCMethodFromContractRouter(contract: AnyContractRouter): (options: unknown, path: readonly string[]) => Exclude<HTTPMethod, 'HEAD'>;

export { ContractBuilder, ContractProcedure, ValidationError, enhanceContractRouter, enhanceRoute, eventIterator, fallbackContractConfig, getContractRouter, getEventIteratorSchemaDetails, inferRPCMethodFromContractRouter, isContractProcedure, isSchemaIssue, mergeErrorMap, mergeMeta, mergePrefix, mergeRoute, mergeTags, minifyContractRouter, oc, prefixRoute, type, unshiftTagRoute };
export type { AnyContractProcedure, AnyContractRouter, AnySchema, ContractBuilderDef, ContractConfig, ContractProcedureBuilder, ContractProcedureBuilderWithInput, ContractProcedureBuilderWithInputOutput, ContractProcedureBuilderWithOutput, ContractProcedureClient, ContractProcedureDef, ContractRouter, ContractRouterBuilder, ContractRouterClient, EnhanceContractRouterOptions, EnhanceRouteOptions, EnhancedContractRouter, ErrorFromErrorMap, ErrorMap, ErrorMapItem, EventIteratorSchemaDetails, InferContractRouterErrorMap, InferContractRouterInputs, InferContractRouterMeta, InferContractRouterOutputs, InferSchemaInput, InferSchemaOutput, InputStructure, MergedErrorMap, Meta, ORPCErrorFromErrorMap, OutputStructure, Route, Schema, SchemaIssue, TypeRest, ValidationErrorOptions };
export { AnyContractRouter, AnySchema, ContractBuilder, ContractProcedure, ContractProcedureDef, ContractRouter, EnhanceRouteOptions, ErrorFromErrorMap, ErrorMap, InferSchemaInput, InferSchemaOutput, InputStructure, MergedErrorMap, Meta, OutputStructure, Route, Schema, SchemaIssue, enhanceContractRouter, eventIterator, fallbackContractConfig, getContractRouter, getEventIteratorSchemaDetails, inferRPCMethodFromContractRouter, isSchemaIssue, minifyContractRouter, oc, populateContractRouterPaths };
export type { ContractBuilderDef, ContractConfig, ContractProcedureBuilder, ContractProcedureBuilderWithInput, ContractProcedureBuilderWithInputOutput, ContractProcedureBuilderWithOutput, ContractProcedureClient, ContractRouterBuilder, ContractRouterClient, EnhanceContractRouterOptions, EnhancedContractRouter, EventIteratorSchemaDetails, PopulateContractRouterPathsOptions, PopulatedContractRouterPaths };

@@ -1,243 +0,10 @@

import { ORPCErrorCode, ORPCError, HTTPMethod, HTTPPath, ClientContext, Client } from '@orpc/client';
import { HTTPPath, HTTPMethod, ClientContext, Client } from '@orpc/client';
export { HTTPMethod, HTTPPath, ORPCError } from '@orpc/client';
import { Promisable, IsEqual, ThrowableError } from '@orpc/shared';
export { Registry, ThrowableError } from '@orpc/shared';
import { StandardSchemaV1 } from '@standard-schema/spec';
import { OpenAPIV3_1 } from 'openapi-types';
import { E as ErrorMap, a as EnhanceRouteOptions, A as AnyContractRouter, C as ContractProcedure, M as MergedErrorMap, b as AnySchema, c as Meta, R as Route, d as ContractRouter, e as ContractProcedureDef, S as Schema, I as InputStructure, O as OutputStructure, f as InferSchemaInput, g as InferSchemaOutput, h as ErrorFromErrorMap, i as SchemaIssue } from './shared/contract.TuRtB1Ca.js';
export { o as AnyContractProcedure, k as ErrorMapItem, z as InferContractRouterErrorMap, x as InferContractRouterInputs, B as InferContractRouterMeta, y as InferContractRouterOutputs, l as ORPCErrorFromErrorMap, T as TypeRest, j as ValidationError, V as ValidationErrorOptions, w as enhanceRoute, p as isContractProcedure, m as mergeErrorMap, n as mergeMeta, s as mergePrefix, q as mergeRoute, t as mergeTags, r as prefixRoute, D as type, u as unshiftTagRoute, v as validateORPCError } from './shared/contract.TuRtB1Ca.js';
import { AsyncIteratorClass } from '@orpc/shared';
export { AsyncIteratorClass, Registry, ThrowableError } from '@orpc/shared';
export { OpenAPIV3_1 as OpenAPI } from 'openapi-types';
import '@standard-schema/spec';
type Schema<TInput, TOutput> = StandardSchemaV1<TInput, TOutput>;
type AnySchema = Schema<any, any>;
type SchemaIssue = StandardSchemaV1.Issue;
type InferSchemaInput<T extends AnySchema> = T extends StandardSchemaV1<infer UInput, any> ? UInput : never;
type InferSchemaOutput<T extends AnySchema> = T extends StandardSchemaV1<any, infer UOutput> ? UOutput : never;
type TypeRest<TInput, TOutput> = [map: (input: TInput) => Promisable<TOutput>] | (IsEqual<TInput, TOutput> extends true ? [] : never);
/**
* The schema for things can be trust without validation.
* If the TInput and TOutput are different, you need pass a map function.
*
* @see {@link https://orpc.unnoq.com/docs/procedure#type-utility Type Utility Docs}
*/
declare function type<TInput, TOutput = TInput>(...[map]: TypeRest<TInput, TOutput>): Schema<TInput, TOutput>;
interface ValidationErrorOptions extends ErrorOptions {
message: string;
issues: readonly SchemaIssue[];
}
/**
* This errors usually used for ORPCError.cause when the error is a validation error.
*
* @see {@link https://orpc.unnoq.com/docs/advanced/validation-errors Validation Errors Docs}
*/
declare class ValidationError extends Error {
readonly issues: readonly SchemaIssue[];
constructor(options: ValidationErrorOptions);
}
interface ErrorMapItem<TDataSchema extends AnySchema> {
status?: number;
message?: string;
data?: TDataSchema;
}
type ErrorMap = {
[key in ORPCErrorCode]?: ErrorMapItem<AnySchema>;
};
type MergedErrorMap<T1 extends ErrorMap, T2 extends ErrorMap> = Omit<T1, keyof T2> & T2;
declare function mergeErrorMap<T1 extends ErrorMap, T2 extends ErrorMap>(errorMap1: T1, errorMap2: T2): MergedErrorMap<T1, T2>;
type ORPCErrorFromErrorMap<TErrorMap extends ErrorMap> = {
[K in keyof TErrorMap]: K extends string ? TErrorMap[K] extends ErrorMapItem<infer TDataSchema extends Schema<unknown, unknown>> ? ORPCError<K, InferSchemaOutput<TDataSchema>> : never : never;
}[keyof TErrorMap];
type ErrorFromErrorMap<TErrorMap extends ErrorMap> = ORPCErrorFromErrorMap<TErrorMap> | ThrowableError;
type Meta = Record<string, any>;
declare function mergeMeta<T extends Meta>(meta1: T, meta2: T): T;
type InputStructure = 'compact' | 'detailed';
type OutputStructure = 'compact' | 'detailed';
interface Route {
/**
* The HTTP method of the procedure.
* This option is typically relevant when integrating with OpenAPI.
*
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
*/
method?: HTTPMethod;
/**
* The HTTP path of the procedure.
* This option is typically relevant when integrating with OpenAPI.
*
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
*/
path?: HTTPPath;
/**
* The summary of the procedure.
* This option is typically relevant when integrating with OpenAPI.
*
* @see {@link https://orpc.unnoq.com/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
*/
summary?: string;
/**
* The description of the procedure.
* This option is typically relevant when integrating with OpenAPI.
*
* @see {@link https://orpc.unnoq.com/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
*/
description?: string;
/**
* Marks the procedure as deprecated.
* This option is typically relevant when integrating with OpenAPI.
*
* @see {@link https://orpc.unnoq.com/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
*/
deprecated?: boolean;
/**
* The tags of the procedure.
* This option is typically relevant when integrating with OpenAPI.
*
* @see {@link https://orpc.unnoq.com/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
*/
tags?: readonly string[];
/**
* The status code of the response when the procedure is successful.
* The status code must be in the 200-399 range.
* This option is typically relevant when integrating with OpenAPI.
*
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
* @default 200
*/
successStatus?: number;
/**
* The description of the response when the procedure is successful.
* This option is typically relevant when integrating with OpenAPI.
*
* @see {@link https://orpc.unnoq.com/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
* @default 'OK'
*/
successDescription?: string;
/**
* Determines how the input should be structured based on `params`, `query`, `headers`, and `body`.
*
* @option 'compact'
* Combines `params` and either `query` or `body` (depending on the HTTP method) into a single object.
*
* @option 'detailed'
* Keeps each part of the request (`params`, `query`, `headers`, and `body`) as separate fields in the input object.
*
* Example:
* ```ts
* const input = {
* params: { id: 1 },
* query: { search: 'hello' },
* headers: { 'Content-Type': 'application/json' },
* body: { name: 'John' },
* }
* ```
*
* @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
* @default 'compact'
*/
inputStructure?: InputStructure;
/**
* Determines how the response should be structured based on the output.
*
* @option 'compact'
* The output data is directly returned as the response body.
*
* @option 'detailed'
* Return an object with optional properties:
* - `status`: The response status (must be in 200-399 range) if not set fallback to `successStatus`.
* - `headers`: Custom headers to merge with the response headers (`Record<string, string | string[] | undefined>`)
* - `body`: The response body.
*
* Example:
* ```ts
* const output = {
* status: 201,
* headers: { 'x-custom-header': 'value' },
* body: { message: 'Hello, world!' },
* };
* ```
*
* @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
* @default 'compact'
*/
outputStructure?: OutputStructure;
/**
* Override entire auto-generated OpenAPI Operation Object Specification.
*
* @see {@link https://orpc.unnoq.com/docs/openapi/openapi-specification#operation-metadata Operation Metadata Docs}
*/
spec?: OpenAPIV3_1.OperationObject;
}
declare function mergeRoute(a: Route, b: Route): Route;
declare function prefixRoute(route: Route, prefix: HTTPPath): Route;
declare function unshiftTagRoute(route: Route, tags: readonly string[]): Route;
declare function mergePrefix(a: HTTPPath | undefined, b: HTTPPath): HTTPPath;
declare function mergeTags(a: readonly string[] | undefined, b: readonly string[]): readonly string[];
interface EnhanceRouteOptions {
prefix?: HTTPPath;
tags?: readonly string[];
}
declare function enhanceRoute(route: Route, options: EnhanceRouteOptions): Route;
interface ContractProcedureDef<TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta> {
meta: TMeta;
route: Route;
inputSchema?: TInputSchema;
outputSchema?: TOutputSchema;
errorMap: TErrorMap;
}
/**
* This class represents a contract procedure.
*
* @see {@link https://orpc.unnoq.com/docs/contract-first/define-contract#procedure-contract Contract Procedure Docs}
*/
declare class ContractProcedure<TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta> {
/**
* This property holds the defined options for the contract procedure.
*/
'~orpc': ContractProcedureDef<TInputSchema, TOutputSchema, TErrorMap, TMeta>;
constructor(def: ContractProcedureDef<TInputSchema, TOutputSchema, TErrorMap, TMeta>);
}
type AnyContractProcedure = ContractProcedure<any, any, any, any>;
declare function isContractProcedure(item: unknown): item is AnyContractProcedure;
/**
* Represents a contract router, which defines a hierarchical structure of contract procedures.
*
* @info A contract procedure is a contract router too.
* @see {@link https://orpc.unnoq.com/docs/contract-first/define-contract#contract-router Contract Router Docs}
*/
type ContractRouter<TMeta extends Meta> = ContractProcedure<any, any, any, TMeta> | {
[k: string]: ContractRouter<TMeta>;
};
type AnyContractRouter = ContractRouter<any>;
/**
* Infer all inputs of the contract router.
*
* @info A contract procedure is a contract router too.
* @see {@link https://orpc.unnoq.com/docs/contract-first/define-contract#utilities Contract Utilities Docs}
*/
type InferContractRouterInputs<T extends AnyContractRouter> = T extends ContractProcedure<infer UInputSchema, any, any, any> ? InferSchemaInput<UInputSchema> : {
[K in keyof T]: T[K] extends AnyContractRouter ? InferContractRouterInputs<T[K]> : never;
};
/**
* Infer all outputs of the contract router.
*
* @info A contract procedure is a contract router too.
* @see {@link https://orpc.unnoq.com/docs/contract-first/define-contract#utilities Contract Utilities Docs}
*/
type InferContractRouterOutputs<T extends AnyContractRouter> = T extends ContractProcedure<any, infer UOutputSchema, any, any> ? InferSchemaOutput<UOutputSchema> : {
[K in keyof T]: T[K] extends AnyContractRouter ? InferContractRouterOutputs<T[K]> : never;
};
/**
* Infer all errors of the contract router.
*
* @info A contract procedure is a contract router too.
* @see {@link https://orpc.unnoq.com/docs/contract-first/define-contract#utilities Contract Utilities Docs}
*/
type InferContractRouterErrorMap<T extends AnyContractRouter> = T extends ContractProcedure<any, any, infer UErrorMap, any> ? UErrorMap : {
[K in keyof T]: T[K] extends AnyContractRouter ? InferContractRouterErrorMap<T[K]> : never;
}[keyof T];
type InferContractRouterMeta<T extends AnyContractRouter> = T extends ContractRouter<infer UMeta> ? UMeta : never;
declare function getContractRouter(router: AnyContractRouter, path: readonly string[]): AnyContractRouter | undefined;

@@ -257,5 +24,20 @@ type EnhancedContractRouter<T extends AnyContractRouter, TErrorMap extends ErrorMap> = T extends ContractProcedure<infer UInputSchema, infer UOutputSchema, infer UErrors, infer UMeta> ? ContractProcedure<UInputSchema, UOutputSchema, MergedErrorMap<TErrorMap, UErrors>, UMeta> : {

*
* @see {@link https://orpc.unnoq.com/docs/contract-first/router-to-contract#minify-export-the-contract-router-for-the-client Router to Contract Docs}
* @see {@link https://orpc.dev/docs/contract-first/router-to-contract#minify-export-the-contract-router-for-the-client Router to Contract Docs}
*/
declare function minifyContractRouter(router: AnyContractRouter): AnyContractRouter;
type PopulatedContractRouterPaths<T extends AnyContractRouter> = T extends ContractProcedure<infer UInputSchema, infer UOutputSchema, infer UErrors, infer UMeta> ? ContractProcedure<UInputSchema, UOutputSchema, UErrors, UMeta> : {
[K in keyof T]: T[K] extends AnyContractRouter ? PopulatedContractRouterPaths<T[K]> : never;
};
interface PopulateContractRouterPathsOptions {
path?: readonly string[];
}
/**
* Automatically populates missing route paths using the router's nested keys.
*
* Constructs paths by joining router keys with `/`.
* Useful for NestJS integration that require explicit route paths.
*
* @see {@link https://orpc.dev/docs/openapi/integrations/implement-contract-in-nest#define-your-contract NestJS Implement Contract Docs}
*/
declare function populateContractRouterPaths<T extends AnyContractRouter>(router: T, options?: PopulateContractRouterPathsOptions): PopulatedContractRouterPaths<T>;

@@ -267,3 +49,3 @@ interface ContractProcedureBuilder<TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta> extends ContractProcedure<TInputSchema, TOutputSchema, TErrorMap, TMeta> {

*
* @see {@link https://orpc.unnoq.com/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
* @see {@link https://orpc.dev/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
*/

@@ -275,3 +57,3 @@ errors<U extends ErrorMap>(errors: U): ContractProcedureBuilder<TInputSchema, TOutputSchema, MergedErrorMap<TErrorMap, U>, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/metadata Metadata Docs}
* @see {@link https://orpc.dev/docs/metadata Metadata Docs}
*/

@@ -284,4 +66,4 @@ meta(meta: TMeta): ContractProcedureBuilder<TInputSchema, TOutputSchema, TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
* @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
* @see {@link https://orpc.dev/docs/openapi/routing OpenAPI Routing Docs}
* @see {@link https://orpc.dev/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
*/

@@ -292,3 +74,3 @@ route(route: Route): ContractProcedureBuilder<TInputSchema, TOutputSchema, TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/procedure#input-output-validation Input Validation Docs}
* @see {@link https://orpc.dev/docs/procedure#input-output-validation Input Validation Docs}
*/

@@ -299,3 +81,3 @@ input<U extends AnySchema>(schema: U): ContractProcedureBuilderWithInput<U, TOutputSchema, TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/procedure#input-output-validation Output Validation Docs}
* @see {@link https://orpc.dev/docs/procedure#input-output-validation Output Validation Docs}
*/

@@ -309,3 +91,3 @@ output<U extends AnySchema>(schema: U): ContractProcedureBuilderWithOutput<TInputSchema, U, TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
* @see {@link https://orpc.dev/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
*/

@@ -317,3 +99,3 @@ errors<U extends ErrorMap>(errors: U): ContractProcedureBuilderWithInput<TInputSchema, TOutputSchema, MergedErrorMap<TErrorMap, U>, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/metadata Metadata Docs}
* @see {@link https://orpc.dev/docs/metadata Metadata Docs}
*/

@@ -326,4 +108,4 @@ meta(meta: TMeta): ContractProcedureBuilderWithInput<TInputSchema, TOutputSchema, TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
* @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
* @see {@link https://orpc.dev/docs/openapi/routing OpenAPI Routing Docs}
* @see {@link https://orpc.dev/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
*/

@@ -334,3 +116,3 @@ route(route: Route): ContractProcedureBuilderWithInput<TInputSchema, TOutputSchema, TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/procedure#input-output-validation Output Validation Docs}
* @see {@link https://orpc.dev/docs/procedure#input-output-validation Output Validation Docs}
*/

@@ -344,3 +126,3 @@ output<U extends AnySchema>(schema: U): ContractProcedureBuilderWithInputOutput<TInputSchema, U, TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
* @see {@link https://orpc.dev/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
*/

@@ -352,3 +134,3 @@ errors<U extends ErrorMap>(errors: U): ContractProcedureBuilderWithOutput<TInputSchema, TOutputSchema, MergedErrorMap<TErrorMap, U>, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/metadata Metadata Docs}
* @see {@link https://orpc.dev/docs/metadata Metadata Docs}
*/

@@ -361,4 +143,4 @@ meta(meta: TMeta): ContractProcedureBuilderWithOutput<TInputSchema, TOutputSchema, TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
* @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
* @see {@link https://orpc.dev/docs/openapi/routing OpenAPI Routing Docs}
* @see {@link https://orpc.dev/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
*/

@@ -369,3 +151,3 @@ route(route: Route): ContractProcedureBuilderWithOutput<TInputSchema, TOutputSchema, TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/procedure#input-output-validation Input Validation Docs}
* @see {@link https://orpc.dev/docs/procedure#input-output-validation Input Validation Docs}
*/

@@ -379,3 +161,3 @@ input<U extends AnySchema>(schema: U): ContractProcedureBuilderWithInputOutput<U, TOutputSchema, TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
* @see {@link https://orpc.dev/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
*/

@@ -387,3 +169,3 @@ errors<U extends ErrorMap>(errors: U): ContractProcedureBuilderWithInputOutput<TInputSchema, TOutputSchema, MergedErrorMap<TErrorMap, U>, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/metadata Metadata Docs}
* @see {@link https://orpc.dev/docs/metadata Metadata Docs}
*/

@@ -396,4 +178,4 @@ meta(meta: TMeta): ContractProcedureBuilderWithInputOutput<TInputSchema, TOutputSchema, TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
* @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
* @see {@link https://orpc.dev/docs/openapi/routing OpenAPI Routing Docs}
* @see {@link https://orpc.dev/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
*/

@@ -411,3 +193,3 @@ route(route: Route): ContractProcedureBuilderWithInputOutput<TInputSchema, TOutputSchema, TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
* @see {@link https://orpc.dev/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
*/

@@ -421,3 +203,3 @@ 'errors'<U extends ErrorMap>(errors: U): ContractRouterBuilder<MergedErrorMap<TErrorMap, U>, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/openapi/routing#route-prefixes OpenAPI Route Prefixes Docs}
* @see {@link https://orpc.dev/docs/openapi/routing#route-prefixes OpenAPI Route Prefixes Docs}
*/

@@ -429,3 +211,3 @@ 'prefix'(prefix: HTTPPath): ContractRouterBuilder<TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
* @see {@link https://orpc.dev/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
*/

@@ -436,3 +218,3 @@ 'tag'(...tags: string[]): ContractRouterBuilder<TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
* @see {@link https://orpc.dev/docs/router#extending-router Extending Router Docs}
*/

@@ -453,3 +235,3 @@ 'router'<T extends ContractRouter<TMeta>>(router: T): EnhancedContractRouter<T, TErrorMap>;

*
* @see {@link https://orpc.unnoq.com/docs/metadata Metadata Docs}
* @see {@link https://orpc.dev/docs/metadata Metadata Docs}
*/

@@ -461,11 +243,17 @@ $meta<U extends Meta>(initialMeta: U): ContractBuilder<TInputSchema, TOutputSchema, TErrorMap, U & Record<never, never>>;

*
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
* @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
* @see {@link https://orpc.dev/docs/openapi/routing OpenAPI Routing Docs}
* @see {@link https://orpc.dev/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
*/
$route(initialRoute: Route): ContractBuilder<TInputSchema, TOutputSchema, TErrorMap, TMeta>;
/**
* Sets or overrides the initial input schema.
*
* @see {@link https://orpc.dev/docs/procedure#initial-configuration Initial Procedure Configuration Docs}
*/
$input<U extends AnySchema>(initialInputSchema?: U): ContractBuilder<U, TOutputSchema, TErrorMap, TMeta>;
/**
* Adds type-safe custom errors to the contract.
* The provided errors are spared-merged with any existing errors in the contract.
*
* @see {@link https://orpc.unnoq.com/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
* @see {@link https://orpc.dev/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
*/

@@ -477,3 +265,3 @@ errors<U extends ErrorMap>(errors: U): ContractBuilder<TInputSchema, TOutputSchema, MergedErrorMap<TErrorMap, U>, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/metadata Metadata Docs}
* @see {@link https://orpc.dev/docs/metadata Metadata Docs}
*/

@@ -486,4 +274,4 @@ meta(meta: TMeta): ContractProcedureBuilder<TInputSchema, TOutputSchema, TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
* @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
* @see {@link https://orpc.dev/docs/openapi/routing OpenAPI Routing Docs}
* @see {@link https://orpc.dev/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
*/

@@ -494,3 +282,3 @@ route(route: Route): ContractProcedureBuilder<TInputSchema, TOutputSchema, TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/procedure#input-output-validation Input Validation Docs}
* @see {@link https://orpc.dev/docs/procedure#input-output-validation Input Validation Docs}
*/

@@ -501,3 +289,3 @@ input<U extends AnySchema>(schema: U): ContractProcedureBuilderWithInput<U, TOutputSchema, TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/procedure#input-output-validation Output Validation Docs}
* @see {@link https://orpc.dev/docs/procedure#input-output-validation Output Validation Docs}
*/

@@ -511,3 +299,3 @@ output<U extends AnySchema>(schema: U): ContractProcedureBuilderWithOutput<TInputSchema, U, TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/openapi/routing#route-prefixes OpenAPI Route Prefixes Docs}
* @see {@link https://orpc.dev/docs/openapi/routing#route-prefixes OpenAPI Route Prefixes Docs}
*/

@@ -519,3 +307,3 @@ prefix(prefix: HTTPPath): ContractRouterBuilder<TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
* @see {@link https://orpc.dev/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
*/

@@ -526,3 +314,3 @@ tag(...tags: string[]): ContractRouterBuilder<TErrorMap, TMeta>;

*
* @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
* @see {@link https://orpc.dev/docs/router#extending-router Extending Router Docs}
*/

@@ -549,5 +337,5 @@ router<T extends ContractRouter<TMeta>>(router: T): EnhancedContractRouter<T, TErrorMap>;

*
* @see {@link https://orpc.unnoq.com/docs/event-iterator#validate-event-iterator Validate Event Iterator Docs}
* @see {@link https://orpc.dev/docs/event-iterator#validate-event-iterator Validate Event Iterator Docs}
*/
declare function eventIterator<TYieldIn, TYieldOut, TReturnIn = unknown, TReturnOut = unknown>(yields: Schema<TYieldIn, TYieldOut>, returns?: Schema<TReturnIn, TReturnOut>): Schema<AsyncIteratorObject<TYieldIn, TReturnIn, void>, AsyncIteratorObject<TYieldOut, TReturnOut, void>>;
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>>;
declare function getEventIteratorSchemaDetails(schema: AnySchema | undefined): undefined | EventIteratorSchemaDetails;

@@ -558,3 +346,3 @@

*
* @see {@link https://orpc.unnoq.com/docs/client/rpc-link#custom-request-method RPCLink Custom Request Method}
* @see {@link https://orpc.dev/docs/client/rpc-link#custom-request-method RPCLink Custom Request Method}
*/

@@ -571,3 +359,3 @@ declare function inferRPCMethodFromContractRouter(contract: AnyContractRouter): (options: unknown, path: readonly string[]) => Exclude<HTTPMethod, 'HEAD'>;

export { ContractBuilder, ContractProcedure, ValidationError, enhanceContractRouter, enhanceRoute, eventIterator, fallbackContractConfig, getContractRouter, getEventIteratorSchemaDetails, inferRPCMethodFromContractRouter, isContractProcedure, isSchemaIssue, mergeErrorMap, mergeMeta, mergePrefix, mergeRoute, mergeTags, minifyContractRouter, oc, prefixRoute, type, unshiftTagRoute };
export type { AnyContractProcedure, AnyContractRouter, AnySchema, ContractBuilderDef, ContractConfig, ContractProcedureBuilder, ContractProcedureBuilderWithInput, ContractProcedureBuilderWithInputOutput, ContractProcedureBuilderWithOutput, ContractProcedureClient, ContractProcedureDef, ContractRouter, ContractRouterBuilder, ContractRouterClient, EnhanceContractRouterOptions, EnhanceRouteOptions, EnhancedContractRouter, ErrorFromErrorMap, ErrorMap, ErrorMapItem, EventIteratorSchemaDetails, InferContractRouterErrorMap, InferContractRouterInputs, InferContractRouterMeta, InferContractRouterOutputs, InferSchemaInput, InferSchemaOutput, InputStructure, MergedErrorMap, Meta, ORPCErrorFromErrorMap, OutputStructure, Route, Schema, SchemaIssue, TypeRest, ValidationErrorOptions };
export { AnyContractRouter, AnySchema, ContractBuilder, ContractProcedure, ContractProcedureDef, ContractRouter, EnhanceRouteOptions, ErrorFromErrorMap, ErrorMap, InferSchemaInput, InferSchemaOutput, InputStructure, MergedErrorMap, Meta, OutputStructure, Route, Schema, SchemaIssue, enhanceContractRouter, eventIterator, fallbackContractConfig, getContractRouter, getEventIteratorSchemaDetails, inferRPCMethodFromContractRouter, isSchemaIssue, minifyContractRouter, oc, populateContractRouterPaths };
export type { ContractBuilderDef, ContractConfig, ContractProcedureBuilder, ContractProcedureBuilderWithInput, ContractProcedureBuilderWithInputOutput, ContractProcedureBuilderWithOutput, ContractProcedureClient, ContractRouterBuilder, ContractRouterClient, EnhanceContractRouterOptions, EnhancedContractRouter, EventIteratorSchemaDetails, PopulateContractRouterPathsOptions, PopulatedContractRouterPaths };

@@ -1,16 +0,9 @@

import { isORPCErrorStatus, mapEventIterator, ORPCError } from '@orpc/client';
import { i as isContractProcedure, C as ContractProcedure, m as mergeErrorMap, V as ValidationError } from './shared/contract.D_dZrO__.mjs';
export { v as validateORPCError } from './shared/contract.D_dZrO__.mjs';
import { toHttpPath } from '@orpc/client/standard';
import { toArray, isAsyncIteratorObject, get, isTypescriptObject, isPropertyKey } from '@orpc/shared';
export { AsyncIteratorClass } from '@orpc/shared';
import { mapEventIterator, ORPCError } from '@orpc/client';
export { ORPCError } from '@orpc/client';
import { isAsyncIteratorObject, get, isTypescriptObject, isPropertyKey } from '@orpc/shared';
class ValidationError extends Error {
issues;
constructor(options) {
super(options.message, options);
this.issues = options.issues;
}
}
function mergeErrorMap(errorMap1, errorMap2) {
return { ...errorMap1, ...errorMap2 };
}
function mergeMeta(meta1, meta2) {

@@ -20,24 +13,2 @@ return { ...meta1, ...meta2 };

class ContractProcedure {
/**
* This property holds the defined options for the contract procedure.
*/
"~orpc";
constructor(def) {
if (def.route?.successStatus && isORPCErrorStatus(def.route.successStatus)) {
throw new Error("[ContractProcedure] Invalid successStatus.");
}
if (Object.values(def.errorMap).some((val) => val && val.status && !isORPCErrorStatus(val.status))) {
throw new Error("[ContractProcedure] Invalid error status code.");
}
this["~orpc"] = def;
}
}
function isContractProcedure(item) {
if (item instanceof ContractProcedure) {
return true;
}
return (typeof item === "object" || typeof item === "function") && item !== null && "~orpc" in item && typeof item["~orpc"] === "object" && item["~orpc"] !== null && "errorMap" in item["~orpc"] && "route" in item["~orpc"] && "meta" in item["~orpc"];
}
function mergeRoute(a, b) {

@@ -88,2 +59,5 @@ return { ...a, ...b };

}
if (typeof current !== "object") {
return void 0;
}
current = current[segment];

@@ -102,2 +76,5 @@ }

}
if (typeof router !== "object" || router === null) {
return router;
}
const enhanced = {};

@@ -120,2 +97,5 @@ for (const key in router) {

}
if (typeof router !== "object" || router === null) {
return router;
}
const json = {};

@@ -127,2 +107,25 @@ for (const key in router) {

}
function populateContractRouterPaths(router, options = {}) {
const path = toArray(options.path);
if (isContractProcedure(router)) {
if (router["~orpc"].route.path === void 0) {
return new ContractProcedure({
...router["~orpc"],
route: {
...router["~orpc"].route,
path: toHttpPath(path)
}
});
}
return router;
}
if (typeof router !== "object" || router === null) {
return router;
}
const populated = {};
for (const key in router) {
populated[key] = populateContractRouterPaths(router[key], { ...options, path: [...path, key] });
}
return populated;
}

@@ -138,3 +141,3 @@ class ContractBuilder extends ContractProcedure {

*
* @see {@link https://orpc.unnoq.com/docs/metadata Metadata Docs}
* @see {@link https://orpc.dev/docs/metadata Metadata Docs}
*/

@@ -151,4 +154,4 @@ $meta(initialMeta) {

*
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
* @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
* @see {@link https://orpc.dev/docs/openapi/routing OpenAPI Routing Docs}
* @see {@link https://orpc.dev/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
*/

@@ -162,6 +165,17 @@ $route(initialRoute) {

/**
* Sets or overrides the initial input schema.
*
* @see {@link https://orpc.dev/docs/procedure#initial-configuration Initial Procedure Configuration Docs}
*/
$input(initialInputSchema) {
return new ContractBuilder({
...this["~orpc"],
inputSchema: initialInputSchema
});
}
/**
* Adds type-safe custom errors to the contract.
* The provided errors are spared-merged with any existing errors in the contract.
*
* @see {@link https://orpc.unnoq.com/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
* @see {@link https://orpc.dev/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
*/

@@ -178,3 +192,3 @@ errors(errors) {

*
* @see {@link https://orpc.unnoq.com/docs/metadata Metadata Docs}
* @see {@link https://orpc.dev/docs/metadata Metadata Docs}
*/

@@ -192,4 +206,4 @@ meta(meta) {

*
* @see {@link https://orpc.unnoq.com/docs/openapi/routing OpenAPI Routing Docs}
* @see {@link https://orpc.unnoq.com/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
* @see {@link https://orpc.dev/docs/openapi/routing OpenAPI Routing Docs}
* @see {@link https://orpc.dev/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
*/

@@ -205,3 +219,3 @@ route(route) {

*
* @see {@link https://orpc.unnoq.com/docs/procedure#input-output-validation Input Validation Docs}
* @see {@link https://orpc.dev/docs/procedure#input-output-validation Input Validation Docs}
*/

@@ -217,3 +231,3 @@ input(schema) {

*
* @see {@link https://orpc.unnoq.com/docs/procedure#input-output-validation Output Validation Docs}
* @see {@link https://orpc.dev/docs/procedure#input-output-validation Output Validation Docs}
*/

@@ -232,3 +246,3 @@ output(schema) {

*
* @see {@link https://orpc.unnoq.com/docs/openapi/routing#route-prefixes OpenAPI Route Prefixes Docs}
* @see {@link https://orpc.dev/docs/openapi/routing#route-prefixes OpenAPI Route Prefixes Docs}
*/

@@ -245,3 +259,3 @@ prefix(prefix) {

*
* @see {@link https://orpc.unnoq.com/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
* @see {@link https://orpc.dev/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
*/

@@ -257,3 +271,3 @@ tag(...tags) {

*
* @see {@link https://orpc.unnoq.com/docs/router#extending-router Extending Router Docs}
* @see {@link https://orpc.dev/docs/router#extending-router Extending Router Docs}
*/

@@ -307,3 +321,4 @@ router(router) {

issues: result.issues,
message: "Event iterator validation failed"
message: "Event iterator validation failed",
data: value
})

@@ -371,2 +386,2 @@ });

export { ContractBuilder, ContractProcedure, ValidationError, enhanceContractRouter, enhanceRoute, eventIterator, fallbackContractConfig, getContractRouter, getEventIteratorSchemaDetails, inferRPCMethodFromContractRouter, isContractProcedure, isSchemaIssue, mergeErrorMap, mergeMeta, mergePrefix, mergeRoute, mergeTags, minifyContractRouter, oc, prefixRoute, type, unshiftTagRoute };
export { ContractBuilder, ContractProcedure, ValidationError, enhanceContractRouter, enhanceRoute, eventIterator, fallbackContractConfig, getContractRouter, getEventIteratorSchemaDetails, inferRPCMethodFromContractRouter, isContractProcedure, isSchemaIssue, mergeErrorMap, mergeMeta, mergePrefix, mergeRoute, mergeTags, minifyContractRouter, oc, populateContractRouterPaths, prefixRoute, type, unshiftTagRoute };
{
"name": "@orpc/contract",
"type": "module",
"version": "0.0.0-next.75f1e0e",
"version": "0.0.0-next.7605f6c",
"license": "MIT",
"homepage": "https://orpc.unnoq.com",
"homepage": "https://orpc.dev",
"repository": {
"type": "git",
"url": "git+https://github.com/unnoq/orpc.git",
"url": "git+https://github.com/middleapi/orpc.git",
"directory": "packages/contract"
},
"keywords": [
"unnoq",
"orpc"
],
"sideEffects": false,
"exports": {

@@ -21,2 +21,7 @@ ".": {

"default": "./dist/index.mjs"
},
"./plugins": {
"types": "./dist/plugins/index.d.mts",
"import": "./dist/plugins/index.mjs",
"default": "./dist/plugins/index.mjs"
}

@@ -28,11 +33,11 @@ },

"dependencies": {
"@standard-schema/spec": "^1.0.0",
"@standard-schema/spec": "^1.1.0",
"openapi-types": "^12.1.3",
"@orpc/shared": "0.0.0-next.75f1e0e",
"@orpc/client": "0.0.0-next.75f1e0e"
"@orpc/client": "0.0.0-next.7605f6c",
"@orpc/shared": "0.0.0-next.7605f6c"
},
"devDependencies": {
"arktype": "2.1.20",
"valibot": "^1.1.0",
"zod": "^3.25.49"
"arktype": "2.2.0",
"valibot": "^1.2.0",
"zod": "^4.3.6"
},

@@ -39,0 +44,0 @@ "scripts": {

+126
-14
<div align="center">
<image align="center" src="https://orpc.unnoq.com/logo.webp" width=280 alt="oRPC logo" />
<image align="center" src="https://orpc.dev/logo.webp" width=280 alt="oRPC logo" />
</div>

@@ -8,4 +8,4 @@

<div align="center">
<a href="https://codecov.io/gh/unnoq/orpc">
<img alt="codecov" src="https://codecov.io/gh/unnoq/orpc/branch/main/graph/badge.svg">
<a href="https://codecov.io/gh/middleapi/orpc">
<img alt="codecov" src="https://codecov.io/gh/middleapi/orpc/branch/main/graph/badge.svg">
</a>

@@ -15,4 +15,4 @@ <a href="https://www.npmjs.com/package/@orpc/contract">

</a>
<a href="https://github.com/unnoq/orpc/blob/main/LICENSE">
<img alt="MIT License" src="https://img.shields.io/github/license/unnoq/orpc?logo=open-source-initiative" />
<a href="https://github.com/middleapi/orpc/blob/main/LICENSE">
<img alt="MIT License" src="https://img.shields.io/github/license/middleapi/orpc?logo=open-source-initiative" />
</a>

@@ -22,2 +22,5 @@ <a href="https://discord.gg/TXEbwRBvQn">

</a>
<a href="https://deepwiki.com/middleapi/orpc">
<img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki">
</a>
</div>

@@ -36,3 +39,4 @@

- **πŸ“ Contract-First Development**: Optionally define your API contract before implementation.
- **βš™οΈ Framework Integrations**: Seamlessly integrate with TanStack Query (React, Vue, Solid, Svelte), Pinia Colada, and more.
- **πŸ” First-Class OpenTelemetry**: Seamlessly integrate with OpenTelemetry for observability.
- **βš™οΈ Framework Integrations**: Seamlessly integrate with TanStack Query (React, Vue, Solid, Svelte, Angular), SWR, Pinia Colada, and more.
- **πŸš€ Server Actions**: Fully compatible with React Server Actions on Next.js, TanStack Start, and other platforms.

@@ -45,7 +49,6 @@ - **πŸ”  Standard Schema Support**: Works out of the box with Zod, Valibot, ArkType, and other schema validators.

- **πŸ”Œ Extendability**: Easily extend functionality with plugins, middleware, and interceptors.
- **πŸ›‘οΈ Reliability**: Well-tested, TypeScript-based, production-ready, and MIT licensed.
## Documentation
You can find the full documentation [here](https://orpc.unnoq.com).
You can find the full documentation [here](https://orpc.dev).

@@ -58,5 +61,7 @@ ## Packages

- [@orpc/openapi](https://www.npmjs.com/package/@orpc/openapi): Generate OpenAPI specs and handle OpenAPI requests.
- [@orpc/otel](https://www.npmjs.com/package/@orpc/otel): [OpenTelemetry](https://opentelemetry.io/) integration for observability.
- [@orpc/nest](https://www.npmjs.com/package/@orpc/nest): Deeply integrate oRPC with [NestJS](https://nestjs.com/).
- [@orpc/react](https://www.npmjs.com/package/@orpc/react): Utilities for integrating oRPC with React and React Server Actions.
- [@orpc/tanstack-query](https://www.npmjs.com/package/@orpc/tanstack-query): [TanStack Query](https://tanstack.com/query/latest) integration.
- [@orpc/experimental-react-swr](https://www.npmjs.com/package/@orpc/experimental-react-swr): [SWR](https://swr.vercel.app/) integration.
- [@orpc/vue-colada](https://www.npmjs.com/package/@orpc/vue-colada): Integration with [Pinia Colada](https://pinia-colada.esm.dev/).

@@ -70,3 +75,3 @@ - [@orpc/hey-api](https://www.npmjs.com/package/@orpc/hey-api): [Hey API](https://heyapi.dev/) integration.

Build your API contract. Read the [documentation](https://orpc.unnoq.com/docs/contract-first/define-contract) for more information.
Build your API contract. Read the [documentation](https://orpc.dev/docs/contract-first/define-contract) for more information.

@@ -108,6 +113,113 @@ ```ts

<p align="center">
<a href="https://cdn.jsdelivr.net/gh/unnoq/unnoq/sponsors.svg">
<img src='https://cdn.jsdelivr.net/gh/unnoq/unnoq/sponsors.svg'/>
</a>
If you find oRPC valuable and would like to support its development, you can do so here: [GitHub Sponsors](https://github.com/sponsors/dinwwwh).
### πŸ† Platinum Sponsor
<table>
<tr>
<td align="center"><a href="https://screenshotone.com/?ref=orpc" target="_blank" rel="noopener" title="ScreenshotOne.com"><img src="https://avatars.githubusercontent.com/u/97035603?v=4" width="279" alt="ScreenshotOne.com"/><br />ScreenshotOne.com</a></td>
</tr>
</table>
### πŸ₯ˆ Silver Sponsor
<table>
<tr>
<td align="center"><a href="https://misskey.io/?ref=orpc" target="_blank" rel="noopener" title="ζ‘δΈŠγ•γ‚“"><img src="https://avatars.githubusercontent.com/u/37681609?u=0dd4c7e4ba937cbb52b068c55914b1d8164dc0c7&amp;v=4" width="209" alt="ζ‘δΈŠγ•γ‚“"/><br />ζ‘δΈŠγ•γ‚“</a></td>
</tr>
</table>
### Generous Sponsors
<table>
<tr>
<td align="center"><a href="https://github.com/ln-markets?ref=orpc" target="_blank" rel="noopener" title="LN Markets"><img src="https://avatars.githubusercontent.com/u/70597625?v=4" width="167" alt="LN Markets"/><br />LN Markets</a></td>
</tr>
</table>
### Sponsors
<table>
<tr>
<td align="center"><a href="https://github.com/hrmcdonald?ref=orpc" target="_blank" rel="noopener" title="Reece McDonald"><img src="https://avatars.githubusercontent.com/u/39349270?v=4" width="139" alt="Reece McDonald"/><br />Reece McDonald</a></td>
<td align="center"><a href="https://github.com/nicognaW?ref=orpc" target="_blank" rel="noopener" title="nk"><img src="https://avatars.githubusercontent.com/u/66731869?u=4699bda3a9092d3ec34fbd959450767bcc8b8b6d&amp;v=4" width="139" alt="nk"/><br />nk</a></td>
<td align="center"><a href="https://github.com/supastarter?ref=orpc" target="_blank" rel="noopener" title="supastarter"><img src="https://avatars.githubusercontent.com/u/110960143?v=4" width="139" alt="supastarter"/><br />supastarter</a></td>
<td align="center"><a href="https://github.com/divmgl?ref=orpc" target="_blank" rel="noopener" title="Dexter Miguel"><img src="https://avatars.githubusercontent.com/u/5452298?u=645993204be8696c085ecf0d228c3062efe2ed65&amp;v=4" width="139" alt="Dexter Miguel"/><br />Dexter Miguel</a></td>
<td align="center"><a href="https://github.com/herrfugbaum?ref=orpc" target="_blank" rel="noopener" title="herrfugbaum"><img src="https://avatars.githubusercontent.com/u/12859776?u=644dc1666d0220bc0468eb0de3c56b919f635b16&amp;v=4" width="139" alt="herrfugbaum"/><br />herrfugbaum</a></td>
<td align="center"><a href="https://github.com/ryota-murakami?ref=orpc" target="_blank" rel="noopener" title="Ryota Murakami"><img src="https://avatars.githubusercontent.com/u/5501268?u=599389e03340734325726ca3f8f423c021d47d7f&amp;v=4" width="139" alt="Ryota Murakami"/><br />Ryota Murakami</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/dcramer?ref=orpc" target="_blank" rel="noopener" title="David Cramer"><img src="https://avatars.githubusercontent.com/u/23610?v=4" width="139" alt="David Cramer"/><br />David Cramer</a></td>
<td align="center"><a href="https://github.com/valerii15298?ref=orpc" target="_blank" rel="noopener" title="Valerii Petryniak"><img src="https://avatars.githubusercontent.com/u/44531564?u=88ac74d9bacd20401518441907acad21063cd397&amp;v=4" width="139" alt="Valerii Petryniak"/><br />Valerii Petryniak</a></td>
<td align="center"><a href="https://github.com/letstri?ref=orpc" target="_blank" rel="noopener" title="Valerii Strilets"><img src="https://avatars.githubusercontent.com/u/13253748?u=c7b10399ccc8f8081e24db94ec32cd9858e86ac3&amp;v=4" width="139" alt="Valerii Strilets"/><br />Valerii Strilets</a></td>
<td align="center"><a href="https://github.com/K-Mistele?ref=orpc" target="_blank" rel="noopener" title="Kyle Mistele"><img src="https://avatars.githubusercontent.com/u/18430555?u=3afebeb81de666e35aaac3ed46f14159d7603ffb&amp;v=4" width="139" alt="Kyle Mistele"/><br />Kyle Mistele</a></td>
<td align="center"><a href="https://github.com/andrewpeters9?ref=orpc" target="_blank" rel="noopener" title="Andrew Peters"><img src="https://avatars.githubusercontent.com/u/36251325?v=4" width="139" alt="Andrew Peters"/><br />Andrew Peters</a></td>
<td align="center"><a href="https://github.com/R44VC0RP?ref=orpc" target="_blank" rel="noopener" title="Ryan Vogel"><img src="https://avatars.githubusercontent.com/u/89211796?u=1857347b9787d8d8a7ea5bfc333f96be92d5a683&amp;v=4" width="139" alt="Ryan Vogel"/><br />Ryan Vogel</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/christ12938?ref=orpc" target="_blank" rel="noopener" title="christ12938"><img src="https://avatars.githubusercontent.com/u/25758598?v=4" width="139" alt="christ12938"/><br />christ12938</a></td>
<td align="center"><a href="https://github.com/peter-adam-dy?ref=orpc" target="_blank" rel="noopener" title="Peter Adam"><img src="https://avatars.githubusercontent.com/u/132129459?u=4f3dbbb3b443990b56acb7d6a5d11ed2c555f6db&amp;v=4" width="139" alt="Peter Adam"/><br />Peter Adam</a></td>
<td align="center"><a href="https://github.com/yukimotochern?ref=orpc" target="_blank" rel="noopener" title="Chen, Zhi-Yuan"><img src="https://avatars.githubusercontent.com/u/20896173?u=945c33fc21725e4d566a0d02afc54b136ca1d67a&amp;v=4" width="139" alt="Chen, Zhi-Yuan"/><br />Chen, Zhi-Yuan</a></td>
<td align="center"><a href="https://github.com/Ryanjso?ref=orpc" target="_blank" rel="noopener" title="Ryan Soderberg"><img src="https://avatars.githubusercontent.com/u/39172778?u=5ed913c31d57e7221b75784abcad48c7ebddde27&amp;v=4" width="139" alt="Ryan Soderberg"/><br />Ryan Soderberg</a></td>
</tr>
</table>
### Backers
<table>
<tr>
<td align="center"><a href="https://github.com/rhinodavid?ref=orpc" target="_blank" rel="noopener" title="David Walsh"><img src="https://avatars.githubusercontent.com/u/5778036?u=b5521f07d2f88c3db2a0dae62b5f2f8357214af0&amp;v=4" width="119" alt="David Walsh"/><br />David Walsh</a></td>
<td align="center"><a href="https://github.com/Robbe95?ref=orpc" target="_blank" rel="noopener" title="Robbe Vaes"><img src="https://avatars.githubusercontent.com/u/44748019?u=e0232402c045ad4eac7cbd217f1f47e083103b89&amp;v=4" width="119" alt="Robbe Vaes"/><br />Robbe Vaes</a></td>
<td align="center"><a href="https://github.com/aidansunbury?ref=orpc" target="_blank" rel="noopener" title="Aidan Sunbury"><img src="https://avatars.githubusercontent.com/u/64103161?v=4" width="119" alt="Aidan Sunbury"/><br />Aidan Sunbury</a></td>
<td align="center"><a href="https://github.com/soonoo?ref=orpc" target="_blank" rel="noopener" title="soonoo"><img src="https://avatars.githubusercontent.com/u/5436405?u=5d0b4aa955c87e30e6bda7f0cccae5402da99528&amp;v=4" width="119" alt="soonoo"/><br />soonoo</a></td>
<td align="center"><a href="https://github.com/kporten?ref=orpc" target="_blank" rel="noopener" title="Kevin Porten"><img src="https://avatars.githubusercontent.com/u/1839345?u=dc2263d5cfe0d927ce1a0be04a1d55dd6b55405c&amp;v=4" width="119" alt="Kevin Porten"/><br />Kevin Porten</a></td>
<td align="center"><a href="https://github.com/pumpkinlink?ref=orpc" target="_blank" rel="noopener" title="Denis"><img src="https://avatars.githubusercontent.com/u/11864620?u=5f47bbe6c65d0f6f5cf011021490238e4b0593d0&amp;v=4" width="119" alt="Denis"/><br />Denis</a></td>
<td align="center"><a href="https://github.com/christopher-kapic?ref=orpc" target="_blank" rel="noopener" title="Christopher Kapic"><img src="https://avatars.githubusercontent.com/u/59740769?u=e7ad4b72b5bf6c9eb1644c26dbf3332a8f987377&amp;v=4" width="119" alt="Christopher Kapic"/><br />Christopher Kapic</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/thomasballinger?ref=orpc" target="_blank" rel="noopener" title="Tom Ballinger"><img src="https://avatars.githubusercontent.com/u/458879?u=4b045ac75d721b6ac2b42a74d7d37f61f0414031&amp;v=4" width="119" alt="Tom Ballinger"/><br />Tom Ballinger</a></td>
<td align="center"><a href="https://github.com/SSam0419?ref=orpc" target="_blank" rel="noopener" title="Sam"><img src="https://avatars.githubusercontent.com/u/102863520?u=3c89611f549d5070be232eb4532f690c8f2e7a65&amp;v=4" width="119" alt="Sam"/><br />Sam</a></td>
<td align="center"><a href="https://github.com/Titoine?ref=orpc" target="_blank" rel="noopener" title="Titoine"><img src="https://avatars.githubusercontent.com/u/3514286?u=1bb1e86b0c99c8a1121372e56d51a177eea12191&amp;v=4" width="119" alt="Titoine"/><br />Titoine</a></td>
<td align="center"><a href="https://github.com/Mnigos?ref=orpc" target="_blank" rel="noopener" title="Igor Makowski"><img src="https://avatars.githubusercontent.com/u/56691628?u=ee8c879478f7c151b9156aef6c74243fa3e247a8&amp;v=4" width="119" alt="Igor Makowski"/><br />Igor Makowski</a></td>
<td align="center"><a href="https://github.com/steelbrain?ref=orpc" target="_blank" rel="noopener" title="Anees Iqbal"><img src="https://avatars.githubusercontent.com/u/4278113?u=22b80b5399eed68ac76cd58b02961b0481f1db11&amp;v=4" width="119" alt="Anees Iqbal"/><br />Anees Iqbal</a></td>
<td align="center"><a href="https://github.com/hanayashiki?ref=orpc" target="_blank" rel="noopener" title="wang chenyu"><img src="https://avatars.githubusercontent.com/u/26056783?u=06c3b9205a16fd41a871e82da1cc2a09306d53f5&amp;v=4" width="119" alt="wang chenyu"/><br />wang chenyu</a></td>
<td align="center"><a href="https://github.com/piscis?ref=orpc" target="_blank" rel="noopener" title="Alex"><img src="https://avatars.githubusercontent.com/u/326163?u=b245f368bd940cf51d08c0b6bf55f8257f359437&amp;v=4" width="119" alt="Alex"/><br />Alex</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/nattstack?ref=orpc" target="_blank" rel="noopener" title="nattstack"><img src="https://avatars.githubusercontent.com/u/31426677?u=fa9dbb8b3e66eb0ea3c88db5dc07f31c8c5418fe&amp;v=4" width="119" alt="nattstack"/><br />nattstack</a></td>
</tr>
</table>
### Past Sponsors
<p>
<a href="https://github.com/MrMaxie?ref=orpc" target="_blank" rel="noopener" title="Maxie"><img src="https://avatars.githubusercontent.com/u/3857836?u=5e6b57973d4385d655663ffdd836e487856f2984&amp;v=4" width="32" height="32" alt="Maxie" /></a>
<a href="https://github.com/Stijn-Timmer?ref=orpc" target="_blank" rel="noopener" title="Stijn Timmer"><img src="https://avatars.githubusercontent.com/u/100147665?u=106b2c18e9c98a61861b4ee7fc100f5b9906a6c9&amp;v=4" width="32" height="32" alt="Stijn Timmer" /></a>
<a href="https://github.com/u1-liquid?ref=orpc" target="_blank" rel="noopener" title="あわわわとーにゅ"><img src="https://avatars.githubusercontent.com/u/17376330?u=de3353804be889f009f7e0a1582daf04d0ab292d&amp;v=4" width="32" height="32" alt="あわわわとーにゅ" /></a>
<a href="https://github.com/zuplo?ref=orpc" target="_blank" rel="noopener" title="Zuplo"><img src="https://avatars.githubusercontent.com/u/85497839?v=4" width="32" height="32" alt="Zuplo" /></a>
<a href="https://github.com/motopods?ref=orpc" target="_blank" rel="noopener" title="motopods"><img src="https://avatars.githubusercontent.com/u/58200641?u=18833983d65b481ae90a4adec2373064ec58bcf3&amp;v=4" width="32" height="32" alt="motopods" /></a>
<a href="https://github.com/franciscohermida?ref=orpc" target="_blank" rel="noopener" title="Francisco Hermida"><img src="https://avatars.githubusercontent.com/u/483242?u=bbcbc80eb9d8781ff401f7dafc3b59cd7bea0561&amp;v=4" width="32" height="32" alt="Francisco Hermida" /></a>
<a href="https://github.com/theoludwig?ref=orpc" target="_blank" rel="noopener" title="ThΓ©o LUDWIG"><img src="https://avatars.githubusercontent.com/u/25207499?u=a6a9653725a2f574c07893748806668e0598cdbe&amp;v=4" width="32" height="32" alt="ThΓ©o LUDWIG" /></a>
<a href="https://github.com/abhay-ramesh?ref=orpc" target="_blank" rel="noopener" title="Abhay Ramesh"><img src="https://avatars.githubusercontent.com/u/66196314?u=c5c2b0327b26606c2efcfaf17046ab18c3d25c57&amp;v=4" width="32" height="32" alt="Abhay Ramesh" /></a>
<a href="https://github.com/shr-ink?ref=orpc" target="_blank" rel="noopener" title="shr.ink oΓΌ"><img src="https://avatars.githubusercontent.com/u/139700438?v=4" width="32" height="32" alt="shr.ink oΓΌ" /></a>
<a href="https://github.com/johngerome?ref=orpc" target="_blank" rel="noopener" title="0x4e32"><img src="https://avatars.githubusercontent.com/u/2002000?u=24e8dd943cfc862aa284d858a023532c75071ade&amp;v=4" width="32" height="32" alt="0x4e32" /></a>
<a href="https://github.com/yzuyr?ref=orpc" target="_blank" rel="noopener" title="Ryuz"><img src="https://avatars.githubusercontent.com/u/196539378?u=d38374588d219b6748b16406982f6559411466d4&amp;v=4" width="32" height="32" alt="Ryuz" /></a>
<a href="https://github.com/happyboy2022?ref=orpc" target="_blank" rel="noopener" title="happyboy"><img src="https://avatars.githubusercontent.com/u/103669586?u=65b49c4b893ed3703909fbb3a7a22313f3f9c121&amp;v=4" width="32" height="32" alt="happyboy" /></a>
<a href="https://github.com/YiCChi?ref=orpc" target="_blank" rel="noopener" title="yicchi"><img src="https://avatars.githubusercontent.com/u/86967274?u=6c2756f09fe15dd94d572f560e979cd157982852&amp;v=4" width="32" height="32" alt="yicchi" /></a>
<a href="https://github.com/cloudycotton?ref=orpc" target="_blank" rel="noopener" title="Saksham"><img src="https://avatars.githubusercontent.com/u/168998965?u=9b9634a5aed66a51c1b880663272725b00b92b14&amp;v=4" width="32" height="32" alt="Saksham" /></a>
<a href="https://github.com/hrynevychroman?ref=orpc" target="_blank" rel="noopener" title="Roman Hrynevych"><img src="https://avatars.githubusercontent.com/u/82209198?u=1a1d111ab3d589855b9cc8a7fefb1b5c6a4fbbaf&amp;v=4" width="32" height="32" alt="Roman Hrynevych" /></a>
<a href="https://github.com/rokitgg?ref=orpc" target="_blank" rel="noopener" title="rokitg"><img src="https://avatars.githubusercontent.com/u/125133357?u=06c74aefaa2236b06a2e5fba5a5c612339f45912&amp;v=4" width="32" height="32" alt="rokitg" /></a>
<a href="https://github.com/omarkhatibgg?ref=orpc" target="_blank" rel="noopener" title="Omar Khatib"><img src="https://avatars.githubusercontent.com/u/9054278?u=afbba7331b85c51b8eee4130f5fd31b1017dc919&amp;v=4" width="32" height="32" alt="Omar Khatib" /></a>
<a href="https://github.com/YuSabo90002?ref=orpc" target="_blank" rel="noopener" title="Yu-Sabo"><img src="https://avatars.githubusercontent.com/u/13120582?v=4" width="32" height="32" alt="Yu-Sabo" /></a>
<a href="https://github.com/bapspatil?ref=orpc" target="_blank" rel="noopener" title="Bapusaheb Patil"><img src="https://avatars.githubusercontent.com/u/16699418?u=6d9d8e0a64a6f91ca1c4d559c72d931172bdcbbd&amp;v=4" width="32" height="32" alt="Bapusaheb Patil" /></a>
<a href="https://github.com/ripgrim?ref=orpc" target="_blank" rel="noopener" title="grim"><img src="https://avatars.githubusercontent.com/u/75869731?u=b17c42ec2309552fdb822a86b25a2f99146a4d72&amp;v=4" width="32" height="32" alt="grim" /></a>
<a href="https://github.com/nelsonlaidev?ref=orpc" target="_blank" rel="noopener" title="Nelson Lai"><img src="https://avatars.githubusercontent.com/u/75498339?u=2fc0e0b95dd184c5ffb744df977cb15a18b60672&amp;v=4" width="32" height="32" alt="Nelson Lai" /></a>
<a href="https://github.com/nguyenlc1993?ref=orpc" target="_blank" rel="noopener" title="LΓͺ Cao NguyΓͺn"><img src="https://avatars.githubusercontent.com/u/13871971?u=83c8b69d9e35b589c4e1f066cc113b1d9461386f&amp;v=4" width="32" height="32" alt="LΓͺ Cao NguyΓͺn" /></a>
<a href="https://github.com/wobsoriano?ref=orpc" target="_blank" rel="noopener" title="Robert Soriano"><img src="https://avatars.githubusercontent.com/u/13049130?u=6d72104182e7c9ed25934815313fb69107332111&amp;v=4" width="32" height="32" alt="Robert Soriano" /></a>
<a href="https://github.com/SKostyukovich?ref=orpc" target="_blank" rel="noopener" title="SKostyukovich"><img src="https://avatars.githubusercontent.com/u/10700067?v=4" width="32" height="32" alt="SKostyukovich" /></a>
<a href="https://github.com/FabworksHQ?ref=orpc" target="_blank" rel="noopener" title="Fabworks"><img src="https://avatars.githubusercontent.com/u/160179500?v=4" width="32" height="32" alt="Fabworks" /></a>
<a href="https://github.com/NovakAnton?ref=orpc" target="_blank" rel="noopener" title="Novak Antonijevic"><img src="https://avatars.githubusercontent.com/u/157126729?u=ae49fa22292d55c0434ff0ca008206155b18663b&amp;v=4" width="32" height="32" alt="Novak Antonijevic" /></a>
<a href="https://github.com/laduniestu?ref=orpc" target="_blank" rel="noopener" title="Laduni Estu Syalwa"><img src="https://avatars.githubusercontent.com/u/44757637?u=a2fc1ea8f7d827a96721176f79d30592d1c48059&amp;v=4" width="32" height="32" alt="Laduni Estu Syalwa" /></a>
<a href="https://github.com/illarionvk?ref=orpc" target="_blank" rel="noopener" title="Illarion Koperski"><img src="https://avatars.githubusercontent.com/u/5012724?u=7cfa13652f7ac5fb3c56d880e3eb3fbe40c3ea34&amp;v=4" width="32" height="32" alt="Illarion Koperski" /></a>
<a href="https://github.com/Scrumplex?ref=orpc" target="_blank" rel="noopener" title="Sefa Eyeoglu"><img src="https://avatars.githubusercontent.com/u/11587657?u=ab503582165c0bbff0cca47ce31c9450bb1553c9&amp;v=4" width="32" height="32" alt="Sefa Eyeoglu" /></a>
</p>

@@ -117,2 +229,2 @@

Distributed under the MIT License. See [LICENSE](https://github.com/unnoq/orpc/blob/main/LICENSE) for more information.
Distributed under the MIT License. See [LICENSE](https://github.com/middleapi/orpc/blob/main/LICENSE) for more information.