import { documentationBlock } from '@sap-cloud-sdk/util' ; import { VdmEntity , VdmProperty } from '../../vdm-types' ; import { addLeadingNewline , getStaticPropertyDescription } from '../../typedoc' ; import { createPropertyFieldInitializerForEntity } from '../../entity' ; internal export function getSchema ( entity ) { return `{ 
    ${ [ ... properties ( entity ) , '...this.navigationPropertyFields' , allFieldsSelector ( entity ) ] . join ( ',\n' ) } 
  }` ; } function properties ( entity ) { return entity . properties . map ( prop => property ( prop ) ) ; } function property ( prop ) { return [ documentationBlock `${ getStaticPropertyDescription ( prop ) }` , `${ prop . staticPropertyName }: ${ createPropertyFieldInitializerForEntity ( prop , 'fieldBuilder' ) }` ] . join ( '\n' ) ; } function allFieldsSelector ( entity ) { return [ documentationBlock `${ addLeadingNewline ( 'All fields selector.' ) }` , `ALL_FIELDS: new AllFields('*', ${ entity . className })` ] . join ( '\n' ) ; }