@trops/dash-core 0.1.91 → 0.1.92

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.
@@ -593,6 +593,7 @@ const DASHBOARD_CONFIG_COMPATIBILITY$1 = "dashboard-config-compatibility";
593
593
  const DASHBOARD_CONFIG_PUBLISH$1 = "dashboard-config-publish";
594
594
  const DASHBOARD_CONFIG_PREVIEW$1 = "dashboard-config-preview";
595
595
  const DASHBOARD_CONFIG_CHECK_UPDATES$1 = "dashboard-config-check-updates";
596
+ const DASHBOARD_CONFIG_PROVIDER_SETUP$1 = "dashboard-config-provider-setup";
596
597
 
597
598
  var dashboardConfigEvents$1 = {
598
599
  DASHBOARD_CONFIG_EXPORT: DASHBOARD_CONFIG_EXPORT$1,
@@ -602,6 +603,7 @@ var dashboardConfigEvents$1 = {
602
603
  DASHBOARD_CONFIG_PUBLISH: DASHBOARD_CONFIG_PUBLISH$1,
603
604
  DASHBOARD_CONFIG_PREVIEW: DASHBOARD_CONFIG_PREVIEW$1,
604
605
  DASHBOARD_CONFIG_CHECK_UPDATES: DASHBOARD_CONFIG_CHECK_UPDATES$1,
606
+ DASHBOARD_CONFIG_PROVIDER_SETUP: DASHBOARD_CONFIG_PROVIDER_SETUP$1,
605
607
  };
606
608
 
607
609
  /**
@@ -8598,6 +8600,59 @@ function checkDashboardUpdates(workspaces = [], registryPackages = []) {
8598
8600
  return updates;
8599
8601
  }
8600
8602
 
8603
+ /**
8604
+ * Build a provider setup manifest for a dashboard's requirements.
8605
+ * Compares required providers against configured providers,
8606
+ * returning status (configured/needs-setup) for each.
8607
+ *
8608
+ * @param {Array} requiredProviders - Provider requirements from dashboard config
8609
+ * @param {Array} configuredProviders - User's configured providers (from providerController)
8610
+ * @returns {Object} Setup manifest with per-provider status
8611
+ */
8612
+ function buildProviderSetupManifest(
8613
+ requiredProviders = [],
8614
+ configuredProviders = [],
8615
+ ) {
8616
+ const configuredByType = new Map();
8617
+ for (const p of configuredProviders) {
8618
+ const key = p.type || p.name || "";
8619
+ if (key) {
8620
+ configuredByType.set(key.toLowerCase(), p);
8621
+ }
8622
+ }
8623
+
8624
+ const providers = requiredProviders.map((req) => {
8625
+ const typeKey = (req.type || "").toLowerCase();
8626
+ const configured = configuredByType.get(typeKey);
8627
+
8628
+ return {
8629
+ type: req.type || "",
8630
+ providerClass: req.providerClass || "",
8631
+ required: req.required !== false,
8632
+ usedBy: req.usedBy || [],
8633
+ status: configured ? "configured" : "needs-setup",
8634
+ configuredProvider: configured || null,
8635
+ };
8636
+ });
8637
+
8638
+ const configuredCount = providers.filter(
8639
+ (p) => p.status === "configured",
8640
+ ).length;
8641
+ const needsSetupCount = providers.filter(
8642
+ (p) => p.status === "needs-setup",
8643
+ ).length;
8644
+
8645
+ return {
8646
+ allConfigured: needsSetupCount === 0,
8647
+ summary: {
8648
+ total: providers.length,
8649
+ configured: configuredCount,
8650
+ needsSetup: needsSetupCount,
8651
+ },
8652
+ providers,
8653
+ };
8654
+ }
8655
+
8601
8656
  var dashboardConfigUtils$1 = {
8602
8657
  collectComponentNames: collectComponentNames$1,
8603
8658
  extractEventWiring: extractEventWiring$1,
@@ -8608,6 +8663,7 @@ var dashboardConfigUtils$1 = {
8608
8663
  generateRegistryManifest,
8609
8664
  buildDashboardPreview,
8610
8665
  checkDashboardUpdates,
8666
+ buildProviderSetupManifest,
8611
8667
  };
8612
8668
 
8613
8669
  var widgetRegistry$1 = {exports: {}};
@@ -10822,6 +10878,31 @@ async function checkDashboardUpdatesForApp$1(appId) {
10822
10878
  }
10823
10879
  }
10824
10880
 
10881
+ /**
10882
+ * Get a provider setup manifest for a dashboard's requirements.
10883
+ * Compares required providers against the user's configured providers.
10884
+ *
10885
+ * @param {string} appId - Application identifier
10886
+ * @param {Array} requiredProviders - Provider requirements from dashboard config
10887
+ * @returns {Object} Setup manifest with per-provider status
10888
+ */
10889
+ function getProviderSetupManifest$1(appId, requiredProviders = []) {
10890
+ const { buildProviderSetupManifest } = dashboardConfigUtils$1;
10891
+ const { listProviders } = requireProviderController();
10892
+
10893
+ let configuredProviders = [];
10894
+ try {
10895
+ configuredProviders = listProviders(null, appId) || [];
10896
+ } catch (err) {
10897
+ console.warn(
10898
+ "[DashboardConfigController] Could not list providers:",
10899
+ err.message,
10900
+ );
10901
+ }
10902
+
10903
+ return buildProviderSetupManifest(requiredProviders, configuredProviders);
10904
+ }
10905
+
10825
10906
  var dashboardConfigController$1 = {
10826
10907
  exportDashboardConfig: exportDashboardConfig$1,
10827
10908
  importDashboardConfig: importDashboardConfig$1,
@@ -10830,6 +10911,7 @@ var dashboardConfigController$1 = {
10830
10911
  prepareDashboardForPublish: prepareDashboardForPublish$1,
10831
10912
  getDashboardPreview: getDashboardPreview$1,
10832
10913
  checkDashboardUpdatesForApp: checkDashboardUpdatesForApp$1,
10914
+ getProviderSetupManifest: getProviderSetupManifest$1,
10833
10915
  };
10834
10916
 
10835
10917
  /**
@@ -10926,6 +11008,7 @@ const {
10926
11008
  prepareDashboardForPublish,
10927
11009
  getDashboardPreview,
10928
11010
  checkDashboardUpdatesForApp,
11011
+ getProviderSetupManifest,
10929
11012
  } = dashboardConfigController$1;
10930
11013
 
10931
11014
  var controller = {
@@ -10976,6 +11059,7 @@ var controller = {
10976
11059
  prepareDashboardForPublish,
10977
11060
  getDashboardPreview,
10978
11061
  checkDashboardUpdatesForApp,
11062
+ getProviderSetupManifest,
10979
11063
  };
10980
11064
 
10981
11065
  const { ipcRenderer: ipcRenderer$i } = require$$0$1;
@@ -12359,6 +12443,7 @@ const {
12359
12443
  DASHBOARD_CONFIG_PUBLISH,
12360
12444
  DASHBOARD_CONFIG_PREVIEW,
12361
12445
  DASHBOARD_CONFIG_CHECK_UPDATES,
12446
+ DASHBOARD_CONFIG_PROVIDER_SETUP,
12362
12447
  } = events$8;
12363
12448
 
12364
12449
  const dashboardConfigApi$2 = {
@@ -12451,6 +12536,19 @@ const dashboardConfigApi$2 = {
12451
12536
  */
12452
12537
  checkDashboardUpdates: (appId) =>
12453
12538
  ipcRenderer$1.invoke(DASHBOARD_CONFIG_CHECK_UPDATES, { appId }),
12539
+
12540
+ /**
12541
+ * Get provider setup manifest for a dashboard's requirements.
12542
+ *
12543
+ * @param {string} appId - Application identifier
12544
+ * @param {Array} requiredProviders - Provider requirements from dashboard config
12545
+ * @returns {Promise<Object>} Setup manifest with per-provider status
12546
+ */
12547
+ getProviderSetupManifest: (appId, requiredProviders) =>
12548
+ ipcRenderer$1.invoke(DASHBOARD_CONFIG_PROVIDER_SETUP, {
12549
+ appId,
12550
+ requiredProviders,
12551
+ }),
12454
12552
  };
12455
12553
 
12456
12554
  var dashboardConfigApi_1 = dashboardConfigApi$2;