@icure/cardinal-sdk 3.0.0-PREVIEW-2 → 3.0.0-PREVIEW-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.
Files changed (94) hide show
  1. package/Kotlin-DateTime-library-kotlinx-datetime.mjs +1 -1
  2. package/api/ApplicationSettingsApi.d.mts +6 -0
  3. package/api/ApplicationSettingsApi.mjs +1 -0
  4. package/api/CryptoApi.d.mts +23 -0
  5. package/api/DataOwnerApi.d.mts +107 -0
  6. package/api/DocumentTemplateApi.d.mts +22 -0
  7. package/api/DocumentTemplateApi.mjs +1 -0
  8. package/api/EntityReferenceApi.d.mts +5 -0
  9. package/api/EntityReferenceApi.mjs +1 -0
  10. package/api/EntityTemplateApi.d.mts +24 -0
  11. package/api/EntityTemplateApi.mjs +1 -0
  12. package/api/HealthcarePartyApi.d.mts +10 -0
  13. package/api/KeywordApi.d.mts +14 -0
  14. package/api/KeywordApi.mjs +1 -0
  15. package/api/MedicalLocationApi.d.mts +17 -0
  16. package/api/MedicalLocationApi.mjs +1 -0
  17. package/api/TarificationApi.d.mts +27 -0
  18. package/api/TarificationApi.mjs +1 -0
  19. package/api/TimeTableApi.d.mts +26 -0
  20. package/api/TimeTableApi.mjs +1 -0
  21. package/cardinal-sdk-ts.mjs +43382 -42838
  22. package/cardinal-sdk.mjs +111008 -107369
  23. package/crypto/CryptoStrategies.d.mts +44 -8
  24. package/crypto/CryptoStrategies.mjs +41 -7
  25. package/crypto/entities/BulkShareByIdsResult.d.mts +31 -17
  26. package/crypto/entities/BulkShareByIdsResult.mjs +5 -5
  27. package/crypto/entities/FailedRequestDetails.d.mts +13 -9
  28. package/crypto/entities/FailedRequestDetails.mjs +10 -7
  29. package/crypto/entities/SecretIdShareOptions.d.mts +4 -0
  30. package/crypto/entities/SecretIdShareOptions.mjs +4 -0
  31. package/crypto/entities/SecretIdUseOption.d.mts +5 -0
  32. package/crypto/entities/ShareAllPatientDataOptions.d.mts +49 -0
  33. package/crypto/entities/ShareAllPatientDataOptions.mjs +58 -0
  34. package/crypto/entities/ShareRequestPurpose.d.mts +12 -0
  35. package/crypto/entities/ShareRequestPurpose.mjs +14 -0
  36. package/crypto/entities/ShareRequestSummary.d.mts +51 -0
  37. package/crypto/entities/ShareRequestSummary.mjs +21 -0
  38. package/crypto/entities/SharedSecretIdsSource.d.mts +8 -0
  39. package/crypto/entities/SharedSecretIdsSource.mjs +10 -0
  40. package/crypto/entities/SuccessfulRequestDetails.d.mts +22 -0
  41. package/crypto/entities/SuccessfulRequestDetails.mjs +11 -0
  42. package/crypto.d.mts +4 -1
  43. package/crypto.mjs +4 -1
  44. package/filters/ClassificationFilters.d.mts +27 -0
  45. package/filters/ClassificationFilters.mjs +8 -0
  46. package/filters/MedicalLocationFilters.d.mts +8 -0
  47. package/filters/MedicalLocationFilters.mjs +6 -0
  48. package/filters/TimeTableFilters.d.mts +12 -0
  49. package/filters/TimeTableFilters.mjs +6 -0
  50. package/kotlin-kotlin-stdlib.mjs +33 -16
  51. package/kotlinx-coroutines-core.mjs +8 -8
  52. package/model/ApplicationSettings.d.mts +87 -0
  53. package/model/ApplicationSettings.mjs +256 -0
  54. package/model/DocumentTemplate.d.mts +35 -0
  55. package/model/DocumentTemplate.mjs +162 -0
  56. package/model/EntityReference.d.mts +10 -0
  57. package/model/EntityReference.mjs +46 -0
  58. package/model/EntityTemplate.d.mts +16 -0
  59. package/model/EntityTemplate.mjs +81 -0
  60. package/model/GroupScoped.d.mts +18 -0
  61. package/model/Keyword.d.mts +23 -0
  62. package/model/Keyword.mjs +99 -0
  63. package/model/ListOfIds.d.mts +6 -0
  64. package/model/ListOfIds.mjs +28 -0
  65. package/model/MedicalLocation.d.mts +28 -0
  66. package/model/MedicalLocation.mjs +116 -0
  67. package/model/PaginatedDocumentKeyIdPair.d.mts +0 -1
  68. package/model/PaginatedDocumentKeyIdPair.mjs +0 -1
  69. package/model/Tarification.d.mts +50 -0
  70. package/model/Tarification.mjs +178 -0
  71. package/model/TimeTable.d.mts +25 -0
  72. package/model/TimeTable.mjs +111 -0
  73. package/model/base/AppendixType.d.mts +5 -0
  74. package/model/base/AppendixType.mjs +7 -0
  75. package/model/base/CodeFlag.d.mts +80 -0
  76. package/model/base/CodeFlag.mjs +82 -0
  77. package/model/base/ReportVersion.d.mts +3 -0
  78. package/model/base/ReportVersion.mjs +5 -0
  79. package/model/embed/HealthElementAsserter.d.mts +30 -1
  80. package/model/embed/HealthElementAsserter.mjs +41 -1
  81. package/model/embed/KeywordSubword.d.mts +8 -0
  82. package/model/embed/KeywordSubword.mjs +35 -0
  83. package/model/embed/LetterValue.d.mts +9 -0
  84. package/model/embed/LetterValue.mjs +47 -0
  85. package/model/embed/Periodicity.d.mts +8 -0
  86. package/model/embed/Periodicity.mjs +36 -0
  87. package/model/embed/TimeTableHour.d.mts +7 -0
  88. package/model/embed/TimeTableHour.mjs +35 -0
  89. package/model/embed/TimeTableItem.d.mts +19 -0
  90. package/model/embed/TimeTableItem.mjs +96 -0
  91. package/model/embed/Valorisation.d.mts +56 -0
  92. package/model/embed/Valorisation.mjs +188 -0
  93. package/package.json +1 -1
  94. package/subscription/EntitySubscriptionEvent.d.mts +3 -0
