@icure/cardinal-sdk 2.10.2 → 2.11.0

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 (67) hide show
  1. package/api/AccessLogApi.d.mts +26 -1
  2. package/api/AccessLogInGroupApi.d.mts +16 -1
  3. package/api/CalendarItemApi.d.mts +25 -0
  4. package/api/CalendarItemInGroupApi.d.mts +12 -0
  5. package/api/ContactApi.d.mts +23 -0
  6. package/api/ContactInGroupApi.d.mts +13 -0
  7. package/api/DocumentApi.d.mts +64 -1
  8. package/api/DocumentInGroupApi.d.mts +33 -0
  9. package/api/FormApi.d.mts +25 -2
  10. package/api/FormInGroupApi.d.mts +13 -0
  11. package/api/HealthElementApi.d.mts +24 -1
  12. package/api/HealthElementInGroupApi.d.mts +13 -0
  13. package/api/InvoiceApi.d.mts +24 -1
  14. package/api/InvoiceBasicApi.d.mts +1 -1
  15. package/api/InvoiceInGroupApi.d.mts +13 -0
  16. package/api/MessageApi.d.mts +24 -1
  17. package/api/MessageInGroupApi.d.mts +13 -0
  18. package/api/PatientApi.d.mts +20 -0
  19. package/api/PatientInGroupApi.d.mts +12 -0
  20. package/api/ReceiptApi.d.mts +23 -0
  21. package/api/ReceiptBasicApi.d.mts +15 -0
  22. package/api/ReceiptBasicInGroupApi.d.mts +14 -0
  23. package/api/ReceiptFlavouredApi.d.mts +15 -0
  24. package/api/ReceiptFlavouredInGroupApi.d.mts +9 -0
  25. package/api/ReceiptInGroupApi.d.mts +26 -0
  26. package/api/TopicApi.d.mts +23 -0
  27. package/api/TopicInGroupApi.d.mts +13 -0
  28. package/api/UserApi.d.mts +10 -0
  29. package/cardinal-sdk-ts.d.mts +0 -19
  30. package/cardinal-sdk-ts.mjs +44169 -40027
  31. package/cardinal-sdk.mjs +104895 -100890
  32. package/crypto/entities/AccessLogDelegateOptions.d.mts +12 -0
  33. package/crypto/entities/AccessLogDelegateOptions.mjs +18 -0
  34. package/crypto/entities/CalendarItemDelegateOptions.d.mts +12 -0
  35. package/crypto/entities/CalendarItemDelegateOptions.mjs +18 -0
  36. package/crypto/entities/ContactDelegateOptions.d.mts +12 -0
  37. package/crypto/entities/ContactDelegateOptions.mjs +18 -0
  38. package/crypto/entities/DocumentDelegateOptions.d.mts +12 -0
  39. package/crypto/entities/DocumentDelegateOptions.mjs +18 -0
  40. package/crypto/entities/FormDelegateOptions.d.mts +12 -0
  41. package/crypto/entities/FormDelegateOptions.mjs +18 -0
  42. package/crypto/entities/HealthElementDelegateOptions.d.mts +12 -0
  43. package/crypto/entities/HealthElementDelegateOptions.mjs +18 -0
  44. package/crypto/entities/InvoiceDelegateOptions.d.mts +12 -0
  45. package/crypto/entities/InvoiceDelegateOptions.mjs +18 -0
  46. package/crypto/entities/MessageDelegateOptions.d.mts +12 -0
  47. package/crypto/entities/MessageDelegateOptions.mjs +18 -0
  48. package/crypto/entities/PatientDelegateOptions.d.mts +7 -0
  49. package/crypto/entities/PatientDelegateOptions.mjs +11 -0
  50. package/crypto/entities/ReceiptDelegateOptions.d.mts +7 -0
  51. package/crypto/entities/ReceiptDelegateOptions.mjs +11 -0
  52. package/crypto/entities/TopicDelegateOptions.d.mts +12 -0
  53. package/crypto/entities/TopicDelegateOptions.mjs +18 -0
  54. package/crypto.d.mts +11 -0
  55. package/crypto.mjs +11 -0
  56. package/filters.d.mts +0 -1
  57. package/filters.mjs +0 -1
  58. package/kotlinx-coroutines-core.mjs +7 -7
  59. package/model/base/CryptoActor.mjs +1 -1
  60. package/model/embed/form/template/Field.d.mts +1 -1
  61. package/model/embed/form/template/StructureElement.d.mts +1 -1
  62. package/model/embed/form/template/StructureElement.mjs +7 -7
  63. package/model/filter/predicate/Predicate.d.mts +1 -1
  64. package/model/filter/predicate/Predicate.mjs +3 -3
  65. package/package.json +1 -1
  66. package/filters/ClassificationFilters.d.mts +0 -114
  67. package/filters/ClassificationFilters.mjs +0 -8
