@icure/cardinal-sdk 2.9.0 → 2.10.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.
@@ -4,7 +4,7 @@ import { randomUuid } from '../../utils/Id.mjs';
4
4
  import { CodeStub } from '../base/CodeStub.mjs';
5
5
  import { Identifier } from '../base/Identifier.mjs';
6
6
  import { LinkQualification } from '../base/LinkQualification.mjs';
7
- import { Annotation } from './Annotation.mjs';
7
+ import { DecryptedAnnotation, EncryptedAnnotation } from './Annotation.mjs';
8
8
  import { DecryptedContent, EncryptedContent } from './Content.mjs';
9
9
  import { Delegation } from './Delegation.mjs';
10
10
  import { SecurityMetadata } from './SecurityMetadata.mjs';
@@ -316,7 +316,7 @@ export class DecryptedService {
316
316
  responsible: expectString(extractEntry(jCpy, 'responsible', false, path), true, [...path, ".responsible"]),
317
317
  comment: expectString(extractEntry(jCpy, 'comment', false, path), true, [...path, ".comment"]),
318
318
  invoicingCodes: expectArray(extractEntry(jCpy, 'invoicingCodes', false, path), false, [...path, ".invoicingCodes"], (x0, p0) => expectString(x0, false, p0)),
319
- notes: expectArray(extractEntry(jCpy, 'notes', false, path), false, [...path, ".notes"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, Annotation.fromJSON)),
319
+ notes: expectArray(extractEntry(jCpy, 'notes', false, path), false, [...path, ".notes"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, DecryptedAnnotation.fromJSON)),
320
320
  qualifiedLinks: expectMap(extractEntry(jCpy, 'qualifiedLinks', false, path), false, [...path, ".qualifiedLinks"], (k0, p0) => expectStringEnum(k0, false, p0, LinkQualification, 'LinkQualification'), (v0, p0) => expectMap(v0, false, p0, (k1, p1) => expectString(k1, false, p1), (v1, p1) => expectString(v1, false, p1))),
321
321
  codes: expectArray(extractEntry(jCpy, 'codes', false, path), false, [...path, ".codes"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, CodeStub.fromJSON)),
322
322
  tags: expectArray(extractEntry(jCpy, 'tags', false, path), false, [...path, ".tags"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, CodeStub.fromJSON)),
@@ -639,7 +639,7 @@ export class EncryptedService {
639
639
  responsible: expectString(extractEntry(jCpy, 'responsible', false, path), true, [...path, ".responsible"]),
640
640
  comment: expectString(extractEntry(jCpy, 'comment', false, path), true, [...path, ".comment"]),
641
641
  invoicingCodes: expectArray(extractEntry(jCpy, 'invoicingCodes', false, path), false, [...path, ".invoicingCodes"], (x0, p0) => expectString(x0, false, p0)),
642
- notes: expectArray(extractEntry(jCpy, 'notes', false, path), false, [...path, ".notes"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, Annotation.fromJSON)),
642
+ notes: expectArray(extractEntry(jCpy, 'notes', false, path), false, [...path, ".notes"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, EncryptedAnnotation.fromJSON)),
643
643
  qualifiedLinks: expectMap(extractEntry(jCpy, 'qualifiedLinks', false, path), false, [...path, ".qualifiedLinks"], (k0, p0) => expectStringEnum(k0, false, p0, LinkQualification, 'LinkQualification'), (v0, p0) => expectMap(v0, false, p0, (k1, p1) => expectString(k1, false, p1), (v1, p1) => expectString(v1, false, p1))),
644
644
  codes: expectArray(extractEntry(jCpy, 'codes', false, path), false, [...path, ".codes"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, CodeStub.fromJSON)),
645
645
  tags: expectArray(extractEntry(jCpy, 'tags', false, path), false, [...path, ".tags"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, CodeStub.fromJSON)),
@@ -66,13 +66,17 @@ export interface SdkOptions {
66
66
  */
67
67
  readonly jsonPatcher?: JsonPatcher;
68
68
  /**
69
- * If true the SDK will use lenient deserialization of the entities coming from the backend.
69
+ * If true, on deserialization of data coming from the backend or from the decrypted content of an entity any
70
+ * field that is not present in the data model will be ignored.
70
71
  *
71
- * This could be helpful when developing using the nightly deployments of the backend, as the SDK will ignore minor changes to the data model.
72
+ * Note that updating an entity where some fields were ignored during deserialization will result in data loss.
72
73
  *
73
- * This option however could cause loss of data when connecting with incompatible versions of the backend, and should be disabled in production.
74
+ * If the ignored keys are coming from the encrypted content of an entity you can provide a {@link jsonPatcher}
75
+ * to specify how the unknown fields should be migrated.
76
+ *
77
+ * This behaviour is disabled by default (strict by default).
74
78
  */
75
- readonly lenientJson?: boolean;
79
+ readonly ignoreUnknownFields?: boolean;
76
80
  /**
77
81
  * If not null the SDK will immediately set the data owner scope to the provided value after login.
78
82
  */
@@ -98,13 +102,14 @@ export interface BasicSdkOptions {
98
102
  */
99
103
  readonly groupSelector?: (availableGroups: Array<UserGroup>) => Promise<string>;
100
104
  /**
101
- * If true the SDK will use lenient deserialization of the entities coming from the backend.
105
+ * If true, on deserialization of data coming from the backend or from the decrypted content of an entity any
106
+ * field that is not present in the data model will be ignored.
102
107
  *
103
- * This could be helpful when developing using the nightly deployments of the backend, as the SDK will ignore minor changes to the data model.
108
+ * Note that updating an entity where some fields were ignored during deserialization will result in data loss.
104
109
  *
105
- * This option however could cause loss of data when connecting with incompatible versions of the backend, and should be disabled in production.
110
+ * This behaviour is disabled by default (strict by default).
106
111
  */
107
- readonly lenientJson?: boolean;
112
+ readonly ignoreUnknownFields?: boolean;
108
113
  /**
109
114
  * If not null the SDK will immediately set the data owner scope to the provided value after login.
110
115
  */
@@ -141,13 +146,14 @@ export interface BasicToFullSdkOptions {
141
146
  }
142
147
  export interface AnonymousSdkOptions {
143
148
  /**
144
- * If true the SDK will use lenient deserialization of the entities coming from the backend.
149
+ * If true, on deserialization of data coming from the backend or from the decrypted content of an entity any
150
+ * field that is not present in the data model will be ignored.
145
151
  *
146
- * This could be helpful when developing using the nightly deployments of the backend, as the SDK will ignore minor changes to the data model.
152
+ * Note that updating an entity where some fields were ignored during deserialization will result in data loss.
147
153
  *
148
- * This option however could cause loss of data when connecting with incompatible versions of the backend, and should be disabled in production.
154
+ * This behaviour is disabled by default (strict by default).
149
155
  */
150
- readonly lenientJson?: boolean;
156
+ readonly ignoreUnknownFields?: boolean;
151
157
  }
152
158
  export interface EncryptedFieldsConfiguration {
153
159
  readonly accessLog?: Array<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icure/cardinal-sdk",
3
- "version": "2.9.0",
3
+ "version": "2.10.0",
4
4
  "main": "cardinal-sdk-ts.mjs",
5
5
  "types": "cardinal-sdk-ts.d.mts",
6
6
  "devDependencies": {