@lunora/studio 1.0.0-alpha.2 → 1.0.0-alpha.21

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.
Files changed (60) hide show
  1. package/__assets__/package-og.svg +1 -1
  2. package/dist/index.d.ts +23 -17
  3. package/dist/index.js +34 -34
  4. package/dist/mount.d.ts +1 -1
  5. package/dist/mount.js +1 -1
  6. package/dist/packem_shared/{ADMIN_FUNCTION_PREFIX-DmBqMZ-z.js → ADMIN_FUNCTIONS-CdaxLGkE.js} +3 -0
  7. package/dist/packem_shared/{ApiDocsPanel-DpRjJhG5.js → ApiDocsPanel-BgrN4kml.js} +3 -3
  8. package/dist/packem_shared/{ApiReferencePanel-DMIUp-kK.js → ApiReferencePanel-1vubqG5s.js} +2 -2
  9. package/dist/packem_shared/{ApiTab-DURGU15e.js → ApiTab-CHkX49o_.js} +4 -4
  10. package/dist/packem_shared/{AuditPanel-BC59Nhst.js → AuditPanel-CP9HM9nq.js} +19 -31
  11. package/dist/packem_shared/{CommandPalette-Dx_CoB9i.js → CommandPalette-BtgkBzZI.js} +2 -2
  12. package/dist/packem_shared/{ConfirmButton-WQVUoGFb.js → ConfirmButton-C2eVi2Qv.js} +1 -1
  13. package/dist/packem_shared/{ConnectionBadge-Bxagrip8.js → ConnectionBadge-B2DDM2Tn.js} +1 -1
  14. package/dist/packem_shared/{createStudioI18n-CgvlmDkN.js → DEFAULT_LOCALE-CiX4W7Kr.js} +1 -1
  15. package/dist/packem_shared/{DataBrowser-Coz6jJE6.js → DataBrowser-Bb1gTQ6c.js} +182 -249
  16. package/dist/packem_shared/{ExportImportPanel-WO34fJxy.js → ExportImportPanel-Dj87tRa5.js} +9 -5
  17. package/dist/packem_shared/{FileBrowser-Zcr-Qgxo.js → FileBrowser-CWvxp_is.js} +7 -7
  18. package/dist/packem_shared/{FunctionRunner-j0Rd5m9t.js → FunctionRunner-DlWApMCH.js} +4 -4
  19. package/dist/packem_shared/{FunctionStatsPanel-DboBl-XL.js → FunctionStatsPanel-CuO2Tmw-.js} +141 -198
  20. package/dist/packem_shared/{GlobalDataBrowser-9MhPEfgN.js → GlobalDataBrowser-3X9uRfdO.js} +37 -66
  21. package/dist/packem_shared/{HealthPanel-DOIgbUtx.js → HealthPanel-Dj0GRo5P.js} +31 -23
  22. package/dist/packem_shared/{HomePanel-bdOCNA-p.js → HomePanel-BewOCuag.js} +450 -389
  23. package/dist/packem_shared/{InsightsPanel-DaZPnSgt.js → InsightsPanel-y_Q-xdPY.js} +104 -66
  24. package/dist/packem_shared/{LogsPanel-CWdqAGpQ.js → LogsPanel-C7crgYoS.js} +35 -47
  25. package/dist/packem_shared/{MailPanel-D_EGtDnS.js → MailPanel-PILidruz.js} +31 -38
  26. package/dist/packem_shared/{MetricsPanel-E4Gv6wTO.js → MetricsPanel-DioILzgf.js} +34 -48
  27. package/dist/packem_shared/{MigrationsPanel-DQdPY9io.js → MigrationsPanel-DkIcRoE5.js} +31 -38
  28. package/dist/packem_shared/{OpenRpcReferencePanel-j2p3HB0s.js → OpenRpcReferencePanel-vbcYbv3V.js} +2 -2
  29. package/dist/packem_shared/{PitrPanel-BbBkQR6t.js → PitrPanel-yKJ1JPPk.js} +4 -4
  30. package/dist/packem_shared/{ScheduledJobs-Ok1CYYwI.js → ScheduledJobs-BWNwIN3I.js} +164 -61
  31. package/dist/packem_shared/{SchemaViewer-D8XGnp-X.js → SchemaViewer-CNr8Wame.js} +4 -4
  32. package/dist/packem_shared/{SecurityAdvisorPanel-Cdm2IxLW.js → SecurityAdvisorPanel-BBzv7L3c.js} +44 -31
  33. package/dist/packem_shared/SettingsPanel-BKSKl8tl.js +390 -0
  34. package/dist/packem_shared/{ShardInput-DNCsT1KW.js → ShardInput-gx_DZXXn.js} +1 -1
  35. package/dist/packem_shared/SqlEditorPanel-CkemCQvy.js +13 -0
  36. package/dist/packem_shared/Studio-QkOjc2NS.js +33 -0
  37. package/dist/packem_shared/{StudioApp-dvywkJ8I.js → StudioApp-TEElspKL.js} +278 -4
  38. package/dist/packem_shared/{StudioI18nProvider-Dcajsznk.js → StudioI18nProvider-B-tDCZIi.js} +1 -1
  39. package/dist/packem_shared/TableEditor-JS3sXYgS.js +11 -0
  40. package/dist/packem_shared/{advisor-view-DBlzJi6C.js → advisor-view-CGcfMiPq.js} +1 -1
  41. package/dist/packem_shared/{app.d-CCmwDEVs.d.ts → app.d-Cnij4Zp5.d.ts} +1 -1
  42. package/dist/packem_shared/{cf-links-BZfRdxSE.js → cf-links-2cktDedA.js} +1 -1
  43. package/dist/packem_shared/{data-grid-CCh2Couo.js → data-grid-B5CaV3wS.js} +2 -2
  44. package/dist/packem_shared/{grid-features-DTjG6Sex.js → grid-features-CzUfqgsM.js} +3 -3
  45. package/dist/packem_shared/{internal-BBZYexre.js → internal-rXJEAhXS.js} +1 -1
  46. package/dist/packem_shared/{live-status-bPff1O7Y.js → live-status-FZ0psC1z.js} +1 -1
  47. package/dist/packem_shared/{reference-view-BCKIoai7.js → reference-view-B4E49Lip.js} +3 -3
  48. package/dist/packem_shared/{sql-editor-panel-CW2y2x9h.js → sql-editor-panel-CUJoYF1Z.js} +6 -6
  49. package/dist/packem_shared/{studio-BDVd7rIV.js → studio-c5Vf7kSh.js} +2897 -1668
  50. package/dist/packem_shared/{TableEditor-DIVDk3vT.js → table-editor-9fhJ4hMJ.js} +43 -7
  51. package/dist/packem_shared/{table-list-sidebar-aZHLq70w.js → table-list-sidebar-Bg7uzbvC.js} +2 -2
  52. package/dist/packem_shared/use-admin-query-BkbdNFNz.js +105 -0
  53. package/dist/standalone/studio.js +198 -176
  54. package/dist/styles.css +1 -1
  55. package/package.json +13 -12
  56. package/dist/packem_shared/SettingsPanel-D3WF2mBU.js +0 -176
  57. package/dist/packem_shared/SqlEditorPanel-BuQ7f2Hs.js +0 -13
  58. package/dist/packem_shared/Studio-D36od9Oz.js +0 -33
  59. package/dist/packem_shared/use-live-admin-D1h1Fzsd.js +0 -73
  60. package/dist/packem_shared/use-live-shard-seed-B74RYcOy.js +0 -76
