@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
@@ -88,5 +88,5 @@ exports.Tarification = Tarification;
88
88
  Deptpercutaneous: 'deptpercutaneous',
89
89
  Deptchildbirth: 'deptchildbirth',
90
90
  };
91
- })(Tarification = exports.Tarification || (exports.Tarification = {}));
91
+ })(Tarification || (exports.Tarification = Tarification = {}));
92
92
  //# sourceMappingURL=Tarification.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tarification.js","sourceRoot":"","sources":["../../../icc-api/model/Tarification.ts"],"names":[],"mappings":";;;AAeA,MAAa,YAAY;IACvB,YAAY,IAAgB;QAC1B,MAAM,CAAC,MAAM,CAAC,IAAoB,EAAE,IAAI,CAAC,CAAA;IAC3C,CAAC;CAiCF;AApCD,oCAoCC;AACD,WAAiB,YAAY;IAgFd,sBAAS,GAAG;QACvB,QAAQ,EAAE,WAAwB;QAClC,UAAU,EAAE,aAA0B;QACtC,iBAAiB,EAAE,mBAAgC;QACnD,WAAW,EAAE,aAA0B;QACvC,mBAAmB,EAAE,qBAAkC;QACvD,gBAAgB,EAAE,kBAA+B;QACjD,cAAc,EAAE,gBAA6B;QAC7C,kBAAkB,EAAE,oBAAiC;QACrD,aAAa,EAAE,eAA4B;QAC3C,iBAAiB,EAAE,mBAAgC;QACnD,aAAa,EAAE,eAA4B;QAC3C,uBAAuB,EAAE,yBAAsC;QAC/D,cAAc,EAAE,gBAA6B;QAC7C,cAAc,EAAE,gBAA6B;QAC7C,YAAY,EAAE,cAA2B;QACzC,YAAY,EAAE,cAA2B;QACzC,oBAAoB,EAAE,sBAAmC;QACzD,kBAAkB,EAAE,oBAAiC;QACrD,gBAAgB,EAAE,kBAA+B;QACjD,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E,iBAA8B;QAC/C,YAAY,EAAE,cAA2B;QACzC,iBAAiB,EAAE,mBAAgC;QACnD,kBAAkB,EAAE,oBAAiC;QACrD,eAAe,EAAE,iBAA8B;QAC/C,WAAW,EAAE,aAA0B;QACvC,mBAAmB,EAAE,qBAAkC;QACvD,cAAc,EAAE,gBAA6B;QAC7C,oBAAoB,EAAE,sBAAmC;QACzD,WAAW,EAAE,aAA0B;QACvC,mBAAmB,EAAE,qBAAkC;QACvD,qCAAqC,EAAE,uCAAoD;QAC3F,qBAAqB,EAAE,uBAAoC;QAC3D,gBAAgB,EAAE,kBAA+B;QACjD,cAAc,EAAE,gBAA6B;KAC9C,CAAA;AACH,CAAC,EAhKgB,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAgK5B","sourcesContent":["/**\n * iCure Data Stack API Documentation\n * The iCure Data Stack Application API is the native interface to iCure. This version is obsolete, please use v2.\n *\n * OpenAPI spec version: v1\n *\n *\n * NOTE: This class is auto generated by the swagger code generator program.\n * https://github.com/swagger-api/swagger-codegen.git\n * Do not edit the class manually.\n */\nimport { LetterValue } from './LetterValue'\nimport { Periodicity } from './Periodicity'\nimport { Valorisation } from './Valorisation'\n\nexport class Tarification {\n constructor(json: JSON | any) {\n Object.assign(this as Tarification, json)\n }\n\n id?: string\n rev?: string\n /**\n * hard delete (unix epoch in ms) timestamp of the object. Filled automatically when deletePatient is called.\n */\n deletionDate?: number\n label?: { [key: string]: string }\n context?: string\n type?: string\n code?: string\n version?: string\n author?: string\n regions?: Array<string>\n periodicity?: Array<Periodicity>\n level?: number\n links?: Array<string>\n qualifiedLinks?: { [key: string]: Array<string> }\n flags?: Array<Tarification.FlagsEnum>\n searchTerms?: { [key: string]: Array<string> }\n data?: string\n appendices?: { [key: string]: string }\n disabled?: boolean\n valorisations?: Array<Valorisation>\n category?: { [key: string]: string }\n consultationCode?: boolean\n hasRelatedCode?: boolean\n needsPrescriber?: boolean\n relatedCodes?: Array<string>\n nGroup?: string\n letterValues?: Array<LetterValue>\n ngroup?: string\n}\nexport namespace Tarification {\n export type FlagsEnum =\n | 'male_only'\n | 'female_only'\n | 'deptkinesitherapy'\n | 'deptnursing'\n | 'deptgeneralpractice'\n | 'deptsocialworker'\n | 'deptpsychology'\n | 'deptadministrative'\n | 'deptdietetics'\n | 'deptspeechtherapy'\n | 'deptdentistry'\n | 'deptoccupationaltherapy'\n | 'depthealthcare'\n | 'deptgynecology'\n | 'deptpediatry'\n | 'deptalgology'\n | 'deptanatomopathology'\n | 'deptanesthesiology'\n | 'deptbacteriology'\n | 'deptcardiacsurgery'\n | 'deptcardiology'\n | 'deptchildandadolescentpsychiatry'\n | 'deptdermatology'\n | 'deptdiabetology'\n | 'deptemergency'\n | 'deptendocrinology'\n | 'deptgastroenterology'\n | 'deptgenetics'\n | 'deptgeriatry'\n | 'depthandsurgery'\n | 'depthematology'\n | 'deptinfectiousdisease'\n | 'deptintensivecare'\n | 'deptlaboratory'\n | 'deptmajorburns'\n | 'deptmaxillofacialsurgery'\n | 'deptmedicine'\n | 'deptmolecularbiology'\n | 'deptneonatalogy'\n | 'deptnephrology'\n | 'deptneurology'\n | 'deptneurosurgery'\n | 'deptnte'\n | 'deptnuclear'\n | 'deptnutritiondietetics'\n | 'deptobstetrics'\n | 'deptoncology'\n | 'deptophtalmology'\n | 'deptorthopedy'\n | 'deptpalliativecare'\n | 'deptpediatricintensivecare'\n | 'deptpediatricsurgery'\n | 'deptpharmacy'\n | 'deptphysicalmedecine'\n | 'deptphysiotherapy'\n | 'deptplasticandreparatorysurgery'\n | 'deptpneumology'\n | 'deptpodiatry'\n | 'deptpsychiatry'\n | 'deptradiology'\n | 'deptradiotherapy'\n | 'deptrevalidation'\n | 'deptrheumatology'\n | 'deptrhumatology'\n | 'deptsenology'\n | 'deptsocialservice'\n | 'deptsportsmedecine'\n | 'deptstomatology'\n | 'deptsurgery'\n | 'deptthoracicsurgery'\n | 'depttoxicology'\n | 'depttropicalmedecine'\n | 'depturology'\n | 'deptvascularsurgery'\n | 'deptvisceraldigestiveabdominalsurgery'\n | 'depttransplantsurgery'\n | 'deptpercutaneous'\n | 'deptchildbirth'\n export const FlagsEnum = {\n MaleOnly: 'male_only' as FlagsEnum,\n FemaleOnly: 'female_only' as FlagsEnum,\n Deptkinesitherapy: 'deptkinesitherapy' as FlagsEnum,\n Deptnursing: 'deptnursing' as FlagsEnum,\n Deptgeneralpractice: 'deptgeneralpractice' as FlagsEnum,\n Deptsocialworker: 'deptsocialworker' as FlagsEnum,\n Deptpsychology: 'deptpsychology' as FlagsEnum,\n Deptadministrative: 'deptadministrative' as FlagsEnum,\n Deptdietetics: 'deptdietetics' as FlagsEnum,\n Deptspeechtherapy: 'deptspeechtherapy' as FlagsEnum,\n Deptdentistry: 'deptdentistry' as FlagsEnum,\n Deptoccupationaltherapy: 'deptoccupationaltherapy' as FlagsEnum,\n Depthealthcare: 'depthealthcare' as FlagsEnum,\n Deptgynecology: 'deptgynecology' as FlagsEnum,\n Deptpediatry: 'deptpediatry' as FlagsEnum,\n Deptalgology: 'deptalgology' as FlagsEnum,\n Deptanatomopathology: 'deptanatomopathology' as FlagsEnum,\n Deptanesthesiology: 'deptanesthesiology' as FlagsEnum,\n Deptbacteriology: 'deptbacteriology' as FlagsEnum,\n Deptcardiacsurgery: 'deptcardiacsurgery' as FlagsEnum,\n Deptcardiology: 'deptcardiology' as FlagsEnum,\n Deptchildandadolescentpsychiatry: 'deptchildandadolescentpsychiatry' as FlagsEnum,\n Deptdermatology: 'deptdermatology' as FlagsEnum,\n Deptdiabetology: 'deptdiabetology' as FlagsEnum,\n Deptemergency: 'deptemergency' as FlagsEnum,\n Deptendocrinology: 'deptendocrinology' as FlagsEnum,\n Deptgastroenterology: 'deptgastroenterology' as FlagsEnum,\n Deptgenetics: 'deptgenetics' as FlagsEnum,\n Deptgeriatry: 'deptgeriatry' as FlagsEnum,\n Depthandsurgery: 'depthandsurgery' as FlagsEnum,\n Depthematology: 'depthematology' as FlagsEnum,\n Deptinfectiousdisease: 'deptinfectiousdisease' as FlagsEnum,\n Deptintensivecare: 'deptintensivecare' as FlagsEnum,\n Deptlaboratory: 'deptlaboratory' as FlagsEnum,\n Deptmajorburns: 'deptmajorburns' as FlagsEnum,\n Deptmaxillofacialsurgery: 'deptmaxillofacialsurgery' as FlagsEnum,\n Deptmedicine: 'deptmedicine' as FlagsEnum,\n Deptmolecularbiology: 'deptmolecularbiology' as FlagsEnum,\n Deptneonatalogy: 'deptneonatalogy' as FlagsEnum,\n Deptnephrology: 'deptnephrology' as FlagsEnum,\n Deptneurology: 'deptneurology' as FlagsEnum,\n Deptneurosurgery: 'deptneurosurgery' as FlagsEnum,\n Deptnte: 'deptnte' as FlagsEnum,\n Deptnuclear: 'deptnuclear' as FlagsEnum,\n Deptnutritiondietetics: 'deptnutritiondietetics' as FlagsEnum,\n Deptobstetrics: 'deptobstetrics' as FlagsEnum,\n Deptoncology: 'deptoncology' as FlagsEnum,\n Deptophtalmology: 'deptophtalmology' as FlagsEnum,\n Deptorthopedy: 'deptorthopedy' as FlagsEnum,\n Deptpalliativecare: 'deptpalliativecare' as FlagsEnum,\n Deptpediatricintensivecare: 'deptpediatricintensivecare' as FlagsEnum,\n Deptpediatricsurgery: 'deptpediatricsurgery' as FlagsEnum,\n Deptpharmacy: 'deptpharmacy' as FlagsEnum,\n Deptphysicalmedecine: 'deptphysicalmedecine' as FlagsEnum,\n Deptphysiotherapy: 'deptphysiotherapy' as FlagsEnum,\n Deptplasticandreparatorysurgery: 'deptplasticandreparatorysurgery' as FlagsEnum,\n Deptpneumology: 'deptpneumology' as FlagsEnum,\n Deptpodiatry: 'deptpodiatry' as FlagsEnum,\n Deptpsychiatry: 'deptpsychiatry' as FlagsEnum,\n Deptradiology: 'deptradiology' as FlagsEnum,\n Deptradiotherapy: 'deptradiotherapy' as FlagsEnum,\n Deptrevalidation: 'deptrevalidation' as FlagsEnum,\n Deptrheumatology: 'deptrheumatology' as FlagsEnum,\n Deptrhumatology: 'deptrhumatology' as FlagsEnum,\n Deptsenology: 'deptsenology' as FlagsEnum,\n Deptsocialservice: 'deptsocialservice' as FlagsEnum,\n Deptsportsmedecine: 'deptsportsmedecine' as FlagsEnum,\n Deptstomatology: 'deptstomatology' as FlagsEnum,\n Deptsurgery: 'deptsurgery' as FlagsEnum,\n Deptthoracicsurgery: 'deptthoracicsurgery' as FlagsEnum,\n Depttoxicology: 'depttoxicology' as FlagsEnum,\n Depttropicalmedecine: 'depttropicalmedecine' as FlagsEnum,\n Depturology: 'depturology' as FlagsEnum,\n Deptvascularsurgery: 'deptvascularsurgery' as FlagsEnum,\n Deptvisceraldigestiveabdominalsurgery: 'deptvisceraldigestiveabdominalsurgery' as FlagsEnum,\n Depttransplantsurgery: 'depttransplantsurgery' as FlagsEnum,\n Deptpercutaneous: 'deptpercutaneous' as FlagsEnum,\n Deptchildbirth: 'deptchildbirth' as FlagsEnum,\n }\n}\n"]}
1
+ {"version":3,"file":"Tarification.js","sourceRoot":"","sources":["../../../icc-api/model/Tarification.ts"],"names":[],"mappings":";;;AAeA,MAAa,YAAY;IACvB,YAAY,IAAgB;QAC1B,MAAM,CAAC,MAAM,CAAC,IAAoB,EAAE,IAAI,CAAC,CAAA;IAC3C,CAAC;CAiCF;AApCD,oCAoCC;AACD,WAAiB,YAAY;IAgFd,sBAAS,GAAG;QACvB,QAAQ,EAAE,WAAwB;QAClC,UAAU,EAAE,aAA0B;QACtC,iBAAiB,EAAE,mBAAgC;QACnD,WAAW,EAAE,aAA0B;QACvC,mBAAmB,EAAE,qBAAkC;QACvD,gBAAgB,EAAE,kBAA+B;QACjD,cAAc,EAAE,gBAA6B;QAC7C,kBAAkB,EAAE,oBAAiC;QACrD,aAAa,EAAE,eAA4B;QAC3C,iBAAiB,EAAE,mBAAgC;QACnD,aAAa,EAAE,eAA4B;QAC3C,uBAAuB,EAAE,yBAAsC;QAC/D,cAAc,EAAE,gBAA6B;QAC7C,cAAc,EAAE,gBAA6B;QAC7C,YAAY,EAAE,cAA2B;QACzC,YA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AA4B;QAC3C,gBAAgB,EAAE,kBAA+B;QACjD,gBAAgB,EAAE,kBAA+B;QACjD,gBAAgB,EAAE,kBAA+B;QACjD,eAAe,EAAE,iBAA8B;QAC/C,YAAY,EAAE,cAA2B;QACzC,iBAAiB,EAAE,mBAAgC;QACnD,kBAAkB,EAAE,oBAAiC;QACrD,eAAe,EAAE,iBAA8B;QAC/C,WAAW,EAAE,aAA0B;QACvC,mBAAmB,EAAE,qBAAkC;QACvD,cAAc,EAAE,gBAA6B;QAC7C,oBAAoB,EAAE,sBAAmC;QACzD,WAAW,EAAE,aAA0B;QACvC,mBAAmB,EAAE,qBAAkC;QACvD,qCAAqC,EAAE,uCAAoD;QAC3F,qBAAqB,EAAE,uBAAoC;QAC3D,gBAAgB,EAAE,kBAA+B;QACjD,cAAc,EAAE,gBAA6B;KAC9C,CAAA;AACH,CAAC,EAhKgB,YAAY,4BAAZ,YAAY,QAgK5B","sourcesContent":["/**\n * iCure Data Stack API Documentation\n * The iCure Data Stack Application API is the native interface to iCure. This version is obsolete, please use v2.\n *\n * OpenAPI spec version: v1\n *\n *\n * NOTE: This class is auto generated by the swagger code generator program.\n * https://github.com/swagger-api/swagger-codegen.git\n * Do not edit the class manually.\n */\nimport { LetterValue } from './LetterValue'\nimport { Periodicity } from './Periodicity'\nimport { Valorisation } from './Valorisation'\n\nexport class Tarification {\n constructor(json: JSON | any) {\n Object.assign(this as Tarification, json)\n }\n\n id?: string\n rev?: string\n /**\n * hard delete (unix epoch in ms) timestamp of the object. Filled automatically when deletePatient is called.\n */\n deletionDate?: number\n label?: { [key: string]: string }\n context?: string\n type?: string\n code?: string\n version?: string\n author?: string\n regions?: Array<string>\n periodicity?: Array<Periodicity>\n level?: number\n links?: Array<string>\n qualifiedLinks?: { [key: string]: Array<string> }\n flags?: Array<Tarification.FlagsEnum>\n searchTerms?: { [key: string]: Array<string> }\n data?: string\n appendices?: { [key: string]: string }\n disabled?: boolean\n valorisations?: Array<Valorisation>\n category?: { [key: string]: string }\n consultationCode?: boolean\n hasRelatedCode?: boolean\n needsPrescriber?: boolean\n relatedCodes?: Array<string>\n nGroup?: string\n letterValues?: Array<LetterValue>\n ngroup?: string\n}\nexport namespace Tarification {\n export type FlagsEnum =\n | 'male_only'\n | 'female_only'\n | 'deptkinesitherapy'\n | 'deptnursing'\n | 'deptgeneralpractice'\n | 'deptsocialworker'\n | 'deptpsychology'\n | 'deptadministrative'\n | 'deptdietetics'\n | 'deptspeechtherapy'\n | 'deptdentistry'\n | 'deptoccupationaltherapy'\n | 'depthealthcare'\n | 'deptgynecology'\n | 'deptpediatry'\n | 'deptalgology'\n | 'deptanatomopathology'\n | 'deptanesthesiology'\n | 'deptbacteriology'\n | 'deptcardiacsurgery'\n | 'deptcardiology'\n | 'deptchildandadolescentpsychiatry'\n | 'deptdermatology'\n | 'deptdiabetology'\n | 'deptemergency'\n | 'deptendocrinology'\n | 'deptgastroenterology'\n | 'deptgenetics'\n | 'deptgeriatry'\n | 'depthandsurgery'\n | 'depthematology'\n | 'deptinfectiousdisease'\n | 'deptintensivecare'\n | 'deptlaboratory'\n | 'deptmajorburns'\n | 'deptmaxillofacialsurgery'\n | 'deptmedicine'\n | 'deptmolecularbiology'\n | 'deptneonatalogy'\n | 'deptnephrology'\n | 'deptneurology'\n | 'deptneurosurgery'\n | 'deptnte'\n | 'deptnuclear'\n | 'deptnutritiondietetics'\n | 'deptobstetrics'\n | 'deptoncology'\n | 'deptophtalmology'\n | 'deptorthopedy'\n | 'deptpalliativecare'\n | 'deptpediatricintensivecare'\n | 'deptpediatricsurgery'\n | 'deptpharmacy'\n | 'deptphysicalmedecine'\n | 'deptphysiotherapy'\n | 'deptplasticandreparatorysurgery'\n | 'deptpneumology'\n | 'deptpodiatry'\n | 'deptpsychiatry'\n | 'deptradiology'\n | 'deptradiotherapy'\n | 'deptrevalidation'\n | 'deptrheumatology'\n | 'deptrhumatology'\n | 'deptsenology'\n | 'deptsocialservice'\n | 'deptsportsmedecine'\n | 'deptstomatology'\n | 'deptsurgery'\n | 'deptthoracicsurgery'\n | 'depttoxicology'\n | 'depttropicalmedecine'\n | 'depturology'\n | 'deptvascularsurgery'\n | 'deptvisceraldigestiveabdominalsurgery'\n | 'depttransplantsurgery'\n | 'deptpercutaneous'\n | 'deptchildbirth'\n export const FlagsEnum = {\n MaleOnly: 'male_only' as FlagsEnum,\n FemaleOnly: 'female_only' as FlagsEnum,\n Deptkinesitherapy: 'deptkinesitherapy' as FlagsEnum,\n Deptnursing: 'deptnursing' as FlagsEnum,\n Deptgeneralpractice: 'deptgeneralpractice' as FlagsEnum,\n Deptsocialworker: 'deptsocialworker' as FlagsEnum,\n Deptpsychology: 'deptpsychology' as FlagsEnum,\n Deptadministrative: 'deptadministrative' as FlagsEnum,\n Deptdietetics: 'deptdietetics' as FlagsEnum,\n Deptspeechtherapy: 'deptspeechtherapy' as FlagsEnum,\n Deptdentistry: 'deptdentistry' as FlagsEnum,\n Deptoccupationaltherapy: 'deptoccupationaltherapy' as FlagsEnum,\n Depthealthcare: 'depthealthcare' as FlagsEnum,\n Deptgynecology: 'deptgynecology' as FlagsEnum,\n Deptpediatry: 'deptpediatry' as FlagsEnum,\n Deptalgology: 'deptalgology' as FlagsEnum,\n Deptanatomopathology: 'deptanatomopathology' as FlagsEnum,\n Deptanesthesiology: 'deptanesthesiology' as FlagsEnum,\n Deptbacteriology: 'deptbacteriology' as FlagsEnum,\n Deptcardiacsurgery: 'deptcardiacsurgery' as FlagsEnum,\n Deptcardiology: 'deptcardiology' as FlagsEnum,\n Deptchildandadolescentpsychiatry: 'deptchildandadolescentpsychiatry' as FlagsEnum,\n Deptdermatology: 'deptdermatology' as FlagsEnum,\n Deptdiabetology: 'deptdiabetology' as FlagsEnum,\n Deptemergency: 'deptemergency' as FlagsEnum,\n Deptendocrinology: 'deptendocrinology' as FlagsEnum,\n Deptgastroenterology: 'deptgastroenterology' as FlagsEnum,\n Deptgenetics: 'deptgenetics' as FlagsEnum,\n Deptgeriatry: 'deptgeriatry' as FlagsEnum,\n Depthandsurgery: 'depthandsurgery' as FlagsEnum,\n Depthematology: 'depthematology' as FlagsEnum,\n Deptinfectiousdisease: 'deptinfectiousdisease' as FlagsEnum,\n Deptintensivecare: 'deptintensivecare' as FlagsEnum,\n Deptlaboratory: 'deptlaboratory' as FlagsEnum,\n Deptmajorburns: 'deptmajorburns' as FlagsEnum,\n Deptmaxillofacialsurgery: 'deptmaxillofacialsurgery' as FlagsEnum,\n Deptmedicine: 'deptmedicine' as FlagsEnum,\n Deptmolecularbiology: 'deptmolecularbiology' as FlagsEnum,\n Deptneonatalogy: 'deptneonatalogy' as FlagsEnum,\n Deptnephrology: 'deptnephrology' as FlagsEnum,\n Deptneurology: 'deptneurology' as FlagsEnum,\n Deptneurosurgery: 'deptneurosurgery' as FlagsEnum,\n Deptnte: 'deptnte' as FlagsEnum,\n Deptnuclear: 'deptnuclear' as FlagsEnum,\n Deptnutritiondietetics: 'deptnutritiondietetics' as FlagsEnum,\n Deptobstetrics: 'deptobstetrics' as FlagsEnum,\n Deptoncology: 'deptoncology' as FlagsEnum,\n Deptophtalmology: 'deptophtalmology' as FlagsEnum,\n Deptorthopedy: 'deptorthopedy' as FlagsEnum,\n Deptpalliativecare: 'deptpalliativecare' as FlagsEnum,\n Deptpediatricintensivecare: 'deptpediatricintensivecare' as FlagsEnum,\n Deptpediatricsurgery: 'deptpediatricsurgery' as FlagsEnum,\n Deptpharmacy: 'deptpharmacy' as FlagsEnum,\n Deptphysicalmedecine: 'deptphysicalmedecine' as FlagsEnum,\n Deptphysiotherapy: 'deptphysiotherapy' as FlagsEnum,\n Deptplasticandreparatorysurgery: 'deptplasticandreparatorysurgery' as FlagsEnum,\n Deptpneumology: 'deptpneumology' as FlagsEnum,\n Deptpodiatry: 'deptpodiatry' as FlagsEnum,\n Deptpsychiatry: 'deptpsychiatry' as FlagsEnum,\n Deptradiology: 'deptradiology' as FlagsEnum,\n Deptradiotherapy: 'deptradiotherapy' as FlagsEnum,\n Deptrevalidation: 'deptrevalidation' as FlagsEnum,\n Deptrheumatology: 'deptrheumatology' as FlagsEnum,\n Deptrhumatology: 'deptrhumatology' as FlagsEnum,\n Deptsenology: 'deptsenology' as FlagsEnum,\n Deptsocialservice: 'deptsocialservice' as FlagsEnum,\n Deptsportsmedecine: 'deptsportsmedecine' as FlagsEnum,\n Deptstomatology: 'deptstomatology' as FlagsEnum,\n Deptsurgery: 'deptsurgery' as FlagsEnum,\n Deptthoracicsurgery: 'deptthoracicsurgery' as FlagsEnum,\n Depttoxicology: 'depttoxicology' as FlagsEnum,\n Depttropicalmedecine: 'depttropicalmedecine' as FlagsEnum,\n Depturology: 'depturology' as FlagsEnum,\n Deptvascularsurgery: 'deptvascularsurgery' as FlagsEnum,\n Deptvisceraldigestiveabdominalsurgery: 'deptvisceraldigestiveabdominalsurgery' as FlagsEnum,\n Depttransplantsurgery: 'depttransplantsurgery' as FlagsEnum,\n Deptpercutaneous: 'deptpercutaneous' as FlagsEnum,\n Deptchildbirth: 'deptchildbirth' as FlagsEnum,\n }\n}\n"]}
@@ -38,5 +38,5 @@ exports.Telecom = Telecom;
38
38
  Other: 'other',
