@lunora/studio 1.0.0-alpha.1 → 1.0.0-alpha.11

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 +21 -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-DjXgvJb6.js} +1 -0
  7. package/dist/packem_shared/{ApiDocsPanel-DpRjJhG5.js → ApiDocsPanel-yVSGHK3H.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-rwttyQ1-.js} +4 -4
  10. package/dist/packem_shared/{AuditPanel-BC59Nhst.js → AuditPanel-SRilxyg0.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-B4v_9GiU.js} +182 -249
  16. package/dist/packem_shared/{ExportImportPanel-WO34fJxy.js → ExportImportPanel-NtZVqbOj.js} +9 -5
  17. package/dist/packem_shared/{FileBrowser-Zcr-Qgxo.js → FileBrowser-0pCpdKPE.js} +7 -7
  18. package/dist/packem_shared/{FunctionRunner-j0Rd5m9t.js → FunctionRunner-7NH3KcTg.js} +4 -4
  19. package/dist/packem_shared/{FunctionStatsPanel-DboBl-XL.js → FunctionStatsPanel-n-6FrbOH.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-Dpr6KTmV.js} +31 -23
  22. package/dist/packem_shared/{HomePanel-bdOCNA-p.js → HomePanel-CpFLsa64.js} +450 -389
  23. package/dist/packem_shared/{InsightsPanel-DaZPnSgt.js → InsightsPanel-BchgeeRx.js} +104 -66
  24. package/dist/packem_shared/{LogsPanel-CWdqAGpQ.js → LogsPanel-DsPnKZ95.js} +35 -47
  25. package/dist/packem_shared/{MailPanel-D_EGtDnS.js → MailPanel-Bmg781UW.js} +31 -38
  26. package/dist/packem_shared/{MetricsPanel-E4Gv6wTO.js → MetricsPanel-DaE8ZXrf.js} +34 -48
  27. package/dist/packem_shared/{MigrationsPanel-DQdPY9io.js → MigrationsPanel-CaUpce-G.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-LJGNP_IX.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-Bam6ylvw.js} +4 -4
  32. package/dist/packem_shared/{SecurityAdvisorPanel-Cdm2IxLW.js → SecurityAdvisorPanel-PAx712Bd.js} +44 -31
  33. package/dist/packem_shared/SettingsPanel-C4tufQD5.js +390 -0
  34. package/dist/packem_shared/{ShardInput-DNCsT1KW.js → ShardInput-gx_DZXXn.js} +1 -1
  35. package/dist/packem_shared/SqlEditorPanel-D5wMIxcg.js +13 -0
  36. package/dist/packem_shared/Studio-BFg10lBc.js +33 -0
  37. package/dist/packem_shared/{StudioApp-dvywkJ8I.js → StudioApp-g8j3V6vA.js} +278 -4
  38. package/dist/packem_shared/{StudioI18nProvider-Dcajsznk.js → StudioI18nProvider-B-tDCZIi.js} +1 -1
  39. package/dist/packem_shared/TableEditor-0TYRqi6t.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-Nbhpihxv.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-Smfl_FDF.js} +6 -6
  49. package/dist/packem_shared/{studio-BDVd7rIV.js → studio-DRWW__L9.js} +2150 -1602
  50. package/dist/packem_shared/{TableEditor-DIVDk3vT.js → table-editor-CiyJi0Nm.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 +184 -162
  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
@@ -2,11 +2,11 @@
2
2
  import { c } from 'react/compiler-runtime';
3
3
  import { createRootRoute, createRoute, createBrowserHistory, createMemoryHistory, createRouter, useNavigate, useRouterState, useSearch, Outlet, RouterProvider } from '@tanstack/react-router';
4
4
  import * as React from 'react';
5
- import { useState, useEffect, createContext, use, useMemo, useRef, useCallback } from 'react';
5
+ import { useState, useEffect, createContext, use, useMemo, useCallback, useRef } from 'react';
6
6
  import { c as cn } from './utils-B05Dmz_H.js';
7
7
  import { jsxDEV, Fragment } from 'react/jsx-dev-runtime';
8
8
  import { ErrorBoundary } from './ErrorBoundary-BzAApI7J.js';
9
- import { useT } from './createStudioI18n-CgvlmDkN.js';
9
+ import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
10
10
  import { motion } from 'motion/react';
11
11
  import { B as Badge } from './badge-B2PKA1-5.js';
12
12
  import { I as Input } from './input-XH4r1Pt1.js';
@@ -19,46 +19,46 @@ import { cva } from 'class-variance-authority';
19
19
  import { B as Button } from './button-BhsN2uZH.js';
20
20
  import { Dialog } from '@base-ui/react/dialog';
21
21
  import { Tooltip as Tooltip$1 } from '@base-ui/react/tooltip';
22
- import { S as Skeleton } from './reference-view-BCKIoai7.js';
23
- import { InsightsPanel } from './InsightsPanel-DaZPnSgt.js';
24
- import { useLunora } from '@lunora/react';
25
- import { C as Card, a as CardContent, b as CardHeader, c as CardTitle, d as CardDescription } from './card-DURq3ElK.js';
22
+ import { S as Skeleton } from './reference-view-B4E49Lip.js';
23
+ import { InsightsPanel } from './InsightsPanel-BchgeeRx.js';
24
+ import { a as CardContent, C as Card, b as CardHeader, c as CardTitle, d as CardDescription } from './card-DURq3ElK.js';
26
25
  import { E as EmptyState } from './empty-state-DY_oe0k6.js';
27
26
  import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell } from './table-_RzNvy3R.js';
28
- import { ADMIN_FUNCTIONS } from './ADMIN_FUNCTION_PREFIX-DmBqMZ-z.js';
29
- import { f as fireAndForget, c as callOptions, e as errorMessage, a as adminRef, h as formatCell, d as formatTimestamp, b as copyToClipboard } from './internal-BBZYexre.js';
30
- import SecurityAdvisorPanel from './SecurityAdvisorPanel-Cdm2IxLW.js';
31
- import { createAnalyticsSqlClient } from '@lunora/analytics';
32
- import ApiTab from './ApiTab-DURGU15e.js';
27
+ import { u as useAdminQuery, b as useClientQuery } from './use-admin-query-BkbdNFNz.js';
28
+ import { ADMIN_FUNCTIONS } from './ADMIN_FUNCTIONS-DjXgvJb6.js';
29
+ import SecurityAdvisorPanel from './SecurityAdvisorPanel-PAx712Bd.js';
30
+ import { createAnalyticsSqlClient } from '@lunora/bindings/analytics';
31
+ import { e as errorMessage, f as fireAndForget, h as formatCell, b as formatTimestamp, g as copyToClipboard, c as callOptions, a as adminRef } from './internal-rXJEAhXS.js';
32
+ import ApiTab from './ApiTab-rwttyQ1-.js';
33
+ import { useLunora } from '@lunora/react';
33
34
  import { useAutoRefresh } from './DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js';
34
35
  import useDebounced from './useDebounced-Dxncpg6z.js';
35
36
  import { L as Label } from './label-D8ykjn5J.js';
36
- import { M as ModalShell } from './grid-features-DTjG6Sex.js';
37
- import { TableEditor } from './TableEditor-DIVDk3vT.js';
38
- import { ExportImportPanel } from './ExportImportPanel-WO34fJxy.js';
39
- import { MigrationsPanel } from './MigrationsPanel-DQdPY9io.js';
40
- import { PitrPanel } from './PitrPanel-BbBkQR6t.js';
41
- import { FunctionRunner } from './FunctionRunner-j0Rd5m9t.js';
42
- import { FunctionStatsPanel } from './FunctionStatsPanel-DboBl-XL.js';
43
- import { HomePanel } from './HomePanel-bdOCNA-p.js';
44
- import { AuditPanel } from './AuditPanel-BC59Nhst.js';
45
- import { a as CLOUDFLARE_OBSERVABILITY_URL } from './cf-links-BZfRdxSE.js';
46
- import { LogsPanel } from './LogsPanel-CWdqAGpQ.js';
47
- import { MailPanel } from './MailPanel-D_EGtDnS.js';
48
- import { ConfirmButton } from './ConfirmButton-WQVUoGFb.js';
49
- import { ScheduledJobs } from './ScheduledJobs-Ok1CYYwI.js';
50
- import { ShardInput } from './ShardInput-DNCsT1KW.js';
51
- import { L as LiveError } from './live-status-bPff1O7Y.js';
52
- import { u as useLiveAdmin } from './use-live-admin-D1h1Fzsd.js';
37
+ import { M as ModalShell } from './grid-features-CzUfqgsM.js';
38
+ import { v as validateDataViewSearch, T as TableEditor } from './table-editor-CiyJi0Nm.js';
39
+ import { ExportImportPanel } from './ExportImportPanel-NtZVqbOj.js';
40
+ import { MigrationsPanel } from './MigrationsPanel-CaUpce-G.js';
41
+ import { PitrPanel } from './PitrPanel-LJGNP_IX.js';
42
+ import { FunctionRunner } from './FunctionRunner-7NH3KcTg.js';
43
+ import { FunctionStatsPanel } from './FunctionStatsPanel-n-6FrbOH.js';
44
+ import { HomePanel } from './HomePanel-CpFLsa64.js';
45
+ import { AuditPanel } from './AuditPanel-SRilxyg0.js';
46
+ import { C as CLOUDFLARE_OBSERVABILITY_URL } from './cf-links-2cktDedA.js';
47
+ import { LogsPanel } from './LogsPanel-DsPnKZ95.js';
48
+ import { MailPanel } from './MailPanel-Bmg781UW.js';
49
+ import { ConfirmButton } from './ConfirmButton-C2eVi2Qv.js';
50
+ import { ScheduledJobs } from './ScheduledJobs-BWNwIN3I.js';
51
+ import { ShardInput } from './ShardInput-gx_DZXXn.js';
52
+ import { L as LiveError } from './live-status-FZ0psC1z.js';
53
53
  import { T as Textarea } from './textarea-D3gaCU_-.js';
54
- import { u as usePersistedList, A as Alert, a as SqlResultChart, n as newId, S as SqlEditorPanel } from './sql-editor-panel-CW2y2x9h.js';
55
- import { HealthPanel } from './HealthPanel-DOIgbUtx.js';
56
- import { MetricsPanel } from './MetricsPanel-E4Gv6wTO.js';
57
- import { SchemaViewer } from './SchemaViewer-D8XGnp-X.js';
58
- import { SettingsPanel } from './SettingsPanel-D3WF2mBU.js';
59
- import { FileBrowser } from './FileBrowser-Zcr-Qgxo.js';
60
- import { StudioI18nProvider } from './StudioI18nProvider-Dcajsznk.js';
61
- import { CommandPalette, openCommandPalette } from './CommandPalette-Dx_CoB9i.js';
54
+ import { u as usePersistedList, A as Alert, a as SqlResultChart, n as newId, S as SqlEditorPanel } from './sql-editor-panel-Smfl_FDF.js';
55
+ import { HealthPanel } from './HealthPanel-Dpr6KTmV.js';
56
+ import { MetricsPanel } from './MetricsPanel-DaE8ZXrf.js';
57
+ import { SchemaViewer } from './SchemaViewer-Bam6ylvw.js';
58
+ import { SettingsPanel } from './SettingsPanel-C4tufQD5.js';
59
+ import { FileBrowser } from './FileBrowser-0pCpdKPE.js';
60
+ import { StudioI18nProvider } from './StudioI18nProvider-B-tDCZIi.js';
61
+ import { CommandPalette, openCommandPalette } from './CommandPalette-BtgkBzZI.js';
62
62
 
63
63
  const DARK_MEDIA_QUERY = "(prefers-color-scheme: dark)";
