@icure/cardinal-sdk 2.4.4 → 2.5.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.
@@ -93,8 +93,8 @@ initMetadataForInterface(Entry, 'Entry');
93
93
  initMetadataForInterface(KtMap, 'Map');
94
94
  initMetadataForInterface(KtSet, 'Set', VOID, VOID, [Collection]);
95
95
  initMetadataForInterface(MutableIterable, 'MutableIterable');
96
- initMetadataForInterface(KtMutableList, 'MutableList', VOID, VOID, [KtList, Collection, MutableIterable]);
97
- initMetadataForInterface(KtMutableSet, 'MutableSet', VOID, VOID, [KtSet, Collection, MutableIterable]);
96
+ initMetadataForInterface(KtMutableList, 'MutableList', VOID, VOID, [KtList, MutableIterable, Collection]);
97
+ initMetadataForInterface(KtMutableSet, 'MutableSet', VOID, VOID, [KtSet, MutableIterable, Collection]);
98
98
  initMetadataForInterface(KtMutableMap, 'MutableMap', VOID, VOID, [KtMap]);
99
99
  initMetadataForCompanion(Companion_0);
100
100
  initMetadataForClass(Enum, 'Enum', VOID, VOID, [Comparable]);
@@ -115,7 +115,7 @@ initMetadataForInterface(AutoCloseable, 'AutoCloseable');
115
115
  initMetadataForInterface(Comparator, 'Comparator');
116
116
  initMetadataForObject(Unit, 'Unit');
117
117
  initMetadataForClass(AbstractCollection, 'AbstractCollection', VOID, VOID, [Collection]);
118
- initMetadataForClass(AbstractMutableCollection, 'AbstractMutableCollection', VOID, AbstractCollection, [Collection, MutableIterable]);
118
+ initMetadataForClass(AbstractMutableCollection, 'AbstractMutableCollection', VOID, AbstractCollection, [MutableIterable, Collection]);
119
119
  initMetadataForClass(IteratorImpl, 'IteratorImpl');
120
120
  initMetadataForClass(ListIteratorImpl, 'ListIteratorImpl', VOID, IteratorImpl);
121
121
  initMetadataForClass(AbstractMutableList, 'AbstractMutableList', VOID, AbstractMutableCollection, [KtMutableList]);
@@ -128,7 +128,7 @@ initMetadataForCompanion(Companion_2);
128
128
  initMetadataForClass(ArrayList, 'ArrayList', ArrayList_init_$Create$, AbstractMutableList, [KtMutableList, RandomAccess]);
129
129
  initMetadataForClass(HashMap, 'HashMap', HashMap_init_$Create$, AbstractMutableMap, [KtMutableMap]);
130
130
  initMetadataForClass(HashMapKeys, 'HashMapKeys', VOID, AbstractMutableSet, [KtMutableSet]);
131
- initMetadataForClass(HashMapValues, 'HashMapValues', VOID, AbstractMutableCollection, [Collection, MutableIterable]);
131
+ initMetadataForClass(HashMapValues, 'HashMapValues', VOID, AbstractMutableCollection, [MutableIterable, Collection]);
132
132
  initMetadataForClass(HashMapEntrySetBase, 'HashMapEntrySetBase', VOID, AbstractMutableSet, [KtMutableSet]);
133
133
  initMetadataForClass(HashMapEntrySet, 'HashMapEntrySet', VOID, HashMapEntrySetBase);
134
134
  initMetadataForClass(HashMapKeysDefault$iterator$1);
