drizzle-cube 0.7.1 → 0.8.1

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 (363) hide show
  1. package/dist/adapters/ActivityGridChart.config-DXUUgx0N.cjs +1 -0
  2. package/dist/adapters/ActivityGridChart.config-Dyozu3VW.js +2 -0
  3. package/dist/adapters/AreaChart.config-Di5odBXp.cjs +1 -0
  4. package/dist/adapters/AreaChart.config-KEaXP_4K.js +2 -0
  5. package/dist/adapters/BarChart.config-B-hBHykR.cjs +1 -0
  6. package/dist/adapters/BarChart.config-C5sqbn0A.js +2 -0
  7. package/dist/adapters/BoxPlotChart.config-B1R4Br7L.js +2 -0
  8. package/dist/adapters/BoxPlotChart.config-C82Fhd3c.cjs +1 -0
  9. package/dist/adapters/BubbleChart.config-CoBxmmfp.js +2 -0
  10. package/dist/adapters/BubbleChart.config-DfOnNjL-.cjs +1 -0
  11. package/dist/adapters/CandlestickChart.config-C5ggV_3j.cjs +1 -0
  12. package/dist/adapters/CandlestickChart.config-ZaJpWVuL.js +2 -0
  13. package/dist/adapters/DataTable.config-Cx2_ACdY.cjs +1 -0
  14. package/dist/adapters/DataTable.config-DkAgD-iz.js +2 -0
  15. package/dist/adapters/FunnelChart.config-CvzcECUB.js +2 -0
  16. package/dist/adapters/FunnelChart.config-DVH7IFnb.cjs +1 -0
  17. package/dist/adapters/GaugeChart.config-Csx8rt8o.cjs +1 -0
  18. package/dist/adapters/GaugeChart.config-DEmrNgMa.js +2 -0
  19. package/dist/adapters/HeatMapChart.config-BfD_dpP7.js +2 -0
  20. package/dist/adapters/HeatMapChart.config-D_jlyPJL.cjs +1 -0
  21. package/dist/adapters/KpiDelta.config-CVBdUL_n.cjs +1 -0
  22. package/dist/adapters/KpiDelta.config-D4dCXOxl.js +2 -0
  23. package/dist/adapters/KpiNumber.config-BK5pgIKz.cjs +1 -0
  24. package/dist/adapters/KpiNumber.config-D6XqjZrm.js +2 -0
  25. package/dist/adapters/KpiText.config-ChphMwG5.js +2 -0
  26. package/dist/adapters/KpiText.config-fO1wc6FH.cjs +1 -0
  27. package/dist/adapters/LineChart.config-CXJrgz1s.js +2 -0
  28. package/dist/adapters/LineChart.config-Cg_h-SiJ.cjs +1 -0
  29. package/dist/adapters/MarkdownChart.config-ByPjX-4O.cjs +1 -0
  30. package/dist/adapters/MarkdownChart.config-Df2yY9AT.js +2 -0
  31. package/dist/adapters/MeasureProfileChart.config-BBWGIteF.cjs +1 -0
  32. package/dist/adapters/MeasureProfileChart.config-C9OFbN9Z.js +2 -0
  33. package/dist/adapters/PieChart.config-C6jJj6xm.js +2 -0
  34. package/dist/adapters/PieChart.config-CmCw_8eN.cjs +1 -0
  35. package/dist/adapters/ProportionBarChart.config-B9NEyFEe.js +2 -0
  36. package/dist/adapters/ProportionBarChart.config-C3GAVPWn.cjs +1 -0
  37. package/dist/adapters/RadarChart.config-5AMwEqUJ.cjs +1 -0
  38. package/dist/adapters/RadarChart.config-Ct_b7IM5.js +2 -0
  39. package/dist/adapters/RadialBarChart.config-Bp-Sl0cm.js +2 -0
  40. package/dist/adapters/RadialBarChart.config-D14yoexI.cjs +1 -0
  41. package/dist/adapters/RecordsTable.config-D2-qmG06.cjs +1 -0
  42. package/dist/adapters/RecordsTable.config-DIwoqZCU.js +2 -0
  43. package/dist/adapters/RetentionCombinedChart.config-BWHipi5M.cjs +1 -0
  44. package/dist/adapters/RetentionCombinedChart.config-D40UgTcl.js +2 -0
  45. package/dist/adapters/RetentionHeatmap.config-GlnSLrjn.js +2 -0
  46. package/dist/adapters/RetentionHeatmap.config-MlhZf26c.cjs +1 -0
  47. package/dist/adapters/SankeyChart.config-Bf1_NHiv.js +2 -0
  48. package/dist/adapters/SankeyChart.config-BoYf6BFE.cjs +1 -0
  49. package/dist/adapters/ScatterChart.config-CV2rdGJp.js +2 -0
  50. package/dist/adapters/ScatterChart.config-DywduGF3.cjs +1 -0
  51. package/dist/adapters/SunburstChart.config-CrqiE1UZ.js +2 -0
  52. package/dist/adapters/SunburstChart.config-D5tbF_GJ.cjs +1 -0
  53. package/dist/adapters/TreeMapChart.config-BJ8HnZU0.cjs +1 -0
  54. package/dist/adapters/TreeMapChart.config-DxgIqIIj.js +2 -0
  55. package/dist/adapters/WaterfallChart.config-Cns8fLFu.js +2 -0
  56. package/dist/adapters/WaterfallChart.config-D_kdL9SN.cjs +1 -0
  57. package/dist/adapters/compiler-BxZHh0UD.cjs +166 -0
  58. package/dist/adapters/{compiler-DiYxWAKg.js → compiler-CBGD_4Et.js} +1389 -1923
  59. package/dist/adapters/core/http-port.d.ts +34 -7
  60. package/dist/adapters/core/index.cjs +1 -1
  61. package/dist/adapters/core/index.d.ts +1 -0
  62. package/dist/adapters/core/index.js +2 -2
  63. package/dist/adapters/core/rest-handlers.d.ts +1 -1
  64. package/dist/adapters/core-CIGuwGuI.cjs +1 -0
  65. package/dist/adapters/{core-BOPRmxPc.js → core-DAAnqPyN.js} +81 -65
  66. package/dist/adapters/express/index.cjs +2 -2
  67. package/dist/adapters/express/index.d.ts +11 -2
  68. package/dist/adapters/express/index.js +14 -14
  69. package/dist/adapters/fastify/index.cjs +2 -2
  70. package/dist/adapters/fastify/index.d.ts +11 -2
  71. package/dist/adapters/fastify/index.js +29 -29
  72. package/dist/{server/google-eKAc20al.js → adapters/google-DRY7jnOh.js} +46 -28
  73. package/dist/adapters/{google-BhvizbFR.cjs → google-PsZzwedr.cjs} +2 -2
  74. package/dist/adapters/handler-BcYTw6zB.cjs +25 -0
  75. package/dist/adapters/{handler-DGud-C-w.js → handler-eA0VJDHj.js} +363 -266
  76. package/dist/adapters/hono/index.cjs +1 -1
  77. package/dist/adapters/hono/index.js +9 -9
  78. package/dist/adapters/mcp-tools-handlers.d.ts +10 -3
  79. package/dist/adapters/mcp-tools.cjs +1 -1
  80. package/dist/adapters/mcp-tools.js +18 -20
  81. package/dist/adapters/mcp-transport-BpG44Fvn.js +730 -0
  82. package/dist/adapters/mcp-transport-CDxZXpc-.cjs +42 -0
  83. package/dist/adapters/mcp-transport.d.ts +13 -2
  84. package/dist/adapters/nextjs/index.cjs +1 -1
  85. package/dist/adapters/nextjs/index.d.ts +5 -2
  86. package/dist/adapters/nextjs/index.js +32 -32
  87. package/dist/adapters/{openai-Crp3X_zg.js → openai-BZ48ioYp.js} +1 -1
  88. package/dist/adapters/{openai-CmdN7Sj1.cjs → openai-Bw1j-OiP.cjs} +1 -1
  89. package/dist/adapters/{openai-Dwt9bxOE.cjs → openai-CLjyL5_J.cjs} +2 -2
  90. package/dist/adapters/{openai-CGJM6Qun.js → openai-CYYjUG_3.js} +4 -4
  91. package/dist/adapters/{utils-DboNUT3A.js → utils-BagURNRb.js} +1963 -1135
  92. package/dist/adapters/utils-BiKIg2tk.cjs +128 -0
  93. package/dist/adapters/utils.cjs +1 -1
  94. package/dist/adapters/utils.d.ts +19 -5
  95. package/dist/adapters/utils.js +1 -1
  96. package/dist/cjs/adapters/core/http-port.d.ts +34 -7
  97. package/dist/cjs/adapters/core/index.d.ts +1 -0
  98. package/dist/cjs/adapters/core/rest-handlers.d.ts +1 -1
  99. package/dist/cjs/adapters/express/index.d.ts +11 -2
  100. package/dist/cjs/adapters/fastify/index.d.ts +11 -2
  101. package/dist/cjs/adapters/mcp-tools-handlers.d.ts +10 -3
  102. package/dist/cjs/adapters/mcp-transport.d.ts +13 -2
  103. package/dist/cjs/adapters/nextjs/index.d.ts +5 -2
  104. package/dist/cjs/adapters/utils.d.ts +19 -5
  105. package/dist/cjs/client/charts/chartConfigRegistry.d.ts +7 -0
  106. package/dist/cjs/client/charts/chartConfigs.d.ts +17 -1
  107. package/dist/cjs/client/client/CubeClient.d.ts +11 -1
  108. package/dist/cjs/client/components/AnalysisBuilder/AnalysisDisplayConfigPanel.d.ts +4 -2
  109. package/dist/cjs/client/components/AnalysisBuilder/ColumnFormatsEditor.d.ts +10 -0
  110. package/dist/cjs/client/components/AnalysisBuilder/DisplayOptionControl.d.ts +3 -2
  111. package/dist/cjs/client/components/AnalysisBuilder/utils/queryUtils.d.ts +7 -1
  112. package/dist/cjs/client/components/analyticsPortlet/PortletChart.d.ts +2 -1
  113. package/dist/cjs/client/components/analyticsPortlet/PortletChartView.d.ts +4 -1
  114. package/dist/cjs/client/components/analyticsPortlet/usePortletDeadMembers.d.ts +24 -0
  115. package/dist/cjs/client/components/analyticsPortlet/usePortletPagination.d.ts +21 -0
  116. package/dist/cjs/client/components/charts/RecordsTable.config.d.ts +10 -0
  117. package/dist/cjs/client/components/charts/RecordsTable.d.ts +4 -0
  118. package/dist/cjs/client/components/charts/recordsTableHooks.d.ts +68 -0
  119. package/dist/cjs/client/icons/types.d.ts +1 -0
  120. package/dist/cjs/client/index.d.ts +2 -2
  121. package/dist/cjs/client/types.d.ts +92 -1
  122. package/dist/cjs/client/utils/recordsTableUtils.d.ts +71 -0
  123. package/dist/cjs/client/utils/rowLinkUtils.d.ts +35 -0
  124. package/dist/cjs/server/adapters/base-adapter.d.ts +46 -0
  125. package/dist/cjs/server/adapters/databend-adapter.d.ts +5 -0
  126. package/dist/cjs/server/adapters/duckdb-adapter.d.ts +5 -0
  127. package/dist/cjs/server/adapters/mysql-adapter.d.ts +14 -0
  128. package/dist/cjs/server/adapters/postgres-adapter.d.ts +15 -0
  129. package/dist/cjs/server/adapters/snowflake-adapter.d.ts +6 -0
  130. package/dist/cjs/server/adapters/sqlite-adapter.d.ts +21 -0
  131. package/dist/cjs/server/agent/chart-validation.d.ts +1 -1
  132. package/dist/cjs/server/ai/chart-schema.d.ts +117 -0
  133. package/dist/cjs/server/ai/discovery-helpers.d.ts +14 -0
  134. package/dist/cjs/server/ai/discovery.d.ts +6 -0
  135. package/dist/cjs/server/ai/query-schema.d.ts +1 -1
  136. package/dist/cjs/server/attribute-dimensions.d.ts +102 -0
  137. package/dist/cjs/server/builders/group-by-builder.d.ts +15 -0
  138. package/dist/cjs/server/cache-utils.d.ts +5 -1
  139. package/dist/cjs/server/compiler-metadata.d.ts +24 -3
  140. package/dist/cjs/server/compiler.d.ts +159 -13
  141. package/dist/cjs/server/execution/query-result-cache.d.ts +1 -1
  142. package/dist/cjs/server/executor.d.ts +15 -0
  143. package/dist/cjs/server/index.d.ts +13 -3
  144. package/dist/cjs/server/query-handlers.d.ts +2 -1
  145. package/dist/cjs/server/query-validator.d.ts +36 -4
  146. package/dist/cjs/server/types/core.d.ts +13 -0
  147. package/dist/cjs/server/types/cube.d.ts +39 -2
  148. package/dist/cjs/server/types/query.d.ts +8 -0
  149. package/dist/cli/index.cjs +130 -52
  150. package/dist/client/charts/chartConfigRegistry.d.ts +7 -0
  151. package/dist/client/charts/chartConfigs.d.ts +17 -1
  152. package/dist/client/charts.js +13 -13
  153. package/dist/client/chunks/{DashboardEditModal-BOfLdTgV.js → DashboardEditModal-_ZDMwaGX.js} +1653 -1188
  154. package/dist/client/chunks/DashboardEditModal-_ZDMwaGX.js.map +1 -0
  155. package/dist/client/chunks/{ProportionBarChart-DwoXU5VP.js → ProportionBarChart-qfpAWhIg.js} +3 -3
  156. package/dist/client/chunks/{ProportionBarChart-DwoXU5VP.js.map → ProportionBarChart-qfpAWhIg.js.map} +1 -1
  157. package/dist/client/chunks/RecordsTable-KmJy94xN.js +556 -0
  158. package/dist/client/chunks/RecordsTable-KmJy94xN.js.map +1 -0
  159. package/dist/client/chunks/{RetentionCombinedChart-BqlSV7yF.js → RetentionCombinedChart-C7X6aj97.js} +3 -3
  160. package/dist/client/chunks/{RetentionCombinedChart-BqlSV7yF.js.map → RetentionCombinedChart-C7X6aj97.js.map} +1 -1
  161. package/dist/client/chunks/{RetentionHeatmap-VdVkBg8Q.js → RetentionHeatmap-PpRpiqR_.js} +2 -2
  162. package/dist/client/chunks/{RetentionHeatmap-VdVkBg8Q.js.map → RetentionHeatmap-PpRpiqR_.js.map} +1 -1
  163. package/dist/client/chunks/{analysis-builder-DXw60SEs.js → analysis-builder-DaqyOjLX.js} +169 -168
  164. package/dist/client/chunks/{analysis-builder-DXw60SEs.js.map → analysis-builder-DaqyOjLX.js.map} +1 -1
  165. package/dist/client/chunks/{analysis-builder-shared-CEvHIlmk.js → analysis-builder-shared-ow9KAHDP.js} +965 -954
  166. package/dist/client/chunks/analysis-builder-shared-ow9KAHDP.js.map +1 -0
  167. package/dist/client/chunks/{chart-activity-grid-4jfS8khG.js → chart-activity-grid-DO82rrbW.js} +140 -84
  168. package/dist/client/chunks/chart-activity-grid-DO82rrbW.js.map +1 -0
  169. package/dist/client/chunks/{chart-area-Dol6s9no.js → chart-area-9SBeG0GM.js} +21 -21
  170. package/dist/client/chunks/{chart-area-Dol6s9no.js.map → chart-area-9SBeG0GM.js.map} +1 -1
  171. package/dist/client/chunks/{chart-bar-5_niozi2.js → chart-bar-tfgmLK2D.js} +5 -5
  172. package/dist/client/chunks/{chart-bar-5_niozi2.js.map → chart-bar-tfgmLK2D.js.map} +1 -1
  173. package/dist/client/chunks/{chart-box-plot-Dhp-VwhD.js → chart-box-plot-BuYW6j6g.js} +2 -2
  174. package/dist/client/chunks/{chart-box-plot-Dhp-VwhD.js.map → chart-box-plot-BuYW6j6g.js.map} +1 -1
  175. package/dist/client/chunks/{chart-bubble-BM2BAMSo.js → chart-bubble-BNmonWqW.js} +2 -2
  176. package/dist/client/chunks/{chart-bubble-BM2BAMSo.js.map → chart-bubble-BNmonWqW.js.map} +1 -1
  177. package/dist/client/chunks/{chart-candlestick-BNwLIBfm.js → chart-candlestick-BYeWNkKl.js} +2 -2
  178. package/dist/client/chunks/{chart-candlestick-BNwLIBfm.js.map → chart-candlestick-BYeWNkKl.js.map} +1 -1
  179. package/dist/client/chunks/{chart-data-table-DoDHQRe7.js → chart-data-table-C_oHiK6N.js} +1094 -1029
  180. package/dist/client/chunks/chart-data-table-C_oHiK6N.js.map +1 -0
  181. package/dist/client/chunks/{chart-funnel-Cd7da_sa.js → chart-funnel-B_CWC3cL.js} +2 -2
  182. package/dist/client/chunks/{chart-funnel-Cd7da_sa.js.map → chart-funnel-B_CWC3cL.js.map} +1 -1
  183. package/dist/client/chunks/{chart-gauge-DOpul-Oz.js → chart-gauge-D7VxwPnx.js} +3 -3
  184. package/dist/client/chunks/{chart-gauge-DOpul-Oz.js.map → chart-gauge-D7VxwPnx.js.map} +1 -1
  185. package/dist/client/chunks/{chart-heat-map-CeKbK655.js → chart-heat-map-q7Vf_dog.js} +3 -3
  186. package/dist/client/chunks/{chart-heat-map-CeKbK655.js.map → chart-heat-map-q7Vf_dog.js.map} +1 -1
  187. package/dist/client/chunks/{chart-kpi-delta-Dq8qUOOT.js → chart-kpi-delta-PEuA3iGs.js} +3 -3
  188. package/dist/client/chunks/{chart-kpi-delta-Dq8qUOOT.js.map → chart-kpi-delta-PEuA3iGs.js.map} +1 -1
  189. package/dist/client/chunks/{chart-kpi-number-DgiqTi9g.js → chart-kpi-number-DlxrO6Pq.js} +5 -5
  190. package/dist/client/chunks/{chart-kpi-number-DgiqTi9g.js.map → chart-kpi-number-DlxrO6Pq.js.map} +1 -1
  191. package/dist/client/chunks/{chart-kpi-text-CsZMVEnM.js → chart-kpi-text-Cx6cJu2s.js} +3 -3
  192. package/dist/client/chunks/{chart-kpi-text-CsZMVEnM.js.map → chart-kpi-text-Cx6cJu2s.js.map} +1 -1
  193. package/dist/client/chunks/{chart-line-DlwOB7C7.js → chart-line-pDe25JzB.js} +3 -3
  194. package/dist/client/chunks/{chart-line-DlwOB7C7.js.map → chart-line-pDe25JzB.js.map} +1 -1
  195. package/dist/client/chunks/{chart-markdown-DPE34SjC.js → chart-markdown-CRY15yp0.js} +2 -2
  196. package/dist/client/chunks/{chart-markdown-DPE34SjC.js.map → chart-markdown-CRY15yp0.js.map} +1 -1
  197. package/dist/client/chunks/{chart-measure-profile-BpTz1fce.js → chart-measure-profile-DyQ-vvuC.js} +3 -3
  198. package/dist/client/chunks/{chart-measure-profile-BpTz1fce.js.map → chart-measure-profile-DyQ-vvuC.js.map} +1 -1
  199. package/dist/client/chunks/{chart-pie-FGw66XAH.js → chart-pie-ZrnBycy1.js} +15 -15
  200. package/dist/client/chunks/{chart-pie-FGw66XAH.js.map → chart-pie-ZrnBycy1.js.map} +1 -1
  201. package/dist/client/chunks/{chart-radar-D-eRDoiA.js → chart-radar-BXbnYMUJ.js} +13 -13
  202. package/dist/client/chunks/{chart-radar-D-eRDoiA.js.map → chart-radar-BXbnYMUJ.js.map} +1 -1
  203. package/dist/client/chunks/{chart-radial-bar-DgtkNTs3.js → chart-radial-bar-CYxH3ryh.js} +3 -3
  204. package/dist/client/chunks/{chart-radial-bar-DgtkNTs3.js.map → chart-radial-bar-CYxH3ryh.js.map} +1 -1
  205. package/dist/client/chunks/{chart-sankey-D0hhb_EQ.js → chart-sankey-C9R_TDDh.js} +2 -2
  206. package/dist/client/chunks/{chart-sankey-D0hhb_EQ.js.map → chart-sankey-C9R_TDDh.js.map} +1 -1
  207. package/dist/client/chunks/{chart-scatter-D9EcAiMQ.js → chart-scatter-DrwRkzzl.js} +3 -3
  208. package/dist/client/chunks/{chart-scatter-D9EcAiMQ.js.map → chart-scatter-DrwRkzzl.js.map} +1 -1
  209. package/dist/client/chunks/{chart-sunburst-DCYmJ5DU.js → chart-sunburst-Bs1yqIPp.js} +3 -3
  210. package/dist/client/chunks/{chart-sunburst-DCYmJ5DU.js.map → chart-sunburst-Bs1yqIPp.js.map} +1 -1
  211. package/dist/client/chunks/{chart-tree-map-D_ACSSiB.js → chart-tree-map-BNjHhhVq.js} +3 -3
  212. package/dist/client/chunks/{chart-tree-map-D_ACSSiB.js.map → chart-tree-map-BNjHhhVq.js.map} +1 -1
  213. package/dist/client/chunks/{chart-waterfall-CVUVNa1R.js → chart-waterfall-CyoC0uLT.js} +3 -3
  214. package/dist/client/chunks/{chart-waterfall-CVUVNa1R.js.map → chart-waterfall-CyoC0uLT.js.map} +1 -1
  215. package/dist/client/chunks/charts-core-DCQ7od_L.js +190 -0
  216. package/dist/client/chunks/charts-core-DCQ7od_L.js.map +1 -0
  217. package/dist/client/chunks/charts-loader-Bya_zDIA.js +86 -0
  218. package/dist/client/chunks/charts-loader-Bya_zDIA.js.map +1 -0
  219. package/dist/client/chunks/{en-US-BE6VoG0o.js → en-US-HP6FHuNy.js} +3 -1
  220. package/dist/client/chunks/{en-US-BE6VoG0o.js.map → en-US-HP6FHuNy.js.map} +1 -1
  221. package/dist/client/chunks/{exceljs.min-DWC_b8G9.js → exceljs.min-CiByP8VQ.js} +2 -3
  222. package/dist/client/chunks/{exceljs.min-DWC_b8G9.js.map → exceljs.min-CiByP8VQ.js.map} +1 -1
  223. package/dist/client/chunks/{nl-NL-DFLVORiD.js → nl-NL-CEdoCz6Q.js} +54 -1
  224. package/dist/client/chunks/nl-NL-CEdoCz6Q.js.map +1 -0
  225. package/dist/client/chunks/{schema-visualization-C6g_LCiA.js → schema-visualization-DfXxFBIY.js} +3 -3
  226. package/dist/client/chunks/{schema-visualization-C6g_LCiA.js.map → schema-visualization-DfXxFBIY.js.map} +1 -1
  227. package/dist/client/chunks/{useDirtyStateTracking-ZfChDEd3.js → useDirtyStateTracking-BFJHiiVK.js} +15 -15
  228. package/dist/client/chunks/{useDirtyStateTracking-ZfChDEd3.js.map → useDirtyStateTracking-BFJHiiVK.js.map} +1 -1
  229. package/dist/client/chunks/{useExplainAI-im9e1rVb.js → useExplainAI-_C4WQE5I.js} +16 -16
  230. package/dist/client/chunks/{useExplainAI-im9e1rVb.js.map → useExplainAI-_C4WQE5I.js.map} +1 -1
  231. package/dist/client/chunks/{vendor-Qa1s8oSX.js → vendor-Gb3lH0cc.js} +49 -49
  232. package/dist/client/chunks/vendor-Gb3lH0cc.js.map +1 -0
  233. package/dist/client/client/CubeClient.d.ts +11 -1
  234. package/dist/client/components/AnalysisBuilder/AnalysisDisplayConfigPanel.d.ts +4 -2
  235. package/dist/client/components/AnalysisBuilder/ColumnFormatsEditor.d.ts +10 -0
  236. package/dist/client/components/AnalysisBuilder/DisplayOptionControl.d.ts +3 -2
  237. package/dist/client/components/AnalysisBuilder/utils/queryUtils.d.ts +7 -1
  238. package/dist/client/components/analyticsPortlet/PortletChart.d.ts +2 -1
  239. package/dist/client/components/analyticsPortlet/PortletChartView.d.ts +4 -1
  240. package/dist/client/components/analyticsPortlet/usePortletDeadMembers.d.ts +24 -0
  241. package/dist/client/components/analyticsPortlet/usePortletPagination.d.ts +21 -0
  242. package/dist/client/components/charts/RecordsTable.config.d.ts +10 -0
  243. package/dist/client/components/charts/RecordsTable.d.ts +4 -0
  244. package/dist/client/components/charts/recordsTableHooks.d.ts +68 -0
  245. package/dist/client/components.js +1 -1
  246. package/dist/client/hooks.js +3 -3
  247. package/dist/client/icons/types.d.ts +1 -0
  248. package/dist/client/icons.js +2 -2
  249. package/dist/client/index.d.ts +2 -2
  250. package/dist/client/index.js +213 -213
  251. package/dist/client/providers.js +1 -1
  252. package/dist/client/schema.js +1 -1
  253. package/dist/client/styles.css +1 -1
  254. package/dist/client/types.d.ts +92 -1
  255. package/dist/client/utils/recordsTableUtils.d.ts +71 -0
  256. package/dist/client/utils/rowLinkUtils.d.ts +35 -0
  257. package/dist/client/utils.js +14 -14
  258. package/dist/client-bundle-stats.html +1 -1
  259. package/dist/mcp-app/mcp-app.html +109 -109
  260. package/dist/server/adapters/base-adapter.d.ts +46 -0
  261. package/dist/server/adapters/databend-adapter.d.ts +5 -0
  262. package/dist/server/adapters/duckdb-adapter.d.ts +5 -0
  263. package/dist/server/adapters/mysql-adapter.d.ts +14 -0
  264. package/dist/server/adapters/postgres-adapter.d.ts +15 -0
  265. package/dist/server/adapters/snowflake-adapter.d.ts +6 -0
  266. package/dist/server/adapters/sqlite-adapter.d.ts +21 -0
  267. package/dist/server/agent/chart-validation.d.ts +1 -1
  268. package/dist/server/ai/chart-schema.d.ts +117 -0
  269. package/dist/server/ai/discovery-helpers.d.ts +14 -0
  270. package/dist/server/ai/discovery.d.ts +6 -0
  271. package/dist/server/ai/query-schema.d.ts +1 -1
  272. package/dist/server/attribute-dimensions.d.ts +102 -0
  273. package/dist/server/builders/group-by-builder.d.ts +15 -0
  274. package/dist/server/cache-utils.d.ts +5 -1
  275. package/dist/server/compiler-metadata.d.ts +24 -3
  276. package/dist/server/compiler.d.ts +159 -13
  277. package/dist/server/execution/query-result-cache.d.ts +1 -1
  278. package/dist/server/executor.d.ts +15 -0
  279. package/dist/{adapters/google-eKAc20al.js → server/google-DRY7jnOh.js} +46 -28
  280. package/dist/server/{google-BhvizbFR.cjs → google-PsZzwedr.cjs} +2 -2
  281. package/dist/server/index.cjs +42 -38
  282. package/dist/server/index.d.ts +13 -3
  283. package/dist/server/index.js +2079 -1573
  284. package/dist/server/{openai-Czk1BdHa.js → openai-6uUf7h-5.js} +1 -1
  285. package/dist/server/{openai-DBwI1OSu.cjs → openai-BBe1XbZd.cjs} +1 -1
  286. package/dist/server/{openai-Cu4TXXjl.cjs → openai-BmADmD1e.cjs} +1 -1
  287. package/dist/server/{openai-CUf4vc3Q.js → openai-C1gLuR-0.js} +1 -1
  288. package/dist/server/query-handlers.d.ts +2 -1
  289. package/dist/server/query-validator.d.ts +36 -4
  290. package/dist/server/types/core.d.ts +13 -0
  291. package/dist/server/types/cube.d.ts +39 -2
  292. package/dist/server/types/query.d.ts +8 -0
  293. package/package.json +2 -2
  294. package/dist/adapters/ActivityGridChart.config-D6hhj345.cjs +0 -1
  295. package/dist/adapters/ActivityGridChart.config-QZKs_NYg.js +0 -2
  296. package/dist/adapters/AreaChart.config-B5XM6G22.js +0 -2
  297. package/dist/adapters/AreaChart.config-NP34BH5y.cjs +0 -1
  298. package/dist/adapters/BarChart.config-Bqlmr81N.js +0 -2
  299. package/dist/adapters/BarChart.config-C3bw-cAP.cjs +0 -1
  300. package/dist/adapters/BoxPlotChart.config-BOAvoj6x.cjs +0 -1
  301. package/dist/adapters/BoxPlotChart.config-CTXiycYY.js +0 -2
  302. package/dist/adapters/BubbleChart.config-CGFIkl4H.cjs +0 -1
  303. package/dist/adapters/BubbleChart.config-Njxx4Eq1.js +0 -2
  304. package/dist/adapters/CandlestickChart.config-BZ_yWaSo.cjs +0 -1
  305. package/dist/adapters/CandlestickChart.config-D4Svhmef.js +0 -2
  306. package/dist/adapters/DataTable.config-B-bT9puT.js +0 -2
  307. package/dist/adapters/DataTable.config-BHtt1cPM.cjs +0 -1
  308. package/dist/adapters/FunnelChart.config-C1e07O7B.cjs +0 -1
  309. package/dist/adapters/FunnelChart.config-CVEy0tV9.js +0 -2
  310. package/dist/adapters/GaugeChart.config-5PLNlQlu.js +0 -2
  311. package/dist/adapters/GaugeChart.config-Cdv6knjZ.cjs +0 -1
  312. package/dist/adapters/HeatMapChart.config-MGTfYpWJ.js +0 -2
  313. package/dist/adapters/HeatMapChart.config-jfBEi1ZI.cjs +0 -1
  314. package/dist/adapters/KpiDelta.config-D2IUsEYz.cjs +0 -1
  315. package/dist/adapters/KpiDelta.config-DT_MmAHw.js +0 -2
  316. package/dist/adapters/KpiNumber.config-ChgbKmx8.cjs +0 -1
  317. package/dist/adapters/KpiNumber.config-CvZ_FhyL.js +0 -2
  318. package/dist/adapters/KpiText.config-Bgkw8gr2.js +0 -2
  319. package/dist/adapters/KpiText.config-Bz9orqt6.cjs +0 -1
  320. package/dist/adapters/LineChart.config-BVew35dI.cjs +0 -1
  321. package/dist/adapters/LineChart.config-DSCCKXNg.js +0 -2
  322. package/dist/adapters/MarkdownChart.config-Bu6XUuhI.js +0 -2
  323. package/dist/adapters/MarkdownChart.config-E4aSVTf3.cjs +0 -1
  324. package/dist/adapters/MeasureProfileChart.config-BF249hc_.cjs +0 -1
  325. package/dist/adapters/MeasureProfileChart.config-lERVe38G.js +0 -2
  326. package/dist/adapters/PieChart.config-7Ujwp8R5.cjs +0 -1
  327. package/dist/adapters/PieChart.config-jQl2HIcA.js +0 -2
  328. package/dist/adapters/ProportionBarChart.config-o0w_Pnlt.js +0 -2
  329. package/dist/adapters/ProportionBarChart.config-phNohhhY.cjs +0 -1
  330. package/dist/adapters/RadarChart.config-BmrYBd9x.js +0 -2
  331. package/dist/adapters/RadarChart.config-Dlt3UflG.cjs +0 -1
  332. package/dist/adapters/RadialBarChart.config-CeEm8xRb.cjs +0 -1
  333. package/dist/adapters/RadialBarChart.config-Dishh6bC.js +0 -2
  334. package/dist/adapters/RetentionCombinedChart.config-BaD4ev85.cjs +0 -1
  335. package/dist/adapters/RetentionCombinedChart.config-m2FjBUi9.js +0 -2
  336. package/dist/adapters/RetentionHeatmap.config-DiMplGdk.js +0 -2
  337. package/dist/adapters/RetentionHeatmap.config-Dp6oYwQZ.cjs +0 -1
  338. package/dist/adapters/SankeyChart.config-C4Y6qzCS.cjs +0 -1
  339. package/dist/adapters/SankeyChart.config-CJHqgjQ1.js +0 -2
  340. package/dist/adapters/ScatterChart.config-C0QqvDrN.cjs +0 -1
  341. package/dist/adapters/ScatterChart.config-DywOsWPW.js +0 -2
  342. package/dist/adapters/SunburstChart.config-DE8RxpDR.cjs +0 -1
  343. package/dist/adapters/SunburstChart.config-DohowrO3.js +0 -2
  344. package/dist/adapters/TreeMapChart.config-D2gXz-zC.cjs +0 -1
  345. package/dist/adapters/TreeMapChart.config-HMlI29GG.js +0 -2
  346. package/dist/adapters/WaterfallChart.config-BO2WV2VB.js +0 -2
  347. package/dist/adapters/WaterfallChart.config-CzwGiheB.cjs +0 -1
  348. package/dist/adapters/compiler-BNjqYdmc.cjs +0 -166
  349. package/dist/adapters/core-CzFfrJzu.cjs +0 -1
  350. package/dist/adapters/handler-m6WgA9xu.cjs +0 -25
  351. package/dist/adapters/mcp-transport-B0b27YUB.cjs +0 -40
  352. package/dist/adapters/mcp-transport-BXyA4dTk.js +0 -603
  353. package/dist/adapters/utils-BoOeig94.cjs +0 -128
  354. package/dist/client/chunks/DashboardEditModal-BOfLdTgV.js.map +0 -1
  355. package/dist/client/chunks/analysis-builder-shared-CEvHIlmk.js.map +0 -1
  356. package/dist/client/chunks/chart-activity-grid-4jfS8khG.js.map +0 -1
  357. package/dist/client/chunks/chart-data-table-DoDHQRe7.js.map +0 -1
  358. package/dist/client/chunks/charts-core-BPD_hLaL.js +0 -215
  359. package/dist/client/chunks/charts-core-BPD_hLaL.js.map +0 -1
  360. package/dist/client/chunks/charts-loader-CwMcOfwT.js +0 -85
  361. package/dist/client/chunks/charts-loader-CwMcOfwT.js.map +0 -1
  362. package/dist/client/chunks/nl-NL-DFLVORiD.js.map +0 -1
  363. package/dist/client/chunks/vendor-Qa1s8oSX.js.map +0 -1
