TypeScript packageSupported prototypeAvailable now
Author typed API and software contracts, then emit portable OpenAPI JSON or YAML.
npm install codepot-openapi zodOn this page
codepot-openapi
codepot-openapi is the supported TypeScript-first contract engine in the current Codepot prototype workflow.
It lets a project describe API contracts, reusable schemas, resources, routes, persistence metadata, access rules, runtime hooks, frontend intent, and implementation guidance in typed TypeScript. The compiler emits portable OpenAPI 3.1 JSON or YAML and resolves Codepot-specific meaning into x-codegen metadata.
Package status
- npm package:
codepot-openapi - current package version:
0.0.4 - runtime: Node.js 20 or newer
- module formats: ESM, CommonJS, and TypeScript declarations
- peer dependency: Zod 4
- binary:
codepot-openapi
The package is active and supported. It is the mature contract-authoring side of the prototype workflow, while codepotx is the official JavaScript runtime rewrite.
What the package owns
- versioned OpenAPI contracts;
- shared property registries and Zod-backed schemas;
- schema projections and reference wrappers;
- reusable parameters, request bodies, and responses;
- resources and route operations;
- entity, relation, and constraint metadata;
- access policies and runtime hooks;
- frontend screens and components;
x-codegenmetadata resolution;- contract validation, OpenAPI compilation, file writing, and CLI commands.
Learning path
- Install and create a contract
- Understand the compiler architecture
- Configure package output
- Define properties, schemas, and refs
- Define resources and routes
- Add entities and relations
- Add access, hooks, and frontends
- Understand
x-codegen - Generate and validate output
- Use the public API safely
Typical workflow
Install
Continue with Getting started.