@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.
Files changed (187) hide show
  1. package/LICENSE.md +6 -0
  2. package/__assets__/package-og.svg +1 -1
  3. package/dist/index.d.ts +33 -18
  4. package/dist/index.js +29 -29
  5. package/dist/mount.d.ts +1 -1
  6. package/dist/mount.js +3 -2
  7. package/dist/{packem_shared/ApiTab-W3no0KOj.js → packem_chunks/ApiTab.js} +5 -5
  8. package/dist/{packem_shared/AuditPanel-Bq4o_IqT.js → packem_chunks/AuditPanel.js} +29 -41
  9. package/dist/{packem_shared/ExportImportPanel-dxY56TDF.js → packem_chunks/ExportImportPanel.js} +16 -11
  10. package/dist/{packem_shared/FileBrowser-Dhy4zES8.js → packem_chunks/FileBrowser.js} +15 -15
  11. package/dist/{packem_shared/FunctionRunner--fQJRPAD.js → packem_chunks/FunctionRunner.js} +10 -10
  12. package/dist/{packem_shared/FunctionStatsPanel-BjRUA_G3.js → packem_chunks/FunctionStatsPanel.js} +153 -208
  13. package/dist/{packem_shared/HealthPanel-PxclMWmA.js → packem_chunks/HealthPanel.js} +37 -29
  14. package/dist/{packem_shared/InsightsPanel-CWS_C-xW.js → packem_chunks/InsightsPanel.js} +108 -69
  15. package/dist/{packem_shared/LogsPanel-CTW8CFcM.js → packem_chunks/LogsPanel.js} +46 -58
  16. package/dist/{packem_shared/MailPanel-BwkvfIHF.js → packem_chunks/MailPanel.js} +45 -139
  17. package/dist/{packem_shared/MetricsPanel-BLuOhZQ4.js → packem_chunks/MetricsPanel.js} +41 -322
  18. package/dist/{packem_shared/MigrationsPanel-DT3lnwHF.js → packem_chunks/MigrationsPanel.js} +44 -51
  19. package/dist/{packem_shared/PitrPanel-CdErL7EJ.js → packem_chunks/PitrPanel.js} +9 -9
  20. package/dist/{packem_shared/SchemaViewer-LJDcmNIO.js → packem_chunks/SchemaViewer.js} +17 -16
  21. package/dist/{packem_shared/SecurityAdvisorPanel-C_ETsPih.js → packem_chunks/SecurityAdvisorPanel.js} +47 -31
  22. package/dist/packem_chunks/SettingsPanel.js +391 -0
  23. package/dist/{packem_shared/sql-editor-panel-BFRpzj6r.js → packem_chunks/SqlEditorPanel.js} +158 -387
  24. package/dist/{packem_shared/TableEditor-ChfUOZec.js → packem_chunks/TableEditor.js} +10 -68
  25. package/dist/packem_chunks/analytics-panel.js +261 -0
  26. package/dist/packem_chunks/auth-config-panel.js +365 -0
  27. package/dist/packem_chunks/auth-sessions-panel.js +175 -0
  28. package/dist/packem_chunks/containers-panel.js +247 -0
  29. package/dist/packem_chunks/dashboards-panel.js +780 -0
  30. package/dist/packem_chunks/fanout-panel.js +482 -0
  31. package/dist/packem_chunks/flags-panel.js +176 -0
  32. package/dist/packem_chunks/kv-browser.js +1896 -0
  33. package/dist/packem_chunks/log-drains-panel.js +273 -0
  34. package/dist/packem_chunks/organizations-panel.js +3178 -0
  35. package/dist/packem_chunks/payments-panel.js +186 -0
  36. package/dist/packem_chunks/permissions-panel.js +805 -0
  37. package/dist/packem_chunks/queues-panel.js +1075 -0
  38. package/dist/packem_chunks/rls-panel.js +315 -0
  39. package/dist/packem_chunks/schedule-panel.js +831 -0
  40. package/dist/packem_chunks/sparkline.js +79 -0
  41. package/dist/packem_chunks/storage-rules-panel.js +140 -0
  42. package/dist/packem_chunks/subscriptions-panel.js +238 -0
  43. package/dist/packem_chunks/users-panel.js +1731 -0
  44. package/dist/packem_chunks/vector-browser.js +281 -0
  45. package/dist/packem_chunks/workflows-panel.js +562 -0
  46. package/dist/packem_shared/{ADMIN_FUNCTIONS-DmBqMZ-z.js → ADMIN_FUNCTIONS-BHHJi3Gb.js} +7 -0
  47. package/dist/packem_shared/{ApiDocsPanel-C5-yJ1p7.js → ApiDocsPanel-CBma-lnp.js} +2 -2
  48. package/dist/packem_shared/{ApiReferencePanel-1vubqG5s.js → ApiReferencePanel-CQM3pPN7.js} +2 -1
  49. package/dist/packem_shared/{CommandPalette-BtgkBzZI.js → CommandPalette-X2tkbyHk.js} +1 -1
  50. package/dist/packem_shared/{DataBrowser-CtBe1So9.js → DataBrowser-D2ywrdId.js} +198 -247
  51. package/dist/packem_shared/{GlobalDataBrowser-BTEmGrph.js → GlobalDataBrowser-BkTPLzAY.js} +37 -66
  52. package/dist/packem_shared/HomePanel-D1Q9LZgK.js +14 -0
  53. package/dist/packem_shared/{OpenRpcReferencePanel-vbcYbv3V.js → OpenRpcReferencePanel-Dno-hfDb.js} +2 -1
  54. package/dist/packem_shared/{ScheduledJobs-CabfKbyM.js → ScheduledJobs-Ctw4jYtU.js} +163 -60
  55. package/dist/packem_shared/Studio-lJhzDAze.js +16 -0
  56. package/dist/packem_shared/{StudioApp-CHOZA-z-.js → StudioApp-DiMkupvZ.js} +276 -11
  57. package/dist/packem_shared/{advisor-view-CGcfMiPq.js → advisor-view-BX8OhG0w.js} +6 -6
  58. package/dist/packem_shared/alert-CdAET2K_.js +68 -0
  59. package/dist/packem_shared/{app.d-CCmwDEVs.d.ts → app.d-CNLRTrWw.d.ts} +1 -1
  60. package/dist/packem_shared/{bar-chart-CzJAgqkp.js → bar-chart-DSwcWIRy.js} +5 -4
  61. package/dist/packem_shared/browser-storage-BTrX4y3B.js +215 -0
  62. package/dist/packem_shared/{cf-links-2cktDedA.js → cf-links-BZfRdxSE.js} +1 -1
  63. package/dist/packem_shared/{data-grid-B5CaV3wS.js → data-grid-CdXztApG.js} +1 -1
  64. package/dist/packem_shared/data-view-params-Cd6yRVbv.js +96 -0
  65. package/dist/packem_shared/error-alert-CXjqyGw9.js +114 -0
  66. package/dist/packem_shared/{grid-features-CzUfqgsM.js → grid-features-BF-KBDFz.js} +131 -163
  67. package/dist/packem_shared/home-panel-TFcRf9Ui.js +1889 -0
  68. package/dist/packem_shared/{internal-rXJEAhXS.js → internal-CYcbqMjX.js} +44 -3
  69. package/dist/packem_shared/modal-shell-hyaJvIJ6.js +100 -0
  70. package/dist/packem_shared/{reference-view-B4E49Lip.js → reference-view-DUiJcILV.js} +6 -45
  71. package/dist/packem_shared/scroll-area-DLhcy-ml.js +93 -0
  72. package/dist/packem_shared/select-UkNYCT3s.js +273 -0
  73. package/dist/packem_shared/skeleton-CGhL0p20.js +45 -0
  74. package/dist/packem_shared/{sparkline-10dG-_f0.js → sparkline-BnA1kC9X.js} +1 -1
  75. package/dist/packem_shared/studio-Dh9UlaF_.js +4015 -0
  76. package/dist/packem_shared/{table-_RzNvy3R.js → table-DsCa9Qp9.js} +1 -1
  77. package/dist/packem_shared/{table-list-sidebar-Bg7uzbvC.js → table-list-sidebar-UVIXQJdU.js} +1 -1
  78. package/dist/packem_shared/use-admin-query-CfHYWx5n.js +106 -0
  79. package/dist/packem_shared/use-async-submit-DJQiPc-_.js +91 -0
  80. package/dist/standalone/chunk-25AYY4H7.js +2 -0
  81. package/dist/standalone/chunk-2ANAF4ZM.js +1 -0
  82. package/dist/standalone/chunk-2K47A3P6.js +1 -0
  83. package/dist/standalone/chunk-2NGUNNGW.js +1 -0
  84. package/dist/standalone/chunk-3CJW6NWG.js +4 -0
  85. package/dist/standalone/chunk-3OA7PECS.js +6 -0
  86. package/dist/standalone/chunk-3OIHOXVV.js +1 -0
  87. package/dist/standalone/chunk-447TAUFD.js +1 -0
  88. package/dist/standalone/chunk-4QHKBC77.js +1 -0
  89. package/dist/standalone/chunk-5C4TSNE6.js +1 -0
  90. package/dist/standalone/chunk-5OIBXYZM.js +1 -0
  91. package/dist/standalone/chunk-6HSHEMZV.js +76 -0
  92. package/dist/standalone/chunk-6JIZ34MB.js +3 -0
  93. package/dist/standalone/chunk-6VO23MMW.js +4 -0
  94. package/dist/standalone/chunk-7MVSQS7B.js +1 -0
  95. package/dist/standalone/chunk-7TJJXVSE.js +1 -0
  96. package/dist/standalone/chunk-7YXOPTWI.js +1 -0
  97. package/dist/standalone/chunk-AHILM3ZP.js +1 -0
  98. package/dist/standalone/chunk-BGXOXASQ.js +1 -0
  99. package/dist/standalone/chunk-BJGBHGK3.js +1 -0
  100. package/dist/standalone/chunk-BOXSWNXZ.js +1 -0
  101. package/dist/standalone/chunk-BX5MKYOC.js +1 -0
  102. package/dist/standalone/chunk-CKSHCYGC.js +2 -0
  103. package/dist/standalone/chunk-DWDILV2E.js +1 -0
  104. package/dist/standalone/chunk-E75ANNWX.js +19 -0
  105. package/dist/standalone/chunk-EQZQOTJY.js +1 -0
  106. package/dist/standalone/chunk-GTLEWM5Y.js +1 -0
  107. package/dist/standalone/chunk-GTM65MVX.js +1 -0
  108. package/dist/standalone/chunk-GUI5GFFI.js +1 -0
  109. package/dist/standalone/chunk-HN6KJXYQ.js +1 -0
  110. package/dist/standalone/chunk-HV7G6DFP.js +5 -0
  111. package/dist/standalone/chunk-HYDJNCGW.js +1 -0
  112. package/dist/standalone/chunk-HZK5RQHG.js +1 -0
  113. package/dist/standalone/chunk-IN2SYVJB.js +1 -0
  114. package/dist/standalone/chunk-IOANPSJN.js +1 -0
  115. package/dist/standalone/chunk-ISDZPW3V.js +1 -0
  116. package/dist/standalone/chunk-IXDH4GL5.js +1 -0
  117. package/dist/standalone/chunk-J6J54MBP.js +1 -0
  118. package/dist/standalone/chunk-J73VHFCL.js +1 -0
  119. package/dist/standalone/chunk-JHKMUTIF.js +13 -0
  120. package/dist/standalone/chunk-JPRH6DPK.js +1 -0
  121. package/dist/standalone/chunk-JSEXCW5Q.js +1 -0
  122. package/dist/standalone/chunk-KA5YB3VP.js +1 -0
  123. package/dist/standalone/chunk-KBB75WNT.js +1 -0
  124. package/dist/standalone/chunk-KEGAWN6Y.js +1 -0
  125. package/dist/standalone/chunk-KJJ3WM6H.js +4 -0
  126. package/dist/standalone/chunk-KQV4NGH3.js +1 -0
  127. package/dist/standalone/chunk-KSKXW5PX.js +1 -0
  128. package/dist/standalone/chunk-KUH4P5F5.js +1 -0
  129. package/dist/standalone/chunk-KYJPPVGB.js +1 -0
  130. package/dist/standalone/chunk-KZ6INM5M.js +1 -0
  131. package/dist/standalone/chunk-L2TJVSDQ.js +1 -0
  132. package/dist/standalone/chunk-L7SK4ZZD.js +1 -0
  133. package/dist/standalone/chunk-LAK5VSPI.js +1 -0
  134. package/dist/standalone/chunk-LBN7LPVK.js +1 -0
  135. package/dist/standalone/chunk-LNZIB2MD.js +1 -0
  136. package/dist/standalone/chunk-MJWVMKQ4.js +6 -0
  137. package/dist/standalone/chunk-MLZYX5CQ.js +1 -0
  138. package/dist/standalone/chunk-N2X2OO4V.js +1 -0
  139. package/dist/standalone/chunk-NGKITPQP.js +13 -0
  140. package/dist/standalone/chunk-O3NAGRTR.js +1 -0
  141. package/dist/standalone/chunk-OZACQNKG.js +1 -0
  142. package/dist/standalone/chunk-PNDNXS5Z.js +1 -0
  143. package/dist/standalone/chunk-Q7DMUTUE.js +1 -0
  144. package/dist/standalone/chunk-QAFAJBAW.js +1 -0
  145. package/dist/standalone/chunk-QBAT52GB.js +1 -0
  146. package/dist/standalone/chunk-RHZ4M2NZ.js +1 -0
  147. package/dist/standalone/chunk-RRCPZMC2.js +22 -0
  148. package/dist/standalone/chunk-SEU5V7I6.js +1 -0
  149. package/dist/standalone/chunk-TAD43CG5.js +1 -0
  150. package/dist/standalone/chunk-TBMYIZIO.js +1 -0
  151. package/dist/standalone/chunk-TDZ44E5I.js +4 -0
  152. package/dist/standalone/chunk-THNBTMUF.js +1 -0
  153. package/dist/standalone/chunk-TIQISBGK.js +1 -0
  154. package/dist/standalone/chunk-TMYVNQ66.js +1 -0
  155. package/dist/standalone/chunk-TQ36RWOP.js +1 -0
  156. package/dist/standalone/chunk-UGUEC6BC.js +1 -0
  157. package/dist/standalone/chunk-UJB2LEI4.js +4 -0
  158. package/dist/standalone/chunk-UK64ZSUW.js +1 -0
  159. package/dist/standalone/chunk-UKDJ4H7I.js +1 -0
  160. package/dist/standalone/chunk-VLXV72QE.js +1 -0
  161. package/dist/standalone/chunk-VON7JUPG.js +1 -0
  162. package/dist/standalone/chunk-W3JK4YWR.js +1 -0
  163. package/dist/standalone/chunk-W3SHEIAL.js +3 -0
  164. package/dist/standalone/chunk-WI7GWFEG.js +1 -0
  165. package/dist/standalone/chunk-WIHXMNUY.js +1 -0
  166. package/dist/standalone/chunk-WLDVXVI2.js +1 -0
  167. package/dist/standalone/chunk-XLXNLJ4N.js +1 -0
  168. package/dist/standalone/chunk-XNJNSCLM.js +1 -0
  169. package/dist/standalone/chunk-YAECF5LW.js +1 -0
  170. package/dist/standalone/chunk-YBGC4PPD.js +1 -0
  171. package/dist/standalone/chunk-YJAPWSDC.js +4 -0
  172. package/dist/standalone/chunk-ZEJB6DXU.js +8 -0
  173. package/dist/standalone/chunk-ZFNBPAIZ.js +1 -0
  174. package/dist/standalone/chunk-ZHVTQ37P.js +1 -0
  175. package/dist/standalone/chunk-ZIGWVHCS.js +1 -0
  176. package/dist/standalone/chunk-ZPP2KOR4.js +1 -0
  177. package/dist/standalone/chunk-ZPUO7FNI.js +1 -0
  178. package/dist/standalone/studio.js +104 -246
  179. package/dist/styles.css +2 -2
  180. package/package.json +15 -13
  181. package/dist/packem_shared/HomePanel-Cw16stjq.js +0 -1273
  182. package/dist/packem_shared/SettingsPanel-C0uLRf5P.js +0 -176
  183. package/dist/packem_shared/SqlEditorPanel-CguV7otm.js +0 -13
  184. package/dist/packem_shared/Studio-DFWAlcuf.js +0 -33
  185. package/dist/packem_shared/studio-Bj8psK1c.js +0 -10303
  186. package/dist/packem_shared/use-live-admin-Dq6g3daN.js +0 -73
  187. package/dist/packem_shared/use-live-shard-seed-Cuk3dnH0.js +0 -76
