/** * iCure Data Stack API Documentation * The iCure Data Stack Application API is the native interface to iCure. This version is obsolete, please use v2. * * OpenAPI spec version: v1 * * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ import { XHR } from './XHR'; import { AbstractFilterUser } from '../model/AbstractFilterUser'; import { DocIdentifier } from '../model/DocIdentifier'; import { FilterChainUser } from '../model/FilterChainUser'; import { PaginatedListUser } from '../model/PaginatedListUser'; import { PropertyStub } from '../model/PropertyStub'; import { TokenWithGroup } from '../model/TokenWithGroup'; import { Unit } from '../model/Unit'; import { User } from '../model/User'; import { UserGroup } from '../model/UserGroup'; import { AuthenticationProvider } from '../../icc-x-api/auth/AuthenticationProvider'; import { ListOfIds } from '../model/ListOfIds'; import { TimingInfo } from '../model/TimingInfo'; import { ConflictResolutionRequest } from '../model/ConflictResolutionRequest'; import { ConflictResolutionResult } from '../model/ConflictResolutionResult'; import { ConflictResolutionStrategy } from '../model/ConflictResolutionStrategy'; import { MergeResult } from '../model/MergeResult'; export declare class IccUserApi { host: string; headers: Array; authenticationProvider: AuthenticationProvider; fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise; constructor(host: string, headers: any, authenticationProvider?: AuthenticationProvider, fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise); setHeaders(h: Array): void; handleError(e: XHR.XHRError): never; /** * UserDto gets returned. * @summary Assign a healthcare party ID to current user * @param healthcarePartyId */ assignHealthcareParty(healthcarePartyId: string): Promise; /** * * @summary Check token validity * @param userId * @param token */ checkTokenValidity(userId: string, token: string): Promise; /** * Create a user. HealthcareParty ID should be set. Email or Login have to be set. If login hasn't been set, Email will be used for Login instead. * @summary Create a user * @param body */ createUser(body?: User): Promise; /** * Create a user. HealthcareParty ID should be set. Email has to be set and the Login has to be null. On server-side, Email will be used for Login. * @summary Create a user * @param body * @param groupId */ createUserInGroup(groupId: string, body?: User): Promise; /** * @summary Creates a new admin user in the group of the current user. * @param body the user to create. * @return a promise that will resolve to the created user. */ createAdminUser(body?: User): Promise; /** * @summary Creates a new admin user in a group of the current user. * @param body the user to create. * @param groupId the id of the group where to create the user. * @return a promise that will resolve to the created user. */ createAdminUserInGroup(groupId: string, body?: User): Promise; /** * Delete a User based on his/her ID. The return value is an array containing the ID of deleted user. * @summary Delete a User based on his/her ID. * @param userId */ deleteUser(userId: string): Promise; /** * Delete a User based on his/her ID. The return value is an array containing the ID of deleted user. * @summary Delete a User based on his/her ID. * @param groupId * @param userId */ deleteUserInGroup(groupId: string, userId: string): Promise; /** * * @param password */ encodePassword(password: string): Promise; /** * Returns a list of users along with next start keys and Document ID. If the nextStartKey is Null it means that this is the last page. * @summary Filter users for the current user (HcParty) * @param body * @param startDocumentId A User document ID * @param limit Number of rows * @param collectTiming if true, include server-side filter timing information in the response */ filterUsersBy(startDocumentId?: string, limit?: number, body?: FilterChainUser, collectTiming?: false): Promise; filterUsersBy(startDocumentId?: string, limit?: number, body?: FilterChainUser, collectTiming?: true): Promise; /** * Returns a list of users along with next start keys and Document ID. If the nextStartKey is Null it means that this is the last page. * @summary Filter users for the current user (HcParty) for a provided groupId * @param body * @param groupId * @param startDocumentId A User document ID * @param limit Number of rows * @param collectTiming if true, include server-side filter timing information in the response */ filterUsersInGroupBy(groupId: string, startDocumentId?: string, limit?: number, body?: FilterChainUser, collectTiming?: false): Promise; filterUsersInGroupBy(groupId: string, startDocumentId?: string, limit?: number, body?: FilterChainUser, collectTiming?: true): Promise; /** * * @summary Get the list of users by healthcare party id * @param id */ findByHcpartyId(id: string): Promise>; /** * * @summary Get the list of users by patient id * @param id */ findByPatientId(id: string): Promise>; /** * Get current user. * @summary Get presently logged-in user. */ getCurrentUser(): Promise; /** * Get current user. * @summary Get presently logged-in user. */ getMatchingUsers(): Promise>; /** * * @summary Request a new temporary token for authentication * @param userId * @param key The token key. Only one instance of a token with a defined key can exist at the same time * @param tokenValidity The token validity in seconds * @param token */ getToken(userId: string, key: string, tokenValidity?: number, token?: string): Promise; /** * * @summary Require a new temporary token for authentication inside all groups * @param userIdentifier * @param key The token key. Only one instance of a token with a defined key can exist at the same time * @param token * @param tokenValidity The token validity in seconds */ getTokenInAllGroups(userIdentifier: string, key: string, token?: string, tokenValidity?: number): Promise>; /** * * @summary Require a new temporary token for authentication inside provided group * @param groupId * @param userId * @param key The token key. Only one instance of a token with a defined key can exist at the same time * @param token * @param tokenValidity The token validity in seconds */ getTokenInGroup(groupId: string, userId: string, key: string, token?: string, tokenValidity?: number): Promise; /** * General information about the user * @summary Get a user by his ID * @param userId */ getUser(userId: string): Promise; /** * @summary Sets the roles of a user to the ones passed as parameter. * * @param userId the Id of the user to update. * @param roleIds the ids of the roles to add to the user. */ setRoles(userId: string, roleIds: string[]): Promise; /** * @summary Sets the roles of a user in a group to the ones passed as parameter. * * @param userId the Id of the user to update. * @param groupId the Id of the group the user belongs to. * @param roleIds the ids of the roles to add to the user. */ setRolesInGroup(userId: string, groupId: string, roleIds: string[]): Promise; /** * @summary Reset the roles of a user to the default ones for their type. * * @param userId the Id of the user to update. */ resetRoles(userId: string): Promise; /** * @summary Reset the roles of a user in a group to the default ones for their type. * * @param userId the Id of the user to update. * @param groupId the Id of the group the user belongs to. */ resetRolesInGroup(userId: string, groupId: string): Promise; /** * General information about the user * @summary Get a user by his Email/Login * @param email */ getUserByEmail(email: string): Promise; /** * @summary Get a user by his phone number. * @param phoneNumber * @return a promise that resolves to the specified user. */ getUserByPhoneNumber(phoneNumber: string): Promise; /** * Returns a list of users. * @summary List users with(out) pagination * @param startKey An user email * @param startDocumentId An user document ID * @param limit Number of rows * @param skipPatients Filter out patient users */ listUsers(startKey?: string, startDocumentId?: string, limit?: number, skipPatients?: boolean): Promise; /** * Returns a list of users. * @summary List users with pagination * @param groupId * @param startKey An user login * @param startDocumentId An user document ID * @param limit Number of rows */ listUsersInGroup(groupId: string, startKey?: string, startDocumentId?: string, limit?: number): Promise; /** * * @summary Get ids of healthcare party matching the provided filter for the current user (HcParty) * @param body * @param collectTiming if true, include server-side filter timing information in the response */ matchUsersBy(body?: AbstractFilterUser, collectTiming?: false): Promise>; matchUsersBy(body?: AbstractFilterUser, collectTiming?: true): Promise & TimingInfo>; /** * Modify a User properties based on his/her ID. The return value is the modified user. * @summary Modify a User property * @param body * @param userId */ modifyProperties(userId: string, body?: Array): Promise; /** * No particular return value. It's just a message. * @summary Modify a user. * @param body */ modifyUser(body?: User): Promise; /** * No particular return value. It's just a message. * @summary Modify a user. * @param body * @param groupId */ modifyUserInGroup(groupId: string, body?: User): Promise; enable2fa(userId: string, secret: string, otp: string, otpLength: number): Promise; enableFasAuthenticationForUser(fasJwtToken: string): Promise; revokeFasAuthenticationForUser(fasJwtToken: string): Promise; disable2fa(userId: string): Promise; getUsers(body?: ListOfIds): Promise>; /** * Retrieves the ids of all the users that currently have conflicting revisions and therefore need to * be resolved. * @summary List the ids of the users that have conflicts. * @return the ids of the users with unresolved conflicts. */ getConflictingEntitiesIds(): Promise>; /** * Retrieves all the conflicting revisions of the user with the given id (the current revision is not * included). The returned entities are still encrypted. * @summary Get the conflicting revisions of a user. * @param entityId the id of the user to retrieve the conflicts for. * @return the conflicting revisions of the user. */ getConflictsForEntity(entityId: string): Promise>; /** * Resolves a conflict by declaring which revision of the user should be kept as winner and which * conflicting revisions should be purged. The provided document must already be encrypted. * @summary Declare the winning revision of a conflicting user. * @param body the {@link ConflictResolutionRequest} carrying the winning revision and the conflicts to purge. * @return the {@link ConflictResolutionResult} with the saved winner and the conflicts that are still unresolved. */ declareConflictWinner(body: ConflictResolutionRequest): Promise>; /** * Automatically resolves the conflicting revisions of the users with the given ids, according to the provided * {@link ConflictResolutionStrategy}. * @summary Automatically solve the conflicts of the users with the given ids. * @param entityIds the ids of the users to solve the conflicts for. * @param strategy the {@link ConflictResolutionStrategy} to use to resolve the conflicts. Defaults to `FullMergeability`. * @return the {@link MergeResult} of the conflict resolution for each requested entity. */ autoSolveConflicts(entityIds: Array, strategy?: ConflictResolutionStrategy): Promise>; /** * Like {@link autoSolveConflicts} but targets the entities of the group with the given id. * @summary Automatically solve the conflicts of the users with the given ids, in the given group. * @param groupId the id of the group to look into. * @param entityIds the ids of the users to solve the conflicts for. * @param strategy the {@link ConflictResolutionStrategy} to use to resolve the conflicts. Defaults to `FullMergeability`. * @return the {@link MergeResult} of the conflict resolution for each requested entity. */ autoSolveConflictsInGroup(groupId: string, entityIds: Array, strategy?: ConflictResolutionStrategy): Promise>; }