@icure/api 8.0.0-RC.2 → 8.0.0-RC.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 (213) hide show
  1. package/icc-api/api/IccAccesslogApi.d.ts +12 -4
  2. package/icc-api/api/IccAccesslogApi.js +23 -18
  3. package/icc-api/api/IccAccesslogApi.js.map +1 -1
  4. package/icc-api/api/IccAgendaApi.d.ts +13 -4
  5. package/icc-api/api/IccAgendaApi.js +42 -19
  6. package/icc-api/api/IccAgendaApi.js.map +1 -1
  7. package/icc-api/api/IccApplicationsettingsApi.d.ts +1 -1
  8. package/icc-api/api/IccApplicationsettingsApi.js +2 -2
  9. package/icc-api/api/IccApplicationsettingsApi.js.map +1 -1
  10. package/icc-api/api/IccArticleApi.d.ts +13 -4
  11. package/icc-api/api/IccArticleApi.js +50 -26
  12. package/icc-api/api/IccArticleApi.js.map +1 -1
  13. package/icc-api/api/IccAuthApi.d.ts +1 -1
  14. package/icc-api/api/IccAuthApi.js +2 -2
  15. package/icc-api/api/IccAuthApi.js.map +1 -1
  16. package/icc-api/api/IccCalendarItemApi.d.ts +8 -4
  17. package/icc-api/api/IccCalendarItemApi.js +15 -22
  18. package/icc-api/api/IccCalendarItemApi.js.map +1 -1
  19. package/icc-api/api/IccCalendarItemTypeApi.d.ts +6 -4
  20. package/icc-api/api/IccCalendarItemTypeApi.js +60 -45
  21. package/icc-api/api/IccCalendarItemTypeApi.js.map +1 -1
  22. package/icc-api/api/IccClassificationApi.d.ts +14 -5
  23. package/icc-api/api/IccClassificationApi.js +22 -12
  24. package/icc-api/api/IccClassificationApi.js.map +1 -1
  25. package/icc-api/api/IccClassificationTemplateApi.d.ts +14 -5
  26. package/icc-api/api/IccClassificationTemplateApi.js +102 -70
  27. package/icc-api/api/IccClassificationTemplateApi.js.map +1 -1
  28. package/icc-api/api/IccCodeApi.d.ts +1 -1
  29. package/icc-api/api/IccCodeApi.js +2 -2
  30. package/icc-api/api/IccCodeApi.js.map +1 -1
  31. package/icc-api/api/IccContactApi.d.ts +11 -4
  32. package/icc-api/api/IccContactApi.js +20 -13
  33. package/icc-api/api/IccContactApi.js.map +1 -1
  34. package/icc-api/api/IccDataownerApi.d.ts +1 -1
  35. package/icc-api/api/IccDataownerApi.js +44 -27
  36. package/icc-api/api/IccDataownerApi.js.map +1 -1
  37. package/icc-api/api/IccDeviceApi.d.ts +1 -1
  38. package/icc-api/api/IccDeviceApi.js +43 -32
  39. package/icc-api/api/IccDeviceApi.js.map +1 -1
  40. package/icc-api/api/IccDoctemplateApi.d.ts +10 -8
  41. package/icc-api/api/IccDoctemplateApi.js +121 -101
  42. package/icc-api/api/IccDoctemplateApi.js.map +1 -1
  43. package/icc-api/api/IccDocumentApi.d.ts +13 -5
  44. package/icc-api/api/IccDocumentApi.js +24 -14
  45. package/icc-api/api/IccDocumentApi.js.map +1 -1
  46. package/icc-api/api/IccEntityrefApi.d.ts +1 -1
  47. package/icc-api/api/IccEntityrefApi.js +27 -16
  48. package/icc-api/api/IccEntityrefApi.js.map +1 -1
  49. package/icc-api/api/IccEntitytemplateApi.d.ts +6 -4
  50. package/icc-api/api/IccEntitytemplateApi.js +118 -97
  51. package/icc-api/api/IccEntitytemplateApi.js.map +1 -1
  52. package/icc-api/api/IccFormApi.d.ts +13 -5
  53. package/icc-api/api/IccFormApi.js +24 -18
  54. package/icc-api/api/IccFormApi.js.map +1 -1
  55. package/icc-api/api/IccFrontendmigrationApi.d.ts +1 -1
  56. package/icc-api/api/IccFrontendmigrationApi.js +19 -10
  57. package/icc-api/api/IccFrontendmigrationApi.js.map +1 -1
  58. package/icc-api/api/IccGroupApi.d.ts +16 -2
  59. package/icc-api/api/IccGroupApi.js +29 -3
  60. package/icc-api/api/IccGroupApi.js.map +1 -1
  61. package/icc-api/api/IccHcpartyApi.d.ts +25 -10
  62. package/icc-api/api/IccHcpartyApi.js +84 -53
  63. package/icc-api/api/IccHcpartyApi.js.map +1 -1
  64. package/icc-api/api/IccHelementApi.d.ts +13 -5
  65. package/icc-api/api/IccHelementApi.js +25 -21
  66. package/icc-api/api/IccHelementApi.js.map +1 -1
  67. package/icc-api/api/IccIcureApi.d.ts +1 -1
  68. package/icc-api/api/IccIcureApi.js +2 -2
  69. package/icc-api/api/IccIcureApi.js.map +1 -1
  70. package/icc-api/api/IccInsuranceApi.d.ts +3 -1
  71. package/icc-api/api/IccInsuranceApi.js +76 -47
  72. package/icc-api/api/IccInsuranceApi.js.map +1 -1
  73. package/icc-api/api/IccInvoiceApi.d.ts +1 -1
  74. package/icc-api/api/IccInvoiceApi.js +5 -11
  75. package/icc-api/api/IccInvoiceApi.js.map +1 -1
  76. package/icc-api/api/IccKeywordApi.d.ts +6 -5
  77. package/icc-api/api/IccKeywordApi.js +59 -45
  78. package/icc-api/api/IccKeywordApi.js.map +1 -1
  79. package/icc-api/api/IccMaintenanceTaskApi.d.ts +13 -4
  80. package/icc-api/api/IccMaintenanceTaskApi.js +22 -12
  81. package/icc-api/api/IccMaintenanceTaskApi.js.map +1 -1
  82. package/icc-api/api/IccMedexApi.d.ts +1 -1
  83. package/icc-api/api/IccMedexApi.js +19 -10
  84. package/icc-api/api/IccMedexApi.js.map +1 -1
  85. package/icc-api/api/IccMedicallocationApi.d.ts +6 -4
  86. package/icc-api/api/IccMedicallocationApi.js +52 -39
  87. package/icc-api/api/IccMedicallocationApi.js.map +1 -1
  88. package/icc-api/api/IccMessageApi.d.ts +9 -7
  89. package/icc-api/api/IccMessageApi.js +14 -21
  90. package/icc-api/api/IccMessageApi.js.map +1 -1
  91. package/icc-api/api/IccPatientApi.d.ts +13 -5
  92. package/icc-api/api/IccPatientApi.js +23 -13
  93. package/icc-api/api/IccPatientApi.js.map +1 -1
  94. package/icc-api/api/IccPermissionApi.d.ts +1 -1
  95. package/icc-api/api/IccPermissionApi.js +19 -10
  96. package/icc-api/api/IccPermissionApi.js.map +1 -1
  97. package/icc-api/api/IccPlaceApi.d.ts +7 -5
  98. package/icc-api/api/IccPlaceApi.js +53 -40
  99. package/icc-api/api/IccPlaceApi.js.map +1 -1
  100. package/icc-api/api/IccReceiptApi.d.ts +13 -4
  101. package/icc-api/api/IccReceiptApi.js +23 -13
  102. package/icc-api/api/IccReceiptApi.js.map +1 -1
  103. package/icc-api/api/IccReplicationApi.d.ts +1 -1
  104. package/icc-api/api/IccReplicationApi.js +3 -5
  105. package/icc-api/api/IccReplicationApi.js.map +1 -1
  106. package/icc-api/api/IccRoleApi.d.ts +16 -0
  107. package/icc-api/api/IccRoleApi.js +42 -0
  108. package/icc-api/api/IccRoleApi.js.map +1 -0
  109. package/icc-api/api/IccTarificationApi.d.ts +1 -1
  110. package/icc-api/api/IccTarificationApi.js +19 -10
  111. package/icc-api/api/IccTarificationApi.js.map +1 -1
  112. package/icc-api/api/IccTimeTableApi.d.ts +13 -4
  113. package/icc-api/api/IccTimeTableApi.js +21 -9
  114. package/icc-api/api/IccTimeTableApi.js.map +1 -1
  115. package/icc-api/api/IccTopicApi.d.ts +13 -6
  116. package/icc-api/api/IccTopicApi.js +18 -3
  117. package/icc-api/api/IccTopicApi.js.map +1 -1
  118. package/icc-api/api/IccUserApi.d.ts +31 -1
  119. package/icc-api/api/IccUserApi.js +65 -2
  120. package/icc-api/api/IccUserApi.js.map +1 -1
  121. package/icc-api/api/{IccExchangeDataApi.d.ts → internal/IccExchangeDataApi.d.ts} +4 -4
  122. package/icc-api/api/internal/IccExchangeDataApi.js +106 -0
  123. package/icc-api/api/internal/IccExchangeDataApi.js.map +1 -0
  124. package/icc-api/api/{IccExchangeDataMapApi.d.ts → internal/IccExchangeDataMapApi.d.ts} +4 -4
  125. package/icc-api/api/internal/IccExchangeDataMapApi.js +84 -0
  126. package/icc-api/api/internal/IccExchangeDataMapApi.js.map +1 -0
  127. package/icc-api/api/internal/IccRecoveryDataApi.d.ts +19 -0
  128. package/icc-api/api/internal/IccRecoveryDataApi.js +83 -0
  129. package/icc-api/api/internal/IccRecoveryDataApi.js.map +1 -0
  130. package/icc-api/api/{IccSecureDelegationKeyMapApi.d.ts → internal/IccSecureDelegationKeyMapApi.d.ts} +6 -6
  131. package/icc-api/api/{IccSecureDelegationKeyMapApi.js → internal/IccSecureDelegationKeyMapApi.js} +5 -5
  132. package/icc-api/api/internal/IccSecureDelegationKeyMapApi.js.map +1 -0
  133. package/icc-api/model/Group.d.ts +4 -0
  134. package/icc-api/model/Group.js.map +1 -1
  135. package/icc-api/model/Message.d.ts +5 -0
  136. package/icc-api/model/Message.js.map +1 -1
  137. package/icc-api/model/MessageAttachment.d.ts +10 -0
  138. package/icc-api/model/MessageAttachment.js +10 -0
  139. package/icc-api/model/MessageAttachment.js.map +1 -0
  140. package/icc-api/model/PaginatedListInsurance.d.ts +20 -0
  141. package/icc-api/model/PaginatedListInsurance.js +10 -0
  142. package/icc-api/model/PaginatedListInsurance.js.map +1 -0
  143. package/icc-api/model/Role.d.ts +11 -0
  144. package/icc-api/model/Role.js +10 -0
  145. package/icc-api/model/Role.js.map +1 -0
  146. package/icc-api/model/RoleConfiguration.d.ts +6 -0
  147. package/icc-api/model/RoleConfiguration.js +10 -0
  148. package/icc-api/model/RoleConfiguration.js.map +1 -0
  149. package/icc-api/model/RoleSourceEnum.d.ts +11 -0
  150. package/icc-api/model/RoleSourceEnum.js +16 -0
  151. package/icc-api/model/RoleSourceEnum.js.map +1 -0
  152. package/icc-api/model/User.d.ts +19 -0
  153. package/icc-api/model/User.js +6 -0
  154. package/icc-api/model/User.js.map +1 -1
  155. package/icc-api/model/UserTypeEnum.d.ts +9 -0
  156. package/icc-api/model/UserTypeEnum.js +14 -0
  157. package/icc-api/model/UserTypeEnum.js.map +1 -0
  158. package/icc-api/model/internal/ExchangeData.d.ts +20 -4
  159. package/icc-api/model/internal/ExchangeData.js +8 -2
  160. package/icc-api/model/internal/ExchangeData.js.map +1 -1
  161. package/icc-api/model/internal/RecoveryData.d.ts +47 -0
  162. package/icc-api/model/internal/RecoveryData.js +34 -0
  163. package/icc-api/model/internal/RecoveryData.js.map +1 -0
  164. package/icc-api/model/models.d.ts +6 -1
  165. package/icc-api/model/models.js +5 -0
  166. package/icc-api/model/models.js.map +1 -1
  167. package/icc-x-api/auth/JwtBridgedAuthService.d.ts +1 -0
  168. package/icc-x-api/auth/JwtBridgedAuthService.js +10 -3
  169. package/icc-x-api/auth/JwtBridgedAuthService.js.map +1 -1
  170. package/icc-x-api/crypto/BaseExchangeDataManager.d.ts +37 -25
  171. package/icc-x-api/crypto/BaseExchangeDataManager.js +123 -64
  172. package/icc-x-api/crypto/BaseExchangeDataManager.js.map +1 -1
  173. package/icc-x-api/crypto/CryptoPrimitives.d.ts +3 -0
  174. package/icc-x-api/crypto/CryptoPrimitives.js +5 -0
  175. package/icc-x-api/crypto/CryptoPrimitives.js.map +1 -1
  176. package/icc-x-api/crypto/DelegationsDeAnonymization.js +1 -1
  177. package/icc-x-api/crypto/DelegationsDeAnonymization.js.map +1 -1
  178. package/icc-x-api/crypto/ExchangeDataManager.js +14 -6
  179. package/icc-x-api/crypto/ExchangeDataManager.js.map +1 -1
  180. package/icc-x-api/crypto/ExchangeDataMapManager.d.ts +1 -1
  181. package/icc-x-api/crypto/ExchangeDataMapManager.js.map +1 -1
  182. package/icc-x-api/crypto/HMACUtils.d.ts +10 -0
  183. package/icc-x-api/crypto/HMACUtils.js +48 -0
  184. package/icc-x-api/crypto/HMACUtils.js.map +1 -0
  185. package/icc-x-api/crypto/SecureDelegationsManager.js +3 -0
  186. package/icc-x-api/crypto/SecureDelegationsManager.js.map +1 -1
  187. package/icc-x-api/crypto/UserSignatureKeysManager.d.ts +1 -1
  188. package/icc-x-api/crypto/UserSignatureKeysManager.js +2 -2
  189. package/icc-x-api/crypto/UserSignatureKeysManager.js.map +1 -1
  190. package/icc-x-api/icc-calendar-item-x-api.js.map +1 -1
  191. package/icc-x-api/icc-icure-maintenance-x-api.d.ts +1 -1
  192. package/icc-x-api/icc-icure-maintenance-x-api.js.map +1 -1
  193. package/icc-x-api/icc-maintenance-task-x-api.d.ts +5 -3
  194. package/icc-x-api/icc-maintenance-task-x-api.js +7 -1
  195. package/icc-x-api/icc-maintenance-task-x-api.js.map +1 -1
  196. package/icc-x-api/icc-recovery-x-api.d.ts +0 -0
  197. package/icc-x-api/icc-recovery-x-api.js +2 -0
  198. package/icc-x-api/icc-recovery-x-api.js.map +1 -0
  199. package/icc-x-api/index.d.ts +2 -0
  200. package/icc-x-api/index.js +7 -2
  201. package/icc-x-api/index.js.map +1 -1
  202. package/icc-x-api/storage/KeyStorageImpl.d.ts +1 -0
  203. package/icc-x-api/storage/KeyStorageImpl.js +20 -12
  204. package/icc-x-api/storage/KeyStorageImpl.js.map +1 -1
  205. package/package.json +1 -1
  206. package/icc-api/api/IccDocumentTemplateApi.d.ts +0 -106
  207. package/icc-api/api/IccDocumentTemplateApi.js +0 -223
  208. package/icc-api/api/IccDocumentTemplateApi.js.map +0 -1
  209. package/icc-api/api/IccExchangeDataApi.js +0 -85
  210. package/icc-api/api/IccExchangeDataApi.js.map +0 -1
  211. package/icc-api/api/IccExchangeDataMapApi.js +0 -65
  212. package/icc-api/api/IccExchangeDataMapApi.js.map +0 -1
  213. package/icc-api/api/IccSecureDelegationKeyMapApi.js.map +0 -1
