@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,20 +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 });
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/proteus/EventHandler/index.ts"],"names":[],"mappings":"AAmBA,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC"}
|
|
@@ -1,36 +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("./EventHandler.types"), exports);
|
|
36
|
-
__exportStar(require("./EventHandler"), exports);
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { APIClient } from '@wireapp/api-client/lib/APIClient';
|
|
2
|
-
import { Conversation } from '@wireapp/api-client/lib/conversation';
|
|
3
|
-
import { AddUsersToProteusConversationParams, CreateProteusConversationParams, ProteusServiceConfig, SendProteusMessageParams } from './ProteusService.types';
|
|
4
|
-
import { SendResult } from '../../../conversation';
|
|
5
|
-
import { CryptographyService } from '../../../cryptography';
|
|
6
|
-
import { EventHandlerResult } from '../../common.types';
|
|
7
|
-
import { EventHandlerParams } from '../EventHandler';
|
|
8
|
-
export declare class ProteusService {
|
|
9
|
-
private readonly apiClient;
|
|
10
|
-
private readonly cryptographyService;
|
|
11
|
-
private readonly config;
|
|
12
|
-
private readonly messageService;
|
|
13
|
-
private readonly logger;
|
|
14
|
-
constructor(apiClient: APIClient, cryptographyService: CryptographyService, config: ProteusServiceConfig);
|
|
15
|
-
handleEvent(params: Omit<EventHandlerParams, 'cryptographyService'>): EventHandlerResult;
|
|
16
|
-
createConversation({ conversationData, otherUserIds, }: CreateProteusConversationParams): Promise<Conversation>;
|
|
17
|
-
addUsersToConversation({ conversationId, qualifiedUserIds }: AddUsersToProteusConversationParams): Promise<import("@wireapp/api-client/lib/event").ConversationMemberJoinEvent>;
|
|
18
|
-
sendMessage({ userIds, sendAsProtobuf, conversationId, nativePush, targetMode, payload, onClientMismatch, }: SendProteusMessageParams): Promise<SendResult>;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=ProteusService.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProteusService.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/proteus/ProteusService/ProteusService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,SAAS,EAAC,MAAM,mCAAmC,CAAC;AAC5D,OAAO,EAAC,YAAY,EAAkB,MAAM,sCAAsC,CAAC;AAGnF,OAAO,EACL,mCAAmC,EACnC,+BAA+B,EAC/B,oBAAoB,EACpB,wBAAwB,EACzB,MAAM,wBAAwB,CAAC;AAIhC,OAAO,EAAsB,UAAU,EAAC,MAAM,uBAAuB,CAAC;AAEtE,OAAO,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAC,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAC,kBAAkB,EAAqB,MAAM,iBAAiB,CAAC;AAEvE,qBAAa,cAAc;IAKvB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IACpC,OAAO,CAAC,QAAQ,CAAC,MAAM;IANzB,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;IAChD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA2C;gBAG/C,SAAS,EAAE,SAAS,EACpB,mBAAmB,EAAE,mBAAmB,EACxC,MAAM,EAAE,oBAAoB;IAKlC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAAG,kBAAkB;IAIxF,kBAAkB,CAAC,EAC9B,gBAAgB,EAChB,YAAY,GACb,EAAE,+BAA+B,GAAG,OAAO,CAAC,YAAY,CAAC;IAiB7C,sBAAsB,CAAC,EAAC,cAAc,EAAE,gBAAgB,EAAC,EAAE,mCAAmC;IAI9F,WAAW,CAAC,EACvB,OAAO,EACP,cAAc,EACd,cAAc,EACd,UAAU,EACV,UAAU,EACV,OAAO,EACP,gBAAgB,GACjB,EAAE,wBAAwB,GAAG,OAAO,CAAC,UAAU,CAAC;CA0ClD"}
|
|
@@ -1,93 +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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
21
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
22
|
-
};
|
|
23
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.ProteusService = void 0;
|
|
25
|
-
const logdown_1 = __importDefault(require("logdown"));
|
|
26
|
-
const Utility_1 = require("./Utility");
|
|
27
|
-
const getGenericMessageParams_1 = require("./Utility/getGenericMessageParams");
|
|
28
|
-
const conversation_1 = require("../../../conversation");
|
|
29
|
-
const MessageService_1 = require("../../../conversation/message/MessageService");
|
|
30
|
-
const EventHandler_1 = require("../EventHandler");
|
|
31
|
-
class ProteusService {
|
|
32
|
-
constructor(apiClient, cryptographyService, config) {
|
|
33
|
-
this.apiClient = apiClient;
|
|
34
|
-
this.cryptographyService = cryptographyService;
|
|
35
|
-
this.config = config;
|
|
36
|
-
this.logger = (0, logdown_1.default)('@wireapp/core/ProteusService');
|
|
37
|
-
this.messageService = new MessageService_1.MessageService(this.apiClient, this.cryptographyService);
|
|
38
|
-
}
|
|
39
|
-
async handleEvent(params) {
|
|
40
|
-
return (0, EventHandler_1.handleBackendEvent)(Object.assign(Object.assign({}, params), { cryptographyService: this.cryptographyService }));
|
|
41
|
-
}
|
|
42
|
-
async createConversation({ conversationData, otherUserIds, }) {
|
|
43
|
-
let payload;
|
|
44
|
-
if (typeof conversationData === 'string') {
|
|
45
|
-
const ids = typeof otherUserIds === 'string' ? [otherUserIds] : otherUserIds;
|
|
46
|
-
payload = {
|
|
47
|
-
name: conversationData,
|
|
48
|
-
receipt_mode: null,
|
|
49
|
-
users: ids !== null && ids !== void 0 ? ids : [],
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
payload = conversationData;
|
|
54
|
-
}
|
|
55
|
-
return this.apiClient.api.conversation.postConversation(payload);
|
|
56
|
-
}
|
|
57
|
-
async addUsersToConversation({ conversationId, qualifiedUserIds }) {
|
|
58
|
-
return this.apiClient.api.conversation.postMembers(conversationId, qualifiedUserIds);
|
|
59
|
-
}
|
|
60
|
-
async sendMessage({ userIds, sendAsProtobuf, conversationId, nativePush, targetMode, payload, onClientMismatch, }) {
|
|
61
|
-
const messageParams = await (0, getGenericMessageParams_1.getGenericMessageParams)({
|
|
62
|
-
apiClient: this.apiClient,
|
|
63
|
-
sendingClientId: this.apiClient.validatedClientId,
|
|
64
|
-
conversationId,
|
|
65
|
-
genericMessage: payload,
|
|
66
|
-
useQualifiedIds: this.config.useQualifiedIds,
|
|
67
|
-
options: {
|
|
68
|
-
userIds,
|
|
69
|
-
sendAsProtobuf,
|
|
70
|
-
nativePush,
|
|
71
|
-
targetMode,
|
|
72
|
-
onClientMismatch,
|
|
73
|
-
},
|
|
74
|
-
});
|
|
75
|
-
const { federated, sendingClientId, recipients, plainText, options } = messageParams;
|
|
76
|
-
const response = federated
|
|
77
|
-
? await this.messageService.sendFederatedMessage(sendingClientId, recipients, plainText, Object.assign(Object.assign({}, options), { onClientMismatch: mismatch => onClientMismatch === null || onClientMismatch === void 0 ? void 0 : onClientMismatch(mismatch, false) }))
|
|
78
|
-
: await this.messageService.sendMessage(sendingClientId, recipients, plainText, Object.assign(Object.assign({}, options), { sendAsProtobuf, onClientMismatch: mismatch => onClientMismatch === null || onClientMismatch === void 0 ? void 0 : onClientMismatch(mismatch, false) }));
|
|
79
|
-
if (!response.errored) {
|
|
80
|
-
if (!(0, Utility_1.isClearFromMismatch)(response)) {
|
|
81
|
-
// We warn the consumer that there is a mismatch that did not prevent message sending
|
|
82
|
-
await (onClientMismatch === null || onClientMismatch === void 0 ? void 0 : onClientMismatch(response, true));
|
|
83
|
-
}
|
|
84
|
-
this.logger.log(`Successfully sent Proteus message to conversation '${conversationId.id}'`);
|
|
85
|
-
}
|
|
86
|
-
return {
|
|
87
|
-
id: payload.messageId,
|
|
88
|
-
sentAt: response.time,
|
|
89
|
-
state: response.errored ? conversation_1.MessageSendingState.CANCELLED : conversation_1.MessageSendingState.OUTGOING_SENT,
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
exports.ProteusService = ProteusService;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { UserClients, QualifiedUserClients, ClientMismatch, MessageSendingStatus, ConversationProtocol, NewConversation } from '@wireapp/api-client/lib/conversation';
|
|
2
|
-
import { QualifiedId } from '@wireapp/api-client/lib/user';
|
|
3
|
-
import { AddUsersParams, MessageSendingOptions, SendCommonParams } from '../../../conversation';
|
|
4
|
-
export type ProteusServiceConfig = {
|
|
5
|
-
useQualifiedIds: boolean;
|
|
6
|
-
};
|
|
7
|
-
export type SendProteusMessageParams = SendCommonParams & MessageSendingOptions & {
|
|
8
|
-
conversationId: QualifiedId;
|
|
9
|
-
/**
|
|
10
|
-
* Can be either a QualifiedId[], string[], UserClients or QualfiedUserClients. The type has some effect on the behavior of the method. (Needed only for Proteus)
|
|
11
|
-
* When given a QualifiedId[] or string[] the method will fetch the freshest list of devices for those users (since they are not given by the consumer). As a consequence no ClientMismatch error will trigger and we will ignore missing clients when sending
|
|
12
|
-
* When given a QualifiedUserClients or UserClients the method will only send to the clients listed in the userIds. This could lead to ClientMismatch (since the given list of devices might not be the freshest one and new clients could have been created)
|
|
13
|
-
* When given a QualifiedId[] or QualifiedUserClients the method will send the message through the federated API endpoint
|
|
14
|
-
* When given a string[] or UserClients the method will send the message through the old API endpoint
|
|
15
|
-
*/
|
|
16
|
-
userIds?: string[] | QualifiedId[] | UserClients | QualifiedUserClients;
|
|
17
|
-
onClientMismatch?: (status: ClientMismatch | MessageSendingStatus, wasSent: boolean) => void | boolean | Promise<boolean>;
|
|
18
|
-
protocol: ConversationProtocol.PROTEUS;
|
|
19
|
-
};
|
|
20
|
-
export type CreateProteusConversationParams = {
|
|
21
|
-
conversationData: NewConversation | string;
|
|
22
|
-
otherUserIds?: string | string[];
|
|
23
|
-
};
|
|
24
|
-
export type AddUsersToProteusConversationParams = Omit<AddUsersParams, 'groupId'>;
|
|
25
|
-
//# sourceMappingURL=ProteusService.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProteusService.types.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/proteus/ProteusService/ProteusService.types.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EAChB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAC,cAAc,EAAE,qBAAqB,EAAE,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AAE9F,MAAM,MAAM,oBAAoB,GAAG;IACjC,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,gBAAgB,GACrD,qBAAqB,GAAG;IACtB,cAAc,EAAE,WAAW,CAAC;IAE5B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,GAAG,WAAW,GAAG,oBAAoB,CAAC;IACxE,gBAAgB,CAAC,EAAE,CACjB,MAAM,EAAE,cAAc,GAAG,oBAAoB,EAC7C,OAAO,EAAE,OAAO,KACb,IAAI,GAAG,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,QAAQ,EAAE,oBAAoB,CAAC,OAAO,CAAC;CACxC,CAAC;AAEJ,MAAM,MAAM,+BAA+B,GAAG;IAC5C,gBAAgB,EAAE,eAAe,GAAG,MAAM,CAAC;IAC3C,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC"}
|
|
@@ -1,20 +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 });
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { APIClient } from '@wireapp/api-client/lib/APIClient';
|
|
2
|
-
import { QualifiedUserClients, UserClients } from '@wireapp/api-client/lib/conversation';
|
|
3
|
-
import { QualifiedId, QualifiedUserPreKeyBundleMap, UserPreKeyBundleMap } from '@wireapp/api-client/lib/user';
|
|
4
|
-
interface GetPreKeyBundleMapParams {
|
|
5
|
-
apiClient: APIClient;
|
|
6
|
-
conversationId: QualifiedId;
|
|
7
|
-
userIds?: string[] | QualifiedId[] | UserClients;
|
|
8
|
-
}
|
|
9
|
-
declare const getPreKeyBundleMap: ({ apiClient, conversationId, userIds, }: GetPreKeyBundleMapParams) => Promise<UserPreKeyBundleMap>;
|
|
10
|
-
/**
|
|
11
|
-
* Will generate a prekey bundle for specific users.
|
|
12
|
-
* If a QualifiedId array is given the bundle will contain all the clients from those users fetched from the server.
|
|
13
|
-
* If a QualifiedUserClients is provided then only the clients in the payload will be targeted (which could generate a ClientMismatch when sending messages)
|
|
14
|
-
*
|
|
15
|
-
* @param {QualifiedId[]|QualifiedUserClients} userIds - Targeted users.
|
|
16
|
-
* @returns {Promise<QualifiedUserPreKeyBundleMap}
|
|
17
|
-
*/
|
|
18
|
-
interface GetQualifiedPreKeyBundleMapParams {
|
|
19
|
-
apiClient: APIClient;
|
|
20
|
-
userIds?: QualifiedId[] | QualifiedUserClients;
|
|
21
|
-
}
|
|
22
|
-
declare const getQualifiedPreKeyBundle: ({ apiClient, userIds, }: GetQualifiedPreKeyBundleMapParams) => Promise<QualifiedUserPreKeyBundleMap>;
|
|
23
|
-
export { getPreKeyBundleMap, getQualifiedPreKeyBundle };
|
|
24
|
-
//# sourceMappingURL=PreKeyBundle.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PreKeyBundle.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/proteus/ProteusService/Utility/PreKeyBundle.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,SAAS,EAAC,MAAM,mCAAmC,CAAC;AAC5D,OAAO,EAAC,oBAAoB,EAAE,WAAW,EAAC,MAAM,sCAAsC,CAAC;AACvF,OAAO,EAAC,WAAW,EAAE,4BAA4B,EAAE,mBAAmB,EAAC,MAAM,8BAA8B,CAAC;AAI5G,UAAU,wBAAwB;IAChC,SAAS,EAAE,SAAS,CAAC;IACrB,cAAc,EAAE,WAAW,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,GAAG,WAAW,CAAC;CAClD;AACD,QAAA,MAAM,kBAAkB,4CAIrB,wBAAwB,KAAG,QAAQ,mBAAmB,CA+BxD,CAAC;AAEF;;;;;;;GAOG;AACH,UAAU,iCAAiC;IACzC,SAAS,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,WAAW,EAAE,GAAG,oBAAoB,CAAC;CAChD;AACD,QAAA,MAAM,wBAAwB,4BAG3B,iCAAiC,KAAG,QAAQ,4BAA4B,CAoC1E,CAAC;AAEF,OAAO,EAAC,kBAAkB,EAAE,wBAAwB,EAAC,CAAC"}
|
|
@@ -1,86 +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.getQualifiedPreKeyBundle = exports.getPreKeyBundleMap = void 0;
|
|
22
|
-
const util_1 = require("../../../../util");
|
|
23
|
-
const getPreKeyBundleMap = async ({ apiClient, conversationId, userIds = [], }) => {
|
|
24
|
-
let members = [];
|
|
25
|
-
if (userIds) {
|
|
26
|
-
if ((0, util_1.isStringArray)(userIds)) {
|
|
27
|
-
members = userIds;
|
|
28
|
-
}
|
|
29
|
-
else if ((0, util_1.isUserClients)(userIds)) {
|
|
30
|
-
members = Object.keys(userIds);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
if (!members.length) {
|
|
34
|
-
const conversation = await apiClient.api.conversation.getConversation(conversationId);
|
|
35
|
-
/*
|
|
36
|
-
* If you are sending a message to a conversation, you have to include
|
|
37
|
-
* yourself in the list of users if you want to sync a message also to your
|
|
38
|
-
* other clients.
|
|
39
|
-
*/
|
|
40
|
-
members = conversation.members.others.map(member => member.id).concat(conversation.members.self.id);
|
|
41
|
-
}
|
|
42
|
-
const preKeys = await Promise.all(members.map(member => apiClient.api.user.getUserPreKeys(member)));
|
|
43
|
-
return preKeys.reduce((bundleMap, bundle) => {
|
|
44
|
-
const userId = bundle.user;
|
|
45
|
-
bundleMap[userId] || (bundleMap[userId] = {});
|
|
46
|
-
for (const client of bundle.clients) {
|
|
47
|
-
bundleMap[userId][client.client] = client.prekey;
|
|
48
|
-
}
|
|
49
|
-
return bundleMap;
|
|
50
|
-
}, {});
|
|
51
|
-
};
|
|
52
|
-
exports.getPreKeyBundleMap = getPreKeyBundleMap;
|
|
53
|
-
const getQualifiedPreKeyBundle = async ({ apiClient, userIds, }) => {
|
|
54
|
-
let targets = [];
|
|
55
|
-
if (userIds) {
|
|
56
|
-
if ((0, util_1.isQualifiedIdArray)(userIds)) {
|
|
57
|
-
targets = userIds.map(id => ({ id }));
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
targets = Object.entries(userIds).reduce((accumulator, [domain, userClients]) => {
|
|
61
|
-
for (const userId in userClients) {
|
|
62
|
-
accumulator.push({ id: { id: userId, domain }, clients: userClients[userId] });
|
|
63
|
-
}
|
|
64
|
-
return accumulator;
|
|
65
|
-
}, []);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
const preKeys = await Promise.all(targets.map(async ({ id: userId, clients }) => {
|
|
69
|
-
const prekeyBundle = await apiClient.api.user.getUserPreKeys(userId);
|
|
70
|
-
// We filter the clients that should not receive the message (if a QualifiedUserClients was given as parameter)
|
|
71
|
-
const userClients = clients
|
|
72
|
-
? prekeyBundle.clients.filter(client => clients.includes(client.client))
|
|
73
|
-
: prekeyBundle.clients;
|
|
74
|
-
return { user: userId, clients: userClients };
|
|
75
|
-
}));
|
|
76
|
-
return preKeys.reduce((bundleMap, qualifiedPrekey) => {
|
|
77
|
-
var _a, _b, _c;
|
|
78
|
-
bundleMap[_a = qualifiedPrekey.user.domain] || (bundleMap[_a] = {});
|
|
79
|
-
for (const client of qualifiedPrekey.clients) {
|
|
80
|
-
(_b = bundleMap[qualifiedPrekey.user.domain])[_c = qualifiedPrekey.user.id] || (_b[_c] = {});
|
|
81
|
-
bundleMap[qualifiedPrekey.user.domain][qualifiedPrekey.user.id][client.client] = client.prekey;
|
|
82
|
-
}
|
|
83
|
-
return bundleMap;
|
|
84
|
-
}, {});
|
|
85
|
-
};
|
|
86
|
-
exports.getQualifiedPreKeyBundle = getQualifiedPreKeyBundle;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { APIClient } from '@wireapp/api-client/lib/APIClient';
|
|
2
|
-
import { QualifiedUserClients, UserClients } from '@wireapp/api-client/lib/conversation';
|
|
3
|
-
import { QualifiedId, QualifiedUserPreKeyBundleMap, UserPreKeyBundleMap } from '@wireapp/api-client/lib/user';
|
|
4
|
-
interface GetRecipientsForConversationQualifiedParams {
|
|
5
|
-
apiClient: APIClient;
|
|
6
|
-
conversationId: QualifiedId;
|
|
7
|
-
userIds?: QualifiedId[] | QualifiedUserClients;
|
|
8
|
-
}
|
|
9
|
-
declare const getQualifiedRecipientsForConversation: ({ apiClient, conversationId, userIds, }: GetRecipientsForConversationQualifiedParams) => Promise<QualifiedUserClients | QualifiedUserPreKeyBundleMap>;
|
|
10
|
-
interface GetRecipientsForConversationParams {
|
|
11
|
-
apiClient: APIClient;
|
|
12
|
-
conversationId: QualifiedId;
|
|
13
|
-
userIds?: string[] | UserClients;
|
|
14
|
-
}
|
|
15
|
-
declare const getRecipientsForConversation: ({ apiClient, conversationId, userIds, }: GetRecipientsForConversationParams) => Promise<UserClients | UserPreKeyBundleMap>;
|
|
16
|
-
export { getQualifiedRecipientsForConversation, getRecipientsForConversation };
|
|
17
|
-
//# sourceMappingURL=Recipients.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Recipients.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/proteus/ProteusService/Utility/Recipients.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,SAAS,EAAC,MAAM,mCAAmC,CAAC;AAC5D,OAAO,EAAC,oBAAoB,EAAE,WAAW,EAAC,MAAM,sCAAsC,CAAC;AACvF,OAAO,EAAC,WAAW,EAAE,4BAA4B,EAAE,mBAAmB,EAAC,MAAM,8BAA8B,CAAC;AAO5G,UAAU,2CAA2C;IACnD,SAAS,EAAE,SAAS,CAAC;IACrB,cAAc,EAAE,WAAW,CAAC;IAC5B,OAAO,CAAC,EAAE,WAAW,EAAE,GAAG,oBAAoB,CAAC;CAChD;AAED,QAAA,MAAM,qCAAqC,4CAIxC,2CAA2C,KAAG,QAAQ,oBAAoB,GAAG,4BAA4B,CAO3G,CAAC;AAEF,UAAU,kCAAkC;IAC1C,SAAS,EAAE,SAAS,CAAC;IACrB,cAAc,EAAE,WAAW,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,WAAW,CAAC;CAClC;AACD,QAAA,MAAM,4BAA4B,4CAI/B,kCAAkC,KAAG,QAAQ,WAAW,GAAG,mBAAmB,CAShF,CAAC;AAEF,OAAO,EAAC,qCAAqC,EAAE,4BAA4B,EAAC,CAAC"}
|
|
@@ -1,43 +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.getRecipientsForConversation = exports.getQualifiedRecipientsForConversation = void 0;
|
|
22
|
-
const PreKeyBundle_1 = require("./PreKeyBundle");
|
|
23
|
-
const getConversationQualifiedMembers_1 = require("../../../../conversation/ConversationService/Utility/getConversationQualifiedMembers");
|
|
24
|
-
const util_1 = require("../../../../util");
|
|
25
|
-
const getQualifiedRecipientsForConversation = async ({ apiClient, conversationId, userIds, }) => {
|
|
26
|
-
if ((0, util_1.isQualifiedUserClients)(userIds)) {
|
|
27
|
-
return userIds;
|
|
28
|
-
}
|
|
29
|
-
const recipientIds = userIds || (await (0, getConversationQualifiedMembers_1.getConversationQualifiedMembers)({ apiClient: apiClient, conversationId }));
|
|
30
|
-
return (0, PreKeyBundle_1.getQualifiedPreKeyBundle)({ apiClient, userIds: recipientIds });
|
|
31
|
-
};
|
|
32
|
-
exports.getQualifiedRecipientsForConversation = getQualifiedRecipientsForConversation;
|
|
33
|
-
const getRecipientsForConversation = async ({ apiClient, conversationId, userIds, }) => {
|
|
34
|
-
if ((0, util_1.isUserClients)(userIds)) {
|
|
35
|
-
return userIds;
|
|
36
|
-
}
|
|
37
|
-
return (0, PreKeyBundle_1.getPreKeyBundleMap)({
|
|
38
|
-
apiClient: apiClient,
|
|
39
|
-
conversationId,
|
|
40
|
-
userIds,
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
exports.getRecipientsForConversation = getRecipientsForConversation;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { UserClients, QualifiedUserClients } from '@wireapp/api-client/lib/conversation';
|
|
2
|
-
import { QualifiedId } from '@wireapp/api-client/lib/user';
|
|
3
|
-
interface ExtractUserIdsParams {
|
|
4
|
-
userIds?: string[] | UserClients;
|
|
5
|
-
}
|
|
6
|
-
declare const extractUserIds: ({ userIds }: ExtractUserIdsParams) => string[] | undefined;
|
|
7
|
-
interface ExtractQualifiedUserIdsParams {
|
|
8
|
-
userIds?: QualifiedId[] | QualifiedUserClients;
|
|
9
|
-
}
|
|
10
|
-
declare const extractQualifiedUserIds: ({ userIds }: ExtractQualifiedUserIdsParams) => QualifiedId[] | undefined;
|
|
11
|
-
export { extractQualifiedUserIds, extractUserIds };
|
|
12
|
-
//# sourceMappingURL=UserIds.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UserIds.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/proteus/ProteusService/Utility/UserIds.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,WAAW,EAAE,oBAAoB,EAAC,MAAM,sCAAsC,CAAC;AACvF,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAIzD,UAAU,oBAAoB;IAC5B,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,WAAW,CAAC;CAClC;AACD,QAAA,MAAM,cAAc,gBAAe,oBAAoB,KAAG,MAAM,EAAE,GAAG,SAKpE,CAAC;AAEF,UAAU,6BAA6B;IACrC,OAAO,CAAC,EAAE,WAAW,EAAE,GAAG,oBAAoB,CAAC;CAChD;AACD,QAAA,MAAM,uBAAuB,gBAAe,6BAA6B,KAAG,WAAW,EAAE,GAAG,SAO3F,CAAC;AAEF,OAAO,EAAC,uBAAuB,EAAE,cAAc,EAAC,CAAC"}
|
|
@@ -1,38 +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.extractUserIds = exports.extractQualifiedUserIds = void 0;
|
|
22
|
-
const util_1 = require("../../../../util");
|
|
23
|
-
const extractUserIds = ({ userIds }) => {
|
|
24
|
-
if ((0, util_1.isUserClients)(userIds)) {
|
|
25
|
-
return Object.keys(userIds);
|
|
26
|
-
}
|
|
27
|
-
return userIds;
|
|
28
|
-
};
|
|
29
|
-
exports.extractUserIds = extractUserIds;
|
|
30
|
-
const extractQualifiedUserIds = ({ userIds }) => {
|
|
31
|
-
if ((0, util_1.isQualifiedUserClients)(userIds)) {
|
|
32
|
-
return Object.entries(userIds).reduce((ids, [domain, userClients]) => {
|
|
33
|
-
return ids.concat(Object.keys(userClients).map(userId => ({ domain, id: userId })));
|
|
34
|
-
}, []);
|
|
35
|
-
}
|
|
36
|
-
return userIds;
|
|
37
|
-
};
|
|
38
|
-
exports.extractQualifiedUserIds = extractQualifiedUserIds;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { APIClient } from '@wireapp/api-client/lib/APIClient';
|
|
2
|
-
import { QualifiedUserClients, UserClients } from '@wireapp/api-client/lib/conversation';
|
|
3
|
-
import { QualifiedId, QualifiedUserPreKeyBundleMap, UserPreKeyBundleMap } from '@wireapp/api-client/lib/user';
|
|
4
|
-
import { GenericMessage } from '@wireapp/protocol-messaging';
|
|
5
|
-
import { MessageSendingOptions } from '../../../../conversation';
|
|
6
|
-
export type FederatedMessageParams = {
|
|
7
|
-
federated: true;
|
|
8
|
-
sendingClientId: string;
|
|
9
|
-
recipients: QualifiedUserClients | QualifiedUserPreKeyBundleMap;
|
|
10
|
-
plainText: Uint8Array;
|
|
11
|
-
options: {
|
|
12
|
-
conversationId: QualifiedId;
|
|
13
|
-
nativePush: boolean | undefined;
|
|
14
|
-
reportMissing: boolean | QualifiedId[] | undefined;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export type MessageParams = Omit<FederatedMessageParams, 'recipients' | 'options' | 'federated'> & {
|
|
18
|
-
federated: false;
|
|
19
|
-
recipients: UserClients | UserPreKeyBundleMap;
|
|
20
|
-
options: Omit<FederatedMessageParams['options'], 'reportMissing'> & {
|
|
21
|
-
reportMissing: boolean | string[] | undefined;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
interface GetGenericMessageParamsParams {
|
|
25
|
-
sendingClientId: string;
|
|
26
|
-
conversationId: QualifiedId;
|
|
27
|
-
genericMessage: GenericMessage;
|
|
28
|
-
options: MessageSendingOptions;
|
|
29
|
-
useQualifiedIds: boolean;
|
|
30
|
-
apiClient: APIClient;
|
|
31
|
-
}
|
|
32
|
-
type GetGenericMessageParamsReturnType = Promise<MessageParams | FederatedMessageParams>;
|
|
33
|
-
declare const getGenericMessageParams: ({ sendingClientId, conversationId, genericMessage, options: { targetMode, userIds, nativePush }, useQualifiedIds, apiClient, }: GetGenericMessageParamsParams) => GetGenericMessageParamsReturnType;
|
|
34
|
-
export { getGenericMessageParams };
|
|
35
|
-
//# sourceMappingURL=getGenericMessageParams.d.ts.map
|
package/lib/messagingProtocols/proteus/ProteusService/Utility/getGenericMessageParams.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getGenericMessageParams.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/proteus/ProteusService/Utility/getGenericMessageParams.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,SAAS,EAAC,MAAM,mCAAmC,CAAC;AAC5D,OAAO,EAAC,oBAAoB,EAAE,WAAW,EAAC,MAAM,sCAAsC,CAAC;AACvF,OAAO,EAAC,WAAW,EAAE,4BAA4B,EAAE,mBAAmB,EAAC,MAAM,8BAA8B,CAAC;AAE5G,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAC;AAK3D,OAAO,EAAoB,qBAAqB,EAAC,MAAM,0BAA0B,CAAC;AAGlF,MAAM,MAAM,sBAAsB,GAAG;IACnC,SAAS,EAAE,IAAI,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,oBAAoB,GAAG,4BAA4B,CAAC;IAChE,SAAS,EAAE,UAAU,CAAC;IACtB,OAAO,EAAE;QACP,cAAc,EAAE,WAAW,CAAC;QAC5B,UAAU,EAAE,OAAO,GAAG,SAAS,CAAC;QAChC,aAAa,EAAE,OAAO,GAAG,WAAW,EAAE,GAAG,SAAS,CAAC;KACpD,CAAC;CACH,CAAC;AACF,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,sBAAsB,EAAE,YAAY,GAAG,SAAS,GAAG,WAAW,CAAC,GAAG;IACjG,SAAS,EAAE,KAAK,CAAC;IACjB,UAAU,EAAE,WAAW,GAAG,mBAAmB,CAAC;IAC9C,OAAO,EAAE,IAAI,CAAC,sBAAsB,CAAC,SAAS,CAAC,EAAE,eAAe,CAAC,GAAG;QAClE,aAAa,EAAE,OAAO,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC;KAC/C,CAAC;CACH,CAAC;AACF,UAAU,6BAA6B;IACrC,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,WAAW,CAAC;IAC5B,cAAc,EAAE,cAAc,CAAC;IAC/B,OAAO,EAAE,qBAAqB,CAAC;IAC/B,eAAe,EAAE,OAAO,CAAC;IACzB,SAAS,EAAE,SAAS,CAAC;CACtB;AACD,KAAK,iCAAiC,GAAG,OAAO,CAAC,aAAa,GAAG,sBAAsB,CAAC,CAAC;AAEzF,QAAA,MAAM,uBAAuB,mIAO1B,6BAA6B,sCAyD/B,CAAC;AAEF,OAAO,EAAC,uBAAuB,EAAC,CAAC"}
|
|
@@ -1,87 +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.getGenericMessageParams = void 0;
|
|
22
|
-
const protocol_messaging_1 = require("@wireapp/protocol-messaging");
|
|
23
|
-
const Recipients_1 = require("./Recipients");
|
|
24
|
-
const UserIds_1 = require("./UserIds");
|
|
25
|
-
const conversation_1 = require("../../../../conversation");
|
|
26
|
-
const util_1 = require("../../../../util");
|
|
27
|
-
const getGenericMessageParams = async ({ sendingClientId, conversationId, genericMessage, options: { targetMode = conversation_1.MessageTargetMode.NONE, userIds, nativePush }, useQualifiedIds, apiClient, }) => {
|
|
28
|
-
const plainText = protocol_messaging_1.GenericMessage.encode(genericMessage).finish();
|
|
29
|
-
if (targetMode !== conversation_1.MessageTargetMode.NONE && !userIds) {
|
|
30
|
-
throw new Error('Cannot send targetted message when no userIds are given');
|
|
31
|
-
}
|
|
32
|
-
if (conversationId.domain && useQualifiedIds) {
|
|
33
|
-
if ((0, util_1.isStringArray)(userIds) || (0, util_1.isUserClients)(userIds)) {
|
|
34
|
-
throw new Error('Invalid userIds option for sending to federated backend');
|
|
35
|
-
}
|
|
36
|
-
const recipients = await (0, Recipients_1.getQualifiedRecipientsForConversation)({ apiClient, conversationId, userIds });
|
|
37
|
-
let reportMissing;
|
|
38
|
-
if (targetMode === conversation_1.MessageTargetMode.NONE) {
|
|
39
|
-
reportMissing = (0, util_1.isQualifiedUserClients)(userIds); // we want to check mismatch in case the consumer gave an exact list of users/devices
|
|
40
|
-
}
|
|
41
|
-
else if (targetMode === conversation_1.MessageTargetMode.USERS) {
|
|
42
|
-
reportMissing = (0, UserIds_1.extractQualifiedUserIds)({ userIds });
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
// in case the message is fully targetted at user/client pairs, we do not want to report the missing clients or users at all
|
|
46
|
-
reportMissing = false;
|
|
47
|
-
}
|
|
48
|
-
return {
|
|
49
|
-
federated: true,
|
|
50
|
-
sendingClientId,
|
|
51
|
-
recipients,
|
|
52
|
-
plainText,
|
|
53
|
-
options: {
|
|
54
|
-
conversationId,
|
|
55
|
-
nativePush,
|
|
56
|
-
reportMissing,
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
if ((0, util_1.isQualifiedIdArray)(userIds) || (0, util_1.isQualifiedUserClients)(userIds)) {
|
|
61
|
-
throw new Error('Invalid userIds option for sending');
|
|
62
|
-
}
|
|
63
|
-
const recipients = await (0, Recipients_1.getRecipientsForConversation)({ apiClient, conversationId, userIds });
|
|
64
|
-
let reportMissing;
|
|
65
|
-
if (targetMode === conversation_1.MessageTargetMode.NONE) {
|
|
66
|
-
reportMissing = (0, util_1.isUserClients)(userIds); // we want to check mismatch in case the consumer gave an exact list of users/devices
|
|
67
|
-
}
|
|
68
|
-
else if (targetMode === conversation_1.MessageTargetMode.USERS) {
|
|
69
|
-
reportMissing = (0, UserIds_1.extractUserIds)({ userIds });
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
// in case the message is fully targetted at user/client pairs, we do not want to report the missing clients or users at all
|
|
73
|
-
reportMissing = false;
|
|
74
|
-
}
|
|
75
|
-
return {
|
|
76
|
-
federated: false,
|
|
77
|
-
sendingClientId,
|
|
78
|
-
recipients,
|
|
79
|
-
plainText,
|
|
80
|
-
options: {
|
|
81
|
-
conversationId,
|
|
82
|
-
nativePush,
|
|
83
|
-
reportMissing,
|
|
84
|
-
},
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
exports.getGenericMessageParams = getGenericMessageParams;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export * from './PreKeyBundle';
|
|
2
|
-
export * from '../../../../conversation/ConversationService/Utility/getConversationQualifiedMembers';
|
|
3
|
-
export * from './UserIds';
|
|
4
|
-
export * from './Recipients';
|
|
5
|
-
export * from './isClearFromMismatch';
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/proteus/ProteusService/Utility/index.ts"],"names":[],"mappings":"AAmBA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sFAAsF,CAAC;AACrG,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC"}
|