@icure/cardinal-sdk 2.13.2 → 2.13.4

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.
@@ -48,6 +48,12 @@ 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
+ }
51
57
  if (typeof String.prototype.endsWith === 'undefined') {
52
58
  Object.defineProperty(String.prototype, 'endsWith', {value: function (searchString, position) {
53
59
  var subjectString = this.toString();
@@ -59,12 +65,6 @@ if (typeof String.prototype.endsWith === 'undefined') {
59
65
  return lastIndex !== -1 && lastIndex === position;
60
66
  }});
61
67
  }
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, 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);
@@ -834,6 +834,17 @@ function get_jsonObject(_this__u8e3s4) {
834
834
  }
835
835
  return tmp;
836
836
  }
837
+ function get_jsonArray(_this__u8e3s4) {
838
+ _init_properties_JsonElement_kt__7cbdc2();
839
+ var tmp0_elvis_lhs = _this__u8e3s4 instanceof JsonArray ? _this__u8e3s4 : null;
840
+ var tmp;
841
+ if (tmp0_elvis_lhs == null) {
842
+ error(_this__u8e3s4, 'JsonArray');
843
+ } else {
844
+ tmp = tmp0_elvis_lhs;
845
+ }
846
+ return tmp;
847
+ }
837
848
  var properties_initialized_JsonElement_kt_abxy8s;
