@wireapp/wire-apps-js-sdk 0.0.1-alpha → 0.1.0
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/README.md +23 -8
- package/build/WireAppSdk.d.ts +22 -7
- package/build/WireAppSdk.d.ts.map +1 -1
- package/build/WireAppSdk.js +69 -47
- package/build/WireAppSdk.js.map +1 -1
- package/build/api/AssetsApiClient.d.ts +4 -4
- package/build/api/AssetsApiClient.d.ts.map +1 -1
- package/build/api/AssetsApiClient.js +7 -7
- package/build/api/AssetsApiClient.js.map +1 -1
- package/build/api/AssetsTransferService.d.ts +3 -3
- package/build/api/AssetsTransferService.d.ts.map +1 -1
- package/build/api/AssetsTransferService.js +9 -10
- package/build/api/AssetsTransferService.js.map +1 -1
- package/build/api/ClientsApiClient.d.ts +4 -4
- package/build/api/ClientsApiClient.d.ts.map +1 -1
- package/build/api/ClientsApiClient.js +7 -7
- package/build/api/ClientsApiClient.js.map +1 -1
- package/build/api/ClientsService.d.ts +3 -3
- package/build/api/ClientsService.d.ts.map +1 -1
- package/build/api/ClientsService.js +3 -3
- package/build/api/ClientsService.js.map +1 -1
- package/build/api/ConversationService.d.ts +34 -22
- package/build/api/ConversationService.d.ts.map +1 -1
- package/build/api/ConversationService.js +91 -84
- package/build/api/ConversationService.js.map +1 -1
- package/build/api/ConversationsApiClient.d.ts +7 -9
- package/build/api/ConversationsApiClient.d.ts.map +1 -1
- package/build/api/ConversationsApiClient.js +10 -20
- package/build/api/ConversationsApiClient.js.map +1 -1
- package/build/api/FeatureConfigsApiClient.d.ts +2 -2
- package/build/api/FeatureConfigsApiClient.d.ts.map +1 -1
- package/build/api/FeatureConfigsApiClient.js +3 -3
- package/build/api/FeatureConfigsApiClient.js.map +1 -1
- package/build/api/FeatureConfigsService.d.ts +1 -1
- package/build/api/FeatureConfigsService.d.ts.map +1 -1
- package/build/api/FeatureConfigsService.js +16 -16
- package/build/api/FeatureConfigsService.js.map +1 -1
- package/build/api/MlsApiClient.d.ts +4 -4
- package/build/api/MlsApiClient.d.ts.map +1 -1
- package/build/api/MlsApiClient.js +12 -12
- package/build/api/MlsApiClient.js.map +1 -1
- package/build/api/MlsService.d.ts +5 -5
- package/build/api/MlsService.d.ts.map +1 -1
- package/build/api/MlsService.js +23 -23
- package/build/api/MlsService.js.map +1 -1
- package/build/api/NotificationsApiClient.d.ts +4 -4
- package/build/api/NotificationsApiClient.d.ts.map +1 -1
- package/build/api/NotificationsApiClient.js +22 -22
- package/build/api/NotificationsApiClient.js.map +1 -1
- package/build/api/OneToOneConversationsApiClient.d.ts +3 -3
- package/build/api/OneToOneConversationsApiClient.d.ts.map +1 -1
- package/build/api/OneToOneConversationsApiClient.js +4 -4
- package/build/api/OneToOneConversationsApiClient.js.map +1 -1
- package/build/api/SearchApiClient.d.ts +2 -2
- package/build/api/SearchApiClient.d.ts.map +1 -1
- package/build/api/SearchApiClient.js +9 -8
- package/build/api/SearchApiClient.js.map +1 -1
- package/build/api/SelfApiClient.d.ts +9 -0
- package/build/api/SelfApiClient.d.ts.map +1 -0
- package/build/api/SelfApiClient.js +42 -0
- package/build/api/SelfApiClient.js.map +1 -0
- package/build/api/SelfService.d.ts +12 -0
- package/build/api/SelfService.d.ts.map +1 -0
- package/build/api/SelfService.js +81 -0
- package/build/api/SelfService.js.map +1 -0
- package/build/api/TeamsApiClient.d.ts +3 -3
- package/build/api/TeamsApiClient.d.ts.map +1 -1
- package/build/api/TeamsApiClient.js +4 -4
- package/build/api/TeamsApiClient.js.map +1 -1
- package/build/api/UserService.d.ts +6 -5
- package/build/api/UserService.d.ts.map +1 -1
- package/build/api/UserService.js +20 -11
- package/build/api/UserService.js.map +1 -1
- package/build/api/UsersApiClient.d.ts +8 -5
- package/build/api/UsersApiClient.d.ts.map +1 -1
- package/build/api/UsersApiClient.js +13 -8
- package/build/api/UsersApiClient.js.map +1 -1
- package/build/api/model/AddMembersToConversationResult.d.ts +1 -1
- package/build/api/model/AddMembersToConversationResult.d.ts.map +1 -1
- package/build/api/model/AddMembersToConversationResult.js +14 -14
- package/build/api/model/AddMembersToConversationResult.js.map +1 -1
- package/build/api/model/ConversationIdsPaginationConfig.js +14 -14
- package/build/api/model/ConversationIdsPaginationConfig.js.map +1 -1
- package/build/api/model/ConversationMemberOtherResponse.d.ts +2 -2
- package/build/api/model/ConversationMemberOtherResponse.d.ts.map +1 -1
- package/build/api/model/ConversationMemberOtherResponse.js +14 -14
- package/build/api/model/ConversationMemberOtherResponse.js.map +1 -1
- package/build/api/model/ConversationMemberSelfResponse.d.ts +2 -2
- package/build/api/model/ConversationMemberSelfResponse.d.ts.map +1 -1
- package/build/api/model/ConversationMemberSelfResponse.js +14 -14
- package/build/api/model/ConversationMemberSelfResponse.js.map +1 -1
- package/build/api/model/ConversationMembersResponse.d.ts +2 -2
- package/build/api/model/ConversationMembersResponse.d.ts.map +1 -1
- package/build/api/model/ConversationMembersResponse.js +14 -14
- package/build/api/model/ConversationMembersResponse.js.map +1 -1
- package/build/api/model/RemoveMembersFromConversationResult.d.ts +1 -1
- package/build/api/model/RemoveMembersFromConversationResult.d.ts.map +1 -1
- package/build/api/model/RemoveMembersFromConversationResult.js +14 -14
- package/build/api/model/RemoveMembersFromConversationResult.js.map +1 -1
- package/build/api/model/UserClientResponse.js +14 -14
- package/build/api/model/UserClientResponse.js.map +1 -1
- package/build/api/model/UserResponse.d.ts +4 -2
- package/build/api/model/UserResponse.d.ts.map +1 -1
- package/build/api/model/UserResponse.js +14 -14
- package/build/api/model/UserResponse.js.map +1 -1
- package/build/api/model/asset/AssetUploadData.d.ts.map +1 -1
- package/build/api/model/asset/AssetUploadResponse.d.ts.map +1 -1
- package/build/api/request/CapabilitiesRequest.js +14 -14
- package/build/api/request/CapabilitiesRequest.js.map +1 -1
- package/build/api/request/ClientUpdateRequest.d.ts +1 -1
- package/build/api/request/ClientUpdateRequest.d.ts.map +1 -1
- package/build/api/request/ClientUpdateRequest.js +14 -14
- package/build/api/request/ClientUpdateRequest.js.map +1 -1
- package/build/api/request/ConversationIdsRequest.d.ts +1 -1
- package/build/api/request/ConversationIdsRequest.js +14 -14
- package/build/api/request/ConversationIdsRequest.js.map +1 -1
- package/build/api/request/CreateConversationRequest.d.ts +9 -9
- package/build/api/request/CreateConversationRequest.d.ts.map +1 -1
- package/build/api/request/CreateConversationRequest.js +8 -11
- package/build/api/request/CreateConversationRequest.js.map +1 -1
- package/build/api/request/MlsKeyPackagesRequest.js +14 -14
- package/build/api/request/MlsKeyPackagesRequest.js.map +1 -1
- package/build/api/request/PreKeyRequest.d.ts.map +1 -1
- package/build/api/request/PreKeyRequest.js +14 -14
- package/build/api/request/PreKeyRequest.js.map +1 -1
- package/build/api/request/RegisterClientRequest.d.ts +2 -2
- package/build/api/request/RegisterClientRequest.d.ts.map +1 -1
- package/build/api/request/RegisterClientRequest.js +18 -20
- package/build/api/request/RegisterClientRequest.js.map +1 -1
- package/build/api/response/ClaimedKeyPackageList.d.ts.map +1 -1
- package/build/api/response/ClaimedKeyPackageList.js +14 -14
- package/build/api/response/ClaimedKeyPackageList.js.map +1 -1
- package/build/api/response/ConversationIdsResponse.d.ts +1 -1
- package/build/api/response/ConversationIdsResponse.js +14 -14
- package/build/api/response/ConversationIdsResponse.js.map +1 -1
- package/build/api/response/ConversationResponse.d.ts +4 -4
- package/build/api/response/ConversationResponse.d.ts.map +1 -1
- package/build/api/response/ConversationResponse.js +14 -14
- package/build/api/response/ConversationResponse.js.map +1 -1
- package/build/api/response/ConversationsResponse.d.ts +2 -2
- package/build/api/response/ConversationsResponse.js +14 -14
- package/build/api/response/ConversationsResponse.js.map +1 -1
- package/build/api/response/EventResponse.d.ts +1 -1
- package/build/api/response/EventResponse.d.ts.map +1 -1
- package/build/api/response/EventResponse.js +14 -14
- package/build/api/response/EventResponse.js.map +1 -1
- package/build/api/response/FeatureConfigsResponse.d.ts +1 -1
- package/build/api/response/FeatureConfigsResponse.d.ts.map +1 -1
- package/build/api/response/FeatureConfigsResponse.js +14 -14
- package/build/api/response/FeatureConfigsResponse.js.map +1 -1
- package/build/api/response/ListUsersResponse.d.ts +7 -0
- package/build/api/response/ListUsersResponse.d.ts.map +1 -0
- package/build/api/response/ListUsersResponse.js +17 -0
- package/build/api/response/ListUsersResponse.js.map +1 -0
- package/build/api/response/MlsPublicKeysResponse.d.ts +2 -2
- package/build/api/response/MlsPublicKeysResponse.d.ts.map +1 -1
- package/build/api/response/MlsPublicKeysResponse.js +18 -17
- package/build/api/response/MlsPublicKeysResponse.js.map +1 -1
- package/build/api/response/NotificationsResponse.d.ts +1 -1
- package/build/api/response/NotificationsResponse.js +14 -14
- package/build/api/response/NotificationsResponse.js.map +1 -1
- package/build/api/response/OneToOneConversationResponse.d.ts +2 -2
- package/build/api/response/OneToOneConversationResponse.d.ts.map +1 -1
- package/build/api/response/OneToOneConversationResponse.js +14 -14
- package/build/api/response/OneToOneConversationResponse.js.map +1 -1
- package/build/api/response/RegisterClientResponse.js +14 -14
- package/build/api/response/RegisterClientResponse.js.map +1 -1
- package/build/api/response/SearchContactsResponse.d.ts +1 -1
- package/build/api/response/SearchContactsResponse.d.ts.map +1 -1
- package/build/api/response/SelfResponse.d.ts +6 -0
- package/build/api/response/SelfResponse.d.ts.map +1 -0
- package/build/api/response/SelfResponse.js +17 -0
- package/build/api/response/SelfResponse.js.map +1 -0
- package/build/core/BackendConnectionListener.d.ts +31 -0
- package/build/core/BackendConnectionListener.d.ts.map +1 -0
- package/build/core/BackendConnectionListener.js +17 -0
- package/build/core/BackendConnectionListener.js.map +1 -0
- package/build/core/CoreCryptoClient.d.ts +10 -7
- package/build/core/CoreCryptoClient.d.ts.map +1 -1
- package/build/core/CoreCryptoClient.js +49 -32
- package/build/core/CoreCryptoClient.js.map +1 -1
- package/build/core/CoreCryptoMlsTransport.d.ts +2 -2
- package/build/core/CoreCryptoMlsTransport.d.ts.map +1 -1
- package/build/core/CoreCryptoMlsTransport.js +18 -17
- package/build/core/CoreCryptoMlsTransport.js.map +1 -1
- package/build/core/CoreCryptoService.d.ts +15 -14
- package/build/core/CoreCryptoService.d.ts.map +1 -1
- package/build/core/CoreCryptoService.js +67 -55
- package/build/core/CoreCryptoService.js.map +1 -1
- package/build/core/HttpClient.d.ts +1 -1
- package/build/core/HttpClient.d.ts.map +1 -1
- package/build/core/HttpClient.js +66 -76
- package/build/core/HttpClient.js.map +1 -1
- package/build/core/HttpRetryHelper.d.ts +1 -1
- package/build/core/HttpRetryHelper.d.ts.map +1 -1
- package/build/core/HttpRetryHelper.js +4 -4
- package/build/core/HttpRetryHelper.js.map +1 -1
- package/build/core/HttpRetryPolicy.js.map +1 -1
- package/build/core/WebSocketClient.d.ts +9 -4
- package/build/core/WebSocketClient.d.ts.map +1 -1
- package/build/core/WebSocketClient.js +66 -35
- package/build/core/WebSocketClient.js.map +1 -1
- package/build/core/WireApplicationManager.d.ts +24 -15
- package/build/core/WireApplicationManager.d.ts.map +1 -1
- package/build/core/WireApplicationManager.js +67 -32
- package/build/core/WireApplicationManager.js.map +1 -1
- package/build/core/WireEventsHandler.d.ts +7 -8
- package/build/core/WireEventsHandler.d.ts.map +1 -1
- package/build/core/WireEventsHandler.js +9 -13
- package/build/core/WireEventsHandler.js.map +1 -1
- package/build/core/event/DeleteConversationEventProcessor.d.ts +4 -4
- package/build/core/event/DeleteConversationEventProcessor.d.ts.map +1 -1
- package/build/core/event/DeleteConversationEventProcessor.js +7 -7
- package/build/core/event/DeleteConversationEventProcessor.js.map +1 -1
- package/build/core/event/EventProcessor.d.ts +2 -2
- package/build/core/event/EventProcessor.d.ts.map +1 -1
- package/build/core/event/EventRouter.d.ts +3 -3
- package/build/core/event/EventRouter.d.ts.map +1 -1
- package/build/core/event/EventRouter.js +18 -18
- package/build/core/event/EventRouter.js.map +1 -1
- package/build/core/event/MemberJoinEventProcessor.d.ts +4 -4
- package/build/core/event/MemberJoinEventProcessor.d.ts.map +1 -1
- package/build/core/event/MemberJoinEventProcessor.js +14 -11
- package/build/core/event/MemberJoinEventProcessor.js.map +1 -1
- package/build/core/event/MemberLeaveEventProcessor.d.ts +4 -4
- package/build/core/event/MemberLeaveEventProcessor.d.ts.map +1 -1
- package/build/core/event/MemberLeaveEventProcessor.js +12 -9
- package/build/core/event/MemberLeaveEventProcessor.js.map +1 -1
- package/build/core/event/MemberUpdateEventProcessor.d.ts +3 -3
- package/build/core/event/MemberUpdateEventProcessor.d.ts.map +1 -1
- package/build/core/event/MemberUpdateEventProcessor.js +6 -6
- package/build/core/event/MemberUpdateEventProcessor.js.map +1 -1
- package/build/core/event/MessageTimerUpdateEventProcessor.d.ts +11 -0
- package/build/core/event/MessageTimerUpdateEventProcessor.d.ts.map +1 -0
- package/build/core/event/MessageTimerUpdateEventProcessor.js +49 -0
- package/build/core/event/MessageTimerUpdateEventProcessor.js.map +1 -0
- package/build/core/event/MlsMessageEventProcessor.d.ts +6 -6
- package/build/core/event/MlsMessageEventProcessor.d.ts.map +1 -1
- package/build/core/event/MlsMessageEventProcessor.js +31 -26
- package/build/core/event/MlsMessageEventProcessor.js.map +1 -1
- package/build/core/event/MlsResetEventProcessor.d.ts +3 -3
- package/build/core/event/MlsResetEventProcessor.d.ts.map +1 -1
- package/build/core/event/MlsResetEventProcessor.js +6 -6
- package/build/core/event/MlsResetEventProcessor.js.map +1 -1
- package/build/core/event/MlsWelcomeEventProcessor.d.ts +7 -7
- package/build/core/event/MlsWelcomeEventProcessor.d.ts.map +1 -1
- package/build/core/event/MlsWelcomeEventProcessor.js +12 -12
- package/build/core/event/MlsWelcomeEventProcessor.js.map +1 -1
- package/build/core/event/NewConversationEventProcessor.d.ts +3 -3
- package/build/core/event/NewConversationEventProcessor.d.ts.map +1 -1
- package/build/core/event/NewConversationEventProcessor.js +6 -6
- package/build/core/event/NewConversationEventProcessor.js.map +1 -1
- package/build/core/event/processors.index.d.ts +9 -8
- package/build/core/event/processors.index.d.ts.map +1 -1
- package/build/core/event/processors.index.js +9 -8
- package/build/core/event/processors.index.js.map +1 -1
- package/build/db/AppPropertiesRepository.d.ts +2 -2
- package/build/db/AppPropertiesRepository.d.ts.map +1 -1
- package/build/db/AppPropertiesRepository.js +34 -23
- package/build/db/AppPropertiesRepository.js.map +1 -1
- package/build/db/ConversationMemberRepository.d.ts +3 -3
- package/build/db/ConversationMemberRepository.d.ts.map +1 -1
- package/build/db/ConversationMemberRepository.js +40 -26
- package/build/db/ConversationMemberRepository.js.map +1 -1
- package/build/db/ConversationRepository.d.ts +7 -2
- package/build/db/ConversationRepository.d.ts.map +1 -1
- package/build/db/ConversationRepository.js +72 -46
- package/build/db/ConversationRepository.js.map +1 -1
- package/build/db/DatabaseService.d.ts.map +1 -1
- package/build/db/DatabaseService.js +29 -27
- package/build/db/DatabaseService.js.map +1 -1
- package/build/db/migrations/0002_perfect_karnak.sql +1 -0
- package/build/db/migrations/meta/0002_snapshot.json +204 -0
- package/build/db/migrations/meta/_journal.json +7 -0
- package/build/db/model/AppEntity.js +14 -14
- package/build/db/model/AppEntity.js.map +1 -1
- package/build/db/model/ConversationEntity.d.ts +2 -1
- package/build/db/model/ConversationEntity.d.ts.map +1 -1
- package/build/db/model/ConversationEntity.js +14 -14
- package/build/db/model/ConversationEntity.js.map +1 -1
- package/build/db/model/ConversationMemberEntity.js +14 -14
- package/build/db/model/ConversationMemberEntity.js.map +1 -1
- package/build/db/relations.d.ts.map +1 -1
- package/build/db/relations.js +4 -4
- package/build/db/relations.js.map +1 -1
- package/build/db/schema.d.ts +17 -0
- package/build/db/schema.d.ts.map +1 -1
- package/build/db/schema.js +27 -19
- package/build/db/schema.js.map +1 -1
- package/build/exception/CoreCryptoMlsException.d.ts.map +1 -0
- package/build/exception/CoreCryptoMlsException.js +25 -0
- package/build/exception/CoreCryptoMlsException.js.map +1 -0
- package/build/exception/MlsException.d.ts.map +1 -0
- package/build/exception/MlsException.js +25 -0
- package/build/exception/MlsException.js.map +1 -0
- package/build/exception/WireApiError.d.ts.map +1 -0
- package/build/exception/WireApiError.js +17 -0
- package/build/exception/WireApiError.js.map +1 -0
- package/build/{model/exception → exception}/WireApiException.d.ts +1 -1
- package/build/exception/WireApiException.d.ts.map +1 -0
- package/build/{model/exception → exception}/WireApiException.js +2 -2
- package/build/exception/WireApiException.js.map +1 -0
- package/build/exception/WireException.d.ts +41 -0
- package/build/exception/WireException.d.ts.map +1 -0
- package/build/exception/WireException.js +81 -0
- package/build/exception/WireException.js.map +1 -0
- package/build/index.d.ts +18 -12
- package/build/index.d.ts.map +1 -1
- package/build/index.js +27 -22
- package/build/index.js.map +1 -1
- package/build/mappers/PreKeyMapper.d.ts +2 -2
- package/build/mappers/PreKeyMapper.d.ts.map +1 -1
- package/build/mappers/PreKeyMapper.js +14 -14
- package/build/mappers/PreKeyMapper.js.map +1 -1
- package/build/mappers/conversation/ConversationMapper.d.ts +2 -2
- package/build/mappers/conversation/ConversationMapper.d.ts.map +1 -1
- package/build/mappers/conversation/ConversationMapper.js +16 -15
- package/build/mappers/conversation/ConversationMapper.js.map +1 -1
- package/build/mappers/conversation/ConversationMemberMapper.d.ts +2 -2
- package/build/mappers/conversation/ConversationMemberMapper.d.ts.map +1 -1
- package/build/mappers/conversation/ConversationMemberMapper.js +15 -15
- package/build/mappers/conversation/ConversationMemberMapper.js.map +1 -1
- package/build/mappers/protobuf/EncryptionAlgorithmMapper.d.ts +4 -4
- package/build/mappers/protobuf/EncryptionAlgorithmMapper.d.ts.map +1 -1
- package/build/mappers/protobuf/EncryptionAlgorithmMapper.js +28 -23
- package/build/mappers/protobuf/EncryptionAlgorithmMapper.js.map +1 -1
- package/build/mappers/protobuf/MessageContentEncoder.d.ts +1 -1
- package/build/mappers/protobuf/MessageContentEncoder.d.ts.map +1 -1
- package/build/mappers/protobuf/MessageContentEncoder.js +4 -4
- package/build/mappers/protobuf/MessageContentEncoder.js.map +1 -1
- package/build/mappers/protobuf/MessageLinkPreviewMapper.d.ts +4 -4
- package/build/mappers/protobuf/MessageLinkPreviewMapper.d.ts.map +1 -1
- package/build/mappers/protobuf/MessageLinkPreviewMapper.js +18 -17
- package/build/mappers/protobuf/MessageLinkPreviewMapper.js.map +1 -1
- package/build/mappers/protobuf/MessageMentionMapper.d.ts +4 -4
- package/build/mappers/protobuf/MessageMentionMapper.d.ts.map +1 -1
- package/build/mappers/protobuf/MessageMentionMapper.js +16 -16
- package/build/mappers/protobuf/MessageMentionMapper.js.map +1 -1
- package/build/mappers/protobuf/ProtobufDeserializer.d.ts +2 -2
- package/build/mappers/protobuf/ProtobufDeserializer.d.ts.map +1 -1
- package/build/mappers/protobuf/ProtobufDeserializer.js +44 -40
- package/build/mappers/protobuf/ProtobufDeserializer.js.map +1 -1
- package/build/mappers/protobuf/ProtobufSerializer.d.ts.map +1 -1
- package/build/mappers/protobuf/ProtobufSerializer.js +51 -47
- package/build/mappers/protobuf/ProtobufSerializer.js.map +1 -1
- package/build/model/Asset.d.ts +1 -1
- package/build/model/Asset.d.ts.map +1 -1
- package/build/model/Asset.js +14 -14
- package/build/model/Asset.js.map +1 -1
- package/build/model/ClaimedKeyPackagesResult.d.ts +1 -1
- package/build/model/ClaimedKeyPackagesResult.d.ts.map +1 -1
- package/build/model/ClaimedKeyPackagesResult.js +14 -14
- package/build/model/ClaimedKeyPackagesResult.js.map +1 -1
- package/build/model/CryptoClientId.d.ts.map +1 -1
- package/build/model/CryptoClientId.js +14 -14
- package/build/model/CryptoClientId.js.map +1 -1
- package/build/model/CryptoProtocol.js +14 -14
- package/build/model/CryptoProtocol.js.map +1 -1
- package/build/model/DecryptedMlsMessage.d.ts +6 -0
- package/build/model/DecryptedMlsMessage.d.ts.map +1 -0
- package/build/model/DecryptedMlsMessage.js +17 -0
- package/build/model/DecryptedMlsMessage.js.map +1 -0
- package/build/model/EventContentDTO.d.ts +14 -4
- package/build/model/EventContentDTO.d.ts.map +1 -1
- package/build/model/EventContentDTO.js +14 -14
- package/build/model/EventContentDTO.js.map +1 -1
- package/build/model/PreKeyCrypto.js +14 -14
- package/build/model/PreKeyCrypto.js.map +1 -1
- package/build/model/QualifiedId.d.ts +4 -0
- package/build/model/QualifiedId.d.ts.map +1 -1
- package/build/model/QualifiedId.js +21 -15
- package/build/model/QualifiedId.js.map +1 -1
- package/build/model/TeamId.js +15 -15
- package/build/model/TeamId.js.map +1 -1
- package/build/model/UserType.d.ts +6 -0
- package/build/model/UserType.d.ts.map +1 -0
- package/build/model/UserType.js +22 -0
- package/build/model/UserType.js.map +1 -0
- package/build/model/WireMessage.d.ts +5 -5
- package/build/model/WireMessage.d.ts.map +1 -1
- package/build/model/WireMessage.js +43 -45
- package/build/model/WireMessage.js.map +1 -1
- package/build/model/WireUser.d.ts +5 -3
- package/build/model/WireUser.d.ts.map +1 -1
- package/build/model/WireUser.js +3 -1
- package/build/model/WireUser.js.map +1 -1
- package/build/model/conversation/Conversation.d.ts +2 -1
- package/build/model/conversation/Conversation.d.ts.map +1 -1
- package/build/model/conversation/Conversation.js +15 -15
- package/build/model/conversation/Conversation.js.map +1 -1
- package/build/model/conversation/ConversationMember.d.ts +2 -2
- package/build/model/conversation/ConversationMember.d.ts.map +1 -1
- package/build/model/conversation/ConversationMember.js +14 -14
- package/build/model/conversation/ConversationMember.js.map +1 -1
- package/build/model/conversation/ConversationRole.d.ts.map +1 -1
- package/build/model/conversation/ConversationRole.js +14 -14
- package/build/model/conversation/ConversationRole.js.map +1 -1
- package/build/model/conversation/ConversationType.js +14 -14
- package/build/model/conversation/ConversationType.js.map +1 -1
- package/build/model/protobuf/MessageEncryptionAlgorithm.d.ts.map +1 -1
- package/build/model/protobuf/MessageEncryptionAlgorithm.js +14 -14
- package/build/model/protobuf/MessageEncryptionAlgorithm.js.map +1 -1
- package/build/service/AppProperties.d.ts +12 -1
- package/build/service/AppProperties.d.ts.map +1 -1
- package/build/service/AppProperties.js +60 -26
- package/build/service/AppProperties.js.map +1 -1
- package/build/service/MlsFallbackStrategy.d.ts +3 -3
- package/build/service/MlsFallbackStrategy.d.ts.map +1 -1
- package/build/service/MlsFallbackStrategy.js +18 -18
- package/build/service/MlsFallbackStrategy.js.map +1 -1
- package/build/service/NotificationsService.d.ts +3 -3
- package/build/service/NotificationsService.d.ts.map +1 -1
- package/build/service/NotificationsService.js +19 -19
- package/build/service/NotificationsService.js.map +1 -1
- package/build/utils/AESUtils.d.ts +1 -1
- package/build/utils/AESUtils.d.ts.map +1 -1
- package/build/utils/AESUtils.js +15 -15
- package/build/utils/AESUtils.js.map +1 -1
- package/build/utils/BufferUtils.d.ts.map +1 -1
- package/build/utils/BufferUtils.js +15 -15
- package/build/utils/BufferUtils.js.map +1 -1
- package/build/utils/DependencyInjectionTokens.d.ts +0 -2
- package/build/utils/DependencyInjectionTokens.d.ts.map +1 -1
- package/build/utils/DependencyInjectionTokens.js +19 -21
- package/build/utils/DependencyInjectionTokens.js.map +1 -1
- package/build/utils/HashUtils.js +14 -14
- package/build/utils/HashUtils.js.map +1 -1
- package/build/utils/ObfuscateUtil.js +15 -15
- package/build/utils/ObfuscateUtil.js.map +1 -1
- package/build/utils/StoragePaths.js +18 -18
- package/build/utils/StoragePaths.js.map +1 -1
- package/build/utils/logger/ConsoleLogger.d.ts +2 -2
- package/build/utils/logger/ConsoleLogger.d.ts.map +1 -1
- package/build/utils/logger/ConsoleLogger.js +1 -1
- package/build/utils/logger/ConsoleLogger.js.map +1 -1
- package/build/utils/logger/Logger.d.ts.map +1 -1
- package/build/utils/logger/LoggerFactory.d.ts +1 -1
- package/build/utils/logger/LoggerFactory.d.ts.map +1 -1
- package/build/utils/logger/LoggerFactory.js +2 -2
- package/build/utils/logger/LoggerFactory.js.map +1 -1
- package/package.json +22 -8
- package/src/WireAppSdk.ts +78 -65
- package/src/api/AssetsApiClient.ts +20 -35
- package/src/api/AssetsTransferService.ts +20 -32
- package/src/api/ClientsApiClient.ts +16 -29
- package/src/api/ClientsService.ts +7 -14
- package/src/api/ConversationService.ts +221 -154
- package/src/api/ConversationsApiClient.ts +25 -29
- package/src/api/FeatureConfigsApiClient.ts +4 -4
- package/src/api/FeatureConfigsService.ts +17 -17
- package/src/api/MlsApiClient.ts +23 -31
- package/src/api/MlsService.ts +31 -41
- package/src/api/NotificationsApiClient.ts +27 -32
- package/src/api/OneToOneConversationsApiClient.ts +7 -10
- package/src/api/SearchApiClient.ts +20 -22
- package/src/api/SelfApiClient.ts +30 -0
- package/src/api/SelfService.ts +81 -0
- package/src/api/TeamsApiClient.ts +10 -10
- package/src/api/UserService.ts +43 -38
- package/src/api/UsersApiClient.ts +27 -23
- package/src/api/model/AddMembersToConversationResult.ts +15 -15
- package/src/api/model/ConversationIdsPaginationConfig.ts +14 -14
- package/src/api/model/ConversationMemberOtherResponse.ts +16 -16
- package/src/api/model/ConversationMemberSelfResponse.ts +16 -16
- package/src/api/model/ConversationMembersResponse.ts +17 -17
- package/src/api/model/RemoveMembersFromConversationResult.ts +15 -15
- package/src/api/model/UserClientResponse.ts +14 -14
- package/src/api/model/UserResponse.ts +18 -16
- package/src/api/model/asset/AssetUploadData.ts +2 -2
- package/src/api/model/asset/AssetUploadResponse.ts +3 -3
- package/src/api/request/CapabilitiesRequest.ts +15 -15
- package/src/api/request/ClientUpdateRequest.ts +15 -15
- package/src/api/request/ConversationIdsRequest.ts +15 -15
- package/src/api/request/CreateConversationRequest.ts +11 -14
- package/src/api/request/MlsKeyPackagesRequest.ts +14 -14
- package/src/api/request/PreKeyRequest.ts +15 -18
- package/src/api/request/RegisterClientRequest.ts +19 -21
- package/src/api/response/ClaimedKeyPackageList.ts +18 -18
- package/src/api/response/ConversationIdsResponse.ts +15 -15
- package/src/api/response/ConversationResponse.ts +18 -18
- package/src/api/response/ConversationsResponse.ts +16 -16
- package/src/api/response/EventResponse.ts +17 -17
- package/src/api/response/FeatureConfigsResponse.ts +15 -15
- package/src/api/response/ListUsersResponse.ts +23 -0
- package/src/api/response/MlsPublicKeysResponse.ts +24 -23
- package/src/api/response/NotificationsResponse.ts +15 -15
- package/src/api/response/OneToOneConversationResponse.ts +16 -17
- package/src/api/response/RegisterClientResponse.ts +14 -14
- package/src/api/response/SearchContactsResponse.ts +10 -10
- package/src/api/response/SelfResponse.ts +22 -0
- package/src/core/BackendConnectionListener.ts +47 -0
- package/src/core/CoreCryptoClient.ts +93 -117
- package/src/core/CoreCryptoMlsTransport.ts +24 -25
- package/src/core/CoreCryptoService.ts +93 -98
- package/src/core/HttpClient.ts +106 -125
- package/src/core/HttpRetryHelper.ts +6 -9
- package/src/core/HttpRetryPolicy.ts +5 -5
- package/src/core/WebSocketClient.ts +87 -47
- package/src/core/WireApplicationManager.ts +120 -68
- package/src/core/WireEventsHandler.ts +26 -35
- package/src/core/event/DeleteConversationEventProcessor.ts +16 -17
- package/src/core/event/EventProcessor.ts +3 -3
- package/src/core/event/EventRouter.ts +31 -35
- package/src/core/event/MemberJoinEventProcessor.ts +24 -21
- package/src/core/event/MemberLeaveEventProcessor.ts +23 -17
- package/src/core/event/MemberUpdateEventProcessor.ts +15 -16
- package/src/core/event/MessageTimerUpdateEventProcessor.ts +41 -0
- package/src/core/event/MlsMessageEventProcessor.ts +48 -38
- package/src/core/event/MlsResetEventProcessor.ts +13 -16
- package/src/core/event/MlsWelcomeEventProcessor.ts +24 -29
- package/src/core/event/NewConversationEventProcessor.ts +14 -15
- package/src/core/event/processors.index.ts +9 -8
- package/src/db/AppPropertiesRepository.ts +45 -39
- package/src/db/ConversationMemberRepository.ts +85 -77
- package/src/db/ConversationRepository.ts +86 -71
- package/src/db/DatabaseService.ts +34 -32
- package/src/db/migrations/0002_perfect_karnak.sql +1 -0
- package/src/db/migrations/meta/0002_snapshot.json +204 -0
- package/src/db/migrations/meta/_journal.json +7 -0
- package/src/db/model/AppEntity.ts +14 -14
- package/src/db/model/ConversationEntity.ts +16 -15
- package/src/db/model/ConversationMemberEntity.ts +14 -14
- package/src/db/relations.ts +6 -6
- package/src/db/schema.ts +47 -33
- package/src/exception/CoreCryptoMlsException.ts +26 -0
- package/src/exception/MlsException.ts +26 -0
- package/src/exception/WireApiError.ts +21 -0
- package/src/{model/exception → exception}/WireApiException.ts +9 -9
- package/src/exception/WireException.ts +94 -0
- package/src/index.ts +43 -27
- package/src/mappers/PreKeyMapper.ts +16 -16
- package/src/mappers/conversation/ConversationMapper.ts +18 -17
- package/src/mappers/conversation/ConversationMemberMapper.ts +18 -19
- package/src/mappers/protobuf/EncryptionAlgorithmMapper.ts +32 -27
- package/src/mappers/protobuf/MessageContentEncoder.ts +34 -50
- package/src/mappers/protobuf/MessageLinkPreviewMapper.ts +38 -37
- package/src/mappers/protobuf/MessageMentionMapper.ts +22 -22
- package/src/mappers/protobuf/ProtobufDeserializer.ts +78 -72
- package/src/mappers/protobuf/ProtobufSerializer.ts +137 -155
- package/src/model/Asset.ts +18 -18
- package/src/model/ClaimedKeyPackagesResult.ts +17 -17
- package/src/model/CryptoClientId.ts +16 -25
- package/src/model/CryptoProtocol.ts +17 -17
- package/src/model/DecryptedMlsMessage.ts +22 -0
- package/src/model/EventContentDTO.ts +36 -24
- package/src/model/PreKeyCrypto.ts +14 -14
- package/src/model/QualifiedId.ts +25 -18
- package/src/model/TeamId.ts +15 -15
- package/src/model/UserType.ts +21 -0
- package/src/model/WireMessage.ts +164 -196
- package/src/model/WireUser.ts +4 -3
- package/src/model/conversation/ChannelAddPermissionType.ts +2 -3
- package/src/model/conversation/Conversation.ts +16 -15
- package/src/model/conversation/ConversationAccess.ts +5 -6
- package/src/model/conversation/ConversationAccessRole.ts +5 -6
- package/src/model/conversation/ConversationMember.ts +16 -16
- package/src/model/conversation/ConversationRole.ts +17 -18
- package/src/model/conversation/ConversationType.ts +14 -14
- package/src/model/conversation/GroupConversationType.ts +2 -3
- package/src/model/conversation/ReceiptMode.ts +0 -1
- package/src/model/protobuf/MessageEncryptionAlgorithm.ts +18 -15
- package/src/service/AppProperties.ts +76 -40
- package/src/service/MlsFallbackStrategy.ts +21 -24
- package/src/service/NotificationsService.ts +22 -22
- package/src/utils/AESUtils.ts +25 -28
- package/src/utils/BufferUtils.ts +16 -16
- package/src/utils/DependencyInjectionTokens.ts +19 -21
- package/src/utils/HashUtils.ts +15 -15
- package/src/utils/ObfuscateUtil.ts +15 -15
- package/src/utils/StoragePaths.ts +18 -18
- package/src/utils/logger/ConsoleLogger.ts +8 -9
- package/src/utils/logger/LogLevel.ts +1 -1
- package/src/utils/logger/Logger.ts +4 -4
- package/src/utils/logger/LoggerFactory.ts +6 -6
- package/build/model/exception/CoreCryptoMlsException.d.ts.map +0 -1
- package/build/model/exception/CoreCryptoMlsException.js +0 -25
- package/build/model/exception/CoreCryptoMlsException.js.map +0 -1
- package/build/model/exception/MlsException.d.ts.map +0 -1
- package/build/model/exception/MlsException.js +0 -25
- package/build/model/exception/MlsException.js.map +0 -1
- package/build/model/exception/WireApiError.d.ts.map +0 -1
- package/build/model/exception/WireApiError.js +0 -17
- package/build/model/exception/WireApiError.js.map +0 -1
- package/build/model/exception/WireApiException.d.ts.map +0 -1
- package/build/model/exception/WireApiException.js.map +0 -1
- package/src/model/exception/CoreCryptoMlsException.ts +0 -26
- package/src/model/exception/MlsException.ts +0 -26
- package/src/model/exception/WireApiError.ts +0 -21
- /package/build/{model/exception → exception}/CoreCryptoMlsException.d.ts +0 -0
- /package/build/{model/exception → exception}/MlsException.d.ts +0 -0
- /package/build/{model/exception → exception}/WireApiError.d.ts +0 -0
|
@@ -1,29 +1,20 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Wire
|
|
3
|
-
* Copyright (C) 2025 Wire Swiss GmbH
|
|
4
|
-
*
|
|
5
|
-
* This program is free software: you can redistribute it and/or modify
|
|
6
|
-
* it under the terms of the GNU General Public License as published by
|
|
7
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
* (at your option) any later version.
|
|
9
|
-
* This program is distributed in the hope that it will be useful,
|
|
10
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
-
* GNU General Public License for more details.
|
|
13
|
-
* You should have received a copy of the GNU General Public License
|
|
14
|
-
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import
|
|
18
|
-
Asset,
|
|
19
|
-
Composite as ProtobufComposite,
|
|
20
|
-
IAsset,
|
|
21
|
-
IButtonAction,
|
|
22
|
-
IButtonActionConfirmation,
|
|
23
|
-
IGenericMessage,
|
|
24
|
-
IText
|
|
25
|
-
} from "../../generated/messages.js";
|
|
26
|
-
import rootMessage from "../../generated/messages.js";
|
|
2
|
+
* Wire
|
|
3
|
+
* Copyright (C) 2025 Wire Swiss GmbH
|
|
4
|
+
*
|
|
5
|
+
* This program is free software: you can redistribute it and/or modify
|
|
6
|
+
* it under the terms of the GNU General Public License as published by
|
|
7
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
* (at your option) any later version.
|
|
9
|
+
* This program is distributed in the hope that it will be useful,
|
|
10
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
* GNU General Public License for more details.
|
|
13
|
+
* You should have received a copy of the GNU General Public License
|
|
14
|
+
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import protobufMessage from '../../generated/messages.js'
|
|
27
18
|
import {
|
|
28
19
|
AssetMessage,
|
|
29
20
|
CompositeButton,
|
|
@@ -42,21 +33,10 @@ import {
|
|
|
42
33
|
TextMessage,
|
|
43
34
|
type WireMessage,
|
|
44
35
|
WireMessageType
|
|
45
|
-
} from '../../model/WireMessage.js'
|
|
46
|
-
import {MessageLinkPreviewMapper} from
|
|
47
|
-
import {MessageMentionMapper} from
|
|
48
|
-
|
|
49
|
-
const {
|
|
50
|
-
GenericMessage,
|
|
51
|
-
Composite,
|
|
52
|
-
Ephemeral,
|
|
53
|
-
Knock,
|
|
54
|
-
Location: ProtobufLocation,
|
|
55
|
-
MessageDelete,
|
|
56
|
-
Confirmation,
|
|
57
|
-
MessageEdit,
|
|
58
|
-
Reaction: ProtobufReaction
|
|
59
|
-
} = rootMessage;
|
|
36
|
+
} from '../../model/WireMessage.js'
|
|
37
|
+
import {MessageLinkPreviewMapper} from './MessageLinkPreviewMapper.js'
|
|
38
|
+
import {MessageMentionMapper} from './MessageMentionMapper.js'
|
|
39
|
+
import {CryptographicSystemError} from '../../exception/WireException.js'
|
|
60
40
|
|
|
61
41
|
/**
|
|
62
42
|
* Utility object responsible for serializing WireMessage to GenericMessage
|
|
@@ -70,11 +50,11 @@ export const ProtobufSerializer = {
|
|
|
70
50
|
* @throws Error if the message type is not supported
|
|
71
51
|
*/
|
|
72
52
|
toGenericMessageByteArray: (wireMessage: WireMessage): Uint8Array => {
|
|
73
|
-
const genericMessage:
|
|
74
|
-
messageId: wireMessage.id
|
|
53
|
+
const genericMessage: protobufMessage.GenericMessage.$Properties = {
|
|
54
|
+
messageId: wireMessage.id
|
|
75
55
|
}
|
|
76
56
|
|
|
77
|
-
let builtMessage:
|
|
57
|
+
let builtMessage: protobufMessage.GenericMessage.$Properties
|
|
78
58
|
|
|
79
59
|
switch (wireMessage.type) {
|
|
80
60
|
case WireMessageType.TEXT:
|
|
@@ -126,12 +106,12 @@ export const ProtobufSerializer = {
|
|
|
126
106
|
break
|
|
127
107
|
|
|
128
108
|
default:
|
|
129
|
-
throw new
|
|
109
|
+
throw new CryptographicSystemError(`Unsupported message type: ${(wireMessage as WireMessage).type}`)
|
|
130
110
|
}
|
|
131
111
|
|
|
132
|
-
const message = GenericMessage.create(builtMessage)
|
|
133
|
-
return GenericMessage.encode(message).finish()
|
|
134
|
-
}
|
|
112
|
+
const message = protobufMessage.GenericMessage.create(builtMessage)
|
|
113
|
+
return protobufMessage.GenericMessage.encode(message).finish()
|
|
114
|
+
}
|
|
135
115
|
}
|
|
136
116
|
|
|
137
117
|
/**
|
|
@@ -139,42 +119,40 @@ export const ProtobufSerializer = {
|
|
|
139
119
|
*/
|
|
140
120
|
function packTextMessage(
|
|
141
121
|
wireMessage: TextMessage,
|
|
142
|
-
genericMessage:
|
|
143
|
-
):
|
|
122
|
+
genericMessage: protobufMessage.GenericMessage.$Properties
|
|
123
|
+
): protobufMessage.GenericMessage.$Properties {
|
|
144
124
|
const textContent = packText(wireMessage)
|
|
145
125
|
|
|
146
126
|
return {
|
|
147
127
|
...genericMessage,
|
|
148
128
|
...(wireMessage.expiresAfterMillis
|
|
149
129
|
? {
|
|
150
|
-
|
|
151
|
-
|
|
130
|
+
ephemeral: protobufMessage.Ephemeral.create({
|
|
131
|
+
expireAfterMillis: wireMessage.expiresAfterMillis,
|
|
132
|
+
text: textContent
|
|
133
|
+
})
|
|
134
|
+
}
|
|
135
|
+
: {
|
|
152
136
|
text: textContent
|
|
153
137
|
})
|
|
154
|
-
|
|
155
|
-
: {
|
|
156
|
-
text: textContent
|
|
157
|
-
})
|
|
158
|
-
} as IGenericMessage
|
|
138
|
+
}
|
|
159
139
|
}
|
|
160
140
|
|
|
161
|
-
function packText(
|
|
162
|
-
|
|
163
|
-
) {
|
|
164
|
-
const textContent: IText = {
|
|
141
|
+
function packText(wireMessage: TextMessage) {
|
|
142
|
+
const textContent: protobufMessage.Text.$Properties = {
|
|
165
143
|
content: wireMessage.text,
|
|
166
144
|
// Add other text-specific fields
|
|
167
145
|
mentions: wireMessage.mentions?.map(MessageMentionMapper.toProtobuf) ?? [],
|
|
168
|
-
linkPreview: wireMessage.linkPreviews?.map(it => MessageLinkPreviewMapper.toProtobuf(it)) ?? [],
|
|
146
|
+
linkPreview: wireMessage.linkPreviews?.map((it) => MessageLinkPreviewMapper.toProtobuf(it)) ?? [],
|
|
169
147
|
expectsReadConfirmation: false,
|
|
170
148
|
legalHoldStatus: null
|
|
171
|
-
}
|
|
149
|
+
}
|
|
172
150
|
|
|
173
151
|
if (wireMessage.quotedMessageId) {
|
|
174
152
|
textContent.quote = {
|
|
175
153
|
quotedMessageId: wireMessage.quotedMessageId!,
|
|
176
154
|
...(wireMessage.quotedMessageSha256 !== undefined ? {quotedMessageSha256: wireMessage.quotedMessageSha256} : {})
|
|
177
|
-
}
|
|
155
|
+
}
|
|
178
156
|
}
|
|
179
157
|
|
|
180
158
|
return textContent
|
|
@@ -182,102 +160,106 @@ function packText(
|
|
|
182
160
|
|
|
183
161
|
function packTextEditedMessage(
|
|
184
162
|
wireMessage: TextEditedMessage,
|
|
185
|
-
genericMessage:
|
|
186
|
-
):
|
|
163
|
+
genericMessage: protobufMessage.GenericMessage.$Properties
|
|
164
|
+
): protobufMessage.GenericMessage.$Properties {
|
|
187
165
|
return {
|
|
188
166
|
...genericMessage,
|
|
189
|
-
edited: MessageEdit.create({
|
|
167
|
+
edited: protobufMessage.MessageEdit.create({
|
|
190
168
|
replacingMessageId: wireMessage.replacingMessageId,
|
|
191
169
|
text: {
|
|
192
170
|
content: wireMessage.text,
|
|
193
171
|
mentions: wireMessage.mentions?.map(MessageMentionMapper.toProtobuf) ?? [],
|
|
194
|
-
linkPreview: wireMessage.linkPreviews?.map(it => MessageLinkPreviewMapper.toProtobuf(it)) ?? []
|
|
172
|
+
linkPreview: wireMessage.linkPreviews?.map((it) => MessageLinkPreviewMapper.toProtobuf(it)) ?? []
|
|
195
173
|
}
|
|
196
174
|
})
|
|
197
|
-
}
|
|
175
|
+
}
|
|
198
176
|
}
|
|
199
177
|
|
|
200
178
|
function packAssetMessage(
|
|
201
179
|
wireMessage: AssetMessage,
|
|
202
|
-
genericMessage:
|
|
203
|
-
):
|
|
204
|
-
const original: Asset.
|
|
180
|
+
genericMessage: protobufMessage.GenericMessage.$Properties
|
|
181
|
+
): protobufMessage.GenericMessage.$Properties {
|
|
182
|
+
const original: protobufMessage.Asset.Original.$Properties = {
|
|
205
183
|
mimeType: wireMessage.mimeType,
|
|
206
184
|
size: wireMessage.sizeInBytes,
|
|
207
185
|
name: wireMessage.name ?? null
|
|
208
|
-
}
|
|
186
|
+
}
|
|
209
187
|
|
|
210
188
|
if (wireMessage.metadata) {
|
|
211
189
|
if (wireMessage.metadata.type === 'image') {
|
|
212
190
|
original.image = {
|
|
213
191
|
width: wireMessage.metadata.width,
|
|
214
192
|
height: wireMessage.metadata.height
|
|
215
|
-
}
|
|
193
|
+
}
|
|
216
194
|
} else if (wireMessage.metadata.type === 'audio') {
|
|
217
|
-
original.audio = {}
|
|
195
|
+
original.audio = {}
|
|
218
196
|
if (wireMessage.metadata.durationMs) {
|
|
219
|
-
original.audio.durationInMillis = wireMessage.metadata.durationMs
|
|
197
|
+
original.audio.durationInMillis = wireMessage.metadata.durationMs
|
|
220
198
|
}
|
|
221
199
|
if (wireMessage.metadata.normalizedLoudness) {
|
|
222
|
-
original.audio.normalizedLoudness = wireMessage.metadata.normalizedLoudness
|
|
200
|
+
original.audio.normalizedLoudness = wireMessage.metadata.normalizedLoudness
|
|
223
201
|
}
|
|
224
202
|
} else if (wireMessage.metadata.type === 'video') {
|
|
225
|
-
original.video = {}
|
|
203
|
+
original.video = {}
|
|
226
204
|
if (wireMessage.metadata.width) {
|
|
227
|
-
original.video.width = wireMessage.metadata.width
|
|
205
|
+
original.video.width = wireMessage.metadata.width
|
|
228
206
|
}
|
|
229
207
|
if (wireMessage.metadata.height) {
|
|
230
|
-
original.video.height = wireMessage.metadata.height
|
|
208
|
+
original.video.height = wireMessage.metadata.height
|
|
231
209
|
}
|
|
232
210
|
if (wireMessage.metadata.durationMs) {
|
|
233
|
-
original.video.durationInMillis = wireMessage.metadata.durationMs
|
|
211
|
+
original.video.durationInMillis = wireMessage.metadata.durationMs
|
|
234
212
|
}
|
|
235
213
|
}
|
|
236
214
|
}
|
|
237
215
|
|
|
238
|
-
const uploaded: Asset.
|
|
216
|
+
const uploaded: protobufMessage.Asset.RemoteData.$Properties = {
|
|
239
217
|
otrKey: wireMessage.remoteData?.otrKey || new Uint8Array(),
|
|
240
218
|
sha256: wireMessage.remoteData?.sha256 || new Uint8Array(),
|
|
241
219
|
assetId: wireMessage.remoteData?.assetId || null,
|
|
242
220
|
assetToken: wireMessage.remoteData?.assetToken || null,
|
|
243
221
|
assetDomain: wireMessage.remoteData?.assetDomain || null
|
|
244
|
-
}
|
|
222
|
+
}
|
|
245
223
|
|
|
246
|
-
const assetContent:
|
|
224
|
+
const assetContent: protobufMessage.Asset.$Properties = {
|
|
247
225
|
original,
|
|
248
226
|
uploaded
|
|
249
|
-
}
|
|
227
|
+
}
|
|
250
228
|
|
|
251
229
|
return {
|
|
252
230
|
...genericMessage,
|
|
253
231
|
...(wireMessage.expiresAfterMillis
|
|
254
232
|
? {
|
|
255
|
-
|
|
256
|
-
|
|
233
|
+
ephemeral: protobufMessage.Ephemeral.create({
|
|
234
|
+
expireAfterMillis: wireMessage.expiresAfterMillis,
|
|
235
|
+
asset: assetContent
|
|
236
|
+
})
|
|
237
|
+
}
|
|
238
|
+
: {
|
|
257
239
|
asset: assetContent
|
|
258
240
|
})
|
|
259
|
-
|
|
260
|
-
: {
|
|
261
|
-
asset: assetContent
|
|
262
|
-
})
|
|
263
|
-
} as IGenericMessage
|
|
241
|
+
}
|
|
264
242
|
}
|
|
265
243
|
|
|
266
|
-
function packItemList(itemsList: Item[]):
|
|
244
|
+
function packItemList(itemsList: Item[]): protobufMessage.Composite.Item[] {
|
|
267
245
|
return itemsList.flatMap((item) => {
|
|
268
246
|
switch ((item as TextMessage | CompositeButton).type) {
|
|
269
247
|
case WireMessageType.COMPOSITE_BUTTON: {
|
|
270
248
|
const button = item as CompositeButton
|
|
271
|
-
return [
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
249
|
+
return [
|
|
250
|
+
protobufMessage.Composite.Item.create({
|
|
251
|
+
content: 'button',
|
|
252
|
+
button: {id: button.id, text: button.text}
|
|
253
|
+
})
|
|
254
|
+
]
|
|
275
255
|
}
|
|
276
256
|
case WireMessageType.TEXT: {
|
|
277
|
-
return [
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
257
|
+
return [
|
|
258
|
+
protobufMessage.Composite.Item.create({
|
|
259
|
+
content: 'text',
|
|
260
|
+
text: packText(item as TextMessage)
|
|
261
|
+
})
|
|
262
|
+
]
|
|
281
263
|
}
|
|
282
264
|
default:
|
|
283
265
|
return []
|
|
@@ -287,9 +269,9 @@ function packItemList(itemsList: Item[]): ProtobufComposite.Item[] {
|
|
|
287
269
|
|
|
288
270
|
function packCompositeButtonAction(
|
|
289
271
|
wireMessage: CompositeButtonAction,
|
|
290
|
-
genericMessage:
|
|
291
|
-
):
|
|
292
|
-
const buttonAction:
|
|
272
|
+
genericMessage: protobufMessage.GenericMessage.$Properties
|
|
273
|
+
): protobufMessage.GenericMessage.$Properties {
|
|
274
|
+
const buttonAction: protobufMessage.ButtonAction.$Properties = {
|
|
293
275
|
referenceMessageId: wireMessage.referenceMessageId,
|
|
294
276
|
buttonId: wireMessage.buttonId
|
|
295
277
|
}
|
|
@@ -297,14 +279,14 @@ function packCompositeButtonAction(
|
|
|
297
279
|
return {
|
|
298
280
|
...genericMessage,
|
|
299
281
|
buttonAction: buttonAction
|
|
300
|
-
}
|
|
282
|
+
}
|
|
301
283
|
}
|
|
302
284
|
|
|
303
285
|
function packCompositeButtonActionConfirmation(
|
|
304
286
|
wireMessage: CompositeButtonActionConfirmation,
|
|
305
|
-
genericMessage:
|
|
306
|
-
):
|
|
307
|
-
const buttonActionConfirmation:
|
|
287
|
+
genericMessage: protobufMessage.GenericMessage.$Properties
|
|
288
|
+
): protobufMessage.GenericMessage.$Properties {
|
|
289
|
+
const buttonActionConfirmation: protobufMessage.ButtonActionConfirmation.$Properties = {
|
|
308
290
|
referenceMessageId: wireMessage.referenceMessageId,
|
|
309
291
|
buttonId: wireMessage.buttonId
|
|
310
292
|
}
|
|
@@ -312,61 +294,61 @@ function packCompositeButtonActionConfirmation(
|
|
|
312
294
|
return {
|
|
313
295
|
...genericMessage,
|
|
314
296
|
buttonActionConfirmation: buttonActionConfirmation
|
|
315
|
-
}
|
|
297
|
+
}
|
|
316
298
|
}
|
|
317
299
|
|
|
318
300
|
function packCompositeMessage(
|
|
319
301
|
wireMessage: CompositeMessage,
|
|
320
|
-
genericMessage:
|
|
321
|
-
):
|
|
302
|
+
genericMessage: protobufMessage.GenericMessage.$Properties
|
|
303
|
+
): protobufMessage.GenericMessage.$Properties {
|
|
322
304
|
return {
|
|
323
305
|
...genericMessage,
|
|
324
|
-
composite: Composite.create({
|
|
306
|
+
composite: protobufMessage.Composite.create({
|
|
325
307
|
items: packItemList(wireMessage.items)
|
|
326
308
|
})
|
|
327
|
-
}
|
|
309
|
+
}
|
|
328
310
|
}
|
|
329
311
|
|
|
330
312
|
function packCompositeEditedMessage(
|
|
331
313
|
wireMessage: CompositeEditedMessage,
|
|
332
|
-
genericMessage:
|
|
333
|
-
):
|
|
314
|
+
genericMessage: protobufMessage.GenericMessage.$Properties
|
|
315
|
+
): protobufMessage.GenericMessage.$Properties {
|
|
334
316
|
return {
|
|
335
317
|
...genericMessage,
|
|
336
|
-
edited: MessageEdit.create({
|
|
318
|
+
edited: protobufMessage.MessageEdit.create({
|
|
337
319
|
replacingMessageId: wireMessage.replacingMessageId,
|
|
338
320
|
composite: {
|
|
339
321
|
items: packItemList(wireMessage.items)
|
|
340
322
|
}
|
|
341
323
|
})
|
|
342
|
-
}
|
|
324
|
+
}
|
|
343
325
|
}
|
|
344
326
|
|
|
345
327
|
function packPing(
|
|
346
328
|
wireMessage: Ping,
|
|
347
|
-
genericMessage:
|
|
348
|
-
):
|
|
349
|
-
const knock = Knock.create({hotKnock: false})
|
|
329
|
+
genericMessage: protobufMessage.GenericMessage.$Properties
|
|
330
|
+
): protobufMessage.GenericMessage.$Properties {
|
|
331
|
+
const knock = protobufMessage.Knock.create({hotKnock: false})
|
|
350
332
|
return {
|
|
351
333
|
...genericMessage,
|
|
352
334
|
...(wireMessage.expiresAfterMillis
|
|
353
335
|
? {
|
|
354
|
-
|
|
355
|
-
|
|
336
|
+
ephemeral: protobufMessage.Ephemeral.create({
|
|
337
|
+
expireAfterMillis: wireMessage.expiresAfterMillis,
|
|
338
|
+
knock: knock
|
|
339
|
+
})
|
|
340
|
+
}
|
|
341
|
+
: {
|
|
356
342
|
knock: knock
|
|
357
343
|
})
|
|
358
|
-
|
|
359
|
-
: {
|
|
360
|
-
knock: knock
|
|
361
|
-
})
|
|
362
|
-
} as IGenericMessage
|
|
344
|
+
}
|
|
363
345
|
}
|
|
364
346
|
|
|
365
347
|
function packLocation(
|
|
366
348
|
wireMessage: Location,
|
|
367
|
-
genericMessage:
|
|
368
|
-
):
|
|
369
|
-
const locationContent =
|
|
349
|
+
genericMessage: protobufMessage.GenericMessage.$Properties
|
|
350
|
+
): protobufMessage.GenericMessage.$Properties {
|
|
351
|
+
const locationContent = protobufMessage.Location.create({
|
|
370
352
|
latitude: wireMessage.latitude,
|
|
371
353
|
longitude: wireMessage.longitude,
|
|
372
354
|
name: wireMessage.name,
|
|
@@ -377,73 +359,73 @@ function packLocation(
|
|
|
377
359
|
...genericMessage,
|
|
378
360
|
...(wireMessage.expiresAfterMillis
|
|
379
361
|
? {
|
|
380
|
-
|
|
381
|
-
|
|
362
|
+
ephemeral: protobufMessage.Ephemeral.create({
|
|
363
|
+
expireAfterMillis: wireMessage.expiresAfterMillis,
|
|
364
|
+
location: locationContent
|
|
365
|
+
})
|
|
366
|
+
}
|
|
367
|
+
: {
|
|
382
368
|
location: locationContent
|
|
383
369
|
})
|
|
384
|
-
|
|
385
|
-
: {
|
|
386
|
-
location: locationContent
|
|
387
|
-
})
|
|
388
|
-
} as IGenericMessage
|
|
370
|
+
}
|
|
389
371
|
}
|
|
390
372
|
|
|
391
373
|
function packDeletedMessage(
|
|
392
374
|
wireMessage: DeletedMessage,
|
|
393
|
-
genericMessage:
|
|
394
|
-
):
|
|
375
|
+
genericMessage: protobufMessage.GenericMessage.$Properties
|
|
376
|
+
): protobufMessage.GenericMessage.$Properties {
|
|
395
377
|
return {
|
|
396
378
|
...genericMessage,
|
|
397
|
-
deleted: MessageDelete.create({
|
|
379
|
+
deleted: protobufMessage.MessageDelete.create({
|
|
398
380
|
messageId: wireMessage.messageId
|
|
399
381
|
})
|
|
400
|
-
}
|
|
382
|
+
}
|
|
401
383
|
}
|
|
402
384
|
|
|
403
385
|
function packReceipt(
|
|
404
386
|
wireMessage: Receipt,
|
|
405
|
-
genericMessage:
|
|
406
|
-
):
|
|
387
|
+
genericMessage: protobufMessage.GenericMessage.$Properties
|
|
388
|
+
): protobufMessage.GenericMessage.$Properties {
|
|
407
389
|
let type
|
|
408
390
|
switch (wireMessage.receiptType) {
|
|
409
391
|
case ReceiptType.DELIVERED:
|
|
410
|
-
type = Confirmation.Type.DELIVERED
|
|
392
|
+
type = protobufMessage.Confirmation.Type.DELIVERED
|
|
411
393
|
break
|
|
412
394
|
case ReceiptType.READ:
|
|
413
|
-
type = Confirmation.Type.READ
|
|
395
|
+
type = protobufMessage.Confirmation.Type.READ
|
|
414
396
|
break
|
|
415
397
|
}
|
|
416
398
|
|
|
417
|
-
const [firstMessageId, ...moreMessageIds] = wireMessage.messageIds
|
|
399
|
+
const [firstMessageId, ...moreMessageIds] = wireMessage.messageIds
|
|
418
400
|
|
|
419
401
|
if (!firstMessageId) {
|
|
420
|
-
throw new
|
|
402
|
+
throw new CryptographicSystemError('First messageId for Receipt message type is null')
|
|
421
403
|
}
|
|
422
404
|
|
|
423
405
|
return {
|
|
424
406
|
...genericMessage,
|
|
425
|
-
confirmation: Confirmation.create({
|
|
407
|
+
confirmation: protobufMessage.Confirmation.create({
|
|
426
408
|
type: type,
|
|
427
409
|
firstMessageId: firstMessageId,
|
|
428
410
|
moreMessageIds: moreMessageIds
|
|
429
411
|
})
|
|
430
|
-
}
|
|
412
|
+
}
|
|
431
413
|
}
|
|
432
414
|
|
|
433
415
|
function packReaction(
|
|
434
416
|
wireMessage: Reaction,
|
|
435
|
-
genericMessage:
|
|
436
|
-
):
|
|
417
|
+
genericMessage: protobufMessage.GenericMessage.$Properties
|
|
418
|
+
): protobufMessage.GenericMessage.$Properties {
|
|
437
419
|
const emojis = [...wireMessage.emojiSet]
|
|
438
|
-
.map(emojiString => emojiString.trim())
|
|
439
|
-
.filter(emojiString => emojiString.length > 0)
|
|
440
|
-
.join(
|
|
420
|
+
.map((emojiString) => emojiString.trim())
|
|
421
|
+
.filter((emojiString) => emojiString.length > 0)
|
|
422
|
+
.join(',')
|
|
441
423
|
|
|
442
424
|
return {
|
|
443
425
|
...genericMessage,
|
|
444
|
-
reaction:
|
|
426
|
+
reaction: protobufMessage.Reaction.create({
|
|
445
427
|
messageId: wireMessage.messageId,
|
|
446
428
|
emoji: emojis
|
|
447
429
|
})
|
|
448
|
-
}
|
|
430
|
+
}
|
|
449
431
|
}
|
package/src/model/Asset.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Wire
|
|
3
|
-
* Copyright (C) 2025 Wire Swiss GmbH
|
|
4
|
-
*
|
|
5
|
-
* This program is free software: you can redistribute it and/or modify
|
|
6
|
-
* it under the terms of the GNU General Public License as published by
|
|
7
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
* (at your option) any later version.
|
|
9
|
-
* This program is distributed in the hope that it will be useful,
|
|
10
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
-
* GNU General Public License for more details.
|
|
13
|
-
* You should have received a copy of the GNU General Public License
|
|
14
|
-
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
15
|
-
*/
|
|
2
|
+
* Wire
|
|
3
|
+
* Copyright (C) 2025 Wire Swiss GmbH
|
|
4
|
+
*
|
|
5
|
+
* This program is free software: you can redistribute it and/or modify
|
|
6
|
+
* it under the terms of the GNU General Public License as published by
|
|
7
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
* (at your option) any later version.
|
|
9
|
+
* This program is distributed in the hope that it will be useful,
|
|
10
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
* GNU General Public License for more details.
|
|
13
|
+
* You should have received a copy of the GNU General Public License
|
|
14
|
+
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
15
|
+
*/
|
|
16
16
|
|
|
17
|
-
import type {AssetMetadata} from
|
|
17
|
+
import type {AssetMetadata} from './WireMessage.js'
|
|
18
18
|
|
|
19
19
|
export interface Asset {
|
|
20
|
-
data: AssetData
|
|
21
|
-
name: string
|
|
22
|
-
mimeType: string
|
|
20
|
+
data: AssetData
|
|
21
|
+
name: string
|
|
22
|
+
mimeType: string
|
|
23
23
|
metadata?: AssetMetadata | null
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Wire
|
|
3
|
-
* Copyright (C) 2026 Wire Swiss GmbH
|
|
4
|
-
*
|
|
5
|
-
* This program is free software: you can redistribute it and/or modify
|
|
6
|
-
* it under the terms of the GNU General Public License as published by
|
|
7
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
* (at your option) any later version.
|
|
9
|
-
* This program is distributed in the hope that it will be useful,
|
|
10
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
-
* GNU General Public License for more details.
|
|
13
|
-
* You should have received a copy of the GNU General Public License
|
|
14
|
-
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
15
|
-
*/
|
|
2
|
+
* Wire
|
|
3
|
+
* Copyright (C) 2026 Wire Swiss GmbH
|
|
4
|
+
*
|
|
5
|
+
* This program is free software: you can redistribute it and/or modify
|
|
6
|
+
* it under the terms of the GNU General Public License as published by
|
|
7
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
* (at your option) any later version.
|
|
9
|
+
* This program is distributed in the hope that it will be useful,
|
|
10
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
* GNU General Public License for more details.
|
|
13
|
+
* You should have received a copy of the GNU General Public License
|
|
14
|
+
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
15
|
+
*/
|
|
16
16
|
|
|
17
|
-
import type {QualifiedId} from
|
|
17
|
+
import type {QualifiedId} from './QualifiedId.js'
|
|
18
18
|
|
|
19
19
|
export interface ClaimedKeyPackagesResult {
|
|
20
|
-
keyPackages: Uint8Array[]
|
|
21
|
-
successUsers: QualifiedId[]
|
|
20
|
+
keyPackages: Uint8Array[]
|
|
21
|
+
successUsers: QualifiedId[]
|
|
22
22
|
failedUsers: QualifiedId[]
|
|
23
23
|
}
|
|
@@ -1,40 +1,31 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Wire
|
|
3
|
-
* Copyright (C) 2025 Wire Swiss GmbH
|
|
4
|
-
*
|
|
5
|
-
* This program is free software: you can redistribute it and/or modify
|
|
6
|
-
* it under the terms of the GNU General Public License as published by
|
|
7
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
* (at your option) any later version.
|
|
9
|
-
* This program is distributed in the hope that it will be useful,
|
|
10
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
-
* GNU General Public License for more details.
|
|
13
|
-
* You should have received a copy of the GNU General Public License
|
|
14
|
-
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
15
|
-
*/
|
|
2
|
+
* Wire
|
|
3
|
+
* Copyright (C) 2025 Wire Swiss GmbH
|
|
4
|
+
*
|
|
5
|
+
* This program is free software: you can redistribute it and/or modify
|
|
6
|
+
* it under the terms of the GNU General Public License as published by
|
|
7
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
* (at your option) any later version.
|
|
9
|
+
* This program is distributed in the hope that it will be useful,
|
|
10
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
* GNU General Public License for more details.
|
|
13
|
+
* You should have received a copy of the GNU General Public License
|
|
14
|
+
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
15
|
+
*/
|
|
16
16
|
|
|
17
17
|
export class CryptoClientId {
|
|
18
18
|
readonly userId: string
|
|
19
19
|
readonly deviceId: string
|
|
20
20
|
readonly userDomain: string
|
|
21
21
|
|
|
22
|
-
private constructor(
|
|
23
|
-
userId: string,
|
|
24
|
-
deviceId: string,
|
|
25
|
-
userDomain: string
|
|
26
|
-
) {
|
|
22
|
+
private constructor(userId: string, deviceId: string, userDomain: string) {
|
|
27
23
|
this.userId = userId
|
|
28
24
|
this.deviceId = deviceId
|
|
29
25
|
this.userDomain = userDomain
|
|
30
26
|
}
|
|
31
27
|
|
|
32
28
|
static create(userId: string, deviceId: string, userDomain: string): CryptoClientId {
|
|
33
|
-
return new CryptoClientId(
|
|
34
|
-
userId,
|
|
35
|
-
deviceId,
|
|
36
|
-
userDomain
|
|
37
|
-
)
|
|
29
|
+
return new CryptoClientId(userId, deviceId, userDomain)
|
|
38
30
|
}
|
|
39
31
|
}
|
|
40
|
-
|