39
39
  Pager: 'pager',
40
40
  };
41
- })(Telecom = exports.Telecom || (exports.Telecom = {}));
41
+ })(Telecom || (exports.Telecom = Telecom = {}));
42
42
  //# sourceMappingURL=Telecom.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Telecom.js","sourceRoot":"","sources":["../../../icc-api/model/Telecom.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAEH;;GAEG;AACH,MAAa,OAAO;IAClB,YAAY,IAAgB;QAC1B,MAAM,CAAC,MAAM,CAAC,IAAe,EAAE,IAAI,CAAC,CAAA;IACtC,CAAC;CAYF;AAfD,0BAeC;AACD,WAAiB,OAAO;IAgBT,uBAAe,GAAG;QAC7B,MAAM,EAAE,QAA2B;QACnC,KAAK,EAAE,OAA0B;QACjC,KAAK,EAAE,OAA0B;QACjC,GAAG,EAAE,KAAwB;QAC7B,KAAK,EAAE,OAA0B;QACjC,EAAE,EAAE,IAAuB;QAC3B,UAAU,EAAE,YAA+B;QAC3C,UAAU,EAAE,YAA+B;QAC3C,QAAQ,EAAE,UAA6B;QACvC,GAAG,EAAE,KAAwB;QAC7B,KAAK,EAAE,OAA0B;QACjC,IAAI,EAAE,MAAyB;QAC/B,KAAK,EAAE,OAA0B;QACjC,KAAK,EAAE,OAA0B;KAClC,CAAA;AACH,CAAC,EAhCgB,OAAO,GAAP,eAAO,KAAP,eAAO,QAgCvB","sourcesContent":["/**\n * iCure Data Stack API Documentation\n * The iCure Data Stack Application API is the native interface to iCure. This version is obsolete, please use v2.\n *\n * OpenAPI spec version: v1\n *\n *\n * NOTE: This class is auto generated by the swagger code generator program.\n * https://github.com/swagger-api/swagger-codegen.git\n * Do not edit the class manually.\n */\n\n/**\n * This entity represents available contact details of a user, reachable by telecom methods\n */\nexport class Telecom {\n constructor(json: JSON | any) {\n Object.assign(this as Telecom, json)\n }\n\n /**\n * The type of telecom method being used, ex: landline phone, mobile phone, email, fax, etc.\n */\n telecomType?: Telecom.TelecomTypeEnum\n telecomNumber?: string\n telecomDescription?: string\n /**\n * The base64 encoded data of this object, formatted as JSON and encrypted in AES using the random master key from encryptionKeys.\n */\n encryptedSelf?: string\n}\nexport namespace Telecom {\n export type TelecomTypeEnum =\n | 'mobile'\n | 'phone'\n | 'email'\n | 'fax'\n | 'skype'\n | 'im'\n | 'medibridge'\n | 'ehealthbox'\n | 'apicrypt'\n | 'web'\n | 'print'\n | 'disk'\n | 'other'\n | 'pager'\n export const TelecomTypeEnum = {\n Mobile: 'mobile' as TelecomTypeEnum,\n Phone: 'phone' as TelecomTypeEnum,\n Email: 'email' as TelecomTypeEnum,\n Fax: 'fax' as TelecomTypeEnum,\n Skype: 'skype' as TelecomTypeEnum,\n Im: 'im' as TelecomTypeEnum,\n Medibridge: 'medibridge' as TelecomTypeEnum,\n Ehealthbox: 'ehealthbox' as TelecomTypeEnum,\n Apicrypt: 'apicrypt' as TelecomTypeEnum,\n Web: 'web' as TelecomTypeEnum,\n Print: 'print' as TelecomTypeEnum,\n Disk: 'disk' as TelecomTypeEnum,\n Other: 'other' as TelecomTypeEnum,\n Pager: 'pager' as TelecomTypeEnum,\n }\n}\n"]}
1
+ {"version":3,"file":"Telecom.js","sourceRoot":"","sources":["../../../icc-api/model/Telecom.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAEH;;GAEG;AACH,MAAa,OAAO;IAClB,YAAY,IAAgB;QAC1B,MAAM,CAAC,MAAM,CAAC,IAAe,EAAE,IAAI,CAAC,CAAA;IACtC,CAAC;CAYF;AAfD,0BAeC;AACD,WAAiB,OAAO;IAgBT,uBAAe,GAAG;QAC7B,MAAM,EAAE,QAA2B;QACnC,KAAK,EAAE,OAA0B;QACjC,KAAK,EAAE,OAA0B;QACjC,GAAG,EAAE,KAAwB;QAC7B,KAAK,EAAE,OAA0B;QACjC,EAAE,EAAE,IAAuB;QAC3B,UAAU,EAAE,YAA+B;QAC3C,UAAU,EAAE,YAA+B;QAC3C,QAAQ,EAAE,UAA6B;QACvC,GAAG,EAAE,KAAwB;QAC7B,KAAK,EAAE,OAA0B;QACjC,IAAI,EAAE,MAAyB;QAC/B,KAAK,EAAE,OAA0B;QACjC,KAAK,EAAE,OAA0B;KAClC,CAAA;AACH,CAAC,EAhCgB,OAAO,uBAAP,OAAO,QAgCvB","sourcesContent":["/**\n * iCure Data Stack API Documentation\n * The iCure Data Stack Application API is the native interface to iCure. This version is obsolete, please use v2.\n *\n * OpenAPI spec version: v1\n *\n *\n * NOTE: This class is auto generated by the swagger code generator program.\n * https://github.com/swagger-api/swagger-codegen.git\n * Do not edit the class manually.\n */\n\n/**\n * This entity represents available contact details of a user, reachable by telecom methods\n */\nexport class Telecom {\n constructor(json: JSON | any) {\n Object.assign(this as Telecom, json)\n }\n\n /**\n * The type of telecom method being used, ex: landline phone, mobile phone, email, fax, etc.\n */\n telecomType?: Telecom.TelecomTypeEnum\n telecomNumber?: string\n telecomDescription?: string\n /**\n * The base64 encoded data of this object, formatted as JSON and encrypted in AES using the random master key from encryptionKeys.\n */\n encryptedSelf?: string\n}\nexport namespace Telecom {\n export type TelecomTypeEnum =\n | 'mobile'\n | 'phone'\n | 'email'\n | 'fax'\n | 'skype'\n | 'im'\n | 'medibridge'\n | 'ehealthbox'\n | 'apicrypt'\n | 'web'\n | 'print'\n | 'disk'\n | 'other'\n | 'pager'\n export const TelecomTypeEnum = {\n Mobile: 'mobile' as TelecomTypeEnum,\n Phone: 'phone' as TelecomTypeEnum,\n Email: 'email' as TelecomTypeEnum,\n Fax: 'fax' as TelecomTypeEnum,\n Skype: 'skype' as TelecomTypeEnum,\n Im: 'im' as TelecomTypeEnum,\n Medibridge: 'medibridge' as TelecomTypeEnum,\n Ehealthbox: 'ehealthbox' as TelecomTypeEnum,\n Apicrypt: 'apicrypt' as TelecomTypeEnum,\n Web: 'web' as TelecomTypeEnum,\n Print: 'print' as TelecomTypeEnum,\n Disk: 'disk' as TelecomTypeEnum,\n Other: 'other' as TelecomTypeEnum,\n Pager: 'pager' as TelecomTypeEnum,\n }\n}\n"]}
@@ -12,5 +12,5 @@ var TopicRole;
12
12
  TopicRole["PARTICIPANT"] = "PARTICIPANT";
13
13
  TopicRole["ADMIN"] = "ADMIN";
14
14
  TopicRole["OWNER"] = "OWNER";
15
- })(TopicRole = exports.TopicRole || (exports.TopicRole = {}));
15
+ })(TopicRole || (exports.TopicRole = TopicRole = {}));
16
16
  //# sourceMappingURL=Topic.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Topic.js","sourceRoot":"","sources":["../../../icc-api/model/Topic.ts"],"names":[],"mappings":";;;AAKA,MAAa,KAAK;IACd,YAAY,IAAgB;QACxB,MAAM,CAAC,MAAM,CAAC,IAAa,EAAE,IAAI,CAAC,CAAA;IACtC,CAAC;CAmFJ;AAtFD,sBAsFC;AAED,IAAY,SAIX;AAJD,WAAY,SAAS;IACjB,wCAA2B,CAAA;IAC3B,4BAAe,CAAA;IACf,4BAAe,CAAA;AACnB,CAAC,EAJW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAIpB","sourcesContent":["import {CodeStub} from \"./CodeStub\";\nimport {SecurityMetadata} from \"./SecurityMetadata\";\nimport {Delegation} from \"./Delegation\";\nimport {EntityWithDelegationTypeName} from \"../../icc-x-api/utils/EntityWithDelegationTypeName\";\n\nexport class Topic {\n constructor(json: JSON | any) {\n Object.assign(this as Topic, json)\n }\n\n /**\n * The id of the topic. We encourage using either a v4 UUID or a HL7 Id.\n */\n id?: string\n /**\n * The revision of the topic in the database, used for conflict management / optimistic locking.\n */\n rev?: string\n /**\n * The timestamp (unix epoch in ms) of creation of this entity, will be filled automatically if missing. Not enforced by the application server.\n */\n created?: number\n /**\n * The timestamp (unix epoch in ms) of the latest modification of this entity, will be filled automatically if missing. Not enforced by the application server.\n */\n modified?: number\n /**\n * Name/basic description of the topic\n */\n description?: string\n /**\n * A tag is an item from a codification system that qualifies an entity as being member of a certain class, whatever the value it might have taken. If the tag qualifies the content of a field, it means that whatever the content of the field, the tag will always apply. For example, the label of a field is qualified using a tag. LOINC is a codification system typically used for tags.\n */\n tags?: Array<CodeStub>\n /**\n * A code is an item from a codification system that qualifies the content of this entity. SNOMED-CT, ICPC-2 or ICD-10 codifications systems can be used for codes\n */\n codes?: Array<CodeStub>\n /**\n * The id of the User that has created this entity, will be filled automatically if missing. Not enforced by the application server.\n */\n author?: string\n /**\n * The id of the HealthcareParty that is responsible for this entity, will be filled automatically if missing. Not enforced by the application server.\n */\n responsible?: string\n /**\n * The id of the medical location where this entity was created.\n */\n medicalLocationId?: string\n /**\n * Soft delete (unix epoch in ms) timestamp of the object.\n */\n endOfLife?: number\n /**\n * hard delete (unix epoch in ms) timestamp of the object. Filled automatically when deletePatient is called.\n */\n deletionDate?: number\n /**\n * List of participants to the topic and their role in the topic {@link TopicRole}\n *\n * This should not be used directly, in the future the format may change. Make sure to only edit this through methods of {@link IccTopicXApi}.\n */\n activeParticipants?: { [key: string]: TopicRole }\n\n linkedServices?: string[]\n\n linkedHealthElements?: string[]\n\n securityMetadata?: SecurityMetadata\n /**\n * The secretForeignKeys are filled at the to many end of a one to many relationship (for example inside Contact for the Patient -> Contacts relationship). Used when we want to find all contacts for a specific patient. These keys are in clear. You can have several to partition the medical document space.\n */\n secretForeignKeys?: Array<string>\n /**\n * The secretForeignKeys are filled at the to many end of a one to many relationship (for example inside Contact for the Patient -> Contacts relationship). Used when we want to find the patient for a specific contact. These keys are the encrypted id (using the hcParty key for the delegate) that can be found in clear inside the patient. ids encrypted using the hcParty keys.\n */\n\n cryptedForeignKeys?: { [key: string]: Array<Delegation> }\n /**\n * When a document is created, the responsible generates a cryptographically random master key (never to be used for something else than referencing from other entities). He/she encrypts it using his own AES exchange key and stores it as a delegation. The responsible is thus always in the delegations as well\n */\n delegations?: { [key: string]: Array<Delegation> }\n /**\n * When a document needs to be encrypted, the responsible generates a cryptographically random master key (different from the delegation key, never to appear in clear anywhere in the db. He/she encrypts it using his own AES exchange key and stores it as a delegation */\n encryptionKeys?: { [key: string]: Array<Delegation> }\n /**\n * The base64 encoded data of this object, formatted as JSON and encrypted in AES using the random master key from encryptionKeys.\n */\n encryptedSelf?: string\n \n}\n\nexport enum TopicRole {\n PARTICIPANT = 'PARTICIPANT',\n ADMIN = 'ADMIN',\n OWNER = 'OWNER',\n}\n"]}
