@icure/api 7.1.16 → 8.0.0-RC.2
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.
- package/icc-api/api/IccAccesslogApi.d.ts +12 -1
- package/icc-api/api/IccAccesslogApi.js +142 -98
- package/icc-api/api/IccAccesslogApi.js.map +1 -1
- package/icc-api/api/IccBemikronoApi.d.ts +81 -0
- package/icc-api/api/IccBemikronoApi.js +163 -0
- package/icc-api/api/IccBemikronoApi.js.map +1 -0
- package/icc-api/api/IccCalendarItemApi.d.ts +21 -1
- package/icc-api/api/IccCalendarItemApi.js +183 -117
- package/icc-api/api/IccCalendarItemApi.js.map +1 -1
- package/icc-api/api/IccClassificationApi.d.ts +21 -1
- package/icc-api/api/IccClassificationApi.js +119 -63
- package/icc-api/api/IccClassificationApi.js.map +1 -1
- package/icc-api/api/IccContactApi.d.ts +21 -1
- package/icc-api/api/IccContactApi.js +385 -294
- package/icc-api/api/IccContactApi.js.map +1 -1
- package/icc-api/api/IccDocumentApi.d.ts +38 -25
- package/icc-api/api/IccDocumentApi.js +279 -212
- package/icc-api/api/IccDocumentApi.js.map +1 -1
- package/icc-api/api/IccExchangeDataApi.d.ts +19 -0
- package/icc-api/api/IccExchangeDataApi.js +85 -0
- package/icc-api/api/IccExchangeDataApi.js.map +1 -0
- package/icc-api/api/IccExchangeDataMapApi.d.ts +18 -0
- package/icc-api/api/IccExchangeDataMapApi.js +65 -0
- package/icc-api/api/IccExchangeDataMapApi.js.map +1 -0
- package/icc-api/api/IccFormApi.d.ts +21 -1
- package/icc-api/api/IccFormApi.js +321 -229
- package/icc-api/api/IccFormApi.js.map +1 -1
- package/icc-api/api/IccHelementApi.d.ts +21 -1
- package/icc-api/api/IccHelementApi.js +207 -137
- package/icc-api/api/IccHelementApi.js.map +1 -1
- package/icc-api/api/IccInvoiceApi.d.ts +21 -1
- package/icc-api/api/IccInvoiceApi.js +404 -298
- package/icc-api/api/IccInvoiceApi.js.map +1 -1
- package/icc-api/api/IccMaintenanceTaskApi.d.ts +12 -1
- package/icc-api/api/IccMaintenanceTaskApi.js +79 -43
- package/icc-api/api/IccMaintenanceTaskApi.js.map +1 -1
- package/icc-api/api/IccMessageApi.d.ts +28 -1
- package/icc-api/api/IccMessageApi.js +294 -191
- package/icc-api/api/IccMessageApi.js.map +1 -1
- package/icc-api/api/IccPatientApi.d.ts +12 -1
- package/icc-api/api/IccPatientApi.js +447 -351
- package/icc-api/api/IccPatientApi.js.map +1 -1
- package/icc-api/api/IccReceiptApi.d.ts +22 -8
- package/icc-api/api/IccReceiptApi.js +121 -64
- package/icc-api/api/IccReceiptApi.js.map +1 -1
- package/icc-api/api/IccRestApiPath.js +1 -1
- package/icc-api/api/IccRestApiPath.js.map +1 -1
- package/icc-api/api/IccSecureDelegationKeyMapApi.d.ts +26 -0
- package/icc-api/api/IccSecureDelegationKeyMapApi.js +71 -0
- package/icc-api/api/IccSecureDelegationKeyMapApi.js.map +1 -0
- package/icc-api/api/IccTimeTableApi.d.ts +12 -1
- package/icc-api/api/IccTimeTableApi.js +86 -48
- package/icc-api/api/IccTimeTableApi.js.map +1 -1
- package/icc-api/api/IccTopicApi.d.ts +90 -0
- package/icc-api/api/IccTopicApi.js +193 -0
- package/icc-api/api/IccTopicApi.js.map +1 -0
- package/icc-api/index.d.ts +2 -0
- package/icc-api/index.js +2 -0
- package/icc-api/index.js.map +1 -1
- package/icc-api/model/AbstractFilterMessage.d.ts +15 -0
- package/icc-api/model/AbstractFilterMessage.js +21 -0
- package/icc-api/model/AbstractFilterMessage.js.map +1 -0
- package/icc-api/model/AbstractFilterTopic.d.ts +15 -0
- package/icc-api/model/AbstractFilterTopic.js +21 -0
- package/icc-api/model/AbstractFilterTopic.js.map +1 -0
- package/icc-api/model/AccessLog.d.ts +2 -0
- package/icc-api/model/AccessLog.js.map +1 -1
- package/icc-api/model/Article.d.ts +2 -0
- package/icc-api/model/Article.js.map +1 -1
- package/icc-api/model/CalendarItem.d.ts +2 -0
- package/icc-api/model/CalendarItem.js.map +1 -1
- package/icc-api/model/Classification.d.ts +2 -0
- package/icc-api/model/Classification.js.map +1 -1
- package/icc-api/model/ClassificationTemplate.d.ts +2 -0
- package/icc-api/model/ClassificationTemplate.js.map +1 -1
- package/icc-api/model/Connection.d.ts +1 -1
- package/icc-api/model/Connection.js.map +1 -1
- package/icc-api/model/Contact.d.ts +2 -0
- package/icc-api/model/Contact.js.map +1 -1
- package/icc-api/model/Device.d.ts +4 -4
- package/icc-api/model/Device.js.map +1 -1
- package/icc-api/model/Document.d.ts +2 -0
- package/icc-api/model/Document.js.map +1 -1
- package/icc-api/model/ExchangeDataMapCreationBatch.d.ts +13 -0
- package/icc-api/model/ExchangeDataMapCreationBatch.js +10 -0
- package/icc-api/model/ExchangeDataMapCreationBatch.js.map +1 -0
- package/icc-api/model/FilterChainMessage.d.ts +19 -0
- package/icc-api/model/FilterChainMessage.js +11 -0
- package/icc-api/model/FilterChainMessage.js.map +1 -0
- package/icc-api/model/FilterChainTopic.d.ts +19 -0
- package/icc-api/model/FilterChainTopic.js +11 -0
- package/icc-api/model/FilterChainTopic.js.map +1 -0
- package/icc-api/model/Form.d.ts +2 -0
- package/icc-api/model/Form.js.map +1 -1
- package/icc-api/model/HealthElement.d.ts +2 -0
- package/icc-api/model/HealthElement.js.map +1 -1
- package/icc-api/model/HealthcareParty.d.ts +2 -2
- package/icc-api/model/HealthcareParty.js +13 -1
- package/icc-api/model/HealthcareParty.js.map +1 -1
- package/icc-api/model/IcureStub.d.ts +2 -0
- package/icc-api/model/IcureStub.js.map +1 -1
- package/icc-api/model/Invoice.d.ts +2 -0
- package/icc-api/model/Invoice.js.map +1 -1
- package/icc-api/model/MaintenanceTask.d.ts +13 -10
- package/icc-api/model/MaintenanceTask.js +13 -11
- package/icc-api/model/MaintenanceTask.js.map +1 -1
- package/icc-api/model/Message.d.ts +2 -0
- package/icc-api/model/Message.js.map +1 -1
- package/icc-api/model/PaginatedListExchangeData.d.ts +9 -0
- package/icc-api/model/PaginatedListExchangeData.js +10 -0
- package/icc-api/model/PaginatedListExchangeData.js.map +1 -0
- package/icc-api/model/PaginatedListTopic.d.ts +20 -0
- package/icc-api/model/PaginatedListTopic.js +10 -0
- package/icc-api/model/PaginatedListTopic.js.map +1 -0
- package/icc-api/model/Patient.d.ts +4 -2
- package/icc-api/model/Patient.js.map +1 -1
- package/icc-api/model/PatientByHcPartyGenderEducationProfession.d.ts +31 -0
- package/icc-api/model/PatientByHcPartyGenderEducationProfession.js +32 -0
- package/icc-api/model/PatientByHcPartyGenderEducationProfession.js.map +1 -0
- package/icc-api/model/Receipt.d.ts +2 -0
- package/icc-api/model/Receipt.js.map +1 -1
- package/icc-api/model/SecureDelegation.d.ts +52 -0
- package/icc-api/model/SecureDelegation.js +16 -0
- package/icc-api/model/SecureDelegation.js.map +1 -0
- package/icc-api/model/SecurityMetadata.d.ts +33 -0
- package/icc-api/model/SecurityMetadata.js +13 -0
- package/icc-api/model/SecurityMetadata.js.map +1 -0
- package/icc-api/model/Service.d.ts +2 -0
- package/icc-api/model/Service.js.map +1 -1
- package/icc-api/model/TimeTable.d.ts +2 -0
- package/icc-api/model/TimeTable.js.map +1 -1
- package/icc-api/model/Topic.d.ts +95 -0
- package/icc-api/model/Topic.js +16 -0
- package/icc-api/model/Topic.js.map +1 -0
- package/icc-api/model/internal/ExchangeData.d.ts +64 -0
- package/icc-api/model/internal/ExchangeData.js +15 -0
- package/icc-api/model/internal/ExchangeData.js.map +1 -0
- package/icc-api/model/internal/ExchangeDataMap.d.ts +24 -0
- package/icc-api/model/internal/ExchangeDataMap.js +13 -0
- package/icc-api/model/internal/ExchangeDataMap.js.map +1 -0
- package/icc-api/model/internal/SecureDelegationKeyMap.d.ts +14 -0
- package/icc-api/model/internal/SecureDelegationKeyMap.js +13 -0
- package/icc-api/model/internal/SecureDelegationKeyMap.js.map +1 -0
- package/icc-api/model/models.d.ts +26 -40
- package/icc-api/model/models.js +19 -37
- package/icc-api/model/models.js.map +1 -1
- package/icc-api/model/requests/EntityBulkShareResult.d.ts +28 -0
- package/icc-api/model/requests/EntityBulkShareResult.js +16 -0
- package/icc-api/model/requests/EntityBulkShareResult.js.map +1 -0
- package/icc-api/model/requests/EntityShareOrMetadataUpdateRequest.d.ts +10 -0
- package/icc-api/model/requests/EntityShareOrMetadataUpdateRequest.js +17 -0
- package/icc-api/model/requests/EntityShareOrMetadataUpdateRequest.js.map +1 -0
- package/icc-api/model/requests/EntityShareRequest.d.ts +110 -0
- package/icc-api/model/requests/EntityShareRequest.js +63 -0
- package/icc-api/model/requests/EntityShareRequest.js.map +1 -0
- package/icc-api/model/requests/EntitySharedMetadataUpdateRequest.d.ts +54 -0
- package/icc-api/model/requests/EntitySharedMetadataUpdateRequest.js +24 -0
- package/icc-api/model/requests/EntitySharedMetadataUpdateRequest.js.map +1 -0
- package/icc-api/model/requests/MinimalEntityBulkShareResult.d.ts +23 -0
- package/icc-api/model/requests/MinimalEntityBulkShareResult.js +13 -0
- package/icc-api/model/requests/MinimalEntityBulkShareResult.js.map +1 -0
- package/icc-api/model/requests/RejectedShareOrMetadataUpdateRequest.d.ts +21 -0
- package/icc-api/model/requests/RejectedShareOrMetadataUpdateRequest.js +14 -0
- package/icc-api/model/requests/RejectedShareOrMetadataUpdateRequest.js.map +1 -0
- package/icc-x-api/basexapi/EncryptedEntityXApi.d.ts +55 -6
- package/icc-x-api/basexapi/EncryptedEntityXApi.js.map +1 -1
- package/icc-x-api/crypto/AES.js +1 -1
- package/icc-x-api/crypto/AES.js.map +1 -1
- package/icc-x-api/crypto/AccessControlKeysHeadersProvider.d.ts +18 -0
- package/icc-x-api/crypto/AccessControlKeysHeadersProvider.js +50 -0
- package/icc-x-api/crypto/AccessControlKeysHeadersProvider.js.map +1 -0
- package/icc-x-api/crypto/AccessControlSecretUtils.d.ts +43 -0
- package/icc-x-api/crypto/AccessControlSecretUtils.js +97 -0
- package/icc-x-api/crypto/AccessControlSecretUtils.js.map +1 -0
- package/icc-x-api/crypto/BaseExchangeDataManager.d.ts +146 -0
- package/icc-x-api/crypto/BaseExchangeDataManager.js +342 -0
- package/icc-x-api/crypto/BaseExchangeDataManager.js.map +1 -0
- package/icc-x-api/crypto/BaseExchangeKeysManager.d.ts +0 -18
- package/icc-x-api/crypto/BaseExchangeKeysManager.js +11 -85
- package/icc-x-api/crypto/BaseExchangeKeysManager.js.map +1 -1
- package/icc-x-api/crypto/ConfidentialEntities.d.ts +26 -16
- package/icc-x-api/crypto/ConfidentialEntities.js +30 -17
- package/icc-x-api/crypto/ConfidentialEntities.js.map +1 -1
- package/icc-x-api/crypto/CryptoStrategies.d.ts +8 -1
- package/icc-x-api/crypto/CryptoStrategies.js.map +1 -1
- package/icc-x-api/crypto/DelegationsDeAnonymization.d.ts +44 -0
- package/icc-x-api/crypto/DelegationsDeAnonymization.js +235 -0
- package/icc-x-api/crypto/DelegationsDeAnonymization.js.map +1 -0
- package/icc-x-api/crypto/ExchangeDataManager.d.ts +97 -0
- package/icc-x-api/crypto/ExchangeDataManager.js +501 -0
- package/icc-x-api/crypto/ExchangeDataManager.js.map +1 -0
- package/icc-x-api/crypto/ExchangeDataMapManager.d.ts +32 -0
- package/icc-x-api/crypto/ExchangeDataMapManager.js +70 -0
- package/icc-x-api/crypto/ExchangeDataMapManager.js.map +1 -0
- package/icc-x-api/crypto/ExchangeKeysManager.d.ts +4 -16
- package/icc-x-api/crypto/ExchangeKeysManager.js +4 -62
- package/icc-x-api/crypto/ExchangeKeysManager.js.map +1 -1
- package/icc-x-api/crypto/ExtendedApisUtils.d.ts +326 -0
- package/icc-x-api/crypto/ExtendedApisUtils.js +3 -0
- package/icc-x-api/crypto/ExtendedApisUtils.js.map +1 -0
- package/icc-x-api/crypto/ExtendedApisUtilsImpl.d.ts +174 -0
- package/icc-x-api/crypto/ExtendedApisUtilsImpl.js +559 -0
- package/icc-x-api/crypto/ExtendedApisUtilsImpl.js.map +1 -0
- package/icc-x-api/crypto/KeyRecovery.d.ts +5 -2
- package/icc-x-api/crypto/KeyRecovery.js +59 -29
- package/icc-x-api/crypto/KeyRecovery.js.map +1 -1
- package/icc-x-api/crypto/LegacyCryptoStrategies.d.ts +7 -2
- package/icc-x-api/crypto/LegacyCryptoStrategies.js +8 -1
- package/icc-x-api/crypto/LegacyCryptoStrategies.js.map +1 -1
- package/icc-x-api/crypto/LegacyDelegationSecurityMetadataDecryptor.d.ts +33 -0
- package/icc-x-api/crypto/LegacyDelegationSecurityMetadataDecryptor.js +141 -0
- package/icc-x-api/crypto/LegacyDelegationSecurityMetadataDecryptor.js.map +1 -0
- package/icc-x-api/crypto/RSA.d.ts +34 -8
- package/icc-x-api/crypto/RSA.js +80 -13
- package/icc-x-api/crypto/RSA.js.map +1 -1
- package/icc-x-api/crypto/SecureDelegationsEncryption.d.ts +54 -0
- package/icc-x-api/crypto/SecureDelegationsEncryption.js +178 -0
- package/icc-x-api/crypto/SecureDelegationsEncryption.js.map +1 -0
- package/icc-x-api/crypto/SecureDelegationsManager.d.ts +66 -0
- package/icc-x-api/crypto/SecureDelegationsManager.js +261 -0
- package/icc-x-api/crypto/SecureDelegationsManager.js.map +1 -0
- package/icc-x-api/crypto/SecureDelegationsSecurityMetadataDecryptor.d.ts +46 -0
- package/icc-x-api/crypto/SecureDelegationsSecurityMetadataDecryptor.js +312 -0
- package/icc-x-api/crypto/SecureDelegationsSecurityMetadataDecryptor.js.map +1 -0
- package/icc-x-api/crypto/SecurityMetadataDecryptor.d.ts +97 -0
- package/icc-x-api/crypto/SecurityMetadataDecryptor.js +79 -0
- package/icc-x-api/crypto/SecurityMetadataDecryptor.js.map +1 -0
- package/icc-x-api/crypto/ShamirKeysManager.d.ts +5 -5
- package/icc-x-api/crypto/ShamirKeysManager.js +6 -9
- package/icc-x-api/crypto/ShamirKeysManager.js.map +1 -1
- package/icc-x-api/crypto/TransferKeysManager.d.ts +8 -6
- package/icc-x-api/crypto/TransferKeysManager.js +75 -52
- package/icc-x-api/crypto/TransferKeysManager.js.map +1 -1
- package/icc-x-api/crypto/{KeyManager.d.ts → UserEncryptionKeysManager.d.ts} +4 -6
- package/icc-x-api/crypto/{KeyManager.js → UserEncryptionKeysManager.js} +43 -23
- package/icc-x-api/crypto/UserEncryptionKeysManager.js.map +1 -0
- package/icc-x-api/crypto/UserSignatureKeysManager.d.ts +26 -0
- package/icc-x-api/crypto/UserSignatureKeysManager.js +74 -0
- package/icc-x-api/crypto/UserSignatureKeysManager.js.map +1 -0
- package/icc-x-api/crypto/utils.d.ts +61 -11
- package/icc-x-api/crypto/utils.js +113 -44
- package/icc-x-api/crypto/utils.js.map +1 -1
- package/icc-x-api/filters/LatestMessageByHcPartyTransportGuidFilter.d.ts +8 -0
- package/icc-x-api/filters/LatestMessageByHcPartyTransportGuidFilter.js +13 -0
- package/icc-x-api/filters/LatestMessageByHcPartyTransportGuidFilter.js.map +1 -0
- package/icc-x-api/filters/MessageByHcPartyFilter.d.ts +7 -0
- package/icc-x-api/filters/MessageByHcPartyFilter.js +13 -0
- package/icc-x-api/filters/MessageByHcPartyFilter.js.map +1 -0
- package/icc-x-api/filters/MessageByHcPartyTransportGuidFilter.d.ts +8 -0
- package/icc-x-api/filters/MessageByHcPartyTransportGuidFilter.js +13 -0
- package/icc-x-api/filters/MessageByHcPartyTransportGuidFilter.js.map +1 -0
- package/icc-x-api/filters/TopicByHcPartyFilter.d.ts +7 -0
- package/icc-x-api/filters/TopicByHcPartyFilter.js +13 -0
- package/icc-x-api/filters/TopicByHcPartyFilter.js.map +1 -0
- package/icc-x-api/filters/TopicByParticipantFilter.d.ts +7 -0
- package/icc-x-api/filters/TopicByParticipantFilter.js +13 -0
- package/icc-x-api/filters/TopicByParticipantFilter.js.map +1 -0
- package/icc-x-api/filters/filters.d.ts +5 -0
- package/icc-x-api/filters/filters.js +5 -0
- package/icc-x-api/filters/filters.js.map +1 -1
- package/icc-x-api/icc-accesslog-x-api.d.ts +49 -12
- package/icc-x-api/icc-accesslog-x-api.js +81 -44
- package/icc-x-api/icc-accesslog-x-api.js.map +1 -1
- package/icc-x-api/icc-calendar-item-x-api.d.ts +53 -15
- package/icc-x-api/icc-calendar-item-x-api.js +105 -51
- package/icc-x-api/icc-calendar-item-x-api.js.map +1 -1
- package/icc-x-api/icc-classification-x-api.d.ts +47 -10
- package/icc-x-api/icc-classification-x-api.js +62 -33
- package/icc-x-api/icc-classification-x-api.js.map +1 -1
- package/icc-x-api/icc-contact-x-api.d.ts +59 -33
- package/icc-x-api/icc-contact-x-api.js +101 -66
- package/icc-x-api/icc-contact-x-api.js.map +1 -1
- package/icc-x-api/icc-crypto-x-api.d.ts +33 -333
- package/icc-x-api/icc-crypto-x-api.js +47 -764
- package/icc-x-api/icc-crypto-x-api.js.map +1 -1
- package/icc-x-api/icc-data-owner-x-api.d.ts +20 -8
- package/icc-x-api/icc-data-owner-x-api.js +31 -10
- package/icc-x-api/icc-data-owner-x-api.js.map +1 -1
- package/icc-x-api/icc-document-x-api.d.ts +51 -12
- package/icc-x-api/icc-document-x-api.js +117 -66
- package/icc-x-api/icc-document-x-api.js.map +1 -1
- package/icc-x-api/icc-form-x-api.d.ts +48 -11
- package/icc-x-api/icc-form-x-api.js +71 -37
- package/icc-x-api/icc-form-x-api.js.map +1 -1
- package/icc-x-api/icc-hcparty-x-api.d.ts +2 -2
- package/icc-x-api/icc-hcparty-x-api.js +3 -3
- package/icc-x-api/icc-hcparty-x-api.js.map +1 -1
- package/icc-x-api/icc-helement-x-api.d.ts +59 -20
- package/icc-x-api/icc-helement-x-api.js +78 -43
- package/icc-x-api/icc-helement-x-api.js.map +1 -1
- package/icc-x-api/icc-icure-maintenance-x-api.d.ts +7 -2
- package/icc-x-api/icc-icure-maintenance-x-api.js +38 -27
- package/icc-x-api/icc-icure-maintenance-x-api.js.map +1 -1
- package/icc-x-api/icc-invoice-x-api.d.ts +53 -16
- package/icc-x-api/icc-invoice-x-api.js +69 -35
- package/icc-x-api/icc-invoice-x-api.js.map +1 -1
- package/icc-x-api/icc-maintenance-task-x-api.d.ts +56 -22
- package/icc-x-api/icc-maintenance-task-x-api.js +77 -36
- package/icc-x-api/icc-maintenance-task-x-api.js.map +1 -1
- package/icc-x-api/icc-message-x-api.d.ts +75 -19
- package/icc-x-api/icc-message-x-api.js +126 -37
- package/icc-x-api/icc-message-x-api.js.map +1 -1
- package/icc-x-api/icc-patient-x-api.d.ts +86 -29
- package/icc-x-api/icc-patient-x-api.js +318 -379
- package/icc-x-api/icc-patient-x-api.js.map +1 -1
- package/icc-x-api/icc-receipt-x-api.d.ts +47 -13
- package/icc-x-api/icc-receipt-x-api.js +72 -36
- package/icc-x-api/icc-receipt-x-api.js.map +1 -1
- package/icc-x-api/icc-time-table-x-api.d.ts +46 -13
- package/icc-x-api/icc-time-table-x-api.js +61 -27
- package/icc-x-api/icc-time-table-x-api.js.map +1 -1
- package/icc-x-api/icc-topic-x-api.d.ts +191 -0
- package/icc-x-api/icc-topic-x-api.js +307 -0
- package/icc-x-api/icc-topic-x-api.js.map +1 -0
- package/icc-x-api/icc-user-x-api.d.ts +2 -2
- package/icc-x-api/icc-user-x-api.js +3 -3
- package/icc-x-api/icc-user-x-api.js.map +1 -1
- package/icc-x-api/index.d.ts +18 -2
- package/icc-x-api/index.js +203 -156
- package/icc-x-api/index.js.map +1 -1
- package/icc-x-api/maintenance/KeyPairUpdateRequest.d.ts +1 -1
- package/icc-x-api/storage/DefaultStorageEntryKeysFactory.d.ts +2 -0
- package/icc-x-api/storage/DefaultStorageEntryKeysFactory.js +9 -2
- package/icc-x-api/storage/DefaultStorageEntryKeysFactory.js.map +1 -1
- package/icc-x-api/storage/IcureStorageFacade.d.ts +23 -2
- package/icc-x-api/storage/IcureStorageFacade.js +36 -2
- package/icc-x-api/storage/IcureStorageFacade.js.map +1 -1
- package/icc-x-api/storage/KeyStorageFacade.d.ts +12 -0
- package/icc-x-api/storage/KeyStorageFacade.js.map +1 -1
- package/icc-x-api/storage/KeyStorageImpl.d.ts +2 -0
- package/icc-x-api/storage/KeyStorageImpl.js +10 -0
- package/icc-x-api/storage/KeyStorageImpl.js.map +1 -1
- package/icc-x-api/storage/StorageEntryKeysFactory.d.ts +14 -1
- package/icc-x-api/storage/StorageEntryKeysFactory.js.map +1 -1
- package/icc-x-api/utils/EntityWithDelegationTypeName.d.ts +32 -0
- package/icc-x-api/utils/EntityWithDelegationTypeName.js +75 -0
- package/icc-x-api/utils/EntityWithDelegationTypeName.js.map +1 -0
- package/icc-x-api/utils/ShareResult.d.ts +74 -0
- package/icc-x-api/utils/ShareResult.js +61 -0
- package/icc-x-api/utils/ShareResult.js.map +1 -0
- package/icc-x-api/utils/binary-utils.d.ts +1 -0
- package/icc-x-api/utils/binary-utils.js +8 -1
- package/icc-x-api/utils/binary-utils.js.map +1 -1
- package/icc-x-api/utils/collection-utils.d.ts +5 -0
- package/icc-x-api/utils/collection-utils.js +26 -1
- package/icc-x-api/utils/collection-utils.js.map +1 -1
- package/icc-x-api/utils/crypto-utils.d.ts +4 -3
- package/icc-x-api/utils/crypto-utils.js +5 -4
- package/icc-x-api/utils/crypto-utils.js.map +1 -1
- package/icc-x-api/utils/lru-temporised-async-cache.d.ts +26 -3
- package/icc-x-api/utils/lru-temporised-async-cache.js +75 -15
- package/icc-x-api/utils/lru-temporised-async-cache.js.map +1 -1
- package/icc-x-api/utils/websocket.d.ts +14 -10
- package/icc-x-api/utils/websocket.js +26 -9
- package/icc-x-api/utils/websocket.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/package.json +2 -3
- package/icc-x-api/crypto/EntitiesEncryption.d.ts +0 -275
- package/icc-x-api/crypto/EntitiesEncryption.js +0 -734
- package/icc-x-api/crypto/EntitiesEncryption.js.map +0 -1
- package/icc-x-api/crypto/KeyManager.js.map +0 -1
|
@@ -16,9 +16,11 @@ const XHR_1 = require("../icc-api/api/XHR");
|
|
|
16
16
|
const models = require("../icc-api/model/models");
|
|
17
17
|
const binary_utils_1 = require("./utils/binary-utils");
|
|
18
18
|
const AuthenticationProvider_1 = require("./auth/AuthenticationProvider");
|
|
19
|
+
const SecureDelegation_1 = require("../icc-api/model/SecureDelegation");
|
|
20
|
+
var AccessLevelEnum = SecureDelegation_1.SecureDelegation.AccessLevelEnum;
|
|
19
21
|
// noinspection JSUnusedGlobalSymbols
|
|
20
22
|
class IccDocumentXApi extends icc_api_1.IccDocumentApi {
|
|
21
|
-
constructor(host, headers, crypto, authApi, dataOwnerApi, authenticationProvider = new AuthenticationProvider_1.NoAuthenticationProvider(), fetchImpl = typeof window !== 'undefined'
|
|
23
|
+
constructor(host, headers, crypto, authApi, dataOwnerApi, autofillAuthor, authenticationProvider = new AuthenticationProvider_1.NoAuthenticationProvider(), fetchImpl = typeof window !== 'undefined'
|
|
22
24
|
? window.fetch
|
|
23
25
|
: typeof self !== 'undefined'
|
|
24
26
|
? self.fetch
|
|
@@ -26,6 +28,7 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
|
|
|
26
28
|
super(host, headers, authenticationProvider, fetchImpl);
|
|
27
29
|
this.crypto = crypto;
|
|
28
30
|
this.authApi = authApi;
|
|
31
|
+
this.autofillAuthor = autofillAuthor;
|
|
29
32
|
/** maps invalid UTI values to corresponding MIME type for backward-compatibility (pre-v1.0.117) */
|
|
30
33
|
this.compatUtiRevDefs = {
|
|
31
34
|
'com.adobe.encapsulatedPostscript': 'image/eps',
|
|
@@ -419,6 +422,9 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
|
|
|
419
422
|
this.authenticationProvider = authenticationProvider;
|
|
420
423
|
this.dataOwnerApi = dataOwnerApi;
|
|
421
424
|
}
|
|
425
|
+
get headers() {
|
|
426
|
+
return super.headers.then((h) => this.crypto.accessControlKeysHeaders.addAccessControlKeysHeaders(h, 'Document'));
|
|
427
|
+
}
|
|
422
428
|
/**
|
|
423
429
|
* Creates a new instance of document with initialised encryption metadata (not in the database).
|
|
424
430
|
* @param user the current user.
|
|
@@ -428,10 +434,9 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
|
|
|
428
434
|
* @param options optional parameters:
|
|
429
435
|
* - additionalDelegates: delegates which will have access to the entity in addition to the current data owner and delegates from the
|
|
430
436
|
* 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
|
|
431
|
-
* auto-delegations, in such case the access level specified here will be used.
|
|
432
|
-
*
|
|
433
|
-
*
|
|
434
|
-
* secret id of patient known by the topmost parent in the current data owner hierarchy.
|
|
437
|
+
* auto-delegations, in such case the access level specified here will be used.
|
|
438
|
+
* - preferredSfk: secret id of the message to use as the secret foreign key to use for the document. The default value will be a
|
|
439
|
+
* secret id of the message known by the topmost parent in the current data owner hierarchy.
|
|
435
440
|
* @return a new instance of document.
|
|
436
441
|
*/
|
|
437
442
|
newInstance(user, message, c = {}, options = {}) {
|
|
@@ -439,27 +444,25 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
|
|
|
439
444
|
return __awaiter(this, void 0, void 0, function* () {
|
|
440
445
|
if (!message && options.preferredSfk)
|
|
441
446
|
throw new Error('You need to specify parent message in order to use secret foreign keys.');
|
|
442
|
-
const document = Object.assign(Object.assign({}, (c !== null && c !== void 0 ? c : {})), { _type: 'org.taktik.icure.entities.Document', id: (_a = c === null || c === void 0 ? void 0 : c.id) !== null && _a !== void 0 ? _a : this.crypto.primitives.randomUuid(), created: (_b = c === null || c === void 0 ? void 0 : c.created) !== null && _b !== void 0 ? _b : new Date().getTime(), modified: (_c = c === null || c === void 0 ? void 0 : c.modified) !== null && _c !== void 0 ? _c : new Date().getTime(), responsible: (_d = c === null || c === void 0 ? void 0 : c.responsible) !== null && _d !== void 0 ? _d : this.dataOwnerApi.getDataOwnerIdOf(user), author: (_e = c === null || c === void 0 ? void 0 : c.author) !== null && _e !== void 0 ? _e : user.id, codes: (_f = c === null || c === void 0 ? void 0 : c.codes) !== null && _f !== void 0 ? _f : [], tags: (_g = c === null || c === void 0 ? void 0 : c.tags) !== null && _g !== void 0 ? _g : [] });
|
|
447
|
+
const document = Object.assign(Object.assign({}, (c !== null && c !== void 0 ? c : {})), { _type: 'org.taktik.icure.entities.Document', id: (_a = c === null || c === void 0 ? void 0 : c.id) !== null && _a !== void 0 ? _a : this.crypto.primitives.randomUuid(), created: (_b = c === null || c === void 0 ? void 0 : c.created) !== null && _b !== void 0 ? _b : new Date().getTime(), modified: (_c = c === null || c === void 0 ? void 0 : c.modified) !== null && _c !== void 0 ? _c : new Date().getTime(), responsible: (_d = c === null || c === void 0 ? void 0 : c.responsible) !== null && _d !== void 0 ? _d : (this.autofillAuthor ? this.dataOwnerApi.getDataOwnerIdOf(user) : undefined), author: (_e = c === null || c === void 0 ? void 0 : c.author) !== null && _e !== void 0 ? _e : (this.autofillAuthor ? user.id : undefined), codes: (_f = c === null || c === void 0 ? void 0 : c.codes) !== null && _f !== void 0 ? _f : [], tags: (_g = c === null || c === void 0 ? void 0 : c.tags) !== null && _g !== void 0 ? _g : [] });
|
|
443
448
|
const ownerId = this.dataOwnerApi.getDataOwnerIdOf(user);
|
|
444
449
|
if (ownerId !== (yield this.dataOwnerApi.getCurrentDataOwnerId()))
|
|
445
450
|
throw new Error('Can only initialise entities as current data owner.');
|
|
446
|
-
const sfk = message
|
|
451
|
+
const sfk = message
|
|
452
|
+
? (_h = options.preferredSfk) !== null && _h !== void 0 ? _h : (yield this.crypto.confidential.getAnySecretIdSharedWithParents({ entity: message, type: 'Message' }))
|
|
453
|
+
: undefined;
|
|
447
454
|
if (message && !sfk)
|
|
448
455
|
throw new Error(`Couldn't find any sfk of parent message ${message.id}`);
|
|
449
|
-
const extraDelegations = [
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
...((_o = (_m = user.autoDelegations) === null || _m === void 0 ? void 0 : _m.medicalInformation) !== null && _o !== void 0 ? _o : []),
|
|
453
|
-
];
|
|
454
|
-
return new models.Document(yield this.crypto.entities
|
|
455
|
-
.entityWithInitialisedEncryptedMetadata(document, message === null || message === void 0 ? void 0 : message.id, sfk, true, extraDelegations)
|
|
456
|
+
const extraDelegations = Object.assign(Object.assign({}, Object.fromEntries([...((_k = (_j = user.autoDelegations) === null || _j === void 0 ? void 0 : _j.all) !== null && _k !== void 0 ? _k : []), ...((_m = (_l = user.autoDelegations) === null || _l === void 0 ? void 0 : _l.medicalInformation) !== null && _m !== void 0 ? _m : [])].map((d) => [d, AccessLevelEnum.WRITE]))), ((_o = options === null || options === void 0 ? void 0 : options.additionalDelegates) !== null && _o !== void 0 ? _o : {}));
|
|
457
|
+
return new models.Document(yield this.crypto.xapi
|
|
458
|
+
.entityWithInitialisedEncryptedMetadata(document, 'Document', message === null || message === void 0 ? void 0 : message.id, sfk, true, false, extraDelegations)
|
|
456
459
|
.then((x) => x.updatedEntity));
|
|
457
460
|
});
|
|
458
461
|
}
|
|
459
462
|
// noinspection JSUnusedGlobalSymbols
|
|
460
463
|
findByMessage(hcpartyId, message) {
|
|
461
464
|
return __awaiter(this, void 0, void 0, function* () {
|
|
462
|
-
const extractedKeys = yield this.crypto.
|
|
465
|
+
const extractedKeys = yield this.crypto.xapi.secretIdsOf({ entity: message, type: 'Message' }, hcpartyId);
|
|
463
466
|
const topmostParentId = (yield this.dataOwnerApi.getCurrentDataOwnerHierarchyIds())[0];
|
|
464
467
|
let documents = yield this.findDocumentsByHCPartyPatientForeignKeys(topmostParentId, _.uniq(extractedKeys).join(','));
|
|
465
468
|
return yield this.decrypt(hcpartyId, documents);
|
|
@@ -467,19 +470,17 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
|
|
|
467
470
|
}
|
|
468
471
|
// Note: this is only for dealing with legacy documents: new document are not encrypted, only their attachments are
|
|
469
472
|
decrypt(hcpartyId, documents) {
|
|
470
|
-
return Promise.all(documents.map((document) => this.crypto
|
|
471
|
-
|
|
472
|
-
.then(({ extractedKeys: sfks }) => {
|
|
473
|
-
if (!sfks || !sfks.length) {
|
|
473
|
+
return Promise.all(documents.map((document) => this.crypto.xapi.decryptAndImportAllDecryptionKeys({ entity: document, type: 'Document' }).then((keys) => {
|
|
474
|
+
if (!keys.length) {
|
|
474
475
|
console.log('Cannot decrypt document', document.id);
|
|
475
476
|
return Promise.resolve(document);
|
|
476
477
|
}
|
|
477
|
-
if (
|
|
478
|
-
|
|
479
|
-
|
|
478
|
+
if (keys.length && (document.encryptedSelf || document.encryptedAttachment)) {
|
|
479
|
+
const key = keys[0].key;
|
|
480
|
+
return Promise.all([
|
|
480
481
|
document.encryptedSelf
|
|
481
482
|
? new Promise((resolve) => {
|
|
482
|
-
this.crypto.AES.decrypt(key, (0, binary_utils_1.string2ua)((0, binary_utils_1.a2b)(document.encryptedSelf))).then(resolve, () => {
|
|
483
|
+
this.crypto.primitives.AES.decrypt(key, (0, binary_utils_1.string2ua)((0, binary_utils_1.a2b)(document.encryptedSelf))).then(resolve, () => {
|
|
483
484
|
console.log('Cannot decrypt document', document.id);
|
|
484
485
|
resolve(null);
|
|
485
486
|
});
|
|
@@ -487,14 +488,13 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
|
|
|
487
488
|
: Promise.resolve(null),
|
|
488
489
|
document.encryptedAttachment
|
|
489
490
|
? new Promise((resolve) => {
|
|
490
|
-
this.crypto.AES.decrypt(key, document.encryptedAttachment).then(resolve, () => {
|
|
491
|
+
this.crypto.primitives.AES.decrypt(key, document.encryptedAttachment).then(resolve, () => {
|
|
491
492
|
console.log('Cannot decrypt document', document.id);
|
|
492
493
|
resolve(null);
|
|
493
494
|
});
|
|
494
495
|
})
|
|
495
496
|
: Promise.resolve(null),
|
|
496
|
-
]))
|
|
497
|
-
.then((decrypted) => {
|
|
497
|
+
]).then((decrypted) => {
|
|
498
498
|
if (decrypted) {
|
|
499
499
|
if (decrypted[0]) {
|
|
500
500
|
document = _.extend(document, JSON.parse((0, binary_utils_1.ua2string)(decrypted[0])));
|
|
@@ -514,16 +514,29 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
|
|
|
514
514
|
return Promise.resolve(documents);
|
|
515
515
|
});
|
|
516
516
|
}
|
|
517
|
+
/**
|
|
518
|
+
* @deprecated use getMainAttachmentAs instead
|
|
519
|
+
*/
|
|
517
520
|
getAttachmentAs(documentId, attachmentId, returnType, enckeys, fileName) {
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
.
|
|
526
|
-
|
|
521
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
522
|
+
const url = this.host +
|
|
523
|
+
`/document/${documentId}/attachment/${attachmentId}` +
|
|
524
|
+
'?ts=' +
|
|
525
|
+
new Date().getTime() +
|
|
526
|
+
(enckeys ? `&enckeys=${enckeys}` : '') +
|
|
527
|
+
(fileName ? `&fileName=${fileName}` : '');
|
|
528
|
+
return XHR_1.XHR.sendCommand('GET', url, yield this.headers, null, this.fetchImpl, returnType, this.authenticationProvider.getAuthService())
|
|
529
|
+
.then((doc) => doc.body)
|
|
530
|
+
.catch((err) => this.handleError(err));
|
|
531
|
+
});
|
|
532
|
+
}
|
|
533
|
+
getMainAttachmentAs(documentId, returnType) {
|
|
534
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
535
|
+
const url = this.host + `/document/${documentId}/attachment` + '?ts=' + new Date().getTime();
|
|
536
|
+
return XHR_1.XHR.sendCommand('GET', url, yield this.headers, null, this.fetchImpl, returnType, this.authenticationProvider.getAuthService())
|
|
537
|
+
.then((doc) => doc.body)
|
|
538
|
+
.catch((err) => this.handleError(err));
|
|
539
|
+
});
|
|
527
540
|
}
|
|
528
541
|
// noinspection JSUnusedGlobalSymbols
|
|
529
542
|
getAttachmentUrl(documentId, attachmentId, sfks, fileName) {
|
|
@@ -551,9 +564,12 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
|
|
|
551
564
|
* @return the updated document.
|
|
552
565
|
*/
|
|
553
566
|
encryptAndSetDocumentAttachment(document, attachment, utis) {
|
|
567
|
+
var _a;
|
|
554
568
|
return __awaiter(this, void 0, void 0, function* () {
|
|
555
|
-
|
|
556
|
-
|
|
569
|
+
if (!document.rev)
|
|
570
|
+
throw new Error('Cannot set attachment on document without rev');
|
|
571
|
+
const { encryptedData, updatedEntity } = yield this.crypto.xapi.encryptDataOf(document, 'Document', attachment, (d) => this.modifyDocument(d));
|
|
572
|
+
return yield this.setMainDocumentAttachment(document.id, (_a = updatedEntity === null || updatedEntity === void 0 ? void 0 : updatedEntity.rev) !== null && _a !== void 0 ? _a : document.rev, encryptedData, utis);
|
|
557
573
|
});
|
|
558
574
|
}
|
|
559
575
|
/**
|
|
@@ -566,7 +582,9 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
|
|
|
566
582
|
*/
|
|
567
583
|
setClearDocumentAttachment(document, attachment, utis) {
|
|
568
584
|
return __awaiter(this, void 0, void 0, function* () {
|
|
569
|
-
|
|
585
|
+
if (!document.rev)
|
|
586
|
+
throw new Error('Cannot set attachment on document without rev');
|
|
587
|
+
return yield this.setMainDocumentAttachment(document.id, document.rev, attachment, utis);
|
|
570
588
|
});
|
|
571
589
|
}
|
|
572
590
|
/**
|
|
@@ -579,9 +597,12 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
|
|
|
579
597
|
* @return the updated document.
|
|
580
598
|
*/
|
|
581
599
|
encryptAndSetSecondaryDocumentAttachment(document, secondaryAttachmentKey, attachment, utis) {
|
|
600
|
+
var _a;
|
|
582
601
|
return __awaiter(this, void 0, void 0, function* () {
|
|
583
|
-
|
|
584
|
-
|
|
602
|
+
if (!document.rev)
|
|
603
|
+
throw new Error('Cannot set attachment on document without rev');
|
|
604
|
+
const { encryptedData, updatedEntity } = yield this.crypto.xapi.encryptDataOf(document, 'Document', attachment, (d) => this.modifyDocument());
|
|
605
|
+
return yield this.setSecondaryAttachment(document.id, secondaryAttachmentKey, (_a = updatedEntity === null || updatedEntity === void 0 ? void 0 : updatedEntity.rev) !== null && _a !== void 0 ? _a : document.rev, encryptedData, utis);
|
|
585
606
|
});
|
|
586
607
|
}
|
|
587
608
|
/**
|
|
@@ -607,10 +628,10 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
|
|
|
607
628
|
*/
|
|
608
629
|
getAndDecryptDocumentAttachment(document, validator = () => Promise.resolve(true)) {
|
|
609
630
|
return __awaiter(this, void 0, void 0, function* () {
|
|
610
|
-
const
|
|
611
|
-
if (!wasDecrypted)
|
|
631
|
+
const retrieved = yield this.getAndTryDecryptDocumentAttachment(document, (x) => validator(x));
|
|
632
|
+
if (!retrieved.wasDecrypted)
|
|
612
633
|
throw new Error(`No valid key found to decrypt data of document ${document.id}.`);
|
|
613
|
-
return data;
|
|
634
|
+
return retrieved.data;
|
|
614
635
|
});
|
|
615
636
|
}
|
|
616
637
|
/**
|
|
@@ -624,7 +645,7 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
|
|
|
624
645
|
*/
|
|
625
646
|
getAndTryDecryptDocumentAttachment(document, validator = () => Promise.resolve(true)) {
|
|
626
647
|
return __awaiter(this, void 0, void 0, function* () {
|
|
627
|
-
return yield this.crypto.
|
|
648
|
+
return yield this.crypto.xapi.tryDecryptDataOf({ entity: document, type: 'Document' }, yield this.getRawMainDocumentAttachment(document.id), (x) => validator(x));
|
|
628
649
|
});
|
|
629
650
|
}
|
|
630
651
|
/**
|
|
@@ -637,7 +658,7 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
|
|
|
637
658
|
*/
|
|
638
659
|
getAndDecryptSecondaryDocumentAttachment(document, secondaryAttachmentKey, validator = () => Promise.resolve(true)) {
|
|
639
660
|
return __awaiter(this, void 0, void 0, function* () {
|
|
640
|
-
const { data, wasDecrypted } = yield this.
|
|
661
|
+
const { data, wasDecrypted } = yield this.getAndTryDecryptSecondaryDocumentAttachment(document, secondaryAttachmentKey, (x) => validator(x));
|
|
641
662
|
if (!wasDecrypted)
|
|
642
663
|
throw new Error(`No valid key found to decrypt data of document ${document.id}.`);
|
|
643
664
|
return data;
|
|
@@ -655,7 +676,7 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
|
|
|
655
676
|
*/
|
|
656
677
|
getAndTryDecryptSecondaryDocumentAttachment(document, secondaryAttachmentKey, validator = () => Promise.resolve(true)) {
|
|
657
678
|
return __awaiter(this, void 0, void 0, function* () {
|
|
658
|
-
return yield this.crypto.
|
|
679
|
+
return yield this.crypto.xapi.tryDecryptDataOf({ entity: document, type: 'Document' }, yield this.getSecondaryAttachment(document.id, secondaryAttachmentKey), (x) => validator(x));
|
|
659
680
|
});
|
|
660
681
|
}
|
|
661
682
|
/**
|
|
@@ -665,12 +686,20 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
|
|
|
665
686
|
*/
|
|
666
687
|
decryptMessageIdOf(document) {
|
|
667
688
|
return __awaiter(this, void 0, void 0, function* () {
|
|
668
|
-
return this.crypto.
|
|
689
|
+
return this.crypto.xapi.owningEntityIdsOf({ entity: document, type: 'Document' }, undefined);
|
|
690
|
+
});
|
|
691
|
+
}
|
|
692
|
+
/**
|
|
693
|
+
* @return if the logged data owner has write access to the content of the given document
|
|
694
|
+
*/
|
|
695
|
+
hasWriteAccess(document) {
|
|
696
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
697
|
+
return this.crypto.xapi.hasWriteAccess({ entity: document, type: 'Document' });
|
|
669
698
|
});
|
|
670
699
|
}
|
|
671
700
|
/**
|
|
672
701
|
* Share an existing document with other data owners, allowing them to access the non-encrypted data of the document and optionally also
|
|
673
|
-
* the encrypted content.
|
|
702
|
+
* the encrypted content, with read-only or read-write permissions.
|
|
674
703
|
* @param delegateId the id of the data owner which will be granted access to the document.
|
|
675
704
|
* @param document the document to share.
|
|
676
705
|
* @param options optional parameters to customize the sharing behaviour:
|
|
@@ -678,7 +707,8 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
|
|
|
678
707
|
* content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}).
|
|
679
708
|
* - shareMessageId: specifies if the id of the message that this document refers to should be shared with the delegate (defaults to
|
|
680
709
|
* {@link ShareMetadataBehaviour.IF_AVAILABLE}).
|
|
681
|
-
*
|
|
710
|
+
* - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.
|
|
711
|
+
* @return the updated entity
|
|
682
712
|
*/
|
|
683
713
|
shareWith(delegateId, document, options = {}) {
|
|
684
714
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -687,40 +717,61 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
|
|
|
687
717
|
}
|
|
688
718
|
/**
|
|
689
719
|
* Share an existing document with other data owners, allowing them to access the non-encrypted data of the document and optionally also
|
|
690
|
-
* the encrypted content.
|
|
720
|
+
* the encrypted content, with read-only or read-write permissions.
|
|
691
721
|
* @param document the document to share.
|
|
692
|
-
* @param delegates
|
|
722
|
+
* @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options:
|
|
693
723
|
* - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted
|
|
694
724
|
* content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}).
|
|
695
725
|
* - shareMessageId: specifies if the id of the message that this document refers to should be shared with the delegate (defaults to
|
|
696
726
|
* {@link ShareMetadataBehaviour.IF_AVAILABLE}).
|
|
697
|
-
*
|
|
727
|
+
* - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.
|
|
728
|
+
* @return the updated entity.
|
|
698
729
|
*/
|
|
699
730
|
shareWithMany(document, delegates) {
|
|
700
731
|
return __awaiter(this, void 0, void 0, function* () {
|
|
701
|
-
|
|
732
|
+
return (yield this.tryShareWithMany(document, delegates)).updatedEntityOrThrow;
|
|
733
|
+
});
|
|
734
|
+
}
|
|
735
|
+
/**
|
|
736
|
+
* Share an existing document with other data owners, allowing them to access the non-encrypted data of the document and optionally also
|
|
737
|
+
* the encrypted content, with read-only or read-write permissions.
|
|
738
|
+
* @param document the document to share.
|
|
739
|
+
* @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options:
|
|
740
|
+
* - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted
|
|
741
|
+
* content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}).
|
|
742
|
+
* - shareMessageId: specifies if the id of the message that this document refers to should be shared with the delegate (defaults to
|
|
743
|
+
* {@link ShareMetadataBehaviour.IF_AVAILABLE}).
|
|
744
|
+
* - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.
|
|
745
|
+
* @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
|
|
746
|
+
* the operation failed.
|
|
747
|
+
*/
|
|
748
|
+
tryShareWithMany(document, delegates) {
|
|
749
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
750
|
+
const self = yield this.dataOwnerApi.getCurrentDataOwnerId();
|
|
751
|
+
// All entities should have an encryption key.
|
|
752
|
+
const entityWithEncryptionKey = yield this.crypto.xapi.ensureEncryptionKeysInitialised(document, 'Document');
|
|
753
|
+
const updatedEntity = entityWithEncryptionKey ? yield this.modifyDocument(entityWithEncryptionKey) : document;
|
|
754
|
+
return this.crypto.xapi
|
|
755
|
+
.simpleShareOrUpdateEncryptedEntityMetadata({ entity: updatedEntity, type: 'Document' }, true, Object.fromEntries(Object.entries(delegates).map(([delegateId, options]) => [
|
|
702
756
|
delegateId,
|
|
703
757
|
{
|
|
704
|
-
|
|
758
|
+
requestedPermissions: options.requestedPermissions,
|
|
759
|
+
shareEncryptionKeys: options.shareEncryptionKey,
|
|
705
760
|
shareOwningEntityIds: options.shareMessageId,
|
|
761
|
+
shareSecretIds: undefined,
|
|
706
762
|
},
|
|
707
|
-
])))
|
|
708
|
-
|
|
709
|
-
return yield this.modifyDocument(extended);
|
|
710
|
-
}
|
|
711
|
-
else
|
|
712
|
-
return document;
|
|
763
|
+
])), (x) => this.bulkShareDocument(x))
|
|
764
|
+
.then((r) => r.mapSuccessAsync((e) => this.decrypt(self, [e]).then((es) => es[0])));
|
|
713
765
|
});
|
|
714
766
|
}
|
|
715
767
|
getDataOwnersWithAccessTo(entity) {
|
|
716
|
-
return
|
|
717
|
-
return yield this.crypto.entities.getDataOwnersWithAccessTo(entity);
|
|
718
|
-
});
|
|
768
|
+
return this.crypto.delegationsDeAnonymization.getDataOwnersWithAccessTo({ entity, type: 'Document' });
|
|
719
769
|
}
|
|
720
770
|
getEncryptionKeysOf(entity) {
|
|
721
|
-
return
|
|
722
|
-
|
|
723
|
-
|
|
771
|
+
return this.crypto.xapi.encryptionKeysOf({ entity, type: 'Document' }, undefined);
|
|
772
|
+
}
|
|
773
|
+
createDelegationDeAnonymizationMetadata(entity, delegates) {
|
|
774
|
+
return this.crypto.delegationsDeAnonymization.createOrUpdateDeAnonymizationInfo({ entity, type: 'Document' }, delegates);
|
|
724
775
|
}
|
|
725
776
|
}
|
|
726
777
|
exports.IccDocumentXApi = IccDocumentXApi;
|