@@ -1,5 +1,6 @@
1
1
  import { FilterOptions, PaginatedListIterator, SortableFilterOptions } from '../cardinal-sdk-ts.mjs';
2
2
  import { EntityAccessInformation } from '../crypto/entities/EntityAccessInformation.mjs';
3
+ import { PatientDelegateOptions } from '../crypto/entities/PatientDelegateOptions.mjs';
3
4
  import { PatientShareOptions } from '../crypto/entities/PatientShareOptions.mjs';
4
5
  import { ShareAllPatientDataOptions } from '../crypto/entities/ShareAllPatientDataOptions.mjs';
5
6
  import { EntityReferenceInGroup } from '../model/EntityReferenceInGroup.mjs';
@@ -80,6 +81,25 @@ export interface PatientApi {
80
81
  };
81
82
  alternateRootDelegateId?: string | undefined;
82
83
  }): Promise<DecryptedPatient>;
84
+ /**
85
+ *
86
+ * Creates a new access log with initialized encryption metadata, specifying fine-grained options for each additional data owner that
87
+ * will have access to the entity.
88
+ * @param base a patient with initialized content and uninitialized encryption metadata. The result of this
89
+ * method takes the content from [base] if provided.
90
+ * @param user the current user, will be used for the auto-delegations if provided.
91
+ * @param delegates additional data owners that will have access to the newly created entity. You may choose the
92
+ * permissions that the delegates will have on the entity and if they will have access to the secretIds, encryptionKeys, and/or
93
+ * owningEntityIds of the new entity.
94
+ * @return a patient with initialized encryption metadata.
95
+ * @throws IllegalArgumentException if base is not null and has a revision or has encryption metadata.
96
+ */
97
+ withEncryptionMetadataAndDelegates(base: DecryptedPatient | undefined, delegates: {
98
+ [key: string]: PatientDelegateOptions;
99
+ }, options?: {
100
+ user?: User | undefined;
101
+ alternateRootDelegateId?: string | undefined;
102
+ }): Promise<DecryptedPatient>;
83
103
  /**
84
104
  *
85
105
  * Specifies if the current user has write access to a patient through delegations.
@@ -1,5 +1,6 @@
1
1
  import { FilterOptions, PaginatedListIterator, SortableFilterOptions } from '../cardinal-sdk-ts.mjs';
2
2
  import { EntityAccessInformation } from '../crypto/entities/EntityAccessInformation.mjs';
3
+ import { PatientDelegateOptions } from '../crypto/entities/PatientDelegateOptions.mjs';
3
4
  import { PatientShareOptions } from '../crypto/entities/PatientShareOptions.mjs';
4
5
  import { EntityReferenceInGroup } from '../model/EntityReferenceInGroup.mjs';
5
6
  import { GroupScoped } from '../model/GroupScoped.mjs';
@@ -52,6 +53,17 @@ export interface PatientInGroupApi {
52
53
  }, 'delegate'>;
53
54
  alternateRootDelegateReference?: EntityReferenceInGroup | undefined;
54
55
  }): Promise<GroupScoped<DecryptedPatient>>;
56
+ /**
57
+ *
58
+ * In-group version of [PatientApi.withEncryptionMetadataAndDelegates]
59
+ */
60
+ withEncryptionMetadataAndDelegates(entityGroupId: string, base: DecryptedPatient | undefined, delegates: ArrayWithUniqueKeys<{
61
+ delegate: EntityReferenceInGroup;
62
+ delegateOptions: PatientDelegateOptions;
63
+ }, 'delegate'>, options?: {
64
+ user?: User | undefined;
65
+ alternateRootDelegateReference?: EntityReferenceInGroup | undefined;
66
+ }): Promise<GroupScoped<DecryptedPatient>>;
55
67
  /**
56
68
  *
57
69
  * In-group version of [PatientApi.hasWriteAccess]
@@ -1,3 +1,4 @@
1
+ import { ReceiptDelegateOptions } from '../crypto/entities/ReceiptDelegateOptions.mjs';
1
2
  import { ReceiptShareOptions } from '../crypto/entities/ReceiptShareOptions.mjs';
2
3
  import { SecretIdUseOption } from '../crypto/entities/SecretIdUseOption.mjs';
3
4
  import { EntityReferenceInGroup } from '../model/EntityReferenceInGroup.mjs';
@@ -21,6 +22,13 @@ export interface ReceiptApi {
21
22
  secretId?: SecretIdUseOption;
22
23
  alternateRootDelegateId?: string | undefined;
23
24
  }): Promise<DecryptedReceipt>;
25
+ withEncryptionMetadataAndDelegates(base: DecryptedReceipt | undefined, patient: Patient | undefined, delegates: {
26
+ [key: string]: ReceiptDelegateOptions;
27
+ }, options?: {
28
+ user?: User | undefined;
29
+ secretId?: SecretIdUseOption;
30
+ alternateRootDelegateId?: string | undefined;
31
+ }): Promise<DecryptedReceipt>;
24
32
  getAndDecryptReceiptAttachment(receipt: Receipt, attachmentId: string): Promise<Int8Array>;
25
33
  encryptAndSetReceiptAttachment(receipt: Receipt, blobType: string, attachment: Int8Array): Promise<EncryptedReceipt>;
26
34
  getEncryptionKeysOf(receipt: Receipt): Promise<Array<HexString>>;
@@ -204,4 +212,19 @@ export interface ReceiptApi {
204
212
  */
