@lunora/studio 1.0.0-alpha.4 → 1.0.0-alpha.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +6 -0
- package/__assets__/package-og.svg +1 -1
- package/dist/index.d.ts +33 -18
- package/dist/index.js +29 -29
- package/dist/mount.d.ts +1 -1
- package/dist/mount.js +3 -2
- package/dist/{packem_shared/ApiTab-W3no0KOj.js → packem_chunks/ApiTab.js} +5 -5
- package/dist/{packem_shared/AuditPanel-Bq4o_IqT.js → packem_chunks/AuditPanel.js} +29 -41
- package/dist/{packem_shared/ExportImportPanel-dxY56TDF.js → packem_chunks/ExportImportPanel.js} +16 -11
- package/dist/{packem_shared/FileBrowser-Dhy4zES8.js → packem_chunks/FileBrowser.js} +15 -15
- package/dist/{packem_shared/FunctionRunner--fQJRPAD.js → packem_chunks/FunctionRunner.js} +10 -10
- package/dist/{packem_shared/FunctionStatsPanel-BjRUA_G3.js → packem_chunks/FunctionStatsPanel.js} +153 -208
- package/dist/{packem_shared/HealthPanel-PxclMWmA.js → packem_chunks/HealthPanel.js} +37 -29
- package/dist/{packem_shared/InsightsPanel-CWS_C-xW.js → packem_chunks/InsightsPanel.js} +108 -69
- package/dist/{packem_shared/LogsPanel-CTW8CFcM.js → packem_chunks/LogsPanel.js} +46 -58
- package/dist/{packem_shared/MailPanel-BwkvfIHF.js → packem_chunks/MailPanel.js} +45 -139
- package/dist/{packem_shared/MetricsPanel-BLuOhZQ4.js → packem_chunks/MetricsPanel.js} +41 -322
- package/dist/{packem_shared/MigrationsPanel-DT3lnwHF.js → packem_chunks/MigrationsPanel.js} +44 -51
- package/dist/{packem_shared/PitrPanel-CdErL7EJ.js → packem_chunks/PitrPanel.js} +9 -9
- package/dist/{packem_shared/SchemaViewer-LJDcmNIO.js → packem_chunks/SchemaViewer.js} +17 -16
- package/dist/{packem_shared/SecurityAdvisorPanel-C_ETsPih.js → packem_chunks/SecurityAdvisorPanel.js} +47 -31
- package/dist/packem_chunks/SettingsPanel.js +391 -0
- package/dist/{packem_shared/sql-editor-panel-BFRpzj6r.js → packem_chunks/SqlEditorPanel.js} +158 -387
- package/dist/{packem_shared/TableEditor-ChfUOZec.js → packem_chunks/TableEditor.js} +10 -68
- package/dist/packem_chunks/analytics-panel.js +261 -0
- package/dist/packem_chunks/auth-config-panel.js +365 -0
- package/dist/packem_chunks/auth-sessions-panel.js +175 -0
- package/dist/packem_chunks/containers-panel.js +247 -0
- package/dist/packem_chunks/dashboards-panel.js +780 -0
- package/dist/packem_chunks/fanout-panel.js +482 -0
- package/dist/packem_chunks/flags-panel.js +176 -0
- package/dist/packem_chunks/kv-browser.js +1896 -0
- package/dist/packem_chunks/log-drains-panel.js +273 -0
- package/dist/packem_chunks/organizations-panel.js +3178 -0
- package/dist/packem_chunks/payments-panel.js +186 -0
- package/dist/packem_chunks/permissions-panel.js +805 -0
- package/dist/packem_chunks/queues-panel.js +1075 -0
- package/dist/packem_chunks/rls-panel.js +315 -0
- package/dist/packem_chunks/schedule-panel.js +831 -0
- package/dist/packem_chunks/sparkline.js +79 -0
- package/dist/packem_chunks/storage-rules-panel.js +140 -0
- package/dist/packem_chunks/subscriptions-panel.js +238 -0
- package/dist/packem_chunks/users-panel.js +1731 -0
- package/dist/packem_chunks/vector-browser.js +281 -0
- package/dist/packem_chunks/workflows-panel.js +562 -0
- package/dist/packem_shared/{ADMIN_FUNCTIONS-DmBqMZ-z.js → ADMIN_FUNCTIONS-BHHJi3Gb.js} +7 -0
- package/dist/packem_shared/{ApiDocsPanel-C5-yJ1p7.js → ApiDocsPanel-CBma-lnp.js} +2 -2
- package/dist/packem_shared/{ApiReferencePanel-1vubqG5s.js → ApiReferencePanel-CQM3pPN7.js} +2 -1
- package/dist/packem_shared/{CommandPalette-BtgkBzZI.js → CommandPalette-X2tkbyHk.js} +1 -1
- package/dist/packem_shared/{DataBrowser-CtBe1So9.js → DataBrowser-D2ywrdId.js} +198 -247
- package/dist/packem_shared/{GlobalDataBrowser-BTEmGrph.js → GlobalDataBrowser-BkTPLzAY.js} +37 -66
- package/dist/packem_shared/HomePanel-D1Q9LZgK.js +14 -0
- package/dist/packem_shared/{OpenRpcReferencePanel-vbcYbv3V.js → OpenRpcReferencePanel-Dno-hfDb.js} +2 -1
- package/dist/packem_shared/{ScheduledJobs-CabfKbyM.js → ScheduledJobs-Ctw4jYtU.js} +163 -60
- package/dist/packem_shared/Studio-lJhzDAze.js +16 -0
- package/dist/packem_shared/{StudioApp-CHOZA-z-.js → StudioApp-DiMkupvZ.js} +276 -11
- package/dist/packem_shared/{advisor-view-CGcfMiPq.js → advisor-view-BX8OhG0w.js} +6 -6
- package/dist/packem_shared/alert-CdAET2K_.js +68 -0
- package/dist/packem_shared/{app.d-CCmwDEVs.d.ts → app.d-CNLRTrWw.d.ts} +1 -1
- package/dist/packem_shared/{bar-chart-CzJAgqkp.js → bar-chart-DSwcWIRy.js} +5 -4
- package/dist/packem_shared/browser-storage-BTrX4y3B.js +215 -0
- package/dist/packem_shared/{cf-links-2cktDedA.js → cf-links-BZfRdxSE.js} +1 -1
- package/dist/packem_shared/{data-grid-B5CaV3wS.js → data-grid-CdXztApG.js} +1 -1
- package/dist/packem_shared/data-view-params-Cd6yRVbv.js +96 -0
- package/dist/packem_shared/error-alert-CXjqyGw9.js +114 -0
- package/dist/packem_shared/{grid-features-CzUfqgsM.js → grid-features-BF-KBDFz.js} +131 -163
- package/dist/packem_shared/home-panel-TFcRf9Ui.js +1889 -0
- package/dist/packem_shared/{internal-rXJEAhXS.js → internal-CYcbqMjX.js} +44 -3
- package/dist/packem_shared/modal-shell-hyaJvIJ6.js +100 -0
- package/dist/packem_shared/{reference-view-B4E49Lip.js → reference-view-DUiJcILV.js} +6 -45
- package/dist/packem_shared/scroll-area-DLhcy-ml.js +93 -0
- package/dist/packem_shared/select-UkNYCT3s.js +273 -0
- package/dist/packem_shared/skeleton-CGhL0p20.js +45 -0
- package/dist/packem_shared/{sparkline-10dG-_f0.js → sparkline-BnA1kC9X.js} +1 -1
- package/dist/packem_shared/studio-Dh9UlaF_.js +4015 -0
- package/dist/packem_shared/{table-_RzNvy3R.js → table-DsCa9Qp9.js} +1 -1
- package/dist/packem_shared/{table-list-sidebar-Bg7uzbvC.js → table-list-sidebar-UVIXQJdU.js} +1 -1
- package/dist/packem_shared/use-admin-query-CfHYWx5n.js +106 -0
- package/dist/packem_shared/use-async-submit-DJQiPc-_.js +91 -0
- package/dist/standalone/chunk-25AYY4H7.js +2 -0
- package/dist/standalone/chunk-2ANAF4ZM.js +1 -0
- package/dist/standalone/chunk-2K47A3P6.js +1 -0
- package/dist/standalone/chunk-2NGUNNGW.js +1 -0
- package/dist/standalone/chunk-3CJW6NWG.js +4 -0
- package/dist/standalone/chunk-3OA7PECS.js +6 -0
- package/dist/standalone/chunk-3OIHOXVV.js +1 -0
- package/dist/standalone/chunk-447TAUFD.js +1 -0
- package/dist/standalone/chunk-4QHKBC77.js +1 -0
- package/dist/standalone/chunk-5C4TSNE6.js +1 -0
- package/dist/standalone/chunk-5OIBXYZM.js +1 -0
- package/dist/standalone/chunk-6HSHEMZV.js +76 -0
- package/dist/standalone/chunk-6JIZ34MB.js +3 -0
- package/dist/standalone/chunk-6VO23MMW.js +4 -0
- package/dist/standalone/chunk-7MVSQS7B.js +1 -0
- package/dist/standalone/chunk-7TJJXVSE.js +1 -0
- package/dist/standalone/chunk-7YXOPTWI.js +1 -0
- package/dist/standalone/chunk-AHILM3ZP.js +1 -0
- package/dist/standalone/chunk-BGXOXASQ.js +1 -0
- package/dist/standalone/chunk-BJGBHGK3.js +1 -0
- package/dist/standalone/chunk-BOXSWNXZ.js +1 -0
- package/dist/standalone/chunk-BX5MKYOC.js +1 -0
- package/dist/standalone/chunk-CKSHCYGC.js +2 -0
- package/dist/standalone/chunk-DWDILV2E.js +1 -0
- package/dist/standalone/chunk-E75ANNWX.js +19 -0
- package/dist/standalone/chunk-EQZQOTJY.js +1 -0
- package/dist/standalone/chunk-GTLEWM5Y.js +1 -0
- package/dist/standalone/chunk-GTM65MVX.js +1 -0
- package/dist/standalone/chunk-GUI5GFFI.js +1 -0
- package/dist/standalone/chunk-HN6KJXYQ.js +1 -0
- package/dist/standalone/chunk-HV7G6DFP.js +5 -0
- package/dist/standalone/chunk-HYDJNCGW.js +1 -0
- package/dist/standalone/chunk-HZK5RQHG.js +1 -0
- package/dist/standalone/chunk-IN2SYVJB.js +1 -0
- package/dist/standalone/chunk-IOANPSJN.js +1 -0
- package/dist/standalone/chunk-ISDZPW3V.js +1 -0
- package/dist/standalone/chunk-IXDH4GL5.js +1 -0
- package/dist/standalone/chunk-J6J54MBP.js +1 -0
- package/dist/standalone/chunk-J73VHFCL.js +1 -0
- package/dist/standalone/chunk-JHKMUTIF.js +13 -0
- package/dist/standalone/chunk-JPRH6DPK.js +1 -0
- package/dist/standalone/chunk-JSEXCW5Q.js +1 -0
- package/dist/standalone/chunk-KA5YB3VP.js +1 -0
- package/dist/standalone/chunk-KBB75WNT.js +1 -0
- package/dist/standalone/chunk-KEGAWN6Y.js +1 -0
- package/dist/standalone/chunk-KJJ3WM6H.js +4 -0
- package/dist/standalone/chunk-KQV4NGH3.js +1 -0
- package/dist/standalone/chunk-KSKXW5PX.js +1 -0
- package/dist/standalone/chunk-KUH4P5F5.js +1 -0
- package/dist/standalone/chunk-KYJPPVGB.js +1 -0
- package/dist/standalone/chunk-KZ6INM5M.js +1 -0
- package/dist/standalone/chunk-L2TJVSDQ.js +1 -0
- package/dist/standalone/chunk-L7SK4ZZD.js +1 -0
- package/dist/standalone/chunk-LAK5VSPI.js +1 -0
- package/dist/standalone/chunk-LBN7LPVK.js +1 -0
- package/dist/standalone/chunk-LNZIB2MD.js +1 -0
- package/dist/standalone/chunk-MJWVMKQ4.js +6 -0
- package/dist/standalone/chunk-MLZYX5CQ.js +1 -0
- package/dist/standalone/chunk-N2X2OO4V.js +1 -0
- package/dist/standalone/chunk-NGKITPQP.js +13 -0
- package/dist/standalone/chunk-O3NAGRTR.js +1 -0
- package/dist/standalone/chunk-OZACQNKG.js +1 -0
- package/dist/standalone/chunk-PNDNXS5Z.js +1 -0
- package/dist/standalone/chunk-Q7DMUTUE.js +1 -0
- package/dist/standalone/chunk-QAFAJBAW.js +1 -0
- package/dist/standalone/chunk-QBAT52GB.js +1 -0
- package/dist/standalone/chunk-RHZ4M2NZ.js +1 -0
- package/dist/standalone/chunk-RRCPZMC2.js +22 -0
- package/dist/standalone/chunk-SEU5V7I6.js +1 -0
- package/dist/standalone/chunk-TAD43CG5.js +1 -0
- package/dist/standalone/chunk-TBMYIZIO.js +1 -0
- package/dist/standalone/chunk-TDZ44E5I.js +4 -0
- package/dist/standalone/chunk-THNBTMUF.js +1 -0
- package/dist/standalone/chunk-TIQISBGK.js +1 -0
- package/dist/standalone/chunk-TMYVNQ66.js +1 -0
- package/dist/standalone/chunk-TQ36RWOP.js +1 -0
- package/dist/standalone/chunk-UGUEC6BC.js +1 -0
- package/dist/standalone/chunk-UJB2LEI4.js +4 -0
- package/dist/standalone/chunk-UK64ZSUW.js +1 -0
- package/dist/standalone/chunk-UKDJ4H7I.js +1 -0
- package/dist/standalone/chunk-VLXV72QE.js +1 -0
- package/dist/standalone/chunk-VON7JUPG.js +1 -0
- package/dist/standalone/chunk-W3JK4YWR.js +1 -0
- package/dist/standalone/chunk-W3SHEIAL.js +3 -0
- package/dist/standalone/chunk-WI7GWFEG.js +1 -0
- package/dist/standalone/chunk-WIHXMNUY.js +1 -0
- package/dist/standalone/chunk-WLDVXVI2.js +1 -0
- package/dist/standalone/chunk-XLXNLJ4N.js +1 -0
- package/dist/standalone/chunk-XNJNSCLM.js +1 -0
- package/dist/standalone/chunk-YAECF5LW.js +1 -0
- package/dist/standalone/chunk-YBGC4PPD.js +1 -0
- package/dist/standalone/chunk-YJAPWSDC.js +4 -0
- package/dist/standalone/chunk-ZEJB6DXU.js +8 -0
- package/dist/standalone/chunk-ZFNBPAIZ.js +1 -0
- package/dist/standalone/chunk-ZHVTQ37P.js +1 -0
- package/dist/standalone/chunk-ZIGWVHCS.js +1 -0
- package/dist/standalone/chunk-ZPP2KOR4.js +1 -0
- package/dist/standalone/chunk-ZPUO7FNI.js +1 -0
- package/dist/standalone/studio.js +104 -246
- package/dist/styles.css +2 -2
- package/package.json +15 -13
- package/dist/packem_shared/HomePanel-Cw16stjq.js +0 -1273
- package/dist/packem_shared/SettingsPanel-C0uLRf5P.js +0 -176
- package/dist/packem_shared/SqlEditorPanel-CguV7otm.js +0 -13
- package/dist/packem_shared/Studio-DFWAlcuf.js +0 -33
- package/dist/packem_shared/studio-Bj8psK1c.js +0 -10303
- package/dist/packem_shared/use-live-admin-Dq6g3daN.js +0 -73
- package/dist/packem_shared/use-live-shard-seed-Cuk3dnH0.js +0 -76
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import { c } from 'react/compiler-runtime';
|
|
2
|
+
import { E as ErrorAlert } from '../packem_shared/error-alert-CXjqyGw9.js';
|
|
3
|
+
import { B as Badge } from '../packem_shared/badge-B2PKA1-5.js';
|
|
4
|
+
import { a as CardContent, C as Card } from '../packem_shared/card-DURq3ElK.js';
|
|
5
|
+
import { E as EmptyState } from '../packem_shared/empty-state-DY_oe0k6.js';
|
|
6
|
+
import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell } from '../packem_shared/table-DsCa9Qp9.js';
|
|
7
|
+
import { u as useAdminQuery } from '../packem_shared/use-admin-query-CfHYWx5n.js';
|
|
8
|
+
import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
|
|
9
|
+
import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-BHHJi3Gb.js';
|
|
10
|
+
import { jsxDEV } from 'react/jsx-dev-runtime';
|
|
11
|
+
|
|
12
|
+
const OPERATIONS = ["read", "insert", "update", "delete"];
|
|
13
|
+
const operationLabel = (t, operation) => ({
|
|
14
|
+
delete: t("Delete"),
|
|
15
|
+
insert: t("Insert"),
|
|
16
|
+
read: t("Read"),
|
|
17
|
+
update: t("Update")
|
|
18
|
+
})[operation];
|
|
19
|
+
const groupByTable = (policies) => {
|
|
20
|
+
const byTable = /* @__PURE__ */ new Map();
|
|
21
|
+
for (const policy of policies) {
|
|
22
|
+
const coverage = byTable.get(policy.table) ?? {
|
|
23
|
+
operations: /* @__PURE__ */ new Set(),
|
|
24
|
+
procedures: [],
|
|
25
|
+
table: policy.table
|
|
26
|
+
};
|
|
27
|
+
coverage.operations.add(policy.on);
|
|
28
|
+
if (!coverage.procedures.includes(policy.procedure)) {
|
|
29
|
+
coverage.procedures.push(policy.procedure);
|
|
30
|
+
}
|
|
31
|
+
byTable.set(policy.table, coverage);
|
|
32
|
+
}
|
|
33
|
+
return [...byTable.values()].toSorted((a, b) => a.table.localeCompare(b.table));
|
|
34
|
+
};
|
|
35
|
+
const RlsPanel = () => {
|
|
36
|
+
const $ = c(49);
|
|
37
|
+
const t = useT();
|
|
38
|
+
let t0;
|
|
39
|
+
if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
40
|
+
t0 = {};
|
|
41
|
+
$[0] = t0;
|
|
42
|
+
} else {
|
|
43
|
+
t0 = $[0];
|
|
44
|
+
}
|
|
45
|
+
const {
|
|
46
|
+
data,
|
|
47
|
+
error,
|
|
48
|
+
errorSource
|
|
49
|
+
} = useAdminQuery(ADMIN_FUNCTIONS.rlsPolicies, t0);
|
|
50
|
+
const loaded = data !== void 0;
|
|
51
|
+
let T0;
|
|
52
|
+
let roles;
|
|
53
|
+
let t1;
|
|
54
|
+
let t2;
|
|
55
|
+
let t3;
|
|
56
|
+
let t4;
|
|
57
|
+
let t5;
|
|
58
|
+
let t6;
|
|
59
|
+
let t7;
|
|
60
|
+
if ($[1] !== data || $[2] !== error || $[3] !== errorSource || $[4] !== loaded || $[5] !== t) {
|
|
61
|
+
const tables = groupByTable(Array.isArray(data?.policies) ? data.policies : []);
|
|
62
|
+
let t82;
|
|
63
|
+
if ($[15] !== data) {
|
|
64
|
+
t82 = Array.isArray(data?.roles) ? data.roles : [];
|
|
65
|
+
$[15] = data;
|
|
66
|
+
$[16] = t82;
|
|
67
|
+
} else {
|
|
68
|
+
t82 = $[16];
|
|
69
|
+
}
|
|
70
|
+
roles = t82;
|
|
71
|
+
t5 = "flex flex-col gap-6";
|
|
72
|
+
t6 = "lunora-rls-panel";
|
|
73
|
+
if ($[17] !== error || $[18] !== errorSource) {
|
|
74
|
+
t7 = error !== null && /* @__PURE__ */ jsxDEV(ErrorAlert, {
|
|
75
|
+
error: errorSource,
|
|
76
|
+
testId: "rls-error"
|
|
77
|
+
}, void 0, false);
|
|
78
|
+
$[17] = error;
|
|
79
|
+
$[18] = errorSource;
|
|
80
|
+
$[19] = t7;
|
|
81
|
+
} else {
|
|
82
|
+
t7 = $[19];
|
|
83
|
+
}
|
|
84
|
+
t4 = "flex flex-col gap-2";
|
|
85
|
+
T0 = Card;
|
|
86
|
+
t1 = "overflow-hidden py-0";
|
|
87
|
+
let t92;
|
|
88
|
+
if ($[20] !== t) {
|
|
89
|
+
t92 = t("Policies");
|
|
90
|
+
$[20] = t;
|
|
91
|
+
$[21] = t92;
|
|
92
|
+
} else {
|
|
93
|
+
t92 = $[21];
|
|
94
|
+
}
|
|
95
|
+
if ($[22] !== t92) {
|
|
96
|
+
t2 = /* @__PURE__ */ jsxDEV("header", {
|
|
97
|
+
className: "border-b border-border px-4 py-3",
|
|
98
|
+
children: /* @__PURE__ */ jsxDEV("span", {
|
|
99
|
+
className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
|
|
100
|
+
children: t92
|
|
101
|
+
}, void 0, false)
|
|
102
|
+
}, void 0, false);
|
|
103
|
+
$[22] = t92;
|
|
104
|
+
$[23] = t2;
|
|
105
|
+
} else {
|
|
106
|
+
t2 = $[23];
|
|
107
|
+
}
|
|
108
|
+
t3 = loaded && tables.length === 0 ? /* @__PURE__ */ jsxDEV(EmptyState, {
|
|
109
|
+
description: t("No `definePolicy` is wired through `.use(rls(...))` in this deployment. Add one to guard a table's rows."),
|
|
110
|
+
testId: "rls-policies-empty",
|
|
111
|
+
title: t("No policies defined")
|
|
112
|
+
}, void 0, false) : /* @__PURE__ */ jsxDEV(CardContent, {
|
|
113
|
+
className: "px-0",
|
|
114
|
+
children: /* @__PURE__ */ jsxDEV(Table, {
|
|
115
|
+
"data-testid": "rls-policies-table",
|
|
116
|
+
children: [/* @__PURE__ */ jsxDEV(TableHeader, {
|
|
117
|
+
children: /* @__PURE__ */ jsxDEV(TableRow, {
|
|
118
|
+
children: [/* @__PURE__ */ jsxDEV(TableHead, {
|
|
119
|
+
children: t("Table")
|
|
120
|
+
}, void 0, false), OPERATIONS.map((operation) => /* @__PURE__ */ jsxDEV(TableHead, {
|
|
121
|
+
children: operationLabel(t, operation)
|
|
122
|
+
}, operation, false)), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
123
|
+
children: t("Guarded by")
|
|
124
|
+
}, void 0, false)]
|
|
125
|
+
}, void 0, true)
|
|
126
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableBody, {
|
|
127
|
+
children: tables.map((coverage) => /* @__PURE__ */ jsxDEV(TableRow, {
|
|
128
|
+
"data-testid": `rls-table-${coverage.table}`,
|
|
129
|
+
children: [/* @__PURE__ */ jsxDEV(TableCell, {
|
|
130
|
+
className: "font-mono text-xs",
|
|
131
|
+
children: coverage.table
|
|
132
|
+
}, void 0, false), OPERATIONS.map((operation_0) => /* @__PURE__ */ jsxDEV(TableCell, {
|
|
133
|
+
children: coverage.operations.has(operation_0) ? /* @__PURE__ */ jsxDEV(Badge, {
|
|
134
|
+
variant: "secondary",
|
|
135
|
+
children: t("Guarded")
|
|
136
|
+
}, void 0, false) : /* @__PURE__ */ jsxDEV("span", {
|
|
137
|
+
"aria-hidden": "true",
|
|
138
|
+
className: "text-muted-foreground",
|
|
139
|
+
children: "—"
|
|
140
|
+
}, void 0, false)
|
|
141
|
+
}, operation_0, false)), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
142
|
+
className: "font-mono text-xs text-muted-foreground",
|
|
143
|
+
children: coverage.procedures.join(", ")
|
|
144
|
+
}, void 0, false)]
|
|
145
|
+
}, coverage.table, true))
|
|
146
|
+
}, void 0, false)]
|
|
147
|
+
}, void 0, true)
|
|
148
|
+
}, void 0, false);
|
|
149
|
+
$[1] = data;
|
|
150
|
+
$[2] = error;
|
|
151
|
+
$[3] = errorSource;
|
|
152
|
+
$[4] = loaded;
|
|
153
|
+
$[5] = t;
|
|
154
|
+
$[6] = T0;
|
|
155
|
+
$[7] = roles;
|
|
156
|
+
$[8] = t1;
|
|
157
|
+
$[9] = t2;
|
|
158
|
+
$[10] = t3;
|
|
159
|
+
$[11] = t4;
|
|
160
|
+
$[12] = t5;
|
|
161
|
+
$[13] = t6;
|
|
162
|
+
$[14] = t7;
|
|
163
|
+
} else {
|
|
164
|
+
T0 = $[6];
|
|
165
|
+
roles = $[7];
|
|
166
|
+
t1 = $[8];
|
|
167
|
+
t2 = $[9];
|
|
168
|
+
t3 = $[10];
|
|
169
|
+
t4 = $[11];
|
|
170
|
+
t5 = $[12];
|
|
171
|
+
t6 = $[13];
|
|
172
|
+
t7 = $[14];
|
|
173
|
+
}
|
|
174
|
+
let t8;
|
|
175
|
+
if ($[24] !== T0 || $[25] !== t1 || $[26] !== t2 || $[27] !== t3) {
|
|
176
|
+
t8 = /* @__PURE__ */ jsxDEV(T0, {
|
|
177
|
+
className: t1,
|
|
178
|
+
children: [t2, t3]
|
|
179
|
+
}, void 0, true);
|
|
180
|
+
$[24] = T0;
|
|
181
|
+
$[25] = t1;
|
|
182
|
+
$[26] = t2;
|
|
183
|
+
$[27] = t3;
|
|
184
|
+
$[28] = t8;
|
|
185
|
+
} else {
|
|
186
|
+
t8 = $[28];
|
|
187
|
+
}
|
|
188
|
+
let t9;
|
|
189
|
+
if ($[29] !== t4 || $[30] !== t8) {
|
|
190
|
+
t9 = /* @__PURE__ */ jsxDEV("section", {
|
|
191
|
+
className: t4,
|
|
192
|
+
children: t8
|
|
193
|
+
}, void 0, false);
|
|
194
|
+
$[29] = t4;
|
|
195
|
+
$[30] = t8;
|
|
196
|
+
$[31] = t9;
|
|
197
|
+
} else {
|
|
198
|
+
t9 = $[31];
|
|
199
|
+
}
|
|
200
|
+
let t10;
|
|
201
|
+
if ($[32] !== t) {
|
|
202
|
+
t10 = t("Roles");
|
|
203
|
+
$[32] = t;
|
|
204
|
+
$[33] = t10;
|
|
205
|
+
} else {
|
|
206
|
+
t10 = $[33];
|
|
207
|
+
}
|
|
208
|
+
let t11;
|
|
209
|
+
if ($[34] !== t10) {
|
|
210
|
+
t11 = /* @__PURE__ */ jsxDEV("header", {
|
|
211
|
+
className: "border-b border-border px-4 py-3",
|
|
212
|
+
children: /* @__PURE__ */ jsxDEV("span", {
|
|
213
|
+
className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
|
|
214
|
+
children: t10
|
|
215
|
+
}, void 0, false)
|
|
216
|
+
}, void 0, false);
|
|
217
|
+
$[34] = t10;
|
|
218
|
+
$[35] = t11;
|
|
219
|
+
} else {
|
|
220
|
+
t11 = $[35];
|
|
221
|
+
}
|
|
222
|
+
let t12;
|
|
223
|
+
if ($[36] !== loaded || $[37] !== roles || $[38] !== t) {
|
|
224
|
+
t12 = loaded && roles.length === 0 ? /* @__PURE__ */ jsxDEV(EmptyState, {
|
|
225
|
+
description: t("No `defineRole` is registered via `rls(policies, { roles })`. Roles back `ctx.auth.can(...)` permission checks."),
|
|
226
|
+
testId: "rls-roles-empty",
|
|
227
|
+
title: t("No roles defined")
|
|
228
|
+
}, void 0, false) : /* @__PURE__ */ jsxDEV(CardContent, {
|
|
229
|
+
className: "px-0",
|
|
230
|
+
children: /* @__PURE__ */ jsxDEV(Table, {
|
|
231
|
+
"data-testid": "rls-roles-table",
|
|
232
|
+
children: [/* @__PURE__ */ jsxDEV(TableHeader, {
|
|
233
|
+
children: /* @__PURE__ */ jsxDEV(TableRow, {
|
|
234
|
+
children: [/* @__PURE__ */ jsxDEV(TableHead, {
|
|
235
|
+
children: t("Role")
|
|
236
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
237
|
+
children: t("Description")
|
|
238
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
239
|
+
children: t("Permissions")
|
|
240
|
+
}, void 0, false)]
|
|
241
|
+
}, void 0, true)
|
|
242
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableBody, {
|
|
243
|
+
children: roles.map(_temp2)
|
|
244
|
+
}, void 0, false)]
|
|
245
|
+
}, void 0, true)
|
|
246
|
+
}, void 0, false);
|
|
247
|
+
$[36] = loaded;
|
|
248
|
+
$[37] = roles;
|
|
249
|
+
$[38] = t;
|
|
250
|
+
$[39] = t12;
|
|
251
|
+
} else {
|
|
252
|
+
t12 = $[39];
|
|
253
|
+
}
|
|
254
|
+
let t13;
|
|
255
|
+
if ($[40] !== t11 || $[41] !== t12) {
|
|
256
|
+
t13 = /* @__PURE__ */ jsxDEV("section", {
|
|
257
|
+
className: "flex flex-col gap-2",
|
|
258
|
+
children: /* @__PURE__ */ jsxDEV(Card, {
|
|
259
|
+
className: "overflow-hidden py-0",
|
|
260
|
+
children: [t11, t12]
|
|
261
|
+
}, void 0, true)
|
|
262
|
+
}, void 0, false);
|
|
263
|
+
$[40] = t11;
|
|
264
|
+
$[41] = t12;
|
|
265
|
+
$[42] = t13;
|
|
266
|
+
} else {
|
|
267
|
+
t13 = $[42];
|
|
268
|
+
}
|
|
269
|
+
let t14;
|
|
270
|
+
if ($[43] !== t13 || $[44] !== t5 || $[45] !== t6 || $[46] !== t7 || $[47] !== t9) {
|
|
271
|
+
t14 = /* @__PURE__ */ jsxDEV("div", {
|
|
272
|
+
className: t5,
|
|
273
|
+
"data-testid": t6,
|
|
274
|
+
children: [t7, t9, t13]
|
|
275
|
+
}, void 0, true);
|
|
276
|
+
$[43] = t13;
|
|
277
|
+
$[44] = t5;
|
|
278
|
+
$[45] = t6;
|
|
279
|
+
$[46] = t7;
|
|
280
|
+
$[47] = t9;
|
|
281
|
+
$[48] = t14;
|
|
282
|
+
} else {
|
|
283
|
+
t14 = $[48];
|
|
284
|
+
}
|
|
285
|
+
return t14;
|
|
286
|
+
};
|
|
287
|
+
function _temp(permission) {
|
|
288
|
+
return /* @__PURE__ */ jsxDEV(Badge, {
|
|
289
|
+
variant: "outline",
|
|
290
|
+
children: permission
|
|
291
|
+
}, permission, false);
|
|
292
|
+
}
|
|
293
|
+
function _temp2(role) {
|
|
294
|
+
return /* @__PURE__ */ jsxDEV(TableRow, {
|
|
295
|
+
"data-testid": `rls-role-${role.name}`,
|
|
296
|
+
children: [/* @__PURE__ */ jsxDEV(TableCell, {
|
|
297
|
+
className: "font-mono text-xs",
|
|
298
|
+
children: role.name
|
|
299
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
300
|
+
className: "text-muted-foreground",
|
|
301
|
+
children: role.description ?? ""
|
|
302
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
303
|
+
children: role.permissions.length === 0 ? /* @__PURE__ */ jsxDEV("span", {
|
|
304
|
+
"aria-hidden": "true",
|
|
305
|
+
className: "text-muted-foreground",
|
|
306
|
+
children: "—"
|
|
307
|
+
}, void 0, false) : /* @__PURE__ */ jsxDEV("span", {
|
|
308
|
+
className: "flex flex-wrap gap-1",
|
|
309
|
+
children: role.permissions.map(_temp)
|
|
310
|
+
}, void 0, false)
|
|
311
|
+
}, void 0, false)]
|
|
312
|
+
}, role.name, true);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
export { RlsPanel as default };
|