incyclist-services 1.4.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -79,54 +79,60 @@ let DeviceConfigurationService = (() => {
|
|
|
79
79
|
init() {
|
|
80
80
|
return __awaiter(this, void 0, void 0, function* () {
|
|
81
81
|
var _a, _b, _c;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
this.
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
this.logEvent({ message: 'DeviceConfig.init' });
|
|
89
|
-
if (this.isLegacyConfiguration()) {
|
|
90
|
-
this.initFromLegacy();
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
yield this.getUserSettings().init();
|
|
94
|
-
this.settings = {
|
|
95
|
-
devices: this.getUserSettings().get('devices', []),
|
|
96
|
-
capabilities: this.getUserSettings().get('capabilities', []),
|
|
97
|
-
interfaces: this.getUserSettings().get('interfaces', [])
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
let emptyConfig = false;
|
|
101
|
-
if (!this.settings)
|
|
102
|
-
this.settings = {};
|
|
103
|
-
if (!this.settings.capabilities || ((_a = this.settings.capabilities) === null || _a === void 0 ? void 0 : _a.length) === 0) {
|
|
104
|
-
this.initCapabilties();
|
|
105
|
-
emptyConfig = true;
|
|
106
|
-
}
|
|
107
|
-
if (!this.settings.interfaces || ((_b = this.settings.interfaces) === null || _b === void 0 ? void 0 : _b.length) === 0) {
|
|
108
|
-
this.initInterfaces();
|
|
109
|
-
emptyConfig = true;
|
|
110
|
-
}
|
|
111
|
-
if (emptyConfig)
|
|
112
|
-
this.updateUserSettings();
|
|
113
|
-
if (!((_c = this.settings) === null || _c === void 0 ? void 0 : _c.devices))
|
|
114
|
-
this.settings.devices = [];
|
|
115
|
-
this.settings.devices.forEach(d => {
|
|
116
|
-
if (!(d === null || d === void 0 ? void 0 : d.udid))
|
|
82
|
+
try {
|
|
83
|
+
const userSettings = this.getUserSettings();
|
|
84
|
+
yield userSettings.init();
|
|
85
|
+
if (this.isInitialized()) {
|
|
86
|
+
this.emitInitialized();
|
|
117
87
|
return;
|
|
118
|
-
try {
|
|
119
|
-
this.adapters[d.udid] = this.getAdapterFromSetting(d.settings);
|
|
120
88
|
}
|
|
121
|
-
|
|
122
|
-
|
|
89
|
+
this.logEvent({ message: 'DeviceConfig.init' });
|
|
90
|
+
if (this.isLegacyConfiguration()) {
|
|
91
|
+
this.initFromLegacy();
|
|
123
92
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
93
|
+
else {
|
|
94
|
+
yield this.getUserSettings().init();
|
|
95
|
+
this.settings = {
|
|
96
|
+
devices: this.getUserSettings().get('devices', []),
|
|
97
|
+
capabilities: this.getUserSettings().get('capabilities', []),
|
|
98
|
+
interfaces: this.getUserSettings().get('interfaces', [])
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
let emptyConfig = false;
|
|
102
|
+
if (!this.settings)
|
|
103
|
+
this.settings = {};
|
|
104
|
+
if (!this.settings.capabilities || ((_a = this.settings.capabilities) === null || _a === void 0 ? void 0 : _a.length) === 0) {
|
|
105
|
+
this.initCapabilties();
|
|
106
|
+
emptyConfig = true;
|
|
107
|
+
}
|
|
108
|
+
if (!this.settings.interfaces || ((_b = this.settings.interfaces) === null || _b === void 0 ? void 0 : _b.length) === 0) {
|
|
109
|
+
this.initInterfaces();
|
|
110
|
+
emptyConfig = true;
|
|
111
|
+
}
|
|
112
|
+
if (emptyConfig)
|
|
113
|
+
this.updateUserSettings();
|
|
114
|
+
if (!((_c = this.settings) === null || _c === void 0 ? void 0 : _c.devices))
|
|
115
|
+
this.settings.devices = [];
|
|
116
|
+
this.settings.devices.forEach(d => {
|
|
117
|
+
if (!(d === null || d === void 0 ? void 0 : d.udid))
|
|
118
|
+
return;
|
|
119
|
+
try {
|
|
120
|
+
this.adapters[d.udid] = this.getAdapterFromSetting(d.settings);
|
|
121
|
+
}
|
|
122
|
+
catch (err) {
|
|
123
|
+
this.logEvent({ message: 'error', fn: 'init()->Adapterfactory.create()', error: err.message, udid: d.udid, settings: d.settings, devices: this.settings.devices, stack: err.stack, });
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
this.initWifiInterface();
|
|
127
|
+
this.verifyCapabilitySettings();
|
|
128
|
+
this.removeLegacySettings();
|
|
129
|
+
this.logEvent({ message: 'DeviceConfig.init done' });
|
|
130
|
+
this.emitInitialized();
|
|
131
|
+
}
|
|
132
|
+
catch (err) {
|
|
133
|
+
this.logEvent({ message: 'Error', fn: 'init', error: err.message, stack: err.stack });
|
|
134
|
+
this.emitInitialized();
|
|
135
|
+
}
|
|
130
136
|
});
|
|
131
137
|
}
|
|
132
138
|
setFeature(name, enabled) {
|
|
@@ -720,8 +726,13 @@ let DeviceConfigurationService = (() => {
|
|
|
720
726
|
this.initWifiInterface();
|
|
721
727
|
}
|
|
722
728
|
doesAppSupportsWifi() {
|
|
723
|
-
|
|
724
|
-
|
|
729
|
+
try {
|
|
730
|
+
const version = this.getAppVersion();
|
|
731
|
+
return semver_1.default.gte(version, '0.9.10');
|
|
732
|
+
}
|
|
733
|
+
catch (_a) {
|
|
734
|
+
return false;
|
|
735
|
+
}
|
|
725
736
|
}
|
|
726
737
|
getAppVersion() {
|
|
727
738
|
var _a;
|