@icure/api 8.6.19 → 8.7.0

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 (326) hide show
  1. package/icc-api/api/IccDocumentApi.d.ts +10 -2
  2. package/icc-api/api/IccDocumentApi.js +22 -4
  3. package/icc-api/api/IccDocumentApi.js.map +1 -1
  4. package/icc-api/api/IccReceiptApi.d.ts +17 -0
  5. package/icc-api/api/IccReceiptApi.js +52 -0
  6. package/icc-api/api/IccReceiptApi.js.map +1 -1
  7. package/icc-api/model/DataAttachment.d.ts +22 -0
  8. package/icc-api/model/DataAttachment.js.map +1 -1
  9. package/icc-api/model/Document.d.ts +6 -0
  10. package/icc-api/model/Document.js.map +1 -1
  11. package/icc-api/model/Receipt.d.ts +6 -0
  12. package/icc-api/model/Receipt.js.map +1 -1
  13. package/icc-x-api/crypto/BaseExchangeDataManager.js +2 -2
  14. package/icc-x-api/crypto/BaseExchangeDataManager.js.map +1 -1
  15. package/icc-x-api/crypto/ExchangeDataManager.js +3 -3
  16. package/icc-x-api/crypto/ExchangeDataManager.js.map +1 -1
  17. package/icc-x-api/crypto/ExtendedApisUtils.d.ts +1 -1
  18. package/icc-x-api/crypto/ExtendedApisUtils.js.map +1 -1
  19. package/icc-x-api/crypto/ExtendedApisUtilsImpl.d.ts +1 -1
  20. package/icc-x-api/crypto/ExtendedApisUtilsImpl.js +8 -2
  21. package/icc-x-api/crypto/ExtendedApisUtilsImpl.js.map +1 -1
  22. package/icc-x-api/crypto/RecoveryDataEncryption.js.map +1 -1
  23. package/icc-x-api/icc-accesslog-x-api.js +7 -7
  24. package/icc-x-api/icc-accesslog-x-api.js.map +1 -1
  25. package/icc-x-api/icc-calendar-item-x-api.js +7 -7
  26. package/icc-x-api/icc-calendar-item-x-api.js.map +1 -1
  27. package/icc-x-api/icc-classification-x-api.js +4 -5
  28. package/icc-x-api/icc-classification-x-api.js.map +1 -1
  29. package/icc-x-api/icc-code-x-api.d.ts +2 -2
  30. package/icc-x-api/icc-code-x-api.js +3 -33
  31. package/icc-x-api/icc-code-x-api.js.map +1 -1
  32. package/icc-x-api/icc-contact-x-api.js +20 -33
  33. package/icc-x-api/icc-contact-x-api.js.map +1 -1
  34. package/icc-x-api/icc-doctemplate-x-api.js.map +1 -1
  35. package/icc-x-api/icc-document-x-api.d.ts +8 -7
  36. package/icc-x-api/icc-document-x-api.js +64 -22
  37. package/icc-x-api/icc-document-x-api.js.map +1 -1
  38. package/icc-x-api/icc-form-x-api.js +3 -4
  39. package/icc-x-api/icc-form-x-api.js.map +1 -1
  40. package/icc-x-api/icc-helement-x-api.js +11 -11
  41. package/icc-x-api/icc-helement-x-api.js.map +1 -1
  42. package/icc-x-api/icc-invoice-x-api.js +3 -4
  43. package/icc-x-api/icc-invoice-x-api.js.map +1 -1
  44. package/icc-x-api/icc-maintenance-task-x-api.js +3 -3
  45. package/icc-x-api/icc-maintenance-task-x-api.js.map +1 -1
  46. package/icc-x-api/icc-patient-x-api.js +29 -29
  47. package/icc-x-api/icc-patient-x-api.js.map +1 -1
  48. package/icc-x-api/icc-receipt-x-api.d.ts +40 -0
  49. package/icc-x-api/icc-receipt-x-api.js +79 -1
  50. package/icc-x-api/icc-receipt-x-api.js.map +1 -1
  51. package/icc-x-api/icc-topic-x-api.js.map +1 -1
  52. package/icc-x-api/utils/code-util.d.ts +23 -0
  53. package/icc-x-api/utils/code-util.js +39 -2
  54. package/icc-x-api/utils/code-util.js.map +1 -1
  55. package/icc-x-api/utils/collection-utils.d.ts +13 -0
  56. package/icc-x-api/utils/collection-utils.js +69 -0
  57. package/icc-x-api/utils/collection-utils.js.map +1 -1
  58. package/icc-x-api/utils/compression-utils.d.ts +28 -0
  59. package/icc-x-api/utils/compression-utils.js +106 -0
  60. package/icc-x-api/utils/compression-utils.js.map +1 -0
  61. package/icc-x-api/utils/crypto-utils.js +7 -7
  62. package/icc-x-api/utils/crypto-utils.js.map +1 -1
  63. package/icc-x-api/utils/formatting-util.d.ts +1 -3
  64. package/icc-x-api/utils/formatting-util.js +15 -17
  65. package/icc-x-api/utils/formatting-util.js.map +1 -1
  66. package/icc-x-api/utils/hcp-util.js +2 -3
  67. package/icc-x-api/utils/hcp-util.js.map +1 -1
  68. package/icc-x-api/utils/insurability-util.js +10 -8
  69. package/icc-x-api/utils/insurability-util.js.map +1 -1
  70. package/icc-x-api/utils/lzma-wasm.d.ts +6 -0
  71. package/icc-x-api/utils/lzma-wasm.js +81 -0
  72. package/icc-x-api/utils/lzma-wasm.js.map +1 -0
  73. package/icc-x-api/utils/mutex.d.ts +12 -0
  74. package/icc-x-api/utils/mutex.js +26 -0
  75. package/icc-x-api/utils/mutex.js.map +1 -0
  76. package/icc-x-api/utils/websocket.js +7 -7
  77. package/icc-x-api/utils/websocket.js.map +1 -1
  78. package/icc-x-api/wasm/lzma/lzma.js +2 -0
  79. package/icc-x-api/wasm/lzma/lzma.wasm +0 -0
  80. package/package.json +2 -11
  81. package/icc-x-api/utils/uuid-encoder.d.ts +0 -44
  82. package/icc-x-api/utils/uuid-encoder.js +0 -114
  83. package/icc-x-api/utils/uuid-encoder.js.map +0 -1
  84. package/test/icc-api/api/IccAgendaApi.d.ts +0 -1
  85. package/test/icc-api/api/IccAgendaApi.js +0 -64
  86. package/test/icc-api/api/IccAgendaApi.js.map +0 -1
  87. package/test/icc-api/api/IccAnonymousAccessApi.d.ts +0 -1
  88. package/test/icc-api/api/IccAnonymousAccessApi.js +0 -58
  89. package/test/icc-api/api/IccAnonymousAccessApi.js.map +0 -1
  90. package/test/icc-api/api/IccCalendarItemApi.d.ts +0 -1
  91. package/test/icc-api/api/IccCalendarItemApi.js +0 -67
  92. package/test/icc-api/api/IccCalendarItemApi.js.map +0 -1
  93. package/test/icc-api/api/IccCalendarItemTypeApi.d.ts +0 -1
  94. package/test/icc-api/api/IccCalendarItemTypeApi.js +0 -96
  95. package/test/icc-api/api/IccCalendarItemTypeApi.js.map +0 -1
  96. package/test/icc-api/api/IccCodeApi.d.ts +0 -1
  97. package/test/icc-api/api/IccCodeApi.js +0 -38
  98. package/test/icc-api/api/IccCodeApi.js.map +0 -1
  99. package/test/icc-api/api/IccDocumentApi.d.ts +0 -1
  100. package/test/icc-api/api/IccDocumentApi.js +0 -199
  101. package/test/icc-api/api/IccDocumentApi.js.map +0 -1
  102. package/test/icc-api/api/IccGroupApi.d.ts +0 -1
  103. package/test/icc-api/api/IccGroupApi.js +0 -50
  104. package/test/icc-api/api/IccGroupApi.js.map +0 -1
  105. package/test/icc-api/api/IccKeywordApi.d.ts +0 -1
  106. package/test/icc-api/api/IccKeywordApi.js +0 -64
  107. package/test/icc-api/api/IccKeywordApi.js.map +0 -1
  108. package/test/icc-api/api/IccMedicalLocationApi.d.ts +0 -1
  109. package/test/icc-api/api/IccMedicalLocationApi.js +0 -64
  110. package/test/icc-api/api/IccMedicalLocationApi.js.map +0 -1
  111. package/test/icc-api/api/IccPlaceApi.d.ts +0 -1
  112. package/test/icc-api/api/IccPlaceApi.js +0 -64
  113. package/test/icc-api/api/IccPlaceApi.js.map +0 -1
  114. package/test/icc-api/api/IccRecoveryDataApi.d.ts +0 -1
  115. package/test/icc-api/api/IccRecoveryDataApi.js +0 -95
  116. package/test/icc-api/api/IccRecoveryDataApi.js.map +0 -1
  117. package/test/icc-api/api/IccRoleApi.d.ts +0 -1
  118. package/test/icc-api/api/IccRoleApi.js +0 -34
  119. package/test/icc-api/api/IccRoleApi.js.map +0 -1
  120. package/test/icc-api/api/IccUserApi.d.ts +0 -1
  121. package/test/icc-api/api/IccUserApi.js +0 -96
  122. package/test/icc-api/api/IccUserApi.js.map +0 -1
  123. package/test/icc-api/e2e/IccCalendarItemApi.d.ts +0 -1
  124. package/test/icc-api/e2e/IccCalendarItemApi.js +0 -46
  125. package/test/icc-api/e2e/IccCalendarItemApi.js.map +0 -1
  126. package/test/icc-api/model/modelHelpersTest.d.ts +0 -1
  127. package/test/icc-api/model/modelHelpersTest.js +0 -45
  128. package/test/icc-api/model/modelHelpersTest.js.map +0 -1
  129. package/test/icc-x-api/auth/group-switch-test.d.ts +0 -1
  130. package/test/icc-x-api/auth/group-switch-test.js +0 -81
  131. package/test/icc-x-api/auth/group-switch-test.js.map +0 -1
  132. package/test/icc-x-api/auth/jwt-concurrency-test.d.ts +0 -2
  133. package/test/icc-x-api/auth/jwt-concurrency-test.js +0 -112
  134. package/test/icc-x-api/auth/jwt-concurrency-test.js.map +0 -1
  135. package/test/icc-x-api/auth/jwt-provider-test.d.ts +0 -1
  136. package/test/icc-x-api/auth/jwt-provider-test.js +0 -197
  137. package/test/icc-x-api/auth/jwt-provider-test.js.map +0 -1
  138. package/test/icc-x-api/auth/smart-auth-provider-test.d.ts +0 -1
  139. package/test/icc-x-api/auth/smart-auth-provider-test.js +0 -224
  140. package/test/icc-x-api/auth/smart-auth-provider-test.js.map +0 -1
  141. package/test/icc-x-api/autofix-anonymity-test.d.ts +0 -1
  142. package/test/icc-x-api/autofix-anonymity-test.js +0 -122
  143. package/test/icc-x-api/autofix-anonymity-test.js.map +0 -1
  144. package/test/icc-x-api/confidential-entities-test.d.ts +0 -1
  145. package/test/icc-x-api/confidential-entities-test.js +0 -168
  146. package/test/icc-x-api/confidential-entities-test.js.map +0 -1
  147. package/test/icc-x-api/crud/comprehensive-crud-test.d.ts +0 -1
  148. package/test/icc-x-api/crud/comprehensive-crud-test.js +0 -276
  149. package/test/icc-x-api/crud/comprehensive-crud-test.js.map +0 -1
  150. package/test/icc-x-api/crud/entities-crud-test-interface.d.ts +0 -16
  151. package/test/icc-x-api/crud/entities-crud-test-interface.js +0 -408
  152. package/test/icc-x-api/crud/entities-crud-test-interface.js.map +0 -1
  153. package/test/icc-x-api/crypto/anonymous-delegations-test.d.ts +0 -1
  154. package/test/icc-x-api/crypto/anonymous-delegations-test.js +0 -587
  155. package/test/icc-x-api/crypto/anonymous-delegations-test.js.map +0 -1
  156. package/test/icc-x-api/crypto/concurrency.d.ts +0 -1
  157. package/test/icc-x-api/crypto/concurrency.js +0 -35
  158. package/test/icc-x-api/crypto/concurrency.js.map +0 -1
  159. package/test/icc-x-api/crypto/crypto-utils.d.ts +0 -1
  160. package/test/icc-x-api/crypto/crypto-utils.js +0 -79
  161. package/test/icc-x-api/crypto/crypto-utils.js.map +0 -1
  162. package/test/icc-x-api/crypto/cryptoTest.d.ts +0 -2
  163. package/test/icc-x-api/crypto/cryptoTest.js +0 -402
  164. package/test/icc-x-api/crypto/cryptoTest.js.map +0 -1
  165. package/test/icc-x-api/crypto/delegate-ci-to-patient-with-missing-keys-test.d.ts +0 -1
  166. package/test/icc-x-api/crypto/delegate-ci-to-patient-with-missing-keys-test.js +0 -166
  167. package/test/icc-x-api/crypto/delegate-ci-to-patient-with-missing-keys-test.js.map +0 -1
  168. package/test/icc-x-api/crypto/exchange-data-manager-test.d.ts +0 -1
  169. package/test/icc-x-api/crypto/exchange-data-manager-test.js +0 -674
  170. package/test/icc-x-api/crypto/exchange-data-manager-test.js.map +0 -1
  171. package/test/icc-x-api/crypto/full-crypto-test.d.ts +0 -1
  172. package/test/icc-x-api/crypto/full-crypto-test.js +0 -454
  173. package/test/icc-x-api/crypto/full-crypto-test.js.map +0 -1
  174. package/test/icc-x-api/crypto/legacy-metadata-migration-test.d.ts +0 -1
  175. package/test/icc-x-api/crypto/legacy-metadata-migration-test.js +0 -379
  176. package/test/icc-x-api/crypto/legacy-metadata-migration-test.js.map +0 -1
  177. package/test/icc-x-api/crypto/secure-delegations-manager-test.d.ts +0 -1
  178. package/test/icc-x-api/crypto/secure-delegations-manager-test.js +0 -278
  179. package/test/icc-x-api/crypto/secure-delegations-manager-test.js.map +0 -1
  180. package/test/icc-x-api/crypto/shamir.d.ts +0 -2
  181. package/test/icc-x-api/crypto/shamir.js +0 -167
  182. package/test/icc-x-api/crypto/shamir.js.map +0 -1
  183. package/test/icc-x-api/crypto/share-to-newly-created-patient-from-hcp.d.ts +0 -1
  184. package/test/icc-x-api/crypto/share-to-newly-created-patient-from-hcp.js +0 -71
  185. package/test/icc-x-api/crypto/share-to-newly-created-patient-from-hcp.js.map +0 -1
  186. package/test/icc-x-api/crypto/soft-deleted-data-owners.d.ts +0 -2
  187. package/test/icc-x-api/crypto/soft-deleted-data-owners.js +0 -113
  188. package/test/icc-x-api/crypto/soft-deleted-data-owners.js.map +0 -1
  189. package/test/icc-x-api/crypto/user-encryption-keys-manager-test.d.ts +0 -1
  190. package/test/icc-x-api/crypto/user-encryption-keys-manager-test.js +0 -246
  191. package/test/icc-x-api/crypto/user-encryption-keys-manager-test.js.map +0 -1
  192. package/test/icc-x-api/entity-with-attachments-api-test.d.ts +0 -1
  193. package/test/icc-x-api/entity-with-attachments-api-test.js +0 -142
  194. package/test/icc-x-api/entity-with-attachments-api-test.js.map +0 -1
  195. package/test/icc-x-api/filters/filters.d.ts +0 -1
  196. package/test/icc-x-api/filters/filters.js +0 -49
  197. package/test/icc-x-api/filters/filters.js.map +0 -1
  198. package/test/icc-x-api/filters/healthelement.d.ts +0 -1
  199. package/test/icc-x-api/filters/healthelement.js +0 -333
  200. package/test/icc-x-api/filters/healthelement.js.map +0 -1
  201. package/test/icc-x-api/icc-accesslog-x-api.d.ts +0 -1
  202. package/test/icc-x-api/icc-accesslog-x-api.js +0 -106
  203. package/test/icc-x-api/icc-accesslog-x-api.js.map +0 -1
  204. package/test/icc-x-api/icc-application-settings-x-api.d.ts +0 -1
  205. package/test/icc-x-api/icc-application-settings-x-api.js +0 -91
  206. package/test/icc-x-api/icc-application-settings-x-api.js.map +0 -1
  207. package/test/icc-x-api/icc-auth-api.d.ts +0 -1
  208. package/test/icc-x-api/icc-auth-api.js +0 -47
  209. package/test/icc-x-api/icc-auth-api.js.map +0 -1
  210. package/test/icc-x-api/icc-calendar-item-x-api.d.ts +0 -1
  211. package/test/icc-x-api/icc-calendar-item-x-api.js +0 -150
  212. package/test/icc-x-api/icc-calendar-item-x-api.js.map +0 -1
  213. package/test/icc-x-api/icc-contact-x-api.d.ts +0 -1
  214. package/test/icc-x-api/icc-contact-x-api.js +0 -355
  215. package/test/icc-x-api/icc-contact-x-api.js.map +0 -1
  216. package/test/icc-x-api/icc-document-x-api.d.ts +0 -1
  217. package/test/icc-x-api/icc-document-x-api.js +0 -76
  218. package/test/icc-x-api/icc-document-x-api.js.map +0 -1
  219. package/test/icc-x-api/icc-form-x-api.d.ts +0 -1
  220. package/test/icc-x-api/icc-form-x-api.js +0 -413
  221. package/test/icc-x-api/icc-form-x-api.js.map +0 -1
  222. package/test/icc-x-api/icc-hcparty-x-api-test.d.ts +0 -1
  223. package/test/icc-x-api/icc-hcparty-x-api-test.js +0 -43
  224. package/test/icc-x-api/icc-hcparty-x-api-test.js.map +0 -1
  225. package/test/icc-x-api/icc-helement-x-api-test.d.ts +0 -1
  226. package/test/icc-x-api/icc-helement-x-api-test.js +0 -155
  227. package/test/icc-x-api/icc-helement-x-api-test.js.map +0 -1
  228. package/test/icc-x-api/icc-invoice-x-api.d.ts +0 -1
  229. package/test/icc-x-api/icc-invoice-x-api.js +0 -99
  230. package/test/icc-x-api/icc-invoice-x-api.js.map +0 -1
  231. package/test/icc-x-api/icc-maintenance-task-x-api-test.d.ts +0 -1
  232. package/test/icc-x-api/icc-maintenance-task-x-api-test.js +0 -222
  233. package/test/icc-x-api/icc-maintenance-task-x-api-test.js.map +0 -1
  234. package/test/icc-x-api/icc-message-x-api.d.ts +0 -1
  235. package/test/icc-x-api/icc-message-x-api.js +0 -54
  236. package/test/icc-x-api/icc-message-x-api.js.map +0 -1
  237. package/test/icc-x-api/icc-patient-x-api-test.d.ts +0 -1
  238. package/test/icc-x-api/icc-patient-x-api-test.js +0 -165
  239. package/test/icc-x-api/icc-patient-x-api-test.js.map +0 -1
  240. package/test/icc-x-api/icc-recovery-x-api.d.ts +0 -1
  241. package/test/icc-x-api/icc-recovery-x-api.js +0 -175
  242. package/test/icc-x-api/icc-recovery-x-api.js.map +0 -1
  243. package/test/icc-x-api/icc-topic-x-api.d.ts +0 -1
  244. package/test/icc-x-api/icc-topic-x-api.js +0 -269
  245. package/test/icc-x-api/icc-topic-x-api.js.map +0 -1
  246. package/test/icc-x-api/icc-user-x-api-test.d.ts +0 -1
  247. package/test/icc-x-api/icc-user-x-api-test.js +0 -99
  248. package/test/icc-x-api/icc-user-x-api-test.js.map +0 -1
  249. package/test/icc-x-api/keyless-api.d.ts +0 -1
  250. package/test/icc-x-api/keyless-api.js +0 -125
  251. package/test/icc-x-api/keyless-api.js.map +0 -1
  252. package/test/icc-x-api/patient-user.d.ts +0 -2
  253. package/test/icc-x-api/patient-user.js +0 -103
  254. package/test/icc-x-api/patient-user.js.map +0 -1
  255. package/test/icc-x-api/storage/storage.d.ts +0 -1
  256. package/test/icc-x-api/storage/storage.js +0 -48
  257. package/test/icc-x-api/storage/storage.js.map +0 -1
  258. package/test/icc-x-api/test-api-no-parent.d.ts +0 -1
  259. package/test/icc-x-api/test-api-no-parent.js +0 -79
  260. package/test/icc-x-api/test-api-no-parent.js.map +0 -1
  261. package/test/icc-x-api/test-legacy-data-support.d.ts +0 -1
  262. package/test/icc-x-api/test-legacy-data-support.js +0 -375
  263. package/test/icc-x-api/test-legacy-data-support.js.map +0 -1
  264. package/test/icc-x-api/utils/graph-test.d.ts +0 -1
  265. package/test/icc-x-api/utils/graph-test.js +0 -54
  266. package/test/icc-x-api/utils/graph-test.js.map +0 -1
  267. package/test/icc-x-api/utils/lru-temporised-async-cache-test.d.ts +0 -1
  268. package/test/icc-x-api/utils/lru-temporised-async-cache-test.js +0 -364
  269. package/test/icc-x-api/utils/lru-temporised-async-cache-test.js.map +0 -1
  270. package/test/support/CSM-185.d.ts +0 -1
  271. package/test/support/CSM-185.js +0 -124
  272. package/test/support/CSM-185.js.map +0 -1
  273. package/test/support/CSM-243.d.ts +0 -1
  274. package/test/support/CSM-243.js +0 -120
  275. package/test/support/CSM-243.js.map +0 -1
  276. package/test/support/CSM-543.d.ts +0 -1
  277. package/test/support/CSM-543.js +0 -164
  278. package/test/support/CSM-543.js.map +0 -1
  279. package/test/support/CSM-729.d.ts +0 -1
  280. package/test/support/CSM-729.js +0 -225
  281. package/test/support/CSM-729.js.map +0 -1
  282. package/test/support/CSM-87.d.ts +0 -0
  283. package/test/support/CSM-87.js +0 -21
  284. package/test/support/CSM-87.js.map +0 -1
  285. package/test/support/CSM-93.d.ts +0 -1
  286. package/test/support/CSM-93.js +0 -112
  287. package/test/support/CSM-93.js.map +0 -1
  288. package/test/utils/FakeDataOwnerApi.d.ts +0 -32
  289. package/test/utils/FakeDataOwnerApi.js +0 -136
  290. package/test/utils/FakeDataOwnerApi.js.map +0 -1
  291. package/test/utils/FakeEncryptionKeysManager.d.ts +0 -36
  292. package/test/utils/FakeEncryptionKeysManager.js +0 -98
  293. package/test/utils/FakeEncryptionKeysManager.js.map +0 -1
  294. package/test/utils/FakeExchangeDataApi.d.ts +0 -32
  295. package/test/utils/FakeExchangeDataApi.js +0 -92
  296. package/test/utils/FakeExchangeDataApi.js.map +0 -1
  297. package/test/utils/FakeExchangeDataManager.d.ts +0 -48
  298. package/test/utils/FakeExchangeDataManager.js +0 -82
  299. package/test/utils/FakeExchangeDataManager.js.map +0 -1
  300. package/test/utils/FakeExchangeDataMapManager.d.ts +0 -12
  301. package/test/utils/FakeExchangeDataMapManager.js +0 -38
  302. package/test/utils/FakeExchangeDataMapManager.js.map +0 -1
  303. package/test/utils/FakeGenericApi.d.ts +0 -16
  304. package/test/utils/FakeGenericApi.js +0 -65
  305. package/test/utils/FakeGenericApi.js.map +0 -1
  306. package/test/utils/KeylessCryptoStrategies.d.ts +0 -23
  307. package/test/utils/KeylessCryptoStrategies.js +0 -26
  308. package/test/utils/KeylessCryptoStrategies.js.map +0 -1
  309. package/test/utils/TestApi.d.ts +0 -3
  310. package/test/utils/TestApi.js +0 -30
  311. package/test/utils/TestApi.js.map +0 -1
  312. package/test/utils/TestCollectionUtils.d.ts +0 -1
  313. package/test/utils/TestCollectionUtils.js +0 -109
  314. package/test/utils/TestCollectionUtils.js.map +0 -1
  315. package/test/utils/TestCryptoStrategies.d.ts +0 -42
  316. package/test/utils/TestCryptoStrategies.js +0 -80
  317. package/test/utils/TestCryptoStrategies.js.map +0 -1
  318. package/test/utils/TestStorage.d.ts +0 -23
  319. package/test/utils/TestStorage.js +0 -61
  320. package/test/utils/TestStorage.js.map +0 -1
  321. package/test/utils/roles.d.ts +0 -14
  322. package/test/utils/roles.js +0 -345
  323. package/test/utils/roles.js.map +0 -1
  324. package/test/utils/test_utils.d.ts +0 -87
  325. package/test/utils/test_utils.js +0 -452
  326. package/test/utils/test_utils.js.map +0 -1
