UNPKG

mobile-cli-lib

Version:
45 lines (44 loc) 2.25 kB
"use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var querystring = require("querystring"); var device_app_data_base_1 = require("./../../mobile/device-app-data/device-app-data-base"); var AppBuilderDeviceAppDataBase = (function (_super) { __extends(AppBuilderDeviceAppDataBase, _super); function AppBuilderDeviceAppDataBase(_appIdentifier, device, platform, $deployHelper, $devicePlatformsConstants) { _super.call(this, _appIdentifier); this.device = device; this.platform = platform; this.$deployHelper = $deployHelper; this.$devicePlatformsConstants = $devicePlatformsConstants; } Object.defineProperty(AppBuilderDeviceAppDataBase.prototype, "liveSyncFormat", { get: function () { return null; }, enumerable: true, configurable: true }); AppBuilderDeviceAppDataBase.prototype.encodeLiveSyncHostUri = function (hostUri) { return querystring.escape(hostUri); }; AppBuilderDeviceAppDataBase.prototype.getLiveSyncNotSupportedError = function () { return "You can't LiveSync on device with id " + this.device.deviceInfo.identifier + "! Deploy the app with LiveSync enabled and wait for the initial start up before LiveSyncing."; }; AppBuilderDeviceAppDataBase.prototype.isLiveSyncSupported = function () { var _this = this; return (function () { var isApplicationInstalled = _this.device.applicationManager.isApplicationInstalled(_this.appIdentifier).wait(); if (!isApplicationInstalled) { _this.$deployHelper.deploy(_this.platform.toString()).wait(); _this.device.applicationManager.checkForApplicationUpdates().wait(); } return _this.device.applicationManager.isLiveSyncSupported(_this.appIdentifier).wait(); }).future()(); }; return AppBuilderDeviceAppDataBase; }(device_app_data_base_1.DeviceAppDataBase)); exports.AppBuilderDeviceAppDataBase = AppBuilderDeviceAppDataBase;