@lightdash/common 0.2104.7 → 0.2104.8
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 -0
- package/dist/cjs/authorization/index.d.ts +1 -4
- package/dist/cjs/authorization/index.d.ts.map +1 -1
- package/dist/cjs/authorization/index.js +0 -4
- package/dist/cjs/authorization/index.js.map +1 -1
- package/dist/cjs/ee/AiAgent/chartConfig/web/getWebAiChartConfig.d.ts +8 -8
- package/dist/cjs/ee/AiAgent/index.d.ts +2 -2
- package/dist/cjs/ee/AiAgent/schemas/parser.d.ts +24 -24
- package/dist/cjs/ee/AiAgent/schemas/tools/toolDashboardV2Args.d.ts +96 -96
- package/dist/cjs/ee/AiAgent/schemas/tools/toolRunQueryArgs.d.ts +48 -48
- package/dist/cjs/ee/AiAgent/utils.d.ts +8 -8
- package/dist/cjs/index.d.ts +23 -449
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +21 -55
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/pivot/index.d.ts +1 -0
- package/dist/cjs/pivot/index.d.ts.map +1 -1
- package/dist/cjs/pivot/index.js +1 -0
- package/dist/cjs/pivot/index.js.map +1 -1
- package/dist/cjs/pivot/pivotConfig.d.ts +7 -0
- package/dist/cjs/pivot/pivotConfig.d.ts.map +1 -0
- package/dist/cjs/pivot/pivotConfig.js +32 -0
- package/dist/cjs/pivot/pivotConfig.js.map +1 -0
- package/dist/cjs/types/api.d.ts +447 -0
- package/dist/cjs/types/api.d.ts.map +1 -1
- package/dist/cjs/types/api.js +50 -1
- package/dist/cjs/types/api.js.map +1 -1
- package/dist/cjs/types/auth.d.ts +2 -1
- package/dist/cjs/types/auth.d.ts.map +1 -1
- package/dist/cjs/types/auth.js +4 -4
- package/dist/cjs/types/auth.js.map +1 -1
- package/dist/cjs/types/changeset.d.ts +10 -10
- package/dist/cjs/types/pivot.d.ts +0 -2
- package/dist/cjs/types/pivot.d.ts.map +1 -1
- package/dist/cjs/types/pivot.js +0 -29
- package/dist/cjs/types/pivot.js.map +1 -1
- package/dist/cjs/types/resourceViewItem.d.ts +1 -1
- package/dist/esm/.tsbuildinfo +1 -0
- package/dist/esm/authorization/index.d.ts +1 -4
- package/dist/esm/authorization/index.d.ts.map +1 -1
- package/dist/esm/authorization/index.js +0 -4
- package/dist/esm/authorization/index.js.map +1 -1
- package/dist/esm/ee/AiAgent/chartConfig/web/getWebAiChartConfig.d.ts +8 -8
- package/dist/esm/ee/AiAgent/index.d.ts +2 -2
- package/dist/esm/ee/AiAgent/schemas/parser.d.ts +24 -24
- package/dist/esm/ee/AiAgent/schemas/tools/toolDashboardV2Args.d.ts +96 -96
- package/dist/esm/ee/AiAgent/schemas/tools/toolRunQueryArgs.d.ts +48 -48
- package/dist/esm/ee/AiAgent/utils.d.ts +8 -8
- package/dist/esm/index.d.ts +23 -449
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +16 -50
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/pivot/index.d.ts +1 -0
- package/dist/esm/pivot/index.d.ts.map +1 -1
- package/dist/esm/pivot/index.js +1 -0
- package/dist/esm/pivot/index.js.map +1 -1
- package/dist/esm/pivot/pivotConfig.d.ts +7 -0
- package/dist/esm/pivot/pivotConfig.d.ts.map +1 -0
- package/dist/esm/pivot/pivotConfig.js +28 -0
- package/dist/esm/pivot/pivotConfig.js.map +1 -0
- package/dist/esm/types/api.d.ts +447 -0
- package/dist/esm/types/api.d.ts.map +1 -1
- package/dist/esm/types/api.js +46 -0
- package/dist/esm/types/api.js.map +1 -1
- package/dist/esm/types/auth.d.ts +2 -1
- package/dist/esm/types/auth.d.ts.map +1 -1
- package/dist/esm/types/auth.js +2 -2
- package/dist/esm/types/auth.js.map +1 -1
- package/dist/esm/types/changeset.d.ts +10 -10
- package/dist/esm/types/pivot.d.ts +0 -2
- package/dist/esm/types/pivot.d.ts.map +1 -1
- package/dist/esm/types/pivot.js +1 -27
- package/dist/esm/types/pivot.js.map +1 -1
- package/dist/esm/types/resourceViewItem.d.ts +1 -1
- package/dist/types/.tsbuildinfo +1 -0
- package/dist/types/authorization/buildAccountHelpers.js +11 -0
- package/dist/types/authorization/buildAccountHelpers.js.map +1 -0
- package/dist/types/authorization/index.d.ts +1 -4
- package/dist/types/authorization/index.d.ts.map +1 -1
- package/dist/types/authorization/index.js +62 -0
- package/dist/types/authorization/index.js.map +1 -0
- package/dist/types/authorization/index.mock.js +42 -0
- package/dist/types/authorization/index.mock.js.map +1 -0
- package/dist/types/authorization/index.test.js +220 -0
- package/dist/types/authorization/index.test.js.map +1 -0
- package/dist/types/authorization/jwtAbility.js +77 -0
- package/dist/types/authorization/jwtAbility.js.map +1 -0
- package/dist/types/authorization/jwtAbility.test.js +416 -0
- package/dist/types/authorization/jwtAbility.test.js.map +1 -0
- package/dist/types/authorization/organizationMemberAbility.js +318 -0
- package/dist/types/authorization/organizationMemberAbility.js.map +1 -0
- package/dist/types/authorization/organizationMemberAbility.mock.js +34 -0
- package/dist/types/authorization/organizationMemberAbility.mock.js.map +1 -0
- package/dist/types/authorization/organizationMemberAbility.test.js +1265 -0
- package/dist/types/authorization/organizationMemberAbility.test.js.map +1 -0
- package/dist/types/authorization/parseAccount.js +28 -0
- package/dist/types/authorization/parseAccount.js.map +1 -0
- package/dist/types/authorization/parseScopes.js +31 -0
- package/dist/types/authorization/parseScopes.js.map +1 -0
- package/dist/types/authorization/parseScopes.test.js +102 -0
- package/dist/types/authorization/parseScopes.test.js.map +1 -0
- package/dist/types/authorization/projectMemberAbility.js +239 -0
- package/dist/types/authorization/projectMemberAbility.js.map +1 -0
- package/dist/types/authorization/projectMemberAbility.mock.js +27 -0
- package/dist/types/authorization/projectMemberAbility.mock.js.map +1 -0
- package/dist/types/authorization/projectMemberAbility.test.js +1031 -0
- package/dist/types/authorization/projectMemberAbility.test.js.map +1 -0
- package/dist/types/authorization/roleToScopeMapping.js +150 -0
- package/dist/types/authorization/roleToScopeMapping.js.map +1 -0
- package/dist/types/authorization/roleToScopeMapping.test.js +561 -0
- package/dist/types/authorization/roleToScopeMapping.test.js.map +1 -0
- package/dist/types/authorization/roleToScopeMapping.testUtils.js +319 -0
- package/dist/types/authorization/roleToScopeMapping.testUtils.js.map +1 -0
- package/dist/types/authorization/roleToScopeParity.test.js +194 -0
- package/dist/types/authorization/roleToScopeParity.test.js.map +1 -0
- package/dist/types/authorization/scopeAbilityBuilder.js +57 -0
- package/dist/types/authorization/scopeAbilityBuilder.js.map +1 -0
- package/dist/types/authorization/scopeAbilityBuilder.test.js +1348 -0
- package/dist/types/authorization/scopeAbilityBuilder.test.js.map +1 -0
- package/dist/types/authorization/scopes.js +613 -0
- package/dist/types/authorization/scopes.js.map +1 -0
- package/dist/types/authorization/serviceAccountAbility.js +303 -0
- package/dist/types/authorization/serviceAccountAbility.js.map +1 -0
- package/dist/types/authorization/types.js +2 -0
- package/dist/types/authorization/types.js.map +1 -0
- package/dist/types/compiler/exploreCompiler.js +462 -0
- package/dist/types/compiler/exploreCompiler.js.map +1 -0
- package/dist/types/compiler/exploreCompiler.mock.js +2016 -0
- package/dist/types/compiler/exploreCompiler.mock.js.map +1 -0
- package/dist/types/compiler/exploreCompiler.test.js +679 -0
- package/dist/types/compiler/exploreCompiler.test.js.map +1 -0
- package/dist/types/compiler/fieldSetExpander.js +119 -0
- package/dist/types/compiler/fieldSetExpander.js.map +1 -0
- package/dist/types/compiler/fieldSetExpander.test.js +184 -0
- package/dist/types/compiler/fieldSetExpander.test.js.map +1 -0
- package/dist/types/compiler/filtersCompiler.js +337 -0
- package/dist/types/compiler/filtersCompiler.js.map +1 -0
- package/dist/types/compiler/filtersCompiler.mock.js +496 -0
- package/dist/types/compiler/filtersCompiler.mock.js.map +1 -0
- package/dist/types/compiler/filtersCompiler.test.js +570 -0
- package/dist/types/compiler/filtersCompiler.test.js.map +1 -0
- package/dist/types/compiler/lightdashProjectConfig.js +37 -0
- package/dist/types/compiler/lightdashProjectConfig.js.map +1 -0
- package/dist/types/compiler/parameters.js +75 -0
- package/dist/types/compiler/parameters.js.map +1 -0
- package/dist/types/compiler/parameters.test.js +216 -0
- package/dist/types/compiler/parameters.test.js.map +1 -0
- package/dist/types/compiler/translator.js +707 -0
- package/dist/types/compiler/translator.js.map +1 -0
- package/dist/types/compiler/translator.mock.js +1901 -0
- package/dist/types/compiler/translator.mock.js.map +1 -0
- package/dist/types/compiler/translator.test.js +323 -0
- package/dist/types/compiler/translator.test.js.map +1 -0
- package/dist/types/constants/pivot.js +7 -0
- package/dist/types/constants/pivot.js.map +1 -0
- package/dist/types/constants/sessionStorageKeys.js +6 -0
- package/dist/types/constants/sessionStorageKeys.js.map +1 -0
- package/dist/types/constants/sqlRunner.js +3 -0
- package/dist/types/constants/sqlRunner.js.map +1 -0
- package/dist/types/dbt/DbtSchemaEditor/DbtSchemaEditor.js +285 -0
- package/dist/types/dbt/DbtSchemaEditor/DbtSchemaEditor.js.map +1 -0
- package/dist/types/dbt/DbtSchemaEditor/DbtSchemaEditor.mock.js +224 -0
- package/dist/types/dbt/DbtSchemaEditor/DbtSchemaEditor.mock.js.map +1 -0
- package/dist/types/dbt/DbtSchemaEditor/DbtSchemaEditor.test.js +129 -0
- package/dist/types/dbt/DbtSchemaEditor/DbtSchemaEditor.test.js.map +1 -0
- package/dist/types/dbt/schemas/lightdashMetadata.json +385 -0
- package/dist/types/dbt/schemas/lightdashV10.json +72 -0
- package/dist/types/dbt/schemas/lightdashV11.json +72 -0
- package/dist/types/dbt/schemas/lightdashV12.json +63 -0
- package/dist/types/dbt/schemas/lightdashV7.json +72 -0
- package/dist/types/dbt/schemas/lightdashV8.json +76 -0
- package/dist/types/dbt/schemas/lightdashV9.json +72 -0
- package/dist/types/dbt/schemas/manifestV10.json +5545 -0
- package/dist/types/dbt/schemas/manifestV11.json +6041 -0
- package/dist/types/dbt/schemas/manifestV12.json +22567 -0
- package/dist/types/dbt/schemas/manifestV7.json +6481 -0
- package/dist/types/dbt/schemas/manifestV8.json +4358 -0
- package/dist/types/dbt/schemas/manifestV9.json +4879 -0
- package/dist/types/dbt/validation.js +67 -0
- package/dist/types/dbt/validation.js.map +1 -0
- package/dist/types/ee/AiAgent/adminTypes.js +2 -0
- package/dist/types/ee/AiAgent/adminTypes.js.map +1 -0
- package/dist/types/ee/AiAgent/chartConfig/shared/formatFieldLabel.js +10 -0
- package/dist/types/ee/AiAgent/chartConfig/shared/formatFieldLabel.js.map +1 -0
- package/dist/types/ee/AiAgent/chartConfig/slack/generateBarVizConfigTool/getVerticalBarChartEchartsConfig.js +60 -0
- package/dist/types/ee/AiAgent/chartConfig/slack/generateBarVizConfigTool/getVerticalBarChartEchartsConfig.js.map +1 -0
- package/dist/types/ee/AiAgent/chartConfig/slack/generateTimeSeriesVizConfigTool/getTimeSeriesChartEchartsConfig.js +60 -0
- package/dist/types/ee/AiAgent/chartConfig/slack/generateTimeSeriesVizConfigTool/getTimeSeriesChartEchartsConfig.js.map +1 -0
- package/dist/types/ee/AiAgent/chartConfig/slack/getSlackAiEchartsConfig.js +33 -0
- package/dist/types/ee/AiAgent/chartConfig/slack/getSlackAiEchartsConfig.js.map +1 -0
- package/dist/types/ee/AiAgent/chartConfig/slack/index.js +2 -0
- package/dist/types/ee/AiAgent/chartConfig/slack/index.js.map +1 -0
- package/dist/types/ee/AiAgent/chartConfig/slack/runQueryTool/getRunQueryEchartsConfig.js +43 -0
- package/dist/types/ee/AiAgent/chartConfig/slack/runQueryTool/getRunQueryEchartsConfig.js.map +1 -0
- package/dist/types/ee/AiAgent/chartConfig/slack/runQueryTool/viz/bar.js +98 -0
- package/dist/types/ee/AiAgent/chartConfig/slack/runQueryTool/viz/bar.js.map +1 -0
- package/dist/types/ee/AiAgent/chartConfig/slack/runQueryTool/viz/funnel.js +38 -0
- package/dist/types/ee/AiAgent/chartConfig/slack/runQueryTool/viz/funnel.js.map +1 -0
- package/dist/types/ee/AiAgent/chartConfig/slack/runQueryTool/viz/horizontalBar.js +65 -0
- package/dist/types/ee/AiAgent/chartConfig/slack/runQueryTool/viz/horizontalBar.js.map +1 -0
- package/dist/types/ee/AiAgent/chartConfig/slack/runQueryTool/viz/line.js +105 -0
- package/dist/types/ee/AiAgent/chartConfig/slack/runQueryTool/viz/line.js.map +1 -0
- package/dist/types/ee/AiAgent/chartConfig/slack/runQueryTool/viz/pie.js +34 -0
- package/dist/types/ee/AiAgent/chartConfig/slack/runQueryTool/viz/pie.js.map +1 -0
- package/dist/types/ee/AiAgent/chartConfig/slack/runQueryTool/viz/scatter.js +66 -0
- package/dist/types/ee/AiAgent/chartConfig/slack/runQueryTool/viz/scatter.js.map +1 -0
- package/dist/types/ee/AiAgent/chartConfig/slack/shared/getCommonEChartsConfig.js +104 -0
- package/dist/types/ee/AiAgent/chartConfig/slack/shared/getCommonEChartsConfig.js.map +1 -0
- package/dist/types/ee/AiAgent/chartConfig/slack/types.js +2 -0
- package/dist/types/ee/AiAgent/chartConfig/slack/types.js.map +1 -0
- package/dist/types/ee/AiAgent/chartConfig/web/generateBarVizConfigTool/getVerticalBarChartConfig.js +65 -0
- package/dist/types/ee/AiAgent/chartConfig/web/generateBarVizConfigTool/getVerticalBarChartConfig.js.map +1 -0
- package/dist/types/ee/AiAgent/chartConfig/web/generateTableVizConfigTool/getTableChartConfig.js +5 -0
- package/dist/types/ee/AiAgent/chartConfig/web/generateTableVizConfigTool/getTableChartConfig.js.map +1 -0
- package/dist/types/ee/AiAgent/chartConfig/web/generateTimeSeriesVizConfigTool/getTimeSeriesChartConfig.js +63 -0
- package/dist/types/ee/AiAgent/chartConfig/web/generateTimeSeriesVizConfigTool/getTimeSeriesChartConfig.js.map +1 -0
- package/dist/types/ee/AiAgent/chartConfig/web/getWebAiChartConfig.d.ts +8 -8
- package/dist/types/ee/AiAgent/chartConfig/web/getWebAiChartConfig.js +51 -0
- package/dist/types/ee/AiAgent/chartConfig/web/getWebAiChartConfig.js.map +1 -0
- package/dist/types/ee/AiAgent/chartConfig/web/index.js +6 -0
- package/dist/types/ee/AiAgent/chartConfig/web/index.js.map +1 -0
- package/dist/types/ee/AiAgent/chartConfig/web/runQueryTool/getRunQueryChartConfig.js +73 -0
- package/dist/types/ee/AiAgent/chartConfig/web/runQueryTool/getRunQueryChartConfig.js.map +1 -0
- package/dist/types/ee/AiAgent/chartConfig/web/runQueryTool/viz/bar.js +91 -0
- package/dist/types/ee/AiAgent/chartConfig/web/runQueryTool/viz/bar.js.map +1 -0
- package/dist/types/ee/AiAgent/chartConfig/web/runQueryTool/viz/funnel.js +17 -0
- package/dist/types/ee/AiAgent/chartConfig/web/runQueryTool/viz/funnel.js.map +1 -0
- package/dist/types/ee/AiAgent/chartConfig/web/runQueryTool/viz/horizontalBar.js +52 -0
- package/dist/types/ee/AiAgent/chartConfig/web/runQueryTool/viz/horizontalBar.js.map +1 -0
- package/dist/types/ee/AiAgent/chartConfig/web/runQueryTool/viz/line.js +96 -0
- package/dist/types/ee/AiAgent/chartConfig/web/runQueryTool/viz/line.js.map +1 -0
- package/dist/types/ee/AiAgent/chartConfig/web/runQueryTool/viz/pie.js +15 -0
- package/dist/types/ee/AiAgent/chartConfig/web/runQueryTool/viz/pie.js.map +1 -0
- package/dist/types/ee/AiAgent/chartConfig/web/runQueryTool/viz/scatter.js +66 -0
- package/dist/types/ee/AiAgent/chartConfig/web/runQueryTool/viz/scatter.js.map +1 -0
- package/dist/types/ee/AiAgent/chartConfig/web/shared/canRenderAsChart.js +24 -0
- package/dist/types/ee/AiAgent/chartConfig/web/shared/canRenderAsChart.js.map +1 -0
- package/dist/types/ee/AiAgent/chartConfig/web/shared/formatPivotValueLabel.js +15 -0
- package/dist/types/ee/AiAgent/chartConfig/web/shared/formatPivotValueLabel.js.map +1 -0
- package/dist/types/ee/AiAgent/chartConfig/web/shared/getAvailableChartTypes.js +11 -0
- package/dist/types/ee/AiAgent/chartConfig/web/shared/getAvailableChartTypes.js.map +1 -0
- package/dist/types/ee/AiAgent/chartConfig/web/shared/getGroupByDimensions.js +15 -0
- package/dist/types/ee/AiAgent/chartConfig/web/shared/getGroupByDimensions.js.map +1 -0
- package/dist/types/ee/AiAgent/chartConfig/web/types.js +2 -0
- package/dist/types/ee/AiAgent/chartConfig/web/types.js.map +1 -0
- package/dist/types/ee/AiAgent/constants.js +2 -0
- package/dist/types/ee/AiAgent/constants.js.map +1 -0
- package/dist/types/ee/AiAgent/filterExploreByTags.js +94 -0
- package/dist/types/ee/AiAgent/filterExploreByTags.js.map +1 -0
- package/dist/types/ee/AiAgent/filterExploreByTags.test.js +634 -0
- package/dist/types/ee/AiAgent/filterExploreByTags.test.js.map +1 -0
- package/dist/types/ee/AiAgent/followUpTools.js +33 -0
- package/dist/types/ee/AiAgent/followUpTools.js.map +1 -0
- package/dist/types/ee/AiAgent/index.d.ts +2 -2
- package/dist/types/ee/AiAgent/index.js +43 -0
- package/dist/types/ee/AiAgent/index.js.map +1 -0
- package/dist/types/ee/AiAgent/requestTypes.js +2 -0
- package/dist/types/ee/AiAgent/requestTypes.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/customMetrics.js +50 -0
- package/dist/types/ee/AiAgent/schemas/customMetrics.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/fieldId.js +11 -0
- package/dist/types/ee/AiAgent/schemas/fieldId.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/filters/booleanFilters.js +29 -0
- package/dist/types/ee/AiAgent/schemas/filters/booleanFilters.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/filters/dateFilters.js +84 -0
- package/dist/types/ee/AiAgent/schemas/filters/dateFilters.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/filters/index.js +98 -0
- package/dist/types/ee/AiAgent/schemas/filters/index.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/filters/numberFilters.js +53 -0
- package/dist/types/ee/AiAgent/schemas/filters/numberFilters.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/filters/stringFilters.js +33 -0
- package/dist/types/ee/AiAgent/schemas/filters/stringFilters.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/index.js +9 -0
- package/dist/types/ee/AiAgent/schemas/index.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/outputMetadata.js +5 -0
- package/dist/types/ee/AiAgent/schemas/outputMetadata.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/parser.d.ts +24 -24
- package/dist/types/ee/AiAgent/schemas/parser.js +43 -0
- package/dist/types/ee/AiAgent/schemas/parser.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/sortField.js +14 -0
- package/dist/types/ee/AiAgent/schemas/sortField.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/tableCalcs/tableCalcBaseSchemas.js +28 -0
- package/dist/types/ee/AiAgent/schemas/tableCalcs/tableCalcBaseSchemas.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/tableCalcs/tableCalcPercentChangeFromPrevious.js +14 -0
- package/dist/types/ee/AiAgent/schemas/tableCalcs/tableCalcPercentChangeFromPrevious.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/tableCalcs/tableCalcPercentOfColumnTotal.js +14 -0
- package/dist/types/ee/AiAgent/schemas/tableCalcs/tableCalcPercentOfColumnTotal.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/tableCalcs/tableCalcPercentOfPreviousValue.js +14 -0
- package/dist/types/ee/AiAgent/schemas/tableCalcs/tableCalcPercentOfPreviousValue.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/tableCalcs/tableCalcRankInColumn.js +10 -0
- package/dist/types/ee/AiAgent/schemas/tableCalcs/tableCalcRankInColumn.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/tableCalcs/tableCalcRunningTotal.js +10 -0
- package/dist/types/ee/AiAgent/schemas/tableCalcs/tableCalcRunningTotal.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/tableCalcs/tableCalcWindowFunction.js +105 -0
- package/dist/types/ee/AiAgent/schemas/tableCalcs/tableCalcWindowFunction.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/tableCalcs/tableCalcs.js +168 -0
- package/dist/types/ee/AiAgent/schemas/tableCalcs/tableCalcs.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/toolSchemaBuilder.js +37 -0
- package/dist/types/ee/AiAgent/schemas/toolSchemaBuilder.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/tools/index.js +16 -0
- package/dist/types/ee/AiAgent/schemas/tools/index.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolDashboardArgs.js +103 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolDashboardArgs.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolDashboardV2Args.d.ts +96 -96
- package/dist/types/ee/AiAgent/schemas/tools/toolDashboardV2Args.js +50 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolDashboardV2Args.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolFindChartsArgs.js +34 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolFindChartsArgs.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolFindContentArgs.js +33 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolFindContentArgs.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolFindDashboardsArgs.js +36 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolFindDashboardsArgs.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolFindExploresArgs.js +45 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolFindExploresArgs.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolFindFieldsArgs.js +34 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolFindFieldsArgs.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolImproveContextArgs.js +60 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolImproveContextArgs.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolProposeChangeArgs.js +157 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolProposeChangeArgs.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolRunMetricQueryArgs.js +41 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolRunMetricQueryArgs.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolRunQueryArgs.d.ts +48 -48
- package/dist/types/ee/AiAgent/schemas/tools/toolRunQueryArgs.js +151 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolRunQueryArgs.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolSearchFieldValuesArgs.js +46 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolSearchFieldValuesArgs.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolTableVizArgs.js +53 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolTableVizArgs.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolTimeSeriesArgs.js +58 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolTimeSeriesArgs.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolVerticalBarArgs.js +53 -0
- package/dist/types/ee/AiAgent/schemas/tools/toolVerticalBarArgs.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/visualizationMetadata.js +9 -0
- package/dist/types/ee/AiAgent/schemas/visualizationMetadata.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/visualizations/index.js +58 -0
- package/dist/types/ee/AiAgent/schemas/visualizations/index.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/visualizations/tableViz.js +38 -0
- package/dist/types/ee/AiAgent/schemas/visualizations/tableViz.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/visualizations/timeSeriesViz.js +63 -0
- package/dist/types/ee/AiAgent/schemas/visualizations/timeSeriesViz.js.map +1 -0
- package/dist/types/ee/AiAgent/schemas/visualizations/verticalBarViz.js +68 -0
- package/dist/types/ee/AiAgent/schemas/visualizations/verticalBarViz.js.map +1 -0
- package/dist/types/ee/AiAgent/types.js +12 -0
- package/dist/types/ee/AiAgent/types.js.map +1 -0
- package/dist/types/ee/AiAgent/utils.d.ts +8 -8
- package/dist/types/ee/AiAgent/utils.js +82 -0
- package/dist/types/ee/AiAgent/utils.js.map +1 -0
- package/dist/types/ee/AiAgent/validators.js +10 -0
- package/dist/types/ee/AiAgent/validators.js.map +1 -0
- package/dist/types/ee/commercialFeatureFlags.js +10 -0
- package/dist/types/ee/commercialFeatureFlags.js.map +1 -0
- package/dist/types/ee/embed/index.js +90 -0
- package/dist/types/ee/embed/index.js.map +1 -0
- package/dist/types/ee/index.js +19 -0
- package/dist/types/ee/index.js.map +1 -0
- package/dist/types/ee/scim/errors.js +22 -0
- package/dist/types/ee/scim/errors.js.map +1 -0
- package/dist/types/ee/scim/types.js +2 -0
- package/dist/types/ee/scim/types.js.map +1 -0
- package/dist/types/ee/serviceAccounts/types.js +8 -0
- package/dist/types/ee/serviceAccounts/types.js.map +1 -0
- package/dist/types/index.d.ts +23 -449
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +652 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/index.mock.js +44 -0
- package/dist/types/index.mock.js.map +1 -0
- package/dist/types/index.test.js +123 -0
- package/dist/types/index.test.js.map +1 -0
- package/dist/types/pivot/derivePivotConfigFromChart.js +206 -0
- package/dist/types/pivot/derivePivotConfigFromChart.js.map +1 -0
- package/dist/types/pivot/derivePivotConfigFromChart.mock.js +112 -0
- package/dist/types/pivot/derivePivotConfigFromChart.mock.js.map +1 -0
- package/dist/types/pivot/derivePivotConfigFromChart.test.js +418 -0
- package/dist/types/pivot/derivePivotConfigFromChart.test.js.map +1 -0
- package/dist/types/pivot/index.d.ts +1 -0
- package/dist/types/pivot/index.d.ts.map +1 -1
- package/dist/types/pivot/index.js +5 -0
- package/dist/types/pivot/index.js.map +1 -0
- package/dist/types/pivot/pivotConfig.d.ts +7 -0
- package/dist/types/pivot/pivotConfig.d.ts.map +1 -0
- package/dist/types/pivot/pivotConfig.js +28 -0
- package/dist/types/pivot/pivotConfig.js.map +1 -0
- package/dist/types/pivot/pivotQueryResults.js +1034 -0
- package/dist/types/pivot/pivotQueryResults.js.map +1 -0
- package/dist/types/pivot/pivotQueryResults.mock.js +2412 -0
- package/dist/types/pivot/pivotQueryResults.mock.js.map +1 -0
- package/dist/types/pivot/pivotQueryResults.test.js +1222 -0
- package/dist/types/pivot/pivotQueryResults.test.js.map +1 -0
- package/dist/types/pivot/utils.js +14 -0
- package/dist/types/pivot/utils.js.map +1 -0
- package/dist/types/schemas/json/chart-as-code-1.0.json +436 -0
- package/dist/types/schemas/json/dashboard-as-code-1.0.json +349 -0
- package/dist/types/schemas/json/lightdash-dbt-2.0.json +1417 -0
- package/dist/types/schemas/json/lightdash-project-config-1.0.json +138 -0
- package/dist/types/templating/template.js +30 -0
- package/dist/types/templating/template.js.map +1 -0
- package/dist/types/templating/template.mock.js +45 -0
- package/dist/types/templating/template.mock.js.map +1 -0
- package/dist/types/templating/template.test.js +21 -0
- package/dist/types/templating/template.test.js.map +1 -0
- package/dist/types/types/SshKeyPair.js +2 -0
- package/dist/types/types/SshKeyPair.js.map +1 -0
- package/dist/types/types/account.js +2 -0
- package/dist/types/types/account.js.map +1 -0
- package/dist/types/types/analytics.js +29 -0
- package/dist/types/types/analytics.js.map +1 -0
- package/dist/types/types/any.js +2 -0
- package/dist/types/types/any.js.map +1 -0
- package/dist/types/types/api/comments.js +2 -0
- package/dist/types/types/api/comments.js.map +1 -0
- package/dist/types/types/api/email.js +2 -0
- package/dist/types/types/api/email.js.map +1 -0
- package/dist/types/types/api/errors.js +2 -0
- package/dist/types/types/api/errors.js.map +1 -0
- package/dist/types/types/api/notifications.js +5 -0
- package/dist/types/types/api/notifications.js.map +1 -0
- package/dist/types/types/api/paginatedQuery.js +3 -0
- package/dist/types/types/api/paginatedQuery.js.map +1 -0
- package/dist/types/types/api/parameters.js +2 -0
- package/dist/types/types/api/parameters.js.map +1 -0
- package/dist/types/types/api/share.js +2 -0
- package/dist/types/types/api/share.js.map +1 -0
- package/dist/types/types/api/sort.js +2 -0
- package/dist/types/types/api/sort.js.map +1 -0
- package/dist/types/types/api/spotlight.js +2 -0
- package/dist/types/types/api/spotlight.js.map +1 -0
- package/dist/types/types/api/success.js +2 -0
- package/dist/types/types/api/success.js.map +1 -0
- package/dist/types/types/api/uuid.js +2 -0
- package/dist/types/types/api/uuid.js.map +1 -0
- package/dist/types/types/api.d.ts +447 -0
- package/dist/types/types/api.d.ts.map +1 -1
- package/dist/types/types/api.js +57 -0
- package/dist/types/types/api.js.map +1 -0
- package/dist/types/types/applyDimensionOverrides.test.js +338 -0
- package/dist/types/types/applyDimensionOverrides.test.js.map +1 -0
- package/dist/types/types/auth.d.ts +2 -1
- package/dist/types/types/auth.d.ts.map +1 -1
- package/dist/types/types/auth.js +42 -0
- package/dist/types/types/auth.js.map +1 -0
- package/dist/types/types/bigQuerySSO.js +2 -0
- package/dist/types/types/bigQuerySSO.js.map +1 -0
- package/dist/types/types/catalog.js +50 -0
- package/dist/types/types/catalog.js.map +1 -0
- package/dist/types/types/changeset.d.ts +10 -10
- package/dist/types/types/changeset.js +72 -0
- package/dist/types/types/changeset.js.map +1 -0
- package/dist/types/types/coder.js +2 -0
- package/dist/types/types/coder.js.map +1 -0
- package/dist/types/types/comments.js +2 -0
- package/dist/types/types/comments.js.map +1 -0
- package/dist/types/types/conditionalFormatting.js +25 -0
- package/dist/types/types/conditionalFormatting.js.map +1 -0
- package/dist/types/types/content.js +19 -0
- package/dist/types/types/content.js.map +1 -0
- package/dist/types/types/csv.js +2 -0
- package/dist/types/types/csv.js.map +1 -0
- package/dist/types/types/dashboard.js +46 -0
- package/dist/types/types/dashboard.js.map +1 -0
- package/dist/types/types/dbt.js +262 -0
- package/dist/types/types/dbt.js.map +1 -0
- package/dist/types/types/dbtFromSchema.js +2 -0
- package/dist/types/types/dbtFromSchema.js.map +1 -0
- package/dist/types/types/deepPartial.js +7 -0
- package/dist/types/types/deepPartial.js.map +1 -0
- package/dist/types/types/downloadFile.js +9 -0
- package/dist/types/types/downloadFile.js.map +1 -0
- package/dist/types/types/email.js +2 -0
- package/dist/types/types/email.js.map +1 -0
- package/dist/types/types/errors.js +496 -0
- package/dist/types/types/errors.js.map +1 -0
- package/dist/types/types/explore.js +24 -0
- package/dist/types/types/explore.js.map +1 -0
- package/dist/types/types/featureFlags.js +62 -0
- package/dist/types/types/featureFlags.js.map +1 -0
- package/dist/types/types/field.js +473 -0
- package/dist/types/types/field.js.map +1 -0
- package/dist/types/types/field.test.js +90 -0
- package/dist/types/types/field.test.js.map +1 -0
- package/dist/types/types/fieldMatch.js +2 -0
- package/dist/types/types/fieldMatch.js.map +1 -0
- package/dist/types/types/filter.js +287 -0
- package/dist/types/types/filter.js.map +1 -0
- package/dist/types/types/filter.test.js +372 -0
- package/dist/types/types/filter.test.js.map +1 -0
- package/dist/types/types/filterGrammar.js +358 -0
- package/dist/types/types/filterGrammar.js.map +1 -0
- package/dist/types/types/filterGrammar.test.js +549 -0
- package/dist/types/types/filterGrammar.test.js.map +1 -0
- package/dist/types/types/filterGrammarConversion.js +94 -0
- package/dist/types/types/filterGrammarConversion.js.map +1 -0
- package/dist/types/types/filterGrammarConversion.test.js +260 -0
- package/dist/types/types/filterGrammarConversion.test.js.map +1 -0
- package/dist/types/types/gdrive.js +2 -0
- package/dist/types/types/gdrive.js.map +1 -0
- package/dist/types/types/gitIntegration.js +2 -0
- package/dist/types/types/gitIntegration.js.map +1 -0
- package/dist/types/types/groups.js +4 -0
- package/dist/types/types/groups.js.map +1 -0
- package/dist/types/types/job.js +67 -0
- package/dist/types/types/job.js.map +1 -0
- package/dist/types/types/knex-paginate.js +2 -0
- package/dist/types/types/knex-paginate.js.map +1 -0
- package/dist/types/types/lightdashProjectConfig.js +4 -0
- package/dist/types/types/lightdashProjectConfig.js.map +1 -0
- package/dist/types/types/metricQuery.js +20 -0
- package/dist/types/types/metricQuery.js.map +1 -0
- package/dist/types/types/metricsExplorer.js +12 -0
- package/dist/types/types/metricsExplorer.js.map +1 -0
- package/dist/types/types/notifications.js +2 -0
- package/dist/types/types/notifications.js.map +1 -0
- package/dist/types/types/oauth.js +2 -0
- package/dist/types/types/oauth.js.map +1 -0
- package/dist/types/types/openIdIdentity.js +12 -0
- package/dist/types/types/openIdIdentity.js.map +1 -0
- package/dist/types/types/organization.js +20 -0
- package/dist/types/types/organization.js.map +1 -0
- package/dist/types/types/organizationMemberProfile.js +30 -0
- package/dist/types/types/organizationMemberProfile.js.map +1 -0
- package/dist/types/types/organizationWarehouseCredentials.js +2 -0
- package/dist/types/types/organizationWarehouseCredentials.js.map +1 -0
- package/dist/types/types/paginateResults.js +2 -0
- package/dist/types/types/paginateResults.js.map +1 -0
- package/dist/types/types/parameters.js +2 -0
- package/dist/types/types/parameters.js.map +1 -0
- package/dist/types/types/personalAccessToken.js +2 -0
- package/dist/types/types/personalAccessToken.js.map +1 -0
- package/dist/types/types/pinning.js +5 -0
- package/dist/types/types/pinning.js.map +1 -0
- package/dist/types/types/pivot.d.ts +0 -2
- package/dist/types/types/pivot.d.ts.map +1 -1
- package/dist/types/types/pivot.js +2 -0
- package/dist/types/types/pivot.js.map +1 -0
- package/dist/types/types/projectGroupAccess.js +2 -0
- package/dist/types/types/projectGroupAccess.js.map +1 -0
- package/dist/types/types/projectMemberProfile.js +2 -0
- package/dist/types/types/projectMemberProfile.js.map +1 -0
- package/dist/types/types/projectMemberRole.js +30 -0
- package/dist/types/types/projectMemberRole.js.map +1 -0
- package/dist/types/types/projects.js +149 -0
- package/dist/types/types/projects.js.map +1 -0
- package/dist/types/types/promotion.js +8 -0
- package/dist/types/types/promotion.js.map +1 -0
- package/dist/types/types/queryHistory.js +8 -0
- package/dist/types/types/queryHistory.js.map +1 -0
- package/dist/types/types/rename.js +6 -0
- package/dist/types/types/rename.js.map +1 -0
- package/dist/types/types/resourceViewItem.d.ts +1 -1
- package/dist/types/types/resourceViewItem.js +103 -0
- package/dist/types/types/resourceViewItem.js.map +1 -0
- package/dist/types/types/results.js +51 -0
- package/dist/types/types/results.js.map +1 -0
- package/dist/types/types/roles.js +2 -0
- package/dist/types/types/roles.js.map +1 -0
- package/dist/types/types/savedCharts.js +225 -0
- package/dist/types/types/savedCharts.js.map +1 -0
- package/dist/types/types/scheduler.js +87 -0
- package/dist/types/types/scheduler.js.map +1 -0
- package/dist/types/types/schedulerLog.js +2 -0
- package/dist/types/types/schedulerLog.js.map +1 -0
- package/dist/types/types/schedulerTaskList.js +31 -0
- package/dist/types/types/schedulerTaskList.js.map +1 -0
- package/dist/types/types/scopes.js +14 -0
- package/dist/types/types/scopes.js.map +1 -0
- package/dist/types/types/search.js +53 -0
- package/dist/types/types/search.js.map +1 -0
- package/dist/types/types/share.js +2 -0
- package/dist/types/types/share.js.map +1 -0
- package/dist/types/types/slack.js +2 -0
- package/dist/types/types/slack.js.map +1 -0
- package/dist/types/types/slackSettings.js +2 -0
- package/dist/types/types/slackSettings.js.map +1 -0
- package/dist/types/types/space.js +7 -0
- package/dist/types/types/space.js.map +1 -0
- package/dist/types/types/spotlightTableConfig.js +17 -0
- package/dist/types/types/spotlightTableConfig.js.map +1 -0
- package/dist/types/types/sqlRunner.js +41 -0
- package/dist/types/types/sqlRunner.js.map +1 -0
- package/dist/types/types/table.js +6 -0
- package/dist/types/types/table.js.map +1 -0
- package/dist/types/types/tags.js +2 -0
- package/dist/types/types/tags.js.map +1 -0
- package/dist/types/types/timeFrames.js +42 -0
- package/dist/types/types/timeFrames.js.map +1 -0
- package/dist/types/types/timezone.js +33 -0
- package/dist/types/types/timezone.js.map +1 -0
- package/dist/types/types/user.js +23 -0
- package/dist/types/types/user.js.map +1 -0
- package/dist/types/types/userAttributes.js +2 -0
- package/dist/types/types/userAttributes.js.map +1 -0
- package/dist/types/types/userWarehouseCredentials.js +2 -0
- package/dist/types/types/userWarehouseCredentials.js.map +1 -0
- package/dist/types/types/validation.js +29 -0
- package/dist/types/types/validation.js.map +1 -0
- package/dist/types/types/warehouse.js +6 -0
- package/dist/types/types/warehouse.js.map +1 -0
- package/dist/types/types/yamlSchema.js +2 -0
- package/dist/types/types/yamlSchema.js.map +1 -0
- package/dist/types/utils/accessors.js +27 -0
- package/dist/types/utils/accessors.js.map +1 -0
- package/dist/types/utils/accessors.test.js +45 -0
- package/dist/types/utils/accessors.test.js.map +1 -0
- package/dist/types/utils/additionalMetrics.js +54 -0
- package/dist/types/utils/additionalMetrics.js.map +1 -0
- package/dist/types/utils/api.js +5 -0
- package/dist/types/utils/api.js.map +1 -0
- package/dist/types/utils/assertUnreachable.js +10 -0
- package/dist/types/utils/assertUnreachable.js.map +1 -0
- package/dist/types/utils/booleanConverter.js +27 -0
- package/dist/types/utils/booleanConverter.js.map +1 -0
- package/dist/types/utils/booleanConverter.test.js +59 -0
- package/dist/types/utils/booleanConverter.test.js.map +1 -0
- package/dist/types/utils/catalogMetricsTree.js +2 -0
- package/dist/types/utils/catalogMetricsTree.js.map +1 -0
- package/dist/types/utils/changeset.js +132 -0
- package/dist/types/utils/changeset.js.map +1 -0
- package/dist/types/utils/changeset.mock.js +146 -0
- package/dist/types/utils/changeset.mock.js.map +1 -0
- package/dist/types/utils/changeset.test.js +248 -0
- package/dist/types/utils/changeset.test.js.map +1 -0
- package/dist/types/utils/charts.js +74 -0
- package/dist/types/utils/charts.js.map +1 -0
- package/dist/types/utils/colors.js +15 -0
- package/dist/types/utils/colors.js.map +1 -0
- package/dist/types/utils/colors.test.js +85 -0
- package/dist/types/utils/colors.test.js.map +1 -0
- package/dist/types/utils/conditionalFormatting.js +436 -0
- package/dist/types/utils/conditionalFormatting.js.map +1 -0
- package/dist/types/utils/conditionalFormatting.test.js +105 -0
- package/dist/types/utils/conditionalFormatting.test.js.map +1 -0
- package/dist/types/utils/convertCustomDimensionsToYaml.js +115 -0
- package/dist/types/utils/convertCustomDimensionsToYaml.js.map +1 -0
- package/dist/types/utils/convertCustomMetricsToYaml.js +15 -0
- package/dist/types/utils/convertCustomMetricsToYaml.js.map +1 -0
- package/dist/types/utils/customDimensions.js +27 -0
- package/dist/types/utils/customDimensions.js.map +1 -0
- package/dist/types/utils/dashboard.js +35 -0
- package/dist/types/utils/dashboard.js.map +1 -0
- package/dist/types/utils/dashboard.test.js +36 -0
- package/dist/types/utils/dashboard.test.js.map +1 -0
- package/dist/types/utils/dbt.js +4 -0
- package/dist/types/utils/dbt.js.map +1 -0
- package/dist/types/utils/dbt.test.js +39 -0
- package/dist/types/utils/dbt.test.js.map +1 -0
- package/dist/types/utils/dependencyGraph.js +51 -0
- package/dist/types/utils/dependencyGraph.js.map +1 -0
- package/dist/types/utils/dependencyGraph.test.js +113 -0
- package/dist/types/utils/dependencyGraph.test.js.map +1 -0
- package/dist/types/utils/email.js +76 -0
- package/dist/types/utils/email.js.map +1 -0
- package/dist/types/utils/email.test.js +49 -0
- package/dist/types/utils/email.test.js.map +1 -0
- package/dist/types/utils/fields.js +183 -0
- package/dist/types/utils/fields.js.map +1 -0
- package/dist/types/utils/fields.mock.js +150 -0
- package/dist/types/utils/fields.mock.js.map +1 -0
- package/dist/types/utils/fields.test.js +259 -0
- package/dist/types/utils/fields.test.js.map +1 -0
- package/dist/types/utils/filters.js +763 -0
- package/dist/types/utils/filters.js.map +1 -0
- package/dist/types/utils/filters.mock.js +450 -0
- package/dist/types/utils/filters.mock.js.map +1 -0
- package/dist/types/utils/filters.test.js +360 -0
- package/dist/types/utils/filters.test.js.map +1 -0
- package/dist/types/utils/formatting.js +552 -0
- package/dist/types/utils/formatting.js.map +1 -0
- package/dist/types/utils/formatting.mock.js +28 -0
- package/dist/types/utils/formatting.mock.js.map +1 -0
- package/dist/types/utils/formatting.test.js +1047 -0
- package/dist/types/utils/formatting.test.js.map +1 -0
- package/dist/types/utils/github.js +11 -0
- package/dist/types/utils/github.js.map +1 -0
- package/dist/types/utils/i18n/abstract.js +3 -0
- package/dist/types/utils/i18n/abstract.js.map +1 -0
- package/dist/types/utils/i18n/chartAsCode.js +132 -0
- package/dist/types/utils/i18n/chartAsCode.js.map +1 -0
- package/dist/types/utils/i18n/chartAsCode.test.js +350 -0
- package/dist/types/utils/i18n/chartAsCode.test.js.map +1 -0
- package/dist/types/utils/i18n/dashboardAsCode.js +58 -0
- package/dist/types/utils/i18n/dashboardAsCode.js.map +1 -0
- package/dist/types/utils/i18n/index.js +5 -0
- package/dist/types/utils/i18n/index.js.map +1 -0
- package/dist/types/utils/i18n/merge.js +20 -0
- package/dist/types/utils/i18n/merge.js.map +1 -0
- package/dist/types/utils/i18n/types.js +2 -0
- package/dist/types/utils/i18n/types.js.map +1 -0
- package/dist/types/utils/item.js +154 -0
- package/dist/types/utils/item.js.map +1 -0
- package/dist/types/utils/loadLightdashProjectConfig.js +49 -0
- package/dist/types/utils/loadLightdashProjectConfig.js.map +1 -0
- package/dist/types/utils/loadLightdashProjectConfig.mock.js +127 -0
- package/dist/types/utils/loadLightdashProjectConfig.mock.js.map +1 -0
- package/dist/types/utils/loadLightdashProjectConfig.test.js +137 -0
- package/dist/types/utils/loadLightdashProjectConfig.test.js.map +1 -0
- package/dist/types/utils/metricsExplorer.js +365 -0
- package/dist/types/utils/metricsExplorer.js.map +1 -0
- package/dist/types/utils/oauth.js +242 -0
- package/dist/types/utils/oauth.js.map +1 -0
- package/dist/types/utils/organization.js +23 -0
- package/dist/types/utils/organization.js.map +1 -0
- package/dist/types/utils/projectMemberRole.js +85 -0
- package/dist/types/utils/projectMemberRole.js.map +1 -0
- package/dist/types/utils/projectMemberRole.test.js +36 -0
- package/dist/types/utils/projectMemberRole.test.js.map +1 -0
- package/dist/types/utils/promises.js +5 -0
- package/dist/types/utils/promises.js.map +1 -0
- package/dist/types/utils/sanitizeHtml.js +111 -0
- package/dist/types/utils/sanitizeHtml.js.map +1 -0
- package/dist/types/utils/sanitizeHtml.test.js +101 -0
- package/dist/types/utils/sanitizeHtml.test.js.map +1 -0
- package/dist/types/utils/scheduler.js +85 -0
- package/dist/types/utils/scheduler.js.map +1 -0
- package/dist/types/utils/scheduler.test.js +41 -0
- package/dist/types/utils/scheduler.test.js.map +1 -0
- package/dist/types/utils/searchParams.js +8 -0
- package/dist/types/utils/searchParams.js.map +1 -0
- package/dist/types/utils/sleep.js +6 -0
- package/dist/types/utils/sleep.js.map +1 -0
- package/dist/types/utils/slug.test.js +129 -0
- package/dist/types/utils/slug.test.js.map +1 -0
- package/dist/types/utils/slugs.js +55 -0
- package/dist/types/utils/slugs.js.map +1 -0
- package/dist/types/utils/subtotals.js +4 -0
- package/dist/types/utils/subtotals.js.map +1 -0
- package/dist/types/utils/time.js +25 -0
- package/dist/types/utils/time.js.map +1 -0
- package/dist/types/utils/timeFrames.js +529 -0
- package/dist/types/utils/timeFrames.js.map +1 -0
- package/dist/types/utils/timeFrames.test.js +50 -0
- package/dist/types/utils/timeFrames.test.js.map +1 -0
- package/dist/types/utils/virtualView.js +98 -0
- package/dist/types/utils/virtualView.js.map +1 -0
- package/dist/types/utils/warehouse.js +57 -0
- package/dist/types/utils/warehouse.js.map +1 -0
- package/dist/types/visualizations/CartesianChartDataModel.js +515 -0
- package/dist/types/visualizations/CartesianChartDataModel.js.map +1 -0
- package/dist/types/visualizations/PieChartDataModel.js +258 -0
- package/dist/types/visualizations/PieChartDataModel.js.map +1 -0
- package/dist/types/visualizations/TableDataModel.js +96 -0
- package/dist/types/visualizations/TableDataModel.js.map +1 -0
- package/dist/types/visualizations/chartTransformations.js +107 -0
- package/dist/types/visualizations/chartTransformations.js.map +1 -0
- package/dist/types/visualizations/helpers/getCartesianAxisFormatterConfig.js +142 -0
- package/dist/types/visualizations/helpers/getCartesianAxisFormatterConfig.js.map +1 -0
- package/dist/types/visualizations/types/IResultsRunner.js +2 -0
- package/dist/types/visualizations/types/IResultsRunner.js.map +1 -0
- package/dist/types/visualizations/types/index.js +78 -0
- package/dist/types/visualizations/types/index.js.map +1 -0
- package/package.json +1 -1
- package/dist/tsconfig.types.tsbuildinfo +0 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { getFieldIdSchema } from '../fieldId';
|
|
3
|
+
import { filtersSchemaTransformed, filtersSchemaV2 } from '../filters';
|
|
4
|
+
import { baseOutputMetadataSchema } from '../outputMetadata';
|
|
5
|
+
import { createToolSchema } from '../toolSchemaBuilder';
|
|
6
|
+
export const TOOL_SEARCH_FIELD_VALUES_DESCRIPTION = `Tool: searchFieldValues
|
|
7
|
+
|
|
8
|
+
Purpose:
|
|
9
|
+
Search for unique values of a specific field in a table. Returns all unique values by default, or use the query parameter to narrow down results. This is useful for finding suggestions for field values when building filters or exploring data.
|
|
10
|
+
|
|
11
|
+
Usage Tips:
|
|
12
|
+
- Specify the table and field you want to search values for
|
|
13
|
+
- Query parameter: use it to narrow down the search to matching values
|
|
14
|
+
- Optionally add filters to further restrict the results
|
|
15
|
+
- Results are returned as a list of unique field values (limited to 100)
|
|
16
|
+
`;
|
|
17
|
+
export const toolSearchFieldValuesArgsSchema = createToolSchema({
|
|
18
|
+
type: 'search_field_values',
|
|
19
|
+
description: TOOL_SEARCH_FIELD_VALUES_DESCRIPTION,
|
|
20
|
+
})
|
|
21
|
+
.extend({
|
|
22
|
+
table: z.string().describe('The table to search in.'),
|
|
23
|
+
fieldId: getFieldIdSchema({
|
|
24
|
+
additionalDescription: 'The ID of the field to search values for',
|
|
25
|
+
}),
|
|
26
|
+
query: z
|
|
27
|
+
.string()
|
|
28
|
+
.describe('Query string to filter field values')
|
|
29
|
+
.nullable(),
|
|
30
|
+
filters: filtersSchemaV2
|
|
31
|
+
.nullable()
|
|
32
|
+
.describe('Filters to apply to the query. Filtered fields must exist in the selected explore or should be referenced from the custom metrics.'),
|
|
33
|
+
})
|
|
34
|
+
.build();
|
|
35
|
+
export const toolSearchFieldValuesArgsSchemaTransformed = toolSearchFieldValuesArgsSchema.transform((data) => ({
|
|
36
|
+
...data,
|
|
37
|
+
filters: data.filters
|
|
38
|
+
? filtersSchemaTransformed.parse(data.filters)
|
|
39
|
+
: undefined,
|
|
40
|
+
query: data.query ?? '',
|
|
41
|
+
}));
|
|
42
|
+
export const toolSearchFieldValuesOutputSchema = z.object({
|
|
43
|
+
result: z.string(),
|
|
44
|
+
metadata: baseOutputMetadataSchema,
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=toolSearchFieldValuesArgs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolSearchFieldValuesArgs.js","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/schemas/tools/toolSearchFieldValuesArgs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,MAAM,CAAC,MAAM,oCAAoC,GAAG;;;;;;;;;;CAUnD,CAAC;AAEF,MAAM,CAAC,MAAM,+BAA+B,GAAG,gBAAgB,CAAC;IAC5D,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,oCAAoC;CACpD,CAAC;KACG,MAAM,CAAC;IACJ,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;IACrD,OAAO,EAAE,gBAAgB,CAAC;QACtB,qBAAqB,EAAE,0CAA0C;KACpE,CAAC;IACF,KAAK,EAAE,CAAC;SACH,MAAM,EAAE;SACR,QAAQ,CAAC,qCAAqC,CAAC;SAC/C,QAAQ,EAAE;IACf,OAAO,EAAE,eAAe;SACnB,QAAQ,EAAE;SACV,QAAQ,CACL,oIAAoI,CACvI;CACR,CAAC;KACD,KAAK,EAAE,CAAC;AAMb,MAAM,CAAC,MAAM,0CAA0C,GACnD,+BAA+B,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACjD,GAAG,IAAI;IACP,OAAO,EAAE,IAAI,CAAC,OAAO;QACjB,CAAC,CAAC,wBAAwB,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;QAC9C,CAAC,CAAC,SAAS;IACf,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,EAAE;CAC1B,CAAC,CAAC,CAAC;AAMR,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CAAC;IACtD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,QAAQ,EAAE,wBAAwB;CACrC,CAAC,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { LegacyFollowUpTools, legacyFollowUpToolsTransform, } from '../../followUpTools';
|
|
3
|
+
import { AiResultType } from '../../types';
|
|
4
|
+
import { customMetricsSchema } from '../customMetrics';
|
|
5
|
+
import { filtersSchemaTransformed, filtersSchemaV2 } from '../filters';
|
|
6
|
+
import { baseOutputMetadataSchema } from '../outputMetadata';
|
|
7
|
+
import { tableCalcsSchema } from '../tableCalcs/tableCalcs';
|
|
8
|
+
import { createToolSchema } from '../toolSchemaBuilder';
|
|
9
|
+
import visualizationMetadataSchema from '../visualizationMetadata';
|
|
10
|
+
import { tableVizConfigSchema } from '../visualizations';
|
|
11
|
+
export const TOOL_TABLE_VIZ_DESCRIPTION = `Use this tool to query data to display in a table or summarized if limit is set to 1.`;
|
|
12
|
+
export const toolTableVizArgsSchema = createToolSchema({
|
|
13
|
+
type: AiResultType.TABLE_RESULT,
|
|
14
|
+
description: TOOL_TABLE_VIZ_DESCRIPTION,
|
|
15
|
+
})
|
|
16
|
+
.extend({
|
|
17
|
+
...visualizationMetadataSchema.shape,
|
|
18
|
+
customMetrics: customMetricsSchema,
|
|
19
|
+
tableCalculations: tableCalcsSchema,
|
|
20
|
+
vizConfig: tableVizConfigSchema,
|
|
21
|
+
filters: filtersSchemaV2
|
|
22
|
+
.nullable()
|
|
23
|
+
.describe('Filters to apply to the query. Filtered fields must exist in the selected explore or should be referenced from the custom metrics.'),
|
|
24
|
+
followUpTools: z
|
|
25
|
+
.array(z.union([
|
|
26
|
+
z.literal(AiResultType.VERTICAL_BAR_RESULT),
|
|
27
|
+
z.literal(AiResultType.TIME_SERIES_RESULT),
|
|
28
|
+
]))
|
|
29
|
+
.describe('The actions the User can ask for after the AI has generated the table.'),
|
|
30
|
+
})
|
|
31
|
+
.build();
|
|
32
|
+
export const toolTableVizArgsSchemaTransformed = toolTableVizArgsSchema
|
|
33
|
+
.extend({
|
|
34
|
+
// backwards compatibility for old viz configs without customMetrics
|
|
35
|
+
customMetrics: customMetricsSchema.default(null),
|
|
36
|
+
tableCalculations: tableCalcsSchema.default(null),
|
|
37
|
+
followUpTools: z.array(z.union([
|
|
38
|
+
z.literal(AiResultType.VERTICAL_BAR_RESULT),
|
|
39
|
+
z.literal(AiResultType.TIME_SERIES_RESULT),
|
|
40
|
+
z.literal(LegacyFollowUpTools.GENERATE_BAR_VIZ),
|
|
41
|
+
z.literal(LegacyFollowUpTools.GENERATE_TIME_SERIES_VIZ),
|
|
42
|
+
])),
|
|
43
|
+
filters: filtersSchemaTransformed,
|
|
44
|
+
})
|
|
45
|
+
.transform((data) => ({
|
|
46
|
+
...data,
|
|
47
|
+
followUpTools: legacyFollowUpToolsTransform(data.followUpTools),
|
|
48
|
+
}));
|
|
49
|
+
export const toolTableVizOutputSchema = z.object({
|
|
50
|
+
result: z.string(),
|
|
51
|
+
metadata: baseOutputMetadataSchema,
|
|
52
|
+
});
|
|
53
|
+
//# sourceMappingURL=toolTableVizArgs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolTableVizArgs.js","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/schemas/tools/toolTableVizArgs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACH,mBAAmB,EACnB,4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IAAI,CAAC;IAChD,iBAAiB,EAAE,gBAAgB,CAAC,OAAO,CAAC,IAAI,CAAC;IACjD,aAAa,EAAE,CAAC,CAAC,KAAK,CAClB,CAAC,CAAC,KAAK,CAAC;QACJ,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,mBAAmB,CAAC;QAC3C,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,kBAAkB,CAAC;QAC1C,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,gBAAgB,CAAC;QAC/C,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,wBAAwB,CAAC;KAC1D,CAAC,CACL;IACD,OAAO,EAAE,wBAAwB;CACpC,CAAC;KACD,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAClB,GAAG,IAAI;IACP,aAAa,EAAE,4BAA4B,CAAC,IAAI,CAAC,aAAa,CAAC;CAClE,CAAC,CAAC,CAAC;AAMR,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,QAAQ,EAAE,wBAAwB;CACrC,CAAC,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { LegacyFollowUpTools, legacyFollowUpToolsTransform, } from '../../followUpTools';
|
|
3
|
+
import { AiResultType } from '../../types';
|
|
4
|
+
import { customMetricsSchema } from '../customMetrics';
|
|
5
|
+
import { filtersSchemaTransformed, filtersSchemaV2 } from '../filters';
|
|
6
|
+
import { baseOutputMetadataSchema } from '../outputMetadata';
|
|
7
|
+
import { tableCalcsSchema } from '../tableCalcs/tableCalcs';
|
|
8
|
+
import { createToolSchema } from '../toolSchemaBuilder';
|
|
9
|
+
import visualizationMetadataSchema from '../visualizationMetadata';
|
|
10
|
+
import { timeSeriesMetricVizConfigSchema } from '../visualizations/timeSeriesViz';
|
|
11
|
+
export const TOOL_TIME_SERIES_VIZ_DESCRIPTION = `Use this tool to generate a Time Series Chart.`;
|
|
12
|
+
export const toolTimeSeriesArgsSchema = createToolSchema({
|
|
13
|
+
type: AiResultType.TIME_SERIES_RESULT,
|
|
14
|
+
description: TOOL_TIME_SERIES_VIZ_DESCRIPTION,
|
|
15
|
+
})
|
|
16
|
+
.extend({
|
|
17
|
+
...visualizationMetadataSchema.shape,
|
|
18
|
+
customMetrics: customMetricsSchema,
|
|
19
|
+
tableCalculations: tableCalcsSchema,
|
|
20
|
+
vizConfig: timeSeriesMetricVizConfigSchema,
|
|
21
|
+
filters: filtersSchemaV2
|
|
22
|
+
.nullable()
|
|
23
|
+
.describe('Filters to apply to the query. Filtered fields must exist in the selected explore or should be referenced from the custom metrics.'),
|
|
24
|
+
followUpTools: z
|
|
25
|
+
.array(z.union([
|
|
26
|
+
z.literal(AiResultType.TABLE_RESULT),
|
|
27
|
+
z.literal(AiResultType.VERTICAL_BAR_RESULT),
|
|
28
|
+
]))
|
|
29
|
+
.describe(`The actions the User can ask for after the AI has generated the chart`),
|
|
30
|
+
})
|
|
31
|
+
.build();
|
|
32
|
+
export const toolTimeSeriesArgsSchemaTransformed = toolTimeSeriesArgsSchema
|
|
33
|
+
.extend({
|
|
34
|
+
// backwards compatibility for old viz configs
|
|
35
|
+
vizConfig: timeSeriesMetricVizConfigSchema.extend({
|
|
36
|
+
xAxisLabel: z.string().default(''),
|
|
37
|
+
yAxisLabel: z.string().default(''),
|
|
38
|
+
}),
|
|
39
|
+
// backwards compatibility for old viz configs without customMetrics
|
|
40
|
+
customMetrics: customMetricsSchema.default(null),
|
|
41
|
+
tableCalculations: tableCalcsSchema.default(null),
|
|
42
|
+
followUpTools: z.array(z.union([
|
|
43
|
+
z.literal(AiResultType.TABLE_RESULT),
|
|
44
|
+
z.literal(AiResultType.VERTICAL_BAR_RESULT),
|
|
45
|
+
z.literal(LegacyFollowUpTools.GENERATE_TABLE),
|
|
46
|
+
z.literal(LegacyFollowUpTools.GENERATE_BAR_VIZ),
|
|
47
|
+
])),
|
|
48
|
+
filters: filtersSchemaTransformed,
|
|
49
|
+
})
|
|
50
|
+
.transform((data) => ({
|
|
51
|
+
...data,
|
|
52
|
+
followUpTools: legacyFollowUpToolsTransform(data.followUpTools),
|
|
53
|
+
}));
|
|
54
|
+
export const toolTimeSeriesOutputSchema = z.object({
|
|
55
|
+
result: z.string(),
|
|
56
|
+
metadata: baseOutputMetadataSchema,
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=toolTimeSeriesArgs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolTimeSeriesArgs.js","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/schemas/tools/toolTimeSeriesArgs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACH,mBAAmB,EACnB,4BAA4B,GAC/B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,2BAA2B,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,+BAA+B,EAAE,MAAM,iCAAiC,CAAC;AAElF,MAAM,CAAC,MAAM,gCAAgC,GAAG,gDAAgD,CAAC;AAEjG,MAAM,CAAC,MAAM,wBAAwB,GAAG,gBAAgB,CAAC;IACrD,IAAI,EAAE,YAAY,CAAC,kBAAkB;IACrC,WAAW,EAAE,gCAAgC;CAChD,CAAC;KACG,MAAM,CAAC;IACJ,GAAG,2BAA2B,CAAC,KA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IAClB,GAAG,IAAI;IACP,aAAa,EAAE,4BAA4B,CAAC,IAAI,CAAC,aAAa,CAAC;CAClE,CAAC,CAAC,CAAC;AAMR,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,QAAQ,EAAE,wBAAwB;CACrC,CAAC,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { LegacyFollowUpTools, legacyFollowUpToolsTransform, } from '../../followUpTools';
|
|
3
|
+
import { AiResultType } from '../../types';
|
|
4
|
+
import { customMetricsSchema } from '../customMetrics';
|
|
5
|
+
import { filtersSchemaTransformed, filtersSchemaV2 } from '../filters';
|
|
6
|
+
import { baseOutputMetadataSchema } from '../outputMetadata';
|
|
7
|
+
import { tableCalcsSchema } from '../tableCalcs/tableCalcs';
|
|
8
|
+
import { createToolSchema } from '../toolSchemaBuilder';
|
|
9
|
+
import visualizationMetadataSchema from '../visualizationMetadata';
|
|
10
|
+
import { verticalBarMetricVizConfigSchema } from '../visualizations';
|
|
11
|
+
export const TOOL_VERTICAL_BAR_VIZ_DESCRIPTION = `Use this tool to generate a Bar Chart Visualization.`;
|
|
12
|
+
export const toolVerticalBarArgsSchema = createToolSchema({
|
|
13
|
+
type: AiResultType.VERTICAL_BAR_RESULT,
|
|
14
|
+
description: TOOL_VERTICAL_BAR_VIZ_DESCRIPTION,
|
|
15
|
+
})
|
|
16
|
+
.extend({
|
|
17
|
+
...visualizationMetadataSchema.shape,
|
|
18
|
+
customMetrics: customMetricsSchema,
|
|
19
|
+
tableCalculations: tableCalcsSchema,
|
|
20
|
+
vizConfig: verticalBarMetricVizConfigSchema,
|
|
21
|
+
filters: filtersSchemaV2
|
|
22
|
+
.nullable()
|
|
23
|
+
.describe('Filters to apply to the query. Filtered fields must exist in the selected explore or should be referenced from the custom metrics.'),
|
|
24
|
+
followUpTools: z
|
|
25
|
+
.array(z.union([
|
|
26
|
+
z.literal(AiResultType.TABLE_RESULT),
|
|
27
|
+
z.literal(AiResultType.TIME_SERIES_RESULT),
|
|
28
|
+
]))
|
|
29
|
+
.describe(`The actions the User can ask for after the AI has generated the chart`),
|
|
30
|
+
})
|
|
31
|
+
.build();
|
|
32
|
+
export const toolVerticalBarArgsSchemaTransformed = toolVerticalBarArgsSchema
|
|
33
|
+
.extend({
|
|
34
|
+
// backwards compatibility for old viz configs without customMetrics
|
|
35
|
+
customMetrics: customMetricsSchema.default(null),
|
|
36
|
+
tableCalculations: tableCalcsSchema.default(null),
|
|
37
|
+
followUpTools: z.array(z.union([
|
|
38
|
+
z.literal(AiResultType.TABLE_RESULT),
|
|
39
|
+
z.literal(AiResultType.TIME_SERIES_RESULT),
|
|
40
|
+
z.literal(LegacyFollowUpTools.GENERATE_TABLE),
|
|
41
|
+
z.literal(LegacyFollowUpTools.GENERATE_TIME_SERIES_VIZ),
|
|
42
|
+
])),
|
|
43
|
+
filters: filtersSchemaTransformed,
|
|
44
|
+
})
|
|
45
|
+
.transform((data) => ({
|
|
46
|
+
...data,
|
|
47
|
+
followUpTools: legacyFollowUpToolsTransform(data.followUpTools),
|
|
48
|
+
}));
|
|
49
|
+
export const toolVerticalBarOutputSchema = z.object({
|
|
50
|
+
result: z.string(),
|
|
51
|
+
metadata: baseOutputMetadataSchema,
|
|
52
|
+
});
|
|
53
|
+
//# sourceMappingURL=toolVerticalBarArgs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolVerticalBarArgs.js","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/schemas/tools/toolVerticalBarArgs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACH,mBAAmB,EACnB,4BAA4B,GAC/B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EA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K,CAClB,CAAC,CAAC,KAAK,CAAC;QACJ,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,YAAY,CAAC;QACpC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,kBAAkB,CAAC;QAC1C,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,cAAc,CAAC;QAC7C,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,wBAAwB,CAAC;KAC1D,CAAC,CACL;IACD,OAAO,EAAE,wBAAwB;CACpC,CAAC;KACD,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAClB,GAAG,IAAI;IACP,aAAa,EAAE,4BAA4B,CAAC,IAAI,CAAC,aAAa,CAAC;CAClE,CAAC,CAAC,CAAC;AAMR,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,QAAQ,EAAE,wBAAwB;CACrC,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const visualizationMetadataSchema = z.object({
|
|
3
|
+
title: z.string().describe('A descriptive title for the chart'),
|
|
4
|
+
description: z
|
|
5
|
+
.string()
|
|
6
|
+
.describe('A descriptive summary or explanation for the chart.'),
|
|
7
|
+
});
|
|
8
|
+
export default visualizationMetadataSchema;
|
|
9
|
+
//# sourceMappingURL=visualizationMetadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visualizationMetadata.js","sourceRoot":"","sources":["../../../../../src/ee/AiAgent/schemas/visualizationMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;IAC/D,WAAW,EAAE,CAAC;SACT,MAAM,EAAE;SACR,QAAQ,CAAC,qDAAqD,CAAC;CACvE,CAAC,CAAC;AAEH,eAAe,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export * from './tableViz';
|
|
3
|
+
export * from './timeSeriesViz';
|
|
4
|
+
export * from './verticalBarViz';
|
|
5
|
+
const VisualizationTools = [
|
|
6
|
+
'generateBarVizConfig',
|
|
7
|
+
'generateTableVizConfig',
|
|
8
|
+
'generateTimeSeriesVizConfig',
|
|
9
|
+
];
|
|
10
|
+
// define tool names
|
|
11
|
+
export const ToolNameSchema = z.enum([
|
|
12
|
+
...VisualizationTools,
|
|
13
|
+
'generateDashboard',
|
|
14
|
+
'generateDashboardV2',
|
|
15
|
+
'findContent',
|
|
16
|
+
'findExplores',
|
|
17
|
+
'findFields',
|
|
18
|
+
'searchFieldValues',
|
|
19
|
+
'findDashboards',
|
|
20
|
+
'findCharts',
|
|
21
|
+
'improveContext',
|
|
22
|
+
'proposeChange',
|
|
23
|
+
'runQuery',
|
|
24
|
+
]);
|
|
25
|
+
export const isToolName = (toolName) => ToolNameSchema.safeParse(toolName).success;
|
|
26
|
+
// display messages schema
|
|
27
|
+
export const ToolDisplayMessagesSchema = z.record(ToolNameSchema, z.string());
|
|
28
|
+
export const TOOL_DISPLAY_MESSAGES = ToolDisplayMessagesSchema.parse({
|
|
29
|
+
findExplores: 'Finding relevant explores',
|
|
30
|
+
findDashboards: 'Finding relevant dashboards',
|
|
31
|
+
findFields: 'Finding relevant fields',
|
|
32
|
+
searchFieldValues: 'Searching field values',
|
|
33
|
+
generateBarVizConfig: 'Generating a bar chart',
|
|
34
|
+
generateTableVizConfig: 'Generating a table',
|
|
35
|
+
generateTimeSeriesVizConfig: 'Generating a line chart',
|
|
36
|
+
generateDashboard: 'Generating a dashboard',
|
|
37
|
+
generateDashboardV2: 'Generating a dashboard',
|
|
38
|
+
findCharts: 'Finding relevant charts',
|
|
39
|
+
improveContext: 'Improving context',
|
|
40
|
+
runQuery: 'Running query',
|
|
41
|
+
});
|
|
42
|
+
// after-tool-call messages
|
|
43
|
+
export const TOOL_DISPLAY_MESSAGES_AFTER_TOOL_CALL = ToolDisplayMessagesSchema.parse({
|
|
44
|
+
findExplores: 'Found relevant explores',
|
|
45
|
+
findDashboards: 'Found relevant dashboards',
|
|
46
|
+
findFields: 'Found relevant fields',
|
|
47
|
+
searchFieldValues: 'Found field values',
|
|
48
|
+
generateBarVizConfig: 'Generated a bar chart',
|
|
49
|
+
generateTableVizConfig: 'Generated a table',
|
|
50
|
+
generateTimeSeriesVizConfig: 'Generated a line chart',
|
|
51
|
+
generateDashboard: 'Generated a dashboard',
|
|
52
|
+
generateDashboardV2: 'Generated a dashboard',
|
|
53
|
+
findCharts: 'Found relevant charts',
|
|
54
|
+
improveContext: 'Improved context',
|
|
55
|
+
runQuery: 'Ran query',
|
|
56
|
+
});
|
|
57
|
+
export const AVAILABLE_VISUALIZATION_TYPES = VisualizationTools;
|
|
58
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/schemas/visualizations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AAEjC,MAAM,kBAAkB,GAAG;IACvB,sBAAsB;IACtB,wBAAwB;IACxB,6BAA6B;CACvB,CAAC;AAEX,oBAAoB;AACpB,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC;IACjC,GAAG,kBAAkB;IACrB,mBAAmB;IACnB,qBAAqB;IACrB,aAAa;IACb,cAAc;IACd,YAAY;IACZ,mBAAmB;IACnB,gBAAgB;IAChB,YAAY;IACZ,gBAAgB;IAChB,eAAe;IACf,UAAU;CACb,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|
|
2
|
+
import { getValidAiQueryLimit } from '../../validators';
|
|
3
|
+
import { getFieldIdSchema } from '../fieldId';
|
|
4
|
+
import sortFieldSchema from '../sortField';
|
|
5
|
+
export const tableVizConfigSchema = z
|
|
6
|
+
.object({
|
|
7
|
+
exploreName: z
|
|
8
|
+
.string()
|
|
9
|
+
.describe('The name of the explore containing the metrics and dimensions used for table query'),
|
|
10
|
+
metrics: z
|
|
11
|
+
.array(getFieldIdSchema({ additionalDescription: null }))
|
|
12
|
+
.describe('The field ids of the metrics to be calculated for the table. They will be grouped by the dimensions.'),
|
|
13
|
+
dimensions: z
|
|
14
|
+
.array(getFieldIdSchema({ additionalDescription: null }))
|
|
15
|
+
.describe('The field id for the dimensions to group the metrics by'),
|
|
16
|
+
sorts: z
|
|
17
|
+
.array(sortFieldSchema)
|
|
18
|
+
.describe('Sort configuration for the query, it can use a combination of metrics and dimensions.'),
|
|
19
|
+
limit: z
|
|
20
|
+
.number()
|
|
21
|
+
.nullable()
|
|
22
|
+
.describe('The maximum number of rows in the table.'),
|
|
23
|
+
})
|
|
24
|
+
.describe('Configuration file for generating a table from a query with metrics and dimensions');
|
|
25
|
+
export const metricQueryTableViz = ({ vizConfig, filters, maxLimit, customMetrics, tableCalculations, }) => ({
|
|
26
|
+
exploreName: vizConfig.exploreName,
|
|
27
|
+
metrics: vizConfig.metrics,
|
|
28
|
+
dimensions: vizConfig.dimensions || [],
|
|
29
|
+
sorts: vizConfig.sorts.map((sort) => ({
|
|
30
|
+
...sort,
|
|
31
|
+
nullsFirst: sort.nullsFirst ?? undefined,
|
|
32
|
+
})),
|
|
33
|
+
limit: getValidAiQueryLimit(vizConfig.limit, maxLimit),
|
|
34
|
+
filters,
|
|
35
|
+
additionalMetrics: customMetrics ?? [],
|
|
36
|
+
tableCalculations,
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=tableViz.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tableViz.js","sourceRoot":"","s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AAG,IAAI;QACP,UAAU,EAAE,IAAI,CAAC,UAAU,IAAI,SAAS;KAC3C,CAAC,CAAC;IACH,KAAK,EAAE,oBAAoB,CAAC,SAAS,CAAC,KAAK,EAAE,QAAQ,CAAC;IACtD,OAAO;IACP,iBAAiB,EAAE,aAAa,IAAI,EAAE;IACtC,iBAAiB;CACpB,CAAC,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AI_DEFAULT_MAX_QUERY_LIMIT } from '../../constants';
|
|
3
|
+
import { getValidAiQueryLimit } from '../../validators';
|
|
4
|
+
import { getFieldIdSchema } from '../fieldId';
|
|
5
|
+
import sortFieldSchema from '../sortField';
|
|
6
|
+
export const timeSeriesMetricVizConfigSchema = z.object({
|
|
7
|
+
exploreName: z
|
|
8
|
+
.string()
|
|
9
|
+
.describe('The name of the explore containing the metrics and dimensions used for the chart.'),
|
|
10
|
+
xDimension: getFieldIdSchema({
|
|
11
|
+
additionalDescription: 'The field id of the time dimension to be displayed on the x-axis.',
|
|
12
|
+
}),
|
|
13
|
+
yMetrics: z
|
|
14
|
+
.array(getFieldIdSchema({ additionalDescription: null }))
|
|
15
|
+
.min(1)
|
|
16
|
+
.describe('At least one metric is required. The field ids of the metrics to be displayed on the y-axis. If there are multiple metrics there will be one line per metric'),
|
|
17
|
+
sorts: z
|
|
18
|
+
.array(sortFieldSchema)
|
|
19
|
+
.describe('Sort configuration for the query, it can use a combination of metrics and dimensions.'),
|
|
20
|
+
breakdownByDimension: getFieldIdSchema({
|
|
21
|
+
additionalDescription: 'The field id of the dimension used to split the metrics into series for each dimension value. For example if you wanted to split a metric into multiple series based on City you would use the City dimension field id here. If this is not provided then the metric will be displayed as a single series.',
|
|
22
|
+
}).nullable(),
|
|
23
|
+
lineType: z
|
|
24
|
+
.union([z.literal('line'), z.literal('area')])
|
|
25
|
+
.describe('default line. The type of line to display. If area then the area under the line will be filled in.'),
|
|
26
|
+
limit: z
|
|
27
|
+
.number()
|
|
28
|
+
.max(AI_DEFAULT_MAX_QUERY_LIMIT)
|
|
29
|
+
.nullable()
|
|
30
|
+
.describe(`The total number of data points allowed on the chart.`),
|
|
31
|
+
xAxisLabel: z
|
|
32
|
+
.string()
|
|
33
|
+
.nullable()
|
|
34
|
+
.describe('A helpful label to explain the x-axis'),
|
|
35
|
+
yAxisLabel: z
|
|
36
|
+
.string()
|
|
37
|
+
.nullable()
|
|
38
|
+
.describe('A helpful label to explain the y-axis'),
|
|
39
|
+
});
|
|
40
|
+
export const metricQueryTimeSeriesViz = ({ vizConfig, filters, maxLimit, customMetrics, tableCalculations, }) => {
|
|
41
|
+
const metrics = vizConfig.yMetrics;
|
|
42
|
+
const dimensions = [
|
|
43
|
+
vizConfig.xDimension,
|
|
44
|
+
...(vizConfig.breakdownByDimension
|
|
45
|
+
? [vizConfig.breakdownByDimension]
|
|
46
|
+
: []),
|
|
47
|
+
];
|
|
48
|
+
const { limit, sorts } = vizConfig;
|
|
49
|
+
return {
|
|
50
|
+
metrics,
|
|
51
|
+
dimensions,
|
|
52
|
+
limit: getValidAiQueryLimit(limit, maxLimit),
|
|
53
|
+
sorts: sorts.map((sort) => ({
|
|
54
|
+
...sort,
|
|
55
|
+
nullsFirst: sort.nullsFirst ?? undefined,
|
|
56
|
+
})),
|
|
57
|
+
exploreName: vizConfig.exploreName,
|
|
58
|
+
filters,
|
|
59
|
+
additionalMetrics: customMetrics ?? [],
|
|
60
|
+
tableCalculations,
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=timeSeriesViz.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeSeriesViz.js","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/schemas/visualizations/timeSeriesViz.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAE7D,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AAS,EACT,OAAO,EACP,QAAQ,EACR,aAAa,EACb,iBAAiB,GAOpB,EAA4B,EAAE;IAC3B,MAAM,OAAO,GAAG,SAAS,CAAC,QAAQ,CAAC;IACnC,MAAM,UAAU,GAAG;QACf,SAAS,CAAC,UAAU;QACpB,GAAG,CAAC,SAAS,CAAC,oBAAoB;YAC9B,CAAC,CAAC,CAAC,SAAS,CAAC,oBAAoB,CAAC;YAClC,CAAC,CAAC,EAAE,CAAC;KACZ,CAAC;IACF,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,SAAS,CAAC;IAEnC,OAAO;QACH,OAAO;QACP,UAAU;QACV,KAAK,EAAE,oBAAoB,CAAC,KAAK,EAAE,QAAQ,CAAC;QAC5C,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YACxB,GAAG,IAAI;YACP,UAAU,EAAE,IAAI,CAAC,UAAU,IAAI,SAAS;SAC3C,CAAC,CAAC;QACH,WAAW,EAAE,SAAS,CAAC,WAAW;QAClC,OAAO;QACP,iBAAiB,EAAE,aAAa,IAAI,EAAE;QACtC,iBAAiB;KACpB,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AI_DEFAULT_MAX_QUERY_LIMIT } from '../../constants';
|
|
3
|
+
import { getValidAiQueryLimit } from '../../validators';
|
|
4
|
+
import { getFieldIdSchema } from '../fieldId';
|
|
5
|
+
import sortFieldSchema from '../sortField';
|
|
6
|
+
export const verticalBarMetricVizConfigSchema = z.object({
|
|
7
|
+
exploreName: z
|
|
8
|
+
.string()
|
|
9
|
+
.describe('The name of the explore containing the metrics and dimensions used for the chart.'),
|
|
10
|
+
xDimension: getFieldIdSchema({
|
|
11
|
+
additionalDescription: 'The field id of the dimension to be displayed on the x-axis.',
|
|
12
|
+
}),
|
|
13
|
+
yMetrics: z
|
|
14
|
+
.array(getFieldIdSchema({ additionalDescription: null }))
|
|
15
|
+
.min(1)
|
|
16
|
+
.describe('The field ids of the metrics to be displayed on the y-axis. The height of the bars'),
|
|
17
|
+
sorts: z
|
|
18
|
+
.array(sortFieldSchema)
|
|
19
|
+
.describe('Sort configuration for the query, it can use a combination of metrics and dimensions.'),
|
|
20
|
+
limit: z
|
|
21
|
+
.number()
|
|
22
|
+
.max(AI_DEFAULT_MAX_QUERY_LIMIT)
|
|
23
|
+
.nullable()
|
|
24
|
+
.describe(`The total number of data points / bars allowed on the chart.`),
|
|
25
|
+
breakdownByDimension: getFieldIdSchema({
|
|
26
|
+
additionalDescription: 'The field id of the dimension used to split the metrics into groups along the x-axis. If stacking is false then this will create multiple bars around each x value, if stacking is true then this will create multiple bars for each metric stacked on top of each other',
|
|
27
|
+
}).nullable(),
|
|
28
|
+
stackBars: z
|
|
29
|
+
.boolean()
|
|
30
|
+
.nullable()
|
|
31
|
+
.describe('If using breakdownByDimension then this will stack the bars on top of each other instead of side by side.'),
|
|
32
|
+
xAxisType: z
|
|
33
|
+
.union([z.literal('category'), z.literal('time')])
|
|
34
|
+
.describe('The x-axis type can be categorical for string value or time if the dimension is a date or timestamp.'),
|
|
35
|
+
xAxisLabel: z
|
|
36
|
+
.string()
|
|
37
|
+
.nullable()
|
|
38
|
+
.describe('A helpful label to explain the x-axis'),
|
|
39
|
+
yAxisLabel: z
|
|
40
|
+
.string()
|
|
41
|
+
.nullable()
|
|
42
|
+
.describe('A helpful label to explain the y-axis'),
|
|
43
|
+
});
|
|
44
|
+
export const metricQueryVerticalBarViz = ({ vizConfig, filters, maxLimit, customMetrics, tableCalculations, }) => {
|
|
45
|
+
const metrics = vizConfig.yMetrics;
|
|
46
|
+
const dimensions = [
|
|
47
|
+
vizConfig.xDimension,
|
|
48
|
+
...(vizConfig.breakdownByDimension
|
|
49
|
+
? [vizConfig.breakdownByDimension]
|
|
50
|
+
: []),
|
|
51
|
+
];
|
|
52
|
+
const { limit, sorts } = vizConfig;
|
|
53
|
+
return {
|
|
54
|
+
metrics,
|
|
55
|
+
dimensions,
|
|
56
|
+
limit: getValidAiQueryLimit(limit, maxLimit),
|
|
57
|
+
sorts: sorts.map((sort) => ({
|
|
58
|
+
...sort,
|
|
59
|
+
nullsFirst: sort.nullsFirst ?? undefined,
|
|
60
|
+
})),
|
|
61
|
+
exploreName: vizConfig.exploreName,
|
|
62
|
+
filters,
|
|
63
|
+
additionalMetrics: customMetrics ?? [],
|
|
64
|
+
// TODO: add tableCalculations
|
|
65
|
+
tableCalculations,
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=verticalBarViz.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verticalBarViz.js","sourceRoot":"","sources":["../../../../../../src/ee/AiAgent/schemas/visualizations/verticalBarViz.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAE7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,eAAe,MAAM,cAAc,CAAC;AAG3C,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,MAAM,CAAC;IACrD,WAAW,EAAE,CAAC;SACT,MAAM,EAAE;SACR,QAAQ,CACL,mFAAmF,CACtF;IACL,UAAU,EAAE,gBAAgB,CAAC;QACzB,qBAAqB,EACjB,8DAA8D;KACrE,CAAC;IACF,QAAQ,EAAE,CAAC;SACN,KAAK,CAAC,gBAAgB,CAAC,EAAE,qBAAqB,EAAE,IAAI,EAAE,CAAC,CAAC;SACxD,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACL,oFAAoF,CACvF;IACL,KAAK,EAAE,CAAC;SACH,KAAK,CAAC,eAAe,CAAC;SACtB,QAAQ,CACL,uFAAuF,CAC1F;IACL,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AE,EAAE,CAAC,CAAC;YACxB,GAAG,IAAI;YACP,UAAU,EAAE,IAAI,CAAC,UAAU,IAAI,SAAS;SAC3C,CAAC,CAAC;QACH,WAAW,EAAE,SAAS,CAAC,WAAW;QAClC,OAAO;QACP,iBAAiB,EAAE,aAAa,IAAI,EAAE;QACtC,8BAA8B;QAC9B,iBAAiB;KACpB,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export var AiResultType;
|
|
2
|
+
(function (AiResultType) {
|
|
3
|
+
AiResultType["TIME_SERIES_RESULT"] = "time_series_chart";
|
|
4
|
+
AiResultType["VERTICAL_BAR_RESULT"] = "vertical_bar_chart";
|
|
5
|
+
AiResultType["TABLE_RESULT"] = "table";
|
|
6
|
+
AiResultType["QUERY_RESULT"] = "query_result";
|
|
7
|
+
AiResultType["DASHBOARD_RESULT"] = "dashboard";
|
|
8
|
+
AiResultType["DASHBOARD_V2_RESULT"] = "dashboard_v2";
|
|
9
|
+
AiResultType["IMPROVE_CONTEXT"] = "improve_context";
|
|
10
|
+
AiResultType["PROPOSE_CHANGE"] = "propose_change";
|
|
11
|
+
})(AiResultType || (AiResultType = {}));
|
|
12
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/ee/AiAgent/types.ts"],"names":[],"mappings":"AASA,MAAM,CAAN,IAAY,YASX;AATD,WAAY,YAAY;IACpB,wDAAwC,CAAA;IACxC,0DAA0C,CAAA;IAC1C,sCAAsB,CAAA;IACtB,6CAA6B,CAAA;IAC7B,8CAA8B,CAAA;IAC9B,oDAAoC,CAAA;IACpC,mDAAmC,CAAA;IACnC,iDAAiC,CAAA;AACrC,CAAC,EATW,YAAY,KAAZ,YAAY,QASvB"}
|
|
@@ -329,14 +329,6 @@ export declare const parseVizConfig: (vizConfigUnknown: object | null, maxLimit?
|
|
|
329
329
|
})[] | null;
|
|
330
330
|
type: AiResultType.QUERY_RESULT;
|
|
331
331
|
description: string;
|
|
332
|
-
customMetrics: {
|
|
333
|
-
name: string;
|
|
334
|
-
label: string;
|
|
335
|
-
table: string;
|
|
336
|
-
type: import("../..").MetricType.PERCENTILE | import("../..").MetricType.AVERAGE | import("../..").MetricType.COUNT | import("../..").MetricType.COUNT_DISTINCT | import("../..").MetricType.SUM | import("../..").MetricType.MIN | import("../..").MetricType.MAX | import("../..").MetricType.MEDIAN;
|
|
337
|
-
description: string;
|
|
338
|
-
baseDimensionName: string;
|
|
339
|
-
}[] | null;
|
|
340
332
|
chartConfig: {
|
|
341
333
|
groupBy: string[] | null;
|
|
342
334
|
stackBars: boolean | null;
|
|
@@ -351,6 +343,14 @@ export declare const parseVizConfig: (vizConfigUnknown: object | null, maxLimit?
|
|
|
351
343
|
secondaryYAxisMetric: string | null;
|
|
352
344
|
secondaryYAxisLabel: string | null;
|
|
353
345
|
} | null;
|
|
346
|
+
customMetrics: {
|
|
347
|
+
name: string;
|
|
348
|
+
label: string;
|
|
349
|
+
table: string;
|
|
350
|
+
type: import("../..").MetricType.PERCENTILE | import("../..").MetricType.AVERAGE | import("../..").MetricType.COUNT | import("../..").MetricType.COUNT_DISTINCT | import("../..").MetricType.SUM | import("../..").MetricType.MIN | import("../..").MetricType.MAX | import("../..").MetricType.MEDIAN;
|
|
351
|
+
description: string;
|
|
352
|
+
baseDimensionName: string;
|
|
353
|
+
}[] | null;
|
|
354
354
|
title: string;
|
|
355
355
|
queryConfig: {
|
|
356
356
|
dimensions: string[];
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { AI_DEFAULT_MAX_QUERY_LIMIT } from './constants';
|
|
2
|
+
import { convertAiTableCalcsSchemaToTableCalcs, metricQueryTableViz, metricQueryTimeSeriesViz, metricQueryVerticalBarViz, toolRunQueryArgsSchemaTransformed, toolTableVizArgsSchemaTransformed, toolTimeSeriesArgsSchemaTransformed, toolVerticalBarArgsSchemaTransformed, } from './schemas';
|
|
3
|
+
import { AiResultType } from './types';
|
|
4
|
+
import { getValidAiQueryLimit } from './validators';
|
|
5
|
+
export const parseVizConfig = (vizConfigUnknown, maxLimit) => {
|
|
6
|
+
if (!vizConfigUnknown) {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
const toolVerticalBarArgsParsed = toolVerticalBarArgsSchemaTransformed.safeParse(vizConfigUnknown);
|
|
10
|
+
if (toolVerticalBarArgsParsed.success) {
|
|
11
|
+
const vizTool = toolVerticalBarArgsParsed.data;
|
|
12
|
+
const metricQuery = metricQueryVerticalBarViz({
|
|
13
|
+
vizConfig: vizTool.vizConfig,
|
|
14
|
+
filters: vizTool.filters,
|
|
15
|
+
maxLimit: maxLimit ?? AI_DEFAULT_MAX_QUERY_LIMIT,
|
|
16
|
+
customMetrics: vizTool.customMetrics ?? null,
|
|
17
|
+
tableCalculations: convertAiTableCalcsSchemaToTableCalcs(vizTool.tableCalculations),
|
|
18
|
+
});
|
|
19
|
+
return {
|
|
20
|
+
type: AiResultType.VERTICAL_BAR_RESULT,
|
|
21
|
+
vizTool,
|
|
22
|
+
metricQuery,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const toolTimeSeriesArgsParsed = toolTimeSeriesArgsSchemaTransformed.safeParse(vizConfigUnknown);
|
|
26
|
+
if (toolTimeSeriesArgsParsed.success) {
|
|
27
|
+
const vizTool = toolTimeSeriesArgsParsed.data;
|
|
28
|
+
const metricQuery = metricQueryTimeSeriesViz({
|
|
29
|
+
vizConfig: vizTool.vizConfig,
|
|
30
|
+
filters: vizTool.filters,
|
|
31
|
+
maxLimit: maxLimit ?? AI_DEFAULT_MAX_QUERY_LIMIT,
|
|
32
|
+
customMetrics: vizTool.customMetrics ?? null,
|
|
33
|
+
tableCalculations: convertAiTableCalcsSchemaToTableCalcs(vizTool.tableCalculations),
|
|
34
|
+
});
|
|
35
|
+
return {
|
|
36
|
+
type: AiResultType.TIME_SERIES_RESULT,
|
|
37
|
+
vizTool,
|
|
38
|
+
metricQuery,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const toolTableVizArgsParsed = toolTableVizArgsSchemaTransformed.safeParse(vizConfigUnknown);
|
|
42
|
+
if (toolTableVizArgsParsed.success) {
|
|
43
|
+
const vizTool = toolTableVizArgsParsed.data;
|
|
44
|
+
const metricQuery = metricQueryTableViz({
|
|
45
|
+
vizConfig: vizTool.vizConfig,
|
|
46
|
+
filters: vizTool.filters,
|
|
47
|
+
maxLimit: maxLimit ?? AI_DEFAULT_MAX_QUERY_LIMIT,
|
|
48
|
+
customMetrics: vizTool.customMetrics ?? null,
|
|
49
|
+
tableCalculations: convertAiTableCalcsSchemaToTableCalcs(vizTool.tableCalculations),
|
|
50
|
+
});
|
|
51
|
+
return {
|
|
52
|
+
type: AiResultType.TABLE_RESULT,
|
|
53
|
+
vizTool,
|
|
54
|
+
metricQuery,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
// Parse runQuery tool
|
|
58
|
+
const toolRunQueryArgsParsed = toolRunQueryArgsSchemaTransformed.safeParse(vizConfigUnknown);
|
|
59
|
+
if (toolRunQueryArgsParsed.success) {
|
|
60
|
+
const vizTool = toolRunQueryArgsParsed.data;
|
|
61
|
+
const metricQuery = {
|
|
62
|
+
exploreName: vizTool.queryConfig.exploreName,
|
|
63
|
+
dimensions: vizTool.queryConfig.dimensions,
|
|
64
|
+
metrics: vizTool.queryConfig.metrics,
|
|
65
|
+
sorts: vizTool.queryConfig.sorts.map((sort) => ({
|
|
66
|
+
...sort,
|
|
67
|
+
nullsFirst: sort.nullsFirst ?? undefined,
|
|
68
|
+
})),
|
|
69
|
+
limit: getValidAiQueryLimit(vizTool.queryConfig.limit, maxLimit ?? AI_DEFAULT_MAX_QUERY_LIMIT),
|
|
70
|
+
filters: vizTool.filters,
|
|
71
|
+
additionalMetrics: vizTool.customMetrics ?? [],
|
|
72
|
+
tableCalculations: convertAiTableCalcsSchemaToTableCalcs(vizTool.tableCalculations),
|
|
73
|
+
};
|
|
74
|
+
return {
|
|
75
|
+
type: AiResultType.QUERY_RESULT,
|
|
76
|
+
vizTool,
|
|
77
|
+
metricQuery,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
return null;
|
|
81
|
+
};
|
|
82
|
+
//# sourceMappingURL=utils.js.map
|