CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/npm-lightdash--common

tessl install tessl/npm-lightdash--common@0.2231.5

Shared TypeScript library for the Lightdash platform containing common types, utilities, and business logic for analytics workflows

Agent Success

Agent success rate when using this tile

72%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.09x

Baseline

Agent success rate without this tile

66%

task.mdevals/scenario-9/

Dashboard Filter Analyzer

A utility tool for analyzing and validating dashboard filter configurations in BI applications.

Capabilities

Extract all filter rules

Extract all individual filter rules from nested filter groups into a flat array.

  • Given a filter group with 3 rules in the root and 2 rules in a nested group, extractAllFilters returns an array of 5 FilterRule objects @test
  • Given a filter group with an empty items array and empty nested groups, extractAllFilters returns an empty array @test

Count total filters

Count the total number of filter rules across all nesting levels.

  • Given a filter group with 2 rules at the root level and 3 nested groups containing 2, 1, and 3 rules respectively, countFilters returns 8 @test
  • Given an empty filter group, countFilters returns 0 @test

Generate filter summary

Combine extraction and counting into a summary report.

  • Given a filter group with 4 total rules (2 at root, 2 in nested group), generateFilterSummary returns an object with totalFilters: 4 and rules array containing all 4 FilterRule objects @test

Implementation

@generates

API

/**
 * Extracts all individual filter rules from a nested filter group structure.
 *
 * @param filterGroup - A filter group that may contain nested groups with AND/OR logic
 * @returns An array of all individual filter rules
 */
export function extractAllFilters(filterGroup: FilterGroup): FilterRule[];

/**
 * Counts the total number of filter rules in a filter group structure.
 *
 * @param filterGroup - A filter group that may contain nested groups
 * @returns The total count of filter rules
 */
export function countFilters(filterGroup: FilterGroup): number;

/**
 * Generates a summary report for a filter group.
 *
 * @param filterGroup - A filter group to analyze
 * @returns A summary object containing the total count and all extracted rules
 */
export function generateFilterSummary(filterGroup: FilterGroup): FilterSummary;

export interface FilterSummary {
  totalFilters: number;
  rules: FilterRule[];
}

Dependencies { .dependencies }

@lightdash/common { .dependency }

Provides filter utilities for working with dashboard filter groups and rules.

@satisfied-by

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/@lightdash/common@0.2231.x
tile.json