@lunora/studio 1.0.0-alpha.35 → 1.0.0-alpha.350
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +6 -0
- package/README.md +4 -4
- package/dist/index.d.mts +1618 -0
- package/dist/index.d.ts +1010 -809
- package/dist/index.mjs +1 -0
- package/dist/mount.d.mts +23 -0
- package/dist/mount.d.ts +13 -11
- package/dist/mount.mjs +1 -0
- package/dist/packem_chunks/AdvisorHealthPanel.mjs +1 -0
- package/dist/packem_chunks/ApiTab.mjs +1 -0
- package/dist/packem_chunks/AuditPanel.mjs +1 -0
- package/dist/packem_chunks/DeploymentHealthPanel.mjs +1 -0
- package/dist/packem_chunks/ExportImportPanel.mjs +8 -0
- package/dist/packem_chunks/FileBrowser.mjs +4 -0
- package/dist/packem_chunks/FunctionRunner.mjs +1 -0
- package/dist/packem_chunks/FunctionStatsPanel.mjs +1 -0
- package/dist/packem_chunks/HealthPanel.mjs +1 -0
- package/dist/packem_chunks/InsightsPanel.mjs +1 -0
- package/dist/packem_chunks/LogsPanel.mjs +1 -0
- package/dist/packem_chunks/MailPanel.mjs +2 -0
- package/dist/packem_chunks/MetricsPanel.mjs +1 -0
- package/dist/packem_chunks/NotificationsPanel.mjs +1 -0
- package/dist/packem_chunks/PitrPanel.mjs +1 -0
- package/dist/packem_chunks/SchemaViewer.mjs +1 -0
- package/dist/packem_chunks/SecurityAdvisorPanel.mjs +1 -0
- package/dist/packem_chunks/SettingsPanel.mjs +1 -0
- package/dist/packem_chunks/SqlEditorPanel.mjs +10 -0
- package/dist/packem_chunks/TableEditor.mjs +1 -0
- package/dist/packem_chunks/agents-panel.mjs +1 -0
- package/dist/packem_chunks/ai-usage-panel.mjs +1 -0
- package/dist/packem_chunks/analytics-panel.mjs +1 -0
- package/dist/packem_chunks/architecture-panel.mjs +1 -0
- package/dist/packem_chunks/auth-audit-panel.mjs +1 -0
- package/dist/packem_chunks/auth-config-panel.mjs +1 -0
- package/dist/packem_chunks/auth-sessions-panel.mjs +1 -0
- package/dist/packem_chunks/containers-panel.mjs +1 -0
- package/dist/packem_chunks/dashboards-panel.mjs +1 -0
- package/dist/packem_chunks/evals-panel.mjs +1 -0
- package/dist/packem_chunks/fanout-panel.mjs +1 -0
- package/dist/packem_chunks/flags-panel.mjs +1 -0
- package/dist/packem_chunks/issues-panel.mjs +1 -0
- package/dist/packem_chunks/kv-browser.mjs +1 -0
- package/dist/packem_chunks/log-drains-panel.mjs +4 -0
- package/dist/packem_chunks/migrations-route.mjs +1 -0
- package/dist/packem_chunks/organizations-panel.mjs +1 -0
- package/dist/packem_chunks/payments-panel.mjs +1 -0
- package/dist/packem_chunks/permissions-panel.mjs +1 -0
- package/dist/packem_chunks/privacy-requests-panel.mjs +1 -0
- package/dist/packem_chunks/queues-panel.mjs +1 -0
- package/dist/packem_chunks/reactors-panel.mjs +1 -0
- package/dist/packem_chunks/rls-panel.mjs +1 -0
- package/dist/packem_chunks/schedule-panel.mjs +1 -0
- package/dist/packem_chunks/storage-rules-panel.mjs +1 -0
- package/dist/packem_chunks/subscriptions-panel.mjs +1 -0
- package/dist/packem_chunks/sync-client-panel.mjs +1 -0
- package/dist/packem_chunks/theme-indicator.mjs +1 -0
- package/dist/packem_chunks/traces-panel.mjs +1 -0
- package/dist/packem_chunks/users-panel.mjs +1 -0
- package/dist/packem_chunks/vector-browser.mjs +1 -0
- package/dist/packem_chunks/workflows-panel.mjs +1 -0
- package/dist/packem_shared/ADMIN_FUNCTIONS-B8yyk5BX.mjs +1 -0
- package/dist/packem_shared/ApiDocsPanel-B_RaW7Br.mjs +2 -0
- package/dist/packem_shared/ApiReferencePanel-u9Rrljdf.mjs +1 -0
- package/dist/packem_shared/CommandPalette-5OsK8PNe.mjs +1 -0
- package/dist/packem_shared/ConfirmButton-CIXYF6Mg.mjs +1 -0
- package/dist/packem_shared/ConnectionBadge-BfcoN-VE.mjs +1 -0
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-CG7Q45ZS.mjs +1 -0
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-D5YMT0gM.mjs +1 -0
- package/dist/packem_shared/DEFAULT_LOCALE-BQ3jRT74.mjs +1 -0
- package/dist/packem_shared/DataBrowser-Cc1qZX-4.mjs +4 -0
- package/dist/packem_shared/DataFilters--ocFTVT2.mjs +1 -0
- package/dist/packem_shared/ErrorBoundary-BWNF98VF.mjs +1 -0
- package/dist/packem_shared/GlobalDataBrowser-Hq6gTlkb.mjs +1 -0
- package/dist/packem_shared/HomePanel-DeyYLVxc.mjs +1 -0
- package/dist/packem_shared/MigrationsPanel-CMZYYcQ5.mjs +1 -0
- package/dist/packem_shared/OpenRpcReferencePanel-E9cDfHRv.mjs +1 -0
- package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.mjs +1 -0
- package/dist/packem_shared/ScheduledJobs-D4CUj7aX.mjs +1 -0
- package/dist/packem_shared/ShardInput-CoySruKZ.mjs +1 -0
- package/dist/packem_shared/Studio-BhTqTeGb.mjs +1 -0
- package/dist/packem_shared/StudioApp-B1d0beD4.mjs +1 -0
- package/dist/packem_shared/StudioI18nProvider-CGXCPnQn.mjs +1 -0
- package/dist/packem_shared/advisor-view-fNcNYW2Q.mjs +1 -0
- package/dist/packem_shared/aggregateMetrics-DKFJc-o5.mjs +1 -0
- package/dist/packem_shared/alert-PB5W11MM.mjs +1 -0
- package/dist/packem_shared/app.d-D425h1XO.d.mts +352 -0
- package/dist/packem_shared/app.d-D425h1XO.d.ts +352 -0
- package/dist/packem_shared/auth-pager-DW77WeZw.mjs +1 -0
- package/dist/packem_shared/badge-r_5B4LHP.mjs +1 -0
- package/dist/packem_shared/bar-chart-BCsEIQoQ.mjs +6 -0
- package/dist/packem_shared/browser-storage-BH1MxLZs.mjs +1 -0
- package/dist/packem_shared/button-q0UYSmrn.mjs +1 -0
- package/dist/packem_shared/card-By2O8ULa.mjs +1 -0
- package/dist/packem_shared/cf-links-CBJ5SywP.mjs +1 -0
- package/dist/packem_shared/checkbox-CnS9cyCz.mjs +1 -0
- package/dist/packem_shared/control-button-BOZ5K-FC.mjs +1 -0
- package/dist/packem_shared/data-grid-r3isM8Nq.mjs +1 -0
- package/dist/packem_shared/data-view-params-C-_G-biH.mjs +1 -0
- package/dist/packem_shared/diagram-export-panel-aBDQdX4e.mjs +2 -0
- package/dist/packem_shared/dropdown-menu-jLZenfWH.mjs +2 -0
- package/dist/packem_shared/empty-state-D7jEML_T.mjs +1 -0
- package/dist/packem_shared/error-alert-54TiaMvZ.mjs +1 -0
- package/dist/packem_shared/grid-features-2c5SaBtH.mjs +6 -0
- package/dist/packem_shared/grid-pagination-DY2erU65.mjs +1 -0
- package/dist/packem_shared/home-panel-0XMGe1hP.mjs +3 -0
- package/dist/packem_shared/input-CXhxesPC.mjs +1 -0
- package/dist/packem_shared/internal-BXEjuLPN.mjs +2 -0
- package/dist/packem_shared/label-DKFzyHq6.mjs +1 -0
- package/dist/packem_shared/live-status-D1GasNsH.mjs +1 -0
- package/dist/packem_shared/log-fields-BolUoZ9g.mjs +1 -0
- package/dist/packem_shared/log-line-BWDt_F56.mjs +1 -0
- package/dist/packem_shared/metrics-format-1sNGG47R.mjs +1 -0
- package/dist/packem_shared/modal-shell-CDztwLnv.mjs +1 -0
- package/dist/packem_shared/operation-console-provider-DoloEvon.mjs +1 -0
- package/dist/packem_shared/recording-client-MbGZ28I0.mjs +1 -0
- package/dist/packem_shared/reference-view-DCEC5kjY.mjs +13 -0
- package/dist/packem_shared/schema-diagram-k7cFl7Wp.mjs +2 -0
- package/dist/packem_shared/scroll-area-CXCQH7VT.mjs +2 -0
- package/dist/packem_shared/select-DPyS18Vy.mjs +2 -0
- package/dist/packem_shared/shard-history-CaO3C4KQ.mjs +1 -0
- package/dist/packem_shared/shortcuts-B9gDaXmw.mjs +1 -0
- package/dist/packem_shared/skeleton-DX1gfixl.mjs +1 -0
- package/dist/packem_shared/sparkline-B_sPPO_8.mjs +1 -0
- package/dist/packem_shared/sql-result-table-CatgdmMh.mjs +1 -0
- package/dist/packem_shared/stat-card-BAv73QtB.mjs +1 -0
- package/dist/packem_shared/storage-tier-C2mKwYRj.mjs +1 -0
- package/dist/packem_shared/studio-CA3ZKwVK.mjs +2 -0
- package/dist/packem_shared/table-D0SBiDu-.mjs +2 -0
- package/dist/packem_shared/table-list-sidebar-nA7g7uSk.mjs +1 -0
- package/dist/packem_shared/textarea--40GKAyz.mjs +1 -0
- package/dist/packem_shared/trace-handoff-BV3EWqy_.mjs +1 -0
- package/dist/packem_shared/use-admin-query-BW9IuacC.mjs +1 -0
- package/dist/packem_shared/use-admin-spec-BdNLZbTO.mjs +1 -0
- package/dist/packem_shared/use-async-submit-2eBBD0-m.mjs +1 -0
- package/dist/packem_shared/use-auth-config-KO9tnI39.mjs +1 -0
- package/dist/packem_shared/use-mirrored-ref-CVDf2z1M.mjs +1 -0
- package/dist/packem_shared/use-open-trace-B_0LbTD7.mjs +1 -0
- package/dist/packem_shared/use-shard-key-BsP3o5wT.mjs +1 -0
- package/dist/packem_shared/use-sql-assistant-DXnqbBs-.mjs +1 -0
- package/dist/packem_shared/use-studio-client-DCA50tF2.mjs +1 -0
- package/dist/packem_shared/useDebounced-DVeQ5-oW.mjs +1 -0
- package/dist/packem_shared/utils-bhneXptQ.mjs +1 -0
- package/dist/packem_shared/virtual-rect-D_j7aLxX.mjs +1 -0
- package/dist/standalone/chunk-26OKWFLO.js +1 -0
- package/dist/standalone/chunk-2EL4EMYZ.js +1 -0
- package/dist/standalone/chunk-2O6KKVH2.js +1 -0
- package/dist/standalone/chunk-2WNL74MI.js +4 -0
- package/dist/standalone/chunk-2X6O33OX.js +1 -0
- package/dist/standalone/chunk-2ZO7XY3Z.js +1 -0
- package/dist/standalone/chunk-3GXPALXG.js +1 -0
- package/dist/standalone/chunk-3Y5K3IQO.js +1 -0
- package/dist/standalone/chunk-4C4THJUD.js +1 -0
- package/dist/standalone/chunk-4IEMXFUB.js +1 -0
- package/dist/standalone/chunk-4SQBAPY6.js +1 -0
- package/dist/standalone/chunk-4ZEL6BYL.js +1 -0
- package/dist/standalone/chunk-5DNGK3NT.js +1 -0
- package/dist/standalone/chunk-5J32EGHF.js +1 -0
- package/dist/standalone/chunk-5NZWQEEJ.js +1 -0
- package/dist/standalone/chunk-6I42AM75.js +1 -0
- package/dist/standalone/chunk-6M7FLLMT.js +1 -0
- package/dist/standalone/chunk-6QEXGYWH.js +1 -0
- package/dist/standalone/chunk-7AZYREIY.js +1 -0
- package/dist/standalone/chunk-7F3S5OQT.js +1 -0
- package/dist/standalone/chunk-7MN724WR.js +1 -0
- package/dist/standalone/chunk-7RGYCU6F.js +1 -0
- package/dist/standalone/chunk-A566HCBX.js +1 -0
- package/dist/standalone/chunk-AOHKAKKL.js +1 -0
- package/dist/standalone/chunk-AP4PC2M4.js +1 -0
- package/dist/standalone/chunk-B3AXFXAD.js +1 -0
- package/dist/standalone/chunk-B7MHW3A5.js +1 -0
- package/dist/standalone/chunk-BHOLL76W.js +8 -0
- package/dist/standalone/chunk-BTRYFPZH.js +1 -0
- package/dist/standalone/chunk-BVKQA5OL.js +1 -0
- package/dist/standalone/chunk-CGZVMM3P.js +1 -0
- package/dist/standalone/chunk-CIVMATZK.js +3 -0
- package/dist/standalone/chunk-CLINNLLE.js +1 -0
- package/dist/standalone/chunk-CTE6RPXC.js +1 -0
- package/dist/standalone/chunk-CW57Q264.js +1 -0
- package/dist/standalone/chunk-D7JK65OK.js +1 -0
- package/dist/standalone/chunk-DBVJ5VLI.js +1 -0
- package/dist/standalone/chunk-DS7HZKZ2.js +6 -0
- package/dist/standalone/chunk-DX55P3KZ.js +1 -0
- package/dist/standalone/chunk-E26OT26O.js +1 -0
- package/dist/standalone/chunk-E32FS6PE.js +5 -0
- package/dist/standalone/chunk-E3VSRIQU.js +1 -0
- package/dist/standalone/chunk-EDGOSJXL.js +1 -0
- package/dist/standalone/chunk-EOR73TZZ.js +1 -0
- package/dist/standalone/chunk-F5LTDUMB.js +1 -0
- package/dist/standalone/chunk-FLVDICZL.js +1 -0
- package/dist/standalone/chunk-FPIUVV7Q.js +1 -0
- package/dist/standalone/chunk-GMW2DYFU.js +1 -0
- package/dist/standalone/chunk-GPOSJNMV.js +14 -0
- package/dist/standalone/chunk-GQYA5W5T.js +1 -0
- package/dist/standalone/chunk-HFYFYNSX.js +1 -0
- package/dist/standalone/chunk-HKLF627N.js +1 -0
- package/dist/standalone/chunk-HKPDPKXD.js +1 -0
- package/dist/standalone/chunk-HLAAOW33.js +1 -0
- package/dist/standalone/chunk-HOPAJ5F6.js +15 -0
- package/dist/standalone/chunk-IBJVVHV5.js +1 -0
- package/dist/standalone/chunk-IH2CJZF2.js +1 -0
- package/dist/standalone/chunk-JAHK7RRJ.js +1 -0
- package/dist/standalone/chunk-JG2C7SS2.js +1 -0
- package/dist/standalone/chunk-JGMQQ3S7.js +1 -0
- package/dist/standalone/chunk-JTGGWF7R.js +1 -0
- package/dist/standalone/chunk-KFNDET5D.js +1 -0
- package/dist/standalone/chunk-KRPXOSBL.js +1 -0
- package/dist/standalone/chunk-KYONGQQ4.js +1 -0
- package/dist/standalone/chunk-LIGOLZND.js +1 -0
- package/dist/standalone/chunk-LKCO3E2B.js +1 -0
- package/dist/standalone/chunk-LOV52GLG.js +1 -0
- package/dist/standalone/chunk-LPINY2IJ.js +19 -0
- package/dist/standalone/chunk-LRXCL6IA.js +1 -0
- package/dist/standalone/chunk-LUHXNZI4.js +2 -0
- package/dist/standalone/chunk-MD67S53Z.js +1 -0
- package/dist/standalone/chunk-MDAXV2XH.js +4 -0
- package/dist/standalone/chunk-MFNO5BFR.js +8 -0
- package/dist/standalone/chunk-MMJTKSHL.js +1 -0
- package/dist/standalone/chunk-NGVP66OH.js +1 -0
- package/dist/standalone/chunk-NMVFSJM7.js +1 -0
- package/dist/standalone/chunk-NVHHB5EV.js +2 -0
- package/dist/standalone/chunk-O3FDK56W.js +1 -0
- package/dist/standalone/chunk-OECMBE6Q.js +1 -0
- package/dist/standalone/chunk-OSJ7HV7B.js +1 -0
- package/dist/standalone/chunk-OUFWXYEF.js +1 -0
- package/dist/standalone/chunk-OXFKZ4BM.js +1 -0
- package/dist/standalone/chunk-P5GAJKDW.js +1 -0
- package/dist/standalone/chunk-P6L6ABWO.js +1 -0
- package/dist/standalone/chunk-PZZWUL5U.js +1 -0
- package/dist/standalone/chunk-QAQVT4FS.js +1 -0
- package/dist/standalone/chunk-R36QXQZX.js +1 -0
- package/dist/standalone/chunk-R3KLR5EP.js +1 -0
- package/dist/standalone/chunk-RXVXXRYD.js +1 -0
- package/dist/standalone/chunk-S7XAAH7U.js +1 -0
- package/dist/standalone/chunk-SDQH4HR6.js +3 -0
- package/dist/standalone/chunk-SFY646MC.js +1 -0
- package/dist/standalone/chunk-SJLEEYCR.js +1 -0
- package/dist/standalone/chunk-SLIDAWNX.js +1 -0
- package/dist/standalone/chunk-SOO2HXV6.js +1 -0
- package/dist/standalone/chunk-SXD6JQXF.js +1 -0
- package/dist/standalone/{chunk-BJGBHGK3.js → chunk-SYGCASPT.js} +1 -1
- package/dist/standalone/chunk-TDVDZ7XQ.js +1 -0
- package/dist/standalone/chunk-TRZTGE4R.js +1 -0
- package/dist/standalone/chunk-TWMS2TMF.js +1 -0
- package/dist/standalone/chunk-U76DVXTR.js +21 -0
- package/dist/standalone/chunk-UTX6IBA3.js +1 -0
- package/dist/standalone/chunk-UYEZR3BI.js +1 -0
- package/dist/standalone/chunk-UZIBQZ2F.js +1 -0
- package/dist/standalone/chunk-VB6YJKPA.js +1 -0
- package/dist/standalone/chunk-VEWQWS3J.js +1 -0
- package/dist/standalone/chunk-W2BCSK5S.js +1 -0
- package/dist/standalone/chunk-W2XSKODB.js +1 -0
- package/dist/standalone/chunk-W7MRISE3.js +1 -0
- package/dist/standalone/chunk-W7Z35E2E.js +1 -0
- package/dist/standalone/chunk-WIET27J3.js +1 -0
- package/dist/standalone/chunk-WQGT24W6.js +1 -0
- package/dist/standalone/chunk-WS36BO4R.js +1 -0
- package/dist/standalone/chunk-WZTY3ZYI.js +1 -0
- package/dist/standalone/chunk-X5KWBDTF.js +1 -0
- package/dist/standalone/chunk-X74GEPSG.js +1 -0
- package/dist/standalone/chunk-XBZUJDHD.js +1 -0
- package/dist/standalone/chunk-XMEVNOCA.js +1 -0
- package/dist/standalone/chunk-XWEDIIIT.js +1 -0
- package/dist/standalone/chunk-XYR5NST4.js +1 -0
- package/dist/standalone/chunk-YHTHRYP5.js +1 -0
- package/dist/standalone/chunk-YJ2WHOGO.js +1 -0
- package/dist/standalone/chunk-YJWR6ZWC.js +1 -0
- package/dist/standalone/chunk-Z5EV64KS.js +1 -0
- package/dist/standalone/chunk-ZBFWT34B.js +59 -0
- package/dist/standalone/chunk-ZBON5T5A.js +1 -0
- package/dist/standalone/chunk-ZGSL4DPP.js +1 -0
- package/dist/standalone/chunk-ZMQ6PKLN.js +1 -0
- package/dist/standalone/chunk-ZTOREMGH.js +1 -0
- package/dist/standalone/chunk-ZTOXQK4V.js +1 -0
- package/dist/standalone/chunk-ZWDORIZY.js +1 -0
- package/dist/standalone/chunk-ZZAJHNZ6.js +1 -0
- package/dist/standalone/studio.js +9 -214
- package/dist/styles.css +2 -2
- package/package.json +26 -22
- package/dist/index.js +0 -41
- package/dist/mount.js +0 -27
- package/dist/packem_chunks/ApiTab.js +0 -251
- package/dist/packem_chunks/AuditPanel.js +0 -200
- package/dist/packem_chunks/ExportImportPanel.js +0 -198
- package/dist/packem_chunks/FileBrowser.js +0 -2932
- package/dist/packem_chunks/FunctionRunner.js +0 -343
- package/dist/packem_chunks/FunctionStatsPanel.js +0 -377
- package/dist/packem_chunks/HealthPanel.js +0 -648
- package/dist/packem_chunks/InsightsPanel.js +0 -462
- package/dist/packem_chunks/LogsPanel.js +0 -827
- package/dist/packem_chunks/MailPanel.js +0 -353
- package/dist/packem_chunks/MetricsPanel.js +0 -1344
- package/dist/packem_chunks/MigrationsPanel.js +0 -239
- package/dist/packem_chunks/PitrPanel.js +0 -252
- package/dist/packem_chunks/SchemaViewer.js +0 -2513
- package/dist/packem_chunks/SecurityAdvisorPanel.js +0 -95
- package/dist/packem_chunks/SettingsPanel.js +0 -391
- package/dist/packem_chunks/SqlEditorPanel.js +0 -2323
- package/dist/packem_chunks/TableEditor.js +0 -313
- package/dist/packem_chunks/analytics-panel.js +0 -261
- package/dist/packem_chunks/auth-config-panel.js +0 -179
- package/dist/packem_chunks/auth-sessions-panel.js +0 -175
- package/dist/packem_chunks/containers-panel.js +0 -247
- package/dist/packem_chunks/dashboards-panel.js +0 -780
- package/dist/packem_chunks/fanout-panel.js +0 -482
- package/dist/packem_chunks/flags-panel.js +0 -176
- package/dist/packem_chunks/kv-browser.js +0 -1896
- package/dist/packem_chunks/log-drains-panel.js +0 -273
- package/dist/packem_chunks/organizations-panel.js +0 -670
- package/dist/packem_chunks/payments-panel.js +0 -186
- package/dist/packem_chunks/permissions-panel.js +0 -805
- package/dist/packem_chunks/queues-panel.js +0 -1052
- package/dist/packem_chunks/rls-panel.js +0 -315
- package/dist/packem_chunks/schedule-panel.js +0 -831
- package/dist/packem_chunks/sparkline.js +0 -79
- package/dist/packem_chunks/storage-rules-panel.js +0 -140
- package/dist/packem_chunks/subscriptions-panel.js +0 -238
- package/dist/packem_chunks/users-panel.js +0 -1265
- package/dist/packem_chunks/vector-browser.js +0 -281
- package/dist/packem_chunks/workflows-panel.js +0 -562
- package/dist/packem_shared/ADMIN_FUNCTIONS-BHHJi3Gb.js +0 -52
- package/dist/packem_shared/ApiDocsPanel-D4CJf2ad.js +0 -842
- package/dist/packem_shared/ApiReferencePanel-Co_wpRF2.js +0 -230
- package/dist/packem_shared/CommandPalette-BUPpbpMc.js +0 -373
- package/dist/packem_shared/ConfirmButton-C2eVi2Qv.js +0 -59
- package/dist/packem_shared/ConnectionBadge-B2DDM2Tn.js +0 -111
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js +0 -50
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js +0 -89
- package/dist/packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js +0 -27
- package/dist/packem_shared/DataBrowser-BeVNxSVm.js +0 -4493
- package/dist/packem_shared/DataFilters-FNquMaiu.js +0 -249
- package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +0 -66
- package/dist/packem_shared/GlobalDataBrowser-ErfvIs1S.js +0 -289
- package/dist/packem_shared/HomePanel-D9MQk8I7.js +0 -14
- package/dist/packem_shared/OpenRpcReferencePanel-DLWzrIx9.js +0 -192
- package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
- package/dist/packem_shared/ScheduledJobs-ClaNpZsg.js +0 -262
- package/dist/packem_shared/ShardInput-gx_DZXXn.js +0 -107
- package/dist/packem_shared/Studio-C48P1K5W.js +0 -16
- package/dist/packem_shared/StudioApp-Cqh-SYm2.js +0 -657
- package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
- package/dist/packem_shared/advisor-view-D3-U4kRR.js +0 -159
- package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +0 -108
- package/dist/packem_shared/alert-CdAET2K_.js +0 -68
- package/dist/packem_shared/app.d-CNLRTrWw.d.ts +0 -300
- package/dist/packem_shared/badge-B2PKA1-5.js +0 -49
- package/dist/packem_shared/bar-chart-DSwcWIRy.js +0 -3246
- package/dist/packem_shared/browser-storage-tLOxkIHd.js +0 -185
- package/dist/packem_shared/button-BhsN2uZH.js +0 -49
- package/dist/packem_shared/card-DURq3ElK.js +0 -175
- package/dist/packem_shared/cf-links-BZfRdxSE.js +0 -8
- package/dist/packem_shared/checkbox-UNkzAxl-.js +0 -63
- package/dist/packem_shared/data-grid-Jz8FqQ2C.js +0 -183
- package/dist/packem_shared/data-view-params-Cd6yRVbv.js +0 -96
- package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +0 -280
- package/dist/packem_shared/empty-state-DY_oe0k6.js +0 -98
- package/dist/packem_shared/error-alert-BBT6D22d.js +0 -114
- package/dist/packem_shared/grid-features-CUr8Z1_O.js +0 -745
- package/dist/packem_shared/home-panel-CoGxi-oj.js +0 -1639
- package/dist/packem_shared/input-XH4r1Pt1.js +0 -53
- package/dist/packem_shared/internal-DTsYVn-g.js +0 -97
- package/dist/packem_shared/label-D8ykjn5J.js +0 -46
- package/dist/packem_shared/live-status-FZ0psC1z.js +0 -44
- package/dist/packem_shared/modal-shell-hyaJvIJ6.js +0 -100
- package/dist/packem_shared/reference-view-CSKyUyPl.js +0 -2141
- package/dist/packem_shared/scroll-area-DLhcy-ml.js +0 -93
- package/dist/packem_shared/select-UkNYCT3s.js +0 -273
- package/dist/packem_shared/shard-history-DyebH1R5.js +0 -38
- package/dist/packem_shared/skeleton-CGhL0p20.js +0 -45
- package/dist/packem_shared/sparkline-BnA1kC9X.js +0 -93
- package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
- package/dist/packem_shared/studio-CPHA_-3I.js +0 -4015
- package/dist/packem_shared/table-DsCa9Qp9.js +0 -246
- package/dist/packem_shared/table-list-sidebar-B5psdSV1.js +0 -832
- package/dist/packem_shared/textarea-D3gaCU_-.js +0 -46
- package/dist/packem_shared/use-admin-query-BHPKmPuj.js +0 -106
- package/dist/packem_shared/use-auth-capabilities-C-VH0oJJ.js +0 -32
- package/dist/packem_shared/useDebounced-Dxncpg6z.js +0 -32
- package/dist/packem_shared/utils-B05Dmz_H.js +0 -8
- package/dist/packem_shared/virtual-rect-CVMUskSm.js +0 -10
- package/dist/standalone/chunk-25VHPD2I.js +0 -1
- package/dist/standalone/chunk-2GGMGPEP.js +0 -1
- package/dist/standalone/chunk-2K47A3P6.js +0 -1
- package/dist/standalone/chunk-2NGUNNGW.js +0 -1
- package/dist/standalone/chunk-3CJW6NWG.js +0 -4
- package/dist/standalone/chunk-3OA7PECS.js +0 -6
- package/dist/standalone/chunk-46K3NKPA.js +0 -1
- package/dist/standalone/chunk-474C2O7W.js +0 -1
- package/dist/standalone/chunk-4H2OJBXO.js +0 -1
- package/dist/standalone/chunk-4QHKBC77.js +0 -1
- package/dist/standalone/chunk-55YA7ZZI.js +0 -76
- package/dist/standalone/chunk-5OH3VPZF.js +0 -1
- package/dist/standalone/chunk-5OIBXYZM.js +0 -1
- package/dist/standalone/chunk-6GFEVKJP.js +0 -1
- package/dist/standalone/chunk-6UGM5IHN.js +0 -4
- package/dist/standalone/chunk-6WRZP62V.js +0 -1
- package/dist/standalone/chunk-764T6X6X.js +0 -1
- package/dist/standalone/chunk-7TJJXVSE.js +0 -1
- package/dist/standalone/chunk-7VF3IAAW.js +0 -2
- package/dist/standalone/chunk-7WNJ4Q7Z.js +0 -8
- package/dist/standalone/chunk-AHILM3ZP.js +0 -1
- package/dist/standalone/chunk-AJIUI7DD.js +0 -1
- package/dist/standalone/chunk-BACPICH6.js +0 -1
- package/dist/standalone/chunk-BI35RXKQ.js +0 -1
- package/dist/standalone/chunk-BOXSWNXZ.js +0 -1
- package/dist/standalone/chunk-BQUQS7QN.js +0 -1
- package/dist/standalone/chunk-CKSHCYGC.js +0 -2
- package/dist/standalone/chunk-DORBUITF.js +0 -1
- package/dist/standalone/chunk-DVC6YWVP.js +0 -1
- package/dist/standalone/chunk-DVKPRFIJ.js +0 -1
- package/dist/standalone/chunk-DWDILV2E.js +0 -1
- package/dist/standalone/chunk-DWTBY343.js +0 -1
- package/dist/standalone/chunk-EIQW6ACH.js +0 -1
- package/dist/standalone/chunk-EUIHTPKI.js +0 -1
- package/dist/standalone/chunk-FCSPAJW4.js +0 -1
- package/dist/standalone/chunk-FKO3HO6I.js +0 -4
- package/dist/standalone/chunk-GMSGZDDH.js +0 -13
- package/dist/standalone/chunk-GTM65MVX.js +0 -1
- package/dist/standalone/chunk-HV7G6DFP.js +0 -5
- package/dist/standalone/chunk-ILCTSAOB.js +0 -1
- package/dist/standalone/chunk-IODYGARQ.js +0 -1
- package/dist/standalone/chunk-J6J54MBP.js +0 -1
- package/dist/standalone/chunk-JE2YOAB7.js +0 -4
- package/dist/standalone/chunk-JFSZIUZT.js +0 -4
- package/dist/standalone/chunk-JSEXCW5Q.js +0 -1
- package/dist/standalone/chunk-K3GNLVYK.js +0 -1
- package/dist/standalone/chunk-KEGAWN6Y.js +0 -1
- package/dist/standalone/chunk-KZ6INM5M.js +0 -1
- package/dist/standalone/chunk-LD2R263D.js +0 -1
- package/dist/standalone/chunk-LI43EKM6.js +0 -1
- package/dist/standalone/chunk-M55U7NHO.js +0 -1
- package/dist/standalone/chunk-MPTM7ZU3.js +0 -3
- package/dist/standalone/chunk-MPYFGAOW.js +0 -1
- package/dist/standalone/chunk-NJFMWO6P.js +0 -1
- package/dist/standalone/chunk-O3NAGRTR.js +0 -1
- package/dist/standalone/chunk-O77VNUFD.js +0 -1
- package/dist/standalone/chunk-OCHNCAXJ.js +0 -1
- package/dist/standalone/chunk-PACH5AHG.js +0 -1
- package/dist/standalone/chunk-PN5NCZDX.js +0 -1
- package/dist/standalone/chunk-PVZI3CXP.js +0 -19
- package/dist/standalone/chunk-PZ7HD5T2.js +0 -1
- package/dist/standalone/chunk-QAFAJBAW.js +0 -1
- package/dist/standalone/chunk-QBAT52GB.js +0 -1
- package/dist/standalone/chunk-QLM6FYZW.js +0 -2
- package/dist/standalone/chunk-RRAFQ5G2.js +0 -1
- package/dist/standalone/chunk-RRCPZMC2.js +0 -22
- package/dist/standalone/chunk-RSEEHNFI.js +0 -1
- package/dist/standalone/chunk-SEU5V7I6.js +0 -1
- package/dist/standalone/chunk-SLKF2L74.js +0 -1
- package/dist/standalone/chunk-SVR644RF.js +0 -1
- package/dist/standalone/chunk-TAD43CG5.js +0 -1
- package/dist/standalone/chunk-TBMYIZIO.js +0 -1
- package/dist/standalone/chunk-TDL7NEWA.js +0 -1
- package/dist/standalone/chunk-TO4JQX7W.js +0 -1
- package/dist/standalone/chunk-TQ36RWOP.js +0 -1
- package/dist/standalone/chunk-U4OAQPBT.js +0 -1
- package/dist/standalone/chunk-UII66UVF.js +0 -1
- package/dist/standalone/chunk-UK64ZSUW.js +0 -1
- package/dist/standalone/chunk-VLXV72QE.js +0 -1
- package/dist/standalone/chunk-VSHUSN6T.js +0 -1
- package/dist/standalone/chunk-VTGBPW24.js +0 -1
- package/dist/standalone/chunk-WXPWVBIY.js +0 -1
- package/dist/standalone/chunk-X6F22DBL.js +0 -1
- package/dist/standalone/chunk-X7MMBSNW.js +0 -1
- package/dist/standalone/chunk-XGMIDFUK.js +0 -1
- package/dist/standalone/chunk-XNJNSCLM.js +0 -1
- package/dist/standalone/chunk-XUGSA2NG.js +0 -1
- package/dist/standalone/chunk-XZE2RNDA.js +0 -1
- package/dist/standalone/chunk-Y2ZPNDL7.js +0 -4
- package/dist/standalone/chunk-YAECF5LW.js +0 -1
- package/dist/standalone/chunk-YEVCU7TB.js +0 -13
- package/dist/standalone/chunk-YV43BOP7.js +0 -1
- package/dist/standalone/chunk-ZHVTQ37P.js +0 -1
- package/dist/standalone/chunk-ZPP2KOR4.js +0 -1
- package/dist/standalone/chunk-ZPUO7FNI.js +0 -1
- package/dist/standalone/chunk-ZU4DZ6NK.js +0 -1
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import { LunoraAdminClient } from '@lunora/client/admin';
|
|
2
|
+
import { ReactElement } from 'react';
|
|
3
|
+
import { I18n } from '@lingui/core';
|
|
4
|
+
import { FunctionUsagePanel, AnalyticsSqlQueryResult } from '@lunora/bindings/analytics-sql';
|
|
5
|
+
import { CronJobInfo, ScheduleRecord } from '@lunora/client';
|
|
6
|
+
interface AnalyticsPanelProps {
|
|
7
|
+
/**
|
|
8
|
+
* Resolve one usage panel. The panel sends only its key; the host's runner
|
|
9
|
+
* calls an action that builds the statement server-side with
|
|
10
|
+
* `functionUsageQuery(panel)` from `@lunora/bindings/analytics-sql` and runs it
|
|
11
|
+
* through `ctx.analyticsSql`. That action reads account analytics, so it must
|
|
12
|
+
* be admin-gated, and it must take the panel key, never SQL: an action that
|
|
13
|
+
* ran caller-supplied SQL could read every dataset in the account. Studio passes
|
|
14
|
+
* its analyticsSqlQuery prop through here; with none, the panel renders an empty
|
|
15
|
+
* state and makes no network call.
|
|
16
|
+
*/
|
|
17
|
+
readonly runQuery?: (panel: FunctionUsagePanel) => Promise<AnalyticsSqlQueryResult>;
|
|
18
|
+
}
|
|
19
|
+
interface CronTriggersPanelProps {
|
|
20
|
+
/**
|
|
21
|
+
* Load the code-defined cron triggers. Defaults to `client.getCronJobs`,
|
|
22
|
+
* which hits the worker's admin-gated `/_lunora/admin/cron-jobs` endpoint —
|
|
23
|
+
* so the panel works out of the box under `<LunoraProvider>`, provided the
|
|
24
|
+
* worker is built with a `cronJobs` map and `adminToken`. Override it to
|
|
25
|
+
* source triggers from elsewhere (e.g. tests).
|
|
26
|
+
*/
|
|
27
|
+
readonly loadCronJobs?: () => Promise<CronJobInfo[]>;
|
|
28
|
+
/**
|
|
29
|
+
* Manually fire one cron job by name. Defaults to `client.runCronJob`, which
|
|
30
|
+
* hits the admin-gated `POST /_lunora/admin/cron-jobs/run` endpoint (the same
|
|
31
|
+
* dispatch the scheduled trigger runs). When a custom {@link CronTriggersPanelProps.loadCronJobs}
|
|
32
|
+
* is supplied without a `runCronJob`, the "Run now" control is hidden — useful
|
|
33
|
+
* for a read-only view.
|
|
34
|
+
*/
|
|
35
|
+
readonly runCronJob?: (name: string) => Promise<{
|
|
36
|
+
name: string;
|
|
37
|
+
ran: boolean;
|
|
38
|
+
}>;
|
|
39
|
+
}
|
|
40
|
+
interface ScheduledJobsProps {
|
|
41
|
+
/**
|
|
42
|
+
* Cancel a pending job by id. Defaults to `client.cancelScheduledJob` when
|
|
43
|
+
* {@link ScheduledJobsProps.loadJobs} is also left to the client. When a
|
|
44
|
+
* custom `loadJobs` is supplied without a `cancelJob`, the cancel control is
|
|
45
|
+
* hidden — useful for a read-only view.
|
|
46
|
+
*/
|
|
47
|
+
readonly cancelJob?: (id: string) => Promise<{
|
|
48
|
+
cancelled: boolean;
|
|
49
|
+
}>;
|
|
50
|
+
/**
|
|
51
|
+
* Load the pending scheduled jobs. Defaults to `client.listScheduledJobs`,
|
|
52
|
+
* which hits the worker's admin-gated `/_lunora/admin/scheduled` endpoint —
|
|
53
|
+
* so the panel works out of the box under `<LunoraProvider>`, provided the
|
|
54
|
+
* worker is built with a `schedulerDO` namespace and `adminToken`. Override
|
|
55
|
+
* it to source jobs from elsewhere.
|
|
56
|
+
*/
|
|
57
|
+
readonly loadJobs?: () => Promise<ScheduleRecord[]>;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* View — and cancel — the functions queued via `runAfter` / `runAt` on the
|
|
61
|
+
* scheduler. Cron *triggers* are static wrangler config and don't appear here;
|
|
62
|
+
* this lists the dynamic, in-flight schedule only.
|
|
63
|
+
*
|
|
64
|
+
* Works out of the box under `<LunoraProvider>` via the client's scheduler
|
|
65
|
+
* admin methods; pass {@link ScheduledJobsProps.loadJobs} /
|
|
66
|
+
* {@link ScheduledJobsProps.cancelJob} to override the transport.
|
|
67
|
+
*/
|
|
68
|
+
declare const ScheduledJobs: ({ cancelJob, loadJobs }?: ScheduledJobsProps) => ReactElement;
|
|
69
|
+
interface SchedulePanelProps {
|
|
70
|
+
/** Override how the Cron triggers sub-view loads triggers; see {@link CronTriggersPanel}. */
|
|
71
|
+
readonly loadCronJobs?: CronTriggersPanelProps["loadCronJobs"];
|
|
72
|
+
/** Override how the Scheduled jobs sub-view cancels a job; see {@link ScheduledJobs}. */
|
|
73
|
+
readonly scheduledCancel?: ScheduledJobsProps["cancelJob"];
|
|
74
|
+
/** Override how the Scheduled jobs sub-view loads jobs; see {@link ScheduledJobs}. */
|
|
75
|
+
readonly scheduledLoad?: ScheduledJobsProps["loadJobs"];
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The statuses a privacy request moves through, and which of them are terminal.
|
|
79
|
+
*
|
|
80
|
+
* `@lunora/privacy` stores them and the Studio's Privacy requests page renders them.
|
|
81
|
+
* The Studio must not depend on the runtime package, so both read the list from here
|
|
82
|
+
* and the bundler inlines it into each. A status added here reaches both, and the
|
|
83
|
+
* Studio's exhaustive badge map fails to compile until it has a variant.
|
|
84
|
+
*/
|
|
85
|
+
/** Every status, in lifecycle order. */
|
|
86
|
+
declare const REQUEST_STATUSES: readonly ["received", "grace", "processing", "ready", "completed", "failed", "cancelled", "expired"];
|
|
87
|
+
type RequestStatus = (typeof REQUEST_STATUSES)[number];
|
|
88
|
+
type RequestType = "erasure" | "export";
|
|
89
|
+
/**
|
|
90
|
+
* Timestamps are epoch milliseconds. `extendedDueAt` is set only when the deadline was extended, so
|
|
91
|
+
* the effective deadline is `extendedDueAt ?? dueAt`.
|
|
92
|
+
*/
|
|
93
|
+
interface PrivacyRequestRow {
|
|
94
|
+
readonly dueAt: number;
|
|
95
|
+
readonly extendedDueAt?: null | number;
|
|
96
|
+
readonly id: string;
|
|
97
|
+
readonly receivedAt: number;
|
|
98
|
+
readonly status: RequestStatus;
|
|
99
|
+
readonly subjectId: string;
|
|
100
|
+
readonly type: RequestType;
|
|
101
|
+
}
|
|
102
|
+
/** What the Studio's Privacy requests page reads and writes. */
|
|
103
|
+
interface PrivacyRequestsSource {
|
|
104
|
+
/** The open requests, in any order; the page sorts nothing. */
|
|
105
|
+
listOpenPrivacyRequests: () => Promise<ReadonlyArray<PrivacyRequestRow>>;
|
|
106
|
+
/** Re-run a failed request. Rejects with the server's message on failure. */
|
|
107
|
+
retryPrivacyRequest: (id: string) => Promise<unknown>;
|
|
108
|
+
}
|
|
109
|
+
/** Which client method a {@link FunctionDescriptor} is invoked through. */
|
|
110
|
+
type FunctionKind = "action" | "mutation" | "query";
|
|
111
|
+
/**
|
|
112
|
+
* One argument of a registered function, derived from its `v.*` validator by the
|
|
113
|
+
* worker's `/_lunora/admin/functions` endpoint. A compact signature shape.
|
|
114
|
+
*/
|
|
115
|
+
interface FunctionArgumentDescriptor {
|
|
116
|
+
/** Element validator kind for an `array` arg (one level), e.g. `string`. */
|
|
117
|
+
element?: string;
|
|
118
|
+
/** The (optional-unwrapped) validator kind, e.g. `string`, `id`, `object`. */
|
|
119
|
+
kind: string;
|
|
120
|
+
/** The argument name. */
|
|
121
|
+
name: string;
|
|
122
|
+
/** True when the arg is wrapped in `v.optional(...)`. */
|
|
123
|
+
optional: boolean;
|
|
124
|
+
/** True when the arg is marked `v.sensitive`: its value is never kept in run history. */
|
|
125
|
+
sensitive?: true;
|
|
126
|
+
/** Target table for an `id` arg (`v.id("table")`). */
|
|
127
|
+
table?: string;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Runtime descriptor for a registered Lunora function. The function's `kind` is
|
|
131
|
+
* a compile-time-only phantom on `FunctionReference`, so the runner needs it
|
|
132
|
+
* spelled out here to know which client method to call. `args` carries the
|
|
133
|
+
* function's argument signature (absent on responses from an older worker).
|
|
134
|
+
*/
|
|
135
|
+
interface FunctionDescriptor {
|
|
136
|
+
args?: FunctionArgumentDescriptor[];
|
|
137
|
+
kind: FunctionKind;
|
|
138
|
+
/** The `<file>:<function>` identifier, e.g. `messages:list`. */
|
|
139
|
+
path: string;
|
|
140
|
+
}
|
|
141
|
+
/** Outcome of a single `FunctionRunner` invocation. */
|
|
142
|
+
type RunStatus = "error" | "idle" | "running" | "success";
|
|
143
|
+
interface StudioProps {
|
|
144
|
+
/**
|
|
145
|
+
* Resolve one Analytics tab panel by its key (`"volume"`, `"latency"`,
|
|
146
|
+
* `"hotShards"`). Supply a runner that calls an action in your app which
|
|
147
|
+
* builds the statement server-side and runs it through `ctx.analyticsSql`:
|
|
148
|
+
*
|
|
149
|
+
* ```ts
|
|
150
|
+
* // lunora/studio-analytics.ts
|
|
151
|
+
* export const usagePanel = action.input({ panel: v.string() }).action(async ({ args, ctx }) => {
|
|
152
|
+
* assertAdmin(ctx); // your own admin check: this reads account analytics
|
|
153
|
+
* if (!isFunctionUsagePanel(args.panel)) throw new LunoraError("BAD_REQUEST", "unknown panel");
|
|
154
|
+
* const { params, query } = functionUsageQuery(args.panel);
|
|
155
|
+
* return ctx.analyticsSql.query(query, params);
|
|
156
|
+
* });
|
|
157
|
+
* ```
|
|
158
|
+
*
|
|
159
|
+
* The action MUST be admin-gated and MUST take the panel key, never SQL: an
|
|
160
|
+
* action running caller-supplied SQL could read every dataset in the account.
|
|
161
|
+
* Without a runner the Analytics tab renders an empty state and issues no
|
|
162
|
+
* request.
|
|
163
|
+
*
|
|
164
|
+
* Pass a STABLE reference — a module-level function, or one held in a
|
|
165
|
+
* `useCallback`/ref. It is read while building the tab router, so a fresh
|
|
166
|
+
* inline arrow on every render rebuilds the router and remounts the panel
|
|
167
|
+
* tree, losing in-progress query state. The same holds for `scheduledLoad`,
|
|
168
|
+
* `scheduledCancel` and `scheduledCron`.
|
|
169
|
+
*/
|
|
170
|
+
readonly analyticsSqlQuery?: AnalyticsPanelProps["runQuery"];
|
|
171
|
+
/**
|
|
172
|
+
* URL path prefix the studio is mounted under, passed to the router as its
|
|
173
|
+
* `basepath`. Defaults to `/` (mounted at the origin root). The `@lunora/vite`
|
|
174
|
+
* dev route serves the studio under `/__lunora`, so it sets this — without
|
|
175
|
+
* it the router treats `/__lunora` as unknown and bounces to `/data`, escaping
|
|
176
|
+
* the mount.
|
|
177
|
+
*/
|
|
178
|
+
readonly basePath?: string;
|
|
179
|
+
/**
|
|
180
|
+
* App-owned top-bar + sidebar-footer chrome (theme toggle, admin-token
|
|
181
|
+
* popover, rules banner). The batteries-included `StudioApp` supplies
|
|
182
|
+
* this; composing `<Studio>` bare omits those affordances. See {@link StudioChrome}.
|
|
183
|
+
*/
|
|
184
|
+
readonly chrome?: StudioChrome;
|
|
185
|
+
/**
|
|
186
|
+
* Show the data tab's write controls (insert/edit/delete rows). Off by
|
|
187
|
+
* default; see {@link TableEditor}.
|
|
188
|
+
*
|
|
189
|
+
* **This HIDES THE CONTROLS. It does not make anything read-only.** The
|
|
190
|
+
* write RPCs are gated server-side by `LUNORA_ADMIN_TOKEN` alone — one
|
|
191
|
+
* all-or-nothing check in `handleAdminRpc`, with no read/write scoping — and
|
|
192
|
+
* `renderStudioHtml({ adminToken })` already ships that bearer to the
|
|
193
|
+
* browser. So a viewer handed a studio deployed with `dataEditable: false`
|
|
194
|
+
* still holds a credential that can write; the buttons are simply absent
|
|
195
|
+
* from the page. Treat it as an affordance switch for a trusted operator,
|
|
196
|
+
* never as an authorization boundary. The same holds for
|
|
197
|
+
* {@link StudioProps.schemaEditable} and {@link StudioProps.runAsIdentity}.
|
|
198
|
+
*/
|
|
199
|
+
readonly dataEditable?: boolean;
|
|
200
|
+
/**
|
|
201
|
+
* Functions exposed in the runner tab. The runner tab only appears when at
|
|
202
|
+
* least one descriptor is supplied (a query/mutation/action's `kind` is
|
|
203
|
+
* compile-time-only, so it must be named here).
|
|
204
|
+
*/
|
|
205
|
+
readonly functions?: FunctionDescriptor[];
|
|
206
|
+
/** Reuse an existing Lingui instance (wins over `locale`). */
|
|
207
|
+
readonly i18n?: I18n;
|
|
208
|
+
/** Shard key every shard-scoped panel targets on first load. */
|
|
209
|
+
readonly initialShardKey?: string;
|
|
210
|
+
/** Active locale for the studio's own UI strings. Defaults to `en`. */
|
|
211
|
+
readonly locale?: string;
|
|
212
|
+
/**
|
|
213
|
+
* Inline OpenAPI 3.1 document rendered by the API tab's reference sub-view.
|
|
214
|
+
* Thread the generated `_generated/openapi.json` here to render it
|
|
215
|
+
* without a round-trip. When omitted the reference fetches the worker's
|
|
216
|
+
* admin-gated `GET /_lunora/admin/openapi` endpoint via the client.
|
|
217
|
+
*/
|
|
218
|
+
readonly openApiSpec?: unknown;
|
|
219
|
+
/**
|
|
220
|
+
* Inline OpenRPC 1.x document rendered by the API tab's reference sub-view
|
|
221
|
+
* when the OpenRPC format is selected. Thread the generated
|
|
222
|
+
* `_generated/openrpc.json` here to render it without a round-trip. When
|
|
223
|
+
* omitted the OpenRPC view fetches the worker's admin-gated
|
|
224
|
+
* `GET /_lunora/admin/openrpc` endpoint via the client.
|
|
225
|
+
*/
|
|
226
|
+
readonly openRpcSpec?: unknown;
|
|
227
|
+
/**
|
|
228
|
+
* The app's data-subject request source for the Privacy requests page, built
|
|
229
|
+
* from the app's own admin functions (`listOpenPrivacyRequests`,
|
|
230
|
+
* `retryPrivacyRequest`). Without one the page renders a "not configured" state
|
|
231
|
+
* and issues no request. Pass a STABLE reference, as for `analyticsSqlQuery`.
|
|
232
|
+
*/
|
|
233
|
+
readonly privacyRequests?: PrivacyRequestsSource;
|
|
234
|
+
/**
|
|
235
|
+
* Allow the function runner to execute a function AS a chosen authenticated
|
|
236
|
+
* identity (the "Run as identity" tool), so an operator can test auth + RLS
|
|
237
|
+
* behavior. Security-sensitive: it forges identity on an admin-gated RPC, so
|
|
238
|
+
* the host MUST set this only on a trusted loopback-dev gate (the same gate
|
|
239
|
+
* as `dataEditable`) — never in a production/static deploy. Off by default;
|
|
240
|
+
* see {@link FunctionRunner}.
|
|
241
|
+
*
|
|
242
|
+
* Like {@link StudioProps.dataEditable}, leaving it off only hides the tool.
|
|
243
|
+
* The RPC behind it stays reachable to anyone holding the admin token the
|
|
244
|
+
* page already carries — the gate is the token, not this flag.
|
|
245
|
+
*/
|
|
246
|
+
readonly runAsIdentity?: boolean;
|
|
247
|
+
/**
|
|
248
|
+
* Override how the schedule tab cancels a job. Defaults to the client's
|
|
249
|
+
* scheduler admin endpoint; see {@link SchedulePanel}.
|
|
250
|
+
*/
|
|
251
|
+
readonly scheduledCancel?: SchedulePanelProps["scheduledCancel"];
|
|
252
|
+
/**
|
|
253
|
+
* Override how the schedule tab's Cron triggers sub-view loads triggers.
|
|
254
|
+
* Defaults to the client's `/_lunora/admin/cron-jobs` endpoint; see
|
|
255
|
+
* {@link SchedulePanel}.
|
|
256
|
+
*/
|
|
257
|
+
readonly scheduledCron?: SchedulePanelProps["loadCronJobs"];
|
|
258
|
+
/**
|
|
259
|
+
* Override how the schedule tab loads jobs. Defaults to the client's
|
|
260
|
+
* scheduler admin endpoint, so the tab works without extra wiring.
|
|
261
|
+
*/
|
|
262
|
+
readonly scheduledLoad?: SchedulePanelProps["scheduledLoad"];
|
|
263
|
+
/**
|
|
264
|
+
* Show the visual schema editor overlay on the schema diagram (add table /
|
|
265
|
+
* column / index, written back to `lunora/schema.ts` + codegen). Off by
|
|
266
|
+
* default. Only the loopback-only dev hosts set this — the write path needs
|
|
267
|
+
* the project's filesystem + toolchain, so a static deploy leaves it off.
|
|
268
|
+
*
|
|
269
|
+
* Like {@link StudioProps.dataEditable}, it hides the overlay rather than
|
|
270
|
+
* making the diagram read-only: what actually stops a schema write in a
|
|
271
|
+
* static deploy is that the host has no filesystem to write to, not this
|
|
272
|
+
* flag.
|
|
273
|
+
*/
|
|
274
|
+
readonly schemaEditable?: boolean;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Top-bar + sidebar-footer chrome the `StudioApp` owns (theme + admin
|
|
278
|
+
* token state, the rules banner) but which renders *inside* the router-owned
|
|
279
|
+
* {@link StudioLayout} (the header and sidebar footer). The layout is a route
|
|
280
|
+
* component with no props, so it reads this from context rather than threading
|
|
281
|
+
* it through the router. Absent (composing `<Studio>` bare) the layout simply
|
|
282
|
+
* omits those affordances.
|
|
283
|
+
*/
|
|
284
|
+
interface StudioChrome {
|
|
285
|
+
readonly clearToken: () => void;
|
|
286
|
+
readonly onTokenChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
287
|
+
readonly rulesInstalled?: boolean;
|
|
288
|
+
readonly token: string;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* The composable studio. {@link StudioShell} reads its strings from `useT`,
|
|
292
|
+
* which needs a `StudioI18nProvider` above it.
|
|
293
|
+
*
|
|
294
|
+
* When an `i18n` instance or a `locale` is supplied, this owns a provider so the
|
|
295
|
+
* studio localises itself standalone. When neither is given it renders the
|
|
296
|
+
* shell bare and inherits whatever provider is already in scope — the host app's
|
|
297
|
+
* (`StudioApp` owns one for the top bar too) or the shared default — instead
|
|
298
|
+
* of nesting a second, redundant provider.
|
|
299
|
+
*/
|
|
300
|
+
declare const Studio: ({ i18n, locale, ...shellProps }: StudioProps) => ReactElement;
|
|
301
|
+
interface StudioAppProps {
|
|
302
|
+
/**
|
|
303
|
+
* Admin bearer token to send with every admin request. When omitted the app
|
|
304
|
+
* renders a small prompt so an operator can paste it at runtime — handy in
|
|
305
|
+
* dev where you don't want to bake the token into a bundle.
|
|
306
|
+
*/
|
|
307
|
+
readonly adminToken?: string;
|
|
308
|
+
/**
|
|
309
|
+
* URL path prefix the studio is mounted under (router `basepath`). Defaults
|
|
310
|
+
* to `/`. The `@lunora/vite` dev route sets `/__lunora`. Forwarded to the
|
|
311
|
+
* composed {@link Studio}.
|
|
312
|
+
*/
|
|
313
|
+
readonly basePath?: string;
|
|
314
|
+
/**
|
|
315
|
+
* Base URL of the Lunora worker the studio talks to. Defaults to the
|
|
316
|
+
* current origin, which is correct when the studio is served from the
|
|
317
|
+
* same worker (the `@lunora/vite` dev route) or proxied to it.
|
|
318
|
+
*/
|
|
319
|
+
readonly baseUrl?: string;
|
|
320
|
+
/**
|
|
321
|
+
* Inject a pre-built client instead of constructing one from `baseUrl` +
|
|
322
|
+
* the admin token. Used by the dev mock harness (and embeddings that own
|
|
323
|
+
* the client) so the chrome renders against a supplied client; when set,
|
|
324
|
+
* `baseUrl`/`adminToken` are ignored and this client is never closed here.
|
|
325
|
+
*/
|
|
326
|
+
readonly client?: LunoraAdminClient;
|
|
327
|
+
/** UI language for the studio's own strings. Defaults to `en`. */
|
|
328
|
+
readonly locale?: string;
|
|
329
|
+
/**
|
|
330
|
+
* Whether the project's Lunora agent skills ("rules") are installed. When
|
|
331
|
+
* explicitly `false`, the studio shows a one-line banner pointing at
|
|
332
|
+
* `lunora rules install`. The loopback dev hosts inject this; a static deploy
|
|
333
|
+
* leaves it unset (no banner).
|
|
334
|
+
*/
|
|
335
|
+
readonly rulesInstalled?: boolean;
|
|
336
|
+
/** Forwarded to the composed {@link Studio} (functions, initialShardKey, scheduled overrides). */
|
|
337
|
+
readonly studio?: Omit<StudioProps, "children" | "chrome" | "i18n" | "locale">;
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* A fully self-contained studio page: it constructs a {@link LunoraAdminClient}
|
|
341
|
+
* pointed at the worker, wires it through a `<LunoraProvider>`, manages the
|
|
342
|
+
* admin token + theme, and renders the composed {@link Studio} — handing it the
|
|
343
|
+
* top-bar/sidebar {@link StudioChrome} (theme toggle, admin-token popover, rules
|
|
344
|
+
* banner) so those affordances render inside the sidebar shell.
|
|
345
|
+
*
|
|
346
|
+
* Mount this directly (the standalone app and the `@lunora/vite` dev route both
|
|
347
|
+
* do) when you want the batteries-included page rather than composing panels
|
|
348
|
+
* yourself. For embedding into an existing admin UI, use the individual panels
|
|
349
|
+
* or `<Studio>` under your own provider instead.
|
|
350
|
+
*/
|
|
351
|
+
declare const StudioApp: ({ adminToken, basePath, baseUrl, client: injectedClient, rulesInstalled, studio, locale }?: StudioAppProps) => ReactElement;
|
|
352
|
+
export { FunctionDescriptor as F, PrivacyRequestRow as P, RunStatus as R, StudioAppProps as S, FunctionKind as a, PrivacyRequestsSource as b, ScheduledJobs as c, ScheduledJobsProps as d, Studio as e, StudioApp as f, StudioProps as g };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as x}from"react/compiler-runtime";import{useState as P}from"react";import{G as d}from"./grid-pagination-DY2erU65.mjs";import{jsx as M}from"react/jsx-runtime";const G=o=>{const t=x(18),{count:n,offset:e,onOffsetChange:i,pageSize:s,prefix:a,total:f}=o;if(f===void 0)return null;const c=Math.max(0,Math.floor((f-1)/s)*s),u=e+n<f,g=e>0;let r;t[0]!==e||t[1]!==i||t[2]!==s?(r=()=>{i(e+s)},t[0]=e,t[1]=i,t[2]=s,t[3]=r):r=t[3];let l;t[4]!==c||t[5]!==e||t[6]!==i||t[7]!==s?(l=()=>{i(Math.max(0,Math.min(e-s,c)))},t[4]=c,t[5]=e,t[6]=i,t[7]=s,t[8]=l):l=t[8];const h=n===0?0:e+n,p=n===0?0:e+1;let m;return t[9]!==a||t[10]!==u||t[11]!==g||t[12]!==r||t[13]!==l||t[14]!==h||t[15]!==p||t[16]!==f?(m=M(d,{hasNext:u,hasPrevious:g,onNext:r,onPrevious:l,prefix:a,rangeEnd:h,rangeStart:p,total:f}),t[9]=a,t[10]=u,t[11]=g,t[12]=r,t[13]=l,t[14]=h,t[15]=p,t[16]=f,t[17]=m):m=t[17],m},N=o=>{const t=x(7);let n;t[0]!==o?(n={offset:0,owner:o},t[0]=o,t[1]=n):n=t[1];const[e,i]=P(n);e.owner!==o&&i({offset:0,owner:o});const s=e.owner===o?e.offset:0;let a;t[2]!==o?(a=c=>{i({offset:c,owner:o})},t[2]=o,t[3]=a):a=t[3];let f;return t[4]!==s||t[5]!==a?(f=[s,a],t[4]=s,t[5]=a,t[6]=f):f=t[6],f};export{G as A,N as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mergeProps as n}from"@base-ui/react/merge-props";import{useRender as a}from"@base-ui/react/use-render";import{cva as o}from"class-variance-authority";import{c as s}from"./utils-bhneXptQ.mjs";const d=o("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-none border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive font-mono text-[11px] tracking-wide uppercase focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline",success:"bg-success/10 text-success font-mono text-[11px] tracking-wide uppercase [a]:hover:bg-success/15 dark:bg-success/15",warning:"bg-warning/10 text-warning font-mono text-[11px] tracking-wide uppercase [a]:hover:bg-warning/15 dark:bg-warning/15",info:"bg-info/10 text-info font-mono text-[11px] tracking-wide uppercase [a]:hover:bg-info/15 dark:bg-info/15"}},defaultVariants:{variant:"default"}});function f({className:r,variant:e="default",render:t,...i}){return a({defaultTagName:"span",props:n({className:s(d({variant:e}),r)},i),render:t,state:{slot:"badge",variant:e}})}export{f as B};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{c as k}from"react/compiler-runtime";import{LunoraError as B}from"@lunora/errors";import{useReducedMotion as V,motion as K}from"motion/react";import*as w from"react";import{useId as j,useState as X,use as Y,createContext as H}from"react";import*as I from"recharts";import{BarChart as U,ReferenceLine as F,XAxis as q,Bar as z,Rectangle as R}from"recharts";import{c as A}from"./utils-bhneXptQ.mjs";import{jsx as l,jsxs as b,Fragment as E}from"react/jsx-runtime";const L={light:"",dark:".dark"},T=Object.keys(L);function W(r){for(const[t,e]of Object.entries(r))if(e.colors&&!T.some(o=>e.colors?.[o]!==void 0))throw new B("INTERNAL",`[EvilCharts] Invalid chart config for "${t}": colors object must have at least one theme key (${T.join(", ")}). Received empty object or invalid keys.`)}const D=w.createContext(null);function J(){const r=w.useContext(D);if(!r)throw new B("INTERNAL","useChart must be used within a <ChartContainer />");return r}const Q=({id:r,config:t,initialDimension:e={width:320,height:200},className:n,children:o,...s})=>{const a=w.useId(),i=`chart-${r??a.replaceAll(":","")}`;return W(t),l(D.Provider,{value:{config:t},children:b("div",{className:A("min-h-0 w-full flex-1","[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-axis-tick_text]:font-mono [&_.recharts-cartesian-axis-tick_text]:text-[11px] [&_.recharts-cartesian-axis-tick_text]:tracking-wide [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border relative flex flex-col justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden","aspect-video",n),"data-chart":i,"data-slot":"chart",...s,children:[l(tt,{config:t,id:i}),l(I.ResponsiveContainer,{className:"min-h-0 w-full flex-1",initialDimension:e,children:o})]})})};function Z(r,t){const e=r.length;if(e>=t)return r.slice(0,t);const n=[],o=Math.floor(t/e),s=t%e;for(let a=0;a<e;a++){const i=a>=e-s,d=o+(i?1:0);for(let u=0;u<d;u++)n.push(r[a])}return n}const tt=r=>{const t=k(6),{id:e,config:n}=r;let o,s;if(t[0]!==n||t[1]!==e){s=Symbol.for("react.early_return_sentinel");t:{const d=Object.entries(n).filter(et);if(d.length===0){s=null;break t}const u=g=>d.flatMap(f=>{const[m,v]=f,h=v.colors?.[g];if(!h||!Array.isArray(h)||h.length===0)return[];const y=N(v);return Z(h,y).map((c,p)=>` --color-${m}-${p}: ${c};`)}).filter(Boolean).join(`
|
|
3
|
+
`);o=Object.entries(L).map(g=>{const[f,m]=g;return`${m} [data-chart=${e}] {
|
|
4
|
+
${u(f)}
|
|
5
|
+
}`})}t[0]=n,t[1]=e,t[2]=o,t[3]=s}else o=t[2],s=t[3];if(s!==Symbol.for("react.early_return_sentinel"))return s;const a=o.join(`
|
|
6
|
+
`);let i;return t[4]!==a?(i=l("style",{dangerouslySetInnerHTML:{__html:a}}),t[4]=a,t[5]=i):i=t[5],i};function M(r,t,e){if(typeof t!="object"||t===null)return;const n="payload"in t&&typeof t.payload=="object"&&t.payload!==null?t.payload:void 0;let o=e;return e in t&&typeof t[e]=="string"?o=t[e]:n&&e in n&&typeof n[e]=="string"&&(o=n[e]),o in r?r[o]:r[e]}function N(r){if(!r.colors)return 1;const t=T.map(e=>r.colors?.[e]?.length??0);return Math.max(...t,1)}function et(r){const[,t]=r;return t.colors}const rt={sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl"},nt={default:"bg-background","frosted-glass":"bg-background"},ot=({active:r,payload:t,className:e,indicator:n="dot",hideLabel:o=!1,hideIndicator:s=!1,label:a,labelFormatter:i,labelClassName:d,formatter:u,nameKey:g,labelKey:f,roundness:m="lg",variant:v="default"})=>{const{config:h}=J(),y=w.useMemo(()=>{if(o||!t?.length)return null;const[c]=t,p=`${f??c?.dataKey??c?.name??"value"}`,$=M(h,c,p),C=!f&&typeof a=="string"?h[a]?.label??a:$?.label;return i?l("div",{className:A("font-medium",d),children:i(C,t)}):C?l("div",{className:A("font-medium",d),children:C}):null},[a,i,t,o,d,h,f]);if(!r||!t?.length)return l("span",{className:"p-4"});const x=t.length===1&&n!=="dot";return b("div",{className:A("border-border/50 grid min-w-32 items-start gap-1.5 border px-2.5 py-1.5 text-xs",rt[m],nt[v],e),children:[x?null:y,l("div",{className:"grid gap-1.5",children:t.filter(c=>c.type!=="none").map((c,p)=>{const C=`${(g&&c.payload?c.payload[g]:void 0)??c.name??c.dataKey??"value"}`,_=M(h,c,C),P=_?N(_):1;return l("div",{className:A("[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",n==="dot"&&"items-center"),children:u&&c?.value!==void 0&&c.name?u(c.value,c.name,c,p,c.payload):b(E,{children:[_?.icon?l(_.icon,{}):!s&&l("div",{className:A("shrink-0 rounded-[2px]",{"h-2.5 w-2.5":n==="dot","w-1":n==="line","w-0 border-[1.5px] border-dashed bg-transparent!":n==="dashed","my-0.5":x&&n==="dashed"}),style:st(C,P)}),b("div",{className:A("flex flex-1 justify-between gap-4 leading-none",x?"items-end":"items-center"),children:[b("div",{className:"grid gap-1.5",children:[x?y:null,l("span",{className:"text-muted-foreground",children:_?.label??c.name})]}),c.value!=null&&l("span",{className:"text-foreground font-mono font-medium tabular-nums",children:typeof c.value=="number"?c.value.toLocaleString():String(c.value)})]})]})},p)})})]})};function st(r,t){return t<=1?{background:`var(--color-${r}-0)`}:{background:`linear-gradient(to right, ${Array.from({length:t},(n,o)=>{const s=o/(t-1)*100;return`var(--color-${r}-${o}) ${s}%`}).join(", ")})`}}const at=({animationDuration:r=200,...t})=>l(I.Tooltip,{animationDuration:r,...t}),G=2,it=.5,lt=.05,ct=[0,.7,.5,1],O=H(null);function dt(){const r=Y(O);if(!r)throw new B("INTERNAL","Bar chart parts (<Bar />, <XAxis />, …) must be used within <EvilBarChart />");return r}const Ct=({config:r,data:t,children:e,className:n,animationType:o="left-to-right",barCategoryGap:s})=>{const a=j().replaceAll(":",""),[i]=X(()=>Date.now()),d={animationType:o,config:r,dataLength:t.length,introStartedAt:i};return l(O,{value:d,children:l(Q,{className:n,config:r,children:b(U,{accessibilityLayer:!0,barCategoryGap:s,data:t,id:a,layout:"horizontal",children:[l(F,{stroke:"var(--border)"}),e]})})})},bt=r=>{const t=k(24),{dataKey:e}=r,{animationType:n,config:o,dataLength:s,introStartedAt:a}=dt(),i=j();let d;t[0]!==i?(d=i.replaceAll(":",""),t[0]=i,t[1]=d):d=t[1];const u=d,f=V()?"none":n;let m;t[2]!==e||t[3]!==s||t[4]!==u||t[5]!==a?(m={dataKey:e,dataLength:s,id:u,introStartedAt:a},t[2]=e,t[3]=s,t[4]=u,t[5]=a,t[6]=m):m=t[6];const v=m;let h;t[7]!==v?(h=C=>l(S,{...C,...v,animationType:"none"}),t[7]=v,t[8]=h):h=t[8];const y=`url(#${u}-colors-${e})`;let x;t[9]!==v||t[10]!==f?(x=C=>l(S,{...C,...v,animationType:f}),t[9]=v,t[10]=f,t[11]=x):x=t[11];let c;t[12]!==e||t[13]!==h||t[14]!==y||t[15]!==x?(c=l(z,{activeBar:h,dataKey:e,fill:y,isAnimationActive:!1,radius:G,shape:x}),t[12]=e,t[13]=h,t[14]=y,t[15]=x,t[16]=c):c=t[16];let p;t[17]!==o||t[18]!==e||t[19]!==u?(p=l("defs",{children:l(ft,{config:o,dataKey:e,id:u})}),t[17]=o,t[18]=e,t[19]=u,t[20]=p):p=t[20];let $;return t[21]!==c||t[22]!==p?($=b(E,{children:[c,p]}),t[21]=c,t[22]=p,t[23]=$):$=t[23],$},$t=({tickLine:r=!1,axisLine:t=!1,tickMargin:e=8,minTickGap:n=8,...o})=>l(q,{axisLine:t,minTickGap:n,tickLine:r,tickMargin:e,type:"category",...o}),At=r=>{const t=k(6),{variant:e,roundness:n,defaultIndex:o}=r;let s;t[0]!==n||t[1]!==e?(s=l(ot,{roundness:n,variant:e}),t[0]=n,t[1]=e,t[2]=s):s=t[2];let a;return t[3]!==o||t[4]!==s?(a=l(at,{content:s,cursor:!1,defaultIndex:o}),t[3]=o,t[4]=s,t[5]=a):a=t[5],a},S=r=>{const{x:t=0,y:e=0,width:n=0,height:o=0,id:s,dataKey:a,animationType:i="none",introStartedAt:d=0,dataLength:u=0}=r,g=typeof r.index=="number"?r.index:-1,f=ut(i,g,u,d),m=l(R,{fill:`url(#${s}-colors-${a})`,height:Math.max(0,o-3),radius:G,width:n,x:t,y:e});return b("g",{children:[l(R,{...r,fill:"transparent"}),f?l(K.g,{animate:f.animate,initial:f.initial,style:f.style,transition:f.transition,children:m}):m]})},ut=(r,t,e,n)=>{if(r==="none"||t<0||e<=0)return null;const o=t*lt*1e3,s=it*1e3,a=o+s,i=Date.now()-n;if(i>=a)return null;const d=i<=o?0:(i-o)/s,u={delay:Math.max(0,o-i)/1e3,duration:(a-Math.max(i,o))/1e3,ease:ct};return{animate:{scaleY:1},initial:{scaleY:d},style:{originY:1},transition:u}},ft=r=>{const t=k(16),{id:e,dataKey:n,config:o}=r;let s,a,i,d,u,g;if(t[0]!==o||t[1]!==n||t[2]!==e){const m=N(o[n]??{});s=`${e}-colors-${n}`,a="0",i="0",d="0",u="1",g=m===1?b(E,{children:[l("stop",{offset:"0%",stopColor:`var(--color-${n}-0)`}),l("stop",{offset:"100%",stopColor:`var(--color-${n}-0)`})]}):Array.from({length:m},(v,h)=>{const y=`${h/(m-1)*100}%`;return l("stop",{offset:y,stopColor:`var(--color-${n}-${h}, var(--color-${n}-0))`},y)}),t[0]=o,t[1]=n,t[2]=e,t[3]=s,t[4]=a,t[5]=i,t[6]=d,t[7]=u,t[8]=g}else s=t[3],a=t[4],i=t[5],d=t[6],u=t[7],g=t[8];let f;return t[9]!==s||t[10]!==a||t[11]!==i||t[12]!==d||t[13]!==u||t[14]!==g?(f=l("linearGradient",{id:s,x1:a,x2:i,y1:d,y2:u,children:g}),t[9]=s,t[10]=a,t[11]=i,t[12]=d,t[13]=u,t[14]=g,t[15]=f):f=t[15],f};export{bt as B,Q as C,Ct as E,At as T,$t as X,at as a,ot as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as m}from"react/compiler-runtime";import{useState as h,useRef as $,useEffect as S}from"react";const d=(o="local")=>{try{return o==="local"?globalThis.localStorage:globalThis.sessionStorage}catch{return}},g=function(o,e="local"){try{const s=d(e)?.getItem(o)??void 0,t=s===void 0?[]:JSON.parse(s);return Array.isArray(t)?t:[]}catch{return[]}},I=(o,e,s="local")=>{const t=d(s);if(t!==void 0)try{t.setItem(o,JSON.stringify(e))}catch{}},A=(o,e="local")=>{try{d(e)?.removeItem(o)}catch{}},J=function(o,e){const s=m(10),t=e===void 0?"local":e;let i;s[0]!==o||s[1]!==t?(i=()=>g(o,t),s[0]=o,s[1]=t,s[2]=i):i=s[2];const[r,u]=h(i),a=$(`${t}:${o}`);let c,l;s[3]!==o||s[4]!==t||s[5]!==r?(c=()=>{const f=`${t}:${o}`;if(a.current!==f){a.current=f,u(g(o,t));return}I(o,r,t)},l=[o,t,r],s[3]=o,s[4]=t,s[5]=r,s[6]=c,s[7]=l):(c=s[6],l=s[7]),S(c,l);let n;return s[8]!==r?(n=[r,u],s[8]=r,s[9]=n):n=s[9],n},O=function(o,e,s){const t=m(6),i="local",[r,u]=J(o,i);let a;t[0]!==e||t[1]!==u?(a=f=>{u(v=>{const p=v[0]??e;return[typeof f=="function"?f(p):f]})},t[0]=e,t[1]=u,t[2]=a):a=t[2];const c=a,l=r[0]??e;let n;return t[3]!==c||t[4]!==l?(n=[l,c],t[3]=c,t[4]=l,t[5]=n):n=t[5],n},V=o=>globalThis.crypto?.randomUUID?.()??`${o}-${globalThis.performance.now().toString(36)}`;export{d as a,O as b,g as l,V as n,A as r,I as s,J as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Button as a}from"@base-ui/react/button";import{cva as n}from"class-variance-authority";import{c as d}from"./utils-bhneXptQ.mjs";import{jsx as o}from"react/jsx-runtime";const s=n("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-xs font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2",xs:"h-6 gap-1 rounded-md px-2 text-xs has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-md px-2.5 has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2",icon:"size-8","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-md","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function v({className:e,variant:r="default",size:i="default",...t}){return o(a,{"data-slot":"button",className:d(s({variant:r,size:i,className:e})),...t})}export{v as B};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as i}from"react/compiler-runtime";import{c as o}from"./utils-bhneXptQ.mjs";import{jsx as l}from"react/jsx-runtime";function p({className:d,size:e="default",...a}){return l("div",{"data-slot":"card","data-size":e,className:o("group/card flex flex-col gap-4 overflow-hidden rounded-xl border border-border bg-card py-4 text-xs/relaxed text-card-foreground shadow-xs has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-2 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-md *:[img:last-child]:rounded-md",d),...a})}function f(d){const e=i(8);let a,t;e[0]!==d?({className:a,...t}=d,e[0]=d,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let s;e[3]!==a?(s=o("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-md px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",a),e[3]=a,e[4]=s):s=e[4];let r;return e[5]!==t||e[6]!==s?(r=l("div",{"data-slot":"card-header",className:s,...t}),e[5]=t,e[6]=s,e[7]=r):r=e[7],r}function u(d){const e=i(8);let a,t;e[0]!==d?({className:a,...t}=d,e[0]=d,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let s;e[3]!==a?(s=o("font-heading text-sm font-medium group-data-[size=sm]/card:text-sm",a),e[3]=a,e[4]=s):s=e[4];let r;return e[5]!==t||e[6]!==s?(r=l("div",{"data-slot":"card-title",className:s,...t}),e[5]=t,e[6]=s,e[7]=r):r=e[7],r}function x(d){const e=i(8);let a,t;e[0]!==d?({className:a,...t}=d,e[0]=d,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let s;e[3]!==a?(s=o("text-xs/relaxed text-muted-foreground",a),e[3]=a,e[4]=s):s=e[4];let r;return e[5]!==t||e[6]!==s?(r=l("div",{"data-slot":"card-description",className:s,...t}),e[5]=t,e[6]=s,e[7]=r):r=e[7],r}function g(d){const e=i(8);let a,t;e[0]!==d?({className:a,...t}=d,e[0]=d,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let s;e[3]!==a?(s=o("px-4 group-data-[size=sm]/card:px-3",a),e[3]=a,e[4]=s):s=e[4];let r;return e[5]!==t||e[6]!==s?(r=l("div",{"data-slot":"card-content",className:s,...t}),e[5]=t,e[6]=s,e[7]=r):r=e[7],r}export{p as C,g as a,f as b,u as c,x as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const s="https://dash.cloudflare.com/?to=/:account",L=`${s}/workers-and-pages/observability`,o=`${s}/workers-and-pages`,R=`${s}/r2`,a=`${s}/workers/d1`,r=`${s}/workers/durable-objects`;export{o as C,L as a,a as b,r as c,R as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as s}from"react/compiler-runtime";import{Checkbox as d}from"@base-ui/react/checkbox";import{c as l}from"./utils-bhneXptQ.mjs";import{HugeiconsIcon as m}from"@hugeicons/react";import{Tick02Icon as b}from"@hugeicons/core-free-icons";import{jsx as n}from"react/jsx-runtime";function v(c){const e=s(9);let r,i;e[0]!==c?({className:r,...i}=c,e[0]=c,e[1]=r,e[2]=i):(r=e[1],i=e[2]);let a;e[3]!==r?(a=l("peer relative flex size-4 shrink-0 items-center justify-center rounded-md border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary",r),e[3]=r,e[4]=a):a=e[4];let t;e[5]===Symbol.for("react.memo_cache_sentinel")?(t=n(d.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:n(m,{icon:b,strokeWidth:2})}),e[5]=t):t=e[5];let o;return e[6]!==i||e[7]!==a?(o=n(d.Root,{"data-slot":"checkbox",className:a,...i,children:t}),e[6]=i,e[7]=a,e[8]=o):o=e[8],o}export{v as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e="inline-flex items-center gap-1 rounded-md border border-border px-2.5 py-1 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50",n=`${e} aria-pressed:bg-accent aria-pressed:text-accent-foreground`;export{e as C,n as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as x}from"react/compiler-runtime";import{useT as w}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{l as y}from"./internal-BXEjuLPN.mjs";import{jsx as i,jsxs as u}from"react/jsx-runtime";const N=(l,e)=>{if(e==="")return[{match:!1,offset:0,text:l}];const a=[],s=l.toLowerCase(),o=e.toLowerCase();let t=0;for(let r=s.indexOf(o);r!==-1;r=s.indexOf(o,t))r>t&&a.push({match:!1,offset:t,text:l.slice(t,r)}),a.push({match:!0,offset:r,text:l.slice(r,r+e.length)}),t=r+e.length;return t<l.length&&a.push({match:!1,offset:t,text:l.slice(t)}),a},v=l=>{const e=x(9),{highlight:a,value:s}=l;if(s==null){let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=i("span",{className:"text-muted-foreground/50 italic",children:"NULL"}),e[0]=n):n=e[0],n}let o,t,r;if(e[1]!==a||e[2]!==s){r=Symbol.for("react.early_return_sentinel");e:{const n=y(s);if(a===void 0||a===""){r=i("span",{title:n,children:n});break e}o=n,t=N(n,a).map(_)}e[1]=a,e[2]=s,e[3]=o,e[4]=t,e[5]=r}else o=e[3],t=e[4],r=e[5];if(r!==Symbol.for("react.early_return_sentinel"))return r;let d;return e[6]!==o||e[7]!==t?(d=i("span",{title:o,children:t}),e[6]=o,e[7]=t,e[8]=d):d=e[8],d},T=l=>{const e=x(22),{columns:a,rows:s}=l,o=w();let t;e[0]!==o?(t=o("Field"),e[0]=o,e[1]=t):t=e[1];let r;e[2]!==t?(r=i("th",{className:"border-b border-e border-border px-3 py-1.5 text-start font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:t}),e[2]=t,e[3]=r):r=e[3];let d;if(e[4]!==s||e[5]!==o){let c;e[7]!==o?(c=(b,p)=>i("th",{className:"border-b border-border px-3 py-1.5 text-start font-mono text-[11px] tracking-wide uppercase tabular-nums text-muted-foreground",children:o("Row {n}",{n:p+1})},p),e[7]=o,e[8]=c):c=e[8],d=s.map(c),e[4]=s,e[5]=o,e[6]=d}else d=e[6];let n;e[9]!==r||e[10]!==d?(n=i("thead",{className:"sticky top-0 z-10 bg-muted",children:u("tr",{children:[r,d]})}),e[9]=r,e[10]=d,e[11]=n):n=e[11];let f;if(e[12]!==a||e[13]!==s){let c;e[15]!==s?(c=b=>u("tr",{className:"hover:bg-muted/40",children:[i("th",{className:"border-b border-e border-border px-3 py-1.5 text-start font-mono font-medium whitespace-nowrap",scope:"row",children:b}),s.map((p,g)=>i("td",{className:"max-w-md truncate border-b border-border px-3 py-1.5 font-mono",children:i(v,{value:p[b]})},g))]},b),e[15]=s,e[16]=c):c=e[16],f=a.map(c),e[12]=a,e[13]=s,e[14]=f}else f=e[14];let m;e[17]!==f?(m=i("tbody",{children:f}),e[17]=f,e[18]=m):m=e[18];let h;return e[19]!==n||e[20]!==m?(h=i("div",{className:"min-h-0 flex-1 overflow-auto","data-testid":"db-transposed",children:u("table",{className:"border-collapse text-xs",children:[n,m]})}),e[19]=n,e[20]=m,e[21]=h):h=e[21],h},j=({children:l,layout:e="card",testId:a})=>i("div",{className:e==="fill"?"flex min-h-0 flex-1 flex-col overflow-hidden border-t border-border":"overflow-x-auto border border-border bg-card","data-testid":a,children:l});function _(l){return i("mark",{className:l.match?"rounded-sm bg-warning/40 text-foreground":"bg-transparent text-inherit",children:l.text},l.offset)}export{v as C,j as G,T};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const h=new Set(["contains","eq","gt","gte","has","lt","lte","ne"]),i=t=>typeof t=="number"&&Number.isSafeInteger(t)?String(t):t,s=t=>{if(typeof t!="string")return;const r=t.trim();return r===""?void 0:r},g=t=>{if(t===null||typeof t!="object")return!1;const r=t,e=r.path===void 0||Array.isArray(r.path)&&r.path.every(o=>typeof o=="string");return typeof r.column=="string"&&typeof r.operator=="string"&&h.has(r.operator)&&e},f=t=>{if(typeof t!="string"||t==="")return[];try{const r=JSON.parse(t);return Array.isArray(r)?r.filter(g):[]}catch{return[]}},p=t=>{if(typeof t!="string"||t==="")return;const r=t.lastIndexOf(":");if(r<=0)return;const e=t.slice(0,r),o=t.slice(r+1);if(!(o!=="asc"&&o!=="desc"))return{column:e,direction:o}},u=/^[\da-f]{16}$/u,y=t=>{const r={};if(typeof t.pins=="string"&&t.pins!==""){const l=t.pins.split(",").filter(c=>c!==""&&c.length<=64).slice(0,12);l.length>0&&(r.pins=l.join(","))}t.schema==="global"&&(r.schema="global");const e=s(t.table);e!==void 0&&(r.table=e);const o=s(i(t.shard));o!==void 0&&(r.shard=o);const d=s(i(t.search));d!==void 0&&(r.search=d);const n=s(t.order);n!==void 0&&p(n)!==void 0&&(r.order=n);const a=s(t.filters);return a!==void 0&&f(a).length>0&&(r.filters=a),r},b=t=>{const r=f(t.filters),e=p(t.order);return{filters:r.length>0?r:void 0,orderBy:e,search:s(i(t.search)),shard:s(i(t.shard)),table:s(t.table),tier:t.schema==="global"?"global":"shard"}},v=t=>{const r=t.filters??[];return{filters:r.length>0?JSON.stringify(r):void 0,order:t.orderBy===void 0?void 0:`${t.orderBy.column}:${t.orderBy.direction}`,schema:t.tier==="global"?"global":void 0,search:t.search!==void 0&&t.search!==""?t.search:void 0,shard:t.shard!==void 0&&t.shard!==""?t.shard:void 0,table:t.table!==void 0&&t.table!==""?t.table:void 0}},S=t=>{const{version:r}=t;return typeof r=="string"&&u.test(r)?{version:r}:{}};export{y as a,v as d,b as s,S as v};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{Download01Icon as k}from"@hugeicons/core-free-icons";import{HugeiconsIcon as j}from"@hugeicons/react";import{getNodesBounds as N,getViewportForBounds as A,useNodes as L,useReactFlow as O,Panel as R}from"@xyflow/react";import{useState as x}from"react";import{LunoraError as U}from"@lunora/errors";import{toBlob as C,toSvg as M}from"html-to-image";import{useT as _}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{f as w,b as G}from"./internal-BXEjuLPN.mjs";import{d as I,D as F,c as H,b as f}from"./dropdown-menu-jLZenfWH.mjs";import{jsxs as p,jsx as g}from"react/jsx-runtime";const c=1920,m=1080,y=32,h=(e,r)=>{const o=globalThis.document.createElement("a");o.href=e,o.download=r,globalThis.document.body.append(o),o.click(),o.remove()},J=(e,r,o="schema-diagram.json")=>{const n={edges:r,exportedAt:new Date().toISOString(),nodes:e},s=JSON.stringify(n,void 0,2),a=globalThis.URL.createObjectURL(new globalThis.Blob([s],{type:"application/json"}));h(a,o),globalThis.setTimeout(()=>{globalThis.URL.revokeObjectURL(a)},0)},v=(e,r,o,n)=>{const s=N(e),{x:a,y:i,zoom:t}=A(s,r,o,.1,2,n);return{transform:[a,i,t],zoom:t}},P=async(e,r,o="schema-diagram.png")=>{const{transform:n}=v(r,c,m,y),[s,a,i]=n,t=await C(e,{backgroundColor:"#ffffff",height:m,style:{transform:`translate(${s.toString()}px, ${a.toString()}px) scale(${i.toString()})`,transformOrigin:"top left",width:`${c.toString()}px`},width:c});if(t===null)throw new U("INTERNAL","html-to-image produced no blob");const d=globalThis.URL.createObjectURL(t);h(d,o),globalThis.setTimeout(()=>{globalThis.URL.revokeObjectURL(d)},0)},q=async(e,r,o="schema-diagram.svg")=>{const{transform:n}=v(r,c,m,y),[s,a,i]=n,t=await M(e,{backgroundColor:"#ffffff",height:m,style:{transform:`translate(${s.toString()}px, ${a.toString()}px) scale(${i.toString()})`,transformOrigin:"top left",width:`${c.toString()}px`},width:c});h(t,o)},to=({containerRef:e,filenameBase:r,testIdPrefix:o})=>{const n=_(),s=L(),{getEdges:a}=O(),[i,t]=x(null),[d,u]=x(null),b=l=>{u(n("Export failed: {message}",{message:G(l)}))},S=async()=>{const l=e.current?.querySelector(".react-flow__viewport");if(l){t("png");try{await P(l,s,`${r}.png`)}finally{t(null)}}},E=async()=>{const l=e.current?.querySelector(".react-flow__viewport");if(l){t("svg");try{await q(l,s,`${r}.svg`)}finally{t(null)}}},D=()=>{t("json");try{J(s,a(),`${r}.json`)}finally{t(null)}},T=()=>{u(null),w(S(),b)},$=()=>{u(null),w(E(),b)};return p(R,{position:"top-right",children:[p(I,{children:[p(F,{className:"group/button inline-flex shrink-0 cursor-pointer items-center justify-center gap-1 rounded-md border border-border bg-background px-2 text-xs font-medium whitespace-nowrap hover:bg-muted disabled:pointer-events-none disabled:opacity-50","data-testid":`${o}-export-trigger`,disabled:i!==null,children:[g(j,{className:"size-3.5",icon:k,strokeWidth:2}),n("Export")]}),p(H,{align:"end",children:[g(f,{"data-testid":`${o}-export-png`,disabled:i!==null,onClick:T,children:n("PNG")}),g(f,{"data-testid":`${o}-export-svg`,disabled:i!==null,onClick:$,children:n("SVG")}),g(f,{"data-testid":`${o}-export-json`,disabled:i!==null,onClick:D,children:n("JSON")})]})]}),d!==null&&g("p",{className:"mt-1 max-w-64 text-right text-xs text-destructive","data-testid":`${o}-export-error`,role:"alert",children:d})]})};export{to as D};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{c}from"react/compiler-runtime";import{Menu as i}from"@base-ui/react/menu";import{c as u}from"./utils-bhneXptQ.mjs";import{HugeiconsIcon as m}from"@hugeicons/react";import{Tick02Icon as g}from"@hugeicons/core-free-icons";import{jsx as s,jsxs as v}from"react/jsx-runtime";function N(n){const e=c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let o;return e[2]!==t?(o=s(i.Root,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=o):o=e[3],o}function z(n){const e=c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let o;return e[2]!==t?(o=s(i.Trigger,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=o):o=e[3],o}function D({align:n="start",alignOffset:e=0,side:t="bottom",sideOffset:o=4,className:a,...r}){return s(i.Portal,{children:s(i.Positioner,{className:"isolate z-50 outline-none",align:n,alignOffset:e,side:t,sideOffset:o,children:s(i.Popup,{"data-slot":"dropdown-menu-content",className:u("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95 animate-none! relative bg-popover before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!",a),...r})})})}function M(n){const e=c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let o;return e[2]!==t?(o=s(i.Group,{"data-slot":"dropdown-menu-group",...t}),e[2]=t,e[3]=o):o=e[3],o}function y(n){const e=c(10);let t,o,a;e[0]!==n?({className:t,inset:o,...a}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=a):(t=e[1],o=e[2],a=e[3]);let r;e[4]!==t?(r=u("px-2 py-2 text-xs text-muted-foreground data-inset:ps-7",t),e[4]=t,e[5]=r):r=e[5];let d;return e[6]!==o||e[7]!==a||e[8]!==r?(d=s(i.GroupLabel,{"data-slot":"dropdown-menu-label","data-inset":o,className:r,...a}),e[6]=o,e[7]=a,e[8]=r,e[9]=d):d=e[9],d}function I({className:n,inset:e,variant:t="default",...o}){return s(i.Item,{"data-slot":"dropdown-menu-item","data-inset":e,"data-variant":t,className:u("group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-md px-2 py-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:ps-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",n),...o})}function _(n){const e=c(15);let t,o,a,r,d;e[0]!==n?({className:a,children:o,checked:t,inset:r,...d}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=a,e[4]=r,e[5]=d):(t=e[1],o=e[2],a=e[3],r=e[4],d=e[5]);let l;e[6]!==a?(l=u("relative flex cursor-default items-center gap-2 rounded-md py-2 pe-8 ps-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:ps-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",a),e[6]=a,e[7]=l):l=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=s("span",{className:"pointer-events-none absolute end-2 flex items-center justify-center","data-slot":"dropdown-menu-checkbox-item-indicator",children:s(i.CheckboxItemIndicator,{children:s(m,{icon:g,strokeWidth:2})})}),e[8]=f):f=e[8];let p;return e[9]!==t||e[10]!==o||e[11]!==r||e[12]!==d||e[13]!==l?(p=v(i.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item","data-inset":r,className:l,checked:t,...d,children:[f,o]}),e[9]=t,e[10]=o,e[11]=r,e[12]=d,e[13]=l,e[14]=p):p=e[14],p}function C(n){const e=c(8);let t,o;e[0]!==n?({className:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let a;e[3]!==t?(a=u("-mx-1 h-px bg-border",t),e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==o||e[6]!==a?(r=s(i.Separator,{"data-slot":"dropdown-menu-separator",className:a,...o}),e[5]=o,e[6]=a,e[7]=r):r=e[7],r}export{z as D,y as a,I as b,D as c,N as d,M as e,_ as f,C as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as h}from"react/compiler-runtime";import{c as v}from"./utils-bhneXptQ.mjs";import{jsx as a,jsxs as u}from"react/jsx-runtime";const y=g=>{const e=h(19),{action:o,className:f,description:c,icon:m,testId:x,title:p}=g;let t;e[0]!==f?(t=v("flex flex-col items-center justify-center gap-3 rounded-lg border border-dashed border-border px-6 py-14 text-center",f),e[0]=f,e[1]=t):t=e[1];let s;e[2]!==m?(s=m!==void 0&&a("span",{className:"flex size-10 items-center justify-center rounded-lg bg-muted text-muted-foreground [&_svg]:size-5",children:m}),e[2]=m,e[3]=s):s=e[3];let l;e[4]!==p?(l=a("p",{className:"text-sm font-medium text-foreground",children:p}),e[4]=p,e[5]=l):l=e[5];let r;e[6]!==c?(r=c!==void 0&&a("p",{className:"max-w-sm text-sm text-muted-foreground",children:c}),e[6]=c,e[7]=r):r=e[7];let i;e[8]!==l||e[9]!==r?(i=u("div",{className:"flex flex-col gap-1",children:[l,r]}),e[8]=l,e[9]=r,e[10]=i):i=e[10];let d;e[11]!==o?(d=o!==void 0&&a("div",{className:"mt-1 flex items-center gap-2",children:o}),e[11]=o,e[12]=d):d=e[12];let n;return e[13]!==t||e[14]!==s||e[15]!==i||e[16]!==d||e[17]!==x?(n=u("div",{className:t,"data-testid":x,children:[s,i,d]}),e[13]=t,e[14]=s,e[15]=i,e[16]=d,e[17]=x,e[18]=n):n=e[18],n};export{y as E};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as O}from"react/compiler-runtime";import{flattenHint as j}from"@lunora/errors";import{useT as q}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{e as E,a as H,b as S}from"./internal-BXEjuLPN.mjs";import{o as T}from"./recording-client-MbGZ28I0.mjs";import{u as U}from"./operation-console-provider-DoloEvon.mjs";import{A as V}from"./alert-PB5W11MM.mjs";import{jsx as h,jsxs as D}from"react/jsx-runtime";const K=I=>{const e=O(42),{className:N,error:t,testId:g}=I,C=q(),o=U();let i,s,n,a,c,m,r,l,f;if(e[0]!==N||e[1]!==t||e[2]!==o||e[3]!==g){const A=E(t);let b;e[13]!==t?(b=H(t),e[13]=t,e[14]=b):b=e[14],s=b;let w;e[15]!==t?(w=T(t),e[15]=t,e[16]=w):w=e[16];const k=w,v=t?.why;let y;e[17]!==o||e[18]!==k?(y=()=>{o?.openConsole({errorsOnly:!0,seq:k})},e[17]=o,e[18]=k,e[19]=y):y=e[19],n=y,i=V,a=N,c=g,m="destructive";let d;e[20]!==t?(d=S(t),e[20]=t,e[21]=d):d=e[21],e[22]!==d?(r=h("p",{className:"font-medium",children:d}),e[22]=d,e[23]=r):r=e[23],e[24]!==v?(l=typeof v=="string"?h("p",{className:"mt-1 text-xs opacity-90",children:v}):null,e[24]=v,e[25]=l):l=e[25],f=A===void 0?null:h("p",{className:"mt-1 whitespace-pre-wrap text-xs opacity-90",children:j(A)}),e[0]=N,e[1]=t,e[2]=o,e[3]=g,e[4]=i,e[5]=s,e[6]=n,e[7]=a,e[8]=c,e[9]=m,e[10]=r,e[11]=l,e[12]=f}else i=e[4],s=e[5],n=e[6],a=e[7],c=e[8],m=e[9],r=e[10],l=e[11],f=e[12];let p;e[26]!==s?(p=s===void 0?null:h("a",{"aria-label":"View documentation for this error",className:"mt-1 inline-block text-xs underline",href:s,rel:"noreferrer",target:"_blank",children:"View error docs"}),e[26]=s,e[27]=p):p=e[27];let u;e[28]!==o||e[29]!==n||e[30]!==C?(u=o===void 0?null:h("button",{className:"mt-1 block text-xs underline outline-none focus-visible:ring-1 focus-visible:ring-ring","data-testid":"error-show-in-console",onClick:n,type:"button",children:C("Show in console")}),e[28]=o,e[29]=n,e[30]=C,e[31]=u):u=e[31];let x;return e[32]!==i||e[33]!==a||e[34]!==c||e[35]!==m||e[36]!==r||e[37]!==l||e[38]!==f||e[39]!==p||e[40]!==u?(x=D(i,{className:a,testId:c,variant:m,children:[r,l,f,p,u]}),e[32]=i,e[33]=a,e[34]=c,e[35]=m,e[36]=r,e[37]=l,e[38]=f,e[39]=p,e[40]=u,e[41]=x):x=e[41],x};export{K as E};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{c as v}from"react/compiler-runtime";import{useState as A,useEffect as Y}from"react";import{ConfirmButton as z}from"./ConfirmButton-CIXYF6Mg.mjs";import{D as Q,a as I,b as O,c as H,d as P,e as V,f as U,g as F}from"./dropdown-menu-jLZenfWH.mjs";import{M as X}from"./modal-shell-CDztwLnv.mjs";import{useT as E}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{l as B,g as Z,k as W,f as ee}from"./internal-BXEjuLPN.mjs";import{C as L}from"./control-button-BOZ5K-FC.mjs";import{jsx as m,jsxs as j}from"react/jsx-runtime";const q=l=>`"${l.replaceAll('"','""')}"`,te=/["\n\r,]/u,le=/^[=+\-@\t\r]/u,J=l=>{if(l==null)return"";let e;return typeof l=="string"?e=le.test(l)?` ${l}`:l:typeof l=="number"||typeof l=="boolean"||typeof l=="bigint"?e=String(l):e=B(l),te.test(e)?`"${e.replaceAll('"','""')}"`:e},ne=(l,e)=>{const n=l.map(t=>J(t)).join(","),o=e.map(t=>l.map(c=>J(t[c])).join(","));return[n,...o].join(`
|
|
2
|
+
`)},oe=l=>JSON.stringify(l,W,2),G=500,K=l=>l==null?"NULL":typeof l=="number"?Number.isFinite(l)?String(l):"NULL":typeof l=="bigint"?String(l):typeof l=="boolean"?l?"1":"0":`'${(typeof l=="string"?l:B(l)).replaceAll("'","''")}'`,D="__doc__",se=(l,e,n,o)=>{if(e.length===0||n.length===0)return"";const t=o?.includes(D)===!0&&!e.includes(D)?e.filter(a=>!o.includes(a)):void 0,c=t===void 0?e:o,i=(a,u)=>K(t===void 0||u!==D?a[u]:JSON.stringify(Object.fromEntries(t.map(f=>[f,a[f]])),W)),s=c.map(a=>q(a)).join(", "),r=[];for(let a=0;a<n.length;a+=G){const u=n.slice(a,a+G).map(f=>` (${c.map(d=>i(f,d)).join(", ")})`).join(`,
|
|
3
|
+
`);r.push(`INSERT INTO ${q(l)} (${s}) VALUES
|
|
4
|
+
${u};`)}return r.join(`
|
|
5
|
+
|
|
6
|
+
`)},M=(l,e,n)=>{if(!("document"in globalThis))return;const o=globalThis.URL.createObjectURL(new globalThis.Blob([e],{type:n})),t=globalThis.document.createElement("a");t.href=o,t.download=l,globalThis.document.body.append(t),t.click(),t.remove(),globalThis.URL.revokeObjectURL(o)},ie=l=>{const e=v(37),{columns:n,name:o,rows:t,sqlColumns:c}=l,i=E();let s;e[0]!==n||e[1]!==o||e[2]!==t?(s=()=>{M(`${o}.csv`,ne(n,t),"text/csv;charset=utf-8")},e[0]=n,e[1]=o,e[2]=t,e[3]=s):s=e[3];const r=s;let a;e[4]!==o||e[5]!==t?(a=()=>{M(`${o}.json`,oe(t),"application/json")},e[4]=o,e[5]=t,e[6]=a):a=e[6];const u=a;let f;e[7]!==n||e[8]!==o||e[9]!==t||e[10]!==c?(f=()=>{M(`${o}.sql`,se(o,n,t,c),"application/sql;charset=utf-8")},e[7]=n,e[8]=o,e[9]=t,e[10]=c,e[11]=f):f=e[11];const d=f,N=t.length===0;let p;e[12]!==N?(p=m(Q,{className:L,"data-testid":"grid-export",disabled:N,title:"Exports only the rows loaded on the current page, not the whole table",children:"Export page"}),e[12]=N,e[13]=p):p=e[13];let C;e[14]===Symbol.for("react.memo_cache_sentinel")?(C=m(I,{children:"Export loaded rows"}),e[14]=C):C=e[14];let g;e[15]!==i?(g=i("CSV"),e[15]=i,e[16]=g):g=e[16];let y;e[17]!==r||e[18]!==g?(y=m(O,{"data-testid":"grid-export-csv",onClick:r,children:g}),e[17]=r,e[18]=g,e[19]=y):y=e[19];let k;e[20]!==i?(k=i("JSON"),e[20]=i,e[21]=k):k=e[21];let x;e[22]!==u||e[23]!==k?(x=m(O,{"data-testid":"grid-export-json",onClick:u,children:k}),e[22]=u,e[23]=k,e[24]=x):x=e[24];let S;e[25]!==i?(S=i("SQL"),e[25]=i,e[26]=S):S=e[26];let h;e[27]!==d||e[28]!==S?(h=m(O,{"data-testid":"grid-export-sql",onClick:d,children:S}),e[27]=d,e[28]=S,e[29]=h):h=e[29];let b;e[30]!==x||e[31]!==h||e[32]!==y?(b=j(H,{align:"end",children:[C,y,x,h]}),e[30]=x,e[31]=h,e[32]=y,e[33]=b):b=e[33];let w;return e[34]!==b||e[35]!==p?(w=j(P,{children:[p,b]}),e[34]=b,e[35]=p,e[36]=w):w=e[36],w},re=l=>{const e=v(9),{column:n}=l;let o;e[0]!==n?(o=()=>{n.toggleVisibility()},e[0]=n,e[1]=o):o=e[1];const t=o;let c;e[2]!==n?(c=n.getIsVisible(),e[2]=n,e[3]=c):c=e[3];const i=`grid-column-${n.id}`;let s;return e[4]!==n.id||e[5]!==t||e[6]!==c||e[7]!==i?(s=m(U,{checked:c,closeOnClick:!1,"data-testid":i,onCheckedChange:t,children:n.id}),e[4]=n.id,e[5]=t,e[6]=c,e[7]=i,e[8]=s):s=e[8],s},ce=[],ae=({backRelations:l=ce,enabledBackRelations:e,onToggleBackRelation:n,table:o})=>{const t=E(),c=o.getIsAllColumnsVisible(),i=()=>{o.toggleAllColumnsVisible(!c)};return j(P,{children:[m(Q,{className:L,"data-testid":"grid-columns",children:t("Columns")}),j(H,{align:"end",className:"max-h-80 overflow-y-auto",children:[j(V,{children:[m(I,{children:t("Columns")}),m(U,{checked:c,closeOnClick:!1,"data-testid":"grid-columns-all",onCheckedChange:i,children:t(c?"Hide all":"Show all")}),m(F,{}),o.getAllLeafColumns().filter(s=>!s.id.startsWith("__back__:")).map(s=>m(re,{column:s},s.id))]}),l.length>0&&n!==void 0&&j(V,{children:[m(F,{}),m(I,{children:t("Related")}),l.map(s=>{const r=`${s.table}.${s.column}`;return m(U,{checked:e?.has(r)===!0,closeOnClick:!1,"data-testid":`grid-back-relation-${r}`,onCheckedChange:()=>{n(r)},children:`← ${s.table}.${s.column}`},r)})]})]})]})},de=l=>{const e=v(19),{count:n,editable:o,onClear:t,onDelete:c}=l,i=E();let s;e[0]!==n||e[1]!==i?(s=i("{count} selected",{count:n}),e[0]=n,e[1]=i,e[2]=s):s=e[2];let r;e[3]!==s?(r=m("span",{className:"font-medium tabular-nums","data-testid":"grid-selection-count",children:s}),e[3]=s,e[4]=r):r=e[4];let a;e[5]!==i?(a=i("Clear"),e[5]=i,e[6]=a):a=e[6];let u;e[7]!==t||e[8]!==a?(u=m("button",{className:L,"data-testid":"grid-selection-clear",onClick:t,type:"button",children:a}),e[7]=t,e[8]=a,e[9]=u):u=e[9];let f;e[10]!==n||e[11]!==o||e[12]!==c||e[13]!==i?(f=o&&m(z,{confirmLabel:i("Delete {count} rows and everything that cascades?",{count:n}),onConfirm:c,testId:"grid-selection-delete",children:i("Delete {count}",{count:n})}),e[10]=n,e[11]=o,e[12]=c,e[13]=i,e[14]=f):f=e[14];let d;return e[15]!==r||e[16]!==u||e[17]!==f?(d=j("div",{className:"flex items-center gap-2 rounded-md border border-border bg-accent/40 px-3 py-1.5 text-xs","data-testid":"grid-selection-bar",children:[r,u,f]}),e[15]=r,e[16]=u,e[17]=f,e[18]=d):d=e[18],d},fe=/\.(?:avif|bmp|gif|ico|jpe?g|png|svg|webp)$/iu,me=l=>{const e=v(9),{bucket:n,objectKey:o,resolveUrl:t}=l,[c,i]=A(null),[s,r]=A(!1);let a,u;e[0]!==n||e[1]!==o||e[2]!==t?(a=()=>{const p={cancelled:!1};return ee((async()=>{try{const C=await t(o,n);p.cancelled||i(C)}catch{p.cancelled||r(!0)}})()),()=>{p.cancelled=!0}},u=[n,o,t],e[0]=n,e[1]=o,e[2]=t,e[3]=a,e[4]=u):(a=e[3],u=e[4]),Y(a,u);let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=()=>{r(!0)},e[5]=f):f=e[5];const d=f;if(c===null||s)return null;let N;return e[6]!==o||e[7]!==c?(N=m("div",{className:"flex max-h-64 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted/30",children:m("img",{alt:o,className:"max-h-64 object-contain","data-testid":"grid-cell-image",onError:d,src:c})}),e[6]=o,e[7]=c,e[8]=N):N=e[8],N},ke=l=>{const e=v(41),{bucket:n,column:o,onClose:t,onFilter:c,resolveUrl:i,value:s}=l,r=E(),[a,u]=A(!1);let f;e[0]!==s?(f=B(s),e[0]=s,e[1]=f):f=e[1];const d=f;let N;e[2]!==d?(N=()=>{Z(d)&&u(!0)},e[2]=d,e[3]=N):N=e[3];const p=N;let C;e[4]!==r?(C=r("Cell value"),e[4]=r,e[5]=C):C=e[5];let g;e[6]!==o?(g=m("h2",{className:"truncate font-mono text-sm font-semibold text-foreground",children:o}),e[6]=o,e[7]=g):g=e[7];let y;e[8]!==c||e[9]!==r?(y=c!==void 0&&m("button",{className:L,"data-testid":"grid-cell-filter",onClick:c,type:"button",children:r("Filter by this value")}),e[8]=c,e[9]=r,e[10]=y):y=e[10];let k;e[11]!==a||e[12]!==r?(k=r(a?"Copied":"Copy"),e[11]=a,e[12]=r,e[13]=k):k=e[13];let x;e[14]!==p||e[15]!==k?(x=m("button",{className:L,"data-testid":"grid-cell-copy",onClick:p,type:"button",children:k}),e[14]=p,e[15]=k,e[16]=x):x=e[16];let S;e[17]!==r?(S=r("Close"),e[17]=r,e[18]=S):S=e[18];let h;e[19]!==t||e[20]!==S?(h=m("button",{className:L,"data-testid":"grid-cell-close",onClick:t,type:"button",children:S}),e[19]=t,e[20]=S,e[21]=h):h=e[21];let b;e[22]!==y||e[23]!==x||e[24]!==h?(b=j("div",{className:"flex items-center gap-1.5",children:[y,x,h]}),e[22]=y,e[23]=x,e[24]=h,e[25]=b):b=e[25];let w;e[26]!==b||e[27]!==g?(w=j("div",{className:"flex items-center justify-between",children:[g,b]}),e[26]=b,e[27]=g,e[28]=w):w=e[28];let _;e[29]!==n||e[30]!==i||e[31]!==s?(_=i!==void 0&&typeof s=="string"&&fe.test(s)&&m(me,{bucket:n,objectKey:s,resolveUrl:i}),e[29]=n,e[30]=i,e[31]=s,e[32]=_):_=e[32];let $;e[33]!==d?($=m("pre",{className:"min-h-0 flex-1 overflow-auto rounded-md border border-border bg-muted/30 p-3 font-mono text-xs whitespace-pre-wrap","data-testid":"grid-cell-value",children:d}),e[33]=d,e[34]=$):$=e[34];let T;return e[35]!==t||e[36]!==w||e[37]!==_||e[38]!==$||e[39]!==C?(T=j(X,{className:"max-h-[70vh] w-[min(40rem,90vw)]",label:C,onClose:t,panelTestId:"grid-cell-dialog",testId:"grid-cell-dialog-overlay",variant:"dialog",children:[w,_,$]}),e[35]=t,e[36]=w,e[37]=_,e[38]=$,e[39]=C,e[40]=T):T=e[40],T},Se=l=>{const e=v(37),{backRelations:n,enabledBackRelations:o,onToggleBackRelation:t,columns:c,editable:i,name:s,onBulkDelete:r,onToggleTranspose:a,rows:u,sqlColumns:f,table:d,transposed:N}=l,p=E();let C;e[0]!==d?(C=d.getSelectedRowModel(),e[0]=d,e[1]=C):C=e[1];const g=C.rows;let y;e[2]!==d?(y=()=>{d.resetRowSelection()},e[2]=d,e[3]=y):y=e[3];const k=y;let x;e[4]!==r||e[5]!==g||e[6]!==d?(x=()=>{r(g.map(ue)),d.resetRowSelection()},e[4]=r,e[5]=g,e[6]=d,e[7]=x):x=e[7];const S=x;let h;e[8]!==c||e[9]!==s||e[10]!==u||e[11]!==f?(h=m(ie,{columns:c,name:s,rows:u,sqlColumns:f}),e[8]=c,e[9]=s,e[10]=u,e[11]=f,e[12]=h):h=e[12];let b;e[13]!==n||e[14]!==o||e[15]!==t||e[16]!==d?(b=m(ae,{backRelations:n,enabledBackRelations:o,onToggleBackRelation:t,table:d}),e[13]=n,e[14]=o,e[15]=t,e[16]=d,e[17]=b):b=e[17];let w;e[18]!==p?(w=p("Swap rows and columns"),e[18]=p,e[19]=w):w=e[19];let _;e[20]!==p?(_=p("Transpose"),e[20]=p,e[21]=_):_=e[21];let $;e[22]!==a||e[23]!==w||e[24]!==_||e[25]!==N?($=m("button",{"aria-pressed":N,className:L,"data-testid":"grid-transpose",onClick:a,title:w,type:"button",children:_}),e[22]=a,e[23]=w,e[24]=_,e[25]=N,e[26]=$):$=e[26];let T;e[27]!==i||e[28]!==k||e[29]!==S||e[30]!==g.length?(T=g.length>0&&m(de,{count:g.length,editable:i,onClear:k,onDelete:S}),e[27]=i,e[28]=k,e[29]=S,e[30]=g.length,e[31]=T):T=e[31];let R;return e[32]!==h||e[33]!==b||e[34]!==$||e[35]!==T?(R=j("div",{className:"flex flex-wrap items-center gap-1.5","data-testid":"grid-actions",children:[h,b,$,T]}),e[32]=h,e[33]=b,e[34]=$,e[35]=T,e[36]=R):R=e[36],R};function ue(l){return l.id}export{ke as C,ie as E,Se as G,de as S,M as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as k}from"react/compiler-runtime";import{useT as M}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{jsxs as $,jsx as p}from"react/jsx-runtime";const w=[25,50,100,250],C=f=>{const e=k(18),{onChange:u,options:m,prefix:a,value:x}=f,t=M();let c;e[0]!==u?(c=h=>{u(Number.parseInt(h.target.value,10))},e[0]=u,e[1]=c):c=e[1];const n=c,b=`${a}-page-size`;let r;e[2]!==t?(r=t("Rows per page"),e[2]=t,e[3]=r):r=e[3];let o;e[4]!==r?(o=p("span",{children:r}),e[4]=r,e[5]=o):o=e[5];const d=`${a}-page-size`,l=`${a}-page-size`;let s;e[6]!==m?(s=m.map(E),e[6]=m,e[7]=s):s=e[7];let i;e[8]!==n||e[9]!==d||e[10]!==l||e[11]!==s||e[12]!==x?(i=p("select",{className:"h-6 rounded-md border border-border bg-background px-1 tabular-nums outline-none focus-visible:border-ring","data-testid":d,id:l,onChange:n,value:x,children:s}),e[8]=n,e[9]=d,e[10]=l,e[11]=s,e[12]=x,e[13]=i):i=e[13];let g;return e[14]!==b||e[15]!==o||e[16]!==i?(g=$("label",{className:"flex items-center gap-1.5",htmlFor:b,children:[o,i]}),e[14]=b,e[15]=o,e[16]=i,e[17]=g):g=e[17],g},j=f=>{const e=k(25),{onJump:u,page:m,pages:a,prefix:x}=f,t=M();let c;e[0]!==u||e[1]!==a?(c=N=>{const P=Number.parseInt(N,10);Number.isNaN(P)||u(Math.min(Math.max(1,P),Math.max(1,a)))},e[0]=u,e[1]=a,e[2]=c):c=e[2];const n=c;let b;e[3]!==n?(b=N=>{N.key==="Enter"&&n(N.currentTarget.value)},e[3]=n,e[4]=b):b=e[4];const r=b;let o;e[5]!==n?(o=N=>{n(N.currentTarget.value)},e[5]=n,e[6]=o):o=e[6];const d=o;let l;e[7]!==t?(l=t("Page"),e[7]=t,e[8]=l):l=e[8];let s;e[9]!==t?(s=t("Page"),e[9]=t,e[10]=s):s=e[10];const i=`${x}-page-jump`,g=Math.max(1,a);let h;e[11]!==d||e[12]!==r||e[13]!==m||e[14]!==s||e[15]!==i||e[16]!==g?(h=p("input",{"aria-label":s,className:"h-6 w-12 rounded-md border border-border bg-background px-1 text-center tabular-nums outline-none focus-visible:border-ring","data-testid":i,defaultValue:m,max:g,min:1,onBlur:d,onKeyDown:r,type:"number"},m),e[11]=d,e[12]=r,e[13]=m,e[14]=s,e[15]=i,e[16]=g,e[17]=h):h=e[17];let v;e[18]!==a||e[19]!==t?(v=t("of {pages}",{pages:a}),e[18]=a,e[19]=t,e[20]=v):v=e[20];let y;return e[21]!==l||e[22]!==h||e[23]!==v?(y=$("span",{className:"flex items-center gap-1.5 tabular-nums",children:[l,h,v]}),e[21]=l,e[22]=h,e[23]=v,e[24]=y):y=e[24],y},_=({hasNext:f,hasPrevious:e,onJumpToPage:u,onNext:m,onPageSizeChange:a,onPrevious:x,pageSize:t,pageSizeOptions:c=w,prefix:n,rangeEnd:b,rangeStart:r,total:o})=>{const d=M(),l="rounded-md border border-border px-2.5 py-1 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50",s=t!==void 0&&t>0?Math.max(1,Math.ceil(o/t)):1,i=t!==void 0&&t>0?Math.floor(Math.max(0,r-1)/t)+1:1;return $("div",{className:"flex w-full items-center justify-between gap-3 text-xs text-muted-foreground",children:[$("div",{className:"flex items-center gap-3",children:[t!==void 0&&a!==void 0&&p(C,{onChange:a,options:c,prefix:n,value:t}),p("span",{className:"tabular-nums","data-testid":`${n}-page-info`,children:d("{rangeStart}-{rangeEnd} of {total}",{rangeEnd:b,rangeStart:r,total:o})})]}),$("div",{className:"flex items-center gap-3",children:[p("button",{className:l,"data-testid":`${n}-prev`,disabled:!e,onClick:x,type:"button",children:d("Previous")}),t!==void 0&&u!==void 0&&p(j,{onJump:u,page:i,pages:s,prefix:n}),p("button",{className:l,"data-testid":`${n}-next`,disabled:!f,onClick:m,type:"button",children:d("Next")})]})]})};function E(f){return p("option",{value:f,children:f},f)}export{_ as G};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{c as _}from"react/compiler-runtime";import{useNavigate as Xe}from"@tanstack/react-router";import{B as et}from"./badge-r_5B4LHP.mjs";import{C as P,a as tt}from"./card-By2O8ULa.mjs";import{E as nt}from"./empty-state-D7jEML_T.mjs";import{u as ve}from"./use-admin-query-BW9IuacC.mjs";import{useT as T}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{ADMIN_FUNCTIONS as ye}from"./ADMIN_FUNCTIONS-B8yyk5BX.mjs";import{c as lt,f as Ne,d as at,w as rt,g as ot,n as it}from"./internal-BXEjuLPN.mjs";import{c as st}from"./utils-bhneXptQ.mjs";import{deriveInsights as ct}from"./DEFAULT_INSIGHT_THRESHOLDS-D5YMT0gM.mjs";import{useState as Ue,useEffect as qe}from"react";import{u as Ke}from"./use-studio-client-DCA50tF2.mjs";import{jsx as a,jsxs as h}from"react/jsx-runtime";import{B as He}from"./button-q0UYSmrn.mjs";const dt=lt(ye.studioFeatures),We={analytics:!0,auth:!0,containers:!0,flags:!0,kv:!0,mail:!0,notifications:!0,payments:!0,privacy:!0,queues:!0,scheduler:!0,storage:!0,vectors:!0,workflows:!0},ut=t=>{if(t===null||typeof t!="object")return;const{id:e,name:n,unsupported:s}=t;if(!(typeof e!="string"||typeof n!="string"||!Array.isArray(s)))return{id:e,name:n,unsupported:s.filter(l=>typeof l=="string")}},mt=t=>{if(t===null||typeof t!="object")return We;const e=t,n=s=>typeof e[s]=="boolean"?e[s]:!0;return{analytics:n("analytics"),auth:n("auth"),containers:n("containers"),flags:n("flags"),kv:n("kv"),mail:n("mail"),notifications:n("notifications"),payments:n("payments"),privacy:n("privacy"),platform:ut(e.platform),queues:n("queues"),scheduler:n("scheduler"),storage:n("storage"),vectors:n("vectors"),workflows:n("workflows")}},ft={...We,settled:!1},pt=()=>{const t=_(3),e=Ke(),[n,s]=Ue(void 0);let l,r;return t[0]!==e?(l=()=>{const i=new AbortController;return Ne((async()=>{let o;try{o={...mt(await e.query(dt,{},at(""))),settled:!0}}catch{o={...We,settled:!0}}i.signal.aborted||s({client:e,features:o})})()),()=>{i.abort()}},r=[e],t[0]=e,t[1]=l,t[2]=r):(l=t[1],r=t[2]),qe(l,r),n?.client===e?n.features:ft},ht=()=>{const t=_(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeWidth:1.6,viewBox:"0 0 24 24",children:a("path",{d:"m9 6 6 6-6 6",strokeLinecap:"round",strokeLinejoin:"round"})}),t[0]=e):e=t[0],e},gt=t=>{const e=_(24),{group:n}=t,s=T(),l=Xe();let r;e[0]!==n.tab||e[1]!==l?(r=()=>{Ne(l({to:`/${n.tab}`}))},e[0]=n.tab,e[1]=l,e[2]=r):r=e[2];const i=r,o=n.bindings.length;let c;e[3]!==n.label?(c=a("span",{className:"text-sm font-medium text-foreground",children:n.label}),e[3]=n.label,e[4]=c):c=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=a(ht,{}),e[5]=u):u=e[5];let m;e[6]!==c?(m=h("div",{className:"flex items-center justify-between",children:[c,u]}),e[6]=c,e[7]=m):m=e[7];let d;e[8]!==o||e[9]!==s?(d=o===1?s("1 binding"):s("{count} bindings",{count:o}),e[8]=o,e[9]=s,e[10]=d):d=e[10];let f;e[11]!==d?(f=a("span",{className:"text-xs text-muted-foreground",children:d}),e[11]=d,e[12]=f):f=e[12];let p;e[13]!==o||e[14]!==n.bindings?(p=o>0&&a("div",{className:"flex flex-wrap gap-1.5",children:n.bindings.map(yt)}),e[13]=o,e[14]=n.bindings,e[15]=p):p=e[15];let g;e[16]!==m||e[17]!==f||e[18]!==p?(g=h(tt,{className:"flex flex-col gap-2 py-4",children:[m,f,p]}),e[16]=m,e[17]=f,e[18]=p,e[19]=g):g=e[19];let x;return e[20]!==n.testId||e[21]!==i||e[22]!==g?(x=a(P,{className:"cursor-pointer gap-0 py-0 transition-colors hover:bg-muted/40","data-testid":n.testId,onClick:i,children:g}),e[20]=n.testId,e[21]=i,e[22]=g,e[23]=x):x=e[23],x},Ve=["kv","files","vectors"],xt=(t,e)=>[...t.filter(n=>n.tab!==e.tab),e].toSorted((n,s)=>Ve.indexOf(n.tab)-Ve.indexOf(s.tab)),bt=()=>{const t=_(19),e=Ke(),n=pt(),s=T();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=[],t[0]=l):l=t[0];const[r,i]=Ue(l);let o,c;if(t[1]!==e||t[2]!==n.kv||t[3]!==n.storage||t[4]!==n.vectors||t[5]!==s?(o=()=>{const g={cancelled:!1},x=[{enabled:n.kv,label:s("KV Namespaces"),load:async()=>(await e.listKvNamespaces()).map(vt),tab:"kv",testId:"home-binding-kv"},{enabled:n.storage,label:s("R2 Buckets"),load:()=>e.listStorageBuckets(),tab:"files",testId:"home-binding-r2"},{enabled:n.vectors,label:s("Vectorize Indexes"),load:async()=>(await e.listVectorIndexes()).map(Nt),tab:"vectors",testId:"home-binding-vectors"}];for(const b of x)b.enabled&&Ne((async()=>{try{const v=await b.load();if(!g.cancelled){const S={bindings:v,label:b.label,tab:b.tab,testId:b.testId};i(w=>xt(w,S))}}catch{}})());return()=>{g.cancelled=!0}},c=[e,n.kv,n.storage,n.vectors,s],t[1]=e,t[2]=n.kv,t[3]=n.storage,t[4]=n.vectors,t[5]=s,t[6]=o,t[7]=c):(o=t[6],c=t[7]),qe(o,c),r.length===0)return null;let u;t[8]!==s?(u=s("Bindings"),t[8]=s,t[9]=u):u=t[9];let m;t[10]!==u?(m=a("h2",{className:"text-sm font-semibold tracking-tight text-foreground",children:u}),t[10]=u,t[11]=m):m=t[11];let d;t[12]!==r?(d=r.map(_t),t[12]=r,t[13]=d):d=t[13];let f;t[14]!==d?(f=a("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:d}),t[14]=d,t[15]=f):f=t[15];let p;return t[16]!==m||t[17]!==f?(p=h("section",{className:"flex flex-col gap-3","data-testid":"home-bindings",children:[m,f]}),t[16]=m,t[17]=f,t[18]=p):p=t[18],p};function yt(t){return a(et,{variant:"secondary",children:t},t)}function vt(t){return t.binding}function Nt(t){return t.name}function _t(t){return a(gt,{group:t},t.tab)}const St=[{name:"lunora_list_functions",summary:"list every query, mutation, and action with its path"},{name:"lunora_list_tables",summary:"list the schema's tables"},{name:"lunora_get_function_schema",summary:"read a function's argument JSON Schema before calling it"},{name:"lunora_run_query",summary:"run a read-only query"},{name:"lunora_run_mutation",summary:"run a mutation — writes; only when LUNORA_MCP_ALLOW_WRITES is set"},{name:"lunora_run_action",summary:"run an action — writes/effects; only when LUNORA_MCP_ALLOW_WRITES is set"}],wt=t=>JSON.stringify({mcpServers:{lunora:{args:["-y","@lunora/mcp"],command:"npx",env:{LUNORA_ADMIN_TOKEN:"<your-admin-token>",LUNORA_URL:t}}}},null,2),kt=t=>{const e=St.map(n=>`- ${n.name} — ${n.summary}`).join(`
|
|
2
|
+
`);return[`You have a Lunora MCP server connected to the deployment at ${t}.`,"It exposes this backend's functions and schema so you can inspect and operate it:",e,"",`Start by calling lunora_list_functions and lunora_list_tables to learn what exists, then lunora_get_function_schema before any run call. The full HTTP API is also documented at ${t}/_lunora/admin/openapi (that endpoint needs the same admin token the MCP server is configured with).`].join(`
|
|
3
|
+
`)},Ct=1500,At=()=>{const t=_(40),e=T(),{url:n}=Ke();let s;t[0]!==n?(s=rt(n),t[0]=n,t[1]=s):s=t[1];const l=s,[r,i]=Ue(null);let o,c;t[2]!==r?(o=()=>{if(r===null)return;const I=globalThis.setTimeout(()=>{i(null)},Ct);return()=>{globalThis.clearTimeout(I)}},c=[r],t[2]=r,t[3]=o,t[4]=c):(o=t[3],c=t[4]),qe(o,c);let u;t[5]===Symbol.for("react.memo_cache_sentinel")?(u=(I,L)=>{ot(L)&&i(I)},t[5]=u):u=t[5];const m=u;let d;t[6]!==l?(d=()=>{m("config",wt(l))},t[6]=l,t[7]=d):d=t[7];const f=d;let p;t[8]!==l?(p=()=>{m("prompt",kt(l))},t[8]=l,t[9]=p):p=t[9];const g=p;let x;t[10]!==e?(x=e("Connect an AI agent"),t[10]=e,t[11]=x):x=t[11];let b;t[12]!==x?(b=a("span",{className:"text-sm font-medium text-foreground",children:x}),t[12]=x,t[13]=b):b=t[13];let v;t[14]!==e?(v=e("Drive this deployment from an AI agent over the Model Context Protocol — it can list functions and tables, read schemas, and run read-only queries. Writes stay off unless you opt in."),t[14]=e,t[15]=v):v=t[15];let S;t[16]!==v?(S=a("span",{className:"text-xs text-muted-foreground",children:v}),t[16]=v,t[17]=S):S=t[17];let w;t[18]!==b||t[19]!==S?(w=h("div",{className:"flex flex-col gap-1.5 p-4",children:[b,S]}),t[18]=b,t[19]=S,t[20]=w):w=t[20];let $;t[21]===Symbol.for("react.memo_cache_sentinel")?($=a("code",{className:"font-mono text-xs text-muted-foreground","data-testid":"home-connect-agent-command",children:"npx -y @lunora/mcp"}),t[21]=$):$=t[21];let y;t[22]!==r||t[23]!==e?(y=e(r==="config"?"Copied":"Copy MCP config"),t[22]=r,t[23]=e,t[24]=y):y=t[24];let k;t[25]!==f||t[26]!==y?(k=a(He,{"data-testid":"home-connect-agent-copy-config",onClick:f,size:"xs",variant:"outline",children:y}),t[25]=f,t[26]=y,t[27]=k):k=t[27];let C;t[28]!==r||t[29]!==e?(C=e(r==="prompt"?"Copied":"Copy agent prompt"),t[28]=r,t[29]=e,t[30]=C):C=t[30];let A;t[31]!==g||t[32]!==C?(A=a(He,{"data-testid":"home-connect-agent-copy-prompt",onClick:g,size:"xs",variant:"outline",children:C}),t[31]=g,t[32]=C,t[33]=A):A=t[33];let N;t[34]!==k||t[35]!==A?(N=h("div",{className:"flex flex-col gap-3 border-t border-border bg-muted/50 px-4 py-3",children:[$,h("div",{className:"flex flex-wrap gap-2",children:[k,A]})]}),t[34]=k,t[35]=A,t[36]=N):N=t[36];let M;return t[37]!==w||t[38]!==N?(M=h(P,{className:"gap-0 py-0","data-testid":"home-connect-agent",children:[w,N]}),t[37]=w,t[38]=N,t[39]=M):M=t[39],M},Mt=112,Qe=32,Le=5,Ge=1,$t=3,It=t=>{const e=t.slice(-16),n=Math.max(0,...e),s=Qe-Le*2,l=(Mt-Le*2)/e.length;return e.map((r,i)=>{const o=n>0?Math.max(0,r)/n*s:0;return{height:Math.max(0,o-$t),width:Math.max(0,l-Ge*2),x:Le+i*l+Ge,y:Qe-Le-o}})},Tt=t=>{const e=_(4),{data:n}=t;let s;e[0]!==n?(s=It(n).map(Lt),e[0]=n,e[1]=s):s=e[1];let l;return e[2]!==s?(l=a("svg",{"aria-hidden":"true",className:"h-8 w-28 fill-foreground","data-testid":"home-sparkline",viewBox:"0 0 112 32",children:s}),e[2]=s,e[3]=l):l=e[3],l};function Lt(t){return a("rect",{height:t.height,rx:2,width:t.width,x:t.x,y:t.y},t.x)}const Ot=3,Rt=(t,e)=>{if(e==null)return t("cache not enabled");const n=e.hits+e.misses;return n===0?t("no cache traffic yet"):`${Math.round(e.hits/n*100).toString()}% ${t("cache hit")}`},Fe=t=>{if(t<1e3)return`${String(Math.round(t))}ms`;const e=t>=1e4?0:1;return`${(t/1e3).toFixed(e)}s`},Et=(t,e)=>{const n=Math.max(0,Math.round((e-t)/1e3));if(n<60)return`${String(n)}s ago`;const s=Math.round(n/60);if(s<60)return`${String(s)}m ago`;const l=Math.round(s/60);return l<24?`${String(l)}h ago`:`${String(Math.round(l/24))}d ago`},Je=(t,e)=>{if(t===void 0||t.length===0)return[];const n=new Map;for(const s of t)n.set(s.bucketMs,(n.get(s.bucketMs)??0)+s[e]);return[...n.entries()].toSorted(([s],[l])=>s-l).map(([,s])=>s)},Ye=(t,e=!0)=>{if(t.length<4)return null;const n=Math.floor(t.length/2),s=t.slice(0,n).reduce((i,o)=>i+o,0),l=t.slice(n).reduce((i,o)=>i+o,0);if(s===0)return null;const r=(l-s)/s*100;return{positive:e?r>=0:r<=0,text:`${r>=0?"+":""}${r.toFixed(1)}%`}},Oe=t=>{const e=_(24),{delta:n,footer:s,label:l,trend:r,unit:i,value:o}=t,c=T();let u;e[0]!==l?(u=a("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:l}),e[0]=l,e[1]=u):u=e[1];let m;e[2]!==o?(m=a("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:o}),e[2]=o,e[3]=m):m=e[3];let d;e[4]!==i?(d=i!==void 0&&a("span",{className:"text-xs text-muted-foreground",children:i}),e[4]=i,e[5]=d):d=e[5];let f;e[6]!==m||e[7]!==d?(f=h("span",{className:"flex items-baseline gap-1.5",children:[m,d]}),e[6]=m,e[7]=d,e[8]=f):f=e[8];let p;e[9]!==r?(p=r!==void 0&&r.length>=Ot&&a(Tt,{data:r}),e[9]=r,e[10]=p):p=e[10];let g;e[11]!==f||e[12]!==p?(g=h("div",{className:"flex items-center justify-between gap-3",children:[f,p]}),e[11]=f,e[12]=p,e[13]=g):g=e[13];let x;e[14]!==u||e[15]!==g?(x=h("div",{className:"flex flex-col gap-2.5 p-4",children:[u,g]}),e[14]=u,e[15]=g,e[16]=x):x=e[16];let b;e[17]!==n||e[18]!==s||e[19]!==c?(b=n==null?s!=null&&a("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px] text-muted-foreground",children:s}):h("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px]",children:[a("span",{className:st("font-semibold",n.positive?"text-success":"text-destructive"),children:n.text})," ",a("span",{className:"text-muted-foreground",children:c("vs. prev.")})]}),e[17]=n,e[18]=s,e[19]=c,e[20]=b):b=e[20];let v;return e[21]!==x||e[22]!==b?(v=h(P,{className:"justify-between gap-0 py-0",children:[x,b]}),e[21]=x,e[22]=b,e[23]=v):v=e[23],v},Bt=()=>{const t=_(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:a("path",{d:"m9 6 6 6-6 6"})}),t[0]=e):e=t[0],e},je=t=>{const e=_(7),{command:n,label:s}=t;let l;e[0]!==s?(l=a("div",{className:"p-4",children:a("span",{className:"text-sm font-medium text-foreground",children:s})}),e[0]=s,e[1]=l):l=e[1];let r;e[2]!==n?(r=a("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5",children:a("code",{className:"font-mono text-xs text-muted-foreground",children:n})}),e[2]=n,e[3]=r):r=e[3];let i;return e[4]!==l||e[5]!==r?(i=h(P,{className:"justify-between gap-0 py-0",children:[l,r]}),e[4]=l,e[5]=r,e[6]=i):i=e[6],i},Ze=t=>{const e=_(18),{count:n,onView:s,testId:l,title:r}=t,i=T();let o;e[0]!==r?(o=a("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:r}),e[0]=r,e[1]=o):o=e[1];let c;e[2]!==n||e[3]!==i?(c=n===null?a("span",{className:"text-xs text-muted-foreground",children:i("No data yet")}):a(et,{variant:n>0?"destructive":"success",children:n>0?n:i("All clear")}),e[2]=n,e[3]=i,e[4]=c):c=e[4];let u;e[5]!==o||e[6]!==c?(u=h("div",{className:"flex items-start justify-between gap-2 p-4",children:[o,c]}),e[5]=o,e[6]=c,e[7]=u):u=e[7];let m;e[8]!==i?(m=i("View"),e[8]=i,e[9]=m):m=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=a(Bt,{}),e[10]=d):d=e[10];let f;e[11]!==s||e[12]!==m?(f=h("button",{className:"flex items-center gap-1 border-t border-border bg-muted/50 px-4 py-2.5 text-[12px] font-medium text-foreground outline-none transition-colors hover:bg-muted focus-visible:bg-muted",onClick:s,type:"button",children:[m,d]}),e[11]=s,e[12]=m,e[13]=f):f=e[13];let p;return e[14]!==u||e[15]!==f||e[16]!==l?(p=h(P,{className:"justify-between gap-0 py-0","data-testid":l,children:[u,f]}),e[14]=u,e[15]=f,e[16]=l,e[17]=p):p=e[17],p},Pt=t=>{const e=_(7),{functions:n}=t,s=T();let l;if(e[0]!==n||e[1]!==s){const r=[...n].toSorted(Ut).slice(0,5);let i;e[3]!==s?(i=s("Top functions"),e[3]=s,e[4]=i):i=e[4];let o;e[5]!==i?(o=a("div",{className:"border-b border-border px-4 py-3",children:a("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:i})}),e[5]=i,e[6]=o):o=e[6],l=h(P,{className:"gap-0 py-0","data-testid":"home-top-functions",children:[o,r.length===0?a("p",{className:"px-4 py-8 text-center text-xs text-muted-foreground",children:s("No functions called yet.")}):h("div",{className:"divide-y divide-border",children:[h("div",{className:"grid grid-cols-[1fr_auto_auto_auto] gap-4 px-4 py-1.5 font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:[a("span",{children:s("Function")}),a("span",{className:"text-end",children:s("Calls")}),a("span",{className:"w-12 text-end",children:s("Avg")}),a("span",{className:"w-8 text-end",children:s("Err")})]}),r.map(qt)]})]}),e[0]=n,e[1]=s,e[2]=l}else l=e[2];return l},Dt=t=>{const e=_(26),{subs:n}=t,s=T();let l;e[0]!==s?(l=s("Live connections"),e[0]=s,e[1]=l):l=e[1];let r;e[2]!==l?(r=a("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:l}),e[2]=l,e[3]=r):r=e[3];const i=n?.totalConnections??0;let o;e[4]!==i?(o=i.toLocaleString(),e[4]=i,e[5]=o):o=e[5];let c;e[6]!==o?(c=a("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:o}),e[6]=o,e[7]=c):c=e[7];let u;e[8]!==s?(u=s("sockets"),e[8]=s,e[9]=u):u=e[9];let m;e[10]!==u?(m=a("span",{className:"text-xs text-muted-foreground",children:u}),e[10]=u,e[11]=m):m=e[11];let d;e[12]!==c||e[13]!==m?(d=h("span",{className:"flex items-baseline gap-1.5",children:[c,m]}),e[12]=c,e[13]=m,e[14]=d):d=e[14];const f=n?.totalSubscriptions??0;let p;e[15]!==f?(p=f.toLocaleString(),e[15]=f,e[16]=p):p=e[16];let g;e[17]!==s?(g=s("active subscriptions"),e[17]=s,e[18]=g):g=e[18];let x;e[19]!==p||e[20]!==g?(x=h("span",{className:"text-[11px] text-muted-foreground",children:[p," ",g]}),e[19]=p,e[20]=g,e[21]=x):x=e[21];let b;return e[22]!==x||e[23]!==r||e[24]!==d?(b=a(P,{"data-testid":"home-live-connections",children:h(tt,{className:"flex flex-col gap-2.5 py-4",children:[r,d,x]})}),e[22]=x,e[23]=r,e[24]=d,e[25]=b):b=e[25],b},jt=t=>{const e=_(7),{entries:n}=t,s=T();let l;if(e[0]!==n||e[1]!==s){const r=Date.now();let i;e[3]!==s?(i=s("Recent activity"),e[3]=s,e[4]=i):i=e[4];let o;e[5]!==i?(o=a("div",{className:"border-b border-border px-4 py-3",children:a("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:i})}),e[5]=i,e[6]=o):o=e[6],l=h(P,{className:"gap-0 py-0","data-testid":"home-recent-activity",children:[o,n.length===0?a("p",{className:"px-4 py-8 text-center text-xs text-muted-foreground",children:s("No recent activity.")}):a("ul",{className:"divide-y divide-border",children:n.slice(0,5).map(c=>h("li",{className:"flex items-center justify-between gap-3 px-4 py-2 text-[13px]",children:[h("span",{className:"flex min-w-0 items-center gap-2",children:[a("span",{"aria-hidden":"true",className:"size-1.5 shrink-0 rounded-full bg-muted-foreground/40"}),h("span",{className:"truncate text-foreground",children:[c.op,c.table!==void 0&&h("span",{className:"text-muted-foreground",children:[" · ",c.table,c.id===void 0?"":`#${c.id}`]})]})]}),a("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:Et(c.ts,r)})]},c.seq))})]}),e[0]=n,e[1]=s,e[2]=l}else l=e[2];return l},Ft=t=>{const e=t.reduce((n,s)=>n+s.calls,0);return e===0?null:t.reduce((n,s)=>n+s.totalDurationMs,0)/e},as=t=>{const e=_(149),{initialShardKey:n}=t,s=T(),l=Xe(),r=n??"";let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={},e[0]=i):i=e[0];let o;e[1]!==r?(o={shardKey:r},e[1]=r,e[2]=o):o=e[2];const c=ve(ye.getMetrics,i,o);let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u={},e[3]=u):u=e[3];let m;e[4]!==r?(m={shardKey:r},e[4]=r,e[5]=m):m=e[5];const d=ve(ye.getFunctionStats,u,m);let f,p;e[6]===Symbol.for("react.memo_cache_sentinel")?(f={},p={shardKey:""},e[6]=f,e[7]=p):(f=e[6],p=e[7]);const g=ve(ye.getSecurityAudit,f,p);let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x={},e[8]=x):x=e[8];let b;e[9]!==r?(b={shardKey:r},e[9]=r,e[10]=b):b=e[10];const v=ve(ye.listSubscriptions,x,b);let S;e[11]===Symbol.for("react.memo_cache_sentinel")?(S={},e[11]=S):S=e[11];let w;e[12]!==r?(w={shardKey:r},e[12]=r,e[13]=w):w=e[13];const $=ve(ye.getAuditLog,S,w),y=c.data??null;let k,C,A,N,M,I,L,O,R,D,j,F,E,B,U,q,K,W;if(e[14]!==$.data||e[15]!==g.data||e[16]!==y||e[17]!==c.data||e[18]!==l||e[19]!==d.data||e[20]!==v.data||e[21]!==s){N=Array.isArray(d.data?.functions)?d.data.functions:[],L=v.data??null;let ke;e[40]!==$.data?(ke=Array.isArray($.data?.entries)?$.data.entries:[],e[40]=$.data,e[41]=ke):ke=e[41],C=ke,M=c.data===void 0||d.data===void 0?null:ct(y,N).length,I=Array.isArray(g.data?.findings)?g.data.findings.length:null;let Ce;e[42]!==l?(Ce=()=>{Ne(l({to:"/security"}))},e[42]=l,e[43]=Ce):Ce=e[43],W=Ce;let Ae;e[44]!==l?(Ae=()=>{Ne(l({to:"/insights"}))},e[44]=l,e[45]=Ae):Ae=e[45],K=Ae;const Me=Je(y?.history,"calls"),$e=Je(y?.history,"errors"),ze=Ft(N),Ie=Math.max(0,...N.map(Kt));let Te;e[46]!==y||e[47]!==s?(Te=y===null?void 0:Rt(s,y.cache),e[46]=y,e[47]=s,e[48]=Te):Te=e[48],A=Te,U="flex flex-col gap-6",q="lunora-home",j="grid gap-3 sm:grid-cols-2 xl:grid-cols-4",F="home-health";const Ee=Ye(Me);let he;e[49]!==s?(he=s("Requests"),e[49]=s,e[50]=he):he=e[50];const Be=y?.requests??0;let ge;e[51]!==Be?(ge=Be.toLocaleString(),e[51]=Be,e[52]=ge):ge=e[52],e[53]!==Me||e[54]!==Ee||e[55]!==he||e[56]!==ge?(E=a(Oe,{delta:Ee,label:he,trend:Me,value:ge}),e[53]=Me,e[54]=Ee,e[55]=he,e[56]=ge,e[57]=E):E=e[57];const Pe=Ye($e,!1);let xe;e[58]!==s?(xe=s("Errors"),e[58]=s,e[59]=xe):xe=e[59];const De=y?.errors??0;let be;e[60]!==De?(be=De.toLocaleString(),e[60]=De,e[61]=be):be=e[61],e[62]!==$e||e[63]!==Pe||e[64]!==xe||e[65]!==be?(B=a(Oe,{delta:Pe,label:xe,trend:$e,value:be}),e[62]=$e,e[63]=Pe,e[64]=xe,e[65]=be,e[66]=B):B=e[66],k=Oe,e[67]!==Ie||e[68]!==s?(O=Ie>0?`${s("max")} ${Fe(Ie)}`:void 0,e[67]=Ie,e[68]=s,e[69]=O):O=e[69],e[70]!==s?(R=s("Avg latency"),e[70]=s,e[71]=R):R=e[71],D=ze===null?"—":Fe(ze),e[14]=$.data,e[15]=g.data,e[16]=y,e[17]=c.data,e[18]=l,e[19]=d.data,e[20]=v.data,e[21]=s,e[22]=k,e[23]=C,e[24]=A,e[25]=N,e[26]=M,e[27]=I,e[28]=L,e[29]=O,e[30]=R,e[31]=D,e[32]=j,e[33]=F,e[34]=E,e[35]=B,e[36]=U,e[37]=q,e[38]=K,e[39]=W}else k=e[22],C=e[23],A=e[24],N=e[25],M=e[26],I=e[27],L=e[28],O=e[29],R=e[30],D=e[31],j=e[32],F=e[33],E=e[34],B=e[35],U=e[36],q=e[37],K=e[38],W=e[39];let z;e[72]!==k||e[73]!==O||e[74]!==R||e[75]!==D?(z=a(k,{footer:O,label:R,value:D}),e[72]=k,e[73]=O,e[74]=R,e[75]=D,e[76]=z):z=e[76];let H;e[77]!==s?(H=s("Database size"),e[77]=s,e[78]=H):H=e[78];const Re=y?.databaseSize??null;let V;e[79]!==Re?(V=it(Re),e[79]=Re,e[80]=V):V=e[80];let Q;e[81]!==A||e[82]!==H||e[83]!==V?(Q=a(Oe,{footer:A,label:H,value:V}),e[81]=A,e[82]=H,e[83]=V,e[84]=Q):Q=e[84];let G;e[85]!==j||e[86]!==F||e[87]!==E||e[88]!==B||e[89]!==z||e[90]!==Q?(G=h("div",{className:j,"data-testid":F,children:[E,B,z,Q]}),e[85]=j,e[86]=F,e[87]=E,e[88]=B,e[89]=z,e[90]=Q,e[91]=G):G=e[91];let _e;e[92]===Symbol.for("react.memo_cache_sentinel")?(_e=a(bt,{}),e[92]=_e):_e=e[92];let J;e[93]!==N?(J=a("div",{className:"lg:col-span-2",children:a(Pt,{functions:N})}),e[93]=N,e[94]=J):J=e[94];let Y;e[95]!==L?(Y=a(Dt,{subs:L}),e[95]=L,e[96]=Y):Y=e[96];let Z;e[97]!==C?(Z=a(jt,{entries:C}),e[97]=C,e[98]=Z):Z=e[98];let X;e[99]!==Y||e[100]!==Z?(X=h("div",{className:"flex flex-col gap-3",children:[Y,Z]}),e[99]=Y,e[100]=Z,e[101]=X):X=e[101];let ee;e[102]!==J||e[103]!==X?(ee=h("div",{className:"grid gap-3 lg:grid-cols-3",children:[J,X]}),e[102]=J,e[103]=X,e[104]=ee):ee=e[104];let te;e[105]!==s?(te=s("Advisors"),e[105]=s,e[106]=te):te=e[106];let se;e[107]!==te?(se=a("h2",{className:"text-sm font-semibold tracking-tight text-foreground",children:te}),e[107]=te,e[108]=se):se=e[108];let ne;e[109]!==M||e[110]!==I||e[111]!==s||e[112]!==K||e[113]!==W?(ne=I===0&&M===0?a(nt,{description:s("No security or performance issues detected."),icon:h("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[a("path",{d:"M12 3 4 6v5c0 5 3.4 8.5 8 10 4.6-1.5 8-5 8-10V6l-8-3Z"}),a("path",{d:"m9 12 2 2 4-4"})]}),testId:"home-advisors-clear",title:s("No issues found")}):h("div",{className:"grid gap-3 sm:grid-cols-2",children:[a(Ze,{count:I,onView:W,testId:"home-security",title:s("Security findings")}),a(Ze,{count:M,onView:K,testId:"home-performance",title:s("Performance issues")})]}),e[109]=M,e[110]=I,e[111]=s,e[112]=K,e[113]=W,e[114]=ne):ne=e[114];let le;e[115]!==se||e[116]!==ne?(le=h("section",{className:"flex flex-col gap-3","data-testid":"home-advisors",children:[se,ne]}),e[115]=se,e[116]=ne,e[117]=le):le=e[117];let ae;e[118]!==s?(ae=s("Get connected"),e[118]=s,e[119]=ae):ae=e[119];let re;e[120]!==ae?(re=a("h2",{className:"text-sm font-semibold tracking-tight text-foreground",children:ae}),e[120]=ae,e[121]=re):re=e[121];let oe;e[122]!==s?(oe=s("Client SDK"),e[122]=s,e[123]=oe):oe=e[123];let ie;e[124]!==oe?(ie=a(je,{command:"npm i @lunora/client",label:oe}),e[124]=oe,e[125]=ie):ie=e[125];let ce;e[126]!==s?(ce=s("React"),e[126]=s,e[127]=ce):ce=e[127];let de;e[128]!==ce?(de=a(je,{command:"npm i @lunora/react",label:ce}),e[128]=ce,e[129]=de):de=e[129];let ue;e[130]!==s?(ue=s("CLI"),e[130]=s,e[131]=ue):ue=e[131];let me;e[132]!==ue?(me=a(je,{command:"lunora dev",label:ue}),e[132]=ue,e[133]=me):me=e[133];let fe;e[134]!==ie||e[135]!==de||e[136]!==me?(fe=h("div",{className:"grid gap-3 sm:grid-cols-3",children:[ie,de,me]}),e[134]=ie,e[135]=de,e[136]=me,e[137]=fe):fe=e[137];let Se;e[138]===Symbol.for("react.memo_cache_sentinel")?(Se=a(At,{}),e[138]=Se):Se=e[138];let pe;e[139]!==re||e[140]!==fe?(pe=h("section",{className:"flex flex-col gap-3","data-testid":"home-get-connected",children:[re,fe,Se]}),e[139]=re,e[140]=fe,e[141]=pe):pe=e[141];let we;return e[142]!==U||e[143]!==q||e[144]!==G||e[145]!==ee||e[146]!==le||e[147]!==pe?(we=h("div",{className:U,"data-testid":q,children:[G,_e,ee,le,pe]}),e[142]=U,e[143]=q,e[144]=G,e[145]=ee,e[146]=le,e[147]=pe,e[148]=we):we=e[148],we};function Ut(t,e){return e.calls-t.calls}function qt(t){return h("div",{className:"grid grid-cols-[1fr_auto_auto_auto] items-center gap-4 px-4 py-2 text-[13px]",children:[a("span",{className:"truncate font-mono text-xs text-foreground",children:t.path}),a("span",{className:"text-end tabular-nums",children:t.calls.toLocaleString()}),a("span",{className:"w-12 text-end tabular-nums text-muted-foreground",children:Fe(t.calls>0?t.totalDurationMs/t.calls:0)}),a("span",{className:st("w-8 text-end tabular-nums",t.errors>0?"text-destructive":"text-muted-foreground"),children:t.errors})]},t.path)}function Kt(t){return t.maxDurationMs}export{as as H,Rt as c,pt as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as d}from"react/compiler-runtime";import{Input as o}from"@base-ui/react/input";import{c as s}from"./utils-bhneXptQ.mjs";import{jsx as u}from"react/jsx-runtime";function m(l){const e=d(10);let i,r,t;e[0]!==l?({className:i,type:t,...r}=l,e[0]=l,e[1]=i,e[2]=r,e[3]=t):(i=e[1],r=e[2],t=e[3]);let n;e[4]!==i?(n=s("h-8 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-xs file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 md:text-xs dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",i),e[4]=i,e[5]=n):n=e[5];let a;return e[6]!==r||e[7]!==n||e[8]!==t?(a=u(o,{type:t,"data-slot":"input",className:n,...r}),e[6]=r,e[7]=n,e[8]=t,e[9]=a):a=e[9],a}export{m as I};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const s=new Set(["ADMIN_FORBIDDEN","FORBIDDEN","UNAUTHORIZED"]),d=(t,n,r,o,i)=>{switch(n){case"action":return t.action(r,o,i);case"mutation":return t.mutation(r,o,{...i,onlineOnly:!0});default:return t.query(r,o,i)}},l=t=>({__lunoraRef:t}),g=t=>{const n=t.trim();return n===""?{}:{shardKey:n}},y=t=>t instanceof Error?t.message:String(t),c=t=>{if(t===null||typeof t!="object"||!("code"in t))return;const{code:n}=t;return typeof n=="string"?n:void 0},h=t=>{const n=c(t);return n!==void 0&&s.has(n)},m=t=>{if(t===null||typeof t!="object"||!("hint"in t))return;const{hint:n}=t;return typeof n=="string"?n:Array.isArray(n)?n.filter(r=>typeof r=="string").join(`
|
|
2
|
+
`):void 0},p=t=>{if(t===null||typeof t!="object"||!("docsUrl"in t))return;const n=t.docsUrl;if(typeof n=="string")try{const{protocol:r}=new URL(n);return r==="http:"||r==="https:"?n:void 0}catch{return}},e=t=>{if(t==null)return"—";if(t<1024)return`${t.toString()} B`;const n=["KB","MB","GB","TB"];let r=t/1024,o=0;for(;r>=1024&&o<n.length-1;)r/=1024,o+=1;return`${r.toFixed(1)} ${n[o]??"TB"}`},a=(t,n)=>typeof n=="bigint"?n.toString():n instanceof ArrayBuffer||ArrayBuffer.isView(n)?`<bytes: ${e(n.byteLength)}>`:n,b=t=>typeof t=="bigint"?t.toString():t,B=t=>{if(t==null)return"";switch(typeof t){case"bigint":case"boolean":case"number":return t.toString();case"string":return t;case"symbol":return t.toString();default:return t instanceof ArrayBuffer||ArrayBuffer.isView(t)?`<bytes: ${e(t.byteLength)}>`:JSON.stringify(t,a)}},f=(t,n)=>{t.catch(r=>{n?.(r)})},u=t=>{if(t!==void 0&&t!=="")return t;const n=globalThis.location;return n?.origin!==void 0&&n.origin!==""?n.origin:"http://localhost:5173"},w=t=>{let n=u(t);for(;n.endsWith("/");)n=n.slice(0,-1);return n},T=t=>{const n="navigator"in globalThis?globalThis.navigator.clipboard:void 0;return n===void 0?!1:(f(n.writeText(t)),!0)},S=(t,n="")=>{if(t==null||t==="")return n;const r=new Date(t);return Number.isNaN(r.getTime())?String(t):r.toLocaleString()};export{p as a,y as b,l as c,g as d,m as e,f,T as g,S as h,h as i,c as j,a as k,B as l,d as m,e as n,b as o,u as r,w};
|