@@ -1,23 +1,17 @@
1
1
  import { c } from 'react/compiler-runtime';
2
- import { useLunora } from '@lunora/react';
3
2
  import { useNavigate } from '@tanstack/react-router';
4
- import { useState, useEffect } from 'react';
5
3
  import { B as Bar, E as EvilBarChart } from './bar-chart-CzJAgqkp.js';
6
4
  import { B as Badge } from './badge-B2PKA1-5.js';
7
5
  import { C as Card, a as CardContent } from './card-DURq3ElK.js';
8
6
  import { E as EmptyState } from './empty-state-DY_oe0k6.js';
9
- import { useT } from './createStudioI18n-CgvlmDkN.js';
10
- import { ADMIN_FUNCTIONS } from './ADMIN_FUNCTION_PREFIX-DmBqMZ-z.js';
11
- import { g as formatBytes, f as fireAndForget, c as callOptions, a as adminRef } from './internal-BBZYexre.js';
7
+ import { u as useAdminQuery } from './use-admin-query-BkbdNFNz.js';
8
+ import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
9
+ import { ADMIN_FUNCTIONS } from './ADMIN_FUNCTIONS-CdaxLGkE.js';
10
+ import { d as formatBytes, f as fireAndForget } from './internal-rXJEAhXS.js';
12
11
  import { c as cn } from './utils-B05Dmz_H.js';
13
12
  import { deriveInsights } from './DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js';
14
13
  import { jsxDEV } from 'react/jsx-dev-runtime';
15
14
 
