@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
package/model/Classification.mjs
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
// auto-generated file
|
|
2
|
+
import { expectArray, expectMap, expectNumber, expectObject, expectString, extractEntry } from '../internal/JsonDecodeUtils.mjs';
|
|
2
3
|
import { randomUuid } from '../utils/Id.mjs';
|
|
4
|
+
import { CodeStub } from './base/CodeStub.mjs';
|
|
5
|
+
import { Delegation } from './embed/Delegation.mjs';
|
|
6
|
+
import { SecurityMetadata } from './embed/SecurityMetadata.mjs';
|
|
3
7
|
export class DecryptedClassification {
|
|
4
8
|
constructor(partial) {
|
|
5
9
|
var _a;
|
|
@@ -65,6 +69,78 @@ export class DecryptedClassification {
|
|
|
65
69
|
if ('securityMetadata' in partial)
|
|
66
70
|
this.securityMetadata = partial.securityMetadata;
|
|
67
71
|
}
|
|
72
|
+
toJSON() {
|
|
73
|
+
const res = {};
|
|
74
|
+
res['id'] = this.id;
|
|
75
|
+
if (this.rev != undefined)
|
|
76
|
+
res['rev'] = this.rev;
|
|
77
|
+
if (this.created != undefined)
|
|
78
|
+
res['created'] = this.created;
|
|
79
|
+
if (this.modified != undefined)
|
|
80
|
+
res['modified'] = this.modified;
|
|
81
|
+
if (this.author != undefined)
|
|
82
|
+
res['author'] = this.author;
|
|
83
|
+
if (this.responsible != undefined)
|
|
84
|
+
res['responsible'] = this.responsible;
|
|
85
|
+
if (this.medicalLocationId != undefined)
|
|
86
|
+
res['medicalLocationId'] = this.medicalLocationId;
|
|
87
|
+
res['tags'] = this.tags.map((x0) => x0.toJSON());
|
|
88
|
+
res['codes'] = this.codes.map((x0) => x0.toJSON());
|
|
89
|
+
if (this.endOfLife != undefined)
|
|
90
|
+
res['endOfLife'] = this.endOfLife;
|
|
91
|
+
if (this.deletionDate != undefined)
|
|
92
|
+
res['deletionDate'] = this.deletionDate;
|
|
93
|
+
if (this.parentId != undefined)
|
|
94
|
+
res['parentId'] = this.parentId;
|
|
95
|
+
res['label'] = this.label;
|
|
96
|
+
if (this.templateId != undefined)
|
|
97
|
+
res['templateId'] = this.templateId;
|
|
98
|
+
res['secretForeignKeys'] = this.secretForeignKeys.map((x0) => x0);
|
|
99
|
+
res['cryptedForeignKeys'] = Object.fromEntries(Object.entries(this.cryptedForeignKeys).map(([k0, v0]) => [k0, v0.map((x1) => x1.toJSON())]));
|
|
100
|
+
res['delegations'] = Object.fromEntries(Object.entries(this.delegations).map(([k0, v0]) => [k0, v0.map((x1) => x1.toJSON())]));
|
|
101
|
+
res['encryptionKeys'] = Object.fromEntries(Object.entries(this.encryptionKeys).map(([k0, v0]) => [k0, v0.map((x1) => x1.toJSON())]));
|
|
102
|
+
if (this.encryptedSelf != undefined)
|
|
103
|
+
res['encryptedSelf'] = this.encryptedSelf;
|
|
104
|
+
if (this.securityMetadata != undefined)
|
|
105
|
+
res['securityMetadata'] = this.securityMetadata.toJSON();
|
|
106
|
+
res['isEncrypted'] = false;
|
|
107
|
+
return res;
|
|
108
|
+
}
|
|
109
|
+
static fromJSON(json, ignoreUnknownKeys = false, path = ['DecryptedClassification']) {
|
|
110
|
+
if (typeof json != 'object')
|
|
111
|
+
throw new Error(`Expected json object at path ${path.join("")}`);
|
|
112
|
+
const jCpy = Object.assign({}, json);
|
|
113
|
+
if (extractEntry(jCpy, "isEncrypted", true, path) !== false)
|
|
114
|
+
throw new Error(`Unexpected value for ${path.join("")} isEncrypted marker, should be false. The provided json doesn't represent a DecryptedClassification`);
|
|
115
|
+
const res = new DecryptedClassification({
|
|
116
|
+
id: expectString(extractEntry(jCpy, 'id', true, path), false, [...path, ".id"]),
|
|
117
|
+
rev: expectString(extractEntry(jCpy, 'rev', false, path), true, [...path, ".rev"]),
|
|
118
|
+
created: expectNumber(extractEntry(jCpy, 'created', false, path), true, true, [...path, ".created"]),
|
|
119
|
+
modified: expectNumber(extractEntry(jCpy, 'modified', false, path), true, true, [...path, ".modified"]),
|
|
120
|
+
author: expectString(extractEntry(jCpy, 'author', false, path), true, [...path, ".author"]),
|
|
121
|
+
responsible: expectString(extractEntry(jCpy, 'responsible', false, path), true, [...path, ".responsible"]),
|
|
122
|
+
medicalLocationId: expectString(extractEntry(jCpy, 'medicalLocationId', false, path), true, [...path, ".medicalLocationId"]),
|
|
123
|
+
tags: expectArray(extractEntry(jCpy, 'tags', false, path), false, [...path, ".tags"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, CodeStub.fromJSON)),
|
|
124
|
+
codes: expectArray(extractEntry(jCpy, 'codes', false, path), false, [...path, ".codes"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, CodeStub.fromJSON)),
|
|
125
|
+
endOfLife: expectNumber(extractEntry(jCpy, 'endOfLife', false, path), true, true, [...path, ".endOfLife"]),
|
|
126
|
+
deletionDate: expectNumber(extractEntry(jCpy, 'deletionDate', false, path), true, true, [...path, ".deletionDate"]),
|
|
127
|
+
parentId: expectString(extractEntry(jCpy, 'parentId', false, path), true, [...path, ".parentId"]),
|
|
128
|
+
label: expectString(extractEntry(jCpy, 'label', false, path), false, [...path, ".label"]),
|
|
129
|
+
templateId: expectString(extractEntry(jCpy, 'templateId', false, path), true, [...path, ".templateId"]),
|
|
130
|
+
secretForeignKeys: expectArray(extractEntry(jCpy, 'secretForeignKeys', false, path), false, [...path, ".secretForeignKeys"], (x0, p0) => expectString(x0, false, p0)),
|
|
131
|
+
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))),
|
|
132
|
+
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))),
|
|
133
|
+
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))),
|
|
134
|
+
encryptedSelf: expectString(extractEntry(jCpy, 'encryptedSelf', false, path), true, [...path, ".encryptedSelf"]),
|
|
135
|
+
securityMetadata: expectObject(extractEntry(jCpy, 'securityMetadata', false, path), true, ignoreUnknownKeys, [...path, ".securityMetadata"], SecurityMetadata.fromJSON),
|
|
136
|
+
});
|
|
137
|
+
if (!ignoreUnknownKeys) {
|
|
138
|
+
const unused = Object.keys(jCpy);
|
|
139
|
+
if (unused.length > 0)
|
|
140
|
+
throw new Error(`Unexpected key(s) for json object DecryptedClassification at path ${path.join("")}: ${unused}`);
|
|
141
|
+
}
|
|
142
|
+
return res;
|
|
143
|
+
}
|
|
68
144
|
}
|
|
69
145
|
export class EncryptedClassification {
|
|
70
146
|
constructor(partial) {
|
|
@@ -131,4 +207,76 @@ export class EncryptedClassification {
|
|
|
131
207
|
if ('securityMetadata' in partial)
|
|
132
208
|
this.securityMetadata = partial.securityMetadata;
|
|
133
209
|
}
|
|
210
|
+
toJSON() {
|
|
211
|
+
const res = {};
|
|
212
|
+
res['id'] = this.id;
|
|
213
|
+
if (this.rev != undefined)
|
|
214
|
+
res['rev'] = this.rev;
|
|
215
|
+
if (this.created != undefined)
|
|
216
|
+
res['created'] = this.created;
|
|
217
|
+
if (this.modified != undefined)
|
|
218
|
+
res['modified'] = this.modified;
|
|
219
|
+
if (this.author != undefined)
|
|
220
|
+
res['author'] = this.author;
|
|
221
|
+
if (this.responsible != undefined)
|
|
222
|
+
res['responsible'] = this.responsible;
|
|
223
|
+
if (this.medicalLocationId != undefined)
|
|
224
|
+
res['medicalLocationId'] = this.medicalLocationId;
|
|
225
|
+
res['tags'] = this.tags.map((x0) => x0.toJSON());
|
|
226
|
+
res['codes'] = this.codes.map((x0) => x0.toJSON());
|
|
227
|
+
if (this.endOfLife != undefined)
|
|
228
|
+
res['endOfLife'] = this.endOfLife;
|
|
229
|
+
if (this.deletionDate != undefined)
|
|
230
|
+
res['deletionDate'] = this.deletionDate;
|
|
231
|
+
if (this.parentId != undefined)
|
|
232
|
+
res['parentId'] = this.parentId;
|
|
233
|
+
res['label'] = this.label;
|
|
234
|
+
if (this.templateId != undefined)
|
|
235
|
+
res['templateId'] = this.templateId;
|
|
236
|
+
res['secretForeignKeys'] = this.secretForeignKeys.map((x0) => x0);
|
|
237
|
+
res['cryptedForeignKeys'] = Object.fromEntries(Object.entries(this.cryptedForeignKeys).map(([k0, v0]) => [k0, v0.map((x1) => x1.toJSON())]));
|
|
238
|
+
res['delegations'] = Object.fromEntries(Object.entries(this.delegations).map(([k0, v0]) => [k0, v0.map((x1) => x1.toJSON())]));
|
|
239
|
+
res['encryptionKeys'] = Object.fromEntries(Object.entries(this.encryptionKeys).map(([k0, v0]) => [k0, v0.map((x1) => x1.toJSON())]));
|
|
240
|
+
if (this.encryptedSelf != undefined)
|
|
241
|
+
res['encryptedSelf'] = this.encryptedSelf;
|
|
242
|
+
if (this.securityMetadata != undefined)
|
|
243
|
+
res['securityMetadata'] = this.securityMetadata.toJSON();
|
|
244
|
+
res['isEncrypted'] = true;
|
|
245
|
+
return res;
|
|
246
|
+
}
|
|
247
|
+
static fromJSON(json, ignoreUnknownKeys = false, path = ['EncryptedClassification']) {
|
|
248
|
+
if (typeof json != 'object')
|
|
249
|
+
throw new Error(`Expected json object at path ${path.join("")}`);
|
|
250
|
+
const jCpy = Object.assign({}, json);
|
|
251
|
+
if (extractEntry(jCpy, "isEncrypted", true, path) !== true)
|
|
252
|
+
throw new Error(`Unexpected value for ${path.join("")} isEncrypted marker, should be true. The provided json doesn't represent a EncryptedClassification`);
|
|
253
|
+
const res = new EncryptedClassification({
|
|
254
|
+
id: expectString(extractEntry(jCpy, 'id', true, path), false, [...path, ".id"]),
|
|
255
|
+
rev: expectString(extractEntry(jCpy, 'rev', false, path), true, [...path, ".rev"]),
|
|
256
|
+
created: expectNumber(extractEntry(jCpy, 'created', false, path), true, true, [...path, ".created"]),
|
|
257
|
+
modified: expectNumber(extractEntry(jCpy, 'modified', false, path), true, true, [...path, ".modified"]),
|
|
258
|
+
author: expectString(extractEntry(jCpy, 'author', false, path), true, [...path, ".author"]),
|
|
259
|
+
responsible: expectString(extractEntry(jCpy, 'responsible', false, path), true, [...path, ".responsible"]),
|
|
260
|
+
medicalLocationId: expectString(extractEntry(jCpy, 'medicalLocationId', false, path), true, [...path, ".medicalLocationId"]),
|
|
261
|
+
tags: expectArray(extractEntry(jCpy, 'tags', false, path), false, [...path, ".tags"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, CodeStub.fromJSON)),
|
|
262
|
+
codes: expectArray(extractEntry(jCpy, 'codes', false, path), false, [...path, ".codes"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, CodeStub.fromJSON)),
|
|
263
|
+
endOfLife: expectNumber(extractEntry(jCpy, 'endOfLife', false, path), true, true, [...path, ".endOfLife"]),
|
|
264
|
+
deletionDate: expectNumber(extractEntry(jCpy, 'deletionDate', false, path), true, true, [...path, ".deletionDate"]),
|
|
265
|
+
parentId: expectString(extractEntry(jCpy, 'parentId', false, path), true, [...path, ".parentId"]),
|
|
266
|
+
label: expectString(extractEntry(jCpy, 'label', false, path), false, [...path, ".label"]),
|
|
267
|
+
templateId: expectString(extractEntry(jCpy, 'templateId', false, path), true, [...path, ".templateId"]),
|
|
268
|
+
secretForeignKeys: expectArray(extractEntry(jCpy, 'secretForeignKeys', false, path), false, [...path, ".secretForeignKeys"], (x0, p0) => expectString(x0, false, p0)),
|
|
269
|
+
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))),
|
|
270
|
+
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))),
|
|
271
|
+
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))),
|
|
272
|
+
encryptedSelf: expectString(extractEntry(jCpy, 'encryptedSelf', false, path), true, [...path, ".encryptedSelf"]),
|
|
273
|
+
securityMetadata: expectObject(extractEntry(jCpy, 'securityMetadata', false, path), true, ignoreUnknownKeys, [...path, ".securityMetadata"], SecurityMetadata.fromJSON),
|
|
274
|
+
});
|
|
275
|
+
if (!ignoreUnknownKeys) {
|
|
276
|
+
const unused = Object.keys(jCpy);
|
|
277
|
+
if (unused.length > 0)
|
|
278
|
+
throw new Error(`Unexpected key(s) for json object EncryptedClassification at path ${path.join("")}: ${unused}`);
|
|
279
|
+
}
|
|
280
|
+
return res;
|
|
281
|
+
}
|
|
134
282
|
}
|
package/model/Code.d.mts
CHANGED
package/model/Code.mjs
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
// auto-generated file
|
|
2
|
+
import { expectArray, expectBoolean, expectMap, expectNumber, expectObject, expectString, expectStringEnum, extractEntry } from '../internal/JsonDecodeUtils.mjs';
|
|
2
3
|
import { randomUuid } from '../utils/Id.mjs';
|
|
4
|
+
import { AppendixType } from './base/AppendixType.mjs';
|
|
5
|
+
import { CodeFlag } from './base/CodeFlag.mjs';
|
|
6
|
+
import { Periodicity } from './embed/Periodicity.mjs';
|
|
3
7
|
export class Code {
|
|
4
8
|
constructor(partial) {
|
|
5
9
|
var _a;
|
|
@@ -59,4 +63,69 @@ export class Code {
|
|
|
59
63
|
if ('disabled' in partial && partial.disabled !== undefined)
|
|
60
64
|
this.disabled = partial.disabled;
|
|
61
65
|
}
|
|
66
|
+
toJSON() {
|
|
67
|
+
const res = {};
|
|
68
|
+
res['id'] = this.id;
|
|
69
|
+
if (this.rev != undefined)
|
|
70
|
+
res['rev'] = this.rev;
|
|
71
|
+
if (this.deletionDate != undefined)
|
|
72
|
+
res['deletionDate'] = this.deletionDate;
|
|
73
|
+
if (this.context != undefined)
|
|
74
|
+
res['context'] = this.context;
|
|
75
|
+
if (this.type != undefined)
|
|
76
|
+
res['type'] = this.type;
|
|
77
|
+
if (this.code != undefined)
|
|
78
|
+
res['code'] = this.code;
|
|
79
|
+
if (this.version != undefined)
|
|
80
|
+
res['version'] = this.version;
|
|
81
|
+
if (this.label != undefined)
|
|
82
|
+
res['label'] = Object.fromEntries(Object.entries(this.label).map(([k0, v0]) => [k0, v0]));
|
|
83
|
+
if (this.author != undefined)
|
|
84
|
+
res['author'] = this.author;
|
|
85
|
+
res['regions'] = this.regions.map((x0) => x0);
|
|
86
|
+
res['periodicity'] = this.periodicity.map((x0) => x0.toJSON());
|
|
87
|
+
if (this.level != undefined)
|
|
88
|
+
res['level'] = this.level;
|
|
89
|
+
res['links'] = this.links.map((x0) => x0);
|
|
90
|
+
res['qualifiedLinks'] = Object.fromEntries(Object.entries(this.qualifiedLinks).map(([k0, v0]) => [k0, v0.map((x1) => x1)]));
|
|
91
|
+
res['flags'] = this.flags.map((x0) => x0);
|
|
92
|
+
res['searchTerms'] = Object.fromEntries(Object.entries(this.searchTerms).map(([k0, v0]) => [k0, v0.map((x1) => x1)]));
|
|
93
|
+
if (this.data != undefined)
|
|
94
|
+
res['data'] = this.data;
|
|
95
|
+
res['appendices'] = Object.fromEntries(Object.entries(this.appendices).map(([k0, v0]) => [k0, v0]));
|
|
96
|
+
res['disabled'] = this.disabled;
|
|
97
|
+
return res;
|
|
98
|
+
}
|
|
99
|
+
static fromJSON(json, ignoreUnknownKeys = false, path = ['Code']) {
|
|
100
|
+
if (typeof json != 'object')
|
|
101
|
+
throw new Error(`Expected json object at path ${path.join("")}`);
|
|
102
|
+
const jCpy = Object.assign({}, json);
|
|
103
|
+
const res = new Code({
|
|
104
|
+
id: expectString(extractEntry(jCpy, 'id', true, path), false, [...path, ".id"]),
|
|
105
|
+
rev: expectString(extractEntry(jCpy, 'rev', false, path), true, [...path, ".rev"]),
|
|
106
|
+
deletionDate: expectNumber(extractEntry(jCpy, 'deletionDate', false, path), true, true, [...path, ".deletionDate"]),
|
|
107
|
+
context: expectString(extractEntry(jCpy, 'context', false, path), true, [...path, ".context"]),
|
|
108
|
+
type: expectString(extractEntry(jCpy, 'type', false, path), true, [...path, ".type"]),
|
|
109
|
+
code: expectString(extractEntry(jCpy, 'code', false, path), true, [...path, ".code"]),
|
|
110
|
+
version: expectString(extractEntry(jCpy, 'version', false, path), true, [...path, ".version"]),
|
|
111
|
+
label: expectMap(extractEntry(jCpy, 'label', false, path), true, [...path, ".label"], (k0, p0) => expectString(k0, false, p0), (v0, p0) => expectString(v0, false, p0)),
|
|
112
|
+
author: expectString(extractEntry(jCpy, 'author', false, path), true, [...path, ".author"]),
|
|
113
|
+
regions: expectArray(extractEntry(jCpy, 'regions', false, path), false, [...path, ".regions"], (x0, p0) => expectString(x0, false, p0)),
|
|
114
|
+
periodicity: expectArray(extractEntry(jCpy, 'periodicity', false, path), false, [...path, ".periodicity"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, Periodicity.fromJSON)),
|
|
115
|
+
level: expectNumber(extractEntry(jCpy, 'level', false, path), true, true, [...path, ".level"]),
|
|
116
|
+
links: expectArray(extractEntry(jCpy, 'links', false, path), false, [...path, ".links"], (x0, p0) => expectString(x0, false, p0)),
|
|
117
|
+
qualifiedLinks: expectMap(extractEntry(jCpy, 'qualifiedLinks', false, path), false, [...path, ".qualifiedLinks"], (k0, p0) => expectString(k0, false, p0), (v0, p0) => expectArray(v0, false, p0, (x1, p1) => expectString(x1, false, p1))),
|
|
118
|
+
flags: expectArray(extractEntry(jCpy, 'flags', false, path), false, [...path, ".flags"], (x0, p0) => expectStringEnum(x0, false, p0, CodeFlag, 'CodeFlag')),
|
|
119
|
+
searchTerms: expectMap(extractEntry(jCpy, 'searchTerms', false, path), false, [...path, ".searchTerms"], (k0, p0) => expectString(k0, false, p0), (v0, p0) => expectArray(v0, false, p0, (x1, p1) => expectString(x1, false, p1))),
|
|
120
|
+
data: expectString(extractEntry(jCpy, 'data', false, path), true, [...path, ".data"]),
|
|
121
|
+
appendices: expectMap(extractEntry(jCpy, 'appendices', false, path), false, [...path, ".appendices"], (k0, p0) => expectStringEnum(k0, false, p0, AppendixType, 'AppendixType'), (v0, p0) => expectString(v0, false, p0)),
|
|
122
|
+
disabled: expectBoolean(extractEntry(jCpy, 'disabled', false, path), false, [...path, ".disabled"]),
|
|
123
|
+
});
|
|
124
|
+
if (!ignoreUnknownKeys) {
|
|
125
|
+
const unused = Object.keys(jCpy);
|
|
126
|
+
if (unused.length > 0)
|
|
127
|
+
throw new Error(`Unexpected key(s) for json object Code at path ${path.join("")}: ${unused}`);
|
|
128
|
+
}
|
|
129
|
+
return res;
|
|
130
|
+
}
|
|
62
131
|
}
|
package/model/Contact.d.mts
CHANGED
|
@@ -31,6 +31,7 @@ export interface Contact extends StoredDocument, ICureDocument<string>, HasEncry
|
|
|
31
31
|
modifiedContactId: string | undefined;
|
|
32
32
|
notes: Array<Annotation>;
|
|
33
33
|
readonly isEncrypted: boolean;
|
|
34
|
+
toJSON(): object;
|
|
34
35
|
}
|
|
35
36
|
export declare class DecryptedContact {
|
|
36
37
|
id: string;
|
|
@@ -75,6 +76,8 @@ export declare class DecryptedContact {
|
|
|
75
76
|
notes: Array<Annotation>;
|
|
76
77
|
readonly isEncrypted: false;
|
|
77
78
|
constructor(partial: Partial<DecryptedContact>);
|
|
79
|
+
toJSON(): object;
|
|
80
|
+
static fromJSON(json: any, ignoreUnknownKeys?: boolean, path?: Array<string>): DecryptedContact;
|
|
78
81
|
}
|
|
79
82
|
export declare class EncryptedContact {
|
|
80
83
|
id: string;
|
|
@@ -119,4 +122,6 @@ export declare class EncryptedContact {
|
|
|
119
122
|
notes: Array<Annotation>;
|
|
120
123
|
readonly isEncrypted: true;
|
|
121
124
|
constructor(partial: Partial<EncryptedContact>);
|
|
125
|
+
toJSON(): object;
|
|
126
|
+
static fromJSON(json: any, ignoreUnknownKeys?: boolean, path?: Array<string>): EncryptedContact;
|
|
122
127
|
}
|
package/model/Contact.mjs
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
// auto-generated file
|
|
2
|
+
import { expectArray, expectMap, expectNumber, expectObject, expectString, expectStringEnum, extractEntry } from '../internal/JsonDecodeUtils.mjs';
|
|
2
3
|
import { randomUuid } from '../utils/Id.mjs';
|
|
4
|
+
import { CodeStub } from './base/CodeStub.mjs';
|
|
5
|
+
import { Identifier } from './base/Identifier.mjs';
|
|
6
|
+
import { ParticipantType } from './base/ParticipantType.mjs';
|
|
7
|
+
import { DecryptedAddress, EncryptedAddress } from './embed/Address.mjs';
|
|
8
|
+
import { Annotation } from './embed/Annotation.mjs';
|
|
9
|
+
import { Delegation } from './embed/Delegation.mjs';
|
|
10
|
+
import { SecurityMetadata } from './embed/SecurityMetadata.mjs';
|
|
11
|
+
import { DecryptedService, EncryptedService } from './embed/Service.mjs';
|
|
12
|
+
import { DecryptedSubContact, EncryptedSubContact } from './embed/SubContact.mjs';
|
|
3
13
|
export class DecryptedContact {
|
|
4
14
|
constructor(partial) {
|
|
5
15
|
var _a;
|
|
@@ -101,6 +111,110 @@ export class DecryptedContact {
|
|
|
101
111
|
if ('notes' in partial && partial.notes !== undefined)
|
|
102
112
|
this.notes = partial.notes;
|
|
103
113
|
}
|
|
114
|
+
toJSON() {
|
|
115
|
+
const res = {};
|
|
116
|
+
res['id'] = this.id;
|
|
117
|
+
if (this.rev != undefined)
|
|
118
|
+
res['rev'] = this.rev;
|
|
119
|
+
if (this.created != undefined)
|
|
120
|
+
res['created'] = this.created;
|
|
121
|
+
if (this.modified != undefined)
|
|
122
|
+
res['modified'] = this.modified;
|
|
123
|
+
if (this.author != undefined)
|
|
124
|
+
res['author'] = this.author;
|
|
125
|
+
if (this.responsible != undefined)
|
|
126
|
+
res['responsible'] = this.responsible;
|
|
127
|
+
if (this.medicalLocationId != undefined)
|
|
128
|
+
res['medicalLocationId'] = this.medicalLocationId;
|
|
129
|
+
res['tags'] = this.tags.map((x0) => x0.toJSON());
|
|
130
|
+
res['codes'] = this.codes.map((x0) => x0.toJSON());
|
|
131
|
+
res['identifier'] = this.identifier.map((x0) => x0.toJSON());
|
|
132
|
+
if (this.endOfLife != undefined)
|
|
133
|
+
res['endOfLife'] = this.endOfLife;
|
|
134
|
+
if (this.deletionDate != undefined)
|
|
135
|
+
res['deletionDate'] = this.deletionDate;
|
|
136
|
+
if (this.groupId != undefined)
|
|
137
|
+
res['groupId'] = this.groupId;
|
|
138
|
+
if (this.openingDate != undefined)
|
|
139
|
+
res['openingDate'] = this.openingDate;
|
|
140
|
+
if (this.closingDate != undefined)
|
|
141
|
+
res['closingDate'] = this.closingDate;
|
|
142
|
+
if (this.descr != undefined)
|
|
143
|
+
res['descr'] = this.descr;
|
|
144
|
+
if (this.location != undefined)
|
|
145
|
+
res['location'] = this.location;
|
|
146
|
+
if (this.externalId != undefined)
|
|
147
|
+
res['externalId'] = this.externalId;
|
|
148
|
+
if (this.encounterType != undefined)
|
|
149
|
+
res['encounterType'] = this.encounterType.toJSON();
|
|
150
|
+
if (this.encounterLocation != undefined)
|
|
151
|
+
res['encounterLocation'] = this.encounterLocation.toJSON();
|
|
152
|
+
res['subContacts'] = this.subContacts.map((x0) => x0.toJSON());
|
|
153
|
+
res['services'] = this.services.map((x0) => x0.toJSON());
|
|
154
|
+
res['participants'] = Object.fromEntries(Object.entries(this.participants).map(([k0, v0]) => [k0, v0]));
|
|
155
|
+
if (this.healthcarePartyId != undefined)
|
|
156
|
+
res['healthcarePartyId'] = this.healthcarePartyId;
|
|
157
|
+
if (this.modifiedContactId != undefined)
|
|
158
|
+
res['modifiedContactId'] = this.modifiedContactId;
|
|
159
|
+
res['secretForeignKeys'] = this.secretForeignKeys.map((x0) => x0);
|
|
160
|
+
res['cryptedForeignKeys'] = Object.fromEntries(Object.entries(this.cryptedForeignKeys).map(([k0, v0]) => [k0, v0.map((x1) => x1.toJSON())]));
|
|
161
|
+
res['delegations'] = Object.fromEntries(Object.entries(this.delegations).map(([k0, v0]) => [k0, v0.map((x1) => x1.toJSON())]));
|
|
162
|
+
res['encryptionKeys'] = Object.fromEntries(Object.entries(this.encryptionKeys).map(([k0, v0]) => [k0, v0.map((x1) => x1.toJSON())]));
|
|
163
|
+
if (this.encryptedSelf != undefined)
|
|
164
|
+
res['encryptedSelf'] = this.encryptedSelf;
|
|
165
|
+
if (this.securityMetadata != undefined)
|
|
166
|
+
res['securityMetadata'] = this.securityMetadata.toJSON();
|
|
167
|
+
res['notes'] = this.notes.map((x0) => x0.toJSON());
|
|
168
|
+
res['isEncrypted'] = false;
|
|
169
|
+
return res;
|
|
170
|
+
}
|
|
171
|
+
static fromJSON(json, ignoreUnknownKeys = false, path = ['DecryptedContact']) {
|
|
172
|
+
if (typeof json != 'object')
|
|
173
|
+
throw new Error(`Expected json object at path ${path.join("")}`);
|
|
174
|
+
const jCpy = Object.assign({}, json);
|
|
175
|
+
if (extractEntry(jCpy, "isEncrypted", true, path) !== false)
|
|
176
|
+
throw new Error(`Unexpected value for ${path.join("")} isEncrypted marker, should be false. The provided json doesn't represent a DecryptedContact`);
|
|
177
|
+
const res = new DecryptedContact({
|
|
178
|
+
id: expectString(extractEntry(jCpy, 'id', true, path), false, [...path, ".id"]),
|
|
179
|
+
rev: expectString(extractEntry(jCpy, 'rev', false, path), true, [...path, ".rev"]),
|
|
180
|
+
created: expectNumber(extractEntry(jCpy, 'created', false, path), true, true, [...path, ".created"]),
|
|
181
|
+
modified: expectNumber(extractEntry(jCpy, 'modified', false, path), true, true, [...path, ".modified"]),
|
|
182
|
+
author: expectString(extractEntry(jCpy, 'author', false, path), true, [...path, ".author"]),
|
|
183
|
+
responsible: expectString(extractEntry(jCpy, 'responsible', false, path), true, [...path, ".responsible"]),
|
|
184
|
+
medicalLocationId: expectString(extractEntry(jCpy, 'medicalLocationId', false, path), true, [...path, ".medicalLocationId"]),
|
|
185
|
+
tags: expectArray(extractEntry(jCpy, 'tags', false, path), false, [...path, ".tags"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, CodeStub.fromJSON)),
|
|
186
|
+
codes: expectArray(extractEntry(jCpy, 'codes', false, path), false, [...path, ".codes"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, CodeStub.fromJSON)),
|
|
187
|
+
identifier: expectArray(extractEntry(jCpy, 'identifier', false, path), false, [...path, ".identifier"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, Identifier.fromJSON)),
|
|
188
|
+
endOfLife: expectNumber(extractEntry(jCpy, 'endOfLife', false, path), true, true, [...path, ".endOfLife"]),
|
|
189
|
+
deletionDate: expectNumber(extractEntry(jCpy, 'deletionDate', false, path), true, true, [...path, ".deletionDate"]),
|
|
190
|
+
groupId: expectString(extractEntry(jCpy, 'groupId', false, path), true, [...path, ".groupId"]),
|
|
191
|
+
openingDate: expectNumber(extractEntry(jCpy, 'openingDate', false, path), true, true, [...path, ".openingDate"]),
|
|
192
|
+
closingDate: expectNumber(extractEntry(jCpy, 'closingDate', false, path), true, true, [...path, ".closingDate"]),
|
|
193
|
+
descr: expectString(extractEntry(jCpy, 'descr', false, path), true, [...path, ".descr"]),
|
|
194
|
+
location: expectString(extractEntry(jCpy, 'location', false, path), true, [...path, ".location"]),
|
|
195
|
+
externalId: expectString(extractEntry(jCpy, 'externalId', false, path), true, [...path, ".externalId"]),
|
|
196
|
+
encounterType: expectObject(extractEntry(jCpy, 'encounterType', false, path), true, ignoreUnknownKeys, [...path, ".encounterType"], CodeStub.fromJSON),
|
|
197
|
+
encounterLocation: expectObject(extractEntry(jCpy, 'encounterLocation', false, path), true, ignoreUnknownKeys, [...path, ".encounterLocation"], DecryptedAddress.fromJSON),
|
|
198
|
+
subContacts: expectArray(extractEntry(jCpy, 'subContacts', false, path), false, [...path, ".subContacts"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, DecryptedSubContact.fromJSON)),
|
|
199
|
+
services: expectArray(extractEntry(jCpy, 'services', false, path), false, [...path, ".services"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, DecryptedService.fromJSON)),
|
|
200
|
+
participants: expectMap(extractEntry(jCpy, 'participants', false, path), false, [...path, ".participants"], (k0, p0) => expectStringEnum(k0, false, p0, ParticipantType, 'ParticipantType'), (v0, p0) => expectString(v0, false, p0)),
|
|
201
|
+
healthcarePartyId: expectString(extractEntry(jCpy, 'healthcarePartyId', false, path), true, [...path, ".healthcarePartyId"]),
|
|
202
|
+
modifiedContactId: expectString(extractEntry(jCpy, 'modifiedContactId', false, path), true, [...path, ".modifiedContactId"]),
|
|
203
|
+
secretForeignKeys: expectArray(extractEntry(jCpy, 'secretForeignKeys', false, path), false, [...path, ".secretForeignKeys"], (x0, p0) => expectString(x0, false, p0)),
|
|
204
|
+
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))),
|
|
205
|
+
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))),
|
|
206
|
+
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))),
|
|
207
|
+
encryptedSelf: expectString(extractEntry(jCpy, 'encryptedSelf', false, path), true, [...path, ".encryptedSelf"]),
|
|
208
|
+
securityMetadata: expectObject(extractEntry(jCpy, 'securityMetadata', false, path), true, ignoreUnknownKeys, [...path, ".securityMetadata"], SecurityMetadata.fromJSON),
|
|
209
|
+
notes: expectArray(extractEntry(jCpy, 'notes', false, path), false, [...path, ".notes"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, Annotation.fromJSON)),
|
|
210
|
+
});
|
|
211
|
+
if (!ignoreUnknownKeys) {
|
|
212
|
+
const unused = Object.keys(jCpy);
|
|
213
|
+
if (unused.length > 0)
|
|
214
|
+
throw new Error(`Unexpected key(s) for json object DecryptedContact at path ${path.join("")}: ${unused}`);
|
|
215
|
+
}
|
|
216
|
+
return res;
|
|
217
|
+
}
|
|
104
218
|
}
|
|
105
219
|
export class EncryptedContact {
|
|
106
220
|
constructor(partial) {
|
|
@@ -203,4 +317,108 @@ export class EncryptedContact {
|
|
|
203
317
|
if ('notes' in partial && partial.notes !== undefined)
|
|
204
318
|
this.notes = partial.notes;
|
|
205
319
|
}
|
|
320
|
+
toJSON() {
|
|
321
|
+
const res = {};
|
|
322
|
+
res['id'] = this.id;
|
|
323
|
+
if (this.rev != undefined)
|
|
324
|
+
res['rev'] = this.rev;
|
|
325
|
+
if (this.created != undefined)
|
|
326
|
+
res['created'] = this.created;
|
|
327
|
+
if (this.modified != undefined)
|
|
328
|
+
res['modified'] = this.modified;
|
|
329
|
+
if (this.author != undefined)
|
|
330
|
+
res['author'] = this.author;
|
|
331
|
+
if (this.responsible != undefined)
|
|
332
|
+
res['responsible'] = this.responsible;
|
|
333
|
+
if (this.medicalLocationId != undefined)
|
|
334
|
+
res['medicalLocationId'] = this.medicalLocationId;
|
|
335
|
+
res['tags'] = this.tags.map((x0) => x0.toJSON());
|
|
336
|
+
res['codes'] = this.codes.map((x0) => x0.toJSON());
|
|
337
|
+
res['identifier'] = this.identifier.map((x0) => x0.toJSON());
|
|
338
|
+
if (this.endOfLife != undefined)
|
|
339
|
+
res['endOfLife'] = this.endOfLife;
|
|
340
|
+
if (this.deletionDate != undefined)
|
|
341
|
+
res['deletionDate'] = this.deletionDate;
|
|
342
|
+
if (this.groupId != undefined)
|
|
343
|
+
res['groupId'] = this.groupId;
|
|
344
|
+
if (this.openingDate != undefined)
|
|
345
|
+
res['openingDate'] = this.openingDate;
|
|
346
|
+
if (this.closingDate != undefined)
|
|
347
|
+
res['closingDate'] = this.closingDate;
|
|
348
|
+
if (this.descr != undefined)
|
|
349
|
+
res['descr'] = this.descr;
|
|
350
|
+
if (this.location != undefined)
|
|
351
|
+
res['location'] = this.location;
|
|
352
|
+
if (this.externalId != undefined)
|
|
353
|
+
res['externalId'] = this.externalId;
|
|
354
|
+
if (this.encounterType != undefined)
|
|
355
|
+
res['encounterType'] = this.encounterType.toJSON();
|
|
356
|
+
if (this.encounterLocation != undefined)
|
|
357
|
+
res['encounterLocation'] = this.encounterLocation.toJSON();
|
|
358
|
+
res['subContacts'] = this.subContacts.map((x0) => x0.toJSON());
|
|
359
|
+
res['services'] = this.services.map((x0) => x0.toJSON());
|
|
360
|
+
res['participants'] = Object.fromEntries(Object.entries(this.participants).map(([k0, v0]) => [k0, v0]));
|
|
361
|
+
if (this.healthcarePartyId != undefined)
|
|
362
|
+
res['healthcarePartyId'] = this.healthcarePartyId;
|
|
363
|
+
if (this.modifiedContactId != undefined)
|
|
364
|
+
res['modifiedContactId'] = this.modifiedContactId;
|
|
365
|
+
res['secretForeignKeys'] = this.secretForeignKeys.map((x0) => x0);
|
|
366
|
+
res['cryptedForeignKeys'] = Object.fromEntries(Object.entries(this.cryptedForeignKeys).map(([k0, v0]) => [k0, v0.map((x1) => x1.toJSON())]));
|
|
367
|
+
res['delegations'] = Object.fromEntries(Object.entries(this.delegations).map(([k0, v0]) => [k0, v0.map((x1) => x1.toJSON())]));
|
|
368
|
+
res['encryptionKeys'] = Object.fromEntries(Object.entries(this.encryptionKeys).map(([k0, v0]) => [k0, v0.map((x1) => x1.toJSON())]));
|
|
369
|
+
if (this.encryptedSelf != undefined)
|
|
370
|
+
res['encryptedSelf'] = this.encryptedSelf;
|
|
371
|
+
if (this.securityMetadata != undefined)
|
|
372
|
+
res['securityMetadata'] = this.securityMetadata.toJSON();
|
|
373
|
+
res['notes'] = this.notes.map((x0) => x0.toJSON());
|
|
374
|
+
res['isEncrypted'] = true;
|
|
375
|
+
return res;
|
|
376
|
+
}
|
|
377
|
+
static fromJSON(json, ignoreUnknownKeys = false, path = ['EncryptedContact']) {
|
|
378
|
+
if (typeof json != 'object')
|
|
379
|
+
throw new Error(`Expected json object at path ${path.join("")}`);
|
|
380
|
+
const jCpy = Object.assign({}, json);
|
|
381
|
+
if (extractEntry(jCpy, "isEncrypted", true, path) !== true)
|
|
382
|
+
throw new Error(`Unexpected value for ${path.join("")} isEncrypted marker, should be true. The provided json doesn't represent a EncryptedContact`);
|
|
383
|
+
const res = new EncryptedContact({
|
|
384
|
+
id: expectString(extractEntry(jCpy, 'id', true, path), false, [...path, ".id"]),
|
|
385
|
+
rev: expectString(extractEntry(jCpy, 'rev', false, path), true, [...path, ".rev"]),
|
|
386
|
+
created: expectNumber(extractEntry(jCpy, 'created', false, path), true, true, [...path, ".created"]),
|
|
387
|
+
modified: expectNumber(extractEntry(jCpy, 'modified', false, path), true, true, [...path, ".modified"]),
|
|
388
|
+
author: expectString(extractEntry(jCpy, 'author', false, path), true, [...path, ".author"]),
|
|
389
|
+
responsible: expectString(extractEntry(jCpy, 'responsible', false, path), true, [...path, ".responsible"]),
|
|
390
|
+
medicalLocationId: expectString(extractEntry(jCpy, 'medicalLocationId', false, path), true, [...path, ".medicalLocationId"]),
|
|
391
|
+
tags: expectArray(extractEntry(jCpy, 'tags', false, path), false, [...path, ".tags"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, CodeStub.fromJSON)),
|
|
392
|
+
codes: expectArray(extractEntry(jCpy, 'codes', false, path), false, [...path, ".codes"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, CodeStub.fromJSON)),
|
|
393
|
+
identifier: expectArray(extractEntry(jCpy, 'identifier', false, path), false, [...path, ".identifier"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, Identifier.fromJSON)),
|
|
394
|
+
endOfLife: expectNumber(extractEntry(jCpy, 'endOfLife', false, path), true, true, [...path, ".endOfLife"]),
|
|
395
|
+
deletionDate: expectNumber(extractEntry(jCpy, 'deletionDate', false, path), true, true, [...path, ".deletionDate"]),
|
|
396
|
+
groupId: expectString(extractEntry(jCpy, 'groupId', false, path), true, [...path, ".groupId"]),
|
|
397
|
+
openingDate: expectNumber(extractEntry(jCpy, 'openingDate', false, path), true, true, [...path, ".openingDate"]),
|
|
398
|
+
closingDate: expectNumber(extractEntry(jCpy, 'closingDate', false, path), true, true, [...path, ".closingDate"]),
|
|
399
|
+
descr: expectString(extractEntry(jCpy, 'descr', false, path), true, [...path, ".descr"]),
|
|
400
|
+
location: expectString(extractEntry(jCpy, 'location', false, path), true, [...path, ".location"]),
|
|
401
|
+
externalId: expectString(extractEntry(jCpy, 'externalId', false, path), true, [...path, ".externalId"]),
|
|
402
|
+
encounterType: expectObject(extractEntry(jCpy, 'encounterType', false, path), true, ignoreUnknownKeys, [...path, ".encounterType"], CodeStub.fromJSON),
|
|
403
|
+
encounterLocation: expectObject(extractEntry(jCpy, 'encounterLocation', false, path), true, ignoreUnknownKeys, [...path, ".encounterLocation"], EncryptedAddress.fromJSON),
|
|
404
|
+
subContacts: expectArray(extractEntry(jCpy, 'subContacts', false, path), false, [...path, ".subContacts"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, EncryptedSubContact.fromJSON)),
|
|
405
|
+
services: expectArray(extractEntry(jCpy, 'services', false, path), false, [...path, ".services"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, EncryptedService.fromJSON)),
|
|
406
|
+
participants: expectMap(extractEntry(jCpy, 'participants', false, path), false, [...path, ".participants"], (k0, p0) => expectStringEnum(k0, false, p0, ParticipantType, 'ParticipantType'), (v0, p0) => expectString(v0, false, p0)),
|
|
407
|
+
healthcarePartyId: expectString(extractEntry(jCpy, 'healthcarePartyId', false, path), true, [...path, ".healthcarePartyId"]),
|
|
408
|
+
modifiedContactId: expectString(extractEntry(jCpy, 'modifiedContactId', false, path), true, [...path, ".modifiedContactId"]),
|
|
409
|
+
secretForeignKeys: expectArray(extractEntry(jCpy, 'secretForeignKeys', false, path), false, [...path, ".secretForeignKeys"], (x0, p0) => expectString(x0, false, p0)),
|
|
410
|
+
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))),
|
|
411
|
+
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))),
|
|
412
|
+
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))),
|
|
413
|
+
encryptedSelf: expectString(extractEntry(jCpy, 'encryptedSelf', false, path), true, [...path, ".encryptedSelf"]),
|
|
414
|
+
securityMetadata: expectObject(extractEntry(jCpy, 'securityMetadata', false, path), true, ignoreUnknownKeys, [...path, ".securityMetadata"], SecurityMetadata.fromJSON),
|
|
415
|
+
notes: expectArray(extractEntry(jCpy, 'notes', false, path), false, [...path, ".notes"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, Annotation.fromJSON)),
|
|
416
|
+
});
|
|
417
|
+
if (!ignoreUnknownKeys) {
|
|
418
|
+
const unused = Object.keys(jCpy);
|
|
419
|
+
if (unused.length > 0)
|
|
420
|
+
throw new Error(`Unexpected key(s) for json object EncryptedContact at path ${path.join("")}: ${unused}`);
|
|
421
|
+
}
|
|
422
|
+
return res;
|
|
423
|
+
}
|
|
206
424
|
}
|
|
@@ -30,4 +30,6 @@ export declare class CryptoActorStub implements Versionable<string>, CryptoActor
|
|
|
30
30
|
cryptoActorProperties: Array<DecryptedPropertyStub> | undefined;
|
|
31
31
|
readonly $ktClass: 'com.icure.cardinal.sdk.model.CryptoActorStub';
|
|
32
32
|
constructor(partial: Partial<CryptoActorStub> & Pick<CryptoActorStub, "rev" | "publicKeysForOaepWithSha256">);
|
|
33
|
+
toJSON(): object;
|
|
34
|
+
static fromJSON(json: any, ignoreUnknownKeys?: boolean, path?: Array<string>): CryptoActorStub;
|
|
33
35
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// auto-generated file
|
|
2
|
+
import { expectArray, expectMap, expectObject, expectString, extractEntry } from '../internal/JsonDecodeUtils.mjs';
|
|
2
3
|
import { randomUuid } from '../utils/Id.mjs';
|
|
4
|
+
import { DecryptedPropertyStub } from './PropertyStub.mjs';
|
|
3
5
|
export class CryptoActorStub {
|
|
4
6
|
constructor(partial) {
|
|
5
7
|
var _a;
|
|
@@ -29,4 +31,47 @@ export class CryptoActorStub {
|
|
|
29
31
|
if ('cryptoActorProperties' in partial)
|
|
30
32
|
this.cryptoActorProperties = partial.cryptoActorProperties;
|
|
31
33
|
}
|
|
34
|
+
toJSON() {
|
|
35
|
+
const res = {};
|
|
36
|
+
res['id'] = this.id;
|
|
37
|
+
res['rev'] = this.rev;
|
|
38
|
+
res['hcPartyKeys'] = Object.fromEntries(Object.entries(this.hcPartyKeys).map(([k0, v0]) => [k0, v0.map((x1) => x1)]));
|
|
39
|
+
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]))]))]));
|
|
40
|
+
res['transferKeys'] = Object.fromEntries(Object.entries(this.transferKeys).map(([k0, v0]) => [k0, Object.fromEntries(Object.entries(v0).map(([k1, v1]) => [k1, v1]))]));
|
|
41
|
+
res['privateKeyShamirPartitions'] = Object.fromEntries(Object.entries(this.privateKeyShamirPartitions).map(([k0, v0]) => [k0, v0]));
|
|
42
|
+
if (this.publicKey != undefined)
|
|
43
|
+
res['publicKey'] = this.publicKey;
|
|
44
|
+
res['publicKeysForOaepWithSha256'] = this.publicKeysForOaepWithSha256.map((x0) => x0);
|
|
45
|
+
if (this.parentId != undefined)
|
|
46
|
+
res['parentId'] = this.parentId;
|
|
47
|
+
if (this.cryptoActorProperties != undefined)
|
|
48
|
+
res['cryptoActorProperties'] = this.cryptoActorProperties.map((x0) => x0.toJSON());
|
|
49
|
+
res['$ktClass'] = 'com.icure.cardinal.sdk.model.CryptoActorStub';
|
|
50
|
+
return res;
|
|
51
|
+
}
|
|
52
|
+
static fromJSON(json, ignoreUnknownKeys = false, path = ['CryptoActorStub']) {
|
|
53
|
+
if (typeof json != 'object')
|
|
54
|
+
throw new Error(`Expected json object at path ${path.join("")}`);
|
|
55
|
+
const jCpy = Object.assign({}, json);
|
|
56
|
+
if (extractEntry(jCpy, '\$ktClass', true, path) !== 'com.icure.cardinal.sdk.model.CryptoActorStub')
|
|
57
|
+
throw new Error(`Unexpected value for ${path.join("")} class marker, should be "com.icure.cardinal.sdk.model.CryptoActorStub". The provided json doesn't represent a CryptoActorStub`);
|
|
58
|
+
const res = new CryptoActorStub({
|
|
59
|
+
id: expectString(extractEntry(jCpy, 'id', true, path), false, [...path, ".id"]),
|
|
60
|
+
rev: expectString(extractEntry(jCpy, 'rev', true, path), false, [...path, ".rev"]),
|
|
61
|
+
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))),
|
|
62
|
+
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)))),
|
|
63
|
+
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))),
|
|
64
|
+
privateKeyShamirPartitions: expectMap(extractEntry(jCpy, 'privateKeyShamirPartitions', false, path), false, [...path, ".privateKeyShamirPartitions"], (k0, p0) => expectString(k0, false, p0), (v0, p0) => expectString(v0, false, p0)),
|
|
65
|
+
publicKey: expectString(extractEntry(jCpy, 'publicKey', false, path), true, [...path, ".publicKey"]),
|
|
66
|
+
publicKeysForOaepWithSha256: expectArray(extractEntry(jCpy, 'publicKeysForOaepWithSha256', true, path), false, [...path, ".publicKeysForOaepWithSha256"], (x0, p0) => expectString(x0, false, p0)),
|
|
67
|
+
parentId: expectString(extractEntry(jCpy, 'parentId', false, path), true, [...path, ".parentId"]),
|
|
68
|
+
cryptoActorProperties: expectArray(extractEntry(jCpy, 'cryptoActorProperties', false, path), true, [...path, ".cryptoActorProperties"], (x0, p0) => expectObject(x0, false, ignoreUnknownKeys, p0, DecryptedPropertyStub.fromJSON)),
|
|
69
|
+
});
|
|
70
|
+
if (!ignoreUnknownKeys) {
|
|
71
|
+
const unused = Object.keys(jCpy);
|
|
72
|
+
if (unused.length > 0)
|
|
73
|
+
throw new Error(`Unexpected key(s) for json object CryptoActorStub at path ${path.join("")}: ${unused}`);
|
|
74
|
+
}
|
|
75
|
+
return res;
|
|
76
|
+
}
|
|
32
77
|
}
|
|
@@ -4,4 +4,6 @@ export declare class CryptoActorStubWithType {
|
|
|
4
4
|
type: DataOwnerType;
|
|
5
5
|
stub: CryptoActorStub;
|
|
6
6
|
constructor(partial: Partial<CryptoActorStubWithType> & Pick<CryptoActorStubWithType, "type" | "stub">);
|
|
7
|
+
toJSON(): object;
|
|
8
|
+
static fromJSON(json: any, ignoreUnknownKeys?: boolean, path?: Array<string>): CryptoActorStubWithType;
|
|
7
9
|
}
|
|
@@ -1,6 +1,31 @@
|
|
|
1
|
+
// auto-generated file
|
|
2
|
+
import { expectObject, expectStringEnum, extractEntry } from '../internal/JsonDecodeUtils.mjs';
|
|
3
|
+
import { CryptoActorStub } from './CryptoActorStub.mjs';
|
|
4
|
+
import { DataOwnerType } from './DataOwnerType.mjs';
|
|
1
5
|
export class CryptoActorStubWithType {
|
|
2
6
|
constructor(partial) {
|
|
3
7
|
this.type = partial.type;
|
|
4
8
|
this.stub = partial.stub;
|
|
5
9
|
}
|
|
10
|
+
toJSON() {
|
|
11
|
+
const res = {};
|
|
12
|
+
res['type'] = this.type;
|
|
13
|
+
res['stub'] = this.stub.toJSON();
|
|
14
|
+
return res;
|
|
15
|
+
}
|
|
16
|
+
static fromJSON(json, ignoreUnknownKeys = false, path = ['CryptoActorStubWithType']) {
|
|
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 CryptoActorStubWithType({
|
|
21
|
+
type: expectStringEnum(extractEntry(jCpy, 'type', true, path), false, [...path, ".type"], DataOwnerType, 'DataOwnerType'),
|
|
22
|
+
stub: expectObject(extractEntry(jCpy, 'stub', true, path), false, ignoreUnknownKeys, [...path, ".stub"], CryptoActorStub.fromJSON),
|
|
23
|
+
});
|
|
24
|
+
if (!ignoreUnknownKeys) {
|
|
25
|
+
const unused = Object.keys(jCpy);
|
|
26
|
+
if (unused.length > 0)
|
|
27
|
+
throw new Error(`Unexpected key(s) for json object CryptoActorStubWithType at path ${path.join("")}: ${unused}`);
|
|
28
|
+
}
|
|
29
|
+
return res;
|
|
30
|
+
}
|
|
6
31
|
}
|
|
@@ -3,4 +3,6 @@ export declare class DataOwnerRegistrationSuccess {
|
|
|
3
3
|
userId: string;
|
|
4
4
|
token: string;
|
|
5
5
|
constructor(partial: Partial<DataOwnerRegistrationSuccess> & Pick<DataOwnerRegistrationSuccess, "userLogin" | "userId" | "token">);
|
|
6
|
+
toJSON(): object;
|
|
7
|
+
static fromJSON(json: any, ignoreUnknownKeys?: boolean, path?: Array<string>): DataOwnerRegistrationSuccess;
|
|
6
8
|
}
|