yamchart 0.8.2 → 0.8.4

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.
Files changed (61) hide show
  1. package/dist/{advisor-3V6WKALO.js → advisor-CSVLJFOG.js} +10 -10
  2. package/dist/{chunk-77CBXDCO.js → chunk-5N3FYFBV.js} +72 -1
  3. package/dist/chunk-5N3FYFBV.js.map +1 -0
  4. package/dist/{chunk-T76DI6OA.js → chunk-QLBCPJDL.js} +4 -4
  5. package/dist/{chunk-KP4CYPBL.js → chunk-RYTMXP2R.js} +49 -7
  6. package/dist/chunk-RYTMXP2R.js.map +1 -0
  7. package/dist/{chunk-HRF7QVK5.js → chunk-VTLZAE3C.js} +2 -2
  8. package/dist/{chunk-GX2PNKES.js → chunk-VXDZEBAN.js} +21 -7
  9. package/dist/chunk-VXDZEBAN.js.map +1 -0
  10. package/dist/{connection-utils-MI7RM5BP.js → connection-utils-2SZAG2QM.js} +4 -4
  11. package/dist/{describe-46XBIND7.js → describe-ELE7CAVA.js} +5 -5
  12. package/dist/{dev-IMKOBPDZ.js → dev-AWJ7TF6G.js} +49 -18
  13. package/dist/dev-AWJ7TF6G.js.map +1 -0
  14. package/dist/dist-2OQOI2PU.js +54 -0
  15. package/dist/{dist-ONU5AKOH.js → dist-E2PVGIPT.js} +4 -2
  16. package/dist/{dist-25RTZO4E.js → dist-GVNWQXFR.js} +2 -2
  17. package/dist/index.js +34 -25
  18. package/dist/index.js.map +1 -1
  19. package/dist/{init-UYQE5DPU.js → init-GVBYCLJT.js} +14 -1
  20. package/dist/init-GVBYCLJT.js.map +1 -0
  21. package/dist/public/assets/{EventManagement-DSew47oL.js → EventManagement-DmRy5bu3.js} +1 -1
  22. package/dist/public/assets/{LoginPage-BwFMXS0X.js → LoginPage-B2bo8Eck.js} +1 -1
  23. package/dist/public/assets/{PublicViewer-70ErTigq.js → PublicViewer-B_3K2MkZ.js} +1 -1
  24. package/dist/public/assets/{SetupWizard-CR7XCMkq.js → SetupWizard-utnbmxeP.js} +1 -1
  25. package/dist/public/assets/{ShareManagement-B2ZU0Fdy.js → ShareManagement-6iYAjCrr.js} +1 -1
  26. package/dist/public/assets/{UserManagement-CHRB-6uy.js → UserManagement-DAOq9eUf.js} +1 -1
  27. package/dist/public/assets/{index-DcNtdUoV.js → index-BbSrYtxR.js} +3 -3
  28. package/dist/public/assets/{index.es-BC82iFuu.js → index.es-C-5Ej3mu.js} +1 -1
  29. package/dist/public/assets/{jspdf.es.min-DojRcwGj.js → jspdf.es.min-B-lLjljE.js} +3 -3
  30. package/dist/public/index.html +1 -1
  31. package/dist/{query-Q3B4TQTZ.js → query-P4TSQES4.js} +4 -4
  32. package/dist/{sample-PEHRM3TN.js → sample-3VDU6ZAV.js} +4 -4
  33. package/dist/{search-NBJHS4TZ.js → search-L5QA64T7.js} +5 -5
  34. package/dist/{source-resolver-2DIK3MK4.js → source-resolver-TTHGNPBK.js} +5 -5
  35. package/dist/source-resolver-TTHGNPBK.js.map +1 -0
  36. package/dist/{sync-warehouse-UGTZCZ7J.js → sync-warehouse-KGT6XSXI.js} +9 -9
  37. package/dist/{tables-ZERITKTS.js → tables-IG4RYPCG.js} +5 -5
  38. package/dist/templates/default/docs/yamchart-reference.md +50 -4
  39. package/dist/templates/default/yamchart.yaml +10 -0
  40. package/dist/templates/empty/yamchart.yaml +10 -0
  41. package/dist/{test-ME2Q6CSR.js → test-SN75DCIN.js} +4 -4
  42. package/package.json +4 -4
  43. package/dist/chunk-77CBXDCO.js.map +0 -1
  44. package/dist/chunk-GX2PNKES.js.map +0 -1
  45. package/dist/chunk-KP4CYPBL.js.map +0 -1
  46. package/dist/dev-IMKOBPDZ.js.map +0 -1
  47. package/dist/init-UYQE5DPU.js.map +0 -1
  48. /package/dist/{advisor-3V6WKALO.js.map → advisor-CSVLJFOG.js.map} +0 -0
  49. /package/dist/{chunk-T76DI6OA.js.map → chunk-QLBCPJDL.js.map} +0 -0
  50. /package/dist/{chunk-HRF7QVK5.js.map → chunk-VTLZAE3C.js.map} +0 -0
  51. /package/dist/{connection-utils-MI7RM5BP.js.map → connection-utils-2SZAG2QM.js.map} +0 -0
  52. /package/dist/{describe-46XBIND7.js.map → describe-ELE7CAVA.js.map} +0 -0
  53. /package/dist/{dist-ONU5AKOH.js.map → dist-2OQOI2PU.js.map} +0 -0
  54. /package/dist/{source-resolver-2DIK3MK4.js.map → dist-E2PVGIPT.js.map} +0 -0
  55. /package/dist/{dist-25RTZO4E.js.map → dist-GVNWQXFR.js.map} +0 -0
  56. /package/dist/{query-Q3B4TQTZ.js.map → query-P4TSQES4.js.map} +0 -0
  57. /package/dist/{sample-PEHRM3TN.js.map → sample-3VDU6ZAV.js.map} +0 -0
  58. /package/dist/{search-NBJHS4TZ.js.map → search-L5QA64T7.js.map} +0 -0
  59. /package/dist/{sync-warehouse-UGTZCZ7J.js.map → sync-warehouse-KGT6XSXI.js.map} +0 -0
  60. /package/dist/{tables-ZERITKTS.js.map → tables-IG4RYPCG.js.map} +0 -0
  61. /package/dist/{test-ME2Q6CSR.js.map → test-SN75DCIN.js.map} +0 -0
