@icure/api 6.4.0 → 7.0.0-beta.1

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 (154) hide show
  1. package/icc-api/api/IccDeviceApi.d.ts +1 -1
  2. package/icc-api/api/IccDeviceApi.js.map +1 -1
  3. package/icc-api/api/IccDoctemplateApi.js.map +1 -1
  4. package/icc-api/api/IccDocumentTemplateApi.js.map +1 -1
  5. package/icc-api/api/IccHcpartyApi.d.ts +1 -1
  6. package/icc-api/api/IccHcpartyApi.js.map +1 -1
  7. package/icc-api/api/IccPatientApi.d.ts +1 -1
  8. package/icc-api/api/IccPatientApi.js.map +1 -1
  9. package/icc-api/model/MaintenanceTask.d.ts +6 -5
  10. package/icc-api/model/MaintenanceTask.js +5 -0
  11. package/icc-api/model/MaintenanceTask.js.map +1 -1
  12. package/icc-api/model/User.d.ts +23 -1
  13. package/icc-api/model/User.js +21 -0
  14. package/icc-api/model/User.js.map +1 -1
  15. package/icc-api/model/models.d.ts +14 -0
  16. package/icc-api/model/models.js.map +1 -1
  17. package/icc-x-api/crypto/AES.d.ts +2 -0
  18. package/icc-x-api/crypto/AES.js +12 -0
  19. package/icc-x-api/crypto/AES.js.map +1 -1
  20. package/icc-x-api/crypto/BaseExchangeKeysManager.d.ts +122 -0
  21. package/icc-x-api/crypto/BaseExchangeKeysManager.js +356 -0
  22. package/icc-x-api/crypto/BaseExchangeKeysManager.js.map +1 -0
  23. package/icc-x-api/crypto/ConfidentialEntities.d.ts +58 -0
  24. package/icc-x-api/crypto/ConfidentialEntities.js +99 -0
  25. package/icc-x-api/crypto/ConfidentialEntities.js.map +1 -0
  26. package/icc-x-api/crypto/CryptoPrimitives.d.ts +31 -0
  27. package/icc-x-api/crypto/CryptoPrimitives.js +55 -0
  28. package/icc-x-api/crypto/CryptoPrimitives.js.map +1 -0
  29. package/icc-x-api/crypto/CryptoStrategies.d.ts +82 -0
  30. package/icc-x-api/crypto/CryptoStrategies.js +3 -0
  31. package/icc-x-api/crypto/CryptoStrategies.js.map +1 -0
  32. package/icc-x-api/crypto/EntitiesEncryption.d.ts +254 -0
  33. package/icc-x-api/crypto/EntitiesEncryption.js +700 -0
  34. package/icc-x-api/crypto/EntitiesEncryption.js.map +1 -0
  35. package/icc-x-api/crypto/ExchangeKeysManager.d.ts +56 -0
  36. package/icc-x-api/crypto/ExchangeKeysManager.js +147 -0
  37. package/icc-x-api/crypto/ExchangeKeysManager.js.map +1 -0
  38. package/icc-x-api/crypto/KeyManager.d.ts +103 -0
  39. package/icc-x-api/crypto/KeyManager.js +288 -0
  40. package/icc-x-api/crypto/KeyManager.js.map +1 -0
  41. package/icc-x-api/crypto/KeyRecovery.d.ts +34 -0
  42. package/icc-x-api/crypto/KeyRecovery.js +253 -0
  43. package/icc-x-api/crypto/KeyRecovery.js.map +1 -0
  44. package/icc-x-api/crypto/LegacyCryptoStrategies.d.ts +28 -0
  45. package/icc-x-api/crypto/LegacyCryptoStrategies.js +22 -0
  46. package/icc-x-api/crypto/LegacyCryptoStrategies.js.map +1 -0
  47. package/icc-x-api/crypto/RSA.d.ts +19 -20
  48. package/icc-x-api/crypto/RSA.js +30 -1
  49. package/icc-x-api/crypto/RSA.js.map +1 -1
  50. package/icc-x-api/crypto/ShamirKeysManager.d.ts +43 -0
  51. package/icc-x-api/crypto/ShamirKeysManager.js +150 -0
  52. package/icc-x-api/crypto/ShamirKeysManager.js.map +1 -0
  53. package/icc-x-api/crypto/ShareMetadataBehaviour.d.ts +19 -0
  54. package/icc-x-api/crypto/ShareMetadataBehaviour.js +24 -0
  55. package/icc-x-api/crypto/ShareMetadataBehaviour.js.map +1 -0
  56. package/icc-x-api/crypto/TransferKeysManager.d.ts +29 -0
  57. package/icc-x-api/crypto/TransferKeysManager.js +121 -0
  58. package/icc-x-api/crypto/TransferKeysManager.js.map +1 -0
  59. package/icc-x-api/crypto/utils.d.ts +46 -0
  60. package/icc-x-api/crypto/utils.js +128 -0
  61. package/icc-x-api/crypto/utils.js.map +1 -1
  62. package/icc-x-api/filters/ContactByHcPartyTagCodeDateFilter.d.ts +11 -0
  63. package/icc-x-api/filters/ContactByHcPartyTagCodeDateFilter.js +11 -0
  64. package/icc-x-api/filters/ContactByHcPartyTagCodeDateFilter.js.map +1 -1
  65. package/icc-x-api/filters/DeviceByHcPartyFilter.d.ts +11 -0
  66. package/icc-x-api/filters/DeviceByHcPartyFilter.js +11 -0
  67. package/icc-x-api/filters/DeviceByHcPartyFilter.js.map +1 -1
  68. package/icc-x-api/filters/DeviceByIdsFilter.d.ts +11 -0
  69. package/icc-x-api/filters/DeviceByIdsFilter.js +11 -0
  70. package/icc-x-api/filters/DeviceByIdsFilter.js.map +1 -1
  71. package/icc-x-api/filters/HealthElementByHcPartySecretForeignKeysFilter.d.ts +11 -0
  72. package/icc-x-api/filters/HealthElementByHcPartySecretForeignKeysFilter.js +11 -0
  73. package/icc-x-api/filters/HealthElementByHcPartySecretForeignKeysFilter.js.map +1 -1
  74. package/icc-x-api/icc-accesslog-x-api.d.ts +49 -4
  75. package/icc-x-api/icc-accesslog-x-api.js +112 -102
  76. package/icc-x-api/icc-accesslog-x-api.js.map +1 -1
  77. package/icc-x-api/icc-calendar-item-x-api.d.ts +53 -5
  78. package/icc-x-api/icc-calendar-item-x-api.js +112 -100
  79. package/icc-x-api/icc-calendar-item-x-api.js.map +1 -1
  80. package/icc-x-api/icc-classification-x-api.d.ts +45 -2
  81. package/icc-x-api/icc-classification-x-api.js +89 -41
  82. package/icc-x-api/icc-classification-x-api.js.map +1 -1
  83. package/icc-x-api/icc-contact-x-api.d.ts +57 -19
  84. package/icc-x-api/icc-contact-x-api.js +149 -154
  85. package/icc-x-api/icc-contact-x-api.js.map +1 -1
  86. package/icc-x-api/icc-crypto-x-api.d.ts +266 -366
  87. package/icc-x-api/icc-crypto-x-api.js +416 -1327
  88. package/icc-x-api/icc-crypto-x-api.js.map +1 -1
  89. package/icc-x-api/icc-data-owner-x-api.d.ts +110 -11
  90. package/icc-x-api/icc-data-owner-x-api.js +188 -14
  91. package/icc-x-api/icc-data-owner-x-api.js.map +1 -1
  92. package/icc-x-api/icc-doctemplate-x-api.js +3 -3
  93. package/icc-x-api/icc-doctemplate-x-api.js.map +1 -1
  94. package/icc-x-api/icc-document-x-api.d.ts +76 -5
  95. package/icc-x-api/icc-document-x-api.js +137 -59
  96. package/icc-x-api/icc-document-x-api.js.map +1 -1
  97. package/icc-x-api/icc-form-x-api.d.ts +47 -7
  98. package/icc-x-api/icc-form-x-api.js +85 -86
  99. package/icc-x-api/icc-form-x-api.js.map +1 -1
  100. package/icc-x-api/icc-hcparty-x-api.d.ts +1 -1
  101. package/icc-x-api/icc-hcparty-x-api.js +1 -1
  102. package/icc-x-api/icc-hcparty-x-api.js.map +1 -1
  103. package/icc-x-api/icc-helement-x-api.d.ts +50 -3
  104. package/icc-x-api/icc-helement-x-api.js +101 -118
  105. package/icc-x-api/icc-helement-x-api.js.map +1 -1
  106. package/icc-x-api/icc-icure-maintenance-x-api.d.ts +31 -0
  107. package/icc-x-api/icc-icure-maintenance-x-api.js +124 -0
  108. package/icc-x-api/icc-icure-maintenance-x-api.js.map +1 -0
  109. package/icc-x-api/icc-invoice-x-api.d.ts +45 -5
  110. package/icc-x-api/icc-invoice-x-api.js +89 -64
  111. package/icc-x-api/icc-invoice-x-api.js.map +1 -1
  112. package/icc-x-api/icc-maintenance-task-x-api.d.ts +38 -6
  113. package/icc-x-api/icc-maintenance-task-x-api.js +73 -102
  114. package/icc-x-api/icc-maintenance-task-x-api.js.map +1 -1
  115. package/icc-x-api/icc-message-x-api.d.ts +55 -2
  116. package/icc-x-api/icc-message-x-api.js +92 -33
  117. package/icc-x-api/icc-message-x-api.js.map +1 -1
  118. package/icc-x-api/icc-patient-x-api.d.ts +67 -7
  119. package/icc-x-api/icc-patient-x-api.js +409 -473
  120. package/icc-x-api/icc-patient-x-api.js.map +1 -1
  121. package/icc-x-api/icc-receipt-x-api.d.ts +49 -5
  122. package/icc-x-api/icc-receipt-x-api.js +85 -47
  123. package/icc-x-api/icc-receipt-x-api.js.map +1 -1
  124. package/icc-x-api/icc-time-table-x-api.d.ts +34 -10
  125. package/icc-x-api/icc-time-table-x-api.js +61 -18
  126. package/icc-x-api/icc-time-table-x-api.js.map +1 -1
  127. package/icc-x-api/index.d.ts +30 -1
  128. package/icc-x-api/index.js +112 -49
  129. package/icc-x-api/index.js.map +1 -1
  130. package/icc-x-api/maintenance/KeyPairUpdateRequest.d.ts +35 -0
  131. package/icc-x-api/maintenance/KeyPairUpdateRequest.js +54 -0
  132. package/icc-x-api/maintenance/KeyPairUpdateRequest.js.map +1 -0
  133. package/icc-x-api/storage/DefaultStorageEntryKeysFactory.d.ts +9 -0
  134. package/icc-x-api/storage/DefaultStorageEntryKeysFactory.js +23 -0
  135. package/icc-x-api/storage/DefaultStorageEntryKeysFactory.js.map +1 -0
  136. package/icc-x-api/storage/IcureStorageFacade.d.ts +55 -0
  137. package/icc-x-api/storage/IcureStorageFacade.js +95 -0
  138. package/icc-x-api/storage/IcureStorageFacade.js.map +1 -0
  139. package/icc-x-api/storage/StorageEntryKeysFactory.d.ts +31 -0
  140. package/icc-x-api/storage/StorageEntryKeysFactory.js +3 -0
  141. package/icc-x-api/storage/StorageEntryKeysFactory.js.map +1 -0
  142. package/icc-x-api/utils/collection-utils.d.ts +8 -0
  143. package/icc-x-api/utils/collection-utils.js +26 -0
  144. package/icc-x-api/utils/collection-utils.js.map +1 -0
  145. package/icc-x-api/utils/crypto-utils.d.ts +8 -1
  146. package/icc-x-api/utils/crypto-utils.js +19 -3
  147. package/icc-x-api/utils/crypto-utils.js.map +1 -1
  148. package/icc-x-api/utils/graph-utils.d.ts +45 -0
  149. package/icc-x-api/utils/graph-utils.js +203 -0
  150. package/icc-x-api/utils/graph-utils.js.map +1 -0
  151. package/icc-x-api/utils/lru-temporised-async-cache.d.ts +27 -0
  152. package/icc-x-api/utils/lru-temporised-async-cache.js +120 -0
  153. package/icc-x-api/utils/lru-temporised-async-cache.js.map +1 -0
  154. package/package.json +1 -1
