@malloy-publisher/server 0.0.86 → 0.0.88
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/build.ts +25 -0
- package/dist/app/api-doc.yaml +83 -0
- package/dist/app/assets/{RenderedResult-BAZuT25g-_eLjVkSo.js → RenderedResult-BAZuT25g-DLMDvQic.js} +2 -2
- package/dist/app/assets/{index-BvRGZn2o.js → index-CNRCklos.js} +211 -206
- package/dist/app/assets/index-CcIq0aEZ.css +1 -0
- package/dist/app/assets/index-CobAY3LE.js +427 -0
- package/dist/app/assets/index-lhN38COk.js +211 -0
- package/dist/app/assets/index.umd-CSPhcx55.js +2105 -0
- package/dist/app/index.html +2 -2
- package/dist/instrumentation.js +67969 -35371
- package/dist/server.js +49297 -40630
- package/package.json +7 -4
- package/publisher.config.json +1 -1
- package/src/config.ts +20 -0
- package/src/constants.ts +6 -0
- package/src/controller/package.controller.ts +41 -2
- package/src/controller/watch-mode.controller.ts +83 -0
- package/src/errors.ts +2 -1
- package/src/server.ts +22 -14
- package/src/service/connection.ts +7 -7
- package/src/service/model.ts +6 -6
- package/src/service/package.ts +4 -4
- package/src/service/project.ts +6 -4
- package/src/service/project_store.spec.ts +19 -14
- package/src/service/project_store.ts +262 -47
- package/src/utils.ts +0 -18
- package/dist/app/assets/index-C-lp8bCy.js +0 -210
- package/dist/app/assets/index-EI2L5apg.js +0 -432
- package/dist/app/assets/index-RMQQYOAi.css +0 -1
- package/dist/app/assets/index.umd-DBkg1U_t.js +0 -2078
package/build.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { build } from "bun";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
|
|
4
|
+
fs.rmSync("./dist", { recursive: true, force: true });
|
|
5
|
+
fs.mkdirSync("./dist");
|
|
6
|
+
|
|
7
|
+
await build({
|
|
8
|
+
entrypoints: ["./src/server.ts", "./src/instrumentation.ts"],
|
|
9
|
+
outdir: "./dist",
|
|
10
|
+
target: "node",
|
|
11
|
+
format: "cjs",
|
|
12
|
+
external: [
|
|
13
|
+
"@malloydata/db-duckdb",
|
|
14
|
+
"@malloydata/malloy",
|
|
15
|
+
"@malloydata/malloy-sql",
|
|
16
|
+
"@malloydata/render",
|
|
17
|
+
"@malloydata/db-bigquery",
|
|
18
|
+
"@malloydata/db-mysql",
|
|
19
|
+
"@malloydata/db-postgres",
|
|
20
|
+
"@malloydata/db-snowflake",
|
|
21
|
+
"@malloydata/db-trino",
|
|
22
|
+
],
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
fs.cpSync("../app/dist", "./dist/app", { recursive: true });
|
package/dist/app/api-doc.yaml
CHANGED
|
@@ -994,6 +994,58 @@ paths:
|
|
|
994
994
|
"501":
|
|
995
995
|
$ref: "#/components/responses/NotImplementedError"
|
|
996
996
|
|
|
997
|
+
/watch-mode/status:
|
|
998
|
+
get:
|
|
999
|
+
tags:
|
|
1000
|
+
- watch-mode
|
|
1001
|
+
operationId: get-watch-status
|
|
1002
|
+
summary: Returns the current watch mode status.
|
|
1003
|
+
responses:
|
|
1004
|
+
"200":
|
|
1005
|
+
description: The current watch mode status.
|
|
1006
|
+
content:
|
|
1007
|
+
application/json:
|
|
1008
|
+
schema:
|
|
1009
|
+
$ref: "#/components/schemas/WatchStatus"
|
|
1010
|
+
"401":
|
|
1011
|
+
$ref: "#/components/responses/UnauthorizedError"
|
|
1012
|
+
"500":
|
|
1013
|
+
$ref: "#/components/responses/InternalServerError"
|
|
1014
|
+
|
|
1015
|
+
/watch-mode/start:
|
|
1016
|
+
post:
|
|
1017
|
+
tags:
|
|
1018
|
+
- watch-mode
|
|
1019
|
+
operationId: start-watching
|
|
1020
|
+
summary: Starts watching a project for file changes.
|
|
1021
|
+
requestBody:
|
|
1022
|
+
required: true
|
|
1023
|
+
content:
|
|
1024
|
+
application/json:
|
|
1025
|
+
schema:
|
|
1026
|
+
$ref: "#/components/schemas/StartWatchRequest"
|
|
1027
|
+
responses:
|
|
1028
|
+
"200":
|
|
1029
|
+
description: Watch mode started successfully.
|
|
1030
|
+
"401":
|
|
1031
|
+
$ref: "#/components/responses/UnauthorizedError"
|
|
1032
|
+
"500":
|
|
1033
|
+
$ref: "#/components/responses/InternalServerError"
|
|
1034
|
+
|
|
1035
|
+
/watch-mode/stop:
|
|
1036
|
+
post:
|
|
1037
|
+
tags:
|
|
1038
|
+
- watch-mode
|
|
1039
|
+
operationId: stop-watching
|
|
1040
|
+
summary: Stops watching for file changes.
|
|
1041
|
+
responses:
|
|
1042
|
+
"200":
|
|
1043
|
+
description: Watch mode stopped successfully.
|
|
1044
|
+
"401":
|
|
1045
|
+
$ref: "#/components/responses/UnauthorizedError"
|
|
1046
|
+
"500":
|
|
1047
|
+
$ref: "#/components/responses/InternalServerError"
|
|
1048
|
+
|
|
997
1049
|
components:
|
|
998
1050
|
responses:
|
|
999
1051
|
InternalServerError:
|
|
@@ -1053,6 +1105,9 @@ components:
|
|
|
1053
1105
|
readme:
|
|
1054
1106
|
type: string
|
|
1055
1107
|
description: Project readme.
|
|
1108
|
+
location:
|
|
1109
|
+
type: string
|
|
1110
|
+
description: Project location, it can be an absolute path or an URI (e.g. github, s3, gcs, etc.).
|
|
1056
1111
|
|
|
1057
1112
|
Package:
|
|
1058
1113
|
type: object
|
|
@@ -1066,6 +1121,9 @@ components:
|
|
|
1066
1121
|
description:
|
|
1067
1122
|
type: string
|
|
1068
1123
|
description: Package description.
|
|
1124
|
+
location:
|
|
1125
|
+
type: string
|
|
1126
|
+
description: Package location, it can be an absolute path or an URI (e.g. github, s3, gcs, etc.).
|
|
1069
1127
|
|
|
1070
1128
|
Model:
|
|
1071
1129
|
type: object
|
|
@@ -1459,3 +1517,28 @@ components:
|
|
|
1459
1517
|
type: array
|
|
1460
1518
|
items:
|
|
1461
1519
|
$ref: "#/components/schemas/Column"
|
|
1520
|
+
|
|
1521
|
+
WatchStatus:
|
|
1522
|
+
type: object
|
|
1523
|
+
description: Current watch mode status
|
|
1524
|
+
properties:
|
|
1525
|
+
enabled:
|
|
1526
|
+
type: boolean
|
|
1527
|
+
description: Whether watch mode is currently enabled
|
|
1528
|
+
projectName:
|
|
1529
|
+
type: string
|
|
1530
|
+
description: Name of the project being watched
|
|
1531
|
+
watchingPath:
|
|
1532
|
+
type: string
|
|
1533
|
+
nullable: true
|
|
1534
|
+
description: The path being watched, null if not watching
|
|
1535
|
+
|
|
1536
|
+
StartWatchRequest:
|
|
1537
|
+
type: object
|
|
1538
|
+
description: Request to start watching a project
|
|
1539
|
+
properties:
|
|
1540
|
+
projectName:
|
|
1541
|
+
type: string
|
|
1542
|
+
description: Name of the project to watch
|
|
1543
|
+
required:
|
|
1544
|
+
- projectName
|
package/dist/app/assets/{RenderedResult-BAZuT25g-_eLjVkSo.js → RenderedResult-BAZuT25g-DLMDvQic.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.umd-
|
|
2
|
-
import{j as a,r as c,_ as w}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.umd-CSPhcx55.js","assets/index-CobAY3LE.js","assets/index-CcIq0aEZ.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{j as a,r as c,_ as w}from"./index-CobAY3LE.js";const x=async e=>{if(typeof window>"u")throw new Error("MalloyRenderer can only be used in browser environment");const{MalloyRenderer:d}=await w(async()=>{const{MalloyRenderer:i}=await import("./index.umd-CSPhcx55.js").then(l=>l.i);return{MalloyRenderer:i}},__vite__mapDeps([0,1,2]));return new d({onClick:e}).createViz()};function m({result:e,height:d,isFillElement:i,onSizeChange:l,onDrill:y}){const u=c.useRef(null),[g,f]=c.useState(!1);return c.useLayoutEffect(()=>{if(!u.current||!e)return;let t=!0;const r=u.current;for(;r.firstChild;)r.removeChild(r.firstChild);return x(y).then(o=>{if(!t)return;const n=new MutationObserver(s=>{for(const h of s)if(h.type==="childList"&&h.addedNodes.length>0&&Array.from(h.addedNodes).some(p=>p.nodeType===Node.ELEMENT_NODE)){n.disconnect(),setTimeout(()=>{t&&f(!0)},50);break}});n.observe(r,{childList:!0,subtree:!0,characterData:!0});try{o.setResult(JSON.parse(e)),o.render(r)}catch(s){console.error("Error rendering visualization:",s),n.disconnect(),t&&f(!0)}}).catch(o=>{console.error("Failed to create renderer:",o),t&&f(!0)}),()=>{t=!1}},[e,y]),c.useEffect(()=>{if(!u.current||!g)return;const t=u.current,r=()=>{if(t){const s=t.offsetHeight;s>0?l&&l(s):i&&t.firstChild&&(t.firstChild.offsetHeight==0?i(!0):i(!1))}},o=setTimeout(r,100);let n=null;return n=new MutationObserver(r),n.observe(t,{childList:!0,subtree:!0,attributes:!0}),()=>{clearTimeout(o),n?.disconnect()}},[l,e,i,g]),a.jsx("div",{ref:u,style:{width:"100%",height:d?`${d}px`:"100%"}})}function E(e){return typeof window>"u"?a.jsx("div",{style:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"#666"},children:"Loading..."}):a.jsx(c.Suspense,{fallback:a.jsx("div",{style:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"#666"},children:"Loading visualization..."}),children:a.jsx(m,{...e})})}export{E as default};
|