@@ -0,0 +1,54 @@
1
+ import {
2
+ ChartSchema,
3
+ ConnectionSchema,
4
+ DashboardSchema,
5
+ DimensionSchema,
6
+ DimensionTypeSchema,
7
+ EventSchema,
8
+ EventsFileSchema,
9
+ MeasureSchema,
10
+ MeasureTypeSchema,
11
+ ModelMetadataSchema,
12
+ ModelSchema,
13
+ ParameterSchema,
14
+ ProjectSchema,
15
+ RelationshipSchema,
16
+ ScheduleSchema,
17
+ SemanticConfigSchema,
18
+ SemanticEntitySchema,
19
+ SemanticFilterOperatorSchema,
20
+ SemanticFilterSchema,
21
+ SemanticModelSchema,
22
+ SemanticQuerySchema,
23
+ VERSION,
24
+ deepMerge,
25
+ resolveProjectConfig
26
+ } from "./chunk-RYTMXP2R.js";
27
+ import "./chunk-DGUM43GV.js";
28
+ export {
29
+ ChartSchema,
30
+ ConnectionSchema,
31
+ DashboardSchema,
32
+ DimensionSchema,
33
+ DimensionTypeSchema,
34
+ EventSchema,
35
+ EventsFileSchema,
36
+ MeasureSchema,
37
+ MeasureTypeSchema,
38
+ ModelMetadataSchema,
39
+ ModelSchema,
40
+ ParameterSchema,
41
+ ProjectSchema,
42
+ RelationshipSchema,
43
+ ScheduleSchema,
44
+ SemanticConfigSchema,
45
+ SemanticEntitySchema,
46
+ SemanticFilterOperatorSchema,
47
+ SemanticFilterSchema,
48
+ SemanticModelSchema,
49
+ SemanticQuerySchema,
50
+ VERSION,
51
+ deepMerge,
52
+ resolveProjectConfig
53
+ };
54
+ //# sourceMappingURL=dist-2OQOI2PU.js.map
@@ -4,6 +4,7 @@ import {
4
4
  MySQLConnector,
5
5
  PostgresConnector,
6
6
  QueryCompiler,
7
+ ReconnectingConnector,
7
8
  SQLiteConnector,
8
9
  SnowflakeConnector,
9
10
  SqlList,
@@ -30,7 +31,7 @@ import {
30
31
  runModel,
31
32
  serializeDateValue,
32
33
  templateHasVariable
33
- } from "./chunk-77CBXDCO.js";
34
+ } from "./chunk-5N3FYFBV.js";
34
35
  import {
35
36
  SemanticModelBuilder,
36
37
  SemanticQueryCompiler,
@@ -47,6 +48,7 @@ export {
47
48
  MySQLConnector,
48
49
  PostgresConnector,
49
50
  QueryCompiler,
51
+ ReconnectingConnector,
50
52
  SQLiteConnector,
51
53
  SemanticModelBuilder,
52
54
  SemanticQueryCompiler,
@@ -81,4 +83,4 @@ export {
81
83
  templateHasVariable,
82
84
  validateSemanticQuery
83
85
  };
84
- //# sourceMappingURL=dist-ONU5AKOH.js.map
86
+ //# sourceMappingURL=dist-E2PVGIPT.js.map
@@ -1,4 +1,4 @@
1
- import "./chunk-77CBXDCO.js";
1
+ import "./chunk-5N3FYFBV.js";
2
2
  import {
3
3
  SemanticModelBuilder,
4
4
  SemanticQueryCompiler
@@ -787,4 +787,4 @@ export {
787
787
  updateSchemaYml,
788
788
  writeDbtModel
789
789
  };
790
- //# sourceMappingURL=dist-25RTZO4E.js.map
790
+ //# sourceMappingURL=dist-GVNWQXFR.js.map
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  findProjectRoot,
7
7
  loadEnvFile,
8
8
  validateProject
9
- } from "./chunk-T76DI6OA.js";
9
+ } from "./chunk-QLBCPJDL.js";
10
10
  import {
11
11
  detail,
12
12
  error,
@@ -17,8 +17,8 @@ import {
17
17
  success,
18
18
  warning
19
19
  } from "./chunk-HJVVHYVN.js";
20
- import "./chunk-KP4CYPBL.js";
21
- import "./chunk-77CBXDCO.js";
20
+ import "./chunk-RYTMXP2R.js";
21
+ import "./chunk-5N3FYFBV.js";
22
22
  import "./chunk-UND73EOB.js";
23
23
  import "./chunk-DGUM43GV.js";
24
24
 
@@ -32,6 +32,13 @@ var __dirname = dirname(fileURLToPath(import.meta.url));
32
32
  var pkg = JSON.parse(readFileSync(join(__dirname, "../package.json"), "utf-8"));
33
33
  var program = new Command();
34
34
  program.name("yamchart").description("Git-native business intelligence dashboards").version(pkg.version);
35
+ program.option("--env <name>", "Environment to use (default: local, or YAMCHART_ENV)");
36
+ program.hook("preAction", () => {
37
+ const opts = program.opts();
38
+ if (opts.env) {
39
+ process.env.YAMCHART_ENV = opts.env;
40
+ }
41
+ });
35
42
  program.command("validate").description("Validate configuration files").argument("[path]", "Path to yamchart project", ".").option("--dry-run", "Connect to database and test queries with EXPLAIN").option("-c, --connection <name>", "Connection to use for dry-run").option("--json", "Output as JSON").action(async (path, options) => {
36
43
  const startPath = resolve(path);
37
44
  const projectDir = await findProjectRoot(startPath);
@@ -97,16 +104,18 @@ program.command("dev").description("Start development server with hot reload").a
97
104
  detail("Run this command from a yamchart project directory");
98
105
  process.exit(2);
99
106
  }
100
- const { runDevServer } = await import("./dev-IMKOBPDZ.js");
107
+ const globalOpts = program.opts();
108
+ const { runDevServer } = await import("./dev-AWJ7TF6G.js");
101
109
  await runDevServer(projectDir, {
102
110
  port: parseInt(options.port, 10),
103
111
  apiOnly: options.apiOnly ?? false,
104
112
  open: options.open,
105
- version: pkg.version
113
+ version: pkg.version,
114
+ env: globalOpts.env
106
115
  });
107
116
  });
108
117
  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) => {
109
- const { initProject } = await import("./init-UYQE5DPU.js");
118
+ const { initProject } = await import("./init-GVBYCLJT.js");
110
119
  const targetDir = resolve(directory);
111
120
  const result = await initProject(targetDir, options);
112
121
  if (!result.success) {
@@ -170,11 +179,11 @@ program.command("sync-dbt").description("Sync dbt project metadata into AI-reada
170
179
  if (!options.targetDatabase) {
171
180
  try {
172
181
  const { readFile } = await import("fs/promises");
173
- const { resolveConnection } = await import("./connection-utils-MI7RM5BP.js");
182
+ const { resolveConnection } = await import("./connection-utils-2SZAG2QM.js");
174
183
  const { detectDatabaseMismatch } = await import("./rewrite-database-FDJIXKZ2.js");
175
184
  const catalogJsonStr = await readFile(join(projectDir, ".yamchart", "catalog.json"), "utf-8");
176
185
  const catalogData = JSON.parse(catalogJsonStr);
177
- const connection = await resolveConnection(projectDir);
186
+ const connection = await resolveConnection(projectDir, void 0, program.opts().env);
178
187
  const connDb = connection.config?.database;
179
188
  const mismatch = detectDatabaseMismatch(catalogData.models, connDb);
180
189
  if (mismatch.mismatch) {
@@ -224,7 +233,7 @@ program.command("test").description("Run model tests (@returns schema checks and
224
233
  }
225
234
  loadEnvFile(projectDir);
226
235
  try {
227
- const { testProject, formatTestOutput } = await import("./test-ME2Q6CSR.js");
236
+ const { testProject, formatTestOutput } = await import("./test-SN75DCIN.js");
228
237
  const result = await testProject(projectDir, model, {
229
238
  connection: options.connection,
230
239
  json: options.json
@@ -273,7 +282,7 @@ program.command("tables").description("List tables and views in the connected da
273
282
  loadEnvFile(projectDir);
274
283
  try {
275
284
  if (options.compare) {
276
- const { resolveTablesSource } = await import("./source-resolver-2DIK3MK4.js");
285
+ const { resolveTablesSource } = await import("./source-resolver-TTHGNPBK.js");
277
286
  const { compareTables, formatCompareTables } = await import("./compare-ZN6RUOOQ.js");
278
287
  let localResult;
279
288
  try {
@@ -304,7 +313,7 @@ program.command("tables").description("List tables and views in the connected da
304
313
  }
305
314
  return;
306
315
  }
307
- const { listTables } = await import("./tables-ZERITKTS.js");
316
+ const { listTables } = await import("./tables-IG4RYPCG.js");
308
317
  const result = await listTables(projectDir, {
309
318
  ...options,
310
319
  source: options.source || "auto"
@@ -342,7 +351,7 @@ program.command("describe").description("Show columns and types for a table").ar
342
351
  loadEnvFile(projectDir);
343
352
  try {
344
353
  if (options.compare) {
345
- const { resolveDescribeSource } = await import("./source-resolver-2DIK3MK4.js");
354
+ const { resolveDescribeSource } = await import("./source-resolver-TTHGNPBK.js");
346
355
  const { compareColumns, formatCompareColumns } = await import("./compare-ZN6RUOOQ.js");
347
356
  let localResult;
348
357
  try {
@@ -364,7 +373,7 @@ program.command("describe").description("Show columns and types for a table").ar
364
373
  }
365
374
  return;
366
375
  }
367
- const { describeTable } = await import("./describe-46XBIND7.js");
376
+ const { describeTable } = await import("./describe-ELE7CAVA.js");
368
377
  const result = await describeTable(projectDir, table, {
369
378
  ...options,
370
379
  source: options.source || "auto"
@@ -403,8 +412,8 @@ program.command("query").description("Execute SQL against a connection").argumen
403
412
  }
404
413
  loadEnvFile(projectDir);
405
414
  try {
406
- const { executeQuery } = await import("./query-Q3B4TQTZ.js");
407
- const { formatTable, formatJSON } = await import("./connection-utils-MI7RM5BP.js");
415
+ const { executeQuery } = await import("./query-P4TSQES4.js");
416
+ const { formatTable, formatJSON } = await import("./connection-utils-2SZAG2QM.js");
408
417
  const limit = options.limit ? parseInt(options.limit, 10) : void 0;
409
418
  const result = await executeQuery(projectDir, sql, {
410
419
  connection: options.connection,
@@ -431,8 +440,8 @@ program.command("sample").description("Show sample rows from a table or dbt mode
431
440
  }
432
441
  loadEnvFile(projectDir);
433
442
  try {
434
- const { sampleTable } = await import("./sample-PEHRM3TN.js");
435
- const { formatTable, formatJSON } = await import("./connection-utils-MI7RM5BP.js");
443
+ const { sampleTable } = await import("./sample-3VDU6ZAV.js");
444
+ const { formatTable, formatJSON } = await import("./connection-utils-2SZAG2QM.js");
436
445
  const limit = options.limit ? parseInt(options.limit, 10) : void 0;
437
446
  const result = await sampleTable(projectDir, table, {
438
447
  connection: options.connection,
@@ -462,7 +471,7 @@ program.command("search").description("Search for tables and columns by keyword"
462
471
  }
463
472
  loadEnvFile(projectDir);
464
473
  try {
465
- const { searchDatabase } = await import("./search-NBJHS4TZ.js");
474
+ const { searchDatabase } = await import("./search-L5QA64T7.js");
466
475
  const result = await searchDatabase(projectDir, keyword, {
467
476
  ...options,
468
477
  source: options.source || "auto"
@@ -516,7 +525,7 @@ catalogCmd.command("tables").description("List tables from cached catalog").opti
516
525
  process.exit(2);
517
526
  }
518
527
  try {
519
- const { listTables } = await import("./tables-ZERITKTS.js");
528
+ const { listTables } = await import("./tables-IG4RYPCG.js");
520
529
  const result = await listTables(projectDir, {
521
530
  source: "catalog",
522
531
  schema: options.schema
@@ -558,7 +567,7 @@ catalogCmd.command("describe").description("Show cached columns and types for a
558
567
  process.exit(2);
559
568
  }
560
569
  try {
561
- const { describeTable } = await import("./describe-46XBIND7.js");
570
+ const { describeTable } = await import("./describe-ELE7CAVA.js");
562
571
  const result = await describeTable(projectDir, table, { source: "catalog" });
563
572
  if (options.json) {
564
573
  console.log(JSON.stringify(result.columns, null, 2));
@@ -600,7 +609,7 @@ catalogCmd.command("search").description("Search cached metadata for tables and
600
609
  process.exit(2);
601
610
  }
602
611
  try {
603
- const { searchDatabase } = await import("./search-NBJHS4TZ.js");
612
+ const { searchDatabase } = await import("./search-L5QA64T7.js");
604
613
  const result = await searchDatabase(projectDir, keyword, { source: "catalog" });
605
614
  if (options.json) {
606
615
  console.log(JSON.stringify(result.results, null, 2));
@@ -725,7 +734,7 @@ program.command("sync-warehouse").description("Sync warehouse table metadata int
725
734
  }
726
735
  loadEnvFile(projectDir);
727
736
  try {
728
- const { runSyncWarehouse } = await import("./sync-warehouse-UGTZCZ7J.js");
737
+ const { runSyncWarehouse } = await import("./sync-warehouse-KGT6XSXI.js");
729
738
  await runSyncWarehouse(projectDir, options);
730
739
  } catch (err) {
731
740
  error(err instanceof Error ? err.message : String(err));
@@ -776,7 +785,7 @@ program.command("advisor").description("AI-powered dbt model advisor \u2014 sugg
776
785
  process.exit(2);
777
786
  }
778
787
  loadEnvFile(projectDir);
779
- const { runAdvisor } = await import("./advisor-3V6WKALO.js");
788
+ const { runAdvisor } = await import("./advisor-CSVLJFOG.js");
780
789
  await runAdvisor(projectDir, question, {
781
790
  top: options.top ? parseInt(options.top, 10) : 5,
782
791
  json: options.json,
@@ -866,8 +875,8 @@ semanticCmd.command("query").description("Run a structured query against the sem
866
875
  console.log(result.sql);
867
876
  return;
868
877
  }
869
- const { resolveConnection, createConnector, formatTable, formatJSON } = await import("./connection-utils-MI7RM5BP.js");
870
- const connection = await resolveConnection(projectDir, options.connection);
878
+ const { resolveConnection, createConnector, formatTable, formatJSON } = await import("./connection-utils-2SZAG2QM.js");
879
+ const connection = await resolveConnection(projectDir, options.connection, program.opts().env);
871
880
  const connector = createConnector(connection, projectDir);
872
881
  const start = performance.now();
873
882
  await connector.connect();