205
213
  getReceipts(entityIds: Array<string>): Promise<Array<DecryptedReceipt>>;
206
214
  listByReference(reference: string): Promise<Array<DecryptedReceipt>>;
215
+ /**
216
+ *
217
+ * Lists the receipts created within the provided date interval (based on the receipt `created`
218
+ * timestamp, both bounds inclusive). A null bound leaves that side of the interval open.
219
+ * Flavoured method.
220
+ * @param startDate the start of the interval (inclusive), no lower bound if null
221
+ * @param endDate the end of the interval (inclusive), no upper bound if null
222
+ * @param descending whether to sort the result from the most recent to the oldest
223
+ * @return the receipts created within the provided interval
224
+ */
225
+ listReceiptsBetweenDates(options?: {
226
+ startDate?: number | undefined;
227
+ endDate?: number | undefined;
228
+ descending?: boolean;
229
+ }): Promise<Array<DecryptedReceipt>>;
207
230
  }
@@ -156,4 +156,19 @@ export interface ReceiptBasicApi {
156
156
  */
157
157
  getReceipts(entityIds: Array<string>): Promise<Array<EncryptedReceipt>>;
158
158
  listByReference(reference: string): Promise<Array<EncryptedReceipt>>;
159
+ /**
160
+ *
161
+ * Lists the receipts created within the provided date interval (based on the receipt `created`
162
+ * timestamp, both bounds inclusive). A null bound leaves that side of the interval open.
163
+ * Flavoured method.
164
+ * @param startDate the start of the interval (inclusive), no lower bound if null
165
+ * @param endDate the end of the interval (inclusive), no upper bound if null
166
+ * @param descending whether to sort the result from the most recent to the oldest
167
+ * @return the receipts created within the provided interval
168
+ */
169
+ listReceiptsBetweenDates(options?: {
170
+ startDate?: number | undefined;
171
+ endDate?: number | undefined;
172
+ descending?: boolean;
173
+ }): Promise<Array<EncryptedReceipt>>;
159
174
  }
