import * as fs from "fs" ; import { CodeGenerator } from "../lib" ; import * as Templates from "../lib/templates" ; import * as Types from "../lib/types" ; const main = ( ) => { const codeGenerator = new CodeGenerator ( "./spec/openapi.yml" ) ; codeGenerator . validateOpenApiSchema ( { logger : { displayLogLines : 1 } } ) ; const apiClientGeneratorTemplate = { generator : Templates . ApiClient . generator , option : { } , } ; const code = codeGenerator . generateTypeDefinition ( [ codeGenerator . getAdditionalTypeDefinitionCustomCodeGenerator ( ) , apiClientGeneratorTemplate , ] ) ; fs . writeFileSync ( "client.ts" , code , { encoding : "utf-8" } ) ; } ; main ( ) ;