@lunora/studio 1.0.0-alpha.3 → 1.0.0-alpha.30

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 (174) hide show
  1. package/__assets__/package-og.svg +1 -1
  2. package/dist/index.d.ts +29 -18
  3. package/dist/index.js +29 -29
  4. package/dist/mount.d.ts +1 -1
  5. package/dist/mount.js +1 -1
  6. package/dist/{packem_shared/ApiTab-W3no0KOj.js → packem_chunks/ApiTab.js} +5 -5
  7. package/dist/{packem_shared/AuditPanel-Bq4o_IqT.js → packem_chunks/AuditPanel.js} +24 -36
  8. package/dist/{packem_shared/ExportImportPanel-dxY56TDF.js → packem_chunks/ExportImportPanel.js} +13 -9
  9. package/dist/{packem_shared/FileBrowser-Dhy4zES8.js → packem_chunks/FileBrowser.js} +15 -15
  10. package/dist/{packem_shared/FunctionRunner--fQJRPAD.js → packem_chunks/FunctionRunner.js} +10 -10
  11. package/dist/{packem_shared/FunctionStatsPanel-BjRUA_G3.js → packem_chunks/FunctionStatsPanel.js} +147 -204
  12. package/dist/{packem_shared/HealthPanel-PxclMWmA.js → packem_chunks/HealthPanel.js} +37 -29
  13. package/dist/{packem_shared/InsightsPanel-CWS_C-xW.js → packem_chunks/InsightsPanel.js} +107 -69
  14. package/dist/{packem_shared/LogsPanel-CTW8CFcM.js → packem_chunks/LogsPanel.js} +41 -53
  15. package/dist/{packem_shared/MailPanel-BwkvfIHF.js → packem_chunks/MailPanel.js} +37 -44
  16. package/dist/{packem_shared/MetricsPanel-BLuOhZQ4.js → packem_chunks/MetricsPanel.js} +41 -322
  17. package/dist/{packem_shared/MigrationsPanel-DT3lnwHF.js → packem_chunks/MigrationsPanel.js} +39 -46
  18. package/dist/{packem_shared/PitrPanel-CdErL7EJ.js → packem_chunks/PitrPanel.js} +9 -9
  19. package/dist/{packem_shared/SchemaViewer-LJDcmNIO.js → packem_chunks/SchemaViewer.js} +15 -15
  20. package/dist/{packem_shared/SecurityAdvisorPanel-C_ETsPih.js → packem_chunks/SecurityAdvisorPanel.js} +44 -31
  21. package/dist/packem_chunks/SettingsPanel.js +390 -0
  22. package/dist/{packem_shared/sql-editor-panel-BFRpzj6r.js → packem_chunks/SqlEditorPanel.js} +12 -252
  23. package/dist/{packem_shared/TableEditor-ChfUOZec.js → packem_chunks/TableEditor.js} +10 -68
  24. package/dist/packem_chunks/analytics-panel.js +261 -0
  25. package/dist/packem_chunks/auth-config-panel.js +179 -0
  26. package/dist/packem_chunks/auth-sessions-panel.js +175 -0
  27. package/dist/packem_chunks/dashboards-panel.js +779 -0
  28. package/dist/packem_chunks/fanout-panel.js +481 -0
  29. package/dist/packem_chunks/flags-panel.js +176 -0
  30. package/dist/packem_chunks/kv-browser.js +1896 -0
  31. package/dist/packem_chunks/log-drains-panel.js +273 -0
  32. package/dist/packem_chunks/organizations-panel.js +670 -0
  33. package/dist/packem_chunks/payments-panel.js +185 -0
  34. package/dist/packem_chunks/permissions-panel.js +804 -0
  35. package/dist/packem_chunks/queues-panel.js +147 -0
  36. package/dist/packem_chunks/rls-panel.js +313 -0
  37. package/dist/packem_chunks/schedule-panel.js +831 -0
  38. package/dist/packem_chunks/sparkline.js +79 -0
  39. package/dist/packem_chunks/storage-rules-panel.js +138 -0
  40. package/dist/packem_chunks/subscriptions-panel.js +236 -0
  41. package/dist/packem_chunks/users-panel.js +1265 -0
  42. package/dist/packem_chunks/vector-browser.js +281 -0
  43. package/dist/packem_chunks/workflows-panel.js +562 -0
  44. package/dist/packem_shared/{ADMIN_FUNCTIONS-DmBqMZ-z.js → ADMIN_FUNCTIONS-CdaxLGkE.js} +3 -0
  45. package/dist/packem_shared/{ApiDocsPanel-C5-yJ1p7.js → ApiDocsPanel-B6u_wnz-.js} +2 -2
  46. package/dist/packem_shared/{ApiReferencePanel-1vubqG5s.js → ApiReferencePanel-Drz4UO0a.js} +2 -1
  47. package/dist/packem_shared/{CommandPalette-BtgkBzZI.js → CommandPalette-B5BertvU.js} +1 -1
  48. package/dist/packem_shared/{DataBrowser-CtBe1So9.js → DataBrowser-ANTHLWWh.js} +198 -247
  49. package/dist/packem_shared/{GlobalDataBrowser-BTEmGrph.js → GlobalDataBrowser-CjgTG_wa.js} +37 -66
  50. package/dist/packem_shared/HomePanel-c2FodE9t.js +14 -0
  51. package/dist/packem_shared/{OpenRpcReferencePanel-vbcYbv3V.js → OpenRpcReferencePanel-CspFdbUT.js} +2 -1
  52. package/dist/packem_shared/{ScheduledJobs-CabfKbyM.js → ScheduledJobs-BEJXtsBn.js} +163 -60
  53. package/dist/packem_shared/Studio-CVTtA_sB.js +16 -0
  54. package/dist/packem_shared/{StudioApp-CHOZA-z-.js → StudioApp-BSYV2fz6.js} +277 -3
  55. package/dist/packem_shared/{advisor-view-CGcfMiPq.js → advisor-view-DzqyvUU3.js} +1 -1
  56. package/dist/packem_shared/{app.d-CCmwDEVs.d.ts → app.d-B6MyY_al.d.ts} +1 -1
  57. package/dist/packem_shared/{bar-chart-CzJAgqkp.js → bar-chart-Bb__F5-u.js} +1 -1
  58. package/dist/packem_shared/browser-storage-d03UsV7v.js +249 -0
  59. package/dist/packem_shared/{cf-links-2cktDedA.js → cf-links-BZfRdxSE.js} +1 -1
  60. package/dist/packem_shared/{data-grid-B5CaV3wS.js → data-grid-Dsg6nRjo.js} +1 -1
  61. package/dist/packem_shared/data-view-params-Cd6yRVbv.js +96 -0
  62. package/dist/packem_shared/{grid-features-CzUfqgsM.js → grid-features-D7nNzBYm.js} +4 -99
  63. package/dist/packem_shared/{HomePanel-Cw16stjq.js → home-panel-aOR_drVv.js} +833 -469
  64. package/dist/packem_shared/{internal-rXJEAhXS.js → internal-FcNZ3beb.js} +1 -1
  65. package/dist/packem_shared/modal-shell-hyaJvIJ6.js +100 -0
  66. package/dist/packem_shared/{reference-view-B4E49Lip.js → reference-view-Doy1XlQq.js} +4 -44
  67. package/dist/packem_shared/select-UkNYCT3s.js +273 -0
  68. package/dist/packem_shared/skeleton-CGhL0p20.js +45 -0
  69. package/dist/packem_shared/{sparkline-10dG-_f0.js → sparkline-KgMPHS4u.js} +1 -1
  70. package/dist/packem_shared/studio-dMTJ-kRR.js +3987 -0
  71. package/dist/packem_shared/{table-_RzNvy3R.js → table-DsCa9Qp9.js} +1 -1
  72. package/dist/packem_shared/{table-list-sidebar-Bg7uzbvC.js → table-list-sidebar-VMo0ftxD.js} +1 -1
  73. package/dist/packem_shared/use-admin-query-BViPA3US.js +105 -0
  74. package/dist/packem_shared/use-auth-capabilities-BHkoBnbZ.js +32 -0
  75. package/dist/standalone/chunk-2DS7JLWL.js +13 -0
  76. package/dist/standalone/chunk-2K47A3P6.js +1 -0
  77. package/dist/standalone/chunk-2NGUNNGW.js +1 -0
  78. package/dist/standalone/chunk-2PDQ4KZ6.js +1 -0
  79. package/dist/standalone/chunk-3BP4BTLR.js +4 -0
  80. package/dist/standalone/chunk-3OA7PECS.js +6 -0
  81. package/dist/standalone/chunk-4QHKBC77.js +1 -0
  82. package/dist/standalone/chunk-57LYXHXH.js +1 -0
  83. package/dist/standalone/chunk-5NSZVXCS.js +1 -0
  84. package/dist/standalone/chunk-5OIBXYZM.js +1 -0
  85. package/dist/standalone/chunk-63XKJQTQ.js +1 -0
  86. package/dist/standalone/chunk-6RC6L33K.js +4 -0
  87. package/dist/standalone/chunk-6VTGE3WJ.js +1 -0
  88. package/dist/standalone/chunk-7PBZKXYA.js +1 -0
  89. package/dist/standalone/chunk-7POIIWC5.js +3 -0
  90. package/dist/standalone/chunk-7RYIQKZA.js +1 -0
  91. package/dist/standalone/chunk-7TJJXVSE.js +1 -0
  92. package/dist/standalone/chunk-AB6QGMBF.js +1 -0
  93. package/dist/standalone/chunk-AHILM3ZP.js +1 -0
  94. package/dist/standalone/chunk-AQGOX5DK.js +1 -0
  95. package/dist/standalone/chunk-ASLGNHAX.js +1 -0
  96. package/dist/standalone/chunk-BHTPZS7L.js +4 -0
  97. package/dist/standalone/chunk-BJGBHGK3.js +1 -0
  98. package/dist/standalone/chunk-D7HKX4DI.js +1 -0
  99. package/dist/standalone/chunk-DGWTR4G7.js +1 -0
  100. package/dist/standalone/chunk-DSX53PBM.js +1 -0
  101. package/dist/standalone/chunk-DV2MNASX.js +1 -0
  102. package/dist/standalone/chunk-DWDILV2E.js +1 -0
  103. package/dist/standalone/chunk-E7AVZZKO.js +1 -0
  104. package/dist/standalone/chunk-EGJX34WM.js +1 -0
  105. package/dist/standalone/chunk-FCR3HKFV.js +1 -0
  106. package/dist/standalone/chunk-FKO3HO6I.js +4 -0
  107. package/dist/standalone/chunk-FQKNJSRA.js +76 -0
  108. package/dist/standalone/chunk-G2TFEWEQ.js +4 -0
  109. package/dist/standalone/chunk-GABMIICA.js +1 -0
  110. package/dist/standalone/chunk-GTM65MVX.js +1 -0
  111. package/dist/standalone/chunk-GZXPPJVK.js +1 -0
  112. package/dist/standalone/chunk-HFBRE65A.js +1 -0
  113. package/dist/standalone/chunk-HFMQNUBC.js +1 -0
  114. package/dist/standalone/chunk-HG7Q5B3H.js +1 -0
  115. package/dist/standalone/chunk-HTQL7AXU.js +1 -0
  116. package/dist/standalone/chunk-HV7G6DFP.js +5 -0
  117. package/dist/standalone/chunk-ITLLHEVG.js +1 -0
  118. package/dist/standalone/chunk-J6J54MBP.js +1 -0
  119. package/dist/standalone/chunk-JSEXCW5Q.js +1 -0
  120. package/dist/standalone/chunk-KEGAWN6Y.js +1 -0
  121. package/dist/standalone/chunk-KG3QTFWE.js +1 -0
  122. package/dist/standalone/chunk-KGS7KM4A.js +2 -0
  123. package/dist/standalone/chunk-KODWGUAB.js +1 -0
  124. package/dist/standalone/chunk-KZ6INM5M.js +1 -0
  125. package/dist/standalone/chunk-MGFEVTRI.js +1 -0
  126. package/dist/standalone/chunk-N2QDG3MW.js +1 -0
  127. package/dist/standalone/chunk-N4JI6VQD.js +1 -0
  128. package/dist/standalone/chunk-NNISYDNI.js +1 -0
  129. package/dist/standalone/chunk-O4PXDNR3.js +1 -0
  130. package/dist/standalone/chunk-O77VNUFD.js +1 -0
  131. package/dist/standalone/chunk-OD2POGPJ.js +1 -0
  132. package/dist/standalone/chunk-OXCK3ZUG.js +1 -0
  133. package/dist/standalone/chunk-P7DSVO4U.js +1 -0
  134. package/dist/standalone/chunk-PKAM3N5C.js +1 -0
  135. package/dist/standalone/chunk-QGXGBHQO.js +1 -0
  136. package/dist/standalone/chunk-QHA3TAEJ.js +1 -0
  137. package/dist/standalone/chunk-QQWC62X7.js +1 -0
  138. package/dist/standalone/chunk-RMYA7NAH.js +1 -0
  139. package/dist/standalone/chunk-RRCPZMC2.js +22 -0
  140. package/dist/standalone/chunk-S53RUBW5.js +1 -0
  141. package/dist/standalone/chunk-SB4GT6PK.js +1 -0
  142. package/dist/standalone/chunk-SEU5V7I6.js +1 -0
  143. package/dist/standalone/chunk-SHIOUDOT.js +1 -0
  144. package/dist/standalone/chunk-SIDRSX7Y.js +1 -0
  145. package/dist/standalone/chunk-SVR644RF.js +1 -0
  146. package/dist/standalone/chunk-TAD43CG5.js +1 -0
  147. package/dist/standalone/chunk-TBMYIZIO.js +1 -0
  148. package/dist/standalone/chunk-TICVNLPM.js +1 -0
  149. package/dist/standalone/chunk-TQ36RWOP.js +1 -0
  150. package/dist/standalone/chunk-UGMRUEBU.js +1 -0
  151. package/dist/standalone/chunk-UII66UVF.js +1 -0
  152. package/dist/standalone/chunk-VJPQUBN6.js +8 -0
  153. package/dist/standalone/chunk-VLXV72QE.js +1 -0
  154. package/dist/standalone/chunk-VMJKJWG6.js +1 -0
  155. package/dist/standalone/chunk-VPDPN5RR.js +2 -0
  156. package/dist/standalone/chunk-VSEGZA3J.js +1 -0
  157. package/dist/standalone/chunk-VXBZQIGY.js +4 -0
  158. package/dist/standalone/chunk-W7PCVQTE.js +1 -0
  159. package/dist/standalone/chunk-XLILSHPE.js +1 -0
  160. package/dist/standalone/chunk-XURNGQSS.js +1 -0
  161. package/dist/standalone/chunk-YJGANMU7.js +18 -0
  162. package/dist/standalone/chunk-YQQJ4N6U.js +1 -0
  163. package/dist/standalone/chunk-ZH7UES4T.js +2 -0
  164. package/dist/standalone/chunk-ZPUO7FNI.js +1 -0
  165. package/dist/standalone/chunk-ZQCVDXDL.js +1 -0
  166. package/dist/standalone/studio.js +104 -246
  167. package/dist/styles.css +1 -1
  168. package/package.json +13 -12
  169. package/dist/packem_shared/SettingsPanel-C0uLRf5P.js +0 -176
  170. package/dist/packem_shared/SqlEditorPanel-CguV7otm.js +0 -13
  171. package/dist/packem_shared/Studio-DFWAlcuf.js +0 -33
  172. package/dist/packem_shared/studio-Bj8psK1c.js +0 -10303
  173. package/dist/packem_shared/use-live-admin-Dq6g3daN.js +0 -73
  174. package/dist/packem_shared/use-live-shard-seed-Cuk3dnH0.js +0 -76
