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.
- package/dist/adapters/ActivityGridChart.config-DXUUgx0N.cjs +1 -0
- package/dist/adapters/ActivityGridChart.config-Dyozu3VW.js +2 -0
- package/dist/adapters/AreaChart.config-Di5odBXp.cjs +1 -0
- package/dist/adapters/AreaChart.config-KEaXP_4K.js +2 -0
- package/dist/adapters/BarChart.config-B-hBHykR.cjs +1 -0
- package/dist/adapters/BarChart.config-C5sqbn0A.js +2 -0
- package/dist/adapters/BoxPlotChart.config-B1R4Br7L.js +2 -0
- package/dist/adapters/BoxPlotChart.config-C82Fhd3c.cjs +1 -0
- package/dist/adapters/BubbleChart.config-CoBxmmfp.js +2 -0
- package/dist/adapters/BubbleChart.config-DfOnNjL-.cjs +1 -0
- package/dist/adapters/CandlestickChart.config-C5ggV_3j.cjs +1 -0
- package/dist/adapters/CandlestickChart.config-ZaJpWVuL.js +2 -0
- package/dist/adapters/DataTable.config-Cx2_ACdY.cjs +1 -0
- package/dist/adapters/DataTable.config-DkAgD-iz.js +2 -0
- package/dist/adapters/FunnelChart.config-CvzcECUB.js +2 -0
- package/dist/adapters/FunnelChart.config-DVH7IFnb.cjs +1 -0
- package/dist/adapters/GaugeChart.config-Csx8rt8o.cjs +1 -0
- package/dist/adapters/GaugeChart.config-DEmrNgMa.js +2 -0
- package/dist/adapters/HeatMapChart.config-BfD_dpP7.js +2 -0
- package/dist/adapters/HeatMapChart.config-D_jlyPJL.cjs +1 -0
- package/dist/adapters/KpiDelta.config-CVBdUL_n.cjs +1 -0
- package/dist/adapters/KpiDelta.config-D4dCXOxl.js +2 -0
- package/dist/adapters/KpiNumber.config-BK5pgIKz.cjs +1 -0
- package/dist/adapters/KpiNumber.config-D6XqjZrm.js +2 -0
- package/dist/adapters/KpiText.config-ChphMwG5.js +2 -0
- package/dist/adapters/KpiText.config-fO1wc6FH.cjs +1 -0
- package/dist/adapters/LineChart.config-CXJrgz1s.js +2 -0
- package/dist/adapters/LineChart.config-Cg_h-SiJ.cjs +1 -0
- package/dist/adapters/MarkdownChart.config-ByPjX-4O.cjs +1 -0
- package/dist/adapters/MarkdownChart.config-Df2yY9AT.js +2 -0
- package/dist/adapters/MeasureProfileChart.config-BBWGIteF.cjs +1 -0
- package/dist/adapters/MeasureProfileChart.config-C9OFbN9Z.js +2 -0
- package/dist/adapters/PieChart.config-C6jJj6xm.js +2 -0
- package/dist/adapters/PieChart.config-CmCw_8eN.cjs +1 -0
- package/dist/adapters/ProportionBarChart.config-B9NEyFEe.js +2 -0
- package/dist/adapters/ProportionBarChart.config-C3GAVPWn.cjs +1 -0
- package/dist/adapters/RadarChart.config-5AMwEqUJ.cjs +1 -0
- package/dist/adapters/RadarChart.config-Ct_b7IM5.js +2 -0
- package/dist/adapters/RadialBarChart.config-Bp-Sl0cm.js +2 -0
- package/dist/adapters/RadialBarChart.config-D14yoexI.cjs +1 -0
- package/dist/adapters/RecordsTable.config-D2-qmG06.cjs +1 -0
- package/dist/adapters/RecordsTable.config-DIwoqZCU.js +2 -0
- package/dist/adapters/RetentionCombinedChart.config-BWHipi5M.cjs +1 -0
- package/dist/adapters/RetentionCombinedChart.config-D40UgTcl.js +2 -0
- package/dist/adapters/RetentionHeatmap.config-GlnSLrjn.js +2 -0
- package/dist/adapters/RetentionHeatmap.config-MlhZf26c.cjs +1 -0
- package/dist/adapters/SankeyChart.config-Bf1_NHiv.js +2 -0
- package/dist/adapters/SankeyChart.config-BoYf6BFE.cjs +1 -0
- package/dist/adapters/ScatterChart.config-CV2rdGJp.js +2 -0
- package/dist/adapters/ScatterChart.config-DywduGF3.cjs +1 -0
- package/dist/adapters/SunburstChart.config-CrqiE1UZ.js +2 -0
- package/dist/adapters/SunburstChart.config-D5tbF_GJ.cjs +1 -0
- package/dist/adapters/TreeMapChart.config-BJ8HnZU0.cjs +1 -0
- package/dist/adapters/TreeMapChart.config-DxgIqIIj.js +2 -0
- package/dist/adapters/WaterfallChart.config-Cns8fLFu.js +2 -0
- package/dist/adapters/WaterfallChart.config-D_kdL9SN.cjs +1 -0
- package/dist/adapters/compiler-BxZHh0UD.cjs +166 -0
- package/dist/adapters/{compiler-DiYxWAKg.js → compiler-CBGD_4Et.js} +1389 -1923
- package/dist/adapters/core/http-port.d.ts +34 -7
- package/dist/adapters/core/index.cjs +1 -1
- package/dist/adapters/core/index.d.ts +1 -0
- package/dist/adapters/core/index.js +2 -2
- package/dist/adapters/core/rest-handlers.d.ts +1 -1
- package/dist/adapters/core-CIGuwGuI.cjs +1 -0
- package/dist/adapters/{core-BOPRmxPc.js → core-DAAnqPyN.js} +81 -65
- package/dist/adapters/express/index.cjs +2 -2
- package/dist/adapters/express/index.d.ts +11 -2
- package/dist/adapters/express/index.js +14 -14
- package/dist/adapters/fastify/index.cjs +2 -2
- package/dist/adapters/fastify/index.d.ts +11 -2
- package/dist/adapters/fastify/index.js +29 -29
- package/dist/{server/google-eKAc20al.js → adapters/google-DRY7jnOh.js} +46 -28
- package/dist/adapters/{google-BhvizbFR.cjs → google-PsZzwedr.cjs} +2 -2
- package/dist/adapters/handler-BcYTw6zB.cjs +25 -0
- package/dist/adapters/{handler-DGud-C-w.js → handler-eA0VJDHj.js} +363 -266
- package/dist/adapters/hono/index.cjs +1 -1
- package/dist/adapters/hono/index.js +9 -9
- package/dist/adapters/mcp-tools-handlers.d.ts +10 -3
- package/dist/adapters/mcp-tools.cjs +1 -1
- package/dist/adapters/mcp-tools.js +18 -20
- package/dist/adapters/mcp-transport-BpG44Fvn.js +730 -0
- package/dist/adapters/mcp-transport-CDxZXpc-.cjs +42 -0
- package/dist/adapters/mcp-transport.d.ts +13 -2
- package/dist/adapters/nextjs/index.cjs +1 -1
- package/dist/adapters/nextjs/index.d.ts +5 -2
- package/dist/adapters/nextjs/index.js +32 -32
- package/dist/adapters/{openai-Crp3X_zg.js → openai-BZ48ioYp.js} +1 -1
- package/dist/adapters/{openai-CmdN7Sj1.cjs → openai-Bw1j-OiP.cjs} +1 -1
- package/dist/adapters/{openai-Dwt9bxOE.cjs → openai-CLjyL5_J.cjs} +2 -2
- package/dist/adapters/{openai-CGJM6Qun.js → openai-CYYjUG_3.js} +4 -4
- package/dist/adapters/{utils-DboNUT3A.js → utils-BagURNRb.js} +1963 -1135
- package/dist/adapters/utils-BiKIg2tk.cjs +128 -0
- package/dist/adapters/utils.cjs +1 -1
- package/dist/adapters/utils.d.ts +19 -5
- package/dist/adapters/utils.js +1 -1
- package/dist/cjs/adapters/core/http-port.d.ts +34 -7
- package/dist/cjs/adapters/core/index.d.ts +1 -0
- package/dist/cjs/adapters/core/rest-handlers.d.ts +1 -1
- package/dist/cjs/adapters/express/index.d.ts +11 -2
- package/dist/cjs/adapters/fastify/index.d.ts +11 -2
- package/dist/cjs/adapters/mcp-tools-handlers.d.ts +10 -3
- package/dist/cjs/adapters/mcp-transport.d.ts +13 -2
- package/dist/cjs/adapters/nextjs/index.d.ts +5 -2
- package/dist/cjs/adapters/utils.d.ts +19 -5
- package/dist/cjs/client/charts/chartConfigRegistry.d.ts +7 -0
- package/dist/cjs/client/charts/chartConfigs.d.ts +17 -1
- package/dist/cjs/client/client/CubeClient.d.ts +11 -1
- package/dist/cjs/client/components/AnalysisBuilder/AnalysisDisplayConfigPanel.d.ts +4 -2
- package/dist/cjs/client/components/AnalysisBuilder/ColumnFormatsEditor.d.ts +10 -0
- package/dist/cjs/client/components/AnalysisBuilder/DisplayOptionControl.d.ts +3 -2
- package/dist/cjs/client/components/AnalysisBuilder/utils/queryUtils.d.ts +7 -1
- package/dist/cjs/client/components/analyticsPortlet/PortletChart.d.ts +2 -1
- package/dist/cjs/client/components/analyticsPortlet/PortletChartView.d.ts +4 -1
- package/dist/cjs/client/components/analyticsPortlet/usePortletDeadMembers.d.ts +24 -0
- package/dist/cjs/client/components/analyticsPortlet/usePortletPagination.d.ts +21 -0
- package/dist/cjs/client/components/charts/RecordsTable.config.d.ts +10 -0
- package/dist/cjs/client/components/charts/RecordsTable.d.ts +4 -0
- package/dist/cjs/client/components/charts/recordsTableHooks.d.ts +68 -0
- package/dist/cjs/client/icons/types.d.ts +1 -0
- package/dist/cjs/client/index.d.ts +2 -2
- package/dist/cjs/client/types.d.ts +92 -1
- package/dist/cjs/client/utils/recordsTableUtils.d.ts +71 -0
- package/dist/cjs/client/utils/rowLinkUtils.d.ts +35 -0
- package/dist/cjs/server/adapters/base-adapter.d.ts +46 -0
- package/dist/cjs/server/adapters/databend-adapter.d.ts +5 -0
- package/dist/cjs/server/adapters/duckdb-adapter.d.ts +5 -0
- package/dist/cjs/server/adapters/mysql-adapter.d.ts +14 -0
- package/dist/cjs/server/adapters/postgres-adapter.d.ts +15 -0
- package/dist/cjs/server/adapters/snowflake-adapter.d.ts +6 -0
- package/dist/cjs/server/adapters/sqlite-adapter.d.ts +21 -0
- package/dist/cjs/server/agent/chart-validation.d.ts +1 -1
- package/dist/cjs/server/ai/chart-schema.d.ts +117 -0
- package/dist/cjs/server/ai/discovery-helpers.d.ts +14 -0
- package/dist/cjs/server/ai/discovery.d.ts +6 -0
- package/dist/cjs/server/ai/query-schema.d.ts +1 -1
- package/dist/cjs/server/attribute-dimensions.d.ts +102 -0
- package/dist/cjs/server/builders/group-by-builder.d.ts +15 -0
- package/dist/cjs/server/cache-utils.d.ts +5 -1
- package/dist/cjs/server/compiler-metadata.d.ts +24 -3
- package/dist/cjs/server/compiler.d.ts +159 -13
- package/dist/cjs/server/execution/query-result-cache.d.ts +1 -1
- package/dist/cjs/server/executor.d.ts +15 -0
- package/dist/cjs/server/index.d.ts +13 -3
- package/dist/cjs/server/query-handlers.d.ts +2 -1
- package/dist/cjs/server/query-validator.d.ts +36 -4
- package/dist/cjs/server/types/core.d.ts +13 -0
- package/dist/cjs/server/types/cube.d.ts +39 -2
- package/dist/cjs/server/types/query.d.ts +8 -0
- package/dist/cli/index.cjs +130 -52
- package/dist/client/charts/chartConfigRegistry.d.ts +7 -0
- package/dist/client/charts/chartConfigs.d.ts +17 -1
- package/dist/client/charts.js +13 -13
- package/dist/client/chunks/{DashboardEditModal-BOfLdTgV.js → DashboardEditModal-_ZDMwaGX.js} +1653 -1188
- package/dist/client/chunks/DashboardEditModal-_ZDMwaGX.js.map +1 -0
- package/dist/client/chunks/{ProportionBarChart-DwoXU5VP.js → ProportionBarChart-qfpAWhIg.js} +3 -3
- package/dist/client/chunks/{ProportionBarChart-DwoXU5VP.js.map → ProportionBarChart-qfpAWhIg.js.map} +1 -1
- package/dist/client/chunks/RecordsTable-KmJy94xN.js +556 -0
- package/dist/client/chunks/RecordsTable-KmJy94xN.js.map +1 -0
- package/dist/client/chunks/{RetentionCombinedChart-BqlSV7yF.js → RetentionCombinedChart-C7X6aj97.js} +3 -3
- package/dist/client/chunks/{RetentionCombinedChart-BqlSV7yF.js.map → RetentionCombinedChart-C7X6aj97.js.map} +1 -1
- package/dist/client/chunks/{RetentionHeatmap-VdVkBg8Q.js → RetentionHeatmap-PpRpiqR_.js} +2 -2
- package/dist/client/chunks/{RetentionHeatmap-VdVkBg8Q.js.map → RetentionHeatmap-PpRpiqR_.js.map} +1 -1
- package/dist/client/chunks/{analysis-builder-DXw60SEs.js → analysis-builder-DaqyOjLX.js} +169 -168
- package/dist/client/chunks/{analysis-builder-DXw60SEs.js.map → analysis-builder-DaqyOjLX.js.map} +1 -1
- package/dist/client/chunks/{analysis-builder-shared-CEvHIlmk.js → analysis-builder-shared-ow9KAHDP.js} +965 -954
- package/dist/client/chunks/analysis-builder-shared-ow9KAHDP.js.map +1 -0
- package/dist/client/chunks/{chart-activity-grid-4jfS8khG.js → chart-activity-grid-DO82rrbW.js} +140 -84
- package/dist/client/chunks/chart-activity-grid-DO82rrbW.js.map +1 -0
- package/dist/client/chunks/{chart-area-Dol6s9no.js → chart-area-9SBeG0GM.js} +21 -21
- package/dist/client/chunks/{chart-area-Dol6s9no.js.map → chart-area-9SBeG0GM.js.map} +1 -1
- package/dist/client/chunks/{chart-bar-5_niozi2.js → chart-bar-tfgmLK2D.js} +5 -5
- package/dist/client/chunks/{chart-bar-5_niozi2.js.map → chart-bar-tfgmLK2D.js.map} +1 -1
- package/dist/client/chunks/{chart-box-plot-Dhp-VwhD.js → chart-box-plot-BuYW6j6g.js} +2 -2
- package/dist/client/chunks/{chart-box-plot-Dhp-VwhD.js.map → chart-box-plot-BuYW6j6g.js.map} +1 -1
- package/dist/client/chunks/{chart-bubble-BM2BAMSo.js → chart-bubble-BNmonWqW.js} +2 -2
- package/dist/client/chunks/{chart-bubble-BM2BAMSo.js.map → chart-bubble-BNmonWqW.js.map} +1 -1
- package/dist/client/chunks/{chart-candlestick-BNwLIBfm.js → chart-candlestick-BYeWNkKl.js} +2 -2
- package/dist/client/chunks/{chart-candlestick-BNwLIBfm.js.map → chart-candlestick-BYeWNkKl.js.map} +1 -1
- package/dist/client/chunks/{chart-data-table-DoDHQRe7.js → chart-data-table-C_oHiK6N.js} +1094 -1029
- package/dist/client/chunks/chart-data-table-C_oHiK6N.js.map +1 -0
- package/dist/client/chunks/{chart-funnel-Cd7da_sa.js → chart-funnel-B_CWC3cL.js} +2 -2
- package/dist/client/chunks/{chart-funnel-Cd7da_sa.js.map → chart-funnel-B_CWC3cL.js.map} +1 -1
- package/dist/client/chunks/{chart-gauge-DOpul-Oz.js → chart-gauge-D7VxwPnx.js} +3 -3
- package/dist/client/chunks/{chart-gauge-DOpul-Oz.js.map → chart-gauge-D7VxwPnx.js.map} +1 -1
- package/dist/client/chunks/{chart-heat-map-CeKbK655.js → chart-heat-map-q7Vf_dog.js} +3 -3
- package/dist/client/chunks/{chart-heat-map-CeKbK655.js.map → chart-heat-map-q7Vf_dog.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-delta-Dq8qUOOT.js → chart-kpi-delta-PEuA3iGs.js} +3 -3
- package/dist/client/chunks/{chart-kpi-delta-Dq8qUOOT.js.map → chart-kpi-delta-PEuA3iGs.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-number-DgiqTi9g.js → chart-kpi-number-DlxrO6Pq.js} +5 -5
- package/dist/client/chunks/{chart-kpi-number-DgiqTi9g.js.map → chart-kpi-number-DlxrO6Pq.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-text-CsZMVEnM.js → chart-kpi-text-Cx6cJu2s.js} +3 -3
- package/dist/client/chunks/{chart-kpi-text-CsZMVEnM.js.map → chart-kpi-text-Cx6cJu2s.js.map} +1 -1
- package/dist/client/chunks/{chart-line-DlwOB7C7.js → chart-line-pDe25JzB.js} +3 -3
- package/dist/client/chunks/{chart-line-DlwOB7C7.js.map → chart-line-pDe25JzB.js.map} +1 -1
- package/dist/client/chunks/{chart-markdown-DPE34SjC.js → chart-markdown-CRY15yp0.js} +2 -2
- package/dist/client/chunks/{chart-markdown-DPE34SjC.js.map → chart-markdown-CRY15yp0.js.map} +1 -1
- package/dist/client/chunks/{chart-measure-profile-BpTz1fce.js → chart-measure-profile-DyQ-vvuC.js} +3 -3
- package/dist/client/chunks/{chart-measure-profile-BpTz1fce.js.map → chart-measure-profile-DyQ-vvuC.js.map} +1 -1
- package/dist/client/chunks/{chart-pie-FGw66XAH.js → chart-pie-ZrnBycy1.js} +15 -15
- package/dist/client/chunks/{chart-pie-FGw66XAH.js.map → chart-pie-ZrnBycy1.js.map} +1 -1
- package/dist/client/chunks/{chart-radar-D-eRDoiA.js → chart-radar-BXbnYMUJ.js} +13 -13
- package/dist/client/chunks/{chart-radar-D-eRDoiA.js.map → chart-radar-BXbnYMUJ.js.map} +1 -1
- package/dist/client/chunks/{chart-radial-bar-DgtkNTs3.js → chart-radial-bar-CYxH3ryh.js} +3 -3
- package/dist/client/chunks/{chart-radial-bar-DgtkNTs3.js.map → chart-radial-bar-CYxH3ryh.js.map} +1 -1
- package/dist/client/chunks/{chart-sankey-D0hhb_EQ.js → chart-sankey-C9R_TDDh.js} +2 -2
- package/dist/client/chunks/{chart-sankey-D0hhb_EQ.js.map → chart-sankey-C9R_TDDh.js.map} +1 -1
- package/dist/client/chunks/{chart-scatter-D9EcAiMQ.js → chart-scatter-DrwRkzzl.js} +3 -3
- package/dist/client/chunks/{chart-scatter-D9EcAiMQ.js.map → chart-scatter-DrwRkzzl.js.map} +1 -1
- package/dist/client/chunks/{chart-sunburst-DCYmJ5DU.js → chart-sunburst-Bs1yqIPp.js} +3 -3
- package/dist/client/chunks/{chart-sunburst-DCYmJ5DU.js.map → chart-sunburst-Bs1yqIPp.js.map} +1 -1
- package/dist/client/chunks/{chart-tree-map-D_ACSSiB.js → chart-tree-map-BNjHhhVq.js} +3 -3
- package/dist/client/chunks/{chart-tree-map-D_ACSSiB.js.map → chart-tree-map-BNjHhhVq.js.map} +1 -1
- package/dist/client/chunks/{chart-waterfall-CVUVNa1R.js → chart-waterfall-CyoC0uLT.js} +3 -3
- package/dist/client/chunks/{chart-waterfall-CVUVNa1R.js.map → chart-waterfall-CyoC0uLT.js.map} +1 -1
- package/dist/client/chunks/charts-core-DCQ7od_L.js +190 -0
- package/dist/client/chunks/charts-core-DCQ7od_L.js.map +1 -0
- package/dist/client/chunks/charts-loader-Bya_zDIA.js +86 -0
- package/dist/client/chunks/charts-loader-Bya_zDIA.js.map +1 -0
- package/dist/client/chunks/{en-US-BE6VoG0o.js → en-US-HP6FHuNy.js} +3 -1
- package/dist/client/chunks/{en-US-BE6VoG0o.js.map → en-US-HP6FHuNy.js.map} +1 -1
- package/dist/client/chunks/{exceljs.min-DWC_b8G9.js → exceljs.min-CiByP8VQ.js} +2 -3
- package/dist/client/chunks/{exceljs.min-DWC_b8G9.js.map → exceljs.min-CiByP8VQ.js.map} +1 -1
- package/dist/client/chunks/{nl-NL-DFLVORiD.js → nl-NL-CEdoCz6Q.js} +54 -1
- package/dist/client/chunks/nl-NL-CEdoCz6Q.js.map +1 -0
- package/dist/client/chunks/{schema-visualization-C6g_LCiA.js → schema-visualization-DfXxFBIY.js} +3 -3
- package/dist/client/chunks/{schema-visualization-C6g_LCiA.js.map → schema-visualization-DfXxFBIY.js.map} +1 -1
- package/dist/client/chunks/{useDirtyStateTracking-ZfChDEd3.js → useDirtyStateTracking-BFJHiiVK.js} +15 -15
- package/dist/client/chunks/{useDirtyStateTracking-ZfChDEd3.js.map → useDirtyStateTracking-BFJHiiVK.js.map} +1 -1
- package/dist/client/chunks/{useExplainAI-im9e1rVb.js → useExplainAI-_C4WQE5I.js} +16 -16
- package/dist/client/chunks/{useExplainAI-im9e1rVb.js.map → useExplainAI-_C4WQE5I.js.map} +1 -1
- package/dist/client/chunks/{vendor-Qa1s8oSX.js → vendor-Gb3lH0cc.js} +49 -49
- package/dist/client/chunks/vendor-Gb3lH0cc.js.map +1 -0
- package/dist/client/client/CubeClient.d.ts +11 -1
- package/dist/client/components/AnalysisBuilder/AnalysisDisplayConfigPanel.d.ts +4 -2
- package/dist/client/components/AnalysisBuilder/ColumnFormatsEditor.d.ts +10 -0
- package/dist/client/components/AnalysisBuilder/DisplayOptionControl.d.ts +3 -2
- package/dist/client/components/AnalysisBuilder/utils/queryUtils.d.ts +7 -1
- package/dist/client/components/analyticsPortlet/PortletChart.d.ts +2 -1
- package/dist/client/components/analyticsPortlet/PortletChartView.d.ts +4 -1
- package/dist/client/components/analyticsPortlet/usePortletDeadMembers.d.ts +24 -0
- package/dist/client/components/analyticsPortlet/usePortletPagination.d.ts +21 -0
- package/dist/client/components/charts/RecordsTable.config.d.ts +10 -0
- package/dist/client/components/charts/RecordsTable.d.ts +4 -0
- package/dist/client/components/charts/recordsTableHooks.d.ts +68 -0
- package/dist/client/components.js +1 -1
- package/dist/client/hooks.js +3 -3
- package/dist/client/icons/types.d.ts +1 -0
- package/dist/client/icons.js +2 -2
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.js +213 -213
- package/dist/client/providers.js +1 -1
- package/dist/client/schema.js +1 -1
- package/dist/client/styles.css +1 -1
- package/dist/client/types.d.ts +92 -1
- package/dist/client/utils/recordsTableUtils.d.ts +71 -0
- package/dist/client/utils/rowLinkUtils.d.ts +35 -0
- package/dist/client/utils.js +14 -14
- package/dist/client-bundle-stats.html +1 -1
- package/dist/mcp-app/mcp-app.html +109 -109
- package/dist/server/adapters/base-adapter.d.ts +46 -0
- package/dist/server/adapters/databend-adapter.d.ts +5 -0
- package/dist/server/adapters/duckdb-adapter.d.ts +5 -0
- package/dist/server/adapters/mysql-adapter.d.ts +14 -0
- package/dist/server/adapters/postgres-adapter.d.ts +15 -0
- package/dist/server/adapters/snowflake-adapter.d.ts +6 -0
- package/dist/server/adapters/sqlite-adapter.d.ts +21 -0
- package/dist/server/agent/chart-validation.d.ts +1 -1
- package/dist/server/ai/chart-schema.d.ts +117 -0
- package/dist/server/ai/discovery-helpers.d.ts +14 -0
- package/dist/server/ai/discovery.d.ts +6 -0
- package/dist/server/ai/query-schema.d.ts +1 -1
- package/dist/server/attribute-dimensions.d.ts +102 -0
- package/dist/server/builders/group-by-builder.d.ts +15 -0
- package/dist/server/cache-utils.d.ts +5 -1
- package/dist/server/compiler-metadata.d.ts +24 -3
- package/dist/server/compiler.d.ts +159 -13
- package/dist/server/execution/query-result-cache.d.ts +1 -1
- package/dist/server/executor.d.ts +15 -0
- package/dist/{adapters/google-eKAc20al.js → server/google-DRY7jnOh.js} +46 -28
- package/dist/server/{google-BhvizbFR.cjs → google-PsZzwedr.cjs} +2 -2
- package/dist/server/index.cjs +42 -38
- package/dist/server/index.d.ts +13 -3
- package/dist/server/index.js +2079 -1573
- package/dist/server/{openai-Czk1BdHa.js → openai-6uUf7h-5.js} +1 -1
- package/dist/server/{openai-DBwI1OSu.cjs → openai-BBe1XbZd.cjs} +1 -1
- package/dist/server/{openai-Cu4TXXjl.cjs → openai-BmADmD1e.cjs} +1 -1
- package/dist/server/{openai-CUf4vc3Q.js → openai-C1gLuR-0.js} +1 -1
- package/dist/server/query-handlers.d.ts +2 -1
- package/dist/server/query-validator.d.ts +36 -4
- package/dist/server/types/core.d.ts +13 -0
- package/dist/server/types/cube.d.ts +39 -2
- package/dist/server/types/query.d.ts +8 -0
- package/package.json +2 -2
- package/dist/adapters/ActivityGridChart.config-D6hhj345.cjs +0 -1
- package/dist/adapters/ActivityGridChart.config-QZKs_NYg.js +0 -2
- package/dist/adapters/AreaChart.config-B5XM6G22.js +0 -2
- package/dist/adapters/AreaChart.config-NP34BH5y.cjs +0 -1
- package/dist/adapters/BarChart.config-Bqlmr81N.js +0 -2
- package/dist/adapters/BarChart.config-C3bw-cAP.cjs +0 -1
- package/dist/adapters/BoxPlotChart.config-BOAvoj6x.cjs +0 -1
- package/dist/adapters/BoxPlotChart.config-CTXiycYY.js +0 -2
- package/dist/adapters/BubbleChart.config-CGFIkl4H.cjs +0 -1
- package/dist/adapters/BubbleChart.config-Njxx4Eq1.js +0 -2
- package/dist/adapters/CandlestickChart.config-BZ_yWaSo.cjs +0 -1
- package/dist/adapters/CandlestickChart.config-D4Svhmef.js +0 -2
- package/dist/adapters/DataTable.config-B-bT9puT.js +0 -2
- package/dist/adapters/DataTable.config-BHtt1cPM.cjs +0 -1
- package/dist/adapters/FunnelChart.config-C1e07O7B.cjs +0 -1
- package/dist/adapters/FunnelChart.config-CVEy0tV9.js +0 -2
- package/dist/adapters/GaugeChart.config-5PLNlQlu.js +0 -2
- package/dist/adapters/GaugeChart.config-Cdv6knjZ.cjs +0 -1
- package/dist/adapters/HeatMapChart.config-MGTfYpWJ.js +0 -2
- package/dist/adapters/HeatMapChart.config-jfBEi1ZI.cjs +0 -1
- package/dist/adapters/KpiDelta.config-D2IUsEYz.cjs +0 -1
- package/dist/adapters/KpiDelta.config-DT_MmAHw.js +0 -2
- package/dist/adapters/KpiNumber.config-ChgbKmx8.cjs +0 -1
- package/dist/adapters/KpiNumber.config-CvZ_FhyL.js +0 -2
- package/dist/adapters/KpiText.config-Bgkw8gr2.js +0 -2
- package/dist/adapters/KpiText.config-Bz9orqt6.cjs +0 -1
- package/dist/adapters/LineChart.config-BVew35dI.cjs +0 -1
- package/dist/adapters/LineChart.config-DSCCKXNg.js +0 -2
- package/dist/adapters/MarkdownChart.config-Bu6XUuhI.js +0 -2
- package/dist/adapters/MarkdownChart.config-E4aSVTf3.cjs +0 -1
- package/dist/adapters/MeasureProfileChart.config-BF249hc_.cjs +0 -1
- package/dist/adapters/MeasureProfileChart.config-lERVe38G.js +0 -2
- package/dist/adapters/PieChart.config-7Ujwp8R5.cjs +0 -1
- package/dist/adapters/PieChart.config-jQl2HIcA.js +0 -2
- package/dist/adapters/ProportionBarChart.config-o0w_Pnlt.js +0 -2
- package/dist/adapters/ProportionBarChart.config-phNohhhY.cjs +0 -1
- package/dist/adapters/RadarChart.config-BmrYBd9x.js +0 -2
- package/dist/adapters/RadarChart.config-Dlt3UflG.cjs +0 -1
- package/dist/adapters/RadialBarChart.config-CeEm8xRb.cjs +0 -1
- package/dist/adapters/RadialBarChart.config-Dishh6bC.js +0 -2
- package/dist/adapters/RetentionCombinedChart.config-BaD4ev85.cjs +0 -1
- package/dist/adapters/RetentionCombinedChart.config-m2FjBUi9.js +0 -2
- package/dist/adapters/RetentionHeatmap.config-DiMplGdk.js +0 -2
- package/dist/adapters/RetentionHeatmap.config-Dp6oYwQZ.cjs +0 -1
- package/dist/adapters/SankeyChart.config-C4Y6qzCS.cjs +0 -1
- package/dist/adapters/SankeyChart.config-CJHqgjQ1.js +0 -2
- package/dist/adapters/ScatterChart.config-C0QqvDrN.cjs +0 -1
- package/dist/adapters/ScatterChart.config-DywOsWPW.js +0 -2
- package/dist/adapters/SunburstChart.config-DE8RxpDR.cjs +0 -1
- package/dist/adapters/SunburstChart.config-DohowrO3.js +0 -2
- package/dist/adapters/TreeMapChart.config-D2gXz-zC.cjs +0 -1
- package/dist/adapters/TreeMapChart.config-HMlI29GG.js +0 -2
- package/dist/adapters/WaterfallChart.config-BO2WV2VB.js +0 -2
- package/dist/adapters/WaterfallChart.config-CzwGiheB.cjs +0 -1
- package/dist/adapters/compiler-BNjqYdmc.cjs +0 -166
- package/dist/adapters/core-CzFfrJzu.cjs +0 -1
- package/dist/adapters/handler-m6WgA9xu.cjs +0 -25
- package/dist/adapters/mcp-transport-B0b27YUB.cjs +0 -40
- package/dist/adapters/mcp-transport-BXyA4dTk.js +0 -603
- package/dist/adapters/utils-BoOeig94.cjs +0 -128
- package/dist/client/chunks/DashboardEditModal-BOfLdTgV.js.map +0 -1
- package/dist/client/chunks/analysis-builder-shared-CEvHIlmk.js.map +0 -1
- package/dist/client/chunks/chart-activity-grid-4jfS8khG.js.map +0 -1
- package/dist/client/chunks/chart-data-table-DoDHQRe7.js.map +0 -1
- package/dist/client/chunks/charts-core-BPD_hLaL.js +0 -215
- package/dist/client/chunks/charts-core-BPD_hLaL.js.map +0 -1
- package/dist/client/chunks/charts-loader-CwMcOfwT.js +0 -85
- package/dist/client/chunks/charts-loader-CwMcOfwT.js.map +0 -1
- package/dist/client/chunks/nl-NL-DFLVORiD.js.map +0 -1
- package/dist/client/chunks/vendor-Qa1s8oSX.js.map +0 -1
package/dist/adapters/utils.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./utils-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./utils-BiKIg2tk.cjs");exports.buildTransformedQuery=e.t,exports.calculateQueryComplexity=e.n,exports.formatCubeResponse=e.r,exports.formatErrorResponse=e.i,exports.formatMetaResponse=e.a,exports.formatSqlResponse=e.o,exports.formatSqlString=e.S,exports.generateRequestId=e.s,exports.getDatabaseType=e.c,exports.handleBatchRequest=e.l,exports.handleDiscover=e.p,exports.handleDryRun=e.u,exports.handleLoad=e.m,exports.handleSuggest=e.d,exports.handleValidate=e.f,exports.normalizeQueryFields=e.h;
|
package/dist/adapters/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SemanticLayerCompiler, SemanticQuery, SecurityContext, QuerySuggestion, AIValidationResult } from '../server/index.js';
|
|
1
|
+
import { SemanticLayerCompiler, SemanticQuery, SecurityContext, QuerySuggestion, AIValidationResult, QueryValidationIssue } from '../server/index.js';
|
|
2
2
|
import { normalizeQueryFields } from '../server/query-handlers.js';
|
|
3
3
|
import { MCPPromptResolver, MCPResourceResolver, MCPInstructionsResolver } from './mcp-transport.js';
|
|
4
4
|
export { handleDiscover, handleLoad } from '../server/query-handlers.js';
|
|
@@ -45,9 +45,11 @@ export declare function formatCubeResponse(query: SemanticQuery, result: {
|
|
|
45
45
|
measures?: string[];
|
|
46
46
|
suggestion?: string;
|
|
47
47
|
}>;
|
|
48
|
+
total?: number;
|
|
48
49
|
}, semanticLayer: SemanticLayerCompiler): {
|
|
49
50
|
queryType: string;
|
|
50
51
|
results: {
|
|
52
|
+
total?: number | undefined;
|
|
51
53
|
warnings?: {
|
|
52
54
|
code: string;
|
|
53
55
|
message: string;
|
|
@@ -86,6 +88,7 @@ export declare function formatCubeResponse(query: SemanticQuery, result: {
|
|
|
86
88
|
order?: Record<string, "asc" | "desc">;
|
|
87
89
|
fillMissingDatesValue?: number | null;
|
|
88
90
|
ungrouped?: boolean;
|
|
91
|
+
total?: boolean;
|
|
89
92
|
funnel?: import('../server/index.js').FunnelQueryConfig;
|
|
90
93
|
flow?: import('../server/types/flow.js').FlowQueryConfig;
|
|
91
94
|
retention?: import('../server/index.js').RetentionQueryConfig;
|
|
@@ -167,9 +170,16 @@ export declare function formatMetaResponse(metadata: any): {
|
|
|
167
170
|
};
|
|
168
171
|
};
|
|
169
172
|
/**
|
|
170
|
-
* Standard error response format
|
|
173
|
+
* Standard error response format.
|
|
174
|
+
*
|
|
175
|
+
* `issues` is additive: the `error` string keeps its exact shape for existing
|
|
176
|
+
* clients, while a caller that needs to act on a *particular* unknown member —
|
|
177
|
+
* a dashboard dropping the column for a deleted attribute, say — has something
|
|
178
|
+
* structured to read. Splitting the joined string back apart is not reliable,
|
|
179
|
+
* since the per-field hints contain the same separator.
|
|
171
180
|
*/
|
|
172
|
-
export declare function formatErrorResponse(error: string | Error, status?: number): {
|
|
181
|
+
export declare function formatErrorResponse(error: string | Error, status?: number, issues?: QueryValidationIssue[]): {
|
|
182
|
+
issues?: QueryValidationIssue[] | undefined;
|
|
173
183
|
error: string;
|
|
174
184
|
status: number;
|
|
175
185
|
};
|
|
@@ -197,6 +207,7 @@ export declare function handleBatchRequest(queries: SemanticQuery[], securityCon
|
|
|
197
207
|
results: ({
|
|
198
208
|
queryType: string;
|
|
199
209
|
results: {
|
|
210
|
+
total?: number | undefined;
|
|
200
211
|
warnings?: {
|
|
201
212
|
code: string;
|
|
202
213
|
message: string;
|
|
@@ -235,6 +246,7 @@ export declare function handleBatchRequest(queries: SemanticQuery[], securityCon
|
|
|
235
246
|
order?: Record<string, "asc" | "desc">;
|
|
236
247
|
fillMissingDatesValue?: number | null;
|
|
237
248
|
ungrouped?: boolean;
|
|
249
|
+
total?: boolean;
|
|
238
250
|
funnel?: import('../server/index.js').FunnelQueryConfig;
|
|
239
251
|
flow?: import('../server/types/flow.js').FlowQueryConfig;
|
|
240
252
|
retention?: import('../server/index.js').RetentionQueryConfig;
|
|
@@ -242,10 +254,12 @@ export declare function handleBatchRequest(queries: SemanticQuery[], securityCon
|
|
|
242
254
|
slowQuery: boolean;
|
|
243
255
|
success: boolean;
|
|
244
256
|
error?: undefined;
|
|
257
|
+
issues?: undefined;
|
|
245
258
|
query?: undefined;
|
|
246
259
|
} | {
|
|
247
260
|
success: boolean;
|
|
248
261
|
error: string;
|
|
262
|
+
issues: QueryValidationIssue[] | undefined;
|
|
249
263
|
query: SemanticQuery;
|
|
250
264
|
})[];
|
|
251
265
|
}>;
|
|
@@ -354,11 +368,11 @@ export interface ValidateRequest {
|
|
|
354
368
|
/**
|
|
355
369
|
* Handle /suggest endpoint - generate query from natural language
|
|
356
370
|
*/
|
|
357
|
-
export declare function handleSuggest(semanticLayer: SemanticLayerCompiler, body: SuggestRequest): Promise<QuerySuggestion>;
|
|
371
|
+
export declare function handleSuggest(semanticLayer: SemanticLayerCompiler, securityContext: SecurityContext, body: SuggestRequest): Promise<QuerySuggestion>;
|
|
358
372
|
/**
|
|
359
373
|
* Handle /validate endpoint - validate query with corrections
|
|
360
374
|
*/
|
|
361
|
-
export declare function handleValidate(semanticLayer: SemanticLayerCompiler,
|
|
375
|
+
export declare function handleValidate(semanticLayer: SemanticLayerCompiler, securityContext: SecurityContext, body: ValidateRequest): Promise<AIValidationResult & {
|
|
362
376
|
sql?: {
|
|
363
377
|
sql: string;
|
|
364
378
|
params?: any[];
|
package/dist/adapters/utils.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { S as e, a as t, c as n, d as r, f as i, h as a, i as o, l as s, m as c, n as l, o as u, p as d, r as f, s as p, t as m, u as h } from "./utils-
|
|
1
|
+
import { S as e, a as t, c as n, d as r, f as i, h as a, i as o, l as s, m as c, n as l, o as u, p as d, r as f, s as p, t as m, u as h } from "./utils-BagURNRb.js";
|
|
2
2
|
export { m as buildTransformedQuery, l as calculateQueryComplexity, f as formatCubeResponse, o as formatErrorResponse, t as formatMetaResponse, u as formatSqlResponse, e as formatSqlString, p as generateRequestId, n as getDatabaseType, s as handleBatchRequest, d as handleDiscover, h as handleDryRun, c as handleLoad, r as handleSuggest, i as handleValidate, a as normalizeQueryFields };
|
|
@@ -7,8 +7,16 @@
|
|
|
7
7
|
* (Hono/Next.js). Implementations are constructed per request by each adapter.
|
|
8
8
|
*
|
|
9
9
|
* This interface is public — third parties implement it to build adapters for
|
|
10
|
-
* other frameworks.
|
|
11
|
-
*
|
|
10
|
+
* other frameworks. Prefer optional members or a separate extension interface
|
|
11
|
+
* for new capabilities, because a new required member is a breaking change for
|
|
12
|
+
* those adapters.
|
|
13
|
+
*
|
|
14
|
+
* `setHeader` was promoted from {@link McpHttpPort} to this interface in the
|
|
15
|
+
* per-tenant cube sets release, so that the core can stamp `Cache-Control` on
|
|
16
|
+
* every REST response (see {@link withRestCacheHeaders}). Every REST body is now
|
|
17
|
+
* tenant-scoped, and that guarantee cannot be left to each adapter. The break is
|
|
18
|
+
* accepted for this release: third-party REST-only adapters must add
|
|
19
|
+
* `setHeader`, which all four first-party adapters already implemented.
|
|
12
20
|
*/
|
|
13
21
|
export interface HttpPort<TRes> {
|
|
14
22
|
/** Read a request header by (case-insensitive) name. Synchronous. */
|
|
@@ -17,23 +25,42 @@ export interface HttpPort<TRes> {
|
|
|
17
25
|
getBody(): Promise<unknown>;
|
|
18
26
|
/** Read a raw query-string value by name (used by GET). */
|
|
19
27
|
getQueryParam(name: string): string | undefined;
|
|
28
|
+
/** Set a response header. Must be called before `send`/`sendSse`/`sendEmpty`. */
|
|
29
|
+
setHeader(name: string, value: string): void;
|
|
20
30
|
/** Send a response with the given status and JSON body; returns the framework's response value. */
|
|
21
31
|
send(status: number, body: unknown): TRes;
|
|
22
32
|
}
|
|
23
33
|
/**
|
|
24
|
-
* Extension of {@link HttpPort} for the MCP POST handler, which needs to
|
|
25
|
-
* response
|
|
26
|
-
*
|
|
34
|
+
* Extension of {@link HttpPort} for the MCP POST handler, which needs to emit a
|
|
35
|
+
* single-event SSE response and send an empty-body acknowledgement (202 for
|
|
36
|
+
* notifications).
|
|
27
37
|
*
|
|
28
38
|
* Kept separate from the minimal REST port so third-party adapters only
|
|
29
39
|
* implement these when they wire up MCP. New required members on this interface
|
|
30
40
|
* are still a breaking change for MCP-capable adapters.
|
|
31
41
|
*/
|
|
32
42
|
export interface McpHttpPort<TRes> extends HttpPort<TRes> {
|
|
33
|
-
/** Set a response header. Must be called before `send`/`sendSse`/`sendEmpty`. */
|
|
34
|
-
setHeader(name: string, value: string): void;
|
|
35
43
|
/** Send a single-event SSE response (status 200): write the pre-serialized body, then end. */
|
|
36
44
|
sendSse(status: number, body: string): TRes;
|
|
37
45
|
/** Send an empty-body response (no JSON), e.g. a 202 notification acknowledgement. */
|
|
38
46
|
sendEmpty(status: number): TRes;
|
|
39
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* `Cache-Control` stamped on every REST response.
|
|
50
|
+
*
|
|
51
|
+
* Every REST body varies by tenant: `/meta` returns the caller's cube set, and
|
|
52
|
+
* `/load`, `/sql`, `/dry-run`, `/batch` and `/explain` return that tenant's data
|
|
53
|
+
* or SQL. With no `Cache-Control` a shared cache may store and reuse these
|
|
54
|
+
* responses heuristically, which would cross-serve one tenant's cubes to
|
|
55
|
+
* another. `private` bars shared caches; `no-store` bars storage entirely.
|
|
56
|
+
*/
|
|
57
|
+
export declare const REST_CACHE_CONTROL = "private, no-store";
|
|
58
|
+
/**
|
|
59
|
+
* Wrap a port so every response it sends carries {@link REST_CACHE_CONTROL}.
|
|
60
|
+
*
|
|
61
|
+
* Applied once over the whole REST surface in `createCubeHttpHandler`, not per
|
|
62
|
+
* route, so no endpoint can forget it — including the 400/500 error paths.
|
|
63
|
+
* Deliberately NOT applied to MCP: its SSE responses set their own
|
|
64
|
+
* `Cache-Control`, and JSON-RPC POSTs are not heuristically cacheable.
|
|
65
|
+
*/
|
|
66
|
+
export declare function withRestCacheHeaders<TRes>(port: HttpPort<TRes>): HttpPort<TRes>;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* {@link createCubeHttpHandler}.
|
|
7
7
|
*/
|
|
8
8
|
export type { HttpPort, McpHttpPort } from './http-port.js';
|
|
9
|
+
export { withRestCacheHeaders, REST_CACHE_CONTROL } from './http-port.js';
|
|
9
10
|
export { withLocaleFromHeaders, resolveSecurityContext, type HeaderReader, type BaseSecurityContextThunk } from './security-context.js';
|
|
10
11
|
export { createCubeHttpHandler, type CubeHttpHandler, type CubeHttpHandlerOptions } from './cube-http-handler.js';
|
|
11
12
|
export type { RestHandlers } from './rest-handlers.js';
|
|
@@ -3,7 +3,7 @@ import { HttpPort } from './http-port.js';
|
|
|
3
3
|
import { BaseSecurityContextThunk } from './security-context.js';
|
|
4
4
|
/** REST handlers keyed by endpoint; each closes over the shared semantic layer. */
|
|
5
5
|
export interface RestHandlers {
|
|
6
|
-
handleMetaGet<TRes>(port: HttpPort<TRes
|
|
6
|
+
handleMetaGet<TRes>(port: HttpPort<TRes>, getBaseSecurityContext: BaseSecurityContextThunk): Promise<TRes>;
|
|
7
7
|
handleSqlGet<TRes>(port: HttpPort<TRes>, getBaseSecurityContext: BaseSecurityContextThunk): Promise<TRes>;
|
|
8
8
|
handleSqlPost<TRes>(port: HttpPort<TRes>, getBaseSecurityContext: BaseSecurityContextThunk): Promise<TRes>;
|
|
9
9
|
handleDryRunGet<TRes>(port: HttpPort<TRes>, getBaseSecurityContext: BaseSecurityContextThunk): Promise<TRes>;
|
|
@@ -2,15 +2,24 @@ import { Router, Request, Response, Express } from 'express';
|
|
|
2
2
|
import { CorsOptions } from 'cors';
|
|
3
3
|
import { SemanticQuery, SecurityContext, DatabaseExecutor, DrizzleDatabase, Cube, CacheConfig, RLSSetupFn } from '../../server/index.js';
|
|
4
4
|
import { AgentConfig } from '../../server/agent/types.js';
|
|
5
|
+
import { SemanticLayerCompiler } from '../../server/compiler.js';
|
|
5
6
|
import { PostgresJsDatabase } from 'drizzle-orm/postgres-js';
|
|
6
7
|
import { MySql2Database } from 'drizzle-orm/mysql2';
|
|
7
8
|
import { BetterSQLite3Database } from 'drizzle-orm/better-sqlite3';
|
|
8
9
|
import { MCPOptions } from '../utils.js';
|
|
9
10
|
export interface ExpressAdapterOptions {
|
|
10
11
|
/**
|
|
11
|
-
*
|
|
12
|
+
* Pre-configured SemanticLayerCompiler instance.
|
|
13
|
+
* When provided, skips creating a new compiler and cube registration (caller
|
|
14
|
+
* manages it). Required to use per-tenant cube sets, since the caller must own
|
|
15
|
+
* the compiler to call `registerCubeSet` — see docs/per-tenant-cube-sets.md.
|
|
12
16
|
*/
|
|
13
|
-
|
|
17
|
+
semanticLayer?: SemanticLayerCompiler;
|
|
18
|
+
/**
|
|
19
|
+
* Array of cube definitions to register.
|
|
20
|
+
* Required unless `semanticLayer` is provided.
|
|
21
|
+
*/
|
|
22
|
+
cubes?: Cube[];
|
|
14
23
|
/**
|
|
15
24
|
* Drizzle database instance (REQUIRED)
|
|
16
25
|
* This is the core of drizzle-cube - Drizzle ORM integration
|
|
@@ -2,15 +2,24 @@ import { FastifyPluginCallback, FastifyRequest, FastifyInstance } from 'fastify'
|
|
|
2
2
|
import { FastifyCorsOptions } from '@fastify/cors';
|
|
3
3
|
import { SemanticQuery, SecurityContext, DatabaseExecutor, DrizzleDatabase, Cube, CacheConfig, RLSSetupFn } from '../../server/index.js';
|
|
4
4
|
import { AgentConfig } from '../../server/agent/types.js';
|
|
5
|
+
import { SemanticLayerCompiler } from '../../server/compiler.js';
|
|
5
6
|
import { PostgresJsDatabase } from 'drizzle-orm/postgres-js';
|
|
6
7
|
import { MySql2Database } from 'drizzle-orm/mysql2';
|
|
7
8
|
import { BetterSQLite3Database } from 'drizzle-orm/better-sqlite3';
|
|
8
9
|
import { MCPOptions } from '../utils.js';
|
|
9
10
|
export interface FastifyAdapterOptions {
|
|
10
11
|
/**
|
|
11
|
-
*
|
|
12
|
+
* Pre-configured SemanticLayerCompiler instance.
|
|
13
|
+
* When provided, skips creating a new compiler and cube registration (caller
|
|
14
|
+
* manages it). Required to use per-tenant cube sets, since the caller must own
|
|
15
|
+
* the compiler to call `registerCubeSet` — see docs/per-tenant-cube-sets.md.
|
|
12
16
|
*/
|
|
13
|
-
|
|
17
|
+
semanticLayer?: SemanticLayerCompiler;
|
|
18
|
+
/**
|
|
19
|
+
* Array of cube definitions to register.
|
|
20
|
+
* Required unless `semanticLayer` is provided.
|
|
21
|
+
*/
|
|
22
|
+
cubes?: Cube[];
|
|
14
23
|
/**
|
|
15
24
|
* Drizzle database instance (REQUIRED)
|
|
16
25
|
* This is the core of drizzle-cube - Drizzle ORM integration
|
|
@@ -6,9 +6,16 @@ export interface CubeToolHandlerDeps {
|
|
|
6
6
|
wrapContent: (result: unknown) => MCPToolResult;
|
|
7
7
|
wrapError: (error: unknown) => MCPToolResult;
|
|
8
8
|
}
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Execute the `discover` tool. Reads the caller's cube set, so it resolves a
|
|
11
|
+
* security context first — discovery has no unauthenticated mode.
|
|
12
|
+
*/
|
|
13
|
+
export declare function runDiscoverTool(deps: CubeToolHandlerDeps, args: unknown, meta?: unknown): Promise<MCPToolResult>;
|
|
14
|
+
/**
|
|
15
|
+
* Execute the `validate` tool. The security context is required: validation is
|
|
16
|
+
* against the caller's cube set, so a caller whose context cannot be resolved
|
|
17
|
+
* gets an error rather than a base-set answer with the SQL omitted.
|
|
18
|
+
*/
|
|
12
19
|
export declare function runValidateTool(deps: CubeToolHandlerDeps, args: unknown, meta?: unknown): Promise<MCPToolResult>;
|
|
13
20
|
/**
|
|
14
21
|
* Execute the `load` / `chart` tools. Both run the same query path; `chart`
|
|
@@ -172,5 +172,16 @@ export declare function resolveMcpResources(resources?: MCPResourceResolver): MC
|
|
|
172
172
|
* project-specific guidance like custom cube semantics).
|
|
173
173
|
*/
|
|
174
174
|
export declare function resolveMcpInstructions(instructions?: MCPInstructionsResolver): string;
|
|
175
|
-
|
|
176
|
-
|
|
175
|
+
/**
|
|
176
|
+
* The `drizzle-cube://schema` resource: this caller's cube metadata as JSON.
|
|
177
|
+
*
|
|
178
|
+
* Its body is tenant-specific, so it must be built per request under the
|
|
179
|
+
* caller's security context. Building it once at handler construction — as this
|
|
180
|
+
* used to be — would freeze every tenant's view to the base set.
|
|
181
|
+
*/
|
|
182
|
+
export declare function buildMcpSchemaResource(semanticLayer: SemanticLayerCompiler, securityContext: SecurityContext): MCPResource;
|
|
183
|
+
/**
|
|
184
|
+
* Static resources plus this caller's schema resource. Call per request, never
|
|
185
|
+
* at setup time — see {@link buildMcpSchemaResource}.
|
|
186
|
+
*/
|
|
187
|
+
export declare function buildMcpResources(semanticLayer: SemanticLayerCompiler, securityContext: SecurityContext, resources?: MCPResourceResolver): MCPResource[];
|
|
@@ -26,9 +26,12 @@ export interface NextCorsOptions {
|
|
|
26
26
|
}
|
|
27
27
|
export interface NextAdapterOptions {
|
|
28
28
|
/**
|
|
29
|
-
* Array of cube definitions to register
|
|
29
|
+
* Array of cube definitions to register.
|
|
30
|
+
* Required unless `semanticLayer` is provided — `createSemanticLayer` returns
|
|
31
|
+
* an injected compiler untouched, so a caller managing their own (which
|
|
32
|
+
* per-tenant cube sets require) supplies no cubes here.
|
|
30
33
|
*/
|
|
31
|
-
cubes
|
|
34
|
+
cubes?: Cube[];
|
|
32
35
|
/**
|
|
33
36
|
* Drizzle database instance (REQUIRED)
|
|
34
37
|
* This is the core of drizzle-cube - Drizzle ORM integration
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SemanticLayerCompiler, SemanticQuery, SecurityContext, QuerySuggestion, AIValidationResult } from '../server/index.js';
|
|
1
|
+
import { SemanticLayerCompiler, SemanticQuery, SecurityContext, QuerySuggestion, AIValidationResult, QueryValidationIssue } from '../server/index.js';
|
|
2
2
|
import { normalizeQueryFields } from '../server/query-handlers.js';
|
|
3
3
|
import { MCPPromptResolver, MCPResourceResolver, MCPInstructionsResolver } from './mcp-transport.js';
|
|
4
4
|
export { handleDiscover, handleLoad } from '../server/query-handlers.js';
|
|
@@ -45,9 +45,11 @@ export declare function formatCubeResponse(query: SemanticQuery, result: {
|
|
|
45
45
|
measures?: string[];
|
|
46
46
|
suggestion?: string;
|
|
47
47
|
}>;
|
|
48
|
+
total?: number;
|
|
48
49
|
}, semanticLayer: SemanticLayerCompiler): {
|
|
49
50
|
queryType: string;
|
|
50
51
|
results: {
|
|
52
|
+
total?: number | undefined;
|
|
51
53
|
warnings?: {
|
|
52
54
|
code: string;
|
|
53
55
|
message: string;
|
|
@@ -86,6 +88,7 @@ export declare function formatCubeResponse(query: SemanticQuery, result: {
|
|
|
86
88
|
order?: Record<string, "asc" | "desc">;
|
|
87
89
|
fillMissingDatesValue?: number | null;
|
|
88
90
|
ungrouped?: boolean;
|
|
91
|
+
total?: boolean;
|
|
89
92
|
funnel?: import('../server/index.js').FunnelQueryConfig;
|
|
90
93
|
flow?: import('../server/types/flow.js').FlowQueryConfig;
|
|
91
94
|
retention?: import('../server/index.js').RetentionQueryConfig;
|
|
@@ -167,9 +170,16 @@ export declare function formatMetaResponse(metadata: any): {
|
|
|
167
170
|
};
|
|
168
171
|
};
|
|
169
172
|
/**
|
|
170
|
-
* Standard error response format
|
|
173
|
+
* Standard error response format.
|
|
174
|
+
*
|
|
175
|
+
* `issues` is additive: the `error` string keeps its exact shape for existing
|
|
176
|
+
* clients, while a caller that needs to act on a *particular* unknown member —
|
|
177
|
+
* a dashboard dropping the column for a deleted attribute, say — has something
|
|
178
|
+
* structured to read. Splitting the joined string back apart is not reliable,
|
|
179
|
+
* since the per-field hints contain the same separator.
|
|
171
180
|
*/
|
|
172
|
-
export declare function formatErrorResponse(error: string | Error, status?: number): {
|
|
181
|
+
export declare function formatErrorResponse(error: string | Error, status?: number, issues?: QueryValidationIssue[]): {
|
|
182
|
+
issues?: QueryValidationIssue[] | undefined;
|
|
173
183
|
error: string;
|
|
174
184
|
status: number;
|
|
175
185
|
};
|
|
@@ -197,6 +207,7 @@ export declare function handleBatchRequest(queries: SemanticQuery[], securityCon
|
|
|
197
207
|
results: ({
|
|
198
208
|
queryType: string;
|
|
199
209
|
results: {
|
|
210
|
+
total?: number | undefined;
|
|
200
211
|
warnings?: {
|
|
201
212
|
code: string;
|
|
202
213
|
message: string;
|
|
@@ -235,6 +246,7 @@ export declare function handleBatchRequest(queries: SemanticQuery[], securityCon
|
|
|
235
246
|
order?: Record<string, "asc" | "desc">;
|
|
236
247
|
fillMissingDatesValue?: number | null;
|
|
237
248
|
ungrouped?: boolean;
|
|
249
|
+
total?: boolean;
|
|
238
250
|
funnel?: import('../server/index.js').FunnelQueryConfig;
|
|
239
251
|
flow?: import('../server/types/flow.js').FlowQueryConfig;
|
|
240
252
|
retention?: import('../server/index.js').RetentionQueryConfig;
|
|
@@ -242,10 +254,12 @@ export declare function handleBatchRequest(queries: SemanticQuery[], securityCon
|
|
|
242
254
|
slowQuery: boolean;
|
|
243
255
|
success: boolean;
|
|
244
256
|
error?: undefined;
|
|
257
|
+
issues?: undefined;
|
|
245
258
|
query?: undefined;
|
|
246
259
|
} | {
|
|
247
260
|
success: boolean;
|
|
248
261
|
error: string;
|
|
262
|
+
issues: QueryValidationIssue[] | undefined;
|
|
249
263
|
query: SemanticQuery;
|
|
250
264
|
})[];
|
|
251
265
|
}>;
|
|
@@ -354,11 +368,11 @@ export interface ValidateRequest {
|
|
|
354
368
|
/**
|
|
355
369
|
* Handle /suggest endpoint - generate query from natural language
|
|
356
370
|
*/
|
|
357
|
-
export declare function handleSuggest(semanticLayer: SemanticLayerCompiler, body: SuggestRequest): Promise<QuerySuggestion>;
|
|
371
|
+
export declare function handleSuggest(semanticLayer: SemanticLayerCompiler, securityContext: SecurityContext, body: SuggestRequest): Promise<QuerySuggestion>;
|
|
358
372
|
/**
|
|
359
373
|
* Handle /validate endpoint - validate query with corrections
|
|
360
374
|
*/
|
|
361
|
-
export declare function handleValidate(semanticLayer: SemanticLayerCompiler,
|
|
375
|
+
export declare function handleValidate(semanticLayer: SemanticLayerCompiler, securityContext: SecurityContext, body: ValidateRequest): Promise<AIValidationResult & {
|
|
362
376
|
sql?: {
|
|
363
377
|
sql: string;
|
|
364
378
|
params?: any[];
|
|
@@ -7,6 +7,13 @@ import { ChartTypeConfig, ChartConfigRegistry } from './chartConfigs.js';
|
|
|
7
7
|
* stay here in full because the server agent reads them synchronously.
|
|
8
8
|
*/
|
|
9
9
|
export declare const chartConfigRegistry: ChartConfigRegistry;
|
|
10
|
+
/**
|
|
11
|
+
* Whether a chart lists records rather than aggregates, and so needs an
|
|
12
|
+
* `ungrouped` query.
|
|
13
|
+
*
|
|
14
|
+
* Reads the eager registry so the query builders need no chart-type switch.
|
|
15
|
+
*/
|
|
16
|
+
export declare function isRecordGrainChart(chartType: string): boolean;
|
|
10
17
|
/**
|
|
11
18
|
* Register a custom chart config into the registry.
|
|
12
19
|
* Used by the chart plugin system.
|
|
@@ -18,6 +18,13 @@ export interface AxisDropZoneConfig {
|
|
|
18
18
|
emptyText?: string;
|
|
19
19
|
/** Enable L/R axis toggle for items in this drop zone (for dual Y-axis support) */
|
|
20
20
|
enableDualAxis?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Keep this zone out of automatic chart-config inference (the agent's
|
|
23
|
+
* `inferChartConfig`). For zones whose meaning is subtractive or opt-in — the
|
|
24
|
+
* records table's hidden columns being the case in point — filling them from
|
|
25
|
+
* the query changes what renders rather than completing a partial config.
|
|
26
|
+
*/
|
|
27
|
+
excludeFromInference?: boolean;
|
|
21
28
|
}
|
|
22
29
|
/**
|
|
23
30
|
* Configuration for a single display option
|
|
@@ -28,7 +35,7 @@ export interface DisplayOptionConfig {
|
|
|
28
35
|
/** Display label for the option */
|
|
29
36
|
label: string;
|
|
30
37
|
/** Type of input control to render */
|
|
31
|
-
type: 'boolean' | 'string' | 'number' | 'select' | 'color' | 'paletteColor' | 'axisFormat' | 'stringArray' | 'buttonGroup' | 'thresholdBands';
|
|
38
|
+
type: 'boolean' | 'string' | 'number' | 'select' | 'color' | 'paletteColor' | 'axisFormat' | 'stringArray' | 'buttonGroup' | 'thresholdBands' | 'columnFormats' | 'rowLink';
|
|
32
39
|
/** Default value for the option */
|
|
33
40
|
defaultValue?: any;
|
|
34
41
|
/** Placeholder text for string/number inputs */
|
|
@@ -125,6 +132,15 @@ export interface ChartTypeConfig {
|
|
|
125
132
|
* Omit to mean "always available".
|
|
126
133
|
*/
|
|
127
134
|
isAvailable?: (ctx: ChartAvailabilityContext) => ChartAvailability;
|
|
135
|
+
/**
|
|
136
|
+
* This chart lists individual records rather than aggregates, so the query
|
|
137
|
+
* built for it must be `ungrouped`.
|
|
138
|
+
*
|
|
139
|
+
* Declared here rather than switched on a chart type inside the query
|
|
140
|
+
* builders, and read from the eager registry so those stay data-driven — and
|
|
141
|
+
* so a custom chart can opt in through the same flag.
|
|
142
|
+
*/
|
|
143
|
+
recordGrain?: boolean;
|
|
128
144
|
}
|
|
129
145
|
/**
|
|
130
146
|
* Registry of all chart type configurations
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
import { CubeQuery, CubeApiOptions, CubeResultSet, ExplainResult, ExplainOptions } from '../types.js';
|
|
1
|
+
import { CubeQuery, CubeApiOptions, CubeResultSet, CubeValidationIssue, ExplainResult, ExplainOptions } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* A failed query, carrying the server's structured validation detail when it
|
|
4
|
+
* sent any. A caller can then react to one dead member — dropping a column for
|
|
5
|
+
* a deleted attribute, say — instead of only seeing prose.
|
|
6
|
+
*/
|
|
7
|
+
export declare class CubeQueryError extends Error {
|
|
8
|
+
readonly status?: number;
|
|
9
|
+
readonly issues?: CubeValidationIssue[];
|
|
10
|
+
constructor(message: string, status?: number, issues?: CubeValidationIssue[]);
|
|
11
|
+
}
|
|
2
12
|
export declare class CubeClient {
|
|
3
13
|
private apiUrl;
|
|
4
14
|
private headers;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { ChartType, ChartDisplayConfig, ColorPalette } from '../../types.js';
|
|
1
|
+
import { ChartAxisConfig, ChartType, ChartDisplayConfig, ColorPalette } from '../../types.js';
|
|
2
2
|
interface AnalysisDisplayConfigPanelProps {
|
|
3
3
|
chartType: ChartType;
|
|
4
4
|
displayConfig: ChartDisplayConfig;
|
|
5
5
|
colorPalette?: ColorPalette;
|
|
6
|
+
/** Passed to options that are keyed by field, such as the records table's column formats. */
|
|
7
|
+
chartConfig?: ChartAxisConfig;
|
|
6
8
|
onDisplayConfigChange: (config: ChartDisplayConfig) => void;
|
|
7
9
|
/** Keys to exclude from displayOptionsConfig rendering (e.g., ['content'] when content is managed elsewhere) */
|
|
8
10
|
excludeKeys?: string[];
|
|
9
11
|
}
|
|
10
|
-
export default function AnalysisDisplayConfigPanel({ chartType, displayConfig, colorPalette, onDisplayConfigChange, excludeKeys, }: AnalysisDisplayConfigPanelProps): import("react").JSX.Element;
|
|
12
|
+
export default function AnalysisDisplayConfigPanel({ chartType, displayConfig, colorPalette, chartConfig, onDisplayConfigChange, excludeKeys, }: AnalysisDisplayConfigPanelProps): import("react").JSX.Element;
|
|
11
13
|
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ChartAxisConfig, ColorPalette, ColumnFormatConfig } from '../../types.js';
|
|
2
|
+
interface ColumnFormatsEditorProps {
|
|
3
|
+
value: Record<string, ColumnFormatConfig>;
|
|
4
|
+
chartConfig?: ChartAxisConfig;
|
|
5
|
+
colorPalette?: ColorPalette;
|
|
6
|
+
onChange: (value: Record<string, ColumnFormatConfig> | undefined) => void;
|
|
7
|
+
t: (key: string, params?: Record<string, string | number>) => string;
|
|
8
|
+
}
|
|
9
|
+
export default function ColumnFormatsEditor({ value, chartConfig, colorPalette, onChange, t }: ColumnFormatsEditorProps): import("react").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { ChartDisplayConfig, ColorPalette } from '../../types.js';
|
|
1
|
+
import { ChartAxisConfig, ChartDisplayConfig, ColorPalette } from '../../types.js';
|
|
2
2
|
import { DisplayOptionConfig } from '../../charts/chartConfigs.js';
|
|
3
3
|
interface DisplayOptionControlProps {
|
|
4
4
|
option: DisplayOptionConfig;
|
|
5
5
|
displayConfig: ChartDisplayConfig;
|
|
6
6
|
colorPalette?: ColorPalette;
|
|
7
|
+
chartConfig?: ChartAxisConfig;
|
|
7
8
|
onDisplayConfigChange: (config: ChartDisplayConfig) => void;
|
|
8
9
|
}
|
|
9
|
-
export default function DisplayOptionControl({ option, displayConfig, colorPalette, onDisplayConfigChange, }: DisplayOptionControlProps): import("react").JSX.Element | null;
|
|
10
|
+
export default function DisplayOptionControl({ option, displayConfig, colorPalette, chartConfig, onDisplayConfigChange, }: DisplayOptionControlProps): import("react").JSX.Element | null;
|
|
10
11
|
export {};
|
|
@@ -4,7 +4,13 @@ import { MetricItem, BreakdownItem } from '../types.js';
|
|
|
4
4
|
* Convert metrics and breakdowns to CubeQuery format
|
|
5
5
|
* Handles comparison mode by building compareDateRange for time dimensions
|
|
6
6
|
*/
|
|
7
|
-
export declare function buildCubeQuery(metrics: MetricItem[], breakdowns: BreakdownItem[], filters: Filter[], order?: Record<string, 'asc' | 'desc'>, preserveComparisonFilters?: boolean, limit?: number
|
|
7
|
+
export declare function buildCubeQuery(metrics: MetricItem[], breakdowns: BreakdownItem[], filters: Filter[], order?: Record<string, 'asc' | 'desc'>, preserveComparisonFilters?: boolean, limit?: number,
|
|
8
|
+
/**
|
|
9
|
+
* Record-grain charts list rows rather than aggregates — see
|
|
10
|
+
* `ChartTypeConfig.recordGrain`. Without this, editing a records-table
|
|
11
|
+
* portlet in the builder silently rebuilds its query as a grouped one.
|
|
12
|
+
*/
|
|
13
|
+
ungrouped?: boolean): CubeQuery;
|
|
8
14
|
/**
|
|
9
15
|
* Check if a query has any content
|
|
10
16
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChartAxisConfig, ChartDisplayConfig, ChartType, CubeQuery } from '../../types.js';
|
|
1
|
+
import { ChartAxisConfig, ChartDisplayConfig, ChartPagination, ChartType, CubeQuery } from '../../types.js';
|
|
2
2
|
import { FlowChartData } from '../../types/flow.js';
|
|
3
3
|
import { RetentionChartData } from '../../types/retention.js';
|
|
4
4
|
import { ColorPalette } from '../../utils/colorPalettes.js';
|
|
@@ -22,6 +22,7 @@ export interface PortletChartProps {
|
|
|
22
22
|
chartConfig?: ChartAxisConfig;
|
|
23
23
|
displayConfig?: ChartDisplayConfig;
|
|
24
24
|
activeQuery: CubeQuery | null;
|
|
25
|
+
pagination?: ChartPagination;
|
|
25
26
|
colorPalette?: ColorPalette;
|
|
26
27
|
drillEnabled: boolean;
|
|
27
28
|
currentChartConfig?: ChartAxisConfig | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChartAxisConfig, ChartDisplayConfig, ChartType, CubeQuery } from '../../types.js';
|
|
1
|
+
import { ChartAxisConfig, ChartDisplayConfig, ChartPagination, ChartType, CubeQuery } from '../../types.js';
|
|
2
2
|
import { FlowChartData } from '../../types/flow.js';
|
|
3
3
|
import { RetentionChartData } from '../../types/retention.js';
|
|
4
4
|
import { ColorPalette } from '../../utils/colorPalettes.js';
|
|
@@ -26,6 +26,9 @@ export interface PortletChartViewProps {
|
|
|
26
26
|
flowChartData: FlowChartData | null;
|
|
27
27
|
retentionChartData: RetentionChartData | null;
|
|
28
28
|
activeQuery: CubeQuery | null;
|
|
29
|
+
pagination?: ChartPagination;
|
|
30
|
+
/** Members dropped because the model no longer has them; surfaced as a note. */
|
|
31
|
+
droppedMembers?: string[];
|
|
29
32
|
drill: DrillInteraction;
|
|
30
33
|
isDrillEnabled: boolean;
|
|
31
34
|
onNavigateBack: () => void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CubeQuery } from '../../types.js';
|
|
2
|
+
export interface UsePortletDeadMembersParams {
|
|
3
|
+
queryObject: CubeQuery | null;
|
|
4
|
+
/** The error from the last attempt, if it failed. */
|
|
5
|
+
error: unknown;
|
|
6
|
+
}
|
|
7
|
+
export interface UsePortletDeadMembersResult {
|
|
8
|
+
/** The query with dead members removed — the original when there are none. */
|
|
9
|
+
query: CubeQuery | null;
|
|
10
|
+
/** Members dropped so far, for the note shown above the chart. */
|
|
11
|
+
droppedMembers: string[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Pull the prunable members out of a failed query, or `null` when the failure
|
|
15
|
+
* is not one we may recover from.
|
|
16
|
+
*
|
|
17
|
+
* A single unknown *filter* member makes the whole error unrecoverable, even
|
|
18
|
+
* alongside prunable ones: re-running without the dead columns would still
|
|
19
|
+
* carry the dead filter.
|
|
20
|
+
*/
|
|
21
|
+
export declare function prunableMembers(error: unknown): string[] | null;
|
|
22
|
+
/** Remove members from everything that projects or orders by them. */
|
|
23
|
+
export declare function withoutMembers(query: CubeQuery, members: string[]): CubeQuery;
|
|
24
|
+
export declare function usePortletDeadMembers({ queryObject, error }: UsePortletDeadMembersParams): UsePortletDeadMembersResult;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ChartPagination, ChartType, CubeQuery } from '../../types.js';
|
|
2
|
+
/** Fixed page sizes, matching the records table's own `pageSize` option. */
|
|
3
|
+
export declare const PAGE_SIZE_OPTIONS: number[];
|
|
4
|
+
export interface UsePortletPaginationParams {
|
|
5
|
+
chartType: ChartType;
|
|
6
|
+
/** The query to paginate — the drilled query when one is active, else the base query. */
|
|
7
|
+
activeQuery: CubeQuery | null;
|
|
8
|
+
/** Authored page size from the portlet's display config. */
|
|
9
|
+
pageSize?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface UsePortletPaginationResult {
|
|
12
|
+
/** `activeQuery` with limit/offset/order/total merged in, or it unchanged when paging is off. */
|
|
13
|
+
paginatedQuery: CubeQuery | null;
|
|
14
|
+
/**
|
|
15
|
+
* Passed to the chart as `ChartProps.pagination`; undefined when paging is
|
|
16
|
+
* off. `total` is left unset here — it arrives with the response, so the
|
|
17
|
+
* caller fills it in from the result set.
|
|
18
|
+
*/
|
|
19
|
+
pagination?: Omit<ChartPagination, 'total'>;
|
|
20
|
+
}
|
|
21
|
+
export declare function usePortletPagination({ chartType, activeQuery, pageSize: authoredPageSize }: UsePortletPaginationParams): UsePortletPaginationResult;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ChartTypeConfig } from '../../charts/chartConfigs.js';
|
|
2
|
+
/**
|
|
3
|
+
* Configuration for the records table.
|
|
4
|
+
*
|
|
5
|
+
* Eager metadata (`label`, `description`, `useCase`, `isAvailable`) lives in the
|
|
6
|
+
* unified `chartRegistry` entry — see `src/client/charts/chartRegistry.ts`. This
|
|
7
|
+
* file owns the lazy-loaded shape: drop zones, display options, clickable
|
|
8
|
+
* elements, validation.
|
|
9
|
+
*/
|
|
10
|
+
export declare const recordsTableConfig: ChartTypeConfig;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ChartProps } from '../../types.js';
|
|
3
|
+
declare const RecordsTable: React.MemoExoticComponent<({ data, chartConfig, displayConfig, queryObject, colorPalette, height, onDataPointClick, drillEnabled, pagination }: ChartProps) => React.JSX.Element>;
|
|
4
|
+
export default RecordsTable;
|