Skip to main content

API

@the-codegen-project/cliDocs


API

These are all the exposed types and functions when installing the CLI as a dependency.

Enumerations

EnumerationDescription
ChannelFunctionTypes-

Interfaces

InterfaceDescription
AsyncAPIDocumentInterface-
GenericCodegenContext-
LoadArgument-
ParameterRenderType-
PayloadRenderType-
RunGeneratorContext-
SingleFunctionRenderType-

Type Aliases

Type aliasDescription
Generators-
PresetTypes-
SupportedLanguages-
TheCodegenConfiguration-
TheCodegenConfigurationInternal-
TypeScriptChannelsGenerator-
TypeScriptClientGenerator-
TypescriptParametersGenerator-
TypeScriptPayloadGenerator-

Variables

VariableDescription
defaultCustomGenerator-
defaultTypeScriptChannelsGenerator-
defaultTypeScriptClientGenerator-
defaultTypeScriptParametersOptions-
defaultTypeScriptPayloadGenerator-
modelina-
zodAsyncAPICodegenConfiguration-
zodAsyncAPIGenerators-
zodAsyncAPITypeScriptGenerators-
zodTheCodegenConfiguration-

Functions

FunctionDescription
generateTypeScriptChannels-
generateTypescriptParameters-
generateTypescriptPayload-
getDefaultConfigurationReturns the default generator for the preset of the language
loadAndRealizeConfigFileLoad the configuration file and realize it with default options if necessary.
loadAsyncapi-
loadAsyncapiFromMemory-
loadConfigFileLoad configuration from file.
loadJsonSchemaLoad JSON Schema document from file path or remote URL in context.
loadJsonSchemaFromMemoryLoad JSON Schema document from memory.
loadOpenapi-
loadOpenapiFromMemoryLoad and normalize an OpenAPI document already held in memory (as a raw JSON/YAML string). Runs the exact same normalization as the local-file path of loadOpenapiDocument — dereference followed by reflectComponentSchemaNames — so in-memory callers (the platform's generateInMemory, preview, and the playground) produce byte-identical output to codegen generate on a file.
realizeConfigurationEnsure that each generator has the default options along side custom properties
realizeGeneratorContextLoad configuration and input document to create generator context
realizeInMemoryGeneratorContextIn-memory counterpart of realizeGeneratorContext. Given a config object and the raw specification string, it produces a fully-loaded RunGeneratorContext using the same per-input loaders as the file flow — so callers that hold a spec in memory (the platform's generateInMemory, preview, the playground) generate identical output to codegen generate. This is the single seam for in-memory generation: parsing/normalization lives here, never in downstream consumers.
renderGenerator-
run-
runGeneratorsFunction that runs the given generator context ensuring the generators are rendered in the correct order.
writeGeneratedFilesWrite generated files to disk. This is the I/O boundary - called by CLI after pure generation.