@orpc/contract:
The oc builder
@orpc/contract exports a pre-configured oc builder (ContractBuilder) that mirrors the os builder API but only defines the contract shape — no handlers, no middleware.
Procedure contracts
.input(schema)
Defines the input schema:
.output(schema)
Defines the output schema:
.errors(map)
Declares typed errors the procedure can return:
.route(options)
Attaches HTTP route information for OpenAPI generation:
.meta(object)
Attaches arbitrary metadata (useful for authorization annotations, etc.):
Contract routers
Group procedure contracts into a nested object usingoc.router():
