@icure/cardinal-sdk 2.13.0 → 2.13.2

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.
@@ -10,6 +10,10 @@ export declare namespace SecretIdShareOptions {
10
10
  * @param requireAtLeastOne if true the sharing will fail if the current user can't access any secret id of the entity
11
11
  */
12
12
  class AllAvailable {
13
+ /**
14
+ * Share all available secret ids
15
+ * @param requireAtLeastOne if true the sharing will fail if the current user can't access any secret id of the entity
16
+ * / */
13
17
  requireAtLeastOne: boolean;
14
18
  readonly $ktClass: 'com.icure.cardinal.sdk.crypto.entities.SecretIdShareOptions.AllAvailable';
15
19
  constructor(partial: Partial<AllAvailable>);
@@ -8,6 +8,10 @@ export var SecretIdShareOptions;
8
8
  */
9
9
  class AllAvailable {
10
10
  constructor(partial) {
11
+ /**
12
+ * Share all available secret ids
13
+ * @param requireAtLeastOne if true the sharing will fail if the current user can't access any secret id of the entity
14
+ * / */
11
15
  this.requireAtLeastOne = false;
12
16
  this.$ktClass = 'com.icure.cardinal.sdk.crypto.entities.SecretIdShareOptions.AllAvailable';
13
17
  if ('requireAtLeastOne' in partial && partial.requireAtLeastOne !== undefined)
@@ -24,6 +24,11 @@ export declare namespace SecretIdUseOption {
24
24
  * Note that the SDK will not check that the secret id you used is actually a secret id of the owning entity.
25
25
  */
26
26
  class Use {
27
+ /**
28
+ * Specify explicitly which secret ids to use. The secretIds can also be empty, in which case the value is
29
+ * equivalent to [UseNone].
30
+ * Note that the SDK will not check that the secret id you used is actually a secret id of the owning entity.
31
+ * / */
27
32
  secretIds: Array<string>;
28
33
  readonly $ktClass: 'com.icure.cardinal.sdk.crypto.entities.SecretIdUseOption.Use';
29
34
  constructor(partial: Partial<Use> & Pick<Use, "secretIds">);
@@ -48,12 +48,6 @@ if (typeof Math.clz32 === 'undefined') {
48
48
  };
49
49
  }(Math.log, Math.LN2);
50
50
  }
51
- if (typeof String.prototype.startsWith === 'undefined') {
52
- Object.defineProperty(String.prototype, 'startsWith', {value: function (searchString, position) {
53
- position = position || 0;
54
- return this.lastIndexOf(searchString, position) === position;
55
- }});
56
- }
57
51
  if (typeof String.prototype.endsWith === 'undefined') {
58
52
  Object.defineProperty(String.prototype, 'endsWith', {value: function (searchString, position) {
59
53
  var subjectString = this.toString();
@@ -65,6 +59,12 @@ if (typeof String.prototype.endsWith === 'undefined') {
65
59
  return lastIndex !== -1 && lastIndex === position;
66
60
  }});
67
61
  }
62
+ if (typeof String.prototype.startsWith === 'undefined') {
63
+ Object.defineProperty(String.prototype, 'startsWith', {value: function (searchString, position) {
64
+ position = position || 0;
65
+ return this.lastIndexOf(searchString, position) === position;
66
+ }});
67
+ }
68
68
  //endregion
69
69
  //region block: imports
70
70
  var imul_0 = Math.imul;
@@ -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, MutableIterable, Collection]);
97
- initMetadataForInterface(KtMutableSet, 'MutableSet', VOID, VOID, [KtSet, MutableIterable, Collection]);
96
+ initMetadataForInterface(KtMutableList, 'MutableList', VOID, VOID, [KtList, Collection, MutableIterable]);
97
+ initMetadataForInterface(KtMutableSet, 'MutableSet', VOID, VOID, [KtSet, Collection, MutableIterable]);
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, [MutableIterable, Collection]);
118
+ initMetadataForClass(AbstractMutableCollection, 'AbstractMutableCollection', VOID, AbstractCollection, [Collection, MutableIterable]);
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, [MutableIterable, Collection]);
131
+ initMetadataForClass(HashMapValues, 'HashMapValues', VOID, AbstractMutableCollection, [Collection, MutableIterable]);
132
132
  initMetadataForClass(HashMapEntrySetBase, 'HashMapEntrySetBase', VOID, AbstractMutableSet, [KtMutableSet]);
133
133
  initMetadataForClass(HashMapEntrySet, 'HashMapEntrySet', VOID, HashMapEntrySetBase);
134
134
  initMetadataForClass(HashMapKeysDefault$iterator$1);
@@ -294,7 +294,7 @@ initMetadataForClass(ContextScope, 'ContextScope', VOID, VOID, [CoroutineScope])
294
294
  initMetadataForClass(Symbol, 'Symbol');
295
295
  initMetadataForInterface(SelectInstance, 'SelectInstance');
296
296
  initMetadataForClass(ClauseData, 'ClauseData', VOID, VOID, VOID, [1]);
297
- initMetadataForClass(SelectImplementation, 'SelectImplementation', VOID, VOID, [CancelHandler, SelectInstance, Waiter], [0, 2]);
297
+ initMetadataForClass(SelectImplementation, 'SelectImplementation', VOID, VOID, [CancelHandler, Waiter, SelectInstance], [0, 2]);
298
298
  initMetadataForClass(TrySelectDetailedResult, 'TrySelectDetailedResult', VOID, Enum);
299
299
  initMetadataForClass(CancellableContinuationWithOwner, 'CancellableContinuationWithOwner', VOID, VOID, [CancellableContinuation, Waiter]);
300
300
  initMetadataForClass(SemaphoreAndMutexImpl, 'SemaphoreAndMutexImpl', VOID, VOID, VOID, [0]);
@@ -9,7 +9,25 @@
9
9
  * instances of the SDK working on a different base group, can cause errors and other unexpected behavior.
10
10
  */
11
11
  export declare class GroupScoped<E> {
12
+ /**
13
+ * Wraps an entity and associates it with the group it exists in.
14
+ *
15
+ * In-group api methods take in input and return group scoped entities.
16
+ *
17
+ * To prevent mistakes, you shouldn't instantiate this class yourself, instead you should always get the GroupScoped
18
+ * entity from the `inGroup` methods of the apis. Using GroupScoped entities with the wrong groupId, or created by
19
+ * instances of the SDK working on a different base group, can cause errors and other unexpected behavior.
20
+ * / */
12
21
  entity: E;
22
+ /**
23
+ * Wraps an entity and associates it with the group it exists in.
24
+ *
25
+ * In-group api methods take in input and return group scoped entities.
26
+ *
27
+ * To prevent mistakes, you shouldn't instantiate this class yourself, instead you should always get the GroupScoped
28
+ * entity from the `inGroup` methods of the apis. Using GroupScoped entities with the wrong groupId, or created by
29
+ * instances of the SDK working on a different base group, can cause errors and other unexpected behavior.
30
+ * / */
13
31
  groupId: string;
14
32
  constructor(partial: Partial<GroupScoped<E>> & Pick<GroupScoped<E>, "entity" | "groupId">);
15
33
  }
@@ -1,12 +1,17 @@
1
1
  /**
2
2
  *
3
3
  *
4
- * The kind of entity a health element asserter's asserterId refers to.
4
+ * The kind of entity a health element asserter's
5
+ * [HealthElementAsserterDto.LocalAsserterIdentifier.id] refers to.
5
6
  *
6
7
  * This is the *entity-kind* axis, not the role axis: it says what sort of record the id points at,
7
8
  * not what part the
8
9
  * party played in the assertion. Do not confuse it with ParticipantTypeDto.
9
10
  *
11
+ * It applies to the *local* branch of [HealthElementAsserterDto] only: an asserter named by
12
+ * [HealthElementAsserterDto.externalAsserterIdentifier] has no record here, so it carries no
13
+ * entity kind.
14
+ *
10
15
  * The entries deliberately mirror [PartnerTypeDto], which answers the same question for a
11
16
  * partnership's partnerId. The
12
17
  * two enums are kept separate on purpose: partnership vocabulary and asserter vocabulary are free
@@ -2,12 +2,17 @@
2
2
  /**
3
3
  *
4
4
  *
5
- * The kind of entity a health element asserter's asserterId refers to.
5
+ * The kind of entity a health element asserter's
6
+ * [HealthElementAsserterDto.LocalAsserterIdentifier.id] refers to.
6
7
  *
7
8
  * This is the *entity-kind* axis, not the role axis: it says what sort of record the id points at,
8
9
  * not what part the
9
10
  * party played in the assertion. Do not confuse it with ParticipantTypeDto.
10
11
  *
12
+ * It applies to the *local* branch of [HealthElementAsserterDto] only: an asserter named by
13
+ * [HealthElementAsserterDto.externalAsserterIdentifier] has no record here, so it carries no
14
+ * entity kind.
15
+ *
11
16
  * The entries deliberately mirror [PartnerTypeDto], which answers the same question for a
12
17
  * partnership's partnerId. The
13
18
  * two enums are kept separate on purpose: partnership vocabulary and asserter vocabulary are free
@@ -1,3 +1,4 @@
1
+ import { Identifier } from '../base/Identifier.mjs';
1
2
  import { AsserterType } from './AsserterType.mjs';
2
3
  /**
3
4
  *
@@ -12,38 +13,79 @@ import { AsserterType } from './AsserterType.mjs';
12
13
  * are asserters, and the
13
14
  * same healthcare element may carry more than one of them.
14
15
  *
15
- * The two fields must agree: [asserterType] declares which kind of entity [asserterId] points at.
16
- * [AsserterTypeDto]
17
- * bounds the vocabulary, but nothing enforces the *pairing* - the field is encrypted, so the
18
- * server never sees the
19
- * values and cannot validate or repair them; that invariant is owned by the SDK.
16
+ * The party is named in exactly one of two ways, and exactly one of the two fields must be set:
17
+ * - [localAsserterIdentifier] names a party stored in this iCure instance: an id, plus the
18
+ * [AsserterTypeDto] saying
19
+ * which kind of record that id points at;
20
+ * - [externalAsserterIdentifier] names a party that has no record here, through a business
21
+ * [IdentifierDto] issued by
22
+ * another system. There is deliberately no [AsserterTypeDto] on this branch: the kind of a
23
+ * record we do not store is
24
+ * not knowable to us.
25
+ *
26
+ * The exactly-one rule is **not** checked on this DTO. It is checked one layer down, in
27
+ * `HealthElementAsserter`'s
28
+ * `init`: mapping this DTO constructs one, so a violation still surfaces as a `400`, and the rule
29
+ * also covers the write
30
+ * paths that never build a DTO at all. This class only checks that [LocalAsserterIdentifier.id] is
31
+ * not blank. Nothing
32
+ * enforces the *pairing* inside [LocalAsserterIdentifier]: [AsserterTypeDto] bounds the
33
+ * vocabulary, not what
34
+ * [LocalAsserterIdentifier.id] actually points at; that invariant is owned by the SDK.
20
35
  *
21
36
  * Note on organisations: an organisation (hospital, practice, care home, ...) is not a distinct
22
37
  * asserter type.
23
38
  * Organisations are stored as healthcare party records, distinguished from individual
24
39
  * practitioners by tags set by the
25
- * client, so an organisation asserter is an entry with `asserterType =
26
- * AsserterTypeDto.healthcareParty` whose
27
- * [asserterId] points to such a record. The association between a practitioner and the
28
- * organisation they were acting
29
- * for at the time of the assertion is deliberately NOT modelled here.
40
+ * client, so an organisation asserter is a [localAsserterIdentifier] with `type =
41
+ * AsserterTypeDto.healthcareParty`
42
+ * whose `id` points to such a record. The association between a practitioner and the organisation
43
+ * they were acting for
44
+ * at the time of the assertion is deliberately NOT modelled here.
30
45
  */
31
46
  export declare class HealthElementAsserter {
32
47
  /**
33
48
  *
34
- * The id of the entity making the assertion. Which entity it refers to is given by [asserterType].
35
49
  *
50
+ * The asserting party, as a reference to a record stored in this instance. Null when the party is
51
+ * named by
52
+ * [externalAsserterIdentifier].
36
53
  */
37
- asserterId: string;
54
+ localAsserterIdentifier: HealthElementAsserter.LocalAsserterIdentifier | undefined;
38
55
  /**
39
56
  *
40
57
  *
41
- * The kind of entity [asserterId] refers to. This is the kind of entity, not the role the party
42
- * played - do not
43
- * confuse it with ParticipantTypeDto.
58
+ * The asserting party, as a business identifier from a system that is not this one. Null when the
59
+ * party is named by
60
+ * [localAsserterIdentifier]. Carries no [AsserterTypeDto].
44
61
  */
45
- asserterType: AsserterType;
46
- constructor(partial: Partial<HealthElementAsserter> & Pick<HealthElementAsserter, "asserterId" | "asserterType">);
62
+ externalAsserterIdentifier: Identifier | undefined;
63
+ constructor(partial: Partial<HealthElementAsserter>);
47
64
  toJSON(): object;
48
65
  static fromJSON(json: any, ignoreUnknownKeys?: boolean, path?: Array<string>): HealthElementAsserter;
49
66
  }
67
+ export declare namespace HealthElementAsserter {
68
+ /**
69
+ *
70
+ *
71
+ * A reference to the record, stored in iCure.
72
+ */
73
+ class LocalAsserterIdentifier {
74
+ /**
75
+ *
76
+ * The id of the entity making the assertion. Which entity it refers to is given by [type].
77
+ */
78
+ id: string;
79
+ /**
80
+ *
81
+ *
82
+ * The kind of entity [id] refers to. This is the kind of entity, not the role the party played -
83
+ * do not
84
+ * confuse it with ParticipantTypeDto.
85
+ */
86
+ type: AsserterType;
87
+ constructor(partial: Partial<LocalAsserterIdentifier> & Pick<LocalAsserterIdentifier, "type">);
88
+ toJSON(): object;
89
+ static fromJSON(json: any, ignoreUnknownKeys?: boolean, path?: Array<string>): LocalAsserterIdentifier;
90
+ }
91
+ }
@@ -1,5 +1,7 @@
1
1
  // auto-generated file
2
- import { expectString, expectStringEnum, extractEntry } from '../../internal/JsonDecodeUtils.mjs';
2
+ import { expectObject, expectString, expectStringEnum, extractEntry } from '../../internal/JsonDecodeUtils.mjs';
3
+ import { randomUuid } from '../../utils/Id.mjs';
4
+ import { Identifier } from '../base/Identifier.mjs';
3
5
  import { AsserterType } from './AsserterType.mjs';
4
6
  /**
5
7
  *
@@ -14,31 +16,65 @@ import { AsserterType } from './AsserterType.mjs';
14
16
  * are asserters, and the
15
17
  * same healthcare element may carry more than one of them.
16
18
  *
17
- * The two fields must agree: [asserterType] declares which kind of entity [asserterId] points at.
18
- * [AsserterTypeDto]
19
- * bounds the vocabulary, but nothing enforces the *pairing* - the field is encrypted, so the
20
- * server never sees the
21
- * values and cannot validate or repair them; that invariant is owned by the SDK.
19
+ * The party is named in exactly one of two ways, and exactly one of the two fields must be set:
20
+ * - [localAsserterIdentifier] names a party stored in this iCure instance: an id, plus the
21
+ * [AsserterTypeDto] saying
22
+ * which kind of record that id points at;
23
+ * - [externalAsserterIdentifier] names a party that has no record here, through a business
24
+ * [IdentifierDto] issued by
25
+ * another system. There is deliberately no [AsserterTypeDto] on this branch: the kind of a
26
+ * record we do not store is
27
+ * not knowable to us.
28
+ *
29
+ * The exactly-one rule is **not** checked on this DTO. It is checked one layer down, in
30
+ * `HealthElementAsserter`'s
31
+ * `init`: mapping this DTO constructs one, so a violation still surfaces as a `400`, and the rule
32
+ * also covers the write
33
+ * paths that never build a DTO at all. This class only checks that [LocalAsserterIdentifier.id] is
34
+ * not blank. Nothing
35
+ * enforces the *pairing* inside [LocalAsserterIdentifier]: [AsserterTypeDto] bounds the
36
+ * vocabulary, not what
37
+ * [LocalAsserterIdentifier.id] actually points at; that invariant is owned by the SDK.
22
38
  *
23
39
  * Note on organisations: an organisation (hospital, practice, care home, ...) is not a distinct
24
40
  * asserter type.
25
41
  * Organisations are stored as healthcare party records, distinguished from individual
26
42
  * practitioners by tags set by the
27
- * client, so an organisation asserter is an entry with `asserterType =
28
- * AsserterTypeDto.healthcareParty` whose
29
- * [asserterId] points to such a record. The association between a practitioner and the
30
- * organisation they were acting
31
- * for at the time of the assertion is deliberately NOT modelled here.
43
+ * client, so an organisation asserter is a [localAsserterIdentifier] with `type =
44
+ * AsserterTypeDto.healthcareParty`
45
+ * whose `id` points to such a record. The association between a practitioner and the organisation
46
+ * they were acting for
47
+ * at the time of the assertion is deliberately NOT modelled here.
32
48
  */
33
49
  export class HealthElementAsserter {
34
50
  constructor(partial) {
35
- this.asserterId = partial.asserterId;
36
- this.asserterType = partial.asserterType;
51
+ /**
52
+ *
53
+ *
54
+ * The asserting party, as a reference to a record stored in this instance. Null when the party is
55
+ * named by
56
+ * [externalAsserterIdentifier].
57
+ */
58
+ this.localAsserterIdentifier = undefined;
59
+ /**
60
+ *
61
+ *
62
+ * The asserting party, as a business identifier from a system that is not this one. Null when the
63
+ * party is named by
64
+ * [localAsserterIdentifier]. Carries no [AsserterTypeDto].
65
+ */
66
+ this.externalAsserterIdentifier = undefined;
67
+ if ('localAsserterIdentifier' in partial)
68
+ this.localAsserterIdentifier = partial.localAsserterIdentifier;
69
+ if ('externalAsserterIdentifier' in partial)
70
+ this.externalAsserterIdentifier = partial.externalAsserterIdentifier;
37
71
  }
38
72
  toJSON() {
39
73
  const res = {};
40
- res['asserterId'] = this.asserterId;
41
- res['asserterType'] = this.asserterType;
74
+ if (this.localAsserterIdentifier != undefined)
75
+ res['localAsserterIdentifier'] = this.localAsserterIdentifier.toJSON();
76
+ if (this.externalAsserterIdentifier != undefined)
77
+ res['externalAsserterIdentifier'] = this.externalAsserterIdentifier.toJSON();
42
78
  return res;
43
79
  }
44
80
  static fromJSON(json, ignoreUnknownKeys = false, path = ['HealthElementAsserter']) {
@@ -46,8 +82,8 @@ export class HealthElementAsserter {
46
82
  throw new Error(`Expected json object at path ${path.join("")}`);
47
83
  const jCpy = Object.assign({}, json);
48
84
  const res = new HealthElementAsserter({
49
- asserterId: expectString(extractEntry(jCpy, 'asserterId', true, path), false, [...path, ".asserterId"]),
50
- asserterType: expectStringEnum(extractEntry(jCpy, 'asserterType', true, path), false, [...path, ".asserterType"], AsserterType, 'AsserterType'),
85
+ localAsserterIdentifier: expectObject(extractEntry(jCpy, 'localAsserterIdentifier', false, path), true, ignoreUnknownKeys, [...path, ".localAsserterIdentifier"], HealthElementAsserter.LocalAsserterIdentifier.fromJSON),
86
+ externalAsserterIdentifier: expectObject(extractEntry(jCpy, 'externalAsserterIdentifier', false, path), true, ignoreUnknownKeys, [...path, ".externalAsserterIdentifier"], Identifier.fromJSON),
51
87
  });
52
88
  if (!ignoreUnknownKeys) {
53
89
  const unused = Object.keys(jCpy);
@@ -57,3 +93,39 @@ export class HealthElementAsserter {
57
93
  return res;
58
94
  }
59
95
  }
96
+ (function (HealthElementAsserter) {
97
+ /**
98
+ *
99
+ *
100
+ * A reference to the record, stored in iCure.
101
+ */
102
+ class LocalAsserterIdentifier {
103
+ constructor(partial) {
104
+ var _a;
105
+ this.id = (_a = partial.id) !== null && _a !== void 0 ? _a : randomUuid();
106
+ this.type = partial.type;
107
+ }
108
+ toJSON() {
109
+ const res = {};
110
+ res['id'] = this.id;
111
+ res['type'] = this.type;
112
+ return res;
113
+ }
114
+ static fromJSON(json, ignoreUnknownKeys = false, path = ['LocalAsserterIdentifier']) {
115
+ if (typeof json != 'object')
116
+ throw new Error(`Expected json object at path ${path.join("")}`);
117
+ const jCpy = Object.assign({}, json);
118
+ const res = new LocalAsserterIdentifier({
119
+ id: expectString(extractEntry(jCpy, 'id', true, path), false, [...path, ".id"]),
120
+ type: expectStringEnum(extractEntry(jCpy, 'type', true, path), false, [...path, ".type"], AsserterType, 'AsserterType'),
121
+ });
122
+ if (!ignoreUnknownKeys) {
123
+ const unused = Object.keys(jCpy);
124
+ if (unused.length > 0)
125
+ throw new Error(`Unexpected key(s) for json object LocalAsserterIdentifier at path ${path.join("")}: ${unused}`);
126
+ }
127
+ return res;
128
+ }
129
+ }
130
+ HealthElementAsserter.LocalAsserterIdentifier = LocalAsserterIdentifier;
131
+ })(HealthElementAsserter || (HealthElementAsserter = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icure/cardinal-sdk",
3
- "version": "2.13.0",
3
+ "version": "2.13.2",
4
4
  "main": "cardinal-sdk-ts.mjs",
5
5
  "types": "cardinal-sdk-ts.d.mts",
6
6
  "devDependencies": {
@@ -19,6 +19,9 @@ export declare namespace EntitySubscriptionEvent {
19
19
  * A general unexpected error.
20
20
  */
21
21
  class UnexpectedError {
22
+ /**
23
+ * A general unexpected error.
24
+ * / */
22
25
  message: string;
23
26
  readonly $ktClass: 'com.icure.cardinal.sdk.subscription.EntitySubscriptionEvent.UnexpectedError';
24
27
  constructor(partial: Partial<UnexpectedError> & Pick<UnexpectedError, "message">);