UNPKG

@alfresco/adf-content-services

Version:
100 lines (99 loc) 4.3 kB
import { AppConfigService, UserPreferencesService } from '@alfresco/adf-core'; import { CategoriesApi, CategoryBody, CategoryEntry, CategoryLinkBody, CategoryPaging, ResultSetPaging, SearchApi } from '@alfresco/js-api'; import { AlfrescoApiService } from '../../services/alfresco-api.service'; import { Observable } from 'rxjs'; import * as i0 from "@angular/core"; export declare class CategoryService { private apiService; private userPreferencesService; private appConfigService; private _categoriesApi; private _searchApi; get categoriesApi(): CategoriesApi; get searchApi(): SearchApi; constructor(apiService: AlfrescoApiService, userPreferencesService: UserPreferencesService, appConfigService: AppConfigService); /** * Get subcategories of a given parent category * * @param parentCategoryId The identifier of a parent category. * @param skipCount Number of top categories to skip. * @param maxItems Maximum number of subcategories returned from Observable. * @returns Observable<CategoryPaging> */ getSubcategories(parentCategoryId: string, skipCount?: number, maxItems?: number): Observable<CategoryPaging>; /** * Get a category by ID * * @param categoryId The identifier of a category. * @param opts Optional parameters. * @param opts.fields A list of field names. * @param opts.include Returns additional information about the category. The following optional fields can be requested: * count * path * @returns Observable<CategoryEntry> */ getCategory(categoryId: string, opts?: any): Observable<CategoryEntry>; /** * Creates subcategories under category with provided categoryId * * @param parentCategoryId The identifier of a parent category. * @param payload List of categories to be created. * @returns Observable<CategoryPaging | CategoryEntry> */ createSubcategories(parentCategoryId: string, payload: CategoryBody[]): Observable<CategoryPaging | CategoryEntry>; /** * Updates category * * @param categoryId The identifier of a category. * @param payload Updated category body * @returns Observable<CategoryEntry> */ updateCategory(categoryId: string, payload: CategoryBody): Observable<CategoryEntry>; /** * Deletes category * * @param categoryId The identifier of a category. * @returns Observable<void> */ deleteCategory(categoryId: string): Observable<void>; /** * Searches categories by their name. * * @param name Value for name which should be used during searching categories. * @param skipCount Specify how many first results should be skipped. Default 0. * @param maxItems Specify max number of returned categories. Default is specified by UserPreferencesService. * @returns Observable<ResultSetPaging> Found categories which name contains searched name. */ searchCategories(name: string, skipCount?: number, maxItems?: number): Observable<ResultSetPaging>; /** * List of categories that node is assigned to * * @param nodeId The identifier of a node. * @returns Observable<CategoryPaging> Categories that node is assigned to */ getCategoryLinksForNode(nodeId: string): Observable<CategoryPaging>; /** * Unlink category from a node * * @param nodeId The identifier of a node. * @param categoryId The identifier of a category. * @returns Observable<void> */ unlinkNodeFromCategory(nodeId: string, categoryId: string): Observable<void>; /** * Link node to a category * * @param nodeId The identifier of a node. * @param categoryLinkBodyCreate Array of a categories that node will be linked to. * @returns Observable<CategoryEntry> */ linkNodeToCategory(nodeId: string, categoryLinkBodyCreate: CategoryLinkBody[]): Observable<CategoryPaging | CategoryEntry>; /** * Checks if categories plugin is enabled. * * @returns boolean true if categories plugin is enabled, false otherwise. */ areCategoriesEnabled(): boolean; static ɵfac: i0.ɵɵFactoryDeclaration<CategoryService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<CategoryService>; }