yamchart 0.10.1 → 0.10.3

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 (83) hide show
  1. package/dist/{advisor-5TJDNAY7.js → advisor-XTJQU7E4.js} +12 -12
  2. package/dist/{chunk-QUIDZO5G.js → chunk-2XJZJ6IA.js} +22 -6
  3. package/dist/chunk-2XJZJ6IA.js.map +1 -0
  4. package/dist/{chunk-UFDQ3C7Q.js → chunk-6ELSQNIH.js} +257 -257
  5. package/dist/chunk-6ELSQNIH.js.map +1 -0
  6. package/dist/{chunk-64CI3HSY.js → chunk-KDDO4UII.js} +70 -11
  7. package/dist/chunk-KDDO4UII.js.map +1 -0
  8. package/dist/{chunk-S2CH4HUZ.js → chunk-ODSPBOJW.js} +4 -4
  9. package/dist/chunk-OYBI433Z.js +1296 -0
  10. package/dist/chunk-OYBI433Z.js.map +1 -0
  11. package/dist/{chunk-ZBCQNWVN.js → chunk-PXFTWXSV.js} +5 -5
  12. package/dist/{chunk-5FHV22X2.js → chunk-XNMB25GT.js} +4 -4
  13. package/dist/{connection-utils-FEUWER5I.js → connection-utils-S7EFPTLY.js} +5 -5
  14. package/dist/{describe-MEP72B56.js → describe-TA2CTODC.js} +7 -7
  15. package/dist/{dev-H6SJZ5UA.js → dev-PHFYLJPJ.js} +2589 -1243
  16. package/dist/dev-PHFYLJPJ.js.map +1 -0
  17. package/dist/dev-supervisor-JXLVGEHP.js +43 -0
  18. package/dist/dev-supervisor-JXLVGEHP.js.map +1 -0
  19. package/dist/{dist-PPAD6KOM.js → dist-F6TVLP6C.js} +34 -4
  20. package/dist/{dist-XNCED7JW.js → dist-Q5ETETUU.js} +4 -4
  21. package/dist/{dist-5DQO6L2S.js → dist-YJOOH65Y.js} +9 -5
  22. package/dist/index.js +65 -42
  23. package/dist/index.js.map +1 -1
  24. package/dist/{init-SECXKD5G.js → init-TJJVKMEN.js} +24 -5
  25. package/dist/init-TJJVKMEN.js.map +1 -0
  26. package/dist/public/assets/DataView-V-E6oxy6.js +9 -0
  27. package/dist/public/assets/{EventManagement-BnmeJDQl.js → EventManagement-Do2xU5lV.js} +2 -2
  28. package/dist/public/assets/ExplorePage-Dg50mvGB.js +1 -0
  29. package/dist/public/assets/{LoginPage-CzaFkkjg.js → LoginPage-DmYGIXcu.js} +1 -1
  30. package/dist/public/assets/{PublicViewer-irjxqH6a.js → PublicViewer-CJTgc9OF.js} +1 -1
  31. package/dist/public/assets/{SetupWizard-ConWIcmy.js → SetupWizard-Bo-zmh43.js} +1 -1
  32. package/dist/public/assets/{ShareManagement-CP4wdwLR.js → ShareManagement-6Wp6b2Gp.js} +1 -1
  33. package/dist/public/assets/{SourceDetailView-DZS5518E.js → SourceDetailView-CTzSXhZc.js} +1 -1
  34. package/dist/public/assets/UserManagement-DQhB13T0.js +1 -0
  35. package/dist/public/assets/{index-jlfTO7f5.js → index-CY8xsfQH.js} +41 -41
  36. package/dist/public/assets/{index-C1X8RW4Z.css → index-Dkn-tJCT.css} +1 -1
  37. package/dist/public/assets/{index.es-CgnvEWi5.js → index.es-Bc3yys5L.js} +1 -1
  38. package/dist/public/assets/{jspdf.es.min-Cw5WefMt.js → jspdf.es.min-D94JEH-J.js} +3 -3
  39. package/dist/public/index.html +2 -2
  40. package/dist/{query-2H3YOPI2.js → query-AX4BOPMH.js} +5 -5
  41. package/dist/sample-4NUBJGIL.js +76 -0
  42. package/dist/sample-4NUBJGIL.js.map +1 -0
  43. package/dist/{search-IPE4ISFB.js → search-IBVVYN4I.js} +7 -7
  44. package/dist/{semantic-K3MYXXJI.js → semantic-33YIUMUV.js} +39 -4
  45. package/dist/semantic-33YIUMUV.js.map +1 -0
  46. package/dist/semantic-5WGVZ7HY.js +30 -0
  47. package/dist/{source-resolver-HZQLOODU.js → source-resolver-GYXIRIVK.js} +7 -7
  48. package/dist/source-resolver-GYXIRIVK.js.map +1 -0
  49. package/dist/{sync-warehouse-TUNULDUY.js → sync-warehouse-5NKENCOZ.js} +15 -11
  50. package/dist/sync-warehouse-5NKENCOZ.js.map +1 -0
  51. package/dist/{tables-K5NAN2WK.js → tables-QMZMYYV5.js} +7 -7
  52. package/dist/templates/default/docs/yamchart-reference.md +26 -0
  53. package/dist/{test-SRHVOXZB.js → test-6MCPGXJP.js} +19 -7
  54. package/dist/test-6MCPGXJP.js.map +1 -0
  55. package/package.json +2 -2
  56. package/dist/chunk-64CI3HSY.js.map +0 -1
  57. package/dist/chunk-QUIDZO5G.js.map +0 -1
  58. package/dist/chunk-UFDQ3C7Q.js.map +0 -1
  59. package/dist/chunk-ZIY22VO7.js +0 -1190
  60. package/dist/chunk-ZIY22VO7.js.map +0 -1
  61. package/dist/dev-H6SJZ5UA.js.map +0 -1
  62. package/dist/init-SECXKD5G.js.map +0 -1
  63. package/dist/public/assets/DataView-DUCz_96y.js +0 -9
  64. package/dist/public/assets/ExplorePage-kk4z9ldZ.js +0 -1
  65. package/dist/public/assets/UserManagement-AubGd9hl.js +0 -1
  66. package/dist/sample-ODUGGSFA.js +0 -42
  67. package/dist/sample-ODUGGSFA.js.map +0 -1
  68. package/dist/semantic-K3MYXXJI.js.map +0 -1
  69. package/dist/sync-warehouse-TUNULDUY.js.map +0 -1
  70. package/dist/test-SRHVOXZB.js.map +0 -1
  71. /package/dist/{advisor-5TJDNAY7.js.map → advisor-XTJQU7E4.js.map} +0 -0
  72. /package/dist/{chunk-S2CH4HUZ.js.map → chunk-ODSPBOJW.js.map} +0 -0
  73. /package/dist/{chunk-ZBCQNWVN.js.map → chunk-PXFTWXSV.js.map} +0 -0
  74. /package/dist/{chunk-5FHV22X2.js.map → chunk-XNMB25GT.js.map} +0 -0
  75. /package/dist/{connection-utils-FEUWER5I.js.map → connection-utils-S7EFPTLY.js.map} +0 -0
  76. /package/dist/{describe-MEP72B56.js.map → describe-TA2CTODC.js.map} +0 -0
  77. /package/dist/{dist-5DQO6L2S.js.map → dist-F6TVLP6C.js.map} +0 -0
  78. /package/dist/{dist-PPAD6KOM.js.map → dist-Q5ETETUU.js.map} +0 -0
  79. /package/dist/{dist-XNCED7JW.js.map → dist-YJOOH65Y.js.map} +0 -0
  80. /package/dist/{query-2H3YOPI2.js.map → query-AX4BOPMH.js.map} +0 -0
  81. /package/dist/{search-IPE4ISFB.js.map → search-IBVVYN4I.js.map} +0 -0
  82. /package/dist/{source-resolver-HZQLOODU.js.map → semantic-5WGVZ7HY.js.map} +0 -0
  83. /package/dist/{tables-K5NAN2WK.js.map → tables-QMZMYYV5.js.map} +0 -0
