@xenon-device-management/xenon 1.1.18 → 1.1.19

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.
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xenon-device-management/xenon",
3
- "version": "1.1.18",
3
+ "version": "1.1.19",
4
4
  "description": "Xenon - Intelligent Mobile Infrastructure. A self-healing device orchestration platform for Appium.",
5
5
  "main": "./lib/src/index.js",
6
6
  "exports": {
package/lib/schema.json CHANGED
@@ -119,6 +119,10 @@
119
119
  "type": "boolean",
120
120
  "default": false
121
121
  },
122
+ "bootedEmulators": {
123
+ "type": "boolean",
124
+ "default": false
125
+ },
122
126
  "removeDevicesFromDatabaseBeforeRunningThePlugin": {
123
127
  "type": "boolean",
124
128
  "default": false
@@ -154,7 +154,8 @@ const findPublicPath = () => {
154
154
  return fallback;
155
155
  };
156
156
  const publicPath = findPublicPath();
157
- logger_1.default.info(`[Xenon] Public assets path resolved to: ${publicPath}`);
157
+ logger_1.default.info(`[Xenon] Dashboard assets path: ${publicPath}`);
158
+ logger_1.default.info(`[Xenon] Dashboard available at: /xenon/ (e.g. http://localhost:4723/xenon/)`);
158
159
  // Principal Security: Add permissive CSP and CORS for the dashboard
159
160
  router.use((req, res, next) => {
160
161
  res.setHeader('Content-Security-Policy', "default-src * 'unsafe-inline' 'unsafe-eval' data: blob:; frame-ancestors 'self';");
@@ -200,13 +201,16 @@ function createRouter(pluginArgs) {
200
201
  return res.status(404).json({ error: true, message: 'Not Found' });
201
202
  logger_1.default.debug(`[Xenon] UI Fallback triggered for: ${url}. Targeting: ${indexPath}`);
202
203
  if (fs_1.default.existsSync(indexPath)) {
203
- res.set('Cache-Control', 'no-store, no-cache, must-revalidate, proxy-revalidate');
204
- res.sendFile(indexPath, (err) => {
205
- if (err && !res.headersSent) {
206
- logger_1.default.error(`[Xenon] res.sendFile failed for ${indexPath}. Error: ${err.message}`);
207
- res.status(404).send(`Xenon UI Asset Error: ${err.message}`);
208
- }
209
- });
204
+ try {
205
+ const html = fs_1.default.readFileSync(indexPath, 'utf-8');
206
+ res.set('Content-Type', 'text/html');
207
+ res.set('Cache-Control', 'no-store, no-cache, must-revalidate, proxy-revalidate');
208
+ return res.send(html);
209
+ }
210
+ catch (err) {
211
+ logger_1.default.error(`[Xenon] UI Fallback read error for ${indexPath}: ${err.message}`);
212
+ return res.status(500).send(`Xenon UI Asset Error: ${err.message}`);
213
+ }
210
214
  }
211
215
  else {
212
216
  logger_1.default.error(`[Xenon] UI Fallback failed: index.html not found at ${indexPath}`);
@@ -218,7 +222,7 @@ function createRouter(pluginArgs) {
218
222
  catch (e) {
219
223
  logger_1.default.error(`[Xenon] Could not even read directory ${publicPath}: ${e.message}`);
220
224
  }
221
- res.status(404).send('Xenon UI assets not found. Check installation.');
225
+ return res.status(404).send('Xenon UI assets not found. Check installation.');
222
226
  }
223
227
  });
224
228
  return router;
@@ -148,12 +148,24 @@ let AndroidDeviceManager = class AndroidDeviceManager {
148
148
  });
149
149
  }
150
150
  else if (deviceTypes.androidDeviceType === 'simulated') {
151
- return devices.filter((device) => {
151
+ const simulated = devices.filter((device) => {
152
152
  return device.deviceType === 'emulator';
153
153
  });
154
+ if (this.pluginArgs.bootedEmulators) {
155
+ return simulated.filter((device) => device.state === 'device');
156
+ }
157
+ return simulated;
154
158
  // return both real and simulated (emulated) devices
155
159
  }
156
160
  else {
161
+ if (this.pluginArgs.bootedEmulators) {
162
+ return devices.filter((device) => {
163
+ if (device.deviceType === 'emulator') {
164
+ return device.state === 'device';
165
+ }
166
+ return true;
167
+ });
168
+ }
157
169
  return devices;
158
170
  }
159
171
  }
@@ -34,6 +34,7 @@ exports.DefaultPluginArgs = {
34
34
  bindHostOrIp: ip_1.default.address(),
35
35
  enableDashboard: false,
36
36
  bootedSimulators: false,
37
+ bootedEmulators: false,
37
38
  healthCheckIntervalMs: 86400000,
38
39
  healthCheckSchedule: undefined,
39
40
  removeDevicesFromDatabaseBeforeRunningThePlugin: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xenon-device-management/xenon",
3
- "version": "1.1.18",
3
+ "version": "1.1.19",
4
4
  "description": "Xenon - Intelligent Mobile Infrastructure. A self-healing device orchestration platform for Appium.",
5
5
  "main": "./lib/src/index.js",
6
6
  "exports": {
package/schema.json CHANGED
@@ -119,6 +119,10 @@
119
119
  "type": "boolean",
120
120
  "default": false
121
121
  },
122
+ "bootedEmulators": {
123
+ "type": "boolean",
124
+ "default": false
125
+ },
122
126
  "removeDevicesFromDatabaseBeforeRunningThePlugin": {
123
127
  "type": "boolean",
124
128
  "default": false