@lunora/studio 1.0.0-alpha.31 → 1.0.0-alpha.310

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 (467) hide show
  1. package/LICENSE.md +6 -0
  2. package/README.md +1 -1
  3. package/dist/index.d.mts +1581 -0
  4. package/dist/index.d.ts +974 -806
  5. package/dist/index.mjs +1 -0
  6. package/dist/mount.d.mts +22 -0
  7. package/dist/mount.d.ts +11 -10
  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 +3 -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/sparkline.mjs +1 -0
  54. package/dist/packem_chunks/storage-rules-panel.mjs +1 -0
  55. package/dist/packem_chunks/subscriptions-panel.mjs +1 -0
  56. package/dist/packem_chunks/sync-client-panel.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-B8yyk5BX.mjs +1 -0
  62. package/dist/packem_shared/ApiDocsPanel-fhDlZGE4.mjs +2 -0
  63. package/dist/packem_shared/ApiReferencePanel-nAf8tNRr.mjs +1 -0
  64. package/dist/packem_shared/CommandPalette-D9ZY-qQd.mjs +1 -0
  65. package/dist/packem_shared/ConfirmButton-DU4p72Er.mjs +1 -0
  66. package/dist/packem_shared/ConnectionBadge-B8Hj5DaE.mjs +1 -0
  67. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-DuULO4XM.mjs +1 -0
  68. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-D5YMT0gM.mjs +1 -0
  69. package/dist/packem_shared/DEFAULT_LOCALE-A1Yg5ORA.mjs +1 -0
  70. package/dist/packem_shared/DataBrowser-E68QfaST.mjs +4 -0
  71. package/dist/packem_shared/DataFilters-CYZFt2EK.mjs +1 -0
  72. package/dist/packem_shared/ErrorBoundary-BWNF98VF.mjs +1 -0
  73. package/dist/packem_shared/GlobalDataBrowser-DhObcZDY.mjs +1 -0
  74. package/dist/packem_shared/HomePanel-CUuYsApa.mjs +1 -0
  75. package/dist/packem_shared/MigrationsPanel-CkVIwAbK.mjs +1 -0
  76. package/dist/packem_shared/OpenRpcReferencePanel-BxEr49D9.mjs +1 -0
  77. package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.mjs +1 -0
  78. package/dist/packem_shared/ScheduledJobs-BZNcYWBP.mjs +1 -0
  79. package/dist/packem_shared/ShardInput-C6mjgAh4.mjs +1 -0
  80. package/dist/packem_shared/Studio-CZjQXFHC.mjs +1 -0
  81. package/dist/packem_shared/StudioApp-C9ENwcOH.mjs +1 -0
  82. package/dist/packem_shared/StudioI18nProvider-fVsCSs5L.mjs +1 -0
  83. package/dist/packem_shared/advisor-view-DzI2RQhY.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-D7vL0y8y.d.mts +349 -0
  87. package/dist/packem_shared/app.d-D7vL0y8y.d.ts +349 -0
  88. package/dist/packem_shared/auth-pager-DiDnXsfe.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-DIiNmDR9.mjs +1 -0
  98. package/dist/packem_shared/data-view-params-DhYmAkcj.mjs +1 -0
  99. package/dist/packem_shared/diagram-export-panel-D5CVNJkp.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-DueSEkt-.mjs +1 -0
  103. package/dist/packem_shared/grid-features-OVIMIQan.mjs +6 -0
  104. package/dist/packem_shared/grid-pagination-DgzyzfBh.mjs +1 -0
  105. package/dist/packem_shared/home-panel-BcE8S2Nn.mjs +3 -0
  106. package/dist/packem_shared/input-CXhxesPC.mjs +1 -0
  107. package/dist/packem_shared/internal-Df43vQI0.mjs +2 -0
  108. package/dist/packem_shared/label-DKFzyHq6.mjs +1 -0
  109. package/dist/packem_shared/live-status-BuJdUZFU.mjs +1 -0
  110. package/dist/packem_shared/log-fields-BolUoZ9g.mjs +1 -0
  111. package/dist/packem_shared/log-line-CICyJ_kc.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-CyFiAE2l.mjs +1 -0
  116. package/dist/packem_shared/reference-view-CIHyURU6.mjs +13 -0
  117. package/dist/packem_shared/schema-diagram-C5oilX7l.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-DyK762_A.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-fK2DTLde.mjs +2 -0
  128. package/dist/packem_shared/table-D0SBiDu-.mjs +2 -0
  129. package/dist/packem_shared/table-list-sidebar-DkPO_Qtz.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-tlBof8Yg.mjs +1 -0
  133. package/dist/packem_shared/use-admin-spec-Bir7V68L.mjs +1 -0
  134. package/dist/packem_shared/use-async-submit-CZqCMTJ_.mjs +1 -0
  135. package/dist/packem_shared/use-auth-config-Z_n4ABCI.mjs +1 -0
  136. package/dist/packem_shared/use-mirrored-ref-CVDf2z1M.mjs +1 -0
  137. package/dist/packem_shared/use-open-trace-DMVhpnyG.mjs +1 -0
  138. package/dist/packem_shared/use-shard-key-BsP3o5wT.mjs +1 -0
  139. package/dist/packem_shared/use-sql-assistant-CZydTzd5.mjs +1 -0
  140. package/dist/packem_shared/useDebounced-DVeQ5-oW.mjs +1 -0
  141. package/dist/packem_shared/utils-bhneXptQ.mjs +1 -0
  142. package/dist/packem_shared/virtual-rect-D_j7aLxX.mjs +1 -0
  143. package/dist/standalone/chunk-225UTWUC.js +2 -0
  144. package/dist/standalone/chunk-253UHWDX.js +1 -0
  145. package/dist/standalone/chunk-2D5PY4GN.js +1 -0
  146. package/dist/standalone/chunk-2I4NHEKA.js +1 -0
  147. package/dist/standalone/chunk-2IKDEUCX.js +1 -0
  148. package/dist/standalone/chunk-2R4BRJGM.js +1 -0
  149. package/dist/standalone/chunk-2SJZZH4H.js +1 -0
  150. package/dist/standalone/chunk-2VA5S3IA.js +1 -0
  151. package/dist/standalone/chunk-37WYCOQ2.js +1 -0
  152. package/dist/standalone/chunk-3GWYCFNE.js +1 -0
  153. package/dist/standalone/chunk-3PZCWECC.js +1 -0
  154. package/dist/standalone/chunk-3QX3JY3V.js +1 -0
  155. package/dist/standalone/chunk-3YXASVTP.js +1 -0
  156. package/dist/standalone/chunk-4IGNK2QW.js +1 -0
  157. package/dist/standalone/chunk-4WD4XGC3.js +1 -0
  158. package/dist/standalone/chunk-4ZEL6BYL.js +1 -0
  159. package/dist/standalone/chunk-55UGUCQ6.js +1 -0
  160. package/dist/standalone/chunk-5B2RTXBS.js +1 -0
  161. package/dist/standalone/chunk-5LZ7ITPY.js +1 -0
  162. package/dist/standalone/chunk-5QR2SQIS.js +1 -0
  163. package/dist/standalone/chunk-6HLARDYO.js +1 -0
  164. package/dist/standalone/chunk-6QTAHSDD.js +1 -0
  165. package/dist/standalone/chunk-6RUR4ENY.js +1 -0
  166. package/dist/standalone/chunk-7474UICL.js +1 -0
  167. package/dist/standalone/chunk-76BXZLNG.js +1 -0
  168. package/dist/standalone/chunk-7DQRMMWU.js +3 -0
  169. package/dist/standalone/chunk-7G4Z6Q7X.js +1 -0
  170. package/dist/standalone/chunk-7RKB5KS7.js +1 -0
  171. package/dist/standalone/chunk-7RPU77RS.js +1 -0
  172. package/dist/standalone/chunk-7Y3SY37W.js +1 -0
  173. package/dist/standalone/chunk-AD2DJJC3.js +1 -0
  174. package/dist/standalone/chunk-AD7GTQBR.js +1 -0
  175. package/dist/standalone/chunk-APSLOGDM.js +1 -0
  176. package/dist/standalone/chunk-AUAECCXB.js +1 -0
  177. package/dist/standalone/{chunk-BJGBHGK3.js → chunk-AUGKHAMQ.js} +1 -1
  178. package/dist/standalone/chunk-AV7OEKJ6.js +9 -0
  179. package/dist/standalone/chunk-AVACONK5.js +1 -0
  180. package/dist/standalone/chunk-BOMPSVRC.js +1 -0
  181. package/dist/standalone/chunk-BSHTZR6K.js +1 -0
  182. package/dist/standalone/chunk-BV2EBCUX.js +1 -0
  183. package/dist/standalone/chunk-CCDX5RYT.js +1 -0
  184. package/dist/standalone/chunk-CGQMJYCW.js +1 -0
  185. package/dist/standalone/chunk-CVXNHIQW.js +1 -0
  186. package/dist/standalone/chunk-D4ZXRW2I.js +5 -0
  187. package/dist/standalone/chunk-E4PXACVL.js +3 -0
  188. package/dist/standalone/chunk-ECY2JC5F.js +1 -0
  189. package/dist/standalone/chunk-F7GN7PFX.js +1 -0
  190. package/dist/standalone/chunk-FPI7AMQJ.js +1 -0
  191. package/dist/standalone/chunk-FUGLFWLW.js +1 -0
  192. package/dist/standalone/chunk-FUYEZFBP.js +1 -0
  193. package/dist/standalone/chunk-FWNCU5GC.js +8 -0
  194. package/dist/standalone/chunk-G74GIEU4.js +1 -0
  195. package/dist/standalone/chunk-GD2NG5PX.js +1 -0
  196. package/dist/standalone/chunk-GHQ2VDI2.js +1 -0
  197. package/dist/standalone/chunk-GHZ2JWYN.js +1 -0
  198. package/dist/standalone/chunk-H3BZ3JO6.js +1 -0
  199. package/dist/standalone/chunk-HCTJKP5J.js +1 -0
  200. package/dist/standalone/chunk-HJHSQPHW.js +19 -0
  201. package/dist/standalone/chunk-HXBFXMPI.js +4 -0
  202. package/dist/standalone/chunk-I26MS5PJ.js +1 -0
  203. package/dist/standalone/chunk-IEDJDJCP.js +1 -0
  204. package/dist/standalone/chunk-IFEMFSLN.js +1 -0
  205. package/dist/standalone/chunk-IWZ7GVQO.js +1 -0
  206. package/dist/standalone/chunk-IY6US3YF.js +1 -0
  207. package/dist/standalone/chunk-JH36CKFQ.js +1 -0
  208. package/dist/standalone/chunk-JQXA2OYK.js +1 -0
  209. package/dist/standalone/chunk-JRGRIQ7P.js +14 -0
  210. package/dist/standalone/chunk-JX6TE3LZ.js +1 -0
  211. package/dist/standalone/chunk-JZGTSH2C.js +4 -0
  212. package/dist/standalone/chunk-K6564T6V.js +1 -0
  213. package/dist/standalone/chunk-K72WUXVL.js +1 -0
  214. package/dist/standalone/chunk-KB4LDWU5.js +1 -0
  215. package/dist/standalone/chunk-L254SW7Y.js +1 -0
  216. package/dist/standalone/chunk-M2FQTDR4.js +1 -0
  217. package/dist/standalone/chunk-M2ZMWQFY.js +1 -0
  218. package/dist/standalone/chunk-MOC6MEKG.js +15 -0
  219. package/dist/standalone/chunk-MVS7RWFI.js +1 -0
  220. package/dist/standalone/chunk-MVWZMWPD.js +1 -0
  221. package/dist/standalone/chunk-MWIKSOHW.js +1 -0
  222. package/dist/standalone/chunk-NCPW7WHO.js +1 -0
  223. package/dist/standalone/chunk-NDTQTKDX.js +6 -0
  224. package/dist/standalone/chunk-NGVP66OH.js +1 -0
  225. package/dist/standalone/chunk-NQZALRU3.js +1 -0
  226. package/dist/standalone/chunk-NRP22GKC.js +1 -0
  227. package/dist/standalone/chunk-NXGPDLDU.js +1 -0
  228. package/dist/standalone/chunk-NXQW5E6W.js +1 -0
  229. package/dist/standalone/chunk-OPM7ESDV.js +1 -0
  230. package/dist/standalone/chunk-OQ6I6OXT.js +2 -0
  231. package/dist/standalone/chunk-OSGXNEFA.js +1 -0
  232. package/dist/standalone/chunk-OYCUPD3Q.js +1 -0
  233. package/dist/standalone/chunk-PIMTWCRD.js +1 -0
  234. package/dist/standalone/chunk-PJSLU6LL.js +1 -0
  235. package/dist/standalone/chunk-Q6ED4KUL.js +1 -0
  236. package/dist/standalone/chunk-Q6IT6ZD7.js +1 -0
  237. package/dist/standalone/chunk-QAQDMS6R.js +1 -0
  238. package/dist/standalone/chunk-QBE5USC3.js +1 -0
  239. package/dist/standalone/chunk-QEMJIJCD.js +1 -0
  240. package/dist/standalone/chunk-QJLHH3ET.js +1 -0
  241. package/dist/standalone/chunk-QPTUTBNA.js +1 -0
  242. package/dist/standalone/chunk-QSF3YY7X.js +59 -0
  243. package/dist/standalone/chunk-R6U22RSY.js +1 -0
  244. package/dist/standalone/chunk-RGMVGZV4.js +1 -0
  245. package/dist/standalone/chunk-RHRUDVZJ.js +1 -0
  246. package/dist/standalone/chunk-RWVIV3U7.js +1 -0
  247. package/dist/standalone/chunk-S4Z7K55A.js +1 -0
  248. package/dist/standalone/chunk-SA2OGF3F.js +1 -0
  249. package/dist/standalone/chunk-SFDYCSQW.js +1 -0
  250. package/dist/standalone/chunk-SJQERRSZ.js +1 -0
  251. package/dist/standalone/chunk-SV764LKQ.js +1 -0
  252. package/dist/standalone/chunk-SZCVCB4X.js +3 -0
  253. package/dist/standalone/chunk-TPHEVTCW.js +1 -0
  254. package/dist/standalone/chunk-UC7MNI2F.js +1 -0
  255. package/dist/standalone/chunk-UYEZR3BI.js +1 -0
  256. package/dist/standalone/chunk-V24V4CZ4.js +1 -0
  257. package/dist/standalone/chunk-VCFEO3RI.js +1 -0
  258. package/dist/standalone/chunk-VESGIGMQ.js +1 -0
  259. package/dist/standalone/chunk-VGL7ERWQ.js +15 -0
  260. package/dist/standalone/chunk-VS4MTIRN.js +1 -0
  261. package/dist/standalone/chunk-VXEC3UCO.js +1 -0
  262. package/dist/standalone/chunk-WJRYEML4.js +1 -0
  263. package/dist/standalone/chunk-WOBRELSS.js +1 -0
  264. package/dist/standalone/chunk-XGCIDUJF.js +1 -0
  265. package/dist/standalone/chunk-XHRKNCCI.js +1 -0
  266. package/dist/standalone/chunk-XL2AUAZA.js +1 -0
  267. package/dist/standalone/chunk-XOFQMNBS.js +1 -0
  268. package/dist/standalone/chunk-Y3AYVFTK.js +1 -0
  269. package/dist/standalone/chunk-YPWBHX2E.js +1 -0
  270. package/dist/standalone/chunk-YVNIQ7OG.js +1 -0
  271. package/dist/standalone/chunk-YVR4SEPU.js +1 -0
  272. package/dist/standalone/chunk-Z22BDS6N.js +1 -0
  273. package/dist/standalone/chunk-ZKJS6EBE.js +1 -0
  274. package/dist/standalone/chunk-ZQPAHCMA.js +1 -0
  275. package/dist/standalone/chunk-ZYKSTQC7.js +1 -0
  276. package/dist/standalone/studio.js +9 -214
  277. package/dist/styles.css +2 -2
  278. package/package.json +26 -21
  279. package/dist/index.js +0 -41
  280. package/dist/mount.js +0 -26
  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 -197
  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 -375
  287. package/dist/packem_chunks/HealthPanel.js +0 -648
  288. package/dist/packem_chunks/InsightsPanel.js +0 -461
  289. package/dist/packem_chunks/LogsPanel.js +0 -827
  290. package/dist/packem_chunks/MailPanel.js +0 -440
  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 -2512
  295. package/dist/packem_chunks/SecurityAdvisorPanel.js +0 -92
  296. package/dist/packem_chunks/SettingsPanel.js +0 -390
  297. package/dist/packem_chunks/SqlEditorPanel.js +0 -2322
  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 -779
  304. package/dist/packem_chunks/fanout-panel.js +0 -481
  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 -185
  310. package/dist/packem_chunks/permissions-panel.js +0 -804
  311. package/dist/packem_chunks/queues-panel.js +0 -147
  312. package/dist/packem_chunks/rls-panel.js +0 -313
  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 -138
  316. package/dist/packem_chunks/subscriptions-panel.js +0 -236
  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-CdaxLGkE.js +0 -48
  321. package/dist/packem_shared/ApiDocsPanel-B6u_wnz-.js +0 -842
  322. package/dist/packem_shared/ApiReferencePanel-Drz4UO0a.js +0 -230
  323. package/dist/packem_shared/CommandPalette-B5BertvU.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-ANTHLWWh.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-CjgTG_wa.js +0 -289
  333. package/dist/packem_shared/HomePanel-BRcQVDby.js +0 -14
  334. package/dist/packem_shared/OpenRpcReferencePanel-CspFdbUT.js +0 -192
  335. package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
  336. package/dist/packem_shared/ScheduledJobs-BEJXtsBn.js +0 -262
  337. package/dist/packem_shared/ShardInput-gx_DZXXn.js +0 -107
  338. package/dist/packem_shared/Studio-B1V0GxTz.js +0 -16
  339. package/dist/packem_shared/StudioApp-CR0Tvy81.js +0 -657
  340. package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
  341. package/dist/packem_shared/advisor-view-DzqyvUU3.js +0 -159
  342. package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +0 -108
  343. package/dist/packem_shared/app.d-CNLRTrWw.d.ts +0 -300
  344. package/dist/packem_shared/badge-B2PKA1-5.js +0 -49
  345. package/dist/packem_shared/bar-chart-Bb__F5-u.js +0 -3245
  346. package/dist/packem_shared/browser-storage-d03UsV7v.js +0 -249
  347. package/dist/packem_shared/button-BhsN2uZH.js +0 -49
  348. package/dist/packem_shared/card-DURq3ElK.js +0 -175
  349. package/dist/packem_shared/cf-links-BZfRdxSE.js +0 -8
  350. package/dist/packem_shared/checkbox-UNkzAxl-.js +0 -63
  351. package/dist/packem_shared/data-grid-Dsg6nRjo.js +0 -183
  352. package/dist/packem_shared/data-view-params-Cd6yRVbv.js +0 -96
  353. package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +0 -280
  354. package/dist/packem_shared/empty-state-DY_oe0k6.js +0 -98
  355. package/dist/packem_shared/grid-features-D7nNzBYm.js +0 -745
  356. package/dist/packem_shared/home-panel-CRIs6x2j.js +0 -1639
  357. package/dist/packem_shared/input-XH4r1Pt1.js +0 -53
  358. package/dist/packem_shared/internal-FcNZ3beb.js +0 -68
  359. package/dist/packem_shared/label-D8ykjn5J.js +0 -46
  360. package/dist/packem_shared/live-status-FZ0psC1z.js +0 -44
  361. package/dist/packem_shared/modal-shell-hyaJvIJ6.js +0 -100
  362. package/dist/packem_shared/reference-view-Doy1XlQq.js +0 -2140
  363. package/dist/packem_shared/select-UkNYCT3s.js +0 -273
  364. package/dist/packem_shared/shard-history-DyebH1R5.js +0 -38
  365. package/dist/packem_shared/skeleton-CGhL0p20.js +0 -45
  366. package/dist/packem_shared/sparkline-KgMPHS4u.js +0 -93
  367. package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
  368. package/dist/packem_shared/studio-CQ-rtNhn.js +0 -4013
  369. package/dist/packem_shared/table-DsCa9Qp9.js +0 -246
  370. package/dist/packem_shared/table-list-sidebar-VMo0ftxD.js +0 -832
  371. package/dist/packem_shared/textarea-D3gaCU_-.js +0 -46
  372. package/dist/packem_shared/use-admin-query-BViPA3US.js +0 -105
  373. package/dist/packem_shared/use-auth-capabilities-BHkoBnbZ.js +0 -32
  374. package/dist/packem_shared/useDebounced-Dxncpg6z.js +0 -32
  375. package/dist/packem_shared/utils-B05Dmz_H.js +0 -8
  376. package/dist/packem_shared/virtual-rect-CVMUskSm.js +0 -10
  377. package/dist/standalone/chunk-2DS7JLWL.js +0 -13
  378. package/dist/standalone/chunk-2K47A3P6.js +0 -1
  379. package/dist/standalone/chunk-2NGUNNGW.js +0 -1
  380. package/dist/standalone/chunk-2PDQ4KZ6.js +0 -1
  381. package/dist/standalone/chunk-3BP4BTLR.js +0 -4
  382. package/dist/standalone/chunk-3OA7PECS.js +0 -6
  383. package/dist/standalone/chunk-45QK5ZPN.js +0 -1
  384. package/dist/standalone/chunk-4QHKBC77.js +0 -1
  385. package/dist/standalone/chunk-57LYXHXH.js +0 -1
  386. package/dist/standalone/chunk-5NSZVXCS.js +0 -1
  387. package/dist/standalone/chunk-5OIBXYZM.js +0 -1
  388. package/dist/standalone/chunk-63XKJQTQ.js +0 -1
  389. package/dist/standalone/chunk-6RC6L33K.js +0 -4
  390. package/dist/standalone/chunk-6VTGE3WJ.js +0 -1
  391. package/dist/standalone/chunk-7PBZKXYA.js +0 -1
  392. package/dist/standalone/chunk-7POIIWC5.js +0 -3
  393. package/dist/standalone/chunk-7RYIQKZA.js +0 -1
  394. package/dist/standalone/chunk-7TJJXVSE.js +0 -1
  395. package/dist/standalone/chunk-AB6QGMBF.js +0 -1
  396. package/dist/standalone/chunk-AHILM3ZP.js +0 -1
  397. package/dist/standalone/chunk-AQGOX5DK.js +0 -1
  398. package/dist/standalone/chunk-ASLGNHAX.js +0 -1
  399. package/dist/standalone/chunk-BHTPZS7L.js +0 -4
  400. package/dist/standalone/chunk-D6ORSB24.js +0 -1
  401. package/dist/standalone/chunk-DGWTR4G7.js +0 -1
  402. package/dist/standalone/chunk-DSX53PBM.js +0 -1
  403. package/dist/standalone/chunk-DV2MNASX.js +0 -1
  404. package/dist/standalone/chunk-DWDILV2E.js +0 -1
  405. package/dist/standalone/chunk-EGJX34WM.js +0 -1
  406. package/dist/standalone/chunk-FCR3HKFV.js +0 -1
  407. package/dist/standalone/chunk-FKO3HO6I.js +0 -4
  408. package/dist/standalone/chunk-FQKNJSRA.js +0 -76
  409. package/dist/standalone/chunk-G2TFEWEQ.js +0 -4
  410. package/dist/standalone/chunk-GTM65MVX.js +0 -1
  411. package/dist/standalone/chunk-GZXPPJVK.js +0 -1
  412. package/dist/standalone/chunk-HFBRE65A.js +0 -1
  413. package/dist/standalone/chunk-HG7Q5B3H.js +0 -1
  414. package/dist/standalone/chunk-HTQL7AXU.js +0 -1
  415. package/dist/standalone/chunk-HV7G6DFP.js +0 -5
  416. package/dist/standalone/chunk-ITLLHEVG.js +0 -1
  417. package/dist/standalone/chunk-J6J54MBP.js +0 -1
  418. package/dist/standalone/chunk-JSEXCW5Q.js +0 -1
  419. package/dist/standalone/chunk-KEGAWN6Y.js +0 -1
  420. package/dist/standalone/chunk-KG3QTFWE.js +0 -1
  421. package/dist/standalone/chunk-KGS7KM4A.js +0 -2
  422. package/dist/standalone/chunk-KNRVPCFX.js +0 -1
  423. package/dist/standalone/chunk-KODWGUAB.js +0 -1
  424. package/dist/standalone/chunk-KZ6INM5M.js +0 -1
  425. package/dist/standalone/chunk-LZWPCZLE.js +0 -1
  426. package/dist/standalone/chunk-N2QDG3MW.js +0 -1
  427. package/dist/standalone/chunk-N4JI6VQD.js +0 -1
  428. package/dist/standalone/chunk-NNISYDNI.js +0 -1
  429. package/dist/standalone/chunk-O4PXDNR3.js +0 -1
  430. package/dist/standalone/chunk-O77VNUFD.js +0 -1
  431. package/dist/standalone/chunk-OD2POGPJ.js +0 -1
  432. package/dist/standalone/chunk-OXCK3ZUG.js +0 -1
  433. package/dist/standalone/chunk-P7DSVO4U.js +0 -1
  434. package/dist/standalone/chunk-PKAM3N5C.js +0 -1
  435. package/dist/standalone/chunk-QGXGBHQO.js +0 -1
  436. package/dist/standalone/chunk-QHA3TAEJ.js +0 -1
  437. package/dist/standalone/chunk-QQWC62X7.js +0 -1
  438. package/dist/standalone/chunk-RMYA7NAH.js +0 -1
  439. package/dist/standalone/chunk-RRCPZMC2.js +0 -22
  440. package/dist/standalone/chunk-S53RUBW5.js +0 -1
  441. package/dist/standalone/chunk-SB4GT6PK.js +0 -1
  442. package/dist/standalone/chunk-SEU5V7I6.js +0 -1
  443. package/dist/standalone/chunk-SHIOUDOT.js +0 -1
  444. package/dist/standalone/chunk-SIDRSX7Y.js +0 -1
  445. package/dist/standalone/chunk-SVR644RF.js +0 -1
  446. package/dist/standalone/chunk-TAD43CG5.js +0 -1
  447. package/dist/standalone/chunk-TBMYIZIO.js +0 -1
  448. package/dist/standalone/chunk-TICVNLPM.js +0 -1
  449. package/dist/standalone/chunk-TQ36RWOP.js +0 -1
  450. package/dist/standalone/chunk-UGMRUEBU.js +0 -1
  451. package/dist/standalone/chunk-UII66UVF.js +0 -1
  452. package/dist/standalone/chunk-VJPQUBN6.js +0 -8
  453. package/dist/standalone/chunk-VLXV72QE.js +0 -1
  454. package/dist/standalone/chunk-VMJKJWG6.js +0 -1
  455. package/dist/standalone/chunk-VPDPN5RR.js +0 -2
  456. package/dist/standalone/chunk-VSEGZA3J.js +0 -1
  457. package/dist/standalone/chunk-VXBZQIGY.js +0 -4
  458. package/dist/standalone/chunk-W5LWN6IP.js +0 -1
  459. package/dist/standalone/chunk-W7PCVQTE.js +0 -1
  460. package/dist/standalone/chunk-W7SQVLBH.js +0 -1
  461. package/dist/standalone/chunk-XLILSHPE.js +0 -1
  462. package/dist/standalone/chunk-XURNGQSS.js +0 -1
  463. package/dist/standalone/chunk-YJGANMU7.js +0 -18
  464. package/dist/standalone/chunk-YQQJ4N6U.js +0 -1
  465. package/dist/standalone/chunk-ZH7UES4T.js +0 -2
  466. package/dist/standalone/chunk-ZPUO7FNI.js +0 -1
  467. package/dist/standalone/chunk-ZQCVDXDL.js +0 -1