@@ -1,1190 +0,0 @@
1
- import { createRequire as __yamchartCreateRequire } from 'module'; if (!globalThis.require) globalThis.require = __yamchartCreateRequire(import.meta.url);
2
- // ../../packages/schema/dist/connection.js
3
- import { z } from "zod";
4
- var EnvAuthSchema = z.object({
5
- type: z.literal("env"),
6
- user_var: z.string(),
7
- password_var: z.string()
8
- });
9
- var KeyPairAuthSchema = z.object({
10
- type: z.literal("key_pair"),
11
- user_var: z.string(),
12
- private_key_path: z.string()
13
- });
14
- var SecretManagerAuthSchema = z.object({
15
- type: z.literal("secret_manager"),
16
- provider: z.enum(["aws_secrets_manager", "gcp_secret_manager", "vault"]),
17
- secret_id: z.string()
18
- });
19
- var ExternalBrowserAuthSchema = z.object({
20
- type: z.literal("externalbrowser"),
21
- user_var: z.string(),
22
- cache_token: z.boolean().optional()
23
- });
24
- var ServiceAccountAuthSchema = z.object({
25
- type: z.literal("service_account"),
26
- credentials_var: z.string().optional(),
27
- // env var NAME holding the SA JSON contents
28
- key_file: z.string().optional()
29
- // path to a SA .json key file
30
- });
31
- var AuthSchema = z.discriminatedUnion("type", [
32
- EnvAuthSchema,
33
- KeyPairAuthSchema,
34
- SecretManagerAuthSchema,
35
- ExternalBrowserAuthSchema,
36
- ServiceAccountAuthSchema
37
- ]);
38
- var PoolConfigSchema = z.object({
39
- min_connections: z.number().int().positive().optional(),
40
- max_connections: z.number().int().positive().optional(),
41
- idle_timeout: z.number().int().positive().optional()
42
- });
43
- var QueryConfigSchema = z.object({
44
- timeout: z.number().int().positive().optional(),
45
- max_rows: z.number().int().positive().optional()
46
- });
47
- var DuckDBConfigSchema = z.object({
48
- path: z.string()
49
- // file path or :memory:
50
- });
51
- var PostgresConfigSchema = z.object({
52
- host: z.string(),
53
- port: z.number().int().positive().default(5432),
54
- database: z.string(),
55
- schema: z.string().optional(),
56
- ssl: z.boolean().optional()
57
- });
58
- var SnowflakeConfigSchema = z.object({
59
- account: z.string(),
60
- warehouse: z.string(),
61
- database: z.string(),
62
- schema: z.string().optional(),
63
- role: z.string().optional()
64
- });
65
- var MySQLConfigSchema = z.object({
66
- host: z.string(),
67
- port: z.number().int().positive().default(3306),
68
- database: z.string(),
69
- ssl: z.boolean().optional()
70
- });
71
- var SQLiteConfigSchema = z.object({
72
- path: z.string()
73
- // file path or :memory:
74
- });
75
- var BigQueryConfigSchema = z.object({
76
- project_id: z.string(),
77
- dataset: z.string().optional(),
78
- location: z.string().optional(),
79
- max_bytes_billed: z.number().optional()
80
- });
81
- var BaseConnectionSchema = z.object({
82
- name: z.string().min(1),
83
- description: z.string().optional(),
84
- pool: PoolConfigSchema.optional(),
85
- query: QueryConfigSchema.optional()
86
- });
87
- var DuckDBConnectionSchema = BaseConnectionSchema.extend({
88
- type: z.literal("duckdb"),
89
- config: DuckDBConfigSchema,
90
- auth: z.undefined().optional()
91
- });
92
- var PostgresConnectionSchema = BaseConnectionSchema.extend({
93
- type: z.literal("postgres"),
94
- config: PostgresConfigSchema,
95
- auth: AuthSchema.optional()
96
- });
97
- var SnowflakeConnectionSchema = BaseConnectionSchema.extend({
98
- type: z.literal("snowflake"),
99
- config: SnowflakeConfigSchema,
100
- auth: AuthSchema
101
- });
102
- var MySQLConnectionSchema = BaseConnectionSchema.extend({
103
- type: z.literal("mysql"),
104
- config: MySQLConfigSchema,
105
- auth: AuthSchema.optional()
106
- });
107
- var SQLiteConnectionSchema = BaseConnectionSchema.extend({
108
- type: z.literal("sqlite"),
109
- config: SQLiteConfigSchema,
110
- auth: z.undefined().optional()
111
- });
112
- var BigQueryConnectionSchema = BaseConnectionSchema.extend({
113
- type: z.literal("bigquery"),
114
- config: BigQueryConfigSchema,
115
- auth: AuthSchema
116
- });
117
- var ConnectionSchema = z.discriminatedUnion("type", [
118
- DuckDBConnectionSchema,
119
- PostgresConnectionSchema,
120
- SnowflakeConnectionSchema,
121
- MySQLConnectionSchema,
122
- SQLiteConnectionSchema,
123
- BigQueryConnectionSchema
124
- ]);
125
-
126
- // ../../packages/schema/dist/chart.js
127
- import { z as z2 } from "zod";
128
- var AxisTypeSchema = z2.enum(["temporal", "quantitative", "ordinal", "nominal"]);
129
- var AxisSchema = z2.object({
130
- field: z2.string().min(1),
131
- type: AxisTypeSchema,
132
- format: z2.string().optional(),
133
- label: z2.string().optional(),
134
- scale: z2.enum(["linear", "log"]).optional()
135
- });
136
- var ChartTypeSchema = z2.enum([
137
- "line",
138
- "bar",
139
- "area",
140
- "pie",
141
- "donut",
142
- "table",
143
- "metric",
144
- "map",
145
- "heatmap",
146
- "funnel",
147
- "sankey",
148
- "treemap",
149
- "waterfall",
150
- "gauge"
151
- ]);
152
- var GradientSchema = z2.union([
153
- z2.boolean(),
154
- z2.object({
155
- from: z2.string(),
156
- to: z2.string()
157
- })
158
- ]);
159
- var LongFormatSeriesSchema = z2.object({
160
- field: z2.string().min(1),
161
- colors: z2.record(z2.string(), z2.string()).optional()
162
- });
163
- var SeriesTransformSchema = z2.object({
164
- type: z2.enum(["rolling_average"]),
165
- window: z2.number().int().positive()
166
- });
167
- var WideFormatColumnSchema = z2.object({
168
- field: z2.string().min(1),
169
- name: z2.string().optional(),
170
- type: z2.enum(["line", "bar", "area"]).optional(),
171
- axis: z2.enum(["left", "right"]).optional(),
172
- color: z2.string().optional(),
173
- style: z2.enum(["solid", "dashed", "dotted"]).optional(),
174
- opacity: z2.number().min(0).max(1).optional(),
175
- gradient: GradientSchema.optional(),
176
- transform: SeriesTransformSchema.optional(),
177
- band: z2.string().optional()
178
- // Pair with another column to render as shaded range band
179
- });
180
- var WideFormatSeriesSchema = z2.object({
181
- columns: z2.array(WideFormatColumnSchema).min(1)
182
- });
183
- var SeriesConfigSchema = z2.union([
184
- LongFormatSeriesSchema,
185
- WideFormatSeriesSchema
186
- ]);
187
- var ColorConditionSchema = z2.object({
188
- when: z2.string(),
189
- color: z2.string()
190
- });
191
- var ConditionalColorSchema = z2.object({
192
- conditions: z2.array(ColorConditionSchema).min(1),
193
- default: z2.string().optional()
194
- });
195
- var ColorSchema = z2.union([
196
- z2.string(),
197
- ConditionalColorSchema
198
- ]);
199
- var LegendSchema = z2.object({
200
- show: z2.boolean().optional(),
201
- position: z2.enum(["top", "bottom", "left", "right"]).optional()
202
- });
203
- var LineAnnotationSchema = z2.object({
204
- type: z2.literal("line"),
205
- value: z2.number(),
206
- label: z2.string().optional(),
207
- color: z2.string().optional(),
208
- style: z2.enum(["solid", "dashed", "dotted"]).optional()
209
- });
210
- var BandAnnotationSchema = z2.object({
211
- type: z2.literal("band"),
212
- from: z2.number(),
213
- to: z2.number(),
214
- label: z2.string().optional(),
215
- color: z2.string().optional()
216
- });
217
- var XLineAnnotationSchema = z2.object({
218
- type: z2.literal("x_line"),
219
- x: z2.string(),
220
- // x-axis value (date string or category)
221
- label: z2.string().optional(),
222
- color: z2.string().optional(),
223
- style: z2.enum(["solid", "dashed", "dotted"]).optional()
224
- });
225
- var AnnotationSchema = z2.discriminatedUnion("type", [
226
- LineAnnotationSchema,
227
- BandAnnotationSchema,
228
- XLineAnnotationSchema
229
- ]);
230
- var GoalZoneSchema = z2.object({
231
- tolerance: z2.number().min(0).max(1)
232
- });
233
- var GoalStyleSchema = z2.enum(["solid", "dashed", "dotted"]);
234
- var FixedGoalSchema = z2.object({
235
- type: z2.literal("fixed"),
236
- value: z2.number(),
237
- label: z2.string().optional(),
238
- color: z2.string().optional(),
239
- style: GoalStyleSchema.optional(),
240
- zone: GoalZoneSchema.optional()
241
- });
242
- var CumulativeGoalSchema = z2.object({
243
- type: z2.literal("cumulative"),
244
- value: z2.number(),
245
- by: z2.string().min(1),
246
- from: z2.string().optional(),
247
- label: z2.string().optional(),
248
- color: z2.string().optional(),
249
- style: GoalStyleSchema.optional(),
250
- zone: GoalZoneSchema.optional()
251
- });
252
- var GoalSourceSchema = z2.object({
253
- model: z2.string().min(1),
254
- value_field: z2.string().min(1),
255
- date_field: z2.string().optional()
256
- });
257
- var ModelGoalSchema = z2.object({
258
- type: z2.literal("model"),
259
- source: GoalSourceSchema,
260
- label: z2.string().optional(),
261
- color: z2.string().optional(),
262
- style: GoalStyleSchema.optional(),
263
- zone: GoalZoneSchema.optional()
264
- });
265
- var GoalSchema = z2.discriminatedUnion("type", [
266
- FixedGoalSchema,
267
- CumulativeGoalSchema,
268
- ModelGoalSchema
269
- ]);
270
- var KpiGoalSchema = z2.object({
271
- value: z2.number(),
272
- label: z2.string().optional(),
273
- show_progress: z2.boolean().optional(),
274
- color: z2.string().optional()
275
- });
276
- var InteractionsSchema = z2.object({
277
- tooltip: z2.boolean().default(true),
278
- zoom: z2.boolean().default(false),
279
- brush: z2.boolean().default(false)
280
- });
281
- var KpiFormatSchema = z2.object({
282
- type: z2.enum(["number", "currency", "percent"]),
283
- currency: z2.string().optional(),
284
- // e.g., 'USD', 'EUR'
285
- decimals: z2.number().optional()
286
- });
287
- var KpiComparisonSchema = z2.object({
288
- enabled: z2.boolean(),
289
- field: z2.string().min(1).optional(),
290
- period: z2.enum(["previous"]).optional(),
291
- label: z2.string().optional(),
292
- type: z2.enum(["percent_change", "absolute"])
293
- }).refine((data) => !(data.field && data.period), { message: "Cannot set both field and period \u2014 use one or the other" }).refine((data) => data.field || data.period, { message: "Must set either field or period for comparison" });
294
- var KpiValueSchema = z2.object({
295
- field: z2.string().min(1)
296
- });
297
- var KpiConfigSchema = z2.object({
298
- type: z2.literal("kpi"),
299
- value: KpiValueSchema,
300
- format: KpiFormatSchema,
301
- comparison: KpiComparisonSchema.optional(),
302
- unit: z2.string().optional(),
303
- // e.g., 'min', 'sessions', 'users'
304
- goal: KpiGoalSchema.optional()
305
- });
306
- var CenterValueSchema = z2.object({
307
- field: z2.string().optional(),
308
- // 'total' for sum, or specific field
309
- label: z2.string().optional(),
310
- format: z2.string().optional()
311
- });
312
- var CompareSchema = z2.object({
313
- period: z2.string(),
314
- // previous_week, previous_month, previous_year, or a preset name
315
- label: z2.string().optional(),
316
- style: z2.enum(["solid", "dashed", "dotted"]).optional(),
317
- opacity: z2.number().min(0).max(1).optional(),
318
- color: z2.string().optional()
319
- });
320
- var StandardChartConfigSchema = z2.object({
321
- type: ChartTypeSchema,
322
- x: AxisSchema,
323
- y: AxisSchema.optional(),
324
- series: SeriesConfigSchema.optional(),
325
- stacking: z2.enum(["stacked", "percent"]).optional(),
326
- orientation: z2.enum(["vertical", "horizontal"]).optional(),
327
- color: ColorSchema.optional(),
328
- gradient: GradientSchema.optional(),
329
- legend: LegendSchema.optional(),
330
- annotations: z2.array(AnnotationSchema).optional(),
331
- compare: z2.array(CompareSchema).optional(),
332
- interactions: InteractionsSchema.optional(),
333
- centerValue: CenterValueSchema.optional(),
334
- // For donut charts
335
- goals: z2.array(GoalSchema).optional()
336
- });
337
- var DualAxisConfigSchema = z2.object({
338
- label: z2.string().optional(),
339
- format: z2.string().optional(),
340
- scale: z2.enum(["linear", "log"]).optional()
341
- });
342
- var DualAxesSchema = z2.object({
343
- left: DualAxisConfigSchema.optional(),
344
- right: DualAxisConfigSchema.optional()
345
- });
346
- var ComboChartConfigSchema = z2.object({
347
- type: z2.literal("combo"),
348
- x: AxisSchema,
349
- series: WideFormatSeriesSchema,
350
- stacking: z2.enum(["stacked", "percent"]).optional(),
351
- axes: DualAxesSchema,
352
- legend: LegendSchema.optional(),
353
- interactions: InteractionsSchema.optional(),
354
- gradient: GradientSchema.optional(),
355
- goals: z2.array(GoalSchema).optional()
356
- });
357
- var ScatterSizeSchema = z2.object({
358
- field: z2.string().min(1),
359
- min: z2.number().optional(),
360
- max: z2.number().optional(),
361
- label: z2.string().optional()
362
- });
363
- var ScatterGroupSchema = z2.object({
364
- field: z2.string().min(1)
365
- });
366
- var RegressionSchema = z2.object({
367
- type: z2.literal("linear"),
368
- show_equation: z2.boolean().optional(),
369
- show_r_squared: z2.boolean().optional()
370
- });
371
- var ScatterChartConfigSchema = z2.object({
372
- type: z2.literal("scatter"),
373
- x: AxisSchema,
374
- y: AxisSchema,
375
- size: ScatterSizeSchema.optional(),
376
- group: ScatterGroupSchema.optional(),
377
- regression: RegressionSchema.optional(),
378
- color: ColorSchema.optional(),
379
- legend: LegendSchema.optional(),
380
- interactions: InteractionsSchema.optional()
381
- });
382
- var HeatmapChartConfigSchema = z2.object({
383
- type: z2.literal("heatmap"),
384
- x: AxisSchema,
385
- y: AxisSchema,
386
- value: z2.object({
387
- field: z2.string().min(1),
388
- label: z2.string().optional()
389
- }),
390
- color_range: z2.object({
391
- min: z2.string().optional(),
392
- max: z2.string().optional()
393
- }).optional(),
394
- show_values: z2.boolean().optional()
395
- });
396
- var FunnelChartConfigSchema = z2.object({
397
- type: z2.literal("funnel"),
398
- stage: z2.object({ field: z2.string().min(1) }),
399
- value: z2.object({ field: z2.string().min(1) }),
400
- show_conversion: z2.boolean().optional(),
401
- color: ColorSchema.optional()
402
- });
403
- var WaterfallChartConfigSchema = z2.object({
404
- type: z2.literal("waterfall"),
405
- category: z2.object({ field: z2.string().min(1) }),
406
- value: z2.object({ field: z2.string().min(1) }),
407
- total_field: z2.string().optional(),
408
- series: LongFormatSeriesSchema.optional(),
409
- // Stacked breakdown within each waterfall step
410
- colors: z2.object({
411
- increase: z2.string().optional(),
412
- decrease: z2.string().optional(),
413
- total: z2.string().optional()
414
- }).optional()
415
- });
416
- var SankeyChartConfigSchema = z2.object({
417
- type: z2.literal("sankey"),
418
- source: z2.object({ field: z2.string().min(1) }),
419
- target: z2.object({ field: z2.string().min(1) }),
420
- value: z2.object({ field: z2.string().min(1) }),
421
- levels: z2.array(z2.array(z2.string())).optional(),
422
- orient: z2.enum(["horizontal", "vertical"]).optional(),
423
- node_width: z2.number().positive().optional(),
424
- node_gap: z2.number().nonnegative().optional(),
425
- label_position: z2.enum(["left", "right", "top", "bottom", "inside"]).optional()
426
- });
427
- var GaugeThresholdSchema = z2.object({
428
- value: z2.number(),
429
- color: z2.string()
430
- });
431
- var GaugeChartConfigSchema = z2.object({
432
- type: z2.literal("gauge"),
433
- value: z2.object({ field: z2.string().min(1) }),
434
- min: z2.number().optional(),
435
- max: z2.number().optional(),
436
- unit: z2.string().optional(),
437
- thresholds: z2.array(GaugeThresholdSchema).optional(),
438
- format: z2.string().optional(),
439
- goal: KpiGoalSchema.optional()
440
- });
441
- var TableColumnSummarySchema = z2.enum(["sum", "avg", "min", "max", "count"]);
442
- var PivotAggregateSchema = z2.enum(["sum", "avg", "min", "max", "count"]);
443
- var PivotValueSchema = z2.object({
444
- field: z2.string().min(1),
445
- aggregate: PivotAggregateSchema.default("sum"),
446
- format: z2.string().optional(),
447
- heatmap: z2.boolean().optional()
448
- });
449
- var PivotHeatmapSchema = z2.object({
450
- color: z2.string().optional(),
451
- scope: z2.enum(["column", "global"]).optional()
452
- });
453
- var PivotConfigSchema = z2.object({
454
- rows: z2.array(z2.string().min(1)).min(1),
455
- columns: z2.string().min(1),
456
- values: z2.array(PivotValueSchema).min(1),
457
- subtotals: z2.boolean().optional(),
458
- grandTotals: z2.boolean().optional(),
459
- heatmap: PivotHeatmapSchema.optional()
460
- });
461
- var TableChartConfigSchema = z2.object({
462
- type: z2.literal("table"),
463
- columns: z2.array(z2.object({
464
- field: z2.string().min(1),
465
- label: z2.string().optional(),
466
- format: z2.string().optional(),
467
- sticky: z2.boolean().optional(),
468
- summary: TableColumnSummarySchema.optional(),
469
- overflow: z2.enum(["ellipsis", "wrap", "hidden"]).optional(),
470
- font: z2.enum(["mono"]).optional()
471
- })).optional(),
472
- summary: z2.object({
473
- label: z2.string().optional()
474
- }).optional(),
475
- sort: z2.object({
476
- field: z2.string().min(1),
477
- direction: z2.enum(["asc", "desc"]).optional()
478
- }).optional(),
479
- pagination: z2.object({
480
- enabled: z2.boolean().optional(),
481
- page_size: z2.number().int().positive().optional(),
482
- mode: z2.enum(["paginated", "infinite_scroll"]).optional(),
483
- server_side: z2.boolean().optional()
484
- }).optional(),
485
- max_rows: z2.number().int().positive().optional(),
486
- export: z2.object({
487
- enabled: z2.boolean().optional(),
488
- max_rows: z2.number().int().positive().optional()
489
- }).optional(),
490
- pivot: PivotConfigSchema.optional()
491
- });
492
- var ChartConfigSchema = z2.union([
493
- ScatterChartConfigSchema,
494
- ComboChartConfigSchema,
495
- HeatmapChartConfigSchema,
496
- FunnelChartConfigSchema,
497
- WaterfallChartConfigSchema,
498
- GaugeChartConfigSchema,
499
- SankeyChartConfigSchema,
500
- TableChartConfigSchema,
501
- StandardChartConfigSchema,
502
- KpiConfigSchema
503
- ]);
504
- var ParameterTypeSchema = z2.enum([
505
- "date_range",
506
- "select",
507
- "multi_select",
508
- "dynamic_select",
509
- "text",
510
- "number",
511
- "boolean"
512
- ]);
513
- var ParameterOptionSchema = z2.union([
514
- z2.string(),
515
- z2.object({
516
- value: z2.string(),
517
- label: z2.string()
518
- })
519
- ]);
520
- var ParameterSourceSchema = z2.object({
521
- model: z2.string(),
522
- value_field: z2.string(),
523
- label_field: z2.string()
524
- });
525
- var ParameterSchema = z2.object({
526
- name: z2.string().min(1),
527
- type: ParameterTypeSchema,
528
- label: z2.string().optional(),
529
- description: z2.string().optional(),
530
- default: z2.union([z2.string(), z2.number(), z2.array(z2.string())]).optional(),
531
- options: z2.array(ParameterOptionSchema).optional(),
532
- source: ParameterSourceSchema.optional()
533
- });
534
- var SourceSchema = z2.object({
535
- model: z2.string().optional(),
536
- sql: z2.string().optional()
537
- }).refine((data) => data.model !== void 0 || data.sql !== void 0, { message: "Source must specify either model or sql" }).refine((data) => !(data.model !== void 0 && data.sql !== void 0), { message: "Source cannot specify both model and sql" });
538
- var RefreshSchema = z2.object({
539
- schedule: z2.string().optional(),
540
- // cron expression
541
- timezone: z2.string().optional(),
542
- cache_ttl: z2.string().optional()
543
- // e.g., "1h", "30m"
544
- });
545
- var DrillDownColumnSchema = z2.object({
546
- field: z2.string().min(1),
547
- label: z2.string().optional(),
548
- format: z2.string().optional()
549
- });
550
- var DrillDownConfigSchema = z2.object({
551
- chart: z2.string().optional(),
552
- // target chart name (source side)
553
- model: z2.string().optional(),
554
- // model name for row-level detail data
555
- field: z2.string().optional(),
556
- // field to pass as filter, defaults to x-axis field (backward compat)
557
- fields: z2.union([z2.string(), z2.array(z2.string())]).optional(),
558
- // dimension field(s) for filtering
559
- columns: z2.array(DrillDownColumnSchema).optional()
560
- // data table columns (target side)
561
- }).refine((data) => data.chart || data.model || data.columns, {
562
- message: "drillDown requires 'chart', 'model', or 'columns'"
563
- });
564
- var ChartSchema = z2.object({
565
- // Identity
566
- name: z2.string().min(1),
567
- title: z2.string().min(1),
568
- description: z2.string().optional(),
569
- // Metadata
570
- owner: z2.string().optional(),
571
- tags: z2.array(z2.string()).optional(),
572
- created: z2.string().optional(),
573
- updated: z2.string().optional(),
574
- // Data
575
- source: SourceSchema,
576
- parameters: z2.array(ParameterSchema).optional(),
577
- // Visualization
578
- chart: ChartConfigSchema,
579
- // Caching
580
- refresh: RefreshSchema.optional(),
581
- // Drill-down navigation
582
- drillDown: DrillDownConfigSchema.optional()
583
- });
584
-
585
- // ../../packages/schema/dist/project.js
586
- import { z as z4 } from "zod";
587
-
588
- // ../../packages/schema/dist/semantic.js
589
- import { z as z3 } from "zod";
590
- var MeasureTypeSchema = z3.enum(["sum", "count", "avg", "min", "max", "count_distinct"]);
591
- var DimensionTypeSchema = z3.enum(["string", "number", "time", "boolean"]);
592
- var MeasureSchema = z3.object({
593
- name: z3.string(),
594
- type: MeasureTypeSchema,
595
- description: z3.string().optional(),
596
- format: z3.string().optional()
597
- });
598
- var DimensionSchema = z3.object({
599
- name: z3.string(),
600
- type: DimensionTypeSchema,
601
- description: z3.string().optional()
602
- });
603
- var SemanticEntitySchema = z3.object({
604
- name: z3.string(),
605
- description: z3.string().optional(),
606
- source: z3.enum(["catalog", "model"]),
607
- source_table: z3.string(),
608
- measures: z3.array(MeasureSchema),
609
- dimensions: z3.array(DimensionSchema),
610
- parameters: z3.array(z3.object({
611
- name: z3.string(),
612
- type: z3.string(),
613
- default: z3.union([z3.string(), z3.number()]).optional(),
614
- options: z3.array(z3.string()).optional()
615
- })).optional()
616
- });
617
- var RelationshipSchema = z3.object({
618
- from: z3.object({ entity: z3.string(), field: z3.string() }),
619
- to: z3.object({ entity: z3.string(), field: z3.string() }),
620
- type: z3.enum(["many_to_one", "one_to_many", "one_to_one"])
621
- });
622
- var SemanticModelSchema = z3.object({
623
- entities: z3.array(SemanticEntitySchema),
624
- relationships: z3.array(RelationshipSchema),
625
- generated_at: z3.string()
626
- });
627
- var SemanticFilterOperatorSchema = z3.enum([
628
- "equals",
629
- "not_equals",
630
- "contains",
631
- "gt",
632
- "gte",
633
- "lt",
634
- "lte",
635
- "in",
636
- "not_in"
637
- ]);
638
- var SemanticFilterSchema = z3.object({
639
- dimension: z3.string(),
640
- operator: SemanticFilterOperatorSchema,
641
- value: z3.union([z3.string(), z3.number(), z3.boolean(), z3.array(z3.union([z3.string(), z3.number()]))])
642
- });
643
- var SemanticQuerySchema = z3.object({
644
- model: z3.string(),
645
- measures: z3.array(z3.string()).min(1),
646
- dimensions: z3.array(z3.string()).optional().default([]),
647
- parameters: z3.record(z3.union([z3.string(), z3.number()])).optional(),
648
- filters: z3.array(SemanticFilterSchema).optional().default([]),
649
- order_by: z3.object({
650
- field: z3.string(),
651
- direction: z3.enum(["asc", "desc"]).default("asc")
652
- }).optional(),
653
- limit: z3.number().int().positive().max(1e4).optional().default(1e3)
654
- });
655
- var SemanticConfigSchema = z3.object({
656
- include: z3.object({
657
- paths: z3.array(z3.string()).default(["gold/", "marts/", "core/"]),
658
- prefixes: z3.array(z3.string()).default(["dim_", "fct_", "fact_"])
659
- }).optional().default({
660
- paths: ["gold/", "marts/", "core/"],
661
- prefixes: ["dim_", "fct_", "fact_"]
662
- })
663
- }).optional();
664
-
665
- // ../../packages/schema/dist/project.js
666
- var DefaultsSchema = z4.object({
667
- connection: z4.string().optional(),
668
- theme: z4.string().optional(),
669
- timezone: z4.string().optional(),
670
- cache_ttl: z4.string().optional(),
671
- base_url: z4.string().url().optional(),
672
- week_start: z4.enum(["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"]).optional(),
673
- table: z4.object({
674
- max_display_rows: z4.number().int().positive().optional(),
675
- max_export_rows: z4.number().int().positive().optional()
676
- }).optional()
677
- });
678
- var GitSchema = z4.object({
679
- provider: z4.enum(["github", "gitlab", "bitbucket"]).optional(),
680
- repo: z4.string().optional(),
681
- branch: z4.string().optional(),
682
- preview_branches: z4.boolean().optional()
683
- });
684
- var SSOProviderSchema = z4.object({
685
- client_id: z4.string(),
686
- // Provide the secret directly, or name an env var that holds it (client_secret_var)
687
- // so the secret never lives in git.
688
- client_secret: z4.string().optional(),
689
- client_secret_var: z4.string().optional(),
690
- tenant: z4.string().optional(),
691
- issuer: z4.string().optional(),
692
- display_name: z4.string().optional(),
693
- // Invite list: if non-empty, only these emails may sign in via this provider.
694
- // Anyone not listed is rejected instead of auto-provisioned.
695
- allowed_emails: z4.array(z4.string()).optional(),
696
- // Emails provisioned with the admin role (implicitly allowed even if not in allowed_emails).
697
- admin_emails: z4.array(z4.string()).optional()
698
- }).refine((c) => !!c.client_secret || !!c.client_secret_var, {
699
- message: "SSO provider requires either client_secret or client_secret_var"
700
- });
701
- var AuthSchema2 = z4.object({
702
- enabled: z4.boolean(),
703
- db_path: z4.string().optional(),
704
- session_ttl: z4.string().optional(),
705
- providers: z4.object({
706
- google: SSOProviderSchema.optional(),
707
- microsoft: SSOProviderSchema.optional(),
708
- oidc: SSOProviderSchema.optional()
709
- }).optional()
710
- });
711
- var FeaturesSchema = z4.object({
712
- enable_sql_editor: z4.boolean().optional(),
713
- enable_csv_export: z4.boolean().optional(),
714
- enable_scheduling: z4.boolean().optional(),
715
- chat: z4.boolean().optional()
716
- });
717
- var SidebarLinkSchema = z4.object({
718
- label: z4.string(),
719
- url: z4.string(),
720
- icon: z4.string().optional()
721
- });
722
- var SidebarConfigSchema = z4.object({
723
- show: z4.boolean().optional(),
724
- collapsed: z4.boolean().optional(),
725
- links: z4.array(SidebarLinkSchema).optional(),
726
- sections: z4.object({
727
- dashboards: z4.boolean().optional(),
728
- charts: z4.boolean().optional()
729
- }).optional()
730
- });
731
- var ColorsSchema = z4.object({
732
- primary: z4.string().optional(),
733
- background: z4.string().optional(),
734
- surface: z4.string().optional(),
735
- sidebar: z4.string().optional(),
736
- text: z4.string().optional()
737
- });
738
- var FontsSchema = z4.object({
739
- heading: z4.string().optional(),
740
- body: z4.string().optional(),
741
- mono: z4.string().optional(),
742
- size: z4.enum(["compact", "default", "comfortable"]).optional()
743
- });
744
- var LogoSchema = z4.union([
745
- z4.string(),
746
- z4.object({
747
- light: z4.string(),
748
- dark: z4.string()
749
- })
750
- ]);
751
- var ThemeSchema = z4.object({
752
- mode: z4.enum(["light", "dark", "auto"]).optional(),
753
- base: z4.enum(["modern", "executive", "minimal"]).optional(),
754
- logo: LogoSchema.optional(),
755
- favicon: z4.string().optional(),
756
- title: z4.string().optional(),
757
- colors: ColorsSchema.optional(),
758
- palette: z4.array(z4.string()).optional(),
759
- gradient: z4.boolean().default(false),
760
- opacity: z4.number().min(0).max(1).default(1),
761
- fonts: FontsSchema.optional(),
762
- sidebar: SidebarConfigSchema.optional(),
763
- customCss: z4.string().optional()
764
- });
765
- var EnvironmentOverrideSchema = z4.object({
766
- defaults: DefaultsSchema.optional(),
767
- git: GitSchema.optional(),
768
- auth: AuthSchema2.optional(),
769
- features: FeaturesSchema.optional(),
770
- theme: ThemeSchema.optional(),
771
- semantic: SemanticConfigSchema.optional()
772
- }).passthrough();
773
- function deepMerge(base, override) {
774
- if (!override)
775
- return { ...base };
776
- const result = { ...base };
777
- for (const [key, value] of Object.entries(override)) {
778
- if (value !== null && typeof value === "object" && !Array.isArray(value) && typeof result[key] === "object" && result[key] !== null && !Array.isArray(result[key])) {
779
- result[key] = deepMerge(result[key], value);
780
- } else {
781
- result[key] = value;
782
- }
783
- }
784
- return result;
785
- }
786
- function resolveProjectConfig(raw, env) {
787
- const { environments, ...base } = raw;
788
- const envBlocks = environments;
789
- const envOverride = env ? envBlocks?.[env] : void 0;
790
- return deepMerge(base, envOverride);
791
- }
792
- var CatalogIncludeSchema = z4.object({
793
- schemas: z4.array(z4.string()).optional(),
794
- tags: z4.array(z4.string()).optional()
795
- });
796
- var CatalogConfigSchema = z4.object({
797
- include: CatalogIncludeSchema.optional()
798
- });
799
- var KnowledgeConfigSchema = z4.object({
800
- database_url_var: z4.string().default("KNOWLEDGE_DATABASE_URL")
801
- });
802
- var ProviderConfigSchema = z4.object({
803
- provider: z4.enum(["anthropic", "openai", "gemini", "ollama", "ollama_cloud", "openai_compatible"]),
804
- model: z4.string().optional(),
805
- base_url: z4.string().optional(),
806
- api_key_var: z4.string().optional()
807
- });
808
- var AiConfigSchema = z4.object({
809
- default: z4.string().optional(),
810
- providers: z4.record(ProviderConfigSchema).optional(),
811
- tasks: z4.record(z4.string()).optional(),
812
- embedding: ProviderConfigSchema.optional()
813
- }).refine((c) => !c.default || !c.providers || c.default in c.providers, { message: "ai.default must name a provider in ai.providers" }).refine((c) => !c.tasks || !c.providers || Object.values(c.tasks).every((n) => c.providers[n] !== void 0), { message: "every ai.tasks value must name a provider in ai.providers" });
814
- var ProjectSchema = z4.object({
815
- version: z4.string().min(1),
816
- name: z4.string().min(1),
817
- description: z4.string().optional(),
818
- defaults: DefaultsSchema.optional(),
819
- environments: z4.record(z4.string(), EnvironmentOverrideSchema).optional(),
820
- git: GitSchema.optional(),
821
- auth: AuthSchema2.optional(),
822
- features: FeaturesSchema.optional(),
823
- theme: ThemeSchema.optional(),
824
- semantic: SemanticConfigSchema,
825
- catalog: CatalogConfigSchema.optional(),
826
- knowledge: KnowledgeConfigSchema.optional(),
827
- ai: AiConfigSchema.optional()
828
- });
829
-
830
- // ../../packages/schema/dist/model.js
831
- import { z as z5 } from "zod";
832
- var ParamTypeSchema = z5.enum(["string", "number", "date", "boolean", "string[]", "number[]"]);
833
- var ModelParamSchema = z5.object({
834
- name: z5.string().min(1),
835
- type: ParamTypeSchema,
836
- default: z5.string().optional(),
837
- options: z5.array(z5.string()).optional(),
838
- // For enum-like params
839
- description: z5.string().optional()
840
- });
841
- var ReturnColumnSchema = z5.object({
842
- name: z5.string().min(1),
843
- type: z5.string(),
844
- description: z5.string().optional()
845
- });
846
- var ModelMetadataSchema = z5.object({
847
- name: z5.string().min(1),
848
- description: z5.string().optional(),
849
- owner: z5.string().optional(),
850
- tags: z5.array(z5.string()).optional(),
851
- params: z5.array(ModelParamSchema).optional(),
852
- returns: z5.array(ReturnColumnSchema).optional(),
853
- tests: z5.array(z5.string()).optional()
854
- // SQL assertions
855
- });
856
- var ModelSchema = z5.object({
857
- metadata: ModelMetadataSchema,
858
- sql: z5.string().min(1),
859
- filePath: z5.string().optional()
860
- });
861
-
862
- // ../../packages/schema/dist/dashboard.js
863
- import { z as z6 } from "zod";
864
- var ChartWidgetSchema = z6.object({
865
- type: z6.literal("chart"),
866
- ref: z6.string().min(1),
867
- cols: z6.number().min(1).max(12),
868
- height: z6.number().min(38).optional(),
869
- x: z6.number().min(0).max(11).optional(),
870
- y: z6.number().min(0).optional()
871
- });
872
- var TextWidgetSchema = z6.object({
873
- type: z6.literal("text"),
874
- content: z6.string(),
875
- cols: z6.number().min(1).max(12),
876
- height: z6.number().min(38).optional(),
877
- x: z6.number().min(0).max(11).optional(),
878
- y: z6.number().min(0).optional()
879
- });
880
- var WidgetSchema = z6.discriminatedUnion("type", [
881
- ChartWidgetSchema,
882
- TextWidgetSchema
883
- ]);
884
- var RowSchema = z6.object({
885
- height: z6.number().min(38),
886
- widgets: z6.array(WidgetSchema).min(1)
887
- });
888
- var LayoutSchema = z6.object({
889
- gap: z6.number().min(0).default(16),
890
- rows: z6.array(RowSchema).min(1)
891
- });
892
- var TabSchema = z6.object({
893
- name: z6.string().min(1),
894
- label: z6.string().min(1),
895
- filters: z6.array(ParameterSchema).optional(),
896
- layout: LayoutSchema
897
- });
898
- var DashboardSchema = z6.object({
899
- // Identity
900
- name: z6.string().min(1),
901
- title: z6.string().min(1),
902
- description: z6.string().optional(),
903
- // Filters inherited by all widgets (shared across tabs)
904
- filters: z6.array(ParameterSchema).optional(),
905
- // Layout definition (mutually exclusive with tabs)
906
- layout: LayoutSchema.optional(),
907
- // Tabbed layout
908
- tabs: z6.array(TabSchema).min(1).optional()
909
- }).superRefine((data, ctx) => {
910
- if (data.layout && data.tabs) {
911
- ctx.addIssue({
912
- code: z6.ZodIssueCode.custom,
913
- message: 'Dashboard must have either "layout" or "tabs", not both',
914
- path: ["tabs"]
915
- });
916
- }
917
- if (!data.layout && !data.tabs) {
918
- ctx.addIssue({
919
- code: z6.ZodIssueCode.custom,
920
- message: 'Dashboard must have either "layout" or "tabs"',
921
- path: []
922
- });
923
- }
924
- });
925
-
926
- // ../../packages/schema/dist/schedule.js
927
- import { z as z7 } from "zod";
928
- var SlackChannelSchema = z7.object({
929
- webhook_url: z7.string().min(1),
930
- channel: z7.string().optional()
931
- });
932
- var ChannelSchema = z7.object({
933
- slack: SlackChannelSchema
934
- });
935
- var ConditionOperatorSchema = z7.enum(["lt", "gt", "lte", "gte", "eq"]);
936
- var ConditionSchema = z7.object({
937
- field: z7.string().min(1),
938
- operator: ConditionOperatorSchema,
939
- value: z7.number()
940
- });
941
- var ReportScheduleSchema = z7.object({
942
- name: z7.string().min(1),
943
- type: z7.literal("report"),
944
- schedule: z7.string().min(1),
945
- timezone: z7.string().optional(),
946
- channel: ChannelSchema,
947
- charts: z7.array(z7.string().min(1)).min(1),
948
- params: z7.record(z7.unknown()).optional(),
949
- message: z7.string().optional(),
950
- notify_on_error: z7.boolean().optional()
951
- });
952
- var AlertScheduleSchema = z7.object({
953
- name: z7.string().min(1),
954
- type: z7.literal("alert"),
955
- schedule: z7.string().min(1),
956
- timezone: z7.string().optional(),
957
- channel: ChannelSchema,
958
- chart: z7.string().min(1),
959
- params: z7.record(z7.unknown()).optional(),
960
- condition: ConditionSchema,
961
- cooldown: z7.string().optional(),
962
- message: z7.string().optional(),
963
- notify_on_error: z7.boolean().optional()
964
- });
965
- var ScheduleSchema = z7.discriminatedUnion("type", [
966
- ReportScheduleSchema,
967
- AlertScheduleSchema
968
- ]);
969
-
970
- // ../../packages/schema/dist/events.js
971
- import { z as z8 } from "zod";
972
- var EventSchema = z8.object({
973
- date: z8.string(),
974
- endDate: z8.string().optional(),
975
- label: z8.string(),
976
- description: z8.string().optional(),
977
- color: z8.string().optional(),
978
- charts: z8.array(z8.string()).optional()
979
- });
980
- var EventsFileSchema = z8.object({
981
- events: z8.array(EventSchema).default([])
982
- });
983
-
984
- // ../../packages/schema/dist/semantic-curated.js
985
- import { z as z9 } from "zod";
986
- var CuratedMetricSchema = z9.object({
987
- name: z9.string().min(1),
988
- label: z9.string().optional(),
989
- description: z9.string().optional(),
990
- agg: MeasureTypeSchema,
991
- // sum|count|avg|min|max|count_distinct
992
- field: z9.string().optional(),
993
- // column to aggregate
994
- sql: z9.string().optional(),
995
- // raw aggregate expression (derived metric)
996
- filter: z9.string().optional(),
997
- // references a named filter on the entity
998
- synonyms: z9.array(z9.string()).optional(),
999
- format: z9.string().optional(),
1000
- default_time_grain: z9.enum(["day", "week", "month", "quarter", "year"]).optional()
1001
- }).refine((m) => Boolean(m.field) !== Boolean(m.sql), {
1002
- message: "metric must specify exactly one of `field` or `sql`"
1003
- }).refine((m) => !(m.sql && m.filter), {
1004
- message: "a metric with raw `sql` cannot also set `filter` (embed the condition in the sql expression instead)"
1005
- });
1006
- var CuratedDimensionSchema = z9.object({
1007
- name: z9.string().min(1),
1008
- type: DimensionTypeSchema,
1009
- // string|number|time|boolean
1010
- description: z9.string().optional(),
1011
- synonyms: z9.array(z9.string()).optional()
1012
- });
1013
- var NamedFilterSchema = z9.object({
1014
- description: z9.string().optional(),
1015
- sql: z9.string().min(1),
1016
- synonyms: z9.array(z9.string()).optional()
1017
- });
1018
- var CuratedSourceSchema = z9.object({ table: z9.string().optional(), model: z9.string().optional() }).refine((s) => Boolean(s.table) !== Boolean(s.model), {
1019
- message: "source must specify exactly one of `table` or `model`"
1020
- });
1021
- var SemanticDefinitionSchema = z9.object({
1022
- entity: z9.string().min(1),
1023
- description: z9.string().optional(),
1024
- source: CuratedSourceSchema,
1025
- primary_key: z9.string().optional(),
1026
- time_dimension: z9.string().optional(),
1027
- dimensions: z9.array(CuratedDimensionSchema).default([]),
1028
- filters: z9.record(NamedFilterSchema).optional().default({}),
1029
- metrics: z9.array(CuratedMetricSchema).min(1)
1030
- });
1031
-
1032
- // ../../packages/schema/dist/agent.js
1033
- import { z as z10 } from "zod";
1034
- var AgentDefinitionSchema = z10.object({
1035
- name: z10.string(),
1036
- title: z10.string().optional(),
1037
- description: z10.string(),
1038
- system_prompt: z10.string(),
1039
- tools: z10.array(z10.string()).default([]),
1040
- model: z10.string().optional(),
1041
- models: z10.array(z10.string()).optional()
1042
- });
1043
-
1044
- // ../../packages/schema/dist/hunch.js
1045
- import { z as z11 } from "zod";
1046
- var HunchStatusSchema = z11.enum(["pending", "confirmed", "rejected"]);
1047
- var HunchSampleSchema = z11.object({
1048
- columns: z11.array(z11.object({ name: z11.string() })),
1049
- rows: z11.array(z11.record(z11.unknown())),
1050
- ranAt: z11.string()
1051
- });
1052
- var NewHunchSchema = z11.object({
1053
- connection: z11.string(),
1054
- question: z11.string().min(1),
1055
- sql: z11.string().min(1),
1056
- generatedSql: z11.string().min(1),
1057
- tablesUsed: z11.array(z11.string()).default([]),
1058
- rationale: z11.string().optional(),
1059
- confidence: z11.number().min(0).max(1).optional()
1060
- });
1061
- var HunchSchema = NewHunchSchema.extend({
1062
- id: z11.string(),
1063
- status: HunchStatusSchema,
1064
- lastRunSample: HunchSampleSchema.optional(),
1065
- createdAt: z11.string(),
1066
- updatedAt: z11.string()
1067
- });
1068
- var ColumnProfileSchema = z11.object({
1069
- name: z11.string(),
1070
- type: z11.string(),
1071
- nullRate: z11.number().optional(),
1072
- distinctCount: z11.number().optional(),
1073
- min: z11.unknown().optional(),
1074
- max: z11.unknown().optional(),
1075
- topValues: z11.array(z11.object({ value: z11.unknown(), count: z11.number() })).optional()
1076
- });
1077
- var TableProfileSchema = z11.object({
1078
- table: z11.string(),
1079
- rowCount: z11.number().optional(),
1080
- columns: z11.array(ColumnProfileSchema),
1081
- sampleRows: z11.array(z11.record(z11.unknown()))
1082
- });
1083
- var SourceProfileSchema = z11.object({
1084
- connection: z11.string(),
1085
- profiledAt: z11.string(),
1086
- tables: z11.array(TableProfileSchema)
1087
- });
1088
-
1089
- // ../../packages/schema/dist/blindspot.js
1090
- import { z as z12 } from "zod";
1091
- var BlindspotKindSchema = z12.enum(["context", "opportunity"]);
1092
- var BlindspotStatusSchema = z12.enum(["open", "answered", "dismissed"]);
1093
- var SuggestedModelSchema = z12.object({
1094
- name: z12.string().min(1),
1095
- description: z12.string(),
1096
- rationale: z12.string(),
1097
- columns: z12.array(z12.object({ name: z12.string(), description: z12.string().optional() }))
1098
- });
1099
- var NewBlindspotSchema = z12.object({
1100
- connection: z12.string(),
1101
- kind: BlindspotKindSchema,
1102
- title: z12.string().min(1),
1103
- detail: z12.string().min(1),
1104
- subject: z12.string().optional(),
1105
- suggestedModel: SuggestedModelSchema.optional(),
1106
- confidence: z12.number().min(0).max(1).optional()
1107
- }).refine((b) => b.kind !== "opportunity" || b.suggestedModel !== void 0, {
1108
- message: "opportunity blindspots must include a suggestedModel"
1109
- });
1110
- var BlindspotSchema = z12.object({
1111
- id: z12.string(),
1112
- connection: z12.string(),
1113
- kind: BlindspotKindSchema,
1114
- title: z12.string(),
1115
- detail: z12.string(),
1116
- subject: z12.string().optional(),
1117
- suggestedModel: SuggestedModelSchema.optional(),
1118
- confidence: z12.number().optional(),
1119
- status: BlindspotStatusSchema,
1120
- answer: z12.string().optional(),
1121
- createdAt: z12.string(),
1122
- updatedAt: z12.string()
1123
- });
1124
-
1125
- // ../../packages/schema/dist/knowledge-doc.js
1126
- import { z as z13 } from "zod";
1127
- var NewKnowledgeDocSchema = z13.object({
1128
- connection: z13.string(),
1129
- title: z13.string().min(1),
1130
- content: z13.string().min(1),
1131
- source: z13.enum(["ui", "file"]).default("ui")
1132
- });
1133
- var KnowledgeDocSchema = NewKnowledgeDocSchema.extend({
1134
- id: z13.string(),
1135
- createdAt: z13.string(),
1136
- updatedAt: z13.string()
1137
- });
1138
-
1139
- // ../../packages/schema/dist/index.js
1140
- var VERSION = "0.1.0";
1141
-
1142
- export {
1143
- ConnectionSchema,
1144
- ParameterSchema,
1145
- ChartSchema,
1146
- MeasureTypeSchema,
1147
- DimensionTypeSchema,
1148
- MeasureSchema,
1149
- DimensionSchema,
1150
- SemanticEntitySchema,
1151
- RelationshipSchema,
1152
- SemanticModelSchema,
1153
- SemanticFilterOperatorSchema,
1154
- SemanticFilterSchema,
1155
- SemanticQuerySchema,
1156
- SemanticConfigSchema,
1157
- deepMerge,
1158
- resolveProjectConfig,
1159
- ProviderConfigSchema,
1160
- AiConfigSchema,
1161
- ProjectSchema,
1162
- ModelMetadataSchema,
1163
- ModelSchema,
1164
- DashboardSchema,
1165
- ScheduleSchema,
1166
- EventSchema,
1167
- EventsFileSchema,
1168
- CuratedMetricSchema,
1169
- CuratedDimensionSchema,
1170
- NamedFilterSchema,
1171
- CuratedSourceSchema,
1172
- SemanticDefinitionSchema,
1173
- AgentDefinitionSchema,
1174
- HunchStatusSchema,
1175
- HunchSampleSchema,
1176
- NewHunchSchema,
1177
- HunchSchema,
1178
- ColumnProfileSchema,
1179
- TableProfileSchema,
1180
- SourceProfileSchema,
1181
- BlindspotKindSchema,
1182
- BlindspotStatusSchema,
1183
- SuggestedModelSchema,
1184
- NewBlindspotSchema,
1185
- BlindspotSchema,
1186
- NewKnowledgeDocSchema,
1187
- KnowledgeDocSchema,
1188
- VERSION
1189
- };
1190
- //# sourceMappingURL=chunk-ZIY22VO7.js.map