@icure/api 8.6.15 → 8.6.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/icc-api/api/IccAccesslogApi.d.ts +7 -2
  2. package/icc-api/api/IccAccesslogApi.js +8 -19
  3. package/icc-api/api/IccAccesslogApi.js.map +1 -1
  4. package/icc-api/api/IccCodeApi.d.ts +11 -3
  5. package/icc-api/api/IccCodeApi.js +10 -31
  6. package/icc-api/api/IccCodeApi.js.map +1 -1
  7. package/icc-api/api/IccContactApi.d.ts +13 -4
  8. package/icc-api/api/IccContactApi.js +16 -40
  9. package/icc-api/api/IccContactApi.js.map +1 -1
  10. package/icc-api/api/IccDeviceApi.d.ts +7 -2
  11. package/icc-api/api/IccDeviceApi.js +6 -18
  12. package/icc-api/api/IccDeviceApi.js.map +1 -1
  13. package/icc-api/api/IccDocumentApi.d.ts +3 -1
  14. package/icc-api/api/IccDocumentApi.js +4 -4
  15. package/icc-api/api/IccDocumentApi.js.map +1 -1
  16. package/icc-api/api/IccHcpartyApi.d.ts +7 -2
  17. package/icc-api/api/IccHcpartyApi.js +7 -19
  18. package/icc-api/api/IccHcpartyApi.js.map +1 -1
  19. package/icc-api/api/IccHelementApi.d.ts +7 -2
  20. package/icc-api/api/IccHelementApi.js +8 -20
  21. package/icc-api/api/IccHelementApi.js.map +1 -1
  22. package/icc-api/api/IccInsuranceApi.d.ts +4 -1
  23. package/icc-api/api/IccInsuranceApi.js +4 -9
  24. package/icc-api/api/IccInsuranceApi.js.map +1 -1
  25. package/icc-api/api/IccInvoiceApi.d.ts +4 -1
  26. package/icc-api/api/IccInvoiceApi.js +4 -9
  27. package/icc-api/api/IccInvoiceApi.js.map +1 -1
  28. package/icc-api/api/IccMaintenanceTaskApi.d.ts +4 -1
  29. package/icc-api/api/IccMaintenanceTaskApi.js +4 -11
  30. package/icc-api/api/IccMaintenanceTaskApi.js.map +1 -1
  31. package/icc-api/api/IccMessageApi.d.ts +7 -2
  32. package/icc-api/api/IccMessageApi.js +8 -20
  33. package/icc-api/api/IccMessageApi.js.map +1 -1
  34. package/icc-api/api/IccPatientApi.d.ts +7 -2
  35. package/icc-api/api/IccPatientApi.js +8 -24
  36. package/icc-api/api/IccPatientApi.js.map +1 -1
  37. package/icc-api/api/IccTarificationApi.d.ts +4 -1
  38. package/icc-api/api/IccTarificationApi.js +4 -9
  39. package/icc-api/api/IccTarificationApi.js.map +1 -1
  40. package/icc-api/api/IccTopicApi.d.ts +7 -2
  41. package/icc-api/api/IccTopicApi.js +8 -20
  42. package/icc-api/api/IccTopicApi.js.map +1 -1
  43. package/icc-api/api/IccUserApi.d.ts +10 -3
  44. package/icc-api/api/IccUserApi.js +9 -29
  45. package/icc-api/api/IccUserApi.js.map +1 -1
  46. package/icc-api/api/XHR.d.ts +7 -2
  47. package/icc-api/api/XHR.js +30 -4
  48. package/icc-api/api/XHR.js.map +1 -1
  49. package/icc-api/model/TimingInfo.d.ts +5 -0
  50. package/icc-api/model/TimingInfo.js +3 -0
  51. package/icc-api/model/TimingInfo.js.map +1 -0
  52. package/icc-api/model/models.d.ts +1 -0
  53. package/icc-api/model/models.js +1 -0
  54. package/icc-api/model/models.js.map +1 -1
  55. package/icc-x-api/icc-contact-x-api.d.ts +7 -3
  56. package/icc-x-api/icc-contact-x-api.js +4 -20
  57. package/icc-x-api/icc-contact-x-api.js.map +1 -1
  58. package/icc-x-api/icc-helement-x-api.d.ts +4 -2
  59. package/icc-x-api/icc-helement-x-api.js +2 -10
  60. package/icc-x-api/icc-helement-x-api.js.map +1 -1
  61. package/icc-x-api/icc-maintenance-task-x-api.d.ts +3 -2
  62. package/icc-x-api/icc-maintenance-task-x-api.js +2 -2
  63. package/icc-x-api/icc-maintenance-task-x-api.js.map +1 -1
  64. package/icc-x-api/icc-message-x-api.d.ts +4 -2
  65. package/icc-x-api/icc-message-x-api.js +3 -11
  66. package/icc-x-api/icc-message-x-api.js.map +1 -1
  67. package/icc-x-api/icc-patient-x-api.d.ts +4 -2
  68. package/icc-x-api/icc-patient-x-api.js +2 -14
  69. package/icc-x-api/icc-patient-x-api.js.map +1 -1
  70. package/icc-x-api/icc-topic-x-api.d.ts +4 -2
  71. package/icc-x-api/icc-topic-x-api.js +3 -10
  72. package/icc-x-api/icc-topic-x-api.js.map +1 -1
  73. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"icc-message-x-api.js","sourceRoot":"","sources":["../../icc-x-api/icc-message-x-api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wCAAsD;AAGtD,kDAAiD;AAGjD,0EAAgG;AAChG,wEAAoE;AAOpE,IAAO,eAAe,GAAG,mCAAgB,CAAC,eAAe,CAAA;AAGzD,mCAAmJ;AACnJ,4DAAwE;AACxE,kEAA8D;AAI9D,MAAa,cAAe,SAAQ,uBAAa;IAG/C,IAAI,OAAO;QACT,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,wBAAwB,CAAC,2BAA2B,CAAC,CAAC,EAAE,oCAA4B,CAAC,OAAO,CAAC,CAAC,CAAA;IAC7I,CAAC;IAED,YACE,IAAY,EACZ,OAAkC,EACjB,MAAqB,EACrB,YAA8B,EAC9B,OAAmB,EACnB,cAAuB,EACxC,yBAAiD,IAAI,iDAAwB,EAAE,EAC/E,gBAA+B,EAAE,EACjC,YAA2E,OAAO,MAAM,KAAK,WAAW;QACtG,CAAC,CAAC,MAAM,CAAC,KAAK;QACd,CAAC,CAAC,OAAO,IAAI,KAAK,WAAW;YAC7B,CAAC,CAAC,IAAI,CAAC,KAAK;YACZ,CAAC,CAAC,KAAK;QAET,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,sBAAsB,EAAE,SAAS,CAAC,CAAA;QAZtC,WAAM,GAAN,MAAM,CAAe;QACrB,iBAAY,GAAZ,YAAY,CAAkB;QAC9B,YAAO,GAAP,OAAO,CAAY;QACnB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xC,CAAC;CACF;AAhpBD,wCAgpBC","sourcesContent":["import { IccAuthApi, IccMessageApi } from '../icc-api'\nimport { IccCryptoXApi } from './icc-crypto-x-api'\n\nimport * as models from '../icc-api/model/models'\nimport { DocIdentifier, ListOfIds, Message, MessagesReadStatusUpdate, PaginatedListMessage, Patient, User } from '../icc-api/model/models'\nimport { IccDataOwnerXApi } from './icc-data-owner-x-api'\nimport { AuthenticationProvider, NoAuthenticationProvider } from './auth/AuthenticationProvider'\nimport { SecureDelegation } from '../icc-api/model/SecureDelegation'\nimport { ShareMetadataBehaviour } from './crypto/ShareMetadataBehaviour'\nimport { ShareResult } from './utils/ShareResult'\nimport { EntityShareRequest } from '../icc-api/model/requests/EntityShareRequest'\nimport { XHR } from '../icc-api/api/XHR'\nimport { EncryptedEntityXApi } from './basexapi/EncryptedEntityXApi'\nimport { FilterChainMessage } from '../icc-api/model/FilterChainMessage'\nimport AccessLevelEnum = SecureDelegation.AccessLevelEnum\nimport RequestedPermissionEnum = EntityShareRequest.RequestedPermissionEnum\nimport { AbstractFilter } from './filters/filters'\nimport { EncryptedFieldsManifest, EntityWithDelegationTypeName, parseEncryptedFields, subscribeToEntityEvents, SubscriptionOptions } from './utils'\nimport { Connection, ConnectionImpl } from '../icc-api/model/Connection'\nimport { SecretIdUseOption } from './crypto/SecretIdUseOption'\nimport { AbstractFilterMessage } from '../icc-api/model/AbstractFilterMessage'\nimport { BulkShareOrUpdateMetadataParams } from '../icc-api/model/requests/BulkShareOrUpdateMetadataParams'\n\nexport class IccMessageXApi extends IccMessageApi implements EncryptedEntityXApi<models.Message> {\n private readonly encryptedFields: EncryptedFieldsManifest\n\n get headers(): Promise<Array<XHR.Header>> {\n return super.headers.then((h) => this.crypto.accessControlKeysHeaders.addAccessControlKeysHeaders(h, EntityWithDelegationTypeName.Message))\n }\n\n constructor(\n host: string,\n headers: { [key: string]: string },\n private readonly crypto: IccCryptoXApi,\n private readonly dataOwnerApi: IccDataOwnerXApi,\n private readonly authApi: IccAuthApi,\n private readonly autofillAuthor: boolean,\n authenticationProvider: AuthenticationProvider = new NoAuthenticationProvider(),\n encryptedKeys: Array<string> = [],\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response> = typeof window !== 'undefined'\n ? window.fetch\n : typeof self !== 'undefined'\n ? self.fetch\n : fetch\n ) {\n super(host, headers, authenticationProvider, fetchImpl)\n this.encryptedFields = parseEncryptedFields(encryptedKeys, 'Message.')\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Creates a new instance of message with initialised encryption metadata (not in the database).\n * @param user the current user.\n * @param m initialised data for the message. Metadata such as id, creation data, etc. will be automatically initialised, but you can specify\n * other kinds of data or overwrite generated metadata with this. You can't specify encryption metadata.\n * @return a new instance of message.\n */\n newInstance(user: User, m: any) {\n return this.newInstanceWithPatient(user, null, m)\n }\n\n /**\n * Creates a new instance of message with initialised encryption metadata (not in the database).\n * @param user the current user.\n * @param patient the patient this message refers to.\n * @param m initialised data for the message. Metadata such as id, creation data, etc. will be automatically initialised, but you can specify\n * other kinds of data or overwrite generated metadata with this. You can't specify encryption metadata.\n * @param options optional parameters:\n * - additionalDelegates: delegates which will have access to the entity in addition to the current data owner and delegates from the\n * auto-delegations. Must be an object which associates each data owner id with the access level to give to that data owner. May overlap with\n * auto-delegations, in such case the access level specified here will be used.\n * - preferredSfk: secret id of the patient to use as the secret foreign key to use for the message. The default value will be a\n * secret id of patient known by the topmost parent in the current data owner hierarchy.\n * - alternateRootDelegation: by default a new entity is created with a root delegation from self to self. In keyless mode this is not possible,\n * and instead the root delegation will be from self to another. You have to specify which delegate will be part of the root delegation.\n * @return a new instance of message.\n */\n async newInstanceWithPatient(\n user: User,\n patient: Patient | null,\n m: any = {},\n options: {\n additionalDelegates?: { [dataOwnerId: string]: AccessLevelEnum }\n sfkOption?: SecretIdUseOption\n alternateRootDelegation?: string\n } = {}\n ) {\n const message = {\n ...(m ?? {}),\n _type: 'org.taktik.icure.entities.Message',\n id: m?.id ?? this.crypto.primitives.randomUuid(),\n created: m?.created ?? new Date().getTime(),\n modified: m?.modified ?? new Date().getTime(),\n responsible: m?.responsible ?? (this.autofillAuthor ? this.dataOwnerApi.getDataOwnerIdOf(user) : undefined),\n author: m?.author ?? (this.autofillAuthor ? user.id : undefined),\n codes: m?.codes ?? [],\n tags: m?.tags ?? [],\n }\n\n const ownerId = this.dataOwnerApi.getDataOwnerIdOf(user)\n if (ownerId !== (await this.dataOwnerApi.getCurrentDataOwnerId())) throw new Error('Can only initialise entities as current data owner.')\n const sfk = patient\n ? await this.crypto.xapi.resolveSecretIdUseOptions(\n { entity: patient, type: EntityWithDelegationTypeName.Patient },\n options.sfkOption ?? SecretIdUseOption.UseAnySharedWithParent\n )\n : undefined\n if (patient && !sfk) throw new Error(`Couldn't find any sfk of parent patient ${patient.id}`)\n const extraDelegations = {\n ...Object.fromEntries(\n [...(user.autoDelegations?.all ?? []), ...(user.autoDelegations?.medicalInformation ?? [])].map((d) => [d, AccessLevelEnum.WRITE])\n ),\n ...(options?.additionalDelegates ?? {}),\n }\n return new models.Message(\n await this.crypto.xapi\n .entityWithInitialisedEncryptedMetadata(\n message,\n EntityWithDelegationTypeName.Message,\n patient?.id,\n sfk,\n true,\n extraDelegations,\n options.alternateRootDelegation\n )\n .then((x) => x.updatedEntity)\n )\n }\n\n /**\n * Decrypts the encrypted content of messages.\n * @param messages the messages to decrypt.\n * @return the decrypted messages with their encryption status.\n */\n async decrypt(messages: Array<models.Message>) {\n return await this.crypto.xapi.tryDecryptEntities(messages, EntityWithDelegationTypeName.Message, (x) => new models.Message(x))\n }\n\n /**\n * Encrypts the content of messages.\n * @param messages the messages to encrypt.\n * @return the encrypted messages.\n */\n encrypt(messages: Array<models.Message>): Promise<Array<models.Message>> {\n return this.crypto.xapi.tryEncryptEntities(\n messages,\n EntityWithDelegationTypeName.Message,\n this.encryptedFields,\n true,\n false,\n (x) => new models.Message(x)\n )\n }\n\n /**\n * @param message a message\n * @return the id of the patient that the message refers to, retrieved from the encrypted metadata. Normally there should only be one element\n * in the returned array, but in case of entity merges there could be multiple values.\n */\n async decryptPatientIdOf(message: models.Message): Promise<string[]> {\n return this.crypto.xapi.owningEntityIdsOf({ entity: message, type: EntityWithDelegationTypeName.Message }, undefined)\n }\n\n /**\n * @return if the logged data owner has write access to the content of the given message\n */\n async hasWriteAccess(message: models.Message): Promise<boolean> {\n return this.crypto.xapi.hasWriteAccess({ entity: message, type: EntityWithDelegationTypeName.Message })\n }\n\n /**\n * Share an existing message with other data owners, allowing them to access the non-encrypted data of the message and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param delegateId the id of the data owner which will be granted access to the message.\n * @param message the message to share.\n * @param shareSecretIds the secret ids of the Message that the delegate will be given access to. Allows the delegate to search for data where the\n * shared Message is the owning entity id.\n * @param options optional parameters to customize the sharing behaviour:\n * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted\n * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a\n * message does not have encrypted content.\n * - sharePatientId: specifies if the id of the patient that this message refers to should be shared with the delegate (defaults to\n * {@link ShareMetadataBehaviour.IF_AVAILABLE}).\n * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.\n * @return the updated entity\n */\n async shareWith(\n delegateId: string,\n message: models.Message,\n shareSecretIds: string[],\n options: {\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n sharePatientId?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n } = {}\n ): Promise<models.Message> {\n return this.shareWithMany(message, { [delegateId]: { ...options, shareSecretIds } })\n }\n\n /**\n * Share an existing message with other data owners, allowing them to access the non-encrypted data of the message and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param message the message to share.\n * @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options:\n * - shareSecretIds the secret ids of the Message that the delegate will be given access to. Allows the delegate to search for data where the\n * shared Message is the owning entity id. Mandatory.\n * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted\n * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a\n * message does not have encrypted content.\n * - sharePatientId: specifies if the id of the patient that this message refers to should be shared with the delegate (defaults to\n * {@link ShareMetadataBehaviour.IF_AVAILABLE}).\n * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.\n * @return the updated entity\n */\n async shareWithMany(\n message: models.Message,\n delegates: {\n [delegateId: string]: {\n shareSecretIds: string[]\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n sharePatientId?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n }\n }\n ): Promise<models.Message> {\n return (await this.tryShareWithMany(message, delegates)).updatedEntityOrThrow\n }\n\n /**\n * Share an existing message with other data owners, allowing them to access the non-encrypted data of the message and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param message the message to share.\n * @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options:\n * - shareSecretIds the secret ids of the Message that the delegate will be given access to. Allows the delegate to search for data where the\n * shared Message is the owning entity id. Mandatory.\n * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted\n * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a\n * message does not have encrypted content.\n * - sharePatientId: specifies if the id of the patient that this message refers to should be shared with the delegate (defaults to\n * {@link ShareMetadataBehaviour.IF_AVAILABLE}).\n * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.\n * @return a promise which will contain the result of the operation: the updated entity if the operation was successful or details of the error if\n * the operation failed.\n */\n async tryShareWithMany(\n message: models.Message,\n delegates: {\n [delegateId: string]: {\n shareSecretIds: string[]\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n sharePatientId?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n }\n }\n ): Promise<ShareResult<models.Message>> {\n // All entities should have an encryption key.\n const entityWithEncryptionKey = await this.crypto.xapi.ensureEncryptionKeysInitialised(message, EntityWithDelegationTypeName.Message)\n const updatedEntity = entityWithEncryptionKey ? await this.modifyMessageWithUser(undefined, entityWithEncryptionKey) : message\n return this.crypto.xapi\n .simpleShareOrUpdateEncryptedEntityMetadata(\n {\n entity: updatedEntity,\n type: EntityWithDelegationTypeName.Message,\n },\n Object.fromEntries(\n Object.entries(delegates).map(([delegateId, options]) => [\n delegateId,\n {\n requestedPermissions: options.requestedPermissions,\n shareEncryptionKeys: options.shareEncryptionKey,\n shareOwningEntityIds: options.sharePatientId,\n shareSecretIds: options.shareSecretIds,\n },\n ])\n ),\n (x) => super.bulkShareMessages(x)\n )\n .then((r) => r.mapSuccessAsync(async (m) => (await this.decrypt([m]))[0].entity))\n }\n\n /**\n * @param message a message\n * @return the secret ids of the message, retrieved from the encrypted metadata. The result may be used to find entities where the message is\n * the 'owning entity', or in the {@link shareWith} method in order to share it with other data owners.\n */\n decryptSecretIdsOf(message: models.Message): Promise<string[]> {\n return this.crypto.xapi.secretIdsOf({ entity: message, type: EntityWithDelegationTypeName.Message }, undefined)\n }\n\n /**\n * Creates or updates de-anonymization metadata for the message, allowing resolution of anonymous delegations.\n * @param entity the message.\n * @param delegates the data owner ids of the delegates.\n */\n createDelegationDeAnonymizationMetadata(entity: Message, delegates: string[]): Promise<void> {\n return this.crypto.delegationsDeAnonymization.createOrUpdateDeAnonymizationInfo({ entity, type: EntityWithDelegationTypeName.Message }, delegates)\n }\n\n /**\n * Retrieves the data owners that have access to the message.\n * @param entity the message.\n * @return the data owners with their access levels and a flag indicating if there are unknown anonymous data owners.\n */\n getDataOwnersWithAccessTo(\n entity: models.Message\n ): Promise<{ permissionsByDataOwnerId: { [p: string]: AccessLevelEnum }; hasUnknownAnonymousDataOwners: boolean }> {\n return this.crypto.delegationsDeAnonymization.getDataOwnersWithAccessTo({ entity, type: EntityWithDelegationTypeName.Message })\n }\n\n /**\n * Retrieves the encryption keys of the message.\n * @param entity the message.\n * @return the encryption keys.\n */\n getEncryptionKeysOf(entity: models.Message): Promise<string[]> {\n return this.crypto.xapi.encryptionKeysOf({ entity, type: EntityWithDelegationTypeName.Message }, undefined)\n }\n\n /**\n * Subscribes to message events (create, update, delete).\n * @param eventTypes the types of events to subscribe to.\n * @param filter optional filter to apply to the events.\n * @param eventFired callback function to be called when an event is fired.\n * @param options optional subscription options.\n * @return a connection that can be used to close the subscription.\n */\n async subscribeToMessageEvents(\n eventTypes: ('CREATE' | 'UPDATE' | 'DELETE')[],\n filter: AbstractFilter<Message> | undefined,\n eventFired: (message: Message) => Promise<void>,\n options: SubscriptionOptions = {}\n ): Promise<Connection> {\n return await subscribeToEntityEvents(\n this.host,\n this.authApi,\n EntityWithDelegationTypeName.Message,\n eventTypes,\n filter,\n eventFired,\n options,\n async (encrypted) => (await this.decrypt([encrypted]))[0].entity\n ).then((rs) => new ConnectionImpl(rs))\n }\n\n private async decryptPage(page: PaginatedListMessage): Promise<PaginatedListMessage> {\n return {\n ...page,\n rows: (await this.decrypt(page.rows ?? [])).map((x) => x.entity),\n }\n }\n\n /**\n * Creates a message.\n * @param user the current user (unused, for compatibility).\n * @param body the message to create.\n * @return the created message.\n */\n async createMessageWithUser(user: models.User | undefined, body: Message): Promise<Message> {\n return (await this.decrypt([await super.createMessage((await this.encrypt([body]))[0])]))[0].entity\n }\n\n /**\n * Finds messages with pagination.\n * @param user the current user (unused, for compatibility).\n * @param startKey optional start key for pagination.\n * @param startDocumentId optional start document id for pagination.\n * @param limit optional maximum number of results to return.\n * @return a paginated list of messages.\n */\n async findMessagesWithUser(\n user: models.User | undefined,\n startKey?: string,\n startDocumentId?: string,\n limit?: number\n ): Promise<PaginatedListMessage> {\n return await this.decryptPage(await super.findMessages(startKey, startDocumentId, limit))\n }\n\n /**\n * Finds messages by sender address with pagination.\n * @param user the current user (unused, for compatibility).\n * @param fromAddress the sender address to filter by.\n * @param startKey optional start key for pagination.\n * @param startDocumentId optional start document id for pagination.\n * @param limit optional maximum number of results to return.\n * @param hcpId optional healthcare party id to filter by.\n * @return a paginated list of messages.\n */\n async findMessagesByFromAddressWithUser(\n user: models.User | undefined,\n fromAddress?: string,\n startKey?: string,\n startDocumentId?: string,\n limit?: number,\n hcpId?: string\n ): Promise<PaginatedListMessage> {\n return await this.decryptPage(await super.findMessagesByFromAddress(fromAddress, startKey, startDocumentId, limit, hcpId))\n }\n\n /**\n * @deprecated\n */\n async findMessagesByHCPartyPatientForeignKeysUsingPostWithUser(user: models.User | undefined, body?: Array<string>): Promise<Array<Message>> {\n return (await this.decrypt(await super.findMessagesByHCPartyPatientForeignKeysUsingPost(body))).map((x) => x.entity)\n }\n\n /**\n * @deprecated\n */\n async findMessagesByHCPartyPatientForeignKeysWithUser(user: models.User | undefined, secretFKeys: string): Promise<Array<Message>> {\n return (await this.decrypt(await super.findMessagesByHCPartyPatientForeignKeys(secretFKeys))).map((x) => x.entity)\n }\n\n /**\n * Finds messages by recipient address with pagination.\n * @param user the current user (unused, for compatibility).\n * @param toAddress the recipient address to filter by.\n * @param startKey optional start key for pagination.\n * @param startDocumentId optional start document id for pagination.\n * @param limit optional maximum number of results to return.\n * @param reverse optional flag to reverse the sort order.\n * @param hcpId optional healthcare party id to filter by.\n * @return a paginated list of messages.\n */\n async findMessagesByToAddressWithUser(\n user: models.User | undefined,\n toAddress?: string,\n startKey?: string,\n startDocumentId?: string,\n limit?: number,\n reverse?: boolean,\n hcpId?: string\n ): Promise<PaginatedListMessage> {\n return await this.decryptPage(await super.findMessagesByToAddress(toAddress, startKey, startDocumentId, limit, reverse, hcpId))\n }\n\n /**\n * Finds messages by transport GUID with pagination.\n * @param user the current user (unused, for compatibility).\n * @param transportGuid the transport GUID to filter by.\n * @param received optional flag to filter by received status.\n * @param startKey optional start key for pagination.\n * @param startDocumentId optional start document id for pagination.\n * @param limit optional maximum number of results to return.\n * @param hcpId optional healthcare party id to filter by.\n * @return a paginated list of messages.\n */\n async findMessagesByTransportGuidWithUser(\n user: models.User | undefined,\n transportGuid?: string,\n received?: boolean,\n startKey?: string,\n startDocumentId?: string,\n limit?: number,\n hcpId?: string\n ): Promise<PaginatedListMessage> {\n return await this.decryptPage(await super.findMessagesByTransportGuid(transportGuid, received, startKey, startDocumentId, limit, hcpId))\n }\n\n /**\n * Finds messages by transport GUID and sent date range with pagination.\n * @param user the current user (unused, for compatibility).\n * @param transportGuid the transport GUID to filter by.\n * @param from optional start timestamp for the date range.\n * @param to optional end timestamp for the date range.\n * @param startKey optional start key for pagination.\n * @param startDocumentId optional start document id for pagination.\n * @param limit optional maximum number of results to return.\n * @param hcpId optional healthcare party id to filter by.\n * @return a paginated list of messages.\n */\n async findMessagesByTransportGuidSentDateWithUser(\n user: models.User | undefined,\n transportGuid?: string,\n from?: number,\n to?: number,\n startKey?: string,\n startDocumentId?: string,\n limit?: number,\n hcpId?: string\n ): Promise<PaginatedListMessage> {\n return await this.decryptPage(await super.findMessagesByTransportGuidSentDate(transportGuid, from, to, startKey, startDocumentId, limit, hcpId))\n }\n\n /**\n * Retrieves the children messages of a message.\n * @param user the current user (unused, for compatibility).\n * @param messageId the id of the parent message.\n * @return the children messages.\n */\n async getChildrenMessagesWithUser(user: models.User | undefined, messageId: string): Promise<Array<Message>> {\n return (await this.decrypt(await super.getChildrenMessages(messageId))).map((x) => x.entity)\n }\n\n /**\n * Retrieves the children messages of a list of parent messages.\n * @param user the current user (unused, for compatibility).\n * @param body the list of parent message ids.\n * @return the children messages.\n */\n async getChildrenMessagesOfListWithUser(user: models.User | undefined, body?: ListOfIds): Promise<Array<Message>> {\n return (await this.decrypt(await super.getChildrenMessagesOfList(body))).map((x) => x.entity)\n }\n\n /**\n * Retrieves a message by its id.\n * @param user the current user (unused, for compatibility).\n * @param messageId the id of the message.\n * @return the message.\n */\n async getMessageWithUser(user: models.User | undefined, messageId: string): Promise<Message> {\n return (await this.decrypt([await super.getMessage(messageId)]))[0].entity\n }\n\n /**\n * Retrieves multiple messages by their ids.\n * @param user the current user (unused, for compatibility).\n * @param messageIds the list of message ids.\n * @return the messages.\n */\n async getMessagesWithUser(user: models.User | undefined, messageIds: ListOfIds): Promise<Message[]> {\n return (await this.decrypt(await super.getMessages(messageIds))).map((x) => x.entity)\n }\n\n /**\n * Lists messages by invoice ids.\n * @param user the current user (unused, for compatibility).\n * @param body the list of invoice ids.\n * @return the messages associated with the invoices.\n */\n async listMessagesByInvoiceIdsWithUser(user: models.User | undefined, body?: ListOfIds): Promise<Array<Message>> {\n return (await this.decrypt(await super.listMessagesByInvoiceIds(body))).map((x) => x.entity)\n }\n\n /**\n * Lists messages by transport GUIDs.\n * @param user the current user (unused, for compatibility).\n * @param hcpId the healthcare party id.\n * @param body the list of transport GUIDs.\n * @return the messages associated with the transport GUIDs.\n */\n async listMessagesByTransportGuidsWithUser(user: models.User | undefined, hcpId: string, body?: ListOfIds): Promise<Array<Message>> {\n return (await this.decrypt(await super.listMessagesByTransportGuids(hcpId, body))).map((x) => x.entity)\n }\n\n /**\n * Modifies a message.\n * @param user the current user (unused, for compatibility).\n * @param body the message to modify.\n * @return the modified message.\n */\n async modifyMessageWithUser(user: models.User | undefined, body: Message): Promise<Message> {\n return (await this.decrypt([await super.modifyMessage((await this.encrypt([body]))[0])]))[0].entity\n }\n\n /**\n * Sets the status bits of multiple messages.\n * @param user the current user (unused, for compatibility).\n * @param status the status bits to set.\n * @param body the list of message ids.\n * @return the updated messages.\n */\n async setMessagesStatusBitsWithUser(user: models.User | undefined, status: number, body?: ListOfIds): Promise<Array<Message>> {\n return (await this.decrypt(await super.setMessagesStatusBits(status, body))).map((x) => x.entity)\n }\n\n /**\n * Filters messages using a filter chain with pagination.\n * @param user the current user (unused, for compatibility).\n * @param body the filter chain to apply.\n * @param startDocumentId optional start document id for pagination.\n * @param limit optional maximum number of results to return.\n * @return a paginated list of filtered messages.\n */\n async filterMessagesByWithUser(\n user: models.User | undefined,\n body: FilterChainMessage,\n startDocumentId?: string,\n limit?: number\n ): Promise<PaginatedListMessage> {\n return await this.decryptPage(await super.filterMessagesBy(body, startDocumentId, limit))\n }\n\n /**\n * Sets the read status of multiple messages.\n * @param user the current user (unused, for compatibility).\n * @param body the read status update information.\n * @return the updated messages.\n */\n async setMessagesReadStatusWithUser(user: models.User | undefined, body?: MessagesReadStatusUpdate): Promise<Array<Message>> {\n return (await this.decrypt(await super.setMessagesReadStatus(body))).map((x) => x.entity)\n }\n\n createMessage(body?: Message): never {\n throw new Error('Use withUser method')\n }\n\n findMessages(startKey?: string, startDocumentId?: string, limit?: number): never {\n throw new Error('Use withUser method')\n }\n\n findMessagesByFromAddress(fromAddress?: string, startKey?: string, startDocumentId?: string, limit?: number, hcpId?: string): never {\n throw new Error('Use withUser method')\n }\n\n findMessagesByHCPartyPatientForeignKeysUsingPost(body?: Array<string>): never {\n throw new Error('Use withUser method')\n }\n\n findMessagesByHCPartyPatientForeignKeys(secretFKeys: string): never {\n throw new Error('Use withUser method')\n }\n\n findMessagesByToAddress(toAddress?: string, startKey?: string, startDocumentId?: string, limit?: number, reverse?: boolean, hcpId?: string): never {\n throw new Error('Use withUser method')\n }\n\n findMessagesByTransportGuid(\n transportGuid?: string,\n received?: boolean,\n startKey?: string,\n startDocumentId?: string,\n limit?: number,\n hcpId?: string\n ): never {\n throw new Error('Use withUser method')\n }\n\n findMessagesByTransportGuidSentDate(\n transportGuid?: string,\n from?: number,\n to?: number,\n startKey?: string,\n startDocumentId?: string,\n limit?: number,\n hcpId?: string\n ): never {\n throw new Error('Use withUser method')\n }\n\n getChildrenMessages(messageId: string): never {\n throw new Error('Use withUser method')\n }\n\n getChildrenMessagesOfList(body?: ListOfIds): never {\n throw new Error('Use withUser method')\n }\n\n getMessage(messageId: string): never {\n throw new Error('Use withUser method')\n }\n\n getMessages(messageIds: ListOfIds): never {\n throw new Error('Use withUser method')\n }\n\n listMessagesByInvoiceIds(body?: ListOfIds): never {\n throw new Error('Use withUser method')\n }\n\n listMessagesByTransportGuids(hcpId: string, body?: ListOfIds): never {\n throw new Error('Use withUser method')\n }\n\n modifyMessage(body?: Message): never {\n throw new Error('Use withUser method')\n }\n\n setMessagesStatusBits(status: number, body?: ListOfIds): never {\n throw new Error('Use withUser method')\n }\n\n filterMessagesBy(body: FilterChainMessage, startDocumentId?: string, limit?: number): never {\n throw new Error('Use withUser method')\n }\n\n setMessagesReadStatus(body?: MessagesReadStatusUpdate): never {\n throw new Error('Use withUser method')\n }\n}\n"]}
