import { Configuration , DefaultApi , DefaultApiInterface } from "@/openapi" ; export interface IEngineConnectorFactory { instance : ( host : string ) => DefaultApiInterface ; } const OpenAPIEngineConnectorFactoryImpl = ( ) : IEngineConnectorFactory => { const instanceMapper = { } ; return { instance : ( host ) => { const cached = instanceMapper [ host ] ; if ( cached !== undefined ) { return cached ; } const api = new DefaultApi ( new Configuration ( { basePath : host } ) ) ; instanceMapper [ host ] = api ; return api ; } , } ; } ; export const OpenAPIEngineConnectorFactory = OpenAPIEngineConnectorFactoryImpl ( ) ;