1
+ {"version":3,"file":"Topic.js","sourceRoot":"","sources":["../../../icc-api/model/Topic.ts"],"names":[],"mappings":";;;AAKA,MAAa,KAAK;IACd,YAAY,IAAgB;QACxB,MAAM,CAAC,MAAM,CAAC,IAAa,EAAE,IAAI,CAAC,CAAA;IACtC,CAAC;CAmFJ;AAtFD,sBAsFC;AAED,IAAY,SAIX;AAJD,WAAY,SAAS;IACjB,wCAA2B,CAAA;IAC3B,4BAAe,CAAA;IACf,4BAAe,CAAA;AACnB,CAAC,EAJW,SAAS,yBAAT,SAAS,QAIpB","sourcesContent":["import {CodeStub} from \"./CodeStub\";\nimport {SecurityMetadata} from \"./SecurityMetadata\";\nimport {Delegation} from \"./Delegation\";\nimport {EntityWithDelegationTypeName} from \"../../icc-x-api/utils/EntityWithDelegationTypeName\";\n\nexport class Topic {\n constructor(json: JSON | any) {\n Object.assign(this as Topic, json)\n }\n\n /**\n * The id of the topic. We encourage using either a v4 UUID or a HL7 Id.\n */\n id?: string\n /**\n * The revision of the topic in the database, used for conflict management / optimistic locking.\n */\n rev?: string\n /**\n * The timestamp (unix epoch in ms) of creation of this entity, will be filled automatically if missing. Not enforced by the application server.\n */\n created?: number\n /**\n * The timestamp (unix epoch in ms) of the latest modification of this entity, will be filled automatically if missing. Not enforced by the application server.\n */\n modified?: number\n /**\n * Name/basic description of the topic\n */\n description?: string\n /**\n * A tag is an item from a codification system that qualifies an entity as being member of a certain class, whatever the value it might have taken. If the tag qualifies the content of a field, it means that whatever the content of the field, the tag will always apply. For example, the label of a field is qualified using a tag. LOINC is a codification system typically used for tags.\n */\n tags?: Array<CodeStub>\n /**\n * A code is an item from a codification system that qualifies the content of this entity. SNOMED-CT, ICPC-2 or ICD-10 codifications systems can be used for codes\n */\n codes?: Array<CodeStub>\n /**\n * The id of the User that has created this entity, will be filled automatically if missing. Not enforced by the application server.\n */\n author?: string\n /**\n * The id of the HealthcareParty that is responsible for this entity, will be filled automatically if missing. Not enforced by the application server.\n */\n responsible?: string\n /**\n * The id of the medical location where this entity was created.\n */\n medicalLocationId?: string\n /**\n * Soft delete (unix epoch in ms) timestamp of the object.\n */\n endOfLife?: number\n /**\n * hard delete (unix epoch in ms) timestamp of the object. Filled automatically when deletePatient is called.\n */\n deletionDate?: number\n /**\n * List of participants to the topic and their role in the topic {@link TopicRole}\n *\n * This should not be used directly, in the future the format may change. Make sure to only edit this through methods of {@link IccTopicXApi}.\n */\n activeParticipants?: { [key: string]: TopicRole }\n\n linkedServices?: string[]\n\n linkedHealthElements?: string[]\n\n securityMetadata?: SecurityMetadata\n /**\n * The secretForeignKeys are filled at the to many end of a one to many relationship (for example inside Contact for the Patient -> Contacts relationship). Used when we want to find all contacts for a specific patient. These keys are in clear. You can have several to partition the medical document space.\n */\n secretForeignKeys?: Array<string>\n /**\n * The secretForeignKeys are filled at the to many end of a one to many relationship (for example inside Contact for the Patient -> Contacts relationship). Used when we want to find the patient for a specific contact. These keys are the encrypted id (using the hcParty key for the delegate) that can be found in clear inside the patient. ids encrypted using the hcParty keys.\n */\n\n cryptedForeignKeys?: { [key: string]: Array<Delegation> }\n /**\n * When a document is created, the responsible generates a cryptographically random master key (never to be used for something else than referencing from other entities). He/she encrypts it using his own AES exchange key and stores it as a delegation. The responsible is thus always in the delegations as well\n */\n delegations?: { [key: string]: Array<Delegation> }\n /**\n * When a document needs to be encrypted, the responsible generates a cryptographically random master key (different from the delegation key, never to appear in clear anywhere in the db. He/she encrypts it using his own AES exchange key and stores it as a delegation */\n encryptionKeys?: { [key: string]: Array<Delegation> }\n /**\n * The base64 encoded data of this object, formatted as JSON and encrypted in AES using the random master key from encryptionKeys.\n */\n encryptedSelf?: string\n \n}\n\nexport enum TopicRole {\n PARTICIPANT = 'PARTICIPANT',\n ADMIN = 'ADMIN',\n OWNER = 'OWNER',\n}\n"]}
@@ -28,5 +28,5 @@ exports.TypedValueObject = TypedValueObject;
28
28
  CLOB: 'CLOB',
29
29
  JSON: 'JSON',
30
30
  };
31
- })(TypedValueObject = exports.TypedValueObject || (exports.TypedValueObject = {}));
31
+ })(TypedValueObject || (exports.TypedValueObject = TypedValueObject = {}));
32
32
  //# sourceMappingURL=TypedValueObject.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TypedValueObject.js","sourceRoot":"","sources":["../../../icc-api/model/TypedValueObject.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAEH,MAAa,gBAAgB;IAC3B,YAAY,IAAgB;QAC1B,MAAM,CAAC,MAAM,CAAC,IAAwB,EAAE,IAAI,CAAC,CAAA;IAC/C,CAAC;CAYF;AAfD,4CAeC;AACD,WAAiB,gBAAgB;IAElB,yBAAQ,GAAG;QACtB,OAAO,EAAE,SAAqB;QAC9B,OAAO,EAAE,SAAqB;QAC9B,MAAM,EAAE,QAAoB;QAC5B,MAAM,EAAE,QAAoB;QAC5B,IAAI,EAAE,MAAkB;QACxB,IAAI,EAAE,MAAkB;QACxB,IAAI,EAAE,MAAkB;KACzB,CAAA;AACH,CAAC,EAXgB,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAWhC","sourcesContent":["/**\n * iCure Data Stack API Documentation\n * The iCure Data Stack Application API is the native interface to iCure. This version is obsolete, please use v2.\n *\n * OpenAPI spec version: v1\n *\n *\n * NOTE: This class is auto generated by the swagger code generator program.\n * https://github.com/swagger-api/swagger-codegen.git\n * Do not edit the class manually.\n */\n\nexport class TypedValueObject {\n constructor(json: JSON | any) {\n Object.assign(this as TypedValueObject, json)\n }\n\n type?: TypedValueObject.TypeEnum\n booleanValue?: boolean\n integerValue?: number\n doubleValue?: number\n stringValue?: string\n dateValue?: number\n /**\n * The base64 encoded data of this object, formatted as JSON and encrypted in AES using the random master key from encryptionKeys.\n */\n encryptedSelf?: string\n}\nexport namespace TypedValueObject {\n export type TypeEnum = 'BOOLEAN' | 'INTEGER' | 'DOUBLE' | 'STRING' | 'DATE' | 'CLOB' | 'JSON'\n export const TypeEnum = {\n BOOLEAN: 'BOOLEAN' as TypeEnum,\n INTEGER: 'INTEGER' as TypeEnum,\n DOUBLE: 'DOUBLE' as TypeEnum,\n STRING: 'STRING' as TypeEnum,\n DATE: 'DATE' as TypeEnum,\n CLOB: 'CLOB' as TypeEnum,\n JSON: 'JSON' as TypeEnum,\n }\n}\n"]}
1
+ {"version":3,"file":"TypedValueObject.js","sourceRoot":"","sources":["../../../icc-api/model/TypedValueObject.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAEH,MAAa,gBAAgB;IAC3B,YAAY,IAAgB;QAC1B,MAAM,CAAC,MAAM,CAAC,IAAwB,EAAE,IAAI,CAAC,CAAA;IAC/C,CAAC;CAYF;AAfD,4CAeC;AACD,WAAiB,gBAAgB;IAElB,yBAAQ,GAAG;QACtB,OAAO,EAAE,SAAqB;QAC9B,OAAO,EAAE,SAAqB;QAC9B,MAAM,EAAE,QAAoB;QAC5B,MAAM,EAAE,QAAoB;QAC5B,IAAI,EAAE,MAAkB;QACxB,IAAI,EAAE,MAAkB;QACxB,IAAI,EAAE,MAAkB;KACzB,CAAA;AACH,CAAC,EAXgB,gBAAgB,gCAAhB,gBAAgB,QAWhC","sourcesContent":["/**\n * iCure Data Stack API Documentation\n * The iCure Data Stack Application API is the native interface to iCure. This version is obsolete, please use v2.\n *\n * OpenAPI spec version: v1\n *\n *\n * NOTE: This class is auto generated by the swagger code generator program.\n * https://github.com/swagger-api/swagger-codegen.git\n * Do not edit the class manually.\n */\n\nexport class TypedValueObject {\n constructor(json: JSON | any) {\n Object.assign(this as TypedValueObject, json)\n }\n\n type?: TypedValueObject.TypeEnum\n booleanValue?: boolean\n integerValue?: number\n doubleValue?: number\n stringValue?: string\n dateValue?: number\n /**\n * The base64 encoded data of this object, formatted as JSON and encrypted in AES using the random master key from encryptionKeys.\n */\n encryptedSelf?: string\n}\nexport namespace TypedValueObject {\n export type TypeEnum = 'BOOLEAN' | 'INTEGER' | 'DOUBLE' | 'STRING' | 'DATE' | 'CLOB' | 'JSON'\n export const TypeEnum = {\n BOOLEAN: 'BOOLEAN' as TypeEnum,\n INTEGER: 'INTEGER' as TypeEnum,\n DOUBLE: 'DOUBLE' as TypeEnum,\n STRING: 'STRING' as TypeEnum,\n DATE: 'DATE' as TypeEnum,\n CLOB: 'CLOB' as TypeEnum,\n JSON: 'JSON' as TypeEnum,\n }\n}\n"]}
@@ -48,5 +48,5 @@ exports.User = User;
48
48
  }
49
49
  }
50
50
  User.SystemMetadata = SystemMetadata;
51
- })(User = exports.User || (exports.User = {}));
51
+ })(User || (exports.User = User = {}));
52
52
  //# sourceMappingURL=User.js.map
@@ -1 +1 @@
1
- {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* iCure Data Stack API Documentation\n * The iCure Data Stack Application API is the native interface to iCure. This version is obsolete, please use v2.\n *\n * OpenAPI spec version: v1\n *\n *\n * NOTE: This class is auto generated by the swagger code generator program.\n * https://github.com/swagger-api/swagger-codegen.git\n * Do not edit the class manually.\n */\nimport { AuthenticationToken } from './AuthenticationToken'\nimport { Permission } from './Permission'\nimport { PropertyStub } from './PropertyStub'\nimport { Identifier } from './Identifier'\n\n/**\n * This entity is a root level object. It represents an user that can log in to the iCure platform. It is serialized in JSON and saved in the underlying icure-base CouchDB database.\n */\nexport class User {\n constructor(json: JSON | any) {\n Object.assign(this as User, json)\n }\n\n /**\n * the Id of the user. We encourage using either a v4 UUID or a HL7 Id.\n */\n id?: string\n /**\n * the revision of the user in the database, used for conflict management / optimistic locking.\n */\n rev?: string\n identifier?: Array<Identifier>\n /**\n * hard delete (unix epoch in ms) timestamp of the object. Filled automatically when deletePatient is called.\n */\n deletionDate?: number\n created?: number\n /**\n * Last name of the user. This is the official last name that should be used for official administrative purposes.\n */\n name?: string\n /**\n * Extra properties for the user. Those properties are typed (see class Property)\n */\n properties?: Array<PropertyStub>\n /**\n * If permission to modify patient data is granted or revoked\n */\n permissions?: Array<Permission>\n /**\n * Roles specified for the user\n */\n roles?: Array<string>\n /**\n * Authorization source for user. 'Database', 'ldap' or 'token'\n */\n type?: User.TypeEnum\n /**\n * State of user's activeness: 'Active', 'Disabled' or 'Registering'\n */\n status?: User.StatusEnum\n /**\n * Username for this user. We encourage using an email address\n */\n login?: string\n /**\n * Hashed version of the password (BCrypt is used for hashing)\n */\n passwordHash?: string\n /**\n * Secret token used to verify 2fa\n */\n secret?: string\n /**\n * Whether the user has activated two factors authentication\n */\n use2fa?: boolean\n /**\n * id of the group (practice/hospital) the user is member of\n */\n groupId?: string\n /**\n * Id of the healthcare party if the user is a healthcare party.\n */\n healthcarePartyId?: string\n /**\n * Id of the patient if the user is a patient\n */\n patientId?: string\n /**\n * Id of the device if the user is a device\n */\n deviceId?: string\n /**\n * Delegations that are automatically generated client side when a new database object is created by this user\n */\n autoDelegations?: { [key in User.AutoDelegationTagEnum]?: Array<string> }\n /**\n * the timestamp (unix epoch in ms) of creation of the user, will be filled automatically if missing. Not enforced by the application server.\n */\n createdDate?: number\n /**\n * the timestamp (unix epoch in ms) of the latest validation of the terms of use of the application\n */\n termsOfUseDate?: number\n /**\n * email address of the user (used for token exchange or password recovery).\n */\n email?: string\n /**\n * mobile phone of the user (used for token exchange or password recovery).\n */\n mobilePhone?: string\n applicationTokens?: { [key: string]: string }\n /**\n * Encrypted and time-limited Authentication tokens used for inter-applications authentication\n */\n authenticationTokens?: { [key: string]: AuthenticationToken }\n /**\n * System metadata for the user: this configuration is read only, and defined only when using the cloud version of iCure.\n */\n systemMetadata?: User.SystemMetadata\n}\nexport namespace User {\n export type TypeEnum = 'database' | 'ldap' | 'token'\n export const TypeEnum = {\n Database: 'database' as TypeEnum,\n Ldap: 'ldap' as TypeEnum,\n Token: 'token' as TypeEnum,\n }\n export type StatusEnum = 'ACTIVE' | 'DISABLED' | 'REGISTERING'\n export const StatusEnum = {\n ACTIVE: 'ACTIVE' as StatusEnum,\n DISABLED: 'DISABLED' as StatusEnum,\n REGISTERING: 'REGISTERING' as StatusEnum,\n }\n export type AutoDelegationTagEnum =\n | 'all'\n | 'administrativeData'\n | 'generalInformation'\n | 'financialInformation'\n | 'medicalInformation'\n | 'sensitiveInformation'\n | 'confidentialInformation'\n | 'cdItemRisk'\n | 'cdItemFamilyRisk'\n | 'cdItemHealthcareelement'\n | 'cdItemHealthcareapproach'\n | 'cdItemAllergy'\n | 'cdItemDiagnosis'\n | 'cdItemLab'\n | 'cdItemResult'\n | 'cdItemParameter'\n | 'cdItemMedication'\n | 'cdItemTreatment'\n | 'cdItemVaccine'\n export const AutoDelegationTagEnum = {\n all: 'all' as AutoDelegationTagEnum,\n administrativeData: 'administrativeData' as AutoDelegationTagEnum,\n generalInformation: 'generalInformation' as AutoDelegationTagEnum,\n financialInformation: 'financialInformation' as AutoDelegationTagEnum,\n medicalInformation: 'medicalInformation' as AutoDelegationTagEnum,\n sensitiveInformation: 'sensitiveInformation' as AutoDelegationTagEnum,\n confidentialInformation: 'confidentialInformation' as AutoDelegationTagEnum,\n cdItemRisk: 'cdItemRisk' as AutoDelegationTagEnum,\n cdItemFamilyRisk: 'cdItemFamilyRisk' as AutoDelegationTagEnum,\n cdItemHealthcareelement: 'cdItemHealthcareelement' as AutoDelegationTagEnum,\n cdItemHealthcareapproach: 'cdItemHealthcareapproach' as AutoDelegationTagEnum,\n cdItemAllergy: 'cdItemAllergy' as AutoDelegationTagEnum,\n cdItemDiagnosis: 'cdItemDiagnosis' as AutoDelegationTagEnum,\n cdItemLab: 'cdItemLab' as AutoDelegationTagEnum,\n cdItemResult: 'cdItemResult' as AutoDelegationTagEnum,\n cdItemParameter: 'cdItemParameter' as AutoDelegationTagEnum,\n cdItemMedication: 'cdItemMedication' as AutoDelegationTagEnum,\n cdItemTreatment: 'cdItemTreatment' as AutoDelegationTagEnum,\n cdItemVaccine: 'cdItemVaccine' as AutoDelegationTagEnum,\n }\n\n export class SystemMetadata {\n constructor(json: JSON | any) {\n Object.assign(this as User, json)\n }\n\n /**\n * The roles of the user that the cloud environment recognizes\n */\n roles?: string[]\n /**\n * If the user is considered as an admin by the cloud environment\n */\n isAdmin?: boolean\n /**\n * True if the content of roles is inherited from the user's group configuration, false if the roles are defined specifically for the use\n */\n inheritsRoles?: boolean\n }\n}\n"]}
1
+ {"version":3,"file":"User.js","sourceRoot":"","sources":["../../../icc-api/model/User.ts"],"names":[],"mappings":";;;AAgBA;;GAEG;AACH,MAAa,IAAI;IACf,YAAY,IAAgB;QAC1B,MAAM,CAAC,MAAM,CAAC,IAAY,EAAE,IAAI,CAAC,CAAA;IACnC,CAAC;CAqGF;AAxGD,oBAwGC;AACD,WAAiB,IAAI;IAEN,aAAQ,GAAG;QACtB,QAAQ,EAAE,UAAsB;QAChC,IAAI,EAAE,MAAkB;QACxB,KAAK,EAAE,OAAmB;KAC3B,CAAA;IAEY,eAAU,GAAG;QACxB,MAAM,EAAE,QAAsB;QAC9B,QAAQ,EAAE,UAAwB;QAClC,WAAW,EAAE,aAA2B;KACzC,CAAA;IAqBY,0BAAqB,GAAG;QACnC,GAAG,EAAE,KAA8B;QACnC,kBAAkB,EAAE,oBAA6C;QACjE,kBAAkB,EAAE,oBAA6C;QACjE,oBAAoB,EAAE,sBAA+C;QACrE,kBAAkB,EAAE,oBAA6C;QACjE,oBAAoB,EAAE,sBAA+C;QACrE,uBAAuB,EAAE,yBAAkD;QAC3E,UAAU,EAAE,YAAqC;QACjD,gBAAgB,EAAE,kBAA2C;QAC7D,uBAAuB,EAAE,yBAAkD;QAC3E,wBAAwB,EAAE,0BAAmD;QAC7E,aAAa,EAAE,eAAwC;QACvD,eAAe,EAAE,iBAA0C;QAC3D,SAAS,EAAE,WAAoC;QAC/C,YAAY,EAAE,cAAuC;QACrD,eAAe,EAAE,iBAA0C;QAC3D,gBAAgB,EAAE,kBAA2C;QAC7D,eAAe,EAAE,iBAA0C;QAC3D,aAAa,EAAE,eAAwC;KACxD,CAAA;IAED,MAAa,cAAc;QACzB,YAAY,IAAgB;YAC1B,MAAM,CAAC,MAAM,CAAC,IAAY,EAAE,IAAI,CAAC,CAAA;QACnC,CAAC;KAcF;IAjBY,mBAAc,iBAiB1B,CAAA;AACH,CAAC,EAzEgB,IAAI,oBAAJ,IAAI,QAyEpB","sourcesContent":["/**\n * iCure Data Stack API Documentation\n * The iCure Data Stack Application API is the native interface to iCure. This version is obsolete, please use v2.\n *\n * OpenAPI spec version: v1\n *\n *\n * NOTE: This class is auto generated by the swagger code generator program.\n * https://github.com/swagger-api/swagger-codegen.git\n * Do not edit the class manually.\n */\nimport { AuthenticationToken } from './AuthenticationToken'\nimport { Permission } from './Permission'\nimport { PropertyStub } from './PropertyStub'\nimport { Identifier } from './Identifier'\n\n/**\n * This entity is a root level object. It represents an user that can log in to the iCure platform. It is serialized in JSON and saved in the underlying icure-base CouchDB database.\n */\nexport class User {\n constructor(json: JSON | any) {\n Object.assign(this as User, json)\n }\n\n /**\n * the Id of the user. We encourage using either a v4 UUID or a HL7 Id.\n */\n id?: string\n /**\n * the revision of the user in the database, used for conflict management / optimistic locking.\n */\n rev?: string\n identifier?: Array<Identifier>\n /**\n * hard delete (unix epoch in ms) timestamp of the object. Filled automatically when deletePatient is called.\n */\n deletionDate?: number\n created?: number\n /**\n * Last name of the user. This is the official last name that should be used for official administrative purposes.\n */\n name?: string\n /**\n * Extra properties for the user. Those properties are typed (see class Property)\n */\n properties?: Array<PropertyStub>\n /**\n * If permission to modify patient data is granted or revoked\n */\n permissions?: Array<Permission>\n /**\n * Roles specified for the user\n */\n roles?: Array<string>\n /**\n * Authorization source for user. 'Database', 'ldap' or 'token'\n */\n type?: User.TypeEnum\n /**\n * State of user's activeness: 'Active', 'Disabled' or 'Registering'\n */\n status?: User.StatusEnum\n /**\n * Username for this user. We encourage using an email address\n */\n login?: string\n /**\n * Hashed version of the password (BCrypt is used for hashing)\n */\n passwordHash?: string\n /**\n * Secret token used to verify 2fa\n */\n secret?: string\n /**\n * Whether the user has activated two factors authentication\n */\n use2fa?: boolean\n /**\n * id of the group (practice/hospital) the user is member of\n */\n groupId?: string\n /**\n * Id of the healthcare party if the user is a healthcare party.\n */\n healthcarePartyId?: string\n /**\n * Id of the patient if the user is a patient\n */\n patientId?: string\n /**\n * Id of the device if the user is a device\n */\n deviceId?: string\n /**\n * Delegations that are automatically generated client side when a new database object is created by this user\n */\n autoDelegations?: { [key in User.AutoDelegationTagEnum]?: Array<string> }\n /**\n * the timestamp (unix epoch in ms) of creation of the user, will be filled automatically if missing. Not enforced by the application server.\n */\n createdDate?: number\n /**\n * the timestamp (unix epoch in ms) of the latest validation of the terms of use of the application\n */\n termsOfUseDate?: number\n /**\n * email address of the user (used for token exchange or password recovery).\n */\n email?: string\n /**\n * mobile phone of the user (used for token exchange or password recovery).\n */\n mobilePhone?: string\n applicationTokens?: { [key: string]: string }\n /**\n * Encrypted and time-limited Authentication tokens used for inter-applications authentication\n */\n authenticationTokens?: { [key: string]: AuthenticationToken }\n /**\n * System metadata for the user: this configuration is read only, and defined only when using the cloud version of iCure.\n */\n systemMetadata?: User.SystemMetadata\n}\nexport namespace User {\n export type TypeEnum = 'database' | 'ldap' | 'token'\n export const TypeEnum = {\n Database: 'database' as TypeEnum,\n Ldap: 'ldap' as TypeEnum,\n Token: 'token' as TypeEnum,\n }\n export type StatusEnum = 'ACTIVE' | 'DISABLED' | 'REGISTERING'\n export const StatusEnum = {\n ACTIVE: 'ACTIVE' as StatusEnum,\n DISABLED: 'DISABLED' as StatusEnum,\n REGISTERING: 'REGISTERING' as StatusEnum,\n }\n export type AutoDelegationTagEnum =\n | 'all'\n | 'administrativeData'\n | 'generalInformation'\n | 'financialInformation'\n | 'medicalInformation'\n | 'sensitiveInformation'\n | 'confidentialInformation'\n | 'cdItemRisk'\n | 'cdItemFamilyRisk'\n | 'cdItemHealthcareelement'\n | 'cdItemHealthcareapproach'\n | 'cdItemAllergy'\n | 'cdItemDiagnosis'\n | 'cdItemLab'\n | 'cdItemResult'\n | 'cdItemParameter'\n | 'cdItemMedication'\n | 'cdItemTreatment'\n | 'cdItemVaccine'\n export const AutoDelegationTagEnum = {\n all: 'all' as AutoDelegationTagEnum,\n administrativeData: 'administrativeData' as AutoDelegationTagEnum,\n generalInformation: 'generalInformation' as AutoDelegationTagEnum,\n financialInformation: 'financialInformation' as AutoDelegationTagEnum,\n medicalInformation: 'medicalInformation' as AutoDelegationTagEnum,\n sensitiveInformation: 'sensitiveInformation' as AutoDelegationTagEnum,\n confidentialInformation: 'confidentialInformation' as AutoDelegationTagEnum,\n cdItemRisk: 'cdItemRisk' as AutoDelegationTagEnum,\n cdItemFamilyRisk: 'cdItemFamilyRisk' as AutoDelegationTagEnum,\n cdItemHealthcareelement: 'cdItemHealthcareelement' as AutoDelegationTagEnum,\n cdItemHealthcareapproach: 'cdItemHealthcareapproach' as AutoDelegationTagEnum,\n cdItemAllergy: 'cdItemAllergy' as AutoDelegationTagEnum,\n cdItemDiagnosis: 'cdItemDiagnosis' as AutoDelegationTagEnum,\n cdItemLab: 'cdItemLab' as AutoDelegationTagEnum,\n cdItemResult: 'cdItemResult' as AutoDelegationTagEnum,\n cdItemParameter: 'cdItemParameter' as AutoDelegationTagEnum,\n cdItemMedication: 'cdItemMedication' as AutoDelegationTagEnum,\n cdItemTreatment: 'cdItemTreatment' as AutoDelegationTagEnum,\n cdItemVaccine: 'cdItemVaccine' as AutoDelegationTagEnum,\n }\n\n export class SystemMetadata {\n constructor(json: JSON | any) {\n Object.assign(this as User, json)\n }\n\n /**\n * The roles of the user that the cloud environment recognizes\n */\n roles?: string[]\n /**\n * If the user is considered as an admin by the cloud environment\n */\n isAdmin?: boolean\n /**\n * True if the content of roles is inherited from the user's group configuration, false if the roles are defined specifically for the use\n */\n inheritsRoles?: boolean\n }\n}\n"]}
@@ -10,5 +10,5 @@ var UserTypeEnum;
10
10
  UserTypeEnum["Hcp"] = "HCP";
11
11
  UserTypeEnum["Device"] = "DEVICE";
12
12
  UserTypeEnum["User"] = "USER";
13
- })(UserTypeEnum = exports.UserTypeEnum || (exports.UserTypeEnum = {}));
13
+ })(UserTypeEnum || (exports.UserTypeEnum = UserTypeEnum = {}));
14
14
  //# sourceMappingURL=UserTypeEnum.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UserTypeEnum.js","sourceRoot":"","sources":["../../../icc-api/model/UserTypeEnum.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,2BAAW,CAAA;IACX,iCAAiB,CAAA;IACjB,6BAAa,CAAA;AACf,CAAC,EALW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAKvB","sourcesContent":["/**\n * Represents the type of a owner\n */\nexport enum UserTypeEnum {\n Patient = 'PATIENT',\n Hcp = 'HCP',\n Device = 'DEVICE',\n User = 'USER',\n}\n"]}
