@lunora/studio 1.0.0-alpha.79 → 1.0.0-alpha.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +28 -14
- package/dist/index.js +1 -1
- package/dist/mount.d.ts +1 -1
- package/dist/mount.js +1 -1
- package/dist/packem_chunks/ApiTab.js +1 -1
- package/dist/packem_chunks/AuditPanel.js +1 -1
- package/dist/packem_chunks/DeploymentHealthPanel.js +1 -1
- package/dist/packem_chunks/ExportImportPanel.js +3 -3
- package/dist/packem_chunks/FileBrowser.js +4 -4
- package/dist/packem_chunks/FunctionRunner.js +1 -1
- package/dist/packem_chunks/FunctionStatsPanel.js +1 -1
- package/dist/packem_chunks/HealthPanel.js +1 -1
- package/dist/packem_chunks/InsightsPanel.js +1 -1
- package/dist/packem_chunks/LogsPanel.js +1 -1
- package/dist/packem_chunks/MailPanel.js +2 -2
- package/dist/packem_chunks/MetricsPanel.js +1 -1
- package/dist/packem_chunks/NotificationsPanel.js +1 -1
- package/dist/packem_chunks/PitrPanel.js +1 -1
- package/dist/packem_chunks/SchemaViewer.js +1 -2
- package/dist/packem_chunks/SecurityAdvisorPanel.js +1 -1
- package/dist/packem_chunks/SettingsPanel.js +1 -1
- package/dist/packem_chunks/SqlEditorPanel.js +6 -4
- package/dist/packem_chunks/TableEditor.js +1 -1
- package/dist/packem_chunks/agents-panel.js +1 -1
- package/dist/packem_chunks/analytics-panel.js +1 -1
- package/dist/packem_chunks/auth-audit-panel.js +1 -1
- package/dist/packem_chunks/auth-config-panel.js +1 -1
- package/dist/packem_chunks/auth-sessions-panel.js +1 -1
- package/dist/packem_chunks/containers-panel.js +1 -1
- package/dist/packem_chunks/dashboards-panel.js +1 -1
- package/dist/packem_chunks/fanout-panel.js +1 -1
- package/dist/packem_chunks/flags-panel.js +1 -1
- package/dist/packem_chunks/issues-panel.js +1 -1
- package/dist/packem_chunks/kv-browser.js +1 -1
- package/dist/packem_chunks/log-drains-panel.js +4 -4
- package/dist/packem_chunks/migrations-route.js +1 -0
- package/dist/packem_chunks/organizations-panel.js +1 -1
- package/dist/packem_chunks/payments-panel.js +1 -1
- package/dist/packem_chunks/permissions-panel.js +1 -1
- package/dist/packem_chunks/queues-panel.js +1 -1
- package/dist/packem_chunks/rls-panel.js +1 -1
- package/dist/packem_chunks/schedule-panel.js +1 -1
- package/dist/packem_chunks/sparkline.js +1 -1
- package/dist/packem_chunks/storage-rules-panel.js +1 -1
- package/dist/packem_chunks/subscriptions-panel.js +1 -1
- package/dist/packem_chunks/sync-client-panel.js +1 -1
- package/dist/packem_chunks/traces-panel.js +1 -1
- package/dist/packem_chunks/users-panel.js +1 -1
- package/dist/packem_chunks/vector-browser.js +1 -1
- package/dist/packem_chunks/workflows-panel.js +1 -1
- package/dist/packem_shared/ADMIN_FUNCTIONS-BnD4aovm.js +1 -0
- package/dist/packem_shared/ApiDocsPanel-DfUQ1ZAF.js +2 -0
- package/dist/packem_shared/{ApiReferencePanel-C42v1jr6.js → ApiReferencePanel-9q8BbJl-.js} +1 -1
- package/dist/packem_shared/CommandPalette--SQwfTW1.js +1 -0
- package/dist/packem_shared/DataBrowser-CuRlztBz.js +1 -0
- package/dist/packem_shared/DataFilters-B26ZeqBZ.js +1 -0
- package/dist/packem_shared/GlobalDataBrowser-DB-vQ2_H.js +1 -0
- package/dist/packem_shared/HomePanel-Dcs4a3Ax.js +1 -0
- package/dist/packem_shared/MigrationsPanel-C2OnsqRb.js +1 -0
- package/dist/packem_shared/{OpenRpcReferencePanel-sGsIgYWj.js → OpenRpcReferencePanel-qOZcWXMs.js} +1 -1
- package/dist/packem_shared/ScheduledJobs-D8kBZWBu.js +1 -0
- package/dist/packem_shared/Studio-B26_pT8J.js +1 -0
- package/dist/packem_shared/StudioApp-bXhJeLlZ.js +1 -0
- package/dist/packem_shared/advisor-view-Pa8HLtBv.js +1 -0
- package/dist/packem_shared/{app.d-bRPJhby-.d.ts → app.d-DW7yZsfu.d.ts} +1 -3
- package/dist/packem_shared/bar-chart-DraN_srt.js +9 -0
- package/dist/packem_shared/data-grid-DcxyIXwG.js +1 -0
- package/dist/packem_shared/data-view-params-ClrV7XgF.js +1 -0
- package/dist/packem_shared/error-alert-t6cpEi0z.js +1 -0
- package/dist/packem_shared/grid-features-jnrD0SpX.js +6 -0
- package/dist/packem_shared/{home-panel-Cm88Nvqh.js → home-panel-CU6MWLHG.js} +2 -2
- package/dist/packem_shared/{internal-AtZ4bTal.js → internal-BSIsQVC6.js} +1 -1
- package/dist/packem_shared/live-status-CmuRLFKf.js +1 -0
- package/dist/packem_shared/operation-console-provider-BMJNtiyB.js +1 -0
- package/dist/packem_shared/recording-client-DRAZEmzE.js +1 -0
- package/dist/packem_shared/reference-view-DnYYWr7I.js +12 -0
- package/dist/packem_shared/result-chart-DzJOVsaw.js +1 -0
- package/dist/packem_shared/schema-diagram-cg-bz_VL.js +2 -0
- package/dist/packem_shared/{sparkline-DtcZoU48.js → sparkline-CgjeUU2I.js} +1 -1
- package/dist/packem_shared/studio-q-C-acL7.js +2 -0
- package/dist/packem_shared/table-list-sidebar-BFkSQwlB.js +1 -0
- package/dist/packem_shared/use-admin-query-QJ-ibl5u.js +1 -0
- package/dist/packem_shared/use-async-submit-q3ymBJkD.js +1 -0
- package/dist/packem_shared/{use-auth-config-9S_K_W-G.js → use-auth-config-BObBpdsi.js} +1 -1
- package/dist/packem_shared/use-sql-assistant-CHEu2-Rk.js +1 -0
- package/dist/standalone/chunk-2GA4SHO7.js +1 -0
- package/dist/standalone/{chunk-NG6LYBPJ.js → chunk-2VDFV5TD.js} +1 -1
- package/dist/standalone/chunk-2WOIRKEI.js +1 -0
- package/dist/standalone/chunk-33CL6OHR.js +1 -0
- package/dist/standalone/{chunk-EIT7ERYE.js → chunk-34D36UCW.js} +1 -1
- package/dist/standalone/chunk-3C3CG7ZK.js +1 -0
- package/dist/standalone/{chunk-6CULAILE.js → chunk-3O3HAXW7.js} +1 -1
- package/dist/standalone/{chunk-LSEZN2ZL.js → chunk-3STOIE7Q.js} +1 -1
- package/dist/standalone/chunk-53WEPGUD.js +1 -0
- package/dist/standalone/chunk-5CVJS7ON.js +1 -0
- package/dist/standalone/chunk-6IKEW5LG.js +1 -0
- package/dist/standalone/chunk-6LNCYDZO.js +1 -0
- package/dist/standalone/chunk-6NY7SPDL.js +1 -0
- package/dist/standalone/chunk-6PNPIW6I.js +2 -0
- package/dist/standalone/{chunk-AVZGVZZ7.js → chunk-6VAKZALJ.js} +1 -1
- package/dist/standalone/chunk-6YI4WJO4.js +1 -0
- package/dist/standalone/{chunk-HYT2ZUNP.js → chunk-6YTSSIEJ.js} +2 -2
- package/dist/standalone/{chunk-KYF2E5CJ.js → chunk-7LWMHTJ3.js} +1 -1
- package/dist/standalone/chunk-A74VSSA2.js +4 -0
- package/dist/standalone/chunk-CCVXYYPJ.js +1 -0
- package/dist/standalone/chunk-CT5MMH4O.js +1 -0
- package/dist/standalone/chunk-CTNB2KIA.js +1 -0
- package/dist/standalone/chunk-CU55Y5TV.js +62 -0
- package/dist/standalone/chunk-D2RKH6JK.js +1 -0
- package/dist/standalone/chunk-E3NMX2VU.js +4 -0
- package/dist/standalone/chunk-FNPJ7GJZ.js +1 -0
- package/dist/standalone/chunk-FOBRNWBG.js +3 -0
- package/dist/standalone/chunk-G6PSMGLD.js +1 -0
- package/dist/standalone/chunk-GAX5IZYG.js +8 -0
- package/dist/standalone/chunk-GB6U2BPU.js +1 -0
- package/dist/standalone/chunk-GEDMLM4A.js +6 -0
- package/dist/standalone/chunk-GXSZH7VJ.js +13 -0
- package/dist/standalone/chunk-GYKVBKT5.js +1 -0
- package/dist/standalone/chunk-H6YOWRFB.js +1 -0
- package/dist/standalone/chunk-HJ3E4YF5.js +1 -0
- package/dist/standalone/chunk-HJD2YUQS.js +1 -0
- package/dist/standalone/chunk-IHQC7J35.js +1 -0
- package/dist/standalone/chunk-JLOWAJRR.js +1 -0
- package/dist/standalone/chunk-JRMMYIAF.js +1 -0
- package/dist/standalone/{chunk-W6TE2I2D.js → chunk-KC44QCN6.js} +1 -1
- package/dist/standalone/chunk-KJB7YAKB.js +1 -0
- package/dist/standalone/chunk-KLQYC6CC.js +1 -0
- package/dist/standalone/{chunk-XQGANNLS.js → chunk-KZ3ALMMP.js} +1 -1
- package/dist/standalone/chunk-L7R74G63.js +1 -0
- package/dist/standalone/{chunk-3RTTXLMU.js → chunk-OY2RVUZL.js} +1 -1
- package/dist/standalone/chunk-P4YLIBCN.js +1 -0
- package/dist/standalone/chunk-PZVU2QMX.js +1 -0
- package/dist/standalone/{chunk-PRJ4RJDU.js → chunk-Q7O6B7WC.js} +1 -1
- package/dist/standalone/chunk-QLQADHFE.js +1 -0
- package/dist/standalone/{chunk-7LQWFOEU.js → chunk-QXXIJAD5.js} +1 -1
- package/dist/standalone/chunk-QZGTH6WH.js +1 -0
- package/dist/standalone/chunk-RJP3WBZ4.js +1 -0
- package/dist/standalone/chunk-RNL6BSFM.js +1 -0
- package/dist/standalone/chunk-RNRJKBY3.js +4 -0
- package/dist/standalone/{chunk-7YEFOSPH.js → chunk-RQ7AFLIV.js} +1 -1
- package/dist/standalone/chunk-S252DAFP.js +1 -0
- package/dist/standalone/chunk-S2VVR7HI.js +1 -0
- package/dist/standalone/chunk-SKW6J4VW.js +1 -0
- package/dist/standalone/chunk-T7IUZIF4.js +1 -0
- package/dist/standalone/chunk-TTGOOYLF.js +1 -0
- package/dist/standalone/chunk-U6TNNM5U.js +1 -0
- package/dist/standalone/chunk-VHWOCPRK.js +1 -0
- package/dist/standalone/chunk-W6SAOXGH.js +6 -0
- package/dist/standalone/{chunk-YCRMVBPW.js → chunk-WBYSSCV2.js} +1 -1
- package/dist/standalone/{chunk-LFXFP4IF.js → chunk-X665E2HU.js} +1 -1
- package/dist/standalone/chunk-XDAT7LHC.js +1 -0
- package/dist/standalone/chunk-XS5LDR52.js +1 -0
- package/dist/standalone/chunk-Y5Y7DHFW.js +1 -0
- package/dist/standalone/chunk-YJYTMQJI.js +1 -0
- package/dist/standalone/chunk-Z2V42P7J.js +1 -0
- package/dist/standalone/studio.js +5 -5
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/packem_chunks/MigrationsPanel.js +0 -1
- package/dist/packem_shared/ADMIN_FUNCTIONS-CpgIo9pj.js +0 -1
- package/dist/packem_shared/ApiDocsPanel-CjdsxN1t.js +0 -2
- package/dist/packem_shared/CommandPalette-CVIaY3j8.js +0 -1
- package/dist/packem_shared/DataBrowser-Bfstz_au.js +0 -1
- package/dist/packem_shared/DataFilters-Csb30F0C.js +0 -1
- package/dist/packem_shared/GlobalDataBrowser-RLJ6NvOs.js +0 -1
- package/dist/packem_shared/HomePanel-B8EFM4u3.js +0 -1
- package/dist/packem_shared/ScheduledJobs-DUbo6epc.js +0 -1
- package/dist/packem_shared/Studio-BDtS9C5g.js +0 -1
- package/dist/packem_shared/StudioApp-DjLzIO9E.js +0 -1
- package/dist/packem_shared/advisor-view-DaCX9Jy5.js +0 -1
- package/dist/packem_shared/bar-chart-AryFCeoa.js +0 -9
- package/dist/packem_shared/data-grid-BMBKzMEJ.js +0 -1
- package/dist/packem_shared/data-view-params-C8T3bW1z.js +0 -1
- package/dist/packem_shared/error-alert-B59DnrDI.js +0 -1
- package/dist/packem_shared/grid-features-uZCUj955.js +0 -6
- package/dist/packem_shared/live-status-CGW2JHf_.js +0 -1
- package/dist/packem_shared/reference-view-KvhektwF.js +0 -12
- package/dist/packem_shared/result-chart-CwKhhKM0.js +0 -1
- package/dist/packem_shared/studio-BmWFd-Rz.js +0 -2
- package/dist/packem_shared/table-list-sidebar-CMCcNALK.js +0 -1
- package/dist/packem_shared/use-admin-query-Di3fLE8H.js +0 -1
- package/dist/packem_shared/use-async-submit-DLNCqLFq.js +0 -1
- package/dist/standalone/chunk-2SHUN7KF.js +0 -1
- package/dist/standalone/chunk-2Y36BVVM.js +0 -4
- package/dist/standalone/chunk-3EXLKL6V.js +0 -1
- package/dist/standalone/chunk-3KAERFMC.js +0 -1
- package/dist/standalone/chunk-4XDMVUS5.js +0 -1
- package/dist/standalone/chunk-5RF4QDDA.js +0 -6
- package/dist/standalone/chunk-5YWJNF5X.js +0 -1
- package/dist/standalone/chunk-66YJ3IOZ.js +0 -1
- package/dist/standalone/chunk-6KHEBRBB.js +0 -1
- package/dist/standalone/chunk-6WCIFGDW.js +0 -1
- package/dist/standalone/chunk-7RG3AKPY.js +0 -1
- package/dist/standalone/chunk-A2FPLOMJ.js +0 -1
- package/dist/standalone/chunk-AADXUXZO.js +0 -1
- package/dist/standalone/chunk-ARI4JTIH.js +0 -1
- package/dist/standalone/chunk-BDO4J5AP.js +0 -1
- package/dist/standalone/chunk-BMQJ4CAO.js +0 -1
- package/dist/standalone/chunk-CMUP7HPS.js +0 -1
- package/dist/standalone/chunk-CP7AUUOU.js +0 -1
- package/dist/standalone/chunk-DX3RMFQU.js +0 -8
- package/dist/standalone/chunk-E2CJUP53.js +0 -13
- package/dist/standalone/chunk-FLYO3XY5.js +0 -1
- package/dist/standalone/chunk-FWCKM2CU.js +0 -1
- package/dist/standalone/chunk-GITJXQOS.js +0 -4
- package/dist/standalone/chunk-GP6IRITM.js +0 -1
- package/dist/standalone/chunk-GXU3ATKS.js +0 -1
- package/dist/standalone/chunk-H5Y5NQPL.js +0 -1
- package/dist/standalone/chunk-HALNNKTC.js +0 -1
- package/dist/standalone/chunk-HK4OVYG3.js +0 -1
- package/dist/standalone/chunk-HQEMYD2K.js +0 -1
- package/dist/standalone/chunk-I4WGRDL2.js +0 -1
- package/dist/standalone/chunk-ISZSYNTI.js +0 -4
- package/dist/standalone/chunk-JWG3VRGB.js +0 -1
- package/dist/standalone/chunk-KDYNM3GV.js +0 -1
- package/dist/standalone/chunk-KP6JQSH2.js +0 -4
- package/dist/standalone/chunk-LLXFYRGQ.js +0 -1
- package/dist/standalone/chunk-LU3GW7HI.js +0 -1
- package/dist/standalone/chunk-M536Y2KX.js +0 -1
- package/dist/standalone/chunk-MVGE3JJN.js +0 -1
- package/dist/standalone/chunk-MXSHWB3M.js +0 -1
- package/dist/standalone/chunk-NL2DZKFI.js +0 -1
- package/dist/standalone/chunk-OGVCXKRL.js +0 -2
- package/dist/standalone/chunk-OPC233PZ.js +0 -1
- package/dist/standalone/chunk-P4CWOYFL.js +0 -1
- package/dist/standalone/chunk-PUY3YDXI.js +0 -1
- package/dist/standalone/chunk-QZMR6MUG.js +0 -1
- package/dist/standalone/chunk-WCWYSOCN.js +0 -62
- package/dist/standalone/chunk-WEO3YVP6.js +0 -3
- package/dist/standalone/chunk-X2FQ6B5V.js +0 -1
- package/dist/standalone/chunk-XIZNYKOD.js +0 -1
- package/dist/standalone/chunk-XS6Q6GGV.js +0 -1
- package/dist/standalone/chunk-Y3CQDULJ.js +0 -1
- package/dist/standalone/chunk-Z2JPEI2V.js +0 -1
- /package/dist/standalone/{chunk-4CGALXS3.js → chunk-OG4N2XHD.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as _t}from"./chunk-GAX5IZYG.js";import{a as ut,b as bt}from"./chunk-GMR677FL.js";import"./chunk-KZ3ALMMP.js";import"./chunk-SD4BERSA.js";import"./chunk-IC4L6G56.js";import"./chunk-7LWMHTJ3.js";import"./chunk-RQ7AFLIV.js";import"./chunk-BGBLQ563.js";import"./chunk-IVFHIQOT.js";import"./chunk-4UOFSGUS.js";import{e as yt}from"./chunk-SMIESS7P.js";import{a as kt}from"./chunk-LFKCLLPT.js";import"./chunk-T6VMSOBB.js";import{a as ot,b as it,c as dt,d as ct,e as mt}from"./chunk-UZERI5YC.js";import{a as we}from"./chunk-5Y3QLNWX.js";import"./chunk-QBWRC5YX.js";import{a as wt}from"./chunk-X665E2HU.js";import{b as Ct}from"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import{R as Ye}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{c as G}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as Ze}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as at}from"./chunk-2WOIRKEI.js";import{f as vt}from"./chunk-EN2QAEO4.js";import"./chunk-XBDKZZ67.js";import{a as Nt}from"./chunk-XQCVZAGU.js";import{d as gt,f as et,g as tt,h as lt,m as M}from"./chunk-OG4N2XHD.js";import"./chunk-AADILRJW.js";import{a as n,e as pt,f as Ot,g as Pt,h as Et,j as ft}from"./chunk-3XIESWL4.js";var Le=pt(Pt(),1);var u=pt(Ot(),1);var t=pt(Et(),1);var Lt="/__lunora/schema-edit",Gt=n(async r=>{let e=await fetch(Lt,{body:JSON.stringify(r),headers:{"Content-Type":"application/json","X-Lunora-Studio":"1"},method:"POST"}),h=await e.json();return h.needsMigration===!0?{kind:"needs-migration",message:h.message??"This edit needs a migration."}:e.ok&&h.tables!==void 0?{diagnostics:h.diagnostics??[],kind:"ok",tables:h.tables}:{kind:"error",message:h.error??`schema edit failed (${String(e.status)})`}},"Pt"),Mt=[{label:"string",validator:"v.string()"},{label:"number",validator:"v.number()"},{label:"boolean",validator:"v.boolean()"},{label:"bigint",validator:"v.int64()"},{label:"bytes",validator:"v.bytes()"},{label:"any",validator:"v.any()"}],Rt="v.string()",Bt=n(r=>r.split(",").map(e=>e.trim()).filter(e=>e!==""),"Dt"),Dt=n(r=>{let e=(0,Le.c)(116),{onApplied:h,tableNames:i}=r,l=gt(),o=yt(),[s,m]=(0,u.useState)(null),[f,d]=(0,u.useState)(!1),[y,g]=(0,u.useState)(null),[C,c]=(0,u.useState)(""),[k,R]=(0,u.useState)(""),[H,Ge]=(0,u.useState)(Rt),[N,nt]=(0,u.useState)(i[0]??""),[O,Me]=(0,u.useState)(""),[X,ce]=(0,u.useState)(""),[Z,Ae]=(0,u.useState)(!1),ee;e[0]===Symbol.for("react.memo_cache_sentinel")?(ee=n(()=>{m(null),c(""),R(""),Me(""),ce(""),Ae(!1)},"ee"),e[0]=ee):ee=e[0];let je=ee,me;e[1]!==h?(me=n(async v=>{d(!0),g(null);try{let E=await Gt(v);g(E),E.kind==="ok"&&(h(E.tables),je())}catch(E){let ie=E;g({kind:"error",message:ie instanceof Error?ie.message:String(ie)})}d(!1)},"me"),e[1]=h,e[2]=me):me=e[2];let S=me,qe;e[3]!==S||e[4]!==C?(qe=n(()=>{M(S({kind:"addTable",table:C.trim()}))},"je"),e[3]=S,e[4]=C,e[5]=qe):qe=e[5];let x=qe,Fe;e[6]!==k||e[7]!==S||e[8]!==N||e[9]!==H?(Fe=n(()=>{M(S({column:k.trim(),kind:"addOptionalColumn",table:N,validator:H}))},"Fe"),e[6]=k,e[7]=S,e[8]=N,e[9]=H,e[10]=Fe):Fe=e[10];let w=Fe,ke;e[11]!==X||e[12]!==O||e[13]!==S||e[14]!==N||e[15]!==Z?(ke=n(()=>{M(S({fields:Bt(X),kind:"addIndex",name:O.trim(),table:N,unique:Z}))},"ke"),e[11]=X,e[12]=O,e[13]=S,e[14]=N,e[15]=Z,e[16]=ke):ke=e[16];let _e=ke,B;e[17]===Symbol.for("react.memo_cache_sentinel")?(B=n(()=>{g(null),m("addTable")},"D"),e[17]=B):B=e[17];let ht=B,D;e[18]===Symbol.for("react.memo_cache_sentinel")?(D=n(()=>{g(null),m("addColumn")},"M"),e[18]=D):D=e[18];let st=D,ue;e[19]===Symbol.for("react.memo_cache_sentinel")?(ue=n(()=>{g(null),m("addIndex")},"ue"),e[19]=ue):ue=e[19];let he=ue,pe;e[20]!==l?(pe=n(()=>{m("destructive"),g({kind:"needs-migration",message:l("This edit changes stored data and must go through a migration. Review the migration before applying.")})},"pe"),e[20]=l,e[21]=pe):pe=e[21];let Se=pe,fe;e[22]===Symbol.for("react.memo_cache_sentinel")?(fe=n(v=>{c(v.target.value)},"fe"),e[22]=fe):fe=e[22];let Re=fe,ge;e[23]===Symbol.for("react.memo_cache_sentinel")?(ge=n(v=>{R(v.target.value)},"ge"),e[23]=ge):ge=e[23];let Be=ge,be;e[24]===Symbol.for("react.memo_cache_sentinel")?(be=n(v=>{Ge(v.target.value)},"be"),e[24]=be):be=e[24];let xe=be,ve;e[25]===Symbol.for("react.memo_cache_sentinel")?(ve=n(v=>{nt(v.target.value)},"ve"),e[25]=ve):ve=e[25];let De=ve,Oe;e[26]===Symbol.for("react.memo_cache_sentinel")?(Oe=n(v=>{Me(v.target.value)},"qe"),e[26]=Oe):Oe=e[26];let Ue=Oe,ye;e[27]===Symbol.for("react.memo_cache_sentinel")?(ye=n(v=>{ce(v.target.value)},"ye"),e[27]=ye):ye=e[27];let Ve=ye,Ne;e[28]===Symbol.for("react.memo_cache_sentinel")?(Ne=n(v=>{Ae(v.target.checked)},"Ne"),e[28]=Ne):Ne=e[28];let Je=Ne,Ce;e[29]!==o?(Ce=n(()=>{M(o({to:"/migrations"}))},"we"),e[29]=o,e[30]=Ce):Ce=e[30];let P=Ce,U;e[31]!==l?(U=l("Edit schema"),e[31]=l,e[32]=U):U=e[32];let te;e[33]!==U?(te=(0,t.jsx)(dt,{children:U}),e[33]=U,e[34]=te):te=e[34];let V;e[35]!==l?(V=l("Adds a table, column, or index to lunora/schema.ts and reruns codegen."),e[35]=l,e[36]=V):V=e[36];let T;e[37]!==V?(T=(0,t.jsx)(ct,{children:V}),e[37]=V,e[38]=T):T=e[38];let J;e[39]!==te||e[40]!==T?(J=(0,t.jsxs)(it,{children:[te,T]}),e[39]=te,e[40]=T,e[41]=J):J=e[41];let le=s==="addTable"?"default":"outline",K;e[42]!==l?(K=l("Add table"),e[42]=l,e[43]=K):K=e[43];let Te;e[44]!==le||e[45]!==K?(Te=(0,t.jsx)(G,{"data-testid":"sc-editor-add-table",onClick:ht,size:"xs",type:"button",variant:le,children:K}),e[44]=le,e[45]=K,e[46]=Te):Te=e[46];let Ie=i.length===0,He=s==="addColumn"?"default":"outline",Q;e[47]!==l?(Q=l("Add column"),e[47]=l,e[48]=Q):Q=e[48];let ze;e[49]!==Ie||e[50]!==He||e[51]!==Q?(ze=(0,t.jsx)(G,{"data-testid":"sc-editor-add-column",disabled:Ie,onClick:st,size:"xs",type:"button",variant:He,children:Q}),e[49]=Ie,e[50]=He,e[51]=Q,e[52]=ze):ze=e[52];let $e=i.length===0,Pe=s==="addIndex"?"default":"outline",I;e[53]!==l?(I=l("Add index"),e[53]=l,e[54]=I):I=e[54];let W;e[55]!==$e||e[56]!==Pe||e[57]!==I?(W=(0,t.jsx)(G,{"data-testid":"sc-editor-add-index",disabled:$e,onClick:he,size:"xs",type:"button",variant:Pe,children:I}),e[55]=$e,e[56]=Pe,e[57]=I,e[58]=W):W=e[58];let Ee=i.length===0,ae=s==="destructive"?"default":"ghost",z;e[59]!==l?(z=l("Rename / drop / change type\u2026"),e[59]=l,e[60]=z):z=e[60];let ne;e[61]!==Se||e[62]!==Ee||e[63]!==ae||e[64]!==z?(ne=(0,t.jsx)(G,{"data-testid":"sc-editor-destructive",disabled:Ee,onClick:Se,size:"xs",type:"button",variant:ae,children:z}),e[61]=Se,e[62]=Ee,e[63]=ae,e[64]=z,e[65]=ne):ne=e[65];let se;e[66]!==Te||e[67]!==ze||e[68]!==W||e[69]!==ne?(se=(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[Te,ze,W,ne]}),e[66]=Te,e[67]=ze,e[68]=W,e[69]=ne,e[70]=se):se=e[70];let $;e[71]!==f||e[72]!==s||e[73]!==x||e[74]!==l||e[75]!==C?($=s==="addTable"&&(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-end gap-2","data-testid":"sc-editor-table-form",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(we,{htmlFor:"sc-editor-table-name",children:l("Table name")}),(0,t.jsx)(Ye,{"data-testid":"sc-editor-table-name",id:"sc-editor-table-name",onChange:Re,value:C})]}),(0,t.jsx)(G,{"data-testid":"sc-editor-table-apply",disabled:f||C.trim()==="",onClick:x,size:"xs",type:"button",children:l(f?"Applying\u2026":"Apply")}),(0,t.jsx)(G,{onClick:je,size:"xs",type:"button",variant:"ghost",children:l("Cancel")})]}),e[71]=f,e[72]=s,e[73]=x,e[74]=l,e[75]=C,e[76]=$):$=e[76];let A;e[77]!==f||e[78]!==k||e[79]!==s||e[80]!==w||e[81]!==l||e[82]!==i||e[83]!==N||e[84]!==H?(A=s==="addColumn"&&(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-end gap-2","data-testid":"sc-editor-column-form",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(we,{htmlFor:"sc-editor-column-table",children:l("Table name")}),(0,t.jsx)("select",{className:"h-8 rounded-md border border-input bg-transparent px-2 text-xs","data-testid":"sc-editor-column-table",id:"sc-editor-column-table",onChange:De,value:N,children:i.map(Ut)})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(we,{htmlFor:"sc-editor-column-name",children:l("Column name")}),(0,t.jsx)(Ye,{"data-testid":"sc-editor-column-name",id:"sc-editor-column-name",onChange:Be,value:k})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(we,{htmlFor:"sc-editor-column-type",children:l("Column type")}),(0,t.jsx)("select",{className:"h-8 rounded-md border border-input bg-transparent px-2 text-xs","data-testid":"sc-editor-column-type",id:"sc-editor-column-type",onChange:xe,value:H,children:Mt.map(Vt)})]}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:l("Optional")}),(0,t.jsx)(G,{"data-testid":"sc-editor-column-apply",disabled:f||k.trim()===""||N==="",onClick:w,size:"xs",type:"button",children:l(f?"Applying\u2026":"Apply")}),(0,t.jsx)(G,{onClick:je,size:"xs",type:"button",variant:"ghost",children:l("Cancel")})]}),e[77]=f,e[78]=k,e[79]=s,e[80]=w,e[81]=l,e[82]=i,e[83]=N,e[84]=H,e[85]=A):A=e[85];let j;e[86]!==f||e[87]!==X||e[88]!==O||e[89]!==s||e[90]!==_e||e[91]!==l||e[92]!==i||e[93]!==N||e[94]!==Z?(j=s==="addIndex"&&(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-end gap-2","data-testid":"sc-editor-index-form",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(we,{htmlFor:"sc-editor-index-table",children:l("Table name")}),(0,t.jsx)("select",{className:"h-8 rounded-md border border-input bg-transparent px-2 text-xs","data-testid":"sc-editor-index-table",id:"sc-editor-index-table",onChange:De,value:N,children:i.map(Jt)})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(we,{htmlFor:"sc-editor-index-name",children:l("Index name")}),(0,t.jsx)(Ye,{"data-testid":"sc-editor-index-name",id:"sc-editor-index-name",onChange:Ue,value:O})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(we,{htmlFor:"sc-editor-index-fields",children:l("Index fields (comma-separated)")}),(0,t.jsx)(Ye,{"data-testid":"sc-editor-index-fields",id:"sc-editor-index-fields",onChange:Ve,value:X})]}),(0,t.jsxs)(we,{className:"flex items-center gap-1 text-xs",htmlFor:"sc-editor-index-unique",children:[(0,t.jsx)("input",{checked:Z,"data-testid":"sc-editor-index-unique",id:"sc-editor-index-unique",onChange:Je,type:"checkbox"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:l("Unique")})]}),(0,t.jsx)(G,{"data-testid":"sc-editor-index-apply",disabled:f||O.trim()===""||X.trim()==="",onClick:_e,size:"xs",type:"button",children:l(f?"Applying\u2026":"Apply")}),(0,t.jsx)(G,{onClick:je,size:"xs",type:"button",variant:"ghost",children:l("Cancel")})]}),e[86]=f,e[87]=X,e[88]=O,e[89]=s,e[90]=_e,e[91]=l,e[92]=i,e[93]=N,e[94]=Z,e[95]=j):j=e[95];let re;e[96]!==y?(re=y?.kind==="error"&&(0,t.jsx)("p",{className:"mt-3 text-sm text-destructive","data-testid":"sc-editor-error",role:"alert",children:y.message}),e[96]=y,e[97]=re):re=e[97];let oe;e[98]!==P||e[99]!==y?.kind||e[100]!==l?(oe=y?.kind==="needs-migration"&&(0,t.jsxs)("div",{className:"mt-3 flex flex-col gap-2","data-testid":"sc-editor-needs-migration",children:[(0,t.jsx)("p",{className:"text-sm text-warning",role:"alert",children:l("This edit changes stored data and must go through a migration. Review the migration before applying.")}),(0,t.jsx)(G,{className:"self-start","data-testid":"sc-editor-open-migrations",onClick:P,size:"xs",type:"button",variant:"outline",children:l("Open Migrations")})]}),e[98]=P,e[99]=y?.kind,e[100]=l,e[101]=oe):oe=e[101];let q;e[102]!==y||e[103]!==l?(q=y?.kind==="ok"&&y.diagnostics.length>0&&(0,t.jsxs)("div",{className:"mt-3 flex flex-col gap-1","data-testid":"sc-editor-diagnostics",children:[(0,t.jsx)("p",{className:"text-sm text-destructive",role:"alert",children:l("Codegen reported diagnostics:")}),(0,t.jsx)("ul",{className:"flex flex-col gap-0.5",children:y.diagnostics.map(Kt)})]}),e[102]=y,e[103]=l,e[104]=q):q=e[104];let F;e[105]!==se||e[106]!==$||e[107]!==A||e[108]!==j||e[109]!==re||e[110]!==oe||e[111]!==q?(F=(0,t.jsxs)(mt,{children:[se,$,A,j,re,oe,q]}),e[105]=se,e[106]=$,e[107]=A,e[108]=j,e[109]=re,e[110]=oe,e[111]=q,e[112]=F):F=e[112];let Y;return e[113]!==J||e[114]!==F?(Y=(0,t.jsxs)(ot,{"data-testid":"sc-editor",size:"sm",children:[J,F]}),e[113]=J,e[114]=F,e[115]=Y):Y=e[115],Y},"Mt");function Ut(r){return(0,t.jsx)("option",{value:r,children:r},r)}n(Ut,"Rt");function Vt(r){return(0,t.jsx)("option",{value:r.validator,children:r.label},r.validator)}n(Vt,"Bt");function Jt(r){return(0,t.jsx)("option",{value:r,children:r},r)}n(Jt,"Ut");function Kt(r){return(0,t.jsx)("li",{className:"font-mono text-[11px] text-destructive",children:r},r)}n(Kt,"Vt");var Qt=et(at.listTables),Wt=et(at.listTableIndexes),Yt=et(at.readTablePage),Ht=et(at.describeTables),Xt={},St=[],Tt=[],Zt=n(r=>{let e=(0,Le.c)(5),{open:h}=r,i=h&&"rotate-90",l;e[0]!==i?(l=ft("size-3.5 shrink-0 text-muted-foreground transition-transform duration-150",i),e[0]=i,e[1]=l):l=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsx)("path",{d:"m9 6 6 6-6 6"}),e[2]=o):o=e[2];let s;return e[3]!==l?(s=(0,t.jsx)("svg",{"aria-hidden":"true",className:l,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:o}),e[3]=l,e[4]=s):s=e[4],s},"Qt"),It=n(r=>{let e=(0,Le.c)(20),{children:h,expanded:i,name:l,onToggle:o,rowCount:s,rowTestId:m,toggleTestId:f}=r,d;e[0]!==i?(d=(0,t.jsx)(Zt,{open:i}),e[0]=i,e[1]=d):d=e[1];let y;e[2]!==l?(y=(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",title:l,children:l}),e[2]=l,e[3]=y):y=e[3];let g;e[4]!==s?(g=(0,t.jsxs)("span",{className:"ms-auto shrink-0 text-xs text-muted-foreground tabular-nums",children:["(",s,")"]}),e[4]=s,e[5]=g):g=e[5];let C;e[6]!==i||e[7]!==o||e[8]!==d||e[9]!==y||e[10]!==g||e[11]!==f?(C=(0,t.jsxs)("button",{"aria-expanded":i,className:"flex w-full items-center gap-2 px-3 py-2 text-start transition-colors hover:bg-muted/50 aria-expanded:bg-muted/40","data-testid":f,onClick:o,type:"button",children:[d,y," ",g]}),e[6]=i,e[7]=o,e[8]=d,e[9]=y,e[10]=g,e[11]=f,e[12]=C):C=e[12];let c;e[13]!==h||e[14]!==i?(c=i&&(0,t.jsx)("div",{className:"px-3 pb-3 ps-8",children:h}),e[13]=h,e[14]=i,e[15]=c):c=e[15];let k;return e[16]!==m||e[17]!==C||e[18]!==c?(k=(0,t.jsxs)("li",{className:"border-t border-border/60 first:border-t-0","data-testid":m,children:[C,c]}),e[16]=m,e[17]=C,e[18]=c,e[19]=k):k=e[19],k},"vt"),zt=n(r=>{let e=(0,Le.c)(5),{columns:h,testId:i}=r,l;e[0]!==h?(l=h.map(tl),e[0]=h,e[1]=l):l=e[1];let o;return e[2]!==l||e[3]!==i?(o=(0,t.jsx)("ul",{className:"flex flex-wrap gap-1.5 pt-1","data-testid":i,children:l}),e[2]=l,e[3]=i,e[4]=o):o=e[4],o},"yt"),el=n(r=>{let e=(0,Le.c)(10),{heading:h,indexes:i,testId:l}=r,o;e[0]!==h?(o=(0,t.jsx)("p",{className:"mb-1.5 font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:h}),e[0]=h,e[1]=o):o=e[1];let s;e[2]!==i?(s=i.map(ll),e[2]=i,e[3]=s):s=e[3];let m;e[4]!==s||e[5]!==l?(m=(0,t.jsx)("ul",{className:"flex flex-col gap-1","data-testid":l,children:s}),e[4]=s,e[5]=l,e[6]=m):m=e[6];let f;return e[7]!==o||e[8]!==m?(f=(0,t.jsxs)("div",{className:"pt-3",children:[o,m]}),e[7]=o,e[8]=m,e[9]=f):f=e[9],f},"Wt"),$t=n(r=>ft("border-b-2 px-3 py-2 font-mono text-[11px] tracking-widest uppercase outline-none transition-colors",r?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),"Nt"),kl=n(r=>{let e=(0,Le.c)(130),{initialShardKey:h,initialTable:i,schemaEditable:l}=r,o=vt(),s=gt(),[m,f]=(0,u.useState)("graph"),[d,y]=(0,u.useState)(h??""),[g,C]=(0,u.useState)(""),[c,k]=(0,u.useState)(null),[R,H]=(0,u.useState)(null),Ge;e[0]===Symbol.for("react.memo_cache_sentinel")?(Ge={},e[0]=Ge):Ge=e[0];let[N,nt]=(0,u.useState)(Ge),O;e[1]===Symbol.for("react.memo_cache_sentinel")?(O={},e[1]=O):O=e[1];let[Me,X]=(0,u.useState)(O),[ce,Z]=(0,u.useState)(null),Ae;e[2]===Symbol.for("react.memo_cache_sentinel")?(Ae={},e[2]=Ae):Ae=e[2];let[ee,je]=(0,u.useState)(Ae),me;e[3]===Symbol.for("react.memo_cache_sentinel")?(me={},e[3]=me):me=e[3];let[S,qe]=(0,u.useState)(me),[x,Fe]=(0,u.useState)(null),[w,ke]=(0,u.useState)(null),_e;e[4]===Symbol.for("react.memo_cache_sentinel")?(_e={},e[4]=_e):_e=e[4];let[B,ht]=(0,u.useState)(_e),[D,st]=(0,u.useState)(null),ue;e[5]!==o?(ue=n(async a=>{H(null);try{let p=await o.query(Qt,{},tt(a));Ct(a),k(p),nt({}),X({}),Z(null),je(b=>Object.fromEntries(Object.entries(b).filter(L=>{let[_]=L;return _!==a}))),qe(b=>Object.fromEntries(Object.entries(b).filter(L=>{let[_]=L;return _!==a})))}catch(p){let b=p;k(null),H(lt(b))}},"ue"),e[5]=o,e[6]=ue):ue=e[6];let he=ue,pe;e[7]!==o?(pe=n(async()=>{ke(null);try{Fe(await o.listGlobalTables())}catch(a){let p=a;Fe(null),ke(lt(p))}},"pe"),e[7]=o,e[8]=pe):pe=e[8];let Se=pe,fe;e[9]!==d?(fe=d.trim(),e[9]=d,e[10]=fe):fe=e[10];let Re=kt(fe,400),ge,Be;e[11]!==Re||e[12]!==he||e[13]!==Se?(Be=n(()=>{M(he(Re)),M(Se())},"Me"),ge=[he,Se,Re],e[11]=Re,e[12]=he,e[13]=Se,e[14]=ge,e[15]=Be):(ge=e[14],Be=e[15]),(0,u.useEffect)(Be,ge);let be;e[16]!==o||e[17]!==N||e[18]!==ce||e[19]!==d?(be=n(async a=>{if(ce===a){Z(null);return}Z(a);let p=`${d}:${a}`;if(N[p]!==void 0)return;let[b,L]=await Promise.allSettled([o.query(Yt,{limit:1,offset:0,table:a},tt(d)),o.query(Wt,{table:a},tt(d))]);b.status==="fulfilled"?nt(_=>({..._,[p]:b.value.columns})):H(lt(b.reason)),L.status==="fulfilled"&&X(_=>({..._,[p]:L.value.indexes}))},"be"),e[16]=o,e[17]=N,e[18]=ce,e[19]=d,e[20]=be):be=e[20];let xe=be,ve;e[21]!==o||e[22]!==B||e[23]!==D?(ve=n(async a=>{if(D===a){st(null);return}if(st(a),B[a]===void 0)try{let p=await o.readGlobalTablePage({limit:1,offset:0,table:a});ht(b=>({...b,[a]:p.columns}))}catch(p){ke(lt(p))}},"ve"),e[21]=o,e[22]=B,e[23]=D,e[24]=ve):ve=e[24];let De=ve,Oe=(0,u.useRef)(void 0),Ue,ye;e[25]!==i||e[26]!==c||e[27]!==xe?(Ue=n(()=>{i===void 0||c===null||Oe.current===i||c.some(a=>a.name===i)&&(Oe.current=i,M(xe(i)))},"Be"),ye=[i,c,xe],e[25]=i,e[26]=c,e[27]=xe,e[28]=Ue,e[29]=ye):(Ue=e[28],ye=e[29]),(0,u.useEffect)(Ue,ye);let Ve;e[30]!==o?(Ve=n(async(a,p,b)=>{let[L,_]=await Promise.all([Promise.allSettled([o.query(Ht,{tables:[...p,...b]},tt(a))]),Promise.all(b.map(async de=>{let Xe=await Promise.allSettled([o.readGlobalTablePage({limit:1,offset:0,table:de})]),xt=Xe[0].status==="fulfilled"?Xe[0].value:void 0;return{columns:xt?.columns??[],refs:xt?.refs??{},table:de}}))]),At=L[0].status==="fulfilled"?L[0].value?.columnsByTable??{}:{},jt=L[0].status==="rejected",qt=new Map(_.map(al)),Ft=[...p,...b].map(de=>{let Xe=At[de]??[];return[de,Xe.length>0?Xe:qt.get(de)??[]]});je(de=>({...de,[a]:Object.fromEntries(Ft)})),qe(de=>({...de,[a]:jt}))},"Ue"),e[30]=o,e[31]=Ve):Ve=e[31];let Ne=Ve,Je,Ce;e[32]!==w||e[33]!==x||e[34]!==Ne||e[35]!==ee||e[36]!==d||e[37]!==c||e[38]!==m?(Je=n(()=>{m!=="graph"||c===null||x===null&&w===null||ee[d]!==void 0||M(Ne(d,c.map(nl),(x??[]).map(sl)))},"Ve"),Ce=[m,c,x,w,d,ee,Ne],e[32]=w,e[33]=x,e[34]=Ne,e[35]=ee,e[36]=d,e[37]=c,e[38]=m,e[39]=Je,e[40]=Ce):(Je=e[39],Ce=e[40]),(0,u.useEffect)(Je,Ce);let P=ee[d]??Xt,U;if(e[41]!==P||e[42]!==x||e[43]!==c){let a;e[45]!==P?(a=n(_=>({columns:P[_.name]??Tt,name:_.name,tier:"shard"}),"a"),e[45]=P,e[46]=a):a=e[46];let p=(c??[]).map(a),b;e[47]!==P?(b=n(_=>({columns:P[_.name]??Tt,name:_.name,tier:"global"}),"b"),e[47]=P,e[48]=b):b=e[48];let L=(x??[]).map(b);U=[...p,...L],e[41]=P,e[42]=x,e[43]=c,e[44]=U}else U=e[44];let te=U,V;if(e[49]!==g||e[50]!==c){let a=g.trim().toLowerCase();V=(c??[]).filter(p=>p.name.toLowerCase().includes(a)),e[49]=g,e[50]=c,e[51]=V}else V=e[51];let T=V,J;if(e[52]!==x||e[53]!==g){let a=g.trim().toLowerCase();J=(x??[]).filter(p=>p.name.toLowerCase().includes(a)),e[52]=x,e[53]=g,e[54]=J}else J=e[54];let le=J,K;e[55]===Symbol.for("react.memo_cache_sentinel")?(K=n(()=>{f("list")},"V"),e[55]=K):K=e[55];let Te=K,Ie;e[56]===Symbol.for("react.memo_cache_sentinel")?(Ie=n(()=>{f("graph")},"Te"),e[56]=Ie):Ie=e[56];let He=Ie,Q;e[57]===Symbol.for("react.memo_cache_sentinel")?(Q=n(a=>{C(a.target.value)},"K"),e[57]=Q):Q=e[57];let ze=Q,$e;e[58]!==he||e[59]!==d?($e=n(a=>{M(he(d))},"$e"),e[58]=he,e[59]=d,e[60]=$e):$e=e[60];let Pe=$e,I;e[61]!==c?(I=c??[],e[61]=c,e[62]=I):I=e[62];let W;e[63]!==I?(W=I.map(rl),e[63]=I,e[64]=W):W=e[64];let Ee=W,ae;e[65]!==d?(ae=(0,t.jsx)(wt,{onChange:y,testId:"sc-shard-input",value:d}),e[65]=d,e[66]=ae):ae=e[66];let z;e[67]!==s?(z=s("Schema view"),e[67]=s,e[68]=z):z=e[68];let ne=m==="graph",se=m==="graph",$;e[69]!==se?($=$t(se),e[69]=se,e[70]=$):$=e[70];let A;e[71]!==s?(A=s("Graph"),e[71]=s,e[72]=A):A=e[72];let j;e[73]!==ne||e[74]!==$||e[75]!==A?(j=(0,t.jsx)("button",{"aria-selected":ne,className:$,"data-testid":"sc-view-graph",onClick:He,role:"tab",type:"button",children:A}),e[73]=ne,e[74]=$,e[75]=A,e[76]=j):j=e[76];let re=m==="list",oe=m==="list",q;e[77]!==oe?(q=$t(oe),e[77]=oe,e[78]=q):q=e[78];let F;e[79]!==s?(F=s("Table list"),e[79]=s,e[80]=F):F=e[80];let Y;e[81]!==re||e[82]!==q||e[83]!==F?(Y=(0,t.jsx)("button",{"aria-selected":re,className:q,"data-testid":"sc-view-list",onClick:Te,role:"tab",type:"button",children:F}),e[81]=re,e[82]=q,e[83]=F,e[84]=Y):Y=e[84];let v;e[85]!==z||e[86]!==j||e[87]!==Y?(v=(0,t.jsxs)("div",{"aria-label":z,className:"flex items-center gap-1","data-testid":"sc-view-toggle",role:"tablist",children:[j,Y]}),e[85]=z,e[86]=j,e[87]=Y,e[88]=v):v=e[88];let E;e[89]!==ae||e[90]!==v?(E=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[ae,v]}),e[89]=ae,e[90]=v,e[91]=E):E=e[91];let ie;e[92]!==Pe||e[93]!==l||e[94]!==Ee?(ie=l===!0&&(0,t.jsx)(Dt,{onApplied:Pe,tableNames:Ee}),e[92]=Pe,e[93]=l,e[94]=Ee,e[95]=ie):ie=e[95];let Ke;e[96]!==s||e[97]!==g||e[98]!==m?(Ke=m==="list"&&(0,t.jsx)(Ye,{"aria-label":s("Filter tables"),className:"h-8 max-w-xs","data-testid":"sc-filter",onChange:ze,placeholder:s("Filter tables"),value:g}),e[96]=s,e[97]=g,e[98]=m,e[99]=Ke):Ke=e[99];let Qe;e[100]!==te||e[101]!==R||e[102]!==w||e[103]!==S||e[104]!==d||e[105]!==m?(Qe=m==="graph"&&(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"sc-graph-view",children:[R!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"sc-error",role:"alert",children:R}),w!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"sc-global-error",role:"alert",children:w}),(0,t.jsx)(_t,{columnsError:S[d]===!0,tables:te,testIdPrefix:"sc-graph"})]}),e[100]=te,e[101]=R,e[102]=w,e[103]=S,e[104]=d,e[105]=m,e[106]=Qe):Qe=e[106];let We;e[107]!==N||e[108]!==R||e[109]!==ce||e[110]!==le||e[111]!==T||e[112]!==B||e[113]!==w||e[114]!==D||e[115]!==x||e[116]!==Me||e[117]!==d||e[118]!==s||e[119]!==c||e[120]!==xe||e[121]!==De||e[122]!==m?(We=m==="list"&&(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)(ot,{"data-testid":"sc-shard-section",size:"sm",children:[(0,t.jsxs)(it,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(bt,{tier:"shard"}),(0,t.jsx)(dt,{children:s("Shard tables")}),c!==null&&(0,t.jsx)(Ze,{className:"ms-auto tabular-nums",variant:"outline",children:T.length})]}),(0,t.jsx)(ct,{children:ut.shard.hint})]}),(0,t.jsxs)(mt,{children:[R!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"sc-error",role:"alert",children:R}),c!==null&&c.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"sc-empty",children:s("No tables in this shard.")}),c!==null&&c.length>0&&T.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"sc-no-match",children:s("No tables match your filter.")}),T.length>0&&(0,t.jsx)("ul",{className:"-mx-3 overflow-hidden border-t border-border","data-testid":"sc-table-list",children:T.map(a=>{let p=`${d}:${a.name}`,b=Me[p]??[];return(0,t.jsxs)(It,{expanded:ce===a.name,name:a.name,onToggle:n(()=>{M(xe(a.name))},"onToggle"),rowCount:a.rowCount,rowTestId:`sc-table-${a.name}`,toggleTestId:`sc-toggle-${a.name}`,children:[(0,t.jsx)(zt,{columns:N[p]??St,testId:`sc-columns-${a.name}`}),b.length>0&&(0,t.jsx)(el,{heading:s("Indexes"),indexes:b,testId:`sc-indexes-${a.name}`})]},a.name)})})]})]}),(0,t.jsxs)(ot,{"data-testid":"sc-global-section",size:"sm",children:[(0,t.jsxs)(it,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(bt,{tier:"global"}),(0,t.jsx)(dt,{children:s("Global tables (D1)")}),x!==null&&(0,t.jsx)(Ze,{className:"ms-auto tabular-nums",variant:"outline",children:le.length})]}),(0,t.jsx)(ct,{children:ut.global.hint})]}),(0,t.jsxs)(mt,{children:[w!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"sc-global-error",role:"alert",children:w}),x!==null&&x.length===0&&(0,t.jsx)(Nt,{description:ut.global.hint,testId:"sc-global-empty",title:s("No global tables.")}),x!==null&&x.length>0&&le.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"sc-global-no-match",children:s("No tables match your filter.")}),le.length>0&&(0,t.jsx)("ul",{className:"-mx-3 overflow-hidden border-t border-border","data-testid":"sc-global-table-list",children:le.map(a=>(0,t.jsx)(It,{expanded:D===a.name,name:a.name,onToggle:n(()=>{M(De(a.name))},"onToggle"),rowCount:a.rowCount,rowTestId:`sc-global-table-${a.name}`,toggleTestId:`sc-global-toggle-${a.name}`,children:(0,t.jsx)(zt,{columns:B[a.name]??St,testId:`sc-global-columns-${a.name}`})},a.name))})]})]})]}),e[107]=N,e[108]=R,e[109]=ce,e[110]=le,e[111]=T,e[112]=B,e[113]=w,e[114]=D,e[115]=x,e[116]=Me,e[117]=d,e[118]=s,e[119]=c,e[120]=xe,e[121]=De,e[122]=m,e[123]=We):We=e[123];let rt;return e[124]!==E||e[125]!==ie||e[126]!==Ke||e[127]!==Qe||e[128]!==We?(rt=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-schema",children:[E,ie,Ke,Qe,We]}),e[124]=E,e[125]=ie,e[126]=Ke,e[127]=Qe,e[128]=We,e[129]=rt):rt=e[129],rt},"_l");function tl(r){return(0,t.jsx)("li",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground",children:r},r)}n(tl,"Yt");function ll(r){return(0,t.jsxs)("li",{className:"flex flex-wrap items-center gap-1.5 text-xs",children:[(0,t.jsx)("span",{className:"font-mono",children:r.name}),(0,t.jsx)(Ze,{variant:"outline",children:r.type}),r.unique===!0&&(0,t.jsx)(Ze,{variant:"secondary",children:"unique"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:r.fields.join(", ")})]},`${r.type}:${r.name}`)}n(ll,"el");function al(r){let{columns:e,refs:h,table:i}=r;return[i,e.map(l=>{let o=h[l];return o===void 0?{name:l,optional:!1,type:""}:{name:l,optional:!1,ref:o,type:"id"}})]}n(al,"tl");function nl(r){return r.name}n(nl,"ll");function sl(r){return r.name}n(sl,"al");function rl(r){return r.name}n(rl,"nl");export{kl as SchemaViewer};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as U}from"./chunk-54MMVNPT.js";import{a as C}from"./chunk-QXXIJAD5.js";import{a as f}from"./chunk-5Y3QLNWX.js";import{R as v}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{c as O}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as L}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as w}from"./chunk-2WOIRKEI.js";import{f as P}from"./chunk-EN2QAEO4.js";import"./chunk-XBDKZZ67.js";import{d as q,f as y,g as c,h,m as p}from"./chunk-OG4N2XHD.js";import"./chunk-AADILRJW.js";import{a as o,e as T,f as W,h as $}from"./chunk-3XIESWL4.js";var a=T(W(),1);var e=T($(),1);var R=y(w.getPitrBookmark),V=y(w.pitrRestore),ne=o(({initialShardKey:j})=>{let m=P(),r=q(),i=j??"",[z,x]=(0,a.useState)(null),[l,A]=(0,a.useState)(""),[B,I]=(0,a.useState)(null),[u,D]=(0,a.useState)(""),[k,E]=(0,a.useState)(!1),[s,K]=(0,a.useState)(null),[F,n]=(0,a.useState)(null),[b,d]=(0,a.useState)(!1),g=(0,a.useCallback)(async()=>{d(!0),n(null);try{let t=await m.query(R,{},c(i));x(t.current)}catch(t){n(h(t))}d(!1)},[m,i]);(0,a.useEffect)(()=>{p(g())},[g]),U(()=>{p((async()=>{try{let t=await m.query(R,{},c(i));x(t.current)}catch{}})())},!0);let M=o(t=>{A(t.target.value)},"U"),Z=o(t=>{D(t.target.value)},"j"),_=o(t=>{E(t.target.checked)},"M"),G=o(()=>{l.trim()!==""&&p((async()=>{d(!0),n(null);try{let t=await m.query(R,{time:l.trim()},c(i));I(t.forTime??null),x(t.current)}catch(t){I(null),n(h(t))}d(!1)})())},"z"),S=o(t=>{p((async()=>{d(!0),n(null);try{let N=await m.mutation(V,t,c(i));K(N),await g()}catch(N){n(h(N))}d(!1)})())},"R"),H=u.trim()!==""||l.trim()!=="",J=o(()=>{let t=k?{restart:!0}:{};u.trim()===""?t.time=l.trim():t.bookmark=u.trim(),S(t)},"$"),Q=o(()=>{s!==null&&S(k?{bookmark:s.undoBookmark,restart:!0}:{bookmark:s.undoBookmark})},"D");return(0,e.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-pitr",children:[(0,e.jsx)("div",{className:"flex flex-wrap items-center gap-3",children:(0,e.jsxs)("span",{className:"text-xs text-muted-foreground",children:[r("Shard"),": ",(0,e.jsx)("span",{className:"font-mono",children:i===""?r("root"):i})]})}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"pitr-note",children:r("In-place recovery to any moment in the last 30 days. For older or portable recovery, use the snapshot backup tier.")}),F!==null&&(0,e.jsx)("p",{className:"text-sm text-destructive","data-testid":"pitr-error",role:"alert",children:F}),(0,e.jsxs)("section",{className:"rounded-xl border border-border bg-card p-3 shadow-xs",children:[(0,e.jsx)("h3",{className:"mb-2 text-sm font-semibold",children:r("Current bookmark")}),(0,e.jsx)("p",{className:"font-mono text-xs break-all text-muted-foreground","data-testid":"pitr-current",children:z??(0,e.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})})]}),(0,e.jsxs)("section",{className:"flex flex-col gap-3 rounded-xl border border-border bg-card p-3 shadow-xs",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold",children:r("Restore")}),(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)(f,{htmlFor:"pitr-time",children:r("Time (ISO or epoch-ms, last 30 days)")}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(v,{"data-testid":"pitr-time",id:"pitr-time",onChange:M,placeholder:"2026-06-01T00:00:00.000Z",value:l}),(0,e.jsx)(O,{"data-testid":"pitr-preview",disabled:b||l.trim()==="",onClick:G,size:"sm",type:"button",variant:"outline",children:r("Preview")})]}),B!==null&&(0,e.jsxs)("p",{className:"font-mono text-xs break-all text-muted-foreground","data-testid":"pitr-preview-bookmark",children:[r("Bookmark for that time"),": ",B]})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)(f,{htmlFor:"pitr-bookmark",children:r("Or an explicit bookmark (wins over time)")}),(0,e.jsx)(v,{"data-testid":"pitr-bookmark",id:"pitr-bookmark",onChange:Z,placeholder:r("bookmark string"),value:u})]}),(0,e.jsxs)(f,{className:"flex items-center gap-2 text-xs font-normal text-muted-foreground",htmlFor:"pitr-restart",children:[(0,e.jsx)("input",{checked:k,className:"size-4 accent-primary","data-testid":"pitr-restart",id:"pitr-restart",onChange:_,type:"checkbox"}),r("Restart the shard now so recovery applies immediately")]}),(0,e.jsx)("div",{children:(0,e.jsx)(C,{confirmLabel:r("Confirm restore"),disabled:b||!H,onConfirm:J,testId:"pitr-restore",children:r("Restore")})})]}),s!==null&&(0,e.jsxs)("section",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card p-3 shadow-xs","data-testid":"pitr-result",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold",children:r("Restore armed")}),(0,e.jsx)(L,{variant:s.restarted?"destructive":"secondary",children:s.restarted?r("restarted now"):r("on next restart")})]}),(0,e.jsxs)("p",{className:"font-mono text-xs break-all text-muted-foreground",children:[r("Restored to"),": ",s.restoredTo]}),(0,e.jsxs)("p",{className:"font-mono text-xs break-all text-muted-foreground","data-testid":"pitr-undo-bookmark",children:[r("Undo bookmark"),": ",s.undoBookmark]}),(0,e.jsx)("div",{children:(0,e.jsx)(C,{confirmLabel:r("Confirm undo"),disabled:b,onConfirm:Q,testId:"pitr-undo",children:r("Undo restore")})})]})]})},"de");export{ne as PitrPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as J}from"./chunk-54MMVNPT.js";import{a as L}from"./chunk-LFKCLLPT.js";import{a as O}from"./chunk-53WEPGUD.js";import"./chunk-XXQUMVWH.js";import"./chunk-RNL6BSFM.js";import"./chunk-QLQADHFE.js";import{c as D}from"./chunk-XDAT7LHC.js";import{a as P,b as W,c as B,d as A,e as m,f as u}from"./chunk-MIQTKZAR.js";import{a as E,e as T}from"./chunk-UZERI5YC.js";import{a as K}from"./chunk-X665E2HU.js";import"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import"./chunk-2OUPA2WJ.js";import{b as S}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as F}from"./chunk-2WOIRKEI.js";import"./chunk-EN2QAEO4.js";import"./chunk-XBDKZZ67.js";import{a as _}from"./chunk-XQCVZAGU.js";import{d as j}from"./chunk-OG4N2XHD.js";import"./chunk-AADILRJW.js";import{a as N,e as C,f as X,g as q,h as z}from"./chunk-3XIESWL4.js";var U=C(q(),1),Z=C(X(),1);var e=C(z(),1);var R=80,G=N(a=>{if(a===void 0)return"";let t=JSON.stringify(a);return t.length>R?`${t.slice(0,R)}\u2026`:t},"X"),H=N(a=>{let t=[];for(let i of a){let n=i.id.toString();if(i.subscriptions.length===0){t.push({admin:i.admin,connectionId:i.id,key:`c${n}`,subscription:null});continue}i.subscriptions.forEach((s,y)=>{t.push({admin:i.admin,connectionId:i.id,key:`c${n}-s${y.toString()}`,subscription:s})})}return t},"Z"),M=(0,e.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}),lt=N(a=>{let t=(0,U.c)(22),{initialShardKey:i}=a,n=j(),[s,y]=(0,Z.useState)(i??""),h;t[0]!==s?(h=s.trim(),t[0]=s,t[1]=h):h=t[1];let k=L(h,400),p;t[2]===Symbol.for("react.memo_cache_sentinel")?(p={},t[2]=p):p=t[2];let f;t[3]!==k?(f={keepPreviousData:!0,shardKey:k},t[3]=k,t[4]=f):f=t[4];let{data:r,error:o,errorSource:d,refetch:Q}=D(F.listSubscriptions,p,f);J(Q,!0);let b;if(t[5]!==o||t[6]!==d||t[7]!==r||t[8]!==s||t[9]!==n){let I=r===void 0?[]:H(r.connections),c;t[11]!==s?(c=(0,e.jsx)(K,{onChange:y,testId:"subs-shard-input",value:s}),t[11]=s,t[12]=c):c=t[12];let l;t[13]!==r||t[14]!==n?(l=r!==void 0&&(0,e.jsxs)("div",{className:"ml-auto flex items-center gap-2 text-sm text-muted-foreground","data-testid":"subs-count",children:[(0,e.jsx)(S,{variant:"secondary",children:n("{count} connections",{count:r.totalConnections})}),(0,e.jsx)(S,{variant:"secondary",children:n("{count} subscriptions",{count:r.totalSubscriptions})})]}),t[13]=r,t[14]=n,t[15]=l):l=t[15];let g;t[16]!==c||t[17]!==l?(g=(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c,l]}),t[16]=c,t[17]=l,t[18]=g):g=t[18];let v;t[19]!==o||t[20]!==d?(v=o!==null&&(0,e.jsx)(O,{error:d,testId:"subs-error"}),t[19]=o,t[20]=d,t[21]=v):v=t[21],b=(0,e.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"subs-panel",children:[g,v,o===null&&r!==void 0&&I.length===0&&(0,e.jsx)(_,{description:n("Active WebSocket subscriptions on this shard."),icon:(0,e.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M5 12a7 7 0 0 1 14 0M8 12a4 4 0 0 1 8 0M12 12v8m0-8a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"})}),testId:"subs-empty",title:n("No active subscriptions.")}),o===null&&I.length>0&&(0,e.jsx)(E,{className:"overflow-hidden py-0",children:(0,e.jsx)(T,{className:"px-0",children:(0,e.jsxs)(P,{"data-testid":"subs-table",children:[(0,e.jsx)(W,{children:(0,e.jsxs)(A,{children:[(0,e.jsx)(m,{children:n("Connection")}),(0,e.jsx)(m,{children:n("Function path")}),(0,e.jsx)(m,{children:n("Table")}),(0,e.jsx)(m,{children:n("Arguments")})]})}),(0,e.jsx)(B,{children:I.map(x=>{let{subscription:w}=x,$=G(w?.args);return(0,e.jsxs)(A,{"data-testid":"subs-row",children:[(0,e.jsx)(u,{className:"font-medium tabular-nums",children:(0,e.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:["#",x.connectionId,x.admin&&(0,e.jsx)(S,{variant:"outline",children:n("admin")})]})}),(0,e.jsx)(u,{className:"font-mono text-xs",children:w?.functionPath??M}),(0,e.jsx)(u,{children:w?.table??M}),(0,e.jsx)(u,{className:"max-w-[32ch] truncate font-mono text-xs text-muted-foreground",title:$||void 0,children:$||M})]},x.key)})})]})})})]}),t[5]=o,t[6]=d,t[7]=r,t[8]=s,t[9]=n,t[10]=b}else b=t[10];return b},"at");export{lt as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as v}from"./chunk-53WEPGUD.js";import"./chunk-XXQUMVWH.js";import"./chunk-RNL6BSFM.js";import"./chunk-QLQADHFE.js";import{c as $}from"./chunk-XDAT7LHC.js";import{a as A,b as I,c as j,d as x,e as n,f as c}from"./chunk-MIQTKZAR.js";import{a as k,e as S}from"./chunk-UZERI5YC.js";import{b as y}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as R}from"./chunk-2WOIRKEI.js";import"./chunk-EN2QAEO4.js";import"./chunk-XBDKZZ67.js";import{a as w}from"./chunk-XQCVZAGU.js";import{d as b}from"./chunk-OG4N2XHD.js";import"./chunk-AADILRJW.js";import{a as f,e as N,g as E,h as _}from"./chunk-3XIESWL4.js";var T=N(E(),1);var r=N(_(),1);var D=f((e,t)=>({delete:e("Delete"),list:e("List"),read:e("Read"),write:e("Write")})[t],"C"),C={delete:2,list:3,read:0,write:1},O=f(e=>[...e].toSorted((t,a)=>t.bucket.localeCompare(a.bucket)||C[t.on]-C[a.on]||(t.prefix??"").localeCompare(a.prefix??"")),"T"),W=f(()=>{let e=(0,T.c)(14),t=b(),a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={},e[0]=a):a=e[0];let{data:l,error:i,errorSource:d}=$(R.storageRules,a),h=l!==void 0,m;if(e[1]!==l||e[2]!==i||e[3]!==d||e[4]!==h||e[5]!==t){let g=O(Array.isArray(l?.rules)?l.rules:[]),u;e[7]!==i||e[8]!==d?(u=i!==null&&(0,r.jsx)(v,{error:d,testId:"storage-rules-error"}),e[7]=i,e[8]=d,e[9]=u):u=e[9];let o;e[10]!==t?(o=t("Storage rules are declared in code with defineStorageRule and gate ctx.storage access per bucket. This view is read-only."),e[10]=t,e[11]=o):o=e[11];let p;e[12]!==o?(p=(0,r.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"storage-rules-note",children:o}),e[12]=o,e[13]=p):p=e[13],m=(0,r.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-storage-rules-panel",children:[u,p,h&&g.length===0?(0,r.jsx)(w,{description:t("No defineStorageRule is wired through .use(storageRules(...)) in this deployment. Add one to gate object access by key prefix."),testId:"storage-rules-empty",title:t("No storage rules defined")}):(0,r.jsx)(k,{className:"overflow-hidden py-0",children:(0,r.jsx)(S,{className:"px-0",children:(0,r.jsxs)(A,{"data-testid":"storage-rules-table",children:[(0,r.jsx)(I,{children:(0,r.jsxs)(x,{children:[(0,r.jsx)(n,{children:t("Bucket")}),(0,r.jsx)(n,{children:t("Operation")}),(0,r.jsx)(n,{children:t("Key prefix")}),(0,r.jsx)(n,{children:t("Guarded by")})]})}),(0,r.jsx)(j,{children:g.map(s=>(0,r.jsxs)(x,{"data-testid":`storage-rule-${s.bucket}-${s.on}-${s.prefix??""}`,children:[(0,r.jsx)(c,{className:"font-mono text-xs",children:s.bucket}),(0,r.jsx)(c,{children:(0,r.jsx)(y,{variant:"secondary",children:D(t,s.on)})}),(0,r.jsx)(c,{className:"font-mono text-xs",children:s.prefix??(0,r.jsx)("span",{className:"text-muted-foreground",children:t("(whole bucket)")})}),(0,r.jsx)(c,{className:"font-mono text-xs text-muted-foreground",children:s.procedure})]},`${s.bucket}:${s.on}:${s.prefix??""}:${s.procedure}`))})]})})})]}),e[1]=l,e[2]=i,e[3]=d,e[4]=h,e[5]=t,e[6]=m}else m=e[6];return m},"U");export{W as StorageRulesPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as O}from"./chunk-CTNB2KIA.js";import{a as q,b as B}from"./chunk-AVAC26HJ.js";import{a as z}from"./chunk-LFKCLLPT.js";import{a as A}from"./chunk-53WEPGUD.js";import"./chunk-XXQUMVWH.js";import"./chunk-RNL6BSFM.js";import"./chunk-QLQADHFE.js";import{c as R}from"./chunk-XDAT7LHC.js";import{a as T,b as F,c as K,d as p,e as l,f as d}from"./chunk-MIQTKZAR.js";import{a as I,e as E}from"./chunk-UZERI5YC.js";import{a as j}from"./chunk-X665E2HU.js";import"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import{R as C}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import"./chunk-2OUPA2WJ.js";import{b as y}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as V}from"./chunk-2WOIRKEI.js";import"./chunk-EN2QAEO4.js";import"./chunk-XBDKZZ67.js";import{a as k}from"./chunk-XQCVZAGU.js";import{d as L,q as M}from"./chunk-OG4N2XHD.js";import"./chunk-AADILRJW.js";import{a as o,e as b,f as ee,h as te}from"./chunk-3XIESWL4.js";var i=b(ee(),1);var e=b(te(),1);var D=80,re=o(s=>{if(s===void 0)return"";let t=JSON.stringify(s);return t.length>D?`${t.slice(0,D)}\u2026`:t},"te"),ae=41,J=480,H=5,ie=o((s,t)=>q(s,n=>{t(n.height>0?n:{height:J,width:n.width})}),"ae"),Ne=o(({initialShardKey:s})=>{let t=L(),[n,P]=(0,i.useState)(s??""),[c,U]=(0,i.useState)(""),W=z(n.trim(),400),{data:f,error:g,errorSource:Z,isLoading:_,liveError:$}=R(V.getAuditLog,{},{live:!0,shardKey:W}),h=(0,i.useMemo)(()=>f?.entries??[],[f]),m=(0,i.useMemo)(()=>{let a=c.trim().toLowerCase();return a===""?h:h.filter(r=>r.op.toLowerCase().includes(a)||(r.table??"").toLowerCase().includes(a)||(r.id??"").toLowerCase().includes(a))},[h,c]),x=(0,i.useRef)(null),v=B({count:m.length,estimateSize:o(()=>ae,"estimateSize"),getScrollElement:o(()=>x.current,"getScrollElement"),initialRect:{height:J,width:800},observeElementRect:ie,overscan:8}),u=v.getVirtualItems(),G=v.getTotalSize(),N=u[0]?.start??0,w=G-(u.at(-1)?.end??0),Q={height:N},X={height:w},Y=o(a=>{U(a.target.value)},"V");return(0,e.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-audit",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)(j,{onChange:P,testId:"au-shard-input",value:n}),(0,e.jsx)(O,{message:$,prefix:"au"}),(0,e.jsx)(C,{"aria-label":t("Filter audit log"),className:"h-8 w-48","data-testid":"au-search",onChange:Y,placeholder:t("filter op, table, id"),value:c})]}),g!==null&&(0,e.jsx)(A,{error:Z,testId:"au-error"}),g===null&&!_&&m.length===0&&(0,e.jsx)(k,{description:t("State-changing admin operations are recorded here."),icon:(0,e.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M8 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2h-2M9 3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1V3Zm-1 9h8m-8 4h5"})}),testId:"au-empty",title:t("No audit entries.")}),m.length>0&&(0,e.jsx)(I,{className:"overflow-hidden py-0",children:(0,e.jsx)(E,{className:"max-h-[30rem] overflow-auto px-0",ref:x,children:(0,e.jsxs)(T,{"data-testid":"au-table",children:[(0,e.jsx)(F,{children:(0,e.jsxs)(p,{children:[(0,e.jsx)(l,{children:t("time")}),(0,e.jsx)(l,{children:t("op")}),(0,e.jsx)(l,{children:t("table")}),(0,e.jsx)(l,{children:t("id")}),(0,e.jsx)(l,{children:t("detail")})]})}),(0,e.jsxs)(K,{children:[N>0&&(0,e.jsx)("tr",{"aria-hidden":"true",children:(0,e.jsx)("td",{colSpan:H,style:Q})}),u.map(a=>{let r=m[a.index],S=re(r.detail);return(0,e.jsxs)(p,{"data-testid":"au-row",children:[(0,e.jsx)(d,{className:"text-muted-foreground tabular-nums",children:M(r.ts,"\u2014")}),(0,e.jsx)(d,{children:(0,e.jsx)(y,{variant:"secondary",children:r.op})}),(0,e.jsx)(d,{className:"font-medium",children:r.table??(0,e.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})}),(0,e.jsx)(d,{className:"max-w-[20ch] truncate font-mono text-xs",children:r.id??(0,e.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})}),(0,e.jsx)(d,{className:"max-w-[32ch] truncate font-mono text-xs text-muted-foreground",title:S||void 0,children:S||(0,e.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})})]},r.seq)}),w>0&&(0,e.jsx)("tr",{"aria-hidden":"true",children:(0,e.jsx)("td",{colSpan:H,style:X})})]})]})})})]})},"we");export{Ne as AuditPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as u,m as f}from"./chunk-OG4N2XHD.js";import{a as s,e as l,f as h,g as S}from"./chunk-3XIESWL4.js";var i=l(S(),1),c=l(h(),1);var g=s(()=>{let t=(0,i.c)(4),[a,n]=(0,c.useState)(!1),[e,m]=(0,c.useState)(null),r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s(p=>{f((async()=>{n(!0),m(null);try{await p()}catch(b){m(u(b))}n(!1)})())},"e"),t[0]=r):r=t[0];let y=r,o;return t[1]!==a||t[2]!==e?(o={busy:a,error:e,run:y},t[1]=a,t[2]=e,t[3]=o):o=t[3],o},"g");export{g as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as We,b as qe,c as De,d as Oe,e as be}from"./chunk-OY2RVUZL.js";import"./chunk-2PJNAWB3.js";import{a as Re}from"./chunk-U6TNNM5U.js";import{a as Ve}from"./chunk-CTNB2KIA.js";import"./chunk-SD4BERSA.js";import"./chunk-IC4L6G56.js";import"./chunk-RQ7AFLIV.js";import"./chunk-BGBLQ563.js";import"./chunk-IVFHIQOT.js";import{a as ze}from"./chunk-LFKCLLPT.js";import"./chunk-T6VMSOBB.js";import"./chunk-QLQADHFE.js";import{c as _e}from"./chunk-XDAT7LHC.js";import{a as Le,b as je,c as Fe,d as pe,e as q,f as R}from"./chunk-MIQTKZAR.js";import{a as Me,e as Ae}from"./chunk-UZERI5YC.js";import"./chunk-QBWRC5YX.js";import{a as Ke}from"./chunk-X665E2HU.js";import"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import{R as ke}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{c as ne}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as me}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as D}from"./chunk-2WOIRKEI.js";import{f as Ne}from"./chunk-EN2QAEO4.js";import"./chunk-XBDKZZ67.js";import{a as Ce}from"./chunk-XQCVZAGU.js";import{d as ue,f as oe,g as we,h as Ee,m as de,q as Te}from"./chunk-OG4N2XHD.js";import{a as Ie,b as $e}from"./chunk-AADILRJW.js";import{a as o,e as ye,f as Be,g as Ge,h as He}from"./chunk-3XIESWL4.js";var ge=ye(Ge(),1);var O=ye(Be(),1);var t=ye(He(),1);var Se="none",Pe=["all","open","resolved","ignored"],Je=["critical","high","medium","low"],Qe=oe(D.resolveIssue),Xe=oe(D.ignoreIssue),Ue=oe(D.assignIssue),Ye=oe(D.setIssueSeverity),Ze=oe(D.explainIssue),es=o(n=>Array.isArray(n?.issues)?n.issues:[],"Xe"),ss=o(n=>n==="resolved"?"success":n==="ignored"?"secondary":"warning","Ye"),ts=o(n=>n==="critical"?"destructive":n==="high"?"warning":n==="medium"?"info":"secondary","Ze"),as=o(n=>{let e=(0,ge.c)(44),{expanded:d,issue:s,shardKey:$}=n,i=Ne(),r=ue(),[a,C]=(0,O.useState)(void 0),{busy:E,error:T,run:F}=Re(),_;e[0]!==i||e[1]!==s||e[2]!==F||e[3]!==$?(_=o(()=>{C(void 0),F(async()=>{let f={culprit:s.culprit,sampleMessage:s.sampleMessage,title:s.title},I=await i.query(Ze,f,we($));C(I)})},"E"),e[0]=i,e[1]=s,e[2]=F,e[3]=$,e[4]=_):_=e[4];let K=_;if(!d)return null;let h;if(e[5]!==s.sampleMessage){let f=$e(s.sampleMessage);h=f===void 0?void 0:Ie(f.body),e[5]=s.sampleMessage,e[6]=h}else h=e[6];let M=h,z=`issues-detail-${s.hash}`,c;e[7]!==s.sampleMessage?(c=(0,t.jsx)("p",{className:"whitespace-pre-wrap font-mono text-xs text-muted-foreground",children:s.sampleMessage}),e[7]=s.sampleMessage,e[8]=c):c=e[8];let x;e[9]!==r?(x=r("Suggested fix"),e[9]=r,e[10]=x):x=e[10];let y;e[11]!==x?(y=(0,t.jsx)("div",{className:"text-xs font-medium text-muted-foreground",children:x}),e[11]=x,e[12]=y):y=e[12];let w;e[13]!==M||e[14]!==s.hash||e[15]!==r?(w=M===void 0?(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground","data-testid":`issues-hint-empty-${s.hash}`,children:r("No known fix for this error yet.")}):(0,t.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-sm","data-testid":`issues-hint-${s.hash}`,children:M}),e[13]=M,e[14]=s.hash,e[15]=r,e[16]=w):w=e[16];let u;e[17]!==y||e[18]!==w?(u=(0,t.jsxs)("div",{children:[y,w]}),e[17]=y,e[18]=w,e[19]=u):u=e[19];let A=`issues-explain-${s.hash}`,m;e[20]!==E||e[21]!==r?(m=r(E?"Explaining\u2026":"Explain in plain language"),e[20]=E,e[21]=r,e[22]=m):m=e[22];let b;e[23]!==E||e[24]!==K||e[25]!==m||e[26]!==A?(b=(0,t.jsx)("div",{children:(0,t.jsx)(ne,{"data-testid":A,disabled:E,onClick:K,size:"sm",type:"button",variant:"outline",children:m})}),e[23]=E,e[24]=K,e[25]=m,e[26]=A,e[27]=b):b=e[27];let p;e[28]!==T||e[29]!==s.hash?(p=T!==null&&(0,t.jsx)("p",{className:"text-xs text-destructive","data-testid":`issues-explain-error-${s.hash}`,role:"alert",children:T}),e[28]=T,e[29]=s.hash,e[30]=p):p=e[30];let v;e[31]!==a||e[32]!==s.hash||e[33]!==r?(v=a!==void 0&&(a.degraded?(0,t.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":`issues-degraded-${s.hash}`,children:a.reason==="no-ai-binding"?r("No AI binding is configured. Wire an AI binding to enable plain-language explanations \u2014 the suggested fix above is always available."):r("The AI model could not explain this error right now. The suggested fix above still applies.")}):(0,t.jsxs)("div",{"data-testid":`issues-explanation-${s.hash}`,children:[(0,t.jsx)("div",{className:"text-xs font-medium text-muted-foreground",children:r("AI explanation")}),(0,t.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-sm",children:a.explanation}),a.groundedId===void 0&&(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground","data-testid":`issues-ungrounded-${s.hash}`,children:r("No catalog fix matched this error, so this explanation is the model's own reading of the message. Verify before acting on it.")}),(0,t.jsx)("p",{className:"mt-1 text-[0.7rem] text-muted-foreground",children:r("Generated by {model}",{model:a.model})})]})),e[31]=a,e[32]=s.hash,e[33]=r,e[34]=v):v=e[34];let g;e[35]!==b||e[36]!==p||e[37]!==v||e[38]!==c||e[39]!==u?(g=(0,t.jsx)(R,{className:"bg-muted/30",colSpan:7,children:(0,t.jsxs)("div",{className:"flex flex-col gap-3 py-1",children:[c,u,b,p,v]})}),e[35]=b,e[36]=p,e[37]=v,e[38]=c,e[39]=u,e[40]=g):g=e[40];let S;return e[41]!==g||e[42]!==z?(S=(0,t.jsx)(pe,{"data-testid":z,children:g}),e[41]=g,e[42]=z,e[43]=S):S=e[43],S},"et"),is=o(n=>{let e=(0,ge.c)(119),{busy:d,issue:s,rowError:$,runTriage:i,shardKey:r}=n,a=ue(),[C,E]=(0,O.useState)(!1),T;e[0]===Symbol.for("react.memo_cache_sentinel")?(T=o(()=>{E(ls)},"_"),e[0]=T):T=e[0];let F=T,_;e[1]!==s.hash||e[2]!==i?(_=o(re=>{let ce=re===null||re===Se?null:re;de(i(s.hash,Ye,{severity:ce}))},"E"),e[1]=s.hash,e[2]=i,e[3]=_):_=e[3];let K=_,h;e[4]!==s.hash||e[5]!==i?(h=o(re=>{if(re.key!=="Enter")return;let ce=re.currentTarget.value.trim();de(i(s.hash,Ue,{assignee:ce===""?null:ce}))},"d"),e[4]=s.hash,e[5]=i,e[6]=h):h=e[6];let M=h,z=`issues-row-${s.hash}`,c;e[7]!==a?(c=a("Toggle issue details"),e[7]=a,e[8]=c):c=e[8];let x=`issues-toggle-${s.hash}`,y=`mt-1 size-3 shrink-0 text-muted-foreground transition-transform ${C?"rotate-90":""}`,w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=(0,t.jsx)("path",{d:"m9 6 6 6-6 6"}),e[9]=w):w=e[9];let u;e[10]!==y?(u=(0,t.jsx)("svg",{"aria-hidden":"true",className:y,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",children:w}),e[10]=y,e[11]=u):u=e[11];let A;e[12]!==s.title?(A=(0,t.jsx)("span",{className:"block truncate font-medium",title:s.title,children:s.title}),e[12]=s.title,e[13]=A):A=e[13];let m;e[14]!==s.culprit?(m=(0,t.jsx)("span",{className:"block truncate font-mono text-xs text-muted-foreground",title:s.culprit,children:s.culprit}),e[14]=s.culprit,e[15]=m):m=e[15];let b;e[16]!==A||e[17]!==m?(b=(0,t.jsxs)("span",{className:"min-w-0",children:[A,m]}),e[16]=A,e[17]=m,e[18]=b):b=e[18];let p;e[19]!==C||e[20]!==b||e[21]!==c||e[22]!==x||e[23]!==u?(p=(0,t.jsxs)("button",{"aria-expanded":C,"aria-label":c,className:"flex w-full items-start gap-2 text-left","data-testid":x,onClick:F,type:"button",children:[u,b]}),e[19]=C,e[20]=b,e[21]=c,e[22]=x,e[23]=u,e[24]=p):p=e[24];let v;e[25]!==s.hash||e[26]!==$?(v=$!==void 0&&(0,t.jsx)("p",{className:"mt-1 text-xs text-destructive","data-testid":`issues-action-error-${s.hash}`,role:"alert",children:$}),e[25]=s.hash,e[26]=$,e[27]=v):v=e[27];let g;e[28]!==p||e[29]!==v?(g=(0,t.jsxs)(R,{className:"max-w-80",children:[p,v]}),e[28]=p,e[29]=v,e[30]=g):g=e[30];let S=`issues-status-${s.hash}`,f;e[31]!==s.status?(f=ss(s.status),e[31]=s.status,e[32]=f):f=e[32];let I;e[33]!==s.status||e[34]!==S||e[35]!==f?(I=(0,t.jsx)(R,{children:(0,t.jsx)(me,{"data-testid":S,variant:f,children:s.status})}),e[33]=s.status,e[34]=S,e[35]=f,e[36]=I):I=e[36];let j=s.severity??Se,L;e[37]!==a?(L=a("Set severity"),e[37]=a,e[38]=L):L=e[38];let l=`issues-severity-${s.hash}`,V;e[39]!==a?(V=a("\u2014"),e[39]=a,e[40]=V):V=e[40];let W;e[41]!==s.severity||e[42]!==a?(W=s.severity===void 0?(0,t.jsx)("span",{className:"text-muted-foreground",children:a("\u2014")}):(0,t.jsx)(me,{variant:ts(s.severity),children:s.severity}),e[41]=s.severity,e[42]=a,e[43]=W):W=e[43];let N;e[44]!==V||e[45]!==W?(N=(0,t.jsx)(qe,{placeholder:V,children:W}),e[44]=V,e[45]=W,e[46]=N):N=e[46];let k;e[47]!==L||e[48]!==l||e[49]!==N?(k=(0,t.jsx)(De,{"aria-label":L,className:"h-7 w-[110px]","data-testid":l,children:N}),e[47]=L,e[48]=l,e[49]=N,e[50]=k):k=e[50];let U;e[51]===Symbol.for("react.memo_cache_sentinel")?(U=Je.map(rs),e[51]=U):U=e[51];let B;e[52]!==a?(B=a("Clear"),e[52]=a,e[53]=B):B=e[53];let G;e[54]!==B?(G=(0,t.jsxs)(Oe,{children:[U,(0,t.jsx)(be,{value:Se,children:B})]}),e[54]=B,e[55]=G):G=e[55];let H;e[56]!==d||e[57]!==K||e[58]!==j||e[59]!==k||e[60]!==G?(H=(0,t.jsx)(R,{children:(0,t.jsxs)(We,{disabled:d,onValueChange:K,value:j,children:[k,G]})}),e[56]=d,e[57]=K,e[58]=j,e[59]=k,e[60]=G,e[61]=H):H=e[61];let P;e[62]!==a?(P=a("Assignee"),e[62]=a,e[63]=P):P=e[63];let fe=`issues-assignee-${s.hash}`,xe=s.assignee??"",ve=s.assignee??"",J;e[64]!==a?(J=a("Unassigned"),e[64]=a,e[65]=J):J=e[65];let Q;e[66]!==d||e[67]!==M||e[68]!==P||e[69]!==fe||e[70]!==xe||e[71]!==ve||e[72]!==J?(Q=(0,t.jsx)(R,{children:(0,t.jsx)(ke,{"aria-label":P,className:"h-7 w-32","data-testid":fe,defaultValue:xe,disabled:d,onKeyDown:M,placeholder:J},ve)}),e[66]=d,e[67]=M,e[68]=P,e[69]=fe,e[70]=xe,e[71]=ve,e[72]=J,e[73]=Q):Q=e[73];let X;e[74]!==s.count?(X=(0,t.jsx)(R,{className:"text-right",children:(0,t.jsx)(me,{variant:"secondary",children:s.count})}),e[74]=s.count,e[75]=X):X=e[75];let Y;e[76]!==s.lastSeen?(Y=Te(s.lastSeen),e[76]=s.lastSeen,e[77]=Y):Y=e[77];let Z;e[78]!==Y?(Z=(0,t.jsx)(R,{className:"text-xs tabular-nums text-muted-foreground",children:Y}),e[78]=Y,e[79]=Z):Z=e[79];let ee;e[80]!==d||e[81]!==s.hash||e[82]!==s.status||e[83]!==i||e[84]!==a?(ee=s.status!=="resolved"&&(0,t.jsx)(ne,{"data-testid":`issues-resolve-${s.hash}`,disabled:d,onClick:o(()=>{de(i(s.hash,Qe,{}))},"onClick"),size:"xs",variant:"outline",children:a("Resolve")}),e[80]=d,e[81]=s.hash,e[82]=s.status,e[83]=i,e[84]=a,e[85]=ee):ee=e[85];let se;e[86]!==d||e[87]!==s.hash||e[88]!==s.status||e[89]!==i||e[90]!==a?(se=s.status!=="ignored"&&(0,t.jsx)(ne,{"data-testid":`issues-ignore-${s.hash}`,disabled:d,onClick:o(()=>{de(i(s.hash,Xe,{}))},"onClick"),size:"xs",variant:"ghost",children:a("Ignore")}),e[86]=d,e[87]=s.hash,e[88]=s.status,e[89]=i,e[90]=a,e[91]=se):se=e[91];let te;e[92]!==d||e[93]!==s.assignee||e[94]!==s.hash||e[95]!==s.status||e[96]!==i||e[97]!==a?(te=s.status!=="open"&&(0,t.jsx)(ne,{"data-testid":`issues-reopen-${s.hash}`,disabled:d,onClick:o(()=>{de(i(s.hash,Ue,{assignee:s.assignee??null}))},"onClick"),size:"xs",variant:"ghost",children:a("Reopen")}),e[92]=d,e[93]=s.assignee,e[94]=s.hash,e[95]=s.status,e[96]=i,e[97]=a,e[98]=te):te=e[98];let ae;e[99]!==ee||e[100]!==se||e[101]!==te?(ae=(0,t.jsx)(R,{className:"text-right",children:(0,t.jsxs)("div",{className:"flex justify-end gap-1",children:[ee,se,te]})}),e[99]=ee,e[100]=se,e[101]=te,e[102]=ae):ae=e[102];let ie;e[103]!==g||e[104]!==I||e[105]!==H||e[106]!==Q||e[107]!==X||e[108]!==Z||e[109]!==z||e[110]!==ae?(ie=(0,t.jsxs)(pe,{"data-testid":z,children:[g,I,H,Q,X,Z,ae]}),e[103]=g,e[104]=I,e[105]=H,e[106]=Q,e[107]=X,e[108]=Z,e[109]=z,e[110]=ae,e[111]=ie):ie=e[111];let le;e[112]!==C||e[113]!==s||e[114]!==r?(le=(0,t.jsx)(as,{expanded:C,issue:s,shardKey:r},s.sampleMessage),e[112]=C,e[113]=s,e[114]=r,e[115]=le):le=e[115];let he;return e[116]!==ie||e[117]!==le?(he=(0,t.jsxs)(t.Fragment,{children:[ie,le]}),e[116]=ie,e[117]=le,e[118]=he):he=e[118],he},"tt"),ks=o(n=>{let e=(0,ge.c)(38),{initialShardKey:d}=n,s=ue(),$=Ne(),[i,r]=(0,O.useState)(d??""),[a,C]=(0,O.useState)("all"),[E,T]=(0,O.useState)(ns),[F,_]=(0,O.useState)(os),K;e[0]!==i?(K=i.trim(),e[0]=i,e[1]=K):K=e[1];let h=ze(K,400),M;e[2]!==a?(M=a==="all"?{}:{status:a},e[2]=a,e[3]=M):M=e[3];let z;e[4]!==h?(z={live:!0,shardKey:h},e[4]=h,e[5]=z):z=e[5];let{data:c,error:x,liveError:y}=_e(D.getIssues,M,z),w=c!==void 0,u;if(e[6]!==F||e[7]!==E||e[8]!==$||e[9]!==c||e[10]!==h||e[11]!==x||e[12]!==y||e[13]!==w||e[14]!==i||e[15]!==a||e[16]!==s){let A=es(c),m;e[18]!==$||e[19]!==h?(m=o(async(l,V,W)=>{_(N=>{if(!N.has(l))return N;let k=new Map(N);return k.delete(l),k}),T(N=>new Set(N).add(l));try{await $.query(V,{...W,hash:l},we(h))}catch(N){let k=Ee(N);_(U=>new Map(U).set(l,k))}T(N=>{let k=new Set(N);return k.delete(l),k})},"u"),e[18]=$,e[19]=h,e[20]=m):m=e[20];let b=m,p;e[21]!==s?(p=o(l=>s(l==="all"?"All":l==="open"?"Open":l==="resolved"?"Resolved":"Ignored"),"m"),e[21]=s,e[22]=p):p=e[22];let v=p,g;e[23]!==x?(g=x!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"issues-error",role:"alert",children:x}),e[23]=x,e[24]=g):g=e[24];let S;e[25]!==i?(S=(0,t.jsx)(Ke,{onChange:r,testId:"issues-shard-input",value:i}),e[25]=i,e[26]=S):S=e[26];let f;e[27]!==y?(f=(0,t.jsx)(Ve,{message:y,prefix:"issues"}),e[27]=y,e[28]=f):f=e[28];let I;e[29]!==a||e[30]!==v?(I=Pe.map(l=>(0,t.jsx)(ne,{"data-active":a===l?"":void 0,"data-testid":`issues-filter-${l}`,onClick:o(()=>{C(l)},"onClick"),size:"xs",variant:a===l?"default":"outline",children:v(l)},l)),e[29]=a,e[30]=v,e[31]=I):I=e[31];let j;e[32]!==I?(j=(0,t.jsx)("div",{className:"ms-auto flex items-center gap-1","data-testid":"issues-status-filter",role:"group",children:I}),e[32]=I,e[33]=j):j=e[33];let L;e[34]!==j||e[35]!==S||e[36]!==f?(L=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[S,f,j]}),e[34]=j,e[35]=S,e[36]=f,e[37]=L):L=e[37],u=(0,t.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-issues-panel",children:[g,L,w&&A.length===0?(0,t.jsx)(Ce,{description:s("No grouped errors yet. When a function throws or a container crashes, matching errors fold into a single issue here."),testId:"issues-empty",title:s("No issues")}):(0,t.jsx)(Me,{className:"overflow-hidden py-0",children:(0,t.jsx)(Ae,{className:"px-0",children:(0,t.jsxs)(Le,{"data-testid":"issues-table",children:[(0,t.jsx)(je,{children:(0,t.jsxs)(pe,{children:[(0,t.jsx)(q,{children:s("Issue")}),(0,t.jsx)(q,{children:s("Status")}),(0,t.jsx)(q,{children:s("Severity")}),(0,t.jsx)(q,{children:s("Assignee")}),(0,t.jsx)(q,{className:"text-right",children:s("Events")}),(0,t.jsx)(q,{children:s("Last seen")}),(0,t.jsx)(q,{className:"text-right",children:s("Actions")})]})}),(0,t.jsx)(Fe,{children:A.map(l=>(0,t.jsx)(is,{busy:E.has(l.hash),issue:l,rowError:F.get(l.hash),runTriage:b,shardKey:h},l.hash))})]})})})]}),e[6]=F,e[7]=E,e[8]=$,e[9]=c,e[10]=h,e[11]=x,e[12]=y,e[13]=w,e[14]=i,e[15]=a,e[16]=s,e[17]=u}else u=e[17];return u},"kt");function ls(n){return!n}o(ls,"st");function rs(n){return(0,t.jsx)(be,{value:n,children:n},n)}o(rs,"at");function ns(){return new Set}o(ns,"it");function os(){return new Map}o(os,"rt");export{ks as IssuesPanel};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{a as _,b as E,c as V,d as D,e as B,f as I,g as A,h as J}from"./chunk-KZ3ALMMP.js";import{a as H}from"./chunk-ESVP44Y3.js";import{a as F}from"./chunk-QXXIJAD5.js";import{d as T,l as M,o as z}from"./chunk-OG4N2XHD.js";import{a as m,e as U,f as G,g as X,h as Y}from"./chunk-3XIESWL4.js";var L=U(X(),1),W=U(G(),1);var i=U(Y(),1);var j="inline-flex items-center gap-1 rounded-md border border-border px-2.5 py-1 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50",Z=/["\n,]/u,ee=/^[=+\-@\t\r]/u,K=m(t=>{if(t==null)return"";let e;return typeof t=="string"?e=ee.test(t)?` ${t}`:t:typeof t=="number"||typeof t=="boolean"||typeof t=="bigint"?e=String(t):e=JSON.stringify(t),Z.test(e)?`"${e.replaceAll('"','""')}"`:e},"E"),te=m((t,e)=>{let n=t.map(o=>K(o)).join(","),a=e.map(o=>t.map(l=>K(o[l])).join(","));return[n,...a].join(`
|
|
2
|
+
`)},"X"),le=m(t=>JSON.stringify(t,null,2),"Y"),P=500,Q=m(t=>`"${t.replaceAll('"','""')}"`,"J"),ne=m(t=>t==null?"NULL":typeof t=="number"?Number.isFinite(t)?String(t):"NULL":typeof t=="bigint"?String(t):typeof t=="boolean"?t?"1":"0":`'${(typeof t=="string"?t:JSON.stringify(t)).replaceAll("'","''")}'`,"Z"),oe=m((t,e,n)=>{if(e.length===0||n.length===0)return"";let a=e.map(l=>Q(l)).join(", "),o=[];for(let l=0;l<n.length;l+=P){let r=n.slice(l,l+P).map(s=>` (${e.map(c=>ne(s[c])).join(", ")})`).join(`,
|
|
3
|
+
`);o.push(`INSERT INTO ${Q(t)} (${a}) VALUES
|
|
4
|
+
${r};`)}return o.join(`
|
|
5
|
+
|
|
6
|
+
`)},"ee"),q=m((t,e,n)=>{if(!("document"in globalThis))return;let a=globalThis.URL.createObjectURL(new globalThis.Blob([e],{type:n})),o=globalThis.document.createElement("a");o.href=a,o.download=t,globalThis.document.body.append(o),o.click(),o.remove(),globalThis.URL.revokeObjectURL(a)},"A"),ae=m(t=>{let e=(0,L.c)(36),{columns:n,name:a,rows:o}=t,l=T(),r;e[0]!==n||e[1]!==a||e[2]!==o?(r=m(()=>{q(`${a}.csv`,te(n,o),"text/csv;charset=utf-8")},"i"),e[0]=n,e[1]=a,e[2]=o,e[3]=r):r=e[3];let s=r,c;e[4]!==a||e[5]!==o?(c=m(()=>{q(`${a}.json`,le(o),"application/json")},"s"),e[4]=a,e[5]=o,e[6]=c):c=e[6];let u=c,p;e[7]!==n||e[8]!==a||e[9]!==o?(p=m(()=>{q(`${a}.sql`,oe(a,n,o),"application/sql;charset=utf-8")},"g"),e[7]=n,e[8]=a,e[9]=o,e[10]=p):p=e[10];let d=p,f=o.length===0,h;e[11]!==f?(h=(0,i.jsx)(E,{className:j,"data-testid":"grid-export",disabled:f,title:"Exports only the rows loaded on the current page, not the whole table",children:"Export page"}),e[11]=f,e[12]=h):h=e[12];let N;e[13]===Symbol.for("react.memo_cache_sentinel")?(N=(0,i.jsx)(B,{children:"Export loaded rows"}),e[13]=N):N=e[13];let g;e[14]!==l?(g=l("CSV"),e[14]=l,e[15]=g):g=e[15];let C;e[16]!==s||e[17]!==g?(C=(0,i.jsx)(I,{"data-testid":"grid-export-csv",onClick:s,children:g}),e[16]=s,e[17]=g,e[18]=C):C=e[18];let y;e[19]!==l?(y=l("JSON"),e[19]=l,e[20]=y):y=e[20];let x;e[21]!==u||e[22]!==y?(x=(0,i.jsx)(I,{"data-testid":"grid-export-json",onClick:u,children:y}),e[21]=u,e[22]=y,e[23]=x):x=e[23];let w;e[24]!==l?(w=l("SQL"),e[24]=l,e[25]=w):w=e[25];let b;e[26]!==d||e[27]!==w?(b=(0,i.jsx)(I,{"data-testid":"grid-export-sql",onClick:d,children:w}),e[26]=d,e[27]=w,e[28]=b):b=e[28];let k;e[29]!==x||e[30]!==b||e[31]!==C?(k=(0,i.jsxs)(V,{align:"end",children:[N,C,x,b]}),e[29]=x,e[30]=b,e[31]=C,e[32]=k):k=e[32];let v;return e[33]!==k||e[34]!==h?(v=(0,i.jsxs)(_,{children:[h,k]}),e[33]=k,e[34]=h,e[35]=v):v=e[35],v},"te"),ie=m(t=>{let e=(0,L.c)(9),{column:n}=t,a;e[0]!==n?(a=m(()=>{n.toggleVisibility()},"a"),e[0]=n,e[1]=a):a=e[1];let o=a,l;e[2]!==n?(l=n.getIsVisible(),e[2]=n,e[3]=l):l=e[3];let r=`grid-column-${n.id}`,s;return e[4]!==n.id||e[5]!==o||e[6]!==l||e[7]!==r?(s=(0,i.jsx)(A,{checked:l,closeOnClick:!1,"data-testid":r,onCheckedChange:o,children:n.id}),e[4]=n.id,e[5]=o,e[6]=l,e[7]=r,e[8]=s):s=e[8],s},"le"),se=[],re=m(({backRelations:t=se,enabledBackRelations:e,onToggleBackRelation:n,table:a})=>{let o=T(),l=a.getIsAllColumnsVisible(),r=m(()=>{a.toggleAllColumnsVisible(!l)},"i");return(0,i.jsxs)(_,{children:[(0,i.jsx)(E,{className:j,"data-testid":"grid-columns",children:o("Columns")}),(0,i.jsxs)(V,{align:"end",className:"max-h-80 overflow-y-auto",children:[(0,i.jsxs)(D,{children:[(0,i.jsx)(B,{children:o("Columns")}),(0,i.jsx)(A,{checked:l,closeOnClick:!1,"data-testid":"grid-columns-all",onCheckedChange:r,children:o(l?"Hide all":"Show all")}),(0,i.jsx)(J,{}),a.getAllLeafColumns().filter(s=>!s.id.startsWith("__back__:")).map(s=>(0,i.jsx)(ie,{column:s},s.id))]}),t.length>0&&n!==void 0&&(0,i.jsxs)(D,{children:[(0,i.jsx)(J,{}),(0,i.jsx)(B,{children:o("Related")}),t.map(s=>{let c=`${s.table}.${s.column}`;return(0,i.jsx)(A,{checked:e?.has(c)===!0,closeOnClick:!1,"data-testid":`grid-back-relation-${c}`,onCheckedChange:m(()=>{n(c)},"onCheckedChange"),children:`\u2190 ${s.table}.${s.column}`},c)})]})]})]})},"oe"),ce=m(t=>{let e=(0,L.c)(19),{count:n,editable:a,onClear:o,onDelete:l}=t,r=T(),s;e[0]!==n||e[1]!==r?(s=r("{count} selected",{count:n}),e[0]=n,e[1]=r,e[2]=s):s=e[2];let c;e[3]!==s?(c=(0,i.jsx)("span",{className:"font-medium tabular-nums","data-testid":"grid-selection-count",children:s}),e[3]=s,e[4]=c):c=e[4];let u;e[5]!==r?(u=r("Clear"),e[5]=r,e[6]=u):u=e[6];let p;e[7]!==o||e[8]!==u?(p=(0,i.jsx)("button",{className:j,"data-testid":"grid-selection-clear",onClick:o,type:"button",children:u}),e[7]=o,e[8]=u,e[9]=p):p=e[9];let d;e[10]!==n||e[11]!==a||e[12]!==l||e[13]!==r?(d=a&&(0,i.jsx)(F,{confirmLabel:r("Delete {count} rows?",{count:n}),onConfirm:l,testId:"grid-selection-delete",children:r("Delete {count}",{count:n})}),e[10]=n,e[11]=a,e[12]=l,e[13]=r,e[14]=d):d=e[14];let f;return e[15]!==c||e[16]!==p||e[17]!==d?(f=(0,i.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-border bg-accent/40 px-3 py-1.5 text-xs","data-testid":"grid-selection-bar",children:[c,p,d]}),e[15]=c,e[16]=p,e[17]=d,e[18]=f):f=e[18],f},"ae"),be=m(t=>{let e=(0,L.c)(32),{column:n,onClose:a,value:o}=t,l=T(),[r,s]=(0,W.useState)(!1),c;e[0]!==o?(c=M(o),e[0]=o,e[1]=c):c=e[1];let u=c,p;e[2]!==u?(p=m(()=>{z(u)&&s(!0)},"g"),e[2]=u,e[3]=p):p=e[3];let d=p,f;e[4]!==l?(f=l("Cell value"),e[4]=l,e[5]=f):f=e[5];let h;e[6]!==n?(h=(0,i.jsx)("h2",{className:"truncate font-mono text-sm font-semibold text-foreground",children:n}),e[6]=n,e[7]=h):h=e[7];let N;e[8]!==r||e[9]!==l?(N=l(r?"Copied":"Copy"),e[8]=r,e[9]=l,e[10]=N):N=e[10];let g;e[11]!==d||e[12]!==N?(g=(0,i.jsx)("button",{className:j,"data-testid":"grid-cell-copy",onClick:d,type:"button",children:N}),e[11]=d,e[12]=N,e[13]=g):g=e[13];let C;e[14]!==l?(C=l("Close"),e[14]=l,e[15]=C):C=e[15];let y;e[16]!==a||e[17]!==C?(y=(0,i.jsx)("button",{className:j,"data-testid":"grid-cell-close",onClick:a,type:"button",children:C}),e[16]=a,e[17]=C,e[18]=y):y=e[18];let x;e[19]!==g||e[20]!==y?(x=(0,i.jsxs)("div",{className:"flex items-center gap-1.5",children:[g,y]}),e[19]=g,e[20]=y,e[21]=x):x=e[21];let w;e[22]!==h||e[23]!==x?(w=(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[h,x]}),e[22]=h,e[23]=x,e[24]=w):w=e[24];let b;e[25]!==u?(b=(0,i.jsx)("pre",{className:"min-h-0 flex-1 overflow-auto rounded-md border border-border bg-muted/30 p-3 font-mono text-xs whitespace-pre-wrap","data-testid":"grid-cell-value",children:u}),e[25]=u,e[26]=b):b=e[26];let k;return e[27]!==a||e[28]!==w||e[29]!==b||e[30]!==f?(k=(0,i.jsxs)(H,{className:"max-h-[70vh] w-[min(40rem,90vw)]",label:f,onClose:a,panelTestId:"grid-cell-dialog",testId:"grid-cell-dialog-overlay",variant:"dialog",children:[w,b]}),e[27]=a,e[28]=w,e[29]=b,e[30]=f,e[31]=k):k=e[31],k},"he"),fe=m(t=>{let e=(0,L.c)(36),{backRelations:n,enabledBackRelations:a,onToggleBackRelation:o,columns:l,editable:r,name:s,onBulkDelete:c,onToggleTranspose:u,rows:p,table:d,transposed:f}=t,h=T(),N;e[0]!==d?(N=d.getSelectedRowModel(),e[0]=d,e[1]=N):N=e[1];let g=N.rows,C;e[2]!==d?(C=m(()=>{d.resetRowSelection()},"f"),e[2]=d,e[3]=C):C=e[3];let y=C,x;e[4]!==c||e[5]!==g||e[6]!==d?(x=m(()=>{c(g.map(de)),d.resetRowSelection()},"C"),e[4]=c,e[5]=g,e[6]=d,e[7]=x):x=e[7];let w=x,b;e[8]!==l||e[9]!==s||e[10]!==p?(b=(0,i.jsx)(ae,{columns:l,name:s,rows:p}),e[8]=l,e[9]=s,e[10]=p,e[11]=b):b=e[11];let k;e[12]!==n||e[13]!==a||e[14]!==o||e[15]!==d?(k=(0,i.jsx)(re,{backRelations:n,enabledBackRelations:a,onToggleBackRelation:o,table:d}),e[12]=n,e[13]=a,e[14]=o,e[15]=d,e[16]=k):k=e[16];let v;e[17]!==h?(v=h("Swap rows and columns"),e[17]=h,e[18]=v):v=e[18];let $;e[19]!==h?($=h("Transpose"),e[19]=h,e[20]=$):$=e[20];let R;e[21]!==u||e[22]!==v||e[23]!==$||e[24]!==f?(R=(0,i.jsx)("button",{"aria-pressed":f,className:j,"data-testid":"grid-transpose",onClick:u,title:v,type:"button",children:$}),e[21]=u,e[22]=v,e[23]=$,e[24]=f,e[25]=R):R=e[25];let S;e[26]!==r||e[27]!==y||e[28]!==w||e[29]!==g.length?(S=g.length>0&&(0,i.jsx)(ce,{count:g.length,editable:r,onClear:y,onDelete:w}),e[26]=r,e[27]=y,e[28]=w,e[29]=g.length,e[30]=S):S=e[30];let O;return e[31]!==b||e[32]!==k||e[33]!==R||e[34]!==S?(O=(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5","data-testid":"grid-actions",children:[b,k,R,S]}),e[31]=b,e[32]=k,e[33]=R,e[34]=S,e[35]=O):O=e[35],O},"be");function de(t){return t.id}m(de,"re");export{ae as a,ce as b,be as c,fe as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b as S}from"./chunk-XDAT7LHC.js";import{a as y,e as A}from"./chunk-UZERI5YC.js";import{b as h}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{f as k}from"./chunk-EN2QAEO4.js";import"./chunk-XBDKZZ67.js";import{d as I}from"./chunk-OG4N2XHD.js";import"./chunk-AADILRJW.js";import{a as u,e as w,g as $,h as j}from"./chunk-3XIESWL4.js";var N=w($(),1);var a=w(j(),1);var z=[{key:"accounts",label:"Accounts"},{key:"admin",label:"Admin"},{key:"organization",label:"Organizations"},{key:"passkey",label:"Passkeys"},{key:"twoFactor",label:"Two-factor"}],v=u(e=>{if(e===void 0)return"\u2014";let i=[[86400,"d"],[3600,"h"],[60,"m"]];for(let[t,d]of i)if(e>=t&&e%t===0)return`${String(e/t)}${d}`;return`${String(e)}s`},"v"),g=u(e=>{let i=(0,N.c)(8),{children:t,heading:d,testId:r}=e,l;i[0]!==d?(l=(0,a.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,a.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:d})}),i[0]=d,i[1]=l):l=i[1];let n;i[2]!==t?(n=(0,a.jsx)(A,{className:"p-3",children:t}),i[2]=t,i[3]=n):n=i[3];let c;return i[4]!==l||i[5]!==n||i[6]!==r?(c=(0,a.jsxs)(y,{className:"gap-0 py-0","data-testid":r,children:[l,n]}),i[4]=l,i[5]=n,i[6]=r,i[7]=c):c=i[7],c},"h"),o=u(e=>{let i=(0,N.c)(7),{label:t,value:d}=e,r;i[0]!==t?(r=(0,a.jsx)("span",{className:"text-sm",children:t}),i[0]=t,i[1]=r):r=i[1];let l;i[2]!==d?(l=(0,a.jsx)("span",{className:"text-sm text-muted-foreground tabular-nums",children:d}),i[2]=d,i[3]=l):l=i[3];let n;return i[4]!==r||i[5]!==l?(n=(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs",children:[r,l]}),i[4]=r,i[5]=l,i[6]=n):n=i[6],n},"c"),T=u(()=>{let e=(0,N.c)(20),i=k(),t=I(),d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=["lunora-auth-config"],e[0]=d):d=e[0];let r;e[1]!==i?(r=u(()=>i.getAuthConfig(),"s"),e[1]=i,e[2]=r):r=e[2];let{data:l,error:n}=S(d,r),c;e[3]!==t?(c=u(s=>(0,a.jsx)(h,{variant:s?"success":"outline",children:t(s?"Enabled":"Disabled")}),"u"),e[3]=t,e[4]=c):c=e[4];let m=c,p;e[5]!==n?(p=n!==null&&(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-destructive","data-testid":"auth-config-error",role:"alert",children:n}),e[5]=n,e[6]=p):p=e[6];let f;e[7]!==l||e[8]!==n||e[9]!==t?(f=n===null&&l===void 0&&(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"auth-config-loading",children:t("Loading auth configuration\u2026")}),e[7]=l,e[8]=n,e[9]=t,e[10]=f):f=e[10];let x;e[11]!==l||e[12]!==n||e[13]!==m||e[14]!==t?(x=n===null&&l!==void 0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(g,{heading:t("Enabled capabilities"),testId:"auth-config-capabilities",children:(0,a.jsx)("ul",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:z.map(s=>{let P=l.capabilities[s.key];return(0,a.jsxs)("li",{className:"flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs","data-testid":`auth-config-cap-${s.key}`,children:[(0,a.jsx)("span",{className:"text-sm",children:t(s.label)}),m(P)]},s.key)})})}),(0,a.jsx)(g,{heading:t("Plugins"),testId:"auth-config-plugins",children:l.plugins.length===0?(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:t("No plugins enabled.")}):(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:l.plugins.map(L)})}),(0,a.jsx)(g,{heading:t("Sign-in methods"),testId:"auth-config-signin",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Email & password"),value:m(l.emailAndPassword)}),(0,a.jsx)(o,{label:t("Social providers"),value:l.socialProviders.length===0?t("None"):(0,a.jsx)("span",{className:"flex flex-wrap justify-end gap-1",children:l.socialProviders.map(q)})})]})}),l.organization.enabled&&(0,a.jsx)(g,{heading:t("Organizations"),testId:"auth-config-org",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Teams"),value:m(l.organization.teams)}),(0,a.jsx)(o,{label:t("Custom roles"),value:m(l.organization.roles)})]})}),(0,a.jsx)(g,{heading:t("Session policy"),testId:"auth-config-session",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Expires in"),value:v(l.session.expiresIn)}),(0,a.jsx)(o,{label:t("Refresh after"),value:v(l.session.updateAge)}),(0,a.jsx)(o,{label:t("Fresh window"),value:v(l.session.freshAge)}),(0,a.jsx)(o,{label:t("Cookie cache"),value:m(l.session.cookieCache===!0)})]})}),(0,a.jsx)(g,{heading:t("Rate limit"),testId:"auth-config-ratelimit",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Status"),value:m(l.rateLimit.enabled)}),l.rateLimit.enabled&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o,{label:t("Max requests"),value:l.rateLimit.max??"\u2014"}),(0,a.jsx)(o,{label:t("Window"),value:v(l.rateLimit.window)})]})]})}),l.userFields.length>0&&(0,a.jsx)(g,{heading:t("Plugin user fields"),testId:"auth-config-user-fields",children:(0,a.jsx)("ul",{className:"flex flex-col gap-2",children:l.userFields.map(s=>(0,a.jsxs)("li",{className:"flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs","data-testid":`auth-config-user-field-${s.name}`,children:[(0,a.jsxs)("span",{className:"flex flex-col",children:[(0,a.jsx)("span",{className:"font-mono text-xs",children:s.name}),s.plugin!==void 0&&(0,a.jsx)("span",{className:"text-[11px] text-muted-foreground",children:s.plugin})]}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)(h,{variant:"outline",children:s.type}),s.required&&(0,a.jsx)(h,{variant:"secondary",children:t("required")}),s.unique&&(0,a.jsx)(h,{variant:"secondary",children:t("unique")})]})]},s.name))})}),(0,a.jsx)(y,{className:"gap-0 py-0",children:(0,a.jsx)("p",{className:"px-4 py-3 text-xs text-muted-foreground","data-testid":"auth-config-note",children:t("OAuth providers, email templates, and rate limits are configured at deploy time in the better-auth setup and aren't editable here. See the Mail tab for email output.")})})]}),e[11]=l,e[12]=n,e[13]=m,e[14]=t,e[15]=x):x=e[15];let b;return e[16]!==p||e[17]!==f||e[18]!==x?(b=(0,a.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"auth-config",children:[p,f,x]}),e[16]=p,e[17]=f,e[18]=x,e[19]=b):b=e[19],b},"M");function L(e){return(0,a.jsx)(h,{"data-testid":`auth-config-plugin-${e}`,variant:"outline",children:e},e)}u(L,"P");function q(e){return(0,a.jsx)(h,{"data-testid":`auth-config-provider-${e}`,variant:"outline",children:e},e)}u(q,"z");export{T as AuthConfigPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as y}from"./chunk-GRL5MG3Z.js";import{R as k}from"./chunk-CFPZYHPY.js";import{d as j}from"./chunk-
|
|
1
|
+
import{a as y}from"./chunk-GRL5MG3Z.js";import{R as k}from"./chunk-CFPZYHPY.js";import{d as j}from"./chunk-OG4N2XHD.js";import{a as m,e as b,f as w,g as F,h as $}from"./chunk-3XIESWL4.js";var C=b(F(),1),h=b(w(),1);var a=b($(),1);var B=m(i=>{let t=(0,C.c)(21),{id:f,onChange:g,testId:e,value:v}=i,r=j(),u=(0,h.useId)(),[d]=(0,h.useState)(A),c;t[0]!==g?(c=m(S=>{g(S.target.value)},"m"),t[0]=g,t[1]=c):c=t[1];let x=c,s;t[2]!==r?(s=r("Shard key"),t[2]=r,t[3]=s):s=t[3];let I=d.length>0?u:void 0,o;t[4]!==r?(o=r("shard key (optional)"),t[4]=r,t[5]=o):o=t[5];let l;t[6]!==f||t[7]!==x||t[8]!==s||t[9]!==I||t[10]!==o||t[11]!==e||t[12]!==v?(l=(0,a.jsx)(k,{"aria-label":s,className:"h-8 w-48","data-testid":e,id:f,list:I,onChange:x,placeholder:o,value:v}),t[6]=f,t[7]=x,t[8]=s,t[9]=I,t[10]=o,t[11]=e,t[12]=v,t[13]=l):l=t[13];let n;t[14]!==u||t[15]!==d||t[16]!==e?(n=d.length>0&&(0,a.jsx)("datalist",{"data-testid":`${e}-recents`,id:u,children:d.map(N)}),t[14]=u,t[15]=d,t[16]=e,t[17]=n):n=t[17];let p;return t[18]!==l||t[19]!==n?(p=(0,a.jsxs)(a.Fragment,{children:[l,n]}),t[18]=l,t[19]=n,t[20]=p):p=t[20],p},"A");function A(){return y()}m(A,"F");function N(i){return(0,a.jsx)("option",{"aria-label":i,value:i},i)}m(N,"w");export{B as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as D,c as g,d as P,f as k}from"./chunk-EN2QAEO4.js";import{f as v,g as S,h as T,m as q}from"./chunk-OG4N2XHD.js";import{a as i,e as A,f as $,g as M}from"./chunk-3XIESWL4.js";var I=A(M(),1);var f=A($(),1);var l=i(e=>typeof e=="string"?e===""?void 0:e:typeof e=="number"||typeof e=="boolean"?String(e):void 0,"u"),h=i(e=>e.filter(r=>r!==void 0).join(" "),"d"),Q={deleteRows:i(e=>h([l(e.table),Array.isArray(e.ids)?`${String(e.ids.length)} rows`:void 0]),"deleteRows"),facetColumn:i(e=>h([l(e.table),l(e.column)]),"facetColumn"),lintSql:i(()=>"sql","lintSql"),readTablePage:i(e=>h([l(e.table),Array.isArray(e.filters)&&e.filters.length>0?`${String(e.filters.length)} filters`:void 0,typeof e.search=="string"&&e.search!==""?"search":void 0,typeof e.limit=="number"?`limit ${String(e.limit)}`:void 0]),"readTablePage"),runMigration:i(e=>h([l(e.id),l(e.direction),e.dryRun===!0?"dry-run":void 0]),"runMigration"),runSql:i(e=>typeof e.sql=="string"?`${String(e.sql.length)} chars`:"","runSql"),schemaVersion:i(e=>typeof e.hash=="string"?e.hash.slice(0,8):"","schemaVersion"),writeRow:i(e=>h([l(e.table),"1 row"]),"writeRow")},E="__lunora_admin__:",C=i((e,r)=>{let s=e.startsWith(E)?e.slice(E.length):e,t=Q[s];if(t!==void 0)return t(r);let n=Object.keys(r);return n.length===0?"":n.join(", ")},"N"),L=i(e=>{if(Array.isArray(e))return e.length;if(!(typeof e!="object"||e===null)){for(let r of Object.values(e))if(Array.isArray(r))return r.length}},"K"),w=class{static{i(this,"L")}entries=[];listeners=new Set;nextSeq=1;getSnapshot=i(()=>this.entries,"getSnapshot");subscribe=i(r=>(this.listeners.add(r),()=>{this.listeners.delete(r)}),"subscribe");start(r,s,t){return this.append(r,s,t,"call","pending")}startSubscription(r,s,t){return this.append(r,s,t,"subscription","live")}recordPush(r){if(this.listeners.size===0){let s=this.entries.find(t=>t.seq===r);s!==void 0&&(s.pushes=(s.pushes??0)+1);return}this.patch(r,s=>({...s,pushes:(s.pushes??0)+1}))}failSubscription(r,s){this.patch(r,t=>({...t,error:s,status:"error"}))}endSubscription(r){this.patch(r,s=>s.status==="error"?s:{...s,durationMs:Date.now()-s.startedAt,status:"closed"})}lastErrorSeq(){return this.entries.findLast(r=>r.status==="error")?.seq}settle(r,s){this.patch(r,t=>({...t,durationMs:Date.now()-t.startedAt,...s.error===void 0?{resultCount:L(s.result),status:"ok"}:{error:s.error,status:"error"}}))}clear(){this.entries=[],this.emit()}append(r,s,t,n,a){let o=this.nextSeq;this.nextSeq+=1;let d={functionPath:r,kind:n,seq:o,shardKey:t,startedAt:Date.now(),status:a,summary:C(r,s),...n==="subscription"?{pushes:0}:{}},u=[...this.entries,d];return this.entries=u.length>300?u.slice(u.length-300):u,this.emit(),o}patch(r,s){let t=this.entries.findIndex(n=>n.seq===r);t!==-1&&(this.entries=this.entries.with(t,s(this.entries[t])),this.emit())}emit(){for(let r of this.listeners)r()}},p=new w,_=i((e,r,s)=>["lunora-admin",e,r,s.trim()],"q");function R(e,r,s={}){let{enabled:t=!0,keepPreviousData:n=!1,staleTime:a=0}=s,o=P({enabled:t,queryFn:r,placeholderData:n?D:void 0,queryKey:e,staleTime:a});return{data:o.data,error:o.error?T(o.error):o.error,errorSource:o.error??void 0,isLoading:o.isLoading,liveError:void 0,refetch:i(()=>{q(o.refetch())},"refetch")}}i(R,"M");function V(e,r,s={}){let t=k(),n=g(),{enabled:a=!0,keepPreviousData:o=!1,live:d=!1,shardKey:u="",staleTime:j}=s,m=_(e,r,u),x=R(m,()=>t.query(v(e),r,S(u)),{enabled:a,keepPreviousData:o,staleTime:j??(d?Number.POSITIVE_INFINITY:0)}),[N,y]=(0,f.useState)(void 0),O=JSON.stringify(m);return(0,f.useEffect)(()=>{if(!a||!d)return;y(void 0);let b=p.startSubscription(e,r,u),K=t.subscribe(v(e),r,c=>{p.recordPush(b),y(void 0),n.setQueryData(m,c)},{...S(u),onError:i(c=>{p.failSubscription(b,c.message),y(c.message)},"onError")});return()=>{p.endSubscription(b),K()}},[O,a,d]),{...x,liveError:a&&d?N:void 0}}i(V,"z");var U=i(()=>{let e=(0,I.c)(2),r=g(),s;return e[0]!==r?(s=i((t,n,a)=>{let o=n===void 0?["lunora-admin",t]:_(t,n,a??"");q(r.invalidateQueries({queryKey:o}))},"e"),e[0]=r,e[1]=s):s=e[1],s},"J");export{p as a,R as b,V as c,U as d};
|