@icure/cardinal-sdk 2.0.0-PREVIEW-18.1 → 2.0.0-PREVIEW-21
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.
- package/Kermit-kermit-core.mjs +45 -40
- package/Kermit-kermit.mjs +6 -6
- package/Kotlin-DateTime-library-kotlinx-datetime.mjs +1577 -1577
- package/api/HealthcarePartyApi.d.mts +2 -0
- package/api/HealthcarePartyApiInGroup.d.mts +5 -0
- package/api/HealthcarePartyApiInGroup.mjs +1 -0
- package/api/RecoveryApi.d.mts +5 -1
- package/api.d.mts +1 -0
- package/api.mjs +1 -0
- package/bitops-library-bits.mjs +197 -0
- package/bitops-library-endian.mjs +117 -0
- package/cardinal-sdk-ts.d.mts +2 -2
- package/cardinal-sdk-ts.mjs +57007 -56794
- package/cardinal-sdk.mjs +120895 -120501
- package/core-library-digest.mjs +186 -0
- package/crypto/CryptoService.d.mts +17 -7
- package/error-library-error.mjs +42 -0
- package/hash-library-sha2.mjs +183 -0
- package/internal/BytesEncoding.d.mts +3 -0
- package/internal/BytesEncoding.mjs +99 -0
- package/internal/JsonDecodeUtils.d.mts +20 -0
- package/internal/JsonDecodeUtils.mjs +99 -0
- package/kerberus.mjs +557 -389
- package/kotlin-kotlin-stdlib.mjs +2445 -2713
- package/kotlinx-atomicfu.mjs +13 -13
- package/kotlinx-coroutines-core.mjs +2455 -2450
- package/kotlinx-io-kotlinx-io-bytestring.mjs +36 -36
- package/kotlinx-io-kotlinx-io-core.mjs +459 -459
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +2029 -2029
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1952 -1952
- package/kryptom-lib.mjs +3263 -1967
- package/ktor-ktor-client-content-negotiation.mjs +184 -184
- package/ktor-ktor-client-core.mjs +2713 -2713
- package/ktor-ktor-events.mjs +6 -6
- package/ktor-ktor-http-cio.mjs +481 -481
- package/ktor-ktor-http.mjs +693 -693
- package/ktor-ktor-io.mjs +963 -963
- package/ktor-ktor-serialization-kotlinx-json.mjs +7 -7
- package/ktor-ktor-serialization-kotlinx.mjs +238 -238
- package/ktor-ktor-serialization.mjs +109 -109
- package/ktor-ktor-utils.mjs +557 -557
- package/ktor-ktor-websockets.mjs +673 -673
- package/model/AccessLog.d.mts +5 -0
- package/model/AccessLog.mjs +168 -0
- package/model/Agenda.d.mts +2 -0
- package/model/Agenda.mjs +82 -0
- package/model/ApplicationSettings.d.mts +5 -0
- package/model/ApplicationSettings.mjs +140 -0
- package/model/BooleanResponse.d.mts +2 -0
- package/model/BooleanResponse.mjs +20 -0
- package/model/CalendarItem.d.mts +5 -0
- package/model/CalendarItem.mjs +290 -0
- package/model/CalendarItemType.d.mts +7 -0
- package/model/CalendarItemType.mjs +117 -0
- package/model/Classification.d.mts +5 -0
- package/model/Classification.mjs +148 -0
- package/model/Code.d.mts +2 -0
- package/model/Code.mjs +69 -0
- package/model/Contact.d.mts +5 -0
- package/model/Contact.mjs +218 -0
- package/model/CryptoActorStub.d.mts +2 -0
- package/model/CryptoActorStub.mjs +45 -0
- package/model/CryptoActorStubWithType.d.mts +2 -0
- package/model/CryptoActorStubWithType.mjs +25 -0
- package/model/DataOwnerRegistrationSuccess.d.mts +2 -0
- package/model/DataOwnerRegistrationSuccess.mjs +24 -0
- package/model/DataOwnerWithType.d.mts +7 -0
- package/model/DataOwnerWithType.mjs +80 -0
- package/model/DatabaseInitialisation.d.mts +2 -0
- package/model/DatabaseInitialisation.mjs +34 -0
- package/model/Device.d.mts +2 -0
- package/model/Device.mjs +99 -0
- package/model/Document.d.mts +5 -0
- package/model/Document.mjs +246 -0
- package/model/DocumentTemplate.d.mts +2 -0
- package/model/DocumentTemplate.mjs +91 -0
- package/model/EntityReference.d.mts +2 -0
- package/model/EntityReference.mjs +29 -0
- package/model/EntityReferenceInGroup.d.mts +2 -0
- package/model/EntityReferenceInGroup.mjs +23 -0
- package/model/EntityTemplate.d.mts +2 -0
- package/model/EntityTemplate.mjs +46 -0
- package/model/Form.d.mts +5 -0
- package/model/Form.mjs +204 -0
- package/model/FormTemplate.d.mts +2 -0
- package/model/FormTemplate.mjs +82 -0
- package/model/FrontEndMigration.d.mts +2 -0
- package/model/FrontEndMigration.mjs +57 -0
- package/model/Group.d.mts +2 -0
- package/model/Group.mjs +68 -0
- package/model/GroupDeletionReport.d.mts +2 -0
- package/model/GroupDeletionReport.mjs +24 -0
- package/model/HealthElement.d.mts +5 -0
- package/model/HealthElement.mjs +226 -0
- package/model/HealthcareParty.d.mts +2 -0
- package/model/HealthcareParty.mjs +182 -0
- package/model/IdWithRev.d.mts +2 -0
- package/model/IdWithRev.mjs +23 -0
- package/model/IndexingInfo.d.mts +2 -0
- package/model/IndexingInfo.mjs +21 -0
- package/model/Insurance.d.mts +2 -0
- package/model/Insurance.mjs +46 -0
- package/model/Invoice.d.mts +5 -0
- package/model/Invoice.mjs +468 -0
- package/model/Keyword.d.mts +2 -0
- package/model/Keyword.mjs +58 -0
- package/model/ListOfIds.d.mts +2 -0
- package/model/ListOfIds.mjs +20 -0
- package/model/ListOfProperties.d.mts +2 -0
- package/model/ListOfProperties.mjs +22 -0
- package/model/MaintenanceTask.d.mts +5 -0
- package/model/MaintenanceTask.mjs +152 -0
- package/model/MedicalLocation.d.mts +2 -0
- package/model/MedicalLocation.mjs +63 -0
- package/model/Message.d.mts +5 -0
- package/model/Message.mjs +248 -0
- package/model/PaginatedDocumentKeyIdPair.d.mts +2 -0
- package/model/PaginatedDocumentKeyIdPair.mjs +24 -0
- package/model/Patient.d.mts +5 -0
- package/model/Patient.mjs +491 -0
- package/model/Place.d.mts +2 -0
- package/model/Place.mjs +33 -0
- package/model/PropertyStub.d.mts +5 -0
- package/model/PropertyStub.mjs +74 -0
- package/model/PropertyTypeStub.d.mts +2 -0
- package/model/PropertyTypeStub.mjs +26 -0
- package/model/PublicAgendasAndCalendarItemTypes.d.mts +2 -0
- package/model/PublicAgendasAndCalendarItemTypes.mjs +25 -0
- package/model/PublicKey.d.mts +2 -0
- package/model/PublicKey.mjs +24 -0
- package/model/Receipt.d.mts +5 -0
- package/model/Receipt.mjs +159 -0
- package/model/RegistrationInformation.d.mts +2 -0
- package/model/RegistrationInformation.mjs +43 -0
- package/model/RegistrationSuccess.d.mts +2 -0
- package/model/RegistrationSuccess.mjs +24 -0
- package/model/Replication.d.mts +2 -0
- package/model/Replication.mjs +35 -0
- package/model/ReplicationInfo.d.mts +2 -0
- package/model/ReplicationInfo.mjs +28 -0
- package/model/Role.d.mts +2 -0
- package/model/Role.mjs +34 -0
- package/model/StoredDocumentIdentifier.d.mts +2 -0
- package/model/StoredDocumentIdentifier.mjs +22 -0
- package/model/Tarification.d.mts +2 -0
- package/model/Tarification.mjs +92 -0
- package/model/TimeTable.d.mts +2 -0
- package/model/TimeTable.mjs +64 -0
- package/model/Topic.d.mts +5 -0
- package/model/Topic.mjs +163 -0
- package/model/User.d.mts +4 -0
- package/model/User.mjs +118 -0
- package/model/UserGroup.d.mts +2 -0
- package/model/UserGroup.mjs +55 -0
- package/model/base/CodeStub.d.mts +2 -0
- package/model/base/CodeStub.mjs +40 -0
- package/model/base/CryptoActor.d.mts +3 -0
- package/model/base/CryptoActor.mjs +19 -1
- package/model/base/Identifier.d.mts +2 -0
- package/model/base/Identifier.mjs +44 -0
- package/model/couchdb/Basic.d.mts +2 -0
- package/model/couchdb/Basic.mjs +22 -0
- package/model/couchdb/DatabaseInfo.d.mts +2 -0
- package/model/couchdb/DatabaseInfo.mjs +47 -0
- package/model/couchdb/DesignDocument.d.mts +2 -0
- package/model/couchdb/DesignDocument.mjs +40 -0
- package/model/couchdb/DocIdentifier.d.mts +2 -0
- package/model/couchdb/DocIdentifier.mjs +24 -0
- package/model/couchdb/GroupDatabasesInfo.d.mts +2 -0
- package/model/couchdb/GroupDatabasesInfo.mjs +26 -0
- package/model/couchdb/Remote.d.mts +2 -0
- package/model/couchdb/Remote.mjs +25 -0
- package/model/couchdb/RemoteAuthentication.d.mts +2 -0
- package/model/couchdb/RemoteAuthentication.mjs +23 -0
- package/model/couchdb/ReplicationStats.d.mts +2 -0
- package/model/couchdb/ReplicationStats.mjs +45 -0
- package/model/couchdb/ReplicatorDocument.d.mts +2 -0
- package/model/couchdb/ReplicatorDocument.mjs +61 -0
- package/model/couchdb/View.d.mts +2 -0
- package/model/couchdb/View.mjs +23 -0
- package/model/data/LabelledOccurence.d.mts +2 -0
- package/model/data/LabelledOccurence.mjs +22 -0
- package/model/embed/Address.d.mts +5 -0
- package/model/embed/Address.mjs +133 -0
- package/model/embed/AdministrationQuantity.d.mts +2 -0
- package/model/embed/AdministrationQuantity.mjs +29 -0
- package/model/embed/AgendaSlottingAlgorithm.d.mts +3 -0
- package/model/embed/AgendaSlottingAlgorithm.mjs +30 -0
- package/model/embed/AgreementAppendix.d.mts +2 -0
- package/model/embed/AgreementAppendix.mjs +30 -0
- package/model/embed/Annotation.d.mts +2 -0
- package/model/embed/Annotation.mjs +46 -0
- package/model/embed/CalendarItemTag.d.mts +5 -0
- package/model/embed/CalendarItemTag.mjs +72 -0
- package/model/embed/CareTeamMember.d.mts +5 -0
- package/model/embed/CareTeamMember.mjs +71 -0
- package/model/embed/CareTeamMembership.d.mts +5 -0
- package/model/embed/CareTeamMembership.mjs +73 -0
- package/model/embed/Content.d.mts +5 -0
- package/model/embed/Content.mjs +125 -0
- package/model/embed/DataAttachment.d.mts +2 -0
- package/model/embed/DataAttachment.mjs +26 -0
- package/model/embed/DatabaseSynchronization.d.mts +2 -0
- package/model/embed/DatabaseSynchronization.mjs +30 -0
- package/model/embed/Delegation.d.mts +2 -0
- package/model/embed/Delegation.mjs +30 -0
- package/model/embed/DeletedAttachment.d.mts +2 -0
- package/model/embed/DeletedAttachment.mjs +30 -0
- package/model/embed/DocumentGroup.d.mts +2 -0
- package/model/embed/DocumentGroup.mjs +24 -0
- package/model/embed/Duration.d.mts +2 -0
- package/model/embed/Duration.mjs +26 -0
- package/model/embed/EmbeddedTimeTableHour.d.mts +2 -0
- package/model/embed/EmbeddedTimeTableHour.mjs +22 -0
- package/model/embed/EmbeddedTimeTableItem.d.mts +2 -0
- package/model/embed/EmbeddedTimeTableItem.mjs +41 -0
- package/model/embed/Employer.d.mts +2 -0
- package/model/embed/Employer.mjs +26 -0
- package/model/embed/EmploymentInfo.d.mts +5 -0
- package/model/embed/EmploymentInfo.mjs +74 -0
- package/model/embed/Episode.d.mts +5 -0
- package/model/embed/Episode.mjs +75 -0
- package/model/embed/FinancialInstitutionInformation.d.mts +5 -0
- package/model/embed/FinancialInstitutionInformation.mjs +88 -0
- package/model/embed/FlatRateTarification.d.mts +5 -0
- package/model/embed/FlatRateTarification.mjs +72 -0
- package/model/embed/FlowItem.d.mts +2 -0
- package/model/embed/FlowItem.mjs +117 -0
- package/model/embed/HealthcarePartyHistoryStatus.d.mts +2 -0
- package/model/embed/HealthcarePartyHistoryStatus.mjs +28 -0
- package/model/embed/IdentityDocumentReader.d.mts +2 -0
- package/model/embed/IdentityDocumentReader.mjs +33 -0
- package/model/embed/Insurability.d.mts +5 -0
- package/model/embed/Insurability.mjs +100 -0
- package/model/embed/InvoicingCode.d.mts +5 -0
- package/model/embed/InvoicingCode.mjs +377 -0
- package/model/embed/KeywordSubword.d.mts +2 -0
- package/model/embed/KeywordSubword.mjs +25 -0
- package/model/embed/LetterValue.d.mts +2 -0
- package/model/embed/LetterValue.mjs +30 -0
- package/model/embed/Measure.d.mts +2 -0
- package/model/embed/Measure.mjs +57 -0
- package/model/embed/MedicalHouseContract.d.mts +5 -0
- package/model/embed/MedicalHouseContract.mjs +223 -0
- package/model/embed/Medication.d.mts +2 -0
- package/model/embed/Medication.mjs +157 -0
- package/model/embed/Medicinalproduct.d.mts +2 -0
- package/model/embed/Medicinalproduct.mjs +33 -0
- package/model/embed/MessageAttachment.d.mts +2 -0
- package/model/embed/MessageAttachment.mjs +25 -0
- package/model/embed/MessageReadStatus.d.mts +2 -0
- package/model/embed/MessageReadStatus.mjs +23 -0
- package/model/embed/ParagraphAgreement.d.mts +2 -0
- package/model/embed/ParagraphAgreement.mjs +86 -0
- package/model/embed/Partnership.d.mts +2 -0
- package/model/embed/Partnership.mjs +36 -0
- package/model/embed/PatientHealthCareParty.d.mts +9 -0
- package/model/embed/PatientHealthCareParty.mjs +88 -0
- package/model/embed/Payment.d.mts +2 -0
- package/model/embed/Payment.mjs +28 -0
- package/model/embed/Periodicity.d.mts +2 -0
- package/model/embed/Periodicity.mjs +26 -0
- package/model/embed/PersonName.d.mts +2 -0
- package/model/embed/PersonName.mjs +41 -0
- package/model/embed/PlanOfAction.d.mts +8 -3
- package/model/embed/PlanOfAction.mjs +179 -0
- package/model/embed/Range.d.mts +2 -0
- package/model/embed/Range.mjs +24 -0
- package/model/embed/ReferenceRange.d.mts +2 -0
- package/model/embed/ReferenceRange.mjs +40 -0
- package/model/embed/ReferralPeriod.d.mts +2 -0
- package/model/embed/ReferralPeriod.mjs +27 -0
- package/model/embed/RegimenItem.d.mts +2 -0
- package/model/embed/RegimenItem.mjs +40 -0
- package/model/embed/Renewal.d.mts +2 -0
- package/model/embed/Renewal.mjs +26 -0
- package/model/embed/ResourceGroupAllocationSchedule.d.mts +2 -0
- package/model/embed/ResourceGroupAllocationSchedule.mjs +39 -0
- package/model/embed/Right.d.mts +2 -0
- package/model/embed/Right.mjs +27 -0
- package/model/embed/RoleConfiguration.d.mts +2 -0
- package/model/embed/RoleConfiguration.mjs +22 -0
- package/model/embed/SchoolingInfo.d.mts +5 -0
- package/model/embed/SchoolingInfo.mjs +73 -0
- package/model/embed/SecureDelegation.d.mts +2 -0
- package/model/embed/SecureDelegation.mjs +39 -0
- package/model/embed/SecurityMetadata.d.mts +2 -0
- package/model/embed/SecurityMetadata.mjs +22 -0
- package/model/embed/Service.d.mts +5 -0
- package/model/embed/Service.mjs +240 -0
- package/model/embed/ServiceLink.d.mts +2 -0
- package/model/embed/ServiceLink.mjs +21 -0
- package/model/embed/SubContact.d.mts +5 -0
- package/model/embed/SubContact.mjs +146 -0
- package/model/embed/Substanceproduct.d.mts +2 -0
- package/model/embed/Substanceproduct.mjs +33 -0
- package/model/embed/Suspension.d.mts +2 -0
- package/model/embed/Suspension.mjs +30 -0
- package/model/embed/Telecom.d.mts +5 -0
- package/model/embed/Telecom.mjs +67 -0
- package/model/embed/TimeSeries.d.mts +2 -0
- package/model/embed/TimeSeries.mjs +32 -0
- package/model/embed/TimeTableHour.d.mts +2 -0
- package/model/embed/TimeTableHour.mjs +24 -0
- package/model/embed/TimeTableItem.d.mts +2 -0
- package/model/embed/TimeTableItem.mjs +57 -0
- package/model/embed/TypedValue.d.mts +5 -0
- package/model/embed/TypedValue.mjs +85 -0
- package/model/embed/Valorisation.d.mts +5 -0
- package/model/embed/Valorisation.mjs +108 -0
- package/model/embed/ValueWithPrecision.d.mts +2 -0
- package/model/embed/ValueWithPrecision.mjs +22 -0
- package/model/embed/Weekday.d.mts +2 -0
- package/model/embed/Weekday.mjs +26 -0
- package/model/embed/form/template/Action.d.mts +2 -0
- package/model/embed/form/template/Action.mjs +30 -0
- package/model/embed/form/template/CheckBox.d.mts +2 -0
- package/model/embed/form/template/CheckBox.mjs +71 -0
- package/model/embed/form/template/DatePicker.d.mts +2 -0
- package/model/embed/form/template/DatePicker.mjs +71 -0
- package/model/embed/form/template/DateTimePicker.d.mts +2 -0
- package/model/embed/form/template/DateTimePicker.mjs +71 -0
- package/model/embed/form/template/DropdownField.d.mts +2 -0
- package/model/embed/form/template/DropdownField.mjs +71 -0
- package/model/embed/form/template/FieldsGroup.d.mts +2 -0
- package/model/embed/form/template/FieldsGroup.mjs +28 -0
- package/model/embed/form/template/FormTemplateLayout.d.mts +2 -0
- package/model/embed/form/template/FormTemplateLayout.mjs +33 -0
- package/model/embed/form/template/Launcher.d.mts +2 -0
- package/model/embed/form/template/Launcher.mjs +26 -0
- package/model/embed/form/template/MeasureField.d.mts +2 -0
- package/model/embed/form/template/MeasureField.mjs +71 -0
- package/model/embed/form/template/MultipleChoice.d.mts +2 -0
- package/model/embed/form/template/MultipleChoice.mjs +71 -0
- package/model/embed/form/template/NumberField.d.mts +2 -0
- package/model/embed/form/template/NumberField.mjs +71 -0
- package/model/embed/form/template/RadioButton.d.mts +2 -0
- package/model/embed/form/template/RadioButton.mjs +71 -0
- package/model/embed/form/template/Section.d.mts +2 -0
- package/model/embed/form/template/Section.mjs +30 -0
- package/model/embed/form/template/State.d.mts +2 -0
- package/model/embed/form/template/State.mjs +26 -0
- package/model/embed/form/template/StructureElement.d.mts +3 -0
- package/model/embed/form/template/StructureElement.mjs +32 -1
- package/model/embed/form/template/TextField.d.mts +2 -0
- package/model/embed/form/template/TextField.mjs +71 -0
- package/model/embed/form/template/TimePicker.d.mts +2 -0
- package/model/embed/form/template/TimePicker.mjs +71 -0
- package/model/filter/predicate/AlwaysPredicate.d.mts +2 -0
- package/model/filter/predicate/AlwaysPredicate.mjs +20 -0
- package/model/filter/predicate/AndPredicate.d.mts +2 -0
- package/model/filter/predicate/AndPredicate.mjs +25 -0
- package/model/filter/predicate/KeyValuePredicate.d.mts +2 -0
- package/model/filter/predicate/KeyValuePredicate.mjs +32 -0
- package/model/filter/predicate/NotPredicate.d.mts +2 -0
- package/model/filter/predicate/NotPredicate.mjs +25 -0
- package/model/filter/predicate/OrPredicate.d.mts +2 -0
- package/model/filter/predicate/OrPredicate.mjs +25 -0
- package/model/filter/predicate/Predicate.d.mts +3 -0
- package/model/filter/predicate/Predicate.mjs +20 -1
- package/model/security/AlwaysPermissionItem.d.mts +2 -0
- package/model/security/AlwaysPermissionItem.mjs +25 -0
- package/model/security/AuthenticationToken.d.mts +2 -0
- package/model/security/AuthenticationToken.mjs +28 -0
- package/model/security/Enable2faRequest.d.mts +2 -0
- package/model/security/Enable2faRequest.mjs +22 -0
- package/model/security/ExternalJwtConfig.d.mts +18 -0
- package/model/security/ExternalJwtConfig.mjs +199 -0
- package/model/security/LoginIdentifier.d.mts +2 -0
- package/model/security/LoginIdentifier.mjs +22 -0
- package/model/security/OperationToken.d.mts +2 -0
- package/model/security/OperationToken.mjs +31 -0
- package/model/security/Permission.d.mts +2 -0
- package/model/security/Permission.mjs +24 -0
- package/model/security/PermissionItem.d.mts +3 -0
- package/model/security/PermissionItem.mjs +12 -1
- package/model/security/TokenWithGroup.d.mts +2 -0
- package/model/security/TokenWithGroup.mjs +25 -0
- package/options/SdkOptions.d.mts +3 -23
- package/package.json +1 -1
- package/utils/Id.d.mts +5 -0
- package/utils/Id.mjs +19 -10
- package/KotlinBigInteger-bignum.mjs +0 -5902
- /package/{KotlinBigInteger-bignum-serialization-kotlinx.mjs → core-library-core.mjs} +0 -0
|
@@ -1,8 +1,32 @@
|
|
|
1
1
|
// auto-generated file
|
|
2
|
+
import { expectString, extractEntry } from '../internal/JsonDecodeUtils.mjs';
|
|
2
3
|
export class DataOwnerRegistrationSuccess {
|
|
3
4
|
constructor(partial) {
|
|
4
5
|
this.userLogin = partial.userLogin;
|
|
5
6
|
this.userId = partial.userId;
|
|
6
7
|
this.token = partial.token;
|
|
7
8
|
}
|
|
9
|
+
toJSON() {
|
|
10
|
+
const res = {};
|
|
11
|
+
res['userLogin'] = this.userLogin;
|
|
12
|
+
res['userId'] = this.userId;
|
|
13
|
+
res['token'] = this.token;
|
|
14
|
+
return res;
|
|
15
|
+
}
|
|
16
|
+
static fromJSON(json, ignoreUnknownKeys = false, path = ['DataOwnerRegistrationSuccess']) {
|
|
17
|
+
if (typeof json != 'object')
|
|
18
|
+
throw new Error(`Expected json object at path ${path.join("")}`);
|
|
19
|
+
const jCpy = Object.assign({}, json);
|
|
20
|
+
const res = new DataOwnerRegistrationSuccess({
|
|
21
|
+
userLogin: expectString(extractEntry(jCpy, 'userLogin', true, path), false, [...path, ".userLogin"]),
|
|
22
|
+
userId: expectString(extractEntry(jCpy, 'userId', true, path), false, [...path, ".userId"]),
|
|
23
|
+
token: expectString(extractEntry(jCpy, 'token', true, path), false, [...path, ".token"]),
|
|
24
|
+
});
|
|
25
|
+
if (!ignoreUnknownKeys) {
|
|
26
|
+
const unused = Object.keys(jCpy);
|
|
27
|
+
if (unused.length > 0)
|
|
28
|
+
throw new Error(`Unexpected key(s) for json object DataOwnerRegistrationSuccess at path ${path.join("")}: ${unused}`);
|
|
29
|
+
}
|
|
30
|
+
return res;
|
|
31
|
+
}
|
|
8
32
|
}
|
|
@@ -7,15 +7,22 @@ export declare namespace DataOwnerWithType {
|
|
|
7
7
|
dataOwner: HealthcareParty;
|
|
8
8
|
readonly $ktClass: 'com.icure.cardinal.sdk.model.DataOwnerWithType.HcpDataOwner';
|
|
9
9
|
constructor(partial: Partial<HcpDataOwner> & Pick<HcpDataOwner, "dataOwner">);
|
|
10
|
+
toJSON(): object;
|
|
11
|
+
static fromJSON(json: any, ignoreUnknownKeys?: boolean, path?: Array<string>): HcpDataOwner;
|
|
10
12
|
}
|
|
11
13
|
class PatientDataOwner {
|
|
12
14
|
dataOwner: EncryptedPatient;
|
|
13
15
|
readonly $ktClass: 'com.icure.cardinal.sdk.model.DataOwnerWithType.PatientDataOwner';
|
|
14
16
|
constructor(partial: Partial<PatientDataOwner> & Pick<PatientDataOwner, "dataOwner">);
|
|
17
|
+
toJSON(): object;
|
|
18
|
+
static fromJSON(json: any, ignoreUnknownKeys?: boolean, path?: Array<string>): PatientDataOwner;
|
|
15
19
|
}
|
|
16
20
|
class DeviceDataOwner {
|
|
17
21
|
dataOwner: Device;
|
|
18
22
|
readonly $ktClass: 'com.icure.cardinal.sdk.model.DataOwnerWithType.DeviceDataOwner';
|
|
19
23
|
constructor(partial: Partial<DeviceDataOwner> & Pick<DeviceDataOwner, "dataOwner">);
|
|
24
|
+
toJSON(): object;
|
|
25
|
+
static fromJSON(json: any, ignoreUnknownKeys?: boolean, path?: Array<string>): DeviceDataOwner;
|
|
20
26
|
}
|
|
27
|
+
function fromJSON(json: any, ignoreUnknownKeys?: boolean, path?: Array<string>): DataOwnerWithType;
|
|
21
28
|
}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
// auto-generated file
|
|
2
|
+
import { expectObject, extractEntry } from '../internal/JsonDecodeUtils.mjs';
|
|
3
|
+
import { Device } from './Device.mjs';
|
|
4
|
+
import { HealthcareParty } from './HealthcareParty.mjs';
|
|
5
|
+
import { EncryptedPatient } from './Patient.mjs';
|
|
1
6
|
export var DataOwnerWithType;
|
|
2
7
|
(function (DataOwnerWithType) {
|
|
3
8
|
class HcpDataOwner {
|
|
@@ -5,6 +10,28 @@ export var DataOwnerWithType;
|
|
|
5
10
|
this.$ktClass = 'com.icure.cardinal.sdk.model.DataOwnerWithType.HcpDataOwner';
|
|
6
11
|
this.dataOwner = partial.dataOwner;
|
|
7
12
|
}
|
|
13
|
+
toJSON() {
|
|
14
|
+
const res = {};
|
|
15
|
+
res['dataOwner'] = this.dataOwner.toJSON();
|
|
16
|
+
res['$ktClass'] = 'com.icure.cardinal.sdk.model.DataOwnerWithType.HcpDataOwner';
|
|
17
|
+
return res;
|
|
18
|
+
}
|
|
19
|
+
static fromJSON(json, ignoreUnknownKeys = false, path = ['HcpDataOwner']) {
|
|
20
|
+
if (typeof json != 'object')
|
|
21
|
+
throw new Error(`Expected json object at path ${path.join("")}`);
|
|
22
|
+
const jCpy = Object.assign({}, json);
|
|
23
|
+
if (extractEntry(jCpy, '\$ktClass', true, path) !== 'com.icure.cardinal.sdk.model.DataOwnerWithType.HcpDataOwner')
|
|
24
|
+
throw new Error(`Unexpected value for ${path.join("")} class marker, should be "com.icure.cardinal.sdk.model.DataOwnerWithType.HcpDataOwner". The provided json doesn't represent a HcpDataOwner`);
|
|
25
|
+
const res = new HcpDataOwner({
|
|
26
|
+
dataOwner: expectObject(extractEntry(jCpy, 'dataOwner', true, path), false, ignoreUnknownKeys, [...path, ".dataOwner"], HealthcareParty.fromJSON),
|
|
27
|
+
});
|
|
28
|
+
if (!ignoreUnknownKeys) {
|
|
29
|
+
const unused = Object.keys(jCpy);
|
|
30
|
+
if (unused.length > 0)
|
|
31
|
+
throw new Error(`Unexpected key(s) for json object HcpDataOwner at path ${path.join("")}: ${unused}`);
|
|
32
|
+
}
|
|
33
|
+
return res;
|
|
34
|
+
}
|
|
8
35
|
}
|
|
9
36
|
DataOwnerWithType.HcpDataOwner = HcpDataOwner;
|
|
10
37
|
class PatientDataOwner {
|
|
@@ -12,6 +39,28 @@ export var DataOwnerWithType;
|
|
|
12
39
|
this.$ktClass = 'com.icure.cardinal.sdk.model.DataOwnerWithType.PatientDataOwner';
|
|
13
40
|
this.dataOwner = partial.dataOwner;
|
|
14
41
|
}
|
|
42
|
+
toJSON() {
|
|
43
|
+
const res = {};
|
|
44
|
+
res['dataOwner'] = this.dataOwner.toJSON();
|
|
45
|
+
res['$ktClass'] = 'com.icure.cardinal.sdk.model.DataOwnerWithType.PatientDataOwner';
|
|
46
|
+
return res;
|
|
47
|
+
}
|
|
48
|
+
static fromJSON(json, ignoreUnknownKeys = false, path = ['PatientDataOwner']) {
|
|
49
|
+
if (typeof json != 'object')
|
|
50
|
+
throw new Error(`Expected json object at path ${path.join("")}`);
|
|
51
|
+
const jCpy = Object.assign({}, json);
|
|
52
|
+
if (extractEntry(jCpy, '\$ktClass', true, path) !== 'com.icure.cardinal.sdk.model.DataOwnerWithType.PatientDataOwner')
|
|
53
|
+
throw new Error(`Unexpected value for ${path.join("")} class marker, should be "com.icure.cardinal.sdk.model.DataOwnerWithType.PatientDataOwner". The provided json doesn't represent a PatientDataOwner`);
|
|
54
|
+
const res = new PatientDataOwner({
|
|
55
|
+
dataOwner: expectObject(extractEntry(jCpy, 'dataOwner', true, path), false, ignoreUnknownKeys, [...path, ".dataOwner"], EncryptedPatient.fromJSON),
|
|
56
|
+
});
|
|
57
|
+
if (!ignoreUnknownKeys) {
|
|
58
|
+
const unused = Object.keys(jCpy);
|
|
59
|
+
if (unused.length > 0)
|
|
60
|
+
throw new Error(`Unexpected key(s) for json object PatientDataOwner at path ${path.join("")}: ${unused}`);
|
|
61
|
+
}
|
|
62
|
+
return res;
|
|
63
|
+
}
|
|
15
64
|
}
|
|
16
65
|
DataOwnerWithType.PatientDataOwner = PatientDataOwner;
|
|
17
66
|
class DeviceDataOwner {
|
|
@@ -19,6 +68,37 @@ export var DataOwnerWithType;
|
|
|
19
68
|
this.$ktClass = 'com.icure.cardinal.sdk.model.DataOwnerWithType.DeviceDataOwner';
|
|
20
69
|
this.dataOwner = partial.dataOwner;
|
|
21
70
|
}
|
|
71
|
+
toJSON() {
|
|
72
|
+
const res = {};
|
|
73
|
+
res['dataOwner'] = this.dataOwner.toJSON();
|
|
74
|
+
res['$ktClass'] = 'com.icure.cardinal.sdk.model.DataOwnerWithType.DeviceDataOwner';
|
|
75
|
+
return res;
|
|
76
|
+
}
|
|
77
|
+
static fromJSON(json, ignoreUnknownKeys = false, path = ['DeviceDataOwner']) {
|
|
78
|
+
if (typeof json != 'object')
|
|
79
|
+
throw new Error(`Expected json object at path ${path.join("")}`);
|
|
80
|
+
const jCpy = Object.assign({}, json);
|
|
81
|
+
if (extractEntry(jCpy, '\$ktClass', true, path) !== 'com.icure.cardinal.sdk.model.DataOwnerWithType.DeviceDataOwner')
|
|
82
|
+
throw new Error(`Unexpected value for ${path.join("")} class marker, should be "com.icure.cardinal.sdk.model.DataOwnerWithType.DeviceDataOwner". The provided json doesn't represent a DeviceDataOwner`);
|
|
83
|
+
const res = new DeviceDataOwner({
|
|
84
|
+
dataOwner: expectObject(extractEntry(jCpy, 'dataOwner', true, path), false, ignoreUnknownKeys, [...path, ".dataOwner"], Device.fromJSON),
|
|
85
|
+
});
|
|
86
|
+
if (!ignoreUnknownKeys) {
|
|
87
|
+
const unused = Object.keys(jCpy);
|
|
88
|
+
if (unused.length > 0)
|
|
89
|
+
throw new Error(`Unexpected key(s) for json object DeviceDataOwner at path ${path.join("")}: ${unused}`);
|
|
90
|
+
}
|
|
91
|
+
return res;
|
|
92
|
+
}
|
|
22
93
|
}
|
|
23
94
|
DataOwnerWithType.DeviceDataOwner = DeviceDataOwner;
|
|
95
|
+
function fromJSON(json, ignoreUnknownKeys = false, path = ['DataOwnerWithType']) {
|
|
96
|
+
switch (json.$ktClass) {
|
|
97
|
+
case 'com.icure.cardinal.sdk.model.DataOwnerWithType.HcpDataOwner': return HcpDataOwner.fromJSON(json, ignoreUnknownKeys);
|
|
98
|
+
case 'com.icure.cardinal.sdk.model.DataOwnerWithType.PatientDataOwner': return PatientDataOwner.fromJSON(json, ignoreUnknownKeys);
|
|
99
|
+
case 'com.icure.cardinal.sdk.model.DataOwnerWithType.DeviceDataOwner': return DeviceDataOwner.fromJSON(json, ignoreUnknownKeys);
|
|
100
|
+
default: throw new Error('Unexpected discriminator for DataOwnerWithType: ' + json.$ktClass);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
DataOwnerWithType.fromJSON = fromJSON;
|
|
24
104
|
})(DataOwnerWithType || (DataOwnerWithType = {}));
|
|
@@ -7,4 +7,6 @@ export declare class DatabaseInitialisation {
|
|
|
7
7
|
replication: Replication | undefined;
|
|
8
8
|
minimumKrakenVersion: string | undefined;
|
|
9
9
|
constructor(partial: Partial<DatabaseInitialisation>);
|
|
10
|
+
toJSON(): object;
|
|
11
|
+
static fromJSON(json: any, ignoreUnknownKeys?: boolean, path?: Array<string>): DatabaseInitialisation;
|
|
10
12
|
}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
// auto-generated file
|
|
2
|
+
import { expectArray, expectObject, expectString, extractEntry } from '../internal/JsonDecodeUtils.mjs';
|
|
3
|
+
import { HealthcareParty } from './HealthcareParty.mjs';
|
|
4
|
+
import { Replication } from './Replication.mjs';
|
|
5
|
+
import { User } from './User.mjs';
|
|
1
6
|
export class DatabaseInitialisation {
|
|
2
7
|
constructor(partial) {
|
|
3
8
|
this.users = [];
|
|
@@ -13,4 +18,33 @@ export class DatabaseInitialisation {
|
|
|
13
18
|
if ('minimumKrakenVersion' in partial)
|
|
14
19
|
this.minimumKrakenVersion = partial.minimumKrakenVersion;
|
|
15
20
|
}
|
|
21
|
+
toJSON() {
|
|
22
|
+
const res = {};
|
|
23
|
+
if (this.users != undefined)
|
|
24
|
+
res['users'] = this.users.map((x0) => x0.toJSON());
|
|
25
|
+
if (this.healthcareParties != undefined)
|
|
26
|
+
res['healthcareParties'] = this.healthcareParties.map((x0) => x0.toJSON());
|
|
27
|
+
if (this.replication != undefined)
|
|
28
|
+
res['replication'] = this.replication.toJSON();
|
|
29
|
+
if (this.minimumKrakenVersion != undefined)
|
|
30
|
+
res['minimumKrakenVersion'] = this.minimumKrakenVersion;
|
|
31
|
+
return res;
|
|
32
|
+
}
|
|
33
|
+
static fromJSON(json, ignoreUnknownKeys = false, path = ['DatabaseInitialisation']) {
|
|
34
|
+
if (typeof json != 'object')
|
|
35
|
+
throw new Error(`Expected json object at path ${path.join("")}`);
|
|
36
|
+
const jCpy = Object.assign({}, json);
|
|
37
|
+
const res = new DatabaseInitialisation({
|
|
38
|
+
users: expectArray(extractEntry(jCpy, 'users', false, path), true, [...path, ".users"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, User.fromJSON)),
|
|
39
|
+
healthcareParties: expectArray(extractEntry(jCpy, 'healthcareParties', false, path), true, [...path, ".healthcareParties"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, HealthcareParty.fromJSON)),
|
|
40
|
+
replication: expectObject(extractEntry(jCpy, 'replication', false, path), true, ignoreUnknownKeys, [...path, ".replication"], Replication.fromJSON),
|
|
41
|
+
minimumKrakenVersion: expectString(extractEntry(jCpy, 'minimumKrakenVersion', false, path), true, [...path, ".minimumKrakenVersion"]),
|
|
42
|
+
});
|
|
43
|
+
if (!ignoreUnknownKeys) {
|
|
44
|
+
const unused = Object.keys(jCpy);
|
|
45
|
+
if (unused.length > 0)
|
|
46
|
+
throw new Error(`Unexpected key(s) for json object DatabaseInitialisation at path ${path.join("")}: ${unused}`);
|
|
47
|
+
}
|
|
48
|
+
return res;
|
|
49
|
+
}
|
|
16
50
|
}
|
package/model/Device.d.mts
CHANGED
|
@@ -53,4 +53,6 @@ export declare class Device implements StoredDocument, ICureDocument<string>, Na
|
|
|
53
53
|
cryptoActorProperties: Array<DecryptedPropertyStub> | undefined;
|
|
54
54
|
readonly $ktClass: 'com.icure.cardinal.sdk.model.Device';
|
|
55
55
|
constructor(partial: Partial<Device>);
|
|
56
|
+
toJSON(): object;
|
|
57
|
+
static fromJSON(json: any, ignoreUnknownKeys?: boolean, path?: Array<string>): Device;
|
|
56
58
|
}
|
package/model/Device.mjs
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
// auto-generated file
|
|
2
|
+
import { decodeBase64, encodeBase64 } from '../internal/BytesEncoding.mjs';
|
|
3
|
+
import { expectArray, expectMap, expectNumber, expectObject, expectString, extractEntry } from '../internal/JsonDecodeUtils.mjs';
|
|
2
4
|
import { randomUuid } from '../utils/Id.mjs';
|
|
5
|
+
import { DecryptedPropertyStub } from './PropertyStub.mjs';
|
|
6
|
+
import { CodeStub } from './base/CodeStub.mjs';
|
|
7
|
+
import { Identifier } from './base/Identifier.mjs';
|
|
3
8
|
export class Device {
|
|
4
9
|
constructor(partial) {
|
|
5
10
|
var _a;
|
|
@@ -87,4 +92,98 @@ export class Device {
|
|
|
87
92
|
if ('cryptoActorProperties' in partial)
|
|
88
93
|
this.cryptoActorProperties = partial.cryptoActorProperties;
|
|
89
94
|
}
|
|
95
|
+
toJSON() {
|
|
96
|
+
const res = {};
|
|
97
|
+
res['id'] = this.id;
|
|
98
|
+
if (this.rev != undefined)
|
|
99
|
+
res['rev'] = this.rev;
|
|
100
|
+
if (this.deletionDate != undefined)
|
|
101
|
+
res['deletionDate'] = this.deletionDate;
|
|
102
|
+
res['identifiers'] = this.identifiers.map((x0) => x0.toJSON());
|
|
103
|
+
if (this.created != undefined)
|
|
104
|
+
res['created'] = this.created;
|
|
105
|
+
if (this.modified != undefined)
|
|
106
|
+
res['modified'] = this.modified;
|
|
107
|
+
if (this.author != undefined)
|
|
108
|
+
res['author'] = this.author;
|
|
109
|
+
if (this.responsible != undefined)
|
|
110
|
+
res['responsible'] = this.responsible;
|
|
111
|
+
res['tags'] = this.tags.map((x0) => x0.toJSON());
|
|
112
|
+
res['codes'] = this.codes.map((x0) => x0.toJSON());
|
|
113
|
+
if (this.endOfLife != undefined)
|
|
114
|
+
res['endOfLife'] = this.endOfLife;
|
|
115
|
+
if (this.medicalLocationId != undefined)
|
|
116
|
+
res['medicalLocationId'] = this.medicalLocationId;
|
|
117
|
+
if (this.externalId != undefined)
|
|
118
|
+
res['externalId'] = this.externalId;
|
|
119
|
+
if (this.name != undefined)
|
|
120
|
+
res['name'] = this.name;
|
|
121
|
+
if (this.type != undefined)
|
|
122
|
+
res['type'] = this.type;
|
|
123
|
+
if (this.brand != undefined)
|
|
124
|
+
res['brand'] = this.brand;
|
|
125
|
+
if (this.model != undefined)
|
|
126
|
+
res['model'] = this.model;
|
|
127
|
+
if (this.serialNumber != undefined)
|
|
128
|
+
res['serialNumber'] = this.serialNumber;
|
|
129
|
+
if (this.parentId != undefined)
|
|
130
|
+
res['parentId'] = this.parentId;
|
|
131
|
+
if (this.picture != undefined)
|
|
132
|
+
res['picture'] = encodeBase64(this.picture);
|
|
133
|
+
res['properties'] = this.properties.map((x0) => x0.toJSON());
|
|
134
|
+
res['hcPartyKeys'] = Object.fromEntries(Object.entries(this.hcPartyKeys).map(([k0, v0]) => [k0, v0.map((x1) => x1)]));
|
|
135
|
+
res['aesExchangeKeys'] = Object.fromEntries(Object.entries(this.aesExchangeKeys).map(([k0, v0]) => [k0, Object.fromEntries(Object.entries(v0).map(([k1, v1]) => [k1, Object.fromEntries(Object.entries(v1).map(([k2, v2]) => [k2, v2]))]))]));
|
|
136
|
+
res['transferKeys'] = Object.fromEntries(Object.entries(this.transferKeys).map(([k0, v0]) => [k0, Object.fromEntries(Object.entries(v0).map(([k1, v1]) => [k1, v1]))]));
|
|
137
|
+
res['privateKeyShamirPartitions'] = Object.fromEntries(Object.entries(this.privateKeyShamirPartitions).map(([k0, v0]) => [k0, v0]));
|
|
138
|
+
if (this.publicKey != undefined)
|
|
139
|
+
res['publicKey'] = this.publicKey;
|
|
140
|
+
res['publicKeysForOaepWithSha256'] = this.publicKeysForOaepWithSha256.map((x0) => x0);
|
|
141
|
+
if (this.cryptoActorProperties != undefined)
|
|
142
|
+
res['cryptoActorProperties'] = this.cryptoActorProperties.map((x0) => x0.toJSON());
|
|
143
|
+
res['$ktClass'] = 'com.icure.cardinal.sdk.model.Device';
|
|
144
|
+
return res;
|
|
145
|
+
}
|
|
146
|
+
static fromJSON(json, ignoreUnknownKeys = false, path = ['Device']) {
|
|
147
|
+
if (typeof json != 'object')
|
|
148
|
+
throw new Error(`Expected json object at path ${path.join("")}`);
|
|
149
|
+
const jCpy = Object.assign({}, json);
|
|
150
|
+
if (extractEntry(jCpy, '\$ktClass', true, path) !== 'com.icure.cardinal.sdk.model.Device')
|
|
151
|
+
throw new Error(`Unexpected value for ${path.join("")} class marker, should be "com.icure.cardinal.sdk.model.Device". The provided json doesn't represent a Device`);
|
|
152
|
+
const res = new Device({
|
|
153
|
+
id: expectString(extractEntry(jCpy, 'id', true, path), false, [...path, ".id"]),
|
|
154
|
+
rev: expectString(extractEntry(jCpy, 'rev', false, path), true, [...path, ".rev"]),
|
|
155
|
+
deletionDate: expectNumber(extractEntry(jCpy, 'deletionDate', false, path), true, true, [...path, ".deletionDate"]),
|
|
156
|
+
identifiers: expectArray(extractEntry(jCpy, 'identifiers', false, path), false, [...path, ".identifiers"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, Identifier.fromJSON)),
|
|
157
|
+
created: expectNumber(extractEntry(jCpy, 'created', false, path), true, true, [...path, ".created"]),
|
|
158
|
+
modified: expectNumber(extractEntry(jCpy, 'modified', false, path), true, true, [...path, ".modified"]),
|
|
159
|
+
author: expectString(extractEntry(jCpy, 'author', false, path), true, [...path, ".author"]),
|
|
160
|
+
responsible: expectString(extractEntry(jCpy, 'responsible', false, path), true, [...path, ".responsible"]),
|
|
161
|
+
tags: expectArray(extractEntry(jCpy, 'tags', false, path), false, [...path, ".tags"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, CodeStub.fromJSON)),
|
|
162
|
+
codes: expectArray(extractEntry(jCpy, 'codes', false, path), false, [...path, ".codes"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, CodeStub.fromJSON)),
|
|
163
|
+
endOfLife: expectNumber(extractEntry(jCpy, 'endOfLife', false, path), true, true, [...path, ".endOfLife"]),
|
|
164
|
+
medicalLocationId: expectString(extractEntry(jCpy, 'medicalLocationId', false, path), true, [...path, ".medicalLocationId"]),
|
|
165
|
+
externalId: expectString(extractEntry(jCpy, 'externalId', false, path), true, [...path, ".externalId"]),
|
|
166
|
+
name: expectString(extractEntry(jCpy, 'name', false, path), true, [...path, ".name"]),
|
|
167
|
+
type: expectString(extractEntry(jCpy, 'type', false, path), true, [...path, ".type"]),
|
|
168
|
+
brand: expectString(extractEntry(jCpy, 'brand', false, path), true, [...path, ".brand"]),
|
|
169
|
+
model: expectString(extractEntry(jCpy, 'model', false, path), true, [...path, ".model"]),
|
|
170
|
+
serialNumber: expectString(extractEntry(jCpy, 'serialNumber', false, path), true, [...path, ".serialNumber"]),
|
|
171
|
+
parentId: expectString(extractEntry(jCpy, 'parentId', false, path), true, [...path, ".parentId"]),
|
|
172
|
+
picture: decodeBase64(expectString(extractEntry(jCpy, 'picture', false, path), true, [...path, ".picture"]), [...path, ".picture"]),
|
|
173
|
+
properties: expectArray(extractEntry(jCpy, 'properties', false, path), false, [...path, ".properties"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, DecryptedPropertyStub.fromJSON)),
|
|
174
|
+
hcPartyKeys: expectMap(extractEntry(jCpy, 'hcPartyKeys', false, path), false, [...path, ".hcPartyKeys"], (k0, p0) => expectString(k0, false, p0), (v0, p0) => expectArray(v0, false, p0, (x1, p1) => expectString(x1, false, p1))),
|
|
175
|
+
aesExchangeKeys: expectMap(extractEntry(jCpy, 'aesExchangeKeys', false, path), false, [...path, ".aesExchangeKeys"], (k0, p0) => expectString(k0, false, p0), (v0, p0) => expectMap(v0, false, p0, (k1, p1) => expectString(k1, false, p1), (v1, p1) => expectMap(v1, false, p1, (k2, p2) => expectString(k2, false, p2), (v2, p2) => expectString(v2, false, p2)))),
|
|
176
|
+
transferKeys: expectMap(extractEntry(jCpy, 'transferKeys', false, path), false, [...path, ".transferKeys"], (k0, p0) => expectString(k0, false, p0), (v0, p0) => expectMap(v0, false, p0, (k1, p1) => expectString(k1, false, p1), (v1, p1) => expectString(v1, false, p1))),
|
|
177
|
+
privateKeyShamirPartitions: expectMap(extractEntry(jCpy, 'privateKeyShamirPartitions', false, path), false, [...path, ".privateKeyShamirPartitions"], (k0, p0) => expectString(k0, false, p0), (v0, p0) => expectString(v0, false, p0)),
|
|
178
|
+
publicKey: expectString(extractEntry(jCpy, 'publicKey', false, path), true, [...path, ".publicKey"]),
|
|
179
|
+
publicKeysForOaepWithSha256: expectArray(extractEntry(jCpy, 'publicKeysForOaepWithSha256', false, path), false, [...path, ".publicKeysForOaepWithSha256"], (x0, p0) => expectString(x0, false, p0)),
|
|
180
|
+
cryptoActorProperties: expectArray(extractEntry(jCpy, 'cryptoActorProperties', false, path), true, [...path, ".cryptoActorProperties"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, DecryptedPropertyStub.fromJSON)),
|
|
181
|
+
});
|
|
182
|
+
if (!ignoreUnknownKeys) {
|
|
183
|
+
const unused = Object.keys(jCpy);
|
|
184
|
+
if (unused.length > 0)
|
|
185
|
+
throw new Error(`Unexpected key(s) for json object Device at path ${path.join("")}: ${unused}`);
|
|
186
|
+
}
|
|
187
|
+
return res;
|
|
188
|
+
}
|
|
90
189
|
}
|
package/model/Document.d.mts
CHANGED
|
@@ -34,6 +34,7 @@ export interface Document extends StoredDocument, ICureDocument<string>, HasEncr
|
|
|
34
34
|
encryptedAttachment: Int8Array | undefined;
|
|
35
35
|
decryptedAttachment: Int8Array | undefined;
|
|
36
36
|
readonly isEncrypted: boolean;
|
|
37
|
+
toJSON(): object;
|
|
37
38
|
}
|
|
38
39
|
export declare class DecryptedDocument {
|
|
39
40
|
id: string;
|
|
@@ -82,6 +83,8 @@ export declare class DecryptedDocument {
|
|
|
82
83
|
securityMetadata: SecurityMetadata | undefined;
|
|
83
84
|
readonly isEncrypted: false;
|
|
84
85
|
constructor(partial: Partial<DecryptedDocument>);
|
|
86
|
+
toJSON(): object;
|
|
87
|
+
static fromJSON(json: any, ignoreUnknownKeys?: boolean, path?: Array<string>): DecryptedDocument;
|
|
85
88
|
}
|
|
86
89
|
export declare class EncryptedDocument {
|
|
87
90
|
id: string;
|
|
@@ -130,4 +133,6 @@ export declare class EncryptedDocument {
|
|
|
130
133
|
securityMetadata: SecurityMetadata | undefined;
|
|
131
134
|
readonly isEncrypted: true;
|
|
132
135
|
constructor(partial: Partial<EncryptedDocument>);
|
|
136
|
+
toJSON(): object;
|
|
137
|
+
static fromJSON(json: any, ignoreUnknownKeys?: boolean, path?: Array<string>): EncryptedDocument;
|
|
133
138
|
}
|
package/model/Document.mjs
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
// auto-generated file
|
|
2
|
+
import { decodeBase64, encodeBase64 } from '../internal/BytesEncoding.mjs';
|
|
3
|
+
import { expectArray, expectMap, expectNumber, expectObject, expectString, expectStringEnum, extractEntry } from '../internal/JsonDecodeUtils.mjs';
|
|
2
4
|
import { randomUuid } from '../utils/Id.mjs';
|
|
5
|
+
import { CodeStub } from './base/CodeStub.mjs';
|
|
6
|
+
import { DataAttachment } from './embed/DataAttachment.mjs';
|
|
7
|
+
import { Delegation } from './embed/Delegation.mjs';
|
|
8
|
+
import { DeletedAttachment } from './embed/DeletedAttachment.mjs';
|
|
9
|
+
import { DocumentLocation } from './embed/DocumentLocation.mjs';
|
|
10
|
+
import { DocumentStatus } from './embed/DocumentStatus.mjs';
|
|
11
|
+
import { DocumentType } from './embed/DocumentType.mjs';
|
|
12
|
+
import { SecurityMetadata } from './embed/SecurityMetadata.mjs';
|
|
3
13
|
export class DecryptedDocument {
|
|
4
14
|
constructor(partial) {
|
|
5
15
|
var _a;
|
|
@@ -113,6 +123,124 @@ export class DecryptedDocument {
|
|
|
113
123
|
if ('securityMetadata' in partial)
|
|
114
124
|
this.securityMetadata = partial.securityMetadata;
|
|
115
125
|
}
|
|
126
|
+
toJSON() {
|
|
127
|
+
const res = {};
|
|
128
|
+
res['id'] = this.id;
|
|
129
|
+
if (this.rev != undefined)
|
|
130
|
+
res['rev'] = this.rev;
|
|
131
|
+
if (this.created != undefined)
|
|
132
|
+
res['created'] = this.created;
|
|
133
|
+
if (this.modified != undefined)
|
|
134
|
+
res['modified'] = this.modified;
|
|
135
|
+
if (this.author != undefined)
|
|
136
|
+
res['author'] = this.author;
|
|
137
|
+
if (this.responsible != undefined)
|
|
138
|
+
res['responsible'] = this.responsible;
|
|
139
|
+
if (this.medicalLocationId != undefined)
|
|
140
|
+
res['medicalLocationId'] = this.medicalLocationId;
|
|
141
|
+
res['tags'] = this.tags.map((x0) => x0.toJSON());
|
|
142
|
+
res['codes'] = this.codes.map((x0) => x0.toJSON());
|
|
143
|
+
if (this.endOfLife != undefined)
|
|
144
|
+
res['endOfLife'] = this.endOfLife;
|
|
145
|
+
if (this.deletionDate != undefined)
|
|
146
|
+
res['deletionDate'] = this.deletionDate;
|
|
147
|
+
if (this.documentLocation != undefined)
|
|
148
|
+
res['documentLocation'] = this.documentLocation;
|
|
149
|
+
if (this.documentType != undefined)
|
|
150
|
+
res['documentType'] = this.documentType;
|
|
151
|
+
if (this.documentStatus != undefined)
|
|
152
|
+
res['documentStatus'] = this.documentStatus;
|
|
153
|
+
if (this.externalUri != undefined)
|
|
154
|
+
res['externalUri'] = this.externalUri;
|
|
155
|
+
if (this.name != undefined)
|
|
156
|
+
res['name'] = this.name;
|
|
157
|
+
if (this.version != undefined)
|
|
158
|
+
res['version'] = this.version;
|
|
159
|
+
if (this.storedICureDocumentId != undefined)
|
|
160
|
+
res['storedICureDocumentId'] = this.storedICureDocumentId;
|
|
161
|
+
if (this.externalUuid != undefined)
|
|
162
|
+
res['externalUuid'] = this.externalUuid;
|
|
163
|
+
if (this.size != undefined)
|
|
164
|
+
res['size'] = this.size;
|
|
165
|
+
if (this.hash != undefined)
|
|
166
|
+
res['hash'] = this.hash;
|
|
167
|
+
if (this.openingContactId != undefined)
|
|
168
|
+
res['openingContactId'] = this.openingContactId;
|
|
169
|
+
if (this.attachmentId != undefined)
|
|
170
|
+
res['attachmentId'] = this.attachmentId;
|
|
171
|
+
if (this.objectStoreReference != undefined)
|
|
172
|
+
res['objectStoreReference'] = this.objectStoreReference;
|
|
173
|
+
if (this.mainUti != undefined)
|
|
174
|
+
res['mainUti'] = this.mainUti;
|
|
175
|
+
res['otherUtis'] = this.otherUtis.map((x0) => x0);
|
|
176
|
+
res['secondaryAttachments'] = Object.fromEntries(Object.entries(this.secondaryAttachments).map(([k0, v0]) => [k0, v0.toJSON()]));
|
|
177
|
+
res['deletedAttachments'] = this.deletedAttachments.map((x0) => x0.toJSON());
|
|
178
|
+
if (this.encryptedAttachment != undefined)
|
|
179
|
+
res['encryptedAttachment'] = encodeBase64(this.encryptedAttachment);
|
|
180
|
+
if (this.decryptedAttachment != undefined)
|
|
181
|
+
res['decryptedAttachment'] = encodeBase64(this.decryptedAttachment);
|
|
182
|
+
res['secretForeignKeys'] = this.secretForeignKeys.map((x0) => x0);
|
|
183
|
+
res['cryptedForeignKeys'] = Object.fromEntries(Object.entries(this.cryptedForeignKeys).map(([k0, v0]) => [k0, v0.map((x1) => x1.toJSON())]));
|
|
184
|
+
res['delegations'] = Object.fromEntries(Object.entries(this.delegations).map(([k0, v0]) => [k0, v0.map((x1) => x1.toJSON())]));
|
|
185
|
+
res['encryptionKeys'] = Object.fromEntries(Object.entries(this.encryptionKeys).map(([k0, v0]) => [k0, v0.map((x1) => x1.toJSON())]));
|
|
186
|
+
if (this.encryptedSelf != undefined)
|
|
187
|
+
res['encryptedSelf'] = this.encryptedSelf;
|
|
188
|
+
if (this.securityMetadata != undefined)
|
|
189
|
+
res['securityMetadata'] = this.securityMetadata.toJSON();
|
|
190
|
+
res['isEncrypted'] = false;
|
|
191
|
+
return res;
|
|
192
|
+
}
|
|
193
|
+
static fromJSON(json, ignoreUnknownKeys = false, path = ['DecryptedDocument']) {
|
|
194
|
+
if (typeof json != 'object')
|
|
195
|
+
throw new Error(`Expected json object at path ${path.join("")}`);
|
|
196
|
+
const jCpy = Object.assign({}, json);
|
|
197
|
+
if (extractEntry(jCpy, "isEncrypted", true, path) !== false)
|
|
198
|
+
throw new Error(`Unexpected value for ${path.join("")} isEncrypted marker, should be false. The provided json doesn't represent a DecryptedDocument`);
|
|
199
|
+
const res = new DecryptedDocument({
|
|
200
|
+
id: expectString(extractEntry(jCpy, 'id', true, path), false, [...path, ".id"]),
|
|
201
|
+
rev: expectString(extractEntry(jCpy, 'rev', false, path), true, [...path, ".rev"]),
|
|
202
|
+
created: expectNumber(extractEntry(jCpy, 'created', false, path), true, true, [...path, ".created"]),
|
|
203
|
+
modified: expectNumber(extractEntry(jCpy, 'modified', false, path), true, true, [...path, ".modified"]),
|
|
204
|
+
author: expectString(extractEntry(jCpy, 'author', false, path), true, [...path, ".author"]),
|
|
205
|
+
responsible: expectString(extractEntry(jCpy, 'responsible', false, path), true, [...path, ".responsible"]),
|
|
206
|
+
medicalLocationId: expectString(extractEntry(jCpy, 'medicalLocationId', false, path), true, [...path, ".medicalLocationId"]),
|
|
207
|
+
tags: expectArray(extractEntry(jCpy, 'tags', false, path), false, [...path, ".tags"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, CodeStub.fromJSON)),
|
|
208
|
+
codes: expectArray(extractEntry(jCpy, 'codes', false, path), false, [...path, ".codes"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, CodeStub.fromJSON)),
|
|
209
|
+
endOfLife: expectNumber(extractEntry(jCpy, 'endOfLife', false, path), true, true, [...path, ".endOfLife"]),
|
|
210
|
+
deletionDate: expectNumber(extractEntry(jCpy, 'deletionDate', false, path), true, true, [...path, ".deletionDate"]),
|
|
211
|
+
documentLocation: expectStringEnum(extractEntry(jCpy, 'documentLocation', false, path), true, [...path, ".documentLocation"], DocumentLocation, 'DocumentLocation'),
|
|
212
|
+
documentType: expectStringEnum(extractEntry(jCpy, 'documentType', false, path), true, [...path, ".documentType"], DocumentType, 'DocumentType'),
|
|
213
|
+
documentStatus: expectStringEnum(extractEntry(jCpy, 'documentStatus', false, path), true, [...path, ".documentStatus"], DocumentStatus, 'DocumentStatus'),
|
|
214
|
+
externalUri: expectString(extractEntry(jCpy, 'externalUri', false, path), true, [...path, ".externalUri"]),
|
|
215
|
+
name: expectString(extractEntry(jCpy, 'name', false, path), true, [...path, ".name"]),
|
|
216
|
+
version: expectString(extractEntry(jCpy, 'version', false, path), true, [...path, ".version"]),
|
|
217
|
+
storedICureDocumentId: expectString(extractEntry(jCpy, 'storedICureDocumentId', false, path), true, [...path, ".storedICureDocumentId"]),
|
|
218
|
+
externalUuid: expectString(extractEntry(jCpy, 'externalUuid', false, path), true, [...path, ".externalUuid"]),
|
|
219
|
+
size: expectNumber(extractEntry(jCpy, 'size', false, path), true, true, [...path, ".size"]),
|
|
220
|
+
hash: expectString(extractEntry(jCpy, 'hash', false, path), true, [...path, ".hash"]),
|
|
221
|
+
openingContactId: expectString(extractEntry(jCpy, 'openingContactId', false, path), true, [...path, ".openingContactId"]),
|
|
222
|
+
attachmentId: expectString(extractEntry(jCpy, 'attachmentId', false, path), true, [...path, ".attachmentId"]),
|
|
223
|
+
objectStoreReference: expectString(extractEntry(jCpy, 'objectStoreReference', false, path), true, [...path, ".objectStoreReference"]),
|
|
224
|
+
mainUti: expectString(extractEntry(jCpy, 'mainUti', false, path), true, [...path, ".mainUti"]),
|
|
225
|
+
otherUtis: expectArray(extractEntry(jCpy, 'otherUtis', false, path), false, [...path, ".otherUtis"], (x0, p0) => expectString(x0, false, p0)),
|
|
226
|
+
secondaryAttachments: expectMap(extractEntry(jCpy, 'secondaryAttachments', false, path), false, [...path, ".secondaryAttachments"], (k0, p0) => expectString(k0, false, p0), (v0, p0) => expectObject(v0, false, ignoreUnknownKeys, p0, DataAttachment.fromJSON)),
|
|
227
|
+
deletedAttachments: expectArray(extractEntry(jCpy, 'deletedAttachments', false, path), false, [...path, ".deletedAttachments"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, DeletedAttachment.fromJSON)),
|
|
228
|
+
encryptedAttachment: decodeBase64(expectString(extractEntry(jCpy, 'encryptedAttachment', false, path), true, [...path, ".encryptedAttachment"]), [...path, ".encryptedAttachment"]),
|
|
229
|
+
decryptedAttachment: decodeBase64(expectString(extractEntry(jCpy, 'decryptedAttachment', false, path), true, [...path, ".decryptedAttachment"]), [...path, ".decryptedAttachment"]),
|
|
230
|
+
secretForeignKeys: expectArray(extractEntry(jCpy, 'secretForeignKeys', false, path), false, [...path, ".secretForeignKeys"], (x0, p0) => expectString(x0, false, p0)),
|
|
231
|
+
cryptedForeignKeys: expectMap(extractEntry(jCpy, 'cryptedForeignKeys', false, path), false, [...path, ".cryptedForeignKeys"], (k0, p0) => expectString(k0, false, p0), (v0, p0) => expectArray(v0, false, p0, (x1, p1) => expectObject(x1, false, ignoreUnknownKeys, p1, Delegation.fromJSON))),
|
|
232
|
+
delegations: expectMap(extractEntry(jCpy, 'delegations', false, path), false, [...path, ".delegations"], (k0, p0) => expectString(k0, false, p0), (v0, p0) => expectArray(v0, false, p0, (x1, p1) => expectObject(x1, false, ignoreUnknownKeys, p1, Delegation.fromJSON))),
|
|
233
|
+
encryptionKeys: expectMap(extractEntry(jCpy, 'encryptionKeys', false, path), false, [...path, ".encryptionKeys"], (k0, p0) => expectString(k0, false, p0), (v0, p0) => expectArray(v0, false, p0, (x1, p1) => expectObject(x1, false, ignoreUnknownKeys, p1, Delegation.fromJSON))),
|
|
234
|
+
encryptedSelf: expectString(extractEntry(jCpy, 'encryptedSelf', false, path), true, [...path, ".encryptedSelf"]),
|
|
235
|
+
securityMetadata: expectObject(extractEntry(jCpy, 'securityMetadata', false, path), true, ignoreUnknownKeys, [...path, ".securityMetadata"], SecurityMetadata.fromJSON),
|
|
236
|
+
});
|
|
237
|
+
if (!ignoreUnknownKeys) {
|
|
238
|
+
const unused = Object.keys(jCpy);
|
|
239
|
+
if (unused.length > 0)
|
|
240
|
+
throw new Error(`Unexpected key(s) for json object DecryptedDocument at path ${path.join("")}: ${unused}`);
|
|
241
|
+
}
|
|
242
|
+
return res;
|
|
243
|
+
}
|
|
116
244
|
}
|
|
117
245
|
export class EncryptedDocument {
|
|
118
246
|
constructor(partial) {
|
|
@@ -227,4 +355,122 @@ export class EncryptedDocument {
|
|
|
227
355
|
if ('securityMetadata' in partial)
|
|
228
356
|
this.securityMetadata = partial.securityMetadata;
|
|
229
357
|
}
|
|
358
|
+
toJSON() {
|
|
359
|
+
const res = {};
|
|
360
|
+
res['id'] = this.id;
|
|
361
|
+
if (this.rev != undefined)
|
|
362
|
+
res['rev'] = this.rev;
|
|
363
|
+
if (this.created != undefined)
|
|
364
|
+
res['created'] = this.created;
|
|
365
|
+
if (this.modified != undefined)
|
|
366
|
+
res['modified'] = this.modified;
|
|
367
|
+
if (this.author != undefined)
|
|
368
|
+
res['author'] = this.author;
|
|
369
|
+
if (this.responsible != undefined)
|
|
370
|
+
res['responsible'] = this.responsible;
|
|
371
|
+
if (this.medicalLocationId != undefined)
|
|
372
|
+
res['medicalLocationId'] = this.medicalLocationId;
|
|
373
|
+
res['tags'] = this.tags.map((x0) => x0.toJSON());
|
|
374
|
+
res['codes'] = this.codes.map((x0) => x0.toJSON());
|
|
375
|
+
if (this.endOfLife != undefined)
|
|
376
|
+
res['endOfLife'] = this.endOfLife;
|
|
377
|
+
if (this.deletionDate != undefined)
|
|
378
|
+
res['deletionDate'] = this.deletionDate;
|
|
379
|
+
if (this.documentLocation != undefined)
|
|
380
|
+
res['documentLocation'] = this.documentLocation;
|
|
381
|
+
if (this.documentType != undefined)
|
|
382
|
+
res['documentType'] = this.documentType;
|
|
383
|
+
if (this.documentStatus != undefined)
|
|
384
|
+
res['documentStatus'] = this.documentStatus;
|
|
385
|
+
if (this.externalUri != undefined)
|
|
386
|
+
res['externalUri'] = this.externalUri;
|
|
387
|
+
if (this.name != undefined)
|
|
388
|
+
res['name'] = this.name;
|
|
389
|
+
if (this.version != undefined)
|
|
390
|
+
res['version'] = this.version;
|
|
391
|
+
if (this.storedICureDocumentId != undefined)
|
|
392
|
+
res['storedICureDocumentId'] = this.storedICureDocumentId;
|
|
393
|
+
if (this.externalUuid != undefined)
|
|
394
|
+
res['externalUuid'] = this.externalUuid;
|
|
395
|
+
if (this.size != undefined)
|
|
396
|
+
res['size'] = this.size;
|
|
397
|
+
if (this.hash != undefined)
|
|
398
|
+
res['hash'] = this.hash;
|
|
399
|
+
if (this.openingContactId != undefined)
|
|
400
|
+
res['openingContactId'] = this.openingContactId;
|
|
401
|
+
if (this.attachmentId != undefined)
|
|
402
|
+
res['attachmentId'] = this.attachmentId;
|
|
403
|
+
if (this.objectStoreReference != undefined)
|
|
404
|
+
res['objectStoreReference'] = this.objectStoreReference;
|
|
405
|
+
if (this.mainUti != undefined)
|
|
406
|
+
res['mainUti'] = this.mainUti;
|
|
407
|
+
res['otherUtis'] = this.otherUtis.map((x0) => x0);
|
|
408
|
+
res['secondaryAttachments'] = Object.fromEntries(Object.entries(this.secondaryAttachments).map(([k0, v0]) => [k0, v0.toJSON()]));
|
|
409
|
+
res['deletedAttachments'] = this.deletedAttachments.map((x0) => x0.toJSON());
|
|
410
|
+
if (this.encryptedAttachment != undefined)
|
|
411
|
+
res['encryptedAttachment'] = encodeBase64(this.encryptedAttachment);
|
|
412
|
+
if (this.decryptedAttachment != undefined)
|
|
413
|
+
res['decryptedAttachment'] = encodeBase64(this.decryptedAttachment);
|
|
414
|
+
res['secretForeignKeys'] = this.secretForeignKeys.map((x0) => x0);
|
|
415
|
+
res['cryptedForeignKeys'] = Object.fromEntries(Object.entries(this.cryptedForeignKeys).map(([k0, v0]) => [k0, v0.map((x1) => x1.toJSON())]));
|
|
416
|
+
res['delegations'] = Object.fromEntries(Object.entries(this.delegations).map(([k0, v0]) => [k0, v0.map((x1) => x1.toJSON())]));
|
|
417
|
+
res['encryptionKeys'] = Object.fromEntries(Object.entries(this.encryptionKeys).map(([k0, v0]) => [k0, v0.map((x1) => x1.toJSON())]));
|
|
418
|
+
if (this.encryptedSelf != undefined)
|
|
419
|
+
res['encryptedSelf'] = this.encryptedSelf;
|
|
420
|
+
if (this.securityMetadata != undefined)
|
|
421
|
+
res['securityMetadata'] = this.securityMetadata.toJSON();
|
|
422
|
+
res['isEncrypted'] = true;
|
|
423
|
+
return res;
|
|
424
|
+
}
|
|
425
|
+
static fromJSON(json, ignoreUnknownKeys = false, path = ['EncryptedDocument']) {
|
|
426
|
+
if (typeof json != 'object')
|
|
427
|
+
throw new Error(`Expected json object at path ${path.join("")}`);
|
|
428
|
+
const jCpy = Object.assign({}, json);
|
|
429
|
+
if (extractEntry(jCpy, "isEncrypted", true, path) !== true)
|
|
430
|
+
throw new Error(`Unexpected value for ${path.join("")} isEncrypted marker, should be true. The provided json doesn't represent a EncryptedDocument`);
|
|
431
|
+
const res = new EncryptedDocument({
|
|
432
|
+
id: expectString(extractEntry(jCpy, 'id', true, path), false, [...path, ".id"]),
|
|
433
|
+
rev: expectString(extractEntry(jCpy, 'rev', false, path), true, [...path, ".rev"]),
|
|
434
|
+
created: expectNumber(extractEntry(jCpy, 'created', false, path), true, true, [...path, ".created"]),
|
|
435
|
+
modified: expectNumber(extractEntry(jCpy, 'modified', false, path), true, true, [...path, ".modified"]),
|
|
436
|
+
author: expectString(extractEntry(jCpy, 'author', false, path), true, [...path, ".author"]),
|
|
437
|
+
responsible: expectString(extractEntry(jCpy, 'responsible', false, path), true, [...path, ".responsible"]),
|
|
438
|
+
medicalLocationId: expectString(extractEntry(jCpy, 'medicalLocationId', false, path), true, [...path, ".medicalLocationId"]),
|
|
439
|
+
tags: expectArray(extractEntry(jCpy, 'tags', false, path), false, [...path, ".tags"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, CodeStub.fromJSON)),
|
|
440
|
+
codes: expectArray(extractEntry(jCpy, 'codes', false, path), false, [...path, ".codes"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, CodeStub.fromJSON)),
|
|
441
|
+
endOfLife: expectNumber(extractEntry(jCpy, 'endOfLife', false, path), true, true, [...path, ".endOfLife"]),
|
|
442
|
+
deletionDate: expectNumber(extractEntry(jCpy, 'deletionDate', false, path), true, true, [...path, ".deletionDate"]),
|
|
443
|
+
documentLocation: expectStringEnum(extractEntry(jCpy, 'documentLocation', false, path), true, [...path, ".documentLocation"], DocumentLocation, 'DocumentLocation'),
|
|
444
|
+
documentType: expectStringEnum(extractEntry(jCpy, 'documentType', false, path), true, [...path, ".documentType"], DocumentType, 'DocumentType'),
|
|
445
|
+
documentStatus: expectStringEnum(extractEntry(jCpy, 'documentStatus', false, path), true, [...path, ".documentStatus"], DocumentStatus, 'DocumentStatus'),
|
|
446
|
+
externalUri: expectString(extractEntry(jCpy, 'externalUri', false, path), true, [...path, ".externalUri"]),
|
|
447
|
+
name: expectString(extractEntry(jCpy, 'name', false, path), true, [...path, ".name"]),
|
|
448
|
+
version: expectString(extractEntry(jCpy, 'version', false, path), true, [...path, ".version"]),
|
|
449
|
+
storedICureDocumentId: expectString(extractEntry(jCpy, 'storedICureDocumentId', false, path), true, [...path, ".storedICureDocumentId"]),
|
|
450
|
+
externalUuid: expectString(extractEntry(jCpy, 'externalUuid', false, path), true, [...path, ".externalUuid"]),
|
|
451
|
+
size: expectNumber(extractEntry(jCpy, 'size', false, path), true, true, [...path, ".size"]),
|
|
452
|
+
hash: expectString(extractEntry(jCpy, 'hash', false, path), true, [...path, ".hash"]),
|
|
453
|
+
openingContactId: expectString(extractEntry(jCpy, 'openingContactId', false, path), true, [...path, ".openingContactId"]),
|
|
454
|
+
attachmentId: expectString(extractEntry(jCpy, 'attachmentId', false, path), true, [...path, ".attachmentId"]),
|
|
455
|
+
objectStoreReference: expectString(extractEntry(jCpy, 'objectStoreReference', false, path), true, [...path, ".objectStoreReference"]),
|
|
456
|
+
mainUti: expectString(extractEntry(jCpy, 'mainUti', false, path), true, [...path, ".mainUti"]),
|
|
457
|
+
otherUtis: expectArray(extractEntry(jCpy, 'otherUtis', false, path), false, [...path, ".otherUtis"], (x0, p0) => expectString(x0, false, p0)),
|
|
458
|
+
secondaryAttachments: expectMap(extractEntry(jCpy, 'secondaryAttachments', false, path), false, [...path, ".secondaryAttachments"], (k0, p0) => expectString(k0, false, p0), (v0, p0) => expectObject(v0, false, ignoreUnknownKeys, p0, DataAttachment.fromJSON)),
|
|
459
|
+
deletedAttachments: expectArray(extractEntry(jCpy, 'deletedAttachments', false, path), false, [...path, ".deletedAttachments"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, DeletedAttachment.fromJSON)),
|
|
460
|
+
encryptedAttachment: decodeBase64(expectString(extractEntry(jCpy, 'encryptedAttachment', false, path), true, [...path, ".encryptedAttachment"]), [...path, ".encryptedAttachment"]),
|
|
461
|
+
decryptedAttachment: decodeBase64(expectString(extractEntry(jCpy, 'decryptedAttachment', false, path), true, [...path, ".decryptedAttachment"]), [...path, ".decryptedAttachment"]),
|
|
462
|
+
secretForeignKeys: expectArray(extractEntry(jCpy, 'secretForeignKeys', false, path), false, [...path, ".secretForeignKeys"], (x0, p0) => expectString(x0, false, p0)),
|
|
463
|
+
cryptedForeignKeys: expectMap(extractEntry(jCpy, 'cryptedForeignKeys', false, path), false, [...path, ".cryptedForeignKeys"], (k0, p0) => expectString(k0, false, p0), (v0, p0) => expectArray(v0, false, p0, (x1, p1) => expectObject(x1, false, ignoreUnknownKeys, p1, Delegation.fromJSON))),
|
|
464
|
+
delegations: expectMap(extractEntry(jCpy, 'delegations', false, path), false, [...path, ".delegations"], (k0, p0) => expectString(k0, false, p0), (v0, p0) => expectArray(v0, false, p0, (x1, p1) => expectObject(x1, false, ignoreUnknownKeys, p1, Delegation.fromJSON))),
|
|
465
|
+
encryptionKeys: expectMap(extractEntry(jCpy, 'encryptionKeys', false, path), false, [...path, ".encryptionKeys"], (k0, p0) => expectString(k0, false, p0), (v0, p0) => expectArray(v0, false, p0, (x1, p1) => expectObject(x1, false, ignoreUnknownKeys, p1, Delegation.fromJSON))),
|
|
466
|
+
encryptedSelf: expectString(extractEntry(jCpy, 'encryptedSelf', false, path), true, [...path, ".encryptedSelf"]),
|
|
467
|
+
securityMetadata: expectObject(extractEntry(jCpy, 'securityMetadata', false, path), true, ignoreUnknownKeys, [...path, ".securityMetadata"], SecurityMetadata.fromJSON),
|
|
468
|
+
});
|
|
469
|
+
if (!ignoreUnknownKeys) {
|
|
470
|
+
const unused = Object.keys(jCpy);
|
|
471
|
+
if (unused.length > 0)
|
|
472
|
+
throw new Error(`Unexpected key(s) for json object EncryptedDocument at path ${path.join("")}: ${unused}`);
|
|
473
|
+
}
|
|
474
|
+
return res;
|
|
475
|
+
}
|
|
230
476
|
}
|
|
@@ -30,4 +30,6 @@ export declare class DocumentTemplate implements StoredDocument, ICureDocument<s
|
|
|
30
30
|
disabled: string | undefined;
|
|
31
31
|
specialty: CodeStub | undefined;
|
|
32
32
|
constructor(partial: Partial<DocumentTemplate>);
|
|
33
|
+
toJSON(): object;
|
|
34
|
+
static fromJSON(json: any, ignoreUnknownKeys?: boolean, path?: Array<string>): DocumentTemplate;
|
|
33
35
|
}
|