UNPKG

@iotile/iotile-cloud

Version:

A typescript library for interfacing with the IOTile Cloud API

39 lines 1.16 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var DataBlock = /** @class */ (function () { function DataBlock(data) { this.description = ''; this.pid = ''; this.id = data.id; this.slug = data.slug; this.title = data.title; this.org = data.org; this.block = data.block; this.sensorGraphSlug = data.sg; this.createdOn = new Date(data.created_on); this.createdBy = data.created_by; if ('description' in data) { this.description = data.description; } if ('pid' in data) { this.pid = data.pid; } } DataBlock.prototype.getPostPayload = function () { var payload = { title: this.title, device: this.slug, description: '' }; if (this.description) { payload.description = this.description; } if (this.onComplete) { payload['on_complete'] = this.onComplete; } return payload; }; return DataBlock; }()); exports.DataBlock = DataBlock; //# sourceMappingURL=datablock.js.map