@@ -11,6 +11,7 @@ import * as models from '../icc-api/model/models';
11
11
  import { IccCalendarItemXApi } from './icc-calendar-item-x-api';
12
12
  import { IccDataOwnerXApi } from './icc-data-owner-x-api';
13
13
  import { AuthenticationProvider } from './auth/AuthenticationProvider';
14
+ import { ShareMetadataBehaviour } from './crypto/ShareMetadataBehaviour';
14
15
  export declare class IccPatientXApi extends IccPatientApi {
15
16
  crypto: IccCryptoXApi;
16
17
  contactApi: IccContactXApi;
@@ -26,10 +27,36 @@ export declare class IccPatientXApi extends IccPatientApi {
26
27
  constructor(host: string, headers: {
27
28
  [key: string]: string;
28
29
  }, crypto: IccCryptoXApi, contactApi: IccContactXApi, formApi: IccFormXApi, helementApi: IccHelementXApi, invoiceApi: IccInvoiceXApi, documentApi: IccDocumentXApi, hcpartyApi: IccHcpartyXApi, classificationApi: IccClassificationXApi, dataOwnerApi: IccDataOwnerXApi, calendarItemaApi: IccCalendarItemXApi, encryptedKeys?: Array<string>, authenticationProvider?: AuthenticationProvider, fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>);
29
- newInstance(user: models.User, p?: any, delegates?: string[]): Promise<models.Patient>;
30
+ /**
31
+ * Creates a new instance of patient with initialised encryption metadata (not in the database).
32
+ * @param user the current user.
33
+ * @param p initialised data for the patient. Metadata such as id, creation data, etc. will be automatically initialised, but you can specify
34
+ * other kinds of data or overwrite generated metadata with this. You can't specify encryption metadata.
35
+ * @param options optional parameters:
36
+ * - additionalDelegates: delegates which will have access to the entity in addition to the current data owner and delegates from the
37
+ * auto-delegations. Must be an object which associates each data owner id with the access level to give to that data owner. May overlap with
38
+ * auto-delegations, in such case the access level specified here will be used. Currently only WRITE access is supported, but in future also read
39
+ * access will be possible.
40
+ * @return a new instance of patient.
41
+ */
42
+ newInstance(user: models.User, p?: any, options?: {
43
+ additionalDelegates?: {
44
+ [dataOwnerId: string]: 'WRITE';
45
+ };
46
+ }): Promise<models.Patient>;
30
47
  completeNames(patient: models.Patient): models.Patient;
31
- initDelegationsAndEncryptionKeys(patient: models.Patient, user: models.User, secretForeignKey?: string | undefined, delegates?: string[]): Promise<models.Patient>;
32
- initConfidentialDelegation(patient: models.Patient, user: models.User): Promise<models.Patient | null>;
48
+ /**
49
+ * @deprecated replace with {@link initConfidentialSecretId}
50
+ */
51
+ initConfidentialDelegation(patient: models.Patient, user: models.User): Promise<models.Patient>;
52
+ /**
53
+ * Ensures that the current data owner has some confidential secret ids for the provided patient. If not creates them and updates the patient in the
54
+ * database.
55
+ * @param patient the patient for which you want to initialise the confidential secret id.
56
+ * @param user the current user.
57
+ * @return the updated patient or the original patient if no change was necessary.
58
+ */
59
+ initConfidentialSecretId(patient: models.Patient, user: models.User): Promise<models.Patient>;
33
60
  createPatient(body?: models.Patient): never;
34
61
  createPatientWithUser(user: models.User, body?: models.Patient): Promise<models.Patient | any>;
35
62
  filterBy(startKey?: string, startDocumentId?: string, limit?: number, skip?: number, sort?: string, desc?: boolean, body?: models.FilterChainPatient): never;
@@ -70,15 +97,13 @@ export declare class IccPatientXApi extends IccPatientApi {
70
97
  modifyPatient(body?: models.Patient): never;
71
98
  modifyPatientRaw(body?: models.Patient): Promise<models.Patient | any>;
72
99
  modifyPatientWithUser(user: models.User, body?: models.Patient): Promise<models.Patient | null>;
100
+ modifyAs(dataOwner: string, body: models.Patient): Promise<models.Patient>;
73
101
  modifyPatientReferral(patientId: string, referralId: string, start?: number, end?: number): never;
74
102
  modifyPatientReferralWithUser(user: models.User, patientId: string, referralId: string, start?: number, end?: number): Promise<models.Patient | any>;
75
103
  encrypt(user: models.User, pats: Array<models.Patient>): Promise<Array<models.Patient>>;
76
- private tryEncrypt;
104
+ private encryptAs;
77
105
  decrypt(user: models.User, patients: Array<models.Patient>, fillDelegations?: boolean): Promise<Array<models.Patient>>;
78
106
  private tryDecryptOrReturnOriginal;
79
- /** By default, an encryptionKey will be added for every hcp in the autoDelegations of the provided user.
80
- * In optional field additionalDelegateIds, you can ask the method to create encryptionKeys for additional hcps */
81
- initEncryptionKeys(user: models.User, pat: models.Patient, additionalDelegateIds?: string[]): Promise<models.Patient>;
82
107
  share(user: models.User, patId: string, ownerId: string, delegateIds: Array<string>, delegationTags: {
83
108
  [key: string]: Array<string>;
84
109
  }, usingPost?: boolean): Promise<{
@@ -96,4 +121,39 @@ export declare class IccPatientXApi extends IccPatientApi {
96
121
  checkInami(inami: string): boolean;
97
122
  isValidSsin(ssin: string): boolean;
98
123
  getPatientIdOfChildDocumentForHcpAndHcpParents(childDocument: models.Invoice | models.CalendarItem | models.Contact | models.AccessLog, hcpId: string): Promise<string>;
124
+ /**
125
+ * Share an existing patient with other data owners, allowing them to access the non-encrypted data of the patient and optionally also
126
+ * the encrypted content.
127
+ * @param delegateId the id of the data owner which will be granted access to the patient.
128
+ * @param patient the patient to share.
129
+ * @param shareSecretIds the secret ids of the Patient that the delegate will be given access to. Allows the delegate to search for data where the
130
+ * shared Patient is the owning entity id.
131
+ * @param options optional parameters to customize the sharing behaviour:
132
+ * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted
133
+ * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a
134
+ * patient does not have encrypted content.
135
+ * {@link ShareMetadataBehaviour.IF_AVAILABLE}).
136
+ * @return a promise which will contain the updated patient.
137
+ */
138
+ shareWith(delegateId: string, patient: models.Patient, shareSecretIds: string[], options?: {
139
+ shareEncryptionKey?: ShareMetadataBehaviour;
140
+ }): Promise<models.Patient>;
141
+ /**
142
+ * @param patient a patient
143
+ * @return all the decryptable secret ids of the patient, retrieved from the encrypted metadata. The result may be used to find entities where the
144
+ * patient is the 'owning entity', or in the {@link shareWith} method in order to share it with other data owners.
145
+ */
146
+ decryptSecretIdsOf(patient: models.Patient): Promise<string[]>;
147
+ /**
148
+ * @param patient a patient
149
+ * @return the confidential secret ids of the patient, retrieved from the encrypted metadata. The result may be used to find entities where the
150
+ * patient is the 'owning entity', or in the {@link shareWith} method in order to share it with other data owners.
151
+ */
152
+ decryptConfidentialSecretIdsOf(patient: models.Patient): Promise<string[]>;
153
+ /**
154
+ * @param patient a patient
155
+ * @return the non-confidential secret ids of the patient, retrieved from the encrypted metadata. The result may be used to find entities where the
156
+ * patient is the 'owning entity', or in the {@link shareWith} method in order to share it with other data owners.
157
+ */
158
+ decryptNonConfidentialSecretIdsOf(patient: models.Patient): Promise<string[]>;
99
159
  }