@lunora/studio 1.0.0-alpha.106 → 1.0.0-alpha.108
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/dist/index.d.ts +15 -2
- package/dist/index.js +1 -1
- package/dist/mount.js +1 -1
- package/dist/packem_chunks/AdvisorHealthPanel.js +1 -1
- package/dist/packem_chunks/ApiTab.js +1 -1
- package/dist/packem_chunks/AuditPanel.js +1 -1
- package/dist/packem_chunks/DeploymentHealthPanel.js +1 -1
- package/dist/packem_chunks/ExportImportPanel.js +3 -3
- package/dist/packem_chunks/FileBrowser.js +4 -4
- package/dist/packem_chunks/FunctionRunner.js +1 -1
- package/dist/packem_chunks/FunctionStatsPanel.js +1 -1
- package/dist/packem_chunks/HealthPanel.js +1 -1
- package/dist/packem_chunks/InsightsPanel.js +1 -1
- package/dist/packem_chunks/LogsPanel.js +1 -1
- package/dist/packem_chunks/MailPanel.js +1 -1
- package/dist/packem_chunks/MetricsPanel.js +1 -1
- package/dist/packem_chunks/NotificationsPanel.js +1 -1
- package/dist/packem_chunks/PitrPanel.js +1 -1
- package/dist/packem_chunks/SchemaViewer.js +1 -1
- package/dist/packem_chunks/SecurityAdvisorPanel.js +1 -1
- package/dist/packem_chunks/SettingsPanel.js +1 -1
- package/dist/packem_chunks/SqlEditorPanel.js +6 -6
- package/dist/packem_chunks/TableEditor.js +1 -1
- package/dist/packem_chunks/agents-panel.js +1 -1
- package/dist/packem_chunks/analytics-panel.js +1 -1
- package/dist/packem_chunks/auth-audit-panel.js +1 -1
- package/dist/packem_chunks/auth-config-panel.js +1 -1
- package/dist/packem_chunks/auth-sessions-panel.js +1 -1
- package/dist/packem_chunks/containers-panel.js +1 -1
- package/dist/packem_chunks/dashboards-panel.js +1 -1
- package/dist/packem_chunks/evals-panel.js +1 -1
- package/dist/packem_chunks/fanout-panel.js +1 -1
- package/dist/packem_chunks/flags-panel.js +1 -1
- package/dist/packem_chunks/issues-panel.js +1 -1
- package/dist/packem_chunks/kv-browser.js +1 -1
- package/dist/packem_chunks/log-drains-panel.js +4 -4
- package/dist/packem_chunks/migrations-route.js +1 -1
- package/dist/packem_chunks/organizations-panel.js +1 -1
- package/dist/packem_chunks/payments-panel.js +1 -1
- package/dist/packem_chunks/permissions-panel.js +1 -1
- package/dist/packem_chunks/queues-panel.js +1 -1
- package/dist/packem_chunks/rls-panel.js +1 -1
- package/dist/packem_chunks/schedule-panel.js +1 -1
- package/dist/packem_chunks/sparkline.js +1 -1
- package/dist/packem_chunks/storage-rules-panel.js +1 -1
- package/dist/packem_chunks/subscriptions-panel.js +1 -1
- package/dist/packem_chunks/sync-client-panel.js +1 -1
- package/dist/packem_chunks/traces-panel.js +1 -1
- package/dist/packem_chunks/users-panel.js +1 -1
- package/dist/packem_chunks/vector-browser.js +1 -1
- package/dist/packem_chunks/workflows-panel.js +1 -1
- package/dist/packem_shared/ApiDocsPanel-BQ79UVEg.js +2 -0
- package/dist/packem_shared/ApiReferencePanel-CkCFMCBb.js +1 -0
- package/dist/packem_shared/CommandPalette-B5yLEABs.js +1 -0
- package/dist/packem_shared/ConfirmButton-Cj2SOapE.js +1 -0
- package/dist/packem_shared/ConnectionBadge-Bh16X9-u.js +1 -0
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-DuULO4XM.js +1 -0
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-1Lrg55IV.js +1 -0
- package/dist/packem_shared/DEFAULT_LOCALE-A1Yg5ORA.js +1 -0
- package/dist/packem_shared/DataBrowser-BnDIFN-S.js +1 -0
- package/dist/packem_shared/DataFilters-3nbW0uax.js +1 -0
- package/dist/packem_shared/ErrorBoundary-BWNF98VF.js +1 -0
- package/dist/packem_shared/GlobalDataBrowser-DusjXzRF.js +1 -0
- package/dist/packem_shared/HomePanel-BcaHVBJh.js +1 -0
- package/dist/packem_shared/MigrationsPanel-CCOENX4X.js +1 -0
- package/dist/packem_shared/OpenRpcReferencePanel-21OWMH45.js +1 -0
- package/dist/packem_shared/ScheduledJobs-CiO3eXgI.js +1 -0
- package/dist/packem_shared/ShardInput-XumEzeT0.js +1 -0
- package/dist/packem_shared/Studio-CHmLCjBR.js +1 -0
- package/dist/packem_shared/StudioApp-DCdbsciH.js +1 -0
- package/dist/packem_shared/StudioI18nProvider-Bl547evf.js +1 -0
- package/dist/packem_shared/advisor-view-C1KFTXSH.js +1 -0
- package/dist/packem_shared/aggregateMetrics-A-Y7OH6R.js +1 -0
- package/dist/packem_shared/alert-C2SEhYS9.js +1 -0
- package/dist/packem_shared/{badge-BbuuAio7.js → badge-cAk9Di1Q.js} +1 -1
- package/dist/packem_shared/bar-chart-CCyO67Uf.js +6 -0
- package/dist/packem_shared/browser-storage-Br_bLeBt.js +1 -0
- package/dist/packem_shared/{button-BkCrNcAs.js → button-BOPLD1un.js} +1 -1
- package/dist/packem_shared/card-BGlQzQY-.js +1 -0
- package/dist/packem_shared/cf-links-CBJ5SywP.js +1 -0
- package/dist/packem_shared/{checkbox-StT4Gob6.js → checkbox-C5w53W-E.js} +1 -1
- package/dist/packem_shared/data-grid-BFTQnkXq.js +1 -0
- package/dist/packem_shared/data-view-params-qoSTqjAj.js +1 -0
- package/dist/packem_shared/dropdown-menu-D_ewqsUU.js +2 -0
- package/dist/packem_shared/empty-state-B939z6K2.js +1 -0
- package/dist/packem_shared/error-alert-TYdKetJd.js +1 -0
- package/dist/packem_shared/grid-features-C_yXlMc_.js +6 -0
- package/dist/packem_shared/home-panel-BiJHXeDC.js +3 -0
- package/dist/packem_shared/input-CY5W3wzv.js +1 -0
- package/dist/packem_shared/internal-CwaF9YNk.js +2 -0
- package/dist/packem_shared/label-BOUo-DP0.js +1 -0
- package/dist/packem_shared/live-status-Bf7rR8o8.js +1 -0
- package/dist/packem_shared/{log-fields-CoL3hsIQ.js → log-fields-SBxKyBug.js} +1 -1
- package/dist/packem_shared/log-line-UnE93Ovi.js +1 -0
- package/dist/packem_shared/modal-shell-wGW4CKEW.js +1 -0
- package/dist/packem_shared/operation-console-provider-DoloEvon.js +1 -0
- package/dist/packem_shared/recording-client-CKn4-vUx.js +1 -0
- package/dist/packem_shared/reference-view-CUIDzLf0.js +12 -0
- package/dist/packem_shared/result-chart-Ca3YLzt8.js +1 -0
- package/dist/packem_shared/schema-diagram-DHD13TjS.js +2 -0
- package/dist/packem_shared/scroll-area-DSJftwu_.js +2 -0
- package/dist/packem_shared/select-BPISLTcv.js +2 -0
- package/dist/packem_shared/shard-history-QcjcMnCA.js +1 -0
- package/dist/packem_shared/skeleton-DFBBaJU6.js +1 -0
- package/dist/packem_shared/sparkline-BreIqzDO.js +1 -0
- package/dist/packem_shared/stat-card-B9uIvAHg.js +1 -0
- package/dist/packem_shared/{storage-tier-DznqOf-q.js → storage-tier-C2mKwYRj.js} +1 -1
- package/dist/packem_shared/studio-B3eEcBK0.js +2 -0
- package/dist/packem_shared/table-BMsuYFhk.js +2 -0
- package/dist/packem_shared/table-list-sidebar-Bluzd1_2.js +1 -0
- package/dist/packem_shared/textarea-DpO3i-Qo.js +1 -0
- package/dist/packem_shared/{trace-handoff-Dw7mwjxu.js → trace-handoff-C0CFV2ix.js} +1 -1
- package/dist/packem_shared/use-admin-query-P0RJrjsD.js +1 -0
- package/dist/packem_shared/use-async-submit-DdLd0MdK.js +1 -0
- package/dist/packem_shared/use-auth-config-z3KRWAqD.js +1 -0
- package/dist/packem_shared/use-open-trace-4tIa0SXZ.js +1 -0
- package/dist/packem_shared/use-shard-key-BsP3o5wT.js +1 -0
- package/dist/packem_shared/use-sql-assistant-CP90nLLh.js +1 -0
- package/dist/packem_shared/useDebounced-DVeQ5-oW.js +1 -0
- package/dist/packem_shared/virtual-rect-D_j7aLxX.js +1 -0
- package/dist/packem_shared/wire-codec-Dl3VeNrd.js +1 -0
- package/dist/standalone/chunk-25OIGX2A.js +1 -0
- package/dist/standalone/{chunk-OBMNLQWG.js → chunk-26VREVWU.js} +1 -1
- package/dist/standalone/chunk-2BDM6HNL.js +1 -0
- package/dist/standalone/{chunk-6WB63KTN.js → chunk-2DC6F7NH.js} +1 -1
- package/dist/standalone/chunk-3F5I435D.js +1 -0
- package/dist/standalone/{chunk-RJS7UD5U.js → chunk-3QB5JI32.js} +1 -1
- package/dist/standalone/chunk-3RYEUXY2.js +1 -0
- package/dist/standalone/chunk-44WNSIGQ.js +1 -0
- package/dist/standalone/chunk-45YWYMD5.js +1 -0
- package/dist/standalone/chunk-4MAJFNON.js +1 -0
- package/dist/standalone/chunk-4YTSKL4R.js +1 -0
- package/dist/standalone/chunk-57VX76PR.js +1 -0
- package/dist/standalone/chunk-5JLIP2HH.js +1 -0
- package/dist/standalone/chunk-5NRQIDQA.js +1 -0
- package/dist/standalone/{chunk-2ZG23BA5.js → chunk-5T7KRUPX.js} +1 -1
- package/dist/standalone/chunk-6FWN26RH.js +1 -0
- package/dist/standalone/chunk-6JGXSMKV.js +1 -0
- package/dist/standalone/{chunk-HX7IXD7I.js → chunk-6NJAHOGO.js} +1 -1
- package/dist/standalone/chunk-6SAAMM4S.js +1 -0
- package/dist/standalone/{chunk-IUYFXK4X.js → chunk-6ZPTNC34.js} +6 -6
- package/dist/standalone/chunk-74ASA4WU.js +1 -0
- package/dist/standalone/{chunk-6ST5ECQA.js → chunk-7PIHTTND.js} +1 -1
- package/dist/standalone/{chunk-GMR677FL.js → chunk-7SROZWKL.js} +1 -1
- package/dist/standalone/chunk-AECDJKXB.js +1 -0
- package/dist/standalone/{chunk-2PJNAWB3.js → chunk-AFKLFS74.js} +1 -1
- package/dist/standalone/chunk-AOAJGSYZ.js +2 -0
- package/dist/standalone/chunk-AOE75NAT.js +1 -0
- package/dist/standalone/{chunk-HFRJMPXJ.js → chunk-APRVSWBH.js} +27 -27
- package/dist/standalone/{chunk-LWE6NWQX.js → chunk-BELLXCN7.js} +1 -1
- package/dist/standalone/chunk-BORG7WUC.js +1 -0
- package/dist/standalone/{chunk-AVAC26HJ.js → chunk-BQK2C2Z4.js} +1 -1
- package/dist/standalone/chunk-BRHTM6FU.js +1 -0
- package/dist/standalone/{chunk-MWIKAR7F.js → chunk-BWEXJENB.js} +1 -1
- package/dist/standalone/chunk-C5E5PLJT.js +4 -0
- package/dist/standalone/chunk-C7E4I7JZ.js +1 -0
- package/dist/standalone/{chunk-QWGT25SE.js → chunk-CAOUXOL7.js} +1 -1
- package/dist/standalone/chunk-CEPMQS24.js +6 -0
- package/dist/standalone/chunk-CKTKI4IY.js +1 -0
- package/dist/standalone/{chunk-IC4L6G56.js → chunk-CN2AINNY.js} +1 -1
- package/dist/standalone/chunk-CP4ZFBVW.js +1 -0
- package/dist/standalone/chunk-CYX3OHJ3.js +1 -0
- package/dist/standalone/{chunk-7P7NURTD.js → chunk-D7DUQS2Y.js} +1 -1
- package/dist/standalone/{chunk-QBWRC5YX.js → chunk-DKSLOJDQ.js} +1 -1
- package/dist/standalone/chunk-DL3UOEWN.js +1 -0
- package/dist/standalone/chunk-DPNEFSEC.js +1 -0
- package/dist/standalone/{chunk-BGBLQ563.js → chunk-DUDQV6XJ.js} +1 -1
- package/dist/standalone/chunk-EDHW2EEG.js +1 -0
- package/dist/standalone/chunk-EYGF6TQS.js +1 -0
- package/dist/standalone/chunk-F7JOSNAT.js +1 -0
- package/dist/standalone/{chunk-7QOXFLZB.js → chunk-FBAZHG35.js} +1 -1
- package/dist/standalone/chunk-FLCK2WWQ.js +1 -0
- package/dist/standalone/chunk-FSWPREH3.js +1 -0
- package/dist/standalone/{chunk-ZCNMXKF2.js → chunk-GIRZD3UB.js} +2 -2
- package/dist/standalone/chunk-GZMBMNL3.js +6 -0
- package/dist/standalone/chunk-HPX3IM45.js +13 -0
- package/dist/standalone/{chunk-KUVMORDQ.js → chunk-INBA3473.js} +1 -1
- package/dist/standalone/{chunk-T6VMSOBB.js → chunk-INQICZYC.js} +1 -1
- package/dist/standalone/chunk-IWNVQHF7.js +1 -0
- package/dist/standalone/chunk-IWOZGUI2.js +1 -0
- package/dist/standalone/chunk-IYWVSMAY.js +1 -0
- package/dist/standalone/chunk-JURAVSE7.js +1 -0
- package/dist/standalone/chunk-JUWOEHDD.js +1 -0
- package/dist/standalone/{chunk-4UOFSGUS.js → chunk-JV7KTJPY.js} +1 -1
- package/dist/standalone/{chunk-XVD7HWY7.js → chunk-JVAYDDMK.js} +1 -1
- package/dist/standalone/chunk-KEKIGANB.js +1 -0
- package/dist/standalone/chunk-KFZ37KQP.js +1 -0
- package/dist/standalone/chunk-KQIHXYE6.js +1 -0
- package/dist/standalone/chunk-L4EZAHCD.js +1 -0
- package/dist/standalone/chunk-L7CJ5PGH.js +1 -0
- package/dist/standalone/{chunk-5MJ3G4DY.js → chunk-LT4XQDD2.js} +1 -1
- package/dist/standalone/chunk-M3NNNOD5.js +1 -0
- package/dist/standalone/chunk-MBEIKVJH.js +1 -0
- package/dist/standalone/chunk-MCLM2QJI.js +1 -0
- package/dist/standalone/chunk-METRMDIQ.js +1 -0
- package/dist/standalone/{chunk-OKQ3NJOW.js → chunk-MGC6PRMV.js} +1 -1
- package/dist/standalone/chunk-MOUI44OT.js +1 -0
- package/dist/standalone/{chunk-DRR3KV5L.js → chunk-MSFUDXBA.js} +1 -1
- package/dist/standalone/chunk-NIX2QSSN.js +1 -0
- package/dist/standalone/chunk-NXXGISFB.js +1 -0
- package/dist/standalone/{chunk-SBZXUGZ7.js → chunk-OE4KGVJW.js} +4 -4
- package/dist/standalone/chunk-OG57FC7W.js +1 -0
- package/dist/standalone/chunk-OLQWBGKT.js +1 -0
- package/dist/standalone/{chunk-F2I4JLFR.js → chunk-OOBJFXYB.js} +1 -1
- package/dist/standalone/chunk-P52BY657.js +1 -0
- package/dist/standalone/chunk-PHHMPYEP.js +1 -0
- package/dist/standalone/{chunk-6KWKX3RH.js → chunk-PJDKRUWT.js} +1 -1
- package/dist/standalone/chunk-PZ4QDWTI.js +1 -0
- package/dist/standalone/chunk-QZ55OWAB.js +4 -0
- package/dist/standalone/chunk-R5ZTCHCE.js +1 -0
- package/dist/standalone/chunk-RBUVNO22.js +1 -0
- package/dist/standalone/{chunk-XBDKZZ67.js → chunk-RCZTUWG3.js} +1 -1
- package/dist/standalone/chunk-S77D4SHR.js +1 -0
- package/dist/standalone/chunk-SL5R7WBN.js +1 -0
- package/dist/standalone/chunk-SMKRXJUC.js +1 -0
- package/dist/standalone/{chunk-THIXMMZD.js → chunk-SPDZUX4P.js} +1 -1
- package/dist/standalone/chunk-T2LDA6WP.js +1 -0
- package/dist/standalone/{chunk-5UY7MLRC.js → chunk-T6HLABZW.js} +1 -1
- package/dist/standalone/{chunk-BDHAGUAY.js → chunk-TBXK3FKP.js} +4 -4
- package/dist/standalone/{chunk-7QIFDWQV.js → chunk-TFMQSCGC.js} +1 -1
- package/dist/standalone/chunk-TLPWZ5NI.js +3 -0
- package/dist/standalone/chunk-TNKECJW4.js +1 -0
- package/dist/standalone/{chunk-XQCVZAGU.js → chunk-UANVABQG.js} +1 -1
- package/dist/standalone/chunk-UIF57LBO.js +1 -0
- package/dist/standalone/chunk-V6QPVFDL.js +1 -0
- package/dist/standalone/chunk-VNTEQQPP.js +1 -0
- package/dist/standalone/chunk-VR3UJA7B.js +1 -0
- package/dist/standalone/{chunk-5DVJR52Z.js → chunk-VYW2PAWC.js} +3 -3
- package/dist/standalone/chunk-VZCS5GXZ.js +1 -0
- package/dist/standalone/{chunk-XYV7TMYI.js → chunk-WHRG6S5P.js} +1 -1
- package/dist/standalone/{chunk-CKG2DTZ2.js → chunk-WIG3HCUJ.js} +1 -1
- package/dist/standalone/chunk-WUW4ZHRL.js +1 -0
- package/dist/standalone/chunk-X6Q5DWLZ.js +1 -0
- package/dist/standalone/{chunk-Z2IF3TEX.js → chunk-XGIG4EDG.js} +4 -4
- package/dist/standalone/chunk-XJSWM47N.js +1 -0
- package/dist/standalone/chunk-XQS7KSHL.js +1 -0
- package/dist/standalone/chunk-YS7HEZC2.js +1 -0
- package/dist/standalone/chunk-YUWMB6EV.js +1 -0
- package/dist/standalone/{chunk-TMGHRD6W.js → chunk-ZPGNTTQ3.js} +1 -1
- package/dist/standalone/chunk-ZQLIKKIY.js +1 -0
- package/dist/standalone/chunk-ZSOLGJFC.js +1 -0
- package/dist/standalone/studio.js +6 -6
- package/package.json +9 -9
- package/dist/packem_shared/ApiDocsPanel-Cu_QmzO0.js +0 -2
- package/dist/packem_shared/ApiReferencePanel-DuIU1P8B.js +0 -1
- package/dist/packem_shared/CommandPalette-mPR8-vIm.js +0 -1
- package/dist/packem_shared/ConfirmButton-CTL3f3kr.js +0 -1
- package/dist/packem_shared/ConnectionBadge-DOk0CQWo.js +0 -1
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-BCC8_4BQ.js +0 -1
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-B-hcFVoi.js +0 -1
- package/dist/packem_shared/DEFAULT_LOCALE-BZ4NojpD.js +0 -1
- package/dist/packem_shared/DataBrowser-CPNKM0KZ.js +0 -1
- package/dist/packem_shared/DataFilters-B26ZeqBZ.js +0 -1
- package/dist/packem_shared/ErrorBoundary-DvzYskH7.js +0 -1
- package/dist/packem_shared/GlobalDataBrowser-BSmyOO0n.js +0 -1
- package/dist/packem_shared/HomePanel-BUO6BcYQ.js +0 -1
- package/dist/packem_shared/MigrationsPanel-BAnvY79E.js +0 -1
- package/dist/packem_shared/OpenRpcReferencePanel-DXeffPFr.js +0 -1
- package/dist/packem_shared/ScheduledJobs-pHVlh2xU.js +0 -1
- package/dist/packem_shared/ShardInput-BVn2iCU0.js +0 -1
- package/dist/packem_shared/Studio-CD66AkL1.js +0 -1
- package/dist/packem_shared/StudioApp-0Vaayv2I.js +0 -1
- package/dist/packem_shared/StudioI18nProvider-CZ5h4nrV.js +0 -1
- package/dist/packem_shared/advisor-view-CGcwvlMo.js +0 -1
- package/dist/packem_shared/aggregateMetrics-BNfajLa2.js +0 -1
- package/dist/packem_shared/alert-CVcOFuDR.js +0 -1
- package/dist/packem_shared/bar-chart-B8oDHgnw.js +0 -6
- package/dist/packem_shared/browser-storage-xjTyMKY0.js +0 -1
- package/dist/packem_shared/card-BMKx5UdA.js +0 -1
- package/dist/packem_shared/cf-links-Dmg86v1D.js +0 -1
- package/dist/packem_shared/data-grid-Ci4-tZkk.js +0 -1
- package/dist/packem_shared/data-view-params-ClrV7XgF.js +0 -1
- package/dist/packem_shared/dropdown-menu-BgS2zw1i.js +0 -2
- package/dist/packem_shared/empty-state-Cg7t_8qu.js +0 -1
- package/dist/packem_shared/error-alert-_2q2VtVG.js +0 -1
- package/dist/packem_shared/grid-features-Y2YSjhCf.js +0 -6
- package/dist/packem_shared/home-panel-Ir3YHReO.js +0 -3
- package/dist/packem_shared/input-JHu63lTv.js +0 -1
- package/dist/packem_shared/internal-zkEvTqy8.js +0 -2
- package/dist/packem_shared/label-6uP1obNF.js +0 -1
- package/dist/packem_shared/live-status-CmuRLFKf.js +0 -1
- package/dist/packem_shared/log-line-BDI826X-.js +0 -1
- package/dist/packem_shared/modal-shell-CUwwWC2o.js +0 -1
- package/dist/packem_shared/operation-console-provider-BMJNtiyB.js +0 -1
- package/dist/packem_shared/recording-client-DtUxwVNY.js +0 -1
- package/dist/packem_shared/reference-view-DncEStdm.js +0 -12
- package/dist/packem_shared/result-chart-0VgP_3FP.js +0 -1
- package/dist/packem_shared/schema-diagram-GVgnLWTf.js +0 -2
- package/dist/packem_shared/scroll-area-DTEq6Jec.js +0 -2
- package/dist/packem_shared/select-BssZMiFY.js +0 -2
- package/dist/packem_shared/shard-history-DMEW5VBE.js +0 -1
- package/dist/packem_shared/skeleton-C1wQ9M5t.js +0 -1
- package/dist/packem_shared/sparkline-BNvxiJj_.js +0 -1
- package/dist/packem_shared/stat-card-BGJdhfm6.js +0 -1
- package/dist/packem_shared/studio-CUXq5VSB.js +0 -2
- package/dist/packem_shared/table-DZAB8cs3.js +0 -2
- package/dist/packem_shared/table-list-sidebar-fz0m_4I4.js +0 -1
- package/dist/packem_shared/textarea-Bu2-jKAs.js +0 -1
- package/dist/packem_shared/use-admin-query-CnnyWJXM.js +0 -1
- package/dist/packem_shared/use-async-submit-B32whHJO.js +0 -1
- package/dist/packem_shared/use-auth-config-0EnNCdLu.js +0 -1
- package/dist/packem_shared/use-open-trace-CniEgUdp.js +0 -1
- package/dist/packem_shared/use-shard-key-B2JtNa5m.js +0 -1
- package/dist/packem_shared/use-sql-assistant-Dtw55kKM.js +0 -1
- package/dist/packem_shared/useDebounced-CU-uftxO.js +0 -1
- package/dist/packem_shared/virtual-rect-1o1veP7R.js +0 -1
- package/dist/packem_shared/wire-codec-DkrdsFXO.js +0 -1
- package/dist/standalone/chunk-25IDU7IW.js +0 -1
- package/dist/standalone/chunk-2OUPA2WJ.js +0 -1
- package/dist/standalone/chunk-2QSHLBCO.js +0 -1
- package/dist/standalone/chunk-3C3CG7ZK.js +0 -1
- package/dist/standalone/chunk-3CWGJYBB.js +0 -1
- package/dist/standalone/chunk-3DH35OZ5.js +0 -1
- package/dist/standalone/chunk-3SCGCJYS.js +0 -1
- package/dist/standalone/chunk-3XIESWL4.js +0 -1
- package/dist/standalone/chunk-54MMVNPT.js +0 -1
- package/dist/standalone/chunk-5RIKPDDA.js +0 -1
- package/dist/standalone/chunk-5Y3QLNWX.js +0 -1
- package/dist/standalone/chunk-63D4ABMW.js +0 -1
- package/dist/standalone/chunk-6QBOXH2I.js +0 -1
- package/dist/standalone/chunk-7CZI2HNL.js +0 -1
- package/dist/standalone/chunk-7T7UOTYK.js +0 -1
- package/dist/standalone/chunk-7UP7OQJG.js +0 -1
- package/dist/standalone/chunk-AXQU7ULF.js +0 -1
- package/dist/standalone/chunk-BCOT3QRZ.js +0 -1
- package/dist/standalone/chunk-BG5ELOW6.js +0 -1
- package/dist/standalone/chunk-BXJPPINU.js +0 -1
- package/dist/standalone/chunk-BZDIRP7L.js +0 -1
- package/dist/standalone/chunk-C3YACIEE.js +0 -1
- package/dist/standalone/chunk-CAOA5AM4.js +0 -1
- package/dist/standalone/chunk-CFPZYHPY.js +0 -2
- package/dist/standalone/chunk-CZZWYUTR.js +0 -1
- package/dist/standalone/chunk-DJZYD5I5.js +0 -1
- package/dist/standalone/chunk-DNEIBTLL.js +0 -1
- package/dist/standalone/chunk-EF5J67J3.js +0 -1
- package/dist/standalone/chunk-EJWTF334.js +0 -1
- package/dist/standalone/chunk-EP4JQH5X.js +0 -1
- package/dist/standalone/chunk-ESVP44Y3.js +0 -1
- package/dist/standalone/chunk-EXL35M7T.js +0 -1
- package/dist/standalone/chunk-F3J6ER2V.js +0 -13
- package/dist/standalone/chunk-FURI47Z2.js +0 -1
- package/dist/standalone/chunk-FZ2N52BV.js +0 -1
- package/dist/standalone/chunk-GG6PIGQO.js +0 -1
- package/dist/standalone/chunk-GRL5MG3Z.js +0 -1
- package/dist/standalone/chunk-HBSEWNIR.js +0 -1
- package/dist/standalone/chunk-HLENOQDN.js +0 -1
- package/dist/standalone/chunk-HPFLBYRI.js +0 -1
- package/dist/standalone/chunk-HUF7RMS3.js +0 -1
- package/dist/standalone/chunk-I6A5C46N.js +0 -1
- package/dist/standalone/chunk-IBPWTHHW.js +0 -1
- package/dist/standalone/chunk-IGCNMZSB.js +0 -1
- package/dist/standalone/chunk-IVFHIQOT.js +0 -1
- package/dist/standalone/chunk-KZRWBSYQ.js +0 -1
- package/dist/standalone/chunk-LEDWUPXM.js +0 -1
- package/dist/standalone/chunk-MLT5MMMY.js +0 -1
- package/dist/standalone/chunk-OENUM3OW.js +0 -1
- package/dist/standalone/chunk-QLQADHFE.js +0 -1
- package/dist/standalone/chunk-RA5DW5MU.js +0 -1
- package/dist/standalone/chunk-RFSPHFKM.js +0 -1
- package/dist/standalone/chunk-RMN2JN4S.js +0 -1
- package/dist/standalone/chunk-S23KCFVU.js +0 -1
- package/dist/standalone/chunk-S4665UG5.js +0 -4
- package/dist/standalone/chunk-SD4BERSA.js +0 -1
- package/dist/standalone/chunk-SFDOII3B.js +0 -1
- package/dist/standalone/chunk-SMIESS7P.js +0 -1
- package/dist/standalone/chunk-SY6ANTKE.js +0 -1
- package/dist/standalone/chunk-TCV7MMYR.js +0 -1
- package/dist/standalone/chunk-UFESYXCE.js +0 -6
- package/dist/standalone/chunk-UKI2ZYB2.js +0 -1
- package/dist/standalone/chunk-UTK6JUTY.js +0 -1
- package/dist/standalone/chunk-V53KNYRN.js +0 -1
- package/dist/standalone/chunk-VIJLMIC3.js +0 -1
- package/dist/standalone/chunk-VOY5EALQ.js +0 -1
- package/dist/standalone/chunk-VR3OBMGZ.js +0 -1
- package/dist/standalone/chunk-WJCKVELA.js +0 -1
- package/dist/standalone/chunk-WJQLNYGX.js +0 -1
- package/dist/standalone/chunk-WPK2Q33V.js +0 -6
- package/dist/standalone/chunk-WQH3LT2P.js +0 -1
- package/dist/standalone/chunk-WZ65AZKA.js +0 -1
- package/dist/standalone/chunk-XEGWCG5S.js +0 -1
- package/dist/standalone/chunk-XFGE43TZ.js +0 -1
- package/dist/standalone/chunk-XNSCEAHM.js +0 -4
- package/dist/standalone/chunk-XXQUMVWH.js +0 -1
- package/dist/standalone/chunk-Y32QIKBS.js +0 -1
- package/dist/standalone/chunk-YJ25NVR2.js +0 -3
- package/dist/standalone/chunk-ZJGP6EKR.js +0 -1
- /package/dist/standalone/{chunk-XF2B7P5A.js → chunk-W2JBKQNU.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as
|
|
1
|
+
import{c as D}from"react/compiler-runtime";import{useState as j}from"react";import{E as K}from"../packem_shared/error-alert-TYdKetJd.js";import{B as L}from"../packem_shared/badge-cAk9Di1Q.js";import{B as F}from"../packem_shared/button-BOPLD1un.js";import{C as O,a as Q}from"../packem_shared/card-BGlQzQY-.js";import{E as U}from"../packem_shared/empty-state-B939z6K2.js";import{I as q}from"../packem_shared/input-CY5W3wzv.js";import{T as G,a as J,b as H,c as h,d as X,e as u}from"../packem_shared/table-BMsuYFhk.js";import{u as Y}from"../packem_shared/use-admin-query-P0RJrjsD.js";import{useT as Z}from"../packem_shared/DEFAULT_LOCALE-A1Yg5ORA.js";import{ADMIN_FUNCTIONS as _}from"../packem_shared/ADMIN_FUNCTIONS-4aE59aDq.js";import{i as ee}from"../packem_shared/internal-CwaF9YNk.js";import{jsx as t,jsxs as x}from"react/jsx-runtime";const te=e=>e==="ok"?"success":e==="failed"?"destructive":e==="expired"?"warning":"secondary",M=e=>e.endpoint??e.id,ge=()=>{const e=D(38),r=Z(),[a,P]=j("all"),[n,V]=j("");let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={},e[0]=b):b=e[0];const{data:T,error:i,errorSource:p,isLoading:v,refetch:g}=Y(_.listPushSubscriptions,b);let N;if(e[1]!==T?.subscriptions||e[2]!==i||e[3]!==p||e[4]!==v||e[5]!==a||e[6]!==g||e[7]!==n||e[8]!==r){const I=T?.subscriptions??[],$=n.trim().toLowerCase(),A=I.filter(s=>a!=="all"&&s.kind!==a?!1:$===""?!0:`${M(s)} ${s.userId??""}`.toLowerCase().includes($));let w;e[10]===Symbol.for("react.memo_cache_sentinel")?(w=s=>{V(s.target.value)},e[10]=w):w=e[10];const z=w;let y;e[11]!==g?(y=()=>{g()},e[11]=g,e[12]=y):y=e[12];const B=y;let C;e[13]===Symbol.for("react.memo_cache_sentinel")?(C=["all","web-push","fcm"],e[13]=C):C=e[13];const W=C;let o;e[14]!==a||e[15]!==r?(o=t("div",{className:"flex items-center gap-1","data-testid":"nt-kind-filter",role:"tablist",children:W.map(s=>t(F,{"aria-selected":a===s,"data-testid":`nt-kind-${s}`,onClick:()=>{P(s)},role:"tab",size:"sm",type:"button",variant:a===s?"secondary":"ghost",children:s==="all"?r("All"):s},s))}),e[14]=a,e[15]=r,e[16]=o):o=e[16];let l;e[17]!==r?(l=r("Filter devices"),e[17]=r,e[18]=l):l=e[18];let d;e[19]!==r?(d=r("filter endpoint, user"),e[19]=r,e[20]=d):d=e[20];let c;e[21]!==n||e[22]!==l||e[23]!==d?(c=t(q,{"aria-label":l,className:"h-8 w-56","data-testid":"nt-search",onChange:z,placeholder:d,value:n}),e[21]=n,e[22]=l,e[23]=d,e[24]=c):c=e[24];let m;e[25]!==r?(m=r("Refresh"),e[25]=r,e[26]=m):m=e[26];let f;e[27]!==B||e[28]!==m?(f=t(F,{className:"ml-auto","data-testid":"nt-refresh",onClick:B,size:"sm",type:"button",variant:"outline",children:m}),e[27]=B,e[28]=m,e[29]=f):f=e[29];const E=I.length>0&&t(L,{"data-testid":"nt-count",variant:"secondary",children:r("{count} devices",{count:I.length})});let k;e[30]!==f||e[31]!==E||e[32]!==o||e[33]!==c?(k=x("div",{className:"flex flex-wrap items-center gap-2",children:[o,c,f,E]}),e[30]=f,e[31]=E,e[32]=o,e[33]=c,e[34]=k):k=e[34];let S;e[35]!==i||e[36]!==p?(S=i!==null&&t(K,{error:p,testId:"nt-error"}),e[35]=i,e[36]=p,e[37]=S):S=e[37],N=x("div",{className:"flex flex-col gap-4","data-testid":"lunora-notifications",children:[k,S,i===null&&!v&&A.length===0&&t(U,{description:r("Registered Web Push / FCM devices appear here. Configure lunora/notify.ts with defineNotify({ store }) and register a device with ctx.push.register(...)."),icon:t("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:t("path",{d:"M15 17h5l-1.4-1.4A2 2 0 0 1 18 14.2V11a6 6 0 0 0-4-5.7V5a2 2 0 1 0-4 0v.3A6 6 0 0 0 6 11v3.2a2 2 0 0 1-.6 1.4L4 17h5m6 0v1a3 3 0 1 1-6 0v-1m6 0H9"})}),testId:"nt-empty",title:r("No registered devices.")}),A.length>0&&t(O,{className:"overflow-hidden py-0",children:t(Q,{className:"max-h-[30rem] overflow-auto px-0",children:x(G,{"data-testid":"nt-table",children:[t(J,{children:x(H,{children:[t(h,{children:r("kind")}),t(h,{children:r("endpoint")}),t(h,{children:r("user")}),t(h,{children:r("last seen")}),t(h,{children:r("status")}),t(h,{children:r("error")})]})}),t(X,{children:A.map(s=>{const R=M(s);return x(H,{"data-testid":"nt-row",children:[t(u,{children:t(L,{variant:"outline",children:s.kind})}),t(u,{className:"max-w-[28ch] truncate font-mono text-xs",title:R,children:R}),t(u,{className:"max-w-[16ch] truncate font-mono text-xs",children:s.userId??t("span",{className:"text-muted-foreground",children:"—"})}),t(u,{className:"text-muted-foreground tabular-nums",children:ee(s.lastSeenAt,"—")}),t(u,{children:t(L,{"data-testid":`nt-status-${s.id}`,variant:te(s.lastStatus),children:s.lastStatus??r("n/a")})}),t(u,{className:"max-w-[28ch] truncate font-mono text-xs text-muted-foreground",title:s.lastError??void 0,children:s.lastError??t("span",{className:"text-muted-foreground",children:"—"})})]},s.id)})})]})})})]}),e[1]=T?.subscriptions,e[2]=i,e[3]=p,e[4]=v,e[5]=a,e[6]=g,e[7]=n,e[8]=r,e[9]=N}else N=e[9];return N};export{ge as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useLunora as
|
|
1
|
+
import{useLunora as D}from"@lunora/react";import{useState as s,useCallback as G,useEffect as Z}from"react";import{ConfirmButton as B}from"../packem_shared/ConfirmButton-Cj2SOapE.js";import{B as H}from"../packem_shared/badge-cAk9Di1Q.js";import{B as J}from"../packem_shared/button-BOPLD1un.js";import{I as _}from"../packem_shared/input-CY5W3wzv.js";import{L as g}from"../packem_shared/label-BOUo-DP0.js";import{useAutoRefresh as Q}from"../packem_shared/DEFAULT_AUTO_REFRESH_MS-DuULO4XM.js";import{useT as V}from"../packem_shared/DEFAULT_LOCALE-A1Yg5ORA.js";import{ADMIN_FUNCTIONS as T}from"../packem_shared/ADMIN_FUNCTIONS-4aE59aDq.js";import{d as u,b as v,f as p,c as I}from"../packem_shared/internal-CwaF9YNk.js";import{jsxs as o,jsx as r}from"react/jsx-runtime";const N=I(T.getPitrBookmark),W=I(T.pitrRestore),de=({initialShardKey:O})=>{const c=D(),t=V(),n=O??"",[P,f]=s(null),[i,F]=s(""),[y,w]=s(null),[m,E]=s(""),[h,L]=s(!1),[a,S]=s(null),[R,l]=s(null),[x,d]=s(!1),k=G(async()=>{d(!0),l(null);try{const e=await c.query(N,{},u(n));f(e.current)}catch(e){l(v(e))}d(!1)},[c,n]);Z(()=>{p(k())},[k]),Q(()=>{p((async()=>{try{const e=await c.query(N,{},u(n));f(e.current)}catch{}})())},!0);const A=e=>{F(e.target.value)},U=e=>{E(e.target.value)},q=e=>{L(e.target.checked)},K=()=>{i.trim()!==""&&p((async()=>{d(!0),l(null);try{const e=await c.query(N,{time:i.trim()},u(n));w(e.forTime??null),f(e.current)}catch(e){w(null),l(v(e))}d(!1)})())},C=e=>{p((async()=>{d(!0),l(null);try{const b=await c.mutation(W,e,u(n));S(b),await k()}catch(b){l(v(b))}d(!1)})())},M=m.trim()!==""||i.trim()!=="",j=()=>{const e=h?{restart:!0}:{};m.trim()===""?e.time=i.trim():e.bookmark=m.trim(),C(e)},z=()=>{a!==null&&C(h?{bookmark:a.undoBookmark,restart:!0}:{bookmark:a.undoBookmark})};return o("div",{className:"flex flex-col gap-4","data-testid":"lunora-pitr",children:[r("div",{className:"flex flex-wrap items-center gap-3",children:o("span",{className:"text-xs text-muted-foreground",children:[t("Shard"),": ",r("span",{className:"font-mono",children:n===""?t("root"):n})]})}),r("p",{className:"text-sm text-muted-foreground","data-testid":"pitr-note",children:t("In-place recovery to any moment in the last 30 days. For older or portable recovery, use the snapshot backup tier.")}),R!==null&&r("p",{className:"text-sm text-destructive","data-testid":"pitr-error",role:"alert",children:R}),o("section",{className:"rounded-xl border border-border bg-card p-3 shadow-xs",children:[r("h3",{className:"mb-2 text-sm font-semibold",children:t("Current bookmark")}),r("p",{className:"font-mono text-xs break-all text-muted-foreground","data-testid":"pitr-current",children:P??r("span",{className:"text-muted-foreground",children:"—"})})]}),o("section",{className:"flex flex-col gap-3 rounded-xl border border-border bg-card p-3 shadow-xs",children:[r("h3",{className:"text-sm font-semibold",children:t("Restore")}),o("div",{className:"flex flex-col gap-1",children:[r(g,{htmlFor:"pitr-time",children:t("Time (ISO or epoch-ms, last 30 days)")}),o("div",{className:"flex items-center gap-2",children:[r(_,{"data-testid":"pitr-time",id:"pitr-time",onChange:A,placeholder:"2026-06-01T00:00:00.000Z",value:i}),r(J,{"data-testid":"pitr-preview",disabled:x||i.trim()==="",onClick:K,size:"sm",type:"button",variant:"outline",children:t("Preview")})]}),y!==null&&o("p",{className:"font-mono text-xs break-all text-muted-foreground","data-testid":"pitr-preview-bookmark",children:[t("Bookmark for that time"),": ",y]})]}),o("div",{className:"flex flex-col gap-1",children:[r(g,{htmlFor:"pitr-bookmark",children:t("Or an explicit bookmark (wins over time)")}),r(_,{"data-testid":"pitr-bookmark",id:"pitr-bookmark",onChange:U,placeholder:t("bookmark string"),value:m})]}),o(g,{className:"flex items-center gap-2 text-xs font-normal text-muted-foreground",htmlFor:"pitr-restart",children:[r("input",{checked:h,className:"size-4 accent-primary","data-testid":"pitr-restart",id:"pitr-restart",onChange:q,type:"checkbox"}),t("Restart the shard now so recovery applies immediately")]}),r("div",{children:r(B,{confirmLabel:t("Confirm restore"),disabled:x||!M,onConfirm:j,testId:"pitr-restore",children:t("Restore")})})]}),a!==null&&o("section",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card p-3 shadow-xs","data-testid":"pitr-result",children:[o("div",{className:"flex items-center gap-2",children:[r("h3",{className:"text-sm font-semibold",children:t("Restore armed")}),r(H,{variant:a.restarted?"destructive":"secondary",children:a.restarted?t("restarted now"):t("on next restart")})]}),o("p",{className:"font-mono text-xs break-all text-muted-foreground",children:[t("Restored to"),": ",a.restoredTo]}),o("p",{className:"font-mono text-xs break-all text-muted-foreground","data-testid":"pitr-undo-bookmark",children:[t("Undo bookmark"),": ",a.undoBookmark]}),r("div",{children:r(B,{confirmLabel:t("Confirm undo"),disabled:x,onConfirm:z,testId:"pitr-undo",children:t("Undo restore")})})]})]})};export{de as PitrPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as Ce}from"react/compiler-runtime";import{ShardInput as Ze}from"../packem_shared/ShardInput-BVn2iCU0.js";import{g as Re,d as Oe}from"../packem_shared/storage-tier-DznqOf-q.js";import{g as Fe}from"../packem_shared/badge-BbuuAio7.js";import{m as Ke,p as Ge,n as Le,f as Me,c as De}from"../packem_shared/card-BMKx5UdA.js";import{E as He}from"../packem_shared/empty-state-Cg7t_8qu.js";import{u as Ie}from"../packem_shared/input-JHu63lTv.js";import{useT as je}from"../packem_shared/DEFAULT_LOCALE-BZ4NojpD.js";import{d as Ae,b as Ee,f as fe,g as qe}from"../packem_shared/internal-zkEvTqy8.js";import{c as We}from"../packem_shared/utils-bhneXptQ.js";import{useLunora as Qe}from"@lunora/react";import{useState as _,useEffect as Pe,useRef as et}from"react";import{S as tt}from"../packem_shared/use-shard-key-B2JtNa5m.js";import{ADMIN_FUNCTIONS as ze}from"../packem_shared/ADMIN_FUNCTIONS-4aE59aDq.js";import{r as lt}from"../packem_shared/shard-history-DMEW5VBE.js";import{S as at}from"../packem_shared/schema-diagram-GVgnLWTf.js";import{useNavigate as nt}from"@tanstack/react-router";import{u as be}from"../packem_shared/button-BkCrNcAs.js";import{p as $e}from"../packem_shared/label-6uP1obNF.js";import{jsx as l,jsxs as g,Fragment as Ve}from"react/jsx-runtime";const st=qe(ze.listTables),rt=qe(ze.listTableIndexes),ot=qe(ze.readTablePage),it=qe(ze.describeTables),dt={},Be=[],ct=s=>{const e=Ce(74),{initialShardKey:m,initialTable:n}=s,t=Qe(),[a,c]=_("graph"),{queryShardKey:d,setShardKey:i,shardKey:f}=tt(m),[r,h]=_(""),[o,x]=_(null),[p,P]=_(null);let S;e[0]===Symbol.for("react.memo_cache_sentinel")?(S={},e[0]=S):S=e[0];const[L,v]=_(S);let K;e[1]===Symbol.for("react.memo_cache_sentinel")?(K={},e[1]=K):K=e[1];const[F,M]=_(K),[w,N]=_(null);let A;e[2]===Symbol.for("react.memo_cache_sentinel")?(A={},e[2]=A):A=e[2];const[j,me]=_(A);let Z;e[3]===Symbol.for("react.memo_cache_sentinel")?(Z={},e[3]=Z):Z=e[3];const[k,G]=_(Z),[$,ue]=_(null),[D,oe]=_(null);let H;e[4]===Symbol.for("react.memo_cache_sentinel")?(H={},e[4]=H):H=e[4];const[X,xe]=_(H),[Y,ie]=_(null);let ve;e[5]!==t?(ve=async u=>{P(null);try{const C=await t.query(st,{},Ae(u));lt(u),x(C),v({}),M({}),N(null),me(y=>Object.fromEntries(Object.entries(y).filter(O=>{const[I]=O;return I!==u}))),G(y=>Object.fromEntries(Object.entries(y).filter(O=>{const[I]=O;return I!==u})))}catch(C){const y=C;x(null),P(Ee(y))}},e[5]=t,e[6]=ve):ve=e[6];const q=ve;let Q;e[7]!==t?(Q=async()=>{oe(null);try{ue(await t.listGlobalTables())}catch(u){const C=u;ue(null),oe(Ee(C))}},e[7]=t,e[8]=Q):Q=e[8];const ee=Q;let de,R;e[9]!==d||e[10]!==q||e[11]!==ee?(de=()=>{fe(q(d)),fe(ee())},R=[q,ee,d],e[9]=d,e[10]=q,e[11]=ee,e[12]=de,e[13]=R):(de=e[12],R=e[13]),Pe(de,R);let te;e[14]!==t||e[15]!==L||e[16]!==w||e[17]!==d?(te=async u=>{if(w===u){N(null);return}N(u);const C=`${d}:${u}`;if(L[C]!==void 0)return;const[y,O]=await Promise.allSettled([t.query(ot,{limit:1,offset:0,table:u},Ae(d)),t.query(rt,{table:u},Ae(d))]);y.status==="fulfilled"?v(I=>({...I,[C]:y.value.columns})):P(Ee(y.reason)),O.status==="fulfilled"&&M(I=>({...I,[C]:O.value.indexes}))},e[14]=t,e[15]=L,e[16]=w,e[17]=d,e[18]=te):te=e[18];const z=te;let ye;e[19]!==t||e[20]!==X||e[21]!==Y?(ye=async u=>{if(Y===u){ie(null);return}if(ie(u),X[u]===void 0)try{const C=await t.readGlobalTablePage({limit:1,offset:0,table:u});xe(y=>({...y,[u]:C.columns}))}catch(C){oe(Ee(C))}},e[19]=t,e[20]=X,e[21]=Y,e[22]=ye):ye=e[22];const ce=ye,he=et(void 0);let V,J;e[23]!==n||e[24]!==o||e[25]!==z?(V=()=>{n===void 0||o===null||he.current===n||o.some(u=>u.name===n)&&(he.current=n,fe(z(n)))},J=[n,o,z],e[23]=n,e[24]=o,e[25]=z,e[26]=V,e[27]=J):(V=e[26],J=e[27]),Pe(V,J);let B;e[28]!==t?(B=async(u,C,y)=>{const[O,I]=await Promise.all([Promise.allSettled([t.query(it,{tables:[...C,...y]},Ae(u))]),Promise.all(y.map(async T=>{const ge=await Promise.allSettled([t.readGlobalTablePage({limit:1,offset:0,table:T})]),ke=ge[0].status==="fulfilled"?ge[0].value:void 0;return{columns:ke?.columns??[],refs:ke?.refs??{},table:T}}))]),Te=O[0].status==="fulfilled"?O[0].value?.columnsByTable??{}:{},we=O[0].status==="rejected",Se=new Map(I.map(mt)),_e=[...C,...y].map(T=>{const ge=Te[T]??[];return[T,ge.length>0?ge:Se.get(T)??[]]});me(T=>({...T,[u]:Object.fromEntries(_e)})),G(T=>({...T,[u]:we}))},e[28]=t,e[29]=B):B=e[29];const le=B;let U,ae;e[30]!==D||e[31]!==$||e[32]!==le||e[33]!==d||e[34]!==j||e[35]!==o||e[36]!==a?(U=()=>{a!=="graph"||o===null||$===null&&D===null||j[d]!==void 0||fe(le(d,o.map(ut),($??[]).map(ht)))},ae=[a,o,$,D,d,j,le],e[30]=D,e[31]=$,e[32]=le,e[33]=d,e[34]=j,e[35]=o,e[36]=a,e[37]=U,e[38]=ae):(U=e[37],ae=e[38]),Pe(U,ae);const E=j[d]??dt;let ne;if(e[39]!==E||e[40]!==$||e[41]!==o){let u;e[43]!==E?(u=I=>({columns:E[I.name]??Be,name:I.name,tier:"shard"}),e[43]=E,e[44]=u):u=e[44];const C=(o??[]).map(u);let y;e[45]!==E?(y=I=>({columns:E[I.name]??Be,name:I.name,tier:"global"}),e[45]=E,e[46]=y):y=e[46];const O=($??[]).map(y);ne=[...C,...O],e[39]=E,e[40]=$,e[41]=o,e[42]=ne}else ne=e[42];const se=ne;let b;if(e[47]!==r||e[48]!==o){const u=r.trim().toLowerCase();b=(o??[]).filter(C=>C.name.toLowerCase().includes(u)),e[47]=r,e[48]=o,e[49]=b}else b=e[49];const re=b;let W;if(e[50]!==$||e[51]!==r){const u=r.trim().toLowerCase();W=($??[]).filter(C=>C.name.toLowerCase().includes(u)),e[50]=$,e[51]=r,e[52]=W}else W=e[52];const Ne=W;let pe;return e[53]!==L||e[54]!==se||e[55]!==p||e[56]!==w||e[57]!==Ne||e[58]!==re||e[59]!==X||e[60]!==D||e[61]!==Y||e[62]!==$||e[63]!==F||e[64]!==q||e[65]!==i||e[66]!==k||e[67]!==f||e[68]!==r||e[69]!==o||e[70]!==z||e[71]!==ce||e[72]!==a?(pe={columns:L,diagramTables:se,error:p,expanded:w,filteredGlobalTables:Ne,filteredTables:re,globalColumns:X,globalError:D,globalExpanded:Y,globalTables:$,indexes:F,refresh:q,setShardKey:i,setTableFilter:h,setView:c,shardColumnsError:k,shardKey:f,tableFilter:r,tables:o,toggle:z,toggleGlobal:ce,view:a},e[53]=L,e[54]=se,e[55]=p,e[56]=w,e[57]=Ne,e[58]=re,e[59]=X,e[60]=D,e[61]=Y,e[62]=$,e[63]=F,e[64]=q,e[65]=i,e[66]=k,e[67]=f,e[68]=r,e[69]=o,e[70]=z,e[71]=ce,e[72]=a,e[73]=pe):pe=e[73],pe};function mt(s){const{columns:e,refs:m,table:n}=s;return[n,e.map(t=>{const a=m[t];return a===void 0?{name:t,optional:!1,type:""}:{name:t,optional:!1,ref:a,type:"id"}})]}function ut(s){return s.name}function ht(s){return s.name}const pt="/__lunora/schema-edit",gt=async s=>{const e=await fetch(pt,{body:JSON.stringify(s),headers:{"Content-Type":"application/json","X-Lunora-Studio":"1"},method:"POST"}),m=await e.json();return m.needsMigration===!0?{kind:"needs-migration",message:m.message??"This edit needs a migration."}:e.ok&&m.tables!==void 0?{diagnostics:m.diagnostics??[],kind:"ok",tables:m.tables}:{kind:"error",message:m.error??`schema edit failed (${String(e.status)})`}},bt=s=>{const e=Ce(32),{hasTables:m,mode:n,onAddColumn:t,onAddIndex:a,onAddTable:c,onDestructive:d}=s,i=je(),f=n==="addTable"?"default":"outline";let r;e[0]!==i?(r=i("Add table"),e[0]=i,e[1]=r):r=e[1];let h;e[2]!==c||e[3]!==f||e[4]!==r?(h=l(be,{"data-testid":"sc-editor-add-table",onClick:c,size:"xs",type:"button",variant:f,children:r}),e[2]=c,e[3]=f,e[4]=r,e[5]=h):h=e[5];const o=!m,x=n==="addColumn"?"default":"outline";let p;e[6]!==i?(p=i("Add column"),e[6]=i,e[7]=p):p=e[7];let P;e[8]!==t||e[9]!==o||e[10]!==x||e[11]!==p?(P=l(be,{"data-testid":"sc-editor-add-column",disabled:o,onClick:t,size:"xs",type:"button",variant:x,children:p}),e[8]=t,e[9]=o,e[10]=x,e[11]=p,e[12]=P):P=e[12];const S=!m,L=n==="addIndex"?"default":"outline";let v;e[13]!==i?(v=i("Add index"),e[13]=i,e[14]=v):v=e[14];let K;e[15]!==a||e[16]!==v||e[17]!==S||e[18]!==L?(K=l(be,{"data-testid":"sc-editor-add-index",disabled:S,onClick:a,size:"xs",type:"button",variant:L,children:v}),e[15]=a,e[16]=v,e[17]=S,e[18]=L,e[19]=K):K=e[19];const F=!m,M=n==="destructive"?"default":"ghost";let w;e[20]!==i?(w=i("Rename / drop / change type…"),e[20]=i,e[21]=w):w=e[21];let N;e[22]!==d||e[23]!==F||e[24]!==M||e[25]!==w?(N=l(be,{"data-testid":"sc-editor-destructive",disabled:F,onClick:d,size:"xs",type:"button",variant:M,children:w}),e[22]=d,e[23]=F,e[24]=M,e[25]=w,e[26]=N):N=e[26];let A;return e[27]!==K||e[28]!==N||e[29]!==h||e[30]!==P?(A=g("div",{className:"flex flex-wrap gap-2",children:[h,P,K,N]}),e[27]=K,e[28]=N,e[29]=h,e[30]=P,e[31]=A):A=e[31],A},ft=s=>{const e=Ce(28),{onOpenMigrations:m,result:n}=s,t=je();if(n===null){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=l(Ve,{}),e[0]=r):r=e[0],r}if(n.kind==="error"){let r;return e[1]!==n.message?(r=l("p",{className:"mt-3 text-sm text-destructive","data-testid":"sc-editor-error",role:"alert",children:n.message}),e[1]=n.message,e[2]=r):r=e[2],r}if(n.kind==="needs-migration"){let r;e[3]!==n.message||e[4]!==t?(r=n.message===""?t("This edit changes stored data and must go through a migration. Review the migration before applying."):n.message,e[3]=n.message,e[4]=t,e[5]=r):r=e[5];let h;e[6]!==r?(h=l("p",{className:"text-sm text-warning",role:"alert",children:r}),e[6]=r,e[7]=h):h=e[7];let o;e[8]!==t?(o=t("Open Migrations"),e[8]=t,e[9]=o):o=e[9];let x;e[10]!==m||e[11]!==o?(x=l(be,{className:"self-start","data-testid":"sc-editor-open-migrations",onClick:m,size:"xs",type:"button",variant:"outline",children:o}),e[10]=m,e[11]=o,e[12]=x):x=e[12];let p;return e[13]!==h||e[14]!==x?(p=g("div",{className:"mt-3 flex flex-col gap-2","data-testid":"sc-editor-needs-migration",children:[h,x]}),e[13]=h,e[14]=x,e[15]=p):p=e[15],p}if(n.diagnostics.length===0){let r;return e[16]===Symbol.for("react.memo_cache_sentinel")?(r=l(Ve,{}),e[16]=r):r=e[16],r}let a;e[17]!==t?(a=t("Codegen reported diagnostics:"),e[17]=t,e[18]=a):a=e[18];let c;e[19]!==a?(c=l("p",{className:"text-sm text-destructive",role:"alert",children:a}),e[19]=a,e[20]=c):c=e[20];let d;e[21]!==n.diagnostics?(d=n.diagnostics.map(xt),e[21]=n.diagnostics,e[22]=d):d=e[22];let i;e[23]!==d?(i=l("ul",{className:"flex flex-col gap-0.5",children:d}),e[23]=d,e[24]=i):i=e[24];let f;return e[25]!==c||e[26]!==i?(f=g("div",{className:"mt-3 flex flex-col gap-1","data-testid":"sc-editor-diagnostics",children:[c,i]}),e[25]=c,e[26]=i,e[27]=f):f=e[27],f};function xt(s){return l("li",{className:"font-mono text-[11px] text-destructive",children:s},s)}const vt=[{label:"string",validator:"v.string()"},{label:"number",validator:"v.number()"},{label:"boolean",validator:"v.boolean()"},{label:"bigint",validator:"v.int64()"},{label:"bytes",validator:"v.bytes()"},{label:"any",validator:"v.any()"}],yt="v.string()",Nt=s=>s.split(",").map(e=>e.trim()).filter(e=>e!==""),Ct=s=>{const e=Ce(83),{onApplied:m,tableNames:n}=s,t=je(),a=nt(),[c,d]=_(null),[i,f]=_(!1),[r,h]=_(null),[o,x]=_(""),[p,P]=_(""),[S,L]=_(yt),[v,K]=_(n[0]??""),[F,M]=_(""),[w,N]=_(""),[A,j]=_(!1);let me;e[0]===Symbol.for("react.memo_cache_sentinel")?(me=()=>{d(null),x(""),P(""),M(""),N(""),j(!1)},e[0]=me):me=e[0];const Z=me;let k;e[1]!==m?(k=async T=>{f(!0),h(null);try{const ge=await gt(T);h(ge),ge.kind==="ok"&&(m(ge.tables),Z())}catch(ge){const ke=ge;h({kind:"error",message:ke instanceof Error?ke.message:String(ke)})}f(!1)},e[1]=m,e[2]=k):k=e[2];const G=k;let $;e[3]!==G||e[4]!==o?($=()=>{fe(G({kind:"addTable",table:o.trim()}))},e[3]=G,e[4]=o,e[5]=$):$=e[5];const ue=$;let D;e[6]!==p||e[7]!==G||e[8]!==v||e[9]!==S?(D=()=>{fe(G({column:p.trim(),kind:"addOptionalColumn",table:v,validator:S}))},e[6]=p,e[7]=G,e[8]=v,e[9]=S,e[10]=D):D=e[10];const oe=D;let H;e[11]!==w||e[12]!==F||e[13]!==G||e[14]!==v||e[15]!==A?(H=()=>{fe(G({fields:Nt(w),kind:"addIndex",name:F.trim(),table:v,unique:A}))},e[11]=w,e[12]=F,e[13]=G,e[14]=v,e[15]=A,e[16]=H):H=e[16];const X=H;let xe;e[17]===Symbol.for("react.memo_cache_sentinel")?(xe=()=>{h(null),d("addTable")},e[17]=xe):xe=e[17];const Y=xe;let ie;e[18]===Symbol.for("react.memo_cache_sentinel")?(ie=()=>{h(null),d("addColumn")},e[18]=ie):ie=e[18];const ve=ie;let q;e[19]===Symbol.for("react.memo_cache_sentinel")?(q=()=>{h(null),d("addIndex")},e[19]=q):q=e[19];const Q=q;let ee;e[20]!==t?(ee=()=>{d("destructive"),h({kind:"needs-migration",message:t("This edit changes stored data and must go through a migration. Review the migration before applying.")})},e[20]=t,e[21]=ee):ee=e[21];const de=ee;let R;e[22]===Symbol.for("react.memo_cache_sentinel")?(R=T=>{x(T.target.value)},e[22]=R):R=e[22];const te=R;let z;e[23]===Symbol.for("react.memo_cache_sentinel")?(z=T=>{P(T.target.value)},e[23]=z):z=e[23];const ye=z;let ce;e[24]===Symbol.for("react.memo_cache_sentinel")?(ce=T=>{L(T.target.value)},e[24]=ce):ce=e[24];const he=ce;let V;e[25]===Symbol.for("react.memo_cache_sentinel")?(V=T=>{K(T.target.value)},e[25]=V):V=e[25];const J=V;let B;e[26]===Symbol.for("react.memo_cache_sentinel")?(B=T=>{M(T.target.value)},e[26]=B):B=e[26];const le=B;let U;e[27]===Symbol.for("react.memo_cache_sentinel")?(U=T=>{N(T.target.value)},e[27]=U):U=e[27];const ae=U;let E;e[28]===Symbol.for("react.memo_cache_sentinel")?(E=T=>{j(T.target.checked)},e[28]=E):E=e[28];const ne=E;let se;e[29]!==a?(se=()=>{fe(a({to:"/migrations"}))},e[29]=a,e[30]=se):se=e[30];const b=se;let re;e[31]!==t?(re=t("Edit schema"),e[31]=t,e[32]=re):re=e[32];let W;e[33]!==re?(W=l(Ke,{children:re}),e[33]=re,e[34]=W):W=e[34];let Ne;e[35]!==t?(Ne=t("Adds a table, column, or index to lunora/schema.ts and reruns codegen."),e[35]=t,e[36]=Ne):Ne=e[36];let pe;e[37]!==Ne?(pe=l(Ge,{children:Ne}),e[37]=Ne,e[38]=pe):pe=e[38];let u;e[39]!==W||e[40]!==pe?(u=g(Le,{children:[W,pe]}),e[39]=W,e[40]=pe,e[41]=u):u=e[41];const C=n.length>0;let y;e[42]!==c||e[43]!==de||e[44]!==C?(y=l(bt,{hasTables:C,mode:c,onAddColumn:ve,onAddIndex:Q,onAddTable:Y,onDestructive:de}),e[42]=c,e[43]=de,e[44]=C,e[45]=y):y=e[45];let O;e[46]!==i||e[47]!==c||e[48]!==ue||e[49]!==t||e[50]!==o?(O=c==="addTable"&&g("div",{className:"mt-3 flex flex-wrap items-end gap-2","data-testid":"sc-editor-table-form",children:[g("div",{className:"flex flex-col gap-1 text-xs",children:[l($e,{htmlFor:"sc-editor-table-name",children:t("Table name")}),l(Ie,{"data-testid":"sc-editor-table-name",id:"sc-editor-table-name",onChange:te,value:o})]}),l(be,{"data-testid":"sc-editor-table-apply",disabled:i||o.trim()==="",onClick:ue,size:"xs",type:"button",children:t(i?"Applying…":"Apply")}),l(be,{onClick:Z,size:"xs",type:"button",variant:"ghost",children:t("Cancel")})]}),e[46]=i,e[47]=c,e[48]=ue,e[49]=t,e[50]=o,e[51]=O):O=e[51];let I;e[52]!==i||e[53]!==p||e[54]!==c||e[55]!==oe||e[56]!==t||e[57]!==n||e[58]!==v||e[59]!==S?(I=c==="addColumn"&&g("div",{className:"mt-3 flex flex-wrap items-end gap-2","data-testid":"sc-editor-column-form",children:[g("div",{className:"flex flex-col gap-1 text-xs",children:[l($e,{htmlFor:"sc-editor-column-table",children:t("Table name")}),l("select",{className:"h-8 rounded-md border border-input bg-transparent px-2 text-xs","data-testid":"sc-editor-column-table",id:"sc-editor-column-table",onChange:J,value:v,children:n.map(Tt)})]}),g("div",{className:"flex flex-col gap-1 text-xs",children:[l($e,{htmlFor:"sc-editor-column-name",children:t("Column name")}),l(Ie,{"data-testid":"sc-editor-column-name",id:"sc-editor-column-name",onChange:ye,value:p})]}),g("div",{className:"flex flex-col gap-1 text-xs",children:[l($e,{htmlFor:"sc-editor-column-type",children:t("Column type")}),l("select",{className:"h-8 rounded-md border border-input bg-transparent px-2 text-xs","data-testid":"sc-editor-column-type",id:"sc-editor-column-type",onChange:he,value:S,children:vt.map(wt)})]}),l("span",{className:"text-[11px] text-muted-foreground",children:t("Optional")}),l(be,{"data-testid":"sc-editor-column-apply",disabled:i||p.trim()===""||v==="",onClick:oe,size:"xs",type:"button",children:t(i?"Applying…":"Apply")}),l(be,{onClick:Z,size:"xs",type:"button",variant:"ghost",children:t("Cancel")})]}),e[52]=i,e[53]=p,e[54]=c,e[55]=oe,e[56]=t,e[57]=n,e[58]=v,e[59]=S,e[60]=I):I=e[60];let Te;e[61]!==i||e[62]!==w||e[63]!==F||e[64]!==c||e[65]!==X||e[66]!==t||e[67]!==n||e[68]!==v||e[69]!==A?(Te=c==="addIndex"&&g("div",{className:"mt-3 flex flex-wrap items-end gap-2","data-testid":"sc-editor-index-form",children:[g("div",{className:"flex flex-col gap-1 text-xs",children:[l($e,{htmlFor:"sc-editor-index-table",children:t("Table name")}),l("select",{className:"h-8 rounded-md border border-input bg-transparent px-2 text-xs","data-testid":"sc-editor-index-table",id:"sc-editor-index-table",onChange:J,value:v,children:n.map(St)})]}),g("div",{className:"flex flex-col gap-1 text-xs",children:[l($e,{htmlFor:"sc-editor-index-name",children:t("Index name")}),l(Ie,{"data-testid":"sc-editor-index-name",id:"sc-editor-index-name",onChange:le,value:F})]}),g("div",{className:"flex flex-col gap-1 text-xs",children:[l($e,{htmlFor:"sc-editor-index-fields",children:t("Index fields (comma-separated)")}),l(Ie,{"data-testid":"sc-editor-index-fields",id:"sc-editor-index-fields",onChange:ae,value:w})]}),g($e,{className:"flex items-center gap-1 text-xs",htmlFor:"sc-editor-index-unique",children:[l("input",{checked:A,"data-testid":"sc-editor-index-unique",id:"sc-editor-index-unique",onChange:ne,type:"checkbox"}),l("span",{className:"text-muted-foreground",children:t("Unique")})]}),l(be,{"data-testid":"sc-editor-index-apply",disabled:i||F.trim()===""||w.trim()==="",onClick:X,size:"xs",type:"button",children:t(i?"Applying…":"Apply")}),l(be,{onClick:Z,size:"xs",type:"button",variant:"ghost",children:t("Cancel")})]}),e[61]=i,e[62]=w,e[63]=F,e[64]=c,e[65]=X,e[66]=t,e[67]=n,e[68]=v,e[69]=A,e[70]=Te):Te=e[70];let we;e[71]!==b||e[72]!==r?(we=l(ft,{onOpenMigrations:b,result:r}),e[71]=b,e[72]=r,e[73]=we):we=e[73];let Se;e[74]!==y||e[75]!==O||e[76]!==I||e[77]!==Te||e[78]!==we?(Se=g(Me,{children:[y,O,I,Te,we]}),e[74]=y,e[75]=O,e[76]=I,e[77]=Te,e[78]=we,e[79]=Se):Se=e[79];let _e;return e[80]!==u||e[81]!==Se?(_e=g(De,{"data-testid":"sc-editor",size:"sm",children:[u,Se]}),e[80]=u,e[81]=Se,e[82]=_e):_e=e[82],_e};function Tt(s){return l("option",{value:s,children:s},s)}function wt(s){return l("option",{value:s.validator,children:s.label},s.validator)}function St(s){return l("option",{value:s,children:s},s)}const Ue=[],$t=s=>{const e=Ce(5),{open:m}=s,n=m&&"rotate-90";let t;e[0]!==n?(t=We("size-3.5 shrink-0 text-muted-foreground transition-transform duration-150",n),e[0]=n,e[1]=t):t=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=l("path",{d:"m9 6 6 6-6 6"}),e[2]=a):a=e[2];let c;return e[3]!==t?(c=l("svg",{"aria-hidden":"true",className:t,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:a}),e[3]=t,e[4]=c):c=e[4],c},Xe=s=>{const e=Ce(20),{children:m,expanded:n,name:t,onToggle:a,rowCount:c,rowTestId:d,toggleTestId:i}=s;let f;e[0]!==n?(f=l($t,{open:n}),e[0]=n,e[1]=f):f=e[1];let r;e[2]!==t?(r=l("span",{className:"truncate font-mono text-xs text-foreground",title:t,children:t}),e[2]=t,e[3]=r):r=e[3];let h;e[4]!==c?(h=g("span",{className:"ms-auto shrink-0 text-xs text-muted-foreground tabular-nums",children:["(",c,")"]}),e[4]=c,e[5]=h):h=e[5];let o;e[6]!==n||e[7]!==a||e[8]!==f||e[9]!==r||e[10]!==h||e[11]!==i?(o=g("button",{"aria-expanded":n,className:"flex w-full items-center gap-2 px-3 py-2 text-start transition-colors hover:bg-muted/50 aria-expanded:bg-muted/40","data-testid":i,onClick:a,type:"button",children:[f,r," ",h]}),e[6]=n,e[7]=a,e[8]=f,e[9]=r,e[10]=h,e[11]=i,e[12]=o):o=e[12];let x;e[13]!==m||e[14]!==n?(x=n&&l("div",{className:"px-3 pb-3 ps-8",children:m}),e[13]=m,e[14]=n,e[15]=x):x=e[15];let p;return e[16]!==d||e[17]!==o||e[18]!==x?(p=g("li",{className:"border-t border-border/60 first:border-t-0","data-testid":d,children:[o,x]}),e[16]=d,e[17]=o,e[18]=x,e[19]=p):p=e[19],p},Ye=s=>{const e=Ce(5),{columns:m,testId:n}=s;let t;e[0]!==m?(t=m.map(kt),e[0]=m,e[1]=t):t=e[1];let a;return e[2]!==t||e[3]!==n?(a=l("ul",{className:"flex flex-wrap gap-1.5 pt-1","data-testid":n,children:t}),e[2]=t,e[3]=n,e[4]=a):a=e[4],a},_t=s=>{const e=Ce(10),{heading:m,indexes:n,testId:t}=s;let a;e[0]!==m?(a=l("p",{className:"mb-1.5 font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:m}),e[0]=m,e[1]=a):a=e[1];let c;e[2]!==n?(c=n.map(It),e[2]=n,e[3]=c):c=e[3];let d;e[4]!==c||e[5]!==t?(d=l("ul",{className:"flex flex-col gap-1","data-testid":t,children:c}),e[4]=c,e[5]=t,e[6]=d):d=e[6];let i;return e[7]!==a||e[8]!==d?(i=g("div",{className:"pt-3",children:[a,d]}),e[7]=a,e[8]=d,e[9]=i):i=e[9],i},Je=s=>We("border-b-2 px-3 py-2 font-mono text-[11px] tracking-widest uppercase outline-none transition-colors",s?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),Zt=s=>{const e=Ce(85),{initialShardKey:m,initialTable:n,schemaEditable:t}=s,a=je();let c;e[0]!==m||e[1]!==n?(c={initialShardKey:m,initialTable:n},e[0]=m,e[1]=n,e[2]=c):c=e[2];const{columns:d,diagramTables:i,error:f,expanded:r,filteredGlobalTables:h,filteredTables:o,globalColumns:x,globalError:p,globalExpanded:P,globalTables:S,indexes:L,refresh:v,setShardKey:K,setTableFilter:F,setView:M,shardColumnsError:w,shardKey:N,tableFilter:A,tables:j,toggle:me,toggleGlobal:Z,view:k}=ct(c);let G;e[3]!==M?(G=()=>{M("list")},e[3]=M,e[4]=G):G=e[4];const $=G;let ue;e[5]!==M?(ue=()=>{M("graph")},e[5]=M,e[6]=ue):ue=e[6];const D=ue;let oe;e[7]!==F?(oe=b=>{F(b.target.value)},e[7]=F,e[8]=oe):oe=e[8];const H=oe;let X;e[9]!==v||e[10]!==N?(X=b=>{fe(v(N))},e[9]=v,e[10]=N,e[11]=X):X=e[11];const xe=X;let Y;e[12]!==j?(Y=j??[],e[12]=j,e[13]=Y):Y=e[13];let ie;e[14]!==Y?(ie=Y.map(At),e[14]=Y,e[15]=ie):ie=e[15];const ve=ie;let q;e[16]!==K||e[17]!==N?(q=l(Ze,{onChange:K,testId:"sc-shard-input",value:N}),e[16]=K,e[17]=N,e[18]=q):q=e[18];let Q;e[19]!==a?(Q=a("Schema view"),e[19]=a,e[20]=Q):Q=e[20];const ee=k==="graph",de=k==="graph";let R;e[21]!==de?(R=Je(de),e[21]=de,e[22]=R):R=e[22];let te;e[23]!==a?(te=a("Graph"),e[23]=a,e[24]=te):te=e[24];let z;e[25]!==D||e[26]!==ee||e[27]!==R||e[28]!==te?(z=l("button",{"aria-selected":ee,className:R,"data-testid":"sc-view-graph",onClick:D,role:"tab",type:"button",children:te}),e[25]=D,e[26]=ee,e[27]=R,e[28]=te,e[29]=z):z=e[29];const ye=k==="list",ce=k==="list";let he;e[30]!==ce?(he=Je(ce),e[30]=ce,e[31]=he):he=e[31];let V;e[32]!==a?(V=a("Table list"),e[32]=a,e[33]=V):V=e[33];let J;e[34]!==$||e[35]!==ye||e[36]!==he||e[37]!==V?(J=l("button",{"aria-selected":ye,className:he,"data-testid":"sc-view-list",onClick:$,role:"tab",type:"button",children:V}),e[34]=$,e[35]=ye,e[36]=he,e[37]=V,e[38]=J):J=e[38];let B;e[39]!==z||e[40]!==J||e[41]!==Q?(B=g("div",{"aria-label":Q,className:"flex items-center gap-1","data-testid":"sc-view-toggle",role:"tablist",children:[z,J]}),e[39]=z,e[40]=J,e[41]=Q,e[42]=B):B=e[42];let le;e[43]!==B||e[44]!==q?(le=g("div",{className:"flex flex-wrap items-center gap-3",children:[q,B]}),e[43]=B,e[44]=q,e[45]=le):le=e[45];let U;e[46]!==xe||e[47]!==t||e[48]!==ve?(U=t===!0&&l(Ct,{onApplied:xe,tableNames:ve}),e[46]=xe,e[47]=t,e[48]=ve,e[49]=U):U=e[49];let ae;e[50]!==H||e[51]!==a||e[52]!==A||e[53]!==k?(ae=k==="list"&&l(Ie,{"aria-label":a("Filter tables"),className:"h-8 max-w-xs","data-testid":"sc-filter",onChange:H,placeholder:a("Filter tables"),value:A}),e[50]=H,e[51]=a,e[52]=A,e[53]=k,e[54]=ae):ae=e[54];let E;e[55]!==i||e[56]!==f||e[57]!==p||e[58]!==w||e[59]!==N||e[60]!==k?(E=k==="graph"&&g("div",{className:"flex flex-col gap-2","data-testid":"sc-graph-view",children:[f!==null&&l("p",{className:"text-sm text-destructive","data-testid":"sc-error",role:"alert",children:f}),p!==null&&l("p",{className:"text-sm text-destructive","data-testid":"sc-global-error",role:"alert",children:p}),l(at,{columnsError:w[N]===!0,tables:i,testIdPrefix:"sc-graph"})]}),e[55]=i,e[56]=f,e[57]=p,e[58]=w,e[59]=N,e[60]=k,e[61]=E):E=e[61];let ne;e[62]!==d||e[63]!==f||e[64]!==r||e[65]!==h||e[66]!==o||e[67]!==x||e[68]!==p||e[69]!==P||e[70]!==S||e[71]!==L||e[72]!==N||e[73]!==a||e[74]!==j||e[75]!==me||e[76]!==Z||e[77]!==k?(ne=k==="list"&&g("div",{className:"flex flex-col gap-4",children:[g(De,{"data-testid":"sc-shard-section",size:"sm",children:[g(Le,{children:[g("div",{className:"flex items-center gap-2",children:[l(Re,{tier:"shard"}),l(Ke,{children:a("Shard tables")}),j!==null&&l(Fe,{className:"ms-auto tabular-nums",variant:"outline",children:o.length})]}),l(Ge,{children:Oe.shard.hint})]}),g(Me,{children:[f!==null&&l("p",{className:"text-sm text-destructive","data-testid":"sc-error",role:"alert",children:f}),j!==null&&j.length===0&&l("p",{className:"text-sm text-muted-foreground","data-testid":"sc-empty",children:a("No tables in this shard.")}),j!==null&&j.length>0&&o.length===0&&l("p",{className:"text-sm text-muted-foreground","data-testid":"sc-no-match",children:a("No tables match your filter.")}),o.length>0&&l("ul",{className:"-mx-3 overflow-hidden border-t border-border","data-testid":"sc-table-list",children:o.map(b=>{const re=`${N}:${b.name}`,W=L[re]??[];return g(Xe,{expanded:r===b.name,name:b.name,onToggle:()=>{fe(me(b.name))},rowCount:b.rowCount,rowTestId:`sc-table-${b.name}`,toggleTestId:`sc-toggle-${b.name}`,children:[l(Ye,{columns:d[re]??Ue,testId:`sc-columns-${b.name}`}),W.length>0&&l(_t,{heading:a("Indexes"),indexes:W,testId:`sc-indexes-${b.name}`})]},b.name)})})]})]}),g(De,{"data-testid":"sc-global-section",size:"sm",children:[g(Le,{children:[g("div",{className:"flex items-center gap-2",children:[l(Re,{tier:"global"}),l(Ke,{children:a("Global tables (D1)")}),S!==null&&l(Fe,{className:"ms-auto tabular-nums",variant:"outline",children:h.length})]}),l(Ge,{children:Oe.global.hint})]}),g(Me,{children:[p!==null&&l("p",{className:"text-sm text-destructive","data-testid":"sc-global-error",role:"alert",children:p}),S!==null&&S.length===0&&l(He,{description:Oe.global.hint,testId:"sc-global-empty",title:a("No global tables.")}),S!==null&&S.length>0&&h.length===0&&l("p",{className:"text-sm text-muted-foreground","data-testid":"sc-global-no-match",children:a("No tables match your filter.")}),h.length>0&&l("ul",{className:"-mx-3 overflow-hidden border-t border-border","data-testid":"sc-global-table-list",children:h.map(b=>l(Xe,{expanded:P===b.name,name:b.name,onToggle:()=>{fe(Z(b.name))},rowCount:b.rowCount,rowTestId:`sc-global-table-${b.name}`,toggleTestId:`sc-global-toggle-${b.name}`,children:l(Ye,{columns:x[b.name]??Ue,testId:`sc-global-columns-${b.name}`})},b.name))})]})]})]}),e[62]=d,e[63]=f,e[64]=r,e[65]=h,e[66]=o,e[67]=x,e[68]=p,e[69]=P,e[70]=S,e[71]=L,e[72]=N,e[73]=a,e[74]=j,e[75]=me,e[76]=Z,e[77]=k,e[78]=ne):ne=e[78];let se;return e[79]!==le||e[80]!==U||e[81]!==ae||e[82]!==E||e[83]!==ne?(se=g("div",{className:"flex flex-col gap-4","data-testid":"lunora-schema",children:[le,U,ae,E,ne]}),e[79]=le,e[80]=U,e[81]=ae,e[82]=E,e[83]=ne,e[84]=se):se=e[84],se};function kt(s){return l("li",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground",children:s},s)}function It(s){return g("li",{className:"flex flex-wrap items-center gap-1.5 text-xs",children:[l("span",{className:"font-mono",children:s.name}),l(Fe,{variant:"outline",children:s.type}),s.unique===!0&&l(Fe,{variant:"secondary",children:"unique"}),l("span",{className:"text-muted-foreground",children:s.fields.join(", ")})]},`${s.type}:${s.name}`)}function At(s){return s.name}export{Zt as SchemaViewer};
|
|
1
|
+
import{c as Ne}from"react/compiler-runtime";import{ShardInput as We}from"../packem_shared/ShardInput-XumEzeT0.js";import{S as Re,T as Pe}from"../packem_shared/storage-tier-C2mKwYRj.js";import{B as Fe}from"../packem_shared/badge-cAk9Di1Q.js";import{b as ze,d as qe,c as Be,a as De,C as je}from"../packem_shared/card-BGlQzQY-.js";import{E as Qe}from"../packem_shared/empty-state-B939z6K2.js";import{I as ke}from"../packem_shared/input-CY5W3wzv.js";import{useT as Le}from"../packem_shared/DEFAULT_LOCALE-A1Yg5ORA.js";import{c as Oe,d as Ae,b as $e,f as be}from"../packem_shared/internal-CwaF9YNk.js";import{c as Je}from"../packem_shared/utils-bhneXptQ.js";import{useLunora as Ze}from"@lunora/react";import{useState as E,useEffect as Ge,useRef as et}from"react";import{u as tt}from"../packem_shared/use-shard-key-BsP3o5wT.js";import{ADMIN_FUNCTIONS as Me}from"../packem_shared/ADMIN_FUNCTIONS-4aE59aDq.js";import{r as lt}from"../packem_shared/shard-history-QcjcMnCA.js";import{S as st}from"../packem_shared/schema-diagram-DHD13TjS.js";import{useNavigate as at}from"@tanstack/react-router";import{B as ge}from"../packem_shared/button-BOPLD1un.js";import{L as _e}from"../packem_shared/label-BOUo-DP0.js";import{jsx as l,jsxs as p,Fragment as Ke}from"react/jsx-runtime";const nt=Oe(Me.listTables),ot=Oe(Me.listTableIndexes),it=Oe(Me.readTablePage),rt=Oe(Me.describeTables),dt={},Ue=[],ct=n=>{const e=Ne(74),{initialShardKey:m,initialTable:a}=n,t=Ze(),[s,c]=E("graph"),{queryShardKey:d,setShardKey:r,shardKey:b}=tt(m),[o,f]=E(""),[i,v]=E(null),[h,G]=E(null);let w;e[0]===Symbol.for("react.memo_cache_sentinel")?(w={},e[0]=w):w=e[0];const[B,y]=E(w);let z;e[1]===Symbol.for("react.memo_cache_sentinel")?(z={},e[1]=z):z=e[1];const[F,D]=E(z),[S,C]=E(null);let A;e[2]===Symbol.for("react.memo_cache_sentinel")?(A={},e[2]=A):A=e[2];const[L,me]=E(A);let W;e[3]===Symbol.for("react.memo_cache_sentinel")?(W={},e[3]=W):W=e[3];const[I,q]=E(W),[_,ue]=E(null),[j,ie]=E(null);let Q;e[4]===Symbol.for("react.memo_cache_sentinel")?(Q={},e[4]=Q):Q=e[4];const[Y,xe]=E(Q),[H,re]=E(null);let ve;e[5]!==t?(ve=async u=>{G(null);try{const N=await t.query(nt,{},Ae(u));lt(u),v(N),y({}),D({}),C(null),me(x=>Object.fromEntries(Object.entries(x).filter(P=>{const[k]=P;return k!==u}))),q(x=>Object.fromEntries(Object.entries(x).filter(P=>{const[k]=P;return k!==u})))}catch(N){const x=N;v(null),G($e(x))}},e[5]=t,e[6]=ve):ve=e[6];const O=ve;let Z;e[7]!==t?(Z=async()=>{ie(null);try{ue(await t.listGlobalTables())}catch(u){const N=u;ue(null),ie($e(N))}},e[7]=t,e[8]=Z):Z=e[8];const ee=Z;let de,R;e[9]!==d||e[10]!==O||e[11]!==ee?(de=()=>{be(O(d)),be(ee())},R=[O,ee,d],e[9]=d,e[10]=O,e[11]=ee,e[12]=de,e[13]=R):(de=e[12],R=e[13]),Ge(de,R);let te;e[14]!==t||e[15]!==B||e[16]!==S||e[17]!==d?(te=async u=>{if(S===u){C(null);return}C(u);const N=`${d}:${u}`;if(B[N]!==void 0)return;const[x,P]=await Promise.allSettled([t.query(it,{limit:1,offset:0,table:u},Ae(d)),t.query(ot,{table:u},Ae(d))]);x.status==="fulfilled"?y(k=>({...k,[N]:x.value.columns})):G($e(x.reason)),P.status==="fulfilled"&&D(k=>({...k,[N]:P.value.indexes}))},e[14]=t,e[15]=B,e[16]=S,e[17]=d,e[18]=te):te=e[18];const M=te;let ye;e[19]!==t||e[20]!==Y||e[21]!==H?(ye=async u=>{if(H===u){re(null);return}if(re(u),Y[u]===void 0)try{const N=await t.readGlobalTablePage({limit:1,offset:0,table:u});xe(x=>({...x,[u]:N.columns}))}catch(N){ie($e(N))}},e[19]=t,e[20]=Y,e[21]=H,e[22]=ye):ye=e[22];const ce=ye,fe=et(void 0);let K,X;e[23]!==a||e[24]!==i||e[25]!==M?(K=()=>{a===void 0||i===null||fe.current===a||i.some(u=>u.name===a)&&(fe.current=a,be(M(a)))},X=[a,i,M],e[23]=a,e[24]=i,e[25]=M,e[26]=K,e[27]=X):(K=e[26],X=e[27]),Ge(K,X);let U;e[28]!==t?(U=async(u,N,x)=>{const[P,k]=await Promise.all([Promise.allSettled([t.query(rt,{tables:[...N,...x]},Ae(u))]),Promise.all(x.map(async T=>{const pe=await Promise.allSettled([t.readGlobalTablePage({limit:1,offset:0,table:T})]),Ie=pe[0].status==="fulfilled"?pe[0].value:void 0;return{columns:Ie?.columns??[],refs:Ie?.refs??{},table:T}}))]),Te=P[0].status==="fulfilled"?P[0].value?.columnsByTable??{}:{},Se=P[0].status==="rejected",we=new Map(k.map(mt)),Ee=[...N,...x].map(T=>{const pe=Te[T]??[];return[T,pe.length>0?pe:we.get(T)??[]]});me(T=>({...T,[u]:Object.fromEntries(Ee)})),q(T=>({...T,[u]:Se}))},e[28]=t,e[29]=U):U=e[29];const le=U;let V,se;e[30]!==j||e[31]!==_||e[32]!==le||e[33]!==d||e[34]!==L||e[35]!==i||e[36]!==s?(V=()=>{s!=="graph"||i===null||_===null&&j===null||L[d]!==void 0||be(le(d,i.map(ut),(_??[]).map(ft)))},se=[s,i,_,j,d,L,le],e[30]=j,e[31]=_,e[32]=le,e[33]=d,e[34]=L,e[35]=i,e[36]=s,e[37]=V,e[38]=se):(V=e[37],se=e[38]),Ge(V,se);const $=L[d]??dt;let ae;if(e[39]!==$||e[40]!==_||e[41]!==i){let u;e[43]!==$?(u=k=>({columns:$[k.name]??Ue,name:k.name,tier:"shard"}),e[43]=$,e[44]=u):u=e[44];const N=(i??[]).map(u);let x;e[45]!==$?(x=k=>({columns:$[k.name]??Ue,name:k.name,tier:"global"}),e[45]=$,e[46]=x):x=e[46];const P=(_??[]).map(x);ae=[...N,...P],e[39]=$,e[40]=_,e[41]=i,e[42]=ae}else ae=e[42];const ne=ae;let g;if(e[47]!==o||e[48]!==i){const u=o.trim().toLowerCase();g=(i??[]).filter(N=>N.name.toLowerCase().includes(u)),e[47]=o,e[48]=i,e[49]=g}else g=e[49];const oe=g;let J;if(e[50]!==_||e[51]!==o){const u=o.trim().toLowerCase();J=(_??[]).filter(N=>N.name.toLowerCase().includes(u)),e[50]=_,e[51]=o,e[52]=J}else J=e[52];const Ce=J;let he;return e[53]!==B||e[54]!==ne||e[55]!==h||e[56]!==S||e[57]!==Ce||e[58]!==oe||e[59]!==Y||e[60]!==j||e[61]!==H||e[62]!==_||e[63]!==F||e[64]!==O||e[65]!==r||e[66]!==I||e[67]!==b||e[68]!==o||e[69]!==i||e[70]!==M||e[71]!==ce||e[72]!==s?(he={columns:B,diagramTables:ne,error:h,expanded:S,filteredGlobalTables:Ce,filteredTables:oe,globalColumns:Y,globalError:j,globalExpanded:H,globalTables:_,indexes:F,refresh:O,setShardKey:r,setTableFilter:f,setView:c,shardColumnsError:I,shardKey:b,tableFilter:o,tables:i,toggle:M,toggleGlobal:ce,view:s},e[53]=B,e[54]=ne,e[55]=h,e[56]=S,e[57]=Ce,e[58]=oe,e[59]=Y,e[60]=j,e[61]=H,e[62]=_,e[63]=F,e[64]=O,e[65]=r,e[66]=I,e[67]=b,e[68]=o,e[69]=i,e[70]=M,e[71]=ce,e[72]=s,e[73]=he):he=e[73],he};function mt(n){const{columns:e,refs:m,table:a}=n;return[a,e.map(t=>{const s=m[t];return s===void 0?{name:t,optional:!1,type:""}:{name:t,optional:!1,ref:s,type:"id"}})]}function ut(n){return n.name}function ft(n){return n.name}const ht="/__lunora/schema-edit",pt=async n=>{const e=await fetch(ht,{body:JSON.stringify(n),headers:{"Content-Type":"application/json","X-Lunora-Studio":"1"},method:"POST"}),m=await e.json();return m.needsMigration===!0?{kind:"needs-migration",message:m.message??"This edit needs a migration."}:e.ok&&m.tables!==void 0?{diagnostics:m.diagnostics??[],kind:"ok",tables:m.tables}:{kind:"error",message:m.error??`schema edit failed (${String(e.status)})`}},gt=n=>{const e=Ne(32),{hasTables:m,mode:a,onAddColumn:t,onAddIndex:s,onAddTable:c,onDestructive:d}=n,r=Le(),b=a==="addTable"?"default":"outline";let o;e[0]!==r?(o=r("Add table"),e[0]=r,e[1]=o):o=e[1];let f;e[2]!==c||e[3]!==b||e[4]!==o?(f=l(ge,{"data-testid":"sc-editor-add-table",onClick:c,size:"xs",type:"button",variant:b,children:o}),e[2]=c,e[3]=b,e[4]=o,e[5]=f):f=e[5];const i=!m,v=a==="addColumn"?"default":"outline";let h;e[6]!==r?(h=r("Add column"),e[6]=r,e[7]=h):h=e[7];let G;e[8]!==t||e[9]!==i||e[10]!==v||e[11]!==h?(G=l(ge,{"data-testid":"sc-editor-add-column",disabled:i,onClick:t,size:"xs",type:"button",variant:v,children:h}),e[8]=t,e[9]=i,e[10]=v,e[11]=h,e[12]=G):G=e[12];const w=!m,B=a==="addIndex"?"default":"outline";let y;e[13]!==r?(y=r("Add index"),e[13]=r,e[14]=y):y=e[14];let z;e[15]!==s||e[16]!==y||e[17]!==w||e[18]!==B?(z=l(ge,{"data-testid":"sc-editor-add-index",disabled:w,onClick:s,size:"xs",type:"button",variant:B,children:y}),e[15]=s,e[16]=y,e[17]=w,e[18]=B,e[19]=z):z=e[19];const F=!m,D=a==="destructive"?"default":"ghost";let S;e[20]!==r?(S=r("Rename / drop / change type…"),e[20]=r,e[21]=S):S=e[21];let C;e[22]!==d||e[23]!==F||e[24]!==D||e[25]!==S?(C=l(ge,{"data-testid":"sc-editor-destructive",disabled:F,onClick:d,size:"xs",type:"button",variant:D,children:S}),e[22]=d,e[23]=F,e[24]=D,e[25]=S,e[26]=C):C=e[26];let A;return e[27]!==z||e[28]!==C||e[29]!==f||e[30]!==G?(A=p("div",{className:"flex flex-wrap gap-2",children:[f,G,z,C]}),e[27]=z,e[28]=C,e[29]=f,e[30]=G,e[31]=A):A=e[31],A},bt=n=>{const e=Ne(28),{onOpenMigrations:m,result:a}=n,t=Le();if(a===null){let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=l(Ke,{}),e[0]=o):o=e[0],o}if(a.kind==="error"){let o;return e[1]!==a.message?(o=l("p",{className:"mt-3 text-sm text-destructive","data-testid":"sc-editor-error",role:"alert",children:a.message}),e[1]=a.message,e[2]=o):o=e[2],o}if(a.kind==="needs-migration"){let o;e[3]!==a.message||e[4]!==t?(o=a.message===""?t("This edit changes stored data and must go through a migration. Review the migration before applying."):a.message,e[3]=a.message,e[4]=t,e[5]=o):o=e[5];let f;e[6]!==o?(f=l("p",{className:"text-sm text-warning",role:"alert",children:o}),e[6]=o,e[7]=f):f=e[7];let i;e[8]!==t?(i=t("Open Migrations"),e[8]=t,e[9]=i):i=e[9];let v;e[10]!==m||e[11]!==i?(v=l(ge,{className:"self-start","data-testid":"sc-editor-open-migrations",onClick:m,size:"xs",type:"button",variant:"outline",children:i}),e[10]=m,e[11]=i,e[12]=v):v=e[12];let h;return e[13]!==f||e[14]!==v?(h=p("div",{className:"mt-3 flex flex-col gap-2","data-testid":"sc-editor-needs-migration",children:[f,v]}),e[13]=f,e[14]=v,e[15]=h):h=e[15],h}if(a.diagnostics.length===0){let o;return e[16]===Symbol.for("react.memo_cache_sentinel")?(o=l(Ke,{}),e[16]=o):o=e[16],o}let s;e[17]!==t?(s=t("Codegen reported diagnostics:"),e[17]=t,e[18]=s):s=e[18];let c;e[19]!==s?(c=l("p",{className:"text-sm text-destructive",role:"alert",children:s}),e[19]=s,e[20]=c):c=e[20];let d;e[21]!==a.diagnostics?(d=a.diagnostics.map(xt),e[21]=a.diagnostics,e[22]=d):d=e[22];let r;e[23]!==d?(r=l("ul",{className:"flex flex-col gap-0.5",children:d}),e[23]=d,e[24]=r):r=e[24];let b;return e[25]!==c||e[26]!==r?(b=p("div",{className:"mt-3 flex flex-col gap-1","data-testid":"sc-editor-diagnostics",children:[c,r]}),e[25]=c,e[26]=r,e[27]=b):b=e[27],b};function xt(n){return l("li",{className:"font-mono text-[11px] text-destructive",children:n},n)}const vt=[{label:"string",validator:"v.string()"},{label:"number",validator:"v.number()"},{label:"boolean",validator:"v.boolean()"},{label:"bigint",validator:"v.int64()"},{label:"bytes",validator:"v.bytes()"},{label:"any",validator:"v.any()"}],yt="v.string()",Ct=n=>n.split(",").map(e=>e.trim()).filter(e=>e!==""),Nt=n=>{const e=Ne(83),{onApplied:m,tableNames:a}=n,t=Le(),s=at(),[c,d]=E(null),[r,b]=E(!1),[o,f]=E(null),[i,v]=E(""),[h,G]=E(""),[w,B]=E(yt),[y,z]=E(a[0]??""),[F,D]=E(""),[S,C]=E(""),[A,L]=E(!1);let me;e[0]===Symbol.for("react.memo_cache_sentinel")?(me=()=>{d(null),v(""),G(""),D(""),C(""),L(!1)},e[0]=me):me=e[0];const W=me;let I;e[1]!==m?(I=async T=>{b(!0),f(null);try{const pe=await pt(T);f(pe),pe.kind==="ok"&&(m(pe.tables),W())}catch(pe){const Ie=pe;f({kind:"error",message:Ie instanceof Error?Ie.message:String(Ie)})}b(!1)},e[1]=m,e[2]=I):I=e[2];const q=I;let _;e[3]!==q||e[4]!==i?(_=()=>{be(q({kind:"addTable",table:i.trim()}))},e[3]=q,e[4]=i,e[5]=_):_=e[5];const ue=_;let j;e[6]!==h||e[7]!==q||e[8]!==y||e[9]!==w?(j=()=>{be(q({column:h.trim(),kind:"addOptionalColumn",table:y,validator:w}))},e[6]=h,e[7]=q,e[8]=y,e[9]=w,e[10]=j):j=e[10];const ie=j;let Q;e[11]!==S||e[12]!==F||e[13]!==q||e[14]!==y||e[15]!==A?(Q=()=>{be(q({fields:Ct(S),kind:"addIndex",name:F.trim(),table:y,unique:A}))},e[11]=S,e[12]=F,e[13]=q,e[14]=y,e[15]=A,e[16]=Q):Q=e[16];const Y=Q;let xe;e[17]===Symbol.for("react.memo_cache_sentinel")?(xe=()=>{f(null),d("addTable")},e[17]=xe):xe=e[17];const H=xe;let re;e[18]===Symbol.for("react.memo_cache_sentinel")?(re=()=>{f(null),d("addColumn")},e[18]=re):re=e[18];const ve=re;let O;e[19]===Symbol.for("react.memo_cache_sentinel")?(O=()=>{f(null),d("addIndex")},e[19]=O):O=e[19];const Z=O;let ee;e[20]!==t?(ee=()=>{d("destructive"),f({kind:"needs-migration",message:t("This edit changes stored data and must go through a migration. Review the migration before applying.")})},e[20]=t,e[21]=ee):ee=e[21];const de=ee;let R;e[22]===Symbol.for("react.memo_cache_sentinel")?(R=T=>{v(T.target.value)},e[22]=R):R=e[22];const te=R;let M;e[23]===Symbol.for("react.memo_cache_sentinel")?(M=T=>{G(T.target.value)},e[23]=M):M=e[23];const ye=M;let ce;e[24]===Symbol.for("react.memo_cache_sentinel")?(ce=T=>{B(T.target.value)},e[24]=ce):ce=e[24];const fe=ce;let K;e[25]===Symbol.for("react.memo_cache_sentinel")?(K=T=>{z(T.target.value)},e[25]=K):K=e[25];const X=K;let U;e[26]===Symbol.for("react.memo_cache_sentinel")?(U=T=>{D(T.target.value)},e[26]=U):U=e[26];const le=U;let V;e[27]===Symbol.for("react.memo_cache_sentinel")?(V=T=>{C(T.target.value)},e[27]=V):V=e[27];const se=V;let $;e[28]===Symbol.for("react.memo_cache_sentinel")?($=T=>{L(T.target.checked)},e[28]=$):$=e[28];const ae=$;let ne;e[29]!==s?(ne=()=>{be(s({to:"/migrations"}))},e[29]=s,e[30]=ne):ne=e[30];const g=ne;let oe;e[31]!==t?(oe=t("Edit schema"),e[31]=t,e[32]=oe):oe=e[32];let J;e[33]!==oe?(J=l(ze,{children:oe}),e[33]=oe,e[34]=J):J=e[34];let Ce;e[35]!==t?(Ce=t("Adds a table, column, or index to lunora/schema.ts and reruns codegen."),e[35]=t,e[36]=Ce):Ce=e[36];let he;e[37]!==Ce?(he=l(qe,{children:Ce}),e[37]=Ce,e[38]=he):he=e[38];let u;e[39]!==J||e[40]!==he?(u=p(Be,{children:[J,he]}),e[39]=J,e[40]=he,e[41]=u):u=e[41];const N=a.length>0;let x;e[42]!==c||e[43]!==de||e[44]!==N?(x=l(gt,{hasTables:N,mode:c,onAddColumn:ve,onAddIndex:Z,onAddTable:H,onDestructive:de}),e[42]=c,e[43]=de,e[44]=N,e[45]=x):x=e[45];let P;e[46]!==r||e[47]!==c||e[48]!==ue||e[49]!==t||e[50]!==i?(P=c==="addTable"&&p("div",{className:"mt-3 flex flex-wrap items-end gap-2","data-testid":"sc-editor-table-form",children:[p("div",{className:"flex flex-col gap-1 text-xs",children:[l(_e,{htmlFor:"sc-editor-table-name",children:t("Table name")}),l(ke,{"data-testid":"sc-editor-table-name",id:"sc-editor-table-name",onChange:te,value:i})]}),l(ge,{"data-testid":"sc-editor-table-apply",disabled:r||i.trim()==="",onClick:ue,size:"xs",type:"button",children:t(r?"Applying…":"Apply")}),l(ge,{onClick:W,size:"xs",type:"button",variant:"ghost",children:t("Cancel")})]}),e[46]=r,e[47]=c,e[48]=ue,e[49]=t,e[50]=i,e[51]=P):P=e[51];let k;e[52]!==r||e[53]!==h||e[54]!==c||e[55]!==ie||e[56]!==t||e[57]!==a||e[58]!==y||e[59]!==w?(k=c==="addColumn"&&p("div",{className:"mt-3 flex flex-wrap items-end gap-2","data-testid":"sc-editor-column-form",children:[p("div",{className:"flex flex-col gap-1 text-xs",children:[l(_e,{htmlFor:"sc-editor-column-table",children:t("Table name")}),l("select",{className:"h-8 rounded-md border border-input bg-transparent px-2 text-xs","data-testid":"sc-editor-column-table",id:"sc-editor-column-table",onChange:X,value:y,children:a.map(Tt)})]}),p("div",{className:"flex flex-col gap-1 text-xs",children:[l(_e,{htmlFor:"sc-editor-column-name",children:t("Column name")}),l(ke,{"data-testid":"sc-editor-column-name",id:"sc-editor-column-name",onChange:ye,value:h})]}),p("div",{className:"flex flex-col gap-1 text-xs",children:[l(_e,{htmlFor:"sc-editor-column-type",children:t("Column type")}),l("select",{className:"h-8 rounded-md border border-input bg-transparent px-2 text-xs","data-testid":"sc-editor-column-type",id:"sc-editor-column-type",onChange:fe,value:w,children:vt.map(St)})]}),l("span",{className:"text-[11px] text-muted-foreground",children:t("Optional")}),l(ge,{"data-testid":"sc-editor-column-apply",disabled:r||h.trim()===""||y==="",onClick:ie,size:"xs",type:"button",children:t(r?"Applying…":"Apply")}),l(ge,{onClick:W,size:"xs",type:"button",variant:"ghost",children:t("Cancel")})]}),e[52]=r,e[53]=h,e[54]=c,e[55]=ie,e[56]=t,e[57]=a,e[58]=y,e[59]=w,e[60]=k):k=e[60];let Te;e[61]!==r||e[62]!==S||e[63]!==F||e[64]!==c||e[65]!==Y||e[66]!==t||e[67]!==a||e[68]!==y||e[69]!==A?(Te=c==="addIndex"&&p("div",{className:"mt-3 flex flex-wrap items-end gap-2","data-testid":"sc-editor-index-form",children:[p("div",{className:"flex flex-col gap-1 text-xs",children:[l(_e,{htmlFor:"sc-editor-index-table",children:t("Table name")}),l("select",{className:"h-8 rounded-md border border-input bg-transparent px-2 text-xs","data-testid":"sc-editor-index-table",id:"sc-editor-index-table",onChange:X,value:y,children:a.map(wt)})]}),p("div",{className:"flex flex-col gap-1 text-xs",children:[l(_e,{htmlFor:"sc-editor-index-name",children:t("Index name")}),l(ke,{"data-testid":"sc-editor-index-name",id:"sc-editor-index-name",onChange:le,value:F})]}),p("div",{className:"flex flex-col gap-1 text-xs",children:[l(_e,{htmlFor:"sc-editor-index-fields",children:t("Index fields (comma-separated)")}),l(ke,{"data-testid":"sc-editor-index-fields",id:"sc-editor-index-fields",onChange:se,value:S})]}),p(_e,{className:"flex items-center gap-1 text-xs",htmlFor:"sc-editor-index-unique",children:[l("input",{checked:A,"data-testid":"sc-editor-index-unique",id:"sc-editor-index-unique",onChange:ae,type:"checkbox"}),l("span",{className:"text-muted-foreground",children:t("Unique")})]}),l(ge,{"data-testid":"sc-editor-index-apply",disabled:r||F.trim()===""||S.trim()==="",onClick:Y,size:"xs",type:"button",children:t(r?"Applying…":"Apply")}),l(ge,{onClick:W,size:"xs",type:"button",variant:"ghost",children:t("Cancel")})]}),e[61]=r,e[62]=S,e[63]=F,e[64]=c,e[65]=Y,e[66]=t,e[67]=a,e[68]=y,e[69]=A,e[70]=Te):Te=e[70];let Se;e[71]!==g||e[72]!==o?(Se=l(bt,{onOpenMigrations:g,result:o}),e[71]=g,e[72]=o,e[73]=Se):Se=e[73];let we;e[74]!==x||e[75]!==P||e[76]!==k||e[77]!==Te||e[78]!==Se?(we=p(De,{children:[x,P,k,Te,Se]}),e[74]=x,e[75]=P,e[76]=k,e[77]=Te,e[78]=Se,e[79]=we):we=e[79];let Ee;return e[80]!==u||e[81]!==we?(Ee=p(je,{"data-testid":"sc-editor",size:"sm",children:[u,we]}),e[80]=u,e[81]=we,e[82]=Ee):Ee=e[82],Ee};function Tt(n){return l("option",{value:n,children:n},n)}function St(n){return l("option",{value:n.validator,children:n.label},n.validator)}function wt(n){return l("option",{value:n,children:n},n)}const Ve=[],_t=n=>{const e=Ne(5),{open:m}=n,a=m&&"rotate-90";let t;e[0]!==a?(t=Je("size-3.5 shrink-0 text-muted-foreground transition-transform duration-150",a),e[0]=a,e[1]=t):t=e[1];let s;e[2]===Symbol.for("react.memo_cache_sentinel")?(s=l("path",{d:"m9 6 6 6-6 6"}),e[2]=s):s=e[2];let c;return e[3]!==t?(c=l("svg",{"aria-hidden":"true",className:t,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:s}),e[3]=t,e[4]=c):c=e[4],c},Ye=n=>{const e=Ne(20),{children:m,expanded:a,name:t,onToggle:s,rowCount:c,rowTestId:d,toggleTestId:r}=n;let b;e[0]!==a?(b=l(_t,{open:a}),e[0]=a,e[1]=b):b=e[1];let o;e[2]!==t?(o=l("span",{className:"truncate font-mono text-xs text-foreground",title:t,children:t}),e[2]=t,e[3]=o):o=e[3];let f;e[4]!==c?(f=p("span",{className:"ms-auto shrink-0 text-xs text-muted-foreground tabular-nums",children:["(",c,")"]}),e[4]=c,e[5]=f):f=e[5];let i;e[6]!==a||e[7]!==s||e[8]!==b||e[9]!==o||e[10]!==f||e[11]!==r?(i=p("button",{"aria-expanded":a,className:"flex w-full items-center gap-2 px-3 py-2 text-start transition-colors hover:bg-muted/50 aria-expanded:bg-muted/40","data-testid":r,onClick:s,type:"button",children:[b,o," ",f]}),e[6]=a,e[7]=s,e[8]=b,e[9]=o,e[10]=f,e[11]=r,e[12]=i):i=e[12];let v;e[13]!==m||e[14]!==a?(v=a&&l("div",{className:"px-3 pb-3 ps-8",children:m}),e[13]=m,e[14]=a,e[15]=v):v=e[15];let h;return e[16]!==d||e[17]!==i||e[18]!==v?(h=p("li",{className:"border-t border-border/60 first:border-t-0","data-testid":d,children:[i,v]}),e[16]=d,e[17]=i,e[18]=v,e[19]=h):h=e[19],h},He=n=>{const e=Ne(5),{columns:m,testId:a}=n;let t;e[0]!==m?(t=m.map(It),e[0]=m,e[1]=t):t=e[1];let s;return e[2]!==t||e[3]!==a?(s=l("ul",{className:"flex flex-wrap gap-1.5 pt-1","data-testid":a,children:t}),e[2]=t,e[3]=a,e[4]=s):s=e[4],s},Et=n=>{const e=Ne(10),{heading:m,indexes:a,testId:t}=n;let s;e[0]!==m?(s=l("p",{className:"mb-1.5 font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:m}),e[0]=m,e[1]=s):s=e[1];let c;e[2]!==a?(c=a.map(kt),e[2]=a,e[3]=c):c=e[3];let d;e[4]!==c||e[5]!==t?(d=l("ul",{className:"flex flex-col gap-1","data-testid":t,children:c}),e[4]=c,e[5]=t,e[6]=d):d=e[6];let r;return e[7]!==s||e[8]!==d?(r=p("div",{className:"pt-3",children:[s,d]}),e[7]=s,e[8]=d,e[9]=r):r=e[9],r},Xe=n=>Je("border-b-2 px-3 py-2 font-mono text-[11px] tracking-widest uppercase outline-none transition-colors",n?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),Wt=n=>{const e=Ne(85),{initialShardKey:m,initialTable:a,schemaEditable:t}=n,s=Le();let c;e[0]!==m||e[1]!==a?(c={initialShardKey:m,initialTable:a},e[0]=m,e[1]=a,e[2]=c):c=e[2];const{columns:d,diagramTables:r,error:b,expanded:o,filteredGlobalTables:f,filteredTables:i,globalColumns:v,globalError:h,globalExpanded:G,globalTables:w,indexes:B,refresh:y,setShardKey:z,setTableFilter:F,setView:D,shardColumnsError:S,shardKey:C,tableFilter:A,tables:L,toggle:me,toggleGlobal:W,view:I}=ct(c);let q;e[3]!==D?(q=()=>{D("list")},e[3]=D,e[4]=q):q=e[4];const _=q;let ue;e[5]!==D?(ue=()=>{D("graph")},e[5]=D,e[6]=ue):ue=e[6];const j=ue;let ie;e[7]!==F?(ie=g=>{F(g.target.value)},e[7]=F,e[8]=ie):ie=e[8];const Q=ie;let Y;e[9]!==y||e[10]!==C?(Y=g=>{be(y(C))},e[9]=y,e[10]=C,e[11]=Y):Y=e[11];const xe=Y;let H;e[12]!==L?(H=L??[],e[12]=L,e[13]=H):H=e[13];let re;e[14]!==H?(re=H.map(At),e[14]=H,e[15]=re):re=e[15];const ve=re;let O;e[16]!==z||e[17]!==C?(O=l(We,{onChange:z,testId:"sc-shard-input",value:C}),e[16]=z,e[17]=C,e[18]=O):O=e[18];let Z;e[19]!==s?(Z=s("Schema view"),e[19]=s,e[20]=Z):Z=e[20];const ee=I==="graph",de=I==="graph";let R;e[21]!==de?(R=Xe(de),e[21]=de,e[22]=R):R=e[22];let te;e[23]!==s?(te=s("Graph"),e[23]=s,e[24]=te):te=e[24];let M;e[25]!==j||e[26]!==ee||e[27]!==R||e[28]!==te?(M=l("button",{"aria-selected":ee,className:R,"data-testid":"sc-view-graph",onClick:j,role:"tab",type:"button",children:te}),e[25]=j,e[26]=ee,e[27]=R,e[28]=te,e[29]=M):M=e[29];const ye=I==="list",ce=I==="list";let fe;e[30]!==ce?(fe=Xe(ce),e[30]=ce,e[31]=fe):fe=e[31];let K;e[32]!==s?(K=s("Table list"),e[32]=s,e[33]=K):K=e[33];let X;e[34]!==_||e[35]!==ye||e[36]!==fe||e[37]!==K?(X=l("button",{"aria-selected":ye,className:fe,"data-testid":"sc-view-list",onClick:_,role:"tab",type:"button",children:K}),e[34]=_,e[35]=ye,e[36]=fe,e[37]=K,e[38]=X):X=e[38];let U;e[39]!==M||e[40]!==X||e[41]!==Z?(U=p("div",{"aria-label":Z,className:"flex items-center gap-1","data-testid":"sc-view-toggle",role:"tablist",children:[M,X]}),e[39]=M,e[40]=X,e[41]=Z,e[42]=U):U=e[42];let le;e[43]!==U||e[44]!==O?(le=p("div",{className:"flex flex-wrap items-center gap-3",children:[O,U]}),e[43]=U,e[44]=O,e[45]=le):le=e[45];let V;e[46]!==xe||e[47]!==t||e[48]!==ve?(V=t===!0&&l(Nt,{onApplied:xe,tableNames:ve}),e[46]=xe,e[47]=t,e[48]=ve,e[49]=V):V=e[49];let se;e[50]!==Q||e[51]!==s||e[52]!==A||e[53]!==I?(se=I==="list"&&l(ke,{"aria-label":s("Filter tables"),className:"h-8 max-w-xs","data-testid":"sc-filter",onChange:Q,placeholder:s("Filter tables"),value:A}),e[50]=Q,e[51]=s,e[52]=A,e[53]=I,e[54]=se):se=e[54];let $;e[55]!==r||e[56]!==b||e[57]!==h||e[58]!==S||e[59]!==C||e[60]!==I?($=I==="graph"&&p("div",{className:"flex flex-col gap-2","data-testid":"sc-graph-view",children:[b!==null&&l("p",{className:"text-sm text-destructive","data-testid":"sc-error",role:"alert",children:b}),h!==null&&l("p",{className:"text-sm text-destructive","data-testid":"sc-global-error",role:"alert",children:h}),l(st,{columnsError:S[C]===!0,tables:r,testIdPrefix:"sc-graph"})]}),e[55]=r,e[56]=b,e[57]=h,e[58]=S,e[59]=C,e[60]=I,e[61]=$):$=e[61];let ae;e[62]!==d||e[63]!==b||e[64]!==o||e[65]!==f||e[66]!==i||e[67]!==v||e[68]!==h||e[69]!==G||e[70]!==w||e[71]!==B||e[72]!==C||e[73]!==s||e[74]!==L||e[75]!==me||e[76]!==W||e[77]!==I?(ae=I==="list"&&p("div",{className:"flex flex-col gap-4",children:[p(je,{"data-testid":"sc-shard-section",size:"sm",children:[p(Be,{children:[p("div",{className:"flex items-center gap-2",children:[l(Re,{tier:"shard"}),l(ze,{children:s("Shard tables")}),L!==null&&l(Fe,{className:"ms-auto tabular-nums",variant:"outline",children:i.length})]}),l(qe,{children:Pe.shard.hint})]}),p(De,{children:[b!==null&&l("p",{className:"text-sm text-destructive","data-testid":"sc-error",role:"alert",children:b}),L!==null&&L.length===0&&l("p",{className:"text-sm text-muted-foreground","data-testid":"sc-empty",children:s("No tables in this shard.")}),L!==null&&L.length>0&&i.length===0&&l("p",{className:"text-sm text-muted-foreground","data-testid":"sc-no-match",children:s("No tables match your filter.")}),i.length>0&&l("ul",{className:"-mx-3 overflow-hidden border-t border-border","data-testid":"sc-table-list",children:i.map(g=>{const oe=`${C}:${g.name}`,J=B[oe]??[];return p(Ye,{expanded:o===g.name,name:g.name,onToggle:()=>{be(me(g.name))},rowCount:g.rowCount,rowTestId:`sc-table-${g.name}`,toggleTestId:`sc-toggle-${g.name}`,children:[l(He,{columns:d[oe]??Ve,testId:`sc-columns-${g.name}`}),J.length>0&&l(Et,{heading:s("Indexes"),indexes:J,testId:`sc-indexes-${g.name}`})]},g.name)})})]})]}),p(je,{"data-testid":"sc-global-section",size:"sm",children:[p(Be,{children:[p("div",{className:"flex items-center gap-2",children:[l(Re,{tier:"global"}),l(ze,{children:s("Global tables (D1)")}),w!==null&&l(Fe,{className:"ms-auto tabular-nums",variant:"outline",children:f.length})]}),l(qe,{children:Pe.global.hint})]}),p(De,{children:[h!==null&&l("p",{className:"text-sm text-destructive","data-testid":"sc-global-error",role:"alert",children:h}),w!==null&&w.length===0&&l(Qe,{description:Pe.global.hint,testId:"sc-global-empty",title:s("No global tables.")}),w!==null&&w.length>0&&f.length===0&&l("p",{className:"text-sm text-muted-foreground","data-testid":"sc-global-no-match",children:s("No tables match your filter.")}),f.length>0&&l("ul",{className:"-mx-3 overflow-hidden border-t border-border","data-testid":"sc-global-table-list",children:f.map(g=>l(Ye,{expanded:G===g.name,name:g.name,onToggle:()=>{be(W(g.name))},rowCount:g.rowCount,rowTestId:`sc-global-table-${g.name}`,toggleTestId:`sc-global-toggle-${g.name}`,children:l(He,{columns:v[g.name]??Ve,testId:`sc-global-columns-${g.name}`})},g.name))})]})]})]}),e[62]=d,e[63]=b,e[64]=o,e[65]=f,e[66]=i,e[67]=v,e[68]=h,e[69]=G,e[70]=w,e[71]=B,e[72]=C,e[73]=s,e[74]=L,e[75]=me,e[76]=W,e[77]=I,e[78]=ae):ae=e[78];let ne;return e[79]!==le||e[80]!==V||e[81]!==se||e[82]!==$||e[83]!==ae?(ne=p("div",{className:"flex flex-col gap-4","data-testid":"lunora-schema",children:[le,V,se,$,ae]}),e[79]=le,e[80]=V,e[81]=se,e[82]=$,e[83]=ae,e[84]=ne):ne=e[84],ne};function It(n){return l("li",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground",children:n},n)}function kt(n){return p("li",{className:"flex flex-wrap items-center gap-1.5 text-xs",children:[l("span",{className:"font-mono",children:n.name}),l(Fe,{variant:"outline",children:n.type}),n.unique===!0&&l(Fe,{variant:"secondary",children:"unique"}),l("span",{className:"text-muted-foreground",children:n.fields.join(", ")})]},`${n.type}:${n.name}`)}function At(n){return n.name}export{Wt as SchemaViewer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u}from"react/compiler-runtime";import{
|
|
1
|
+
import{c as u}from"react/compiler-runtime";import{u as m}from"../packem_shared/use-admin-query-P0RJrjsD.js";import{useT as h}from"../packem_shared/DEFAULT_LOCALE-A1Yg5ORA.js";import{ADMIN_FUNCTIONS as p}from"../packem_shared/ADMIN_FUNCTIONS-4aE59aDq.js";import{A as R}from"../packem_shared/advisor-view-C1KFTXSH.js";import{jsx as g}from"react/jsx-runtime";const f=(e,s)=>({"admin-token-weak":e("Weak admin token"),"auth-secret-weak":e("Weak auth secret"),"cookies-insecure":e("Session cookies are not Secure"),"cors-wildcard-credentials":e("Wildcard CORS with credentials"),"csrf-disabled":e("CSRF/origin guard is off"),"dev-args-unredacted":e("Request log keeps un-redacted args"),"security-headers-disabled":e("Security headers are off"),"ws-gate-open":e("Live admin subscriptions are ungated")})[s.kind],k=e=>Array.isArray(e.findings)?e.findings:[],S=e=>({"admin-token-weak":"LUNORA_ADMIN_TOKEN","auth-secret-weak":"AUTH_SECRET","cookies-insecure":"BETTER_AUTH_URL","cors-wildcard-credentials":"LUNORA_ALLOWED_ORIGINS","csrf-disabled":"LUNORA_SECURITY_CSRF","dev-args-unredacted":"request log","security-headers-disabled":"LUNORA_SECURITY_HEADERS","ws-gate-open":"LUNORA_WS_BEARER"})[e.kind],A=(e,s)=>({"admin-token-weak":e("Your admin token is {length} characters — use at least {min} for a brute-force-resistant secret.",{length:s.detail?.length,min:s.detail?.min}),"auth-secret-weak":e("Your auth secret is {length} characters — use at least {min} (e.g. `openssl rand -hex 32`) to sign sessions safely.",{length:s.detail?.length,min:s.detail?.min}),"cookies-insecure":e("BETTER_AUTH_URL is a plaintext http:// origin, so session cookies cannot be Secure and ride in cleartext. Serve auth over https:// in production."),"cors-wildcard-credentials":e("LUNORA_ALLOWED_ORIGINS includes a wildcard while credentials are allowed — browsers reject this and it defeats the allowlist. Name explicit origins instead of *."),"csrf-disabled":e("LUNORA_SECURITY_CSRF is off, so cross-origin state-changing cookie requests are not blocked. Re-enable it in production to keep mutations un-forgeable."),"dev-args-unredacted":e("This worker reports a development environment, so the request log stores raw args and identity. Confirm it isn't a mislabeled production deploy."),"security-headers-disabled":e("LUNORA_SECURITY_HEADERS is off, so HSTS, CSP, nosniff, and frame-options are not applied. Re-enable the baseline headers in production."),"ws-gate-open":e("LUNORA_WS_BEARER is unset, so the WebSocket upgrade gate is open: live admin subscriptions need no credential. Set it to gate them like the HTTP admin RPCs.")})[s.kind],y=()=>{const e=u(8),s=h();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={},e[0]=i):i=e[0];const{data:r,error:n,errorSource:d}=m(p.getSecurityAudit,i);let a;if(e[1]!==r||e[2]!==s){const l=r===void 0?null:k(r);a=l===null?null:l.map(t=>({description:A(s,t),entity:S(t),issueType:f(s,t),key:t.kind,level:t.level})),e[1]=r,e[2]=s,e[3]=a}else a=e[3];const c=a;let o;return e[4]!==n||e[5]!==d||e[6]!==c?(o=g(R,{error:n,errorSource:d,rows:c,testId:"lunora-security-advisor"}),e[4]=n,e[5]=d,e[6]=c,e[7]=o):o=e[7],o};export{y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as
|
|
1
|
+
import{c as K}from"react/compiler-runtime";import{E as O}from"../packem_shared/error-alert-TYdKetJd.js";import{B}from"../packem_shared/badge-cAk9Di1Q.js";import{C as D,a as U}from"../packem_shared/card-BGlQzQY-.js";import{T as V,a as j,b as L,c as I,d as F,e as S}from"../packem_shared/table-BMsuYFhk.js";import{u as H}from"../packem_shared/use-admin-query-P0RJrjsD.js";import{useT as M}from"../packem_shared/DEFAULT_LOCALE-A1Yg5ORA.js";import{ADMIN_FUNCTIONS as P}from"../packem_shared/ADMIN_FUNCTIONS-4aE59aDq.js";import{C as Q}from"../packem_shared/cf-links-CBJ5SywP.js";import{jsxs as c,jsx as t}from"react/jsx-runtime";const W={binding:"outline",secret:"destructive",var:"secondary"},$=(r,e)=>{if(r===void 0)return[];const m=[];return r.workerUrl!==void 0&&m.push({label:e("URL"),value:r.workerUrl}),r.environment!==void 0&&m.push({label:e("Environment"),value:r.environment}),r.deploymentId!==void 0&&m.push({label:e("Deployment"),value:r.deploymentId}),r.versionTag!==void 0&&m.push({label:e("Version"),value:r.versionTag}),m},ne=r=>{const e=K(52),{initialShardKey:m}=r,s=M();let w;e[0]===Symbol.for("react.memo_cache_sentinel")?(w={},e[0]=w):w=e[0];const R=m??"";let k;e[1]!==R?(k={shardKey:R},e[1]=R,e[2]=k):k=e[2];const{data:n,error:a,errorSource:T,isLoading:E}=H(P.getSettings,w,k);let l,f,u,i,o,d,p;if(e[3]!==a||e[4]!==T||e[5]!==n?.deploy||e[6]!==n?.settings||e[7]!==s){const A=$(n?.deploy,s);let _;e[15]!==n?.settings?(_=n?.settings??[],e[15]=n?.settings,e[16]=_):_=e[16],l=_,f="flex flex-col gap-4",u="lunora-settings";let N;e[17]!==s?(N=s("Open in Cloudflare"),e[17]=s,e[18]=N):N=e[18],e[19]!==N?(i=t("div",{className:"flex flex-wrap items-center gap-3",children:t("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"set-cf-link",href:Q,rel:"noreferrer",target:"_blank",children:N})}),e[19]=N,e[20]=i):i=e[20];let y;e[21]!==s?(y=s("View-only — values are masked. Edit vars, secrets, and bindings in wrangler or the Cloudflare dashboard."),e[21]=s,e[22]=y):y=e[22],e[23]!==y?(o=t("p",{className:"text-sm text-muted-foreground","data-testid":"set-readonly-note",children:y}),e[23]=y,e[24]=o):o=e[24],e[25]!==a||e[26]!==T?(d=a!==null&&t(O,{error:T,testId:"set-error"}),e[25]=a,e[26]=T,e[27]=d):d=e[27],p=A.length>0&&c(D,{className:"py-0","data-testid":"set-deploy",children:[t("header",{className:"border-b border-border px-4 py-3",children:t("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:s("Deployment")})}),t(U,{className:"py-3",children:t("dl",{className:"grid grid-cols-[8rem_minmax(0,1fr)] gap-x-4 gap-y-1 text-sm",children:A.map(q)})})]}),e[3]=a,e[4]=T,e[5]=n?.deploy,e[6]=n?.settings,e[7]=s,e[8]=l,e[9]=f,e[10]=u,e[11]=i,e[12]=o,e[13]=d,e[14]=p}else l=e[8],f=e[9],u=e[10],i=e[11],o=e[12],d=e[13],p=e[14];let h;e[28]!==s?(h=s("Environment & bindings"),e[28]=s,e[29]=h):h=e[29];let g;e[30]!==h?(g=t("header",{className:"border-b border-border px-4 py-3",children:t("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:h})}),e[30]=h,e[31]=g):g=e[31];let x;e[32]!==a||e[33]!==E||e[34]!==l.length||e[35]!==s?(x=a===null&&!E&&l.length===0&&t("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"set-empty",children:s("No environment variables or bindings.")}),e[32]=a,e[33]=E,e[34]=l.length,e[35]=s,e[36]=x):x=e[36];let b;e[37]!==l||e[38]!==s?(b=l.length>0&&t(U,{className:"px-0 py-0",children:c(V,{"data-testid":"set-table",children:[t(j,{children:c(L,{children:[t(I,{children:s("name")}),t(I,{children:s("kind")}),t(I,{children:s("value")})]})}),t(F,{children:l.map(z)})]})}),e[37]=l,e[38]=s,e[39]=b):b=e[39];let v;e[40]!==g||e[41]!==x||e[42]!==b?(v=c(D,{className:"py-0",children:[g,x,b]}),e[40]=g,e[41]=x,e[42]=b,e[43]=v):v=e[43];let C;return e[44]!==v||e[45]!==f||e[46]!==u||e[47]!==i||e[48]!==o||e[49]!==d||e[50]!==p?(C=c("div",{className:f,"data-testid":u,children:[i,o,d,p,v]}),e[44]=v,e[45]=f,e[46]=u,e[47]=i,e[48]=o,e[49]=d,e[50]=p,e[51]=C):C=e[51],C};function q(r){return c("div",{className:"contents","data-testid":"set-deploy-row",children:[t("dt",{className:"text-muted-foreground",children:r.label}),t("dd",{className:"truncate font-mono text-xs",title:r.value,children:r.value})]},r.label)}function z(r){return c(L,{"data-testid":"set-row",children:[t(S,{className:"font-mono text-xs font-medium",children:r.name}),t(S,{children:t(B,{variant:W[r.kind],children:r.bindingType??r.kind})}),t(S,{className:"max-w-[28ch] truncate font-mono text-xs text-muted-foreground",children:r.value??t("span",{className:"text-muted-foreground",children:"—"})})]},r.name)}export{ne as SettingsPanel};
|