MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / isKnownEventField

Function isKnownEventField

packages/db/src/services/chart.service.ts:101–112  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

99// cohort breakdown, or `has_profile`. Used to drop unknown filters/breakdowns
100// instead of emitting invalid `SELECT cohort` / `SELECT temple_name` queries.
101export function isKnownEventField(name: string): boolean {
102 if (name === 'has_profile') return true;
103 if (isAllCohortsBreakdown(name)) return true;
104 if (extractCohortId(name)) return true;
105 if (name.startsWith('properties.')) return true;
106 if (name.startsWith('profile.')) return true;
107 if (name.startsWith('group.')) return true;
108 const normalized = normalizeEventField(name);
109 if (normalized.startsWith('properties.')) return true;
110 if (EVENT_TOP_LEVEL_COLUMNS.has(normalized)) return true;
111 return false;
112}
113
114export type CohortMetadata = {
115 id: string;

Callers 6

getFunnelMethod · 0.90
getConversionMethod · 0.90
chart.tsFile · 0.90
getChartSqlFunction · 0.85
getAggregateChartSqlFunction · 0.85

Calls 4

isAllCohortsBreakdownFunction · 0.85
extractCohortIdFunction · 0.85
normalizeEventFieldFunction · 0.85
hasMethod · 0.80

Tested by

no test coverage detected