/** * 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 { Document } from '../model/Document'; import { ListOfIds } from '../model/ListOfIds'; import { AuthenticationProvider } from '../../icc-x-api/auth/AuthenticationProvider'; import { EntityBulkShareResult } from '../model/requests/EntityBulkShareResult'; import { BulkShareOrUpdateMetadataParams } from '../model/requests/BulkShareOrUpdateMetadataParams'; import { PaginatedListDocument } from '../model/PaginatedListDocument'; import { AbstractFilterDocument } from '../model/AbstractFilterDocument'; 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 IccDocumentApi { 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; /** * Creates a document and returns an instance of created document afterward * @summary Create a document * @param body */ createDocument(body?: Document): Promise; /** * Deletes a document's attachment and returns the modified document instance afterward * @summary Delete a document's attachment * @param documentId * @param documentRev */ deleteAttachment(documentId: string, documentRev: string): Promise; /** * @summary Deletes a batch of documents and returns the list of deleted document ids. * * @param documentIds a ListOfIds containing the ids of the documents to delete. * @return a Promise that will resolve in an array of DocIdentifier of the successfully deleted documents. */ deleteDocuments(documentIds: ListOfIds): Promise>; /** * @summary Deletes a single document by id. * * @param documentId the id of the document to delete. * @return a DocIdentifier of the document. */ deleteDocument(documentId: string): Promise; /** * @summary Purges a single document, also purging any attachment linked to it. * * @param document the document to purge. * @return a DocIdentifier of the document. */ purgeDocument(document: Document): Promise; /** * Keys must be delimited by coma * @deprecated use {@link findDocumentIdsByDataOwnerSecretForeignKey} instead. * @summary List documents found By type, By Healthcare Party and secret foreign keys. * @param documentTypeCode * @param hcPartyId * @param secretFKeys */ findByTypeHCPartyMessageSecretFKeys(documentTypeCode: string, hcPartyId: string, secretFKeys: string[]): Promise>; /** * Keys must be delimited by commas. * @deprecated use {@link findDocumentIdsByDataOwnerSecretForeignKey} instead. * @summary List documents found By Healthcare Party and secret foreign keys. * @param hcPartyId * @param secretFKeys */ findDocumentsByHCPartyPatientForeignKeys(hcPartyId: string, secretFKeys: string[]): Promise>; /** * @summary List documents found By Healthcare Party and a single secret foreign key with pagination. * @deprecated use {@link findDocumentIdsByDataOwnerSecretForeignKey} instead. * @param hcPartyId the healthcare party id. * @param secretFKey the secret foreign key. * @param startKey the startKey provided by the previous page or undefined for the first page. * @param startDocumentId the startDocumentId provided by the previous page or undefined for the first page. * @param limit the number of elements that the page should contain. * @return a promise that will resolve in a PaginatedListDocument. */ findDocumentsByHCPartyPatientForeignKey(hcPartyId: string, secretFKey: string, startKey?: string, startDocumentId?: string, limit?: number): Promise; findDocumentIdsByDataOwnerSecretForeignKey(dataOwnerId: string, secretForeignKeys: string[], startDate?: number, endDate?: number, descending?: boolean): Promise; /** * Keys must be delimited by commas. * @summary List documents with no delegation * @param limit */ findWithoutDelegation(limit?: number): Promise>; /** * Returns the document corresponding to the identifier passed in the request * @summary Get a document * @param documentId */ getDocument(documentId: string): Promise; /** * @deprecated use getMainDocumentAttachment instead */ getDocumentAttachment(documentId: string, attachmentId: string, enckeys?: string, fileName?: string): Promise; /** * Get the main attachment of a document * @param documentId id of the document * @return the content of the main attachment for the document (if any) */ getMainDocumentAttachment(documentId: string): Promise; /** * Get the main attachment of a document forcing usage of `application/octet-stream` in Content-Type * @param documentId id of the document * @return the content of the main attachment for the document (if any) */ getRawMainDocumentAttachment(documentId: string): Promise; /** * Returns the first document corresponding to the externalUuid passed in the request * @summary Get a document * @param externalUuid */ getDocumentByExternalUuid(externalUuid: string): Promise; /** * Returns a list of document corresponding to the identifiers passed in the body * @summary Get a batch of document * @param body */ getDocuments(body?: ListOfIds): Promise>; /** * Returns a list of document corresponding to the externalUuid passed in the request * @summary Get all documents with externalUuid * @param externalUuid */ getDocumentsByExternalUuid(externalUuid: string): Promise>; /** * Updates the document and returns an instance of the modified document afterward * @summary Update a document * @param body */ modifyDocument(body?: Document): Promise; /** * Returns the modified documents. * @summary Update a batch of documents * @param body */ modifyDocuments(body?: Array): Promise>; /** * Creates or updates a main attachment for a document and returns the modified document instance afterward * @param documentId id of the document * @param documentRev revision of the document * @param body content of the attachment (must be compatible with XHR body) * @param utis an array of UTIs for the attachment. The first element will be considered as the main UTI for the document. If provided and non-empty * overrides existing values. * @param dataIsEncrypted set this to true if the body you provided is containing encrypted data. This helps to have the appropriate content type * for the attachment. Defaults is false * @param compressionAlgorithm the client-side compression algorithm used on the data, if any (e.g. 'lzma2'). Null/undefined if no compression was applied. * @param triedCompressionAlgorithmsVersion a version string indicating which compression algorithms were tried by the SDK, used to decide whether * re-compression with newer algorithms should be attempted on read. * @param realDataSize the size in bytes of the original data before compression and encryption, used for informational purposes. */ setMainDocumentAttachment(documentId: string, documentRev: string, body: Object, utis?: Array, dataIsEncrypted?: boolean, compressionAlgorithm?: string, triedCompressionAlgorithmsVersion?: string, realDataSize?: number): Promise; /** * @deprecated use setMainDocumentAttachment instead */ setDocumentAttachmentBody(documentId: string, documentRev: string, enckeys?: null, body?: Object, utis?: string[]): Promise; /** * @deprecated use setMainDocumentAttachment instead */ setDocumentAttachment(documentId: string, documentRev: string, enckeys?: null, body?: Object, utis?: string[]): Promise; /** * @deprecated use setMainDocumentAttachment instead */ setDocumentAttachmentMulti(attachment: ArrayBuffer, documentRev: string, documentId: string, enckeys?: null): Promise; /** * Creates or updates a secondary attachment for a document and returns the modified document instance afterward * @summary Creates or modifies a secondary attachment for a document * @param documentId id of the document to update * @param key Key of the secondary attachment to update * @param rev Revision of the latest known version of the document. If the revision does not match the current version of the document the method * will fail with CONFLICT status * @param attachment * @param utis an array of UTIs for the attachment. If provided and non-empty overrides existing values. * @param dataIsEncrypted set this to true if the body you provided is containing encrypted data. This helps to have the appropriate content type * for the attachment. Defaults is false * @param compressionAlgorithm the client-side compression algorithm used on the data, if any (e.g. 'lzma'). Null/undefined if no compression was applied. * @param triedCompressionAlgorithmsVersion a version string indicating which compression algorithms were tried by the SDK, used to decide whether * re-compression with newer algorithms should be attempted on read. * @param realDataSize the size in bytes of the original data before compression and encryption, used for informational purposes. * @return the updated document */ setSecondaryAttachment(documentId: string, key: string, rev: string, attachment: Object, utis?: Array, dataIsEncrypted?: boolean, compressionAlgorithm?: string, triedCompressionAlgorithmsVersion?: string, realDataSize?: number): Promise; /** * Get the secondary attachment with the provided key for a document * @summary Retrieve a secondary attachment of a document * @param documentId id of the document * @param key Key of the secondary attachment to retrieve * @param fileName * @return the content of the attachment */ getSecondaryAttachment(documentId: string, key: string, fileName?: string): Promise; /** * Deletes a document's attachment and returns the modified document instance afterward * @summary Delete a document's attachment * @param documentId id of the document * @param key Key of the secondary attachment to delete * @param rev Revision of the latest known version of the document. If the revision does not match the current version of the document the method will fail with CONFLICT status * @return the updated document */ deleteSecondaryAttachment(documentId: string, key: string, rev: string): Promise; /** * @internal this method is for internal use only and may be changed without notice */ bulkShareDocument(request: BulkShareOrUpdateMetadataParams): Promise[]>; matchDocumentsBy(body?: AbstractFilterDocument, collectTiming?: false): Promise>; matchDocumentsBy(body?: AbstractFilterDocument, collectTiming?: true): Promise & TimingInfo>; /** * Retrieves the ids of all the documents that currently have conflicting revisions and therefore need to * be resolved. * @summary List the ids of the documents that have conflicts. * @return the ids of the documents with unresolved conflicts. */ getConflictingEntitiesIds(): Promise>; /** * Retrieves all the conflicting revisions of the document with the given id (the current revision is not * included). The returned entities are still encrypted. * @summary Get the conflicting revisions of a document. * @param entityId the id of the document to retrieve the conflicts for. * @return the conflicting revisions of the document. */ getConflictsForEntity(entityId: string): Promise>; /** * Resolves a conflict by declaring which revision of the document 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 document. * @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 documents that have conflicts, in the given group. * @param groupId the id of the group to look into. * @return the ids of the documents 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 document, in the given group. * @param groupId the id of the group the document belongs to. * @param entityId the id of the document to retrieve the conflicts for. * @return the conflicting revisions of the document. */ 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 document, in the given group. * @param groupId the id of the group the document 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 documents with the given ids, according to the provided * {@link ConflictResolutionStrategy}. * @summary Automatically solve the conflicts of the documents with the given ids. * @param entityIds the ids of the documents 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 documents with the given ids, in the given group. * @param groupId the id of the group to look into. * @param entityIds the ids of the documents 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>; }