@malloy-publisher/server 0.17.0 → 0.17.2
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/admin-api-doc.yaml +2 -1
- package/dist/app/api-doc.yaml +212 -618
- package/dist/app/assets/{EnvironmentPage-D2-0ts2G.js → EnvironmentPage-DF2PahCR.js} +1 -1
- package/dist/app/assets/{HomePage-S_Bkczsx.js → HomePage-DIYlgPCz.js} +1 -1
- package/dist/app/assets/{MainPage-DEy4SyjJ.js → MainPage-C7PGAA5k.js} +1 -1
- package/dist/app/assets/ModelPage-BMoBnrW7.js +2 -0
- package/dist/app/assets/PackagePage-DD2vLSFe.js +1 -0
- package/dist/app/assets/{PackageSplatRoute-ChFCJOWE.js → PackageSplatRoute-BYIMwnLL.js} +2 -2
- package/dist/app/assets/{RenderedResult-BcEDcw0V.es-BD6PNbt6.js → RenderedResult-CYJ2Y9Fm.es-C8nokn71.js} +7 -7
- package/dist/app/assets/{RouteError-CDSSYdLB.js → RouteError-B8dE60Vs.js} +1 -1
- package/dist/app/assets/{ThemeEditorPage-DO2JWYOR.js → ThemeEditorPage-D0wf74fh.js} +1 -1
- package/dist/app/assets/{ToggleButtonGroup-BylAiUaK.js → ToggleButtonGroup-CX0_J2zR.js} +1 -1
- package/dist/app/assets/{documentRoutes-CaOt2rpR.js → documentRoutes-DgSMAc0m.js} +1 -1
- package/dist/app/assets/{editPageMounted-79YCIKgP.js → editPageMounted-BUGVg-_g.js} +2 -2
- package/dist/app/assets/{index-BOCBPBsi.js → index-BQL8UUcK.js} +1 -1
- package/dist/app/assets/{index-CPSEdm5f.js → index-BiOT4K_d.js} +1 -1
- package/dist/app/assets/{index-keJ8KKBp.js → index-DAQjZOAL.js} +1 -1
- package/dist/app/assets/index-DRkw60sj.js +512 -0
- package/dist/app/assets/{index.es-DTreXoC5.js → index.es-DgNl8IqU.js} +20 -20
- package/dist/app/assets/usePackageLinkNavigate-bHr_AFYo.js +1 -0
- package/dist/app/assets/{usePackageRoute-G6fA1__J.js → usePackageRoute-BhB6txS6.js} +1 -1
- package/dist/app/index.html +1 -1
- package/dist/app/mcp-app/report.js +2683 -757
- package/dist/instrumentation.mjs +4 -4
- package/dist/package_load_worker.mjs +364 -62
- package/dist/server.mjs +84274 -81768
- package/package.json +2 -2
- package/dist/app/assets/ModelPage-BVHjDM-u.js +0 -2
- package/dist/app/assets/PackagePage-Cbrg7o1X.js +0 -1
- package/dist/app/assets/index-BKjEX4_C.js +0 -512
- package/dist/app/assets/usePackageLinkNavigate-BfSAqkJS.js +0 -1
package/package.json
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"snowflake"
|
|
20
20
|
],
|
|
21
21
|
"homepage": "https://docs.malloydata.dev/documentation/user_guides/publishing/mcp_agents",
|
|
22
|
-
"version": "0.17.
|
|
22
|
+
"version": "0.17.2",
|
|
23
23
|
"main": "dist/server.mjs",
|
|
24
24
|
"bin": {
|
|
25
25
|
"malloy-publisher": "dist/server.mjs"
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"test": "bun run test:unit && bun run test:component && bun run test:integration",
|
|
44
44
|
"test:unit": "bun test --timeout 100000 ./src",
|
|
45
45
|
"test:coverage": "bun run test:unit --coverage",
|
|
46
|
-
"test:component": "bun test --timeout 200000 ./tests/component",
|
|
46
|
+
"test:component": "bun test --timeout 200000 ./tests/component ./tests/conformance",
|
|
47
47
|
"test:integration": "bun test --timeout 200000 ./tests/integration --max-workers=1",
|
|
48
48
|
"perf:router": "bun tests/perf/router_bench.ts",
|
|
49
49
|
"perf:main-thread": "bun tests/perf/main-thread/run.ts",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.es-DTreXoC5.js","assets/index-BKjEX4_C.js","assets/index-DUqldpo0.css","assets/ToggleButtonGroup-BylAiUaK.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{y as te,F as B,r as f,d7 as ne,d8 as se,d9 as U,da as W,a5 as q,E as I,j as t,J as m,db as re,a7 as E,dc as z,a4 as oe,az as ae,dd as ie,bn as ce,de as le,D as de,A as k,df as ue,as as fe,a2 as O,a3 as G,dg as he,dh as pe,a6 as H,T as w,di as me,dj as N,H as xe,dk as ge,a1 as ve,a0 as P,dl as L,C as je,Q as ye,dm as be,dn as _,dp as we,dq as Ee}from"./index-BKjEX4_C.js";import{i as D,w as Re,a as K,l as ke}from"./documentRoutes-CaOt2rpR.js";import{v as Se,w as A,u as V}from"./usePackageRoute-G6fA1__J.js";import{u as Ce}from"./usePackageLinkNavigate-BfSAqkJS.js";import{T as X,P as S}from"./PackageSplatRoute-ChFCJOWE.js";import{a as De,l as Y}from"./editPageMounted-79YCIKgP.js";function Ae(e,n,s){const r=te(),{reports:a,settled:h,isError:c}=B(e,n,Se(s)),o=h&&!c;return f.useCallback((i,l)=>{const u=i.path;if(!ne(u))return"malformed";const d=se(u,a),p=A(U(e,n,d.kind==="path"?d.report.path:u),e,n,s),g=new URLSearchParams(i.givens).toString();return r(p+(g?`?${g}`:""),l),d.kind==="path"?"resolved":o?"unresolved":"unverified"},[r,e,n,s,a,o])}const Te='[data-tile-kind="query"]',$e=".malloy-render, .malloy-table, [role='alert'], .MuiAlert-root",Me=3e3;function J(e,n,s,r){const a=f.useRef(s);a.current=s;const h=f.useRef(!1);f.useEffect(()=>{if(!a.current||h.current)return;let c=0;const o={},i=()=>{clearTimeout(u),o.beat!==void 0&&clearInterval(o.beat),cancelAnimationFrame(c),o.observer?.disconnect()},l=()=>{h.current||(h.current=!0,i(),a.current?.())},u=setTimeout(l,Me);if(!n)return()=>clearTimeout(u);const d=()=>{const p=e.current;if(!p||r&&p.querySelector(r)===null)return;const g=window.innerHeight;[...p.querySelectorAll(Te)].filter(x=>{if(x.getBoundingClientRect().top>=g)return!1;const j=x.querySelector($e);return!j||j.getBoundingClientRect().height<8}).length===0&&c===0&&(c=requestAnimationFrame(()=>{c=requestAnimationFrame(l)}))};return o.observer=new MutationObserver(d),e.current&&o.observer.observe(e.current,{childList:!0,subtree:!0}),o.beat=setInterval(d,50),d(),i},[n,e,r])}function Q({environmentName:e,packageName:n,versionId:s,path:r,editable:a=r.endsWith(".malloy"),onReady:h}){const c=f.useRef(null);J(c,!0,h,`.${ae.report}`);const{params:o,onGivensChange:i}=W(),{versionSegment:l}=V(),u=Ae(e,n,l),d=Ce(e,n,l),p=f.useMemo(()=>q({environmentName:e,packageName:n}),[e,n]),g=I();return f.useEffect(()=>{if(!a||g)return;const y=()=>void oe(()=>import("./index.es-DTreXoC5.js"),__vite__mapDeps([0,1,2,3])),x=window.requestIdleCallback;if(x){const j=x(y);return()=>window.cancelIdleCallback?.(j)}const v=setTimeout(y,1500);return()=>clearTimeout(v)},[a,g]),t.jsx(m,{ref:c,sx:X,children:r.endsWith(".malloynb")?t.jsx(re,{resourceUri:E({environmentName:e,packageName:n,modelPath:r,versionId:s}),givens:o,onGivensChange:i,onNavigate:d,onDrillNavigate:u,maxResultSize:1024*1024}):t.jsx(z,{resourceUri:E({environmentName:e,packageName:n,versionId:s}),path:r,givens:o,onGivensChange:i,onNavigate:u,onLinkNavigate:d,onEvent:p,maxResultSize:1024*1024})})}function Pe(){const[e,n]=f.useState(!1),s=f.useRef(!1),r=f.useRef(!1),a=f.useCallback(i=>{s.current=i,n(i)},[]),h=f.useCallback(()=>{r.current=!0},[]),c=ie(f.useCallback(({currentLocation:i,nextLocation:l})=>s.current&&!r.current&&(i.pathname!==l.pathname||D(i.search)!==D(l.search)),[]));f.useEffect(()=>{if(!e)return;const i=l=>{l.preventDefault(),l.returnValue=""};return window.addEventListener("beforeunload",i),()=>window.removeEventListener("beforeunload",i)},[e]);const o=t.jsx(ce,{open:c.state==="blocked",canSave:!1,onKeepEditing:()=>c.reset?.(),onDiscard:()=>c.proceed?.()});return{onDirtyChange:a,leaving:h,dialog:o}}const Le=G.lazy(()=>Y().then(e=>({default:e.ReportEditor}))),_e=G.lazy(()=>Y().then(e=>({default:e.BuilderBar})));function Fe(){const[e,n]=f.useState(null);return f.useEffect(()=>{n(document.getElementById("header-actions-portal"))},[]),e}function Z({environmentName:e,packageName:n,path:s,layout:r="grid",onReady:a,quietLoading:h=!1,offstage:c=!1}){const o=Pe();De();const[i]=f.useState(le),l=de(),{pathname:u,search:d}=k(),p=Fe(),[g,y]=f.useState(),x=f.useRef(null),v=I();J(x,g!==void 0||v,a);const j=()=>l(`${u.replace(/\/$/,"")}${Re(d)}`),C=f.useMemo(()=>q({environmentName:e,packageName:n}),[e,n]),R=t.jsx(z,{resourceUri:E({environmentName:e,packageName:n}),path:s,manifestStaleTime:1e4});return t.jsxs(m,{ref:x,sx:X,children:[t.jsx(ue,{children:t.jsx(f.Suspense,{fallback:h?null:R,children:t.jsx(Le,{resourceUri:E({environmentName:e,packageName:n}),path:s,layout:r,keepDraft:i,onDirtyChange:o.onDirtyChange,onExit:j,onOpenModel:b=>l(`/${[e,n,...b.split("/")].map(encodeURIComponent).join("/")}`),onEvent:C,loading:h?null:R,onControlsChange:y},`${e}/${n}/${s}`)})}),o.dialog,p&&!c&&fe.createPortal(t.jsx(f.Suspense,{fallback:t.jsx(O,{variant:"contained",disableElevation:!0,onClick:j,children:"Done"}),children:t.jsx(_e,{controls:g,onDone:j})}),p)]})}function Be({environmentName:e,packageName:n,versionSegment:s,routePath:r,edit:a,reports:h,children:c}){const{search:o}=k(),i=d=>A(U(e,n,d),e,n,s),l=he(r);if(!l)return t.jsx(t.Fragment,{children:c});const u=pe(l.name,h,l.prefer);return"found"in u?t.jsx(H,{replace:!0,to:`${i(u.found.path)}${a?K(o):o}`}):"ambiguous"in u?t.jsxs(m,{sx:S,children:[t.jsxs(w,{variant:"h6",sx:{fontWeight:"fontWeightMedium"},children:["More than one report is named ",l.name]}),t.jsx(w,{variant:"body2",color:"text.secondary",sx:{mt:1},children:"This is an old link, which names a report by its file name alone. Open one by its path:"}),t.jsx(m,{component:"ul",sx:{mt:1},children:u.ambiguous.map(d=>t.jsx("li",{children:t.jsx(me,{to:i(d),style:{fontFamily:N},children:d})},d))})]}):t.jsx(t.Fragment,{children:c})}function Ue({environmentName:e,packageName:n,routePath:s,edit:r,notFound:a,notFoundUntilListed:h=!1,versionId:c,versionSegment:o,readOnly:i=!1}){const{reports:l,settled:u,isFetching:d,isError:p,refetch:g}=B(e,n,c),{search:y}=k(),x=`${s}.malloy`,v=u?xe(x,l):void 0,j=u&&!d&&!p,[C,R]=f.useState();f.useEffect(()=>{j&&R(x)},[j,x]);const b=v!==void 0||j||C===x,T=ge(e,n,x,r&&!i&&b&&!v),$=ee=>t.jsx(Be,{environmentName:e,packageName:n,...o!==void 0?{versionSegment:o}:{},routePath:s,edit:r,reports:l,children:ee});if(!b&&(h&&!r&&!v))return $(a);if(!b&&p&&!d)return t.jsx(m,{sx:S,children:t.jsxs(ve,{severity:"warning",action:t.jsx(O,{color:"inherit",size:"small",onClick:()=>void g(),children:"Retry"}),children:["Could not list this package's reports, so this page cannot tell what is at ",s,"."]})});if(!b)return t.jsx(P,{text:L.opening()});if(v)return t.jsx(We,{environmentName:e,packageName:n,...c!==void 0?{versionId:c}:{},path:v.path,editable:i?!1:v.editable,layout:v.layout,edit:r&&!i});const M=r?void 0:ke(s);return M!==void 0?t.jsx(H,{replace:!0,to:`${A(`/${e}/${n}/${M.split("/").map(encodeURIComponent).join("/")}`,e,n,o)}${K(y)}`}):$(r&&!i?T.settled?t.jsx(Z,{environmentName:e,packageName:n,path:x,layout:T.layout??"grid"}):t.jsx(P,{text:L.opening()}):a)}function We({environmentName:e,packageName:n,versionId:s,path:r,editable:a,layout:h,edit:c}){const[o,i]=f.useState(c?"editor":"reader"),l=c?"editor":"reader",u=l==="reader"||o==="reader",d=l==="editor"||o==="editor",p={position:"absolute",inset:0,visibility:"hidden",pointerEvents:"none",overflow:"hidden"};return t.jsxs(m,{sx:{position:"relative"},"data-switching":u&&d||void 0,children:[u&&t.jsx(m,{sx:o==="reader"?void 0:p,"aria-hidden":o!=="reader"||void 0,children:t.jsx(Q,{environmentName:e,packageName:n,...s!==void 0?{versionId:s}:{},path:r,...a!==void 0?{editable:a}:{},onReady:()=>{c||i("reader")}})},"reader"),d&&t.jsx(m,{sx:o==="editor"?void 0:p,"aria-hidden":o!=="editor"||void 0,children:t.jsx(Z,{environmentName:e,packageName:n,path:r,...h?{layout:h}:{},quietLoading:u,offstage:l!=="editor"||o!=="editor",onReady:()=>{c&&i("editor")}})},"editor")]})}function Ke(){const e=je(),{search:n}=k(),{path:s,versionId:r,versionSegment:a,writable:h}=V({always:!0}),{server:c}=ye(),{params:o,onGivensChange:i,setParam:l}=W();if(!e.environmentName)return t.jsx("div",{children:t.jsx("h2",{children:"Missing environment name"})});if(!e.packageName)return t.jsx("div",{children:t.jsx("h2",{children:"Missing package name"})});if(s!==void 0&&s!==""&&!s.endsWith(".malloy")&&!s.endsWith(".malloynb")){const d=s.replace(/\/$/,""),p=d.startsWith("data-apps/"),g=p?t.jsx(be,{resourceUri:E({environmentName:e.environmentName,packageName:e.packageName,modelPath:d.slice(10),versionId:r})}):t.jsx(F,{environmentName:e.environmentName,packageName:e.packageName,modelPath:s,staticUrl:_({server:c,environmentName:e.environmentName,packageName:e.packageName,path:s,...r!==void 0?{versionId:r}:{}})});return t.jsx(Ue,{environmentName:e.environmentName,packageName:e.packageName,...r!==void 0?{versionId:r}:{},...a!==void 0?{versionSegment:a}:{},readOnly:!h,routePath:d,edit:D(n),notFound:g,notFoundUntilListed:p})}const u=E({environmentName:e.environmentName,packageName:e.packageName,modelPath:s,versionId:r});return s?.endsWith(".malloy")?t.jsx(m,{sx:S,children:t.jsx(we,{resourceUri:u,runOnDemand:!0,sourceName:o.source,onSourceChange:d=>l("source",d),givens:o,onGivensChange:i,maxResultSize:512*1024})}):s?.endsWith(".malloynb")?t.jsx(Q,{environmentName:e.environmentName,packageName:e.packageName,...r!==void 0?{versionId:r}:{},path:s,editable:!1}):t.jsx(F,{environmentName:e.environmentName,packageName:e.packageName,modelPath:s??"",staticUrl:_({server:c,environmentName:e.environmentName,packageName:e.packageName,path:s??"",...r!==void 0?{versionId:r}:{}})})}function F({packageName:e,modelPath:n,staticUrl:s}){const r=/\.[^./]+$/.test(n),a={fontFamily:N};return t.jsxs(m,{sx:S,children:[t.jsx(w,{variant:"h6",sx:{fontWeight:"fontWeightMedium"},children:"Nothing to open at this path"}),t.jsxs(w,{variant:"body2",color:"text.secondary",sx:{mt:1},children:[t.jsx(m,{component:"span",sx:a,children:n})," ","does not name a report, a"," ",t.jsx(m,{component:"span",sx:a,children:".malloy"})," ","or a"," ",t.jsx(m,{component:"span",sx:a,children:".malloynb"})," ","file in package"," ",t.jsx(m,{component:"span",sx:a,children:e}),". This address opens reports by their path without"," ",t.jsx(m,{component:"span",sx:a,children:".malloy"}),", and"," ",t.jsx(m,{component:"span",sx:a,children:".malloy"})," ","and"," ",t.jsx(m,{component:"span",sx:a,children:".malloynb"})," ","files."]}),r&&t.jsxs(w,{variant:"body2",color:"text.secondary",sx:{mt:1},children:["A file from the package's"," ",t.jsx(m,{component:"span",sx:a,children:"public/"})," ","directory is served at ",t.jsx(Ee,{href:s,children:s}),"."]}),t.jsx(w,{variant:"body2",color:"text.secondary",sx:{mt:1},children:"The package lists its reports, models, and data apps."})]})}export{Ke as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as x,y as N,D as f,r as h,a5 as j,j as n,a6 as P,a7 as E,a8 as L}from"./index-BKjEX4_C.js";import{d as M}from"./documentRoutes-CaOt2rpR.js";import{u as R,p as r,L as c}from"./usePackageRoute-G6fA1__J.js";import{u as S}from"./usePackageLinkNavigate-BfSAqkJS.js";function D(){const{environmentName:e,packageName:a,versionSegment:o,versionId:m,versioned:u}=R({always:!0}),{search:g}=x(),p=N(),v=f(),i=S(e??"",a??"",o),l=h.useMemo(()=>j({environmentName:e??"",packageName:a??""}),[e,a]);if(e){if(!a)return n.jsx("div",{children:n.jsx("h2",{children:"Missing package name"})})}else return n.jsx("div",{children:n.jsx("h2",{children:"Missing environment name"})});if(u&&o===void 0)return n.jsx(P,{to:`${r(e,a,c)}${g}`,replace:!0});const d=E({environmentName:e,packageName:a,versionId:m});return n.jsx(L,{onClickPackageFile:i,onOpenDocument:({path:s,mode:t},k)=>i(M(e,a,s,t),k),onSelectVersion:(s,t)=>p(r(e,a,s),t),onReplaceVersion:s=>v(r(e,a,s??c),{replace:!0}),resourceUri:d,onEvent:l})}export{D as default};
|