838
849
  function _init_properties_JsonElement_kt__7cbdc2() {
839
850
  if (!properties_initialized_JsonElement_kt_abxy8s) {
@@ -6737,6 +6748,7 @@ export {
6737
6748
  decodeFromDynamic as decodeFromDynamic3axi482yesc93,
6738
6749
  get_doubleOrNull as get_doubleOrNull2fo14gjg922um,
6739
6750
  encodeToDynamic as encodeToDynamicsae9c2u7066d,
6751
+ get_jsonArray as get_jsonArray18sglwhl4pclz,
6740
6752
  get_jsonObject as get_jsonObject2u4z2ch1uuca9,
6741
6753
  get_jsonPrimitive as get_jsonPrimitivez17tyd5rw1ql,
6742
6754
  get_longOrNull as get_longOrNull1kg1ha9scz5pa,
@@ -7,10 +7,10 @@ export var CryptoActor;
7
7
  (function (CryptoActor) {
8
8
  function fromJSON(json, ignoreUnknownKeys = false, path = ['CryptoActor']) {
9
9
  switch (json.$ktClass) {
10
- case 'com.icure.cardinal.sdk.model.HealthcareParty': return HealthcareParty.fromJSON(json, ignoreUnknownKeys);
11
- case 'com.icure.cardinal.sdk.model.Device': return Device.fromJSON(json, ignoreUnknownKeys);
12
- case 'com.icure.cardinal.sdk.model.EncryptedPatient': return EncryptedPatient.fromJSON(json, ignoreUnknownKeys);
13
10
  case 'com.icure.cardinal.sdk.model.DecryptedPatient': return DecryptedPatient.fromJSON(json, ignoreUnknownKeys);
11
+ case 'com.icure.cardinal.sdk.model.EncryptedPatient': return EncryptedPatient.fromJSON(json, ignoreUnknownKeys);
12
+ case 'com.icure.cardinal.sdk.model.Device': return Device.fromJSON(json, ignoreUnknownKeys);
13
+ case 'com.icure.cardinal.sdk.model.HealthcareParty': return HealthcareParty.fromJSON(json, ignoreUnknownKeys);
14
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
  }
@@ -59,7 +59,7 @@ export declare class HealthElementAsserter {
59
59
  * party is named by
60
60
  * [localAsserterIdentifier]. Carries no [AsserterTypeDto].
61
61
  */
62
- externalAsserterIdentifier: Identifier | undefined;
62
+ externalAsserterIdentifier: HealthElementAsserter.ExternalAsserterIdentifier | undefined;
63
63
  constructor(partial: Partial<HealthElementAsserter>);
64
64
  toJSON(): object;
65
65
  static fromJSON(json: any, ignoreUnknownKeys?: boolean, path?: Array<string>): HealthElementAsserter;
@@ -88,4 +88,33 @@ export declare namespace HealthElementAsserter {
88
88
  toJSON(): object;
89
89
  static fromJSON(json: any, ignoreUnknownKeys?: boolean, path?: Array<string>): LocalAsserterIdentifier;
90
90
  }
91
+ /**
92
+ *
93
+ *
94
+ * The party making the assertion, when it has no record in this iCure instance.
95
+ *
96
+ * The party is named by a business [identifier] issued by another system: a national registry
97
+ * number, an entry in
98
+ * the sending hospital's directory, and so on. Because the record lives elsewhere there is no
99
+ * [AsserterTypeDto]
100
+ * here - the kind of a record we do not store is not knowable to us. The wrapper around the
101
+ * [IdentifierDto] mirrors
102
+ * [LocalAsserterIdentifier] on the other branch, and is where anything specific to an external
103
+ * asserter would go:
104
+ * [IdentifierDto] itself is shared by every `identifiers` field in the model and cannot carry it.
105
+ */
106
+ class ExternalAsserterIdentifier {
107
+ /**
108
+ *
109
+ *
110
+ * The business identifier of the party in the system that issued it. `system` names that issuing
111
+ * system and
112
+ * `value` is the party's identifier within it; together they are what makes the party
113
+ * resolvable.
114
+ */
115
+ identifier: Identifier;
116
+ constructor(partial: Partial<ExternalAsserterIdentifier> & Pick<ExternalAsserterIdentifier, "identifier">);
117
+ toJSON(): object;
118
+ static fromJSON(json: any, ignoreUnknownKeys?: boolean, path?: Array<string>): ExternalAsserterIdentifier;
119
+ }
91
120
  }
@@ -83,7 +83,7 @@ export class HealthElementAsserter {
83
83
  const jCpy = Object.assign({}, json);
84
84
  const res = new HealthElementAsserter({
85
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),
86
+ externalAsserterIdentifier: expectObject(extractEntry(jCpy, 'externalAsserterIdentifier', false, path), true, ignoreUnknownKeys, [...path, ".externalAsserterIdentifier"], HealthElementAsserter.ExternalAsserterIdentifier.fromJSON),
87
87
  });
88
88
  if (!ignoreUnknownKeys) {
89
89
  const unused = Object.keys(jCpy);
@@ -128,4 +128,44 @@ export class HealthElementAsserter {
128
128
  }
129
129
  }
130
130
  HealthElementAsserter.LocalAsserterIdentifier = LocalAsserterIdentifier;
131
+ /**
132
+ *
133
+ *
134
+ * The party making the assertion, when it has no record in this iCure instance.
135
+ *
136
+ * The party is named by a business [identifier] issued by another system: a national registry
137
+ * number, an entry in
138
+ * the sending hospital's directory, and so on. Because the record lives elsewhere there is no
139
+ * [AsserterTypeDto]
140
+ * here - the kind of a record we do not store is not knowable to us. The wrapper around the
141
+ * [IdentifierDto] mirrors
142
+ * [LocalAsserterIdentifier] on the other branch, and is where anything specific to an external
143
+ * asserter would go:
144
+ * [IdentifierDto] itself is shared by every `identifiers` field in the model and cannot carry it.
145
+ */
146
+ class ExternalAsserterIdentifier {
147
+ constructor(partial) {
148
+ this.identifier = partial.identifier;
149
+ }
150
+ toJSON() {
151
+ const res = {};
152
+ res['identifier'] = this.identifier.toJSON();
153
+ return res;
154
+ }
155
+ static fromJSON(json, ignoreUnknownKeys = false, path = ['ExternalAsserterIdentifier']) {
156
+ if (typeof json != 'object')
157
+ throw new Error(`Expected json object at path ${path.join("")}`);
158
+ const jCpy = Object.assign({}, json);
159
+ const res = new ExternalAsserterIdentifier({
160
+ identifier: expectObject(extractEntry(jCpy, 'identifier', true, path), false, ignoreUnknownKeys, [...path, ".identifier"], Identifier.fromJSON),
161
+ });
162
+ if (!ignoreUnknownKeys) {
163
+ const unused = Object.keys(jCpy);
164
+ if (unused.length > 0)
165
+ throw new Error(`Unexpected key(s) for json object ExternalAsserterIdentifier at path ${path.join("")}: ${unused}`);
166
+ }
167
+ return res;
168
+ }
169
+ }
170
+ HealthElementAsserter.ExternalAsserterIdentifier = ExternalAsserterIdentifier;
131
171
  })(HealthElementAsserter || (HealthElementAsserter = {}));
@@ -17,4 +17,4 @@ import { TimePicker } from './TimePicker.mjs';
17
17
  * validation rules, and optional codification and tagging.
18
18
  * /
19
19
  */
20
- export type Field = DropdownField | TimePicker | RadioButton | DatePicker | MeasureField | TextField | DateTimePicker | MultipleChoice | CheckBox | NumberField;
20
+ export type Field = DatePicker | MeasureField | DateTimePicker | TextField | CheckBox | DropdownField | NumberField | TimePicker | RadioButton | MultipleChoice;
@@ -6,7 +6,7 @@ import { FieldsGroup } from './FieldsGroup.mjs';
6
6
  * groups.
7
7
  * /
8
8
  */
9
- export type StructureElement = Field | FieldsGroup;
9
+ export type StructureElement = FieldsGroup | Field;
10
10
  export declare namespace StructureElement {
11
11
  function fromJSON(json: any, ignoreUnknownKeys?: boolean, path?: Array<string>): StructureElement;
12
12
  }
@@ -14,17 +14,17 @@ export var StructureElement;
14
14
  (function (StructureElement) {
15
15
  function fromJSON(json, ignoreUnknownKeys = false, path = ['StructureElement']) {
16
16
  switch (json.$ktClass) {
17
- case 'com.icure.cardinal.sdk.model.embed.form.template.DropdownField': return DropdownField.fromJSON(json, ignoreUnknownKeys);
18
- case 'com.icure.cardinal.sdk.model.embed.form.template.TimePicker': return TimePicker.fromJSON(json, ignoreUnknownKeys);
19
- case 'com.icure.cardinal.sdk.model.embed.form.template.RadioButton': return RadioButton.fromJSON(json, ignoreUnknownKeys);
17
+ case 'com.icure.cardinal.sdk.model.embed.form.template.FieldsGroup': return FieldsGroup.fromJSON(json, ignoreUnknownKeys);
20
18
  case 'com.icure.cardinal.sdk.model.embed.form.template.DatePicker': return DatePicker.fromJSON(json, ignoreUnknownKeys);
21
19
  case 'com.icure.cardinal.sdk.model.embed.form.template.MeasureField': return MeasureField.fromJSON(json, ignoreUnknownKeys);
22
- case 'com.icure.cardinal.sdk.model.embed.form.template.TextField': return TextField.fromJSON(json, ignoreUnknownKeys);
23
20
  case 'com.icure.cardinal.sdk.model.embed.form.template.DateTimePicker': return DateTimePicker.fromJSON(json, ignoreUnknownKeys);
24
- case 'com.icure.cardinal.sdk.model.embed.form.template.MultipleChoice': return MultipleChoice.fromJSON(json, ignoreUnknownKeys);
21
+ case 'com.icure.cardinal.sdk.model.embed.form.template.TextField': return TextField.fromJSON(json, ignoreUnknownKeys);
25
22
  case 'com.icure.cardinal.sdk.model.embed.form.template.CheckBox': return CheckBox.fromJSON(json, ignoreUnknownKeys);
23
+ case 'com.icure.cardinal.sdk.model.embed.form.template.DropdownField': return DropdownField.fromJSON(json, ignoreUnknownKeys);
26
24
  case 'com.icure.cardinal.sdk.model.embed.form.template.NumberField': return NumberField.fromJSON(json, ignoreUnknownKeys);
27
- case 'com.icure.cardinal.sdk.model.embed.form.template.FieldsGroup': return FieldsGroup.fromJSON(json, ignoreUnknownKeys);
25
+ case 'com.icure.cardinal.sdk.model.embed.form.template.TimePicker': return TimePicker.fromJSON(json, ignoreUnknownKeys);
26
+ case 'com.icure.cardinal.sdk.model.embed.form.template.RadioButton': return RadioButton.fromJSON(json, ignoreUnknownKeys);
27
+ case 'com.icure.cardinal.sdk.model.embed.form.template.MultipleChoice': return MultipleChoice.fromJSON(json, ignoreUnknownKeys);
28
28
  default: throw new Error('Unexpected discriminator for StructureElement: ' + json.$ktClass);
29
29
  }
30
30
  }
@@ -9,7 +9,7 @@ import { OrPredicate } from './OrPredicate.mjs';
9
9
  * chain.
10
10
  * /
11
11
  */
12
- export type Predicate = KeyValuePredicate | AlwaysPredicate | NotPredicate | AndPredicate | OrPredicate;
12
+ export type Predicate = NotPredicate | AndPredicate | OrPredicate | KeyValuePredicate | AlwaysPredicate;
13
13
  export declare namespace Predicate {
14
14
  function fromJSON(json: any, ignoreUnknownKeys?: boolean, path?: Array<string>): Predicate;
15
15
  }
@@ -8,11 +8,11 @@ export var Predicate;
8
8
  (function (Predicate) {
9
9
  function fromJSON(json, ignoreUnknownKeys = false, path = ['Predicate']) {
10
10
  switch (json.$ktClass) {
11
- case 'com.icure.cardinal.sdk.model.filter.predicate.KeyValuePredicate': return KeyValuePredicate.fromJSON(json, ignoreUnknownKeys);
12
- case 'com.icure.cardinal.sdk.model.filter.predicate.AlwaysPredicate': return AlwaysPredicate.fromJSON(json, ignoreUnknownKeys);
13
11
  case 'com.icure.cardinal.sdk.model.filter.predicate.NotPredicate': return NotPredicate.fromJSON(json, ignoreUnknownKeys);
14
12
  case 'com.icure.cardinal.sdk.model.filter.predicate.AndPredicate': return AndPredicate.fromJSON(json, ignoreUnknownKeys);
15
13
  case 'com.icure.cardinal.sdk.model.filter.predicate.OrPredicate': return OrPredicate.fromJSON(json, ignoreUnknownKeys);
14
+ case 'com.icure.cardinal.sdk.model.filter.predicate.KeyValuePredicate': return KeyValuePredicate.fromJSON(json, ignoreUnknownKeys);
15
+ case 'com.icure.cardinal.sdk.model.filter.predicate.AlwaysPredicate': return AlwaysPredicate.fromJSON(json, ignoreUnknownKeys);
16
16
  default: throw new Error('Unexpected discriminator for Predicate: ' + json.$ktClass);
17
17
  }
18
18
  }
@@ -81,6 +81,19 @@ export interface SdkOptions {
81
81
  * If not null the SDK will immediately set the data owner scope to the provided value after login.
82
82
  */
83
83
  readonly dataOwnerScope?: string;
84
+ /**
85
+ * If provided, when the backend returns a list of stored entities (get by ids, filter, find, list, ...) the entities
86
+ * that can't be deserialized are dropped from the result instead of failing the whole request, and this function is
87
+ * called once for each dropped entity. Methods returning lists may then return fewer entities than requested.
88
+ *
89
+ * Single entity reads, write operations and the entities used internally by the crypto layer are never affected.
90
+ * If the function throws, the request fails with that error.
91
+ *
92
+ * The `json` of the entity contains all its non-encrypted data, including personal data: avoid logging it as is.
93
+ *
94
+ * If not provided (default) a malformed entity fails the whole request.
95
+ */
96
+ readonly onMalformedEntity?: (entity: MalformedEntity) => void;
84
97
  }
85
98
  export interface BasicSdkOptions {
86
99
  /**
@@ -114,6 +127,19 @@ export interface BasicSdkOptions {
114
127
  * If not null the SDK will immediately set the data owner scope to the provided value after login.
115
128
  */
116
129
  readonly dataOwnerScope?: string;
130
+ /**
131
+ * If provided, when the backend returns a list of stored entities (get by ids, filter, find, list, ...) the entities
132
+ * that can't be deserialized are dropped from the result instead of failing the whole request, and this function is
133
+ * called once for each dropped entity. Methods returning lists may then return fewer entities than requested.
134
+ *
135
+ * Single entity reads, write operations and the entities used internally by the crypto layer are never affected.
136
+ * If the function throws, the request fails with that error.
137
+ *
138
+ * The `json` of the entity contains all its non-encrypted data, including personal data: avoid logging it as is.
139
+ *
140
+ * If not provided (default) a malformed entity fails the whole request.
141
+ */
142
+ readonly onMalformedEntity?: (entity: MalformedEntity) => void;
117
143
  }
118
144
  /**
119
145
  * Optional parameters used in the conversion from a basic sdk to a full sdk.
@@ -154,6 +180,44 @@ export interface AnonymousSdkOptions {
154
180
  * This behaviour is disabled by default (strict by default).
155
181
  */
156
182
  readonly ignoreUnknownFields?: boolean;
183
+ /**
184
+ * If provided, when the backend returns a list of stored entities (get by ids, filter, find, list, ...) the entities
185
+ * that can't be deserialized are dropped from the result instead of failing the whole request, and this function is
186
+ * called once for each dropped entity. Methods returning lists may then return fewer entities than requested.
187
+ *
188
+ * Single entity reads, write operations and the entities used internally by the crypto layer are never affected.
189
+ * If the function throws, the request fails with that error.
190
+ *
191
+ * The `json` of the entity contains all its non-encrypted data, including personal data: avoid logging it as is.
192
+ *
193
+ * If not provided (default) a malformed entity fails the whole request.
194
+ */
195
+ readonly onMalformedEntity?: (entity: MalformedEntity) => void;
196
+ }
197
+ /**
198
+ * An entity returned by the backend in a list that could not be deserialized and was discarded.
199
+ */
200
+ export interface MalformedEntity {
201
+ /**
202
+ * Serial name of the expected type of the entity, e.g. "com.icure.cardinal.sdk.model.EncryptedPatient".
203
+ */
204
+ readonly entityType: string;
205
+ /**
206
+ * Id of the entity, if it could be read from its raw json.
207
+ */
208
+ readonly entityId: string | undefined;
209
+ /**
210
+ * The raw json of the entity, as returned by the backend.
211
+ */
212
+ readonly json: any;
213
+ /**
214
+ * Message of the deserialization error.
215
+ */
216
+ readonly error: string;
217
+ /**
218
+ * Url of the request that returned the entity.
219
+ */
220
+ readonly requestUrl: string;
157
221
  }
158
222
  export interface EncryptedFieldsConfiguration {
159
223
  readonly accessLog?: Array<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icure/cardinal-sdk",
3
- "version": "2.13.2",
3
+ "version": "2.13.4",
4
4
  "main": "cardinal-sdk-ts.mjs",
5
5
  "types": "cardinal-sdk-ts.d.mts",
6
6
  "devDependencies": {