@@ -42,6 +42,11 @@ export interface ReceiptBasicInGroupApi {
42
42
  * In-group version of [ReceiptBasicFlavourlessApi.purgeReceipts]
43
43
  */
44
44
  purgeReceipts(receipts: Array<GroupScoped<Receipt>>): Promise<Array<GroupScoped<StoredDocumentIdentifier>>>;
45
+ /**
46
+ *
47
+ * In-group version of [ReceiptBasicFlavourlessApi.getRawReceiptAttachment]
48
+ */
49
+ getRawReceiptAttachment(groupId: string, receiptId: string, attachmentId: string): Promise<Int8Array>;
45
50
  /**
46
51
  *
47
52
  * In-group version of [ReceiptApi.createReceipt]
@@ -92,4 +97,13 @@ export interface ReceiptBasicInGroupApi {
92
97
  * In-group version of [ReceiptBasicFlavouredApi.getReceipts]
93
98
  */
94
99
  getReceipts(groupId: string, entityIds: Array<string>): Promise<Array<GroupScoped<EncryptedReceipt>>>;
100
+ /**
101
+ *
102
+ * In-group version of [ReceiptBasicFlavouredApi.listReceiptsBetweenDates]
103
+ */
104
+ listReceiptsBetweenDates(groupId: string, options?: {
105
+ startDate?: number | undefined;
106
+ endDate?: number | undefined;
107
+ descending?: boolean;
108
+ }): Promise<Array<GroupScoped<EncryptedReceipt>>>;
95
109
  }
@@ -109,4 +109,19 @@ export interface ReceiptFlavouredApi<E extends Receipt> {
109
109
  */
110
110
  getReceipts(entityIds: Array<string>): Promise<Array<E>>;
111
111
  listByReference(reference: string): Promise<Array<E>>;
112
+ /**
113
+ *
114
+ * Lists the receipts created within the provided date interval (based on the receipt `created`
115
+ * timestamp, both bounds inclusive). A null bound leaves that side of the interval open.
116
+ * Flavoured method.
117
+ * @param startDate the start of the interval (inclusive), no lower bound if null
118
+ * @param endDate the end of the interval (inclusive), no upper bound if null
119
+ * @param descending whether to sort the result from the most recent to the oldest
120
+ * @return the receipts created within the provided interval
121
+ */
122
+ listReceiptsBetweenDates(options?: {
123
+ startDate?: number | undefined;
124
+ endDate?: number | undefined;
125
+ descending?: boolean;
126
+ }): Promise<Array<E>>;
112
127
  }
@@ -70,4 +70,13 @@ export interface ReceiptFlavouredInGroupApi<E extends Receipt> {
70
70
  * In-group version of [ReceiptBasicFlavouredApi.getReceipts]
71
71
  */
72
72
  getReceipts(groupId: string, entityIds: Array<string>): Promise<Array<GroupScoped<E>>>;
73
+ /**
74
+ *
75
+ * In-group version of [ReceiptBasicFlavouredApi.listReceiptsBetweenDates]
76
+ */
77
+ listReceiptsBetweenDates(groupId: string, options?: {
78
+ startDate?: number | undefined;
79
+ endDate?: number | undefined;
80
+ descending?: boolean;
81
+ }): Promise<Array<GroupScoped<E>>>;
73
82
  }
@@ -1,3 +1,4 @@
1
+ import { ReceiptDelegateOptions } from '../crypto/entities/ReceiptDelegateOptions.mjs';
1
2
  import { ReceiptShareOptions } from '../crypto/entities/ReceiptShareOptions.mjs';
2
3
  import { SecretIdUseOption } from '../crypto/entities/SecretIdUseOption.mjs';
3
4
  import { EntityReferenceInGroup } from '../model/EntityReferenceInGroup.mjs';
@@ -25,6 +26,17 @@ export interface ReceiptInGroupApi {
25
26
  secretId?: SecretIdUseOption;
26
27
  alternateRootDelegateId?: string | undefined;
27
28
  }): Promise<GroupScoped<DecryptedReceipt>>;
29
+ /**
30
+ *
31
+ * In-group version of [ReceiptApi.withEncryptionMetadataAndDelegates]
32
+ */
33
+ withEncryptionMetadataAndDelegates(groupId: string, base: DecryptedReceipt | undefined, patient: GroupScoped<Patient> | undefined, delegates: {
34
+ [key: string]: ReceiptDelegateOptions;
35
+ }, options?: {
36
+ user?: User | undefined;
37
+ secretId?: SecretIdUseOption;
38
+ alternateRootDelegateId?: string | undefined;
39
+ }): Promise<GroupScoped<DecryptedReceipt>>;
28
40
  /**
29
41
  *
30
42
  * In-group version of [ReceiptApi.getEncryptionKeysOf]
@@ -95,6 +107,11 @@ export interface ReceiptInGroupApi {
95
107
  * In-group version of [ReceiptBasicFlavourlessApi.purgeReceipts]
96
108
  */
