drizzle-cube 0.5.3 → 0.5.5
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/express/index.cjs +2 -2
- package/dist/adapters/express/index.js +105 -104
- package/dist/adapters/fastify/index.cjs +2 -2
- package/dist/adapters/fastify/index.js +107 -106
- package/dist/adapters/{google-CBfBGU4F.js → google-CT4kgmBf.js} +1 -1
- package/dist/adapters/{google-BOAwi9Ib.cjs → google-Dgo9-Kb5.cjs} +1 -1
- package/dist/adapters/{handler-Cqf-CqAS.cjs → handler-C1Qs8JMY.cjs} +13 -13
- package/dist/adapters/{handler-BC3nFNxV.js → handler-CoaNnZyf.js} +154 -34
- package/dist/adapters/hono/index.cjs +1 -1
- package/dist/adapters/hono/index.js +99 -98
- package/dist/adapters/{locale-BoiA6WiV.cjs → locale-CTuvUGBs.cjs} +7 -7
- package/dist/adapters/{locale-D9VQkLXt.js → locale-wMBdZ3Ks.js} +1 -1
- package/dist/adapters/mcp-tools.cjs +1 -1
- package/dist/adapters/mcp-tools.js +8 -3
- package/dist/adapters/mcp-transport-B_HoB1HQ.js +579 -0
- package/dist/adapters/mcp-transport-bQzyrBPI.cjs +40 -0
- package/dist/adapters/mcp-transport.d.ts +22 -0
- package/dist/adapters/nextjs/index.cjs +1 -1
- package/dist/adapters/nextjs/index.js +136 -135
- package/dist/adapters/{openai-B4N3KfTG.cjs → openai-BjLV_Wjx.cjs} +1 -1
- package/dist/adapters/{openai-BWdm0JvG.js → openai-DQawCWQb.js} +1 -1
- package/dist/adapters/utils-CIRA5_JO.cjs +128 -0
- package/dist/adapters/{utils-CTYvfZ3I.js → utils-hC7Z8V39.js} +1114 -664
- package/dist/adapters/utils.cjs +1 -1
- package/dist/adapters/utils.d.ts +52 -5
- package/dist/adapters/utils.js +1 -1
- package/dist/client/charts/chartConfigs.d.ts +34 -0
- package/dist/client/charts.js +12 -12
- package/dist/client/chunks/{DashboardEditModal-IU_0dgfC.js → DashboardEditModal-DayTXEH0.js} +10 -10
- package/dist/client/chunks/{DashboardEditModal-IU_0dgfC.js.map → DashboardEditModal-DayTXEH0.js.map} +1 -1
- package/dist/client/chunks/{FieldSearchModal-BCWanpPX.js → FieldSearchModal-B7Mr8UNT.js} +4 -4
- package/dist/client/chunks/{FieldSearchModal-BCWanpPX.js.map → FieldSearchModal-B7Mr8UNT.js.map} +1 -1
- package/dist/client/chunks/KpiDelta-C-hZ1x01.js +2 -0
- package/dist/client/chunks/KpiNumber-Beo8CK0a.js +2 -0
- package/dist/client/chunks/KpiText-ytYiRTRO.js +2 -0
- package/dist/client/chunks/{RetentionCombinedChart-CQMBODsK.js → RetentionCombinedChart-D3dRmoos.js} +3 -3
- package/dist/client/chunks/{RetentionCombinedChart-CQMBODsK.js.map → RetentionCombinedChart-D3dRmoos.js.map} +1 -1
- package/dist/client/chunks/{RetentionHeatmap-B_5sewwi.js → RetentionHeatmap-DHPnn0qH.js} +2 -2
- package/dist/client/chunks/{RetentionHeatmap-B_5sewwi.js.map → RetentionHeatmap-DHPnn0qH.js.map} +1 -1
- package/dist/client/chunks/SchemaVisualization-DbYZBTyi.js +2 -0
- package/dist/client/chunks/SchemaVisualizationLazy-BGo-1S3q.js +2 -0
- package/dist/client/chunks/{af-ZA-xDmO5F0s.js → af-ZA-BtTNqvHF.js} +8 -3
- package/dist/client/chunks/af-ZA-BtTNqvHF.js.map +1 -0
- package/dist/client/chunks/{analysis-builder-Dm6eD_AX.js → analysis-builder-lcGl099d.js} +245 -255
- package/dist/client/chunks/analysis-builder-lcGl099d.js.map +1 -0
- package/dist/client/chunks/{analysis-builder-shared-DT5bXwCA.js → analysis-builder-shared-6BRZcEnu.js} +391 -459
- package/dist/client/chunks/analysis-builder-shared-6BRZcEnu.js.map +1 -0
- package/dist/client/chunks/{chart-activity-grid-CWT0gLv4.js → chart-activity-grid-BnY-jaoa.js} +26 -6
- package/dist/client/chunks/chart-activity-grid-BnY-jaoa.js.map +1 -0
- package/dist/client/chunks/{chart-area-DDti9Qtp.js → chart-area-G3OvLLK4.js} +2 -2
- package/dist/client/chunks/{chart-area-DDti9Qtp.js.map → chart-area-G3OvLLK4.js.map} +1 -1
- package/dist/client/chunks/{chart-bar-B3s9qDlh.js → chart-bar-MLIWiLrc.js} +3 -3
- package/dist/client/chunks/{chart-bar-B3s9qDlh.js.map → chart-bar-MLIWiLrc.js.map} +1 -1
- package/dist/client/chunks/{chart-box-plot-o-h9MRX5.js → chart-box-plot-c2XqKTWq.js} +2 -2
- package/dist/client/chunks/{chart-box-plot-o-h9MRX5.js.map → chart-box-plot-c2XqKTWq.js.map} +1 -1
- package/dist/client/chunks/{chart-bubble-CMDp4Pfm.js → chart-bubble-CAGvnYb1.js} +2 -2
- package/dist/client/chunks/{chart-bubble-CMDp4Pfm.js.map → chart-bubble-CAGvnYb1.js.map} +1 -1
- package/dist/client/chunks/{chart-candlestick-WyANJ0Ky.js → chart-candlestick-oSPk-KQp.js} +2 -2
- package/dist/client/chunks/{chart-candlestick-WyANJ0Ky.js.map → chart-candlestick-oSPk-KQp.js.map} +1 -1
- package/dist/client/chunks/{chart-config-activity-grid-C-EkgYoa.js → chart-config-activity-grid-Dssynumw.js} +8 -1
- package/dist/client/chunks/chart-config-activity-grid-Dssynumw.js.map +1 -0
- package/dist/client/chunks/{chart-config-area-CMZpbIah.js → chart-config-area-40fbx2Ah.js} +8 -1
- package/dist/client/chunks/chart-config-area-40fbx2Ah.js.map +1 -0
- package/dist/client/chunks/{chart-config-bar-B8_V4YLg.js → chart-config-bar-CUWHwOPN.js} +8 -1
- package/dist/client/chunks/chart-config-bar-CUWHwOPN.js.map +1 -0
- package/dist/client/chunks/{chart-config-box-plot-Dwj7sEbU.js → chart-config-box-plot-D3Y0ien3.js} +8 -1
- package/dist/client/chunks/chart-config-box-plot-D3Y0ien3.js.map +1 -0
- package/dist/client/chunks/{chart-config-bubble-B0w0ZVp4.js → chart-config-bubble-BXSTKLn-.js} +8 -1
- package/dist/client/chunks/chart-config-bubble-BXSTKLn-.js.map +1 -0
- package/dist/client/chunks/{chart-config-candlestick-Bvo3zeIn.js → chart-config-candlestick-DEuD2Av0.js} +8 -1
- package/dist/client/chunks/chart-config-candlestick-DEuD2Av0.js.map +1 -0
- package/dist/client/chunks/{chart-config-gauge-C5ZiyZy7.js → chart-config-gauge-CCva3FfA.js} +5 -1
- package/dist/client/chunks/chart-config-gauge-CCva3FfA.js.map +1 -0
- package/dist/client/chunks/{chart-config-heat-map-Cv8qNnVP.js → chart-config-heat-map-Db4Z8UUn.js} +8 -1
- package/dist/client/chunks/chart-config-heat-map-Db4Z8UUn.js.map +1 -0
- package/dist/client/chunks/{chart-config-kpi-delta-BraHQc2E.js → chart-config-kpi-delta-BfLf3iyi.js} +8 -1
- package/dist/client/chunks/chart-config-kpi-delta-BfLf3iyi.js.map +1 -0
- package/dist/client/chunks/{chart-config-kpi-number-CeCkx7mC.js → chart-config-kpi-number-DWKFc9PX.js} +5 -1
- package/dist/client/chunks/chart-config-kpi-number-DWKFc9PX.js.map +1 -0
- package/dist/client/chunks/{chart-config-kpi-text-CImM3SvH.js → chart-config-kpi-text-Dr4OG6cY.js} +5 -1
- package/dist/client/chunks/chart-config-kpi-text-Dr4OG6cY.js.map +1 -0
- package/dist/client/chunks/{chart-config-line-BVKapAQK.js → chart-config-line-DGYYdDw9.js} +8 -1
- package/dist/client/chunks/chart-config-line-DGYYdDw9.js.map +1 -0
- package/dist/client/chunks/{chart-config-measure-profile-KTVV1gO3.js → chart-config-measure-profile-sB3n_Azv.js} +5 -1
- package/dist/client/chunks/chart-config-measure-profile-sB3n_Azv.js.map +1 -0
- package/dist/client/chunks/{chart-config-pie-BZxVl25X.js → chart-config-pie-kte7OXa9.js} +8 -1
- package/dist/client/chunks/chart-config-pie-kte7OXa9.js.map +1 -0
- package/dist/client/chunks/{chart-config-radar-B7FByX3t.js → chart-config-radar-C9IxP5tc.js} +8 -1
- package/dist/client/chunks/chart-config-radar-C9IxP5tc.js.map +1 -0
- package/dist/client/chunks/{chart-config-radial-bar-UfW_3yyX.js → chart-config-radial-bar-C3WJ8Uhm.js} +8 -1
- package/dist/client/chunks/chart-config-radial-bar-C3WJ8Uhm.js.map +1 -0
- package/dist/client/chunks/{chart-config-scatter-BVVJuOnt.js → chart-config-scatter-BVN_29G5.js} +8 -1
- package/dist/client/chunks/chart-config-scatter-BVN_29G5.js.map +1 -0
- package/dist/client/chunks/{chart-config-tree-map-IHp97OyV.js → chart-config-tree-map-meeJEDi8.js} +8 -1
- package/dist/client/chunks/chart-config-tree-map-meeJEDi8.js.map +1 -0
- package/dist/client/chunks/{chart-config-waterfall-BdqG1V-x.js → chart-config-waterfall-CaPeWZMl.js} +8 -1
- package/dist/client/chunks/chart-config-waterfall-CaPeWZMl.js.map +1 -0
- package/dist/client/chunks/{chart-data-table-Qrt6EAno.js → chart-data-table-BRXHT2H-.js} +68 -68
- package/dist/client/chunks/chart-data-table-BRXHT2H-.js.map +1 -0
- package/dist/client/chunks/{chart-funnel-C7pgktN5.js → chart-funnel-aQ7G_CqU.js} +2 -2
- package/dist/client/chunks/{chart-funnel-C7pgktN5.js.map → chart-funnel-aQ7G_CqU.js.map} +1 -1
- package/dist/client/chunks/{chart-gauge-D2r2B_AR.js → chart-gauge-DqbDKr9E.js} +2 -2
- package/dist/client/chunks/{chart-gauge-D2r2B_AR.js.map → chart-gauge-DqbDKr9E.js.map} +1 -1
- package/dist/client/chunks/{chart-heat-map-Dw2yjwfO.js → chart-heat-map--6QnhUM8.js} +2 -2
- package/dist/client/chunks/{chart-heat-map-Dw2yjwfO.js.map → chart-heat-map--6QnhUM8.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-delta-CgldZ7zO.js → chart-kpi-delta-DOSpRjfs.js} +3 -3
- package/dist/client/chunks/{chart-kpi-delta-CgldZ7zO.js.map → chart-kpi-delta-DOSpRjfs.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-number-ByfuX1ki.js → chart-kpi-number-BcMjeKm8.js} +5 -5
- package/dist/client/chunks/{chart-kpi-number-ByfuX1ki.js.map → chart-kpi-number-BcMjeKm8.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-text-DeNuDraJ.js → chart-kpi-text-BI9isc2i.js} +3 -3
- package/dist/client/chunks/{chart-kpi-text-DeNuDraJ.js.map → chart-kpi-text-BI9isc2i.js.map} +1 -1
- package/dist/client/chunks/{chart-line-RdZwtk27.js → chart-line-C0IHQteu.js} +3 -3
- package/dist/client/chunks/{chart-line-RdZwtk27.js.map → chart-line-C0IHQteu.js.map} +1 -1
- package/dist/client/chunks/{chart-markdown-CiGRZdJj.js → chart-markdown-BmgSMqPg.js} +2 -2
- package/dist/client/chunks/{chart-markdown-CiGRZdJj.js.map → chart-markdown-BmgSMqPg.js.map} +1 -1
- package/dist/client/chunks/{chart-measure-profile-Ckjw9bX6.js → chart-measure-profile-DEyLW1fd.js} +3 -3
- package/dist/client/chunks/{chart-measure-profile-Ckjw9bX6.js.map → chart-measure-profile-DEyLW1fd.js.map} +1 -1
- package/dist/client/chunks/{chart-pie-BvY4FY__.js → chart-pie-DSIekr7p.js} +3 -3
- package/dist/client/chunks/{chart-pie-BvY4FY__.js.map → chart-pie-DSIekr7p.js.map} +1 -1
- package/dist/client/chunks/{chart-radar-DjiiEAmc.js → chart-radar-SGl62hK8.js} +3 -3
- package/dist/client/chunks/{chart-radar-DjiiEAmc.js.map → chart-radar-SGl62hK8.js.map} +1 -1
- package/dist/client/chunks/{chart-radial-bar-lla_JEYu.js → chart-radial-bar-C42EykOa.js} +3 -3
- package/dist/client/chunks/{chart-radial-bar-lla_JEYu.js.map → chart-radial-bar-C42EykOa.js.map} +1 -1
- package/dist/client/chunks/{chart-sankey-WwkZAhLy.js → chart-sankey-DguImp0W.js} +2 -2
- package/dist/client/chunks/{chart-sankey-WwkZAhLy.js.map → chart-sankey-DguImp0W.js.map} +1 -1
- package/dist/client/chunks/{chart-scatter-DwXnI0rr.js → chart-scatter-Doeox4OP.js} +3 -3
- package/dist/client/chunks/{chart-scatter-DwXnI0rr.js.map → chart-scatter-Doeox4OP.js.map} +1 -1
- package/dist/client/chunks/{chart-sunburst-CIDB_pTl.js → chart-sunburst-F3tgCpL-.js} +3 -3
- package/dist/client/chunks/{chart-sunburst-CIDB_pTl.js.map → chart-sunburst-F3tgCpL-.js.map} +1 -1
- package/dist/client/chunks/{chart-tree-map-DJHoA26f.js → chart-tree-map-DvuSCIc8.js} +3 -3
- package/dist/client/chunks/{chart-tree-map-DJHoA26f.js.map → chart-tree-map-DvuSCIc8.js.map} +1 -1
- package/dist/client/chunks/{chart-waterfall-Y7c8csO5.js → chart-waterfall-Be5duXlO.js} +3 -3
- package/dist/client/chunks/{chart-waterfall-Y7c8csO5.js.map → chart-waterfall-Be5duXlO.js.map} +1 -1
- package/dist/client/chunks/{charts-core-BXOqaYFn.js → charts-core-XlOwoP_r.js} +2 -2
- package/dist/client/chunks/{charts-core-BXOqaYFn.js.map → charts-core-XlOwoP_r.js.map} +1 -1
- package/dist/client/chunks/{nl-NL-vCifBijs.js → nl-NL-BLDeSy_P.js} +24 -4
- package/dist/client/chunks/nl-NL-BLDeSy_P.js.map +1 -0
- package/dist/client/chunks/{schema-visualization-DWwJukK7.js → schema-visualization-CM5ikSWB.js} +4 -4
- package/dist/client/chunks/{schema-visualization-DWwJukK7.js.map → schema-visualization-CM5ikSWB.js.map} +1 -1
- package/dist/client/chunks/{useDebounce-DyJVREop.js → useDebounce-NEZQbfxN.js} +4 -4
- package/dist/client/chunks/{useDebounce-DyJVREop.js.map → useDebounce-NEZQbfxN.js.map} +1 -1
- package/dist/client/chunks/{useExplainAI-CxSkjocM.js → useExplainAI-DivfI0dW.js} +4 -4
- package/dist/client/chunks/{useExplainAI-CxSkjocM.js.map → useExplainAI-DivfI0dW.js.map} +1 -1
- package/dist/client/chunks/{utils-BHZdKxua.js → utils-Ctl_cVNR.js} +2 -2
- package/dist/client/chunks/{utils-BHZdKxua.js.map → utils-Ctl_cVNR.js.map} +1 -1
- package/dist/client/chunks/{vendor-CBD_Olr0.js → vendor-BcLQ6iVZ.js} +2 -2
- package/dist/client/chunks/{vendor-CBD_Olr0.js.map → vendor-BcLQ6iVZ.js.map} +1 -1
- package/dist/client/components/AnalysisBuilder/types.d.ts +2 -2
- package/dist/client/components.js +3 -3
- package/dist/client/hooks.js +3 -3
- package/dist/client/icons.js +1 -1
- package/dist/client/index.js +14 -14
- package/dist/client/providers.js +1 -1
- package/dist/client/schema.js +1 -1
- package/dist/client/shared/chartDefaults.d.ts +5 -10
- package/dist/client/utils.js +5 -5
- package/dist/client-bundle-stats.html +1 -1
- package/dist/mcp-app/mcp-app.html +24 -24
- package/dist/server/index.cjs +135 -134
- package/dist/server/index.js +1128 -948
- package/package.json +2 -2
- package/dist/adapters/mcp-prompts-BUFyQLHQ.js +0 -377
- package/dist/adapters/mcp-prompts-B_NvEJT_.cjs +0 -111
- package/dist/adapters/mcp-transport-B0mgxRnJ.js +0 -579
- package/dist/adapters/mcp-transport-irsahKmD.cjs +0 -39
- package/dist/adapters/utils-XPOzzMdY.cjs +0 -17
- package/dist/client/chunks/KpiDelta-_igN6cJa.js +0 -2
- package/dist/client/chunks/KpiNumber-t5n8PtRU.js +0 -2
- package/dist/client/chunks/KpiText-BCZJJ6a0.js +0 -2
- package/dist/client/chunks/SchemaVisualization-BUUhlOvG.js +0 -2
- package/dist/client/chunks/SchemaVisualizationLazy-CwaPCUL0.js +0 -2
- package/dist/client/chunks/af-ZA-xDmO5F0s.js.map +0 -1
- package/dist/client/chunks/analysis-builder-Dm6eD_AX.js.map +0 -1
- package/dist/client/chunks/analysis-builder-shared-DT5bXwCA.js.map +0 -1
- package/dist/client/chunks/chart-activity-grid-CWT0gLv4.js.map +0 -1
- package/dist/client/chunks/chart-config-activity-grid-C-EkgYoa.js.map +0 -1
- package/dist/client/chunks/chart-config-area-CMZpbIah.js.map +0 -1
- package/dist/client/chunks/chart-config-bar-B8_V4YLg.js.map +0 -1
- package/dist/client/chunks/chart-config-box-plot-Dwj7sEbU.js.map +0 -1
- package/dist/client/chunks/chart-config-bubble-B0w0ZVp4.js.map +0 -1
- package/dist/client/chunks/chart-config-candlestick-Bvo3zeIn.js.map +0 -1
- package/dist/client/chunks/chart-config-gauge-C5ZiyZy7.js.map +0 -1
- package/dist/client/chunks/chart-config-heat-map-Cv8qNnVP.js.map +0 -1
- package/dist/client/chunks/chart-config-kpi-delta-BraHQc2E.js.map +0 -1
- package/dist/client/chunks/chart-config-kpi-number-CeCkx7mC.js.map +0 -1
- package/dist/client/chunks/chart-config-kpi-text-CImM3SvH.js.map +0 -1
- package/dist/client/chunks/chart-config-line-BVKapAQK.js.map +0 -1
- package/dist/client/chunks/chart-config-measure-profile-KTVV1gO3.js.map +0 -1
- package/dist/client/chunks/chart-config-pie-BZxVl25X.js.map +0 -1
- package/dist/client/chunks/chart-config-radar-B7FByX3t.js.map +0 -1
- package/dist/client/chunks/chart-config-radial-bar-UfW_3yyX.js.map +0 -1
- package/dist/client/chunks/chart-config-scatter-BVVJuOnt.js.map +0 -1
- package/dist/client/chunks/chart-config-tree-map-IHp97OyV.js.map +0 -1
- package/dist/client/chunks/chart-config-waterfall-BdqG1V-x.js.map +0 -1
- package/dist/client/chunks/chart-data-table-Qrt6EAno.js.map +0 -1
- package/dist/client/chunks/nl-NL-vCifBijs.js.map +0 -1
- /package/dist/adapters/{anthropic-Cto4Jxqt.cjs → anthropic-BIva8k1r.cjs} +0 -0
- /package/dist/adapters/{anthropic-DpEbCVvF.js → anthropic-B_rg0BhK.js} +0 -0
- /package/dist/adapters/{dist-BnyV9wfA.cjs → dist-Boc63-1q.cjs} +0 -0
- /package/dist/adapters/{dist-DjVh2RFz.js → dist-De5fzUEM.js} +0 -0
- /package/dist/adapters/{openai-CoqT_FM5.cjs → openai-Bgri5TJc.cjs} +0 -0
- /package/dist/adapters/{openai-D0Nsvc9L.js → openai-CuUGrKaK.js} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as e, f as t, o as n, r, u as i } from "../utils-
|
|
2
|
-
import { i as a, n as o, r as s, t as c } from "../locale-
|
|
3
|
-
import {
|
|
4
|
-
import { Hono as
|
|
1
|
+
import { a as e, f as t, o as n, r, u as i } from "../utils-hC7Z8V39.js";
|
|
2
|
+
import { i as a, n as o, r as s, t as c } from "../locale-wMBdZ3Ks.js";
|
|
3
|
+
import { C as l, S as u, _ as d, a as f, b as p, c as m, g as h, h as g, i as _, l as v, m as y, o as b, r as x, u as S, v as C, x as w, y as T } from "../mcp-transport-B_HoB1HQ.js";
|
|
4
|
+
import { Hono as E } from "hono";
|
|
5
5
|
//#region node_modules/hono/dist/middleware/cors/index.js
|
|
6
|
-
var
|
|
6
|
+
var D = (e) => {
|
|
7
7
|
let t = {
|
|
8
8
|
origin: "*",
|
|
9
9
|
allowMethods: [
|
|
@@ -43,36 +43,36 @@ var E = (e) => {
|
|
|
43
43
|
};
|
|
44
44
|
//#endregion
|
|
45
45
|
//#region src/adapters/hono/index.ts
|
|
46
|
-
function
|
|
47
|
-
let { cubes:
|
|
48
|
-
if (!
|
|
49
|
-
let
|
|
50
|
-
if (
|
|
46
|
+
function O(O) {
|
|
47
|
+
let { cubes: k, drizzle: A, schema: j, extractSecurityContext: M, engineType: N, cors: P, basePath: F = "/cubejs-api/v1", cache: I, mcp: L = { enabled: !0 }, agent: R } = O;
|
|
48
|
+
if (!O.semanticLayer && (!k || k.length === 0)) throw Error("Either semanticLayer or a non-empty cubes array must be provided");
|
|
49
|
+
let z = new E(), B = async (e) => s(await M(e), o((t) => e.req.header(t)));
|
|
50
|
+
if (P) {
|
|
51
51
|
let e = {
|
|
52
|
-
...
|
|
53
|
-
allowHeaders: c(
|
|
52
|
+
...P,
|
|
53
|
+
allowHeaders: c(P.allowHeaders)
|
|
54
54
|
};
|
|
55
|
-
|
|
55
|
+
z.use("/*", D(e));
|
|
56
56
|
}
|
|
57
|
-
let
|
|
58
|
-
drizzle:
|
|
59
|
-
schema:
|
|
60
|
-
engineType:
|
|
61
|
-
cache:
|
|
62
|
-
rlsSetup:
|
|
57
|
+
let V = O.semanticLayer ?? new a({
|
|
58
|
+
drizzle: A,
|
|
59
|
+
schema: j,
|
|
60
|
+
engineType: N,
|
|
61
|
+
cache: I,
|
|
62
|
+
rlsSetup: O.rlsSetup
|
|
63
63
|
});
|
|
64
|
-
if (!
|
|
65
|
-
|
|
66
|
-
}),
|
|
64
|
+
if (!O.semanticLayer && k && k.forEach((e) => {
|
|
65
|
+
V.registerCube(e);
|
|
66
|
+
}), z.post(`${F}/load`, async (e) => {
|
|
67
67
|
try {
|
|
68
|
-
let t = await e.req.json(), n = t.query || t, i = await
|
|
68
|
+
let t = await e.req.json(), n = t.query || t, i = await B(e), a = V.validateQuery(n);
|
|
69
69
|
if (!a.isValid) return e.json({ error: `Query validation failed: ${a.errors.join(", ")}` }, 400);
|
|
70
|
-
let o = e.req.header("x-cache-control") === "no-cache", s = await
|
|
71
|
-
return e.json(r(n, s,
|
|
70
|
+
let o = e.req.header("x-cache-control") === "no-cache", s = await V.executeMultiCubeQuery(n, i, { skipCache: o });
|
|
71
|
+
return e.json(r(n, s, V));
|
|
72
72
|
} catch (t) {
|
|
73
73
|
return console.error("Query execution error:", t), e.json({ error: t instanceof Error ? t.message : "Query execution failed" }, 500);
|
|
74
74
|
}
|
|
75
|
-
}),
|
|
75
|
+
}), z.get(`${F}/load`, async (e) => {
|
|
76
76
|
try {
|
|
77
77
|
let t = e.req.query("query");
|
|
78
78
|
if (!t) return e.json({ error: "Query parameter is required" }, 400);
|
|
@@ -82,57 +82,57 @@ function D(D) {
|
|
|
82
82
|
} catch {
|
|
83
83
|
return e.json({ error: "Invalid JSON in query parameter" }, 400);
|
|
84
84
|
}
|
|
85
|
-
let i = await
|
|
85
|
+
let i = await B(e), a = V.validateQuery(n);
|
|
86
86
|
if (!a.isValid) return e.json({ error: `Query validation failed: ${a.errors.join(", ")}` }, 400);
|
|
87
|
-
let o = e.req.header("x-cache-control") === "no-cache", s = await
|
|
88
|
-
return e.json(r(n, s,
|
|
87
|
+
let o = e.req.header("x-cache-control") === "no-cache", s = await V.executeMultiCubeQuery(n, i, { skipCache: o });
|
|
88
|
+
return e.json(r(n, s, V));
|
|
89
89
|
} catch (t) {
|
|
90
90
|
return console.error("Query execution error:", t), e.json({ error: t instanceof Error ? t.message : "Query execution failed" }, 500);
|
|
91
91
|
}
|
|
92
|
-
}),
|
|
92
|
+
}), z.post(`${F}/batch`, async (e) => {
|
|
93
93
|
try {
|
|
94
94
|
let { queries: t } = await e.req.json();
|
|
95
95
|
if (!t || !Array.isArray(t)) return e.json({ error: "Request body must contain a \"queries\" array" }, 400);
|
|
96
96
|
if (t.length === 0) return e.json({ error: "Queries array cannot be empty" }, 400);
|
|
97
|
-
let n = await i(t, await
|
|
97
|
+
let n = await i(t, await B(e), V, { skipCache: e.req.header("x-cache-control") === "no-cache" });
|
|
98
98
|
return e.json(n);
|
|
99
99
|
} catch (t) {
|
|
100
100
|
return console.error("Batch execution error:", t), e.json({ error: t instanceof Error ? t.message : "Batch execution failed" }, 500);
|
|
101
101
|
}
|
|
102
|
-
}),
|
|
102
|
+
}), z.get(`${F}/meta`, (t) => {
|
|
103
103
|
try {
|
|
104
|
-
let n =
|
|
104
|
+
let n = V.getMetadata();
|
|
105
105
|
return t.json(e(n));
|
|
106
106
|
} catch (e) {
|
|
107
107
|
return console.error("Metadata error:", e), t.json({ error: e instanceof Error ? e.message : "Failed to fetch metadata" }, 500);
|
|
108
108
|
}
|
|
109
|
-
}),
|
|
109
|
+
}), z.post(`${F}/sql`, async (e) => {
|
|
110
110
|
try {
|
|
111
|
-
let t = await e.req.json(), r = await
|
|
111
|
+
let t = await e.req.json(), r = await B(e), i = V.validateQuery(t);
|
|
112
112
|
if (!i.isValid) return e.json({ error: `Query validation failed: ${i.errors.join(", ")}` }, 400);
|
|
113
113
|
let a = t.measures?.[0] || t.dimensions?.[0];
|
|
114
114
|
if (!a) return e.json({ error: "No measures or dimensions specified" }, 400);
|
|
115
|
-
let o = a.split(".")[0], s = await
|
|
115
|
+
let o = a.split(".")[0], s = await V.generateSQL(o, t, r);
|
|
116
116
|
return e.json(n(t, s));
|
|
117
117
|
} catch (t) {
|
|
118
118
|
return console.error("SQL generation error:", t), e.json({ error: t instanceof Error ? t.message : "SQL generation failed" }, 500);
|
|
119
119
|
}
|
|
120
|
-
}),
|
|
120
|
+
}), z.get(`${F}/sql`, async (e) => {
|
|
121
121
|
try {
|
|
122
122
|
let t = e.req.query("query");
|
|
123
123
|
if (!t) return e.json({ error: "Query parameter is required" }, 400);
|
|
124
|
-
let r = JSON.parse(t), i = await
|
|
124
|
+
let r = JSON.parse(t), i = await B(e), a = V.validateQuery(r);
|
|
125
125
|
if (!a.isValid) return e.json({ error: `Query validation failed: ${a.errors.join(", ")}` }, 400);
|
|
126
126
|
let o = r.measures?.[0] || r.dimensions?.[0];
|
|
127
127
|
if (!o) return e.json({ error: "No measures or dimensions specified" }, 400);
|
|
128
|
-
let s = o.split(".")[0], c = await
|
|
128
|
+
let s = o.split(".")[0], c = await V.generateSQL(s, r, i);
|
|
129
129
|
return e.json(n(r, c));
|
|
130
130
|
} catch (t) {
|
|
131
131
|
return console.error("SQL generation error:", t), e.json({ error: t instanceof Error ? t.message : "SQL generation failed" }, 500);
|
|
132
132
|
}
|
|
133
|
-
}),
|
|
133
|
+
}), z.post(`${F}/dry-run`, async (e) => {
|
|
134
134
|
try {
|
|
135
|
-
let n = await e.req.json(), r = await t(n.query || n, await
|
|
135
|
+
let n = await e.req.json(), r = await t(n.query || n, await B(e), V);
|
|
136
136
|
return e.json(r);
|
|
137
137
|
} catch (t) {
|
|
138
138
|
return console.error("Dry-run error:", t), e.json({
|
|
@@ -140,14 +140,14 @@ function D(D) {
|
|
|
140
140
|
valid: !1
|
|
141
141
|
}, 400);
|
|
142
142
|
}
|
|
143
|
-
}),
|
|
143
|
+
}), z.get(`${F}/dry-run`, async (e) => {
|
|
144
144
|
try {
|
|
145
145
|
let n = e.req.query("query");
|
|
146
146
|
if (!n) return e.json({
|
|
147
147
|
error: "Query parameter is required",
|
|
148
148
|
valid: !1
|
|
149
149
|
}, 400);
|
|
150
|
-
let r = await t(JSON.parse(n), await
|
|
150
|
+
let r = await t(JSON.parse(n), await B(e), V);
|
|
151
151
|
return e.json(r);
|
|
152
152
|
} catch (t) {
|
|
153
153
|
return console.error("Dry-run error:", t), e.json({
|
|
@@ -155,34 +155,34 @@ function D(D) {
|
|
|
155
155
|
valid: !1
|
|
156
156
|
}, 400);
|
|
157
157
|
}
|
|
158
|
-
}),
|
|
158
|
+
}), z.post(`${F}/explain`, async (e) => {
|
|
159
159
|
try {
|
|
160
|
-
let t = await e.req.json(), n = t.query || t, r = t.options || {}, i = await
|
|
160
|
+
let t = await e.req.json(), n = t.query || t, r = t.options || {}, i = await B(e), a = V.validateQuery(n);
|
|
161
161
|
if (!a.isValid) return e.json({ error: `Query validation failed: ${a.errors.join(", ")}` }, 400);
|
|
162
|
-
let o = await
|
|
162
|
+
let o = await V.explainQuery(n, i, r);
|
|
163
163
|
return e.json(o);
|
|
164
164
|
} catch (t) {
|
|
165
165
|
return console.error("Explain error:", t), e.json({ error: t instanceof Error ? t.message : "Explain query failed" }, 500);
|
|
166
166
|
}
|
|
167
|
-
}),
|
|
167
|
+
}), R && z.post(`${F}/agent/chat`, async (e) => {
|
|
168
168
|
try {
|
|
169
|
-
let { handleAgentChat: t } = await import("../handler-
|
|
169
|
+
let { handleAgentChat: t } = await import("../handler-CoaNnZyf.js"), { message: n, sessionId: r, history: i } = await e.req.json();
|
|
170
170
|
if (!n || typeof n != "string") return e.json({ error: "message is required and must be a string" }, 400);
|
|
171
|
-
let a = (
|
|
172
|
-
if (
|
|
171
|
+
let a = (R.apiKey || "").trim();
|
|
172
|
+
if (R.allowClientApiKey) {
|
|
173
173
|
let t = e.req.header("x-agent-api-key");
|
|
174
174
|
t && (a = t.trim());
|
|
175
175
|
}
|
|
176
176
|
if (!a) return e.json({ error: "No API key configured. Set agent.apiKey in server config or send X-Agent-Api-Key header." }, 401);
|
|
177
|
-
let o =
|
|
177
|
+
let o = R.allowClientApiKey ? e.req.header("x-agent-provider") : void 0, s = R.allowClientApiKey ? e.req.header("x-agent-model") : void 0, c = R.allowClientApiKey ? e.req.header("x-agent-provider-endpoint") : void 0, l = await B(e), u = R.buildSystemContext?.(l), d = new TextEncoder(), f = new ReadableStream({ async start(e) {
|
|
178
178
|
try {
|
|
179
179
|
let f = t({
|
|
180
180
|
message: n,
|
|
181
181
|
sessionId: r,
|
|
182
182
|
history: i,
|
|
183
|
-
semanticLayer:
|
|
183
|
+
semanticLayer: V,
|
|
184
184
|
securityContext: l,
|
|
185
|
-
agentConfig:
|
|
185
|
+
agentConfig: R,
|
|
186
186
|
apiKey: a,
|
|
187
187
|
systemContext: u,
|
|
188
188
|
providerOverride: o,
|
|
@@ -214,40 +214,41 @@ function D(D) {
|
|
|
214
214
|
} catch (t) {
|
|
215
215
|
return console.error("Agent chat error:", t), e.json({ error: t instanceof Error ? t.message : "Agent chat failed" }, 500);
|
|
216
216
|
}
|
|
217
|
-
}),
|
|
218
|
-
let e =
|
|
219
|
-
|
|
220
|
-
if (
|
|
221
|
-
let
|
|
222
|
-
if (!
|
|
223
|
-
let
|
|
224
|
-
if (!
|
|
225
|
-
let
|
|
226
|
-
if (!
|
|
217
|
+
}), L.enabled !== !1) {
|
|
218
|
+
let e = b(V, L.resources), t = T(L.prompts), n = C(L.instructions), r = L.basePath ?? "/mcp";
|
|
219
|
+
z.post(`${r}`, async (r) => {
|
|
220
|
+
if (L.resourceMetadataUrl && !S(r.req.header("authorization"))) return r.header("WWW-Authenticate", m(L.resourceMetadataUrl)), r.json({ error: "Bearer token required" }, 401);
|
|
221
|
+
let i = u(r.req.header("origin"), L.allowedOrigins ? { allowedOrigins: L.allowedOrigins } : {});
|
|
222
|
+
if (!i.valid) return r.json(_(null, -32600, i.reason), 403);
|
|
223
|
+
let a = r.req.header("accept");
|
|
224
|
+
if (!w(a)) return r.json(_(null, -32600, "Accept header must include both application/json and text/event-stream"), 400);
|
|
225
|
+
let o = g(r.req.header());
|
|
226
|
+
if (!o.ok) return r.json({
|
|
227
227
|
error: "Unsupported MCP protocol version",
|
|
228
|
-
supported:
|
|
228
|
+
supported: o.supported
|
|
229
229
|
}, 426);
|
|
230
|
-
let
|
|
231
|
-
if (!
|
|
232
|
-
let
|
|
230
|
+
let s = h(await r.req.json().catch(() => null));
|
|
231
|
+
if (!s) return r.json(_(null, -32600, "Invalid JSON-RPC 2.0 request"), 400);
|
|
232
|
+
let c = l(a), b = s.method === "initialize";
|
|
233
233
|
try {
|
|
234
|
-
let
|
|
235
|
-
semanticLayer:
|
|
236
|
-
extractSecurityContext: (e, t) =>
|
|
237
|
-
rawRequest:
|
|
234
|
+
let i = await v(s.method, s.params, {
|
|
235
|
+
semanticLayer: V,
|
|
236
|
+
extractSecurityContext: (e, t) => B(e),
|
|
237
|
+
rawRequest: r,
|
|
238
238
|
rawResponse: null,
|
|
239
|
-
negotiatedProtocol:
|
|
239
|
+
negotiatedProtocol: o.negotiated,
|
|
240
240
|
resources: e,
|
|
241
241
|
prompts: t,
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
242
|
+
instructions: n,
|
|
243
|
+
appEnabled: !!L.app,
|
|
244
|
+
appConfig: typeof L.app == "object" ? L.app : void 0,
|
|
245
|
+
serverName: L.serverName
|
|
245
246
|
});
|
|
246
|
-
if (
|
|
247
|
-
let
|
|
248
|
-
if (l && (
|
|
249
|
-
let e = new TextEncoder(), t =
|
|
250
|
-
n.enqueue(e.encode(`id: ${t}\n\n`)), n.enqueue(e.encode(
|
|
247
|
+
if (y(s)) return r.body(null, 202);
|
|
248
|
+
let a = f(s.id ?? null, i), l = b && i && typeof i == "object" && "sessionId" in i ? i.sessionId : void 0, u = {};
|
|
249
|
+
if (l && (u[x] = l), c) {
|
|
250
|
+
let e = new TextEncoder(), t = d(), n = new ReadableStream({ start(n) {
|
|
251
|
+
n.enqueue(e.encode(`id: ${t}\n\n`)), n.enqueue(e.encode(p(a, t))), n.close();
|
|
251
252
|
} });
|
|
252
253
|
return new Response(n, {
|
|
253
254
|
status: 200,
|
|
@@ -255,18 +256,18 @@ function D(D) {
|
|
|
255
256
|
"Content-Type": "text/event-stream",
|
|
256
257
|
"Cache-Control": "no-cache",
|
|
257
258
|
Connection: "keep-alive",
|
|
258
|
-
...
|
|
259
|
+
...u
|
|
259
260
|
}
|
|
260
261
|
});
|
|
261
262
|
}
|
|
262
|
-
return
|
|
263
|
+
return r.json(a, 200, u);
|
|
263
264
|
} catch (e) {
|
|
264
|
-
if (
|
|
265
|
+
if (y(s)) return console.error("MCP notification processing error:", e), r.body(null, 202);
|
|
265
266
|
console.error("MCP RPC error:", e);
|
|
266
|
-
let t = e?.code ?? -32603,
|
|
267
|
-
if (
|
|
268
|
-
let e = new TextEncoder(), t =
|
|
269
|
-
n.enqueue(e.encode(`id: ${t}\n\n`)), n.enqueue(e.encode(
|
|
267
|
+
let t = e?.code ?? -32603, n = e?.data, i = e.message || "MCP request failed", a = _(s.id ?? null, t, i, n);
|
|
268
|
+
if (c) {
|
|
269
|
+
let e = new TextEncoder(), t = d(), n = new ReadableStream({ start(n) {
|
|
270
|
+
n.enqueue(e.encode(`id: ${t}\n\n`)), n.enqueue(e.encode(p(a, t))), n.close();
|
|
270
271
|
} });
|
|
271
272
|
return new Response(n, {
|
|
272
273
|
status: 200,
|
|
@@ -277,13 +278,13 @@ function D(D) {
|
|
|
277
278
|
}
|
|
278
279
|
});
|
|
279
280
|
}
|
|
280
|
-
return
|
|
281
|
+
return r.json(a, 200);
|
|
281
282
|
}
|
|
282
|
-
}),
|
|
283
|
-
if (
|
|
284
|
-
let t = new TextEncoder(), n =
|
|
283
|
+
}), z.delete(`${r}`, (e) => L.resourceMetadataUrl && !S(e.req.header("authorization")) ? (e.header("WWW-Authenticate", m(L.resourceMetadataUrl)), e.json({ error: "Bearer token required" }, 401)) : e.json({ error: "Session termination not supported" }, 405)), z.get(`${r}`, (e) => {
|
|
284
|
+
if (L.resourceMetadataUrl && !S(e.req.header("authorization"))) return e.header("WWW-Authenticate", m(L.resourceMetadataUrl)), e.json({ error: "Bearer token required" }, 401);
|
|
285
|
+
let t = new TextEncoder(), n = d(), r, i = new ReadableStream({
|
|
285
286
|
start(e) {
|
|
286
|
-
e.enqueue(t.encode(
|
|
287
|
+
e.enqueue(t.encode(p({
|
|
287
288
|
jsonrpc: "2.0",
|
|
288
289
|
method: "mcp/ready",
|
|
289
290
|
params: { protocol: "streamable-http" }
|
|
@@ -305,14 +306,14 @@ function D(D) {
|
|
|
305
306
|
});
|
|
306
307
|
});
|
|
307
308
|
}
|
|
308
|
-
return
|
|
309
|
+
return z;
|
|
309
310
|
}
|
|
310
|
-
function
|
|
311
|
-
let n =
|
|
311
|
+
function k(e, t) {
|
|
312
|
+
let n = O(t);
|
|
312
313
|
return e.route("/", n), e;
|
|
313
314
|
}
|
|
314
|
-
function
|
|
315
|
-
return
|
|
315
|
+
function A(e) {
|
|
316
|
+
return k(new E(), e);
|
|
316
317
|
}
|
|
317
318
|
//#endregion
|
|
318
|
-
export {
|
|
319
|
+
export { A as createCubeApp, O as createCubeRoutes, k as mountCubeRoutes };
|