import { ServiceNowInstance } from "../ServiceNowInstance.js"; import { CatalogItemRecord, CatalogItemDetail, CatalogCategoryRecord, CatalogCategoryDetail, CatalogVariableRecord, CatalogRequestResult, ListCatalogItemsOptions, ListCatalogCategoriesOptions, ListCatalogVariablesOptions, SubmitCatalogRequestOptions } from './CatalogModels.js'; /** * Mapping of numeric variable type codes to friendly names. * Sourced from a ServiceNow instance with sysparm_display_value: 'all'. */ export declare const VARIABLE_TYPE_MAP: Record; /** * Get a human-readable variable type name from a numeric type code. * * @param typeCode The numeric type code (as a string) * @returns The friendly type name, or "Unknown ({typeCode})" if not mapped */ export declare function getVariableTypeName(typeCode: string | undefined): string; /** * Provides operations for managing ServiceNow Service Catalog items, * categories, variables, and request submissions via the Table API, * Stats API, and Service Catalog REST API. */ export declare class CatalogManager { private static readonly CATALOG_ITEM_TABLE; private static readonly CATEGORY_TABLE; private static readonly VARIABLE_TABLE; private static readonly VARIABLE_SET_ITEM_TABLE; private static readonly REQUEST_ITEM_TABLE; private static readonly ORDER_NOW_API; /** Fields to return for catalog item list operations */ private static readonly ITEM_LIST_FIELDS; /** Fields to return for category list operations */ private static readonly CATEGORY_LIST_FIELDS; /** Fields to return for variable list operations */ private static readonly VARIABLE_LIST_FIELDS; private _logger; private _req; private _tableAPI; private _aggregateQuery; private _instance; private _headers; constructor(instance: ServiceNowInstance); /** * List catalog items with optional filtering and pagination. * * @param options Filtering and pagination options * @returns Array of catalog item records * @throws Error if the API call fails */ listCatalogItems(options?: ListCatalogItemsOptions): Promise; /** * Get details of a specific catalog item, optionally including its variables. * * @param sysId The sys_id of the catalog item * @param includeVariables Whether to include variables (default true) * @returns Catalog item detail with item record and variables * @throws Error if the sys_id is empty, the item is not found, or the API call fails */ getCatalogItem(sysId: string, includeVariables?: boolean): Promise; /** * List catalog categories with optional filtering and pagination. * * @param options Filtering and pagination options * @returns Array of catalog category records * @throws Error if the API call fails */ listCatalogCategories(options?: ListCatalogCategoriesOptions): Promise; /** * Get details of a specific catalog category including its item count. * * @param sysId The sys_id of the catalog category * @returns Category detail with category record and item count * @throws Error if the sys_id is empty, the category is not found, or the API call fails */ getCatalogCategory(sysId: string): Promise; /** * List variables for a catalog item, including variables from variable sets. * * @param options Options including the catalog item sys_id * @returns Array of catalog variable records sorted by order * @throws Error if the catalog item sys_id is empty or the API call fails */ listCatalogItemVariables(options: ListCatalogVariablesOptions): Promise; /** * Submit a catalog request using the Service Catalog order_now API. * After ordering, fetches the RITM record for the complete result. * * @param options Request submission options * @returns Request result with REQ and RITM numbers/sys_ids * @throws Error if the catalog item sys_id is empty or the API call fails */ submitCatalogRequest(options: SubmitCatalogRequestOptions): Promise; /** * Fetch all variables for a catalog item: direct variables + variable set variables. * Merges, deduplicates by sys_id, enriches with friendly_type, and sorts by order. * @private */ private _fetchAllVariables; /** * Fetch variables directly assigned to a catalog item (cat_item field). * @private */ private _fetchDirectVariables; }