@trops/dash-core 0.1.87 → 0.1.88
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/dist/electron/index.js +137 -0
- package/dist/electron/index.js.map +1 -1
- package/package.json +1 -1
package/dist/electron/index.js
CHANGED
|
@@ -589,11 +589,13 @@ var clientCacheEvents$1 = {
|
|
|
589
589
|
const DASHBOARD_CONFIG_EXPORT$1 = "dashboard-config-export";
|
|
590
590
|
const DASHBOARD_CONFIG_IMPORT$1 = "dashboard-config-import";
|
|
591
591
|
const DASHBOARD_CONFIG_INSTALL$1 = "dashboard-config-install";
|
|
592
|
+
const DASHBOARD_CONFIG_COMPATIBILITY$1 = "dashboard-config-compatibility";
|
|
592
593
|
|
|
593
594
|
var dashboardConfigEvents$1 = {
|
|
594
595
|
DASHBOARD_CONFIG_EXPORT: DASHBOARD_CONFIG_EXPORT$1,
|
|
595
596
|
DASHBOARD_CONFIG_IMPORT: DASHBOARD_CONFIG_IMPORT$1,
|
|
596
597
|
DASHBOARD_CONFIG_INSTALL: DASHBOARD_CONFIG_INSTALL$1,
|
|
598
|
+
DASHBOARD_CONFIG_COMPATIBILITY: DASHBOARD_CONFIG_COMPATIBILITY$1,
|
|
597
599
|
};
|
|
598
600
|
|
|
599
601
|
/**
|
|
@@ -8356,12 +8358,98 @@ function applyEventWiringToLayout$1(layout, eventWiring) {
|
|
|
8356
8358
|
return layout;
|
|
8357
8359
|
}
|
|
8358
8360
|
|
|
8361
|
+
/**
|
|
8362
|
+
* Check compatibility of a dashboard config against installed widgets.
|
|
8363
|
+
* Returns a per-widget status report indicating what's installed,
|
|
8364
|
+
* what needs to be installed, and what's unavailable.
|
|
8365
|
+
*
|
|
8366
|
+
* @param {Array} dashboardWidgets - Widget deps from dashboard config (widgets array)
|
|
8367
|
+
* @param {Array} installedWidgets - Currently installed widget metadata (from widgetRegistry.getWidgets())
|
|
8368
|
+
* @param {Array} registryPackages - Available packages from registry index (optional)
|
|
8369
|
+
* @returns {Object} Compatibility report
|
|
8370
|
+
*/
|
|
8371
|
+
function checkDashboardCompatibility(
|
|
8372
|
+
dashboardWidgets = [],
|
|
8373
|
+
installedWidgets = [],
|
|
8374
|
+
registryPackages = [],
|
|
8375
|
+
) {
|
|
8376
|
+
const installedByName = new Map();
|
|
8377
|
+
for (const w of installedWidgets) {
|
|
8378
|
+
if (w.name) {
|
|
8379
|
+
installedByName.set(w.name, w);
|
|
8380
|
+
}
|
|
8381
|
+
}
|
|
8382
|
+
|
|
8383
|
+
const registryByName = new Map();
|
|
8384
|
+
for (const p of registryPackages) {
|
|
8385
|
+
if (p.name) {
|
|
8386
|
+
registryByName.set(p.name, p);
|
|
8387
|
+
}
|
|
8388
|
+
}
|
|
8389
|
+
|
|
8390
|
+
const widgets = [];
|
|
8391
|
+
let installedCount = 0;
|
|
8392
|
+
let toInstallCount = 0;
|
|
8393
|
+
let unavailableCount = 0;
|
|
8394
|
+
|
|
8395
|
+
for (const dep of dashboardWidgets) {
|
|
8396
|
+
const packageName = dep.package;
|
|
8397
|
+
const required = dep.required !== false;
|
|
8398
|
+
const installed = installedByName.get(packageName);
|
|
8399
|
+
|
|
8400
|
+
if (installed) {
|
|
8401
|
+
installedCount++;
|
|
8402
|
+
widgets.push({
|
|
8403
|
+
package: packageName,
|
|
8404
|
+
required,
|
|
8405
|
+
status: "installed",
|
|
8406
|
+
installedVersion: installed.version || null,
|
|
8407
|
+
requiredVersion: dep.version || "*",
|
|
8408
|
+
});
|
|
8409
|
+
} else if (registryByName.has(packageName)) {
|
|
8410
|
+
toInstallCount++;
|
|
8411
|
+
const registryPkg = registryByName.get(packageName);
|
|
8412
|
+
widgets.push({
|
|
8413
|
+
package: packageName,
|
|
8414
|
+
required,
|
|
8415
|
+
status: "to-install",
|
|
8416
|
+
availableVersion: registryPkg.version || null,
|
|
8417
|
+
requiredVersion: dep.version || "*",
|
|
8418
|
+
});
|
|
8419
|
+
} else {
|
|
8420
|
+
unavailableCount++;
|
|
8421
|
+
widgets.push({
|
|
8422
|
+
package: packageName,
|
|
8423
|
+
required,
|
|
8424
|
+
status: "unavailable",
|
|
8425
|
+
requiredVersion: dep.version || "*",
|
|
8426
|
+
});
|
|
8427
|
+
}
|
|
8428
|
+
}
|
|
8429
|
+
|
|
8430
|
+
const hasUnavailableRequired = widgets.some(
|
|
8431
|
+
(w) => w.status === "unavailable" && w.required,
|
|
8432
|
+
);
|
|
8433
|
+
|
|
8434
|
+
return {
|
|
8435
|
+
compatible: !hasUnavailableRequired,
|
|
8436
|
+
summary: {
|
|
8437
|
+
total: dashboardWidgets.length,
|
|
8438
|
+
installed: installedCount,
|
|
8439
|
+
toInstall: toInstallCount,
|
|
8440
|
+
unavailable: unavailableCount,
|
|
8441
|
+
},
|
|
8442
|
+
widgets,
|
|
8443
|
+
};
|
|
8444
|
+
}
|
|
8445
|
+
|
|
8359
8446
|
var dashboardConfigUtils$1 = {
|
|
8360
8447
|
collectComponentNames: collectComponentNames$1,
|
|
8361
8448
|
extractEventWiring: extractEventWiring$1,
|
|
8362
8449
|
buildWidgetDependencies: buildWidgetDependencies$1,
|
|
8363
8450
|
buildProviderRequirements: buildProviderRequirements$1,
|
|
8364
8451
|
applyEventWiringToLayout: applyEventWiringToLayout$1,
|
|
8452
|
+
checkDashboardCompatibility,
|
|
8365
8453
|
};
|
|
8366
8454
|
|
|
8367
8455
|
var widgetRegistry$1 = {exports: {}};
|
|
@@ -10271,10 +10359,43 @@ async function installDashboardFromRegistry$1(
|
|
|
10271
10359
|
}
|
|
10272
10360
|
}
|
|
10273
10361
|
|
|
10362
|
+
/**
|
|
10363
|
+
* Check compatibility of a dashboard's widget dependencies against
|
|
10364
|
+
* installed widgets and registry availability.
|
|
10365
|
+
*
|
|
10366
|
+
* @param {Array} dashboardWidgets - Widget deps from dashboard config
|
|
10367
|
+
* @param {Object} widgetRegistry - WidgetRegistry instance (needs getWidgets())
|
|
10368
|
+
* @returns {Promise<Object>} Compatibility report
|
|
10369
|
+
*/
|
|
10370
|
+
async function checkCompatibility$1(dashboardWidgets, widgetRegistry = null) {
|
|
10371
|
+
const { checkDashboardCompatibility } = dashboardConfigUtils$1;
|
|
10372
|
+
const { fetchRegistryIndex } = registryController$1;
|
|
10373
|
+
|
|
10374
|
+
const installedWidgets = widgetRegistry ? widgetRegistry.getWidgets() : [];
|
|
10375
|
+
|
|
10376
|
+
let registryPackages = [];
|
|
10377
|
+
try {
|
|
10378
|
+
const index = await fetchRegistryIndex();
|
|
10379
|
+
registryPackages = index.packages || [];
|
|
10380
|
+
} catch (err) {
|
|
10381
|
+
console.warn(
|
|
10382
|
+
"[DashboardConfigController] Could not fetch registry index for compatibility check:",
|
|
10383
|
+
err.message,
|
|
10384
|
+
);
|
|
10385
|
+
}
|
|
10386
|
+
|
|
10387
|
+
return checkDashboardCompatibility(
|
|
10388
|
+
dashboardWidgets,
|
|
10389
|
+
installedWidgets,
|
|
10390
|
+
registryPackages,
|
|
10391
|
+
);
|
|
10392
|
+
}
|
|
10393
|
+
|
|
10274
10394
|
var dashboardConfigController$1 = {
|
|
10275
10395
|
exportDashboardConfig: exportDashboardConfig$1,
|
|
10276
10396
|
importDashboardConfig: importDashboardConfig$1,
|
|
10277
10397
|
installDashboardFromRegistry: installDashboardFromRegistry$1,
|
|
10398
|
+
checkCompatibility: checkCompatibility$1,
|
|
10278
10399
|
};
|
|
10279
10400
|
|
|
10280
10401
|
/**
|
|
@@ -10367,6 +10488,7 @@ const {
|
|
|
10367
10488
|
exportDashboardConfig,
|
|
10368
10489
|
importDashboardConfig,
|
|
10369
10490
|
installDashboardFromRegistry,
|
|
10491
|
+
checkCompatibility,
|
|
10370
10492
|
} = dashboardConfigController$1;
|
|
10371
10493
|
|
|
10372
10494
|
var controller = {
|
|
@@ -10413,6 +10535,7 @@ var controller = {
|
|
|
10413
10535
|
exportDashboardConfig,
|
|
10414
10536
|
importDashboardConfig,
|
|
10415
10537
|
installDashboardFromRegistry,
|
|
10538
|
+
checkCompatibility,
|
|
10416
10539
|
};
|
|
10417
10540
|
|
|
10418
10541
|
const { ipcRenderer: ipcRenderer$i } = require$$0$1;
|
|
@@ -11792,6 +11915,7 @@ const {
|
|
|
11792
11915
|
DASHBOARD_CONFIG_EXPORT,
|
|
11793
11916
|
DASHBOARD_CONFIG_IMPORT,
|
|
11794
11917
|
DASHBOARD_CONFIG_INSTALL,
|
|
11918
|
+
DASHBOARD_CONFIG_COMPATIBILITY,
|
|
11795
11919
|
} = events$8;
|
|
11796
11920
|
|
|
11797
11921
|
const dashboardConfigApi$2 = {
|
|
@@ -11835,6 +11959,19 @@ const dashboardConfigApi$2 = {
|
|
|
11835
11959
|
appId,
|
|
11836
11960
|
packageName,
|
|
11837
11961
|
}),
|
|
11962
|
+
|
|
11963
|
+
/**
|
|
11964
|
+
* Check compatibility of a dashboard config against installed widgets.
|
|
11965
|
+
*
|
|
11966
|
+
* @param {string} appId - Application identifier
|
|
11967
|
+
* @param {Array} dashboardWidgets - Widget dependencies from dashboard config
|
|
11968
|
+
* @returns {Promise<Object>} Compatibility report with per-widget status
|
|
11969
|
+
*/
|
|
11970
|
+
checkDashboardCompatibility: (appId, dashboardWidgets) =>
|
|
11971
|
+
ipcRenderer$1.invoke(DASHBOARD_CONFIG_COMPATIBILITY, {
|
|
11972
|
+
appId,
|
|
11973
|
+
dashboardWidgets,
|
|
11974
|
+
}),
|
|
11838
11975
|
};
|
|
11839
11976
|
|
|
11840
11977
|
var dashboardConfigApi_1 = dashboardConfigApi$2;
|