@@ -4,7 +4,7 @@ import { KeypairFingerprintV1String } from "../model/specializations/KeypairFing
4
4
  import { CryptoActorStubWithType } from "../model/CryptoActorStubWithType.mjs";
5
5
  import { RecoveryResult } from "./entities/RecoveryResult.mjs";
6
6
  import { RecoveryDataKey } from "./entities/RecoveryDataKey.mjs";
7
- import { RsaAlgorithm, XCryptoService, XRsaKeypair } from "./CryptoService.mjs";
7
+ import { RsaAlgorithm, RsaEncryptionAlgorithm, XCryptoService, XRsaKeypair } from "./CryptoService.mjs";
8
8
  import { CardinalApis } from "../sdk/CardinalSdk.mjs";
9
9
  /**
10
10
  * Allows customizing the behavior of the crypto api to better suit your needs.
@@ -54,21 +54,57 @@ export declare class CryptoStrategies {
54
54
  */
55
55
  generateNewKeyForDataOwner(self: DataOwnerWithType, cryptoPrimitives: XCryptoService): Promise<CryptoStrategies.KeyGenerationRequestResult>;
56
56
  /**
57
- * Verifies if the public keys of a data owner which will be the delegate of a new exchange key do actually belong to the person the data owner
58
- * represents. This method is not called when the delegate would be the current data owner for the api.
57
+ * Verifies if the public keys of a data owner which will be the delegate of new exchange data do actually belong to
58
+ * the person the data owner represents; if you do not override this method the public keys of the delegate are
59
+ * obtained from the cardinal backend and are fully trusted.
59
60
  *
60
- * The user will have to obtain the verified public keys of the delegate from outside iCure, for example by email with another hcp, by checking the
61
- * personal website of the other user, or by scanning verification qr codes at the doctor office...
61
+ * Note that this method is not called when:
62
+ * - The delegate id the current SDK delegator actor
63
+ * - The delegate is a parent type data owner linked from the current SDK delegator actor.
64
+ * - The SDK is creating exchange data to a simple-type group of data owners (in that case [getDelegatesPublicKeys] is used)
65
+ *
66
+ * There are two approaches you can use for verification of public keys: a separate service not controlled by iCure,
67
+ * or interaction with the end user.
68
+ *
69
+ * For example this method may ask the end user to compare the public keys with verified public keys of the delegate
70
+ * obtained from out of iCure, such as an email, the personal website of the other user, or by scanning verification
71
+ * qr codes at the doctor office.
72
+ *
73
+ * As long as one of the public keys is verified the creation of a new exchange key will succeed.
74
+ *
75
+ * If no public key is verified the operation will fail.
62
76
  *
63
- * As long as one of the public keys is verified the creation of a new exchange key will succeed. If no public key is verified the operation will
64
- * fail.
65
77
  * @param delegate the potential data owner delegate.
66
78
  * @param publicKeys public keys requiring verification, in spki hex-encoded format.
67
79
  * @param cryptoPrimitives cryptographic primitives you can use to support the process.
68
- * @param groupId the id of the data owner's group, or null if the data owner is in the same group as the current user
80
+ * @param groupId the id of the delegate data owner's group, or null if the data owner is in the same group as the current user
69
81
  * @return all verified public keys, in spki hex-encoded format.
70
82
  */
71
83
  verifyDelegatePublicKeys(delegate: CryptoActorStubWithType, publicKeys: Array<SpkiHexString>, cryptoPrimitives: XCryptoService, groupId: string | undefined): Promise<Array<SpkiHexString>>;
