@icure/api 6.0.2 → 6.0.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 (238) hide show
  1. package/icc-api/api/IccAccesslogApi.d.ts +3 -1
  2. package/icc-api/api/IccAccesslogApi.js +10 -8
  3. package/icc-api/api/IccAccesslogApi.js.map +1 -1
  4. package/icc-api/api/IccAgendaApi.d.ts +3 -1
  5. package/icc-api/api/IccAgendaApi.js +10 -8
  6. package/icc-api/api/IccAgendaApi.js.map +1 -1
  7. package/icc-api/api/IccAnonymousAccessApi.d.ts +3 -1
  8. package/icc-api/api/IccAnonymousAccessApi.js +6 -4
  9. package/icc-api/api/IccAnonymousAccessApi.js.map +1 -1
  10. package/icc-api/api/IccApplicationsettingsApi.d.ts +3 -1
  11. package/icc-api/api/IccApplicationsettingsApi.js +6 -4
  12. package/icc-api/api/IccApplicationsettingsApi.js.map +1 -1
  13. package/icc-api/api/IccArticleApi.d.ts +3 -1
  14. package/icc-api/api/IccArticleApi.js +8 -6
  15. package/icc-api/api/IccArticleApi.js.map +1 -1
  16. package/icc-api/api/IccAuthApi.d.ts +13 -1
  17. package/icc-api/api/IccAuthApi.js +30 -4
  18. package/icc-api/api/IccAuthApi.js.map +1 -1
  19. package/icc-api/api/IccBeefactApi.d.ts +3 -1
  20. package/icc-api/api/IccBeefactApi.js +4 -2
  21. package/icc-api/api/IccBeefactApi.js.map +1 -1
  22. package/icc-api/api/IccBekmehrApi.d.ts +3 -1
  23. package/icc-api/api/IccBekmehrApi.js +30 -28
  24. package/icc-api/api/IccBekmehrApi.js.map +1 -1
  25. package/icc-api/api/IccBemikronoApi.d.ts +3 -1
  26. package/icc-api/api/IccBemikronoApi.js +11 -9
  27. package/icc-api/api/IccBemikronoApi.js.map +1 -1
  28. package/icc-api/api/IccBeresultexportApi.d.ts +3 -1
  29. package/icc-api/api/IccBeresultexportApi.js +6 -4
  30. package/icc-api/api/IccBeresultexportApi.js.map +1 -1
  31. package/icc-api/api/IccBeresultimportApi.d.ts +3 -1
  32. package/icc-api/api/IccBeresultimportApi.js +6 -4
  33. package/icc-api/api/IccBeresultimportApi.js.map +1 -1
  34. package/icc-api/api/IccBesamv2Api.d.ts +3 -1
  35. package/icc-api/api/IccBesamv2Api.js +36 -34
  36. package/icc-api/api/IccBesamv2Api.js.map +1 -1
  37. package/icc-api/api/IccCalendarItemApi.d.ts +3 -1
  38. package/icc-api/api/IccCalendarItemApi.js +15 -13
  39. package/icc-api/api/IccCalendarItemApi.js.map +1 -1
  40. package/icc-api/api/IccCalendarItemTypeApi.d.ts +3 -1
  41. package/icc-api/api/IccCalendarItemTypeApi.js +9 -7
  42. package/icc-api/api/IccCalendarItemTypeApi.js.map +1 -1
  43. package/icc-api/api/IccClassificationApi.d.ts +3 -1
  44. package/icc-api/api/IccClassificationApi.js +11 -9
  45. package/icc-api/api/IccClassificationApi.js.map +1 -1
  46. package/icc-api/api/IccClassificationTemplateApi.d.ts +3 -1
  47. package/icc-api/api/IccClassificationTemplateApi.js +11 -9
  48. package/icc-api/api/IccClassificationTemplateApi.js.map +1 -1
  49. package/icc-api/api/IccCodeApi.d.ts +3 -1
  50. package/icc-api/api/IccCodeApi.js +19 -17
  51. package/icc-api/api/IccCodeApi.js.map +1 -1
  52. package/icc-api/api/IccContactApi.d.ts +3 -2
  53. package/icc-api/api/IccContactApi.js +31 -32
  54. package/icc-api/api/IccContactApi.js.map +1 -1
  55. package/icc-api/api/IccDeviceApi.d.ts +3 -1
  56. package/icc-api/api/IccDeviceApi.js +21 -19
  57. package/icc-api/api/IccDeviceApi.js.map +1 -1
  58. package/icc-api/api/IccDoctemplateApi.d.ts +3 -1
  59. package/icc-api/api/IccDoctemplateApi.js +16 -14
  60. package/icc-api/api/IccDoctemplateApi.js.map +1 -1
  61. package/icc-api/api/IccDocumentApi.d.ts +3 -1
  62. package/icc-api/api/IccDocumentApi.js +23 -21
  63. package/icc-api/api/IccDocumentApi.js.map +1 -1
  64. package/icc-api/api/IccDocumentTemplateApi.d.ts +3 -1
  65. package/icc-api/api/IccDocumentTemplateApi.js +16 -14
  66. package/icc-api/api/IccDocumentTemplateApi.js.map +1 -1
  67. package/icc-api/api/IccEntityrefApi.d.ts +3 -1
  68. package/icc-api/api/IccEntityrefApi.js +5 -3
  69. package/icc-api/api/IccEntityrefApi.js.map +1 -1
  70. package/icc-api/api/IccEntitytemplateApi.d.ts +3 -1
  71. package/icc-api/api/IccEntitytemplateApi.js +14 -12
  72. package/icc-api/api/IccEntitytemplateApi.js.map +1 -1
  73. package/icc-api/api/IccFormApi.d.ts +3 -1
  74. package/icc-api/api/IccFormApi.js +27 -25
  75. package/icc-api/api/IccFormApi.js.map +1 -1
  76. package/icc-api/api/IccFrontendmigrationApi.d.ts +3 -1
  77. package/icc-api/api/IccFrontendmigrationApi.js +9 -7
  78. package/icc-api/api/IccFrontendmigrationApi.js.map +1 -1
  79. package/icc-api/api/IccGroupApi.d.ts +3 -1
  80. package/icc-api/api/IccGroupApi.js +19 -17
  81. package/icc-api/api/IccGroupApi.js.map +1 -1
  82. package/icc-api/api/IccHcpartyApi.d.ts +3 -1
  83. package/icc-api/api/IccHcpartyApi.js +25 -23
  84. package/icc-api/api/IccHcpartyApi.js.map +1 -1
  85. package/icc-api/api/IccHelementApi.d.ts +3 -1
  86. package/icc-api/api/IccHelementApi.js +16 -14
  87. package/icc-api/api/IccHelementApi.js.map +1 -1
  88. package/icc-api/api/IccIcureApi.d.ts +3 -1
  89. package/icc-api/api/IccIcureApi.js +19 -17
  90. package/icc-api/api/IccIcureApi.js.map +1 -1
  91. package/icc-api/api/IccInsuranceApi.d.ts +3 -1
  92. package/icc-api/api/IccInsuranceApi.js +10 -8
  93. package/icc-api/api/IccInsuranceApi.js.map +1 -1
  94. package/icc-api/api/IccInvoiceApi.d.ts +3 -1
  95. package/icc-api/api/IccInvoiceApi.js +34 -32
  96. package/icc-api/api/IccInvoiceApi.js.map +1 -1
  97. package/icc-api/api/IccKeywordApi.d.ts +3 -1
  98. package/icc-api/api/IccKeywordApi.js +9 -7
  99. package/icc-api/api/IccKeywordApi.js.map +1 -1
  100. package/icc-api/api/IccMaintenanceTaskApi.d.ts +3 -1
  101. package/icc-api/api/IccMaintenanceTaskApi.js +8 -6
  102. package/icc-api/api/IccMaintenanceTaskApi.js.map +1 -1
  103. package/icc-api/api/IccMedexApi.d.ts +3 -1
  104. package/icc-api/api/IccMedexApi.js +4 -2
  105. package/icc-api/api/IccMedexApi.js.map +1 -1
  106. package/icc-api/api/IccMedicallocationApi.d.ts +3 -1
  107. package/icc-api/api/IccMedicallocationApi.js +8 -6
  108. package/icc-api/api/IccMedicallocationApi.js.map +1 -1
  109. package/icc-api/api/IccMessageApi.d.ts +3 -1
  110. package/icc-api/api/IccMessageApi.js +22 -20
  111. package/icc-api/api/IccMessageApi.js.map +1 -1
  112. package/icc-api/api/IccPatientApi.d.ts +3 -1
  113. package/icc-api/api/IccPatientApi.js +37 -35
  114. package/icc-api/api/IccPatientApi.js.map +1 -1
  115. package/icc-api/api/IccPermissionApi.d.ts +3 -1
  116. package/icc-api/api/IccPermissionApi.js +4 -2
  117. package/icc-api/api/IccPermissionApi.js.map +1 -1
  118. package/icc-api/api/IccPlaceApi.d.ts +3 -1
  119. package/icc-api/api/IccPlaceApi.js +8 -6
  120. package/icc-api/api/IccPlaceApi.js.map +1 -1
  121. package/icc-api/api/IccPubsubApi.d.ts +3 -1
  122. package/icc-api/api/IccPubsubApi.js +7 -5
  123. package/icc-api/api/IccPubsubApi.js.map +1 -1
  124. package/icc-api/api/IccReceiptApi.d.ts +3 -1
  125. package/icc-api/api/IccReceiptApi.js +10 -8
  126. package/icc-api/api/IccReceiptApi.js.map +1 -1
  127. package/icc-api/api/IccReplicationApi.d.ts +3 -1
  128. package/icc-api/api/IccReplicationApi.js +7 -5
  129. package/icc-api/api/IccReplicationApi.js.map +1 -1
  130. package/icc-api/api/IccTarificationApi.d.ts +3 -1
  131. package/icc-api/api/IccTarificationApi.js +11 -9
  132. package/icc-api/api/IccTarificationApi.js.map +1 -1
  133. package/icc-api/api/IccTimeTableApi.d.ts +3 -1
  134. package/icc-api/api/IccTimeTableApi.js +9 -7
  135. package/icc-api/api/IccTimeTableApi.js.map +1 -1
  136. package/icc-api/api/IccTmpApi.d.ts +3 -1
  137. package/icc-api/api/IccTmpApi.js +74 -72
  138. package/icc-api/api/IccTmpApi.js.map +1 -1
  139. package/icc-api/api/IccUserApi.d.ts +3 -1
  140. package/icc-api/api/IccUserApi.js +29 -27
  141. package/icc-api/api/IccUserApi.js.map +1 -1
  142. package/icc-api/api/XHR.d.ts +2 -1
  143. package/icc-api/api/XHR.js +45 -59
  144. package/icc-api/api/XHR.js.map +1 -1
  145. package/icc-api/model/AuthenticationResponse.d.ts +2 -0
  146. package/icc-api/model/AuthenticationResponse.js.map +1 -1
  147. package/icc-api/model/Group.d.ts +6 -0
  148. package/icc-api/model/Group.js.map +1 -1
  149. package/icc-api/model/RefreshTokenExpiredError.d.ts +3 -0
  150. package/icc-api/model/RefreshTokenExpiredError.js +10 -0
  151. package/icc-api/model/RefreshTokenExpiredError.js.map +1 -0
  152. package/icc-api/model/RegistrationInformation.d.ts +1 -0
  153. package/icc-api/model/RegistrationInformation.js.map +1 -1
  154. package/icc-api/model/TimeTableItem.d.ts +2 -1
  155. package/icc-api/model/TimeTableItem.js.map +1 -1
  156. package/icc-x-api/auth/AuthService.d.ts +16 -0
  157. package/icc-x-api/auth/AuthService.js +3 -0
  158. package/icc-x-api/auth/AuthService.js.map +1 -0
  159. package/icc-x-api/auth/AuthenticationProvider.d.ts +30 -0
  160. package/icc-x-api/auth/AuthenticationProvider.js +56 -0
  161. package/icc-x-api/auth/AuthenticationProvider.js.map +1 -0
  162. package/icc-x-api/auth/BasicAuthService.d.ts +12 -0
  163. package/icc-x-api/auth/BasicAuthService.js +27 -0
  164. package/icc-x-api/auth/BasicAuthService.js.map +1 -0
  165. package/icc-x-api/auth/EnsembleAuthService.d.ts +17 -0
  166. package/icc-x-api/auth/EnsembleAuthService.js +60 -0
  167. package/icc-x-api/auth/EnsembleAuthService.js.map +1 -0
  168. package/icc-x-api/auth/JwtAuthService.d.ts +19 -0
  169. package/icc-x-api/auth/JwtAuthService.js +97 -0
  170. package/icc-x-api/auth/JwtAuthService.js.map +1 -0
  171. package/icc-x-api/auth/NoAuthService.d.ts +8 -0
  172. package/icc-x-api/auth/NoAuthService.js +30 -0
  173. package/icc-x-api/auth/NoAuthService.js.map +1 -0
  174. package/icc-x-api/filters/MaintenanceTaskAfterDateFilter.d.ts +1 -0
  175. package/icc-x-api/filters/MaintenanceTaskAfterDateFilter.js.map +1 -1
  176. package/icc-x-api/icc-accesslog-x-api.d.ts +2 -1
  177. package/icc-x-api/icc-accesslog-x-api.js +3 -2
  178. package/icc-x-api/icc-accesslog-x-api.js.map +1 -1
  179. package/icc-x-api/icc-bekmehr-x-api.d.ts +2 -1
  180. package/icc-x-api/icc-bekmehr-x-api.js +3 -2
  181. package/icc-x-api/icc-bekmehr-x-api.js.map +1 -1
  182. package/icc-x-api/icc-calendar-item-x-api.d.ts +2 -1
  183. package/icc-x-api/icc-calendar-item-x-api.js +3 -2
  184. package/icc-x-api/icc-calendar-item-x-api.js.map +1 -1
  185. package/icc-x-api/icc-classification-x-api.d.ts +2 -1
  186. package/icc-x-api/icc-classification-x-api.js +3 -2
  187. package/icc-x-api/icc-classification-x-api.js.map +1 -1
  188. package/icc-x-api/icc-code-x-api.d.ts +2 -1
  189. package/icc-x-api/icc-code-x-api.js +3 -2
  190. package/icc-x-api/icc-code-x-api.js.map +1 -1
  191. package/icc-x-api/icc-contact-x-api.d.ts +2 -1
  192. package/icc-x-api/icc-contact-x-api.js +3 -2
  193. package/icc-x-api/icc-contact-x-api.js.map +1 -1
  194. package/icc-x-api/icc-crypto-x-api.d.ts +13 -0
  195. package/icc-x-api/icc-crypto-x-api.js +22 -0
  196. package/icc-x-api/icc-crypto-x-api.js.map +1 -1
  197. package/icc-x-api/icc-doctemplate-x-api.d.ts +3 -1
  198. package/icc-x-api/icc-doctemplate-x-api.js +5 -3
  199. package/icc-x-api/icc-doctemplate-x-api.js.map +1 -1
  200. package/icc-x-api/icc-document-x-api.d.ts +3 -1
  201. package/icc-x-api/icc-document-x-api.js +5 -3
  202. package/icc-x-api/icc-document-x-api.js.map +1 -1
  203. package/icc-x-api/icc-form-x-api.d.ts +2 -1
  204. package/icc-x-api/icc-form-x-api.js +3 -2
  205. package/icc-x-api/icc-form-x-api.js.map +1 -1
  206. package/icc-x-api/icc-hcparty-x-api.d.ts +2 -1
  207. package/icc-x-api/icc-hcparty-x-api.js +3 -2
  208. package/icc-x-api/icc-hcparty-x-api.js.map +1 -1
  209. package/icc-x-api/icc-helement-x-api.d.ts +2 -1
  210. package/icc-x-api/icc-helement-x-api.js +3 -2
  211. package/icc-x-api/icc-helement-x-api.js.map +1 -1
  212. package/icc-x-api/icc-invoice-x-api.d.ts +2 -1
  213. package/icc-x-api/icc-invoice-x-api.js +3 -2
  214. package/icc-x-api/icc-invoice-x-api.js.map +1 -1
  215. package/icc-x-api/icc-maintenance-task-x-api.d.ts +2 -1
  216. package/icc-x-api/icc-maintenance-task-x-api.js +3 -2
  217. package/icc-x-api/icc-maintenance-task-x-api.js.map +1 -1
  218. package/icc-x-api/icc-message-x-api.d.ts +2 -1
  219. package/icc-x-api/icc-message-x-api.js +3 -2
  220. package/icc-x-api/icc-message-x-api.js.map +1 -1
  221. package/icc-x-api/icc-patient-x-api.d.ts +2 -1
  222. package/icc-x-api/icc-patient-x-api.js +3 -2
  223. package/icc-x-api/icc-patient-x-api.js.map +1 -1
  224. package/icc-x-api/icc-receipt-x-api.d.ts +2 -1
  225. package/icc-x-api/icc-receipt-x-api.js +3 -2
  226. package/icc-x-api/icc-receipt-x-api.js.map +1 -1
  227. package/icc-x-api/icc-time-table-x-api.d.ts +2 -1
  228. package/icc-x-api/icc-time-table-x-api.js +3 -2
  229. package/icc-x-api/icc-time-table-x-api.js.map +1 -1
  230. package/icc-x-api/icc-user-x-api.d.ts +2 -1
  231. package/icc-x-api/icc-user-x-api.js +3 -2
  232. package/icc-x-api/icc-user-x-api.js.map +1 -1
  233. package/icc-x-api/index.d.ts +0 -4
  234. package/icc-x-api/index.js +34 -35
  235. package/icc-x-api/index.js.map +1 -1
  236. package/icc-x-api/storage/StorageFacade.d.ts +1 -1
  237. package/icc-x-api/storage/StorageFacade.js.map +1 -1
  238. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"icc-time-table-x-api.js","sourceRoot":"","sources":["../../icc-x-api/icc-time-table-x-api.ts"],"names":[],"mappings":";;;AAAA,4CAA2C;AAE3C,4BAA2B;AAC3B,wCAA4C;AAM5C,MAAa,gBAAiB,SAAQ,yBAAe;IAKnD,YACE,IAAY,EACZ,OAAkC,EAClC,MAAqB,EACrB,YAA8B,EAC9B,YAA2E,OAAO,MAAM,KAAK,WAAW;QACtG,CAAC,CAAC,MAAM,CAAC,KAAK;QACd,CAAC,CAAC,OAAO,IAAI,KAAK,WAAW;YAC7B,CAAC,CAAC,IAAI,CAAC,KAAK;YACZ,CAAC,CAAC,KAAK;QAET,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,CAAC,CAAA;QAfjC,SAAI,GAAQ,IAAI,CAAA;QAgBd,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;IAClC,CAAC;IAED,WAAW,CAAC,IAAU,EAAE,EAAa;QACnC,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CACxB;YACE,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE;YAC5B,KAAK,EAAE,qCAAqC;YAC5C,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE;YAC7B,QAAQ,EAAE,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE;YAC9B,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,IAAI,CAAC;YACnD,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nimport { IccTimeTableApi } from '../icc-api'\nimport { User } from '../icc-api/model/User'\nimport { TimeTable } from '../icc-api/model/TimeTable'\nimport { IccCryptoXApi } from './icc-crypto-x-api'\nimport { IccDataOwnerXApi } from './icc-data-owner-x-api'\n\nexport class IccTimeTableXApi extends IccTimeTableApi {\n i18n: any = i18n\n crypto: IccCryptoXApi\n dataOwnerApi: IccDataOwnerXApi\n\n constructor(\n host: string,\n headers: { [key: string]: string },\n crypto: IccCryptoXApi,\n dataOwnerApi: IccDataOwnerXApi,\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response> = typeof window !== 'undefined'\n ? window.fetch\n : typeof self !== 'undefined'\n ? self.fetch\n : fetch\n ) {\n super(host, headers, fetchImpl)\n this.crypto = crypto\n this.dataOwnerApi = dataOwnerApi\n }\n\n newInstance(user: User, tt: TimeTable) {\n const timeTable = _.extend(\n {\n id: this.crypto.randomUuid(),\n _type: 'org.taktik.icure.entities.TimeTable',\n created: new Date().getTime(),\n modified: new Date().getTime(),\n responsible: this.dataOwnerApi.getDataOwnerOf(user),\n author: user.id,\n codes: [],\n tags: [],\n },\n tt || {}\n )\n\n return this.crypto.initObjectDelegations(timeTable, null, this.dataOwnerApi.getDataOwnerOf(user), null).then((initData) => {\n _.extend(timeTable, { delegations: initData.delegations })\n\n let promise = Promise.resolve(timeTable)\n ;(user.autoDelegations ? (user.autoDelegations.all || []).concat(user.autoDelegations.medicalInformation || []) : []).forEach(\n (delegateId) =>\n (promise = promise\n .then((patient) =>\n this.crypto.extendedDelegationsAndCryptedForeignKeys(\n patient,\n null,\n this.dataOwnerApi.getDataOwnerOf(user),\n delegateId,\n initData.secretId\n )\n )\n .then((extraData) => _.extend(timeTable, { delegations: extraData.delegations })))\n )\n return promise\n })\n }\n}\n"]}
