/** * Copyright (c) 2026-present, Goldman Sachs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { PropertyDocumentationEntry, type NormalizedDocumentationEntry } from '../model-documentation/index.js'; import type { TDSColumnSchema, TDSServiceSchema, TDSServicePreFilter, LegendAIServiceRelationship } from './LegendAITypes.js'; /** * Builds a lookup map from lowercase property name to its documentation entry. * Used to enrich TDS columns with business descriptions and nullability * from the PURE model's class properties. */ export declare function buildPropertyDocIndex(elementDocs: NormalizedDocumentationEntry[]): Map; /** * Enriches TDS columns with documentation and nullability from model * class property docs. Matches columns to properties case-insensitively. */ export declare function enrichColumnsFromElementDocs(columns: TDSColumnSchema[], propIndex: Map): void; /** * Infers cross-service relationships from association documentation entries. * * Associations in the PURE model define how classes connect (e.g., * `Trade ──(1:*)──→ Instrument`). By finding associations that link * classes backing different services, we determine: * - Which services share a common parent entity (the via entity) * - The cardinality of each side (1:1, 1:*, etc.) * - Which columns to JOIN on (shared column names) * * Used by both Data Space and Data Product AI integrations. */ export declare function inferServiceRelationshipsFromAssociations(services: TDSServiceSchema[], elementDocs: NormalizedDocumentationEntry[]): LegendAIServiceRelationship[]; /** * Extracts hardcoded pre-filter constraints from a raw lambda body. * * Walks the lambda JSON tree to find: * - `equal` comparisons with literal values (e.g. `fsymId == 'D7HG0X-S'`) * - `isEmpty` checks (e.g. `consEndDate->isEmpty()`) * - `isNotNull` post-projection TDS row checks (e.g. `row.isNotNull('Fe Mean')`) * * The `rawLambdaBody` parameter is `RawLambda.body` — the raw JSON array * from the PURE protocol. */ export declare function extractLambdaPreFilters(rawLambdaBody: object | undefined): TDSServicePreFilter[]; /** * Formats pre-filter constraints into a human-readable summary for LLM context. * This generates a concise description of what's hardcoded in the service lambda * so the AI avoids generating contradictory WHERE clauses. */ export declare function formatPreFiltersForContext(preFilters: TDSServicePreFilter[]): string; //# sourceMappingURL=LegendAIDocEnrichment.d.ts.map