1
+ {"version":3,"file":"UserTypeEnum.js","sourceRoot":"","sources":["../../../icc-api/model/UserTypeEnum.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,2BAAW,CAAA;IACX,iCAAiB,CAAA;IACjB,6BAAa,CAAA;AACf,CAAC,EALW,YAAY,4BAAZ,YAAY,QAKvB","sourcesContent":["/**\n * Represents the type of a owner\n */\nexport enum UserTypeEnum {\n Patient = 'PATIENT',\n Hcp = 'HCP',\n Device = 'DEVICE',\n User = 'USER',\n}\n"]}
@@ -12,5 +12,5 @@ exports.VirtualIngredient = VirtualIngredient;
12
12
  ACTIVESUBSTANCE: 'ACTIVE_SUBSTANCE',
13
13
  EXCIPIENT: 'EXCIPIENT',
14
14
  };
15
- })(VirtualIngredient = exports.VirtualIngredient || (exports.VirtualIngredient = {}));
15
+ })(VirtualIngredient || (exports.VirtualIngredient = VirtualIngredient = {}));
16
16
  //# sourceMappingURL=VirtualIngredient.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"VirtualIngredient.js","sourceRoot":"","sources":["../../../icc-api/model/VirtualIngredient.ts"],"names":[],"mappings":";;;AAcA,MAAa,iBAAiB;IAC5B,YAAY,IAAgB;QAC1B,MAAM,CAAC,MAAM,CAAC,IAAyB,EAAE,IAAI,CAAC,CAAA;IAChD,CAAC;CAQF;AAXD,8CAWC;AACD,WAAiB,iBAAiB;IAEnB,0BAAQ,GAAG;QACtB,eAAe,EAAE,kBAA8B;QAC/C,SAAS,EAAE,WAAuB;KACnC,CAAA;AACH,CAAC,EANgB,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAMjC","sourcesContent":["/**\n * iCure Data Stack API Documentation\n * The iCure Data Stack Application API is the native interface to iCure. This version is obsolete, please use v2.\n *\n * OpenAPI spec version: v1\n *\n *\n * NOTE: This class is auto generated by the swagger code generator program.\n * https://github.com/swagger-api/swagger-codegen.git\n * Do not edit the class manually.\n */\nimport { StrengthRange } from './StrengthRange'\nimport { SubstanceStub } from './SubstanceStub'\n\nexport class VirtualIngredient {\n constructor(json: JSON | any) {\n Object.assign(this as VirtualIngredient, json)\n }\n\n from?: number\n to?: number\n rank?: number\n type?: VirtualIngredient.TypeEnum\n strengthRange?: StrengthRange\n substance?: SubstanceStub\n}\nexport namespace VirtualIngredient {\n export type TypeEnum = 'ACTIVE_SUBSTANCE' | 'EXCIPIENT'\n export const TypeEnum = {\n ACTIVESUBSTANCE: 'ACTIVE_SUBSTANCE' as TypeEnum,\n EXCIPIENT: 'EXCIPIENT' as TypeEnum,\n }\n}\n"]}
1
+ {"version":3,"file":"VirtualIngredient.js","sourceRoot":"","sources":["../../../icc-api/model/VirtualIngredient.ts"],"names":[],"mappings":";;;AAcA,MAAa,iBAAiB;IAC5B,YAAY,IAAgB;QAC1B,MAAM,CAAC,MAAM,CAAC,IAAyB,EAAE,IAAI,CAAC,CAAA;IAChD,CAAC;CAQF;AAXD,8CAWC;AACD,WAAiB,iBAAiB;IAEnB,0BAAQ,GAAG;QACtB,eAAe,EAAE,kBAA8B;QAC/C,SAAS,EAAE,WAAuB;KACnC,CAAA;AACH,CAAC,EANgB,iBAAiB,iCAAjB,iBAAiB,QAMjC","sourcesContent":["/**\n * iCure Data Stack API Documentation\n * The iCure Data Stack Application API is the native interface to iCure. This version is obsolete, please use v2.\n *\n * OpenAPI spec version: v1\n *\n *\n * NOTE: This class is auto generated by the swagger code generator program.\n * https://github.com/swagger-api/swagger-codegen.git\n * Do not edit the class manually.\n */\nimport { StrengthRange } from './StrengthRange'\nimport { SubstanceStub } from './SubstanceStub'\n\nexport class VirtualIngredient {\n constructor(json: JSON | any) {\n Object.assign(this as VirtualIngredient, json)\n }\n\n from?: number\n to?: number\n rank?: number\n type?: VirtualIngredient.TypeEnum\n strengthRange?: StrengthRange\n substance?: SubstanceStub\n}\nexport namespace VirtualIngredient {\n export type TypeEnum = 'ACTIVE_SUBSTANCE' | 'EXCIPIENT'\n export const TypeEnum = {\n ACTIVESUBSTANCE: 'ACTIVE_SUBSTANCE' as TypeEnum,\n EXCIPIENT: 'EXCIPIENT' as TypeEnum,\n }\n}\n"]}
@@ -30,5 +30,5 @@ exports.RecoveryData = RecoveryData;
30
30
  */
31
31
  Type["EXCHANGE_KEY_RECOVERY"] = "EXCHANGE_KEY_RECOVERY";
32
32
  })(Type = RecoveryData.Type || (RecoveryData.Type = {}));
33
- })(RecoveryData = exports.RecoveryData || (exports.RecoveryData = {}));
33
+ })(RecoveryData || (exports.RecoveryData = RecoveryData = {}));
34
34
  //# sourceMappingURL=RecoveryData.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RecoveryData.js","sourceRoot":"","sources":["../../../../icc-api/model/internal/RecoveryData.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,MAAa,YAAY;IACvB,YAAY,IAAgB;QAC1B,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,CAAC,IAAI,CAAC,IAAI;YACtD,MAAM,IAAI,KAAK,CAAC,uDAAuD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QAChG,MAAM,CAAC,MAAM,CAAC,IAAoB,EAAE,IAAI,CAAC,CAAA;IAC3C,CAAC;CAyBF;AA9BD,oCA8BC;AACD,WAAiB,YAAY;IAC3B;;OAEG;IACH,IAAY,IAYX;IAZD,WAAY,IAAI;QACd;;;WAGG;QACH,6CAAqC,CAAA;QACrC;;;;WAIG;QACH,uDAA+C,CAAA;IACjD,CAAC,EAZW,IAAI,GAAJ,iBAAI,KAAJ,iBAAI,QAYf;AACH,CAAC,EAjBgB,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAiB5B","sourcesContent":["/**\n * @internal this entity is meant for internal use only\n */\nexport class RecoveryData {\n constructor(json: JSON | any) {\n if (!json.recipient || !json.encryptedSelf || !json.type)\n throw new Error(`Recovery data json is missing required properties.\\n${JSON.stringify(json)}`)\n Object.assign(this as RecoveryData, json)\n }\n\n id?: string\n rev?: string\n /**\n * Id of the data owner that this recovery data is meant for\n */\n recipient!: string\n /**\n * Encrypted recovery data. The structure of the decrypted data depends on the [type] of the recovery data.\n */\n encryptedSelf!: string\n /**\n * Type of the recovery data.\n */\n type!: RecoveryData.Type\n /**\n * Timestamp (unix epoch in ms) at which this recovery data will expire. If null, this recovery data will never\n * expire. Negative values or zero mean the data is already expired.\n */\n expirationInstant?: number\n /**\n * hard delete (unix epoch in ms) timestamp of the object. Filled automatically when the delete method is called.\n */\n deletionDate?: number\n}\nexport namespace RecoveryData {\n /**\n * Represents possible types of recovery data.\n */\n export enum Type {\n /**\n * This recovery data is meant to be used to recover a keypair of the recipient. This could be for making a key\n * available on another device, or for recovering a keypair that has been fully lost.\n */\n KEYPAIR_RECOVERY = 'KEYPAIR_RECOVERY',\n /**\n * This recovery data is meant to be used to recover an exchange key of the recipient. The main purpose of this\n * is to allow data owners to share data with other data owners that do not have created a keypair yet, but it\n * can also be used as part of the give-access-back recovery mechanism.\n */\n EXCHANGE_KEY_RECOVERY = 'EXCHANGE_KEY_RECOVERY',\n }\n}\n"]}
