UNPKG

@apihawk/help-center-sdk

Version:

The ApiHawk Help Center SDK

84 lines (83 loc) 3.1 kB
import { ApiHawkConnectorService } from '@apihawk/connector'; import { HelpCenterSDKServiceBase } from '../lib/help-center-sdk-service-base'; import { ICategoryBreadcrumbResult, IHelpCenterCategory } from './help-center-sdk.types'; export declare class HelpCenterSDKCategories extends HelpCenterSDKServiceBase { private helpCenterSDKArticles; constructor(api: ApiHawkConnectorService); /** * Fetches the tree of categories. * @param {string|number} query.rootId - the category ID from which the tree will start * @param {number} query.nestingLevel - how deep the three will be walked over (-1 => no limits) * @param {string} query.lang - the language for the content * @param query * @param rootCategoryUrl - the root of the categories */ getTree(query?: { rootId?: number; nestingLevel?: number; lang?: string; }, rootCategoryUrl?: string): Promise<any>; /** * Get category * @param {number} id * @returns {Promise<IHelpCenterCategory>} */ getCategory(id: number): Promise<IHelpCenterCategory>; /** * Fetches the "root" category. * The root category is like a scope for the help center - only * categories and articles which belong to it are visible. * * @returns {Promise} - the root category */ getRoot(rootCategoryUrl: string): Promise<IHelpCenterCategory>; /** * Get * @param {string} categorySeoUrl * @returns {Promise<IHelpCenterCategory>} */ getBySeoUrl(categorySeoUrl: string): Promise<IHelpCenterCategory>; /** * * @param {number} categoryId * @param {number} page * @param {number} pageSize * @returns {Promise<void>} */ getArticleIdsFromCategory(categoryId: number, page?: number, pageSize?: number): Promise<import("../types/common").IRestPaginatedResource<import("./help-center-sdk.types").IContent2Category>>; /** * Get category breadcrumbs * @param {number} categoryId * @returns {Promise<ICategoryBreadcrumbResult>} */ getBreadcrumbs(categoryId: number): Promise<ICategoryBreadcrumbResult>; /** * Collects article IDs to be fetched by walking the * tree of categories and checking whether a category's * subcategory articles should be fetched as well. * * (yes) -> fetch subarticles * (no) -> do not fetch subarticles * * -- Products (yes) <--- STARTING CATEGORY * ---- Syme (no) * ------ Syme Linux (no) * ------ Syme Windows (no) * ---- Billia (yes) * ------ HelpCenter (no) * -------- Creating Articles (no) * -------- Creating Categories (no) * ------ Payments (yes) * -------- Card Payments (no) * -------- Bank Payments (no) * * Should get the IDs for the following categories: * * Products, Syme, Billia, HelpCenter, Payments, Card Payments, Bank Payments * * @param {Array} categoryTree - tree of categories * * @returns {Array<string>} - list of article IDs */ private collectArticleIdsToFetch; }