@wireapp/wire-apps-js-sdk 0.0.1-alpha → 0.0.2-alpha
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,18 +1,18 @@
|
|
|
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
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
17
17
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18
18
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -25,20 +25,21 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
25
25
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
26
26
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
27
27
|
};
|
|
28
|
-
import { ConversationId, CoreCryptoError, GroupInfo, MlsError } from
|
|
29
|
-
import { ClientsService } from
|
|
30
|
-
import { CryptoClientId } from
|
|
31
|
-
import { WIRE_CRYPTOGRAPHY_STORAGE_KEY
|
|
32
|
-
import { MlsService } from
|
|
33
|
-
import { CoreCryptoClient } from
|
|
34
|
-
import { CoreCryptoMlsTransport } from
|
|
35
|
-
import { FeatureConfigsService } from
|
|
36
|
-
import { Decoder } from
|
|
37
|
-
import { inject, singleton } from
|
|
38
|
-
import { LoggerFactory } from
|
|
39
|
-
import { AppProperties } from
|
|
40
|
-
import { obfuscateClientId, obfuscateId } from
|
|
41
|
-
import {} from
|
|
28
|
+
import { ConversationId, CoreCryptoError, GroupInfo, MlsError } from '@wireapp/core-crypto/native';
|
|
29
|
+
import { ClientsService } from '../api/ClientsService.js';
|
|
30
|
+
import { CryptoClientId } from '../model/CryptoClientId.js';
|
|
31
|
+
import { WIRE_CRYPTOGRAPHY_STORAGE_KEY } from '../utils/DependencyInjectionTokens.js';
|
|
32
|
+
import { MlsService } from '../api/MlsService.js';
|
|
33
|
+
import { CoreCryptoClient } from './CoreCryptoClient.js';
|
|
34
|
+
import { CoreCryptoMlsTransport } from './CoreCryptoMlsTransport.js';
|
|
35
|
+
import { FeatureConfigsService } from '../api/FeatureConfigsService.js';
|
|
36
|
+
import { Decoder } from 'bazinga64';
|
|
37
|
+
import { inject, singleton } from 'tsyringe';
|
|
38
|
+
import { LoggerFactory } from '../utils/logger/LoggerFactory.js';
|
|
39
|
+
import { AppProperties } from '../service/AppProperties.js';
|
|
40
|
+
import { obfuscateClientId, obfuscateId } from '../utils/ObfuscateUtil.js';
|
|
41
|
+
import {} from '../api/response/MlsPublicKeysResponse.js';
|
|
42
|
+
import { CryptographicSystemError, InvalidParameterError, MissingParameterError } from '../exception/WireException.js';
|
|
42
43
|
/**
|
|
43
44
|
* Service that handles initialization of CoreCrypto and provides a high-level API for:
|
|
44
45
|
* - Client initialization
|
|
@@ -46,8 +47,6 @@ import {} from "../api/response/MlsPublicKeysResponse.js";
|
|
|
46
47
|
* - Message encryption and decryption
|
|
47
48
|
*/
|
|
48
49
|
let CoreCryptoService = class CoreCryptoService {
|
|
49
|
-
wireUserId;
|
|
50
|
-
wireUserDomain;
|
|
51
50
|
cryptographyStorageKey;
|
|
52
51
|
featureConfigsService;
|
|
53
52
|
clientsService;
|
|
@@ -57,9 +56,8 @@ let CoreCryptoService = class CoreCryptoService {
|
|
|
57
56
|
coreCryptoClient;
|
|
58
57
|
logger = LoggerFactory.getLogger(this.constructor.name);
|
|
59
58
|
defaultCiphersuiteCode;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
this.wireUserDomain = wireUserDomain;
|
|
59
|
+
appQualifiedId;
|
|
60
|
+
constructor(cryptographyStorageKey, featureConfigsService, clientsService, mlsService, mlsTransport, appProperties) {
|
|
63
61
|
this.cryptographyStorageKey = cryptographyStorageKey;
|
|
64
62
|
this.featureConfigsService = featureConfigsService;
|
|
65
63
|
this.clientsService = clientsService;
|
|
@@ -67,14 +65,28 @@ let CoreCryptoService = class CoreCryptoService {
|
|
|
67
65
|
this.mlsTransport = mlsTransport;
|
|
68
66
|
this.appProperties = appProperties;
|
|
69
67
|
}
|
|
68
|
+
getApplicationQualifiedId() {
|
|
69
|
+
this.appQualifiedId ??= this.appProperties.getApplicationQualifiedId();
|
|
70
|
+
return this.appQualifiedId;
|
|
71
|
+
}
|
|
70
72
|
/**
|
|
71
73
|
* Initializes the CoreCryptoClient.
|
|
72
74
|
*
|
|
73
75
|
* Must be called before anything else.
|
|
74
76
|
*/
|
|
75
77
|
async initCoreCryptoClient() {
|
|
78
|
+
const appQualifiedId = this.getApplicationQualifiedId();
|
|
76
79
|
this.defaultCiphersuiteCode = await this.featureConfigsService.getDefaultCipherSuite();
|
|
77
|
-
|
|
80
|
+
if (!this.appProperties.hasDeviceId()) {
|
|
81
|
+
this.logger.warn(`No stored deviceId found. Wiping cryptographic storage. userId: ${obfuscateId(appQualifiedId.id)}`);
|
|
82
|
+
try {
|
|
83
|
+
CoreCryptoClient.deleteClientStorage(appQualifiedId.id);
|
|
84
|
+
}
|
|
85
|
+
catch (exception) {
|
|
86
|
+
throw new CryptographicSystemError('Error when deleting stale cryptographic storage', exception);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
this.coreCryptoClient = await CoreCryptoClient.create(appQualifiedId.id, this.defaultCiphersuiteCode, this.cryptographyStorageKey, this.mlsTransport);
|
|
78
90
|
}
|
|
79
91
|
/**
|
|
80
92
|
* Initializes existing client device or register a new client device.
|
|
@@ -85,18 +97,19 @@ let CoreCryptoService = class CoreCryptoService {
|
|
|
85
97
|
*/
|
|
86
98
|
async initOrRegisterClient() {
|
|
87
99
|
if (!this.coreCryptoClient) {
|
|
88
|
-
throw new
|
|
100
|
+
throw new CryptographicSystemError('CoreCryptoClient is not initialized.');
|
|
89
101
|
}
|
|
102
|
+
const appQualifiedId = this.getApplicationQualifiedId();
|
|
90
103
|
if (this.appProperties.hasDeviceId()) {
|
|
91
104
|
const storedDeviceId = this.appProperties.getDeviceId();
|
|
92
105
|
this.logger.info(`Loading MLS Client for deviceId: ${obfuscateClientId(storedDeviceId)}`);
|
|
93
|
-
const cryptoClientId = CryptoClientId.create(
|
|
106
|
+
const cryptoClientId = CryptoClientId.create(appQualifiedId.id, storedDeviceId, appQualifiedId.domain);
|
|
94
107
|
await this.coreCryptoClient.initMlsClient(cryptoClientId);
|
|
95
108
|
this.appProperties.setShouldRejoinConversations(false);
|
|
96
109
|
}
|
|
97
110
|
else {
|
|
98
111
|
this.logger.info("App doesn't have a client. Creating one.");
|
|
99
|
-
this.logger.info(`Initializing Proteus Client. appId: ${obfuscateId(
|
|
112
|
+
this.logger.info(`Initializing Proteus Client. appId: ${obfuscateId(appQualifiedId.id)}`);
|
|
100
113
|
await this.coreCryptoClient.initProteusClient();
|
|
101
114
|
const proteusPreKeys = await this.coreCryptoClient.generateProteusPreKeys();
|
|
102
115
|
const proteusLastPreKey = await this.coreCryptoClient.generateProteusLastPreKey();
|
|
@@ -105,11 +118,11 @@ let CoreCryptoService = class CoreCryptoService {
|
|
|
105
118
|
registeredDeviceId = await this.clientsService.registerClient(proteusPreKeys, proteusLastPreKey);
|
|
106
119
|
}
|
|
107
120
|
catch (exception) {
|
|
108
|
-
throw new
|
|
121
|
+
throw new CryptographicSystemError('Error when registering client', exception);
|
|
109
122
|
}
|
|
110
123
|
this.appProperties.setDeviceId(registeredDeviceId);
|
|
111
|
-
const cryptoClientId = CryptoClientId.create(
|
|
112
|
-
this.logger.info(`Initializing MLS Client. userId: ${obfuscateId(
|
|
124
|
+
const cryptoClientId = CryptoClientId.create(appQualifiedId.id, registeredDeviceId, appQualifiedId.domain);
|
|
125
|
+
this.logger.info(`Initializing MLS Client. userId: ${obfuscateId(appQualifiedId.id)}, deviceId: ${obfuscateClientId(registeredDeviceId)}`);
|
|
113
126
|
await this.coreCryptoClient.initMlsClient(cryptoClientId);
|
|
114
127
|
await this.uploadClientWithMlsPublicKey();
|
|
115
128
|
await this.uploadMlsKeyPackages();
|
|
@@ -134,11 +147,11 @@ let CoreCryptoService = class CoreCryptoService {
|
|
|
134
147
|
}
|
|
135
148
|
catch (exception) {
|
|
136
149
|
if (CoreCryptoError.Mls.instanceOf(exception) && MlsError.OrphanWelcome.instanceOf(exception.inner.mlsError)) {
|
|
137
|
-
this.logger.warn(
|
|
150
|
+
this.logger.warn('Cannot process welcome message, asking to join the conversation');
|
|
138
151
|
await this.joinMlsConversation(groupInfoBytes);
|
|
139
152
|
}
|
|
140
153
|
else {
|
|
141
|
-
this.logger.error(
|
|
154
|
+
this.logger.error('Cannot process welcome message', exception);
|
|
142
155
|
}
|
|
143
156
|
}
|
|
144
157
|
}
|
|
@@ -148,14 +161,14 @@ let CoreCryptoService = class CoreCryptoService {
|
|
|
148
161
|
async mlsGenerateKeyPackages() {
|
|
149
162
|
return await this.coreCryptoClient.mlsGenerateKeyPackages();
|
|
150
163
|
}
|
|
151
|
-
async
|
|
164
|
+
async encryptMlsMessage(mlsGroupId, message) {
|
|
152
165
|
const mlsGroupIdBytes = Decoder.fromBase64(mlsGroupId).asBytes;
|
|
153
|
-
return await this.coreCryptoClient.
|
|
166
|
+
return await this.coreCryptoClient.encryptMlsMessage(new ConversationId(mlsGroupIdBytes), message);
|
|
154
167
|
}
|
|
155
|
-
async
|
|
168
|
+
async decryptMlsMessage(mlsGroupId, encryptedMessage) {
|
|
156
169
|
const mlsGroupIdBytes = Decoder.fromBase64(mlsGroupId).asBytes;
|
|
157
170
|
const encryptedMessageBytes = Decoder.fromBase64(encryptedMessage).asBytes;
|
|
158
|
-
return await this.coreCryptoClient.
|
|
171
|
+
return await this.coreCryptoClient.decryptMlsMessage(new ConversationId(mlsGroupIdBytes), encryptedMessageBytes);
|
|
159
172
|
}
|
|
160
173
|
async wipeConversation(mlsGroupId) {
|
|
161
174
|
const conversationId = this.conversationIdFromMlsGroupId(mlsGroupId);
|
|
@@ -175,7 +188,7 @@ let CoreCryptoService = class CoreCryptoService {
|
|
|
175
188
|
async addClientsToMlsConversation(mlsGroupId, members) {
|
|
176
189
|
this.logger.debug(`Adding ${members.length} clients to MLS group id: ${obfuscateId(mlsGroupId)}`);
|
|
177
190
|
if (members.length === 0) {
|
|
178
|
-
throw new
|
|
191
|
+
throw new InvalidParameterError('List of members cannot be empty.');
|
|
179
192
|
}
|
|
180
193
|
const claimedKeyPackagesResult = await this.mlsService.claimKeyPackages(members, this.defaultCiphersuiteCode);
|
|
181
194
|
if (claimedKeyPackagesResult.keyPackages.length === 0) {
|
|
@@ -198,20 +211,21 @@ let CoreCryptoService = class CoreCryptoService {
|
|
|
198
211
|
async establishMlsConversation(mlsGroupId, mlsPublicKeysResponse // Exists only for 1-1 conversations
|
|
199
212
|
) {
|
|
200
213
|
if (!mlsGroupId) {
|
|
201
|
-
throw new
|
|
214
|
+
throw new MissingParameterError('mlsGroupId is required to establish an MLS conversation.');
|
|
202
215
|
}
|
|
203
216
|
const cipherSuite = CoreCryptoClient.getMlsCiphersuiteName(this.defaultCiphersuiteCode);
|
|
204
217
|
const removalKey = await this.mlsService.getRemovalKey(cipherSuite, mlsPublicKeysResponse);
|
|
205
218
|
if (removalKey == null) {
|
|
206
|
-
throw
|
|
219
|
+
throw new MissingParameterError(`No Public Keys found, skipping creating a conversation. mlsGroupId: ${obfuscateId(mlsGroupId)}`);
|
|
207
220
|
}
|
|
208
221
|
try {
|
|
209
222
|
this.logger.debug(`Creating MLS conversation in CoreCrypto. mlsGroupId: ${obfuscateId(mlsGroupId)}`);
|
|
210
223
|
await this.coreCryptoClient.createConversation(mlsGroupId, removalKey);
|
|
211
224
|
}
|
|
212
225
|
catch (exception) {
|
|
213
|
-
if (CoreCryptoError.Mls.instanceOf(exception) &&
|
|
214
|
-
|
|
226
|
+
if (CoreCryptoError.Mls.instanceOf(exception) &&
|
|
227
|
+
MlsError.ConversationAlreadyExists.instanceOf(exception.inner.mlsError)) {
|
|
228
|
+
throw new CryptographicSystemError(`Conversation already exists. mlsGroupId: ${obfuscateId(mlsGroupId)}`);
|
|
215
229
|
}
|
|
216
230
|
this.logger.error(`Failed to create MLS conversation. mlsGroupId: ${obfuscateId(mlsGroupId)}`, exception);
|
|
217
231
|
}
|
|
@@ -219,10 +233,8 @@ let CoreCryptoService = class CoreCryptoService {
|
|
|
219
233
|
};
|
|
220
234
|
CoreCryptoService = __decorate([
|
|
221
235
|
singleton(),
|
|
222
|
-
__param(0, inject(
|
|
223
|
-
|
|
224
|
-
__param(2, inject(WIRE_CRYPTOGRAPHY_STORAGE_KEY)),
|
|
225
|
-
__metadata("design:paramtypes", [String, String, Uint8Array,
|
|
236
|
+
__param(0, inject(WIRE_CRYPTOGRAPHY_STORAGE_KEY)),
|
|
237
|
+
__metadata("design:paramtypes", [Uint8Array,
|
|
226
238
|
FeatureConfigsService,
|
|
227
239
|
ClientsService,
|
|
228
240
|
MlsService,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoreCryptoService.js","sourceRoot":"","sources":["../../src/core/CoreCryptoService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"CoreCryptoService.js","sourceRoot":"","sources":["../../src/core/CoreCryptoService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;AAEH,OAAO,EAAC,cAAc,EAAE,eAAe,EAAE,SAAS,EAAE,QAAQ,EAAC,MAAM,6BAA6B,CAAA;AAChG,OAAO,EAAC,cAAc,EAAC,MAAM,0BAA0B,CAAA;AACvD,OAAO,EAAC,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KAAK,CAAC,wDAAwD,WAAW,CAAC,UAAU,CAAC,EAAE,CAAC,CAAA;YACpG,MAAM,IAAI,CAAC,gBAAiB,CAAC,kBAAkB,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;QACzE,CAAC;QAAC,OAAO,SAAS,EAAE,CAAC;YACnB,IACE,eAAe,CAAC,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC;gBACzC,QAAQ,CAAC,yBAAyB,CAAC,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,EACvE,CAAC;gBACD,MAAM,IAAI,wBAAwB,CAAC,4CAA4C,WAAW,CAAC,UAAU,CAAC,EAAE,CAAC,CAAA;YAC3G,CAAC;YACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,kDAAkD,WAAW,CAAC,UAAU,CAAC,EAAE,EAAE,SAAS,CAAC,CAAA;QAC3G,CAAC;IACH,CAAC;CACF,CAAA;AApOY,iBAAiB;IAD7B,SAAS,EAAE;IAQP,WAAA,MAAM,CAAC,6BAA6B,CAAC,CAAA;qCAAiC,UAAU;QAClD,qBAAqB;QAC5B,cAAc;QAClB,UAAU;QACR,sBAAsB;QACrB,aAAa;GAZ3B,iBAAiB,CAoO7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpClient.d.ts","sourceRoot":"","sources":["../../src/core/HttpClient.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,
|
|
1
|
+
{"version":3,"file":"HttpClient.d.ts","sourceRoot":"","sources":["../../src/core/HttpClient.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAA;AAczD,qBACa,UAAU;IASI,OAAO,CAAC,WAAW;IAC1C,OAAO,CAAC,aAAa;IATvB,OAAO,CAAC,MAAM,CAAiD;IAC/D,OAAO,CAAC,iBAAiB,CAAsB;IAC/C,OAAO,CAAC,sBAAsB,CAA6B;IAC3D,OAA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AC,CAAC;IAgBP,aAAa,CAAC,CAAC,EACnB,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,OAAO,EACd,OAAO,CAAC,EAAE;QACR,iBAAiB,CAAC,EAAE,MAAM,CAAA;QAC1B,YAAY,CAAC,EAAE,MAAM,CAAA;KACtB,GACA,OAAO,CAAC,CAAC,CAAC;IAmBb,OAAO,CAAC,gBAAgB,CAAgB;IACxC,OAAO,CAAC,2BAA2B,CAAqB;IACxD,OAAO,CAAC,qBAAqB,CAAqB;CACnD"}
|
package/build/core/HttpClient.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
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
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
17
17
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18
18
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -25,13 +25,14 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
25
25
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
26
26
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
27
27
|
};
|
|
28
|
-
import { WIRE_API_HOST } from
|
|
29
|
-
import { inject, singleton } from
|
|
30
|
-
import { LoggerFactory } from
|
|
31
|
-
import { AppProperties } from
|
|
32
|
-
import { WireApiException } from
|
|
33
|
-
import { HTTP_RETRY_POLICY } from
|
|
34
|
-
import { calculateHttpRetryDelay, isRetryableHttpError, isRetryableHttpStatus, RetryableHttpStatusError, RetryableNetworkError, waitForHttpRetry } from
|
|
28
|
+
import { WIRE_API_HOST } from '../utils/DependencyInjectionTokens.js';
|
|
29
|
+
import { inject, singleton } from 'tsyringe';
|
|
30
|
+
import { LoggerFactory } from '../utils/logger/LoggerFactory.js';
|
|
31
|
+
import { AppProperties } from '../service/AppProperties.js';
|
|
32
|
+
import { WireApiException } from '../exception/WireApiException.js';
|
|
33
|
+
import { HTTP_RETRY_POLICY } from './HttpRetryPolicy.js';
|
|
34
|
+
import { calculateHttpRetryDelay, isRetryableHttpError, isRetryableHttpStatus, RetryableHttpStatusError, RetryableNetworkError, waitForHttpRetry } from './HttpRetryHelper.js';
|
|
35
|
+
import { AuthenticationError, UnknownError } from '../exception/WireException.js';
|
|
35
36
|
let HttpClient = class HttpClient {
|
|
36
37
|
wireApiHost;
|
|
37
38
|
appProperties;
|
|
@@ -39,14 +40,14 @@ let HttpClient = class HttpClient {
|
|
|
39
40
|
cachedAccessToken = null;
|
|
40
41
|
accessTokenRefreshLock = null;
|
|
41
42
|
headers = {
|
|
42
|
-
|
|
43
|
+
'Content-Type': 'application/json'
|
|
43
44
|
};
|
|
44
45
|
constructor(wireApiHost, appProperties) {
|
|
45
46
|
this.wireApiHost = wireApiHost;
|
|
46
47
|
this.appProperties = appProperties;
|
|
47
48
|
}
|
|
48
49
|
setAuthorizationToken(token) {
|
|
49
|
-
this.headers[
|
|
50
|
+
this.headers['Authorization'] = `Bearer ${token}`;
|
|
50
51
|
}
|
|
51
52
|
clearAuthorizationToken() {
|
|
52
53
|
this.cachedAccessToken = null;
|
|
@@ -56,9 +57,8 @@ let HttpClient = class HttpClient {
|
|
|
56
57
|
}
|
|
57
58
|
getCachedAccessToken() {
|
|
58
59
|
if (!this.cachedAccessToken) {
|
|
59
|
-
this.logger.error(
|
|
60
|
-
|
|
61
|
-
throw new Error("No cached access token found.");
|
|
60
|
+
this.logger.error('No cached access token found.');
|
|
61
|
+
throw new AuthenticationError('No cached access token found.');
|
|
62
62
|
}
|
|
63
63
|
return this.cachedAccessToken;
|
|
64
64
|
}
|
|
@@ -92,25 +92,23 @@ let HttpClient = class HttpClient {
|
|
|
92
92
|
this.logger.error('Unable to retrieve access token, Error:', exception);
|
|
93
93
|
if (exception instanceof WireApiException && exception.isCredentialsInvalid()) {
|
|
94
94
|
this.appProperties.deleteBackendCookie();
|
|
95
|
-
|
|
96
|
-
throw new
|
|
95
|
+
this.appProperties.deleteDeviceId();
|
|
96
|
+
throw new AuthenticationError('Current cookie/api-token is expired. Get a new apiToken and restart the App');
|
|
97
97
|
}
|
|
98
98
|
throw exception;
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
async fetchAccessToken() {
|
|
102
|
-
const path = this.appProperties.hasDeviceId()
|
|
103
|
-
? `access?client_id=${this.appProperties.getDeviceId()}`
|
|
104
|
-
: `access`;
|
|
102
|
+
const path = this.appProperties.hasDeviceId() ? `access?client_id=${this.appProperties.getDeviceId()}` : `access`;
|
|
105
103
|
return this.request(path, {
|
|
106
|
-
method:
|
|
104
|
+
method: 'POST',
|
|
107
105
|
headers: {
|
|
108
|
-
|
|
106
|
+
Cookie: `zuid=${this.appProperties.getBackendCookie()}`
|
|
109
107
|
}
|
|
110
108
|
}, true, false);
|
|
111
109
|
}
|
|
112
110
|
async request(path, options = {}, includeApiVersion = true, shouldRetry = true) {
|
|
113
|
-
return this.withRetry(shouldRetryOnStatus => this.requestOnce(path, options, includeApiVersion, shouldRetry, shouldRetryOnStatus), path);
|
|
111
|
+
return this.withRetry((shouldRetryOnStatus) => this.requestOnce(path, options, includeApiVersion, shouldRetry, shouldRetryOnStatus), path);
|
|
114
112
|
}
|
|
115
113
|
async requestOnce(path, options, includeApiVersion, shouldRetryUnauthorized, shouldRetryOnStatus) {
|
|
116
114
|
const optionsAndHeaders = {
|
|
@@ -120,11 +118,7 @@ let HttpClient = class HttpClient {
|
|
|
120
118
|
...(options.headers || {})
|
|
121
119
|
}
|
|
122
120
|
};
|
|
123
|
-
const url = [
|
|
124
|
-
this.wireApiHost,
|
|
125
|
-
includeApiVersion ? this.API_HOST_VERSION : null,
|
|
126
|
-
path
|
|
127
|
-
].filter(Boolean).join("/");
|
|
121
|
+
const url = [this.wireApiHost, includeApiVersion ? this.API_HOST_VERSION : null, path].filter(Boolean).join('/');
|
|
128
122
|
let response;
|
|
129
123
|
try {
|
|
130
124
|
response = await fetch(url, optionsAndHeaders);
|
|
@@ -134,7 +128,7 @@ let HttpClient = class HttpClient {
|
|
|
134
128
|
}
|
|
135
129
|
if (!response.ok) {
|
|
136
130
|
if (response.status === 401 && shouldRetryUnauthorized) {
|
|
137
|
-
this.logger.info(
|
|
131
|
+
this.logger.info('Access token not valid, getting a new one.');
|
|
138
132
|
await this.refreshAccessToken();
|
|
139
133
|
return this.requestOnce(path, options, includeApiVersion, false, shouldRetryOnStatus);
|
|
140
134
|
}
|
|
@@ -143,10 +137,10 @@ let HttpClient = class HttpClient {
|
|
|
143
137
|
throw new RetryableHttpStatusError(response.status, path);
|
|
144
138
|
}
|
|
145
139
|
let standardError;
|
|
146
|
-
const contentType = response.headers.get(
|
|
147
|
-
if (contentType?.includes(
|
|
140
|
+
const contentType = response.headers.get('content-type');
|
|
141
|
+
if (contentType?.includes('application/json')) {
|
|
148
142
|
try {
|
|
149
|
-
standardError = await response.json();
|
|
143
|
+
standardError = (await response.json());
|
|
150
144
|
}
|
|
151
145
|
catch (exception) {
|
|
152
146
|
this.logger.error(`Could not parse error response: ${exception}`);
|
|
@@ -156,15 +150,15 @@ let HttpClient = class HttpClient {
|
|
|
156
150
|
this.logger.error(`WireApiException - Label: ${standardError.label}, Message: ${standardError.message}`);
|
|
157
151
|
throw new WireApiException(standardError);
|
|
158
152
|
}
|
|
159
|
-
|
|
160
|
-
|
|
153
|
+
throw new UnknownError(`HTTP ${response.status} for ${path}: ${response.statusText}`);
|
|
154
|
+
//TODO: Maybe more clear error type?
|
|
161
155
|
}
|
|
162
|
-
const contentType = response.headers.get(
|
|
163
|
-
if (contentType?.includes(
|
|
164
|
-
const data = await response.json();
|
|
156
|
+
const contentType = response.headers.get('content-type');
|
|
157
|
+
if (contentType?.includes('application/json')) {
|
|
158
|
+
const data = (await response.json());
|
|
165
159
|
return { data, response };
|
|
166
160
|
}
|
|
167
|
-
if (contentType?.includes(
|
|
161
|
+
if (contentType?.includes('message/mls') || contentType?.includes('octet-stream')) {
|
|
168
162
|
const arrayBuffer = await response.arrayBuffer();
|
|
169
163
|
const data = new Uint8Array(arrayBuffer);
|
|
170
164
|
return { data, response };
|
|
@@ -184,70 +178,66 @@ let HttpClient = class HttpClient {
|
|
|
184
178
|
throw exception;
|
|
185
179
|
}
|
|
186
180
|
const delayMs = calculateHttpRetryDelay(retryPolicy, attemptIndex + 1);
|
|
187
|
-
this.logger.warn(`Retrying HTTP request for ${path} in ${delayMs}ms ` +
|
|
188
|
-
`(attempt ${attemptIndex + 2}/${maxAttempts})`);
|
|
181
|
+
this.logger.warn(`Retrying HTTP request for ${path} in ${delayMs}ms ` + `(attempt ${attemptIndex + 2}/${maxAttempts})`);
|
|
189
182
|
await waitForHttpRetry(delayMs);
|
|
190
183
|
}
|
|
191
184
|
}
|
|
192
|
-
throw new
|
|
185
|
+
throw new UnknownError(`HTTP request failed for ${path}`);
|
|
186
|
+
//TODO: Maybe more clear error type?
|
|
193
187
|
}
|
|
194
188
|
async getRequest(path, options) {
|
|
195
189
|
const { headerContentType = this.HEADER_DEFAULT_CONTENT_TYPE, headerAccept = this.HEADER_DEFAULT_ACCEPT, includeApiVersion = true, additionalHeaders = {} } = options ?? {};
|
|
196
190
|
const requestConfig = {
|
|
197
|
-
method:
|
|
191
|
+
method: 'GET',
|
|
198
192
|
headers: {
|
|
199
|
-
|
|
200
|
-
|
|
193
|
+
'Content-Type': headerContentType,
|
|
194
|
+
Accept: headerAccept,
|
|
201
195
|
...additionalHeaders
|
|
202
196
|
}
|
|
203
197
|
};
|
|
204
198
|
return (await this.request(path, requestConfig, includeApiVersion)).data;
|
|
205
199
|
}
|
|
206
200
|
async postRequest(path, body, options) {
|
|
207
|
-
const { headerContentType = this.HEADER_DEFAULT_CONTENT_TYPE, headerAccept = this.HEADER_DEFAULT_ACCEPT, includeApiVersion = true
|
|
201
|
+
const { headerContentType = this.HEADER_DEFAULT_CONTENT_TYPE, headerAccept = this.HEADER_DEFAULT_ACCEPT, includeApiVersion = true } = options ?? {};
|
|
208
202
|
const isBinary = body instanceof Uint8Array || body instanceof ArrayBuffer;
|
|
209
|
-
const requestBody = body
|
|
210
|
-
? (isBinary ? body : JSON.stringify(body))
|
|
211
|
-
: null;
|
|
203
|
+
const requestBody = body ? (isBinary ? body : JSON.stringify(body)) : null;
|
|
212
204
|
const requestConfig = {
|
|
213
|
-
method:
|
|
205
|
+
method: 'POST',
|
|
214
206
|
body: requestBody,
|
|
215
207
|
headers: {
|
|
216
|
-
|
|
217
|
-
|
|
208
|
+
'Content-Type': headerContentType,
|
|
209
|
+
Accept: headerAccept
|
|
218
210
|
}
|
|
219
211
|
};
|
|
220
212
|
return (await this.request(path, requestConfig, includeApiVersion)).data;
|
|
221
213
|
}
|
|
222
214
|
async putRequest(path, body, options) {
|
|
223
|
-
const { headerContentType = this.HEADER_DEFAULT_CONTENT_TYPE, headerAccept = this.HEADER_DEFAULT_ACCEPT
|
|
215
|
+
const { headerContentType = this.HEADER_DEFAULT_CONTENT_TYPE, headerAccept = this.HEADER_DEFAULT_ACCEPT } = options ?? {};
|
|
224
216
|
return (await this.request(path, {
|
|
225
|
-
method:
|
|
217
|
+
method: 'PUT',
|
|
226
218
|
body: JSON.stringify(body),
|
|
227
219
|
headers: {
|
|
228
|
-
|
|
229
|
-
|
|
220
|
+
'Content-Type': headerContentType,
|
|
221
|
+
Accept: headerAccept
|
|
230
222
|
}
|
|
231
223
|
})).data;
|
|
232
224
|
}
|
|
233
225
|
async deleteRequest(path, body, options) {
|
|
234
|
-
const { headerContentType = this.HEADER_DEFAULT_CONTENT_TYPE, headerAccept = this.HEADER_DEFAULT_ACCEPT
|
|
226
|
+
const { headerContentType = this.HEADER_DEFAULT_CONTENT_TYPE, headerAccept = this.HEADER_DEFAULT_ACCEPT } = options ?? {};
|
|
235
227
|
const isBinary = body instanceof Uint8Array || body instanceof ArrayBuffer;
|
|
236
|
-
const requestBody = body
|
|
237
|
-
? (isBinary ? body : JSON.stringify(body))
|
|
238
|
-
: null;
|
|
228
|
+
const requestBody = body ? (isBinary ? body : JSON.stringify(body)) : null;
|
|
239
229
|
return (await this.request(path, {
|
|
240
|
-
method:
|
|
230
|
+
method: 'DELETE',
|
|
241
231
|
...(requestBody && { body: requestBody }),
|
|
242
232
|
headers: {
|
|
243
|
-
|
|
244
|
-
|
|
233
|
+
'Content-Type': headerContentType,
|
|
234
|
+
Accept: headerAccept
|
|
245
235
|
}
|
|
246
236
|
})).data;
|
|
247
237
|
}
|
|
248
|
-
API_HOST_VERSION =
|
|
249
|
-
HEADER_DEFAULT_CONTENT_TYPE =
|
|
250
|
-
HEADER_DEFAULT_ACCEPT =
|
|
238
|
+
API_HOST_VERSION = 'v15';
|
|
239
|
+
HEADER_DEFAULT_CONTENT_TYPE = 'application/json';
|
|
240
|
+
HEADER_DEFAULT_ACCEPT = 'application/json';
|
|
251
241
|
};
|
|
252
242
|
HttpClient = __decorate([
|
|
253
243
|
singleton(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpClient.js","sourceRoot":"","sources":["../../src/core/HttpClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"HttpClient.js","sourceRoot":"","sources":["../../src/core/HttpClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,uCAAuC,CAAA;AAEnE,OAAO,EAAC,MAAM,EAAE,SAAS,EAAC,MAAM,UAAU,CAAA;AAC1C,OAAO,EAAC,aAAa,EAAC,MAAM,kCAAkC,CAAA;AAC9D,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAC,gBAAgB,EAAC,MAAM,kCAAkC,CAAA;AAEjE,OAAO,EAAC,iBAAiB,EAAC,MAAM,sBAAsB,CAAA;AACtD,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,wBAAwB,EACxB,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAC,mBAAmB,EAAE,YAAY,EAAC,MAAM,+BAA+B,CAAA;AAGxE,IAAM,UAAU,GAAhB,MAAM,UAAU;IASY;IACvB;IATF,MAAM,GAAG,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IACvD,iBAAiB,GAAkB,IAAI,CAAA;IACvC,sBAAsB,GAAyB,IAAI,CAAA;IACnD,OAAO,G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