UNPKG

@xompass/sdk-cloud-api

Version:

Xompass Client for cloud-api

145 lines 4.48 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Device = void 0; var Device = /** @class */ (function () { function Device(data) { Object.assign(this, data); } /** * The name of the model represented by this $resource, * i.e. `Device`. */ Device.getModelName = function () { return 'Device'; }; /** * @method factory * @author Jonathan Casarrubias * @license MIT * This method creates an instance of Device for dynamic purposes. */ Device.factory = function (data) { return new Device(data); }; /** * @method getModelDefinition * @author Julien Ledun * @license MIT * This method returns an object that represents some of the model * definitions. */ Device.getModelDefinition = function () { return { name: 'Device', plural: 'Devices', path: 'Devices', idName: 'id', properties: { id: { name: 'id', type: 'string' }, name: { name: 'name', type: 'string' }, enabled: { name: 'enabled', type: 'boolean' }, description: { name: 'description', type: 'string' }, requested: { name: 'requested', type: 'Date' }, created: { name: 'created', type: 'Date' }, modified: { name: 'modified', type: 'Date' }, deleted: { name: 'deleted', type: 'Date', default: undefined }, customerId: { name: 'customerId', type: 'any' }, _config: { name: '_config', type: 'any' }, }, relations: { customer: { name: 'customer', type: 'Customer', model: 'Customer', relationType: 'belongsTo', keyFrom: 'customerId', keyTo: 'id' }, config: { name: 'config', type: 'any[]', model: '', relationType: 'embedsOne', keyFrom: '_config', keyTo: 'id' }, events: { name: 'events', type: 'DeviceEvent[]', model: 'DeviceEvent', relationType: 'hasMany', keyFrom: 'id', keyTo: 'deviceId' }, token: { name: 'token', type: 'DeviceToken', model: 'DeviceToken', relationType: 'hasOne', keyFrom: 'id', keyTo: 'deviceId' }, edgeAgents: { name: 'edgeAgents', type: 'EdgeAgent[]', model: 'EdgeAgent', relationType: 'hasMany', keyFrom: 'id', keyTo: 'deviceId' }, trackingLogs: { name: 'trackingLogs', type: 'Log[]', model: 'Log', relationType: 'hasMany', keyFrom: 'id', keyTo: 'trackingModelId' }, telegramChats: { name: 'telegramChats', type: 'TelegramChat[]', model: 'TelegramChat', relationType: 'hasMany', modelThrough: 'TelegramChatDevice', keyThrough: 'telegramChatId', keyFrom: 'id', keyTo: 'deviceId' }, } }; }; return Device; }()); exports.Device = Device; //# sourceMappingURL=Device.js.map