97
109
  purgeReceipts(receipts: Array<GroupScoped<Receipt>>): Promise<Array<GroupScoped<StoredDocumentIdentifier>>>;
110
+ /**
111
+ *
112
+ * In-group version of [ReceiptBasicFlavourlessApi.getRawReceiptAttachment]
113
+ */
114
+ getRawReceiptAttachment(groupId: string, receiptId: string, attachmentId: string): Promise<Int8Array>;
98
115
  /**
99
116
  *
100
117
  * In-group version of [ReceiptFlavouredApi.shareWith]
@@ -160,4 +177,13 @@ export interface ReceiptInGroupApi {
160
177
  * In-group version of [ReceiptBasicFlavouredApi.getReceipts]
161
178
  */
162
179
  getReceipts(groupId: string, entityIds: Array<string>): Promise<Array<GroupScoped<DecryptedReceipt>>>;
180
+ /**
181
+ *
182
+ * In-group version of [ReceiptBasicFlavouredApi.listReceiptsBetweenDates]
183
+ */
184
+ listReceiptsBetweenDates(groupId: string, options?: {
185
+ startDate?: number | undefined;
186
+ endDate?: number | undefined;
187
+ descending?: boolean;
188
+ }): Promise<Array<GroupScoped<DecryptedReceipt>>>;
163
189
  }
@@ -1,5 +1,6 @@
1
1
  import { FilterOptions, PaginatedListIterator, SortableFilterOptions } from '../cardinal-sdk-ts.mjs';
2
2
  import { SecretIdUseOption } from '../crypto/entities/SecretIdUseOption.mjs';
3
+ import { TopicDelegateOptions } from '../crypto/entities/TopicDelegateOptions.mjs';
3
4
  import { TopicShareOptions } from '../crypto/entities/TopicShareOptions.mjs';
4
5
  import { EntityReferenceInGroup } from '../model/EntityReferenceInGroup.mjs';
5
6
  import { Patient } from '../model/Patient.mjs';
@@ -39,6 +40,28 @@ export interface TopicApi {
39
40
  secretId?: SecretIdUseOption;
40
41
  alternateRootDelegateId?: string | undefined;
41
42
  }): Promise<DecryptedTopic>;