@@ -235,11 +235,6 @@ initMetadataForClass(BufferedChannelIterator, 'BufferedChannelIterator', VOID, V
235
235
  initMetadataForCoroutine($sendCOROUTINE$, CoroutineImpl);
236
236
  initMetadataForCoroutine($receiveCOROUTINE$, CoroutineImpl);
237
237
  initMetadataForCoroutine($receiveCatchingCOROUTINE$, CoroutineImpl);
238
- function close$default(cause, $super) {
239
- cause = cause === VOID ? null : cause;
240
- return $super === VOID ? this.s1d(cause) : $super.s1d.call(this, cause);
241
- }
242
- initMetadataForInterface(SendChannel, 'SendChannel', VOID, VOID, VOID, [1]);
243
238
  function cancel$default_0(cause, $super) {
244
239
  cause = cause === VOID ? null : cause;
245
240
  var tmp;
@@ -252,7 +247,12 @@ function cancel$default_0(cause, $super) {
252
247
  return tmp;
253
248
  }
254
249
  initMetadataForInterface(ReceiveChannel, 'ReceiveChannel', VOID, VOID, VOID, [0]);
255
- initMetadataForClass(BufferedChannel, 'BufferedChannel', VOID, VOID, [SendChannel, ReceiveChannel], [1, 4, 0, 3]);
250
+ function close$default(cause, $super) {
251
+ cause = cause === VOID ? null : cause;
252
+ return $super === VOID ? this.s1d(cause) : $super.s1d.call(this, cause);
253
+ }
254
+ initMetadataForInterface(SendChannel, 'SendChannel', VOID, VOID, VOID, [1]);
255
+ initMetadataForClass(BufferedChannel, 'BufferedChannel', VOID, VOID, [ReceiveChannel, SendChannel], [1, 4, 0, 3]);
256
256
  initMetadataForClass(WaiterEB, 'WaiterEB');
257
257
  initMetadataForClass(ReceiveCatching, 'ReceiveCatching', VOID, VOID, [Waiter]);
258
258
  initMetadataForObject(Factory, 'Factory');
@@ -262,7 +262,7 @@ initMetadataForCompanion(Companion);
262
262
  initMetadataForClass(ChannelResult, 'ChannelResult');
263
263
  initMetadataForClass(ClosedReceiveChannelException, 'ClosedReceiveChannelException', VOID, NoSuchElementException);
264
264
  initMetadataForClass(ClosedSendChannelException, 'ClosedSendChannelException', VOID, IllegalStateException);
265
- initMetadataForClass(ChannelCoroutine, 'ChannelCoroutine', VOID, AbstractCoroutine, [SendChannel, ReceiveChannel], [1, 0]);
265
+ initMetadataForClass(ChannelCoroutine, 'ChannelCoroutine', VOID, AbstractCoroutine, [ReceiveChannel, SendChannel], [1, 0]);
266
266
  initMetadataForClass(ConflatedBufferedChannel, 'ConflatedBufferedChannel', VOID, BufferedChannel, VOID, [1, 0]);
267
267
  initMetadataForInterface(ProducerScope, 'ProducerScope', VOID, VOID, [CoroutineScope, SendChannel], [1]);
268
268
  initMetadataForClass(ProducerCoroutine, 'ProducerCoroutine', VOID, ChannelCoroutine, [ProducerScope], [1, 0]);
@@ -8,11 +8,11 @@ import { ResourceGroupAllocationSchedule } from './embed/ResourceGroupAllocation
8
8
  import { UserAccessLevel } from './embed/UserAccessLevel.mjs';
9
9
  /**
10
10
  *
11
- * Represents an agenda that keeps track of appointments (calendar items) for a resource or group of
12
- * resources.
13
- * An agenda can specify a schedule for its resources and allows managing availabilities for
11
+ *
12
+ * Represents an agenda that keeps track of appointments (calendar items) for a resource or group
13
+ * of resources.
14
+ * An agenda can specify a schedule for its resources and allows managing availabilities for
14
15
  * booking.
15
- * /
16
16
  */
17
17
  export declare class Agenda implements StoredDocument, ICureDocument<string>, HasEndOfLife {
18
18
  /**
package/model/Agenda.mjs CHANGED
@@ -8,11 +8,11 @@ import { ResourceGroupAllocationSchedule } from './embed/ResourceGroupAllocation
8
8
  import { UserAccessLevel } from './embed/UserAccessLevel.mjs';
9
9
  /**
10
10
  *
11
- * Represents an agenda that keeps track of appointments (calendar items) for a resource or group of
12
- * resources.
13
- * An agenda can specify a schedule for its resources and allows managing availabilities for
11
+ *
12
+ * Represents an agenda that keeps track of appointments (calendar items) for a resource or group
13
+ * of resources.
14
+ * An agenda can specify a schedule for its resources and allows managing availabilities for
14
15
  * booking.
15
- * /
16
16
  */
17
17
  export class Agenda {
18
18
  constructor(partial) {
@@ -12,10 +12,10 @@ import { SecurityMetadata } from './embed/SecurityMetadata.mjs';
12
12
  import { Base64String } from './specializations/Base64String.mjs';
13
13
  /**
14
14
  *
15
- * Represents an appointment or event in a calendar. Calendar items are linked to an agenda and can
15
+ *
16
+ * Represents an appointment or event in a calendar. Calendar items are linked to an agenda and can
16
17
  * block
17
- * availabilities for scheduling purposes.
18
- * /
18
+ * availabilities for scheduling purposes.
19
19
  */
20
20
  export interface CalendarItem extends StoredDocument, ICureDocument<string>, HasEncryptionMetadata, Encryptable {
21
21
  /**
@@ -149,10 +149,10 @@ export interface CalendarItem extends StoredDocument, ICureDocument<string>, Has
149
149
  }
150
150
  /**
151
151
  *
152
- * Represents an appointment or event in a calendar. Calendar items are linked to an agenda and can
152
+ *
153
+ * Represents an appointment or event in a calendar. Calendar items are linked to an agenda and can
153
154
  * block
154
- * availabilities for scheduling purposes.
155
- * /
155
+ * availabilities for scheduling purposes.
156
156
  */
157
157
  export declare class DecryptedCalendarItem {
158
158
  /**
@@ -370,10 +370,10 @@ export declare class DecryptedCalendarItem {
370
370
  }
371
371
  /**
372
372
  *
373
- * Represents an appointment or event in a calendar. Calendar items are linked to an agenda and can
373
+ *
374
+ * Represents an appointment or event in a calendar. Calendar items are linked to an agenda and can
374
375
  * block
375
- * availabilities for scheduling purposes.
376
- * /
376
+ * availabilities for scheduling purposes.
377
377
  */
378
378
  export declare class EncryptedCalendarItem {
379
379
  /**
@@ -10,10 +10,10 @@ import { Delegation } from './embed/Delegation.mjs';
10
10
  import { SecurityMetadata } from './embed/SecurityMetadata.mjs';
11
11
  /**
12
12
  *
13
- * Represents an appointment or event in a calendar. Calendar items are linked to an agenda and can
13
+ *
14
+ * Represents an appointment or event in a calendar. Calendar items are linked to an agenda and can
14
15
  * block
15
- * availabilities for scheduling purposes.
16
- * /
16
+ * availabilities for scheduling purposes.
17
17
  */
18
18
  export class DecryptedCalendarItem {
19
19
  constructor(partial) {
@@ -432,10 +432,10 @@ export class DecryptedCalendarItem {
432
432
  }
433
433
  /**
434
434
  *
435
- * Represents an appointment or event in a calendar. Calendar items are linked to an agenda and can
435
+ *
436
+ * Represents an appointment or event in a calendar. Calendar items are linked to an agenda and can
436
437
  * block
437
- * availabilities for scheduling purposes.
438
- * /
438
+ * availabilities for scheduling purposes.
439
439
  */
440
440
  export class EncryptedCalendarItem {
441
441
  constructor(partial) {
package/model/Group.d.mts CHANGED
@@ -26,7 +26,7 @@ export declare class Group implements StoredDocument, HasTags {
26
26
  rev: string | undefined;
27
27
  /**
28
28
  *
29
- * Hard delete (unix epoch in ms) timestamp of the object.
29
+ * Soft delete (unix epoch in ms) timestamp of the object.
30
30
  */
31
31
  deletionDate: number | undefined;
32
32
  /**
package/model/Group.mjs CHANGED
@@ -24,7 +24,7 @@ export class Group {
24
24
  this.rev = undefined;
25
25
  /**
26
26
  *
27
- * Hard delete (unix epoch in ms) timestamp of the object.
27
+ * Soft delete (unix epoch in ms) timestamp of the object.
28
28
  */
29
29
  this.deletionDate = undefined;
30
30
  /**
@@ -14,7 +14,7 @@ import { DecryptedFinancialInstitutionInformation, EncryptedFinancialInstitution
14
14
  import { Gender } from './embed/Gender.mjs';
15
15
  import { DecryptedInsurability, EncryptedInsurability, Insurability } from './embed/Insurability.mjs';
16
16
  import { DecryptedMedicalHouseContract, EncryptedMedicalHouseContract, MedicalHouseContract } from './embed/MedicalHouseContract.mjs';
17
- import { Partnership } from './embed/Partnership.mjs';
17
+ import { DecryptedPartnership, EncryptedPartnership, Partnership } from './embed/Partnership.mjs';
18
18
  import { DecryptedPatientHealthCareParty, EncryptedPatientHealthCareParty, PatientHealthCareParty } from './embed/PatientHealthCareParty.mjs';
19
19
  import { PersonName } from './embed/PersonName.mjs';
20
20
  import { PersonalStatus } from './embed/PersonalStatus.mjs';
@@ -461,7 +461,7 @@ export declare class DecryptedPatient {
461
461
  *
462
462
  * List of partners, or persons of contact.
463
463
  */
464
- partnerships: Array<Partnership>;
464
+ partnerships: Array<DecryptedPartnership>;
465
465
  /**
466
466
  *
467
467
  * Links between this patient and healthcare parties.
@@ -829,7 +829,7 @@ export declare class EncryptedPatient {
829
829
  *
830
830
  * List of partners, or persons of contact.
831
831
  */
832
- partnerships: Array<Partnership>;
832
+ partnerships: Array<EncryptedPartnership>;
833
833
  /**
834
834
  *
835
835
  * Links between this patient and healthcare parties.
package/model/Patient.mjs CHANGED
@@ -11,7 +11,7 @@ import { DecryptedFinancialInstitutionInformation, EncryptedFinancialInstitution
11
11
  import { Gender } from './embed/Gender.mjs';
12
12
  import { DecryptedInsurability, EncryptedInsurability } from './embed/Insurability.mjs';
13
13
  import { DecryptedMedicalHouseContract, EncryptedMedicalHouseContract } from './embed/MedicalHouseContract.mjs';
14
- import { Partnership } from './embed/Partnership.mjs';
14
+ import { DecryptedPartnership, EncryptedPartnership } from './embed/Partnership.mjs';
15
15
  import { DecryptedPatientHealthCareParty, EncryptedPatientHealthCareParty } from './embed/PatientHealthCareParty.mjs';
16
16
  import { PersonName } from './embed/PersonName.mjs';
17
17
  import { PersonalStatus } from './embed/PersonalStatus.mjs';
@@ -652,7 +652,7 @@ export class DecryptedPatient {
652
652
  race: expectString(extractEntry(jCpy, 'race', false, path), true, [...path, ".race"]),
653
653
  ethnicity: expectString(extractEntry(jCpy, 'ethnicity', false, path), true, [...path, ".ethnicity"]),
654
654
  insurabilities: expectArray(extractEntry(jCpy, 'insurabilities', false, path), false, [...path, ".insurabilities"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, DecryptedInsurability.fromJSON)),
655
- partnerships: expectArray(extractEntry(jCpy, 'partnerships', false, path), false, [...path, ".partnerships"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, Partnership.fromJSON)),
655
+ partnerships: expectArray(extractEntry(jCpy, 'partnerships', false, path), false, [...path, ".partnerships"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, DecryptedPartnership.fromJSON)),
656
656
  patientHealthCareParties: expectArray(extractEntry(jCpy, 'patientHealthCareParties', false, path), false, [...path, ".patientHealthCareParties"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, DecryptedPatientHealthCareParty.fromJSON)),
657
657
  financialInstitutionInformation: expectArray(extractEntry(jCpy, 'financialInstitutionInformation', false, path), false, [...path, ".financialInstitutionInformation"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, DecryptedFinancialInstitutionInformation.fromJSON)),
658
658
  medicalHouseContracts: expectArray(extractEntry(jCpy, 'medicalHouseContracts', false, path), false, [...path, ".medicalHouseContracts"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, DecryptedMedicalHouseContract.fromJSON)),
@@ -1318,7 +1318,7 @@ export class EncryptedPatient {
1318
1318
  race: expectString(extractEntry(jCpy, 'race', false, path), true, [...path, ".race"]),
1319
1319
  ethnicity: expectString(extractEntry(jCpy, 'ethnicity', false, path), true, [...path, ".ethnicity"]),
1320
1320
  insurabilities: expectArray(extractEntry(jCpy, 'insurabilities', false, path), false, [...path, ".insurabilities"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, EncryptedInsurability.fromJSON)),
1321
- partnerships: expectArray(extractEntry(jCpy, 'partnerships', false, path), false, [...path, ".partnerships"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, Partnership.fromJSON)),
1321
+ partnerships: expectArray(extractEntry(jCpy, 'partnerships', false, path), false, [...path, ".partnerships"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, EncryptedPartnership.fromJSON)),
1322
1322
  patientHealthCareParties: expectArray(extractEntry(jCpy, 'patientHealthCareParties', false, path), false, [...path, ".patientHealthCareParties"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, EncryptedPatientHealthCareParty.fromJSON)),
1323
1323
  financialInstitutionInformation: expectArray(extractEntry(jCpy, 'financialInstitutionInformation', false, path), false, [...path, ".financialInstitutionInformation"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, EncryptedFinancialInstitutionInformation.fromJSON)),
1324
1324
  medicalHouseContracts: expectArray(extractEntry(jCpy, 'medicalHouseContracts', false, path), false, [...path, ".medicalHouseContracts"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, EncryptedMedicalHouseContract.fromJSON)),
package/model/Role.d.mts CHANGED
@@ -1,16 +1,16 @@
1
1
  import { StoredDocument } from './base/StoredDocument.mjs';
2
2
  /**
3
3
  *
4
- * The RoleDto class represents a role in the system, which can have permissions and can be
4
+ *
5
+ * The RoleDto class represents a role in the system, which can have permissions and can be
5
6
  * inheritable up to a certain level by users in child Groups.$
6
- * down the group hierarchy this role can be inherited by users in child groups. A value of 0 means
7
+ * down the group hierarchy this role can be inherited by users in child groups. A value of 0 means
7
8
  * it cannot be inherited, while a value of -1 means it can be inherited indefinitely.
8
- * /
9
9
  */
10
10
  export declare class Role implements StoredDocument {
11
11
  /**
12
12
  *
13
- * The unique identifier of the role.
13
+ * The unique identifier of the role. It is automatically set to <GROUP_ID>:<ROLE_NAME>
14
14
  */
15
15
  id: string;
16
16
  /**
@@ -25,12 +25,22 @@ export declare class Role implements StoredDocument {
25
25
  deletionDate: number | undefined;
26
26
  /**
27
27
  *
28
- * The name of the role.
28
+ * The name of the role. It can only contain uppercase letters, numbers, and underscores for a max
29
+ * length of 40 characters.
29
30
  */
30
31
  name: string | undefined;
31
32
  /**
32
33
  *
33
- * The maximum level of inheritance for this role, indicating how far
34
+ * A short description for the role. It cannot exceed 300 characters.
35
+ */
36
+ description: string | undefined;
37
+ /**
38
+ *
39
+ *
40
+ * Represents the levels in the descendant groups hierarchy where this role can be used. Eg:
41
+ * - null: all the users in the descendants of the group can use this role.
42
+ * - 0: only the users in the group can use this role.
43
+ * - 1: only the users in the group and in its children groups can use this role.
34
44
  */
35
45
  inheritableUpTo: number | undefined;
36
46
  /**
package/model/Role.mjs CHANGED
@@ -3,11 +3,11 @@ import { expectArray, expectNumber, expectString, extractEntry } from '../intern
3
3
  import { randomUuid } from '../utils/Id.mjs';
4
4
  /**
5
5
  *
6
- * The RoleDto class represents a role in the system, which can have permissions and can be
6
+ *
7
+ * The RoleDto class represents a role in the system, which can have permissions and can be
7
8
  * inheritable up to a certain level by users in child Groups.$
8
- * down the group hierarchy this role can be inherited by users in child groups. A value of 0 means
9
+ * down the group hierarchy this role can be inherited by users in child groups. A value of 0 means
9
10
  * it cannot be inherited, while a value of -1 means it can be inherited indefinitely.
10
- * /
11
11
  */
12
12
  export class Role {
13
13
  constructor(partial) {
@@ -24,12 +24,22 @@ export class Role {
24
24
  this.deletionDate = undefined;
25
25
  /**
26
26
  *
27
- * The name of the role.
27
+ * The name of the role. It can only contain uppercase letters, numbers, and underscores for a max
28
+ * length of 40 characters.
28
29
  */
29
30
  this.name = undefined;
30
31
  /**
31
32
  *
32
- * The maximum level of inheritance for this role, indicating how far
33
+ * A short description for the role. It cannot exceed 300 characters.
34
+ */
35
+ this.description = undefined;
36
+ /**
37
+ *
38
+ *
39
+ * Represents the levels in the descendant groups hierarchy where this role can be used. Eg:
40
+ * - null: all the users in the descendants of the group can use this role.
41
+ * - 0: only the users in the group can use this role.
42
+ * - 1: only the users in the group and in its children groups can use this role.
33
43
  */
34
44
  this.inheritableUpTo = undefined;
35
45
  /**
@@ -45,6 +55,8 @@ export class Role {
45
55
  this.deletionDate = partial.deletionDate;
46
56
  if ('name' in partial)
47
57
  this.name = partial.name;
58
+ if ('description' in partial)
59
+ this.description = partial.description;
48
60
  if ('inheritableUpTo' in partial)
49
61
  this.inheritableUpTo = partial.inheritableUpTo;
50
62
  if ('permissions' in partial && partial.permissions !== undefined)
@@ -59,6 +71,8 @@ export class Role {
59
71
  res['deletionDate'] = this.deletionDate;
60
72
  if (this.name != undefined)
61
73
  res['name'] = this.name;
74
+ if (this.description != undefined)
75
+ res['description'] = this.description;
62
76
  if (this.inheritableUpTo != undefined)
63
77
  res['inheritableUpTo'] = this.inheritableUpTo;
64
78
  res['permissions'] = this.permissions.map((x0) => x0);
@@ -73,6 +87,7 @@ export class Role {
73
87
  rev: expectString(extractEntry(jCpy, 'rev', false, path), true, [...path, ".rev"]),
74
88
  deletionDate: expectNumber(extractEntry(jCpy, 'deletionDate', false, path), true, true, [...path, ".deletionDate"]),
75
89
  name: expectString(extractEntry(jCpy, 'name', false, path), true, [...path, ".name"]),
90
+ description: expectString(extractEntry(jCpy, 'description', false, path), true, [...path, ".description"]),
76
91
  inheritableUpTo: expectNumber(extractEntry(jCpy, 'inheritableUpTo', false, path), true, true, [...path, ".inheritableUpTo"]),
77
92
  permissions: expectArray(extractEntry(jCpy, 'permissions', false, path), false, [...path, ".permissions"], (x0, p0) => expectString(x0, false, p0)),
78
93
  });
@@ -8,10 +8,10 @@ export var CryptoActor;
8
8
  function fromJSON(json, ignoreUnknownKeys = false, path = ['CryptoActor']) {
9
9
  switch (json.$ktClass) {
10
10
  case 'com.icure.cardinal.sdk.model.Device': return Device.fromJSON(json, ignoreUnknownKeys);
11
+ case 'com.icure.cardinal.sdk.model.CryptoActorStub': return CryptoActorStub.fromJSON(json, ignoreUnknownKeys);
12
+ case 'com.icure.cardinal.sdk.model.HealthcareParty': return HealthcareParty.fromJSON(json, ignoreUnknownKeys);
11
13
  case 'com.icure.cardinal.sdk.model.DecryptedPatient': return DecryptedPatient.fromJSON(json, ignoreUnknownKeys);
12
14
  case 'com.icure.cardinal.sdk.model.EncryptedPatient': return EncryptedPatient.fromJSON(json, ignoreUnknownKeys);
13
- case 'com.icure.cardinal.sdk.model.HealthcareParty': return HealthcareParty.fromJSON(json, ignoreUnknownKeys);
14
- case 'com.icure.cardinal.sdk.model.CryptoActorStub': return CryptoActorStub.fromJSON(json, ignoreUnknownKeys);
15
15
  default: throw new Error('Unexpected discriminator for CryptoActor: ' + json.$ktClass);
16
16
  }
17
17
  }
@@ -1,3 +1,5 @@
1
+ import { Base64String } from '../specializations/Base64String.mjs';
2
+ import { Encryptable } from './Encryptable.mjs';
1
3
  import { PartnershipStatus } from './PartnershipStatus.mjs';
2
4
  import { PartnershipType } from './PartnershipType.mjs';
3
5
  /**
@@ -6,7 +8,7 @@ import { PartnershipType } from './PartnershipType.mjs';
6
8
  * patient).
7
9
  * /
8
10
  */
9
- export declare class Partnership {
11
+ export interface Partnership extends Encryptable {
10
12
  /**
11
13
  *
12
14
  * The type of relationship (from CD-CONTACT-PERSON codes).
@@ -22,7 +24,62 @@ export declare class Partnership {
22
24
  * The UUID of the contact person or patient in this relationship.
23
25
  */
24
26
  partnerId: string | undefined;
25
- constructor(partial: Partial<Partnership>);
27
+ readonly isEncrypted: boolean;
26
28
  toJSON(): object;
27
- static fromJSON(json: any, ignoreUnknownKeys?: boolean, path?: Array<string>): Partnership;
29
+ }
30
+ /**
31
+ *
32
+ * Represents a relationship between a patient and another person (contact person or another
33
+ * patient).
34
+ * /
35
+ */
36
+ export declare class DecryptedPartnership {
37
+ /**
38
+ *
39
+ * The type of relationship (from CD-CONTACT-PERSON codes).
40
+ */
41
+ type: PartnershipType | undefined;
42
+ /**
43
+ *
44
+ * The status of the relationship.
45
+ */
46
+ status: PartnershipStatus | undefined;
47
+ /**
48
+ *
49
+ * The UUID of the contact person or patient in this relationship.
50
+ */
51
+ partnerId: string | undefined;
52
+ encryptedSelf: Base64String | undefined;
53
+ readonly isEncrypted: false;
54
+ constructor(partial: Partial<DecryptedPartnership>);
55
+ toJSON(): object;
56
+ static fromJSON(json: any, ignoreUnknownKeys?: boolean, path?: Array<string>): DecryptedPartnership;
57
+ }
58
+ /**
59
+ *
60
+ * Represents a relationship between a patient and another person (contact person or another
61
+ * patient).
62
+ * /
63
+ */
64
+ export declare class EncryptedPartnership {
65
+ /**
66
+ *
67
+ * The type of relationship (from CD-CONTACT-PERSON codes).
68
+ */
69
+ type: PartnershipType | undefined;
70
+ /**
71
+ *
72
+ * The status of the relationship.
73
+ */
74
+ status: PartnershipStatus | undefined;
75
+ /**
76
+ *
77
+ * The UUID of the contact person or patient in this relationship.
78
+ */
79
+ partnerId: string | undefined;
80
+ encryptedSelf: Base64String | undefined;
81
+ readonly isEncrypted: true;
82
+ constructor(partial: Partial<EncryptedPartnership>);
83
+ toJSON(): object;
84
+ static fromJSON(json: any, ignoreUnknownKeys?: boolean, path?: Array<string>): EncryptedPartnership;
28
85
  }
@@ -8,7 +8,7 @@ import { PartnershipType } from './PartnershipType.mjs';
8
8
  * patient).
9
9
  * /
10
10
  */
11
- export class Partnership {
11
+ export class DecryptedPartnership {
12
12
  constructor(partial) {
13
13
  /**
14
14
  *
@@ -25,12 +25,18 @@ export class Partnership {
25
25
  * The UUID of the contact person or patient in this relationship.
26
26
  */
27
27
  this.partnerId = undefined;
28
+ this.encryptedSelf = undefined;
29
+ this.isEncrypted = false;
30
+ if (partial.isEncrypted !== undefined && partial.isEncrypted !== false)
31
+ throw new Error('partial.isEncrypted must be undefined or false');
28
32
  if ('type' in partial)
29
33
  this.type = partial.type;
30
34
  if ('status' in partial)
31
35
  this.status = partial.status;
32
36
  if ('partnerId' in partial)
33
37
  this.partnerId = partial.partnerId;
38
+ if ('encryptedSelf' in partial)
39
+ this.encryptedSelf = partial.encryptedSelf;
34
40
  }
35
41
  toJSON() {
36
42
  const res = {};
@@ -40,21 +46,96 @@ export class Partnership {
40
46
  res['status'] = this.status;
41
47
  if (this.partnerId != undefined)
42
48
  res['partnerId'] = this.partnerId;
49
+ if (this.encryptedSelf != undefined)
50
+ res['encryptedSelf'] = this.encryptedSelf;
51
+ res['isEncrypted'] = false;
43
52
  return res;
44
53
  }
45
- static fromJSON(json, ignoreUnknownKeys = false, path = ['Partnership']) {
54
+ static fromJSON(json, ignoreUnknownKeys = false, path = ['DecryptedPartnership']) {
46
55
  if (typeof json != 'object')
47
56
  throw new Error(`Expected json object at path ${path.join("")}`);
48
57
  const jCpy = Object.assign({}, json);
49
- const res = new Partnership({
58
+ if (extractEntry(jCpy, "isEncrypted", true, path) !== false)
59
+ throw new Error(`Unexpected value for ${path.join("")} isEncrypted marker, should be false. The provided json doesn't represent a DecryptedPartnership`);
60
+ const res = new DecryptedPartnership({
50
61
  type: expectStringEnum(extractEntry(jCpy, 'type', false, path), true, [...path, ".type"], PartnershipType, 'PartnershipType'),
51
62
  status: expectStringEnum(extractEntry(jCpy, 'status', false, path), true, [...path, ".status"], PartnershipStatus, 'PartnershipStatus'),
52
63
  partnerId: expectString(extractEntry(jCpy, 'partnerId', false, path), true, [...path, ".partnerId"]),
64
+ encryptedSelf: expectString(extractEntry(jCpy, 'encryptedSelf', false, path), true, [...path, ".encryptedSelf"]),
53
65
  });
54
66
  if (!ignoreUnknownKeys) {
55
67
  const unused = Object.keys(jCpy);
56
68
  if (unused.length > 0)
57
- throw new Error(`Unexpected key(s) for json object Partnership at path ${path.join("")}: ${unused}`);
69
+ throw new Error(`Unexpected key(s) for json object DecryptedPartnership at path ${path.join("")}: ${unused}`);
70
+ }
71
+ return res;
72
+ }
73
+ }
74
+ /**
75
+ *
76
+ * Represents a relationship between a patient and another person (contact person or another
77
+ * patient).
78
+ * /
79
+ */
80
+ export class EncryptedPartnership {
81
+ constructor(partial) {
82
+ /**
83
+ *
84
+ * The type of relationship (from CD-CONTACT-PERSON codes).
85
+ */
86
+ this.type = undefined;
87
+ /**
88
+ *
89
+ * The status of the relationship.
90
+ */
91
+ this.status = undefined;
92
+ /**
93
+ *
94
+ * The UUID of the contact person or patient in this relationship.
95
+ */
96
+ this.partnerId = undefined;
97
+ this.encryptedSelf = undefined;
98
+ this.isEncrypted = true;
99
+ if (partial.isEncrypted !== undefined && partial.isEncrypted !== true)
100
+ throw new Error('partial.isEncrypted must be undefined or true');
101
+ if ('type' in partial)
102
+ this.type = partial.type;
103
+ if ('status' in partial)
104
+ this.status = partial.status;
105
+ if ('partnerId' in partial)
106
+ this.partnerId = partial.partnerId;
107
+ if ('encryptedSelf' in partial)
108
+ this.encryptedSelf = partial.encryptedSelf;
109
+ }
110
+ toJSON() {
111
+ const res = {};
112
+ if (this.type != undefined)
113
+ res['type'] = this.type;
114
+ if (this.status != undefined)
115
+ res['status'] = this.status;
116
+ if (this.partnerId != undefined)
117
+ res['partnerId'] = this.partnerId;
118
+ if (this.encryptedSelf != undefined)
119
+ res['encryptedSelf'] = this.encryptedSelf;
120
+ res['isEncrypted'] = true;
121
+ return res;
122
+ }
123
+ static fromJSON(json, ignoreUnknownKeys = false, path = ['EncryptedPartnership']) {
124
+ if (typeof json != 'object')
125
+ throw new Error(`Expected json object at path ${path.join("")}`);
126
+ const jCpy = Object.assign({}, json);
127
+ if (extractEntry(jCpy, "isEncrypted", true, path) !== true)
128
+ throw new Error(`Unexpected value for ${path.join("")} isEncrypted marker, should be true. The provided json doesn't represent a EncryptedPartnership`);
129
+ const res = new EncryptedPartnership({
130
+ type: expectStringEnum(extractEntry(jCpy, 'type', false, path), true, [...path, ".type"], PartnershipType, 'PartnershipType'),
131
+ status: expectStringEnum(extractEntry(jCpy, 'status', false, path), true, [...path, ".status"], PartnershipStatus, 'PartnershipStatus'),
132
+ partnerId: expectString(extractEntry(jCpy, 'partnerId', false, path), true, [...path, ".partnerId"]),
133
+ encryptedSelf: expectString(extractEntry(jCpy, 'encryptedSelf', false, path), true, [...path, ".encryptedSelf"]),
134
+ });
135
+ if (!ignoreUnknownKeys) {
136
+ const unused = Object.keys(jCpy);
137
+ if (unused.length > 0)
138
+ throw new Error(`Unexpected key(s) for json object EncryptedPartnership at path ${path.join("")}: ${unused}`);
58
139
  }
59
140
  return res;
60
141
  }