@lightdash/common 3.39.0 → 3.41.0
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/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/ee/AiAgent/chartConfig/slack/getComposerSlackEchartsConfig.d.ts +16 -0
- package/dist/cjs/ee/AiAgent/chartConfig/slack/getComposerSlackEchartsConfig.d.ts.map +1 -0
- package/dist/cjs/ee/AiAgent/chartConfig/slack/getComposerSlackEchartsConfig.js +24 -0
- package/dist/cjs/ee/AiAgent/chartConfig/slack/getComposerSlackEchartsConfig.js.map +1 -0
- package/dist/cjs/ee/AiAgent/chartConfig/slack/index.d.ts +1 -0
- package/dist/cjs/ee/AiAgent/chartConfig/slack/index.d.ts.map +1 -1
- package/dist/cjs/ee/AiAgent/chartConfig/slack/index.js +3 -1
- package/dist/cjs/ee/AiAgent/chartConfig/slack/index.js.map +1 -1
- package/dist/cjs/ee/AiAgent/chartConfig/web/getWebAiChartConfig.d.ts +29 -29
- package/dist/cjs/ee/AiAgent/composerArtifact.d.ts +9 -2
- package/dist/cjs/ee/AiAgent/composerArtifact.d.ts.map +1 -1
- package/dist/cjs/ee/AiAgent/composerArtifact.js +14 -1
- package/dist/cjs/ee/AiAgent/composerArtifact.js.map +1 -1
- package/dist/cjs/ee/AiAgent/composerChartVizConfig.d.ts +26 -122
- package/dist/cjs/ee/AiAgent/composerChartVizConfig.d.ts.map +1 -1
- package/dist/cjs/ee/AiAgent/composerChartVizConfig.js +63 -103
- package/dist/cjs/ee/AiAgent/composerChartVizConfig.js.map +1 -1
- package/dist/cjs/ee/AiAgent/schemas/filterExpressions/resolvedArgs.d.ts +100 -100
- package/dist/cjs/ee/AiAgent/schemas/tools/composerChartVizConfigSchema.d.ts +122 -0
- package/dist/cjs/ee/AiAgent/schemas/tools/composerChartVizConfigSchema.d.ts.map +1 -0
- package/dist/cjs/ee/AiAgent/schemas/tools/composerChartVizConfigSchema.js +89 -0
- package/dist/cjs/ee/AiAgent/schemas/tools/composerChartVizConfigSchema.js.map +1 -0
- package/dist/cjs/ee/AiAgent/schemas/tools/index.d.ts +2 -0
- package/dist/cjs/ee/AiAgent/schemas/tools/index.d.ts.map +1 -1
- package/dist/cjs/ee/AiAgent/schemas/tools/index.js +2 -0
- package/dist/cjs/ee/AiAgent/schemas/tools/index.js.map +1 -1
- package/dist/cjs/ee/AiAgent/schemas/tools/toolComposerQueryArgs.d.ts.map +1 -1
- package/dist/cjs/ee/AiAgent/schemas/tools/toolComposerQueryArgs.js +4 -6
- package/dist/cjs/ee/AiAgent/schemas/tools/toolComposerQueryArgs.js.map +1 -1
- package/dist/cjs/ee/AiAgent/schemas/tools/toolDashboardV2Args.d.ts +50 -50
- package/dist/cjs/ee/AiAgent/schemas/tools/toolDefinitions.d.ts +3 -0
- package/dist/cjs/ee/AiAgent/schemas/tools/toolDefinitions.d.ts.map +1 -1
- package/dist/cjs/ee/AiAgent/schemas/tools/toolDefinitions.js +14 -3
- package/dist/cjs/ee/AiAgent/schemas/tools/toolDefinitions.js.map +1 -1
- package/dist/cjs/ee/AiAgent/schemas/tools/toolRunMetricQueryArgs.d.ts +65 -65
- package/dist/cjs/ee/AiAgent/schemas/tools/toolRunQueryArgs.d.ts +433 -433
- package/dist/cjs/ee/AiAgent/schemas/tools/toolSearchFieldValuesArgs.d.ts +22 -22
- package/dist/cjs/ee/AiAgent/schemas/tools/toolVisualizeArgs.d.ts +153 -0
- package/dist/cjs/ee/AiAgent/schemas/tools/toolVisualizeArgs.d.ts.map +1 -0
- package/dist/cjs/ee/AiAgent/schemas/tools/toolVisualizeArgs.js +55 -0
- package/dist/cjs/ee/AiAgent/schemas/tools/toolVisualizeArgs.js.map +1 -0
- package/dist/cjs/ee/AiAgent/schemas/visualizations/index.d.ts +4 -2
- package/dist/cjs/ee/AiAgent/schemas/visualizations/index.d.ts.map +1 -1
- package/dist/cjs/ee/AiAgent/schemas/visualizations/index.js +3 -0
- package/dist/cjs/ee/AiAgent/schemas/visualizations/index.js.map +1 -1
- package/dist/cjs/ee/AiAgent/utils.d.ts +7 -7
- package/dist/cjs/ee/AiAgent/utils.d.ts.map +1 -1
- package/dist/cjs/ee/AiAgent/utils.js +2 -2
- package/dist/cjs/ee/AiAgent/utils.js.map +1 -1
- package/dist/cjs/schemas/json/mcp-tools-1.0.json +2 -2
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/ee/AiAgent/chartConfig/slack/getComposerSlackEchartsConfig.d.ts +16 -0
- package/dist/esm/ee/AiAgent/chartConfig/slack/getComposerSlackEchartsConfig.d.ts.map +1 -0
- package/dist/esm/ee/AiAgent/chartConfig/slack/getComposerSlackEchartsConfig.js +20 -0
- package/dist/esm/ee/AiAgent/chartConfig/slack/getComposerSlackEchartsConfig.js.map +1 -0
- package/dist/esm/ee/AiAgent/chartConfig/slack/index.d.ts +1 -0
- package/dist/esm/ee/AiAgent/chartConfig/slack/index.d.ts.map +1 -1
- package/dist/esm/ee/AiAgent/chartConfig/slack/index.js +1 -0
- package/dist/esm/ee/AiAgent/chartConfig/slack/index.js.map +1 -1
- package/dist/esm/ee/AiAgent/chartConfig/web/getWebAiChartConfig.d.ts +7 -7
- package/dist/esm/ee/AiAgent/composerArtifact.d.ts +9 -2
- package/dist/esm/ee/AiAgent/composerArtifact.d.ts.map +1 -1
- package/dist/esm/ee/AiAgent/composerArtifact.js +12 -0
- package/dist/esm/ee/AiAgent/composerArtifact.js.map +1 -1
- package/dist/esm/ee/AiAgent/composerChartVizConfig.d.ts +26 -122
- package/dist/esm/ee/AiAgent/composerChartVizConfig.d.ts.map +1 -1
- package/dist/esm/ee/AiAgent/composerChartVizConfig.js +60 -101
- package/dist/esm/ee/AiAgent/composerChartVizConfig.js.map +1 -1
- package/dist/esm/ee/AiAgent/schemas/filterExpressions/resolvedArgs.d.ts +100 -100
- package/dist/esm/ee/AiAgent/schemas/tools/composerChartVizConfigSchema.d.ts +122 -0
- package/dist/esm/ee/AiAgent/schemas/tools/composerChartVizConfigSchema.d.ts.map +1 -0
- package/dist/esm/ee/AiAgent/schemas/tools/composerChartVizConfigSchema.js +85 -0
- package/dist/esm/ee/AiAgent/schemas/tools/composerChartVizConfigSchema.js.map +1 -0
- package/dist/esm/ee/AiAgent/schemas/tools/index.d.ts +2 -0
- package/dist/esm/ee/AiAgent/schemas/tools/index.d.ts.map +1 -1
- package/dist/esm/ee/AiAgent/schemas/tools/index.js +2 -0
- package/dist/esm/ee/AiAgent/schemas/tools/index.js.map +1 -1
- package/dist/esm/ee/AiAgent/schemas/tools/toolComposerQueryArgs.d.ts.map +1 -1
- package/dist/esm/ee/AiAgent/schemas/tools/toolComposerQueryArgs.js +4 -6
- package/dist/esm/ee/AiAgent/schemas/tools/toolComposerQueryArgs.js.map +1 -1
- package/dist/esm/ee/AiAgent/schemas/tools/toolDashboardV2Args.d.ts +50 -50
- package/dist/esm/ee/AiAgent/schemas/tools/toolDefinitions.d.ts +3 -0
- package/dist/esm/ee/AiAgent/schemas/tools/toolDefinitions.d.ts.map +1 -1
- package/dist/esm/ee/AiAgent/schemas/tools/toolDefinitions.js +11 -0
- package/dist/esm/ee/AiAgent/schemas/tools/toolDefinitions.js.map +1 -1
- package/dist/esm/ee/AiAgent/schemas/tools/toolRunMetricQueryArgs.d.ts +65 -65
- package/dist/esm/ee/AiAgent/schemas/tools/toolRunQueryArgs.d.ts +433 -433
- package/dist/esm/ee/AiAgent/schemas/tools/toolSearchFieldValuesArgs.d.ts +22 -22
- package/dist/esm/ee/AiAgent/schemas/tools/toolVisualizeArgs.d.ts +153 -0
- package/dist/esm/ee/AiAgent/schemas/tools/toolVisualizeArgs.d.ts.map +1 -0
- package/dist/esm/ee/AiAgent/schemas/tools/toolVisualizeArgs.js +51 -0
- package/dist/esm/ee/AiAgent/schemas/tools/toolVisualizeArgs.js.map +1 -0
- package/dist/esm/ee/AiAgent/schemas/visualizations/index.d.ts +4 -2
- package/dist/esm/ee/AiAgent/schemas/visualizations/index.d.ts.map +1 -1
- package/dist/esm/ee/AiAgent/schemas/visualizations/index.js +3 -0
- package/dist/esm/ee/AiAgent/schemas/visualizations/index.js.map +1 -1
- package/dist/esm/ee/AiAgent/utils.d.ts +29 -29
- package/dist/esm/ee/AiAgent/utils.d.ts.map +1 -1
- package/dist/esm/ee/AiAgent/utils.js +1 -1
- package/dist/esm/ee/AiAgent/utils.js.map +1 -1
- package/dist/esm/schemas/json/mcp-tools-1.0.json +2 -2
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/ee/AiAgent/chartConfig/slack/getComposerSlackEchartsConfig.d.ts +16 -0
- package/dist/types/ee/AiAgent/chartConfig/slack/getComposerSlackEchartsConfig.d.ts.map +1 -0
- package/dist/types/ee/AiAgent/chartConfig/slack/getComposerSlackEchartsConfig.js +20 -0
- package/dist/types/ee/AiAgent/chartConfig/slack/getComposerSlackEchartsConfig.js.map +1 -0
- package/dist/types/ee/AiAgent/chartConfig/slack/index.d.ts +1 -0
- package/dist/types/ee/AiAgent/chartConfig/slack/index.d.ts.map +1 -1
- package/dist/types/ee/AiAgent/chartConfig/slack/index.js +1 -0
- package/dist/types/ee/AiAgent/chartConfig/slack/index.js.map +1 -1
- package/dist/types/ee/AiAgent/chartConfig/web/getWebAiChartConfig.d.ts +7 -7
- package/dist/types/ee/AiAgent/composerArtifact.d.ts +9 -2
- package/dist/types/ee/AiAgent/composerArtifact.d.ts.map +1 -1
- package/dist/types/ee/AiAgent/composerArtifact.js +12 -0
- package/dist/types/ee/AiAgent/composerArtifact.js.map +1 -1
- package/dist/types/ee/AiAgent/composerChartVizConfig.d.ts +26 -122
- package/dist/types/ee/AiAgent/composerChartVizConfig.d.ts.map +1 -1
- package/dist/types/ee/AiAgent/composerChartVizConfig.js +60 -101
- package/dist/types/ee/AiAgent/composerChartVizConfig.js.map +1 -1
- package/dist/types/ee/AiAgent/schemas/filterExpressions/resolvedArgs.d.ts +100 -100
- package/dist/types/ee/AiAgent/schemas/tools/composerChartVizConfigSchema.d.ts +122 -0
- package/dist/types/ee/AiAgent/schemas/tools/composerChartVizConfigSchema.d.ts.map +1 -0
- package/dist/types/ee/AiAgent/schemas/tools/composerChartVizConfigSchema.js +85 -0
- package/dist/types/ee/AiAgent/schemas/tools/composerChartVizConfigSchema.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/tools/index.d.ts +2 -0
- package/dist/types/ee/AiAgent/schemas/tools/index.d.ts.map +1 -1
- package/dist/types/ee/AiAgent/schemas/tools/index.js +2 -0
- package/dist/types/ee/AiAgent/schemas/tools/index.js.map +1 -1
- package/dist/types/ee/AiAgent/schemas/tools/toolComposerQueryArgs.d.ts.map +1 -1
- package/dist/types/ee/AiAgent/schemas/tools/toolComposerQueryArgs.js +4 -6
- package/dist/types/ee/AiAgent/schemas/tools/toolComposerQueryArgs.js.map +1 -1
- package/dist/types/ee/AiAgent/schemas/tools/toolDashboardV2Args.d.ts +50 -50
- package/dist/types/ee/AiAgent/schemas/tools/toolDefinitions.d.ts +3 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolDefinitions.d.ts.map +1 -1
- package/dist/types/ee/AiAgent/schemas/tools/toolDefinitions.js +11 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolDefinitions.js.map +1 -1
- package/dist/types/ee/AiAgent/schemas/tools/toolRunMetricQueryArgs.d.ts +65 -65
- package/dist/types/ee/AiAgent/schemas/tools/toolRunQueryArgs.d.ts +433 -433
- package/dist/types/ee/AiAgent/schemas/tools/toolSearchFieldValuesArgs.d.ts +22 -22
- package/dist/types/ee/AiAgent/schemas/tools/toolVisualizeArgs.d.ts +153 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolVisualizeArgs.d.ts.map +1 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolVisualizeArgs.js +51 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolVisualizeArgs.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/visualizations/index.d.ts +4 -2
- package/dist/types/ee/AiAgent/schemas/visualizations/index.d.ts.map +1 -1
- package/dist/types/ee/AiAgent/schemas/visualizations/index.js +3 -0
- package/dist/types/ee/AiAgent/schemas/visualizations/index.js.map +1 -1
- package/dist/types/ee/AiAgent/utils.d.ts +29 -29
- package/dist/types/ee/AiAgent/utils.d.ts.map +1 -1
- package/dist/types/ee/AiAgent/utils.js +1 -1
- package/dist/types/ee/AiAgent/utils.js.map +1 -1
- package/dist/types/schemas/json/mcp-tools-1.0.json +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type EChartsOption } from 'echarts';
|
|
2
|
+
import { type ResultColumn } from '../../../../types/results';
|
|
3
|
+
import { type ComposerStoredChartVizConfig } from '../../schemas';
|
|
4
|
+
import { type GetPivotedResultsFn } from './types';
|
|
5
|
+
/** A composer chart drawn by the runQuery Slack echarts builders; null when Slack posts no image. */
|
|
6
|
+
export declare const getComposerSlackEchartsConfig: ({ columns, rows, vizConfig, metadata, getPivotedResults, }: {
|
|
7
|
+
columns: ResultColumn[];
|
|
8
|
+
rows: Record<string, unknown>[];
|
|
9
|
+
vizConfig: ComposerStoredChartVizConfig;
|
|
10
|
+
metadata: {
|
|
11
|
+
title: string;
|
|
12
|
+
description: string;
|
|
13
|
+
};
|
|
14
|
+
getPivotedResults: GetPivotedResultsFn;
|
|
15
|
+
}) => Promise<EChartsOption | null>;
|
|
16
|
+
//# sourceMappingURL=getComposerSlackEchartsConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getComposerSlackEchartsConfig.d.ts","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/chartConfig/slack/getComposerSlackEchartsConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,EAAE,KAAK,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAGlE,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,qGAAqG;AACrG,eAAO,MAAM,6BAA6B,+DAMvC;IACC,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAChC,SAAS,EAAE,4BAA4B,CAAC;IACxC,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;IACjD,iBAAiB,EAAE,mBAAmB,CAAC;CAC1C,KAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAa/B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { getComposerSlackRunQueryChart } from '../../composerChartVizConfig';
|
|
2
|
+
import { AiResultType } from '../../types';
|
|
3
|
+
import { getSlackAiEchartsConfig } from './getSlackAiEchartsConfig';
|
|
4
|
+
/** A composer chart drawn by the runQuery Slack echarts builders; null when Slack posts no image. */
|
|
5
|
+
export const getComposerSlackEchartsConfig = async ({ columns, rows, vizConfig, metadata, getPivotedResults, }) => {
|
|
6
|
+
const chart = getComposerSlackRunQueryChart({
|
|
7
|
+
columns,
|
|
8
|
+
rows,
|
|
9
|
+
vizConfig,
|
|
10
|
+
metadata,
|
|
11
|
+
});
|
|
12
|
+
if (!chart)
|
|
13
|
+
return null;
|
|
14
|
+
return getSlackAiEchartsConfig({
|
|
15
|
+
toolArgs: { type: AiResultType.QUERY_RESULT, tool: chart.tool },
|
|
16
|
+
queryResults: { rows: chart.rows, fields: chart.fields },
|
|
17
|
+
getPivotedResults,
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=getComposerSlackEchartsConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getComposerSlackEchartsConfig.js","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/chartConfig/slack/getComposerSlackEchartsConfig.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAE7E,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAGpE,qGAAqG;AACrG,MAAM,CAAC,MAAM,6BAA6B,GAAG,KAAK,EAAE,EAChD,OAAO,EACP,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,iBAAiB,GAOpB,EAAiC,EAAE;IAChC,MAAM,KAAK,GAAG,6BAA6B,CAAC;QACxC,OAAO;QACP,IAAI;QACJ,SAAS;QACT,QAAQ;KACX,CAAC,CAAC;IACH,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,OAAO,uBAAuB,CAAC;QAC3B,QAAQ,EAAE,EAAE,IAAI,EAAE,YAAY,CAAC,YAAY,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE;QAC/D,YAAY,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE;QACxD,iBAAiB;KACpB,CAAC,CAAC;AACP,CAAC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { formatFieldLabel } from '../shared/formatFieldLabel';
|
|
2
|
+
export { getComposerSlackEchartsConfig } from './getComposerSlackEchartsConfig';
|
|
2
3
|
export { getSlackAiEchartsConfig, type SlackAiToolArgs, } from './getSlackAiEchartsConfig';
|
|
3
4
|
export { getWarehousePivotedResults } from './getWarehousePivotedResults';
|
|
4
5
|
export type { GetPivotedResultsFn, PivotedResults } from './types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/chartConfig/slack/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EACH,uBAAuB,EACvB,KAAK,eAAe,GACvB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,YAAY,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/chartConfig/slack/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EACH,uBAAuB,EACvB,KAAK,eAAe,GACvB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,YAAY,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { formatFieldLabel } from '../shared/formatFieldLabel';
|
|
2
|
+
export { getComposerSlackEchartsConfig } from './getComposerSlackEchartsConfig';
|
|
2
3
|
export { getSlackAiEchartsConfig, } from './getSlackAiEchartsConfig';
|
|
3
4
|
export { getWarehousePivotedResults } from './getWarehousePivotedResults';
|
|
4
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/chartConfig/slack/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EACH,uBAAuB,GAE1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/chartConfig/slack/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EACH,uBAAuB,GAE1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -27,18 +27,13 @@ export declare const getWebAiChartConfig: ({ vizConfig, metricQuery, maxQueryLim
|
|
|
27
27
|
tableCalculations: ({
|
|
28
28
|
name: string;
|
|
29
29
|
displayName: string;
|
|
30
|
-
type: "
|
|
30
|
+
type: "percent_of_previous_value";
|
|
31
31
|
fieldId: string;
|
|
32
32
|
orderBy: {
|
|
33
33
|
fieldId: string;
|
|
34
34
|
order: "asc" | "desc" | null;
|
|
35
35
|
}[];
|
|
36
36
|
partitionBy: string[] | null;
|
|
37
|
-
} | {
|
|
38
|
-
name: string;
|
|
39
|
-
displayName: string;
|
|
40
|
-
type: "running_total";
|
|
41
|
-
fieldId: string;
|
|
42
37
|
} | {
|
|
43
38
|
name: string;
|
|
44
39
|
displayName: string;
|
|
@@ -49,7 +44,7 @@ export declare const getWebAiChartConfig: ({ vizConfig, metricQuery, maxQueryLim
|
|
|
49
44
|
} | {
|
|
50
45
|
name: string;
|
|
51
46
|
displayName: string;
|
|
52
|
-
type: "
|
|
47
|
+
type: "percent_change_from_previous";
|
|
53
48
|
fieldId: string;
|
|
54
49
|
orderBy: {
|
|
55
50
|
fieldId: string;
|
|
@@ -67,6 +62,11 @@ export declare const getWebAiChartConfig: ({ vizConfig, metricQuery, maxQueryLim
|
|
|
67
62
|
displayName: string;
|
|
68
63
|
type: "rank_in_column";
|
|
69
64
|
fieldId: string;
|
|
65
|
+
} | {
|
|
66
|
+
name: string;
|
|
67
|
+
displayName: string;
|
|
68
|
+
type: "running_total";
|
|
69
|
+
fieldId: string;
|
|
70
70
|
} | {
|
|
71
71
|
name: string;
|
|
72
72
|
displayName: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type QueryNodeId, type SourceQuery } from '../../types/querySources';
|
|
2
2
|
import { type AllVizChartConfig } from '../../visualizations/types';
|
|
3
|
-
import { type ComposerStoredChartVizConfig } from './
|
|
3
|
+
import { type ComposerStoredChartVizConfig } from './schemas/tools/composerChartVizConfigSchema';
|
|
4
4
|
/**
|
|
5
5
|
* A composer artifact version: a declarative pipeline, its terminal node and
|
|
6
6
|
* the viz config. Holds no results; opening it runs the pipeline.
|
|
@@ -27,7 +27,7 @@ export type AiComposerArtifactVersion = {
|
|
|
27
27
|
artifactType: 'chart';
|
|
28
28
|
title: string;
|
|
29
29
|
description?: string;
|
|
30
|
-
vizConfig:
|
|
30
|
+
vizConfig: AiComposerChartArtifactConfig;
|
|
31
31
|
};
|
|
32
32
|
export declare const toComposerArtifactVersion: ({ title, description, queries, terminalNodeId, vizConfig, }: {
|
|
33
33
|
title: string;
|
|
@@ -36,6 +36,13 @@ export declare const toComposerArtifactVersion: ({ title, description, queries,
|
|
|
36
36
|
terminalNodeId: QueryNodeId;
|
|
37
37
|
vizConfig: AllVizChartConfig | null;
|
|
38
38
|
}) => AiComposerArtifactVersion;
|
|
39
|
+
export declare const toComposerChartArtifactVersion: ({ title, description, queries, terminalNodeId, vizConfig, }: {
|
|
40
|
+
title: string;
|
|
41
|
+
description: string | null;
|
|
42
|
+
queries: SourceQuery[];
|
|
43
|
+
terminalNodeId: QueryNodeId;
|
|
44
|
+
vizConfig: ComposerStoredChartVizConfig;
|
|
45
|
+
}) => AiComposerArtifactVersion;
|
|
39
46
|
export declare const isAiComposerChartArtifactConfig: (config: unknown) => config is AiComposerChartArtifactConfig;
|
|
40
47
|
export declare const isSameComposerNodeDefinition: (a: SourceQuery, b: SourceQuery) => boolean;
|
|
41
48
|
export declare const getComposerNodeConflictMessage: (existing: ThreadComposerQueryNode) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composerArtifact.d.ts","sourceRoot":"","sources":["../../../../src/ee/AiAgent/composerArtifact.ts"],"names":[],"mappings":"AAOA,OAAO,EAGH,KAAK,WA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AM,CAAC;IACd,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,cAAc,EAAE,WAAW,CAAC;IAC5B,SAAS,EAAE,iBAAiB,GAAG,IAAI,CAAC;CACvC,KAAG,yBAWF,CAAC;AAEH,eAAO,MAAM,8BAA8B,gEAMxC;IACC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,cAAc,EAAE,WAAW,CAAC;IAC5B,SAAS,EAAE,4BAA4B,CAAC;CAC3C,KAAG,yBAWF,CAAC;AAEH,eAAO,MAAM,+BAA+B,WAChC,OAAO,KAChB,MAAM,IAAI,6BAUgC,CAAC;AAiD9C,eAAO,MAAM,4BAA4B,MAClC,WAAW,KACX,WAAW,KACf,OAAkD,CAAC;AAEtD,eAAO,MAAM,8BAA8B,aAC7B,uBAAuB,KAClC,MAC0O,CAAC;AAS9O,4EAA4E;AAC5E,MAAM,MAAM,oBAAoB,GAAG,WAAW,GAAG;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,CAAC;AAEzE,mEAAmE;AACnE,MAAM,MAAM,uBAAuB,GAAG,oBAAoB,CAAC;AAK3D;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,8CAGvC;IACC,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,WAAW,EAAE,uBAAuB,EAAE,CAAC;CAC1C,KAAG,oBAAoB,EAkDvB,CAAC"}
|
|
@@ -15,6 +15,18 @@ export const toComposerArtifactVersion = ({ title, description, queries, termina
|
|
|
15
15
|
vizConfig,
|
|
16
16
|
},
|
|
17
17
|
});
|
|
18
|
+
export const toComposerChartArtifactVersion = ({ title, description, queries, terminalNodeId, vizConfig, }) => ({
|
|
19
|
+
artifactType: 'chart',
|
|
20
|
+
title,
|
|
21
|
+
...(description ? { description } : {}),
|
|
22
|
+
vizConfig: {
|
|
23
|
+
source: 'composer',
|
|
24
|
+
schemaVersion: 2,
|
|
25
|
+
queries,
|
|
26
|
+
terminalNodeId,
|
|
27
|
+
vizConfig,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
18
30
|
export const isAiComposerChartArtifactConfig = (config) => typeof config === 'object' &&
|
|
19
31
|
config !== null &&
|
|
20
32
|
'source' in config &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composerArtifact.js","sourceRoot":"","sources":["../../../../src/ee/AiAgent/composerArtifact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EACH,gBAAgB,EAChB,eAAe,GAGlB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACH,8BAA8B,EAC9B,eAAe,GAGlB,MAAM,0BAA0B,CAAC;AAClC,OAAO,iBAAiB,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAsCpD,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,EACtC,KAAK,EACL,WAAW,EACX,OAAO,EACP,cAAc,EACd,SAAS,GAOZ,EAA6B,EAAE,CAAC,CAAC;IAC9B,YAAY,EAAE,OAAO;IACrB,KAAK;IACL,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACvC,SAAS,EAAE;QACP,MAAM,EAAE,UAAU;QAClB,aAAa,EAAE,CAAC;QAChB,OAAO;QACP,cAAc;QACd,SAAS;KACZ;CACJ,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAC3C,MAAe,EACwB,EAAE,CACzC,OAAO,MAAM,KAAK,QAAQ;IAC1B,MAAM,KAAK,IAAI;IACf,QAAQ,IAAI,MAAM;IAClB,MAAM,CAAC,MAAM,KAAK,UAAU;IAC5B,eAAe,IAAI,MAAM;IACzB,CAAC,MAAM,CAAC,aAAa,KA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C;IACvC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAe,CAAC;IACxC,MAAM,QAAQ,GAA2B,EAAE,CAAC;IAC5C,MAAM,KAAK,GAAG,CAAC,IAAiB,EAAE,EAAE;QAChC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;YAAE,OAAO;QAC7B,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QACxB,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC;YAAE,OAAO;QACxD,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACrB,MAAM,CAAC,MAAM,CAAC,8BAA8B,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CACvD,CAAC,SAAS,EAAE,EAAE;YACV,MAAM,IAAI,GACN,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YAChE,IAAI,IAAI;gBAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC,CACJ,CAAC;QACF,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACxB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACpB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC,CAAC;IACF,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACvB,OAAO,QAAQ,CAAC;AACpB,CAAC,CAAC"}
|
|
@@ -1,129 +1,10 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
1
|
import { type ItemsMap } from '../../types/field';
|
|
3
2
|
import { type MetricQuery } from '../../types/metricQuery';
|
|
4
3
|
import { type DuckdbSourceQuery, type QueryNodeId } from '../../types/querySources';
|
|
5
|
-
import { type ResultColumn
|
|
4
|
+
import { type ResultColumn } from '../../types/results';
|
|
6
5
|
import { type ChartConfig } from '../../types/savedCharts';
|
|
7
6
|
import { type DataAppVizField } from '../apps/types';
|
|
8
|
-
|
|
9
|
-
type: z.ZodEnum<{
|
|
10
|
-
area: "area";
|
|
11
|
-
bar: "bar";
|
|
12
|
-
big_number: "big_number";
|
|
13
|
-
funnel: "funnel";
|
|
14
|
-
line: "line";
|
|
15
|
-
pie: "pie";
|
|
16
|
-
scatter: "scatter";
|
|
17
|
-
table: "table";
|
|
18
|
-
}>;
|
|
19
|
-
x: z.ZodNullable<z.ZodString>;
|
|
20
|
-
y: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
21
|
-
groupBy: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
22
|
-
stack: z.ZodNullable<z.ZodBoolean>;
|
|
23
|
-
horizontal: z.ZodNullable<z.ZodBoolean>;
|
|
24
|
-
y2: z.ZodNullable<z.ZodString>;
|
|
25
|
-
labels: z.ZodNullable<z.ZodObject<{
|
|
26
|
-
x: z.ZodNullable<z.ZodString>;
|
|
27
|
-
y: z.ZodNullable<z.ZodString>;
|
|
28
|
-
y2: z.ZodNullable<z.ZodString>;
|
|
29
|
-
}, z.core.$strip>>;
|
|
30
|
-
}, z.core.$strip>;
|
|
31
|
-
declare const composerCustomChartVizConfigSchemaV1: z.ZodObject<{
|
|
32
|
-
type: z.ZodLiteral<"custom">;
|
|
33
|
-
customChartTypeSlug: z.ZodString;
|
|
34
|
-
fieldMapping: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
35
|
-
options: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
36
|
-
colors: z.ZodArray<z.ZodString>;
|
|
37
|
-
min: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"auto">]>;
|
|
38
|
-
max: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"auto">]>;
|
|
39
|
-
}, z.core.$strip>, z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
40
|
-
}, z.core.$strip>;
|
|
41
|
-
/** The viz config the agent writes: the agent chart vocabulary over result column references. */
|
|
42
|
-
export declare const composerChartVizConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
43
|
-
type: z.ZodEnum<{
|
|
44
|
-
area: "area";
|
|
45
|
-
bar: "bar";
|
|
46
|
-
big_number: "big_number";
|
|
47
|
-
funnel: "funnel";
|
|
48
|
-
line: "line";
|
|
49
|
-
pie: "pie";
|
|
50
|
-
scatter: "scatter";
|
|
51
|
-
table: "table";
|
|
52
|
-
}>;
|
|
53
|
-
x: z.ZodNullable<z.ZodString>;
|
|
54
|
-
y: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
55
|
-
groupBy: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
56
|
-
stack: z.ZodNullable<z.ZodBoolean>;
|
|
57
|
-
horizontal: z.ZodNullable<z.ZodBoolean>;
|
|
58
|
-
y2: z.ZodNullable<z.ZodString>;
|
|
59
|
-
labels: z.ZodNullable<z.ZodObject<{
|
|
60
|
-
x: z.ZodNullable<z.ZodString>;
|
|
61
|
-
y: z.ZodNullable<z.ZodString>;
|
|
62
|
-
y2: z.ZodNullable<z.ZodString>;
|
|
63
|
-
}, z.core.$strip>>;
|
|
64
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
65
|
-
type: z.ZodLiteral<"custom">;
|
|
66
|
-
customChartTypeSlug: z.ZodString;
|
|
67
|
-
fieldMapping: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
68
|
-
options: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
69
|
-
colors: z.ZodArray<z.ZodString>;
|
|
70
|
-
min: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"auto">]>;
|
|
71
|
-
max: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"auto">]>;
|
|
72
|
-
}, z.core.$strip>, z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
73
|
-
}, z.core.$strip>], "type">;
|
|
74
|
-
export type ComposerChartVizConfig = z.infer<typeof composerChartVizConfigSchema>;
|
|
75
|
-
export type ComposerBuiltinChartVizConfig = z.infer<typeof composerBuiltinChartVizConfigSchemaV1>;
|
|
76
|
-
export type ComposerCustomChartVizConfig = z.infer<typeof composerCustomChartVizConfigSchemaV1>;
|
|
77
|
-
declare const composerStoredCustomChartVizConfigSchemaV1: z.ZodObject<{
|
|
78
|
-
type: z.ZodLiteral<"custom">;
|
|
79
|
-
customChartTypeSlug: z.ZodString;
|
|
80
|
-
fieldMapping: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
81
|
-
options: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
82
|
-
colors: z.ZodArray<z.ZodString>;
|
|
83
|
-
min: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"auto">]>;
|
|
84
|
-
max: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"auto">]>;
|
|
85
|
-
}, z.core.$strip>, z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
86
|
-
dataAppVizUuid: z.ZodString;
|
|
87
|
-
dataAppVizVersion: z.ZodNullable<z.ZodNumber>;
|
|
88
|
-
}, z.core.$strip>;
|
|
89
|
-
export declare const composerChartVizConfigSchemaPersisted: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
90
|
-
type: z.ZodEnum<{
|
|
91
|
-
area: "area";
|
|
92
|
-
bar: "bar";
|
|
93
|
-
big_number: "big_number";
|
|
94
|
-
funnel: "funnel";
|
|
95
|
-
line: "line";
|
|
96
|
-
pie: "pie";
|
|
97
|
-
scatter: "scatter";
|
|
98
|
-
table: "table";
|
|
99
|
-
}>;
|
|
100
|
-
x: z.ZodNullable<z.ZodString>;
|
|
101
|
-
y: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
102
|
-
groupBy: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
103
|
-
stack: z.ZodNullable<z.ZodBoolean>;
|
|
104
|
-
horizontal: z.ZodNullable<z.ZodBoolean>;
|
|
105
|
-
y2: z.ZodNullable<z.ZodString>;
|
|
106
|
-
labels: z.ZodNullable<z.ZodObject<{
|
|
107
|
-
x: z.ZodNullable<z.ZodString>;
|
|
108
|
-
y: z.ZodNullable<z.ZodString>;
|
|
109
|
-
y2: z.ZodNullable<z.ZodString>;
|
|
110
|
-
}, z.core.$strip>>;
|
|
111
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
112
|
-
type: z.ZodLiteral<"custom">;
|
|
113
|
-
customChartTypeSlug: z.ZodString;
|
|
114
|
-
fieldMapping: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
115
|
-
options: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
116
|
-
colors: z.ZodArray<z.ZodString>;
|
|
117
|
-
min: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"auto">]>;
|
|
118
|
-
max: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"auto">]>;
|
|
119
|
-
}, z.core.$strip>, z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
120
|
-
dataAppVizUuid: z.ZodString;
|
|
121
|
-
dataAppVizVersion: z.ZodNullable<z.ZodNumber>;
|
|
122
|
-
}, z.core.$strip>], "type">;
|
|
123
|
-
/** Stored form: a custom chart type carries the version the server pinned. */
|
|
124
|
-
export type ComposerStoredChartVizConfig = z.infer<typeof composerChartVizConfigSchemaPersisted>;
|
|
125
|
-
export type ComposerStoredCustomChartVizConfig = z.infer<typeof composerStoredCustomChartVizConfigSchemaV1>;
|
|
126
|
-
export declare const parseComposerStoredChartVizConfig: (raw: unknown) => ComposerStoredChartVizConfig | null;
|
|
7
|
+
import { type ComposerBuiltinChartVizConfig, type ComposerStoredChartVizConfig, type ToolRunQueryArgsTransformed } from './schemas';
|
|
127
8
|
/** Synthetic explore of a composer node result; its fields are the result columns. */
|
|
128
9
|
export declare const COMPOSER_RESULT_TABLE_NAME = "composer_result";
|
|
129
10
|
export declare const getComposerResultFieldId: (reference: string) => string;
|
|
@@ -136,6 +17,12 @@ export type ComposerRunQueryChart = {
|
|
|
136
17
|
};
|
|
137
18
|
/** Slots of a custom chart type; their kinds decide what a custom chart splits and measures. */
|
|
138
19
|
export type ComposerCustomChartTypeSlot = Pick<DataAppVizField, 'name' | 'type'>;
|
|
20
|
+
type CartesianVizType = 'bar' | 'line' | 'area' | 'scatter';
|
|
21
|
+
type RunQueryBuilderVizType = CartesianVizType | 'pie' | 'funnel';
|
|
22
|
+
/** Builtin types Slack posts as a chart image; tables, big numbers and custom types are not images. */
|
|
23
|
+
export declare const isComposerSlackImageVizConfig: (vizConfig: ComposerStoredChartVizConfig) => vizConfig is ComposerBuiltinChartVizConfig & {
|
|
24
|
+
type: RunQueryBuilderVizType;
|
|
25
|
+
};
|
|
139
26
|
/**
|
|
140
27
|
* A node result drawn by the runQuery chart builders: a synthetic metric query
|
|
141
28
|
* and fields from the result columns of the run being drawn.
|
|
@@ -150,7 +37,24 @@ export declare const getComposerRunQueryChart: ({ columns: resultColumns, vizCon
|
|
|
150
37
|
customChartTypeSlots: ComposerCustomChartTypeSlot[];
|
|
151
38
|
}) => ComposerRunQueryChart;
|
|
152
39
|
/** Row keys renamed to field ids, keeping only the chart's fields: builders treat any extra key as data (funnel labels). */
|
|
153
|
-
export declare const toComposerResultRows: (chart: ComposerRunQueryChart, rows:
|
|
40
|
+
export declare const toComposerResultRows: <Value>(chart: Pick<ComposerRunQueryChart, 'metricQuery' | 'fields'>, rows: Record<string, Value>[]) => Record<string, Value>[];
|
|
41
|
+
/**
|
|
42
|
+
* A builtin composer chart as runQuery tool args over the chart's fields only,
|
|
43
|
+
* for the Slack image builders; null for types Slack posts as a link or table.
|
|
44
|
+
*/
|
|
45
|
+
export declare const getComposerSlackRunQueryChart: ({ columns: resultColumns, rows, vizConfig, metadata, }: {
|
|
46
|
+
columns: ResultColumn[];
|
|
47
|
+
rows: Record<string, unknown>[];
|
|
48
|
+
vizConfig: ComposerStoredChartVizConfig;
|
|
49
|
+
metadata: {
|
|
50
|
+
title: string;
|
|
51
|
+
description: string;
|
|
52
|
+
};
|
|
53
|
+
}) => {
|
|
54
|
+
tool: ToolRunQueryArgsTransformed;
|
|
55
|
+
rows: Record<string, unknown>[];
|
|
56
|
+
fields: ItemsMap;
|
|
57
|
+
} | null;
|
|
154
58
|
/**
|
|
155
59
|
* The chart stage for a series split: a DuckDB query over the presented
|
|
156
60
|
* node's result renaming the split's columns to field ids, then pivoting.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composerChartVizConfig.d.ts","sourceRoot":"","sources":["../../../../src/ee/AiAgent/composerChartVizConfig.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"composerChartVizConfig.d.ts","sourceRoot":"","sources":["../../../../src/ee/AiAgent/composerChartVizConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAMH,KAAK,QAAQ,EAEhB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAEH,KAAK,iBAAiB,EACtB,KAAK,WAAW,EACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAEH,KAAK,WAAW,EAGnB,MAAM,yBAAyB,CAAC;AASjC,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,OAAO,EACH,KAAK,6BAA6B,EAClC,KAAK,4BAA4B,EAEjC,KAAK,2BAA2B,EAEnC,MAAM,WAAW,CAAC;AAEnB,sFAAsF;AACtF,eAAO,MAAM,0BAA0B,oBAAo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M,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAChC,SAAS,EAAE,4BAA4B,CAAC;IACxC,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;CACpD,KAAG;IACA,IAAI,EAAE,2BAA2B,CAAC;IAClC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAChC,MAAM,EAAE,QAAQ,CAAC;CACpB,GAAG,IA2BH,CAAC;AAqDF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,yDAK/B;IACC,SAAS,EAAE,4BAA4B,CAAC;IACxC,oBAAoB,EAAE,2BAA2B,EAAE,CAAC;IACpD,MAAM,EAAE,WAAW,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAClB,KAAG,iBAAiB,GAAG,IA+BvB,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
1
|
import { DimensionType, FieldType, friendlyName, MetricType, } from '../../types/field';
|
|
3
2
|
import { QuerySourceType, } from '../../types/querySources';
|
|
4
3
|
import { ChartType, } from '../../types/savedCharts';
|
|
@@ -8,87 +7,6 @@ import { getItemId } from '../../utils/item';
|
|
|
8
7
|
import { VizAggregationOptions, VizIndexType, } from '../../visualizations/types';
|
|
9
8
|
import { getDataAppVizFieldIds } from '../apps/dataAppVizFieldMapping';
|
|
10
9
|
import { getRunQueryChartConfig } from './chartConfig/web/runQueryTool/getRunQueryChartConfig';
|
|
11
|
-
import { customChartTypeOptionValueSchema, } from './schemas';
|
|
12
|
-
const refSchema = z
|
|
13
|
-
.string()
|
|
14
|
-
.describe('A result column reference of the presented node');
|
|
15
|
-
const composerBuiltinChartVizTypeSchema = z.enum([
|
|
16
|
-
'table',
|
|
17
|
-
'big_number',
|
|
18
|
-
'bar',
|
|
19
|
-
'line',
|
|
20
|
-
'area',
|
|
21
|
-
'scatter',
|
|
22
|
-
'pie',
|
|
23
|
-
'funnel',
|
|
24
|
-
]);
|
|
25
|
-
const composerBuiltinChartVizConfigSchemaV1 = z.object({
|
|
26
|
-
type: composerBuiltinChartVizTypeSchema.describe('Chart type. area is a filled line.'),
|
|
27
|
-
x: refSchema
|
|
28
|
-
.nullable()
|
|
29
|
-
.describe('Category or time column. bar/line/area/scatter/pie/funnel. null for table/big_number, or to use the first non-numeric column.'),
|
|
30
|
-
y: z
|
|
31
|
-
.array(refSchema)
|
|
32
|
-
.nullable()
|
|
33
|
-
.describe('Value columns. big_number, pie and funnel use y[0]. null to use every numeric column not on x or groupBy.'),
|
|
34
|
-
groupBy: z
|
|
35
|
-
.array(refSchema)
|
|
36
|
-
.nullable()
|
|
37
|
-
.describe('Columns that split y into one series per value. bar/line/area/scatter only. Must not include x.'),
|
|
38
|
-
stack: z
|
|
39
|
-
.boolean()
|
|
40
|
-
.nullable()
|
|
41
|
-
.describe('bar: stack series on top of each other. area always stacks. Ignored elsewhere.'),
|
|
42
|
-
horizontal: z
|
|
43
|
-
.boolean()
|
|
44
|
-
.nullable()
|
|
45
|
-
.describe('bar only: draw bars horizontally.'),
|
|
46
|
-
y2: refSchema
|
|
47
|
-
.nullable()
|
|
48
|
-
.describe('Column on a secondary (right) y axis. bar/line/area (drawn as a line on area). Must not be in y.'),
|
|
49
|
-
labels: z
|
|
50
|
-
.object({
|
|
51
|
-
x: z.string().nullable(),
|
|
52
|
-
y: z.string().nullable(),
|
|
53
|
-
y2: z.string().nullable(),
|
|
54
|
-
})
|
|
55
|
-
.nullable()
|
|
56
|
-
.describe('Axis titles. big_number uses labels.y as its label.'),
|
|
57
|
-
});
|
|
58
|
-
const composerCustomChartVizConfigSchemaV1 = z.object({
|
|
59
|
-
type: z.literal('custom').describe('Renders a custom chart type.'),
|
|
60
|
-
customChartTypeSlug: z.string().describe('Slug of the custom chart type.'),
|
|
61
|
-
fieldMapping: z
|
|
62
|
-
.record(z.string(), z.union([refSchema, z.array(refSchema)]))
|
|
63
|
-
.describe('Binds each slot of the custom chart type to a column, or ordered columns for a multiple slot.'),
|
|
64
|
-
options: z
|
|
65
|
-
.record(z.string(), customChartTypeOptionValueSchema)
|
|
66
|
-
.nullable()
|
|
67
|
-
.describe("Values for the type's options; null for defaults."),
|
|
68
|
-
});
|
|
69
|
-
const composerChartVizConfigSchemaV1 = z.discriminatedUnion('type', [
|
|
70
|
-
composerBuiltinChartVizConfigSchemaV1,
|
|
71
|
-
composerCustomChartVizConfigSchemaV1,
|
|
72
|
-
]);
|
|
73
|
-
/** The viz config the agent writes: the agent chart vocabulary over result column references. */
|
|
74
|
-
export const composerChartVizConfigSchema = composerChartVizConfigSchemaV1;
|
|
75
|
-
const composerStoredCustomChartVizConfigSchemaV1 = composerCustomChartVizConfigSchemaV1.extend({
|
|
76
|
-
dataAppVizUuid: z.string(),
|
|
77
|
-
dataAppVizVersion: z.number().nullable(),
|
|
78
|
-
});
|
|
79
|
-
const composerStoredChartVizConfigSchemaV1 = z.discriminatedUnion('type', [
|
|
80
|
-
composerBuiltinChartVizConfigSchemaV1,
|
|
81
|
-
composerStoredCustomChartVizConfigSchemaV1,
|
|
82
|
-
]);
|
|
83
|
-
// Wide contract for parsing stored viz configs; call sites use this alias.
|
|
84
|
-
// Additive fields are `.nullish().default(null)` on the current version; a
|
|
85
|
-
// restructure adds V(N), bumps the composer artifact schemaVersion with it,
|
|
86
|
-
// and keeps this alias parsing everything ever stored.
|
|
87
|
-
export const composerChartVizConfigSchemaPersisted = composerStoredChartVizConfigSchemaV1;
|
|
88
|
-
export const parseComposerStoredChartVizConfig = (raw) => {
|
|
89
|
-
const parsed = composerChartVizConfigSchemaPersisted.safeParse(raw);
|
|
90
|
-
return parsed.success ? parsed.data : null;
|
|
91
|
-
};
|
|
92
10
|
/** Synthetic explore of a composer node result; its fields are the result columns. */
|
|
93
11
|
export const COMPOSER_RESULT_TABLE_NAME = 'composer_result';
|
|
94
12
|
export const getComposerResultFieldId = (reference) => getItemId({ table: COMPOSER_RESULT_TABLE_NAME, name: reference });
|
|
@@ -178,6 +96,13 @@ const toQuery = (columns, dimensions, metrics) => {
|
|
|
178
96
|
fields,
|
|
179
97
|
};
|
|
180
98
|
};
|
|
99
|
+
/** Builtin types Slack posts as a chart image; tables, big numbers and custom types are not images. */
|
|
100
|
+
export const isComposerSlackImageVizConfig = (vizConfig) => vizConfig.type === 'bar' ||
|
|
101
|
+
vizConfig.type === 'line' ||
|
|
102
|
+
vizConfig.type === 'area' ||
|
|
103
|
+
vizConfig.type === 'scatter' ||
|
|
104
|
+
vizConfig.type === 'pie' ||
|
|
105
|
+
vizConfig.type === 'funnel';
|
|
181
106
|
const isCartesianVizType = (type) => type === 'bar' || type === 'line' || type === 'area' || type === 'scatter';
|
|
182
107
|
const toRunQueryVizType = (type, horizontal) => {
|
|
183
108
|
switch (type) {
|
|
@@ -245,7 +170,8 @@ const withUnstackedSecondaryArea = (chartConfig) => {
|
|
|
245
170
|
},
|
|
246
171
|
};
|
|
247
172
|
};
|
|
248
|
-
|
|
173
|
+
/** The runQuery tool query and chart config a builtin composer chart maps onto. */
|
|
174
|
+
const getRunQueryBuilderInput = (columns, vizConfig, type) => {
|
|
249
175
|
const isCartesian = isCartesianVizType(type);
|
|
250
176
|
const groupBy = isCartesian ? (vizConfig.groupBy ?? []) : [];
|
|
251
177
|
const x = vizConfig.x ??
|
|
@@ -261,6 +187,23 @@ const getRunQueryBuilderChart = (columns, vizConfig, type, metadata) => {
|
|
|
261
187
|
const metrics = unique([...y, ...(y2 ? [y2] : [])]);
|
|
262
188
|
const { metricQuery, fields } = toQuery(columns, dimensions, metrics);
|
|
263
189
|
const fieldIdOf = getComposerResultFieldId;
|
|
190
|
+
const chartConfig = {
|
|
191
|
+
defaultVizType: toRunQueryVizType(type, vizConfig.horizontal),
|
|
192
|
+
xAxisDimension: x ? fieldIdOf(x) : null,
|
|
193
|
+
yAxisMetrics: y.map(fieldIdOf),
|
|
194
|
+
groupBy: groupBy.length > 0 ? groupBy.map(fieldIdOf) : null,
|
|
195
|
+
xAxisType: x && isTimeType(columns.get(x).type) ? 'time' : 'category',
|
|
196
|
+
stackBars: type === 'bar' ? vizConfig.stack : null,
|
|
197
|
+
lineType: type === 'area' ? 'area' : null,
|
|
198
|
+
xAxisLabel: vizConfig.labels?.x ?? '',
|
|
199
|
+
yAxisLabel: vizConfig.labels?.y ?? '',
|
|
200
|
+
secondaryYAxisMetric: y2 ? fieldIdOf(y2) : null,
|
|
201
|
+
secondaryYAxisLabel: vizConfig.labels?.y2 ?? null,
|
|
202
|
+
};
|
|
203
|
+
return { metricQuery, fields, chartConfig };
|
|
204
|
+
};
|
|
205
|
+
const getRunQueryBuilderChart = (columns, vizConfig, type, metadata) => {
|
|
206
|
+
const { metricQuery, fields, chartConfig } = getRunQueryBuilderInput(columns, vizConfig, type);
|
|
264
207
|
const builtChartConfig = getRunQueryChartConfig({
|
|
265
208
|
queryTool: {
|
|
266
209
|
...metadata,
|
|
@@ -268,31 +211,18 @@ const getRunQueryBuilderChart = (columns, vizConfig, type, metadata) => {
|
|
|
268
211
|
dimensions: metricQuery.dimensions,
|
|
269
212
|
metrics: metricQuery.metrics,
|
|
270
213
|
},
|
|
271
|
-
chartConfig
|
|
272
|
-
defaultVizType: toRunQueryVizType(type, vizConfig.horizontal),
|
|
273
|
-
xAxisDimension: x ? fieldIdOf(x) : null,
|
|
274
|
-
yAxisMetrics: y.map(fieldIdOf),
|
|
275
|
-
groupBy: groupBy.length > 0 ? groupBy.map(fieldIdOf) : null,
|
|
276
|
-
xAxisType: x && isTimeType(columns.get(x).type) ? 'time' : 'category',
|
|
277
|
-
stackBars: type === 'bar' ? vizConfig.stack : null,
|
|
278
|
-
lineType: type === 'area' ? 'area' : null,
|
|
279
|
-
xAxisLabel: vizConfig.labels?.x ?? '',
|
|
280
|
-
yAxisLabel: vizConfig.labels?.y ?? '',
|
|
281
|
-
secondaryYAxisMetric: y2 ? fieldIdOf(y2) : null,
|
|
282
|
-
secondaryYAxisLabel: vizConfig.labels?.y2 ?? null,
|
|
283
|
-
},
|
|
214
|
+
chartConfig,
|
|
284
215
|
},
|
|
285
216
|
metricQuery,
|
|
286
217
|
fieldsMap: fields,
|
|
287
218
|
});
|
|
288
|
-
const chartConfig = type === 'area' && y2
|
|
289
|
-
? withUnstackedSecondaryArea(builtChartConfig)
|
|
290
|
-
: builtChartConfig;
|
|
291
219
|
return {
|
|
292
220
|
metricQuery,
|
|
293
221
|
fields,
|
|
294
|
-
chartConfig
|
|
295
|
-
|
|
222
|
+
chartConfig: type === 'area' && chartConfig.secondaryYAxisMetric
|
|
223
|
+
? withUnstackedSecondaryArea(builtChartConfig)
|
|
224
|
+
: builtChartConfig,
|
|
225
|
+
pivotColumns: chartConfig.groupBy ?? [],
|
|
296
226
|
};
|
|
297
227
|
};
|
|
298
228
|
const mapFieldMapping = (fieldMapping, map) => Object.fromEntries(Object.entries(fieldMapping).map(([slot, value]) => [
|
|
@@ -366,6 +296,35 @@ export const toComposerResultRows = (chart, rows) => {
|
|
|
366
296
|
row[chart.fields[fieldId].name],
|
|
367
297
|
])));
|
|
368
298
|
};
|
|
299
|
+
/**
|
|
300
|
+
* A builtin composer chart as runQuery tool args over the chart's fields only,
|
|
301
|
+
* for the Slack image builders; null for types Slack posts as a link or table.
|
|
302
|
+
*/
|
|
303
|
+
export const getComposerSlackRunQueryChart = ({ columns: resultColumns, rows, vizConfig, metadata, }) => {
|
|
304
|
+
if (!isComposerSlackImageVizConfig(vizConfig))
|
|
305
|
+
return null;
|
|
306
|
+
const { metricQuery, fields, chartConfig } = getRunQueryBuilderInput(new ComposerColumns(resultColumns), vizConfig, vizConfig.type);
|
|
307
|
+
return {
|
|
308
|
+
tool: {
|
|
309
|
+
...metadata,
|
|
310
|
+
queryConfig: {
|
|
311
|
+
exploreName: COMPOSER_RESULT_TABLE_NAME,
|
|
312
|
+
dimensions: metricQuery.dimensions,
|
|
313
|
+
metrics: metricQuery.metrics,
|
|
314
|
+
sorts: [],
|
|
315
|
+
limit: null,
|
|
316
|
+
parameters: null,
|
|
317
|
+
customMetrics: null,
|
|
318
|
+
tableCalculations: null,
|
|
319
|
+
filters: {},
|
|
320
|
+
},
|
|
321
|
+
chartConfig,
|
|
322
|
+
mergeConfig: null,
|
|
323
|
+
},
|
|
324
|
+
rows: toComposerResultRows({ metricQuery, fields }, rows),
|
|
325
|
+
fields,
|
|
326
|
+
};
|
|
327
|
+
};
|
|
369
328
|
/** References of a series split, from the viz config alone; null without one. */
|
|
370
329
|
const getSplitReferences = (vizConfig, customChartTypeSlots) => {
|
|
371
330
|
if (vizConfig.type === 'custom') {
|