1
+ {"version":3,"file":"RecoveryData.js","sourceRoot":"","sources":["../../../../icc-api/model/internal/RecoveryData.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,MAAa,YAAY;IACvB,YAAY,IAAgB;QAC1B,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,CAAC,IAAI,CAAC,IAAI;YACtD,MAAM,IAAI,KAAK,CAAC,uDAAuD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QAChG,MAAM,CAAC,MAAM,CAAC,IAAoB,EAAE,IAAI,CAAC,CAAA;IAC3C,CAAC;CAyBF;AA9BD,oCA8BC;AACD,WAAiB,YAAY;IAC3B;;OAEG;IACH,IAAY,IAYX;IAZD,WAAY,IAAI;QACd;;;WAGG;QACH,6CAAqC,CAAA;QACrC;;;;WAIG;QACH,uDAA+C,CAAA;IACjD,CAAC,EAZW,IAAI,GAAJ,iBAAI,KAAJ,iBAAI,QAYf;AACH,CAAC,EAjBgB,YAAY,4BAAZ,YAAY,QAiB5B","sourcesContent":["/**\n * @internal this entity is meant for internal use only\n */\nexport class RecoveryData {\n constructor(json: JSON | any) {\n if (!json.recipient || !json.encryptedSelf || !json.type)\n throw new Error(`Recovery data json is missing required properties.\\n${JSON.stringify(json)}`)\n Object.assign(this as RecoveryData, json)\n }\n\n id?: string\n rev?: string\n /**\n * Id of the data owner that this recovery data is meant for\n */\n recipient!: string\n /**\n * Encrypted recovery data. The structure of the decrypted data depends on the [type] of the recovery data.\n */\n encryptedSelf!: string\n /**\n * Type of the recovery data.\n */\n type!: RecoveryData.Type\n /**\n * Timestamp (unix epoch in ms) at which this recovery data will expire. If null, this recovery data will never\n * expire. Negative values or zero mean the data is already expired.\n */\n expirationInstant?: number\n /**\n * hard delete (unix epoch in ms) timestamp of the object. Filled automatically when the delete method is called.\n */\n deletionDate?: number\n}\nexport namespace RecoveryData {\n /**\n * Represents possible types of recovery data.\n */\n export enum Type {\n /**\n * This recovery data is meant to be used to recover a keypair of the recipient. This could be for making a key\n * available on another device, or for recovering a keypair that has been fully lost.\n */\n KEYPAIR_RECOVERY = 'KEYPAIR_RECOVERY',\n /**\n * This recovery data is meant to be used to recover an exchange key of the recipient. The main purpose of this\n * is to allow data owners to share data with other data owners that do not have created a keypair yet, but it\n * can also be used as part of the give-access-back recovery mechanism.\n */\n EXCHANGE_KEY_RECOVERY = 'EXCHANGE_KEY_RECOVERY',\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"EntityBulkShareResult.js","sourceRoot":"","sources":["../../../../icc-api/model/requests/EntityBulkShareResult.ts"],"names":[],"mappings":";;;AAGA;;GAEG;AACH,MAAa,qBAAqB;IAChC,YAAY,IAAgB,EAAE,iBAA8C;QAC1E,MAAM,CAAC,MAAM,CAAC,IAAgC,EAAE,IAAI,CAAC,CAAA;QACrD,IAAI,IAAI,CAAC,eAAe,CAAC,EAAE;YACzB,IAAI,CAAC,aAAa,GAAG,IAAI,iBAAiB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAA;SAClE;IACH,CAAC;CAoBF;AA1BD,sDA0BC","sourcesContent":["import { RejectedShareOrMetadataUpdateRequest } from './RejectedShareOrMetadataUpdateRequest'\nimport { EncryptedEntity } from '../models'\n\n/**\n * Result of a bulk share operation.\n */\nexport class EntityBulkShareResult<T extends EncryptedEntity> {\n constructor(json: JSON | any, entityConstructor: new (json: JSON | any) => T) {\n Object.assign(this as EntityBulkShareResult<T>, json)\n if (json['updatedEntity']) {\n this.updatedEntity = new entityConstructor(json['updatedEntity'])\n }\n }\n\n /**\n * The updated entity. Non-null if at least one of the requests succeeded.\n */\n updatedEntity?: T\n /**\n * Id of the entity for which the update was requested.\n */\n entityId!: string\n /**\n * Last known revision of the entity before any update, non-null only if an entity matching the requests could be\n * found. This can help to understand if an error is caused by an outdated version of the entity on the client-side.\n */\n entityRev?: string\n /**\n * If a `bulkShare` method fails to apply any of the share requests for an entity this map associates the id of the\n * original failed request to the reason of failure.\n */\n rejectedRequests?: { [requestId: string]: RejectedShareOrMetadataUpdateRequest }\n}\n"]}
1
+ {"version":3,"file":"EntityBulkShareResult.js","sourceRoot":"","sources":["../../../../icc-api/model/requests/EntityBulkShareResult.ts"],"names":[],"mappings":";;;AAGA;;GAEG;AACH,MAAa,qBAAqB;IAChC,YAAY,IAAgB,EAAE,iBAA8C;QAC1E,MAAM,CAAC,MAAM,CAAC,IAAgC,EAAE,IAAI,CAAC,CAAA;QACrD,IAAI,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC;YAC1B,IAAI,CAAC,aAAa,GAAG,IAAI,iBAAiB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAA;QACnE,CAAC;IACH,CAAC;CAoBF;AA1BD,sDA0BC","sourcesContent":["import { RejectedShareOrMetadataUpdateRequest } from './RejectedShareOrMetadataUpdateRequest'\nimport { EncryptedEntity } from '../models'\n\n/**\n * Result of a bulk share operation.\n */\nexport class EntityBulkShareResult<T extends EncryptedEntity> {\n constructor(json: JSON | any, entityConstructor: new (json: JSON | any) => T) {\n Object.assign(this as EntityBulkShareResult<T>, json)\n if (json['updatedEntity']) {\n this.updatedEntity = new entityConstructor(json['updatedEntity'])\n }\n }\n\n /**\n * The updated entity. Non-null if at least one of the requests succeeded.\n */\n updatedEntity?: T\n /**\n * Id of the entity for which the update was requested.\n */\n entityId!: string\n /**\n * Last known revision of the entity before any update, non-null only if an entity matching the requests could be\n * found. This can help to understand if an error is caused by an outdated version of the entity on the client-side.\n */\n entityRev?: string\n /**\n * If a `bulkShare` method fails to apply any of the share requests for an entity this map associates the id of the\n * original failed request to the reason of failure.\n */\n rejectedRequests?: { [requestId: string]: RejectedShareOrMetadataUpdateRequest }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"EntityShareOrMetadataUpdateRequest.js","sourceRoot":"","sources":["../../../../icc-api/model/requests/EntityShareOrMetadataUpdateRequest.ts"],"names":[],"mappings":";;;AAGA,MAAa,kCAAkC;IAC7C,YAAY,MAAkF;QAC5F,IAAI,MAAM,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;YAClC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAA;SAC1B;aAAM,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE;YACzC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAA;SAC5B;;YAAM,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAA;IACxE,CAAC;CAIF;AAXD,gFAWC","sourcesContent":["import { EntityShareRequest } from './EntityShareRequest'\nimport { EntitySharedMetadataUpdateRequest } from './EntitySharedMetadataUpdateRequest'\n\nexport class EntityShareOrMetadataUpdateRequest {\n constructor(params: { share?: EntityShareRequest; update?: EntitySharedMetadataUpdateRequest }) {\n if (params.share && !params.update) {\n this.share = params.share\n } else if (!params.share && params.update) {\n this.update = params.update\n } else throw new Error('Exactly one of share or update should be set')\n }\n\n share?: EntityShareRequest\n update?: EntitySharedMetadataUpdateRequest\n}\n"]}
1
+ {"version":3,"file":"EntityShareOrMetadataUpdateRequest.js","sourceRoot":"","sources":["../../../../icc-api/model/requests/EntityShareOrMetadataUpdateRequest.ts"],"names":[],"mappings":";;;AAGA,MAAa,kCAAkC;IAC7C,YAAY,MAAkF;QAC5F,IAAI,MAAM,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YACnC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAA;QAC3B,CAAC;aAAM,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;YAC1C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAA;QAC7B,CAAC;;YAAM,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAA;IACxE,CAAC;CAIF;AAXD,gFAWC","sourcesContent":["import { EntityShareRequest } from './EntityShareRequest'\nimport { EntitySharedMetadataUpdateRequest } from './EntitySharedMetadataUpdateRequest'\n\nexport class EntityShareOrMetadataUpdateRequest {\n constructor(params: { share?: EntityShareRequest; update?: EntitySharedMetadataUpdateRequest }) {\n if (params.share && !params.update) {\n this.share = params.share\n } else if (!params.share && params.update) {\n this.update = params.update\n } else throw new Error('Exactly one of share or update should be set')\n }\n\n share?: EntityShareRequest\n update?: EntitySharedMetadataUpdateRequest\n}\n"]}
@@ -59,5 +59,5 @@ exports.EntityShareRequest = EntityShareRequest;
59
59
  MAX_WRITE: EntityShareRequest.RequestedPermissionEnum.MAX_WRITE,
60
60
  FULL_WRITE: EntityShareRequest.RequestedPermissionEnum.FULL_WRITE,
61
61
  };
62
- })(EntityShareRequest = exports.EntityShareRequest || (exports.EntityShareRequest = {}));
62
+ })(EntityShareRequest || (exports.EntityShareRequest = EntityShareRequest = {}));
63
63
  //# sourceMappingURL=EntityShareRequest.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EntityShareRequest.js","sourceRoot":"","sources":["../../../../icc-api/model/requests/EntityShareRequest.ts"],"names":[],"mappings":";;;AAAA,MAAa,kBAAkB;IAC7B,YAAY,MAUX;;QACC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAA;QAChG,IAAI,CAAC,iBAAiB,GAAG,MAAM,CAAC,iBAAiB,CAAA;QACjD,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAA;QAC/C,IAAI,CAAC,iBAAiB,GAAG,MAAM,CAAC,iBAAiB,CAAA;QACjD,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAA;QACjC,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAA;QAC3C,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,CAAA;QAC7C,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAA;QAC3C,IAAI,CAAC,uBAAuB,GAAG,MAAM,CAAC,uBAAuB,CAAA;QAC7D,IAAI,CAAC,oBAAoB,GAAG,MAAA,MAAM,CAAC,oBAAoB,mCAAI,kBAAkB,CAAC,2BAA2B,CAAC,SAAS,CAAA;IACrH,CAAC;CA2CF;AAjED,gDAiEC;AAED,WAAiB,kBAAkB;IAKpB,0CAAuB,GAAG;QACrC;;;;WAIG;QACH,SAAS,EAAE,WAAsC;QAEjD;;;;WAIG;QACH,SAAS,EAAE,WAAsC;QAEjD;;;WAGG;QACH,UAAU,EAAE,YAAuC;KACpD,CAAA;IAQY,8CAA2B,GAAG;QACzC;;;;;;;;;;;;;;WAcG;QACH,IAAI,EAAE,MAAqC;QAC3C,SAAS,EAAE,mBAAA,uBAAuB,CAAC,SAAwC;QAC3E,SAAS,EAAE,mBAAA,uBAAuB,CAAC,SAAwC;QAC3E,UAAU,EAAE,mBAAA,uBAAuB,CAAC,UAAyC;KAC9E,CAAA;AACH,CAAC,EAtDgB,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAsDlC","sourcesContent":["export class EntityShareRequest {\n constructor(params: {\n explicitDelegator?: string\n explicitDelegate?: string\n accessControlKeys: string[]\n secretIds?: string[]\n encryptionKeys?: string[]\n owningEntityIds?: string[]\n exchangeDataId?: string\n encryptedExchangeDataId?: { [fp: string]: string }\n requestedPermissions?: EntityShareRequest.RequestedPermissionInternal\n }) {\n if (!params.accessControlKeys.length) throw new Error('Access control keys should not be empty')\n this.explicitDelegator = params.explicitDelegator\n this.explicitDelegate = params.explicitDelegate\n this.accessControlKeys = params.accessControlKeys\n this.secretIds = params.secretIds\n this.encryptionKeys = params.encryptionKeys\n this.owningEntityIds = params.owningEntityIds\n this.exchangeDataId = params.exchangeDataId\n this.encryptedExchangeDataId = params.encryptedExchangeDataId\n this.requestedPermissions = params.requestedPermissions ?? EntityShareRequest.RequestedPermissionInternal.MAX_WRITE\n }\n\n /**\n * Id of the data owner which is sharing the entity (delegator), if it should be explicitly indicated or null if the\n * delegator requires anonymous delegations. If not null this must match the logged data owner id.\n */\n explicitDelegator?: string\n /**\n * Id of the data owner which will gain access to the entity (delegate), if it should be explicitly indicated or\n * null if the delegate requires anonymous delegations.\n */\n explicitDelegate?: string\n /**\n * The access control keys obtained from the access control secrets of the exchange data used for the encryption of the ids and keys\n * to share. These are also used to uniquely identify an instance of share metadata.\n */\n accessControlKeys: string[]\n /**\n * Encrypted secret ids to share with the delegate.\n */\n secretIds?: string[]\n /**\n * Encrypted encryption keys to share with the delegate.\n */\n encryptionKeys?: string[]\n /**\n * Encrypted owning entity ids to share with the delegate.\n */\n owningEntityIds?: string[]\n /**\n * Id of the exchange data used for the encryption of the ids and keys to share. Must be null at least one of\n * delegator or delegate is not explicit.\n */\n exchangeDataId?: string\n /**\n * Must be non-empty if exactly one of delegator or delegate is explicit and the other is not, empty in all other\n * cases.\n */\n encryptedExchangeDataId?: { [fp: string]: string }\n /**\n * Permissions requested for the delegate.\n */\n requestedPermissions: EntityShareRequest.RequestedPermissionInternal\n}\n\nexport namespace EntityShareRequest {\n /**\n * Strategy to use for the calculation of permissions for the new [SecureDelegation.permissions]\n */\n export type RequestedPermissionEnum = 'FULL_READ' | 'MAX_WRITE' | 'FULL_WRITE'\n export const RequestedPermissionEnum = {\n /**\n * The new secure delegation will give full-read access to the delegate. If in future iCure is going to support\n * fine-grained access control a user may have limited read access to an entity, and in such case the request\n * would fail (similarly to [FULL_WRITE]).\n */\n FULL_READ: 'FULL_READ' as RequestedPermissionEnum,\n\n /**\n * The new secure delegation will give maximum access to the delegate, depending on the rights of the delegator.\n * If the delegator has full-write access the delegate will also have full-write access else the delegate will\n * have full-read access.\n */\n MAX_WRITE: 'MAX_WRITE' as RequestedPermissionEnum,\n\n /**\n * The new secure delegation will give full-write access to the delegate. If the delegator does not have\n * full-write access to the entity the request will fail.\n */\n FULL_WRITE: 'FULL_WRITE' as RequestedPermissionEnum,\n }\n\n /**\n * @internal this type is for internal use only and may be changed without notice.\n * Additional values for requested permissions which are used automatically by the extended apis and should not\n * be used directly by the user.\n */\n export type RequestedPermissionInternal = 'ROOT' | RequestedPermissionEnum\n export const RequestedPermissionInternal = {\n /**\n * Request to create a root delegation on the entity. Usually new entities are created with a root delegation\n * for the creator data owner and no other data owners will be able to obtain root permissions, but there are\n * some situations where other data owners can create root delegations on existing entities:\n * - If a data owner has a legacy delegation on an entity he can create a root delegation. This is necessary in\n * cases where the data owner wants to share an entity with another data owner using the new delegation format\n * but does not have a delegation in the new format yet (the data owner creates a new root delegation self->self\n * and then creates a delegation self->other).\n * - A patient data owner is always allowed to create a root delegation for himself\n *\n * A root delegation gives full write permissions to the data owners which can access it (usually a root\n * delegation should be accessible only for one data owner, it should be a delegation a->a) and does not depend\n * on any other delegation: this means that no data owners except for the data owners with the root permission\n * can revoke it.\n */\n ROOT: 'ROOT' as RequestedPermissionInternal,\n FULL_READ: RequestedPermissionEnum.FULL_READ as RequestedPermissionInternal,\n MAX_WRITE: RequestedPermissionEnum.MAX_WRITE as RequestedPermissionInternal,\n FULL_WRITE: RequestedPermissionEnum.FULL_WRITE as RequestedPermissionInternal,\n }\n}\n"]}
1
+ {"version":3,"file":"EntityShareRequest.js","sourceRoot":"","sources":["../../../../icc-api/model/requests/EntityShareRequest.ts"],"names":[],"mappings":";;;AAAA,MAAa,kBAAkB;IAC7B,YAAY,MAUX;;QACC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAA;QAChG,IAAI,CAAC,iBAAiB,GAAG,MAAM,CAAC,iBAAiB,CAAA;QACjD,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAA;QAC/C,IAAI,CAAC,iBAAiB,GAAG,MAAM,CAAC,iBAAiB,CAAA;QACjD,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAA;QACjC,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAA;QAC3C,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,CAAA;QAC7C,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAA;QAC3C,IAAI,CAAC,uBAAuB,GAAG,MAAM,CAAC,uBAAuB,CAAA;QAC7D,IAAI,CAAC,oBAAoB,GAAG,MAAA,MAAM,CAAC,oBAAoB,mCAAI,kBAAkB,CAAC,2BAA2B,CAAC,SAAS,CAAA;IACrH,CAAC;CA2CF;AAjED,gDAiEC;AAED,WAAiB,kBAAkB;IAKpB,0CAAuB,GAAG;QACrC;;;;WAIG;QACH,SAAS,EAAE,WAAsC;QAEjD;;;;WAIG;QACH,SAAS,EAAE,WAAsC;QAEjD;;;WAGG;QACH,UAAU,EAAE,YAAuC;KACpD,CAAA;IAQY,8CAA2B,GAAG;QACzC;;;;;;;;;;;;;;WAcG;QACH,IAAI,EAAE,MAAqC;QAC3C,SAAS,EAAE,mBAAA,uBAAuB,CAAC,SAAwC;QAC3E,SAAS,EAAE,mBAAA,uBAAuB,CAAC,SAAwC;QAC3E,UAAU,EAAE,mBAAA,uBAAuB,CAAC,UAAyC;KAC9E,CAAA;AACH,CAAC,EAtDgB,kBAAkB,kCAAlB,kBAAkB,QAsDlC","sourcesContent":["export class EntityShareRequest {\n constructor(params: {\n explicitDelegator?: string\n explicitDelegate?: string\n accessControlKeys: string[]\n secretIds?: string[]\n encryptionKeys?: string[]\n owningEntityIds?: string[]\n exchangeDataId?: string\n encryptedExchangeDataId?: { [fp: string]: string }\n requestedPermissions?: EntityShareRequest.RequestedPermissionInternal\n }) {\n if (!params.accessControlKeys.length) throw new Error('Access control keys should not be empty')\n this.explicitDelegator = params.explicitDelegator\n this.explicitDelegate = params.explicitDelegate\n this.accessControlKeys = params.accessControlKeys\n this.secretIds = params.secretIds\n this.encryptionKeys = params.encryptionKeys\n this.owningEntityIds = params.owningEntityIds\n this.exchangeDataId = params.exchangeDataId\n this.encryptedExchangeDataId = params.encryptedExchangeDataId\n this.requestedPermissions = params.requestedPermissions ?? EntityShareRequest.RequestedPermissionInternal.MAX_WRITE\n }\n\n /**\n * Id of the data owner which is sharing the entity (delegator), if it should be explicitly indicated or null if the\n * delegator requires anonymous delegations. If not null this must match the logged data owner id.\n */\n explicitDelegator?: string\n /**\n * Id of the data owner which will gain access to the entity (delegate), if it should be explicitly indicated or\n * null if the delegate requires anonymous delegations.\n */\n explicitDelegate?: string\n /**\n * The access control keys obtained from the access control secrets of the exchange data used for the encryption of the ids and keys\n * to share. These are also used to uniquely identify an instance of share metadata.\n */\n accessControlKeys: string[]\n /**\n * Encrypted secret ids to share with the delegate.\n */\n secretIds?: string[]\n /**\n * Encrypted encryption keys to share with the delegate.\n */\n encryptionKeys?: string[]\n /**\n * Encrypted owning entity ids to share with the delegate.\n */\n owningEntityIds?: string[]\n /**\n * Id of the exchange data used for the encryption of the ids and keys to share. Must be null at least one of\n * delegator or delegate is not explicit.\n */\n exchangeDataId?: string\n /**\n * Must be non-empty if exactly one of delegator or delegate is explicit and the other is not, empty in all other\n * cases.\n */\n encryptedExchangeDataId?: { [fp: string]: string }\n /**\n * Permissions requested for the delegate.\n */\n requestedPermissions: EntityShareRequest.RequestedPermissionInternal\n}\n\nexport namespace EntityShareRequest {\n /**\n * Strategy to use for the calculation of permissions for the new [SecureDelegation.permissions]\n */\n export type RequestedPermissionEnum = 'FULL_READ' | 'MAX_WRITE' | 'FULL_WRITE'\n export const RequestedPermissionEnum = {\n /**\n * The new secure delegation will give full-read access to the delegate. If in future iCure is going to support\n * fine-grained access control a user may have limited read access to an entity, and in such case the request\n * would fail (similarly to [FULL_WRITE]).\n */\n FULL_READ: 'FULL_READ' as RequestedPermissionEnum,\n\n /**\n * The new secure delegation will give maximum access to the delegate, depending on the rights of the delegator.\n * If the delegator has full-write access the delegate will also have full-write access else the delegate will\n * have full-read access.\n */\n MAX_WRITE: 'MAX_WRITE' as RequestedPermissionEnum,\n\n /**\n * The new secure delegation will give full-write access to the delegate. If the delegator does not have\n * full-write access to the entity the request will fail.\n */\n FULL_WRITE: 'FULL_WRITE' as RequestedPermissionEnum,\n }\n\n /**\n * @internal this type is for internal use only and may be changed without notice.\n * Additional values for requested permissions which are used automatically by the extended apis and should not\n * be used directly by the user.\n */\n export type RequestedPermissionInternal = 'ROOT' | RequestedPermissionEnum\n export const RequestedPermissionInternal = {\n /**\n * Request to create a root delegation on the entity. Usually new entities are created with a root delegation\n * for the creator data owner and no other data owners will be able to obtain root permissions, but there are\n * some situations where other data owners can create root delegations on existing entities:\n * - If a data owner has a legacy delegation on an entity he can create a root delegation. This is necessary in\n * cases where the data owner wants to share an entity with another data owner using the new delegation format\n * but does not have a delegation in the new format yet (the data owner creates a new root delegation self->self\n * and then creates a delegation self->other).\n * - A patient data owner is always allowed to create a root delegation for himself\n *\n * A root delegation gives full write permissions to the data owners which can access it (usually a root\n * delegation should be accessible only for one data owner, it should be a delegation a->a) and does not depend\n * on any other delegation: this means that no data owners except for the data owners with the root permission\n * can revoke it.\n */\n ROOT: 'ROOT' as RequestedPermissionInternal,\n FULL_READ: RequestedPermissionEnum.FULL_READ as RequestedPermissionInternal,\n MAX_WRITE: RequestedPermissionEnum.MAX_WRITE as RequestedPermissionInternal,\n FULL_WRITE: RequestedPermissionEnum.FULL_WRITE as RequestedPermissionInternal,\n }\n}\n"]}
@@ -20,5 +20,5 @@ exports.EntitySharedMetadataUpdateRequest = EntitySharedMetadataUpdateRequest;
20
20
  CREATE: 'CREATE',
21
21
  DELETE: 'DELETE',
22
22
  };
23
- })(EntitySharedMetadataUpdateRequest = exports.EntitySharedMetadataUpdateRequest || (exports.EntitySharedMetadataUpdateRequest = {}));
23
+ })(EntitySharedMetadataUpdateRequest || (exports.EntitySharedMetadataUpdateRequest = EntitySharedMetadataUpdateRequest = {}));
24
24
  //# sourceMappingURL=EntitySharedMetadataUpdateRequest.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EntitySharedMetadataUpdateRequest.js","sourceRoot":"","sources":["../../../../icc-api/model/requests/EntitySharedMetadataUpdateRequest.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,MAAa,iCAAiC;IAC5C,YAAY,MAKX;QACC,IAAI,CAAC,yBAAyB,GAAG,MAAM,CAAC,yBAAyB,CAAA;QACjE,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAA;QACjC,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAA;QAC3C,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,CAAA;IAC/C,CAAC;CAqBF;AAhCD,8EAgCC;AACD,WAAiB,iCAAiC;IAKnC,qDAAmB,GAAG;QACjC,MAAM,EAAE,QAA+B;QACvC,MAAM,EAAE,QAA+B;KACxC,CAAA;AACH,CAAC,EATgB,iCAAiC,GAAjC,yCAAiC,KAAjC,yCAAiC,QASjD","sourcesContent":["/**\n * Parameters for the update of shared metadata. Currently only changes to secret ids, encryption keys and owning entity\n * ids are allowed. In the future we are going to allow also changes to the permissions of users with access to the\n * shared metadata.\n */\nexport class EntitySharedMetadataUpdateRequest {\n constructor(params: {\n metadataAccessControlHash: string\n secretIds?: { [encryptedData: string]: EntitySharedMetadataUpdateRequest.EntryUpdateTypeEnum }\n encryptionKeys?: { [encryptedData: string]: EntitySharedMetadataUpdateRequest.EntryUpdateTypeEnum }\n owningEntityIds?: { [encryptedData: string]: EntitySharedMetadataUpdateRequest.EntryUpdateTypeEnum }\n }) {\n this.metadataAccessControlHash = params.metadataAccessControlHash\n this.secretIds = params.secretIds\n this.encryptionKeys = params.encryptionKeys\n this.owningEntityIds = params.owningEntityIds\n }\n\n /**\n * Access control hash of the metadata to update.\n */\n metadataAccessControlHash: string\n /**\n * Updates for secret ids: the key is an encrypted secret id and the value is if an entry with that encrypted secret\n * id should be created or deleted.\n */\n secretIds?: { [encryptedData: string]: EntitySharedMetadataUpdateRequest.EntryUpdateTypeEnum }\n /**\n * Updates for encryption keys: a key in the map is an encrypted encrpytion key and the value is if an entry with\n * that encrypted encryption key should be created or deleted.\n */\n encryptionKeys?: { [encryptedData: string]: EntitySharedMetadataUpdateRequest.EntryUpdateTypeEnum }\n /**\n * Updates for owning entity ids: the key is the encrypted id of an owning entity and the value is if an entry with\n * that encrypted owning entity id should be created or deleted.\n */\n owningEntityIds?: { [encryptedData: string]: EntitySharedMetadataUpdateRequest.EntryUpdateTypeEnum }\n}\nexport namespace EntitySharedMetadataUpdateRequest {\n /**\n * Specifies if an entry should be created anew or deleted\n */\n export type EntryUpdateTypeEnum = 'CREATE' | 'DELETE'\n export const EntryUpdateTypeEnum = {\n CREATE: 'CREATE' as EntryUpdateTypeEnum,\n DELETE: 'DELETE' as EntryUpdateTypeEnum,\n }\n}\n"]}