1
+ {"version":3,"file":"icc-time-table-x-api.js","sourceRoot":"","sources":["../../icc-x-api/icc-time-table-x-api.ts"],"names":[],"mappings":";;;AAAA,4CAA2C;AAE3C,4BAA2B;AAC3B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AAW,EAAE,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAA;YAE1D,IAAI,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CACvC;YAAA,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,kBAAkB,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,OAAO,CAC3H,CAAC,UAAU,EAAE,EAAE,CACb,CAAC,OAAO,GAAG,OAAO;iBACf,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAChB,IAAI,CAAC,MAAM,CAAC,wCAAwC,CAClD,OAAO,EACP,IAAI,EACJ,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,IAAI,CAAC,EACtC,UAAU,EACV,QAAQ,CAAC,QAAQ,CAClB,CACF;iBACA,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,WAAW,EAAE,SAAS,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CACvF,CAAA;YACD,OAAO,OAAO,CAAA;QAChB,CAAC,CAAC,CAAA;IACJ,CAAC;CACF;AA1DD,4CA0DC","sourcesContent":["import * as i18n from './rsrc/contact.i18n'\n\nimport * as _ from 'lodash'\nimport { IccTimeTableApi } from '../icc-api'\nimport { User } from '../icc-api/model/User'\nimport { TimeTable } from '../icc-api/model/TimeTable'\nimport { IccCryptoXApi } from './icc-crypto-x-api'\nimport { IccDataOwnerXApi } from './icc-data-owner-x-api'\nimport { AuthenticationProvider, NoAuthenticationProvider } from './auth/AuthenticationProvider'\n\nexport class IccTimeTableXApi extends IccTimeTableApi {\n i18n: any = i18n\n crypto: IccCryptoXApi\n dataOwnerApi: IccDataOwnerXApi\n\n constructor(\n host: string,\n headers: { [key: string]: string },\n crypto: IccCryptoXApi,\n dataOwnerApi: IccDataOwnerXApi,\n authenticationProvider: AuthenticationProvider = new NoAuthenticationProvider(),\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response> = typeof window !== 'undefined'\n ? window.fetch\n : typeof self !== 'undefined'\n ? self.fetch\n : fetch\n ) {\n super(host, headers, authenticationProvider, fetchImpl)\n this.crypto = crypto\n this.dataOwnerApi = dataOwnerApi\n }\n\n newInstance(user: User, tt: TimeTable) {\n const timeTable = _.extend(\n {\n id: this.crypto.randomUuid(),\n _type: 'org.taktik.icure.entities.TimeTable',\n created: new Date().getTime(),\n modified: new Date().getTime(),\n responsible: this.dataOwnerApi.getDataOwnerOf(user),\n author: user.id,\n codes: [],\n tags: [],\n },\n tt || {}\n )\n\n return this.crypto.initObjectDelegations(timeTable, null, this.dataOwnerApi.getDataOwnerOf(user), null).then((initData) => {\n _.extend(timeTable, { delegations: initData.delegations })\n\n let promise = Promise.resolve(timeTable)\n ;(user.autoDelegations ? (user.autoDelegations.all || []).concat(user.autoDelegations.medicalInformation || []) : []).forEach(\n (delegateId) =>\n (promise = promise\n .then((patient) =>\n this.crypto.extendedDelegationsAndCryptedForeignKeys(\n patient,\n null,\n this.dataOwnerApi.getDataOwnerOf(user),\n delegateId,\n initData.secretId\n )\n )\n .then((extraData) => _.extend(timeTable, { delegations: extraData.delegations })))\n )\n return promise\n })\n }\n}\n"]}
@@ -1,7 +1,8 @@
1
1
  import { IccUserApi } from '../icc-api/api/IccUserApi';