@@ -0,0 +1,179 @@
1
+ import { c } from 'react/compiler-runtime';
2
+ import { useLunora } from '@lunora/react';
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 { a as useClientQuery } from '../packem_shared/use-admin-query-BViPA3US.js';
6
+ import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
7
+ import { jsxDEV } from 'react/jsx-dev-runtime';
8
+
9
+ const CAPABILITY_ROWS = [{
10
+ key: "accounts",
11
+ label: "Accounts"
12
+ }, {
13
+ key: "admin",
14
+ label: "Admin"
15
+ }, {
16
+ key: "organization",
17
+ label: "Organizations"
18
+ }, {
19
+ key: "passkey",
20
+ label: "Passkeys"
21
+ }, {
22
+ key: "twoFactor",
23
+ label: "Two-factor"
24
+ }];
25
+ const AuthConfigPanel = () => {
26
+ const $ = c(29);
27
+ const client = useLunora();
28
+ const t = useT();
29
+ let t0;
30
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
31
+ t0 = ["lunora-auth-capabilities"];
32
+ $[0] = t0;
33
+ } else {
34
+ t0 = $[0];
35
+ }
36
+ let t1;
37
+ if ($[1] !== client) {
38
+ t1 = () => client.getAuthCapabilities();
39
+ $[1] = client;
40
+ $[2] = t1;
41
+ } else {
42
+ t1 = $[2];
43
+ }
44
+ const {
45
+ data: capabilities,
46
+ error
47
+ } = useClientQuery(t0, t1);
48
+ let t2;
49
+ if ($[3] !== t) {
50
+ t2 = t("Enabled capabilities");
51
+ $[3] = t;
52
+ $[4] = t2;
53
+ } else {
54
+ t2 = $[4];
55
+ }
56
+ let t3;
57
+ if ($[5] !== t2) {
58
+ t3 = /* @__PURE__ */ jsxDEV("header", {
59
+ className: "border-b border-border px-4 py-3",
60
+ children: /* @__PURE__ */ jsxDEV("span", {
61
+ className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
62
+ children: t2
63
+ }, void 0, false)
64
+ }, void 0, false);
65
+ $[5] = t2;
66
+ $[6] = t3;
67
+ } else {
68
+ t3 = $[6];
69
+ }
70
+ let t4;
71
+ if ($[7] !== error) {
72
+ t4 = error !== null && /* @__PURE__ */ jsxDEV("p", {
73
+ className: "px-4 py-8 text-center text-sm text-destructive",
74
+ "data-testid": "auth-config-error",
75
+ role: "alert",
76
+ children: error
77
+ }, void 0, false);
78
+ $[7] = error;
79
+ $[8] = t4;
80
+ } else {
81
+ t4 = $[8];
82
+ }
83
+ let t5;
84
+ if ($[9] !== capabilities || $[10] !== error || $[11] !== t) {
85
+ t5 = error === null && capabilities === void 0 && /* @__PURE__ */ jsxDEV("p", {
86
+ className: "px-4 py-8 text-center text-sm text-muted-foreground",
87
+ "data-testid": "auth-config-loading",
88
+ children: t("Loading auth configuration…")
89
+ }, void 0, false);
90
+ $[9] = capabilities;
91
+ $[10] = error;
92
+ $[11] = t;
93
+ $[12] = t5;
94
+ } else {
95
+ t5 = $[12];
96
+ }
97
+ let t6;
98
+ if ($[13] !== capabilities || $[14] !== error || $[15] !== t) {
99
+ t6 = error === null && capabilities !== void 0 && /* @__PURE__ */ jsxDEV(CardContent, {
100
+ className: "p-3",
101
+ children: /* @__PURE__ */ jsxDEV("ul", {
102
+ className: "grid grid-cols-1 gap-2 sm:grid-cols-2",
103
+ children: CAPABILITY_ROWS.map((row) => {
104
+ const enabled = capabilities[row.key];
105
+ return /* @__PURE__ */ jsxDEV("li", {
106
+ className: "flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs",
107
+ "data-testid": `auth-config-cap-${row.key}`,
108
+ children: [/* @__PURE__ */ jsxDEV("span", {
109
+ className: "text-sm",
110
+ children: t(row.label)
111
+ }, void 0, false), /* @__PURE__ */ jsxDEV(Badge, {
112
+ variant: enabled ? "success" : "outline",
113
+ children: enabled ? t("Enabled") : t("Disabled")
114
+ }, void 0, false)]
115
+ }, row.key, true);
116
+ })
117
+ }, void 0, false)
118
+ }, void 0, false);
119
+ $[13] = capabilities;
120
+ $[14] = error;
121
+ $[15] = t;
122
+ $[16] = t6;
123
+ } else {
124
+ t6 = $[16];
125
+ }
126
+ let t7;
127
+ if ($[17] !== t3 || $[18] !== t4 || $[19] !== t5 || $[20] !== t6) {
128
+ t7 = /* @__PURE__ */ jsxDEV(Card, {
129
+ className: "gap-0 py-0",
130
+ children: [t3, t4, t5, t6]
131
+ }, void 0, true);
132
+ $[17] = t3;
133
+ $[18] = t4;
134
+ $[19] = t5;
135
+ $[20] = t6;
136
+ $[21] = t7;
137
+ } else {
138
+ t7 = $[21];
139
+ }
140
+ let t8;
141
+ if ($[22] !== t) {
142
+ 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.");
143
+ $[22] = t;
144
+ $[23] = t8;
145
+ } else {
146
+ t8 = $[23];
147
+ }
148
+ let t9;
149
+ if ($[24] !== t8) {
150
+ t9 = /* @__PURE__ */ jsxDEV(Card, {
151
+ className: "gap-0 py-0",
152
+ children: /* @__PURE__ */ jsxDEV("p", {
153
+ className: "px-4 py-3 text-xs text-muted-foreground",
154
+ "data-testid": "auth-config-note",
155
+ children: t8
156
+ }, void 0, false)
157
+ }, void 0, false);
158
+ $[24] = t8;
159
+ $[25] = t9;
160
+ } else {
161
+ t9 = $[25];
162
+ }
163
+ let t10;
164
+ if ($[26] !== t7 || $[27] !== t9) {
165
+ t10 = /* @__PURE__ */ jsxDEV("div", {
166
+ className: "flex flex-col gap-4",
167
+ "data-testid": "auth-config",
168
+ children: [t7, t9]
169
+ }, void 0, true);
170
+ $[26] = t7;
171
+ $[27] = t9;
172
+ $[28] = t10;
173
+ } else {
174
+ t10 = $[28];
175
+ }
176
+ return t10;
177
+ };
178
+
179
+ export { AuthConfigPanel };
@@ -0,0 +1,175 @@
1
+ import { c } from 'react/compiler-runtime';
2
+ import { useLunora } from '@lunora/react';
3
+ import { B as Button } from '../packem_shared/button-BhsN2uZH.js';
4
+ import { C as Card, a as CardContent } 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 { a as useClientQuery } from '../packem_shared/use-admin-query-BViPA3US.js';
8
+ import { useAutoRefresh } from '../packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js';
9
+ import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
10
+ import { g as formatTimestamp, f as fireAndForget } from '../packem_shared/internal-FcNZ3beb.js';
11
+ import { jsxDEV } from 'react/jsx-dev-runtime';
12
+
13
+ const SESSION_LIMIT = 200;
14
+ const AuthSessionsPanel = () => {
15
+ const $ = c(21);
16
+ const client = useLunora();
17
+ const t = useT();
18
+ let t0;
19
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
20
+ t0 = ["lunora-auth-sessions", SESSION_LIMIT];
21
+ $[0] = t0;
22
+ } else {
23
+ t0 = $[0];
24
+ }
25
+ let t1;
26
+ if ($[1] !== client) {
27
+ t1 = () => client.listAuthSessions({
28
+ limit: SESSION_LIMIT
29
+ });
30
+ $[1] = client;
31
+ $[2] = t1;
32
+ } else {
33
+ t1 = $[2];
34
+ }
35
+ const sessionsQuery = useClientQuery(t0, t1);
36
+ const {
37
+ error
38
+ } = sessionsQuery;
39
+ const sessions = sessionsQuery.data?.rows ?? null;
40
+ let t2;
41
+ if ($[3] !== sessionsQuery) {
42
+ t2 = () => {
43
+ sessionsQuery.refetch();
44
+ };
45
+ $[3] = sessionsQuery;
46
+ $[4] = t2;
47
+ } else {
48
+ t2 = $[4];
49
+ }
50
+ useAutoRefresh(t2, true);
51
+ let t3;
52
+ if ($[5] !== client || $[6] !== sessionsQuery) {
53
+ t3 = (sessionId) => {
54
+ fireAndForget((async () => {
55
+ await client.revokeAuthSession({
56
+ sessionId
57
+ });
58
+ sessionsQuery.refetch();
59
+ })());
60
+ };
61
+ $[5] = client;
62
+ $[6] = sessionsQuery;
63
+ $[7] = t3;
64
+ } else {
65
+ t3 = $[7];
66
+ }
67
+ const onRevoke = t3;
68
+ let t4;
69
+ if ($[8] !== error) {
70
+ t4 = error !== null && /* @__PURE__ */ jsxDEV("p", {
71
+ className: "text-sm text-destructive",
72
+ "data-testid": "auth-sessions-error",
73
+ role: "alert",
74
+ children: error
75
+ }, void 0, false);
76
+ $[8] = error;
77
+ $[9] = t4;
78
+ } else {
79
+ t4 = $[9];
80
+ }
81
+ let t5;
82
+ if ($[10] !== sessions || $[11] !== t) {
83
+ t5 = sessions !== null && sessions.length === 0 && /* @__PURE__ */ jsxDEV(EmptyState, {
84
+ testId: "auth-sessions-empty",
85
+ title: t("No active sessions.")
86
+ }, void 0, false);
87
+ $[10] = sessions;
88
+ $[11] = t;
89
+ $[12] = t5;
90
+ } else {
91
+ t5 = $[12];
92
+ }
93
+ let t6;
94
+ if ($[13] !== onRevoke || $[14] !== sessions || $[15] !== t) {
95
+ t6 = sessions !== null && sessions.length > 0 && /* @__PURE__ */ jsxDEV(Card, {
96
+ className: "overflow-hidden py-0",
97
+ children: /* @__PURE__ */ jsxDEV(CardContent, {
98
+ className: "px-0",
99
+ children: /* @__PURE__ */ jsxDEV(Table, {
100
+ "data-testid": "auth-sessions-table",
101
+ children: [/* @__PURE__ */ jsxDEV(TableHeader, {
102
+ children: /* @__PURE__ */ jsxDEV(TableRow, {
103
+ children: [/* @__PURE__ */ jsxDEV(TableHead, {
104
+ children: t("user")
105
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
106
+ children: t("expires")
107
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
108
+ children: t("ip")
109
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
110
+ children: t("user agent")
111
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
112
+ children: t("impersonated by")
113
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
114
+ "aria-label": t("Actions")
115
+ }, void 0, false)]
116
+ }, void 0, true)
117
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableBody, {
118
+ children: sessions.map((session) => /* @__PURE__ */ jsxDEV(TableRow, {
119
+ "data-testid": `auth-session-${session.id}`,
120
+ children: [/* @__PURE__ */ jsxDEV(TableCell, {
121
+ className: "font-mono text-xs",
122
+ children: session.userId
123
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
124
+ className: "text-muted-foreground tabular-nums",
125
+ children: formatTimestamp(session.expiresAt)
126
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
127
+ children: session.ipAddress ?? ""
128
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
129
+ className: "max-w-40 truncate",
130
+ children: session.userAgent ?? ""
131
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
132
+ className: "font-mono text-xs",
133
+ children: session.impersonatedBy ?? ""
134
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
135
+ children: /* @__PURE__ */ jsxDEV(Button, {
136
+ "data-testid": `auth-session-revoke-${session.id}`,
137
+ onClick: () => {
138
+ onRevoke(session.id);
139
+ },
140
+ size: "xs",
141
+ type: "button",
142
+ variant: "ghost",
143
+ children: t("Revoke")
144
+ }, void 0, false)
145
+ }, void 0, false)]
146
+ }, session.id, true))
147
+ }, void 0, false)]
148
+ }, void 0, true)
149
+ }, void 0, false)
150
+ }, void 0, false);
151
+ $[13] = onRevoke;
152
+ $[14] = sessions;
153
+ $[15] = t;
154
+ $[16] = t6;
155
+ } else {
156
+ t6 = $[16];
157
+ }
158
+ let t7;
159
+ if ($[17] !== t4 || $[18] !== t5 || $[19] !== t6) {
160
+ t7 = /* @__PURE__ */ jsxDEV("div", {
161
+ className: "flex flex-col gap-4",
162
+ "data-testid": "auth-sessions",
163
+ children: [t4, t5, t6]
164
+ }, void 0, true);
165
+ $[17] = t4;
166
+ $[18] = t5;
167
+ $[19] = t6;
168
+ $[20] = t7;
169
+ } else {
170
+ t7 = $[20];
171
+ }
172
+ return t7;
173
+ };
174
+
175
+ export { AuthSessionsPanel };