@malloy-publisher/server 0.0.189-dev → 0.0.191
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 +7 -3
- package/dist/{instrumentation.js → instrumentation.mjs} +10481 -10519
- package/dist/{server.js → server.mjs} +14932 -15011
- package/package.json +6 -6
- package/src/mcp/prompts/handlers.ts +1 -1
- package/src/server.ts +6 -10
- package/src/service/model.ts +7 -3
- package/src/storage/duckdb/DuckDBConnection.ts +1 -1
- package/tsconfig.json +1 -1
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@malloy-publisher/server",
|
|
3
3
|
"description": "Malloy Publisher Server",
|
|
4
|
-
"version": "0.0.
|
|
5
|
-
"main": "dist/server.
|
|
4
|
+
"version": "0.0.191",
|
|
5
|
+
"main": "dist/server.mjs",
|
|
6
6
|
"bin": {
|
|
7
|
-
"malloy-publisher": "dist/server.
|
|
7
|
+
"malloy-publisher": "dist/server.mjs"
|
|
8
8
|
},
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
"test:integration": "bun test --timeout 100000 tests",
|
|
20
20
|
"build": "bun generate-api-types && bun build:app && NODE_ENV=production bun run build.ts",
|
|
21
21
|
"build:server-only": "bun generate-api-types && NODE_ENV=production bun run build.ts",
|
|
22
|
-
"start": "NODE_ENV=production
|
|
23
|
-
"start:init": "NODE_ENV=production
|
|
22
|
+
"start": "NODE_ENV=production bun run ./dist/server.mjs",
|
|
23
|
+
"start:init": "NODE_ENV=production bun run ./dist/server.mjs --init",
|
|
24
24
|
"start:dev": "NODE_ENV=development bun --watch src/server.ts",
|
|
25
25
|
"start:dev:init": "NODE_ENV=development bun --watch src/server.ts --init",
|
|
26
|
-
"start:instrumented": "
|
|
26
|
+
"start:instrumented": "bun --preload ./dist/instrumentation.mjs ./dist/server.mjs",
|
|
27
27
|
"lint": "bunx eslint \"./src/**/*.ts\"",
|
|
28
28
|
"format": "bunx prettier --write '**/*.{ts,tsx}'",
|
|
29
29
|
"build:app": "cd ../app && NODE_ENV=production bunx vite build",
|
package/src/server.ts
CHANGED
|
@@ -6,13 +6,14 @@ import {
|
|
|
6
6
|
} from "./instrumentation";
|
|
7
7
|
|
|
8
8
|
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
9
|
-
import
|
|
9
|
+
import bodyParser from "body-parser";
|
|
10
10
|
import cors from "cors";
|
|
11
11
|
import express from "express";
|
|
12
12
|
import * as http from "http";
|
|
13
13
|
import { createProxyMiddleware } from "http-proxy-middleware";
|
|
14
14
|
import { AddressInfo } from "net";
|
|
15
15
|
import * as path from "path";
|
|
16
|
+
import { fileURLToPath } from "url";
|
|
16
17
|
import { CompileController } from "./controller/compile.controller";
|
|
17
18
|
import { ConnectionController } from "./controller/connection.controller";
|
|
18
19
|
import { DatabaseController } from "./controller/database.controller";
|
|
@@ -120,15 +121,10 @@ const SHUTDOWN_DRAIN_DURATION_SECONDS = Number(
|
|
|
120
121
|
const SHUTDOWN_GRACEFUL_CLOSE_TIMEOUT_SECONDS = Number(
|
|
121
122
|
process.env.SHUTDOWN_GRACEFUL_CLOSE_TIMEOUT_SECONDS || 0,
|
|
122
123
|
);
|
|
123
|
-
// Find the app directory
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
ROOT = path.join(path.dirname(require.main.filename), "app");
|
|
128
|
-
} else {
|
|
129
|
-
// Fallback to current script directory
|
|
130
|
-
ROOT = path.join(path.dirname(process.argv[1] || __filename), "app");
|
|
131
|
-
}
|
|
124
|
+
// Find the app directory relative to this bundled server file.
|
|
125
|
+
// Works under both ESM (import.meta.url) and when invoked via NPX.
|
|
126
|
+
const __filename_esm = fileURLToPath(import.meta.url);
|
|
127
|
+
const ROOT = path.join(path.dirname(__filename_esm), "app");
|
|
132
128
|
const SERVER_ROOT = path.resolve(process.cwd(), process.env.SERVER_ROOT || ".");
|
|
133
129
|
const API_PREFIX = "/api/v0";
|
|
134
130
|
const isDevelopment = process.env["NODE_ENV"] === "development";
|
package/src/service/model.ts
CHANGED
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
MalloySQLParser,
|
|
23
23
|
MalloySQLStatementType,
|
|
24
24
|
} from "@malloydata/malloy-sql";
|
|
25
|
-
import
|
|
25
|
+
import { createRequire } from "module";
|
|
26
26
|
import { DataStyles } from "@malloydata/render";
|
|
27
27
|
import { metrics } from "@opentelemetry/api";
|
|
28
28
|
import * as fs from "fs/promises";
|
|
@@ -45,9 +45,9 @@ import { BuildManifest } from "../storage/DatabaseInterface";
|
|
|
45
45
|
import { URL_READER } from "../utils";
|
|
46
46
|
import {
|
|
47
47
|
buildFilterClause,
|
|
48
|
+
FilterValidationError,
|
|
48
49
|
injectFilterRefinement,
|
|
49
50
|
parseFilters,
|
|
50
|
-
FilterValidationError,
|
|
51
51
|
type FilterDefinition,
|
|
52
52
|
type FilterParams,
|
|
53
53
|
} from "./filter";
|
|
@@ -65,7 +65,11 @@ export type PostgresConnection = components["schemas"]["PostgresConnection"];
|
|
|
65
65
|
export type BigqueryConnection = components["schemas"]["BigqueryConnection"];
|
|
66
66
|
export type TrinoConnection = components["schemas"]["TrinoConnection"];
|
|
67
67
|
|
|
68
|
-
const MALLOY_VERSION =
|
|
68
|
+
const MALLOY_VERSION = (
|
|
69
|
+
createRequire(import.meta.url)("@malloydata/malloy/package.json") as {
|
|
70
|
+
version: string;
|
|
71
|
+
}
|
|
72
|
+
).version;
|
|
69
73
|
|
|
70
74
|
export type ModelType = "model" | "notebook";
|
|
71
75
|
|
package/tsconfig.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"target": "ESNext", // Specifies the JavaScript version to target when transpiling code.
|
|
4
4
|
"lib": ["ESNext", "DOM", "DOM.Iterable"], // Specifies the libraries available for the code.
|
|
5
|
-
"module": "
|
|
5
|
+
"module": "ESNext", // Emits ESM syntax; Bun bundler handles final module format.
|
|
6
6
|
"skipLibCheck": true, // Skips type checking of declaration files.
|
|
7
7
|
"useDefineForClassFields": true, // Enables the use of 'define' for class fields.
|
|
8
8
|
"experimentalDecorators": true,
|