yamchart 0.10.0 → 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-O2BRAI4T.js → advisor-5F73GF54.js} +13 -13
- package/dist/{advisor-O2BRAI4T.js.map → advisor-5F73GF54.js.map} +1 -1
- package/dist/agent-TZZHNDPK.js +1 -0
- package/dist/{chunk-S2CH4HUZ.js → chunk-25ES7MGF.js} +5 -4
- package/dist/{chunk-QUIDZO5G.js → chunk-5CRXV5PQ.js} +23 -6
- package/dist/chunk-5CRXV5PQ.js.map +1 -0
- package/dist/chunk-7D4SUZUM.js +1 -0
- package/dist/chunk-7HWFVUGP.js +1239 -0
- package/dist/chunk-7HWFVUGP.js.map +1 -0
- package/dist/chunk-DZVT6PHW.js +1 -0
- package/dist/chunk-EAQXUGP6.js +1 -0
- package/dist/chunk-HJVVHYVN.js +1 -0
- package/dist/chunk-IVD4OP3K.js +1 -0
- package/dist/{chunk-5FHV22X2.js → chunk-PYVROL7Z.js} +5 -4
- package/dist/chunk-TZKNU5TD.js +1 -0
- package/dist/chunk-UOSOZT47.js +966 -0
- package/dist/chunk-UOSOZT47.js.map +1 -0
- package/dist/chunk-VJC24RKT.js +1 -0
- package/dist/{chunk-ZBCQNWVN.js → chunk-WVSDQNAN.js} +6 -5
- package/dist/chunk-WYS4ULBE.js +1 -0
- package/dist/{chunk-UFDQ3C7Q.js → chunk-X3UG6T3Q.js} +258 -257
- package/dist/chunk-X3UG6T3Q.js.map +1 -0
- package/dist/chunk-ZMJPRNOA.js +1 -0
- package/dist/compare-RQFCEZIK.js +1 -0
- package/dist/connection-utils-HNX3473B.js +20 -0
- package/dist/{describe-MEP72B56.js → describe-KDGXFPDQ.js} +8 -7
- package/dist/{dev-LZ4YHNDJ.js → dev-KOWFGDOP.js} +934 -128
- 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-5IFWLWND.js → dist-LK3ZG74Q.js} +6 -6
- package/dist/dist-MIKFZKSD.js +1 -0
- package/dist/{dist-PPAD6KOM.js → dist-WMP7BFKP.js} +25 -2
- package/dist/{dist-XNCED7JW.js → dist-YB5RBWCC.js} +5 -4
- package/dist/generate-B7FAWVIQ.js +1 -0
- package/dist/index.js +66 -42
- package/dist/index.js.map +1 -1
- package/dist/{init-SECXKD5G.js → init-TJJVKMEN.js} +25 -5
- package/dist/init-TJJVKMEN.js.map +1 -0
- package/dist/lineage-HYO4RKZT.js +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} +6 -5
- package/dist/reset-password-YVCZKZPC.js +1 -0
- package/dist/rewrite-database-BOA4QPUR.js +1 -0
- package/dist/sample-YNSJ3I3T.js +76 -0
- package/dist/sample-YNSJ3I3T.js.map +1 -0
- package/dist/{search-IPE4ISFB.js → search-NKRXXLRS.js} +8 -7
- package/dist/semantic-DD7P4634.js +30 -0
- package/dist/semantic-NBAX4WU4.js +76 -0
- package/dist/semantic-NBAX4WU4.js.map +1 -0
- package/dist/source-resolver-7NY3KEZ2.js +19 -0
- package/dist/source-resolver-7NY3KEZ2.js.map +1 -0
- package/dist/sync-dbt-72GVO75P.js +1 -0
- package/dist/{sync-warehouse-26L6JDSV.js → sync-warehouse-PK7HXW7U.js} +11 -6
- package/dist/sync-warehouse-PK7HXW7U.js.map +1 -0
- package/dist/{tables-K5NAN2WK.js → tables-WQTRZSXR.js} +8 -7
- package/dist/templates/default/docs/yamchart-reference.md +26 -0
- package/dist/{test-SRHVOXZB.js → test-MKNKUR3N.js} +20 -7
- package/dist/test-MKNKUR3N.js.map +1 -0
- package/dist/update-HWCJNQRP.js +1 -0
- package/package.json +9 -7
- package/dist/chunk-FN6R2LAC.js +0 -15442
- package/dist/chunk-FN6R2LAC.js.map +0 -1
- package/dist/chunk-QJ5CPQJK.js +0 -2053
- package/dist/chunk-QJ5CPQJK.js.map +0 -1
- package/dist/chunk-QUIDZO5G.js.map +0 -1
- package/dist/chunk-UFDQ3C7Q.js.map +0 -1
- package/dist/chunk-ZIY22VO7.js +0 -1189
- package/dist/chunk-ZIY22VO7.js.map +0 -1
- package/dist/connection-utils-FEUWER5I.js +0 -19
- package/dist/dev-LZ4YHNDJ.js.map +0 -1
- package/dist/fileFromPath-7TNUU6RI.js +0 -130
- package/dist/fileFromPath-7TNUU6RI.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 -41
- package/dist/sample-ODUGGSFA.js.map +0 -1
- package/dist/semantic-K3MYXXJI.js +0 -40
- package/dist/semantic-K3MYXXJI.js.map +0 -1
- package/dist/source-resolver-HZQLOODU.js +0 -18
- package/dist/sync-warehouse-26L6JDSV.js.map +0 -1
- package/dist/test-SRHVOXZB.js.map +0 -1
- /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-5IFWLWND.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":[]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createRequire as __yamchartCreateRequire } from 'module'; if (!globalThis.require) globalThis.require = __yamchartCreateRequire(import.meta.url);
|
|
1
2
|
import {
|
|
2
3
|
AdvisorAgent,
|
|
3
4
|
AnthropicProvider,
|
|
@@ -18,11 +19,10 @@ import {
|
|
|
18
19
|
readDbtModel,
|
|
19
20
|
updateSchemaYml,
|
|
20
21
|
writeDbtModel
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-QJ5CPQJK.js";
|
|
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
|
package/dist/dist-MIKFZKSD.js
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
|
+
import { createRequire as __yamchartCreateRequire } from 'module'; if (!globalThis.require) globalThis.require = __yamchartCreateRequire(import.meta.url);
|
|
1
2
|
import {
|
|
2
3
|
AgentDefinitionSchema,
|
|
3
4
|
AiConfigSchema,
|
|
5
|
+
BigQueryConfigSchema,
|
|
4
6
|
BlindspotKindSchema,
|
|
5
7
|
BlindspotSchema,
|
|
6
8
|
BlindspotStatusSchema,
|
|
7
9
|
ChartSchema,
|
|
8
10
|
ColumnProfileSchema,
|
|
9
11
|
ConnectionSchema,
|
|
12
|
+
ConnectionSecretsSchema,
|
|
10
13
|
CuratedDimensionSchema,
|
|
11
14
|
CuratedMetricSchema,
|
|
12
15
|
CuratedSourceSchema,
|
|
13
16
|
DashboardSchema,
|
|
14
17
|
DimensionSchema,
|
|
15
18
|
DimensionTypeSchema,
|
|
19
|
+
DuckDBConfigSchema,
|
|
16
20
|
EventSchema,
|
|
17
21
|
EventsFileSchema,
|
|
18
22
|
HunchSampleSchema,
|
|
@@ -23,14 +27,21 @@ import {
|
|
|
23
27
|
MeasureTypeSchema,
|
|
24
28
|
ModelMetadataSchema,
|
|
25
29
|
ModelSchema,
|
|
30
|
+
MySQLConfigSchema,
|
|
26
31
|
NamedFilterSchema,
|
|
27
32
|
NewBlindspotSchema,
|
|
28
33
|
NewHunchSchema,
|
|
29
34
|
NewKnowledgeDocSchema,
|
|
30
35
|
ParameterSchema,
|
|
36
|
+
PoolConfigSchema,
|
|
37
|
+
PostgresConfigSchema,
|
|
31
38
|
ProjectSchema,
|
|
32
39
|
ProviderConfigSchema,
|
|
40
|
+
QueryConfigSchema,
|
|
33
41
|
RelationshipSchema,
|
|
42
|
+
RuntimeConfigSchema,
|
|
43
|
+
RuntimeConnectionSchema,
|
|
44
|
+
SQLiteConfigSchema,
|
|
34
45
|
ScheduleSchema,
|
|
35
46
|
SemanticConfigSchema,
|
|
36
47
|
SemanticDefinitionSchema,
|
|
@@ -39,29 +50,33 @@ import {
|
|
|
39
50
|
SemanticFilterSchema,
|
|
40
51
|
SemanticModelSchema,
|
|
41
52
|
SemanticQuerySchema,
|
|
53
|
+
SnowflakeConfigSchema,
|
|
42
54
|
SourceProfileSchema,
|
|
43
55
|
SuggestedModelSchema,
|
|
44
56
|
TableProfileSchema,
|
|
45
57
|
VERSION,
|
|
46
58
|
deepMerge,
|
|
47
59
|
resolveProjectConfig
|
|
48
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-7HWFVUGP.js";
|
|
49
61
|
import "./chunk-7D4SUZUM.js";
|
|
50
62
|
export {
|
|
51
63
|
AgentDefinitionSchema,
|
|
52
64
|
AiConfigSchema,
|
|
65
|
+
BigQueryConfigSchema,
|
|
53
66
|
BlindspotKindSchema,
|
|
54
67
|
BlindspotSchema,
|
|
55
68
|
BlindspotStatusSchema,
|
|
56
69
|
ChartSchema,
|
|
57
70
|
ColumnProfileSchema,
|
|
58
71
|
ConnectionSchema,
|
|
72
|
+
ConnectionSecretsSchema,
|
|
59
73
|
CuratedDimensionSchema,
|
|
60
74
|
CuratedMetricSchema,
|
|
61
75
|
CuratedSourceSchema,
|
|
62
76
|
DashboardSchema,
|
|
63
77
|
DimensionSchema,
|
|
64
78
|
DimensionTypeSchema,
|
|
79
|
+
DuckDBConfigSchema,
|
|
65
80
|
EventSchema,
|
|
66
81
|
EventsFileSchema,
|
|
67
82
|
HunchSampleSchema,
|
|
@@ -72,14 +87,21 @@ export {
|
|
|
72
87
|
MeasureTypeSchema,
|
|
73
88
|
ModelMetadataSchema,
|
|
74
89
|
ModelSchema,
|
|
90
|
+
MySQLConfigSchema,
|
|
75
91
|
NamedFilterSchema,
|
|
76
92
|
NewBlindspotSchema,
|
|
77
93
|
NewHunchSchema,
|
|
78
94
|
NewKnowledgeDocSchema,
|
|
79
95
|
ParameterSchema,
|
|
96
|
+
PoolConfigSchema,
|
|
97
|
+
PostgresConfigSchema,
|
|
80
98
|
ProjectSchema,
|
|
81
99
|
ProviderConfigSchema,
|
|
100
|
+
QueryConfigSchema,
|
|
82
101
|
RelationshipSchema,
|
|
102
|
+
RuntimeConfigSchema,
|
|
103
|
+
RuntimeConnectionSchema,
|
|
104
|
+
SQLiteConfigSchema,
|
|
83
105
|
ScheduleSchema,
|
|
84
106
|
SemanticConfigSchema,
|
|
85
107
|
SemanticDefinitionSchema,
|
|
@@ -88,6 +110,7 @@ export {
|
|
|
88
110
|
SemanticFilterSchema,
|
|
89
111
|
SemanticModelSchema,
|
|
90
112
|
SemanticQuerySchema,
|
|
113
|
+
SnowflakeConfigSchema,
|
|
91
114
|
SourceProfileSchema,
|
|
92
115
|
SuggestedModelSchema,
|
|
93
116
|
TableProfileSchema,
|
|
@@ -95,4 +118,4 @@ export {
|
|
|
95
118
|
deepMerge,
|
|
96
119
|
resolveProjectConfig
|
|
97
120
|
};
|
|
98
|
-
//# sourceMappingURL=dist-
|
|
121
|
+
//# sourceMappingURL=dist-WMP7BFKP.js.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createRequire as __yamchartCreateRequire } from 'module'; if (!globalThis.require) globalThis.require = __yamchartCreateRequire(import.meta.url);
|
|
1
2
|
import {
|
|
2
3
|
BigQueryConnector,
|
|
3
4
|
DuckDBConnector,
|
|
@@ -30,7 +31,7 @@ import {
|
|
|
30
31
|
runModel,
|
|
31
32
|
serializeDateValue,
|
|
32
33
|
templateHasVariable
|
|
33
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-5CRXV5PQ.js";
|
|
34
35
|
import {
|
|
35
36
|
DATE_PRESETS,
|
|
36
37
|
SemanticModelBuilder,
|
|
@@ -52,8 +53,8 @@ import {
|
|
|
52
53
|
isRelativeDateRange,
|
|
53
54
|
loadSemanticDefinitions,
|
|
54
55
|
validateSemanticQuery
|
|
55
|
-
} from "./chunk-
|
|
56
|
-
import "./chunk-
|
|
56
|
+
} from "./chunk-X3UG6T3Q.js";
|
|
57
|
+
import "./chunk-7HWFVUGP.js";
|
|
57
58
|
import "./chunk-7D4SUZUM.js";
|
|
58
59
|
export {
|
|
59
60
|
BigQueryConnector,
|
|
@@ -108,4 +109,4 @@ export {
|
|
|
108
109
|
templateHasVariable,
|
|
109
110
|
validateSemanticQuery
|
|
110
111
|
};
|
|
111
|
-
//# sourceMappingURL=dist-
|
|
112
|
+
//# sourceMappingURL=dist-YB5RBWCC.js.map
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
checkForUpdate
|
|
4
|
-
} from "./chunk-TZKNU5TD.js";
|
|
2
|
+
import { createRequire as __yamchartCreateRequire } from 'module'; if (!globalThis.require) globalThis.require = __yamchartCreateRequire(import.meta.url);
|
|
5
3
|
import {
|
|
6
4
|
findProjectRoot,
|
|
7
5
|
loadEnvFile,
|
|
8
6
|
validateProject
|
|
9
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-25ES7MGF.js";
|
|
8
|
+
import {
|
|
9
|
+
checkForUpdate
|
|
10
|
+
} from "./chunk-TZKNU5TD.js";
|
|
10
11
|
import {
|
|
11
12
|
detail,
|
|
12
13
|
error,
|
|
@@ -17,9 +18,9 @@ import {
|
|
|
17
18
|
success,
|
|
18
19
|
warning
|
|
19
20
|
} from "./chunk-HJVVHYVN.js";
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-5CRXV5PQ.js";
|
|
22
|
+
import "./chunk-X3UG6T3Q.js";
|
|
23
|
+
import "./chunk-7HWFVUGP.js";
|
|
23
24
|
import "./chunk-7D4SUZUM.js";
|
|
24
25
|
|
|
25
26
|
// src/index.ts
|
|
@@ -97,6 +98,11 @@ program.command("validate").description("Validate configuration files").argument
|
|
|
97
98
|
process.exit(result.success ? 0 : 1);
|
|
98
99
|
});
|
|
99
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
|
+
}
|
|
100
106
|
const startPath = resolve(path);
|
|
101
107
|
const projectDir = await findProjectRoot(startPath);
|
|
102
108
|
if (!projectDir) {
|
|
@@ -105,7 +111,7 @@ program.command("dev").description("Start development server with hot reload").a
|
|
|
105
111
|
process.exit(2);
|
|
106
112
|
}
|
|
107
113
|
const globalOpts = program.opts();
|
|
108
|
-
const { runDevServer } = await import("./dev-
|
|
114
|
+
const { runDevServer } = await import("./dev-KOWFGDOP.js");
|
|
109
115
|
await runDevServer(projectDir, {
|
|
110
116
|
port: parseInt(options.port, 10),
|
|
111
117
|
apiOnly: options.apiOnly ?? false,
|
|
@@ -115,7 +121,7 @@ program.command("dev").description("Start development server with hot reload").a
|
|
|
115
121
|
});
|
|
116
122
|
});
|
|
117
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) => {
|
|
118
|
-
const { initProject } = await import("./init-
|
|
124
|
+
const { initProject } = await import("./init-TJJVKMEN.js");
|
|
119
125
|
const targetDir = resolve(directory);
|
|
120
126
|
const result = await initProject(targetDir, options);
|
|
121
127
|
if (!result.success) {
|
|
@@ -179,7 +185,7 @@ program.command("sync-dbt").description("Sync dbt project metadata into AI-reada
|
|
|
179
185
|
if (!options.targetDatabase) {
|
|
180
186
|
try {
|
|
181
187
|
const { readFile } = await import("fs/promises");
|
|
182
|
-
const { resolveConnection } = await import("./connection-utils-
|
|
188
|
+
const { resolveConnection } = await import("./connection-utils-HNX3473B.js");
|
|
183
189
|
const { detectDatabaseMismatch } = await import("./rewrite-database-BOA4QPUR.js");
|
|
184
190
|
const catalogJsonStr = await readFile(join(projectDir, ".yamchart", "catalog.json"), "utf-8");
|
|
185
191
|
const catalogData = JSON.parse(catalogJsonStr);
|
|
@@ -233,7 +239,7 @@ program.command("test").description("Run model tests (@returns schema checks and
|
|
|
233
239
|
}
|
|
234
240
|
loadEnvFile(projectDir);
|
|
235
241
|
try {
|
|
236
|
-
const { testProject, formatTestOutput } = await import("./test-
|
|
242
|
+
const { testProject, formatTestOutput } = await import("./test-MKNKUR3N.js");
|
|
237
243
|
const result = await testProject(projectDir, model, {
|
|
238
244
|
connection: options.connection,
|
|
239
245
|
json: options.json
|
|
@@ -282,7 +288,7 @@ program.command("tables").description("List tables and views in the connected da
|
|
|
282
288
|
loadEnvFile(projectDir);
|
|
283
289
|
try {
|
|
284
290
|
if (options.compare) {
|
|
285
|
-
const { resolveTablesSource } = await import("./source-resolver-
|
|
291
|
+
const { resolveTablesSource } = await import("./source-resolver-7NY3KEZ2.js");
|
|
286
292
|
const { compareTables, formatCompareTables } = await import("./compare-RQFCEZIK.js");
|
|
287
293
|
let localResult;
|
|
288
294
|
try {
|
|
@@ -313,7 +319,7 @@ program.command("tables").description("List tables and views in the connected da
|
|
|
313
319
|
}
|
|
314
320
|
return;
|
|
315
321
|
}
|
|
316
|
-
const { listTables } = await import("./tables-
|
|
322
|
+
const { listTables } = await import("./tables-WQTRZSXR.js");
|
|
317
323
|
const result = await listTables(projectDir, {
|
|
318
324
|
...options,
|
|
319
325
|
source: options.source || "auto"
|
|
@@ -351,7 +357,7 @@ program.command("describe").description("Show columns and types for a table").ar
|
|
|
351
357
|
loadEnvFile(projectDir);
|
|
352
358
|
try {
|
|
353
359
|
if (options.compare) {
|
|
354
|
-
const { resolveDescribeSource } = await import("./source-resolver-
|
|
360
|
+
const { resolveDescribeSource } = await import("./source-resolver-7NY3KEZ2.js");
|
|
355
361
|
const { compareColumns, formatCompareColumns } = await import("./compare-RQFCEZIK.js");
|
|
356
362
|
let localResult;
|
|
357
363
|
try {
|
|
@@ -373,7 +379,7 @@ program.command("describe").description("Show columns and types for a table").ar
|
|
|
373
379
|
}
|
|
374
380
|
return;
|
|
375
381
|
}
|
|
376
|
-
const { describeTable } = await import("./describe-
|
|
382
|
+
const { describeTable } = await import("./describe-KDGXFPDQ.js");
|
|
377
383
|
const result = await describeTable(projectDir, table, {
|
|
378
384
|
...options,
|
|
379
385
|
source: options.source || "auto"
|
|
@@ -412,8 +418,8 @@ program.command("query").description("Execute SQL against a connection").argumen
|
|
|
412
418
|
}
|
|
413
419
|
loadEnvFile(projectDir);
|
|
414
420
|
try {
|
|
415
|
-
const { executeQuery } = await import("./query-
|
|
416
|
-
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");
|
|
417
423
|
const limit = options.limit ? parseInt(options.limit, 10) : void 0;
|
|
418
424
|
const result = await executeQuery(projectDir, sql, {
|
|
419
425
|
connection: options.connection,
|
|
@@ -440,8 +446,8 @@ program.command("sample").description("Show sample rows from a table or dbt mode
|
|
|
440
446
|
}
|
|
441
447
|
loadEnvFile(projectDir);
|
|
442
448
|
try {
|
|
443
|
-
const { sampleTable } = await import("./sample-
|
|
444
|
-
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");
|
|
445
451
|
const limit = options.limit ? parseInt(options.limit, 10) : void 0;
|
|
446
452
|
const result = await sampleTable(projectDir, table, {
|
|
447
453
|
connection: options.connection,
|
|
@@ -471,7 +477,7 @@ program.command("search").description("Search for tables and columns by keyword"
|
|
|
471
477
|
}
|
|
472
478
|
loadEnvFile(projectDir);
|
|
473
479
|
try {
|
|
474
|
-
const { searchDatabase } = await import("./search-
|
|
480
|
+
const { searchDatabase } = await import("./search-NKRXXLRS.js");
|
|
475
481
|
const result = await searchDatabase(projectDir, keyword, {
|
|
476
482
|
...options,
|
|
477
483
|
source: options.source || "auto"
|
|
@@ -525,7 +531,7 @@ catalogCmd.command("tables").description("List tables from cached catalog").opti
|
|
|
525
531
|
process.exit(2);
|
|
526
532
|
}
|
|
527
533
|
try {
|
|
528
|
-
const { listTables } = await import("./tables-
|
|
534
|
+
const { listTables } = await import("./tables-WQTRZSXR.js");
|
|
529
535
|
const result = await listTables(projectDir, {
|
|
530
536
|
source: "catalog",
|
|
531
537
|
schema: options.schema
|
|
@@ -567,7 +573,7 @@ catalogCmd.command("describe").description("Show cached columns and types for a
|
|
|
567
573
|
process.exit(2);
|
|
568
574
|
}
|
|
569
575
|
try {
|
|
570
|
-
const { describeTable } = await import("./describe-
|
|
576
|
+
const { describeTable } = await import("./describe-KDGXFPDQ.js");
|
|
571
577
|
const result = await describeTable(projectDir, table, { source: "catalog" });
|
|
572
578
|
if (options.json) {
|
|
573
579
|
console.log(JSON.stringify(result.columns, null, 2));
|
|
@@ -609,7 +615,7 @@ catalogCmd.command("search").description("Search cached metadata for tables and
|
|
|
609
615
|
process.exit(2);
|
|
610
616
|
}
|
|
611
617
|
try {
|
|
612
|
-
const { searchDatabase } = await import("./search-
|
|
618
|
+
const { searchDatabase } = await import("./search-NKRXXLRS.js");
|
|
613
619
|
const result = await searchDatabase(projectDir, keyword, { source: "catalog" });
|
|
614
620
|
if (options.json) {
|
|
615
621
|
console.log(JSON.stringify(result.results, null, 2));
|
|
@@ -734,7 +740,7 @@ program.command("sync-warehouse").description("Sync warehouse table metadata int
|
|
|
734
740
|
}
|
|
735
741
|
loadEnvFile(projectDir);
|
|
736
742
|
try {
|
|
737
|
-
const { runSyncWarehouse } = await import("./sync-warehouse-
|
|
743
|
+
const { runSyncWarehouse } = await import("./sync-warehouse-PK7HXW7U.js");
|
|
738
744
|
await runSyncWarehouse(projectDir, options);
|
|
739
745
|
} catch (err) {
|
|
740
746
|
error(err instanceof Error ? err.message : String(err));
|
|
@@ -785,7 +791,7 @@ program.command("advisor").description("AI-powered dbt model advisor \u2014 sugg
|
|
|
785
791
|
process.exit(2);
|
|
786
792
|
}
|
|
787
793
|
loadEnvFile(projectDir);
|
|
788
|
-
const { runAdvisor } = await import("./advisor-
|
|
794
|
+
const { runAdvisor } = await import("./advisor-5F73GF54.js");
|
|
789
795
|
await runAdvisor(projectDir, question, {
|
|
790
796
|
top: options.top ? parseInt(options.top, 10) : 5,
|
|
791
797
|
json: options.json,
|
|
@@ -793,7 +799,7 @@ program.command("advisor").description("AI-powered dbt model advisor \u2014 sugg
|
|
|
793
799
|
connection: options.connection
|
|
794
800
|
});
|
|
795
801
|
});
|
|
796
|
-
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) => {
|
|
797
803
|
const startPath = resolve(".");
|
|
798
804
|
const projectDir = await findProjectRoot(startPath);
|
|
799
805
|
if (!projectDir) {
|
|
@@ -803,21 +809,31 @@ var semanticCmd = program.command("semantic").description("Explore the semantic
|
|
|
803
809
|
}
|
|
804
810
|
loadEnvFile(projectDir);
|
|
805
811
|
try {
|
|
806
|
-
const {
|
|
807
|
-
const
|
|
808
|
-
const
|
|
809
|
-
|
|
810
|
-
|
|
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
|
+
}
|
|
811
827
|
if (options.json) {
|
|
812
828
|
console.log(JSON.stringify(result.entities, null, 2));
|
|
813
829
|
return;
|
|
814
830
|
}
|
|
815
831
|
if (result.entities.length === 0) {
|
|
816
832
|
info("No semantic entities found.");
|
|
817
|
-
detail("
|
|
833
|
+
detail("Add YAML files to semantic/ or run `yamchart sync-dbt` / `yamchart sync-warehouse` to populate the catalog.");
|
|
818
834
|
return;
|
|
819
835
|
}
|
|
820
|
-
header(`Semantic Layer \u2014 ${result.entities.length} entities`);
|
|
836
|
+
header(`Semantic Layer \u2014 ${result.entities.length} entities (${source === "curated" ? "semantic/*.yaml" : "catalog"})`);
|
|
821
837
|
for (const entity of result.entities) {
|
|
822
838
|
console.log(` ${pc.bold(entity.name)}`);
|
|
823
839
|
console.log(` ${pc.dim(entity.source_table)}`);
|
|
@@ -834,7 +850,7 @@ var semanticCmd = program.command("semantic").description("Explore the semantic
|
|
|
834
850
|
}
|
|
835
851
|
} catch (err) {
|
|
836
852
|
if (err instanceof Error && err.message.includes("ENOENT")) {
|
|
837
|
-
error("No catalog found.
|
|
853
|
+
error("No catalog found. Add semantic/*.yaml files or run `yamchart sync-dbt` / `yamchart sync-warehouse` first.");
|
|
838
854
|
} else {
|
|
839
855
|
error(err instanceof Error ? err.message : String(err));
|
|
840
856
|
}
|
|
@@ -850,10 +866,8 @@ semanticCmd.command("query").description("Run a structured query against the sem
|
|
|
850
866
|
}
|
|
851
867
|
loadEnvFile(projectDir);
|
|
852
868
|
try {
|
|
853
|
-
const {
|
|
854
|
-
const
|
|
855
|
-
const catalogJson = JSON.parse(await readFile(catalogPath, "utf-8"));
|
|
856
|
-
const { querySemanticEntity } = await import("./semantic-K3MYXXJI.js");
|
|
869
|
+
const { loadSemanticDefinitions } = await import("./semantic-DD7P4634.js");
|
|
870
|
+
const { querySemanticDefinition, querySemanticEntity } = await import("./semantic-NBAX4WU4.js");
|
|
857
871
|
const filters = (options.filter || []).map((f) => {
|
|
858
872
|
const eqIdx = f.indexOf("=");
|
|
859
873
|
if (eqIdx === -1) throw new Error(`Invalid filter format: "${f}". Use dimension=value`);
|
|
@@ -863,19 +877,29 @@ semanticCmd.command("query").description("Run a structured query against the sem
|
|
|
863
877
|
value: f.slice(eqIdx + 1)
|
|
864
878
|
};
|
|
865
879
|
});
|
|
866
|
-
const
|
|
880
|
+
const queryInput = {
|
|
867
881
|
entity: options.entity,
|
|
868
882
|
measures: options.measures.split(",").map((s) => s.trim()),
|
|
869
883
|
dimensions: options.dimensions ? options.dimensions.split(",").map((s) => s.trim()) : [],
|
|
870
884
|
filters,
|
|
871
885
|
order_by: options.order ? { field: options.order, direction: options.desc ? "desc" : "asc" } : void 0,
|
|
872
886
|
limit: options.limit ? parseInt(options.limit, 10) : 100
|
|
873
|
-
}
|
|
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
|
+
}
|
|
874
898
|
if (options.sql) {
|
|
875
899
|
console.log(result.sql);
|
|
876
900
|
return;
|
|
877
901
|
}
|
|
878
|
-
const { resolveConnection, createConnector, formatTable, formatJSON } = await import("./connection-utils-
|
|
902
|
+
const { resolveConnection, createConnector, formatTable, formatJSON } = await import("./connection-utils-HNX3473B.js");
|
|
879
903
|
const connection = await resolveConnection(projectDir, options.connection, program.opts().env);
|
|
880
904
|
const connector = createConnector(connection, projectDir);
|
|
881
905
|
const start = performance.now();
|
|
@@ -903,7 +927,7 @@ semanticCmd.command("query").description("Run a structured query against the sem
|
|
|
903
927
|
}
|
|
904
928
|
} catch (err) {
|
|
905
929
|
if (err instanceof Error && err.message.includes("ENOENT")) {
|
|
906
|
-
error("No catalog found.
|
|
930
|
+
error("No catalog found. Add semantic/*.yaml files or run `yamchart sync-dbt` / `yamchart sync-warehouse` first.");
|
|
907
931
|
} else {
|
|
908
932
|
error(err instanceof Error ? err.message : String(err));
|
|
909
933
|
}
|