2
+ import { AuthenticationProvider } from './auth/AuthenticationProvider';
2
3
  export declare class IccUserXApi extends IccUserApi {
3
4
  fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response>;
4
5
  constructor(host: string, headers: {
5
6
  [key: string]: string;
6
- }, fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>);
7
+ }, authenticationProvider?: AuthenticationProvider, fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>);
7
8
  }
@@ -2,13 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.IccUserXApi = void 0;
4
4
  const IccUserApi_1 = require("../icc-api/api/IccUserApi");
5
+ const AuthenticationProvider_1 = require("./auth/AuthenticationProvider");
5
6
  class IccUserXApi extends IccUserApi_1.IccUserApi {
6
- constructor(host, headers, fetchImpl = typeof window !== 'undefined'
7
+ constructor(host, headers, authenticationProvider = new AuthenticationProvider_1.NoAuthenticationProvider(), fetchImpl = typeof window !== 'undefined'
7
8
  ? window.fetch
8
9
  : typeof self !== 'undefined'
9
10
  ? self.fetch
10
11
  : fetch) {
11
- super(host, headers, fetchImpl);
12
+ super(host, headers, authenticationProvider, fetchImpl);
12
13
  this.fetchImpl = fetchImpl;
13
14
  }
14
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"icc-user-x-api.js","sourceRoot":"","sources":["../../icc-x-api/icc-user-x-api.ts"],"names":[],"mappings":";;;AAAA,0DAAsD;AAEtD,MAAa,WAAY,SAAQ,uBAAU;IAGzC,YACE,IAAY,EACZ,OAAkC,EAClC,YAA2E,OAAO,MAAM,KAAK,WAAW;QACtG,CAAC,CAAC,MAAM,CAAC,KAAK;QACd,CAAC,CAAC,OAAO,IAAI,KAAK,WAAW;YAC7B,CAAC,CAAC,IAAI,CAAC,KAAK;YACZ,CAAC,CAAC,KAAK;QAET,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,CAAC,CAAA;QAC/B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;IAC5B,CAAC;CACF;AAfD,kCAeC","sourcesContent":["import { IccUserApi } from '../icc-api/api/IccUserApi'\n\nexport class IccUserXApi extends IccUserApi {\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response>\n\n constructor(\n host: string,\n headers: { [key: string]: string },\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response> = typeof window !== 'undefined'\n ? window.fetch\n : typeof self !== 'undefined'\n ? self.fetch\n : fetch\n ) {\n super(host, headers, fetchImpl)\n this.fetchImpl = fetchImpl\n }\n}\n"]}
1
+ {"version":3,"file":"icc-user-x-api.js","sourceRoot":"","sources":["../../icc-x-api/icc-user-x-api.ts"],"names":[],"mappings":";;;AAAA,0DAAsD;AACtD,0EAAgG;AAEhG,MAAa,WAAY,SAAQ,uBAAU;IAGzC,YACE,IAAY,EACZ,OAAkC,EAClC,yBAAiD,IAAI,iDAAwB,EAAE,EAC/E,YAA2E,OAAO,MAAM,KAAK,WAAW;QACtG,CAAC,CAAC,MAAM,CAAC,KAAK;QACd,CAAC,CAAC,OAAO,IAAI,KAAK,WAAW;YAC7B,CAAC,CAAC,IAAI,CAAC,KAAK;YACZ,CAAC,CAAC,KAAK;QAET,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,sBAAsB,EAAE,SAAS,CAAC,CAAA;QACvD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;IAC5B,CAAC;CACF;AAhBD,kCAgBC","sourcesContent":["import { IccUserApi } from '../icc-api/api/IccUserApi'\nimport { AuthenticationProvider, NoAuthenticationProvider } from './auth/AuthenticationProvider'\n\nexport class IccUserXApi extends IccUserApi {\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response>\n\n constructor(\n host: string,\n headers: { [key: string]: string },\n authenticationProvider: AuthenticationProvider = new NoAuthenticationProvider(),\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response> = typeof window !== 'undefined'\n ? window.fetch\n : typeof self !== 'undefined'\n ? self.fetch\n : fetch\n ) {\n super(host, headers, authenticationProvider, fetchImpl)\n this.fetchImpl = fetchImpl\n }\n}\n"]}
@@ -43,10 +43,6 @@ export { KeyStorageFacade } from './storage/KeyStorageFacade';
43
43
  export { LocalStorageImpl } from './storage/LocalStorageImpl';
44
44
  export { StorageFacade } from './storage/StorageFacade';
45
45
  export { KeyStorageImpl } from './storage/KeyStorageImpl';
46
- export declare const apiHeaders: (username: string, password: string, forceBasic?: boolean) => {
47
- Authorization: string;
48
- 'force-authentication': string;
49
- };
50
46
  export interface Apis {
51
47
  authApi: IccAuthApi;
52
48
  codeApi: IccCodeXApi;
@@ -23,7 +23,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
23
23
  });
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.Api = exports.apiHeaders = exports.KeyStorageImpl = exports.LocalStorageImpl = void 0;
26
+ exports.Api = exports.KeyStorageImpl = exports.LocalStorageImpl = void 0;
27
27
  const icc_api_1 = require("../icc-api");