64
64
  const store = () => {
@@ -302,7 +302,7 @@ const writeBannerDismissed = () => {
302
302
  const RulesBanner = () => {
303
303
  const $ = c(18);
304
304
  const t = useT();
305
- const [dismissed, setDismissed] = useState(_temp$4);
305
+ const [dismissed, setDismissed] = useState(_temp$8);
306
306
  let t0;
307
307
  if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
308
308
  t0 = () => {
@@ -422,7 +422,7 @@ const RulesBanner = () => {
422
422
  }
423
423
  return t9;
424
424
  };
425
- function _temp$4() {
425
+ function _temp$8() {
426
426
  return readBannerDismissed();
427
427
  }
428
428
 
@@ -1648,7 +1648,6 @@ function SidebarMenuButton({
1648
1648
  }, void 0, true);
1649
1649
  }
1650
1650
 
1651
- const RLS_POLICIES$1 = adminRef(ADMIN_FUNCTIONS.rlsPolicies);
1652
1651
  const OPERATIONS$1 = ["read", "insert", "update", "delete"];
1653
1652
  const operationLabel$2 = (t, operation) => ({
1654
1653
  delete: t("Delete"),
@@ -1673,145 +1672,283 @@ const groupByTable = (policies) => {
1673
1672
  return [...byTable.values()].toSorted((a, b) => a.table.localeCompare(b.table));
1674
1673
  };
1675
1674
  const RlsPanel = () => {
1676
- const client = useLunora();
1675
+ const $ = c(47);
1677
1676
  const t = useT();
1678
- const [data, setData] = useState(null);
1679
- const [error, setError] = useState(null);
1680
- const refresh = async () => {
1681
- try {
1682
- const result = await client.query(RLS_POLICIES$1, {}, callOptions(""));
1683
- setData({
1684
- policies: Array.isArray(result.policies) ? result.policies : [],
1685
- roles: Array.isArray(result.roles) ? result.roles : []
1686
- });
1687
- setError(null);
1688
- } catch (error_) {
1689
- setError(errorMessage(error_));
1677
+ let t0;
1678
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
1679
+ t0 = {};
1680
+ $[0] = t0;
1681
+ } else {
1682
+ t0 = $[0];
1683
+ }
1684
+ const {
1685
+ data,
1686
+ error
1687
+ } = useAdminQuery(ADMIN_FUNCTIONS.rlsPolicies, t0);
1688
+ const loaded = data !== void 0;
1689
+ let T0;
1690
+ let roles;
1691
+ let t1;
1692
+ let t2;
1693
+ let t3;
1694
+ let t4;
1695
+ let t5;
1696
+ let t6;
1697
+ let t7;
1698
+ if ($[1] !== data || $[2] !== error || $[3] !== loaded || $[4] !== t) {
1699
+ const tables = groupByTable(Array.isArray(data?.policies) ? data.policies : []);
1700
+ let t82;
1701
+ if ($[14] !== data) {
1702
+ t82 = Array.isArray(data?.roles) ? data.roles : [];
1703
+ $[14] = data;
1704
+ $[15] = t82;
1705
+ } else {
1706
+ t82 = $[15];
1690
1707
  }
1691
- };
1692
- useEffect(() => {
1693
- fireAndForget(refresh());
1694
- }, [refresh]);
1695
- const tables = data === null ? [] : groupByTable(data.policies);
1696
- const roles = data?.roles ?? [];
1697
- return /* @__PURE__ */ jsxDEV("div", {
1698
- className: "flex flex-col gap-6",
1699
- "data-testid": "lunora-rls-panel",
1700
- children: [error !== null && /* @__PURE__ */ jsxDEV("p", {
1701
- className: "px-4 py-8 text-center text-sm text-destructive",
1702
- "data-testid": "rls-error",
1703
- role: "alert",
1704
- children: error
1705
- }, void 0, false), /* @__PURE__ */ jsxDEV("section", {
1706
- className: "flex flex-col gap-2",
1707
- children: /* @__PURE__ */ jsxDEV(Card, {
1708
- className: "overflow-hidden py-0",
1709
- children: [/* @__PURE__ */ jsxDEV("header", {
1710
- className: "border-b border-border px-4 py-3",
1711
- children: /* @__PURE__ */ jsxDEV("span", {
1712
- className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
1713
- children: t("Policies")
1714
- }, void 0, false)
1715
- }, void 0, false), data !== null && tables.length === 0 ? /* @__PURE__ */ jsxDEV(EmptyState, {
1716
- description: t("No `definePolicy` is wired through `.use(rls(...))` in this deployment. Add one to guard a table's rows."),
1717
- testId: "rls-policies-empty",
1718
- title: t("No policies defined")
1719
- }, void 0, false) : /* @__PURE__ */ jsxDEV(CardContent, {
1720
- className: "px-0",
1721
- children: /* @__PURE__ */ jsxDEV(Table, {
1722
- "data-testid": "rls-policies-table",
1723
- children: [/* @__PURE__ */ jsxDEV(TableHeader, {
1724
- children: /* @__PURE__ */ jsxDEV(TableRow, {
1725
- children: [/* @__PURE__ */ jsxDEV(TableHead, {
1726
- children: t("Table")
1727
- }, void 0, false), OPERATIONS$1.map((operation) => /* @__PURE__ */ jsxDEV(TableHead, {
1728
- children: operationLabel$2(t, operation)
1729
- }, operation, false)), /* @__PURE__ */ jsxDEV(TableHead, {
1730
- children: t("Guarded by")
1731
- }, void 0, false)]
1732
- }, void 0, true)
1733
- }, void 0, false), /* @__PURE__ */ jsxDEV(TableBody, {
1734
- children: tables.map((coverage) => /* @__PURE__ */ jsxDEV(TableRow, {
1735
- "data-testid": `rls-table-${coverage.table}`,
1736
- children: [/* @__PURE__ */ jsxDEV(TableCell, {
1737
- className: "font-mono text-xs",
1738
- children: coverage.table
1739
- }, void 0, false), OPERATIONS$1.map((operation_0) => /* @__PURE__ */ jsxDEV(TableCell, {
1740
- children: coverage.operations.has(operation_0) ? /* @__PURE__ */ jsxDEV(Badge, {
1741
- variant: "secondary",
1742
- children: t("Guarded")
1743
- }, void 0, false) : /* @__PURE__ */ jsxDEV("span", {
1744
- "aria-hidden": "true",
1745
- className: "text-muted-foreground",
1746
- children: "—"
1747
- }, void 0, false)
1748
- }, operation_0, false)), /* @__PURE__ */ jsxDEV(TableCell, {
1749
- className: "font-mono text-xs text-muted-foreground",
1750
- children: coverage.procedures.join(", ")
1751
- }, void 0, false)]
1752
- }, coverage.table, true))
1708
+ roles = t82;
1709
+ t5 = "flex flex-col gap-6";
1710
+ t6 = "lunora-rls-panel";
1711
+ if ($[16] !== error) {
1712
+ t7 = error !== null && /* @__PURE__ */ jsxDEV("p", {
1713
+ className: "px-4 py-8 text-center text-sm text-destructive",
1714
+ "data-testid": "rls-error",
1715
+ role: "alert",
1716
+ children: error
1717
+ }, void 0, false);
1718
+ $[16] = error;
1719
+ $[17] = t7;
1720
+ } else {
1721
+ t7 = $[17];
1722
+ }
1723
+ t4 = "flex flex-col gap-2";
1724
+ T0 = Card;
1725
+ t1 = "overflow-hidden py-0";
1726
+ let t92;
1727
+ if ($[18] !== t) {
1728
+ t92 = t("Policies");
1729
+ $[18] = t;
1730
+ $[19] = t92;
1731
+ } else {
1732
+ t92 = $[19];
1733
+ }
1734
+ if ($[20] !== t92) {
1735
+ t2 = /* @__PURE__ */ jsxDEV("header", {
1736
+ className: "border-b border-border px-4 py-3",
1737
+ children: /* @__PURE__ */ jsxDEV("span", {
1738
+ className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
1739
+ children: t92
1740
+ }, void 0, false)
1741
+ }, void 0, false);
1742
+ $[20] = t92;
1743
+ $[21] = t2;
1744
+ } else {
1745
+ t2 = $[21];
1746
+ }
1747
+ t3 = loaded && tables.length === 0 ? /* @__PURE__ */ jsxDEV(EmptyState, {
1748
+ description: t("No `definePolicy` is wired through `.use(rls(...))` in this deployment. Add one to guard a table's rows."),
1749
+ testId: "rls-policies-empty",
1750
+ title: t("No policies defined")
1751
+ }, void 0, false) : /* @__PURE__ */ jsxDEV(CardContent, {
1752
+ className: "px-0",
1753
+ children: /* @__PURE__ */ jsxDEV(Table, {
1754
+ "data-testid": "rls-policies-table",
1755
+ children: [/* @__PURE__ */ jsxDEV(TableHeader, {
1756
+ children: /* @__PURE__ */ jsxDEV(TableRow, {
1757
+ children: [/* @__PURE__ */ jsxDEV(TableHead, {
1758
+ children: t("Table")
1759
+ }, void 0, false), OPERATIONS$1.map((operation) => /* @__PURE__ */ jsxDEV(TableHead, {
1760
+ children: operationLabel$2(t, operation)
1761
+ }, operation, false)), /* @__PURE__ */ jsxDEV(TableHead, {
1762
+ children: t("Guarded by")
1753
1763
  }, void 0, false)]
1754
1764
  }, void 0, true)
1765
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableBody, {
1766
+ children: tables.map((coverage) => /* @__PURE__ */ jsxDEV(TableRow, {
1767
+ "data-testid": `rls-table-${coverage.table}`,
1768
+ children: [/* @__PURE__ */ jsxDEV(TableCell, {
1769
+ className: "font-mono text-xs",
1770
+ children: coverage.table
1771
+ }, void 0, false), OPERATIONS$1.map((operation_0) => /* @__PURE__ */ jsxDEV(TableCell, {
1772
+ children: coverage.operations.has(operation_0) ? /* @__PURE__ */ jsxDEV(Badge, {
1773
+ variant: "secondary",
1774
+ children: t("Guarded")
1775
+ }, void 0, false) : /* @__PURE__ */ jsxDEV("span", {
1776
+ "aria-hidden": "true",
1777
+ className: "text-muted-foreground",
1778
+ children: "—"
1779
+ }, void 0, false)
1780
+ }, operation_0, false)), /* @__PURE__ */ jsxDEV(TableCell, {
1781
+ className: "font-mono text-xs text-muted-foreground",
1782
+ children: coverage.procedures.join(", ")
1783
+ }, void 0, false)]
1784
+ }, coverage.table, true))
1755
1785
  }, void 0, false)]
1756
1786
  }, void 0, true)
1757
- }, void 0, false), /* @__PURE__ */ jsxDEV("section", {
1758
- className: "flex flex-col gap-2",
1759
- children: /* @__PURE__ */ jsxDEV(Card, {
1760
- className: "overflow-hidden py-0",
1761
- children: [/* @__PURE__ */ jsxDEV("header", {
1762
- className: "border-b border-border px-4 py-3",
1763
- children: /* @__PURE__ */ jsxDEV("span", {
1764
- className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
1765
- children: t("Roles")
1766
- }, void 0, false)
1767
- }, void 0, false), data !== null && roles.length === 0 ? /* @__PURE__ */ jsxDEV(EmptyState, {
1768
- description: t("No `defineRole` is registered via `rls(policies, { roles })`. Roles back `ctx.auth.can(...)` permission checks."),
1769
- testId: "rls-roles-empty",
1770
- title: t("No roles defined")
1771
- }, void 0, false) : /* @__PURE__ */ jsxDEV(CardContent, {
1772
- className: "px-0",
1773
- children: /* @__PURE__ */ jsxDEV(Table, {
1774
- "data-testid": "rls-roles-table",
1775
- children: [/* @__PURE__ */ jsxDEV(TableHeader, {
1776
- children: /* @__PURE__ */ jsxDEV(TableRow, {
1777
- children: [/* @__PURE__ */ jsxDEV(TableHead, {
1778
- children: t("Role")
1779
- }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
1780
- children: t("Description")
1781
- }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
1782
- children: t("Permissions")
1783
- }, void 0, false)]
1784
- }, void 0, true)
1785
- }, void 0, false), /* @__PURE__ */ jsxDEV(TableBody, {
1786
- children: roles.map((role) => /* @__PURE__ */ jsxDEV(TableRow, {
1787
- "data-testid": `rls-role-${role.name}`,
1788
- children: [/* @__PURE__ */ jsxDEV(TableCell, {
1789
- className: "font-mono text-xs",
1790
- children: role.name
1791
- }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
1792
- className: "text-muted-foreground",
1793
- children: role.description ?? ""
1794
- }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
1795
- children: role.permissions.length === 0 ? /* @__PURE__ */ jsxDEV("span", {
1796
- "aria-hidden": "true",
1797
- className: "text-muted-foreground",
1798
- children: "—"
1799
- }, void 0, false) : /* @__PURE__ */ jsxDEV("span", {
1800
- className: "flex flex-wrap gap-1",
1801
- children: role.permissions.map((permission) => /* @__PURE__ */ jsxDEV(Badge, {
1802
- variant: "outline",
1803
- children: permission
1804
- }, permission, false))
1805
- }, void 0, false)
1806
- }, void 0, false)]
1807
- }, role.name, true))
1787
+ }, void 0, false);
1788
+ $[1] = data;
1789
+ $[2] = error;
1790
+ $[3] = loaded;
1791
+ $[4] = t;
1792
+ $[5] = T0;
1793
+ $[6] = roles;
1794
+ $[7] = t1;
1795
+ $[8] = t2;
1796
+ $[9] = t3;
1797
+ $[10] = t4;
1798
+ $[11] = t5;
1799
+ $[12] = t6;
1800
+ $[13] = t7;
1801
+ } else {
1802
+ T0 = $[5];
1803
+ roles = $[6];
1804
+ t1 = $[7];
1805
+ t2 = $[8];
1806
+ t3 = $[9];
1807
+ t4 = $[10];
1808
+ t5 = $[11];
1809
+ t6 = $[12];
1810
+ t7 = $[13];
1811
+ }
1812
+ let t8;
1813
+ if ($[22] !== T0 || $[23] !== t1 || $[24] !== t2 || $[25] !== t3) {
1814
+ t8 = /* @__PURE__ */ jsxDEV(T0, {
1815
+ className: t1,
1816
+ children: [t2, t3]
1817
+ }, void 0, true);
1818
+ $[22] = T0;
1819
+ $[23] = t1;
1820
+ $[24] = t2;
1821
+ $[25] = t3;
1822
+ $[26] = t8;
1823
+ } else {
1824
+ t8 = $[26];
1825
+ }
1826
+ let t9;
1827
+ if ($[27] !== t4 || $[28] !== t8) {
1828
+ t9 = /* @__PURE__ */ jsxDEV("section", {
1829
+ className: t4,
1830
+ children: t8
1831
+ }, void 0, false);
1832
+ $[27] = t4;
1833
+ $[28] = t8;
1834
+ $[29] = t9;
1835
+ } else {
1836
+ t9 = $[29];
1837
+ }
1838
+ let t10;
1839
+ if ($[30] !== t) {
1840
+ t10 = t("Roles");
1841
+ $[30] = t;
1842
+ $[31] = t10;
1843
+ } else {
1844
+ t10 = $[31];
1845
+ }
1846
+ let t11;
1847
+ if ($[32] !== t10) {
1848
+ t11 = /* @__PURE__ */ jsxDEV("header", {
1849
+ className: "border-b border-border px-4 py-3",
1850
+ children: /* @__PURE__ */ jsxDEV("span", {
1851
+ className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
1852
+ children: t10
1853
+ }, void 0, false)
1854
+ }, void 0, false);
1855
+ $[32] = t10;
1856
+ $[33] = t11;
1857
+ } else {
1858
+ t11 = $[33];
1859
+ }
1860
+ let t12;
1861
+ if ($[34] !== loaded || $[35] !== roles || $[36] !== t) {
1862
+ t12 = loaded && roles.length === 0 ? /* @__PURE__ */ jsxDEV(EmptyState, {
1863
+ description: t("No `defineRole` is registered via `rls(policies, { roles })`. Roles back `ctx.auth.can(...)` permission checks."),
1864
+ testId: "rls-roles-empty",
1865
+ title: t("No roles defined")
1866
+ }, void 0, false) : /* @__PURE__ */ jsxDEV(CardContent, {
1867
+ className: "px-0",
1868
+ children: /* @__PURE__ */ jsxDEV(Table, {
1869
+ "data-testid": "rls-roles-table",
1870
+ children: [/* @__PURE__ */ jsxDEV(TableHeader, {
1871
+ children: /* @__PURE__ */ jsxDEV(TableRow, {
1872
+ children: [/* @__PURE__ */ jsxDEV(TableHead, {
1873
+ children: t("Role")
1874
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
1875
+ children: t("Description")
1876
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
1877
+ children: t("Permissions")
1808
1878
  }, void 0, false)]
1809
1879
  }, void 0, true)
1880
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableBody, {
1881
+ children: roles.map(_temp2$4)
1810
1882
  }, void 0, false)]
1811
1883
  }, void 0, true)
1812
- }, void 0, false)]
1813
- }, void 0, true);
1884
+ }, void 0, false);
1885
+ $[34] = loaded;
1886
+ $[35] = roles;
1887
+ $[36] = t;
1888
+ $[37] = t12;
1889
+ } else {
1890
+ t12 = $[37];
1891
+ }
1892
+ let t13;
1893
+ if ($[38] !== t11 || $[39] !== t12) {
1894
+ t13 = /* @__PURE__ */ jsxDEV("section", {
1895
+ className: "flex flex-col gap-2",
1896
+ children: /* @__PURE__ */ jsxDEV(Card, {
1897
+ className: "overflow-hidden py-0",
1898
+ children: [t11, t12]
1899
+ }, void 0, true)
1900
+ }, void 0, false);
1901
+ $[38] = t11;
1902
+ $[39] = t12;
1903
+ $[40] = t13;
1904
+ } else {
1905
+ t13 = $[40];
1906
+ }
1907
+ let t14;
1908
+ if ($[41] !== t13 || $[42] !== t5 || $[43] !== t6 || $[44] !== t7 || $[45] !== t9) {
1909
+ t14 = /* @__PURE__ */ jsxDEV("div", {
1910
+ className: t5,
1911
+ "data-testid": t6,
1912
+ children: [t7, t9, t13]
1913
+ }, void 0, true);
1914
+ $[41] = t13;
1915
+ $[42] = t5;
1916
+ $[43] = t6;
1917
+ $[44] = t7;
1918
+ $[45] = t9;
1919
+ $[46] = t14;
1920
+ } else {
1921
+ t14 = $[46];
1922
+ }
1923
+ return t14;
1814
1924
  };
1925
+ function _temp$7(permission) {
1926
+ return /* @__PURE__ */ jsxDEV(Badge, {
1927
+ variant: "outline",
1928
+ children: permission
1929
+ }, permission, false);
1930
+ }
1931
+ function _temp2$4(role) {
1932
+ return /* @__PURE__ */ jsxDEV(TableRow, {
1933
+ "data-testid": `rls-role-${role.name}`,
1934
+ children: [/* @__PURE__ */ jsxDEV(TableCell, {
1935
+ className: "font-mono text-xs",
1936
+ children: role.name
1937
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
1938
+ className: "text-muted-foreground",
1939
+ children: role.description ?? ""
1940
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
1941
+ children: role.permissions.length === 0 ? /* @__PURE__ */ jsxDEV("span", {
1942
+ "aria-hidden": "true",
1943
+ className: "text-muted-foreground",
1944
+ children: "—"
1945
+ }, void 0, false) : /* @__PURE__ */ jsxDEV("span", {
1946
+ className: "flex flex-wrap gap-1",
1947
+ children: role.permissions.map(_temp$7)
1948
+ }, void 0, false)
1949
+ }, void 0, false)]
1950
+ }, role.name, true);
1951
+ }
1815
1952
 
1816
1953
  const DEFAULT_DATASET = "ANALYTICS";
1817
1954
  const PANEL_QUERIES = [{
@@ -1915,7 +2052,7 @@ const PanelResult = (t0) => {
1915
2052
  t7 = !loading && error === null && result !== null && result.rows.length > 0 && /* @__PURE__ */ jsxDEV(Table, {
1916
2053
  children: [/* @__PURE__ */ jsxDEV(TableHeader, {
1917
2054
  children: /* @__PURE__ */ jsxDEV(TableRow, {
1918
- children: result.columns.map(_temp$3)
2055
+ children: result.columns.map(_temp$6)
1919
2056
  }, void 0, false)
1920
2057
  }, void 0, false), /* @__PURE__ */ jsxDEV(TableBody, {
1921
2058
  children: result.rows.map((row, rowIndex) => /* @__PURE__ */ jsxDEV(TableRow, {
@@ -1972,7 +2109,7 @@ const AnalyticsPanel = ({
1972
2109
  });
1973
2110
  return (sql) => client.query(sql);
1974
2111
  }, [config, runQuery]);
1975
- const load = async (token) => {
2112
+ const load = useCallback(async (token) => {
1976
2113
  if (run === null) {
1977
2114
  return;
1978
2115
  }
@@ -2019,7 +2156,7 @@ const AnalyticsPanel = ({
2019
2156
  }
2020
2157
  }
2021
2158
  }
2022
- };
2159
+ }, [run, dataset]);
2023
2160
  useEffect(() => {
2024
2161
  const token_0 = {
2025
2162
  cancelled: false
@@ -2057,7 +2194,7 @@ const AnalyticsPanel = ({
2057
2194
  }, panel_0.key, false))
2058
2195
  }, void 0, false);
2059
2196
  };
2060
- function _temp$3(column) {
2197
+ function _temp$6(column) {
2061
2198
  return /* @__PURE__ */ jsxDEV(TableHead, {
2062
2199
  children: column.name
2063
2200
  }, column.name, false);
@@ -2080,153 +2217,209 @@ const CAPABILITY_ROWS = [{
2080
2217
  label: "Two-factor"
2081
2218
  }];
2082
2219
  const AuthConfigPanel = () => {
2220
+ const $ = c(29);
2083
2221
  const client = useLunora();
2084
2222
  const t = useT();
2085
- const [capabilities, setCapabilities] = useState(null);
2086
- const [error, setError] = useState(null);
2087
- const [loading, setLoading] = useState(true);
2088
- useEffect(() => {
2089
- const token = {
2090
- cancelled: false
2091
- };
2092
- fireAndForget((async () => {
2093
- try {
2094
- const result = await client.getAuthCapabilities();
2095
- if (!token.cancelled) {
2096
- setCapabilities(result);
2097
- setError(null);
2098
- }
2099
- } catch (error_) {
2100
- if (!token.cancelled) {
2101
- setError(errorMessage(error_));
2102
- }
2103
- } finally {
2104
- if (!token.cancelled) {
2105
- setLoading(false);
2106
- }
2107
- }
2108
- })());
2109
- return () => {
2110
- token.cancelled = true;
2111
- };
2112
- }, [client]);
2113
- return /* @__PURE__ */ jsxDEV("div", {
2114
- className: "flex flex-col gap-4",
2115
- "data-testid": "auth-config",
2116
- children: [/* @__PURE__ */ jsxDEV(Card, {
2117
- className: "gap-0 py-0",
2118
- children: [/* @__PURE__ */ jsxDEV("header", {
2119
- className: "border-b border-border px-4 py-3",
2120
- children: /* @__PURE__ */ jsxDEV("span", {
2121
- className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
2122
- children: t("Enabled capabilities")
2123
- }, void 0, false)
2124
- }, void 0, false), error !== null && /* @__PURE__ */ jsxDEV("p", {
2125
- className: "px-4 py-8 text-center text-sm text-destructive",
2126
- "data-testid": "auth-config-error",
2127
- role: "alert",
2128
- children: error
2129
- }, void 0, false), error === null && loading && /* @__PURE__ */ jsxDEV("p", {
2130
- className: "px-4 py-8 text-center text-sm text-muted-foreground",
2131
- "data-testid": "auth-config-loading",
2132
- children: t("Loading auth configuration…")
2133
- }, void 0, false), error === null && !loading && capabilities !== null && /* @__PURE__ */ jsxDEV(CardContent, {
2134
- className: "p-3",
2135
- children: /* @__PURE__ */ jsxDEV("ul", {
2136
- className: "grid grid-cols-1 gap-2 sm:grid-cols-2",
2137
- children: CAPABILITY_ROWS.map((row) => {
2138
- const enabled = capabilities[row.key];
2139
- return /* @__PURE__ */ jsxDEV("li", {
2140
- className: "flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs",
2141
- "data-testid": `auth-config-cap-${row.key}`,
2142
- children: [/* @__PURE__ */ jsxDEV("span", {
2143
- className: "text-sm",
2144
- children: t(row.label)
2145
- }, void 0, false), /* @__PURE__ */ jsxDEV(Badge, {
2146
- variant: enabled ? "success" : "outline",
2147
- children: enabled ? t("Enabled") : t("Disabled")
2148
- }, void 0, false)]
2149
- }, row.key, true);
2150
- })
2151
- }, void 0, false)
2152
- }, void 0, false)]
2153
- }, void 0, true), /* @__PURE__ */ jsxDEV(Card, {
2154
- className: "gap-0 py-0",
2155
- children: /* @__PURE__ */ jsxDEV("p", {
2156
- className: "px-4 py-3 text-xs text-muted-foreground",
2157
- "data-testid": "auth-config-note",
2158
- children: t("OAuth providers, email templates, and rate limits are configured at deploy time in the better-auth setup and aren't editable here. See the Mail tab for email output.")
2159
- }, void 0, false)
2160
- }, void 0, false)]
2161
- }, void 0, true);
2162
- };
2163
-
2164
- const SESSION_LIMIT = 200;
2165
- const AuthSessionsPanel = () => {
2166
- const $ = c(21);
2167
- const client = useLunora();
2168
- const t = useT();
2169
- const [sessions, setSessions] = useState(null);
2170
- const [error, setError] = useState(null);
2171
- const [version, setVersion] = useState(0);
2172
2223
  let t0;
2173
- if ($[0] !== client) {
2174
- t0 = () => {
2175
- fireAndForget((async () => {
2176
- setError(null);
2177
- try {
2178
- const page = await client.listAuthSessions({
2179
- limit: SESSION_LIMIT
2180
- });
2181
- setSessions(page.rows);
2182
- } catch (t12) {
2183
- const error_ = t12;
2184
- setSessions(null);
2185
- setError(errorMessage(error_));
2186
- }
2187
- })());
2188
- };
2189
- $[0] = client;
2190
- $[1] = t0;
2224
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2225
+ t0 = ["lunora-auth-capabilities"];
2226
+ $[0] = t0;
2191
2227
  } else {
2192
- t0 = $[1];
2228
+ t0 = $[0];
2193
2229
  }
2194
2230
  let t1;
2195
- if ($[2] !== client || $[3] !== version) {
2196
- t1 = [client, version];
2197
- $[2] = client;
2198
- $[3] = version;
2199
- $[4] = t1;
2231
+ if ($[1] !== client) {
2232
+ t1 = () => client.getAuthCapabilities();
2233
+ $[1] = client;
2234
+ $[2] = t1;
2200
2235
  } else {
2201
- t1 = $[4];
2236
+ t1 = $[2];
2202
2237
  }
2203
- useEffect(t0, t1);
2238
+ const {
2239
+ data: capabilities,
2240
+ error
2241
+ } = useClientQuery(t0, t1);
2204
2242
  let t2;
2205
- if ($[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2243
+ if ($[3] !== t) {
2244
+ t2 = t("Enabled capabilities");
2245
+ $[3] = t;
2246
+ $[4] = t2;
2247
+ } else {
2248
+ t2 = $[4];
2249
+ }
2250
+ let t3;
2251
+ if ($[5] !== t2) {
2252
+ t3 = /* @__PURE__ */ jsxDEV("header", {
2253
+ className: "border-b border-border px-4 py-3",
2254
+ children: /* @__PURE__ */ jsxDEV("span", {
2255
+ className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
2256
+ children: t2
2257
+ }, void 0, false)
2258
+ }, void 0, false);
2259
+ $[5] = t2;
2260
+ $[6] = t3;
2261
+ } else {
2262
+ t3 = $[6];
2263
+ }
2264
+ let t4;
2265
+ if ($[7] !== error) {
2266
+ t4 = error !== null && /* @__PURE__ */ jsxDEV("p", {
2267
+ className: "px-4 py-8 text-center text-sm text-destructive",
2268
+ "data-testid": "auth-config-error",
2269
+ role: "alert",
2270
+ children: error
2271
+ }, void 0, false);
2272
+ $[7] = error;
2273
+ $[8] = t4;
2274
+ } else {
2275
+ t4 = $[8];
2276
+ }
2277
+ let t5;
2278
+ if ($[9] !== capabilities || $[10] !== error || $[11] !== t) {
2279
+ t5 = error === null && capabilities === void 0 && /* @__PURE__ */ jsxDEV("p", {
2280
+ className: "px-4 py-8 text-center text-sm text-muted-foreground",
2281
+ "data-testid": "auth-config-loading",
2282
+ children: t("Loading auth configuration…")
2283
+ }, void 0, false);
2284
+ $[9] = capabilities;
2285
+ $[10] = error;
2286
+ $[11] = t;
2287
+ $[12] = t5;
2288
+ } else {
2289
+ t5 = $[12];
2290
+ }
2291
+ let t6;
2292
+ if ($[13] !== capabilities || $[14] !== error || $[15] !== t) {
2293
+ t6 = error === null && capabilities !== void 0 && /* @__PURE__ */ jsxDEV(CardContent, {
2294
+ className: "p-3",
2295
+ children: /* @__PURE__ */ jsxDEV("ul", {
2296
+ className: "grid grid-cols-1 gap-2 sm:grid-cols-2",
2297
+ children: CAPABILITY_ROWS.map((row) => {
2298
+ const enabled = capabilities[row.key];
2299
+ return /* @__PURE__ */ jsxDEV("li", {
2300
+ className: "flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs",
2301
+ "data-testid": `auth-config-cap-${row.key}`,
2302
+ children: [/* @__PURE__ */ jsxDEV("span", {
2303
+ className: "text-sm",
2304
+ children: t(row.label)
2305
+ }, void 0, false), /* @__PURE__ */ jsxDEV(Badge, {
2306
+ variant: enabled ? "success" : "outline",
2307
+ children: enabled ? t("Enabled") : t("Disabled")
2308
+ }, void 0, false)]
2309
+ }, row.key, true);
2310
+ })
2311
+ }, void 0, false)
2312
+ }, void 0, false);
2313
+ $[13] = capabilities;
2314
+ $[14] = error;
2315
+ $[15] = t;
2316
+ $[16] = t6;
2317
+ } else {
2318
+ t6 = $[16];
2319
+ }
2320
+ let t7;
2321
+ if ($[17] !== t3 || $[18] !== t4 || $[19] !== t5 || $[20] !== t6) {
2322
+ t7 = /* @__PURE__ */ jsxDEV(Card, {
2323
+ className: "gap-0 py-0",
2324
+ children: [t3, t4, t5, t6]
2325
+ }, void 0, true);
2326
+ $[17] = t3;
2327
+ $[18] = t4;
2328
+ $[19] = t5;
2329
+ $[20] = t6;
2330
+ $[21] = t7;
2331
+ } else {
2332
+ t7 = $[21];
2333
+ }
2334
+ let t8;
2335
+ if ($[22] !== t) {
2336
+ t8 = t("OAuth providers, email templates, and rate limits are configured at deploy time in the better-auth setup and aren't editable here. See the Mail tab for email output.");
2337
+ $[22] = t;
2338
+ $[23] = t8;
2339
+ } else {
2340
+ t8 = $[23];
2341
+ }
2342
+ let t9;
2343
+ if ($[24] !== t8) {
2344
+ t9 = /* @__PURE__ */ jsxDEV(Card, {
2345
+ className: "gap-0 py-0",
2346
+ children: /* @__PURE__ */ jsxDEV("p", {
2347
+ className: "px-4 py-3 text-xs text-muted-foreground",
2348
+ "data-testid": "auth-config-note",
2349
+ children: t8
2350
+ }, void 0, false)
2351
+ }, void 0, false);
2352
+ $[24] = t8;
2353
+ $[25] = t9;
2354
+ } else {
2355
+ t9 = $[25];
2356
+ }
2357
+ let t10;
2358
+ if ($[26] !== t7 || $[27] !== t9) {
2359
+ t10 = /* @__PURE__ */ jsxDEV("div", {
2360
+ className: "flex flex-col gap-4",
2361
+ "data-testid": "auth-config",
2362
+ children: [t7, t9]
2363
+ }, void 0, true);
2364
+ $[26] = t7;
2365
+ $[27] = t9;
2366
+ $[28] = t10;
2367
+ } else {
2368
+ t10 = $[28];
2369
+ }
2370
+ return t10;
2371
+ };
2372
+
2373
+ const SESSION_LIMIT = 200;
2374
+ const AuthSessionsPanel = () => {
2375
+ const $ = c(21);
2376
+ const client = useLunora();
2377
+ const t = useT();
2378
+ let t0;
2379
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2380
+ t0 = ["lunora-auth-sessions", SESSION_LIMIT];
2381
+ $[0] = t0;
2382
+ } else {
2383
+ t0 = $[0];
2384
+ }
2385
+ let t1;
2386
+ if ($[1] !== client) {
2387
+ t1 = () => client.listAuthSessions({
2388
+ limit: SESSION_LIMIT
2389
+ });
2390
+ $[1] = client;
2391
+ $[2] = t1;
2392
+ } else {
2393
+ t1 = $[2];
2394
+ }
2395
+ const sessionsQuery = useClientQuery(t0, t1);
2396
+ const {
2397
+ error
2398
+ } = sessionsQuery;
2399
+ const sessions = sessionsQuery.data?.rows ?? null;
2400
+ let t2;
2401
+ if ($[3] !== sessionsQuery) {
2206
2402
  t2 = () => {
2207
- setVersion(_temp$2);
2403
+ sessionsQuery.refetch();
2208
2404
  };
2209
- $[5] = t2;
2405
+ $[3] = sessionsQuery;
2406
+ $[4] = t2;
2210
2407
  } else {
2211
- t2 = $[5];
2408
+ t2 = $[4];
2212
2409
  }
2213
2410
  useAutoRefresh(t2, true);
2214
2411
  let t3;
2215
- if ($[6] !== client) {
2412
+ if ($[5] !== client || $[6] !== sessionsQuery) {
2216
2413
  t3 = (sessionId) => {
2217
2414
  fireAndForget((async () => {
2218
- try {
2219
- await client.revokeAuthSession({
2220
- sessionId
2221
- });
2222
- setVersion(_temp2$2);
2223
- } catch (t42) {
2224
- const error__0 = t42;
2225
- setError(errorMessage(error__0));
2226
- }
2415
+ await client.revokeAuthSession({
2416
+ sessionId
2417
+ });
2418
+ sessionsQuery.refetch();
2227
2419
  })());
2228
2420
  };
2229
- $[6] = client;
2421
+ $[5] = client;
2422
+ $[6] = sessionsQuery;
2230
2423
  $[7] = t3;
2231
2424
  } else {
2232
2425
  t3 = $[7];
@@ -2338,12 +2531,6 @@ const AuthSessionsPanel = () => {
2338
2531
  }
2339
2532
  return t7;
2340
2533
  };
2341
- function _temp$2(value) {
2342
- return value + 1;
2343
- }
2344
- function _temp2$2(value_0) {
2345
- return value_0 + 1;
2346
- }
2347
2534
 
2348
2535
  const DEFAULT_CAPABILITIES = {
2349
2536
  accounts: true,
@@ -2401,7 +2588,7 @@ const OrgRowTable = (t0) => {
2401
2588
  }
2402
2589
  let t2;
2403
2590
  if ($[2] !== columns) {
2404
- t2 = columns.map(_temp$1);
2591
+ t2 = columns.map(_temp$5);
2405
2592
  $[2] = columns;
2406
2593
  $[3] = t2;
2407
2594
  } else {
@@ -2534,344 +2721,358 @@ const OrgRowTable = (t0) => {
2534
2721
  return t10;
2535
2722
  };
2536
2723
  const OrganizationsPanel = () => {
2537
- const $ = c(82);
2724
+ const $ = c(95);
2538
2725
  const client = useLunora();
2539
2726
  const t = useT();
2540
2727
  const {
2541
2728
  capabilities,
2542
2729
  ready
2543
2730
  } = useAuthCapabilities();
2544
- const [orgs, setOrgs] = useState(null);
2545
- const [error, setError] = useState(null);
2546
2731
  const [selected, setSelected] = useState(null);
2547
- const [members, setMembers] = useState(null);
2548
- const [invitations, setInvitations] = useState(null);
2549
- const [version, setVersion] = useState(0);
2550
2732
  let t0;
2551
- if ($[0] !== capabilities.organization || $[1] !== client) {
2552
- t0 = () => {
2553
- if (!capabilities.organization) {
2554
- return;
2555
- }
2556
- fireAndForget((async () => {
2557
- try {
2558
- const page = await client.listAuthOrganizations({
2559
- limit: 100
2560
- });
2561
- setOrgs(page.rows);
2562
- } catch (t110) {
2563
- const error_ = t110;
2564
- setError(errorMessage(error_));
2565
- }
2566
- })());
2567
- };
2568
- $[0] = capabilities.organization;
2569
- $[1] = client;
2570
- $[2] = t0;
2733
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2734
+ t0 = ["lunora-auth-orgs"];
2735
+ $[0] = t0;
2571
2736
  } else {
2572
- t0 = $[2];
2737
+ t0 = $[0];
2573
2738
  }
2574
2739
  let t1;
2575
- if ($[3] !== capabilities.organization || $[4] !== client || $[5] !== version) {
2576
- t1 = [capabilities.organization, client, version];
2577
- $[3] = capabilities.organization;
2578
- $[4] = client;
2579
- $[5] = version;
2580
- $[6] = t1;
2740
+ if ($[1] !== client) {
2741
+ t1 = () => client.listAuthOrganizations({
2742
+ limit: 100
2743
+ });
2744
+ $[1] = client;
2745
+ $[2] = t1;
2581
2746
  } else {
2582
- t1 = $[6];
2747
+ t1 = $[2];
2583
2748
  }
2584
- useEffect(t0, t1);
2585
2749
  let t2;
2586
- if ($[7] !== client || $[8] !== selected) {
2587
- t2 = () => {
2588
- if (selected === null) {
2589
- return;
2590
- }
2591
- let cancelled = false;
2592
- fireAndForget((async () => {
2593
- try {
2594
- const [memberPage, invitePage] = await Promise.all([client.listAuthOrgMembers({
2595
- limit: 200,
2596
- organizationId: selected
2597
- }), client.listAuthOrgInvitations({
2598
- limit: 200,
2599
- organizationId: selected
2600
- })]);
2601
- if (!cancelled) {
2602
- setMembers(memberPage.rows);
2603
- setInvitations(invitePage.rows);
2604
- }
2605
- } catch (t32) {
2606
- const error__0 = t32;
2607
- if (!cancelled) {
2608
- setError(errorMessage(error__0));
2609
- }
2610
- }
2611
- })());
2612
- return () => {
2613
- cancelled = true;
2614
- };
2750
+ if ($[3] !== capabilities.organization) {
2751
+ t2 = {
2752
+ enabled: capabilities.organization
2615
2753
  };
2616
- $[7] = client;
2617
- $[8] = selected;
2618
- $[9] = t2;
2754
+ $[3] = capabilities.organization;
2755
+ $[4] = t2;
2619
2756
  } else {
2620
- t2 = $[9];
2757
+ t2 = $[4];
2621
2758
  }
2759
+ const orgsQuery = useClientQuery(t0, t1, t2);
2760
+ const orgs = orgsQuery.data?.rows ?? null;
2622
2761
  let t3;
2623
- if ($[10] !== client || $[11] !== selected || $[12] !== version) {
2624
- t3 = [client, selected, version];
2625
- $[10] = client;
2626
- $[11] = selected;
2627
- $[12] = version;
2628
- $[13] = t3;
2762
+ if ($[5] !== selected) {
2763
+ t3 = ["lunora-auth-org-members", selected];
2764
+ $[5] = selected;
2765
+ $[6] = t3;
2629
2766
  } else {
2630
- t3 = $[13];
2767
+ t3 = $[6];
2631
2768
  }
2632
- useEffect(t2, t3);
2633
2769
  let t4;
2634
- if ($[14] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2635
- t4 = () => {
2636
- setVersion(_temp2$1);
2770
+ if ($[7] !== client || $[8] !== selected) {
2771
+ t4 = () => client.listAuthOrgMembers({
2772
+ limit: 200,
2773
+ organizationId: selected ?? ""
2774
+ });
2775
+ $[7] = client;
2776
+ $[8] = selected;
2777
+ $[9] = t4;
2778
+ } else {
2779
+ t4 = $[9];
2780
+ }
2781
+ const t5 = selected !== null;
2782
+ let t6;
2783
+ if ($[10] !== t5) {
2784
+ t6 = {
2785
+ enabled: t5
2637
2786
  };
2638
- $[14] = t4;
2787
+ $[10] = t5;
2788
+ $[11] = t6;
2639
2789
  } else {
2640
- t4 = $[14];
2790
+ t6 = $[11];
2641
2791
  }
2642
- useAutoRefresh(t4, capabilities.organization);
2643
- let t5;
2644
- if ($[15] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2645
- t5 = (id) => {
2792
+ const membersQuery = useClientQuery(t3, t4, t6);
2793
+ let t7;
2794
+ if ($[12] !== selected) {
2795
+ t7 = ["lunora-auth-org-invitations", selected];
2796
+ $[12] = selected;
2797
+ $[13] = t7;
2798
+ } else {
2799
+ t7 = $[13];
2800
+ }
2801
+ let t8;
2802
+ if ($[14] !== client || $[15] !== selected) {
2803
+ t8 = () => client.listAuthOrgInvitations({
2804
+ limit: 200,
2805
+ organizationId: selected ?? ""
2806
+ });
2807
+ $[14] = client;
2808
+ $[15] = selected;
2809
+ $[16] = t8;
2810
+ } else {
2811
+ t8 = $[16];
2812
+ }
2813
+ const t9 = selected !== null;
2814
+ let t10;
2815
+ if ($[17] !== t9) {
2816
+ t10 = {
2817
+ enabled: t9
2818
+ };
2819
+ $[17] = t9;
2820
+ $[18] = t10;
2821
+ } else {
2822
+ t10 = $[18];
2823
+ }
2824
+ const invitationsQuery = useClientQuery(t7, t8, t10);
2825
+ const members = selected === null ? null : membersQuery.data?.rows ?? null;
2826
+ const invitations = selected === null ? null : invitationsQuery.data?.rows ?? null;
2827
+ const error = orgsQuery.error ?? membersQuery.error ?? invitationsQuery.error;
2828
+ let t11;
2829
+ if ($[19] !== invitationsQuery || $[20] !== membersQuery || $[21] !== orgsQuery || $[22] !== selected) {
2830
+ t11 = () => {
2831
+ orgsQuery.refetch();
2832
+ if (selected !== null) {
2833
+ membersQuery.refetch();
2834
+ invitationsQuery.refetch();
2835
+ }
2836
+ };
2837
+ $[19] = invitationsQuery;
2838
+ $[20] = membersQuery;
2839
+ $[21] = orgsQuery;
2840
+ $[22] = selected;
2841
+ $[23] = t11;
2842
+ } else {
2843
+ t11 = $[23];
2844
+ }
2845
+ useAutoRefresh(t11, capabilities.organization);
2846
+ let t12;
2847
+ if ($[24] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2848
+ t12 = (id) => {
2646
2849
  setSelected(id);
2647
- setMembers(null);
2648
- setInvitations(null);
2649
2850
  };
2650
- $[15] = t5;
2851
+ $[24] = t12;
2651
2852
  } else {
2652
- t5 = $[15];
2853
+ t12 = $[24];
2653
2854
  }
2654
- const onSelectOrg = t5;
2655
- let t6;
2656
- if ($[16] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2657
- t6 = (action) => {
2855
+ const onSelectOrg = t12;
2856
+ let t13;
2857
+ if ($[25] !== invitationsQuery || $[26] !== membersQuery) {
2858
+ t13 = (action) => {
2658
2859
  fireAndForget((async () => {
2659
- try {
2660
- await action();
2661
- setVersion(_temp3);
2662
- } catch (t72) {
2663
- const error__1 = t72;
2664
- setError(errorMessage(error__1));
2665
- }
2860
+ await action();
2861
+ membersQuery.refetch();
2862
+ invitationsQuery.refetch();
2666
2863
  })());
2667
2864
  };
2668
- $[16] = t6;
2865
+ $[25] = invitationsQuery;
2866
+ $[26] = membersQuery;
2867
+ $[27] = t13;
2669
2868
  } else {
2670
- t6 = $[16];
2869
+ t13 = $[27];
2671
2870
  }
2672
- const runOrgAction = t6;
2673
- let t7;
2674
- if ($[17] !== client) {
2675
- t7 = (memberId) => {
2871
+ const runOrgAction = t13;
2872
+ let t14;
2873
+ if ($[28] !== client || $[29] !== runOrgAction) {
2874
+ t14 = (memberId) => {
2676
2875
  runOrgAction(() => client.removeAuthOrgMember({
2677
2876
  memberId
2678
2877
  }));
2679
2878
  };
2680
- $[17] = client;
2681
- $[18] = t7;
2879
+ $[28] = client;
2880
+ $[29] = runOrgAction;
2881
+ $[30] = t14;
2682
2882
  } else {
2683
- t7 = $[18];
2883
+ t14 = $[30];
2684
2884
  }
2685
- const onRemoveMember = t7;
2686
- let t8;
2687
- if ($[19] !== client) {
2688
- t8 = (invitationId) => {
2885
+ const onRemoveMember = t14;
2886
+ let t15;
2887
+ if ($[31] !== client || $[32] !== runOrgAction) {
2888
+ t15 = (invitationId) => {
2689
2889
  runOrgAction(() => client.cancelAuthOrgInvitation({
2690
2890
  invitationId
2691
2891
  }));
2692
2892
  };
2693
- $[19] = client;
2694
- $[20] = t8;
2893
+ $[31] = client;
2894
+ $[32] = runOrgAction;
2895
+ $[33] = t15;
2695
2896
  } else {
2696
- t8 = $[20];
2897
+ t15 = $[33];
2697
2898
  }
2698
- const onCancelInvitation = t8;
2699
- let t9;
2700
- if ($[21] !== t) {
2701
- t9 = t("userId");
2702
- $[21] = t;
2703
- $[22] = t9;
2899
+ const onCancelInvitation = t15;
2900
+ let t16;
2901
+ if ($[34] !== t) {
2902
+ t16 = t("userId");
2903
+ $[34] = t;
2904
+ $[35] = t16;
2704
2905
  } else {
2705
- t9 = $[22];
2906
+ t16 = $[35];
2706
2907
  }
2707
- let t10;
2708
- if ($[23] !== t9) {
2709
- t10 = {
2710
- head: t9,
2711
- render: _temp4
2908
+ let t17;
2909
+ if ($[36] !== t16) {
2910
+ t17 = {
2911
+ head: t16,
2912
+ render: _temp2$3
2712
2913
  };
2713
- $[23] = t9;
2714
- $[24] = t10;
2914
+ $[36] = t16;
2915
+ $[37] = t17;
2715
2916
  } else {
2716
- t10 = $[24];
2917
+ t17 = $[37];
2717
2918
  }
2718
- let t11;
2719
- if ($[25] !== t) {
2720
- t11 = t("role");
2721
- $[25] = t;
2722
- $[26] = t11;
2919
+ let t18;
2920
+ if ($[38] !== t) {
2921
+ t18 = t("role");
2922
+ $[38] = t;
2923
+ $[39] = t18;
2723
2924
  } else {
2724
- t11 = $[26];
2925
+ t18 = $[39];
2725
2926
  }
2726
- let t12;
2727
- if ($[27] !== t11) {
2728
- t12 = {
2729
- head: t11,
2730
- render: _temp5
2927
+ let t19;
2928
+ if ($[40] !== t18) {
2929
+ t19 = {
2930
+ head: t18,
2931
+ render: _temp3
2731
2932
  };
2732
- $[27] = t11;
2733
- $[28] = t12;
2933
+ $[40] = t18;
2934
+ $[41] = t19;
2734
2935
  } else {
2735
- t12 = $[28];
2936
+ t19 = $[41];
2736
2937
  }
2737
- let t13;
2738
- if ($[29] !== t10 || $[30] !== t12) {
2739
- t13 = [t10, t12];
2740
- $[29] = t10;
2741
- $[30] = t12;
2742
- $[31] = t13;
2938
+ let t20;
2939
+ if ($[42] !== t17 || $[43] !== t19) {
2940
+ t20 = [t17, t19];
2941
+ $[42] = t17;
2942
+ $[43] = t19;
2943
+ $[44] = t20;
2743
2944
  } else {
2744
- t13 = $[31];
2945
+ t20 = $[44];
2745
2946
  }
2746
- const memberColumns = t13;
2747
- let t14;
2748
- if ($[32] !== t) {
2749
- t14 = t("email");
2750
- $[32] = t;
2751
- $[33] = t14;
2947
+ const memberColumns = t20;
2948
+ let t21;
2949
+ if ($[45] !== t) {
2950
+ t21 = t("email");
2951
+ $[45] = t;
2952
+ $[46] = t21;
2752
2953
  } else {
2753
- t14 = $[33];
2954
+ t21 = $[46];
2754
2955
  }
2755
- let t15;
2756
- if ($[34] !== t14) {
2757
- t15 = {
2758
- head: t14,
2759
- render: _temp6
2956
+ let t22;
2957
+ if ($[47] !== t21) {
2958
+ t22 = {
2959
+ head: t21,
2960
+ render: _temp4
2760
2961
  };
2761
- $[34] = t14;
2762
- $[35] = t15;
2962
+ $[47] = t21;
2963
+ $[48] = t22;
2763
2964
  } else {
2764
- t15 = $[35];
2965
+ t22 = $[48];
2765
2966
  }
2766
- let t16;
2767
- if ($[36] !== t) {
2768
- t16 = t("role");
2769
- $[36] = t;
2770
- $[37] = t16;
2967
+ let t23;
2968
+ if ($[49] !== t) {
2969
+ t23 = t("role");
2970
+ $[49] = t;
2971
+ $[50] = t23;
2771
2972
  } else {
2772
- t16 = $[37];
2973
+ t23 = $[50];
2773
2974
  }
2774
- let t17;
2775
- if ($[38] !== t16) {
2776
- t17 = {
2777
- head: t16,
2778
- render: _temp7
2975
+ let t24;
2976
+ if ($[51] !== t23) {
2977
+ t24 = {
2978
+ head: t23,
2979
+ render: _temp5
2779
2980
  };
2780
- $[38] = t16;
2781
- $[39] = t17;
2981
+ $[51] = t23;
2982
+ $[52] = t24;
2782
2983
  } else {
2783
- t17 = $[39];
2984
+ t24 = $[52];
2784
2985
  }
2785
- let t18;
2786
- if ($[40] !== t) {
2787
- t18 = t("status");
2788
- $[40] = t;
2789
- $[41] = t18;
2986
+ let t25;
2987
+ if ($[53] !== t) {
2988
+ t25 = t("status");
2989
+ $[53] = t;
2990
+ $[54] = t25;
2790
2991
  } else {
2791
- t18 = $[41];
2992
+ t25 = $[54];
2792
2993
  }
2793
- let t19;
2794
- if ($[42] !== t18) {
2795
- t19 = {
2796
- head: t18,
2797
- render: _temp8
2994
+ let t26;
2995
+ if ($[55] !== t25) {
2996
+ t26 = {
2997
+ head: t25,
2998
+ render: _temp6
2798
2999
  };
2799
- $[42] = t18;
2800
- $[43] = t19;
3000
+ $[55] = t25;
3001
+ $[56] = t26;
2801
3002
  } else {
2802
- t19 = $[43];
3003
+ t26 = $[56];
2803
3004
  }
2804
- let t20;
2805
- if ($[44] !== t15 || $[45] !== t17 || $[46] !== t19) {
2806
- t20 = [t15, t17, t19];
2807
- $[44] = t15;
2808
- $[45] = t17;
2809
- $[46] = t19;
2810
- $[47] = t20;
3005
+ let t27;
3006
+ if ($[57] !== t22 || $[58] !== t24 || $[59] !== t26) {
3007
+ t27 = [t22, t24, t26];
3008
+ $[57] = t22;
3009
+ $[58] = t24;
3010
+ $[59] = t26;
3011
+ $[60] = t27;
2811
3012
  } else {
2812
- t20 = $[47];
3013
+ t27 = $[60];
2813
3014
  }
2814
- const invitationColumns = t20;
3015
+ const invitationColumns = t27;
2815
3016
  if (ready && !capabilities.organization) {
2816
- let t212;
2817
- if ($[48] !== t) {
2818
- t212 = t("Enable the organization() plugin in your auth config to manage organizations here.");
2819
- $[48] = t;
2820
- $[49] = t212;
3017
+ let t282;
3018
+ if ($[61] !== t) {
3019
+ t282 = t("Enable the organization() plugin in your auth config to manage organizations here.");
3020
+ $[61] = t;
3021
+ $[62] = t282;
2821
3022
  } else {
2822
- t212 = $[49];
3023
+ t282 = $[62];
2823
3024
  }
2824
- let t222;
2825
- if ($[50] !== t) {
2826
- t222 = t("Organizations are not enabled.");
2827
- $[50] = t;
2828
- $[51] = t222;
3025
+ let t292;
3026
+ if ($[63] !== t) {
3027
+ t292 = t("Organizations are not enabled.");
3028
+ $[63] = t;
3029
+ $[64] = t292;
2829
3030
  } else {
2830
- t222 = $[51];
3031
+ t292 = $[64];
2831
3032
  }
2832
- let t232;
2833
- if ($[52] !== t212 || $[53] !== t222) {
2834
- t232 = /* @__PURE__ */ jsxDEV(EmptyState, {
2835
- description: t212,
3033
+ let t302;
3034
+ if ($[65] !== t282 || $[66] !== t292) {
3035
+ t302 = /* @__PURE__ */ jsxDEV(EmptyState, {
3036
+ description: t282,
2836
3037
  testId: "org-disabled",
2837
- title: t222
3038
+ title: t292
2838
3039
  }, void 0, false);
2839
- $[52] = t212;
2840
- $[53] = t222;
2841
- $[54] = t232;
3040
+ $[65] = t282;
3041
+ $[66] = t292;
3042
+ $[67] = t302;
2842
3043
  } else {
2843
- t232 = $[54];
3044
+ t302 = $[67];
2844
3045
  }
2845
- return t232;
3046
+ return t302;
2846
3047
  }
2847
- let t21;
2848
- if ($[55] !== error) {
2849
- t21 = error !== null && /* @__PURE__ */ jsxDEV("p", {
3048
+ let t28;
3049
+ if ($[68] !== error) {
3050
+ t28 = error !== null && /* @__PURE__ */ jsxDEV("p", {
2850
3051
  className: "text-sm text-destructive",
2851
3052
  "data-testid": "org-error",
2852
3053
  role: "alert",
2853
3054
  children: error
2854
3055
  }, void 0, false);
2855
- $[55] = error;
2856
- $[56] = t21;
3056
+ $[68] = error;
3057
+ $[69] = t28;
2857
3058
  } else {
2858
- t21 = $[56];
3059
+ t28 = $[69];
2859
3060
  }
2860
- let t22;
2861
- if ($[57] !== orgs || $[58] !== t) {
2862
- t22 = orgs !== null && orgs.length === 0 && /* @__PURE__ */ jsxDEV(EmptyState, {
3061
+ let t29;
3062
+ if ($[70] !== orgs || $[71] !== t) {
3063
+ t29 = orgs !== null && orgs.length === 0 && /* @__PURE__ */ jsxDEV(EmptyState, {
2863
3064
  testId: "org-empty",
2864
3065
  title: t("No organizations.")
2865
3066
  }, void 0, false);
2866
- $[57] = orgs;
2867
- $[58] = t;
2868
- $[59] = t22;
3067
+ $[70] = orgs;
3068
+ $[71] = t;
3069
+ $[72] = t29;
2869
3070
  } else {
2870
- t22 = $[59];
3071
+ t29 = $[72];
2871
3072
  }
2872
- let t23;
2873
- if ($[60] !== orgs || $[61] !== selected || $[62] !== t) {
2874
- t23 = orgs !== null && orgs.length > 0 && /* @__PURE__ */ jsxDEV(Card, {
3073
+ let t30;
3074
+ if ($[73] !== orgs || $[74] !== selected || $[75] !== t) {
3075
+ t30 = orgs !== null && orgs.length > 0 && /* @__PURE__ */ jsxDEV(Card, {
2875
3076
  className: "overflow-hidden py-0",
2876
3077
  children: /* @__PURE__ */ jsxDEV(CardContent, {
2877
3078
  className: "px-0",
@@ -2925,16 +3126,16 @@ const OrganizationsPanel = () => {
2925
3126
  }, void 0, true)
2926
3127
  }, void 0, false)
2927
3128
  }, void 0, false);
2928
- $[60] = orgs;
2929
- $[61] = selected;
2930
- $[62] = t;
2931
- $[63] = t23;
3129
+ $[73] = orgs;
3130
+ $[74] = selected;
3131
+ $[75] = t;
3132
+ $[76] = t30;
2932
3133
  } else {
2933
- t23 = $[63];
3134
+ t30 = $[76];
2934
3135
  }
2935
- let t24;
2936
- if ($[64] !== memberColumns || $[65] !== members || $[66] !== onRemoveMember || $[67] !== selected || $[68] !== t) {
2937
- t24 = selected !== null && members !== null && /* @__PURE__ */ jsxDEV(OrgRowTable, {
3136
+ let t31;
3137
+ if ($[77] !== memberColumns || $[78] !== members || $[79] !== onRemoveMember || $[80] !== selected || $[81] !== t) {
3138
+ t31 = selected !== null && members !== null && /* @__PURE__ */ jsxDEV(OrgRowTable, {
2938
3139
  actionLabel: t("Remove"),
2939
3140
  actionPrefix: "org-remove-member",
2940
3141
  columns: memberColumns,
@@ -2944,18 +3145,18 @@ const OrganizationsPanel = () => {
2944
3145
  rows: members,
2945
3146
  testId: "org-members"
2946
3147
  }, void 0, false);
2947
- $[64] = memberColumns;
2948
- $[65] = members;
2949
- $[66] = onRemoveMember;
2950
- $[67] = selected;
2951
- $[68] = t;
2952
- $[69] = t24;
3148
+ $[77] = memberColumns;
3149
+ $[78] = members;
3150
+ $[79] = onRemoveMember;
3151
+ $[80] = selected;
3152
+ $[81] = t;
3153
+ $[82] = t31;
2953
3154
  } else {
2954
- t24 = $[69];
3155
+ t31 = $[82];
2955
3156
  }
2956
- let t25;
2957
- if ($[70] !== invitationColumns || $[71] !== invitations || $[72] !== onCancelInvitation || $[73] !== selected || $[74] !== t) {
2958
- t25 = selected !== null && invitations !== null && invitations.length > 0 && /* @__PURE__ */ jsxDEV(OrgRowTable, {
3157
+ let t32;
3158
+ if ($[83] !== invitationColumns || $[84] !== invitations || $[85] !== onCancelInvitation || $[86] !== selected || $[87] !== t) {
3159
+ t32 = selected !== null && invitations !== null && invitations.length > 0 && /* @__PURE__ */ jsxDEV(OrgRowTable, {
2959
3160
  actionLabel: t("Cancel"),
2960
3161
  actionPrefix: "org-cancel-invitation",
2961
3162
  columns: invitationColumns,
@@ -2965,57 +3166,51 @@ const OrganizationsPanel = () => {
2965
3166
  rows: invitations,
2966
3167
  testId: "org-invitations"
2967
3168
  }, void 0, false);
2968
- $[70] = invitationColumns;
2969
- $[71] = invitations;
2970
- $[72] = onCancelInvitation;
2971
- $[73] = selected;
2972
- $[74] = t;
2973
- $[75] = t25;
3169
+ $[83] = invitationColumns;
3170
+ $[84] = invitations;
3171
+ $[85] = onCancelInvitation;
3172
+ $[86] = selected;
3173
+ $[87] = t;
3174
+ $[88] = t32;
2974
3175
  } else {
2975
- t25 = $[75];
3176
+ t32 = $[88];
2976
3177
  }
2977
- let t26;
2978
- if ($[76] !== t21 || $[77] !== t22 || $[78] !== t23 || $[79] !== t24 || $[80] !== t25) {
2979
- t26 = /* @__PURE__ */ jsxDEV("div", {
3178
+ let t33;
3179
+ if ($[89] !== t28 || $[90] !== t29 || $[91] !== t30 || $[92] !== t31 || $[93] !== t32) {
3180
+ t33 = /* @__PURE__ */ jsxDEV("div", {
2980
3181
  className: "flex flex-col gap-4",
2981
3182
  "data-testid": "lunora-organizations",
2982
- children: [t21, t22, t23, t24, t25]
3183
+ children: [t28, t29, t30, t31, t32]
2983
3184
  }, void 0, true);
2984
- $[76] = t21;
2985
- $[77] = t22;
2986
- $[78] = t23;
2987
- $[79] = t24;
2988
- $[80] = t25;
2989
- $[81] = t26;
3185
+ $[89] = t28;
3186
+ $[90] = t29;
3187
+ $[91] = t30;
3188
+ $[92] = t31;
3189
+ $[93] = t32;
3190
+ $[94] = t33;
2990
3191
  } else {
2991
- t26 = $[81];
3192
+ t33 = $[94];
2992
3193
  }
2993
- return t26;
3194
+ return t33;
2994
3195
  };
2995
- function _temp$1(column) {
3196
+ function _temp$5(column) {
2996
3197
  return /* @__PURE__ */ jsxDEV(TableHead, {
2997
3198
  children: column.head
2998
3199
  }, column.head, false);
2999
3200
  }
3000
- function _temp2$1(value) {
3001
- return value + 1;
3002
- }
3003
- function _temp3(value_0) {
3004
- return value_0 + 1;
3005
- }
3006
- function _temp4(row) {
3201
+ function _temp2$3(row) {
3007
3202
  return formatCell(row.userId);
3008
3203
  }
3009
- function _temp5(row_0) {
3204
+ function _temp3(row_0) {
3010
3205
  return formatCell(row_0.role);
3011
3206
  }
3012
- function _temp6(row_1) {
3207
+ function _temp4(row_1) {
3013
3208
  return formatCell(row_1.email);
3014
3209
  }
3015
- function _temp7(row_2) {
3210
+ function _temp5(row_2) {
3016
3211
  return formatCell(row_2.role);
3017
3212
  }
3018
- function _temp8(row_3) {
3213
+ function _temp6(row_3) {
3019
3214
  return formatCell(row_3.status);
3020
3215
  }
3021
3216
 
@@ -4092,8 +4287,6 @@ const UsersPanel = ({
4092
4287
  } = {}) => {
4093
4288
  const client = useLunora();
4094
4289
  const t = useT();
4095
- const [users, setUsers] = useState(null);
4096
- const [usersError, setUsersError] = useState(null);
4097
4290
  const [search, setSearch] = useState("");
4098
4291
  const [roleFilter, setRoleFilter] = useState("");
4099
4292
  const debouncedSearch = useDebounced(search);
@@ -4102,31 +4295,23 @@ const UsersPanel = ({
4102
4295
  const {
4103
4296
  capabilities
4104
4297
  } = useAuthCapabilities();
4105
- const fetchUsers = async () => {
4106
- setUsersError(null);
4107
- const trimmedSearch = debouncedSearch.trim();
4108
- const trimmedRole = roleFilter.trim();
4109
- try {
4110
- const page = await client.listAuthUsers({
4111
- filterField: trimmedRole === "" ? void 0 : "role",
4112
- filterValue: trimmedRole === "" ? void 0 : trimmedRole,
4113
- limit: pageSize,
4114
- search: trimmedSearch === "" ? void 0 : trimmedSearch
4115
- });
4116
- setUsers(page.rows);
4117
- } catch (error_) {
4118
- setUsers(null);
4119
- setUsersError(errorMessage(error_));
4120
- }
4121
- };
4298
+ const trimmedSearch = debouncedSearch.trim();
4299
+ const trimmedRole = roleFilter.trim();
4300
+ const usersQuery = useClientQuery(["lunora-auth-users", trimmedSearch, trimmedRole, pageSize], () => client.listAuthUsers({
4301
+ filterField: trimmedRole === "" ? void 0 : "role",
4302
+ filterValue: trimmedRole === "" ? void 0 : trimmedRole,
4303
+ limit: pageSize,
4304
+ search: trimmedSearch === "" ? void 0 : trimmedSearch
4305
+ }), {
4306
+ keepPreviousData: true
4307
+ });
4308
+ const users = usersQuery.data?.rows ?? null;
4309
+ const usersError = usersQuery.error;
4122
4310
  const reloadUsers = () => {
4123
- fireAndForget(fetchUsers());
4311
+ usersQuery.refetch();
4124
4312
  };
4125
- useEffect(() => {
4126
- fireAndForget(fetchUsers());
4127
- }, [fetchUsers]);
4128
4313
  useAutoRefresh(() => {
4129
- fireAndForget(fetchUsers());
4314
+ usersQuery.refetch();
4130
4315
  }, true);
4131
4316
  const selectedUser = selectedUserId === null ? null : users?.find((user) => user.id === selectedUserId) ?? null;
4132
4317
  return /* @__PURE__ */ jsxDEV("div", {
@@ -4545,37 +4730,18 @@ const CronTriggersPanel = ({
4545
4730
  } = {}) => {
4546
4731
  const client = useLunora();
4547
4732
  const t = useT();
4548
- const [jobs, setJobs] = useState(null);
4549
- const [error, setError] = useState(null);
4550
4733
  const [runStates, setRunStates] = useState({});
4734
+ const jobsQuery = useClientQuery(["lunora-cron-jobs", loadCronJobs ? "custom" : "default"], () => (loadCronJobs ?? (() => client.getCronJobs()))());
4735
+ const {
4736
+ data: jobs,
4737
+ error
4738
+ } = jobsQuery;
4551
4739
  const runImpl = useMemo(() => {
4552
4740
  if (runCronJob !== void 0) {
4553
4741
  return runCronJob;
4554
4742
  }
4555
4743
  return loadCronJobs === void 0 ? (name) => client.runCronJob(name) : void 0;
4556
4744
  }, [client, loadCronJobs, runCronJob]);
4557
- useEffect(() => {
4558
- const token = {
4559
- cancelled: false
4560
- };
4561
- fireAndForget((async () => {
4562
- try {
4563
- const records = await (loadCronJobs ?? (() => client.getCronJobs()))();
4564
- if (!token.cancelled) {
4565
- setJobs(records);
4566
- setError(null);
4567
- }
4568
- } catch (error_) {
4569
- if (!token.cancelled) {
4570
- setJobs(null);
4571
- setError(errorMessage(error_));
4572
- }
4573
- }
4574
- })());
4575
- return () => {
4576
- token.cancelled = true;
4577
- };
4578
- }, [client, loadCronJobs]);
4579
4745
  const run = async (name_0) => {
4580
4746
  if (runImpl === void 0) {
4581
4747
  return;
@@ -4598,13 +4764,14 @@ const CronTriggersPanel = ({
4598
4764
  }
4599
4765
  };
4600
4766
  });
4601
- } catch (error__0) {
4767
+ jobsQuery.refetch();
4768
+ } catch (error_) {
4602
4769
  setRunStates((previous_0) => {
4603
4770
  return {
4604
4771
  ...previous_0,
4605
4772
  [name_0]: {
4606
4773
  kind: "error",
4607
- message: errorMessage(error__0)
4774
+ message: errorMessage(error_)
4608
4775
  }
4609
4776
  };
4610
4777
  });
@@ -4618,7 +4785,7 @@ const CronTriggersPanel = ({
4618
4785
  "data-testid": "cron-error",
4619
4786
  role: "alert",
4620
4787
  children: error
4621
- }, void 0, false), jobs !== null && jobs.length === 0 && /* @__PURE__ */ jsxDEV(EmptyState, {
4788
+ }, void 0, false), jobs?.length === 0 && /* @__PURE__ */ jsxDEV(EmptyState, {
4622
4789
  description: t("Triggers declared with the cronJobs() builder appear here."),
4623
4790
  icon: /* @__PURE__ */ jsxDEV("svg", {
4624
4791
  "aria-hidden": "true",
@@ -4638,7 +4805,7 @@ const CronTriggersPanel = ({
4638
4805
  }, void 0, true),
4639
4806
  testId: "cron-empty",
4640
4807
  title: t("No cron triggers.")
4641
- }, void 0, false), jobs !== null && jobs.length > 0 && /* @__PURE__ */ jsxDEV(Card, {
4808
+ }, void 0, false), jobs !== void 0 && jobs.length > 0 && /* @__PURE__ */ jsxDEV(Card, {
4642
4809
  className: "overflow-hidden py-0",
4643
4810
  children: /* @__PURE__ */ jsxDEV(CardContent, {
4644
4811
  className: "px-0",
@@ -4718,54 +4885,115 @@ const CronTriggersPanel = ({
4718
4885
  };
4719
4886
 
4720
4887
  const formatScheduledFor = (value) => Number.isFinite(value) ? formatTimestamp(value, "—") : "—";
4721
- const DeadLetterJobs = ({
4722
- loadJobs,
4723
- removeJob,
4724
- retryJob
4725
- } = {}) => {
4888
+ const DeadLetterJobs = (t0) => {
4889
+ const $ = c(34);
4890
+ let t1;
4891
+ if ($[0] !== t0) {
4892
+ t1 = t0 === void 0 ? {} : t0;
4893
+ $[0] = t0;
4894
+ $[1] = t1;
4895
+ } else {
4896
+ t1 = $[1];
4897
+ }
4898
+ const {
4899
+ loadJobs,
4900
+ removeJob,
4901
+ retryJob
4902
+ } = t1;
4726
4903
  const client = useLunora();
4727
4904
  const t = useT();
4728
- const [jobs, setJobs] = useState(null);
4729
- const [error, setError] = useState(null);
4730
- const load = loadJobs ?? (() => client.listDeadJobs());
4905
+ let t2;
4906
+ if ($[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
4907
+ t2 = ["lunora-dead-jobs"];
4908
+ $[2] = t2;
4909
+ } else {
4910
+ t2 = $[2];
4911
+ }
4912
+ let t3;
4913
+ if ($[3] !== client || $[4] !== loadJobs) {
4914
+ t3 = async () => {
4915
+ const records = await (loadJobs ?? (() => client.listDeadJobs()))();
4916
+ return records.toSorted(_temp$4);
4917
+ };
4918
+ $[3] = client;
4919
+ $[4] = loadJobs;
4920
+ $[5] = t3;
4921
+ } else {
4922
+ t3 = $[5];
4923
+ }
4924
+ const jobsQuery = useClientQuery(t2, t3);
4925
+ const jobs = jobsQuery.data;
4926
+ const [actionError, setActionError] = useState(void 0);
4927
+ const error = jobsQuery.error ?? actionError;
4731
4928
  const clientOwned = loadJobs === void 0;
4732
- const retryImpl = retryJob ?? (clientOwned ? (id) => client.retryDeadJob(id) : void 0);
4733
- const removeImpl = removeJob ?? (clientOwned ? (id) => client.removeDeadJob(id) : void 0);
4734
- const refresh = async () => {
4735
- setError(null);
4736
- try {
4737
- const records = await load();
4738
- setJobs(records.toSorted((a, b) => (b.attempts ?? 0) - (a.attempts ?? 0)));
4739
- } catch (error_) {
4740
- setJobs(null);
4741
- setError(errorMessage(error_));
4742
- }
4743
- };
4744
- useEffect(() => {
4745
- fireAndForget(refresh());
4746
- }, []);
4747
- useAutoRefresh(() => {
4748
- fireAndForget(refresh());
4749
- }, true);
4750
- const act = async (operation) => {
4751
- setError(null);
4752
- try {
4753
- await operation;
4754
- await refresh();
4755
- } catch (error_) {
4756
- setError(errorMessage(error_));
4757
- }
4758
- };
4929
+ let t4;
4930
+ if ($[6] !== client || $[7] !== clientOwned || $[8] !== retryJob) {
4931
+ t4 = retryJob ?? (clientOwned ? (id) => client.retryDeadJob(id) : void 0);
4932
+ $[6] = client;
4933
+ $[7] = clientOwned;
4934
+ $[8] = retryJob;
4935
+ $[9] = t4;
4936
+ } else {
4937
+ t4 = $[9];
4938
+ }
4939
+ const retryImpl = t4;
4940
+ let t5;
4941
+ if ($[10] !== client || $[11] !== clientOwned || $[12] !== removeJob) {
4942
+ t5 = removeJob ?? (clientOwned ? (id_0) => client.removeDeadJob(id_0) : void 0);
4943
+ $[10] = client;
4944
+ $[11] = clientOwned;
4945
+ $[12] = removeJob;
4946
+ $[13] = t5;
4947
+ } else {
4948
+ t5 = $[13];
4949
+ }
4950
+ const removeImpl = t5;
4951
+ let t6;
4952
+ if ($[14] !== jobsQuery) {
4953
+ t6 = () => {
4954
+ jobsQuery.refetch();
4955
+ };
4956
+ $[14] = jobsQuery;
4957
+ $[15] = t6;
4958
+ } else {
4959
+ t6 = $[15];
4960
+ }
4961
+ useAutoRefresh(t6, true);
4962
+ let t7;
4963
+ if ($[16] !== jobsQuery) {
4964
+ t7 = async (operation) => {
4965
+ setActionError(void 0);
4966
+ try {
4967
+ await operation;
4968
+ jobsQuery.refetch();
4969
+ } catch (t82) {
4970
+ const error_ = t82;
4971
+ setActionError(errorMessage(error_));
4972
+ }
4973
+ };
4974
+ $[16] = jobsQuery;
4975
+ $[17] = t7;
4976
+ } else {
4977
+ t7 = $[17];
4978
+ }
4979
+ const act = t7;
4759
4980
  const hasActions = retryImpl !== void 0 || removeImpl !== void 0;
4760
- return /* @__PURE__ */ jsxDEV("div", {
4761
- className: "flex flex-col gap-3",
4762
- "data-testid": "lunora-dead-letter",
4763
- children: [error !== null && /* @__PURE__ */ jsxDEV("p", {
4981
+ let t8;
4982
+ if ($[18] !== error) {
4983
+ t8 = error !== void 0 && /* @__PURE__ */ jsxDEV("p", {
4764
4984
  className: "text-sm text-destructive",
4765
4985
  "data-testid": "dlq-error",
4766
4986
  role: "alert",
4767
4987
  children: error
4768
- }, void 0, false), jobs !== null && jobs.length === 0 && /* @__PURE__ */ jsxDEV(EmptyState, {
4988
+ }, void 0, false);
4989
+ $[18] = error;
4990
+ $[19] = t8;
4991
+ } else {
4992
+ t8 = $[19];
4993
+ }
4994
+ let t9;
4995
+ if ($[20] !== jobs?.length || $[21] !== t) {
4996
+ t9 = jobs?.length === 0 && /* @__PURE__ */ jsxDEV(EmptyState, {
4769
4997
  description: t("Jobs that exhaust their retry budget are parked here instead of being dropped."),
4770
4998
  icon: /* @__PURE__ */ jsxDEV("svg", {
4771
4999
  "aria-hidden": "true",
@@ -4781,7 +5009,16 @@ const DeadLetterJobs = ({
4781
5009
  }, void 0, false),
4782
5010
  testId: "dlq-empty",
4783
5011
  title: t("No dead-letter jobs.")
4784
- }, void 0, false), jobs !== null && jobs.length > 0 && /* @__PURE__ */ jsxDEV(Card, {
5012
+ }, void 0, false);
5013
+ $[20] = jobs?.length;
5014
+ $[21] = t;
5015
+ $[22] = t9;
5016
+ } else {
5017
+ t9 = $[22];
5018
+ }
5019
+ let t10;
5020
+ if ($[23] !== act || $[24] !== hasActions || $[25] !== jobs || $[26] !== removeImpl || $[27] !== retryImpl || $[28] !== t) {
5021
+ t10 = jobs !== void 0 && jobs.length > 0 && /* @__PURE__ */ jsxDEV(Card, {
4785
5022
  className: "overflow-hidden py-0",
4786
5023
  children: /* @__PURE__ */ jsxDEV(CardContent, {
4787
5024
  className: "px-0",
@@ -4852,9 +5089,36 @@ const DeadLetterJobs = ({
4852
5089
  }, void 0, false)]
4853
5090
  }, void 0, true)
4854
5091
  }, void 0, false)
4855
- }, void 0, false)]
4856
- }, void 0, true);
5092
+ }, void 0, false);
5093
+ $[23] = act;
5094
+ $[24] = hasActions;
5095
+ $[25] = jobs;
5096
+ $[26] = removeImpl;
5097
+ $[27] = retryImpl;
5098
+ $[28] = t;
5099
+ $[29] = t10;
5100
+ } else {
5101
+ t10 = $[29];
5102
+ }
5103
+ let t11;
5104
+ if ($[30] !== t10 || $[31] !== t8 || $[32] !== t9) {
5105
+ t11 = /* @__PURE__ */ jsxDEV("div", {
5106
+ className: "flex flex-col gap-3",
5107
+ "data-testid": "lunora-dead-letter",
5108
+ children: [t8, t9, t10]
5109
+ }, void 0, true);
5110
+ $[30] = t10;
5111
+ $[31] = t8;
5112
+ $[32] = t9;
5113
+ $[33] = t11;
5114
+ } else {
5115
+ t11 = $[33];
5116
+ }
5117
+ return t11;
4857
5118
  };
5119
+ function _temp$4(a, b) {
5120
+ return (b.attempts ?? 0) - (a.attempts ?? 0);
5121
+ }
4858
5122
 
4859
5123
  const StatTile = (t0) => {
4860
5124
  const $ = c(8);
@@ -4904,42 +5168,77 @@ const StatTile = (t0) => {
4904
5168
  }
4905
5169
  return t3;
4906
5170
  };
4907
- const SchedulerPoolsPanel = ({
4908
- loadStatus
4909
- } = {}) => {
5171
+ const SchedulerPoolsPanel = (t0) => {
5172
+ const $ = c(25);
5173
+ let t1;
5174
+ if ($[0] !== t0) {
5175
+ t1 = t0 === void 0 ? {} : t0;
5176
+ $[0] = t0;
5177
+ $[1] = t1;
5178
+ } else {
5179
+ t1 = $[1];
5180
+ }
5181
+ const {
5182
+ loadStatus
5183
+ } = t1;
4910
5184
  const client = useLunora();
4911
5185
  const t = useT();
4912
- const [status, setStatus] = useState(null);
4913
- const [error, setError] = useState(null);
4914
- const load = loadStatus ?? (() => client.schedulerStatus());
4915
- const refresh = async () => {
4916
- setError(null);
4917
- try {
4918
- const next = await load();
4919
- setStatus({
5186
+ const t2 = loadStatus === void 0;
5187
+ let t3;
5188
+ if ($[2] !== t2) {
5189
+ t3 = ["lunora-scheduler-status", t2];
5190
+ $[2] = t2;
5191
+ $[3] = t3;
5192
+ } else {
5193
+ t3 = $[3];
5194
+ }
5195
+ let t4;
5196
+ if ($[4] !== client || $[5] !== loadStatus) {
5197
+ t4 = async () => {
5198
+ const next = await (loadStatus ?? (() => client.schedulerStatus()))();
5199
+ return {
4920
5200
  ...next,
4921
- pools: next.pools.toSorted((a, b) => b.queued - a.queued)
4922
- });
4923
- } catch (error_) {
4924
- setStatus(null);
4925
- setError(errorMessage(error_));
4926
- }
4927
- };
4928
- useEffect(() => {
4929
- fireAndForget(refresh());
4930
- }, []);
4931
- useAutoRefresh(() => {
4932
- fireAndForget(refresh());
4933
- }, true);
4934
- return /* @__PURE__ */ jsxDEV("div", {
4935
- className: "flex flex-col gap-3",
4936
- "data-testid": "lunora-scheduler-pools",
4937
- children: [error !== null && /* @__PURE__ */ jsxDEV("p", {
5201
+ pools: next.pools.toSorted(_temp$3)
5202
+ };
5203
+ };
5204
+ $[4] = client;
5205
+ $[5] = loadStatus;
5206
+ $[6] = t4;
5207
+ } else {
5208
+ t4 = $[6];
5209
+ }
5210
+ const statusQuery = useClientQuery(t3, t4);
5211
+ const {
5212
+ data: status,
5213
+ error
5214
+ } = statusQuery;
5215
+ let t5;
5216
+ if ($[7] !== statusQuery) {
5217
+ t5 = () => {
5218
+ statusQuery.refetch();
5219
+ };
5220
+ $[7] = statusQuery;
5221
+ $[8] = t5;
5222
+ } else {
5223
+ t5 = $[8];
5224
+ }
5225
+ useAutoRefresh(t5, true);
5226
+ let t6;
5227
+ if ($[9] !== error) {
5228
+ t6 = error !== null && /* @__PURE__ */ jsxDEV("p", {
4938
5229
  className: "text-sm text-destructive",
4939
5230
  "data-testid": "pools-error",
4940
5231
  role: "alert",
4941
5232
  children: error
4942
- }, void 0, false), status !== null && /* @__PURE__ */ jsxDEV("div", {
5233
+ }, void 0, false);
5234
+ $[9] = error;
5235
+ $[10] = t6;
5236
+ } else {
5237
+ t6 = $[10];
5238
+ }
5239
+ let t7;
5240
+ if ($[11] !== status || $[12] !== t) {
5241
+ t7 = status !== void 0 && /* @__PURE__ */ jsxDEV("div", {
4943
5242
  className: "flex gap-3",
4944
5243
  "data-testid": "pools-totals",
4945
5244
  children: [/* @__PURE__ */ jsxDEV(StatTile, {
@@ -4955,7 +5254,16 @@ const SchedulerPoolsPanel = ({
4955
5254
  testId: "pools-count",
4956
5255
  value: status.pools.length
4957
5256
  }, void 0, false)]
4958
- }, void 0, true), status !== null && status.pools.length === 0 && /* @__PURE__ */ jsxDEV(EmptyState, {
5257
+ }, void 0, true);
5258
+ $[11] = status;
5259
+ $[12] = t;
5260
+ $[13] = t7;
5261
+ } else {
5262
+ t7 = $[13];
5263
+ }
5264
+ let t8;
5265
+ if ($[14] !== status?.pools.length || $[15] !== t) {
5266
+ t8 = status?.pools.length === 0 && /* @__PURE__ */ jsxDEV(EmptyState, {
4959
5267
  description: t("Pools created with createWorkpool appear here once they have activity."),
4960
5268
  icon: /* @__PURE__ */ jsxDEV("svg", {
4961
5269
  "aria-hidden": "true",
@@ -4971,7 +5279,16 @@ const SchedulerPoolsPanel = ({
4971
5279
  }, void 0, false),
4972
5280
  testId: "pools-empty",
4973
5281
  title: t("No workpools.")
4974
- }, void 0, false), status !== null && status.pools.length > 0 && /* @__PURE__ */ jsxDEV(Card, {
5282
+ }, void 0, false);
5283
+ $[14] = status?.pools.length;
5284
+ $[15] = t;
5285
+ $[16] = t8;
5286
+ } else {
5287
+ t8 = $[16];
5288
+ }
5289
+ let t9;
5290
+ if ($[17] !== status || $[18] !== t) {
5291
+ t9 = status !== void 0 && status.pools.length > 0 && /* @__PURE__ */ jsxDEV(Card, {
4975
5292
  className: "overflow-hidden py-0",
4976
5293
  children: /* @__PURE__ */ jsxDEV(CardContent, {
4977
5294
  className: "px-0",
@@ -4990,28 +5307,55 @@ const SchedulerPoolsPanel = ({
4990
5307
  }, void 0, false)]
4991
5308
  }, void 0, true)
4992
5309
  }, void 0, false), /* @__PURE__ */ jsxDEV(TableBody, {
4993
- children: status.pools.map((pool) => /* @__PURE__ */ jsxDEV(TableRow, {
4994
- "data-testid": `pools-row-${pool.name}`,
4995
- children: [/* @__PURE__ */ jsxDEV(TableCell, {
4996
- className: "font-mono text-xs",
4997
- children: pool.name
4998
- }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
4999
- className: "tabular-nums",
5000
- children: pool.queued
5001
- }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
5002
- className: "tabular-nums",
5003
- children: [pool.inFlight, " / ", pool.maxConcurrency]
5004
- }, void 0, true), /* @__PURE__ */ jsxDEV(TableCell, {
5005
- className: "tabular-nums",
5006
- children: pool.maxConcurrency
5007
- }, void 0, false)]
5008
- }, pool.name, true))
5310
+ children: status.pools.map(_temp2$2)
5009
5311
  }, void 0, false)]
5010
5312
  }, void 0, true)
5011
5313
  }, void 0, false)
5012
- }, void 0, false)]
5013
- }, void 0, true);
5314
+ }, void 0, false);
5315
+ $[17] = status;
5316
+ $[18] = t;
5317
+ $[19] = t9;
5318
+ } else {
5319
+ t9 = $[19];
5320
+ }
5321
+ let t10;
5322
+ if ($[20] !== t6 || $[21] !== t7 || $[22] !== t8 || $[23] !== t9) {
5323
+ t10 = /* @__PURE__ */ jsxDEV("div", {
5324
+ className: "flex flex-col gap-3",
5325
+ "data-testid": "lunora-scheduler-pools",
5326
+ children: [t6, t7, t8, t9]
5327
+ }, void 0, true);
5328
+ $[20] = t6;
5329
+ $[21] = t7;
5330
+ $[22] = t8;
5331
+ $[23] = t9;
5332
+ $[24] = t10;
5333
+ } else {
5334
+ t10 = $[24];
5335
+ }
5336
+ return t10;
5014
5337
  };
5338
+ function _temp$3(a, b) {
5339
+ return b.queued - a.queued;
5340
+ }
5341
+ function _temp2$2(pool) {
5342
+ return /* @__PURE__ */ jsxDEV(TableRow, {
5343
+ "data-testid": `pools-row-${pool.name}`,
5344
+ children: [/* @__PURE__ */ jsxDEV(TableCell, {
5345
+ className: "font-mono text-xs",
5346
+ children: pool.name
5347
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
5348
+ className: "tabular-nums",
5349
+ children: pool.queued
5350
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
5351
+ className: "tabular-nums",
5352
+ children: [pool.inFlight, " / ", pool.maxConcurrency]
5353
+ }, void 0, true), /* @__PURE__ */ jsxDEV(TableCell, {
5354
+ className: "tabular-nums",
5355
+ children: pool.maxConcurrency
5356
+ }, void 0, false)]
5357
+ }, pool.name, true);
5358
+ }
5015
5359
 
5016
5360
  const VIEW_KEYS = ["jobs", "dead", "pools", "cron"];
5017
5361
  const SchedulePanel = (t0) => {
@@ -5191,7 +5535,6 @@ const SchedulePanel = (t0) => {
5191
5535
  return t15;
5192
5536
  };
5193
5537
 
5194
- const LIST_SUBSCRIPTIONS = adminRef(ADMIN_FUNCTIONS.listSubscriptions);
5195
5538
  const ARGS_MAX = 80;
5196
5539
  const formatArguments = (args) => {
5197
5540
  if (args === void 0) {
@@ -5229,89 +5572,63 @@ const DASH = /* @__PURE__ */ jsxDEV("span", {
5229
5572
  children: "—"
5230
5573
  }, void 0, false);
5231
5574
  const SubscriptionsPanel = (t0) => {
5232
- const $ = c(26);
5575
+ const $ = c(20);
5233
5576
  const {
5234
5577
  initialShardKey
5235
5578
  } = t0;
5236
- const client = useLunora();
5237
5579
  const t = useT();
5238
5580
  const [shardKey, setShardKey] = useState(initialShardKey ?? "");
5239
- const [result, setResult] = useState(null);
5240
- const [error, setError] = useState(null);
5241
5581
  let t1;
5242
- if ($[0] !== client) {
5243
- t1 = async (shard) => {
5244
- setError(null);
5245
- try {
5246
- const next = await client.query(LIST_SUBSCRIPTIONS, {}, callOptions(shard));
5247
- setResult(next);
5248
- } catch (t22) {
5249
- const error_ = t22;
5250
- setResult(null);
5251
- setError(errorMessage(error_));
5252
- }
5253
- };
5254
- $[0] = client;
5582
+ if ($[0] !== shardKey) {
5583
+ t1 = shardKey.trim();
5584
+ $[0] = shardKey;
5255
5585
  $[1] = t1;
5256
5586
  } else {
5257
5587
  t1 = $[1];
5258
5588
  }
5259
- const refresh = t1;
5589
+ const debouncedShard = useDebounced(t1, 400);
5260
5590
  let t2;
5261
- if ($[2] !== shardKey) {
5262
- t2 = shardKey.trim();
5263
- $[2] = shardKey;
5264
- $[3] = t2;
5591
+ if ($[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
5592
+ t2 = {};
5593
+ $[2] = t2;
5265
5594
  } else {
5266
- t2 = $[3];
5595
+ t2 = $[2];
5267
5596
  }
5268
- const debouncedShard = useDebounced(t2, 400);
5269
5597
  let t3;
5270
- let t4;
5271
- if ($[4] !== debouncedShard || $[5] !== refresh) {
5272
- t3 = () => {
5273
- fireAndForget(refresh(debouncedShard));
5274
- };
5275
- t4 = [refresh, debouncedShard];
5276
- $[4] = debouncedShard;
5277
- $[5] = refresh;
5278
- $[6] = t3;
5279
- $[7] = t4;
5280
- } else {
5281
- t3 = $[6];
5282
- t4 = $[7];
5283
- }
5284
- useEffect(t3, t4);
5285
- let t5;
5286
- if ($[8] !== debouncedShard || $[9] !== refresh) {
5287
- t5 = () => {
5288
- fireAndForget(refresh(debouncedShard));
5598
+ if ($[3] !== debouncedShard) {
5599
+ t3 = {
5600
+ keepPreviousData: true,
5601
+ shardKey: debouncedShard
5289
5602
  };
5290
- $[8] = debouncedShard;
5291
- $[9] = refresh;
5292
- $[10] = t5;
5603
+ $[3] = debouncedShard;
5604
+ $[4] = t3;
5293
5605
  } else {
5294
- t5 = $[10];
5606
+ t3 = $[4];
5295
5607
  }
5296
- useAutoRefresh(t5, true);
5297
- let t6;
5298
- if ($[11] !== error || $[12] !== result || $[13] !== shardKey || $[14] !== t) {
5299
- const rows = result === null ? [] : toRows(result.connections);
5300
- let t7;
5301
- if ($[16] !== shardKey) {
5302
- t7 = /* @__PURE__ */ jsxDEV(ShardInput, {
5608
+ const {
5609
+ data: result,
5610
+ error,
5611
+ refetch
5612
+ } = useAdminQuery(ADMIN_FUNCTIONS.listSubscriptions, t2, t3);
5613
+ useAutoRefresh(refetch, true);
5614
+ let t4;
5615
+ if ($[5] !== error || $[6] !== result || $[7] !== shardKey || $[8] !== t) {
5616
+ const rows = result === void 0 ? [] : toRows(result.connections);
5617
+ let t5;
5618
+ if ($[10] !== shardKey) {
5619
+ t5 = /* @__PURE__ */ jsxDEV(ShardInput, {
5303
5620
  onChange: setShardKey,
5304
5621
  testId: "subs-shard-input",
5305
5622
  value: shardKey
5306
5623
  }, void 0, false);
5307
- $[16] = shardKey;
5308
- $[17] = t7;
5624
+ $[10] = shardKey;
5625
+ $[11] = t5;
5309
5626
  } else {
5310
- t7 = $[17];
5627
+ t5 = $[11];
5311
5628
  }
5312
- let t8;
5313
- if ($[18] !== result || $[19] !== t) {
5314
- t8 = result !== null && /* @__PURE__ */ jsxDEV("div", {
5629
+ let t6;
5630
+ if ($[12] !== result || $[13] !== t) {
5631
+ t6 = result !== void 0 && /* @__PURE__ */ jsxDEV("div", {
5315
5632
  className: "ml-auto flex items-center gap-2 text-sm text-muted-foreground",
5316
5633
  "data-testid": "subs-count",
5317
5634
  children: [/* @__PURE__ */ jsxDEV(Badge, {
@@ -5326,41 +5643,41 @@ const SubscriptionsPanel = (t0) => {
5326
5643
  })
5327
5644
  }, void 0, false)]
5328
5645
  }, void 0, true);
5329
- $[18] = result;
5330
- $[19] = t;
5331
- $[20] = t8;
5646
+ $[12] = result;
5647
+ $[13] = t;
5648
+ $[14] = t6;
5332
5649
  } else {
5333
- t8 = $[20];
5650
+ t6 = $[14];
5334
5651
  }
5335
- let t9;
5336
- if ($[21] !== t7 || $[22] !== t8) {
5337
- t9 = /* @__PURE__ */ jsxDEV("div", {
5652
+ let t7;
5653
+ if ($[15] !== t5 || $[16] !== t6) {
5654
+ t7 = /* @__PURE__ */ jsxDEV("div", {
5338
5655
  className: "flex flex-wrap items-center gap-2",
5339
- children: [t7, t8]
5656
+ children: [t5, t6]
5340
5657
  }, void 0, true);
5341
- $[21] = t7;
5342
- $[22] = t8;
5343
- $[23] = t9;
5658
+ $[15] = t5;
5659
+ $[16] = t6;
5660
+ $[17] = t7;
5344
5661
  } else {
5345
- t9 = $[23];
5662
+ t7 = $[17];
5346
5663
  }
5347
- let t10;
5348
- if ($[24] !== error) {
5349
- t10 = error !== null && /* @__PURE__ */ jsxDEV("p", {
5664
+ let t8;
5665
+ if ($[18] !== error) {
5666
+ t8 = error !== null && /* @__PURE__ */ jsxDEV("p", {
5350
5667
  className: "text-sm text-destructive",
5351
5668
  "data-testid": "subs-error",
5352
5669
  role: "alert",
5353
5670
  children: error
5354
5671
  }, void 0, false);
5355
- $[24] = error;
5356
- $[25] = t10;
5672
+ $[18] = error;
5673
+ $[19] = t8;
5357
5674
  } else {
5358
- t10 = $[25];
5675
+ t8 = $[19];
5359
5676
  }
5360
- t6 = /* @__PURE__ */ jsxDEV("div", {
5677
+ t4 = /* @__PURE__ */ jsxDEV("div", {
5361
5678
  className: "flex flex-col gap-4",
5362
5679
  "data-testid": "subs-panel",
5363
- children: [t9, t10, error === null && result !== null && rows.length === 0 && /* @__PURE__ */ jsxDEV(EmptyState, {
5680
+ children: [t7, t8, error === null && result !== void 0 && rows.length === 0 && /* @__PURE__ */ jsxDEV(EmptyState, {
5364
5681
  description: t("Active WebSocket subscriptions on this shard."),
5365
5682
  icon: /* @__PURE__ */ jsxDEV("svg", {
5366
5683
  "aria-hidden": "true",
@@ -5376,7 +5693,7 @@ const SubscriptionsPanel = (t0) => {
5376
5693
  }, void 0, false),
5377
5694
  testId: "subs-empty",
5378
5695
  title: t("No active subscriptions.")
5379
- }, void 0, false), rows.length > 0 && /* @__PURE__ */ jsxDEV(Card, {
5696
+ }, void 0, false), error === null && rows.length > 0 && /* @__PURE__ */ jsxDEV(Card, {
5380
5697
  className: "overflow-hidden py-0",
5381
5698
  children: /* @__PURE__ */ jsxDEV(CardContent, {
5382
5699
  className: "px-0",
@@ -5428,18 +5745,17 @@ const SubscriptionsPanel = (t0) => {
5428
5745
  }, void 0, false)
5429
5746
  }, void 0, false)]
5430
5747
  }, void 0, true);
5431
- $[11] = error;
5432
- $[12] = result;
5433
- $[13] = shardKey;
5434
- $[14] = t;
5435
- $[15] = t6;
5748
+ $[5] = error;
5749
+ $[6] = result;
5750
+ $[7] = shardKey;
5751
+ $[8] = t;
5752
+ $[9] = t4;
5436
5753
  } else {
5437
- t6 = $[15];
5754
+ t4 = $[9];
5438
5755
  }
5439
- return t6;
5756
+ return t4;
5440
5757
  };
5441
5758
 
5442
- const READ_TABLE_PAGE = adminRef(ADMIN_FUNCTIONS.readTablePage);
5443
5759
  const ACTIVE_STATES = /* @__PURE__ */ new Set(["active", "trialing"]);
5444
5760
  const ALERT_STATES = /* @__PURE__ */ new Set(["past_due", "unpaid"]);
5445
5761
  const readField = (row, key) => {
@@ -5470,44 +5786,33 @@ const badgeVariant = (state) => {
5470
5786
  }
5471
5787
  return ALERT_STATES.has(state) ? "destructive" : "outline";
5472
5788
  };
5473
- const readRows = async (client, table, limit) => {
5474
- const page = await client.query(READ_TABLE_PAGE, {
5789
+ const PaymentsPanel = ({
5790
+ limit = 100
5791
+ }) => {
5792
+ const t = useT();
5793
+ const subscriptionsQuery = useAdminQuery(ADMIN_FUNCTIONS.readTablePage, {
5475
5794
  filters: [],
5476
5795
  limit,
5477
5796
  offset: 0,
5478
5797
  orderBy: [],
5479
5798
  search: "",
5480
- table
5481
- }, callOptions(""));
5482
- return page.rows;
5483
- };
5484
- const PaymentsPanel = ({
5485
- limit = 100
5486
- }) => {
5487
- const client = useLunora();
5488
- const t = useT();
5489
- const [subscriptions, setSubscriptions] = useState([]);
5490
- const [events, setEvents] = useState([]);
5491
- const [error, setError] = useState(null);
5492
- const refresh = async () => {
5493
- setError(null);
5494
- try {
5495
- const [subscriptionRows, eventRows] = await Promise.all([readRows(client, "subscriptions", limit), readRows(client, "events", 25)]);
5496
- setSubscriptions(subscriptionRows);
5497
- setEvents(eventRows);
5498
- } catch (error_) {
5499
- setSubscriptions([]);
5500
- setEvents([]);
5501
- setError(errorMessage(error_));
5502
- }
5503
- };
5504
- useEffect(() => {
5505
- fireAndForget(refresh());
5506
- }, [refresh]);
5507
- const reload = () => {
5508
- fireAndForget(refresh());
5509
- };
5510
- useAutoRefresh(reload, true);
5799
+ table: "subscriptions"
5800
+ });
5801
+ const eventsQuery = useAdminQuery(ADMIN_FUNCTIONS.readTablePage, {
5802
+ filters: [],
5803
+ limit: 25,
5804
+ offset: 0,
5805
+ orderBy: [],
5806
+ search: "",
5807
+ table: "events"
5808
+ });
5809
+ useAutoRefresh(() => {
5810
+ subscriptionsQuery.refetch();
5811
+ eventsQuery.refetch();
5812
+ }, true);
5813
+ const subscriptions = subscriptionsQuery.data?.rows ?? [];
5814
+ const events = eventsQuery.data?.rows ?? [];
5815
+ const error = subscriptionsQuery.error ?? eventsQuery.error;
5511
5816
  const activeCount = subscriptions.filter((row) => ACTIVE_STATES.has(text(readField(row, "state")))).length;
5512
5817
  const recentEvents = events.toSorted((a, b) => Number(readField(b, "processedAt") ?? 0) - Number(readField(a, "processedAt") ?? 0));
5513
5818
  return /* @__PURE__ */ jsxDEV("div", {
@@ -5545,7 +5850,7 @@ const PaymentsPanel = ({
5545
5850
  }, void 0, false), error === null ? void 0 : /* @__PURE__ */ jsxDEV("p", {
5546
5851
  className: "text-sm text-destructive",
5547
5852
  children: error
5548
- }, void 0, false), subscriptions.length === 0 ? /* @__PURE__ */ jsxDEV(EmptyState, {
5853
+ }, void 0, false), subscriptions.length === 0 && !subscriptionsQuery.isLoading ? /* @__PURE__ */ jsxDEV(EmptyState, {
5549
5854
  testId: "payments-empty",
5550
5855
  title: t("No subscriptions yet")
5551
5856
  }, void 0, false) : /* @__PURE__ */ jsxDEV(Card, {
@@ -5624,9 +5929,6 @@ const PaymentsPanel = ({
5624
5929
  }, void 0, true);
5625
5930
  };
5626
5931
 
5627
- const RLS_POLICIES = adminRef(ADMIN_FUNCTIONS.rlsPolicies);
5628
- const MASK_POLICIES = adminRef(ADMIN_FUNCTIONS.maskPolicies);
5629
- const GET_ADVISORIES = adminRef(ADMIN_FUNCTIONS.getAdvisories);
5630
5932
  const OPERATIONS = ["read", "insert", "update", "delete"];
5631
5933
  const operationLabel$1 = (t, operation) => ({
5632
5934
  delete: t("Delete"),
@@ -5685,136 +5987,181 @@ const buildRows = (policies, maskColumns, uncovered) => {
5685
5987
  }
5686
5988
  return [...byTable.values()].toSorted((a, b) => a.table.localeCompare(b.table));
5687
5989
  };
5688
- const PermissionsMatrix = ({
5689
- onProbe
5690
- } = {}) => {
5691
- const client = useLunora();
5990
+ const PermissionsMatrix = (t0) => {
5991
+ const $ = c(16);
5992
+ let t1;
5993
+ if ($[0] !== t0) {
5994
+ t1 = t0 === void 0 ? {} : t0;
5995
+ $[0] = t0;
5996
+ $[1] = t1;
5997
+ } else {
5998
+ t1 = $[1];
5999
+ }
6000
+ const {
6001
+ onProbe
6002
+ } = t1;
5692
6003
  const t = useT();
5693
- const [policies, setPolicies] = useState(null);
5694
- const [maskColumns, setMaskColumns] = useState([]);
5695
- const [advisories, setAdvisories] = useState(null);
5696
- const [error, setError] = useState(null);
5697
- const [liveError, setLiveError] = useState(void 0);
5698
- const refresh = async () => {
5699
- const queryRls = client.query(RLS_POLICIES, {}, callOptions(""));
5700
- const queryMasks = client.query(MASK_POLICIES, {}, callOptions(""));
5701
- const queryAdvisories = client.query(GET_ADVISORIES, {}, callOptions(""));
5702
- try {
5703
- const [rls, masks, advisory] = await Promise.all([queryRls, queryMasks.catch(() => {
5704
- return {
5705
- columns: []
5706
- };
5707
- }), queryAdvisories.catch(() => {
5708
- return {
5709
- advisories: []
5710
- };
5711
- })]);
5712
- setPolicies(Array.isArray(rls.policies) ? rls.policies : []);
5713
- setMaskColumns(Array.isArray(masks.columns) ? masks.columns : []);
5714
- setAdvisories(advisory);
5715
- setError(null);
5716
- } catch (error_) {
5717
- setError(errorMessage(error_));
6004
+ let t2;
6005
+ let t3;
6006
+ if ($[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6007
+ t2 = {};
6008
+ t3 = {
6009
+ live: true
6010
+ };
6011
+ $[2] = t2;
6012
+ $[3] = t3;
6013
+ } else {
6014
+ t2 = $[2];
6015
+ t3 = $[3];
6016
+ }
6017
+ const policiesQuery = useAdminQuery(ADMIN_FUNCTIONS.rlsPolicies, t2, t3);
6018
+ let t4;
6019
+ if ($[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6020
+ t4 = {};
6021
+ $[4] = t4;
6022
+ } else {
6023
+ t4 = $[4];
6024
+ }
6025
+ const masksQuery = useAdminQuery(ADMIN_FUNCTIONS.maskPolicies, t4);
6026
+ let t5;
6027
+ if ($[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6028
+ t5 = {};
6029
+ $[5] = t5;
6030
+ } else {
6031
+ t5 = $[5];
6032
+ }
6033
+ const advisoriesQuery = useAdminQuery(ADMIN_FUNCTIONS.getAdvisories, t5);
6034
+ let t6;
6035
+ if ($[6] !== advisoriesQuery.data || $[7] !== masksQuery.data || $[8] !== onProbe || $[9] !== policiesQuery || $[10] !== t) {
6036
+ let policies = null;
6037
+ if (policiesQuery.data !== void 0) {
6038
+ policies = Array.isArray(policiesQuery.data.policies) ? policiesQuery.data.policies : [];
5718
6039
  }
5719
- };
5720
- useEffect(() => {
5721
- fireAndForget(refresh());
5722
- }, [refresh]);
5723
- useLiveAdmin(ADMIN_FUNCTIONS.rlsPolicies, {}, "", (value) => {
5724
- const result = value;
5725
- setPolicies(Array.isArray(result.policies) ? result.policies : []);
5726
- setLiveError(void 0);
5727
- }, true, setLiveError);
5728
- const rows = policies === null ? [] : buildRows(policies, maskColumns, uncoveredTables(advisories));
5729
- return /* @__PURE__ */ jsxDEV("div", {
5730
- className: "flex flex-col gap-3",
5731
- "data-testid": "lunora-permissions-matrix",
5732
- children: [/* @__PURE__ */ jsxDEV("div", {
5733
- className: "flex items-center justify-end",
5734
- children: /* @__PURE__ */ jsxDEV(LiveError, {
5735
- message: liveError,
5736
- prefix: "pm"
5737
- }, void 0, false)
5738
- }, void 0, false), error !== null && /* @__PURE__ */ jsxDEV("p", {
5739
- className: "text-sm text-destructive",
5740
- "data-testid": "pm-error",
5741
- role: "alert",
5742
- children: error
5743
- }, void 0, false), policies !== null && rows.length === 0 ? /* @__PURE__ */ jsxDEV(EmptyState, {
5744
- description: t("Add a `definePolicy` and wire it through `.use(rls(...))` to populate this matrix."),
5745
- testId: "pm-empty",
5746
- title: t("No policy")
5747
- }, void 0, false) : /* @__PURE__ */ jsxDEV(Table, {
5748
- "data-testid": "pm-table",
5749
- children: [/* @__PURE__ */ jsxDEV(TableHeader, {
5750
- children: /* @__PURE__ */ jsxDEV(TableRow, {
5751
- children: [/* @__PURE__ */ jsxDEV(TableHead, {
5752
- children: t("Table")
5753
- }, void 0, false), OPERATIONS.map((operation) => /* @__PURE__ */ jsxDEV(TableHead, {
5754
- children: operationLabel$1(t, operation)
5755
- }, operation, false)), /* @__PURE__ */ jsxDEV(TableHead, {
5756
- children: t("Masked columns")
5757
- }, void 0, false)]
5758
- }, void 0, true)
5759
- }, void 0, false), /* @__PURE__ */ jsxDEV(TableBody, {
5760
- children: rows.map((row) => /* @__PURE__ */ jsxDEV(TableRow, {
5761
- "data-testid": `pm-row-${row.table}`,
5762
- children: [/* @__PURE__ */ jsxDEV(TableCell, {
5763
- className: "font-mono text-xs",
5764
- children: /* @__PURE__ */ jsxDEV("span", {
5765
- className: "flex items-center gap-1.5",
5766
- children: [row.table, row.uncovered && /* @__PURE__ */ jsxDEV(Badge, {
5767
- "data-testid": `pm-uncovered-${row.table}`,
5768
- title: t("Uncovered — reachable without a policy"),
5769
- variant: "destructive",
5770
- children: t("Uncovered — reachable without a policy")
5771
- }, void 0, false)]
5772
- }, void 0, true)
5773
- }, void 0, false), OPERATIONS.map((operation_0) => {
5774
- const cell = row.cells[operation_0];
5775
- return /* @__PURE__ */ jsxDEV(TableCell, {
5776
- "data-testid": `pm-cell-${row.table}-${operation_0}`,
5777
- children: cell.procedure === void 0 ? /* @__PURE__ */ jsxDEV("span", {
5778
- className: "text-xs text-muted-foreground",
5779
- children: t("No policy")
5780
- }, void 0, false) : /* @__PURE__ */ jsxDEV("span", {
5781
- className: "flex flex-col gap-1",
5782
- children: [/* @__PURE__ */ jsxDEV(Badge, {
5783
- variant: "secondary",
5784
- children: t("Covered by {procedure}", {
5785
- procedure: cell.procedure
5786
- })
5787
- }, void 0, false), onProbe !== void 0 && /* @__PURE__ */ jsxDEV(Button, {
5788
- className: "h-auto justify-start p-0 text-[11px]",
5789
- "data-testid": `pm-probe-${row.table}-${operation_0}`,
5790
- onClick: () => {
5791
- onProbe(row.table, operation_0, cell.procedure ?? "");
5792
- },
5793
- size: "xs",
5794
- type: "button",
5795
- variant: "ghost",
5796
- children: t("Probe this")
6040
+ const maskColumns = Array.isArray(masksQuery.data?.columns) ? masksQuery.data.columns : [];
6041
+ const advisories = advisoriesQuery.data ?? null;
6042
+ const {
6043
+ error,
6044
+ liveError
6045
+ } = policiesQuery;
6046
+ const rows = policies === null ? [] : buildRows(policies, maskColumns, uncoveredTables(advisories));
6047
+ let t7;
6048
+ if ($[12] !== liveError) {
6049
+ t7 = /* @__PURE__ */ jsxDEV("div", {
6050
+ className: "flex items-center justify-end",
6051
+ children: /* @__PURE__ */ jsxDEV(LiveError, {
6052
+ message: liveError,
6053
+ prefix: "pm"
6054
+ }, void 0, false)
6055
+ }, void 0, false);
6056
+ $[12] = liveError;
6057
+ $[13] = t7;
6058
+ } else {
6059
+ t7 = $[13];
6060
+ }
6061
+ let t8;
6062
+ if ($[14] !== error) {
6063
+ t8 = error !== null && /* @__PURE__ */ jsxDEV("p", {
6064
+ className: "text-sm text-destructive",
6065
+ "data-testid": "pm-error",
6066
+ role: "alert",
6067
+ children: error
6068
+ }, void 0, false);
6069
+ $[14] = error;
6070
+ $[15] = t8;
6071
+ } else {
6072
+ t8 = $[15];
6073
+ }
6074
+ t6 = /* @__PURE__ */ jsxDEV("div", {
6075
+ className: "flex flex-col gap-3",
6076
+ "data-testid": "lunora-permissions-matrix",
6077
+ children: [t7, t8, policies !== null && rows.length === 0 ? /* @__PURE__ */ jsxDEV(EmptyState, {
6078
+ description: t("Add a `definePolicy` and wire it through `.use(rls(...))` to populate this matrix."),
6079
+ testId: "pm-empty",
6080
+ title: t("No policy")
6081
+ }, void 0, false) : /* @__PURE__ */ jsxDEV(Table, {
6082
+ "data-testid": "pm-table",
6083
+ children: [/* @__PURE__ */ jsxDEV(TableHeader, {
6084
+ children: /* @__PURE__ */ jsxDEV(TableRow, {
6085
+ children: [/* @__PURE__ */ jsxDEV(TableHead, {
6086
+ children: t("Table")
6087
+ }, void 0, false), OPERATIONS.map((operation) => /* @__PURE__ */ jsxDEV(TableHead, {
6088
+ children: operationLabel$1(t, operation)
6089
+ }, operation, false)), /* @__PURE__ */ jsxDEV(TableHead, {
6090
+ children: t("Masked columns")
6091
+ }, void 0, false)]
6092
+ }, void 0, true)
6093
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableBody, {
6094
+ children: rows.map((row) => /* @__PURE__ */ jsxDEV(TableRow, {
6095
+ "data-testid": `pm-row-${row.table}`,
6096
+ children: [/* @__PURE__ */ jsxDEV(TableCell, {
6097
+ className: "font-mono text-xs",
6098
+ children: /* @__PURE__ */ jsxDEV("span", {
6099
+ className: "flex items-center gap-1.5",
6100
+ children: [row.table, row.uncovered && /* @__PURE__ */ jsxDEV(Badge, {
6101
+ "data-testid": `pm-uncovered-${row.table}`,
6102
+ title: t("Uncovered — reachable without a policy"),
6103
+ variant: "destructive",
6104
+ children: t("Uncovered — reachable without a policy")
5797
6105
  }, void 0, false)]
5798
6106
  }, void 0, true)
5799
- }, operation_0, false);
5800
- }), /* @__PURE__ */ jsxDEV(TableCell, {
5801
- children: row.maskedColumns.length === 0 ? /* @__PURE__ */ jsxDEV("span", {
5802
- "aria-hidden": "true",
5803
- className: "text-muted-foreground",
5804
- children: "—"
5805
- }, void 0, false) : /* @__PURE__ */ jsxDEV("span", {
5806
- className: "flex flex-wrap gap-1",
5807
- children: row.maskedColumns.map((column) => /* @__PURE__ */ jsxDEV(Badge, {
5808
- variant: "outline",
5809
- children: column
5810
- }, column, false))
5811
- }, void 0, false)
5812
- }, void 0, false)]
5813
- }, row.table, true))
5814
- }, void 0, false)]
5815
- }, void 0, true)]
5816
- }, void 0, true);
6107
+ }, void 0, false), OPERATIONS.map((operation_0) => {
6108
+ const cell = row.cells[operation_0];
6109
+ return /* @__PURE__ */ jsxDEV(TableCell, {
6110
+ "data-testid": `pm-cell-${row.table}-${operation_0}`,
6111
+ children: cell.procedure === void 0 ? /* @__PURE__ */ jsxDEV("span", {
6112
+ className: "text-xs text-muted-foreground",
6113
+ children: t("No policy")
6114
+ }, void 0, false) : /* @__PURE__ */ jsxDEV("span", {
6115
+ className: "flex flex-col gap-1",
6116
+ children: [/* @__PURE__ */ jsxDEV(Badge, {
6117
+ variant: "secondary",
6118
+ children: t("Covered by {procedure}", {
6119
+ procedure: cell.procedure
6120
+ })
6121
+ }, void 0, false), onProbe !== void 0 && /* @__PURE__ */ jsxDEV(Button, {
6122
+ className: "h-auto justify-start p-0 text-[11px]",
6123
+ "data-testid": `pm-probe-${row.table}-${operation_0}`,
6124
+ onClick: () => {
6125
+ onProbe(row.table, operation_0, cell.procedure ?? "");
6126
+ },
6127
+ size: "xs",
6128
+ type: "button",
6129
+ variant: "ghost",
6130
+ children: t("Probe this")
6131
+ }, void 0, false)]
6132
+ }, void 0, true)
6133
+ }, operation_0, false);
6134
+ }), /* @__PURE__ */ jsxDEV(TableCell, {
6135
+ children: row.maskedColumns.length === 0 ? /* @__PURE__ */ jsxDEV("span", {
6136
+ "aria-hidden": "true",
6137
+ className: "text-muted-foreground",
6138
+ children: "—"
6139
+ }, void 0, false) : /* @__PURE__ */ jsxDEV("span", {
6140
+ className: "flex flex-wrap gap-1",
6141
+ children: row.maskedColumns.map(_temp$2)
6142
+ }, void 0, false)
6143
+ }, void 0, false)]
6144
+ }, row.table, true))
6145
+ }, void 0, false)]
6146
+ }, void 0, true)]
6147
+ }, void 0, true);
6148
+ $[6] = advisoriesQuery.data;
6149
+ $[7] = masksQuery.data;
6150
+ $[8] = onProbe;
6151
+ $[9] = policiesQuery;
6152
+ $[10] = t;
6153
+ $[11] = t6;
6154
+ } else {
6155
+ t6 = $[11];
6156
+ }
6157
+ return t6;
5817
6158
  };
6159
+ function _temp$2(column) {
6160
+ return /* @__PURE__ */ jsxDEV(Badge, {
6161
+ variant: "outline",
6162
+ children: column
6163
+ }, column, false);
6164
+ }
5818
6165
 
5819
6166
  const RUN_AS = adminRef(ADMIN_FUNCTIONS.runAs);
5820
6167
  const useRunAsProbe = () => {
@@ -6357,14 +6704,150 @@ const PermissionsPanel = ({
6357
6704
  prefill,
6358
6705
  runAsIdentity
6359
6706
  }, void 0, false)]
6360
- }, void 0, true)]
6361
- }, void 0, true)
6362
- }, void 0, false), schemaEditable && /* @__PURE__ */ jsxDEV("section", {
6363
- className: "flex flex-col gap-2",
6364
- children: /* @__PURE__ */ jsxDEV(PolicyScaffolder, {}, void 0, false)
6365
- }, void 0, false)]
6366
- }, void 0, true);
6707
+ }, void 0, true)]
6708
+ }, void 0, true)
6709
+ }, void 0, false), schemaEditable && /* @__PURE__ */ jsxDEV("section", {
6710
+ className: "flex flex-col gap-2",
6711
+ children: /* @__PURE__ */ jsxDEV(PolicyScaffolder, {}, void 0, false)
6712
+ }, void 0, false)]
6713
+ }, void 0, true);
6714
+ };
6715
+
6716
+ const QueuesPanel = () => {
6717
+ const $ = c(17);
6718
+ const t = useT();
6719
+ let t0;
6720
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6721
+ t0 = {};
6722
+ $[0] = t0;
6723
+ } else {
6724
+ t0 = $[0];
6725
+ }
6726
+ const {
6727
+ data,
6728
+ error
6729
+ } = useAdminQuery(ADMIN_FUNCTIONS.listQueues, t0);
6730
+ const loaded = data !== void 0;
6731
+ let t1;
6732
+ if ($[1] !== data) {
6733
+ t1 = Array.isArray(data?.queues) ? [...data.queues].toSorted(_temp$1) : [];
6734
+ $[1] = data;
6735
+ $[2] = t1;
6736
+ } else {
6737
+ t1 = $[2];
6738
+ }
6739
+ const queues = t1;
6740
+ let t2;
6741
+ if ($[3] !== error) {
6742
+ t2 = error !== null && /* @__PURE__ */ jsxDEV("p", {
6743
+ className: "text-sm text-destructive",
6744
+ "data-testid": "queues-error",
6745
+ role: "alert",
6746
+ children: error
6747
+ }, void 0, false);
6748
+ $[3] = error;
6749
+ $[4] = t2;
6750
+ } else {
6751
+ t2 = $[4];
6752
+ }
6753
+ let t3;
6754
+ if ($[5] !== t) {
6755
+ t3 = t("Queues are declared in code with defineQueue. Enqueue from a mutation or action with ctx.queues.<name>.send(...); push consumers process batches in the worker.");
6756
+ $[5] = t;
6757
+ $[6] = t3;
6758
+ } else {
6759
+ t3 = $[6];
6760
+ }
6761
+ let t4;
6762
+ if ($[7] !== t3) {
6763
+ t4 = /* @__PURE__ */ jsxDEV("p", {
6764
+ className: "text-sm text-muted-foreground",
6765
+ children: t3
6766
+ }, void 0, false);
6767
+ $[7] = t3;
6768
+ $[8] = t4;
6769
+ } else {
6770
+ t4 = $[8];
6771
+ }
6772
+ let t5;
6773
+ if ($[9] !== loaded || $[10] !== queues || $[11] !== t) {
6774
+ t5 = loaded && queues.length === 0 ? /* @__PURE__ */ jsxDEV(EmptyState, {
6775
+ description: t("No defineQueue is declared in lunora/queues.ts in this deployment. Add one to offload async work to a Cloudflare Queue."),
6776
+ testId: "queues-empty",
6777
+ title: t("No queues defined")
6778
+ }, void 0, false) : /* @__PURE__ */ jsxDEV(Card, {
6779
+ className: "overflow-hidden py-0",
6780
+ children: /* @__PURE__ */ jsxDEV(CardContent, {
6781
+ className: "px-0",
6782
+ children: /* @__PURE__ */ jsxDEV(Table, {
6783
+ "data-testid": "queues-table",
6784
+ children: [/* @__PURE__ */ jsxDEV(TableHeader, {
6785
+ children: /* @__PURE__ */ jsxDEV(TableRow, {
6786
+ children: [/* @__PURE__ */ jsxDEV(TableHead, {
6787
+ children: t("Export")
6788
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
6789
+ children: t("Queue")
6790
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
6791
+ children: t("Mode")
6792
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
6793
+ children: t("Binding")
6794
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
6795
+ children: t("Dead-letter")
6796
+ }, void 0, false)]
6797
+ }, void 0, true)
6798
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableBody, {
6799
+ children: queues.map(_temp2$1)
6800
+ }, void 0, false)]
6801
+ }, void 0, true)
6802
+ }, void 0, false)
6803
+ }, void 0, false);
6804
+ $[9] = loaded;
6805
+ $[10] = queues;
6806
+ $[11] = t;
6807
+ $[12] = t5;
6808
+ } else {
6809
+ t5 = $[12];
6810
+ }
6811
+ let t6;
6812
+ if ($[13] !== t2 || $[14] !== t4 || $[15] !== t5) {
6813
+ t6 = /* @__PURE__ */ jsxDEV("div", {
6814
+ className: "flex flex-col gap-6",
6815
+ "data-testid": "lunora-queues-panel",
6816
+ children: [t2, t4, t5]
6817
+ }, void 0, true);
6818
+ $[13] = t2;
6819
+ $[14] = t4;
6820
+ $[15] = t5;
6821
+ $[16] = t6;
6822
+ } else {
6823
+ t6 = $[16];
6824
+ }
6825
+ return t6;
6367
6826
  };
6827
+ function _temp$1(a, b) {
6828
+ return a.exportName.localeCompare(b.exportName);
6829
+ }
6830
+ function _temp2$1(queue) {
6831
+ return /* @__PURE__ */ jsxDEV(TableRow, {
6832
+ "data-testid": `queues-row-${queue.exportName}`,
6833
+ children: [/* @__PURE__ */ jsxDEV(TableCell, {
6834
+ className: "font-mono text-xs",
6835
+ children: queue.exportName
6836
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
6837
+ className: "font-mono text-xs text-muted-foreground",
6838
+ children: queue.name
6839
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
6840
+ className: "font-mono text-xs text-muted-foreground",
6841
+ children: queue.mode
6842
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
6843
+ className: "font-mono text-xs text-muted-foreground",
6844
+ children: queue.binding
6845
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
6846
+ className: "font-mono text-xs text-muted-foreground",
6847
+ children: queue.deadLetterQueue ?? "—"
6848
+ }, void 0, false)]
6849
+ }, queue.exportName, true);
6850
+ }
6368
6851
 
6369
6852
  const RUN_SQL = adminRef(ADMIN_FUNCTIONS.runSql);
6370
6853
  const useRunSql = (sql, shardKey) => {
@@ -7132,7 +7615,6 @@ const DashboardsPanel = (t0) => {
7132
7615
  return t12;
7133
7616
  };
7134
7617
 
7135
- const STORAGE_RULES = adminRef(ADMIN_FUNCTIONS.storageRules);
7136
7618
  const operationLabel = (t, operation) => ({
7137
7619
  delete: t("Delete"),
7138
7620
  list: t("List"),
@@ -7147,86 +7629,117 @@ const OPERATION_ORDER = {
7147
7629
  };
7148
7630
  const sortRules = (rules) => [...rules].toSorted((a, b) => a.bucket.localeCompare(b.bucket) || OPERATION_ORDER[a.on] - OPERATION_ORDER[b.on] || (a.prefix ?? "").localeCompare(b.prefix ?? ""));
7149
7631
  const StorageRulesPanel = () => {
7150
- const client = useLunora();
7632
+ const $ = c(12);
7151
7633
  const t = useT();
7152
- const [data, setData] = useState(null);
7153
- const [error, setError] = useState(null);
7154
- const refresh = async () => {
7155
- try {
7156
- const result = await client.query(STORAGE_RULES, {}, callOptions(""));
7157
- setData({
7158
- rules: Array.isArray(result.rules) ? result.rules : []
7159
- });
7160
- setError(null);
7161
- } catch (error_) {
7162
- setError(errorMessage(error_));
7634
+ let t0;
7635
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
7636
+ t0 = {};
7637
+ $[0] = t0;
7638
+ } else {
7639
+ t0 = $[0];
7640
+ }
7641
+ const {
7642
+ data,
7643
+ error
7644
+ } = useAdminQuery(ADMIN_FUNCTIONS.storageRules, t0);
7645
+ const loaded = data !== void 0;
7646
+ let t1;
7647
+ if ($[1] !== data || $[2] !== error || $[3] !== loaded || $[4] !== t) {
7648
+ const rules = sortRules(Array.isArray(data?.rules) ? data.rules : []);
7649
+ let t2;
7650
+ if ($[6] !== error) {
7651
+ t2 = error !== null && /* @__PURE__ */ jsxDEV("p", {
7652
+ className: "text-sm text-destructive",
7653
+ "data-testid": "storage-rules-error",
7654
+ role: "alert",
7655
+ children: error
7656
+ }, void 0, false);
7657
+ $[6] = error;
7658
+ $[7] = t2;
7659
+ } else {
7660
+ t2 = $[7];
7163
7661
  }
7164
- };
7165
- useEffect(() => {
7166
- fireAndForget(refresh());
7167
- }, [refresh]);
7168
- const rules = data === null ? [] : sortRules(data.rules);
7169
- return /* @__PURE__ */ jsxDEV("div", {
7170
- className: "flex flex-col gap-4",
7171
- "data-testid": "lunora-storage-rules-panel",
7172
- children: [error !== null && /* @__PURE__ */ jsxDEV("p", {
7173
- className: "text-sm text-destructive",
7174
- "data-testid": "storage-rules-error",
7175
- role: "alert",
7176
- children: error
7177
- }, void 0, false), /* @__PURE__ */ jsxDEV("p", {
7178
- className: "text-sm text-muted-foreground",
7179
- "data-testid": "storage-rules-note",
7180
- children: t("Storage rules are declared in code with defineStorageRule and gate ctx.storage access per bucket. This view is read-only.")
7181
- }, void 0, false), data !== null && rules.length === 0 ? /* @__PURE__ */ jsxDEV(EmptyState, {
7182
- description: t("No defineStorageRule is wired through .use(storageRules(...)) in this deployment. Add one to gate object access by key prefix."),
7183
- testId: "storage-rules-empty",
7184
- title: t("No storage rules defined")
7185
- }, void 0, false) : /* @__PURE__ */ jsxDEV(Card, {
7186
- className: "overflow-hidden py-0",
7187
- children: /* @__PURE__ */ jsxDEV(CardContent, {
7188
- className: "px-0",
7189
- children: /* @__PURE__ */ jsxDEV(Table, {
7190
- "data-testid": "storage-rules-table",
7191
- children: [/* @__PURE__ */ jsxDEV(TableHeader, {
7192
- children: /* @__PURE__ */ jsxDEV(TableRow, {
7193
- children: [/* @__PURE__ */ jsxDEV(TableHead, {
7194
- children: t("Bucket")
7195
- }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
7196
- children: t("Operation")
7197
- }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
7198
- children: t("Key prefix")
7199
- }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
7200
- children: t("Guarded by")
7201
- }, void 0, false)]
7202
- }, void 0, true)
7203
- }, void 0, false), /* @__PURE__ */ jsxDEV(TableBody, {
7204
- children: rules.map((rule) => /* @__PURE__ */ jsxDEV(TableRow, {
7205
- "data-testid": `storage-rule-${rule.bucket}-${rule.on}-${rule.prefix ?? ""}`,
7206
- children: [/* @__PURE__ */ jsxDEV(TableCell, {
7207
- className: "font-mono text-xs",
7208
- children: rule.bucket
7209
- }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
7210
- children: /* @__PURE__ */ jsxDEV(Badge, {
7211
- variant: "secondary",
7212
- children: operationLabel(t, rule.on)
7213
- }, void 0, false)
7214
- }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
7215
- className: "font-mono text-xs",
7216
- children: rule.prefix ?? /* @__PURE__ */ jsxDEV("span", {
7217
- className: "text-muted-foreground",
7218
- children: t("(whole bucket)")
7219
- }, void 0, false)
7220
- }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
7221
- className: "font-mono text-xs text-muted-foreground",
7222
- children: rule.procedure
7223
- }, void 0, false)]
7224
- }, `${rule.bucket}:${rule.on}:${rule.prefix ?? ""}:${rule.procedure}`, true))
7225
- }, void 0, false)]
7226
- }, void 0, true)
7227
- }, void 0, false)
7228
- }, void 0, false)]
7229
- }, void 0, true);
7662
+ let t3;
7663
+ if ($[8] !== t) {
7664
+ t3 = t("Storage rules are declared in code with defineStorageRule and gate ctx.storage access per bucket. This view is read-only.");
7665
+ $[8] = t;
7666
+ $[9] = t3;
7667
+ } else {
7668
+ t3 = $[9];
7669
+ }
7670
+ let t4;
7671
+ if ($[10] !== t3) {
7672
+ t4 = /* @__PURE__ */ jsxDEV("p", {
7673
+ className: "text-sm text-muted-foreground",
7674
+ "data-testid": "storage-rules-note",
7675
+ children: t3
7676
+ }, void 0, false);
7677
+ $[10] = t3;
7678
+ $[11] = t4;
7679
+ } else {
7680
+ t4 = $[11];
7681
+ }
7682
+ t1 = /* @__PURE__ */ jsxDEV("div", {
7683
+ className: "flex flex-col gap-4",
7684
+ "data-testid": "lunora-storage-rules-panel",
7685
+ children: [t2, t4, loaded && rules.length === 0 ? /* @__PURE__ */ jsxDEV(EmptyState, {
7686
+ description: t("No defineStorageRule is wired through .use(storageRules(...)) in this deployment. Add one to gate object access by key prefix."),
7687
+ testId: "storage-rules-empty",
7688
+ title: t("No storage rules defined")
7689
+ }, void 0, false) : /* @__PURE__ */ jsxDEV(Card, {
7690
+ className: "overflow-hidden py-0",
7691
+ children: /* @__PURE__ */ jsxDEV(CardContent, {
7692
+ className: "px-0",
7693
+ children: /* @__PURE__ */ jsxDEV(Table, {
7694
+ "data-testid": "storage-rules-table",
7695
+ children: [/* @__PURE__ */ jsxDEV(TableHeader, {
7696
+ children: /* @__PURE__ */ jsxDEV(TableRow, {
7697
+ children: [/* @__PURE__ */ jsxDEV(TableHead, {
7698
+ children: t("Bucket")
7699
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
7700
+ children: t("Operation")
7701
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
7702
+ children: t("Key prefix")
7703
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
7704
+ children: t("Guarded by")
7705
+ }, void 0, false)]
7706
+ }, void 0, true)
7707
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableBody, {
7708
+ children: rules.map((rule) => /* @__PURE__ */ jsxDEV(TableRow, {
7709
+ "data-testid": `storage-rule-${rule.bucket}-${rule.on}-${rule.prefix ?? ""}`,
7710
+ children: [/* @__PURE__ */ jsxDEV(TableCell, {
7711
+ className: "font-mono text-xs",
7712
+ children: rule.bucket
7713
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
7714
+ children: /* @__PURE__ */ jsxDEV(Badge, {
7715
+ variant: "secondary",
7716
+ children: operationLabel(t, rule.on)
7717
+ }, void 0, false)
7718
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
7719
+ className: "font-mono text-xs",
7720
+ children: rule.prefix ?? /* @__PURE__ */ jsxDEV("span", {
7721
+ className: "text-muted-foreground",
7722
+ children: t("(whole bucket)")
7723
+ }, void 0, false)
7724
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
7725
+ className: "font-mono text-xs text-muted-foreground",
7726
+ children: rule.procedure
7727
+ }, void 0, false)]
7728
+ }, `${rule.bucket}:${rule.on}:${rule.prefix ?? ""}:${rule.procedure}`, true))
7729
+ }, void 0, false)]
7730
+ }, void 0, true)
7731
+ }, void 0, false)
7732
+ }, void 0, false)]
7733
+ }, void 0, true);
7734
+ $[1] = data;
7735
+ $[2] = error;
7736
+ $[3] = loaded;
7737
+ $[4] = t;
7738
+ $[5] = t1;
7739
+ } else {
7740
+ t1 = $[5];
7741
+ }
7742
+ return t1;
7230
7743
  };
7231
7744
 
7232
7745
  const DEFAULT_TOP_K = 10;
@@ -7527,10 +8040,6 @@ const WorkflowInstanceHistory = ({
7527
8040
  const [error, setError] = useState(null);
7528
8041
  const [notConfigured, setNotConfigured] = useState(false);
7529
8042
  const [busyId, setBusyId] = useState(null);
7530
- const listImpl = loadInstances ?? (async (arguments_) => {
7531
- const page = await client.listWorkflowInstances(arguments_);
7532
- return page.instances;
7533
- });
7534
8043
  const detailImpl = loadDetail ?? ((arguments_) => client.getWorkflowInstance(arguments_));
7535
8044
  const clientOwned = loadInstances === void 0;
7536
8045
  const clientAction = clientOwned ? (arguments_) => client.setWorkflowInstanceStatus(arguments_) : void 0;
@@ -7538,10 +8047,24 @@ const WorkflowInstanceHistory = ({
7538
8047
  const load = async () => {
7539
8048
  setError(null);
7540
8049
  setNotConfigured(false);
8050
+ const status = statusFilter === "" ? void 0 : statusFilter;
7541
8051
  try {
7542
- setInstances(await listImpl({
8052
+ if (loadInstances === void 0) {
8053
+ const page = await client.listWorkflowInstances({
8054
+ name: workflowName,
8055
+ status
8056
+ });
8057
+ if (page.configured === false) {
8058
+ setInstances(null);
8059
+ setNotConfigured(true);
8060
+ return;
8061
+ }
8062
+ setInstances(page.instances);
8063
+ return;
8064
+ }
8065
+ setInstances(await loadInstances({
7543
8066
  name: workflowName,
7544
- status: statusFilter === "" ? void 0 : statusFilter
8067
+ status
7545
8068
  }));
7546
8069
  } catch (error_) {
7547
8070
  setInstances(null);
@@ -7754,7 +8277,6 @@ const WorkflowInstanceHistory = ({
7754
8277
  }, void 0, true);
7755
8278
  };
7756
8279
 
7757
- const LIST_WORKFLOWS = adminRef(ADMIN_FUNCTIONS.listWorkflows);
7758
8280
  const CREATE_WORKFLOW_INSTANCE = adminRef(ADMIN_FUNCTIONS.createWorkflowInstance);
7759
8281
  const GET_WORKFLOW_INSTANCE_STATUS = adminRef(ADMIN_FUNCTIONS.getWorkflowInstanceStatus);
7760
8282
  const formatPayload = (instance) => {
@@ -7773,8 +8295,10 @@ const formatPayload = (instance) => {
7773
8295
  const WorkflowsPanel = () => {
7774
8296
  const client = useLunora();
7775
8297
  const t = useT();
7776
- const [data, setData] = useState(null);
7777
- const [error, setError] = useState(null);
8298
+ const {
8299
+ data,
8300
+ error
8301
+ } = useAdminQuery(ADMIN_FUNCTIONS.listWorkflows, {});
7778
8302
  const [selectedExport, setSelectedExport] = useState("");
7779
8303
  const [instanceIdInput, setInstanceIdInput] = useState("");
7780
8304
  const [paramsText, setParamsText] = useState("");
@@ -7782,21 +8306,8 @@ const WorkflowsPanel = () => {
7782
8306
  const [startError, setStartError] = useState(null);
7783
8307
  const [instances, setInstances] = useState([]);
7784
8308
  const [refreshingId, setRefreshingId] = useState(null);
7785
- const refresh = useCallback(async () => {
7786
- try {
7787
- const result = await client.query(LIST_WORKFLOWS, {}, callOptions(""));
7788
- setData({
7789
- workflows: Array.isArray(result.workflows) ? result.workflows : []
7790
- });
7791
- setError(null);
7792
- } catch (error_) {
7793
- setError(errorMessage(error_));
7794
- }
7795
- }, [client]);
7796
- useEffect(() => {
7797
- fireAndForget(refresh());
7798
- }, [refresh]);
7799
- const workflows = useMemo(() => data === null ? [] : [...data.workflows].toSorted((a, b) => a.exportName.localeCompare(b.exportName)), [data]);
8309
+ const loaded = data !== void 0;
8310
+ const workflows = useMemo(() => Array.isArray(data?.workflows) ? [...data.workflows].toSorted((a, b) => a.exportName.localeCompare(b.exportName)) : [], [data]);
7800
8311
  const selectedExportName = useMemo(() => {
7801
8312
  if (workflows.some((workflow) => workflow.exportName === selectedExport)) {
7802
8313
  return selectedExport;
@@ -7829,19 +8340,19 @@ const WorkflowsPanel = () => {
7829
8340
  setStartError(null);
7830
8341
  try {
7831
8342
  const id = instanceIdInput.trim();
7832
- const result_0 = await client.query(CREATE_WORKFLOW_INSTANCE, {
8343
+ const result = await client.query(CREATE_WORKFLOW_INSTANCE, {
7833
8344
  exportName,
7834
8345
  id: id === "" ? void 0 : id,
7835
8346
  params: parameters
7836
8347
  }, callOptions(""));
7837
8348
  upsertInstance({
7838
8349
  exportName,
7839
- id: result_0.id,
7840
- status: result_0.status
8350
+ id: result.id,
8351
+ status: result.status
7841
8352
  });
7842
8353
  setInstanceIdInput("");
7843
- } catch (error__0) {
7844
- setStartError(errorMessage(error__0));
8354
+ } catch (error_) {
8355
+ setStartError(errorMessage(error_));
7845
8356
  } finally {
7846
8357
  setStarting(false);
7847
8358
  }
@@ -7852,19 +8363,19 @@ const WorkflowsPanel = () => {
7852
8363
  const refreshInstance = async (exportName_0, id_0) => {
7853
8364
  setRefreshingId(id_0);
7854
8365
  try {
7855
- const result_1 = await client.query(GET_WORKFLOW_INSTANCE_STATUS, {
8366
+ const result_0 = await client.query(GET_WORKFLOW_INSTANCE_STATUS, {
7856
8367
  exportName: exportName_0,
7857
8368
  id: id_0
7858
8369
  }, callOptions(""));
7859
8370
  upsertInstance({
7860
- error: result_1.error,
8371
+ error: result_0.error,
7861
8372
  exportName: exportName_0,
7862
- id: result_1.id,
7863
- output: result_1.output,
7864
- status: result_1.status
8373
+ id: result_0.id,
8374
+ output: result_0.output,
8375
+ status: result_0.status
7865
8376
  });
7866
- } catch (error__1) {
7867
- setStartError(errorMessage(error__1));
8377
+ } catch (error__0) {
8378
+ setStartError(errorMessage(error__0));
7868
8379
  } finally {
7869
8380
  setRefreshingId(null);
7870
8381
  }
@@ -7898,7 +8409,7 @@ const WorkflowsPanel = () => {
7898
8409
  }, void 0, false), /* @__PURE__ */ jsxDEV("p", {
7899
8410
  className: "text-sm text-muted-foreground",
7900
8411
  children: t("Workflows are declared in code with defineWorkflow and run as durable Cloudflare Workflows. Start an instance and observe its status below.")
7901
- }, void 0, false), data !== null && workflows.length === 0 ? /* @__PURE__ */ jsxDEV(EmptyState, {
8412
+ }, void 0, false), loaded && workflows.length === 0 ? /* @__PURE__ */ jsxDEV(EmptyState, {
7902
8413
  description: t("No defineWorkflow is declared in lunora/workflows.ts in this deployment. Add one to run a durable, multi-step workflow."),
7903
8414
  testId: "workflows-empty",
7904
8415
  title: t("No workflows defined")
@@ -8050,6 +8561,7 @@ const STUDIO_FEATURES = adminRef(ADMIN_FUNCTIONS.studioFeatures);
8050
8561
  const DEFAULT_STUDIO_FEATURES = {
8051
8562
  mail: true,
8052
8563
  payments: true,
8564
+ queues: true,
8053
8565
  scheduler: true,
8054
8566
  storage: true,
8055
8567
  vectors: true,
@@ -8064,6 +8576,7 @@ const coerceFeatures = (raw) => {
8064
8576
  return {
8065
8577
  mail: flag("mail"),
8066
8578
  payments: flag("payments"),
8579
+ queues: flag("queues"),
8067
8580
  scheduler: flag("scheduler"),
8068
8581
  storage: flag("storage"),
8069
8582
  vectors: flag("vectors"),
@@ -8165,6 +8678,9 @@ const TAB_ICONS = {
8165
8678
  pitr: /* @__PURE__ */ jsxDEV("path", {
8166
8679
  d: "M12 21a9 9 0 1 0-9-9M12 7.5V12l3 2M3 12l-2-2m2 2 2-2"
8167
8680
  }, void 0, false),
8681
+ queues: /* @__PURE__ */ jsxDEV("path", {
8682
+ d: "M4 6h16M4 10h16M4 14h10M4 18h10m4-2 3 2-3 2v-4Z"
8683
+ }, void 0, false),
8168
8684
  realtime: /* @__PURE__ */ jsxDEV("path", {
8169
8685
  d: "M5 12a7 7 0 0 1 14 0M8 12a4 4 0 0 1 8 0M12 12v8m0-8a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"
8170
8686
  }, void 0, false),
@@ -8207,7 +8723,7 @@ const NAV_GROUPS = [{
8207
8723
  tabs: ["data", "sql", "schema", "migrations", "vectors", "pitr", "export"]
8208
8724
  }, {
8209
8725
  key: "functions",
8210
- tabs: ["functions", "api", "workflows"]
8726
+ tabs: ["functions", "api", "workflows", "queues"]
8211
8727
  }, {
8212
8728
  key: "auth",
8213
8729
  tabs: ["users", "organizations", "authSessions", "authConfig"]
@@ -8231,6 +8747,7 @@ const TAB_FEATURE = {
8231
8747
  files: "storage",
8232
8748
  mail: "mail",
8233
8749
  payments: "payments",
8750
+ queues: "queues",
8234
8751
  schedule: "scheduler",
8235
8752
  storageRules: "storage",
8236
8753
  vectors: "vectors",
@@ -8266,7 +8783,7 @@ const TabIcon = (t0) => {
8266
8783
  }
8267
8784
  return t2;
8268
8785
  };
8269
- const TABS = ["home", "data", "sql", "functions", "api", "workflows", "schema", "migrations", "vectors", "export", "pitr", "users", "organizations", "authSessions", "authConfig", "files", "storageRules", "dashboards", "metrics", "analytics", "health", "security", "rls", "permissions", "insights", "logs", "realtime", "mail", "payments", "audit", "schedule", "drains", "settings"];
8786
+ const TABS = ["home", "data", "sql", "functions", "api", "workflows", "queues", "schema", "migrations", "vectors", "export", "pitr", "users", "organizations", "authSessions", "authConfig", "files", "storageRules", "dashboards", "metrics", "analytics", "health", "security", "rls", "permissions", "insights", "logs", "realtime", "mail", "payments", "audit", "schedule", "drains", "settings"];
8270
8787
  const FULL_HEIGHT_TABS = /* @__PURE__ */ new Set(["api", "data", "sql"]);
8271
8788
  const tabFromPathname = (pathname) => {
8272
8789
  const slug = pathname.split("/").findLast(Boolean) ?? "";
@@ -8873,7 +9390,7 @@ const StudioSidebar = (t0) => {
8873
9390
  return t9;
8874
9391
  };
8875
9392
  const StudioLayout = () => {
8876
- const $ = c(264);
9393
+ const $ = c(270);
8877
9394
  const t = useT();
8878
9395
  const navigate = useNavigate();
8879
9396
  let t0;
@@ -9112,7 +9629,7 @@ const StudioLayout = () => {
9112
9629
  }
9113
9630
  let t27;
9114
9631
  if ($[55] !== t) {
9115
- t27 = t("Realtime");
9632
+ t27 = t("Queues");
9116
9633
  $[55] = t;
9117
9634
  $[56] = t27;
9118
9635
  } else {
@@ -9120,7 +9637,7 @@ const StudioLayout = () => {
9120
9637
  }
9121
9638
  let t28;
9122
9639
  if ($[57] !== t) {
9123
- t28 = t("RLS Policies");
9640
+ t28 = t("Realtime");
9124
9641
  $[57] = t;
9125
9642
  $[58] = t28;
9126
9643
  } else {
@@ -9128,7 +9645,7 @@ const StudioLayout = () => {
9128
9645
  }
9129
9646
  let t29;
9130
9647
  if ($[59] !== t) {
9131
- t29 = t("Scheduled");
9648
+ t29 = t("RLS Policies");
9132
9649
  $[59] = t;
9133
9650
  $[60] = t29;
9134
9651
  } else {
@@ -9136,7 +9653,7 @@ const StudioLayout = () => {
9136
9653
  }
9137
9654
  let t30;
9138
9655
  if ($[61] !== t) {
9139
- t30 = t("Schema");
9656
+ t30 = t("Scheduled");
9140
9657
  $[61] = t;
9141
9658
  $[62] = t30;
9142
9659
  } else {
@@ -9144,7 +9661,7 @@ const StudioLayout = () => {
9144
9661
  }
9145
9662
  let t31;
9146
9663
  if ($[63] !== t) {
9147
- t31 = t("Security");
9664
+ t31 = t("Schema");
9148
9665
  $[63] = t;
9149
9666
  $[64] = t31;
9150
9667
  } else {
@@ -9152,7 +9669,7 @@ const StudioLayout = () => {
9152
9669
  }
9153
9670
  let t32;
9154
9671
  if ($[65] !== t) {
9155
- t32 = t("Settings");
9672
+ t32 = t("Security");
9156
9673
  $[65] = t;
9157
9674
  $[66] = t32;
9158
9675
  } else {
@@ -9160,7 +9677,7 @@ const StudioLayout = () => {
9160
9677
  }
9161
9678
  let t33;
9162
9679
  if ($[67] !== t) {
9163
- t33 = t("SQL editor");
9680
+ t33 = t("Settings");
9164
9681
  $[67] = t;
9165
9682
  $[68] = t33;
9166
9683
  } else {
@@ -9168,7 +9685,7 @@ const StudioLayout = () => {
9168
9685
  }
9169
9686
  let t34;
9170
9687
  if ($[69] !== t) {
9171
- t34 = t("Access Rules");
9688
+ t34 = t("SQL editor");
9172
9689
  $[69] = t;
9173
9690
  $[70] = t34;
9174
9691
  } else {
@@ -9176,7 +9693,7 @@ const StudioLayout = () => {
9176
9693
  }
9177
9694
  let t35;
9178
9695
  if ($[71] !== t) {
9179
- t35 = t("Users");
9696
+ t35 = t("Access Rules");
9180
9697
  $[71] = t;
9181
9698
  $[72] = t35;
9182
9699
  } else {
@@ -9184,7 +9701,7 @@ const StudioLayout = () => {
9184
9701
  }
9185
9702
  let t36;
9186
9703
  if ($[73] !== t) {
9187
- t36 = t("Vectors");
9704
+ t36 = t("Users");
9188
9705
  $[73] = t;
9189
9706
  $[74] = t36;
9190
9707
  } else {
@@ -9192,15 +9709,23 @@ const StudioLayout = () => {
9192
9709
  }
9193
9710
  let t37;
9194
9711
  if ($[75] !== t) {
9195
- t37 = t("Workflows");
9712
+ t37 = t("Vectors");
9196
9713
  $[75] = t;
9197
9714
  $[76] = t37;
9198
9715
  } else {
9199
9716
  t37 = $[76];
9200
9717
  }
9201
9718
  let t38;
9202
- if ($[77] !== t10 || $[78] !== t11 || $[79] !== t12 || $[80] !== t13 || $[81] !== t14 || $[82] !== t15 || $[83] !== t16 || $[84] !== t17 || $[85] !== t18 || $[86] !== t19 || $[87] !== t20 || $[88] !== t21 || $[89] !== t22 || $[90] !== t23 || $[91] !== t24 || $[92] !== t25 || $[93] !== t26 || $[94] !== t27 || $[95] !== t28 || $[96] !== t29 || $[97] !== t30 || $[98] !== t31 || $[99] !== t32 || $[100] !== t33 || $[101] !== t34 || $[102] !== t35 || $[103] !== t36 || $[104] !== t37 || $[105] !== t5 || $[106] !== t6 || $[107] !== t7 || $[108] !== t8 || $[109] !== t9) {
9203
- t38 = {
9719
+ if ($[77] !== t) {
9720
+ t38 = t("Workflows");
9721
+ $[77] = t;
9722
+ $[78] = t38;
9723
+ } else {
9724
+ t38 = $[78];
9725
+ }
9726
+ let t39;
9727
+ if ($[79] !== t10 || $[80] !== t11 || $[81] !== t12 || $[82] !== t13 || $[83] !== t14 || $[84] !== t15 || $[85] !== t16 || $[86] !== t17 || $[87] !== t18 || $[88] !== t19 || $[89] !== t20 || $[90] !== t21 || $[91] !== t22 || $[92] !== t23 || $[93] !== t24 || $[94] !== t25 || $[95] !== t26 || $[96] !== t27 || $[97] !== t28 || $[98] !== t29 || $[99] !== t30 || $[100] !== t31 || $[101] !== t32 || $[102] !== t33 || $[103] !== t34 || $[104] !== t35 || $[105] !== t36 || $[106] !== t37 || $[107] !== t38 || $[108] !== t5 || $[109] !== t6 || $[110] !== t7 || $[111] !== t8 || $[112] !== t9) {
9728
+ t39 = {
9204
9729
  analytics: t5,
9205
9730
  api: t6,
9206
9731
  audit: t7,
@@ -9223,56 +9748,58 @@ const StudioLayout = () => {
9223
9748
  mail: t24,
9224
9749
  payments: t25,
9225
9750
  permissions: t26,
9226
- realtime: t27,
9227
- rls: t28,
9228
- schedule: t29,
9229
- schema: t30,
9230
- security: t31,
9231
- settings: t32,
9232
- sql: t33,
9233
- storageRules: t34,
9234
- users: t35,
9235
- vectors: t36,
9236
- workflows: t37
9751
+ queues: t27,
9752
+ realtime: t28,
9753
+ rls: t29,
9754
+ schedule: t30,
9755
+ schema: t31,
9756
+ security: t32,
9757
+ settings: t33,
9758
+ sql: t34,
9759
+ storageRules: t35,
9760
+ users: t36,
9761
+ vectors: t37,
9762
+ workflows: t38
9237
9763
  };
9238
- $[77] = t10;
9239
- $[78] = t11;
9240
- $[79] = t12;
9241
- $[80] = t13;
9242
- $[81] = t14;
9243
- $[82] = t15;
9244
- $[83] = t16;
9245
- $[84] = t17;
9246
- $[85] = t18;
9247
- $[86] = t19;
9248
- $[87] = t20;
9249
- $[88] = t21;
9250
- $[89] = t22;
9251
- $[90] = t23;
9252
- $[91] = t24;
9253
- $[92] = t25;
9254
- $[93] = t26;
9255
- $[94] = t27;
9256
- $[95] = t28;
9257
- $[96] = t29;
9258
- $[97] = t30;
9259
- $[98] = t31;
9260
- $[99] = t32;
9261
- $[100] = t33;
9262
- $[101] = t34;
9263
- $[102] = t35;
9264
- $[103] = t36;
9265
- $[104] = t37;
9266
- $[105] = t5;
9267
- $[106] = t6;
9268
- $[107] = t7;
9269
- $[108] = t8;
9270
- $[109] = t9;
9271
- $[110] = t38;
9272
- } else {
9273
- t38 = $[110];
9274
- }
9275
- const tabLabel = t38;
9764
+ $[79] = t10;
9765
+ $[80] = t11;
9766
+ $[81] = t12;
9767
+ $[82] = t13;
9768
+ $[83] = t14;
9769
+ $[84] = t15;
9770
+ $[85] = t16;
9771
+ $[86] = t17;
9772
+ $[87] = t18;
9773
+ $[88] = t19;
9774
+ $[89] = t20;
9775
+ $[90] = t21;
9776
+ $[91] = t22;
9777
+ $[92] = t23;
9778
+ $[93] = t24;
9779
+ $[94] = t25;
9780
+ $[95] = t26;
9781
+ $[96] = t27;
9782
+ $[97] = t28;
9783
+ $[98] = t29;
9784
+ $[99] = t30;
9785
+ $[100] = t31;
9786
+ $[101] = t32;
9787
+ $[102] = t33;
9788
+ $[103] = t34;
9789
+ $[104] = t35;
9790
+ $[105] = t36;
9791
+ $[106] = t37;
9792
+ $[107] = t38;
9793
+ $[108] = t5;
9794
+ $[109] = t6;
9795
+ $[110] = t7;
9796
+ $[111] = t8;
9797
+ $[112] = t9;
9798
+ $[113] = t39;
9799
+ } else {
9800
+ t39 = $[113];
9801
+ }
9802
+ const tabLabel = t39;
9276
9803
  const groupLabel = {
9277
9804
  advisors: t("Advisors"),
9278
9805
  auth: t("Auth"),
@@ -9284,376 +9811,386 @@ const StudioLayout = () => {
9284
9811
  settings: t("Settings"),
9285
9812
  storage: t("Storage")
9286
9813
  };
9287
- let t39;
9288
- if ($[111] !== t) {
9289
- t39 = t("Usage and latency from Analytics Engine — request volume, p50/p95, and hot shards.");
9290
- $[111] = t;
9291
- $[112] = t39;
9292
- } else {
9293
- t39 = $[112];
9294
- }
9295
9814
  let t40;
9296
- if ($[113] !== t) {
9297
- t40 = t("Interactive OpenAPI reference and copy-paste snippets for your functions.");
9298
- $[113] = t;
9299
- $[114] = t40;
9815
+ if ($[114] !== t) {
9816
+ t40 = t("Usage and latency from Analytics Engine — request volume, p50/p95, and hot shards.");
9817
+ $[114] = t;
9818
+ $[115] = t40;
9300
9819
  } else {
9301
- t40 = $[114];
9820
+ t40 = $[115];
9302
9821
  }
9303
9822
  let t41;
9304
- if ($[115] !== t) {
9305
- t41 = t("A durable log of admin state-changing operations.");
9306
- $[115] = t;
9307
- $[116] = t41;
9823
+ if ($[116] !== t) {
9824
+ t41 = t("Interactive OpenAPI reference and copy-paste snippets for your functions.");
9825
+ $[116] = t;
9826
+ $[117] = t41;
9308
9827
  } else {
9309
- t41 = $[116];
9828
+ t41 = $[117];
9310
9829
  }
9311
9830
  let t42;
9312
- if ($[117] !== t) {
9313
- t42 = t("Enabled plugins and session config (read-only).");
9314
- $[117] = t;
9315
- $[118] = t42;
9831
+ if ($[118] !== t) {
9832
+ t42 = t("A durable log of admin state-changing operations.");
9833
+ $[118] = t;
9834
+ $[119] = t42;
9316
9835
  } else {
9317
- t42 = $[118];
9836
+ t42 = $[119];
9318
9837
  }
9319
9838
  let t43;
9320
- if ($[119] !== t) {
9321
- t43 = t("Browse and revoke active sessions across all users.");
9322
- $[119] = t;
9323
- $[120] = t43;
9839
+ if ($[120] !== t) {
9840
+ t43 = t("Enabled plugins and session config (read-only).");
9841
+ $[120] = t;
9842
+ $[121] = t43;
9324
9843
  } else {
9325
- t43 = $[120];
9844
+ t43 = $[121];
9326
9845
  }
9327
9846
  let t44;
9328
- if ($[121] !== t) {
9329
- t44 = t("Chart widgets backed by saved read-only SQL queries.");
9330
- $[121] = t;
9331
- $[122] = t44;
9847
+ if ($[122] !== t) {
9848
+ t44 = t("Browse and revoke active sessions across all users.");
9849
+ $[122] = t;
9850
+ $[123] = t44;
9332
9851
  } else {
9333
- t44 = $[122];
9852
+ t44 = $[123];
9334
9853
  }
9335
9854
  let t45;
9336
- if ($[123] !== t) {
9337
- t45 = t("Browse and edit rows across your shard and global tables.");
9338
- $[123] = t;
9339
- $[124] = t45;
9855
+ if ($[124] !== t) {
9856
+ t45 = t("Chart widgets backed by saved read-only SQL queries.");
9857
+ $[124] = t;
9858
+ $[125] = t45;
9340
9859
  } else {
9341
- t45 = $[124];
9860
+ t45 = $[125];
9342
9861
  }
9343
9862
  let t46;
9344
- if ($[125] !== t) {
9345
- t46 = t("Forward logs to Logpush, Tail Workers, or a webhook collector.");
9346
- $[125] = t;
9347
- $[126] = t46;
9863
+ if ($[126] !== t) {
9864
+ t46 = t("Browse and edit rows across your shard and global tables.");
9865
+ $[126] = t;
9866
+ $[127] = t46;
9348
9867
  } else {
9349
- t46 = $[126];
9868
+ t46 = $[127];
9350
9869
  }
9351
9870
  let t47;
9352
- if ($[127] !== t) {
9353
- t47 = t("Export a shard to NDJSON, or import rows from it.");
9354
- $[127] = t;
9355
- $[128] = t47;
9871
+ if ($[128] !== t) {
9872
+ t47 = t("Forward logs to Logpush, Tail Workers, or a webhook collector.");
9873
+ $[128] = t;
9874
+ $[129] = t47;
9356
9875
  } else {
9357
- t47 = $[128];
9876
+ t47 = $[129];
9358
9877
  }
9359
9878
  let t48;
9360
- if ($[129] !== t) {
9361
- t48 = t("Browse objects in your R2 storage buckets.");
9362
- $[129] = t;
9363
- $[130] = t48;
9879
+ if ($[130] !== t) {
9880
+ t48 = t("Export a shard to NDJSON, or import rows from it.");
9881
+ $[130] = t;
9882
+ $[131] = t48;
9364
9883
  } else {
9365
- t48 = $[130];
9884
+ t48 = $[131];
9366
9885
  }
9367
9886
  let t49;
9368
- if ($[131] !== t) {
9369
- t49 = t("Run registered queries, mutations, and actions.");
9370
- $[131] = t;
9371
- $[132] = t49;
9887
+ if ($[132] !== t) {
9888
+ t49 = t("Browse objects in your R2 storage buckets.");
9889
+ $[132] = t;
9890
+ $[133] = t49;
9372
9891
  } else {
9373
- t49 = $[132];
9892
+ t49 = $[133];
9374
9893
  }
9375
9894
  let t50;
9376
- if ($[133] !== t) {
9377
- t50 = t("At-a-glance connection, error, and shard signals.");
9378
- $[133] = t;
9379
- $[134] = t50;
9895
+ if ($[134] !== t) {
9896
+ t50 = t("Run registered queries, mutations, and actions.");
9897
+ $[134] = t;
9898
+ $[135] = t50;
9380
9899
  } else {
9381
- t50 = $[134];
9900
+ t50 = $[135];
9382
9901
  }
9383
9902
  let t51;
9384
- if ($[135] !== t) {
9385
- t51 = t("Connection, health, and advisor summary for your deployment.");
9386
- $[135] = t;
9387
- $[136] = t51;
9903
+ if ($[136] !== t) {
9904
+ t51 = t("At-a-glance connection, error, and shard signals.");
9905
+ $[136] = t;
9906
+ $[137] = t51;
9388
9907
  } else {
9389
- t51 = $[136];
9908
+ t51 = $[137];
9390
9909
  }
9391
9910
  let t52;
9392
- if ($[137] !== t) {
9393
- t52 = t("Surface slow functions, error spikes, and cache problems.");
9394
- $[137] = t;
9395
- $[138] = t52;
9911
+ if ($[138] !== t) {
9912
+ t52 = t("Connection, health, and advisor summary for your deployment.");
9913
+ $[138] = t;
9914
+ $[139] = t52;
9396
9915
  } else {
9397
- t52 = $[138];
9916
+ t52 = $[139];
9398
9917
  }
9399
9918
  let t53;
9400
- if ($[139] !== t) {
9401
- t53 = t("A live stream of recent function logs.");
9402
- $[139] = t;
9403
- $[140] = t53;
9919
+ if ($[140] !== t) {
9920
+ t53 = t("Surface slow functions, error spikes, and cache problems.");
9921
+ $[140] = t;
9922
+ $[141] = t53;
9404
9923
  } else {
9405
- t53 = $[140];
9924
+ t53 = $[141];
9406
9925
  }
9407
9926
  let t54;
9408
- if ($[141] !== t) {
9409
- t54 = t("Per-shard health and aggregate metrics.");
9410
- $[141] = t;
9411
- $[142] = t54;
9927
+ if ($[142] !== t) {
9928
+ t54 = t("A live stream of recent function logs.");
9929
+ $[142] = t;
9930
+ $[143] = t54;
9412
9931
  } else {
9413
- t54 = $[142];
9932
+ t54 = $[143];
9414
9933
  }
9415
9934
  let t55;
9416
- if ($[143] !== t) {
9417
- t55 = t("Review migration status and run them.");
9418
- $[143] = t;
9419
- $[144] = t55;
9935
+ if ($[144] !== t) {
9936
+ t55 = t("Per-shard health and aggregate metrics.");
9937
+ $[144] = t;
9938
+ $[145] = t55;
9420
9939
  } else {
9421
- t55 = $[144];
9940
+ t55 = $[145];
9422
9941
  }
9423
9942
  let t56;
9424
- if ($[145] !== t) {
9425
- t56 = t("Browse and manage organizations, members, and invitations.");
9426
- $[145] = t;
9427
- $[146] = t56;
9943
+ if ($[146] !== t) {
9944
+ t56 = t("Review migration status and run them.");
9945
+ $[146] = t;
9946
+ $[147] = t56;
9428
9947
  } else {
9429
- t56 = $[146];
9948
+ t56 = $[147];
9430
9949
  }
9431
9950
  let t57;
9432
- if ($[147] !== t) {
9433
- t57 = t("Restore a shard to a point in the last 30 days.");
9434
- $[147] = t;
9435
- $[148] = t57;
9951
+ if ($[148] !== t) {
9952
+ t57 = t("Browse and manage organizations, members, and invitations.");
9953
+ $[148] = t;
9954
+ $[149] = t57;
9436
9955
  } else {
9437
- t57 = $[148];
9956
+ t57 = $[149];
9438
9957
  }
9439
9958
  let t58;
9440
- if ($[149] !== t) {
9441
- t58 = t("Email your app sent, captured in dev.");
9442
- $[149] = t;
9443
- $[150] = t58;
9959
+ if ($[150] !== t) {
9960
+ t58 = t("Restore a shard to a point in the last 30 days.");
9961
+ $[150] = t;
9962
+ $[151] = t58;
9444
9963
  } else {
9445
- t58 = $[150];
9964
+ t58 = $[151];
9446
9965
  }
9447
9966
  let t59;
9448
- if ($[151] !== t) {
9449
- t59 = t("Synced customers, subscriptions, and webhook events.");
9450
- $[151] = t;
9451
- $[152] = t59;
9967
+ if ($[152] !== t) {
9968
+ t59 = t("Email your app sent, captured in dev.");
9969
+ $[152] = t;
9970
+ $[153] = t59;
9452
9971
  } else {
9453
- t59 = $[152];
9972
+ t59 = $[153];
9454
9973
  }
9455
9974
  let t60;
9456
- if ($[153] !== t) {
9457
- t60 = t("Inspect access policies per table, and probe a function as any identity.");
9458
- $[153] = t;
9459
- $[154] = t60;
9975
+ if ($[154] !== t) {
9976
+ t60 = t("Synced customers, subscriptions, and webhook events.");
9977
+ $[154] = t;
9978
+ $[155] = t60;
9460
9979
  } else {
9461
- t60 = $[154];
9980
+ t60 = $[155];
9462
9981
  }
9463
9982
  let t61;
9464
- if ($[155] !== t) {
9465
- t61 = t("Active WebSocket subscriptions on this shard.");
9466
- $[155] = t;
9467
- $[156] = t61;
9983
+ if ($[156] !== t) {
9984
+ t61 = t("Inspect access policies per table, and probe a function as any identity.");
9985
+ $[156] = t;
9986
+ $[157] = t61;
9468
9987
  } else {
9469
- t61 = $[156];
9988
+ t61 = $[157];
9470
9989
  }
9471
9990
  let t62;
9472
- if ($[157] !== t) {
9473
- t62 = t("Inspect row-level-security policies and roles, per table.");
9474
- $[157] = t;
9475
- $[158] = t62;
9991
+ if ($[158] !== t) {
9992
+ t62 = t("Inspect declared Cloudflare Queues — their producer bindings, consumer mode, and dead-letter queue.");
9993
+ $[158] = t;
9994
+ $[159] = t62;
9476
9995
  } else {
9477
- t62 = $[158];
9996
+ t62 = $[159];
9478
9997
  }
9479
9998
  let t63;
9480
- if ($[159] !== t) {
9481
- t63 = t("Inspect and cancel scheduled jobs.");
9482
- $[159] = t;
9483
- $[160] = t63;
9999
+ if ($[160] !== t) {
10000
+ t63 = t("Active WebSocket subscriptions on this shard.");
10001
+ $[160] = t;
10002
+ $[161] = t63;
9484
10003
  } else {
9485
- t63 = $[160];
10004
+ t63 = $[161];
9486
10005
  }
9487
10006
  let t64;
9488
- if ($[161] !== t) {
9489
- t64 = t("Inspect each table and its columns.");
9490
- $[161] = t;
9491
- $[162] = t64;
10007
+ if ($[162] !== t) {
10008
+ t64 = t("Inspect row-level-security policies and roles, per table.");
10009
+ $[162] = t;
10010
+ $[163] = t64;
9492
10011
  } else {
9493
- t64 = $[162];
10012
+ t64 = $[163];
9494
10013
  }
9495
10014
  let t65;
9496
- if ($[163] !== t) {
9497
- t65 = t("Review admin gates, credentials, and log redaction.");
9498
- $[163] = t;
9499
- $[164] = t65;
10015
+ if ($[164] !== t) {
10016
+ t65 = t("Inspect and cancel scheduled jobs.");
10017
+ $[164] = t;
10018
+ $[165] = t65;
9500
10019
  } else {
9501
- t65 = $[164];
10020
+ t65 = $[165];
9502
10021
  }
9503
10022
  let t66;
9504
- if ($[165] !== t) {
9505
- t66 = t("Read-only deployment config — vars, secrets, and bindings.");
9506
- $[165] = t;
9507
- $[166] = t66;
10023
+ if ($[166] !== t) {
10024
+ t66 = t("Inspect each table and its columns.");
10025
+ $[166] = t;
10026
+ $[167] = t66;
9508
10027
  } else {
9509
- t66 = $[166];
10028
+ t66 = $[167];
9510
10029
  }
9511
10030
  let t67;
9512
- if ($[167] !== t) {
9513
- t67 = t("Run read-only SQL against a shard.");
9514
- $[167] = t;
9515
- $[168] = t67;
10031
+ if ($[168] !== t) {
10032
+ t67 = t("Review admin gates, credentials, and log redaction.");
10033
+ $[168] = t;
10034
+ $[169] = t67;
9516
10035
  } else {
9517
- t67 = $[168];
10036
+ t67 = $[169];
9518
10037
  }
9519
10038
  let t68;
9520
- if ($[169] !== t) {
9521
- t68 = t("Inspect storage access rules — per bucket, operation, and key prefix.");
9522
- $[169] = t;
9523
- $[170] = t68;
10039
+ if ($[170] !== t) {
10040
+ t68 = t("Read-only deployment config — vars, secrets, and bindings.");
10041
+ $[170] = t;
10042
+ $[171] = t68;
9524
10043
  } else {
9525
- t68 = $[170];
10044
+ t68 = $[171];
9526
10045
  }
9527
10046
  let t69;
9528
- if ($[171] !== t) {
9529
- t69 = t("Manage auth users — roles, bans, sessions, and identity.");
9530
- $[171] = t;
9531
- $[172] = t69;
10047
+ if ($[172] !== t) {
10048
+ t69 = t("Run read-only SQL against a shard.");
10049
+ $[172] = t;
10050
+ $[173] = t69;
9532
10051
  } else {
9533
- t69 = $[172];
10052
+ t69 = $[173];
9534
10053
  }
9535
10054
  let t70;
9536
- if ($[173] !== t) {
9537
- t70 = t("Browse Vectorize indexes and run similarity searches.");
9538
- $[173] = t;
9539
- $[174] = t70;
10055
+ if ($[174] !== t) {
10056
+ t70 = t("Inspect storage access rules — per bucket, operation, and key prefix.");
10057
+ $[174] = t;
10058
+ $[175] = t70;
9540
10059
  } else {
9541
- t70 = $[174];
10060
+ t70 = $[175];
9542
10061
  }
9543
10062
  let t71;
9544
- if ($[175] !== t) {
9545
- t71 = t("Inspect declared Cloudflare Workflows and their bindings.");
9546
- $[175] = t;
9547
- $[176] = t71;
10063
+ if ($[176] !== t) {
10064
+ t71 = t("Manage auth users — roles, bans, sessions, and identity.");
10065
+ $[176] = t;
10066
+ $[177] = t71;
9548
10067
  } else {
9549
- t71 = $[176];
10068
+ t71 = $[177];
9550
10069
  }
9551
10070
  let t72;
9552
- if ($[177] !== t39 || $[178] !== t40 || $[179] !== t41 || $[180] !== t42 || $[181] !== t43 || $[182] !== t44 || $[183] !== t45 || $[184] !== t46 || $[185] !== t47 || $[186] !== t48 || $[187] !== t49 || $[188] !== t50 || $[189] !== t51 || $[190] !== t52 || $[191] !== t53 || $[192] !== t54 || $[193] !== t55 || $[194] !== t56 || $[195] !== t57 || $[196] !== t58 || $[197] !== t59 || $[198] !== t60 || $[199] !== t61 || $[200] !== t62 || $[201] !== t63 || $[202] !== t64 || $[203] !== t65 || $[204] !== t66 || $[205] !== t67 || $[206] !== t68 || $[207] !== t69 || $[208] !== t70 || $[209] !== t71) {
9553
- t72 = {
9554
- analytics: t39,
9555
- api: t40,
9556
- audit: t41,
9557
- authConfig: t42,
9558
- authSessions: t43,
9559
- dashboards: t44,
9560
- data: t45,
9561
- drains: t46,
9562
- export: t47,
9563
- files: t48,
9564
- functions: t49,
9565
- health: t50,
9566
- home: t51,
9567
- insights: t52,
9568
- logs: t53,
9569
- metrics: t54,
9570
- migrations: t55,
9571
- organizations: t56,
9572
- pitr: t57,
9573
- mail: t58,
9574
- payments: t59,
9575
- permissions: t60,
9576
- realtime: t61,
9577
- rls: t62,
9578
- schedule: t63,
9579
- schema: t64,
9580
- security: t65,
9581
- settings: t66,
9582
- sql: t67,
9583
- storageRules: t68,
9584
- users: t69,
9585
- vectors: t70,
9586
- workflows: t71
9587
- };
9588
- $[177] = t39;
9589
- $[178] = t40;
9590
- $[179] = t41;
9591
- $[180] = t42;
9592
- $[181] = t43;
9593
- $[182] = t44;
9594
- $[183] = t45;
9595
- $[184] = t46;
9596
- $[185] = t47;
9597
- $[186] = t48;
9598
- $[187] = t49;
9599
- $[188] = t50;
9600
- $[189] = t51;
9601
- $[190] = t52;
9602
- $[191] = t53;
9603
- $[192] = t54;
9604
- $[193] = t55;
9605
- $[194] = t56;
9606
- $[195] = t57;
9607
- $[196] = t58;
9608
- $[197] = t59;
9609
- $[198] = t60;
9610
- $[199] = t61;
9611
- $[200] = t62;
9612
- $[201] = t63;
9613
- $[202] = t64;
9614
- $[203] = t65;
9615
- $[204] = t66;
9616
- $[205] = t67;
9617
- $[206] = t68;
9618
- $[207] = t69;
9619
- $[208] = t70;
9620
- $[209] = t71;
9621
- $[210] = t72;
9622
- } else {
9623
- t72 = $[210];
9624
- }
9625
- const tabDescription = t72;
10071
+ if ($[178] !== t) {
10072
+ t72 = t("Browse Vectorize indexes and run similarity searches.");
10073
+ $[178] = t;
10074
+ $[179] = t72;
10075
+ } else {
10076
+ t72 = $[179];
10077
+ }
9626
10078
  let t73;
9627
- if ($[211] !== navigate) {
9628
- t73 = (event) => {
10079
+ if ($[180] !== t) {
10080
+ t73 = t("Inspect declared Cloudflare Workflows and their bindings.");
10081
+ $[180] = t;
10082
+ $[181] = t73;
10083
+ } else {
10084
+ t73 = $[181];
10085
+ }
10086
+ let t74;
10087
+ if ($[182] !== t40 || $[183] !== t41 || $[184] !== t42 || $[185] !== t43 || $[186] !== t44 || $[187] !== t45 || $[188] !== t46 || $[189] !== t47 || $[190] !== t48 || $[191] !== t49 || $[192] !== t50 || $[193] !== t51 || $[194] !== t52 || $[195] !== t53 || $[196] !== t54 || $[197] !== t55 || $[198] !== t56 || $[199] !== t57 || $[200] !== t58 || $[201] !== t59 || $[202] !== t60 || $[203] !== t61 || $[204] !== t62 || $[205] !== t63 || $[206] !== t64 || $[207] !== t65 || $[208] !== t66 || $[209] !== t67 || $[210] !== t68 || $[211] !== t69 || $[212] !== t70 || $[213] !== t71 || $[214] !== t72 || $[215] !== t73) {
10088
+ t74 = {
10089
+ analytics: t40,
10090
+ api: t41,
10091
+ audit: t42,
10092
+ authConfig: t43,
10093
+ authSessions: t44,
10094
+ dashboards: t45,
10095
+ data: t46,
10096
+ drains: t47,
10097
+ export: t48,
10098
+ files: t49,
10099
+ functions: t50,
10100
+ health: t51,
10101
+ home: t52,
10102
+ insights: t53,
10103
+ logs: t54,
10104
+ metrics: t55,
10105
+ migrations: t56,
10106
+ organizations: t57,
10107
+ pitr: t58,
10108
+ mail: t59,
10109
+ payments: t60,
10110
+ permissions: t61,
10111
+ queues: t62,
10112
+ realtime: t63,
10113
+ rls: t64,
10114
+ schedule: t65,
10115
+ schema: t66,
10116
+ security: t67,
10117
+ settings: t68,
10118
+ sql: t69,
10119
+ storageRules: t70,
10120
+ users: t71,
10121
+ vectors: t72,
10122
+ workflows: t73
10123
+ };
10124
+ $[182] = t40;
10125
+ $[183] = t41;
10126
+ $[184] = t42;
10127
+ $[185] = t43;
10128
+ $[186] = t44;
10129
+ $[187] = t45;
10130
+ $[188] = t46;
10131
+ $[189] = t47;
10132
+ $[190] = t48;
10133
+ $[191] = t49;
10134
+ $[192] = t50;
10135
+ $[193] = t51;
10136
+ $[194] = t52;
10137
+ $[195] = t53;
10138
+ $[196] = t54;
10139
+ $[197] = t55;
10140
+ $[198] = t56;
10141
+ $[199] = t57;
10142
+ $[200] = t58;
10143
+ $[201] = t59;
10144
+ $[202] = t60;
10145
+ $[203] = t61;
10146
+ $[204] = t62;
10147
+ $[205] = t63;
10148
+ $[206] = t64;
10149
+ $[207] = t65;
10150
+ $[208] = t66;
10151
+ $[209] = t67;
10152
+ $[210] = t68;
10153
+ $[211] = t69;
10154
+ $[212] = t70;
10155
+ $[213] = t71;
10156
+ $[214] = t72;
10157
+ $[215] = t73;
10158
+ $[216] = t74;
10159
+ } else {
10160
+ t74 = $[216];
10161
+ }
10162
+ const tabDescription = t74;
10163
+ let t75;
10164
+ if ($[217] !== navigate) {
10165
+ t75 = (event) => {
9629
10166
  fireAndForget(navigate({
9630
10167
  to: `/${event.currentTarget.dataset.tab ?? ""}`
9631
10168
  }));
9632
10169
  };
9633
- $[211] = navigate;
9634
- $[212] = t73;
10170
+ $[217] = navigate;
10171
+ $[218] = t75;
9635
10172
  } else {
9636
- t73 = $[212];
10173
+ t75 = $[218];
9637
10174
  }
9638
- const selectTab = t73;
9639
- let t74;
9640
- let t75;
9641
- if ($[213] !== current || $[214] !== tabLabel) {
9642
- t74 = () => {
10175
+ const selectTab = t75;
10176
+ let t76;
10177
+ let t77;
10178
+ if ($[219] !== current || $[220] !== tabLabel) {
10179
+ t76 = () => {
9643
10180
  if (typeof document !== "undefined") {
9644
10181
  document.title = `${tabLabel[current]} · lunora`;
9645
10182
  }
9646
10183
  };
9647
- t75 = [current, tabLabel];
9648
- $[213] = current;
9649
- $[214] = tabLabel;
9650
- $[215] = t74;
9651
- $[216] = t75;
10184
+ t77 = [current, tabLabel];
10185
+ $[219] = current;
10186
+ $[220] = tabLabel;
10187
+ $[221] = t76;
10188
+ $[222] = t77;
9652
10189
  } else {
9653
- t74 = $[215];
9654
- t75 = $[216];
10190
+ t76 = $[221];
10191
+ t77 = $[222];
9655
10192
  }
9656
- useEffect(t74, t75);
10193
+ useEffect(t76, t77);
9657
10194
  const activeGroup = visibleGroups.find((group_1) => group_1.tabs.includes(current)) ?? NAV_GROUPS[0];
9658
10195
  const commandItems = visibleGroups.flatMap((group_2) => group_2.tabs.map((tab_0) => ({
9659
10196
  group: groupLabel[group_2.key],
@@ -9662,48 +10199,48 @@ const StudioLayout = () => {
9662
10199
  })));
9663
10200
  const chrome = use(StudioChromeContext);
9664
10201
  const connected = chrome !== null && chrome.token !== "";
9665
- let t76;
9666
- if ($[217] !== commandItems) {
9667
- t76 = /* @__PURE__ */ jsxDEV(CommandPalette, {
10202
+ let t78;
10203
+ if ($[223] !== commandItems) {
10204
+ t78 = /* @__PURE__ */ jsxDEV(CommandPalette, {
9668
10205
  items: commandItems
9669
10206
  }, void 0, false);
9670
- $[217] = commandItems;
9671
- $[218] = t76;
10207
+ $[223] = commandItems;
10208
+ $[224] = t78;
9672
10209
  } else {
9673
- t76 = $[218];
10210
+ t78 = $[224];
9674
10211
  }
9675
- let t77;
9676
- if ($[219] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
9677
- t77 = /* @__PURE__ */ jsxDEV(SidebarTrigger, {
10212
+ let t79;
10213
+ if ($[225] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
10214
+ t79 = /* @__PURE__ */ jsxDEV(SidebarTrigger, {
9678
10215
  className: "-ms-1"
9679
10216
  }, void 0, false);
9680
- $[219] = t77;
10217
+ $[225] = t79;
9681
10218
  } else {
9682
- t77 = $[219];
10219
+ t79 = $[225];
9683
10220
  }
9684
- let t78;
9685
- if ($[220] !== t) {
9686
- t78 = t("Breadcrumb");
9687
- $[220] = t;
9688
- $[221] = t78;
10221
+ let t80;
10222
+ if ($[226] !== t) {
10223
+ t80 = t("Breadcrumb");
10224
+ $[226] = t;
10225
+ $[227] = t80;
9689
10226
  } else {
9690
- t78 = $[221];
10227
+ t80 = $[227];
9691
10228
  }
9692
- const t79 = groupLabel[activeGroup.key];
9693
- let t80;
9694
- if ($[222] !== t79) {
9695
- t80 = /* @__PURE__ */ jsxDEV("span", {
10229
+ const t81 = groupLabel[activeGroup.key];
10230
+ let t82;
10231
+ if ($[228] !== t81) {
10232
+ t82 = /* @__PURE__ */ jsxDEV("span", {
9696
10233
  className: "text-muted-foreground",
9697
- children: t79
10234
+ children: t81
9698
10235
  }, void 0, false);
9699
- $[222] = t79;
9700
- $[223] = t80;
10236
+ $[228] = t81;
10237
+ $[229] = t82;
9701
10238
  } else {
9702
- t80 = $[223];
10239
+ t82 = $[229];
9703
10240
  }
9704
- let t81;
9705
- if ($[224] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
9706
- t81 = /* @__PURE__ */ jsxDEV("svg", {
10241
+ let t83;
10242
+ if ($[230] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
10243
+ t83 = /* @__PURE__ */ jsxDEV("svg", {
9707
10244
  "aria-hidden": "true",
9708
10245
  className: "size-3.5 text-muted-foreground/60",
9709
10246
  fill: "none",
@@ -9716,39 +10253,39 @@ const StudioLayout = () => {
9716
10253
  strokeLinejoin: "round"
9717
10254
  }, void 0, false)
9718
10255
  }, void 0, false);
9719
- $[224] = t81;
10256
+ $[230] = t83;
9720
10257
  } else {
9721
- t81 = $[224];
10258
+ t83 = $[230];
9722
10259
  }
9723
- const t82 = tabLabel[current];
9724
- let t83;
9725
- if ($[225] !== t82) {
9726
- t83 = /* @__PURE__ */ jsxDEV("span", {
10260
+ const t84 = tabLabel[current];
10261
+ let t85;
10262
+ if ($[231] !== t84) {
10263
+ t85 = /* @__PURE__ */ jsxDEV("span", {
9727
10264
  className: "font-medium text-foreground",
9728
- children: t82
10265
+ children: t84
9729
10266
  }, void 0, false);
9730
- $[225] = t82;
9731
- $[226] = t83;
10267
+ $[231] = t84;
10268
+ $[232] = t85;
9732
10269
  } else {
9733
- t83 = $[226];
10270
+ t85 = $[232];
9734
10271
  }
9735
- let t84;
9736
- if ($[227] !== t78 || $[228] !== t80 || $[229] !== t83) {
9737
- t84 = /* @__PURE__ */ jsxDEV("nav", {
9738
- "aria-label": t78,
10272
+ let t86;
10273
+ if ($[233] !== t80 || $[234] !== t82 || $[235] !== t85) {
10274
+ t86 = /* @__PURE__ */ jsxDEV("nav", {
10275
+ "aria-label": t80,
9739
10276
  className: "flex items-center gap-1.5 text-[13px]",
9740
- children: [t80, t81, t83]
10277
+ children: [t82, t83, t85]
9741
10278
  }, void 0, true);
9742
- $[227] = t78;
9743
- $[228] = t80;
9744
- $[229] = t83;
9745
- $[230] = t84;
10279
+ $[233] = t80;
10280
+ $[234] = t82;
10281
+ $[235] = t85;
10282
+ $[236] = t86;
9746
10283
  } else {
9747
- t84 = $[230];
10284
+ t86 = $[236];
9748
10285
  }
9749
- let t85;
9750
- if ($[231] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
9751
- t85 = /* @__PURE__ */ jsxDEV("svg", {
10286
+ let t87;
10287
+ if ($[237] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
10288
+ t87 = /* @__PURE__ */ jsxDEV("svg", {
9752
10289
  "aria-hidden": "true",
9753
10290
  className: "size-3.5",
9754
10291
  fill: "none",
@@ -9764,164 +10301,164 @@ const StudioLayout = () => {
9764
10301
  strokeLinecap: "round"
9765
10302
  }, void 0, false)]
9766
10303
  }, void 0, true);
9767
- $[231] = t85;
10304
+ $[237] = t87;
9768
10305
  } else {
9769
- t85 = $[231];
10306
+ t87 = $[237];
9770
10307
  }
9771
- let t86;
9772
- if ($[232] !== t) {
9773
- t86 = t("Search…");
9774
- $[232] = t;
9775
- $[233] = t86;
10308
+ let t88;
10309
+ if ($[238] !== t) {
10310
+ t88 = t("Search…");
10311
+ $[238] = t;
10312
+ $[239] = t88;
9776
10313
  } else {
9777
- t86 = $[233];
10314
+ t88 = $[239];
9778
10315
  }
9779
- let t87;
9780
- if ($[234] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
9781
- t87 = /* @__PURE__ */ jsxDEV("kbd", {
10316
+ let t89;
10317
+ if ($[240] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
10318
+ t89 = /* @__PURE__ */ jsxDEV("kbd", {
9782
10319
  className: "ms-auto rounded border border-border bg-background px-1 font-sans text-[10px] text-muted-foreground",
9783
10320
  children: "⌘K"
9784
10321
  }, void 0, false);
9785
- $[234] = t87;
10322
+ $[240] = t89;
9786
10323
  } else {
9787
- t87 = $[234];
10324
+ t89 = $[240];
9788
10325
  }
9789
- let t88;
9790
- if ($[235] !== t86) {
9791
- t88 = /* @__PURE__ */ jsxDEV("button", {
10326
+ let t90;
10327
+ if ($[241] !== t88) {
10328
+ t90 = /* @__PURE__ */ jsxDEV("button", {
9792
10329
  className: "mx-auto hidden h-8 w-72 items-center gap-2 rounded-lg border border-border bg-muted/40 px-3 text-xs text-muted-foreground transition-colors hover:bg-muted md:flex",
9793
10330
  "data-testid": "dash-app-search",
9794
10331
  onClick: openCommandPalette,
9795
10332
  type: "button",
9796
- children: [t85, t86, t87]
10333
+ children: [t87, t88, t89]
9797
10334
  }, void 0, true);
9798
- $[235] = t86;
9799
- $[236] = t88;
10335
+ $[241] = t88;
10336
+ $[242] = t90;
9800
10337
  } else {
9801
- t88 = $[236];
10338
+ t90 = $[242];
9802
10339
  }
9803
- let t89;
9804
- if ($[237] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
9805
- t89 = /* @__PURE__ */ jsxDEV("div", {
10340
+ let t91;
10341
+ if ($[243] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
10342
+ t91 = /* @__PURE__ */ jsxDEV("div", {
9806
10343
  className: "ms-auto flex items-center gap-1.5 md:ms-0",
9807
10344
  children: /* @__PURE__ */ jsxDEV(ThemeToggle, {}, void 0, false)
9808
10345
  }, void 0, false);
9809
- $[237] = t89;
10346
+ $[243] = t91;
9810
10347
  } else {
9811
- t89 = $[237];
10348
+ t91 = $[243];
9812
10349
  }
9813
- let t90;
9814
- if ($[238] !== t84 || $[239] !== t88) {
9815
- t90 = /* @__PURE__ */ jsxDEV("header", {
10350
+ let t92;
10351
+ if ($[244] !== t86 || $[245] !== t90) {
10352
+ t92 = /* @__PURE__ */ jsxDEV("header", {
9816
10353
  className: "flex h-11 shrink-0 items-center gap-2 border-b border-border px-4",
9817
10354
  "data-testid": "dash-app-header",
9818
- children: [t77, t84, t88, t89]
10355
+ children: [t79, t86, t90, t91]
9819
10356
  }, void 0, true);
9820
- $[238] = t84;
9821
- $[239] = t88;
9822
- $[240] = t90;
10357
+ $[244] = t86;
10358
+ $[245] = t90;
10359
+ $[246] = t92;
9823
10360
  } else {
9824
- t90 = $[240];
10361
+ t92 = $[246];
9825
10362
  }
9826
- let t91;
9827
- if ($[241] !== chrome?.rulesInstalled) {
9828
- t91 = chrome?.rulesInstalled === false && /* @__PURE__ */ jsxDEV(RulesBanner, {}, void 0, false);
9829
- $[241] = chrome?.rulesInstalled;
9830
- $[242] = t91;
9831
- } else {
9832
- t91 = $[242];
9833
- }
9834
- const t92 = `dash-tab-${current}`;
9835
- const t93 = fullHeight ? "flex min-w-0 flex-1 flex-col overflow-hidden" : "min-w-0 flex-1 overflow-auto p-6";
9836
- const t94 = tabLabel[current];
9837
- let t95;
9838
- if ($[243] !== t || $[244] !== t94) {
9839
- t95 = t("{title} failed", {
9840
- title: t94
9841
- });
9842
- $[243] = t;
9843
- $[244] = t94;
9844
- $[245] = t95;
10363
+ let t93;
10364
+ if ($[247] !== chrome?.rulesInstalled) {
10365
+ t93 = chrome?.rulesInstalled === false && /* @__PURE__ */ jsxDEV(RulesBanner, {}, void 0, false);
10366
+ $[247] = chrome?.rulesInstalled;
10367
+ $[248] = t93;
9845
10368
  } else {
9846
- t95 = $[245];
10369
+ t93 = $[248];
9847
10370
  }
10371
+ const t94 = `dash-tab-${current}`;
10372
+ const t95 = fullHeight ? "flex min-w-0 flex-1 flex-col overflow-hidden" : "min-w-0 flex-1 overflow-auto p-6";
9848
10373
  const t96 = tabLabel[current];
9849
10374
  let t97;
9850
- if ($[246] !== t) {
9851
- t97 = t("Try again");
9852
- $[246] = t;
9853
- $[247] = t97;
9854
- } else {
9855
- t97 = $[247];
9856
- }
9857
- let t98;
9858
- if ($[248] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
9859
- t98 = /* @__PURE__ */ jsxDEV(Outlet, {}, void 0, false);
9860
- $[248] = t98;
10375
+ if ($[249] !== t || $[250] !== t96) {
10376
+ t97 = t("{title} failed", {
10377
+ title: t96
10378
+ });
10379
+ $[249] = t;
10380
+ $[250] = t96;
10381
+ $[251] = t97;
9861
10382
  } else {
9862
- t98 = $[248];
10383
+ t97 = $[251];
9863
10384
  }
10385
+ const t98 = tabLabel[current];
9864
10386
  let t99;
9865
- if ($[249] !== current || $[250] !== t95 || $[251] !== t96 || $[252] !== t97) {
9866
- t99 = /* @__PURE__ */ jsxDEV(ErrorBoundary, {
9867
- fallbackTitle: t95,
9868
- label: t96,
9869
- retryLabel: t97,
9870
- children: t98
9871
- }, current, false);
9872
- $[249] = current;
9873
- $[250] = t95;
9874
- $[251] = t96;
9875
- $[252] = t97;
10387
+ if ($[252] !== t) {
10388
+ t99 = t("Try again");
10389
+ $[252] = t;
9876
10390
  $[253] = t99;
9877
10391
  } else {
9878
10392
  t99 = $[253];
9879
10393
  }
9880
10394
  let t100;
9881
- if ($[254] !== t93 || $[255] !== t99) {
9882
- t100 = /* @__PURE__ */ jsxDEV("div", {
9883
- className: t93,
9884
- children: t99
9885
- }, void 0, false);
9886
- $[254] = t93;
9887
- $[255] = t99;
9888
- $[256] = t100;
10395
+ if ($[254] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
10396
+ t100 = /* @__PURE__ */ jsxDEV(Outlet, {}, void 0, false);
10397
+ $[254] = t100;
9889
10398
  } else {
9890
- t100 = $[256];
10399
+ t100 = $[254];
9891
10400
  }
9892
10401
  let t101;
9893
- if ($[257] !== t100 || $[258] !== t92) {
9894
- t101 = /* @__PURE__ */ jsxDEV("div", {
9895
- "aria-labelledby": t92,
10402
+ if ($[255] !== current || $[256] !== t97 || $[257] !== t98 || $[258] !== t99) {
10403
+ t101 = /* @__PURE__ */ jsxDEV(ErrorBoundary, {
10404
+ fallbackTitle: t97,
10405
+ label: t98,
10406
+ retryLabel: t99,
10407
+ children: t100
10408
+ }, current, false);
10409
+ $[255] = current;
10410
+ $[256] = t97;
10411
+ $[257] = t98;
10412
+ $[258] = t99;
10413
+ $[259] = t101;
10414
+ } else {
10415
+ t101 = $[259];
10416
+ }
10417
+ let t102;
10418
+ if ($[260] !== t101 || $[261] !== t95) {
10419
+ t102 = /* @__PURE__ */ jsxDEV("div", {
10420
+ className: t95,
10421
+ children: t101
10422
+ }, void 0, false);
10423
+ $[260] = t101;
10424
+ $[261] = t95;
10425
+ $[262] = t102;
10426
+ } else {
10427
+ t102 = $[262];
10428
+ }
10429
+ let t103;
10430
+ if ($[263] !== t102 || $[264] !== t94) {
10431
+ t103 = /* @__PURE__ */ jsxDEV("div", {
10432
+ "aria-labelledby": t94,
9896
10433
  className: "flex min-w-0 flex-1 flex-col overflow-hidden",
9897
10434
  "data-testid": "dash-panel",
9898
10435
  id: "dash-panel",
9899
10436
  role: "tabpanel",
9900
- children: t100
10437
+ children: t102
9901
10438
  }, void 0, false);
9902
- $[257] = t100;
9903
- $[258] = t92;
9904
- $[259] = t101;
10439
+ $[263] = t102;
10440
+ $[264] = t94;
10441
+ $[265] = t103;
9905
10442
  } else {
9906
- t101 = $[259];
10443
+ t103 = $[265];
9907
10444
  }
9908
- let t102;
9909
- if ($[260] !== t101 || $[261] !== t90 || $[262] !== t91) {
9910
- t102 = /* @__PURE__ */ jsxDEV(SidebarInset, {
10445
+ let t104;
10446
+ if ($[266] !== t103 || $[267] !== t92 || $[268] !== t93) {
10447
+ t104 = /* @__PURE__ */ jsxDEV(SidebarInset, {
9911
10448
  className: "overflow-hidden md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",
9912
- children: [t90, t91, t101]
10449
+ children: [t92, t93, t103]
9913
10450
  }, void 0, true);
9914
- $[260] = t101;
9915
- $[261] = t90;
9916
- $[262] = t91;
9917
- $[263] = t102;
10451
+ $[266] = t103;
10452
+ $[267] = t92;
10453
+ $[268] = t93;
10454
+ $[269] = t104;
9918
10455
  } else {
9919
- t102 = $[263];
10456
+ t104 = $[269];
9920
10457
  }
9921
10458
  return /* @__PURE__ */ jsxDEV(SidebarProvider, {
9922
10459
  className: "min-h-0 flex-1",
9923
10460
  "data-testid": "lunora-studio",
9924
- children: [t76, /* @__PURE__ */ jsxDEV(StudioSidebar, {
10461
+ children: [t78, /* @__PURE__ */ jsxDEV(StudioSidebar, {
9925
10462
  chrome,
9926
10463
  connected,
9927
10464
  current,
@@ -9930,7 +10467,7 @@ const StudioLayout = () => {
9930
10467
  selectTab,
9931
10468
  tabDescription,
9932
10469
  tabLabel
9933
- }, void 0, false), t102]
10470
+ }, void 0, false), t104]
9934
10471
  }, void 0, true);
9935
10472
  };
9936
10473
  const RoutePending = () => {
@@ -10096,6 +10633,7 @@ const buildRouter = ({
10096
10633
  }, void 0, false),
10097
10634
  mail: /* @__PURE__ */ jsxDEV(MailPanel, {}, void 0, false),
10098
10635
  payments: /* @__PURE__ */ jsxDEV(PaymentsPanel, {}, void 0, false),
10636
+ queues: /* @__PURE__ */ jsxDEV(QueuesPanel, {}, void 0, false),
10099
10637
  realtime: /* @__PURE__ */ jsxDEV(SubscriptionsPanel, {
10100
10638
  initialShardKey
10101
10639
  }, void 0, false),
@@ -10126,11 +10664,21 @@ const buildRouter = ({
10126
10664
  getParentRoute: () => rootRoute,
10127
10665
  path: "/"
10128
10666
  });
10129
- const tabRoutes = TABS.map((tab) => createRoute({
10130
- component: () => panels[tab],
10131
- getParentRoute: () => rootRoute,
10132
- path: `/${tab}`
10133
- }));
10667
+ const tabRoutes = TABS.map((tab) => {
10668
+ if (tab === "data") {
10669
+ return createRoute({
10670
+ component: () => panels[tab],
10671
+ getParentRoute: () => rootRoute,
10672
+ path: `/${tab}`,
10673
+ validateSearch: validateDataViewSearch
10674
+ });
10675
+ }
10676
+ return createRoute({
10677
+ component: () => panels[tab],
10678
+ getParentRoute: () => rootRoute,
10679
+ path: `/${tab}`
10680
+ });
10681
+ });
10134
10682
  const routeTree = rootRoute.addChildren([indexRoute, ...tabRoutes]);
10135
10683
  const history = "window" in globalThis ? createBrowserHistory() : createMemoryHistory({
10136
10684
  initialEntries: ["/home"]
@@ -10300,4 +10848,4 @@ function _temp2(group_0) {
10300
10848
  return group_0.tabs.length > 0;
10301
10849
  }
10302
10850
 
10303
- export { Studio as S, ThemeProvider as T, TooltipProvider as a, useTheme as u };
10851
+ export { BrandMark as B, Studio as S, ThemeProvider as T, TooltipProvider as a, useTheme as u };