1
+ {"version":3,"file":"EntitySharedMetadataUpdateRequest.js","sourceRoot":"","sources":["../../../../icc-api/model/requests/EntitySharedMetadataUpdateRequest.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,MAAa,iCAAiC;IAC5C,YAAY,MAKX;QACC,IAAI,CAAC,yBAAyB,GAAG,MAAM,CAAC,yBAAyB,CAAA;QACjE,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAA;QACjC,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAA;QAC3C,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,CAAA;IAC/C,CAAC;CAqBF;AAhCD,8EAgCC;AACD,WAAiB,iCAAiC;IAKnC,qDAAmB,GAAG;QACjC,MAAM,EAAE,QAA+B;QACvC,MAAM,EAAE,QAA+B;KACxC,CAAA;AACH,CAAC,EATgB,iCAAiC,iDAAjC,iCAAiC,QASjD","sourcesContent":["/**\n * Parameters for the update of shared metadata. Currently only changes to secret ids, encryption keys and owning entity\n * ids are allowed. In the future we are going to allow also changes to the permissions of users with access to the\n * shared metadata.\n */\nexport class EntitySharedMetadataUpdateRequest {\n constructor(params: {\n metadataAccessControlHash: string\n secretIds?: { [encryptedData: string]: EntitySharedMetadataUpdateRequest.EntryUpdateTypeEnum }\n encryptionKeys?: { [encryptedData: string]: EntitySharedMetadataUpdateRequest.EntryUpdateTypeEnum }\n owningEntityIds?: { [encryptedData: string]: EntitySharedMetadataUpdateRequest.EntryUpdateTypeEnum }\n }) {\n this.metadataAccessControlHash = params.metadataAccessControlHash\n this.secretIds = params.secretIds\n this.encryptionKeys = params.encryptionKeys\n this.owningEntityIds = params.owningEntityIds\n }\n\n /**\n * Access control hash of the metadata to update.\n */\n metadataAccessControlHash: string\n /**\n * Updates for secret ids: the key is an encrypted secret id and the value is if an entry with that encrypted secret\n * id should be created or deleted.\n */\n secretIds?: { [encryptedData: string]: EntitySharedMetadataUpdateRequest.EntryUpdateTypeEnum }\n /**\n * Updates for encryption keys: a key in the map is an encrypted encrpytion key and the value is if an entry with\n * that encrypted encryption key should be created or deleted.\n */\n encryptionKeys?: { [encryptedData: string]: EntitySharedMetadataUpdateRequest.EntryUpdateTypeEnum }\n /**\n * Updates for owning entity ids: the key is the encrypted id of an owning entity and the value is if an entry with\n * that encrypted owning entity id should be created or deleted.\n */\n owningEntityIds?: { [encryptedData: string]: EntitySharedMetadataUpdateRequest.EntryUpdateTypeEnum }\n}\nexport namespace EntitySharedMetadataUpdateRequest {\n /**\n * Specifies if an entry should be created anew or deleted\n */\n export type EntryUpdateTypeEnum = 'CREATE' | 'DELETE'\n export const EntryUpdateTypeEnum = {\n CREATE: 'CREATE' as EntryUpdateTypeEnum,\n DELETE: 'DELETE' as EntryUpdateTypeEnum,\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"AuthenticationProvider.js","sourceRoot":"","sources":["../../../icc-x-api/auth/AuthenticationProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,+DAA2D;AAC3D,mEAA+D;AAC/D,mDAA+C;AAC/C,yDAAqD;AACrD,qDAAiD;AA0BjD,MAAa,8BAA8B;IAKzC,YACmB,OAAmB,EACnB,QAAgB,EAChB,QAAgB,EAChB,aAAqB,IAAI,EAC1C,OAAgD,EAChD,SAA4B,EAC5B,mBAAqD,EAAE;QANtC,YAAO,GAAP,OAAO,CAAY;QACnB,aAAQ,GAAR,QAAQ,CAAQ;QAChB,aAAQ,GAAR,QAAQ,CAAQ;QAChB,eAAU,GAAV,UAAU,CAAe;QAK1C,IAAI,CAAC,OAAO,GAAG,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,IAAI,6CAAqB,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,gBAAgB,EAAE,SAAS,CAAC,CAAA;QAC5H,IAAI,CAAC,SAAS,GAAG,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,IAAI,mCAAgB,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CA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eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,YAAY,CAAA;gBACrD,CAAC,CAAC,EAAE,OAAO,EAAE,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE,eAAe,CAAC,YAAY,EAAE;gBAC9E,CAAC,CAAC,SAAS,CACd,CAAA;QACP,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,eAAe,EAAE,CAAA;IACzD,CAAC;CAAA","sourcesContent":["import { AuthService } from './AuthService'\nimport { IccAuthApi } from '../../icc-api'\nimport { EnsembleAuthService } from './EnsembleAuthService'\nimport { JwtBridgedAuthService } from './JwtBridgedAuthService'\nimport { NoAuthService } from './NoAuthService'\nimport { BasicAuthService } from './BasicAuthService'\nimport { JwtAuthService } from './JwtAuthService'\nimport { UserGroup } from '../../icc-api/model/UserGroup'\n\n/**\n * @internal you should not implement this interface yourself.\n */\nexport interface AuthenticationProvider {\n /**\n * @internal this method is meant for internal use only and may be changed without notice\n */\n getAuthService(): AuthService\n\n /**\n * @internal this method is meant for internal use only and may be changed without notice\n * Gives a new authentication provider for the same user and authentication method but for a different iCure group\n * @param newGroupId id of the new group to switch to\n * @param matches the list of groups the user is in, containing also the group-specific id of the user. Note that users with same login username but\n * different password are considered as if they are different users and should not appear in these matches. You can get this list by calling\n * {@link IccUserApi.getMatchingUsers} authenticated.\n * @return a new authentication provider\n */\n switchGroup(newGroupId: string, matches: Array<UserGroup>): Promise<AuthenticationProvider>\n\n getIcureTokens(): Promise<{ token: string; refreshToken: string } | undefined>\n}\n\nexport class EnsembleAuthenticationProvider implements AuthenticationProvider {\n private readonly basicAuth: BasicAuthService\n private jwtAuth: JwtAuthService | JwtBridgedAuthService\n private suspensionEnd: Date | undefined\n\n constructor(\n private readonly authApi: IccAuthApi,\n private readonly username: string,\n private readonly password: string,\n private readonly jwtTimeout: number = 3600,\n jwtAuth?: JwtAuthService | JwtBridgedAuthService,\n basicAuth?: BasicAuthService,\n thirdPartyTokens: { [thirdParty: string]: string } = {}\n ) {\n this.jwtAuth = jwtAuth ?? new JwtBridgedAuthService(this.authApi, this.username, this.password, thirdPartyTokens, undefined)\n this.basicAuth = basicAuth ?? new BasicAuthService(this.username, this.password)\n }\n\n getIcureTokens(): Promise<{ token: string; refreshToken: string } | undefined> {\n return this.jwtAuth.getIcureTokens()\n }\n\n getAuthService(): AuthService {\n // If the jwtAuth is in an error state, it instantiates a new one,\n // but it will not use it until the suspension ends\n if (this.jwtAuth.isInErrorState()) {\n console.warn('Error state in JWT, I will skip it')\n this.jwtAuth = new JwtBridgedAuthService(this.authApi, this.username, this.password, {}, undefined)\n this.suspensionEnd = new Date(new Date().getTime() + this.jwtTimeout * 1000)\n }\n\n return !!this.suspensionEnd && new Date() <= this.suspensionEnd\n ? new EnsembleAuthService(null, new NoAuthService(), this.basicAuth)\n : new EnsembleAuthService(this.jwtAuth, new NoAuthService(), this.basicAuth)\n }\n\n async switchGroup(newGroupId: string, matches: Array<UserGroup>): Promise<AuthenticationProvider> {\n const switchInfo = await switchJwtAuth(this.authApi, this.jwtAuth, this.username, this.password, newGroupId, matches)\n return new EnsembleAuthenticationProvider(\n this.authApi,\n switchInfo.loginForGroup,\n this.password,\n this.jwtTimeout,\n switchInfo.switchedJwtAuth,\n new BasicAuthService(switchInfo.loginForGroup, this.password)\n )\n }\n}\n\nexport class JwtAuthenticationProvider implements AuthenticationProvider {\n getIcureTokens(): Promise<{ token: string; refreshToken: string } | undefined> {\n return this.jwtAuth.getIcureTokens()\n }\n\n private readonly jwtAuth: JwtAuthService | JwtBridgedAuthService\n\n /**\n * @internal\n * @param authApi\n * @param username\n * @param password\n * @param jwtAuth\n * @param icureToken\n */\n constructor(\n private readonly authApi: IccAuthApi,\n private readonly username?: string,\n private readonly password?: string,\n jwtAuth?: JwtAuthService | JwtBridgedAuthService,\n icureToken?: { token: string; refreshToken: string }\n ) {\n const composedAuth =\n jwtAuth ??\n (!!username && !!password\n ? new JwtBridgedAuthService(\n authApi,\n username!,\n password!,\n {},\n icureToken ? { authJwt: icureToken.token, refreshJwt: icureToken.refreshToken } : undefined\n )\n : icureToken\n ? new JwtAuthService(authApi, { authJwt: icureToken.token, refreshJwt: icureToken.refreshToken })\n : undefined)\n if (!composedAuth) {\n throw new Error('No authentication method provided')\n }\n this.jwtAuth = composedAuth\n }\n\n getAuthService(): AuthService {\n return this.jwtAuth\n }\n\n async switchGroup(newGroupId: string, matches: Array<UserGroup>): Promise<AuthenticationProvider> {\n const switchInfo = await switchJwtAuth(this.authApi, this.jwtAuth, this.username, this.password, newGroupId, matches)\n return new JwtAuthenticationProvider(this.authApi, switchInfo.loginForGroup, this.password, switchInfo.switchedJwtAuth)\n }\n}\n\nexport class BasicAuthenticationProvider implements AuthenticationProvider {\n getIcureTokens(): Promise<{ token: string; refreshToken: string } | undefined> {\n return Promise.resolve() as Promise<undefined>\n }\n\n constructor(private username: string, private password: string) {}\n\n getAuthService(): AuthService {\n return new BasicAuthService(this.username, this.password)\n }\n\n async switchGroup(newGroupId: string, matches: Array<UserGroup>): Promise<AuthenticationProvider> {\n return Promise.resolve(new BasicAuthenticationProvider(loginForGroup(newGroupId, matches), this.password))\n }\n}\n\nexport class NoAuthenticationProvider implements AuthenticationProvider {\n getAuthService(): AuthService {\n return new NoAuthService()\n }\n\n getIcureTokens(): Promise<{ token: string; refreshToken: string } | undefined> {\n return Promise.resolve() as Promise<undefined>\n }\n\n async switchGroup(newGroupId: string, matches: Array<UserGroup>): Promise<AuthenticationProvider> {\n return Promise.resolve(new NoAuthenticationProvider())\n }\n}\n\n/**\n * @internal\n */\nfunction loginForGroup(groupId: string, matches: Array<UserGroup>): string {\n const matchForGroup = matches.find((x) => x.groupId === groupId)\n if (!matchForGroup?.userId) {\n throw new Error(`Can't switch to group ${groupId} for the current user.`)\n }\n return `${groupId}/${matchForGroup.userId}`\n}\n\n/**\n * @internal\n * Creates a jwtAuth from an existing one in order to switch group\n */\nasync function switchJwtAuth(\n authApi: IccAuthApi,\n jwtAuth: JwtAuthService | JwtBridgedAuthService,\n username: string | undefined,\n password: string | undefined,\n newGroupId: string,\n matches: Array<UserGroup>\n): Promise<{ loginForGroup: string; switchedJwtAuth: JwtAuthService | JwtBridgedAuthService }> {\n const refreshToken = jwtAuth.isInErrorState() ? undefined : await jwtAuth.refreshToken\n const switchedJwtInfo = refreshToken ? await authApi.switchGroup(refreshToken, newGroupId).catch(() => undefined as any) : undefined\n const updatedLogin = loginForGroup(newGroupId, matches)\n const switchedJwtAuth =\n !!username && !!password\n ? new JwtBridgedAuthService(\n authApi,\n updatedLogin,\n password,\n {},\n switchedJwtInfo?.token && switchedJwtInfo?.refreshToken\n ? { authJwt: switchedJwtInfo.token, refreshJwt: switchedJwtInfo.refreshToken }\n : undefined\n )\n : new JwtAuthService(\n authApi,\n switchedJwtInfo?.token && switchedJwtInfo?.refreshToken\n ? { authJwt: switchedJwtInfo.token, refreshJwt: switchedJwtInfo.refreshToken }\n : undefined\n )\n return { loginForGroup: updatedLogin, switchedJwtAuth }\n}\n"]}
1
+ {"version":3,"file":"AuthenticationProvider.js","sourceRoot":"","sources":["../../../icc-x-api/auth/AuthenticationProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,+DAA2D;AAC3D,mEAA+D;AAC/D,mDAA+C;AAC/C,yDAAqD;AACrD,qDAAiD;AA0BjD,MAAa,8BAA8B;IAKzC,YACmB,OAAmB,EACnB,QAAgB,EAChB,QAAgB,EAChB,aAAqB,IAAI,EAC1C,OAAgD,EAChD,SAA4B,EAC5B,mBAAqD,EAAE;QANtC,YAAO,GAAP,OAAO,CAAY;QACnB,aAAQ,GAAR,QAAQ,CAAQ;QAChB,aAAQ,GAAR,QAAQ,CAAQ;QAChB,eAAU,GAAV,UAAU,CAAe;QAK1C,IAAI,CAAC,OAAO,GAAG,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,IAAI,6CAAqB,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,gBAAgB,EAAE,S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CAAC,KAAK,EAAE,UAAU,EAAE,eAAe,CAAC,YAAY,EAAE;gBAC9E,CAAC,CAAC,SAAS,CACd;YACH,CAAC,CAAC,IAAI,+BAAc,CAChB,OAAO,EACP,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,KAAK,MAAI,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,YAAY,CAAA;gBACrD,CAAC,CAAC,EAAE,OAAO,EAAE,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE,eAAe,CAAC,YAAY,EAAE;gBAC9E,CAAC,CAAC,SAAS,CACd,CAAA;QACP,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,eAAe,EAAE,CAAA;IACzD,CAAC;CAAA","sourcesContent":["import { AuthService } from './AuthService'\nimport { IccAuthApi } from '../../icc-api'\nimport { EnsembleAuthService } from './EnsembleAuthService'\nimport { JwtBridgedAuthService } from './JwtBridgedAuthService'\nimport { NoAuthService } from './NoAuthService'\nimport { BasicAuthService } from './BasicAuthService'\nimport { JwtAuthService } from './JwtAuthService'\nimport { UserGroup } from '../../icc-api/model/UserGroup'\n\n/**\n * @internal you should not implement this interface yourself.\n */\nexport interface AuthenticationProvider {\n /**\n * @internal this method is meant for internal use only and may be changed without notice\n */\n getAuthService(): AuthService\n\n /**\n * @internal this method is meant for internal use only and may be changed without notice\n * Gives a new authentication provider for the same user and authentication method but for a different iCure group\n * @param newGroupId id of the new group to switch to\n * @param matches the list of groups the user is in, containing also the group-specific id of the user. Note that users with same login username but\n * different password are considered as if they are different users and should not appear in these matches. You can get this list by calling\n * {@link IccUserApi.getMatchingUsers} authenticated.\n * @return a new authentication provider\n */\n switchGroup(newGroupId: string, matches: Array<UserGroup>): Promise<AuthenticationProvider>\n\n getIcureTokens(): Promise<{ token: string; refreshToken: string } | undefined>\n}\n\nexport class EnsembleAuthenticationProvider implements AuthenticationProvider {\n private readonly basicAuth: BasicAuthService\n private jwtAuth: JwtAuthService | JwtBridgedAuthService\n private suspensionEnd: Date | undefined\n\n constructor(\n private readonly authApi: IccAuthApi,\n private readonly username: string,\n private readonly password: string,\n private readonly jwtTimeout: number = 3600,\n jwtAuth?: JwtAuthService | JwtBridgedAuthService,\n basicAuth?: BasicAuthService,\n thirdPartyTokens: { [thirdParty: string]: string } = {}\n ) {\n this.jwtAuth = jwtAuth ?? new JwtBridgedAuthService(this.authApi, this.username, this.password, thirdPartyTokens, undefined)\n this.basicAuth = basicAuth ?? new BasicAuthService(this.username, this.password)\n }\n\n getIcureTokens(): Promise<{ token: string; refreshToken: string } | undefined> {\n return this.jwtAuth.getIcureTokens()\n }\n\n getAuthService(): AuthService {\n // If the jwtAuth is in an error state, it instantiates a new one,\n // but it will not use it until the suspension ends\n if (this.jwtAuth.isInErrorState()) {\n console.warn('Error state in JWT, I will skip it')\n this.jwtAuth = new JwtBridgedAuthService(this.authApi, this.username, this.password, {}, undefined)\n this.suspensionEnd = new Date(new Date().getTime() + this.jwtTimeout * 1000)\n }\n\n return !!this.suspensionEnd && new Date() <= this.suspensionEnd\n ? new EnsembleAuthService(null, new NoAuthService(), this.basicAuth)\n : new EnsembleAuthService(this.jwtAuth, new NoAuthService(), this.basicAuth)\n }\n\n async switchGroup(newGroupId: string, matches: Array<UserGroup>): Promise<AuthenticationProvider> {\n const switchInfo = await switchJwtAuth(this.authApi, this.jwtAuth, this.username, this.password, newGroupId, matches)\n return new EnsembleAuthenticationProvider(\n this.authApi,\n switchInfo.loginForGroup,\n this.password,\n this.jwtTimeout,\n switchInfo.switchedJwtAuth,\n new BasicAuthService(switchInfo.loginForGroup, this.password)\n )\n }\n}\n\nexport class JwtAuthenticationProvider implements AuthenticationProvider {\n getIcureTokens(): Promise<{ token: string; refreshToken: string } | undefined> {\n return this.jwtAuth.getIcureTokens()\n }\n\n private readonly jwtAuth: JwtAuthService | JwtBridgedAuthService\n\n /**\n * @internal\n * @param authApi\n * @param username\n * @param password\n * @param jwtAuth\n * @param icureToken\n */\n constructor(\n private readonly authApi: IccAuthApi,\n private readonly username?: string,\n private readonly password?: string,\n jwtAuth?: JwtAuthService | JwtBridgedAuthService,\n icureToken?: { token: string; refreshToken: string }\n ) {\n const composedAuth =\n jwtAuth ??\n (!!username && !!password\n ? new JwtBridgedAuthService(\n authApi,\n username!,\n password!,\n {},\n icureToken ? { authJwt: icureToken.token, refreshJwt: icureToken.refreshToken } : undefined\n )\n : icureToken\n ? new JwtAuthService(authApi, { authJwt: icureToken.token, refreshJwt: icureToken.refreshToken })\n : undefined)\n if (!composedAuth) {\n throw new Error('No authentication method provided')\n }\n this.jwtAuth = composedAuth\n }\n\n getAuthService(): AuthService {\n return this.jwtAuth\n }\n\n async switchGroup(newGroupId: string, matches: Array<UserGroup>): Promise<AuthenticationProvider> {\n const switchInfo = await switchJwtAuth(this.authApi, this.jwtAuth, this.username, this.password, newGroupId, matches)\n return new JwtAuthenticationProvider(this.authApi, switchInfo.loginForGroup, this.password, switchInfo.switchedJwtAuth)\n }\n}\n\nexport class BasicAuthenticationProvider implements AuthenticationProvider {\n getIcureTokens(): Promise<{ token: string; refreshToken: string } | undefined> {\n return Promise.resolve() as Promise<undefined>\n }\n\n constructor(private username: string, private password: string) {}\n\n getAuthService(): AuthService {\n return new BasicAuthService(this.username, this.password)\n }\n\n async switchGroup(newGroupId: string, matches: Array<UserGroup>): Promise<AuthenticationProvider> {\n return Promise.resolve(new BasicAuthenticationProvider(loginForGroup(newGroupId, matches), this.password))\n }\n}\n\nexport class NoAuthenticationProvider implements AuthenticationProvider {\n getAuthService(): AuthService {\n return new NoAuthService()\n }\n\n getIcureTokens(): Promise<{ token: string; refreshToken: string } | undefined> {\n return Promise.resolve() as Promise<undefined>\n }\n\n async switchGroup(newGroupId: string, matches: Array<UserGroup>): Promise<AuthenticationProvider> {\n return Promise.resolve(new NoAuthenticationProvider())\n }\n}\n\n/**\n * @internal\n */\nfunction loginForGroup(groupId: string, matches: Array<UserGroup>): string {\n const matchForGroup = matches.find((x) => x.groupId === groupId)\n if (!matchForGroup?.userId) {\n throw new Error(`Can't switch to group ${groupId} for the current user.`)\n }\n return `${groupId}/${matchForGroup.userId}`\n}\n\n/**\n * @internal\n * Creates a jwtAuth from an existing one in order to switch group\n */\nasync function switchJwtAuth(\n authApi: IccAuthApi,\n jwtAuth: JwtAuthService | JwtBridgedAuthService,\n username: string | undefined,\n password: string | undefined,\n newGroupId: string,\n matches: Array<UserGroup>\n): Promise<{ loginForGroup: string; switchedJwtAuth: JwtAuthService | JwtBridgedAuthService }> {\n const refreshToken = jwtAuth.isInErrorState() ? undefined : await jwtAuth.refreshToken\n const switchedJwtInfo = refreshToken ? await authApi.switchGroup(refreshToken, newGroupId).catch(() => undefined as any) : undefined\n const updatedLogin = loginForGroup(newGroupId, matches)\n const switchedJwtAuth =\n !!username && !!password\n ? new JwtBridgedAuthService(\n authApi,\n updatedLogin,\n password,\n {},\n switchedJwtInfo?.token && switchedJwtInfo?.refreshToken\n ? { authJwt: switchedJwtInfo.token, refreshJwt: switchedJwtInfo.refreshToken }\n : undefined\n )\n : new JwtAuthService(\n authApi,\n switchedJwtInfo?.token && switchedJwtInfo?.refreshToken\n ? { authJwt: switchedJwtInfo.token, refreshJwt: switchedJwtInfo.refreshToken }\n : undefined\n )\n return { loginForGroup: updatedLogin, switchedJwtAuth }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"BasicAuthService.js","sourceRoot":"","sources":["../../../icc-x-api/auth/BasicAuthService.ts"],"names":[],"mappings":";;;AACA,+CAA2C;AAC3C,IAAO,MAAM,GAAG,SAAG,CAAC,MAAM,CAAA;AAC1B,oCAA8B;AAE9B,MAAa,gBAAgB;IAG3B,YAAoB,QAAgB,EAAU,QAAgB;QAA1C,aAAQ,GAAR,QAAQ,CAAQ;QAAU,aAAQ,GAAR,QAAQ,CAAQ;QAFtD,UAAK,GAAiB,IAAI,CAAA;IAE+B,CAAC;IAElE,cAAc;QACZ,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE;YAChB,MAAM,IAAI,CAAC,KAAK,CAAA;SACjB;QACD,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,MAAM,CAAC,eAAe,EAAE,SAAS,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;IAC3H,CAAC;IAEO,aAAa,CAAC,aAAqB;QACzC,OAAO,IAAA,WAAG,EAAC,aAAa,CAAC,CAAA;IAC3B,CAAC;IAED,gBAAgB,CAAC,KAAY;QAC3B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;CACF;AAnBD,4CAmBC","sourcesContent":["import { AuthService } from './AuthService'\nimport { XHR } from '../../icc-api/api/XHR'\nimport Header = XHR.Header\nimport { b2a } from '../utils'\n\nexport class BasicAuthService implements AuthService {\n private error: Error | null = null\n\n constructor(private username: string, private password: string) {}\n\n getAuthHeaders(): Promise<Array<Header>> {\n if (!!this.error) {\n throw this.error\n }\n return Promise.resolve([new Header('Authorization', `Basic ${this._base64Encode(`${this.username}:${this.password}`)}`)])\n }\n\n private _base64Encode(decodedString: string): string {\n return b2a(decodedString)\n }\n\n invalidateHeader(error: Error): void {\n this.error = error\n }\n}\n"]}
1
+ {"version":3,"file":"BasicAuthService.js","sourceRoot":"","sources":["../../../icc-x-api/auth/BasicAuthService.ts"],"names":[],"mappings":";;;AACA,+CAA2C;AAC3C,IAAO,MAAM,GAAG,SAAG,CAAC,MAAM,CAAA;AAC1B,oCAA8B;AAE9B,MAAa,gBAAgB;IAG3B,YAAoB,QAAgB,EAAU,QAAgB;QAA1C,aAAQ,GAAR,QAAQ,CAAQ;QAAU,aAAQ,GAAR,QAAQ,CAAQ;QAFtD,UAAK,GAAiB,IAAI,CAAA;IAE+B,CAAC;IAElE,cAAc;QACZ,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YACjB,MAAM,IAAI,CAAC,KAAK,CAAA;QAClB,CAAC;QACD,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,MAAM,CAAC,eAAe,EAAE,SAAS,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;IAC3H,CAAC;IAEO,aAAa,CAAC,aAAqB;QACzC,OAAO,IAAA,WAAG,EAAC,aAAa,CAAC,CAAA;IAC3B,CAAC;IAED,gBAAgB,CAAC,KAAY;QAC3B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;CACF;AAnBD,4CAmBC","sourcesContent":["import { AuthService } from './AuthService'\nimport { XHR } from '../../icc-api/api/XHR'\nimport Header = XHR.Header\nimport { b2a } from '../utils'\n\nexport class BasicAuthService implements AuthService {\n private error: Error | null = null\n\n constructor(private username: string, private password: string) {}\n\n getAuthHeaders(): Promise<Array<Header>> {\n if (!!this.error) {\n throw this.error\n }\n return Promise.resolve([new Header('Authorization', `Basic ${this._base64Encode(`${this.username}:${this.password}`)}`)])\n }\n\n private _base64Encode(decodedString: string): string {\n return b2a(decodedString)\n }\n\n invalidateHeader(error: Error): void {\n this.error = error\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"EnsembleAuthService.js","sourceRoot":"","sources":["../../../icc-x-api/auth/EnsembleAuthService.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,+CAA2C;AAK3C,IAAO,QAAQ,GAAG,SAAG,CAAC,QAAQ,CAAA;AAG9B,MAAa,mBAAmB;IAM9B,YACmB,OAAsD,EACtD,WAA0B,EAC1B,SAA2B;QAF3B,YAAO,GAAP,OAAO,CAA+C;QACtD,gBAAW,GAAX,WAAW,CAAe;QAC1B,cAAS,GAAT,SAAS,CAAkB;QAPtC,UAAK,GAAiB,IAAI,CAAA;QAEzB,cAAS,GAAG,IAAI,CAAC,cAAc,CAAA;QAOtC,IAAI,CAAC,QAAQ,GAAG;YACd,KAAK,EAAE,EA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,KAAK,GAAG,CAAC,CAAA;wBAEd,OAAO,EAAE,CAAA;oBACX,CAAC,CAAC;oBACJ,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;aACxB;iBAAM,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE;gBACvB,oEAAoE;gBACpE,MAAM,IAAI,CAAC,KAAK,CAAA;aACjB;iBAAM;gBACL,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAA;aACvC;QACH,CAAC;KAAA;IAED,gBAAgB,CAAC,KAAY;;QAC3B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE;YACvB,MAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,KAAK,0CAAE,gBAAgB,CAAC,KAAK,CAAC,CAAA;SAChE;IACH,CAAC;CACF;AAxDD,kDAwDC","sourcesContent":["import { AuthService } from './AuthService'\nimport { XHR } from '../../icc-api/api/XHR'\nimport { JwtBridgedAuthService } from './JwtBridgedAuthService'\nimport { NoAuthService } from './NoAuthService'\nimport { BasicAuthService } from './BasicAuthService'\nimport Header = XHR.Header\nimport XHRError = XHR.XHRError\nimport { JwtAuthService } from './JwtAuthService'\n\nexport class EnsembleAuthService implements AuthService {\n private currentState: string | null\n private error: Error | null = null\n private stateMap: { [key: string]: { state: AuthService | null; next: string | null } }\n readonly jwtGetter = this.getIcureTokens\n\n constructor(\n private readonly jwtAuth: JwtBridgedAuthService | JwtAuthService | null,\n private readonly sessionAuth: NoAuthService,\n private readonly basicAuth: BasicAuthService\n ) {\n this.stateMap = {\n start: { state: null, next: 'jwt' },\n jwt: { state: this.jwtAuth, next: 'session' },\n session: { state: this.sessionAuth, next: 'basic' },\n basic: { state: this.basicAuth, next: null },\n }\n this.currentState = 'start'\n }\n\n getIcureTokens(): Promise<{ token: string; refreshToken: string } | undefined> {\n return this.jwtAuth?.getIcureTokens() ?? (Promise.resolve() as Promise<undefined>)\n }\n\n async getAuthHeaders(minimumAuthenticationClass: number | undefined): Promise<Array<Header>> {\n this.currentState = !!this.currentState ? this.stateMap[this.currentState].next : this.currentState\n\n if (!!this.currentState) {\n // If I have a state I return the headers, otherwise I return empty headers\n // And delegate the responsibility of handling the error to the next call\n return !!this.stateMap[this.currentState].state\n ? this.stateMap[this.currentState].state!.getAuthHeaders(minimumAuthenticationClass).catch((e) => {\n if (e instanceof XHRError && e.statusCode === 417) {\n throw e\n }\n // If I get an error, it is also responsibility of the next call, but I give a warning\n console.warn(e.message)\n this.error = e\n\n return []\n })\n : Promise.resolve([])\n } else if (!!this.error) {\n // If I have no more states, I throw the last error or a default one\n throw this.error\n } else {\n throw new Error('Cannot authenticate')\n }\n }\n\n invalidateHeader(error: Error): void {\n this.error = error\n if (!!this.currentState) {\n this.stateMap[this.currentState].state?.invalidateHeader(error)\n }\n }\n}\n"]}
1
+ {"version":3,"file":"EnsembleAuthService.js","sourceRoot":"","sources":["../../../icc-x-api/auth/EnsembleAuthService.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,+CAA2C;AAK3C,IAAO,QAAQ,GAAG,SAAG,CAAC,QAAQ,CAAA;AAG9B,MAAa,mBAAmB;IAM9B,YACmB,OAAsD,EACtD,WAA0B,EAC1B,SAA2B;QAF3B,YAAO,GAAP,OAAO,CAA+C;QACtD,gBAAW,GAAX,WAAW,CAAe;QAC1B,cAAS,GAAT,SAAS,CAAkB;QAPtC,UAAK,GAAiB,IAAI,CAAA;QAEzB,cAAS,GAAG,IAAI,CAAC,cAAc,CAAA;QAOtC,IAAI,CAAC,QAAQ,GAAG;YACd,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE;YACnC,GAAG,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;YAC7C,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,WA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AI,CAAC,KAAK,EAAE,CAAC;gBACxB,oEAAoE;gBACpE,MAAM,IAAI,CAAC,KAAK,CAAA;YAClB,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAA;YACxC,CAAC;QACH,CAAC;KAAA;IAED,gBAAgB,CAAC,KAAY;;QAC3B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YACxB,MAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,KAAK,0CAAE,gBAAgB,CAAC,KAAK,CAAC,CAAA;QACjE,CAAC;IACH,CAAC;CACF;AAxDD,kDAwDC","sourcesContent":["import { AuthService } from './AuthService'\nimport { XHR } from '../../icc-api/api/XHR'\nimport { JwtBridgedAuthService } from './JwtBridgedAuthService'\nimport { NoAuthService } from './NoAuthService'\nimport { BasicAuthService } from './BasicAuthService'\nimport Header = XHR.Header\nimport XHRError = XHR.XHRError\nimport { JwtAuthService } from './JwtAuthService'\n\nexport class EnsembleAuthService implements AuthService {\n private currentState: string | null\n private error: Error | null = null\n private stateMap: { [key: string]: { state: AuthService | null; next: string | null } }\n readonly jwtGetter = this.getIcureTokens\n\n constructor(\n private readonly jwtAuth: JwtBridgedAuthService | JwtAuthService | null,\n private readonly sessionAuth: NoAuthService,\n private readonly basicAuth: BasicAuthService\n ) {\n this.stateMap = {\n start: { state: null, next: 'jwt' },\n jwt: { state: this.jwtAuth, next: 'session' },\n session: { state: this.sessionAuth, next: 'basic' },\n basic: { state: this.basicAuth, next: null },\n }\n this.currentState = 'start'\n }\n\n getIcureTokens(): Promise<{ token: string; refreshToken: string } | undefined> {\n return this.jwtAuth?.getIcureTokens() ?? (Promise.resolve() as Promise<undefined>)\n }\n\n async getAuthHeaders(minimumAuthenticationClass: number | undefined): Promise<Array<Header>> {\n this.currentState = !!this.currentState ? this.stateMap[this.currentState].next : this.currentState\n\n if (!!this.currentState) {\n // If I have a state I return the headers, otherwise I return empty headers\n // And delegate the responsibility of handling the error to the next call\n return !!this.stateMap[this.currentState].state\n ? this.stateMap[this.currentState].state!.getAuthHeaders(minimumAuthenticationClass).catch((e) => {\n if (e instanceof XHRError && e.statusCode === 417) {\n throw e\n }\n // If I get an error, it is also responsibility of the next call, but I give a warning\n console.warn(e.message)\n this.error = e\n\n return []\n })\n : Promise.resolve([])\n } else if (!!this.error) {\n // If I have no more states, I throw the last error or a default one\n throw this.error\n } else {\n throw new Error('Cannot authenticate')\n }\n }\n\n invalidateHeader(error: Error): void {\n this.error = error\n if (!!this.currentState) {\n this.stateMap[this.currentState].state?.invalidateHeader(error)\n }\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"JwtAuthService.js","sourceRoot":"","sources":["../../../icc-x-api/auth/JwtAuthService.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,+CAA2C;AAG3C,yCAAkD;AAClD,yCAAqC;AAErC;;GAEG;AACH,MAAa,cAAc;IAKzB,YAA6B,OAAmB,EAAE,UAAoD;QAAzE,YAAO,GAAP,OAAO,CAAY;QAJxC,WAAM,GAAiB,IAAI,CAAA;QAC3B,oBAAe,GAAiE,OAAO,CAAC,OAAO,CAAC,SAAgB,CAAC,CAAA;QAChH,cAAS,GAAG,IAAI,CAAC,cAAc,CAAA;QAGtC,IAAI,CAAC,CAAC,UAAU,EAAE;YAChB,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;SACnD;IACH,CAAC;IAED,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,UAAiB,CAAC,CAAA;IAC/D,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,C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M,CAAA;IACtB,CAAC;CACF;AAnFD,wCAmFC","sourcesContent":["import { AuthService } from './AuthService'\nimport { XHR } from '../../icc-api/api/XHR'\nimport { IccAuthApi } from '../../icc-api'\nimport Header = XHR.Header\nimport { isJwtInvalidOrExpired } from './JwtUtils'\nimport { JwtError } from './JwtError'\n\n/**\n * Differs from JwtBridgedAuthService in that it cannot create new refresh tokens\n */\nexport class JwtAuthService implements AuthService {\n private _error: Error | null = null\n private _currentPromise: Promise<{ authJwt: string; refreshJwt: string } | undefined> = Promise.resolve(undefined as any)\n readonly jwtGetter = this.getIcureTokens\n\n constructor(private readonly authApi: IccAuthApi, initialJwt?: { authJwt: string; refreshJwt: string }) {\n if (!!initialJwt) {\n this._currentPromise = Promise.resolve(initialJwt)\n }\n }\n\n get refreshToken(): Promise<string | undefined> {\n return this._currentPromise.then((x) => x?.refreshJwt as any)\n }\n\n getIcureTokens(): Promise<{ token: string; refreshToken: string } | undefined> {\n return this._currentPromise.then((x) => (x ? { token: x.authJwt, refreshToken: x.refreshJwt } : undefined))\n }\n\n async getAuthHeaders(): Promise<Array<Header>> {\n return this._currentPromise\n .then(\n (x) => ({ authJwt: x?.authJwt, refreshJwt: x?.refreshJwt }),\n (e: Error) => {\n if (e instanceof JwtError && !!e.jwt && !!e.refreshJwt) {\n return { authJwt: e.jwt, refreshJwt: e.refreshJwt }\n } else {\n throw new Error('There was an error while refreshing the token, please re-instantiate the API.')\n }\n }\n )\n .then((x) => {\n const authJwt = x?.authJwt\n const refreshJwt = x?.refreshJwt\n\n if ((!authJwt || isJwtInvalidOrExpired(authJwt)) && refreshJwt) {\n // If it does not have the JWT, tries to get it\n // If the JWT is expired, tries to refresh it\n\n this._currentPromise = this._refreshAuthJwt(refreshJwt).then(\n (updatedTokens) => {\n // If here the token is null,\n // it goes in a suspension status\n if (!updatedTokens.authJwt) {\n throw new Error('Your iCure back-end version does not support JWT authentication')\n }\n\n return updatedTokens\n },\n (e: Error) => {\n throw new JwtError(authJwt, refreshJwt, 'There was an error while refreshing the token, please re-instantiate the API or try again.', e)\n }\n )\n } else if (!!this._error) {\n throw this._error\n }\n return this._currentPromise\n })\n .then((x) => {\n return x?.authJwt ? [new XHR.Header('Authorization', `Bearer ${x.authJwt}`)] : Promise.reject('Cannot provide auth: No JWT')\n })\n }\n\n private async _refreshAuthJwt(refreshJwt: string): Promise<{ authJwt: string; refreshJwt: string }> {\n // If I do not have a refresh JWT or the refresh JWT is expired,\n // I have to log in again\n if (isJwtInvalidOrExpired(refreshJwt)) {\n throw Error('Missing or expired refresh token: please log in again')\n } else {\n return this.authApi.refreshAuthenticationJWT(refreshJwt).then((refreshResponse) => ({\n authJwt: refreshResponse.token!,\n refreshJwt: refreshJwt,\n }))\n }\n }\n\n invalidateHeader(error: Error): void {\n this._error = error\n }\n\n isInErrorState(): boolean {\n return !!this._error\n }\n}\n"]}
1
+ {"version":3,"file":"JwtAuthService.js","sourceRoot":"","sources":["../../../icc-x-api/auth/JwtAuthService.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,+CAA2C;AAG3C,yCAAkD;AAClD,yCAAqC;AAErC;;GAEG;AACH,MAAa,cAAc;IAKzB,YAA6B,OAAmB,EAAE,UAAoD;QAAzE,YAAO,GAAP,OAAO,CAAY;QAJxC,WAAM,GAAiB,IAAI,CAAA;QAC3B,oBAAe,GAAiE,OAAO,CAAC,OAAO,CAAC,SAAgB,CAAC,CAAA;QAChH,cAAS,GAAG,IAAI,CAAC,cAAc,CAAA;QAGtC,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;YACjB,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;QACpD,CAAC;IACH,CAAC;IAED,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,UAAiB,CAAC,CAAA;IAC/D,CAAC;IAED,cAAc;QACZ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CAAA;YACL,CAAC;QACH,CAAC;KAAA;IAED,gBAAgB,CAAC,KAAY;QAC3B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;IACrB,CAAC;IAED,cAAc;QACZ,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,CAAA;IACtB,CAAC;CACF;AAnFD,wCAmFC","sourcesContent":["import { AuthService } from './AuthService'\nimport { XHR } from '../../icc-api/api/XHR'\nimport { IccAuthApi } from '../../icc-api'\nimport Header = XHR.Header\nimport { isJwtInvalidOrExpired } from './JwtUtils'\nimport { JwtError } from './JwtError'\n\n/**\n * Differs from JwtBridgedAuthService in that it cannot create new refresh tokens\n */\nexport class JwtAuthService implements AuthService {\n private _error: Error | null = null\n private _currentPromise: Promise<{ authJwt: string; refreshJwt: string } | undefined> = Promise.resolve(undefined as any)\n readonly jwtGetter = this.getIcureTokens\n\n constructor(private readonly authApi: IccAuthApi, initialJwt?: { authJwt: string; refreshJwt: string }) {\n if (!!initialJwt) {\n this._currentPromise = Promise.resolve(initialJwt)\n }\n }\n\n get refreshToken(): Promise<string | undefined> {\n return this._currentPromise.then((x) => x?.refreshJwt as any)\n }\n\n getIcureTokens(): Promise<{ token: string; refreshToken: string } | undefined> {\n return this._currentPromise.then((x) => (x ? { token: x.authJwt, refreshToken: x.refreshJwt } : undefined))\n }\n\n async getAuthHeaders(): Promise<Array<Header>> {\n return this._currentPromise\n .then(\n (x) => ({ authJwt: x?.authJwt, refreshJwt: x?.refreshJwt }),\n (e: Error) => {\n if (e instanceof JwtError && !!e.jwt && !!e.refreshJwt) {\n return { authJwt: e.jwt, refreshJwt: e.refreshJwt }\n } else {\n throw new Error('There was an error while refreshing the token, please re-instantiate the API.')\n }\n }\n )\n .then((x) => {\n const authJwt = x?.authJwt\n const refreshJwt = x?.refreshJwt\n\n if ((!authJwt || isJwtInvalidOrExpired(authJwt)) && refreshJwt) {\n // If it does not have the JWT, tries to get it\n // If the JWT is expired, tries to refresh it\n\n this._currentPromise = this._refreshAuthJwt(refreshJwt).then(\n (updatedTokens) => {\n // If here the token is null,\n // it goes in a suspension status\n if (!updatedTokens.authJwt) {\n throw new Error('Your iCure back-end version does not support JWT authentication')\n }\n\n return updatedTokens\n },\n (e: Error) => {\n throw new JwtError(authJwt, refreshJwt, 'There was an error while refreshing the token, please re-instantiate the API or try again.', e)\n }\n )\n } else if (!!this._error) {\n throw this._error\n }\n return this._currentPromise\n })\n .then((x) => {\n return x?.authJwt ? [new XHR.Header('Authorization', `Bearer ${x.authJwt}`)] : Promise.reject('Cannot provide auth: No JWT')\n })\n }\n\n private async _refreshAuthJwt(refreshJwt: string): Promise<{ authJwt: string; refreshJwt: string }> {\n // If I do not have a refresh JWT or the refresh JWT is expired,\n // I have to log in again\n if (isJwtInvalidOrExpired(refreshJwt)) {\n throw Error('Missing or expired refresh token: please log in again')\n } else {\n return this.authApi.refreshAuthenticationJWT(refreshJwt).then((refreshResponse) => ({\n authJwt: refreshResponse.token!,\n refreshJwt: refreshJwt,\n }))\n }\n }\n\n invalidateHeader(error: Error): void {\n this._error = error\n }\n\n isInErrorState(): boolean {\n return !!this._error\n }\n}\n"]}
@@ -18,7 +18,7 @@ export declare class JwtBridgedAuthService implements AuthService {
18
18
  } | undefined>;
19
19
  constructor(authApi: IccAuthApi, username: string | undefined, password: string | undefined, thirdPartyTokens: {
20
20
  [thirdParty: string]: string;
21
- }, initialJwt: {
21
+ } | undefined, initialJwt: {
22
22
  authJwt: string;
23
23
  refreshJwt: string;
24
24
  } | undefined);
@@ -115,7 +115,7 @@ class JwtBridgedAuthService {
115
115
  }
116
116
  }
117
117
  if (!authResponse) {
118
- authResponse = yield Object.entries(this.thirdPartyTokens).reduce((acc, [thirdParty, token]) => __awaiter(this, void 0, void 0, function* () {
118
+ authResponse = yield Object.entries(this.thirdPartyTokens).reduce((acc_1, _a) => __awaiter(this, [acc_1, _a], void 0, function* (acc, [thirdParty, token]) {
119
119
  const prev = yield acc;
120
120
  return (prev !== null && prev !== void 0 ? prev : (token
121
121
  ? this.authApi.loginWithThirdPartyToken(thirdParty, token).catch((e) => {
@@ -1 +1 @@
1
- {"version":3,"file":"JwtBridgedAuthService.js","sourceRoot":"","sources":["../../../icc-x-api/auth/JwtBridgedAuthService.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,+CAA2C;AAE3C,2EAAuE;AAEvE,oCAA8B;AAE9B,IAAO,QAAQ,GAAG,SAAG,CAAC,QAAQ,CAAA;AAC9B,yCAAqC;AAErC;;GAEG;AACH,MAAa,qBAAqB;IAKhC,YACU,OAAmB,EACnB,QAA4B,EAC5B,QAA4B,EAC5B,mBAAqD,EAAE,EAC/D,UAA+D;QAJvD,YAAO,GAAP,OAAO,CAAY;QACnB,aAAQ,GAAR,QAAQ,CAAoB;QAC5B,aAAQ,GAAR,QAAQ,CAAoB;QAC5B,qBAAgB,GAAhB,gBAAgB,CAAuC;QARzD,WAAM,GAAiB,IAAI,CAAA;QAC3B,oBAAe,GAAuD,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;QACxF,cAAS,GAAG,IAAI,CAAC,cAAc,CAAA;QAStC,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,EAAE,CAAC,CAAA;IAC1D,CAAC;IAED,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAiB,CAAC,CAAA;IAC9D,CAAC;IACD,cAAc;QACZ,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,OAAQ,EAAE,YAAY,EAAE,UAAW,EAAE,CAAC,CAAC,CAAC,CAAA;IACnJ,CAAC;IAEK,MAAM;;YACV,OAAO,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,KAAK,CAAC,EAAE;YACtB,OAAO,IAAI,CAAA;SACZ;QACD,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;QAC5C,mGAAmG;QACnG,OAAO,CAAC,CAAC,KAAK,IAAI,OAAO,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,CAAA;IACpF,CAAC;IAEO,aAAa,CAAC,aAAqB;QACzC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAA,WAAG,EAAC,aAAa,CAAC,CAAC,CAAA;IACvC,CAAC;IAED,gBAAgB,CAAC,KAAY;QAC3B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;IACrB,CAAC;IAED,cAAc;QACZ,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,CAAA;IACtB,CAAC;CACF;AAvJD,sDAuJC","sourcesContent":["import { AuthService } from './AuthService'\nimport { XHR } from '../../icc-api/api/XHR'\nimport { IccAuthApi, OAuthThirdParty } from '../../icc-api'\nimport { LoginCredentials } from '../../icc-api/model/LoginCredentials'\nimport Header = XHR.Header\nimport { a2b } from '../utils'\nimport { AuthenticationResponse } from '../../icc-api/model/AuthenticationResponse'\nimport XHRError = XHR.XHRError\nimport { JwtError } from './JwtError'\n\n/**\n * Differs from JwtAuthService in that it can create new refresh tokens if the old one is expired\n */\nexport class JwtBridgedAuthService implements AuthService {\n private _error: Error | null = null\n private _currentPromise: Promise<{ authJwt?: string; refreshJwt?: string }> = Promise.resolve({})\n readonly jwtGetter = this.getIcureTokens\n\n constructor(\n private authApi: IccAuthApi,\n private username: string | undefined,\n private password: string | undefined,\n private thirdPartyTokens: { [thirdParty: string]: string } = {},\n initialJwt: { authJwt: string; refreshJwt: string } | undefined\n ) {\n this._currentPromise = Promise.resolve(initialJwt ?? {})\n }\n\n get refreshToken(): Promise<string | undefined> {\n return this._currentPromise.then((x) => x.refreshJwt as any)\n }\n getIcureTokens(): Promise<{ token: string; refreshToken: string } | undefined> {\n return this.getAuthHeaders().then(() => this._currentPromise.then(({ authJwt, refreshJwt }) => ({ token: authJwt!, refreshToken: refreshJwt! })))\n }\n\n async getJWT(): Promise<string | undefined> {\n return this._currentPromise\n .then(\n ({ authJwt, refreshJwt }) => ({ authJwt, refreshJwt }),\n (e: Error) => {\n if (e instanceof JwtError) {\n const wrappedError = e.reason as any\n if (!!wrappedError.statusCode && wrappedError.statusCode >= 400 && wrappedError.statusCode < 500) {\n return { authJwt: undefined, refreshJwt: undefined }\n } else {\n return { authJwt: e.jwt, refreshJwt: e.refreshJwt }\n }\n } else {\n return { authJwt: undefined, refreshJwt: undefined }\n }\n }\n )\n .then(({ authJwt, refreshJwt }) => {\n if (!authJwt || this._isJwtInvalidOrExpired(authJwt)) {\n // If it does not have the JWT, tries to get it\n // If the JWT is expired, tries to refresh it\n\n this._currentPromise = this._refreshAuthJwt(refreshJwt).then(\n (updatedTokens) => {\n // If here the token is null,\n // it goes in a suspension status\n if (!updatedTokens.authJwt) {\n throw new Error('Your iCure back-end version does not support JWT authentication')\n }\n\n return updatedTokens\n },\n (e: Error) => {\n throw new JwtError(authJwt, refreshJwt, 'There was an error while refreshing the token, please re-instantiate the API or try again.', e)\n }\n )\n } else if (!!this._error) {\n throw this._error\n }\n return this._currentPromise\n })\n .then(({ authJwt }) => {\n return authJwt\n })\n }\n\n async getAuthHeaders(): Promise<Array<Header>> {\n return this.getJWT().then((authJwt) => {\n return [new XHR.Header('Authorization', `Bearer ${authJwt}`)]\n })\n }\n\n private async _refreshAuthJwt(refreshJwt: string | undefined): Promise<{ authJwt?: string; refreshJwt?: string }> {\n // If I do not have a refresh JWT or the refresh JWT is expired,\n // I have to log in again\n if (!refreshJwt || this._isJwtInvalidOrExpired(refreshJwt)) {\n return this._loginAndGetTokens()\n } else {\n return this.authApi.refreshAuthenticationJWT(refreshJwt).then((refreshResponse) => ({\n authJwt: refreshResponse.token,\n refreshJwt: refreshJwt,\n }))\n }\n }\n\n private async _loginAndGetTokens(): Promise<{ authJwt?: string; refreshJwt?: string }> {\n let authResponse: AuthenticationResponse | undefined\n let firstError: XHRError | undefined\n if (this.username && this.password) {\n try {\n authResponse = await this.authApi.login(\n new LoginCredentials({\n username: this.username,\n password: this.password,\n })\n )\n } catch (e) {\n firstError = e as XHRError\n }\n }\n if (!authResponse) {\n authResponse = await (Object.entries(this.thirdPartyTokens) as [OAuthThirdParty, string][]).reduce(async (acc, [thirdParty, token]) => {\n const prev = await acc\n return (\n prev ??\n (token\n ? this.authApi.loginWithThirdPartyToken(thirdParty, token).catch((e) => {\n if (!firstError) {\n firstError = e as XHRError\n }\n return Promise.resolve() as Promise<undefined>\n })\n : undefined)\n )\n }, Promise.resolve() as Promise<AuthenticationResponse | undefined>)\n }\n\n if (!authResponse) {\n if (firstError) throw firstError\n throw new XHRError('', 'Unknown error', 401, 'Unauthorized', new Headers())\n }\n\n return {\n authJwt: authResponse.token,\n refreshJwt: authResponse.refreshToken,\n }\n }\n\n private _isJwtInvalidOrExpired(jwt: string): boolean {\n const parts = jwt.split('.')\n if (parts.length !== 3) {\n return true\n }\n const payload = this._base64Decode(parts[1])\n // Using the 'exp' string is safe to use as it is part of the JWT RFC and cannot be modified by us.\n return !('exp' in payload) || payload['exp'] * 1000 < new Date().getTime() - 10000\n }\n\n private _base64Decode(encodedString: string): any {\n return JSON.parse(a2b(encodedString))\n }\n\n invalidateHeader(error: Error): void {\n this._error = error\n }\n\n isInErrorState(): boolean {\n return !!this._error\n }\n}\n"]}
1
+ {"version":3,"file":"JwtBridgedAuthService.js","sourceRoot":"","sources":["../../../icc-x-api/auth/JwtBridgedAuthService.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,+CAA2C;AAE3C,2EAAuE;AAEvE,oCAA8B;AAE9B,IAAO,QAAQ,GAAG,SAAG,CAAC,QAAQ,CAAA;AAC9B,yCAAqC;AAErC;;GAEG;AACH,MAAa,qBAA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C,CAAC,CAAA;QAC5C,mGAAmG;QACnG,OAAO,CAAC,CAAC,KAAK,IAAI,OAAO,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,CAAA;IACpF,CAAC;IAEO,aAAa,CAAC,aAAqB;QACzC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAA,WAAG,EAAC,aAAa,CAAC,CAAC,CAAA;IACvC,CAAC;IAED,gBAAgB,CAAC,KAAY;QAC3B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;IACrB,CAAC;IAED,cAAc;QACZ,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,CAAA;IACtB,CAAC;CACF;AAvJD,sDAuJC","sourcesContent":["import { AuthService } from './AuthService'\nimport { XHR } from '../../icc-api/api/XHR'\nimport { IccAuthApi, OAuthThirdParty } from '../../icc-api'\nimport { LoginCredentials } from '../../icc-api/model/LoginCredentials'\nimport Header = XHR.Header\nimport { a2b } from '../utils'\nimport { AuthenticationResponse } from '../../icc-api/model/AuthenticationResponse'\nimport XHRError = XHR.XHRError\nimport { JwtError } from './JwtError'\n\n/**\n * Differs from JwtAuthService in that it can create new refresh tokens if the old one is expired\n */\nexport class JwtBridgedAuthService implements AuthService {\n private _error: Error | null = null\n private _currentPromise: Promise<{ authJwt?: string; refreshJwt?: string }> = Promise.resolve({})\n readonly jwtGetter = this.getIcureTokens\n\n constructor(\n private authApi: IccAuthApi,\n private username: string | undefined,\n private password: string | undefined,\n private thirdPartyTokens: { [thirdParty: string]: string } = {},\n initialJwt: { authJwt: string; refreshJwt: string } | undefined\n ) {\n this._currentPromise = Promise.resolve(initialJwt ?? {})\n }\n\n get refreshToken(): Promise<string | undefined> {\n return this._currentPromise.then((x) => x.refreshJwt as any)\n }\n getIcureTokens(): Promise<{ token: string; refreshToken: string } | undefined> {\n return this.getAuthHeaders().then(() => this._currentPromise.then(({ authJwt, refreshJwt }) => ({ token: authJwt!, refreshToken: refreshJwt! })))\n }\n\n async getJWT(): Promise<string | undefined> {\n return this._currentPromise\n .then(\n ({ authJwt, refreshJwt }) => ({ authJwt, refreshJwt }),\n (e: Error) => {\n if (e instanceof JwtError) {\n const wrappedError = e.reason as any\n if (!!wrappedError.statusCode && wrappedError.statusCode >= 400 && wrappedError.statusCode < 500) {\n return { authJwt: undefined, refreshJwt: undefined }\n } else {\n return { authJwt: e.jwt, refreshJwt: e.refreshJwt }\n }\n } else {\n return { authJwt: undefined, refreshJwt: undefined }\n }\n }\n )\n .then(({ authJwt, refreshJwt }) => {\n if (!authJwt || this._isJwtInvalidOrExpired(authJwt)) {\n // If it does not have the JWT, tries to get it\n // If the JWT is expired, tries to refresh it\n\n this._currentPromise = this._refreshAuthJwt(refreshJwt).then(\n (updatedTokens) => {\n // If here the token is null,\n // it goes in a suspension status\n if (!updatedTokens.authJwt) {\n throw new Error('Your iCure back-end version does not support JWT authentication')\n }\n\n return updatedTokens\n },\n (e: Error) => {\n throw new JwtError(authJwt, refreshJwt, 'There was an error while refreshing the token, please re-instantiate the API or try again.', e)\n }\n )\n } else if (!!this._error) {\n throw this._error\n }\n return this._currentPromise\n })\n .then(({ authJwt }) => {\n return authJwt\n })\n }\n\n async getAuthHeaders(): Promise<Array<Header>> {\n return this.getJWT().then((authJwt) => {\n return [new XHR.Header('Authorization', `Bearer ${authJwt}`)]\n })\n }\n\n private async _refreshAuthJwt(refreshJwt: string | undefined): Promise<{ authJwt?: string; refreshJwt?: string }> {\n // If I do not have a refresh JWT or the refresh JWT is expired,\n // I have to log in again\n if (!refreshJwt || this._isJwtInvalidOrExpired(refreshJwt)) {\n return this._loginAndGetTokens()\n } else {\n return this.authApi.refreshAuthenticationJWT(refreshJwt).then((refreshResponse) => ({\n authJwt: refreshResponse.token,\n refreshJwt: refreshJwt,\n }))\n }\n }\n\n private async _loginAndGetTokens(): Promise<{ authJwt?: string; refreshJwt?: string }> {\n let authResponse: AuthenticationResponse | undefined\n let firstError: XHRError | undefined\n if (this.username && this.password) {\n try {\n authResponse = await this.authApi.login(\n new LoginCredentials({\n username: this.username,\n password: this.password,\n })\n )\n } catch (e) {\n firstError = e as XHRError\n }\n }\n if (!authResponse) {\n authResponse = await (Object.entries(this.thirdPartyTokens) as [OAuthThirdParty, string][]).reduce(async (acc, [thirdParty, token]) => {\n const prev = await acc\n return (\n prev ??\n (token\n ? this.authApi.loginWithThirdPartyToken(thirdParty, token).catch((e) => {\n if (!firstError) {\n firstError = e as XHRError\n }\n return Promise.resolve() as Promise<undefined>\n })\n : undefined)\n )\n }, Promise.resolve() as Promise<AuthenticationResponse | undefined>)\n }\n\n if (!authResponse) {\n if (firstError) throw firstError\n throw new XHRError('', 'Unknown error', 401, 'Unauthorized', new Headers())\n }\n\n return {\n authJwt: authResponse.token,\n refreshJwt: authResponse.refreshToken,\n }\n }\n\n private _isJwtInvalidOrExpired(jwt: string): boolean {\n const parts = jwt.split('.')\n if (parts.length !== 3) {\n return true\n }\n const payload = this._base64Decode(parts[1])\n // Using the 'exp' string is safe to use as it is part of the JWT RFC and cannot be modified by us.\n return !('exp' in payload) || payload['exp'] * 1000 < new Date().getTime() - 10000\n }\n\n private _base64Decode(encodedString: string): any {\n return JSON.parse(a2b(encodedString))\n }\n\n invalidateHeader(error: Error): void {\n this._error = error\n }\n\n isInErrorState(): boolean {\n return !!this._error\n }\n}\n"]}