@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
package/README.md
CHANGED
|
@@ -73,23 +73,24 @@ The SQLite schema is initialized by SDK startup through migrations shipped with
|
|
|
73
73
|
The SDK is published as an ESM package. Import it with standard `import` syntax:
|
|
74
74
|
|
|
75
75
|
```ts
|
|
76
|
-
import {
|
|
77
|
-
WireAppSdk,
|
|
78
|
-
WireEventsHandler,
|
|
79
|
-
TextMessage
|
|
80
|
-
} from '@wireapp/wire-apps-js-sdk'
|
|
76
|
+
import {WireAppSdk, WireEventsHandler, TextMessage} from '@wireapp/wire-apps-js-sdk'
|
|
81
77
|
```
|
|
82
78
|
|
|
83
79
|
CommonJS `require()` is not the supported integration path for this alpha release.
|
|
84
80
|
|
|
81
|
+
After `WireAppSdk.create()` resolves, access backend operations through the application manager:
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
const sdk = await WireAppSdk.create(apiToken, apiHost, cryptographyStorageKey, eventsHandler)
|
|
85
|
+
const manager = sdk.getApplicationManager()
|
|
86
|
+
```
|
|
87
|
+
|
|
85
88
|
## Environment Variables
|
|
86
89
|
|
|
87
90
|
Environment Variables can be checked from: `.env.example` file
|
|
88
91
|
|
|
89
92
|
```
|
|
90
|
-
WIRE_SDK_USER_ID=your-user-ID-UUID-format
|
|
91
93
|
WIRE_SDK_API_TOKEN=your-api-token
|
|
92
|
-
WIRE_SDK_USER_DOMAIN=yourdomain
|
|
93
94
|
WIRE_SDK_API_HOST=https://your-api.host
|
|
94
95
|
```
|
|
95
96
|
|
|
@@ -111,13 +112,27 @@ npm run sample
|
|
|
111
112
|
|
|
112
113
|
The `sample` script builds the sample workspace and starts it. It expects the environment variables listed above to be available from the repository `.env` file.
|
|
113
114
|
|
|
115
|
+
## Ready to use examples
|
|
116
|
+
|
|
117
|
+
Beside the sample app, [`sample/src/examples`](./sample/src/examples) contains small, focused examples covering common
|
|
118
|
+
usage patterns: event handling via callbacks (greeting new joiners, replying, reacting, sending pings, ephemeral,
|
|
119
|
+
location messages, downloading assets) and self-contained programs (creating a group conversation, broadcasting to all
|
|
120
|
+
conversations).
|
|
121
|
+
|
|
122
|
+
```shell
|
|
123
|
+
npm run -w sample example:callback -- ReplyMessageExample
|
|
124
|
+
npm run -w sample example:create-group-conversation
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
See the [examples README](./sample/src/examples/README.md) for the full list and details.
|
|
128
|
+
|
|
114
129
|
## Troubleshooting
|
|
115
130
|
|
|
116
131
|
If the SDK fails to start because a native module cannot be loaded, check that Node was installed for the same CPU architecture as the native dependencies. On Apple Silicon, mixing an x64 Node binary with arm64 native libraries, or the reverse, can cause `dlopen` architecture errors. Reinstalling dependencies with the intended Node binary usually fixes this.
|
|
117
132
|
|
|
118
133
|
If database migrations fail at startup, verify that the package was built before running and that `build/db/migrations/**` exists. Published npm installs include these files, but local development builds need `npm run build` to copy them into `build`.
|
|
119
134
|
|
|
120
|
-
If environment variables are missing, confirm that `.env` exists at the repository root when running the bundled sample app. The sample validates `
|
|
135
|
+
If environment variables are missing, confirm that `.env` exists at the repository root when running the bundled sample app. The sample validates `WIRE_SDK_API_TOKEN` and `WIRE_SDK_API_HOST` on startup.
|
|
121
136
|
|
|
122
137
|
### Testing the SDK
|
|
123
138
|
|
package/build/WireAppSdk.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import 'reflect-metadata';
|
|
2
2
|
import './core/event/processors.index.js';
|
|
3
|
-
import { WireEventsHandler } from
|
|
4
|
-
import type { Logger } from
|
|
3
|
+
import { WireEventsHandler } from './core/WireEventsHandler.js';
|
|
4
|
+
import type { Logger } from './utils/logger/Logger.js';
|
|
5
|
+
import type { BackendConnectionListener } from './core/BackendConnectionListener.js';
|
|
6
|
+
import { WireApplicationManager } from './core/WireApplicationManager.js';
|
|
5
7
|
export declare class WireAppSdk {
|
|
6
8
|
private readonly CRYPTOGRAPHY_STORAGE_KEY_BYTES;
|
|
7
|
-
private userId;
|
|
8
9
|
private apiToken;
|
|
9
|
-
private userDomain;
|
|
10
10
|
private apiHost;
|
|
11
11
|
private cryptographyStorageKey;
|
|
12
12
|
private isShuttingDown;
|
|
@@ -17,14 +17,29 @@ export declare class WireAppSdk {
|
|
|
17
17
|
private wireEventsHandler;
|
|
18
18
|
private logger;
|
|
19
19
|
private constructor();
|
|
20
|
-
static create(
|
|
20
|
+
static create(apiToken: string, apiHost: string, cryptographyStorageKey: Uint8Array, wireEventsHandler: WireEventsHandler, logger?: Logger): Promise<WireAppSdk>;
|
|
21
21
|
private init;
|
|
22
22
|
private prepareStorage;
|
|
23
|
-
private
|
|
23
|
+
private configureDependencyTokens;
|
|
24
|
+
private resolveRuntimeDependencies;
|
|
25
|
+
private configureApplicationIdentity;
|
|
24
26
|
private initCryptoClient;
|
|
25
27
|
startListening(): Promise<void>;
|
|
26
28
|
stopListening(): void;
|
|
27
29
|
close(): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Registers a listener to be notified when the connection to the Wire backend
|
|
32
|
+
* is established or lost.
|
|
33
|
+
*/
|
|
34
|
+
setBackendConnectionListener(listener: BackendConnectionListener): void;
|
|
35
|
+
/**
|
|
36
|
+
* Returns the WireApplicationManager used to interact with the Wire backend.
|
|
37
|
+
*
|
|
38
|
+
* Available as soon as create() resolves. Operations on MLS conversations require the app
|
|
39
|
+
* to have joined those conversations, which happens during startListening().
|
|
40
|
+
* Do not use the returned instance after close().
|
|
41
|
+
*/
|
|
42
|
+
getApplicationManager(): WireApplicationManager;
|
|
28
43
|
private registerExitHandlers;
|
|
29
44
|
private handleExit;
|
|
30
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WireAppSdk.d.ts","sourceRoot":"","sources":["../src/WireAppSdk.ts"],"names":[],"mappings":"AAgBA,OAAO,kBAAkB,
|
|
1
|
+
{"version":3,"file":"WireAppSdk.d.ts","sourceRoot":"","sources":["../src/WireAppSdk.ts"],"names":[],"mappings":"AAgBA,OAAO,kBAAkB,CAAA;AACzB,OAAO,kCAAkC,CAAA;AAUzC,OAAO,EAAC,iBAAiB,EAAC,MAAM,6BAA6B,CAAA;AAG7D,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,0BAA0B,CAAA;AAMpD,OAAO,KAAK,EAAC,yBAAyB,EAAC,MAAM,qCAAqC,CAAA;AAGlF,OAAO,EAAC,sBAAsB,EAAC,MAAM,kCAAkC,CAAA;AAEvE,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,8BAA8B,CAAK;IACpD,OAAO,CAAC,QAAQ,CAAQ;IACxB,OAAO,CAAC,OAAO,CAAQ;IACvB,OAAO,CAAC,sBAAsB,CAAY;IAE1C,OAAO,CAAC,cAAc,CAAQ;IAE9B,OAAO,CAAC,kBAAkB,CAAiB;IAC3C,OAAO,CAAC,eAAe,CAAC,CAAiB;IACzC,OAAO,CAAC,mBAAmB,CAAC,CAAqB;IACjD,OAAO,CAAC,aAAa,CAAC,CAAe;IAErC,OAAO,CAAC,iBAAiB,CAAmB;IAC5C,OAAO,CAAC,MAAM,CAAQ;IAEtB,OAAO;WAqBM,MAAM,CACjB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,sBAAsB,EAAE,UAAU,EAClC,iBAAiB,EAAE,iBAAiB,EACpC,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,UAAU,CAAC;YAQR,IAAI;IAelB,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,yBAAyB;IAQjC,OAAO,CAAC,0BAA0B;YAKpB,4BAA4B;YAK5B,gBAAgB;IAQxB,cAAc;IAkBpB,aAAa;IAUP,KAAK;IAgBX;;;OAGG;IACH,4BAA4B,CAAC,QAAQ,EAAE,yBAAyB,GAAG,IAAI;IAIvE;;;;;;OAMG;IACH,qBAAqB,IAAI,sBAAsB;IAI/C,OAAO,CAAC,oBAAoB;YAkBd,UAAU;CAiBzB"}
|
package/build/WireAppSdk.js
CHANGED
|
@@ -1,37 +1,38 @@
|
|
|
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
|
-
import
|
|
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
|
+
import 'reflect-metadata';
|
|
17
17
|
import './core/event/processors.index.js';
|
|
18
|
-
import { mkdirSync } from
|
|
19
|
-
import { CoreCryptoService } from
|
|
20
|
-
import { WIRE_API_HOST, WIRE_CRYPTOGRAPHY_STORAGE_KEY, WIRE_EVENTS_HANDLER,
|
|
21
|
-
import { WebSocketClient } from
|
|
22
|
-
import { WireEventsHandler } from
|
|
23
|
-
import { DatabaseService } from
|
|
24
|
-
import { container } from
|
|
25
|
-
import { LoggerFactory } from
|
|
26
|
-
import { ConsoleLogger } from
|
|
27
|
-
import { ConversationService } from
|
|
28
|
-
import { AppProperties } from
|
|
29
|
-
import { CRYPTOGRAPHY_STORAGE_PATH, STORAGE_PATH } from
|
|
18
|
+
import { mkdirSync } from 'node:fs';
|
|
19
|
+
import { CoreCryptoService } from './core/CoreCryptoService.js';
|
|
20
|
+
import { WIRE_API_HOST, WIRE_CRYPTOGRAPHY_STORAGE_KEY, WIRE_EVENTS_HANDLER, WIRE_SDK_API_TOKEN } from './utils/DependencyInjectionTokens.js';
|
|
21
|
+
import { WebSocketClient } from './core/WebSocketClient.js';
|
|
22
|
+
import { WireEventsHandler } from './core/WireEventsHandler.js';
|
|
23
|
+
import { DatabaseService } from './db/DatabaseService.js';
|
|
24
|
+
import { container } from 'tsyringe';
|
|
25
|
+
import { LoggerFactory } from './utils/logger/LoggerFactory.js';
|
|
26
|
+
import { ConsoleLogger } from './utils/logger/ConsoleLogger.js';
|
|
27
|
+
import { ConversationService } from './api/ConversationService.js';
|
|
28
|
+
import { AppProperties } from './service/AppProperties.js';
|
|
29
|
+
import { CRYPTOGRAPHY_STORAGE_PATH, STORAGE_PATH } from './utils/StoragePaths.js';
|
|
30
|
+
import { InvalidParameterError, UnknownError } from './exception/WireException.js';
|
|
31
|
+
import { SelfService } from './api/SelfService.js';
|
|
32
|
+
import { WireApplicationManager } from './core/WireApplicationManager.js';
|
|
30
33
|
export class WireAppSdk {
|
|
31
34
|
CRYPTOGRAPHY_STORAGE_KEY_BYTES = 32;
|
|
32
|
-
userId;
|
|
33
35
|
apiToken;
|
|
34
|
-
userDomain;
|
|
35
36
|
apiHost;
|
|
36
37
|
cryptographyStorageKey;
|
|
37
38
|
isShuttingDown = false;
|
|
@@ -41,47 +42,51 @@ export class WireAppSdk {
|
|
|
41
42
|
appProperties;
|
|
42
43
|
wireEventsHandler;
|
|
43
44
|
logger;
|
|
44
|
-
constructor(
|
|
45
|
+
constructor(apiToken, apiHost, cryptographyStorageKey, wireEventsHandler, logger) {
|
|
45
46
|
if (cryptographyStorageKey.length !== this.CRYPTOGRAPHY_STORAGE_KEY_BYTES) {
|
|
46
|
-
throw new
|
|
47
|
+
throw new InvalidParameterError(`cryptographyStorageKey must be exactly ${this.CRYPTOGRAPHY_STORAGE_KEY_BYTES} bytes long`);
|
|
47
48
|
}
|
|
48
|
-
this.userId = userId;
|
|
49
49
|
this.apiToken = apiToken;
|
|
50
|
-
this.userDomain = userDomain;
|
|
51
50
|
this.apiHost = apiHost;
|
|
52
51
|
this.cryptographyStorageKey = cryptographyStorageKey;
|
|
53
52
|
this.wireEventsHandler = wireEventsHandler;
|
|
54
53
|
LoggerFactory.setRootLogger(logger ?? new ConsoleLogger());
|
|
55
54
|
this.logger = LoggerFactory.getLogger(this.constructor.name);
|
|
56
55
|
}
|
|
57
|
-
static async create(
|
|
58
|
-
const wireAppSdk = new WireAppSdk(
|
|
56
|
+
static async create(apiToken, apiHost, cryptographyStorageKey, wireEventsHandler, logger) {
|
|
57
|
+
const wireAppSdk = new WireAppSdk(apiToken, apiHost, cryptographyStorageKey, wireEventsHandler, logger);
|
|
59
58
|
wireAppSdk.registerExitHandlers();
|
|
60
59
|
await wireAppSdk.init();
|
|
61
60
|
return wireAppSdk;
|
|
62
61
|
}
|
|
63
62
|
async init() {
|
|
64
63
|
this.prepareStorage();
|
|
65
|
-
this.
|
|
64
|
+
this.configureDependencyTokens();
|
|
66
65
|
// Save cookie from constructor parameter only at first application start.
|
|
67
66
|
// Once BE provides new token, the one stored in `apiToken` will be obsolete.
|
|
67
|
+
this.appProperties = container.resolve(AppProperties);
|
|
68
68
|
this.appProperties.saveBackendCookieIfMissing(this.apiToken);
|
|
69
|
+
await this.configureApplicationIdentity();
|
|
70
|
+
this.resolveRuntimeDependencies();
|
|
69
71
|
await this.initCryptoClient();
|
|
70
72
|
}
|
|
71
73
|
prepareStorage() {
|
|
72
74
|
mkdirSync(STORAGE_PATH, { recursive: true });
|
|
73
75
|
mkdirSync(CRYPTOGRAPHY_STORAGE_PATH, { recursive: true });
|
|
74
76
|
}
|
|
75
|
-
|
|
77
|
+
configureDependencyTokens() {
|
|
76
78
|
container.registerInstance(WIRE_API_HOST, this.apiHost);
|
|
77
79
|
container.registerInstance(WIRE_SDK_API_TOKEN, this.apiToken);
|
|
78
|
-
container.registerInstance(WIRE_USER_ID, this.userId);
|
|
79
|
-
container.registerInstance(WIRE_USER_DOMAIN, this.userDomain);
|
|
80
80
|
container.registerInstance(WIRE_CRYPTOGRAPHY_STORAGE_KEY, this.cryptographyStorageKey);
|
|
81
81
|
container.registerInstance(WIRE_EVENTS_HANDLER, this.wireEventsHandler);
|
|
82
|
+
}
|
|
83
|
+
resolveRuntimeDependencies() {
|
|
82
84
|
this.webSocketClient = container.resolve(WebSocketClient);
|
|
83
85
|
this.conversationService = container.resolve(ConversationService);
|
|
84
|
-
|
|
86
|
+
}
|
|
87
|
+
async configureApplicationIdentity() {
|
|
88
|
+
const selfService = container.resolve(SelfService);
|
|
89
|
+
await selfService.fetchAndSaveApplicationData();
|
|
85
90
|
}
|
|
86
91
|
async initCryptoClient() {
|
|
87
92
|
const coreCryptoService = container.resolve(CoreCryptoService);
|
|
@@ -91,12 +96,12 @@ export class WireAppSdk {
|
|
|
91
96
|
}
|
|
92
97
|
async startListening() {
|
|
93
98
|
if (this.isWebSocketRunning) {
|
|
94
|
-
this.logger.info(
|
|
99
|
+
this.logger.info('Wire Apps SDK is already running.');
|
|
95
100
|
return;
|
|
96
101
|
}
|
|
97
102
|
this.isWebSocketRunning = true;
|
|
98
103
|
if (!this.webSocketClient || !this.conversationService) {
|
|
99
|
-
throw new
|
|
104
|
+
throw new UnknownError('Wire Apps SDK dependencies are not initialized.');
|
|
100
105
|
}
|
|
101
106
|
this.webSocketClient.connect().finally(() => {
|
|
102
107
|
this.isWebSocketRunning = false;
|
|
@@ -105,26 +110,43 @@ export class WireAppSdk {
|
|
|
105
110
|
}
|
|
106
111
|
stopListening() {
|
|
107
112
|
if (!this.isWebSocketRunning) {
|
|
108
|
-
this.logger.info(
|
|
113
|
+
this.logger.info('Wire Apps SDK is not running.');
|
|
109
114
|
}
|
|
110
|
-
this.logger.info(
|
|
115
|
+
this.logger.info('Wire Apps SDK shutting down.');
|
|
111
116
|
this.isWebSocketRunning = false;
|
|
112
117
|
this.webSocketClient?.close();
|
|
113
118
|
}
|
|
114
119
|
async close() {
|
|
115
|
-
this.logger.debug(
|
|
120
|
+
this.logger.debug('Closing Websocket connections.');
|
|
116
121
|
this.stopListening();
|
|
117
|
-
this.logger.debug(
|
|
122
|
+
this.logger.debug('Closing Database connections.');
|
|
118
123
|
try {
|
|
119
124
|
const databaseService = container.resolve(DatabaseService);
|
|
120
125
|
databaseService.close();
|
|
121
126
|
}
|
|
122
127
|
catch (exception) {
|
|
123
|
-
this.logger.debug(
|
|
128
|
+
this.logger.debug('Database service was not initialized or could not be closed.', exception);
|
|
124
129
|
}
|
|
125
130
|
// Clear container to prevent memory leaks
|
|
126
131
|
container.clearInstances();
|
|
127
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* Registers a listener to be notified when the connection to the Wire backend
|
|
135
|
+
* is established or lost.
|
|
136
|
+
*/
|
|
137
|
+
setBackendConnectionListener(listener) {
|
|
138
|
+
this.webSocketClient?.setBackendConnectionListener(listener);
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Returns the WireApplicationManager used to interact with the Wire backend.
|
|
142
|
+
*
|
|
143
|
+
* Available as soon as create() resolves. Operations on MLS conversations require the app
|
|
144
|
+
* to have joined those conversations, which happens during startListening().
|
|
145
|
+
* Do not use the returned instance after close().
|
|
146
|
+
*/
|
|
147
|
+
getApplicationManager() {
|
|
148
|
+
return container.resolve(WireApplicationManager);
|
|
149
|
+
}
|
|
128
150
|
registerExitHandlers() {
|
|
129
151
|
// SIGINT: Ctrl+C in terminal
|
|
130
152
|
process.on('SIGINT', () => this.handleExit('SIGINT'));
|
package/build/WireAppSdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WireAppSdk.js","sourceRoot":"","sources":["../src/WireAppSdk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"WireAppSdk.js","sourceRoot":"","sources":["../src/WireAppSdk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,kBAAkB,CAAA;AACzB,OAAO,kCAAkC,CAAA;AACzC,OAAO,EAAC,SAAS,EAAC,MAAM,SAAS,CAAA;AACjC,OAAO,EAAC,iBAAiB,EAAC,MAAM,6BAA6B,CAAA;AAC7D,OAAO,EACL,aAAa,EACb,6BAA6B,EAC7B,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,sCAAsC,CAAA;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AAuB,EAAE,SAAS,CAAC,CAAA;YACrD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACjB,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { HttpClient } from
|
|
2
|
-
import type { AssetUploadData } from
|
|
3
|
-
import type { AssetUploadResponse } from
|
|
4
|
-
import type { AssetData } from
|
|
1
|
+
import { HttpClient } from '../core/HttpClient.js';
|
|
2
|
+
import type { AssetUploadData } from './model/asset/AssetUploadData.js';
|
|
3
|
+
import type { AssetUploadResponse } from './model/asset/AssetUploadResponse.js';
|
|
4
|
+
import type { AssetData } from '../model/Asset.js';
|
|
5
5
|
export declare class AssetsApiClient {
|
|
6
6
|
private httpClient;
|
|
7
7
|
constructor(httpClient: HttpClient);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetsApiClient.d.ts","sourceRoot":"","sources":["../../src/api/AssetsApiClient.ts"],"names":[],"mappings":"AAgBA,OAAO,
|
|
1
|
+
{"version":3,"file":"AssetsApiClient.d.ts","sourceRoot":"","sources":["../../src/api/AssetsApiClient.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAA;AAEhD,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,kCAAkC,CAAA;AACrE,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,sCAAsC,CAAA;AAG7E,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAA;AAEhD,qBACa,eAAe;IACd,OAAO,CAAC,UAAU;gBAAV,UAAU,EAAE,UAAU;IAE1C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAW;IAEtC,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,SAAS,CAAC;IASnG,WAAW,CAAC,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,eAAe,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAsBpG"}
|
|
@@ -23,20 +23,20 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
23
23
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
24
24
|
};
|
|
25
25
|
var AssetsApiClient_1;
|
|
26
|
-
import { HttpClient } from
|
|
27
|
-
import { singleton } from
|
|
28
|
-
import { randomUUID } from
|
|
29
|
-
import { concatToBuffer } from
|
|
26
|
+
import { HttpClient } from '../core/HttpClient.js';
|
|
27
|
+
import { singleton } from 'tsyringe';
|
|
28
|
+
import { randomUUID } from 'crypto';
|
|
29
|
+
import { concatToBuffer } from '../utils/BufferUtils.js';
|
|
30
30
|
let AssetsApiClient = class AssetsApiClient {
|
|
31
31
|
static { AssetsApiClient_1 = this; }
|
|
32
32
|
httpClient;
|
|
33
33
|
constructor(httpClient) {
|
|
34
34
|
this.httpClient = httpClient;
|
|
35
35
|
}
|
|
36
|
-
static BASE_PATH =
|
|
36
|
+
static BASE_PATH = 'assets';
|
|
37
37
|
async downloadAsset(assetId, assetDomain, assetToken) {
|
|
38
38
|
const path = `${AssetsApiClient_1.BASE_PATH}/${assetDomain}/${assetId}`;
|
|
39
|
-
const headerAssetToken = assetToken ? {
|
|
39
|
+
const headerAssetToken = assetToken ? { 'Asset-Token': assetToken } : {};
|
|
40
40
|
return await this.httpClient.getRequest(path, {
|
|
41
41
|
additionalHeaders: headerAssetToken
|
|
42
42
|
});
|
|
@@ -55,7 +55,7 @@ let AssetsApiClient = class AssetsApiClient {
|
|
|
55
55
|
'\r\n';
|
|
56
56
|
const footer = `\r\n--${boundary}--\r\n`;
|
|
57
57
|
return await this.httpClient.postRequest(AssetsApiClient_1.BASE_PATH, concatToBuffer(body, asset, footer), {
|
|
58
|
-
headerContentType: `multipart/mixed; boundary=${boundary}
|
|
58
|
+
headerContentType: `multipart/mixed; boundary=${boundary}`
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetsApiClient.js","sourceRoot":"","sources":["../../src/api/AssetsApiClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"AssetsApiClient.js","sourceRoot":"","sources":["../../src/api/AssetsApiClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;AAEH,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAA;AAChD,OAAO,EAAC,SAAS,EAAC,MAAM,UAAU,CAAA;AAGlC,OAAO,EAAC,UAAU,EAAC,MAAM,QAAQ,CAAA;AACjC,OAAO,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAA;AAI/C,IAAM,eAAe,GAArB,MAAM,eAAe;;IACN;IAApB,YAAoB,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAAG,CAAC;IAEtC,MAAM,CAAU,SAAS,GAAG,QAAQ,CAAA;IAE5C,KAAK,CAAC,aAAa,CAAC,OAAe,EAAE,WAAmB,EAAE,UAA0B;QAClF,MAAM,IAAI,GAAG,GAAG,iBAAe,CAAC,SAAS,IAAI,WAAW,IAAI,OAAO,EAAE,CAAA;QACrE,MAAM,gBAAgB,GAA2B,UAAU,CAAC,CAAC,CAAC,EAAC,aAAa,EAAE,UAAU,EAAC,CAAC,CAAC,CAAC,EAAE,CAAA;QAE9F,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,UAAU,CAAa,IAAI,EAAE;YACxD,iBAAiB,EAAE,gBAAgB;SACpC,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,KAAgB,EAAE,eAAgC;QAClE,MAAM,QAAQ,GAAG,WAAW,UAAU,EAAE,EAAE,CAAA;QAE1C,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,CAAA;QAEhD,MAAM,IAAI,GACR,KAAK,QAAQ,MAAM;YACnB,kDAAkD;YAClD,mBAAmB,QAAQ,CAAC,MAAM,MAAM;YACxC,MAAM;YACN,GAAG,QAAQ,MAAM;YACjB,KAAK,QAAQ,MAAM;YACnB,4CAA4C;YAC5C,mBAAmB,KAAK,CAAC,MAAM,MAAM;YACrC,MAAM,CAAA;QAER,MAAM,MAAM,GAAG,SAAS,QAAQ,QAAQ,CAAA;QAExC,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,iBAAe,CAAC,SAAS,EAAE,cAAc,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE;YACvG,iBAAiB,EAAE,6BAA6B,QAAQ,EAAE;SAC3D,CAAC,CAAA;IACJ,CAAC;;AAnCU,eAAe;IAD3B,SAAS,EAAE;qCAEsB,UAAU;GAD/B,eAAe,CAoC3B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AssetsApiClient } from
|
|
2
|
-
import type { AssetRemoteData } from
|
|
3
|
-
import type { AssetData } from
|
|
1
|
+
import { AssetsApiClient } from './AssetsApiClient.js';
|
|
2
|
+
import type { AssetRemoteData } from '../model/WireMessage.js';
|
|
3
|
+
import type { AssetData } from '../model/Asset.js';
|
|
4
4
|
export declare class AssetsTransferService {
|
|
5
5
|
private assetsApiClient;
|
|
6
6
|
constructor(assetsApiClient: AssetsApiClient);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetsTransferService.d.ts","sourceRoot":"","sources":["../../src/api/AssetsTransferService.ts"],"names":[],"mappings":"AAiBA,OAAO,
|
|
1
|
+
{"version":3,"file":"AssetsTransferService.d.ts","sourceRoot":"","sources":["../../src/api/AssetsTransferService.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAC,eAAe,EAAC,MAAM,sBAAsB,CAAA;AACpD,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAA;AAM5D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAA;AAGhD,qBACa,qBAAqB;IACpB,OAAO,CAAC,eAAe;gBAAf,eAAe,EAAE,eAAe;IAEpD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAoB;IAE5C,aAAa,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC;IAiBpE,qBAAqB,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,eAAe,CAAC;YAoBzD,WAAW;CAO1B"}
|
|
@@ -22,11 +22,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
22
22
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
23
23
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
24
24
|
};
|
|
25
|
-
import { singleton } from
|
|
26
|
-
import { AssetsApiClient } from
|
|
27
|
-
import { AESUtils } from
|
|
28
|
-
import { HashUtils } from
|
|
29
|
-
import { obfuscateId } from
|
|
25
|
+
import { singleton } from 'tsyringe';
|
|
26
|
+
import { AssetsApiClient } from './AssetsApiClient.js';
|
|
27
|
+
import { AESUtils } from '../utils/AESUtils.js';
|
|
28
|
+
import { HashUtils } from '../utils/HashUtils.js';
|
|
29
|
+
import { obfuscateId } from '../utils/ObfuscateUtil.js';
|
|
30
|
+
import { InvalidParameterError } from '../exception/WireException.js';
|
|
30
31
|
let AssetsTransferService = class AssetsTransferService {
|
|
31
32
|
assetsApiClient;
|
|
32
33
|
constructor(assetsApiClient) {
|
|
@@ -37,8 +38,7 @@ let AssetsTransferService = class AssetsTransferService {
|
|
|
37
38
|
const encryptedAsset = await this.assetsApiClient.downloadAsset(assetRemoteData.assetId, assetRemoteData.assetDomain, assetRemoteData.assetToken);
|
|
38
39
|
const calculatedSha256 = HashUtils.calculateSha256Hash(encryptedAsset);
|
|
39
40
|
if (!HashUtils.isHashEqual(assetRemoteData.sha256, calculatedSha256)) {
|
|
40
|
-
|
|
41
|
-
throw new Error(`The sha256 doesn't match for asset with ID ${obfuscateId(assetRemoteData.assetId)}`);
|
|
41
|
+
throw new InvalidParameterError(`Asset download failed. Asset checksums do not match. assetId: ${obfuscateId(assetRemoteData.assetId)}`);
|
|
42
42
|
}
|
|
43
43
|
return AESUtils.decryptData(encryptedAsset, assetRemoteData.otrKey);
|
|
44
44
|
}
|
|
@@ -61,8 +61,7 @@ let AssetsTransferService = class AssetsTransferService {
|
|
|
61
61
|
}
|
|
62
62
|
async uploadAsset(asset, assetUploadData) {
|
|
63
63
|
if (asset.length > this.MAX_DATA_SIZE) {
|
|
64
|
-
|
|
65
|
-
throw new Error("AssetData size exceeds the maximum limit of 100MB");
|
|
64
|
+
throw new InvalidParameterError(`AssetData size exceeds the maximum limit of 100MB. Size: ${asset.length} bytes`);
|
|
66
65
|
}
|
|
67
66
|
return await this.assetsApiClient.uploadAsset(asset, assetUploadData);
|
|
68
67
|
}
|
|
@@ -76,5 +75,5 @@ export { AssetsTransferService };
|
|
|
76
75
|
* The asset is retained indefinitely, storage is optimized
|
|
77
76
|
* for infrequent access after 30 days of creation.
|
|
78
77
|
*/
|
|
79
|
-
const ETERNAL_INFREQUENT_ACCESS =
|
|
78
|
+
const ETERNAL_INFREQUENT_ACCESS = 'eternal-infrequent_access';
|
|
80
79
|
//# sourceMappingURL=AssetsTransferService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetsTransferService.js","sourceRoot":"","sources":["../../src/api/AssetsTransferService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"AssetsTransferService.js","sourceRoot":"","sources":["../../src/api/AssetsTransferService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;AAEH,OAAO,EAAC,SAAS,EAAC,MAAM,UAAU,CAAA;AAClC,OAAO,EAAC,eAAe,EAAC,MAAM,sBAAsB,CAAA;AAE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I,CAAC,WAAW,CAAC,cAAc,EAAE,eAAe,CAAC,CAAA;QAEnF,OAAO;YACL,MAAM,EAAE,aAAa,CAAC,WAAW;YACjC,mBAAmB,EAAE,aAAa,CAAC,SAAS;YAC5C,MAAM,EAAE,SAAS,CAAC,mBAAmB,CAAC,cAAc,CAAC;YACrD,OAAO,EAAE,mBAAmB,CAAC,GAAG;YAChC,UAAU,EAAE,mBAAmB,CAAC,KAAK,IAAI,IAAI;YAC7C,WAAW,EAAE,mBAAmB,CAAC,MAAM;SACxC,CAAA;IACH,CAAC;IAEO,KAAK,CAAC,WAAW,CAAC,KAAgB,EAAE,eAAgC;QAC1E,IAAI,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;YACtC,MAAM,IAAI,qBAAqB,CAAC,4DAA4D,KAAK,CAAC,MAAM,QAAQ,CAAC,CAAA;QACnH,CAAC;QAED,OAAO,MAAM,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,KAAK,EAAE,eAAe,CAAC,CAAA;IACvE,CAAC;CACF,CAAA;AAjDY,qBAAqB;IADjC,SAAS,EAAE;qCAE2B,eAAe;GADzC,qBAAqB,CAiDjC;;AAED;;;GAGG;AACH,MAAM,yBAAyB,GAAG,2BAA2B,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { HttpClient } from
|
|
2
|
-
import type { MlsPublicKeys } from
|
|
3
|
-
import type { PreKeyCrypto } from
|
|
4
|
-
import { AppProperties } from
|
|
1
|
+
import { HttpClient } from '../core/HttpClient.js';
|
|
2
|
+
import type { MlsPublicKeys } from '../model/MlsPublicKeys.js';
|
|
3
|
+
import type { PreKeyCrypto } from '../model/PreKeyCrypto.js';
|
|
4
|
+
import { AppProperties } from '../service/AppProperties.js';
|
|
5
5
|
export declare class ClientsApiClient {
|
|
6
6
|
private httpClient;
|
|
7
7
|
private appProperties;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientsApiClient.d.ts","sourceRoot":"","sources":["../../src/api/ClientsApiClient.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"ClientsApiClient.d.ts","sourceRoot":"","sources":["../../src/api/ClientsApiClient.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAA;AAGhD,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,2BAA2B,CAAA;AAG5D,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAA;AAE1D,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAA;AAEzD,qBACa,gBAAgB;IAEzB,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,aAAa;gBADb,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,aAAa;IAGtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAY;IAE/B,cAAc,CAAC,cAAc,EAAE,YAAY,EAAE,EAAE,iBAAiB,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;IAehG,4BAA4B,CAAC,aAAa,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;CAOhF"}
|
|
@@ -22,11 +22,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
22
22
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
23
23
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
24
24
|
};
|
|
25
|
-
import { HttpClient } from
|
|
26
|
-
import { RegisterClientRequest } from
|
|
27
|
-
import { mapToPreKeyRequest } from
|
|
28
|
-
import { singleton } from
|
|
29
|
-
import { AppProperties } from
|
|
25
|
+
import { HttpClient } from '../core/HttpClient.js';
|
|
26
|
+
import { RegisterClientRequest } from './request/RegisterClientRequest.js';
|
|
27
|
+
import { mapToPreKeyRequest } from '../mappers/PreKeyMapper.js';
|
|
28
|
+
import { singleton } from 'tsyringe';
|
|
29
|
+
import { AppProperties } from '../service/AppProperties.js';
|
|
30
30
|
let ClientsApiClient = class ClientsApiClient {
|
|
31
31
|
httpClient;
|
|
32
32
|
appProperties;
|
|
@@ -34,7 +34,7 @@ let ClientsApiClient = class ClientsApiClient {
|
|
|
34
34
|
this.httpClient = httpClient;
|
|
35
35
|
this.appProperties = appProperties;
|
|
36
36
|
}
|
|
37
|
-
basePath =
|
|
37
|
+
basePath = 'clients';
|
|
38
38
|
async registerClient(proteusPreKeys, proteusLastPreKey) {
|
|
39
39
|
const requestPayload = new RegisterClientRequest(mapToPreKeyRequest(proteusLastPreKey), proteusPreKeys.map((preKey) => mapToPreKeyRequest(preKey)));
|
|
40
40
|
const response = await this.httpClient.postRequest(this.basePath, requestPayload);
|
|
@@ -45,7 +45,7 @@ let ClientsApiClient = class ClientsApiClient {
|
|
|
45
45
|
}
|
|
46
46
|
async updateClientWithMlsPublicKey(mlsPublicKeys) {
|
|
47
47
|
const requestPayload = {
|
|
48
|
-
mls_public_keys: mlsPublicKeys
|
|
48
|
+
mls_public_keys: mlsPublicKeys
|
|
49
49
|
};
|
|
50
50
|
await this.httpClient.putRequest(`${this.basePath}/${this.appProperties.getDeviceId()}`, requestPayload);
|
|
51
51
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientsApiClient.js","sourceRoot":"","sources":["../../src/api/ClientsApiClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;AAEH,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"ClientsApiClient.js","sourceRoot":"","sources":["../../src/api/ClientsApiClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;AAEH,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAA;AAEhD,OAAO,EAAC,qBAAqB,EAAC,MAAM,oCAAoC,CAAA;AAGxE,OAAO,EAAC,kBAAkB,EAAC,M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3
|
-
import { PreKeyCrypto } from
|
|
1
|
+
import type { MlsPublicKeys } from '../model/MlsPublicKeys.js';
|
|
2
|
+
import { ClientsApiClient } from './ClientsApiClient.js';
|
|
3
|
+
import { PreKeyCrypto } from '../model/PreKeyCrypto.js';
|
|
4
4
|
export declare class ClientsService {
|
|
5
5
|
private clientsApiClient;
|
|
6
6
|
constructor(clientsApiClient: ClientsApiClient);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientsService.d.ts","sourceRoot":"","sources":["../../src/api/ClientsService.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,2BAA2B,
|
|
1
|
+
{"version":3,"file":"ClientsService.d.ts","sourceRoot":"","sources":["../../src/api/ClientsService.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,2BAA2B,CAAA;AAC5D,OAAO,EAAC,gBAAgB,EAAC,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAA;AAGrD,qBACa,cAAc;IACb,OAAO,CAAC,gBAAgB;gBAAhB,gBAAgB,EAAE,gBAAgB;IAEhD,cAAc,CAAC,cAAc,EAAE,YAAY,EAAE,EAAE,iBAAiB,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;IAIhG,4BAA4B,CAAC,aAAa,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;CAGhF"}
|
|
@@ -22,9 +22,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
22
22
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
23
23
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
24
24
|
};
|
|
25
|
-
import { ClientsApiClient } from
|
|
26
|
-
import { PreKeyCrypto } from
|
|
27
|
-
import { singleton } from
|
|
25
|
+
import { ClientsApiClient } from './ClientsApiClient.js';
|
|
26
|
+
import { PreKeyCrypto } from '../model/PreKeyCrypto.js';
|
|
27
|
+
import { singleton } from 'tsyringe';
|
|
28
28
|
let ClientsService = class ClientsService {
|
|
29
29
|
clientsApiClient;
|
|
30
30
|
constructor(clientsApiClient) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientsService.js","sourceRoot":"","sources":["../../src/api/ClientsService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;AAGH,OAAO,EAAC,gBAAgB,EAAC,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"ClientsService.js","sourceRoot":"","sources":["../../src/api/ClientsService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;AAGH,OAAO,EAAC,gBAAgB,EAAC,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAC,SAAS,EAAC,MAAM,UAAU,CAAA;AAG3B,IAAM,cAAc,GAApB,MAAM,cAAc;IACL;IAApB,YAAoB,gBAAkC;QAAlC,qBAAgB,GAAhB,gBAAgB,CAAkB;IAAG,CAAC;IAE1D,KAAK,CAAC,cAAc,CAAC,cAA8B,EAAE,iBAA+B;QAClF,OAAO,MAAM,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAA;IACtF,CAAC;IAED,KAAK,CAAC,4BAA4B,CAAC,aAA4B;QAC7D,MAAM,IAAI,CAAC,gBAAgB,CAAC,4BAA4B,CAAC,aAAa,CAAC,CAAA;IACzE,CAAC;CACF,CAAA;AAVY,cAAc;IAD1B,SAAS,EAAE;qCAE4B,gBAAgB;GAD3C,cAAc,CAU1B"}
|