yamchart 0.10.1 → 0.10.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/{advisor-5TJDNAY7.js → advisor-5F73GF54.js} +12 -12
- package/dist/{chunk-S2CH4HUZ.js → chunk-25ES7MGF.js} +4 -4
- package/dist/{chunk-QUIDZO5G.js → chunk-5CRXV5PQ.js} +22 -6
- package/dist/chunk-5CRXV5PQ.js.map +1 -0
- package/dist/chunk-7HWFVUGP.js +1239 -0
- package/dist/chunk-7HWFVUGP.js.map +1 -0
- package/dist/{chunk-5FHV22X2.js → chunk-PYVROL7Z.js} +4 -4
- package/dist/{chunk-64CI3HSY.js → chunk-UOSOZT47.js} +15 -8
- package/dist/{chunk-64CI3HSY.js.map → chunk-UOSOZT47.js.map} +1 -1
- package/dist/{chunk-ZBCQNWVN.js → chunk-WVSDQNAN.js} +5 -5
- package/dist/{chunk-UFDQ3C7Q.js → chunk-X3UG6T3Q.js} +257 -257
- package/dist/chunk-X3UG6T3Q.js.map +1 -0
- package/dist/{connection-utils-FEUWER5I.js → connection-utils-HNX3473B.js} +5 -5
- package/dist/{describe-MEP72B56.js → describe-KDGXFPDQ.js} +7 -7
- package/dist/{dev-H6SJZ5UA.js → dev-KOWFGDOP.js} +933 -127
- package/dist/dev-KOWFGDOP.js.map +1 -0
- package/dist/dev-supervisor-JXLVGEHP.js +43 -0
- package/dist/dev-supervisor-JXLVGEHP.js.map +1 -0
- package/dist/{dist-5DQO6L2S.js → dist-LK3ZG74Q.js} +5 -5
- package/dist/{dist-PPAD6KOM.js → dist-WMP7BFKP.js} +24 -2
- package/dist/{dist-XNCED7JW.js → dist-YB5RBWCC.js} +4 -4
- package/dist/index.js +65 -42
- package/dist/index.js.map +1 -1
- package/dist/{init-SECXKD5G.js → init-TJJVKMEN.js} +24 -5
- package/dist/init-TJJVKMEN.js.map +1 -0
- package/dist/public/assets/DataView-BfwnWnLH.js +9 -0
- package/dist/public/assets/{EventManagement-BnmeJDQl.js → EventManagement-BIkVUSCe.js} +2 -2
- package/dist/public/assets/ExplorePage-CeaAulqT.js +1 -0
- package/dist/public/assets/{LoginPage-CzaFkkjg.js → LoginPage-4WeNcdRi.js} +1 -1
- package/dist/public/assets/{PublicViewer-irjxqH6a.js → PublicViewer-CkW-G56D.js} +1 -1
- package/dist/public/assets/{SetupWizard-ConWIcmy.js → SetupWizard-CwTr3PCy.js} +1 -1
- package/dist/public/assets/{ShareManagement-CP4wdwLR.js → ShareManagement-DSon6CoC.js} +1 -1
- package/dist/public/assets/{SourceDetailView-DZS5518E.js → SourceDetailView-BA4XVKqV.js} +1 -1
- package/dist/public/assets/UserManagement-BWD2Ugkv.js +1 -0
- package/dist/public/assets/{index-C1X8RW4Z.css → index-Cb4omrVn.css} +1 -1
- package/dist/public/assets/{index-jlfTO7f5.js → index-iR9gLdl9.js} +41 -41
- package/dist/public/assets/{index.es-CgnvEWi5.js → index.es-BuEtjxhO.js} +1 -1
- package/dist/public/assets/{jspdf.es.min-Cw5WefMt.js → jspdf.es.min-CScx2_oK.js} +3 -3
- package/dist/public/index.html +2 -2
- package/dist/{query-2H3YOPI2.js → query-7XHKSZ5H.js} +5 -5
- package/dist/sample-YNSJ3I3T.js +76 -0
- package/dist/sample-YNSJ3I3T.js.map +1 -0
- package/dist/{search-IPE4ISFB.js → search-NKRXXLRS.js} +7 -7
- package/dist/semantic-DD7P4634.js +30 -0
- package/dist/{semantic-K3MYXXJI.js → semantic-NBAX4WU4.js} +39 -4
- package/dist/semantic-NBAX4WU4.js.map +1 -0
- package/dist/{source-resolver-HZQLOODU.js → source-resolver-7NY3KEZ2.js} +7 -7
- package/dist/source-resolver-7NY3KEZ2.js.map +1 -0
- package/dist/{sync-warehouse-TUNULDUY.js → sync-warehouse-PK7HXW7U.js} +15 -11
- package/dist/sync-warehouse-PK7HXW7U.js.map +1 -0
- package/dist/{tables-K5NAN2WK.js → tables-WQTRZSXR.js} +7 -7
- package/dist/templates/default/docs/yamchart-reference.md +26 -0
- package/dist/{test-SRHVOXZB.js → test-MKNKUR3N.js} +19 -7
- package/dist/test-MKNKUR3N.js.map +1 -0
- package/package.json +5 -5
- package/dist/chunk-QUIDZO5G.js.map +0 -1
- package/dist/chunk-UFDQ3C7Q.js.map +0 -1
- package/dist/chunk-ZIY22VO7.js +0 -1190
- package/dist/chunk-ZIY22VO7.js.map +0 -1
- package/dist/dev-H6SJZ5UA.js.map +0 -1
- package/dist/init-SECXKD5G.js.map +0 -1
- package/dist/public/assets/DataView-DUCz_96y.js +0 -9
- package/dist/public/assets/ExplorePage-kk4z9ldZ.js +0 -1
- package/dist/public/assets/UserManagement-AubGd9hl.js +0 -1
- package/dist/sample-ODUGGSFA.js +0 -42
- package/dist/sample-ODUGGSFA.js.map +0 -1
- package/dist/semantic-K3MYXXJI.js.map +0 -1
- package/dist/sync-warehouse-TUNULDUY.js.map +0 -1
- package/dist/test-SRHVOXZB.js.map +0 -1
- /package/dist/{advisor-5TJDNAY7.js.map → advisor-5F73GF54.js.map} +0 -0
- /package/dist/{chunk-S2CH4HUZ.js.map → chunk-25ES7MGF.js.map} +0 -0
- /package/dist/{chunk-5FHV22X2.js.map → chunk-PYVROL7Z.js.map} +0 -0
- /package/dist/{chunk-ZBCQNWVN.js.map → chunk-WVSDQNAN.js.map} +0 -0
- /package/dist/{connection-utils-FEUWER5I.js.map → connection-utils-HNX3473B.js.map} +0 -0
- /package/dist/{describe-MEP72B56.js.map → describe-KDGXFPDQ.js.map} +0 -0
- /package/dist/{dist-5DQO6L2S.js.map → dist-LK3ZG74Q.js.map} +0 -0
- /package/dist/{dist-PPAD6KOM.js.map → dist-WMP7BFKP.js.map} +0 -0
- /package/dist/{dist-XNCED7JW.js.map → dist-YB5RBWCC.js.map} +0 -0
- /package/dist/{query-2H3YOPI2.js.map → query-7XHKSZ5H.js.map} +0 -0
- /package/dist/{search-IPE4ISFB.js.map → search-NKRXXLRS.js.map} +0 -0
- /package/dist/{source-resolver-HZQLOODU.js.map → semantic-DD7P4634.js.map} +0 -0
- /package/dist/{tables-K5NAN2WK.js.map → tables-WQTRZSXR.js.map} +0 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { createRequire as __yamchartCreateRequire } from 'module'; if (!globalThis.require) globalThis.require = __yamchartCreateRequire(import.meta.url);
|
|
2
|
+
import "./chunk-7D4SUZUM.js";
|
|
3
|
+
|
|
4
|
+
// src/commands/dev-supervisor.ts
|
|
5
|
+
import { spawn } from "child_process";
|
|
6
|
+
var RESTART_EXIT_CODE = 75;
|
|
7
|
+
function shouldRestart(code, signal) {
|
|
8
|
+
return signal === null && code === RESTART_EXIT_CODE;
|
|
9
|
+
}
|
|
10
|
+
function superviseDevServer(argv) {
|
|
11
|
+
let child = null;
|
|
12
|
+
let shuttingDown = false;
|
|
13
|
+
const start = () => {
|
|
14
|
+
child = spawn(process.execPath, [process.argv[1], ...argv], {
|
|
15
|
+
stdio: "inherit",
|
|
16
|
+
env: { ...process.env, YAMCHART_DEV_CHILD: "1" }
|
|
17
|
+
});
|
|
18
|
+
child.on("exit", (code, signal) => {
|
|
19
|
+
if (shuttingDown) {
|
|
20
|
+
process.exit(0);
|
|
21
|
+
}
|
|
22
|
+
if (shouldRestart(code, signal)) {
|
|
23
|
+
start();
|
|
24
|
+
} else {
|
|
25
|
+
process.exit(code ?? 0);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
for (const sig of ["SIGINT", "SIGTERM"]) {
|
|
30
|
+
process.once(sig, () => {
|
|
31
|
+
shuttingDown = true;
|
|
32
|
+
if (child) child.kill(sig);
|
|
33
|
+
else process.exit(0);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
start();
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
RESTART_EXIT_CODE,
|
|
40
|
+
shouldRestart,
|
|
41
|
+
superviseDevServer
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=dev-supervisor-JXLVGEHP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/dev-supervisor.ts"],"sourcesContent":["import { spawn, type ChildProcess } from 'node:child_process';\n\n/** The child requests a restart by exiting with this code (see server services/restart.ts). */\nexport const RESTART_EXIT_CODE = 75;\n\nexport function shouldRestart(code: number | null, signal: NodeJS.Signals | null): boolean {\n return signal === null && code === RESTART_EXIT_CODE;\n}\n\n/**\n * Run the dev server as a supervised child. Re-spawns it whenever it exits with\n * RESTART_EXIT_CODE (a UI-triggered \"apply changes\"); forwards SIGINT/SIGTERM; and\n * propagates any other exit code. Works locally and inside the Fly container\n * (CMD is `yamchart dev …`).\n */\nexport function superviseDevServer(argv: string[]): void {\n let child: ChildProcess | null = null;\n let shuttingDown = false;\n\n const start = () => {\n child = spawn(process.execPath, [process.argv[1]!, ...argv], {\n stdio: 'inherit',\n env: { ...process.env, YAMCHART_DEV_CHILD: '1' },\n });\n child.on('exit', (code, signal) => {\n if (shuttingDown) {\n // We were asked to shut down: exit only AFTER the child has closed\n // (so it can drain connections), then propagate a clean code.\n process.exit(0);\n }\n if (shouldRestart(code, signal)) {\n start(); // re-spawn for an applied config change\n } else {\n process.exit(code ?? 0);\n }\n });\n };\n\n for (const sig of ['SIGINT', 'SIGTERM'] as const) {\n process.once(sig, () => {\n shuttingDown = true;\n // Forward the signal; the child's 'exit' handler above triggers our exit.\n if (child) child.kill(sig);\n else process.exit(0);\n });\n }\n start();\n}\n"],"mappings":";;;AAAA,SAAS,aAAgC;AAGlC,IAAM,oBAAoB;AAE1B,SAAS,cAAc,MAAqB,QAAwC;AACzF,SAAO,WAAW,QAAQ,SAAS;AACrC;AAQO,SAAS,mBAAmB,MAAsB;AACvD,MAAI,QAA6B;AACjC,MAAI,eAAe;AAEnB,QAAM,QAAQ,MAAM;AAClB,YAAQ,MAAM,QAAQ,UAAU,CAAC,QAAQ,KAAK,CAAC,GAAI,GAAG,IAAI,GAAG;AAAA,MAC3D,OAAO;AAAA,MACP,KAAK,EAAE,GAAG,QAAQ,KAAK,oBAAoB,IAAI;AAAA,IACjD,CAAC;AACD,UAAM,GAAG,QAAQ,CAAC,MAAM,WAAW;AACjC,UAAI,cAAc;AAGhB,gBAAQ,KAAK,CAAC;AAAA,MAChB;AACA,UAAI,cAAc,MAAM,MAAM,GAAG;AAC/B,cAAM;AAAA,MACR,OAAO;AACL,gBAAQ,KAAK,QAAQ,CAAC;AAAA,MACxB;AAAA,IACF,CAAC;AAAA,EACH;AAEA,aAAW,OAAO,CAAC,UAAU,SAAS,GAAY;AAChD,YAAQ,KAAK,KAAK,MAAM;AACtB,qBAAe;AAEf,UAAI,MAAO,OAAM,KAAK,GAAG;AAAA,UACpB,SAAQ,KAAK,CAAC;AAAA,IACrB,CAAC;AAAA,EACH;AACA,QAAM;AACR;","names":[]}
|
|
@@ -19,10 +19,10 @@ import {
|
|
|
19
19
|
readDbtModel,
|
|
20
20
|
updateSchemaYml,
|
|
21
21
|
writeDbtModel
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
22
|
+
} from "./chunk-UOSOZT47.js";
|
|
23
|
+
import "./chunk-5CRXV5PQ.js";
|
|
24
|
+
import "./chunk-X3UG6T3Q.js";
|
|
25
|
+
import "./chunk-7HWFVUGP.js";
|
|
26
26
|
import "./chunk-7D4SUZUM.js";
|
|
27
27
|
export {
|
|
28
28
|
AdvisorAgent,
|
|
@@ -45,4 +45,4 @@ export {
|
|
|
45
45
|
updateSchemaYml,
|
|
46
46
|
writeDbtModel
|
|
47
47
|
};
|
|
48
|
-
//# sourceMappingURL=dist-
|
|
48
|
+
//# sourceMappingURL=dist-LK3ZG74Q.js.map
|
|
@@ -2,18 +2,21 @@ import { createRequire as __yamchartCreateRequire } from 'module'; if (!globalTh
|
|
|
2
2
|
import {
|
|
3
3
|
AgentDefinitionSchema,
|
|
4
4
|
AiConfigSchema,
|
|
5
|
+
BigQueryConfigSchema,
|
|
5
6
|
BlindspotKindSchema,
|
|
6
7
|
BlindspotSchema,
|
|
7
8
|
BlindspotStatusSchema,
|
|
8
9
|
ChartSchema,
|
|
9
10
|
ColumnProfileSchema,
|
|
10
11
|
ConnectionSchema,
|
|
12
|
+
ConnectionSecretsSchema,
|
|
11
13
|
CuratedDimensionSchema,
|
|
12
14
|
CuratedMetricSchema,
|
|
13
15
|
CuratedSourceSchema,
|
|
14
16
|
DashboardSchema,
|
|
15
17
|
DimensionSchema,
|
|
16
18
|
DimensionTypeSchema,
|
|
19
|
+
DuckDBConfigSchema,
|
|
17
20
|
EventSchema,
|
|
18
21
|
EventsFileSchema,
|
|
19
22
|
HunchSampleSchema,
|
|
@@ -24,14 +27,21 @@ import {
|
|
|
24
27
|
MeasureTypeSchema,
|
|
25
28
|
ModelMetadataSchema,
|
|
26
29
|
ModelSchema,
|
|
30
|
+
MySQLConfigSchema,
|
|
27
31
|
NamedFilterSchema,
|
|
28
32
|
NewBlindspotSchema,
|
|
29
33
|
NewHunchSchema,
|
|
30
34
|
NewKnowledgeDocSchema,
|
|
31
35
|
ParameterSchema,
|
|
36
|
+
PoolConfigSchema,
|
|
37
|
+
PostgresConfigSchema,
|
|
32
38
|
ProjectSchema,
|
|
33
39
|
ProviderConfigSchema,
|
|
40
|
+
QueryConfigSchema,
|
|
34
41
|
RelationshipSchema,
|
|
42
|
+
RuntimeConfigSchema,
|
|
43
|
+
RuntimeConnectionSchema,
|
|
44
|
+
SQLiteConfigSchema,
|
|
35
45
|
ScheduleSchema,
|
|
36
46
|
SemanticConfigSchema,
|
|
37
47
|
SemanticDefinitionSchema,
|
|
@@ -40,29 +50,33 @@ import {
|
|
|
40
50
|
SemanticFilterSchema,
|
|
41
51
|
SemanticModelSchema,
|
|
42
52
|
SemanticQuerySchema,
|
|
53
|
+
SnowflakeConfigSchema,
|
|
43
54
|
SourceProfileSchema,
|
|
44
55
|
SuggestedModelSchema,
|
|
45
56
|
TableProfileSchema,
|
|
46
57
|
VERSION,
|
|
47
58
|
deepMerge,
|
|
48
59
|
resolveProjectConfig
|
|
49
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-7HWFVUGP.js";
|
|
50
61
|
import "./chunk-7D4SUZUM.js";
|
|
51
62
|
export {
|
|
52
63
|
AgentDefinitionSchema,
|
|
53
64
|
AiConfigSchema,
|
|
65
|
+
BigQueryConfigSchema,
|
|
54
66
|
BlindspotKindSchema,
|
|
55
67
|
BlindspotSchema,
|
|
56
68
|
BlindspotStatusSchema,
|
|
57
69
|
ChartSchema,
|
|
58
70
|
ColumnProfileSchema,
|
|
59
71
|
ConnectionSchema,
|
|
72
|
+
ConnectionSecretsSchema,
|
|
60
73
|
CuratedDimensionSchema,
|
|
61
74
|
CuratedMetricSchema,
|
|
62
75
|
CuratedSourceSchema,
|
|
63
76
|
DashboardSchema,
|
|
64
77
|
DimensionSchema,
|
|
65
78
|
DimensionTypeSchema,
|
|
79
|
+
DuckDBConfigSchema,
|
|
66
80
|
EventSchema,
|
|
67
81
|
EventsFileSchema,
|
|
68
82
|
HunchSampleSchema,
|
|
@@ -73,14 +87,21 @@ export {
|
|
|
73
87
|
MeasureTypeSchema,
|
|
74
88
|
ModelMetadataSchema,
|
|
75
89
|
ModelSchema,
|
|
90
|
+
MySQLConfigSchema,
|
|
76
91
|
NamedFilterSchema,
|
|
77
92
|
NewBlindspotSchema,
|
|
78
93
|
NewHunchSchema,
|
|
79
94
|
NewKnowledgeDocSchema,
|
|
80
95
|
ParameterSchema,
|
|
96
|
+
PoolConfigSchema,
|
|
97
|
+
PostgresConfigSchema,
|
|
81
98
|
ProjectSchema,
|
|
82
99
|
ProviderConfigSchema,
|
|
100
|
+
QueryConfigSchema,
|
|
83
101
|
RelationshipSchema,
|
|
102
|
+
RuntimeConfigSchema,
|
|
103
|
+
RuntimeConnectionSchema,
|
|
104
|
+
SQLiteConfigSchema,
|
|
84
105
|
ScheduleSchema,
|
|
85
106
|
SemanticConfigSchema,
|
|
86
107
|
SemanticDefinitionSchema,
|
|
@@ -89,6 +110,7 @@ export {
|
|
|
89
110
|
SemanticFilterSchema,
|
|
90
111
|
SemanticModelSchema,
|
|
91
112
|
SemanticQuerySchema,
|
|
113
|
+
SnowflakeConfigSchema,
|
|
92
114
|
SourceProfileSchema,
|
|
93
115
|
SuggestedModelSchema,
|
|
94
116
|
TableProfileSchema,
|
|
@@ -96,4 +118,4 @@ export {
|
|
|
96
118
|
deepMerge,
|
|
97
119
|
resolveProjectConfig
|
|
98
120
|
};
|
|
99
|
-
//# sourceMappingURL=dist-
|
|
121
|
+
//# sourceMappingURL=dist-WMP7BFKP.js.map
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
runModel,
|
|
32
32
|
serializeDateValue,
|
|
33
33
|
templateHasVariable
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-5CRXV5PQ.js";
|
|
35
35
|
import {
|
|
36
36
|
DATE_PRESETS,
|
|
37
37
|
SemanticModelBuilder,
|
|
@@ -53,8 +53,8 @@ import {
|
|
|
53
53
|
isRelativeDateRange,
|
|
54
54
|
loadSemanticDefinitions,
|
|
55
55
|
validateSemanticQuery
|
|
56
|
-
} from "./chunk-
|
|
57
|
-
import "./chunk-
|
|
56
|
+
} from "./chunk-X3UG6T3Q.js";
|
|
57
|
+
import "./chunk-7HWFVUGP.js";
|
|
58
58
|
import "./chunk-7D4SUZUM.js";
|
|
59
59
|
export {
|
|
60
60
|
BigQueryConnector,
|
|
@@ -109,4 +109,4 @@ export {
|
|
|
109
109
|
templateHasVariable,
|
|
110
110
|
validateSemanticQuery
|
|
111
111
|
};
|
|
112
|
-
//# sourceMappingURL=dist-
|
|
112
|
+
//# sourceMappingURL=dist-YB5RBWCC.js.map
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __yamchartCreateRequire } from 'module'; if (!globalThis.require) globalThis.require = __yamchartCreateRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
checkForUpdate
|
|
5
|
-
} from "./chunk-TZKNU5TD.js";
|
|
6
3
|
import {
|
|
7
4
|
findProjectRoot,
|
|
8
5
|
loadEnvFile,
|
|
9
6
|
validateProject
|
|
10
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-25ES7MGF.js";
|
|
8
|
+
import {
|
|
9
|
+
checkForUpdate
|
|
10
|
+
} from "./chunk-TZKNU5TD.js";
|
|
11
11
|
import {
|
|
12
12
|
detail,
|
|
13
13
|
error,
|
|
@@ -18,9 +18,9 @@ import {
|
|
|
18
18
|
success,
|
|
19
19
|
warning
|
|
20
20
|
} from "./chunk-HJVVHYVN.js";
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-5CRXV5PQ.js";
|
|
22
|
+
import "./chunk-X3UG6T3Q.js";
|
|
23
|
+
import "./chunk-7HWFVUGP.js";
|
|
24
24
|
import "./chunk-7D4SUZUM.js";
|
|
25
25
|
|
|
26
26
|
// src/index.ts
|
|
@@ -98,6 +98,11 @@ program.command("validate").description("Validate configuration files").argument
|
|
|
98
98
|
process.exit(result.success ? 0 : 1);
|
|
99
99
|
});
|
|
100
100
|
program.command("dev").description("Start development server with hot reload").argument("[path]", "Path to yamchart project", ".").option("-p, --port <number>", "Port to listen on", "3001").option("--api-only", "Only serve API, no web UI").option("--no-open", "Do not open browser automatically").action(async (path, options) => {
|
|
101
|
+
if (process.env.YAMCHART_DEV_CHILD !== "1") {
|
|
102
|
+
const { superviseDevServer } = await import("./dev-supervisor-JXLVGEHP.js");
|
|
103
|
+
superviseDevServer(process.argv.slice(2));
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
101
106
|
const startPath = resolve(path);
|
|
102
107
|
const projectDir = await findProjectRoot(startPath);
|
|
103
108
|
if (!projectDir) {
|
|
@@ -106,7 +111,7 @@ program.command("dev").description("Start development server with hot reload").a
|
|
|
106
111
|
process.exit(2);
|
|
107
112
|
}
|
|
108
113
|
const globalOpts = program.opts();
|
|
109
|
-
const { runDevServer } = await import("./dev-
|
|
114
|
+
const { runDevServer } = await import("./dev-KOWFGDOP.js");
|
|
110
115
|
await runDevServer(projectDir, {
|
|
111
116
|
port: parseInt(options.port, 10),
|
|
112
117
|
apiOnly: options.apiOnly ?? false,
|
|
@@ -116,7 +121,7 @@ program.command("dev").description("Start development server with hot reload").a
|
|
|
116
121
|
});
|
|
117
122
|
});
|
|
118
123
|
program.command("init").description("Create a new yamchart project").argument("[directory]", "Target directory", ".").option("--example", "Create full example project with sample database").option("--empty", "Create only yamchart.yaml (no connections, models, or charts)").option("--force", "Overwrite existing files").action(async (directory, options) => {
|
|
119
|
-
const { initProject } = await import("./init-
|
|
124
|
+
const { initProject } = await import("./init-TJJVKMEN.js");
|
|
120
125
|
const targetDir = resolve(directory);
|
|
121
126
|
const result = await initProject(targetDir, options);
|
|
122
127
|
if (!result.success) {
|
|
@@ -180,7 +185,7 @@ program.command("sync-dbt").description("Sync dbt project metadata into AI-reada
|
|
|
180
185
|
if (!options.targetDatabase) {
|
|
181
186
|
try {
|
|
182
187
|
const { readFile } = await import("fs/promises");
|
|
183
|
-
const { resolveConnection } = await import("./connection-utils-
|
|
188
|
+
const { resolveConnection } = await import("./connection-utils-HNX3473B.js");
|
|
184
189
|
const { detectDatabaseMismatch } = await import("./rewrite-database-BOA4QPUR.js");
|
|
185
190
|
const catalogJsonStr = await readFile(join(projectDir, ".yamchart", "catalog.json"), "utf-8");
|
|
186
191
|
const catalogData = JSON.parse(catalogJsonStr);
|
|
@@ -234,7 +239,7 @@ program.command("test").description("Run model tests (@returns schema checks and
|
|
|
234
239
|
}
|
|
235
240
|
loadEnvFile(projectDir);
|
|
236
241
|
try {
|
|
237
|
-
const { testProject, formatTestOutput } = await import("./test-
|
|
242
|
+
const { testProject, formatTestOutput } = await import("./test-MKNKUR3N.js");
|
|
238
243
|
const result = await testProject(projectDir, model, {
|
|
239
244
|
connection: options.connection,
|
|
240
245
|
json: options.json
|
|
@@ -283,7 +288,7 @@ program.command("tables").description("List tables and views in the connected da
|
|
|
283
288
|
loadEnvFile(projectDir);
|
|
284
289
|
try {
|
|
285
290
|
if (options.compare) {
|
|
286
|
-
const { resolveTablesSource } = await import("./source-resolver-
|
|
291
|
+
const { resolveTablesSource } = await import("./source-resolver-7NY3KEZ2.js");
|
|
287
292
|
const { compareTables, formatCompareTables } = await import("./compare-RQFCEZIK.js");
|
|
288
293
|
let localResult;
|
|
289
294
|
try {
|
|
@@ -314,7 +319,7 @@ program.command("tables").description("List tables and views in the connected da
|
|
|
314
319
|
}
|
|
315
320
|
return;
|
|
316
321
|
}
|
|
317
|
-
const { listTables } = await import("./tables-
|
|
322
|
+
const { listTables } = await import("./tables-WQTRZSXR.js");
|
|
318
323
|
const result = await listTables(projectDir, {
|
|
319
324
|
...options,
|
|
320
325
|
source: options.source || "auto"
|
|
@@ -352,7 +357,7 @@ program.command("describe").description("Show columns and types for a table").ar
|
|
|
352
357
|
loadEnvFile(projectDir);
|
|
353
358
|
try {
|
|
354
359
|
if (options.compare) {
|
|
355
|
-
const { resolveDescribeSource } = await import("./source-resolver-
|
|
360
|
+
const { resolveDescribeSource } = await import("./source-resolver-7NY3KEZ2.js");
|
|
356
361
|
const { compareColumns, formatCompareColumns } = await import("./compare-RQFCEZIK.js");
|
|
357
362
|
let localResult;
|
|
358
363
|
try {
|
|
@@ -374,7 +379,7 @@ program.command("describe").description("Show columns and types for a table").ar
|
|
|
374
379
|
}
|
|
375
380
|
return;
|
|
376
381
|
}
|
|
377
|
-
const { describeTable } = await import("./describe-
|
|
382
|
+
const { describeTable } = await import("./describe-KDGXFPDQ.js");
|
|
378
383
|
const result = await describeTable(projectDir, table, {
|
|
379
384
|
...options,
|
|
380
385
|
source: options.source || "auto"
|
|
@@ -413,8 +418,8 @@ program.command("query").description("Execute SQL against a connection").argumen
|
|
|
413
418
|
}
|
|
414
419
|
loadEnvFile(projectDir);
|
|
415
420
|
try {
|
|
416
|
-
const { executeQuery } = await import("./query-
|
|
417
|
-
const { formatTable, formatJSON } = await import("./connection-utils-
|
|
421
|
+
const { executeQuery } = await import("./query-7XHKSZ5H.js");
|
|
422
|
+
const { formatTable, formatJSON } = await import("./connection-utils-HNX3473B.js");
|
|
418
423
|
const limit = options.limit ? parseInt(options.limit, 10) : void 0;
|
|
419
424
|
const result = await executeQuery(projectDir, sql, {
|
|
420
425
|
connection: options.connection,
|
|
@@ -441,8 +446,8 @@ program.command("sample").description("Show sample rows from a table or dbt mode
|
|
|
441
446
|
}
|
|
442
447
|
loadEnvFile(projectDir);
|
|
443
448
|
try {
|
|
444
|
-
const { sampleTable } = await import("./sample-
|
|
445
|
-
const { formatTable, formatJSON } = await import("./connection-utils-
|
|
449
|
+
const { sampleTable } = await import("./sample-YNSJ3I3T.js");
|
|
450
|
+
const { formatTable, formatJSON } = await import("./connection-utils-HNX3473B.js");
|
|
446
451
|
const limit = options.limit ? parseInt(options.limit, 10) : void 0;
|
|
447
452
|
const result = await sampleTable(projectDir, table, {
|
|
448
453
|
connection: options.connection,
|
|
@@ -472,7 +477,7 @@ program.command("search").description("Search for tables and columns by keyword"
|
|
|
472
477
|
}
|
|
473
478
|
loadEnvFile(projectDir);
|
|
474
479
|
try {
|
|
475
|
-
const { searchDatabase } = await import("./search-
|
|
480
|
+
const { searchDatabase } = await import("./search-NKRXXLRS.js");
|
|
476
481
|
const result = await searchDatabase(projectDir, keyword, {
|
|
477
482
|
...options,
|
|
478
483
|
source: options.source || "auto"
|
|
@@ -526,7 +531,7 @@ catalogCmd.command("tables").description("List tables from cached catalog").opti
|
|
|
526
531
|
process.exit(2);
|
|
527
532
|
}
|
|
528
533
|
try {
|
|
529
|
-
const { listTables } = await import("./tables-
|
|
534
|
+
const { listTables } = await import("./tables-WQTRZSXR.js");
|
|
530
535
|
const result = await listTables(projectDir, {
|
|
531
536
|
source: "catalog",
|
|
532
537
|
schema: options.schema
|
|
@@ -568,7 +573,7 @@ catalogCmd.command("describe").description("Show cached columns and types for a
|
|
|
568
573
|
process.exit(2);
|
|
569
574
|
}
|
|
570
575
|
try {
|
|
571
|
-
const { describeTable } = await import("./describe-
|
|
576
|
+
const { describeTable } = await import("./describe-KDGXFPDQ.js");
|
|
572
577
|
const result = await describeTable(projectDir, table, { source: "catalog" });
|
|
573
578
|
if (options.json) {
|
|
574
579
|
console.log(JSON.stringify(result.columns, null, 2));
|
|
@@ -610,7 +615,7 @@ catalogCmd.command("search").description("Search cached metadata for tables and
|
|
|
610
615
|
process.exit(2);
|
|
611
616
|
}
|
|
612
617
|
try {
|
|
613
|
-
const { searchDatabase } = await import("./search-
|
|
618
|
+
const { searchDatabase } = await import("./search-NKRXXLRS.js");
|
|
614
619
|
const result = await searchDatabase(projectDir, keyword, { source: "catalog" });
|
|
615
620
|
if (options.json) {
|
|
616
621
|
console.log(JSON.stringify(result.results, null, 2));
|
|
@@ -735,7 +740,7 @@ program.command("sync-warehouse").description("Sync warehouse table metadata int
|
|
|
735
740
|
}
|
|
736
741
|
loadEnvFile(projectDir);
|
|
737
742
|
try {
|
|
738
|
-
const { runSyncWarehouse } = await import("./sync-warehouse-
|
|
743
|
+
const { runSyncWarehouse } = await import("./sync-warehouse-PK7HXW7U.js");
|
|
739
744
|
await runSyncWarehouse(projectDir, options);
|
|
740
745
|
} catch (err) {
|
|
741
746
|
error(err instanceof Error ? err.message : String(err));
|
|
@@ -786,7 +791,7 @@ program.command("advisor").description("AI-powered dbt model advisor \u2014 sugg
|
|
|
786
791
|
process.exit(2);
|
|
787
792
|
}
|
|
788
793
|
loadEnvFile(projectDir);
|
|
789
|
-
const { runAdvisor } = await import("./advisor-
|
|
794
|
+
const { runAdvisor } = await import("./advisor-5F73GF54.js");
|
|
790
795
|
await runAdvisor(projectDir, question, {
|
|
791
796
|
top: options.top ? parseInt(options.top, 10) : 5,
|
|
792
797
|
json: options.json,
|
|
@@ -794,7 +799,7 @@ program.command("advisor").description("AI-powered dbt model advisor \u2014 sugg
|
|
|
794
799
|
connection: options.connection
|
|
795
800
|
});
|
|
796
801
|
});
|
|
797
|
-
var semanticCmd = program.command("semantic").description("Explore the semantic layer \u2014 auto-generated
|
|
802
|
+
var semanticCmd = program.command("semantic").description("Explore the semantic layer \u2014 curated semantic/*.yaml definitions or auto-generated from catalog").option("--json", "Output as JSON").action(async (options) => {
|
|
798
803
|
const startPath = resolve(".");
|
|
799
804
|
const projectDir = await findProjectRoot(startPath);
|
|
800
805
|
if (!projectDir) {
|
|
@@ -804,21 +809,31 @@ var semanticCmd = program.command("semantic").description("Explore the semantic
|
|
|
804
809
|
}
|
|
805
810
|
loadEnvFile(projectDir);
|
|
806
811
|
try {
|
|
807
|
-
const {
|
|
808
|
-
const
|
|
809
|
-
const
|
|
810
|
-
|
|
811
|
-
|
|
812
|
+
const { loadSemanticDefinitions } = await import("./semantic-DD7P4634.js");
|
|
813
|
+
const { listSemanticDefinitions, listSemanticEntities } = await import("./semantic-NBAX4WU4.js");
|
|
814
|
+
const defs = loadSemanticDefinitions(projectDir);
|
|
815
|
+
let result;
|
|
816
|
+
let source;
|
|
817
|
+
if (defs.length > 0) {
|
|
818
|
+
result = listSemanticDefinitions(defs);
|
|
819
|
+
source = "curated";
|
|
820
|
+
} else {
|
|
821
|
+
const { readFile } = await import("fs/promises");
|
|
822
|
+
const catalogPath = join(projectDir, ".yamchart", "catalog.json");
|
|
823
|
+
const catalogJson = JSON.parse(await readFile(catalogPath, "utf-8"));
|
|
824
|
+
result = listSemanticEntities(catalogJson);
|
|
825
|
+
source = "catalog";
|
|
826
|
+
}
|
|
812
827
|
if (options.json) {
|
|
813
828
|
console.log(JSON.stringify(result.entities, null, 2));
|
|
814
829
|
return;
|
|
815
830
|
}
|
|
816
831
|
if (result.entities.length === 0) {
|
|
817
832
|
info("No semantic entities found.");
|
|
818
|
-
detail("
|
|
833
|
+
detail("Add YAML files to semantic/ or run `yamchart sync-dbt` / `yamchart sync-warehouse` to populate the catalog.");
|
|
819
834
|
return;
|
|
820
835
|
}
|
|
821
|
-
header(`Semantic Layer \u2014 ${result.entities.length} entities`);
|
|
836
|
+
header(`Semantic Layer \u2014 ${result.entities.length} entities (${source === "curated" ? "semantic/*.yaml" : "catalog"})`);
|
|
822
837
|
for (const entity of result.entities) {
|
|
823
838
|
console.log(` ${pc.bold(entity.name)}`);
|
|
824
839
|
console.log(` ${pc.dim(entity.source_table)}`);
|
|
@@ -835,7 +850,7 @@ var semanticCmd = program.command("semantic").description("Explore the semantic
|
|
|
835
850
|
}
|
|
836
851
|
} catch (err) {
|
|
837
852
|
if (err instanceof Error && err.message.includes("ENOENT")) {
|
|
838
|
-
error("No catalog found.
|
|
853
|
+
error("No catalog found. Add semantic/*.yaml files or run `yamchart sync-dbt` / `yamchart sync-warehouse` first.");
|
|
839
854
|
} else {
|
|
840
855
|
error(err instanceof Error ? err.message : String(err));
|
|
841
856
|
}
|
|
@@ -851,10 +866,8 @@ semanticCmd.command("query").description("Run a structured query against the sem
|
|
|
851
866
|
}
|
|
852
867
|
loadEnvFile(projectDir);
|
|
853
868
|
try {
|
|
854
|
-
const {
|
|
855
|
-
const
|
|
856
|
-
const catalogJson = JSON.parse(await readFile(catalogPath, "utf-8"));
|
|
857
|
-
const { querySemanticEntity } = await import("./semantic-K3MYXXJI.js");
|
|
869
|
+
const { loadSemanticDefinitions } = await import("./semantic-DD7P4634.js");
|
|
870
|
+
const { querySemanticDefinition, querySemanticEntity } = await import("./semantic-NBAX4WU4.js");
|
|
858
871
|
const filters = (options.filter || []).map((f) => {
|
|
859
872
|
const eqIdx = f.indexOf("=");
|
|
860
873
|
if (eqIdx === -1) throw new Error(`Invalid filter format: "${f}". Use dimension=value`);
|
|
@@ -864,19 +877,29 @@ semanticCmd.command("query").description("Run a structured query against the sem
|
|
|
864
877
|
value: f.slice(eqIdx + 1)
|
|
865
878
|
};
|
|
866
879
|
});
|
|
867
|
-
const
|
|
880
|
+
const queryInput = {
|
|
868
881
|
entity: options.entity,
|
|
869
882
|
measures: options.measures.split(",").map((s) => s.trim()),
|
|
870
883
|
dimensions: options.dimensions ? options.dimensions.split(",").map((s) => s.trim()) : [],
|
|
871
884
|
filters,
|
|
872
885
|
order_by: options.order ? { field: options.order, direction: options.desc ? "desc" : "asc" } : void 0,
|
|
873
886
|
limit: options.limit ? parseInt(options.limit, 10) : 100
|
|
874
|
-
}
|
|
887
|
+
};
|
|
888
|
+
const defs = loadSemanticDefinitions(projectDir);
|
|
889
|
+
let result;
|
|
890
|
+
if (defs.length > 0) {
|
|
891
|
+
result = querySemanticDefinition(defs, queryInput);
|
|
892
|
+
} else {
|
|
893
|
+
const { readFile } = await import("fs/promises");
|
|
894
|
+
const catalogPath = join(projectDir, ".yamchart", "catalog.json");
|
|
895
|
+
const catalogJson = JSON.parse(await readFile(catalogPath, "utf-8"));
|
|
896
|
+
result = querySemanticEntity(catalogJson, queryInput);
|
|
897
|
+
}
|
|
875
898
|
if (options.sql) {
|
|
876
899
|
console.log(result.sql);
|
|
877
900
|
return;
|
|
878
901
|
}
|
|
879
|
-
const { resolveConnection, createConnector, formatTable, formatJSON } = await import("./connection-utils-
|
|
902
|
+
const { resolveConnection, createConnector, formatTable, formatJSON } = await import("./connection-utils-HNX3473B.js");
|
|
880
903
|
const connection = await resolveConnection(projectDir, options.connection, program.opts().env);
|
|
881
904
|
const connector = createConnector(connection, projectDir);
|
|
882
905
|
const start = performance.now();
|
|
@@ -904,7 +927,7 @@ semanticCmd.command("query").description("Run a structured query against the sem
|
|
|
904
927
|
}
|
|
905
928
|
} catch (err) {
|
|
906
929
|
if (err instanceof Error && err.message.includes("ENOENT")) {
|
|
907
|
-
error("No catalog found.
|
|
930
|
+
error("No catalog found. Add semantic/*.yaml files or run `yamchart sync-dbt` / `yamchart sync-warehouse` first.");
|
|
908
931
|
} else {
|
|
909
932
|
error(err instanceof Error ? err.message : String(err));
|
|
910
933
|
}
|