@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
@@ -14,13 +14,22 @@ const i18n = require("./rsrc/contact.i18n");
14
14
  const icc_api_1 = require("../icc-api");
15
15
  const models = require("../icc-api/model/models");
16
16
  const AuthenticationProvider_1 = require("./auth/AuthenticationProvider");
17
+ const ShareMetadataBehaviour_1 = require("./crypto/ShareMetadataBehaviour");
18
+ const SecureDelegation_1 = require("../icc-api/model/SecureDelegation");
19
+ var AccessLevelEnum = SecureDelegation_1.SecureDelegation.AccessLevelEnum;
17
20
  class IccTimeTableXApi extends icc_api_1.IccTimeTableApi {
18
- constructor(host, headers, crypto, dataOwnerApi, authenticationProvider = new AuthenticationProvider_1.NoAuthenticationProvider(), fetchImpl = typeof window !== 'undefined'
21
+ get headers() {
22
+ return super.headers.then((h) => this.crypto.accessControlKeysHeaders.addAccessControlKeysHeaders(h, 'TimeTable'));
23
+ }
24
+ constructor(host, headers, crypto, dataOwnerApi, autofillAuthor, authenticationProvider = new AuthenticationProvider_1.NoAuthenticationProvider(), fetchImpl = typeof window !== 'undefined'
19
25
  ? window.fetch
20
26
  : typeof self !== 'undefined'
21
27
  ? self.fetch
22
28
  : fetch) {
23
29
  super(host, headers, authenticationProvider, fetchImpl);
30
+ this.crypto = crypto;
31
+ this.dataOwnerApi = dataOwnerApi;
32
+ this.autofillAuthor = autofillAuthor;
24
33
  this.i18n = i18n;
25
34
  this.crypto = crypto;
26
35
  this.dataOwnerApi = dataOwnerApi;
@@ -33,24 +42,27 @@ class IccTimeTableXApi extends icc_api_1.IccTimeTableApi {
33
42
  * @param options optional parameters:
34
43
  * - additionalDelegates: delegates which will have access to the entity in addition to the current data owner and delegates from the
35
44
  * auto-delegations. Must be an object which associates each data owner id with the access level to give to that data owner. May overlap with
36
- * auto-delegations, in such case the access level specified here will be used. Currently only WRITE access is supported, but in future also read
37
- * access will be possible.
45
+ * auto-delegations, in such case the access level specified here will be used.
38
46
  * @return a new instance of timetable.
39
47
  */
40
48
  newInstance(user, tt, options = {}) {
41
49
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
42
50
  return __awaiter(this, void 0, void 0, function* () {
43
- const timeTable = Object.assign(Object.assign({}, (tt !== null && tt !== void 0 ? tt : {})), { _type: 'org.taktik.icure.entities.TimeTable', id: (_a = tt === null || tt === void 0 ? void 0 : tt.id) !== null && _a !== void 0 ? _a : this.crypto.primitives.randomUuid(), created: (_b = tt === null || tt === void 0 ? void 0 : tt.created) !== null && _b !== void 0 ? _b : new Date().getTime(), modified: (_c = tt === null || tt === void 0 ? void 0 : tt.modified) !== null && _c !== void 0 ? _c : new Date().getTime(), responsible: (_d = tt === null || tt === void 0 ? void 0 : tt.responsible) !== null && _d !== void 0 ? _d : this.dataOwnerApi.getDataOwnerIdOf(user), author: (_e = tt === null || tt === void 0 ? void 0 : tt.author) !== null && _e !== void 0 ? _e : user.id, codes: (_f = tt === null || tt === void 0 ? void 0 : tt.codes) !== null && _f !== void 0 ? _f : [], tags: (_g = tt === null || tt === void 0 ? void 0 : tt.tags) !== null && _g !== void 0 ? _g : [] });
44
- const extraDelegations = [
45
- ...Object.keys((_h = options.additionalDelegates) !== null && _h !== void 0 ? _h : {}),
46
- ...((_k = (_j = user.autoDelegations) === null || _j === void 0 ? void 0 : _j.all) !== null && _k !== void 0 ? _k : []),
47
- ...((_m = (_l = user.autoDelegations) === null || _l === void 0 ? void 0 : _l.administrativeData) !== null && _m !== void 0 ? _m : []),
48
- ];
49
- return new models.TimeTable(yield this.crypto.entities
50
- .entityWithInitialisedEncryptedMetadata(timeTable, undefined, undefined, true, extraDelegations)
51
+ const timeTable = Object.assign(Object.assign({}, (tt !== null && tt !== void 0 ? tt : {})), { id: (_a = tt === null || tt === void 0 ? void 0 : tt.id) !== null && _a !== void 0 ? _a : this.crypto.primitives.randomUuid(), created: (_b = tt === null || tt === void 0 ? void 0 : tt.created) !== null && _b !== void 0 ? _b : new Date().getTime(), modified: (_c = tt === null || tt === void 0 ? void 0 : tt.modified) !== null && _c !== void 0 ? _c : new Date().getTime(), responsible: (_d = tt === null || tt === void 0 ? void 0 : tt.responsible) !== null && _d !== void 0 ? _d : (this.autofillAuthor ? this.dataOwnerApi.getDataOwnerIdOf(user) : undefined), author: (_e = tt === null || tt === void 0 ? void 0 : tt.author) !== null && _e !== void 0 ? _e : (this.autofillAuthor ? user.id : undefined), codes: (_f = tt === null || tt === void 0 ? void 0 : tt.codes) !== null && _f !== void 0 ? _f : [], tags: (_g = tt === null || tt === void 0 ? void 0 : tt.tags) !== null && _g !== void 0 ? _g : [] });
52
+ const extraDelegations = Object.assign(Object.assign({}, Object.fromEntries([...((_j = (_h = user.autoDelegations) === null || _h === void 0 ? void 0 : _h.all) !== null && _j !== void 0 ? _j : []), ...((_l = (_k = user.autoDelegations) === null || _k === void 0 ? void 0 : _k.administrativeData) !== null && _l !== void 0 ? _l : [])].map((d) => [d, AccessLevelEnum.WRITE]))), ((_m = options === null || options === void 0 ? void 0 : options.additionalDelegates) !== null && _m !== void 0 ? _m : {}));
53
+ return new models.TimeTable(yield this.crypto.xapi
54
+ .entityWithInitialisedEncryptedMetadata(timeTable, 'TimeTable', undefined, undefined, true, false, extraDelegations)
51
55
  .then((x) => x.updatedEntity));
52
56
  });
53
57
  }
58
+ /**
59
+ * @return if the logged data owner has write access to the content of the given time table
60
+ */
61
+ hasWriteAccess(timeTable) {
62
+ return __awaiter(this, void 0, void 0, function* () {
63
+ return this.crypto.xapi.hasWriteAccess({ entity: timeTable, type: 'TimeTable' });
64
+ });
65
+ }
54
66
  /**
55
67
  * Share an existing time table with other data owners, allowing them to access the non-encrypted data of the time table and optionally also
56
68
  * the encrypted content, with read-only or read-write permissions.
@@ -60,8 +72,8 @@ class IccTimeTableXApi extends icc_api_1.IccTimeTableApi {
60
72
  * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted
61
73
  * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a
62
74
  * time table does not have encrypted content.
63
- * @return a promise which will contain the result of the operation: the updated entity if the operation was successful or details of the error if
64
- * the operation failed.
75
+ * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.
76
+ * @return the updated entity
65
77
  */
66
78
  shareWith(delegateId, timeTable, options = {}) {
67
79
  return __awaiter(this, void 0, void 0, function* () {
@@ -72,32 +84,54 @@ class IccTimeTableXApi extends icc_api_1.IccTimeTableApi {
72
84
  * Share an existing time table with other data owners, allowing them to access the non-encrypted data of the time table and optionally also
73
85
  * the encrypted content, with read-only or read-write permissions.
74
86
  * @param timeTable the time table to share.
75
- * @param delegates sharing options for each delegate.
87
+ * @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options:
76
88
  * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted
77
89
  * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a
78
90
  * time table does not have encrypted content.
79
- * @return a promise which will contain the result of the operation: the updated entity if the operation was successful or details of the error if
80
- * the operation failed.
91
+ * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.
92
+ * @return the updated entity
81
93
  */
82
94
  shareWithMany(timeTable, delegates) {
83
95
  return __awaiter(this, void 0, void 0, function* () {
84
- const extended = yield this.crypto.entities.entityWithAutoExtendedEncryptedMetadata(timeTable, true, delegates);
85
- if (!!extended) {
86
- return yield this.modifyTimeTable(extended);
87
- }
88
- else
89
- return timeTable;
96
+ return (yield this.tryShareWithMany(timeTable, delegates)).updatedEntityOrThrow;
90
97
  });
91
98
  }
92
- getDataOwnersWithAccessTo(entity) {
99
+ /**
100
+ * Share an existing time table with other data owners, allowing them to access the non-encrypted data of the time table and optionally also
101
+ * the encrypted content, with read-only or read-write permissions.
102
+ * @param timeTable the time table to share.
103
+ * @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options:
104
+ * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted
105
+ * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a
106
+ * time table does not have encrypted content.
107
+ * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.
108
+ * @return a promise which will contain the result of the operation: the updated entity if the operation was successful or details of the error if
109
+ * the operation failed.
110
+ */
111
+ tryShareWithMany(timeTable, delegates) {
93
112
  return __awaiter(this, void 0, void 0, function* () {
94
- return yield this.crypto.entities.getDataOwnersWithAccessTo(entity);
113
+ // All entities should have an encryption key.
114
+ const entityWithEncryptionKey = yield this.crypto.xapi.ensureEncryptionKeysInitialised(timeTable, 'TimeTable');
115
+ const updatedEntity = entityWithEncryptionKey ? yield this.modifyTimeTable(entityWithEncryptionKey) : timeTable;
116
+ return this.crypto.xapi.simpleShareOrUpdateEncryptedEntityMetadata({ entity: updatedEntity, type: 'TimeTable' }, true, Object.fromEntries(Object.entries(delegates).map(([delegateId, options]) => [
117
+ delegateId,
118
+ {
119
+ requestedPermissions: options.requestedPermissions,
120
+ shareEncryptionKeys: options.shareEncryptionKey,
121
+ shareOwningEntityIds: ShareMetadataBehaviour_1.ShareMetadataBehaviour.NEVER,
122
+ shareSecretIds: undefined,
123
+ },
124
+ ])), (x) => this.bulkShareTimeTable(x));
95
125
  });
96
126
  }
127
+ getDataOwnersWithAccessTo(entity) {
128
+ return this.crypto.delegationsDeAnonymization.getDataOwnersWithAccessTo({ entity, type: 'TimeTable' });
129
+ }
97
130
  getEncryptionKeysOf(entity) {
98
- return __awaiter(this, void 0, void 0, function* () {
99
- return yield this.crypto.entities.encryptionKeysOf(entity);
100
- });
131
+ return this.crypto.xapi.encryptionKeysOf({ entity, type: 'TimeTable' }, undefined);
132
+ }
133
+ createDelegationDeAnonymizationMetadata(entity, delegates) {
134
+ return this.crypto.delegationsDeAnonymization.createOrUpdateDeAnonymizationInfo({ entity, type: 'TimeTable' }, delegates);
101
135
  }
102
136
  }
103
137
  exports.IccTimeTableXApi = IccTimeTableXApi;
@@ -1 +1 @@
1
- {"version":3,"file":"icc-time-table-x-api.js","sourceRoot":"","sources":["../../icc-x-api/icc-time-table-x-api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAA2C;AAG3C,wCAA4C;AAK5C,kDAAiD;AACjD,0EAAgG;AAIhG,MAAa,gBAAiB,SAAQ,yBAAe;IAKnD,YACE,IAAY,EACZ,OAAkC,EAClC,MAAqB,EACrB,YAA8B,EAC9B,yBAAiD,IAAI,iDAAwB,EAAE,EAC/E,YAA2E,OAAO,MAAM,KAAK,WAAW;QACtG,CAAC,CAAC,MAAM,CAAC,KAAK;QACd,CAAC,CAAC,OAAO,IAAI,KAAK,WAAW;YAC7B,CAAC,CAAC,IAAI,CAAC,KAAK;YACZ,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C,CAAA;QAC5D,CAAC;KAAA;CACF;AAzHD,4CAyHC","sourcesContent":["import * as i18n from './rsrc/contact.i18n'\n\nimport * as _ from 'lodash'\nimport { IccTimeTableApi } from '../icc-api'\nimport { User } from '../icc-api/model/User'\nimport { TimeTable } from '../icc-api/model/TimeTable'\nimport { IccCryptoXApi } from './icc-crypto-x-api'\nimport { IccDataOwnerXApi } from './icc-data-owner-x-api'\nimport * as models from '../icc-api/model/models'\nimport { AuthenticationProvider, NoAuthenticationProvider } from './auth/AuthenticationProvider'\nimport { ShareMetadataBehaviour } from './crypto/ShareMetadataBehaviour'\nimport { EncryptedEntityXApi } from './basexapi/EncryptedEntityXApi'\n\nexport class IccTimeTableXApi extends IccTimeTableApi implements EncryptedEntityXApi<TimeTable> {\n i18n: any = i18n\n crypto: IccCryptoXApi\n dataOwnerApi: IccDataOwnerXApi\n\n constructor(\n host: string,\n headers: { [key: string]: string },\n crypto: IccCryptoXApi,\n dataOwnerApi: IccDataOwnerXApi,\n authenticationProvider: AuthenticationProvider = new NoAuthenticationProvider(),\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response> = typeof window !== 'undefined'\n ? window.fetch\n : typeof self !== 'undefined'\n ? self.fetch\n : fetch\n ) {\n super(host, headers, authenticationProvider, fetchImpl)\n this.crypto = crypto\n this.dataOwnerApi = dataOwnerApi\n }\n\n /**\n * Creates a new instance of timetable with initialised encryption metadata (not in the database).\n * @param user the current user.\n * @param tt initialised data for the timetable. Metadata such as id, creation data, etc. will be automatically initialised, but you can specify\n * other kinds of data or overwrite generated metadata with this. You can't specify encryption metadata.\n * @param options optional parameters:\n * - additionalDelegates: delegates which will have access to the entity in addition to the current data owner and delegates from the\n * auto-delegations. Must be an object which associates each data owner id with the access level to give to that data owner. May overlap with\n * auto-delegations, in such case the access level specified here will be used. Currently only WRITE access is supported, but in future also read\n * access will be possible.\n * @return a new instance of timetable.\n */\n async newInstance(\n user: User,\n tt: TimeTable,\n options: {\n additionalDelegates?: { [dataOwnerId: string]: 'WRITE' }\n } = {}\n ) {\n const timeTable = {\n ...(tt ?? {}),\n _type: 'org.taktik.icure.entities.TimeTable',\n id: tt?.id ?? this.crypto.primitives.randomUuid(),\n created: tt?.created ?? new Date().getTime(),\n modified: tt?.modified ?? new Date().getTime(),\n responsible: tt?.responsible ?? this.dataOwnerApi.getDataOwnerIdOf(user),\n author: tt?.author ?? user.id,\n codes: tt?.codes ?? [],\n tags: tt?.tags ?? [],\n }\n\n const extraDelegations = [\n ...Object.keys(options.additionalDelegates ?? {}),\n ...(user.autoDelegations?.all ?? []),\n ...(user.autoDelegations?.administrativeData ?? []),\n ]\n return new models.TimeTable(\n await this.crypto.entities\n .entityWithInitialisedEncryptedMetadata(timeTable, undefined, undefined, true, extraDelegations)\n .then((x) => x.updatedEntity)\n )\n }\n\n /**\n * Share an existing time table with other data owners, allowing them to access the non-encrypted data of the time table and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param delegateId the id of the data owner which will be granted access to the time table.\n * @param timeTable the time table to share.\n * @param options optional parameters to customize the sharing behaviour:\n * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted\n * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a\n * time table does not have encrypted content.\n * @return a promise which will contain the result of the operation: the updated entity if the operation was successful or details of the error if\n * the operation failed.\n */\n async shareWith(\n delegateId: string,\n timeTable: models.TimeTable,\n options: {\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n } = {}\n ): Promise<models.TimeTable> {\n return this.shareWithMany(timeTable, { [delegateId]: options })\n }\n\n /**\n * Share an existing time table with other data owners, allowing them to access the non-encrypted data of the time table and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param timeTable the time table to share.\n * @param delegates sharing options for each delegate.\n * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted\n * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a\n * time table does not have encrypted content.\n * @return a promise which will contain the result of the operation: the updated entity if the operation was successful or details of the error if\n * the operation failed.\n */\n async shareWithMany(\n timeTable: models.TimeTable,\n delegates: {\n [delegateId: string]: {\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n }\n }\n ): Promise<models.TimeTable> {\n const extended = await this.crypto.entities.entityWithAutoExtendedEncryptedMetadata(timeTable, true, delegates)\n if (!!extended) {\n return await this.modifyTimeTable(extended)\n } else return timeTable\n }\n\n async getDataOwnersWithAccessTo(\n entity: models.TimeTable\n ): Promise<{ permissionsByDataOwnerId: { [p: string]: 'WRITE' }; hasUnknownAnonymousDataOwners: boolean }> {\n return await this.crypto.entities.getDataOwnersWithAccessTo(entity)\n }\n\n async getEncryptionKeysOf(entity: models.TimeTable): Promise<string[]> {\n return await this.crypto.entities.encryptionKeysOf(entity)\n }\n}\n"]}
1
+ {"version":3,"file":"icc-time-table-x-api.js","sourceRoot":"","sources":["../../icc-x-api/icc-time-table-x-api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAA2C;AAG3C,wCAA4C;AAK5C,kDAAiD;AACjD,0EAAgG;AAChG,4EAAwE;AAIxE,wEAAoE;AACpE,IAAO,eAAe,GAAG,mCAAgB,CAAC,eAAe,CAAA;AAKzD,MAAa,gBAAiB,SAAQ,yBAAe;IAGnD,IAAI,OAAO;QACT,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,wBAAwB,CAAC,2BAA2B,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAA;IACpH,CAAC;IAED,YACE,IAAY,EACZ,OAAkC,EACjB,MAAqB,EACrB,YAA8B,EAC9B,cAAuB,EACxC,yBAAiD,IAAI,iDAAwB,EAAE,EAC/E,YAA2E,OAAO,MAAM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,CAAC,yBAAyB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAA;IACxG,CAAC;IAED,mBAAmB,CAAC,MAAwB;QAC1C,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,SAAS,CAAC,CAAA;IACpF,CAAC;IAED,uCAAuC,CAAC,MAAwB,EAAE,SAAmB;QACnF,OAAO,IAAI,CAAC,MAAM,CAAC,0BAA0B,CAAC,iCAAiC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,SAAS,CAAC,CAAA;IAC3H,CAAC;CACF;AAjLD,4CAiLC","sourcesContent":["import * as i18n from './rsrc/contact.i18n'\n\nimport * as _ from 'lodash'\nimport { IccTimeTableApi } from '../icc-api'\nimport { User } from '../icc-api/model/User'\nimport { TimeTable } from '../icc-api/model/TimeTable'\nimport { IccCryptoXApi } from './icc-crypto-x-api'\nimport { IccDataOwnerXApi } from './icc-data-owner-x-api'\nimport * as models from '../icc-api/model/models'\nimport { AuthenticationProvider, NoAuthenticationProvider } from './auth/AuthenticationProvider'\nimport { ShareMetadataBehaviour } from './crypto/ShareMetadataBehaviour'\nimport { ShareResult } from './utils/ShareResult'\nimport { EntityShareRequest } from '../icc-api/model/requests/EntityShareRequest'\nimport RequestedPermissionEnum = EntityShareRequest.RequestedPermissionEnum\nimport { SecureDelegation } from '../icc-api/model/SecureDelegation'\nimport AccessLevelEnum = SecureDelegation.AccessLevelEnum\nimport { XHR } from '../icc-api/api/XHR'\nimport { EncryptedEntityXApi } from './basexapi/EncryptedEntityXApi'\nimport { MaintenanceTask } from '../icc-api/model/models'\n\nexport class IccTimeTableXApi extends IccTimeTableApi implements EncryptedEntityXApi<models.TimeTable> {\n i18n: any = i18n\n\n get headers(): Promise<Array<XHR.Header>> {\n return super.headers.then((h) => this.crypto.accessControlKeysHeaders.addAccessControlKeysHeaders(h, 'TimeTable'))\n }\n\n constructor(\n host: string,\n headers: { [key: string]: string },\n private readonly crypto: IccCryptoXApi,\n private readonly dataOwnerApi: IccDataOwnerXApi,\n private readonly autofillAuthor: boolean,\n authenticationProvider: AuthenticationProvider = new NoAuthenticationProvider(),\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response> = typeof window !== 'undefined'\n ? window.fetch\n : typeof self !== 'undefined'\n ? self.fetch\n : fetch\n ) {\n super(host, headers, authenticationProvider, fetchImpl)\n this.crypto = crypto\n this.dataOwnerApi = dataOwnerApi\n }\n\n /**\n * Creates a new instance of timetable with initialised encryption metadata (not in the database).\n * @param user the current user.\n * @param tt initialised data for the timetable. Metadata such as id, creation data, etc. will be automatically initialised, but you can specify\n * other kinds of data or overwrite generated metadata with this. You can't specify encryption metadata.\n * @param options optional parameters:\n * - additionalDelegates: delegates which will have access to the entity in addition to the current data owner and delegates from the\n * auto-delegations. Must be an object which associates each data owner id with the access level to give to that data owner. May overlap with\n * auto-delegations, in such case the access level specified here will be used.\n * @return a new instance of timetable.\n */\n async newInstance(\n user: User,\n tt: TimeTable,\n options: {\n additionalDelegates?: { [dataOwnerId: string]: AccessLevelEnum }\n preferredSfk?: string\n } = {}\n ) {\n const timeTable: TimeTable = {\n ...(tt ?? {}),\n id: tt?.id ?? this.crypto.primitives.randomUuid(),\n created: tt?.created ?? new Date().getTime(),\n modified: tt?.modified ?? new Date().getTime(),\n responsible: tt?.responsible ?? (this.autofillAuthor ? this.dataOwnerApi.getDataOwnerIdOf(user) : undefined),\n author: tt?.author ?? (this.autofillAuthor ? user.id : undefined),\n codes: tt?.codes ?? [],\n tags: tt?.tags ?? [],\n }\n\n const extraDelegations = {\n ...Object.fromEntries(\n [...(user.autoDelegations?.all ?? []), ...(user.autoDelegations?.administrativeData ?? [])].map((d) => [d, AccessLevelEnum.WRITE])\n ),\n ...(options?.additionalDelegates ?? {}),\n }\n\n return new models.TimeTable(\n await this.crypto.xapi\n .entityWithInitialisedEncryptedMetadata(timeTable, 'TimeTable', undefined, undefined, true, false, extraDelegations)\n .then((x) => x.updatedEntity)\n )\n }\n\n /**\n * @return if the logged data owner has write access to the content of the given time table\n */\n async hasWriteAccess(timeTable: models.TimeTable): Promise<boolean> {\n return this.crypto.xapi.hasWriteAccess({ entity: timeTable, type: 'TimeTable' })\n }\n\n /**\n * Share an existing time table with other data owners, allowing them to access the non-encrypted data of the time table and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param delegateId the id of the data owner which will be granted access to the time table.\n * @param timeTable the time table to share.\n * @param options optional parameters to customize the sharing behaviour:\n * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted\n * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a\n * time table does not have encrypted content.\n * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.\n * @return the updated entity\n */\n async shareWith(\n delegateId: string,\n timeTable: models.TimeTable,\n options: {\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n } = {}\n ): Promise<models.TimeTable> {\n return this.shareWithMany(timeTable, { [delegateId]: options })\n }\n\n /**\n * Share an existing time table with other data owners, allowing them to access the non-encrypted data of the time table and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param timeTable the time table to share.\n * @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options:\n * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted\n * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a\n * time table does not have encrypted content.\n * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.\n * @return the updated entity\n */\n async shareWithMany(\n timeTable: models.TimeTable,\n delegates: {\n [delegateId: string]: {\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n }\n }\n ): Promise<models.TimeTable> {\n return (await this.tryShareWithMany(timeTable, delegates)).updatedEntityOrThrow\n }\n\n /**\n * Share an existing time table with other data owners, allowing them to access the non-encrypted data of the time table and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param timeTable the time table to share.\n * @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options:\n * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted\n * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a\n * time table does not have encrypted content.\n * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.\n * @return a promise which will contain the result of the operation: the updated entity if the operation was successful or details of the error if\n * the operation failed.\n */\n async tryShareWithMany(\n timeTable: models.TimeTable,\n delegates: {\n [delegateId: string]: {\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n }\n }\n ): Promise<ShareResult<models.TimeTable>> {\n // All entities should have an encryption key.\n const entityWithEncryptionKey = await this.crypto.xapi.ensureEncryptionKeysInitialised(timeTable, 'TimeTable')\n const updatedEntity = entityWithEncryptionKey ? await this.modifyTimeTable(entityWithEncryptionKey) : timeTable\n return this.crypto.xapi.simpleShareOrUpdateEncryptedEntityMetadata(\n { entity: updatedEntity, type: 'TimeTable' },\n true,\n Object.fromEntries(\n Object.entries(delegates).map(([delegateId, options]) => [\n delegateId,\n {\n requestedPermissions: options.requestedPermissions,\n shareEncryptionKeys: options.shareEncryptionKey,\n shareOwningEntityIds: ShareMetadataBehaviour.NEVER,\n shareSecretIds: undefined,\n },\n ])\n ),\n (x) => this.bulkShareTimeTable(x)\n )\n }\n\n getDataOwnersWithAccessTo(\n entity: models.TimeTable\n ): Promise<{ permissionsByDataOwnerId: { [p: string]: AccessLevelEnum }; hasUnknownAnonymousDataOwners: boolean }> {\n return this.crypto.delegationsDeAnonymization.getDataOwnersWithAccessTo({ entity, type: 'TimeTable' })\n }\n\n getEncryptionKeysOf(entity: models.TimeTable): Promise<string[]> {\n return this.crypto.xapi.encryptionKeysOf({ entity, type: 'TimeTable' }, undefined)\n }\n\n createDelegationDeAnonymizationMetadata(entity: models.TimeTable, delegates: string[]): Promise<void> {\n return this.crypto.delegationsDeAnonymization.createOrUpdateDeAnonymizationInfo({ entity, type: 'TimeTable' }, delegates)\n }\n}\n"]}
@@ -0,0 +1,191 @@
1
+ import { IccAuthApi, IccTopicApi } from '../icc-api';
2
+ import { IccCryptoXApi } from './icc-crypto-x-api';
3
+ import * as models from '../icc-api/model/models';
4
+ import { ListOfIds, Topic, TopicRole } from '../icc-api/model/models';
5
+ import { IccDataOwnerXApi } from './icc-data-owner-x-api';
6
+ import { AuthenticationProvider } from './auth/AuthenticationProvider';
7
+ import { SecureDelegation } from '../icc-api/model/SecureDelegation';
8
+ import { ShareMetadataBehaviour } from './crypto/ShareMetadataBehaviour';
9
+ import { ShareResult } from './utils/ShareResult';
10
+ import { EntityShareRequest } from '../icc-api/model/requests/EntityShareRequest';
11
+ import { XHR } from '../icc-api/api/XHR';
12
+ import { EncryptedEntityXApi } from './basexapi/EncryptedEntityXApi';
13
+ import { FilterChainTopic } from '../icc-api/model/FilterChainTopic';
14
+ import { PaginatedListTopic } from '../icc-api/model/PaginatedListTopic';
15
+ import AccessLevelEnum = SecureDelegation.AccessLevelEnum;
16
+ import RequestedPermissionEnum = EntityShareRequest.RequestedPermissionEnum;
17
+ import { SubscriptionOptions } from './utils';
18
+ import { AbstractFilter } from './filters/filters';
19
+ import { Connection } from '../icc-api/model/Connection';
20
+ export declare class IccTopicXApi extends IccTopicApi implements EncryptedEntityXApi<models.Topic> {
21
+ private readonly crypto;
22
+ private readonly dataOwnerApi;
23
+ private readonly authApi;
24
+ private readonly autofillAuthor;
25
+ private readonly encryptedFields;
26
+ constructor(host: string, headers: {
27
+ [key: string]: string;
28
+ }, crypto: IccCryptoXApi, dataOwnerApi: IccDataOwnerXApi, authApi: IccAuthApi, autofillAuthor: boolean, authenticationProvider?: AuthenticationProvider, encryptedKeys?: Array<string>, fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>);
29
+ get headers(): Promise<Array<XHR.Header>>;
30
+ /**
31
+ * Creates a new instance of topic with initialised encryption metadata (not in the database).
32
+ * @param user the current user.
33
+ * @param patient the patient this topic refers to.
34
+ * @param c initialised data for the topic. Metadata such as id, creation data, etc. will be automatically initialised, but you can specify
35
+ * other kinds of data or overwrite generated metadata with this. You can't specify encryption metadata.
36
+ * @param options optional parameters:
37
+ * - additionalDelegates: delegates which will have access to the entity in addition to the current data owner and delegates from the
38
+ * auto-delegations. Must be an object which associates each data owner id with the access level to give to that data owner. May overlap with
39
+ * auto-delegations, in such case the access level specified here will be used.
40
+ * - preferredSfk: secret id of the patient to use as the secret foreign key to use for the topic. The default value will be a
41
+ * secret id of patient known by the topmost parent in the current data owner hierarchy.
42
+ * @return a new instance of topic.
43
+ */
44
+ newInstance(user: models.User, patient: models.Patient | null, c?: Topic, // TODO: Why this isn't Topic?
45
+ options?: {
46
+ additionalDelegates?: {
47
+ [dataOwnerId: string]: AccessLevelEnum;
48
+ };
49
+ preferredSfk?: string;
50
+ }): Promise<models.Topic>;
51
+ decrypt(topics: Array<models.Topic>): Promise<models.Topic[]>;
52
+ encrypt(topics: Array<models.Topic>): Promise<Array<models.Topic>>;
53
+ /**
54
+ * Create and share a new topic with other participants.
55
+ * @param body the topic to create.
56
+ * @return the created topic.
57
+ */
58
+ createTopic(body: Topic): Promise<Topic>;
59
+ /**
60
+ * @param topic a topic
61
+ * @return the id of the patient that the topic refers to, retrieved from the encrypted metadata. Normally there should only be one element
62
+ * in the returned array, but in case of entity merges there could be multiple values.
63
+ */
64
+ decryptPatientIdOf(topic: models.Topic): Promise<string[]>;
65
+ /**
66
+ * @return if the logged data owner has write access to the content of the given topic
67
+ */
68
+ hasWriteAccess(topic: models.Topic): Promise<boolean>;
69
+ /**
70
+ * Share an existing topic with other data owners, allowing them to access the non-encrypted data of the topic and optionally also
71
+ * the encrypted content, with read-only or read-write permissions.
72
+ * @param delegateId the id of the data owner which will be granted access to the topic.
73
+ * @param topic the topic to share.
74
+ * @param options optional parameters to customize the sharing behaviour:
75
+ * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted
76
+ * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}).
77
+ * - sharePatientId: specifies if the id of the patient that this topic refers to should be shared with the delegate (defaults to
78
+ * {@link ShareMetadataBehaviour.IF_AVAILABLE}).
79
+ * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.
80
+ * @return the updated entity
81
+ */
82
+ shareWith(delegateId: string, topic: models.Topic, options?: {
83
+ requestedPermissions?: RequestedPermissionEnum;
84
+ shareEncryptionKey?: ShareMetadataBehaviour;
85
+ sharePatientId?: ShareMetadataBehaviour;
86
+ }): Promise<models.Topic>;
87
+ /**
88
+ * Share an existing topic with other data owners, allowing them to access the non-encrypted data of the topic and optionally also
89
+ * the encrypted content, with read-only or read-write permissions.
90
+ * @param topic the topic to share.
91
+ * @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options:
92
+ * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted
93
+ * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a
94
+ * topic does not have encrypted content.
95
+ * - sharePatientId: specifies if the id of the patient that this topic refers to should be shared with the delegate (defaults to
96
+ * {@link ShareMetadataBehaviour.IF_AVAILABLE}).
97
+ * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.
98
+ * @return the updated entity
99
+ */
100
+ shareWithMany(topic: models.Topic, delegates: {
101
+ [delegateId: string]: {
102
+ requestedPermissions?: RequestedPermissionEnum;
103
+ shareEncryptionKey?: ShareMetadataBehaviour;
104
+ sharePatientId?: ShareMetadataBehaviour;
105
+ };
106
+ }): Promise<models.Topic>;
107
+ /**
108
+ * Share an existing topic with other data owners, allowing them to access the non-encrypted data of the topic and optionally also
109
+ * the encrypted content, with read-only or read-write permissions.
110
+ * @param topic the topic to share.
111
+ * @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options:
112
+ * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted
113
+ * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a
114
+ * topic does not have encrypted content.
115
+ * - sharePatientId: specifies if the id of the patient that this topic refers to should be shared with the delegate (defaults to
116
+ * {@link ShareMetadataBehaviour.IF_AVAILABLE}).
117
+ * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.
118
+ * @return a promise which will contain the result of the operation: the updated entity if the operation was successful or details of the error if
119
+ * the operation failed.
120
+ */
121
+ tryShareWithMany(topic: models.Topic, delegates: {
122
+ [delegateId: string]: {
123
+ requestedPermissions?: RequestedPermissionEnum;
124
+ shareEncryptionKey?: ShareMetadataBehaviour;
125
+ sharePatientId?: ShareMetadataBehaviour;
126
+ };
127
+ }): Promise<ShareResult<models.Topic>>;
128
+ getDataOwnersWithAccessTo(entity: models.Topic): Promise<{
129
+ permissionsByDataOwnerId: {
130
+ [p: string]: AccessLevelEnum;
131
+ };
132
+ hasUnknownAnonymousDataOwners: boolean;
133
+ }>;
134
+ getEncryptionKeysOf(entity: models.Topic): Promise<string[]>;
135
+ /**
136
+ * Filter and decrypt topics by the given filter.
137
+ * @param body the filter to apply.
138
+ * @param startDocumentId the document id to start from (inclusive).
139
+ * @param limit the maximum number of topics to return in the page.
140
+ * @return a paginated list of topics.
141
+ */
142
+ filterTopicsBy(body: FilterChainTopic, startDocumentId?: string, limit?: number): Promise<PaginatedListTopic>;
143
+ /**
144
+ * Obtain the topic with the given id and decrypt it.
145
+ * @param id the id of the topic to retrieve.
146
+ * @return the decrypted topic.
147
+ */
148
+ getTopic(id: string): Promise<Topic>;
149
+ /**
150
+ * Obtain the topics with the given ids and decrypt them.
151
+ * @param body the ids of the topics to retrieve.
152
+ * @return the decrypted topics.
153
+ */
154
+ getTopics(body: ListOfIds): Promise<Array<Topic>>;
155
+ /**
156
+ * Update and encrypt the given topic.
157
+ * @param body the topic to update.
158
+ * @return the updated decrypted topic.
159
+ */
160
+ modifyTopic(body: Topic): Promise<Topic>;
161
+ /**
162
+ * @internal this method is for internal use only and may be changed without notice
163
+ * @param body data owner id of the data owner to which the participant should be added and the topic role of the participant.
164
+ * @param topicId Id of the topic to which the participant should be added.
165
+ */
166
+ addParticipant(body: {
167
+ dataOwnerId: string;
168
+ topicRole: TopicRole;
169
+ }, topicId: string): Promise<Topic>;
170
+ /**
171
+ * This method is similar to {@link addParticipant} but it also shares the topic with the data owner before adding the participant.
172
+ * @param body data owner id of the data owner to which the participant should be added and the topic role of the participant.
173
+ * @param topic the topic to share and to which the participant should be added.
174
+ * @return the updated topic.
175
+ */
176
+ addParticipantWithTopic(body: {
177
+ dataOwnerId: string;
178
+ topicRole: TopicRole;
179
+ }, topic: Topic): Promise<Topic>;
180
+ /**
181
+ * Remove the participant with the given data owner id from the topic with the given id.
182
+ * @param body data owner id of the participant to remove.
183
+ * @param topicId Id of the topic from which the participant should be removed.
184
+ * @return the updated decrypted topic.
185
+ */
186
+ removeParticipant(body: {
187
+ dataOwnerId: string;
188
+ }, topicId: string): Promise<Topic>;
189
+ subscribeToTopicEvents(eventTypes: ('CREATE' | 'UPDATE' | 'DELETE')[], filter: AbstractFilter<Topic> | undefined, eventFired: (message: Topic) => Promise<void>, options?: SubscriptionOptions): Promise<Connection>;
190
+ createDelegationDeAnonymizationMetadata(entity: Topic, delegates: string[]): Promise<void>;
191
+ }