diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/BackendMetaDataUtil.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/BackendMetaDataUtil.kt index 81ec09de345..a1112018e9c 100644 --- a/network/src/commonMain/kotlin/com/wire/kalium/network/BackendMetaDataUtil.kt +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/BackendMetaDataUtil.kt @@ -24,8 +24,8 @@ import com.wire.kalium.network.api.base.unbound.versioning.VersionInfoDTO import com.wire.kalium.network.tools.ApiVersionDTO import com.wire.kalium.network.tools.ServerConfigDTO -val SupportedApiVersions = setOf(0, 1, 2, 3, 4) -val DevelopmentApiVersions = setOf(5) +val SupportedApiVersions = setOf(0, 1, 2, 3, 4, 5) +val DevelopmentApiVersions = setOf(6) interface BackendMetaDataUtil { fun calculateApiVersion( diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/v5/authenticated/AccessTokenApiV5.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v5/authenticated/AccessTokenApiV5.kt index 697c0180394..6dc480fd107 100644 --- a/network/src/commonMain/kotlin/com/wire/kalium/network/api/v5/authenticated/AccessTokenApiV5.kt +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v5/authenticated/AccessTokenApiV5.kt @@ -21,6 +21,6 @@ package com.wire.kalium.network.api.v5.authenticated import com.wire.kalium.network.api.v4.authenticated.AccessTokenApiV4 import io.ktor.client.HttpClient -internal class AccessTokenApiV5 internal constructor( +internal open class AccessTokenApiV5 internal constructor( private val httpClient: HttpClient ) : AccessTokenApiV4(httpClient) diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/AccessTokenApiV6.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/AccessTokenApiV6.kt new file mode 100644 index 00000000000..a37f21cd1a8 --- /dev/null +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/AccessTokenApiV6.kt @@ -0,0 +1,26 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ + +package com.wire.kalium.network.api.v6.authenticated + +import com.wire.kalium.network.api.v5.authenticated.AccessTokenApiV5 +import io.ktor.client.HttpClient + +internal class AccessTokenApiV6 internal constructor( + private val httpClient: HttpClient +) : AccessTokenApiV5(httpClient) diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/AssetApiV6.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/AssetApiV6.kt new file mode 100644 index 00000000000..7c0f085c0cb --- /dev/null +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/AssetApiV6.kt @@ -0,0 +1,28 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ + +package com.wire.kalium.network.api.v6.authenticated + +import com.wire.kalium.network.AuthenticatedNetworkClient +import com.wire.kalium.network.api.base.model.UserId +import com.wire.kalium.network.api.v5.authenticated.AssetApiV5 + +internal open class AssetApiV6 internal constructor( + authenticatedNetworkClient: AuthenticatedNetworkClient, + selfUserId: UserId +) : AssetApiV5(authenticatedNetworkClient, selfUserId) diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/CallApiV6.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/CallApiV6.kt new file mode 100644 index 00000000000..4382422a273 --- /dev/null +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/CallApiV6.kt @@ -0,0 +1,26 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ + +package com.wire.kalium.network.api.v6.authenticated + +import com.wire.kalium.network.AuthenticatedNetworkClient +import com.wire.kalium.network.api.v5.authenticated.CallApiV5 + +internal open class CallApiV6 internal constructor( + authenticatedNetworkClient: AuthenticatedNetworkClient +) : CallApiV5(authenticatedNetworkClient) diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/ClientApiV6.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/ClientApiV6.kt new file mode 100644 index 00000000000..98f017ccb46 --- /dev/null +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/ClientApiV6.kt @@ -0,0 +1,26 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ + +package com.wire.kalium.network.api.v6.authenticated + +import com.wire.kalium.network.AuthenticatedNetworkClient +import com.wire.kalium.network.api.v5.authenticated.ClientApiV5 + +internal open class ClientApiV6 internal constructor( + authenticatedNetworkClient: AuthenticatedNetworkClient +) : ClientApiV5(authenticatedNetworkClient) diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/ConnectionApiV6.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/ConnectionApiV6.kt new file mode 100644 index 00000000000..17f0e9ddbae --- /dev/null +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/ConnectionApiV6.kt @@ -0,0 +1,26 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ + +package com.wire.kalium.network.api.v6.authenticated + +import com.wire.kalium.network.AuthenticatedNetworkClient +import com.wire.kalium.network.api.v5.authenticated.ConnectionApiV5 + +internal open class ConnectionApiV6 internal constructor( + authenticatedNetworkClient: AuthenticatedNetworkClient +) : ConnectionApiV5(authenticatedNetworkClient) diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/ConversationApiV6.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/ConversationApiV6.kt new file mode 100644 index 00000000000..bcdaa50c0a4 --- /dev/null +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/ConversationApiV6.kt @@ -0,0 +1,26 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ + +package com.wire.kalium.network.api.v6.authenticated + +import com.wire.kalium.network.AuthenticatedNetworkClient +import com.wire.kalium.network.api.v5.authenticated.ConversationApiV5 + +internal open class ConversationApiV6 internal constructor( + authenticatedNetworkClient: AuthenticatedNetworkClient, +) : ConversationApiV5(authenticatedNetworkClient) diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/E2EIApiV6.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/E2EIApiV6.kt new file mode 100644 index 00000000000..62c439c72c8 --- /dev/null +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/E2EIApiV6.kt @@ -0,0 +1,25 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ +package com.wire.kalium.network.api.v6.authenticated + +import com.wire.kalium.network.AuthenticatedNetworkClient +import com.wire.kalium.network.api.v5.authenticated.E2EIApiV5 + +internal open class E2EIApiV6 internal constructor( + private val authenticatedNetworkClient: AuthenticatedNetworkClient +) : E2EIApiV5(authenticatedNetworkClient) diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/FeatureConfigApiV6.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/FeatureConfigApiV6.kt new file mode 100644 index 00000000000..c95984547e4 --- /dev/null +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/FeatureConfigApiV6.kt @@ -0,0 +1,26 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ + +package com.wire.kalium.network.api.v6.authenticated + +import com.wire.kalium.network.AuthenticatedNetworkClient +import com.wire.kalium.network.api.v5.authenticated.FeatureConfigApiV5 + +internal open class FeatureConfigApiV6 internal constructor( + authenticatedNetworkClient: AuthenticatedNetworkClient +) : FeatureConfigApiV5(authenticatedNetworkClient) diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/KeyPackageApiV6.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/KeyPackageApiV6.kt new file mode 100644 index 00000000000..f4c82848c04 --- /dev/null +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/KeyPackageApiV6.kt @@ -0,0 +1,26 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ + +package com.wire.kalium.network.api.v6.authenticated + +import com.wire.kalium.network.AuthenticatedNetworkClient +import com.wire.kalium.network.api.v5.authenticated.KeyPackageApiV5 + +internal open class KeyPackageApiV6 internal constructor( + private val authenticatedNetworkClient: AuthenticatedNetworkClient +) : KeyPackageApiV5(authenticatedNetworkClient) diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/LogoutApiV6.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/LogoutApiV6.kt new file mode 100644 index 00000000000..7db8432488a --- /dev/null +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/LogoutApiV6.kt @@ -0,0 +1,28 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ + +package com.wire.kalium.network.api.v6.authenticated + +import com.wire.kalium.network.AuthenticatedNetworkClient +import com.wire.kalium.network.api.v5.authenticated.LogoutApiV5 +import com.wire.kalium.network.session.SessionManager + +internal open class LogoutApiV6 internal constructor( + authenticatedNetworkClient: AuthenticatedNetworkClient, + sessionManager: SessionManager +) : LogoutApiV5(authenticatedNetworkClient, sessionManager) diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/MLSMessageApiV6.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/MLSMessageApiV6.kt new file mode 100644 index 00000000000..00a28b82330 --- /dev/null +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/MLSMessageApiV6.kt @@ -0,0 +1,26 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ + +package com.wire.kalium.network.api.v6.authenticated + +import com.wire.kalium.network.AuthenticatedNetworkClient +import com.wire.kalium.network.api.v5.authenticated.MLSMessageApiV5 + +internal open class MLSMessageApiV6 internal constructor( + private val authenticatedNetworkClient: AuthenticatedNetworkClient +) : MLSMessageApiV5(authenticatedNetworkClient) diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/MLSPublicKeyApiV6.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/MLSPublicKeyApiV6.kt new file mode 100644 index 00000000000..2657848f35d --- /dev/null +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/MLSPublicKeyApiV6.kt @@ -0,0 +1,26 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ + +package com.wire.kalium.network.api.v6.authenticated + +import com.wire.kalium.network.AuthenticatedNetworkClient +import com.wire.kalium.network.api.v5.authenticated.MLSPublicKeyApiV5 + +internal open class MLSPublicKeyApiV6 internal constructor( + private val authenticatedNetworkClient: AuthenticatedNetworkClient +) : MLSPublicKeyApiV5(authenticatedNetworkClient) diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/MessageApiV6.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/MessageApiV6.kt new file mode 100644 index 00000000000..2c65d79f3eb --- /dev/null +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/MessageApiV6.kt @@ -0,0 +1,28 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ + +package com.wire.kalium.network.api.v6.authenticated + +import com.wire.kalium.network.AuthenticatedNetworkClient +import com.wire.kalium.network.api.base.authenticated.message.EnvelopeProtoMapper +import com.wire.kalium.network.api.v5.authenticated.MessageApiV5 + +internal open class MessageApiV6 internal constructor( + authenticatedNetworkClient: AuthenticatedNetworkClient, + envelopeProtoMapper: EnvelopeProtoMapper +) : MessageApiV5(authenticatedNetworkClient, envelopeProtoMapper) diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/NotificationApiV6.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/NotificationApiV6.kt new file mode 100644 index 00000000000..9f47855e883 --- /dev/null +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/NotificationApiV6.kt @@ -0,0 +1,30 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ + +package com.wire.kalium.network.api.v6.authenticated + +import com.wire.kalium.network.AuthenticatedNetworkClient +import com.wire.kalium.network.AuthenticatedWebSocketClient +import com.wire.kalium.network.api.v5.authenticated.NotificationApiV5 +import com.wire.kalium.network.tools.ServerConfigDTO + +internal open class NotificationApiV6 internal constructor( + private val authenticatedNetworkClient: AuthenticatedNetworkClient, + authenticatedWebSocketClient: AuthenticatedWebSocketClient, + serverLinks: ServerConfigDTO.Links +) : NotificationApiV5(authenticatedNetworkClient, authenticatedWebSocketClient, serverLinks) diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/PreKeyApiV6.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/PreKeyApiV6.kt new file mode 100644 index 00000000000..873fc044845 --- /dev/null +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/PreKeyApiV6.kt @@ -0,0 +1,26 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ + +package com.wire.kalium.network.api.v6.authenticated + +import com.wire.kalium.network.AuthenticatedNetworkClient +import com.wire.kalium.network.api.v5.authenticated.PreKeyApiV5 + +internal open class PreKeyApiV6 internal constructor( + authenticatedNetworkClient: AuthenticatedNetworkClient +) : PreKeyApiV5(authenticatedNetworkClient) diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/PropertiesApiV6.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/PropertiesApiV6.kt new file mode 100644 index 00000000000..1e8db89f6df --- /dev/null +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/PropertiesApiV6.kt @@ -0,0 +1,26 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ + +package com.wire.kalium.network.api.v6.authenticated + +import com.wire.kalium.network.AuthenticatedNetworkClient +import com.wire.kalium.network.api.v5.authenticated.PropertiesApiV5 + +internal open class PropertiesApiV6 internal constructor( + authenticatedNetworkClient: AuthenticatedNetworkClient +) : PropertiesApiV5(authenticatedNetworkClient) diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/SelfApiV6.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/SelfApiV6.kt new file mode 100644 index 00000000000..07b664ae7f3 --- /dev/null +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/SelfApiV6.kt @@ -0,0 +1,28 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ + +package com.wire.kalium.network.api.v6.authenticated + +import com.wire.kalium.network.AuthenticatedNetworkClient +import com.wire.kalium.network.api.v5.authenticated.SelfApiV5 +import com.wire.kalium.network.session.SessionManager + +internal open class SelfApiV6 internal constructor( + authenticatedNetworkClient: AuthenticatedNetworkClient, + sessionManager: SessionManager +) : SelfApiV5(authenticatedNetworkClient, sessionManager) diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/TeamsApiV6.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/TeamsApiV6.kt new file mode 100644 index 00000000000..061cc91c1b8 --- /dev/null +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/TeamsApiV6.kt @@ -0,0 +1,26 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ + +package com.wire.kalium.network.api.v6.authenticated + +import com.wire.kalium.network.AuthenticatedNetworkClient +import com.wire.kalium.network.api.v5.authenticated.TeamsApiV5 + +internal open class TeamsApiV6 internal constructor( + authenticatedNetworkClient: AuthenticatedNetworkClient +) : TeamsApiV5(authenticatedNetworkClient) diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/UserDetailsApiV6.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/UserDetailsApiV6.kt new file mode 100644 index 00000000000..75466827de6 --- /dev/null +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/UserDetailsApiV6.kt @@ -0,0 +1,26 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ + +package com.wire.kalium.network.api.v6.authenticated + +import com.wire.kalium.network.AuthenticatedNetworkClient +import com.wire.kalium.network.api.v5.authenticated.UserDetailsApiV5 + +internal open class UserDetailsApiV6 internal constructor( + authenticatedNetworkClient: AuthenticatedNetworkClient +) : UserDetailsApiV5(authenticatedNetworkClient) diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/UserSearchApiV6.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/UserSearchApiV6.kt new file mode 100644 index 00000000000..db1cc9b68fd --- /dev/null +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/UserSearchApiV6.kt @@ -0,0 +1,26 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ + +package com.wire.kalium.network.api.v6.authenticated + +import com.wire.kalium.network.AuthenticatedNetworkClient +import com.wire.kalium.network.api.v5.authenticated.UserSearchApiV5 + +internal open class UserSearchApiV6 internal constructor( + authenticatedNetworkClient: AuthenticatedNetworkClient +) : UserSearchApiV5(authenticatedNetworkClient) diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/networkContainer/AuthenticatedNetworkContainerV6.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/networkContainer/AuthenticatedNetworkContainerV6.kt new file mode 100644 index 00000000000..9c5e38ff0a0 --- /dev/null +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/authenticated/networkContainer/AuthenticatedNetworkContainerV6.kt @@ -0,0 +1,134 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ + +package com.wire.kalium.network.api.v6.authenticated.networkContainer + +import com.wire.kalium.logger.KaliumLogger +import com.wire.kalium.network.NetworkStateObserver +import com.wire.kalium.network.api.base.authenticated.AccessTokenApi +import com.wire.kalium.network.api.base.authenticated.CallApi +import com.wire.kalium.network.api.base.authenticated.TeamsApi +import com.wire.kalium.network.api.base.authenticated.asset.AssetApi +import com.wire.kalium.network.api.base.authenticated.client.ClientApi +import com.wire.kalium.network.api.base.authenticated.connection.ConnectionApi +import com.wire.kalium.network.api.base.authenticated.conversation.ConversationApi +import com.wire.kalium.network.api.base.authenticated.e2ei.E2EIApi +import com.wire.kalium.network.api.base.authenticated.featureConfigs.FeatureConfigApi +import com.wire.kalium.network.api.base.authenticated.keypackage.KeyPackageApi +import com.wire.kalium.network.api.base.authenticated.logout.LogoutApi +import com.wire.kalium.network.api.base.authenticated.message.EnvelopeProtoMapperImpl +import com.wire.kalium.network.api.base.authenticated.message.MLSMessageApi +import com.wire.kalium.network.api.base.authenticated.message.MessageApi +import com.wire.kalium.network.api.base.authenticated.notification.NotificationApi +import com.wire.kalium.network.api.base.authenticated.prekey.PreKeyApi +import com.wire.kalium.network.api.base.authenticated.properties.PropertiesApi +import com.wire.kalium.network.api.base.authenticated.search.UserSearchApi +import com.wire.kalium.network.api.base.authenticated.self.SelfApi +import com.wire.kalium.network.api.base.authenticated.serverpublickey.MLSPublicKeyApi +import com.wire.kalium.network.api.base.authenticated.userDetails.UserDetailsApi +import com.wire.kalium.network.api.base.model.UserId +import com.wire.kalium.network.api.v6.authenticated.AccessTokenApiV6 +import com.wire.kalium.network.api.v6.authenticated.AssetApiV6 +import com.wire.kalium.network.api.v6.authenticated.CallApiV6 +import com.wire.kalium.network.api.v6.authenticated.ClientApiV6 +import com.wire.kalium.network.api.v6.authenticated.ConnectionApiV6 +import com.wire.kalium.network.api.v6.authenticated.ConversationApiV6 +import com.wire.kalium.network.api.v6.authenticated.E2EIApiV6 +import com.wire.kalium.network.api.v6.authenticated.FeatureConfigApiV6 +import com.wire.kalium.network.api.v6.authenticated.KeyPackageApiV6 +import com.wire.kalium.network.api.v6.authenticated.LogoutApiV6 +import com.wire.kalium.network.api.v6.authenticated.MLSMessageApiV6 +import com.wire.kalium.network.api.v6.authenticated.MLSPublicKeyApiV6 +import com.wire.kalium.network.api.v6.authenticated.MessageApiV6 +import com.wire.kalium.network.api.v6.authenticated.NotificationApiV6 +import com.wire.kalium.network.api.v6.authenticated.PreKeyApiV6 +import com.wire.kalium.network.api.v6.authenticated.PropertiesApiV6 +import com.wire.kalium.network.api.v6.authenticated.SelfApiV6 +import com.wire.kalium.network.api.v6.authenticated.TeamsApiV6 +import com.wire.kalium.network.api.v6.authenticated.UserDetailsApiV6 +import com.wire.kalium.network.api.v6.authenticated.UserSearchApiV6 +import com.wire.kalium.network.defaultHttpEngine +import com.wire.kalium.network.networkContainer.AuthenticatedHttpClientProvider +import com.wire.kalium.network.networkContainer.AuthenticatedHttpClientProviderImpl +import com.wire.kalium.network.networkContainer.AuthenticatedNetworkContainer +import com.wire.kalium.network.session.CertificatePinning +import com.wire.kalium.network.session.SessionManager +import io.ktor.client.engine.HttpClientEngine + +@Suppress("LongParameterList") +internal class AuthenticatedNetworkContainerV6 internal constructor( + private val networkStateObserver: NetworkStateObserver, + private val sessionManager: SessionManager, + private val selfUserId: UserId, + certificatePinning: CertificatePinning, + mockEngine: HttpClientEngine?, + kaliumLogger: KaliumLogger, + engine: HttpClientEngine = mockEngine ?: defaultHttpEngine( + serverConfigDTOApiProxy = sessionManager.serverConfig().links.apiProxy, + proxyCredentials = sessionManager.proxyCredentials(), + certificatePinning = certificatePinning + ) +) : AuthenticatedNetworkContainer, + AuthenticatedHttpClientProvider by AuthenticatedHttpClientProviderImpl( + sessionManager = sessionManager, + networkStateObserver = networkStateObserver, + accessTokenApi = { httpClient -> AccessTokenApiV6(httpClient) }, + engine = engine, + kaliumLogger = kaliumLogger + ) { + + override val accessTokenApi: AccessTokenApi get() = AccessTokenApiV6(networkClient.httpClient) + + override val logoutApi: LogoutApi get() = LogoutApiV6(networkClient, sessionManager) + + override val clientApi: ClientApi get() = ClientApiV6(networkClient) + + override val messageApi: MessageApi get() = MessageApiV6(networkClient, EnvelopeProtoMapperImpl()) + + override val mlsMessageApi: MLSMessageApi get() = MLSMessageApiV6(networkClient) + + override val e2eiApi: E2EIApi get() = E2EIApiV6(networkClient) + + override val conversationApi: ConversationApi get() = ConversationApiV6(networkClient) + + override val keyPackageApi: KeyPackageApi get() = KeyPackageApiV6(networkClient) + + override val preKeyApi: PreKeyApi get() = PreKeyApiV6(networkClient) + + override val assetApi: AssetApi get() = AssetApiV6(networkClientWithoutCompression, selfUserId) + + override val notificationApi: NotificationApi get() = NotificationApiV6(networkClient, websocketClient, backendConfig) + + override val teamsApi: TeamsApi get() = TeamsApiV6(networkClient) + + override val selfApi: SelfApi get() = SelfApiV6(networkClient, sessionManager) + + override val userDetailsApi: UserDetailsApi get() = UserDetailsApiV6(networkClient) + + override val userSearchApi: UserSearchApi get() = UserSearchApiV6(networkClient) + + override val callApi: CallApi get() = CallApiV6(networkClient) + + override val connectionApi: ConnectionApi get() = ConnectionApiV6(networkClient) + + override val featureConfigApi: FeatureConfigApi get() = FeatureConfigApiV6(networkClient) + + override val mlsPublicKeyApi: MLSPublicKeyApi get() = MLSPublicKeyApiV6(networkClient) + + override val propertiesApi: PropertiesApi get() = PropertiesApiV6(networkClient) +} diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/unauthenticated/DomainLookupApiV6.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/unauthenticated/DomainLookupApiV6.kt new file mode 100644 index 00000000000..d32a048b2e1 --- /dev/null +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/unauthenticated/DomainLookupApiV6.kt @@ -0,0 +1,25 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ +package com.wire.kalium.network.api.v6.unauthenticated + +import com.wire.kalium.network.UnauthenticatedNetworkClient +import com.wire.kalium.network.api.v5.unauthenticated.DomainLookupApiV5 + +internal open class DomainLookupApiV6 internal constructor( + unauthenticatedNetworkClient: UnauthenticatedNetworkClient +) : DomainLookupApiV5(unauthenticatedNetworkClient) diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/unauthenticated/LoginApiV6.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/unauthenticated/LoginApiV6.kt new file mode 100644 index 00000000000..d1d56e59ce7 --- /dev/null +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/unauthenticated/LoginApiV6.kt @@ -0,0 +1,26 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ + +package com.wire.kalium.network.api.v6.unauthenticated + +import com.wire.kalium.network.UnauthenticatedNetworkClient +import com.wire.kalium.network.api.v5.unauthenticated.LoginApiV5 + +internal open class LoginApiV6 internal constructor( + unauthenticatedNetworkClient: UnauthenticatedNetworkClient +) : LoginApiV5(unauthenticatedNetworkClient) diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/unauthenticated/RegisterApiV6.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/unauthenticated/RegisterApiV6.kt new file mode 100644 index 00000000000..72283285f0e --- /dev/null +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/unauthenticated/RegisterApiV6.kt @@ -0,0 +1,26 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ + +package com.wire.kalium.network.api.v6.unauthenticated + +import com.wire.kalium.network.UnauthenticatedNetworkClient +import com.wire.kalium.network.api.v5.unauthenticated.RegisterApiV5 + +internal open class RegisterApiV6 internal constructor( + unauthenticatedNetworkClient: UnauthenticatedNetworkClient +) : RegisterApiV5(unauthenticatedNetworkClient) diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/unauthenticated/SSOLoginApiV6.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/unauthenticated/SSOLoginApiV6.kt new file mode 100644 index 00000000000..a56815cb116 --- /dev/null +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/unauthenticated/SSOLoginApiV6.kt @@ -0,0 +1,26 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ + +package com.wire.kalium.network.api.v6.unauthenticated + +import com.wire.kalium.network.UnauthenticatedNetworkClient +import com.wire.kalium.network.api.v5.unauthenticated.SSOLoginApiV5 + +internal open class SSOLoginApiV6 internal constructor( + unauthenticatedNetworkClient: UnauthenticatedNetworkClient +) : SSOLoginApiV5(unauthenticatedNetworkClient) diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/unauthenticated/VerificationCodeApiV6.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/unauthenticated/VerificationCodeApiV6.kt new file mode 100644 index 00000000000..43f34208815 --- /dev/null +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/unauthenticated/VerificationCodeApiV6.kt @@ -0,0 +1,25 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ +package com.wire.kalium.network.api.v6.unauthenticated + +import com.wire.kalium.network.UnauthenticatedNetworkClient +import com.wire.kalium.network.api.v5.unauthenticated.VerificationCodeApiV5 + +internal open class VerificationCodeApiV6 internal constructor( + unauthenticatedNetworkClient: UnauthenticatedNetworkClient +) : VerificationCodeApiV5(unauthenticatedNetworkClient) diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/unauthenticated/networkContainer/UnauthenticatedNetworkContainerV6.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/unauthenticated/networkContainer/UnauthenticatedNetworkContainerV6.kt new file mode 100644 index 00000000000..d7d29b84ccd --- /dev/null +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v6/unauthenticated/networkContainer/UnauthenticatedNetworkContainerV6.kt @@ -0,0 +1,66 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ + +package com.wire.kalium.network.api.v6.unauthenticated.networkContainer + +import com.wire.kalium.network.NetworkStateObserver +import com.wire.kalium.network.api.base.model.ProxyCredentialsDTO +import com.wire.kalium.network.api.base.unauthenticated.DomainLookupApi +import com.wire.kalium.network.api.base.unauthenticated.LoginApi +import com.wire.kalium.network.api.base.unauthenticated.SSOLoginApi +import com.wire.kalium.network.api.base.unauthenticated.VerificationCodeApi +import com.wire.kalium.network.api.base.unauthenticated.appVersioning.AppVersioningApi +import com.wire.kalium.network.api.base.unauthenticated.appVersioning.AppVersioningApiImpl +import com.wire.kalium.network.api.base.unauthenticated.register.RegisterApi +import com.wire.kalium.network.api.v6.unauthenticated.DomainLookupApiV6 +import com.wire.kalium.network.api.v6.unauthenticated.LoginApiV6 +import com.wire.kalium.network.api.v6.unauthenticated.RegisterApiV6 +import com.wire.kalium.network.api.v6.unauthenticated.SSOLoginApiV6 +import com.wire.kalium.network.api.v6.unauthenticated.VerificationCodeApiV6 +import com.wire.kalium.network.defaultHttpEngine +import com.wire.kalium.network.networkContainer.UnauthenticatedNetworkClientProvider +import com.wire.kalium.network.networkContainer.UnauthenticatedNetworkClientProviderImpl +import com.wire.kalium.network.networkContainer.UnauthenticatedNetworkContainer +import com.wire.kalium.network.session.CertificatePinning +import com.wire.kalium.network.tools.ServerConfigDTO +import io.ktor.client.engine.HttpClientEngine + +class UnauthenticatedNetworkContainerV6 internal constructor( + networkStateObserver: NetworkStateObserver, + backendLinks: ServerConfigDTO, + proxyCredentials: ProxyCredentialsDTO?, + certificatePinning: CertificatePinning, + mockEngine: HttpClientEngine?, + engine: HttpClientEngine = mockEngine ?: defaultHttpEngine( + serverConfigDTOApiProxy = backendLinks.links.apiProxy, + proxyCredentials = proxyCredentials, + certificatePinning = certificatePinning + ) +) : UnauthenticatedNetworkContainer, + UnauthenticatedNetworkClientProvider by UnauthenticatedNetworkClientProviderImpl( + networkStateObserver, + backendLinks, + engine + ) { + override val loginApi: LoginApi get() = LoginApiV6(unauthenticatedNetworkClient) + override val verificationCodeApi: VerificationCodeApi get() = VerificationCodeApiV6(unauthenticatedNetworkClient) + override val domainLookupApi: DomainLookupApi get() = DomainLookupApiV6(unauthenticatedNetworkClient) + override val registerApi: RegisterApi get() = RegisterApiV6(unauthenticatedNetworkClient) + override val sso: SSOLoginApi get() = SSOLoginApiV6(unauthenticatedNetworkClient) + override val appVersioningApi: AppVersioningApi get() = AppVersioningApiImpl(unauthenticatedNetworkClient) +} diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/networkContainer/AuthenticatedNetworkContainer.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/networkContainer/AuthenticatedNetworkContainer.kt index eee73638555..1e180dde758 100644 --- a/network/src/commonMain/kotlin/com/wire/kalium/network/networkContainer/AuthenticatedNetworkContainer.kt +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/networkContainer/AuthenticatedNetworkContainer.kt @@ -48,6 +48,7 @@ import com.wire.kalium.network.api.v2.authenticated.networkContainer.Authenticat import com.wire.kalium.network.api.v3.authenticated.networkContainer.AuthenticatedNetworkContainerV3 import com.wire.kalium.network.api.v4.authenticated.networkContainer.AuthenticatedNetworkContainerV4 import com.wire.kalium.network.api.v5.authenticated.networkContainer.AuthenticatedNetworkContainerV5 +import com.wire.kalium.network.api.v6.authenticated.networkContainer.AuthenticatedNetworkContainerV6 import com.wire.kalium.network.session.CertificatePinning import com.wire.kalium.network.session.SessionManager import com.wire.kalium.network.tools.ServerConfigDTO @@ -108,7 +109,7 @@ interface AuthenticatedNetworkContainer { companion object { - @Suppress("LongParameterList") + @Suppress("LongParameterList", "LongMethod") fun create( networkStateObserver: NetworkStateObserver, sessionManager: SessionManager, @@ -174,6 +175,15 @@ interface AuthenticatedNetworkContainer { kaliumLogger, ) + 6 -> AuthenticatedNetworkContainerV6( + networkStateObserver, + sessionManager, + selfUserId, + certificatePinning, + mockEngine, + kaliumLogger, + ) + else -> error("Unsupported version: $version") } } diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/networkContainer/UnauthenticatedNetworkContainer.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/networkContainer/UnauthenticatedNetworkContainer.kt index 6f844cc60f3..3dbad174cf8 100644 --- a/network/src/commonMain/kotlin/com/wire/kalium/network/networkContainer/UnauthenticatedNetworkContainer.kt +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/networkContainer/UnauthenticatedNetworkContainer.kt @@ -32,6 +32,7 @@ import com.wire.kalium.network.api.v2.unauthenticated.networkContainer.Unauthent import com.wire.kalium.network.api.v3.unauthenticated.networkContainer.UnauthenticatedNetworkContainerV3 import com.wire.kalium.network.api.v4.unauthenticated.networkContainer.UnauthenticatedNetworkContainerV4 import com.wire.kalium.network.api.v5.unauthenticated.networkContainer.UnauthenticatedNetworkContainerV5 +import com.wire.kalium.network.api.v6.unauthenticated.networkContainer.UnauthenticatedNetworkContainerV6 import com.wire.kalium.network.session.CertificatePinning import com.wire.kalium.network.tools.ServerConfigDTO import io.ktor.client.engine.HttpClientEngine @@ -106,6 +107,14 @@ interface UnauthenticatedNetworkContainer { mockEngine ) + 6 -> UnauthenticatedNetworkContainerV6( + networkStateObserver, + serverConfigDTO, + proxyCredentials = proxyCredentials, + certificatePinning = certificatePinning, + mockEngine + ) + else -> error("Unsupported version: ${serverConfigDTO.metaData.commonApiVersion.version}") } }