import { codeBlock , kebabCase } from '@sap-cloud-sdk/util' ; import { OpenApiDocument } from '../openapi-types' ; param openApiDocument returns internal export function apiIndexFile ( openApiDocument ) { const files = [ ... openApiDocument . apis . map ( api => api . name ) , ... ( openApiDocument . schemas . length ? [ 'schema' ] : [ ] ) ] ; return codeBlock `
    ${ exportAllFiles ( files . map ( fileName => kebabCase ( fileName ) ) ) }
  ` ; } param openApiDocument returns internal export function schemaIndexFile ( openApiDocument ) { return exportAllFiles ( openApiDocument . schemas . map ( schema => schema . fileName ) ) ; } function exportAllFiles ( fileNames ) { return codeBlock `${ fileNames . map ( fileName => exportAll ( fileName ) ) . join ( '\n' ) }` ; } function exportAll ( file ) { return `export * from './${ file }';` ; }