drizzle-cube 0.6.1 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/ActivityGridChart.config-BtECymia.cjs +1 -0
- package/dist/adapters/ActivityGridChart.config-CTd5HYjI.js +2 -0
- package/dist/adapters/AreaChart.config-1B8iQnfn.js +2 -0
- package/dist/adapters/AreaChart.config-hnncyQL4.cjs +1 -0
- package/dist/adapters/BarChart.config-C-QCf1rL.cjs +1 -0
- package/dist/adapters/BarChart.config-CFelK1qP.js +2 -0
- package/dist/adapters/BoxPlotChart.config-CD9WEPyF.js +2 -0
- package/dist/adapters/BoxPlotChart.config-DEbLA0BX.cjs +1 -0
- package/dist/adapters/BubbleChart.config-B_M4hzzV.js +2 -0
- package/dist/adapters/BubbleChart.config-dRZZlAke.cjs +1 -0
- package/dist/adapters/CandlestickChart.config-Dsil2Fop.cjs +1 -0
- package/dist/adapters/CandlestickChart.config-fuhyFvob.js +2 -0
- package/dist/adapters/DataTable.config-q2gqBi6t.cjs +1 -0
- package/dist/adapters/DataTable.config-wIQnHX5R.js +2 -0
- package/dist/adapters/FunnelChart.config-Dz710ssx.js +2 -0
- package/dist/adapters/FunnelChart.config-YNP9CeS-.cjs +1 -0
- package/dist/adapters/GaugeChart.config-BG9FcMCn.cjs +1 -0
- package/dist/adapters/GaugeChart.config-CgwniXkd.js +2 -0
- package/dist/adapters/HeatMapChart.config-1zSMXXoN.cjs +1 -0
- package/dist/adapters/HeatMapChart.config-YVEWx6s5.js +2 -0
- package/dist/adapters/KpiDelta.config-BWvYXuFp.cjs +1 -0
- package/dist/adapters/KpiDelta.config-C_dYM64q.js +2 -0
- package/dist/adapters/KpiNumber.config-CXg6toZG.js +2 -0
- package/dist/adapters/KpiNumber.config-CZmV-yU1.cjs +1 -0
- package/dist/adapters/KpiText.config-BY-SJvAF.js +2 -0
- package/dist/adapters/KpiText.config-GSIxy0CE.cjs +1 -0
- package/dist/adapters/LineChart.config-CJtF8SOu.js +2 -0
- package/dist/adapters/LineChart.config-d0y60gw9.cjs +1 -0
- package/dist/adapters/MarkdownChart.config-B6w0spya.cjs +1 -0
- package/dist/adapters/MarkdownChart.config-BuIQcWOn.js +2 -0
- package/dist/adapters/MeasureProfileChart.config-Bo2n5Ae5.cjs +1 -0
- package/dist/adapters/MeasureProfileChart.config-C5d34lsc.js +2 -0
- package/dist/adapters/PieChart.config-CDxfXCIt.cjs +1 -0
- package/dist/adapters/PieChart.config-CuZxQc5m.js +2 -0
- package/dist/adapters/RadarChart.config-DpdVWyh5.cjs +1 -0
- package/dist/adapters/RadarChart.config-KrxwaaGu.js +2 -0
- package/dist/adapters/RadialBarChart.config-DpRZd0FW.js +2 -0
- package/dist/adapters/RadialBarChart.config-faIY4jpE.cjs +1 -0
- package/dist/adapters/RetentionCombinedChart.config-CUnScqnS.cjs +1 -0
- package/dist/adapters/RetentionCombinedChart.config-Dd8FuawP.js +2 -0
- package/dist/adapters/RetentionHeatmap.config-CPd6GeoQ.js +2 -0
- package/dist/adapters/RetentionHeatmap.config-CPlHbLom.cjs +1 -0
- package/dist/adapters/SankeyChart.config-DbIUqi-H.cjs +1 -0
- package/dist/adapters/SankeyChart.config-kzAnW0C7.js +2 -0
- package/dist/adapters/ScatterChart.config-4Okvn27v.js +2 -0
- package/dist/adapters/ScatterChart.config-4f9nNw3e.cjs +1 -0
- package/dist/adapters/SunburstChart.config-BsUQkIM_.js +2 -0
- package/dist/adapters/SunburstChart.config-lvnYkWs7.cjs +1 -0
- package/dist/adapters/TreeMapChart.config-S0qsgAFW.js +2 -0
- package/dist/adapters/TreeMapChart.config-jbwKsTYt.cjs +1 -0
- package/dist/adapters/WaterfallChart.config-CDQ74-pS.cjs +1 -0
- package/dist/adapters/WaterfallChart.config-XdtH-O5g.js +2 -0
- package/dist/adapters/chartConfigHelpers-CcvqrIWF.js +72 -0
- package/dist/adapters/chartConfigHelpers-DHQB-_v5.cjs +1 -0
- package/dist/adapters/{locale-ZLUUNUxr.cjs → compiler-ChGO4ZLU.cjs} +1 -1
- package/dist/adapters/{locale-DDvZDFVn.js → compiler-LKTN9PTt.js} +2 -21
- package/dist/adapters/core/cube-http-handler.d.ts +27 -0
- package/dist/adapters/core/http-port.d.ts +39 -0
- package/dist/adapters/core/index.cjs +1 -0
- package/dist/adapters/core/index.d.ts +11 -0
- package/dist/adapters/core/index.js +2 -0
- package/dist/adapters/core/mcp-handler.d.ts +13 -0
- package/dist/adapters/core/rest-handlers.d.ts +14 -0
- package/dist/adapters/core/security-context.d.ts +17 -0
- package/dist/adapters/core-Bbchr0ui.js +244 -0
- package/dist/adapters/core-F1pCQPde.cjs +1 -0
- package/dist/adapters/express/index.cjs +2 -2
- package/dist/adapters/express/index.js +93 -201
- package/dist/adapters/fastify/index.cjs +2 -2
- package/dist/adapters/fastify/index.js +79 -217
- package/dist/adapters/handler-DRZb2ip6.cjs +25 -0
- package/dist/adapters/{handler-CfgE0JSL.js → handler-u8FyzPBT.js} +1572 -1500
- package/dist/adapters/hono/index.cjs +2 -2
- package/dist/adapters/hono/index.js +69 -225
- package/dist/adapters/mcp-tools.cjs +1 -1
- package/dist/adapters/mcp-tools.js +1 -1
- package/dist/adapters/mcp-transport-Bw_zqky2.js +591 -0
- package/dist/adapters/mcp-transport-CNIPoe1i.cjs +40 -0
- package/dist/adapters/nextjs/index.cjs +1 -1
- package/dist/adapters/nextjs/index.d.ts +8 -9
- package/dist/adapters/nextjs/index.js +181 -288
- package/dist/adapters/nextjs/mcp-handler.d.ts +0 -28
- package/dist/adapters/{openai-D0musiYP.cjs → openai-B4kAJTSD.cjs} +3 -3
- package/dist/adapters/{openai-vXvLni8v.cjs → openai-Cdf2wWZA.cjs} +1 -1
- package/dist/adapters/{openai-B5jEiqiB.js → openai-CmMzrs1Y.js} +18 -2
- package/dist/adapters/{openai-cDlFSTk6.js → openai-DhzGY9R4.js} +1 -1
- package/dist/cjs/adapters/core/cube-http-handler.d.ts +27 -0
- package/dist/cjs/adapters/core/http-port.d.ts +39 -0
- package/dist/cjs/adapters/core/index.d.ts +11 -0
- package/dist/cjs/adapters/core/mcp-handler.d.ts +13 -0
- package/dist/cjs/adapters/core/rest-handlers.d.ts +14 -0
- package/dist/cjs/adapters/core/security-context.d.ts +17 -0
- package/dist/cjs/adapters/express/index.d.ts +114 -0
- package/dist/cjs/adapters/fastify/index.d.ts +113 -0
- package/dist/cjs/adapters/hono/agent-handler.d.ts +9 -0
- package/dist/cjs/adapters/hono/index.d.ts +120 -0
- package/dist/cjs/adapters/locale.d.ts +8 -0
- package/dist/cjs/adapters/mcp-tools-handlers.d.ts +18 -0
- package/dist/cjs/adapters/mcp-tools.d.ts +134 -0
- package/dist/cjs/adapters/mcp-transport.d.ts +158 -0
- package/dist/cjs/adapters/nextjs/index.d.ts +195 -0
- package/dist/cjs/adapters/nextjs/mcp-handler.d.ts +8 -0
- package/dist/cjs/adapters/types.d.ts +41 -0
- package/dist/cjs/adapters/utils.d.ts +354 -0
- package/dist/cjs/client/adapters/adapterRegistry.d.ts +44 -0
- package/dist/cjs/client/adapters/flowModeAdapter.d.ts +3 -0
- package/dist/cjs/client/adapters/funnelModeAdapter.d.ts +19 -0
- package/dist/cjs/client/adapters/index.d.ts +29 -0
- package/dist/cjs/client/adapters/modeAdapter.d.ts +117 -0
- package/dist/cjs/client/adapters/queryModeAdapter.d.ts +16 -0
- package/dist/cjs/client/adapters/retentionModeAdapter.d.ts +3 -0
- package/dist/cjs/client/charts/ChartLoader.d.ts +69 -0
- package/dist/cjs/client/charts/chartComponentRegistry.d.ts +38 -0
- package/dist/cjs/client/charts/chartConfigHelpers.d.ts +38 -0
- package/dist/cjs/client/charts/chartConfigRegistry.d.ts +19 -0
- package/dist/cjs/client/charts/chartConfigs.d.ts +142 -0
- package/dist/cjs/client/charts/chartPlugin.d.ts +73 -0
- package/dist/cjs/client/charts/chartRegistry.d.ts +73 -0
- package/dist/cjs/client/charts/lazyChartConfigRegistry.d.ts +100 -0
- package/dist/cjs/client/charts.d.ts +17 -0
- package/dist/cjs/client/client/BatchCoordinator.d.ts +38 -0
- package/dist/cjs/client/client/CubeClient.d.ts +32 -0
- package/dist/cjs/client/components/AIAssistant/constants.d.ts +11 -0
- package/dist/cjs/client/components/AIAssistant/index.d.ts +10 -0
- package/dist/cjs/client/components/AIAssistant/types.d.ts +49 -0
- package/dist/cjs/client/components/AIAssistant/utils.d.ts +17 -0
- package/dist/cjs/client/components/AgenticNotebook/AgentChatPanel.d.ts +27 -0
- package/dist/cjs/client/components/AgenticNotebook/ChatInput.d.ts +14 -0
- package/dist/cjs/client/components/AgenticNotebook/ChatMessage.d.ts +9 -0
- package/dist/cjs/client/components/AgenticNotebook/NotebookCanvas.d.ts +6 -0
- package/dist/cjs/client/components/AgenticNotebook/NotebookMarkdownBlock.d.ts +12 -0
- package/dist/cjs/client/components/AgenticNotebook/NotebookPortletBlock.d.ts +15 -0
- package/dist/cjs/client/components/AgenticNotebook/agentChatParts.d.ts +34 -0
- package/dist/cjs/client/components/AgenticNotebook/chatMessageParts.d.ts +39 -0
- package/dist/cjs/client/components/AgenticNotebook/index.d.ts +56 -0
- package/dist/cjs/client/components/AgenticNotebook/useAgentChatController.d.ts +25 -0
- package/dist/cjs/client/components/AgenticNotebook/useNotebookAutosave.d.ts +12 -0
- package/dist/cjs/client/components/AnalysisBuilder/AnalysisAIPanel.d.ts +25 -0
- package/dist/cjs/client/components/AnalysisBuilder/AnalysisAxisDropZone.d.ts +29 -0
- package/dist/cjs/client/components/AnalysisBuilder/AnalysisChartConfigPanel.d.ts +18 -0
- package/dist/cjs/client/components/AnalysisBuilder/AnalysisDisplayConfigPanel.d.ts +11 -0
- package/dist/cjs/client/components/AnalysisBuilder/AnalysisFilterGroup.d.ts +20 -0
- package/dist/cjs/client/components/AnalysisBuilder/AnalysisFilterItem.d.ts +14 -0
- package/dist/cjs/client/components/AnalysisBuilder/AnalysisFilterSection.d.ts +16 -0
- package/dist/cjs/client/components/AnalysisBuilder/AnalysisModeErrorBoundary.d.ts +27 -0
- package/dist/cjs/client/components/AnalysisBuilder/AnalysisQueryPanel.d.ts +12 -0
- package/dist/cjs/client/components/AnalysisBuilder/AnalysisQueryPanelParts.d.ts +64 -0
- package/dist/cjs/client/components/AnalysisBuilder/AnalysisResultsHeader.d.ts +67 -0
- package/dist/cjs/client/components/AnalysisBuilder/AnalysisResultsPanel.d.ts +14 -0
- package/dist/cjs/client/components/AnalysisBuilder/AnalysisTypeSelector.d.ts +17 -0
- package/dist/cjs/client/components/AnalysisBuilder/BreakdownComparisonToggle.d.ts +13 -0
- package/dist/cjs/client/components/AnalysisBuilder/BreakdownItemCard.d.ts +12 -0
- package/dist/cjs/client/components/AnalysisBuilder/BreakdownRow.d.ts +26 -0
- package/dist/cjs/client/components/AnalysisBuilder/BreakdownSection.d.ts +9 -0
- package/dist/cjs/client/components/AnalysisBuilder/DisplayOptionControl.d.ts +10 -0
- package/dist/cjs/client/components/AnalysisBuilder/ExecutionPlanPanel.d.ts +49 -0
- package/dist/cjs/client/components/AnalysisBuilder/ExecutionPlanPanelParts.d.ts +22 -0
- package/dist/cjs/client/components/AnalysisBuilder/ExplainAIPanel.d.ts +16 -0
- package/dist/cjs/client/components/AnalysisBuilder/FieldDetailPanel.d.ts +4 -0
- package/dist/cjs/client/components/AnalysisBuilder/FieldSearchItem.d.ts +6 -0
- package/dist/cjs/client/components/AnalysisBuilder/FieldSearchModal.d.ts +2 -0
- package/dist/cjs/client/components/AnalysisBuilder/FieldSearchResults.d.ts +16 -0
- package/dist/cjs/client/components/AnalysisBuilder/FilterConfigModal.d.ts +17 -0
- package/dist/cjs/client/components/AnalysisBuilder/FilterValueInput.d.ts +63 -0
- package/dist/cjs/client/components/AnalysisBuilder/FlowConfigPanel.d.ts +28 -0
- package/dist/cjs/client/components/AnalysisBuilder/FlowDepthControls.d.ts +10 -0
- package/dist/cjs/client/components/AnalysisBuilder/FlowModeContent.d.ts +57 -0
- package/dist/cjs/client/components/AnalysisBuilder/FlowVisualizationPicker.d.ts +7 -0
- package/dist/cjs/client/components/AnalysisBuilder/FunnelBindingKeySelector.d.ts +21 -0
- package/dist/cjs/client/components/AnalysisBuilder/FunnelConfigPanel.d.ts +24 -0
- package/dist/cjs/client/components/AnalysisBuilder/FunnelModeContent.d.ts +48 -0
- package/dist/cjs/client/components/AnalysisBuilder/FunnelStepCard.d.ts +25 -0
- package/dist/cjs/client/components/AnalysisBuilder/FunnelStepList.d.ts +26 -0
- package/dist/cjs/client/components/AnalysisBuilder/LegacyBooleanOptions.d.ts +8 -0
- package/dist/cjs/client/components/AnalysisBuilder/LimitSection.d.ts +14 -0
- package/dist/cjs/client/components/AnalysisBuilder/MetricItemCard.d.ts +11 -0
- package/dist/cjs/client/components/AnalysisBuilder/MetricRow.d.ts +23 -0
- package/dist/cjs/client/components/AnalysisBuilder/MetricsSection.d.ts +9 -0
- package/dist/cjs/client/components/AnalysisBuilder/RetentionConfigPanel.d.ts +36 -0
- package/dist/cjs/client/components/AnalysisBuilder/RetentionModeContent.d.ts +71 -0
- package/dist/cjs/client/components/AnalysisBuilder/SectionHeading.d.ts +12 -0
- package/dist/cjs/client/components/AnalysisBuilder/SortToggleButton.d.ts +13 -0
- package/dist/cjs/client/components/AnalysisBuilder/StringArrayInput.d.ts +17 -0
- package/dist/cjs/client/components/AnalysisBuilder/filterConfigModalUtils.d.ts +30 -0
- package/dist/cjs/client/components/AnalysisBuilder/hooks/useAnalysisBuilderImperativeHandle.d.ts +13 -0
- package/dist/cjs/client/components/AnalysisBuilder/hooks/useDragReorder.d.ts +25 -0
- package/dist/cjs/client/components/AnalysisBuilder/hooks/useFieldSearchKeyboard.d.ts +11 -0
- package/dist/cjs/client/components/AnalysisBuilder/index.d.ts +9 -0
- package/dist/cjs/client/components/AnalysisBuilder/types.d.ts +851 -0
- package/dist/cjs/client/components/AnalysisBuilder/utils/axisConfigUtils.d.ts +23 -0
- package/dist/cjs/client/components/AnalysisBuilder/utils/executionPlanMarkdown.d.ts +8 -0
- package/dist/cjs/client/components/AnalysisBuilder/utils/fieldUtils.d.ts +69 -0
- package/dist/cjs/client/components/AnalysisBuilder/utils/filterUtils.d.ts +19 -0
- package/dist/cjs/client/components/AnalysisBuilder/utils/idUtils.d.ts +11 -0
- package/dist/cjs/client/components/AnalysisBuilder/utils/index.d.ts +11 -0
- package/dist/cjs/client/components/AnalysisBuilder/utils/queryUtils.d.ts +11 -0
- package/dist/cjs/client/components/AnalysisBuilder/utils/recentFieldsUtils.d.ts +14 -0
- package/dist/cjs/client/components/AnalysisBuilder/utils/resultsPanelDerive.d.ts +68 -0
- package/dist/cjs/client/components/AnalysisBuilder/utils/shareStateUtils.d.ts +68 -0
- package/dist/cjs/client/components/AnalysisBuilder/utils/sortUtils.d.ts +7 -0
- package/dist/cjs/client/components/AnalysisBuilder/utils/storageUtils.d.ts +44 -0
- package/dist/cjs/client/components/AnalysisBuilderLazy.d.ts +4 -0
- package/dist/cjs/client/components/AnalyticsDashboard.d.ts +2 -0
- package/dist/cjs/client/components/AnalyticsPage.d.ts +1 -0
- package/dist/cjs/client/components/AnalyticsPortlet.d.ts +10 -0
- package/dist/cjs/client/components/ChartErrorBoundary.d.ts +21 -0
- package/dist/cjs/client/components/ChartTypeSelector.d.ts +15 -0
- package/dist/cjs/client/components/ColorPaletteSelector.d.ts +11 -0
- package/dist/cjs/client/components/ConfirmModal.d.ts +30 -0
- package/dist/cjs/client/components/DashboardEditModal.d.ts +15 -0
- package/dist/cjs/client/components/DashboardFilterPanel.d.ts +15 -0
- package/dist/cjs/client/components/DashboardFilters/CompactFilterBar.d.ts +13 -0
- package/dist/cjs/client/components/DashboardFilters/CompactFilterBarParts.d.ts +26 -0
- package/dist/cjs/client/components/DashboardFilters/CustomDateDropdown.d.ts +10 -0
- package/dist/cjs/client/components/DashboardFilters/DashboardFilterConfigModal.d.ts +20 -0
- package/dist/cjs/client/components/DashboardFilters/DashboardFilterConfigModalParts.d.ts +27 -0
- package/dist/cjs/client/components/DashboardFilters/DashboardFilterItem.d.ts +14 -0
- package/dist/cjs/client/components/DashboardFilters/DashboardFilterValueInput.d.ts +39 -0
- package/dist/cjs/client/components/DashboardFilters/DatePresetChips.d.ts +8 -0
- package/dist/cjs/client/components/DashboardFilters/EditModeFilterList.d.ts +13 -0
- package/dist/cjs/client/components/DashboardFilters/FilterChip.d.ts +12 -0
- package/dist/cjs/client/components/DashboardFilters/FilterEditModal.d.ts +15 -0
- package/dist/cjs/client/components/DashboardFilters/FilterValuePopover.d.ts +11 -0
- package/dist/cjs/client/components/DashboardFilters/ReadOnlyFilterList.d.ts +13 -0
- package/dist/cjs/client/components/DashboardFilters/XTDDropdown.d.ts +10 -0
- package/dist/cjs/client/components/DashboardFilters/dashboardFilterConfigModalUtils.d.ts +21 -0
- package/dist/cjs/client/components/DashboardFilters/useCompactFilterBar.d.ts +19 -0
- package/dist/cjs/client/components/DashboardFilters/useDashboardFilterConfigModal.d.ts +69 -0
- package/dist/cjs/client/components/DashboardFilters/useDateRangeState.d.ts +19 -0
- package/dist/cjs/client/components/DashboardFilters/useFilterDropdowns.d.ts +21 -0
- package/dist/cjs/client/components/DashboardFilters/useFilterValueFetch.d.ts +23 -0
- package/dist/cjs/client/components/DashboardGrid.d.ts +22 -0
- package/dist/cjs/client/components/DashboardPortletCard.d.ts +4 -0
- package/dist/cjs/client/components/DashboardThumbnailPlaceholder.d.ts +13 -0
- package/dist/cjs/client/components/DataBrowser/DataBrowserSidebar.d.ts +16 -0
- package/dist/cjs/client/components/DataBrowser/DataBrowserTable.d.ts +16 -0
- package/dist/cjs/client/components/DataBrowser/DataBrowserToolbar.d.ts +22 -0
- package/dist/cjs/client/components/DataBrowser/index.d.ts +28 -0
- package/dist/cjs/client/components/DataHistogram.d.ts +27 -0
- package/dist/cjs/client/components/DebugModal.d.ts +17 -0
- package/dist/cjs/client/components/DrillBreadcrumb.d.ts +7 -0
- package/dist/cjs/client/components/DrillMenu.d.ts +8 -0
- package/dist/cjs/client/components/FloatingEditToolbar.d.ts +30 -0
- package/dist/cjs/client/components/LoadingIndicator.d.ts +16 -0
- package/dist/cjs/client/components/MobileStackedLayout.d.ts +14 -0
- package/dist/cjs/client/components/Modal.d.ts +16 -0
- package/dist/cjs/client/components/PortletAnalysisModal.d.ts +27 -0
- package/dist/cjs/client/components/PortletContainer.d.ts +10 -0
- package/dist/cjs/client/components/PortletFilterConfigModal.d.ts +13 -0
- package/dist/cjs/client/components/RowManagedLayout.d.ts +19 -0
- package/dist/cjs/client/components/ScaledGridWrapper.d.ts +12 -0
- package/dist/cjs/client/components/SchemaVisualization/CubeNode.d.ts +25 -0
- package/dist/cjs/client/components/SchemaVisualization/FieldDetailPanel.d.ts +15 -0
- package/dist/cjs/client/components/SchemaVisualization/RelationshipEdge.d.ts +13 -0
- package/dist/cjs/client/components/SchemaVisualization/SchemaVisualizationLazy.d.ts +3 -0
- package/dist/cjs/client/components/SchemaVisualization/index.d.ts +10 -0
- package/dist/cjs/client/components/SchemaVisualization/useERDLayout.d.ts +39 -0
- package/dist/cjs/client/components/SchemaVisualization/xyflowContext.d.ts +11 -0
- package/dist/cjs/client/components/TextPortletModal.d.ts +12 -0
- package/dist/cjs/client/components/analyticsPortlet/PortletChart.d.ts +31 -0
- package/dist/cjs/client/components/analyticsPortlet/PortletChartView.d.ts +35 -0
- package/dist/cjs/client/components/analyticsPortlet/PortletStates.d.ts +65 -0
- package/dist/cjs/client/components/analyticsPortlet/parsePortletQuery.d.ts +22 -0
- package/dist/cjs/client/components/analyticsPortlet/portletRenderState.d.ts +31 -0
- package/dist/cjs/client/components/analyticsPortlet/usePortletDebugData.d.ts +37 -0
- package/dist/cjs/client/components/analyticsPortlet/usePortletDrillState.d.ts +17 -0
- package/dist/cjs/client/components/analyticsPortlet/usePortletQueryResults.d.ts +37 -0
- package/dist/cjs/client/components/charts/ActivityGridChart.config.d.ts +10 -0
- package/dist/cjs/client/components/charts/ActivityGridChart.d.ts +4 -0
- package/dist/cjs/client/components/charts/ActivityGridChart.helpers.d.ts +33 -0
- package/dist/cjs/client/components/charts/ActivityGridChart.render.d.ts +31 -0
- package/dist/cjs/client/components/charts/AngledXAxisTick.d.ts +19 -0
- package/dist/cjs/client/components/charts/AreaChart.config.d.ts +10 -0
- package/dist/cjs/client/components/charts/AreaChart.d.ts +4 -0
- package/dist/cjs/client/components/charts/AxisFormatControls.d.ts +37 -0
- package/dist/cjs/client/components/charts/BarChart.config.d.ts +10 -0
- package/dist/cjs/client/components/charts/BarChart.d.ts +4 -0
- package/dist/cjs/client/components/charts/BarChart.helpers.d.ts +23 -0
- package/dist/cjs/client/components/charts/BarSeries.d.ts +29 -0
- package/dist/cjs/client/components/charts/BoxPlotChart.config.d.ts +10 -0
- package/dist/cjs/client/components/charts/BoxPlotChart.d.ts +4 -0
- package/dist/cjs/client/components/charts/BubbleChart.config.d.ts +10 -0
- package/dist/cjs/client/components/charts/BubbleChart.d.ts +4 -0
- package/dist/cjs/client/components/charts/BubbleChart.helpers.d.ts +43 -0
- package/dist/cjs/client/components/charts/BubbleChart.render.d.ts +21 -0
- package/dist/cjs/client/components/charts/CandlestickChart.config.d.ts +10 -0
- package/dist/cjs/client/components/charts/CandlestickChart.d.ts +4 -0
- package/dist/cjs/client/components/charts/ChartContainer.d.ts +7 -0
- package/dist/cjs/client/components/charts/ChartLegend.d.ts +7 -0
- package/dist/cjs/client/components/charts/ChartStates.d.ts +38 -0
- package/dist/cjs/client/components/charts/ChartTooltip.d.ts +7 -0
- package/dist/cjs/client/components/charts/DataTable.config.d.ts +10 -0
- package/dist/cjs/client/components/charts/DataTable.d.ts +4 -0
- package/dist/cjs/client/components/charts/FunnelChart.config.d.ts +14 -0
- package/dist/cjs/client/components/charts/FunnelChart.d.ts +11 -0
- package/dist/cjs/client/components/charts/FunnelChart.helpers.d.ts +25 -0
- package/dist/cjs/client/components/charts/FunnelViews.d.ts +16 -0
- package/dist/cjs/client/components/charts/GaugeChart.config.d.ts +10 -0
- package/dist/cjs/client/components/charts/GaugeChart.d.ts +4 -0
- package/dist/cjs/client/components/charts/HeatMapCanvas.d.ts +25 -0
- package/dist/cjs/client/components/charts/HeatMapChart.config.d.ts +13 -0
- package/dist/cjs/client/components/charts/HeatMapChart.d.ts +10 -0
- package/dist/cjs/client/components/charts/HeatMapChart.helpers.d.ts +64 -0
- package/dist/cjs/client/components/charts/KpiDelta.config.d.ts +10 -0
- package/dist/cjs/client/components/charts/KpiDelta.d.ts +4 -0
- package/dist/cjs/client/components/charts/KpiDelta.helpers.d.ts +20 -0
- package/dist/cjs/client/components/charts/KpiNumber.config.d.ts +10 -0
- package/dist/cjs/client/components/charts/KpiNumber.d.ts +4 -0
- package/dist/cjs/client/components/charts/KpiNumber.helpers.d.ts +30 -0
- package/dist/cjs/client/components/charts/KpiStates.d.ts +19 -0
- package/dist/cjs/client/components/charts/KpiText.config.d.ts +10 -0
- package/dist/cjs/client/components/charts/KpiText.d.ts +4 -0
- package/dist/cjs/client/components/charts/LineChart.config.d.ts +10 -0
- package/dist/cjs/client/components/charts/LineChart.d.ts +4 -0
- package/dist/cjs/client/components/charts/MarkdownChart.config.d.ts +10 -0
- package/dist/cjs/client/components/charts/MarkdownChart.d.ts +4 -0
- package/dist/cjs/client/components/charts/MeasureProfileChart.config.d.ts +10 -0
- package/dist/cjs/client/components/charts/MeasureProfileChart.d.ts +4 -0
- package/dist/cjs/client/components/charts/MissingDependencyFallback.d.ts +12 -0
- package/dist/cjs/client/components/charts/PieChart.config.d.ts +10 -0
- package/dist/cjs/client/components/charts/PieChart.d.ts +4 -0
- package/dist/cjs/client/components/charts/RadarChart.config.d.ts +10 -0
- package/dist/cjs/client/components/charts/RadarChart.d.ts +4 -0
- package/dist/cjs/client/components/charts/RadialBarChart.config.d.ts +10 -0
- package/dist/cjs/client/components/charts/RadialBarChart.d.ts +4 -0
- package/dist/cjs/client/components/charts/RetentionCombinedChart.config.d.ts +2 -0
- package/dist/cjs/client/components/charts/RetentionCombinedChart.d.ts +14 -0
- package/dist/cjs/client/components/charts/RetentionHeatmap.config.d.ts +2 -0
- package/dist/cjs/client/components/charts/RetentionHeatmap.d.ts +7 -0
- package/dist/cjs/client/components/charts/SankeyChart.config.d.ts +14 -0
- package/dist/cjs/client/components/charts/SankeyChart.d.ts +10 -0
- package/dist/cjs/client/components/charts/ScatterChart.config.d.ts +10 -0
- package/dist/cjs/client/components/charts/ScatterChart.d.ts +4 -0
- package/dist/cjs/client/components/charts/ScatterChart.helpers.d.ts +43 -0
- package/dist/cjs/client/components/charts/ScatterSeries.d.ts +17 -0
- package/dist/cjs/client/components/charts/ScatterTooltip.d.ts +21 -0
- package/dist/cjs/client/components/charts/SunburstChart.config.d.ts +14 -0
- package/dist/cjs/client/components/charts/SunburstChart.d.ts +10 -0
- package/dist/cjs/client/components/charts/TreeMapChart.config.d.ts +10 -0
- package/dist/cjs/client/components/charts/TreeMapChart.d.ts +4 -0
- package/dist/cjs/client/components/charts/TreeMapChart.helpers.d.ts +37 -0
- package/dist/cjs/client/components/charts/TreeMapContent.d.ts +24 -0
- package/dist/cjs/client/components/charts/TreeMapLegend.d.ts +13 -0
- package/dist/cjs/client/components/charts/WaterfallChart.config.d.ts +10 -0
- package/dist/cjs/client/components/charts/WaterfallChart.d.ts +4 -0
- package/dist/cjs/client/components/charts/cartesianChartHelpers.d.ts +126 -0
- package/dist/cjs/client/components/charts/chartAxisResolution.d.ts +32 -0
- package/dist/cjs/client/components/charts/chartScaffolding.d.ts +77 -0
- package/dist/cjs/client/components/charts/gaugeChartHelpers.d.ts +36 -0
- package/dist/cjs/client/components/charts/index.d.ts +25 -0
- package/dist/cjs/client/components/charts/kpiTextHelpers.d.ts +46 -0
- package/dist/cjs/client/components/charts/radarChartHelpers.d.ts +14 -0
- package/dist/cjs/client/components/charts/radialBarChartHelpers.d.ts +22 -0
- package/dist/cjs/client/components/charts/useChartDimensions.d.ts +20 -0
- package/dist/cjs/client/components/charts/useKpiDimensions.d.ts +30 -0
- package/dist/cjs/client/components/dashboard/DashboardContext.d.ts +113 -0
- package/dist/cjs/client/components/dashboard/DashboardCoordinator.d.ts +2 -0
- package/dist/cjs/client/components/dashboard/DashboardEditBar.d.ts +5 -0
- package/dist/cjs/client/components/dashboard/DashboardFilterBar.d.ts +8 -0
- package/dist/cjs/client/components/dashboard/DashboardGridSurface.d.ts +8 -0
- package/dist/cjs/client/components/dashboard/DashboardModals.d.ts +8 -0
- package/dist/cjs/client/components/dashboard/DashboardProvider.d.ts +2 -0
- package/dist/cjs/client/components/dashboard/DashboardToolbar.d.ts +11 -0
- package/dist/cjs/client/components/dashboard/LayoutModeToggle.d.ts +10 -0
- package/dist/cjs/client/components/dashboard/dashboardGridUtils.d.ts +17 -0
- package/dist/cjs/client/components/dashboard/index.d.ts +13 -0
- package/dist/cjs/client/components/dashboardPortletCard/FilterFieldChip.d.ts +12 -0
- package/dist/cjs/client/components/dashboardPortletCard/PortletCardHeader.d.ts +43 -0
- package/dist/cjs/client/components/dashboardPortletCard/cardStyles.d.ts +33 -0
- package/dist/cjs/client/components/dashboardPortletCard/filterField.d.ts +12 -0
- package/dist/cjs/client/components/dashboardPortletCard/propsEqual.d.ts +55 -0
- package/dist/cjs/client/components/dashboardPortletCard/usePortletCardActions.d.ts +16 -0
- package/dist/cjs/client/components/portletAnalysisModal/saveValidation.d.ts +8 -0
- package/dist/cjs/client/components/shared/DateRangeFilter.d.ts +4 -0
- package/dist/cjs/client/components/shared/DateRangeSelector.d.ts +13 -0
- package/dist/cjs/client/components/shared/FilterBuilder.d.ts +4 -0
- package/dist/cjs/client/components/shared/FilterGroup.d.ts +4 -0
- package/dist/cjs/client/components/shared/FilterItem.d.ts +4 -0
- package/dist/cjs/client/components/shared/FilterValueSelector.d.ts +4 -0
- package/dist/cjs/client/components/shared/dateRangeUtils.d.ts +40 -0
- package/dist/cjs/client/components/shared/filterDisplayUtils.d.ts +10 -0
- package/dist/cjs/client/components/shared/filterItem/FilterDateRangeSelector.d.ts +17 -0
- package/dist/cjs/client/components/shared/filterItem/FilterFieldDropdown.d.ts +16 -0
- package/dist/cjs/client/components/shared/filterItem/dateRangeSync.d.ts +14 -0
- package/dist/cjs/client/components/shared/filterItem/fieldVisuals.d.ts +5 -0
- package/dist/cjs/client/components/shared/filterValueSelector/FilterValueInputs.d.ts +55 -0
- package/dist/cjs/client/components/shared/filterValueSelector/useFilterValueSelectorState.d.ts +25 -0
- package/dist/cjs/client/components/shared/queryFieldUtils.d.ts +21 -0
- package/dist/cjs/client/components/shared/types.d.ts +60 -0
- package/dist/cjs/client/components/shared/utils.d.ts +71 -0
- package/dist/cjs/client/components.d.ts +17 -0
- package/dist/cjs/client/hooks/agentChatStream.d.ts +39 -0
- package/dist/cjs/client/hooks/analysisQueryExecutionModes.d.ts +133 -0
- package/dist/cjs/client/hooks/dashboard/layoutUtils.d.ts +7 -0
- package/dist/cjs/client/hooks/dashboard/useDashboardController.d.ts +53 -0
- package/dist/cjs/client/hooks/dashboard/useGridLayoutEngine.d.ts +10 -0
- package/dist/cjs/client/hooks/dashboard/useRowLayoutEngine.d.ts +18 -0
- package/dist/cjs/client/hooks/drillNavigation.d.ts +25 -0
- package/dist/cjs/client/hooks/queries/index.d.ts +20 -0
- package/dist/cjs/client/hooks/queries/useCubeLoadQuery.d.ts +85 -0
- package/dist/cjs/client/hooks/queries/useCubeMetaQuery.d.ts +51 -0
- package/dist/cjs/client/hooks/queries/useDryRunQuery.d.ts +153 -0
- package/dist/cjs/client/hooks/queries/useExplainAI.d.ts +62 -0
- package/dist/cjs/client/hooks/queries/useExplainQuery.d.ts +62 -0
- package/dist/cjs/client/hooks/queries/useFlowQuery.d.ts +72 -0
- package/dist/cjs/client/hooks/queries/useFunnelQuery.d.ts +20 -0
- package/dist/cjs/client/hooks/queries/useMultiCubeLoadQuery.d.ts +70 -0
- package/dist/cjs/client/hooks/queries/useRetentionQuery.d.ts +67 -0
- package/dist/cjs/client/hooks/useAgentChat.d.ts +60 -0
- package/dist/cjs/client/hooks/useAnalysisBuilderHook.d.ts +245 -0
- package/dist/cjs/client/hooks/useAnalysisEffects.d.ts +33 -0
- package/dist/{client/hooks/useAnalysisQueryExecution.d.ts → cjs/client/hooks/useAnalysisQuery.d.ts} +3 -3
- package/dist/cjs/client/hooks/useAnalysisState.d.ts +165 -0
- package/dist/cjs/client/hooks/useCubeFieldLabel.d.ts +16 -0
- package/dist/cjs/client/hooks/useDashboardHook.d.ts +123 -0
- package/dist/cjs/client/hooks/useDataBrowser.d.ts +67 -0
- package/dist/cjs/client/hooks/useDebounce.d.ts +12 -0
- package/dist/cjs/client/hooks/useDebounceQuery.d.ts +48 -0
- package/dist/cjs/client/hooks/useDirtyStateTracking.d.ts +37 -0
- package/dist/cjs/client/hooks/useDragAutoScroll.d.ts +18 -0
- package/dist/cjs/client/hooks/useDrillInteraction.d.ts +9 -0
- package/dist/cjs/client/hooks/useElementVisibility.d.ts +30 -0
- package/dist/cjs/client/hooks/useFilterValues.d.ts +19 -0
- package/dist/cjs/client/hooks/useNotebookLayout.d.ts +8 -0
- package/dist/cjs/client/hooks/useResponsiveDashboard.d.ts +16 -0
- package/dist/cjs/client/hooks/useScrollDetection.d.ts +29 -0
- package/dist/cjs/client/hooks/useTheme.d.ts +11 -0
- package/dist/cjs/client/hooks/useTranslation.d.ts +21 -0
- package/dist/cjs/client/hooks.d.ts +17 -0
- package/dist/cjs/client/icons/customIcons.d.ts +22 -0
- package/dist/cjs/client/icons/defaultIcons.d.ts +5 -0
- package/dist/cjs/client/icons/index.d.ts +22 -0
- package/dist/cjs/client/icons/registry.d.ts +58 -0
- package/dist/cjs/client/icons/types.d.ts +134 -0
- package/dist/cjs/client/icons.d.ts +2 -0
- package/dist/cjs/client/index.d.ts +76 -0
- package/dist/cjs/client/providers/CubeApiProvider.d.ts +24 -0
- package/dist/cjs/client/providers/CubeFeaturesProvider.d.ts +19 -0
- package/dist/cjs/client/providers/CubeMetaContext.d.ts +11 -0
- package/dist/cjs/client/providers/CubeMetaProvider.d.ts +6 -0
- package/dist/cjs/client/providers/CubeProvider.d.ts +70 -0
- package/dist/cjs/client/providers/I18nProvider.d.ts +18 -0
- package/dist/cjs/client/providers/ScrollContainerContext.d.ts +19 -0
- package/dist/cjs/client/providers.d.ts +10 -0
- package/dist/cjs/client/schema.d.ts +13 -0
- package/dist/cjs/client/shared/chartConfigBuilders.d.ts +18 -0
- package/dist/cjs/client/shared/chartDefaults.d.ts +59 -0
- package/dist/cjs/client/shared/components/CodeBlock.d.ts +13 -0
- package/dist/cjs/client/shared/components/QueryAnalysisPanel.d.ts +7 -0
- package/dist/cjs/client/shared/components/QueryAnalysisPanel.sections.d.ts +41 -0
- package/dist/cjs/client/shared/index.d.ts +11 -0
- package/dist/cjs/client/shared/queryKey.d.ts +1 -0
- package/dist/cjs/client/shared/queryTransforms.d.ts +20 -0
- package/dist/cjs/client/shared/types.d.ts +184 -0
- package/dist/cjs/client/shared/utils.d.ts +104 -0
- package/dist/cjs/client/stores/analysisBuilderStore.d.ts +578 -0
- package/dist/cjs/client/stores/dashboardStore.d.ts +292 -0
- package/dist/cjs/client/stores/dataBrowserStore.d.ts +34 -0
- package/dist/cjs/client/stores/index.d.ts +13 -0
- package/dist/cjs/client/stores/notebookStore.d.ts +157 -0
- package/dist/cjs/client/stores/optionsToAnalysisConfig.d.ts +17 -0
- package/dist/cjs/client/stores/slices/coreSlice.d.ts +96 -0
- package/dist/cjs/client/stores/slices/flowSlice.d.ts +69 -0
- package/dist/cjs/client/stores/slices/funnelSlice.d.ts +61 -0
- package/dist/cjs/client/stores/slices/index.d.ts +13 -0
- package/dist/cjs/client/stores/slices/querySlice.d.ts +55 -0
- package/dist/cjs/client/stores/slices/retentionSlice.d.ts +66 -0
- package/dist/cjs/client/stores/slices/uiSlice.d.ts +52 -0
- package/dist/cjs/client/theme/index.d.ts +135 -0
- package/dist/cjs/client/types/analysisConfig.d.ts +185 -0
- package/dist/cjs/client/types/drill.d.ts +240 -0
- package/dist/cjs/client/types/flow.d.ts +191 -0
- package/dist/cjs/client/types/funnel.d.ts +288 -0
- package/dist/cjs/client/types/retention.d.ts +301 -0
- package/dist/cjs/client/types.d.ts +600 -0
- package/dist/cjs/client/utils/axisValueFormatting.d.ts +32 -0
- package/dist/cjs/client/utils/chartConstants.d.ts +16 -0
- package/dist/cjs/client/utils/chartUtils.d.ts +35 -0
- package/dist/cjs/client/utils/colorPalettes.d.ts +35 -0
- package/dist/cjs/client/utils/comparisonUtils.d.ts +96 -0
- package/dist/cjs/client/utils/configMigration.d.ts +85 -0
- package/dist/cjs/client/utils/drillQueryBuilder.d.ts +41 -0
- package/dist/cjs/client/utils/exportXlsx.d.ts +20 -0
- package/dist/cjs/client/utils/filterUtils.d.ts +113 -0
- package/dist/cjs/client/utils/funnelExecution.d.ts +211 -0
- package/dist/cjs/client/utils/funnelValidation.d.ts +46 -0
- package/dist/cjs/client/utils/index.d.ts +94 -0
- package/dist/cjs/client/utils/joinReachability.d.ts +27 -0
- package/dist/cjs/client/utils/measureIcons.d.ts +11 -0
- package/dist/cjs/client/utils/multiQueryUtils.d.ts +86 -0
- package/dist/cjs/client/utils/multiQueryValidation.d.ts +69 -0
- package/dist/cjs/client/utils/periodUtils.d.ts +40 -0
- package/dist/cjs/client/utils/pivotUtils.d.ts +87 -0
- package/dist/cjs/client/utils/shareUtils.d.ts +61 -0
- package/dist/cjs/client/utils/syntaxHighlighting.d.ts +36 -0
- package/dist/cjs/client/utils/targetUtils.d.ts +36 -0
- package/dist/cjs/client/utils/thumbnail.d.ts +36 -0
- package/dist/cjs/client/utils/timeValueFormatting.d.ts +32 -0
- package/dist/cjs/client/utils.d.ts +8 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/server/adapters/base-adapter.d.ts +332 -0
- package/dist/cjs/server/adapters/databend-adapter.d.ts +63 -0
- package/dist/cjs/server/adapters/duckdb-adapter.d.ts +68 -0
- package/dist/cjs/server/adapters/mysql-adapter.d.ts +65 -0
- package/dist/cjs/server/adapters/postgres-adapter.d.ts +55 -0
- package/dist/cjs/server/adapters/singlestore-adapter.d.ts +4 -0
- package/dist/cjs/server/adapters/snowflake-adapter.d.ts +53 -0
- package/dist/cjs/server/adapters/sqlite-adapter.d.ts +120 -0
- package/dist/cjs/server/adapters/window-function-builder.d.ts +11 -0
- package/dist/cjs/server/agent/chart-validation.d.ts +22 -0
- package/dist/cjs/server/agent/handler-steps.d.ts +37 -0
- package/dist/cjs/server/agent/handler.d.ts +25 -0
- package/dist/cjs/server/agent/index.d.ts +11 -0
- package/dist/cjs/server/agent/providers/anthropic.d.ts +24 -0
- package/dist/cjs/server/agent/providers/factory.d.ts +12 -0
- package/dist/cjs/server/agent/providers/google.d.ts +23 -0
- package/dist/cjs/server/agent/providers/index.d.ts +6 -0
- package/dist/cjs/server/agent/providers/openai.d.ts +26 -0
- package/dist/cjs/server/agent/providers/types.d.ts +95 -0
- package/dist/cjs/server/agent/system-prompt.d.ts +5 -0
- package/dist/cjs/server/agent/tools.d.ts +28 -0
- package/dist/cjs/server/agent/types.d.ts +192 -0
- package/dist/cjs/server/ai/discovery-helpers.d.ts +29 -0
- package/dist/cjs/server/ai/discovery.d.ts +66 -0
- package/dist/cjs/server/ai/index.d.ts +10 -0
- package/dist/cjs/server/ai/mcp-prompts.d.ts +83 -0
- package/dist/cjs/server/ai/query-schema.d.ts +258 -0
- package/dist/cjs/server/ai/schemas.d.ts +63 -0
- package/dist/cjs/server/ai/suggestion-helpers.d.ts +33 -0
- package/dist/cjs/server/ai/suggestion.d.ts +16 -0
- package/dist/cjs/server/ai/validation-helpers.d.ts +21 -0
- package/dist/cjs/server/ai/validation.d.ts +31 -0
- package/dist/cjs/server/builders/analysis-utils.d.ts +106 -0
- package/dist/cjs/server/builders/comparison-query-builder.d.ts +70 -0
- package/dist/cjs/server/builders/cte-builder.d.ts +108 -0
- package/dist/cjs/server/builders/date-time-builder.d.ts +34 -0
- package/dist/cjs/server/builders/date-time-helpers.d.ts +34 -0
- package/dist/cjs/server/builders/filter-builder.d.ts +25 -0
- package/dist/cjs/server/builders/filter-operators.d.ts +23 -0
- package/dist/cjs/server/builders/flow-query-builder.d.ts +136 -0
- package/dist/cjs/server/builders/funnel-query-builder.d.ts +145 -0
- package/dist/cjs/server/builders/group-by-builder.d.ts +38 -0
- package/dist/cjs/server/builders/index.d.ts +13 -0
- package/dist/cjs/server/builders/measure-builder.d.ts +185 -0
- package/dist/cjs/server/builders/retention-query-builder.d.ts +98 -0
- package/dist/cjs/server/cache-providers/index.d.ts +5 -0
- package/dist/cjs/server/cache-providers/memory.d.ts +105 -0
- package/dist/cjs/server/cache-utils.d.ts +85 -0
- package/dist/cjs/server/compiler-metadata.d.ts +11 -0
- package/dist/cjs/server/compiler.d.ts +212 -0
- package/dist/cjs/server/cube-utils.d.ts +158 -0
- package/dist/cjs/server/database-utils.d.ts +18 -0
- package/dist/cjs/server/execution/annotation-builder.d.ts +12 -0
- package/dist/cjs/server/execution/filter-cache-preloader.d.ts +19 -0
- package/dist/cjs/server/execution/mode-router.d.ts +25 -0
- package/dist/cjs/server/execution/query-result-cache.d.ts +21 -0
- package/dist/cjs/server/execution/result-post-processor.d.ts +10 -0
- package/dist/cjs/server/executor.d.ts +186 -0
- package/dist/cjs/server/executors/base-executor.d.ts +16 -0
- package/dist/cjs/server/executors/databend-executor.d.ts +33 -0
- package/dist/cjs/server/executors/duckdb-executor.d.ts +33 -0
- package/dist/cjs/server/executors/explain-utils.d.ts +28 -0
- package/dist/cjs/server/executors/index.d.ts +21 -0
- package/dist/cjs/server/executors/mysql-executor.d.ts +27 -0
- package/dist/cjs/server/executors/postgres-executor.d.ts +27 -0
- package/dist/cjs/server/executors/singlestore-executor.d.ts +9 -0
- package/dist/cjs/server/executors/snowflake-executor.d.ts +33 -0
- package/dist/cjs/server/executors/sqlite-executor.d.ts +28 -0
- package/dist/cjs/server/explain/databend-parser.d.ts +16 -0
- package/dist/cjs/server/explain/duckdb-parser.d.ts +28 -0
- package/dist/cjs/server/explain/explain-tree.d.ts +20 -0
- package/dist/cjs/server/explain/index.d.ts +9 -0
- package/dist/cjs/server/explain/mysql-parser.d.ts +38 -0
- package/dist/cjs/server/explain/postgres-parser.d.ts +18 -0
- package/dist/cjs/server/explain/snowflake-parser.d.ts +17 -0
- package/dist/cjs/server/explain/sqlite-parser.d.ts +23 -0
- package/dist/cjs/server/filter-cache.d.ts +73 -0
- package/dist/cjs/server/gap-filler.d.ts +48 -0
- package/dist/cjs/server/index.d.ts +38 -0
- package/dist/cjs/server/logical-plan/cte-planner-helpers.d.ts +37 -0
- package/dist/cjs/server/logical-plan/cte-planner.d.ts +104 -0
- package/dist/cjs/server/logical-plan/filter-propagation.d.ts +44 -0
- package/dist/cjs/server/logical-plan/index.d.ts +19 -0
- package/dist/cjs/server/logical-plan/join-planner.d.ts +27 -0
- package/dist/cjs/server/logical-plan/logical-plan-builder.d.ts +58 -0
- package/dist/cjs/server/logical-plan/logical-planner.d.ts +39 -0
- package/dist/cjs/server/logical-plan/optimiser.d.ts +34 -0
- package/dist/cjs/server/logical-plan/plan-analysis-reporter.d.ts +59 -0
- package/dist/cjs/server/logical-plan/planner-utils.d.ts +20 -0
- package/dist/cjs/server/logical-plan/types.d.ts +199 -0
- package/dist/cjs/server/measure-classification.d.ts +40 -0
- package/dist/cjs/server/physical-plan/drizzle-plan-builder.d.ts +50 -0
- package/dist/cjs/server/physical-plan/drizzle-sql-builder.d.ts +118 -0
- package/dist/cjs/server/physical-plan/index.d.ts +2 -0
- package/dist/cjs/server/physical-plan/processors/cte-processor.d.ts +6 -0
- package/dist/cjs/server/physical-plan/processors/index.d.ts +8 -0
- package/dist/cjs/server/physical-plan/processors/joins-processor.d.ts +6 -0
- package/dist/cjs/server/physical-plan/processors/keys-dedup-processor.d.ts +13 -0
- package/dist/cjs/server/physical-plan/processors/multi-fact-processor.d.ts +13 -0
- package/dist/cjs/server/physical-plan/processors/predicates-processor.d.ts +6 -0
- package/dist/cjs/server/physical-plan/processors/selection-processor.d.ts +6 -0
- package/dist/cjs/server/physical-plan/processors/shared.d.ts +38 -0
- package/dist/cjs/server/physical-plan/processors/window-processor.d.ts +6 -0
- package/dist/cjs/server/prompts/explain-analysis-prompt.d.ts +47 -0
- package/dist/cjs/server/prompts/index.d.ts +27 -0
- package/dist/cjs/server/prompts/single-step-prompt.d.ts +31 -0
- package/dist/cjs/server/prompts/step0-validation-prompt.d.ts +39 -0
- package/dist/cjs/server/prompts/step1-shape-prompt.d.ts +29 -0
- package/dist/cjs/server/prompts/step2-complete-prompt.d.ts +19 -0
- package/dist/cjs/server/prompts/types.d.ts +37 -0
- package/dist/cjs/server/query-handlers.d.ts +79 -0
- package/dist/cjs/server/query-modes.d.ts +28 -0
- package/dist/cjs/server/query-validator.d.ts +9 -0
- package/dist/cjs/server/resolvers/calculated-measure-resolver.d.ts +98 -0
- package/dist/cjs/server/resolvers/index.d.ts +6 -0
- package/dist/cjs/server/resolvers/join-path-resolver.d.ts +158 -0
- package/dist/cjs/server/sql-format.d.ts +11 -0
- package/dist/cjs/server/template-substitution.d.ts +57 -0
- package/dist/cjs/server/types/analysis.d.ts +189 -0
- package/dist/cjs/server/types/cache.d.ts +132 -0
- package/dist/cjs/server/types/core.d.ts +164 -0
- package/dist/cjs/server/types/cube.d.ts +544 -0
- package/dist/cjs/server/types/executor.d.ts +156 -0
- package/dist/cjs/server/types/flow.d.ts +144 -0
- package/dist/cjs/server/types/funnel.d.ts +118 -0
- package/dist/cjs/server/types/index.d.ts +11 -0
- package/dist/cjs/server/types/metadata.d.ts +113 -0
- package/dist/cjs/server/types/query.d.ts +153 -0
- package/dist/cjs/server/types/retention.d.ts +141 -0
- package/dist/cjs/server/types/utils.d.ts +11 -0
- package/dist/cjs/server/types/validation.d.ts +14 -0
- package/dist/client/charts/chartComponentRegistry.d.ts +1 -9
- package/dist/client/charts/chartConfigRegistry.d.ts +5 -1
- package/dist/client/charts/chartPlugin.d.ts +1 -2
- package/dist/client/charts/chartRegistry.d.ts +73 -0
- package/dist/client/charts.js +3 -3
- package/dist/client/chunks/{DashboardEditModal-okVfH8ZK.js → DashboardEditModal-CWurUU2B.js} +7 -7
- package/dist/client/chunks/{DashboardEditModal-okVfH8ZK.js.map → DashboardEditModal-CWurUU2B.js.map} +1 -1
- package/dist/client/chunks/{analysis-builder-DB88FojM.js → analysis-builder-Uj_Fxv0-.js} +1588 -1857
- package/dist/client/chunks/analysis-builder-Uj_Fxv0-.js.map +1 -0
- package/dist/client/chunks/{analysis-builder-shared-BVK4TYfR.js → analysis-builder-shared-AdAYIfj_.js} +1531 -1266
- package/dist/client/chunks/analysis-builder-shared-AdAYIfj_.js.map +1 -0
- package/dist/client/chunks/{chart-config-activity-grid-D_UX4NHC.js → chart-config-activity-grid-BU_bkvER.js} +1 -11
- package/dist/client/chunks/chart-config-activity-grid-BU_bkvER.js.map +1 -0
- package/dist/client/chunks/{chart-config-area-BNigHUy8.js → chart-config-area-DxwIZ4Uf.js} +1 -5
- package/dist/client/chunks/{chart-config-area-BNigHUy8.js.map → chart-config-area-DxwIZ4Uf.js.map} +1 -1
- package/dist/client/chunks/{chart-config-bar-DSO_LRTx.js → chart-config-bar-Cc8GY9aQ.js} +5 -9
- package/dist/client/chunks/chart-config-bar-Cc8GY9aQ.js.map +1 -0
- package/dist/client/chunks/{chart-config-box-plot-oW8axV2q.js → chart-config-box-plot-Bs8ovYvV.js} +3 -8
- package/dist/client/chunks/chart-config-box-plot-Bs8ovYvV.js.map +1 -0
- package/dist/client/chunks/{chart-config-bubble-gIoqVyjZ.js → chart-config-bubble-BfgY7pt8.js} +1 -11
- package/dist/client/chunks/chart-config-bubble-BfgY7pt8.js.map +1 -0
- package/dist/client/chunks/{chart-config-candlestick-N6DchAA3.js → chart-config-candlestick-jaeNNEtC.js} +1 -11
- package/dist/client/chunks/chart-config-candlestick-jaeNNEtC.js.map +1 -0
- package/dist/client/chunks/{chart-config-data-table-d7VBY-y_.js → chart-config-data-table-CRk0C0rW.js} +1 -4
- package/dist/client/chunks/chart-config-data-table-CRk0C0rW.js.map +1 -0
- package/dist/client/chunks/{chart-config-funnel-DEYMcxsD.js → chart-config-funnel-boT_LNfl.js} +1 -4
- package/dist/client/chunks/chart-config-funnel-boT_LNfl.js.map +1 -0
- package/dist/client/chunks/{chart-config-gauge-Dq-_H9UN.js → chart-config-gauge-C5uJEr97.js} +3 -8
- package/dist/client/chunks/chart-config-gauge-C5uJEr97.js.map +1 -0
- package/dist/client/chunks/{chart-config-heat-map-CfRnRNcw.js → chart-config-heat-map-CCarP44-.js} +1 -11
- package/dist/client/chunks/chart-config-heat-map-CCarP44-.js.map +1 -0
- package/dist/client/chunks/{chart-config-kpi-delta-DSQbvqu_.js → chart-config-kpi-delta-DYopvwyG.js} +3 -8
- package/dist/client/chunks/chart-config-kpi-delta-DYopvwyG.js.map +1 -0
- package/dist/client/chunks/{chart-config-kpi-number-EFSWY1We.js → chart-config-kpi-number-BhMdoArB.js} +3 -8
- package/dist/client/chunks/chart-config-kpi-number-BhMdoArB.js.map +1 -0
- package/dist/client/chunks/{chart-config-kpi-text-KM3V5X2u.js → chart-config-kpi-text-DE6Zdi53.js} +3 -8
- package/dist/client/chunks/chart-config-kpi-text-DE6Zdi53.js.map +1 -0
- package/dist/client/chunks/{chart-config-line-D6jG8PCH.js → chart-config-line-CBfM0Rds.js} +6 -10
- package/dist/client/chunks/chart-config-line-CBfM0Rds.js.map +1 -0
- package/dist/client/chunks/{chart-config-markdown-BtRIe8JN.js → chart-config-markdown-BCDyBI8K.js} +1 -4
- package/dist/client/chunks/chart-config-markdown-BCDyBI8K.js.map +1 -0
- package/dist/client/chunks/{chart-config-measure-profile-DxRGa-zf.js → chart-config-measure-profile-BgQIH1u2.js} +1 -8
- package/dist/client/chunks/chart-config-measure-profile-BgQIH1u2.js.map +1 -0
- package/dist/client/chunks/{chart-config-pie-BhzW-fdn.js → chart-config-pie-ChfFz6DV.js} +5 -9
- package/dist/client/chunks/chart-config-pie-ChfFz6DV.js.map +1 -0
- package/dist/client/chunks/{chart-config-radar-D7REP1q_.js → chart-config-radar-BlAIGnww.js} +5 -9
- package/dist/client/chunks/chart-config-radar-BlAIGnww.js.map +1 -0
- package/dist/client/chunks/{chart-config-radial-bar-Byx6qOPU.js → chart-config-radial-bar-VFerwbCO.js} +5 -9
- package/dist/client/chunks/chart-config-radial-bar-VFerwbCO.js.map +1 -0
- package/dist/client/chunks/{chart-config-sankey-BTnWA7EW.js → chart-config-sankey-BhrDxIgj.js} +1 -4
- package/dist/client/chunks/chart-config-sankey-BhrDxIgj.js.map +1 -0
- package/dist/client/chunks/{chart-config-scatter-DSYTjwRb.js → chart-config-scatter-q_olh54e.js} +1 -11
- package/dist/client/chunks/chart-config-scatter-q_olh54e.js.map +1 -0
- package/dist/client/chunks/{chart-config-sunburst-Bwjtdf7X.js → chart-config-sunburst-BOmkOnKn.js} +1 -4
- package/dist/client/chunks/chart-config-sunburst-BOmkOnKn.js.map +1 -0
- package/dist/client/chunks/{chart-config-tree-map-DVrvf3yQ.js → chart-config-tree-map-BjX88YBY.js} +5 -9
- package/dist/client/chunks/chart-config-tree-map-BjX88YBY.js.map +1 -0
- package/dist/client/chunks/{chart-config-waterfall-DmFeQdIk.js → chart-config-waterfall-QsWXVSoF.js} +3 -8
- package/dist/client/chunks/chart-config-waterfall-QsWXVSoF.js.map +1 -0
- package/dist/client/chunks/{chart-data-table-CKauQXme.js → chart-data-table-D4g5_jfF.js} +1277 -1094
- package/dist/client/chunks/chart-data-table-D4g5_jfF.js.map +1 -0
- package/dist/client/chunks/{chart-kpi-delta-Dn-jjO-2.js → chart-kpi-delta-BvWOt8-D.js} +2 -2
- package/dist/client/chunks/{chart-kpi-delta-Dn-jjO-2.js.map → chart-kpi-delta-BvWOt8-D.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-number-P_WBiO5S.js → chart-kpi-number-xgZmMiQY.js} +3 -3
- package/dist/client/chunks/{chart-kpi-number-P_WBiO5S.js.map → chart-kpi-number-xgZmMiQY.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-text-C-Y4eb5H.js → chart-kpi-text-ZO3eFi7t.js} +2 -2
- package/dist/client/chunks/{chart-kpi-text-C-Y4eb5H.js.map → chart-kpi-text-ZO3eFi7t.js.map} +1 -1
- package/dist/client/chunks/{charts-loader-DdTeCeNo.js → charts-loader-B0DOQMFH.js} +6 -6
- package/dist/client/chunks/{charts-loader-DdTeCeNo.js.map → charts-loader-B0DOQMFH.js.map} +1 -1
- package/dist/client/chunks/{schema-visualization-Cb_E9_Gd.js → schema-visualization-DJPTktM6.js} +2 -2
- package/dist/client/chunks/{schema-visualization-Cb_E9_Gd.js.map → schema-visualization-DJPTktM6.js.map} +1 -1
- package/dist/client/chunks/{useDirtyStateTracking-MbpxH_v6.js → useDirtyStateTracking-BY_IIG1n.js} +2 -2
- package/dist/client/chunks/{useDirtyStateTracking-MbpxH_v6.js.map → useDirtyStateTracking-BY_IIG1n.js.map} +1 -1
- package/dist/client/chunks/{useExplainAI-evnZkjCY.js → useExplainAI-PjMBmj2p.js} +4 -4
- package/dist/client/chunks/{useExplainAI-evnZkjCY.js.map → useExplainAI-PjMBmj2p.js.map} +1 -1
- package/dist/client/chunks/{utils-3P6z1vz5.js → utils-Cq-j5E5I.js} +2 -2
- package/dist/client/chunks/{utils-3P6z1vz5.js.map → utils-Cq-j5E5I.js.map} +1 -1
- package/dist/client/chunks/{vendor-DSpR0IW6.js → vendor-D4jADu8t.js} +2 -2
- package/dist/client/chunks/{vendor-DSpR0IW6.js.map → vendor-D4jADu8t.js.map} +1 -1
- package/dist/client/components/AIAssistant/index.d.ts +2 -2
- package/dist/client/components/charts/ActivityGridChart.config.d.ts +6 -1
- package/dist/client/components/charts/AreaChart.config.d.ts +6 -1
- package/dist/client/components/charts/BarChart.config.d.ts +6 -1
- package/dist/client/components/charts/BoxPlotChart.config.d.ts +6 -1
- package/dist/client/components/charts/BubbleChart.config.d.ts +6 -1
- package/dist/client/components/charts/CandlestickChart.config.d.ts +6 -1
- package/dist/client/components/charts/DataTable.config.d.ts +6 -1
- package/dist/client/components/charts/FunnelChart.config.d.ts +5 -0
- package/dist/client/components/charts/GaugeChart.config.d.ts +6 -1
- package/dist/client/components/charts/HeatMapChart.config.d.ts +6 -1
- package/dist/client/components/charts/KpiDelta.config.d.ts +6 -1
- package/dist/client/components/charts/KpiNumber.config.d.ts +6 -1
- package/dist/client/components/charts/KpiText.config.d.ts +6 -1
- package/dist/client/components/charts/LineChart.config.d.ts +6 -1
- package/dist/client/components/charts/MarkdownChart.config.d.ts +6 -1
- package/dist/client/components/charts/MeasureProfileChart.config.d.ts +6 -1
- package/dist/client/components/charts/PieChart.config.d.ts +6 -1
- package/dist/client/components/charts/RadarChart.config.d.ts +6 -1
- package/dist/client/components/charts/RadialBarChart.config.d.ts +6 -1
- package/dist/client/components/charts/SankeyChart.config.d.ts +5 -0
- package/dist/client/components/charts/ScatterChart.config.d.ts +6 -1
- package/dist/client/components/charts/SunburstChart.config.d.ts +5 -0
- package/dist/client/components/charts/TreeMapChart.config.d.ts +6 -1
- package/dist/client/components/charts/WaterfallChart.config.d.ts +6 -1
- package/dist/client/components.js +2 -2
- package/dist/client/hooks/analysisQueryExecutionModes.d.ts +1 -1
- package/dist/client/hooks/useAnalysisEffects.d.ts +33 -0
- package/dist/client/hooks/useAnalysisQuery.d.ts +144 -0
- package/dist/client/hooks/useAnalysisState.d.ts +165 -0
- package/dist/client/hooks.js +3 -3
- package/dist/client/icons/registry.d.ts +0 -6
- package/dist/client/icons/types.d.ts +5 -0
- package/dist/client/icons.js +1 -1
- package/dist/client/index.js +9 -9
- package/dist/client/providers.js +1 -1
- package/dist/client/schema.js +1 -1
- package/dist/client/utils.js +3 -3
- package/dist/client-bundle-stats.html +1 -1
- package/dist/mcp-app/mcp-app.html +34 -34
- package/dist/server/chartConfigHelpers-CcvqrIWF.js +72 -0
- package/dist/server/chartConfigHelpers-DHQB-_v5.cjs +1 -0
- package/dist/server/index.cjs +68 -68
- package/dist/server/index.js +3800 -3728
- package/dist/server/{openai-D0musiYP.cjs → openai-B4kAJTSD.cjs} +3 -3
- package/dist/server/{openai-vXvLni8v.cjs → openai-Cdf2wWZA.cjs} +1 -1
- package/dist/server/{openai-B5jEiqiB.js → openai-CmMzrs1Y.js} +18 -2
- package/dist/server/{openai-cDlFSTk6.js → openai-DhzGY9R4.js} +1 -1
- package/package.json +85 -29
- package/dist/adapters/handler-Cn0dOctE.cjs +0 -25
- package/dist/adapters/hono/mcp-handler.d.ts +0 -37
- package/dist/adapters/mcp-transport-B7ddET3M.cjs +0 -40
- package/dist/adapters/mcp-transport-Dfuj4j4q.js +0 -591
- package/dist/client/chunks/analysis-builder-DB88FojM.js.map +0 -1
- package/dist/client/chunks/analysis-builder-shared-BVK4TYfR.js.map +0 -1
- package/dist/client/chunks/chart-config-activity-grid-D_UX4NHC.js.map +0 -1
- package/dist/client/chunks/chart-config-bar-DSO_LRTx.js.map +0 -1
- package/dist/client/chunks/chart-config-box-plot-oW8axV2q.js.map +0 -1
- package/dist/client/chunks/chart-config-bubble-gIoqVyjZ.js.map +0 -1
- package/dist/client/chunks/chart-config-candlestick-N6DchAA3.js.map +0 -1
- package/dist/client/chunks/chart-config-data-table-d7VBY-y_.js.map +0 -1
- package/dist/client/chunks/chart-config-funnel-DEYMcxsD.js.map +0 -1
- package/dist/client/chunks/chart-config-gauge-Dq-_H9UN.js.map +0 -1
- package/dist/client/chunks/chart-config-heat-map-CfRnRNcw.js.map +0 -1
- package/dist/client/chunks/chart-config-kpi-delta-DSQbvqu_.js.map +0 -1
- package/dist/client/chunks/chart-config-kpi-number-EFSWY1We.js.map +0 -1
- package/dist/client/chunks/chart-config-kpi-text-KM3V5X2u.js.map +0 -1
- package/dist/client/chunks/chart-config-line-D6jG8PCH.js.map +0 -1
- package/dist/client/chunks/chart-config-markdown-BtRIe8JN.js.map +0 -1
- package/dist/client/chunks/chart-config-measure-profile-DxRGa-zf.js.map +0 -1
- package/dist/client/chunks/chart-config-pie-BhzW-fdn.js.map +0 -1
- package/dist/client/chunks/chart-config-radar-D7REP1q_.js.map +0 -1
- package/dist/client/chunks/chart-config-radial-bar-Byx6qOPU.js.map +0 -1
- package/dist/client/chunks/chart-config-sankey-BTnWA7EW.js.map +0 -1
- package/dist/client/chunks/chart-config-scatter-DSYTjwRb.js.map +0 -1
- package/dist/client/chunks/chart-config-sunburst-Bwjtdf7X.js.map +0 -1
- package/dist/client/chunks/chart-config-tree-map-DVrvf3yQ.js.map +0 -1
- package/dist/client/chunks/chart-config-waterfall-DmFeQdIk.js.map +0 -1
- package/dist/client/chunks/chart-data-table-CKauQXme.js.map +0 -1
- package/dist/client/hooks/useAnalysisAI.d.ts +0 -56
- package/dist/client/hooks/useAnalysisChartDefaults.d.ts +0 -35
- package/dist/client/hooks/useAnalysisCombinedFields.d.ts +0 -18
- package/dist/client/hooks/useAnalysisInitialization.d.ts +0 -25
- package/dist/client/hooks/useAnalysisQueryBuilder.d.ts +0 -32
- package/dist/client/hooks/useAnalysisShare.d.ts +0 -18
- package/dist/client/hooks/useAnalysisUIState.d.ts +0 -24
|
@@ -119,7 +119,7 @@ var ce = (e, t) => {
|
|
|
119
119
|
} catch {
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
|
-
}, ue = (e) => new Promise((t) => setTimeout(t, e)), de = "6.
|
|
122
|
+
}, ue = (e) => new Promise((t) => setTimeout(t, e)), de = "6.44.0", fe = () => typeof window < "u" && window.document !== void 0 && typeof navigator < "u";
|
|
123
123
|
function pe() {
|
|
124
124
|
return typeof Deno < "u" && Deno.build != null ? "deno" : typeof EdgeRuntime < "u" ? "edge" : Object.prototype.toString.call(globalThis.process === void 0 ? 0 : globalThis.process) === "[object process]" ? "node" : "unknown";
|
|
125
125
|
}
|
|
@@ -1399,7 +1399,10 @@ I = /* @__PURE__ */ new WeakSet(), hn = function() {
|
|
|
1399
1399
|
}, _n = function() {
|
|
1400
1400
|
for (let e = this.messages.length - 1; e >= 0; e--) {
|
|
1401
1401
|
let t = this.messages[e];
|
|
1402
|
-
if (Qt(t) && t?.tool_calls?.length)
|
|
1402
|
+
if (Qt(t) && t?.tool_calls?.length) for (let e = t.tool_calls.length - 1; e >= 0; e--) {
|
|
1403
|
+
let n = t.tool_calls[e];
|
|
1404
|
+
if (n?.type === "function") return n.function;
|
|
1405
|
+
}
|
|
1403
1406
|
}
|
|
1404
1407
|
}, vn = function() {
|
|
1405
1408
|
for (let e = this.messages.length - 1; e >= 0; e--) {
|
|
@@ -2080,6 +2083,12 @@ var Gn = class extends N {
|
|
|
2080
2083
|
__security: { adminAPIKeyAuth: !0 }
|
|
2081
2084
|
});
|
|
2082
2085
|
}
|
|
2086
|
+
retrieve(e, t) {
|
|
2087
|
+
return this._client.get(P`/organization/spend_alerts/${e}`, {
|
|
2088
|
+
...t,
|
|
2089
|
+
__security: { adminAPIKeyAuth: !0 }
|
|
2090
|
+
});
|
|
2091
|
+
}
|
|
2083
2092
|
update(e, t, n) {
|
|
2084
2093
|
return this._client.post(P`/organization/spend_alerts/${e}`, {
|
|
2085
2094
|
body: t,
|
|
@@ -2469,6 +2478,13 @@ var nr = class extends N {
|
|
|
2469
2478
|
__security: { adminAPIKeyAuth: !0 }
|
|
2470
2479
|
});
|
|
2471
2480
|
}
|
|
2481
|
+
retrieve(e, t, n) {
|
|
2482
|
+
let { project_id: r } = t;
|
|
2483
|
+
return this._client.get(P`/organization/projects/${r}/spend_alerts/${e}`, {
|
|
2484
|
+
...n,
|
|
2485
|
+
__security: { adminAPIKeyAuth: !0 }
|
|
2486
|
+
});
|
|
2487
|
+
}
|
|
2472
2488
|
update(e, t, n) {
|
|
2473
2489
|
let { project_id: r, ...i } = t;
|
|
2474
2490
|
return this._client.post(P`/organization/projects/${r}/spend_alerts/${e}`, {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SemanticLayerCompiler } from '../../server/compiler.js';
|
|
2
|
+
import { MCPOptions } from '../utils.js';
|
|
3
|
+
import { HttpPort, McpHttpPort } from './http-port.js';
|
|
4
|
+
import { BaseSecurityContextThunk } from './security-context.js';
|
|
5
|
+
import { RestHandlers } from './rest-handlers.js';
|
|
6
|
+
export type { BaseSecurityContextThunk } from './security-context.js';
|
|
7
|
+
export interface CubeHttpHandlerOptions {
|
|
8
|
+
/** The semantic layer the handlers validate and execute against. */
|
|
9
|
+
semanticLayer: SemanticLayerCompiler;
|
|
10
|
+
/** Called in the REST `/load` catch-all 500 path with the thrown error (e.g. for logging). */
|
|
11
|
+
onError: (error: unknown) => void;
|
|
12
|
+
/**
|
|
13
|
+
* MCP endpoint config. Resolved once into the MCP POST handler. When omitted,
|
|
14
|
+
* MCP defaults are used; the adapter decides whether to route the MCP path.
|
|
15
|
+
*/
|
|
16
|
+
mcp?: MCPOptions;
|
|
17
|
+
}
|
|
18
|
+
export interface CubeHttpHandler extends RestHandlers {
|
|
19
|
+
handleLoadGet<TRes>(port: HttpPort<TRes>, getBaseSecurityContext: BaseSecurityContextThunk): Promise<TRes>;
|
|
20
|
+
handleLoadPost<TRes>(port: HttpPort<TRes>, getBaseSecurityContext: BaseSecurityContextThunk): Promise<TRes>;
|
|
21
|
+
handleMcpPost<TRes>(port: McpHttpPort<TRes>, getBaseSecurityContext: BaseSecurityContextThunk): Promise<TRes>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Build all HTTP handlers once. Each REST entry point owns its own request
|
|
25
|
+
* extraction, then funnels into a shared validate/execute/format tail.
|
|
26
|
+
*/
|
|
27
|
+
export declare function createCubeHttpHandler(options: CubeHttpHandlerOptions): CubeHttpHandler;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Framework port for the HTTP handler core.
|
|
3
|
+
*
|
|
4
|
+
* Captures the minimal transport surface a handler needs, generically over the
|
|
5
|
+
* framework's response type `TRes` so the same core works for adapters that
|
|
6
|
+
* mutate a response object (Express) and adapters that return a `Response`
|
|
7
|
+
* (Hono/Next.js). Implementations are constructed per request by each adapter.
|
|
8
|
+
*
|
|
9
|
+
* This interface is public — third parties implement it to build adapters for
|
|
10
|
+
* other frameworks. Add new capabilities as optional members or via a separate
|
|
11
|
+
* extension interface; a new required member is a breaking change.
|
|
12
|
+
*/
|
|
13
|
+
export interface HttpPort<TRes> {
|
|
14
|
+
/** Read a request header by (case-insensitive) name. Synchronous. */
|
|
15
|
+
getHeader(name: string): string | undefined;
|
|
16
|
+
/** Resolve the parsed request body. Async (Express resolves `req.body`; others await `.json()`). */
|
|
17
|
+
getBody(): Promise<unknown>;
|
|
18
|
+
/** Read a raw query-string value by name (used by GET). */
|
|
19
|
+
getQueryParam(name: string): string | undefined;
|
|
20
|
+
/** Send a response with the given status and JSON body; returns the framework's response value. */
|
|
21
|
+
send(status: number, body: unknown): TRes;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Extension of {@link HttpPort} for the MCP POST handler, which needs to set
|
|
25
|
+
* response headers (WWW-Authenticate, MCP-Session-Id), emit a single-event SSE
|
|
26
|
+
* response, and send an empty-body acknowledgement (202 for notifications).
|
|
27
|
+
*
|
|
28
|
+
* Kept separate from the minimal REST port so third-party adapters only
|
|
29
|
+
* implement these when they wire up MCP. New required members on this interface
|
|
30
|
+
* are still a breaking change for MCP-capable adapters.
|
|
31
|
+
*/
|
|
32
|
+
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
|
+
/** Send a single-event SSE response (status 200): write the pre-serialized body, then end. */
|
|
36
|
+
sendSse(status: number, body: string): TRes;
|
|
37
|
+
/** Send an empty-body response (no JSON), e.g. a 202 notification acknowledgement. */
|
|
38
|
+
sendEmpty(status: number): TRes;
|
|
39
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public entry point for the framework-agnostic HTTP handler core.
|
|
3
|
+
*
|
|
4
|
+
* Third parties can build adapters for other frameworks by implementing
|
|
5
|
+
* {@link HttpPort} (REST) / {@link McpHttpPort} (MCP) and driving them with
|
|
6
|
+
* {@link createCubeHttpHandler}.
|
|
7
|
+
*/
|
|
8
|
+
export type { HttpPort, McpHttpPort } from './http-port.js';
|
|
9
|
+
export { withLocaleFromHeaders, resolveSecurityContext, type HeaderReader, type BaseSecurityContextThunk } from './security-context.js';
|
|
10
|
+
export { createCubeHttpHandler, type CubeHttpHandler, type CubeHttpHandlerOptions } from './cube-http-handler.js';
|
|
11
|
+
export type { RestHandlers } from './rest-handlers.js';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SemanticLayerCompiler } from '../../server/compiler.js';
|
|
2
|
+
import { MCPOptions } from '../utils.js';
|
|
3
|
+
import { McpHttpPort } from './http-port.js';
|
|
4
|
+
import { BaseSecurityContextThunk } from './security-context.js';
|
|
5
|
+
export interface McpPostHandler {
|
|
6
|
+
handleMcpPost<TRes>(port: McpHttpPort<TRes>, getBaseSecurityContext: BaseSecurityContextThunk): Promise<TRes>;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Build the MCP POST handler once. Resolves the static resources/prompts/
|
|
10
|
+
* instructions and app config from {@link MCPOptions} at setup time, mirroring
|
|
11
|
+
* the per-request plumbing the adapters used to do inline.
|
|
12
|
+
*/
|
|
13
|
+
export declare function createMcpPostHandler(semanticLayer: SemanticLayerCompiler, mcp: MCPOptions): McpPostHandler;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SemanticLayerCompiler } from '../../server/compiler.js';
|
|
2
|
+
import { HttpPort } from './http-port.js';
|
|
3
|
+
import { BaseSecurityContextThunk } from './security-context.js';
|
|
4
|
+
/** REST handlers keyed by endpoint; each closes over the shared semantic layer. */
|
|
5
|
+
export interface RestHandlers {
|
|
6
|
+
handleMetaGet<TRes>(port: HttpPort<TRes>): TRes;
|
|
7
|
+
handleSqlGet<TRes>(port: HttpPort<TRes>, getBaseSecurityContext: BaseSecurityContextThunk): Promise<TRes>;
|
|
8
|
+
handleSqlPost<TRes>(port: HttpPort<TRes>, getBaseSecurityContext: BaseSecurityContextThunk): Promise<TRes>;
|
|
9
|
+
handleDryRunGet<TRes>(port: HttpPort<TRes>, getBaseSecurityContext: BaseSecurityContextThunk): Promise<TRes>;
|
|
10
|
+
handleDryRunPost<TRes>(port: HttpPort<TRes>, getBaseSecurityContext: BaseSecurityContextThunk): Promise<TRes>;
|
|
11
|
+
handleBatchPost<TRes>(port: HttpPort<TRes>, getBaseSecurityContext: BaseSecurityContextThunk): Promise<TRes>;
|
|
12
|
+
handleExplainPost<TRes>(port: HttpPort<TRes>, getBaseSecurityContext: BaseSecurityContextThunk): Promise<TRes>;
|
|
13
|
+
}
|
|
14
|
+
export declare function createRestHandlers(semanticLayer: SemanticLayerCompiler): RestHandlers;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SecurityContext } from '../../server/index.js';
|
|
2
|
+
/** Returns the base (pre-locale) security context for a request. */
|
|
3
|
+
export type BaseSecurityContextThunk = () => SecurityContext | Promise<SecurityContext>;
|
|
4
|
+
/** Reads a request header by (case-insensitive) name. */
|
|
5
|
+
export type HeaderReader = (name: string) => string | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* Merge the request locale (from the `X-DC-Locale` header) into a base security
|
|
8
|
+
* context. Replaces the per-adapter `extractSecurityContextWithLocale` wrappers.
|
|
9
|
+
*/
|
|
10
|
+
export declare function withLocaleFromHeaders(base: SecurityContext, readHeader: HeaderReader): SecurityContext;
|
|
11
|
+
/**
|
|
12
|
+
* Resolve the base security context and merge the request locale in one step —
|
|
13
|
+
* the standard preamble for every authenticated core handler.
|
|
14
|
+
*/
|
|
15
|
+
export declare function resolveSecurityContext(getBaseSecurityContext: BaseSecurityContextThunk, readHeader: HeaderReader): Promise<SecurityContext>;
|
|
16
|
+
/** Strip CR/LF from a thrown value for single-line logging (log-injection guard). */
|
|
17
|
+
export declare function sanitizeForLog(error: unknown): string;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { Router, Request, Response, Express } from 'express';
|
|
2
|
+
import { CorsOptions } from 'cors';
|
|
3
|
+
import { SemanticQuery, SecurityContext, DatabaseExecutor, DrizzleDatabase, Cube, CacheConfig, RLSSetupFn } from '../../server/index.js';
|
|
4
|
+
import { AgentConfig } from '../../server/agent/types.js';
|
|
5
|
+
import { PostgresJsDatabase } from 'drizzle-orm/postgres-js';
|
|
6
|
+
import { MySql2Database } from 'drizzle-orm/mysql2';
|
|
7
|
+
import { BetterSQLite3Database } from 'drizzle-orm/better-sqlite3';
|
|
8
|
+
import { MCPOptions } from '../utils.js';
|
|
9
|
+
export interface ExpressAdapterOptions {
|
|
10
|
+
/**
|
|
11
|
+
* Array of cube definitions to register
|
|
12
|
+
*/
|
|
13
|
+
cubes: Cube[];
|
|
14
|
+
/**
|
|
15
|
+
* Drizzle database instance (REQUIRED)
|
|
16
|
+
* This is the core of drizzle-cube - Drizzle ORM integration
|
|
17
|
+
* Accepts PostgreSQL, MySQL, or SQLite database instances
|
|
18
|
+
*/
|
|
19
|
+
drizzle: PostgresJsDatabase<any> | MySql2Database<any> | BetterSQLite3Database<any> | DrizzleDatabase;
|
|
20
|
+
/**
|
|
21
|
+
* Database schema for type inference (RECOMMENDED)
|
|
22
|
+
* Provides full type safety for cube definitions
|
|
23
|
+
*/
|
|
24
|
+
schema?: any;
|
|
25
|
+
/**
|
|
26
|
+
* Extract security context from incoming HTTP request.
|
|
27
|
+
* Called for EVERY API request to determine user permissions and multi-tenant isolation.
|
|
28
|
+
*
|
|
29
|
+
* This is your security boundary - ensure proper authentication and authorization here.
|
|
30
|
+
*
|
|
31
|
+
* @param req - Express Request object containing the incoming HTTP request
|
|
32
|
+
* @param res - Express Response object
|
|
33
|
+
* @returns Security context with organisationId, userId, roles, etc.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* extractSecurityContext: async (req, res) => {
|
|
37
|
+
* // Extract JWT from Authorization header
|
|
38
|
+
* const token = req.headers.authorization?.replace('Bearer ', '')
|
|
39
|
+
* const decoded = await verifyJWT(token)
|
|
40
|
+
*
|
|
41
|
+
* // Return context that will be available in all cube SQL functions
|
|
42
|
+
* return {
|
|
43
|
+
* organisationId: decoded.orgId,
|
|
44
|
+
* userId: decoded.userId,
|
|
45
|
+
* roles: decoded.roles
|
|
46
|
+
* }
|
|
47
|
+
* }
|
|
48
|
+
*/
|
|
49
|
+
extractSecurityContext: (req: Request, res: Response) => SecurityContext | Promise<SecurityContext>;
|
|
50
|
+
/**
|
|
51
|
+
* Database engine type (optional - auto-detected if not provided)
|
|
52
|
+
*/
|
|
53
|
+
engineType?: 'postgres' | 'mysql' | 'sqlite' | 'singlestore' | 'duckdb' | 'databend' | 'snowflake';
|
|
54
|
+
/**
|
|
55
|
+
* CORS configuration (optional)
|
|
56
|
+
*/
|
|
57
|
+
cors?: CorsOptions;
|
|
58
|
+
/**
|
|
59
|
+
* API base path (default: '/cubejs-api/v1')
|
|
60
|
+
*/
|
|
61
|
+
basePath?: string;
|
|
62
|
+
/**
|
|
63
|
+
* JSON body parser limit (default: '10mb')
|
|
64
|
+
*/
|
|
65
|
+
jsonLimit?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Cache configuration for query result caching
|
|
68
|
+
* When provided, query results will be cached using the specified provider
|
|
69
|
+
*/
|
|
70
|
+
cache?: CacheConfig;
|
|
71
|
+
/**
|
|
72
|
+
* MCP (AI-Ready) endpoint configuration
|
|
73
|
+
* Enables AI agents to discover and query your data
|
|
74
|
+
* @default { enabled: true }
|
|
75
|
+
*/
|
|
76
|
+
mcp?: MCPOptions;
|
|
77
|
+
/**
|
|
78
|
+
* Agent configuration for the agentic AI notebook feature.
|
|
79
|
+
* When provided, enables the POST /agent/chat SSE endpoint.
|
|
80
|
+
* Requires `@anthropic-ai/sdk` as a peer dependency.
|
|
81
|
+
*/
|
|
82
|
+
agent?: AgentConfig;
|
|
83
|
+
/**
|
|
84
|
+
* Row-Level Security setup function.
|
|
85
|
+
* When provided, every query execution opens a transaction, calls this function
|
|
86
|
+
* to configure RLS (e.g., set JWT claims and switch Postgres roles), then runs the query.
|
|
87
|
+
*/
|
|
88
|
+
rlsSetup?: RLSSetupFn;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Create Express router for Cube.js-compatible API
|
|
92
|
+
*/
|
|
93
|
+
export declare function createCubeRouter(options: ExpressAdapterOptions): Router;
|
|
94
|
+
/**
|
|
95
|
+
* Convenience function to mount Cube routes on an existing Express app
|
|
96
|
+
*/
|
|
97
|
+
export declare function mountCubeRoutes(app: Express, options: ExpressAdapterOptions): Express;
|
|
98
|
+
/**
|
|
99
|
+
* Create a complete Express app with Cube.js routes
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* const app = createCubeApp({
|
|
103
|
+
* cubes: [salesCube, employeesCube],
|
|
104
|
+
* drizzle: db,
|
|
105
|
+
* schema,
|
|
106
|
+
* extractSecurityContext: async (req, res) => {
|
|
107
|
+
* const token = req.headers.authorization?.replace('Bearer ', '')
|
|
108
|
+
* const decoded = await verifyJWT(token)
|
|
109
|
+
* return { organisationId: decoded.orgId, userId: decoded.userId }
|
|
110
|
+
* }
|
|
111
|
+
* })
|
|
112
|
+
*/
|
|
113
|
+
export declare function createCubeApp(options: ExpressAdapterOptions): Express;
|
|
114
|
+
export type { SecurityContext, DatabaseExecutor, SemanticQuery, DrizzleDatabase, CorsOptions };
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { FastifyPluginCallback, FastifyRequest, FastifyInstance } from 'fastify';
|
|
2
|
+
import { FastifyCorsOptions } from '@fastify/cors';
|
|
3
|
+
import { SemanticQuery, SecurityContext, DatabaseExecutor, DrizzleDatabase, Cube, CacheConfig, RLSSetupFn } from '../../server/index.js';
|
|
4
|
+
import { AgentConfig } from '../../server/agent/types.js';
|
|
5
|
+
import { PostgresJsDatabase } from 'drizzle-orm/postgres-js';
|
|
6
|
+
import { MySql2Database } from 'drizzle-orm/mysql2';
|
|
7
|
+
import { BetterSQLite3Database } from 'drizzle-orm/better-sqlite3';
|
|
8
|
+
import { MCPOptions } from '../utils.js';
|
|
9
|
+
export interface FastifyAdapterOptions {
|
|
10
|
+
/**
|
|
11
|
+
* Array of cube definitions to register
|
|
12
|
+
*/
|
|
13
|
+
cubes: Cube[];
|
|
14
|
+
/**
|
|
15
|
+
* Drizzle database instance (REQUIRED)
|
|
16
|
+
* This is the core of drizzle-cube - Drizzle ORM integration
|
|
17
|
+
* Accepts PostgreSQL, MySQL, or SQLite database instances
|
|
18
|
+
*/
|
|
19
|
+
drizzle: PostgresJsDatabase<any> | MySql2Database<any> | BetterSQLite3Database<any> | DrizzleDatabase;
|
|
20
|
+
/**
|
|
21
|
+
* Database schema for type inference (RECOMMENDED)
|
|
22
|
+
* Provides full type safety for cube definitions
|
|
23
|
+
*/
|
|
24
|
+
schema?: any;
|
|
25
|
+
/**
|
|
26
|
+
* Extract security context from incoming HTTP request.
|
|
27
|
+
* Called for EVERY API request to determine user permissions and multi-tenant isolation.
|
|
28
|
+
*
|
|
29
|
+
* This is your security boundary - ensure proper authentication and authorization here.
|
|
30
|
+
*
|
|
31
|
+
* @param request - Fastify Request object containing the incoming HTTP request
|
|
32
|
+
* @returns Security context with organisationId, userId, roles, etc.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* extractSecurityContext: async (request) => {
|
|
36
|
+
* // Extract JWT from Authorization header
|
|
37
|
+
* const token = request.headers.authorization?.replace('Bearer ', '')
|
|
38
|
+
* const decoded = await verifyJWT(token)
|
|
39
|
+
*
|
|
40
|
+
* // Return context that will be available in all cube SQL functions
|
|
41
|
+
* return {
|
|
42
|
+
* organisationId: decoded.orgId,
|
|
43
|
+
* userId: decoded.userId,
|
|
44
|
+
* roles: decoded.roles
|
|
45
|
+
* }
|
|
46
|
+
* }
|
|
47
|
+
*/
|
|
48
|
+
extractSecurityContext: (request: FastifyRequest) => SecurityContext | Promise<SecurityContext>;
|
|
49
|
+
/**
|
|
50
|
+
* Database engine type (optional - auto-detected if not provided)
|
|
51
|
+
*/
|
|
52
|
+
engineType?: 'postgres' | 'mysql' | 'sqlite' | 'singlestore' | 'duckdb' | 'databend' | 'snowflake';
|
|
53
|
+
/**
|
|
54
|
+
* CORS configuration (optional)
|
|
55
|
+
*/
|
|
56
|
+
cors?: FastifyCorsOptions;
|
|
57
|
+
/**
|
|
58
|
+
* API base path (default: '/cubejs-api/v1')
|
|
59
|
+
*/
|
|
60
|
+
basePath?: string;
|
|
61
|
+
/**
|
|
62
|
+
* JSON body parser limit (default: 10485760 - 10MB)
|
|
63
|
+
*/
|
|
64
|
+
bodyLimit?: number;
|
|
65
|
+
/**
|
|
66
|
+
* Cache configuration for query result caching
|
|
67
|
+
* When provided, query results will be cached using the specified provider
|
|
68
|
+
*/
|
|
69
|
+
cache?: CacheConfig;
|
|
70
|
+
/**
|
|
71
|
+
* MCP (AI-Ready) endpoint configuration
|
|
72
|
+
* Enables AI agents to discover and query your data
|
|
73
|
+
* @default { enabled: true }
|
|
74
|
+
*/
|
|
75
|
+
mcp?: MCPOptions;
|
|
76
|
+
/**
|
|
77
|
+
* Agent configuration for the agentic AI notebook feature.
|
|
78
|
+
* When provided, enables the POST /agent/chat SSE endpoint.
|
|
79
|
+
* Requires `@anthropic-ai/sdk` as a peer dependency.
|
|
80
|
+
*/
|
|
81
|
+
agent?: AgentConfig;
|
|
82
|
+
/**
|
|
83
|
+
* Row-Level Security setup function.
|
|
84
|
+
* When provided, every query execution opens a transaction, calls this function
|
|
85
|
+
* to configure RLS (e.g., set JWT claims and switch Postgres roles), then runs the query.
|
|
86
|
+
*/
|
|
87
|
+
rlsSetup?: RLSSetupFn;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Fastify plugin for Cube.js-compatible API
|
|
91
|
+
*/
|
|
92
|
+
export declare const cubePlugin: FastifyPluginCallback<FastifyAdapterOptions>;
|
|
93
|
+
/**
|
|
94
|
+
* Helper function to register cube routes on an existing Fastify instance
|
|
95
|
+
*/
|
|
96
|
+
export declare function registerCubeRoutes(fastify: FastifyInstance, options: FastifyAdapterOptions): Promise<void>;
|
|
97
|
+
/**
|
|
98
|
+
* Create a complete Fastify instance with Cube.js routes
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* const app = createCubeApp({
|
|
102
|
+
* cubes: [salesCube, employeesCube],
|
|
103
|
+
* drizzle: db,
|
|
104
|
+
* schema,
|
|
105
|
+
* extractSecurityContext: async (request) => {
|
|
106
|
+
* const token = request.headers.authorization?.replace('Bearer ', '')
|
|
107
|
+
* const decoded = await verifyJWT(token)
|
|
108
|
+
* return { organisationId: decoded.orgId, userId: decoded.userId }
|
|
109
|
+
* }
|
|
110
|
+
* })
|
|
111
|
+
*/
|
|
112
|
+
export declare function createCubeApp(options: FastifyAdapterOptions): FastifyInstance;
|
|
113
|
+
export type { SecurityContext, DatabaseExecutor, SemanticQuery, DrizzleDatabase, FastifyCorsOptions };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Context } from 'hono';
|
|
2
|
+
import { SemanticLayerCompiler } from '../../server/compiler.js';
|
|
3
|
+
import { SecurityContext } from '../../server/index.js';
|
|
4
|
+
import { AgentConfig } from '../../server/agent/types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Handle a `POST /agent/chat` request: validate input, resolve the API key and
|
|
7
|
+
* overrides, then stream agent events as SSE. Mirrors the previous inline route.
|
|
8
|
+
*/
|
|
9
|
+
export declare function handleAgentChatRequest(c: Context, agentConfig: AgentConfig, semanticLayer: SemanticLayerCompiler, extractSecurityContext: (c: Context) => Promise<SecurityContext>): Promise<Response>;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { Hono } from 'hono';
|
|
2
|
+
import { SemanticQuery, SecurityContext, DatabaseExecutor, DrizzleDatabase, Cube, CacheConfig, RLSSetupFn } from '../../server/index.js';
|
|
3
|
+
import { AgentConfig } from '../../server/agent/types.js';
|
|
4
|
+
import { SemanticLayerCompiler } from '../../server/compiler.js';
|
|
5
|
+
import { PostgresJsDatabase } from 'drizzle-orm/postgres-js';
|
|
6
|
+
import { MySql2Database } from 'drizzle-orm/mysql2';
|
|
7
|
+
import { BetterSQLite3Database } from 'drizzle-orm/better-sqlite3';
|
|
8
|
+
import { MCPOptions } from '../utils.js';
|
|
9
|
+
export interface HonoAdapterOptions {
|
|
10
|
+
/**
|
|
11
|
+
* Array of cube definitions to register.
|
|
12
|
+
* Optional when `semanticLayer` is provided (caller manages registration).
|
|
13
|
+
*/
|
|
14
|
+
cubes?: Cube[];
|
|
15
|
+
/**
|
|
16
|
+
* Pre-configured SemanticLayerCompiler instance.
|
|
17
|
+
* When provided, skips creating a new compiler and cube registration (caller manages it).
|
|
18
|
+
*/
|
|
19
|
+
semanticLayer?: SemanticLayerCompiler;
|
|
20
|
+
/**
|
|
21
|
+
* Drizzle database instance.
|
|
22
|
+
* Required unless `semanticLayer` is provided.
|
|
23
|
+
* Accepts PostgreSQL, MySQL, or SQLite database instances.
|
|
24
|
+
*/
|
|
25
|
+
drizzle?: PostgresJsDatabase<any> | MySql2Database<any> | BetterSQLite3Database<any> | DrizzleDatabase;
|
|
26
|
+
/**
|
|
27
|
+
* Database schema for type inference (RECOMMENDED)
|
|
28
|
+
* Provides full type safety for cube definitions
|
|
29
|
+
*/
|
|
30
|
+
schema?: any;
|
|
31
|
+
/**
|
|
32
|
+
* Extract security context from incoming HTTP request.
|
|
33
|
+
* Called for EVERY API request to determine user permissions and multi-tenant isolation.
|
|
34
|
+
*
|
|
35
|
+
* This is your security boundary - ensure proper authentication and authorization here.
|
|
36
|
+
*
|
|
37
|
+
* @param c - Hono context containing the incoming HTTP request
|
|
38
|
+
* @returns Security context with organisationId, userId, roles, etc.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* extractSecurityContext: async (c) => {
|
|
42
|
+
* // Extract JWT from Authorization header
|
|
43
|
+
* const token = c.req.header('Authorization')?.replace('Bearer ', '')
|
|
44
|
+
* const decoded = await verifyJWT(token)
|
|
45
|
+
*
|
|
46
|
+
* // Return context that will be available in all cube SQL functions
|
|
47
|
+
* return {
|
|
48
|
+
* organisationId: decoded.orgId,
|
|
49
|
+
* userId: decoded.userId,
|
|
50
|
+
* roles: decoded.roles
|
|
51
|
+
* }
|
|
52
|
+
* }
|
|
53
|
+
*/
|
|
54
|
+
extractSecurityContext: (c: any) => SecurityContext | Promise<SecurityContext>;
|
|
55
|
+
/**
|
|
56
|
+
* Database engine type (optional - auto-detected if not provided)
|
|
57
|
+
*/
|
|
58
|
+
engineType?: 'postgres' | 'mysql' | 'sqlite' | 'singlestore' | 'duckdb' | 'databend' | 'snowflake';
|
|
59
|
+
/**
|
|
60
|
+
* CORS configuration (optional)
|
|
61
|
+
*/
|
|
62
|
+
cors?: {
|
|
63
|
+
origin?: string | string[] | ((origin: string, c: any) => string | null | undefined);
|
|
64
|
+
allowMethods?: string[];
|
|
65
|
+
allowHeaders?: string[];
|
|
66
|
+
credentials?: boolean;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* API base path (default: '/cubejs-api/v1')
|
|
70
|
+
*/
|
|
71
|
+
basePath?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Cache configuration for query result caching
|
|
74
|
+
* When provided, query results will be cached using the specified provider
|
|
75
|
+
*/
|
|
76
|
+
cache?: CacheConfig;
|
|
77
|
+
/**
|
|
78
|
+
* MCP (AI-Ready) endpoint configuration
|
|
79
|
+
* Enables AI agents to discover and query your data
|
|
80
|
+
* @default { enabled: true }
|
|
81
|
+
*/
|
|
82
|
+
mcp?: MCPOptions;
|
|
83
|
+
/**
|
|
84
|
+
* Agent configuration for the agentic AI notebook feature.
|
|
85
|
+
* When provided, enables the POST /agent/chat SSE endpoint.
|
|
86
|
+
* Requires `@anthropic-ai/sdk` as a peer dependency.
|
|
87
|
+
*/
|
|
88
|
+
agent?: AgentConfig;
|
|
89
|
+
/**
|
|
90
|
+
* Row-Level Security setup function.
|
|
91
|
+
* When provided, every query execution opens a transaction, calls this function
|
|
92
|
+
* to configure RLS (e.g., set JWT claims and switch Postgres roles), then runs the query.
|
|
93
|
+
*/
|
|
94
|
+
rlsSetup?: RLSSetupFn;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Create Hono routes for Cube.js-compatible API
|
|
98
|
+
*/
|
|
99
|
+
export declare function createCubeRoutes(options: HonoAdapterOptions): Hono<import('hono/types').BlankEnv, import('hono/types').BlankSchema, "/">;
|
|
100
|
+
/**
|
|
101
|
+
* Convenience function to create routes and mount them on an existing Hono app
|
|
102
|
+
*/
|
|
103
|
+
export declare function mountCubeRoutes(app: Hono, options: HonoAdapterOptions): Hono<import('hono/types').BlankEnv, import('hono/types').BlankSchema, "/">;
|
|
104
|
+
/**
|
|
105
|
+
* Create a complete Hono app with Cube.js routes
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* const app = createCubeApp({
|
|
109
|
+
* cubes: [salesCube, employeesCube],
|
|
110
|
+
* drizzle: db,
|
|
111
|
+
* schema,
|
|
112
|
+
* extractSecurityContext: async (c) => {
|
|
113
|
+
* const token = c.req.header('Authorization')
|
|
114
|
+
* const decoded = await verifyJWT(token)
|
|
115
|
+
* return { organisationId: decoded.orgId, userId: decoded.userId }
|
|
116
|
+
* }
|
|
117
|
+
* })
|
|
118
|
+
*/
|
|
119
|
+
export declare function createCubeApp(options: HonoAdapterOptions): Hono<import('hono/types').BlankEnv, import('hono/types').BlankSchema, "/">;
|
|
120
|
+
export type { SecurityContext, DatabaseExecutor, SemanticQuery, DrizzleDatabase };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SecurityContext } from '../server/index.js';
|
|
2
|
+
export declare const DC_LOCALE_HEADER = "x-dc-locale";
|
|
3
|
+
export declare const DEFAULT_LOCALE = "en-GB";
|
|
4
|
+
type HeaderValue = string | string[] | null | undefined;
|
|
5
|
+
export declare function resolveRequestLocale(getHeader: (name: string) => HeaderValue): string | undefined;
|
|
6
|
+
export declare function withLocaleInSecurityContext(securityContext: SecurityContext, requestLocale?: string): SecurityContext;
|
|
7
|
+
export declare function ensureLocaleHeader(allowHeaders?: string[] | string): string[];
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SemanticLayerCompiler, SecurityContext } from '../server/index.js';
|
|
2
|
+
import { MCPToolResult } from './mcp-tools.js';
|
|
3
|
+
export interface CubeToolHandlerDeps {
|
|
4
|
+
semanticLayer: SemanticLayerCompiler;
|
|
5
|
+
getSecurityContext: (meta?: unknown) => SecurityContext | Promise<SecurityContext>;
|
|
6
|
+
wrapContent: (result: unknown) => MCPToolResult;
|
|
7
|
+
wrapError: (error: unknown) => MCPToolResult;
|
|
8
|
+
}
|
|
9
|
+
/** Execute the `discover` tool. */
|
|
10
|
+
export declare function runDiscoverTool(deps: CubeToolHandlerDeps, args: unknown): Promise<MCPToolResult>;
|
|
11
|
+
/** Execute the `validate` tool — security context is optional (SQL omitted without auth). */
|
|
12
|
+
export declare function runValidateTool(deps: CubeToolHandlerDeps, args: unknown, meta?: unknown): Promise<MCPToolResult>;
|
|
13
|
+
/**
|
|
14
|
+
* Execute the `load` / `chart` tools. Both run the same query path; `chart`
|
|
15
|
+
* additionally carries `_meta.ui` on its definition so the result renders in the
|
|
16
|
+
* MCP App UI.
|
|
17
|
+
*/
|
|
18
|
+
export declare function runLoadTool(deps: CubeToolHandlerDeps, args: unknown, meta?: unknown): Promise<MCPToolResult>;
|