drizzle-cube 0.11.0 → 0.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/adapters/{mcp-app-html-CNp0VqS_.cjs → mcp-app-html-BCkzy3a2.cjs} +1 -1
  2. package/dist/adapters/{mcp-app-html-CvWoYMO3.js → mcp-app-html-WiSFu1oD.js} +1 -1
  3. package/dist/adapters/mcp-app-html.cjs +1 -1
  4. package/dist/adapters/mcp-app-html.js +1 -1
  5. package/dist/adapters/mcp-tools.cjs +1 -1
  6. package/dist/adapters/mcp-tools.js +1 -1
  7. package/dist/cjs/client/components/AnalysisBuilder/types.d.ts +4 -0
  8. package/dist/cjs/client/components/AnalysisBuilder/utils/queryUtils.d.ts +6 -1
  9. package/dist/cjs/client/components/charts/MarkdownChart.helpers.d.ts +5 -0
  10. package/dist/cjs/client/components/markdownOverrides.d.ts +2 -0
  11. package/dist/cjs/client/types.d.ts +2 -0
  12. package/dist/client/charts.js +1 -1
  13. package/dist/client/chunks/{DashboardEditModal-CIR4aqr7.js → DashboardEditModal-BrZuaG5z.js} +5 -5
  14. package/dist/client/chunks/DashboardEditModal-BrZuaG5z.js.map +1 -0
  15. package/dist/client/chunks/{analysis-builder-DJNYt7CF.js → analysis-builder-CwKFNoe7.js} +5 -5
  16. package/dist/client/chunks/analysis-builder-CwKFNoe7.js.map +1 -0
  17. package/dist/client/chunks/{analysis-builder-shared-DPLR8upd.js → analysis-builder-shared-D1SsD4qC.js} +56 -45
  18. package/dist/client/chunks/analysis-builder-shared-D1SsD4qC.js.map +1 -0
  19. package/dist/client/chunks/{chart-markdown-DtgpU3xd.js → chart-markdown-XWU1MyCy.js} +2 -1
  20. package/dist/client/chunks/{chart-markdown-DtgpU3xd.js.map → chart-markdown-XWU1MyCy.js.map} +1 -1
  21. package/dist/client/chunks/{charts-loader-DoLQqFXg.js → charts-loader-DMdE-Azc.js} +2 -2
  22. package/dist/client/chunks/{charts-loader-DoLQqFXg.js.map → charts-loader-DMdE-Azc.js.map} +1 -1
  23. package/dist/client/chunks/{useDirtyStateTracking-DSkxAJ29.js → useDirtyStateTracking-DUyYwuN_.js} +2 -2
  24. package/dist/client/chunks/useDirtyStateTracking-DUyYwuN_.js.map +1 -0
  25. package/dist/client/chunks/{useExplainAI-DRCIVcbu.js → useExplainAI-BtoS3tb5.js} +2 -2
  26. package/dist/client/chunks/{useExplainAI-DRCIVcbu.js.map → useExplainAI-BtoS3tb5.js.map} +1 -1
  27. package/dist/client/components/AnalysisBuilder/types.d.ts +4 -0
  28. package/dist/client/components/AnalysisBuilder/utils/queryUtils.d.ts +6 -1
  29. package/dist/client/components/charts/MarkdownChart.helpers.d.ts +5 -0
  30. package/dist/client/components/markdownOverrides.d.ts +2 -0
  31. package/dist/client/components.js +1 -1
  32. package/dist/client/hooks.js +2 -2
  33. package/dist/client/index.js +37 -31
  34. package/dist/client/index.js.map +1 -1
  35. package/dist/client/types.d.ts +2 -0
  36. package/dist/client-bundle-stats.html +1 -1
  37. package/dist/mcp-app/mcp-app.html +1 -1
  38. package/package.json +1 -1
  39. package/dist/client/chunks/DashboardEditModal-CIR4aqr7.js.map +0 -1
  40. package/dist/client/chunks/analysis-builder-DJNYt7CF.js.map +0 -1
  41. package/dist/client/chunks/analysis-builder-shared-DPLR8upd.js.map +0 -1
  42. package/dist/client/chunks/useDirtyStateTracking-DSkxAJ29.js.map +0 -1
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./mcp-app-html-CNp0VqS_.cjs");exports.mcpAppHtml=e.t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./mcp-app-html-BCkzy3a2.cjs");exports.mcpAppHtml=e.t;
@@ -1,2 +1,2 @@
1
- import { t as e } from "./mcp-app-html-CvWoYMO3.js";
1
+ import { t as e } from "./mcp-app-html-WiSFu1oD.js";
2
2
  export { e as mcpAppHtml };
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./utils-a2p2B6x8.cjs"),t=require("./mcp-transport-DnLP5FPL.cjs"),n=require("./mcp-app-html-CNp0VqS_.cjs");async function r(t,n,r){let i=await t.getSecurityContext(r);return t.wrapContent(await e.p(t.semanticLayer,i,n||{}))}async function i(t,n,r){let i=n||{};if(!i.query)return t.wrapError(`query is required`);let a=await t.getSecurityContext(r);return t.wrapContent(await e.f(t.semanticLayer,a,i))}async function a(t,n,r){let i=n||{};if(!i.query)return t.wrapError(`query is required`);let a=await t.getSecurityContext(r);return t.wrapContent(await e.m(t.semanticLayer,a,i))}function o(e){return{content:[{type:`text`,text:typeof e==`string`?e:JSON.stringify(e)}],isError:!1}}function s(e){return{content:[{type:`text`,text:e instanceof Error?e.message:String(e)}],isError:!0}}function c(e){let{semanticLayer:n,getSecurityContext:c,toolPrefix:u=`drizzle_cube_`,tools:d=[`discover`,`validate`,`load`,`chart`],prompts:f=t.u(),resources:p,app:m=!1}=e,h=!!m,g=typeof m==`object`?m:void 0,_=p??t.d(),v=h?[..._,...l(g)]:_,y=t.o({appEnabled:h}),b=new Map(y.map(e=>[e.name,e])),x=d.filter(e=>b.has(e)).map(e=>{let t=b.get(e),n={name:`${u}${e}`,description:t.description,inputSchema:t.inputSchema},r=t._meta;return r&&(n._meta=r),n}),S=x.map(e=>e.name),C=new Set;for(let e of d)C.add(e),C.add(`${u}${e}`);function w(e){return C.has(e)}let T={semanticLayer:n,getSecurityContext:c,wrapContent:o,wrapError:s},E={discover:(e,t)=>r(T,e,t),validate:(e,t)=>i(T,e,t),load:(e,t)=>a(T,e,t),chart:(e,t)=>a(T,e,t)};async function D(e,t,n){let r=e.startsWith(u)?e.slice(u.length):e,i=d.includes(r)?E[r]:void 0;if(!i)return s(`Unknown tool: ${e}`);try{return await i(t,n)}catch(e){return s(e)}}return{definitions:x,handle:D,handles:w,prompts:f,resources:v,toolNames:S}}function l(e){let r=t.f(n.t,e);return r?[{uri:t.n,name:`Drizzle Cube Visualization`,description:`Interactive chart visualization for query results`,mimeType:t.t,text:r}]:[]}exports.getCubeTools=c;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./utils-a2p2B6x8.cjs"),t=require("./mcp-transport-DnLP5FPL.cjs"),n=require("./mcp-app-html-BCkzy3a2.cjs");async function r(t,n,r){let i=await t.getSecurityContext(r);return t.wrapContent(await e.p(t.semanticLayer,i,n||{}))}async function i(t,n,r){let i=n||{};if(!i.query)return t.wrapError(`query is required`);let a=await t.getSecurityContext(r);return t.wrapContent(await e.f(t.semanticLayer,a,i))}async function a(t,n,r){let i=n||{};if(!i.query)return t.wrapError(`query is required`);let a=await t.getSecurityContext(r);return t.wrapContent(await e.m(t.semanticLayer,a,i))}function o(e){return{content:[{type:`text`,text:typeof e==`string`?e:JSON.stringify(e)}],isError:!1}}function s(e){return{content:[{type:`text`,text:e instanceof Error?e.message:String(e)}],isError:!0}}function c(e){let{semanticLayer:n,getSecurityContext:c,toolPrefix:u=`drizzle_cube_`,tools:d=[`discover`,`validate`,`load`,`chart`],prompts:f=t.u(),resources:p,app:m=!1}=e,h=!!m,g=typeof m==`object`?m:void 0,_=p??t.d(),v=h?[..._,...l(g)]:_,y=t.o({appEnabled:h}),b=new Map(y.map(e=>[e.name,e])),x=d.filter(e=>b.has(e)).map(e=>{let t=b.get(e),n={name:`${u}${e}`,description:t.description,inputSchema:t.inputSchema},r=t._meta;return r&&(n._meta=r),n}),S=x.map(e=>e.name),C=new Set;for(let e of d)C.add(e),C.add(`${u}${e}`);function w(e){return C.has(e)}let T={semanticLayer:n,getSecurityContext:c,wrapContent:o,wrapError:s},E={discover:(e,t)=>r(T,e,t),validate:(e,t)=>i(T,e,t),load:(e,t)=>a(T,e,t),chart:(e,t)=>a(T,e,t)};async function D(e,t,n){let r=e.startsWith(u)?e.slice(u.length):e,i=d.includes(r)?E[r]:void 0;if(!i)return s(`Unknown tool: ${e}`);try{return await i(t,n)}catch(e){return s(e)}}return{definitions:x,handle:D,handles:w,prompts:f,resources:v,toolNames:S}}function l(e){let r=t.f(n.t,e);return r?[{uri:t.n,name:`Drizzle Cube Visualization`,description:`Interactive chart visualization for query results`,mimeType:t.t,text:r}]:[]}exports.getCubeTools=c;
@@ -1,6 +1,6 @@
1
1
  import { f as e, m as t, p as n } from "./utils-BaxFceDq.js";
