@lunora/studio 1.0.0-alpha.35 → 1.0.0-alpha.351

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 (475) hide show
  1. package/LICENSE.md +6 -0
  2. package/README.md +4 -4
  3. package/dist/index.d.mts +1621 -0
  4. package/dist/index.d.ts +1013 -809
  5. package/dist/index.mjs +1 -0
  6. package/dist/mount.d.mts +23 -0
  7. package/dist/mount.d.ts +13 -11
  8. package/dist/mount.mjs +1 -0
  9. package/dist/packem_chunks/AdvisorHealthPanel.mjs +1 -0
  10. package/dist/packem_chunks/ApiTab.mjs +1 -0
  11. package/dist/packem_chunks/AuditPanel.mjs +1 -0
  12. package/dist/packem_chunks/DeploymentHealthPanel.mjs +1 -0
  13. package/dist/packem_chunks/ExportImportPanel.mjs +8 -0
  14. package/dist/packem_chunks/FileBrowser.mjs +4 -0
  15. package/dist/packem_chunks/FunctionRunner.mjs +1 -0
  16. package/dist/packem_chunks/FunctionStatsPanel.mjs +1 -0
  17. package/dist/packem_chunks/HealthPanel.mjs +1 -0
  18. package/dist/packem_chunks/InsightsPanel.mjs +1 -0
  19. package/dist/packem_chunks/LogsPanel.mjs +1 -0
  20. package/dist/packem_chunks/MailPanel.mjs +2 -0
  21. package/dist/packem_chunks/MetricsPanel.mjs +1 -0
  22. package/dist/packem_chunks/NotificationsPanel.mjs +1 -0
  23. package/dist/packem_chunks/PitrPanel.mjs +1 -0
  24. package/dist/packem_chunks/SchemaViewer.mjs +1 -0
  25. package/dist/packem_chunks/SecurityAdvisorPanel.mjs +1 -0
  26. package/dist/packem_chunks/SettingsPanel.mjs +1 -0
  27. package/dist/packem_chunks/SqlEditorPanel.mjs +10 -0
  28. package/dist/packem_chunks/TableEditor.mjs +1 -0
  29. package/dist/packem_chunks/agents-panel.mjs +1 -0
  30. package/dist/packem_chunks/ai-usage-panel.mjs +1 -0
  31. package/dist/packem_chunks/analytics-panel.mjs +1 -0
  32. package/dist/packem_chunks/architecture-panel.mjs +1 -0
  33. package/dist/packem_chunks/auth-audit-panel.mjs +1 -0
  34. package/dist/packem_chunks/auth-config-panel.mjs +1 -0
  35. package/dist/packem_chunks/auth-sessions-panel.mjs +1 -0
  36. package/dist/packem_chunks/containers-panel.mjs +1 -0
  37. package/dist/packem_chunks/dashboards-panel.mjs +1 -0
  38. package/dist/packem_chunks/evals-panel.mjs +1 -0
  39. package/dist/packem_chunks/fanout-panel.mjs +1 -0
  40. package/dist/packem_chunks/flags-panel.mjs +1 -0
  41. package/dist/packem_chunks/issues-panel.mjs +1 -0
  42. package/dist/packem_chunks/kv-browser.mjs +1 -0
  43. package/dist/packem_chunks/log-drains-panel.mjs +4 -0
  44. package/dist/packem_chunks/migrations-route.mjs +1 -0
  45. package/dist/packem_chunks/organizations-panel.mjs +1 -0
  46. package/dist/packem_chunks/payments-panel.mjs +1 -0
  47. package/dist/packem_chunks/permissions-panel.mjs +1 -0
  48. package/dist/packem_chunks/privacy-requests-panel.mjs +1 -0
  49. package/dist/packem_chunks/queues-panel.mjs +1 -0
  50. package/dist/packem_chunks/reactors-panel.mjs +1 -0
  51. package/dist/packem_chunks/rls-panel.mjs +1 -0
  52. package/dist/packem_chunks/schedule-panel.mjs +1 -0
  53. package/dist/packem_chunks/storage-rules-panel.mjs +1 -0
  54. package/dist/packem_chunks/subscriptions-panel.mjs +1 -0
  55. package/dist/packem_chunks/sync-client-panel.mjs +1 -0
  56. package/dist/packem_chunks/theme-indicator.mjs +1 -0
  57. package/dist/packem_chunks/traces-panel.mjs +1 -0
  58. package/dist/packem_chunks/users-panel.mjs +1 -0
  59. package/dist/packem_chunks/vector-browser.mjs +1 -0
  60. package/dist/packem_chunks/workflows-panel.mjs +1 -0
  61. package/dist/packem_shared/ADMIN_FUNCTIONS-4aGsMs95.mjs +1 -0
  62. package/dist/packem_shared/ApiDocsPanel-E4Vr-8zW.mjs +2 -0
  63. package/dist/packem_shared/ApiReferencePanel-u9Rrljdf.mjs +1 -0
  64. package/dist/packem_shared/CommandPalette-5OsK8PNe.mjs +1 -0
  65. package/dist/packem_shared/ConfirmButton-CIXYF6Mg.mjs +1 -0
  66. package/dist/packem_shared/ConnectionBadge-BfcoN-VE.mjs +1 -0
  67. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-CG7Q45ZS.mjs +1 -0
  68. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-D5YMT0gM.mjs +1 -0
  69. package/dist/packem_shared/DEFAULT_LOCALE-BQ3jRT74.mjs +1 -0
  70. package/dist/packem_shared/DataBrowser-C5HbI4TH.mjs +4 -0
  71. package/dist/packem_shared/DataFilters--ocFTVT2.mjs +1 -0
  72. package/dist/packem_shared/ErrorBoundary-BWNF98VF.mjs +1 -0
  73. package/dist/packem_shared/GlobalDataBrowser-D0H2yJSl.mjs +1 -0
  74. package/dist/packem_shared/HomePanel-CcYkDlR-.mjs +1 -0
  75. package/dist/packem_shared/MigrationsPanel-YyCO_T-3.mjs +1 -0
  76. package/dist/packem_shared/OpenRpcReferencePanel-E9cDfHRv.mjs +1 -0
  77. package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.mjs +1 -0
  78. package/dist/packem_shared/ScheduledJobs-D4CUj7aX.mjs +1 -0
  79. package/dist/packem_shared/ShardInput-CoySruKZ.mjs +1 -0
  80. package/dist/packem_shared/Studio-4vJzwwNa.mjs +1 -0
  81. package/dist/packem_shared/StudioApp-px2FMPDS.mjs +1 -0
  82. package/dist/packem_shared/StudioI18nProvider-CGXCPnQn.mjs +1 -0
  83. package/dist/packem_shared/advisor-view-fNcNYW2Q.mjs +1 -0
  84. package/dist/packem_shared/aggregateMetrics-DKFJc-o5.mjs +1 -0
  85. package/dist/packem_shared/alert-PB5W11MM.mjs +1 -0
  86. package/dist/packem_shared/app.d-D425h1XO.d.mts +352 -0
  87. package/dist/packem_shared/app.d-D425h1XO.d.ts +352 -0
  88. package/dist/packem_shared/auth-pager-DW77WeZw.mjs +1 -0
  89. package/dist/packem_shared/badge-r_5B4LHP.mjs +1 -0
  90. package/dist/packem_shared/bar-chart-BCsEIQoQ.mjs +6 -0
  91. package/dist/packem_shared/browser-storage-BH1MxLZs.mjs +1 -0
  92. package/dist/packem_shared/button-q0UYSmrn.mjs +1 -0
  93. package/dist/packem_shared/card-By2O8ULa.mjs +1 -0
  94. package/dist/packem_shared/cf-links-CBJ5SywP.mjs +1 -0
  95. package/dist/packem_shared/checkbox-CnS9cyCz.mjs +1 -0
  96. package/dist/packem_shared/control-button-BOZ5K-FC.mjs +1 -0
  97. package/dist/packem_shared/data-grid-r3isM8Nq.mjs +1 -0
  98. package/dist/packem_shared/data-view-params-C-_G-biH.mjs +1 -0
  99. package/dist/packem_shared/diagram-export-panel-aBDQdX4e.mjs +2 -0
  100. package/dist/packem_shared/dropdown-menu-jLZenfWH.mjs +2 -0
  101. package/dist/packem_shared/empty-state-D7jEML_T.mjs +1 -0
  102. package/dist/packem_shared/error-alert-54TiaMvZ.mjs +1 -0
  103. package/dist/packem_shared/grid-features-2c5SaBtH.mjs +6 -0
  104. package/dist/packem_shared/grid-pagination-DY2erU65.mjs +1 -0
  105. package/dist/packem_shared/home-panel-DPiMVQZ2.mjs +3 -0
  106. package/dist/packem_shared/input-CXhxesPC.mjs +1 -0
  107. package/dist/packem_shared/internal-BXEjuLPN.mjs +2 -0
  108. package/dist/packem_shared/label-DKFzyHq6.mjs +1 -0
  109. package/dist/packem_shared/live-status-D1GasNsH.mjs +1 -0
  110. package/dist/packem_shared/log-fields-BolUoZ9g.mjs +1 -0
  111. package/dist/packem_shared/log-line-BWDt_F56.mjs +1 -0
  112. package/dist/packem_shared/metrics-format-1sNGG47R.mjs +1 -0
  113. package/dist/packem_shared/modal-shell-CDztwLnv.mjs +1 -0
  114. package/dist/packem_shared/operation-console-provider-DoloEvon.mjs +1 -0
  115. package/dist/packem_shared/recording-client-MbGZ28I0.mjs +1 -0
  116. package/dist/packem_shared/reference-view-DCEC5kjY.mjs +13 -0
  117. package/dist/packem_shared/schema-diagram-k7cFl7Wp.mjs +2 -0
  118. package/dist/packem_shared/scroll-area-CXCQH7VT.mjs +2 -0
  119. package/dist/packem_shared/select-DPyS18Vy.mjs +2 -0
  120. package/dist/packem_shared/shard-history-CaO3C4KQ.mjs +1 -0
  121. package/dist/packem_shared/shortcuts-B9gDaXmw.mjs +1 -0
  122. package/dist/packem_shared/skeleton-DX1gfixl.mjs +1 -0
  123. package/dist/packem_shared/sparkline-B_sPPO_8.mjs +1 -0
  124. package/dist/packem_shared/sql-result-table-CatgdmMh.mjs +1 -0
  125. package/dist/packem_shared/stat-card-BAv73QtB.mjs +1 -0
  126. package/dist/packem_shared/storage-tier-C2mKwYRj.mjs +1 -0
  127. package/dist/packem_shared/studio-DIUgH7k0.mjs +2 -0
  128. package/dist/packem_shared/table-D0SBiDu-.mjs +2 -0
  129. package/dist/packem_shared/table-list-sidebar-CCRB_iYz.mjs +1 -0
  130. package/dist/packem_shared/textarea--40GKAyz.mjs +1 -0
  131. package/dist/packem_shared/trace-handoff-BV3EWqy_.mjs +1 -0
  132. package/dist/packem_shared/use-admin-query-BW9IuacC.mjs +1 -0
  133. package/dist/packem_shared/use-admin-spec-BdNLZbTO.mjs +1 -0
  134. package/dist/packem_shared/use-async-submit-2eBBD0-m.mjs +1 -0
  135. package/dist/packem_shared/use-auth-config-KO9tnI39.mjs +1 -0
  136. package/dist/packem_shared/use-mirrored-ref-CVDf2z1M.mjs +1 -0
  137. package/dist/packem_shared/use-open-trace-B_0LbTD7.mjs +1 -0
  138. package/dist/packem_shared/use-shard-key-BsP3o5wT.mjs +1 -0
  139. package/dist/packem_shared/use-sql-assistant-BMVlguKF.mjs +1 -0
  140. package/dist/packem_shared/use-studio-client-DCA50tF2.mjs +1 -0
  141. package/dist/packem_shared/useDebounced-DVeQ5-oW.mjs +1 -0
  142. package/dist/packem_shared/utils-bhneXptQ.mjs +1 -0
  143. package/dist/packem_shared/virtual-rect-D_j7aLxX.mjs +1 -0
  144. package/dist/standalone/chunk-22O2JDWR.js +1 -0
  145. package/dist/standalone/chunk-2DV455PX.js +1 -0
  146. package/dist/standalone/chunk-2EMNPL3B.js +1 -0
  147. package/dist/standalone/chunk-2O6KKVH2.js +1 -0
  148. package/dist/standalone/chunk-35BGGOWV.js +1 -0
  149. package/dist/standalone/chunk-3GXPALXG.js +1 -0
  150. package/dist/standalone/chunk-3MQ477EE.js +1 -0
  151. package/dist/standalone/chunk-3Y5K3IQO.js +1 -0
  152. package/dist/standalone/chunk-453GHHZ4.js +1 -0
  153. package/dist/standalone/chunk-4C4THJUD.js +1 -0
  154. package/dist/standalone/chunk-4CITH2NU.js +1 -0
  155. package/dist/standalone/chunk-4EDOPHLM.js +5 -0
  156. package/dist/standalone/chunk-4IEMXFUB.js +1 -0
  157. package/dist/standalone/chunk-4QRVJDM4.js +1 -0
  158. package/dist/standalone/chunk-4SQBAPY6.js +1 -0
  159. package/dist/standalone/chunk-4UWYDYM5.js +1 -0
  160. package/dist/standalone/chunk-57ZNR6IA.js +1 -0
  161. package/dist/standalone/chunk-5DNGK3NT.js +1 -0
  162. package/dist/standalone/chunk-6DYXTEU7.js +1 -0
  163. package/dist/standalone/chunk-6GPEHYCG.js +1 -0
  164. package/dist/standalone/chunk-6GRI2HXU.js +1 -0
  165. package/dist/standalone/chunk-6I42AM75.js +1 -0
  166. package/dist/standalone/chunk-6M7FLLMT.js +1 -0
  167. package/dist/standalone/chunk-6QBK3Z7A.js +1 -0
  168. package/dist/standalone/chunk-6QEXGYWH.js +1 -0
  169. package/dist/standalone/chunk-6UTZXEW3.js +1 -0
  170. package/dist/standalone/chunk-7EAHHRJR.js +1 -0
  171. package/dist/standalone/chunk-7RGYCU6F.js +1 -0
  172. package/dist/standalone/chunk-A566HCBX.js +1 -0
  173. package/dist/standalone/chunk-ACNWZIAH.js +15 -0
  174. package/dist/standalone/chunk-ANACHJRU.js +1 -0
  175. package/dist/standalone/chunk-AOHKAKKL.js +1 -0
  176. package/dist/standalone/chunk-AP4PC2M4.js +1 -0
  177. package/dist/standalone/chunk-BAGJYLSU.js +8 -0
  178. package/dist/standalone/chunk-BCOOULSO.js +1 -0
  179. package/dist/standalone/chunk-BKH2NALB.js +1 -0
  180. package/dist/standalone/chunk-BTOOJXUL.js +59 -0
  181. package/dist/standalone/chunk-C6FNBKCO.js +1 -0
  182. package/dist/standalone/chunk-CTE6RPXC.js +1 -0
  183. package/dist/standalone/chunk-CW57Q264.js +1 -0
  184. package/dist/standalone/chunk-DBVJ5VLI.js +1 -0
  185. package/dist/standalone/chunk-DS7HZKZ2.js +6 -0
  186. package/dist/standalone/chunk-DSTNWB4N.js +1 -0
  187. package/dist/standalone/chunk-DTW4E5AB.js +1 -0
  188. package/dist/standalone/chunk-DX55P3KZ.js +1 -0
  189. package/dist/standalone/chunk-E26OT26O.js +1 -0
  190. package/dist/standalone/chunk-FLVDICZL.js +1 -0
  191. package/dist/standalone/chunk-FNWRS4VQ.js +1 -0
  192. package/dist/standalone/chunk-FST24UXA.js +1 -0
  193. package/dist/standalone/chunk-FXGYX2V6.js +1 -0
  194. package/dist/standalone/chunk-HKLF627N.js +1 -0
  195. package/dist/standalone/chunk-HKPDPKXD.js +1 -0
  196. package/dist/standalone/chunk-HWTX54JM.js +8 -0
  197. package/dist/standalone/chunk-HZCLLEWP.js +1 -0
  198. package/dist/standalone/chunk-IBJVVHV5.js +1 -0
  199. package/dist/standalone/chunk-IH2CJZF2.js +1 -0
  200. package/dist/standalone/chunk-IRCUXARN.js +1 -0
  201. package/dist/standalone/chunk-IVQKQBKK.js +1 -0
  202. package/dist/standalone/chunk-JTGGWF7R.js +1 -0
  203. package/dist/standalone/chunk-K7FZTYAY.js +1 -0
  204. package/dist/standalone/chunk-KNX3KB7E.js +1 -0
  205. package/dist/standalone/chunk-KRPXOSBL.js +1 -0
  206. package/dist/standalone/chunk-KYONGQQ4.js +1 -0
  207. package/dist/standalone/chunk-LIGOLZND.js +1 -0
  208. package/dist/standalone/chunk-LKCO3E2B.js +1 -0
  209. package/dist/standalone/chunk-LPINY2IJ.js +19 -0
  210. package/dist/standalone/chunk-LRXCL6IA.js +1 -0
  211. package/dist/standalone/chunk-LUHXNZI4.js +2 -0
  212. package/dist/standalone/chunk-LYHEBMM6.js +1 -0
  213. package/dist/standalone/chunk-M2RIGPGL.js +1 -0
  214. package/dist/standalone/chunk-MD67S53Z.js +1 -0
  215. package/dist/standalone/chunk-MDAXV2XH.js +4 -0
  216. package/dist/standalone/chunk-MKVZXGJQ.js +1 -0
  217. package/dist/standalone/chunk-NGVP66OH.js +1 -0
  218. package/dist/standalone/chunk-NMVFSJM7.js +1 -0
  219. package/dist/standalone/chunk-OIDFWEJX.js +21 -0
  220. package/dist/standalone/chunk-OJG65AG4.js +1 -0
  221. package/dist/standalone/chunk-OSJ7HV7B.js +1 -0
  222. package/dist/standalone/chunk-OUFWXYEF.js +1 -0
  223. package/dist/standalone/chunk-OXFKZ4BM.js +1 -0
  224. package/dist/standalone/chunk-P6L6ABWO.js +1 -0
  225. package/dist/standalone/chunk-PZZWUL5U.js +1 -0
  226. package/dist/standalone/chunk-Q4N3TJPV.js +1 -0
  227. package/dist/standalone/chunk-QEVFVWGC.js +2 -0
  228. package/dist/standalone/chunk-R36QXQZX.js +1 -0
  229. package/dist/standalone/chunk-RHOQJNDW.js +1 -0
  230. package/dist/standalone/chunk-RQDSPVVH.js +1 -0
  231. package/dist/standalone/chunk-S5S2YICJ.js +1 -0
  232. package/dist/standalone/chunk-S6JFSLBK.js +1 -0
  233. package/dist/standalone/chunk-SDQH4HR6.js +3 -0
  234. package/dist/standalone/chunk-SDTHCM5H.js +1 -0
  235. package/dist/standalone/chunk-SFY646MC.js +1 -0
  236. package/dist/standalone/chunk-SJLEEYCR.js +1 -0
  237. package/dist/standalone/chunk-SLIDAWNX.js +1 -0
  238. package/dist/standalone/chunk-SM2IQWCJ.js +1 -0
  239. package/dist/standalone/{chunk-BJGBHGK3.js → chunk-SYGCASPT.js} +1 -1
  240. package/dist/standalone/chunk-T2QAOXUO.js +14 -0
  241. package/dist/standalone/chunk-T4VAXHRL.js +4 -0
  242. package/dist/standalone/chunk-TBDJVYCB.js +1 -0
  243. package/dist/standalone/chunk-TDVDZ7XQ.js +1 -0
  244. package/dist/standalone/chunk-TRZTGE4R.js +1 -0
  245. package/dist/standalone/chunk-TTD7BKB6.js +1 -0
  246. package/dist/standalone/chunk-UCK6ITED.js +1 -0
  247. package/dist/standalone/chunk-UKKZJRJT.js +1 -0
  248. package/dist/standalone/chunk-UYEZR3BI.js +1 -0
  249. package/dist/standalone/chunk-V74BXQXC.js +1 -0
  250. package/dist/standalone/chunk-VEWQWS3J.js +1 -0
  251. package/dist/standalone/chunk-VHMA6YPT.js +1 -0
  252. package/dist/standalone/chunk-W2BCSK5S.js +1 -0
  253. package/dist/standalone/chunk-W4X4J7BU.js +1 -0
  254. package/dist/standalone/chunk-W6ZKEW5M.js +1 -0
  255. package/dist/standalone/chunk-W7MRISE3.js +1 -0
  256. package/dist/standalone/chunk-WIYDA4XT.js +1 -0
  257. package/dist/standalone/chunk-WS36BO4R.js +1 -0
  258. package/dist/standalone/chunk-WZTY3ZYI.js +1 -0
  259. package/dist/standalone/chunk-X5KWBDTF.js +1 -0
  260. package/dist/standalone/chunk-X74GEPSG.js +1 -0
  261. package/dist/standalone/chunk-X7GSROPX.js +1 -0
  262. package/dist/standalone/chunk-XBZUJDHD.js +1 -0
  263. package/dist/standalone/chunk-XYR5NST4.js +1 -0
  264. package/dist/standalone/chunk-Y7SN6CTX.js +1 -0
  265. package/dist/standalone/chunk-YHTHRYP5.js +1 -0
  266. package/dist/standalone/chunk-YJWR6ZWC.js +1 -0
  267. package/dist/standalone/chunk-YRQHFMEY.js +1 -0
  268. package/dist/standalone/chunk-Z5EV64KS.js +1 -0
  269. package/dist/standalone/chunk-ZBON5T5A.js +1 -0
  270. package/dist/standalone/chunk-ZGSL4DPP.js +1 -0
  271. package/dist/standalone/chunk-ZKPRORLI.js +1 -0
  272. package/dist/standalone/chunk-ZLSNET6H.js +1 -0
  273. package/dist/standalone/chunk-ZM4K2ETZ.js +3 -0
  274. package/dist/standalone/chunk-ZTOREMGH.js +1 -0
  275. package/dist/standalone/chunk-ZWDORIZY.js +1 -0
  276. package/dist/standalone/studio.js +9 -214
  277. package/dist/styles.css +2 -2
  278. package/package.json +26 -22
  279. package/dist/index.js +0 -41
  280. package/dist/mount.js +0 -27
  281. package/dist/packem_chunks/ApiTab.js +0 -251
  282. package/dist/packem_chunks/AuditPanel.js +0 -200
  283. package/dist/packem_chunks/ExportImportPanel.js +0 -198
  284. package/dist/packem_chunks/FileBrowser.js +0 -2932
  285. package/dist/packem_chunks/FunctionRunner.js +0 -343
  286. package/dist/packem_chunks/FunctionStatsPanel.js +0 -377
  287. package/dist/packem_chunks/HealthPanel.js +0 -648
  288. package/dist/packem_chunks/InsightsPanel.js +0 -462
  289. package/dist/packem_chunks/LogsPanel.js +0 -827
  290. package/dist/packem_chunks/MailPanel.js +0 -353
  291. package/dist/packem_chunks/MetricsPanel.js +0 -1344
  292. package/dist/packem_chunks/MigrationsPanel.js +0 -239
  293. package/dist/packem_chunks/PitrPanel.js +0 -252
  294. package/dist/packem_chunks/SchemaViewer.js +0 -2513
  295. package/dist/packem_chunks/SecurityAdvisorPanel.js +0 -95
  296. package/dist/packem_chunks/SettingsPanel.js +0 -391
  297. package/dist/packem_chunks/SqlEditorPanel.js +0 -2323
  298. package/dist/packem_chunks/TableEditor.js +0 -313
  299. package/dist/packem_chunks/analytics-panel.js +0 -261
  300. package/dist/packem_chunks/auth-config-panel.js +0 -179
  301. package/dist/packem_chunks/auth-sessions-panel.js +0 -175
  302. package/dist/packem_chunks/containers-panel.js +0 -247
  303. package/dist/packem_chunks/dashboards-panel.js +0 -780
  304. package/dist/packem_chunks/fanout-panel.js +0 -482
  305. package/dist/packem_chunks/flags-panel.js +0 -176
  306. package/dist/packem_chunks/kv-browser.js +0 -1896
  307. package/dist/packem_chunks/log-drains-panel.js +0 -273
  308. package/dist/packem_chunks/organizations-panel.js +0 -670
  309. package/dist/packem_chunks/payments-panel.js +0 -186
  310. package/dist/packem_chunks/permissions-panel.js +0 -805
  311. package/dist/packem_chunks/queues-panel.js +0 -1052
  312. package/dist/packem_chunks/rls-panel.js +0 -315
  313. package/dist/packem_chunks/schedule-panel.js +0 -831
  314. package/dist/packem_chunks/sparkline.js +0 -79
  315. package/dist/packem_chunks/storage-rules-panel.js +0 -140
  316. package/dist/packem_chunks/subscriptions-panel.js +0 -238
  317. package/dist/packem_chunks/users-panel.js +0 -1265
  318. package/dist/packem_chunks/vector-browser.js +0 -281
  319. package/dist/packem_chunks/workflows-panel.js +0 -562
  320. package/dist/packem_shared/ADMIN_FUNCTIONS-BHHJi3Gb.js +0 -52
  321. package/dist/packem_shared/ApiDocsPanel-D4CJf2ad.js +0 -842
  322. package/dist/packem_shared/ApiReferencePanel-Co_wpRF2.js +0 -230
  323. package/dist/packem_shared/CommandPalette-BUPpbpMc.js +0 -373
  324. package/dist/packem_shared/ConfirmButton-C2eVi2Qv.js +0 -59
  325. package/dist/packem_shared/ConnectionBadge-B2DDM2Tn.js +0 -111
  326. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js +0 -50
  327. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js +0 -89
  328. package/dist/packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js +0 -27
  329. package/dist/packem_shared/DataBrowser-BeVNxSVm.js +0 -4493
  330. package/dist/packem_shared/DataFilters-FNquMaiu.js +0 -249
  331. package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +0 -66
  332. package/dist/packem_shared/GlobalDataBrowser-ErfvIs1S.js +0 -289
  333. package/dist/packem_shared/HomePanel-D9MQk8I7.js +0 -14
  334. package/dist/packem_shared/OpenRpcReferencePanel-DLWzrIx9.js +0 -192
  335. package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
  336. package/dist/packem_shared/ScheduledJobs-ClaNpZsg.js +0 -262
  337. package/dist/packem_shared/ShardInput-gx_DZXXn.js +0 -107
  338. package/dist/packem_shared/Studio-C48P1K5W.js +0 -16
  339. package/dist/packem_shared/StudioApp-Cqh-SYm2.js +0 -657
  340. package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
  341. package/dist/packem_shared/advisor-view-D3-U4kRR.js +0 -159
  342. package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +0 -108
  343. package/dist/packem_shared/alert-CdAET2K_.js +0 -68
  344. package/dist/packem_shared/app.d-CNLRTrWw.d.ts +0 -300
  345. package/dist/packem_shared/badge-B2PKA1-5.js +0 -49
  346. package/dist/packem_shared/bar-chart-DSwcWIRy.js +0 -3246
  347. package/dist/packem_shared/browser-storage-tLOxkIHd.js +0 -185
  348. package/dist/packem_shared/button-BhsN2uZH.js +0 -49
  349. package/dist/packem_shared/card-DURq3ElK.js +0 -175
  350. package/dist/packem_shared/cf-links-BZfRdxSE.js +0 -8
  351. package/dist/packem_shared/checkbox-UNkzAxl-.js +0 -63
  352. package/dist/packem_shared/data-grid-Jz8FqQ2C.js +0 -183
  353. package/dist/packem_shared/data-view-params-Cd6yRVbv.js +0 -96
  354. package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +0 -280
  355. package/dist/packem_shared/empty-state-DY_oe0k6.js +0 -98
  356. package/dist/packem_shared/error-alert-BBT6D22d.js +0 -114
  357. package/dist/packem_shared/grid-features-CUr8Z1_O.js +0 -745
  358. package/dist/packem_shared/home-panel-CoGxi-oj.js +0 -1639
  359. package/dist/packem_shared/input-XH4r1Pt1.js +0 -53
  360. package/dist/packem_shared/internal-DTsYVn-g.js +0 -97
  361. package/dist/packem_shared/label-D8ykjn5J.js +0 -46
  362. package/dist/packem_shared/live-status-FZ0psC1z.js +0 -44
  363. package/dist/packem_shared/modal-shell-hyaJvIJ6.js +0 -100
  364. package/dist/packem_shared/reference-view-CSKyUyPl.js +0 -2141
  365. package/dist/packem_shared/scroll-area-DLhcy-ml.js +0 -93
  366. package/dist/packem_shared/select-UkNYCT3s.js +0 -273
  367. package/dist/packem_shared/shard-history-DyebH1R5.js +0 -38
  368. package/dist/packem_shared/skeleton-CGhL0p20.js +0 -45
  369. package/dist/packem_shared/sparkline-BnA1kC9X.js +0 -93
  370. package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
  371. package/dist/packem_shared/studio-CPHA_-3I.js +0 -4015
  372. package/dist/packem_shared/table-DsCa9Qp9.js +0 -246
  373. package/dist/packem_shared/table-list-sidebar-B5psdSV1.js +0 -832
  374. package/dist/packem_shared/textarea-D3gaCU_-.js +0 -46
  375. package/dist/packem_shared/use-admin-query-BHPKmPuj.js +0 -106
  376. package/dist/packem_shared/use-auth-capabilities-C-VH0oJJ.js +0 -32
  377. package/dist/packem_shared/useDebounced-Dxncpg6z.js +0 -32
  378. package/dist/packem_shared/utils-B05Dmz_H.js +0 -8
  379. package/dist/packem_shared/virtual-rect-CVMUskSm.js +0 -10
  380. package/dist/standalone/chunk-25VHPD2I.js +0 -1
  381. package/dist/standalone/chunk-2GGMGPEP.js +0 -1
  382. package/dist/standalone/chunk-2K47A3P6.js +0 -1
  383. package/dist/standalone/chunk-2NGUNNGW.js +0 -1
  384. package/dist/standalone/chunk-3CJW6NWG.js +0 -4
  385. package/dist/standalone/chunk-3OA7PECS.js +0 -6
  386. package/dist/standalone/chunk-46K3NKPA.js +0 -1
  387. package/dist/standalone/chunk-474C2O7W.js +0 -1
  388. package/dist/standalone/chunk-4H2OJBXO.js +0 -1
  389. package/dist/standalone/chunk-4QHKBC77.js +0 -1
  390. package/dist/standalone/chunk-55YA7ZZI.js +0 -76
  391. package/dist/standalone/chunk-5OH3VPZF.js +0 -1
  392. package/dist/standalone/chunk-5OIBXYZM.js +0 -1
  393. package/dist/standalone/chunk-6GFEVKJP.js +0 -1
  394. package/dist/standalone/chunk-6UGM5IHN.js +0 -4
  395. package/dist/standalone/chunk-6WRZP62V.js +0 -1
  396. package/dist/standalone/chunk-764T6X6X.js +0 -1
  397. package/dist/standalone/chunk-7TJJXVSE.js +0 -1
  398. package/dist/standalone/chunk-7VF3IAAW.js +0 -2
  399. package/dist/standalone/chunk-7WNJ4Q7Z.js +0 -8
  400. package/dist/standalone/chunk-AHILM3ZP.js +0 -1
  401. package/dist/standalone/chunk-AJIUI7DD.js +0 -1
  402. package/dist/standalone/chunk-BACPICH6.js +0 -1
  403. package/dist/standalone/chunk-BI35RXKQ.js +0 -1
  404. package/dist/standalone/chunk-BOXSWNXZ.js +0 -1
  405. package/dist/standalone/chunk-BQUQS7QN.js +0 -1
  406. package/dist/standalone/chunk-CKSHCYGC.js +0 -2
  407. package/dist/standalone/chunk-DORBUITF.js +0 -1
  408. package/dist/standalone/chunk-DVC6YWVP.js +0 -1
  409. package/dist/standalone/chunk-DVKPRFIJ.js +0 -1
  410. package/dist/standalone/chunk-DWDILV2E.js +0 -1
  411. package/dist/standalone/chunk-DWTBY343.js +0 -1
  412. package/dist/standalone/chunk-EIQW6ACH.js +0 -1
  413. package/dist/standalone/chunk-EUIHTPKI.js +0 -1
  414. package/dist/standalone/chunk-FCSPAJW4.js +0 -1
  415. package/dist/standalone/chunk-FKO3HO6I.js +0 -4
  416. package/dist/standalone/chunk-GMSGZDDH.js +0 -13
  417. package/dist/standalone/chunk-GTM65MVX.js +0 -1
  418. package/dist/standalone/chunk-HV7G6DFP.js +0 -5
  419. package/dist/standalone/chunk-ILCTSAOB.js +0 -1
  420. package/dist/standalone/chunk-IODYGARQ.js +0 -1
  421. package/dist/standalone/chunk-J6J54MBP.js +0 -1
  422. package/dist/standalone/chunk-JE2YOAB7.js +0 -4
  423. package/dist/standalone/chunk-JFSZIUZT.js +0 -4
  424. package/dist/standalone/chunk-JSEXCW5Q.js +0 -1
  425. package/dist/standalone/chunk-K3GNLVYK.js +0 -1
  426. package/dist/standalone/chunk-KEGAWN6Y.js +0 -1
  427. package/dist/standalone/chunk-KZ6INM5M.js +0 -1
  428. package/dist/standalone/chunk-LD2R263D.js +0 -1
  429. package/dist/standalone/chunk-LI43EKM6.js +0 -1
  430. package/dist/standalone/chunk-M55U7NHO.js +0 -1
  431. package/dist/standalone/chunk-MPTM7ZU3.js +0 -3
  432. package/dist/standalone/chunk-MPYFGAOW.js +0 -1
  433. package/dist/standalone/chunk-NJFMWO6P.js +0 -1
  434. package/dist/standalone/chunk-O3NAGRTR.js +0 -1
  435. package/dist/standalone/chunk-O77VNUFD.js +0 -1
  436. package/dist/standalone/chunk-OCHNCAXJ.js +0 -1
  437. package/dist/standalone/chunk-PACH5AHG.js +0 -1
  438. package/dist/standalone/chunk-PN5NCZDX.js +0 -1
  439. package/dist/standalone/chunk-PVZI3CXP.js +0 -19
  440. package/dist/standalone/chunk-PZ7HD5T2.js +0 -1
  441. package/dist/standalone/chunk-QAFAJBAW.js +0 -1
  442. package/dist/standalone/chunk-QBAT52GB.js +0 -1
  443. package/dist/standalone/chunk-QLM6FYZW.js +0 -2
  444. package/dist/standalone/chunk-RRAFQ5G2.js +0 -1
  445. package/dist/standalone/chunk-RRCPZMC2.js +0 -22
  446. package/dist/standalone/chunk-RSEEHNFI.js +0 -1
  447. package/dist/standalone/chunk-SEU5V7I6.js +0 -1
  448. package/dist/standalone/chunk-SLKF2L74.js +0 -1
  449. package/dist/standalone/chunk-SVR644RF.js +0 -1
  450. package/dist/standalone/chunk-TAD43CG5.js +0 -1
  451. package/dist/standalone/chunk-TBMYIZIO.js +0 -1
  452. package/dist/standalone/chunk-TDL7NEWA.js +0 -1
  453. package/dist/standalone/chunk-TO4JQX7W.js +0 -1
  454. package/dist/standalone/chunk-TQ36RWOP.js +0 -1
  455. package/dist/standalone/chunk-U4OAQPBT.js +0 -1
  456. package/dist/standalone/chunk-UII66UVF.js +0 -1
  457. package/dist/standalone/chunk-UK64ZSUW.js +0 -1
  458. package/dist/standalone/chunk-VLXV72QE.js +0 -1
  459. package/dist/standalone/chunk-VSHUSN6T.js +0 -1
  460. package/dist/standalone/chunk-VTGBPW24.js +0 -1
  461. package/dist/standalone/chunk-WXPWVBIY.js +0 -1
  462. package/dist/standalone/chunk-X6F22DBL.js +0 -1
  463. package/dist/standalone/chunk-X7MMBSNW.js +0 -1
  464. package/dist/standalone/chunk-XGMIDFUK.js +0 -1
  465. package/dist/standalone/chunk-XNJNSCLM.js +0 -1
  466. package/dist/standalone/chunk-XUGSA2NG.js +0 -1
  467. package/dist/standalone/chunk-XZE2RNDA.js +0 -1
  468. package/dist/standalone/chunk-Y2ZPNDL7.js +0 -4
  469. package/dist/standalone/chunk-YAECF5LW.js +0 -1
  470. package/dist/standalone/chunk-YEVCU7TB.js +0 -13
  471. package/dist/standalone/chunk-YV43BOP7.js +0 -1
  472. package/dist/standalone/chunk-ZHVTQ37P.js +0 -1
  473. package/dist/standalone/chunk-ZPP2KOR4.js +0 -1
  474. package/dist/standalone/chunk-ZPUO7FNI.js +0 -1
  475. package/dist/standalone/chunk-ZU4DZ6NK.js +0 -1
