@malloy-publisher/server 0.0.175 → 0.0.177
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/app/api-doc.yaml +7 -58
- package/dist/app/assets/{HomePage-_GXfGtrF.js → HomePage-CwUkFsA8.js} +1 -1
- package/dist/app/assets/{MainPage-UqGzQjP1.js → MainPage-JYvDXOkC.js} +1 -1
- package/dist/app/assets/{ModelPage-CnwgkZU6.js → ModelPage-TEQrhaqq.js} +1 -1
- package/dist/app/assets/{PackagePage-CqmgyERX.js → PackagePage-CgE-izLw.js} +1 -1
- package/dist/app/assets/{ProjectPage-5jrEp4pr.js → ProjectPage-PiMPpFX8.js} +1 -1
- package/dist/app/assets/{RouteError-CjrNNYGo.js → RouteError-DnSZEzkT.js} +1 -1
- package/dist/app/assets/{WorkbookPage-Cy2UHLkL.js → WorkbookPage-DjQ8u5DD.js} +1 -1
- package/dist/app/assets/{index-DfOHc8G8.js → index--80Q7qw1.js} +1 -1
- package/dist/app/assets/{index-ZpoRvcIi.js → index-BJUsHnGO.js} +40 -40
- package/dist/app/assets/{index-_xQHc-7Q.js → index-CZ4G_NMp.js} +1 -1
- package/dist/app/assets/{index.umd-Bq6CbCSn.js → index.umd-Cf-wqh-R.js} +1 -1
- package/dist/app/index.html +1 -1
- package/dist/server.js +514 -544
- package/package.json +1 -1
- package/src/controller/connection.controller.ts +56 -60
- package/src/server.ts +10 -25
- package/src/service/db_utils.spec.ts +712 -0
- package/src/service/db_utils.ts +786 -755
- package/src/service/project.ts +2 -2
- package/src/service/project_store.ts +6 -19
- package/tests/unit/ducklake/ducklake.test.ts +3 -3
package/src/service/project.ts
CHANGED
|
@@ -121,7 +121,7 @@ export class Project {
|
|
|
121
121
|
projectPath: string,
|
|
122
122
|
connections: ApiConnection[],
|
|
123
123
|
): Promise<Project> {
|
|
124
|
-
if (!(await fs.promises.stat(projectPath))
|
|
124
|
+
if (!(await fs.promises.stat(projectPath))?.isDirectory()) {
|
|
125
125
|
throw new ProjectNotFoundError(
|
|
126
126
|
`Project path ${projectPath} not found`,
|
|
127
127
|
);
|
|
@@ -383,7 +383,7 @@ export class Project {
|
|
|
383
383
|
.access(packagePath)
|
|
384
384
|
.then(() => true)
|
|
385
385
|
.catch(() => false)) ||
|
|
386
|
-
!(await fs.promises.stat(packagePath))
|
|
386
|
+
!(await fs.promises.stat(packagePath))?.isDirectory()
|
|
387
387
|
) {
|
|
388
388
|
throw new PackageNotFoundError(`Package ${packageName} not found`);
|
|
389
389
|
}
|
|
@@ -569,22 +569,10 @@ export class ProjectStore {
|
|
|
569
569
|
private async cleanupAndCreatePublisherPath() {
|
|
570
570
|
const reInit = process.env.INITIALIZE_STORAGE === "true";
|
|
571
571
|
|
|
572
|
-
// Ensure serverRootPath exists
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
throw new Error(
|
|
577
|
-
`Server root path ${this.serverRootPath} exists but is not a directory`,
|
|
578
|
-
);
|
|
579
|
-
}
|
|
580
|
-
} catch (error) {
|
|
581
|
-
if ((error as NodeJS.ErrnoException).code === "ENOENT") {
|
|
582
|
-
// Directory doesn't exist, create it
|
|
583
|
-
await fs.promises.mkdir(this.serverRootPath, { recursive: true });
|
|
584
|
-
} else {
|
|
585
|
-
throw error;
|
|
586
|
-
}
|
|
587
|
-
}
|
|
572
|
+
// Ensure serverRootPath exists as a directory (mkdir recursive is a
|
|
573
|
+
// no-op when the directory already exists and avoids a Bun-on-Windows
|
|
574
|
+
// bug where fs.promises.stat resolves to undefined instead of throwing)
|
|
575
|
+
await fs.promises.mkdir(this.serverRootPath, { recursive: true });
|
|
588
576
|
|
|
589
577
|
if (reInit) {
|
|
590
578
|
const uploadDocsPath = path.join(
|
|
@@ -1233,9 +1221,8 @@ export class ProjectStore {
|
|
|
1233
1221
|
if (projectPath.endsWith(".zip")) {
|
|
1234
1222
|
projectPath = await this.unzipProject(projectPath);
|
|
1235
1223
|
}
|
|
1236
|
-
const projectDirExists =
|
|
1237
|
-
await fs.promises.stat(projectPath)
|
|
1238
|
-
).isDirectory();
|
|
1224
|
+
const projectDirExists =
|
|
1225
|
+
(await fs.promises.stat(projectPath))?.isDirectory() ?? false;
|
|
1239
1226
|
if (projectDirExists) {
|
|
1240
1227
|
await fs.promises.rm(absoluteTargetPath, {
|
|
1241
1228
|
recursive: true,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "../../../src/service/connection";
|
|
11
11
|
import {
|
|
12
12
|
getSchemasForConnection,
|
|
13
|
-
|
|
13
|
+
listTablesForSchema,
|
|
14
14
|
} from "../../../src/service/db_utils";
|
|
15
15
|
|
|
16
16
|
type ApiConnection = components["schemas"]["Connection"];
|
|
@@ -421,8 +421,8 @@ describe("DuckLake Connection Tests", () => {
|
|
|
421
421
|
}
|
|
422
422
|
|
|
423
423
|
// Test table listing for first schema
|
|
424
|
-
const schemaName = schemas[0].name
|
|
425
|
-
const tables = await
|
|
424
|
+
const schemaName = schemas[0].name!;
|
|
425
|
+
const tables = await listTablesForSchema(
|
|
426
426
|
ducklakeConnection,
|
|
427
427
|
schemaName,
|
|
428
428
|
connection,
|