2
2
  import { d as r, f as i, n as a, o, t as s, u as c } from "./mcp-transport-Cy6n4uj1.js";
3
- import { t as l } from "./mcp-app-html-CvWoYMO3.js";
3
+ import { t as l } from "./mcp-app-html-WiSFu1oD.js";
4
4
  //#region src/adapters/mcp-tools-handlers.ts
5
5
  async function u(e, t, r) {
6
6
  let i = await e.getSecurityContext(r);
@@ -31,6 +31,8 @@ export interface BreakdownItem {
31
31
  isTimeDimension: boolean;
32
32
  /** Enable period comparison for time dimensions (compares current filter period vs prior period) */
33
33
  enableComparison?: boolean;
34
+ /** Whether to fill missing buckets for this time dimension. */
35
+ fillMissingDates?: boolean;
34
36
  }
35
37
  /** Validation status for query building */
36
38
  export type ValidationStatus = 'idle' | 'validating' | 'valid' | 'invalid';
@@ -54,6 +56,8 @@ export interface AnalysisBuilderState {
54
56
  order?: Record<string, 'asc' | 'desc'>;
55
57
  /** Row limit for the query (sent to server) */
56
58
  limit?: number;
59
+ /** Value for filled time buckets; `null` leaves a gap. Unset fills with 0. */
60
+ fillMissingDatesValue?: number | null;
57
61
  validationStatus: ValidationStatus;
58
62
  validationError: string | null;
59
63
  }
@@ -9,8 +9,13 @@ export declare function buildCubeQuery(metrics: MetricItem[], breakdowns: Breakd
9
9
  * Record-grain charts list rows rather than aggregates — see
10
10
  * `ChartTypeConfig.recordGrain`. Without this, editing a records-table
11
11
  * portlet in the builder silently rebuilds its query as a grouped one.
12
+ *
13
+ * The server rejects period comparison and `fillMissingDates: true` on an
14
+ * ungrouped query, so it leaves both out and keeps the date filter. The
15
+ * breakdowns keep both settings for when the chart switches back. An
16
+ * explicit `fillMissingDates: false` stays, since the server accepts it.
12
17
  */
13
- ungrouped?: boolean): CubeQuery;
18
+ ungrouped?: boolean, fillMissingDatesValue?: number | null): CubeQuery;
14
19
  /**
15
20
  * Check if a query has any content
16
21
  */
