UNPKG

@alfresco/adf-content-services

Version:
87 lines (86 loc) 3 kB
import { Observable } from 'rxjs'; import { AuthenticationService } from '@alfresco/adf-core'; import { Pagination, PeopleApi, PersonBodyCreate, PersonBodyUpdate } from '@alfresco/js-api'; import { EcmUserModel } from '../models/ecm-user.model'; import { ContentService } from './content.service'; import { AlfrescoApiService } from '../../services/alfresco-api.service'; import * as i0 from "@angular/core"; export interface PeopleContentQueryResponse { pagination: Pagination; entries: EcmUserModel[]; } export interface PeopleContentSortingModel { orderBy: string; direction: string; } export interface PeopleContentQueryRequestModel { skipCount?: number; maxItems?: number; sorting?: PeopleContentSortingModel; } export declare class PeopleContentService { private apiService; private contentService; private currentUser; private _peopleApi; get peopleApi(): PeopleApi; constructor(apiService: AlfrescoApiService, authenticationService: AuthenticationService, contentService: ContentService); /** * Gets information about a user identified by their username. * * @param personId ID of the target user * @returns User information */ getPerson(personId: string): Observable<EcmUserModel>; getCurrentPerson(): Observable<EcmUserModel>; /** * Gets information about the current user alias -me- * * @returns User information */ getCurrentUserInfo(): Observable<EcmUserModel>; /** * Used to know if the current user has the admin capability * * @returns true or false */ isCurrentUserAdmin(): boolean; /** * Reset the local current user object */ resetLocalCurrentUser(): void; /** * Gets a list of people. * * @param requestQuery maxItems and skipCount parameters supported by JS-API * @returns Response containing pagination and list of entries */ listPeople(requestQuery?: PeopleContentQueryRequestModel): Observable<PeopleContentQueryResponse>; /** * Creates new person. * * @param newPerson Object containing the new person details. * @param opts Optional parameters * @returns Created new person */ createPerson(newPerson: PersonBodyCreate, opts?: any): Observable<EcmUserModel>; /** * Updates the person details * * @param personId The identifier of a person * @param details The person details * @param opts Optional parameters * @returns Updated person model */ updatePerson(personId: string, details: PersonBodyUpdate, opts?: any): Observable<EcmUserModel>; /** * Returns a profile image as a URL. * * @param avatarId Target avatar * @returns Image URL */ getUserProfileImage(avatarId: string): string; private buildOrderArray; static ɵfac: i0.ɵɵFactoryDeclaration<PeopleContentService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<PeopleContentService>; }