import { ServiceNowInstance } from "../ServiceNowInstance.js"; import { GetRelationshipsOptions, TraverseGraphOptions, RelationshipsResult, GraphTraversalResult } from './CMDBModels.js'; /** * CMDBRelationships provides methods for querying and traversing * CMDB relationship graphs. Supports single-level lookups and * multi-level BFS traversal with configurable depth and direction. */ export declare class CMDBRelationships { private static readonly CMDB_CI_TABLE; private static readonly CMDB_REL_CI_TABLE; private static readonly MAX_DEPTH; private static readonly MAX_NODES; private _logger; private _tableAPI; private _instance; /** Cache for CI records to minimize API calls during traversal */ private _ciCache; constructor(instance: ServiceNowInstance); /** * Get direct relationships of a CI (single level). * * @param options Relationship query options * @returns RelationshipsResult with the CI and its direct relationships * @throws Error if ciSysId is empty */ getRelationships(options: GetRelationshipsOptions): Promise; /** * Traverse the CMDB relationship graph using BFS starting from a CI. * * @param options Traversal options * @returns GraphTraversalResult with all nodes, edges, and metadata * @throws Error if ciSysId is empty */ traverseGraph(options: TraverseGraphOptions): Promise; /** * Look up a single CI by sys_id. Uses cache when available. * @private */ private _lookupCI; /** * Batch look up multiple CIs by sys_id. * @private */ private _batchLookupCIs; /** * Query relationships from cmdb_rel_ci. * @private */ private _queryRelationships; /** * Extract sys_id from a field that may be a string or reference object. * @private */ private _extractSysId; /** * Extract display value or value from a field. * @private */ private _extractDisplayValue; }