@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,4 +1,5 @@
1
1
  import { FilterOptions, PaginatedListIterator, SortableFilterOptions } from '../cardinal-sdk-ts.mjs';
2
+ import { AccessLogDelegateOptions } from '../crypto/entities/AccessLogDelegateOptions.mjs';
2
3
  import { AccessLogShareOptions } from '../crypto/entities/AccessLogShareOptions.mjs';
3
4
  import { SecretIdUseOption } from '../crypto/entities/SecretIdUseOption.mjs';
4
5
  import { AccessLog, DecryptedAccessLog, EncryptedAccessLog } from '../model/AccessLog.mjs';
@@ -27,7 +28,8 @@ export interface AccessLogApi {
27
28
  * @return an access log with initialized encryption metadata.
28
29
  * @throws IllegalArgumentException if base is not null and has a revision or has encryption metadata.
29
30
  */
30
- withEncryptionMetadata(base: DecryptedAccessLog | undefined, patient: Patient, options?: {
31
+ withEncryptionMetadata(base: DecryptedAccessLog | undefined, options?: {
32
+ patient?: Patient | undefined;
31
33
  user?: User | undefined;
32
34
  delegates?: {
33
35
  [key: string]: AccessLevel;
@@ -35,6 +37,29 @@ export interface AccessLogApi {
35
37
  secretId?: SecretIdUseOption;
36
38
  alternateRootDelegateId?: string | undefined;
37
39
  }): Promise<DecryptedAccessLog>;
40
+ /**
41
+ *
42
+ * Creates a new access log with initialized encryption metadata, specifying fine-grained options for each additional data owner that
43
+ * will have access to the entity.
44
+ * @param base an access log with initialized content and uninitialized encryption metadata. The result of this
45
+ * method takes the content from [base] if provided.
46
+ * @param patient the patient linked to the access log.
47
+ * @param user the current user, will be used for the auto-delegations if provided.
48
+ * @param delegates additional data owners that will have access to the newly created entity. You may choose the
49
+ * permissions that the delegates will have on the entity and if they will have access to the secretIds, encryptionKeys, and/or
50
+ * owningEntityIds of the new entity.
51
+ * @param secretId specifies which secret id of [patient] to use for the new access log
52
+ * @return an access log with initialized encryption metadata.
53
+ * @throws IllegalArgumentException if base is not null and has a revision or has encryption metadata.
54
+ */
55
+ withEncryptionMetadataAndDelegates(base: DecryptedAccessLog | undefined, delegates: {
56
+ [key: string]: AccessLogDelegateOptions;
57
+ }, options?: {
58
+ patient?: Patient | undefined;
59
+ user?: User | undefined;
60
+ secretId?: SecretIdUseOption;
61
+ alternateRootDelegateId?: string | undefined;
62
+ }): Promise<DecryptedAccessLog>;
38
63
  /**
39
64
  *
40
65
  * Attempts to extract the encryption keys of an access log. If the user does not have access to any encryption key
@@ -1,4 +1,5 @@
1
1
  import { FilterOptions, SortableFilterOptions } from '../cardinal-sdk-ts.mjs';
2
+ import { AccessLogDelegateOptions } from '../crypto/entities/AccessLogDelegateOptions.mjs';
2
3
  import { SecretIdUseOption } from '../crypto/entities/SecretIdUseOption.mjs';
3
4
  import { AccessLog, DecryptedAccessLog, EncryptedAccessLog } from '../model/AccessLog.mjs';
4
5
  import { EntityReferenceInGroup } from '../model/EntityReferenceInGroup.mjs';
@@ -17,7 +18,8 @@ export interface AccessLogInGroupApi {
17
18
  *
18
19
  * In-group version of [AccessLogApi.withEncryptionMetadata]
19
20
  */
20
- withEncryptionMetadata(entityGroupId: string, base: DecryptedAccessLog | undefined, patient: GroupScoped<Patient>, options?: {
21
+ withEncryptionMetadata(entityGroupId: string, base: DecryptedAccessLog | undefined, options?: {
22
+ patient?: GroupScoped<Patient> | undefined;
21
23
  user?: User | undefined;
22
24
  delegates?: ArrayWithUniqueKeys<{
23
25
  delegate: EntityReferenceInGroup;
@@ -26,6 +28,19 @@ export interface AccessLogInGroupApi {
26
28
  secretId?: SecretIdUseOption;
27
29
  alternateRootDelegateReference?: EntityReferenceInGroup | undefined;
28
30
  }): Promise<GroupScoped<DecryptedAccessLog>>;
31
+ /**
32
+ *
33
+ * In-group version of [AccessLogApi.withEncryptionMetadataAndDelegates]
34
+ */
35
+ withEncryptionMetadataAndDelegates(entityGroupId: string, base: DecryptedAccessLog | undefined, delegates: ArrayWithUniqueKeys<{
36
+ delegate: EntityReferenceInGroup;
37
+ delegateOptions: AccessLogDelegateOptions;
38
+ }, 'delegate'>, options?: {
39
+ patient?: GroupScoped<Patient> | undefined;
40
+ user?: User | undefined;
41
+ secretId?: SecretIdUseOption;
42
+ alternateRootDelegateReference?: EntityReferenceInGroup | undefined;
43
+ }): Promise<GroupScoped<DecryptedAccessLog>>;
29
44
  /**
30
45
  *
31
46
  * In-group version of [AccessLogApi.getEncryptionKeysOf]
@@ -1,4 +1,5 @@
1
1
  import { FilterOptions, PaginatedListIterator, SortableFilterOptions } from '../cardinal-sdk-ts.mjs';
2
+ import { CalendarItemDelegateOptions } from '../crypto/entities/CalendarItemDelegateOptions.mjs';
2
3
  import { CalendarItemShareOptions } from '../crypto/entities/CalendarItemShareOptions.mjs';
3
4
  import { SecretIdUseOption } from '../crypto/entities/SecretIdUseOption.mjs';
4
5
  import { CalendarItem, DecryptedCalendarItem, EncryptedCalendarItem } from '../model/CalendarItem.mjs';
@@ -41,6 +42,30 @@ export interface CalendarItemApi {
41
42
  secretId?: SecretIdUseOption;
42
43
  alternateRootDelegateId?: string | undefined;
43
44
  }): Promise<DecryptedCalendarItem>;
45
+ /**
46
+ *
47
+ * Creates a new calendar item entity with initialized encryption metadata, specifying fine-grained options for each additional data owner that
48
+ * will have access to the entity.
49
+ * NOTE: this method doesn't send the entity to the backend, to store it you will need to pass the entity to the
50
+ * [createCalendarItem] method.
51
+ * @param base a calendar item with initialized content and uninitialized encryption metadata. The result of this
52
+ * method takes the content from [base] if provided.
53
+ * @param patient the patient linked to the calendar item.
54
+ * @param user the current user, will be used for the auto-delegations if provided.
55
+ * @param delegates additional data owners that will have access to the newly created entity. You may choose the
56
+ * permissions that the delegates will have on the entity and if they will have access to the secretIds, encryptionKeys, and/or
57
+ * owningEntityIds of the new entity.
58
+ * @param secretId specifies which secret id of [patient] to use for the new calendar item
59
+ * @return a calendar item with initialized encryption metadata.
60
+ * @throws IllegalArgumentException if base is not null and has a revision or has encryption metadata.
61
+ */
62
+ withEncryptionMetadataAndDelegates(base: DecryptedCalendarItem | undefined, patient: Patient | undefined, delegates: {
63
+ [key: string]: CalendarItemDelegateOptions;
64
+ }, options?: {
65
+ user?: User | undefined;
66
+ secretId?: SecretIdUseOption;
67
+ alternateRootDelegateId?: string | undefined;
68
+ }): Promise<DecryptedCalendarItem>;
44
69
  /**
45
70
  *
46
71
  * Attempts to extract the encryption keys of a calendar item. If the user does not have access to any encryption key
@@ -1,4 +1,5 @@
1
1
  import { FilterOptions, PaginatedListIterator, SortableFilterOptions } from '../cardinal-sdk-ts.mjs';
2
+ import { CalendarItemDelegateOptions } from '../crypto/entities/CalendarItemDelegateOptions.mjs';
2
3
  import { CalendarItemShareOptions } from '../crypto/entities/CalendarItemShareOptions.mjs';
3
4
  import { SecretIdUseOption } from '../crypto/entities/SecretIdUseOption.mjs';
4
5
  import { CalendarItem, DecryptedCalendarItem, EncryptedCalendarItem } from '../model/CalendarItem.mjs';
@@ -28,6 +29,17 @@ export interface CalendarItemInGroupApi {
28
29
  secretId?: SecretIdUseOption;
29
30
  alternateRootDelegateReference?: EntityReferenceInGroup | undefined;
30
31
  }): Promise<GroupScoped<DecryptedCalendarItem>>;
32
+ /**
33
+ *
34
+ * In-group version of [CalendarItemApi.withEncryptionMetadataAndDelegates]
35
+ */
36
+ withEncryptionMetadataAndDelegates(entityGroupId: string, base: DecryptedCalendarItem | undefined, patient: GroupScoped<Patient> | undefined, delegates: ArrayWithUniqueKeys<{
37
+ delegate: EntityReferenceInGroup;
38
+ delegateOptions: CalendarItemDelegateOptions;
39
+ }, 'delegate'>, user: User | undefined, options?: {
40
+ secretId?: SecretIdUseOption;
41
+ alternateRootDelegateReference?: EntityReferenceInGroup | undefined;
42
+ }): Promise<GroupScoped<DecryptedCalendarItem>>;
31
43
  /**
32
44
  *
33
45
  * In-group version of [CalendarItemApi.getEncryptionKeysOf]
@@ -1,4 +1,5 @@
1
1
  import { FilterOptions, PaginatedListIterator, SortableFilterOptions } from '../cardinal-sdk-ts.mjs';
2
+ import { ContactDelegateOptions } from '../crypto/entities/ContactDelegateOptions.mjs';
2
3
  import { ContactShareOptions } from '../crypto/entities/ContactShareOptions.mjs';
3
4
  import { SecretIdUseOption } from '../crypto/entities/SecretIdUseOption.mjs';
4
5
  import { Contact, DecryptedContact, EncryptedContact } from '../model/Contact.mjs';
@@ -88,6 +89,28 @@ export interface ContactApi {
88
89
  secretId?: SecretIdUseOption;
89
90
  alternateRootDelegateId?: string | undefined;
90
91
  }): Promise<DecryptedContact>;
92
+ /**
93
+ *
94
+ * Creates a new contact with initialized encryption metadata, specifying fine-grained options for each additional data owner that
95
+ * will have access to the entity.
96
+ * @param base a contact with initialized content and uninitialized encryption metadata. The result of this
97
+ * method takes the content from [base] if provided.
98
+ * @param patient the patient linked to the contact.
99
+ * @param user the current user, will be used for the auto-delegations if provided.
100
+ * @param delegates additional data owners that will have access to the newly created entity. You may choose the
101
+ * permissions that the delegates will have on the entity and if they will have access to the secretIds, encryptionKeys, and/or
102
+ * owningEntityIds of the new entity.
103
+ * @param secretId specifies which secret id of [patient] to use for the new contact
104
+ * @return a contact with initialized encryption metadata.
105
+ * @throws IllegalArgumentException if base is not null and has a revision or has encryption metadata.
106
+ */
107
+ withEncryptionMetadataAndDelegates(base: DecryptedContact | undefined, patient: Patient, delegates: {
108
+ [key: string]: ContactDelegateOptions;
109
+ }, options?: {
110
+ user?: User | undefined;
111
+ secretId?: SecretIdUseOption;
112
+ alternateRootDelegateId?: string | undefined;
113
+ }): Promise<DecryptedContact>;
91
114
  /**
92
115
  *
93
116
  * Attempts to extract the encryption keys of a contact. If the user does not have access to any encryption key
@@ -1,4 +1,5 @@
1
1
  import { FilterOptions, PaginatedListIterator, SortableFilterOptions } from '../cardinal-sdk-ts.mjs';
2
+ import { ContactDelegateOptions } from '../crypto/entities/ContactDelegateOptions.mjs';
2
3
  import { ContactShareOptions } from '../crypto/entities/ContactShareOptions.mjs';
3
4
  import { SecretIdUseOption } from '../crypto/entities/SecretIdUseOption.mjs';
4
5
  import { Contact, DecryptedContact, EncryptedContact } from '../model/Contact.mjs';
@@ -28,6 +29,18 @@ export interface ContactInGroupApi {
28
29
  secretId?: SecretIdUseOption;
29
30
  alternateRootDelegateReference?: EntityReferenceInGroup | undefined;
30
31
  }): Promise<GroupScoped<DecryptedContact>>;
32
+ /**
33
+ *
34
+ * In-group version of [ContactApi.withEncryptionMetadataAndDelegates]
35
+ */
36
+ withEncryptionMetadataAndDelegates(entityGroupId: string, base: DecryptedContact | undefined, patient: GroupScoped<Patient> | undefined, delegates: ArrayWithUniqueKeys<{
37
+ delegate: EntityReferenceInGroup;
38
+ delegateOptions: ContactDelegateOptions;
39
+ }, 'delegate'>, options?: {
40
+ user?: User | undefined;
41
+ secretId?: SecretIdUseOption;
42
+ alternateRootDelegateReference?: EntityReferenceInGroup | undefined;
43
+ }): Promise<GroupScoped<DecryptedContact>>;
31
44
  /**
32
45
  *
33
46
  * In-group version of [ContactApi.getEncryptionKeysOf]
@@ -1,4 +1,5 @@
1
1
  import { FilterOptions, PaginatedListIterator, SortableFilterOptions } from '../cardinal-sdk-ts.mjs';
2
+ import { DocumentDelegateOptions } from '../crypto/entities/DocumentDelegateOptions.mjs';
2
3
  import { DocumentShareOptions } from '../crypto/entities/DocumentShareOptions.mjs';
3
4
  import { SecretIdUseOption } from '../crypto/entities/SecretIdUseOption.mjs';
4
5
  import { DecryptedDocument, Document, EncryptedDocument } from '../model/Document.mjs';
@@ -38,7 +39,29 @@ export interface DocumentApi {
38
39
  }): Promise<DecryptedDocument>;
39
40
  /**
40
41
  *
41
- * Creates a new document with initialized encryption metadata
42
+ * Creates a new document with initialized encryption metadata, specifying fine-grained options for each additional data owner that
43
+ * will have access to the entity.
44
+ * @param base a document with initialized content and uninitialized encryption metadata. The result of this
45
+ * method takes the content from [base] if provided.
46
+ * @param message the message linked to the document, if any.
47
+ * @param user the current user, will be used for the auto-delegations if provided.
48
+ * @param delegates additional data owners that will have access to the newly created entity. You may choose the
49
+ * permissions that the delegates will have on the entity and if they will have access to the secretIds, encryptionKeys, and/or
50
+ * owningEntityIds of the new entity.
51
+ * @param secretId specifies which secret id of [message] to use for the new document
52
+ * @return a document with initialized encryption metadata.
53
+ * @throws IllegalArgumentException if base is not null and has a revision or has encryption metadata.
54
+ */
55
+ withEncryptionMetadataAndDelegatesLinkedToMessage(base: DecryptedDocument | undefined, message: Message, delegates: {
56
+ [key: string]: DocumentDelegateOptions;
57
+ }, options?: {
58
+ user?: User | undefined;
59
+ secretId?: SecretIdUseOption;
60
+ alternateRootDelegateId?: string | undefined;
61
+ }): Promise<DecryptedDocument>;
62
+ /**
63
+ *
64
+ * Creates a new document with initialized encryption metadata.
42
65
  * @param base a document with initialized content and uninitialized encryption metadata. The result of this
43
66
  * method takes the content from [base] if provided.
44
67
  * @param patient the patient linked to the patient, if any.
@@ -57,6 +80,27 @@ export interface DocumentApi {
57
80
  secretId?: SecretIdUseOption;
58
81
  alternateRootDelegateId?: string | undefined;
59
82
  }): Promise<DecryptedDocument>;
83
+ /**
84
+ *
85
+ * Creates a new document with initialized encryption metadata, specifying fine-grained options for each additional data owner that
86
+ * will have access to the entity.
87
+ * @param base a document with initialized content and uninitialized encryption metadata. The result of this
88
+ * method takes the content from [base] if provided.
89
+ * @param patient the patient linked to the patient, if any.
90
+ * @param delegates additional data owners that will have access to the newly created entity. You may choose the
91
+ * permissions that the delegates will have on the entity and if they will have access to the secretIds, encryptionKeys, and/or
92
+ * owningEntityIds of the new entity.
93
+ * @param secretId specifies which secret id of [Message] to use for the new document
94
+ * @return a document with initialized encryption metadata.
95
+ * @throws IllegalArgumentException if base is not null and has a revision or has encryption metadata.
96
+ */
97
+ withEncryptionMetadataAndDelegatesLinkedToPatient(base: DecryptedDocument | undefined, patient: Patient, delegates: {
98
+ [key: string]: DocumentDelegateOptions;
99
+ }, options?: {
100
+ user?: User | undefined;
101
+ secretId?: SecretIdUseOption;
102
+ alternateRootDelegateId?: string | undefined;
103
+ }): Promise<DecryptedDocument>;
60
104
  /**
61
105
  *
62
106
  * Creates a new document with initialized encryption metadata
@@ -75,6 +119,25 @@ export interface DocumentApi {
75
119
  };
76
120
  alternateRootDelegateId?: string | undefined;
77
121
  }): Promise<DecryptedDocument>;
122
+ /**
123
+ *
124
+ * Creates a new document with initialized encryption metadata, specifying fine-grained options for each additional data owner that
125
+ * will have access to the entity.
126
+ * @param base a document with initialized content and uninitialized encryption metadata. The result of this
127
+ * method takes the content from [base] if provided.
128
+ * @param user the current user, will be used for the auto-delegations if provided.
129
+ * @param delegates additional data owners that will have access to the newly created entity. You may choose the
130
+ * permissions that the delegates will have on the entity and if they will have access to the secretIds, encryptionKeys, and/or
131
+ * owningEntityIds of the new entity.
132
+ * @return a document with initialized encryption metadata.
133
+ * @throws IllegalArgumentException if base is not null and has a revision or has encryption metadata.
134
+ */
135
+ withEncryptionMetadataAndDelegatesUnlinked(base: DecryptedDocument | undefined, delegates: {
136
+ [key: string]: DocumentDelegateOptions;
137
+ }, options?: {
138
+ user?: User | undefined;
139
+ alternateRootDelegateId?: string | undefined;
140
+ }): Promise<DecryptedDocument>;
78
141
  /**
79
142
  *
80
143
  * Retrieves and tries to decrypt the main attachment of a document.
@@ -1,4 +1,5 @@
1
1
  import { FilterOptions, PaginatedListIterator, SortableFilterOptions } from '../cardinal-sdk-ts.mjs';
2
+ import { DocumentDelegateOptions } from '../crypto/entities/DocumentDelegateOptions.mjs';
2
3
  import { DocumentShareOptions } from '../crypto/entities/DocumentShareOptions.mjs';
3
4
  import { SecretIdUseOption } from '../crypto/entities/SecretIdUseOption.mjs';
4
5
  import { DecryptedDocument, Document, EncryptedDocument } from '../model/Document.mjs';
@@ -27,6 +28,17 @@ export interface DocumentInGroupApi {
27
28
  secretId?: SecretIdUseOption;
28
29
  alternateRootDelegateId?: string | undefined;
29
30
  }): Promise<GroupScoped<DecryptedDocument>>;
31
+ /**
32
+ *
33
+ * In-group version of [DocumentApi.withEncryptionMetadataAndDelegatesLinkedToMessage]
34
+ */
35
+ withEncryptionMetadataAndDelegatesLinkedToMessage(entityGroupId: string, base: DecryptedDocument | undefined, message: GroupScoped<Message>, delegates: {
36
+ [key: string]: DocumentDelegateOptions;
37
+ }, options?: {
38
+ user?: User | undefined;
39
+ secretId?: SecretIdUseOption;
40
+ alternateRootDelegateId?: string | undefined;
41
+ }): Promise<GroupScoped<DecryptedDocument>>;
30
42
  /**
31
43
  *
32
44
  * In-group version of [DocumentApi.withEncryptionMetadataLinkedToPatient]
@@ -39,6 +51,17 @@ export interface DocumentInGroupApi {
39
51
  secretId?: SecretIdUseOption;
40
52
  alternateRootDelegateId?: string | undefined;
41
53
  }): Promise<GroupScoped<DecryptedDocument>>;
54
+ /**
55
+ *
56
+ * In-group version of [DocumentApi.withEncryptionMetadataAndDelegatesLinkedToPatient]
57
+ */
58
+ withEncryptionMetadataAndDelegatesLinkedToPatient(entityGroupId: string, base: DecryptedDocument | undefined, patient: GroupScoped<Patient>, delegates: {
59
+ [key: string]: DocumentDelegateOptions;
60
+ }, options?: {
61
+ user?: User | undefined;
62
+ secretId?: SecretIdUseOption;
63
+ alternateRootDelegateId?: string | undefined;
64
+ }): Promise<GroupScoped<DecryptedDocument>>;
42
65
  /**
43
66
  *
44
67
  * In-group version of [DocumentApi.withEncryptionMetadataUnlinked]
@@ -50,6 +73,16 @@ export interface DocumentInGroupApi {
50
73
  };
51
74
  alternateRootDelegateId?: string | undefined;
52
75
  }): Promise<GroupScoped<DecryptedDocument>>;
76
+ /**
77
+ *
78
+ * In-group version of [DocumentApi.withEncryptionMetadataAndDelegatesUnlinked]
79
+ */
80
+ withEncryptionMetadataAndDelegatesUnlinked(entityGroupId: string, base: DecryptedDocument | undefined, delegates: {
81
+ [key: string]: DocumentDelegateOptions;
82
+ }, options?: {
83
+ user?: User | undefined;
84
+ alternateRootDelegateId?: string | undefined;
85
+ }): Promise<GroupScoped<DecryptedDocument>>;
53
86
  /**
54
87
  *
55
88
  * In-group version of [DocumentApi.getEncryptionKeysOf]
package/api/FormApi.d.mts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { BaseFilterOptions, FilterOptions, PaginatedListIterator, SortableFilterOptions } from '../cardinal-sdk-ts.mjs';
2
+ import { FormDelegateOptions } from '../crypto/entities/FormDelegateOptions.mjs';
2
3
  import { FormShareOptions } from '../crypto/entities/FormShareOptions.mjs';
3
4
  import { SecretIdUseOption } from '../crypto/entities/SecretIdUseOption.mjs';
4
5
  import { EntityReferenceInGroup } from '../model/EntityReferenceInGroup.mjs';
@@ -17,7 +18,7 @@ export interface FormApi {
17
18
  inGroup: FormInGroupApi;
18
19
  /**
19
20
  *
20
- * Creates a new form with initialized encryption metadata
21
+ * Creates a new form with initialized encryption metadata.
21
22
  * @param base a form with initialized content and uninitialized encryption metadata. The result of this
22
23
  * method takes the content from [base] if provided.
23
24
  * @param patient the patient linked to the form.
@@ -36,12 +37,34 @@ export interface FormApi {
36
37
  secretId?: SecretIdUseOption;
37
38
  alternateRootDelegateId?: string | undefined;
38
39
  }): Promise<DecryptedForm>;
40
+ /**
41
+ *
42
+ * Creates a new access log with initialized encryption metadata, specifying fine-grained options for each additional data owner that
43
+ * will have access to the entity.
44
+ * @param base a form with initialized content and uninitialized encryption metadata. The result of this
45
+ * method takes the content from [base] if provided.
46
+ * @param patient the patient linked to the form.
47
+ * @param user the current user, will be used for the auto-delegations if provided.
48
+ * @param delegates additional data owners that will have access to the newly created entity. You may choose the
49
+ * permissions that the delegates will have on the entity and if they will have access to the secretIds, encryptionKeys, and/or
50
+ * owningEntityIds of the new entity.
51
+ * @param secretId specifies which secret id of [patient] to use for the new form
52
+ * @return a form with initialized encryption metadata.
53
+ * @throws IllegalArgumentException if base is not null and has a revision or has encryption metadata.
54
+ */
55
+ withEncryptionMetadataAndDelegates(base: DecryptedForm | undefined, patient: Patient, delegates: {
56
+ [key: string]: FormDelegateOptions;
57
+ }, options?: {
58
+ user?: User | undefined;
59
+ secretId?: SecretIdUseOption;
60
+ alternateRootDelegateId?: string | undefined;
61
+ }): Promise<DecryptedForm>;
39
62
  /**
40
63
  *
41
64
  * Attempts to extract the encryption keys of a form. If the user does not have access to any encryption key
42
65
  * of the access log the method will return an empty set.
43
66
  * Note: entities now have only one encryption key, but this method returns a set for compatibility with older
44
- * versions of iCure where this was not a guarantee.
67
+ * versions of Cardinal where this was not a guarantee.
45
68
  * @param form a form
46
69
  * @return the encryption keys extracted from the provided form.
47
70
  */
@@ -1,4 +1,5 @@
1
1
  import { BaseFilterOptions, FilterOptions, PaginatedListIterator, SortableFilterOptions } from '../cardinal-sdk-ts.mjs';
2
+ import { FormDelegateOptions } from '../crypto/entities/FormDelegateOptions.mjs';
2
3
  import { FormShareOptions } from '../crypto/entities/FormShareOptions.mjs';
3
4
  import { SecretIdUseOption } from '../crypto/entities/SecretIdUseOption.mjs';
4
5
  import { EntityReferenceInGroup } from '../model/EntityReferenceInGroup.mjs';
@@ -28,6 +29,18 @@ export interface FormInGroupApi {
28
29
  secretId?: SecretIdUseOption;
29
30
  alternateRootDelegateReference?: EntityReferenceInGroup | undefined;
30
31
  }): Promise<GroupScoped<DecryptedForm>>;
32
+ /**
33
+ *
34
+ * In-group version of [FormApi.withEncryptionMetadataAndDelegates]
35
+ */
36
+ withEncryptionMetadataAndDelegates(entityGroupId: string, base: DecryptedForm | undefined, patient: GroupScoped<Patient> | undefined, delegates: ArrayWithUniqueKeys<{
37
+ delegate: EntityReferenceInGroup;
38
+ delegateOptions: FormDelegateOptions;
39
+ }, 'delegate'>, options?: {
40
+ user?: User | undefined;
41
+ secretId?: SecretIdUseOption;
42
+ alternateRootDelegateReference?: EntityReferenceInGroup | undefined;
43
+ }): Promise<GroupScoped<DecryptedForm>>;
31
44
  /**
32
45
  *
33
46
  * In-group version of [FormApi.getEncryptionKeysOf]
@@ -1,4 +1,5 @@
1
1
  import { FilterOptions, PaginatedListIterator, SortableFilterOptions } from '../cardinal-sdk-ts.mjs';
2
+ import { HealthElementDelegateOptions } from '../crypto/entities/HealthElementDelegateOptions.mjs';
2
3
  import { HealthElementShareOptions } from '../crypto/entities/HealthElementShareOptions.mjs';
3
4
  import { SecretIdUseOption } from '../crypto/entities/SecretIdUseOption.mjs';
4
5
  import { EntityReferenceInGroup } from '../model/EntityReferenceInGroup.mjs';
@@ -19,7 +20,7 @@ export interface HealthElementApi {
19
20
  inGroup: HealthElementInGroupApi;
20
21
  /**
21
22
  *
22
- * Creates a new health element with initialized encryption metadata
23
+ * Creates a new health element with initialized encryption metadata.
23
24
  * @param base a health element with initialized content and uninitialized encryption metadata. The result of this
24
25
  * method takes the content from [base] if provided.
25
26
  * @param patient the patient linked to the health element.
@@ -38,6 +39,28 @@ export interface HealthElementApi {
38
39
  secretId?: SecretIdUseOption;
39
40
  alternateRootDelegateId?: string | undefined;
40
41
  }): Promise<DecryptedHealthElement>;
42
+ /**
43
+ *
44
+ * Creates a new access log with initialized encryption metadata, specifying fine-grained options for each additional data owner that
45
+ * will have access to the entity.
46
+ * @param base a health element with initialized content and uninitialized encryption metadata. The result of this
47
+ * method takes the content from [base] if provided.
48
+ * @param patient the patient linked to the health element.
49
+ * @param user the current user, will be used for the auto-delegations if provided.
50
+ * @param delegates additional data owners that will have access to the newly created entity. You may choose the
51
+ * permissions that the delegates will have on the entity and if they will have access to the secretIds, encryptionKeys, and/or
52
+ * owningEntityIds of the new entity.
53
+ * @param secretId specifies which secret id of [patient] to use for the new health element
54
+ * @return a health element with initialized encryption metadata.
55
+ * @throws IllegalArgumentException if base is not null and has a revision or has encryption metadata.
56
+ */
57
+ withEncryptionMetadataAndDelegates(base: DecryptedHealthElement | undefined, patient: Patient, delegates: {
58
+ [key: string]: HealthElementDelegateOptions;
59
+ }, options?: {
60
+ user?: User | undefined;
61
+ secretId?: SecretIdUseOption;
62
+ alternateRootDelegateId?: string | undefined;
63
+ }): Promise<DecryptedHealthElement>;
41
64
  /**
42
65
  *
43
66
  * Attempts to extract the encryption keys of a health element. If the user does not have access to any encryption key
@@ -1,4 +1,5 @@
1
1
  import { FilterOptions, PaginatedListIterator, SortableFilterOptions } from '../cardinal-sdk-ts.mjs';
2
+ import { HealthElementDelegateOptions } from '../crypto/entities/HealthElementDelegateOptions.mjs';
2
3
  import { HealthElementShareOptions } from '../crypto/entities/HealthElementShareOptions.mjs';
3
4
  import { SecretIdUseOption } from '../crypto/entities/SecretIdUseOption.mjs';
4
5
  import { EntityReferenceInGroup } from '../model/EntityReferenceInGroup.mjs';
@@ -27,6 +28,18 @@ export interface HealthElementInGroupApi {
27
28
  secretId?: SecretIdUseOption;
28
29
  alternateRootDelegateReference?: EntityReferenceInGroup | undefined;
29
30
  }): Promise<GroupScoped<DecryptedHealthElement>>;
31
+ /**
32
+ *
33
+ * In-group version of [HealthElementApi.withEncryptionMetadataAndDelegates]
34
+ */
35
+ withEncryptionMetadataAndDelegates(entityGroupId: string, base: DecryptedHealthElement | undefined, patient: GroupScoped<Patient>, delegates: ArrayWithUniqueKeys<{
36
+ delegate: EntityReferenceInGroup;
37
+ delegateOptions: HealthElementDelegateOptions;
38
+ }, 'delegate'>, options?: {
39
+ user?: User | undefined;
40
+ secretId?: SecretIdUseOption;
41
+ alternateRootDelegateReference?: EntityReferenceInGroup | undefined;
42
+ }): Promise<GroupScoped<DecryptedHealthElement>>;
30
43
  /**
31
44
  *
32
45
  * In-group version of [HealthElementApi.getEncryptionKeysOf]
@@ -1,4 +1,5 @@
1
1
  import { PaginatedListIterator } from '../cardinal-sdk-ts.mjs';
2
+ import { InvoiceDelegateOptions } from '../crypto/entities/InvoiceDelegateOptions.mjs';
2
3
  import { InvoiceShareOptions } from '../crypto/entities/InvoiceShareOptions.mjs';
3
4
  import { SecretIdUseOption } from '../crypto/entities/SecretIdUseOption.mjs';
4
5
  import { EntityReferenceInGroup } from '../model/EntityReferenceInGroup.mjs';
@@ -40,6 +41,28 @@ export interface InvoiceApi {
40
41
  secretId?: SecretIdUseOption;
41
42
  alternateRootDelegateId?: string | undefined;
42
43
  }): Promise<DecryptedInvoice>;
44
+ /**
45
+ *
46
+ * Creates a new access log with initialized encryption metadata, specifying fine-grained options for each additional data owner that
47
+ * will have access to the entity.
48
+ * @param base an invoice with initialized content and uninitialized encryption metadata. The result of this
49
+ * method takes the content from [base] if provided.
50
+ * @param patient the patient linked to the invoice.
51
+ * @param user the current user, will be used for the auto-delegations if provided.
52
+ * @param delegates additional data owners that will have access to the newly created entity. You may choose the
53
+ * permissions that the delegates will have on the entity and if they will have access to the secretIds, encryptionKeys, and/or
54
+ * owningEntityIds of the new entity.
55
+ * @param secretId specifies which secret id of [patient] to use for the new invoice
56
+ * @return an invoice with initialized encryption metadata.
57
+ * @throws IllegalArgumentException if base is not null and has a revision or has encryption metadata.
58
+ */
59
+ withEncryptionMetadataAndDelegates(base: DecryptedInvoice | undefined, patient: Patient | undefined, delegates: {
60
+ [key: string]: InvoiceDelegateOptions;
61
+ }, options?: {
62
+ user?: User | undefined;
63
+ secretId?: SecretIdUseOption;
64
+ alternateRootDelegateId?: string | undefined;
65
+ }): Promise<DecryptedInvoice>;
43
66
  /**
44
67
  *
45
68
  * Attempts to extract the encryption keys of an invoice. If the user does not have access to any encryption key
@@ -187,7 +210,7 @@ export interface InvoiceApi {
187
210
  /**
188
211
  *
189
212
  * Gives an approximation of the amount of times each tarification code ([Invoice.invoicingCodes] ->
190
- * [InvoicingCode.tarificationId]) is used in invoices where the current data owner is a direct delegate (does not
213
+ * [InvoicingCode.pricingId]) is used in invoices where the current data owner is a direct delegate (does not
191
214
  * count situations where the data owner has access to the service through delegations to a parent data owner).
192
215
  * This number is not exact, and may be cached, so you should not use this method if you need precise values, but
193
216
  * it can be useful if you want to give suggestions.
@@ -76,7 +76,7 @@ export interface InvoiceBasicApi {
76
76
  /**
77
77
  *
78
78
  * Gives an approximation of the amount of times each tarification code ([Invoice.invoicingCodes] ->
79
- * [InvoicingCode.tarificationId]) is used in invoices where the current data owner is a direct delegate (does not
79
+ * [InvoicingCode.pricingId]) is used in invoices where the current data owner is a direct delegate (does not
80
80
  * count situations where the data owner has access to the service through delegations to a parent data owner).
81
81
  * This number is not exact, and may be cached, so you should not use this method if you need precise values, but
82
82
  * it can be useful if you want to give suggestions.
@@ -1,3 +1,4 @@
1
+ import { InvoiceDelegateOptions } from '../crypto/entities/InvoiceDelegateOptions.mjs';
1
2
  import { InvoiceShareOptions } from '../crypto/entities/InvoiceShareOptions.mjs';
2
3
  import { SecretIdUseOption } from '../crypto/entities/SecretIdUseOption.mjs';
3
4
  import { EntityReferenceInGroup } from '../model/EntityReferenceInGroup.mjs';
@@ -26,6 +27,18 @@ export interface InvoiceInGroupApi {
26
27
  secretId?: SecretIdUseOption;
27
28
  alternateRootDelegateReference?: EntityReferenceInGroup | undefined;
28
29
  }): Promise<GroupScoped<DecryptedInvoice>>;
30
+ /**
31
+ *
32
+ * In-group version of [InvoiceApi.withEncryptionMetadataAndDelegates]
33
+ */
34
+ withEncryptionMetadataAndDelegates(entityGroupId: string, base: DecryptedInvoice | undefined, patient: GroupScoped<Patient> | undefined, delegates: ArrayWithUniqueKeys<{
35
+ delegate: EntityReferenceInGroup;
36
+ delegateOptions: InvoiceDelegateOptions;
37
+ }, 'delegate'>, options?: {
38
+ user?: User | undefined;
39
+ secretId?: SecretIdUseOption;
40
+ alternateRootDelegateReference?: EntityReferenceInGroup | undefined;
41
+ }): Promise<GroupScoped<DecryptedInvoice>>;
29
42
  /**
30
43
  *
31
44
  * In-group version of [InvoiceApi.getEncryptionKeysOf]
@@ -1,4 +1,5 @@
1
1
  import { FilterOptions, PaginatedListIterator, SortableFilterOptions } from '../cardinal-sdk-ts.mjs';
2
+ import { MessageDelegateOptions } from '../crypto/entities/MessageDelegateOptions.mjs';
2
3
  import { MessageShareOptions } from '../crypto/entities/MessageShareOptions.mjs';
3
4
  import { SecretIdUseOption } from '../crypto/entities/SecretIdUseOption.mjs';
4
5
  import { EntityReferenceInGroup } from '../model/EntityReferenceInGroup.mjs';
@@ -38,12 +39,34 @@ export interface MessageApi {
38
39
  secretId?: SecretIdUseOption;
39
40
  alternateRootDelegateId?: string | undefined;
40
41
  }): Promise<DecryptedMessage>;
42
+ /**
43
+ *
44
+ * Creates a new access log with initialized encryption metadata, specifying fine-grained options for each additional data owner that
45
+ * will have access to the entity.
46
+ * @param base a message with initialized content and uninitialized encryption metadata. The result of this
47
+ * method takes the content from [base] if provided.
48
+ * @param patient the patient linked to the Message.
49
+ * @param user the current user, will be used for the auto-delegations if provided.
50
+ * @param delegates additional data owners that will have access to the newly created entity. You may choose the
51
+ * permissions that the delegates will have on the entity and if they will have access to the secretIds, encryptionKeys, and/or
52
+ * owningEntityIds of the new entity.
53
+ * @param secretId specifies which secret id of [patient] to use for the new Message
54
+ * @return a message with initialized encryption metadata.
55
+ * @throws IllegalArgumentException if base is not null and has a revision or has encryption metadata.
56
+ */
57
+ withEncryptionMetadataAndDelegates(base: DecryptedMessage | undefined, patient: Patient | undefined, delegates: {
58
+ [key: string]: MessageDelegateOptions;
59
+ }, options?: {
60
+ user?: User | undefined;
61
+ secretId?: SecretIdUseOption;
62
+ alternateRootDelegateId?: string | undefined;
63
+ }): Promise<DecryptedMessage>;
41
64
  /**
42
65
  *
43
66
  * Attempts to extract the encryption keys of a message. If the user does not have access to any encryption key
44
67
  * of the access log the method will return an empty set.
45
68
  * Note: entities now have only one encryption key, but this method returns a set for compatibility with older
46
- * versions of iCure where this was not a guarantee.
69
+ * versions of Cardinal where this was not a guarantee.
47
70
  * @param message a message
48
71
  * @return the encryption keys extracted from the provided Message.
49
72
  */
@@ -1,4 +1,5 @@
1
1
  import { FilterOptions, PaginatedListIterator, SortableFilterOptions } from '../cardinal-sdk-ts.mjs';
2
+ import { MessageDelegateOptions } from '../crypto/entities/MessageDelegateOptions.mjs';
2
3
  import { MessageShareOptions } from '../crypto/entities/MessageShareOptions.mjs';
3
4
  import { SecretIdUseOption } from '../crypto/entities/SecretIdUseOption.mjs';
4
5
  import { EntityReferenceInGroup } from '../model/EntityReferenceInGroup.mjs';
@@ -27,6 +28,18 @@ export interface MessageInGroupApi {
27
28
  secretId?: SecretIdUseOption;
28
29
  alternateRootDelegateReference?: EntityReferenceInGroup | undefined;
29
30
  }): Promise<GroupScoped<DecryptedMessage>>;
31
+ /**
32
+ *
33
+ * In-group version of [MessageApi.withEncryptionMetadataAndDelegates]
34
+ */
35
+ withEncryptionMetadataAndDelegates(entityGroupId: string, base: DecryptedMessage | undefined, patient: GroupScoped<Patient> | undefined, delegates: ArrayWithUniqueKeys<{
36
+ delegate: EntityReferenceInGroup;
37
+ delegateOptions: MessageDelegateOptions;
38
+ }, 'delegate'>, options?: {
39
+ user?: User | undefined;
40
+ secretId?: SecretIdUseOption;
41
+ alternateRootDelegateReference?: EntityReferenceInGroup | undefined;
42
+ }): Promise<GroupScoped<DecryptedMessage>>;
30
43
  /**
31
44
  *
32
45
  * In-group version of [MessageApi.getEncryptionKeysOf]