@@ -19,28 +19,36 @@ class KeyStorageImpl {
19
19
  return yield this._storage.removeItem(key);
20
20
  });
21
21
  }
22
+ getPartialKeyPair(key) {
23
+ return __awaiter(this, void 0, void 0, function* () {
24
+ const loaded = yield this._storage.getItem(key);
25
+ if (!loaded)
26
+ return undefined;
27
+ const keyPair = JSON.parse(loaded);
28
+ const res = {};
29
+ if (keyPair.hasOwnProperty('publicKey'))
30
+ res['publicKey'] = keyPair['publicKey'];
31
+ if (keyPair.hasOwnProperty('privateKey'))
32
+ res['privateKey'] = keyPair['privateKey'];
33
+ return res;
34
+ });
35
+ }
22
36
  getKeypair(key) {
23
- var _a;
24
37
  return __awaiter(this, void 0, void 0, function* () {
25
- const keyPair = JSON.parse((_a = (yield this._storage.getItem(key))) !== null && _a !== void 0 ? _a : '{}');
26
- return keyPair.hasOwnProperty('publicKey') && keyPair.hasOwnProperty('privateKey')
27
- ? {
28
- publicKey: keyPair.publicKey,
29
- privateKey: keyPair.privateKey,
30
- }
31
- : undefined;
38
+ const partial = yield this.getPartialKeyPair(key);
39
+ if (!partial || !partial.publicKey || !partial.privateKey)
40
+ return undefined;
41
+ return { publicKey: partial.publicKey, privateKey: partial.privateKey };
32
42
  });
33
43
  }