28
28
  const icc_user_x_api_1 = require("./icc-user-x-api");
29
29
  const icc_crypto_x_api_1 = require("./icc-crypto-x-api");
@@ -47,6 +47,7 @@ const icc_data_owner_x_api_1 = require("./icc-data-owner-x-api");
47
47
  const utils_1 = require("./utils");
48
48
  const LocalStorageImpl_1 = require("./storage/LocalStorageImpl");
49
49
  const KeyStorageImpl_1 = require("./storage/KeyStorageImpl");
50
+ const AuthenticationProvider_1 = require("./auth/AuthenticationProvider");
50
51
  __exportStar(require("./icc-accesslog-x-api"), exports);
51
52
  __exportStar(require("./icc-bekmehr-x-api"), exports);
52
53
  __exportStar(require("./icc-calendar-item-x-api"), exports);
@@ -70,47 +71,45 @@ var LocalStorageImpl_2 = require("./storage/LocalStorageImpl");
70
71
  Object.defineProperty(exports, "LocalStorageImpl", { enumerable: true, get: function () { return LocalStorageImpl_2.LocalStorageImpl; } });
71
72
  var KeyStorageImpl_2 = require("./storage/KeyStorageImpl");
72
73
  Object.defineProperty(exports, "KeyStorageImpl", { enumerable: true, get: function () { return KeyStorageImpl_2.KeyStorageImpl; } });