@@ -1,106 +0,0 @@
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
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- require("isomorphic-fetch");
13
- const test_utils_1 = require("../utils/test_utils");
14
- const mocha_1 = require("mocha");
15
- const icc_x_api_1 = require("../../icc-x-api");
16
- const icc_api_1 = require("../../icc-api");
17
- const types_1 = require("@icure/test-setup/types");
18
- const chai_1 = require("chai");
19
- var initApi = test_utils_1.TestUtils.initApi;
20
- const Patient_1 = require("../../icc-api/model/Patient");
21
- const crypto_1 = require("crypto");
22
- const AccessLog_1 = require("../../icc-api/model/AccessLog");
23
- const chai_2 = require("chai");
24
- const icc_x_api_2 = require("../../icc-x-api");
25
- (0, test_utils_1.setLocalStorage)(fetch);
26
- let env;
27
- describe('icc-x-accesslog-api Tests', () => {
28
- (0, mocha_1.before)(function () {
29
- return __awaiter(this, void 0, void 0, function* () {
30
- this.timeout(600000);
31
- const initializer = yield (0, test_utils_1.getEnvironmentInitializer)();
32
- env = yield initializer.execute((0, types_1.getEnvVariables)());
33
- });
34
- });
35
- function createPatient(patientApiForHcp, hcpUser) {
36
- return __awaiter(this, void 0, void 0, function* () {
37
- return patientApiForHcp.createPatientWithUser(hcpUser, yield patientApiForHcp.newInstance(hcpUser, new Patient_1.Patient({
38
- id: (0, crypto_1.randomUUID)(),
39
- firstName: 'John',
40
- lastName: 'Snow',
41
- note: 'Winter is coming',
42
- })));
43
- });
44
- }
45
- it('Test', () => __awaiter(void 0, void 0, void 0, function* () {
46
- // Given
47
- const username = env.dataOwnerDetails[test_utils_1.hcp1Username].user;
48
- const password = env.dataOwnerDetails[test_utils_1.hcp1Username].password;
49
- const authProvider = new icc_x_api_2.BasicAuthenticationProvider(username, password);
50
- const userApi = new icc_x_api_1.IccUserXApi(env.iCureUrl, {}, authProvider, null, fetch);
51
- const accessLogApi = new icc_api_1.IccAccesslogApi(env.iCureUrl, {}, authProvider, fetch);
52
- const currentUser = yield userApi.getCurrentUser();
53
- yield accessLogApi.findByUserAfterDate(currentUser.id);
54
- }));
55
- it('Test findBy', () => __awaiter(void 0, void 0, void 0, function* () {
56
- // Given
57
- const apis = yield initApi(env, test_utils_1.hcp1Username);
58
- const hcpUser = yield apis.userApi.getCurrentUser();
59
- const patient = (yield createPatient(apis.patientApi, hcpUser));
60
- const accessLog = new AccessLog_1.AccessLog({
61
- id: (0, crypto_1.randomUUID)(),
62
- _type: 'org.taktik.icure.entities.AccessLog',
63
- created: new Date().getTime(),
64
- modified: new Date().getTime(),
65
- date: +new Date(),
66
- responsible: hcpUser.healthcarePartyId,
67
- author: hcpUser.id,
68
- codes: [],
69
- tags: [],
70
- user: hcpUser.id,
71
- patient: patient.id,
72
- accessType: 'USER_ACCESS',
73
- });
74
- const accessLogToCreate = yield apis.accessLogApi.newInstance(hcpUser, patient, accessLog);
75
- const createdAccessLog = yield apis.accessLogApi.createAccessLogWithUser(hcpUser, accessLogToCreate);
76
- const foundItems = yield apis.accessLogApi.findBy(hcpUser.healthcarePartyId, patient, false);
77
- const foundItemsUsingPost = yield apis.accessLogApi.findBy(hcpUser.healthcarePartyId, patient, true);
78
- (0, chai_2.assert)(foundItems.length == 1, 'Found items should be 1');
79
- (0, chai_2.assert)(foundItems[0].id == createdAccessLog.id, 'Found item should be the same as the created one');
80
- (0, chai_2.assert)(foundItemsUsingPost.length == 1, 'Found items using post should be 1');
81
- (0, chai_2.assert)(foundItemsUsingPost[0].id == createdAccessLog.id, 'Found item using post should be the same as the created one');
82
- }));
83
- it('Share with should work as expected', () => __awaiter(void 0, void 0, void 0, function* () {
84
- const api1 = yield initApi(env, test_utils_1.hcp1Username);
85
- const user1 = yield api1.userApi.getCurrentUser();
86
- const api2 = yield initApi(env, test_utils_1.hcp2Username);
87
- const user2 = yield api2.userApi.getCurrentUser();
88
- const samplePatient = yield api1.patientApi.createPatientWithUser(user1, yield api1.patientApi.newInstance(user1, { firstName: 'Gigio', lastName: 'Bagigio' }));
89
- const encryptedField = 'Something encrypted';
90
- const entity = yield api1.accessLogApi.createAccessLogWithUser(user1, yield api1.accessLogApi.newInstance(user1, samplePatient, { detail: encryptedField }));
91
- (0, chai_1.expect)(entity.detail).to.be.equal(encryptedField);
92
- yield api2.accessLogApi
93
- .getAccessLogWithUser(user2, entity.id)
94
- .then(() => {
95
- throw new Error('Should not be able to get the entity');
96
- })
97
- .catch(() => {
98
- /* expected */
99
- });
100
- yield api1.accessLogApi.shareWith(user2.healthcarePartyId, entity);
101
- const retrieved = yield api2.accessLogApi.getAccessLogWithUser(user2, entity.id);
102
- (0, chai_1.expect)(retrieved.detail).to.be.equal(encryptedField);
103
- (0, chai_1.expect)((yield api2.accessLogApi.decryptPatientIdOf(retrieved))[0]).to.equal(samplePatient.id);
104
- }));
105
- });
106
- //# sourceMappingURL=icc-accesslog-x-api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"icc-accesslog-x-api.js","sourceRoot":"","sources":["../../../test/icc-x-api/icc-accesslog-x-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EAAE,CAAC,CAAA;IAC/F,CAAC,CAAA,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import 'isomorphic-fetch'\nimport { getEnvironmentInitializer, hcp1Username, hcp2Username, setLocalStorage, TestUtils } from '../utils/test_utils'\nimport { before } from 'mocha'\nimport { IccPatientXApi, IccUserXApi } from '../../icc-x-api'\nimport { IccAccesslogApi } from '../../icc-api'\nimport { getEnvVariables, TestVars } from '@icure/test-setup/types'\nimport { expect } from 'chai'\nimport initApi = TestUtils.initApi\nimport { Patient } from '../../icc-api/model/Patient'\nimport { User } from '../../icc-api/model/User'\nimport { randomUUID } from 'crypto'\nimport { AccessLog } from '../../icc-api/model/AccessLog'\nimport { assert } from 'chai'\nimport { BasicAuthenticationProvider } from '../../icc-x-api'\n\nsetLocalStorage(fetch)\nlet env: TestVars\n\ndescribe('icc-x-accesslog-api Tests', () => {\n before(async function () {\n this.timeout(600000)\n const initializer = await getEnvironmentInitializer()\n env = await initializer.execute(getEnvVariables())\n })\n\n async function createPatient(patientApiForHcp: IccPatientXApi, hcpUser: User) {\n return patientApiForHcp.createPatientWithUser(\n hcpUser,\n await patientApiForHcp.newInstance(\n hcpUser,\n new Patient({\n id: randomUUID(),\n firstName: 'John',\n lastName: 'Snow',\n note: 'Winter is coming',\n })\n )\n )\n }\n\n it('Test', async () => {\n // Given\n const username = env.dataOwnerDetails[hcp1Username].user\n const password = env.dataOwnerDetails[hcp1Username].password\n\n const authProvider = new BasicAuthenticationProvider(username, password)\n\n const userApi = new IccUserXApi(env.iCureUrl, {}, authProvider, null as any, fetch)\n const accessLogApi = new IccAccesslogApi(env.iCureUrl, {}, authProvider, fetch)\n\n const currentUser = await userApi.getCurrentUser()\n\n await accessLogApi.findByUserAfterDate(currentUser.id!)\n })\n\n it('Test findBy', async () => {\n // Given\n const apis = await initApi(env, hcp1Username)\n const hcpUser = await apis.userApi.getCurrentUser()\n\n const patient = (await createPatient(apis.patientApi, hcpUser)) as Patient\n\n const accessLog = new AccessLog({\n id: randomUUID(),\n _type: 'org.taktik.icure.entities.AccessLog',\n created: new Date().getTime(),\n modified: new Date().getTime(),\n date: +new Date(),\n responsible: hcpUser.healthcarePartyId!,\n author: hcpUser.id,\n codes: [],\n tags: [],\n user: hcpUser.id,\n patient: patient.id,\n accessType: 'USER_ACCESS',\n })\n\n const accessLogToCreate = await apis.accessLogApi.newInstance(hcpUser, patient, accessLog)\n const createdAccessLog = await apis.accessLogApi.createAccessLogWithUser(hcpUser, accessLogToCreate)\n\n const foundItems: AccessLog[] = await apis.accessLogApi.findBy(hcpUser.healthcarePartyId!, patient, false)\n const foundItemsUsingPost: AccessLog[] = await apis.accessLogApi.findBy(hcpUser.healthcarePartyId!, patient, true)\n\n assert(foundItems.length == 1, 'Found items should be 1')\n assert(foundItems[0].id == createdAccessLog.id, 'Found item should be the same as the created one')\n\n assert(foundItemsUsingPost.length == 1, 'Found items using post should be 1')\n assert(foundItemsUsingPost[0].id == createdAccessLog.id, 'Found item using post should be the same as the created one')\n })\n\n it('Share with should work as expected', async () => {\n const api1 = await initApi(env!, hcp1Username)\n const user1 = await api1.userApi.getCurrentUser()\n const api2 = await initApi(env!, hcp2Username)\n const user2 = await api2.userApi.getCurrentUser()\n const samplePatient = await api1.patientApi.createPatientWithUser(\n user1,\n await api1.patientApi.newInstance(user1, { firstName: 'Gigio', lastName: 'Bagigio' })\n )\n const encryptedField = 'Something encrypted'\n const entity = await api1.accessLogApi.createAccessLogWithUser(\n user1,\n await api1.accessLogApi.newInstance(user1, samplePatient, { detail: encryptedField })\n )\n expect(entity.detail).to.be.equal(encryptedField)\n await api2.accessLogApi\n .getAccessLogWithUser(user2, entity.id)\n .then(() => {\n throw new Error('Should not be able to get the entity')\n })\n .catch(() => {\n /* expected */\n })\n await api1.accessLogApi.shareWith(user2.healthcarePartyId!, entity)\n const retrieved = await api2.accessLogApi.getAccessLogWithUser(user2, entity.id)\n expect(retrieved.detail).to.be.equal(encryptedField)\n expect((await api2.accessLogApi.decryptPatientIdOf(retrieved))[0]).to.equal(samplePatient.id)\n })\n})\n"]}
@@ -1 +0,0 @@
1
- import 'isomorphic-fetch';
@@ -1,91 +0,0 @@
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
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- require("isomorphic-fetch");
13
- const test_utils_1 = require("../utils/test_utils");
14
- const mocha_1 = require("mocha");
15
- const crypto_1 = require("crypto");
16
- const chai_1 = require("chai");
17
- const types_1 = require("@icure/test-setup/types");
18
- var initApi = test_utils_1.TestUtils.initApi;
19
- const icc_api_1 = require("../../icc-api");
20
- const ApplicationSettings_1 = require("../../icc-api/model/ApplicationSettings");
21
- (0, test_utils_1.setLocalStorage)(fetch);
22
- let env;
23
- let unencryptedAppSettings;
24
- (0, test_utils_1.describeNoLite)('icc-application-settings-x-api Tests', () => {
25
- (0, mocha_1.before)(function () {
26
- return __awaiter(this, void 0, void 0, function* () {
27
- this.timeout(600000);
28
- const initializer = yield (0, test_utils_1.getEnvironmentInitializer)();
29
- env = yield initializer.execute((0, types_1.getEnvVariables)());
30
- });
31
- });
32
- (0, mocha_1.it)('Should still be able to create and get application settings that are not encrypted using the base api', () => __awaiter(void 0, void 0, void 0, function* () {
33
- const api1 = yield initApi(env, test_utils_1.hcp1Username);
34
- const appSettingsApi = new icc_api_1.IccApplicationsettingsApi(env.iCureUrl, {}, api1.authApi.authenticationProvider, fetch);
35
- unencryptedAppSettings = yield appSettingsApi.createApplicationSettings(new ApplicationSettings_1.ApplicationSettings({
36
- id: (0, crypto_1.randomUUID)(),
37
- settings: { demo: 'plaintext' },
38
- }));
39
- (0, chai_1.expect)((yield appSettingsApi.getApplicationSettings()).map((x) => x.id)).to.have.members([unencryptedAppSettings.id]);
40
- (0, chai_1.expect)((yield api1.applicationSettingsApi.getApplicationSettingsWithUser(undefined)).map((x) => x.id)).to.have.members([
41
- unencryptedAppSettings.id,
42
- ]);
43
- })).timeout(10000);
44
- (0, mocha_1.it)('Should be able to create encrypted application settings', () => __awaiter(void 0, void 0, void 0, function* () {
45
- var _a, _b, _c;
46
- const api2 = yield initApi(env, test_utils_1.hcp2Username);
47
- const user = yield api2.userApi.getCurrentUser();
48
- const appSettingsApi = new icc_api_1.IccApplicationsettingsApi(env.iCureUrl, {}, api2.authApi.authenticationProvider, fetch);
49
- const createdWithEncryption = yield api2.applicationSettingsApi.createApplicationSettingsWithUser(undefined, yield api2.applicationSettingsApi.newInstance(user, {
50
- id: (0, crypto_1.randomUUID)(),
51
- settings: { demo: 'plaintext' },
52
- encryptedSettings: { demo: 'willsucceed' },
53
- }));
54
- const retrievedWithoutDecryption = yield appSettingsApi.getApplicationSettings();
55
- (0, chai_1.expect)(retrievedWithoutDecryption.map((x) => x.id)).to.have.members([unencryptedAppSettings.id, createdWithEncryption.id]);
56
- retrievedWithoutDecryption.forEach((x) => { var _a; return (0, chai_1.expect)((_a = x.encryptedSettings) !== null && _a !== void 0 ? _a : {}).to.deep.eq({}); });
57
- (0, chai_1.expect)((_a = retrievedWithoutDecryption.find((x) => x.id == createdWithEncryption.id)) === null || _a === void 0 ? void 0 : _a.settings).to.deep.eq({ demo: 'plaintext' });
58
- const retrievedWithDecryption = yield api2.applicationSettingsApi.getApplicationSettingsWithUser(undefined);
59
- (0, chai_1.expect)(retrievedWithDecryption.map((x) => x.id)).to.have.members([unencryptedAppSettings.id, createdWithEncryption.id]);
60
- (0, chai_1.expect)((_b = retrievedWithDecryption.find((x) => x.id == createdWithEncryption.id)) === null || _b === void 0 ? void 0 : _b.settings).to.deep.eq({ demo: 'plaintext' });
61
- (0, chai_1.expect)((_c = retrievedWithDecryption.find((x) => x.id == createdWithEncryption.id)) === null || _c === void 0 ? void 0 : _c.encryptedSettings).to.deep.eq({ demo: 'willsucceed' });
62
- })).timeout(10000);
63
- (0, mocha_1.it)('Should be able to make existing application settings encrypted', () => __awaiter(void 0, void 0, void 0, function* () {
64
- var _a, _b, _c;
65
- const api1 = yield initApi(env, test_utils_1.hcp1Username);
66
- const user = yield api1.userApi.getCurrentUser();
67
- const appSettingsApi = new icc_api_1.IccApplicationsettingsApi(env.iCureUrl, {}, api1.authApi.authenticationProvider, fetch);
68
- const newToEncryptAfter = yield appSettingsApi.createApplicationSettings(new ApplicationSettings_1.ApplicationSettings({
69
- id: (0, crypto_1.randomUUID)(),
70
- settings: { demo: 'plaintext' },
71
- }));
72
- // Should not be allowed to set encryptedSettings on application settings where encryption key is not initialized through with user method
73
- yield api1.applicationSettingsApi
74
- .updateApplicationSettingsWithUser(user, new ApplicationSettings_1.ApplicationSettings(Object.assign(Object.assign({}, newToEncryptAfter), { encryptedSettings: { demo: 'willfail' } })))
75
- .then((x) => {
76
- throw new Error('Should not succeed');
77
- }, (x) => {
78
- (0, chai_1.expect)(x.toString()).to.contain('Application settings does not have initialized encryption metadata; initialize or use non-encrypted api');
79
- });
80
- yield api1.applicationSettingsApi.updateApplicationSettingsWithUser(undefined, yield api1.applicationSettingsApi.newInstance(user, Object.assign(Object.assign({}, newToEncryptAfter), { encryptedSettings: { demo: 'willsucceed' } })));
81
- const retrievedWithoutDecryption = yield appSettingsApi.getApplicationSettings();
82
- (0, chai_1.expect)(retrievedWithoutDecryption.map((x) => x.id)).to.have.members([unencryptedAppSettings.id, newToEncryptAfter.id]);
83
- retrievedWithoutDecryption.forEach((x) => { var _a; return (0, chai_1.expect)((_a = x.encryptedSettings) !== null && _a !== void 0 ? _a : {}).to.deep.eq({}); });
84
- (0, chai_1.expect)((_a = retrievedWithoutDecryption.find((x) => x.id == newToEncryptAfter.id)) === null || _a === void 0 ? void 0 : _a.settings).to.deep.eq({ demo: 'plaintext' });
85
- const retrievedWithDecryption = yield api1.applicationSettingsApi.getApplicationSettingsWithUser(undefined);
86
- (0, chai_1.expect)(retrievedWithDecryption.map((x) => x.id)).to.have.members([unencryptedAppSettings.id, newToEncryptAfter.id]);
87
- (0, chai_1.expect)((_b = retrievedWithDecryption.find((x) => x.id == newToEncryptAfter.id)) === null || _b === void 0 ? void 0 : _b.settings).to.deep.eq({ demo: 'plaintext' });
88
- (0, chai_1.expect)((_c = retrievedWithDecryption.find((x) => x.id == newToEncryptAfter.id)) === null || _c === void 0 ? void 0 : _c.encryptedSettings).to.deep.eq({ demo: 'willsucceed' });
89
- })).timeout(10000);
90
- });
91
- //# sourceMappingURL=icc-application-settings-x-api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"icc-application-settings-x-api.js","sourceRoot":"","sources":["../../../test/icc-x-api/icc-application-settings-x-api.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,4BAAyB;AACzB,oDAAuI;AACvI,iCAA4C;AAI5C,mCAAmC;AACnC,+BAA6B;AAC7B,mDAAmE;AAInE,IAAO,OAAO,GAAG,sBAAS,CAAC,OAAO,CAAA;AAQlC,2CAAsE;AACtE,iFAA6E;AAE7E,IAAA,4BAAe,EAAC,KAAK,CAAC,CAAA;AACtB,IAAI,GAAa,CAAA;AACjB,IAAI,sBAA2C,CAAA;AAE/C,IAAA,2BAAc,EAAC,sCAAsC,EAAE,GAAG,EAAE;IAC1D,IAAA,cAAM,EAAC;;YACL,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;YACpB,MAAM,WAAW,GAAG,MAAM,IAAA,sCAAyB,GAAE,CAAA;YACrD,GAAG,GAAG,MAAM,WAAW,CAAC,OAAO,CAAC,IAAA,uBAAe,GAAE,CAAC,CAAA;QACpD,CAAC;KAAA,CAAC,CAAA;IAEF,IAAA,UAAE,EAAC,uGAAuG,EAAE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C,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,iBAAiB,CAAC,EAAE,CAAC,0CAAE,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAA;QACxH,MAAM,uBAAuB,GAAG,MAAM,IAAI,CAAC,sBAAsB,CAAC,8BAA8B,CAAC,SAAS,CAAC,CAAA;QAC3G,IAAA,aAAM,EAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,sBAAsB,CAAC,EAAE,EAAE,iBAAiB,CAAC,EAAE,CAAC,CAAC,CAAA;QACnH,IAAA,aAAM,EAAC,MAAA,uBAAuB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,iBAAiB,CAAC,EAAE,CAAC,0CAAE,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAA;QACrH,IAAA,aAAM,EAAC,MAAA,uBAAuB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,iBAAiB,CAAC,EAAE,CAAC,0CAAE,iBAAiB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,CAAA;IAClI,CAAC,CAAA,CAAC,CAAC,OAAO,CAAC,KAAM,CAAC,CAAA;AACpB,CAAC,CAAC,CAAA","sourcesContent":["import 'isomorphic-fetch'\nimport { describeNoLite, getEnvironmentInitializer, hcp1Username, hcp2Username, setLocalStorage, TestUtils } from '../utils/test_utils'\nimport { before, it, describe } from 'mocha'\nimport { IccPatientXApi, sleep, SubscriptionOptions } from '../../icc-x-api'\nimport { Patient } from '../../icc-api/model/Patient'\nimport { User } from '../../icc-api/model/User'\nimport { randomUUID } from 'crypto'\nimport { expect } from 'chai'\nimport { getEnvVariables, TestVars } from '@icure/test-setup/types'\nimport { IccTopicXApi } from '../../icc-x-api/icc-topic-x-api'\nimport { Topic, TopicRole } from '../../icc-api/model/Topic'\nimport { SecureDelegation } from '../../icc-api/model/SecureDelegation'\nimport initApi = TestUtils.initApi\nimport { XHR } from '../../icc-api/api/XHR'\nimport XHRError = XHR.XHRError\nimport { FilterChainTopic } from '../../icc-api/model/FilterChainTopic'\nimport { TopicByHcPartyFilter } from '../../icc-x-api/filters/TopicByHcPartyFilter'\nimport { TopicByParticipantFilter } from '../../icc-x-api/filters/TopicByParticipantFilter'\nimport { Connection } from '../../icc-api/model/Connection'\nimport { Message } from '../../icc-api/model/Message'\nimport { IccApplicationsettingsApi, IccTopicApi } from '../../icc-api'\nimport { ApplicationSettings } from '../../icc-api/model/ApplicationSettings'\n\nsetLocalStorage(fetch)\nlet env: TestVars\nlet unencryptedAppSettings: ApplicationSettings\n\ndescribeNoLite('icc-application-settings-x-api Tests', () => {\n before(async function () {\n this.timeout(600000)\n const initializer = await getEnvironmentInitializer()\n env = await initializer.execute(getEnvVariables())\n })\n\n it('Should still be able to create and get application settings that are not encrypted using the base api', async () => {\n const api1 = await initApi(env, hcp1Username)\n const appSettingsApi = new IccApplicationsettingsApi(env.iCureUrl, {}, api1.authApi.authenticationProvider, fetch)\n unencryptedAppSettings = await appSettingsApi.createApplicationSettings(\n new ApplicationSettings({\n id: randomUUID(),\n settings: { demo: 'plaintext' },\n })\n )\n expect((await appSettingsApi.getApplicationSettings()).map((x) => x.id)).to.have.members([unencryptedAppSettings.id])\n expect((await api1.applicationSettingsApi.getApplicationSettingsWithUser(undefined)).map((x) => x.id)).to.have.members([\n unencryptedAppSettings.id,\n ])\n }).timeout(10_000)\n\n it('Should be able to create encrypted application settings', async () => {\n const api2 = await initApi(env, hcp2Username)\n const user = await api2.userApi.getCurrentUser()\n const appSettingsApi = new IccApplicationsettingsApi(env.iCureUrl, {}, api2.authApi.authenticationProvider, fetch)\n const createdWithEncryption = await api2.applicationSettingsApi.createApplicationSettingsWithUser(\n undefined,\n await api2.applicationSettingsApi.newInstance(user, {\n id: randomUUID(),\n settings: { demo: 'plaintext' },\n encryptedSettings: { demo: 'willsucceed' },\n })\n )\n const retrievedWithoutDecryption = await appSettingsApi.getApplicationSettings()\n expect(retrievedWithoutDecryption.map((x) => x.id)).to.have.members([unencryptedAppSettings.id, createdWithEncryption.id])\n retrievedWithoutDecryption.forEach((x) => expect(x.encryptedSettings ?? {}).to.deep.eq({}))\n expect(retrievedWithoutDecryption.find((x) => x.id == createdWithEncryption.id)?.settings).to.deep.eq({ demo: 'plaintext' })\n const retrievedWithDecryption = await api2.applicationSettingsApi.getApplicationSettingsWithUser(undefined)\n expect(retrievedWithDecryption.map((x) => x.id)).to.have.members([unencryptedAppSettings.id, createdWithEncryption.id])\n expect(retrievedWithDecryption.find((x) => x.id == createdWithEncryption.id)?.settings).to.deep.eq({ demo: 'plaintext' })\n expect(retrievedWithDecryption.find((x) => x.id == createdWithEncryption.id)?.encryptedSettings).to.deep.eq({ demo: 'willsucceed' })\n }).timeout(10_000)\n\n it('Should be able to make existing application settings encrypted', async () => {\n const api1 = await initApi(env, hcp1Username)\n const user = await api1.userApi.getCurrentUser()\n\n const appSettingsApi = new IccApplicationsettingsApi(env.iCureUrl, {}, api1.authApi.authenticationProvider, fetch)\n const newToEncryptAfter = await appSettingsApi.createApplicationSettings(\n new ApplicationSettings({\n id: randomUUID(),\n settings: { demo: 'plaintext' },\n })\n )\n // Should not be allowed to set encryptedSettings on application settings where encryption key is not initialized through with user method\n await api1.applicationSettingsApi\n .updateApplicationSettingsWithUser(\n user,\n new ApplicationSettings({\n ...newToEncryptAfter,\n encryptedSettings: { demo: 'willfail' },\n })\n )\n .then(\n (x) => {\n throw new Error('Should not succeed')\n },\n (x) => {\n expect(x.toString()).to.contain('Application settings does not have initialized encryption metadata; initialize or use non-encrypted api')\n }\n )\n await api1.applicationSettingsApi.updateApplicationSettingsWithUser(\n undefined,\n await api1.applicationSettingsApi.newInstance(user, {\n ...newToEncryptAfter,\n encryptedSettings: { demo: 'willsucceed' },\n })\n )\n const retrievedWithoutDecryption = await appSettingsApi.getApplicationSettings()\n expect(retrievedWithoutDecryption.map((x) => x.id)).to.have.members([unencryptedAppSettings.id, newToEncryptAfter.id])\n retrievedWithoutDecryption.forEach((x) => expect(x.encryptedSettings ?? {}).to.deep.eq({}))\n expect(retrievedWithoutDecryption.find((x) => x.id == newToEncryptAfter.id)?.settings).to.deep.eq({ demo: 'plaintext' })\n const retrievedWithDecryption = await api1.applicationSettingsApi.getApplicationSettingsWithUser(undefined)\n expect(retrievedWithDecryption.map((x) => x.id)).to.have.members([unencryptedAppSettings.id, newToEncryptAfter.id])\n expect(retrievedWithDecryption.find((x) => x.id == newToEncryptAfter.id)?.settings).to.deep.eq({ demo: 'plaintext' })\n expect(retrievedWithDecryption.find((x) => x.id == newToEncryptAfter.id)?.encryptedSettings).to.deep.eq({ demo: 'willsucceed' })\n }).timeout(10_000)\n})\n"]}
@@ -1 +0,0 @@
1
- import 'isomorphic-fetch';
@@ -1,47 +0,0 @@
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
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- require("isomorphic-fetch");
13
- const test_utils_1 = require("../utils/test_utils");
14
- const mocha_1 = require("mocha");
15
- const AuthenticationProvider_1 = require("../../icc-x-api/auth/AuthenticationProvider");
16
- const icc_api_1 = require("../../icc-api");
17
- const node_compat_1 = require("../../node-compat");
18
- const TestApi_1 = require("../utils/TestApi");
19
- const types_1 = require("@icure/test-setup/types");
20
- const icc_x_api_1 = require("../../icc-x-api");
21
- (0, test_utils_1.setLocalStorage)(fetch);
22
- let env;
23
- describe('icc-auth-api Tests', () => {
24
- (0, mocha_1.before)(function () {
25
- return __awaiter(this, void 0, void 0, function* () {
26
- this.timeout(600000);
27
- const initializer = yield (0, test_utils_1.getEnvironmentInitializer)();
28
- env = yield initializer.execute((0, types_1.getEnvVariables)());
29
- });
30
- });
31
- it('Can login and then logout instating all the Apis', () => __awaiter(void 0, void 0, void 0, function* () {
32
- // Given
33
- const username = env.dataOwnerDetails[test_utils_1.hcp1Username].user;
34
- const password = env.dataOwnerDetails[test_utils_1.hcp1Username].password;
35
- const { authApi } = yield (0, TestApi_1.TestApi)(env.iCureUrl, username, password, node_compat_1.crypto);
36
- yield authApi.logout();
37
- }));
38
- it('Can login and then logout instating only the AuthApi', () => __awaiter(void 0, void 0, void 0, function* () {
39
- // Given
40
- const username = env.dataOwnerDetails[test_utils_1.hcp1Username].user;
41
- const password = env.dataOwnerDetails[test_utils_1.hcp1Username].password;
42
- const authenticationProvider = new icc_x_api_1.EnsembleAuthenticationProvider(new icc_api_1.IccAuthApi(env.iCureUrl, {}, new AuthenticationProvider_1.NoAuthenticationProvider(), fetch), username, password);
43
- const authApi = new icc_api_1.IccAuthApi(env.iCureUrl, {}, authenticationProvider, fetch);
44
- yield authApi.logout();
45
- }));
46
- });
47
- //# sourceMappingURL=icc-auth-api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"icc-auth-api.js","sourceRoot":"","sources":["../../../test/icc-x-api/icc-auth-api.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,4BAAyB;AACzB,oDAA8F;AAC9F,iCAA8B;AAC9B,wFAAsF;AACtF,2CAA0C;AAC1C,mD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T,CAAA;QAED,MAAM,OAAO,GAAG,IAAI,oBAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,EAAE,sBAAsB,EAAE,KAAK,CAAC,CAAA;QAE/E,MAAM,OAAO,CAAC,MAAM,EAAE,CAAA;IACxB,CAAC,CAAA,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import 'isomorphic-fetch'\nimport { getEnvironmentInitializer, hcp1Username, setLocalStorage } from '../utils/test_utils'\nimport { before } from 'mocha'\nimport { NoAuthenticationProvider } from '../../icc-x-api/auth/AuthenticationProvider'\nimport { IccAuthApi } from '../../icc-api'\nimport { crypto } from '../../node-compat'\nimport { TestApi } from '../utils/TestApi'\nimport { getEnvVariables, TestVars } from '@icure/test-setup/types'\nimport { EnsembleAuthenticationProvider } from '../../icc-x-api'\n\nsetLocalStorage(fetch)\nlet env: TestVars\n\ndescribe('icc-auth-api Tests', () => {\n before(async function () {\n this.timeout(600000)\n const initializer = await getEnvironmentInitializer()\n env = await initializer.execute(getEnvVariables())\n })\n\n it('Can login and then logout instating all the Apis', async () => {\n // Given\n const username = env.dataOwnerDetails[hcp1Username].user\n const password = env.dataOwnerDetails[hcp1Username].password\n\n const { authApi } = await TestApi(env!.iCureUrl, username, password, crypto)\n\n await authApi.logout()\n })\n\n it('Can login and then logout instating only the AuthApi', async () => {\n // Given\n const username = env.dataOwnerDetails[hcp1Username].user\n const password = env.dataOwnerDetails[hcp1Username].password\n\n const authenticationProvider = new EnsembleAuthenticationProvider(\n new IccAuthApi(env.iCureUrl, {}, new NoAuthenticationProvider(), fetch),\n username,\n password\n )\n\n const authApi = new IccAuthApi(env.iCureUrl, {}, authenticationProvider, fetch)\n\n await authApi.logout()\n })\n})\n"]}
@@ -1 +0,0 @@
1
- import 'isomorphic-fetch';
@@ -1,150 +0,0 @@
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
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- require("isomorphic-fetch");
13
- const test_utils_1 = require("../utils/test_utils");
14
- const mocha_1 = require("mocha");
15
- const icc_x_api_1 = require("../../icc-x-api");
16
- const icc_api_1 = require("../../icc-api");
17
- const Patient_1 = require("../../icc-api/model/Patient");
18
- const crypto_1 = require("crypto");
19
- const chai_1 = require("chai");
20
- var initApi = test_utils_1.TestUtils.initApi;
21
- const types_1 = require("@icure/test-setup/types");
22
- const SecureDelegation_1 = require("../../icc-api/model/SecureDelegation");
23
- var AccessLevelEnum = SecureDelegation_1.SecureDelegation.AccessLevelEnum;
24
- const AuthenticationProvider_1 = require("../../icc-x-api/auth/AuthenticationProvider");
25
- (0, test_utils_1.setLocalStorage)(fetch);
26
- let env;
27
- describe('icc-calendar-item-x-api Tests', () => {
28
- (0, mocha_1.before)(function () {
29
- return __awaiter(this, void 0, void 0, function* () {
30
- this.timeout(600000);
31
- const initializer = yield (0, test_utils_1.getEnvironmentInitializer)();
32
- env = yield initializer.execute((0, types_1.getEnvVariables)());
33
- });
34
- });
35
- function createPatient(patientApiForHcp, hcpUser) {
36
- return __awaiter(this, void 0, void 0, function* () {
37
- return patientApiForHcp.createPatientWithUser(hcpUser, yield patientApiForHcp.newInstance(hcpUser, new Patient_1.Patient({
38
- id: (0, crypto_1.randomUUID)(),
39
- firstName: 'John',
40
- lastName: 'Snow',
41
- note: 'Winter is coming',
42
- })));
43
- });
44
- }
45
- it('Test', () => __awaiter(void 0, void 0, void 0, function* () {
46
- // Given
47
- const username = env.dataOwnerDetails[test_utils_1.hcp1Username].user;
48
- const password = env.dataOwnerDetails[test_utils_1.hcp1Username].password;
49
- const authProvider = new AuthenticationProvider_1.BasicAuthenticationProvider(username, password);
50
- const userApi = new icc_x_api_1.IccUserXApi(env.iCureUrl, {}, authProvider, null, fetch);
51
- const calenderItemApi = new icc_api_1.IccCalendarItemApi(env.iCureUrl, {}, authProvider, fetch);
52
- const currentUser = yield userApi.getCurrentUser();
53
- }));
54
- it('Test findBy', () => __awaiter(void 0, void 0, void 0, function* () {
55
- // Given
56
- const { userApi: userApiForHcp, dataOwnerApi: dataOwnerApiForHcp, patientApi: patientApiForHcp, cryptoApi: cryptoApiForHcp, dataOwnerApi: dateOwnerApiForHcp, calendarItemApi: calendarItemXApi, } = yield initApi(env, test_utils_1.hcp1Username);
57
- const hcpUser = yield userApiForHcp.getCurrentUser();
58
- const patient = (yield createPatient(patientApiForHcp, hcpUser));
59
- const calendarItem = {
60
- id: (0, crypto_1.randomUUID)(),
61
- created: new Date().getTime(),
62
- modified: new Date().getTime(),
63
- startTime: 20230327131313,
64
- endTime: 20230327141313,
65
- responsible: hcpUser.healthcarePartyId,
66
- author: hcpUser.id,
67
- codes: [],
68
- tags: [],
69
- };
70
- const calendarItemToCreate = yield calendarItemXApi.newInstancePatient(hcpUser, patient, calendarItem);
71
- const createdCalendarItem = yield calendarItemXApi.createCalendarItemWithHcParty(hcpUser, calendarItemToCreate);
72
- const foundItems = yield calendarItemXApi.findBy(hcpUser.healthcarePartyId, patient, false);
73
- const foundItemsUsingPost = yield calendarItemXApi.findBy(hcpUser.healthcarePartyId, patient, true);
74
- (0, chai_1.assert)(foundItems.length == 1, 'Found items should be 1');
75
- (0, chai_1.assert)(foundItems[0].id == createdCalendarItem.id, 'Found item should be the same as created item');
76
- (0, chai_1.assert)(foundItemsUsingPost.length == 1, 'Found items using post should be 1');
77
- (0, chai_1.assert)(foundItemsUsingPost[0].id == createdCalendarItem.id, 'Found item using post should be the same as created item');
78
- }));
79
- it('Share with should work as expected', () => __awaiter(void 0, void 0, void 0, function* () {
80
- const api1 = yield initApi(env, test_utils_1.hcp1Username);
81
- const user1 = yield api1.userApi.getCurrentUser();
82
- const api2 = yield initApi(env, test_utils_1.hcp2Username);
83
- const user2 = yield api2.userApi.getCurrentUser();
84
- const samplePatient = yield api1.patientApi.createPatientWithUser(user1, yield api1.patientApi.newInstance(user1, { firstName: 'Gigio', lastName: 'Bagigio' }));
85
- const encryptedField = 'Something encrypted';
86
- const entity = yield api1.calendarItemApi.createCalendarItemWithHcParty(user1, yield api1.calendarItemApi.newInstancePatient(user1, samplePatient, { details: encryptedField }));
87
- (0, chai_1.expect)(entity.details).to.be.equal(encryptedField);
88
- yield api2.calendarItemApi
89
- .getCalendarItemWithUser(user2, entity.id)
90
- .then(() => {
91
- throw new Error('Should not be able to get the entity');
92
- })
93
- .catch(() => {
94
- /* expected */
95
- });
96
- yield api1.calendarItemApi.shareWith(user2.healthcarePartyId, entity);
97
- const retrieved = yield api2.calendarItemApi.getCalendarItemWithUser(user2, entity.id);
98
- (0, chai_1.expect)(retrieved.details).to.be.equal(encryptedField);
99
- (0, chai_1.expect)((yield api2.calendarItemApi.decryptPatientIdOf(retrieved))[0]).to.equal(samplePatient.id);
100
- }));
101
- it('Should be able to link a calendar item with an existing patient', () => __awaiter(void 0, void 0, void 0, function* () {
102
- var _a, _b;
103
- const api1 = yield initApi(env, test_utils_1.hcp1Username);
104
- const user1 = yield api1.userApi.getCurrentUser();
105
- const api2 = yield initApi(env, test_utils_1.hcp2Username);
106
- const user2 = yield api2.userApi.getCurrentUser();
107
- const api3 = yield initApi(env, test_utils_1.hcp3Username);
108
- const user3 = yield api3.userApi.getCurrentUser();
109
- const patient = yield api1.patientApi.createPatientWithUser(user1, yield api1.patientApi.newInstance(user1, {
110
- firstName: 'Gigio',
111
- lastName: 'Bagigio',
112
- }, { additionalDelegates: { [user2.healthcarePartyId]: 'WRITE' } }));
113
- const patientSecretIds = yield api2.patientApi.decryptNonConfidentialSecretIdsOf(patient);
114
- (0, chai_1.expect)(patientSecretIds).to.have.length(1);
115
- const itemTitle = 'An interesting title';
116
- const calendarItem = yield api2.calendarItemApi.createCalendarItemWithHcParty(user2, yield api2.calendarItemApi.newInstance(user2, { title: itemTitle }, { additionalDelegates: { [user1.healthcarePartyId]: 'WRITE' } }));
117
- (0, chai_1.expect)(calendarItem.title).to.equal(itemTitle);
118
- (0, chai_1.expect)((yield api1.calendarItemApi.getCalendarItemWithUser(user1, calendarItem.id)).title).to.equal(itemTitle);
119
- (0, chai_1.expect)(yield api1.calendarItemApi.decryptPatientIdOf(calendarItem)).to.have.length(0);
120
- (0, chai_1.expect)((_a = calendarItem.secretForeignKeys) !== null && _a !== void 0 ? _a : []).to.have.length(0);
121
- const linked = yield api1.calendarItemApi.linkWithPatient(calendarItem, patient, [user2.healthcarePartyId, user3.healthcarePartyId]);
122
- (0, chai_1.expect)(linked.title).to.equal(itemTitle);
123
- (0, chai_1.expect)((_b = linked.secretForeignKeys) !== null && _b !== void 0 ? _b : []).to.have.length(1);
124
- (0, chai_1.expect)(linked.secretForeignKeys[0]).to.equal(patientSecretIds[0]);
125
- const decryptedPatientIdBy1 = yield api1.calendarItemApi.decryptPatientIdOf(linked);
126
- (0, chai_1.expect)(decryptedPatientIdBy1).to.have.length(1);
127
- (0, chai_1.expect)(decryptedPatientIdBy1[0]).to.equal(patient.id);
128
- const retrievedBy2AfterLink = yield api2.calendarItemApi.getCalendarItemWithUser(user2, calendarItem.id);
129
- (0, chai_1.expect)(retrievedBy2AfterLink.title).to.equal(itemTitle);
130
- const decryptedPatientIdBy2 = yield api2.calendarItemApi.decryptPatientIdOf(retrievedBy2AfterLink);
131
- (0, chai_1.expect)(decryptedPatientIdBy2).to.have.length(1);
132
- (0, chai_1.expect)(decryptedPatientIdBy2[0]).to.equal(patient.id);
133
- const retrievedBy3AfterLink = yield api3.calendarItemApi.getCalendarItemWithUser(user3, calendarItem.id);
134
- (0, chai_1.expect)(retrievedBy3AfterLink.title).to.be.undefined; // not shared with user3
135
- const decryptedPatientIdBy3 = yield api3.calendarItemApi.decryptPatientIdOf(retrievedBy3AfterLink);
136
- (0, chai_1.expect)(decryptedPatientIdBy3).to.have.length(1);
137
- (0, chai_1.expect)(decryptedPatientIdBy3[0]).to.equal(patient.id);
138
- const sharedInfo = yield api1.calendarItemApi.getDataOwnersWithAccessTo(linked);
139
- (0, chai_1.expect)(sharedInfo.hasUnknownAnonymousDataOwners).to.be.false;
140
- (0, chai_1.expect)(Object.keys(sharedInfo.permissionsByDataOwnerId)).to.have.members([
141
- user1.healthcarePartyId,
142
- user2.healthcarePartyId,
143
- user3.healthcarePartyId,
144
- ]);
145
- (0, chai_1.expect)(sharedInfo.permissionsByDataOwnerId[user1.healthcarePartyId]).to.equal(AccessLevelEnum.WRITE);
146
- (0, chai_1.expect)(sharedInfo.permissionsByDataOwnerId[user2.healthcarePartyId]).to.equal(AccessLevelEnum.WRITE);
147
- (0, chai_1.expect)(sharedInfo.permissionsByDataOwnerId[user3.healthcarePartyId]).to.equal(AccessLevelEnum.READ);
148
- }));
149
- });
150
- //# sourceMappingURL=icc-calendar-item-x-api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"icc-calendar-item-x-api.js","sourceRoot":"","sources":["../../../test/icc-x-api/icc-calendar-item-x-api.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,4BAAyB;AACzB,oDAAqI;AACrI,iCAA8B;AAC9B,+CAA6D;AAC7D,2CAAkD;AAClD,yDAAqD;AAErD,mCAAmC;AAEnC,+BAAqC;AACrC,IAAO,OAAO,GAAG,sBAAS,CAAC,OAAO,CAAA;AAClC,mDAAmE;AACnE,2EAAuE;AACvE,IAAO,eAAe,GAAG,mCAAgB,CAAC,eAAe,CAAA;AACzD,wFAAyF;AAEzF,IAAA,4BAAe,EAAC,KAAK,CAAC,CAAA;AACtB,IAAI,GAAa,CAAA;AAEjB,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;IAC7C,IAAA,cAAM,EAAC;;YACL,IAAI,CAAC,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B,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,KAAK,CAAC,CAAA;QACrG,IAAA,aAAM,EAAC,UAAU,CAAC,wBAAwB,CAAC,KAAK,CAAC,iBAAkB,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,KAAK,CAAC,CAAA;QACrG,IAAA,aAAM,EAAC,UAAU,CAAC,wBAAwB,CAAC,KAAK,CAAC,iBAAkB,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,CAAA;IACtG,CAAC,CAAA,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import 'isomorphic-fetch'\nimport { getEnvironmentInitializer, hcp1Username, hcp2Username, hcp3Username, setLocalStorage, TestUtils } from '../utils/test_utils'\nimport { before } from 'mocha'\nimport { IccPatientXApi, IccUserXApi } from '../../icc-x-api'\nimport { IccCalendarItemApi } from '../../icc-api'\nimport { Patient } from '../../icc-api/model/Patient'\nimport { User } from '../../icc-api/model/User'\nimport { randomUUID } from 'crypto'\nimport { CalendarItem } from '../../icc-api/model/CalendarItem'\nimport { assert, expect } from 'chai'\nimport initApi = TestUtils.initApi\nimport { getEnvVariables, TestVars } from '@icure/test-setup/types'\nimport { SecureDelegation } from '../../icc-api/model/SecureDelegation'\nimport AccessLevelEnum = SecureDelegation.AccessLevelEnum\nimport { BasicAuthenticationProvider } from '../../icc-x-api/auth/AuthenticationProvider'\n\nsetLocalStorage(fetch)\nlet env: TestVars\n\ndescribe('icc-calendar-item-x-api Tests', () => {\n before(async function () {\n this.timeout(600000)\n const initializer = await getEnvironmentInitializer()\n env = await initializer.execute(getEnvVariables())\n })\n\n async function createPatient(patientApiForHcp: IccPatientXApi, hcpUser: User) {\n return patientApiForHcp.createPatientWithUser(\n hcpUser,\n await patientApiForHcp.newInstance(\n hcpUser,\n new Patient({\n id: randomUUID(),\n firstName: 'John',\n lastName: 'Snow',\n note: 'Winter is coming',\n })\n )\n )\n }\n\n it('Test', async () => {\n // Given\n const username = env.dataOwnerDetails[hcp1Username].user\n const password = env.dataOwnerDetails[hcp1Username].password\n\n const authProvider = new BasicAuthenticationProvider(username, password)\n\n const userApi = new IccUserXApi(env.iCureUrl, {}, authProvider, null as any, fetch)\n const calenderItemApi = new IccCalendarItemApi(env.iCureUrl, {}, authProvider, fetch)\n\n const currentUser = await userApi.getCurrentUser()\n })\n\n it('Test findBy', async () => {\n // Given\n const {\n userApi: userApiForHcp,\n dataOwnerApi: dataOwnerApiForHcp,\n patientApi: patientApiForHcp,\n cryptoApi: cryptoApiForHcp,\n dataOwnerApi: dateOwnerApiForHcp,\n calendarItemApi: calendarItemXApi,\n } = await initApi(env, hcp1Username)\n const hcpUser = await userApiForHcp.getCurrentUser()\n const patient = (await createPatient(patientApiForHcp, hcpUser)) as Patient\n\n const calendarItem: CalendarItem = {\n id: randomUUID(),\n created: new Date().getTime(),\n modified: new Date().getTime(),\n startTime: 20230327131313,\n endTime: 20230327141313,\n responsible: hcpUser.healthcarePartyId!,\n author: hcpUser.id,\n codes: [],\n tags: [],\n }\n const calendarItemToCreate: CalendarItem = await calendarItemXApi.newInstancePatient(hcpUser, patient, calendarItem)\n const createdCalendarItem = await calendarItemXApi.createCalendarItemWithHcParty(hcpUser, calendarItemToCreate)\n\n const foundItems = await calendarItemXApi.findBy(hcpUser.healthcarePartyId!, patient, false)\n const foundItemsUsingPost = await calendarItemXApi.findBy(hcpUser.healthcarePartyId!, patient, true)\n\n assert(foundItems.length == 1, 'Found items should be 1')\n assert(foundItems[0].id == createdCalendarItem.id, 'Found item should be the same as created item')\n\n assert(foundItemsUsingPost.length == 1, 'Found items using post should be 1')\n assert(foundItemsUsingPost[0].id == createdCalendarItem.id, 'Found item using post should be the same as created item')\n })\n\n it('Share with should work as expected', async () => {\n const api1 = await initApi(env!, hcp1Username)\n const user1 = await api1.userApi.getCurrentUser()\n const api2 = await initApi(env!, hcp2Username)\n const user2 = await api2.userApi.getCurrentUser()\n const samplePatient = await api1.patientApi.createPatientWithUser(\n user1,\n await api1.patientApi.newInstance(user1, { firstName: 'Gigio', lastName: 'Bagigio' })\n )\n const encryptedField = 'Something encrypted'\n const entity = await api1.calendarItemApi.createCalendarItemWithHcParty(\n user1,\n await api1.calendarItemApi.newInstancePatient(user1, samplePatient, { details: encryptedField })\n )\n expect(entity.details).to.be.equal(encryptedField)\n await api2.calendarItemApi\n .getCalendarItemWithUser(user2, entity.id)\n .then(() => {\n throw new Error('Should not be able to get the entity')\n })\n .catch(() => {\n /* expected */\n })\n await api1.calendarItemApi.shareWith(user2.healthcarePartyId!, entity)\n const retrieved = await api2.calendarItemApi.getCalendarItemWithUser(user2, entity.id)\n expect(retrieved.details).to.be.equal(encryptedField)\n expect((await api2.calendarItemApi.decryptPatientIdOf(retrieved))[0]).to.equal(samplePatient.id)\n })\n\n it('Should be able to link a calendar item with an existing patient', async () => {\n const api1 = await initApi(env!, hcp1Username)\n const user1 = await api1.userApi.getCurrentUser()\n const api2 = await initApi(env!, hcp2Username)\n const user2 = await api2.userApi.getCurrentUser()\n const api3 = await initApi(env!, hcp3Username)\n const user3 = await api3.userApi.getCurrentUser()\n const patient = await api1.patientApi.createPatientWithUser(\n user1,\n await api1.patientApi.newInstance(\n user1,\n {\n firstName: 'Gigio',\n lastName: 'Bagigio',\n },\n { additionalDelegates: { [user2.healthcarePartyId!]: 'WRITE' } }\n )\n )\n const patientSecretIds = await api2.patientApi.decryptNonConfidentialSecretIdsOf(patient)\n expect(patientSecretIds).to.have.length(1)\n const itemTitle = 'An interesting title'\n const calendarItem = await api2.calendarItemApi.createCalendarItemWithHcParty(\n user2,\n await api2.calendarItemApi.newInstance(user2, { title: itemTitle }, { additionalDelegates: { [user1.healthcarePartyId!]: 'WRITE' } })\n )\n expect(calendarItem.title).to.equal(itemTitle)\n expect((await api1.calendarItemApi.getCalendarItemWithUser(user1, calendarItem.id)).title).to.equal(itemTitle)\n expect(await api1.calendarItemApi.decryptPatientIdOf(calendarItem)).to.have.length(0)\n expect(calendarItem.secretForeignKeys ?? []).to.have.length(0)\n const linked = await api1.calendarItemApi.linkWithPatient(calendarItem, patient, [user2.healthcarePartyId!, user3.healthcarePartyId!])\n expect(linked.title).to.equal(itemTitle)\n expect(linked.secretForeignKeys ?? []).to.have.length(1)\n expect(linked.secretForeignKeys![0]).to.equal(patientSecretIds[0])\n const decryptedPatientIdBy1 = await api1.calendarItemApi.decryptPatientIdOf(linked)\n expect(decryptedPatientIdBy1).to.have.length(1)\n expect(decryptedPatientIdBy1[0]).to.equal(patient.id)\n const retrievedBy2AfterLink = await api2.calendarItemApi.getCalendarItemWithUser(user2, calendarItem.id)\n expect(retrievedBy2AfterLink.title).to.equal(itemTitle)\n const decryptedPatientIdBy2 = await api2.calendarItemApi.decryptPatientIdOf(retrievedBy2AfterLink)\n expect(decryptedPatientIdBy2).to.have.length(1)\n expect(decryptedPatientIdBy2[0]).to.equal(patient.id)\n const retrievedBy3AfterLink = await api3.calendarItemApi.getCalendarItemWithUser(user3, calendarItem.id)\n expect(retrievedBy3AfterLink.title).to.be.undefined // not shared with user3\n const decryptedPatientIdBy3 = await api3.calendarItemApi.decryptPatientIdOf(retrievedBy3AfterLink)\n expect(decryptedPatientIdBy3).to.have.length(1)\n expect(decryptedPatientIdBy3[0]).to.equal(patient.id)\n const sharedInfo = await api1.calendarItemApi.getDataOwnersWithAccessTo(linked)\n expect(sharedInfo.hasUnknownAnonymousDataOwners).to.be.false\n expect(Object.keys(sharedInfo.permissionsByDataOwnerId)).to.have.members([\n user1.healthcarePartyId!,\n user2.healthcarePartyId!,\n user3.healthcarePartyId!,\n ])\n expect(sharedInfo.permissionsByDataOwnerId[user1.healthcarePartyId!]).to.equal(AccessLevelEnum.WRITE)\n expect(sharedInfo.permissionsByDataOwnerId[user2.healthcarePartyId!]).to.equal(AccessLevelEnum.WRITE)\n expect(sharedInfo.permissionsByDataOwnerId[user3.healthcarePartyId!]).to.equal(AccessLevelEnum.READ)\n })\n})\n"]}
@@ -1 +0,0 @@
1
- import 'isomorphic-fetch';