@nmshd/runtime 2.0.0-beta.2 → 2.0.0-beta.22
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/dist/Runtime.d.ts +6 -5
- package/dist/Runtime.js +20 -8
- package/dist/Runtime.js.map +1 -1
- package/dist/buildInformation.js +5 -5
- package/dist/dataViews/DataViewExpander.d.ts +12 -6
- package/dist/dataViews/DataViewExpander.js +219 -74
- package/dist/dataViews/DataViewExpander.js.map +1 -1
- package/dist/dataViews/consumption/DecidableRequestItemDVOs.d.ts +5 -7
- package/dist/dataViews/consumption/LocalAttributeDVO.d.ts +4 -3
- package/dist/dataViews/consumption/LocalRequestDVO.d.ts +2 -3
- package/dist/dataViews/consumption/PeerRelationshipTemplateDVO.d.ts +4 -2
- package/dist/dataViews/consumption/RelationshipSettingDVO.d.ts +5 -0
- package/dist/{types/consumption/RelationshipAttributeDTO.js → dataViews/consumption/RelationshipSettingDVO.js} +1 -1
- package/dist/dataViews/consumption/RelationshipSettingDVO.js.map +1 -0
- package/dist/dataViews/consumption/index.d.ts +1 -0
- package/dist/dataViews/consumption/index.js +1 -0
- package/dist/dataViews/consumption/index.js.map +1 -1
- package/dist/dataViews/content/AttributeDVOs.d.ts +1 -0
- package/dist/dataViews/content/RequestItemDVOs.d.ts +4 -7
- package/dist/dataViews/content/ResponseDVO.d.ts +8 -0
- package/dist/{types/consumption/SharedItemDTO.js → dataViews/content/ResponseDVO.js} +1 -1
- package/dist/dataViews/content/ResponseDVO.js.map +1 -0
- package/dist/dataViews/content/ResponseItemDVOs.d.ts +41 -0
- package/dist/{types/consumption/RelationshipInfoDTO.js → dataViews/content/ResponseItemDVOs.js} +1 -1
- package/dist/dataViews/content/ResponseItemDVOs.js.map +1 -0
- package/dist/dataViews/content/index.d.ts +2 -0
- package/dist/dataViews/content/index.js +2 -0
- package/dist/dataViews/content/index.js.map +1 -1
- package/dist/dataViews/transport/RelationshipDVO.d.ts +6 -1
- package/dist/dataViews/transport/RelationshipDVO.js.map +1 -1
- package/dist/dataViews/transport/RelationshipTemplateDVO.d.ts +2 -0
- package/dist/events/EventProxy.d.ts +12 -0
- package/dist/events/EventProxy.js +112 -0
- package/dist/events/EventProxy.js.map +1 -0
- package/dist/events/consumption/MessageProcessedEvent.d.ts +15 -0
- package/dist/events/consumption/MessageProcessedEvent.js +18 -0
- package/dist/events/consumption/MessageProcessedEvent.js.map +1 -0
- package/dist/events/consumption/RelationshipTemplateProcessedEvent.d.ts +17 -0
- package/dist/events/consumption/RelationshipTemplateProcessedEvent.js +22 -0
- package/dist/events/consumption/RelationshipTemplateProcessedEvent.js.map +1 -0
- package/dist/events/consumption/index.d.ts +14 -0
- package/dist/events/consumption/index.js +31 -0
- package/dist/events/consumption/index.js.map +1 -0
- package/dist/events/index.d.ts +3 -23
- package/dist/events/index.js +3 -23
- package/dist/events/index.js.map +1 -1
- package/dist/events/runtime/index.d.ts +5 -0
- package/dist/events/runtime/index.js +22 -0
- package/dist/events/runtime/index.js.map +1 -0
- package/dist/events/transport/MessageDeliveredEvent.d.ts +6 -0
- package/dist/events/transport/MessageDeliveredEvent.js +13 -0
- package/dist/events/transport/MessageDeliveredEvent.js.map +1 -0
- package/dist/events/transport/index.d.ts +5 -0
- package/dist/events/transport/index.js +22 -0
- package/dist/events/transport/index.js.map +1 -0
- package/dist/extensibility/facades/consumption/OutgoingRequestsFacade.d.ts +2 -2
- package/dist/extensibility/facades/consumption/OutgoingRequestsFacade.js.map +1 -1
- package/dist/extensibility/facades/transport/AccountFacade.d.ts +4 -2
- package/dist/extensibility/facades/transport/AccountFacade.js +8 -2
- package/dist/extensibility/facades/transport/AccountFacade.js.map +1 -1
- package/dist/extensibility/facades/transport/FilesFacade.d.ts +4 -4
- package/dist/extensibility/facades/transport/FilesFacade.js +5 -5
- package/dist/extensibility/facades/transport/FilesFacade.js.map +1 -1
- package/dist/modules/DeciderModule.d.ts +5 -3
- package/dist/modules/DeciderModule.js +29 -3
- package/dist/modules/DeciderModule.js.map +1 -1
- package/dist/modules/MessageModule.js +1 -1
- package/dist/modules/MessageModule.js.map +1 -1
- package/dist/modules/RequestModule.d.ts +3 -3
- package/dist/modules/RequestModule.js +65 -27
- package/dist/modules/RequestModule.js.map +1 -1
- package/dist/types/consumption/SettingDTO.d.ts +0 -1
- package/dist/types/consumption/index.d.ts +0 -4
- package/dist/types/consumption/index.js +0 -4
- package/dist/types/consumption/index.js.map +1 -1
- package/dist/useCases/anonymous/tokens/LoadPeerTokenAnonymousByIdAndKey.d.ts +5 -5
- package/dist/useCases/anonymous/tokens/LoadPeerTokenAnonymousByIdAndKey.js +9 -7
- package/dist/useCases/anonymous/tokens/LoadPeerTokenAnonymousByIdAndKey.js.map +1 -1
- package/dist/useCases/anonymous/tokens/LoadPeerTokenAnonymousByTruncatedReference.d.ts +5 -5
- package/dist/useCases/anonymous/tokens/LoadPeerTokenAnonymousByTruncatedReference.js +9 -6
- package/dist/useCases/anonymous/tokens/LoadPeerTokenAnonymousByTruncatedReference.js.map +1 -1
- package/dist/useCases/common/RuntimeErrors.d.ts +1 -1
- package/dist/useCases/common/RuntimeErrors.js +2 -2
- package/dist/useCases/common/RuntimeErrors.js.map +1 -1
- package/dist/useCases/common/SchemaRepository.js +1 -1
- package/dist/useCases/common/SchemaRepository.js.map +1 -1
- package/dist/useCases/common/Schemas.d.ts +10 -5
- package/dist/useCases/common/Schemas.js +2604 -323
- package/dist/useCases/common/Schemas.js.map +1 -1
- package/dist/useCases/common/UseCase.js +1 -4
- package/dist/useCases/common/UseCase.js.map +1 -1
- package/dist/useCases/common/index.d.ts +3 -4
- package/dist/useCases/common/index.js +3 -4
- package/dist/useCases/common/index.js.map +1 -1
- package/dist/useCases/common/validation/IValidator.d.ts +1 -1
- package/dist/useCases/common/validation/SchemaValidator.d.ts +2 -2
- package/dist/useCases/common/validation/SchemaValidator.js +5 -3
- package/dist/useCases/common/validation/SchemaValidator.js.map +1 -1
- package/dist/useCases/common/validation/ValidatableStrings.d.ts +69 -0
- package/dist/{types/consumption/RelationshipThemeDTO.js → useCases/common/validation/ValidatableStrings.js} +1 -1
- package/dist/useCases/common/validation/ValidatableStrings.js.map +1 -0
- package/dist/useCases/common/validation/ValidationFailure.d.ts +6 -0
- package/dist/useCases/common/validation/ValidationFailure.js +11 -0
- package/dist/useCases/common/validation/ValidationFailure.js.map +1 -0
- package/dist/useCases/common/validation/ValidationResult.d.ts +11 -0
- package/dist/useCases/common/validation/ValidationResult.js +31 -0
- package/dist/useCases/common/validation/ValidationResult.js.map +1 -0
- package/dist/useCases/consumption/attributes/CreateAttribute.d.ts +3 -5
- package/dist/useCases/consumption/attributes/CreateAttribute.js +2 -11
- package/dist/useCases/consumption/attributes/CreateAttribute.js.map +1 -1
- package/dist/useCases/consumption/attributes/CreateSharedAttributeCopy.d.ts +7 -18
- package/dist/useCases/consumption/attributes/CreateSharedAttributeCopy.js +2 -11
- package/dist/useCases/consumption/attributes/CreateSharedAttributeCopy.js.map +1 -1
- package/dist/useCases/consumption/attributes/DeleteAttribute.d.ts +5 -10
- package/dist/useCases/consumption/attributes/DeleteAttribute.js +1 -10
- package/dist/useCases/consumption/attributes/DeleteAttribute.js.map +1 -1
- package/dist/useCases/consumption/attributes/GetAttribute.d.ts +2 -5
- package/dist/useCases/consumption/attributes/GetAttribute.js.map +1 -1
- package/dist/useCases/consumption/attributes/SucceedAttribute.d.ts +5 -10
- package/dist/useCases/consumption/attributes/SucceedAttribute.js +2 -11
- package/dist/useCases/consumption/attributes/SucceedAttribute.js.map +1 -1
- package/dist/useCases/consumption/attributes/UpdateAttribute.d.ts +5 -10
- package/dist/useCases/consumption/attributes/UpdateAttribute.js +2 -11
- package/dist/useCases/consumption/attributes/UpdateAttribute.js.map +1 -1
- package/dist/useCases/consumption/drafts/CreateDraft.d.ts +4 -4
- package/dist/useCases/consumption/drafts/CreateDraft.js +9 -7
- package/dist/useCases/consumption/drafts/CreateDraft.js.map +1 -1
- package/dist/useCases/consumption/drafts/DeleteDraft.d.ts +5 -5
- package/dist/useCases/consumption/drafts/DeleteDraft.js +9 -8
- package/dist/useCases/consumption/drafts/DeleteDraft.js.map +1 -1
- package/dist/useCases/consumption/drafts/GetDraft.d.ts +5 -5
- package/dist/useCases/consumption/drafts/GetDraft.js +9 -5
- package/dist/useCases/consumption/drafts/GetDraft.js.map +1 -1
- package/dist/useCases/consumption/drafts/GetDrafts.d.ts +6 -2
- package/dist/useCases/consumption/drafts/GetDrafts.js +10 -1
- package/dist/useCases/consumption/drafts/GetDrafts.js.map +1 -1
- package/dist/useCases/consumption/drafts/UpdateDraft.d.ts +5 -5
- package/dist/useCases/consumption/drafts/UpdateDraft.js +9 -7
- package/dist/useCases/consumption/drafts/UpdateDraft.js.map +1 -1
- package/dist/useCases/consumption/requests/AcceptIncomingRequest.d.ts +2 -3
- package/dist/useCases/consumption/requests/AcceptIncomingRequest.js +3 -13
- package/dist/useCases/consumption/requests/AcceptIncomingRequest.js.map +1 -1
- package/dist/useCases/consumption/requests/CanCreateOutgoingRequest.d.ts +13 -5
- package/dist/useCases/consumption/requests/CanCreateOutgoingRequest.js +14 -4
- package/dist/useCases/consumption/requests/CanCreateOutgoingRequest.js.map +1 -1
- package/dist/useCases/consumption/requests/CheckPrerequisitesOfIncomingRequest.d.ts +4 -8
- package/dist/useCases/consumption/requests/CheckPrerequisitesOfIncomingRequest.js +3 -14
- package/dist/useCases/consumption/requests/CheckPrerequisitesOfIncomingRequest.js.map +1 -1
- package/dist/useCases/consumption/requests/CompleteIncomingRequest.d.ts +6 -12
- package/dist/useCases/consumption/requests/CompleteIncomingRequest.js +16 -30
- package/dist/useCases/consumption/requests/CompleteIncomingRequest.js.map +1 -1
- package/dist/useCases/consumption/requests/CompleteOutgoingRequest.d.ts +4 -8
- package/dist/useCases/consumption/requests/CompleteOutgoingRequest.js +3 -13
- package/dist/useCases/consumption/requests/CompleteOutgoingRequest.js.map +1 -1
- package/dist/useCases/consumption/requests/CreateAndCompleteOutgoingRequestFromRelationshipCreationChange.d.ts +5 -12
- package/dist/useCases/consumption/requests/CreateAndCompleteOutgoingRequestFromRelationshipCreationChange.js +3 -9
- package/dist/useCases/consumption/requests/CreateAndCompleteOutgoingRequestFromRelationshipCreationChange.js.map +1 -1
- package/dist/useCases/consumption/requests/CreateOutgoingRequest.d.ts +4 -8
- package/dist/useCases/consumption/requests/CreateOutgoingRequest.js +3 -8
- package/dist/useCases/consumption/requests/CreateOutgoingRequest.js.map +1 -1
- package/dist/useCases/consumption/requests/GetIncomingRequest.d.ts +2 -5
- package/dist/useCases/consumption/requests/GetIncomingRequest.js.map +1 -1
- package/dist/useCases/consumption/requests/GetOutgoingRequest.d.ts +2 -5
- package/dist/useCases/consumption/requests/GetOutgoingRequest.js.map +1 -1
- package/dist/useCases/consumption/requests/ReceivedIncomingRequest.d.ts +4 -9
- package/dist/useCases/consumption/requests/ReceivedIncomingRequest.js +3 -9
- package/dist/useCases/consumption/requests/ReceivedIncomingRequest.js.map +1 -1
- package/dist/useCases/consumption/requests/RejectIncomingRequest.d.ts +2 -3
- package/dist/useCases/consumption/requests/RejectIncomingRequest.js +3 -13
- package/dist/useCases/consumption/requests/RejectIncomingRequest.js.map +1 -1
- package/dist/useCases/consumption/requests/RequestMapper.js.map +1 -1
- package/dist/useCases/consumption/requests/RequireManualDecisionOfIncomingRequest.d.ts +4 -8
- package/dist/useCases/consumption/requests/RequireManualDecisionOfIncomingRequest.js +3 -12
- package/dist/useCases/consumption/requests/RequireManualDecisionOfIncomingRequest.js.map +1 -1
- package/dist/useCases/consumption/requests/SentOutgoingRequest.d.ts +5 -12
- package/dist/useCases/consumption/requests/SentOutgoingRequest.js +3 -14
- package/dist/useCases/consumption/requests/SentOutgoingRequest.js.map +1 -1
- package/dist/useCases/consumption/settings/CreateSetting.d.ts +8 -8
- package/dist/useCases/consumption/settings/CreateSetting.js +9 -13
- package/dist/useCases/consumption/settings/CreateSetting.js.map +1 -1
- package/dist/useCases/consumption/settings/DeleteSetting.d.ts +5 -5
- package/dist/useCases/consumption/settings/DeleteSetting.js +9 -6
- package/dist/useCases/consumption/settings/DeleteSetting.js.map +1 -1
- package/dist/useCases/consumption/settings/GetSetting.d.ts +5 -5
- package/dist/useCases/consumption/settings/GetSetting.js +9 -6
- package/dist/useCases/consumption/settings/GetSetting.js.map +1 -1
- package/dist/useCases/consumption/settings/GetSettings.d.ts +6 -2
- package/dist/useCases/consumption/settings/GetSettings.js +10 -1
- package/dist/useCases/consumption/settings/GetSettings.js.map +1 -1
- package/dist/useCases/consumption/settings/SettingMapper.js +0 -1
- package/dist/useCases/consumption/settings/SettingMapper.js.map +1 -1
- package/dist/useCases/consumption/settings/UpdateSetting.d.ts +5 -5
- package/dist/useCases/consumption/settings/UpdateSetting.js +9 -7
- package/dist/useCases/consumption/settings/UpdateSetting.js.map +1 -1
- package/dist/useCases/transport/account/LoadItemFromTruncatedReference.d.ts +34 -0
- package/dist/useCases/transport/account/LoadItemFromTruncatedReference.js +112 -0
- package/dist/useCases/transport/account/LoadItemFromTruncatedReference.js.map +1 -0
- package/dist/useCases/transport/account/RegisterPushNotificationToken.d.ts +3 -3
- package/dist/useCases/transport/account/RegisterPushNotificationToken.js +8 -13
- package/dist/useCases/transport/account/RegisterPushNotificationToken.js.map +1 -1
- package/dist/useCases/transport/account/SyncEverything.d.ts +3 -7
- package/dist/useCases/transport/account/SyncEverything.js +2 -33
- package/dist/useCases/transport/account/SyncEverything.js.map +1 -1
- package/dist/useCases/transport/account/index.d.ts +1 -0
- package/dist/useCases/transport/account/index.js +1 -0
- package/dist/useCases/transport/account/index.js.map +1 -1
- package/dist/useCases/transport/challenges/CreateChallenge.d.ts +2 -6
- package/dist/useCases/transport/challenges/CreateChallenge.js +3 -4
- package/dist/useCases/transport/challenges/CreateChallenge.js.map +1 -1
- package/dist/useCases/transport/challenges/ValidateChallenge.d.ts +2 -3
- package/dist/useCases/transport/challenges/ValidateChallenge.js +5 -5
- package/dist/useCases/transport/challenges/ValidateChallenge.js.map +1 -1
- package/dist/useCases/transport/devices/CreateDevice.d.ts +4 -4
- package/dist/useCases/transport/devices/CreateDevice.js +9 -8
- package/dist/useCases/transport/devices/CreateDevice.js.map +1 -1
- package/dist/useCases/transport/devices/CreateDeviceOnboardingToken.d.ts +6 -6
- package/dist/useCases/transport/devices/CreateDeviceOnboardingToken.js +9 -14
- package/dist/useCases/transport/devices/CreateDeviceOnboardingToken.js.map +1 -1
- package/dist/useCases/transport/devices/DeleteDevice.d.ts +5 -5
- package/dist/useCases/transport/devices/DeleteDevice.js +9 -8
- package/dist/useCases/transport/devices/DeleteDevice.js.map +1 -1
- package/dist/useCases/transport/devices/GetDevice.d.ts +5 -5
- package/dist/useCases/transport/devices/GetDevice.js +9 -6
- package/dist/useCases/transport/devices/GetDevice.js.map +1 -1
- package/dist/useCases/transport/devices/GetDeviceOnboardingInfo.d.ts +7 -3
- package/dist/useCases/transport/devices/GetDeviceOnboardingInfo.js +10 -1
- package/dist/useCases/transport/devices/GetDeviceOnboardingInfo.js.map +1 -1
- package/dist/useCases/transport/devices/UpdateDevice.d.ts +5 -5
- package/dist/useCases/transport/devices/UpdateDevice.js +9 -8
- package/dist/useCases/transport/devices/UpdateDevice.js.map +1 -1
- package/dist/useCases/transport/files/CreateQrCodeForFile.d.ts +2 -5
- package/dist/useCases/transport/files/CreateQrCodeForFile.js.map +1 -1
- package/dist/useCases/transport/files/CreateTokenForFile.d.ts +3 -9
- package/dist/useCases/transport/files/CreateTokenForFile.js.map +1 -1
- package/dist/useCases/transport/files/CreateTokenQrCodeForFile.d.ts +3 -9
- package/dist/useCases/transport/files/CreateTokenQrCodeForFile.js.map +1 -1
- package/dist/useCases/transport/files/DownloadFile.d.ts +2 -5
- package/dist/useCases/transport/files/DownloadFile.js.map +1 -1
- package/dist/useCases/transport/files/GetFile.d.ts +2 -5
- package/dist/useCases/transport/files/GetFile.js.map +1 -1
- package/dist/useCases/transport/files/GetFiles.d.ts +6 -2
- package/dist/useCases/transport/files/GetFiles.js +10 -1
- package/dist/useCases/transport/files/GetFiles.js.map +1 -1
- package/dist/useCases/transport/files/{LoadPeerFile.d.ts → GetOrLoadFile.d.ts} +10 -17
- package/dist/useCases/transport/files/{LoadPeerFile.js → GetOrLoadFile.js} +21 -22
- package/dist/useCases/transport/files/GetOrLoadFile.js.map +1 -0
- package/dist/useCases/transport/files/UploadOwnFile.d.ts +9 -5
- package/dist/useCases/transport/files/UploadOwnFile.js +25 -23
- package/dist/useCases/transport/files/UploadOwnFile.js.map +1 -1
- package/dist/useCases/transport/files/index.d.ts +1 -1
- package/dist/useCases/transport/files/index.js +1 -1
- package/dist/useCases/transport/files/index.js.map +1 -1
- package/dist/useCases/transport/identity/CheckIdentity.d.ts +5 -5
- package/dist/useCases/transport/identity/CheckIdentity.js +9 -6
- package/dist/useCases/transport/identity/CheckIdentity.js.map +1 -1
- package/dist/useCases/transport/messages/DownloadAttachment.d.ts +6 -6
- package/dist/useCases/transport/messages/DownloadAttachment.js +9 -9
- package/dist/useCases/transport/messages/DownloadAttachment.js.map +1 -1
- package/dist/useCases/transport/messages/GetAttachmentMetadata.d.ts +6 -6
- package/dist/useCases/transport/messages/GetAttachmentMetadata.js +9 -9
- package/dist/useCases/transport/messages/GetAttachmentMetadata.js.map +1 -1
- package/dist/useCases/transport/messages/GetMessage.d.ts +5 -5
- package/dist/useCases/transport/messages/GetMessage.js +9 -8
- package/dist/useCases/transport/messages/GetMessage.js.map +1 -1
- package/dist/useCases/transport/messages/GetMessages.d.ts +4 -4
- package/dist/useCases/transport/messages/GetMessages.js +9 -5
- package/dist/useCases/transport/messages/GetMessages.js.map +1 -1
- package/dist/useCases/transport/messages/SendMessage.d.ts +11 -10
- package/dist/useCases/transport/messages/SendMessage.js +10 -19
- package/dist/useCases/transport/messages/SendMessage.js.map +1 -1
- package/dist/useCases/transport/relationshipTemplates/CreateOwnRelationshipTemplate.d.ts +10 -5
- package/dist/useCases/transport/relationshipTemplates/CreateOwnRelationshipTemplate.js +19 -16
- package/dist/useCases/transport/relationshipTemplates/CreateOwnRelationshipTemplate.js.map +1 -1
- package/dist/useCases/transport/relationshipTemplates/CreateQrCodeForOwnRelationshipTemplate.d.ts +5 -5
- package/dist/useCases/transport/relationshipTemplates/CreateQrCodeForOwnRelationshipTemplate.js +9 -6
- package/dist/useCases/transport/relationshipTemplates/CreateQrCodeForOwnRelationshipTemplate.js.map +1 -1
- package/dist/useCases/transport/relationshipTemplates/CreateTokenForOwnRelationshipTemplate.d.ts +6 -6
- package/dist/useCases/transport/relationshipTemplates/CreateTokenForOwnRelationshipTemplate.js +9 -7
- package/dist/useCases/transport/relationshipTemplates/CreateTokenForOwnRelationshipTemplate.js.map +1 -1
- package/dist/useCases/transport/relationshipTemplates/CreateTokenQrCodeForOwnRelationshipTemplate.d.ts +6 -6
- package/dist/useCases/transport/relationshipTemplates/CreateTokenQrCodeForOwnRelationshipTemplate.js +9 -7
- package/dist/useCases/transport/relationshipTemplates/CreateTokenQrCodeForOwnRelationshipTemplate.js.map +1 -1
- package/dist/useCases/transport/relationshipTemplates/GetRelationshipTemplate.d.ts +5 -5
- package/dist/useCases/transport/relationshipTemplates/GetRelationshipTemplate.js +9 -6
- package/dist/useCases/transport/relationshipTemplates/GetRelationshipTemplate.js.map +1 -1
- package/dist/useCases/transport/relationshipTemplates/GetRelationshipTemplates.d.ts +6 -2
- package/dist/useCases/transport/relationshipTemplates/GetRelationshipTemplates.js +10 -1
- package/dist/useCases/transport/relationshipTemplates/GetRelationshipTemplates.js.map +1 -1
- package/dist/useCases/transport/relationshipTemplates/LoadPeerRelationshipTemplate.d.ts +5 -13
- package/dist/useCases/transport/relationshipTemplates/LoadPeerRelationshipTemplate.js +4 -13
- package/dist/useCases/transport/relationshipTemplates/LoadPeerRelationshipTemplate.js.map +1 -1
- package/dist/useCases/transport/relationships/AcceptRelationshipChange.d.ts +8 -10
- package/dist/useCases/transport/relationships/AcceptRelationshipChange.js +11 -19
- package/dist/useCases/transport/relationships/AcceptRelationshipChange.js.map +1 -1
- package/dist/useCases/transport/relationships/CreateRelationship.d.ts +7 -9
- package/dist/useCases/transport/relationships/CreateRelationship.js +11 -18
- package/dist/useCases/transport/relationships/CreateRelationship.js.map +1 -1
- package/dist/useCases/transport/relationships/CreateRelationshipChange.d.ts +5 -5
- package/dist/useCases/transport/relationships/CreateRelationshipChange.js +9 -7
- package/dist/useCases/transport/relationships/CreateRelationshipChange.js.map +1 -1
- package/dist/useCases/transport/relationships/GetAttributesForRelationship.d.ts +2 -2
- package/dist/useCases/transport/relationships/GetAttributesForRelationship.js.map +1 -1
- package/dist/useCases/transport/relationships/GetRelationship.d.ts +5 -5
- package/dist/useCases/transport/relationships/GetRelationship.js +9 -6
- package/dist/useCases/transport/relationships/GetRelationship.js.map +1 -1
- package/dist/useCases/transport/relationships/GetRelationshipByAddress.d.ts +5 -5
- package/dist/useCases/transport/relationships/GetRelationshipByAddress.js +9 -6
- package/dist/useCases/transport/relationships/GetRelationshipByAddress.js.map +1 -1
- package/dist/useCases/transport/relationships/GetRelationships.d.ts +6 -2
- package/dist/useCases/transport/relationships/GetRelationships.js +10 -1
- package/dist/useCases/transport/relationships/GetRelationships.js.map +1 -1
- package/dist/useCases/transport/relationships/RejectRelationshipChange.d.ts +8 -10
- package/dist/useCases/transport/relationships/RejectRelationshipChange.js +11 -19
- package/dist/useCases/transport/relationships/RejectRelationshipChange.js.map +1 -1
- package/dist/useCases/transport/relationships/RevokeRelationshipChange.d.ts +8 -10
- package/dist/useCases/transport/relationships/RevokeRelationshipChange.js +11 -19
- package/dist/useCases/transport/relationships/RevokeRelationshipChange.js.map +1 -1
- package/dist/useCases/transport/tokens/CreateOwnToken.d.ts +6 -5
- package/dist/useCases/transport/tokens/CreateOwnToken.js +19 -14
- package/dist/useCases/transport/tokens/CreateOwnToken.js.map +1 -1
- package/dist/useCases/transport/tokens/GetQRCodeForToken.d.ts +5 -5
- package/dist/useCases/transport/tokens/GetQRCodeForToken.js +9 -6
- package/dist/useCases/transport/tokens/GetQRCodeForToken.js.map +1 -1
- package/dist/useCases/transport/tokens/GetToken.d.ts +5 -5
- package/dist/useCases/transport/tokens/GetToken.js +9 -6
- package/dist/useCases/transport/tokens/GetToken.js.map +1 -1
- package/dist/useCases/transport/tokens/GetTokens.d.ts +6 -2
- package/dist/useCases/transport/tokens/GetTokens.js +10 -1
- package/dist/useCases/transport/tokens/GetTokens.js.map +1 -1
- package/dist/useCases/transport/tokens/LoadPeerToken.d.ts +21 -10
- package/dist/useCases/transport/tokens/LoadPeerToken.js +36 -35
- package/dist/useCases/transport/tokens/LoadPeerToken.js.map +1 -1
- package/lib-web/nmshd.runtime.js +19805 -27613
- package/lib-web/nmshd.runtime.js.map +1 -1
- package/lib-web/nmshd.runtime.min.js +7 -7
- package/lib-web/nmshd.runtime.min.js.map +1 -1
- package/package.json +18 -19
- package/dist/events/transport/TransportLibraryInitializedEvent.d.ts +0 -5
- package/dist/events/transport/TransportLibraryInitializedEvent.js +0 -12
- package/dist/events/transport/TransportLibraryInitializedEvent.js.map +0 -1
- package/dist/events/transport/TransportLibraryInitializingEvent.d.ts +0 -5
- package/dist/events/transport/TransportLibraryInitializingEvent.js +0 -12
- package/dist/events/transport/TransportLibraryInitializingEvent.js.map +0 -1
- package/dist/types/consumption/RelationshipAttributeDTO.d.ts +0 -6
- package/dist/types/consumption/RelationshipAttributeDTO.js.map +0 -1
- package/dist/types/consumption/RelationshipInfoDTO.d.ts +0 -13
- package/dist/types/consumption/RelationshipInfoDTO.js.map +0 -1
- package/dist/types/consumption/RelationshipThemeDTO.d.ts +0 -6
- package/dist/types/consumption/RelationshipThemeDTO.js.map +0 -1
- package/dist/types/consumption/SharedItemDTO.d.ts +0 -12
- package/dist/types/consumption/SharedItemDTO.js.map +0 -1
- package/dist/useCases/common/RuntimeValidator.d.ts +0 -4
- package/dist/useCases/common/RuntimeValidator.js +0 -14
- package/dist/useCases/common/RuntimeValidator.js.map +0 -1
- package/dist/useCases/common/validation/AddressValidator.d.ts +0 -6
- package/dist/useCases/common/validation/AddressValidator.js +0 -25
- package/dist/useCases/common/validation/AddressValidator.js.map +0 -1
- package/dist/useCases/common/validation/DateValidator.d.ts +0 -6
- package/dist/useCases/common/validation/DateValidator.js +0 -26
- package/dist/useCases/common/validation/DateValidator.js.map +0 -1
- package/dist/useCases/common/validation/IdValidator.d.ts +0 -7
- package/dist/useCases/common/validation/IdValidator.js +0 -25
- package/dist/useCases/common/validation/IdValidator.js.map +0 -1
- package/dist/useCases/transport/files/LoadPeerFile.js.map +0 -1
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
import { Result } from "@js-soft/ts-utils";
|
|
2
2
|
import { AccountController, FileController } from "@nmshd/transport";
|
|
3
3
|
import { FileDTO } from "../../../types";
|
|
4
|
-
import {
|
|
4
|
+
import { ISO8601DateTimeString, SchemaRepository, SchemaValidator, UseCase, ValidationResult } from "../../common";
|
|
5
5
|
export interface UploadOwnFileRequest {
|
|
6
6
|
content: Uint8Array;
|
|
7
7
|
filename: string;
|
|
8
8
|
mimetype: string;
|
|
9
|
-
expiresAt:
|
|
9
|
+
expiresAt: ISO8601DateTimeString;
|
|
10
10
|
title: string;
|
|
11
11
|
description?: string;
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
export interface UploadOwnFileValidatableRequest extends Omit<UploadOwnFileRequest, "content"> {
|
|
14
|
+
content: object;
|
|
15
|
+
}
|
|
16
|
+
declare class Validator extends SchemaValidator<UploadOwnFileValidatableRequest> {
|
|
14
17
|
private _maxFileSize;
|
|
15
18
|
set maxFileSize(fileSize: number);
|
|
16
|
-
constructor();
|
|
19
|
+
constructor(schemaRepository: SchemaRepository);
|
|
20
|
+
validate(input: UploadOwnFileRequest): ValidationResult;
|
|
17
21
|
}
|
|
18
22
|
export declare class UploadOwnFileUseCase extends UseCase<UploadOwnFileRequest, FileDTO> {
|
|
19
23
|
private readonly fileController;
|
|
20
24
|
private readonly accountController;
|
|
21
|
-
constructor(fileController: FileController, accountController: AccountController, validator:
|
|
25
|
+
constructor(fileController: FileController, accountController: AccountController, validator: Validator);
|
|
22
26
|
protected executeInternal(request: UploadOwnFileRequest): Promise<Result<FileDTO>>;
|
|
23
27
|
}
|
|
24
28
|
export {};
|
|
@@ -17,33 +17,37 @@ const ts_utils_1 = require("@js-soft/ts-utils");
|
|
|
17
17
|
const crypto_1 = require("@nmshd/crypto");
|
|
18
18
|
const transport_1 = require("@nmshd/transport");
|
|
19
19
|
const luxon_1 = require("luxon");
|
|
20
|
+
const ts_simple_nameof_1 = require("ts-simple-nameof");
|
|
20
21
|
const typescript_ioc_1 = require("typescript-ioc");
|
|
21
22
|
const common_1 = require("../../common");
|
|
22
23
|
const FileMapper_1 = require("./FileMapper");
|
|
23
|
-
class
|
|
24
|
-
constructor() {
|
|
25
|
-
super();
|
|
26
|
-
this.validateIf((x) => x.content)
|
|
27
|
-
.isNotNull()
|
|
28
|
-
.fulfills((c) => c.length > 0)
|
|
29
|
-
.withFailureMessage("file content is empty");
|
|
30
|
-
this.validateIf((x) => x.content)
|
|
31
|
-
.isNotNull()
|
|
32
|
-
.fulfills((c) => c.byteLength <= this._maxFileSize)
|
|
33
|
-
.withFailureMessage("file content is too large");
|
|
34
|
-
this.validateIf((x) => x.filename).isNotNull();
|
|
35
|
-
this.validateIf((x) => x.mimetype).isNotNull();
|
|
36
|
-
this.validateIf((x) => x.title).isNotNull();
|
|
37
|
-
this.validateIf((x) => x.expiresAt).isNotNull();
|
|
38
|
-
this.validateIf((x) => x.expiresAt).fulfills(common_1.DateValidator.required());
|
|
39
|
-
this.validateIf((x) => x.expiresAt)
|
|
40
|
-
.fulfills((e) => luxon_1.DateTime.fromISO(e) > luxon_1.DateTime.utc())
|
|
41
|
-
.withFailureMessage("'$propertyName' must be in the future.");
|
|
24
|
+
let Validator = class Validator extends common_1.SchemaValidator {
|
|
25
|
+
constructor(schemaRepository) {
|
|
26
|
+
super(schemaRepository.getSchema("UploadOwnFileValidatableRequest"));
|
|
42
27
|
}
|
|
43
28
|
set maxFileSize(fileSize) {
|
|
44
29
|
this._maxFileSize = fileSize;
|
|
45
30
|
}
|
|
46
|
-
|
|
31
|
+
validate(input) {
|
|
32
|
+
const validationResult = super.validate(input);
|
|
33
|
+
if (!validationResult.isValid())
|
|
34
|
+
return validationResult;
|
|
35
|
+
if (input.content.byteLength > this._maxFileSize) {
|
|
36
|
+
validationResult.addFailure(new common_1.ValidationFailure(common_1.RuntimeErrors.general.invalidPropertyValue(`'${(0, ts_simple_nameof_1.nameof)((r) => r.content)}' is too large`), (0, ts_simple_nameof_1.nameof)((r) => r.content)));
|
|
37
|
+
}
|
|
38
|
+
if (input.content.length === 0) {
|
|
39
|
+
validationResult.addFailure(new common_1.ValidationFailure(common_1.RuntimeErrors.general.invalidPropertyValue(`'${(0, ts_simple_nameof_1.nameof)((r) => r.content)}' is empty`), (0, ts_simple_nameof_1.nameof)((r) => r.content)));
|
|
40
|
+
}
|
|
41
|
+
if (luxon_1.DateTime.fromISO(input.expiresAt) <= luxon_1.DateTime.utc()) {
|
|
42
|
+
validationResult.addFailure(new common_1.ValidationFailure(common_1.RuntimeErrors.general.invalidPropertyValue(`'${(0, ts_simple_nameof_1.nameof)((r) => r.expiresAt)}' must be in the future`), (0, ts_simple_nameof_1.nameof)((r) => r.expiresAt)));
|
|
43
|
+
}
|
|
44
|
+
return validationResult;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
Validator = __decorate([
|
|
48
|
+
__param(0, typescript_ioc_1.Inject),
|
|
49
|
+
__metadata("design:paramtypes", [common_1.SchemaRepository])
|
|
50
|
+
], Validator);
|
|
47
51
|
let UploadOwnFileUseCase = class UploadOwnFileUseCase extends common_1.UseCase {
|
|
48
52
|
constructor(fileController, accountController, validator) {
|
|
49
53
|
super(validator);
|
|
@@ -68,9 +72,7 @@ UploadOwnFileUseCase = __decorate([
|
|
|
68
72
|
__param(0, typescript_ioc_1.Inject),
|
|
69
73
|
__param(1, typescript_ioc_1.Inject),
|
|
70
74
|
__param(2, typescript_ioc_1.Inject),
|
|
71
|
-
__metadata("design:paramtypes", [transport_1.FileController,
|
|
72
|
-
transport_1.AccountController,
|
|
73
|
-
UploadOwnFileRequestValidator])
|
|
75
|
+
__metadata("design:paramtypes", [transport_1.FileController, transport_1.AccountController, Validator])
|
|
74
76
|
], UploadOwnFileUseCase);
|
|
75
77
|
exports.UploadOwnFileUseCase = UploadOwnFileUseCase;
|
|
76
78
|
//# sourceMappingURL=UploadOwnFile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadOwnFile.js","sourceRoot":"","sources":["../../../../src/useCases/transport/files/UploadOwnFile.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,0CAA2C;AAC3C,gDAA+E;AAC/E,iCAAiC;AACjC,mDAAwC;AAExC,
|
|
1
|
+
{"version":3,"file":"UploadOwnFile.js","sourceRoot":"","sources":["../../../../src/useCases/transport/files/UploadOwnFile.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,0CAA2C;AAC3C,gDAA+E;AAC/E,iCAAiC;AACjC,uDAA0C;AAC1C,mDAAwC;AAExC,yCAAqJ;AACrJ,6CAA0C;AAe1C,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,wBAAgD;IAMpE,YAA2B,gBAAkC;QACzD,KAAK,CAAC,gBAAgB,CAAC,SAAS,CAAC,iCAAiC,CAAC,CAAC,CAAC;IACzE,CAAC;IAND,IAAW,WAAW,CAAC,QAAgB;QACnC,IAAI,CAAC,YAAY,GAAG,QAAQ,CAAC;IACjC,CAAC;IAMM,QAAQ,CAAC,KAA2B;QACvC,MAAM,gBAAgB,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC/C,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE;YAAE,OAAO,gBAAgB,CAAC;QAEzD,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,YAAY,EAAE;YAC9C,gBAAgB,CAAC,UA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,EAAU,SAAoB;QACnK,KAAK,CAAC,SAAS,CAAC,CAAC;QADuB,mBAAc,GAAd,cAAc,CAAgB;QAA2B,sBAAiB,GAAjB,iBAAiB,CAAmB;QAErI,SAAS,CAAC,WAAW,GAAG,cAAc,CAAC,MAAM,CAAC,8BAA8B,CAAC;IACjF,CAAC;IAES,KAAK,CAAC,eAAe,CAAC,OAA6B;QACzD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC;YAC5C,MAAM,EAAE,mBAAU,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;YACxC,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,EAAE;YACtC,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,SAAS,EAAE,oBAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;SAC9C,CAAC,CAAC;QAEH,MAAM,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,CAAC;QAE9C,OAAO,iBAAM,CAAC,EAAE,CAAC,uBAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IACjD,CAAC;CACJ,CAAA;AApBY,oBAAoB;IACT,WAAA,uBAAM,CAAA;IAAmD,WAAA,uBAAM,CAAA;IAAyD,WAAA,uBAAM,CAAA;qCAAtF,0BAAc,EAA8C,6BAAiB,EAAqB,SAAS;GAD9J,oBAAoB,CAoBhC;AApBY,oDAAoB"}
|
|
@@ -21,6 +21,6 @@ __exportStar(require("./DownloadFile"), exports);
|
|
|
21
21
|
__exportStar(require("./FileMapper"), exports);
|
|
22
22
|
__exportStar(require("./GetFile"), exports);
|
|
23
23
|
__exportStar(require("./GetFiles"), exports);
|
|
24
|
-
__exportStar(require("./
|
|
24
|
+
__exportStar(require("./GetOrLoadFile"), exports);
|
|
25
25
|
__exportStar(require("./UploadOwnFile"), exports);
|
|
26
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/useCases/transport/files/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,uDAAqC;AACrC,6DAA2C;AAC3C,iDAA+B;AAC/B,+CAA6B;AAC7B,4CAA0B;AAC1B,6CAA2B;AAC3B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/useCases/transport/files/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,uDAAqC;AACrC,6DAA2C;AAC3C,iDAA+B;AAC/B,+CAA6B;AAC7B,4CAA0B;AAC1B,6CAA2B;AAC3B,kDAAgC;AAChC,kDAAgC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Result } from "@js-soft/ts-utils";
|
|
2
2
|
import { IdentityController, RelationshipsController } from "@nmshd/transport";
|
|
3
3
|
import { RelationshipDTO } from "../../../types";
|
|
4
|
-
import {
|
|
4
|
+
import { AddressString, SchemaRepository, SchemaValidator, UseCase } from "../../common";
|
|
5
5
|
export interface CheckIdentityRequest {
|
|
6
|
-
address:
|
|
6
|
+
address: AddressString;
|
|
7
7
|
}
|
|
8
8
|
export interface CheckIdentityResponse {
|
|
9
9
|
unknown?: boolean;
|
|
@@ -14,13 +14,13 @@ export interface CheckIdentityResponse {
|
|
|
14
14
|
relationshipTerminated?: boolean;
|
|
15
15
|
relationship?: RelationshipDTO;
|
|
16
16
|
}
|
|
17
|
-
declare class
|
|
18
|
-
constructor();
|
|
17
|
+
declare class Validator extends SchemaValidator<CheckIdentityRequest> {
|
|
18
|
+
constructor(schemaRepository: SchemaRepository);
|
|
19
19
|
}
|
|
20
20
|
export declare class CheckIdentityUseCase extends UseCase<CheckIdentityRequest, CheckIdentityResponse> {
|
|
21
21
|
private readonly identityController;
|
|
22
22
|
private readonly relationshipsController;
|
|
23
|
-
constructor(identityController: IdentityController, relationshipsController: RelationshipsController, validator:
|
|
23
|
+
constructor(identityController: IdentityController, relationshipsController: RelationshipsController, validator: Validator);
|
|
24
24
|
protected executeInternal(request: CheckIdentityRequest): Promise<Result<CheckIdentityResponse>>;
|
|
25
25
|
}
|
|
26
26
|
export {};
|
|
@@ -18,12 +18,15 @@ const transport_1 = require("@nmshd/transport");
|
|
|
18
18
|
const typescript_ioc_1 = require("typescript-ioc");
|
|
19
19
|
const common_1 = require("../../common");
|
|
20
20
|
const RelationshipMapper_1 = require("../relationships/RelationshipMapper");
|
|
21
|
-
class
|
|
22
|
-
constructor() {
|
|
23
|
-
super();
|
|
24
|
-
this.validateIfString((x) => x.address).fulfills(common_1.AddressValidator.required());
|
|
21
|
+
let Validator = class Validator extends common_1.SchemaValidator {
|
|
22
|
+
constructor(schemaRepository) {
|
|
23
|
+
super(schemaRepository.getSchema("CheckIdentityRequest"));
|
|
25
24
|
}
|
|
26
|
-
}
|
|
25
|
+
};
|
|
26
|
+
Validator = __decorate([
|
|
27
|
+
__param(0, typescript_ioc_1.Inject),
|
|
28
|
+
__metadata("design:paramtypes", [common_1.SchemaRepository])
|
|
29
|
+
], Validator);
|
|
27
30
|
let CheckIdentityUseCase = class CheckIdentityUseCase extends common_1.UseCase {
|
|
28
31
|
constructor(identityController, relationshipsController, validator) {
|
|
29
32
|
super(validator);
|
|
@@ -72,7 +75,7 @@ CheckIdentityUseCase = __decorate([
|
|
|
72
75
|
__param(2, typescript_ioc_1.Inject),
|
|
73
76
|
__metadata("design:paramtypes", [transport_1.IdentityController,
|
|
74
77
|
transport_1.RelationshipsController,
|
|
75
|
-
|
|
78
|
+
Validator])
|
|
76
79
|
], CheckIdentityUseCase);
|
|
77
80
|
exports.CheckIdentityUseCase = CheckIdentityUseCase;
|
|
78
81
|
//# sourceMappingURL=CheckIdentity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckIdentity.js","sourceRoot":"","sources":["../../../../src/useCases/transport/identity/CheckIdentity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,gDAAgH;AAChH,mDAAwC;AAExC,
|
|
1
|
+
{"version":3,"file":"CheckIdentity.js","sourceRoot":"","sources":["../../../../src/useCases/transport/identity/CheckIdentity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,gDAAgH;AAChH,mDAAwC;AAExC,yCAAyF;AACzF,4EAAyE;AAgBzE,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,wBAAqC;IACzD,YAA2B,gBAAkC;QACzD,KAAK,CAAC,gBAAgB,CAAC,SAAS,CAAC,sBAAsB,CAAC,CAAC,CAAC;IAC9D,CAAC;CACJ,CAAA;AAJK,SAAS;IACS,WAAA,uBAAM,CAAA;qCAAmB,yBAAgB;GAD3D,SAAS,CAId;AAED,IAAa,oBAAoB,GAAjC,MAAa,oBAAqB,SAAQ,gBAAoD;IAC1F,YAC6B,kBAAsC,EACtC,uBAAgD,EACjE,SAAoB;QAE5B,KAAK,CAAC,SAAS,CAAC,CAAC;QAJQ,uBAAkB,GAAlB,kBAAkB,CAAoB;QACtC,4BAAuB,GAAvB,uBAAuB,CAAyB;IAI7E,CAAC;IAES,KAAK,CAAC,eAAe,CAAC,OAA6B;QACzD,MAAM,OAAO,GAAG,uBAAW,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAClD,MAAM,IAAI,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAEnD,IAAI,IAAI,EAAE;YACN,OAAO,iBAAM,CAAC,EAAE,CAAC;gBACb,IAAI,EAAE,IAAI;aACb,CAAC,CAAC;SACN;QAED,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,uBAAuB,CAAC,yBAAyB,CAAC,OAAO,CAAC,CAAC;QAC3F,IAAI,YAAY,EAAE;YACd,MAAM,eAAe,GAAG,uCAAkB,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC;YAC3E,IAAI,YAAY,CAAC,MAAM,KAAK,8BAAkB,CAAC,OAAO,EAAE;gBACpD,OAAO,iBAAM,CAAC,EAAE,CAAC;oBACb,IAAI,EAAE,IAAI;oBACV,mBAAmB,EAAE,IAAI;oBACzB,YAAY,EAAE,eAAe;iBAChC,CAAC,CAAC;aACN;iBAAM,IAAI,YAAY,CAAC,MAAM,KAAK,8BAAkB,CAAC,MAAM,IAAI,YAAY,CAAC,MAAM,KAAK,8BAAkB,CAAC,WAAW,EAAE;gBACpH,OAAO,iBAAM,CAAC,EAAE,CAAC;oBACb,IAAI,EAAE,IAAI;oBACV,kBAAkB,EAAE,IAAI;oBACxB,YAAY,EAAE,eAAe;iBAChC,CAAC,CAAC;aACN;YAED,OAAO,iBAAM,CAAC,EAAE,CAAC;gBACb,IAAI,EAAE,IAAI;gBACV,sBAAsB,EAAE,IAAI;gBAC5B,YAAY,EAAE,eAAe;aAChC,CAAC,CAAC;SACN;QAED,OAAO,iBAAM,CAAC,EAAE,CAAC;YACb,OAAO,EAAE,IAAI;SAChB,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AA/CY,oBAAoB;IAExB,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;qCAFsC,8BAAkB;QACb,mCAAuB;QACtD,SAAS;GAJvB,oBAAoB,CA+ChC;AA/CY,oDAAoB"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Result } from "@js-soft/ts-utils";
|
|
2
2
|
import { FileController, MessageController } from "@nmshd/transport";
|
|
3
|
-
import {
|
|
3
|
+
import { FileIdString, MessageIdString, SchemaRepository, SchemaValidator, UseCase } from "../../common";
|
|
4
4
|
export interface DownloadAttachmentRequest {
|
|
5
|
-
id:
|
|
6
|
-
attachmentId:
|
|
5
|
+
id: MessageIdString;
|
|
6
|
+
attachmentId: FileIdString;
|
|
7
7
|
}
|
|
8
|
-
declare class
|
|
9
|
-
constructor();
|
|
8
|
+
declare class Validator extends SchemaValidator<DownloadAttachmentRequest> {
|
|
9
|
+
constructor(schemaRepository: SchemaRepository);
|
|
10
10
|
}
|
|
11
11
|
export interface DownloadAttachmentResponse {
|
|
12
12
|
content: Uint8Array;
|
|
@@ -16,7 +16,7 @@ export interface DownloadAttachmentResponse {
|
|
|
16
16
|
export declare class DownloadAttachmentUseCase extends UseCase<DownloadAttachmentRequest, DownloadAttachmentResponse> {
|
|
17
17
|
private readonly messageController;
|
|
18
18
|
private readonly fileController;
|
|
19
|
-
constructor(messageController: MessageController, fileController: FileController, validator:
|
|
19
|
+
constructor(messageController: MessageController, fileController: FileController, validator: Validator);
|
|
20
20
|
protected executeInternal(request: DownloadAttachmentRequest): Promise<Result<DownloadAttachmentResponse>>;
|
|
21
21
|
}
|
|
22
22
|
export {};
|
|
@@ -18,13 +18,15 @@ const transport_1 = require("@nmshd/transport");
|
|
|
18
18
|
const typescript_ioc_1 = require("typescript-ioc");
|
|
19
19
|
const common_1 = require("../../common");
|
|
20
20
|
const MessageMapper_1 = require("./MessageMapper");
|
|
21
|
-
class
|
|
22
|
-
constructor() {
|
|
23
|
-
super();
|
|
24
|
-
this.validateIf((x) => x.id).fulfills(common_1.IdValidator.required(transport_1.BackboneIds.message));
|
|
25
|
-
this.validateIf((x) => x.attachmentId).fulfills(common_1.IdValidator.required(transport_1.BackboneIds.file));
|
|
21
|
+
let Validator = class Validator extends common_1.SchemaValidator {
|
|
22
|
+
constructor(schemaRepository) {
|
|
23
|
+
super(schemaRepository.getSchema("DownloadAttachmentRequest"));
|
|
26
24
|
}
|
|
27
|
-
}
|
|
25
|
+
};
|
|
26
|
+
Validator = __decorate([
|
|
27
|
+
__param(0, typescript_ioc_1.Inject),
|
|
28
|
+
__metadata("design:paramtypes", [common_1.SchemaRepository])
|
|
29
|
+
], Validator);
|
|
28
30
|
let DownloadAttachmentUseCase = class DownloadAttachmentUseCase extends common_1.UseCase {
|
|
29
31
|
constructor(messageController, fileController, validator) {
|
|
30
32
|
super(validator);
|
|
@@ -55,9 +57,7 @@ DownloadAttachmentUseCase = __decorate([
|
|
|
55
57
|
__param(0, typescript_ioc_1.Inject),
|
|
56
58
|
__param(1, typescript_ioc_1.Inject),
|
|
57
59
|
__param(2, typescript_ioc_1.Inject),
|
|
58
|
-
__metadata("design:paramtypes", [transport_1.MessageController,
|
|
59
|
-
transport_1.FileController,
|
|
60
|
-
DownloadAttachmentRequestValidator])
|
|
60
|
+
__metadata("design:paramtypes", [transport_1.MessageController, transport_1.FileController, Validator])
|
|
61
61
|
], DownloadAttachmentUseCase);
|
|
62
62
|
exports.DownloadAttachmentUseCase = DownloadAttachmentUseCase;
|
|
63
63
|
//# sourceMappingURL=DownloadAttachment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DownloadAttachment.js","sourceRoot":"","sources":["../../../../src/useCases/transport/messages/DownloadAttachment.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,
|
|
1
|
+
{"version":3,"file":"DownloadAttachment.js","sourceRoot":"","sources":["../../../../src/useCases/transport/messages/DownloadAttachment.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,gDAA4F;AAC5F,mDAAwC;AACxC,yCAAwH;AACxH,mDAAgD;AAOhD,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,wBAA0C;IAC9D,YAA2B,gBAAkC;QACzD,KAAK,CAAC,gBAAgB,CAAC,SAAS,CAAC,2BAA2B,CAAC,CAAC,CAAC;IACnE,CAAC;CACJ,CAAA;AAJK,SAAS;IACS,WAAA,uBAAM,CAAA;qCAAmB,yBAAgB;GAD3D,SAAS,CAId;AAQD,IAAa,yBAAyB,GAAtC,MAAa,yBAA0B,SAAQ,gBAA8D;IACzG,YAA4C,iBAAoC,EAA2B,cAA8B,EAAU,SAAoB;QACnK,KAAK,CAAC,SAAS,CAAC,CAAC;QADuB,sBAAiB,GA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A4B,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC;IACpF,CAAC;CACJ,CAAA;AA7BY,yBAAyB;IACd,WAAA,uBAAM,CAAA;IAAyD,WAAA,uBAAM,CAAA;IAAmD,WAAA,uBAAM,CAAA;qCAAnF,6BAAiB,EAA2C,0BAAc,EAAqB,SAAS;GAD9J,yBAAyB,CA6BrC;AA7BY,8DAAyB"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { Result } from "@js-soft/ts-utils";
|
|
2
2
|
import { FileController, MessageController } from "@nmshd/transport";
|
|
3
3
|
import { FileDTO } from "../../../types";
|
|
4
|
-
import {
|
|
4
|
+
import { FileIdString, MessageIdString, SchemaRepository, SchemaValidator, UseCase } from "../../common";
|
|
5
5
|
export interface GetAttachmentMetadataRequest {
|
|
6
|
-
id:
|
|
7
|
-
attachmentId:
|
|
6
|
+
id: MessageIdString;
|
|
7
|
+
attachmentId: FileIdString;
|
|
8
8
|
}
|
|
9
|
-
declare class
|
|
10
|
-
constructor();
|
|
9
|
+
declare class Validator extends SchemaValidator<GetAttachmentMetadataRequest> {
|
|
10
|
+
constructor(schemaRepository: SchemaRepository);
|
|
11
11
|
}
|
|
12
12
|
export declare class GetAttachmentMetadataUseCase extends UseCase<GetAttachmentMetadataRequest, FileDTO> {
|
|
13
13
|
private readonly messageController;
|
|
14
14
|
private readonly fileController;
|
|
15
|
-
constructor(messageController: MessageController, fileController: FileController, validator:
|
|
15
|
+
constructor(messageController: MessageController, fileController: FileController, validator: Validator);
|
|
16
16
|
protected executeInternal(request: GetAttachmentMetadataRequest): Promise<Result<FileDTO>>;
|
|
17
17
|
}
|
|
18
18
|
export {};
|
|
@@ -18,13 +18,15 @@ const transport_1 = require("@nmshd/transport");
|
|
|
18
18
|
const typescript_ioc_1 = require("typescript-ioc");
|
|
19
19
|
const common_1 = require("../../common");
|
|
20
20
|
const FileMapper_1 = require("../files/FileMapper");
|
|
21
|
-
class
|
|
22
|
-
constructor() {
|
|
23
|
-
super();
|
|
24
|
-
this.validateIf((x) => x.id).fulfills(common_1.IdValidator.required(transport_1.BackboneIds.message));
|
|
25
|
-
this.validateIf((x) => x.attachmentId).fulfills(common_1.IdValidator.required(transport_1.BackboneIds.file));
|
|
21
|
+
let Validator = class Validator extends common_1.SchemaValidator {
|
|
22
|
+
constructor(schemaRepository) {
|
|
23
|
+
super(schemaRepository.getSchema("GetAttachmentMetadataRequest"));
|
|
26
24
|
}
|
|
27
|
-
}
|
|
25
|
+
};
|
|
26
|
+
Validator = __decorate([
|
|
27
|
+
__param(0, typescript_ioc_1.Inject),
|
|
28
|
+
__metadata("design:paramtypes", [common_1.SchemaRepository])
|
|
29
|
+
], Validator);
|
|
28
30
|
let GetAttachmentMetadataUseCase = class GetAttachmentMetadataUseCase extends common_1.UseCase {
|
|
29
31
|
constructor(messageController, fileController, validator) {
|
|
30
32
|
super(validator);
|
|
@@ -54,9 +56,7 @@ GetAttachmentMetadataUseCase = __decorate([
|
|
|
54
56
|
__param(0, typescript_ioc_1.Inject),
|
|
55
57
|
__param(1, typescript_ioc_1.Inject),
|
|
56
58
|
__param(2, typescript_ioc_1.Inject),
|
|
57
|
-
__metadata("design:paramtypes", [transport_1.MessageController,
|
|
58
|
-
transport_1.FileController,
|
|
59
|
-
GetAttachmentMetadataRequestValidator])
|
|
59
|
+
__metadata("design:paramtypes", [transport_1.MessageController, transport_1.FileController, Validator])
|
|
60
60
|
], GetAttachmentMetadataUseCase);
|
|
61
61
|
exports.GetAttachmentMetadataUseCase = GetAttachmentMetadataUseCase;
|
|
62
62
|
//# sourceMappingURL=GetAttachmentMetadata.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GetAttachmentMetadata.js","sourceRoot":"","sources":["../../../../src/useCases/transport/messages/GetAttachmentMetadata.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,
|
|
1
|
+
{"version":3,"file":"GetAttachmentMetadata.js","sourceRoot":"","sources":["../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YAAY,CAAC,CAAC,CAAC,CAAC;QACtG,IAAI,CAAC,UAAU,EAAE;YACb,OAAO,iBAAM,CAAC,IAAI,CAAC,sBAAa,CAAC,QAAQ,CAAC,qBAAqB,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;SAC1F;QAED,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC3D,IAAI,CAAC,IAAI,EAAE;YACP,OAAO,iBAAM,CAAC,IAAI,CAAC,sBAAa,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC;SAClE;QAED,OAAO,iBAAM,CAAC,EAAE,CAAC,uBAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IACjD,CAAC;CACJ,CAAA;AA3BY,4BAA4B;IACjB,WAAA,uBAAM,CAAA;IAAyD,WAAA,uBAAM,CAAA;IAAmD,WAAA,uBAAM,CAAA;qCAAnF,6BAAiB,EAA2C,0BAAc,EAAqB,SAAS;GAD9J,4BAA4B,CA2BxC;AA3BY,oEAA4B"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { Result } from "@js-soft/ts-utils";
|
|
2
2
|
import { FileController, MessageController } from "@nmshd/transport";
|
|
3
3
|
import { MessageWithAttachmentsDTO } from "../../../types";
|
|
4
|
-
import {
|
|
4
|
+
import { MessageIdString, SchemaRepository, SchemaValidator, UseCase } from "../../common";
|
|
5
5
|
export interface GetMessageRequest {
|
|
6
|
-
id:
|
|
6
|
+
id: MessageIdString;
|
|
7
7
|
}
|
|
8
|
-
declare class
|
|
9
|
-
constructor();
|
|
8
|
+
declare class Validator extends SchemaValidator<GetMessageRequest> {
|
|
9
|
+
constructor(schemaRepository: SchemaRepository);
|
|
10
10
|
}
|
|
11
11
|
export declare class GetMessageUseCase extends UseCase<GetMessageRequest, MessageWithAttachmentsDTO> {
|
|
12
12
|
private readonly messageController;
|
|
13
13
|
private readonly fileController;
|
|
14
|
-
constructor(messageController: MessageController, fileController: FileController, validator:
|
|
14
|
+
constructor(messageController: MessageController, fileController: FileController, validator: Validator);
|
|
15
15
|
protected executeInternal(request: GetMessageRequest): Promise<Result<MessageWithAttachmentsDTO>>;
|
|
16
16
|
}
|
|
17
17
|
export {};
|
|
@@ -18,12 +18,15 @@ const transport_1 = require("@nmshd/transport");
|
|
|
18
18
|
const typescript_ioc_1 = require("typescript-ioc");
|
|
19
19
|
const common_1 = require("../../common");
|
|
20
20
|
const MessageMapper_1 = require("./MessageMapper");
|
|
21
|
-
class
|
|
22
|
-
constructor() {
|
|
23
|
-
super();
|
|
24
|
-
this.validateIf((x) => x.id).fulfills(common_1.IdValidator.required(transport_1.BackboneIds.message));
|
|
21
|
+
let Validator = class Validator extends common_1.SchemaValidator {
|
|
22
|
+
constructor(schemaRepository) {
|
|
23
|
+
super(schemaRepository.getSchema("GetMessageRequest"));
|
|
25
24
|
}
|
|
26
|
-
}
|
|
25
|
+
};
|
|
26
|
+
Validator = __decorate([
|
|
27
|
+
__param(0, typescript_ioc_1.Inject),
|
|
28
|
+
__metadata("design:paramtypes", [common_1.SchemaRepository])
|
|
29
|
+
], Validator);
|
|
27
30
|
let GetMessageUseCase = class GetMessageUseCase extends common_1.UseCase {
|
|
28
31
|
constructor(messageController, fileController, validator) {
|
|
29
32
|
super(validator);
|
|
@@ -49,9 +52,7 @@ GetMessageUseCase = __decorate([
|
|
|
49
52
|
__param(0, typescript_ioc_1.Inject),
|
|
50
53
|
__param(1, typescript_ioc_1.Inject),
|
|
51
54
|
__param(2, typescript_ioc_1.Inject),
|
|
52
|
-
__metadata("design:paramtypes", [transport_1.MessageController,
|
|
53
|
-
transport_1.FileController,
|
|
54
|
-
GetMessageRequestValidator])
|
|
55
|
+
__metadata("design:paramtypes", [transport_1.MessageController, transport_1.FileController, Validator])
|
|
55
56
|
], GetMessageUseCase);
|
|
56
57
|
exports.GetMessageUseCase = GetMessageUseCase;
|
|
57
58
|
//# sourceMappingURL=GetMessage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GetMessage.js","sourceRoot":"","sources":["../../../../src/useCases/transport/messages/GetMessage.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,
|
|
1
|
+
{"version":3,"file":"GetMessage.js","sourceRoot":"","sources":["../../../../src/useCases/transport/messages/GetMessage.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,gDAA4F;AAC5F,mDAAwC;AAExC,yCAA0G;AAC1G,mDAAgD;AAMhD,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,wBAAkC;IACtD,YAA2B,gBAAkC;QACzD,KAAK,CAAC,gBAAgB,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAC3D,CAAC;CACJ,CAAA;AAJK,SAAS;IACS,WAAA,uBAAM,CAAA;qCAAmB,yBAAgB;GAD3D,SAAS,CAId;AAED,IAAa,iBAAiB,GAA9B,MAAa,iBAAkB,SAAQ,gBAAqD;IACxF,YAA4C,iBAAoC,EAA2B,cAA8B,EAAU,SAAoB;QACnK,KAAK,CAAC,SAAS,CAAC,CAAC;QADuB,sBAAiB,GAAjB,iBAAiB,CAAmB;QAA2B,mBAAc,GAAd,cAAc,CAAgB;IAEzI,CAAC;IAES,KAAK,CAAC,eAAe,CAAC,OAA0B;QACtD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,kBAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;QAEjF,IAAI,CAAC,OAAO,EAAE;YACV,OAAO,iBAAM,CAAC,IAAI,CAAC,sBAAa,CAAC,OAAO,CAAC,cAAc,CAAC,mBAAO,CAAC,CAAC,CAAC;SACrE;QAED,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE;YAChB,OAAO,iBAAM,CAAC,IAAI,CAAC,sBAAa,CAAC,OAAO,CAAC,UAAU,CAAC,mBAAO,EAAE,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;SACxF;QAED,MAAM,WAAW,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC9G,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE;YAC7B,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;SACnD;QAED,OAAO,iBAAM,CAAC,EAAE,CAAC,6BAAa,CAAC,2BAA2B,CAAC,OAAO,EAAE,WAAqB,CAAC,CAAC,CAAC;IAChG,CAAC;CACJ,CAAA;AAvBY,iBAAiB;IACN,WAAA,uBAAM,CAAA;IAAyD,WAAA,uBAAM,CAAA;IAAmD,WAAA,uBAAM,CAAA;qCAAnF,6BAAiB,EAA2C,0BAAc,EAAqB,SAAS;GAD9J,iBAAiB,CAuB7B;AAvBY,8CAAiB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Result } from "@js-soft/ts-utils";
|
|
2
2
|
import { MessageController } from "@nmshd/transport";
|
|
3
3
|
import { MessageDTO } from "../../../types";
|
|
4
|
-
import {
|
|
4
|
+
import { SchemaRepository, SchemaValidator, UseCase } from "../../common";
|
|
5
5
|
export interface GetMessagesQuery {
|
|
6
6
|
createdBy?: string | string[];
|
|
7
7
|
createdByDevice?: string | string[];
|
|
@@ -17,13 +17,13 @@ export interface GetMessagesQuery {
|
|
|
17
17
|
export interface GetMessagesRequest {
|
|
18
18
|
query?: any;
|
|
19
19
|
}
|
|
20
|
-
declare class
|
|
21
|
-
constructor();
|
|
20
|
+
declare class Validator extends SchemaValidator<GetMessagesRequest> {
|
|
21
|
+
constructor(schemaRepository: SchemaRepository);
|
|
22
22
|
}
|
|
23
23
|
export declare class GetMessagesUseCase extends UseCase<GetMessagesRequest, MessageDTO[]> {
|
|
24
24
|
private readonly messageController;
|
|
25
25
|
private static readonly queryTranslator;
|
|
26
|
-
constructor(messageController: MessageController, validator:
|
|
26
|
+
constructor(messageController: MessageController, validator: Validator);
|
|
27
27
|
protected executeInternal(request: GetMessagesRequest): Promise<Result<MessageDTO[]>>;
|
|
28
28
|
}
|
|
29
29
|
export {};
|
|
@@ -20,11 +20,15 @@ const ts_simple_nameof_1 = require("ts-simple-nameof");
|
|
|
20
20
|
const typescript_ioc_1 = require("typescript-ioc");
|
|
21
21
|
const common_1 = require("../../common");
|
|
22
22
|
const MessageMapper_1 = require("./MessageMapper");
|
|
23
|
-
class
|
|
24
|
-
constructor() {
|
|
25
|
-
super();
|
|
23
|
+
let Validator = class Validator extends common_1.SchemaValidator {
|
|
24
|
+
constructor(schemaRepository) {
|
|
25
|
+
super(schemaRepository.getSchema("GetMessagesRequest"));
|
|
26
26
|
}
|
|
27
|
-
}
|
|
27
|
+
};
|
|
28
|
+
Validator = __decorate([
|
|
29
|
+
__param(0, typescript_ioc_1.Inject),
|
|
30
|
+
__metadata("design:paramtypes", [common_1.SchemaRepository])
|
|
31
|
+
], Validator);
|
|
28
32
|
let GetMessagesUseCase = class GetMessagesUseCase extends common_1.UseCase {
|
|
29
33
|
constructor(messageController, validator) {
|
|
30
34
|
super(validator);
|
|
@@ -106,7 +110,7 @@ GetMessagesUseCase.queryTranslator = new docdb_querytranslator_1.QueryTranslator
|
|
|
106
110
|
GetMessagesUseCase = __decorate([
|
|
107
111
|
__param(0, typescript_ioc_1.Inject),
|
|
108
112
|
__param(1, typescript_ioc_1.Inject),
|
|
109
|
-
__metadata("design:paramtypes", [transport_1.MessageController,
|
|
113
|
+
__metadata("design:paramtypes", [transport_1.MessageController, Validator])
|
|
110
114
|
], GetMessagesUseCase);
|
|
111
115
|
exports.GetMessagesUseCase = GetMessagesUseCase;
|
|
112
116
|
//# sourceMappingURL=GetMessages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GetMessages.js","sourceRoot":"","sources":["../../../../src/useCases/transport/messages/GetMessages.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,0EAAiE;AACjE,gDAA2C;AAC3C,gDAAuG;AACvG,uDAA0C;AAC1C,mDAAwC;AAExC,
|
|
1
|
+
{"version":3,"file":"GetMessages.js","sourceRoot":"","sources":["../../../../src/useCases/transport/messages/GetMessages.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,0EAAiE;AACjE,gDAA2C;AAC3C,gDAAuG;AACvG,uDAA0C;AAC1C,mDAAwC;AAExC,yCAA0E;AAC1E,mDAAgD;AAmBhD,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,wBAAmC;IACvD,YAA2B,gBAAkC;QACzD,KAAK,CAAC,gBAAgB,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAC5D,CAAC;CACJ,CAAA;AAJK,SAAS;IACS,WAAA,uBAAM,CAAA;qCAAmB,yBAAgB;GAD3D,SAAS,CAId;AAED,IAAa,kBAAkB,GAA/B,MAAa,kBAAmB,SAAQ,gBAAyC;IA6E7E,YAA4C,iBAAoC,EAAU,SAAoB;QAC1G,KAAK,CAAC,SAAS,CAAC,CAAC;QADuB,sBAAiB,GAAjB,iBAAiB,CAAmB;IAEhF,CAAC;IAES,KAAK,CAAC,eAAe,CAAC,OAA2B;QACvD,MAAM,KAAK,GAAG,kBAAkB,CAAC,eAAe,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAEtE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEjE,OAAO,iBAAM,CAAC,EAAE,CAAC,6BAAa,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC/D,CAAC;CACJ,CAAA;AAvF2B,kCAAe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,MAAM;wBACV;4BACI,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC;qBACrD;iBACJ;aACJ;iBAAM;gBACH,gBAAgB,GAAG,kBAAkB,CAAC,eAAe,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;aAC/E;YAED,KAAK,CAAC,KAAK,CAAC,GAAG;gBACX;oBACI,CAAC,GAAG,IAAA,yBAAM,EAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,IAAA,yBAAM,EAAgB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,gBAAgB;iBACxG;gBACD;oBACI,CAAC,GAAG,IAAA,yBAAM,EAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,IAAA,yBAAM,EAAgB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,IAAA,yBAAM,EAA2B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,gBAAgB;iBAC/J;aACJ,CAAC;QACN,CAAC;KACJ;CACJ,CAAE,CAAA;AA3EM,kBAAkB;IA6EP,WAAA,uBAAM,CAAA;IAAyD,WAAA,uBAAM,CAAA;qCAA1B,6BAAiB,EAAqB,SAAS;GA7ErG,kBAAkB,CAwF9B;AAxFY,gDAAkB"}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AccountController, FileController,
|
|
1
|
+
import { Result } from "@js-soft/ts-utils";
|
|
2
|
+
import { AccountController, FileController, MessageController } from "@nmshd/transport";
|
|
3
3
|
import { MessageDTO } from "../../../types";
|
|
4
|
-
import {
|
|
4
|
+
import { AddressString, FileIdString, SchemaRepository, SchemaValidator, UseCase } from "../../common";
|
|
5
5
|
export interface SendMessageRequest {
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* @minItems 1
|
|
8
|
+
*/
|
|
9
|
+
recipients: AddressString[];
|
|
7
10
|
content: any;
|
|
8
|
-
attachments?:
|
|
11
|
+
attachments?: FileIdString[];
|
|
9
12
|
}
|
|
10
|
-
declare class
|
|
11
|
-
constructor();
|
|
13
|
+
declare class Validator extends SchemaValidator<SendMessageRequest> {
|
|
14
|
+
constructor(schemaRepository: SchemaRepository);
|
|
12
15
|
}
|
|
13
16
|
export declare class SendMessageUseCase extends UseCase<SendMessageRequest, MessageDTO> {
|
|
14
17
|
private readonly messageController;
|
|
15
18
|
private readonly fileController;
|
|
16
19
|
private readonly accountController;
|
|
17
|
-
|
|
18
|
-
private readonly eventBus;
|
|
19
|
-
constructor(messageController: MessageController, fileController: FileController, accountController: AccountController, identityController: IdentityController, eventBus: EventBus, validator: SendMessageRequestValidator);
|
|
20
|
+
constructor(messageController: MessageController, fileController: FileController, accountController: AccountController, validator: Validator);
|
|
20
21
|
protected executeInternal(request: SendMessageRequest): Promise<Result<MessageDTO>>;
|
|
21
22
|
private transformAttachments;
|
|
22
23
|
}
|
|
@@ -16,26 +16,23 @@ exports.SendMessageUseCase = void 0;
|
|
|
16
16
|
const ts_utils_1 = require("@js-soft/ts-utils");
|
|
17
17
|
const transport_1 = require("@nmshd/transport");
|
|
18
18
|
const typescript_ioc_1 = require("typescript-ioc");
|
|
19
|
-
const events_1 = require("../../../events");
|
|
20
19
|
const common_1 = require("../../common");
|
|
21
20
|
const MessageMapper_1 = require("./MessageMapper");
|
|
22
|
-
class
|
|
23
|
-
constructor() {
|
|
24
|
-
super();
|
|
25
|
-
this.validateIfIterable((x) => x.recipients).isNotEmpty();
|
|
26
|
-
this.validateIfEachString((x) => x.recipients).fulfills(common_1.AddressValidator.required());
|
|
27
|
-
this.validateIfAny((x) => x.content).isNotNull();
|
|
28
|
-
this.validateIfEachString((x) => x.attachments).fulfills(common_1.IdValidator.required(transport_1.BackboneIds.file));
|
|
21
|
+
let Validator = class Validator extends common_1.SchemaValidator {
|
|
22
|
+
constructor(schemaRepository) {
|
|
23
|
+
super(schemaRepository.getSchema("SendMessageRequest"));
|
|
29
24
|
}
|
|
30
|
-
}
|
|
25
|
+
};
|
|
26
|
+
Validator = __decorate([
|
|
27
|
+
__param(0, typescript_ioc_1.Inject),
|
|
28
|
+
__metadata("design:paramtypes", [common_1.SchemaRepository])
|
|
29
|
+
], Validator);
|
|
31
30
|
let SendMessageUseCase = class SendMessageUseCase extends common_1.UseCase {
|
|
32
|
-
constructor(messageController, fileController, accountController,
|
|
31
|
+
constructor(messageController, fileController, accountController, validator) {
|
|
33
32
|
super(validator);
|
|
34
33
|
this.messageController = messageController;
|
|
35
34
|
this.fileController = fileController;
|
|
36
35
|
this.accountController = accountController;
|
|
37
|
-
this.identityController = identityController;
|
|
38
|
-
this.eventBus = eventBus;
|
|
39
36
|
}
|
|
40
37
|
async executeInternal(request) {
|
|
41
38
|
const transformAttachmentsResult = await this.transformAttachments(request.attachments);
|
|
@@ -47,8 +44,6 @@ let SendMessageUseCase = class SendMessageUseCase extends common_1.UseCase {
|
|
|
47
44
|
content: request.content,
|
|
48
45
|
attachments: transformAttachmentsResult.value
|
|
49
46
|
});
|
|
50
|
-
const messageDTO = MessageMapper_1.MessageMapper.toMessageDTO(result);
|
|
51
|
-
this.eventBus.publish(new events_1.MessageSentEvent(this.identityController.identity.address.toString(), messageDTO));
|
|
52
47
|
await this.accountController.syncDatawallet();
|
|
53
48
|
return ts_utils_1.Result.ok(MessageMapper_1.MessageMapper.toMessageDTO(result));
|
|
54
49
|
}
|
|
@@ -72,14 +67,10 @@ SendMessageUseCase = __decorate([
|
|
|
72
67
|
__param(1, typescript_ioc_1.Inject),
|
|
73
68
|
__param(2, typescript_ioc_1.Inject),
|
|
74
69
|
__param(3, typescript_ioc_1.Inject),
|
|
75
|
-
__param(4, typescript_ioc_1.Inject),
|
|
76
|
-
__param(5, typescript_ioc_1.Inject),
|
|
77
70
|
__metadata("design:paramtypes", [transport_1.MessageController,
|
|
78
71
|
transport_1.FileController,
|
|
79
72
|
transport_1.AccountController,
|
|
80
|
-
|
|
81
|
-
ts_utils_1.EventBus,
|
|
82
|
-
SendMessageRequestValidator])
|
|
73
|
+
Validator])
|
|
83
74
|
], SendMessageUseCase);
|
|
84
75
|
exports.SendMessageUseCase = SendMessageUseCase;
|
|
85
76
|
//# sourceMappingURL=SendMessage.js.map
|