@lunora/studio 1.0.0-alpha.358 → 1.0.0-alpha.359
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.mjs +1 -1
- package/dist/mount.mjs +1 -1
- package/dist/packem_chunks/AdvisorHealthPanel.mjs +1 -1
- package/dist/packem_chunks/ApiTab.mjs +1 -1
- package/dist/packem_chunks/AuditPanel.mjs +1 -1
- package/dist/packem_chunks/DeploymentHealthPanel.mjs +1 -1
- package/dist/packem_chunks/ExportImportPanel.mjs +1 -1
- package/dist/packem_chunks/FileBrowser.mjs +1 -1
- package/dist/packem_chunks/FunctionRunner.mjs +1 -1
- package/dist/packem_chunks/FunctionStatsPanel.mjs +1 -1
- package/dist/packem_chunks/HealthPanel.mjs +1 -1
- package/dist/packem_chunks/InsightsPanel.mjs +1 -1
- package/dist/packem_chunks/LogsPanel.mjs +1 -1
- package/dist/packem_chunks/MailPanel.mjs +1 -1
- package/dist/packem_chunks/MetricsPanel.mjs +1 -1
- package/dist/packem_chunks/NotificationsPanel.mjs +1 -1
- package/dist/packem_chunks/PitrPanel.mjs +1 -1
- package/dist/packem_chunks/SchemaViewer.mjs +1 -1
- package/dist/packem_chunks/SecurityAdvisorPanel.mjs +1 -1
- package/dist/packem_chunks/SettingsPanel.mjs +1 -1
- package/dist/packem_chunks/SqlEditorPanel.mjs +1 -1
- package/dist/packem_chunks/TableEditor.mjs +1 -1
- package/dist/packem_chunks/agents-panel.mjs +1 -1
- package/dist/packem_chunks/ai-usage-panel.mjs +1 -1
- package/dist/packem_chunks/analytics-panel.mjs +1 -1
- package/dist/packem_chunks/architecture-panel.mjs +1 -1
- package/dist/packem_chunks/auth-audit-panel.mjs +1 -1
- package/dist/packem_chunks/auth-config-panel.mjs +1 -1
- package/dist/packem_chunks/auth-sessions-panel.mjs +1 -1
- package/dist/packem_chunks/containers-panel.mjs +1 -1
- package/dist/packem_chunks/dashboards-panel.mjs +1 -1
- package/dist/packem_chunks/evals-panel.mjs +1 -1
- package/dist/packem_chunks/fanout-panel.mjs +1 -1
- package/dist/packem_chunks/flags-panel.mjs +1 -1
- package/dist/packem_chunks/issues-panel.mjs +1 -1
- package/dist/packem_chunks/kv-browser.mjs +1 -1
- package/dist/packem_chunks/log-drains-panel.mjs +1 -1
- package/dist/packem_chunks/migrations-route.mjs +1 -1
- package/dist/packem_chunks/organizations-panel.mjs +1 -1
- package/dist/packem_chunks/payments-panel.mjs +1 -1
- package/dist/packem_chunks/permissions-panel.mjs +1 -1
- package/dist/packem_chunks/privacy-requests-panel.mjs +1 -1
- package/dist/packem_chunks/queues-panel.mjs +1 -1
- package/dist/packem_chunks/reactors-panel.mjs +1 -1
- package/dist/packem_chunks/rls-panel.mjs +1 -1
- package/dist/packem_chunks/schedule-panel.mjs +1 -1
- package/dist/packem_chunks/storage-rules-panel.mjs +1 -1
- package/dist/packem_chunks/subscriptions-panel.mjs +1 -1
- package/dist/packem_chunks/sync-client-panel.mjs +1 -1
- package/dist/packem_chunks/traces-panel.mjs +1 -1
- package/dist/packem_chunks/users-panel.mjs +1 -1
- package/dist/packem_chunks/vector-browser.mjs +1 -1
- package/dist/packem_chunks/workflows-panel.mjs +1 -1
- package/dist/packem_shared/{ApiDocsPanel-E4Vr-8zW.mjs → ApiDocsPanel-DD2Uns6b.mjs} +1 -1
- package/dist/packem_shared/{ApiReferencePanel-u9Rrljdf.mjs → ApiReferencePanel-CQxU1Ocx.mjs} +1 -1
- package/dist/packem_shared/{CommandPalette-5OsK8PNe.mjs → CommandPalette-BZCHLpst.mjs} +1 -1
- package/dist/packem_shared/{DEFAULT_AUTO_REFRESH_MS-CG7Q45ZS.mjs → DEFAULT_AUTO_REFRESH_MS-Py5Yx7rP.mjs} +1 -1
- package/dist/packem_shared/{DataBrowser-C5HbI4TH.mjs → DataBrowser-CVRWnNWu.mjs} +1 -1
- package/dist/packem_shared/{GlobalDataBrowser-D0H2yJSl.mjs → GlobalDataBrowser-DC47T6Zl.mjs} +1 -1
- package/dist/packem_shared/{HomePanel-CcYkDlR-.mjs → HomePanel-D12HxHQo.mjs} +1 -1
- package/dist/packem_shared/{MigrationsPanel-YyCO_T-3.mjs → MigrationsPanel-DMkxSXNl.mjs} +1 -1
- package/dist/packem_shared/{OpenRpcReferencePanel-E9cDfHRv.mjs → OpenRpcReferencePanel-BFDG91tn.mjs} +1 -1
- package/dist/packem_shared/{ScheduledJobs-D4CUj7aX.mjs → ScheduledJobs-QCTRdugp.mjs} +1 -1
- package/dist/packem_shared/{Studio-4vJzwwNa.mjs → Studio-MA8kKZLu.mjs} +1 -1
- package/dist/packem_shared/{StudioApp-px2FMPDS.mjs → StudioApp-isdWpF9P.mjs} +1 -1
- package/dist/packem_shared/{advisor-view-fNcNYW2Q.mjs → advisor-view-tBumWci_.mjs} +1 -1
- package/dist/packem_shared/{data-grid-r3isM8Nq.mjs → data-grid-B5m1OosL.mjs} +1 -1
- package/dist/packem_shared/{diagram-export-panel-aBDQdX4e.mjs → diagram-export-panel-Vdt-DZnO.mjs} +1 -1
- package/dist/packem_shared/{error-alert-54TiaMvZ.mjs → error-alert-C0R39DO1.mjs} +1 -1
- package/dist/packem_shared/{grid-features-2c5SaBtH.mjs → grid-features-Drvfswwy.mjs} +1 -1
- package/dist/packem_shared/{home-panel-DPiMVQZ2.mjs → home-panel-CDVTuTF8.mjs} +1 -1
- package/dist/packem_shared/internal-hIuTpSbx.mjs +2 -0
- package/dist/packem_shared/{log-line-BWDt_F56.mjs → log-line-BH0iWiBv.mjs} +1 -1
- package/dist/packem_shared/{recording-client-MbGZ28I0.mjs → recording-client-DAipTA_n.mjs} +1 -1
- package/dist/packem_shared/{reference-view-DCEC5kjY.mjs → reference-view-DENugPcj.mjs} +1 -1
- package/dist/packem_shared/{schema-diagram-k7cFl7Wp.mjs → schema-diagram-CtVPhOGj.mjs} +1 -1
- package/dist/packem_shared/{sql-result-table-CatgdmMh.mjs → sql-result-table-DCwooMGW.mjs} +1 -1
- package/dist/packem_shared/{studio-DIUgH7k0.mjs → studio-UhUrPz5J.mjs} +1 -1
- package/dist/packem_shared/{table-list-sidebar-CCRB_iYz.mjs → table-list-sidebar-CNadcIgG.mjs} +1 -1
- package/dist/packem_shared/{use-admin-query-BW9IuacC.mjs → use-admin-query-CaOm4JS3.mjs} +1 -1
- package/dist/packem_shared/{use-admin-spec-BdNLZbTO.mjs → use-admin-spec-CK7mk3Ui.mjs} +1 -1
- package/dist/packem_shared/{use-async-submit-2eBBD0-m.mjs → use-async-submit-D0r7-m2J.mjs} +1 -1
- package/dist/packem_shared/{use-auth-config-KO9tnI39.mjs → use-auth-config-CG7VvAvQ.mjs} +1 -1
- package/dist/packem_shared/{use-open-trace-B_0LbTD7.mjs → use-open-trace-BJKMJjeS.mjs} +1 -1
- package/dist/packem_shared/{use-sql-assistant-BMVlguKF.mjs → use-sql-assistant-rZPs3LC3.mjs} +1 -1
- package/dist/standalone/{chunk-UFPN44MP.js → chunk-2AH4ABE5.js} +1 -1
- package/dist/standalone/{chunk-FYWZRJCT.js → chunk-2G57ENH5.js} +1 -1
- package/dist/standalone/{chunk-CVUNFP54.js → chunk-3FS22LNI.js} +1 -1
- package/dist/standalone/{chunk-2CPBNLFU.js → chunk-3GYLOE4V.js} +1 -1
- package/dist/standalone/{chunk-XZKWGTLI.js → chunk-3PAYDWHN.js} +1 -1
- package/dist/standalone/{chunk-FACE2CFY.js → chunk-473JK2PQ.js} +1 -1
- package/dist/standalone/chunk-4DAKKAK7.js +1 -0
- package/dist/standalone/{chunk-FRN6D6MP.js → chunk-4M57OYFX.js} +1 -1
- package/dist/standalone/{chunk-KRDWV6YM.js → chunk-5GIQ6C5N.js} +1 -1
- package/dist/standalone/{chunk-MDAXV2XH.js → chunk-5R2YO7HF.js} +1 -1
- package/dist/standalone/{chunk-SUOVLXY6.js → chunk-5WJG7FMH.js} +1 -1
- package/dist/standalone/{chunk-4FZYH76L.js → chunk-63KDHS3H.js} +1 -1
- package/dist/standalone/{chunk-HGT4YHTI.js → chunk-6B6ARRMI.js} +1 -1
- package/dist/standalone/{chunk-NSUOMZWM.js → chunk-6LMO2D54.js} +1 -1
- package/dist/standalone/{chunk-2O6KKVH2.js → chunk-6VAY6L4J.js} +1 -1
- package/dist/standalone/{chunk-HKLF627N.js → chunk-7PADVGQX.js} +1 -1
- package/dist/standalone/{chunk-IIJXS3KP.js → chunk-7UM5ROG6.js} +1 -1
- package/dist/standalone/{chunk-XIVWJUD3.js → chunk-7ZIYHKLX.js} +1 -1
- package/dist/standalone/{chunk-NEZRBBPI.js → chunk-A5JISKHE.js} +1 -1
- package/dist/standalone/{chunk-MI7DM536.js → chunk-ADNRFCMZ.js} +1 -1
- package/dist/standalone/chunk-BFE2DRP6.js +33 -0
- package/dist/standalone/{chunk-OIBN6KMM.js → chunk-BPEB4KFE.js} +1 -1
- package/dist/standalone/chunk-BVX45MU5.js +7 -0
- package/dist/standalone/{chunk-5IGDDSST.js → chunk-BYOGQ2IV.js} +1 -1
- package/dist/standalone/{chunk-AKGGWCWW.js → chunk-C6GN7ZXJ.js} +1 -1
- package/dist/standalone/{chunk-ZD53YB3L.js → chunk-CL2VZNDI.js} +1 -1
- package/dist/standalone/{chunk-P6L6ABWO.js → chunk-CNA3TVUK.js} +1 -1
- package/dist/standalone/chunk-CZ6HBDIL.js +1 -0
- package/dist/standalone/{chunk-MY7ZGJOD.js → chunk-D6S7MXW4.js} +1 -1
- package/dist/standalone/{chunk-LKCO3E2B.js → chunk-FCAXVYAX.js} +1 -1
- package/dist/standalone/{chunk-ZWDORIZY.js → chunk-FXPAJDES.js} +1 -1
- package/dist/standalone/{chunk-WZTY3ZYI.js → chunk-H7HZ42JY.js} +1 -1
- package/dist/standalone/{chunk-CW57Q264.js → chunk-HHRYM6UW.js} +1 -1
- package/dist/standalone/{chunk-PMGNJZYE.js → chunk-HPRF5LMA.js} +1 -1
- package/dist/standalone/{chunk-PBKTGB7B.js → chunk-IB22LETR.js} +1 -1
- package/dist/standalone/chunk-IENQRRQT.js +1 -0
- package/dist/standalone/{chunk-LRXCL6IA.js → chunk-IQ4TTHQT.js} +1 -1
- package/dist/standalone/{chunk-TA3DCQUA.js → chunk-ITH5LRWM.js} +1 -1
- package/dist/standalone/{chunk-B4BK5Q5O.js → chunk-J6VFG6M5.js} +1 -1
- package/dist/standalone/{chunk-MD67S53Z.js → chunk-JSDKOE4U.js} +1 -1
- package/dist/standalone/{chunk-EAZXULX6.js → chunk-JZD7ZN3F.js} +1 -1
- package/dist/standalone/chunk-K3CWB3AM.js +1 -0
- package/dist/standalone/{chunk-FCRSF54M.js → chunk-KNFB3FGW.js} +1 -1
- package/dist/standalone/{chunk-WOGVVXGF.js → chunk-KNXWDE4N.js} +1 -1
- package/dist/standalone/{chunk-DPESH5MT.js → chunk-KRY7BYHT.js} +1 -1
- package/dist/standalone/chunk-KYAG2YMF.js +1 -0
- package/dist/standalone/{chunk-OUFWXYEF.js → chunk-KZCEJFZF.js} +1 -1
- package/dist/standalone/{chunk-F4VO76XV.js → chunk-KZILJQX3.js} +1 -1
- package/dist/standalone/{chunk-OSQYIZAV.js → chunk-LEYUH5TS.js} +1 -1
- package/dist/standalone/{chunk-AN2L3XHC.js → chunk-LFM672WN.js} +1 -1
- package/dist/standalone/{chunk-FHGTI6PR.js → chunk-LPU6YTSU.js} +1 -1
- package/dist/standalone/{chunk-TRZTGE4R.js → chunk-MWJC3S62.js} +1 -1
- package/dist/standalone/{chunk-OX7I5YHU.js → chunk-NP2AQOLE.js} +1 -1
- package/dist/standalone/{chunk-5SYMAYUA.js → chunk-NVKLYDOH.js} +1 -1
- package/dist/standalone/{chunk-ZFFZWSDJ.js → chunk-O2NMPIV2.js} +1 -1
- package/dist/standalone/{chunk-BCP3MEB3.js → chunk-O2X2XYCM.js} +1 -1
- package/dist/standalone/{chunk-XZ6B5XNN.js → chunk-O3MDWYXF.js} +1 -1
- package/dist/standalone/chunk-ONG4JEZD.js +1 -0
- package/dist/standalone/{chunk-DS7HZKZ2.js → chunk-ONWGX5Y4.js} +1 -1
- package/dist/standalone/{chunk-X5KWBDTF.js → chunk-OS26JXYA.js} +1 -1
- package/dist/standalone/{chunk-N4AWDORA.js → chunk-PGTEGUAB.js} +1 -1
- package/dist/standalone/{chunk-6I42AM75.js → chunk-PQH2LSJX.js} +1 -1
- package/dist/standalone/{chunk-7KPRMBD6.js → chunk-PTBUWRBY.js} +1 -1
- package/dist/standalone/{chunk-4IEMXFUB.js → chunk-Q6HA3L2H.js} +1 -1
- package/dist/standalone/{chunk-KRH6UDVU.js → chunk-QGV5ARD2.js} +1 -1
- package/dist/standalone/{chunk-YJWR6ZWC.js → chunk-QWRK4ESB.js} +1 -1
- package/dist/standalone/{chunk-WC5QFZYZ.js → chunk-RL2ITK2N.js} +1 -1
- package/dist/standalone/{chunk-ZQOPXQIT.js → chunk-RTJO3AR4.js} +1 -1
- package/dist/standalone/{chunk-SDQH4HR6.js → chunk-SU5DTRGK.js} +1 -1
- package/dist/standalone/{chunk-OSJ7HV7B.js → chunk-T5UMHPAB.js} +1 -1
- package/dist/standalone/{chunk-QXHMVPS3.js → chunk-T6HV2FQP.js} +1 -1
- package/dist/standalone/{chunk-FNUPPZKJ.js → chunk-T7ZKNNGX.js} +1 -1
- package/dist/standalone/{chunk-FLVDICZL.js → chunk-TCYPNSTV.js} +1 -1
- package/dist/standalone/{chunk-MHJNM7VT.js → chunk-TQM6XHBA.js} +1 -1
- package/dist/standalone/{chunk-IWG2D7QS.js → chunk-TRMWBRRU.js} +1 -1
- package/dist/standalone/{chunk-FSWWDMW2.js → chunk-TW7KJSMR.js} +1 -1
- package/dist/standalone/{chunk-NMVFSJM7.js → chunk-TYD3V4NB.js} +1 -1
- package/dist/standalone/{chunk-3HX723U6.js → chunk-TZKLK52W.js} +1 -1
- package/dist/standalone/{chunk-B6OTKSMY.js → chunk-U4RXQSQ7.js} +1 -1
- package/dist/standalone/{chunk-MC577GI5.js → chunk-UNZ2UBVL.js} +1 -1
- package/dist/standalone/{chunk-SJLEEYCR.js → chunk-VJRNOSRY.js} +1 -1
- package/dist/standalone/{chunk-HKPDPKXD.js → chunk-WM72PRE3.js} +1 -1
- package/dist/standalone/{chunk-HSLO46OW.js → chunk-X4WHMCOZ.js} +1 -1
- package/dist/standalone/{chunk-PCMV6S7K.js → chunk-XIRKBJPD.js} +1 -1
- package/dist/standalone/{chunk-WCWSMX3N.js → chunk-XKPD4SFN.js} +1 -1
- package/dist/standalone/chunk-XMSNLMWU.js +1 -0
- package/dist/standalone/{chunk-JYCRY3LM.js → chunk-XOPFDWXX.js} +1 -1
- package/dist/standalone/{chunk-V6SVNLUM.js → chunk-XQLOVFPP.js} +1 -1
- package/dist/standalone/{chunk-HONLEKH5.js → chunk-XSHYZPGF.js} +1 -1
- package/dist/standalone/{chunk-KYONGQQ4.js → chunk-XST3UEHU.js} +1 -1
- package/dist/standalone/{chunk-AOHKAKKL.js → chunk-Y74LIFSL.js} +1 -1
- package/dist/standalone/{chunk-CTE6RPXC.js → chunk-YMEKCV27.js} +1 -1
- package/dist/standalone/{chunk-CZACJYDC.js → chunk-ZOQTXWPK.js} +1 -1
- package/dist/standalone/{chunk-FMQ72AKG.js → chunk-ZZ5GICTF.js} +1 -1
- package/dist/standalone/studio.js +1 -1
- package/package.json +6 -6
- package/dist/packem_shared/internal-BXEjuLPN.mjs +0 -2
- package/dist/standalone/chunk-3Y5K3IQO.js +0 -1
- package/dist/standalone/chunk-GMO7IUXO.js +0 -1
- package/dist/standalone/chunk-LPINY2IJ.js +0 -19
- package/dist/standalone/chunk-LVNPLZDL.js +0 -1
- package/dist/standalone/chunk-PTCC45P7.js +0 -1
- package/dist/standalone/chunk-PZZWUL5U.js +0 -1
- package/dist/standalone/chunk-SDSQIQJG.js +0 -21
- package/dist/standalone/chunk-W37HRJGQ.js +0 -1
- package/dist/standalone/chunk-XBZUJDHD.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as Ne}from"react/compiler-runtime";import{useState as Q,useEffect as Se}from"react";import{ConfirmButton as Ie}from"./ConfirmButton-CIXYF6Mg.mjs";import{E as Ee}from"./error-alert-
|
|
1
|
+
import{c as Ne}from"react/compiler-runtime";import{useState as Q,useEffect as Se}from"react";import{ConfirmButton as Ie}from"./ConfirmButton-CIXYF6Mg.mjs";import{E as Ee}from"./error-alert-C0R39DO1.mjs";import{L as Me}from"./live-status-D1GasNsH.mjs";import{ShardInput as Te}from"./ShardInput-CoySruKZ.mjs";import{B as _e}from"./badge-r_5B4LHP.mjs";import{B as ke}from"./button-q0UYSmrn.mjs";import{C as we,a as De}from"./card-By2O8ULa.mjs";import{E as Le}from"./empty-state-D7jEML_T.mjs";import{I as Be}from"./input-CXhxesPC.mjs";import{L as me}from"./label-DKFzyHq6.mjs";import{T as Ae,a as Ke,b as fe,c as m,d as je,e as f}from"./table-D0SBiDu-.mjs";import{u as Fe}from"./use-admin-query-CaOm4JS3.mjs";import{u as Oe}from"./use-shard-key-BsP3o5wT.mjs";import{u as qe}from"./use-studio-client-DCA50tF2.mjs";import{useT as He}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{ADMIN_FUNCTIONS as he}from"./ADMIN_FUNCTIONS-4aGsMs95.mjs";import{h as Qe,c as Ue,f as $e,d as ze,b as Ge}from"./internal-hIuTpSbx.mjs";import{r as Pe}from"./shard-history-CaO3C4KQ.mjs";import{jsx as r,jsxs as s}from"react/jsx-runtime";const We=Ue(he.runMigration),yt=i=>{const e=Ne(98),{initialShardKey:pe}=i,re=qe(),t=He(),{queryShardKey:d,setShardKey:ie,shardKey:a}=Oe(pe),[h,ge]=Q(""),[p,ye]=Q("up"),[l,be]=Q(!0),[g,ce]=Q(!1),[c,ne]=Q(null),[U,se]=Q(null);let $;e[0]!==a?($=a.trim(),e[0]=a,e[1]=$):$=e[1];const z=$===d;let G;e[2]===Symbol.for("react.memo_cache_sentinel")?(G={},e[2]=G):G=e[2];let P;e[3]!==d?(P={live:!0,shardKey:d},e[3]=d,e[4]=P):P=e[4];const n=Fe(he.migrationStatus,G,P),o=n.data?.migrations??null,ae=n.error,{errorSource:le,liveError:oe}=n;let W,J;e[5]!==d||e[6]!==n.data?(W=()=>{n.data!==void 0&&Pe(d)},J=[n.data,d],e[5]=d,e[6]=n.data,e[7]=W,e[8]=J):(W=e[7],J=e[8]),Se(W,J);let V;if(e[9]!==re||e[10]!==p||e[11]!==l||e[12]!==h||e[13]!==a||e[14]!==n||e[15]!==t){const u=async()=>{const ue=h.trim();if(ue===""){se(t("Enter a migration id")),ne(null);return}ce(!0),se(null);try{const de=await re.query(We,{direction:p,dryRun:l,id:ue},ze(a));ne(de),n.refetch()}catch(de){const Ce=de;ne(null),se(Ge(Ce))}ce(!1)};V=()=>{$e(u())},e[9]=re,e[10]=p,e[11]=l,e[12]=h,e[13]=a,e[14]=n,e[15]=t,e[16]=V}else V=e[16];const X=V;let Y;e[17]===Symbol.for("react.memo_cache_sentinel")?(Y=u=>{ge(u.target.value)},e[17]=Y):Y=e[17];const ve=Y;let Z;e[18]===Symbol.for("react.memo_cache_sentinel")?(Z=u=>{ye(u.target.value==="down"?"down":"up")},e[18]=Z):Z=e[18];const xe=Z;let ee;e[19]===Symbol.for("react.memo_cache_sentinel")?(ee=u=>{be(u.target.checked)},e[19]=ee):ee=e[19];const Re=ee;let y;e[20]!==ie||e[21]!==a?(y=r(Te,{onChange:ie,testId:"mg-shard-input",value:a}),e[20]=ie,e[21]=a,e[22]=y):y=e[22];let b;e[23]!==oe?(b=r(Me,{message:oe,prefix:"mg"}),e[23]=oe,e[24]=b):b=e[24];let v;e[25]!==y||e[26]!==b?(v=s("div",{className:"flex flex-wrap items-center gap-2",children:[y,b]}),e[25]=y,e[26]=b,e[27]=v):v=e[27];let x;e[28]!==ae||e[29]!==le?(x=ae!==null&&r(Ee,{error:le,testId:"mg-status-error"}),e[28]=ae,e[29]=le,e[30]=x):x=e[30];let R;e[31]!==o||e[32]!==t?(R=o!==null&&o.length===0&&r(Le,{description:t("Data migrations you run against this shard will be tracked here."),icon:r("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:r("path",{d:"M4 12a8 8 0 0 1 13.7-5.6L20 8M20 4v4h-4M20 12a8 8 0 0 1-13.7 5.6L4 16m0 4v-4h4"})}),testId:"mg-empty",title:t("No migrations have run on this shard.")}),e[31]=o,e[32]=t,e[33]=R):R=e[33];let C;e[34]!==o||e[35]!==t?(C=o!==null&&o.length>0&&r(we,{className:"overflow-hidden py-0",children:r(De,{className:"px-0",children:s(Ae,{"data-testid":"mg-table",children:[r(Ke,{children:s(fe,{children:[r(m,{children:t("id")}),r(m,{children:t("direction")}),r(m,{children:t("status")}),r(m,{children:t("processed")}),r(m,{children:t("changed")}),r(m,{children:t("updated")}),r(m,{children:t("error")})]})}),r(je,{children:o.map(Je)})]})})}),e[34]=o,e[35]=t,e[36]=C):C=e[36];let N;e[37]!==t?(N=t("Run migration"),e[37]=t,e[38]=N):N=e[38];let S;e[39]!==N?(S=r(me,{children:N}),e[39]=N,e[40]=S):S=e[40];let I;e[41]!==t?(I=t("Migration id"),e[41]=t,e[42]=I):I=e[42];let E;e[43]!==t?(E=t("migration id"),e[43]=t,e[44]=E):E=e[44];let M;e[45]!==h||e[46]!==I||e[47]!==E?(M=r(Be,{"aria-label":I,className:"w-auto","data-testid":"mg-id-input",onChange:ve,placeholder:E,value:h}),e[45]=h,e[46]=I,e[47]=E,e[48]=M):M=e[48];let T;e[49]!==t?(T=t("Direction"),e[49]=t,e[50]=T):T=e[50];let _;e[51]!==t?(_=t("up"),e[51]=t,e[52]=_):_=e[52];let k;e[53]!==_?(k=r("option",{value:"up",children:_}),e[53]=_,e[54]=k):k=e[54];let w;e[55]!==t?(w=t("down"),e[55]=t,e[56]=w):w=e[56];let D;e[57]!==w?(D=r("option",{value:"down",children:w}),e[57]=w,e[58]=D):D=e[58];let L;e[59]!==p||e[60]!==T||e[61]!==k||e[62]!==D?(L=s("select",{"aria-label":T,className:"flex h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs transition-colors outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 dark:bg-input/30","data-testid":"mg-direction",onChange:xe,value:p,children:[k,D]}),e[59]=p,e[60]=T,e[61]=k,e[62]=D,e[63]=L):L=e[63];let B;e[64]!==l?(B=r("input",{checked:l,className:"size-4 accent-primary","data-testid":"mg-dry-run",id:"mg-dry-run",onChange:Re,type:"checkbox"}),e[64]=l,e[65]=B):B=e[65];let A;e[66]!==t?(A=t("Dry run"),e[66]=t,e[67]=A):A=e[67];let K;e[68]!==B||e[69]!==A?(K=s(me,{className:"flex items-center gap-1.5",htmlFor:"mg-dry-run",children:[B,A]}),e[68]=B,e[69]=A,e[70]=K):K=e[70];let j;e[71]!==l||e[72]!==X||e[73]!==g||e[74]!==z||e[75]!==t?(j=l?r(ke,{"data-testid":"mg-run",disabled:g||!z,onClick:X,type:"button",children:t(g?"Running…":"Run")}):r(Ie,{confirmLabel:t(g?"Running…":"Run migration?"),disabled:g||!z,onConfirm:X,testId:"mg-run",children:t("Run")}),e[71]=l,e[72]=X,e[73]=g,e[74]=z,e[75]=t,e[76]=j):j=e[76];let F;e[77]!==M||e[78]!==L||e[79]!==K||e[80]!==j?(F=s("div",{className:"flex flex-wrap items-center gap-2",children:[M,L,K,j]}),e[77]=M,e[78]=L,e[79]=K,e[80]=j,e[81]=F):F=e[81];let O;e[82]!==S||e[83]!==F?(O=s("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card p-3 shadow-xs",children:[S,F]}),e[82]=S,e[83]=F,e[84]=O):O=e[84];let q;e[85]!==U?(q=U!==null&&r("pre",{className:"text-sm text-destructive whitespace-pre-wrap","data-testid":"mg-run-error",role:"alert",children:U}),e[85]=U,e[86]=q):q=e[86];let H;e[87]!==c||e[88]!==t?(H=c!==null&&s("p",{className:"text-sm text-muted-foreground","data-testid":"mg-run-result",children:[c.dryRun?t("Dry run: "):"",t("{status} — processed",{status:c.status}),c.processed,t(", changed"),c.changed]}),e[87]=c,e[88]=t,e[89]=H):H=e[89];let te;return e[90]!==v||e[91]!==x||e[92]!==R||e[93]!==C||e[94]!==O||e[95]!==q||e[96]!==H?(te=s("div",{className:"flex flex-col gap-3 pt-4","data-testid":"lunora-migrations",children:[v,x,R,C,O,q,H]}),e[90]=v,e[91]=x,e[92]=R,e[93]=C,e[94]=O,e[95]=q,e[96]=H,e[97]=te):te=e[97],te};function Je(i){return s(fe,{"data-testid":`mg-row-${i.id}`,children:[r(f,{children:i.id}),r(f,{children:i.direction}),r(f,{children:r(_e,{variant:"secondary",children:i.status})}),r(f,{children:i.processed}),r(f,{children:i.changed}),r(f,{children:Qe(i.updatedAt)}),r(f,{children:i.error??""})]},i.id)}export{yt as MigrationsPanel};
|
package/dist/packem_shared/{OpenRpcReferencePanel-E9cDfHRv.mjs → OpenRpcReferencePanel-BFDG91tn.mjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as O}from"react/compiler-runtime";import{E as g}from"./empty-state-D7jEML_T.mjs";import{S as y}from"./skeleton-DX1gfixl.mjs";import{u as R}from"./use-admin-spec-
|
|
1
|
+
import{c as O}from"react/compiler-runtime";import{E as g}from"./empty-state-D7jEML_T.mjs";import{S as y}from"./skeleton-DX1gfixl.mjs";import{u as R}from"./use-admin-spec-CK7mk3Ui.mjs";import{u as S}from"./use-studio-client-DCA50tF2.mjs";import{useT as P}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{R as x}from"./reference-view-DENugPcj.mjs";import{jsxs as h,jsx as l}from"react/jsx-runtime";const k=n=>(n.methods??[]).filter(e=>e["x-lunora-function-kind"]!=="stream"),w=n=>(n.params??[]).find(e=>e.name==="args")??(n.params??[])[0],C=n=>n["x-tags"]?.[0]?.name??(n.name.includes(":")?n.name.slice(0,n.name.indexOf(":")):""),I=n=>{const e=w(n)?.schema;return{argsSchema:e,description:n.description,functionPath:n.name,httpPath:"/_lunora/rpc",key:n.name,kind:n["x-lunora-function-kind"],method:"POST",operationId:n.name,requestSchema:e,responses:[{description:n.result?.name,schema:n.result?.schema,status:"200"}],summary:n.summary??n.name,tags:[C(n)],title:n.summary??n.name}},v=n=>{const e=n??{},m=k(e).map(a=>I(a)),r=new Map;for(const a of m){const i=a.tags[0]??"",s=r.get(i)??[];s.push(a),r.set(i,s)}return{groups:[...r.entries()].map(([a,i])=>({name:a,operations:i.toSorted((s,p)=>s.operationId.localeCompare(p.operationId))})).toSorted((a,i)=>a.name.localeCompare(i.name)),operationByKey:new Map(m.map(a=>[a.key,a])),title:e.info?.title??"API reference",version:e.info?.version}},N=n=>k(n).length===0,b=n=>{const e=n;return N(e)?{kind:"empty"}:{kind:"ready",spec:e}},B=n=>{const e=O(23),{spec:m}=n,r=P(),f=S();let a;e[0]!==f?(a=()=>f.fetchOpenRpc(),e[0]=f,e[1]=a):a=e[1];const s=R(m,a,b);let p;e[2]!==s.kind||e[3]!==s.spec?(p=s.kind==="ready"?v(s.spec):void 0,e[2]=s.kind,e[3]=s.spec,e[4]=p):p=e[4];const u=p;if(s.kind==="loading"){let t;return e[5]===Symbol.for("react.memo_cache_sentinel")?(t=h("div",{className:"flex flex-col gap-4","data-testid":"openrpc-reference-loading",children:[l(y,{className:"h-8 w-48"}),l(y,{className:"h-64 w-full"})]}),e[5]=t):t=e[5],t}if(s.kind==="error"){let t;e[6]!==s.message||e[7]!==r?(t=r("Couldn't load the OpenRPC spec: {message}",{message:s.message}),e[6]=s.message,e[7]=r,e[8]=t):t=e[8];let o;e[9]!==r?(o=r("API reference unavailable"),e[9]=r,e[10]=o):o=e[10];let c;return e[11]!==t||e[12]!==o?(c=l(g,{description:t,testId:"openrpc-reference-error",title:o}),e[11]=t,e[12]=o,e[13]=c):c=e[13],c}if(s.kind==="empty"||u===void 0){let t;e[14]!==r?(t=r("Run `lunora codegen --api-spec openrpc` and wire `_generated/openrpc.json` to the worker to render the OpenRPC reference here."),e[14]=r,e[15]=t):t=e[15];let o;e[16]!==r?(o=r("No OpenRPC spec configured"),e[16]=r,e[17]=o):o=e[17];let c;return e[18]!==t||e[19]!==o?(c=l(g,{description:t,testId:"openrpc-reference-empty",title:o}),e[18]=t,e[19]=o,e[20]=c):c=e[20],c}let d;return e[21]!==u?(d=l(x,{model:u}),e[21]=u,e[22]=d):d=e[22],d};export{B as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as I}from"react/compiler-runtime";import{useState as T,useEffect as $}from"react";import{ConfirmButton as H}from"./ConfirmButton-CIXYF6Mg.mjs";import{C as M,a as P}from"./card-By2O8ULa.mjs";import{E as Q}from"./empty-state-D7jEML_T.mjs";import{T as R,a as q,b as J,c as l,d as D,e as i}from"./table-D0SBiDu-.mjs";import{a as K}from"./use-admin-query-
|
|
1
|
+
import{c as I}from"react/compiler-runtime";import{useState as T,useEffect as $}from"react";import{ConfirmButton as H}from"./ConfirmButton-CIXYF6Mg.mjs";import{C as M,a as P}from"./card-By2O8ULa.mjs";import{E as Q}from"./empty-state-D7jEML_T.mjs";import{T as R,a as q,b as J,c as l,d as D,e as i}from"./table-D0SBiDu-.mjs";import{a as K}from"./use-admin-query-CaOm4JS3.mjs";import{useAutoRefresh as V}from"./DEFAULT_AUTO_REFRESH_MS-Py5Yx7rP.mjs";import{u as W}from"./use-studio-client-DCA50tF2.mjs";import{useT as z}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{f as G,h as O,b as U}from"./internal-hIuTpSbx.mjs";import{jsx as t,jsxs as p}from"react/jsx-runtime";const X=s=>Number.isFinite(s)?O(s,"—"):"—",F=s=>s.toSorted((e,u)=>e.scheduledFor-u.scheduledFor),Y=(s,e,u)=>e!==void 0?e:u===void 0?f=>s.cancelScheduledJob(f):void 0,he=s=>{const e=I(16),{cancelJob:u,loadJobs:f}=s===void 0?{}:s,n=W(),o=z(),c=f===void 0;let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b=["lunora-scheduled-jobs"],e[0]=b):b=e[0];const d=K(b,async()=>{const r=await(f??(()=>n.listScheduledJobs()))();return F(r)}),[j,k]=T(void 0),[A,w]=T(void 0);let v,x;e[1]!==n||e[2]!==c?(v=()=>{if(c)return n.subscribeScheduledJobs(r=>{w(void 0),k(F(r))})},x=[c,n],e[1]=n,e[2]=c,e[3]=v,e[4]=x):(v=e[3],x=e[4]),$(v,x);let y;e[5]!==d?(y=()=>d.poll(),e[5]=d,e[6]=y):y=e[6],V(y,!c);const C=Y(n,u,f),a=j??d.data,N=A??d.error,E=async r=>{if(C!==void 0){w(void 0);try{await C(r),c||d.refetch()}catch(_){w(U(_))}}},L="flex flex-col gap-3",B="lunora-scheduled-jobs";let m;e[7]!==N?(m=N!==null&&t("p",{className:"text-sm text-destructive","data-testid":"sj-error",role:"alert",children:N}),e[7]=N,e[8]=m):m=e[8];let h;e[9]!==a?.length||e[10]!==o?(h=a?.length===0&&t(Q,{description:o("Jobs queued with runAfter / runAt will appear here."),icon:p("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[t("circle",{cx:"12",cy:"12",r:"9"}),t("path",{d:"M12 7.5V12l4 2"})]}),testId:"sj-empty",title:o("No scheduled jobs.")}),e[9]=a?.length,e[10]=o,e[11]=h):h=e[11];const S=a!==void 0&&a.length>0&&t(M,{className:"overflow-hidden py-0",children:t(P,{className:"px-0",children:p(R,{"data-testid":"sj-table",children:[t(q,{children:p(J,{children:[t(l,{children:o("function")}),t(l,{children:o("scheduled for")}),t(l,{children:o("pool")}),t(l,{children:o("attempts")}),t(l,{children:o("shard")}),t(l,{children:o("id")}),C!==void 0&&t(l,{"aria-label":o("Actions")})]})}),t(D,{children:a.map(r=>p(J,{"data-testid":`sj-row-${r.id}`,children:[t(i,{className:"font-mono text-xs",children:r.workflow??r.functionPath}),t(i,{className:"text-muted-foreground tabular-nums",children:X(r.scheduledFor)}),t(i,{className:"font-mono text-xs",children:r.pool??""}),t(i,{className:"tabular-nums",children:r.attempts??0}),t(i,{children:r.shardKey??""}),t(i,{className:"font-mono text-xs",children:r.id}),C!==void 0&&t(i,{className:"text-right",children:t(H,{confirmLabel:o("Cancel job?"),onConfirm:()=>{G(E(r.id))},testId:`sj-cancel-${r.id}`,children:o("Cancel")})})]},r.id))})]})})});let g;return e[12]!==S||e[13]!==m||e[14]!==h?(g=p("div",{className:L,"data-testid":B,children:[m,h,S]}),e[12]=S,e[13]=m,e[14]=h,e[15]=g):g=e[15],g};export{he as ScheduledJobs};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as b}from"./studio-
|
|
1
|
+
import{S as b}from"./studio-UhUrPz5J.mjs";import"./ErrorBoundary-BWNF98VF.mjs";import"./operation-console-provider-DoloEvon.mjs";import"./badge-r_5B4LHP.mjs";import"./input-CXhxesPC.mjs";import"./skeleton-DX1gfixl.mjs";import"./home-panel-CDVTuTF8.mjs";import"./DEFAULT_LOCALE-BQ3jRT74.mjs";import"./StudioI18nProvider-CGXCPnQn.mjs";import"./data-view-params-C-_G-biH.mjs";import"./internal-hIuTpSbx.mjs";import"./utils-bhneXptQ.mjs";import"./CommandPalette-BZCHLpst.mjs";export{b as Studio};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as O}from"react/compiler-runtime";import{LunoraAdminClient as G}from"@lunora/client/admin";import{LunoraProvider as H}from"@lunora/react";import{useState as B,useEffect as $}from"react";import{ErrorBoundary as z}from"./ErrorBoundary-BWNF98VF.mjs";import{u as U,B as V,T as Y,a as q,S as J}from"./studio-
|
|
1
|
+
import{c as O}from"react/compiler-runtime";import{LunoraAdminClient as G}from"@lunora/client/admin";import{LunoraProvider as H}from"@lunora/react";import{useState as B,useEffect as $}from"react";import{ErrorBoundary as z}from"./ErrorBoundary-BWNF98VF.mjs";import{u as U,B as V,T as Y,a as q,S as J}from"./studio-UhUrPz5J.mjs";import Q from"./useDebounced-DVeQ5-oW.mjs";import{useT as j,createStudioI18n as X}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{StudioI18nProvider as D}from"./StudioI18nProvider-CGXCPnQn.mjs";import{r as Z}from"./internal-hIuTpSbx.mjs";import{w as R}from"./recording-client-DAipTA_n.mjs";import F from"./STUDIO_ROOT_CLASS-C6MccdVk.mjs";import{a as K}from"./browser-storage-BH1MxLZs.mjs";import{c as W}from"./utils-bhneXptQ.mjs";import{B as ee}from"./button-q0UYSmrn.mjs";import{I as te}from"./input-CXhxesPC.mjs";import{jsx as f,jsxs as C}from"react/jsx-runtime";const M="lunora-studio-admin-token",oe=()=>{try{return K("session")?.getItem(M)??""}catch{return""}},ne=m=>{const e=K("session");if(e!==void 0)try{m===""?e.removeItem(M):e.setItem(M,m)}catch{}},ie="/_lunora/admin/ws-token",se=1e4,le=m=>{const e=m;return typeof e?.token=="string"&&e.token.length>0&&typeof e.expiresAtMs=="number"},re=m=>{const{adminToken:e,baseUrl:a}=m,o=m.fetchImpl??fetch;let l=a;for(;l.endsWith("/");)l=l.slice(0,-1);const r=`${l}${ie}`;let t,n;const i=async()=>{const s=await o(r,{headers:{authorization:`Bearer ${e}`},method:"POST"});if(!s.ok)throw new Error(`ws-token mint failed: ${String(s.status)}`);const u=await s.json().catch(()=>{});if(!le(u))throw new Error("ws-token mint failed: malformed response body");return t=u,u.token};return{getToken:async()=>t!==void 0&&t.expiresAtMs-se>Date.now()?t.token:(n??=i().finally(()=>{n=void 0}),n),invalidate:()=>{t=void 0}}},ae=m=>{const e=O(42),{onSubmit:a}=m,o=j(),[l,r]=B("");let t;e[0]!==l?(t=l.trim(),e[0]=l,e[1]=t):t=e[1];const n=t;let i;e[2]!==a||e[3]!==n?(i=_=>{_.preventDefault(),n!==""&&a(n)},e[2]=a,e[3]=n,e[4]=i):i=e[4];const s=i;let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=f("div",{className:"h-10 w-10 text-foreground",children:f(V,{})}),e[5]=u):u=e[5];let d;e[6]!==o?(d=o("Connect to Lunora Studio"),e[6]=o,e[7]=d):d=e[7];let v;e[8]!==d?(v=f("h1",{className:"text-base font-semibold text-foreground",children:d}),e[8]=d,e[9]=v):v=e[9];let k;e[10]!==o?(k=o("Enter your admin token to access the studio."),e[10]=o,e[11]=k):k=e[11];let p;e[12]!==k?(p=f("p",{className:"text-[13px] text-muted-foreground",children:k}),e[12]=k,e[13]=p):p=e[13];let h;e[14]!==v||e[15]!==p?(h=C("div",{className:"flex flex-col items-center gap-3 text-center",children:[u,C("div",{className:"flex flex-col gap-1",children:[v,p]})]}),e[14]=v,e[15]=p,e[16]=h):h=e[16];let g;e[17]!==o?(g=o("admin token"),e[17]=o,e[18]=g):g=e[18];let c;e[19]!==g?(c=f("label",{className:"text-xs font-medium text-foreground",htmlFor:"lunora-studio-login-token",children:g}),e[19]=g,e[20]=c):c=e[20];let b;e[21]===Symbol.for("react.memo_cache_sentinel")?(b=_=>{r(_.target.value)},e[21]=b):b=e[21];let x;e[22]!==l?(x=f(te,{autoComplete:"off",autoFocus:!0,"data-testid":"lunora-studio-login-token",id:"lunora-studio-login-token",onChange:b,placeholder:"LUNORA_ADMIN_TOKEN",type:"password",value:l}),e[22]=l,e[23]=x):x=e[23];let T;e[24]!==o?(T=o("From your worker's LUNORA_ADMIN_TOKEN — your project's .dev.vars in dev, or a deployment secret in production."),e[24]=o,e[25]=T):T=e[25];let I;e[26]!==T?(I=f("p",{className:"text-[11px] text-muted-foreground",children:T}),e[26]=T,e[27]=I):I=e[27];let S;e[28]!==c||e[29]!==x||e[30]!==I?(S=C("div",{className:"flex flex-col gap-1.5",children:[c,x,I]}),e[28]=c,e[29]=x,e[30]=I,e[31]=S):S=e[31];const E=n==="";let y;e[32]!==o?(y=o("Connect"),e[32]=o,e[33]=y):y=e[33];let w;e[34]!==E||e[35]!==y?(w=f(ee,{"data-testid":"lunora-studio-login-submit",disabled:E,type:"submit",children:y}),e[34]=E,e[35]=y,e[36]=w):w=e[36];let N;return e[37]!==s||e[38]!==S||e[39]!==w||e[40]!==h?(N=C("form",{className:"flex w-full max-w-sm flex-col gap-5 rounded-xl border border-border bg-card p-7 shadow-lg","data-testid":"lunora-studio-login",onSubmit:s,children:[h,S,w]}),e[37]=s,e[38]=S,e[39]=w,e[40]=h,e[41]=N):N=e[41],N},de=m=>{const e=O(10),{i18n:a,onSubmit:o}=m,{resolvedTheme:l}=U(),r=l==="dark"&&"dark";let t;e[0]!==r?(t=W(F,r,"flex h-dvh items-center justify-center bg-sidebar p-6 text-sm text-foreground"),e[0]=r,e[1]=t):t=e[1];let n;e[2]!==o?(n=f(ae,{onSubmit:o}),e[2]=o,e[3]=n):n=e[3];let i;e[4]!==a||e[5]!==n?(i=f(D,{i18n:a,children:n}),e[4]=a,e[5]=n,e[6]=i):i=e[6];let s;return e[7]!==t||e[8]!==i?(s=f("div",{className:t,"data-testid":"lunora-studio-login-root",children:i}),e[7]=t,e[8]=i,e[9]=s):s=e[9],s},ce=m=>{const e=O(15),{basePath:a,chrome:o,studio:l}=m,r=j();let t;e[0]!==r?(t=r("Studio failed"),e[0]=r,e[1]=t):t=e[1];let n;e[2]!==r?(n=r("Studio"),e[2]=r,e[3]=n):n=e[3];let i;e[4]!==r?(i=r("Try again"),e[4]=r,e[5]=i):i=e[5];let s;e[6]!==a||e[7]!==o||e[8]!==l?(s=f(J,{...l,basePath:a,chrome:o}),e[6]=a,e[7]=o,e[8]=l,e[9]=s):s=e[9];let u;return e[10]!==t||e[11]!==n||e[12]!==i||e[13]!==s?(u=f(z,{fallbackTitle:t,label:n,retryLabel:i,children:s}),e[10]=t,e[11]=n,e[12]=i,e[13]=s,e[14]=u):u=e[14],u},fe=m=>{const e=O(20),{basePath:a,clearToken:o,client:l,i18n:r,onTokenChange:t,rulesInstalled:n,studio:i,token:s}=m,{resolvedTheme:u}=U();let d;e[0]!==o||e[1]!==t||e[2]!==n||e[3]!==s?(d={clearToken:o,onTokenChange:t,rulesInstalled:n,token:s},e[0]=o,e[1]=t,e[2]=n,e[3]=s,e[4]=d):d=e[4];const v=d,k=u==="dark"&&"dark";let p;e[5]!==k?(p=W(F,k,"flex h-dvh flex-col overflow-hidden bg-sidebar text-sm text-foreground"),e[5]=k,e[6]=p):p=e[6];let h;e[7]!==a||e[8]!==v||e[9]!==i?(h=f(q,{children:f(ce,{basePath:a,chrome:v,studio:i})}),e[7]=a,e[8]=v,e[9]=i,e[10]=h):h=e[10];let g;e[11]!==r||e[12]!==h?(g=f(D,{i18n:r,children:h}),e[11]=r,e[12]=h,e[13]=g):g=e[13];let c;e[14]!==l||e[15]!==g?(c=f(H,{client:l,children:g}),e[14]=l,e[15]=g,e[16]=c):c=e[16];let b;return e[17]!==p||e[18]!==c?(b=f("div",{className:p,"data-testid":"lunora-studio-app",children:c}),e[17]=p,e[18]=c,e[19]=b):b=e[19],b},Ee=m=>{const e=O(28);let a;e[0]!==m?(a=m===void 0?{}:m,e[0]=m,e[1]=a):a=e[1];const{adminToken:o,basePath:l,baseUrl:r,client:t,rulesInstalled:n,studio:i,locale:s}=a;let u;e[2]!==o?(u=()=>o??oe(),e[2]=o,e[3]=u):u=e[3];const[d,v]=B(u);let k,p;e[4]!==d?(k=()=>{ne(d)},p=[d],e[4]=d,e[5]=k,e[6]=p):(k=e[5],p=e[6]),$(k,p);const h=Q(d,300,d==="");let g;e:{if(t!==void 0){let A;e[7]!==t?(A=R(t),e[7]=t,e[8]=A):A=e[8],g=A;break e}let _;if(e[9]!==r||e[10]!==h){const A=Z(r),P=h===""?void 0:re({adminToken:h,baseUrl:A}),L=new G({url:A,...P===void 0?{}:{wsTicket:P.getToken}});P!==void 0&&(L.setAuthToken(h),L.onTokenExpired(P.invalidate)),_=R(L),e[9]=r,e[10]=h,e[11]=_}else _=e[11];g=_}const c=g;let b,x;e[12]!==c||e[13]!==t?(b=()=>()=>{t===void 0&&c.close()},x=[c,t],e[12]=c,e[13]=t,e[14]=b,e[15]=x):(b=e[14],x=e[15]),$(b,x);let T;e[16]===Symbol.for("react.memo_cache_sentinel")?(T=_=>{v(_.target.value)},e[16]=T):T=e[16];const I=T;let S;e[17]===Symbol.for("react.memo_cache_sentinel")?(S=()=>{v("")},e[17]=S):S=e[17];const E=S;let y;e[18]!==s?(y=X(s),e[18]=s,e[19]=y):y=e[19];const w=y;let N;return e[20]!==l||e[21]!==c||e[22]!==w||e[23]!==t||e[24]!==n||e[25]!==i||e[26]!==d?(N=f(Y,{children:d===""&&t===void 0?f(de,{i18n:w,onSubmit:v}):f(fe,{basePath:l,clearToken:E,client:c,i18n:w,onTokenChange:I,rulesInstalled:n,studio:i,token:d})}),e[20]=l,e[21]=c,e[22]=w,e[23]=t,e[24]=n,e[25]=i,e[26]=d,e[27]=N):N=e[27],N};export{Ee as StudioApp};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useState as g}from"react";import{E as x}from"./error-alert-
|
|
1
|
+
import{useState as g}from"react";import{E as x}from"./error-alert-C0R39DO1.mjs";import{C as N,a as y}from"./card-By2O8ULa.mjs";import{T as v,a as T,b as d,c as m,d as w,e as l}from"./table-D0SBiDu-.mjs";import{useT as E}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{c as L}from"./utils-bhneXptQ.mjs";import{jsxs as o,jsx as t}from"react/jsx-runtime";const C={ERROR:"error",INFO:"info",WARN:"warning"},z=e=>{const a=typeof e.metadata.table=="string"?e.metadata.table:void 0;return{description:`${e.detail} ${e.remediation}`,entity:a,issueType:e.title,key:e.cacheKey,level:C[e.level]}},R=["error","warning","info"],A={error:"bg-destructive",info:"bg-info",warning:"bg-warning"},$=(e,a)=>({error:e("Errors"),info:e("Info"),warning:e("Warnings")})[a],k=(e,a,n)=>({error:e("{count} errors",{count:n}),info:e("{count} suggestions",{count:n}),warning:e("{count} warnings",{count:n})})[a],V=(e,a)=>({error:e("No errors detected"),info:e("No suggestions"),warning:e("No warnings detected")})[a],O=e=>{const a={error:0,info:0,warning:0};for(const n of e??[])a[n.level]+=1;return a},F=({error:e=null,errorSource:a,rows:n,testId:i,toolbar:p})=>{const s=E(),[c,f]=g("error"),b=O(n),u=(n??[]).filter(r=>r.level===c),h=r=>{f(r.currentTarget.dataset.level)};return o("div",{className:"flex flex-col gap-3","data-testid":i,children:[t("div",{className:"flex border-b border-border",role:"tablist",children:R.map(r=>o("button",{"aria-selected":c===r,className:"flex min-w-32 flex-col gap-0.5 border-b-2 border-transparent px-4 py-2 text-start outline-none transition-colors hover:bg-muted/40 focus-visible:bg-muted/40 aria-selected:border-foreground","data-level":r,"data-testid":`${i}-tab-${r}`,onClick:h,role:"tab",type:"button",children:[o("span",{className:"flex items-center gap-2 text-sm font-medium text-foreground",children:[t("span",{"aria-hidden":"true",className:L("size-2 rounded-sm",A[r])}),$(s,r)]}),t("span",{className:"ps-4 text-xs text-muted-foreground",children:k(s,r,b[r])})]},r))}),p!==void 0&&t("div",{className:"flex flex-wrap items-center gap-2",children:p}),e!==null&&t(x,{error:a??e,testId:`${i}-error`}),t(N,{className:"overflow-hidden py-0",children:t(y,{className:"px-0",children:o(v,{children:[t(T,{children:o(d,{children:[t(m,{children:s("Issue type")}),t(m,{children:s("Entity/item")}),t(m,{children:s("Description")})]})}),t(w,{children:u.length===0?t(d,{children:o(l,{className:"h-40 text-center align-middle text-muted-foreground",colSpan:3,"data-testid":`${i}-empty`,children:[t("span",{className:"block text-sm font-medium text-foreground",children:V(s,c)}),t("span",{className:"block text-sm",children:s("Nothing to report for this deployment.")})]})}):u.map(r=>o(d,{children:[t(l,{className:"font-medium text-foreground",children:r.issueType}),t(l,{className:"font-mono text-xs text-muted-foreground",children:r.entity??"—"}),o(l,{className:"text-muted-foreground",children:[t("span",{children:r.description}),r.action!==void 0&&t("span",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:r.action})]})]},r.key))})]})})})]})};export{F as A,z as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as x}from"react/compiler-runtime";import{useT as w}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{l as y}from"./internal-
|
|
1
|
+
import{c as x}from"react/compiler-runtime";import{useT as w}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{l as y}from"./internal-hIuTpSbx.mjs";import{jsx as i,jsxs as u}from"react/jsx-runtime";const N=(l,e)=>{if(e==="")return[{match:!1,offset:0,text:l}];const a=[],s=l.toLowerCase(),o=e.toLowerCase();let t=0;for(let r=s.indexOf(o);r!==-1;r=s.indexOf(o,t))r>t&&a.push({match:!1,offset:t,text:l.slice(t,r)}),a.push({match:!0,offset:r,text:l.slice(r,r+e.length)}),t=r+e.length;return t<l.length&&a.push({match:!1,offset:t,text:l.slice(t)}),a},v=l=>{const e=x(9),{highlight:a,value:s}=l;if(s==null){let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=i("span",{className:"text-muted-foreground/50 italic",children:"NULL"}),e[0]=n):n=e[0],n}let o,t,r;if(e[1]!==a||e[2]!==s){r=Symbol.for("react.early_return_sentinel");e:{const n=y(s);if(a===void 0||a===""){r=i("span",{title:n,children:n});break e}o=n,t=N(n,a).map(_)}e[1]=a,e[2]=s,e[3]=o,e[4]=t,e[5]=r}else o=e[3],t=e[4],r=e[5];if(r!==Symbol.for("react.early_return_sentinel"))return r;let d;return e[6]!==o||e[7]!==t?(d=i("span",{title:o,children:t}),e[6]=o,e[7]=t,e[8]=d):d=e[8],d},T=l=>{const e=x(22),{columns:a,rows:s}=l,o=w();let t;e[0]!==o?(t=o("Field"),e[0]=o,e[1]=t):t=e[1];let r;e[2]!==t?(r=i("th",{className:"border-b border-e border-border px-3 py-1.5 text-start font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:t}),e[2]=t,e[3]=r):r=e[3];let d;if(e[4]!==s||e[5]!==o){let c;e[7]!==o?(c=(b,p)=>i("th",{className:"border-b border-border px-3 py-1.5 text-start font-mono text-[11px] tracking-wide uppercase tabular-nums text-muted-foreground",children:o("Row {n}",{n:p+1})},p),e[7]=o,e[8]=c):c=e[8],d=s.map(c),e[4]=s,e[5]=o,e[6]=d}else d=e[6];let n;e[9]!==r||e[10]!==d?(n=i("thead",{className:"sticky top-0 z-10 bg-muted",children:u("tr",{children:[r,d]})}),e[9]=r,e[10]=d,e[11]=n):n=e[11];let f;if(e[12]!==a||e[13]!==s){let c;e[15]!==s?(c=b=>u("tr",{className:"hover:bg-muted/40",children:[i("th",{className:"border-b border-e border-border px-3 py-1.5 text-start font-mono font-medium whitespace-nowrap",scope:"row",children:b}),s.map((p,g)=>i("td",{className:"max-w-md truncate border-b border-border px-3 py-1.5 font-mono",children:i(v,{value:p[b]})},g))]},b),e[15]=s,e[16]=c):c=e[16],f=a.map(c),e[12]=a,e[13]=s,e[14]=f}else f=e[14];let m;e[17]!==f?(m=i("tbody",{children:f}),e[17]=f,e[18]=m):m=e[18];let h;return e[19]!==n||e[20]!==m?(h=i("div",{className:"min-h-0 flex-1 overflow-auto","data-testid":"db-transposed",children:u("table",{className:"border-collapse text-xs",children:[n,m]})}),e[19]=n,e[20]=m,e[21]=h):h=e[21],h},j=({children:l,layout:e="card",testId:a})=>i("div",{className:e==="fill"?"flex min-h-0 flex-1 flex-col overflow-hidden border-t border-border":"overflow-x-auto border border-border bg-card","data-testid":a,children:l});function _(l){return i("mark",{className:l.match?"rounded-sm bg-warning/40 text-foreground":"bg-transparent text-inherit",children:l.text},l.offset)}export{v as C,j as G,T};
|
package/dist/packem_shared/{diagram-export-panel-aBDQdX4e.mjs → diagram-export-panel-Vdt-DZnO.mjs}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{Download01Icon as k}from"@hugeicons/core-free-icons";import{HugeiconsIcon as j}from"@hugeicons/react";import{getNodesBounds as N,getViewportForBounds as A,useNodes as L,useReactFlow as O,Panel as R}from"@xyflow/react";import{useState as x}from"react";import{LunoraError as U}from"@lunora/errors";import{toBlob as C,toSvg as M}from"html-to-image";import{useT as _}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{f as w,b as G}from"./internal-
|
|
2
|
+
import{Download01Icon as k}from"@hugeicons/core-free-icons";import{HugeiconsIcon as j}from"@hugeicons/react";import{getNodesBounds as N,getViewportForBounds as A,useNodes as L,useReactFlow as O,Panel as R}from"@xyflow/react";import{useState as x}from"react";import{LunoraError as U}from"@lunora/errors";import{toBlob as C,toSvg as M}from"html-to-image";import{useT as _}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{f as w,b as G}from"./internal-hIuTpSbx.mjs";import{d as I,D as F,c as H,b as f}from"./dropdown-menu-jLZenfWH.mjs";import{jsxs as p,jsx as g}from"react/jsx-runtime";const c=1920,m=1080,y=32,h=(e,r)=>{const o=globalThis.document.createElement("a");o.href=e,o.download=r,globalThis.document.body.append(o),o.click(),o.remove()},J=(e,r,o="schema-diagram.json")=>{const n={edges:r,exportedAt:new Date().toISOString(),nodes:e},s=JSON.stringify(n,void 0,2),a=globalThis.URL.createObjectURL(new globalThis.Blob([s],{type:"application/json"}));h(a,o),globalThis.setTimeout(()=>{globalThis.URL.revokeObjectURL(a)},0)},v=(e,r,o,n)=>{const s=N(e),{x:a,y:i,zoom:t}=A(s,r,o,.1,2,n);return{transform:[a,i,t],zoom:t}},P=async(e,r,o="schema-diagram.png")=>{const{transform:n}=v(r,c,m,y),[s,a,i]=n,t=await C(e,{backgroundColor:"#ffffff",height:m,style:{transform:`translate(${s.toString()}px, ${a.toString()}px) scale(${i.toString()})`,transformOrigin:"top left",width:`${c.toString()}px`},width:c});if(t===null)throw new U("INTERNAL","html-to-image produced no blob");const d=globalThis.URL.createObjectURL(t);h(d,o),globalThis.setTimeout(()=>{globalThis.URL.revokeObjectURL(d)},0)},q=async(e,r,o="schema-diagram.svg")=>{const{transform:n}=v(r,c,m,y),[s,a,i]=n,t=await M(e,{backgroundColor:"#ffffff",height:m,style:{transform:`translate(${s.toString()}px, ${a.toString()}px) scale(${i.toString()})`,transformOrigin:"top left",width:`${c.toString()}px`},width:c});h(t,o)},to=({containerRef:e,filenameBase:r,testIdPrefix:o})=>{const n=_(),s=L(),{getEdges:a}=O(),[i,t]=x(null),[d,u]=x(null),b=l=>{u(n("Export failed: {message}",{message:G(l)}))},S=async()=>{const l=e.current?.querySelector(".react-flow__viewport");if(l){t("png");try{await P(l,s,`${r}.png`)}finally{t(null)}}},E=async()=>{const l=e.current?.querySelector(".react-flow__viewport");if(l){t("svg");try{await q(l,s,`${r}.svg`)}finally{t(null)}}},D=()=>{t("json");try{J(s,a(),`${r}.json`)}finally{t(null)}},T=()=>{u(null),w(S(),b)},$=()=>{u(null),w(E(),b)};return p(R,{position:"top-right",children:[p(I,{children:[p(F,{className:"group/button inline-flex shrink-0 cursor-pointer items-center justify-center gap-1 rounded-md border border-border bg-background px-2 text-xs font-medium whitespace-nowrap hover:bg-muted disabled:pointer-events-none disabled:opacity-50","data-testid":`${o}-export-trigger`,disabled:i!==null,children:[g(j,{className:"size-3.5",icon:k,strokeWidth:2}),n("Export")]}),p(H,{align:"end",children:[g(f,{"data-testid":`${o}-export-png`,disabled:i!==null,onClick:T,children:n("PNG")}),g(f,{"data-testid":`${o}-export-svg`,disabled:i!==null,onClick:$,children:n("SVG")}),g(f,{"data-testid":`${o}-export-json`,disabled:i!==null,onClick:D,children:n("JSON")})]})]}),d!==null&&g("p",{className:"mt-1 max-w-64 text-right text-xs text-destructive","data-testid":`${o}-export-error`,role:"alert",children:d})]})};export{to as D};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as O}from"react/compiler-runtime";import{flattenHint as j}from"@lunora/errors";import{useT as q}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{e as E,a as H,b as S}from"./internal-
|
|
1
|
+
import{c as O}from"react/compiler-runtime";import{flattenHint as j}from"@lunora/errors";import{useT as q}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{e as E,a as H,b as S}from"./internal-hIuTpSbx.mjs";import{o as T}from"./recording-client-DAipTA_n.mjs";import{u as U}from"./operation-console-provider-DoloEvon.mjs";import{A as V}from"./alert-PB5W11MM.mjs";import{jsx as h,jsxs as D}from"react/jsx-runtime";const K=I=>{const e=O(42),{className:N,error:t,testId:g}=I,C=q(),o=U();let i,s,n,a,c,m,r,l,f;if(e[0]!==N||e[1]!==t||e[2]!==o||e[3]!==g){const A=E(t);let b;e[13]!==t?(b=H(t),e[13]=t,e[14]=b):b=e[14],s=b;let w;e[15]!==t?(w=T(t),e[15]=t,e[16]=w):w=e[16];const k=w,v=t?.why;let y;e[17]!==o||e[18]!==k?(y=()=>{o?.openConsole({errorsOnly:!0,seq:k})},e[17]=o,e[18]=k,e[19]=y):y=e[19],n=y,i=V,a=N,c=g,m="destructive";let d;e[20]!==t?(d=S(t),e[20]=t,e[21]=d):d=e[21],e[22]!==d?(r=h("p",{className:"font-medium",children:d}),e[22]=d,e[23]=r):r=e[23],e[24]!==v?(l=typeof v=="string"?h("p",{className:"mt-1 text-xs opacity-90",children:v}):null,e[24]=v,e[25]=l):l=e[25],f=A===void 0?null:h("p",{className:"mt-1 whitespace-pre-wrap text-xs opacity-90",children:j(A)}),e[0]=N,e[1]=t,e[2]=o,e[3]=g,e[4]=i,e[5]=s,e[6]=n,e[7]=a,e[8]=c,e[9]=m,e[10]=r,e[11]=l,e[12]=f}else i=e[4],s=e[5],n=e[6],a=e[7],c=e[8],m=e[9],r=e[10],l=e[11],f=e[12];let p;e[26]!==s?(p=s===void 0?null:h("a",{"aria-label":"View documentation for this error",className:"mt-1 inline-block text-xs underline",href:s,rel:"noreferrer",target:"_blank",children:"View error docs"}),e[26]=s,e[27]=p):p=e[27];let u;e[28]!==o||e[29]!==n||e[30]!==C?(u=o===void 0?null:h("button",{className:"mt-1 block text-xs underline outline-none focus-visible:ring-1 focus-visible:ring-ring","data-testid":"error-show-in-console",onClick:n,type:"button",children:C("Show in console")}),e[28]=o,e[29]=n,e[30]=C,e[31]=u):u=e[31];let x;return e[32]!==i||e[33]!==a||e[34]!==c||e[35]!==m||e[36]!==r||e[37]!==l||e[38]!==f||e[39]!==p||e[40]!==u?(x=D(i,{className:a,testId:c,variant:m,children:[r,l,f,p,u]}),e[32]=i,e[33]=a,e[34]=c,e[35]=m,e[36]=r,e[37]=l,e[38]=f,e[39]=p,e[40]=u,e[41]=x):x=e[41],x};export{K as E};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as v}from"react/compiler-runtime";import{useState as A,useEffect as Y}from"react";import{ConfirmButton as z}from"./ConfirmButton-CIXYF6Mg.mjs";import{D as Q,a as I,b as O,c as H,d as P,e as V,f as U,g as F}from"./dropdown-menu-jLZenfWH.mjs";import{M as X}from"./modal-shell-CDztwLnv.mjs";import{useT as E}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{l as B,g as Z,k as W,f as ee}from"./internal-
|
|
1
|
+
import{c as v}from"react/compiler-runtime";import{useState as A,useEffect as Y}from"react";import{ConfirmButton as z}from"./ConfirmButton-CIXYF6Mg.mjs";import{D as Q,a as I,b as O,c as H,d as P,e as V,f as U,g as F}from"./dropdown-menu-jLZenfWH.mjs";import{M as X}from"./modal-shell-CDztwLnv.mjs";import{useT as E}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{l as B,g as Z,k as W,f as ee}from"./internal-hIuTpSbx.mjs";import{C as L}from"./control-button-BOZ5K-FC.mjs";import{jsx as m,jsxs as j}from"react/jsx-runtime";const q=l=>`"${l.replaceAll('"','""')}"`,te=/["\n\r,]/u,le=/^[=+\-@\t\r]/u,J=l=>{if(l==null)return"";let e;return typeof l=="string"?e=le.test(l)?` ${l}`:l:typeof l=="number"||typeof l=="boolean"||typeof l=="bigint"?e=String(l):e=B(l),te.test(e)?`"${e.replaceAll('"','""')}"`:e},ne=(l,e)=>{const n=l.map(t=>J(t)).join(","),o=e.map(t=>l.map(c=>J(t[c])).join(","));return[n,...o].join(`
|
|
2
2
|
`)},oe=l=>JSON.stringify(l,W,2),G=500,K=l=>l==null?"NULL":typeof l=="number"?Number.isFinite(l)?String(l):"NULL":typeof l=="bigint"?String(l):typeof l=="boolean"?l?"1":"0":`'${(typeof l=="string"?l:B(l)).replaceAll("'","''")}'`,D="__doc__",se=(l,e,n,o)=>{if(e.length===0||n.length===0)return"";const t=o?.includes(D)===!0&&!e.includes(D)?e.filter(a=>!o.includes(a)):void 0,c=t===void 0?e:o,i=(a,u)=>K(t===void 0||u!==D?a[u]:JSON.stringify(Object.fromEntries(t.map(f=>[f,a[f]])),W)),s=c.map(a=>q(a)).join(", "),r=[];for(let a=0;a<n.length;a+=G){const u=n.slice(a,a+G).map(f=>` (${c.map(d=>i(f,d)).join(", ")})`).join(`,
|
|
3
3
|
`);r.push(`INSERT INTO ${q(l)} (${s}) VALUES
|
|
4
4
|
${u};`)}return r.join(`
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{c as _}from"react/compiler-runtime";import{useNavigate as Xe}from"@tanstack/react-router";import{B as et}from"./badge-r_5B4LHP.mjs";import{C as P,a as tt}from"./card-By2O8ULa.mjs";import{E as nt}from"./empty-state-D7jEML_T.mjs";import{u as ve}from"./use-admin-query-
|
|
1
|
+
import{c as _}from"react/compiler-runtime";import{useNavigate as Xe}from"@tanstack/react-router";import{B as et}from"./badge-r_5B4LHP.mjs";import{C as P,a as tt}from"./card-By2O8ULa.mjs";import{E as nt}from"./empty-state-D7jEML_T.mjs";import{u as ve}from"./use-admin-query-CaOm4JS3.mjs";import{useT as T}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{ADMIN_FUNCTIONS as ye}from"./ADMIN_FUNCTIONS-4aGsMs95.mjs";import{c as lt,f as Ne,d as at,w as rt,g as ot,n as it}from"./internal-hIuTpSbx.mjs";import{c as st}from"./utils-bhneXptQ.mjs";import{deriveInsights as ct}from"./DEFAULT_INSIGHT_THRESHOLDS-D5YMT0gM.mjs";import{useState as Ue,useEffect as qe}from"react";import{u as Ke}from"./use-studio-client-DCA50tF2.mjs";import{jsx as a,jsxs as h}from"react/jsx-runtime";import{B as He}from"./button-q0UYSmrn.mjs";const dt=lt(ye.studioFeatures),We={analytics:!0,auth:!0,containers:!0,flags:!0,kv:!0,mail:!0,notifications:!0,payments:!0,privacy:!0,queues:!0,scheduler:!0,storage:!0,vectors:!0,workflows:!0},ut=t=>{if(t===null||typeof t!="object")return;const{id:e,name:n,unsupported:s}=t;if(!(typeof e!="string"||typeof n!="string"||!Array.isArray(s)))return{id:e,name:n,unsupported:s.filter(l=>typeof l=="string")}},mt=t=>{if(t===null||typeof t!="object")return We;const e=t,n=s=>typeof e[s]=="boolean"?e[s]:!0;return{analytics:n("analytics"),auth:n("auth"),containers:n("containers"),flags:n("flags"),kv:n("kv"),mail:n("mail"),notifications:n("notifications"),payments:n("payments"),privacy:n("privacy"),platform:ut(e.platform),queues:n("queues"),scheduler:n("scheduler"),storage:n("storage"),vectors:n("vectors"),workflows:n("workflows")}},ft={...We,settled:!1},pt=()=>{const t=_(3),e=Ke(),[n,s]=Ue(void 0);let l,r;return t[0]!==e?(l=()=>{const i=new AbortController;return Ne((async()=>{let o;try{o={...mt(await e.query(dt,{},at(""))),settled:!0}}catch{o={...We,settled:!0}}i.signal.aborted||s({client:e,features:o})})()),()=>{i.abort()}},r=[e],t[0]=e,t[1]=l,t[2]=r):(l=t[1],r=t[2]),qe(l,r),n?.client===e?n.features:ft},ht=()=>{const t=_(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeWidth:1.6,viewBox:"0 0 24 24",children:a("path",{d:"m9 6 6 6-6 6",strokeLinecap:"round",strokeLinejoin:"round"})}),t[0]=e):e=t[0],e},gt=t=>{const e=_(24),{group:n}=t,s=T(),l=Xe();let r;e[0]!==n.tab||e[1]!==l?(r=()=>{Ne(l({to:`/${n.tab}`}))},e[0]=n.tab,e[1]=l,e[2]=r):r=e[2];const i=r,o=n.bindings.length;let c;e[3]!==n.label?(c=a("span",{className:"text-sm font-medium text-foreground",children:n.label}),e[3]=n.label,e[4]=c):c=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=a(ht,{}),e[5]=u):u=e[5];let m;e[6]!==c?(m=h("div",{className:"flex items-center justify-between",children:[c,u]}),e[6]=c,e[7]=m):m=e[7];let d;e[8]!==o||e[9]!==s?(d=o===1?s("1 binding"):s("{count} bindings",{count:o}),e[8]=o,e[9]=s,e[10]=d):d=e[10];let f;e[11]!==d?(f=a("span",{className:"text-xs text-muted-foreground",children:d}),e[11]=d,e[12]=f):f=e[12];let p;e[13]!==o||e[14]!==n.bindings?(p=o>0&&a("div",{className:"flex flex-wrap gap-1.5",children:n.bindings.map(yt)}),e[13]=o,e[14]=n.bindings,e[15]=p):p=e[15];let g;e[16]!==m||e[17]!==f||e[18]!==p?(g=h(tt,{className:"flex flex-col gap-2 py-4",children:[m,f,p]}),e[16]=m,e[17]=f,e[18]=p,e[19]=g):g=e[19];let x;return e[20]!==n.testId||e[21]!==i||e[22]!==g?(x=a(P,{className:"cursor-pointer gap-0 py-0 transition-colors hover:bg-muted/40","data-testid":n.testId,onClick:i,children:g}),e[20]=n.testId,e[21]=i,e[22]=g,e[23]=x):x=e[23],x},Ve=["kv","files","vectors"],xt=(t,e)=>[...t.filter(n=>n.tab!==e.tab),e].toSorted((n,s)=>Ve.indexOf(n.tab)-Ve.indexOf(s.tab)),bt=()=>{const t=_(19),e=Ke(),n=pt(),s=T();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=[],t[0]=l):l=t[0];const[r,i]=Ue(l);let o,c;if(t[1]!==e||t[2]!==n.kv||t[3]!==n.storage||t[4]!==n.vectors||t[5]!==s?(o=()=>{const g={cancelled:!1},x=[{enabled:n.kv,label:s("KV Namespaces"),load:async()=>(await e.listKvNamespaces()).map(vt),tab:"kv",testId:"home-binding-kv"},{enabled:n.storage,label:s("R2 Buckets"),load:()=>e.listStorageBuckets(),tab:"files",testId:"home-binding-r2"},{enabled:n.vectors,label:s("Vectorize Indexes"),load:async()=>(await e.listVectorIndexes()).map(Nt),tab:"vectors",testId:"home-binding-vectors"}];for(const b of x)b.enabled&&Ne((async()=>{try{const v=await b.load();if(!g.cancelled){const S={bindings:v,label:b.label,tab:b.tab,testId:b.testId};i(w=>xt(w,S))}}catch{}})());return()=>{g.cancelled=!0}},c=[e,n.kv,n.storage,n.vectors,s],t[1]=e,t[2]=n.kv,t[3]=n.storage,t[4]=n.vectors,t[5]=s,t[6]=o,t[7]=c):(o=t[6],c=t[7]),qe(o,c),r.length===0)return null;let u;t[8]!==s?(u=s("Bindings"),t[8]=s,t[9]=u):u=t[9];let m;t[10]!==u?(m=a("h2",{className:"text-sm font-semibold tracking-tight text-foreground",children:u}),t[10]=u,t[11]=m):m=t[11];let d;t[12]!==r?(d=r.map(_t),t[12]=r,t[13]=d):d=t[13];let f;t[14]!==d?(f=a("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:d}),t[14]=d,t[15]=f):f=t[15];let p;return t[16]!==m||t[17]!==f?(p=h("section",{className:"flex flex-col gap-3","data-testid":"home-bindings",children:[m,f]}),t[16]=m,t[17]=f,t[18]=p):p=t[18],p};function yt(t){return a(et,{variant:"secondary",children:t},t)}function vt(t){return t.binding}function Nt(t){return t.name}function _t(t){return a(gt,{group:t},t.tab)}const St=[{name:"lunora_list_functions",summary:"list every query, mutation, and action with its path"},{name:"lunora_list_tables",summary:"list the schema's tables"},{name:"lunora_get_function_schema",summary:"read a function's argument JSON Schema before calling it"},{name:"lunora_run_query",summary:"run a read-only query"},{name:"lunora_run_mutation",summary:"run a mutation — writes; only when LUNORA_MCP_ALLOW_WRITES is set"},{name:"lunora_run_action",summary:"run an action — writes/effects; only when LUNORA_MCP_ALLOW_WRITES is set"}],wt=t=>JSON.stringify({mcpServers:{lunora:{args:["-y","@lunora/mcp"],command:"npx",env:{LUNORA_ADMIN_TOKEN:"<your-admin-token>",LUNORA_URL:t}}}},null,2),kt=t=>{const e=St.map(n=>`- ${n.name} — ${n.summary}`).join(`
|
|
2
2
|
`);return[`You have a Lunora MCP server connected to the deployment at ${t}.`,"It exposes this backend's functions and schema so you can inspect and operate it:",e,"",`Start by calling lunora_list_functions and lunora_list_tables to learn what exists, then lunora_get_function_schema before any run call. The full HTTP API is also documented at ${t}/_lunora/admin/openapi (that endpoint needs the same admin token the MCP server is configured with).`].join(`
|
|
3
3
|
`)},Ct=1500,At=()=>{const t=_(40),e=T(),{url:n}=Ke();let s;t[0]!==n?(s=rt(n),t[0]=n,t[1]=s):s=t[1];const l=s,[r,i]=Ue(null);let o,c;t[2]!==r?(o=()=>{if(r===null)return;const I=globalThis.setTimeout(()=>{i(null)},Ct);return()=>{globalThis.clearTimeout(I)}},c=[r],t[2]=r,t[3]=o,t[4]=c):(o=t[3],c=t[4]),qe(o,c);let u;t[5]===Symbol.for("react.memo_cache_sentinel")?(u=(I,L)=>{ot(L)&&i(I)},t[5]=u):u=t[5];const m=u;let d;t[6]!==l?(d=()=>{m("config",wt(l))},t[6]=l,t[7]=d):d=t[7];const f=d;let p;t[8]!==l?(p=()=>{m("prompt",kt(l))},t[8]=l,t[9]=p):p=t[9];const g=p;let x;t[10]!==e?(x=e("Connect an AI agent"),t[10]=e,t[11]=x):x=t[11];let b;t[12]!==x?(b=a("span",{className:"text-sm font-medium text-foreground",children:x}),t[12]=x,t[13]=b):b=t[13];let v;t[14]!==e?(v=e("Drive this deployment from an AI agent over the Model Context Protocol — it can list functions and tables, read schemas, and run read-only queries. Writes stay off unless you opt in."),t[14]=e,t[15]=v):v=t[15];let S;t[16]!==v?(S=a("span",{className:"text-xs text-muted-foreground",children:v}),t[16]=v,t[17]=S):S=t[17];let w;t[18]!==b||t[19]!==S?(w=h("div",{className:"flex flex-col gap-1.5 p-4",children:[b,S]}),t[18]=b,t[19]=S,t[20]=w):w=t[20];let $;t[21]===Symbol.for("react.memo_cache_sentinel")?($=a("code",{className:"font-mono text-xs text-muted-foreground","data-testid":"home-connect-agent-command",children:"npx -y @lunora/mcp"}),t[21]=$):$=t[21];let y;t[22]!==r||t[23]!==e?(y=e(r==="config"?"Copied":"Copy MCP config"),t[22]=r,t[23]=e,t[24]=y):y=t[24];let k;t[25]!==f||t[26]!==y?(k=a(He,{"data-testid":"home-connect-agent-copy-config",onClick:f,size:"xs",variant:"outline",children:y}),t[25]=f,t[26]=y,t[27]=k):k=t[27];let C;t[28]!==r||t[29]!==e?(C=e(r==="prompt"?"Copied":"Copy agent prompt"),t[28]=r,t[29]=e,t[30]=C):C=t[30];let A;t[31]!==g||t[32]!==C?(A=a(He,{"data-testid":"home-connect-agent-copy-prompt",onClick:g,size:"xs",variant:"outline",children:C}),t[31]=g,t[32]=C,t[33]=A):A=t[33];let N;t[34]!==k||t[35]!==A?(N=h("div",{className:"flex flex-col gap-3 border-t border-border bg-muted/50 px-4 py-3",children:[$,h("div",{className:"flex flex-wrap gap-2",children:[k,A]})]}),t[34]=k,t[35]=A,t[36]=N):N=t[36];let M;return t[37]!==w||t[38]!==N?(M=h(P,{className:"gap-0 py-0","data-testid":"home-connect-agent",children:[w,N]}),t[37]=w,t[38]=N,t[39]=M):M=t[39],M},Mt=112,Qe=32,Le=5,Ge=1,$t=3,It=t=>{const e=t.slice(-16),n=Math.max(0,...e),s=Qe-Le*2,l=(Mt-Le*2)/e.length;return e.map((r,i)=>{const o=n>0?Math.max(0,r)/n*s:0;return{height:Math.max(0,o-$t),width:Math.max(0,l-Ge*2),x:Le+i*l+Ge,y:Qe-Le-o}})},Tt=t=>{const e=_(4),{data:n}=t;let s;e[0]!==n?(s=It(n).map(Lt),e[0]=n,e[1]=s):s=e[1];let l;return e[2]!==s?(l=a("svg",{"aria-hidden":"true",className:"h-8 w-28 fill-foreground","data-testid":"home-sparkline",viewBox:"0 0 112 32",children:s}),e[2]=s,e[3]=l):l=e[3],l};function Lt(t){return a("rect",{height:t.height,rx:2,width:t.width,x:t.x,y:t.y},t.x)}const Ot=3,Rt=(t,e)=>{if(e==null)return t("cache not enabled");const n=e.hits+e.misses;return n===0?t("no cache traffic yet"):`${Math.round(e.hits/n*100).toString()}% ${t("cache hit")}`},Fe=t=>{if(t<1e3)return`${String(Math.round(t))}ms`;const e=t>=1e4?0:1;return`${(t/1e3).toFixed(e)}s`},Et=(t,e)=>{const n=Math.max(0,Math.round((e-t)/1e3));if(n<60)return`${String(n)}s ago`;const s=Math.round(n/60);if(s<60)return`${String(s)}m ago`;const l=Math.round(s/60);return l<24?`${String(l)}h ago`:`${String(Math.round(l/24))}d ago`},Je=(t,e)=>{if(t===void 0||t.length===0)return[];const n=new Map;for(const s of t)n.set(s.bucketMs,(n.get(s.bucketMs)??0)+s[e]);return[...n.entries()].toSorted(([s],[l])=>s-l).map(([,s])=>s)},Ye=(t,e=!0)=>{if(t.length<4)return null;const n=Math.floor(t.length/2),s=t.slice(0,n).reduce((i,o)=>i+o,0),l=t.slice(n).reduce((i,o)=>i+o,0);if(s===0)return null;const r=(l-s)/s*100;return{positive:e?r>=0:r<=0,text:`${r>=0?"+":""}${r.toFixed(1)}%`}},Oe=t=>{const e=_(24),{delta:n,footer:s,label:l,trend:r,unit:i,value:o}=t,c=T();let u;e[0]!==l?(u=a("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:l}),e[0]=l,e[1]=u):u=e[1];let m;e[2]!==o?(m=a("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:o}),e[2]=o,e[3]=m):m=e[3];let d;e[4]!==i?(d=i!==void 0&&a("span",{className:"text-xs text-muted-foreground",children:i}),e[4]=i,e[5]=d):d=e[5];let f;e[6]!==m||e[7]!==d?(f=h("span",{className:"flex items-baseline gap-1.5",children:[m,d]}),e[6]=m,e[7]=d,e[8]=f):f=e[8];let p;e[9]!==r?(p=r!==void 0&&r.length>=Ot&&a(Tt,{data:r}),e[9]=r,e[10]=p):p=e[10];let g;e[11]!==f||e[12]!==p?(g=h("div",{className:"flex items-center justify-between gap-3",children:[f,p]}),e[11]=f,e[12]=p,e[13]=g):g=e[13];let x;e[14]!==u||e[15]!==g?(x=h("div",{className:"flex flex-col gap-2.5 p-4",children:[u,g]}),e[14]=u,e[15]=g,e[16]=x):x=e[16];let b;e[17]!==n||e[18]!==s||e[19]!==c?(b=n==null?s!=null&&a("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px] text-muted-foreground",children:s}):h("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px]",children:[a("span",{className:st("font-semibold",n.positive?"text-success":"text-destructive"),children:n.text})," ",a("span",{className:"text-muted-foreground",children:c("vs. prev.")})]}),e[17]=n,e[18]=s,e[19]=c,e[20]=b):b=e[20];let v;return e[21]!==x||e[22]!==b?(v=h(P,{className:"justify-between gap-0 py-0",children:[x,b]}),e[21]=x,e[22]=b,e[23]=v):v=e[23],v},Bt=()=>{const t=_(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:a("path",{d:"m9 6 6 6-6 6"})}),t[0]=e):e=t[0],e},je=t=>{const e=_(7),{command:n,label:s}=t;let l;e[0]!==s?(l=a("div",{className:"p-4",children:a("span",{className:"text-sm font-medium text-foreground",children:s})}),e[0]=s,e[1]=l):l=e[1];let r;e[2]!==n?(r=a("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5",children:a("code",{className:"font-mono text-xs text-muted-foreground",children:n})}),e[2]=n,e[3]=r):r=e[3];let i;return e[4]!==l||e[5]!==r?(i=h(P,{className:"justify-between gap-0 py-0",children:[l,r]}),e[4]=l,e[5]=r,e[6]=i):i=e[6],i},Ze=t=>{const e=_(18),{count:n,onView:s,testId:l,title:r}=t,i=T();let o;e[0]!==r?(o=a("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:r}),e[0]=r,e[1]=o):o=e[1];let c;e[2]!==n||e[3]!==i?(c=n===null?a("span",{className:"text-xs text-muted-foreground",children:i("No data yet")}):a(et,{variant:n>0?"destructive":"success",children:n>0?n:i("All clear")}),e[2]=n,e[3]=i,e[4]=c):c=e[4];let u;e[5]!==o||e[6]!==c?(u=h("div",{className:"flex items-start justify-between gap-2 p-4",children:[o,c]}),e[5]=o,e[6]=c,e[7]=u):u=e[7];let m;e[8]!==i?(m=i("View"),e[8]=i,e[9]=m):m=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=a(Bt,{}),e[10]=d):d=e[10];let f;e[11]!==s||e[12]!==m?(f=h("button",{className:"flex items-center gap-1 border-t border-border bg-muted/50 px-4 py-2.5 text-[12px] font-medium text-foreground outline-none transition-colors hover:bg-muted focus-visible:bg-muted",onClick:s,type:"button",children:[m,d]}),e[11]=s,e[12]=m,e[13]=f):f=e[13];let p;return e[14]!==u||e[15]!==f||e[16]!==l?(p=h(P,{className:"justify-between gap-0 py-0","data-testid":l,children:[u,f]}),e[14]=u,e[15]=f,e[16]=l,e[17]=p):p=e[17],p},Pt=t=>{const e=_(7),{functions:n}=t,s=T();let l;if(e[0]!==n||e[1]!==s){const r=[...n].toSorted(Ut).slice(0,5);let i;e[3]!==s?(i=s("Top functions"),e[3]=s,e[4]=i):i=e[4];let o;e[5]!==i?(o=a("div",{className:"border-b border-border px-4 py-3",children:a("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:i})}),e[5]=i,e[6]=o):o=e[6],l=h(P,{className:"gap-0 py-0","data-testid":"home-top-functions",children:[o,r.length===0?a("p",{className:"px-4 py-8 text-center text-xs text-muted-foreground",children:s("No functions called yet.")}):h("div",{className:"divide-y divide-border",children:[h("div",{className:"grid grid-cols-[1fr_auto_auto_auto] gap-4 px-4 py-1.5 font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:[a("span",{children:s("Function")}),a("span",{className:"text-end",children:s("Calls")}),a("span",{className:"w-12 text-end",children:s("Avg")}),a("span",{className:"w-8 text-end",children:s("Err")})]}),r.map(qt)]})]}),e[0]=n,e[1]=s,e[2]=l}else l=e[2];return l},Dt=t=>{const e=_(26),{subs:n}=t,s=T();let l;e[0]!==s?(l=s("Live connections"),e[0]=s,e[1]=l):l=e[1];let r;e[2]!==l?(r=a("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:l}),e[2]=l,e[3]=r):r=e[3];const i=n?.totalConnections??0;let o;e[4]!==i?(o=i.toLocaleString(),e[4]=i,e[5]=o):o=e[5];let c;e[6]!==o?(c=a("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:o}),e[6]=o,e[7]=c):c=e[7];let u;e[8]!==s?(u=s("sockets"),e[8]=s,e[9]=u):u=e[9];let m;e[10]!==u?(m=a("span",{className:"text-xs text-muted-foreground",children:u}),e[10]=u,e[11]=m):m=e[11];let d;e[12]!==c||e[13]!==m?(d=h("span",{className:"flex items-baseline gap-1.5",children:[c,m]}),e[12]=c,e[13]=m,e[14]=d):d=e[14];const f=n?.totalSubscriptions??0;let p;e[15]!==f?(p=f.toLocaleString(),e[15]=f,e[16]=p):p=e[16];let g;e[17]!==s?(g=s("active subscriptions"),e[17]=s,e[18]=g):g=e[18];let x;e[19]!==p||e[20]!==g?(x=h("span",{className:"text-[11px] text-muted-foreground",children:[p," ",g]}),e[19]=p,e[20]=g,e[21]=x):x=e[21];let b;return e[22]!==x||e[23]!==r||e[24]!==d?(b=a(P,{"data-testid":"home-live-connections",children:h(tt,{className:"flex flex-col gap-2.5 py-4",children:[r,d,x]})}),e[22]=x,e[23]=r,e[24]=d,e[25]=b):b=e[25],b},jt=t=>{const e=_(7),{entries:n}=t,s=T();let l;if(e[0]!==n||e[1]!==s){const r=Date.now();let i;e[3]!==s?(i=s("Recent activity"),e[3]=s,e[4]=i):i=e[4];let o;e[5]!==i?(o=a("div",{className:"border-b border-border px-4 py-3",children:a("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:i})}),e[5]=i,e[6]=o):o=e[6],l=h(P,{className:"gap-0 py-0","data-testid":"home-recent-activity",children:[o,n.length===0?a("p",{className:"px-4 py-8 text-center text-xs text-muted-foreground",children:s("No recent activity.")}):a("ul",{className:"divide-y divide-border",children:n.slice(0,5).map(c=>h("li",{className:"flex items-center justify-between gap-3 px-4 py-2 text-[13px]",children:[h("span",{className:"flex min-w-0 items-center gap-2",children:[a("span",{"aria-hidden":"true",className:"size-1.5 shrink-0 rounded-full bg-muted-foreground/40"}),h("span",{className:"truncate text-foreground",children:[c.op,c.table!==void 0&&h("span",{className:"text-muted-foreground",children:[" · ",c.table,c.id===void 0?"":`#${c.id}`]})]})]}),a("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:Et(c.ts,r)})]},c.seq))})]}),e[0]=n,e[1]=s,e[2]=l}else l=e[2];return l},Ft=t=>{const e=t.reduce((n,s)=>n+s.calls,0);return e===0?null:t.reduce((n,s)=>n+s.totalDurationMs,0)/e},as=t=>{const e=_(149),{initialShardKey:n}=t,s=T(),l=Xe(),r=n??"";let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={},e[0]=i):i=e[0];let o;e[1]!==r?(o={shardKey:r},e[1]=r,e[2]=o):o=e[2];const c=ve(ye.getMetrics,i,o);let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u={},e[3]=u):u=e[3];let m;e[4]!==r?(m={shardKey:r},e[4]=r,e[5]=m):m=e[5];const d=ve(ye.getFunctionStats,u,m);let f,p;e[6]===Symbol.for("react.memo_cache_sentinel")?(f={},p={shardKey:""},e[6]=f,e[7]=p):(f=e[6],p=e[7]);const g=ve(ye.getSecurityAudit,f,p);let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x={},e[8]=x):x=e[8];let b;e[9]!==r?(b={shardKey:r},e[9]=r,e[10]=b):b=e[10];const v=ve(ye.listSubscriptions,x,b);let S;e[11]===Symbol.for("react.memo_cache_sentinel")?(S={},e[11]=S):S=e[11];let w;e[12]!==r?(w={shardKey:r},e[12]=r,e[13]=w):w=e[13];const $=ve(ye.getAuditLog,S,w),y=c.data??null;let k,C,A,N,M,I,L,O,R,D,j,F,E,B,U,q,K,W;if(e[14]!==$.data||e[15]!==g.data||e[16]!==y||e[17]!==c.data||e[18]!==l||e[19]!==d.data||e[20]!==v.data||e[21]!==s){N=Array.isArray(d.data?.functions)?d.data.functions:[],L=v.data??null;let ke;e[40]!==$.data?(ke=Array.isArray($.data?.entries)?$.data.entries:[],e[40]=$.data,e[41]=ke):ke=e[41],C=ke,M=c.data===void 0||d.data===void 0?null:ct(y,N).length,I=Array.isArray(g.data?.findings)?g.data.findings.length:null;let Ce;e[42]!==l?(Ce=()=>{Ne(l({to:"/security"}))},e[42]=l,e[43]=Ce):Ce=e[43],W=Ce;let Ae;e[44]!==l?(Ae=()=>{Ne(l({to:"/insights"}))},e[44]=l,e[45]=Ae):Ae=e[45],K=Ae;const Me=Je(y?.history,"calls"),$e=Je(y?.history,"errors"),ze=Ft(N),Ie=Math.max(0,...N.map(Kt));let Te;e[46]!==y||e[47]!==s?(Te=y===null?void 0:Rt(s,y.cache),e[46]=y,e[47]=s,e[48]=Te):Te=e[48],A=Te,U="flex flex-col gap-6",q="lunora-home",j="grid gap-3 sm:grid-cols-2 xl:grid-cols-4",F="home-health";const Ee=Ye(Me);let he;e[49]!==s?(he=s("Requests"),e[49]=s,e[50]=he):he=e[50];const Be=y?.requests??0;let ge;e[51]!==Be?(ge=Be.toLocaleString(),e[51]=Be,e[52]=ge):ge=e[52],e[53]!==Me||e[54]!==Ee||e[55]!==he||e[56]!==ge?(E=a(Oe,{delta:Ee,label:he,trend:Me,value:ge}),e[53]=Me,e[54]=Ee,e[55]=he,e[56]=ge,e[57]=E):E=e[57];const Pe=Ye($e,!1);let xe;e[58]!==s?(xe=s("Errors"),e[58]=s,e[59]=xe):xe=e[59];const De=y?.errors??0;let be;e[60]!==De?(be=De.toLocaleString(),e[60]=De,e[61]=be):be=e[61],e[62]!==$e||e[63]!==Pe||e[64]!==xe||e[65]!==be?(B=a(Oe,{delta:Pe,label:xe,trend:$e,value:be}),e[62]=$e,e[63]=Pe,e[64]=xe,e[65]=be,e[66]=B):B=e[66],k=Oe,e[67]!==Ie||e[68]!==s?(O=Ie>0?`${s("max")} ${Fe(Ie)}`:void 0,e[67]=Ie,e[68]=s,e[69]=O):O=e[69],e[70]!==s?(R=s("Avg latency"),e[70]=s,e[71]=R):R=e[71],D=ze===null?"—":Fe(ze),e[14]=$.data,e[15]=g.data,e[16]=y,e[17]=c.data,e[18]=l,e[19]=d.data,e[20]=v.data,e[21]=s,e[22]=k,e[23]=C,e[24]=A,e[25]=N,e[26]=M,e[27]=I,e[28]=L,e[29]=O,e[30]=R,e[31]=D,e[32]=j,e[33]=F,e[34]=E,e[35]=B,e[36]=U,e[37]=q,e[38]=K,e[39]=W}else k=e[22],C=e[23],A=e[24],N=e[25],M=e[26],I=e[27],L=e[28],O=e[29],R=e[30],D=e[31],j=e[32],F=e[33],E=e[34],B=e[35],U=e[36],q=e[37],K=e[38],W=e[39];let z;e[72]!==k||e[73]!==O||e[74]!==R||e[75]!==D?(z=a(k,{footer:O,label:R,value:D}),e[72]=k,e[73]=O,e[74]=R,e[75]=D,e[76]=z):z=e[76];let H;e[77]!==s?(H=s("Database size"),e[77]=s,e[78]=H):H=e[78];const Re=y?.databaseSize??null;let V;e[79]!==Re?(V=it(Re),e[79]=Re,e[80]=V):V=e[80];let Q;e[81]!==A||e[82]!==H||e[83]!==V?(Q=a(Oe,{footer:A,label:H,value:V}),e[81]=A,e[82]=H,e[83]=V,e[84]=Q):Q=e[84];let G;e[85]!==j||e[86]!==F||e[87]!==E||e[88]!==B||e[89]!==z||e[90]!==Q?(G=h("div",{className:j,"data-testid":F,children:[E,B,z,Q]}),e[85]=j,e[86]=F,e[87]=E,e[88]=B,e[89]=z,e[90]=Q,e[91]=G):G=e[91];let _e;e[92]===Symbol.for("react.memo_cache_sentinel")?(_e=a(bt,{}),e[92]=_e):_e=e[92];let J;e[93]!==N?(J=a("div",{className:"lg:col-span-2",children:a(Pt,{functions:N})}),e[93]=N,e[94]=J):J=e[94];let Y;e[95]!==L?(Y=a(Dt,{subs:L}),e[95]=L,e[96]=Y):Y=e[96];let Z;e[97]!==C?(Z=a(jt,{entries:C}),e[97]=C,e[98]=Z):Z=e[98];let X;e[99]!==Y||e[100]!==Z?(X=h("div",{className:"flex flex-col gap-3",children:[Y,Z]}),e[99]=Y,e[100]=Z,e[101]=X):X=e[101];let ee;e[102]!==J||e[103]!==X?(ee=h("div",{className:"grid gap-3 lg:grid-cols-3",children:[J,X]}),e[102]=J,e[103]=X,e[104]=ee):ee=e[104];let te;e[105]!==s?(te=s("Advisors"),e[105]=s,e[106]=te):te=e[106];let se;e[107]!==te?(se=a("h2",{className:"text-sm font-semibold tracking-tight text-foreground",children:te}),e[107]=te,e[108]=se):se=e[108];let ne;e[109]!==M||e[110]!==I||e[111]!==s||e[112]!==K||e[113]!==W?(ne=I===0&&M===0?a(nt,{description:s("No security or performance issues detected."),icon:h("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[a("path",{d:"M12 3 4 6v5c0 5 3.4 8.5 8 10 4.6-1.5 8-5 8-10V6l-8-3Z"}),a("path",{d:"m9 12 2 2 4-4"})]}),testId:"home-advisors-clear",title:s("No issues found")}):h("div",{className:"grid gap-3 sm:grid-cols-2",children:[a(Ze,{count:I,onView:W,testId:"home-security",title:s("Security findings")}),a(Ze,{count:M,onView:K,testId:"home-performance",title:s("Performance issues")})]}),e[109]=M,e[110]=I,e[111]=s,e[112]=K,e[113]=W,e[114]=ne):ne=e[114];let le;e[115]!==se||e[116]!==ne?(le=h("section",{className:"flex flex-col gap-3","data-testid":"home-advisors",children:[se,ne]}),e[115]=se,e[116]=ne,e[117]=le):le=e[117];let ae;e[118]!==s?(ae=s("Get connected"),e[118]=s,e[119]=ae):ae=e[119];let re;e[120]!==ae?(re=a("h2",{className:"text-sm font-semibold tracking-tight text-foreground",children:ae}),e[120]=ae,e[121]=re):re=e[121];let oe;e[122]!==s?(oe=s("Client SDK"),e[122]=s,e[123]=oe):oe=e[123];let ie;e[124]!==oe?(ie=a(je,{command:"npm i @lunora/client",label:oe}),e[124]=oe,e[125]=ie):ie=e[125];let ce;e[126]!==s?(ce=s("React"),e[126]=s,e[127]=ce):ce=e[127];let de;e[128]!==ce?(de=a(je,{command:"npm i @lunora/react",label:ce}),e[128]=ce,e[129]=de):de=e[129];let ue;e[130]!==s?(ue=s("CLI"),e[130]=s,e[131]=ue):ue=e[131];let me;e[132]!==ue?(me=a(je,{command:"lunora dev",label:ue}),e[132]=ue,e[133]=me):me=e[133];let fe;e[134]!==ie||e[135]!==de||e[136]!==me?(fe=h("div",{className:"grid gap-3 sm:grid-cols-3",children:[ie,de,me]}),e[134]=ie,e[135]=de,e[136]=me,e[137]=fe):fe=e[137];let Se;e[138]===Symbol.for("react.memo_cache_sentinel")?(Se=a(At,{}),e[138]=Se):Se=e[138];let pe;e[139]!==re||e[140]!==fe?(pe=h("section",{className:"flex flex-col gap-3","data-testid":"home-get-connected",children:[re,fe,Se]}),e[139]=re,e[140]=fe,e[141]=pe):pe=e[141];let we;return e[142]!==U||e[143]!==q||e[144]!==G||e[145]!==ee||e[146]!==le||e[147]!==pe?(we=h("div",{className:U,"data-testid":q,children:[G,_e,ee,le,pe]}),e[142]=U,e[143]=q,e[144]=G,e[145]=ee,e[146]=le,e[147]=pe,e[148]=we):we=e[148],we};function Ut(t,e){return e.calls-t.calls}function qt(t){return h("div",{className:"grid grid-cols-[1fr_auto_auto_auto] items-center gap-4 px-4 py-2 text-[13px]",children:[a("span",{className:"truncate font-mono text-xs text-foreground",children:t.path}),a("span",{className:"text-end tabular-nums",children:t.calls.toLocaleString()}),a("span",{className:"w-12 text-end tabular-nums text-muted-foreground",children:Fe(t.calls>0?t.totalDurationMs/t.calls:0)}),a("span",{className:st("w-8 text-end tabular-nums",t.errors>0?"text-destructive":"text-muted-foreground"),children:t.errors})]},t.path)}function Kt(t){return t.maxDurationMs}export{as as H,Rt as c,pt as u};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{resolveHint as e}from"@lunora/errors";const a=t=>{if(typeof t=="string")return[t];if(!Array.isArray(t))return;const n=t.filter(r=>typeof r=="string");return n.length>0?n:void 0},s=t=>{if(t!==void 0)return typeof t=="string"?t:t.join(`
|
|
2
|
+
`)},f=new Set(["ADMIN_FORBIDDEN","FORBIDDEN","UNAUTHORIZED"]),p=(t,n,r,o,i)=>{switch(n){case"action":return t.action(r,o,i);case"mutation":return t.mutation(r,o,{...i,onlineOnly:!0});default:return t.query(r,o,i)}},m=t=>({__lunoraRef:t}),h=t=>{const n=t.trim();return n===""?{}:{shardKey:n}},b=t=>t instanceof Error?t.message:String(t),u=t=>{if(t===null||typeof t!="object"||!("code"in t))return;const{code:n}=t;return typeof n=="string"?n:void 0},B=t=>{const n=u(t);return n!==void 0&&f.has(n)},w=t=>{if(typeof t=="string")return s(e(t));if(t===null||typeof t!="object")return;const{code:n,hint:r,message:o}=t;return s(e({code:typeof n=="string"?n:void 0,hint:a(r),message:typeof o=="string"?o:void 0}))},T=t=>{if(t===null||typeof t!="object"||!("docsUrl"in t))return;const n=t.docsUrl;if(typeof n=="string")try{const{protocol:r}=new URL(n);return r==="http:"||r==="https:"?n:void 0}catch{return}},c=t=>{if(t==null)return"—";if(t<1024)return`${t.toString()} B`;const n=["KB","MB","GB","TB"];let r=t/1024,o=0;for(;r>=1024&&o<n.length-1;)r/=1024,o+=1;return`${r.toFixed(1)} ${n[o]??"TB"}`},d=(t,n)=>typeof n=="bigint"?n.toString():n instanceof ArrayBuffer||ArrayBuffer.isView(n)?`<bytes: ${c(n.byteLength)}>`:n,S=t=>typeof t=="bigint"?t.toString():t,A=t=>{if(t==null)return"";switch(typeof t){case"bigint":case"boolean":case"number":return t.toString();case"string":return t;case"symbol":return t.toString();default:return t instanceof ArrayBuffer||ArrayBuffer.isView(t)?`<bytes: ${c(t.byteLength)}>`:JSON.stringify(t,d)}},g=(t,n)=>{t.catch(r=>{n?.(r)})},l=t=>{if(t!==void 0&&t!=="")return t;const n=globalThis.location;return n?.origin!==void 0&&n.origin!==""?n.origin:"http://localhost:5173"},D=t=>{let n=l(t);for(;n.endsWith("/");)n=n.slice(0,-1);return n},N=t=>{const n="navigator"in globalThis?globalThis.navigator.clipboard:void 0;return n===void 0?!1:(g(n.writeText(t)),!0)},O=(t,n="")=>{if(t==null||t==="")return n;const r=new Date(t);return Number.isNaN(r.getTime())?String(t):r.toLocaleString()};export{T as a,b,m as c,h as d,w as e,g as f,N as g,O as h,B as i,u as j,d as k,A as l,p as m,c as n,S as o,l as r,D as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as h}from"react/compiler-runtime";import{f as v}from"./log-fields-BolUoZ9g.mjs";import{B as x}from"./badge-r_5B4LHP.mjs";import{h as L}from"./internal-
|
|
1
|
+
import{c as h}from"react/compiler-runtime";import{f as v}from"./log-fields-BolUoZ9g.mjs";import{B as x}from"./badge-r_5B4LHP.mjs";import{h as L}from"./internal-hIuTpSbx.mjs";import{jsx as o,jsxs as g,Fragment as N}from"react/jsx-runtime";const w={debug:"secondary",error:"destructive",fatal:"destructive",info:"outline",log:"outline",trace:"outline",warn:"secondary"},B=p=>{const e=h(21),{entry:t}=p;let m;e[0]!==t.fields?(m=v(t.fields),e[0]=t.fields,e[1]=m):m=e[1];const c=m;let l;e[2]!==t.timestamp?(l=L(t.timestamp),e[2]=t.timestamp,e[3]=l):l=e[3];let s;e[4]!==l?(s=o("span",{className:"w-44 shrink-0 tabular-nums text-muted-foreground",role:"gridcell",children:l}),e[4]=l,e[5]=s):s=e[5];const f=w[t.level];let r;e[6]!==t.level||e[7]!==f?(r=o("span",{className:"w-20 shrink-0",role:"gridcell",children:o(x,{variant:f,children:t.level})}),e[6]=t.level,e[7]=f,e[8]=r):r=e[8];const u=t.functionPath??"—";let a;e[9]!==u?(a=o("span",{className:"w-48 shrink-0 truncate text-muted-foreground",role:"gridcell",children:u}),e[9]=u,e[10]=a):a=e[10];let i;e[11]!==c?(i=c===""?null:o("span",{className:"ml-2 text-muted-foreground","data-testid":"lg-fields",children:c}),e[11]=c,e[12]=i):i=e[12];let n;e[13]!==t.message||e[14]!==i?(n=g("span",{className:"flex-1 truncate",role:"gridcell",children:[t.message,i]}),e[13]=t.message,e[14]=i,e[15]=n):n=e[15];let d;return e[16]!==s||e[17]!==r||e[18]!==a||e[19]!==n?(d=g(N,{children:[s,r,a,n]}),e[16]=s,e[17]=r,e[18]=a,e[19]=n,e[20]=d):d=e[20],d};export{B as L,w as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as u}from"./use-admin-query-
|
|
1
|
+
import{o as u}from"./use-admin-query-CaOm4JS3.mjs";const b="__lunora_admin__:",d=new Set(["action","mutation","query"]),r=Symbol("lunora.operationSeq"),g=t=>{if(typeof t!="object"||t===null)return;const n=t[r];return typeof n=="number"?n:void 0},h=(t,n)=>{if(!(typeof t!="object"||t===null||!Object.isExtensible(t)))try{Object.defineProperty(t,r,{configurable:!0,enumerable:!1,value:n,writable:!0})}catch{}},p=t=>{if(typeof t!="object"||t===null)return;const n=t.__lunoraRef;return typeof n=="string"&&n.startsWith(b)?n:void 0},O=t=>{if(typeof t!="object"||t===null)return"";const{shardKey:n}=t;return typeof n=="string"?n:""},E=t=>new Proxy(t,{get(n,c,a){const i=Reflect.get(n,c,a);if(typeof i!="function"||typeof c!="string"||!d.has(c))return typeof i=="function"?i.bind(n):i;const f=i;return async(...e)=>{const l=p(e[0]);if(l===void 0)return f.apply(n,e);const y=typeof e[1]=="object"&&e[1]!==null?e[1]:{},s=u.start(l,y,O(e[2]));try{const o=await f.apply(n,e);return u.settle(s,{result:o}),o}catch(o){throw u.settle(s,{error:o instanceof Error?o.message:String(o)}),h(o,s),o}}}});export{g as o,E as w};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as P}from"react/compiler-runtime";import{SentIcon as ie,Copy01Icon as ae,Search01Icon as le}from"@hugeicons/core-free-icons";import{HugeiconsIcon as F}from"@hugeicons/react";import{useState as B,createContext as de,use as ce}from"react";import{I as ue}from"./input-CXhxesPC.mjs";import{useT as J}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{B as W}from"./button-q0UYSmrn.mjs";import{g as X,f as fe,b as H,m as me,c as pe,d as he,k as ge}from"./internal-
|
|
1
|
+
import{c as P}from"react/compiler-runtime";import{SentIcon as ie,Copy01Icon as ae,Search01Icon as le}from"@hugeicons/core-free-icons";import{HugeiconsIcon as F}from"@hugeicons/react";import{useState as B,createContext as de,use as ce}from"react";import{I as ue}from"./input-CXhxesPC.mjs";import{useT as J}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{B as W}from"./button-q0UYSmrn.mjs";import{g as X,f as fe,b as H,m as me,c as pe,d as he,k as ge}from"./internal-hIuTpSbx.mjs";import{jsx as i,jsxs as N,Fragment as xe}from"react/jsx-runtime";import{B as ye}from"./badge-r_5B4LHP.mjs";import{ShardInput as be}from"./ShardInput-CoySruKZ.mjs";import{L as U}from"./label-DKFzyHq6.mjs";import{T as ve}from"./textarea--40GKAyz.mjs";import{LunoraError as Ne}from"@lunora/errors";import{u as Se}from"./use-studio-client-DCA50tF2.mjs";import{c as Y}from"./utils-bhneXptQ.mjs";const we=t=>typeof t=="number"?"number":typeof t=="boolean"?"boolean":"string",Q=t=>{if(t.enum!==void 0&&t.enum.length>0)return t.enum;if(t.anyOf!==void 0&&t.anyOf.length>0&&t.anyOf.every(e=>e.const!==void 0))return t.anyOf.map(e=>e.const)},z=t=>t===void 0?"any":t.const!==void 0?JSON.stringify(t.const):t.enum!==void 0&&t.enum.length>0?t.enum.map(e=>JSON.stringify(e)).join(" | "):t.anyOf!==void 0&&t.anyOf.length>0?t.anyOf.map(e=>z(e)).join(" | "):t.type==="array"?`array<${z(t.items)}>`:t.type??"any",ke=t=>{const e=Q(t);return e!==void 0?t.type??we(e[0]):z(t)},Oe=t=>{const e=Q(t);return e===void 0?void 0:e.map(r=>JSON.stringify(r)).join(" | ")},$e=t=>{const e=[];t.minimum!==void 0?e.push(`${String(t.minimum)} ≤`):t.exclusiveMinimum!==void 0&&e.push(`${String(t.exclusiveMinimum)} <`);const r=e.length>0;e.push("value"),t.maximum!==void 0?e.push(`≤ ${String(t.maximum)}`):t.exclusiveMaximum!==void 0&&e.push(`< ${String(t.exclusiveMaximum)}`);const s=e.length>(r?2:1);return r||s?e.join(" "):void 0},Te=t=>{if(t.type==="object"&&t.properties!==void 0)return t;if(t.type==="array"&&t.items?.type==="object"&&t.items.properties!==void 0)return t.items},D=t=>{if(t===void 0)return null;if(t.const!==void 0)return t.const;if(t.enum!==void 0&&t.enum.length>0)return t.enum[0];if(t.anyOf!==void 0&&t.anyOf.length>0)return D(t.anyOf[0]);switch(t.type){case"array":return[];case"boolean":return!1;case"number":return 0;case"object":{const e={};for(const[r,s]of Object.entries(t.properties??{}))e[r]=D(s);return e}case"string":return"";default:return null}},K=t=>{const e=P(7),{label:r,value:s}=t;let n;e[0]!==r?(n=i("span",{className:"text-muted-foreground",children:r}),e[0]=r,e[1]=n):n=e[1];let o;e[2]!==s?(o=i("span",{className:"text-foreground",children:s}),e[2]=s,e[3]=o):o=e[3];let l;return e[4]!==n||e[5]!==o?(l=N("span",{className:"inline-flex items-center gap-1 rounded border border-border px-1.5 py-0.5 font-mono text-[10px]",children:[n,o]}),e[4]=n,e[5]=o,e[6]=l):l=e[6],l},Ce=t=>{const e=P(40),{name:r,required:s,schema:n}=t,o=J();let l;e[0]!==n?(l=$e(n),e[0]=n,e[1]=l):l=e[1];const a=l;let y;e[2]!==n?(y=Oe(n),e[2]=n,e[3]=y):y=e[3];const d=y,c=n["x-lunora-table"],u=n.format!==void 0||a!==void 0||d!==void 0||c!==void 0;let b;e[4]!==n?(b=Te(n),e[4]=n,e[5]=b):b=e[5];const x=b,f=s?"*":"?";let m;e[6]!==f?(m=i("span",{className:"text-muted-foreground",children:f}),e[6]=f,e[7]=m):m=e[7];let v;e[8]!==r||e[9]!==m?(v=N("span",{className:"font-mono text-foreground",children:[r,m]}),e[8]=r,e[9]=m,e[10]=v):v=e[10];let w;e[11]!==n?(w=ke(n),e[11]=n,e[12]=w):w=e[12];let p;e[13]!==w?(p=i("span",{className:"font-mono text-muted-foreground",children:w}),e[13]=w,e[14]=p):p=e[14];let h;e[15]!==v||e[16]!==p?(h=N("div",{className:"flex items-baseline gap-2",children:[v,p]}),e[15]=v,e[16]=p,e[17]=h):h=e[17];let g;e[18]!==n.description?(g=n.description!==void 0&&i("p",{className:"max-w-prose text-muted-foreground",children:n.description}),e[18]=n.description,e[19]=g):g=e[19];let S;e[20]!==u||e[21]!==a||e[22]!==c||e[23]!==n.format||e[24]!==o||e[25]!==d?(S=u&&N("div",{className:"flex flex-wrap gap-1",children:[n.format!==void 0&&i(K,{label:o("Format"),value:n.format}),a!==void 0&&i(K,{label:o("Range"),value:a}),d!==void 0&&i(K,{label:o("Value in"),value:d}),c!==void 0&&i(K,{label:o("relation"),value:c})]}),e[20]=u,e[21]=a,e[22]=c,e[23]=n.format,e[24]=o,e[25]=d,e[26]=S):S=e[26];let O;e[27]!==g||e[28]!==S||e[29]!==h?(O=N("div",{className:"flex flex-col gap-1 py-2",children:[h,g,S]}),e[27]=g,e[28]=S,e[29]=h,e[30]=O):O=e[30];const k=O;if(x===void 0){let $;return e[31]!==k?($=i("div",{className:"border-b border-border/50 last:border-b-0",children:k}),e[31]=k,e[32]=$):$=e[32],$}let T;e[33]!==k?(T=i("summary",{className:"cursor-pointer marker:text-muted-foreground",children:k}),e[33]=k,e[34]=T):T=e[34];let R;e[35]!==x?(R=i("div",{className:"mb-2 ml-2 border-l border-border pl-3",children:i(Z,{schema:x})}),e[35]=x,e[36]=R):R=e[36];let C;return e[37]!==T||e[38]!==R?(C=N("details",{className:"border-b border-border/50 last:border-b-0",children:[T,R]}),e[37]=T,e[38]=R,e[39]=C):C=e[39],C},Z=t=>{const e=P(7),{schema:r}=t;let s;e[0]!==r.required?(s=new Set(r.required),e[0]=r.required,e[1]=s):s=e[1];const n=s;let o;e[2]!==r.properties?(o=Object.entries(r.properties??{}),e[2]=r.properties,e[3]=o):o=e[3];const l=o;let a;return e[4]!==n||e[5]!==l?(a=i("div",{className:"flex flex-col",children:l.map(y=>{const[d,c]=y;return i(Ce,{name:d,required:n.has(d),schema:c},d)})}),e[4]=n,e[5]=l,e[6]=a):a=e[6],a},V=t=>{const e=P(10),{schema:r,testId:s}=t;if(r?.type!=="object"||Object.keys(r.properties??{}).length===0){let l;e[0]!==r?(l=z(r),e[0]=r,e[1]=l):l=e[1];let a;return e[2]!==l||e[3]!==s?(a=i("p",{className:"font-mono text-xs text-muted-foreground","data-testid":s,children:l}),e[2]=l,e[3]=s,e[4]=a):a=e[4],a}let n;e[5]!==r?(n=i(Z,{schema:r}),e[5]=r,e[6]=n):n=e[6];let o;return e[7]!==n||e[8]!==s?(o=i("div",{className:"text-xs","data-testid":s,children:n}),e[7]=n,e[8]=s,e[9]=o):o=e[9],o},Ee=["curl","javascript","lunora"],Re={lunora:"Lunora",curl:"cURL",javascript:"JavaScript"},Ae=t=>`api.${t.replaceAll(/[/:]/g,".")}`,je=t=>{const e=D(t.argsSchema)??{};return t.functionPath===void 0?e:{args:e,functionPath:t.functionPath}},Ie=(t,e,r)=>{const s=`${r}${e.httpPath}`,n=JSON.stringify(je(e),void 0,2),o=JSON.stringify(D(e.argsSchema)??{},void 0,2);switch(t){case"curl":{const l=e.method!=="GET"&&e.method!=="HEAD",a=[`curl -X ${e.method} ${JSON.stringify(s)}`];return l&&a.push(' -H "Content-Type: application/json"',` -d '${n}'`),a.join(` \\
|
|
2
2
|
`)}case"lunora":return e.functionPath===void 0?`await fetch(${JSON.stringify(e.httpPath)}, { method: ${JSON.stringify(e.method)} });`:`import { useLunora } from "@lunora/react";
|
|
3
3
|
import { api } from "./_generated/api";
|
|
4
4
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{c as y}from"react/compiler-runtime";import{Handle as L,Position as R,useNodesState as q,useEdgesState as Q,ReactFlow as Z,Background as J,Panel as k,Controls as X,MiniMap as ee,useNodesInitialized as te,useReactFlow as se}from"@xyflow/react";import{useState as D,useMemo as _,useRef as oe,useEffect as w}from"react";import{D as ae}from"./diagram-export-panel-aBDQdX4e.mjs";import{S as ne,T as x}from"./storage-tier-C2mKwYRj.mjs";import{B as E}from"./badge-r_5B4LHP.mjs";import{B as A}from"./button-q0UYSmrn.mjs";import{I as re}from"./input-CXhxesPC.mjs";import{useT as M}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{f as le}from"./internal-BXEjuLPN.mjs";import{c as N}from"./utils-bhneXptQ.mjs";import{jsx as c,jsxs as h}from"react/jsx-runtime";function ie(s){const e=y(10);let t,n,o;e[0]!==s?({className:t,selected:o,...n}=s,e[0]=s,e[1]=t,e[2]=n,e[3]=o):(t=e[1],n=e[2],o=e[3]);const r=o===!0?"":void 0;let a;e[4]!==t?(a=N("rounded-md border border-border bg-card text-card-foreground shadow-sm transition-colors","data-[selected]:border-ring data-[selected]:ring-[3px] data-[selected]:ring-ring/30",t),e[4]=t,e[5]=a):a=e[5];let l;return e[6]!==n||e[7]!==r||e[8]!==a?(l=c("div",{"data-slot":"base-node","data-selected":r,className:a,...n}),e[6]=n,e[7]=r,e[8]=a,e[9]=l):l=e[9],l}function ce(s){const e=y(8);let t,n;e[0]!==s?({className:t,...n}=s,e[0]=s,e[1]=t,e[2]=n):(t=e[1],n=e[2]);let o;e[3]!==t?(o=N("flex items-center gap-2 rounded-t-md bg-muted/50 px-3 py-1.5",t),e[3]=t,e[4]=o):o=e[4];let r;return e[5]!==n||e[6]!==o?(r=c("div",{"data-slot":"base-node-header",className:o,...n}),e[5]=n,e[6]=o,e[7]=r):r=e[7],r}function de(s){const e=y(8);let t,n;e[0]!==s?({className:t,...n}=s,e[0]=s,e[1]=t,e[2]=n):(t=e[1],n=e[2]);let o;e[3]!==t?(o=N("flex flex-col",t),e[3]=t,e[4]=o):o=e[4];let r;return e[5]!==n||e[6]!==o?(r=c("div",{"data-slot":"base-node-content",className:o,...n}),e[5]=n,e[6]=o,e[7]=r):r=e[7],r}const me=3,fe=(s,e,t)=>{const n=e?s:s.slice(0,me),o=n.map(a=>JSON.stringify(a)).join(" | "),r=s.length-n.length;return r>0?`${o} ${t("+{count} more",{count:r})}`:o},H=(s,e,t)=>{const n=s.enumValues??[],o=n.length===0?s.type:fe(n,e,t),r=s.ref===void 0?o:`${o} → ${s.ref}`;return s.optional===!0?`${r}?`:r},ue=s=>{const e=y(23),{data:t,selected:n}=s,o=M();let r;e[0]!==t.label||e[1]!==t.loadError||e[2]!==o?(r=t.loadError===!0?c("span",{className:"px-3 py-1.5 text-xs text-destructive","data-testid":`sd-node-${t.label}-error`,children:o("Columns unavailable")}):c("span",{className:"px-3 py-1.5 text-xs text-muted-foreground",children:"—"}),e[0]=t.label,e[1]=t.loadError,e[2]=o,e[3]=r):r=e[3];const a=r,l=`sd-node-${t.label}`;let d;e[4]!==t.label?(d=c("span",{className:"truncate font-mono text-xs font-semibold",title:t.label,children:t.label}),e[4]=t.label,e[5]=d):d=e[5];let m;e[6]!==t.tier?(m=c("span",{className:"ms-auto",children:c(ne,{tier:t.tier})}),e[6]=t.tier,e[7]=m):m=e[7];let i;e[8]!==d||e[9]!==m?(i=h(ce,{children:[d,m]}),e[8]=d,e[9]=m,e[10]=i):i=e[10];let f;e[11]!==t.columns||e[12]!==t.label||e[13]!==a||e[14]!==o?(f=t.columns.length===0?a:t.columns.map(p=>h("div",{className:N("relative flex items-center gap-2 border-t border-border px-3 py-1.5 text-xs first:border-t-0",p.pk===!0&&"bg-muted/30"),"data-testid":`sd-col-${t.label}-${p.name}`,children:[c(L,{className:"!h-2 !w-2 !-left-1 !border-border !bg-muted-foreground/70",id:p.name,isConnectable:!1,position:R.Left,type:"target"}),c("span",{className:"truncate font-mono",title:p.name,children:p.name}),p.pk===!0&&c(E,{className:"px-1 py-0 text-[10px] leading-tight",variant:"secondary",children:"PK"}),p.ref!==void 0&&c(E,{className:"px-1 py-0 text-[10px] leading-tight",variant:"outline",children:"FK"}),c("span",{className:"ms-auto truncate text-muted-foreground",title:H(p,!0,o),children:H(p,!1,o)}),c(L,{className:"!h-2 !w-2 !-right-1 !border-border !bg-muted-foreground/70",id:p.name,isConnectable:!1,position:R.Right,type:"source"})]},p.name)),e[11]=t.columns,e[12]=t.label,e[13]=a,e[14]=o,e[15]=f):f=e[15];let u;e[16]!==f?(u=c(de,{children:f}),e[16]=f,e[17]=u):u=e[17];let b;return e[18]!==n||e[19]!==l||e[20]!==i||e[21]!==u?(b=h(ie,{className:"w-64 overflow-hidden","data-testid":l,selected:n,children:[i,u]}),e[18]=n,e[19]=l,e[20]=i,e[21]=u,e[22]=b):b=e[22],b},F=256,z=112,O=36,v=24,pe=480,he=1.4,ge=s=>{const e=Math.max(1,Math.round(Math.sqrt(he*s/(F+z))));return Math.max(pe,s/e)},be=38,xe=28,B=s=>be+Math.max(1,s)*xe,Ne=(s,e)=>{const t=new Map;for(const a of s)t.set(a,[]);for(const a of e)a.to!==a.from&&t.has(a.from)&&t.has(a.to)&&t.get(a.from)?.push(a.to);const n=new Map,o=new Set,r=a=>{const l=n.get(a);if(l!==void 0)return l;if(o.has(a))return 0;o.add(a);let d=0;for(const m of t.get(a)??[])d=Math.max(d,r(m)+1);return o.delete(a),n.set(a,d),d};for(const a of s)r(a);return n},ye=(s,e,t)=>{const n=Ne(s,e),o=new Map;for(const m of s){const i=n.get(m)??0,f=o.get(i);f===void 0?o.set(i,[m]):f.push(m)}const r=s.reduce((m,i)=>m+B(t.get(i)??0)+O,0),a=ge(r),l=[];let d=0;for(const m of[...o.keys()].toSorted((i,f)=>i-f)){let i=0,f=v;for(const u of o.get(m)??[]){const b=B(t.get(u)??0);f>v&&f+b>a&&(i+=1,f=v),l.push({name:u,x:v+(d+i)*(F+z),y:f}),f+=b+O}d+=i+1}return l},ve={databaseSchema:ue},G={backgroundColor:x.shard.color},I={backgroundColor:x.global.color},Ee={global:!0,shard:!0},Se={},_e=s=>{const e=s.find(t=>t.pk===!0)?.name;return e!==void 0?e:s.some(t=>t.name==="_id")?"_id":s.some(t=>t.name==="id")?"id":s[0]?.name??"_id"},K=s=>s.flatMap(e=>e.columns.filter(t=>t.ref!==void 0).map(t=>({column:t.name,from:e.name,to:t.ref}))),we=(s,e,t)=>{const n=s.map(l=>l.name),o=new Map(s.map(l=>[l.name,l.columns.length])),r=ye(n,K(s),o),a=new Map(s.map(l=>[l.name,l]));return r.flatMap(({name:l,x:d,y:m})=>{const i=a.get(l);return i===void 0?[]:[{className:t[l],data:{columns:i.columns,label:l,loadError:e,tier:i.tier},id:l,position:{x:d,y:m},type:"databaseSchema"}]})},Me=s=>{const e=new Map(s.map(t=>[t.name,t.columns]));return K(s).flatMap(t=>{const n=e.get(t.to)??[],o=e.get(t.from)??[],r=_e(n);return!n.some(a=>a.name===r)||!o.some(a=>a.name===t.column)?[]:[{id:`${t.from}.${t.column}->${t.to}`,source:t.to,sourceHandle:r,target:t.from,targetHandle:t.column}]})},Ce=()=>{const s=y(15),e=M();let t;s[0]===Symbol.for("react.memo_cache_sentinel")?(t=h("span",{className:"flex items-center gap-1",children:[c("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:G}),x.shard.label]}),s[0]=t):t=s[0];let n;s[1]===Symbol.for("react.memo_cache_sentinel")?(n=h("span",{className:"flex items-center gap-1",children:[c("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:I}),x.global.label]}),s[1]=n):n=s[1];let o;s[2]===Symbol.for("react.memo_cache_sentinel")?(o=c(E,{className:"px-1 py-0 text-[10px] leading-tight",variant:"secondary",children:"PK"}),s[2]=o):o=s[2];let r;s[3]!==e?(r=e("Primary key"),s[3]=e,s[4]=r):r=s[4];let a;s[5]!==r?(a=h("span",{className:"flex items-center gap-1",children:[o,r]}),s[5]=r,s[6]=a):a=s[6];let l;s[7]===Symbol.for("react.memo_cache_sentinel")?(l=c(E,{className:"px-1 py-0 text-[10px] leading-tight",variant:"outline",children:"FK"}),s[7]=l):l=s[7];let d;s[8]!==e?(d=e("Foreign key"),s[8]=e,s[9]=d):d=s[9];let m;s[10]!==d?(m=h("span",{className:"flex items-center gap-1",children:[l,d]}),s[10]=d,s[11]=m):m=s[11];let i;return s[12]!==a||s[13]!==m?(i=h("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 rounded-xl border border-border bg-card/95 px-2.5 py-1.5 text-[11px] text-muted-foreground shadow-xs",children:[t,n,a,m]}),s[12]=a,s[13]=m,s[14]=i):i=s[14],i},$e=12,Te=s=>{const e=y(9),{containerRef:t,seedKey:n}=s,o=te(),{fitView:r}=se();let a;e[0]!==t||e[1]!==r||e[2]!==o?(a=()=>{if(!o)return;const d=()=>{le(r({duration:0,maxZoom:1.6,padding:.14}))};d();const m=t.current;if(m===null)return;const i=new ResizeObserver(()=>{d()});return i.observe(m),()=>{i.disconnect()}},e[0]=t,e[1]=r,e[2]=o,e[3]=a):a=e[3];let l;return e[4]!==t||e[5]!==r||e[6]!==o||e[7]!==n?(l=[t,r,o,n],e[4]=t,e[5]=r,e[6]=o,e[7]=n,e[8]=l):l=e[8],w(a,l),null},Ke=({columnsError:s,fill:e=!1,nodeClasses:t,tables:n,testIdPrefix:o})=>{const r=M(),[a,l]=D(Ee),[d,m]=D(""),i=_(()=>{const g=d.trim().toLowerCase();return n.filter(T=>a[T.tier]&&T.name.toLowerCase().includes(g))},[n,a,d]),f=_(()=>we(i,s??!1,t??Se),[i,s,t]),u=_(()=>Me(i),[i]),b=i.map(g=>g.name).join(","),[p,C,P]=q(f),[U,$,j]=Q(u),S=oe(null);w(()=>{C(f)},[f,C]),w(()=>{$(u)},[u,$]);const V=g=>{m(g.target.value)},W=()=>{l(g=>({...g,shard:!g.shard}))},Y=()=>{l(g=>({...g,global:!g.global}))};return n.length===0?c("section",{className:"flex flex-col gap-2","data-testid":`${o}-section`,children:c("p",{className:"text-sm text-muted-foreground","data-testid":`${o}-empty`,children:r("No tables to graph.")})}):c("section",{className:N("flex flex-col",e&&"min-h-0 flex-1"),"data-testid":`${o}-section`,children:c("div",{className:N("w-full overflow-hidden border border-border bg-muted/20",e?"min-h-0 flex-1":"h-[560px]"),"data-testid":`${o}-canvas`,ref:S,children:h(Z,{edges:U,elementsSelectable:!0,fitView:!0,minZoom:.2,nodes:p,nodesConnectable:!1,nodeTypes:ve,onEdgesChange:j,onNodesChange:P,children:[c(J,{}),c(k,{position:"top-left",children:h("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card/95 p-2 shadow-xs",children:[c(re,{"aria-label":r("Find table…"),className:"h-7 w-44 text-xs","data-testid":`${o}-find`,onChange:V,placeholder:r("Find table…"),value:d}),h("div",{"aria-label":r("Storage tiers"),className:"flex items-center gap-1.5",role:"group",children:[h(A,{"aria-pressed":a.shard,className:"gap-1.5","data-testid":`${o}-tier-shard`,onClick:W,size:"xs",type:"button",variant:a.shard?"default":"outline",children:[c("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:G}),x.shard.label]}),h(A,{"aria-pressed":a.global,className:"gap-1.5","data-testid":`${o}-tier-global`,onClick:Y,size:"xs",type:"button",variant:a.global?"default":"outline",children:[c("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:I}),x.global.label]})]})]})}),c(k,{position:"bottom-center",children:c(Ce,{})}),c(X,{showInteractive:!1}),i.length>$e&&c(ee,{className:"!border !border-border !bg-card",maskColor:"var(--color-muted)",nodeColor:"var(--color-muted-foreground)",nodeStrokeWidth:0,pannable:!0,zoomable:!0}),c(ae,{containerRef:S,filenameBase:`${o}-schema-diagram`,testIdPrefix:o}),c(Te,{containerRef:S,seedKey:b})]})})})};export{Ke as S};
|
|
2
|
+
import{c as y}from"react/compiler-runtime";import{Handle as L,Position as R,useNodesState as q,useEdgesState as Q,ReactFlow as Z,Background as J,Panel as k,Controls as X,MiniMap as ee,useNodesInitialized as te,useReactFlow as se}from"@xyflow/react";import{useState as D,useMemo as _,useRef as oe,useEffect as w}from"react";import{D as ae}from"./diagram-export-panel-Vdt-DZnO.mjs";import{S as ne,T as x}from"./storage-tier-C2mKwYRj.mjs";import{B as E}from"./badge-r_5B4LHP.mjs";import{B as A}from"./button-q0UYSmrn.mjs";import{I as re}from"./input-CXhxesPC.mjs";import{useT as M}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{f as le}from"./internal-hIuTpSbx.mjs";import{c as N}from"./utils-bhneXptQ.mjs";import{jsx as c,jsxs as h}from"react/jsx-runtime";function ie(s){const e=y(10);let t,n,o;e[0]!==s?({className:t,selected:o,...n}=s,e[0]=s,e[1]=t,e[2]=n,e[3]=o):(t=e[1],n=e[2],o=e[3]);const r=o===!0?"":void 0;let a;e[4]!==t?(a=N("rounded-md border border-border bg-card text-card-foreground shadow-sm transition-colors","data-[selected]:border-ring data-[selected]:ring-[3px] data-[selected]:ring-ring/30",t),e[4]=t,e[5]=a):a=e[5];let l;return e[6]!==n||e[7]!==r||e[8]!==a?(l=c("div",{"data-slot":"base-node","data-selected":r,className:a,...n}),e[6]=n,e[7]=r,e[8]=a,e[9]=l):l=e[9],l}function ce(s){const e=y(8);let t,n;e[0]!==s?({className:t,...n}=s,e[0]=s,e[1]=t,e[2]=n):(t=e[1],n=e[2]);let o;e[3]!==t?(o=N("flex items-center gap-2 rounded-t-md bg-muted/50 px-3 py-1.5",t),e[3]=t,e[4]=o):o=e[4];let r;return e[5]!==n||e[6]!==o?(r=c("div",{"data-slot":"base-node-header",className:o,...n}),e[5]=n,e[6]=o,e[7]=r):r=e[7],r}function de(s){const e=y(8);let t,n;e[0]!==s?({className:t,...n}=s,e[0]=s,e[1]=t,e[2]=n):(t=e[1],n=e[2]);let o;e[3]!==t?(o=N("flex flex-col",t),e[3]=t,e[4]=o):o=e[4];let r;return e[5]!==n||e[6]!==o?(r=c("div",{"data-slot":"base-node-content",className:o,...n}),e[5]=n,e[6]=o,e[7]=r):r=e[7],r}const me=3,fe=(s,e,t)=>{const n=e?s:s.slice(0,me),o=n.map(a=>JSON.stringify(a)).join(" | "),r=s.length-n.length;return r>0?`${o} ${t("+{count} more",{count:r})}`:o},H=(s,e,t)=>{const n=s.enumValues??[],o=n.length===0?s.type:fe(n,e,t),r=s.ref===void 0?o:`${o} → ${s.ref}`;return s.optional===!0?`${r}?`:r},ue=s=>{const e=y(23),{data:t,selected:n}=s,o=M();let r;e[0]!==t.label||e[1]!==t.loadError||e[2]!==o?(r=t.loadError===!0?c("span",{className:"px-3 py-1.5 text-xs text-destructive","data-testid":`sd-node-${t.label}-error`,children:o("Columns unavailable")}):c("span",{className:"px-3 py-1.5 text-xs text-muted-foreground",children:"—"}),e[0]=t.label,e[1]=t.loadError,e[2]=o,e[3]=r):r=e[3];const a=r,l=`sd-node-${t.label}`;let d;e[4]!==t.label?(d=c("span",{className:"truncate font-mono text-xs font-semibold",title:t.label,children:t.label}),e[4]=t.label,e[5]=d):d=e[5];let m;e[6]!==t.tier?(m=c("span",{className:"ms-auto",children:c(ne,{tier:t.tier})}),e[6]=t.tier,e[7]=m):m=e[7];let i;e[8]!==d||e[9]!==m?(i=h(ce,{children:[d,m]}),e[8]=d,e[9]=m,e[10]=i):i=e[10];let f;e[11]!==t.columns||e[12]!==t.label||e[13]!==a||e[14]!==o?(f=t.columns.length===0?a:t.columns.map(p=>h("div",{className:N("relative flex items-center gap-2 border-t border-border px-3 py-1.5 text-xs first:border-t-0",p.pk===!0&&"bg-muted/30"),"data-testid":`sd-col-${t.label}-${p.name}`,children:[c(L,{className:"!h-2 !w-2 !-left-1 !border-border !bg-muted-foreground/70",id:p.name,isConnectable:!1,position:R.Left,type:"target"}),c("span",{className:"truncate font-mono",title:p.name,children:p.name}),p.pk===!0&&c(E,{className:"px-1 py-0 text-[10px] leading-tight",variant:"secondary",children:"PK"}),p.ref!==void 0&&c(E,{className:"px-1 py-0 text-[10px] leading-tight",variant:"outline",children:"FK"}),c("span",{className:"ms-auto truncate text-muted-foreground",title:H(p,!0,o),children:H(p,!1,o)}),c(L,{className:"!h-2 !w-2 !-right-1 !border-border !bg-muted-foreground/70",id:p.name,isConnectable:!1,position:R.Right,type:"source"})]},p.name)),e[11]=t.columns,e[12]=t.label,e[13]=a,e[14]=o,e[15]=f):f=e[15];let u;e[16]!==f?(u=c(de,{children:f}),e[16]=f,e[17]=u):u=e[17];let b;return e[18]!==n||e[19]!==l||e[20]!==i||e[21]!==u?(b=h(ie,{className:"w-64 overflow-hidden","data-testid":l,selected:n,children:[i,u]}),e[18]=n,e[19]=l,e[20]=i,e[21]=u,e[22]=b):b=e[22],b},F=256,z=112,O=36,v=24,pe=480,he=1.4,ge=s=>{const e=Math.max(1,Math.round(Math.sqrt(he*s/(F+z))));return Math.max(pe,s/e)},be=38,xe=28,B=s=>be+Math.max(1,s)*xe,Ne=(s,e)=>{const t=new Map;for(const a of s)t.set(a,[]);for(const a of e)a.to!==a.from&&t.has(a.from)&&t.has(a.to)&&t.get(a.from)?.push(a.to);const n=new Map,o=new Set,r=a=>{const l=n.get(a);if(l!==void 0)return l;if(o.has(a))return 0;o.add(a);let d=0;for(const m of t.get(a)??[])d=Math.max(d,r(m)+1);return o.delete(a),n.set(a,d),d};for(const a of s)r(a);return n},ye=(s,e,t)=>{const n=Ne(s,e),o=new Map;for(const m of s){const i=n.get(m)??0,f=o.get(i);f===void 0?o.set(i,[m]):f.push(m)}const r=s.reduce((m,i)=>m+B(t.get(i)??0)+O,0),a=ge(r),l=[];let d=0;for(const m of[...o.keys()].toSorted((i,f)=>i-f)){let i=0,f=v;for(const u of o.get(m)??[]){const b=B(t.get(u)??0);f>v&&f+b>a&&(i+=1,f=v),l.push({name:u,x:v+(d+i)*(F+z),y:f}),f+=b+O}d+=i+1}return l},ve={databaseSchema:ue},G={backgroundColor:x.shard.color},I={backgroundColor:x.global.color},Ee={global:!0,shard:!0},Se={},_e=s=>{const e=s.find(t=>t.pk===!0)?.name;return e!==void 0?e:s.some(t=>t.name==="_id")?"_id":s.some(t=>t.name==="id")?"id":s[0]?.name??"_id"},K=s=>s.flatMap(e=>e.columns.filter(t=>t.ref!==void 0).map(t=>({column:t.name,from:e.name,to:t.ref}))),we=(s,e,t)=>{const n=s.map(l=>l.name),o=new Map(s.map(l=>[l.name,l.columns.length])),r=ye(n,K(s),o),a=new Map(s.map(l=>[l.name,l]));return r.flatMap(({name:l,x:d,y:m})=>{const i=a.get(l);return i===void 0?[]:[{className:t[l],data:{columns:i.columns,label:l,loadError:e,tier:i.tier},id:l,position:{x:d,y:m},type:"databaseSchema"}]})},Me=s=>{const e=new Map(s.map(t=>[t.name,t.columns]));return K(s).flatMap(t=>{const n=e.get(t.to)??[],o=e.get(t.from)??[],r=_e(n);return!n.some(a=>a.name===r)||!o.some(a=>a.name===t.column)?[]:[{id:`${t.from}.${t.column}->${t.to}`,source:t.to,sourceHandle:r,target:t.from,targetHandle:t.column}]})},Ce=()=>{const s=y(15),e=M();let t;s[0]===Symbol.for("react.memo_cache_sentinel")?(t=h("span",{className:"flex items-center gap-1",children:[c("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:G}),x.shard.label]}),s[0]=t):t=s[0];let n;s[1]===Symbol.for("react.memo_cache_sentinel")?(n=h("span",{className:"flex items-center gap-1",children:[c("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:I}),x.global.label]}),s[1]=n):n=s[1];let o;s[2]===Symbol.for("react.memo_cache_sentinel")?(o=c(E,{className:"px-1 py-0 text-[10px] leading-tight",variant:"secondary",children:"PK"}),s[2]=o):o=s[2];let r;s[3]!==e?(r=e("Primary key"),s[3]=e,s[4]=r):r=s[4];let a;s[5]!==r?(a=h("span",{className:"flex items-center gap-1",children:[o,r]}),s[5]=r,s[6]=a):a=s[6];let l;s[7]===Symbol.for("react.memo_cache_sentinel")?(l=c(E,{className:"px-1 py-0 text-[10px] leading-tight",variant:"outline",children:"FK"}),s[7]=l):l=s[7];let d;s[8]!==e?(d=e("Foreign key"),s[8]=e,s[9]=d):d=s[9];let m;s[10]!==d?(m=h("span",{className:"flex items-center gap-1",children:[l,d]}),s[10]=d,s[11]=m):m=s[11];let i;return s[12]!==a||s[13]!==m?(i=h("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 rounded-xl border border-border bg-card/95 px-2.5 py-1.5 text-[11px] text-muted-foreground shadow-xs",children:[t,n,a,m]}),s[12]=a,s[13]=m,s[14]=i):i=s[14],i},$e=12,Te=s=>{const e=y(9),{containerRef:t,seedKey:n}=s,o=te(),{fitView:r}=se();let a;e[0]!==t||e[1]!==r||e[2]!==o?(a=()=>{if(!o)return;const d=()=>{le(r({duration:0,maxZoom:1.6,padding:.14}))};d();const m=t.current;if(m===null)return;const i=new ResizeObserver(()=>{d()});return i.observe(m),()=>{i.disconnect()}},e[0]=t,e[1]=r,e[2]=o,e[3]=a):a=e[3];let l;return e[4]!==t||e[5]!==r||e[6]!==o||e[7]!==n?(l=[t,r,o,n],e[4]=t,e[5]=r,e[6]=o,e[7]=n,e[8]=l):l=e[8],w(a,l),null},Ke=({columnsError:s,fill:e=!1,nodeClasses:t,tables:n,testIdPrefix:o})=>{const r=M(),[a,l]=D(Ee),[d,m]=D(""),i=_(()=>{const g=d.trim().toLowerCase();return n.filter(T=>a[T.tier]&&T.name.toLowerCase().includes(g))},[n,a,d]),f=_(()=>we(i,s??!1,t??Se),[i,s,t]),u=_(()=>Me(i),[i]),b=i.map(g=>g.name).join(","),[p,C,P]=q(f),[U,$,j]=Q(u),S=oe(null);w(()=>{C(f)},[f,C]),w(()=>{$(u)},[u,$]);const V=g=>{m(g.target.value)},W=()=>{l(g=>({...g,shard:!g.shard}))},Y=()=>{l(g=>({...g,global:!g.global}))};return n.length===0?c("section",{className:"flex flex-col gap-2","data-testid":`${o}-section`,children:c("p",{className:"text-sm text-muted-foreground","data-testid":`${o}-empty`,children:r("No tables to graph.")})}):c("section",{className:N("flex flex-col",e&&"min-h-0 flex-1"),"data-testid":`${o}-section`,children:c("div",{className:N("w-full overflow-hidden border border-border bg-muted/20",e?"min-h-0 flex-1":"h-[560px]"),"data-testid":`${o}-canvas`,ref:S,children:h(Z,{edges:U,elementsSelectable:!0,fitView:!0,minZoom:.2,nodes:p,nodesConnectable:!1,nodeTypes:ve,onEdgesChange:j,onNodesChange:P,children:[c(J,{}),c(k,{position:"top-left",children:h("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card/95 p-2 shadow-xs",children:[c(re,{"aria-label":r("Find table…"),className:"h-7 w-44 text-xs","data-testid":`${o}-find`,onChange:V,placeholder:r("Find table…"),value:d}),h("div",{"aria-label":r("Storage tiers"),className:"flex items-center gap-1.5",role:"group",children:[h(A,{"aria-pressed":a.shard,className:"gap-1.5","data-testid":`${o}-tier-shard`,onClick:W,size:"xs",type:"button",variant:a.shard?"default":"outline",children:[c("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:G}),x.shard.label]}),h(A,{"aria-pressed":a.global,className:"gap-1.5","data-testid":`${o}-tier-global`,onClick:Y,size:"xs",type:"button",variant:a.global?"default":"outline",children:[c("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:I}),x.global.label]})]})]})}),c(k,{position:"bottom-center",children:c(Ce,{})}),c(X,{showInteractive:!1}),i.length>$e&&c(ee,{className:"!border !border-border !bg-card",maskColor:"var(--color-muted)",nodeColor:"var(--color-muted-foreground)",nodeStrokeWidth:0,pannable:!0,zoomable:!0}),c(ae,{containerRef:S,filenameBase:`${o}-schema-diagram`,testIdPrefix:o}),c(Te,{containerRef:S,seedKey:b})]})})})};export{Ke as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as k}from"react/compiler-runtime";import{AreaChart as R,CartesianGrid as g,XAxis as N,Area as B,LineChart as X,Line as $}from"recharts";import{useT as S}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{l as E}from"./internal-
|
|
1
|
+
import{c as k}from"react/compiler-runtime";import{AreaChart as R,CartesianGrid as g,XAxis as N,Area as B,LineChart as X,Line as $}from"recharts";import{useT as S}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{l as E}from"./internal-hIuTpSbx.mjs";import{E as H,X as _,B as j,T as G,C as O,a as A,b as K}from"./bar-chart-BCsEIQoQ.mjs";import{jsx as l,jsxs as T}from"react/jsx-runtime";import{c as V,a as z,b as L,e as F,d as I,T as M}from"./table-D0SBiDu-.mjs";import{C as U}from"./data-grid-B5m1OosL.mjs";const W=50,q={value:{colors:{dark:["var(--chart-1)"],light:["var(--chart-1)"]},label:"value"}},D=o=>{const e=o.columns.find(n=>o.rows.length>0&&o.rows.every(a=>typeof a[n]=="number"))??null;return{label:o.columns.find(n=>n!==e)??null,value:e}},J=o=>{const e=k(3),{data:t,kind:n}=o;let a;return e[0]!==t||e[1]!==n?(a=l(O,{className:"h-full w-full",config:q,children:n==="area"?T(R,{data:t,children:[l(g,{vertical:!1}),l(N,{axisLine:!1,dataKey:"label",tickLine:!1}),l(A,{content:l(K,{})}),l(B,{dataKey:"value",fill:"var(--color-value-0)",fillOpacity:.2,stroke:"var(--color-value-0)",type:"monotone"})]}):T(X,{data:t,children:[l(g,{vertical:!1}),l(N,{axisLine:!1,dataKey:"label",tickLine:!1}),l(A,{content:l(K,{})}),l($,{dataKey:"value",dot:!1,stroke:"var(--color-value-0)",strokeWidth:2,type:"monotone"})]})}),e[0]=t,e[1]=n,e[2]=a):a=e[2],a},oe=o=>{const e=k(21),{axes:t,kind:n,result:a}=o,u=S();let r;e[0]!==a?(r=D(a),e[0]=a,e[1]=r):r=e[1];const d=r;let m;e[2]!==a.columns?(m=new Set(a.columns),e[2]=a.columns,e[3]=m):m=e[3];const s=m,i=t!==void 0&&s.has(t.x)?t.x:d.label;let h;e[4]!==t?.y||e[5]!==s?(h=t?.y.find(c=>s.has(c)),e[4]=t?.y,e[5]=s,e[6]=h):h=e[6];const b=h,C=b??d.value;let w;e[7]!==i||e[8]!==a.rows||e[9]!==C?(w=C===null?[]:a.rows.slice(0,W).map((c,v)=>({label:i===null?`#${(v+1).toString()}`:E(c[i]),value:Number(c[C])||0})),e[7]=i,e[8]=a.rows,e[9]=C,e[10]=w):w=e[10];const x=w;if(C===null){let c;e[11]!==u?(c=u("No numeric column to chart."),e[11]=u,e[12]=c):c=e[12];let v;return e[13]!==c?(v=l("p",{className:"p-4 text-sm text-muted-foreground","data-testid":"sql-chart-empty",children:c}),e[13]=c,e[14]=v):v=e[14],v}const f=n??(t!==void 0&&b!==void 0?t.kind:"bar");let p;e[15]!==x||e[16]!==f?(p=f==="bar"?T(H,{className:"h-full w-full",config:q,data:x,children:[l(_,{dataKey:"label"}),l(j,{dataKey:"value"}),l(G,{})]}):l(J,{data:x,kind:f}),e[15]=x,e[16]=f,e[17]=p):p=e[17];let y;return e[18]!==f||e[19]!==p?(y=l("div",{className:"h-80 w-full p-3","data-chart-kind":f,"data-testid":"sql-chart",children:p}),e[18]=f,e[19]=p,e[20]=y):y=e[20],y},ne=o=>{const e=k(19),{result:t}=o,n=S();if(t.columns.length===0){let s;e[0]!==t.rowCount||e[1]!==n?(s=n("{count} rows",{count:t.rowCount}),e[0]=t.rowCount,e[1]=n,e[2]=s):s=e[2];let i;return e[3]!==s?(i=l("p",{className:"p-4 text-sm text-muted-foreground",children:s}),e[3]=s,e[4]=i):i=e[4],i}let a;e[5]!==t.columns?(a=t.columns.map(P),e[5]=t.columns,e[6]=a):a=e[6];let u;e[7]!==a?(u=l(z,{className:"sticky top-0 z-10 bg-muted",children:l(L,{children:a})}),e[7]=a,e[8]=u):u=e[8];let r;if(e[9]!==t.columns||e[10]!==t.rows){let s;e[12]!==t.columns?(s=(i,h)=>l(L,{"data-testid":"sql-row",children:t.columns.map(b=>l(F,{className:"max-w-md truncate font-mono text-xs",children:l(U,{value:i[b]})},b))},h),e[12]=t.columns,e[13]=s):s=e[13],r=t.rows.map(s),e[9]=t.columns,e[10]=t.rows,e[11]=r}else r=e[11];let d;e[14]!==r?(d=l(I,{children:r}),e[14]=r,e[15]=d):d=e[15];let m;return e[16]!==u||e[17]!==d?(m=T(M,{"data-testid":"sql-rows",children:[u,d]}),e[16]=u,e[17]=d,e[18]=m):m=e[18],m};function P(o){return l(V,{children:o},o)}export{oe as S,ne as a};
|