@icure/api 8.2.3 → 8.2.4

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 (337) hide show
  1. package/icc-api/api/IccAuthApi.js +1 -1
  2. package/icc-api/api/IccAuthApi.js.map +1 -1
  3. package/icc-api/api/IccDocumentApi.js.map +1 -1
  4. package/icc-api/api/IccFormApi.js.map +1 -1
  5. package/icc-api/api/IccReceiptApi.js.map +1 -1
  6. package/icc-api/api/IccRestApiPath.js +1 -2
  7. package/icc-api/api/IccRestApiPath.js.map +1 -1
  8. package/icc-api/api/XHR.js +17 -8
  9. package/icc-api/api/XHR.js.map +1 -1
  10. package/icc-api/model/Address.js +1 -1
  11. package/icc-api/model/Address.js.map +1 -1
  12. package/icc-api/model/Amp.js +1 -1
  13. package/icc-api/model/Amp.js.map +1 -1
  14. package/icc-api/model/AmpComponent.js +1 -1
  15. package/icc-api/model/AmpComponent.js.map +1 -1
  16. package/icc-api/model/Ampp.js +1 -1
  17. package/icc-api/model/Ampp.js.map +1 -1
  18. package/icc-api/model/AmppComponent.js +1 -1
  19. package/icc-api/model/AmppComponent.js.map +1 -1
  20. package/icc-api/model/CareTeamMember.js +1 -1
  21. package/icc-api/model/CareTeamMember.js.map +1 -1
  22. package/icc-api/model/CareTeamMembership.js +1 -1
  23. package/icc-api/model/CareTeamMembership.js.map +1 -1
  24. package/icc-api/model/Code.js +1 -1
  25. package/icc-api/model/Code.js.map +1 -1
  26. package/icc-api/model/Contact.js.map +1 -1
  27. package/icc-api/model/Content.js.map +1 -1
  28. package/icc-api/model/DataOwnerTypeEnum.js +1 -1
  29. package/icc-api/model/DataOwnerTypeEnum.js.map +1 -1
  30. package/icc-api/model/DataOwnerWithType.js +1 -1
  31. package/icc-api/model/DataOwnerWithType.js.map +1 -1
  32. package/icc-api/model/DatabaseSynchronization.js +1 -1
  33. package/icc-api/model/DatabaseSynchronization.js.map +1 -1
  34. package/icc-api/model/Dmpp.js +1 -1
  35. package/icc-api/model/Dmpp.js.map +1 -1
  36. package/icc-api/model/Document.js +1 -1
  37. package/icc-api/model/Document.js.map +1 -1
  38. package/icc-api/model/DocumentTemplate.d.ts +1 -1
  39. package/icc-api/model/DocumentTemplate.js +1 -1
  40. package/icc-api/model/DocumentTemplate.js.map +1 -1
  41. package/icc-api/model/Editor.js +1 -1
  42. package/icc-api/model/Editor.js.map +1 -1
  43. package/icc-api/model/EfactInvoice.js +1 -1
  44. package/icc-api/model/EfactInvoice.js.map +1 -1
  45. package/icc-api/model/EmailOrSmsMessage.js +1 -1
  46. package/icc-api/model/EmailOrSmsMessage.js.map +1 -1
  47. package/icc-api/model/FlatRateTarification.js +1 -1
  48. package/icc-api/model/FlatRateTarification.js.map +1 -1
  49. package/icc-api/model/Formula.js +1 -1
  50. package/icc-api/model/Formula.js.map +1 -1
  51. package/icc-api/model/FrontEndMigration.js +1 -1
  52. package/icc-api/model/FrontEndMigration.js.map +1 -1
  53. package/icc-api/model/HealthElement.js +1 -1
  54. package/icc-api/model/HealthElement.js.map +1 -1
  55. package/icc-api/model/HealthcareParty.js +1 -1
  56. package/icc-api/model/HealthcareParty.js.map +1 -1
  57. package/icc-api/model/HealthcarePartyHistoryStatus.js +1 -1
  58. package/icc-api/model/HealthcarePartyHistoryStatus.js.map +1 -1
  59. package/icc-api/model/Ingredient.js +1 -1
  60. package/icc-api/model/Ingredient.js.map +1 -1
  61. package/icc-api/model/Invoice.js +1 -1
  62. package/icc-api/model/Invoice.js.map +1 -1
  63. package/icc-api/model/InvoiceItem.js +1 -1
  64. package/icc-api/model/InvoiceItem.js.map +1 -1
  65. package/icc-api/model/InvoicingCode.js +1 -1
  66. package/icc-api/model/InvoicingCode.js.map +1 -1
  67. package/icc-api/model/MaintenanceTask.js +1 -1
  68. package/icc-api/model/MaintenanceTask.js.map +1 -1
  69. package/icc-api/model/Measure.js.map +1 -1
  70. package/icc-api/model/MedicalHouseContract.js +1 -1
  71. package/icc-api/model/MedicalHouseContract.js.map +1 -1
  72. package/icc-api/model/ModelHelper.js +9 -10
  73. package/icc-api/model/ModelHelper.js.map +1 -1
  74. package/icc-api/model/Partnership.js +1 -1
  75. package/icc-api/model/Partnership.js.map +1 -1
  76. package/icc-api/model/Patient.js +1 -1
  77. package/icc-api/model/Patient.js.map +1 -1
  78. package/icc-api/model/PatientByHcPartyGenderEducationProfession.js +1 -1
  79. package/icc-api/model/PatientByHcPartyGenderEducationProfession.js.map +1 -1
  80. package/icc-api/model/PatientHealthCareParty.js +1 -1
  81. package/icc-api/model/PatientHealthCareParty.js.map +1 -1
  82. package/icc-api/model/Payment.js +1 -1
  83. package/icc-api/model/Payment.js.map +1 -1
  84. package/icc-api/model/PermissionCriterion.js +1 -1
  85. package/icc-api/model/PermissionCriterion.js.map +1 -1
  86. package/icc-api/model/PermissionItem.js +1 -1
  87. package/icc-api/model/PermissionItem.js.map +1 -1
  88. package/icc-api/model/PersonName.js +1 -1
  89. package/icc-api/model/PersonName.js.map +1 -1
  90. package/icc-api/model/PropertyTypeStub.js +1 -1
  91. package/icc-api/model/PropertyTypeStub.js.map +1 -1
  92. package/icc-api/model/Reimbursement.js +1 -1
  93. package/icc-api/model/Reimbursement.js.map +1 -1
  94. package/icc-api/model/RoleSourceEnum.js +1 -1
  95. package/icc-api/model/RoleSourceEnum.js.map +1 -1
  96. package/icc-api/model/SecureDelegation.js +1 -1
  97. package/icc-api/model/SecureDelegation.js.map +1 -1
  98. package/icc-api/model/Service.js.map +1 -1
  99. package/icc-api/model/StandardSubstance.js +1 -1
  100. package/icc-api/model/StandardSubstance.js.map +1 -1
  101. package/icc-api/model/SumehrValidity.js +1 -1
  102. package/icc-api/model/SumehrValidity.js.map +1 -1
  103. package/icc-api/model/Tarification.js +1 -1
  104. package/icc-api/model/Tarification.js.map +1 -1
  105. package/icc-api/model/Telecom.js +1 -1
  106. package/icc-api/model/Telecom.js.map +1 -1
  107. package/icc-api/model/Topic.js +1 -1
  108. package/icc-api/model/Topic.js.map +1 -1
  109. package/icc-api/model/TypedValueObject.js +1 -1
  110. package/icc-api/model/TypedValueObject.js.map +1 -1
  111. package/icc-api/model/User.js +1 -1
  112. package/icc-api/model/User.js.map +1 -1
  113. package/icc-api/model/UserTypeEnum.js +1 -1
  114. package/icc-api/model/UserTypeEnum.js.map +1 -1
  115. package/icc-api/model/VirtualIngredient.js +1 -1
  116. package/icc-api/model/VirtualIngredient.js.map +1 -1
  117. package/icc-api/model/internal/RecoveryData.js +1 -1
  118. package/icc-api/model/internal/RecoveryData.js.map +1 -1
  119. package/icc-api/model/requests/EntityBulkShareResult.js.map +1 -1
  120. package/icc-api/model/requests/EntityShareOrMetadataUpdateRequest.js.map +1 -1
  121. package/icc-api/model/requests/EntityShareRequest.js +1 -1
  122. package/icc-api/model/requests/EntityShareRequest.js.map +1 -1
  123. package/icc-api/model/requests/EntitySharedMetadataUpdateRequest.js +1 -1
  124. package/icc-api/model/requests/EntitySharedMetadataUpdateRequest.js.map +1 -1
  125. package/icc-x-api/auth/AuthenticationProvider.js.map +1 -1
  126. package/icc-x-api/auth/BasicAuthService.js.map +1 -1
  127. package/icc-x-api/auth/EnsembleAuthService.js.map +1 -1
  128. package/icc-x-api/auth/JwtAuthService.js.map +1 -1
  129. package/icc-x-api/auth/JwtBridgedAuthService.d.ts +1 -1
  130. package/icc-x-api/auth/JwtBridgedAuthService.js +1 -1
  131. package/icc-x-api/auth/JwtBridgedAuthService.js.map +1 -1
  132. package/icc-x-api/auth/JwtUtils.js +3 -4
  133. package/icc-x-api/auth/JwtUtils.js.map +1 -1
  134. package/icc-x-api/auth/NoAuthService.js.map +1 -1
  135. package/icc-x-api/auth/SmartAuthProvider.d.ts +1 -1
  136. package/icc-x-api/auth/SmartAuthProvider.js +1 -1
  137. package/icc-x-api/auth/SmartAuthProvider.js.map +1 -1
  138. package/icc-x-api/crypto/AES.js.map +1 -1
  139. package/icc-x-api/crypto/AccessControlKeysHeadersProvider.js.map +1 -1
  140. package/icc-x-api/crypto/AccessControlSecretUtils.js.map +1 -1
  141. package/icc-x-api/crypto/BaseExchangeDataManager.js +10 -10
  142. package/icc-x-api/crypto/BaseExchangeDataManager.js.map +1 -1
  143. package/icc-x-api/crypto/BaseExchangeKeysManager.js +4 -4
  144. package/icc-x-api/crypto/BaseExchangeKeysManager.js.map +1 -1
  145. package/icc-x-api/crypto/CryptoStrategies.d.ts +5 -7
  146. package/icc-x-api/crypto/CryptoStrategies.js.map +1 -1
  147. package/icc-x-api/crypto/DelegationsDeAnonymization.js +1 -1
  148. package/icc-x-api/crypto/DelegationsDeAnonymization.js.map +1 -1
  149. package/icc-x-api/crypto/ExchangeDataManager.js +7 -8
  150. package/icc-x-api/crypto/ExchangeDataManager.js.map +1 -1
  151. package/icc-x-api/crypto/ExchangeDataMapManager.js.map +1 -1
  152. package/icc-x-api/crypto/ExchangeKeysManager.js +1 -1
  153. package/icc-x-api/crypto/ExchangeKeysManager.js.map +1 -1
  154. package/icc-x-api/crypto/ExtendedApisUtilsImpl.js +11 -10
  155. package/icc-x-api/crypto/ExtendedApisUtilsImpl.js.map +1 -1
  156. package/icc-x-api/crypto/HMACUtils.js.map +1 -1
  157. package/icc-x-api/crypto/KeyRecovery.js +5 -5
  158. package/icc-x-api/crypto/KeyRecovery.js.map +1 -1
  159. package/icc-x-api/crypto/NativeCryptoPrimitivesBridge.js +3 -3
  160. package/icc-x-api/crypto/NativeCryptoPrimitivesBridge.js.map +1 -1
  161. package/icc-x-api/crypto/RSA.js +4 -4
  162. package/icc-x-api/crypto/RSA.js.map +1 -1
  163. package/icc-x-api/crypto/RecoveryDataEncryption.js +1 -1
  164. package/icc-x-api/crypto/RecoveryDataEncryption.js.map +1 -1
  165. package/icc-x-api/crypto/SecretIdUseOption.js +1 -1
  166. package/icc-x-api/crypto/SecretIdUseOption.js.map +1 -1
  167. package/icc-x-api/crypto/SecureDelegationsEncryption.js +4 -4
  168. package/icc-x-api/crypto/SecureDelegationsEncryption.js.map +1 -1
  169. package/icc-x-api/crypto/SecureDelegationsManager.js +1 -1
  170. package/icc-x-api/crypto/SecureDelegationsManager.js.map +1 -1
  171. package/icc-x-api/crypto/SecurityMetadataDecryptor.d.ts +1 -1
  172. package/icc-x-api/crypto/SecurityMetadataDecryptor.js +9 -9
  173. package/icc-x-api/crypto/SecurityMetadataDecryptor.js.map +1 -1
  174. package/icc-x-api/crypto/ShamirKeysManager.js.map +1 -1
  175. package/icc-x-api/crypto/ShareMetadataBehaviour.js +1 -1
  176. package/icc-x-api/crypto/ShareMetadataBehaviour.js.map +1 -1
  177. package/icc-x-api/crypto/TransferKeysManager.js +1 -1
  178. package/icc-x-api/crypto/TransferKeysManager.js.map +1 -1
  179. package/icc-x-api/crypto/UserEncryptionKeysManager.js +2 -2
  180. package/icc-x-api/crypto/UserEncryptionKeysManager.js.map +1 -1
  181. package/icc-x-api/crypto/shamir.d.ts +2 -2
  182. package/icc-x-api/crypto/shamir.js +4 -4
  183. package/icc-x-api/crypto/shamir.js.map +1 -1
  184. package/icc-x-api/crypto/utils.js +14 -15
  185. package/icc-x-api/crypto/utils.js.map +1 -1
  186. package/icc-x-api/icc-accesslog-x-api.js +10 -10
  187. package/icc-x-api/icc-accesslog-x-api.js.map +1 -1
  188. package/icc-x-api/icc-bekmehr-x-api.js.map +1 -1
  189. package/icc-x-api/icc-calendar-item-x-api.js +7 -7
  190. package/icc-x-api/icc-calendar-item-x-api.js.map +1 -1
  191. package/icc-x-api/icc-classification-x-api.js +5 -5
  192. package/icc-x-api/icc-classification-x-api.js.map +1 -1
  193. package/icc-x-api/icc-code-x-api.js.map +1 -1
  194. package/icc-x-api/icc-contact-x-api.js +12 -12
  195. package/icc-x-api/icc-contact-x-api.js.map +1 -1
  196. package/icc-x-api/icc-data-owner-x-api.js.map +1 -1
  197. package/icc-x-api/icc-device-x-api.js +2 -2
  198. package/icc-x-api/icc-device-x-api.js.map +1 -1
  199. package/icc-x-api/icc-doctemplate-x-api.js.map +1 -1
  200. package/icc-x-api/icc-document-x-api.js +15 -15
  201. package/icc-x-api/icc-document-x-api.js.map +1 -1
  202. package/icc-x-api/icc-form-x-api.js +7 -7
  203. package/icc-x-api/icc-form-x-api.js.map +1 -1
  204. package/icc-x-api/icc-hcparty-x-api.js +4 -4
  205. package/icc-x-api/icc-hcparty-x-api.js.map +1 -1
  206. package/icc-x-api/icc-helement-x-api.js +10 -10
  207. package/icc-x-api/icc-helement-x-api.js.map +1 -1
  208. package/icc-x-api/icc-icure-maintenance-x-api.js.map +1 -1
  209. package/icc-x-api/icc-invoice-x-api.js +7 -7
  210. package/icc-x-api/icc-invoice-x-api.js.map +1 -1
  211. package/icc-x-api/icc-maintenance-task-x-api.js +7 -7
  212. package/icc-x-api/icc-maintenance-task-x-api.js.map +1 -1
  213. package/icc-x-api/icc-message-x-api.js +8 -8
  214. package/icc-x-api/icc-message-x-api.js.map +1 -1
  215. package/icc-x-api/icc-patient-x-api.js +11 -11
  216. package/icc-x-api/icc-patient-x-api.js.map +1 -1
  217. package/icc-x-api/icc-receipt-x-api.js +10 -10
  218. package/icc-x-api/icc-receipt-x-api.js.map +1 -1
  219. package/icc-x-api/icc-recovery-x-api.js +4 -4
  220. package/icc-x-api/icc-recovery-x-api.js.map +1 -1
  221. package/icc-x-api/icc-time-table-x-api.js +5 -5
  222. package/icc-x-api/icc-time-table-x-api.js.map +1 -1
  223. package/icc-x-api/icc-topic-x-api.js +9 -9
  224. package/icc-x-api/icc-topic-x-api.js.map +1 -1
  225. package/icc-x-api/icc-user-x-api.js +4 -4
  226. package/icc-x-api/icc-user-x-api.js.map +1 -1
  227. package/icc-x-api/index.js +22 -22
  228. package/icc-x-api/index.js.map +1 -1
  229. package/icc-x-api/maintenance/KeyPairUpdateRequest.js +2 -2
  230. package/icc-x-api/maintenance/KeyPairUpdateRequest.js.map +1 -1
  231. package/icc-x-api/storage/IcureStorageFacade.js +1 -1
  232. package/icc-x-api/storage/IcureStorageFacade.js.map +1 -1
  233. package/icc-x-api/storage/LocalStorageImpl.js +1 -1
  234. package/icc-x-api/storage/LocalStorageImpl.js.map +1 -1
  235. package/icc-x-api/utils/EntityWithDelegationTypeName.js +4 -4
  236. package/icc-x-api/utils/EntityWithDelegationTypeName.js.map +1 -1
  237. package/icc-x-api/utils/asn1-packer.js +2 -3
  238. package/icc-x-api/utils/asn1-packer.js.map +1 -1
  239. package/icc-x-api/utils/asn1-parser.js +1 -2
  240. package/icc-x-api/utils/asn1-parser.js.map +1 -1
  241. package/icc-x-api/utils/binary-utils.js +11 -11
  242. package/icc-x-api/utils/binary-utils.js.map +1 -1
  243. package/icc-x-api/utils/code-util.js +1 -2
  244. package/icc-x-api/utils/code-util.js.map +1 -1
  245. package/icc-x-api/utils/collection-utils.js +5 -6
  246. package/icc-x-api/utils/collection-utils.js.map +1 -1
  247. package/icc-x-api/utils/crypto-utils.d.ts +1 -1
  248. package/icc-x-api/utils/crypto-utils.js +17 -18
  249. package/icc-x-api/utils/crypto-utils.js.map +1 -1
  250. package/icc-x-api/utils/formatting-util.js +21 -21
  251. package/icc-x-api/utils/formatting-util.js.map +1 -1
  252. package/icc-x-api/utils/functional-util.js +3 -4
  253. package/icc-x-api/utils/functional-util.js.map +1 -1
  254. package/icc-x-api/utils/graph-utils.js +3 -4
  255. package/icc-x-api/utils/graph-utils.js.map +1 -1
  256. package/icc-x-api/utils/hcp-util.js +4 -4
  257. package/icc-x-api/utils/hcp-util.js.map +1 -1
  258. package/icc-x-api/utils/insurability-util.js +6 -7
  259. package/icc-x-api/utils/insurability-util.js.map +1 -1
  260. package/icc-x-api/utils/lru-temporised-async-cache.js.map +1 -1
  261. package/icc-x-api/utils/net-utils.js +3 -4
  262. package/icc-x-api/utils/net-utils.js.map +1 -1
  263. package/icc-x-api/utils/person-util.js +3 -4
  264. package/icc-x-api/utils/person-util.js.map +1 -1
  265. package/icc-x-api/utils/proxy-utils.js.map +1 -1
  266. package/icc-x-api/utils/simple-lru-cache.js.map +1 -1
  267. package/icc-x-api/utils/uuid-encoder.js +2 -2
  268. package/icc-x-api/utils/uuid-encoder.js.map +1 -1
  269. package/icc-x-api/utils/websocket.d.ts +0 -1
  270. package/icc-x-api/utils/websocket.js +3 -3
  271. package/icc-x-api/utils/websocket.js.map +1 -1
  272. package/package.json +3 -3
  273. package/test/icc-api/api/IccAgendaApi.js.map +1 -1
  274. package/test/icc-api/api/IccCalendarItemApi.js.map +1 -1
  275. package/test/icc-api/api/IccCalendarItemTypeApi.js +2 -2
  276. package/test/icc-api/api/IccCalendarItemTypeApi.js.map +1 -1
  277. package/test/icc-api/api/IccDocumentApi.js.map +1 -1
  278. package/test/icc-api/api/IccKeywordApi.js.map +1 -1
  279. package/test/icc-api/api/IccMedicalLocationApi.js.map +1 -1
  280. package/test/icc-api/api/IccPlaceApi.js.map +1 -1
  281. package/test/icc-api/api/IccUserApi.js +6 -6
  282. package/test/icc-x-api/auth/group-switch-test.js.map +1 -1
  283. package/test/icc-x-api/auth/jwt-concurrency-test.js +1 -2
  284. package/test/icc-x-api/auth/jwt-concurrency-test.js.map +1 -1
  285. package/test/icc-x-api/auth/jwt-provider-test.js.map +1 -1
  286. package/test/icc-x-api/auth/smart-auth-provider-test.js.map +1 -1
  287. package/test/icc-x-api/autofix-anonymity-test.js.map +1 -1
  288. package/test/icc-x-api/confidential-entities-test.js +1 -1
  289. package/test/icc-x-api/confidential-entities-test.js.map +1 -1
  290. package/test/icc-x-api/crud/comprehensive-crud-test.js.map +1 -1
  291. package/test/icc-x-api/crud/entities-crud-test-interface.js +24 -24
  292. package/test/icc-x-api/crud/entities-crud-test-interface.js.map +1 -1
  293. package/test/icc-x-api/crypto/anonymous-delegations-test.js +2 -2
  294. package/test/icc-x-api/crypto/anonymous-delegations-test.js.map +1 -1
  295. package/test/icc-x-api/crypto/cryptoTest.js.map +1 -1
  296. package/test/icc-x-api/crypto/delegate-ci-to-patient-with-missing-keys-test.js.map +1 -1
  297. package/test/icc-x-api/crypto/exchange-data-manager-test.js +4 -4
  298. package/test/icc-x-api/crypto/exchange-data-manager-test.js.map +1 -1
  299. package/test/icc-x-api/crypto/full-crypto-test.js +5 -5
  300. package/test/icc-x-api/crypto/full-crypto-test.js.map +1 -1
  301. package/test/icc-x-api/crypto/legacy-metadata-migration-test.js +7 -7
  302. package/test/icc-x-api/crypto/legacy-metadata-migration-test.js.map +1 -1
  303. package/test/icc-x-api/crypto/secure-delegations-manager-test.js +2 -2
  304. package/test/icc-x-api/crypto/secure-delegations-manager-test.js.map +1 -1
  305. package/test/icc-x-api/crypto/shamir.js.map +1 -1
  306. package/test/icc-x-api/crypto/soft-deleted-data-owners.js +3 -3
  307. package/test/icc-x-api/crypto/soft-deleted-data-owners.js.map +1 -1
  308. package/test/icc-x-api/entity-with-attachments-api-test.js +2 -2
  309. package/test/icc-x-api/entity-with-attachments-api-test.js.map +1 -1
  310. package/test/icc-x-api/icc-maintenance-task-x-api-test.js +4 -4
  311. package/test/icc-x-api/icc-message-x-api.js +1 -1
  312. package/test/icc-x-api/icc-message-x-api.js.map +1 -1
  313. package/test/icc-x-api/icc-patient-x-api-test.js.map +1 -1
  314. package/test/icc-x-api/icc-recovery-x-api.js.map +1 -1
  315. package/test/icc-x-api/icc-topic-x-api.js.map +1 -1
  316. package/test/icc-x-api/icc-user-x-api-test.js.map +1 -1
  317. package/test/icc-x-api/patient-user.js.map +1 -1
  318. package/test/icc-x-api/test-legacy-data-support.js.map +1 -1
  319. package/test/icc-x-api/utils/graph-test.js.map +1 -1
  320. package/test/icc-x-api/utils/lru-temporised-async-cache-test.js.map +1 -1
  321. package/test/support/CSM-243.js +2 -2
  322. package/test/support/CSM-243.js.map +1 -1
  323. package/test/support/CSM-93.js +1 -1
  324. package/test/support/CSM-93.js.map +1 -1
  325. package/test/utils/FakeDataOwnerApi.js.map +1 -1
  326. package/test/utils/FakeEncryptionKeysManager.js +2 -2
  327. package/test/utils/FakeEncryptionKeysManager.js.map +1 -1
  328. package/test/utils/FakeExchangeDataApi.js.map +1 -1
  329. package/test/utils/FakeExchangeDataManager.js.map +1 -1
  330. package/test/utils/FakeGenericApi.js.map +1 -1
  331. package/test/utils/TestApi.js +2 -2
  332. package/test/utils/TestApi.js.map +1 -1
  333. package/test/utils/TestCryptoStrategies.js.map +1 -1
  334. package/test/utils/TestStorage.js +2 -2
  335. package/test/utils/TestStorage.js.map +1 -1
  336. package/test/utils/test_utils.js +22 -22
  337. package/test/utils/test_utils.js.map +1 -1