@@ -1,804 +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 { L as LiveError } from '../packem_shared/live-status-FZ0psC1z.js';
6
- import { B as Badge } from '../packem_shared/badge-B2PKA1-5.js';
7
- import { B as Button } from '../packem_shared/button-BhsN2uZH.js';
8
- import { E as EmptyState } from '../packem_shared/empty-state-DY_oe0k6.js';
9
- 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';
10
- import { u as useAdminQuery } from '../packem_shared/use-admin-query-BViPA3US.js';
11
- import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-CdaxLGkE.js';
12
- import { jsxDEV } from 'react/jsx-dev-runtime';
13
- import { useLunora } from '@lunora/react';
14
- import { ShardInput } from '../packem_shared/ShardInput-gx_DZXXn.js';
15
- import { I as Input } from '../packem_shared/input-XH4r1Pt1.js';
16
- import { L as Label } from '../packem_shared/label-D8ykjn5J.js';
17
- import { T as Textarea } from '../packem_shared/textarea-D3gaCU_-.js';
18
- import { c as callOptions, a as adminRef, e as errorMessage, f as fireAndForget } from '../packem_shared/internal-FcNZ3beb.js';
19
-
20
- const OPERATIONS = ["read", "insert", "update", "delete"];
21
- const operationLabel = (t, operation) => ({
22
- delete: t("Delete"),
23
- insert: t("Insert"),
24
- read: t("Read"),
25
- update: t("Update")
26
- })[operation];
27
- const uncoveredTables = (advisories) => {
28
- const set = /* @__PURE__ */ new Set();
29
- for (const advisory of advisories?.advisories ?? []) {
30
- if (advisory.name === "rls_uncovered_table") {
31
- const {
32
- table
33
- } = advisory.metadata;
34
- if (typeof table === "string" && table !== "") {
35
- set.add(table);
36
- }
37
- }
38
- }
39
- return set;
40
- };
41
- const buildRows = (policies, maskColumns, uncovered) => {
42
- const byTable = /* @__PURE__ */ new Map();
43
- const ensure = (table) => {
44
- const existing = byTable.get(table);
45
- if (existing !== void 0) {
46
- return existing;
47
- }
48
- const row = {
49
- cells: {
50
- delete: {},
51
- insert: {},
52
- read: {},
53
- update: {}
54
- },
55
- maskedColumns: [],
56
- table,
57
- uncovered: uncovered.has(table)
58
- };
59
- byTable.set(table, row);
60
- return row;
61
- };
62
- for (const policy of policies) {
63
- ensure(policy.table).cells[policy.on] = {
64
- procedure: policy.procedure
65
- };
66
- }
67
- for (const column of maskColumns) {
68
- const row = ensure(column.table);
69
- if (!row.maskedColumns.includes(column.column)) {
70
- row.maskedColumns.push(column.column);
71
- }
72
- }
73
- for (const table of uncovered) {
74
- ensure(table);
75
- }
76
- return [...byTable.values()].toSorted((a, b) => a.table.localeCompare(b.table));
77
- };
78
- const PermissionsMatrix = (t0) => {
79
- const $ = c(16);
80
- let t1;
81
- if ($[0] !== t0) {
82
- t1 = t0 === void 0 ? {} : t0;
83
- $[0] = t0;
84
- $[1] = t1;
85
- } else {
86
- t1 = $[1];
87
- }
88
- const {
89
- onProbe
90
- } = t1;
91
- const t = useT();
92
- let t2;
93
- let t3;
94
- if ($[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
95
- t2 = {};
96
- t3 = {
97
- live: true
98
- };
99
- $[2] = t2;
100
- $[3] = t3;
101
- } else {
102
- t2 = $[2];
103
- t3 = $[3];
104
- }
105
- const policiesQuery = useAdminQuery(ADMIN_FUNCTIONS.rlsPolicies, t2, t3);
106
- let t4;
107
- if ($[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
108
- t4 = {};
109
- $[4] = t4;
110
- } else {
111
- t4 = $[4];
112
- }
113
- const masksQuery = useAdminQuery(ADMIN_FUNCTIONS.maskPolicies, t4);
114
- let t5;
115
- if ($[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
116
- t5 = {};
117
- $[5] = t5;
118
- } else {
119
- t5 = $[5];
120
- }
121
- const advisoriesQuery = useAdminQuery(ADMIN_FUNCTIONS.getAdvisories, t5);
122
- let t6;
123
- if ($[6] !== advisoriesQuery.data || $[7] !== masksQuery.data || $[8] !== onProbe || $[9] !== policiesQuery || $[10] !== t) {
124
- let policies = null;
125
- if (policiesQuery.data !== void 0) {
126
- policies = Array.isArray(policiesQuery.data.policies) ? policiesQuery.data.policies : [];
127
- }
128
- const maskColumns = Array.isArray(masksQuery.data?.columns) ? masksQuery.data.columns : [];
129
- const advisories = advisoriesQuery.data ?? null;
130
- const {
131
- error,
132
- liveError
133
- } = policiesQuery;
134
- const rows = policies === null ? [] : buildRows(policies, maskColumns, uncoveredTables(advisories));
135
- let t7;
136
- if ($[12] !== liveError) {
137
- t7 = /* @__PURE__ */ jsxDEV("div", {
138
- className: "flex items-center justify-end",
139
- children: /* @__PURE__ */ jsxDEV(LiveError, {
140
- message: liveError,
141
- prefix: "pm"
142
- }, void 0, false)
143
- }, void 0, false);
144
- $[12] = liveError;
145
- $[13] = t7;
146
- } else {
147
- t7 = $[13];
148
- }
149
- let t8;
150
- if ($[14] !== error) {
151
- t8 = error !== null && /* @__PURE__ */ jsxDEV("p", {
152
- className: "text-sm text-destructive",
153
- "data-testid": "pm-error",
154
- role: "alert",
155
- children: error
156
- }, void 0, false);
157
- $[14] = error;
158
- $[15] = t8;
159
- } else {
160
- t8 = $[15];
161
- }
162
- t6 = /* @__PURE__ */ jsxDEV("div", {
163
- className: "flex flex-col gap-3",
164
- "data-testid": "lunora-permissions-matrix",
165
- children: [t7, t8, policies !== null && rows.length === 0 ? /* @__PURE__ */ jsxDEV(EmptyState, {
166
- description: t("Add a `definePolicy` and wire it through `.use(rls(...))` to populate this matrix."),
167
- testId: "pm-empty",
168
- title: t("No policy")
169
- }, void 0, false) : /* @__PURE__ */ jsxDEV(Table, {
170
- "data-testid": "pm-table",
171
- children: [/* @__PURE__ */ jsxDEV(TableHeader, {
172
- children: /* @__PURE__ */ jsxDEV(TableRow, {
173
- children: [/* @__PURE__ */ jsxDEV(TableHead, {
174
- children: t("Table")
175
- }, void 0, false), OPERATIONS.map((operation) => /* @__PURE__ */ jsxDEV(TableHead, {
176
- children: operationLabel(t, operation)
177
- }, operation, false)), /* @__PURE__ */ jsxDEV(TableHead, {
178
- children: t("Masked columns")
179
- }, void 0, false)]
180
- }, void 0, true)
181
- }, void 0, false), /* @__PURE__ */ jsxDEV(TableBody, {
182
- children: rows.map((row) => /* @__PURE__ */ jsxDEV(TableRow, {
183
- "data-testid": `pm-row-${row.table}`,
184
- children: [/* @__PURE__ */ jsxDEV(TableCell, {
185
- className: "font-mono text-xs",
186
- children: /* @__PURE__ */ jsxDEV("span", {
187
- className: "flex items-center gap-1.5",
188
- children: [row.table, row.uncovered && /* @__PURE__ */ jsxDEV(Badge, {
189
- "data-testid": `pm-uncovered-${row.table}`,
190
- title: t("Uncovered — reachable without a policy"),
191
- variant: "destructive",
192
- children: t("Uncovered — reachable without a policy")
193
- }, void 0, false)]
194
- }, void 0, true)
195
- }, void 0, false), OPERATIONS.map((operation_0) => {
196
- const cell = row.cells[operation_0];
197
- return /* @__PURE__ */ jsxDEV(TableCell, {
198
- "data-testid": `pm-cell-${row.table}-${operation_0}`,
199
- children: cell.procedure === void 0 ? /* @__PURE__ */ jsxDEV("span", {
200
- className: "text-xs text-muted-foreground",
201
- children: t("No policy")
202
- }, void 0, false) : /* @__PURE__ */ jsxDEV("span", {
203
- className: "flex flex-col gap-1",
204
- children: [/* @__PURE__ */ jsxDEV(Badge, {
205
- variant: "secondary",
206
- children: t("Covered by {procedure}", {
207
- procedure: cell.procedure
208
- })
209
- }, void 0, false), onProbe !== void 0 && /* @__PURE__ */ jsxDEV(Button, {
210
- className: "h-auto justify-start p-0 text-[11px]",
211
- "data-testid": `pm-probe-${row.table}-${operation_0}`,
212
- onClick: () => {
213
- onProbe(row.table, operation_0, cell.procedure ?? "");
214
- },
215
- size: "xs",
216
- type: "button",
217
- variant: "ghost",
218
- children: t("Probe this")
219
- }, void 0, false)]
220
- }, void 0, true)
221
- }, operation_0, false);
222
- }), /* @__PURE__ */ jsxDEV(TableCell, {
223
- children: row.maskedColumns.length === 0 ? /* @__PURE__ */ jsxDEV("span", {
224
- "aria-hidden": "true",
225
- className: "text-muted-foreground",
226
- children: "—"
227
- }, void 0, false) : /* @__PURE__ */ jsxDEV("span", {
228
- className: "flex flex-wrap gap-1",
229
- children: row.maskedColumns.map(_temp)
230
- }, void 0, false)
231
- }, void 0, false)]
232
- }, row.table, true))
233
- }, void 0, false)]
234
- }, void 0, true)]
235
- }, void 0, true);
236
- $[6] = advisoriesQuery.data;
237
- $[7] = masksQuery.data;
238
- $[8] = onProbe;
239
- $[9] = policiesQuery;
240
- $[10] = t;
241
- $[11] = t6;
242
- } else {
243
- t6 = $[11];
244
- }
245
- return t6;
246
- };
247
- function _temp(column) {
248
- return /* @__PURE__ */ jsxDEV(Badge, {
249
- variant: "outline",
250
- children: column
251
- }, column, false);
252
- }
253
-
254
- const RUN_AS = adminRef(ADMIN_FUNCTIONS.runAs);
255
- const useRunAsProbe = () => {
256
- const client = useLunora();
257
- return async ({
258
- args,
259
- functionPath,
260
- shardKey = "",
261
- userId
262
- }) => {
263
- const reference = RUN_AS;
264
- try {
265
- const value = await client.query(reference, {
266
- args,
267
- functionPath,
268
- userId
269
- }, callOptions(shardKey));
270
- return {
271
- kind: "allowed",
272
- value
273
- };
274
- } catch (error) {
275
- return {
276
- kind: "denied",
277
- message: error instanceof Error ? error.message : String(error)
278
- };
279
- }
280
- };
281
- };
282
-
283
- const formatValue = (value) => value === void 0 ? "undefined" : JSON.stringify(value, null, 2);
284
- const PermissionsPlayground = ({
285
- functions: functionsProp,
286
- prefill,
287
- runAsIdentity = false
288
- } = {}) => {
289
- const client = useLunora();
290
- const t = useT();
291
- const probe = useRunAsProbe();
292
- const [discovered, setDiscovered] = useState(null);
293
- const [discoverError, setDiscoverError] = useState(null);
294
- const functions = functionsProp ?? discovered ?? [];
295
- const [selectedPath, setSelectedPath] = useState("");
296
- const [argsText, setArgsText] = useState("{}");
297
- const [shardKey, setShardKey] = useState("");
298
- const [runAsUserId, setRunAsUserId] = useState("");
299
- const [running, setRunning] = useState(false);
300
- const [outcome, setOutcome] = useState(null);
301
- const [argsError, setArgsError] = useState(null);
302
- const appliedNonce = useRef(-1);
303
- useEffect(() => {
304
- if (functionsProp !== void 0) {
305
- return void 0;
306
- }
307
- let cancelled = false;
308
- client.listFunctions().then((list) => {
309
- if (!cancelled) {
310
- setDiscovered(list);
311
- }
312
- return list;
313
- }).catch((error_) => {
314
- if (!cancelled) {
315
- setDiscoverError(errorMessage(error_));
316
- }
317
- });
318
- return () => {
319
- cancelled = true;
320
- };
321
- }, [client, functionsProp]);
322
- useEffect(() => {
323
- if (prefill === void 0 || appliedNonce.current === prefill.nonce) {
324
- return;
325
- }
326
- appliedNonce.current = prefill.nonce;
327
- const target = prefill.functionPath;
328
- queueMicrotask(() => {
329
- setSelectedPath(target);
330
- setOutcome(null);
331
- });
332
- }, [prefill]);
333
- const effectivePath = selectedPath === "" ? functions[0]?.path ?? "" : selectedPath;
334
- const run = async () => {
335
- if (effectivePath === "") {
336
- return;
337
- }
338
- let parsedArgs;
339
- try {
340
- parsedArgs = argsText.trim() === "" ? {} : JSON.parse(argsText);
341
- } catch (parseError) {
342
- setArgsError(t("Invalid JSON args: {message}", {
343
- message: parseError.message
344
- }));
345
- setOutcome(null);
346
- return;
347
- }
348
- setArgsError(null);
349
- setRunning(true);
350
- try {
351
- const result = await probe({
352
- args: parsedArgs,
353
- functionPath: effectivePath,
354
- shardKey: shardKey.trim(),
355
- userId: runAsUserId.trim()
356
- });
357
- setOutcome(result);
358
- } finally {
359
- setRunning(false);
360
- }
361
- };
362
- const runOnce = () => {
363
- fireAndForget(run());
364
- };
365
- const onSelectChange = (event) => {
366
- setSelectedPath(event.target.value);
367
- };
368
- const onArgsChange = (event_0) => {
369
- setArgsText(event_0.target.value);
370
- };
371
- const onUserIdChange = (event_1) => {
372
- setRunAsUserId(event_1.target.value);
373
- };
374
- return /* @__PURE__ */ jsxDEV("div", {
375
- className: "flex flex-col gap-3",
376
- "data-testid": "lunora-permissions-playground",
377
- children: [discoverError !== null && /* @__PURE__ */ jsxDEV("p", {
378
- className: "text-sm text-destructive",
379
- "data-testid": "pp-discover-error",
380
- role: "alert",
381
- children: discoverError
382
- }, void 0, false), !runAsIdentity && /* @__PURE__ */ jsxDEV(EmptyState, {
383
- description: t("Dev only: runs the selected function as this user over the admin gate so you can test auth and RLS."),
384
- testId: "pp-gate",
385
- title: t("Set `runAsIdentity` to forge an identity and probe access.")
386
- }, void 0, false), /* @__PURE__ */ jsxDEV("div", {
387
- className: "flex flex-col gap-3 rounded-md border border-border p-3",
388
- children: [/* @__PURE__ */ jsxDEV("div", {
389
- className: "flex flex-col gap-1.5",
390
- children: [/* @__PURE__ */ jsxDEV(Label, {
391
- htmlFor: "pp-function",
392
- children: t("Function")
393
- }, void 0, false), /* @__PURE__ */ jsxDEV("select", {
394
- "aria-label": t("Function"),
395
- 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",
396
- "data-testid": "pp-function",
397
- id: "pp-function",
398
- onChange: onSelectChange,
399
- value: effectivePath,
400
- children: functions.map((descriptor) => /* @__PURE__ */ jsxDEV("option", {
401
- value: descriptor.path,
402
- children: [descriptor.path, " (", descriptor.kind, ")"]
403
- }, descriptor.path, true))
404
- }, void 0, false)]
405
- }, void 0, true), /* @__PURE__ */ jsxDEV("div", {
406
- className: "flex flex-col gap-1.5",
407
- children: [/* @__PURE__ */ jsxDEV(Label, {
408
- htmlFor: "pp-args",
409
- children: t("Arguments")
410
- }, void 0, false), /* @__PURE__ */ jsxDEV(Textarea, {
411
- "aria-label": t("Arguments"),
412
- className: "font-mono text-xs",
413
- "data-testid": "pp-args",
414
- id: "pp-args",
415
- onChange: onArgsChange,
416
- value: argsText
417
- }, void 0, false)]
418
- }, void 0, true), /* @__PURE__ */ jsxDEV(ShardInput, {
419
- onChange: setShardKey,
420
- testId: "pp-shard",
421
- value: shardKey
422
- }, void 0, false), /* @__PURE__ */ jsxDEV("div", {
423
- className: "flex flex-col gap-1.5",
424
- children: [/* @__PURE__ */ jsxDEV(Label, {
425
- htmlFor: "pp-user",
426
- children: t("Run as (userId)")
427
- }, void 0, false), /* @__PURE__ */ jsxDEV(Input, {
428
- "aria-label": t("Identity (userId) to run as"),
429
- className: "font-mono text-xs",
430
- "data-testid": "pp-user",
431
- id: "pp-user",
432
- onChange: onUserIdChange,
433
- placeholder: t("Leave empty to run as admin"),
434
- value: runAsUserId
435
- }, void 0, false)]
436
- }, void 0, true), /* @__PURE__ */ jsxDEV("div", {
437
- className: "flex items-center gap-2",
438
- children: [/* @__PURE__ */ jsxDEV(Button, {
439
- "data-testid": "pp-run",
440
- disabled: !runAsIdentity || running || effectivePath === "",
441
- onClick: runOnce,
442
- type: "button",
443
- children: running ? t("Probing…") : t("Run probe")
444
- }, void 0, false), runAsUserId.trim() !== "" && /* @__PURE__ */ jsxDEV(Badge, {
445
- "data-testid": "pp-as-badge",
446
- variant: "secondary",
447
- children: t("as {userId}", {
448
- userId: runAsUserId.trim()
449
- })
450
- }, void 0, false)]
451
- }, void 0, true)]
452
- }, void 0, true), argsError !== null && /* @__PURE__ */ jsxDEV("p", {
453
- className: "text-sm text-destructive",
454
- "data-testid": "pp-args-error",
455
- role: "alert",
456
- children: argsError
457
- }, void 0, false), outcome !== null && outcome.kind === "allowed" && /* @__PURE__ */ jsxDEV("div", {
458
- className: "flex flex-col gap-2",
459
- "data-testid": "pp-outcome-allowed",
460
- children: [/* @__PURE__ */ jsxDEV(Badge, {
461
- variant: "secondary",
462
- children: t("Allowed")
463
- }, void 0, false), /* @__PURE__ */ jsxDEV("pre", {
464
- className: "overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs",
465
- "data-testid": "pp-result",
466
- children: formatValue(outcome.value)
467
- }, void 0, false)]
468
- }, void 0, true), outcome !== null && outcome.kind === "denied" && /* @__PURE__ */ jsxDEV("div", {
469
- className: "flex flex-col gap-2",
470
- "data-testid": "pp-outcome-denied",
471
- children: [/* @__PURE__ */ jsxDEV(Badge, {
472
- variant: "destructive",
473
- children: t("Denied")
474
- }, void 0, false), /* @__PURE__ */ jsxDEV("pre", {
475
- className: "overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs text-destructive",
476
- "data-testid": "pp-denied",
477
- role: "alert",
478
- children: outcome.message
479
- }, void 0, false)]
480
- }, void 0, true)]
481
- }, void 0, true);
482
- };
483
-
484
- const POLICY_SCAFFOLD_ENDPOINT = "/__lunora/policy-scaffold";
485
- const FAILURE_MESSAGES = {
486
- "already-wired": "That procedure already has an rls(...) policy wired in.",
487
- "file-exists": "A policy file with that name already exists — pick another name or edit it by hand.",
488
- "invalid-identifier": "Name, table, and policy-set must be plain identifiers (letters, digits, _ or $).",
489
- "unknown-procedure": "No exported procedure was found at that file path.",
490
- "unsupported-procedure-shape": "That procedure uses the bare query({…}) form — convert it to the builder form (c.use(…).query(…)) before wiring RLS."
491
- };
492
- const applyPolicyScaffold = async (request) => {
493
- const response = await fetch(POLICY_SCAFFOLD_ENDPOINT, {
494
- body: JSON.stringify(request),
495
- headers: {
496
- "Content-Type": "application/json"
497
- },
498
- method: "POST"
499
- });
500
- const body = await response.json();
501
- if (body.needsManualEdit === true) {
502
- return {
503
- kind: "needs-manual-edit",
504
- message: body.message ?? "This change must be made by hand."
505
- };
506
- }
507
- if (response.ok) {
508
- return {
509
- diagnostics: body.diagnostics ?? [],
510
- kind: "ok",
511
- label: body.fileName ?? body.exportName ?? ""
512
- };
513
- }
514
- const token = body.error;
515
- const message = token === void 0 ? `policy scaffold failed (${String(response.status)})` : FAILURE_MESSAGES[token] ?? token;
516
- return {
517
- kind: "error",
518
- message
519
- };
520
- };
521
-
522
- const EMPTY_FORM = {
523
- exportName: "",
524
- filePath: "",
525
- policyName: "",
526
- policies: "",
527
- tableName: ""
528
- };
529
- const PolicyScaffolder = () => {
530
- const t = useT();
531
- const [mode, setMode] = useState(null);
532
- const [busy, setBusy] = useState(false);
533
- const [result, setResult] = useState(null);
534
- const [form, setForm] = useState(EMPTY_FORM);
535
- const onFieldChange = (event) => {
536
- const field = event.target.name;
537
- const {
538
- value
539
- } = event.target;
540
- setForm((previous) => {
541
- return {
542
- ...previous,
543
- [field]: value
544
- };
545
- });
546
- };
547
- const reset = () => {
548
- setMode(null);
549
- setForm(EMPTY_FORM);
550
- };
551
- const submit = async (request) => {
552
- setBusy(true);
553
- setResult(null);
554
- try {
555
- const outcome = await applyPolicyScaffold(request);
556
- setResult(outcome);
557
- if (outcome.kind === "ok") {
558
- reset();
559
- }
560
- } catch (error) {
561
- setResult({
562
- kind: "error",
563
- message: error instanceof Error ? error.message : String(error)
564
- });
565
- } finally {
566
- setBusy(false);
567
- }
568
- };
569
- const onSubmitScaffold = () => {
570
- fireAndForget(submit({
571
- kind: "scaffoldPolicy",
572
- name: form.policyName.trim(),
573
- table: form.tableName.trim()
574
- }));
575
- };
576
- const onSubmitWire = () => {
577
- fireAndForget(submit({
578
- exportName: form.exportName.trim(),
579
- filePath: form.filePath.trim(),
580
- kind: "wireRls",
581
- policies: form.policies.trim()
582
- }));
583
- };
584
- const openScaffold = () => {
585
- setResult(null);
586
- setMode("scaffold");
587
- };
588
- const openWire = () => {
589
- setResult(null);
590
- setMode("wire");
591
- };
592
- return /* @__PURE__ */ jsxDEV(Card, {
593
- "data-testid": "policy-scaffolder",
594
- size: "sm",
595
- children: [/* @__PURE__ */ jsxDEV(CardHeader, {
596
- children: [/* @__PURE__ */ jsxDEV(CardTitle, {
597
- children: t("Scaffold access rules")
598
- }, void 0, false), /* @__PURE__ */ jsxDEV(CardDescription, {
599
- children: t("Writes a new deny-by-default policy file under lunora/, or wires one into a procedure, then reruns codegen. Local dev only.")
600
- }, void 0, false)]
601
- }, void 0, true), /* @__PURE__ */ jsxDEV(CardContent, {
602
- children: [/* @__PURE__ */ jsxDEV("div", {
603
- className: "flex flex-wrap gap-2",
604
- children: [/* @__PURE__ */ jsxDEV(Button, {
605
- "data-testid": "policy-scaffolder-new",
606
- onClick: openScaffold,
607
- size: "xs",
608
- type: "button",
609
- variant: mode === "scaffold" ? "default" : "outline",
610
- children: t("New policy file")
611
- }, void 0, false), /* @__PURE__ */ jsxDEV(Button, {
612
- "data-testid": "policy-scaffolder-wire",
613
- onClick: openWire,
614
- size: "xs",
615
- type: "button",
616
- variant: mode === "wire" ? "default" : "outline",
617
- children: t("Wire into a procedure")
618
- }, void 0, false)]
619
- }, void 0, true), mode === "scaffold" && /* @__PURE__ */ jsxDEV("div", {
620
- className: "mt-3 flex flex-wrap items-end gap-2",
621
- "data-testid": "policy-scaffolder-new-form",
622
- children: [/* @__PURE__ */ jsxDEV("div", {
623
- className: "flex flex-col gap-1 text-xs",
624
- children: [/* @__PURE__ */ jsxDEV(Label, {
625
- htmlFor: "policy-scaffolder-name",
626
- children: t("Policy name")
627
- }, void 0, false), /* @__PURE__ */ jsxDEV(Input, {
628
- "data-testid": "policy-scaffolder-name",
629
- id: "policy-scaffolder-name",
630
- name: "policyName",
631
- onChange: onFieldChange,
632
- value: form.policyName
633
- }, void 0, false)]
634
- }, void 0, true), /* @__PURE__ */ jsxDEV("div", {
635
- className: "flex flex-col gap-1 text-xs",
636
- children: [/* @__PURE__ */ jsxDEV(Label, {
637
- htmlFor: "policy-scaffolder-table",
638
- children: t("Table name")
639
- }, void 0, false), /* @__PURE__ */ jsxDEV(Input, {
640
- "data-testid": "policy-scaffolder-table",
641
- id: "policy-scaffolder-table",
642
- name: "tableName",
643
- onChange: onFieldChange,
644
- value: form.tableName
645
- }, void 0, false)]
646
- }, void 0, true), /* @__PURE__ */ jsxDEV(Button, {
647
- "data-testid": "policy-scaffolder-create",
648
- disabled: busy || form.policyName.trim() === "" || form.tableName.trim() === "",
649
- onClick: onSubmitScaffold,
650
- size: "xs",
651
- type: "button",
652
- children: busy ? t("Creating…") : t("Create policy file")
653
- }, void 0, false), /* @__PURE__ */ jsxDEV(Button, {
654
- onClick: reset,
655
- size: "xs",
656
- type: "button",
657
- variant: "ghost",
658
- children: t("Cancel")
659
- }, void 0, false)]
660
- }, void 0, true), mode === "wire" && /* @__PURE__ */ jsxDEV("div", {
661
- className: "mt-3 flex flex-wrap items-end gap-2",
662
- "data-testid": "policy-scaffolder-wire-form",
663
- children: [/* @__PURE__ */ jsxDEV("div", {
664
- className: "flex flex-col gap-1 text-xs",
665
- children: [/* @__PURE__ */ jsxDEV(Label, {
666
- htmlFor: "policy-scaffolder-file",
667
- children: t("Procedure file path")
668
- }, void 0, false), /* @__PURE__ */ jsxDEV(Input, {
669
- "data-testid": "policy-scaffolder-file",
670
- id: "policy-scaffolder-file",
671
- name: "filePath",
672
- onChange: onFieldChange,
673
- value: form.filePath
674
- }, void 0, false)]
675
- }, void 0, true), /* @__PURE__ */ jsxDEV("div", {
676
- className: "flex flex-col gap-1 text-xs",
677
- children: [/* @__PURE__ */ jsxDEV(Label, {
678
- htmlFor: "policy-scaffolder-export",
679
- children: t("Exported procedure")
680
- }, void 0, false), /* @__PURE__ */ jsxDEV(Input, {
681
- "data-testid": "policy-scaffolder-export",
682
- id: "policy-scaffolder-export",
683
- name: "exportName",
684
- onChange: onFieldChange,
685
- value: form.exportName
686
- }, void 0, false)]
687
- }, void 0, true), /* @__PURE__ */ jsxDEV("div", {
688
- className: "flex flex-col gap-1 text-xs",
689
- children: [/* @__PURE__ */ jsxDEV(Label, {
690
- htmlFor: "policy-scaffolder-policies",
691
- children: t("Policy set identifier")
692
- }, void 0, false), /* @__PURE__ */ jsxDEV(Input, {
693
- "data-testid": "policy-scaffolder-policies",
694
- id: "policy-scaffolder-policies",
695
- name: "policies",
696
- onChange: onFieldChange,
697
- value: form.policies
698
- }, void 0, false)]
699
- }, void 0, true), /* @__PURE__ */ jsxDEV(Button, {
700
- "data-testid": "policy-scaffolder-apply",
701
- disabled: busy || form.filePath.trim() === "" || form.exportName.trim() === "" || form.policies.trim() === "",
702
- onClick: onSubmitWire,
703
- size: "xs",
704
- type: "button",
705
- children: busy ? t("Wiring…") : t("Wire RLS")
706
- }, void 0, false), /* @__PURE__ */ jsxDEV(Button, {
707
- onClick: reset,
708
- size: "xs",
709
- type: "button",
710
- variant: "ghost",
711
- children: t("Cancel")
712
- }, void 0, false)]
713
- }, void 0, true), result?.kind === "error" && /* @__PURE__ */ jsxDEV("p", {
714
- className: "mt-3 text-sm text-destructive",
715
- "data-testid": "policy-scaffolder-error",
716
- role: "alert",
717
- children: result.message
718
- }, void 0, false), result?.kind === "needs-manual-edit" && /* @__PURE__ */ jsxDEV("p", {
719
- className: "mt-3 text-sm text-amber-600 dark:text-amber-500",
720
- "data-testid": "policy-scaffolder-manual",
721
- role: "alert",
722
- children: t("This change must be made by hand — the scaffolder only adds new, deny-by-default rules.")
723
- }, void 0, false), result?.kind === "ok" && /* @__PURE__ */ jsxDEV("div", {
724
- className: "mt-3 flex flex-col gap-1",
725
- "data-testid": "policy-scaffolder-ok",
726
- children: [/* @__PURE__ */ jsxDEV("p", {
727
- className: "text-sm text-emerald-600 dark:text-emerald-500",
728
- children: t("Scaffolded {label} and reran codegen. Fill in the `when` predicates before relying on it.", {
729
- label: result.label
730
- })
731
- }, void 0, false), result.diagnostics.length > 0 && /* @__PURE__ */ jsxDEV("ul", {
732
- className: "flex flex-col gap-0.5",
733
- "data-testid": "policy-scaffolder-diagnostics",
734
- children: result.diagnostics.map((diagnostic) => /* @__PURE__ */ jsxDEV("li", {
735
- className: "font-mono text-[11px] text-destructive",
736
- children: diagnostic
737
- }, diagnostic, false))
738
- }, void 0, false)]
739
- }, void 0, true)]
740
- }, void 0, true)]
741
- }, void 0, true);
742
- };
743
-
744
- const PermissionsPanel = ({
745
- functions,
746
- runAsIdentity = false,
747
- schemaEditable = false
748
- } = {}) => {
749
- const t = useT();
750
- const [prefill, setPrefill] = useState(void 0);
751
- const onProbe = (_table, _operation, procedure) => {
752
- if (procedure !== "") {
753
- setPrefill((previous) => {
754
- return {
755
- functionPath: procedure,
756
- nonce: (previous?.nonce ?? 0) + 1
757
- };
758
- });
759
- }
760
- };
761
- return /* @__PURE__ */ jsxDEV("div", {
762
- className: "flex flex-col gap-8",
763
- "data-testid": "lunora-permissions",
764
- children: [/* @__PURE__ */ jsxDEV("section", {
765
- className: "flex flex-col gap-3",
766
- children: [/* @__PURE__ */ jsxDEV("header", {
767
- className: "border-b border-border px-4 py-3",
768
- children: /* @__PURE__ */ jsxDEV("span", {
769
- className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
770
- children: t("Permissions")
771
- }, void 0, false)
772
- }, void 0, false), /* @__PURE__ */ jsxDEV(PermissionsMatrix, {
773
- onProbe
774
- }, void 0, false)]
775
- }, void 0, true), /* @__PURE__ */ jsxDEV("section", {
776
- className: "flex flex-col gap-3",
777
- children: /* @__PURE__ */ jsxDEV(Card, {
778
- className: "gap-0 py-0",
779
- children: [/* @__PURE__ */ jsxDEV("header", {
780
- className: "border-b border-border px-4 py-3",
781
- children: /* @__PURE__ */ jsxDEV("span", {
782
- className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
783
- children: t("Probe")
784
- }, void 0, false)
785
- }, void 0, false), /* @__PURE__ */ jsxDEV(CardContent, {
786
- className: "px-4 py-4",
787
- children: [/* @__PURE__ */ jsxDEV("p", {
788
- className: "mb-3 text-sm text-muted-foreground",
789
- children: t("Pick a function and an identity, then run it to see the access outcome.")
790
- }, void 0, false), /* @__PURE__ */ jsxDEV(PermissionsPlayground, {
791
- functions,
792
- prefill,
793
- runAsIdentity
794
- }, void 0, false)]
795
- }, void 0, true)]
796
- }, void 0, true)
797
- }, void 0, false), schemaEditable && /* @__PURE__ */ jsxDEV("section", {
798
- className: "flex flex-col gap-2",
799
- children: /* @__PURE__ */ jsxDEV(PolicyScaffolder, {}, void 0, false)
800
- }, void 0, false)]
801
- }, void 0, true);
802
- };
803
-
804
- export { PermissionsPanel };