@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.
Files changed (363) hide show
  1. package/icc-api/api/IccAccesslogApi.d.ts +12 -1
  2. package/icc-api/api/IccAccesslogApi.js +142 -98
  3. package/icc-api/api/IccAccesslogApi.js.map +1 -1
  4. package/icc-api/api/IccBemikronoApi.d.ts +81 -0
  5. package/icc-api/api/IccBemikronoApi.js +163 -0
  6. package/icc-api/api/IccBemikronoApi.js.map +1 -0
  7. package/icc-api/api/IccCalendarItemApi.d.ts +21 -1
  8. package/icc-api/api/IccCalendarItemApi.js +183 -117
  9. package/icc-api/api/IccCalendarItemApi.js.map +1 -1
  10. package/icc-api/api/IccClassificationApi.d.ts +21 -1
  11. package/icc-api/api/IccClassificationApi.js +119 -63
  12. package/icc-api/api/IccClassificationApi.js.map +1 -1
  13. package/icc-api/api/IccContactApi.d.ts +21 -1
  14. package/icc-api/api/IccContactApi.js +385 -294
  15. package/icc-api/api/IccContactApi.js.map +1 -1
  16. package/icc-api/api/IccDocumentApi.d.ts +38 -25
  17. package/icc-api/api/IccDocumentApi.js +279 -212
  18. package/icc-api/api/IccDocumentApi.js.map +1 -1
  19. package/icc-api/api/IccExchangeDataApi.d.ts +19 -0
  20. package/icc-api/api/IccExchangeDataApi.js +85 -0
  21. package/icc-api/api/IccExchangeDataApi.js.map +1 -0
  22. package/icc-api/api/IccExchangeDataMapApi.d.ts +18 -0
  23. package/icc-api/api/IccExchangeDataMapApi.js +65 -0
  24. package/icc-api/api/IccExchangeDataMapApi.js.map +1 -0
  25. package/icc-api/api/IccFormApi.d.ts +21 -1
  26. package/icc-api/api/IccFormApi.js +321 -229
  27. package/icc-api/api/IccFormApi.js.map +1 -1
  28. package/icc-api/api/IccHelementApi.d.ts +21 -1
  29. package/icc-api/api/IccHelementApi.js +207 -137
  30. package/icc-api/api/IccHelementApi.js.map +1 -1
  31. package/icc-api/api/IccInvoiceApi.d.ts +21 -1
  32. package/icc-api/api/IccInvoiceApi.js +404 -298
  33. package/icc-api/api/IccInvoiceApi.js.map +1 -1
  34. package/icc-api/api/IccMaintenanceTaskApi.d.ts +12 -1
  35. package/icc-api/api/IccMaintenanceTaskApi.js +79 -43
  36. package/icc-api/api/IccMaintenanceTaskApi.js.map +1 -1
  37. package/icc-api/api/IccMessageApi.d.ts +28 -1
  38. package/icc-api/api/IccMessageApi.js +294 -191
  39. package/icc-api/api/IccMessageApi.js.map +1 -1
  40. package/icc-api/api/IccPatientApi.d.ts +12 -1
  41. package/icc-api/api/IccPatientApi.js +447 -351
  42. package/icc-api/api/IccPatientApi.js.map +1 -1
  43. package/icc-api/api/IccReceiptApi.d.ts +22 -8
  44. package/icc-api/api/IccReceiptApi.js +121 -64
  45. package/icc-api/api/IccReceiptApi.js.map +1 -1
  46. package/icc-api/api/IccRestApiPath.js +1 -1
  47. package/icc-api/api/IccRestApiPath.js.map +1 -1
  48. package/icc-api/api/IccSecureDelegationKeyMapApi.d.ts +26 -0
  49. package/icc-api/api/IccSecureDelegationKeyMapApi.js +71 -0
  50. package/icc-api/api/IccSecureDelegationKeyMapApi.js.map +1 -0
  51. package/icc-api/api/IccTimeTableApi.d.ts +12 -1
  52. package/icc-api/api/IccTimeTableApi.js +86 -48
  53. package/icc-api/api/IccTimeTableApi.js.map +1 -1
  54. package/icc-api/api/IccTopicApi.d.ts +90 -0
  55. package/icc-api/api/IccTopicApi.js +193 -0
  56. package/icc-api/api/IccTopicApi.js.map +1 -0
  57. package/icc-api/index.d.ts +2 -0
  58. package/icc-api/index.js +2 -0
  59. package/icc-api/index.js.map +1 -1
  60. package/icc-api/model/AbstractFilterMessage.d.ts +15 -0
  61. package/icc-api/model/AbstractFilterMessage.js +21 -0
  62. package/icc-api/model/AbstractFilterMessage.js.map +1 -0
  63. package/icc-api/model/AbstractFilterTopic.d.ts +15 -0
  64. package/icc-api/model/AbstractFilterTopic.js +21 -0
  65. package/icc-api/model/AbstractFilterTopic.js.map +1 -0
  66. package/icc-api/model/AccessLog.d.ts +2 -0
  67. package/icc-api/model/AccessLog.js.map +1 -1
  68. package/icc-api/model/Article.d.ts +2 -0
  69. package/icc-api/model/Article.js.map +1 -1
  70. package/icc-api/model/CalendarItem.d.ts +2 -0
  71. package/icc-api/model/CalendarItem.js.map +1 -1
  72. package/icc-api/model/Classification.d.ts +2 -0
  73. package/icc-api/model/Classification.js.map +1 -1
  74. package/icc-api/model/ClassificationTemplate.d.ts +2 -0
  75. package/icc-api/model/ClassificationTemplate.js.map +1 -1
  76. package/icc-api/model/Connection.d.ts +1 -1
  77. package/icc-api/model/Connection.js.map +1 -1
  78. package/icc-api/model/Contact.d.ts +2 -0
  79. package/icc-api/model/Contact.js.map +1 -1
  80. package/icc-api/model/Device.d.ts +4 -4
  81. package/icc-api/model/Device.js.map +1 -1
  82. package/icc-api/model/Document.d.ts +2 -0
  83. package/icc-api/model/Document.js.map +1 -1
  84. package/icc-api/model/ExchangeDataMapCreationBatch.d.ts +13 -0
  85. package/icc-api/model/ExchangeDataMapCreationBatch.js +10 -0
  86. package/icc-api/model/ExchangeDataMapCreationBatch.js.map +1 -0
  87. package/icc-api/model/FilterChainMessage.d.ts +19 -0
  88. package/icc-api/model/FilterChainMessage.js +11 -0
  89. package/icc-api/model/FilterChainMessage.js.map +1 -0
  90. package/icc-api/model/FilterChainTopic.d.ts +19 -0
  91. package/icc-api/model/FilterChainTopic.js +11 -0
  92. package/icc-api/model/FilterChainTopic.js.map +1 -0
  93. package/icc-api/model/Form.d.ts +2 -0
  94. package/icc-api/model/Form.js.map +1 -1
  95. package/icc-api/model/HealthElement.d.ts +2 -0
  96. package/icc-api/model/HealthElement.js.map +1 -1
  97. package/icc-api/model/HealthcareParty.d.ts +2 -2
  98. package/icc-api/model/HealthcareParty.js +13 -1
  99. package/icc-api/model/HealthcareParty.js.map +1 -1
  100. package/icc-api/model/IcureStub.d.ts +2 -0
  101. package/icc-api/model/IcureStub.js.map +1 -1
  102. package/icc-api/model/Invoice.d.ts +2 -0
  103. package/icc-api/model/Invoice.js.map +1 -1
  104. package/icc-api/model/MaintenanceTask.d.ts +13 -10
  105. package/icc-api/model/MaintenanceTask.js +13 -11
  106. package/icc-api/model/MaintenanceTask.js.map +1 -1
  107. package/icc-api/model/Message.d.ts +2 -0
  108. package/icc-api/model/Message.js.map +1 -1
  109. package/icc-api/model/PaginatedListExchangeData.d.ts +9 -0
  110. package/icc-api/model/PaginatedListExchangeData.js +10 -0
  111. package/icc-api/model/PaginatedListExchangeData.js.map +1 -0
  112. package/icc-api/model/PaginatedListTopic.d.ts +20 -0
  113. package/icc-api/model/PaginatedListTopic.js +10 -0
  114. package/icc-api/model/PaginatedListTopic.js.map +1 -0
  115. package/icc-api/model/Patient.d.ts +4 -2
  116. package/icc-api/model/Patient.js.map +1 -1
  117. package/icc-api/model/PatientByHcPartyGenderEducationProfession.d.ts +31 -0
  118. package/icc-api/model/PatientByHcPartyGenderEducationProfession.js +32 -0
  119. package/icc-api/model/PatientByHcPartyGenderEducationProfession.js.map +1 -0
  120. package/icc-api/model/Receipt.d.ts +2 -0
  121. package/icc-api/model/Receipt.js.map +1 -1
  122. package/icc-api/model/SecureDelegation.d.ts +52 -0
  123. package/icc-api/model/SecureDelegation.js +16 -0
  124. package/icc-api/model/SecureDelegation.js.map +1 -0
  125. package/icc-api/model/SecurityMetadata.d.ts +33 -0
  126. package/icc-api/model/SecurityMetadata.js +13 -0
  127. package/icc-api/model/SecurityMetadata.js.map +1 -0
  128. package/icc-api/model/Service.d.ts +2 -0
  129. package/icc-api/model/Service.js.map +1 -1
  130. package/icc-api/model/TimeTable.d.ts +2 -0
  131. package/icc-api/model/TimeTable.js.map +1 -1
  132. package/icc-api/model/Topic.d.ts +95 -0
  133. package/icc-api/model/Topic.js +16 -0
  134. package/icc-api/model/Topic.js.map +1 -0
  135. package/icc-api/model/internal/ExchangeData.d.ts +64 -0
  136. package/icc-api/model/internal/ExchangeData.js +15 -0
  137. package/icc-api/model/internal/ExchangeData.js.map +1 -0
  138. package/icc-api/model/internal/ExchangeDataMap.d.ts +24 -0
  139. package/icc-api/model/internal/ExchangeDataMap.js +13 -0
  140. package/icc-api/model/internal/ExchangeDataMap.js.map +1 -0
  141. package/icc-api/model/internal/SecureDelegationKeyMap.d.ts +14 -0
  142. package/icc-api/model/internal/SecureDelegationKeyMap.js +13 -0
  143. package/icc-api/model/internal/SecureDelegationKeyMap.js.map +1 -0
  144. package/icc-api/model/models.d.ts +26 -40
  145. package/icc-api/model/models.js +19 -37
  146. package/icc-api/model/models.js.map +1 -1
  147. package/icc-api/model/requests/EntityBulkShareResult.d.ts +28 -0
  148. package/icc-api/model/requests/EntityBulkShareResult.js +16 -0
  149. package/icc-api/model/requests/EntityBulkShareResult.js.map +1 -0
  150. package/icc-api/model/requests/EntityShareOrMetadataUpdateRequest.d.ts +10 -0
  151. package/icc-api/model/requests/EntityShareOrMetadataUpdateRequest.js +17 -0
  152. package/icc-api/model/requests/EntityShareOrMetadataUpdateRequest.js.map +1 -0
  153. package/icc-api/model/requests/EntityShareRequest.d.ts +110 -0
  154. package/icc-api/model/requests/EntityShareRequest.js +63 -0
  155. package/icc-api/model/requests/EntityShareRequest.js.map +1 -0
  156. package/icc-api/model/requests/EntitySharedMetadataUpdateRequest.d.ts +54 -0
  157. package/icc-api/model/requests/EntitySharedMetadataUpdateRequest.js +24 -0
  158. package/icc-api/model/requests/EntitySharedMetadataUpdateRequest.js.map +1 -0
  159. package/icc-api/model/requests/MinimalEntityBulkShareResult.d.ts +23 -0
  160. package/icc-api/model/requests/MinimalEntityBulkShareResult.js +13 -0
  161. package/icc-api/model/requests/MinimalEntityBulkShareResult.js.map +1 -0
  162. package/icc-api/model/requests/RejectedShareOrMetadataUpdateRequest.d.ts +21 -0
  163. package/icc-api/model/requests/RejectedShareOrMetadataUpdateRequest.js +14 -0
  164. package/icc-api/model/requests/RejectedShareOrMetadataUpdateRequest.js.map +1 -0
  165. package/icc-x-api/basexapi/EncryptedEntityXApi.d.ts +55 -6
  166. package/icc-x-api/basexapi/EncryptedEntityXApi.js.map +1 -1
  167. package/icc-x-api/crypto/AES.js +1 -1
  168. package/icc-x-api/crypto/AES.js.map +1 -1
  169. package/icc-x-api/crypto/AccessControlKeysHeadersProvider.d.ts +18 -0
  170. package/icc-x-api/crypto/AccessControlKeysHeadersProvider.js +50 -0
  171. package/icc-x-api/crypto/AccessControlKeysHeadersProvider.js.map +1 -0
  172. package/icc-x-api/crypto/AccessControlSecretUtils.d.ts +43 -0
  173. package/icc-x-api/crypto/AccessControlSecretUtils.js +97 -0
  174. package/icc-x-api/crypto/AccessControlSecretUtils.js.map +1 -0
  175. package/icc-x-api/crypto/BaseExchangeDataManager.d.ts +146 -0
  176. package/icc-x-api/crypto/BaseExchangeDataManager.js +342 -0
  177. package/icc-x-api/crypto/BaseExchangeDataManager.js.map +1 -0
  178. package/icc-x-api/crypto/BaseExchangeKeysManager.d.ts +0 -18
  179. package/icc-x-api/crypto/BaseExchangeKeysManager.js +11 -85
  180. package/icc-x-api/crypto/BaseExchangeKeysManager.js.map +1 -1
  181. package/icc-x-api/crypto/ConfidentialEntities.d.ts +26 -16
  182. package/icc-x-api/crypto/ConfidentialEntities.js +30 -17
  183. package/icc-x-api/crypto/ConfidentialEntities.js.map +1 -1
  184. package/icc-x-api/crypto/CryptoStrategies.d.ts +8 -1
  185. package/icc-x-api/crypto/CryptoStrategies.js.map +1 -1
  186. package/icc-x-api/crypto/DelegationsDeAnonymization.d.ts +44 -0
  187. package/icc-x-api/crypto/DelegationsDeAnonymization.js +235 -0
  188. package/icc-x-api/crypto/DelegationsDeAnonymization.js.map +1 -0
  189. package/icc-x-api/crypto/ExchangeDataManager.d.ts +97 -0
  190. package/icc-x-api/crypto/ExchangeDataManager.js +501 -0
  191. package/icc-x-api/crypto/ExchangeDataManager.js.map +1 -0
  192. package/icc-x-api/crypto/ExchangeDataMapManager.d.ts +32 -0
  193. package/icc-x-api/crypto/ExchangeDataMapManager.js +70 -0
  194. package/icc-x-api/crypto/ExchangeDataMapManager.js.map +1 -0
  195. package/icc-x-api/crypto/ExchangeKeysManager.d.ts +4 -16
  196. package/icc-x-api/crypto/ExchangeKeysManager.js +4 -62
  197. package/icc-x-api/crypto/ExchangeKeysManager.js.map +1 -1
  198. package/icc-x-api/crypto/ExtendedApisUtils.d.ts +326 -0
  199. package/icc-x-api/crypto/ExtendedApisUtils.js +3 -0
  200. package/icc-x-api/crypto/ExtendedApisUtils.js.map +1 -0
  201. package/icc-x-api/crypto/ExtendedApisUtilsImpl.d.ts +174 -0
  202. package/icc-x-api/crypto/ExtendedApisUtilsImpl.js +559 -0
  203. package/icc-x-api/crypto/ExtendedApisUtilsImpl.js.map +1 -0
  204. package/icc-x-api/crypto/KeyRecovery.d.ts +5 -2
  205. package/icc-x-api/crypto/KeyRecovery.js +59 -29
  206. package/icc-x-api/crypto/KeyRecovery.js.map +1 -1
  207. package/icc-x-api/crypto/LegacyCryptoStrategies.d.ts +7 -2
  208. package/icc-x-api/crypto/LegacyCryptoStrategies.js +8 -1
  209. package/icc-x-api/crypto/LegacyCryptoStrategies.js.map +1 -1
  210. package/icc-x-api/crypto/LegacyDelegationSecurityMetadataDecryptor.d.ts +33 -0
  211. package/icc-x-api/crypto/LegacyDelegationSecurityMetadataDecryptor.js +141 -0
  212. package/icc-x-api/crypto/LegacyDelegationSecurityMetadataDecryptor.js.map +1 -0
  213. package/icc-x-api/crypto/RSA.d.ts +34 -8
  214. package/icc-x-api/crypto/RSA.js +80 -13
  215. package/icc-x-api/crypto/RSA.js.map +1 -1
  216. package/icc-x-api/crypto/SecureDelegationsEncryption.d.ts +54 -0
  217. package/icc-x-api/crypto/SecureDelegationsEncryption.js +178 -0
  218. package/icc-x-api/crypto/SecureDelegationsEncryption.js.map +1 -0
  219. package/icc-x-api/crypto/SecureDelegationsManager.d.ts +66 -0
  220. package/icc-x-api/crypto/SecureDelegationsManager.js +261 -0
  221. package/icc-x-api/crypto/SecureDelegationsManager.js.map +1 -0
  222. package/icc-x-api/crypto/SecureDelegationsSecurityMetadataDecryptor.d.ts +46 -0
  223. package/icc-x-api/crypto/SecureDelegationsSecurityMetadataDecryptor.js +312 -0
  224. package/icc-x-api/crypto/SecureDelegationsSecurityMetadataDecryptor.js.map +1 -0
  225. package/icc-x-api/crypto/SecurityMetadataDecryptor.d.ts +97 -0
  226. package/icc-x-api/crypto/SecurityMetadataDecryptor.js +79 -0
  227. package/icc-x-api/crypto/SecurityMetadataDecryptor.js.map +1 -0
  228. package/icc-x-api/crypto/ShamirKeysManager.d.ts +5 -5
  229. package/icc-x-api/crypto/ShamirKeysManager.js +6 -9
  230. package/icc-x-api/crypto/ShamirKeysManager.js.map +1 -1
  231. package/icc-x-api/crypto/TransferKeysManager.d.ts +8 -6
  232. package/icc-x-api/crypto/TransferKeysManager.js +75 -52
  233. package/icc-x-api/crypto/TransferKeysManager.js.map +1 -1
  234. package/icc-x-api/crypto/{KeyManager.d.ts → UserEncryptionKeysManager.d.ts} +4 -6
  235. package/icc-x-api/crypto/{KeyManager.js → UserEncryptionKeysManager.js} +43 -23
  236. package/icc-x-api/crypto/UserEncryptionKeysManager.js.map +1 -0
  237. package/icc-x-api/crypto/UserSignatureKeysManager.d.ts +26 -0
  238. package/icc-x-api/crypto/UserSignatureKeysManager.js +74 -0
  239. package/icc-x-api/crypto/UserSignatureKeysManager.js.map +1 -0
  240. package/icc-x-api/crypto/utils.d.ts +61 -11
  241. package/icc-x-api/crypto/utils.js +113 -44
  242. package/icc-x-api/crypto/utils.js.map +1 -1
  243. package/icc-x-api/filters/LatestMessageByHcPartyTransportGuidFilter.d.ts +8 -0
  244. package/icc-x-api/filters/LatestMessageByHcPartyTransportGuidFilter.js +13 -0
  245. package/icc-x-api/filters/LatestMessageByHcPartyTransportGuidFilter.js.map +1 -0
  246. package/icc-x-api/filters/MessageByHcPartyFilter.d.ts +7 -0
  247. package/icc-x-api/filters/MessageByHcPartyFilter.js +13 -0
  248. package/icc-x-api/filters/MessageByHcPartyFilter.js.map +1 -0
  249. package/icc-x-api/filters/MessageByHcPartyTransportGuidFilter.d.ts +8 -0
  250. package/icc-x-api/filters/MessageByHcPartyTransportGuidFilter.js +13 -0
  251. package/icc-x-api/filters/MessageByHcPartyTransportGuidFilter.js.map +1 -0
  252. package/icc-x-api/filters/TopicByHcPartyFilter.d.ts +7 -0
  253. package/icc-x-api/filters/TopicByHcPartyFilter.js +13 -0
  254. package/icc-x-api/filters/TopicByHcPartyFilter.js.map +1 -0
  255. package/icc-x-api/filters/TopicByParticipantFilter.d.ts +7 -0
  256. package/icc-x-api/filters/TopicByParticipantFilter.js +13 -0
  257. package/icc-x-api/filters/TopicByParticipantFilter.js.map +1 -0
  258. package/icc-x-api/filters/filters.d.ts +5 -0
  259. package/icc-x-api/filters/filters.js +5 -0
  260. package/icc-x-api/filters/filters.js.map +1 -1
  261. package/icc-x-api/icc-accesslog-x-api.d.ts +49 -12
  262. package/icc-x-api/icc-accesslog-x-api.js +81 -44
  263. package/icc-x-api/icc-accesslog-x-api.js.map +1 -1
  264. package/icc-x-api/icc-calendar-item-x-api.d.ts +53 -15
  265. package/icc-x-api/icc-calendar-item-x-api.js +105 -51
  266. package/icc-x-api/icc-calendar-item-x-api.js.map +1 -1
  267. package/icc-x-api/icc-classification-x-api.d.ts +47 -10
  268. package/icc-x-api/icc-classification-x-api.js +62 -33
  269. package/icc-x-api/icc-classification-x-api.js.map +1 -1
  270. package/icc-x-api/icc-contact-x-api.d.ts +59 -33
  271. package/icc-x-api/icc-contact-x-api.js +101 -66
  272. package/icc-x-api/icc-contact-x-api.js.map +1 -1
  273. package/icc-x-api/icc-crypto-x-api.d.ts +33 -333
  274. package/icc-x-api/icc-crypto-x-api.js +47 -764
  275. package/icc-x-api/icc-crypto-x-api.js.map +1 -1
  276. package/icc-x-api/icc-data-owner-x-api.d.ts +20 -8
  277. package/icc-x-api/icc-data-owner-x-api.js +31 -10
  278. package/icc-x-api/icc-data-owner-x-api.js.map +1 -1
  279. package/icc-x-api/icc-document-x-api.d.ts +51 -12
  280. package/icc-x-api/icc-document-x-api.js +117 -66
  281. package/icc-x-api/icc-document-x-api.js.map +1 -1
  282. package/icc-x-api/icc-form-x-api.d.ts +48 -11
  283. package/icc-x-api/icc-form-x-api.js +71 -37
  284. package/icc-x-api/icc-form-x-api.js.map +1 -1
  285. package/icc-x-api/icc-hcparty-x-api.d.ts +2 -2
  286. package/icc-x-api/icc-hcparty-x-api.js +3 -3
  287. package/icc-x-api/icc-hcparty-x-api.js.map +1 -1
  288. package/icc-x-api/icc-helement-x-api.d.ts +59 -20
  289. package/icc-x-api/icc-helement-x-api.js +78 -43
  290. package/icc-x-api/icc-helement-x-api.js.map +1 -1
  291. package/icc-x-api/icc-icure-maintenance-x-api.d.ts +7 -2
  292. package/icc-x-api/icc-icure-maintenance-x-api.js +38 -27
  293. package/icc-x-api/icc-icure-maintenance-x-api.js.map +1 -1
  294. package/icc-x-api/icc-invoice-x-api.d.ts +53 -16
  295. package/icc-x-api/icc-invoice-x-api.js +69 -35
  296. package/icc-x-api/icc-invoice-x-api.js.map +1 -1
  297. package/icc-x-api/icc-maintenance-task-x-api.d.ts +56 -22
  298. package/icc-x-api/icc-maintenance-task-x-api.js +77 -36
  299. package/icc-x-api/icc-maintenance-task-x-api.js.map +1 -1
  300. package/icc-x-api/icc-message-x-api.d.ts +75 -19
  301. package/icc-x-api/icc-message-x-api.js +126 -37
  302. package/icc-x-api/icc-message-x-api.js.map +1 -1
  303. package/icc-x-api/icc-patient-x-api.d.ts +86 -29
  304. package/icc-x-api/icc-patient-x-api.js +318 -379
  305. package/icc-x-api/icc-patient-x-api.js.map +1 -1
  306. package/icc-x-api/icc-receipt-x-api.d.ts +47 -13
  307. package/icc-x-api/icc-receipt-x-api.js +72 -36
  308. package/icc-x-api/icc-receipt-x-api.js.map +1 -1
  309. package/icc-x-api/icc-time-table-x-api.d.ts +46 -13
  310. package/icc-x-api/icc-time-table-x-api.js +61 -27
  311. package/icc-x-api/icc-time-table-x-api.js.map +1 -1
  312. package/icc-x-api/icc-topic-x-api.d.ts +191 -0
  313. package/icc-x-api/icc-topic-x-api.js +307 -0
  314. package/icc-x-api/icc-topic-x-api.js.map +1 -0
  315. package/icc-x-api/icc-user-x-api.d.ts +2 -2
  316. package/icc-x-api/icc-user-x-api.js +3 -3
  317. package/icc-x-api/icc-user-x-api.js.map +1 -1
  318. package/icc-x-api/index.d.ts +18 -2
  319. package/icc-x-api/index.js +203 -156
  320. package/icc-x-api/index.js.map +1 -1
  321. package/icc-x-api/maintenance/KeyPairUpdateRequest.d.ts +1 -1
  322. package/icc-x-api/storage/DefaultStorageEntryKeysFactory.d.ts +2 -0
  323. package/icc-x-api/storage/DefaultStorageEntryKeysFactory.js +9 -2
  324. package/icc-x-api/storage/DefaultStorageEntryKeysFactory.js.map +1 -1
  325. package/icc-x-api/storage/IcureStorageFacade.d.ts +23 -2
  326. package/icc-x-api/storage/IcureStorageFacade.js +36 -2
  327. package/icc-x-api/storage/IcureStorageFacade.js.map +1 -1
  328. package/icc-x-api/storage/KeyStorageFacade.d.ts +12 -0
  329. package/icc-x-api/storage/KeyStorageFacade.js.map +1 -1
  330. package/icc-x-api/storage/KeyStorageImpl.d.ts +2 -0
  331. package/icc-x-api/storage/KeyStorageImpl.js +10 -0
  332. package/icc-x-api/storage/KeyStorageImpl.js.map +1 -1
  333. package/icc-x-api/storage/StorageEntryKeysFactory.d.ts +14 -1
  334. package/icc-x-api/storage/StorageEntryKeysFactory.js.map +1 -1
  335. package/icc-x-api/utils/EntityWithDelegationTypeName.d.ts +32 -0
  336. package/icc-x-api/utils/EntityWithDelegationTypeName.js +75 -0
  337. package/icc-x-api/utils/EntityWithDelegationTypeName.js.map +1 -0
  338. package/icc-x-api/utils/ShareResult.d.ts +74 -0
  339. package/icc-x-api/utils/ShareResult.js +61 -0
  340. package/icc-x-api/utils/ShareResult.js.map +1 -0
  341. package/icc-x-api/utils/binary-utils.d.ts +1 -0
  342. package/icc-x-api/utils/binary-utils.js +8 -1
  343. package/icc-x-api/utils/binary-utils.js.map +1 -1
  344. package/icc-x-api/utils/collection-utils.d.ts +5 -0
  345. package/icc-x-api/utils/collection-utils.js +26 -1
  346. package/icc-x-api/utils/collection-utils.js.map +1 -1
  347. package/icc-x-api/utils/crypto-utils.d.ts +4 -3
  348. package/icc-x-api/utils/crypto-utils.js +5 -4
  349. package/icc-x-api/utils/crypto-utils.js.map +1 -1
  350. package/icc-x-api/utils/lru-temporised-async-cache.d.ts +26 -3
  351. package/icc-x-api/utils/lru-temporised-async-cache.js +75 -15
  352. package/icc-x-api/utils/lru-temporised-async-cache.js.map +1 -1
  353. package/icc-x-api/utils/websocket.d.ts +14 -10
  354. package/icc-x-api/utils/websocket.js +26 -9
  355. package/icc-x-api/utils/websocket.js.map +1 -1
  356. package/index.d.ts +1 -1
  357. package/index.js +3 -1
  358. package/index.js.map +1 -1
  359. package/package.json +2 -3
  360. package/icc-x-api/crypto/EntitiesEncryption.d.ts +0 -275
  361. package/icc-x-api/crypto/EntitiesEncryption.js +0 -734
  362. package/icc-x-api/crypto/EntitiesEncryption.js.map +0 -1
  363. 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.headers = Object.keys(headers).map((k) => new XHR_1.XHR.Header(k, headers[k]));
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.headers = h;
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
- let _body = null;
41
- _body = body;
42
- const _url = this.host + `/document` + '?ts=' + new Date().getTime();
43
- let headers = this.headers;
44
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
45
- return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
46
- .then((doc) => new Document_1.Document(doc.body))
47
- .catch((err) => this.handleError(err));
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
- let _body = null;
56
- const _url = this.host + `/document/${encodeURIComponent(String(documentId))}/attachment` + '?ts=' + new Date().getTime();
57
- let headers = this.headers;
58
- return XHR_1.XHR.sendCommand('DELETE', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
59
- .then((doc) => new Document_1.Document(doc.body))
60
- .catch((err) => this.handleError(err));
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
- let _body = null;
69
- const _url = this.host + `/document/${encodeURIComponent(String(documentIds))}` + '?ts=' + new Date().getTime();
70
- let headers = this.headers;
71
- return XHR_1.XHR.sendCommand('DELETE', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
72
- .then((doc) => doc.body.map((it) => new DocIdentifier_1.DocIdentifier(it)))
73
- .catch((err) => this.handleError(err));
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
- let _body = null;
84
- const _url = this.host +
85
- `/document/byTypeHcPartySecretForeignKeys` +
86
- '?ts=' +
87
- new Date().getTime() +
88
- (documentTypeCode ? '&documentTypeCode=' + encodeURIComponent(String(documentTypeCode)) : '') +
89
- (hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '') +
90
- (secretFKeys ? '&secretFKeys=' + encodeURIComponent(String(secretFKeys)) : '');
91
- let headers = this.headers;
92
- return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
93
- .then((doc) => doc.body.map((it) => new Document_1.Document(it)))
94
- .catch((err) => this.handleError(err));
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
- let _body = null;
104
- const _url = this.host +
105
- `/document/byHcPartySecretForeignKeys` +
106
- '?ts=' +
107
- new Date().getTime() +
108
- (hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '') +
109
- (secretFKeys ? '&secretFKeys=' + encodeURIComponent(String(secretFKeys)) : '');
110
- let headers = this.headers;
111
- return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
112
- .then((doc) => doc.body.map((it) => new Document_1.Document(it)))
113
- .catch((err) => this.handleError(err));
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
- let _body = null;
122
- const _url = this.host + `/document/woDelegation` + '?ts=' + new Date().getTime() + (limit ? '&limit=' + encodeURIComponent(String(limit)) : '');
123
- let headers = this.headers;
124
- return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
125
- .then((doc) => doc.body.map((it) => new Document_1.Document(it)))
126
- .catch((err) => this.handleError(err));
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
- let _body = null;
135
- const _url = this.host + `/document/${encodeURIComponent(String(documentId))}` + '?ts=' + new Date().getTime();
136
- let headers = this.headers;
137
- return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
138
- .then((doc) => new Document_1.Document(doc.body))
139
- .catch((err) => this.handleError(err));
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
- let _body = null;
151
- const _url = this.host +
152
- `/document/${encodeURIComponent(String(documentId))}/attachment/${encodeURIComponent(String(attachmentId))}` +
153
- '?ts=' +
154
- new Date().getTime() +
155
- (enckeys ? '&enckeys=' + encodeURIComponent(String(enckeys)) : '') +
156
- (fileName ? '&fileName=' + encodeURIComponent(String(fileName)) : '');
157
- let headers = this.headers;
158
- return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
159
- .then((doc) => doc.body)
160
- .catch((err) => this.handleError(err));
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
- let _body = null;
169
- const _url = this.host + `/document/externaluuid/${encodeURIComponent(String(externalUuid))}` + '?ts=' + new Date().getTime();
170
- let headers = this.headers;
171
- return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
172
- .then((doc) => new Document_1.Document(doc.body))
173
- .catch((err) => this.handleError(err));
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
- let _body = null;
182
- _body = body;
183
- const _url = this.host + `/document/batch` + '?ts=' + new Date().getTime();
184
- let headers = this.headers;
185
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
186
- return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
187
- .then((doc) => doc.body.map((it) => new Document_1.Document(it)))
188
- .catch((err) => this.handleError(err));
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
- let _body = null;
197
- const _url = this.host + `/document/externaluuid/${encodeURIComponent(String(externalUuid))}/all` + '?ts=' + new Date().getTime();
198
- let headers = this.headers;
199
- return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
200
- .then((doc) => doc.body.map((it) => new Document_1.Document(it)))
201
- .catch((err) => this.handleError(err));
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
- let _body = null;
210
- _body = body;
211
- const _url = this.host + `/document` + '?ts=' + new Date().getTime();
212
- let headers = this.headers;
213
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
214
- return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
215
- .then((doc) => new Document_1.Document(doc.body))
216
- .catch((err) => this.handleError(err));
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
- let _body = null;
225
- _body = body;
226
- const _url = this.host + `/document/batch` + '?ts=' + new Date().getTime();
227
- let headers = this.headers;
228
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
229
- return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
230
- .then((doc) => doc.body.map((it) => new Document_1.Document(it)))
231
- .catch((err) => this.handleError(err));
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 document's attachment and returns the modified document instance afterward
235
- * @summary Create a document's attachment
236
- * @param body
237
- * @param documentId
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
- setDocumentAttachment(documentId, enckeys, body, utis) {
243
- let _body = null;
244
- _body = body;
245
- const _url = this.host +
246
- `/document/${encodeURIComponent(String(documentId))}/attachment` +
247
- '?ts=' +
248
- new Date().getTime() +
249
- (enckeys ? '&enckeys=' + encodeURIComponent(String(enckeys)) : '') +
250
- (utis ? utis.map((x) => '&utis=' + encodeURIComponent(String(x))).join('') : '');
251
- let headers = this.headers;
252
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/octet-stream'));
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));
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
- * Creates a document attachment and returns the modified document instance afterward
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
- let _body = null;
266
- _body = body;
267
- const _url = this.host +
268
- `/document/attachment` +
269
- '?ts=' +
270
- new Date().getTime() +
271
- (documentId ? '&documentId=' + encodeURIComponent(String(documentId)) : '') +
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
- * @summary Creates a document's attachment
282
- * @param attachment
283
- * @param documentId
284
- * @param enckeys
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
- let _body = null;
288
- if (attachment && !_body) {
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
- const _url = this.host +
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
- let _body = null;
312
- _body = body;
313
- const _url = this.host + `/document/delegations` + '?ts=' + new Date().getTime();
314
- let headers = this.headers;
315
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
316
- return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
317
- .then((doc) => doc.body.map((it) => new IcureStub_1.IcureStub(it)))
318
- .catch((err) => this.handleError(err));
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
- const _url = this.host +
333
- `/document/` +
334
- encodeURIComponent(String(documentId)) +
335
- '/secondaryAttachments/' +
336
- encodeURIComponent(String(key)) +
337
- '?ts=' +
338
- new Date().getTime() +
339
- (rev ? '&rev=' + encodeURIComponent(String(rev)) : '') +
340
- (utis ? utis.map((x) => '&utis=' + encodeURIComponent(String(x))).join('') : '');
341
- let headers = this.headers;
342
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/octet-stream'));
343
- return XHR_1.XHR.sendCommand('PUT', _url, headers, attachment, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
344
- .then((doc) => new Document_1.Document(doc.body))
345
- .catch((err) => this.handleError(err));
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
- let _body = null;
357
- const _url = this.host +
358
- `/document/${encodeURIComponent(String(documentId))}/secondaryAttachments/${encodeURIComponent(String(key))}` +
359
- '?ts=' +
360
- new Date().getTime() +
361
- (fileName ? '&fileName=' + encodeURIComponent(String(fileName)) : '');
362
- let headers = this.headers;
363
- return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
364
- .then((doc) => doc.body)
365
- .catch((err) => this.handleError(err));
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
- let _body = null;
377
- const _url = this.host +
378
- `/document/${encodeURIComponent(String(documentId))}/secondaryAttachments/${encodeURIComponent(String(key))}` +
379
- '?ts=' +
380
- new Date().getTime() +
381
- (rev ? '&rev=' + encodeURIComponent(String(rev)) : '');
382
- let headers = this.headers;
383
- return XHR_1.XHR.sendCommand('DELETE', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
384
- .then((doc) => new Document_1.Document(doc.body))
385
- .catch((err) => this.handleError(err));
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;