import { ServiceNowInstance } from "../ServiceNowInstance.js"; import { KnowledgeBaseRecord, KnowledgeBaseDetail, KnowledgeCategoryRecord, KnowledgeArticleRecord, KnowledgeArticleSummary, ListKnowledgeBasesOptions, ListCategoriesOptions, CreateCategoryOptions, ListArticlesOptions, CreateArticleOptions, UpdateArticleOptions } from './KnowledgeModels.js'; /** * Provides operations for managing ServiceNow Knowledge Base articles, * knowledge bases, and categories via the Table API and Stats API. */ export declare class KnowledgeManager { private static readonly KB_BASE_TABLE; private static readonly KB_CATEGORY_TABLE; private static readonly KB_KNOWLEDGE_TABLE; /** Fields to return in list operations (excludes large body fields) */ private static readonly ARTICLE_LIST_FIELDS; private _logger; private _req; private _tableAPI; private _aggregateQuery; private _instance; constructor(instance: ServiceNowInstance); /** * List knowledge bases with optional filtering and pagination. * * @param options Filtering and pagination options * @returns Array of knowledge base records * @throws Error if the API call fails */ listKnowledgeBases(options?: ListKnowledgeBasesOptions): Promise; /** * Get details of a specific knowledge base including article and category counts. * * @param sysId The sys_id of the knowledge base * @returns Knowledge base detail with article and category counts * @throws Error if the sys_id is empty, the KB is not found, or the API call fails */ getKnowledgeBase(sysId: string): Promise; /** * List categories within a knowledge base with optional filtering. * * @param options Filtering and pagination options * @returns Array of category records * @throws Error if the API call fails */ listCategories(options?: ListCategoriesOptions): Promise; /** * Create a new knowledge base category. * * @param options Category creation options * @returns The created category record * @throws Error if required fields are missing or the API call fails */ createCategory(options: CreateCategoryOptions): Promise; /** * List knowledge articles with filtering by KB, category, workflow state, and text search. * Returns article summaries (without large body fields) for efficiency. * * @param options Filtering and pagination options * @returns Array of article summaries * @throws Error if the API call fails */ listArticles(options?: ListArticlesOptions): Promise; /** * Get full article content including body text. * * @param sysId The sys_id of the article * @returns The full article record * @throws Error if the sys_id is empty, the article is not found, or the API call fails */ getArticle(sysId: string): Promise; /** * Create a new knowledge article. * * @param options Article creation options * @returns The created article record * @throws Error if required fields are missing or the API call fails */ createArticle(options: CreateArticleOptions): Promise; /** * Update an existing knowledge article. * * @param sysId The sys_id of the article to update * @param options Fields to update * @returns The updated article record * @throws Error if the sys_id is empty, no fields are provided, or the API call fails */ updateArticle(sysId: string, options: UpdateArticleOptions): Promise; /** * Publish a draft article by setting its workflow_state to "published". * * @param sysId The sys_id of the article to publish * @returns The updated article record * @throws Error if the sys_id is empty or the API call fails */ publishArticle(sysId: string): Promise; }