73
- const apiHeaders = function (username, password, forceBasic = false) {
74
- return {
75
- Authorization: `Basic ${typeof btoa !== 'undefined' ? btoa(`${username}:${password}`) : Buffer.from(`${username}:${password}`).toString('base64')}`,
76
- 'force-authentication': forceBasic ? 'true' : 'false',
77
- };
78
- };
79
- exports.apiHeaders = apiHeaders;
80
74
  const Api = function (host, username, password, crypto = typeof window !== 'undefined' ? window.crypto : typeof self !== 'undefined' ? self.crypto : {}, fetchImpl = typeof window !== 'undefined'
81
75
  ? window.fetch
82
76
  : typeof self !== 'undefined'
83
77
  ? self.fetch
84
- : fetch, forceBasic = false, autoLogin = true, storage, keyStorage) {
78
+ : fetch, forceBasic = false, autoLogin = false, storage, keyStorage) {
85
79
  return __awaiter(this, void 0, void 0, function* () {
86
80
  const _storage = storage || new LocalStorageImpl_1.LocalStorageImpl();
87
81
  const _keyStorage = keyStorage || new KeyStorageImpl_1.KeyStorageImpl(_storage);
88
- const headers = (0, exports.apiHeaders)(username, password, forceBasic);
89
- const authApi = new icc_api_1.IccAuthApi(host, headers, fetchImpl);
90
- const codeApi = new icc_code_x_api_1.IccCodeXApi(host, headers, fetchImpl);
91
- const entityReferenceApi = new icc_api_1.IccEntityrefApi(host, headers, fetchImpl);
92
- const userApi = new icc_user_x_api_1.IccUserXApi(host, headers, fetchImpl);
93
- const permissionApi = new icc_api_1.IccPermissionApi(host, headers, fetchImpl);
94
- const healthcarePartyApi = new icc_hcparty_x_api_1.IccHcpartyXApi(host, headers, fetchImpl);
95
- const deviceApi = new IccDeviceApi_1.IccDeviceApi(host, headers, fetchImpl);
96
- const cryptoApi = new icc_crypto_x_api_1.IccCryptoXApi(host, headers, healthcarePartyApi, new icc_api_1.IccPatientApi(host, headers, fetchImpl), deviceApi, crypto, _storage, _keyStorage);
97
- const dataOwnerApi = new icc_data_owner_x_api_1.IccDataOwnerXApi(cryptoApi, new icc_api_1.IccPatientApi(host, headers, fetchImpl));
98
- const accessLogApi = new icc_accesslog_x_api_1.IccAccesslogXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl);
99
- const agendaApi = new icc_api_1.IccAgendaApi(host, headers, fetchImpl);
100
- const contactApi = new icc_contact_x_api_1.IccContactXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl);
101
- const formApi = new icc_form_x_api_1.IccFormXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl);
102
- const groupApi = new icc_api_1.IccGroupApi(host, headers);
103
- const invoiceApi = new icc_invoice_x_api_1.IccInvoiceXApi(host, headers, cryptoApi, entityReferenceApi, dataOwnerApi, fetchImpl);
104
- const insuranceApi = new icc_api_1.IccInsuranceApi(host, headers, fetchImpl);
105
- const documentApi = new icc_document_x_api_1.IccDocumentXApi(host, headers, cryptoApi, authApi, dataOwnerApi, fetchImpl);
106
- const healthcareElementApi = new icc_helement_x_api_1.IccHelementXApi(host, headers, cryptoApi, dataOwnerApi, ['descr', 'note'], fetchImpl);
107
- const classificationApi = new icc_classification_x_api_1.IccClassificationXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl);
108
- const calendarItemApi = new icc_calendar_item_x_api_1.IccCalendarItemXApi(host, headers, cryptoApi, dataOwnerApi, ['details', 'title', 'patientId'], fetchImpl);
109
- const receiptApi = new icc_receipt_x_api_1.IccReceiptXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl);
110
- const timetableApi = new icc_time_table_x_api_1.IccTimeTableXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl);
111
- const patientApi = new icc_patient_x_api_1.IccPatientXApi(host, headers, cryptoApi, contactApi, formApi, healthcareElementApi, invoiceApi, documentApi, healthcarePartyApi, classificationApi, dataOwnerApi, calendarItemApi, ['note'], fetchImpl);
112
- const messageApi = new icc_message_x_api_1.IccMessageXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl);
113
- const maintenanceTaskApi = new icc_maintenance_task_x_api_1.IccMaintenanceTaskXApi(host, headers, cryptoApi, healthcarePartyApi, dataOwnerApi, ['properties'], fetchImpl);
82
+ // The AuthenticationProvider needs a AuthApi without authentication because it will only call methods without authentication
83
+ const headers = {};
84
+ const authenticationProvider = forceBasic
85
+ ? new AuthenticationProvider_1.BasicAuthenticationProvider(username, password)
86
+ : new AuthenticationProvider_1.EnsembleAuthenticationProvider(new icc_api_1.IccAuthApi(host, headers, new AuthenticationProvider_1.NoAuthenticationProvider(), fetchImpl), username, password);
87
+ // Here I instantiate a separate instance of the AuthApi that can call also login-protected methods (logout)
88
+ const authApi = new icc_api_1.IccAuthApi(host, headers, authenticationProvider, fetchImpl);
89
+ const codeApi = new icc_code_x_api_1.IccCodeXApi(host, headers, authenticationProvider, fetchImpl);
90
+ const entityReferenceApi = new icc_api_1.IccEntityrefApi(host, headers, authenticationProvider, fetchImpl);
91
+ const userApi = new icc_user_x_api_1.IccUserXApi(host, headers, authenticationProvider, fetchImpl);
92
+ const permissionApi = new icc_api_1.IccPermissionApi(host, headers, authenticationProvider, fetchImpl);
93
+ const healthcarePartyApi = new icc_hcparty_x_api_1.IccHcpartyXApi(host, headers, authenticationProvider, fetchImpl);
94
+ const deviceApi = new IccDeviceApi_1.IccDeviceApi(host, headers, authenticationProvider, fetchImpl);
95
+ const cryptoApi = new icc_crypto_x_api_1.IccCryptoXApi(host, headers, healthcarePartyApi, new icc_api_1.IccPatientApi(host, headers, authenticationProvider, fetchImpl), deviceApi, crypto, _storage, _keyStorage);
96
+ const dataOwnerApi = new icc_data_owner_x_api_1.IccDataOwnerXApi(cryptoApi, new icc_api_1.IccPatientApi(host, headers, authenticationProvider, fetchImpl));
97
+ const accessLogApi = new icc_accesslog_x_api_1.IccAccesslogXApi(host, headers, cryptoApi, dataOwnerApi, authenticationProvider, fetchImpl);
98
+ const agendaApi = new icc_api_1.IccAgendaApi(host, headers, authenticationProvider, fetchImpl);
99
+ const contactApi = new icc_contact_x_api_1.IccContactXApi(host, headers, cryptoApi, dataOwnerApi, authenticationProvider, fetchImpl);
100
+ const formApi = new icc_form_x_api_1.IccFormXApi(host, headers, cryptoApi, dataOwnerApi, authenticationProvider, fetchImpl);
101
+ const groupApi = new icc_api_1.IccGroupApi(host, headers, authenticationProvider);
102
+ const invoiceApi = new icc_invoice_x_api_1.IccInvoiceXApi(host, headers, cryptoApi, entityReferenceApi, dataOwnerApi, authenticationProvider, fetchImpl);
103
+ const insuranceApi = new icc_api_1.IccInsuranceApi(host, headers, authenticationProvider, fetchImpl);
104
+ const documentApi = new icc_document_x_api_1.IccDocumentXApi(host, headers, cryptoApi, authApi, dataOwnerApi, authenticationProvider, fetchImpl);
105
+ const healthcareElementApi = new icc_helement_x_api_1.IccHelementXApi(host, headers, cryptoApi, dataOwnerApi, ['descr', 'note'], authenticationProvider, fetchImpl);
106
+ const classificationApi = new icc_classification_x_api_1.IccClassificationXApi(host, headers, cryptoApi, dataOwnerApi, authenticationProvider, fetchImpl);
107
+ const calendarItemApi = new icc_calendar_item_x_api_1.IccCalendarItemXApi(host, headers, cryptoApi, dataOwnerApi, ['details', 'title', 'patientId'], authenticationProvider, fetchImpl);
108
+ const receiptApi = new icc_receipt_x_api_1.IccReceiptXApi(host, headers, cryptoApi, dataOwnerApi, authenticationProvider, fetchImpl);
109
+ const timetableApi = new icc_time_table_x_api_1.IccTimeTableXApi(host, headers, cryptoApi, dataOwnerApi, authenticationProvider, fetchImpl);
110
+ const patientApi = new icc_patient_x_api_1.IccPatientXApi(host, headers, cryptoApi, contactApi, formApi, healthcareElementApi, invoiceApi, documentApi, healthcarePartyApi, classificationApi, dataOwnerApi, calendarItemApi, ['note'], authenticationProvider, fetchImpl);
111
+ const messageApi = new icc_message_x_api_1.IccMessageXApi(host, headers, cryptoApi, dataOwnerApi, authenticationProvider, fetchImpl);
112
+ const maintenanceTaskApi = new icc_maintenance_task_x_api_1.IccMaintenanceTaskXApi(host, headers, cryptoApi, healthcarePartyApi, dataOwnerApi, ['properties'], authenticationProvider, fetchImpl);
114
113
  if (autoLogin) {
115
114
  if (username != undefined && password != undefined) {
116
115
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../icc-x-api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAAqI;AACrI,qDAA8C;AAC9C,yDAAkD;AAClD,2DAAoD;AACpD,2DAAoD;AACpD,6DAAsD;AACtD,2DAAoD;AACpD,qDAA8C;AAC9C,6DAAsD;AACtD,yEAAkE;AAClE,uEAA+D;AAC/D,2DAAoD;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BAC5F;aACF;SACF;aAAM;YACL,OAAO,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAA;SACnC;QAED,OAAO;YACL,SAAS;YACT,OAAO;YACP,OAAO;YACP,OAAO;YACP,aAAa;YACb,UAAU;YACV,kBAAkB;YAClB,SAAS;YACT,YAAY;YACZ,UAAU;YACV,oBAAoB;YACpB,WAAW;YACX,OAAO;YACP,UAAU;YACV,YAAY;YACZ,UAAU;YACV,kBAAkB;YAClB,UAAU;YACV,SAAS;YACT,eAAe;YACf,iBAAiB;YACjB,YAAY;YACZ,QAAQ;YACR,kBAAkB;YAClB,YAAY;SACb,CAAA;IACH,CAAC;CAAA,CAAA;AA5GY,QAAA,GAAG,OA4Gf","sourcesContent":["import { IccAgendaApi, IccAuthApi, IccEntityrefApi, IccGroupApi, IccInsuranceApi, IccPatientApi, IccPermissionApi } from '../icc-api'\nimport { IccUserXApi } from './icc-user-x-api'\nimport { IccCryptoXApi } from './icc-crypto-x-api'\nimport { IccContactXApi } from './icc-contact-x-api'\nimport { IccInvoiceXApi } from './icc-invoice-x-api'\nimport { IccDocumentXApi } from './icc-document-x-api'\nimport { IccHcpartyXApi } from './icc-hcparty-x-api'\nimport { IccFormXApi } from './icc-form-x-api'\nimport { IccHelementXApi } from './icc-helement-x-api'\nimport { IccClassificationXApi } from './icc-classification-x-api'\nimport { IccCalendarItemXApi } from './icc-calendar-item-x-api'\nimport { IccPatientXApi } from './icc-patient-x-api'\nimport { IccMessageXApi } from './icc-message-x-api'\nimport { IccReceiptXApi } from './icc-receipt-x-api'\nimport { IccAccesslogXApi } from './icc-accesslog-x-api'\nimport { IccTimeTableXApi } from './icc-time-table-x-api'\nimport { IccDeviceApi } from '../icc-api/api/IccDeviceApi'\nimport { IccCodeXApi } from './icc-code-x-api'\nimport { IccMaintenanceTaskXApi } from './icc-maintenance-task-x-api'\nimport { IccDataOwnerXApi } from './icc-data-owner-x-api'\nimport { retry } from './utils'\nimport { StorageFacade } from './storage/StorageFacade'\nimport { KeyStorageFacade } from './storage/KeyStorageFacade'\nimport { LocalStorageImpl } from './storage/LocalStorageImpl'\nimport { KeyStorageImpl } from './storage/KeyStorageImpl'\n\nexport * from './icc-accesslog-x-api'\nexport * from './icc-bekmehr-x-api'\nexport * from './icc-calendar-item-x-api'\nexport * from './icc-classification-x-api'\nexport * from './icc-code-x-api'\nexport * from './icc-contact-x-api'\nexport * from './icc-crypto-x-api'\nexport * from './icc-doctemplate-x-api'\nexport * from './icc-document-x-api'\nexport * from './icc-form-x-api'\nexport * from './icc-hcparty-x-api'\nexport * from './icc-helement-x-api'\nexport * from './icc-invoice-x-api'\nexport * from './icc-message-x-api'\nexport * from './icc-patient-x-api'\nexport * from './icc-user-x-api'\nexport * from './icc-time-table-x-api'\nexport * from './icc-receipt-x-api'\nexport * from './utils'\nexport { KeyStorageFacade } from './storage/KeyStorageFacade'\nexport { LocalStorageImpl } from './storage/LocalStorageImpl'\nexport { StorageFacade } from './storage/StorageFacade'\nexport { KeyStorageImpl } from './storage/KeyStorageImpl'\n\nexport const apiHeaders = function (username: string, password: string, forceBasic = false) {\n return {\n Authorization: `Basic ${\n typeof btoa !== 'undefined' ? btoa(`${username}:${password}`) : Buffer.from(`${username}:${password}`).toString('base64')\n }`,\n 'force-authentication': forceBasic ? 'true' : 'false',\n }\n}\n\nexport interface Apis {\n authApi: IccAuthApi\n codeApi: IccCodeXApi\n entityReferenceApi: IccEntityrefApi\n userApi: IccUserXApi\n permissionApi: IccPermissionApi\n healthcarePartyApi: IccHcpartyXApi\n deviceApi: IccDeviceApi\n cryptoApi: IccCryptoXApi\n accessLogApi: IccAccesslogXApi\n agendaApi: IccAgendaApi\n contactApi: IccContactXApi\n formApi: IccFormXApi\n groupApi: IccGroupApi\n invoiceApi: IccInvoiceXApi\n insuranceApi: IccInsuranceApi\n documentApi: IccDocumentXApi\n healthcareElementApi: IccHelementXApi\n classificationApi: IccClassificationXApi\n calendarItemApi: IccCalendarItemXApi\n receiptApi: IccReceiptXApi\n timetableApi: IccTimeTableXApi\n patientApi: IccPatientXApi\n messageApi: IccMessageXApi\n maintenanceTaskApi: IccMaintenanceTaskXApi\n dataOwnerApi: IccDataOwnerXApi\n}\n\nexport const Api = async function (\n host: string,\n username: string,\n password: string,\n crypto: Crypto = typeof window !== 'undefined' ? window.crypto : typeof self !== 'undefined' ? self.crypto : ({} as Crypto),\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response> = typeof window !== 'undefined'\n ? window.fetch\n : typeof self !== 'undefined'\n ? self.fetch\n : fetch,\n forceBasic = false,\n autoLogin = true,\n storage?: StorageFacade<string>,\n keyStorage?: KeyStorageFacade\n): Promise<Apis> {\n const _storage = storage || new LocalStorageImpl()\n const _keyStorage = keyStorage || new KeyStorageImpl(_storage)\n\n const headers = apiHeaders(username, password, forceBasic)\n const authApi = new IccAuthApi(host, headers, fetchImpl)\n const codeApi = new IccCodeXApi(host, headers, fetchImpl)\n const entityReferenceApi = new IccEntityrefApi(host, headers, fetchImpl)\n const userApi = new IccUserXApi(host, headers, fetchImpl)\n const permissionApi = new IccPermissionApi(host, headers, fetchImpl)\n const healthcarePartyApi = new IccHcpartyXApi(host, headers, fetchImpl)\n const deviceApi = new IccDeviceApi(host, headers, fetchImpl)\n const cryptoApi = new IccCryptoXApi(\n host,\n headers,\n healthcarePartyApi,\n new IccPatientApi(host, headers, fetchImpl),\n deviceApi,\n crypto,\n _storage,\n _keyStorage\n )\n const dataOwnerApi = new IccDataOwnerXApi(cryptoApi, new IccPatientApi(host, headers, fetchImpl))\n const accessLogApi = new IccAccesslogXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl)\n const agendaApi = new IccAgendaApi(host, headers, fetchImpl)\n const contactApi = new IccContactXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl)\n const formApi = new IccFormXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl)\n const groupApi = new IccGroupApi(host, headers)\n const invoiceApi = new IccInvoiceXApi(host, headers, cryptoApi, entityReferenceApi, dataOwnerApi, fetchImpl)\n const insuranceApi = new IccInsuranceApi(host, headers, fetchImpl)\n const documentApi = new IccDocumentXApi(host, headers, cryptoApi, authApi, dataOwnerApi, fetchImpl)\n const healthcareElementApi = new IccHelementXApi(host, headers, cryptoApi, dataOwnerApi, ['descr', 'note'], fetchImpl)\n const classificationApi = new IccClassificationXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl)\n const calendarItemApi = new IccCalendarItemXApi(host, headers, cryptoApi, dataOwnerApi, ['details', 'title', 'patientId'], fetchImpl)\n const receiptApi = new IccReceiptXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl)\n const timetableApi = new IccTimeTableXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl)\n const patientApi = new IccPatientXApi(\n host,\n headers,\n cryptoApi,\n contactApi,\n formApi,\n healthcareElementApi,\n invoiceApi,\n documentApi,\n healthcarePartyApi,\n classificationApi,\n dataOwnerApi,\n calendarItemApi,\n ['note'],\n fetchImpl\n )\n const messageApi = new IccMessageXApi(host, headers, cryptoApi, dataOwnerApi, fetchImpl)\n const maintenanceTaskApi = new IccMaintenanceTaskXApi(host, headers, cryptoApi, healthcarePartyApi, dataOwnerApi, ['properties'], fetchImpl)\n\n if (autoLogin) {\n if (username != undefined && password != undefined) {\n try {\n await retry(() => authApi.login({ username, password }), 3, 1000, 1.5)\n } catch (e) {\n console.error('Incorrect user and password used to instantiate Api, or network problem', e)\n }\n }\n } else {\n console.info('Auto login skipped')\n }\n\n return {\n cryptoApi,\n authApi,\n codeApi,\n userApi,\n permissionApi,\n patientApi,\n healthcarePartyApi,\n deviceApi,\n accessLogApi,\n contactApi,\n healthcareElementApi,\n documentApi,\n formApi,\n invoiceApi,\n insuranceApi,\n messageApi,\n entityReferenceApi,\n receiptApi,\n agendaApi,\n calendarItemApi,\n classificationApi,\n timetableApi,\n groupApi,\n maintenanceTaskApi,\n dataOwnerApi,\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ic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,sBAAsB,EACtB,SAAS,CACV,CAAA;QAED,IAAI,SAAS,EAAE;YACb,IAAI,QAAQ,IAAI,SAAS,IAAI,QAAQ,IAAI,SAAS,EAAE;gBAClD,IAAI;oBACF,MAAM,IAAA,aAAK,EAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,CAAA;iBACvE;gBAAC,OAAO,CAAC,EAAE;oBACV,OAAO,CAAC,KAAK,CAAC,yEAAyE,EAAE,CAAC,CAAC,CAAA;iBAC5F;aACF;SACF;aAAM;YACL,OAAO,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAA;SACnC;QAED,OAAO;YACL,SAAS;YACT,OAAO;YACP,OAAO;YACP,OAAO;YACP,aAAa;YACb,UAAU;YACV,kBAAkB;YAClB,SAAS;YACT,YAAY;YACZ,UAAU;YACV,oBAAoB;YACpB,WAAW;YACX,OAAO;YACP,UAAU;YACV,YAAY;YACZ,UAAU;YACV,kBAAkB;YAClB,UAAU;YACV,SAAS;YACT,eAAe;YACf,iBAAiB;YACjB,YAAY;YACZ,QAAQ;YACR,kBAAkB;YAClB,YAAY;SACb,CAAA;IACH,CAAC;CAAA,CAAA;AApIY,QAAA,GAAG,OAoIf","sourcesContent":["import { IccAgendaApi, IccAuthApi, IccEntityrefApi, IccGroupApi, IccInsuranceApi, IccPatientApi, IccPermissionApi } from '../icc-api'\nimport { IccUserXApi } from './icc-user-x-api'\nimport { IccCryptoXApi } from './icc-crypto-x-api'\nimport { IccContactXApi } from './icc-contact-x-api'\nimport { IccInvoiceXApi } from './icc-invoice-x-api'\nimport { IccDocumentXApi } from './icc-document-x-api'\nimport { IccHcpartyXApi } from './icc-hcparty-x-api'\nimport { IccFormXApi } from './icc-form-x-api'\nimport { IccHelementXApi } from './icc-helement-x-api'\nimport { IccClassificationXApi } from './icc-classification-x-api'\nimport { IccCalendarItemXApi } from './icc-calendar-item-x-api'\nimport { IccPatientXApi } from './icc-patient-x-api'\nimport { IccMessageXApi } from './icc-message-x-api'\nimport { IccReceiptXApi } from './icc-receipt-x-api'\nimport { IccAccesslogXApi } from './icc-accesslog-x-api'\nimport { IccTimeTableXApi } from './icc-time-table-x-api'\nimport { IccDeviceApi } from '../icc-api/api/IccDeviceApi'\nimport { IccCodeXApi } from './icc-code-x-api'\nimport { IccMaintenanceTaskXApi } from './icc-maintenance-task-x-api'\nimport { IccDataOwnerXApi } from './icc-data-owner-x-api'\nimport { retry } from './utils'\nimport { StorageFacade } from './storage/StorageFacade'\nimport { KeyStorageFacade } from './storage/KeyStorageFacade'\nimport { LocalStorageImpl } from './storage/LocalStorageImpl'\nimport { KeyStorageImpl } from './storage/KeyStorageImpl'\nimport { BasicAuthenticationProvider, EnsembleAuthenticationProvider, NoAuthenticationProvider } from './auth/AuthenticationProvider'\n\nexport * from './icc-accesslog-x-api'\nexport * from './icc-bekmehr-x-api'\nexport * from './icc-calendar-item-x-api'\nexport * from './icc-classification-x-api'\nexport * from './icc-code-x-api'\nexport * from './icc-contact-x-api'\nexport * from './icc-crypto-x-api'\nexport * from './icc-doctemplate-x-api'\nexport * from './icc-document-x-api'\nexport * from './icc-form-x-api'\nexport * from './icc-hcparty-x-api'\nexport * from './icc-helement-x-api'\nexport * from './icc-invoice-x-api'\nexport * from './icc-message-x-api'\nexport * from './icc-patient-x-api'\nexport * from './icc-user-x-api'\nexport * from './icc-time-table-x-api'\nexport * from './icc-receipt-x-api'\nexport * from './utils'\nexport { KeyStorageFacade } from './storage/KeyStorageFacade'\nexport { LocalStorageImpl } from './storage/LocalStorageImpl'\nexport { StorageFacade } from './storage/StorageFacade'\nexport { KeyStorageImpl } from './storage/KeyStorageImpl'\n\nexport interface Apis {\n authApi: IccAuthApi\n codeApi: IccCodeXApi\n entityReferenceApi: IccEntityrefApi\n userApi: IccUserXApi\n permissionApi: IccPermissionApi\n healthcarePartyApi: IccHcpartyXApi\n deviceApi: IccDeviceApi\n cryptoApi: IccCryptoXApi\n accessLogApi: IccAccesslogXApi\n agendaApi: IccAgendaApi\n contactApi: IccContactXApi\n formApi: IccFormXApi\n groupApi: IccGroupApi\n invoiceApi: IccInvoiceXApi\n insuranceApi: IccInsuranceApi\n documentApi: IccDocumentXApi\n healthcareElementApi: IccHelementXApi\n classificationApi: IccClassificationXApi\n calendarItemApi: IccCalendarItemXApi\n receiptApi: IccReceiptXApi\n timetableApi: IccTimeTableXApi\n patientApi: IccPatientXApi\n messageApi: IccMessageXApi\n maintenanceTaskApi: IccMaintenanceTaskXApi\n dataOwnerApi: IccDataOwnerXApi\n}\n\nexport const Api = async function (\n host: string,\n username: string,\n password: string,\n crypto: Crypto = typeof window !== 'undefined' ? window.crypto : typeof self !== 'undefined' ? self.crypto : ({} as Crypto),\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response> = typeof window !== 'undefined'\n ? window.fetch\n : typeof self !== 'undefined'\n ? self.fetch\n : fetch,\n forceBasic = false,\n autoLogin = false,\n storage?: StorageFacade<string>,\n keyStorage?: KeyStorageFacade\n): Promise<Apis> {\n const _storage = storage || new LocalStorageImpl()\n const _keyStorage = keyStorage || new KeyStorageImpl(_storage)\n\n // The AuthenticationProvider needs a AuthApi without authentication because it will only call methods without authentication\n const headers = {}\n const authenticationProvider = forceBasic\n ? new BasicAuthenticationProvider(username, password)\n : new EnsembleAuthenticationProvider(new IccAuthApi(host, headers, new NoAuthenticationProvider(), fetchImpl), username, password)\n\n // Here I instantiate a separate instance of the AuthApi that can call also login-protected methods (logout)\n const authApi = new IccAuthApi(host, headers, authenticationProvider, fetchImpl)\n const codeApi = new IccCodeXApi(host, headers, authenticationProvider, fetchImpl)\n const entityReferenceApi = new IccEntityrefApi(host, headers, authenticationProvider, fetchImpl)\n const userApi = new IccUserXApi(host, headers, authenticationProvider, fetchImpl)\n const permissionApi = new IccPermissionApi(host, headers, authenticationProvider, fetchImpl)\n const healthcarePartyApi = new IccHcpartyXApi(host, headers, authenticationProvider, fetchImpl)\n const deviceApi = new IccDeviceApi(host, headers, authenticationProvider, fetchImpl)\n const cryptoApi = new IccCryptoXApi(\n host,\n headers,\n healthcarePartyApi,\n new IccPatientApi(host, headers, authenticationProvider, fetchImpl),\n deviceApi,\n crypto,\n _storage,\n _keyStorage\n )\n const dataOwnerApi = new IccDataOwnerXApi(cryptoApi, new IccPatientApi(host, headers, authenticationProvider, fetchImpl))\n const accessLogApi = new IccAccesslogXApi(host, headers, cryptoApi, dataOwnerApi, authenticationProvider, fetchImpl)\n const agendaApi = new IccAgendaApi(host, headers, authenticationProvider, fetchImpl)\n const contactApi = new IccContactXApi(host, headers, cryptoApi, dataOwnerApi, authenticationProvider, fetchImpl)\n const formApi = new IccFormXApi(host, headers, cryptoApi, dataOwnerApi, authenticationProvider, fetchImpl)\n const groupApi = new IccGroupApi(host, headers, authenticationProvider)\n const invoiceApi = new IccInvoiceXApi(host, headers, cryptoApi, entityReferenceApi, dataOwnerApi, authenticationProvider, fetchImpl)\n const insuranceApi = new IccInsuranceApi(host, headers, authenticationProvider, fetchImpl)\n const documentApi = new IccDocumentXApi(host, headers, cryptoApi, authApi, dataOwnerApi, authenticationProvider, fetchImpl)\n const healthcareElementApi = new IccHelementXApi(host, headers, cryptoApi, dataOwnerApi, ['descr', 'note'], authenticationProvider, fetchImpl)\n const classificationApi = new IccClassificationXApi(host, headers, cryptoApi, dataOwnerApi, authenticationProvider, fetchImpl)\n const calendarItemApi = new IccCalendarItemXApi(\n host,\n headers,\n cryptoApi,\n dataOwnerApi,\n ['details', 'title', 'patientId'],\n authenticationProvider,\n fetchImpl\n )\n const receiptApi = new IccReceiptXApi(host, headers, cryptoApi, dataOwnerApi, authenticationProvider, fetchImpl)\n const timetableApi = new IccTimeTableXApi(host, headers, cryptoApi, dataOwnerApi, authenticationProvider, fetchImpl)\n const patientApi = new IccPatientXApi(\n host,\n headers,\n cryptoApi,\n contactApi,\n formApi,\n healthcareElementApi,\n invoiceApi,\n documentApi,\n healthcarePartyApi,\n classificationApi,\n dataOwnerApi,\n calendarItemApi,\n ['note'],\n authenticationProvider,\n fetchImpl\n )\n const messageApi = new IccMessageXApi(host, headers, cryptoApi, dataOwnerApi, authenticationProvider, fetchImpl)\n const maintenanceTaskApi = new IccMaintenanceTaskXApi(\n host,\n headers,\n cryptoApi,\n healthcarePartyApi,\n dataOwnerApi,\n ['properties'],\n authenticationProvider,\n fetchImpl\n )\n\n if (autoLogin) {\n if (username != undefined && password != undefined) {\n try {\n await retry(() => authApi.login({ username, password }), 3, 1000, 1.5)\n } catch (e) {\n console.error('Incorrect user and password used to instantiate Api, or network problem', e)\n }\n }\n } else {\n console.info('Auto login skipped')\n }\n\n return {\n cryptoApi,\n authApi,\n codeApi,\n userApi,\n permissionApi,\n patientApi,\n healthcarePartyApi,\n deviceApi,\n accessLogApi,\n contactApi,\n healthcareElementApi,\n documentApi,\n formApi,\n invoiceApi,\n insuranceApi,\n messageApi,\n entityReferenceApi,\n receiptApi,\n agendaApi,\n calendarItemApi,\n classificationApi,\n timetableApi,\n groupApi,\n maintenanceTaskApi,\n dataOwnerApi,\n }\n}\n"]}
@@ -2,7 +2,7 @@ export interface StorageFacade<T> {
2
2
  /**
3
3
  * Returns the value of the provided key from the storage
4
4
  * @param key Key of the value to retrieve
5
- * @return The value associated to the provided key or null if not found.
5
+ * @return The value associated to the provided key or undefined if not found.
6
6
  */
7
7
  getItem(key: string): Promise<T | undefined>;
8
8
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"StorageFacade.js","sourceRoot":"","sources":["../../../icc-x-api/storage/StorageFacade.ts"],"names":[],"mappings":"","sourcesContent":["export interface StorageFacade<T> {\n /**\n * Returns the value of the provided key from the storage\n * @param key Key of the value to retrieve\n * @return The value associated to the provided key or null if not found.\n */\n getItem(key: string): Promise<T | undefined>\n\n /**\n * Set an item in the storage for the given key\n * @param key Key of the value to set\n * @param valueToStore\n */\n setItem(key: string, valueToStore: T): Promise<void>\n\n /**\n * Removes the item with the given key from the storage.\n * @param key The key of the item to remove.\n */\n removeItem(key: string): Promise<void>\n}\n"]}
1
+ {"version":3,"file":"StorageFacade.js","sourceRoot":"","sources":["../../../icc-x-api/storage/StorageFacade.ts"],"names":[],"mappings":"","sourcesContent":["export interface StorageFacade<T> {\n /**\n * Returns the value of the provided key from the storage\n * @param key Key of the value to retrieve\n * @return The value associated to the provided key or undefined if not found.\n */\n getItem(key: string): Promise<T | undefined>\n\n /**\n * Set an item in the storage for the given key\n * @param key Key of the value to set\n * @param valueToStore\n */\n setItem(key: string, valueToStore: T): Promise<void>\n\n /**\n * Removes the item with the given key from the storage.\n * @param key The key of the item to remove.\n */\n removeItem(key: string): Promise<void>\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icure/api",
3
- "version": "6.0.2",
3
+ "version": "6.0.4",
4
4
  "description": "Typescript version of iCure standalone API client",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",