43
+ /**
44
+ *
45
+ * Creates a new topic with initialized encryption metadata, specifying fine-grained options for each additional data owner that
46
+ * will have access to the entity.
47
+ * @param base a topic with initialized content and uninitialized encryption metadata. The result of this
48
+ * method takes the content from [base] if provided.
49
+ * @param patient the patient linked to the topic.
50
+ * @param user the current user, will be used for the auto-delegations if provided.
51
+ * @param delegates additional data owners that will have access to the newly created entity. You may choose the
52
+ * permissions that the delegates will have on the entity and if they will have access to the secretIds, encryptionKeys, and/or
53
+ * owningEntityIds of the new entity.
54
+ * @param secretId specifies which secret id of [patient] to use for the new topic
55
+ * @return a topic with initialized encryption metadata.
56
+ * @throws IllegalArgumentException if base is not null and has a revision or has encryption metadata.
57
+ */
58
+ withEncryptionMetadataAndDelegates(base: DecryptedTopic | undefined, patient: Patient | undefined, delegates: {
59
+ [key: string]: TopicDelegateOptions;
60
+ }, options?: {
61
+ user?: User | undefined;
62
+ secretId?: SecretIdUseOption;
63
+ alternateRootDelegateId?: string | undefined;
64
+ }): Promise<DecryptedTopic>;
42
65
  /**
43
66
  *
44
67
  * Attempts to extract the encryption keys of a topic. If the user does not have access to any encryption key
@@ -1,5 +1,6 @@
1
1
  import { FilterOptions, PaginatedListIterator, SortableFilterOptions } from '../cardinal-sdk-ts.mjs';
2
2
  import { SecretIdUseOption } from '../crypto/entities/SecretIdUseOption.mjs';
3
+ import { TopicDelegateOptions } from '../crypto/entities/TopicDelegateOptions.mjs';
3
4
  import { TopicShareOptions } from '../crypto/entities/TopicShareOptions.mjs';
4
5
  import { EntityReferenceInGroup } from '../model/EntityReferenceInGroup.mjs';
5
6
  import { GroupScoped } from '../model/GroupScoped.mjs';
@@ -26,6 +27,18 @@ export interface TopicInGroupApi {
26
27
  secretId?: SecretIdUseOption;
27
28
  alternateRootDelegateId?: string | undefined;
28
29
  }): Promise<GroupScoped<DecryptedTopic>>;
30
+ /**
31
+ *
32
+ * In-group version of [TopicApi.withEncryptionMetadataAndDelegates]
33
+ */
34
+ withEncryptionMetadataAndDelegates(groupId: string, base: DecryptedTopic | undefined, patient: GroupScoped<Patient> | undefined, delegates: ArrayWithUniqueKeys<{
35
+ delegate: EntityReferenceInGroup;
36
+ delegateOptions: TopicDelegateOptions;
37
+ }, 'delegate'>, options?: {
38
+ user?: User | undefined;
39
+ secretId?: SecretIdUseOption;
40
+ alternateRootDelegateId?: string | undefined;
41
+ }): Promise<GroupScoped<DecryptedTopic>>;
29
42
  /**
30
43
  *
31
44
  * In-group version of [TopicApi.getEncryptionKeysOf]
package/api/UserApi.d.mts CHANGED
@@ -84,6 +84,16 @@ export interface UserApi {
84
84
  * that is modifying the user tokens when performing the request.
85
85
  */
86
86
  modifyUserMobilePhone(userId: string, newMobilePhone: string, previousMobilePhone: string | undefined): Promise<User>;
87
+ /**
88
+ *
89
+ * Removes a user mobile phone given its previous value, throwing a [RevisionConflictException] if the provided
90
+ * [previousMobilePhone] does not match the stored value.
91
+ *
92
+ * This method should be favored over a simple [modifyUser] when changing the MobilePhone as it does not require knowing
93
+ * the revision of the user directly, and can work even if there is a [com.icure.cardinal.sdk.auth.services.SmartAuthProvider]
94
+ * that is modifying the user tokens when performing the request.
95
+ */
96
+ removeUserMobilePhone(userId: string, previousMobilePhone: string | undefined): Promise<User>;
87
97
  /**
88
98
  *
89
99
  * Deletes a user. If you don't have write access to the user the method will fail.
@@ -237,25 +237,6 @@ export declare namespace InternalCalendarItemFiltersObj {
237
237
  }
238
238
  }
239
239
  }
240
- export declare abstract class InternalClassificationFiltersObj {
241
- static readonly getInstance: () => typeof InternalClassificationFiltersObj.$metadata$.type;
242
- private constructor();
243
- }
244
- export declare namespace InternalClassificationFiltersObj {
245
- /** @deprecated $metadata$ is used for internal purposes, please don't use it in your code, because it can be removed at any moment */
246
- namespace $metadata$ {
247
- abstract class type extends KtSingleton<constructor>() {
248
- private constructor();
249
- }
250
- abstract class constructor {
251
- byPatientsCreatedForDataOwner(dataOwnerId: string, patients: Array<model.Patient>, options: any): SortableFilterOptions<model.Classification>;
252
- byPatientsCreatedForSelf(patients: Array<model.Patient>, options: any): SortableFilterOptions<model.Classification>;
253
- byPatientSecretIdsCreatedForDataOwner(dataOwnerId: string, secretIds: Array<string>, options: any): BaseSortableFilterOptions<model.Classification>;
254
- byPatientSecretIdsCreatedForSelf(secretIds: Array<string>, options: any): SortableFilterOptions<model.Classification>;
255
- private constructor();
256
- }
257
- }
258
- }
259
240
  export declare abstract class InternalCodeFiltersObj {
260
241
  static readonly getInstance: () => typeof InternalCodeFiltersObj.$metadata$.type;
261
242
  private constructor();