@@ -1,805 +0,0 @@
1
- import { useState, useRef, useEffect } from 'react';
2
- import { C as Card, b as CardHeader, c as CardTitle, d as CardDescription, a as CardContent } from '../packem_shared/card-DURq3ElK.js';
3
- import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
4
- import { c } from 'react/compiler-runtime';
5
- import { E as ErrorAlert } from '../packem_shared/error-alert-BBT6D22d.js';
6
- import { L as LiveError } from '../packem_shared/live-status-FZ0psC1z.js';
7
- import { B as Badge } from '../packem_shared/badge-B2PKA1-5.js';
8
- import { B as Button } from '../packem_shared/button-BhsN2uZH.js';
9
- import { E as EmptyState } from '../packem_shared/empty-state-DY_oe0k6.js';
10
- 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';
11
- import { u as useAdminQuery } from '../packem_shared/use-admin-query-BHPKmPuj.js';
12
- import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-BHHJi3Gb.js';
13
- import { jsxDEV } from 'react/jsx-dev-runtime';
14
- import { useLunora } from '@lunora/react';
15
- import { ShardInput } from '../packem_shared/ShardInput-gx_DZXXn.js';
16
- import { I as Input } from '../packem_shared/input-XH4r1Pt1.js';
17
- import { L as Label } from '../packem_shared/label-D8ykjn5J.js';
18
- import { T as Textarea } from '../packem_shared/textarea-D3gaCU_-.js';
19
- import { c as callOptions, a as adminRef, e as errorMessage, f as fireAndForget } from '../packem_shared/internal-DTsYVn-g.js';
20
-
21
- const OPERATIONS = ["read", "insert", "update", "delete"];
22
- const operationLabel = (t, operation) => ({
23
- delete: t("Delete"),
24
- insert: t("Insert"),
25
- read: t("Read"),
26
- update: t("Update")
27
- })[operation];
28
- const uncoveredTables = (advisories) => {
29
- const set = /* @__PURE__ */ new Set();
30
- for (const advisory of advisories?.advisories ?? []) {
31
- if (advisory.name === "rls_uncovered_table") {
32
- const {
33
- table
34
- } = advisory.metadata;
35
- if (typeof table === "string" && table !== "") {
36
- set.add(table);
37
- }
38
- }
39
- }
40
- return set;
41
- };
42
- const buildRows = (policies, maskColumns, uncovered) => {
43
- const byTable = /* @__PURE__ */ new Map();
44
- const ensure = (table) => {
45
- const existing = byTable.get(table);
46
- if (existing !== void 0) {
47
- return existing;
48
- }
49
- const row = {
50
- cells: {
51
- delete: {},
52
- insert: {},
53
- read: {},
54
- update: {}
55
- },
56
- maskedColumns: [],
57
- table,
58
- uncovered: uncovered.has(table)
59
- };
60
- byTable.set(table, row);
61
- return row;
62
- };
63
- for (const policy of policies) {
64
- ensure(policy.table).cells[policy.on] = {
65
- procedure: policy.procedure
66
- };
67
- }
68
- for (const column of maskColumns) {
69
- const row = ensure(column.table);
70
- if (!row.maskedColumns.includes(column.column)) {
71
- row.maskedColumns.push(column.column);
72
- }
73
- }
74
- for (const table of uncovered) {
75
- ensure(table);
76
- }
77
- return [...byTable.values()].toSorted((a, b) => a.table.localeCompare(b.table));
78
- };
79
- const PermissionsMatrix = (t0) => {
80
- const $ = c(17);
81
- let t1;
82
- if ($[0] !== t0) {
83
- t1 = t0 === void 0 ? {} : t0;
84
- $[0] = t0;
85
- $[1] = t1;
86
- } else {
87
- t1 = $[1];
88
- }
89
- const {
90
- onProbe
91
- } = t1;
92
- const t = useT();
93
- let t2;
94
- let t3;
95
- if ($[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
96
- t2 = {};
97
- t3 = {
98
- live: true
99
- };
100
- $[2] = t2;
101
- $[3] = t3;
102
- } else {
103
- t2 = $[2];
104
- t3 = $[3];
105
- }
106
- const policiesQuery = useAdminQuery(ADMIN_FUNCTIONS.rlsPolicies, t2, t3);
107
- let t4;
108
- if ($[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
109
- t4 = {};
110
- $[4] = t4;
111
- } else {
112
- t4 = $[4];
113
- }
114
- const masksQuery = useAdminQuery(ADMIN_FUNCTIONS.maskPolicies, t4);
115
- let t5;
116
- if ($[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
117
- t5 = {};
118
- $[5] = t5;
119
- } else {
120
- t5 = $[5];
121
- }
122
- const advisoriesQuery = useAdminQuery(ADMIN_FUNCTIONS.getAdvisories, t5);
123
- let t6;
124
- if ($[6] !== advisoriesQuery.data || $[7] !== masksQuery.data || $[8] !== onProbe || $[9] !== policiesQuery || $[10] !== t) {
125
- let policies = null;
126
- if (policiesQuery.data !== void 0) {
127
- policies = Array.isArray(policiesQuery.data.policies) ? policiesQuery.data.policies : [];
128
- }
129
- const maskColumns = Array.isArray(masksQuery.data?.columns) ? masksQuery.data.columns : [];
130
- const advisories = advisoriesQuery.data ?? null;
131
- const {
132
- error,
133
- errorSource,
134
- liveError
135
- } = policiesQuery;
136
- const rows = policies === null ? [] : buildRows(policies, maskColumns, uncoveredTables(advisories));
137
- let t7;
138
- if ($[12] !== liveError) {
139
- t7 = /* @__PURE__ */ jsxDEV("div", {
140
- className: "flex items-center justify-end",
141
- children: /* @__PURE__ */ jsxDEV(LiveError, {
142
- message: liveError,
143
- prefix: "pm"
144
- }, void 0, false)
145
- }, void 0, false);
146
- $[12] = liveError;
147
- $[13] = t7;
148
- } else {
149
- t7 = $[13];
150
- }
151
- let t8;
152
- if ($[14] !== error || $[15] !== errorSource) {
153
- t8 = error !== null && /* @__PURE__ */ jsxDEV(ErrorAlert, {
154
- error: errorSource,
155
- testId: "pm-error"
156
- }, void 0, false);
157
- $[14] = error;
158
- $[15] = errorSource;
159
- $[16] = t8;
160
- } else {
161
- t8 = $[16];
162
- }
163
- t6 = /* @__PURE__ */ jsxDEV("div", {
164
- className: "flex flex-col gap-3",
165
- "data-testid": "lunora-permissions-matrix",
166
- children: [t7, t8, policies !== null && rows.length === 0 ? /* @__PURE__ */ jsxDEV(EmptyState, {
167
- description: t("Add a `definePolicy` and wire it through `.use(rls(...))` to populate this matrix."),
168
- testId: "pm-empty",
169
- title: t("No policy")
170
- }, void 0, false) : /* @__PURE__ */ jsxDEV(Table, {
171
- "data-testid": "pm-table",
172
- children: [/* @__PURE__ */ jsxDEV(TableHeader, {
173
- children: /* @__PURE__ */ jsxDEV(TableRow, {
174
- children: [/* @__PURE__ */ jsxDEV(TableHead, {
175
- children: t("Table")
176
- }, void 0, false), OPERATIONS.map((operation) => /* @__PURE__ */ jsxDEV(TableHead, {
177
- children: operationLabel(t, operation)
178
- }, operation, false)), /* @__PURE__ */ jsxDEV(TableHead, {
179
- children: t("Masked columns")
180
- }, void 0, false)]
181
- }, void 0, true)
182
- }, void 0, false), /* @__PURE__ */ jsxDEV(TableBody, {
183
- children: rows.map((row) => /* @__PURE__ */ jsxDEV(TableRow, {
184
- "data-testid": `pm-row-${row.table}`,
185
- children: [/* @__PURE__ */ jsxDEV(TableCell, {
186
- className: "font-mono text-xs",
187
- children: /* @__PURE__ */ jsxDEV("span", {
188
- className: "flex items-center gap-1.5",
189
- children: [row.table, row.uncovered && /* @__PURE__ */ jsxDEV(Badge, {
190
- "data-testid": `pm-uncovered-${row.table}`,
191
- title: t("Uncovered — reachable without a policy"),
192
- variant: "destructive",
193
- children: t("Uncovered — reachable without a policy")
194
- }, void 0, false)]
195
- }, void 0, true)
196
- }, void 0, false), OPERATIONS.map((operation_0) => {
197
- const cell = row.cells[operation_0];
198
- return /* @__PURE__ */ jsxDEV(TableCell, {
199
- "data-testid": `pm-cell-${row.table}-${operation_0}`,
200
- children: cell.procedure === void 0 ? /* @__PURE__ */ jsxDEV("span", {
201
- className: "text-xs text-muted-foreground",
202
- children: t("No policy")
203
- }, void 0, false) : /* @__PURE__ */ jsxDEV("span", {
204
- className: "flex flex-col gap-1",
205
- children: [/* @__PURE__ */ jsxDEV(Badge, {
206
- variant: "secondary",
207
- children: t("Covered by {procedure}", {
208
- procedure: cell.procedure
209
- })
210
- }, void 0, false), onProbe !== void 0 && /* @__PURE__ */ jsxDEV(Button, {
211
- className: "h-auto justify-start p-0 text-[11px]",
212
- "data-testid": `pm-probe-${row.table}-${operation_0}`,
213
- onClick: () => {
214
- onProbe(row.table, operation_0, cell.procedure ?? "");
215
- },
216
- size: "xs",
217
- type: "button",
218
- variant: "ghost",
219
- children: t("Probe this")
220
- }, void 0, false)]
221
- }, void 0, true)
222
- }, operation_0, false);
223
- }), /* @__PURE__ */ jsxDEV(TableCell, {
224
- children: row.maskedColumns.length === 0 ? /* @__PURE__ */ jsxDEV("span", {
225
- "aria-hidden": "true",
226
- className: "text-muted-foreground",
227
- children: "—"
228
- }, void 0, false) : /* @__PURE__ */ jsxDEV("span", {
229
- className: "flex flex-wrap gap-1",
230
- children: row.maskedColumns.map(_temp)
231
- }, void 0, false)
232
- }, void 0, false)]
233
- }, row.table, true))
234
- }, void 0, false)]
235
- }, void 0, true)]
236
- }, void 0, true);
237
- $[6] = advisoriesQuery.data;
238
- $[7] = masksQuery.data;
239
- $[8] = onProbe;
240
- $[9] = policiesQuery;
241
- $[10] = t;
242
- $[11] = t6;
243
- } else {
244
- t6 = $[11];
245
- }
246
- return t6;
247
- };
248
- function _temp(column) {
249
- return /* @__PURE__ */ jsxDEV(Badge, {
250
- variant: "outline",
251
- children: column
252
- }, column, false);
253
- }
254
-
255
- const RUN_AS = adminRef(ADMIN_FUNCTIONS.runAs);
256
- const useRunAsProbe = () => {
257
- const client = useLunora();
258
- return async ({
259
- args,
260
- functionPath,
261
- shardKey = "",
262
- userId
263
- }) => {
264
- const reference = RUN_AS;
265
- try {
266
- const value = await client.query(reference, {
267
- args,
268
- functionPath,
269
- userId
270
- }, callOptions(shardKey));
271
- return {
272
- kind: "allowed",
273
- value
274
- };
275
- } catch (error) {
276
- return {
277
- kind: "denied",
278
- message: error instanceof Error ? error.message : String(error)
279
- };
280
- }
281
- };
282
- };
283
-
284
- const formatValue = (value) => value === void 0 ? "undefined" : JSON.stringify(value, null, 2);
285
- const PermissionsPlayground = ({
286
- functions: functionsProp,
287
- prefill,
288
- runAsIdentity = false
289
- } = {}) => {
290
- const client = useLunora();
291
- const t = useT();
292
- const probe = useRunAsProbe();
293
- const [discovered, setDiscovered] = useState(null);
294
- const [discoverError, setDiscoverError] = useState(null);
295
- const functions = functionsProp ?? discovered ?? [];
296
- const [selectedPath, setSelectedPath] = useState("");
297
- const [argsText, setArgsText] = useState("{}");
298
- const [shardKey, setShardKey] = useState("");
299
- const [runAsUserId, setRunAsUserId] = useState("");
300
- const [running, setRunning] = useState(false);
301
- const [outcome, setOutcome] = useState(null);
302
- const [argsError, setArgsError] = useState(null);
303
- const appliedNonce = useRef(-1);
304
- useEffect(() => {
305
- if (functionsProp !== void 0) {
306
- return void 0;
307
- }
308
- let cancelled = false;
309
- client.listFunctions().then((list) => {
310
- if (!cancelled) {
311
- setDiscovered(list);
312
- }
313
- return list;
314
- }).catch((error_) => {
315
- if (!cancelled) {
316
- setDiscoverError(errorMessage(error_));
317
- }
318
- });
319
- return () => {
320
- cancelled = true;
321
- };
322
- }, [client, functionsProp]);
323
- useEffect(() => {
324
- if (prefill === void 0 || appliedNonce.current === prefill.nonce) {
325
- return;
326
- }
327
- appliedNonce.current = prefill.nonce;
328
- const target = prefill.functionPath;
329
- queueMicrotask(() => {
330
- setSelectedPath(target);
331
- setOutcome(null);
332
- });
333
- }, [prefill]);
334
- const effectivePath = selectedPath === "" ? functions[0]?.path ?? "" : selectedPath;
335
- const run = async () => {
336
- if (effectivePath === "") {
337
- return;
338
- }
339
- let parsedArgs;
340
- try {
341
- parsedArgs = argsText.trim() === "" ? {} : JSON.parse(argsText);
342
- } catch (parseError) {
343
- setArgsError(t("Invalid JSON args: {message}", {
344
- message: parseError.message
345
- }));
346
- setOutcome(null);
347
- return;
348
- }
349
- setArgsError(null);
350
- setRunning(true);
351
- try {
352
- const result = await probe({
353
- args: parsedArgs,
354
- functionPath: effectivePath,
355
- shardKey: shardKey.trim(),
356
- userId: runAsUserId.trim()
357
- });
358
- setOutcome(result);
359
- } finally {
360
- setRunning(false);
361
- }
362
- };
363
- const runOnce = () => {
364
- fireAndForget(run());
365
- };
366
- const onSelectChange = (event) => {
367
- setSelectedPath(event.target.value);
368
- };
369
- const onArgsChange = (event_0) => {
370
- setArgsText(event_0.target.value);
371
- };
372
- const onUserIdChange = (event_1) => {
373
- setRunAsUserId(event_1.target.value);
374
- };
375
- return /* @__PURE__ */ jsxDEV("div", {
376
- className: "flex flex-col gap-3",
377
- "data-testid": "lunora-permissions-playground",
378
- children: [discoverError !== null && /* @__PURE__ */ jsxDEV("p", {
379
- className: "text-sm text-destructive",
380
- "data-testid": "pp-discover-error",
381
- role: "alert",
382
- children: discoverError
383
- }, void 0, false), !runAsIdentity && /* @__PURE__ */ jsxDEV(EmptyState, {
384
- description: t("Dev only: runs the selected function as this user over the admin gate so you can test auth and RLS."),
385
- testId: "pp-gate",
386
- title: t("Set `runAsIdentity` to forge an identity and probe access.")
387
- }, void 0, false), /* @__PURE__ */ jsxDEV("div", {
388
- className: "flex flex-col gap-3 rounded-md border border-border p-3",
389
- children: [/* @__PURE__ */ jsxDEV("div", {
390
- className: "flex flex-col gap-1.5",
391
- children: [/* @__PURE__ */ jsxDEV(Label, {
392
- htmlFor: "pp-function",
393
- children: t("Function")
394
- }, void 0, false), /* @__PURE__ */ jsxDEV("select", {
395
- "aria-label": t("Function"),
396
- className: "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",
397
- "data-testid": "pp-function",
398
- id: "pp-function",
399
- onChange: onSelectChange,
400
- value: effectivePath,
401
- children: functions.map((descriptor) => /* @__PURE__ */ jsxDEV("option", {
402
- value: descriptor.path,
403
- children: [descriptor.path, " (", descriptor.kind, ")"]
404
- }, descriptor.path, true))
405
- }, void 0, false)]
406
- }, void 0, true), /* @__PURE__ */ jsxDEV("div", {
407
- className: "flex flex-col gap-1.5",
408
- children: [/* @__PURE__ */ jsxDEV(Label, {
409
- htmlFor: "pp-args",
410
- children: t("Arguments")
411
- }, void 0, false), /* @__PURE__ */ jsxDEV(Textarea, {
412
- "aria-label": t("Arguments"),
413
- className: "font-mono text-xs",
414
- "data-testid": "pp-args",
415
- id: "pp-args",
416
- onChange: onArgsChange,
417
- value: argsText
418
- }, void 0, false)]
419
- }, void 0, true), /* @__PURE__ */ jsxDEV(ShardInput, {
420
- onChange: setShardKey,
421
- testId: "pp-shard",
422
- value: shardKey
423
- }, void 0, false), /* @__PURE__ */ jsxDEV("div", {
424
- className: "flex flex-col gap-1.5",
425
- children: [/* @__PURE__ */ jsxDEV(Label, {
426
- htmlFor: "pp-user",
427
- children: t("Run as (userId)")
428
- }, void 0, false), /* @__PURE__ */ jsxDEV(Input, {
429
- "aria-label": t("Identity (userId) to run as"),
430
- className: "font-mono text-xs",
431
- "data-testid": "pp-user",
432
- id: "pp-user",
433
- onChange: onUserIdChange,
434
- placeholder: t("Leave empty to run as admin"),
435
- value: runAsUserId
436
- }, void 0, false)]
437
- }, void 0, true), /* @__PURE__ */ jsxDEV("div", {
438
- className: "flex items-center gap-2",
439
- children: [/* @__PURE__ */ jsxDEV(Button, {
440
- "data-testid": "pp-run",
441
- disabled: !runAsIdentity || running || effectivePath === "",
442
- onClick: runOnce,
443
- type: "button",
444
- children: running ? t("Probing…") : t("Run probe")
445
- }, void 0, false), runAsUserId.trim() !== "" && /* @__PURE__ */ jsxDEV(Badge, {
446
- "data-testid": "pp-as-badge",
447
- variant: "secondary",
448
- children: t("as {userId}", {
449
- userId: runAsUserId.trim()
450
- })
451
- }, void 0, false)]
452
- }, void 0, true)]
453
- }, void 0, true), argsError !== null && /* @__PURE__ */ jsxDEV("p", {
454
- className: "text-sm text-destructive",
455
- "data-testid": "pp-args-error",
456
- role: "alert",
457
- children: argsError
458
- }, void 0, false), outcome !== null && outcome.kind === "allowed" && /* @__PURE__ */ jsxDEV("div", {
459
- className: "flex flex-col gap-2",
460
- "data-testid": "pp-outcome-allowed",
461
- children: [/* @__PURE__ */ jsxDEV(Badge, {
462
- variant: "secondary",
463
- children: t("Allowed")
464
- }, void 0, false), /* @__PURE__ */ jsxDEV("pre", {
465
- className: "overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs",
466
- "data-testid": "pp-result",
467
- children: formatValue(outcome.value)
468
- }, void 0, false)]
469
- }, void 0, true), outcome !== null && outcome.kind === "denied" && /* @__PURE__ */ jsxDEV("div", {
470
- className: "flex flex-col gap-2",
471
- "data-testid": "pp-outcome-denied",
472
- children: [/* @__PURE__ */ jsxDEV(Badge, {
473
- variant: "destructive",
474
- children: t("Denied")
475
- }, void 0, false), /* @__PURE__ */ jsxDEV("pre", {
476
- className: "overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs text-destructive",
477
- "data-testid": "pp-denied",
478
- role: "alert",
479
- children: outcome.message
480
- }, void 0, false)]
481
- }, void 0, true)]
482
- }, void 0, true);
483
- };
484
-
485
- const POLICY_SCAFFOLD_ENDPOINT = "/__lunora/policy-scaffold";
486
- const FAILURE_MESSAGES = {
487
- "already-wired": "That procedure already has an rls(...) policy wired in.",
488
- "file-exists": "A policy file with that name already exists — pick another name or edit it by hand.",
489
- "invalid-identifier": "Name, table, and policy-set must be plain identifiers (letters, digits, _ or $).",
490
- "unknown-procedure": "No exported procedure was found at that file path.",
491
- "unsupported-procedure-shape": "That procedure uses the bare query({…}) form — convert it to the builder form (c.use(…).query(…)) before wiring RLS."
492
- };
493
- const applyPolicyScaffold = async (request) => {
494
- const response = await fetch(POLICY_SCAFFOLD_ENDPOINT, {
495
- body: JSON.stringify(request),
496
- headers: {
497
- "Content-Type": "application/json"
498
- },
499
- method: "POST"
500
- });
501
- const body = await response.json();
502
- if (body.needsManualEdit === true) {
503
- return {
504
- kind: "needs-manual-edit",
505
- message: body.message ?? "This change must be made by hand."
506
- };
507
- }
508
- if (response.ok) {
509
- return {
510
- diagnostics: body.diagnostics ?? [],
511
- kind: "ok",
512
- label: body.fileName ?? body.exportName ?? ""
513
- };
514
- }
515
- const token = body.error;
516
- const message = token === void 0 ? `policy scaffold failed (${String(response.status)})` : FAILURE_MESSAGES[token] ?? token;
517
- return {
518
- kind: "error",
519
- message
520
- };
521
- };
522
-
523
- const EMPTY_FORM = {
524
- exportName: "",
525
- filePath: "",
526
- policyName: "",
527
- policies: "",
528
- tableName: ""
529
- };
530
- const PolicyScaffolder = () => {
531
- const t = useT();
532
- const [mode, setMode] = useState(null);
533
- const [busy, setBusy] = useState(false);
534
- const [result, setResult] = useState(null);
535
- const [form, setForm] = useState(EMPTY_FORM);
536
- const onFieldChange = (event) => {
537
- const field = event.target.name;
538
- const {
539
- value
540
- } = event.target;
541
- setForm((previous) => {
542
- return {
543
- ...previous,
544
- [field]: value
545
- };
546
- });
547
- };
548
- const reset = () => {
549
- setMode(null);
550
- setForm(EMPTY_FORM);
551
- };
552
- const submit = async (request) => {
553
- setBusy(true);
554
- setResult(null);
555
- try {
556
- const outcome = await applyPolicyScaffold(request);
557
- setResult(outcome);
558
- if (outcome.kind === "ok") {
559
- reset();
560
- }
561
- } catch (error) {
562
- setResult({
563
- kind: "error",
564
- message: error instanceof Error ? error.message : String(error)
565
- });
566
- } finally {
567
- setBusy(false);
568
- }
569
- };
570
- const onSubmitScaffold = () => {
571
- fireAndForget(submit({
572
- kind: "scaffoldPolicy",
573
- name: form.policyName.trim(),
574
- table: form.tableName.trim()
575
- }));
576
- };
577
- const onSubmitWire = () => {
578
- fireAndForget(submit({
579
- exportName: form.exportName.trim(),
580
- filePath: form.filePath.trim(),
581
- kind: "wireRls",
582
- policies: form.policies.trim()
583
- }));
584
- };
585
- const openScaffold = () => {
586
- setResult(null);
587
- setMode("scaffold");
588
- };
589
- const openWire = () => {
590
- setResult(null);
591
- setMode("wire");
592
- };
593
- return /* @__PURE__ */ jsxDEV(Card, {
594
- "data-testid": "policy-scaffolder",
595
- size: "sm",
596
- children: [/* @__PURE__ */ jsxDEV(CardHeader, {
597
- children: [/* @__PURE__ */ jsxDEV(CardTitle, {
598
- children: t("Scaffold access rules")
599
- }, void 0, false), /* @__PURE__ */ jsxDEV(CardDescription, {
600
- children: t("Writes a new deny-by-default policy file under lunora/, or wires one into a procedure, then reruns codegen. Local dev only.")
601
- }, void 0, false)]
602
- }, void 0, true), /* @__PURE__ */ jsxDEV(CardContent, {
603
- children: [/* @__PURE__ */ jsxDEV("div", {
604
- className: "flex flex-wrap gap-2",
605
- children: [/* @__PURE__ */ jsxDEV(Button, {
606
- "data-testid": "policy-scaffolder-new",
607
- onClick: openScaffold,
608
- size: "xs",
609
- type: "button",
610
- variant: mode === "scaffold" ? "default" : "outline",
611
- children: t("New policy file")
612
- }, void 0, false), /* @__PURE__ */ jsxDEV(Button, {
613
- "data-testid": "policy-scaffolder-wire",
614
- onClick: openWire,
615
- size: "xs",
616
- type: "button",
617
- variant: mode === "wire" ? "default" : "outline",
618
- children: t("Wire into a procedure")
619
- }, void 0, false)]
620
- }, void 0, true), mode === "scaffold" && /* @__PURE__ */ jsxDEV("div", {
621
- className: "mt-3 flex flex-wrap items-end gap-2",
622
- "data-testid": "policy-scaffolder-new-form",
623
- children: [/* @__PURE__ */ jsxDEV("div", {
624
- className: "flex flex-col gap-1 text-xs",
625
- children: [/* @__PURE__ */ jsxDEV(Label, {
626
- htmlFor: "policy-scaffolder-name",
627
- children: t("Policy name")
628
- }, void 0, false), /* @__PURE__ */ jsxDEV(Input, {
629
- "data-testid": "policy-scaffolder-name",
630
- id: "policy-scaffolder-name",
631
- name: "policyName",
632
- onChange: onFieldChange,
633
- value: form.policyName
634
- }, void 0, false)]
635
- }, void 0, true), /* @__PURE__ */ jsxDEV("div", {
636
- className: "flex flex-col gap-1 text-xs",
637
- children: [/* @__PURE__ */ jsxDEV(Label, {
638
- htmlFor: "policy-scaffolder-table",
639
- children: t("Table name")
640
- }, void 0, false), /* @__PURE__ */ jsxDEV(Input, {
641
- "data-testid": "policy-scaffolder-table",
642
- id: "policy-scaffolder-table",
643
- name: "tableName",
644
- onChange: onFieldChange,
645
- value: form.tableName
646
- }, void 0, false)]
647
- }, void 0, true), /* @__PURE__ */ jsxDEV(Button, {
648
- "data-testid": "policy-scaffolder-create",
649
- disabled: busy || form.policyName.trim() === "" || form.tableName.trim() === "",
650
- onClick: onSubmitScaffold,
651
- size: "xs",
652
- type: "button",
653
- children: busy ? t("Creating…") : t("Create policy file")
654
- }, void 0, false), /* @__PURE__ */ jsxDEV(Button, {
655
- onClick: reset,
656
- size: "xs",
657
- type: "button",
658
- variant: "ghost",
659
- children: t("Cancel")
660
- }, void 0, false)]
661
- }, void 0, true), mode === "wire" && /* @__PURE__ */ jsxDEV("div", {
662
- className: "mt-3 flex flex-wrap items-end gap-2",
663
- "data-testid": "policy-scaffolder-wire-form",
664
- children: [/* @__PURE__ */ jsxDEV("div", {
665
- className: "flex flex-col gap-1 text-xs",
666
- children: [/* @__PURE__ */ jsxDEV(Label, {
667
- htmlFor: "policy-scaffolder-file",
668
- children: t("Procedure file path")
669
- }, void 0, false), /* @__PURE__ */ jsxDEV(Input, {
670
- "data-testid": "policy-scaffolder-file",
671
- id: "policy-scaffolder-file",
672
- name: "filePath",
673
- onChange: onFieldChange,
674
- value: form.filePath
675
- }, void 0, false)]
676
- }, void 0, true), /* @__PURE__ */ jsxDEV("div", {
677
- className: "flex flex-col gap-1 text-xs",
678
- children: [/* @__PURE__ */ jsxDEV(Label, {
679
- htmlFor: "policy-scaffolder-export",
680
- children: t("Exported procedure")
681
- }, void 0, false), /* @__PURE__ */ jsxDEV(Input, {
682
- "data-testid": "policy-scaffolder-export",
683
- id: "policy-scaffolder-export",
684
- name: "exportName",
685
- onChange: onFieldChange,
686
- value: form.exportName
687
- }, void 0, false)]
688
- }, void 0, true), /* @__PURE__ */ jsxDEV("div", {
689
- className: "flex flex-col gap-1 text-xs",
690
- children: [/* @__PURE__ */ jsxDEV(Label, {
691
- htmlFor: "policy-scaffolder-policies",
692
- children: t("Policy set identifier")
693
- }, void 0, false), /* @__PURE__ */ jsxDEV(Input, {
694
- "data-testid": "policy-scaffolder-policies",
695
- id: "policy-scaffolder-policies",
696
- name: "policies",
697
- onChange: onFieldChange,
698
- value: form.policies
699
- }, void 0, false)]
700
- }, void 0, true), /* @__PURE__ */ jsxDEV(Button, {
701
- "data-testid": "policy-scaffolder-apply",
702
- disabled: busy || form.filePath.trim() === "" || form.exportName.trim() === "" || form.policies.trim() === "",
703
- onClick: onSubmitWire,
704
- size: "xs",
705
- type: "button",
706
- children: busy ? t("Wiring…") : t("Wire RLS")
707
- }, void 0, false), /* @__PURE__ */ jsxDEV(Button, {
708
- onClick: reset,
709
- size: "xs",
710
- type: "button",
711
- variant: "ghost",
712
- children: t("Cancel")
713
- }, void 0, false)]
714
- }, void 0, true), result?.kind === "error" && /* @__PURE__ */ jsxDEV("p", {
715
- className: "mt-3 text-sm text-destructive",
716
- "data-testid": "policy-scaffolder-error",
717
- role: "alert",
718
- children: result.message
719
- }, void 0, false), result?.kind === "needs-manual-edit" && /* @__PURE__ */ jsxDEV("p", {
720
- className: "mt-3 text-sm text-amber-600 dark:text-amber-500",
721
- "data-testid": "policy-scaffolder-manual",
722
- role: "alert",
723
- children: t("This change must be made by hand — the scaffolder only adds new, deny-by-default rules.")
724
- }, void 0, false), result?.kind === "ok" && /* @__PURE__ */ jsxDEV("div", {
725
- className: "mt-3 flex flex-col gap-1",
726
- "data-testid": "policy-scaffolder-ok",
727
- children: [/* @__PURE__ */ jsxDEV("p", {
728
- className: "text-sm text-emerald-600 dark:text-emerald-500",
729
- children: t("Scaffolded {label} and reran codegen. Fill in the `when` predicates before relying on it.", {
730
- label: result.label
731
- })
732
- }, void 0, false), result.diagnostics.length > 0 && /* @__PURE__ */ jsxDEV("ul", {
733
- className: "flex flex-col gap-0.5",
734
- "data-testid": "policy-scaffolder-diagnostics",
735
- children: result.diagnostics.map((diagnostic) => /* @__PURE__ */ jsxDEV("li", {
736
- className: "font-mono text-[11px] text-destructive",
737
- children: diagnostic
738
- }, diagnostic, false))
739
- }, void 0, false)]
740
- }, void 0, true)]
741
- }, void 0, true)]
742
- }, void 0, true);
743
- };
744
-
745
- const PermissionsPanel = ({
746
- functions,
747
- runAsIdentity = false,
748
- schemaEditable = false
749
- } = {}) => {
750
- const t = useT();
751
- const [prefill, setPrefill] = useState(void 0);
752
- const onProbe = (_table, _operation, procedure) => {
753
- if (procedure !== "") {
754
- setPrefill((previous) => {
755
- return {
756
- functionPath: procedure,
757
- nonce: (previous?.nonce ?? 0) + 1
758
- };
759
- });
760
- }
761
- };
762
- return /* @__PURE__ */ jsxDEV("div", {
763
- className: "flex flex-col gap-8",
764
- "data-testid": "lunora-permissions",
765
- children: [/* @__PURE__ */ jsxDEV("section", {
766
- className: "flex flex-col gap-3",
767
- children: [/* @__PURE__ */ jsxDEV("header", {
768
- className: "border-b border-border px-4 py-3",
769
- children: /* @__PURE__ */ jsxDEV("span", {
770
- className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
771
- children: t("Permissions")
772
- }, void 0, false)
773
- }, void 0, false), /* @__PURE__ */ jsxDEV(PermissionsMatrix, {
774
- onProbe
775
- }, void 0, false)]
776
- }, void 0, true), /* @__PURE__ */ jsxDEV("section", {
777
- className: "flex flex-col gap-3",
778
- children: /* @__PURE__ */ jsxDEV(Card, {
779
- className: "gap-0 py-0",
780
- children: [/* @__PURE__ */ jsxDEV("header", {
781
- className: "border-b border-border px-4 py-3",
782
- children: /* @__PURE__ */ jsxDEV("span", {
783
- className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
784
- children: t("Probe")
785
- }, void 0, false)
786
- }, void 0, false), /* @__PURE__ */ jsxDEV(CardContent, {
787
- className: "px-4 py-4",
788
- children: [/* @__PURE__ */ jsxDEV("p", {
789
- className: "mb-3 text-sm text-muted-foreground",
790
- children: t("Pick a function and an identity, then run it to see the access outcome.")
791
- }, void 0, false), /* @__PURE__ */ jsxDEV(PermissionsPlayground, {
792
- functions,
793
- prefill,
794
- runAsIdentity
795
- }, void 0, false)]
796
- }, void 0, true)]
797
- }, void 0, true)
798
- }, void 0, false), schemaEditable && /* @__PURE__ */ jsxDEV("section", {
799
- className: "flex flex-col gap-2",
800
- children: /* @__PURE__ */ jsxDEV(PolicyScaffolder, {}, void 0, false)
801
- }, void 0, false)]
802
- }, void 0, true);
803
- };
804
-
805
- export { PermissionsPanel };