16
- const GET_METRICS = adminRef(ADMIN_FUNCTIONS.getMetrics);
17
- const GET_FUNCTION_STATS = adminRef(ADMIN_FUNCTIONS.getFunctionStats);
18
- const GET_SECURITY_AUDIT = adminRef(ADMIN_FUNCTIONS.getSecurityAudit);
19
- const GET_AUDIT_LOG = adminRef(ADMIN_FUNCTIONS.getAuditLog);
20
- const LIST_SUBSCRIPTIONS = adminRef(ADMIN_FUNCTIONS.listSubscriptions);
21
15
  const formatMs = (ms) => {
22
16
  if (ms < 1e3) {
23
17
  return `${String(Math.round(ms))}ms`;
@@ -682,389 +676,456 @@ const averageLatencyMs = (functions) => {
682
676
  return functions.reduce((sum, function_) => sum + function_.totalDurationMs, 0) / calls;
683
677
  };
684
678
  const HomePanel = (t0) => {
685
- const $ = c(132);
679
+ const $ = c(149);
686
680
  const {
687
681
  initialShardKey
688
682
  } = t0;
689
- const client = useLunora();
690
683
  const t = useT();
691
684
  const navigate = useNavigate();
692
- const [metrics, setMetrics] = useState(null);
685
+ const shard = initialShardKey ?? "";
693
686
  let t1;
694
687
  if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
695
- t1 = [];
688
+ t1 = {};
696
689
  $[0] = t1;
697
690
  } else {
698
691
  t1 = $[0];
699
692
  }
700
- const [functions, setFunctions] = useState(t1);
701
- const [performanceCount, setPerformanceCount] = useState(null);
702
- const [securityCount, setSecurityCount] = useState(null);
703
- const [subscriptions, setSubscriptions] = useState(null);
704
693
  let t2;
705
- if ($[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
706
- t2 = [];
707
- $[1] = t2;
694
+ if ($[1] !== shard) {
695
+ t2 = {
696
+ shardKey: shard
697
+ };
698
+ $[1] = shard;
699
+ $[2] = t2;
708
700
  } else {
709
- t2 = $[1];
701
+ t2 = $[2];
710
702
  }
711
- const [activity, setActivity] = useState(t2);
703
+ const metricsQuery = useAdminQuery(ADMIN_FUNCTIONS.getMetrics, t1, t2);
712
704
  let t3;
705
+ if ($[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
706
+ t3 = {};
707
+ $[3] = t3;
708
+ } else {
709
+ t3 = $[3];
710
+ }
713
711
  let t4;
714
- if ($[2] !== client || $[3] !== initialShardKey) {
715
- t3 = () => {
716
- const shard = initialShardKey ?? "";
717
- const load = async () => {
718
- const [snapshot, stats, audit, subs, recent] = await Promise.allSettled([client.query(GET_METRICS, {}, callOptions(shard)), client.query(GET_FUNCTION_STATS, {}, callOptions(shard)), client.query(GET_SECURITY_AUDIT, {}, callOptions("")), client.query(LIST_SUBSCRIPTIONS, {}, callOptions(shard)), client.query(GET_AUDIT_LOG, {}, callOptions(shard))]);
719
- const snapshotValue = snapshot.status === "fulfilled" ? snapshot.value : null;
720
- const statFns = stats.status === "fulfilled" && Array.isArray(stats.value.functions) ? stats.value.functions : [];
721
- setMetrics(snapshotValue);
722
- setFunctions(statFns);
723
- setPerformanceCount(stats.status === "fulfilled" ? deriveInsights(snapshotValue, statFns).length : null);
724
- setSecurityCount(audit.status === "fulfilled" && Array.isArray(audit.value.findings) ? audit.value.findings.length : null);
725
- setSubscriptions(subs.status === "fulfilled" ? subs.value : null);
726
- setActivity(recent.status === "fulfilled" && Array.isArray(recent.value.entries) ? recent.value.entries : []);
727
- };
728
- fireAndForget(load());
712
+ if ($[4] !== shard) {
713
+ t4 = {
714
+ shardKey: shard
729
715
  };
730
- t4 = [client, initialShardKey];
731
- $[2] = client;
732
- $[3] = initialShardKey;
733
- $[4] = t3;
716
+ $[4] = shard;
734
717
  $[5] = t4;
735
718
  } else {
736
- t3 = $[4];
737
719
  t4 = $[5];
738
720
  }
739
- useEffect(t3, t4);
721
+ const statsQuery = useAdminQuery(ADMIN_FUNCTIONS.getFunctionStats, t3, t4);
740
722
  let t5;
741
- if ($[6] !== navigate) {
742
- t5 = () => {
743
- fireAndForget(navigate({
744
- to: "/security"
745
- }));
723
+ let t6;
724
+ if ($[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
725
+ t5 = {};
726
+ t6 = {
727
+ shardKey: ""
746
728
  };
747
- $[6] = navigate;
748
- $[7] = t5;
729
+ $[6] = t5;
730
+ $[7] = t6;
749
731
  } else {
750
- t5 = $[7];
732
+ t5 = $[6];
733
+ t6 = $[7];
751
734
  }
752
- const viewSecurity = t5;
753
- let t6;
754
- if ($[8] !== navigate) {
755
- t6 = () => {
756
- fireAndForget(navigate({
757
- to: "/insights"
758
- }));
735
+ const auditQuery = useAdminQuery(ADMIN_FUNCTIONS.getSecurityAudit, t5, t6);
736
+ let t7;
737
+ if ($[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
738
+ t7 = {};
739
+ $[8] = t7;
740
+ } else {
741
+ t7 = $[8];
742
+ }
743
+ let t8;
744
+ if ($[9] !== shard) {
745
+ t8 = {
746
+ shardKey: shard
759
747
  };
760
- $[8] = navigate;
761
- $[9] = t6;
748
+ $[9] = shard;
749
+ $[10] = t8;
762
750
  } else {
763
- t6 = $[9];
751
+ t8 = $[10];
752
+ }
753
+ const subscriptionsQuery = useAdminQuery(ADMIN_FUNCTIONS.listSubscriptions, t7, t8);
754
+ let t9;
755
+ if ($[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
756
+ t9 = {};
757
+ $[11] = t9;
758
+ } else {
759
+ t9 = $[11];
760
+ }
761
+ let t10;
762
+ if ($[12] !== shard) {
763
+ t10 = {
764
+ shardKey: shard
765
+ };
766
+ $[12] = shard;
767
+ $[13] = t10;
768
+ } else {
769
+ t10 = $[13];
764
770
  }
765
- const viewPerformance = t6;
771
+ const auditLogQuery = useAdminQuery(ADMIN_FUNCTIONS.getAuditLog, t9, t10);
772
+ const metrics = metricsQuery.data ?? null;
766
773
  let T0;
774
+ let activity;
767
775
  let cacheHitRate;
768
- let t10;
776
+ let functions;
777
+ let performanceCount;
778
+ let securityCount;
779
+ let subscriptions;
769
780
  let t11;
770
781
  let t12;
771
782
  let t13;
772
783
  let t14;
773
784
  let t15;
774
- let t7;
775
- let t8;
776
- let t9;
777
- if ($[10] !== functions || $[11] !== metrics?.cache || $[12] !== metrics?.errors || $[13] !== metrics?.history || $[14] !== metrics?.requests || $[15] !== t) {
785
+ let t16;
786
+ let t17;
787
+ let t18;
788
+ let t19;
789
+ let viewPerformance;
790
+ let viewSecurity;
791
+ if ($[14] !== auditLogQuery.data || $[15] !== auditQuery.data || $[16] !== metrics || $[17] !== metricsQuery.data || $[18] !== navigate || $[19] !== statsQuery.data || $[20] !== subscriptionsQuery.data || $[21] !== t) {
792
+ functions = Array.isArray(statsQuery.data?.functions) ? statsQuery.data.functions : [];
793
+ subscriptions = subscriptionsQuery.data ?? null;
794
+ let t202;
795
+ if ($[40] !== auditLogQuery.data) {
796
+ t202 = Array.isArray(auditLogQuery.data?.entries) ? auditLogQuery.data.entries : [];
797
+ $[40] = auditLogQuery.data;
798
+ $[41] = t202;
799
+ } else {
800
+ t202 = $[41];
801
+ }
802
+ activity = t202;
803
+ performanceCount = metricsQuery.data === void 0 || statsQuery.data === void 0 ? null : deriveInsights(metrics, functions).length;
804
+ securityCount = Array.isArray(auditQuery.data?.findings) ? auditQuery.data.findings.length : null;
805
+ let t212;
806
+ if ($[42] !== navigate) {
807
+ t212 = () => {
808
+ fireAndForget(navigate({
809
+ to: "/security"
810
+ }));
811
+ };
812
+ $[42] = navigate;
813
+ $[43] = t212;
814
+ } else {
815
+ t212 = $[43];
816
+ }
817
+ viewSecurity = t212;
818
+ let t222;
819
+ if ($[44] !== navigate) {
820
+ t222 = () => {
821
+ fireAndForget(navigate({
822
+ to: "/insights"
823
+ }));
824
+ };
825
+ $[44] = navigate;
826
+ $[45] = t222;
827
+ } else {
828
+ t222 = $[45];
829
+ }
830
+ viewPerformance = t222;
778
831
  const requestSeries = bucketSeries(metrics?.history, "calls");
779
832
  const errorSeries = bucketSeries(metrics?.history, "errors");
780
833
  const avgLatency = averageLatencyMs(functions);
781
- let t162;
782
- if ($[27] !== functions) {
783
- t162 = Math.max(0, ...functions.map(_temp4));
784
- $[27] = functions;
785
- $[28] = t162;
786
- } else {
787
- t162 = $[28];
788
- }
789
- const maxLatency = t162;
834
+ const maxLatency = Math.max(0, ...functions.map(_temp4));
790
835
  const cache = metrics?.cache;
791
- let t172;
792
- if ($[29] !== cache) {
793
- t172 = cache != null && cache.hits + cache.misses > 0 ? Math.round(cache.hits / (cache.hits + cache.misses) * 100) : null;
794
- $[29] = cache;
795
- $[30] = t172;
836
+ let t232;
837
+ if ($[46] !== cache) {
838
+ t232 = cache != null && cache.hits + cache.misses > 0 ? Math.round(cache.hits / (cache.hits + cache.misses) * 100) : null;
839
+ $[46] = cache;
840
+ $[47] = t232;
796
841
  } else {
797
- t172 = $[30];
842
+ t232 = $[47];
798
843
  }
799
- cacheHitRate = t172;
800
- t14 = "flex flex-col gap-6";
801
- t15 = "lunora-home";
802
- t10 = "grid gap-3 sm:grid-cols-2 xl:grid-cols-4";
803
- t11 = "home-health";
804
- const t182 = seriesDelta(requestSeries);
805
- let t192;
806
- if ($[31] !== t) {
807
- t192 = t("Requests");
808
- $[31] = t;
809
- $[32] = t192;
844
+ cacheHitRate = t232;
845
+ t18 = "flex flex-col gap-6";
846
+ t19 = "lunora-home";
847
+ t14 = "grid gap-3 sm:grid-cols-2 xl:grid-cols-4";
848
+ t15 = "home-health";
849
+ const t242 = seriesDelta(requestSeries);
850
+ let t252;
851
+ if ($[48] !== t) {
852
+ t252 = t("Requests");
853
+ $[48] = t;
854
+ $[49] = t252;
810
855
  } else {
811
- t192 = $[32];
856
+ t252 = $[49];
812
857
  }
813
- const t202 = metrics?.requests ?? 0;
814
- let t212;
815
- if ($[33] !== t202) {
816
- t212 = t202.toLocaleString();
817
- $[33] = t202;
818
- $[34] = t212;
858
+ const t262 = metrics?.requests ?? 0;
859
+ let t272;
860
+ if ($[50] !== t262) {
861
+ t272 = t262.toLocaleString();
862
+ $[50] = t262;
863
+ $[51] = t272;
819
864
  } else {
820
- t212 = $[34];
865
+ t272 = $[51];
821
866
  }
822
- if ($[35] !== requestSeries || $[36] !== t182 || $[37] !== t192 || $[38] !== t212) {
823
- t12 = /* @__PURE__ */ jsxDEV(StatCard, {
824
- delta: t182,
825
- label: t192,
867
+ if ($[52] !== requestSeries || $[53] !== t242 || $[54] !== t252 || $[55] !== t272) {
868
+ t16 = /* @__PURE__ */ jsxDEV(StatCard, {
869
+ delta: t242,
870
+ label: t252,
826
871
  trend: requestSeries,
827
- value: t212
872
+ value: t272
828
873
  }, void 0, false);
829
- $[35] = requestSeries;
830
- $[36] = t182;
831
- $[37] = t192;
832
- $[38] = t212;
833
- $[39] = t12;
874
+ $[52] = requestSeries;
875
+ $[53] = t242;
876
+ $[54] = t252;
877
+ $[55] = t272;
878
+ $[56] = t16;
834
879
  } else {
835
- t12 = $[39];
880
+ t16 = $[56];
836
881
  }
837
- const t222 = seriesDelta(errorSeries, false);
838
- let t232;
839
- if ($[40] !== t) {
840
- t232 = t("Errors");
841
- $[40] = t;
842
- $[41] = t232;
882
+ const t282 = seriesDelta(errorSeries, false);
883
+ let t292;
884
+ if ($[57] !== t) {
885
+ t292 = t("Errors");
886
+ $[57] = t;
887
+ $[58] = t292;
843
888
  } else {
844
- t232 = $[41];
889
+ t292 = $[58];
845
890
  }
846
- const t242 = metrics?.errors ?? 0;
847
- let t252;
848
- if ($[42] !== t242) {
849
- t252 = t242.toLocaleString();
850
- $[42] = t242;
851
- $[43] = t252;
891
+ const t302 = metrics?.errors ?? 0;
892
+ let t312;
893
+ if ($[59] !== t302) {
894
+ t312 = t302.toLocaleString();
895
+ $[59] = t302;
896
+ $[60] = t312;
852
897
  } else {
853
- t252 = $[43];
898
+ t312 = $[60];
854
899
  }
855
- if ($[44] !== errorSeries || $[45] !== t222 || $[46] !== t232 || $[47] !== t252) {
856
- t13 = /* @__PURE__ */ jsxDEV(StatCard, {
857
- delta: t222,
858
- label: t232,
900
+ if ($[61] !== errorSeries || $[62] !== t282 || $[63] !== t292 || $[64] !== t312) {
901
+ t17 = /* @__PURE__ */ jsxDEV(StatCard, {
902
+ delta: t282,
903
+ label: t292,
859
904
  trend: errorSeries,
860
- value: t252
905
+ value: t312
861
906
  }, void 0, false);
862
- $[44] = errorSeries;
863
- $[45] = t222;
864
- $[46] = t232;
865
- $[47] = t252;
866
- $[48] = t13;
907
+ $[61] = errorSeries;
908
+ $[62] = t282;
909
+ $[63] = t292;
910
+ $[64] = t312;
911
+ $[65] = t17;
867
912
  } else {
868
- t13 = $[48];
913
+ t17 = $[65];
869
914
  }
870
915
  T0 = StatCard;
871
- if ($[49] !== maxLatency || $[50] !== t) {
872
- t7 = maxLatency > 0 ? `${t("max")} ${formatMs(maxLatency)}` : void 0;
873
- $[49] = maxLatency;
874
- $[50] = t;
875
- $[51] = t7;
916
+ if ($[66] !== maxLatency || $[67] !== t) {
917
+ t11 = maxLatency > 0 ? `${t("max")} ${formatMs(maxLatency)}` : void 0;
918
+ $[66] = maxLatency;
919
+ $[67] = t;
920
+ $[68] = t11;
876
921
  } else {
877
- t7 = $[51];
922
+ t11 = $[68];
878
923
  }
879
- if ($[52] !== t) {
880
- t8 = t("Avg latency");
881
- $[52] = t;
882
- $[53] = t8;
924
+ if ($[69] !== t) {
925
+ t12 = t("Avg latency");
926
+ $[69] = t;
927
+ $[70] = t12;
883
928
  } else {
884
- t8 = $[53];
929
+ t12 = $[70];
885
930
  }
886
- t9 = avgLatency === null ? "—" : formatMs(avgLatency);
887
- $[10] = functions;
888
- $[11] = metrics?.cache;
889
- $[12] = metrics?.errors;
890
- $[13] = metrics?.history;
891
- $[14] = metrics?.requests;
892
- $[15] = t;
893
- $[16] = T0;
894
- $[17] = cacheHitRate;
895
- $[18] = t10;
896
- $[19] = t11;
897
- $[20] = t12;
898
- $[21] = t13;
899
- $[22] = t14;
900
- $[23] = t15;
901
- $[24] = t7;
902
- $[25] = t8;
903
- $[26] = t9;
904
- } else {
905
- T0 = $[16];
906
- cacheHitRate = $[17];
907
- t10 = $[18];
908
- t11 = $[19];
909
- t12 = $[20];
910
- t13 = $[21];
911
- t14 = $[22];
912
- t15 = $[23];
913
- t7 = $[24];
914
- t8 = $[25];
915
- t9 = $[26];
931
+ t13 = avgLatency === null ? "—" : formatMs(avgLatency);
932
+ $[14] = auditLogQuery.data;
933
+ $[15] = auditQuery.data;
934
+ $[16] = metrics;
935
+ $[17] = metricsQuery.data;
936
+ $[18] = navigate;
937
+ $[19] = statsQuery.data;
938
+ $[20] = subscriptionsQuery.data;
939
+ $[21] = t;
940
+ $[22] = T0;
941
+ $[23] = activity;
942
+ $[24] = cacheHitRate;
943
+ $[25] = functions;
944
+ $[26] = performanceCount;
945
+ $[27] = securityCount;
946
+ $[28] = subscriptions;
947
+ $[29] = t11;
948
+ $[30] = t12;
949
+ $[31] = t13;
950
+ $[32] = t14;
951
+ $[33] = t15;
952
+ $[34] = t16;
953
+ $[35] = t17;
954
+ $[36] = t18;
955
+ $[37] = t19;
956
+ $[38] = viewPerformance;
957
+ $[39] = viewSecurity;
958
+ } else {
959
+ T0 = $[22];
960
+ activity = $[23];
961
+ cacheHitRate = $[24];
962
+ functions = $[25];
963
+ performanceCount = $[26];
964
+ securityCount = $[27];
965
+ subscriptions = $[28];
966
+ t11 = $[29];
967
+ t12 = $[30];
968
+ t13 = $[31];
969
+ t14 = $[32];
970
+ t15 = $[33];
971
+ t16 = $[34];
972
+ t17 = $[35];
973
+ t18 = $[36];
974
+ t19 = $[37];
975
+ viewPerformance = $[38];
976
+ viewSecurity = $[39];
916
977
  }
917
- let t16;
918
- if ($[54] !== T0 || $[55] !== t7 || $[56] !== t8 || $[57] !== t9) {
919
- t16 = /* @__PURE__ */ jsxDEV(T0, {
920
- footer: t7,
921
- label: t8,
922
- value: t9
978
+ let t20;
979
+ if ($[71] !== T0 || $[72] !== t11 || $[73] !== t12 || $[74] !== t13) {
980
+ t20 = /* @__PURE__ */ jsxDEV(T0, {
981
+ footer: t11,
982
+ label: t12,
983
+ value: t13
923
984
  }, void 0, false);
924
- $[54] = T0;
925
- $[55] = t7;
926
- $[56] = t8;
927
- $[57] = t9;
928
- $[58] = t16;
985
+ $[71] = T0;
986
+ $[72] = t11;
987
+ $[73] = t12;
988
+ $[74] = t13;
989
+ $[75] = t20;
929
990
  } else {
930
- t16 = $[58];
991
+ t20 = $[75];
931
992
  }
932
- let t17;
933
- if ($[59] !== cacheHitRate || $[60] !== t) {
934
- t17 = cacheHitRate === null ? void 0 : `${String(cacheHitRate)}% ${t("cache hit")}`;
935
- $[59] = cacheHitRate;
936
- $[60] = t;
937
- $[61] = t17;
993
+ let t21;
994
+ if ($[76] !== cacheHitRate || $[77] !== t) {
995
+ t21 = cacheHitRate === null ? void 0 : `${String(cacheHitRate)}% ${t("cache hit")}`;
996
+ $[76] = cacheHitRate;
997
+ $[77] = t;
998
+ $[78] = t21;
938
999
  } else {
939
- t17 = $[61];
1000
+ t21 = $[78];
940
1001
  }
941
- let t18;
942
- if ($[62] !== t) {
943
- t18 = t("Database size");
944
- $[62] = t;
945
- $[63] = t18;
1002
+ let t22;
1003
+ if ($[79] !== t) {
1004
+ t22 = t("Database size");
1005
+ $[79] = t;
1006
+ $[80] = t22;
946
1007
  } else {
947
- t18 = $[63];
1008
+ t22 = $[80];
948
1009
  }
949
- const t19 = metrics?.databaseSize ?? null;
950
- let t20;
951
- if ($[64] !== t19) {
952
- t20 = formatBytes(t19);
953
- $[64] = t19;
954
- $[65] = t20;
1010
+ const t23 = metrics?.databaseSize ?? null;
1011
+ let t24;
1012
+ if ($[81] !== t23) {
1013
+ t24 = formatBytes(t23);
1014
+ $[81] = t23;
1015
+ $[82] = t24;
955
1016
  } else {
956
- t20 = $[65];
1017
+ t24 = $[82];
957
1018
  }
958
- let t21;
959
- if ($[66] !== t17 || $[67] !== t18 || $[68] !== t20) {
960
- t21 = /* @__PURE__ */ jsxDEV(StatCard, {
961
- footer: t17,
962
- label: t18,
963
- value: t20
1019
+ let t25;
1020
+ if ($[83] !== t21 || $[84] !== t22 || $[85] !== t24) {
1021
+ t25 = /* @__PURE__ */ jsxDEV(StatCard, {
1022
+ footer: t21,
1023
+ label: t22,
1024
+ value: t24
964
1025
  }, void 0, false);
965
- $[66] = t17;
966
- $[67] = t18;
967
- $[68] = t20;
968
- $[69] = t21;
1026
+ $[83] = t21;
1027
+ $[84] = t22;
1028
+ $[85] = t24;
1029
+ $[86] = t25;
969
1030
  } else {
970
- t21 = $[69];
1031
+ t25 = $[86];
971
1032
  }
972
- let t22;
973
- if ($[70] !== t10 || $[71] !== t11 || $[72] !== t12 || $[73] !== t13 || $[74] !== t16 || $[75] !== t21) {
974
- t22 = /* @__PURE__ */ jsxDEV("div", {
975
- className: t10,
976
- "data-testid": t11,
977
- children: [t12, t13, t16, t21]
1033
+ let t26;
1034
+ if ($[87] !== t14 || $[88] !== t15 || $[89] !== t16 || $[90] !== t17 || $[91] !== t20 || $[92] !== t25) {
1035
+ t26 = /* @__PURE__ */ jsxDEV("div", {
1036
+ className: t14,
1037
+ "data-testid": t15,
1038
+ children: [t16, t17, t20, t25]
978
1039
  }, void 0, true);
979
- $[70] = t10;
980
- $[71] = t11;
981
- $[72] = t12;
982
- $[73] = t13;
983
- $[74] = t16;
984
- $[75] = t21;
985
- $[76] = t22;
986
- } else {
987
- t22 = $[76];
988
- }
989
- let t23;
990
- if ($[77] !== functions) {
991
- t23 = /* @__PURE__ */ jsxDEV("div", {
1040
+ $[87] = t14;
1041
+ $[88] = t15;
1042
+ $[89] = t16;
1043
+ $[90] = t17;
1044
+ $[91] = t20;
1045
+ $[92] = t25;
1046
+ $[93] = t26;
1047
+ } else {
1048
+ t26 = $[93];
1049
+ }
1050
+ let t27;
1051
+ if ($[94] !== functions) {
1052
+ t27 = /* @__PURE__ */ jsxDEV("div", {
992
1053
  className: "lg:col-span-2",
993
1054
  children: /* @__PURE__ */ jsxDEV(TopFunctionsCard, {
994
1055
  functions
995
1056
  }, void 0, false)
996
1057
  }, void 0, false);
997
- $[77] = functions;
998
- $[78] = t23;
1058
+ $[94] = functions;
1059
+ $[95] = t27;
999
1060
  } else {
1000
- t23 = $[78];
1061
+ t27 = $[95];
1001
1062
  }
1002
- let t24;
1003
- if ($[79] !== subscriptions) {
1004
- t24 = /* @__PURE__ */ jsxDEV(LiveConnectionsCard, {
1063
+ let t28;
1064
+ if ($[96] !== subscriptions) {
1065
+ t28 = /* @__PURE__ */ jsxDEV(LiveConnectionsCard, {
1005
1066
  subs: subscriptions
1006
1067
  }, void 0, false);
1007
- $[79] = subscriptions;
1008
- $[80] = t24;
1068
+ $[96] = subscriptions;
1069
+ $[97] = t28;
1009
1070
  } else {
1010
- t24 = $[80];
1071
+ t28 = $[97];
1011
1072
  }
1012
- let t25;
1013
- if ($[81] !== activity) {
1014
- t25 = /* @__PURE__ */ jsxDEV(RecentActivityCard, {
1073
+ let t29;
1074
+ if ($[98] !== activity) {
1075
+ t29 = /* @__PURE__ */ jsxDEV(RecentActivityCard, {
1015
1076
  entries: activity
1016
1077
  }, void 0, false);
1017
- $[81] = activity;
1018
- $[82] = t25;
1078
+ $[98] = activity;
1079
+ $[99] = t29;
1019
1080
  } else {
1020
- t25 = $[82];
1081
+ t29 = $[99];
1021
1082
  }
1022
- let t26;
1023
- if ($[83] !== t24 || $[84] !== t25) {
1024
- t26 = /* @__PURE__ */ jsxDEV("div", {
1083
+ let t30;
1084
+ if ($[100] !== t28 || $[101] !== t29) {
1085
+ t30 = /* @__PURE__ */ jsxDEV("div", {
1025
1086
  className: "flex flex-col gap-3",
1026
- children: [t24, t25]
1087
+ children: [t28, t29]
1027
1088
  }, void 0, true);
1028
- $[83] = t24;
1029
- $[84] = t25;
1030
- $[85] = t26;
1089
+ $[100] = t28;
1090
+ $[101] = t29;
1091
+ $[102] = t30;
1031
1092
  } else {
1032
- t26 = $[85];
1093
+ t30 = $[102];
1033
1094
  }
1034
- let t27;
1035
- if ($[86] !== t23 || $[87] !== t26) {
1036
- t27 = /* @__PURE__ */ jsxDEV("div", {
1095
+ let t31;
1096
+ if ($[103] !== t27 || $[104] !== t30) {
1097
+ t31 = /* @__PURE__ */ jsxDEV("div", {
1037
1098
  className: "grid gap-3 lg:grid-cols-3",
1038
- children: [t23, t26]
1099
+ children: [t27, t30]
1039
1100
  }, void 0, true);
1040
- $[86] = t23;
1041
- $[87] = t26;
1042
- $[88] = t27;
1101
+ $[103] = t27;
1102
+ $[104] = t30;
1103
+ $[105] = t31;
1043
1104
  } else {
1044
- t27 = $[88];
1105
+ t31 = $[105];
1045
1106
  }
1046
- let t28;
1047
- if ($[89] !== t) {
1048
- t28 = t("Advisors");
1049
- $[89] = t;
1050
- $[90] = t28;
1107
+ let t32;
1108
+ if ($[106] !== t) {
1109
+ t32 = t("Advisors");
1110
+ $[106] = t;
1111
+ $[107] = t32;
1051
1112
  } else {
1052
- t28 = $[90];
1113
+ t32 = $[107];
1053
1114
  }
1054
- let t29;
1055
- if ($[91] !== t28) {
1056
- t29 = /* @__PURE__ */ jsxDEV("h2", {
1115
+ let t33;
1116
+ if ($[108] !== t32) {
1117
+ t33 = /* @__PURE__ */ jsxDEV("h2", {
1057
1118
  className: "text-sm font-semibold tracking-tight text-foreground",
1058
- children: t28
1119
+ children: t32
1059
1120
  }, void 0, false);
1060
- $[91] = t28;
1061
- $[92] = t29;
1121
+ $[108] = t32;
1122
+ $[109] = t33;
1062
1123
  } else {
1063
- t29 = $[92];
1124
+ t33 = $[109];
1064
1125
  }
1065
- let t30;
1066
- if ($[93] !== performanceCount || $[94] !== securityCount || $[95] !== t || $[96] !== viewPerformance || $[97] !== viewSecurity) {
1067
- t30 = securityCount === 0 && performanceCount === 0 ? /* @__PURE__ */ jsxDEV(EmptyState, {
1126
+ let t34;
1127
+ if ($[110] !== performanceCount || $[111] !== securityCount || $[112] !== t || $[113] !== viewPerformance || $[114] !== viewSecurity) {
1128
+ t34 = securityCount === 0 && performanceCount === 0 ? /* @__PURE__ */ jsxDEV(EmptyState, {
1068
1129
  description: t("No security or performance issues detected."),
1069
1130
  icon: /* @__PURE__ */ jsxDEV("svg", {
1070
1131
  "aria-hidden": "true",
@@ -1096,148 +1157,148 @@ const HomePanel = (t0) => {
1096
1157
  title: t("Performance issues")
1097
1158
  }, void 0, false)]
1098
1159
  }, void 0, true);
1099
- $[93] = performanceCount;
1100
- $[94] = securityCount;
1101
- $[95] = t;
1102
- $[96] = viewPerformance;
1103
- $[97] = viewSecurity;
1104
- $[98] = t30;
1160
+ $[110] = performanceCount;
1161
+ $[111] = securityCount;
1162
+ $[112] = t;
1163
+ $[113] = viewPerformance;
1164
+ $[114] = viewSecurity;
1165
+ $[115] = t34;
1105
1166
  } else {
1106
- t30 = $[98];
1167
+ t34 = $[115];
1107
1168
  }
1108
- let t31;
1109
- if ($[99] !== t29 || $[100] !== t30) {
1110
- t31 = /* @__PURE__ */ jsxDEV("section", {
1169
+ let t35;
1170
+ if ($[116] !== t33 || $[117] !== t34) {
1171
+ t35 = /* @__PURE__ */ jsxDEV("section", {
1111
1172
  className: "flex flex-col gap-3",
1112
1173
  "data-testid": "home-advisors",
1113
- children: [t29, t30]
1174
+ children: [t33, t34]
1114
1175
  }, void 0, true);
1115
- $[99] = t29;
1116
- $[100] = t30;
1117
- $[101] = t31;
1176
+ $[116] = t33;
1177
+ $[117] = t34;
1178
+ $[118] = t35;
1118
1179
  } else {
1119
- t31 = $[101];
1180
+ t35 = $[118];
1120
1181
  }
1121
- let t32;
1122
- if ($[102] !== t) {
1123
- t32 = t("Get connected");
1124
- $[102] = t;
1125
- $[103] = t32;
1182
+ let t36;
1183
+ if ($[119] !== t) {
1184
+ t36 = t("Get connected");
1185
+ $[119] = t;
1186
+ $[120] = t36;
1126
1187
  } else {
1127
- t32 = $[103];
1188
+ t36 = $[120];
1128
1189
  }
1129
- let t33;
1130
- if ($[104] !== t32) {
1131
- t33 = /* @__PURE__ */ jsxDEV("h2", {
1190
+ let t37;
1191
+ if ($[121] !== t36) {
1192
+ t37 = /* @__PURE__ */ jsxDEV("h2", {
1132
1193
  className: "text-sm font-semibold tracking-tight text-foreground",
1133
- children: t32
1194
+ children: t36
1134
1195
  }, void 0, false);
1135
- $[104] = t32;
1136
- $[105] = t33;
1196
+ $[121] = t36;
1197
+ $[122] = t37;
1137
1198
  } else {
1138
- t33 = $[105];
1199
+ t37 = $[122];
1139
1200
  }
1140
- let t34;
1141
- if ($[106] !== t) {
1142
- t34 = t("Client SDK");
1143
- $[106] = t;
1144
- $[107] = t34;
1201
+ let t38;
1202
+ if ($[123] !== t) {
1203
+ t38 = t("Client SDK");
1204
+ $[123] = t;
1205
+ $[124] = t38;
1145
1206
  } else {
1146
- t34 = $[107];
1207
+ t38 = $[124];
1147
1208
  }
1148
- let t35;
1149
- if ($[108] !== t34) {
1150
- t35 = /* @__PURE__ */ jsxDEV(ConnectCard, {
1209
+ let t39;
1210
+ if ($[125] !== t38) {
1211
+ t39 = /* @__PURE__ */ jsxDEV(ConnectCard, {
1151
1212
  command: "npm i @lunora/client",
1152
- label: t34
1213
+ label: t38
1153
1214
  }, void 0, false);
1154
- $[108] = t34;
1155
- $[109] = t35;
1215
+ $[125] = t38;
1216
+ $[126] = t39;
1156
1217
  } else {
1157
- t35 = $[109];
1218
+ t39 = $[126];
1158
1219
  }
1159
- let t36;
1160
- if ($[110] !== t) {
1161
- t36 = t("React");
1162
- $[110] = t;
1163
- $[111] = t36;
1220
+ let t40;
1221
+ if ($[127] !== t) {
1222
+ t40 = t("React");
1223
+ $[127] = t;
1224
+ $[128] = t40;
1164
1225
  } else {
1165
- t36 = $[111];
1226
+ t40 = $[128];
1166
1227
  }
1167
- let t37;
1168
- if ($[112] !== t36) {
1169
- t37 = /* @__PURE__ */ jsxDEV(ConnectCard, {
1228
+ let t41;
1229
+ if ($[129] !== t40) {
1230
+ t41 = /* @__PURE__ */ jsxDEV(ConnectCard, {
1170
1231
  command: "npm i @lunora/react",
1171
- label: t36
1232
+ label: t40
1172
1233
  }, void 0, false);
1173
- $[112] = t36;
1174
- $[113] = t37;
1234
+ $[129] = t40;
1235
+ $[130] = t41;
1175
1236
  } else {
1176
- t37 = $[113];
1237
+ t41 = $[130];
1177
1238
  }
1178
- let t38;
1179
- if ($[114] !== t) {
1180
- t38 = t("CLI");
1181
- $[114] = t;
1182
- $[115] = t38;
1239
+ let t42;
1240
+ if ($[131] !== t) {
1241
+ t42 = t("CLI");
1242
+ $[131] = t;
1243
+ $[132] = t42;
1183
1244
  } else {
1184
- t38 = $[115];
1245
+ t42 = $[132];
1185
1246
  }
1186
- let t39;
1187
- if ($[116] !== t38) {
1188
- t39 = /* @__PURE__ */ jsxDEV(ConnectCard, {
1247
+ let t43;
1248
+ if ($[133] !== t42) {
1249
+ t43 = /* @__PURE__ */ jsxDEV(ConnectCard, {
1189
1250
  command: "lunora dev",
1190
- label: t38
1251
+ label: t42
1191
1252
  }, void 0, false);
1192
- $[116] = t38;
1193
- $[117] = t39;
1253
+ $[133] = t42;
1254
+ $[134] = t43;
1194
1255
  } else {
1195
- t39 = $[117];
1256
+ t43 = $[134];
1196
1257
  }
1197
- let t40;
1198
- if ($[118] !== t35 || $[119] !== t37 || $[120] !== t39) {
1199
- t40 = /* @__PURE__ */ jsxDEV("div", {
1258
+ let t44;
1259
+ if ($[135] !== t39 || $[136] !== t41 || $[137] !== t43) {
1260
+ t44 = /* @__PURE__ */ jsxDEV("div", {
1200
1261
  className: "grid gap-3 sm:grid-cols-3",
1201
- children: [t35, t37, t39]
1262
+ children: [t39, t41, t43]
1202
1263
  }, void 0, true);
1203
- $[118] = t35;
1204
- $[119] = t37;
1205
- $[120] = t39;
1206
- $[121] = t40;
1264
+ $[135] = t39;
1265
+ $[136] = t41;
1266
+ $[137] = t43;
1267
+ $[138] = t44;
1207
1268
  } else {
1208
- t40 = $[121];
1269
+ t44 = $[138];
1209
1270
  }
1210
- let t41;
1211
- if ($[122] !== t33 || $[123] !== t40) {
1212
- t41 = /* @__PURE__ */ jsxDEV("section", {
1271
+ let t45;
1272
+ if ($[139] !== t37 || $[140] !== t44) {
1273
+ t45 = /* @__PURE__ */ jsxDEV("section", {
1213
1274
  className: "flex flex-col gap-3",
1214
1275
  "data-testid": "home-get-connected",
1215
- children: [t33, t40]
1276
+ children: [t37, t44]
1216
1277
  }, void 0, true);
1217
- $[122] = t33;
1218
- $[123] = t40;
1219
- $[124] = t41;
1220
- } else {
1221
- t41 = $[124];
1222
- }
1223
- let t42;
1224
- if ($[125] !== t14 || $[126] !== t15 || $[127] !== t22 || $[128] !== t27 || $[129] !== t31 || $[130] !== t41) {
1225
- t42 = /* @__PURE__ */ jsxDEV("div", {
1226
- className: t14,
1227
- "data-testid": t15,
1228
- children: [t22, t27, t31, t41]
1278
+ $[139] = t37;
1279
+ $[140] = t44;
1280
+ $[141] = t45;
1281
+ } else {
1282
+ t45 = $[141];
1283
+ }
1284
+ let t46;
1285
+ if ($[142] !== t18 || $[143] !== t19 || $[144] !== t26 || $[145] !== t31 || $[146] !== t35 || $[147] !== t45) {
1286
+ t46 = /* @__PURE__ */ jsxDEV("div", {
1287
+ className: t18,
1288
+ "data-testid": t19,
1289
+ children: [t26, t31, t35, t45]
1229
1290
  }, void 0, true);
1230
- $[125] = t14;
1231
- $[126] = t15;
1232
- $[127] = t22;
1233
- $[128] = t27;
1234
- $[129] = t31;
1235
- $[130] = t41;
1236
- $[131] = t42;
1291
+ $[142] = t18;
1292
+ $[143] = t19;
1293
+ $[144] = t26;
1294
+ $[145] = t31;
1295
+ $[146] = t35;
1296
+ $[147] = t45;
1297
+ $[148] = t46;
1237
1298
  } else {
1238
- t42 = $[131];
1299
+ t46 = $[148];
1239
1300
  }
1240
- return t42;
1301
+ return t46;
1241
1302
  };
1242
1303
  function _temp(value, index) {
1243
1304
  return {