/** * 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 { DocIdentifier } from '../model/DocIdentifier'; import { ListOfIds } from '../model/ListOfIds'; import { Message } from '../model/Message'; import { MessagesReadStatusUpdate } from '../model/MessagesReadStatusUpdate'; import { PaginatedListMessage } from '../model/PaginatedListMessage'; import { AuthenticationProvider } from '../../icc-x-api/auth/AuthenticationProvider'; import { EntityBulkShareResult } from '../model/requests/EntityBulkShareResult'; import { FilterChainMessage } from '../model/FilterChainMessage'; import { AbstractFilterMessage } from '../model/AbstractFilterMessage'; import { BulkShareOrUpdateMetadataParams } from '../model/requests/BulkShareOrUpdateMetadataParams'; 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 IccMessageApi { host: string; _headers: Array; authenticationProvider: AuthenticationProvider; fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise; get headers(): Promise>; constructor(host: string, headers: any, authenticationProvider?: AuthenticationProvider, fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise); setHeaders(h: Array): void; handleError(e: XHR.XHRError): never; /** * @summary Creates a message * @param body */ createMessage(body?: Message): Promise; /** * @summary Deletes a batch of messages. * * @param messageIds a ListOfIds containing the ids of the messages to delete. * @return a Promise that will resolve in an array of DocIdentifiers of the messages successfully deleted */ deleteMessages(messageIds: ListOfIds): Promise>; /** * @summary Deletes a single message by id. * * @param messageId the id of the message to delete. * @return a Promise that will resolve in the DocIdentifier of the deleted message. */ deleteMessage(messageId: string): Promise; /** * * @summary Get all messages (paginated) for current HC Party * @param startKey * @param startDocumentId * @param limit */ findMessages(startKey?: string, startDocumentId?: string, limit?: number): Promise; /** * * @summary Get all messages (paginated) for current HC Party and provided from address * @param fromAddress * @param startKey * @param startDocumentId * @param limit * @param hcpId */ findMessagesByFromAddress(fromAddress?: string, startKey?: string, startDocumentId?: string, limit?: number, hcpId?: string): Promise; /** * @deprecated use {@link listMessageIdsByDataOwnerPatientSentDate} instead. * @summary List messages found By Healthcare Party and secret foreign keys. * @param body */ findMessagesByHCPartyPatientForeignKeysUsingPost(body?: Array): Promise>; /** * Keys must be delimited by commas. * @deprecated use {@link listMessageIdsByDataOwnerPatientSentDate} instead. * @summary List messages found By Healthcare Party and secret foreign keys. * @param secretFKeys */ findMessagesByHCPartyPatientForeignKeys(secretFKeys: string): Promise>; /** * @summary List Message ids by data owner and a set of secret foreign key. The ids will be sorted by Message sent, in ascending or descending * order according to the specified parameter value. * * @param dataOwnerId the data owner id. * @param secretFKeys an array of secret foreign keys. * @param startDate a timestamp in epoch milliseconds. If undefined, all the message ids since the beginning of time will be returned. * @param endDate a timestamp in epoch milliseconds. If undefined, all the message ids until the end of time will be returned. * @param descending whether to return the ids ordered in ascending or descending order by Message sent. * @return a promise that will resolve in an Array of Message ids. */ listMessageIdsByDataOwnerPatientSentDate(dataOwnerId: string, secretFKeys: string[], startDate?: number, endDate?: number, descending?: boolean): Promise; /** * * @summary Get all messages (paginated) for current HC Party and provided to address * @param toAddress * @param startKey * @param startDocumentId * @param limit * @param reverse * @param hcpId */ findMessagesByToAddress(toAddress?: string, startKey?: string, startDocumentId?: string, limit?: number, reverse?: boolean, hcpId?: string): Promise; /** * * @summary Get all messages (paginated) for current HC Party and provided transportGuid * @param transportGuid * @param received * @param startKey * @param startDocumentId * @param limit * @param hcpId */ findMessagesByTransportGuid(transportGuid?: string, received?: boolean, startKey?: string, startDocumentId?: string, limit?: number, hcpId?: string): Promise; /** * * @summary Get all messages starting by a prefix between two date * @param transportGuid * @param from * @param to * @param startKey * @param startDocumentId * @param limit * @param hcpId */ findMessagesByTransportGuidSentDate(transportGuid?: string, from?: number, to?: number, startKey?: string, startDocumentId?: string, limit?: number, hcpId?: string): Promise; /** * * @summary Get children messages of provided message * @param messageId */ getChildrenMessages(messageId: string): Promise>; /** * * @summary Get children messages of provided message * @param body */ getChildrenMessagesOfList(body?: ListOfIds): Promise>; /** * @summary Gets a message * @param messageId */ getMessage(messageId: string): Promise; /** * @summary Gets batch of messages by their ids. * @param messageIds the ids of the messages */ getMessages(messageIds: ListOfIds): Promise; /** * * @summary Get children messages of provided message * @param body */ listMessagesByInvoiceIds(body?: ListOfIds): Promise>; /** * * @summary Get all messages for current HC Party and provided transportGuids * @param body * @param hcpId */ listMessagesByTransportGuids(hcpId: string, body?: ListOfIds): Promise>; /** * * @summary Updates a message * @param body */ modifyMessage(body?: Message): Promise; /** * * @summary Set read status for given list of messages * @param body */ setMessagesReadStatus(body?: MessagesReadStatusUpdate): Promise>; /** * * @summary Set status bits for given list of messages * @param body * @param status */ setMessagesStatusBits(status: number, body?: ListOfIds): Promise>; /** * @internal this method is for internal use only and may be changed without notice */ bulkShareMessages(request: BulkShareOrUpdateMetadataParams): Promise[]>; /** * Returns a list of messages along with next start keys and Document ID. If the nextStartKey is Null it means that this is the last page. * @summary List messages for the current user (HcParty) or the given hcparty in the filter * @param body * @param startDocumentId A Message document ID * @param limit Number of rows * @param collectTiming if true, include server-side filter timing information in the response */ filterMessagesBy(body: FilterChainMessage, startDocumentId?: string, limit?: number, collectTiming?: false): Promise; filterMessagesBy(body: FilterChainMessage, startDocumentId?: string, limit?: number, collectTiming?: true): Promise; /** * * @summary Get ids of messages matching the provided filter for the current user (HcParty) * @param body * @param collectTiming if true, include server-side filter timing information in the response */ matchMessagesBy(body: AbstractFilterMessage, collectTiming?: false): Promise>; matchMessagesBy(body: AbstractFilterMessage, collectTiming?: true): Promise & TimingInfo>; /** * Retrieves the ids of all the messages that currently have conflicting revisions and therefore need to * be resolved. * @summary List the ids of the messages that have conflicts. * @return the ids of the messages with unresolved conflicts. */ getConflictingEntitiesIds(): Promise>; /** * Retrieves all the conflicting revisions of the message with the given id (the current revision is not * included). The returned entities are still encrypted. * @summary Get the conflicting revisions of a message. * @param entityId the id of the message to retrieve the conflicts for. * @return the conflicting revisions of the message. */ getConflictsForEntity(entityId: string): Promise>; /** * Resolves a conflict by declaring which revision of the message 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 message. * @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>; /** * Like {@link getConflictingEntitiesIds} but targets the entities of the group with the given id. * @summary List the ids of the messages that have conflicts, in the given group. * @param groupId the id of the group to look into. * @return the ids of the messages with unresolved conflicts in the group. */ getConflictingEntitiesIdsInGroup(groupId: string): Promise>; /** * Like {@link getConflictsForEntity} but targets the entity of the group with the given id. * @summary Get the conflicting revisions of a message, in the given group. * @param groupId the id of the group the message belongs to. * @param entityId the id of the message to retrieve the conflicts for. * @return the conflicting revisions of the message. */ getConflictsForEntityInGroup(groupId: string, entityId: string): Promise>; /** * Like {@link declareConflictWinner} but targets the entity of the group with the given id. * @summary Declare the winning revision of a conflicting message, in the given group. * @param groupId the id of the group the message belongs to. * @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. */ declareConflictWinnerInGroup(groupId: string, body: ConflictResolutionRequest): Promise>; /** * Automatically resolves the conflicting revisions of the messages with the given ids, according to the provided * {@link ConflictResolutionStrategy}. * @summary Automatically solve the conflicts of the messages with the given ids. * @param entityIds the ids of the messages 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 messages with the given ids, in the given group. * @param groupId the id of the group to look into. * @param entityIds the ids of the messages 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>; }