@nmshd/transport 7.0.0-alpha.9 → 7.0.0-openid4vc.1
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/buildInformation.js +5 -5
- package/dist/core/CoreSynchronizable.d.ts +1 -0
- package/dist/core/CoreSynchronizable.d.ts.map +1 -1
- package/dist/core/CoreSynchronizable.js +1 -0
- package/dist/core/CoreSynchronizable.js.map +1 -1
- package/dist/core/DbCollectionName.d.ts +0 -1
- package/dist/core/DbCollectionName.d.ts.map +1 -1
- package/dist/core/DbCollectionName.js +0 -1
- package/dist/core/DbCollectionName.js.map +1 -1
- package/dist/core/TransportController.d.ts +1 -4
- package/dist/core/TransportController.d.ts.map +1 -1
- package/dist/core/TransportController.js +7 -7
- package/dist/core/TransportController.js.map +1 -1
- package/dist/core/TransportCoreErrors.d.ts +7 -2
- package/dist/core/TransportCoreErrors.d.ts.map +1 -1
- package/dist/core/TransportCoreErrors.js +15 -6
- package/dist/core/TransportCoreErrors.js.map +1 -1
- package/dist/core/backbone/RESTClient.d.ts +1 -0
- package/dist/core/backbone/RESTClient.d.ts.map +1 -1
- package/dist/core/backbone/RESTClient.js +30 -10
- package/dist/core/backbone/RESTClient.js.map +1 -1
- package/dist/core/backbone/RESTClientAuthenticate.d.ts +1 -0
- package/dist/core/backbone/RESTClientAuthenticate.d.ts.map +1 -1
- package/dist/core/backbone/RESTClientAuthenticate.js +5 -0
- package/dist/core/backbone/RESTClientAuthenticate.js.map +1 -1
- package/dist/core/backbone/RequestError.d.ts.map +1 -1
- package/dist/core/backbone/RequestError.js +3 -0
- package/dist/core/backbone/RequestError.js.map +1 -1
- package/dist/core/types/PasswordProtection.d.ts +4 -5
- package/dist/core/types/PasswordProtection.d.ts.map +1 -1
- package/dist/core/types/PasswordProtection.js +10 -9
- package/dist/core/types/PasswordProtection.js.map +1 -1
- package/dist/core/types/PasswordProtectionCreationParameters.d.ts +3 -0
- package/dist/core/types/PasswordProtectionCreationParameters.d.ts.map +1 -1
- package/dist/core/types/PasswordProtectionCreationParameters.js +7 -1
- package/dist/core/types/PasswordProtectionCreationParameters.js.map +1 -1
- package/dist/events/FileOwnershipClaimedEvent.d.ts +7 -0
- package/dist/events/FileOwnershipClaimedEvent.d.ts.map +1 -0
- package/dist/events/FileOwnershipClaimedEvent.js +12 -0
- package/dist/events/FileOwnershipClaimedEvent.js.map +1 -0
- package/dist/events/FileOwnershipLockedEvent.d.ts +7 -0
- package/dist/events/FileOwnershipLockedEvent.d.ts.map +1 -0
- package/dist/events/FileOwnershipLockedEvent.js +12 -0
- package/dist/events/FileOwnershipLockedEvent.js.map +1 -0
- package/dist/events/MessageDeliveredEvent.d.ts +1 -1
- package/dist/events/MessageDeliveredEvent.d.ts.map +1 -1
- package/dist/events/MessageReceivedEvent.d.ts +1 -1
- package/dist/events/MessageReceivedEvent.d.ts.map +1 -1
- package/dist/events/MessageSentEvent.d.ts +1 -1
- package/dist/events/MessageSentEvent.d.ts.map +1 -1
- package/dist/events/MessageWasReadAtChangedEvent.d.ts +1 -1
- package/dist/events/MessageWasReadAtChangedEvent.d.ts.map +1 -1
- package/dist/events/PeerRelationshipTemplateLoadedEvent.d.ts +1 -1
- package/dist/events/PeerRelationshipTemplateLoadedEvent.d.ts.map +1 -1
- package/dist/events/RelationshipChangedEvent.d.ts +1 -1
- package/dist/events/RelationshipChangedEvent.d.ts.map +1 -1
- package/dist/events/RelationshipReactivationCompletedEvent.d.ts +1 -1
- package/dist/events/RelationshipReactivationCompletedEvent.d.ts.map +1 -1
- package/dist/events/RelationshipReactivationRequestedEvent.d.ts +1 -1
- package/dist/events/RelationshipReactivationRequestedEvent.d.ts.map +1 -1
- package/dist/events/RelationshipTemplateAllocationsExhaustedEvent.d.ts +7 -0
- package/dist/events/RelationshipTemplateAllocationsExhaustedEvent.d.ts.map +1 -0
- package/dist/events/RelationshipTemplateAllocationsExhaustedEvent.js +12 -0
- package/dist/events/RelationshipTemplateAllocationsExhaustedEvent.js.map +1 -0
- package/dist/events/index.d.ts +3 -0
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +3 -0
- package/dist/events/index.js.map +1 -1
- package/dist/modules/accounts/AccountController.d.ts +4 -6
- package/dist/modules/accounts/AccountController.d.ts.map +1 -1
- package/dist/modules/accounts/AccountController.js +31 -17
- package/dist/modules/accounts/AccountController.js.map +1 -1
- package/dist/modules/accounts/IdentityDeletionProcessController.d.ts +2 -8
- package/dist/modules/accounts/IdentityDeletionProcessController.d.ts.map +1 -1
- package/dist/modules/accounts/IdentityDeletionProcessController.js +4 -24
- package/dist/modules/accounts/IdentityDeletionProcessController.js.map +1 -1
- package/dist/modules/accounts/data/IdentityDeletionProcess.d.ts +35 -8
- package/dist/modules/accounts/data/IdentityDeletionProcess.d.ts.map +1 -1
- package/dist/modules/accounts/data/IdentityDeletionProcess.js +65 -10
- package/dist/modules/accounts/data/IdentityDeletionProcess.js.map +1 -1
- package/dist/modules/announcements/AnnouncementController.d.ts +11 -0
- package/dist/modules/announcements/AnnouncementController.d.ts.map +1 -0
- package/dist/modules/announcements/AnnouncementController.js +26 -0
- package/dist/modules/announcements/AnnouncementController.js.map +1 -0
- package/dist/modules/announcements/backbone/AnnouncementClient.d.ts +6 -0
- package/dist/modules/announcements/backbone/AnnouncementClient.d.ts.map +1 -0
- package/dist/modules/announcements/backbone/AnnouncementClient.js +11 -0
- package/dist/modules/announcements/backbone/AnnouncementClient.js.map +1 -0
- package/dist/modules/announcements/backbone/BackboneGetAnnouncements.d.ts +18 -0
- package/dist/modules/announcements/backbone/BackboneGetAnnouncements.d.ts.map +1 -0
- package/dist/modules/announcements/backbone/BackboneGetAnnouncements.js +3 -0
- package/dist/modules/announcements/backbone/BackboneGetAnnouncements.js.map +1 -0
- package/dist/modules/announcements/data/Announcement.d.ts +30 -0
- package/dist/modules/announcements/data/Announcement.d.ts.map +1 -0
- package/dist/modules/{messages/local/CachedMessage.js → announcements/data/Announcement.js} +37 -31
- package/dist/modules/announcements/data/Announcement.js.map +1 -0
- package/dist/modules/announcements/data/AnnouncementAction.d.ts +11 -0
- package/dist/modules/announcements/data/AnnouncementAction.d.ts.map +1 -0
- package/dist/modules/{certificates/data/items/CertificateRoleItem.js → announcements/data/AnnouncementAction.js} +13 -17
- package/dist/modules/announcements/data/AnnouncementAction.js.map +1 -0
- package/dist/modules/backboneNotifications/BackboneNotificationsController.d.ts +13 -0
- package/dist/modules/backboneNotifications/BackboneNotificationsController.d.ts.map +1 -0
- package/dist/modules/backboneNotifications/BackboneNotificationsController.js +42 -0
- package/dist/modules/backboneNotifications/BackboneNotificationsController.js.map +1 -0
- package/dist/modules/backboneNotifications/backbone/BackboneNotificationsClient.d.ts +9 -0
- package/dist/modules/backboneNotifications/backbone/BackboneNotificationsClient.d.ts.map +1 -0
- package/dist/modules/backboneNotifications/backbone/BackboneNotificationsClient.js +11 -0
- package/dist/modules/backboneNotifications/backbone/BackboneNotificationsClient.js.map +1 -0
- package/dist/modules/devices/DeviceController.d.ts +0 -1
- package/dist/modules/devices/DeviceController.d.ts.map +1 -1
- package/dist/modules/devices/DeviceController.js +0 -3
- package/dist/modules/devices/DeviceController.js.map +1 -1
- package/dist/modules/devices/backbone/BackboneGetDevices.d.ts +12 -0
- package/dist/modules/devices/backbone/BackboneGetDevices.d.ts.map +1 -0
- package/dist/modules/devices/backbone/BackboneGetDevices.js +3 -0
- package/dist/modules/devices/backbone/BackboneGetDevices.js.map +1 -0
- package/dist/modules/devices/backbone/DeviceAuthClient.d.ts +2 -0
- package/dist/modules/devices/backbone/DeviceAuthClient.d.ts.map +1 -1
- package/dist/modules/devices/backbone/DeviceAuthClient.js +3 -0
- package/dist/modules/devices/backbone/DeviceAuthClient.js.map +1 -1
- package/dist/modules/devices/local/Device.d.ts +0 -2
- package/dist/modules/devices/local/Device.d.ts.map +1 -1
- package/dist/modules/devices/local/Device.js +0 -6
- package/dist/modules/devices/local/Device.js.map +1 -1
- package/dist/modules/files/FileController.d.ts +8 -10
- package/dist/modules/files/FileController.d.ts.map +1 -1
- package/dist/modules/files/FileController.js +71 -84
- package/dist/modules/files/FileController.js.map +1 -1
- package/dist/modules/files/backbone/BackbonePostFiles.d.ts +1 -0
- package/dist/modules/files/backbone/BackbonePostFiles.d.ts.map +1 -1
- package/dist/modules/files/backbone/FileClient.d.ts +9 -0
- package/dist/modules/files/backbone/FileClient.d.ts.map +1 -1
- package/dist/modules/files/backbone/FileClient.js +9 -0
- package/dist/modules/files/backbone/FileClient.js.map +1 -1
- package/dist/modules/files/local/File.d.ts +57 -11
- package/dist/modules/files/local/File.d.ts.map +1 -1
- package/dist/modules/files/local/File.js +171 -18
- package/dist/modules/files/local/File.js.map +1 -1
- package/dist/modules/index.d.ts +5 -23
- package/dist/modules/index.d.ts.map +1 -1
- package/dist/modules/index.js +5 -23
- package/dist/modules/index.js.map +1 -1
- package/dist/modules/messages/MessageController.d.ts +3 -8
- package/dist/modules/messages/MessageController.d.ts.map +1 -1
- package/dist/modules/messages/MessageController.js +29 -55
- package/dist/modules/messages/MessageController.js.map +1 -1
- package/dist/modules/messages/local/Message.d.ts +28 -7
- package/dist/modules/messages/local/Message.d.ts.map +1 -1
- package/dist/modules/messages/local/Message.js +53 -12
- package/dist/modules/messages/local/Message.js.map +1 -1
- package/dist/modules/messages/local/{CachedMessageRecipient.d.ts → MessageRecipient.d.ts} +4 -4
- package/dist/modules/messages/local/MessageRecipient.d.ts.map +1 -0
- package/dist/modules/messages/local/{CachedMessageRecipient.js → MessageRecipient.js} +12 -12
- package/dist/modules/messages/local/MessageRecipient.js.map +1 -0
- package/dist/modules/messages/transmission/MessageContentWrapper.js +1 -2
- package/dist/modules/messages/transmission/MessageContentWrapper.js.map +1 -1
- package/dist/modules/relationshipTemplates/RelationshipTemplateController.d.ts +3 -11
- package/dist/modules/relationshipTemplates/RelationshipTemplateController.d.ts.map +1 -1
- package/dist/modules/relationshipTemplates/RelationshipTemplateController.js +49 -131
- package/dist/modules/relationshipTemplates/RelationshipTemplateController.js.map +1 -1
- package/dist/modules/relationshipTemplates/local/RelationshipTemplate.d.ts +26 -10
- package/dist/modules/relationshipTemplates/local/RelationshipTemplate.d.ts.map +1 -1
- package/dist/modules/relationshipTemplates/local/RelationshipTemplate.js +70 -19
- package/dist/modules/relationshipTemplates/local/RelationshipTemplate.js.map +1 -1
- package/dist/modules/relationshipTemplates/local/SendRelationshipTemplateParameters.js +2 -2
- package/dist/modules/relationshipTemplates/local/SendRelationshipTemplateParameters.js.map +1 -1
- package/dist/modules/relationships/RelationshipSecretController.d.ts +3 -3
- package/dist/modules/relationships/RelationshipSecretController.d.ts.map +1 -1
- package/dist/modules/relationships/RelationshipSecretController.js +2 -2
- package/dist/modules/relationships/RelationshipSecretController.js.map +1 -1
- package/dist/modules/relationships/RelationshipsController.d.ts +0 -10
- package/dist/modules/relationships/RelationshipsController.d.ts.map +1 -1
- package/dist/modules/relationships/RelationshipsController.js +41 -117
- package/dist/modules/relationships/RelationshipsController.js.map +1 -1
- package/dist/modules/relationships/local/Relationship.d.ts +14 -10
- package/dist/modules/relationships/local/Relationship.d.ts.map +1 -1
- package/dist/modules/relationships/local/Relationship.js +30 -28
- package/dist/modules/relationships/local/Relationship.js.map +1 -1
- package/dist/modules/sync/ChangedItems.d.ts +5 -2
- package/dist/modules/sync/ChangedItems.d.ts.map +1 -1
- package/dist/modules/sync/ChangedItems.js +6 -1
- package/dist/modules/sync/ChangedItems.js.map +1 -1
- package/dist/modules/sync/DatawalletModificationMapper.js +3 -3
- package/dist/modules/sync/DatawalletModificationMapper.js.map +1 -1
- package/dist/modules/sync/DatawalletModificationsProcessor.d.ts +2 -60
- package/dist/modules/sync/DatawalletModificationsProcessor.d.ts.map +1 -1
- package/dist/modules/sync/DatawalletModificationsProcessor.js +11 -158
- package/dist/modules/sync/DatawalletModificationsProcessor.js.map +1 -1
- package/dist/modules/sync/SyncController.d.ts +0 -3
- package/dist/modules/sync/SyncController.d.ts.map +1 -1
- package/dist/modules/sync/SyncController.js +16 -30
- package/dist/modules/sync/SyncController.js.map +1 -1
- package/dist/modules/sync/SynchronizedCollection.d.ts.map +1 -1
- package/dist/modules/sync/SynchronizedCollection.js +24 -10
- package/dist/modules/sync/SynchronizedCollection.js.map +1 -1
- package/dist/modules/sync/backbone/FinalizeSyncRun.d.ts +1 -0
- package/dist/modules/sync/backbone/FinalizeSyncRun.d.ts.map +1 -1
- package/dist/modules/sync/backbone/SyncClient.d.ts +0 -1
- package/dist/modules/sync/backbone/SyncClient.d.ts.map +1 -1
- package/dist/modules/sync/backbone/SyncClient.js.map +1 -1
- package/dist/modules/sync/externalEventProcessors/ExternalEventProcessor.d.ts +2 -1
- package/dist/modules/sync/externalEventProcessors/ExternalEventProcessor.d.ts.map +1 -1
- package/dist/modules/sync/externalEventProcessors/ExternalEventProcessor.js.map +1 -1
- package/dist/modules/sync/externalEventProcessors/ExternalEventProcessorRegistry.d.ts.map +1 -1
- package/dist/modules/sync/externalEventProcessors/ExternalEventProcessorRegistry.js +6 -0
- package/dist/modules/sync/externalEventProcessors/ExternalEventProcessorRegistry.js.map +1 -1
- package/dist/modules/sync/externalEventProcessors/FileOwnershipClaimedExternalEventProcessor.d.ts +7 -0
- package/dist/modules/sync/externalEventProcessors/FileOwnershipClaimedExternalEventProcessor.d.ts.map +1 -0
- package/dist/modules/sync/externalEventProcessors/FileOwnershipClaimedExternalEventProcessor.js +34 -0
- package/dist/modules/sync/externalEventProcessors/FileOwnershipClaimedExternalEventProcessor.js.map +1 -0
- package/dist/modules/sync/externalEventProcessors/FileOwnershipLockedExternalEventProcessor.d.ts +7 -0
- package/dist/modules/sync/externalEventProcessors/FileOwnershipLockedExternalEventProcessor.d.ts.map +1 -0
- package/dist/modules/sync/externalEventProcessors/FileOwnershipLockedExternalEventProcessor.js +37 -0
- package/dist/modules/sync/externalEventProcessors/FileOwnershipLockedExternalEventProcessor.js.map +1 -0
- package/dist/modules/sync/externalEventProcessors/IdentityDeletionProcessStatusChangedExternalEventProcessor.js +1 -1
- package/dist/modules/sync/externalEventProcessors/IdentityDeletionProcessStatusChangedExternalEventProcessor.js.map +1 -1
- package/dist/modules/sync/externalEventProcessors/MessageDeliveredExternalEventProcessor.js +1 -1
- package/dist/modules/sync/externalEventProcessors/MessageDeliveredExternalEventProcessor.js.map +1 -1
- package/dist/modules/sync/externalEventProcessors/RelationshipExternalEventProcessor.js +1 -1
- package/dist/modules/sync/externalEventProcessors/RelationshipExternalEventProcessor.js.map +1 -1
- package/dist/modules/sync/externalEventProcessors/RelationshipTemplateAllocationsExhaustedProcessor.d.ts +6 -0
- package/dist/modules/sync/externalEventProcessors/RelationshipTemplateAllocationsExhaustedProcessor.d.ts.map +1 -0
- package/dist/modules/sync/externalEventProcessors/RelationshipTemplateAllocationsExhaustedProcessor.js +34 -0
- package/dist/modules/sync/externalEventProcessors/RelationshipTemplateAllocationsExhaustedProcessor.js.map +1 -0
- package/dist/modules/sync/local/DatawalletModification.d.ts +2 -2
- package/dist/modules/sync/local/DatawalletModification.d.ts.map +1 -1
- package/dist/modules/sync/local/DatawalletModification.js +1 -1
- package/dist/modules/sync/local/DatawalletModification.js.map +1 -1
- package/dist/modules/sync/migrations/DeviceMigrations.d.ts +2 -2
- package/dist/modules/sync/migrations/DeviceMigrations.d.ts.map +1 -1
- package/dist/modules/sync/migrations/DeviceMigrations.js +5 -15
- package/dist/modules/sync/migrations/DeviceMigrations.js.map +1 -1
- package/dist/modules/tokens/AnonymousTokenController.d.ts +2 -1
- package/dist/modules/tokens/AnonymousTokenController.d.ts.map +1 -1
- package/dist/modules/tokens/AnonymousTokenController.js +4 -9
- package/dist/modules/tokens/AnonymousTokenController.js.map +1 -1
- package/dist/modules/tokens/TokenController.d.ts +3 -11
- package/dist/modules/tokens/TokenController.d.ts.map +1 -1
- package/dist/modules/tokens/TokenController.js +33 -128
- package/dist/modules/tokens/TokenController.js.map +1 -1
- package/dist/modules/tokens/local/Token.d.ts +16 -9
- package/dist/modules/tokens/local/Token.d.ts.map +1 -1
- package/dist/modules/tokens/local/Token.js +40 -18
- package/dist/modules/tokens/local/Token.js.map +1 -1
- package/package.json +17 -19
- package/dist/core/ICacheable.d.ts +0 -6
- package/dist/core/ICacheable.d.ts.map +0 -1
- package/dist/core/ICacheable.js +0 -17
- package/dist/core/ICacheable.js.map +0 -1
- package/dist/modules/accounts/data/CachedIdentityDeletionProcess.d.ts +0 -44
- package/dist/modules/accounts/data/CachedIdentityDeletionProcess.d.ts.map +0 -1
- package/dist/modules/accounts/data/CachedIdentityDeletionProcess.js +0 -80
- package/dist/modules/accounts/data/CachedIdentityDeletionProcess.js.map +0 -1
- package/dist/modules/certificates/CertificateController.d.ts +0 -15
- package/dist/modules/certificates/CertificateController.d.ts.map +0 -1
- package/dist/modules/certificates/CertificateController.js +0 -20
- package/dist/modules/certificates/CertificateController.js.map +0 -1
- package/dist/modules/certificates/CertificateIssuer.d.ts +0 -29
- package/dist/modules/certificates/CertificateIssuer.d.ts.map +0 -1
- package/dist/modules/certificates/CertificateIssuer.js +0 -43
- package/dist/modules/certificates/CertificateIssuer.js.map +0 -1
- package/dist/modules/certificates/CertificateValidator.d.ts +0 -15
- package/dist/modules/certificates/CertificateValidator.d.ts.map +0 -1
- package/dist/modules/certificates/CertificateValidator.js +0 -20
- package/dist/modules/certificates/CertificateValidator.js.map +0 -1
- package/dist/modules/certificates/data/Certificate.d.ts +0 -34
- package/dist/modules/certificates/data/Certificate.d.ts.map +0 -1
- package/dist/modules/certificates/data/Certificate.js +0 -61
- package/dist/modules/certificates/data/Certificate.js.map +0 -1
- package/dist/modules/certificates/data/CertificateConstraint.d.ts +0 -10
- package/dist/modules/certificates/data/CertificateConstraint.d.ts.map +0 -1
- package/dist/modules/certificates/data/CertificateConstraint.js +0 -23
- package/dist/modules/certificates/data/CertificateConstraint.js.map +0 -1
- package/dist/modules/certificates/data/CertificateContent.d.ts +0 -29
- package/dist/modules/certificates/data/CertificateContent.d.ts.map +0 -1
- package/dist/modules/certificates/data/CertificateContent.js +0 -66
- package/dist/modules/certificates/data/CertificateContent.js.map +0 -1
- package/dist/modules/certificates/data/CertificateItem.d.ts +0 -11
- package/dist/modules/certificates/data/CertificateItem.d.ts.map +0 -1
- package/dist/modules/certificates/data/CertificateItem.js +0 -24
- package/dist/modules/certificates/data/CertificateItem.js.map +0 -1
- package/dist/modules/certificates/data/constraints/CertificateBorderConstraint.d.ts +0 -30
- package/dist/modules/certificates/data/constraints/CertificateBorderConstraint.d.ts.map +0 -1
- package/dist/modules/certificates/data/constraints/CertificateBorderConstraint.js +0 -56
- package/dist/modules/certificates/data/constraints/CertificateBorderConstraint.js.map +0 -1
- package/dist/modules/certificates/data/constraints/CertificateCityConstraint.d.ts +0 -32
- package/dist/modules/certificates/data/constraints/CertificateCityConstraint.d.ts.map +0 -1
- package/dist/modules/certificates/data/constraints/CertificateCityConstraint.js +0 -59
- package/dist/modules/certificates/data/constraints/CertificateCityConstraint.js.map +0 -1
- package/dist/modules/certificates/data/constraints/CertificateIdentityConstraint.d.ts +0 -10
- package/dist/modules/certificates/data/constraints/CertificateIdentityConstraint.d.ts.map +0 -1
- package/dist/modules/certificates/data/constraints/CertificateIdentityConstraint.js +0 -30
- package/dist/modules/certificates/data/constraints/CertificateIdentityConstraint.js.map +0 -1
- package/dist/modules/certificates/data/constraints/CertificateTimeConstraint.d.ts +0 -17
- package/dist/modules/certificates/data/constraints/CertificateTimeConstraint.d.ts.map +0 -1
- package/dist/modules/certificates/data/constraints/CertificateTimeConstraint.js +0 -40
- package/dist/modules/certificates/data/constraints/CertificateTimeConstraint.js.map +0 -1
- package/dist/modules/certificates/data/items/CertificateAuthorizationItem.d.ts +0 -18
- package/dist/modules/certificates/data/items/CertificateAuthorizationItem.d.ts.map +0 -1
- package/dist/modules/certificates/data/items/CertificateAuthorizationItem.js +0 -38
- package/dist/modules/certificates/data/items/CertificateAuthorizationItem.js.map +0 -1
- package/dist/modules/certificates/data/items/CertificateDelegateItem.d.ts +0 -19
- package/dist/modules/certificates/data/items/CertificateDelegateItem.d.ts.map +0 -1
- package/dist/modules/certificates/data/items/CertificateDelegateItem.js +0 -45
- package/dist/modules/certificates/data/items/CertificateDelegateItem.js.map +0 -1
- package/dist/modules/certificates/data/items/CertificatePrivateAttributeItem.d.ts +0 -21
- package/dist/modules/certificates/data/items/CertificatePrivateAttributeItem.d.ts.map +0 -1
- package/dist/modules/certificates/data/items/CertificatePrivateAttributeItem.js +0 -41
- package/dist/modules/certificates/data/items/CertificatePrivateAttributeItem.js.map +0 -1
- package/dist/modules/certificates/data/items/CertificatePrivateAttributeItemSource.d.ts +0 -26
- package/dist/modules/certificates/data/items/CertificatePrivateAttributeItemSource.d.ts.map +0 -1
- package/dist/modules/certificates/data/items/CertificatePrivateAttributeItemSource.js +0 -54
- package/dist/modules/certificates/data/items/CertificatePrivateAttributeItemSource.js.map +0 -1
- package/dist/modules/certificates/data/items/CertificatePublicAttributeItem.d.ts +0 -15
- package/dist/modules/certificates/data/items/CertificatePublicAttributeItem.d.ts.map +0 -1
- package/dist/modules/certificates/data/items/CertificatePublicAttributeItem.js +0 -38
- package/dist/modules/certificates/data/items/CertificatePublicAttributeItem.js.map +0 -1
- package/dist/modules/certificates/data/items/CertificateRoleItem.d.ts +0 -17
- package/dist/modules/certificates/data/items/CertificateRoleItem.d.ts.map +0 -1
- package/dist/modules/certificates/data/items/CertificateRoleItem.js.map +0 -1
- package/dist/modules/files/local/CachedFile.d.ts +0 -52
- package/dist/modules/files/local/CachedFile.d.ts.map +0 -1
- package/dist/modules/files/local/CachedFile.js +0 -145
- package/dist/modules/files/local/CachedFile.js.map +0 -1
- package/dist/modules/messages/local/CachedMessage.d.ts +0 -23
- package/dist/modules/messages/local/CachedMessage.d.ts.map +0 -1
- package/dist/modules/messages/local/CachedMessage.js.map +0 -1
- package/dist/modules/messages/local/CachedMessageRecipient.d.ts.map +0 -1
- package/dist/modules/messages/local/CachedMessageRecipient.js.map +0 -1
- package/dist/modules/relationshipTemplates/local/CachedRelationshipTemplate.d.ts +0 -30
- package/dist/modules/relationshipTemplates/local/CachedRelationshipTemplate.d.ts.map +0 -1
- package/dist/modules/relationshipTemplates/local/CachedRelationshipTemplate.js +0 -80
- package/dist/modules/relationshipTemplates/local/CachedRelationshipTemplate.js.map +0 -1
- package/dist/modules/relationships/local/CachedRelationship.d.ts +0 -20
- package/dist/modules/relationships/local/CachedRelationship.d.ts.map +0 -1
- package/dist/modules/relationships/local/CachedRelationship.js +0 -57
- package/dist/modules/relationships/local/CachedRelationship.js.map +0 -1
- package/dist/modules/tokens/local/CachedToken.d.ts +0 -20
- package/dist/modules/tokens/local/CachedToken.d.ts.map +0 -1
- package/dist/modules/tokens/local/CachedToken.js +0 -54
- package/dist/modules/tokens/local/CachedToken.js.map +0 -1
|
@@ -17,9 +17,9 @@ const ts_simple_nameof_1 = require("ts-simple-nameof");
|
|
|
17
17
|
const core_1 = require("../../../core");
|
|
18
18
|
const Identity_1 = require("../../accounts/data/Identity");
|
|
19
19
|
const RelationshipStatus_1 = require("../transmission/RelationshipStatus");
|
|
20
|
-
const CachedRelationship_1 = require("./CachedRelationship");
|
|
21
20
|
const PeerDeletionInfo_1 = require("./PeerDeletionInfo");
|
|
22
21
|
const RelationshipAuditLog_1 = require("./RelationshipAuditLog");
|
|
22
|
+
const RelationshipAuditLogEntry_1 = require("./RelationshipAuditLogEntry");
|
|
23
23
|
let Relationship = Relationship_1 = class Relationship extends core_1.CoreSynchronizable {
|
|
24
24
|
constructor() {
|
|
25
25
|
super(...arguments);
|
|
@@ -29,49 +29,36 @@ let Relationship = Relationship_1 = class Relationship extends core_1.CoreSynchr
|
|
|
29
29
|
(0, ts_simple_nameof_1.nameof)((r) => r.relationshipSecretId),
|
|
30
30
|
(0, ts_simple_nameof_1.nameof)((r) => r.peer),
|
|
31
31
|
(0, ts_simple_nameof_1.nameof)((r) => r.status),
|
|
32
|
-
(0, ts_simple_nameof_1.nameof)((r) => r.peerDeletionInfo)
|
|
32
|
+
(0, ts_simple_nameof_1.nameof)((r) => r.peerDeletionInfo),
|
|
33
|
+
(0, ts_simple_nameof_1.nameof)((r) => r.auditLog)
|
|
34
|
+
];
|
|
35
|
+
this.contentProperties = [
|
|
36
|
+
(0, ts_simple_nameof_1.nameof)((r) => r.templateId),
|
|
37
|
+
(0, ts_simple_nameof_1.nameof)((r) => r.creationContent),
|
|
38
|
+
(0, ts_simple_nameof_1.nameof)((r) => r.lastMessageSentAt),
|
|
39
|
+
(0, ts_simple_nameof_1.nameof)((r) => r.lastMessageReceivedAt)
|
|
33
40
|
];
|
|
34
41
|
this.metadataProperties = [(0, ts_simple_nameof_1.nameof)((r) => r.metadata), (0, ts_simple_nameof_1.nameof)((r) => r.metadataModifiedAt)];
|
|
35
42
|
}
|
|
36
|
-
toJSON(verbose, serializeAsString) {
|
|
37
|
-
const json = super.toJSON(verbose, serializeAsString);
|
|
38
|
-
// Adds flattened peerAddress and templateId to the JSON stored in the database.
|
|
39
|
-
// This helps us to boost the performance of database queries that include these fields.
|
|
40
|
-
json.peerAddress = this.peer.address.toString();
|
|
41
|
-
json.templateId = this.cache?.templateId.toString();
|
|
42
|
-
return json;
|
|
43
|
-
}
|
|
44
43
|
static fromBackboneAndCreationContent(response, peer, creationContent, relationshipSecretId) {
|
|
45
|
-
const cache = CachedRelationship_1.CachedRelationship.from({
|
|
46
|
-
creationContent,
|
|
47
|
-
templateId: core_types_1.CoreId.from(response.relationshipTemplateId),
|
|
48
|
-
auditLog: RelationshipAuditLog_1.RelationshipAuditLog.fromBackboneAuditLog(response.auditLog)
|
|
49
|
-
});
|
|
50
44
|
return Relationship_1.from({
|
|
51
45
|
id: core_types_1.CoreId.from(response.id),
|
|
52
46
|
relationshipSecretId: relationshipSecretId,
|
|
53
47
|
peer: peer,
|
|
54
48
|
status: RelationshipStatus_1.RelationshipStatus.Pending,
|
|
55
|
-
|
|
56
|
-
|
|
49
|
+
creationContent,
|
|
50
|
+
templateId: core_types_1.CoreId.from(response.relationshipTemplateId),
|
|
51
|
+
auditLog: RelationshipAuditLog_1.RelationshipAuditLog.fromBackboneAuditLog(response.auditLog)
|
|
57
52
|
});
|
|
58
53
|
}
|
|
59
54
|
static from(value) {
|
|
60
55
|
return this.fromAny(value);
|
|
61
56
|
}
|
|
62
|
-
setCache(cache) {
|
|
63
|
-
this.cache = cache;
|
|
64
|
-
this.cachedAt = core_types_1.CoreDate.utc();
|
|
65
|
-
return this;
|
|
66
|
-
}
|
|
67
57
|
setMetadata(metadata) {
|
|
68
58
|
this.metadata = metadata;
|
|
69
59
|
this.metadataModifiedAt = core_types_1.CoreDate.utc();
|
|
70
60
|
return this;
|
|
71
61
|
}
|
|
72
|
-
newCacheEmptyError() {
|
|
73
|
-
return new core_1.TransportError(`The cache of the Relationship with id "${this.id}" is empty.`);
|
|
74
|
-
}
|
|
75
62
|
};
|
|
76
63
|
exports.Relationship = Relationship;
|
|
77
64
|
__decorate([
|
|
@@ -94,16 +81,31 @@ __decorate([
|
|
|
94
81
|
(0, ts_serval_1.serialize)(),
|
|
95
82
|
__metadata("design:type", String)
|
|
96
83
|
], Relationship.prototype, "status", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, ts_serval_1.validate)(),
|
|
86
|
+
(0, ts_serval_1.serialize)(),
|
|
87
|
+
__metadata("design:type", core_types_1.CoreId)
|
|
88
|
+
], Relationship.prototype, "templateId", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, ts_serval_1.validate)(),
|
|
91
|
+
(0, ts_serval_1.serialize)(),
|
|
92
|
+
__metadata("design:type", ts_serval_1.Serializable)
|
|
93
|
+
], Relationship.prototype, "creationContent", void 0);
|
|
97
94
|
__decorate([
|
|
98
95
|
(0, ts_serval_1.validate)({ nullable: true }),
|
|
99
96
|
(0, ts_serval_1.serialize)(),
|
|
100
|
-
__metadata("design:type",
|
|
101
|
-
], Relationship.prototype, "
|
|
97
|
+
__metadata("design:type", core_types_1.CoreDate)
|
|
98
|
+
], Relationship.prototype, "lastMessageSentAt", void 0);
|
|
102
99
|
__decorate([
|
|
103
100
|
(0, ts_serval_1.validate)({ nullable: true }),
|
|
104
101
|
(0, ts_serval_1.serialize)(),
|
|
105
102
|
__metadata("design:type", core_types_1.CoreDate)
|
|
106
|
-
], Relationship.prototype, "
|
|
103
|
+
], Relationship.prototype, "lastMessageReceivedAt", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, ts_serval_1.validate)(),
|
|
106
|
+
(0, ts_serval_1.serialize)({ type: RelationshipAuditLogEntry_1.RelationshipAuditLogEntry }),
|
|
107
|
+
__metadata("design:type", Array)
|
|
108
|
+
], Relationship.prototype, "auditLog", void 0);
|
|
107
109
|
__decorate([
|
|
108
110
|
(0, ts_serval_1.validate)({ nullable: true }),
|
|
109
111
|
(0, ts_serval_1.serialize)(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Relationship.js","sourceRoot":"","sources":["../../../../src/modules/relationships/local/Relationship.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"Relationship.js","sourceRoot":"","sources":["../../../../src/modules/relationships/local/Relationship.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,kDAA4F;AAC5F,kDAAyE;AACzE,uDAA0C;AAC1C,wCAAwE;AACxE,2DAAmE;AAEnE,2EAAwE;AACxE,yDAAyE;AACzE,iEAA8D;AAC9D,2EAAoG;AAoB7F,IAAM,YAAY,oBAAlB,MAAM,YAAa,SAAQ,yBAAkB;IAA7C;;QACsB,wBAAmB,GAAG;YAC3C,OAAO;YACP,UAAU;YACV,IAAA,yBAAM,EAAe,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,oBAAoB,CAAC;YACnD,IAAA,yBAAM,EAAe,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;YACnC,IAAA,yBAAM,EAAe,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;YACrC,IAAA,yBAAM,EAAe,CAAC,CAAC,EAAE,EAAE,CAAC,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CAAC;IAC5B,IAAA,qBAAS,GAAE;8BACgB,qBAAQ;wDAAC;uBA9D5B,YAAY;IADxB,IAAA,gBAAI,EAAC,cAAc,CAAC;GACR,YAAY,CA0FxB"}
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import { IdentityDeletionProcess } from "../accounts/data/IdentityDeletionProcess";
|
|
2
|
+
import { File } from "../files/local/File";
|
|
2
3
|
import { Message } from "../messages/local/Message";
|
|
3
4
|
import { Relationship } from "../relationships/local/Relationship";
|
|
4
5
|
export interface IChangedItems {
|
|
5
6
|
relationships: Relationship[];
|
|
6
7
|
messages: Message[];
|
|
7
8
|
identityDeletionProcesses: IdentityDeletionProcess[];
|
|
9
|
+
files: File[];
|
|
8
10
|
}
|
|
9
11
|
export declare class ChangedItems implements IChangedItems {
|
|
10
12
|
readonly relationships: Relationship[];
|
|
11
13
|
readonly messages: Message[];
|
|
12
14
|
readonly identityDeletionProcesses: IdentityDeletionProcess[];
|
|
15
|
+
readonly files: File[];
|
|
13
16
|
readonly changedObjectIdentifiersDuringDatawalletSync: string[];
|
|
14
|
-
constructor(relationships?: Relationship[], messages?: Message[], identityDeletionProcesses?: IdentityDeletionProcess[], changedObjectIdentifiersDuringDatawalletSync?: string[]);
|
|
15
|
-
addItem(item: Relationship | Message | IdentityDeletionProcess): void;
|
|
17
|
+
constructor(relationships?: Relationship[], messages?: Message[], identityDeletionProcesses?: IdentityDeletionProcess[], files?: File[], changedObjectIdentifiersDuringDatawalletSync?: string[]);
|
|
18
|
+
addItem(item: Relationship | Message | IdentityDeletionProcess | File): void;
|
|
16
19
|
addChangedObjectsIdentifiersDuringDatawalletSync(identifiers: string[]): void;
|
|
17
20
|
}
|
|
18
21
|
//# sourceMappingURL=ChangedItems.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChangedItems.d.ts","sourceRoot":"","sources":["../../../src/modules/sync/ChangedItems.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,E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EAAE,GAAG,IAAI;CAGvF"}
|
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ChangedItems = void 0;
|
|
4
4
|
const IdentityDeletionProcess_1 = require("../accounts/data/IdentityDeletionProcess");
|
|
5
|
+
const File_1 = require("../files/local/File");
|
|
5
6
|
const Message_1 = require("../messages/local/Message");
|
|
6
7
|
const Relationship_1 = require("../relationships/local/Relationship");
|
|
7
8
|
class ChangedItems {
|
|
8
|
-
constructor(relationships = [], messages = [], identityDeletionProcesses = [], changedObjectIdentifiersDuringDatawalletSync = []) {
|
|
9
|
+
constructor(relationships = [], messages = [], identityDeletionProcesses = [], files = [], changedObjectIdentifiersDuringDatawalletSync = []) {
|
|
9
10
|
this.relationships = relationships;
|
|
10
11
|
this.messages = messages;
|
|
11
12
|
this.identityDeletionProcesses = identityDeletionProcesses;
|
|
13
|
+
this.files = files;
|
|
12
14
|
this.changedObjectIdentifiersDuringDatawalletSync = changedObjectIdentifiersDuringDatawalletSync;
|
|
13
15
|
}
|
|
14
16
|
addItem(item) {
|
|
@@ -21,6 +23,9 @@ class ChangedItems {
|
|
|
21
23
|
else if (item instanceof IdentityDeletionProcess_1.IdentityDeletionProcess) {
|
|
22
24
|
this.identityDeletionProcesses.push(item);
|
|
23
25
|
}
|
|
26
|
+
else if (item instanceof File_1.File) {
|
|
27
|
+
this.files.push(item);
|
|
28
|
+
}
|
|
24
29
|
}
|
|
25
30
|
addChangedObjectsIdentifiersDuringDatawalletSync(identifiers) {
|
|
26
31
|
this.changedObjectIdentifiersDuringDatawalletSync.push(...identifiers);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChangedItems.js","sourceRoot":"","sources":["../../../src/modules/sync/ChangedItems.ts"],"names":[],"mappings":";;;AAAA,sFAAmF;AACnF,uDAAoD;AACpD,sEAAmE;
|
|
1
|
+
{"version":3,"file":"ChangedItems.js","sourceRoot":"","sources":["../../../src/modules/sync/ChangedItems.ts"],"names":[],"mappings":";;;AAAA,sFAAmF;AACnF,8CAA2C;AAC3C,uDAAoD;AACpD,sEAAmE;AASnE,MAAa,YAAY;IACrB,YACoB,gBAAgC,EAAE,EAClC,WAAsB,EAAE,EACxB,4BAAuD,EAAE,EACzD,QAAgB,EAAE,EAClB,+CAAyD,EAAE;QAJ3D,kBAAa,GAAb,aAAa,CAAqB;QAClC,aAAQ,GAAR,QAAQ,CAAgB;QACxB,8BAAyB,GAAzB,yBAAyB,CAAgC;QACzD,UAAK,GAAL,KAAK,CAAa;QAClB,iDAA4C,GAA5C,4CAA4C,CAAe;IAC5E,CAAC;IAEG,OAAO,CAAC,IAA6D;QACxE,IAAI,IAAI,YAAY,iBAAO,EAAE,CAAC;YAC1B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7B,CAAC;aAAM,IAAI,IAAI,YAAY,2BAAY,EAAE,CAAC;YACtC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClC,CAAC;aAAM,IAAI,IAAI,YAAY,iDAAuB,EAAE,CAAC;YACjD,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9C,CAAC;aAAM,IAAI,IAAI,YAAY,WAAI,EAAE,CAAC;YAC9B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;IACL,CAAC;IAEM,gDAAgD,CAAC,WAAqB;QACzE,IAAI,CAAC,4CAA4C,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,CAAC;IAC3E,CAAC;CACJ;AAxBD,oCAwBC"}
|
|
@@ -17,9 +17,6 @@ class DatawalletModificationMapper {
|
|
|
17
17
|
case "Delete":
|
|
18
18
|
type = DatawalletModification_1.DatawalletModificationType.Delete;
|
|
19
19
|
break;
|
|
20
|
-
case "CacheChanged":
|
|
21
|
-
type = DatawalletModification_1.DatawalletModificationType.CacheChanged;
|
|
22
|
-
break;
|
|
23
20
|
default:
|
|
24
21
|
throw new core_1.TransportError("Unsupported DatawalletModificationType '${backboneDatawalletModification.type}'");
|
|
25
22
|
}
|
|
@@ -28,6 +25,9 @@ class DatawalletModificationMapper {
|
|
|
28
25
|
case "TechnicalData":
|
|
29
26
|
payloadCategory = DatawalletModification_1.DatawalletModificationCategory.TechnicalData;
|
|
30
27
|
break;
|
|
28
|
+
case "Content":
|
|
29
|
+
payloadCategory = DatawalletModification_1.DatawalletModificationCategory.Content;
|
|
30
|
+
break;
|
|
31
31
|
case "Userdata":
|
|
32
32
|
payloadCategory = DatawalletModification_1.DatawalletModificationCategory.Userdata;
|
|
33
33
|
break;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatawalletModificationMapper.js","sourceRoot":"","sources":["../../../src/modules/sync/DatawalletModificationMapper.ts"],"names":[],"mappings":";;;AAAA,kDAA2C;AAC3C,qCAA0D;AAG1D,2EAAoI;AAEpI,MAAa,4BAA4B;IAC9B,MAAM,CAAC,KAAK,CAAC,kCAAkC,CAClD,8BAA8D,EAC9D,gBAAoC,EACpC,iBAAyB;QAEzB,IAAI,IAAgC,CAAC;QAErC,QAAQ,8BAA8B,CAAC,IAAI,EAAE,CAAC;YAC1C,KAAK,QAAQ;gBACT,IAAI,GAAG,mDAA0B,CAAC,MAAM,CAAC;gBACzC,MAAM;YACV,KAAK,QAAQ;gBACT,IAAI,GAAG,mDAA0B,CAAC,MAAM,CAAC;gBACzC,MAAM;YACV,KAAK,QAAQ;gBACT,IAAI,GAAG,mDAA0B,CAAC,MAAM,CAAC;gBACzC,MAAM;YACV
|
|
1
|
+
{"version":3,"file":"DatawalletModificationMapper.js","sourceRoot":"","sources":["../../../src/modules/sync/DatawalletModificationMapper.ts"],"names":[],"mappings":";;;AAAA,kDAA2C;AAC3C,qCAA0D;AAG1D,2EAAoI;AAEpI,MAAa,4BAA4B;IAC9B,MAAM,CAAC,KAAK,CAAC,kCAAkC,C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gBAAgB;YACzB,iBAAiB,EAAE,iBAAiB;SACvC,CAAC,CAAC;IACP,CAAC;IAEM,MAAM,CAAC,0CAA0C,CACpD,sBAA8C,EAC9C,gBAAoC;QAEpC,OAAO;YACH,gBAAgB,EAAE,sBAAsB,CAAC,gBAAgB,CAAC,QAAQ,EAAE;YACpE,eAAe,EAAE,sBAAsB,CAAC,eAAe;YACvD,UAAU,EAAE,sBAAsB,CAAC,UAAU;YAC7C,IAAI,EAAE,sBAAsB,CAAC,IAAI;YACjC,gBAAgB,EAAE,gBAAgB;YAClC,iBAAiB,EAAE,sBAAsB,CAAC,iBAAiB,IAAI,CAAC;SACnE,CAAC;IACN,CAAC;CACJ;AApED,oEAoEC"}
|
|
@@ -1,73 +1,15 @@
|
|
|
1
1
|
import { IDatabaseCollectionProvider } from "@js-soft/docdb-access-abstractions";
|
|
2
2
|
import { ILogger } from "@js-soft/logging-abstractions";
|
|
3
|
-
import { CoreId } from "@nmshd/core-types";
|
|
4
|
-
import { CachedIdentityDeletionProcess } from "../accounts/data/CachedIdentityDeletionProcess";
|
|
5
|
-
import { IdentityDeletionProcessController } from "../accounts/IdentityDeletionProcessController";
|
|
6
|
-
import { FileController } from "../files/FileController";
|
|
7
|
-
import { CachedFile } from "../files/local/CachedFile";
|
|
8
|
-
import { CachedMessage } from "../messages/local/CachedMessage";
|
|
9
|
-
import { MessageController } from "../messages/MessageController";
|
|
10
|
-
import { CachedRelationship } from "../relationships/local/CachedRelationship";
|
|
11
|
-
import { RelationshipsController } from "../relationships/RelationshipsController";
|
|
12
|
-
import { CachedRelationshipTemplate } from "../relationshipTemplates/local/CachedRelationshipTemplate";
|
|
13
|
-
import { RelationshipTemplateController } from "../relationshipTemplates/RelationshipTemplateController";
|
|
14
|
-
import { CachedToken } from "../tokens/local/CachedToken";
|
|
15
|
-
import { TokenController } from "../tokens/TokenController";
|
|
16
3
|
import { DatawalletModification } from "./local/DatawalletModification";
|
|
17
4
|
export declare class DatawalletModificationsProcessor {
|
|
18
|
-
private readonly
|
|
5
|
+
private readonly modifications;
|
|
19
6
|
private readonly collectionProvider;
|
|
20
7
|
private readonly logger;
|
|
21
|
-
private readonly modificationsWithoutCacheChanges;
|
|
22
|
-
private readonly cacheChanges;
|
|
23
8
|
private readonly deletedObjectIdentifiers;
|
|
24
9
|
private readonly _changedObjectIdentifiers;
|
|
25
10
|
get changedObjectIdentifiers(): string[];
|
|
26
11
|
get log(): ILogger;
|
|
27
|
-
constructor(modifications: DatawalletModification[],
|
|
28
|
-
private readonly collectionsWithCacheableItems;
|
|
12
|
+
constructor(modifications: DatawalletModification[], collectionProvider: IDatabaseCollectionProvider, logger: ILogger);
|
|
29
13
|
execute(): Promise<void>;
|
|
30
|
-
private applyModifications;
|
|
31
|
-
/**
|
|
32
|
-
* if a collection contains cacheable items, the cache has to be fetched after the item is created on a new device
|
|
33
|
-
* this can only happen after all creates are applied, because the fetching needs properties like the secret key
|
|
34
|
-
*/
|
|
35
|
-
private simulateCacheChangeForCreate;
|
|
36
|
-
private applyCacheChanges;
|
|
37
|
-
private ensureAllItemsAreCacheable;
|
|
38
|
-
private groupCacheChangesByCollection;
|
|
39
|
-
private saveNewCaches;
|
|
40
14
|
}
|
|
41
|
-
export declare class CacheFetcher {
|
|
42
|
-
private readonly fileController;
|
|
43
|
-
private readonly messageController;
|
|
44
|
-
private readonly relationshipTemplateController;
|
|
45
|
-
private readonly relationshipController;
|
|
46
|
-
private readonly tokenController;
|
|
47
|
-
private readonly identityDeletionProcessController;
|
|
48
|
-
constructor(fileController: FileController, messageController: MessageController, relationshipTemplateController: RelationshipTemplateController, relationshipController: RelationshipsController, tokenController: TokenController, identityDeletionProcessController: IdentityDeletionProcessController);
|
|
49
|
-
fetchCacheFor(input: FetchCacheInput): Promise<FetchCacheOutput>;
|
|
50
|
-
private fetchCaches;
|
|
51
|
-
}
|
|
52
|
-
interface FetchCacheInput {
|
|
53
|
-
files?: CoreId[];
|
|
54
|
-
messages?: CoreId[];
|
|
55
|
-
relationships?: CoreId[];
|
|
56
|
-
relationshipTemplates?: CoreId[];
|
|
57
|
-
tokens?: CoreId[];
|
|
58
|
-
identityDeletionProcesses?: CoreId[];
|
|
59
|
-
}
|
|
60
|
-
interface FetchCacheOutput {
|
|
61
|
-
files: FetchCacheOutputItem<CachedFile>[];
|
|
62
|
-
messages: FetchCacheOutputItem<CachedMessage>[];
|
|
63
|
-
relationships: FetchCacheOutputItem<CachedRelationship>[];
|
|
64
|
-
relationshipTemplates: FetchCacheOutputItem<CachedRelationshipTemplate>[];
|
|
65
|
-
tokens: FetchCacheOutputItem<CachedToken>[];
|
|
66
|
-
identityDeletionProcesses: FetchCacheOutputItem<CachedIdentityDeletionProcess>[];
|
|
67
|
-
}
|
|
68
|
-
interface FetchCacheOutputItem<TCache> {
|
|
69
|
-
id: CoreId;
|
|
70
|
-
cache: TCache;
|
|
71
|
-
}
|
|
72
|
-
export {};
|
|
73
15
|
//# sourceMappingURL=DatawalletModificationsProcessor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatawalletModificationsProcessor.d.ts","sourceRoot":"","sources":["../../../src/modules/sync/DatawalletModificationsProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"DatawalletModificationsProcessor.d.ts","sourceRoot":"","sources":["../../../src/modules/sync/DatawalletModificationsProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAIxD,OAAO,EAAE,sBAAsB,EAA8B,MAAM,gCAAgC,CAAC;AAEpG,qBAAa,gCAAgC;IAarC,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IACnC,OAAO,CAAC,QAAQ,CAAC,MAAM;IAd3B,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAAgB;IAEzD,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAA0B;IACpE,IAAW,wBAAwB,IAAI,MAAM,EAAE,CAE9C;IAED,IAAW,GAAG,IAAI,OAAO,CAExB;gBAGoB,aAAa,EAAE,sBAAsB,EAAE,EACvC,kBAAkB,EAAE,2BAA2B,EAC/C,MAAM,EAAE,OAAO;IAGvB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAqDxC"}
|
|
@@ -1,30 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
14
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.
|
|
6
|
+
exports.DatawalletModificationsProcessor = void 0;
|
|
16
7
|
const ts_serval_1 = require("@js-soft/ts-serval");
|
|
17
|
-
const ts_utils_1 = require("@js-soft/ts-utils");
|
|
18
|
-
const core_types_1 = require("@nmshd/core-types");
|
|
19
8
|
const lodash_1 = __importDefault(require("lodash"));
|
|
20
9
|
const core_1 = require("../../core");
|
|
21
|
-
const DbCollectionName_1 = require("../../core/DbCollectionName");
|
|
22
|
-
const IdentityDeletionProcess_1 = require("../accounts/data/IdentityDeletionProcess");
|
|
23
|
-
const File_1 = require("../files/local/File");
|
|
24
|
-
const Message_1 = require("../messages/local/Message");
|
|
25
|
-
const Relationship_1 = require("../relationships/local/Relationship");
|
|
26
|
-
const RelationshipTemplate_1 = require("../relationshipTemplates/local/RelationshipTemplate");
|
|
27
|
-
const Token_1 = require("../tokens/local/Token");
|
|
28
10
|
const DatawalletModification_1 = require("./local/DatawalletModification");
|
|
29
11
|
class DatawalletModificationsProcessor {
|
|
30
12
|
get changedObjectIdentifiers() {
|
|
@@ -33,29 +15,15 @@ class DatawalletModificationsProcessor {
|
|
|
33
15
|
get log() {
|
|
34
16
|
return this.logger;
|
|
35
17
|
}
|
|
36
|
-
constructor(modifications,
|
|
37
|
-
this.
|
|
18
|
+
constructor(modifications, collectionProvider, logger) {
|
|
19
|
+
this.modifications = modifications;
|
|
38
20
|
this.collectionProvider = collectionProvider;
|
|
39
21
|
this.logger = logger;
|
|
40
22
|
this.deletedObjectIdentifiers = [];
|
|
41
23
|
this._changedObjectIdentifiers = new Set();
|
|
42
|
-
this.collectionsWithCacheableItems = [
|
|
43
|
-
DbCollectionName_1.DbCollectionName.Files,
|
|
44
|
-
DbCollectionName_1.DbCollectionName.Messages,
|
|
45
|
-
DbCollectionName_1.DbCollectionName.Relationships,
|
|
46
|
-
DbCollectionName_1.DbCollectionName.RelationshipTemplates,
|
|
47
|
-
DbCollectionName_1.DbCollectionName.Tokens,
|
|
48
|
-
DbCollectionName_1.DbCollectionName.IdentityDeletionProcess
|
|
49
|
-
];
|
|
50
|
-
this.modificationsWithoutCacheChanges = modifications.filter((m) => m.type !== DatawalletModification_1.DatawalletModificationType.CacheChanged);
|
|
51
|
-
this.cacheChanges = modifications.filter((m) => m.type === DatawalletModification_1.DatawalletModificationType.CacheChanged);
|
|
52
24
|
}
|
|
53
25
|
async execute() {
|
|
54
|
-
|
|
55
|
-
await this.applyCacheChanges();
|
|
56
|
-
}
|
|
57
|
-
async applyModifications() {
|
|
58
|
-
const modificationsGroupedByObjectIdentifier = lodash_1.default.groupBy(this.modificationsWithoutCacheChanges, (m) => m.objectIdentifier);
|
|
26
|
+
const modificationsGroupedByObjectIdentifier = lodash_1.default.groupBy(this.modifications, (m) => m.objectIdentifier);
|
|
59
27
|
for (const objectIdentifier in modificationsGroupedByObjectIdentifier) {
|
|
60
28
|
this._changedObjectIdentifiers.add(objectIdentifier);
|
|
61
29
|
const currentModifications = modificationsGroupedByObjectIdentifier[objectIdentifier];
|
|
@@ -77,8 +45,8 @@ class DatawalletModificationsProcessor {
|
|
|
77
45
|
case DatawalletModification_1.DatawalletModificationType.Delete:
|
|
78
46
|
resultingObject = {};
|
|
79
47
|
break;
|
|
80
|
-
|
|
81
|
-
throw new core_1.TransportError(
|
|
48
|
+
default:
|
|
49
|
+
throw new core_1.TransportError(`${modification.type} modifications are not allowed in this context.`);
|
|
82
50
|
}
|
|
83
51
|
}
|
|
84
52
|
const oldDoc = await targetCollection.read(objectIdentifier);
|
|
@@ -89,129 +57,14 @@ class DatawalletModificationsProcessor {
|
|
|
89
57
|
...resultingObject
|
|
90
58
|
};
|
|
91
59
|
await targetCollection.update(oldDoc, newObject);
|
|
60
|
+
continue;
|
|
92
61
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
...resultingObject
|
|
98
|
-
});
|
|
99
|
-
}
|
|
62
|
+
await targetCollection.create({
|
|
63
|
+
id: objectIdentifier,
|
|
64
|
+
...resultingObject
|
|
65
|
+
});
|
|
100
66
|
}
|
|
101
67
|
}
|
|
102
|
-
/**
|
|
103
|
-
* if a collection contains cacheable items, the cache has to be fetched after the item is created on a new device
|
|
104
|
-
* this can only happen after all creates are applied, because the fetching needs properties like the secret key
|
|
105
|
-
*/
|
|
106
|
-
async simulateCacheChangeForCreate(targetCollectionName, objectIdentifier) {
|
|
107
|
-
if (!this.collectionsWithCacheableItems.includes(targetCollectionName))
|
|
108
|
-
return;
|
|
109
|
-
const modification = DatawalletModification_1.DatawalletModification.from({
|
|
110
|
-
localId: await core_1.TransportIds.datawalletModification.generate(),
|
|
111
|
-
type: DatawalletModification_1.DatawalletModificationType.CacheChanged,
|
|
112
|
-
collection: targetCollectionName,
|
|
113
|
-
objectIdentifier: core_types_1.CoreId.from(objectIdentifier)
|
|
114
|
-
});
|
|
115
|
-
this.cacheChanges.push(modification);
|
|
116
|
-
}
|
|
117
|
-
async applyCacheChanges() {
|
|
118
|
-
if (this.cacheChanges.length === 0) {
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
this.ensureAllItemsAreCacheable();
|
|
122
|
-
const cacheChangesWithoutDeletes = this.cacheChanges.filter((c) => !this.deletedObjectIdentifiers.some((d) => c.objectIdentifier.equals(d)));
|
|
123
|
-
for (const objectIdentifier of cacheChangesWithoutDeletes.map((c) => c.objectIdentifier.toString())) {
|
|
124
|
-
this._changedObjectIdentifiers.add(objectIdentifier);
|
|
125
|
-
}
|
|
126
|
-
const cacheChangesGroupedByCollection = this.groupCacheChangesByCollection(cacheChangesWithoutDeletes);
|
|
127
|
-
const caches = await this.cacheFetcher.fetchCacheFor({
|
|
128
|
-
files: cacheChangesGroupedByCollection.fileIds,
|
|
129
|
-
relationshipTemplates: cacheChangesGroupedByCollection.relationshipTemplateIds,
|
|
130
|
-
tokens: cacheChangesGroupedByCollection.tokenIds,
|
|
131
|
-
identityDeletionProcesses: cacheChangesGroupedByCollection.identityDeletionProcessIds
|
|
132
|
-
});
|
|
133
|
-
await this.saveNewCaches(caches.files, DbCollectionName_1.DbCollectionName.Files, File_1.File);
|
|
134
|
-
await this.saveNewCaches(caches.relationshipTemplates, DbCollectionName_1.DbCollectionName.RelationshipTemplates, RelationshipTemplate_1.RelationshipTemplate);
|
|
135
|
-
await this.saveNewCaches(caches.tokens, DbCollectionName_1.DbCollectionName.Tokens, Token_1.Token);
|
|
136
|
-
await this.saveNewCaches(caches.identityDeletionProcesses, DbCollectionName_1.DbCollectionName.IdentityDeletionProcess, IdentityDeletionProcess_1.IdentityDeletionProcess);
|
|
137
|
-
// Need to fetch the cache for relationships after the cache for relationship templates was fetched, because when building the relationship cache, the cache of thecorresponding relationship template is needed
|
|
138
|
-
const relationshipCaches = await this.cacheFetcher.fetchCacheFor({ relationships: cacheChangesGroupedByCollection.relationshipIds });
|
|
139
|
-
await this.saveNewCaches(relationshipCaches.relationships, DbCollectionName_1.DbCollectionName.Relationships, Relationship_1.Relationship);
|
|
140
|
-
// Need to fetch the cache for messages after the cache for relationships was fetched, because when building the message cache, the cache of thecorresponding relationship is needed
|
|
141
|
-
const messageCaches = await this.cacheFetcher.fetchCacheFor({ messages: cacheChangesGroupedByCollection.messageIds });
|
|
142
|
-
await this.saveNewCaches(messageCaches.messages, DbCollectionName_1.DbCollectionName.Messages, Message_1.Message);
|
|
143
|
-
}
|
|
144
|
-
ensureAllItemsAreCacheable() {
|
|
145
|
-
const collections = this.cacheChanges.map((c) => c.collection);
|
|
146
|
-
const uniqueCollections = [...new Set(collections)];
|
|
147
|
-
const collectionsWithUncacheableItems = uniqueCollections.filter((c) => !this.collectionsWithCacheableItems.includes(c));
|
|
148
|
-
if (collectionsWithUncacheableItems.length > 0) {
|
|
149
|
-
throw core_1.TransportCoreErrors.datawallet.unsupportedModification(`The following collections were received in CacheChanged datawallet modifications but are not supported by the current version of this library: '${collectionsWithUncacheableItems.join(", ")}'.`);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
groupCacheChangesByCollection(cacheChanges) {
|
|
153
|
-
const groups = lodash_1.default.groupBy(cacheChanges, (c) => c.collection);
|
|
154
|
-
const fileIds = (groups[DbCollectionName_1.DbCollectionName.Files] ?? []).map((m) => m.objectIdentifier);
|
|
155
|
-
const messageIds = (groups[DbCollectionName_1.DbCollectionName.Messages] ?? []).map((m) => m.objectIdentifier);
|
|
156
|
-
const relationshipIds = (groups[DbCollectionName_1.DbCollectionName.Relationships] ?? []).map((m) => m.objectIdentifier);
|
|
157
|
-
const relationshipTemplateIds = (groups[DbCollectionName_1.DbCollectionName.RelationshipTemplates] ?? []).map((m) => m.objectIdentifier);
|
|
158
|
-
const tokenIds = (groups[DbCollectionName_1.DbCollectionName.Tokens] ?? []).map((m) => m.objectIdentifier);
|
|
159
|
-
const identityDeletionProcessIds = (groups[DbCollectionName_1.DbCollectionName.IdentityDeletionProcess] ?? []).map((m) => m.objectIdentifier);
|
|
160
|
-
return { fileIds, messageIds, relationshipTemplateIds, tokenIds, relationshipIds, identityDeletionProcessIds };
|
|
161
|
-
}
|
|
162
|
-
async saveNewCaches(caches, collectionName, constructorOfT) {
|
|
163
|
-
if (caches.length === 0)
|
|
164
|
-
return;
|
|
165
|
-
const collection = await this.collectionProvider.getCollection(collectionName);
|
|
166
|
-
await Promise.all(caches.map(async (c) => {
|
|
167
|
-
const itemDoc = await collection.read(c.id.toString());
|
|
168
|
-
const item = constructorOfT.from(itemDoc);
|
|
169
|
-
item.setCache(c.cache);
|
|
170
|
-
await collection.update(itemDoc, item);
|
|
171
|
-
}));
|
|
172
|
-
}
|
|
173
68
|
}
|
|
174
69
|
exports.DatawalletModificationsProcessor = DatawalletModificationsProcessor;
|
|
175
|
-
__decorate([
|
|
176
|
-
(0, ts_utils_1.log)(),
|
|
177
|
-
__metadata("design:type", Function),
|
|
178
|
-
__metadata("design:paramtypes", []),
|
|
179
|
-
__metadata("design:returntype", void 0)
|
|
180
|
-
], DatawalletModificationsProcessor.prototype, "ensureAllItemsAreCacheable", null);
|
|
181
|
-
class CacheFetcher {
|
|
182
|
-
constructor(fileController, messageController, relationshipTemplateController, relationshipController, tokenController, identityDeletionProcessController) {
|
|
183
|
-
this.fileController = fileController;
|
|
184
|
-
this.messageController = messageController;
|
|
185
|
-
this.relationshipTemplateController = relationshipTemplateController;
|
|
186
|
-
this.relationshipController = relationshipController;
|
|
187
|
-
this.tokenController = tokenController;
|
|
188
|
-
this.identityDeletionProcessController = identityDeletionProcessController;
|
|
189
|
-
}
|
|
190
|
-
async fetchCacheFor(input) {
|
|
191
|
-
const caches = await Promise.all([
|
|
192
|
-
this.fetchCaches(this.fileController, input.files),
|
|
193
|
-
this.fetchCaches(this.messageController, input.messages),
|
|
194
|
-
this.fetchCaches(this.relationshipController, input.relationships),
|
|
195
|
-
this.fetchCaches(this.relationshipTemplateController, input.relationshipTemplates),
|
|
196
|
-
this.fetchCaches(this.tokenController, input.tokens),
|
|
197
|
-
this.fetchCaches(this.identityDeletionProcessController, input.identityDeletionProcesses)
|
|
198
|
-
]);
|
|
199
|
-
const output = {
|
|
200
|
-
files: caches[0],
|
|
201
|
-
messages: caches[1],
|
|
202
|
-
relationships: caches[2],
|
|
203
|
-
relationshipTemplates: caches[3],
|
|
204
|
-
tokens: caches[4],
|
|
205
|
-
identityDeletionProcesses: caches[5]
|
|
206
|
-
};
|
|
207
|
-
return output;
|
|
208
|
-
}
|
|
209
|
-
async fetchCaches(controller, ids) {
|
|
210
|
-
if (!ids)
|
|
211
|
-
return [];
|
|
212
|
-
const caches = await controller.fetchCaches(ids);
|
|
213
|
-
return caches;
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
exports.CacheFetcher = CacheFetcher;
|
|
217
70
|
//# sourceMappingURL=DatawalletModificationsProcessor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatawalletModificationsProcessor.js","sourceRoot":"","sources":["../../../src/modules/sync/DatawalletModificationsProcessor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DatawalletModificationsProcessor.js","sourceRoot":"","sources":["../../../src/modules/sync/DatawalletModificationsProcessor.ts"],"names":[],"mappings":";;;;;;AAEA,kDAAkD;AAClD,oDAAuB;AACvB,qCAA4C;AAC5C,2EAAoG;AAEpG,MAAa,gCAAgC;IAIzC,IAAW,wBAAwB;QAC/B,OAAO,KAAK,CAAC,IA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AK,MAAM,YAAY,IAAI,oBAAoB,EAAE,CAAC;gBAC9C,QAAQ,YAAY,CAAC,IAAI,EAAE,CAAC;oBACxB,KAAK,mDAA0B,CAAC,MAAM,CAAC;oBACvC,KAAK,mDAA0B,CAAC,MAAM;wBAClC,eAAe,GAAG,EAAE,GAAG,eAAe,EAAE,GAAG,YAAY,CAAC,OAAO,EAAE,CAAC;wBAClE,MAAM;oBACV,KAAK,mDAA0B,CAAC,MAAM;wBAClC,eAAe,GAAG,EAAE,CAAC;wBACrB,MAAM;oBACV;wBACI,MAAM,IAAI,qBAAc,CAAC,GAAG,YAAY,CAAC,IAAI,iDAAiD,CAAC,CAAC;gBACxG,CAAC;YACL,CAAC;YAED,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;YAC7D,IAAI,MAAM,EAAE,CAAC;gBACT,MAAM,SAAS,GAAG,wBAAY,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;gBAEnD,MAAM,SAAS,GAAG;oBACd,GAAG,SAAS,CAAC,MAAM,EAAE;oBACrB,GAAG,eAAe;iBACrB,CAAC;gBAEF,MAAM,gBAAgB,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;gBACjD,SAAS;YACb,CAAC;YAED,MAAM,gBAAgB,CAAC,MAAM,CAAC;gBAC1B,EAAE,EAAE,gBAAgB;gBACpB,GAAG,eAAe;aACrB,CAAC,CAAC;QACP,CAAC;IACL,CAAC;CACJ;AAvED,4EAuEC"}
|
|
@@ -13,8 +13,6 @@ export declare class SyncController extends TransportController {
|
|
|
13
13
|
private readonly deviceMigrations;
|
|
14
14
|
private readonly identityMigrations;
|
|
15
15
|
private readonly externalEventRegistry;
|
|
16
|
-
private _cacheFetcher?;
|
|
17
|
-
private get cacheFetcher();
|
|
18
16
|
constructor(parent: AccountController, dependencyOverrides: DependencyOverrides, unpushedDatawalletModifications: IDatabaseCollection, datawalletEnabled: boolean);
|
|
19
17
|
init(): Promise<SyncController>;
|
|
20
18
|
private currentSync?;
|
|
@@ -28,7 +26,6 @@ export declare class SyncController extends TransportController {
|
|
|
28
26
|
private upgradeIdentityDatawalletVersion;
|
|
29
27
|
private upgradeDeviceDatawalletVersion;
|
|
30
28
|
private applyIncomingDatawalletModifications;
|
|
31
|
-
private promiseAllWithProgess;
|
|
32
29
|
private decryptDatawalletModifications;
|
|
33
30
|
private decryptDatawalletModification;
|
|
34
31
|
private pushLocalDatawalletModifications;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SyncController.d.ts","sourceRoot":"","sources":["../../../src/modules/sync/SyncController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAgB,MAAM,oCAAoC,CAAC;AAEvF,OAAO,EAAE,QAAQ,EAAqB,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAgC,mBAAmB,EAA+D,MAAM,YAAY,CAAC;AAC5I,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAErE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAa1C,qBAAa,cAAe,SAAQ,mBAAmB;
|
|
1
|
+
{"version":3,"file":"SyncController.d.ts","sourceRoot":"","sources":["../../../src/modules/sync/SyncController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAgB,MAAM,oCAAoC,CAAC;AAEvF,OAAO,EAAE,QAAQ,EAAqB,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAgC,mBAAmB,EAA+D,MAAM,YAAY,CAAC;AAC5I,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAErE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9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