@@ -443,9 +443,9 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
443
443
  * and instead the root delegation will be from self to another. You have to specify which delegate will be part of the root delegation.
444
444
  * @return a new instance of document.
445
445
  */
446
- newInstance(user, message, c = {}, options = {}) {
447
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
448
- return __awaiter(this, void 0, void 0, function* () {
446
+ newInstance(user_1, message_1) {
447
+ return __awaiter(this, arguments, void 0, function* (user, message, c = {}, options = {}) {
448
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
449
449
  const document = Object.assign(Object.assign({}, (c !== null && c !== void 0 ? c : {})), { _type: 'org.taktik.icure.entities.Document', id: (_a = c === null || c === void 0 ? void 0 : c.id) !== null && _a !== void 0 ? _a : this.crypto.primitives.randomUuid(), created: (_b = c === null || c === void 0 ? void 0 : c.created) !== null && _b !== void 0 ? _b : new Date().getTime(), modified: (_c = c === null || c === void 0 ? void 0 : c.modified) !== null && _c !== void 0 ? _c : new Date().getTime(), responsible: (_d = c === null || c === void 0 ? void 0 : c.responsible) !== null && _d !== void 0 ? _d : (this.autofillAuthor ? this.dataOwnerApi.getDataOwnerIdOf(user) : undefined), author: (_e = c === null || c === void 0 ? void 0 : c.author) !== null && _e !== void 0 ? _e : (this.autofillAuthor ? user.id : undefined), codes: (_f = c === null || c === void 0 ? void 0 : c.codes) !== null && _f !== void 0 ? _f : [], tags: (_g = c === null || c === void 0 ? void 0 : c.tags) !== null && _g !== void 0 ? _g : [] });
450
450
  const ownerId = this.dataOwnerApi.getDataOwnerIdOf(user);
451
451
  if (ownerId !== (yield this.dataOwnerApi.getCurrentDataOwnerId()))
@@ -608,8 +608,8 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
608
608
  * @return the updated document.
609
609
  */
610
610
  encryptAndSetDocumentAttachment(document, attachment, utis) {
611
- var _a;
612
611
  return __awaiter(this, void 0, void 0, function* () {
612
+ var _a;
613
613
  if (!document.rev)
614
614
  throw new Error('Cannot set attachment on document without rev');
615
615
  const { encryptedData, updatedEntity } = yield this.crypto.xapi.encryptDataOf(document, utils_1.EntityWithDelegationTypeName.Document, attachment, (d) => this.modifyDocument(d));
@@ -641,8 +641,8 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
641
641
  * @return the updated document.
642
642
  */
643
643
  encryptAndSetSecondaryDocumentAttachment(document, secondaryAttachmentKey, attachment, utis) {
644
- var _a;
645
644
  return __awaiter(this, void 0, void 0, function* () {
645
+ var _a;
646
646
  if (!document.rev)
647
647
  throw new Error('Cannot set attachment on document without rev');
648
648
  const { encryptedData, updatedEntity } = yield this.crypto.xapi.encryptDataOf(document, utils_1.EntityWithDelegationTypeName.Document, attachment, (d) => this.modifyDocument());
@@ -670,8 +670,8 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
670
670
  * keys and it is unclear which one should be used this function can help to detect bad decryptions.
671
671
  * @return the decrypted attachment, if it could be decrypted, else the encrypted attachment.
672
672
  */
673
- getAndDecryptDocumentAttachment(document, validator = () => Promise.resolve(true)) {
674
- return __awaiter(this, void 0, void 0, function* () {
673
+ getAndDecryptDocumentAttachment(document_1) {
674
+ return __awaiter(this, arguments, void 0, function* (document, validator = () => Promise.resolve(true)) {
675
675
  const retrieved = yield this.getAndTryDecryptDocumentAttachment(document, (x) => validator(x));
676
676
  if (!retrieved.wasDecrypted)
677
677
  throw new Error(`No valid key found to decrypt data of document ${document.id}.`);
@@ -687,8 +687,8 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
687
687
  * - data: the decrypted attachment, if it could be decrypted, else the encrypted attachment.
688
688
  * - wasDecrypted: if the data was successfully decrypted or not
689
689
  */
690
- getAndTryDecryptDocumentAttachment(document, validator = () => Promise.resolve(true)) {
691
- return __awaiter(this, void 0, void 0, function* () {
690
+ getAndTryDecryptDocumentAttachment(document_1) {
691
+ return __awaiter(this, arguments, void 0, function* (document, validator = () => Promise.resolve(true)) {
692
692
  return yield this.crypto.xapi.tryDecryptDataOf({ entity: document, type: utils_1.EntityWithDelegationTypeName.Document }, yield this.getRawMainDocumentAttachment(document.id), (x) => validator(x));
693
693
  });
694
694
  }
@@ -700,8 +700,8 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
700
700
  * keys and it is unclear which one should be used this function can help to detect bad decryptions.
701
701
  * @return the decrypted attachment.
702
702
  */
703
- getAndDecryptSecondaryDocumentAttachment(document, secondaryAttachmentKey, validator = () => Promise.resolve(true)) {
704
- return __awaiter(this, void 0, void 0, function* () {
703
+ getAndDecryptSecondaryDocumentAttachment(document_1, secondaryAttachmentKey_1) {
704
+ return __awaiter(this, arguments, void 0, function* (document, secondaryAttachmentKey, validator = () => Promise.resolve(true)) {
705
705
  const { data, wasDecrypted } = yield this.getAndTryDecryptSecondaryDocumentAttachment(document, secondaryAttachmentKey, (x) => validator(x));
706
706
  if (!wasDecrypted)
707
707
  throw new Error(`No valid key found to decrypt data of document ${document.id}.`);
@@ -718,8 +718,8 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
718
718
  * - data: the decrypted attachment, if it could be decrypted, else the encrypted attachment.
719
719
  * - wasDecrypted: if the data was successfully decrypted or not
720
720
  */
721
- getAndTryDecryptSecondaryDocumentAttachment(document, secondaryAttachmentKey, validator = () => Promise.resolve(true)) {
722
- return __awaiter(this, void 0, void 0, function* () {
721
+ getAndTryDecryptSecondaryDocumentAttachment(document_1, secondaryAttachmentKey_1) {
722
+ return __awaiter(this, arguments, void 0, function* (document, secondaryAttachmentKey, validator = () => Promise.resolve(true)) {
723
723
  return yield this.crypto.xapi.tryDecryptDataOf({ entity: document, type: utils_1.EntityWithDelegationTypeName.Document }, yield this.getSecondaryAttachment(document.id, secondaryAttachmentKey), (x) => validator(x));
724
724
  });
725
725
  }
@@ -755,8 +755,8 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
755
755
  * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.
756
756
  * @return the updated entity
757
757
  */
758
- shareWith(delegateId, document, options = {}) {
759
- return __awaiter(this, void 0, void 0, function* () {
758
+ shareWith(delegateId_1, document_1) {
759
+ return __awaiter(this, arguments, void 0, function* (delegateId, document, options = {}) {
760
760
  return this.shareWithMany(document, { [delegateId]: options });
761
761
  });
762
762
  }
@@ -1 +1 @@
1
- {"version":3,"file":"icc-document-x-api.js","sourceRoot":"","sources":["../../icc-x-api/icc-document-x-api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wCAAuD;AAGvD,4BAA2B;AAC3B,4CAAwC;AACxC,kDAAiD;AAEjD,uDAAiF;AAEjF,0EAAgG;AAChG,wEAAoE;AAKpE,mCAAsD;AACtD,IAAO,eAAe,GAAG,mCAAgB,CAAC,eAAe,CAAA;AAEzD,kEAA8D;AAE9D,qCAAqC;AACrC,MAAa,eAAgB,SAAQ,wBAAc;IAuhBjD,YACE,IAAY,EACZ,OAAkC,EAC1B,MAAqB,EACrB,OAAmB,EAC3B,YAA8B,EACb,cAAuB,EACxC,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,CAAC,CAAC,KAAK;QAET,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,sBAAsB,EAAE,SAAS,CAAC,CAAA;QAX/C,WAAM,GAAN,MAAM,CAAe;QACrB,YAAO,GAAP,OAAO,CAAY;QAEV,mBAAc,GAAd,cA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AC,EAAE,EAAE,CAAC;gBACvD,UAAU;gBACV;oBACE,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;oBAClD,mBAAmB,EAAE,OAAO,CAAC,kBAAkB;oBAC/C,oBAAoB,EAAE,OAAO,CAAC,cAAc;oBAC5C,cAAc,EAAE,OAAO,CAAC,cAAc;iBACvC;aACF,CAAC,CACH,EACD,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,CACjC;iBACA,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAA;QACnB,CAAC;KAAA;IAED,yBAAyB,CACvB,MAAuB;QAEvB,OAAO,IAAI,CAAC,MAAM,CAAC,0BAA0B,CAAC,yBAAyB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,oCAA4B,CAAC,QAAQ,EAAE,CAAC,CAAA;IAClI,CAAC;IAED,mBAAmB,CAAC,MAAuB;QACzC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,oCAA4B,CAAC,QAAQ,EAAE,EAAE,SAAS,CAAC,CAAA;IAC9G,CAAC;IAED,uCAAuC,CAAC,MAAuB,EAAE,SAAmB;QAClF,OAAO,IAAI,CAAC,MAAM,CAAC,0BAA0B,CAAC,iCAAiC,CAC7E,EAAE,MAAM,EAAE,IAAI,EAAE,oCAA4B,CAAC,QAAQ,EAAE,EACvD,SAAS,CACV,CAAA;IACH,CAAC;CACF;AAziCD,0CAyiCC","sourcesContent":["import { IccAuthApi, IccDocumentApi } from '../icc-api'\nimport { IccCryptoXApi } from './icc-crypto-x-api'\n\nimport * as _ from 'lodash'\nimport { XHR } from '../icc-api/api/XHR'\nimport * as models from '../icc-api/model/models'\n\nimport { a2b, hex2ua, string2ua, ua2string, ua2utf8 } from './utils/binary-utils'\nimport { IccDataOwnerXApi } from './icc-data-owner-x-api'\nimport { AuthenticationProvider, NoAuthenticationProvider } from './auth/AuthenticationProvider'\nimport { SecureDelegation } from '../icc-api/model/SecureDelegation'\nimport { ShareMetadataBehaviour } from './crypto/ShareMetadataBehaviour'\nimport { ShareResult } from './utils/ShareResult'\nimport { EntityShareRequest } from '../icc-api/model/requests/EntityShareRequest'\nimport { EncryptedEntityXApi } from './basexapi/EncryptedEntityXApi'\nimport { EntityWithDelegationTypeName } from './utils'\nimport AccessLevelEnum = SecureDelegation.AccessLevelEnum\nimport RequestedPermissionEnum = EntityShareRequest.RequestedPermissionEnum\nimport { SecretIdUseOption } from './crypto/SecretIdUseOption'\n\n// noinspection JSUnusedGlobalSymbols\nexport class IccDocumentXApi extends IccDocumentApi implements EncryptedEntityXApi<models.Document> {\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response>\n\n /** maps invalid UTI values to corresponding MIME type for backward-compatibility (pre-v1.0.117) */\n compatUtiRevDefs: { [key: string]: string } = {\n 'com.adobe.encapsulatedPostscript': 'image/eps',\n 'com.adobe.illustrator.aiImage': 'application/illustrator',\n 'com.adobe.indesignImage': 'image/indesign',\n 'com.adobe.photoshopImage': 'image/psd',\n 'com.adobe.postscriptPfaFont': 'application/x-font-type1',\n 'com.adobe.postscriptPfbFont': 'application/x-font-type1',\n 'com.allume.stuffitArchive': 'application/stuffit',\n 'com.apple.binhexArchive': 'application/binhex',\n 'com.apple.diskImageUdif': 'application/x-apple-diskimage',\n 'com.apple.macbinaryArchive': 'application/macbinary',\n 'com.apple.quartzComposerComposition': 'application/x-quartzcomposer',\n 'com.apple.quicktimeImage': 'image/x-quicktime',\n 'com.apple.quicktimeMovie': 'video/quicktime',\n 'com.js.efxFax': 'image/efax',\n 'com.macromedia.shockwaveFlash': 'application/x-shockwave-flash',\n 'com.microsoft.advancedStreamRedirector': 'video/x-ms-asx',\n 'com.microsoft.advancedSystemsFormat': 'video/x-ms-asf',\n 'com.microsoft.waveformAudio': 'audio/wave',\n 'com.microsoft.windowsDynamicLinkLibrary': 'application/x-msdownload',\n 'com.microsoft.windowsExecutable': 'application/exe',\n 'com.microsoft.windowsMediaWax': 'audio/x-ms-wax',\n 'com.microsoft.windowsMediaWm': 'video/x-ms-wm',\n 'com.microsoft.windowsMediaWma': 'audio/x-ms-wma',\n 'com.microsoft.windowsMediaWmd': 'video/x-ms-wmd',\n 'com.microsoft.windowsMediaWmp': 'video/x-ms-wmp',\n 'com.microsoft.windowsMediaWmv': 'video/x-ms-wmv',\n 'com.microsoft.windowsMediaWmx': 'video/x-ms-wmx',\n 'com.microsoft.windowsMediaWmz': 'video/x-ms-wmz',\n 'com.microsoft.windowsMediaWvx': 'video/x-ms-wvx',\n 'com.netscape.javascriptSource': 'text/javascript',\n 'com.pkware.zipArchive': 'application/zip',\n 'com.rarlab.rarArchive': 'application/rar',\n 'com.redhat.redhatPackage': 'application/x-redhat-package',\n 'com.sgi.sgiImage': 'image/sgi',\n 'com.sun.javaAppDescriptor': 'text/vnd.sun.j2me.app-descriptor',\n 'com.sun.javaArchive': 'application/java-archive',\n 'com.sun.javaClass': 'application/java',\n 'com.sun.javaSource': 'text/x-java-source',\n 'com.sun.javaWebStart': 'application/jnlp',\n 'com.truevision.tgaImage': 'image/tga',\n 'org.bzip.bzip2Archive': 'application/x-bzip2',\n 'org.debian.debianPackage': 'application/x-debian-package',\n 'org.gnu.gnuTarArchive': 'application/x-gtar',\n 'org.gnu.gnuZipArchive': 'application/gzip',\n 'org.oasis.opendocument.textMaster': 'application/vnd.oasis.opendocument.text-master',\n 'org.oasis.opendocument.textWeb': 'application/vnd.oasis.opendocument.text-web',\n 'org.xiph.oggTheora': 'video/ogg',\n 'org.xiph.oggVorbis': 'audio/ogg',\n 'public.aifcAudio': 'audio/aiff',\n 'public.aiffAudio': 'audio/aiff',\n 'public.assemblySource': 'text/x-asm',\n 'public.cHeader': 'text/x-c-header',\n 'public.cpioArchive': 'application/x-cpio',\n 'public.cPlusPlusHeader': 'text/x-c++-hdr',\n 'public.cPlusPlusSource': 'application/x-cplusplus',\n 'public.cshScript': 'application/x-csh',\n 'public.cSource': 'text/x-c-code',\n 'public.isoImage': 'application/x-iso-image',\n 'public.mpeg4Audio': 'audio/mp4',\n 'public.objectiveCPlusPlusSource': 'text/x-objcppsrc',\n 'public.objectiveCSource': 'text/x-objcsrc',\n 'public.opentypeFont': 'font/opentype',\n 'public.perlScript': 'text/x-perl',\n 'public.phpScript': 'text/php',\n 'public.plainText': 'text/plain',\n 'public.pythonScript': 'text/x-python-script',\n 'public.shellScript': 'application/x-sh',\n 'public.tarArchive': 'application/tar',\n 'public.truetypeTtfFont': 'application/x-font-ttf',\n 'public.ulawAudio': 'audio/au',\n 'public.xbitmapImage': 'image/xbm',\n 'unofficial.atomFeed': 'application/atom+xml',\n 'unofficial.m3u8Playlist': 'application/x-mpegURL',\n 'unofficial.plsPlaylist': 'audio/scpls',\n 'unofficial.rdfFeed': 'application/rdf+xml',\n 'unofficial.rssFeed': 'application/rss+xml',\n }\n\n utiRevDefs: { [key: string]: string } = {\n ...this.compatUtiRevDefs,\n 'com.adobe.encapsulated-postscript': 'image/eps',\n 'com.adobe.illustrator.ai-image': 'application/illustrator',\n 'com.adobe.indesign-image': 'image/indesign',\n 'com.adobe.pdf': 'application/pdf',\n 'com.adobe.photoshop-image': 'image/psd',\n 'com.adobe.postscript': 'application/postscript',\n 'com.adobe.postscript-pfa-font': 'application/x-font-type1',\n 'com.adobe.postscript-pfb-font': 'application/x-font-type1',\n 'com.allume.stuffit-archive': 'application/stuffit',\n 'com.apple.applescript.script': 'application/x-applescript',\n 'com.apple.applescript.text': 'application/x-applescript',\n 'com.apple.binhex-archive': 'application/binhex',\n 'com.apple.disk-image-udif': 'application/x-apple-diskimage',\n 'com.apple.ical.ics': 'text/calendar',\n 'com.apple.ical.vcs': 'text/x-vcalendar',\n 'com.apple.macbinary-archive': 'application/macbinary',\n 'com.apple.pict': 'image/pict',\n 'com.apple.quartz-composer-composition': 'application/x-quartzcomposer',\n 'com.apple.quicktime-image': 'image/x-quicktime',\n 'com.apple.quicktime-movie': 'video/quicktime',\n 'com.bittorrent.torrent': 'application/x-bittorrent',\n 'com.compuserve.gif': 'image/gif',\n 'com.js.efx-fax': 'image/efax',\n 'com.kodak.flashpix.image': 'image/vndfpx',\n 'com.lizardtech.djvu': 'image/vnd.djvu',\n 'com.macromedia.shockwave-flash': 'application/x-shockwave-flash',\n 'com.microsoft.advanced-stream-redirector': 'video/x-ms-asx',\n 'com.microsoft.advanced-systems-format': 'video/x-ms-asf',\n 'com.microsoft.bmp': 'image/bmp',\n 'com.microsoft.excel.xls': 'application/excel',\n 'com.microsoft.ico': 'image/x-icon',\n 'com.microsoft.powerpoint.ppt': 'application/powerpoint',\n 'com.microsoft.waveform-audio': 'audio/wave',\n 'com.microsoft.windows-dynamic-link-library': 'application/x-msdownload',\n 'com.microsoft.windows-executable': 'application/exe',\n 'com.microsoft.windows-media-wax': 'audio/x-ms-wax',\n 'com.microsoft.windows-media-wm': 'video/x-ms-wm',\n 'com.microsoft.windows-media-wma': 'audio/x-ms-wma',\n 'com.microsoft.windows-media-wmd': 'video/x-ms-wmd',\n 'com.microsoft.windows-media-wmp': 'video/x-ms-wmp',\n 'com.microsoft.windows-media-wmv': 'video/x-ms-wmv',\n 'com.microsoft.windows-media-wmx': 'video/x-ms-wmx',\n 'com.microsoft.windows-media-wmz': 'video/x-ms-wmz',\n 'com.microsoft.windows-media-wvx': 'video/x-ms-wvx',\n 'com.microsoft.word.doc': 'application/msword',\n 'com.netscape.javascript-source': 'text/javascript',\n 'com.pkware.zip-archive': 'application/zip',\n 'com.rarlab.rar-archive': 'application/rar',\n 'com.real.realaudio': 'audio/vnd.rn-realaudio',\n 'com.real.realmedia': 'application/vnd.rn-realmedia',\n 'com.real.smil': 'application/smil',\n 'com.redhat.redhat-package': 'application/x-redhat-package',\n 'com.sgi.sgi-image': 'image/sgi',\n 'com.soundblaster.soundfont': 'application/x-soundfont',\n 'com.sun.java-app-descriptor': 'text/vnd.sun.j2me.app-descriptor',\n 'com.sun.java-archive': 'application/java-archive',\n 'com.sun.java-class': 'application/java',\n 'com.sun.java-source': 'text/x-java-source',\n 'com.sun.java-web-start': 'application/jnlp',\n 'com.truevision.tga-image': 'image/tga',\n 'org.bzip.bzip2-archive': 'application/x-bzip2',\n 'org.debian.debian-package': 'application/x-debian-package',\n 'org.gnu.gnu-tar-archive': 'application/x-gtar',\n 'org.gnu.gnu-zip-archive': 'application/gzip',\n 'org.neooffice.calc': 'application/vnd.sun.xml.calc',\n 'org.neooffice.draw': 'application/vnd.sun.xml.draw',\n 'org.neooffice.global': 'application/vnd.sun.xml.writer.global',\n 'org.neooffice.impress': 'application/vnd.sun.xml.impress',\n 'org.neooffice.math': 'application/vnd.sun.xml.math',\n 'org.neooffice.writer': 'application/vnd.sun.xml.writer',\n 'org.oasis.opendocument.chart': 'application/vnd.oasis.opendocument.chart',\n 'org.oasis.opendocument.database': 'application/vnd.oasis.opendocument.database',\n 'org.oasis.opendocument.formula': 'application/vnd.oasis.opendocument.formula',\n 'org.oasis.opendocument.graphics': 'application/vnd.oasis.opendocument.graphics',\n 'org.oasis.opendocument.image': 'application/vnd.oasis.opendocument.image',\n 'org.oasis.opendocument.presentation': 'application/vnd.oasis.opendocument.presentation',\n 'org.oasis.opendocument.spreadsheet': 'application/vnd.oasis.opendocument.spreadsheet',\n 'org.oasis.opendocument.text': 'application/vnd.oasis.opendocument.text',\n 'org.oasis.opendocument.text-master': 'application/vnd.oasis.opendocument.text-master',\n 'org.oasis.opendocument.text-web': 'application/vnd.oasis.opendocument.text-web',\n 'org.tug.tex': 'text/tex',\n 'org.xiph.flac': 'audio/flac',\n 'org.xiph.ogg-theora': 'video/ogg',\n 'org.xiph.ogg-vorbis': 'audio/ogg',\n 'public.3gpp': 'video/3gpp',\n 'public.3gpp2': 'video/3gpp2',\n 'public.aifc-audio': 'audio/aiff',\n 'public.aiff-audio': 'audio/aiff',\n 'public.assembly-source': 'text/x-asm',\n 'public.avi': 'video/avi',\n 'public.c-header': 'text/x-c-header',\n 'public.cpio-archive': 'application/x-cpio',\n 'public.c-plus-plus-header': 'text/x-c++-hdr',\n 'public.c-plus-plus-source': 'application/x-cplusplus',\n 'public.csh-script': 'application/x-csh',\n 'public.c-source': 'text/x-c-code',\n 'public.css': 'text/css',\n 'public.dv': 'video/x-dv',\n 'public.flv': 'video/x-flv',\n 'public.html': 'text/html',\n 'public.iso-image': 'application/x-iso-image',\n 'public.jpeg': 'image/jpeg',\n 'public.jpeg2000': 'image/jp2',\n 'public.midi': 'audio/midi',\n 'public.mka': 'audio/x-matroska',\n 'public.mkv': 'video/x-matroska',\n 'public.mp3': 'audio/mp3',\n 'public.mpeg': 'video/mpeg',\n 'public.mpeg4': 'video/mp4',\n 'public.mpeg4-audio': 'audio/mp4',\n 'public.mpegts': 'video/MP2T',\n 'public.objective-c-plus-plus-source': 'text/x-objcppsrc',\n 'public.objective-c-source': 'text/x-objcsrc',\n 'public.opentype-font': 'font/opentype',\n 'public.perl-script': 'text/x-perl',\n 'public.php-script': 'text/php',\n 'public.plain-text': 'text/plain',\n 'public.png': 'image/png',\n 'public.python-script': 'text/x-python-script',\n 'public.rtf': 'text/rtf',\n 'public.shell-script': 'application/x-sh',\n 'public.tar-archive': 'application/tar',\n 'public.tiff': 'image/tiff',\n 'public.truetype-ttf-font': 'application/x-font-ttf',\n 'public.ulaw-audio': 'audio/au',\n 'public.vcard': 'text/vcard',\n 'public.webm': 'video/webm',\n 'public.xbitmap-image': 'image/xbm',\n 'public.xml': 'text/xml',\n 'unofficial.atom-feed': 'application/atom+xml',\n 'unofficial.m3u8-playlist': 'application/x-mpegURL',\n 'unofficial.opml': 'text/x-opml',\n 'unofficial.pls-playlist': 'audio/scpls',\n 'unofficial.rdf-feed': 'application/rdf+xml',\n 'unofficial.rss-feed': 'application/rss+xml',\n }\n\n utiExts: { [key: string]: string } = {\n jpg: 'public.jpeg',\n jpeg: 'public.jpeg',\n png: 'public.png',\n rtf: 'public.rtf',\n mpeg: 'public.mpeg',\n mpg: 'public.mpeg',\n html: 'public.html',\n htm: 'public.html',\n pdf: 'com.adobe.pdf',\n xls: 'com.microsoft.excel.xls',\n xlsx: 'com.microsoft.excel.xls',\n doc: 'com.microsoft.word.doc',\n docx: 'com.microsoft.word.doc',\n }\n\n utiDefs: { [key: string]: string } = {\n 'application/atom+xml': 'unofficial.atom-feed',\n 'application/bat': 'com.microsoft.windows-executable',\n 'application/binhex': 'com.apple.binhex-archive',\n 'application/binhex4': 'com.apple.binhex-archive',\n 'application/ecmascript': 'com.netscape.javascript-source',\n 'application/eps': 'com.adobe.encapsulated-postscript',\n 'application/excel': 'com.microsoft.excel.xls',\n 'application/exe': 'com.microsoft.windows-executable',\n 'application/gnutar': 'public.tar-archive',\n 'application/gzip': 'org.gnu.gnu-zip-archive',\n 'application/illustrator': 'com.adobe.illustrator.ai-image',\n 'application/indesign': 'com.adobe.indesign-image',\n 'application/java-archive': 'com.sun.java-archive',\n 'application/java-byte-code': 'com.sun.java-class',\n 'application/java': 'com.sun.java-class',\n 'application/javascript': 'com.netscape.javascript-source',\n 'application/jnlp': 'com.sun.java-web-start',\n 'application/latex': 'org.tug.tex',\n 'application/mac-binary': 'com.apple.macbinary-archive',\n 'application/mac-binhex': 'com.apple.binhex-archive',\n 'application/mac-binhex40': 'com.apple.binhex-archive',\n 'application/macbinary': 'com.apple.macbinary-archive',\n 'application/mspowerpoint': 'com.microsoft.powerpoint.ppt',\n 'application/msword': 'com.microsoft.word.doc',\n 'application/octet-stream': 'com.microsoft.windows-executable',\n 'application/pdf': 'com.adobe.pdf',\n 'application/photoshop': 'com.adobe.photoshop-image',\n 'application/php': 'public.php-script',\n 'application/plain': 'public.plain-text',\n 'application/postscript': 'com.adobe.postscript',\n 'application/powerpoint': 'com.microsoft.powerpoint.ppt',\n 'application/rar': 'com.rarlab.rar-archive',\n 'application/rdf+xml': 'unofficial.rdf-feed',\n 'application/rss+xml': 'unofficial.rss-feed',\n 'application/rtf': 'public.rtf',\n 'application/smil': 'com.real.smil',\n 'application/stuffit': 'com.allume.stuffit-archive',\n 'application/tar': 'public.tar-archive',\n 'application/tga': 'com.truevision.tga-image',\n 'application/vnd.fpx': 'com.kodak.flashpix.image',\n 'application/vnd.ms-excel': 'com.microsoft.excel.xls',\n 'application/vnd.ms-powerpoint': 'com.microsoft.powerpoint.ppt',\n 'application/vnd.oasis.opendocument.chart': 'org.oasis.opendocument.chart',\n 'application/vnd.oasis.opendocument.database': 'org.oasis.opendocument.database',\n 'application/vnd.oasis.opendocument.formula': 'org.oasis.opendocument.formula',\n 'application/vnd.oasis.opendocument.graphics-template': 'org.oasis.opendocument.graphics',\n 'application/vnd.oasis.opendocument.graphics': 'org.oasis.opendocument.graphics',\n 'application/vnd.oasis.opendocument.image': 'org.oasis.opendocument.image',\n 'application/vnd.oasis.opendocument.presentation-template': 'org.oasis.opendocument.presentation',\n 'application/vnd.oasis.opendocument.presentation': 'org.oasis.opendocument.presentation',\n 'application/vnd.oasis.opendocument.spreadsheet-template': 'org.oasis.opendocument.spreadsheet',\n 'application/vnd.oasis.opendocument.spreadsheet': 'org.oasis.opendocument.spreadsheet',\n 'application/vnd.oasis.opendocument.text-master': 'org.oasis.opendocument.text-master',\n 'application/vnd.oasis.opendocument.text-template': 'org.oasis.opendocument.text',\n 'application/vnd.oasis.opendocument.text-web': 'org.oasis.opendocument.text-web',\n 'application/vnd.oasis.opendocument.text': 'org.oasis.opendocument.text',\n 'application/vnd.rn-realmedia': 'com.real.realmedia',\n 'application/vnd.sun.xml.calc.template': 'org.neooffice.calc',\n 'application/vnd.sun.xml.calc': 'org.neooffice.calc',\n 'application/vnd.sun.xml.draw.template': 'org.neooffice.draw',\n 'application/vnd.sun.xml.draw': 'org.neooffice.draw',\n 'application/vnd.sun.xml.impress.template': 'org.neooffice.impress',\n 'application/vnd.sun.xml.impress': 'org.neooffice.impress',\n 'application/vnd.sun.xml.math': 'org.neooffice.math',\n 'application/vnd.sun.xml.writer.global': 'org.neooffice.global',\n 'application/vnd.sun.xml.writer.template': 'org.neooffice.writer',\n 'application/vnd.sun.xml.writer': 'org.neooffice.writer',\n 'application/vndms-excel': 'com.microsoft.excel.xls',\n 'application/vndms-powerpoint': 'com.microsoft.powerpoint.ppt',\n 'application/vndrn-realmedia': 'com.real.realmedia',\n 'application/x-apple-diskimage': 'com.apple.disk-image-udif',\n 'application/x-applescript': 'com.apple.applescript.script',\n 'application/x-bat': 'com.microsoft.windows-executable',\n 'application/x-binary': 'com.apple.macbinary-archive',\n 'application/x-binhex40': 'com.apple.binhex-archive',\n 'application/x-bittorrent': 'com.bittorrent.torrent',\n 'application/x-bzip2': 'org.bzip.bzip2-archive',\n 'application/x-cpio': 'public.cpio-archive',\n 'application/x-cplusplus': 'public.c-plus-plus-source',\n 'application/x-csh': 'public.csh-script',\n 'application/x-deb': 'org.debian.debian-package',\n 'application/x-debian-package': 'org.debian.debian-package',\n 'application/x-eps': 'com.adobe.encapsulated-postscript',\n 'application/x-excel': 'com.microsoft.excel.xls',\n 'application/x-exe': 'com.microsoft.windows-executable',\n 'application/x-flac': 'org.xiph.flac',\n 'application/x-font-ttf': 'public.truetype-ttf-font',\n 'application/x-font-type1': 'com.adobe.postscript-pfa-font',\n 'application/x-gtar': 'org.gnu.gnu-tar-archive',\n 'application/x-gzip': 'org.gnu.gnu-zip-archive',\n 'application/x-iso-image': 'public.iso-image',\n 'application/x-java-class': 'com.sun.java-class',\n 'application/x-java': 'com.sun.java-web-start',\n 'application/x-javascript': 'com.netscape.javascript-source',\n 'application/x-latex': 'org.tug.tex',\n 'application/x-mac-binhex40': 'com.apple.binhex-archive',\n 'application/x-macbinary': 'com.apple.macbinary-archive',\n 'application/x-midi': 'public.midi',\n 'application/x-mpegURL': 'unofficial.m3u8-playlist',\n 'application/x-ms-wmd': 'com.microsoft.windows-media-wmd',\n 'application/x-ms-wmz': 'com.microsoft.windows-media-wmz',\n 'application/x-msdos-program': 'com.microsoft.windows-executable',\n 'application/x-msdownload': 'com.microsoft.windows-executable',\n 'application/x-msexcel': 'com.microsoft.excel.xls',\n 'application/x-mspowerpoint': 'com.microsoft.powerpoint.ppt',\n 'application/x-pdf': 'com.adobe.pdf',\n 'application/x-perl': 'public.perl-script',\n 'application/x-php': 'public.php-script',\n 'application/x-quartzcomposer': 'com.apple.quartz-composer-composition',\n 'application/x-rar-compressed': 'com.rarlab.rar-archive',\n 'application/x-redhat-package': 'com.redhat.redhat-package',\n 'application/x-rpm': 'com.redhat.redhat-package',\n 'application/x-rtf': 'public.rtf',\n 'application/x-sh': 'public.shell-script',\n 'application/x-shellscript': 'public.shell-script',\n 'application/x-shockwave-flash': 'com.macromedia.shockwave-flash',\n 'application/x-sit': 'com.allume.stuffit-archive',\n 'application/x-smil': 'com.real.smil',\n 'application/x-soundfont': 'com.soundblaster.soundfont',\n 'application/x-stuffit': 'com.allume.stuffit-archive',\n 'application/x-tar': 'public.tar-archive',\n 'application/x-tex': 'org.tug.tex',\n 'application/x-texinfo': 'org.tug.tex',\n 'application/x-troff-msvideo': 'public.avi',\n 'application/x-zip-compressed': 'com.pkware.zip-archive',\n 'application/xhtml+xml': 'public.html',\n 'application/xml': 'public.xml',\n 'application/zip': 'com.pkware.zip-archive',\n 'audio/3gpp': 'public.3gpp',\n 'audio/3gpp2': 'public.3gpp2',\n 'audio/aiff': 'public.aiff-audio',\n 'audio/au': 'public.ulaw-audio',\n 'audio/basic': 'public.ulaw-audio',\n 'audio/flac': 'org.xiph.flac',\n 'audio/mid': 'public.midi',\n 'audio/midi': 'public.midi',\n 'audio/mp3': 'public.mp3',\n 'audio/mp4': 'public.mpeg4-audio',\n 'audio/mp4a-latm': 'public.mpeg4-audio',\n 'audio/mpeg': 'public.mp3',\n 'audio/mpeg3': 'public.mp3',\n 'audio/mpegurl': 'unofficial.m3u-playlist',\n 'audio/mpg': 'public.mp3',\n 'audio/ogg': 'org.xiph.ogg-vorbis',\n 'audio/scpls': 'unofficial.pls-playlist',\n 'audio/snd': 'public.ulaw-audio',\n 'audio/vnd.rn-realaudio': 'com.real.realaudio',\n 'audio/wav': 'com.microsoft.waveform-audio',\n 'audio/wave': 'com.microsoft.waveform-audio',\n 'audio/webm': 'public.webm',\n 'audio/x-adpcm': 'public.ulaw-audio',\n 'audio/x-aiff': 'public.aiff-audio',\n 'audio/x-au': 'public.ulaw-audio',\n 'audio/x-flac': 'org.xiph.flac',\n 'audio/x-matroska': 'public.mka',\n 'audio/x-mid': 'public.midi',\n 'audio/x-midi': 'public.midi',\n 'audio/x-mp3': 'public.mp3',\n 'audio/x-mpeg-3': 'public.mp3',\n 'audio/x-mpeg': 'public.mp3',\n 'audio/x-mpeg3': 'public.mp3',\n 'audio/x-mpegurl': 'unofficial.m3u-playlist',\n 'audio/x-mpg': 'public.mp3',\n 'audio/x-ms-wax': 'com.microsoft.windows-media-wax',\n 'audio/x-ms-wma': 'com.microsoft.windows-media-wma',\n 'audio/x-ogg': 'org.xiph.ogg-vorbis',\n 'audio/x-pn-realaudio-plugin': 'com.real.realaudio',\n 'audio/x-pn-realaudio': 'com.real.realaudio',\n 'audio/x-pn-wav': 'com.microsoft.waveform-audio',\n 'audio/x-realaudio': 'com.real.realmedia',\n 'audio/x-scpls': 'unofficial.pls-playlist',\n 'audio/x-wav': 'com.microsoft.waveform-audio',\n 'font/opentype': 'public.opentype-font',\n 'image/bmp': 'com.microsoft.bmp',\n 'image/efax': 'com.js.efx-fax',\n 'image/eps': 'com.adobe.encapsulated-postscript',\n 'image/fpx': 'com.kodak.flashpix.image',\n 'image/gif': 'com.compuserve.gif',\n 'image/indd': 'com.adobe.indesign-image',\n 'image/indesign': 'com.adobe.indesign-image',\n 'image/jp2': 'public.jpeg2000',\n 'image/jpeg': 'public.jpeg',\n 'image/ms-bmp': 'com.microsoft.bmp',\n 'image/photoshop': 'com.adobe.photoshop-image',\n 'image/pict': 'com.apple.pict',\n 'image/pipeg': 'public.jpeg',\n 'image/pjpeg': 'public.jpeg',\n 'image/png': 'public.png',\n 'image/psd': 'com.adobe.photoshop-image',\n 'image/sgi': 'com.sgi.sgi-image',\n 'image/targa': 'com.truevision.tga-image',\n 'image/tga': 'com.truevision.tga-image',\n 'image/tiff': 'public.tiff',\n 'image/vnd.djvu': 'com.lizardtech.djvu',\n 'image/vndfpx': 'com.kodak.flashpix.image',\n 'image/vndnet-fpx': 'com.kodak.flashpix.image',\n 'image/webp': 'public.webp',\n 'image/x-bitmap': 'com.microsoft.bmp',\n 'image/x-bmp': 'com.microsoft.bmp',\n 'image/x-djvu': 'com.lizardtech.djvu',\n 'image/x-eps': 'com.adobe.encapsulated-postscript',\n 'image/x-icon': 'com.microsoft.ico',\n 'image/x-indesign': 'com.adobe.indesign-image',\n 'image/x-macpict': 'com.apple.pict',\n 'image/x-ms-bmp': 'com.microsoft.bmp',\n 'image/x-photoshop': 'com.adobe.photoshop-image',\n 'image/x-pict': 'com.apple.pict',\n 'image/x-quicktime': 'com.apple.quicktime-image',\n 'image/x-tiff': 'public.tiff',\n 'image/x-windows-bmp': 'com.microsoft.bmp',\n 'image/x-xbitmap': 'com.microsoft.bmp',\n 'image/x-xbm': 'public.xbitmap-image',\n 'image/xbm': 'public.xbitmap-image',\n 'multipart/x-gzip': 'org.gnu.gnu-zip-archive',\n 'multipart/x-zip': 'com.pkware.zip-archive',\n 'music/crescendo': 'public.midi',\n 'text/calendar': 'com.apple.ical.ics',\n 'text/css': 'public.css',\n 'text/directory': 'public.vcard',\n 'text/ecmascript': 'com.netscape.javascript-source',\n 'text/html': 'public.html',\n 'text/javascript': 'com.netscape.javascript-source',\n 'text/php': 'public.php-script',\n 'text/plain': 'public.plain-text',\n 'text/richtext': 'public.rtf',\n 'text/rtf': 'public.rtf',\n 'text/ruby-script': 'public.ruby-script',\n 'text/tex': 'org.tug.tex',\n 'text/vcard': 'public.vcard',\n 'text/vnd.sun.j2me.app-descriptor': 'com.sun.java-app-descriptor',\n 'text/x-asm': 'public.assembly-source',\n 'text/x-c-code': 'public.c-source',\n 'text/x-c-header': 'public.c-header',\n 'text/x-c': 'public.c-source',\n 'text/x-c++-code': 'public.c-plus-plus-source',\n 'text/x-c++-hdr': 'public.c-plus-plus-header',\n 'text/x-c++-src': 'public.c-plus-plus-source',\n 'text/x-c++src': 'public.c-plus-plus-source',\n 'text/x-h': 'public.c-header',\n 'text/x-java-source': 'com.sun.java-source',\n 'text/x-latex': 'org.tug.tex',\n 'text/x-objcppsrc': 'public.objective-c-plus-plus-source',\n 'text/x-objcsrc': 'public.objective-c-source',\n 'text/x-opml': 'unofficial.opml',\n 'text/x-perl-script': 'public.perl-script',\n 'text/x-perl': 'public.perl-script',\n 'text/x-php-script': 'public.php-script',\n 'text/x-python-script': 'public.python-script',\n 'text/x-python': 'public.python-script',\n 'text/x-scriptcsh': 'public.csh-script',\n 'text/x-scriptperl-module': 'public.perl-script',\n 'text/x-scriptperl': 'public.perl-script',\n 'text/x-scriptphyton': 'public.python-script',\n 'text/x-scriptsh': 'public.shell-script',\n 'text/x-server-parsed-html': 'public.html',\n 'text/x-tex': 'org.tug.tex',\n 'text/x-vcalendar': 'com.apple.ical.vcs',\n 'text/x-vcard': 'public.vcard',\n 'text/xhtml': 'public.html',\n 'text/xml': 'public.xml',\n 'video/3gpp': 'public.3gpp',\n 'video/3gpp2': 'public.3gpp2',\n 'video/avi': 'public.avi',\n 'video/MP2T': 'public.mpegts',\n 'video/mp4': 'public.mpeg4',\n 'video/mp4v': 'public.mpeg4',\n 'video/mpeg': 'public.mpeg',\n 'video/mpg': 'public.mpeg',\n 'video/msvideo': 'public.avi',\n 'video/ogg': 'org.xiph.ogg-theora',\n 'video/quicktime': 'com.apple.quicktime-movie',\n 'video/webm': 'public.webm',\n 'video/x-dv': 'public.dv',\n 'video/x-flv': 'public.flv',\n 'video/x-m4v': 'public.mpeg4',\n 'video/x-matroska': 'public.mkv',\n 'video/x-mpeg': 'public.mpeg',\n 'video/x-mpg': 'public.mpeg',\n 'video/x-ms-asf-plugin': 'com.microsoft.advanced-systems-format',\n 'video/x-ms-asf': 'com.microsoft.advanced-systems-format',\n 'video/x-ms-asx': 'com.microsoft.advanced-stream-redirector',\n 'video/x-ms-wm': 'com.microsoft.windows-media-wm',\n 'video/x-ms-wmd': 'com.microsoft.windows-media-wmd',\n 'video/x-ms-wmp': 'com.microsoft.windows-media-wmp',\n 'video/x-ms-wmv': 'com.microsoft.windows-media-wmv',\n 'video/x-ms-wmx': 'com.microsoft.windows-media-wmx',\n 'video/x-ms-wmz': 'com.microsoft.windows-media-wmz',\n 'video/x-ms-wvx': 'com.microsoft.windows-media-wvx',\n 'video/x-msvideo': 'public.avi',\n 'video/x-ogg': 'org.xiph.ogg-theora',\n 'x-msdos-program': 'com.microsoft.windows-executable',\n 'x-music/x-midi': 'public.midi',\n }\n dataOwnerApi: IccDataOwnerXApi\n authenticationProvider: AuthenticationProvider\n\n constructor(\n host: string,\n headers: { [key: string]: string },\n private crypto: IccCryptoXApi,\n private authApi: IccAuthApi,\n 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.fetchImpl = fetchImpl\n this.authenticationProvider = authenticationProvider\n this.dataOwnerApi = dataOwnerApi\n }\n\n override get headers(): Promise<Array<XHR.Header>> {\n return super.headers.then((h) => this.crypto.accessControlKeysHeaders.addAccessControlKeysHeaders(h, EntityWithDelegationTypeName.Document))\n }\n\n /**\n * Creates a new instance of document with initialised encryption metadata (not in the database).\n * @param user the current user.\n * @param message the message this document refers to.\n * @param c initialised data for the document. 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 * - preferredSfk: secret id of the message to use as the secret foreign key to use for the document. The default value will be a\n * secret id of the message known by the topmost parent in the current data owner hierarchy.\n * - alternateRootDelegation: by default a new entity is created with a root delegation from self to self. In keyless mode this is not possible,\n * and instead the root delegation will be from self to another. You have to specify which delegate will be part of the root delegation.\n * @return a new instance of document.\n */\n async newInstance(\n user: models.User,\n message?: models.Message,\n c: any = {},\n options: {\n additionalDelegates?: { [dataOwnerId: string]: AccessLevelEnum }\n sfkOption?: SecretIdUseOption\n alternateRootDelegation?: string\n } = {}\n ) {\n const document = {\n ...(c ?? {}),\n _type: 'org.taktik.icure.entities.Document',\n id: c?.id ?? this.crypto.primitives.randomUuid(),\n created: c?.created ?? new Date().getTime(),\n modified: c?.modified ?? new Date().getTime(),\n responsible: c?.responsible ?? (this.autofillAuthor ? this.dataOwnerApi.getDataOwnerIdOf(user) : undefined),\n author: c?.author ?? (this.autofillAuthor ? user.id : undefined),\n codes: c?.codes ?? [],\n tags: c?.tags ?? [],\n }\n\n const ownerId = this.dataOwnerApi.getDataOwnerIdOf(user)\n if (ownerId !== (await this.dataOwnerApi.getCurrentDataOwnerId())) throw new Error('Can only initialise entities as current data owner.')\n const sfk = message\n ? await this.crypto.xapi.resolveSecretIdUseOptions(\n { entity: message, type: EntityWithDelegationTypeName.Message },\n options.sfkOption ?? SecretIdUseOption.UseAnySharedWithParent\n )\n : []\n const extraDelegations = {\n ...Object.fromEntries(\n [...(user.autoDelegations?.all ?? []), ...(user.autoDelegations?.medicalInformation ?? [])].map((d) => [d, AccessLevelEnum.WRITE])\n ),\n ...(options?.additionalDelegates ?? {}),\n }\n return new models.Document(\n await this.crypto.xapi\n .entityWithInitialisedEncryptedMetadata(\n document,\n EntityWithDelegationTypeName.Document,\n message?.id,\n sfk,\n true,\n extraDelegations,\n options.alternateRootDelegation\n )\n .then((x) => x.updatedEntity)\n )\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * @deprecated use {@link findIdsByMessage} instead.\n */\n async findByMessage(hcpartyId: string, message: models.Message) {\n const extractedKeys = await this.crypto.xapi.secretIdsOf({ entity: message, type: EntityWithDelegationTypeName.Message }, hcpartyId)\n const topmostParentId = (await this.dataOwnerApi.getCurrentDataOwnerHierarchyIds())[0]\n let documents: Array<models.Document> = await this.findDocumentsByHCPartyPatientForeignKeys(topmostParentId, _.uniq(extractedKeys))\n return await this.decrypt(hcpartyId, documents)\n }\n\n /**\n * Same as {@link findByMessage} but it will only return the ids of the contacts. It can also filter the documents where Document.created is between\n * startDate and endDate in ascending or descending order by that field. (default: ascending).\n */\n async findIdsByMessage(hcpartyId: string, message: models.Message, startDate?: number, endDate?: number, descending?: boolean): Promise<string[]> {\n const extractedKeys = await this.crypto.xapi.secretIdsOf({ entity: message, type: EntityWithDelegationTypeName.Message }, hcpartyId)\n const topmostParentId = (await this.dataOwnerApi.getCurrentDataOwnerHierarchyIds())[0]\n return this.findDocumentIdsByDataOwnerSecretForeignKey(topmostParentId, _.uniq(extractedKeys), startDate, endDate, descending)\n }\n\n // Note: this is only for dealing with legacy documents: new document are not encrypted, only their attachments are\n async decrypt(hcpartyId: string, documents: Array<models.Document>): Promise<Array<models.Document>> {\n const res: models.Document[] = []\n for (const document of documents) {\n const keys = await this.crypto.xapi.encryptionKeysOf({ entity: document, type: EntityWithDelegationTypeName.Document }, undefined)\n if (!keys.length) {\n console.log('Cannot decrypt document', document.id)\n res.push(document)\n } else if (keys.length && (document.encryptedSelf || document.encryptedAttachment)) {\n const key = await this.crypto.primitives.AES.importKey('raw', hex2ua(keys[0]))\n res.push(\n await Promise.all([\n document.encryptedSelf\n ? new Promise((resolve: (value: ArrayBuffer | null) => any) => {\n this.crypto.primitives.AES.decrypt(key, string2ua(a2b(document.encryptedSelf!))).then(resolve, () => {\n console.log('Cannot decrypt document', document.id)\n resolve(null)\n })\n })\n : Promise.resolve(null),\n document.encryptedAttachment\n ? new Promise((resolve: (value: ArrayBuffer | null) => any) => {\n this.crypto.primitives.AES.decrypt(key, document.encryptedAttachment!).then(resolve, () => {\n console.log('Cannot decrypt document', document.id)\n resolve(null)\n })\n })\n : Promise.resolve(null),\n ]).then((decrypted: [ArrayBuffer | null, ArrayBuffer | null]) => {\n let updatedDocument = { ...document }\n if (decrypted) {\n if (decrypted[0]) {\n updatedDocument = _.extend(document, JSON.parse(ua2string(decrypted[0])))\n }\n if (decrypted[1]) {\n updatedDocument.decryptedAttachment = decrypted[1]\n }\n }\n return updatedDocument\n })\n )\n } else {\n res.push(document)\n }\n }\n return res\n }\n\n //prettier-ignore\n getAttachmentAs(documentId: string, attachmentId: string, returnType: \"application/octet-stream\", enckeys?: string, fileName?: string): Promise<ArrayBuffer>\n //prettier-ignore\n getAttachmentAs(documentId: string, attachmentId: string, returnType: \"text/plain\", enckeys?: string, fileName?: string): Promise<string>\n //prettier-ignore\n getAttachmentAs(documentId: string, attachmentId: string, returnType: \"application/json\", enckeys?: string, fileName?: string): Promise<any>\n /**\n * @deprecated use getMainAttachmentAs instead\n */\n async getAttachmentAs(\n documentId: string,\n attachmentId: string,\n returnType: 'application/octet-stream' | 'text/plain' | 'application/json',\n enckeys?: string,\n fileName?: string\n ): Promise<any> {\n if (!!enckeys || !!fileName) {\n console.warn('Using getAttachmentAs method with a value for enckeys or fileName does nothing anymore.')\n }\n return this.getMainAttachmentAs(documentId, returnType)\n }\n\n //prettier-ignore\n getMainAttachmentAs(documentId: string, returnType: \"application/octet-stream\"): Promise<ArrayBuffer>\n //prettier-ignore\n getMainAttachmentAs(documentId: string, returnType: \"text/plain\"): Promise<string>\n //prettier-ignore\n getMainAttachmentAs(documentId: string, returnType: \"application/json\"): Promise<any>\n //prettier-ignore\n getMainAttachmentAs(documentId: string, returnType: 'application/octet-stream' | 'text/plain' | 'application/json'): Promise<any>\n async getMainAttachmentAs(documentId: string, returnType: 'application/octet-stream' | 'text/plain' | 'application/json'): Promise<any> {\n const url = this.host + `/document/${documentId}/attachment` + '?ts=' + new Date().getTime()\n return XHR.sendCommand('GET', url, await this.headers, null, this.fetchImpl, returnType, this.authenticationProvider.getAuthService())\n .then((doc) => doc.body)\n .catch((err) => this.handleError(err))\n }\n\n //prettier-ignore\n getAndTryDecryptMainAttachmentAs(document: models.Document, returnType: \"application/octet-stream\"): Promise<ArrayBuffer | undefined>\n //prettier-ignore\n getAndTryDecryptMainAttachmentAs(document: models.Document, returnType: \"text/plain\"): Promise<string | undefined>\n //prettier-ignore\n getAndTryDecryptMainAttachmentAs(document: models.Document, returnType: \"application/json\"): Promise<any | undefined>\n //prettier-ignore\n getAndTryDecryptMainAttachmentAs(document: models.Document, returnType: 'application/octet-stream' | 'text/plain' | 'application/json'): Promise<any | undefined>\n async getAndTryDecryptMainAttachmentAs(\n document: models.Document,\n returnType: 'application/octet-stream' | 'text/plain' | 'application/json'\n ): Promise<any | undefined> {\n const key = (await this.crypto.xapi.encryptionKeysOf({ entity: document, type: EntityWithDelegationTypeName.Document }, undefined))[0]\n if (!key) return undefined\n const tryParse = this.parserFor(returnType)\n const attachmentInfo = await this.getAndTryDecryptDocumentAttachment(document, (decrypted) => Promise.resolve(tryParse(decrypted) !== undefined))\n if (attachmentInfo.wasDecrypted) {\n return tryParse(attachmentInfo.data)\n } else return undefined\n }\n private parserFor(returnType: 'application/octet-stream' | 'text/plain' | 'application/json'): (data: ArrayBuffer) => any | undefined {\n if (returnType === 'application/octet-stream') {\n return (data) => data\n } else if (returnType === 'text/plain') {\n return (data) => {\n try {\n return ua2utf8(data)\n } catch (e) {\n return undefined\n }\n }\n } else if (returnType === 'application/json') {\n return (data) => {\n try {\n return JSON.parse(ua2utf8(data))\n } catch (e) {\n return undefined\n }\n }\n } else throw new Error(`Unsupported type ${returnType}`)\n }\n\n // noinspection JSUnusedGlobalSymbols\n uti(mimeType: string, extension: string) {\n return (mimeType && mimeType !== 'application/octet-stream' ? this.utiDefs[mimeType] : this.utiExts[extension]) || this.utiDefs[mimeType]\n }\n\n // noinspection JSUnusedGlobalSymbols\n mimeType(uti: string) {\n return this.utiRevDefs[uti]\n }\n\n /**\n * Adds an attachment to a document, encrypting it on client side using the encryption keys of the provided document.\n * @param document a document.\n * @param attachment a new main attachment for the document.\n * @param utis an array of UTIs for the attachment. The first element will be considered as the main UTI for the document. If provided and non-empty\n * overrides existing values.\n * @return the updated document.\n */\n async encryptAndSetDocumentAttachment(document: models.Document, attachment: ArrayBuffer | Uint8Array, utis?: string[]): Promise<models.Document> {\n if (!document.rev) throw new Error('Cannot set attachment on document without rev')\n const { encryptedData, updatedEntity } = await this.crypto.xapi.encryptDataOf(document, EntityWithDelegationTypeName.Document, attachment, (d) =>\n this.modifyDocument(d)\n )\n return await this.setMainDocumentAttachment(document.id!, updatedEntity?.rev ?? document.rev, encryptedData, utis, true)\n }\n\n /**\n * Adds an unencrypted attachment to a document.\n * @param document a document.\n * @param attachment a new main attachment for the document.\n * @param utis an array of UTIs for the attachment. The first element will be considered as the main UTI for the document. If provided and non-empty\n * overrides existing values.\n * @return the updated document.\n */\n async setClearDocumentAttachment(document: models.Document, attachment: ArrayBuffer | Uint8Array, utis?: string[]): Promise<models.Document> {\n if (!document.rev) throw new Error('Cannot set attachment on document without rev')\n return await this.setMainDocumentAttachment(document.id!, document.rev, attachment, utis, false)\n }\n\n /**\n * Adds a secondary attachment to a document, encrypting it on client side using the encryption keys of the provided document.\n * @param document a document.\n * @param secondaryAttachmentKey key for the secondary attachment.\n * @param attachment a new secondary attachment for the document.\n * @param utis an array of UTIs for the attachment. The first element will be considered as the main UTI for the document. If provided and non-empty\n * overrides existing values.\n * @return the updated document.\n */\n async encryptAndSetSecondaryDocumentAttachment(\n document: models.Document,\n secondaryAttachmentKey: string,\n attachment: ArrayBuffer | Uint8Array,\n utis?: string[]\n ): Promise<models.Document> {\n if (!document.rev) throw new Error('Cannot set attachment on document without rev')\n const { encryptedData, updatedEntity } = await this.crypto.xapi.encryptDataOf(document, EntityWithDelegationTypeName.Document, attachment, (d) =>\n this.modifyDocument()\n )\n return await this.setSecondaryAttachment(document.id!, secondaryAttachmentKey, updatedEntity?.rev ?? document.rev!, encryptedData, utis, true)\n }\n\n /**\n * Adds an unencrypted secondary attachment to a document.\n * @param document a document.\n * @param secondaryAttachmentKey key for the secondary attachment.\n * @param attachment a new secondary attachment for the document.\n * @param utis an array of UTIs for the attachment. The first element will be considered as the main UTI for the document. If provided and non-empty\n * overrides existing values.\n * @return the updated document.\n */\n async setClearSecondaryDocumentAttachment(\n document: models.Document,\n secondaryAttachmentKey: string,\n attachment: ArrayBuffer | Uint8Array,\n utis?: string[]\n ): Promise<models.Document> {\n return await this.setSecondaryAttachment(document.id!, secondaryAttachmentKey, document.rev!, attachment, utis, false)\n }\n\n /**\n * Gets the main attachment of a document and tries to decrypt it using the encryption keys of the document, throwing an error if the operation fails.\n * @param document a document.\n * @param validator optionally a validator function which checks if the decryption was successful. In cases where the document has many encryption\n * keys and it is unclear which one should be used this function can help to detect bad decryptions.\n * @return the decrypted attachment, if it could be decrypted, else the encrypted attachment.\n */\n async getAndDecryptDocumentAttachment(\n document: models.Document,\n validator: (decrypted: ArrayBuffer) => Promise<boolean> = () => Promise.resolve(true)\n ): Promise<ArrayBuffer> {\n const retrieved = await this.getAndTryDecryptDocumentAttachment(document, (x) => validator(x))\n if (!retrieved.wasDecrypted) throw new Error(`No valid key found to decrypt data of document ${document.id}.`)\n return retrieved.data\n }\n\n /**\n * Gets the main attachment of a document and tries to decrypt it using the encryption keys of the document.\n * @param document a document.\n * @param validator optionally a validator function which checks if the decryption was successful. In cases where the document has many encryption\n * keys and it is unclear which one should be used this function can help to detect bad decryptions.\n * @return an object containing:\n * - data: the decrypted attachment, if it could be decrypted, else the encrypted attachment.\n * - wasDecrypted: if the data was successfully decrypted or not\n */\n async getAndTryDecryptDocumentAttachment(\n document: models.Document,\n validator: (decrypted: ArrayBuffer) => Promise<boolean> = () => Promise.resolve(true)\n ): Promise<{ data: ArrayBuffer; wasDecrypted: boolean }> {\n return await this.crypto.xapi.tryDecryptDataOf(\n { entity: document, type: EntityWithDelegationTypeName.Document },\n await this.getRawMainDocumentAttachment(document.id!),\n (x) => validator(x)\n )\n }\n\n /**\n * Gets the secondary attachment of a document and tries to decrypt it using the encryption keys of the document, throwing an error if the operation fails.\n * @param document a document.\n * @param secondaryAttachmentKey key of the secondary attachment.\n * @param validator optionally a validator function which checks if the decryption was successful. In cases where the document has many encryption\n * keys and it is unclear which one should be used this function can help to detect bad decryptions.\n * @return the decrypted attachment.\n */\n async getAndDecryptSecondaryDocumentAttachment(\n document: models.Document,\n secondaryAttachmentKey: string,\n validator: (decrypted: ArrayBuffer) => Promise<boolean> = () => Promise.resolve(true)\n ): Promise<ArrayBuffer> {\n const { data, wasDecrypted } = await this.getAndTryDecryptSecondaryDocumentAttachment(document, secondaryAttachmentKey, (x) => validator(x))\n if (!wasDecrypted) throw new Error(`No valid key found to decrypt data of document ${document.id}.`)\n return data\n }\n\n /**\n * Gets the secondary attachment of a document and tries to decrypt it using the encryption keys of the document.\n * @param document a document.\n * @param secondaryAttachmentKey key of the secondary attachment.\n * @param validator optionally a validator function which checks if the decryption was successful. In cases where the document has many encryption\n * keys and it is unclear which one should be used this function can help to detect bad decryptions.\n * @return an object containing:\n * - data: the decrypted attachment, if it could be decrypted, else the encrypted attachment.\n * - wasDecrypted: if the data was successfully decrypted or not\n */\n async getAndTryDecryptSecondaryDocumentAttachment(\n document: models.Document,\n secondaryAttachmentKey: string,\n validator: (decrypted: ArrayBuffer) => Promise<boolean> = () => Promise.resolve(true)\n ): Promise<{ data: ArrayBuffer; wasDecrypted: boolean }> {\n return await this.crypto.xapi.tryDecryptDataOf(\n { entity: document, type: EntityWithDelegationTypeName.Document },\n await this.getSecondaryAttachment(document.id!, secondaryAttachmentKey),\n (x) => validator(x)\n )\n }\n\n /**\n * @param document a document\n * @return the id of the message that the document refers to, retrieved from the encrypted metadata. Normally there should only be one element\n * in the returned array, but in case of entity merges there could be multiple values.\n */\n async decryptMessageIdOf(document: models.Document): Promise<string[]> {\n return this.crypto.xapi.owningEntityIdsOf({ entity: document, type: EntityWithDelegationTypeName.Document }, undefined)\n }\n\n /**\n * @return if the logged data owner has write access to the content of the given document\n */\n async hasWriteAccess(document: models.Document): Promise<boolean> {\n return this.crypto.xapi.hasWriteAccess({ entity: document, type: EntityWithDelegationTypeName.Document })\n }\n\n /**\n * Share an existing document with other data owners, allowing them to access the non-encrypted data of the document 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 document.\n * @param document the document to share.\n * @param options optional parameters to customize the sharing behaviour:\n * - shareSecretIds: specifies which secret ids of the entity should be shared. If not provided all secret ids available to the current user will be shared\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}).\n * - shareMessageId: specifies if the id of the message that this document refers to should be shared with the delegate (defaults to\n * {@link ShareMetadataBehaviour.IF_AVAILABLE}).\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 document: models.Document,\n options: {\n shareSecretIds?: string[]\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n shareMessageId?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n } = {}\n ): Promise<models.Document> {\n return this.shareWithMany(document, { [delegateId]: options })\n }\n\n /**\n * Share an existing document with other data owners, allowing them to access the non-encrypted data of the document and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param document the document 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 * - shareSecretIds: specifies which secret ids of the entity should be shared. If not provided all secret ids available to the current user will be shared\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}).\n * - shareMessageId: specifies if the id of the message that this document refers to should be shared with the delegate (defaults to\n * {@link ShareMetadataBehaviour.IF_AVAILABLE}).\n * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.\n * @return the updated entity.\n */\n async shareWithMany(\n document: models.Document,\n delegates: {\n [delegateId: string]: {\n shareSecretIds?: string[]\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n shareMessageId?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n }\n }\n ): Promise<models.Document> {\n return (await this.tryShareWithMany(document, delegates)).updatedEntityOrThrow\n }\n /**\n * Share an existing document with other data owners, allowing them to access the non-encrypted data of the document and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param document the document 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 * - shareSecretIds: specifies which secret ids of the entity should be shared. If not provided all secret ids available to the current user will be shared\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}).\n * - shareMessageId: specifies if the id of the message that this document refers to should be shared with the delegate (defaults to\n * {@link ShareMetadataBehaviour.IF_AVAILABLE}).\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 document: models.Document,\n delegates: {\n [delegateId: string]: {\n shareSecretIds?: string[]\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n shareMessageId?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n }\n }\n ): Promise<ShareResult<models.Document>> {\n const self = await this.dataOwnerApi.getCurrentDataOwnerId()\n // All entities should have an encryption key.\n const entityWithEncryptionKey = await this.crypto.xapi.ensureEncryptionKeysInitialised(document, EntityWithDelegationTypeName.Document)\n const updatedEntity = entityWithEncryptionKey ? await this.modifyDocument(entityWithEncryptionKey) : document\n return this.crypto.xapi\n .simpleShareOrUpdateEncryptedEntityMetadata(\n {\n entity: updatedEntity,\n type: EntityWithDelegationTypeName.Document,\n },\n Object.fromEntries(\n Object.entries(delegates).map(([delegateId, options]) => [\n delegateId,\n {\n requestedPermissions: options.requestedPermissions,\n shareEncryptionKeys: options.shareEncryptionKey,\n shareOwningEntityIds: options.shareMessageId,\n shareSecretIds: options.shareSecretIds,\n },\n ])\n ),\n (x) => this.bulkShareDocument(x)\n )\n .then((r) => r)\n }\n\n getDataOwnersWithAccessTo(\n entity: models.Document\n ): Promise<{ permissionsByDataOwnerId: { [p: string]: AccessLevelEnum }; hasUnknownAnonymousDataOwners: boolean }> {\n return this.crypto.delegationsDeAnonymization.getDataOwnersWithAccessTo({ entity, type: EntityWithDelegationTypeName.Document })\n }\n\n getEncryptionKeysOf(entity: models.Document): Promise<string[]> {\n return this.crypto.xapi.encryptionKeysOf({ entity, type: EntityWithDelegationTypeName.Document }, undefined)\n }\n\n createDelegationDeAnonymizationMetadata(entity: models.Document, delegates: string[]): Promise<void> {\n return this.crypto.delegationsDeAnonymization.createOrUpdateDeAnonymizationInfo(\n { entity, type: EntityWithDelegationTypeName.Document },\n delegates\n )\n }\n}\n"]}
1
+ {"version":3,"file":"icc-document-x-api.js","sourceRoot":"","sources":["../../icc-x-api/icc-document-x-api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wCAAuD;AAGvD,4BAA2B;AAC3B,4CAAwC;AACxC,kDAAiD;AAEjD,uDAAiF;AAEjF,0EAAgG;AAChG,wEAAoE;AAKpE,mCAAsD;AACtD,IAAO,eAAe,GAAG,mCAAgB,CAAC,eAAe,CAAA;AAEzD,kEAA8D;AAE9D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AAE,oCAA4B,CAAC,QAAQ,EAAE,CAAC,CAAA;IAClI,CAAC;IAED,mBAAmB,CAAC,MAAuB;QACzC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,oCAA4B,CAAC,QAAQ,EAAE,EAAE,SAAS,CAAC,CAAA;IAC9G,CAAC;IAED,uCAAuC,CAAC,MAAuB,EAAE,SAAmB;QAClF,OAAO,IAAI,CAAC,MAAM,CAAC,0BAA0B,CAAC,iCAAiC,CAC7E,EAAE,MAAM,EAAE,IAAI,EAAE,oCAA4B,CAAC,QAAQ,EAAE,EACvD,SAAS,CACV,CAAA;IACH,CAAC;CACF;AAziCD,0CAyiCC","sourcesContent":["import { IccAuthApi, IccDocumentApi } from '../icc-api'\nimport { IccCryptoXApi } from './icc-crypto-x-api'\n\nimport * as _ from 'lodash'\nimport { XHR } from '../icc-api/api/XHR'\nimport * as models from '../icc-api/model/models'\n\nimport { a2b, hex2ua, string2ua, ua2string, ua2utf8 } from './utils/binary-utils'\nimport { IccDataOwnerXApi } from './icc-data-owner-x-api'\nimport { AuthenticationProvider, NoAuthenticationProvider } from './auth/AuthenticationProvider'\nimport { SecureDelegation } from '../icc-api/model/SecureDelegation'\nimport { ShareMetadataBehaviour } from './crypto/ShareMetadataBehaviour'\nimport { ShareResult } from './utils/ShareResult'\nimport { EntityShareRequest } from '../icc-api/model/requests/EntityShareRequest'\nimport { EncryptedEntityXApi } from './basexapi/EncryptedEntityXApi'\nimport { EntityWithDelegationTypeName } from './utils'\nimport AccessLevelEnum = SecureDelegation.AccessLevelEnum\nimport RequestedPermissionEnum = EntityShareRequest.RequestedPermissionEnum\nimport { SecretIdUseOption } from './crypto/SecretIdUseOption'\n\n// noinspection JSUnusedGlobalSymbols\nexport class IccDocumentXApi extends IccDocumentApi implements EncryptedEntityXApi<models.Document> {\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response>\n\n /** maps invalid UTI values to corresponding MIME type for backward-compatibility (pre-v1.0.117) */\n compatUtiRevDefs: { [key: string]: string } = {\n 'com.adobe.encapsulatedPostscript': 'image/eps',\n 'com.adobe.illustrator.aiImage': 'application/illustrator',\n 'com.adobe.indesignImage': 'image/indesign',\n 'com.adobe.photoshopImage': 'image/psd',\n 'com.adobe.postscriptPfaFont': 'application/x-font-type1',\n 'com.adobe.postscriptPfbFont': 'application/x-font-type1',\n 'com.allume.stuffitArchive': 'application/stuffit',\n 'com.apple.binhexArchive': 'application/binhex',\n 'com.apple.diskImageUdif': 'application/x-apple-diskimage',\n 'com.apple.macbinaryArchive': 'application/macbinary',\n 'com.apple.quartzComposerComposition': 'application/x-quartzcomposer',\n 'com.apple.quicktimeImage': 'image/x-quicktime',\n 'com.apple.quicktimeMovie': 'video/quicktime',\n 'com.js.efxFax': 'image/efax',\n 'com.macromedia.shockwaveFlash': 'application/x-shockwave-flash',\n 'com.microsoft.advancedStreamRedirector': 'video/x-ms-asx',\n 'com.microsoft.advancedSystemsFormat': 'video/x-ms-asf',\n 'com.microsoft.waveformAudio': 'audio/wave',\n 'com.microsoft.windowsDynamicLinkLibrary': 'application/x-msdownload',\n 'com.microsoft.windowsExecutable': 'application/exe',\n 'com.microsoft.windowsMediaWax': 'audio/x-ms-wax',\n 'com.microsoft.windowsMediaWm': 'video/x-ms-wm',\n 'com.microsoft.windowsMediaWma': 'audio/x-ms-wma',\n 'com.microsoft.windowsMediaWmd': 'video/x-ms-wmd',\n 'com.microsoft.windowsMediaWmp': 'video/x-ms-wmp',\n 'com.microsoft.windowsMediaWmv': 'video/x-ms-wmv',\n 'com.microsoft.windowsMediaWmx': 'video/x-ms-wmx',\n 'com.microsoft.windowsMediaWmz': 'video/x-ms-wmz',\n 'com.microsoft.windowsMediaWvx': 'video/x-ms-wvx',\n 'com.netscape.javascriptSource': 'text/javascript',\n 'com.pkware.zipArchive': 'application/zip',\n 'com.rarlab.rarArchive': 'application/rar',\n 'com.redhat.redhatPackage': 'application/x-redhat-package',\n 'com.sgi.sgiImage': 'image/sgi',\n 'com.sun.javaAppDescriptor': 'text/vnd.sun.j2me.app-descriptor',\n 'com.sun.javaArchive': 'application/java-archive',\n 'com.sun.javaClass': 'application/java',\n 'com.sun.javaSource': 'text/x-java-source',\n 'com.sun.javaWebStart': 'application/jnlp',\n 'com.truevision.tgaImage': 'image/tga',\n 'org.bzip.bzip2Archive': 'application/x-bzip2',\n 'org.debian.debianPackage': 'application/x-debian-package',\n 'org.gnu.gnuTarArchive': 'application/x-gtar',\n 'org.gnu.gnuZipArchive': 'application/gzip',\n 'org.oasis.opendocument.textMaster': 'application/vnd.oasis.opendocument.text-master',\n 'org.oasis.opendocument.textWeb': 'application/vnd.oasis.opendocument.text-web',\n 'org.xiph.oggTheora': 'video/ogg',\n 'org.xiph.oggVorbis': 'audio/ogg',\n 'public.aifcAudio': 'audio/aiff',\n 'public.aiffAudio': 'audio/aiff',\n 'public.assemblySource': 'text/x-asm',\n 'public.cHeader': 'text/x-c-header',\n 'public.cpioArchive': 'application/x-cpio',\n 'public.cPlusPlusHeader': 'text/x-c++-hdr',\n 'public.cPlusPlusSource': 'application/x-cplusplus',\n 'public.cshScript': 'application/x-csh',\n 'public.cSource': 'text/x-c-code',\n 'public.isoImage': 'application/x-iso-image',\n 'public.mpeg4Audio': 'audio/mp4',\n 'public.objectiveCPlusPlusSource': 'text/x-objcppsrc',\n 'public.objectiveCSource': 'text/x-objcsrc',\n 'public.opentypeFont': 'font/opentype',\n 'public.perlScript': 'text/x-perl',\n 'public.phpScript': 'text/php',\n 'public.plainText': 'text/plain',\n 'public.pythonScript': 'text/x-python-script',\n 'public.shellScript': 'application/x-sh',\n 'public.tarArchive': 'application/tar',\n 'public.truetypeTtfFont': 'application/x-font-ttf',\n 'public.ulawAudio': 'audio/au',\n 'public.xbitmapImage': 'image/xbm',\n 'unofficial.atomFeed': 'application/atom+xml',\n 'unofficial.m3u8Playlist': 'application/x-mpegURL',\n 'unofficial.plsPlaylist': 'audio/scpls',\n 'unofficial.rdfFeed': 'application/rdf+xml',\n 'unofficial.rssFeed': 'application/rss+xml',\n }\n\n utiRevDefs: { [key: string]: string } = {\n ...this.compatUtiRevDefs,\n 'com.adobe.encapsulated-postscript': 'image/eps',\n 'com.adobe.illustrator.ai-image': 'application/illustrator',\n 'com.adobe.indesign-image': 'image/indesign',\n 'com.adobe.pdf': 'application/pdf',\n 'com.adobe.photoshop-image': 'image/psd',\n 'com.adobe.postscript': 'application/postscript',\n 'com.adobe.postscript-pfa-font': 'application/x-font-type1',\n 'com.adobe.postscript-pfb-font': 'application/x-font-type1',\n 'com.allume.stuffit-archive': 'application/stuffit',\n 'com.apple.applescript.script': 'application/x-applescript',\n 'com.apple.applescript.text': 'application/x-applescript',\n 'com.apple.binhex-archive': 'application/binhex',\n 'com.apple.disk-image-udif': 'application/x-apple-diskimage',\n 'com.apple.ical.ics': 'text/calendar',\n 'com.apple.ical.vcs': 'text/x-vcalendar',\n 'com.apple.macbinary-archive': 'application/macbinary',\n 'com.apple.pict': 'image/pict',\n 'com.apple.quartz-composer-composition': 'application/x-quartzcomposer',\n 'com.apple.quicktime-image': 'image/x-quicktime',\n 'com.apple.quicktime-movie': 'video/quicktime',\n 'com.bittorrent.torrent': 'application/x-bittorrent',\n 'com.compuserve.gif': 'image/gif',\n 'com.js.efx-fax': 'image/efax',\n 'com.kodak.flashpix.image': 'image/vndfpx',\n 'com.lizardtech.djvu': 'image/vnd.djvu',\n 'com.macromedia.shockwave-flash': 'application/x-shockwave-flash',\n 'com.microsoft.advanced-stream-redirector': 'video/x-ms-asx',\n 'com.microsoft.advanced-systems-format': 'video/x-ms-asf',\n 'com.microsoft.bmp': 'image/bmp',\n 'com.microsoft.excel.xls': 'application/excel',\n 'com.microsoft.ico': 'image/x-icon',\n 'com.microsoft.powerpoint.ppt': 'application/powerpoint',\n 'com.microsoft.waveform-audio': 'audio/wave',\n 'com.microsoft.windows-dynamic-link-library': 'application/x-msdownload',\n 'com.microsoft.windows-executable': 'application/exe',\n 'com.microsoft.windows-media-wax': 'audio/x-ms-wax',\n 'com.microsoft.windows-media-wm': 'video/x-ms-wm',\n 'com.microsoft.windows-media-wma': 'audio/x-ms-wma',\n 'com.microsoft.windows-media-wmd': 'video/x-ms-wmd',\n 'com.microsoft.windows-media-wmp': 'video/x-ms-wmp',\n 'com.microsoft.windows-media-wmv': 'video/x-ms-wmv',\n 'com.microsoft.windows-media-wmx': 'video/x-ms-wmx',\n 'com.microsoft.windows-media-wmz': 'video/x-ms-wmz',\n 'com.microsoft.windows-media-wvx': 'video/x-ms-wvx',\n 'com.microsoft.word.doc': 'application/msword',\n 'com.netscape.javascript-source': 'text/javascript',\n 'com.pkware.zip-archive': 'application/zip',\n 'com.rarlab.rar-archive': 'application/rar',\n 'com.real.realaudio': 'audio/vnd.rn-realaudio',\n 'com.real.realmedia': 'application/vnd.rn-realmedia',\n 'com.real.smil': 'application/smil',\n 'com.redhat.redhat-package': 'application/x-redhat-package',\n 'com.sgi.sgi-image': 'image/sgi',\n 'com.soundblaster.soundfont': 'application/x-soundfont',\n 'com.sun.java-app-descriptor': 'text/vnd.sun.j2me.app-descriptor',\n 'com.sun.java-archive': 'application/java-archive',\n 'com.sun.java-class': 'application/java',\n 'com.sun.java-source': 'text/x-java-source',\n 'com.sun.java-web-start': 'application/jnlp',\n 'com.truevision.tga-image': 'image/tga',\n 'org.bzip.bzip2-archive': 'application/x-bzip2',\n 'org.debian.debian-package': 'application/x-debian-package',\n 'org.gnu.gnu-tar-archive': 'application/x-gtar',\n 'org.gnu.gnu-zip-archive': 'application/gzip',\n 'org.neooffice.calc': 'application/vnd.sun.xml.calc',\n 'org.neooffice.draw': 'application/vnd.sun.xml.draw',\n 'org.neooffice.global': 'application/vnd.sun.xml.writer.global',\n 'org.neooffice.impress': 'application/vnd.sun.xml.impress',\n 'org.neooffice.math': 'application/vnd.sun.xml.math',\n 'org.neooffice.writer': 'application/vnd.sun.xml.writer',\n 'org.oasis.opendocument.chart': 'application/vnd.oasis.opendocument.chart',\n 'org.oasis.opendocument.database': 'application/vnd.oasis.opendocument.database',\n 'org.oasis.opendocument.formula': 'application/vnd.oasis.opendocument.formula',\n 'org.oasis.opendocument.graphics': 'application/vnd.oasis.opendocument.graphics',\n 'org.oasis.opendocument.image': 'application/vnd.oasis.opendocument.image',\n 'org.oasis.opendocument.presentation': 'application/vnd.oasis.opendocument.presentation',\n 'org.oasis.opendocument.spreadsheet': 'application/vnd.oasis.opendocument.spreadsheet',\n 'org.oasis.opendocument.text': 'application/vnd.oasis.opendocument.text',\n 'org.oasis.opendocument.text-master': 'application/vnd.oasis.opendocument.text-master',\n 'org.oasis.opendocument.text-web': 'application/vnd.oasis.opendocument.text-web',\n 'org.tug.tex': 'text/tex',\n 'org.xiph.flac': 'audio/flac',\n 'org.xiph.ogg-theora': 'video/ogg',\n 'org.xiph.ogg-vorbis': 'audio/ogg',\n 'public.3gpp': 'video/3gpp',\n 'public.3gpp2': 'video/3gpp2',\n 'public.aifc-audio': 'audio/aiff',\n 'public.aiff-audio': 'audio/aiff',\n 'public.assembly-source': 'text/x-asm',\n 'public.avi': 'video/avi',\n 'public.c-header': 'text/x-c-header',\n 'public.cpio-archive': 'application/x-cpio',\n 'public.c-plus-plus-header': 'text/x-c++-hdr',\n 'public.c-plus-plus-source': 'application/x-cplusplus',\n 'public.csh-script': 'application/x-csh',\n 'public.c-source': 'text/x-c-code',\n 'public.css': 'text/css',\n 'public.dv': 'video/x-dv',\n 'public.flv': 'video/x-flv',\n 'public.html': 'text/html',\n 'public.iso-image': 'application/x-iso-image',\n 'public.jpeg': 'image/jpeg',\n 'public.jpeg2000': 'image/jp2',\n 'public.midi': 'audio/midi',\n 'public.mka': 'audio/x-matroska',\n 'public.mkv': 'video/x-matroska',\n 'public.mp3': 'audio/mp3',\n 'public.mpeg': 'video/mpeg',\n 'public.mpeg4': 'video/mp4',\n 'public.mpeg4-audio': 'audio/mp4',\n 'public.mpegts': 'video/MP2T',\n 'public.objective-c-plus-plus-source': 'text/x-objcppsrc',\n 'public.objective-c-source': 'text/x-objcsrc',\n 'public.opentype-font': 'font/opentype',\n 'public.perl-script': 'text/x-perl',\n 'public.php-script': 'text/php',\n 'public.plain-text': 'text/plain',\n 'public.png': 'image/png',\n 'public.python-script': 'text/x-python-script',\n 'public.rtf': 'text/rtf',\n 'public.shell-script': 'application/x-sh',\n 'public.tar-archive': 'application/tar',\n 'public.tiff': 'image/tiff',\n 'public.truetype-ttf-font': 'application/x-font-ttf',\n 'public.ulaw-audio': 'audio/au',\n 'public.vcard': 'text/vcard',\n 'public.webm': 'video/webm',\n 'public.xbitmap-image': 'image/xbm',\n 'public.xml': 'text/xml',\n 'unofficial.atom-feed': 'application/atom+xml',\n 'unofficial.m3u8-playlist': 'application/x-mpegURL',\n 'unofficial.opml': 'text/x-opml',\n 'unofficial.pls-playlist': 'audio/scpls',\n 'unofficial.rdf-feed': 'application/rdf+xml',\n 'unofficial.rss-feed': 'application/rss+xml',\n }\n\n utiExts: { [key: string]: string } = {\n jpg: 'public.jpeg',\n jpeg: 'public.jpeg',\n png: 'public.png',\n rtf: 'public.rtf',\n mpeg: 'public.mpeg',\n mpg: 'public.mpeg',\n html: 'public.html',\n htm: 'public.html',\n pdf: 'com.adobe.pdf',\n xls: 'com.microsoft.excel.xls',\n xlsx: 'com.microsoft.excel.xls',\n doc: 'com.microsoft.word.doc',\n docx: 'com.microsoft.word.doc',\n }\n\n utiDefs: { [key: string]: string } = {\n 'application/atom+xml': 'unofficial.atom-feed',\n 'application/bat': 'com.microsoft.windows-executable',\n 'application/binhex': 'com.apple.binhex-archive',\n 'application/binhex4': 'com.apple.binhex-archive',\n 'application/ecmascript': 'com.netscape.javascript-source',\n 'application/eps': 'com.adobe.encapsulated-postscript',\n 'application/excel': 'com.microsoft.excel.xls',\n 'application/exe': 'com.microsoft.windows-executable',\n 'application/gnutar': 'public.tar-archive',\n 'application/gzip': 'org.gnu.gnu-zip-archive',\n 'application/illustrator': 'com.adobe.illustrator.ai-image',\n 'application/indesign': 'com.adobe.indesign-image',\n 'application/java-archive': 'com.sun.java-archive',\n 'application/java-byte-code': 'com.sun.java-class',\n 'application/java': 'com.sun.java-class',\n 'application/javascript': 'com.netscape.javascript-source',\n 'application/jnlp': 'com.sun.java-web-start',\n 'application/latex': 'org.tug.tex',\n 'application/mac-binary': 'com.apple.macbinary-archive',\n 'application/mac-binhex': 'com.apple.binhex-archive',\n 'application/mac-binhex40': 'com.apple.binhex-archive',\n 'application/macbinary': 'com.apple.macbinary-archive',\n 'application/mspowerpoint': 'com.microsoft.powerpoint.ppt',\n 'application/msword': 'com.microsoft.word.doc',\n 'application/octet-stream': 'com.microsoft.windows-executable',\n 'application/pdf': 'com.adobe.pdf',\n 'application/photoshop': 'com.adobe.photoshop-image',\n 'application/php': 'public.php-script',\n 'application/plain': 'public.plain-text',\n 'application/postscript': 'com.adobe.postscript',\n 'application/powerpoint': 'com.microsoft.powerpoint.ppt',\n 'application/rar': 'com.rarlab.rar-archive',\n 'application/rdf+xml': 'unofficial.rdf-feed',\n 'application/rss+xml': 'unofficial.rss-feed',\n 'application/rtf': 'public.rtf',\n 'application/smil': 'com.real.smil',\n 'application/stuffit': 'com.allume.stuffit-archive',\n 'application/tar': 'public.tar-archive',\n 'application/tga': 'com.truevision.tga-image',\n 'application/vnd.fpx': 'com.kodak.flashpix.image',\n 'application/vnd.ms-excel': 'com.microsoft.excel.xls',\n 'application/vnd.ms-powerpoint': 'com.microsoft.powerpoint.ppt',\n 'application/vnd.oasis.opendocument.chart': 'org.oasis.opendocument.chart',\n 'application/vnd.oasis.opendocument.database': 'org.oasis.opendocument.database',\n 'application/vnd.oasis.opendocument.formula': 'org.oasis.opendocument.formula',\n 'application/vnd.oasis.opendocument.graphics-template': 'org.oasis.opendocument.graphics',\n 'application/vnd.oasis.opendocument.graphics': 'org.oasis.opendocument.graphics',\n 'application/vnd.oasis.opendocument.image': 'org.oasis.opendocument.image',\n 'application/vnd.oasis.opendocument.presentation-template': 'org.oasis.opendocument.presentation',\n 'application/vnd.oasis.opendocument.presentation': 'org.oasis.opendocument.presentation',\n 'application/vnd.oasis.opendocument.spreadsheet-template': 'org.oasis.opendocument.spreadsheet',\n 'application/vnd.oasis.opendocument.spreadsheet': 'org.oasis.opendocument.spreadsheet',\n 'application/vnd.oasis.opendocument.text-master': 'org.oasis.opendocument.text-master',\n 'application/vnd.oasis.opendocument.text-template': 'org.oasis.opendocument.text',\n 'application/vnd.oasis.opendocument.text-web': 'org.oasis.opendocument.text-web',\n 'application/vnd.oasis.opendocument.text': 'org.oasis.opendocument.text',\n 'application/vnd.rn-realmedia': 'com.real.realmedia',\n 'application/vnd.sun.xml.calc.template': 'org.neooffice.calc',\n 'application/vnd.sun.xml.calc': 'org.neooffice.calc',\n 'application/vnd.sun.xml.draw.template': 'org.neooffice.draw',\n 'application/vnd.sun.xml.draw': 'org.neooffice.draw',\n 'application/vnd.sun.xml.impress.template': 'org.neooffice.impress',\n 'application/vnd.sun.xml.impress': 'org.neooffice.impress',\n 'application/vnd.sun.xml.math': 'org.neooffice.math',\n 'application/vnd.sun.xml.writer.global': 'org.neooffice.global',\n 'application/vnd.sun.xml.writer.template': 'org.neooffice.writer',\n 'application/vnd.sun.xml.writer': 'org.neooffice.writer',\n 'application/vndms-excel': 'com.microsoft.excel.xls',\n 'application/vndms-powerpoint': 'com.microsoft.powerpoint.ppt',\n 'application/vndrn-realmedia': 'com.real.realmedia',\n 'application/x-apple-diskimage': 'com.apple.disk-image-udif',\n 'application/x-applescript': 'com.apple.applescript.script',\n 'application/x-bat': 'com.microsoft.windows-executable',\n 'application/x-binary': 'com.apple.macbinary-archive',\n 'application/x-binhex40': 'com.apple.binhex-archive',\n 'application/x-bittorrent': 'com.bittorrent.torrent',\n 'application/x-bzip2': 'org.bzip.bzip2-archive',\n 'application/x-cpio': 'public.cpio-archive',\n 'application/x-cplusplus': 'public.c-plus-plus-source',\n 'application/x-csh': 'public.csh-script',\n 'application/x-deb': 'org.debian.debian-package',\n 'application/x-debian-package': 'org.debian.debian-package',\n 'application/x-eps': 'com.adobe.encapsulated-postscript',\n 'application/x-excel': 'com.microsoft.excel.xls',\n 'application/x-exe': 'com.microsoft.windows-executable',\n 'application/x-flac': 'org.xiph.flac',\n 'application/x-font-ttf': 'public.truetype-ttf-font',\n 'application/x-font-type1': 'com.adobe.postscript-pfa-font',\n 'application/x-gtar': 'org.gnu.gnu-tar-archive',\n 'application/x-gzip': 'org.gnu.gnu-zip-archive',\n 'application/x-iso-image': 'public.iso-image',\n 'application/x-java-class': 'com.sun.java-class',\n 'application/x-java': 'com.sun.java-web-start',\n 'application/x-javascript': 'com.netscape.javascript-source',\n 'application/x-latex': 'org.tug.tex',\n 'application/x-mac-binhex40': 'com.apple.binhex-archive',\n 'application/x-macbinary': 'com.apple.macbinary-archive',\n 'application/x-midi': 'public.midi',\n 'application/x-mpegURL': 'unofficial.m3u8-playlist',\n 'application/x-ms-wmd': 'com.microsoft.windows-media-wmd',\n 'application/x-ms-wmz': 'com.microsoft.windows-media-wmz',\n 'application/x-msdos-program': 'com.microsoft.windows-executable',\n 'application/x-msdownload': 'com.microsoft.windows-executable',\n 'application/x-msexcel': 'com.microsoft.excel.xls',\n 'application/x-mspowerpoint': 'com.microsoft.powerpoint.ppt',\n 'application/x-pdf': 'com.adobe.pdf',\n 'application/x-perl': 'public.perl-script',\n 'application/x-php': 'public.php-script',\n 'application/x-quartzcomposer': 'com.apple.quartz-composer-composition',\n 'application/x-rar-compressed': 'com.rarlab.rar-archive',\n 'application/x-redhat-package': 'com.redhat.redhat-package',\n 'application/x-rpm': 'com.redhat.redhat-package',\n 'application/x-rtf': 'public.rtf',\n 'application/x-sh': 'public.shell-script',\n 'application/x-shellscript': 'public.shell-script',\n 'application/x-shockwave-flash': 'com.macromedia.shockwave-flash',\n 'application/x-sit': 'com.allume.stuffit-archive',\n 'application/x-smil': 'com.real.smil',\n 'application/x-soundfont': 'com.soundblaster.soundfont',\n 'application/x-stuffit': 'com.allume.stuffit-archive',\n 'application/x-tar': 'public.tar-archive',\n 'application/x-tex': 'org.tug.tex',\n 'application/x-texinfo': 'org.tug.tex',\n 'application/x-troff-msvideo': 'public.avi',\n 'application/x-zip-compressed': 'com.pkware.zip-archive',\n 'application/xhtml+xml': 'public.html',\n 'application/xml': 'public.xml',\n 'application/zip': 'com.pkware.zip-archive',\n 'audio/3gpp': 'public.3gpp',\n 'audio/3gpp2': 'public.3gpp2',\n 'audio/aiff': 'public.aiff-audio',\n 'audio/au': 'public.ulaw-audio',\n 'audio/basic': 'public.ulaw-audio',\n 'audio/flac': 'org.xiph.flac',\n 'audio/mid': 'public.midi',\n 'audio/midi': 'public.midi',\n 'audio/mp3': 'public.mp3',\n 'audio/mp4': 'public.mpeg4-audio',\n 'audio/mp4a-latm': 'public.mpeg4-audio',\n 'audio/mpeg': 'public.mp3',\n 'audio/mpeg3': 'public.mp3',\n 'audio/mpegurl': 'unofficial.m3u-playlist',\n 'audio/mpg': 'public.mp3',\n 'audio/ogg': 'org.xiph.ogg-vorbis',\n 'audio/scpls': 'unofficial.pls-playlist',\n 'audio/snd': 'public.ulaw-audio',\n 'audio/vnd.rn-realaudio': 'com.real.realaudio',\n 'audio/wav': 'com.microsoft.waveform-audio',\n 'audio/wave': 'com.microsoft.waveform-audio',\n 'audio/webm': 'public.webm',\n 'audio/x-adpcm': 'public.ulaw-audio',\n 'audio/x-aiff': 'public.aiff-audio',\n 'audio/x-au': 'public.ulaw-audio',\n 'audio/x-flac': 'org.xiph.flac',\n 'audio/x-matroska': 'public.mka',\n 'audio/x-mid': 'public.midi',\n 'audio/x-midi': 'public.midi',\n 'audio/x-mp3': 'public.mp3',\n 'audio/x-mpeg-3': 'public.mp3',\n 'audio/x-mpeg': 'public.mp3',\n 'audio/x-mpeg3': 'public.mp3',\n 'audio/x-mpegurl': 'unofficial.m3u-playlist',\n 'audio/x-mpg': 'public.mp3',\n 'audio/x-ms-wax': 'com.microsoft.windows-media-wax',\n 'audio/x-ms-wma': 'com.microsoft.windows-media-wma',\n 'audio/x-ogg': 'org.xiph.ogg-vorbis',\n 'audio/x-pn-realaudio-plugin': 'com.real.realaudio',\n 'audio/x-pn-realaudio': 'com.real.realaudio',\n 'audio/x-pn-wav': 'com.microsoft.waveform-audio',\n 'audio/x-realaudio': 'com.real.realmedia',\n 'audio/x-scpls': 'unofficial.pls-playlist',\n 'audio/x-wav': 'com.microsoft.waveform-audio',\n 'font/opentype': 'public.opentype-font',\n 'image/bmp': 'com.microsoft.bmp',\n 'image/efax': 'com.js.efx-fax',\n 'image/eps': 'com.adobe.encapsulated-postscript',\n 'image/fpx': 'com.kodak.flashpix.image',\n 'image/gif': 'com.compuserve.gif',\n 'image/indd': 'com.adobe.indesign-image',\n 'image/indesign': 'com.adobe.indesign-image',\n 'image/jp2': 'public.jpeg2000',\n 'image/jpeg': 'public.jpeg',\n 'image/ms-bmp': 'com.microsoft.bmp',\n 'image/photoshop': 'com.adobe.photoshop-image',\n 'image/pict': 'com.apple.pict',\n 'image/pipeg': 'public.jpeg',\n 'image/pjpeg': 'public.jpeg',\n 'image/png': 'public.png',\n 'image/psd': 'com.adobe.photoshop-image',\n 'image/sgi': 'com.sgi.sgi-image',\n 'image/targa': 'com.truevision.tga-image',\n 'image/tga': 'com.truevision.tga-image',\n 'image/tiff': 'public.tiff',\n 'image/vnd.djvu': 'com.lizardtech.djvu',\n 'image/vndfpx': 'com.kodak.flashpix.image',\n 'image/vndnet-fpx': 'com.kodak.flashpix.image',\n 'image/webp': 'public.webp',\n 'image/x-bitmap': 'com.microsoft.bmp',\n 'image/x-bmp': 'com.microsoft.bmp',\n 'image/x-djvu': 'com.lizardtech.djvu',\n 'image/x-eps': 'com.adobe.encapsulated-postscript',\n 'image/x-icon': 'com.microsoft.ico',\n 'image/x-indesign': 'com.adobe.indesign-image',\n 'image/x-macpict': 'com.apple.pict',\n 'image/x-ms-bmp': 'com.microsoft.bmp',\n 'image/x-photoshop': 'com.adobe.photoshop-image',\n 'image/x-pict': 'com.apple.pict',\n 'image/x-quicktime': 'com.apple.quicktime-image',\n 'image/x-tiff': 'public.tiff',\n 'image/x-windows-bmp': 'com.microsoft.bmp',\n 'image/x-xbitmap': 'com.microsoft.bmp',\n 'image/x-xbm': 'public.xbitmap-image',\n 'image/xbm': 'public.xbitmap-image',\n 'multipart/x-gzip': 'org.gnu.gnu-zip-archive',\n 'multipart/x-zip': 'com.pkware.zip-archive',\n 'music/crescendo': 'public.midi',\n 'text/calendar': 'com.apple.ical.ics',\n 'text/css': 'public.css',\n 'text/directory': 'public.vcard',\n 'text/ecmascript': 'com.netscape.javascript-source',\n 'text/html': 'public.html',\n 'text/javascript': 'com.netscape.javascript-source',\n 'text/php': 'public.php-script',\n 'text/plain': 'public.plain-text',\n 'text/richtext': 'public.rtf',\n 'text/rtf': 'public.rtf',\n 'text/ruby-script': 'public.ruby-script',\n 'text/tex': 'org.tug.tex',\n 'text/vcard': 'public.vcard',\n 'text/vnd.sun.j2me.app-descriptor': 'com.sun.java-app-descriptor',\n 'text/x-asm': 'public.assembly-source',\n 'text/x-c-code': 'public.c-source',\n 'text/x-c-header': 'public.c-header',\n 'text/x-c': 'public.c-source',\n 'text/x-c++-code': 'public.c-plus-plus-source',\n 'text/x-c++-hdr': 'public.c-plus-plus-header',\n 'text/x-c++-src': 'public.c-plus-plus-source',\n 'text/x-c++src': 'public.c-plus-plus-source',\n 'text/x-h': 'public.c-header',\n 'text/x-java-source': 'com.sun.java-source',\n 'text/x-latex': 'org.tug.tex',\n 'text/x-objcppsrc': 'public.objective-c-plus-plus-source',\n 'text/x-objcsrc': 'public.objective-c-source',\n 'text/x-opml': 'unofficial.opml',\n 'text/x-perl-script': 'public.perl-script',\n 'text/x-perl': 'public.perl-script',\n 'text/x-php-script': 'public.php-script',\n 'text/x-python-script': 'public.python-script',\n 'text/x-python': 'public.python-script',\n 'text/x-scriptcsh': 'public.csh-script',\n 'text/x-scriptperl-module': 'public.perl-script',\n 'text/x-scriptperl': 'public.perl-script',\n 'text/x-scriptphyton': 'public.python-script',\n 'text/x-scriptsh': 'public.shell-script',\n 'text/x-server-parsed-html': 'public.html',\n 'text/x-tex': 'org.tug.tex',\n 'text/x-vcalendar': 'com.apple.ical.vcs',\n 'text/x-vcard': 'public.vcard',\n 'text/xhtml': 'public.html',\n 'text/xml': 'public.xml',\n 'video/3gpp': 'public.3gpp',\n 'video/3gpp2': 'public.3gpp2',\n 'video/avi': 'public.avi',\n 'video/MP2T': 'public.mpegts',\n 'video/mp4': 'public.mpeg4',\n 'video/mp4v': 'public.mpeg4',\n 'video/mpeg': 'public.mpeg',\n 'video/mpg': 'public.mpeg',\n 'video/msvideo': 'public.avi',\n 'video/ogg': 'org.xiph.ogg-theora',\n 'video/quicktime': 'com.apple.quicktime-movie',\n 'video/webm': 'public.webm',\n 'video/x-dv': 'public.dv',\n 'video/x-flv': 'public.flv',\n 'video/x-m4v': 'public.mpeg4',\n 'video/x-matroska': 'public.mkv',\n 'video/x-mpeg': 'public.mpeg',\n 'video/x-mpg': 'public.mpeg',\n 'video/x-ms-asf-plugin': 'com.microsoft.advanced-systems-format',\n 'video/x-ms-asf': 'com.microsoft.advanced-systems-format',\n 'video/x-ms-asx': 'com.microsoft.advanced-stream-redirector',\n 'video/x-ms-wm': 'com.microsoft.windows-media-wm',\n 'video/x-ms-wmd': 'com.microsoft.windows-media-wmd',\n 'video/x-ms-wmp': 'com.microsoft.windows-media-wmp',\n 'video/x-ms-wmv': 'com.microsoft.windows-media-wmv',\n 'video/x-ms-wmx': 'com.microsoft.windows-media-wmx',\n 'video/x-ms-wmz': 'com.microsoft.windows-media-wmz',\n 'video/x-ms-wvx': 'com.microsoft.windows-media-wvx',\n 'video/x-msvideo': 'public.avi',\n 'video/x-ogg': 'org.xiph.ogg-theora',\n 'x-msdos-program': 'com.microsoft.windows-executable',\n 'x-music/x-midi': 'public.midi',\n }\n dataOwnerApi: IccDataOwnerXApi\n authenticationProvider: AuthenticationProvider\n\n constructor(\n host: string,\n headers: { [key: string]: string },\n private crypto: IccCryptoXApi,\n private authApi: IccAuthApi,\n 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.fetchImpl = fetchImpl\n this.authenticationProvider = authenticationProvider\n this.dataOwnerApi = dataOwnerApi\n }\n\n override get headers(): Promise<Array<XHR.Header>> {\n return super.headers.then((h) => this.crypto.accessControlKeysHeaders.addAccessControlKeysHeaders(h, EntityWithDelegationTypeName.Document))\n }\n\n /**\n * Creates a new instance of document with initialised encryption metadata (not in the database).\n * @param user the current user.\n * @param message the message this document refers to.\n * @param c initialised data for the document. 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 * - preferredSfk: secret id of the message to use as the secret foreign key to use for the document. The default value will be a\n * secret id of the message known by the topmost parent in the current data owner hierarchy.\n * - alternateRootDelegation: by default a new entity is created with a root delegation from self to self. In keyless mode this is not possible,\n * and instead the root delegation will be from self to another. You have to specify which delegate will be part of the root delegation.\n * @return a new instance of document.\n */\n async newInstance(\n user: models.User,\n message?: models.Message,\n c: any = {},\n options: {\n additionalDelegates?: { [dataOwnerId: string]: AccessLevelEnum }\n sfkOption?: SecretIdUseOption\n alternateRootDelegation?: string\n } = {}\n ) {\n const document = {\n ...(c ?? {}),\n _type: 'org.taktik.icure.entities.Document',\n id: c?.id ?? this.crypto.primitives.randomUuid(),\n created: c?.created ?? new Date().getTime(),\n modified: c?.modified ?? new Date().getTime(),\n responsible: c?.responsible ?? (this.autofillAuthor ? this.dataOwnerApi.getDataOwnerIdOf(user) : undefined),\n author: c?.author ?? (this.autofillAuthor ? user.id : undefined),\n codes: c?.codes ?? [],\n tags: c?.tags ?? [],\n }\n\n const ownerId = this.dataOwnerApi.getDataOwnerIdOf(user)\n if (ownerId !== (await this.dataOwnerApi.getCurrentDataOwnerId())) throw new Error('Can only initialise entities as current data owner.')\n const sfk = message\n ? await this.crypto.xapi.resolveSecretIdUseOptions(\n { entity: message, type: EntityWithDelegationTypeName.Message },\n options.sfkOption ?? SecretIdUseOption.UseAnySharedWithParent\n )\n : []\n const extraDelegations = {\n ...Object.fromEntries(\n [...(user.autoDelegations?.all ?? []), ...(user.autoDelegations?.medicalInformation ?? [])].map((d) => [d, AccessLevelEnum.WRITE])\n ),\n ...(options?.additionalDelegates ?? {}),\n }\n return new models.Document(\n await this.crypto.xapi\n .entityWithInitialisedEncryptedMetadata(\n document,\n EntityWithDelegationTypeName.Document,\n message?.id,\n sfk,\n true,\n extraDelegations,\n options.alternateRootDelegation\n )\n .then((x) => x.updatedEntity)\n )\n }\n\n // noinspection JSUnusedGlobalSymbols\n /**\n * @deprecated use {@link findIdsByMessage} instead.\n */\n async findByMessage(hcpartyId: string, message: models.Message) {\n const extractedKeys = await this.crypto.xapi.secretIdsOf({ entity: message, type: EntityWithDelegationTypeName.Message }, hcpartyId)\n const topmostParentId = (await this.dataOwnerApi.getCurrentDataOwnerHierarchyIds())[0]\n let documents: Array<models.Document> = await this.findDocumentsByHCPartyPatientForeignKeys(topmostParentId, _.uniq(extractedKeys))\n return await this.decrypt(hcpartyId, documents)\n }\n\n /**\n * Same as {@link findByMessage} but it will only return the ids of the contacts. It can also filter the documents where Document.created is between\n * startDate and endDate in ascending or descending order by that field. (default: ascending).\n */\n async findIdsByMessage(hcpartyId: string, message: models.Message, startDate?: number, endDate?: number, descending?: boolean): Promise<string[]> {\n const extractedKeys = await this.crypto.xapi.secretIdsOf({ entity: message, type: EntityWithDelegationTypeName.Message }, hcpartyId)\n const topmostParentId = (await this.dataOwnerApi.getCurrentDataOwnerHierarchyIds())[0]\n return this.findDocumentIdsByDataOwnerSecretForeignKey(topmostParentId, _.uniq(extractedKeys), startDate, endDate, descending)\n }\n\n // Note: this is only for dealing with legacy documents: new document are not encrypted, only their attachments are\n async decrypt(hcpartyId: string, documents: Array<models.Document>): Promise<Array<models.Document>> {\n const res: models.Document[] = []\n for (const document of documents) {\n const keys = await this.crypto.xapi.encryptionKeysOf({ entity: document, type: EntityWithDelegationTypeName.Document }, undefined)\n if (!keys.length) {\n console.log('Cannot decrypt document', document.id)\n res.push(document)\n } else if (keys.length && (document.encryptedSelf || document.encryptedAttachment)) {\n const key = await this.crypto.primitives.AES.importKey('raw', hex2ua(keys[0]))\n res.push(\n await Promise.all([\n document.encryptedSelf\n ? new Promise((resolve: (value: ArrayBuffer | null) => any) => {\n this.crypto.primitives.AES.decrypt(key, string2ua(a2b(document.encryptedSelf!))).then(resolve, () => {\n console.log('Cannot decrypt document', document.id)\n resolve(null)\n })\n })\n : Promise.resolve(null),\n document.encryptedAttachment\n ? new Promise((resolve: (value: ArrayBuffer | null) => any) => {\n this.crypto.primitives.AES.decrypt(key, document.encryptedAttachment!).then(resolve, () => {\n console.log('Cannot decrypt document', document.id)\n resolve(null)\n })\n })\n : Promise.resolve(null),\n ]).then((decrypted: [ArrayBuffer | null, ArrayBuffer | null]) => {\n let updatedDocument = { ...document }\n if (decrypted) {\n if (decrypted[0]) {\n updatedDocument = _.extend(document, JSON.parse(ua2string(decrypted[0])))\n }\n if (decrypted[1]) {\n updatedDocument.decryptedAttachment = decrypted[1]\n }\n }\n return updatedDocument\n })\n )\n } else {\n res.push(document)\n }\n }\n return res\n }\n\n //prettier-ignore\n getAttachmentAs(documentId: string, attachmentId: string, returnType: \"application/octet-stream\", enckeys?: string, fileName?: string): Promise<ArrayBuffer>\n //prettier-ignore\n getAttachmentAs(documentId: string, attachmentId: string, returnType: \"text/plain\", enckeys?: string, fileName?: string): Promise<string>\n //prettier-ignore\n getAttachmentAs(documentId: string, attachmentId: string, returnType: \"application/json\", enckeys?: string, fileName?: string): Promise<any>\n /**\n * @deprecated use getMainAttachmentAs instead\n */\n async getAttachmentAs(\n documentId: string,\n attachmentId: string,\n returnType: 'application/octet-stream' | 'text/plain' | 'application/json',\n enckeys?: string,\n fileName?: string\n ): Promise<any> {\n if (!!enckeys || !!fileName) {\n console.warn('Using getAttachmentAs method with a value for enckeys or fileName does nothing anymore.')\n }\n return this.getMainAttachmentAs(documentId, returnType)\n }\n\n //prettier-ignore\n getMainAttachmentAs(documentId: string, returnType: \"application/octet-stream\"): Promise<ArrayBuffer>\n //prettier-ignore\n getMainAttachmentAs(documentId: string, returnType: \"text/plain\"): Promise<string>\n //prettier-ignore\n getMainAttachmentAs(documentId: string, returnType: \"application/json\"): Promise<any>\n //prettier-ignore\n getMainAttachmentAs(documentId: string, returnType: 'application/octet-stream' | 'text/plain' | 'application/json'): Promise<any>\n async getMainAttachmentAs(documentId: string, returnType: 'application/octet-stream' | 'text/plain' | 'application/json'): Promise<any> {\n const url = this.host + `/document/${documentId}/attachment` + '?ts=' + new Date().getTime()\n return XHR.sendCommand('GET', url, await this.headers, null, this.fetchImpl, returnType, this.authenticationProvider.getAuthService())\n .then((doc) => doc.body)\n .catch((err) => this.handleError(err))\n }\n\n //prettier-ignore\n getAndTryDecryptMainAttachmentAs(document: models.Document, returnType: \"application/octet-stream\"): Promise<ArrayBuffer | undefined>\n //prettier-ignore\n getAndTryDecryptMainAttachmentAs(document: models.Document, returnType: \"text/plain\"): Promise<string | undefined>\n //prettier-ignore\n getAndTryDecryptMainAttachmentAs(document: models.Document, returnType: \"application/json\"): Promise<any | undefined>\n //prettier-ignore\n getAndTryDecryptMainAttachmentAs(document: models.Document, returnType: 'application/octet-stream' | 'text/plain' | 'application/json'): Promise<any | undefined>\n async getAndTryDecryptMainAttachmentAs(\n document: models.Document,\n returnType: 'application/octet-stream' | 'text/plain' | 'application/json'\n ): Promise<any | undefined> {\n const key = (await this.crypto.xapi.encryptionKeysOf({ entity: document, type: EntityWithDelegationTypeName.Document }, undefined))[0]\n if (!key) return undefined\n const tryParse = this.parserFor(returnType)\n const attachmentInfo = await this.getAndTryDecryptDocumentAttachment(document, (decrypted) => Promise.resolve(tryParse(decrypted) !== undefined))\n if (attachmentInfo.wasDecrypted) {\n return tryParse(attachmentInfo.data)\n } else return undefined\n }\n private parserFor(returnType: 'application/octet-stream' | 'text/plain' | 'application/json'): (data: ArrayBuffer) => any | undefined {\n if (returnType === 'application/octet-stream') {\n return (data) => data\n } else if (returnType === 'text/plain') {\n return (data) => {\n try {\n return ua2utf8(data)\n } catch (e) {\n return undefined\n }\n }\n } else if (returnType === 'application/json') {\n return (data) => {\n try {\n return JSON.parse(ua2utf8(data))\n } catch (e) {\n return undefined\n }\n }\n } else throw new Error(`Unsupported type ${returnType}`)\n }\n\n // noinspection JSUnusedGlobalSymbols\n uti(mimeType: string, extension: string) {\n return (mimeType && mimeType !== 'application/octet-stream' ? this.utiDefs[mimeType] : this.utiExts[extension]) || this.utiDefs[mimeType]\n }\n\n // noinspection JSUnusedGlobalSymbols\n mimeType(uti: string) {\n return this.utiRevDefs[uti]\n }\n\n /**\n * Adds an attachment to a document, encrypting it on client side using the encryption keys of the provided document.\n * @param document a document.\n * @param attachment a new main attachment for the document.\n * @param utis an array of UTIs for the attachment. The first element will be considered as the main UTI for the document. If provided and non-empty\n * overrides existing values.\n * @return the updated document.\n */\n async encryptAndSetDocumentAttachment(document: models.Document, attachment: ArrayBuffer | Uint8Array, utis?: string[]): Promise<models.Document> {\n if (!document.rev) throw new Error('Cannot set attachment on document without rev')\n const { encryptedData, updatedEntity } = await this.crypto.xapi.encryptDataOf(document, EntityWithDelegationTypeName.Document, attachment, (d) =>\n this.modifyDocument(d)\n )\n return await this.setMainDocumentAttachment(document.id!, updatedEntity?.rev ?? document.rev, encryptedData, utis, true)\n }\n\n /**\n * Adds an unencrypted attachment to a document.\n * @param document a document.\n * @param attachment a new main attachment for the document.\n * @param utis an array of UTIs for the attachment. The first element will be considered as the main UTI for the document. If provided and non-empty\n * overrides existing values.\n * @return the updated document.\n */\n async setClearDocumentAttachment(document: models.Document, attachment: ArrayBuffer | Uint8Array, utis?: string[]): Promise<models.Document> {\n if (!document.rev) throw new Error('Cannot set attachment on document without rev')\n return await this.setMainDocumentAttachment(document.id!, document.rev, attachment, utis, false)\n }\n\n /**\n * Adds a secondary attachment to a document, encrypting it on client side using the encryption keys of the provided document.\n * @param document a document.\n * @param secondaryAttachmentKey key for the secondary attachment.\n * @param attachment a new secondary attachment for the document.\n * @param utis an array of UTIs for the attachment. The first element will be considered as the main UTI for the document. If provided and non-empty\n * overrides existing values.\n * @return the updated document.\n */\n async encryptAndSetSecondaryDocumentAttachment(\n document: models.Document,\n secondaryAttachmentKey: string,\n attachment: ArrayBuffer | Uint8Array,\n utis?: string[]\n ): Promise<models.Document> {\n if (!document.rev) throw new Error('Cannot set attachment on document without rev')\n const { encryptedData, updatedEntity } = await this.crypto.xapi.encryptDataOf(document, EntityWithDelegationTypeName.Document, attachment, (d) =>\n this.modifyDocument()\n )\n return await this.setSecondaryAttachment(document.id!, secondaryAttachmentKey, updatedEntity?.rev ?? document.rev!, encryptedData, utis, true)\n }\n\n /**\n * Adds an unencrypted secondary attachment to a document.\n * @param document a document.\n * @param secondaryAttachmentKey key for the secondary attachment.\n * @param attachment a new secondary attachment for the document.\n * @param utis an array of UTIs for the attachment. The first element will be considered as the main UTI for the document. If provided and non-empty\n * overrides existing values.\n * @return the updated document.\n */\n async setClearSecondaryDocumentAttachment(\n document: models.Document,\n secondaryAttachmentKey: string,\n attachment: ArrayBuffer | Uint8Array,\n utis?: string[]\n ): Promise<models.Document> {\n return await this.setSecondaryAttachment(document.id!, secondaryAttachmentKey, document.rev!, attachment, utis, false)\n }\n\n /**\n * Gets the main attachment of a document and tries to decrypt it using the encryption keys of the document, throwing an error if the operation fails.\n * @param document a document.\n * @param validator optionally a validator function which checks if the decryption was successful. In cases where the document has many encryption\n * keys and it is unclear which one should be used this function can help to detect bad decryptions.\n * @return the decrypted attachment, if it could be decrypted, else the encrypted attachment.\n */\n async getAndDecryptDocumentAttachment(\n document: models.Document,\n validator: (decrypted: ArrayBuffer) => Promise<boolean> = () => Promise.resolve(true)\n ): Promise<ArrayBuffer> {\n const retrieved = await this.getAndTryDecryptDocumentAttachment(document, (x) => validator(x))\n if (!retrieved.wasDecrypted) throw new Error(`No valid key found to decrypt data of document ${document.id}.`)\n return retrieved.data\n }\n\n /**\n * Gets the main attachment of a document and tries to decrypt it using the encryption keys of the document.\n * @param document a document.\n * @param validator optionally a validator function which checks if the decryption was successful. In cases where the document has many encryption\n * keys and it is unclear which one should be used this function can help to detect bad decryptions.\n * @return an object containing:\n * - data: the decrypted attachment, if it could be decrypted, else the encrypted attachment.\n * - wasDecrypted: if the data was successfully decrypted or not\n */\n async getAndTryDecryptDocumentAttachment(\n document: models.Document,\n validator: (decrypted: ArrayBuffer) => Promise<boolean> = () => Promise.resolve(true)\n ): Promise<{ data: ArrayBuffer; wasDecrypted: boolean }> {\n return await this.crypto.xapi.tryDecryptDataOf(\n { entity: document, type: EntityWithDelegationTypeName.Document },\n await this.getRawMainDocumentAttachment(document.id!),\n (x) => validator(x)\n )\n }\n\n /**\n * Gets the secondary attachment of a document and tries to decrypt it using the encryption keys of the document, throwing an error if the operation fails.\n * @param document a document.\n * @param secondaryAttachmentKey key of the secondary attachment.\n * @param validator optionally a validator function which checks if the decryption was successful. In cases where the document has many encryption\n * keys and it is unclear which one should be used this function can help to detect bad decryptions.\n * @return the decrypted attachment.\n */\n async getAndDecryptSecondaryDocumentAttachment(\n document: models.Document,\n secondaryAttachmentKey: string,\n validator: (decrypted: ArrayBuffer) => Promise<boolean> = () => Promise.resolve(true)\n ): Promise<ArrayBuffer> {\n const { data, wasDecrypted } = await this.getAndTryDecryptSecondaryDocumentAttachment(document, secondaryAttachmentKey, (x) => validator(x))\n if (!wasDecrypted) throw new Error(`No valid key found to decrypt data of document ${document.id}.`)\n return data\n }\n\n /**\n * Gets the secondary attachment of a document and tries to decrypt it using the encryption keys of the document.\n * @param document a document.\n * @param secondaryAttachmentKey key of the secondary attachment.\n * @param validator optionally a validator function which checks if the decryption was successful. In cases where the document has many encryption\n * keys and it is unclear which one should be used this function can help to detect bad decryptions.\n * @return an object containing:\n * - data: the decrypted attachment, if it could be decrypted, else the encrypted attachment.\n * - wasDecrypted: if the data was successfully decrypted or not\n */\n async getAndTryDecryptSecondaryDocumentAttachment(\n document: models.Document,\n secondaryAttachmentKey: string,\n validator: (decrypted: ArrayBuffer) => Promise<boolean> = () => Promise.resolve(true)\n ): Promise<{ data: ArrayBuffer; wasDecrypted: boolean }> {\n return await this.crypto.xapi.tryDecryptDataOf(\n { entity: document, type: EntityWithDelegationTypeName.Document },\n await this.getSecondaryAttachment(document.id!, secondaryAttachmentKey),\n (x) => validator(x)\n )\n }\n\n /**\n * @param document a document\n * @return the id of the message that the document refers to, retrieved from the encrypted metadata. Normally there should only be one element\n * in the returned array, but in case of entity merges there could be multiple values.\n */\n async decryptMessageIdOf(document: models.Document): Promise<string[]> {\n return this.crypto.xapi.owningEntityIdsOf({ entity: document, type: EntityWithDelegationTypeName.Document }, undefined)\n }\n\n /**\n * @return if the logged data owner has write access to the content of the given document\n */\n async hasWriteAccess(document: models.Document): Promise<boolean> {\n return this.crypto.xapi.hasWriteAccess({ entity: document, type: EntityWithDelegationTypeName.Document })\n }\n\n /**\n * Share an existing document with other data owners, allowing them to access the non-encrypted data of the document 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 document.\n * @param document the document to share.\n * @param options optional parameters to customize the sharing behaviour:\n * - shareSecretIds: specifies which secret ids of the entity should be shared. If not provided all secret ids available to the current user will be shared\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}).\n * - shareMessageId: specifies if the id of the message that this document refers to should be shared with the delegate (defaults to\n * {@link ShareMetadataBehaviour.IF_AVAILABLE}).\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 document: models.Document,\n options: {\n shareSecretIds?: string[]\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n shareMessageId?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n } = {}\n ): Promise<models.Document> {\n return this.shareWithMany(document, { [delegateId]: options })\n }\n\n /**\n * Share an existing document with other data owners, allowing them to access the non-encrypted data of the document and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param document the document 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 * - shareSecretIds: specifies which secret ids of the entity should be shared. If not provided all secret ids available to the current user will be shared\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}).\n * - shareMessageId: specifies if the id of the message that this document refers to should be shared with the delegate (defaults to\n * {@link ShareMetadataBehaviour.IF_AVAILABLE}).\n * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.\n * @return the updated entity.\n */\n async shareWithMany(\n document: models.Document,\n delegates: {\n [delegateId: string]: {\n shareSecretIds?: string[]\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n shareMessageId?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n }\n }\n ): Promise<models.Document> {\n return (await this.tryShareWithMany(document, delegates)).updatedEntityOrThrow\n }\n /**\n * Share an existing document with other data owners, allowing them to access the non-encrypted data of the document and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param document the document 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 * - shareSecretIds: specifies which secret ids of the entity should be shared. If not provided all secret ids available to the current user will be shared\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}).\n * - shareMessageId: specifies if the id of the message that this document refers to should be shared with the delegate (defaults to\n * {@link ShareMetadataBehaviour.IF_AVAILABLE}).\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 document: models.Document,\n delegates: {\n [delegateId: string]: {\n shareSecretIds?: string[]\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n shareMessageId?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n }\n }\n ): Promise<ShareResult<models.Document>> {\n const self = await this.dataOwnerApi.getCurrentDataOwnerId()\n // All entities should have an encryption key.\n const entityWithEncryptionKey = await this.crypto.xapi.ensureEncryptionKeysInitialised(document, EntityWithDelegationTypeName.Document)\n const updatedEntity = entityWithEncryptionKey ? await this.modifyDocument(entityWithEncryptionKey) : document\n return this.crypto.xapi\n .simpleShareOrUpdateEncryptedEntityMetadata(\n {\n entity: updatedEntity,\n type: EntityWithDelegationTypeName.Document,\n },\n Object.fromEntries(\n Object.entries(delegates).map(([delegateId, options]) => [\n delegateId,\n {\n requestedPermissions: options.requestedPermissions,\n shareEncryptionKeys: options.shareEncryptionKey,\n shareOwningEntityIds: options.shareMessageId,\n shareSecretIds: options.shareSecretIds,\n },\n ])\n ),\n (x) => this.bulkShareDocument(x)\n )\n .then((r) => r)\n }\n\n getDataOwnersWithAccessTo(\n entity: models.Document\n ): Promise<{ permissionsByDataOwnerId: { [p: string]: AccessLevelEnum }; hasUnknownAnonymousDataOwners: boolean }> {\n return this.crypto.delegationsDeAnonymization.getDataOwnersWithAccessTo({ entity, type: EntityWithDelegationTypeName.Document })\n }\n\n getEncryptionKeysOf(entity: models.Document): Promise<string[]> {\n return this.crypto.xapi.encryptionKeysOf({ entity, type: EntityWithDelegationTypeName.Document }, undefined)\n }\n\n createDelegationDeAnonymizationMetadata(entity: models.Document, delegates: string[]): Promise<void> {\n return this.crypto.delegationsDeAnonymization.createOrUpdateDeAnonymizationInfo(\n { entity, type: EntityWithDelegationTypeName.Document },\n delegates\n )\n }\n}\n"]}
@@ -49,9 +49,9 @@ class IccFormXApi extends icc_api_1.IccFormApi {
49
49
  * and instead the root delegation will be from self to another. You have to specify which delegate will be part of the root delegation.
50
50
  * @return a new instance of form.
51
51
  */
52
- newInstance(user, patient, c = {}, options = {}) {
53
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
54
- return __awaiter(this, void 0, void 0, function* () {
52
+ newInstance(user_1, patient_1) {
53
+ return __awaiter(this, arguments, void 0, function* (user, patient, c = {}, options = {}) {
54
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
55
55
  const form = Object.assign(Object.assign({}, (c !== null && c !== void 0 ? c : {})), { _type: 'org.taktik.icure.entities.Form', id: (_a = c === null || c === void 0 ? void 0 : c.id) !== null && _a !== void 0 ? _a : this.crypto.primitives.randomUuid(), created: (_b = c === null || c === void 0 ? void 0 : c.created) !== null && _b !== void 0 ? _b : new Date().getTime(), modified: (_c = c === null || c === void 0 ? void 0 : c.modified) !== null && _c !== void 0 ? _c : new Date().getTime(), responsible: (_d = c === null || c === void 0 ? void 0 : c.responsible) !== null && _d !== void 0 ? _d : (this.autofillAuthor ? this.dataOwnerApi.getDataOwnerIdOf(user) : undefined), author: (_e = c === null || c === void 0 ? void 0 : c.author) !== null && _e !== void 0 ? _e : (this.autofillAuthor ? user.id : undefined), codes: (_f = c === null || c === void 0 ? void 0 : c.codes) !== null && _f !== void 0 ? _f : [], tags: (_g = c === null || c === void 0 ? void 0 : c.tags) !== null && _g !== void 0 ? _g : [] });
56
56
  const ownerId = this.dataOwnerApi.getDataOwnerIdOf(user);
57
57
  if (ownerId !== (yield this.dataOwnerApi.getCurrentDataOwnerId()))
@@ -80,8 +80,8 @@ class IccFormXApi extends icc_api_1.IccFormApi {
80
80
  * @param patient
81
81
  * @param usingPost (Promise)
82
82
  */
83
- findBy(hcpartyId, patient, usingPost = false) {
84
- return __awaiter(this, void 0, void 0, function* () {
83
+ findBy(hcpartyId_1, patient_1) {
84
+ return __awaiter(this, arguments, void 0, function* (hcpartyId, patient, usingPost = false) {
85
85
  const extractedKeys = yield this.crypto.xapi.secretIdsOf({ entity: patient, type: utils_1.EntityWithDelegationTypeName.Patient }, hcpartyId);
86
86
  const topmostParentId = (yield this.dataOwnerApi.getCurrentDataOwnerHierarchyIds())[0];
87
87
  let forms = yield (usingPost
@@ -138,8 +138,8 @@ class IccFormXApi extends icc_api_1.IccFormApi {
138
138
  * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.
139
139
  * @return the updated entity
140
140
  */
141
- shareWith(delegateId, form, options = {}) {
142
- return __awaiter(this, void 0, void 0, function* () {
141
+ shareWith(delegateId_1, form_1) {
142
+ return __awaiter(this, arguments, void 0, function* (delegateId, form, options = {}) {
143
143
  return this.shareWithMany(form, { [delegateId]: options });
144
144
  });
145
145
  }