@xompass/sdk-cloud-api
Version:
Xompass Client for cloud-api
150 lines (144 loc) • 3.36 kB
text/typescript
import {ModelDefinition} from './BaseModels';
import {Log} from './Log';
import {Project} from './Project';
declare var Object: any;
export interface ProcessLayoutInterface {
name?: string;
zoom?: number;
components?: Array<any>;
connectors?: Array<any>;
controls?: Array<any>;
variables?: Array<any>;
created?: Date;
modified?: Date;
deleted?: Date;
id?: any;
projectId?: any;
trackingLogs?: Log[];
container?: any;
project?: Project;
}
export class ProcessLayout implements ProcessLayoutInterface {
name: string;
zoom: number = 1;
components: Array<any>;
connectors: Array<any>;
controls: Array<any>;
variables: Array<any>;
created: Date;
modified: Date;
deleted: Date;
id: any;
projectId: any;
trackingLogs?: Log[];
container?: any;
project?: Project;
constructor(data?: ProcessLayoutInterface) {
Object.assign(this, data);
}
/**
* The name of the model represented by this $resource,
* i.e. `ProcessLayout`.
*/
public static getModelName(): string {
return 'ProcessLayout';
}
/**
* @method factory
* @author Jonathan Casarrubias
* @license MIT
* This method creates an instance of ProcessLayout for dynamic purposes.
*/
public static factory(data: ProcessLayoutInterface): ProcessLayout{
return new ProcessLayout(data);
}
/**
* @method getModelDefinition
* @author Julien Ledun
* @license MIT
* This method returns an object that represents some of the model
* definitions.
*/
public static getModelDefinition(): ModelDefinition {
return {
name: 'ProcessLayout',
plural: 'ProcessLayouts',
path: 'ProcessLayouts',
idName: 'id',
properties: {
name: {
name: 'name',
type: 'string'
},
zoom: {
name: 'zoom',
type: 'number',
default: 1
},
components: {
name: 'components',
type: 'Array<any>'
},
connectors: {
name: 'connectors',
type: 'Array<any>'
},
controls: {
name: 'controls',
type: 'Array<any>'
},
variables: {
name: 'variables',
type: 'Array<any>'
},
created: {
name: 'created',
type: 'Date'
},
modified: {
name: 'modified',
type: 'Date'
},
deleted: {
name: 'deleted',
type: 'Date',
default: undefined
},
id: {
name: 'id',
type: 'any'
},
projectId: {
name: 'projectId',
type: 'any'
},
},
relations: {
trackingLogs: {
name: 'trackingLogs',
type: 'Log[]',
model: 'Log',
relationType: 'hasMany',
keyFrom: 'id',
keyTo: 'trackingModelId'
},
container: {
name: 'container',
type: 'any',
model: '',
relationType: 'hasOne',
keyFrom: 'id',
keyTo: 'processLayoutId'
},
project: {
name: 'project',
type: 'Project',
model: 'Project',
relationType: 'belongsTo',
keyFrom: 'projectId',
keyTo: 'id'
},
}
};
}
}