@@ -70,7 +70,7 @@ var r = class {
70
70
  try {
71
71
  let t = await import(
72
72
  /* webpackIgnore: true */
73
- "./openai-CUf4vc3Q.js"
73
+ "./openai-C1gLuR-0.js"
74
74
  );
75
75
  e = t.default || t.OpenAI || t;
76
76
  } catch {
@@ -1 +1 @@
1
- function*e(e,t){let n=e.index??0;if(e.id&&(t.set(n,{id:e.id,name:e.function?.name||``,arguments:``}),yield{type:`tool_use_start`,id:e.id,name:e.function?.name||``}),e.function?.name&&t.has(n)){let r=t.get(n);r.name||=e.function.name}if(e.function?.arguments){let r=t.get(n);r&&(r.arguments+=e.function.arguments,yield{type:`tool_input_delta`,json:e.function.arguments})}}function*t(e,t){for(let[e,n]of t){let r={};try{n.arguments&&(r=JSON.parse(n.arguments))}catch{}yield{type:`tool_use_end`,id:n.id,input:r},t.delete(e)}yield{type:`message_meta`,stopReason:e}}function*n(n,r){n.usage&&(yield{type:`message_meta`,inputTokens:n.usage.prompt_tokens,outputTokens:n.usage.completion_tokens,stopReason:``});let i=n.choices?.[0];if(!i)return;let a=i.delta;if(a){if(a.content&&(yield{type:`text_delta`,text:a.content}),a.tool_calls)for(let t of a.tool_calls)yield*e(t,r);i.finish_reason&&(yield*t(i.finish_reason,r))}}var r=class{client;apiKey;baseURL;initialized=!1;constructor(e,t){this.apiKey=e,this.baseURL=t?.baseURL}async ensureClient(){if(this.initialized)return;let e;try{let t=await Promise.resolve().then(()=>require("./openai-Cu4TXXjl.cjs"));e=t.default||t.OpenAI||t}catch{throw Error(`openai is required for the OpenAI provider. Install it with: npm install openai`)}let t={apiKey:this.apiKey};this.baseURL&&(t.baseURL=this.baseURL),this.client=new e(t),this.initialized=!0}async createStream(e){await this.ensureClient();let{messages:t}=this.formatMessages(e.messages,e.system);return this.client.chat.completions.create({model:e.model,max_completion_tokens:e.maxTokens,tools:this.formatTools(e.tools),messages:t,stream:!0,stream_options:{include_usage:!0}})}async*parseStreamEvents(e){let t=new Map;for await(let r of e)yield*n(r,t)}formatTools(e){return e.map(e=>({type:`function`,function:{name:e.name,description:e.description,parameters:e.parameters}}))}formatMessages(e,t){let n=[{role:`system`,content:t}];for(let t of e)if(t.role===`user`)n.push({role:`user`,content:typeof t.content==`string`?t.content:JSON.stringify(t.content)});else if(t.role===`assistant`){if(typeof t.content==`string`)n.push({role:`assistant`,content:t.content});else{let e=t.content,r=e.filter(e=>e.type===`text`).map(e=>e.text).join(``),i=e.filter(e=>e.type===`tool_use`).map(e=>({id:e.id,type:`function`,function:{name:e.name,arguments:JSON.stringify(e.input||{})}})),a={role:`assistant`};r&&(a.content=r),i.length>0&&(a.tool_calls=i),n.push(a)}}else t.role===`tool`?n.push(t):t.role===`tool_result`&&n.push({role:`user`,content:typeof t.content==`string`?t.content:JSON.stringify(t.content)});return{messages:n}}formatToolResults(e){return e.map(e=>({role:`tool`,tool_call_id:e.toolUseId,content:e.content}))}shouldContinue(e){return e===`tool_calls`}formatError(e){if(!e||!(e instanceof Error))return`Something went wrong. Please try again.`;let t=e.message||``,n=e;return n.status===429?`Too many requests. Please wait a moment and try again.`:n.status===401?`Authentication failed. Please check your API key configuration.`:n.status===503||n.status===502?`The AI service is temporarily unavailable. Please try again in a moment.`:n.status===400?`There was a problem with the request. Please try again.`:t.startsWith(`{`)||t.startsWith(`Error: {`)?`The AI service encountered an error. Please try again.`:t}};exports.OpenAIProvider=r;
1
+ function*e(e,t){let n=e.index??0;if(e.id&&(t.set(n,{id:e.id,name:e.function?.name||``,arguments:``}),yield{type:`tool_use_start`,id:e.id,name:e.function?.name||``}),e.function?.name&&t.has(n)){let r=t.get(n);r.name||=e.function.name}if(e.function?.arguments){let r=t.get(n);r&&(r.arguments+=e.function.arguments,yield{type:`tool_input_delta`,json:e.function.arguments})}}function*t(e,t){for(let[e,n]of t){let r={};try{n.arguments&&(r=JSON.parse(n.arguments))}catch{}yield{type:`tool_use_end`,id:n.id,input:r},t.delete(e)}yield{type:`message_meta`,stopReason:e}}function*n(n,r){n.usage&&(yield{type:`message_meta`,inputTokens:n.usage.prompt_tokens,outputTokens:n.usage.completion_tokens,stopReason:``});let i=n.choices?.[0];if(!i)return;let a=i.delta;if(a){if(a.content&&(yield{type:`text_delta`,text:a.content}),a.tool_calls)for(let t of a.tool_calls)yield*e(t,r);i.finish_reason&&(yield*t(i.finish_reason,r))}}var r=class{client;apiKey;baseURL;initialized=!1;constructor(e,t){this.apiKey=e,this.baseURL=t?.baseURL}async ensureClient(){if(this.initialized)return;let e;try{let t=await Promise.resolve().then(()=>require("./openai-BmADmD1e.cjs"));e=t.default||t.OpenAI||t}catch{throw Error(`openai is required for the OpenAI provider. Install it with: npm install openai`)}let t={apiKey:this.apiKey};this.baseURL&&(t.baseURL=this.baseURL),this.client=new e(t),this.initialized=!0}async createStream(e){await this.ensureClient();let{messages:t}=this.formatMessages(e.messages,e.system);return this.client.chat.completions.create({model:e.model,max_completion_tokens:e.maxTokens,tools:this.formatTools(e.tools),messages:t,stream:!0,stream_options:{include_usage:!0}})}async*parseStreamEvents(e){let t=new Map;for await(let r of e)yield*n(r,t)}formatTools(e){return e.map(e=>({type:`function`,function:{name:e.name,description:e.description,parameters:e.parameters}}))}formatMessages(e,t){let n=[{role:`system`,content:t}];for(let t of e)if(t.role===`user`)n.push({role:`user`,content:typeof t.content==`string`?t.content:JSON.stringify(t.content)});else if(t.role===`assistant`){if(typeof t.content==`string`)n.push({role:`assistant`,content:t.content});else{let e=t.content,r=e.filter(e=>e.type===`text`).map(e=>e.text).join(``),i=e.filter(e=>e.type===`tool_use`).map(e=>({id:e.id,type:`function`,function:{name:e.name,arguments:JSON.stringify(e.input||{})}})),a={role:`assistant`};r&&(a.content=r),i.length>0&&(a.tool_calls=i),n.push(a)}}else t.role===`tool`?n.push(t):t.role===`tool_result`&&n.push({role:`user`,content:typeof t.content==`string`?t.content:JSON.stringify(t.content)});return{messages:n}}formatToolResults(e){return e.map(e=>({role:`tool`,tool_call_id:e.toolUseId,content:e.content}))}shouldContinue(e){return e===`tool_calls`}formatError(e){if(!e||!(e instanceof Error))return`Something went wrong. Please try again.`;let t=e.message||``,n=e;return n.status===429?`Too many requests. Please wait a moment and try again.`:n.status===401?`Authentication failed. Please check your API key configuration.`:n.status===503||n.status===502?`The AI service is temporarily unavailable. Please try again in a moment.`:n.status===400?`There was a problem with the request. Please try again.`:t.startsWith(`{`)||t.startsWith(`Error: {`)?`The AI service encountered an error. Please try again.`:t}};exports.OpenAIProvider=r;
@@ -1,4 +1,4 @@
1
- const e=require("./rolldown-runtime-DF3sbh8G.cjs");function t(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n}function n(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)}var r=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return r=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),n=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return`10000000-1000-4000-8000-100000000000`.replace(/[018]/g,e=>(e^n()&15>>e/4).toString(16))};function i(e){return typeof e==`object`&&!!e&&(`name`in e&&e.name===`AbortError`||`message`in e&&String(e.message).includes(`FetchRequestCanceledException`))}var a=e=>{if(e instanceof Error)return e;if(typeof e==`object`&&e){try{if(Object.prototype.toString.call(e)===`[object Error]`){let t=Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(t.stack=e.stack),e.cause&&!t.cause&&(t.cause=e.cause),e.name&&(t.name=e.name),t}}catch{}try{return Error(JSON.stringify(e))}catch{}}return Error(e)},o=class extends Error{},s=class e extends o{constructor(t,n,r,i){super(`${e.makeMessage(t,n,r)}`),this.status=t,this.headers=i,this.requestID=i?.get(`x-request-id`),this.error=n;let a=n;this.code=a?.code,this.param=a?.param,this.type=a?.type}static makeMessage(e,t,n){let r=t?.message?typeof t.message==`string`?t.message:JSON.stringify(t.message):t?JSON.stringify(t):n;return e&&r?`${e} ${r}`:e?`${e} status code (no body)`:r||`(no status code or body)`}static generate(t,n,r,i){if(!t||!i)return new l({message:r,cause:a(n)});let o=n?.error;return t===400?new d(t,o,r,i):t===401?new f(t,o,r,i):t===403?new p(t,o,r,i):t===404?new m(t,o,r,i):t===409?new h(t,o,r,i):t===422?new g(t,o,r,i):t===429?new _(t,o,r,i):t>=500?new v(t,o,r,i):new e(t,o,r,i)}},c=class extends s{constructor({message:e}={}){super(void 0,void 0,e||`Request was aborted.`,void 0)}},l=class extends s{constructor({message:e,cause:t}){super(void 0,void 0,e||`Connection error.`,void 0),t&&(this.cause=t)}},u=class extends l{constructor({message:e}={}){super({message:e??`Request timed out.`})}},d=class extends s{},f=class extends s{},p=class extends s{},m=class extends s{},h=class extends s{},g=class extends s{},_=class extends s{},v=class extends s{},y=class extends o{constructor(){super(`Could not parse response content as the length limit was reached`)}},b=class extends o{constructor(){super(`Could not parse response content as the request was rejected by the content filter`)}},x=class extends Error{constructor(e){super(e)}},S=class extends s{constructor(e,t,n){let r=`OAuth2 authentication error`,i;if(t&&typeof t==`object`){let e=t;i=e.error;let n=e.error_description;n&&typeof n==`string`?r=n:i&&(r=i)}super(e,t,r,n),this.error_code=i}},C=class extends o{constructor(e,t,n){super(e),this.provider=t,this.cause=n}},w=/^[a-z][a-z0-9+.-]*:/i,ee=e=>w.test(e),T=e=>(T=Array.isArray,T(e)),te=T;function ne(e){return typeof e==`object`?e??{}:{}}function re(e){if(!e)return!0;for(let t in e)return!1;return!0}function E(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ie(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var ae=(e,t)=>{if(typeof t!=`number`||!Number.isInteger(t))throw new o(`${e} must be an integer`);if(t<0)throw new o(`${e} must be a positive integer`);return t},oe=e=>{try{return JSON.parse(e)}catch{return}},se=e=>new Promise(t=>setTimeout(t,e));function ce(){if(typeof fetch<`u`)return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function le(...e){let t=globalThis.ReadableStream;if(t===void 0)throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function ue(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return le({start(){},async pull(e){let{done:n,value:r}=await t.next();n?e.close():e.enqueue(r)},async cancel(){await t.return?.()}})}function de(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let e=await t.read();return e?.done&&t.releaseLock(),e}catch(e){throw t.releaseLock(),e}},async return(){let e=t.cancel();return t.releaseLock(),await e,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function fe(e){if(typeof e!=`object`||!e)return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}let t=e.getReader(),n=t.cancel();t.releaseLock(),await n}var pe;function me(e){let t;return(pe??=(t=new globalThis.TextEncoder,t.encode.bind(t)))(e)}var he;function ge(e){let t;return(he??=(t=new globalThis.TextDecoder,t.decode.bind(t)))(e)}var _e,D,O,k,ve,ye,be,xe=65536,Se=class{constructor(){_e.add(this),D.set(this,void 0),O.set(this,void 0),k.set(this,void 0),ve.set(this,void 0),ye.set(this,void 0),t(this,D,new Uint8Array,`f`),t(this,O,0,`f`),t(this,k,0,`f`),t(this,ve,0,`f`),t(this,ye,!1,`f`)}decode(e){if(e==null)return[];let r;if(r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e==`string`?me(e):e,r.length===0||n(this,ye,`f`)&&(t(this,ye,!1,`f`),r[0]===10&&(r=r.subarray(1)),r.length===0))return[];n(this,_e,`m`,be).call(this,r);let i=[],a;for(;(a=Ce(n(this,D,`f`),n(this,ve,`f`),n(this,k,`f`)))!=null;){let e=ge(n(this,D,`f`).subarray(n(this,O,`f`),a.preceding));i.push(e),t(this,O,a.index,`f`),a.carriage&&(n(this,O,`f`)<n(this,k,`f`)&&n(this,D,`f`)[n(this,O,`f`)]===10?t(this,O,n(this,O,`f`)+1,`f`):n(this,O,`f`)===n(this,k,`f`)&&t(this,ye,!0,`f`)),t(this,ve,n(this,O,`f`),`f`)}if(t(this,ve,n(this,k,`f`),`f`),n(this,O,`f`)===n(this,k,`f`))t(this,O,0,`f`),t(this,k,0,`f`),t(this,ve,0,`f`),n(this,D,`f`).length>xe&&t(this,D,new Uint8Array,`f`);else if(i.length>0&&n(this,D,`f`).length>xe){let e=n(this,k,`f`)-n(this,O,`f`);if(e<=xe||n(this,D,`f`).length>e*4){let r=e<=xe?Math.min(Math.max(e*2,256),xe):e*2,i=new Uint8Array(r);i.set(n(this,D,`f`).subarray(n(this,O,`f`),n(this,k,`f`))),t(this,D,i,`f`),t(this,O,0,`f`),t(this,k,e,`f`),t(this,ve,e,`f`)}}return i}flush(){return t(this,ye,!1,`f`),n(this,O,`f`)===n(this,k,`f`)?[]:this.decode(`
1
+ const e=require("./rolldown-runtime-DF3sbh8G.cjs");function t(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n}function n(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)}var r=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return r=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),n=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return`10000000-1000-4000-8000-100000000000`.replace(/[018]/g,e=>(+e^n()&15>>e/4).toString(16))};function i(e){return typeof e==`object`&&!!e&&(`name`in e&&e.name===`AbortError`||`message`in e&&String(e.message).includes(`FetchRequestCanceledException`))}var a=e=>{if(e instanceof Error)return e;if(typeof e==`object`&&e){try{if(Object.prototype.toString.call(e)===`[object Error]`){let t=Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(t.stack=e.stack),e.cause&&!t.cause&&(t.cause=e.cause),e.name&&(t.name=e.name),t}}catch{}try{return Error(JSON.stringify(e))}catch{}}return Error(e)},o=class extends Error{},s=class e extends o{constructor(t,n,r,i){super(`${e.makeMessage(t,n,r)}`),this.status=t,this.headers=i,this.requestID=i?.get(`x-request-id`),this.error=n;let a=n;this.code=a?.code,this.param=a?.param,this.type=a?.type}static makeMessage(e,t,n){let r=t?.message?typeof t.message==`string`?t.message:JSON.stringify(t.message):t?JSON.stringify(t):n;return e&&r?`${e} ${r}`:e?`${e} status code (no body)`:r||`(no status code or body)`}static generate(t,n,r,i){if(!t||!i)return new l({message:r,cause:a(n)});let o=n?.error;return t===400?new d(t,o,r,i):t===401?new f(t,o,r,i):t===403?new p(t,o,r,i):t===404?new m(t,o,r,i):t===409?new h(t,o,r,i):t===422?new g(t,o,r,i):t===429?new _(t,o,r,i):t>=500?new v(t,o,r,i):new e(t,o,r,i)}},c=class extends s{constructor({message:e}={}){super(void 0,void 0,e||`Request was aborted.`,void 0)}},l=class extends s{constructor({message:e,cause:t}){super(void 0,void 0,e||`Connection error.`,void 0),t&&(this.cause=t)}},u=class extends l{constructor({message:e}={}){super({message:e??`Request timed out.`})}},d=class extends s{},f=class extends s{},p=class extends s{},m=class extends s{},h=class extends s{},g=class extends s{},_=class extends s{},v=class extends s{},y=class extends o{constructor(){super(`Could not parse response content as the length limit was reached`)}},b=class extends o{constructor(){super(`Could not parse response content as the request was rejected by the content filter`)}},x=class extends Error{constructor(e){super(e)}},S=class extends s{constructor(e,t,n){let r=`OAuth2 authentication error`,i;if(t&&typeof t==`object`){let e=t;i=e.error;let n=e.error_description;n&&typeof n==`string`?r=n:i&&(r=i)}super(e,t,r,n),this.error_code=i}},C=class extends o{constructor(e,t,n){super(e),this.provider=t,this.cause=n}},w=/^[a-z][a-z0-9+.-]*:/i,ee=e=>w.test(e),T=e=>(T=Array.isArray,T(e)),te=T;function ne(e){return typeof e==`object`?e??{}:{}}function re(e){if(!e)return!0;for(let t in e)return!1;return!0}function E(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ie(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var ae=(e,t)=>{if(typeof t!=`number`||!Number.isInteger(t))throw new o(`${e} must be an integer`);if(t<0)throw new o(`${e} must be a positive integer`);return t},oe=e=>{try{return JSON.parse(e)}catch{return}},se=e=>new Promise(t=>setTimeout(t,e));function ce(){if(typeof fetch<`u`)return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function le(...e){let t=globalThis.ReadableStream;if(t===void 0)throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function ue(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return le({start(){},async pull(e){let{done:n,value:r}=await t.next();n?e.close():e.enqueue(r)},async cancel(){await t.return?.()}})}function de(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let e=await t.read();return e?.done&&t.releaseLock(),e}catch(e){throw t.releaseLock(),e}},async return(){let e=t.cancel();return t.releaseLock(),await e,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function fe(e){if(typeof e!=`object`||!e)return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}let t=e.getReader(),n=t.cancel();t.releaseLock(),await n}var pe;function me(e){let t;return(pe??=(t=new globalThis.TextEncoder,t.encode.bind(t)))(e)}var he;function ge(e){let t;return(he??=(t=new globalThis.TextDecoder,t.decode.bind(t)))(e)}var _e,D,O,k,ve,ye,be,xe=65536,Se=class{constructor(){_e.add(this),D.set(this,void 0),O.set(this,void 0),k.set(this,void 0),ve.set(this,void 0),ye.set(this,void 0),t(this,D,new Uint8Array,`f`),t(this,O,0,`f`),t(this,k,0,`f`),t(this,ve,0,`f`),t(this,ye,!1,`f`)}decode(e){if(e==null)return[];let r;if(r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e==`string`?me(e):e,r.length===0||n(this,ye,`f`)&&(t(this,ye,!1,`f`),r[0]===10&&(r=r.subarray(1)),r.length===0))return[];n(this,_e,`m`,be).call(this,r);let i=[],a;for(;(a=Ce(n(this,D,`f`),n(this,ve,`f`),n(this,k,`f`)))!=null;){let e=ge(n(this,D,`f`).subarray(n(this,O,`f`),a.preceding));i.push(e),t(this,O,a.index,`f`),a.carriage&&(n(this,O,`f`)<n(this,k,`f`)&&n(this,D,`f`)[n(this,O,`f`)]===10?t(this,O,n(this,O,`f`)+1,`f`):n(this,O,`f`)===n(this,k,`f`)&&t(this,ye,!0,`f`)),t(this,ve,n(this,O,`f`),`f`)}if(t(this,ve,n(this,k,`f`),`f`),n(this,O,`f`)===n(this,k,`f`))t(this,O,0,`f`),t(this,k,0,`f`),t(this,ve,0,`f`),n(this,D,`f`).length>xe&&t(this,D,new Uint8Array,`f`);else if(i.length>0&&n(this,D,`f`).length>xe){let e=n(this,k,`f`)-n(this,O,`f`);if(e<=xe||n(this,D,`f`).length>e*4){let r=e<=xe?Math.min(Math.max(e*2,256),xe):e*2,i=new Uint8Array(r);i.set(n(this,D,`f`).subarray(n(this,O,`f`),n(this,k,`f`))),t(this,D,i,`f`),t(this,O,0,`f`),t(this,k,e,`f`),t(this,ve,e,`f`)}}return i}flush(){return t(this,ye,!1,`f`),n(this,O,`f`)===n(this,k,`f`)?[]:this.decode(`
2
2
  `)}};D=new WeakMap,O=new WeakMap,k=new WeakMap,ve=new WeakMap,ye=new WeakMap,_e=new WeakSet,be=function(e){if(n(this,k,`f`)+e.length>n(this,D,`f`).length){let r=n(this,k,`f`)-n(this,O,`f`);if(n(this,O,`f`)>=n(this,D,`f`).length/2&&r+e.length<=n(this,D,`f`).length)n(this,D,`f`).copyWithin(0,n(this,O,`f`),n(this,k,`f`));else{let i=Math.max(n(this,D,`f`).length*2,r+e.length,256),a=new Uint8Array(i);a.set(n(this,D,`f`).subarray(n(this,O,`f`),n(this,k,`f`))),t(this,D,a,`f`)}t(this,ve,n(this,ve,`f`)-n(this,O,`f`),`f`),t(this,k,r,`f`),t(this,O,0,`f`)}n(this,D,`f`).set(e,n(this,k,`f`)),t(this,k,n(this,k,`f`)+e.length,`f`)},Se.NEWLINE_CHARS=new Set([`
3
3
  `,`\r`]),Se.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function Ce(e,t,n){for(let r=t;r<n;r++){if(e[r]===10)return{preceding:r,index:r+1,carriage:!1};if(e[r]===13)return{preceding:r,index:r+1,carriage:!0}}return null}function we(e){for(let t=0;t<e.length-1;t++){let n=Te(e,t);if(n>0){let r=t+n,i=Te(e,r);if(i>0)return r+i}}return-1}function Te(e,t){return e[t]===10?1:e[t]===13?e[t+1]===10?2:1:0}var Ee={off:0,error:200,warn:300,info:400,debug:500},De=(e,t,n)=>{if(e){if(E(Ee,e))return e;A(n).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(Ee))}`)}};function Oe(){}function ke(e,t,n){return!t||Ee[e]>Ee[n]?Oe:t[e].bind(t)}var Ae={error:Oe,warn:Oe,info:Oe,debug:Oe},je=new WeakMap;function A(e){let t=e.logger,n=e.logLevel??`off`;if(!t)return Ae;let r=je.get(t);if(r&&r[0]===n)return r[1];let i={error:ke(`error`,t,n),warn:ke(`warn`,t,n),info:ke(`info`,t,n),debug:ke(`debug`,t,n)};return je.set(t,[n,i]),i}var Me=new Set([`apikey`,`accesstoken`,`refreshtoken`,`sessiontoken`,`sessionid`,`idtoken`,`authtoken`,`authorization`,`token`,`password`,`clientsecret`,`xamzsecuritytoken`,`xamzsignature`,`xamzcredential`]);function Ne(e){let t=e.toLowerCase().replace(/[-_]/gu,``);return Me.has(t)||Me.has(t.replace(/^x/u,``))}var Pe=new Set([`authorization`,`proxy-authorization`,`api-key`,`x-api-key`,`x-amz-security-token`,`cookie`,`set-cookie`,`x-session-token`,`x-session-id`,`x-auth-token`,`x-id-token`]);function Fe(e){return Pe.has(e.toLowerCase().replace(/_/gu,`-`))||Ne(e)}function Ie(e){let t=new URL(e);t.username=``,t.password=``,t.hash=``;for(let e of t.searchParams.keys())Ne(e)&&t.searchParams.set(e,`***`);return t.href}var Le=e=>{if(e.options){if(e.options={...e.options},delete e.options.headers,e.options.path){let t=e.options.path,n=new URL(Ie(new URL(t,`https://redacted.invalid`).href));e.options.path=n.origin===`https://redacted.invalid`?`${t.startsWith(`/`)?`/`:``}${n.pathname.slice(1)}${n.search}`:n.href}e.options.query&&(e.options.query=Object.fromEntries(Object.entries(e.options.query).map(([e,t])=>[e,Ne(e)?`***`:t])))}return e.url&&=Ie(e.url),e.headers&&=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([e,t])=>[e,Fe(e)?`***`:t])),`retryOfRequestLogID`in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e},Re;function ze(){let e=[],t=0;return{get length(){return e.length-t},enqueue(t){e.push(t)},dequeue(){if(t===e.length)return;let n=e[t];return e[t]=void 0,t+=1,t===e.length?(e=[],t=0):t>=1024&&t*2>=e.length&&(e=e.slice(t),t=0),n}}}var Be=class e{constructor(e,n,r){Re.set(this,void 0),this.iterator=e,this.controller=n,t(this,Re,r,`f`)}static fromSSEResponse(t,n,r,a){let c=!1,l=r?A(r):console;async function*u(){if(c)throw new o("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");c=!0;let e=!1,r=!1;try{for await(let e of He(t,n)){if(e.data===`[DONE]`){r=!0;break}if(e.event===null||!e.event.startsWith(`thread.`)){let n;try{n=JSON.parse(e.data)}catch{throw l.error(`Could not parse message into JSON:`),l.error(`From chunk:`),SyntaxError(`Error reading response: malformed server-sent event JSON.`)}if(e.event===`error`)throw new s(void 0,n?.error??n,void 0,t.headers);if(n&&n.error)throw new s(void 0,n.error,void 0,t.headers);yield a?{event:e.event,data:n}:n}else{let t;try{t=JSON.parse(e.data)}catch{throw l.error(`Could not parse message into JSON:`),l.error(`From chunk:`),SyntaxError(`Error reading response: malformed server-sent event JSON.`)}yield{event:e.event,data:t}}}e=!0}catch(e){if(r||i(e)||n.signal.aborted&&e===n.signal.reason)return;throw e}finally{e||n.abort()}}return new e(u,n,r)}static fromReadableStream(t,n,r){let a=!1;async function*s(){let e=new Se,r=t.getReader(),i=!1,a,o=()=>{a??=r.cancel(),a.catch(()=>void 0)};n.signal.addEventListener(`abort`,o,{once:!0});try{if(n.signal.aborted){o();return}for(;;){let{value:t,done:a}=await r.read();if(a){i=!0;break}if(n.signal.aborted)return;for(let r of e.decode(t)){if(n.signal.aborted)return;yield r}}if(n.signal.aborted)return;for(let t of e.flush()){if(n.signal.aborted)return;yield t}}finally{n.signal.removeEventListener(`abort`,o),i||o(),r.releaseLock()}}async function*c(){if(a)throw new o("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");a=!0;let e=!1;try{for await(let t of s())if(!e&&t){let e;try{e=JSON.parse(t)}catch(e){throw e instanceof SyntaxError?SyntaxError(`Error reading response: malformed newline-delimited JSON.`):e}yield e}e=!0}catch(e){if(n.signal.aborted||i(e))return;throw e}finally{e||n.abort()}}return new e(c,n,r)}[(Re=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let t=ze(),r=ze(),i=this.iterator(),a=e=>({next:()=>{if(e.length===0){let e=i.next();t.enqueue(e),r.enqueue(e)}return e.dequeue()}});return[new e(()=>a(t),this.controller,n(this,Re,`f`)),new e(()=>a(r),this.controller,n(this,Re,`f`))]}toReadableStream(){let e;return le({start:async()=>{e=this[Symbol.asyncIterator]()},async pull(t){try{let{value:n,done:r}=await e.next();if(r)return t.close();let i=me(JSON.stringify(n)+`
4
4
  `);t.enqueue(i)}catch(e){t.error(e)}},async cancel(){await e.return?.()}})}};function Ve(e,t){let n=typeof e.getReader==`function`?e.getReader():void 0,r=n?{next:()=>n.read(),return:()=>n.cancel()}:de(e)[Symbol.asyncIterator](),a={value:void 0,done:!0},o=!1,s=!1,c,l,u=()=>new Promise(e=>{l=e}),d=()=>{if(s||o)return c;s=!0;try{c=Promise.resolve(r.return?.())}catch(e){c=Promise.reject(e)}return c.catch(()=>void 0),c},f=()=>{queueMicrotask(()=>{l?.(),d()})};return{iterator:{async next(){if(t.aborted)return a;let e=u().then(()=>a);try{let n=await Promise.race([r.next(),e]);return t.aborted?a:n.done?(o=!0,a):{value:n.value,done:!1}}catch(e){if(t.aborted&&(i(e)||e===t.reason))return a;throw e}finally{l=void 0}},async return(){let e=d();if(e&&!t.aborted){let n=u();try{t.aborted||await Promise.race([e,n])}finally{l=void 0}}return a},[Symbol.asyncIterator](){return this}},start(){t.addEventListener(`abort`,f,{once:!0}),t.aborted&&f()},async cleanup(e){let r;try{t.removeEventListener(`abort`,f)}catch(e){r=e}if(!o){let n=d();if(n&&!e&&!t.aborted)try{await n}catch(e){r??=e}}if(n)try{n.releaseLock()}catch(e){r??=e}if(r!==void 0&&!e&&!t.aborted)throw r}}}async function*He(e,t){if(!e.body)throw t.abort(),globalThis.navigator!==void 0&&globalThis.navigator.product===`ReactNative`?new o(`The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api`):new o(`Attempted to iterate over a response with no body`);let n=new Ge,r=new Se,{signal:a}=t,s=Ve(e.body,a),c=!1;try{s.start();for await(let e of We(s.iterator)){if(a.aborted)return;for(let t of r.decode(e)){if(a.aborted)return;let e=n.decode(t);e&&(yield e)}}if(a.aborted)return;for(let e of r.flush()){if(a.aborted)return;let t=n.decode(e);t&&(yield t)}}catch(e){if(c=!0,!a.aborted||!i(e)&&e!==a.reason)throw e}finally{await s.cleanup(c)}}var Ue=3;async function*We(e){let t=new Uint8Array,n=0,r=0,i=0;for await(let a of e){if(a==null)continue;let e;if(e=a instanceof ArrayBuffer?new Uint8Array(a):typeof a==`string`?me(a):a,r+e.length>t.length){let a=r-n;if(n>=t.length/2&&a+e.length<=t.length)t.copyWithin(0,n,r);else{let i=new Uint8Array(Math.max(t.length*2,a+e.length));i.set(t.subarray(n,r)),t=i}i-=n,n=0,r=a}t.set(e,r),r+=e.length;let o;for(;(o=we(t.subarray(i,r)))!==-1;)o+=i,yield t.slice(n,o),n=o,i=n;i=Math.max(n,r-Ue)}r>n&&(yield t.slice(n,r))}var Ge=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith(`\r`)&&(e=e.slice(0,-1)),!e){if(!this.event&&!this.data.length)return null;let e={event:this.event,data:this.data.join(`
@@ -17,7 +17,7 @@ var a = function() {
17
17
  let { crypto: e } = globalThis;
18
18
  if (e?.randomUUID) return a = e.randomUUID.bind(e), e.randomUUID();
19
19
  let t = /* @__PURE__ */ new Uint8Array(1), n = e ? () => e.getRandomValues(t)[0] : () => Math.random() * 255 & 255;
20
- return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (e) => (e ^ n() & 15 >> e / 4).toString(16));
20
+ return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (e) => (+e ^ n() & 15 >> e / 4).toString(16));
21
21
  };
22
22
  //#endregion
23
23
  //#region node_modules/openai/internal/errors.mjs
@@ -56,7 +56,7 @@ export interface DiscoverResponse {
56
56
  * Always returns `queryLanguageReference` and `dateFilteringGuide` alongside
57
57
  * the matched cubes. See `DiscoverResponse` for the rationale.
58
58
  */
59
- export declare function handleDiscover(semanticLayer: SemanticLayerCompiler, body: DiscoverRequest): Promise<DiscoverResponse>;
59
+ export declare function handleDiscover(semanticLayer: SemanticLayerCompiler, securityContext: SecurityContext, body: DiscoverRequest): Promise<DiscoverResponse>;
60
60
  /**
61
61
  * Normalize AI-generated query fields before validation/execution.
62
62
  * Fixes common LLM mistakes:
@@ -76,4 +76,5 @@ export declare function handleLoad(semanticLayer: SemanticLayerCompiler, securit
76
76
  data: Record<string, unknown>[];
77
77
  annotation: any;
78
78
  query: SemanticQuery;
79
+ total?: number;
79
80
  }>;
@@ -1,9 +1,41 @@
1
1
  import { SemanticQuery, Cube } from './types/index.js';
2
2
  /**
3
- * Validate a query against a cubes map
4
- * Standalone function that can be used by both compiler and executor
3
+ * A member the query references that no cube provides, reported alongside the
4
+ * human-readable errors.
5
+ *
6
+ * The joined error string cannot be split back apart reliably — the per-field
7
+ * "did you mean" hints contain the same separator — so a caller that wants to
8
+ * react to a *specific* missing member (a dashboard dropping a column for a
9
+ * deleted attribute, say) needs this rather than the prose. `source` is the
10
+ * part that matters: dropping a projected member narrows what is displayed,
11
+ * whereas dropping a filter would widen the result set, so the two cannot be
12
+ * treated alike.
13
+ */
14
+ export interface QueryValidationIssue {
15
+ source: 'measure' | 'dimension' | 'timeDimension' | 'filter';
16
+ /** The full `Cube.field` reference as the query wrote it. */
17
+ member: string;
18
+ message: string;
19
+ }
20
+ /**
21
+ * Thrown when a query fails validation during execution.
22
+ *
23
+ * Carries the structured issues alongside the joined message so a caller can
24
+ * react to a specific unknown member — the batch endpoint, which validates
25
+ * inside execution rather than ahead of it, would otherwise only have prose.
5
26
  */
6
- export declare function validateQueryAgainstCubes(cubes: Map<string, Cube>, query: SemanticQuery): {
27
+ export declare class QueryValidationError extends Error {
28
+ readonly issues: QueryValidationIssue[];
29
+ constructor(message: string, issues: QueryValidationIssue[]);
30
+ }
31
+ export interface QueryValidationResult {
7
32
  isValid: boolean;
8
33
  errors: string[];
9
- };
34
+ /** Unknown members, when any — see {@link QueryValidationIssue}. */
35
+ issues: QueryValidationIssue[];
36
+ }
37
+ /**
38
+ * Validate a query against a cubes map
39
+ * Standalone function that can be used by both compiler and executor
40
+ */
41
+ export declare function validateQueryAgainstCubes(cubes: Map<string, Cube>, query: SemanticQuery): QueryValidationResult;
@@ -57,6 +57,11 @@ export interface QueryResult {
57
57
  };
58
58
  /** Warnings about potential query issues (e.g., fan-out without dimensions) */
59
59
  warnings?: QueryWarning[];
60
+ /**
61
+ * Total rows the query would return with no limit/offset, present only when
62
+ * the query asked for it with `total: true`.
63
+ */
64
+ total?: number;
60
65
  }
61
66
  /**
62
67
  * Period comparison metadata for compareDateRange queries
@@ -85,6 +90,14 @@ export interface SqlResult {
85
90
  export interface ExecutionOptions {
86
91
  /** Skip the cache lookup (but still cache the result for future requests) */
87
92
  skipCache?: boolean;
93
+ /**
94
+ * Identifies the cube definitions that produced the result, as
95
+ * `setId:baseGeneration.setGeneration`. Appended unconditionally to the query
96
+ * cache key so results can never be shared between tenants whose cube sets
97
+ * differ, nor survive a re-registration that changed a definition.
98
+ * Set by SemanticLayerCompiler; callers do not supply it.
99
+ */
100
+ cubeSetKey?: string;
88
101
  }
89
102
  /**
90
103
  * Core database interface that supports all Drizzle instances
@@ -64,6 +64,19 @@ export interface QueryContext {
64
64
  * without aggregation wrappers. Set from SemanticQuery.ungrouped.
65
65
  */
66
66
  ungrouped?: boolean;
67
+ /**
68
+ * Cast an expression to a type, in this engine's dialect (`::decimal` on
69
+ * Postgres, `CAST(... AS DECIMAL)` elsewhere). Strict: unparseable input
70
+ * fails the query on Postgres and silently yields `0` on MySQL/SQLite.
71
+ */
72
+ cast: (fieldExpr: AnyColumn | SQL, targetType: 'timestamp' | 'decimal' | 'integer') => SQL;
73
+ /**
74
+ * Cast an expression to a type, yielding NULL rather than failing when the
75
+ * input cannot be parsed. Use this over {@link QueryContext.cast} whenever
76
+ * the source column is free text — one dirty value should leave a row with a
77
+ * NULL cell, not fail the whole query.
78
+ */
79
+ tryCast: (fieldExpr: AnyColumn | SQL, targetType: 'timestamp' | 'decimal' | 'integer') => SQL;
67
80
  }
68
81
  /**
69
82
  * Multi-cube query context for cross-cube operations
@@ -147,7 +160,25 @@ export interface Dimension {
147
160
  sql: AnyColumn | SQL | ((ctx: QueryContext) => AnyColumn | SQL);
148
161
  /** Whether this is a primary key */
149
162
  primaryKey?: boolean;
150
- /** Whether to show in UI */
163
+ /**
164
+ * The column this dimension's SQL correlates on, for dimensions built from a
165
+ * correlated subquery (see `buildAttributeDimensions`).
166
+ *
167
+ * A correlated subquery in the SELECT list is only legal under GROUP BY when
168
+ * the column it correlates on is itself grouped: Postgres otherwise rejects
169
+ * the query with "subquery uses ungrouped column … from outer query", and
170
+ * MySQL does the same under `only_full_group_by`. The planner cannot see
171
+ * inside an opaque `sql` function, so a dimension that needs this declares it
172
+ * and the GROUP BY builder adds the key.
173
+ */
174
+ correlatesOn?: AnyColumn;
175
+ /**
176
+ * Whether to include this dimension in generated cube metadata (`/meta`,
177
+ * the client field picker, AI prompts). Defaults to `true` (shown) when
178
+ * omitted. Setting `shown: false` hides the dimension from metadata/UI
179
+ * only — it remains fully usable in queries and filters, matching Cube.js
180
+ * semantics for `shown: false`.
181
+ */
151
182
  shown?: boolean;
152
183
  /** Display format */
153
184
  format?: string;
@@ -182,7 +213,13 @@ export interface Measure {
182
213
  sql?: AnyColumn | SQL | ((ctx: QueryContext) => AnyColumn | SQL);
183
214
  /** Display format */
184
215
  format?: string;
185
- /** Whether to show in UI */
216
+ /**
217
+ * Whether to include this measure in generated cube metadata (`/meta`,
218
+ * the client field picker, AI prompts). Defaults to `true` (shown) when
219
+ * omitted. Setting `shown: false` hides the measure from metadata/UI
220
+ * only — it remains fully usable in queries and filters, matching Cube.js
221
+ * semantics for `shown: false`.
222
+ */
186
223
  shown?: boolean;
187
224
  /** Filters applied to this measure */
188
225
  filters?: Array<(ctx: QueryContext) => SQL>;
@@ -32,6 +32,14 @@ export interface SemanticQuery {
32
32
  * - Incompatible with compareDateRange and fillMissingDates
33
33
  */
34
34
  ungrouped?: boolean;
35
+ /**
36
+ * Return the number of rows the query would produce with no `limit` or
37
+ * `offset` applied, as `QueryResult.total`. Matches Cube's `total`.
38
+ *
39
+ * Costs a second round trip: the same plan is rebuilt without pagination and
40
+ * counted, wrapped so a grouped query counts groups rather than base rows.
41
+ */
42
+ total?: boolean;
35
43
  /**
36
44
  * Funnel analysis configuration for query-time funnel definition.
37
45
  * When specified, the query executes as a funnel analysis instead of
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-cube",
3
- "version": "0.7.1",
3
+ "version": "0.8.1",
4
4
  "description": "Drizzle ORM-first semantic layer with Cube.js compatibility. Type-safe analytics and dashboards with SQL injection protection.",
5
5
  "main": "./dist/server/index.js",
6
6
  "types": "./dist/server/index.d.ts",
@@ -413,7 +413,7 @@
413
413
  "eslint-plugin-unused-imports": "^4.4.1",
414
414
  "exceljs": "^4.4.0",
415
415
  "express": "^5.1.0",
416
- "fallow": "3.20.0",
416
+ "fallow": "3.21.0",
417
417
  "fastify": "^5.6.2",
418
418
  "globals": "^17.0.0",
419
419
  "hono": "^4.0.0",
@@ -1 +0,0 @@
1
- const e=require("./handler-m6WgA9xu.cjs");exports.activityGridChartConfig=e._;
@@ -1,2 +0,0 @@
1
- import { _ as e } from "./handler-DGud-C-w.js";
2
- export { e as activityGridChartConfig };
@@ -1,2 +0,0 @@
1
- import { T as e } from "./handler-DGud-C-w.js";
2
- export { e as areaChartConfig };
@@ -1 +0,0 @@
1
- const e=require("./handler-m6WgA9xu.cjs");exports.areaChartConfig=e.T;
@@ -1,2 +0,0 @@
1
- import { D as e } from "./handler-DGud-C-w.js";
2
- export { e as barChartConfig };
@@ -1 +0,0 @@
1
- const e=require("./handler-m6WgA9xu.cjs");exports.barChartConfig=e.D;
@@ -1 +0,0 @@
1
- const e=require("./handler-m6WgA9xu.cjs");exports.boxPlotChartConfig=e.o;
@@ -1,2 +0,0 @@
1
- import { o as e } from "./handler-DGud-C-w.js";
2
- export { e as boxPlotChartConfig };
@@ -1 +0,0 @@
1
- const e=require("./handler-m6WgA9xu.cjs");exports.bubbleChartConfig=e.S;
@@ -1,2 +0,0 @@
1
- import { S as e } from "./handler-DGud-C-w.js";
2
- export { e as bubbleChartConfig };
@@ -1 +0,0 @@
1
- const e=require("./handler-m6WgA9xu.cjs");exports.candlestickChartConfig=e.i;
@@ -1,2 +0,0 @@
1
- import { i as e } from "./handler-DGud-C-w.js";
2
- export { e as candlestickChartConfig };
@@ -1,2 +0,0 @@
1
- import { v as e } from "./handler-DGud-C-w.js";
2
- export { e as dataTableConfig };
@@ -1 +0,0 @@
1
- const e=require("./handler-m6WgA9xu.cjs");exports.dataTableConfig=e.v;
@@ -1 +0,0 @@
1
- const e=require("./handler-m6WgA9xu.cjs");exports.funnelChartConfig=e.f;
@@ -1,2 +0,0 @@
1
- import { f as e } from "./handler-DGud-C-w.js";
2
- export { e as funnelChartConfig };
@@ -1,2 +0,0 @@
1
- import { t as e } from "./handler-DGud-C-w.js";
2
- export { e as gaugeChartConfig };
@@ -1 +0,0 @@
1
- const e=require("./handler-m6WgA9xu.cjs");exports.gaugeChartConfig=e.t;
@@ -1,2 +0,0 @@
1
- import { l as e } from "./handler-DGud-C-w.js";
2
- export { e as heatmapChartConfig };
@@ -1 +0,0 @@
1
- const e=require("./handler-m6WgA9xu.cjs");exports.heatmapChartConfig=e.l;
@@ -1 +0,0 @@
1
- const e=require("./handler-m6WgA9xu.cjs");exports.kpiDeltaConfig=e.h;
@@ -1,2 +0,0 @@
1
- import { h as e } from "./handler-DGud-C-w.js";
2
- export { e as kpiDeltaConfig };
@@ -1 +0,0 @@
1
- const e=require("./handler-m6WgA9xu.cjs");exports.kpiNumberConfig=e.g;
@@ -1,2 +0,0 @@
1
- import { g as e } from "./handler-DGud-C-w.js";
2
- export { e as kpiNumberConfig };
@@ -1,2 +0,0 @@
1
- import { m as e } from "./handler-DGud-C-w.js";
2
- export { e as kpiTextConfig };
@@ -1 +0,0 @@
1
- const e=require("./handler-m6WgA9xu.cjs");exports.kpiTextConfig=e.m;
@@ -1 +0,0 @@
1
- const e=require("./handler-m6WgA9xu.cjs");exports.lineChartConfig=e.E;
@@ -1,2 +0,0 @@
1
- import { E as e } from "./handler-DGud-C-w.js";
2
- export { e as lineChartConfig };
@@ -1,2 +0,0 @@
1
- import { p as e } from "./handler-DGud-C-w.js";
2
- export { e as markdownConfig };
@@ -1 +0,0 @@
1
- const e=require("./handler-m6WgA9xu.cjs");exports.markdownConfig=e.p;
@@ -1 +0,0 @@
1
- const e=require("./handler-m6WgA9xu.cjs");exports.measureProfileChartConfig=e.r;
@@ -1,2 +0,0 @@
1
- import { r as e } from "./handler-DGud-C-w.js";
2
- export { e as measureProfileChartConfig };
@@ -1 +0,0 @@
1
- const e=require("./handler-m6WgA9xu.cjs");exports.pieChartConfig=e.w;
@@ -1,2 +0,0 @@
1
- import { w as e } from "./handler-DGud-C-w.js";
2
- export { e as pieChartConfig };
@@ -1,2 +0,0 @@
1
- import { n as e } from "./handler-DGud-C-w.js";
2
- export { e as proportionBarChartConfig };
@@ -1 +0,0 @@
1
- const e=require("./handler-m6WgA9xu.cjs");exports.proportionBarChartConfig=e.n;
@@ -1,2 +0,0 @@
1
- import { x as e } from "./handler-DGud-C-w.js";
2
- export { e as radarChartConfig };
@@ -1 +0,0 @@
1
- const e=require("./handler-m6WgA9xu.cjs");exports.radarChartConfig=e.x;
@@ -1 +0,0 @@
1
- const e=require("./handler-m6WgA9xu.cjs");exports.radialBarChartConfig=e.b;
@@ -1,2 +0,0 @@
1
- import { b as e } from "./handler-DGud-C-w.js";
2
- export { e as radialBarChartConfig };
@@ -1 +0,0 @@
1
- const e=require("./handler-m6WgA9xu.cjs");exports.retentionCombinedConfig=e.s;
@@ -1,2 +0,0 @@
1
- import { s as e } from "./handler-DGud-C-w.js";
2
- export { e as retentionCombinedConfig };
@@ -1,2 +0,0 @@
1
- import { c as e } from "./handler-DGud-C-w.js";
2
- export { e as retentionHeatmapConfig };
@@ -1 +0,0 @@
1
- const e=require("./handler-m6WgA9xu.cjs");exports.retentionHeatmapConfig=e.c;
@@ -1 +0,0 @@
1
- const e=require("./handler-m6WgA9xu.cjs");exports.sankeyChartConfig=e.d;
@@ -1,2 +0,0 @@
1
- import { d as e } from "./handler-DGud-C-w.js";
2
- export { e as sankeyChartConfig };
@@ -1 +0,0 @@
1
- const e=require("./handler-m6WgA9xu.cjs");exports.scatterChartConfig=e.C;
@@ -1,2 +0,0 @@
1
- import { C as e } from "./handler-DGud-C-w.js";
2
- export { e as scatterChartConfig };
@@ -1 +0,0 @@
1
- const e=require("./handler-m6WgA9xu.cjs");exports.sunburstChartConfig=e.u;
@@ -1,2 +0,0 @@
1
- import { u as e } from "./handler-DGud-C-w.js";
2
- export { e as sunburstChartConfig };
@@ -1 +0,0 @@
1
- const e=require("./handler-m6WgA9xu.cjs");exports.treemapChartConfig=e.y;
@@ -1,2 +0,0 @@
1
- import { y as e } from "./handler-DGud-C-w.js";
2
- export { e as treemapChartConfig };
@@ -1,2 +0,0 @@
1
- import { a as e } from "./handler-DGud-C-w.js";
2
- export { e as waterfallChartConfig };
@@ -1 +0,0 @@
1
- const e=require("./handler-m6WgA9xu.cjs");exports.waterfallChartConfig=e.a;