import { ServiceNowInstance } from "../ServiceNowInstance.js"; import { TableSchemaOptions, TableSchema, FieldExplanation, CatalogValidationResult } from './SchemaModels.js'; /** * SchemaDiscovery provides operations for discovering ServiceNow table schemas, * explaining fields, and validating catalog configurations. */ export declare class SchemaDiscovery { private static readonly SYS_DB_OBJECT_TABLE; private static readonly SYS_DICTIONARY_TABLE; private static readonly SYS_CHOICE_TABLE; private static readonly ITEM_OPTION_NEW_TABLE; private static readonly CATALOG_UI_POLICY_TABLE; private _logger; private _req; private _tableAPI; private _instance; constructor(instance: ServiceNowInstance); /** * Discover the schema for a ServiceNow table. * Queries sys_db_object for table info and sys_dictionary for field definitions. * Optionally includes choice tables, relationships, UI policies, and business rules. * * @param tableName The name of the table to discover * @param options Optional flags to include additional information * @returns TableSchema with all discovered information * @throws Error if tableName is empty or the table is not found */ discoverTableSchema(tableName: string, options?: TableSchemaOptions): Promise; /** * Explain a specific field on a table. * Queries sys_dictionary for the field definition and sys_choice for available choices. * * @param tableName The table containing the field * @param fieldName The field name to explain * @returns Detailed FieldExplanation * @throws Error if tableName or fieldName is empty, or the field is not found */ explainField(tableName: string, fieldName: string): Promise; /** * Validate a catalog item configuration. * Checks variables (item_option_new) and UI policies (catalog_ui_policy) for integrity issues. * * @param catalogItemSysId The sys_id of the catalog item to validate * @returns Validation result with issues, warnings, and errors * @throws Error if catalogItemSysId is empty */ validateCatalogConfiguration(catalogItemSysId: string): Promise; /** * Get choice values for all fields on a table. * @private */ private _getChoicesForTable; /** * Extract relationship information from field schemas (reference fields). * @private */ private _extractRelationships; /** * Get UI policies for a table. * @private */ private _getUIPoliciesForTable; /** * Get business rules for a table. * @private */ private _getBusinessRulesForTable; }