@wireapp/core 37.5.0 → 38.0.0-beta
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/package.json +9 -8
- package/LICENSE +0 -674
- package/lib/Account.d.ts +0 -213
- package/lib/Account.d.ts.map +0 -1
- package/lib/Account.js +0 -543
- package/lib/CoreError.d.ts +0 -10
- package/lib/CoreError.d.ts.map +0 -1
- package/lib/CoreError.js +0 -25
- package/lib/account/AccountService.d.ts +0 -8
- package/lib/account/AccountService.d.ts.map +0 -1
- package/lib/account/AccountService.js +0 -32
- package/lib/account/index.d.ts +0 -2
- package/lib/account/index.d.ts.map +0 -1
- package/lib/account/index.js +0 -35
- package/lib/auth/LoginSanitizer.d.ts +0 -6
- package/lib/auth/LoginSanitizer.d.ts.map +0 -1
- package/lib/auth/LoginSanitizer.js +0 -40
- package/lib/auth/index.d.ts +0 -2
- package/lib/auth/index.d.ts.map +0 -1
- package/lib/auth/index.js +0 -35
- package/lib/broadcast/AvailabilityType.d.ts +0 -3
- package/lib/broadcast/AvailabilityType.d.ts.map +0 -1
- package/lib/broadcast/AvailabilityType.js +0 -20
- package/lib/broadcast/BroadcastService.d.ts +0 -21
- package/lib/broadcast/BroadcastService.d.ts.map +0 -1
- package/lib/broadcast/BroadcastService.js +0 -77
- package/lib/broadcast/index.d.ts +0 -3
- package/lib/broadcast/index.d.ts.map +0 -1
- package/lib/broadcast/index.js +0 -36
- package/lib/client/ClientBackendRepository.d.ts +0 -12
- package/lib/client/ClientBackendRepository.d.ts.map +0 -1
- package/lib/client/ClientBackendRepository.js +0 -42
- package/lib/client/ClientDatabaseRepository.d.ts +0 -28
- package/lib/client/ClientDatabaseRepository.d.ts.map +0 -1
- package/lib/client/ClientDatabaseRepository.js +0 -84
- package/lib/client/ClientInfo.d.ts +0 -9
- package/lib/client/ClientInfo.d.ts.map +0 -1
- package/lib/client/ClientInfo.js +0 -20
- package/lib/client/ClientService.d.ts +0 -41
- package/lib/client/ClientService.d.ts.map +0 -1
- package/lib/client/ClientService.js +0 -102
- package/lib/client/index.d.ts +0 -5
- package/lib/client/index.d.ts.map +0 -1
- package/lib/client/index.js +0 -38
- package/lib/connection/ConnectionService.d.ts +0 -12
- package/lib/connection/ConnectionService.d.ts.map +0 -1
- package/lib/connection/ConnectionService.js +0 -44
- package/lib/connection/index.d.ts +0 -2
- package/lib/connection/index.d.ts.map +0 -1
- package/lib/connection/index.js +0 -35
- package/lib/conversation/AbortReason.d.ts +0 -3
- package/lib/conversation/AbortReason.d.ts.map +0 -1
- package/lib/conversation/AbortReason.js +0 -20
- package/lib/conversation/AssetService/AssetService.d.ts +0 -66
- package/lib/conversation/AssetService/AssetService.d.ts.map +0 -1
- package/lib/conversation/AssetService/AssetService.js +0 -87
- package/lib/conversation/AssetService/index.d.ts +0 -2
- package/lib/conversation/AssetService/index.d.ts.map +0 -1
- package/lib/conversation/AssetService/index.js +0 -35
- package/lib/conversation/AssetTransferState.d.ts +0 -5
- package/lib/conversation/AssetTransferState.d.ts.map +0 -1
- package/lib/conversation/AssetTransferState.js +0 -26
- package/lib/conversation/ClientActionType.d.ts +0 -2
- package/lib/conversation/ClientActionType.d.ts.map +0 -1
- package/lib/conversation/ClientActionType.js +0 -23
- package/lib/conversation/ConversationMapper/ConversationMapper.d.ts +0 -8
- package/lib/conversation/ConversationMapper/ConversationMapper.d.ts.map +0 -1
- package/lib/conversation/ConversationMapper/ConversationMapper.js +0 -57
- package/lib/conversation/ConversationService/ConversationService.d.ts +0 -98
- package/lib/conversation/ConversationService/ConversationService.d.ts.map +0 -1
- package/lib/conversation/ConversationService/ConversationService.js +0 -316
- package/lib/conversation/ConversationService/ConversationService.types.d.ts +0 -95
- package/lib/conversation/ConversationService/ConversationService.types.d.ts.map +0 -1
- package/lib/conversation/ConversationService/ConversationService.types.js +0 -27
- package/lib/conversation/ConversationService/Utility/getConversationQualifiedMembers.d.ts +0 -9
- package/lib/conversation/ConversationService/Utility/getConversationQualifiedMembers.d.ts.map +0 -1
- package/lib/conversation/ConversationService/Utility/getConversationQualifiedMembers.js +0 -34
- package/lib/conversation/ConversationService/index.d.ts +0 -3
- package/lib/conversation/ConversationService/index.d.ts.map +0 -1
- package/lib/conversation/ConversationService/index.js +0 -36
- package/lib/conversation/GenericMessageType.d.ts +0 -26
- package/lib/conversation/GenericMessageType.d.ts.map +0 -1
- package/lib/conversation/GenericMessageType.js +0 -48
- package/lib/conversation/MessageTimer/MessageTimer.d.ts +0 -11
- package/lib/conversation/MessageTimer/MessageTimer.d.ts.map +0 -1
- package/lib/conversation/MessageTimer/MessageTimer.js +0 -53
- package/lib/conversation/MessageTimer/index.d.ts +0 -2
- package/lib/conversation/MessageTimer/index.d.ts.map +0 -1
- package/lib/conversation/MessageTimer/index.js +0 -35
- package/lib/conversation/ReactionType.d.ts +0 -5
- package/lib/conversation/ReactionType.d.ts.map +0 -1
- package/lib/conversation/ReactionType.js +0 -26
- package/lib/conversation/content/AssetContent.d.ts +0 -43
- package/lib/conversation/content/AssetContent.d.ts.map +0 -1
- package/lib/conversation/content/AssetContent.js +0 -20
- package/lib/conversation/content/ButtonActionConfirmationContent.d.ts +0 -3
- package/lib/conversation/content/ButtonActionConfirmationContent.d.ts.map +0 -1
- package/lib/conversation/content/ButtonActionConfirmationContent.js +0 -20
- package/lib/conversation/content/ButtonActionContent.d.ts +0 -3
- package/lib/conversation/content/ButtonActionContent.d.ts.map +0 -1
- package/lib/conversation/content/ButtonActionContent.js +0 -20
- package/lib/conversation/content/CallingContent.d.ts +0 -2
- package/lib/conversation/content/CallingContent.d.ts.map +0 -1
- package/lib/conversation/content/CallingContent.js +0 -20
- package/lib/conversation/content/ClearedContent.d.ts +0 -3
- package/lib/conversation/content/ClearedContent.d.ts.map +0 -1
- package/lib/conversation/content/ClearedContent.js +0 -20
- package/lib/conversation/content/ClientActionContent.d.ts +0 -3
- package/lib/conversation/content/ClientActionContent.d.ts.map +0 -1
- package/lib/conversation/content/ClientActionContent.js +0 -20
- package/lib/conversation/content/ClientAddContent.d.ts +0 -5
- package/lib/conversation/content/ClientAddContent.d.ts.map +0 -1
- package/lib/conversation/content/ClientAddContent.js +0 -20
- package/lib/conversation/content/ClientRemoveContent.d.ts +0 -7
- package/lib/conversation/content/ClientRemoveContent.d.ts.map +0 -1
- package/lib/conversation/content/ClientRemoveContent.js +0 -20
- package/lib/conversation/content/CompositeContent.d.ts +0 -3
- package/lib/conversation/content/CompositeContent.d.ts.map +0 -1
- package/lib/conversation/content/CompositeContent.js +0 -20
- package/lib/conversation/content/ConfirmationContent.d.ts +0 -3
- package/lib/conversation/content/ConfirmationContent.d.ts.map +0 -1
- package/lib/conversation/content/ConfirmationContent.js +0 -20
- package/lib/conversation/content/ContentType.d.ts +0 -22
- package/lib/conversation/content/ContentType.d.ts.map +0 -1
- package/lib/conversation/content/ContentType.js +0 -93
- package/lib/conversation/content/ConversationContent.d.ts +0 -4
- package/lib/conversation/content/ConversationContent.d.ts.map +0 -1
- package/lib/conversation/content/ConversationContent.js +0 -20
- package/lib/conversation/content/DeletedContent.d.ts +0 -3
- package/lib/conversation/content/DeletedContent.d.ts.map +0 -1
- package/lib/conversation/content/DeletedContent.js +0 -20
- package/lib/conversation/content/EditedTextContent.d.ts +0 -12
- package/lib/conversation/content/EditedTextContent.d.ts.map +0 -1
- package/lib/conversation/content/EditedTextContent.js +0 -20
- package/lib/conversation/content/FileContent.d.ts +0 -14
- package/lib/conversation/content/FileContent.d.ts.map +0 -1
- package/lib/conversation/content/FileContent.js +0 -20
- package/lib/conversation/content/HiddenContent.d.ts +0 -3
- package/lib/conversation/content/HiddenContent.d.ts.map +0 -1
- package/lib/conversation/content/HiddenContent.js +0 -20
- package/lib/conversation/content/ImageContent.d.ts +0 -8
- package/lib/conversation/content/ImageContent.d.ts.map +0 -1
- package/lib/conversation/content/ImageContent.js +0 -20
- package/lib/conversation/content/KnockContent.d.ts +0 -3
- package/lib/conversation/content/KnockContent.d.ts.map +0 -1
- package/lib/conversation/content/KnockContent.js +0 -20
- package/lib/conversation/content/LinkPreviewContent.d.ts +0 -11
- package/lib/conversation/content/LinkPreviewContent.d.ts.map +0 -1
- package/lib/conversation/content/LinkPreviewContent.js +0 -20
- package/lib/conversation/content/LocationContent.d.ts +0 -10
- package/lib/conversation/content/LocationContent.d.ts.map +0 -1
- package/lib/conversation/content/LocationContent.js +0 -20
- package/lib/conversation/content/MentionContent.d.ts +0 -3
- package/lib/conversation/content/MentionContent.d.ts.map +0 -1
- package/lib/conversation/content/MentionContent.js +0 -20
- package/lib/conversation/content/QuoteContent.d.ts +0 -8
- package/lib/conversation/content/QuoteContent.d.ts.map +0 -1
- package/lib/conversation/content/QuoteContent.js +0 -20
- package/lib/conversation/content/ReactionContent.d.ts +0 -8
- package/lib/conversation/content/ReactionContent.d.ts.map +0 -1
- package/lib/conversation/content/ReactionContent.js +0 -20
- package/lib/conversation/content/TextContent.d.ts +0 -10
- package/lib/conversation/content/TextContent.d.ts.map +0 -1
- package/lib/conversation/content/TextContent.js +0 -20
- package/lib/conversation/content/TweetContent.d.ts +0 -3
- package/lib/conversation/content/TweetContent.d.ts.map +0 -1
- package/lib/conversation/content/TweetContent.js +0 -20
- package/lib/conversation/content/index.d.ts +0 -29
- package/lib/conversation/content/index.d.ts.map +0 -1
- package/lib/conversation/content/index.js +0 -75
- package/lib/conversation/index.d.ts +0 -11
- package/lib/conversation/index.d.ts.map +0 -1
- package/lib/conversation/index.js +0 -44
- package/lib/conversation/message/Message.d.ts +0 -5
- package/lib/conversation/message/Message.d.ts.map +0 -1
- package/lib/conversation/message/Message.js +0 -20
- package/lib/conversation/message/Message.types.d.ts +0 -7
- package/lib/conversation/message/Message.types.d.ts.map +0 -1
- package/lib/conversation/message/Message.types.js +0 -28
- package/lib/conversation/message/MessageBuilder.d.ts +0 -26
- package/lib/conversation/message/MessageBuilder.d.ts.map +0 -1
- package/lib/conversation/message/MessageBuilder.js +0 -291
- package/lib/conversation/message/MessageService.d.ts +0 -68
- package/lib/conversation/message/MessageService.d.ts.map +0 -1
- package/lib/conversation/message/MessageService.js +0 -291
- package/lib/conversation/message/MessageToProtoMapper.d.ts +0 -7
- package/lib/conversation/message/MessageToProtoMapper.d.ts.map +0 -1
- package/lib/conversation/message/MessageToProtoMapper.js +0 -98
- package/lib/conversation/message/OtrMessage.d.ts +0 -81
- package/lib/conversation/message/OtrMessage.d.ts.map +0 -1
- package/lib/conversation/message/OtrMessage.js +0 -20
- package/lib/conversation/message/PayloadBundle.d.ts +0 -68
- package/lib/conversation/message/PayloadBundle.d.ts.map +0 -1
- package/lib/conversation/message/PayloadBundle.js +0 -67
- package/lib/conversation/message/TeamMessage.d.ts +0 -32
- package/lib/conversation/message/TeamMessage.d.ts.map +0 -1
- package/lib/conversation/message/TeamMessage.js +0 -20
- package/lib/conversation/message/TextContentBuilder.d.ts +0 -12
- package/lib/conversation/message/TextContentBuilder.d.ts.map +0 -1
- package/lib/conversation/message/TextContentBuilder.js +0 -61
- package/lib/conversation/message/UserClientsUtil.d.ts +0 -23
- package/lib/conversation/message/UserClientsUtil.d.ts.map +0 -1
- package/lib/conversation/message/UserClientsUtil.js +0 -37
- package/lib/conversation/message/UserMessage.d.ts +0 -44
- package/lib/conversation/message/UserMessage.d.ts.map +0 -1
- package/lib/conversation/message/UserMessage.js +0 -20
- package/lib/conversation/message/index.d.ts +0 -2
- package/lib/conversation/message/index.d.ts.map +0 -1
- package/lib/conversation/message/index.js +0 -35
- package/lib/conversation/message/messageSender.d.ts +0 -7
- package/lib/conversation/message/messageSender.d.ts.map +0 -1
- package/lib/conversation/message/messageSender.js +0 -43
- package/lib/cryptography/AssetCryptography/EncryptedAsset.d.ts +0 -12
- package/lib/cryptography/AssetCryptography/EncryptedAsset.d.ts.map +0 -1
- package/lib/cryptography/AssetCryptography/EncryptedAsset.js +0 -20
- package/lib/cryptography/AssetCryptography/crypto.browser.d.ts +0 -3
- package/lib/cryptography/AssetCryptography/crypto.browser.d.ts.map +0 -1
- package/lib/cryptography/AssetCryptography/crypto.browser.js +0 -45
- package/lib/cryptography/AssetCryptography/crypto.node.d.ts +0 -3
- package/lib/cryptography/AssetCryptography/crypto.node.d.ts.map +0 -1
- package/lib/cryptography/AssetCryptography/crypto.node.js +0 -71
- package/lib/cryptography/AssetCryptography/index.d.ts +0 -9
- package/lib/cryptography/AssetCryptography/index.d.ts.map +0 -1
- package/lib/cryptography/AssetCryptography/index.js +0 -52
- package/lib/cryptography/AssetCryptography/interfaces.d.ts +0 -10
- package/lib/cryptography/AssetCryptography/interfaces.d.ts.map +0 -1
- package/lib/cryptography/AssetCryptography/interfaces.js +0 -20
- package/lib/cryptography/CryptographyDatabaseRepository.d.ts +0 -16
- package/lib/cryptography/CryptographyDatabaseRepository.d.ts.map +0 -1
- package/lib/cryptography/CryptographyDatabaseRepository.js +0 -42
- package/lib/cryptography/CryptographyService.d.ts +0 -77
- package/lib/cryptography/CryptographyService.d.ts.map +0 -1
- package/lib/cryptography/CryptographyService.js +0 -222
- package/lib/cryptography/GenericMessageMapper.d.ts +0 -8
- package/lib/cryptography/GenericMessageMapper.d.ts.map +0 -1
- package/lib/cryptography/GenericMessageMapper.js +0 -159
- package/lib/cryptography/MessageHashService.d.ts +0 -17
- package/lib/cryptography/MessageHashService.d.ts.map +0 -1
- package/lib/cryptography/MessageHashService.js +0 -117
- package/lib/cryptography/SessionPayloadBundle.d.ts +0 -5
- package/lib/cryptography/SessionPayloadBundle.d.ts.map +0 -1
- package/lib/cryptography/SessionPayloadBundle.js +0 -20
- package/lib/cryptography/Utlility/generateDecryptionError.d.ts +0 -6
- package/lib/cryptography/Utlility/generateDecryptionError.d.ts.map +0 -1
- package/lib/cryptography/Utlility/generateDecryptionError.js +0 -50
- package/lib/cryptography/index.d.ts +0 -5
- package/lib/cryptography/index.d.ts.map +0 -1
- package/lib/cryptography/index.js +0 -38
- package/lib/errors/DecryptionError.d.ts +0 -6
- package/lib/errors/DecryptionError.d.ts.map +0 -1
- package/lib/errors/DecryptionError.js +0 -29
- package/lib/giphy/GiphyService.d.ts +0 -10
- package/lib/giphy/GiphyService.d.ts.map +0 -1
- package/lib/giphy/GiphyService.js +0 -36
- package/lib/giphy/index.d.ts +0 -2
- package/lib/giphy/index.d.ts.map +0 -1
- package/lib/giphy/index.js +0 -35
- package/lib/index.d.ts +0 -8
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -54
- package/lib/linkPreview/LinkPreviewService.d.ts +0 -8
- package/lib/linkPreview/LinkPreviewService.d.ts.map +0 -1
- package/lib/linkPreview/LinkPreviewService.js +0 -51
- package/lib/linkPreview/index.d.ts +0 -2
- package/lib/linkPreview/index.d.ts.map +0 -1
- package/lib/linkPreview/index.js +0 -35
- package/lib/messagingProtocols/common.types.d.ts +0 -3
- package/lib/messagingProtocols/common.types.d.ts.map +0 -1
- package/lib/messagingProtocols/common.types.js +0 -20
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/ConversationEvent.d.ts +0 -5
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/ConversationEvent.d.ts.map +0 -1
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/ConversationEvent.js +0 -37
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/events/index.d.ts +0 -3
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/events/index.d.ts.map +0 -1
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/events/index.js +0 -36
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/events/messageAdd/index.d.ts +0 -2
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/events/messageAdd/index.d.ts.map +0 -1
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/events/messageAdd/index.js +0 -35
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/events/messageAdd/messageAdd.d.ts +0 -12
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/events/messageAdd/messageAdd.d.ts.map +0 -1
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/events/messageAdd/messageAdd.js +0 -62
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/events/welcomeMessage/index.d.ts +0 -2
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/events/welcomeMessage/index.d.ts.map +0 -1
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/events/welcomeMessage/index.js +0 -35
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/events/welcomeMessage/welcomeMessage.d.ts +0 -10
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/events/welcomeMessage/welcomeMessage.d.ts.map +0 -1
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/events/welcomeMessage/welcomeMessage.js +0 -36
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/index.d.ts +0 -2
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/index.d.ts.map +0 -1
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/index.js +0 -35
- package/lib/messagingProtocols/mls/EventHandler/EventHandler.d.ts +0 -5
- package/lib/messagingProtocols/mls/EventHandler/EventHandler.d.ts.map +0 -1
- package/lib/messagingProtocols/mls/EventHandler/EventHandler.js +0 -24
- package/lib/messagingProtocols/mls/EventHandler/EventHandler.types.d.ts +0 -11
- package/lib/messagingProtocols/mls/EventHandler/EventHandler.types.d.ts.map +0 -1
- package/lib/messagingProtocols/mls/EventHandler/EventHandler.types.js +0 -20
- package/lib/messagingProtocols/mls/EventHandler/index.d.ts +0 -3
- package/lib/messagingProtocols/mls/EventHandler/index.d.ts.map +0 -1
- package/lib/messagingProtocols/mls/EventHandler/index.js +0 -36
- package/lib/messagingProtocols/mls/MLSService/MLSService.d.ts +0 -126
- package/lib/messagingProtocols/mls/MLSService/MLSService.d.ts.map +0 -1
- package/lib/messagingProtocols/mls/MLSService/MLSService.js +0 -428
- package/lib/messagingProtocols/mls/MLSService/MLSService.types.d.ts +0 -16
- package/lib/messagingProtocols/mls/MLSService/MLSService.types.d.ts.map +0 -1
- package/lib/messagingProtocols/mls/MLSService/MLSService.types.js +0 -20
- package/lib/messagingProtocols/mls/MLSService/commitBundleUtil.d.ts +0 -8
- package/lib/messagingProtocols/mls/MLSService/commitBundleUtil.d.ts.map +0 -1
- package/lib/messagingProtocols/mls/MLSService/commitBundleUtil.js +0 -50
- package/lib/messagingProtocols/mls/MLSService/index.d.ts +0 -2
- package/lib/messagingProtocols/mls/MLSService/index.d.ts.map +0 -1
- package/lib/messagingProtocols/mls/MLSService/index.js +0 -35
- package/lib/messagingProtocols/mls/MLSService/stores/keyMaterialUpdatesStore/index.d.ts +0 -2
- package/lib/messagingProtocols/mls/MLSService/stores/keyMaterialUpdatesStore/index.d.ts.map +0 -1
- package/lib/messagingProtocols/mls/MLSService/stores/keyMaterialUpdatesStore/index.js +0 -35
- package/lib/messagingProtocols/mls/MLSService/stores/keyMaterialUpdatesStore/keyMaterialUpdatesStore.d.ts +0 -11
- package/lib/messagingProtocols/mls/MLSService/stores/keyMaterialUpdatesStore/keyMaterialUpdatesStore.d.ts.map +0 -1
- package/lib/messagingProtocols/mls/MLSService/stores/keyMaterialUpdatesStore/keyMaterialUpdatesStore.js +0 -50
- package/lib/messagingProtocols/mls/MLSService/stores/pendingProposalsStore/index.d.ts +0 -2
- package/lib/messagingProtocols/mls/MLSService/stores/pendingProposalsStore/index.d.ts.map +0 -1
- package/lib/messagingProtocols/mls/MLSService/stores/pendingProposalsStore/index.js +0 -35
- package/lib/messagingProtocols/mls/MLSService/stores/pendingProposalsStore/pendingProposalsStore.d.ts +0 -10
- package/lib/messagingProtocols/mls/MLSService/stores/pendingProposalsStore/pendingProposalsStore.d.ts.map +0 -1
- package/lib/messagingProtocols/mls/MLSService/stores/pendingProposalsStore/pendingProposalsStore.js +0 -50
- package/lib/messagingProtocols/mls/MLSService/stores/stores.mock.d.ts +0 -9
- package/lib/messagingProtocols/mls/MLSService/stores/stores.mock.d.ts.map +0 -1
- package/lib/messagingProtocols/mls/MLSService/stores/stores.mock.js +0 -43
- package/lib/messagingProtocols/mls/index.d.ts +0 -2
- package/lib/messagingProtocols/mls/index.d.ts.map +0 -1
- package/lib/messagingProtocols/mls/index.js +0 -35
- package/lib/messagingProtocols/mls/types.d.ts +0 -55
- package/lib/messagingProtocols/mls/types.d.ts.map +0 -1
- package/lib/messagingProtocols/mls/types.js +0 -20
- package/lib/messagingProtocols/proteus/EventHandler/ConversationEvent/ConversationEvent.d.ts +0 -5
- package/lib/messagingProtocols/proteus/EventHandler/ConversationEvent/ConversationEvent.d.ts.map +0 -1
- package/lib/messagingProtocols/proteus/EventHandler/ConversationEvent/ConversationEvent.js +0 -29
- package/lib/messagingProtocols/proteus/EventHandler/ConversationEvent/events/index.d.ts +0 -2
- package/lib/messagingProtocols/proteus/EventHandler/ConversationEvent/events/index.d.ts.map +0 -1
- package/lib/messagingProtocols/proteus/EventHandler/ConversationEvent/events/index.js +0 -35
- package/lib/messagingProtocols/proteus/EventHandler/ConversationEvent/events/otrMessageAdd/index.d.ts +0 -2
- package/lib/messagingProtocols/proteus/EventHandler/ConversationEvent/events/otrMessageAdd/index.d.ts.map +0 -1
- package/lib/messagingProtocols/proteus/EventHandler/ConversationEvent/events/otrMessageAdd/index.js +0 -35
- package/lib/messagingProtocols/proteus/EventHandler/ConversationEvent/events/otrMessageAdd/otrMessageAdd.d.ts +0 -10
- package/lib/messagingProtocols/proteus/EventHandler/ConversationEvent/events/otrMessageAdd/otrMessageAdd.d.ts.map +0 -1
- package/lib/messagingProtocols/proteus/EventHandler/ConversationEvent/events/otrMessageAdd/otrMessageAdd.js +0 -46
- package/lib/messagingProtocols/proteus/EventHandler/ConversationEvent/index.d.ts +0 -2
- package/lib/messagingProtocols/proteus/EventHandler/ConversationEvent/index.d.ts.map +0 -1
- package/lib/messagingProtocols/proteus/EventHandler/ConversationEvent/index.js +0 -35
- package/lib/messagingProtocols/proteus/EventHandler/EventHandler.d.ts +0 -5
- package/lib/messagingProtocols/proteus/EventHandler/EventHandler.d.ts.map +0 -1
- package/lib/messagingProtocols/proteus/EventHandler/EventHandler.js +0 -24
- package/lib/messagingProtocols/proteus/EventHandler/EventHandler.types.d.ts +0 -11
- package/lib/messagingProtocols/proteus/EventHandler/EventHandler.types.d.ts.map +0 -1
- package/lib/messagingProtocols/proteus/EventHandler/EventHandler.types.js +0 -20
- package/lib/messagingProtocols/proteus/EventHandler/index.d.ts +0 -3
- package/lib/messagingProtocols/proteus/EventHandler/index.d.ts.map +0 -1
- package/lib/messagingProtocols/proteus/EventHandler/index.js +0 -36
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.d.ts +0 -20
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.d.ts.map +0 -1
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.js +0 -93
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.types.d.ts +0 -25
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.types.d.ts.map +0 -1
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.types.js +0 -20
- package/lib/messagingProtocols/proteus/ProteusService/Utility/PreKeyBundle.d.ts +0 -24
- package/lib/messagingProtocols/proteus/ProteusService/Utility/PreKeyBundle.d.ts.map +0 -1
- package/lib/messagingProtocols/proteus/ProteusService/Utility/PreKeyBundle.js +0 -86
- package/lib/messagingProtocols/proteus/ProteusService/Utility/Recipients.d.ts +0 -17
- package/lib/messagingProtocols/proteus/ProteusService/Utility/Recipients.d.ts.map +0 -1
- package/lib/messagingProtocols/proteus/ProteusService/Utility/Recipients.js +0 -43
- package/lib/messagingProtocols/proteus/ProteusService/Utility/UserIds.d.ts +0 -12
- package/lib/messagingProtocols/proteus/ProteusService/Utility/UserIds.d.ts.map +0 -1
- package/lib/messagingProtocols/proteus/ProteusService/Utility/UserIds.js +0 -38
- package/lib/messagingProtocols/proteus/ProteusService/Utility/getGenericMessageParams.d.ts +0 -35
- package/lib/messagingProtocols/proteus/ProteusService/Utility/getGenericMessageParams.d.ts.map +0 -1
- package/lib/messagingProtocols/proteus/ProteusService/Utility/getGenericMessageParams.js +0 -87
- package/lib/messagingProtocols/proteus/ProteusService/Utility/index.d.ts +0 -6
- package/lib/messagingProtocols/proteus/ProteusService/Utility/index.d.ts.map +0 -1
- package/lib/messagingProtocols/proteus/ProteusService/Utility/index.js +0 -39
- package/lib/messagingProtocols/proteus/ProteusService/Utility/isClearFromMismatch.d.ts +0 -4
- package/lib/messagingProtocols/proteus/ProteusService/Utility/isClearFromMismatch.d.ts.map +0 -1
- package/lib/messagingProtocols/proteus/ProteusService/Utility/isClearFromMismatch.js +0 -29
- package/lib/messagingProtocols/proteus/ProteusService/index.d.ts +0 -4
- package/lib/messagingProtocols/proteus/ProteusService/index.d.ts.map +0 -1
- package/lib/messagingProtocols/proteus/ProteusService/index.js +0 -37
- package/lib/messagingProtocols/proteus/index.d.ts +0 -2
- package/lib/messagingProtocols/proteus/index.d.ts.map +0 -1
- package/lib/messagingProtocols/proteus/index.js +0 -35
- package/lib/notification/NotificationBackendRepository.d.ts +0 -12
- package/lib/notification/NotificationBackendRepository.d.ts.map +0 -1
- package/lib/notification/NotificationBackendRepository.js +0 -33
- package/lib/notification/NotificationDatabaseRepository.d.ts +0 -21
- package/lib/notification/NotificationDatabaseRepository.d.ts.map +0 -1
- package/lib/notification/NotificationDatabaseRepository.js +0 -67
- package/lib/notification/NotificationService.d.ts +0 -70
- package/lib/notification/NotificationService.d.ts.map +0 -1
- package/lib/notification/NotificationService.js +0 -224
- package/lib/notification/Notifications.types.d.ts +0 -6
- package/lib/notification/Notifications.types.d.ts.map +0 -1
- package/lib/notification/Notifications.types.js +0 -27
- package/lib/notification/index.d.ts +0 -3
- package/lib/notification/index.d.ts.map +0 -1
- package/lib/notification/index.js +0 -36
- package/lib/self/SelfService.d.ts +0 -14
- package/lib/self/SelfService.d.ts.map +0 -1
- package/lib/self/SelfService.js +0 -54
- package/lib/self/index.d.ts +0 -2
- package/lib/self/index.d.ts.map +0 -1
- package/lib/self/index.js +0 -35
- package/lib/team/TeamService.d.ts +0 -16
- package/lib/team/TeamService.d.ts.map +0 -1
- package/lib/team/TeamService.js +0 -54
- package/lib/team/index.d.ts +0 -2
- package/lib/team/index.d.ts.map +0 -1
- package/lib/team/index.js +0 -35
- package/lib/user/UserMapper.d.ts +0 -7
- package/lib/user/UserMapper.d.ts.map +0 -1
- package/lib/user/UserMapper.js +0 -87
- package/lib/user/UserService.d.ts +0 -24
- package/lib/user/UserService.d.ts.map +0 -1
- package/lib/user/UserService.js +0 -81
- package/lib/user/index.d.ts +0 -2
- package/lib/user/index.d.ts.map +0 -1
- package/lib/user/index.js +0 -35
- package/lib/util/LowPrecisionTaskScheduler/LowPrecisionTaskScheduler.d.ts +0 -22
- package/lib/util/LowPrecisionTaskScheduler/LowPrecisionTaskScheduler.d.ts.map +0 -1
- package/lib/util/LowPrecisionTaskScheduler/LowPrecisionTaskScheduler.js +0 -66
- package/lib/util/LowPrecisionTaskScheduler/index.d.ts +0 -2
- package/lib/util/LowPrecisionTaskScheduler/index.d.ts.map +0 -1
- package/lib/util/LowPrecisionTaskScheduler/index.js +0 -35
- package/lib/util/RecurringTaskScheduler/RecurringTaskScheduler.d.ts +0 -9
- package/lib/util/RecurringTaskScheduler/RecurringTaskScheduler.d.ts.map +0 -1
- package/lib/util/RecurringTaskScheduler/RecurringTaskScheduler.js +0 -52
- package/lib/util/RecurringTaskScheduler/RecurringTaskScheduler.store.d.ts +0 -4
- package/lib/util/RecurringTaskScheduler/RecurringTaskScheduler.store.d.ts.map +0 -1
- package/lib/util/RecurringTaskScheduler/RecurringTaskScheduler.store.js +0 -34
- package/lib/util/RecurringTaskScheduler/index.d.ts +0 -2
- package/lib/util/RecurringTaskScheduler/index.d.ts.map +0 -1
- package/lib/util/RecurringTaskScheduler/index.js +0 -35
- package/lib/util/TaskScheduler/TaskScheduler.d.ts +0 -11
- package/lib/util/TaskScheduler/TaskScheduler.d.ts.map +0 -1
- package/lib/util/TaskScheduler/TaskScheduler.js +0 -70
- package/lib/util/TaskScheduler/index.d.ts +0 -2
- package/lib/util/TaskScheduler/index.d.ts.map +0 -1
- package/lib/util/TaskScheduler/index.js +0 -35
- package/lib/util/TypePredicateUtil.d.ts +0 -10
- package/lib/util/TypePredicateUtil.d.ts.map +0 -1
- package/lib/util/TypePredicateUtil.js +0 -60
- package/lib/util/encryptedStore.d.ts +0 -46
- package/lib/util/encryptedStore.d.ts.map +0 -1
- package/lib/util/encryptedStore.js +0 -115
- package/lib/util/encryptedStore.test.node.d.ts +0 -2
- package/lib/util/encryptedStore.test.node.d.ts.map +0 -1
- package/lib/util/encryptedStore.test.node.js +0 -53
- package/lib/util/fullyQualifiedClientIdUtils.d.ts +0 -14
- package/lib/util/fullyQualifiedClientIdUtils.d.ts.map +0 -1
- package/lib/util/fullyQualifiedClientIdUtils.js +0 -41
- package/lib/util/index.d.ts +0 -2
- package/lib/util/index.d.ts.map +0 -1
- package/lib/util/index.js +0 -35
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Wire
|
|
4
|
-
* Copyright (C) 2022 Wire Swiss GmbH
|
|
5
|
-
*
|
|
6
|
-
* This program is free software: you can redistribute it and/or modify
|
|
7
|
-
* it under the terms of the GNU General Public License as published by
|
|
8
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
9
|
-
* (at your option) any later version.
|
|
10
|
-
*
|
|
11
|
-
* This program is distributed in the hope that it will be useful,
|
|
12
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
* GNU General Public License for more details.
|
|
15
|
-
*
|
|
16
|
-
* You should have received a copy of the GNU General Public License
|
|
17
|
-
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
23
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
24
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
25
|
-
}
|
|
26
|
-
Object.defineProperty(o, k2, desc);
|
|
27
|
-
}) : (function(o, m, k, k2) {
|
|
28
|
-
if (k2 === undefined) k2 = k;
|
|
29
|
-
o[k2] = m[k];
|
|
30
|
-
}));
|
|
31
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
32
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
33
|
-
};
|
|
34
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
__exportStar(require("./PreKeyBundle"), exports);
|
|
36
|
-
__exportStar(require("../../../../conversation/ConversationService/Utility/getConversationQualifiedMembers"), exports);
|
|
37
|
-
__exportStar(require("./UserIds"), exports);
|
|
38
|
-
__exportStar(require("./Recipients"), exports);
|
|
39
|
-
__exportStar(require("./isClearFromMismatch"), exports);
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ClientMismatch, MessageSendingStatus } from '@wireapp/api-client/lib/conversation';
|
|
2
|
-
declare const isClearFromMismatch: (mismatch: ClientMismatch | MessageSendingStatus) => boolean;
|
|
3
|
-
export { isClearFromMismatch };
|
|
4
|
-
//# sourceMappingURL=isClearFromMismatch.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isClearFromMismatch.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/proteus/ProteusService/Utility/isClearFromMismatch.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,cAAc,EAAE,oBAAoB,EAAC,MAAM,sCAAsC,CAAC;AAE1F,QAAA,MAAM,mBAAmB,aAAc,cAAc,GAAG,oBAAoB,KAAG,OAM9E,CAAC;AAEF,OAAO,EAAC,mBAAmB,EAAC,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Wire
|
|
4
|
-
* Copyright (C) 2022 Wire Swiss GmbH
|
|
5
|
-
*
|
|
6
|
-
* This program is free software: you can redistribute it and/or modify
|
|
7
|
-
* it under the terms of the GNU General Public License as published by
|
|
8
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
9
|
-
* (at your option) any later version.
|
|
10
|
-
*
|
|
11
|
-
* This program is distributed in the hope that it will be useful,
|
|
12
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
* GNU General Public License for more details.
|
|
15
|
-
*
|
|
16
|
-
* You should have received a copy of the GNU General Public License
|
|
17
|
-
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.isClearFromMismatch = void 0;
|
|
22
|
-
const isClearFromMismatch = (mismatch) => {
|
|
23
|
-
const hasMissing = Object.keys(mismatch.missing || {}).length > 0;
|
|
24
|
-
const hasDeleted = Object.keys(mismatch.deleted || {}).length > 0;
|
|
25
|
-
const hasRedundant = Object.keys(mismatch.redundant || {}).length > 0;
|
|
26
|
-
const hasFailed = Object.keys(mismatch.failed_to_send || {}).length > 0;
|
|
27
|
-
return !hasMissing && !hasDeleted && !hasRedundant && !hasFailed;
|
|
28
|
-
};
|
|
29
|
-
exports.isClearFromMismatch = isClearFromMismatch;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/proteus/ProteusService/index.ts"],"names":[],"mappings":"AAmBA,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,mCAAmC,CAAC"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Wire
|
|
4
|
-
* Copyright (C) 2022 Wire Swiss GmbH
|
|
5
|
-
*
|
|
6
|
-
* This program is free software: you can redistribute it and/or modify
|
|
7
|
-
* it under the terms of the GNU General Public License as published by
|
|
8
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
9
|
-
* (at your option) any later version.
|
|
10
|
-
*
|
|
11
|
-
* This program is distributed in the hope that it will be useful,
|
|
12
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
* GNU General Public License for more details.
|
|
15
|
-
*
|
|
16
|
-
* You should have received a copy of the GNU General Public License
|
|
17
|
-
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
23
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
24
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
25
|
-
}
|
|
26
|
-
Object.defineProperty(o, k2, desc);
|
|
27
|
-
}) : (function(o, m, k, k2) {
|
|
28
|
-
if (k2 === undefined) k2 = k;
|
|
29
|
-
o[k2] = m[k];
|
|
30
|
-
}));
|
|
31
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
32
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
33
|
-
};
|
|
34
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
__exportStar(require("./ProteusService"), exports);
|
|
36
|
-
__exportStar(require("./Utility"), exports);
|
|
37
|
-
__exportStar(require("./Utility/getGenericMessageParams"), exports);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/messagingProtocols/proteus/index.ts"],"names":[],"mappings":"AAmBA,cAAc,kBAAkB,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Wire
|
|
4
|
-
* Copyright (C) 2022 Wire Swiss GmbH
|
|
5
|
-
*
|
|
6
|
-
* This program is free software: you can redistribute it and/or modify
|
|
7
|
-
* it under the terms of the GNU General Public License as published by
|
|
8
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
9
|
-
* (at your option) any later version.
|
|
10
|
-
*
|
|
11
|
-
* This program is distributed in the hope that it will be useful,
|
|
12
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
* GNU General Public License for more details.
|
|
15
|
-
*
|
|
16
|
-
* You should have received a copy of the GNU General Public License
|
|
17
|
-
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
23
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
24
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
25
|
-
}
|
|
26
|
-
Object.defineProperty(o, k2, desc);
|
|
27
|
-
}) : (function(o, m, k, k2) {
|
|
28
|
-
if (k2 === undefined) k2 = k;
|
|
29
|
-
o[k2] = m[k];
|
|
30
|
-
}));
|
|
31
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
32
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
33
|
-
};
|
|
34
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
__exportStar(require("./ProteusService"), exports);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Notification } from '@wireapp/api-client/lib/notification/';
|
|
2
|
-
import { APIClient } from '@wireapp/api-client';
|
|
3
|
-
export declare class NotificationBackendRepository {
|
|
4
|
-
private readonly apiClient;
|
|
5
|
-
constructor(apiClient: APIClient);
|
|
6
|
-
getAllNotifications(clientId?: string, lastNotificationId?: string): Promise<{
|
|
7
|
-
notifications: Notification[];
|
|
8
|
-
missedNotification?: string | undefined;
|
|
9
|
-
}>;
|
|
10
|
-
getLastNotification(clientId?: string): Promise<Notification>;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=NotificationBackendRepository.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationBackendRepository.d.ts","sourceRoot":"","sources":["../../src/notification/NotificationBackendRepository.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,YAAY,EAAC,MAAM,uCAAuC,CAAC;AAEnE,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAE9C,qBAAa,6BAA6B;IAC5B,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,SAAS;IAEpC,mBAAmB,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM;;;;IAIxE,mBAAmB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;CAGrE"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Wire
|
|
4
|
-
* Copyright (C) 2018 Wire Swiss GmbH
|
|
5
|
-
*
|
|
6
|
-
* This program is free software: you can redistribute it and/or modify
|
|
7
|
-
* it under the terms of the GNU General Public License as published by
|
|
8
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
9
|
-
* (at your option) any later version.
|
|
10
|
-
*
|
|
11
|
-
* This program is distributed in the hope that it will be useful,
|
|
12
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
* GNU General Public License for more details.
|
|
15
|
-
*
|
|
16
|
-
* You should have received a copy of the GNU General Public License
|
|
17
|
-
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.NotificationBackendRepository = void 0;
|
|
22
|
-
class NotificationBackendRepository {
|
|
23
|
-
constructor(apiClient) {
|
|
24
|
-
this.apiClient = apiClient;
|
|
25
|
-
}
|
|
26
|
-
async getAllNotifications(clientId, lastNotificationId) {
|
|
27
|
-
return this.apiClient.api.notification.getAllNotifications(clientId, lastNotificationId);
|
|
28
|
-
}
|
|
29
|
-
getLastNotification(clientId) {
|
|
30
|
-
return this.apiClient.api.notification.getLastNotification(clientId);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.NotificationBackendRepository = NotificationBackendRepository;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { BackendEvent } from '@wireapp/api-client/lib/event';
|
|
2
|
-
import { Notification } from '@wireapp/api-client/lib/notification/';
|
|
3
|
-
import { CRUDEngine } from '@wireapp/store-engine';
|
|
4
|
-
export declare enum DatabaseStores {
|
|
5
|
-
EVENTS = "events"
|
|
6
|
-
}
|
|
7
|
-
export declare enum DatabaseKeys {
|
|
8
|
-
PRIMARY_KEY_LAST_EVENT = "z.storage.StorageKey.EVENT.LAST_DATE",
|
|
9
|
-
PRIMARY_KEY_LAST_NOTIFICATION = "z.storage.StorageKey.NOTIFICATION.LAST_ID"
|
|
10
|
-
}
|
|
11
|
-
export declare class NotificationDatabaseRepository {
|
|
12
|
-
private readonly storeEngine;
|
|
13
|
-
constructor(storeEngine: CRUDEngine);
|
|
14
|
-
getNotificationEventList(): Promise<BackendEvent[]>;
|
|
15
|
-
getLastEventDate(): Promise<Date>;
|
|
16
|
-
updateLastEventDate(eventDate: Date): Promise<Date>;
|
|
17
|
-
createLastEventDate(eventDate: Date): Promise<Date>;
|
|
18
|
-
getLastNotificationId(): Promise<string>;
|
|
19
|
-
updateLastNotificationId(lastNotification: Notification): Promise<string>;
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=NotificationDatabaseRepository.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationDatabaseRepository.d.ts","sourceRoot":"","sources":["../../src/notification/NotificationDatabaseRepository.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,YAAY,EAAC,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAC,YAAY,EAAC,MAAM,uCAAuC,CAAC;AAEnE,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AAIjD,oBAAY,cAAc;IACxB,MAAM,WAAW;CAClB;AAED,oBAAY,YAAY;IACtB,sBAAsB,yCAAyC;IAC/D,6BAA6B,8CAA8C;CAC5E;AAMD,qBAAa,8BAA8B;IAC7B,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAAX,WAAW,EAAE,UAAU;IAE7C,wBAAwB;IAIlB,gBAAgB;IAOhB,mBAAmB,CAAC,SAAS,EAAE,IAAI;IAOnC,mBAAmB,CAAC,SAAS,EAAE,IAAI;IAOnC,qBAAqB;IAOrB,wBAAwB,CAAC,gBAAgB,EAAE,YAAY;CAMrE"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Wire
|
|
4
|
-
* Copyright (C) 2018 Wire Swiss GmbH
|
|
5
|
-
*
|
|
6
|
-
* This program is free software: you can redistribute it and/or modify
|
|
7
|
-
* it under the terms of the GNU General Public License as published by
|
|
8
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
9
|
-
* (at your option) any later version.
|
|
10
|
-
*
|
|
11
|
-
* This program is distributed in the hope that it will be useful,
|
|
12
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
* GNU General Public License for more details.
|
|
15
|
-
*
|
|
16
|
-
* You should have received a copy of the GNU General Public License
|
|
17
|
-
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.NotificationDatabaseRepository = exports.DatabaseKeys = exports.DatabaseStores = void 0;
|
|
22
|
-
const CryptographyDatabaseRepository_1 = require("../cryptography/CryptographyDatabaseRepository");
|
|
23
|
-
var DatabaseStores;
|
|
24
|
-
(function (DatabaseStores) {
|
|
25
|
-
DatabaseStores["EVENTS"] = "events";
|
|
26
|
-
})(DatabaseStores = exports.DatabaseStores || (exports.DatabaseStores = {}));
|
|
27
|
-
var DatabaseKeys;
|
|
28
|
-
(function (DatabaseKeys) {
|
|
29
|
-
DatabaseKeys["PRIMARY_KEY_LAST_EVENT"] = "z.storage.StorageKey.EVENT.LAST_DATE";
|
|
30
|
-
DatabaseKeys["PRIMARY_KEY_LAST_NOTIFICATION"] = "z.storage.StorageKey.NOTIFICATION.LAST_ID";
|
|
31
|
-
})(DatabaseKeys = exports.DatabaseKeys || (exports.DatabaseKeys = {}));
|
|
32
|
-
const STORES = Object.assign({}, CryptographyDatabaseRepository_1.CryptographyDatabaseRepository.STORES);
|
|
33
|
-
class NotificationDatabaseRepository {
|
|
34
|
-
constructor(storeEngine) {
|
|
35
|
-
this.storeEngine = storeEngine;
|
|
36
|
-
}
|
|
37
|
-
getNotificationEventList() {
|
|
38
|
-
return this.storeEngine.readAll(DatabaseStores.EVENTS);
|
|
39
|
-
}
|
|
40
|
-
async getLastEventDate() {
|
|
41
|
-
const { value } = await this.storeEngine.read(STORES.AMPLIFY, DatabaseKeys.PRIMARY_KEY_LAST_EVENT);
|
|
42
|
-
return new Date(value);
|
|
43
|
-
}
|
|
44
|
-
async updateLastEventDate(eventDate) {
|
|
45
|
-
await this.storeEngine.update(STORES.AMPLIFY, DatabaseKeys.PRIMARY_KEY_LAST_EVENT, {
|
|
46
|
-
value: eventDate.toISOString(),
|
|
47
|
-
});
|
|
48
|
-
return eventDate;
|
|
49
|
-
}
|
|
50
|
-
async createLastEventDate(eventDate) {
|
|
51
|
-
await this.storeEngine.create(STORES.AMPLIFY, DatabaseKeys.PRIMARY_KEY_LAST_EVENT, {
|
|
52
|
-
value: eventDate.toISOString(),
|
|
53
|
-
});
|
|
54
|
-
return eventDate;
|
|
55
|
-
}
|
|
56
|
-
async getLastNotificationId() {
|
|
57
|
-
const { value } = await this.storeEngine.read(STORES.AMPLIFY, DatabaseKeys.PRIMARY_KEY_LAST_NOTIFICATION);
|
|
58
|
-
return value;
|
|
59
|
-
}
|
|
60
|
-
async updateLastNotificationId(lastNotification) {
|
|
61
|
-
await this.storeEngine.updateOrCreate(STORES.AMPLIFY, DatabaseKeys.PRIMARY_KEY_LAST_NOTIFICATION, {
|
|
62
|
-
value: lastNotification.id,
|
|
63
|
-
});
|
|
64
|
-
return lastNotification.id;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
exports.NotificationDatabaseRepository = NotificationDatabaseRepository;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { BackendEvent } from '@wireapp/api-client/lib/event';
|
|
3
|
-
import { Notification } from '@wireapp/api-client/lib/notification/';
|
|
4
|
-
import { AbortHandler } from '@wireapp/api-client/lib/tcp';
|
|
5
|
-
import { EventEmitter } from 'events';
|
|
6
|
-
import { APIClient } from '@wireapp/api-client';
|
|
7
|
-
import { GenericMessage } from '@wireapp/protocol-messaging';
|
|
8
|
-
import { CRUDEngine } from '@wireapp/store-engine';
|
|
9
|
-
import { NotificationSource } from './Notifications.types';
|
|
10
|
-
import { NotificationError } from '../CoreError';
|
|
11
|
-
import { DecryptionError } from '../errors/DecryptionError';
|
|
12
|
-
import { MLSService } from '../messagingProtocols/mls';
|
|
13
|
-
import { ProteusService } from '../messagingProtocols/proteus';
|
|
14
|
-
export type HandledEventPayload = {
|
|
15
|
-
event: BackendEvent;
|
|
16
|
-
decryptedData?: GenericMessage;
|
|
17
|
-
decryptionError?: DecryptionError;
|
|
18
|
-
};
|
|
19
|
-
declare enum TOPIC {
|
|
20
|
-
NOTIFICATION_ERROR = "NotificationService.TOPIC.NOTIFICATION_ERROR"
|
|
21
|
-
}
|
|
22
|
-
export type NotificationHandler = (notification: Notification, source: NotificationSource, progress: {
|
|
23
|
-
done: number;
|
|
24
|
-
total: number;
|
|
25
|
-
}) => Promise<void>;
|
|
26
|
-
export interface NotificationService {
|
|
27
|
-
on(event: TOPIC.NOTIFICATION_ERROR, listener: (payload: NotificationError) => void): this;
|
|
28
|
-
}
|
|
29
|
-
export declare class NotificationService extends EventEmitter {
|
|
30
|
-
private readonly mlsService;
|
|
31
|
-
private readonly proteusService;
|
|
32
|
-
private readonly apiClient;
|
|
33
|
-
private readonly backend;
|
|
34
|
-
private readonly database;
|
|
35
|
-
private readonly logger;
|
|
36
|
-
static readonly TOPIC: typeof TOPIC;
|
|
37
|
-
constructor(apiClient: APIClient, mlsService: MLSService, proteusService: ProteusService, storeEngine: CRUDEngine);
|
|
38
|
-
private getAllNotifications;
|
|
39
|
-
/** Should only be called with a completely new client. */
|
|
40
|
-
initializeNotificationStream(): Promise<string>;
|
|
41
|
-
hasHistory(): Promise<boolean>;
|
|
42
|
-
getNotificationEventList(): Promise<BackendEvent[]>;
|
|
43
|
-
setLastEventDate(eventDate: Date): Promise<Date>;
|
|
44
|
-
setLastNotificationId(lastNotification: Notification): Promise<string>;
|
|
45
|
-
processNotificationStream(notificationHandler: NotificationHandler, onMissedNotifications: (notificationId: string) => void, abortHandler: AbortHandler): Promise<{
|
|
46
|
-
total: number;
|
|
47
|
-
error: number;
|
|
48
|
-
success: number;
|
|
49
|
-
}>;
|
|
50
|
-
/**
|
|
51
|
-
* Checks if an event should be ignored.
|
|
52
|
-
* An event that has a date prior to that last event that we have parsed should be ignored
|
|
53
|
-
*
|
|
54
|
-
* @param event
|
|
55
|
-
* @param source
|
|
56
|
-
* @param lastEventDate?
|
|
57
|
-
*/
|
|
58
|
-
private isOutdatedEvent;
|
|
59
|
-
handleNotification(notification: Notification, source: NotificationSource, dryRun?: boolean): AsyncGenerator<HandledEventPayload>;
|
|
60
|
-
/**
|
|
61
|
-
* Will process one event
|
|
62
|
-
* @param event The backend event to process
|
|
63
|
-
* @param source The source of the event (websocket or notication stream)
|
|
64
|
-
* @param dryRun Will not try to decrypt if true
|
|
65
|
-
* @return the decrypted payload and the raw event. Returns `undefined` when the payload is a coreCrypto-only system message
|
|
66
|
-
*/
|
|
67
|
-
private handleEvent;
|
|
68
|
-
}
|
|
69
|
-
export {};
|
|
70
|
-
//# sourceMappingURL=NotificationService.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationService.d.ts","sourceRoot":"","sources":["../../src/notification/NotificationService.ts"],"names":[],"mappings":";AAmBA,OAAO,EAAC,YAAY,EAAqB,MAAM,+BAA+B,CAAC;AAC/E,OAAO,EAAC,YAAY,EAAC,MAAM,uCAAuC,CAAC;AACnE,OAAO,EAAC,YAAY,EAAC,MAAM,6BAA6B,CAAC;AAGzD,OAAO,EAAC,YAAY,EAAC,MAAM,QAAQ,CAAC;AAEpC,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAC,UAAU,EAA4B,MAAM,uBAAuB,CAAC;AAI5E,OAAO,EAAC,kBAAkB,EAAC,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EAAY,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAC,UAAU,EAAC,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAC,cAAc,EAAC,MAAM,+BAA+B,CAAC;AAE7D,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE,YAAY,CAAC;IACpB,aAAa,CAAC,EAAE,cAAc,CAAC;IAC/B,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC,CAAC;AAEF,aAAK,KAAK;IACR,kBAAkB,iDAAiD;CACpE;AAED,MAAM,MAAM,mBAAmB,GAAG,CAChC,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,kBAAkB,EAC1B,QAAQ,EAAE;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAC,KACpC,OAAO,CAAC,IAAI,CAAC,CAAC;AAEnB,MAAM,WAAW,mBAAmB;IAClC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,kBAAkB,EAAE,QAAQ,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,GAAG,IAAI,CAAC;CAC3F;AAED,qBAAa,mBAAoB,SAAQ,YAAY;IAYjD,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAZjC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgC;IACxD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAiC;IAC1D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAGpB;IACH,gBAAuB,KAAK,eAAS;gBAGnC,SAAS,EAAE,SAAS,EACH,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,cAAc,EAC/C,WAAW,EAAE,UAAU;YAQX,mBAAmB;IAKjC,0DAA0D;IAC7C,4BAA4B,IAAI,OAAO,CAAC,MAAM,CAAC;IAO/C,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAKpC,wBAAwB,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAI7C,gBAAgB,CAAC,SAAS,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAsBhD,qBAAqB,CAAC,gBAAgB,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;IAItE,yBAAyB,CACpC,mBAAmB,EAAE,mBAAmB,EACxC,qBAAqB,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,IAAI,EACvD,YAAY,EAAE,YAAY,GACzB,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAC,CAAC;IAoC3D;;;;;;;OAOG;IACH,OAAO,CAAC,eAAe;IAYT,kBAAkB,CAC9B,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,kBAAkB,EAC1B,MAAM,GAAE,OAAe,GACtB,cAAc,CAAC,mBAAmB,CAAC;IAmCtC;;;;;;OAMG;YACW,WAAW;CAmC1B"}
|
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Wire
|
|
4
|
-
* Copyright (C) 2018 Wire Swiss GmbH
|
|
5
|
-
*
|
|
6
|
-
* This program is free software: you can redistribute it and/or modify
|
|
7
|
-
* it under the terms of the GNU General Public License as published by
|
|
8
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
9
|
-
* (at your option) any later version.
|
|
10
|
-
*
|
|
11
|
-
* This program is distributed in the hope that it will be useful,
|
|
12
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
* GNU General Public License for more details.
|
|
15
|
-
*
|
|
16
|
-
* You should have received a copy of the GNU General Public License
|
|
17
|
-
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
|
21
|
-
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
|
22
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
23
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
24
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
25
|
-
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
26
|
-
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
27
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
28
|
-
function fulfill(value) { resume("next", value); }
|
|
29
|
-
function reject(value) { resume("throw", value); }
|
|
30
|
-
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
31
|
-
};
|
|
32
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
33
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
34
|
-
};
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.NotificationService = void 0;
|
|
37
|
-
const event_1 = require("@wireapp/api-client/lib/event");
|
|
38
|
-
const logdown_1 = __importDefault(require("logdown"));
|
|
39
|
-
const events_1 = require("events");
|
|
40
|
-
const store_engine_1 = require("@wireapp/store-engine");
|
|
41
|
-
const NotificationBackendRepository_1 = require("./NotificationBackendRepository");
|
|
42
|
-
const NotificationDatabaseRepository_1 = require("./NotificationDatabaseRepository");
|
|
43
|
-
const Notifications_types_1 = require("./Notifications.types");
|
|
44
|
-
const CoreError_1 = require("../CoreError");
|
|
45
|
-
var TOPIC;
|
|
46
|
-
(function (TOPIC) {
|
|
47
|
-
TOPIC["NOTIFICATION_ERROR"] = "NotificationService.TOPIC.NOTIFICATION_ERROR";
|
|
48
|
-
})(TOPIC || (TOPIC = {}));
|
|
49
|
-
class NotificationService extends events_1.EventEmitter {
|
|
50
|
-
constructor(apiClient, mlsService, proteusService, storeEngine) {
|
|
51
|
-
super();
|
|
52
|
-
this.mlsService = mlsService;
|
|
53
|
-
this.proteusService = proteusService;
|
|
54
|
-
this.logger = (0, logdown_1.default)('@wireapp/core/NotificationService', {
|
|
55
|
-
logger: console,
|
|
56
|
-
markdown: false,
|
|
57
|
-
});
|
|
58
|
-
this.apiClient = apiClient;
|
|
59
|
-
this.backend = new NotificationBackendRepository_1.NotificationBackendRepository(this.apiClient);
|
|
60
|
-
this.database = new NotificationDatabaseRepository_1.NotificationDatabaseRepository(storeEngine);
|
|
61
|
-
}
|
|
62
|
-
async getAllNotifications(since) {
|
|
63
|
-
const clientId = this.apiClient.clientId;
|
|
64
|
-
return this.backend.getAllNotifications(clientId, since);
|
|
65
|
-
}
|
|
66
|
-
/** Should only be called with a completely new client. */
|
|
67
|
-
async initializeNotificationStream() {
|
|
68
|
-
const clientId = this.apiClient.clientId;
|
|
69
|
-
await this.setLastEventDate(new Date(0));
|
|
70
|
-
const latestNotification = await this.backend.getLastNotification(clientId);
|
|
71
|
-
return this.setLastNotificationId(latestNotification);
|
|
72
|
-
}
|
|
73
|
-
async hasHistory() {
|
|
74
|
-
const notificationEvents = await this.getNotificationEventList();
|
|
75
|
-
return !!notificationEvents.length;
|
|
76
|
-
}
|
|
77
|
-
getNotificationEventList() {
|
|
78
|
-
return this.database.getNotificationEventList();
|
|
79
|
-
}
|
|
80
|
-
async setLastEventDate(eventDate) {
|
|
81
|
-
let databaseLastEventDate;
|
|
82
|
-
try {
|
|
83
|
-
databaseLastEventDate = await this.database.getLastEventDate();
|
|
84
|
-
}
|
|
85
|
-
catch (error) {
|
|
86
|
-
if (error instanceof store_engine_1.error.RecordNotFoundError ||
|
|
87
|
-
error.constructor.name === store_engine_1.error.RecordNotFoundError.name) {
|
|
88
|
-
return this.database.createLastEventDate(eventDate);
|
|
89
|
-
}
|
|
90
|
-
throw error;
|
|
91
|
-
}
|
|
92
|
-
if (databaseLastEventDate && eventDate > databaseLastEventDate) {
|
|
93
|
-
return this.database.updateLastEventDate(eventDate);
|
|
94
|
-
}
|
|
95
|
-
return databaseLastEventDate;
|
|
96
|
-
}
|
|
97
|
-
async setLastNotificationId(lastNotification) {
|
|
98
|
-
return this.database.updateLastNotificationId(lastNotification);
|
|
99
|
-
}
|
|
100
|
-
async processNotificationStream(notificationHandler, onMissedNotifications, abortHandler) {
|
|
101
|
-
const lastNotificationId = await this.database.getLastNotificationId();
|
|
102
|
-
const { notifications, missedNotification } = await this.getAllNotifications(lastNotificationId);
|
|
103
|
-
if (missedNotification) {
|
|
104
|
-
onMissedNotifications(missedNotification);
|
|
105
|
-
}
|
|
106
|
-
const results = { total: notifications.length, error: 0, success: 0 };
|
|
107
|
-
const logMessage = notifications.length > 0
|
|
108
|
-
? `Start processing ${notifications.length} notifications since notification id ${lastNotificationId}`
|
|
109
|
-
: `No notification to process from the stream`;
|
|
110
|
-
this.logger.log(logMessage);
|
|
111
|
-
for (const [index, notification] of notifications.entries()) {
|
|
112
|
-
if (abortHandler.isAborted()) {
|
|
113
|
-
/* Stop handling notifications if the websocket has been disconnected.
|
|
114
|
-
* Upon reconnecting we are going to restart handling the notification stream for where we left of
|
|
115
|
-
*/
|
|
116
|
-
this.logger.warn(`Stop processing notifications as connection to websocket was closed`);
|
|
117
|
-
return results;
|
|
118
|
-
}
|
|
119
|
-
try {
|
|
120
|
-
await notificationHandler(notification, Notifications_types_1.NotificationSource.NOTIFICATION_STREAM, {
|
|
121
|
-
done: index + 1,
|
|
122
|
-
total: notifications.length,
|
|
123
|
-
});
|
|
124
|
-
results.success++;
|
|
125
|
-
}
|
|
126
|
-
catch (error) {
|
|
127
|
-
const message = error instanceof Error ? error.message : error;
|
|
128
|
-
this.logger.error(`Error while processing notification ${notification.id}: ${message}`, error);
|
|
129
|
-
results.error++;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
return results;
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Checks if an event should be ignored.
|
|
136
|
-
* An event that has a date prior to that last event that we have parsed should be ignored
|
|
137
|
-
*
|
|
138
|
-
* @param event
|
|
139
|
-
* @param source
|
|
140
|
-
* @param lastEventDate?
|
|
141
|
-
*/
|
|
142
|
-
isOutdatedEvent(event, source, lastEventDate) {
|
|
143
|
-
const isFromNotificationStream = source === Notifications_types_1.NotificationSource.NOTIFICATION_STREAM;
|
|
144
|
-
const shouldCheckEventDate = !!event.time && isFromNotificationStream && lastEventDate;
|
|
145
|
-
if (shouldCheckEventDate) {
|
|
146
|
-
/** This check prevents duplicated "You joined" system messages. */
|
|
147
|
-
const isOutdated = lastEventDate.getTime() >= new Date(event.time).getTime();
|
|
148
|
-
return isOutdated;
|
|
149
|
-
}
|
|
150
|
-
return false;
|
|
151
|
-
}
|
|
152
|
-
handleNotification(notification, source, dryRun = false) {
|
|
153
|
-
return __asyncGenerator(this, arguments, function* handleNotification_1() {
|
|
154
|
-
for (const event of notification.payload) {
|
|
155
|
-
this.logger.log(`Handling event of type "${event.type}" for notification with ID "${notification.id}"`, event);
|
|
156
|
-
let lastEventDate = undefined;
|
|
157
|
-
try {
|
|
158
|
-
lastEventDate = yield __await(this.database.getLastEventDate());
|
|
159
|
-
}
|
|
160
|
-
catch (_a) { }
|
|
161
|
-
if ('time' in event && this.isOutdatedEvent(event, source, lastEventDate)) {
|
|
162
|
-
this.logger.info(`Ignored outdated event type: '${event.type}'`);
|
|
163
|
-
continue;
|
|
164
|
-
}
|
|
165
|
-
try {
|
|
166
|
-
const data = yield __await(this.handleEvent(event, source, dryRun));
|
|
167
|
-
if (typeof data !== 'undefined') {
|
|
168
|
-
yield yield __await(data);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
catch (error) {
|
|
172
|
-
this.logger.error(`There was an error with notification ID "${notification.id}": ${error.message}`, error);
|
|
173
|
-
const notificationError = {
|
|
174
|
-
error: error,
|
|
175
|
-
notification,
|
|
176
|
-
type: CoreError_1.CoreError.NOTIFICATION_ERROR,
|
|
177
|
-
};
|
|
178
|
-
this.emit(NotificationService.TOPIC.NOTIFICATION_ERROR, notificationError);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
if (!dryRun && !notification.transient) {
|
|
182
|
-
// keep track of the last handled notification for next time we fetch the notification stream
|
|
183
|
-
yield __await(this.setLastNotificationId(notification));
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Will process one event
|
|
189
|
-
* @param event The backend event to process
|
|
190
|
-
* @param source The source of the event (websocket or notication stream)
|
|
191
|
-
* @param dryRun Will not try to decrypt if true
|
|
192
|
-
* @return the decrypted payload and the raw event. Returns `undefined` when the payload is a coreCrypto-only system message
|
|
193
|
-
*/
|
|
194
|
-
async handleEvent(event, source, dryRun = false) {
|
|
195
|
-
var _a;
|
|
196
|
-
// Handle MLS Events
|
|
197
|
-
const mlsResult = await this.mlsService.handleEvent({ event, source, dryRun });
|
|
198
|
-
if (mlsResult) {
|
|
199
|
-
return mlsResult;
|
|
200
|
-
}
|
|
201
|
-
const proteusResult = await this.proteusService.handleEvent({
|
|
202
|
-
event,
|
|
203
|
-
source,
|
|
204
|
-
dryRun,
|
|
205
|
-
});
|
|
206
|
-
if (proteusResult) {
|
|
207
|
-
return proteusResult;
|
|
208
|
-
}
|
|
209
|
-
// Fallback to other events
|
|
210
|
-
switch (event.type) {
|
|
211
|
-
// Meta events
|
|
212
|
-
case event_1.CONVERSATION_EVENT.MEMBER_JOIN:
|
|
213
|
-
// As of today (07/07/2022) the backend sends `WELCOME` message to the user's own conversation (not the actual conversation that the welcome should be part of)
|
|
214
|
-
// So in order to map conversation Ids and groupId together, we need to first fetch the conversation and get the groupId linked to it.
|
|
215
|
-
const conversation = await this.apiClient.api.conversation.getConversation((_a = event.qualified_conversation) !== null && _a !== void 0 ? _a : { id: event.conversation, domain: '' });
|
|
216
|
-
if (!conversation) {
|
|
217
|
-
throw new Error('no conv');
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
return { event };
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
exports.NotificationService = NotificationService;
|
|
224
|
-
NotificationService.TOPIC = TOPIC;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Notifications.types.d.ts","sourceRoot":"","sources":["../../src/notification/Notifications.types.ts"],"names":[],"mappings":"AAmBA,oBAAY,kBAAkB;IAC5B,KAAK,UAAU;IACf,mBAAmB,wBAAwB;IAC3C,SAAS,cAAc;CACxB"}
|