import { SFieldDescribe } from "./sfieldDescribe" ; import { AppUtils } from "../components/appUtils" ; import { IAppModel } from "../components/helper_interfaces" ; /**
 * Description of the sobject
 */ export class SObjectDescribe implements IAppModel { constructor ( init ? ) { if ( init ) { AppUtils . objectAssignSafe ( this , init ) ; } } name : string = "" ; label : string = "" ; updateable : boolean = false ; createable : boolean = false ; custom : boolean = false ; fieldsMap : Map < string , SFieldDescribe > = new Map < string , SFieldDescribe > ( ) ; get fields ( ) : SFieldDescribe [ ] { return [ ... this . fieldsMap . values ( ) ] ; } errorMessage : string ; initialize : ( init : Partial < any > ) => void ; isDescribed ( ) { return ! ! this . name ; } isValid ( ) { return this . isDescribed ( ) && this . fieldsMap . size > 0 ; } }