@lightdash/common 0.2104.6 → 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,679 @@
|
|
|
1
|
+
import { SupportedDbtAdapter } from '../types/dbt';
|
|
2
|
+
import { CompileError } from '../types/errors';
|
|
3
|
+
import { DimensionType, FieldType, friendlyName } from '../types/field';
|
|
4
|
+
import { ExploreCompiler, parseAllReferences, } from './exploreCompiler';
|
|
5
|
+
import { compiledExploreWithHiddenJoin, compiledExploreWithJoinWithFieldsAndGroups, compiledExploreWithParameters, compiledJoinedExploreOverridingAliasAndLabel, compiledJoinedExploreOverridingJoinAlias, compiledJoinedExploreOverridingJoinLabel, compiledJoinedExploreWithJoinAliasAndSubsetOfFieldsThatDontIncludeSqlFields, compiledJoinedExploreWithSubsetOfFields, compiledJoinedExploreWithSubsetOfFieldsThatDontIncludeSqlFields, compiledJoinedExploreWithTwoJoinsToTheSameTable, compiledSimpleJoinedExplore, compiledSimpleJoinedExploreWithAlwaysTrue, customSqlDimensionWithNoReferences, customSqlDimensionWithReferences, expectedCompiledCustomSqlDimensionWithNoReferences, expectedCompiledCustomSqlDimensionWithReferences, exploreCircularDimensionReference, exploreCircularDimensionShortReference, exploreCircularMetricReference, exploreCircularMetricShortReference, exploreComplexReference, exploreComplexReferenceCompiled, exploreMissingBaseTable, exploreMissingJoinTable, exploreOneEmptyTable, exploreOneEmptyTableCompiled, exploreReferenceDimension, exploreReferenceDimensionCompiled, exploreReferenceInJoin, exploreReferenceInJoinCompiled, exploreTableSelfReference, exploreTableSelfReferenceCompiled, exploreTableSelfReferenceCompiledSqlWhere, exploreTableSelfReferenceSqlWhere, exploreWithHiddenJoin, exploreWithInvalidParameterReference, exploreWithJoinWithFieldsAndGroups, exploreWithMetricNumber, exploreWithMetricNumberCompiled, exploreWithParameters, exploreWithRequiredAttributes, exploreWithRequiredAttributesCompiled, joinedExploreOverridingAliasAndLabel, joinedExploreOverridingJoinAlias, joinedExploreOverridingJoinLabel, joinedExploreWithJoinAliasAndSubsetOfFieldsThatDontIncludeSqlFields, joinedExploreWithSubsetOfFields, joinedExploreWithSubsetOfFieldsThatDontIncludeSqlFields, joinedExploreWithTwoJoinsToTheSameTable, simpleJoinedExplore, simpleJoinedExploreWithAlwaysTrue, tablesWithMetricsWithFilters, warehouseClientMock, } from './exploreCompiler.mock';
|
|
6
|
+
const compiler = new ExploreCompiler(warehouseClientMock);
|
|
7
|
+
test('Should compile empty table', () => {
|
|
8
|
+
expect(compiler.compileExplore(exploreOneEmptyTable)).toStrictEqual(exploreOneEmptyTableCompiled);
|
|
9
|
+
});
|
|
10
|
+
test('Should throw error when missing base table', () => {
|
|
11
|
+
expect(() => compiler.compileExplore(exploreMissingBaseTable)).toThrowError(CompileError);
|
|
12
|
+
});
|
|
13
|
+
test('Should throw error when missing joined table', () => {
|
|
14
|
+
expect(() => compiler.compileExplore(exploreMissingJoinTable)).toThrowError(CompileError);
|
|
15
|
+
});
|
|
16
|
+
test('Should throw error when dimension/metric has circular reference', () => {
|
|
17
|
+
expect(() => compiler.compileExplore(exploreCircularDimensionReference)).toThrowError(CompileError);
|
|
18
|
+
expect(() => compiler.compileExplore(exploreCircularDimensionShortReference)).toThrowError(CompileError);
|
|
19
|
+
expect(() => compiler.compileExplore(exploreCircularMetricReference)).toThrowError(CompileError);
|
|
20
|
+
expect(() => compiler.compileExplore(exploreCircularMetricShortReference)).toThrowError(CompileError);
|
|
21
|
+
});
|
|
22
|
+
test('Should compile table with TABLE reference', () => {
|
|
23
|
+
expect(compiler.compileExplore(exploreTableSelfReference)).toStrictEqual(exploreTableSelfReferenceCompiled);
|
|
24
|
+
});
|
|
25
|
+
test('Should compile table with TABLE reference on sql where', () => {
|
|
26
|
+
expect(compiler.compileExplore(exploreTableSelfReferenceSqlWhere)).toStrictEqual(exploreTableSelfReferenceCompiledSqlWhere);
|
|
27
|
+
});
|
|
28
|
+
test('Should compile table with reference to another dimension', () => {
|
|
29
|
+
expect(compiler.compileExplore(exploreReferenceDimension)).toStrictEqual(exploreReferenceDimensionCompiled);
|
|
30
|
+
});
|
|
31
|
+
test('Should compile table with nested references in dimensions and metrics', () => {
|
|
32
|
+
expect(compiler.compileExplore(exploreComplexReference)).toStrictEqual(exploreComplexReferenceCompiled);
|
|
33
|
+
});
|
|
34
|
+
test('Should compile with a reference to a dimension in a joined table', () => {
|
|
35
|
+
expect(compiler.compileExplore(exploreReferenceInJoin)).toStrictEqual(exploreReferenceInJoinCompiled);
|
|
36
|
+
});
|
|
37
|
+
test('Should compile with a reference to a metric in a non-aggregate metric', () => {
|
|
38
|
+
expect(compiler.compileExplore(exploreWithMetricNumber)).toStrictEqual(exploreWithMetricNumberCompiled);
|
|
39
|
+
});
|
|
40
|
+
describe('Explores with a base table and joined table', () => {
|
|
41
|
+
test('should compile', () => {
|
|
42
|
+
expect(compiler.compileExplore(simpleJoinedExplore)).toStrictEqual(compiledSimpleJoinedExplore);
|
|
43
|
+
});
|
|
44
|
+
test('should compile explore with join with fields and a time interval dimension with groups', () => {
|
|
45
|
+
expect(compiler.compileExplore(exploreWithJoinWithFieldsAndGroups)).toStrictEqual(compiledExploreWithJoinWithFieldsAndGroups);
|
|
46
|
+
});
|
|
47
|
+
test('should compile with a reference to a dimension in a joined table', () => {
|
|
48
|
+
expect(compiler.compileExplore(exploreReferenceInJoin)).toStrictEqual(exploreReferenceInJoinCompiled);
|
|
49
|
+
});
|
|
50
|
+
test('should compile with custom label on join', () => {
|
|
51
|
+
expect(compiler.compileExplore(joinedExploreOverridingJoinLabel)).toStrictEqual(compiledJoinedExploreOverridingJoinLabel);
|
|
52
|
+
});
|
|
53
|
+
test('should compile with alias on join', () => {
|
|
54
|
+
expect(compiler.compileExplore(joinedExploreOverridingJoinAlias)).toStrictEqual(compiledJoinedExploreOverridingJoinAlias);
|
|
55
|
+
});
|
|
56
|
+
test('should compile with an alias and custom label on join', () => {
|
|
57
|
+
expect(compiler.compileExplore(joinedExploreOverridingAliasAndLabel)).toStrictEqual(compiledJoinedExploreOverridingAliasAndLabel);
|
|
58
|
+
});
|
|
59
|
+
test('should compile with a subset of fields selected on join', () => {
|
|
60
|
+
expect(compiler.compileExplore(joinedExploreWithSubsetOfFields)).toStrictEqual(compiledJoinedExploreWithSubsetOfFields);
|
|
61
|
+
});
|
|
62
|
+
test('should compile with 2 joins to the same table, one without alias and one with alias', () => {
|
|
63
|
+
expect(compiler.compileExplore(joinedExploreWithTwoJoinsToTheSameTable)).toStrictEqual(compiledJoinedExploreWithTwoJoinsToTheSameTable);
|
|
64
|
+
});
|
|
65
|
+
test('should compile with a subset of fields selected on join what dont include the fields in the join SQL', () => {
|
|
66
|
+
expect(compiler.compileExplore(joinedExploreWithSubsetOfFieldsThatDontIncludeSqlFields)).toStrictEqual(compiledJoinedExploreWithSubsetOfFieldsThatDontIncludeSqlFields);
|
|
67
|
+
});
|
|
68
|
+
test('should compile joins with a join alias and a subset of fields selected on join which dont include the fields in the join SQL', () => {
|
|
69
|
+
expect(compiler.compileExplore(joinedExploreWithJoinAliasAndSubsetOfFieldsThatDontIncludeSqlFields)).toStrictEqual(compiledJoinedExploreWithJoinAliasAndSubsetOfFieldsThatDontIncludeSqlFields);
|
|
70
|
+
});
|
|
71
|
+
test('should compile with a hidden join', () => {
|
|
72
|
+
expect(compiler.compileExplore(exploreWithHiddenJoin)).toStrictEqual(compiledExploreWithHiddenJoin);
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
describe('Default field labels render correctly for various input formats', () => {
|
|
76
|
+
test('should handle uppercase field names', () => {
|
|
77
|
+
expect(friendlyName('MYFIELDID')).toEqual('Myfieldid');
|
|
78
|
+
expect(friendlyName('MY_FIELD_ID')).toEqual('My field id');
|
|
79
|
+
});
|
|
80
|
+
test('should handle camel case names', () => {
|
|
81
|
+
expect(friendlyName('myFieldId')).toEqual('My field id');
|
|
82
|
+
});
|
|
83
|
+
test('should handle snake case names', () => {
|
|
84
|
+
expect(friendlyName('my_field_id')).toEqual('My field id');
|
|
85
|
+
});
|
|
86
|
+
test('should handle names with numbers at the start', () => {
|
|
87
|
+
expect(friendlyName('1_field_id')).toEqual('1 field id');
|
|
88
|
+
});
|
|
89
|
+
test('should handle names with numbers in the middle', () => {
|
|
90
|
+
expect(friendlyName('my_1field_id')).toEqual('My 1field id');
|
|
91
|
+
});
|
|
92
|
+
test('should handle numbers in the input', () => {
|
|
93
|
+
expect(friendlyName('numberrange1')).toBe('Numberrange 1');
|
|
94
|
+
expect(friendlyName('numberrange_14')).toBe('Numberrange 14');
|
|
95
|
+
expect(friendlyName('date9')).toBe('Date 9');
|
|
96
|
+
});
|
|
97
|
+
const commonCases = [
|
|
98
|
+
['customer_id', 'Customer id'],
|
|
99
|
+
['first_name', 'First name'],
|
|
100
|
+
['last_name', 'Last name'],
|
|
101
|
+
['created', 'Created'],
|
|
102
|
+
['payment_id', 'Payment id'],
|
|
103
|
+
['order_id', 'Order id'],
|
|
104
|
+
['payment_method', 'Payment method'],
|
|
105
|
+
['amount', 'Amount'],
|
|
106
|
+
];
|
|
107
|
+
test.each(commonCases)('should handle common case %s', (input, expected) => {
|
|
108
|
+
expect(friendlyName(input)).toBe(expected);
|
|
109
|
+
});
|
|
110
|
+
test('should handle empty strings', () => {
|
|
111
|
+
expect(friendlyName('')).toBe('');
|
|
112
|
+
});
|
|
113
|
+
test('should handle all uppercase input', () => {
|
|
114
|
+
expect(friendlyName('TIMESTAMP_EST')).toBe('Timestamp est');
|
|
115
|
+
});
|
|
116
|
+
test('should handle mixed case input', () => {
|
|
117
|
+
expect(friendlyName('Timestamp_EST')).toBe('Timestamp est');
|
|
118
|
+
});
|
|
119
|
+
const underscoreCases = [
|
|
120
|
+
['created_by_first_name', 'Created by first name'],
|
|
121
|
+
['order_date', 'Order date'],
|
|
122
|
+
['customer_lifetime_value', 'Customer lifetime value'],
|
|
123
|
+
['days_since_last_order', 'Days since last order'],
|
|
124
|
+
[
|
|
125
|
+
'days_between_created_and_first_order',
|
|
126
|
+
'Days between created and first order',
|
|
127
|
+
],
|
|
128
|
+
];
|
|
129
|
+
test.each(underscoreCases)('should handle multiple underscores %s', (input, expected) => {
|
|
130
|
+
expect(friendlyName(input)).toBe(expected);
|
|
131
|
+
});
|
|
132
|
+
const edgeCases = [
|
|
133
|
+
['_timestamp_', 'Timestamp'],
|
|
134
|
+
['__timestamp__', 'Timestamp'],
|
|
135
|
+
['timestamp__EST', 'Timestamp est'],
|
|
136
|
+
['timestamp_EST_', 'Timestamp est'],
|
|
137
|
+
];
|
|
138
|
+
test.each(edgeCases)('should handle edge case %s', (input, expected) => {
|
|
139
|
+
expect(friendlyName(input)).toBe(expected);
|
|
140
|
+
});
|
|
141
|
+
const specialCases = [
|
|
142
|
+
['timestamp_tz', 'Timestamp tz'],
|
|
143
|
+
['timestamp_ntz', 'Timestamp ntz'],
|
|
144
|
+
['timestamp_ltz', 'Timestamp ltz'],
|
|
145
|
+
['event_id', 'Event id'],
|
|
146
|
+
['context_app_version', 'Context app version'],
|
|
147
|
+
];
|
|
148
|
+
test.each(specialCases)('should handle special case %s', (input, expected) => {
|
|
149
|
+
expect(friendlyName(input)).toBe(expected);
|
|
150
|
+
});
|
|
151
|
+
const additionalCases = [
|
|
152
|
+
['name_with-dash', 'Name with dash'],
|
|
153
|
+
['name_with.dot', 'Name with dot'],
|
|
154
|
+
['name_with/slash', 'Name with slash'],
|
|
155
|
+
['Customer_ID', 'Customer id'],
|
|
156
|
+
['User_Name', 'User name'],
|
|
157
|
+
];
|
|
158
|
+
test.each(additionalCases)('should handle special characters and mixed case %s', (input, expected) => {
|
|
159
|
+
expect(friendlyName(input)).toBe(expected);
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
describe('Compile metrics with filters', () => {
|
|
163
|
+
beforeAll(() => {
|
|
164
|
+
jest.useFakeTimers();
|
|
165
|
+
jest.setSystemTime(new Date('04 Apr 2020 00:12:00 GMT').getTime());
|
|
166
|
+
});
|
|
167
|
+
afterAll(() => {
|
|
168
|
+
jest.useFakeTimers();
|
|
169
|
+
});
|
|
170
|
+
test('should show filters as columns metric1', () => {
|
|
171
|
+
expect(compiler.compileMetric(tablesWithMetricsWithFilters.table1.metrics.metric1, tablesWithMetricsWithFilters, []).compiledSql).toStrictEqual(`MAX(CASE WHEN (LOWER("table1".shared) LIKE LOWER('%foo%')) THEN ("table1".number_column) ELSE NULL END)`);
|
|
172
|
+
});
|
|
173
|
+
test('should show filters as columns metric2', () => {
|
|
174
|
+
expect(compiler.compileMetric(tablesWithMetricsWithFilters.table2.metrics.metric2, tablesWithMetricsWithFilters, []).compiledSql).toStrictEqual(`MAX(CASE WHEN (("table2".dim2) < (10) AND ("table2".dim2) > (5)) THEN ("table2".number_column) ELSE NULL END)`);
|
|
175
|
+
});
|
|
176
|
+
test('should show filters as columns metric with sql', () => {
|
|
177
|
+
expect(compiler.compileMetric(tablesWithMetricsWithFilters.table1.metrics.metric_with_sql, tablesWithMetricsWithFilters, []).compiledSql).toStrictEqual(`MAX(CASE WHEN (LOWER("table1".shared) LIKE LOWER('%foo%')) THEN (CASE WHEN "table1".number_column THEN 1 ELSE 0 END) ELSE NULL END)`);
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
describe('Parse dimension reference', () => {
|
|
181
|
+
test('should parse dimensions', () => {
|
|
182
|
+
expect(parseAllReferences('${dimension} == 1', 'table')).toStrictEqual([
|
|
183
|
+
{ refName: 'dimension', refTable: 'table' },
|
|
184
|
+
]);
|
|
185
|
+
expect(parseAllReferences('${table.dimension}', 'table')).toStrictEqual([{ refName: 'dimension', refTable: 'table' }]);
|
|
186
|
+
});
|
|
187
|
+
test('should parse TABLE', () => {
|
|
188
|
+
expect(parseAllReferences('${TABLE}', 'table')).toStrictEqual([
|
|
189
|
+
{ refName: 'TABLE', refTable: 'table' },
|
|
190
|
+
]);
|
|
191
|
+
});
|
|
192
|
+
test('should not parse lightdash attribute', () => {
|
|
193
|
+
expect(parseAllReferences('${lightdash.attribute.country}', 'table')).toStrictEqual([]);
|
|
194
|
+
});
|
|
195
|
+
test('should not parse short lightdash attribute', () => {
|
|
196
|
+
expect(parseAllReferences('${ld.attr.country}', 'table')).toStrictEqual([]);
|
|
197
|
+
});
|
|
198
|
+
test('should parse references with lightdash prefix', () => {
|
|
199
|
+
expect(parseAllReferences('${lightdash_dimension} == 1', 'table')).toStrictEqual([
|
|
200
|
+
{ refName: 'lightdash_dimension', refTable: 'table' },
|
|
201
|
+
]);
|
|
202
|
+
expect(parseAllReferences('${dimension_lightdash} == 1', 'table')).toStrictEqual([
|
|
203
|
+
{ refName: 'dimension_lightdash', refTable: 'table' },
|
|
204
|
+
]);
|
|
205
|
+
expect(parseAllReferences('${lightdash_table.dimension}', 'lightdash_table')).toStrictEqual([
|
|
206
|
+
{ refName: 'dimension', refTable: 'lightdash_table' },
|
|
207
|
+
]);
|
|
208
|
+
expect(parseAllReferences('${table_lightdash.dimension}', 'table_lightdash')).toStrictEqual([
|
|
209
|
+
{ refName: 'dimension', refTable: 'table_lightdash' },
|
|
210
|
+
]);
|
|
211
|
+
expect(parseAllReferences('${ld_dimension} == 1', 'table')).toStrictEqual([{ refName: 'ld_dimension', refTable: 'table' }]);
|
|
212
|
+
expect(parseAllReferences('${ld_table.ld_dimension} == 1', 'ld_table')).toStrictEqual([{ refName: 'ld_dimension', refTable: 'ld_table' }]);
|
|
213
|
+
});
|
|
214
|
+
});
|
|
215
|
+
describe('Explore with user attributes', () => {
|
|
216
|
+
test('should compile explore with table and field required attributes', () => {
|
|
217
|
+
expect(compiler.compileExplore(exploreWithRequiredAttributes)).toStrictEqual(exploreWithRequiredAttributesCompiled);
|
|
218
|
+
});
|
|
219
|
+
});
|
|
220
|
+
describe('Explore with always true join', () => {
|
|
221
|
+
test('should compile explore with always true join', () => {
|
|
222
|
+
expect(compiler.compileExplore(simpleJoinedExploreWithAlwaysTrue)).toStrictEqual(compiledSimpleJoinedExploreWithAlwaysTrue);
|
|
223
|
+
});
|
|
224
|
+
});
|
|
225
|
+
describe('Compiled custom dimensions', () => {
|
|
226
|
+
test('should compile custom dimension with no references', () => {
|
|
227
|
+
expect(compiler.compileCustomDimension(customSqlDimensionWithNoReferences, simpleJoinedExplore.tables, [])).toStrictEqual(expectedCompiledCustomSqlDimensionWithNoReferences);
|
|
228
|
+
});
|
|
229
|
+
test('should compile custom dimension with references', () => {
|
|
230
|
+
expect(compiler.compileCustomDimension(customSqlDimensionWithReferences, simpleJoinedExplore.tables, [])).toStrictEqual(expectedCompiledCustomSqlDimensionWithReferences);
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
describe('Explore compilation with model-level parameters', () => {
|
|
234
|
+
describe('Parameter inheritance on tables', () => {
|
|
235
|
+
test('should compile explore with table parameters', () => {
|
|
236
|
+
const result = compiler.compileExplore(exploreWithParameters);
|
|
237
|
+
expect(result).toStrictEqual(compiledExploreWithParameters);
|
|
238
|
+
});
|
|
239
|
+
test('should copy parameters to compiled tables', () => {
|
|
240
|
+
const result = compiler.compileExplore(exploreWithParameters);
|
|
241
|
+
expect(result.tables.a.parameters).toEqual({
|
|
242
|
+
region: {
|
|
243
|
+
label: 'Region',
|
|
244
|
+
description: 'Filter by region',
|
|
245
|
+
default: 'US',
|
|
246
|
+
},
|
|
247
|
+
});
|
|
248
|
+
expect(result.tables.b.parameters).toEqual({
|
|
249
|
+
active_status: {
|
|
250
|
+
label: 'Active Status',
|
|
251
|
+
description: 'Define active status',
|
|
252
|
+
default: 'active',
|
|
253
|
+
},
|
|
254
|
+
});
|
|
255
|
+
});
|
|
256
|
+
test('should track parameter references in joins', () => {
|
|
257
|
+
const result = compiler.compileExplore(exploreWithParameters);
|
|
258
|
+
expect(result.joinedTables[0].parameterReferences).toEqual([
|
|
259
|
+
'b.active_status',
|
|
260
|
+
]);
|
|
261
|
+
});
|
|
262
|
+
});
|
|
263
|
+
describe('Parameter validation in joins', () => {
|
|
264
|
+
test('should throw error for invalid parameter references', () => {
|
|
265
|
+
expect(() => compiler.compileExplore(exploreWithInvalidParameterReference)).toThrowError(CompileError);
|
|
266
|
+
});
|
|
267
|
+
test('should throw error with descriptive message for missing parameters', () => {
|
|
268
|
+
expect(() => compiler.compileExplore(exploreWithInvalidParameterReference)).toThrow('Missing parameters: b.nonexistent_param');
|
|
269
|
+
});
|
|
270
|
+
});
|
|
271
|
+
describe('Parameter resolution in join conditions', () => {
|
|
272
|
+
test('should preserve parameter references in compiled SQL', () => {
|
|
273
|
+
const result = compiler.compileExplore(exploreWithParameters);
|
|
274
|
+
expect(result.joinedTables[0].compiledSqlOn).toContain('${ld.parameters.b.active_status}');
|
|
275
|
+
});
|
|
276
|
+
test('should compile table references but preserve parameter references', () => {
|
|
277
|
+
const result = compiler.compileExplore(exploreWithParameters);
|
|
278
|
+
const compiledSql = result.joinedTables[0].compiledSqlOn;
|
|
279
|
+
expect(compiledSql).toContain('"a".dim1');
|
|
280
|
+
expect(compiledSql).toContain('"b".dim1');
|
|
281
|
+
expect(compiledSql).toContain('${ld.parameters.b.active_status}');
|
|
282
|
+
});
|
|
283
|
+
test('should track both table and parameter references', () => {
|
|
284
|
+
const result = compiler.compileExplore(exploreWithParameters);
|
|
285
|
+
expect(result.joinedTables[0].tablesReferences).toEqual(['a', 'b']);
|
|
286
|
+
expect(result.joinedTables[0].parameterReferences).toEqual([
|
|
287
|
+
'b.active_status',
|
|
288
|
+
]);
|
|
289
|
+
});
|
|
290
|
+
});
|
|
291
|
+
describe('Parameter scoping across joined tables', () => {
|
|
292
|
+
test('should validate parameter exists in correct table scope', () => {
|
|
293
|
+
expect(() => compiler.compileExplore(exploreWithInvalidParameterReference)).toThrow('Missing parameters: b.nonexistent_param');
|
|
294
|
+
});
|
|
295
|
+
test('should allow parameters from any table in the explore', () => {
|
|
296
|
+
const exploreWithMultipleParamReferences = {
|
|
297
|
+
...exploreWithParameters,
|
|
298
|
+
joinedTables: [
|
|
299
|
+
{
|
|
300
|
+
table: 'b',
|
|
301
|
+
sqlOn: "${a.dim1} = ${b.dim1} AND ${ld.parameters.a.region} = 'US' AND ${ld.parameters.b.active_status} = 'active'",
|
|
302
|
+
},
|
|
303
|
+
],
|
|
304
|
+
};
|
|
305
|
+
expect(() => compiler.compileExplore(exploreWithMultipleParamReferences)).not.toThrow();
|
|
306
|
+
});
|
|
307
|
+
});
|
|
308
|
+
describe('Edge cases', () => {
|
|
309
|
+
test('should handle join with no parameters', () => {
|
|
310
|
+
const exploreWithoutParams = {
|
|
311
|
+
...exploreWithParameters,
|
|
312
|
+
tables: {
|
|
313
|
+
...exploreWithParameters.tables,
|
|
314
|
+
a: {
|
|
315
|
+
...exploreWithParameters.tables.a,
|
|
316
|
+
parameters: {},
|
|
317
|
+
},
|
|
318
|
+
b: {
|
|
319
|
+
...exploreWithParameters.tables.b,
|
|
320
|
+
parameters: {},
|
|
321
|
+
},
|
|
322
|
+
},
|
|
323
|
+
joinedTables: [
|
|
324
|
+
{
|
|
325
|
+
table: 'b',
|
|
326
|
+
sqlOn: '${a.dim1} = ${b.dim1}',
|
|
327
|
+
},
|
|
328
|
+
],
|
|
329
|
+
};
|
|
330
|
+
expect(() => compiler.compileExplore(exploreWithoutParams)).not.toThrow();
|
|
331
|
+
});
|
|
332
|
+
test('should handle tables with undefined parameters', () => {
|
|
333
|
+
const exploreWithUndefinedParams = {
|
|
334
|
+
...exploreWithParameters,
|
|
335
|
+
tables: {
|
|
336
|
+
...exploreWithParameters.tables,
|
|
337
|
+
a: {
|
|
338
|
+
...exploreWithParameters.tables.a,
|
|
339
|
+
parameters: undefined,
|
|
340
|
+
},
|
|
341
|
+
b: {
|
|
342
|
+
...exploreWithParameters.tables.b,
|
|
343
|
+
parameters: undefined,
|
|
344
|
+
},
|
|
345
|
+
},
|
|
346
|
+
joinedTables: [
|
|
347
|
+
{
|
|
348
|
+
table: 'b',
|
|
349
|
+
sqlOn: '${a.dim1} = ${b.dim1}',
|
|
350
|
+
},
|
|
351
|
+
],
|
|
352
|
+
};
|
|
353
|
+
expect(() => compiler.compileExplore(exploreWithUndefinedParams)).not.toThrow();
|
|
354
|
+
});
|
|
355
|
+
test('should handle mixed project and model parameter syntax', () => {
|
|
356
|
+
const exploreWithMixedSyntax = {
|
|
357
|
+
...exploreWithParameters,
|
|
358
|
+
// Add project-level parameters
|
|
359
|
+
projectParameters: {
|
|
360
|
+
region: {
|
|
361
|
+
label: 'Global Region',
|
|
362
|
+
description: 'Global region filter',
|
|
363
|
+
default: 'US',
|
|
364
|
+
},
|
|
365
|
+
},
|
|
366
|
+
tables: {
|
|
367
|
+
...exploreWithParameters.tables,
|
|
368
|
+
b: {
|
|
369
|
+
...exploreWithParameters.tables.b,
|
|
370
|
+
parameters: {
|
|
371
|
+
active_status: {
|
|
372
|
+
label: 'Active Status',
|
|
373
|
+
description: 'Define what constitutes an active order',
|
|
374
|
+
default: 'active',
|
|
375
|
+
},
|
|
376
|
+
},
|
|
377
|
+
},
|
|
378
|
+
},
|
|
379
|
+
joinedTables: [
|
|
380
|
+
{
|
|
381
|
+
table: 'b',
|
|
382
|
+
sqlOn: "${a.dim1} = ${b.dim1} AND ${ld.parameters.b.active_status} = 'active' AND ${ld.parameters.region} = 'US'",
|
|
383
|
+
},
|
|
384
|
+
],
|
|
385
|
+
};
|
|
386
|
+
const result = compiler.compileExplore(exploreWithMixedSyntax);
|
|
387
|
+
expect(result.joinedTables[0].parameterReferences).toEqual([
|
|
388
|
+
'b.active_status',
|
|
389
|
+
'region',
|
|
390
|
+
]);
|
|
391
|
+
});
|
|
392
|
+
test('should allow same parameter name at project and model levels without conflict', () => {
|
|
393
|
+
const exploreWithSameNamedParams = {
|
|
394
|
+
...exploreWithParameters,
|
|
395
|
+
projectParameters: {
|
|
396
|
+
region: {
|
|
397
|
+
label: 'Global Region',
|
|
398
|
+
description: 'Global region filter',
|
|
399
|
+
default: 'US',
|
|
400
|
+
},
|
|
401
|
+
status: {
|
|
402
|
+
label: 'Global Status',
|
|
403
|
+
description: 'Global status filter',
|
|
404
|
+
default: 'active',
|
|
405
|
+
},
|
|
406
|
+
},
|
|
407
|
+
tables: {
|
|
408
|
+
...exploreWithParameters.tables,
|
|
409
|
+
a: {
|
|
410
|
+
...exploreWithParameters.tables.a,
|
|
411
|
+
parameters: {
|
|
412
|
+
region: {
|
|
413
|
+
label: 'Table A Region',
|
|
414
|
+
description: 'Region specific to table A',
|
|
415
|
+
default: 'EU',
|
|
416
|
+
},
|
|
417
|
+
},
|
|
418
|
+
},
|
|
419
|
+
b: {
|
|
420
|
+
...exploreWithParameters.tables.b,
|
|
421
|
+
parameters: {
|
|
422
|
+
status: {
|
|
423
|
+
label: 'Table B Status',
|
|
424
|
+
description: 'Status specific to table B',
|
|
425
|
+
default: 'inactive',
|
|
426
|
+
},
|
|
427
|
+
},
|
|
428
|
+
},
|
|
429
|
+
},
|
|
430
|
+
joinedTables: [
|
|
431
|
+
{
|
|
432
|
+
table: 'b',
|
|
433
|
+
sqlOn: "${a.dim1} = ${b.dim1} AND ${ld.parameters.region} = 'US' AND ${ld.parameters.a.region} = 'EU' AND ${ld.parameters.status} = 'active' AND ${ld.parameters.b.status} = 'inactive'",
|
|
434
|
+
},
|
|
435
|
+
],
|
|
436
|
+
};
|
|
437
|
+
// This should NOT throw an error because parameters are properly scoped
|
|
438
|
+
expect(() => compiler.compileExplore(exploreWithSameNamedParams)).not.toThrow();
|
|
439
|
+
const result = compiler.compileExplore(exploreWithSameNamedParams);
|
|
440
|
+
// Should track all scoped parameters correctly
|
|
441
|
+
expect(result.joinedTables[0].parameterReferences).toEqual([
|
|
442
|
+
'region',
|
|
443
|
+
'a.region',
|
|
444
|
+
'status',
|
|
445
|
+
'b.status',
|
|
446
|
+
]);
|
|
447
|
+
// Model parameters should be preserved on compiled tables
|
|
448
|
+
expect(result.tables.a.parameters).toEqual({
|
|
449
|
+
region: {
|
|
450
|
+
label: 'Table A Region',
|
|
451
|
+
description: 'Region specific to table A',
|
|
452
|
+
default: 'EU',
|
|
453
|
+
},
|
|
454
|
+
});
|
|
455
|
+
expect(result.tables.b.parameters).toEqual({
|
|
456
|
+
status: {
|
|
457
|
+
label: 'Table B Status',
|
|
458
|
+
description: 'Status specific to table B',
|
|
459
|
+
default: 'inactive',
|
|
460
|
+
},
|
|
461
|
+
});
|
|
462
|
+
});
|
|
463
|
+
test('should handle complex scoping scenarios with multiple same-named parameters', () => {
|
|
464
|
+
const exploreWithComplexScoping = {
|
|
465
|
+
...exploreWithParameters,
|
|
466
|
+
projectParameters: {
|
|
467
|
+
date_range: {
|
|
468
|
+
label: 'Global Date Range',
|
|
469
|
+
description: 'Global date filter',
|
|
470
|
+
default: '2024-01-01',
|
|
471
|
+
},
|
|
472
|
+
},
|
|
473
|
+
tables: {
|
|
474
|
+
...exploreWithParameters.tables,
|
|
475
|
+
a: {
|
|
476
|
+
...exploreWithParameters.tables.a,
|
|
477
|
+
parameters: {
|
|
478
|
+
date_range: {
|
|
479
|
+
label: 'Table A Date Range',
|
|
480
|
+
description: 'Date range for table A',
|
|
481
|
+
default: '2024-02-01',
|
|
482
|
+
},
|
|
483
|
+
},
|
|
484
|
+
},
|
|
485
|
+
b: {
|
|
486
|
+
...exploreWithParameters.tables.b,
|
|
487
|
+
parameters: {
|
|
488
|
+
date_range: {
|
|
489
|
+
label: 'Table B Date Range',
|
|
490
|
+
description: 'Date range for table B',
|
|
491
|
+
default: '2024-03-01',
|
|
492
|
+
},
|
|
493
|
+
},
|
|
494
|
+
},
|
|
495
|
+
},
|
|
496
|
+
joinedTables: [
|
|
497
|
+
{
|
|
498
|
+
table: 'b',
|
|
499
|
+
sqlOn: "${a.dim1} = ${b.dim1} AND ${ld.parameters.date_range} >= '2024-01-01' AND ${ld.parameters.a.date_range} >= '2024-02-01' AND ${lightdash.parameters.b.date_range} >= '2024-03-01'",
|
|
500
|
+
},
|
|
501
|
+
],
|
|
502
|
+
};
|
|
503
|
+
expect(() => compiler.compileExplore(exploreWithComplexScoping)).not.toThrow();
|
|
504
|
+
const result = compiler.compileExplore(exploreWithComplexScoping);
|
|
505
|
+
expect(result.joinedTables[0].parameterReferences).toEqual([
|
|
506
|
+
'date_range',
|
|
507
|
+
'a.date_range',
|
|
508
|
+
'b.date_range',
|
|
509
|
+
]);
|
|
510
|
+
});
|
|
511
|
+
});
|
|
512
|
+
describe('Field Sets', () => {
|
|
513
|
+
it('should expand field sets in join.fields', () => {
|
|
514
|
+
const explore = {
|
|
515
|
+
name: 'test_explore',
|
|
516
|
+
label: 'Test Explore',
|
|
517
|
+
tags: [],
|
|
518
|
+
baseTable: 'a',
|
|
519
|
+
groupLabel: undefined,
|
|
520
|
+
joinedTables: [
|
|
521
|
+
{
|
|
522
|
+
table: 'b',
|
|
523
|
+
sqlOn: '${a.dim1} = ${b.dim1}',
|
|
524
|
+
fields: ['all_fields*', '-dim3'],
|
|
525
|
+
},
|
|
526
|
+
],
|
|
527
|
+
tables: {
|
|
528
|
+
a: {
|
|
529
|
+
name: 'a',
|
|
530
|
+
label: 'a',
|
|
531
|
+
database: 'database',
|
|
532
|
+
schema: 'schema',
|
|
533
|
+
sqlTable: 'test.a',
|
|
534
|
+
dimensions: {
|
|
535
|
+
dim1: {
|
|
536
|
+
fieldType: FieldType.DIMENSION,
|
|
537
|
+
type: DimensionType.STRING,
|
|
538
|
+
name: 'dim1',
|
|
539
|
+
label: 'Dim 1',
|
|
540
|
+
table: 'a',
|
|
541
|
+
tableLabel: 'a',
|
|
542
|
+
sql: '${TABLE}.dim1',
|
|
543
|
+
hidden: false,
|
|
544
|
+
index: 0,
|
|
545
|
+
},
|
|
546
|
+
},
|
|
547
|
+
metrics: {},
|
|
548
|
+
lineageGraph: {},
|
|
549
|
+
},
|
|
550
|
+
b: {
|
|
551
|
+
name: 'b',
|
|
552
|
+
label: 'b',
|
|
553
|
+
database: 'database',
|
|
554
|
+
schema: 'schema',
|
|
555
|
+
sqlTable: 'test.b',
|
|
556
|
+
dimensions: {
|
|
557
|
+
dim1: {
|
|
558
|
+
fieldType: FieldType.DIMENSION,
|
|
559
|
+
type: DimensionType.STRING,
|
|
560
|
+
name: 'dim1',
|
|
561
|
+
label: 'Dim 1',
|
|
562
|
+
table: 'b',
|
|
563
|
+
tableLabel: 'b',
|
|
564
|
+
sql: '${TABLE}.dim1',
|
|
565
|
+
hidden: false,
|
|
566
|
+
index: 0,
|
|
567
|
+
},
|
|
568
|
+
dim2: {
|
|
569
|
+
fieldType: FieldType.DIMENSION,
|
|
570
|
+
type: DimensionType.STRING,
|
|
571
|
+
name: 'dim2',
|
|
572
|
+
label: 'Dim 2',
|
|
573
|
+
table: 'b',
|
|
574
|
+
tableLabel: 'b',
|
|
575
|
+
sql: '${TABLE}.dim2',
|
|
576
|
+
hidden: false,
|
|
577
|
+
index: 1,
|
|
578
|
+
},
|
|
579
|
+
dim3: {
|
|
580
|
+
fieldType: FieldType.DIMENSION,
|
|
581
|
+
type: DimensionType.STRING,
|
|
582
|
+
name: 'dim3',
|
|
583
|
+
label: 'Dim 3',
|
|
584
|
+
table: 'b',
|
|
585
|
+
tableLabel: 'b',
|
|
586
|
+
sql: '${TABLE}.dim3',
|
|
587
|
+
hidden: false,
|
|
588
|
+
index: 2,
|
|
589
|
+
},
|
|
590
|
+
},
|
|
591
|
+
metrics: {},
|
|
592
|
+
lineageGraph: {},
|
|
593
|
+
sets: {
|
|
594
|
+
id_fields: {
|
|
595
|
+
fields: ['dim1', 'dim2'],
|
|
596
|
+
},
|
|
597
|
+
all_fields: {
|
|
598
|
+
fields: ['id_fields*', 'dim3'],
|
|
599
|
+
},
|
|
600
|
+
},
|
|
601
|
+
},
|
|
602
|
+
},
|
|
603
|
+
targetDatabase: SupportedDbtAdapter.POSTGRES,
|
|
604
|
+
meta: {},
|
|
605
|
+
};
|
|
606
|
+
const result = compiler.compileExplore(explore);
|
|
607
|
+
// Should include dim1 and dim2 from id_fields, but exclude dim3
|
|
608
|
+
expect(result.tables.b.dimensions).toHaveProperty('dim1');
|
|
609
|
+
expect(result.tables.b.dimensions).toHaveProperty('dim2');
|
|
610
|
+
expect(result.tables.b.dimensions).not.toHaveProperty('dim3');
|
|
611
|
+
});
|
|
612
|
+
it('should throw error for non-existent set in join', () => {
|
|
613
|
+
const explore = {
|
|
614
|
+
name: 'test_explore',
|
|
615
|
+
label: 'Test Explore',
|
|
616
|
+
tags: [],
|
|
617
|
+
baseTable: 'a',
|
|
618
|
+
groupLabel: undefined,
|
|
619
|
+
joinedTables: [
|
|
620
|
+
{
|
|
621
|
+
table: 'b',
|
|
622
|
+
sqlOn: '${a.dim1} = ${b.dim1}',
|
|
623
|
+
fields: ['nonexistent_set*'],
|
|
624
|
+
},
|
|
625
|
+
],
|
|
626
|
+
tables: {
|
|
627
|
+
a: {
|
|
628
|
+
name: 'a',
|
|
629
|
+
label: 'a',
|
|
630
|
+
database: 'database',
|
|
631
|
+
schema: 'schema',
|
|
632
|
+
sqlTable: 'test.a',
|
|
633
|
+
dimensions: {
|
|
634
|
+
dim1: {
|
|
635
|
+
fieldType: FieldType.DIMENSION,
|
|
636
|
+
type: DimensionType.STRING,
|
|
637
|
+
name: 'dim1',
|
|
638
|
+
label: 'Dim 1',
|
|
639
|
+
table: 'a',
|
|
640
|
+
tableLabel: 'a',
|
|
641
|
+
sql: '${TABLE}.dim1',
|
|
642
|
+
hidden: false,
|
|
643
|
+
index: 0,
|
|
644
|
+
},
|
|
645
|
+
},
|
|
646
|
+
metrics: {},
|
|
647
|
+
lineageGraph: {},
|
|
648
|
+
},
|
|
649
|
+
b: {
|
|
650
|
+
name: 'b',
|
|
651
|
+
label: 'b',
|
|
652
|
+
database: 'database',
|
|
653
|
+
schema: 'schema',
|
|
654
|
+
sqlTable: 'test.b',
|
|
655
|
+
dimensions: {
|
|
656
|
+
dim1: {
|
|
657
|
+
fieldType: FieldType.DIMENSION,
|
|
658
|
+
type: DimensionType.STRING,
|
|
659
|
+
name: 'dim1',
|
|
660
|
+
label: 'Dim 1',
|
|
661
|
+
table: 'b',
|
|
662
|
+
tableLabel: 'b',
|
|
663
|
+
sql: '${TABLE}.dim1',
|
|
664
|
+
hidden: false,
|
|
665
|
+
index: 0,
|
|
666
|
+
},
|
|
667
|
+
},
|
|
668
|
+
metrics: {},
|
|
669
|
+
lineageGraph: {},
|
|
670
|
+
},
|
|
671
|
+
},
|
|
672
|
+
targetDatabase: SupportedDbtAdapter.POSTGRES,
|
|
673
|
+
meta: {},
|
|
674
|
+
};
|
|
675
|
+
expect(() => compiler.compileExplore(explore)).toThrow(/Set "nonexistent_set" not found/);
|
|
676
|
+
});
|
|
677
|
+
});
|
|
678
|
+
});
|
|
679
|
+
//# sourceMappingURL=exploreCompiler.test.js.map
|