@icure/api 7.1.13 → 8.0.0-RC.1
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 +23 -1
- package/icc-api/api/IccAccesslogApi.js +154 -84
- 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 +32 -25
- package/icc-api/api/IccDocumentApi.js +264 -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 +28 -5
- package/icc-api/api/IccFormApi.js +328 -222
- package/icc-api/api/IccFormApi.js.map +1 -1
- package/icc-api/api/IccGroupApi.d.ts +40 -7
- package/icc-api/api/IccGroupApi.js +91 -16
- package/icc-api/api/IccGroupApi.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 +12 -1
- package/icc-api/api/IccMessageApi.js +257 -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/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/XHR.js +1 -1
- package/icc-api/api/XHR.js.map +1 -1
- package/icc-api/index.d.ts +1 -0
- package/icc-api/index.js +1 -0
- package/icc-api/index.js.map +1 -1
- package/icc-api/model/AccessLog.d.ts +4 -0
- package/icc-api/model/AccessLog.js +1 -0
- package/icc-api/model/AccessLog.js.map +1 -1
- package/icc-api/model/Article.d.ts +4 -0
- package/icc-api/model/Article.js +1 -0
- package/icc-api/model/Article.js.map +1 -1
- package/icc-api/model/CalendarItem.d.ts +6 -1
- package/icc-api/model/CalendarItem.js +1 -0
- package/icc-api/model/CalendarItem.js.map +1 -1
- package/icc-api/model/Classification.d.ts +4 -0
- package/icc-api/model/Classification.js +1 -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/Contact.d.ts +4 -0
- package/icc-api/model/Contact.js +1 -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 +4 -0
- package/icc-api/model/Document.js +1 -0
- package/icc-api/model/Document.js.map +1 -1
- package/icc-api/model/ExchangeData.d.ts +61 -0
- package/icc-api/model/ExchangeData.js +12 -0
- package/icc-api/model/ExchangeData.js.map +1 -0
- package/icc-api/model/ExchangeDataMap.d.ts +21 -0
- package/icc-api/model/ExchangeDataMap.js +10 -0
- package/icc-api/model/ExchangeDataMap.js.map +1 -0
- 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/Form.d.ts +4 -0
- package/icc-api/model/Form.js +1 -0
- package/icc-api/model/Form.js.map +1 -1
- package/icc-api/model/FormTemplate.d.ts +2 -1
- package/icc-api/model/FormTemplate.js +2 -1
- package/icc-api/model/FormTemplate.js.map +1 -1
- package/icc-api/model/Group.d.ts +7 -0
- package/icc-api/model/Group.js.map +1 -1
- package/icc-api/model/GroupDatabasesInfo.d.ts +1 -0
- package/icc-api/model/GroupDatabasesInfo.js.map +1 -1
- package/icc-api/model/HealthElement.d.ts +4 -0
- package/icc-api/model/HealthElement.js +1 -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.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 +4 -0
- package/icc-api/model/Invoice.js +1 -0
- package/icc-api/model/Invoice.js.map +1 -1
- package/icc-api/model/MaintenanceTask.d.ts +4 -0
- package/icc-api/model/MaintenanceTask.js +1 -0
- package/icc-api/model/MaintenanceTask.js.map +1 -1
- package/icc-api/model/Message.d.ts +4 -0
- package/icc-api/model/Message.js +1 -0
- package/icc-api/model/Message.js.map +1 -1
- package/icc-api/model/OperationToken.d.ts +18 -0
- package/icc-api/model/OperationToken.js +21 -0
- package/icc-api/model/OperationToken.js.map +1 -0
- 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/Patient.d.ts +6 -2
- package/icc-api/model/Patient.js +1 -0
- 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 +4 -0
- package/icc-api/model/Receipt.js +1 -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 +4 -0
- package/icc-api/model/TimeTable.js +1 -0
- package/icc-api/model/TimeTable.js.map +1 -1
- package/icc-api/model/models.d.ts +20 -39
- package/icc-api/model/models.js +15 -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 +3 -2
- 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 +16 -0
- package/icc-x-api/crypto/AccessControlKeysHeadersProvider.js +41 -0
- package/icc-x-api/crypto/AccessControlKeysHeadersProvider.js.map +1 -0
- package/icc-x-api/crypto/AccessControlSecretUtils.d.ts +42 -0
- package/icc-x-api/crypto/AccessControlSecretUtils.js +86 -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/ExchangeDataManager.d.ts +95 -0
- package/icc-x-api/crypto/ExchangeDataManager.js +493 -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 +336 -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 +181 -0
- package/icc-x-api/crypto/ExtendedApisUtilsImpl.js +562 -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 +39 -0
- package/icc-x-api/crypto/LegacyDelegationSecurityMetadataDecryptor.js +150 -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 +37 -0
- package/icc-x-api/crypto/SecureDelegationsSecurityMetadataDecryptor.js +294 -0
- package/icc-x-api/crypto/SecureDelegationsSecurityMetadataDecryptor.js.map +1 -0
- package/icc-x-api/crypto/SecurityMetadataDecryptor.d.ts +114 -0
- package/icc-x-api/crypto/SecurityMetadataDecryptor.js +98 -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/filters.js.map +1 -1
- package/icc-x-api/icc-accesslog-x-api.d.ts +46 -11
- package/icc-x-api/icc-accesslog-x-api.js +75 -42
- package/icc-x-api/icc-accesslog-x-api.js.map +1 -1
- package/icc-x-api/icc-calendar-item-x-api.d.ts +50 -14
- package/icc-x-api/icc-calendar-item-x-api.js +99 -49
- package/icc-x-api/icc-calendar-item-x-api.js.map +1 -1
- package/icc-x-api/icc-classification-x-api.d.ts +44 -9
- package/icc-x-api/icc-classification-x-api.js +56 -31
- package/icc-x-api/icc-classification-x-api.js.map +1 -1
- package/icc-x-api/icc-contact-x-api.d.ts +56 -32
- package/icc-x-api/icc-contact-x-api.js +95 -64
- package/icc-x-api/icc-contact-x-api.js.map +1 -1
- package/icc-x-api/icc-crypto-x-api.d.ts +28 -334
- package/icc-x-api/icc-crypto-x-api.js +41 -765
- 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 +48 -11
- package/icc-x-api/icc-document-x-api.js +111 -64
- package/icc-x-api/icc-document-x-api.js.map +1 -1
- package/icc-x-api/icc-form-x-api.d.ts +45 -10
- package/icc-x-api/icc-form-x-api.js +65 -35
- 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 +55 -18
- package/icc-x-api/icc-helement-x-api.js +76 -41
- 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 +50 -15
- package/icc-x-api/icc-invoice-x-api.js +63 -33
- package/icc-x-api/icc-invoice-x-api.js.map +1 -1
- package/icc-x-api/icc-maintenance-task-x-api.d.ts +53 -21
- package/icc-x-api/icc-maintenance-task-x-api.js +72 -35
- package/icc-x-api/icc-maintenance-task-x-api.js.map +1 -1
- package/icc-x-api/icc-message-x-api.d.ts +53 -15
- package/icc-x-api/icc-message-x-api.js +65 -36
- package/icc-x-api/icc-message-x-api.js.map +1 -1
- package/icc-x-api/icc-patient-x-api.d.ts +84 -29
- package/icc-x-api/icc-patient-x-api.js +313 -378
- package/icc-x-api/icc-patient-x-api.js.map +1 -1
- package/icc-x-api/icc-receipt-x-api.d.ts +44 -12
- package/icc-x-api/icc-receipt-x-api.js +67 -35
- package/icc-x-api/icc-receipt-x-api.js.map +1 -1
- package/icc-x-api/icc-time-table-x-api.d.ts +43 -12
- package/icc-x-api/icc-time-table-x-api.js +56 -26
- package/icc-x-api/icc-time-table-x-api.js.map +1 -1
- 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 +4 -2
- package/icc-x-api/index.js +154 -135
- package/icc-x-api/index.js.map +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 +10 -10
- package/icc-x-api/utils/websocket.js +18 -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,40 @@ 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
|
+
});
|
|
161
193
|
}
|
|
162
194
|
/**
|
|
163
195
|
* Returns the first document corresponding to the externalUuid passed in the request
|
|
@@ -165,12 +197,14 @@ class IccDocumentApi {
|
|
|
165
197
|
* @param externalUuid
|
|
166
198
|
*/
|
|
167
199
|
getDocumentByExternalUuid(externalUuid) {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
.
|
|
173
|
-
|
|
200
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
201
|
+
let _body = null;
|
|
202
|
+
const _url = this.host + `/document/externaluuid/${encodeURIComponent(String(externalUuid))}` + '?ts=' + new Date().getTime();
|
|
203
|
+
let headers = yield this.headers;
|
|
204
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
205
|
+
.then((doc) => new Document_1.Document(doc.body))
|
|
206
|
+
.catch((err) => this.handleError(err));
|
|
207
|
+
});
|
|
174
208
|
}
|
|
175
209
|
/**
|
|
176
210
|
* Returns a list of document corresponding to the identifiers passed in the body
|
|
@@ -178,14 +212,16 @@ class IccDocumentApi {
|
|
|
178
212
|
* @param body
|
|
179
213
|
*/
|
|
180
214
|
getDocuments(body) {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
215
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
216
|
+
let _body = null;
|
|
217
|
+
_body = body;
|
|
218
|
+
const _url = this.host + `/document/byIds` + '?ts=' + new Date().getTime();
|
|
219
|
+
let headers = yield this.headers;
|
|
220
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
221
|
+
return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
222
|
+
.then((doc) => doc.body.map((it) => new Document_1.Document(it)))
|
|
223
|
+
.catch((err) => this.handleError(err));
|
|
224
|
+
});
|
|
189
225
|
}
|
|
190
226
|
/**
|
|
191
227
|
* Returns a list of document corresponding to the externalUuid passed in the request
|
|
@@ -193,12 +229,14 @@ class IccDocumentApi {
|
|
|
193
229
|
* @param externalUuid
|
|
194
230
|
*/
|
|
195
231
|
getDocumentsByExternalUuid(externalUuid) {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
232
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
233
|
+
let _body = null;
|
|
234
|
+
const _url = this.host + `/document/externaluuid/${encodeURIComponent(String(externalUuid))}/all` + '?ts=' + new Date().getTime();
|
|
235
|
+
let headers = yield this.headers;
|
|
236
|
+
return XHR_1.XHR.sendCommand('GET', _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
|
+
});
|
|
202
240
|
}
|
|
203
241
|
/**
|
|
204
242
|
* Updates the document and returns an instance of the modified document afterward
|
|
@@ -206,14 +244,16 @@ class IccDocumentApi {
|
|
|
206
244
|
* @param body
|
|
207
245
|
*/
|
|
208
246
|
modifyDocument(body) {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
.
|
|
216
|
-
|
|
247
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
248
|
+
let _body = null;
|
|
249
|
+
_body = body;
|
|
250
|
+
const _url = this.host + `/document` + '?ts=' + new Date().getTime();
|
|
251
|
+
let headers = yield this.headers;
|
|
252
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
253
|
+
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
254
|
+
.then((doc) => new Document_1.Document(doc.body))
|
|
255
|
+
.catch((err) => this.handleError(err));
|
|
256
|
+
});
|
|
217
257
|
}
|
|
218
258
|
/**
|
|
219
259
|
* Returns the modified documents.
|
|
@@ -221,86 +261,76 @@ class IccDocumentApi {
|
|
|
221
261
|
* @param body
|
|
222
262
|
*/
|
|
223
263
|
modifyDocuments(body) {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
264
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
265
|
+
let _body = null;
|
|
266
|
+
_body = body;
|
|
267
|
+
const _url = this.host + `/document/batch` + '?ts=' + new Date().getTime();
|
|
268
|
+
let headers = yield this.headers;
|
|
269
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
270
|
+
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
271
|
+
.then((doc) => doc.body.map((it) => new Document_1.Document(it)))
|
|
272
|
+
.catch((err) => this.handleError(err));
|
|
273
|
+
});
|
|
232
274
|
}
|
|
233
275
|
/**
|
|
234
|
-
* Creates or updates a
|
|
235
|
-
* @
|
|
236
|
-
* @param
|
|
237
|
-
* @param
|
|
238
|
-
* @param enckeys
|
|
276
|
+
* Creates or updates a main attachment for a document and returns the modified document instance afterward
|
|
277
|
+
* @param documentId id of the document
|
|
278
|
+
* @param documentRev revision of the document
|
|
279
|
+
* @param body content of the attachment (must be compatible with XHR body)
|
|
239
280
|
* @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
281
|
* overrides existing values.
|
|
241
282
|
*/
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
.
|
|
283
|
+
setMainDocumentAttachment(documentId, documentRev, body, utis) {
|
|
284
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
285
|
+
if (!documentRev)
|
|
286
|
+
throw new Error('Document rev is required');
|
|
287
|
+
let _body = body;
|
|
288
|
+
const _url = this.host +
|
|
289
|
+
`/document/${encodeURIComponent(String(documentId))}/attachment` +
|
|
290
|
+
'?ts=' +
|
|
291
|
+
new Date().getTime() +
|
|
292
|
+
'&rev=' +
|
|
293
|
+
encodeURIComponent(String(documentRev)) +
|
|
294
|
+
(utis ? utis.map((x) => '&utis=' + encodeURIComponent(String(x))).join('') : '');
|
|
295
|
+
let headers = yield this.headers;
|
|
296
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/octet-stream'));
|
|
297
|
+
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
298
|
+
.then((doc) => new Document_1.Document(doc.body))
|
|
299
|
+
.catch((err) => this.handleError(err));
|
|
300
|
+
});
|
|
256
301
|
}
|
|
257
302
|
/**
|
|
258
|
-
*
|
|
259
|
-
* @summary Create a document's attachment
|
|
260
|
-
* @param body
|
|
261
|
-
* @param documentId
|
|
262
|
-
* @param enckeys
|
|
303
|
+
* @deprecated use setMainDocumentAttachment instead
|
|
263
304
|
*/
|
|
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));
|
|
305
|
+
setDocumentAttachmentBody(documentId, documentRev, enckeys, body, utis) {
|
|
306
|
+
if (enckeys) {
|
|
307
|
+
throw new Error('Server-side encryption of attachment is not allowed anymore');
|
|
308
|
+
}
|
|
309
|
+
if (!body) {
|
|
310
|
+
throw new Error('body is now required.');
|
|
311
|
+
}
|
|
312
|
+
return this.setMainDocumentAttachment(documentId, documentRev, body, utis);
|
|
278
313
|
}
|
|
279
314
|
/**
|
|
280
|
-
*
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
315
|
+
* @deprecated use setMainDocumentAttachment instead
|
|
316
|
+
*/
|
|
317
|
+
setDocumentAttachment(documentId, documentRev, enckeys, body, utis) {
|
|
318
|
+
if (enckeys) {
|
|
319
|
+
throw new Error('Server-side encryption of attachment is not allowed anymore');
|
|
320
|
+
}
|
|
321
|
+
if (!body) {
|
|
322
|
+
throw new Error('body is now required.');
|
|
323
|
+
}
|
|
324
|
+
return this.setMainDocumentAttachment(documentId, documentRev, body, utis);
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* @deprecated use setMainDocumentAttachment instead
|
|
285
328
|
*/
|
|
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);
|
|
329
|
+
setDocumentAttachmentMulti(attachment, documentRev, documentId, enckeys) {
|
|
330
|
+
if (enckeys) {
|
|
331
|
+
throw new Error('Server-side encryption of attachment is not allowed anymore');
|
|
293
332
|
}
|
|
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));
|
|
333
|
+
return this.setMainDocumentAttachment(documentId, documentRev, attachment);
|
|
304
334
|
}
|
|
305
335
|
/**
|
|
306
336
|
* Keys must be delimited by coma
|
|
@@ -308,14 +338,16 @@ class IccDocumentApi {
|
|
|
308
338
|
* @param body
|
|
309
339
|
*/
|
|
310
340
|
setDocumentsDelegations(body) {
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
341
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
342
|
+
let _body = null;
|
|
343
|
+
_body = body;
|
|
344
|
+
const _url = this.host + `/document/delegations` + '?ts=' + new Date().getTime();
|
|
345
|
+
let headers = yield this.headers;
|
|
346
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
347
|
+
return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
348
|
+
.then((doc) => doc.body.map((it) => new IcureStub_1.IcureStub(it)))
|
|
349
|
+
.catch((err) => this.handleError(err));
|
|
350
|
+
});
|
|
319
351
|
}
|
|
320
352
|
/**
|
|
321
353
|
* Creates or updates a secondary attachment for a document and returns the modified document instance afterward
|
|
@@ -329,20 +361,22 @@ class IccDocumentApi {
|
|
|
329
361
|
* @return the updated document
|
|
330
362
|
*/
|
|
331
363
|
setSecondaryAttachment(documentId, key, rev, attachment, utis) {
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
.
|
|
345
|
-
|
|
364
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
365
|
+
const _url = this.host +
|
|
366
|
+
`/document/` +
|
|
367
|
+
encodeURIComponent(String(documentId)) +
|
|
368
|
+
'/secondaryAttachments/' +
|
|
369
|
+
encodeURIComponent(String(key)) +
|
|
370
|
+
'?ts=' +
|
|
371
|
+
new Date().getTime() +
|
|
372
|
+
(rev ? '&rev=' + encodeURIComponent(String(rev)) : '') +
|
|
373
|
+
(utis ? utis.map((x) => '&utis=' + encodeURIComponent(String(x))).join('') : '');
|
|
374
|
+
let headers = yield this.headers;
|
|
375
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/octet-stream'));
|
|
376
|
+
return XHR_1.XHR.sendCommand('PUT', _url, headers, attachment, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
377
|
+
.then((doc) => new Document_1.Document(doc.body))
|
|
378
|
+
.catch((err) => this.handleError(err));
|
|
379
|
+
});
|
|
346
380
|
}
|
|
347
381
|
/**
|
|
348
382
|
* Get the secondary attachment with the provided key for a document
|
|
@@ -353,16 +387,18 @@ class IccDocumentApi {
|
|
|
353
387
|
* @return the content of the attachment
|
|
354
388
|
*/
|
|
355
389
|
getSecondaryAttachment(documentId, key, fileName) {
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
.
|
|
365
|
-
|
|
390
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
391
|
+
let _body = null;
|
|
392
|
+
const _url = this.host +
|
|
393
|
+
`/document/${encodeURIComponent(String(documentId))}/secondaryAttachments/${encodeURIComponent(String(key))}` +
|
|
394
|
+
'?ts=' +
|
|
395
|
+
new Date().getTime() +
|
|
396
|
+
(fileName ? '&fileName=' + encodeURIComponent(String(fileName)) : '');
|
|
397
|
+
let headers = yield this.headers;
|
|
398
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
399
|
+
.then((doc) => doc.body)
|
|
400
|
+
.catch((err) => this.handleError(err));
|
|
401
|
+
});
|
|
366
402
|
}
|
|
367
403
|
/**
|
|
368
404
|
* Deletes a document's attachment and returns the modified document instance afterward
|
|
@@ -373,16 +409,32 @@ class IccDocumentApi {
|
|
|
373
409
|
* @return the updated document
|
|
374
410
|
*/
|
|
375
411
|
deleteSecondaryAttachment(documentId, key, rev) {
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
.
|
|
385
|
-
|
|
412
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
413
|
+
let _body = null;
|
|
414
|
+
const _url = this.host +
|
|
415
|
+
`/document/${encodeURIComponent(String(documentId))}/secondaryAttachments/${encodeURIComponent(String(key))}` +
|
|
416
|
+
'?ts=' +
|
|
417
|
+
new Date().getTime() +
|
|
418
|
+
(rev ? '&rev=' + encodeURIComponent(String(rev)) : '');
|
|
419
|
+
let headers = yield this.headers;
|
|
420
|
+
return XHR_1.XHR.sendCommand('DELETE', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
421
|
+
.then((doc) => new Document_1.Document(doc.body))
|
|
422
|
+
.catch((err) => this.handleError(err));
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
// TODO single request multi-attachment update
|
|
426
|
+
/**
|
|
427
|
+
* @internal this method is for internal use only and may be changed without notice
|
|
428
|
+
*/
|
|
429
|
+
bulkShareDocument(request) {
|
|
430
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
431
|
+
const _url = this.host + '/document/bulkSharedMetadataUpdate' + '?ts=' + new Date().getTime();
|
|
432
|
+
let headers = yield this.headers;
|
|
433
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
434
|
+
return XHR_1.XHR.sendCommand('PUT', _url, headers, request, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
435
|
+
.then((doc) => doc.body.map((x) => new EntityBulkShareResult_1.EntityBulkShareResult(x, Document_1.Document)))
|
|
436
|
+
.catch((err) => this.handleError(err));
|
|
437
|
+
});
|
|
386
438
|
}
|
|
387
439
|
}
|
|
388
440
|
exports.IccDocumentApi = IccDocumentApi;
|