tessl install tessl/npm-lightdash--common@0.2231.5Shared 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%
Build a template rendering system that supports dual context layers for dynamic URL generation in a business intelligence tool. The system must handle both current cell values and references to other fields in the same data row.
Implement a function that renders templates with dual context access:
${} delimitersurl_encode)Implement a function that extracts row field dependencies from templates without executing them:
tableName_fieldNamerow.{table}.{field}.(raw|formatted))Support references to the current cell value:
${value.raw} - access raw database value${value.formatted} - access pre-formatted display stringSupport references to other fields in the same row:
${row.{table}.{field}.(raw|formatted)}Renders a template with only value references: ${value.raw} returns the raw value from the current cell @test
Renders a template with row references: ${row.customers.customer_id.raw} accesses the customer_id field from the customers table @test
Applies Liquid filters correctly: ${value.raw | url_encode} applies URL encoding to the raw value @test
Extracts dependencies from row references: template with ${row.customers.customer_id.raw} returns ['customers_customer_id'] @test
Rejects invalid row references: template with ${row.customer_id.raw} (missing table name) throws an error @test
Renders complex templates with multiple references: combines value and multiple row references in a single URL @test
Returns empty dependencies for value-only templates: template with only ${value.raw} returns empty array @test
@generates
/**
* ResultValue represents a data cell with both raw database value and formatted display string
*/
type ResultValue = {
raw: unknown;
formatted: string;
};
/**
* Renders a template string with dual context layers
*
* @param template - Template string using ${} delimiters
* @param value - Current cell value with raw and formatted representations
* @param row - Complete row data organized as row[tableName][fieldName] = ResultValue
* @returns Rendered string with all template variables resolved
*/
export function renderTemplatedUrl(
template: string,
value: ResultValue,
row: Record<string, Record<string, ResultValue>>
): string;
/**
* Extracts row field dependencies from a template without executing it
* Uses AST parsing to identify all row.{table}.{field} references
*
* @param template - Template string to analyze
* @returns Array of field identifiers in format 'tableName_fieldName'
* @throws Error if template contains invalid row references
*/
export function getTemplatedUrlRowDependencies(
template: string
): string[];Provides template rendering utilities and type definitions for business intelligence operations.
docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10
scenario-11
scenario-12
scenario-13
scenario-14
scenario-15
scenario-16
scenario-17
scenario-18
scenario-19
scenario-20