@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
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
exports.IccDocumentApi = void 0;
|
|
4
13
|
/**
|
|
@@ -18,15 +27,19 @@ const Document_1 = require("../model/Document");
|
|
|
18
27
|
const IcureStub_1 = require("../model/IcureStub");
|
|
19
28
|
const AuthenticationProvider_1 = require("../../icc-x-api/auth/AuthenticationProvider");
|
|
20
29
|
const IccRestApiPath_1 = require("./IccRestApiPath");
|
|
30
|
+
const EntityBulkShareResult_1 = require("../model/requests/EntityBulkShareResult");
|
|
21
31
|
class IccDocumentApi {
|
|
32
|
+
get headers() {
|
|
33
|
+
return Promise.resolve(this._headers);
|
|
34
|
+
}
|
|
22
35
|
constructor(host, headers, authenticationProvider, fetchImpl) {
|
|
23
36
|
this.host = (0, IccRestApiPath_1.iccRestApiPath)(host);
|
|
24
|
-
this.
|
|
37
|
+
this._headers = Object.keys(headers).map((k) => new XHR_1.XHR.Header(k, headers[k]));
|
|
25
38
|
this.authenticationProvider = !!authenticationProvider ? authenticationProvider : new AuthenticationProvider_1.NoAuthenticationProvider();
|
|
26
39
|
this.fetchImpl = fetchImpl;
|
|
27
40
|
}
|
|
28
41
|
setHeaders(h) {
|
|
29
|
-
this.
|
|
42
|
+
this._headers = h;
|
|
30
43
|
}
|
|
31
44
|
handleError(e) {
|
|
32
45
|
throw e;
|
|
@@ -37,14 +50,16 @@ class IccDocumentApi {
|
|
|
37
50
|
* @param body
|
|
38
51
|
*/
|
|
39
52
|
createDocument(body) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
.
|
|
47
|
-
|
|
53
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
let _body = null;
|
|
55
|
+
_body = body;
|
|
56
|
+
const _url = this.host + `/document` + '?ts=' + new Date().getTime();
|
|
57
|
+
let headers = yield this.headers;
|
|
58
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
59
|
+
return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
60
|
+
.then((doc) => new Document_1.Document(doc.body))
|
|
61
|
+
.catch((err) => this.handleError(err));
|
|
62
|
+
});
|
|
48
63
|
}
|
|
49
64
|
/**
|
|
50
65
|
* Deletes a document's attachment and returns the modified document instance afterward
|
|
@@ -52,12 +67,14 @@ class IccDocumentApi {
|
|
|
52
67
|
* @param documentId
|
|
53
68
|
*/
|
|
54
69
|
deleteAttachment(documentId) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
.
|
|
60
|
-
|
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
let _body = null;
|
|
72
|
+
const _url = this.host + `/document/${encodeURIComponent(String(documentId))}/attachment` + '?ts=' + new Date().getTime();
|
|
73
|
+
let headers = yield this.headers;
|
|
74
|
+
return XHR_1.XHR.sendCommand('DELETE', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
75
|
+
.then((doc) => new Document_1.Document(doc.body))
|
|
76
|
+
.catch((err) => this.handleError(err));
|
|
77
|
+
});
|
|
61
78
|
}
|
|
62
79
|
/**
|
|
63
80
|
* Deletes a batch of documents and returns the list of deleted document ids
|
|
@@ -65,12 +82,14 @@ class IccDocumentApi {
|
|
|
65
82
|
* @param documentIds
|
|
66
83
|
*/
|
|
67
84
|
deleteDocument(documentIds) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
85
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
86
|
+
let _body = null;
|
|
87
|
+
const _url = this.host + `/document/${encodeURIComponent(String(documentIds))}` + '?ts=' + new Date().getTime();
|
|
88
|
+
let headers = yield this.headers;
|
|
89
|
+
return XHR_1.XHR.sendCommand('DELETE', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
90
|
+
.then((doc) => doc.body.map((it) => new DocIdentifier_1.DocIdentifier(it)))
|
|
91
|
+
.catch((err) => this.handleError(err));
|
|
92
|
+
});
|
|
74
93
|
}
|
|
75
94
|
/**
|
|
76
95
|
* Keys must be delimited by coma
|
|
@@ -80,18 +99,20 @@ class IccDocumentApi {
|
|
|
80
99
|
* @param secretFKeys
|
|
81
100
|
*/
|
|
82
101
|
findByTypeHCPartyMessageSecretFKeys(documentTypeCode, hcPartyId, secretFKeys) {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
102
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
103
|
+
let _body = null;
|
|
104
|
+
const _url = this.host +
|
|
105
|
+
`/document/byTypeHcPartySecretForeignKeys` +
|
|
106
|
+
'?ts=' +
|
|
107
|
+
new Date().getTime() +
|
|
108
|
+
(documentTypeCode ? '&documentTypeCode=' + encodeURIComponent(String(documentTypeCode)) : '') +
|
|
109
|
+
(hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '') +
|
|
110
|
+
(secretFKeys ? '&secretFKeys=' + encodeURIComponent(String(secretFKeys)) : '');
|
|
111
|
+
let headers = yield this.headers;
|
|
112
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
113
|
+
.then((doc) => doc.body.map((it) => new Document_1.Document(it)))
|
|
114
|
+
.catch((err) => this.handleError(err));
|
|
115
|
+
});
|
|
95
116
|
}
|
|
96
117
|
/**
|
|
97
118
|
* Keys must be delimited by coma
|
|
@@ -100,17 +121,19 @@ class IccDocumentApi {
|
|
|
100
121
|
* @param secretFKeys
|
|
101
122
|
*/
|
|
102
123
|
findDocumentsByHCPartyPatientForeignKeys(hcPartyId, secretFKeys) {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
124
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
125
|
+
let _body = null;
|
|
126
|
+
const _url = this.host +
|
|
127
|
+
`/document/byHcPartySecretForeignKeys` +
|
|
128
|
+
'?ts=' +
|
|
129
|
+
new Date().getTime() +
|
|
130
|
+
(hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '') +
|
|
131
|
+
(secretFKeys ? '&secretFKeys=' + encodeURIComponent(String(secretFKeys)) : '');
|
|
132
|
+
let headers = yield this.headers;
|
|
133
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
134
|
+
.then((doc) => doc.body.map((it) => new Document_1.Document(it)))
|
|
135
|
+
.catch((err) => this.handleError(err));
|
|
136
|
+
});
|
|
114
137
|
}
|
|
115
138
|
/**
|
|
116
139
|
* Keys must be delimited by coma
|
|
@@ -118,12 +141,14 @@ class IccDocumentApi {
|
|
|
118
141
|
* @param limit
|
|
119
142
|
*/
|
|
120
143
|
findWithoutDelegation(limit) {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
144
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
145
|
+
let _body = null;
|
|
146
|
+
const _url = this.host + `/document/woDelegation` + '?ts=' + new Date().getTime() + (limit ? '&limit=' + encodeURIComponent(String(limit)) : '');
|
|
147
|
+
let headers = yield this.headers;
|
|
148
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
149
|
+
.then((doc) => doc.body.map((it) => new Document_1.Document(it)))
|
|
150
|
+
.catch((err) => this.handleError(err));
|
|
151
|
+
});
|
|
127
152
|
}
|
|
128
153
|
/**
|
|
129
154
|
* Returns the document corresponding to the identifier passed in the request
|
|
@@ -131,33 +156,55 @@ class IccDocumentApi {
|
|
|
131
156
|
* @param documentId
|
|
132
157
|
*/
|
|
133
158
|
getDocument(documentId) {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
.
|
|
139
|
-
|
|
159
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
160
|
+
let _body = null;
|
|
161
|
+
const _url = this.host + `/document/${encodeURIComponent(String(documentId))}` + '?ts=' + new Date().getTime();
|
|
162
|
+
let headers = yield this.headers;
|
|
163
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
164
|
+
.then((doc) => new Document_1.Document(doc.body))
|
|
165
|
+
.catch((err) => this.handleError(err));
|
|
166
|
+
});
|
|
140
167
|
}
|
|
141
168
|
/**
|
|
142
|
-
*
|
|
143
|
-
* @summary Load document's attachment
|
|
144
|
-
* @param documentId
|
|
145
|
-
* @param attachmentId
|
|
146
|
-
* @param enckeys
|
|
147
|
-
* @param fileName
|
|
169
|
+
* @deprecated use getMainDocumentAttachment instead
|
|
148
170
|
*/
|
|
149
171
|
getDocumentAttachment(documentId, attachmentId, enckeys, fileName) {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
172
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
173
|
+
if (enckeys) {
|
|
174
|
+
throw new Error('Server-side encryption of attachment is not allowed anymore');
|
|
175
|
+
}
|
|
176
|
+
return this.getMainDocumentAttachment(documentId);
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Get the main attachment of a document
|
|
181
|
+
* @param documentId id of the document
|
|
182
|
+
* @return the content of the main attachment for the document (if any)
|
|
183
|
+
*/
|
|
184
|
+
getMainDocumentAttachment(documentId) {
|
|
185
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
186
|
+
let _body = null;
|
|
187
|
+
const _url = this.host + `/document/${encodeURIComponent(String(documentId))}/attachment` + '?ts=' + new Date().getTime();
|
|
188
|
+
let headers = yield this.headers;
|
|
189
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
190
|
+
.then((doc) => doc.body)
|
|
191
|
+
.catch((err) => this.handleError(err));
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Get the main attachment of a document forcing usage of `application/octet-stream` in Content-Type
|
|
196
|
+
* @param documentId id of the document
|
|
197
|
+
* @return the content of the main attachment for the document (if any)
|
|
198
|
+
*/
|
|
199
|
+
getRawMainDocumentAttachment(documentId) {
|
|
200
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
201
|
+
let _body = null;
|
|
202
|
+
const _url = this.host + `/document/${encodeURIComponent(String(documentId))}/attachment` + '?ts=' + new Date().getTime();
|
|
203
|
+
let headers = yield this.headers;
|
|
204
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, "application/octet-stream", this.authenticationProvider.getAuthService())
|
|
205
|
+
.then((doc) => doc.body)
|
|
206
|
+
.catch((err) => this.handleError(err));
|
|
207
|
+
});
|
|
161
208
|
}
|
|
162
209
|
/**
|
|
163
210
|
* Returns the first document corresponding to the externalUuid passed in the request
|
|
@@ -165,12 +212,14 @@ class IccDocumentApi {
|
|
|
165
212
|
* @param externalUuid
|
|
166
213
|
*/
|
|
167
214
|
getDocumentByExternalUuid(externalUuid) {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
.
|
|
173
|
-
|
|
215
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
216
|
+
let _body = null;
|
|
217
|
+
const _url = this.host + `/document/externaluuid/${encodeURIComponent(String(externalUuid))}` + '?ts=' + new Date().getTime();
|
|
218
|
+
let headers = yield this.headers;
|
|
219
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
220
|
+
.then((doc) => new Document_1.Document(doc.body))
|
|
221
|
+
.catch((err) => this.handleError(err));
|
|
222
|
+
});
|
|
174
223
|
}
|
|
175
224
|
/**
|
|
176
225
|
* Returns a list of document corresponding to the identifiers passed in the body
|
|
@@ -178,14 +227,16 @@ class IccDocumentApi {
|
|
|
178
227
|
* @param body
|
|
179
228
|
*/
|
|
180
229
|
getDocuments(body) {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
230
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
231
|
+
let _body = null;
|
|
232
|
+
_body = body;
|
|
233
|
+
const _url = this.host + `/document/byIds` + '?ts=' + new Date().getTime();
|
|
234
|
+
let headers = yield this.headers;
|
|
235
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
236
|
+
return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
237
|
+
.then((doc) => doc.body.map((it) => new Document_1.Document(it)))
|
|
238
|
+
.catch((err) => this.handleError(err));
|
|
239
|
+
});
|
|
189
240
|
}
|
|
190
241
|
/**
|
|
191
242
|
* Returns a list of document corresponding to the externalUuid passed in the request
|
|
@@ -193,12 +244,14 @@ class IccDocumentApi {
|
|
|
193
244
|
* @param externalUuid
|
|
194
245
|
*/
|
|
195
246
|
getDocumentsByExternalUuid(externalUuid) {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
247
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
248
|
+
let _body = null;
|
|
249
|
+
const _url = this.host + `/document/externaluuid/${encodeURIComponent(String(externalUuid))}/all` + '?ts=' + new Date().getTime();
|
|
250
|
+
let headers = yield this.headers;
|
|
251
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
252
|
+
.then((doc) => doc.body.map((it) => new Document_1.Document(it)))
|
|
253
|
+
.catch((err) => this.handleError(err));
|
|
254
|
+
});
|
|
202
255
|
}
|
|
203
256
|
/**
|
|
204
257
|
* Updates the document and returns an instance of the modified document afterward
|
|
@@ -206,14 +259,16 @@ class IccDocumentApi {
|
|
|
206
259
|
* @param body
|
|
207
260
|
*/
|
|
208
261
|
modifyDocument(body) {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
.
|
|
216
|
-
|
|
262
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
263
|
+
let _body = null;
|
|
264
|
+
_body = body;
|
|
265
|
+
const _url = this.host + `/document` + '?ts=' + new Date().getTime();
|
|
266
|
+
let headers = yield this.headers;
|
|
267
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
268
|
+
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
269
|
+
.then((doc) => new Document_1.Document(doc.body))
|
|
270
|
+
.catch((err) => this.handleError(err));
|
|
271
|
+
});
|
|
217
272
|
}
|
|
218
273
|
/**
|
|
219
274
|
* Returns the modified documents.
|
|
@@ -221,86 +276,76 @@ class IccDocumentApi {
|
|
|
221
276
|
* @param body
|
|
222
277
|
*/
|
|
223
278
|
modifyDocuments(body) {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
279
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
280
|
+
let _body = null;
|
|
281
|
+
_body = body;
|
|
282
|
+
const _url = this.host + `/document/batch` + '?ts=' + new Date().getTime();
|
|
283
|
+
let headers = yield this.headers;
|
|
284
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
285
|
+
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
286
|
+
.then((doc) => doc.body.map((it) => new Document_1.Document(it)))
|
|
287
|
+
.catch((err) => this.handleError(err));
|
|
288
|
+
});
|
|
232
289
|
}
|
|
233
290
|
/**
|
|
234
|
-
* Creates or updates a
|
|
235
|
-
* @
|
|
236
|
-
* @param
|
|
237
|
-
* @param
|
|
238
|
-
* @param enckeys
|
|
291
|
+
* Creates or updates a main attachment for a document and returns the modified document instance afterward
|
|
292
|
+
* @param documentId id of the document
|
|
293
|
+
* @param documentRev revision of the document
|
|
294
|
+
* @param body content of the attachment (must be compatible with XHR body)
|
|
239
295
|
* @param utis an array of UTIs for the attachment. The first element will be considered as the main UTI for the document. If provided and non-empty
|
|
240
296
|
* overrides existing values.
|
|
241
297
|
*/
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
.
|
|
298
|
+
setMainDocumentAttachment(documentId, documentRev, body, utis) {
|
|
299
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
300
|
+
if (!documentRev)
|
|
301
|
+
throw new Error('Document rev is required');
|
|
302
|
+
let _body = body;
|
|
303
|
+
const _url = this.host +
|
|
304
|
+
`/document/${encodeURIComponent(String(documentId))}/attachment` +
|
|
305
|
+
'?ts=' +
|
|
306
|
+
new Date().getTime() +
|
|
307
|
+
'&rev=' +
|
|
308
|
+
encodeURIComponent(String(documentRev)) +
|
|
309
|
+
(utis ? utis.map((x) => '&utis=' + encodeURIComponent(String(x))).join('') : '');
|
|
310
|
+
let headers = yield this.headers;
|
|
311
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/octet-stream'));
|
|
312
|
+
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
313
|
+
.then((doc) => new Document_1.Document(doc.body))
|
|
314
|
+
.catch((err) => this.handleError(err));
|
|
315
|
+
});
|
|
256
316
|
}
|
|
257
317
|
/**
|
|
258
|
-
*
|
|
259
|
-
* @summary Create a document's attachment
|
|
260
|
-
* @param body
|
|
261
|
-
* @param documentId
|
|
262
|
-
* @param enckeys
|
|
318
|
+
* @deprecated use setMainDocumentAttachment instead
|
|
263
319
|
*/
|
|
264
|
-
setDocumentAttachmentBody(documentId, enckeys, body) {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
'
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
(enckeys ? '&enckeys=' + encodeURIComponent(String(enckeys)) : '');
|
|
273
|
-
let headers = this.headers;
|
|
274
|
-
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/octet-stream'));
|
|
275
|
-
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
276
|
-
.then((doc) => new Document_1.Document(doc.body))
|
|
277
|
-
.catch((err) => this.handleError(err));
|
|
320
|
+
setDocumentAttachmentBody(documentId, documentRev, enckeys, body, utis) {
|
|
321
|
+
if (enckeys) {
|
|
322
|
+
throw new Error('Server-side encryption of attachment is not allowed anymore');
|
|
323
|
+
}
|
|
324
|
+
if (!body) {
|
|
325
|
+
throw new Error('body is now required.');
|
|
326
|
+
}
|
|
327
|
+
return this.setMainDocumentAttachment(documentId, documentRev, body, utis);
|
|
278
328
|
}
|
|
279
329
|
/**
|
|
280
|
-
*
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
330
|
+
* @deprecated use setMainDocumentAttachment instead
|
|
331
|
+
*/
|
|
332
|
+
setDocumentAttachment(documentId, documentRev, enckeys, body, utis) {
|
|
333
|
+
if (enckeys) {
|
|
334
|
+
throw new Error('Server-side encryption of attachment is not allowed anymore');
|
|
335
|
+
}
|
|
336
|
+
if (!body) {
|
|
337
|
+
throw new Error('body is now required.');
|
|
338
|
+
}
|
|
339
|
+
return this.setMainDocumentAttachment(documentId, documentRev, body, utis);
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* @deprecated use setMainDocumentAttachment instead
|
|
285
343
|
*/
|
|
286
|
-
setDocumentAttachmentMulti(attachment, documentId, enckeys) {
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
const parts = Array.isArray(attachment) ? attachment : [attachment];
|
|
290
|
-
const _blob = new Blob(parts, { type: 'application/octet-stream' });
|
|
291
|
-
_body = new FormData();
|
|
292
|
-
_body.append('attachment', _blob);
|
|
344
|
+
setDocumentAttachmentMulti(attachment, documentRev, documentId, enckeys) {
|
|
345
|
+
if (enckeys) {
|
|
346
|
+
throw new Error('Server-side encryption of attachment is not allowed anymore');
|
|
293
347
|
}
|
|
294
|
-
|
|
295
|
-
`/document/${encodeURIComponent(String(documentId))}/attachment/multipart` +
|
|
296
|
-
'?ts=' +
|
|
297
|
-
new Date().getTime() +
|
|
298
|
-
(enckeys ? '&enckeys=' + encodeURIComponent(String(enckeys)) : '');
|
|
299
|
-
let headers = this.headers;
|
|
300
|
-
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'multipart/form-data'));
|
|
301
|
-
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
302
|
-
.then((doc) => new Document_1.Document(doc.body))
|
|
303
|
-
.catch((err) => this.handleError(err));
|
|
348
|
+
return this.setMainDocumentAttachment(documentId, documentRev, attachment);
|
|
304
349
|
}
|
|
305
350
|
/**
|
|
306
351
|
* Keys must be delimited by coma
|
|
@@ -308,14 +353,16 @@ class IccDocumentApi {
|
|
|
308
353
|
* @param body
|
|
309
354
|
*/
|
|
310
355
|
setDocumentsDelegations(body) {
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
356
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
357
|
+
let _body = null;
|
|
358
|
+
_body = body;
|
|
359
|
+
const _url = this.host + `/document/delegations` + '?ts=' + new Date().getTime();
|
|
360
|
+
let headers = yield this.headers;
|
|
361
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
362
|
+
return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
363
|
+
.then((doc) => doc.body.map((it) => new IcureStub_1.IcureStub(it)))
|
|
364
|
+
.catch((err) => this.handleError(err));
|
|
365
|
+
});
|
|
319
366
|
}
|
|
320
367
|
/**
|
|
321
368
|
* Creates or updates a secondary attachment for a document and returns the modified document instance afterward
|
|
@@ -329,20 +376,22 @@ class IccDocumentApi {
|
|
|
329
376
|
* @return the updated document
|
|
330
377
|
*/
|
|
331
378
|
setSecondaryAttachment(documentId, key, rev, attachment, utis) {
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
.
|
|
345
|
-
|
|
379
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
380
|
+
const _url = this.host +
|
|
381
|
+
`/document/` +
|
|
382
|
+
encodeURIComponent(String(documentId)) +
|
|
383
|
+
'/secondaryAttachments/' +
|
|
384
|
+
encodeURIComponent(String(key)) +
|
|
385
|
+
'?ts=' +
|
|
386
|
+
new Date().getTime() +
|
|
387
|
+
(rev ? '&rev=' + encodeURIComponent(String(rev)) : '') +
|
|
388
|
+
(utis ? utis.map((x) => '&utis=' + encodeURIComponent(String(x))).join('') : '');
|
|
389
|
+
let headers = yield this.headers;
|
|
390
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/octet-stream'));
|
|
391
|
+
return XHR_1.XHR.sendCommand('PUT', _url, headers, attachment, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
392
|
+
.then((doc) => new Document_1.Document(doc.body))
|
|
393
|
+
.catch((err) => this.handleError(err));
|
|
394
|
+
});
|
|
346
395
|
}
|
|
347
396
|
/**
|
|
348
397
|
* Get the secondary attachment with the provided key for a document
|
|
@@ -353,16 +402,18 @@ class IccDocumentApi {
|
|
|
353
402
|
* @return the content of the attachment
|
|
354
403
|
*/
|
|
355
404
|
getSecondaryAttachment(documentId, key, fileName) {
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
.
|
|
365
|
-
|
|
405
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
406
|
+
let _body = null;
|
|
407
|
+
const _url = this.host +
|
|
408
|
+
`/document/${encodeURIComponent(String(documentId))}/secondaryAttachments/${encodeURIComponent(String(key))}` +
|
|
409
|
+
'?ts=' +
|
|
410
|
+
new Date().getTime() +
|
|
411
|
+
(fileName ? '&fileName=' + encodeURIComponent(String(fileName)) : '');
|
|
412
|
+
let headers = yield this.headers;
|
|
413
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
414
|
+
.then((doc) => doc.body)
|
|
415
|
+
.catch((err) => this.handleError(err));
|
|
416
|
+
});
|
|
366
417
|
}
|
|
367
418
|
/**
|
|
368
419
|
* Deletes a document's attachment and returns the modified document instance afterward
|
|
@@ -373,16 +424,32 @@ class IccDocumentApi {
|
|
|
373
424
|
* @return the updated document
|
|
374
425
|
*/
|
|
375
426
|
deleteSecondaryAttachment(documentId, key, rev) {
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
.
|
|
385
|
-
|
|
427
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
428
|
+
let _body = null;
|
|
429
|
+
const _url = this.host +
|
|
430
|
+
`/document/${encodeURIComponent(String(documentId))}/secondaryAttachments/${encodeURIComponent(String(key))}` +
|
|
431
|
+
'?ts=' +
|
|
432
|
+
new Date().getTime() +
|
|
433
|
+
(rev ? '&rev=' + encodeURIComponent(String(rev)) : '');
|
|
434
|
+
let headers = yield this.headers;
|
|
435
|
+
return XHR_1.XHR.sendCommand('DELETE', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
436
|
+
.then((doc) => new Document_1.Document(doc.body))
|
|
437
|
+
.catch((err) => this.handleError(err));
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
// TODO single request multi-attachment update
|
|
441
|
+
/**
|
|
442
|
+
* @internal this method is for internal use only and may be changed without notice
|
|
443
|
+
*/
|
|
444
|
+
bulkShareDocument(request) {
|
|
445
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
446
|
+
const _url = this.host + '/document/bulkSharedMetadataUpdate' + '?ts=' + new Date().getTime();
|
|
447
|
+
let headers = yield this.headers;
|
|
448
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
449
|
+
return XHR_1.XHR.sendCommand('PUT', _url, headers, request, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
450
|
+
.then((doc) => doc.body.map((x) => new EntityBulkShareResult_1.EntityBulkShareResult(x, Document_1.Document)))
|
|
451
|
+
.catch((err) => this.handleError(err));
|
|
452
|
+
});
|
|
386
453
|
}
|
|
387
454
|
}
|
|
388
455
|
exports.IccDocumentApi = IccDocumentApi;
|