@@ -0,0 +1,365 @@
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 { C as Card, a as CardContent } from '../packem_shared/card-DURq3ElK.js';
5
+ import { a as useClientQuery } from '../packem_shared/use-admin-query-CfHYWx5n.js';
6
+ import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
7
+ import { jsxDEV, Fragment } 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 formatDuration = (seconds) => {
26
+ if (seconds === void 0) {
27
+ return "—";
28
+ }
29
+ const units = [[86400, "d"], [3600, "h"], [60, "m"]];
30
+ for (const [size, suffix] of units) {
31
+ if (seconds >= size && seconds % size === 0) {
32
+ return `${String(seconds / size)}${suffix}`;
33
+ }
34
+ }
35
+ return `${String(seconds)}s`;
36
+ };
37
+ const ConfigCard = (t0) => {
38
+ const $ = c(8);
39
+ const {
40
+ children,
41
+ heading,
42
+ testId
43
+ } = t0;
44
+ let t1;
45
+ if ($[0] !== heading) {
46
+ t1 = /* @__PURE__ */ jsxDEV("header", {
47
+ className: "border-b border-border px-4 py-3",
48
+ children: /* @__PURE__ */ jsxDEV("span", {
49
+ className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
50
+ children: heading
51
+ }, void 0, false)
52
+ }, void 0, false);
53
+ $[0] = heading;
54
+ $[1] = t1;
55
+ } else {
56
+ t1 = $[1];
57
+ }
58
+ let t2;
59
+ if ($[2] !== children) {
60
+ t2 = /* @__PURE__ */ jsxDEV(CardContent, {
61
+ className: "p-3",
62
+ children
63
+ }, void 0, false);
64
+ $[2] = children;
65
+ $[3] = t2;
66
+ } else {
67
+ t2 = $[3];
68
+ }
69
+ let t3;
70
+ if ($[4] !== t1 || $[5] !== t2 || $[6] !== testId) {
71
+ t3 = /* @__PURE__ */ jsxDEV(Card, {
72
+ className: "gap-0 py-0",
73
+ "data-testid": testId,
74
+ children: [t1, t2]
75
+ }, void 0, true);
76
+ $[4] = t1;
77
+ $[5] = t2;
78
+ $[6] = testId;
79
+ $[7] = t3;
80
+ } else {
81
+ t3 = $[7];
82
+ }
83
+ return t3;
84
+ };
85
+ const KeyValue = (t0) => {
86
+ const $ = c(7);
87
+ const {
88
+ label,
89
+ value
90
+ } = t0;
91
+ let t1;
92
+ if ($[0] !== label) {
93
+ t1 = /* @__PURE__ */ jsxDEV("span", {
94
+ className: "text-sm",
95
+ children: label
96
+ }, void 0, false);
97
+ $[0] = label;
98
+ $[1] = t1;
99
+ } else {
100
+ t1 = $[1];
101
+ }
102
+ let t2;
103
+ if ($[2] !== value) {
104
+ t2 = /* @__PURE__ */ jsxDEV("span", {
105
+ className: "text-sm text-muted-foreground tabular-nums",
106
+ children: value
107
+ }, void 0, false);
108
+ $[2] = value;
109
+ $[3] = t2;
110
+ } else {
111
+ t2 = $[3];
112
+ }
113
+ let t3;
114
+ if ($[4] !== t1 || $[5] !== t2) {
115
+ t3 = /* @__PURE__ */ jsxDEV("div", {
116
+ className: "flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs",
117
+ children: [t1, t2]
118
+ }, void 0, true);
119
+ $[4] = t1;
120
+ $[5] = t2;
121
+ $[6] = t3;
122
+ } else {
123
+ t3 = $[6];
124
+ }
125
+ return t3;
126
+ };
127
+ const AuthConfigPanel = () => {
128
+ const $ = c(20);
129
+ const client = useLunora();
130
+ const t = useT();
131
+ let t0;
132
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
133
+ t0 = ["lunora-auth-config"];
134
+ $[0] = t0;
135
+ } else {
136
+ t0 = $[0];
137
+ }
138
+ let t1;
139
+ if ($[1] !== client) {
140
+ t1 = () => client.getAuthConfig();
141
+ $[1] = client;
142
+ $[2] = t1;
143
+ } else {
144
+ t1 = $[2];
145
+ }
146
+ const {
147
+ data: config,
148
+ error
149
+ } = useClientQuery(t0, t1);
150
+ let t2;
151
+ if ($[3] !== t) {
152
+ t2 = (on) => /* @__PURE__ */ jsxDEV(Badge, {
153
+ variant: on ? "success" : "outline",
154
+ children: on ? t("Enabled") : t("Disabled")
155
+ }, void 0, false);
156
+ $[3] = t;
157
+ $[4] = t2;
158
+ } else {
159
+ t2 = $[4];
160
+ }
161
+ const statusBadge = t2;
162
+ let t3;
163
+ if ($[5] !== error) {
164
+ t3 = error !== null && /* @__PURE__ */ jsxDEV("p", {
165
+ className: "px-4 py-8 text-center text-sm text-destructive",
166
+ "data-testid": "auth-config-error",
167
+ role: "alert",
168
+ children: error
169
+ }, void 0, false);
170
+ $[5] = error;
171
+ $[6] = t3;
172
+ } else {
173
+ t3 = $[6];
174
+ }
175
+ let t4;
176
+ if ($[7] !== config || $[8] !== error || $[9] !== t) {
177
+ t4 = error === null && config === void 0 && /* @__PURE__ */ jsxDEV("p", {
178
+ className: "px-4 py-8 text-center text-sm text-muted-foreground",
179
+ "data-testid": "auth-config-loading",
180
+ children: t("Loading auth configuration…")
181
+ }, void 0, false);
182
+ $[7] = config;
183
+ $[8] = error;
184
+ $[9] = t;
185
+ $[10] = t4;
186
+ } else {
187
+ t4 = $[10];
188
+ }
189
+ let t5;
190
+ if ($[11] !== config || $[12] !== error || $[13] !== statusBadge || $[14] !== t) {
191
+ t5 = error === null && config !== void 0 && /* @__PURE__ */ jsxDEV(Fragment, {
192
+ children: [/* @__PURE__ */ jsxDEV(ConfigCard, {
193
+ heading: t("Enabled capabilities"),
194
+ testId: "auth-config-capabilities",
195
+ children: /* @__PURE__ */ jsxDEV("ul", {
196
+ className: "grid grid-cols-1 gap-2 sm:grid-cols-2",
197
+ children: CAPABILITY_ROWS.map((row) => {
198
+ const enabled = config.capabilities[row.key];
199
+ return /* @__PURE__ */ jsxDEV("li", {
200
+ className: "flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs",
201
+ "data-testid": `auth-config-cap-${row.key}`,
202
+ children: [/* @__PURE__ */ jsxDEV("span", {
203
+ className: "text-sm",
204
+ children: t(row.label)
205
+ }, void 0, false), statusBadge(enabled)]
206
+ }, row.key, true);
207
+ })
208
+ }, void 0, false)
209
+ }, void 0, false), /* @__PURE__ */ jsxDEV(ConfigCard, {
210
+ heading: t("Plugins"),
211
+ testId: "auth-config-plugins",
212
+ children: config.plugins.length === 0 ? /* @__PURE__ */ jsxDEV("p", {
213
+ className: "text-sm text-muted-foreground",
214
+ children: t("No plugins enabled.")
215
+ }, void 0, false) : /* @__PURE__ */ jsxDEV("div", {
216
+ className: "flex flex-wrap gap-2",
217
+ children: config.plugins.map(_temp)
218
+ }, void 0, false)
219
+ }, void 0, false), /* @__PURE__ */ jsxDEV(ConfigCard, {
220
+ heading: t("Sign-in methods"),
221
+ testId: "auth-config-signin",
222
+ children: /* @__PURE__ */ jsxDEV("div", {
223
+ className: "flex flex-col gap-2",
224
+ children: [/* @__PURE__ */ jsxDEV(KeyValue, {
225
+ label: t("Email & password"),
226
+ value: statusBadge(config.emailAndPassword)
227
+ }, void 0, false), /* @__PURE__ */ jsxDEV(KeyValue, {
228
+ label: t("Social providers"),
229
+ value: config.socialProviders.length === 0 ? t("None") : /* @__PURE__ */ jsxDEV("span", {
230
+ className: "flex flex-wrap justify-end gap-1",
231
+ children: config.socialProviders.map(_temp2)
232
+ }, void 0, false)
233
+ }, void 0, false)]
234
+ }, void 0, true)
235
+ }, void 0, false), config.organization.enabled && /* @__PURE__ */ jsxDEV(ConfigCard, {
236
+ heading: t("Organizations"),
237
+ testId: "auth-config-org",
238
+ children: /* @__PURE__ */ jsxDEV("div", {
239
+ className: "flex flex-col gap-2",
240
+ children: [/* @__PURE__ */ jsxDEV(KeyValue, {
241
+ label: t("Teams"),
242
+ value: statusBadge(config.organization.teams)
243
+ }, void 0, false), /* @__PURE__ */ jsxDEV(KeyValue, {
244
+ label: t("Custom roles"),
245
+ value: statusBadge(config.organization.roles)
246
+ }, void 0, false)]
247
+ }, void 0, true)
248
+ }, void 0, false), /* @__PURE__ */ jsxDEV(ConfigCard, {
249
+ heading: t("Session policy"),
250
+ testId: "auth-config-session",
251
+ children: /* @__PURE__ */ jsxDEV("div", {
252
+ className: "flex flex-col gap-2",
253
+ children: [/* @__PURE__ */ jsxDEV(KeyValue, {
254
+ label: t("Expires in"),
255
+ value: formatDuration(config.session.expiresIn)
256
+ }, void 0, false), /* @__PURE__ */ jsxDEV(KeyValue, {
257
+ label: t("Refresh after"),
258
+ value: formatDuration(config.session.updateAge)
259
+ }, void 0, false), /* @__PURE__ */ jsxDEV(KeyValue, {
260
+ label: t("Fresh window"),
261
+ value: formatDuration(config.session.freshAge)
262
+ }, void 0, false), /* @__PURE__ */ jsxDEV(KeyValue, {
263
+ label: t("Cookie cache"),
264
+ value: statusBadge(config.session.cookieCache === true)
265
+ }, void 0, false)]
266
+ }, void 0, true)
267
+ }, void 0, false), /* @__PURE__ */ jsxDEV(ConfigCard, {
268
+ heading: t("Rate limit"),
269
+ testId: "auth-config-ratelimit",
270
+ children: /* @__PURE__ */ jsxDEV("div", {
271
+ className: "flex flex-col gap-2",
272
+ children: [/* @__PURE__ */ jsxDEV(KeyValue, {
273
+ label: t("Status"),
274
+ value: statusBadge(config.rateLimit.enabled)
275
+ }, void 0, false), config.rateLimit.enabled && /* @__PURE__ */ jsxDEV(Fragment, {
276
+ children: [/* @__PURE__ */ jsxDEV(KeyValue, {
277
+ label: t("Max requests"),
278
+ value: config.rateLimit.max ?? "—"
279
+ }, void 0, false), /* @__PURE__ */ jsxDEV(KeyValue, {
280
+ label: t("Window"),
281
+ value: formatDuration(config.rateLimit.window)
282
+ }, void 0, false)]
283
+ }, void 0, true)]
284
+ }, void 0, true)
285
+ }, void 0, false), config.userFields.length > 0 && /* @__PURE__ */ jsxDEV(ConfigCard, {
286
+ heading: t("Plugin user fields"),
287
+ testId: "auth-config-user-fields",
288
+ children: /* @__PURE__ */ jsxDEV("ul", {
289
+ className: "flex flex-col gap-2",
290
+ children: config.userFields.map((field) => /* @__PURE__ */ jsxDEV("li", {
291
+ className: "flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs",
292
+ "data-testid": `auth-config-user-field-${field.name}`,
293
+ children: [/* @__PURE__ */ jsxDEV("span", {
294
+ className: "flex flex-col",
295
+ children: [/* @__PURE__ */ jsxDEV("span", {
296
+ className: "font-mono text-xs",
297
+ children: field.name
298
+ }, void 0, false), field.plugin !== void 0 && /* @__PURE__ */ jsxDEV("span", {
299
+ className: "text-[11px] text-muted-foreground",
300
+ children: field.plugin
301
+ }, void 0, false)]
302
+ }, void 0, true), /* @__PURE__ */ jsxDEV("span", {
303
+ className: "flex items-center gap-1",
304
+ children: [/* @__PURE__ */ jsxDEV(Badge, {
305
+ variant: "outline",
306
+ children: field.type
307
+ }, void 0, false), field.required && /* @__PURE__ */ jsxDEV(Badge, {
308
+ variant: "secondary",
309
+ children: t("required")
310
+ }, void 0, false), field.unique && /* @__PURE__ */ jsxDEV(Badge, {
311
+ variant: "secondary",
312
+ children: t("unique")
313
+ }, void 0, false)]
314
+ }, void 0, true)]
315
+ }, field.name, true))
316
+ }, void 0, false)
317
+ }, void 0, false), /* @__PURE__ */ jsxDEV(Card, {
318
+ className: "gap-0 py-0",
319
+ children: /* @__PURE__ */ jsxDEV("p", {
320
+ className: "px-4 py-3 text-xs text-muted-foreground",
321
+ "data-testid": "auth-config-note",
322
+ 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.")
323
+ }, void 0, false)
324
+ }, void 0, false)]
325
+ }, void 0, true);
326
+ $[11] = config;
327
+ $[12] = error;
328
+ $[13] = statusBadge;
329
+ $[14] = t;
330
+ $[15] = t5;
331
+ } else {
332
+ t5 = $[15];
333
+ }
334
+ let t6;
335
+ if ($[16] !== t3 || $[17] !== t4 || $[18] !== t5) {
336
+ t6 = /* @__PURE__ */ jsxDEV("div", {
337
+ className: "flex flex-col gap-4",
338
+ "data-testid": "auth-config",
339
+ children: [t3, t4, t5]
340
+ }, void 0, true);
341
+ $[16] = t3;
342
+ $[17] = t4;
343
+ $[18] = t5;
344
+ $[19] = t6;
345
+ } else {
346
+ t6 = $[19];
347
+ }
348
+ return t6;
349
+ };
350
+ function _temp(plugin) {
351
+ return /* @__PURE__ */ jsxDEV(Badge, {
352
+ "data-testid": `auth-config-plugin-${plugin}`,
353
+ variant: "outline",
354
+ children: plugin
355
+ }, plugin, false);
356
+ }
357
+ function _temp2(provider) {
358
+ return /* @__PURE__ */ jsxDEV(Badge, {
359
+ "data-testid": `auth-config-provider-${provider}`,
360
+ variant: "outline",
361
+ children: provider
362
+ }, provider, false);
363
+ }
364
+
365
+ 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-CfHYWx5n.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 { i as formatTimestamp, f as fireAndForget } from '../packem_shared/internal-CYcbqMjX.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 };