@icure/api 5.3.10 → 5.3.12

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.
@@ -19,47 +19,6 @@ const binary_utils_1 = require("./utils/binary-utils");
19
19
  const utils_1 = require("./utils");
20
20
  const error_reporting_1 = require("./utils/error-reporting");
21
21
  class IccCryptoXApi {
22
- constructor(host, headers, hcpartyBaseApi, //Init with a hcparty x api for better performances
23
- patientBaseApi, deviceBaseApi, crypto = typeof window !== 'undefined' ? window.crypto : typeof self !== 'undefined' ? self.crypto : {}, storage, keyStorage) {
24
- this.hcPartyKeysCache = {};
25
- //[delegateId][delegatorId] = delegateEncryptedHcPartyKey
26
- //for each delegate, it stores the list of delegators and the corresponding delegateEncryptedHcPartyKey (shared HcPartyKey, from delegator to delegate, encrypted with the RSA key of the delegate)
27
- this.hcPartyKeysRequestsCache = {};
28
- this.cacheLastDeletionTimestamp = undefined;
29
- this.dataOwnerCache = {};
30
- this.keychainLocalStoreIdPrefix = 'org.taktik.icure.ehealth.keychain.';
31
- this.keychainValidityDateLocalStoreIdPrefix = 'org.taktik.icure.ehealth.keychain-date.';
32
- this.hcpPreferenceKeyEhealthCert = 'eHealthCRTCrypt';
33
- this.hcpPreferenceKeyEhealthCertDate = 'eHealthCRTDate';
34
- this.rsaLocalStoreIdPrefix = 'org.taktik.icure.rsa.';
35
- /**
36
- * @internal may be changed without notice
37
- */
38
- this.rsaKeyPairs = {};
39
- /**
40
- * Specifies if the error reporting is enabled
41
- */
42
- this.enableErrorReporting = true;
43
- /**
44
- * Allows to specify the behaviour for saving the error report
45
- */
46
- this.saveErrorReportCallback = (collectedData) => __awaiter(this, void 0, void 0, function* () {
47
- const entryPrefix = `icure.errorreports.${new Date() / 1}.${this.randomUuid()}.`;
48
- console.warn('Storage entry prefix: ' + entryPrefix);
49
- this.storage.setItem(entryPrefix + 'full', JSON.stringify(collectedData.fullData));
50
- this.storage.setItem(entryPrefix + 'minimal', JSON.stringify(collectedData.minimalData));
51
- });
52
- this.hcpartyBaseApi = hcpartyBaseApi;
53
- this.patientBaseApi = patientBaseApi;
54
- this.deviceBaseApi = deviceBaseApi;
55
- this._crypto = crypto;
56
- this.generateKeyConcurrencyMap = {};
57
- this._AES = new AES_1.AESUtils(crypto);
58
- this._RSA = new RSA_1.RSAUtils(crypto);
59
- this._shamir = new shamir_1.ShamirClass(crypto);
60
- this._storage = storage;
61
- this._keyStorage = keyStorage;
62
- }
63
22
  get crypto() {
64
23
  return this._crypto;
65
24
  }
@@ -101,6 +60,47 @@ class IccCryptoXApi {
101
60
  this.deviceBaseApi.getDeviceAesExchangeKeysForDelegate(delegateHcPartyId).catch(() => { }),
102
61
  ]).then(([a, b, c]) => (Object.assign(Object.assign(Object.assign({}, a), b), c)));
103
62
  }
63
+ constructor(host, headers, hcpartyBaseApi, //Init with a hcparty x api for better performances
64
+ patientBaseApi, deviceBaseApi, crypto = typeof window !== 'undefined' ? window.crypto : typeof self !== 'undefined' ? self.crypto : {}, storage, keyStorage) {
65
+ this.hcPartyKeysCache = {};
66
+ //[delegateId][delegatorId] = delegateEncryptedHcPartyKey
67
+ //for each delegate, it stores the list of delegators and the corresponding delegateEncryptedHcPartyKey (shared HcPartyKey, from delegator to delegate, encrypted with the RSA key of the delegate)
68
+ this.hcPartyKeysRequestsCache = {};
69
+ this.cacheLastDeletionTimestamp = undefined;
70
+ this.dataOwnerCache = {};
71
+ this.keychainLocalStoreIdPrefix = 'org.taktik.icure.ehealth.keychain.';
72
+ this.keychainValidityDateLocalStoreIdPrefix = 'org.taktik.icure.ehealth.keychain-date.';
73
+ this.hcpPreferenceKeyEhealthCert = 'eHealthCRTCrypt';
74
+ this.hcpPreferenceKeyEhealthCertDate = 'eHealthCRTDate';
75
+ this.rsaLocalStoreIdPrefix = 'org.taktik.icure.rsa.';
76
+ /**
77
+ * @internal may be changed without notice
78
+ */
79
+ this.rsaKeyPairs = {};
80
+ /**
81
+ * Specifies if the error reporting is enabled
82
+ */
83
+ this.enableErrorReporting = true;
84
+ /**
85
+ * Allows to specify the behaviour for saving the error report
86
+ */
87
+ this.saveErrorReportCallback = (collectedData) => __awaiter(this, void 0, void 0, function* () {
88
+ const entryPrefix = `icure.errorreports.${new Date() / 1}.${this.randomUuid()}.`;
89
+ console.warn('Storage entry prefix: ' + entryPrefix);
90
+ this.storage.setItem(entryPrefix + 'full', JSON.stringify(collectedData.fullData));
91
+ this.storage.setItem(entryPrefix + 'minimal', JSON.stringify(collectedData.minimalData));
92
+ });
93
+ this.hcpartyBaseApi = hcpartyBaseApi;
94
+ this.patientBaseApi = patientBaseApi;
95
+ this.deviceBaseApi = deviceBaseApi;
96
+ this._crypto = crypto;
97
+ this.generateKeyConcurrencyMap = {};
98
+ this._AES = new AES_1.AESUtils(crypto);
99
+ this._RSA = new RSA_1.RSAUtils(crypto);
100
+ this._shamir = new shamir_1.ShamirClass(crypto);
101
+ this._storage = storage;
102
+ this._keyStorage = keyStorage;
103
+ }
104
104
  loadAllKeysFromLocalStorage(dataOwnerId) {
105
105
  return __awaiter(this, void 0, void 0, function* () {
106
106
  const pubKeys = yield this.getDataOwnerHexPublicKeys((yield this.getDataOwner(dataOwnerId)).dataOwner);