84
+ /**
85
+ * Similarly to [verifyDelegatePublicKeys] this method can be used if you don't want the SDK to fully trust the
86
+ * public keys coming from the cardinal backend, however this method is only called when creating exchange data for
87
+ * a simple-type data owner group, which may require to get validated public keys for many data owners.
88
+ *
89
+ * In that case interaction with the end-user is undesired, and it would be better instead to have a dedicated
90
+ * service separated from cardinal that provides the public keys of your cardinal data owners.
91
+ *
92
+ * Note that:
93
+ * - Returning null means the SDK will retrieve public keys from the cardinal backend and fully trust them.
94
+ * - If this method does not return null, it must provide at least a key for each delegate
95
+ * - Unlike [verifyDelegatePublicKeys] this method might be called even for delegates that are parent of the current
96
+ * SDK delegator actor.
97
+ * - The keys returned by this method will not be checked against the cardinal backend; if there are any
98
+ * inconsistencies the SDK might create invalid exchange data.
99
+ *
100
+ * @param delegates delegates for which the public keys are required.
101
+ * @param groupId the id of the delegate data owners' group, or null if their group is the same as the current user
102
+ */
103
+ getDelegatesPublicKeys(delegates: Array<string>, groupId: string | undefined): Promise<{
104
+ [delegateId: string]: {
105
+ [publicKey: SpkiHexString]: RsaEncryptionAlgorithm;
106
+ };
107
+ } | undefined>;
72
108
  /**
73
109
  * Specifies if a data owner requires anonymous delegations, i.e. his id should not appear unencrypted in new secure
74
110
  * delegations.
@@ -51,23 +51,57 @@ export class CryptoStrategies {
51
51
  return Promise.resolve(CryptoStrategies.KeyGenerationRequestResult.Allow);
52
52
  }
53
53
  /**
54
- * Verifies if the public keys of a data owner which will be the delegate of a new exchange key do actually belong to the person the data owner
55
- * represents. This method is not called when the delegate would be the current data owner for the api.
54
+ * Verifies if the public keys of a data owner which will be the delegate of new exchange data do actually belong to
55
+ * the person the data owner represents; if you do not override this method the public keys of the delegate are
56
+ * obtained from the cardinal backend and are fully trusted.
56
57
  *
57
- * The user will have to obtain the verified public keys of the delegate from outside iCure, for example by email with another hcp, by checking the
58
- * personal website of the other user, or by scanning verification qr codes at the doctor office...
58
+ * Note that this method is not called when:
59
+ * - The delegate id the current SDK delegator actor
60
+ * - The delegate is a parent type data owner linked from the current SDK delegator actor.
61
+ * - The SDK is creating exchange data to a simple-type group of data owners (in that case [getDelegatesPublicKeys] is used)
62
+ *
63
+ * There are two approaches you can use for verification of public keys: a separate service not controlled by iCure,
64
+ * or interaction with the end user.
65
+ *
66
+ * For example this method may ask the end user to compare the public keys with verified public keys of the delegate
67
+ * obtained from out of iCure, such as an email, the personal website of the other user, or by scanning verification
68
+ * qr codes at the doctor office.
69
+ *
70
+ * As long as one of the public keys is verified the creation of a new exchange key will succeed.
71
+ *
72
+ * If no public key is verified the operation will fail.
59
73
  *
60
- * As long as one of the public keys is verified the creation of a new exchange key will succeed. If no public key is verified the operation will
61
- * fail.
62
74
  * @param delegate the potential data owner delegate.
63
75
  * @param publicKeys public keys requiring verification, in spki hex-encoded format.
64
76
  * @param cryptoPrimitives cryptographic primitives you can use to support the process.
65
- * @param groupId the id of the data owner's group, or null if the data owner is in the same group as the current user
77
+ * @param groupId the id of the delegate data owner's group, or null if the data owner is in the same group as the current user
66
78
  * @return all verified public keys, in spki hex-encoded format.
67
79
  */
68
80
  verifyDelegatePublicKeys(delegate, publicKeys, cryptoPrimitives, groupId) {
69
81
  return Promise.resolve(publicKeys);
70
82
  }
83
+ /**
84
+ * Similarly to [verifyDelegatePublicKeys] this method can be used if you don't want the SDK to fully trust the
85
+ * public keys coming from the cardinal backend, however this method is only called when creating exchange data for
86
+ * a simple-type data owner group, which may require to get validated public keys for many data owners.
87
+ *
88
+ * In that case interaction with the end-user is undesired, and it would be better instead to have a dedicated
89
+ * service separated from cardinal that provides the public keys of your cardinal data owners.
90
+ *
91
+ * Note that:
92
+ * - Returning null means the SDK will retrieve public keys from the cardinal backend and fully trust them.
93
+ * - If this method does not return null, it must provide at least a key for each delegate
94
+ * - Unlike [verifyDelegatePublicKeys] this method might be called even for delegates that are parent of the current
95
+ * SDK delegator actor.
96
+ * - The keys returned by this method will not be checked against the cardinal backend; if there are any
97
+ * inconsistencies the SDK might create invalid exchange data.
98
+ *
99
+ * @param delegates delegates for which the public keys are required.
100
+ * @param groupId the id of the delegate data owners' group, or null if their group is the same as the current user
101
+ */
102
+ getDelegatesPublicKeys(delegates, groupId) {
103
+ return Promise.resolve(undefined);
104
+ }
71
105
  /**
72
106
  * Specifies if a data owner requires anonymous delegations, i.e. his id should not appear unencrypted in new secure
73
107
  * delegations.
@@ -1,13 +1,15 @@
1
+ import { EntityReferenceInGroup } from '../../model/EntityReferenceInGroup.mjs';
1
2
  import { FailedRequestDetails } from './FailedRequestDetails.mjs';
3
+ import { SuccessfulRequestDetails } from './SuccessfulRequestDetails.mjs';
2
4
  /**
3
5
  *
4
6
  * Outcome of a "share by ids" bulk operation: sharing many already-existing entities (retrieved server-side by id)
5
7
  * with one or more delegates, using the same share options for the whole batch.
6
8
  *
7
9
  * For every entity id that was found (i.e. not in [notFoundIds]) and every delegate the operation was called with,
8
- * that (entity id, delegate id) pair is accounted for in exactly one place: as a delegate id under that entity id in
9
- * [successfulDelegateIdsByEntityId], as a delegate id under that entity id in [unmodifiedDelegateIdsByEntityId], or
10
- * as an entry in [shareErrors] - never in more than one of these, and never in none of them.
10
+ * that (entity id, delegate) pair is accounted for in exactly one place: as a successful request under that entity id
11
+ * in [successfulRequestsByEntityId], as a delegate under that entity id in [unmodifiedDelegatesByEntityId], or as an
12
+ * entry in [shareErrors] - never in more than one of these, and never in none of them.
11
13
  */