34
44
  getPrivateKey(key) {
35
- var _a;
36
45
  return __awaiter(this, void 0, void 0, function* () {
37
- return (_a = (yield this.getKeypair(key))) === null || _a === void 0 ? void 0 : _a.privateKey;
46
+ return this.getPartialKeyPair(key).then((partial) => partial === null || partial === void 0 ? void 0 : partial.privateKey);
38
47
  });
39
48
  }
40
49
  getPublicKey(key) {
41
- var _a;
42
50
  return __awaiter(this, void 0, void 0, function* () {
43
- return (_a = (yield this.getKeypair(key))) === null || _a === void 0 ? void 0 : _a.publicKey;
51
+ return this.getPartialKeyPair(key).then((partial) => partial === null || partial === void 0 ? void 0 : partial.publicKey);
44
52
  });
45
53
  }
46
54
  storeKeyPair(key, keyPair) {
@@ -1 +1 @@
1
- {"version":3,"file":"KeyStorageImpl.js","sourceRoot":"","sources":["../../../icc-x-api/storage/KeyStorageImpl.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,MAAa,cAAc;IAGzB,YAAY,OAA8B;QACxC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;IACzB,CAAC;IAEK,aAAa,CAAC,GAAW;;YAC7B,OAAO,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;QAC5C,CAAC;KAAA;IAEK,UAAU,CAAC,GAAW;;;YAC1B,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,MAAA,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,mCAAI,IAAI,CAAC,CAAA;YACtE,OAAO,OAAO,CAAC,cAAc,CAAC,WAAW,CAAC,IAAI,OAAO,CAAC,cAAc,CAAC,YAAY,CAAC;gBAChF,CAAC,CAAC;oBACE,SAAS,EAAE,OAAO,CAAC,SAAuB;oBAC1C,UAAU,EAAE,OAAO,CAAC,UAAwB;iBAC7C;gBACH,CAAC,CAAC,SAAS,CAAA;;KACd;IAEK,aAAa,CAAC,GAAW;;;YAC7B,OAAO,MAAA,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,0CAAE,UAAU,CAAA;;KAChD;IAEK,YAAY,CAAC,GAAW;;;YAC5B,OAAO,MAAA,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,0CAAE,SAAS,CAAA;;KAC/C;IAEK,YAAY,CAAC,GAAW,EAAE,OAA0D;;YACxF,OAAO,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;QAClE,CAAC;KAAA;IAEK,cAAc,CAAC,GAAW,EAAE,SAAqB;;YACrD,OAAO,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAA;QACxE,CAAC;KAAA;IAEK,eAAe,CAAC,GAAW,EAAE,UAAsB;;YACvD,OAAO,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAA;QACzE,CAAC;KAAA;CACF;AAxCD,wCAwCC","sourcesContent":["import { StorageFacade } from './StorageFacade'\nimport { KeyStorageFacade } from './KeyStorageFacade'\n\nexport class KeyStorageImpl implements KeyStorageFacade {\n private readonly _storage: StorageFacade<string>\n\n constructor(storage: StorageFacade<string>) {\n this._storage = storage\n }\n\n async deleteKeypair(key: string): Promise<void> {\n return await this._storage.removeItem(key)\n }\n\n async getKeypair(key: string): Promise<{ publicKey: JsonWebKey; privateKey: JsonWebKey } | undefined> {\n const keyPair = JSON.parse((await this._storage.getItem(key)) ?? '{}')\n return keyPair.hasOwnProperty('publicKey') && keyPair.hasOwnProperty('privateKey')\n ? {\n publicKey: keyPair.publicKey as JsonWebKey,\n privateKey: keyPair.privateKey as JsonWebKey,\n }\n : undefined\n }\n\n async getPrivateKey(key: string): Promise<JsonWebKey | undefined> {\n return (await this.getKeypair(key))?.privateKey\n }\n\n async getPublicKey(key: string): Promise<JsonWebKey | undefined> {\n return (await this.getKeypair(key))?.publicKey\n }\n\n async storeKeyPair(key: string, keyPair: { publicKey: JsonWebKey; privateKey: JsonWebKey }): Promise<void> {\n return await this._storage.setItem(key, JSON.stringify(keyPair))\n }\n\n async storePublicKey(key: string, publicKey: JsonWebKey): Promise<void> {\n return await this._storage.setItem(key, JSON.stringify({ publicKey }))\n }\n\n async storePrivateKey(key: string, privateKey: JsonWebKey): Promise<void> {\n return await this._storage.setItem(key, JSON.stringify({ privateKey }))\n }\n}\n"]}
1
+ {"version":3,"file":"KeyStorageImpl.js","sourceRoot":"","sources":["../../../icc-x-api/storage/KeyStorageImpl.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,MAAa,cAAc;IAGzB,YAAY,OAA8B;QACxC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;IACzB,CAAC;IAEK,aAAa,CAAC,GAAW;;YAC7B,OAAO,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;QAC5C,CAAC;KAAA;IAEa,iBAAiB,CAAC,GAAW;;YACzC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;YAC/C,IAAI,CAAC,MAAM;gBAAE,OAAO,SAAS,CAAA;YAC7B,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;YAClC,MAAM,GAAG,GAAwD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O,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAA;QACxE,CAAC;KAAA;IAEK,eAAe,CAAC,GAAW,EAAE,UAAsB;;YACvD,OAAO,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAA;QACzE,CAAC;KAAA;CACF;AA9CD,wCA8CC","sourcesContent":["import { StorageFacade } from './StorageFacade'\nimport { KeyStorageFacade } from './KeyStorageFacade'\n\nexport class KeyStorageImpl implements KeyStorageFacade {\n private readonly _storage: StorageFacade<string>\n\n constructor(storage: StorageFacade<string>) {\n this._storage = storage\n }\n\n async deleteKeypair(key: string): Promise<void> {\n return await this._storage.removeItem(key)\n }\n\n private async getPartialKeyPair(key: string): Promise<{ publicKey?: JsonWebKey; privateKey?: JsonWebKey } | undefined> {\n const loaded = await this._storage.getItem(key)\n if (!loaded) return undefined\n const keyPair = JSON.parse(loaded)\n const res: { publicKey?: JsonWebKey; privateKey?: JsonWebKey } = {}\n if (keyPair.hasOwnProperty('publicKey')) res['publicKey'] = keyPair['publicKey']\n if (keyPair.hasOwnProperty('privateKey')) res['privateKey'] = keyPair['privateKey']\n return res\n }\n\n async getKeypair(key: string): Promise<{ publicKey: JsonWebKey; privateKey: JsonWebKey } | undefined> {\n const partial = await this.getPartialKeyPair(key)\n if (!partial || !partial.publicKey || !partial.privateKey) return undefined\n return { publicKey: partial.publicKey, privateKey: partial.privateKey }\n }\n\n async getPrivateKey(key: string): Promise<JsonWebKey | undefined> {\n return this.getPartialKeyPair(key).then((partial) => partial?.privateKey)\n }\n\n async getPublicKey(key: string): Promise<JsonWebKey | undefined> {\n return this.getPartialKeyPair(key).then((partial) => partial?.publicKey)\n }\n\n async storeKeyPair(key: string, keyPair: { publicKey: JsonWebKey; privateKey: JsonWebKey }): Promise<void> {\n return await this._storage.setItem(key, JSON.stringify(keyPair))\n }\n\n async storePublicKey(key: string, publicKey: JsonWebKey): Promise<void> {\n return await this._storage.setItem(key, JSON.stringify({ publicKey }))\n }\n\n async storePrivateKey(key: string, privateKey: JsonWebKey): Promise<void> {\n return await this._storage.setItem(key, JSON.stringify({ privateKey }))\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icure/api",
3
- "version": "8.0.0-RC.2",
3
+ "version": "8.0.0-RC.4",
4
4
  "description": "Typescript version of iCure standalone API client",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -1,106 +0,0 @@
1
- /**
2
- * iCure Data Stack API Documentation
3
- * The iCure Data Stack Application API is the native interface to iCure.
4
- *
5
- * OpenAPI spec version: v0
6
- *
7
- *
8
- * NOTE: This class is auto generated by the swagger code generator program.
9
- * https://github.com/swagger-api/swagger-codegen.git
10
- * Do not edit the class manually.
11
- */
12
- import { XHR } from './XHR';
13
- import { DocIdentifier } from '../model/DocIdentifier';
14
- import { DocumentTemplate } from '../model/DocumentTemplate';
15
- import { ListOfIds } from '../model/ListOfIds';
16
- import { AuthenticationProvider } from '../../icc-x-api/auth/AuthenticationProvider';
17
- export declare class IccDocumentTemplateApi {
18
- host: string;
19
- headers: Array<XHR.Header>;
20
- authenticationProvider: AuthenticationProvider;
21
- fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>;
22
- constructor(host: string, headers: any, authenticationProvider?: AuthenticationProvider, fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>);
23
- setHeaders(h: Array<XHR.Header>): void;
24
- handleError(e: XHR.XHRError): never;
25
- /**
26
- * Returns an instance of created document template.
27
- * @summary Create a document template with the current user
28
- * @param body
29
- */
30
- createDocumentTemplate(body?: DocumentTemplate): Promise<DocumentTemplate>;
31
- /**
32
- *
33
- * @summary Deletes document templates
34
- * @param body
35
- */
36
- deleteDocumentTemplates(body?: ListOfIds): Promise<Array<DocIdentifier>>;
37
- /**
38
- *
39
- * @summary Download a the document template attachment
40
- * @param documentTemplateId
41
- * @param attachmentId
42
- */
43
- getAttachmentText(documentTemplateId: string, attachmentId: string): Promise<ArrayBuffer>;
44
- /**
45
- *
46
- * @summary Gets a document template
47
- * @param documentTemplateId
48
- */
49
- getDocumentTemplate(documentTemplateId: string): Promise<DocumentTemplate>;
50
- /**
51
- *
52
- * @summary Download a the document template attachment
53
- * @param documentTemplateId
54
- * @param attachmentId
55
- */
56
- getDocumentTemplateAttachment(documentTemplateId: string, attachmentId: string): Promise<ArrayBuffer>;
57
- /**
58
- *
59
- * @summary Gets all document templates for all users
60
- */
61
- listAllDocumentTemplates(): Promise<Array<DocumentTemplate>>;
62
- /**
63
- *
64
- * @summary Gets all document templates for current user
65
- */
66
- listDocumentTemplates(): Promise<Array<DocumentTemplate>>;
67
- /**
68
- *
69
- * @summary Gets all document templates by Type
70
- * @param documentTypeCode
71
- */
72
- listDocumentTemplatesByDocumentType(documentTypeCode: string): Promise<Array<DocumentTemplate>>;
73
- /**
74
- *
75
- * @summary Gets all document templates by Type For currentUser
76
- * @param documentTypeCode
77
- */
78
- listDocumentTemplatesByDocumentTypeForCurrentUser(documentTypeCode: string): Promise<Array<DocumentTemplate>>;
79
- /**
80
- *
81
- * @summary Gets all document templates
82
- * @param specialityCode
83
- */
84
- listDocumentTemplatesBySpeciality(specialityCode: string): Promise<Array<DocumentTemplate>>;
85
- /**
86
- * Returns an instance of created document template.
87
- * @summary Modify a document template with the current user
88
- * @param body
89
- * @param documentTemplateId
90
- */
91
- modifyDocumentTemplate(documentTemplateId: string, body?: DocumentTemplate): Promise<DocumentTemplate>;
92
- /**
93
- *
94
- * @summary Creates a document's attachment
95
- * @param body
96
- * @param documentTemplateId
97
- */
98
- setDocumentTemplateAttachment(documentTemplateId: string, body?: ArrayBuffer): Promise<DocumentTemplate>;
99
- /**
100
- *
101
- * @summary Creates a document's attachment
102
- * @param body
103
- * @param documentTemplateId
104
- */
105
- setDocumentTemplateAttachmentJson(documentTemplateId: string, body?: string): Promise<DocumentTemplate>;
106
- }
@@ -1,223 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IccDocumentTemplateApi = void 0;
4
- /**
5
- * iCure Data Stack API Documentation
6
- * The iCure Data Stack Application API is the native interface to iCure.
7
- *
8
- * OpenAPI spec version: v0
9
- *
10
- *
11
- * NOTE: This class is auto generated by the swagger code generator program.
12
- * https://github.com/swagger-api/swagger-codegen.git
13
- * Do not edit the class manually.
14
- */
15
- const XHR_1 = require("./XHR");
16
- const DocIdentifier_1 = require("../model/DocIdentifier");
17
- const DocumentTemplate_1 = require("../model/DocumentTemplate");
18
- const AuthenticationProvider_1 = require("../../icc-x-api/auth/AuthenticationProvider");
19
- const IccRestApiPath_1 = require("./IccRestApiPath");
20
- class IccDocumentTemplateApi {
21
- constructor(host, headers, authenticationProvider, fetchImpl) {
22
- this.host = (0, IccRestApiPath_1.iccRestApiPath)(host);
23
- this.headers = Object.keys(headers).map((k) => new XHR_1.XHR.Header(k, headers[k]));
24
- this.authenticationProvider = !!authenticationProvider ? authenticationProvider : new AuthenticationProvider_1.NoAuthenticationProvider();
25
- this.fetchImpl = fetchImpl;
26
- }
27
- setHeaders(h) {
28
- this.headers = h;
29
- }
30
- handleError(e) {
31
- throw e;
32
- }
33
- /**
34
- * Returns an instance of created document template.
35
- * @summary Create a document template with the current user
36
- * @param body
37
- */
38
- createDocumentTemplate(body) {
39
- let _body = null;
40
- _body = body;
41
- const _url = this.host + `/rest/v2/doctemplate` + '?ts=' + new Date().getTime();
42
- let headers = this.headers;
43
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
44
- return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
45
- .then((doc) => new DocumentTemplate_1.DocumentTemplate(doc.body))
46
- .catch((err) => this.handleError(err));
47
- }
48
- /**
49
- *
50
- * @summary Deletes document templates
51
- * @param body
52
- */
53
- deleteDocumentTemplates(body) {
54
- let _body = null;
55
- _body = body;
56
- const _url = this.host + `/rest/v2/doctemplate/delete/batch` + '?ts=' + new Date().getTime();
57
- let headers = this.headers;
58
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
59
- return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
60
- .then((doc) => doc.body.map((it) => new DocIdentifier_1.DocIdentifier(it)))
61
- .catch((err) => this.handleError(err));
62
- }
63
- /**
64
- *
65
- * @summary Download a the document template attachment
66
- * @param documentTemplateId
67
- * @param attachmentId
68
- */
69
- getAttachmentText(documentTemplateId, attachmentId) {
70
- const _body = null;
71
- const _url = this.host +
72
- `/rest/v2/doctemplate/${encodeURIComponent(String(documentTemplateId))}/attachmentText/${encodeURIComponent(String(attachmentId))}` +
73
- '?ts=' +
74
- new Date().getTime();
75
- const headers = this.headers;
76
- return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
77
- .then((doc) => doc.body)
78
- .catch((err) => this.handleError(err));
79
- }
80
- /**
81
- *
82
- * @summary Gets a document template
83
- * @param documentTemplateId
84
- */
85
- getDocumentTemplate(documentTemplateId) {
86
- const _body = null;
87
- const _url = this.host + `/rest/v2/doctemplate/${encodeURIComponent(String(documentTemplateId))}` + '?ts=' + new Date().getTime();
88
- const headers = this.headers;
89
- return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
90
- .then((doc) => new DocumentTemplate_1.DocumentTemplate(doc.body))
91
- .catch((err) => this.handleError(err));
92
- }
93
- /**
94
- *
95
- * @summary Download a the document template attachment
96
- * @param documentTemplateId
97
- * @param attachmentId
98
- */
99
- getDocumentTemplateAttachment(documentTemplateId, attachmentId) {
100
- const _body = null;
101
- const _url = this.host +
102
- `/rest/v2/doctemplate/${encodeURIComponent(String(documentTemplateId))}/attachment/${encodeURIComponent(String(attachmentId))}` +
103
- '?ts=' +
104
- new Date().getTime();
105
- const headers = this.headers;
106
- return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
107
- .then((doc) => doc.body)
108
- .catch((err) => this.handleError(err));
109
- }
110
- /**
111
- *
112
- * @summary Gets all document templates for all users
113
- */
114
- listAllDocumentTemplates() {
115
- const _body = null;
116
- const _url = this.host + `/rest/v2/doctemplate/find/all` + '?ts=' + new Date().getTime();
117
- const headers = this.headers;
118
- return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
119
- .then((doc) => doc.body.map((it) => new DocumentTemplate_1.DocumentTemplate(it)))
120
- .catch((err) => this.handleError(err));
121
- }
122
- /**
123
- *
124
- * @summary Gets all document templates for current user
125
- */
126
- listDocumentTemplates() {
127
- const _body = null;
128
- const _url = this.host + `/rest/v2/doctemplate` + '?ts=' + new Date().getTime();
129
- const headers = this.headers;
130
- return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
131
- .then((doc) => doc.body.map((it) => new DocumentTemplate_1.DocumentTemplate(it)))
132
- .catch((err) => this.handleError(err));
133
- }
134
- /**
135
- *
136
- * @summary Gets all document templates by Type
137
- * @param documentTypeCode
138
- */
139
- listDocumentTemplatesByDocumentType(documentTypeCode) {
140
- const _body = null;
141
- const _url = this.host + `/rest/v2/doctemplate/byDocumentType/${encodeURIComponent(String(documentTypeCode))}` + '?ts=' + new Date().getTime();
142
- const headers = this.headers;
143
- return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
144
- .then((doc) => doc.body.map((it) => new DocumentTemplate_1.DocumentTemplate(it)))
145
- .catch((err) => this.handleError(err));
146
- }
147
- /**
148
- *
149
- * @summary Gets all document templates by Type For currentUser
150
- * @param documentTypeCode
151
- */
152
- listDocumentTemplatesByDocumentTypeForCurrentUser(documentTypeCode) {
153
- const _body = null;
154
- const _url = this.host + `/rest/v2/doctemplate/byDocumentTypeForCurrentUser/${encodeURIComponent(String(documentTypeCode))}` + '?ts=' + new Date().getTime();
155
- const headers = this.headers;
156
- return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
157
- .then((doc) => doc.body.map((it) => new DocumentTemplate_1.DocumentTemplate(it)))
158
- .catch((err) => this.handleError(err));
159
- }
160
- /**
161
- *
162
- * @summary Gets all document templates
163
- * @param specialityCode
164
- */
165
- listDocumentTemplatesBySpeciality(specialityCode) {
166
- const _body = null;
167
- const _url = this.host + `/rest/v2/doctemplate/bySpecialty/${encodeURIComponent(String(specialityCode))}` + '?ts=' + new Date().getTime();
168
- const headers = this.headers;
169
- return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
170
- .then((doc) => doc.body.map((it) => new DocumentTemplate_1.DocumentTemplate(it)))
171
- .catch((err) => this.handleError(err));
172
- }
173
- /**
174
- * Returns an instance of created document template.
175
- * @summary Modify a document template with the current user
176
- * @param body
177
- * @param documentTemplateId
178
- */
179
- modifyDocumentTemplate(documentTemplateId, body) {
180
- let _body = null;
181
- _body = body;
182
- const _url = this.host + `/rest/v2/doctemplate/${encodeURIComponent(String(documentTemplateId))}` + '?ts=' + new Date().getTime();
183
- let headers = this.headers;
184
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
185
- return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
186
- .then((doc) => new DocumentTemplate_1.DocumentTemplate(doc.body))
187
- .catch((err) => this.handleError(err));
188
- }
189
- /**
190
- *
191
- * @summary Creates a document's attachment
192
- * @param body
193
- * @param documentTemplateId
194
- */
195
- setDocumentTemplateAttachment(documentTemplateId, body) {
196
- let _body = null;
197
- _body = body;
198
- const _url = this.host + `/rest/v2/doctemplate/${encodeURIComponent(String(documentTemplateId))}/attachment` + '?ts=' + new Date().getTime();
199
- let headers = this.headers;
200
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/octet-stream'));
201
- return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
202
- .then((doc) => new DocumentTemplate_1.DocumentTemplate(doc.body))
203
- .catch((err) => this.handleError(err));
204
- }
205
- /**
206
- *
207
- * @summary Creates a document's attachment
208
- * @param body
209
- * @param documentTemplateId
210
- */
211
- setDocumentTemplateAttachmentJson(documentTemplateId, body) {
212
- let _body = null;
213
- _body = body;
214
- const _url = this.host + `/rest/v2/doctemplate/${encodeURIComponent(String(documentTemplateId))}/attachmentJson` + '?ts=' + new Date().getTime();
215
- let headers = this.headers;
216
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/octet-stream'));
217
- return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
218
- .then((doc) => new DocumentTemplate_1.DocumentTemplate(doc.body))
219
- .catch((err) => this.handleError(err));
220
- }
221
- }
222
- exports.IccDocumentTemplateApi = IccDocumentTemplateApi;
223
- //# sourceMappingURL=IccDocumentTemplateApi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IccDocumentTemplateApi.js","sourceRoot":"","sources":["../../../icc-api/api/IccDocumentTemplateApi.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;GAUG;AACH,+BAA2B;AAC3B,0DAAsD;AACtD,gEAA4D;AAE5D,wFAA8G;AAC9G,qDAAiD;AAEjD,MAAa,sBAAsB;IAMjC,YACE,IAAY,EACZ,OAAY,EACZ,sBAA+C,EAC/C,SAAyE;QAEzE,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A;QAChB,KAAK,GAAG,IAAI,CAAA;QAEZ,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,wBAAwB,kBAAkB,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,iBAAiB,GAAG,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAA;QAChJ,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAC1B,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,cAAc,CAAC,CAAC,MAAM,CAAC,IAAI,SAAG,CAAC,MAAM,CAAC,cAAc,EAAE,0BAA0B,CAAC,CAAC,CAAA;QAC/H,OAAO,SAAG,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,sBAAsB,CAAC,cAAc,EAAE,CAAC;aACzH,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,mCAAgB,CAAC,GAAG,CAAC,IAAY,CAAC,CAAC;aACrD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAA;IAC1C,CAAC;CACF;AAlPD,wDAkPC","sourcesContent":["/**\n * iCure Data Stack API Documentation\n * The iCure Data Stack Application API is the native interface to iCure.\n *\n * OpenAPI spec version: v0\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 { XHR } from './XHR'\nimport { DocIdentifier } from '../model/DocIdentifier'\nimport { DocumentTemplate } from '../model/DocumentTemplate'\nimport { ListOfIds } from '../model/ListOfIds'\nimport { AuthenticationProvider, NoAuthenticationProvider } from '../../icc-x-api/auth/AuthenticationProvider'\nimport { iccRestApiPath } from './IccRestApiPath'\n\nexport class IccDocumentTemplateApi {\n host: string\n headers: Array<XHR.Header>\n authenticationProvider: AuthenticationProvider\n fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>\n\n constructor(\n host: string,\n headers: any,\n authenticationProvider?: AuthenticationProvider,\n fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>\n ) {\n this.host = iccRestApiPath(host)\n this.headers = Object.keys(headers).map((k) => new XHR.Header(k, headers[k]))\n this.authenticationProvider = !!authenticationProvider ? authenticationProvider : new NoAuthenticationProvider()\n this.fetchImpl = fetchImpl\n }\n\n setHeaders(h: Array<XHR.Header>) {\n this.headers = h\n }\n\n handleError(e: XHR.XHRError): never {\n throw e\n }\n\n /**\n * Returns an instance of created document template.\n * @summary Create a document template with the current user\n * @param body\n */\n createDocumentTemplate(body?: DocumentTemplate): Promise<DocumentTemplate> {\n let _body = null\n _body = body\n\n const _url = this.host + `/rest/v2/doctemplate` + '?ts=' + new Date().getTime()\n let headers = this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new DocumentTemplate(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Deletes document templates\n * @param body\n */\n deleteDocumentTemplates(body?: ListOfIds): Promise<Array<DocIdentifier>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/rest/v2/doctemplate/delete/batch` + '?ts=' + new Date().getTime()\n let headers = this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new DocIdentifier(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Download a the document template attachment\n * @param documentTemplateId\n * @param attachmentId\n */\n getAttachmentText(documentTemplateId: string, attachmentId: string): Promise<ArrayBuffer> {\n const _body = null\n\n const _url =\n this.host +\n `/rest/v2/doctemplate/${encodeURIComponent(String(documentTemplateId))}/attachmentText/${encodeURIComponent(String(attachmentId))}` +\n '?ts=' +\n new Date().getTime()\n const headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => doc.body)\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Gets a document template\n * @param documentTemplateId\n */\n getDocumentTemplate(documentTemplateId: string): Promise<DocumentTemplate> {\n const _body = null\n\n const _url = this.host + `/rest/v2/doctemplate/${encodeURIComponent(String(documentTemplateId))}` + '?ts=' + new Date().getTime()\n const headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new DocumentTemplate(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Download a the document template attachment\n * @param documentTemplateId\n * @param attachmentId\n */\n getDocumentTemplateAttachment(documentTemplateId: string, attachmentId: string): Promise<ArrayBuffer> {\n const _body = null\n\n const _url =\n this.host +\n `/rest/v2/doctemplate/${encodeURIComponent(String(documentTemplateId))}/attachment/${encodeURIComponent(String(attachmentId))}` +\n '?ts=' +\n new Date().getTime()\n const headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => doc.body)\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Gets all document templates for all users\n */\n listAllDocumentTemplates(): Promise<Array<DocumentTemplate>> {\n const _body = null\n\n const _url = this.host + `/rest/v2/doctemplate/find/all` + '?ts=' + new Date().getTime()\n const headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new DocumentTemplate(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Gets all document templates for current user\n */\n listDocumentTemplates(): Promise<Array<DocumentTemplate>> {\n const _body = null\n\n const _url = this.host + `/rest/v2/doctemplate` + '?ts=' + new Date().getTime()\n const headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new DocumentTemplate(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Gets all document templates by Type\n * @param documentTypeCode\n */\n listDocumentTemplatesByDocumentType(documentTypeCode: string): Promise<Array<DocumentTemplate>> {\n const _body = null\n\n const _url = this.host + `/rest/v2/doctemplate/byDocumentType/${encodeURIComponent(String(documentTypeCode))}` + '?ts=' + new Date().getTime()\n const headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new DocumentTemplate(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Gets all document templates by Type For currentUser\n * @param documentTypeCode\n */\n listDocumentTemplatesByDocumentTypeForCurrentUser(documentTypeCode: string): Promise<Array<DocumentTemplate>> {\n const _body = null\n\n const _url =\n this.host + `/rest/v2/doctemplate/byDocumentTypeForCurrentUser/${encodeURIComponent(String(documentTypeCode))}` + '?ts=' + new Date().getTime()\n const headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new DocumentTemplate(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Gets all document templates\n * @param specialityCode\n */\n listDocumentTemplatesBySpeciality(specialityCode: string): Promise<Array<DocumentTemplate>> {\n const _body = null\n\n const _url = this.host + `/rest/v2/doctemplate/bySpecialty/${encodeURIComponent(String(specialityCode))}` + '?ts=' + new Date().getTime()\n const headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new DocumentTemplate(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns an instance of created document template.\n * @summary Modify a document template with the current user\n * @param body\n * @param documentTemplateId\n */\n modifyDocumentTemplate(documentTemplateId: string, body?: DocumentTemplate): Promise<DocumentTemplate> {\n let _body = null\n _body = body\n\n const _url = this.host + `/rest/v2/doctemplate/${encodeURIComponent(String(documentTemplateId))}` + '?ts=' + new Date().getTime()\n let headers = this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new DocumentTemplate(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Creates a document's attachment\n * @param body\n * @param documentTemplateId\n */\n setDocumentTemplateAttachment(documentTemplateId: string, body?: ArrayBuffer): Promise<DocumentTemplate> {\n let _body = null\n _body = body\n\n const _url = this.host + `/rest/v2/doctemplate/${encodeURIComponent(String(documentTemplateId))}/attachment` + '?ts=' + new Date().getTime()\n let headers = this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/octet-stream'))\n return XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new DocumentTemplate(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Creates a document's attachment\n * @param body\n * @param documentTemplateId\n */\n setDocumentTemplateAttachmentJson(documentTemplateId: string, body?: string): Promise<DocumentTemplate> {\n let _body = null\n _body = body\n\n const _url = this.host + `/rest/v2/doctemplate/${encodeURIComponent(String(documentTemplateId))}/attachmentJson` + '?ts=' + new Date().getTime()\n let headers = this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/octet-stream'))\n return XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new DocumentTemplate(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n}\n"]}
@@ -1,85 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IccExchangeDataApi = void 0;
4
- const XHR_1 = require("./XHR");
5
- const AuthenticationProvider_1 = require("../../icc-x-api/auth/AuthenticationProvider");
6
- const ExchangeData_1 = require("../model/internal/ExchangeData");
7
- const PaginatedListExchangeData_1 = require("../model/PaginatedListExchangeData");
8
- const IccRestApiPath_1 = require("./IccRestApiPath");
9
- class IccExchangeDataApi {
10
- constructor(host, headers, authenticationProvider, fetchImpl) {
11
- this.host = (0, IccRestApiPath_1.iccRestApiPath)(host);
12
- this.headers = Object.keys(headers).map((k) => new XHR_1.XHR.Header(k, headers[k]));
13
- this.authenticationProvider = !!authenticationProvider ? authenticationProvider : new AuthenticationProvider_1.NoAuthenticationProvider();
14
- this.fetchImpl = fetchImpl;
15
- }
16
- setHeaders(h) {
17
- this.headers = h;
18
- }
19
- handleError(e) {
20
- throw e;
21
- }
22
- createExchangeData(body) {
23
- const _url = this.host + `/exchangedata` + '?ts=' + new Date().getTime();
24
- let headers = this.headers;
25
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
26
- return XHR_1.XHR.sendCommand('POST', _url, headers, body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
27
- .then((doc) => new ExchangeData_1.ExchangeData(doc.body))
28
- .catch((err) => this.handleError(err));
29
- }
30
- modifyExchangeData(body) {
31
- const _url = this.host + `/exchangedata` + '?ts=' + new Date().getTime();
32
- let headers = this.headers;
33
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
34
- return XHR_1.XHR.sendCommand('PUT', _url, headers, body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
35
- .then((doc) => new ExchangeData_1.ExchangeData(doc.body))
36
- .catch((err) => this.handleError(err));
37
- }
38
- getExchangeDataById(exchangeDataId) {
39
- const _url = this.host + `/exchangedata/${encodeURIComponent(String(exchangeDataId))}` + '?ts=' + new Date().getTime();
40
- let headers = this.headers;
41
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
42
- return XHR_1.XHR.sendCommand('GET', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
43
- .then((doc) => new ExchangeData_1.ExchangeData(doc.body))
44
- .catch((err) => this.handleError(err));
45
- }
46
- getExchangeDataByDelegatorDelegate(delegatorId, delegateId) {
47
- const _url = this.host +
48
- `/exchangedata/byDelegatorDelegate/${encodeURIComponent(String(delegatorId))}/${encodeURIComponent(String(delegateId))}` +
49
- '?ts=' +
50
- new Date().getTime();
51
- let headers = this.headers;
52
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
53
- return XHR_1.XHR.sendCommand('GET', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
54
- .then((doc) => doc.body.map((it) => new ExchangeData_1.ExchangeData(it)))
55
- .catch((err) => this.handleError(err));
56
- }
57
- getExchangeDataByParticipant(dataOwnerId, startDocumentId, limit) {
58
- const _url = this.host +
59
- `/exchangedata/byParticipant/${encodeURIComponent(String(dataOwnerId))}` +
60
- '?ts=' +
61
- new Date().getTime() +
62
- (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
63
- (limit ? '&limit=' + encodeURIComponent(String(limit)) : '');
64
- let headers = this.headers;
65
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
66
- return XHR_1.XHR.sendCommand('GET', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
67
- .then((doc) => new PaginatedListExchangeData_1.PaginatedListExchangeData(doc.body))
68
- .catch((err) => this.handleError(err));
69
- }
70
- getExchangeDataParticipantCounterparts(dataOwnerId, counterpartTypes) {
71
- const _url = this.host +
72
- `/exchangedata/byParticipant/${encodeURIComponent(String(dataOwnerId))}/counterparts` +
73
- '?ts=' +
74
- new Date().getTime() +
75
- '&counterpartsTypes=' +
76
- encodeURIComponent(String(counterpartTypes));
77
- let headers = this.headers;
78
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
79
- return XHR_1.XHR.sendCommand('GET', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
80
- .then((doc) => doc.body.map((it) => JSON.parse(JSON.stringify(it))))
81
- .catch((err) => this.handleError(err));
82
- }
83
- }
84
- exports.IccExchangeDataApi = IccExchangeDataApi;
85
- //# sourceMappingURL=IccExchangeDataApi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IccExchangeDataApi.js","sourceRoot":"","sources":["../../../icc-api/api/IccExchangeDataApi.ts"],"names":[],"mappings":";;;AAAA,+BAA2B;AAC3B,wFAA8G;AAC9G,iEAA6D;AAC7D,kFAA8E;AAC9E,qDAAiD;AAEjD,MAAa,kBAAkB;IAM7B,YACE,IAAY,EACZ,OAAY,EACZ,sBAA+C,EAC/C,SAAyE;QAEzE,IAAI,CAAC,IAAI,GAAG,IAAA,+BAAc,EAAC,IAAI,CAAC,CAAA;QAChC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,SAAG,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAC7E,IAAI,CAAC,sBAAsB,GAAG,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,IAAI,iDAAwB,EAAE,CAAA;QAChH,IAAI,CAAC,SAAS,GA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c,CAAC,CAAC,MAAM,CAAC,IAAI,SAAG,CAAC,MAAM,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC,CAAA;QACvH,OAAO,SAAG,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,sBAAsB,CAAC,cAAc,EAAE,CAAC;aACxH,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAE,GAAG,CAAC,IAAoB,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;aACpF,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAA;IAC1C,CAAC;CACF;AA/FD,gDA+FC","sourcesContent":["import { XHR } from './XHR'\nimport { AuthenticationProvider, NoAuthenticationProvider } from '../../icc-x-api/auth/AuthenticationProvider'\nimport { ExchangeData } from '../model/internal/ExchangeData'\nimport { PaginatedListExchangeData } from '../model/PaginatedListExchangeData'\nimport { iccRestApiPath } from './IccRestApiPath'\n\nexport class IccExchangeDataApi {\n host: string\n headers: Array<XHR.Header>\n authenticationProvider: AuthenticationProvider\n fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>\n\n constructor(\n host: string,\n headers: any,\n authenticationProvider?: AuthenticationProvider,\n fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>\n ) {\n this.host = iccRestApiPath(host)\n this.headers = Object.keys(headers).map((k) => new XHR.Header(k, headers[k]))\n this.authenticationProvider = !!authenticationProvider ? authenticationProvider : new NoAuthenticationProvider()\n this.fetchImpl = fetchImpl\n }\n\n setHeaders(h: Array<XHR.Header>) {\n this.headers = h\n }\n\n handleError(e: XHR.XHRError): never {\n throw e\n }\n\n createExchangeData(body?: ExchangeData): Promise<ExchangeData> {\n const _url = this.host + `/exchangedata` + '?ts=' + new Date().getTime()\n let headers = this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new ExchangeData(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n modifyExchangeData(body?: ExchangeData): Promise<ExchangeData> {\n const _url = this.host + `/exchangedata` + '?ts=' + new Date().getTime()\n let headers = this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('PUT', _url, headers, body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new ExchangeData(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n getExchangeDataById(exchangeDataId: string): Promise<ExchangeData> {\n const _url = this.host + `/exchangedata/${encodeURIComponent(String(exchangeDataId))}` + '?ts=' + new Date().getTime()\n let headers = this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('GET', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new ExchangeData(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n getExchangeDataByDelegatorDelegate(delegatorId: string, delegateId: string): Promise<ExchangeData[]> {\n const _url =\n this.host +\n `/exchangedata/byDelegatorDelegate/${encodeURIComponent(String(delegatorId))}/${encodeURIComponent(String(delegateId))}` +\n '?ts=' +\n new Date().getTime()\n let headers = this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('GET', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new ExchangeData(it)))\n .catch((err) => this.handleError(err))\n }\n\n getExchangeDataByParticipant(dataOwnerId: string, startDocumentId?: string, limit?: number): Promise<PaginatedListExchangeData> {\n const _url =\n this.host +\n `/exchangedata/byParticipant/${encodeURIComponent(String(dataOwnerId))}` +\n '?ts=' +\n new Date().getTime() +\n (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +\n (limit ? '&limit=' + encodeURIComponent(String(limit)) : '')\n let headers = this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('GET', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new PaginatedListExchangeData(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n getExchangeDataParticipantCounterparts(dataOwnerId: string, counterpartTypes: string): Promise<string[]> {\n const _url =\n this.host +\n `/exchangedata/byParticipant/${encodeURIComponent(String(dataOwnerId))}/counterparts` +\n '?ts=' +\n new Date().getTime() +\n '&counterpartsTypes=' +\n encodeURIComponent(String(counterpartTypes))\n let headers = this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('GET', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => JSON.parse(JSON.stringify(it))))\n .catch((err) => this.handleError(err))\n }\n}\n"]}
@@ -1,65 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IccExchangeDataMapApi = void 0;
4
- const XHR_1 = require("./XHR");
5
- const AuthenticationProvider_1 = require("../../icc-x-api/auth/AuthenticationProvider");
6
- const IccRestApiPath_1 = require("./IccRestApiPath");
7
- const ExchangeDataMap_1 = require("../model/internal/ExchangeDataMap");
8
- const ListOfIds_1 = require("../model/ListOfIds");
9
- class IccExchangeDataMapApi {
10
- constructor(host, headers, authenticationProvider, fetchImpl) {
11
- this.host = (0, IccRestApiPath_1.iccRestApiPath)(host);
12
- this.headers = Object.keys(headers).map((k) => new XHR_1.XHR.Header(k, headers[k]));
13
- this.authenticationProvider = !!authenticationProvider ? authenticationProvider : new AuthenticationProvider_1.NoAuthenticationProvider();
14
- this.fetchImpl = fetchImpl;
15
- }
16
- setHeaders(h) {
17
- this.headers = h;
18
- }
19
- handleError(e) {
20
- throw e;
21
- }
22
- getExchangeDataMapById(exchangeDataMapId) {
23
- const _url = this.host + `/exchangedatamap/${encodeURIComponent(String(exchangeDataMapId))}` + '?ts=' + new Date().getTime();
24
- let headers = this.headers;
25
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
26
- return XHR_1.XHR.sendCommand('GET', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
27
- .then((doc) => new ExchangeDataMap_1.ExchangeDataMap(doc.body))
28
- .catch((err) => this.handleError(err));
29
- }
30
- getExchangeDataMapByBatch(ids) {
31
- const _url = this.host + `/exchangedatamap/batch` + '?ts=' + new Date().getTime();
32
- const body = new ListOfIds_1.ListOfIds({ ids });
33
- let headers = this.headers;
34
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
35
- return XHR_1.XHR.sendCommand('POST', _url, headers, body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
36
- .then((doc) => doc.body)
37
- .catch((err) => this.handleError(err));
38
- }
39
- createExchangeDataMap(body) {
40
- const _url = this.host + `/exchangedatamap` + '?ts=' + new Date().getTime();
41
- let headers = this.headers;
42
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
43
- return XHR_1.XHR.sendCommand('POST', _url, headers, body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
44
- .then((doc) => new ExchangeDataMap_1.ExchangeDataMap(doc.body))
45
- .catch((err) => this.handleError(err));
46
- }
47
- createExchangeDataMapBatch(body) {
48
- const _url = this.host + `/exchangedatamap/batch` + '?ts=' + new Date().getTime();
49
- let headers = this.headers;
50
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
51
- return XHR_1.XHR.sendCommand('PUT', _url, headers, body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
52
- .then((doc) => doc.body)
53
- .catch((err) => this.handleError(err));
54
- }
55
- modifyExchangeDataMapForKey(accessControlKey, body) {
56
- const _url = this.host + `/exchangedatamap/forKey/${encodeURIComponent(String(accessControlKey))}` + '?ts=' + new Date().getTime();
57
- let headers = this.headers;
58
- headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
59
- return XHR_1.XHR.sendCommand('PUT', _url, headers, body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
60
- .then((doc) => new ExchangeDataMap_1.ExchangeDataMap(doc.body))
61
- .catch((err) => this.handleError(err));
62
- }
63
- }
64
- exports.IccExchangeDataMapApi = IccExchangeDataMapApi;
65
- //# sourceMappingURL=IccExchangeDataMapApi.js.map