@xenon-device-management/xenon 1.1.6 → 1.1.7

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.6",
3
+ "version": "1.1.7",
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": {
@@ -9,7 +9,7 @@
9
9
  "./package.json": "./package.json"
10
10
  },
11
11
  "scripts": {
12
- "postinstall": "npx prisma generate",
12
+ "postinstall": "node scripts/generate-prisma.js",
13
13
  "build": "npx prisma generate && tsc -b && npm run build:copy",
14
14
  "build:all": "npm run build:xenon && npm run build",
15
15
  "build:copy": "rm -rf lib/public && mkdir -p lib && cp -R src/public lib/ && cp schema.json lib/",
@@ -12,14 +12,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.addNewPendingSession = addNewPendingSession;
13
13
  exports.removePendingSession = removePendingSession;
14
14
  const device_store_1 = require("./device-store");
15
- const store = device_store_1.DeviceStoreFactory.getPendingSessionStore();
16
15
  function addNewPendingSession(capability) {
17
16
  return __awaiter(this, void 0, void 0, function* () {
17
+ const store = device_store_1.DeviceStoreFactory.getPendingSessionStore();
18
18
  yield store.addPendingSession(capability);
19
19
  });
20
20
  }
21
21
  function removePendingSession(sessionCapabilityId) {
22
22
  return __awaiter(this, void 0, void 0, function* () {
23
+ const store = device_store_1.DeviceStoreFactory.getPendingSessionStore();
23
24
  yield store.removePendingSession(sessionCapabilityId);
24
25
  });
25
26
  }
@@ -51,8 +51,8 @@ const typedi_1 = require("typedi");
51
51
  const semver = __importStar(require("semver"));
52
52
  const logger_1 = __importDefault(require("../logger"));
53
53
  class PrismaDeviceStore {
54
- constructor() {
55
- this.prisma = typedi_1.Container.get(prisma_service_1.PrismaService).client;
54
+ get prisma() {
55
+ return typedi_1.Container.get(prisma_service_1.PrismaService).client;
56
56
  }
57
57
  toIDevice(device) {
58
58
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
@@ -275,8 +275,8 @@ class PrismaDeviceStore {
275
275
  }
276
276
  exports.PrismaDeviceStore = PrismaDeviceStore;
277
277
  class PrismaPendingSessionStore {
278
- constructor() {
279
- this.prisma = typedi_1.Container.get(prisma_service_1.PrismaService).client;
278
+ get prisma() {
279
+ return typedi_1.Container.get(prisma_service_1.PrismaService).client;
280
280
  }
281
281
  addPendingSession(capability) {
282
282
  return __awaiter(this, void 0, void 0, function* () {
@@ -327,8 +327,8 @@ class PrismaPendingSessionStore {
327
327
  }
328
328
  exports.PrismaPendingSessionStore = PrismaPendingSessionStore;
329
329
  class PrismaCLIArgsStore {
330
- constructor() {
331
- this.prisma = typedi_1.Container.get(prisma_service_1.PrismaService).client;
330
+ get prisma() {
331
+ return typedi_1.Container.get(prisma_service_1.PrismaService).client;
332
332
  }
333
333
  addCLIArgs(args) {
334
334
  return __awaiter(this, void 0, void 0, function* () {
@@ -348,8 +348,8 @@ class PrismaCLIArgsStore {
348
348
  }
349
349
  exports.PrismaCLIArgsStore = PrismaCLIArgsStore;
350
350
  class PrismaHealEtalonStore {
351
- constructor() {
352
- this.prisma = typedi_1.Container.get(prisma_service_1.PrismaService).client;
351
+ get prisma() {
352
+ return typedi_1.Container.get(prisma_service_1.PrismaService).client;
353
353
  }
354
354
  saveSignature(etalon) {
355
355
  return __awaiter(this, void 0, void 0, function* () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xenon-device-management/xenon",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
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": {
@@ -9,7 +9,7 @@
9
9
  "./package.json": "./package.json"
10
10
  },
11
11
  "scripts": {
12
- "postinstall": "npx prisma generate",
12
+ "postinstall": "node scripts/generate-prisma.js",
13
13
  "build": "npx prisma generate && tsc -b && npm run build:copy",
14
14
  "build:all": "npm run build:xenon && npm run build",
15
15
  "build:copy": "rm -rf lib/public && mkdir -p lib && cp -R src/public lib/ && cp schema.json lib/",
@@ -0,0 +1,40 @@
1
+ const { execSync } = require('child_process');
2
+ const path = require('path');
3
+ const fs = require('fs');
4
+
5
+ /**
6
+ * Robust Prisma Client Generator
7
+ *
8
+ * This script runs 'prisma generate' but ensures that it doesn't
9
+ * crash the npm install process if it fails.
10
+ */
11
+ function generate() {
12
+ console.log('📦 [Xenon] Running Prisma client generation...');
13
+
14
+ try {
15
+ // Determine the path to prisma CLI
16
+ let prismaBin = path.resolve(__dirname, '../node_modules/.bin/prisma');
17
+ if (!fs.existsSync(prismaBin)) {
18
+ prismaBin = 'npx prisma'; // Fallback to npx
19
+ }
20
+
21
+ const command = `${prismaBin} generate`;
22
+ console.log(`🚀 [Xenon] Executing: ${command}`);
23
+
24
+ execSync(command, {
25
+ stdio: 'inherit',
26
+ cwd: path.resolve(__dirname, '..')
27
+ });
28
+
29
+ console.log('✅ [Xenon] Prisma client generated successfully.');
30
+ } catch (error) {
31
+ console.error('⚠️ [Xenon] Prisma client generation failed.');
32
+ console.error('⚠️ [Xenon] This is usually fine during installation; the client will be verified at runtime.');
33
+ console.error('⚠️ [Xenon] Error detail:', error.message);
34
+
35
+ // Crucial: Exit with 0 so npm install proceeds
36
+ process.exit(0);
37
+ }
38
+ }
39
+
40
+ generate();