12
14
  export declare class BulkShareByIdsResult {
13
15
  /**
@@ -19,24 +21,27 @@ export declare class BulkShareByIdsResult {
19
21
  notFoundIds: Array<string>;
20
22
  /**
21
23
  *
22
- * For each entity id, the ids of the delegates for which a share request was actually sent and succeeded. An
23
- * entity id with no successful delegate to report is simply absent from this map - it never appears with an
24
- * empty set.
24
+ * For each entity id, the requests that were actually sent for that entity and succeeded, one per delegate. An
25
+ * entity id with no successful request to report is simply absent from this map - it never appears with an empty
26
+ * set.
27
+ *
28
+ * In addition to the requested delegates this may contain requests for delegates the operation was not called
29
+ * with, recognisable by a [ShareRequestPurpose.Migration] purpose: see [shareErrors] for what those are.
25
30
  */
26
- successfulDelegateIdsByEntityId: {
27
- [key: string]: Array<string>;
31
+ successfulRequestsByEntityId: {
32
+ [key: string]: Array<SuccessfulRequestDetails>;
28
33
  };
29
34
  /**
30
35
  *
31
- * For each entity id, the ids of the delegates for which no update request had to be sent at all, because that
32
- * delegate already had access to everything requested with a sufficient access level. This is tracked per
33
- * delegate, not per entity: if an entity was shared with two delegates and only one of them already had
34
- * everything, only that delegate's id ends up here - the other one ends up under
35
- * [successfulDelegateIdsByEntityId] or in [shareErrors] instead. An entity id with no unmodified delegate to
36
- * report is simply absent from this map - it never appears with an empty set.
36
+ * For each entity id, the delegates for which no update request had to be sent at all, because that delegate
37
+ * already had access to everything requested with a sufficient access level. This is tracked per delegate, not
38
+ * per entity: if an entity was shared with two delegates and only one of them already had everything, only that
39
+ * delegate ends up here - the other one ends up under [successfulRequestsByEntityId] or in [shareErrors]
40
+ * instead. An entity id with no unmodified delegate to report is simply absent from this map - it never appears
41
+ * with an empty set.
37
42
  */
38
- unmodifiedDelegateIdsByEntityId: {
39
- [key: string]: Array<string>;
43
+ unmodifiedDelegatesByEntityId: {
44
+ [key: string]: Array<EntityReferenceInGroup>;
40
45
  };
41
46
  /**
42
47
  *
@@ -44,7 +49,16 @@ export declare class BulkShareByIdsResult {
44
49
  * the distinction between a [FailedRequestDetails.ResolutionFailed] (the requested share options couldn't be
45
50
  * satisfied locally, e.g. [ShareMetadataBehaviour.Required] was asked for something unavailable) and a
46
51
  * [FailedRequestDetails.RequestRejected] (a well-formed request was sent and the server rejected it).
52
+ *
53
+ * In addition to the requested delegates this may contain entries for delegates the operation was not called
54
+ * with: those are the internal requests the sdk piggybacks on a share to migrate the legacy delegations of the
55
+ * current data owner hierarchy, and they carry a [ShareRequestPurpose.Migration] purpose. A failure of such a
56
+ * request means the migration didn't happen, not that the requested sharing didn't (the requested sharing of a
57
+ * delegate that was not requested was, by definition, not requested). When a requested delegate is also a data
58
+ * owner whose legacy delegations need to be migrated the two are done by a single request, whose purpose is
59
+ * [ShareRequestPurpose.RequestedShareAndMigration]: a failure of that one does mean the requested sharing
60
+ * failed.
47
61
  */
48
62
  shareErrors: Array<FailedRequestDetails>;
49
- constructor(partial: Partial<BulkShareByIdsResult> & Pick<BulkShareByIdsResult, "notFoundIds" | "successfulDelegateIdsByEntityId" | "unmodifiedDelegateIdsByEntityId" | "shareErrors">);
63
+ constructor(partial: Partial<BulkShareByIdsResult> & Pick<BulkShareByIdsResult, "notFoundIds" | "successfulRequestsByEntityId" | "unmodifiedDelegatesByEntityId" | "shareErrors">);
50
64
  }
@@ -4,15 +4,15 @@
4
4
  * with one or more delegates, using the same share options for the whole batch.
5
5
  *
6
6
  * For every entity id that was found (i.e. not in [notFoundIds]) and every delegate the operation was called with,
7
- * that (entity id, delegate id) pair is accounted for in exactly one place: as a delegate id under that entity id in
8
- * [successfulDelegateIdsByEntityId], as a delegate id under that entity id in [unmodifiedDelegateIdsByEntityId], or
9
- * as an entry in [shareErrors] - never in more than one of these, and never in none of them.
7
+ * that (entity id, delegate) pair is accounted for in exactly one place: as a successful request under that entity id
8
+ * in [successfulRequestsByEntityId], as a delegate under that entity id in [unmodifiedDelegatesByEntityId], or as an
9
+ * entry in [shareErrors] - never in more than one of these, and never in none of them.
10
10
  */
11
11
  export class BulkShareByIdsResult {
12
12
  constructor(partial) {
13
13
  this.notFoundIds = partial.notFoundIds;
14
- this.successfulDelegateIdsByEntityId = partial.successfulDelegateIdsByEntityId;
15
- this.unmodifiedDelegateIdsByEntityId = partial.unmodifiedDelegateIdsByEntityId;
14
+ this.successfulRequestsByEntityId = partial.successfulRequestsByEntityId;
15
+ this.unmodifiedDelegatesByEntityId = partial.unmodifiedDelegatesByEntityId;
16
16
  this.shareErrors = partial.shareErrors;
17
17
  }
18
18
  }
@@ -1,5 +1,6 @@
1
1
  import { EntityReferenceInGroup } from '../../model/EntityReferenceInGroup.mjs';
2
- import { DelegateShareOptions } from './DelegateShareOptions.mjs';
2
+ import { ShareRequestPurpose } from './ShareRequestPurpose.mjs';
3
+ import { ShareRequestSummary } from './ShareRequestSummary.mjs';
3
4
  /**
4
5
  *
5
6
  * Details about a single (entity, delegate) share-or-metadata-update request that did not succeed, returned as part
@@ -46,11 +47,14 @@ export declare namespace FailedRequestDetails {
46
47
  * @param shouldRetry whether the SDK considers this specific failure worth retrying (e.g. with a freshly
47
48
  * fetched revision of the entity). Bulk operations that support `autoRetry` already do this automatically once
48
49
  * before giving up, so by the time you observe this you can assume that retry (if applicable) already happened.
49
- * @param updatedForMigration `true` if this request wasn't actually about sharing or updating access for
50
- * [delegateReference], but rather an internal step to migrate that delegate's pre-existing legacy delegation to
51
- * the current secure-delegation format. Most callers can ignore this field.
52
- * @param request the low-level share options that were sent to the server for this (entity, delegate) pair, or
53
- * `null` if this was an [updatedForMigration] request (which doesn't carry share options of its own).
50
+ * @param purpose what the rejected request was for. Most callers can ignore this field: it is
51
+ * [ShareRequestPurpose.RequestedShare] for a plain share, and the two other values only tell you that the sdk also
52
+ * had (or only had) to migrate the legacy delegations of [delegateReference] along the way.
53
+ * @param requestSummary a non-sensitive summary of what the rejected request was asking for, to help understand
54
+ * why it was rejected. `null` when the sdk didn't resolve any share options for this pair on the caller's behalf,
55
+ * i.e. when [purpose] is [ShareRequestPurpose.Migration], or when the caller used one of the lower-level share
56
+ * methods that take an already resolved [DelegateShareOptions] (in which case the caller already holds the exact
57
+ * options that were sent).
54
58
  */
55
59
  class RequestRejected {
56
60
  entityId: string;
@@ -58,9 +62,9 @@ export declare namespace FailedRequestDetails {
58
62
  reason: string | undefined;
59
63
  code: number;
60
64
  shouldRetry: boolean;
61
- updatedForMigration: boolean;
62
- request: DelegateShareOptions | undefined;
65
+ purpose: ShareRequestPurpose;
66
+ requestSummary: ShareRequestSummary | undefined;
63
67
  readonly $ktClass: 'com.icure.cardinal.sdk.crypto.entities.FailedRequestDetails.RequestRejected';
64
- constructor(partial: Partial<RequestRejected> & Pick<RequestRejected, "entityId" | "delegateReference" | "reason" | "code" | "shouldRetry" | "updatedForMigration" | "request">);
68
+ constructor(partial: Partial<RequestRejected> & Pick<RequestRejected, "entityId" | "delegateReference" | "reason" | "code" | "shouldRetry" | "purpose" | "requestSummary">);
65
69
  }
66
70
  }
@@ -38,11 +38,14 @@ export var FailedRequestDetails;
38
38
  * @param shouldRetry whether the SDK considers this specific failure worth retrying (e.g. with a freshly
39
39
  * fetched revision of the entity). Bulk operations that support `autoRetry` already do this automatically once
40
40
  * before giving up, so by the time you observe this you can assume that retry (if applicable) already happened.
41
- * @param updatedForMigration `true` if this request wasn't actually about sharing or updating access for
42
- * [delegateReference], but rather an internal step to migrate that delegate's pre-existing legacy delegation to
43
- * the current secure-delegation format. Most callers can ignore this field.
44
- * @param request the low-level share options that were sent to the server for this (entity, delegate) pair, or
45
- * `null` if this was an [updatedForMigration] request (which doesn't carry share options of its own).
41
+ * @param purpose what the rejected request was for. Most callers can ignore this field: it is
42
+ * [ShareRequestPurpose.RequestedShare] for a plain share, and the two other values only tell you that the sdk also
43
+ * had (or only had) to migrate the legacy delegations of [delegateReference] along the way.
44
+ * @param requestSummary a non-sensitive summary of what the rejected request was asking for, to help understand
45
+ * why it was rejected. `null` when the sdk didn't resolve any share options for this pair on the caller's behalf,
46
+ * i.e. when [purpose] is [ShareRequestPurpose.Migration], or when the caller used one of the lower-level share
47
+ * methods that take an already resolved [DelegateShareOptions] (in which case the caller already holds the exact
48
+ * options that were sent).
46
49
  */
47
50
  class RequestRejected {
48
51
  constructor(partial) {
@@ -52,8 +55,8 @@ export var FailedRequestDetails;
52
55
  this.reason = partial.reason;
53
56
  this.code = partial.code;
54
57
  this.shouldRetry = partial.shouldRetry;
55
- this.updatedForMigration = partial.updatedForMigration;
56
- this.request = partial.request;
58
+ this.purpose = partial.purpose;
59
+ this.requestSummary = partial.requestSummary;
57
60
  }
58
61
  }
59
62
  FailedRequestDetails.RequestRejected = RequestRejected;
@@ -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)
@@ -18,6 +18,11 @@ export declare namespace SecretIdUseOption {
18
18
  * Note that the SDK will not check that the secret id you used is actually a secret id of the owning entity.
19
19
  */
20
20
  class Use {
21
+ /**
22
+ * Specify explicitly which secret ids to use. The secretIds can also be empty, in which case the value is
23
+ * equivalent to [UseNone].
24
+ * Note that the SDK will not check that the secret id you used is actually a secret id of the owning entity.
25
+ * / */
21
26
  secretIds: Array<string>;
22
27
  readonly $ktClass: 'com.icure.cardinal.sdk.crypto.entities.SecretIdUseOption.Use';
23
28
  constructor(partial: Partial<Use> & Pick<Use, "secretIds">);
@@ -0,0 +1,49 @@
1
+ import { EncryptedPatient } from '../../model/Patient.mjs';
2
+ import { FailedRequestDetails } from './FailedRequestDetails.mjs';
3
+ import { ShareAllPatientDataOptions as ShareAllPatientDataOptions_ } from './ShareAllPatientDataOptions.mjs';
4
+ export declare namespace ShareAllPatientDataOptions {
5
+ /**
6
+ *
7
+ * Specifies which entities related to a Patient will be shared by [PatientApi.shareAllDataOfPatient].
8
+ */
9
+ enum Tag {
10
+ All = "All",
11
+ MedicalInformation = "MedicalInformation",
12
+ FinancialInformation = "FinancialInformation"
13
+ }
14
+ enum ShareableEntity {
15
+ CalendarItem = "CalendarItem",
16
+ Contact = "Contact",
17
+ Classification = "Classification",
18
+ Document = "Document",
19
+ Form = "Form",
20
+ HealthElement = "HealthElement",
21
+ Invoice = "Invoice",
22
+ Patient = "Patient"
23
+ }
24
+ class EntityResult {
25
+ success: boolean | undefined;
26
+ error: ShareAllPatientDataOptions_.SharePatientDataError | undefined;
27
+ modified: number;
28
+ constructor(partial: Partial<EntityResult> & Pick<EntityResult, "modified">);
29
+ }
30
+ class Result {
31
+ patient: EncryptedPatient;
32
+ statuses: {
33
+ [key in ShareAllPatientDataOptions_.ShareableEntity]?: ShareAllPatientDataOptions_.EntityResult;
34
+ };
35
+ constructor(partial: Partial<Result> & Pick<Result, "patient" | "statuses">);
36
+ }
37
+ type SharePatientDataError = BulkShareFailure | FailedRequest;
38
+ class BulkShareFailure {
39
+ errors: Array<FailedRequestDetails>;
40
+ message: string;
41
+ readonly $ktClass: 'com.icure.cardinal.sdk.crypto.entities.ShareAllPatientDataOptions.BulkShareFailure';
42
+ constructor(partial: Partial<BulkShareFailure> & Pick<BulkShareFailure, "errors" | "message">);
43
+ }
44
+ class FailedRequest {
45
+ description: string;
46
+ readonly $ktClass: 'com.icure.cardinal.sdk.crypto.entities.ShareAllPatientDataOptions.FailedRequest';
47
+ constructor(partial: Partial<FailedRequest> & Pick<FailedRequest, "description">);
48
+ }
49
+ }
@@ -0,0 +1,58 @@
1
+ export var ShareAllPatientDataOptions;
2
+ (function (ShareAllPatientDataOptions) {
3
+ /**
4
+ *
5
+ * Specifies which entities related to a Patient will be shared by [PatientApi.shareAllDataOfPatient].
6
+ */
7
+ let Tag;
8
+ (function (Tag) {
9
+ Tag["All"] = "All";
10
+ Tag["MedicalInformation"] = "MedicalInformation";
11
+ Tag["FinancialInformation"] = "FinancialInformation";
12
+ })(Tag = ShareAllPatientDataOptions.Tag || (ShareAllPatientDataOptions.Tag = {}));
13
+ let ShareableEntity;
14
+ (function (ShareableEntity) {
15
+ ShareableEntity["CalendarItem"] = "CalendarItem";
16
+ ShareableEntity["Contact"] = "Contact";
17
+ ShareableEntity["Classification"] = "Classification";
18
+ ShareableEntity["Document"] = "Document";
19
+ ShareableEntity["Form"] = "Form";
20
+ ShareableEntity["HealthElement"] = "HealthElement";
21
+ ShareableEntity["Invoice"] = "Invoice";
22
+ ShareableEntity["Patient"] = "Patient";
23
+ })(ShareableEntity = ShareAllPatientDataOptions.ShareableEntity || (ShareAllPatientDataOptions.ShareableEntity = {}));
24
+ class EntityResult {
25
+ constructor(partial) {
26
+ this.success = undefined;
27
+ this.error = undefined;
28
+ if ('success' in partial)
29
+ this.success = partial.success;
30
+ if ('error' in partial)
31
+ this.error = partial.error;
32
+ this.modified = partial.modified;
33
+ }
34
+ }
35
+ ShareAllPatientDataOptions.EntityResult = EntityResult;
36
+ class Result {
37
+ constructor(partial) {
38
+ this.patient = partial.patient;
39
+ this.statuses = partial.statuses;
40
+ }
41
+ }
42
+ ShareAllPatientDataOptions.Result = Result;
43
+ class BulkShareFailure {
44
+ constructor(partial) {
45
+ this.$ktClass = 'com.icure.cardinal.sdk.crypto.entities.ShareAllPatientDataOptions.BulkShareFailure';
46
+ this.errors = partial.errors;
47
+ this.message = partial.message;
48
+ }
49
+ }
50
+ ShareAllPatientDataOptions.BulkShareFailure = BulkShareFailure;
51
+ class FailedRequest {
52
+ constructor(partial) {
53
+ this.$ktClass = 'com.icure.cardinal.sdk.crypto.entities.ShareAllPatientDataOptions.FailedRequest';
54
+ this.description = partial.description;
55
+ }
56
+ }
57
+ ShareAllPatientDataOptions.FailedRequest = FailedRequest;
58
+ })(ShareAllPatientDataOptions || (ShareAllPatientDataOptions = {}));
@@ -0,0 +1,12 @@
1
+ /**
2
+ *
3
+ * What a single share-or-metadata-update request the sdk sent was actually for. Sharing an entity may require the sdk
4
+ * to also migrate the pre-existing legacy delegations of the data owners of the current hierarchy to the current
5
+ * secure-delegation format, and those migrations travel as requests of their own - sometimes merged with a request
6
+ * the caller asked for.
7
+ */
8
+ export declare enum ShareRequestPurpose {
9
+ RequestedShare = "RequestedShare",
10
+ Migration = "Migration",
11
+ RequestedShareAndMigration = "RequestedShareAndMigration"
12
+ }
@@ -0,0 +1,14 @@
1
+ // auto-generated file
2
+ /**
3
+ *
4
+ * What a single share-or-metadata-update request the sdk sent was actually for. Sharing an entity may require the sdk
5
+ * to also migrate the pre-existing legacy delegations of the data owners of the current hierarchy to the current
6
+ * secure-delegation format, and those migrations travel as requests of their own - sometimes merged with a request
7
+ * the caller asked for.
8
+ */
9
+ export var ShareRequestPurpose;
10
+ (function (ShareRequestPurpose) {
11
+ ShareRequestPurpose["RequestedShare"] = "RequestedShare";
12
+ ShareRequestPurpose["Migration"] = "Migration";
13
+ ShareRequestPurpose["RequestedShareAndMigration"] = "RequestedShareAndMigration";
14
+ })(ShareRequestPurpose || (ShareRequestPurpose = {}));
@@ -0,0 +1,51 @@
1
+ import { RequestedPermission } from '../../model/requests/RequestedPermission.mjs';
2
+ import { ShareMetadataBehaviour } from './ShareMetadataBehaviour.mjs';
3
+ import { SharedSecretIdsSource } from './SharedSecretIdsSource.mjs';
4
+ /**
5
+ *
6
+ * A non-sensitive summary of a share request the sdk built out of the share options provided by the caller: what was
7
+ * asked for each kind of metadata and how much of it the request was carrying, but never the metadata itself -
8
+ * sharing a secret id or an encryption key means putting the actual value in the request, and those values must not
9
+ * end up in an error object that callers routinely log.
10
+ *
11
+ * The counts are those of the resolved request, before the sdk dropped from it whatever the delegate can already
12
+ * access anyway (see [FailedRequestDetails.RequestRejected.requestSummary] for when you get one of these).
13
+ */
14
+ export declare class ShareRequestSummary {
15
+ /**
16
+ *
17
+ * The permissions that were requested for the delegate.
18
+ */
19
+ requestedPermissions: RequestedPermission;
20
+ /**
21
+ *
22
+ * Where the secret ids of the request came from.
23
+ */
24
+ secretIdsSource: SharedSecretIdsSource;
25
+ /**
26
+ *
27
+ * How many secret ids the request was carrying.
28
+ */
29
+ sharedSecretIdsCount: number;
30
+ /**
31
+ *
32
+ * The behaviour that was requested for the encryption key.
33
+ */
34
+ encryptionKeysBehaviour: ShareMetadataBehaviour;
35
+ /**
36
+ *
37
+ * How many encryption keys the request was carrying.
38
+ */
39
+ sharedEncryptionKeysCount: number;
40
+ /**
41
+ *
42
+ * The behaviour that was requested for the owning entity ids.
43
+ */
44
+ owningEntityIdsBehaviour: ShareMetadataBehaviour;
45
+ /**
46
+ *
47
+ * How many owning entity ids the request was carrying.
48
+ */
49
+ sharedOwningEntityIdsCount: number;
50
+ constructor(partial: Partial<ShareRequestSummary> & Pick<ShareRequestSummary, "requestedPermissions" | "secretIdsSource" | "sharedSecretIdsCount" | "encryptionKeysBehaviour" | "sharedEncryptionKeysCount" | "owningEntityIdsBehaviour" | "sharedOwningEntityIdsCount">);
51
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ *
3
+ * A non-sensitive summary of a share request the sdk built out of the share options provided by the caller: what was
4
+ * asked for each kind of metadata and how much of it the request was carrying, but never the metadata itself -
5
+ * sharing a secret id or an encryption key means putting the actual value in the request, and those values must not
6
+ * end up in an error object that callers routinely log.
7
+ *
8
+ * The counts are those of the resolved request, before the sdk dropped from it whatever the delegate can already
9
+ * access anyway (see [FailedRequestDetails.RequestRejected.requestSummary] for when you get one of these).
10
+ */
11
+ export class ShareRequestSummary {
12
+ constructor(partial) {
13
+ this.requestedPermissions = partial.requestedPermissions;
14
+ this.secretIdsSource = partial.secretIdsSource;
15
+ this.sharedSecretIdsCount = partial.sharedSecretIdsCount;
16
+ this.encryptionKeysBehaviour = partial.encryptionKeysBehaviour;
17
+ this.sharedEncryptionKeysCount = partial.sharedEncryptionKeysCount;
18
+ this.owningEntityIdsBehaviour = partial.owningEntityIdsBehaviour;
19
+ this.sharedOwningEntityIdsCount = partial.sharedOwningEntityIdsCount;
20
+ }
21
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ *
3
+ * Whether the secret ids carried by a share request were chosen by the caller or by the sdk.
4
+ */
5
+ export declare enum SharedSecretIdsSource {
6
+ AllAvailable = "AllAvailable",
7
+ ExplicitValues = "ExplicitValues"
8
+ }
@@ -0,0 +1,10 @@
1
+ // auto-generated file
2
+ /**
3
+ *
4
+ * Whether the secret ids carried by a share request were chosen by the caller or by the sdk.
5
+ */
6
+ export var SharedSecretIdsSource;
7
+ (function (SharedSecretIdsSource) {
8
+ SharedSecretIdsSource["AllAvailable"] = "AllAvailable";
9
+ SharedSecretIdsSource["ExplicitValues"] = "ExplicitValues";
10
+ })(SharedSecretIdsSource || (SharedSecretIdsSource = {}));
@@ -0,0 +1,22 @@
1
+ import { EntityReferenceInGroup } from '../../model/EntityReferenceInGroup.mjs';
2
+ import { ShareRequestPurpose } from './ShareRequestPurpose.mjs';
3
+ /**
4
+ *
5
+ * Details about a single (entity, delegate) share-or-metadata-update request that was sent and succeeded, returned as
6
+ * part of the success map of a bulk-share operation (e.g. [BulkShareByIdsResult.successfulRequestsByEntityId]).
7
+ */
8
+ export declare class SuccessfulRequestDetails {
9
+ /**
10
+ *
11
+ * The delegate this request shared with, or updated the delegation of.
12
+ */
13
+ delegateReference: EntityReferenceInGroup;
14
+ /**
15
+ *
16
+ * What this request was for. Most callers can ignore this field: it is [ShareRequestPurpose.RequestedShare] for a
17
+ * plain share, and the two other values only tell you that the sdk also had (or only had) to migrate the legacy
18
+ * delegations of that data owner along the way.
19
+ */
20
+ purpose: ShareRequestPurpose;
21
+ constructor(partial: Partial<SuccessfulRequestDetails> & Pick<SuccessfulRequestDetails, "delegateReference" | "purpose">);
22
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ *
3
+ * Details about a single (entity, delegate) share-or-metadata-update request that was sent and succeeded, returned as
4
+ * part of the success map of a bulk-share operation (e.g. [BulkShareByIdsResult.successfulRequestsByEntityId]).
5
+ */
6
+ export class SuccessfulRequestDetails {
7
+ constructor(partial) {
8
+ this.delegateReference = partial.delegateReference;
9
+ this.purpose = partial.purpose;
10
+ }
11
+ }