1
+ {"version":3,"file":"icc-message-x-api.js","sourceRoot":"","sources":["../../icc-x-api/icc-message-x-api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wCAAsD;AAGtD,kDAAiD;AAGjD,0EAAgG;AAChG,wEAAoE;AAOpE,IAAO,eAAe,GAAG,mCAAgB,CAAC,eAAe,CAAA;AAGzD,mCAAmJ;AACnJ,4DAAwE;AACxE,kEAA8D;AAI9D,MAAa,cAAe,SAAQ,uBAAa;IAG/C,IAAI,OAAO;QACT,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,wBAAwB,CAAC,2BAA2B,CAAC,CAAC,EAAE,oCAA4B,CAAC,OAAO,CAAC,CAAC,CAAA;IAC7I,CAAC;IAED,YACE,IAAY,EACZ,OAAkC,EACjB,MAAqB,EACrB,YAA8B,EAC9B,OAAmB,EACnB,cAAuB,EACxC,yBAAiD,IAAI,iDAAwB,EAAE,EAC/E,gBAA+B,EAAE,EACjC,YAA2E,OAAO,MAAM,KAAK,WAAW;QACtG,CAAC,CAAC,MAAM,CAAC,KAAK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IAED,qBAAqB,CAAC,MAAc,EAAE,IAAgB;QACpD,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAA;IACxC,CAAC;IAED,gBAAgB,CAAC,IAAwB,EAAE,eAAwB,EAAE,KAAc;QACjF,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAA;IACxC,CAAC;IAED,qBAAqB,CAAC,IAA+B;QACnD,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAA;IACxC,CAAC;CACF;AAhqBD,wCAgqBC","sourcesContent":["import { IccAuthApi, IccMessageApi } from '../icc-api'\nimport { IccCryptoXApi } from './icc-crypto-x-api'\n\nimport * as models from '../icc-api/model/models'\nimport { DocIdentifier, ListOfIds, Message, MessagesReadStatusUpdate, PaginatedListMessage, Patient, TimingInfo, User } from '../icc-api/model/models'\nimport { IccDataOwnerXApi } from './icc-data-owner-x-api'\nimport { AuthenticationProvider, NoAuthenticationProvider } from './auth/AuthenticationProvider'\nimport { SecureDelegation } from '../icc-api/model/SecureDelegation'\nimport { ShareMetadataBehaviour } from './crypto/ShareMetadataBehaviour'\nimport { ShareResult } from './utils/ShareResult'\nimport { EntityShareRequest } from '../icc-api/model/requests/EntityShareRequest'\nimport { XHR } from '../icc-api/api/XHR'\nimport { EncryptedEntityXApi } from './basexapi/EncryptedEntityXApi'\nimport { FilterChainMessage } from '../icc-api/model/FilterChainMessage'\nimport AccessLevelEnum = SecureDelegation.AccessLevelEnum\nimport RequestedPermissionEnum = EntityShareRequest.RequestedPermissionEnum\nimport { AbstractFilter } from './filters/filters'\nimport { EncryptedFieldsManifest, EntityWithDelegationTypeName, parseEncryptedFields, subscribeToEntityEvents, SubscriptionOptions } from './utils'\nimport { Connection, ConnectionImpl } from '../icc-api/model/Connection'\nimport { SecretIdUseOption } from './crypto/SecretIdUseOption'\nimport { AbstractFilterMessage } from '../icc-api/model/AbstractFilterMessage'\nimport { BulkShareOrUpdateMetadataParams } from '../icc-api/model/requests/BulkShareOrUpdateMetadataParams'\n\nexport class IccMessageXApi extends IccMessageApi implements EncryptedEntityXApi<models.Message> {\n private readonly encryptedFields: EncryptedFieldsManifest\n\n get headers(): Promise<Array<XHR.Header>> {\n return super.headers.then((h) => this.crypto.accessControlKeysHeaders.addAccessControlKeysHeaders(h, EntityWithDelegationTypeName.Message))\n }\n\n constructor(\n host: string,\n headers: { [key: string]: string },\n private readonly crypto: IccCryptoXApi,\n private readonly dataOwnerApi: IccDataOwnerXApi,\n private readonly authApi: IccAuthApi,\n private readonly autofillAuthor: boolean,\n authenticationProvider: AuthenticationProvider = new NoAuthenticationProvider(),\n encryptedKeys: Array<string> = [],\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response> = typeof window !== 'undefined'\n ? window.fetch\n : typeof self !== 'undefined'\n ? self.fetch\n : fetch\n ) {\n super(host, headers, authenticationProvider, fetchImpl)\n this.encryptedFields = parseEncryptedFields(encryptedKeys, 'Message.')\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * Creates a new instance of message with initialised encryption metadata (not in the database).\n * @param user the current user.\n * @param m initialised data for the message. Metadata such as id, creation data, etc. will be automatically initialised, but you can specify\n * other kinds of data or overwrite generated metadata with this. You can't specify encryption metadata.\n * @return a new instance of message.\n */\n newInstance(user: User, m: any) {\n return this.newInstanceWithPatient(user, null, m)\n }\n\n /**\n * Creates a new instance of message with initialised encryption metadata (not in the database).\n * @param user the current user.\n * @param patient the patient this message refers to.\n * @param m initialised data for the message. Metadata such as id, creation data, etc. will be automatically initialised, but you can specify\n * other kinds of data or overwrite generated metadata with this. You can't specify encryption metadata.\n * @param options optional parameters:\n * - additionalDelegates: delegates which will have access to the entity in addition to the current data owner and delegates from the\n * auto-delegations. Must be an object which associates each data owner id with the access level to give to that data owner. May overlap with\n * auto-delegations, in such case the access level specified here will be used.\n * - preferredSfk: secret id of the patient to use as the secret foreign key to use for the message. The default value will be a\n * secret id of patient known by the topmost parent in the current data owner hierarchy.\n * - alternateRootDelegation: by default a new entity is created with a root delegation from self to self. In keyless mode this is not possible,\n * and instead the root delegation will be from self to another. You have to specify which delegate will be part of the root delegation.\n * @return a new instance of message.\n */\n async newInstanceWithPatient(\n user: User,\n patient: Patient | null,\n m: any = {},\n options: {\n additionalDelegates?: { [dataOwnerId: string]: AccessLevelEnum }\n sfkOption?: SecretIdUseOption\n alternateRootDelegation?: string\n } = {}\n ) {\n const message = {\n ...(m ?? {}),\n _type: 'org.taktik.icure.entities.Message',\n id: m?.id ?? this.crypto.primitives.randomUuid(),\n created: m?.created ?? new Date().getTime(),\n modified: m?.modified ?? new Date().getTime(),\n responsible: m?.responsible ?? (this.autofillAuthor ? this.dataOwnerApi.getDataOwnerIdOf(user) : undefined),\n author: m?.author ?? (this.autofillAuthor ? user.id : undefined),\n codes: m?.codes ?? [],\n tags: m?.tags ?? [],\n }\n\n const ownerId = this.dataOwnerApi.getDataOwnerIdOf(user)\n if (ownerId !== (await this.dataOwnerApi.getCurrentDataOwnerId())) throw new Error('Can only initialise entities as current data owner.')\n const sfk = patient\n ? await this.crypto.xapi.resolveSecretIdUseOptions(\n { entity: patient, type: EntityWithDelegationTypeName.Patient },\n options.sfkOption ?? SecretIdUseOption.UseAnySharedWithParent\n )\n : undefined\n if (patient && !sfk) throw new Error(`Couldn't find any sfk of parent patient ${patient.id}`)\n const extraDelegations = {\n ...Object.fromEntries(\n [...(user.autoDelegations?.all ?? []), ...(user.autoDelegations?.medicalInformation ?? [])].map((d) => [d, AccessLevelEnum.WRITE])\n ),\n ...(options?.additionalDelegates ?? {}),\n }\n return new models.Message(\n await this.crypto.xapi\n .entityWithInitialisedEncryptedMetadata(\n message,\n EntityWithDelegationTypeName.Message,\n patient?.id,\n sfk,\n true,\n extraDelegations,\n options.alternateRootDelegation\n )\n .then((x) => x.updatedEntity)\n )\n }\n\n /**\n * Decrypts the encrypted content of messages.\n * @param messages the messages to decrypt.\n * @return the decrypted messages with their encryption status.\n */\n async decrypt(messages: Array<models.Message>) {\n return await this.crypto.xapi.tryDecryptEntities(messages, EntityWithDelegationTypeName.Message, (x) => new models.Message(x))\n }\n\n /**\n * Encrypts the content of messages.\n * @param messages the messages to encrypt.\n * @return the encrypted messages.\n */\n encrypt(messages: Array<models.Message>): Promise<Array<models.Message>> {\n return this.crypto.xapi.tryEncryptEntities(\n messages,\n EntityWithDelegationTypeName.Message,\n this.encryptedFields,\n true,\n false,\n (x) => new models.Message(x)\n )\n }\n\n /**\n * @param message a message\n * @return the id of the patient that the message refers to, retrieved from the encrypted metadata. Normally there should only be one element\n * in the returned array, but in case of entity merges there could be multiple values.\n */\n async decryptPatientIdOf(message: models.Message): Promise<string[]> {\n return this.crypto.xapi.owningEntityIdsOf({ entity: message, type: EntityWithDelegationTypeName.Message }, undefined)\n }\n\n /**\n * @return if the logged data owner has write access to the content of the given message\n */\n async hasWriteAccess(message: models.Message): Promise<boolean> {\n return this.crypto.xapi.hasWriteAccess({ entity: message, type: EntityWithDelegationTypeName.Message })\n }\n\n /**\n * Share an existing message with other data owners, allowing them to access the non-encrypted data of the message and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param delegateId the id of the data owner which will be granted access to the message.\n * @param message the message to share.\n * @param shareSecretIds the secret ids of the Message that the delegate will be given access to. Allows the delegate to search for data where the\n * shared Message is the owning entity id.\n * @param options optional parameters to customize the sharing behaviour:\n * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted\n * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a\n * message does not have encrypted content.\n * - sharePatientId: specifies if the id of the patient that this message refers to should be shared with the delegate (defaults to\n * {@link ShareMetadataBehaviour.IF_AVAILABLE}).\n * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.\n * @return the updated entity\n */\n async shareWith(\n delegateId: string,\n message: models.Message,\n shareSecretIds: string[],\n options: {\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n sharePatientId?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n } = {}\n ): Promise<models.Message> {\n return this.shareWithMany(message, { [delegateId]: { ...options, shareSecretIds } })\n }\n\n /**\n * Share an existing message with other data owners, allowing them to access the non-encrypted data of the message and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param message the message to share.\n * @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options:\n * - shareSecretIds the secret ids of the Message that the delegate will be given access to. Allows the delegate to search for data where the\n * shared Message is the owning entity id. Mandatory.\n * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted\n * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a\n * message does not have encrypted content.\n * - sharePatientId: specifies if the id of the patient that this message refers to should be shared with the delegate (defaults to\n * {@link ShareMetadataBehaviour.IF_AVAILABLE}).\n * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.\n * @return the updated entity\n */\n async shareWithMany(\n message: models.Message,\n delegates: {\n [delegateId: string]: {\n shareSecretIds: string[]\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n sharePatientId?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n }\n }\n ): Promise<models.Message> {\n return (await this.tryShareWithMany(message, delegates)).updatedEntityOrThrow\n }\n\n /**\n * Share an existing message with other data owners, allowing them to access the non-encrypted data of the message and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param message the message to share.\n * @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options:\n * - shareSecretIds the secret ids of the Message that the delegate will be given access to. Allows the delegate to search for data where the\n * shared Message is the owning entity id. Mandatory.\n * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted\n * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a\n * message does not have encrypted content.\n * - sharePatientId: specifies if the id of the patient that this message refers to should be shared with the delegate (defaults to\n * {@link ShareMetadataBehaviour.IF_AVAILABLE}).\n * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.\n * @return a promise which will contain the result of the operation: the updated entity if the operation was successful or details of the error if\n * the operation failed.\n */\n async tryShareWithMany(\n message: models.Message,\n delegates: {\n [delegateId: string]: {\n shareSecretIds: string[]\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n sharePatientId?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n }\n }\n ): Promise<ShareResult<models.Message>> {\n // All entities should have an encryption key.\n const entityWithEncryptionKey = await this.crypto.xapi.ensureEncryptionKeysInitialised(message, EntityWithDelegationTypeName.Message)\n const updatedEntity = entityWithEncryptionKey ? await this.modifyMessageWithUser(undefined, entityWithEncryptionKey) : message\n return this.crypto.xapi\n .simpleShareOrUpdateEncryptedEntityMetadata(\n {\n entity: updatedEntity,\n type: EntityWithDelegationTypeName.Message,\n },\n Object.fromEntries(\n Object.entries(delegates).map(([delegateId, options]) => [\n delegateId,\n {\n requestedPermissions: options.requestedPermissions,\n shareEncryptionKeys: options.shareEncryptionKey,\n shareOwningEntityIds: options.sharePatientId,\n shareSecretIds: options.shareSecretIds,\n },\n ])\n ),\n (x) => super.bulkShareMessages(x)\n )\n .then((r) => r.mapSuccessAsync(async (m) => (await this.decrypt([m]))[0].entity))\n }\n\n /**\n * @param message a message\n * @return the secret ids of the message, retrieved from the encrypted metadata. The result may be used to find entities where the message is\n * the 'owning entity', or in the {@link shareWith} method in order to share it with other data owners.\n */\n decryptSecretIdsOf(message: models.Message): Promise<string[]> {\n return this.crypto.xapi.secretIdsOf({ entity: message, type: EntityWithDelegationTypeName.Message }, undefined)\n }\n\n /**\n * Creates or updates de-anonymization metadata for the message, allowing resolution of anonymous delegations.\n * @param entity the message.\n * @param delegates the data owner ids of the delegates.\n */\n createDelegationDeAnonymizationMetadata(entity: Message, delegates: string[]): Promise<void> {\n return this.crypto.delegationsDeAnonymization.createOrUpdateDeAnonymizationInfo({ entity, type: EntityWithDelegationTypeName.Message }, delegates)\n }\n\n /**\n * Retrieves the data owners that have access to the message.\n * @param entity the message.\n * @return the data owners with their access levels and a flag indicating if there are unknown anonymous data owners.\n */\n getDataOwnersWithAccessTo(\n entity: models.Message\n ): Promise<{ permissionsByDataOwnerId: { [p: string]: AccessLevelEnum }; hasUnknownAnonymousDataOwners: boolean }> {\n return this.crypto.delegationsDeAnonymization.getDataOwnersWithAccessTo({ entity, type: EntityWithDelegationTypeName.Message })\n }\n\n /**\n * Retrieves the encryption keys of the message.\n * @param entity the message.\n * @return the encryption keys.\n */\n getEncryptionKeysOf(entity: models.Message): Promise<string[]> {\n return this.crypto.xapi.encryptionKeysOf({ entity, type: EntityWithDelegationTypeName.Message }, undefined)\n }\n\n /**\n * Subscribes to message events (create, update, delete).\n * @param eventTypes the types of events to subscribe to.\n * @param filter optional filter to apply to the events.\n * @param eventFired callback function to be called when an event is fired.\n * @param options optional subscription options.\n * @return a connection that can be used to close the subscription.\n */\n async subscribeToMessageEvents(\n eventTypes: ('CREATE' | 'UPDATE' | 'DELETE')[],\n filter: AbstractFilter<Message> | undefined,\n eventFired: (message: Message) => Promise<void>,\n options: SubscriptionOptions = {}\n ): Promise<Connection> {\n return await subscribeToEntityEvents(\n this.host,\n this.authApi,\n EntityWithDelegationTypeName.Message,\n eventTypes,\n filter,\n eventFired,\n options,\n async (encrypted) => (await this.decrypt([encrypted]))[0].entity\n ).then((rs) => new ConnectionImpl(rs))\n }\n\n private async decryptPage(page: PaginatedListMessage): Promise<PaginatedListMessage> {\n return {\n ...page,\n rows: (await this.decrypt(page.rows ?? [])).map((x) => x.entity),\n }\n }\n\n /**\n * Creates a message.\n * @param user the current user (unused, for compatibility).\n * @param body the message to create.\n * @return the created message.\n */\n async createMessageWithUser(user: models.User | undefined, body: Message): Promise<Message> {\n return (await this.decrypt([await super.createMessage((await this.encrypt([body]))[0])]))[0].entity\n }\n\n /**\n * Finds messages with pagination.\n * @param user the current user (unused, for compatibility).\n * @param startKey optional start key for pagination.\n * @param startDocumentId optional start document id for pagination.\n * @param limit optional maximum number of results to return.\n * @return a paginated list of messages.\n */\n async findMessagesWithUser(\n user: models.User | undefined,\n startKey?: string,\n startDocumentId?: string,\n limit?: number\n ): Promise<PaginatedListMessage> {\n return await this.decryptPage(await super.findMessages(startKey, startDocumentId, limit))\n }\n\n /**\n * Finds messages by sender address with pagination.\n * @param user the current user (unused, for compatibility).\n * @param fromAddress the sender address to filter by.\n * @param startKey optional start key for pagination.\n * @param startDocumentId optional start document id for pagination.\n * @param limit optional maximum number of results to return.\n * @param hcpId optional healthcare party id to filter by.\n * @return a paginated list of messages.\n */\n async findMessagesByFromAddressWithUser(\n user: models.User | undefined,\n fromAddress?: string,\n startKey?: string,\n startDocumentId?: string,\n limit?: number,\n hcpId?: string\n ): Promise<PaginatedListMessage> {\n return await this.decryptPage(await super.findMessagesByFromAddress(fromAddress, startKey, startDocumentId, limit, hcpId))\n }\n\n /**\n * @deprecated\n */\n async findMessagesByHCPartyPatientForeignKeysUsingPostWithUser(user: models.User | undefined, body?: Array<string>): Promise<Array<Message>> {\n return (await this.decrypt(await super.findMessagesByHCPartyPatientForeignKeysUsingPost(body))).map((x) => x.entity)\n }\n\n /**\n * @deprecated\n */\n async findMessagesByHCPartyPatientForeignKeysWithUser(user: models.User | undefined, secretFKeys: string): Promise<Array<Message>> {\n return (await this.decrypt(await super.findMessagesByHCPartyPatientForeignKeys(secretFKeys))).map((x) => x.entity)\n }\n\n /**\n * Finds messages by recipient address with pagination.\n * @param user the current user (unused, for compatibility).\n * @param toAddress the recipient address to filter by.\n * @param startKey optional start key for pagination.\n * @param startDocumentId optional start document id for pagination.\n * @param limit optional maximum number of results to return.\n * @param reverse optional flag to reverse the sort order.\n * @param hcpId optional healthcare party id to filter by.\n * @return a paginated list of messages.\n */\n async findMessagesByToAddressWithUser(\n user: models.User | undefined,\n toAddress?: string,\n startKey?: string,\n startDocumentId?: string,\n limit?: number,\n reverse?: boolean,\n hcpId?: string\n ): Promise<PaginatedListMessage> {\n return await this.decryptPage(await super.findMessagesByToAddress(toAddress, startKey, startDocumentId, limit, reverse, hcpId))\n }\n\n /**\n * Finds messages by transport GUID with pagination.\n * @param user the current user (unused, for compatibility).\n * @param transportGuid the transport GUID to filter by.\n * @param received optional flag to filter by received status.\n * @param startKey optional start key for pagination.\n * @param startDocumentId optional start document id for pagination.\n * @param limit optional maximum number of results to return.\n * @param hcpId optional healthcare party id to filter by.\n * @return a paginated list of messages.\n */\n async findMessagesByTransportGuidWithUser(\n user: models.User | undefined,\n transportGuid?: string,\n received?: boolean,\n startKey?: string,\n startDocumentId?: string,\n limit?: number,\n hcpId?: string\n ): Promise<PaginatedListMessage> {\n return await this.decryptPage(await super.findMessagesByTransportGuid(transportGuid, received, startKey, startDocumentId, limit, hcpId))\n }\n\n /**\n * Finds messages by transport GUID and sent date range with pagination.\n * @param user the current user (unused, for compatibility).\n * @param transportGuid the transport GUID to filter by.\n * @param from optional start timestamp for the date range.\n * @param to optional end timestamp for the date range.\n * @param startKey optional start key for pagination.\n * @param startDocumentId optional start document id for pagination.\n * @param limit optional maximum number of results to return.\n * @param hcpId optional healthcare party id to filter by.\n * @return a paginated list of messages.\n */\n async findMessagesByTransportGuidSentDateWithUser(\n user: models.User | undefined,\n transportGuid?: string,\n from?: number,\n to?: number,\n startKey?: string,\n startDocumentId?: string,\n limit?: number,\n hcpId?: string\n ): Promise<PaginatedListMessage> {\n return await this.decryptPage(await super.findMessagesByTransportGuidSentDate(transportGuid, from, to, startKey, startDocumentId, limit, hcpId))\n }\n\n /**\n * Retrieves the children messages of a message.\n * @param user the current user (unused, for compatibility).\n * @param messageId the id of the parent message.\n * @return the children messages.\n */\n async getChildrenMessagesWithUser(user: models.User | undefined, messageId: string): Promise<Array<Message>> {\n return (await this.decrypt(await super.getChildrenMessages(messageId))).map((x) => x.entity)\n }\n\n /**\n * Retrieves the children messages of a list of parent messages.\n * @param user the current user (unused, for compatibility).\n * @param body the list of parent message ids.\n * @return the children messages.\n */\n async getChildrenMessagesOfListWithUser(user: models.User | undefined, body?: ListOfIds): Promise<Array<Message>> {\n return (await this.decrypt(await super.getChildrenMessagesOfList(body))).map((x) => x.entity)\n }\n\n /**\n * Retrieves a message by its id.\n * @param user the current user (unused, for compatibility).\n * @param messageId the id of the message.\n * @return the message.\n */\n async getMessageWithUser(user: models.User | undefined, messageId: string): Promise<Message> {\n return (await this.decrypt([await super.getMessage(messageId)]))[0].entity\n }\n\n /**\n * Retrieves multiple messages by their ids.\n * @param user the current user (unused, for compatibility).\n * @param messageIds the list of message ids.\n * @return the messages.\n */\n async getMessagesWithUser(user: models.User | undefined, messageIds: ListOfIds): Promise<Message[]> {\n return (await this.decrypt(await super.getMessages(messageIds))).map((x) => x.entity)\n }\n\n /**\n * Lists messages by invoice ids.\n * @param user the current user (unused, for compatibility).\n * @param body the list of invoice ids.\n * @return the messages associated with the invoices.\n */\n async listMessagesByInvoiceIdsWithUser(user: models.User | undefined, body?: ListOfIds): Promise<Array<Message>> {\n return (await this.decrypt(await super.listMessagesByInvoiceIds(body))).map((x) => x.entity)\n }\n\n /**\n * Lists messages by transport GUIDs.\n * @param user the current user (unused, for compatibility).\n * @param hcpId the healthcare party id.\n * @param body the list of transport GUIDs.\n * @return the messages associated with the transport GUIDs.\n */\n async listMessagesByTransportGuidsWithUser(user: models.User | undefined, hcpId: string, body?: ListOfIds): Promise<Array<Message>> {\n return (await this.decrypt(await super.listMessagesByTransportGuids(hcpId, body))).map((x) => x.entity)\n }\n\n /**\n * Modifies a message.\n * @param user the current user (unused, for compatibility).\n * @param body the message to modify.\n * @return the modified message.\n */\n async modifyMessageWithUser(user: models.User | undefined, body: Message): Promise<Message> {\n return (await this.decrypt([await super.modifyMessage((await this.encrypt([body]))[0])]))[0].entity\n }\n\n /**\n * Sets the status bits of multiple messages.\n * @param user the current user (unused, for compatibility).\n * @param status the status bits to set.\n * @param body the list of message ids.\n * @return the updated messages.\n */\n async setMessagesStatusBitsWithUser(user: models.User | undefined, status: number, body?: ListOfIds): Promise<Array<Message>> {\n return (await this.decrypt(await super.setMessagesStatusBits(status, body))).map((x) => x.entity)\n }\n\n /**\n * Filters messages using a filter chain with pagination.\n * @param user the current user (unused, for compatibility).\n * @param body the filter chain to apply.\n * @param startDocumentId optional start document id for pagination.\n * @param limit optional maximum number of results to return.\n * @param collectTiming add timing information to the response\n * @return a paginated list of filtered messages.\n */\n async filterMessagesByWithUser(\n user: models.User | undefined,\n body: FilterChainMessage,\n startDocumentId?: string,\n limit?: number,\n collectTiming?: false\n ): Promise<PaginatedListMessage>\n async filterMessagesByWithUser(\n user: models.User | undefined,\n body: FilterChainMessage,\n startDocumentId?: string,\n limit?: number,\n collectTiming?: true\n ): Promise<PaginatedListMessage & TimingInfo>\n async filterMessagesByWithUser(\n user: models.User | undefined,\n body: FilterChainMessage,\n startDocumentId?: string,\n limit?: number,\n collectTiming: boolean = false\n ): Promise<PaginatedListMessage> {\n return await this.decryptPage(await super.filterMessagesBy(body, startDocumentId, limit, collectTiming as any))\n }\n\n /**\n * Sets the read status of multiple messages.\n * @param user the current user (unused, for compatibility).\n * @param body the read status update information.\n * @return the updated messages.\n */\n async setMessagesReadStatusWithUser(user: models.User | undefined, body?: MessagesReadStatusUpdate): Promise<Array<Message>> {\n return (await this.decrypt(await super.setMessagesReadStatus(body))).map((x) => x.entity)\n }\n\n createMessage(body?: Message): never {\n throw new Error('Use withUser method')\n }\n\n findMessages(startKey?: string, startDocumentId?: string, limit?: number): never {\n throw new Error('Use withUser method')\n }\n\n findMessagesByFromAddress(fromAddress?: string, startKey?: string, startDocumentId?: string, limit?: number, hcpId?: string): never {\n throw new Error('Use withUser method')\n }\n\n findMessagesByHCPartyPatientForeignKeysUsingPost(body?: Array<string>): never {\n throw new Error('Use withUser method')\n }\n\n findMessagesByHCPartyPatientForeignKeys(secretFKeys: string): never {\n throw new Error('Use withUser method')\n }\n\n findMessagesByToAddress(toAddress?: string, startKey?: string, startDocumentId?: string, limit?: number, reverse?: boolean, hcpId?: string): never {\n throw new Error('Use withUser method')\n }\n\n findMessagesByTransportGuid(\n transportGuid?: string,\n received?: boolean,\n startKey?: string,\n startDocumentId?: string,\n limit?: number,\n hcpId?: string\n ): never {\n throw new Error('Use withUser method')\n }\n\n findMessagesByTransportGuidSentDate(\n transportGuid?: string,\n from?: number,\n to?: number,\n startKey?: string,\n startDocumentId?: string,\n limit?: number,\n hcpId?: string\n ): never {\n throw new Error('Use withUser method')\n }\n\n getChildrenMessages(messageId: string): never {\n throw new Error('Use withUser method')\n }\n\n getChildrenMessagesOfList(body?: ListOfIds): never {\n throw new Error('Use withUser method')\n }\n\n getMessage(messageId: string): never {\n throw new Error('Use withUser method')\n }\n\n getMessages(messageIds: ListOfIds): never {\n throw new Error('Use withUser method')\n }\n\n listMessagesByInvoiceIds(body?: ListOfIds): never {\n throw new Error('Use withUser method')\n }\n\n listMessagesByTransportGuids(hcpId: string, body?: ListOfIds): never {\n throw new Error('Use withUser method')\n }\n\n modifyMessage(body?: Message): never {\n throw new Error('Use withUser method')\n }\n\n setMessagesStatusBits(status: number, body?: ListOfIds): never {\n throw new Error('Use withUser method')\n }\n\n filterMessagesBy(body: FilterChainMessage, startDocumentId?: string, limit?: number): never {\n throw new Error('Use withUser method')\n }\n\n setMessagesReadStatus(body?: MessagesReadStatusUpdate): never {\n throw new Error('Use withUser method')\n }\n}\n"]}
@@ -8,7 +8,7 @@ import { IccDocumentXApi } from './icc-document-x-api';
8
8
  import { IccHelementXApi } from './icc-helement-x-api';
9
9
  import { IccClassificationXApi } from './icc-classification-x-api';
10
10
  import * as models from '../icc-api/model/models';
11
- import { Patient } from '../icc-api/model/models';
11
+ import { Patient, TimingInfo } from '../icc-api/model/models';
12
12
  import { IccCalendarItemXApi } from './icc-calendar-item-x-api';
13
13
  import { SubscriptionOptions } from './utils';
14
14
  import { IccDataOwnerXApi } from './icc-data-owner-x-api';
@@ -102,9 +102,11 @@ export declare class IccPatientXApi extends IccPatientApi implements EncryptedEn
102
102
  * @param skip optional number of results to skip
103
103
  * @param sort optional sort field
104
104
  * @param desc optional sort direction
105
+ * @param collectTiming add timing information to the response
105
106
  * @return paginated list of decrypted patients
106
107
  */
107
- filterByWithUser(user: models.User, filterChain: models.FilterChainPatient, startKey?: string, startDocumentId?: string, limit?: number, skip?: number, sort?: string, desc?: boolean): Promise<models.PaginatedListPatient | any>;
108
+ filterByWithUser(user: models.User, filterChain: models.FilterChainPatient, startKey?: string, startDocumentId?: string, limit?: number, skip?: number, sort?: string, desc?: boolean, collectTiming?: false): Promise<models.PaginatedListPatient | any>;
109
+ filterByWithUser(user: models.User, filterChain: models.FilterChainPatient, startKey?: string, startDocumentId?: string, limit?: number, skip?: number, sort?: string, desc?: boolean, collectTiming?: true): Promise<(models.PaginatedListPatient & TimingInfo) | any>;
108
110
  findByAccessLogUserAfterDate(userId: string, accessType?: string, startDate?: number, startKey?: string, startDocumentId?: string, limit?: number): never;
109
111
  /**
110
112
  * Finds patients by access log user after a specific date and returns decrypted results.
@@ -176,21 +176,9 @@ class IccPatientXApi extends icc_api_1.IccPatientApi {
176
176
  filterBy(startKey, startDocumentId, limit, skip, sort, desc, body) {
177
177
  throw new Error('Cannot call a method that returns contacts without providing a user for de/encryption');
178
178
  }
179
- /**
180
- * Filters patients using a filter chain and returns decrypted results.
181
- * @param user the current user
182
- * @param filterChain the filter chain to apply
183
- * @param startKey optional start key for pagination
184
- * @param startDocumentId optional start document id for pagination
185
- * @param limit optional maximum number of results
186
- * @param skip optional number of results to skip
187
- * @param sort optional sort field
188
- * @param desc optional sort direction
189
- * @return paginated list of decrypted patients
190
- */
191
- filterByWithUser(user, filterChain, startKey, startDocumentId, limit, skip, sort, desc) {
179
+ filterByWithUser(user, filterChain, startKey, startDocumentId, limit, skip, sort, desc, collectTiming = false) {
192
180
  return super
193
- .filterPatientsBy(startKey, startDocumentId, limit, skip, sort, desc, filterChain)
181
+ .filterPatientsBy(startKey, startDocumentId, limit, skip, sort, desc, filterChain, collectTiming)
194
182
  .then((pl) => this.decrypt(user, pl.rows, false).then((dr) => Object.assign(pl, { rows: dr })));
195
183
  }
196
184
  findByAccessLogUserAfterDate(userId, accessType, startDate, startKey, startDocumentId, limit) {