@@ -11,8 +11,13 @@ export declare function alignmentClass(alignment: string): string;
11
11
  * The `sanitizer` is markdown-to-jsx's own, named rather than left implicit:
12
12
  * template output can carry warehouse values into link and image destinations,
13
13
  * so the protocol policy should be visible in our code.
14
+ *
15
+ * Raw HTML is never parsed: content can come from a shared dashboard, an
16
+ * imported file or (via templates) a warehouse value, and markdown-to-jsx's
17
+ * attribute stripping is not a complete XSS defence. HTML renders as text.
14
18
  */
15
19
  export declare function buildMarkdownOptions(accentColor: string, fontSize: string): {
20
+ disableParsingRawHTML: boolean;
16
21
  sanitizer: (value: string) => string | null;
17
22
  overrides: {
18
23
  h1: {
@@ -3,6 +3,7 @@ import { default as React } from 'react';
3
3
  export declare function ScrollableTable({ children, ...props }: React.HTMLAttributes<HTMLTableElement>): React.JSX.Element;
4
4
  /** Notebook canvas blocks — roomy, distinct heading sizes. */
5
5
  export declare const NOTEBOOK_MARKDOWN_OPTIONS: {
6
+ disableParsingRawHTML: boolean;
6
7
  overrides: {
7
8
  code: {
8
9
  props: {
@@ -104,6 +105,7 @@ export declare const NOTEBOOK_MARKDOWN_OPTIONS: {
104
105
  * weight, and every block margin is tighter to suit an ~85%-width bubble.
105
106
  */
106
107
  export declare const CHAT_MARKDOWN_OPTIONS: {
108
+ disableParsingRawHTML: boolean;
107
109
  overrides: {
108
110
  code: {
109
111
  props: {
@@ -403,6 +403,8 @@ export interface CubeQuery {
403
403
  limit?: number;
404
404
  offset?: number;
405
405
  segments?: string[];
406
+ /** Value for filled time buckets; `null` leaves a gap. Unset fills with 0. */
407
+ fillMissingDatesValue?: number | null;
406
408
  /** When true, returns raw row-level data without GROUP BY or aggregation */
407
409
  ungrouped?: boolean;
408
410
  /**
@@ -1,7 +1,7 @@
1
1
  import { dt as e, ft as t, gt as n, ht as r, lt as i, mt as a, pt as o, t as s, ut as c } from "./chunks/chart-data-table-Cxd0cdAl.js";
2
2
  import { d as l, l as u, s as d, u as f } from "./chunks/chart-activity-grid-Ly_-2B-f.js";
3
3
  import { t as p } from "./chunks/chart-funnel-71Kn4eeF.js";
4
- import { a as m, i as h, n as g, o as _, r as v, s as y, t as b } from "./chunks/charts-loader-DoLQqFXg.js";
4
+ import { a as m, i as h, n as g, o as _, r as v, s as y, t as b } from "./chunks/charts-loader-DMdE-Azc.js";
5
5
  import { t as x } from "./chunks/chart-area-D3l-71Wy.js";
6
6
  import { i as S } from "./chunks/utils-CToHkuhU.js";
7
7
  import { t as C } from "./chunks/chart-bar-BaTyQOqs.js";
@@ -3,12 +3,12 @@ import { n as s, t as c } from "./providers-DwQCKdGW.js";
3
3
  import { A as l, C as u, F as d, I as f, M as p, P as m, _t as h, ct as g, gt as _, j as v, v as y, y as b } from "./chart-data-table-Cxd0cdAl.js";
4
4
  import { r as x } from "./chart-sankey-CFXPybny.js";
5
5
  import { a as S, l as C, s as w } from "./retention-ChW9jYdy.js";
6
- import { i as T, t as E } from "./chart-markdown-DtgpU3xd.js";
6
+ import { i as T, t as E } from "./chart-markdown-XWU1MyCy.js";
7
7
  import { c as D, f as O, n as k, o as A, p as j, r as M, t as N } from "./dashboardExport-Db3rmUP1.js";
8
- import { A as ee, D as P, E as F, L as I, S as te, T as L, a as R, d as ne, i as re, l as z, n as ie, r as ae, s as B, t as oe, u as se, w as ce, x as le } from "./useDirtyStateTracking-DSkxAJ29.js";
8
+ import { A as ee, D as P, E as F, L as I, S as te, T as L, a as R, d as ne, i as re, l as z, n as ie, r as ae, s as B, t as oe, u as se, w as ce, x as le } from "./useDirtyStateTracking-DUyYwuN_.js";
9
9
  import { B as ue, F as V, R as H } from "./chart-activity-grid-Ly_-2B-f.js";
10
10
  import { o as de } from "./gapFilling-DKBRHcQL.js";
11
- import { a as fe, t as pe } from "./charts-loader-DoLQqFXg.js";
11
+ import { a as fe, t as pe } from "./charts-loader-DMdE-Azc.js";
12
12
  import { H as me } from "./chart-area-D3l-71Wy.js";
13
13
  import { n as he, t as U } from "./charts-core-BdEQgbqN.js";
14
14
  import { n as ge } from "./chart-gauge-BddS_9oS.js";
@@ -10252,7 +10252,7 @@ var us = ({ isOpen: e, onClose: t, title: n, size: r = "md", closeOnBackdropClic
10252
10252
  ]
10253
10253
  })
10254
10254
  }) : null;
10255
- }, ds = G(() => import("./analysis-builder-DJNYt7CF.js")), fs = W((e, t) => /* @__PURE__ */ Q(be, {
10255
+ }, ds = G(() => import("./analysis-builder-CwKFNoe7.js")), fs = W((e, t) => /* @__PURE__ */ Q(be, {
10256
10256
  fallback: /* @__PURE__ */ Q("div", {
10257
10257
  className: "dc:flex dc:items-center dc:justify-center dc:w-full dc:py-6",
10258
10258
  children: /* @__PURE__ */ Q(me, {})
@@ -12610,4 +12610,4 @@ function Fc({ isOpen: e, onClose: t, onSave: n, title: r, submitText: i, initial
12610
12610
  //#endregion
12611
12611
  export { Jt as $, Qr as A, An as B, qi as C, mi as D, Oi as E, xn as F, En as G, Mn as H, _n as I, Sn as J, kn as K, Fn as L, Gn as M, Ln as N, fi as O, In as P, $t as Q, On as R, aa as S, Ki as T, Dn as U, Tn as V, jn as W, wn as X, Cn as Y, pn as Z, ka as _, jc as a, ke as at, Yi as b, gc as c, bs as d, zt as et, gs as f, es as g, ls as h, Mc as i, Pe as it, Kn as j, ai as k, Os as l, us as m, Pc as n, Be as nt, Dc as o, Ae as ot, fs as p, Pn as q, Nc as r, je as rt, yc as s, Fc as t, xt as tt, ws as u, Sa as v, Ji as w, Xi as x, xa as y, Nn as z };
12612
12612
 
12613
- //# sourceMappingURL=DashboardEditModal-CIR4aqr7.js.map
12613
+ //# sourceMappingURL=DashboardEditModal-BrZuaG5z.js.map