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