From 2fca4e782ba2cad45e27c4e182050ef2025706c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Dimja=C5=A1evi=C4=87?= Date: Mon, 14 Feb 2022 14:04:43 +0100 Subject: [PATCH 01/14] Drop the `managed` column from `team_conv` table --- cassandra-schema.cql | 1 - services/galley/galley.cabal | 1 + services/galley/schema/src/Main.hs | 4 ++- .../src/V71_DropManagedConversations.hs | 30 +++++++++++++++++++ services/galley/src/Galley/Cassandra.hs | 2 +- 5 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 services/galley/schema/src/V71_DropManagedConversations.hs diff --git a/cassandra-schema.cql b/cassandra-schema.cql index c4666a1071b..a7889fcffc3 100644 --- a/cassandra-schema.cql +++ b/cassandra-schema.cql @@ -38,7 +38,6 @@ CREATE TABLE galley_test.meta ( CREATE TABLE galley_test.team_conv ( team uuid, conv uuid, - managed boolean, PRIMARY KEY (team, conv) ) WITH CLUSTERING ORDER BY (conv ASC) AND bloom_filter_fp_chance = 0.1 diff --git a/services/galley/galley.cabal b/services/galley/galley.cabal index f10581474ee..7c2aace79d6 100644 --- a/services/galley/galley.cabal +++ b/services/galley/galley.cabal @@ -660,6 +660,7 @@ executable galley-schema V68_MLSCommitLock V69_MLSProposal V70_MLSCipherSuite + V71_DropManagedConversations hs-source-dirs: schema/src default-extensions: diff --git a/services/galley/schema/src/Main.hs b/services/galley/schema/src/Main.hs index 1d26cc7a89f..65f9e60650a 100644 --- a/services/galley/schema/src/Main.hs +++ b/services/galley/schema/src/Main.hs @@ -73,6 +73,7 @@ import qualified V67_MLSFeature import qualified V68_MLSCommitLock import qualified V69_MLSProposal import qualified V70_MLSCipherSuite +import qualified V71_DropManagedConversations main :: IO () main = do @@ -131,7 +132,8 @@ main = do V67_MLSFeature.migration, V68_MLSCommitLock.migration, V69_MLSProposal.migration, - V70_MLSCipherSuite.migration + V70_MLSCipherSuite.migration, + V71_DropManagedConversations.migration -- When adding migrations here, don't forget to update -- 'schemaVersion' in Galley.Cassandra -- (see also docs/developer/cassandra-interaction.md) diff --git a/services/galley/schema/src/V71_DropManagedConversations.hs b/services/galley/schema/src/V71_DropManagedConversations.hs new file mode 100644 index 00000000000..231df246735 --- /dev/null +++ b/services/galley/schema/src/V71_DropManagedConversations.hs @@ -0,0 +1,30 @@ +-- This file is part of the Wire Server implementation. +-- +-- Copyright (C) 2022 Wire Swiss GmbH +-- +-- This program is free software: you can redistribute it and/or modify it under +-- the terms of the GNU Affero 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 Affero General Public License for more +-- details. +-- +-- You should have received a copy of the GNU Affero General Public License along +-- with this program. If not, see . + +module V71_DropManagedConversations where + +import Cassandra.Schema +import Imports +import Text.RawString.QQ + +migration :: Migration +migration = Migration 71 "Drop the managed column from team_conv" $ do + schema' + [r| ALTER TABLE team_conv DROP ( + managed + ); + |] diff --git a/services/galley/src/Galley/Cassandra.hs b/services/galley/src/Galley/Cassandra.hs index 4d70622b88b..e256f18aba0 100644 --- a/services/galley/src/Galley/Cassandra.hs +++ b/services/galley/src/Galley/Cassandra.hs @@ -20,4 +20,4 @@ module Galley.Cassandra (schemaVersion) where import Imports schemaVersion :: Int32 -schemaVersion = 70 +schemaVersion = 71 From d11ae08f084e9dd0ff1729cedd603d672ff1500e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Dimja=C5=A1evi=C4=87?= Date: Mon, 14 Feb 2022 15:12:27 +0100 Subject: [PATCH 02/14] Remove "managed" from JSON instances - This is a breaking API change. In FromJSON instances, this key was already ignored during parsing, but now it is removed from ToJSON instances as well. The change is reflected only in version 2 of the client API, and version 1 stays intact. --- docs/src/developer/reference/conversation.md | 1 - libs/wire-api/src/Wire/API/Conversation.hs | 225 ++++++--- .../src/Wire/API/Routes/Public/Galley.hs | 80 ++- .../src/Wire/API/Team/Conversation.hs | 160 ++++-- .../golden/Test/Wire/API/Golden/Generated.hs | 45 +- .../API/Golden/Generated/ConvTeamInfo_user.hs | 4 +- .../Wire/API/Golden/Generated/NewConv_user.hs | 6 +- .../Generated/TeamConversationList_team.hs | 456 +----------------- .../Golden/Generated/TeamConversation_team.hs | 87 +--- .../testObject_NewConvManaged_user_2.json | 24 - .../testObject_NewConvUnmanaged_user_2.json | 18 - .../testObject_ConvTeamInfo_user_2.json | 3 + ..._1.json => testObject_NewConv_user_2.json} | 17 +- ...estObject_TeamConversationList_team_1.json | 72 --- ...stObject_TeamConversationList_team_10.json | 28 -- ...stObject_TeamConversationList_team_11.json | 20 - ...stObject_TeamConversationList_team_12.json | 92 ---- ...stObject_TeamConversationList_team_13.json | 88 ---- ...stObject_TeamConversationList_team_14.json | 84 ---- ...stObject_TeamConversationList_team_15.json | 28 -- ...stObject_TeamConversationList_team_16.json | 112 ----- ...stObject_TeamConversationList_team_17.json | 112 ----- ...stObject_TeamConversationList_team_18.json | 72 --- ...stObject_TeamConversationList_team_19.json | 100 ---- ...estObject_TeamConversationList_team_2.json | 112 ----- ...stObject_TeamConversationList_team_20.json | 12 - ...estObject_TeamConversationList_team_3.json | 44 -- ...estObject_TeamConversationList_team_4.json | 120 ----- ...estObject_TeamConversationList_team_5.json | 16 - ...estObject_TeamConversationList_team_6.json | 40 -- ...estObject_TeamConversationList_team_7.json | 40 -- ...estObject_TeamConversationList_team_8.json | 124 ----- ...estObject_TeamConversationList_team_9.json | 120 ----- ...ect_TeamConversationList_team_from_v2.json | 10 + ...ct_TeamConversationList_team_until_v2.json | 12 + .../testObject_TeamConversation_team_10.json | 4 - .../testObject_TeamConversation_team_11.json | 4 - .../testObject_TeamConversation_team_12.json | 4 - .../testObject_TeamConversation_team_13.json | 4 - .../testObject_TeamConversation_team_14.json | 4 - .../testObject_TeamConversation_team_15.json | 4 - .../testObject_TeamConversation_team_16.json | 4 - .../testObject_TeamConversation_team_17.json | 4 - .../testObject_TeamConversation_team_18.json | 4 - .../testObject_TeamConversation_team_19.json | 4 - .../testObject_TeamConversation_team_2.json | 4 - .../testObject_TeamConversation_team_20.json | 4 - .../testObject_TeamConversation_team_3.json | 4 - .../testObject_TeamConversation_team_4.json | 4 - .../testObject_TeamConversation_team_5.json | 4 - .../testObject_TeamConversation_team_6.json | 4 - .../testObject_TeamConversation_team_7.json | 4 - .../testObject_TeamConversation_team_8.json | 4 - .../testObject_TeamConversation_team_9.json | 4 - ...tObject_TeamConversation_team_from_v2.json | 3 + ...bject_TeamConversation_team_until_v2.json} | 0 .../unit/Test/Wire/API/Roundtrip/Aeson.hs | 10 +- services/galley/src/Galley/API/Create.hs | 18 +- services/galley/src/Galley/API/Internal.hs | 3 +- .../galley/src/Galley/API/Public/Servant.hs | 4 + services/galley/src/Galley/API/Teams.hs | 11 +- .../galley/src/Galley/Cassandra/Instances.hs | 7 +- services/galley/src/Galley/Cassandra/Team.hs | 12 +- .../galley/src/Galley/Effects/TeamStore.hs | 4 +- services/galley/test/integration/API.hs | 33 +- .../galley/test/integration/API/MLS/Util.hs | 2 +- services/galley/test/integration/API/Util.hs | 87 +++- 67 files changed, 569 insertions(+), 2285 deletions(-) delete mode 100644 libs/wire-api/test/golden/fromJSON/testObject_NewConvManaged_user_2.json delete mode 100644 libs/wire-api/test/golden/fromJSON/testObject_NewConvUnmanaged_user_2.json create mode 100644 libs/wire-api/test/golden/testObject_ConvTeamInfo_user_2.json rename libs/wire-api/test/golden/{fromJSON/testObject_NewConvUnmanaged_user_1.json => testObject_NewConv_user_2.json} (81%) delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversationList_team_1.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversationList_team_10.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversationList_team_11.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversationList_team_12.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversationList_team_13.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversationList_team_14.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversationList_team_15.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversationList_team_16.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversationList_team_17.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversationList_team_18.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversationList_team_19.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversationList_team_2.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversationList_team_20.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversationList_team_3.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversationList_team_4.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversationList_team_5.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversationList_team_6.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversationList_team_7.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversationList_team_8.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversationList_team_9.json create mode 100644 libs/wire-api/test/golden/testObject_TeamConversationList_team_from_v2.json create mode 100644 libs/wire-api/test/golden/testObject_TeamConversationList_team_until_v2.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversation_team_10.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversation_team_11.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversation_team_12.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversation_team_13.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversation_team_14.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversation_team_15.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversation_team_16.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversation_team_17.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversation_team_18.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversation_team_19.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversation_team_2.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversation_team_20.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversation_team_3.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversation_team_4.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversation_team_5.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversation_team_6.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversation_team_7.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversation_team_8.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversation_team_9.json create mode 100644 libs/wire-api/test/golden/testObject_TeamConversation_team_from_v2.json rename libs/wire-api/test/golden/{testObject_TeamConversation_team_1.json => testObject_TeamConversation_team_until_v2.json} (100%) diff --git a/docs/src/developer/reference/conversation.md b/docs/src/developer/reference/conversation.md index eedbfa7ce0b..44db3a28603 100644 --- a/docs/src/developer/reference/conversation.md +++ b/docs/src/developer/reference/conversation.md @@ -82,7 +82,6 @@ export WIRE_CONV='{ "users": [], "name": "'${WIRE_CONV_NAME}'", "team": { - "managed": false, "teamid": "'${WIRE_TEAMID}'" }, "receipt_mode": 0, diff --git a/libs/wire-api/src/Wire/API/Conversation.hs b/libs/wire-api/src/Wire/API/Conversation.hs index f9ad1b122ea..1858028ba8e 100644 --- a/libs/wire-api/src/Wire/API/Conversation.hs +++ b/libs/wire-api/src/Wire/API/Conversation.hs @@ -117,6 +117,7 @@ import Wire.API.Conversation.Protocol import Wire.API.Conversation.Role (RoleName, roleNameWireAdmin) import Wire.API.MLS.Group import Wire.API.Routes.MultiTablePaging +import Wire.API.Routes.Version import Wire.Arbitrary -------------------------------------------------------------------------------- @@ -633,7 +634,10 @@ modelNewConversation = Doc.defineModel "NewConversation" $ do Doc.description "Conversation receipt mode" Doc.optional -data NewConv = NewConv +-- FUTUREWORK: The version tag type argument can be dropped as soon as versions +-- below V2 are not supported any more, at least as far as the 'newConvTeam' is +-- considered. +data NewConv (v :: *) = NewConv { newConvUsers :: [UserId], -- | A list of qualified users, which can include some local qualified users -- too. @@ -641,7 +645,7 @@ data NewConv = NewConv newConvName :: Maybe (Range 1 256 Text), newConvAccess :: Set Access, newConvAccessRoles :: Maybe (Set AccessRoleV2), - newConvTeam :: Maybe ConvTeamInfo, + newConvTeam :: Maybe (ConvTeamInfo v), newConvMessageTimer :: Maybe Milliseconds, newConvReceiptMode :: Maybe ReceiptMode, -- | Every member except for the creator will have this role @@ -653,78 +657,147 @@ data NewConv = NewConv newConvCreatorClient :: Maybe ClientId } deriving stock (Eq, Show, Generic) - deriving (Arbitrary) via (GenericUniform NewConv) - deriving (FromJSON, ToJSON, S.ToSchema) via (Schema NewConv) - -instance ToSchema NewConv where - schema = - objectWithDocModifier - "NewConv" - (description ?~ "JSON object to create a new conversation. When using 'qualified_users' (preferred), you can omit 'users'") - $ NewConv - <$> newConvUsers - .= ( fieldWithDocModifier - "users" - (description ?~ usersDesc) - (array schema) - <|> pure [] - ) - <*> newConvQualifiedUsers - .= ( fieldWithDocModifier - "qualified_users" - (description ?~ qualifiedUsersDesc) - (array schema) - <|> pure [] - ) - <*> newConvName .= maybe_ (optField "name" schema) - <*> (Set.toList . newConvAccess) - .= (fromMaybe mempty <$> optField "access" (Set.fromList <$> array schema)) - <*> newConvAccessRoles .= accessRolesSchemaOpt - <*> newConvTeam - .= maybe_ - ( optFieldWithDocModifier - "team" - (description ?~ "Team information of this conversation") - schema - ) - <*> newConvMessageTimer - .= maybe_ - ( optFieldWithDocModifier - "message_timer" - (description ?~ "Per-conversation message timer") - schema - ) - <*> newConvReceiptMode .= maybe_ (optField "receipt_mode" schema) - <*> newConvUsersRole - .= ( fieldWithDocModifier "conversation_role" (description ?~ usersRoleDesc) schema - <|> pure roleNameWireAdmin - ) - <*> newConvProtocol .= protocolTagSchema - <*> newConvCreatorClient .= maybe_ (optField "creator_client" schema) - where - usersDesc = - "List of user IDs (excluding the requestor) to be \ - \part of this conversation (deprecated)" - qualifiedUsersDesc = - "List of qualified user IDs (excluding the requestor) \ - \to be part of this conversation" - usersRoleDesc :: Text - usersRoleDesc = - cs $ - "The conversation permissions the users \ - \added in this request should have. \ - \Optional, defaults to '" - <> show roleNameWireAdmin - <> "' if unset." - -newtype ConvTeamInfo = ConvTeamInfo + deriving (Arbitrary) via (GenericUniform (NewConv v)) + +instance ToSchema (NewConv (Until 'V2)) where + schema = newConvSchema @(Until 'V2) + +instance ToSchema (NewConv (From 'V2)) where + schema = newConvSchema @(From 'V2) + +deriving via + Schema (NewConv (Until 'V2)) + instance + FromJSON (NewConv (Until 'V2)) + +deriving via + Schema (NewConv (Until 'V2)) + instance + ToJSON (NewConv (Until 'V2)) + +deriving via + Schema (NewConv (From 'V2)) + instance + FromJSON (NewConv (From 'V2)) + +deriving via + Schema (NewConv (From 'V2)) + instance + ToJSON (NewConv (From 'V2)) + +deriving via + Schema (NewConv (Until 'V2)) + instance + S.ToSchema (NewConv (Until 'V2)) + +deriving via + Schema (NewConv (From 'V2)) + instance + S.ToSchema (NewConv (From 'V2)) + +newConvSchema :: + forall v. + ToSchema (ConvTeamInfo v) => + ValueSchema NamedSwaggerDoc (NewConv v) +newConvSchema = + objectWithDocModifier + "NewConv" + (description ?~ "JSON object to create a new conversation. When using 'qualified_users' (preferred), you can omit 'users'") + $ NewConv + <$> newConvUsers + .= ( fieldWithDocModifier + "users" + (description ?~ usersDesc) + (array schema) + <|> pure [] + ) + <*> newConvQualifiedUsers + .= ( fieldWithDocModifier + "qualified_users" + (description ?~ qualifiedUsersDesc) + (array schema) + <|> pure [] + ) + <*> newConvName .= maybe_ (optField "name" schema) + <*> (Set.toList . newConvAccess) + .= (fromMaybe mempty <$> optField "access" (Set.fromList <$> array schema)) + <*> newConvAccessRoles .= accessRolesSchemaOpt + <*> newConvTeam + .= maybe_ + ( optFieldWithDocModifier + "team" + (description ?~ "Team information of this conversation") + (schema @(ConvTeamInfo v)) + ) + <*> newConvMessageTimer + .= maybe_ + ( optFieldWithDocModifier + "message_timer" + (description ?~ "Per-conversation message timer") + schema + ) + <*> newConvReceiptMode .= maybe_ (optField "receipt_mode" schema) + <*> newConvUsersRole + .= ( fieldWithDocModifier "conversation_role" (description ?~ usersRoleDesc) schema + <|> pure roleNameWireAdmin + ) + <*> newConvProtocol .= protocolTagSchema + <*> newConvCreatorClient .= maybe_ (optField "creator_client" schema) + where + usersDesc = + "List of user IDs (excluding the requestor) to be \ + \part of this conversation (deprecated)" + qualifiedUsersDesc = + "List of qualified user IDs (excluding the requestor) \ + \to be part of this conversation" + usersRoleDesc :: Text + usersRoleDesc = + cs $ + "The conversation permissions the users \ + \added in this request should have. \ + \Optional, defaults to '" + <> show roleNameWireAdmin + <> "' if unset." + +-- FUTUREWORK: The version tag type argument can be dropped as soon as versions +-- below V2 are not supported any more. +newtype ConvTeamInfo (v :: *) = ConvTeamInfo { cnvTeamId :: TeamId } deriving stock (Eq, Show, Generic) - deriving (Arbitrary) via (GenericUniform ConvTeamInfo) - deriving (FromJSON, ToJSON, S.ToSchema) via Schema ConvTeamInfo - -instance ToSchema ConvTeamInfo where + deriving (Arbitrary) via (GenericUniform (ConvTeamInfo v)) + +deriving via + Schema (ConvTeamInfo (Until 'V2)) + instance + FromJSON (ConvTeamInfo (Until 'V2)) + +deriving via + Schema (ConvTeamInfo (Until 'V2)) + instance + ToJSON (ConvTeamInfo (Until 'V2)) + +deriving via + Schema (ConvTeamInfo (From 'V2)) + instance + FromJSON (ConvTeamInfo (From 'V2)) + +deriving via + Schema (ConvTeamInfo (From 'V2)) + instance + ToJSON (ConvTeamInfo (From 'V2)) + +deriving via + Schema (ConvTeamInfo (Until 'V2)) + instance + S.ToSchema (ConvTeamInfo (Until 'V2)) + +deriving via + Schema (ConvTeamInfo (From 'V2)) + instance + S.ToSchema (ConvTeamInfo (From 'V2)) + +instance ToSchema (ConvTeamInfo (Until 'V2)) where schema = objectWithDocModifier "ConvTeamInfo" @@ -740,13 +813,19 @@ instance ToSchema ConvTeamInfo where c :: ToJSON a => a -> ValueSchema SwaggerDoc () c val = mkSchema mempty (const (pure ())) (const (pure (toJSON val))) +instance ToSchema (ConvTeamInfo (From 'V2)) where + schema = + objectWithDocModifier + "ConvTeamInfo" + (description ?~ "Team information") + $ ConvTeamInfo + <$> cnvTeamId .= field "teamid" schema + modelTeamInfo :: Doc.Model modelTeamInfo = Doc.defineModel "TeamInfo" $ do Doc.description "Team information" Doc.property "teamid" Doc.bytes' $ Doc.description "Team ID" - Doc.property "managed" Doc.bool' $ - Doc.description "Is this a managed team conversation?" -------------------------------------------------------------------------------- -- invite diff --git a/libs/wire-api/src/Wire/API/Routes/Public/Galley.hs b/libs/wire-api/src/Wire/API/Routes/Public/Galley.hs index 719fc9b33fc..a38a92739bc 100644 --- a/libs/wire-api/src/Wire/API/Routes/Public/Galley.hs +++ b/libs/wire-api/src/Wire/API/Routes/Public/Galley.hs @@ -106,7 +106,7 @@ instance fromUnion (Z (I c)) = CodeAlreadyExisted c fromUnion (S (Z (I e))) = CodeAdded e - fromUnion (S (S x)) = case x of {} + fromUnion (S (S x)) = case x of type ConvUpdateResponses = UpdateResponses "Conversation unchanged" "Conversation updated" Event @@ -309,9 +309,27 @@ type ConversationAPI = :> QueryParam' [Required, Strict] "code" Code.Value :> Get '[Servant.JSON] ConversationCoverView ) + :<|> Named + "create-group-conversation-v1" + ( Summary "Create a new conversation" + :> Until 'V2 + :> CanThrow 'ConvAccessDenied + :> CanThrow 'MLSNonEmptyMemberList + :> CanThrow 'NotConnected + :> CanThrow 'NotATeamMember + :> CanThrow OperationDenied + :> CanThrow 'MissingLegalholdConsent + :> Description "This returns 201 when a new conversation is created, and 200 when the conversation already existed" + :> ZLocalUser + :> ZConn + :> "conversations" + :> ReqBody '[Servant.JSON] (NewConv (Until 'V2)) + :> ConversationVerb + ) :<|> Named "create-group-conversation" ( Summary "Create a new conversation" + :> From 'V2 :> CanThrow 'ConvAccessDenied :> CanThrow 'MLSNonEmptyMemberList :> CanThrow 'NotConnected @@ -322,7 +340,7 @@ type ConversationAPI = :> ZLocalUser :> ZConn :> "conversations" - :> ReqBody '[Servant.JSON] NewConv + :> ReqBody '[Servant.JSON] (NewConv (From 'V2)) :> ConversationVerb ) :<|> Named @@ -336,9 +354,33 @@ type ConversationAPI = -- This endpoint can lead to the following events being sent: -- - ConvCreate event to members -- TODO: add note: "On 201, the conversation ID is the `Location` header" + :<|> Named + "create-one-to-one-conversation-v1" + ( Summary "Create a 1:1 conversation" + :> Until 'V2 + :> CanThrow 'ConvAccessDenied + :> CanThrow 'InvalidOperation + :> CanThrow 'NoBindingTeamMembers + :> CanThrow 'NonBindingTeam + :> CanThrow 'NotATeamMember + :> CanThrow 'NotConnected + :> CanThrow OperationDenied + :> CanThrow 'TeamNotFound + :> CanThrow 'MissingLegalholdConsent + :> ZLocalUser + :> ZConn + :> "conversations" + :> "one2one" + :> ReqBody '[Servant.JSON] (NewConv (Until 'V2)) + :> ConversationVerb + ) + -- This endpoint can lead to the following events being sent: + -- - ConvCreate event to members + -- TODO: add note: "On 201, the conversation ID is the `Location` header" :<|> Named "create-one-to-one-conversation" ( Summary "Create a 1:1 conversation" + :> From 'V2 :> CanThrow 'ConvAccessDenied :> CanThrow 'InvalidOperation :> CanThrow 'NoBindingTeamMembers @@ -352,7 +394,7 @@ type ConversationAPI = :> ZConn :> "conversations" :> "one2one" - :> ReqBody '[Servant.JSON] NewConv + :> ReqBody '[Servant.JSON] (NewConv (From 'V2)) :> ConversationVerb ) -- This endpoint can lead to the following events being sent: @@ -873,20 +915,48 @@ type TeamConversationAPI = :> "roles" :> Get '[Servant.JSON] ConversationRolesList ) + :<|> Named + "get-team-conversations-v1" + ( Summary "Get team conversations" + :> Until 'V2 + :> CanThrow OperationDenied + :> CanThrow 'NotATeamMember + :> ZUser + :> "teams" + :> Capture "tid" TeamId + :> "conversations" + :> Get '[Servant.JSON] (TeamConversationList (Until 'V2)) + ) :<|> Named "get-team-conversations" ( Summary "Get team conversations" + :> From 'V2 :> CanThrow OperationDenied :> CanThrow 'NotATeamMember :> ZUser :> "teams" :> Capture "tid" TeamId :> "conversations" - :> Get '[Servant.JSON] TeamConversationList + :> Get '[Servant.JSON] (TeamConversationList (From 'V2)) + ) + :<|> Named + "get-team-conversation-v1" + ( Summary "Get one team conversation" + :> Until 'V2 + :> CanThrow 'ConvNotFound + :> CanThrow OperationDenied + :> CanThrow 'NotATeamMember + :> ZUser + :> "teams" + :> Capture "tid" TeamId + :> "conversations" + :> Capture "cid" ConvId + :> Get '[Servant.JSON] (TeamConversation (Until 'V2)) ) :<|> Named "get-team-conversation" ( Summary "Get one team conversation" + :> From 'V2 :> CanThrow 'ConvNotFound :> CanThrow OperationDenied :> CanThrow 'NotATeamMember @@ -895,7 +965,7 @@ type TeamConversationAPI = :> Capture "tid" TeamId :> "conversations" :> Capture "cid" ConvId - :> Get '[Servant.JSON] TeamConversation + :> Get '[Servant.JSON] (TeamConversation (From 'V2)) ) :<|> Named "delete-team-conversation" diff --git a/libs/wire-api/src/Wire/API/Team/Conversation.hs b/libs/wire-api/src/Wire/API/Team/Conversation.hs index 3fd614cd6b8..ffe0508f82f 100644 --- a/libs/wire-api/src/Wire/API/Team/Conversation.hs +++ b/libs/wire-api/src/Wire/API/Team/Conversation.hs @@ -36,36 +36,82 @@ module Wire.API.Team.Conversation ) where -import Control.Lens (At (at), makeLenses, over, (?~)) -import Data.Aeson hiding (fieldLabelModifier) +import Control.Lens (makeLenses, (?~)) +import qualified Data.Aeson as A import Data.Id (ConvId) -import Data.Proxy -import Data.Swagger +import Data.Schema +import qualified Data.Swagger as S import qualified Data.Swagger.Build.Api as Doc import Imports +import Wire.API.Routes.Version import Wire.Arbitrary (Arbitrary, GenericUniform (..)) -------------------------------------------------------------------------------- -- TeamConversation -newtype TeamConversation = TeamConversation +-- FUTUREWORK: The version tag type argument can be dropped as soon as versions +-- below V2 are not supported any more. +newtype TeamConversation (v :: *) = TeamConversation { _conversationId :: ConvId } deriving stock (Eq, Show, Generic) - deriving (Arbitrary) via (GenericUniform TeamConversation) - -instance ToSchema TeamConversation where - declareNamedSchema _ = do - idSchema <- declareSchemaRef (Proxy @ConvId) - pure $ - NamedSchema (Just "TeamConversation") $ - mempty - & description ?~ "team conversation data" - & over - properties - (at "conversation" ?~ idSchema) - -newTeamConversation :: ConvId -> TeamConversation + deriving (Arbitrary) via (GenericUniform (TeamConversation v)) + +instance ToSchema (TeamConversation (Until 'V2)) where + schema = + objectWithDocModifier + "TeamConversation" + (description ?~ "Team conversation data") + $ TeamConversation + <$> _conversationId .= field "conversation" schema + <* const () + .= fieldWithDocModifier + "managed" + (description ?~ "(Not parsed any more) Whether this is a managed team conversation") + (c (False :: Bool)) + where + c :: A.ToJSON a => a -> ValueSchema SwaggerDoc () + c val = mkSchema mempty (const (pure ())) (const (pure (A.toJSON val))) + +instance ToSchema (TeamConversation (From 'V2)) where + schema = + objectWithDocModifier + "TeamConversation" + (description ?~ "Team conversation data") + $ TeamConversation + <$> _conversationId .= field "conversation" schema + +deriving via + Schema (TeamConversation (Until 'V2)) + instance + A.FromJSON (TeamConversation (Until 'V2)) + +deriving via + Schema (TeamConversation (Until 'V2)) + instance + A.ToJSON (TeamConversation (Until 'V2)) + +deriving via + Schema (TeamConversation (From 'V2)) + instance + A.FromJSON (TeamConversation (From 'V2)) + +deriving via + Schema (TeamConversation (From 'V2)) + instance + A.ToJSON (TeamConversation (From 'V2)) + +deriving via + Schema (TeamConversation (Until 'V2)) + instance + S.ToSchema (TeamConversation (Until 'V2)) + +deriving via + Schema (TeamConversation (From 'V2)) + instance + S.ToSchema (TeamConversation (From 'V2)) + +newTeamConversation :: ConvId -> TeamConversation v newTeamConversation = TeamConversation modelTeamConversation :: Doc.Model @@ -73,39 +119,60 @@ modelTeamConversation = Doc.defineModel "TeamConversation" $ do Doc.description "team conversation data" Doc.property "conversation" Doc.bytes' $ Doc.description "conversation ID" - -instance ToJSON TeamConversation where - toJSON t = - object - [ "conversation" .= _conversationId t, - -- FUTUREWORK: get rid of the "managed" field in the next version of the API - "managed" .= False - ] - -instance FromJSON TeamConversation where - parseJSON = withObject "team conversation" $ \o -> - TeamConversation <$> o .: "conversation" + Doc.property "managed" Doc.bytes' $ + Doc.description "Whether the conversation is managed (deprecated)" -------------------------------------------------------------------------------- -- TeamConversationList -newtype TeamConversationList = TeamConversationList - { _teamConversations :: [TeamConversation] +-- FUTUREWORK: The version tag type argument can be dropped as soon as versions +-- below V2 are not supported any more. +newtype TeamConversationList (v :: *) = TeamConversationList + { _teamConversations :: [TeamConversation v] } deriving (Generic) deriving stock (Eq, Show) deriving newtype (Arbitrary) -instance ToSchema TeamConversationList where - declareNamedSchema _ = do - convs <- declareSchema (Proxy @[TeamConversation]) - pure $ - NamedSchema (Just "TeamConversationList") $ - mempty - & description ?~ "team conversation list" - & properties . at "conversations" ?~ Inline convs - -newTeamConversationList :: [TeamConversation] -> TeamConversationList +instance ToSchema (TeamConversation v) => ToSchema (TeamConversationList v) where + schema = + objectWithDocModifier + "TeamConversationList" + (description ?~ "Team conversation list") + $ TeamConversationList + <$> _teamConversations .= field "conversations" (array schema) + +deriving via + Schema (TeamConversationList (Until 'V2)) + instance + A.FromJSON (TeamConversationList (Until 'V2)) + +deriving via + Schema (TeamConversationList (Until 'V2)) + instance + A.ToJSON (TeamConversationList (Until 'V2)) + +deriving via + Schema (TeamConversationList (From 'V2)) + instance + A.FromJSON (TeamConversationList (From 'V2)) + +deriving via + Schema (TeamConversationList (From 'V2)) + instance + A.ToJSON (TeamConversationList (From 'V2)) + +deriving via + Schema (TeamConversationList (Until 'V2)) + instance + S.ToSchema (TeamConversationList (Until 'V2)) + +deriving via + Schema (TeamConversationList (From 'V2)) + instance + S.ToSchema (TeamConversationList (From 'V2)) + +newTeamConversationList :: [TeamConversation v] -> TeamConversationList v newTeamConversationList = TeamConversationList modelTeamConversationList :: Doc.Model @@ -114,12 +181,5 @@ modelTeamConversationList = Doc.defineModel "TeamConversationListList" $ do Doc.property "conversations" (Doc.unique $ Doc.array (Doc.ref modelTeamConversation)) $ Doc.description "the array of team conversations" -instance ToJSON TeamConversationList where - toJSON t = object ["conversations" .= _teamConversations t] - -instance FromJSON TeamConversationList where - parseJSON = withObject "team conversation list" $ \o -> do - TeamConversationList <$> o .: "conversations" - makeLenses ''TeamConversation makeLenses ''TeamConversationList diff --git a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated.hs index 049b631f568..741b9cd78b7 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated.hs @@ -235,6 +235,7 @@ import qualified Test.Wire.API.Golden.Generated.WithStatusPatch_team import qualified Test.Wire.API.Golden.Generated.WithStatus_team import qualified Test.Wire.API.Golden.Generated.Wrapped_20_22some_5fint_22_20Int_user import Test.Wire.API.Golden.Runner +import Wire.API.Routes.Version tests :: TestTree tests = @@ -387,11 +388,15 @@ tests = [ (Test.Wire.API.Golden.Generated.Conversation_user.testObject_Conversation_user_1, "testObject_Conversation_user_1.json"), (Test.Wire.API.Golden.Generated.Conversation_user.testObject_Conversation_user_2, "testObject_Conversation_user_2.json") ], - testGroup "Golden: NewConv_user" $ + testGroup "Golden: NewConv_user (Until 'V2)" $ testObjects - [ (Test.Wire.API.Golden.Generated.NewConv_user.testObject_NewConv_user_1, "testObject_NewConv_user_1.json"), + [ (Test.Wire.API.Golden.Generated.NewConv_user.testObject_NewConv_user_1_2 @(Until 'V2), "testObject_NewConv_user_1.json"), (Test.Wire.API.Golden.Generated.NewConv_user.testObject_NewConv_user_3, "testObject_NewConv_user_3.json") ], + testGroup "Golden: NewConv_user (From 'V2)" $ + testObjects + [ (Test.Wire.API.Golden.Generated.NewConv_user.testObject_NewConv_user_1_2 @(From 'V2), "testObject_NewConv_user_2.json") + ], testGroup "Golden: ConversationList_20_28Id_20_2a_20C_29_user" $ testObjects [ ( Test.Wire.API.Golden.Generated.ConversationList_20_28Id_20_2a_20C_29_user.testObject_ConversationList_20_28Id_20_2a_20C_29_user_1, @@ -436,9 +441,13 @@ tests = [ (Test.Wire.API.Golden.Generated.ReceiptMode_user.testObject_ReceiptMode_user_1, "testObject_ReceiptMode_user_1.json"), (Test.Wire.API.Golden.Generated.ReceiptMode_user.testObject_ReceiptMode_user_2, "testObject_ReceiptMode_user_2.json") ], - testGroup "Golden: ConvTeamInfo_user" $ + testGroup "Golden: ConvTeamInfo_user (Until 'V2)" $ + testObjects + [ (Test.Wire.API.Golden.Generated.ConvTeamInfo_user.testObject_ConvTeamInfo_user_1_2 @(Until 'V2), "testObject_ConvTeamInfo_user_1.json") + ], + testGroup "Golden: ConvTeamInfo_user (From 'V2)" $ testObjects - [ (Test.Wire.API.Golden.Generated.ConvTeamInfo_user.testObject_ConvTeamInfo_user_1, "testObject_ConvTeamInfo_user_1.json") + [ (Test.Wire.API.Golden.Generated.ConvTeamInfo_user.testObject_ConvTeamInfo_user_1_2 @(From 'V2), "testObject_ConvTeamInfo_user_2.json") ], testGroup "Golden: Invite_user" $ testObjects @@ -1144,10 +1153,30 @@ tests = testObjects [(Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_1, "testObject_TeamUpdateData_team_1.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_2, "testObject_TeamUpdateData_team_2.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_3, "testObject_TeamUpdateData_team_3.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_4, "testObject_TeamUpdateData_team_4.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_5, "testObject_TeamUpdateData_team_5.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_6, "testObject_TeamUpdateData_team_6.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_7, "testObject_TeamUpdateData_team_7.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_8, "testObject_TeamUpdateData_team_8.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_9, "testObject_TeamUpdateData_team_9.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_10, "testObject_TeamUpdateData_team_10.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_11, "testObject_TeamUpdateData_team_11.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_12, "testObject_TeamUpdateData_team_12.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_13, "testObject_TeamUpdateData_team_13.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_14, "testObject_TeamUpdateData_team_14.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_15, "testObject_TeamUpdateData_team_15.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_16, "testObject_TeamUpdateData_team_16.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_17, "testObject_TeamUpdateData_team_17.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_18, "testObject_TeamUpdateData_team_18.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_19, "testObject_TeamUpdateData_team_19.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_20, "testObject_TeamUpdateData_team_20.json")], testGroup "Golden: TeamDeleteData_team" $ testObjects [(Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_1, "testObject_TeamDeleteData_team_1.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_2, "testObject_TeamDeleteData_team_2.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_3, "testObject_TeamDeleteData_team_3.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_4, "testObject_TeamDeleteData_team_4.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_5, "testObject_TeamDeleteData_team_5.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_6, "testObject_TeamDeleteData_team_6.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_7, "testObject_TeamDeleteData_team_7.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_8, "testObject_TeamDeleteData_team_8.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_9, "testObject_TeamDeleteData_team_9.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_10, "testObject_TeamDeleteData_team_10.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_11, "testObject_TeamDeleteData_team_11.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_12, "testObject_TeamDeleteData_team_12.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_13, "testObject_TeamDeleteData_team_13.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_14, "testObject_TeamDeleteData_team_14.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_15, "testObject_TeamDeleteData_team_15.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_16, "testObject_TeamDeleteData_team_16.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_17, "testObject_TeamDeleteData_team_17.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_18, "testObject_TeamDeleteData_team_18.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_19, "testObject_TeamDeleteData_team_19.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_20, "testObject_TeamDeleteData_team_20.json")], - testGroup "Golden: TeamConversation_team" $ - testObjects [(Test.Wire.API.Golden.Generated.TeamConversation_team.testObject_TeamConversation_team_1, "testObject_TeamConversation_team_1.json"), (Test.Wire.API.Golden.Generated.TeamConversation_team.testObject_TeamConversation_team_2, "testObject_TeamConversation_team_2.json"), (Test.Wire.API.Golden.Generated.TeamConversation_team.testObject_TeamConversation_team_3, "testObject_TeamConversation_team_3.json"), (Test.Wire.API.Golden.Generated.TeamConversation_team.testObject_TeamConversation_team_4, "testObject_TeamConversation_team_4.json"), (Test.Wire.API.Golden.Generated.TeamConversation_team.testObject_TeamConversation_team_5, "testObject_TeamConversation_team_5.json"), (Test.Wire.API.Golden.Generated.TeamConversation_team.testObject_TeamConversation_team_6, "testObject_TeamConversation_team_6.json"), (Test.Wire.API.Golden.Generated.TeamConversation_team.testObject_TeamConversation_team_7, "testObject_TeamConversation_team_7.json"), (Test.Wire.API.Golden.Generated.TeamConversation_team.testObject_TeamConversation_team_8, "testObject_TeamConversation_team_8.json"), (Test.Wire.API.Golden.Generated.TeamConversation_team.testObject_TeamConversation_team_9, "testObject_TeamConversation_team_9.json"), (Test.Wire.API.Golden.Generated.TeamConversation_team.testObject_TeamConversation_team_10, "testObject_TeamConversation_team_10.json"), (Test.Wire.API.Golden.Generated.TeamConversation_team.testObject_TeamConversation_team_11, "testObject_TeamConversation_team_11.json"), (Test.Wire.API.Golden.Generated.TeamConversation_team.testObject_TeamConversation_team_12, "testObject_TeamConversation_team_12.json"), (Test.Wire.API.Golden.Generated.TeamConversation_team.testObject_TeamConversation_team_13, "testObject_TeamConversation_team_13.json"), (Test.Wire.API.Golden.Generated.TeamConversation_team.testObject_TeamConversation_team_14, "testObject_TeamConversation_team_14.json"), (Test.Wire.API.Golden.Generated.TeamConversation_team.testObject_TeamConversation_team_15, "testObject_TeamConversation_team_15.json"), (Test.Wire.API.Golden.Generated.TeamConversation_team.testObject_TeamConversation_team_16, "testObject_TeamConversation_team_16.json"), (Test.Wire.API.Golden.Generated.TeamConversation_team.testObject_TeamConversation_team_17, "testObject_TeamConversation_team_17.json"), (Test.Wire.API.Golden.Generated.TeamConversation_team.testObject_TeamConversation_team_18, "testObject_TeamConversation_team_18.json"), (Test.Wire.API.Golden.Generated.TeamConversation_team.testObject_TeamConversation_team_19, "testObject_TeamConversation_team_19.json"), (Test.Wire.API.Golden.Generated.TeamConversation_team.testObject_TeamConversation_team_20, "testObject_TeamConversation_team_20.json")], - testGroup "Golden: TeamConversationList_team" $ - testObjects [(Test.Wire.API.Golden.Generated.TeamConversationList_team.testObject_TeamConversationList_team_1, "testObject_TeamConversationList_team_1.json"), (Test.Wire.API.Golden.Generated.TeamConversationList_team.testObject_TeamConversationList_team_2, "testObject_TeamConversationList_team_2.json"), (Test.Wire.API.Golden.Generated.TeamConversationList_team.testObject_TeamConversationList_team_3, "testObject_TeamConversationList_team_3.json"), (Test.Wire.API.Golden.Generated.TeamConversationList_team.testObject_TeamConversationList_team_4, "testObject_TeamConversationList_team_4.json"), (Test.Wire.API.Golden.Generated.TeamConversationList_team.testObject_TeamConversationList_team_5, "testObject_TeamConversationList_team_5.json"), (Test.Wire.API.Golden.Generated.TeamConversationList_team.testObject_TeamConversationList_team_6, "testObject_TeamConversationList_team_6.json"), (Test.Wire.API.Golden.Generated.TeamConversationList_team.testObject_TeamConversationList_team_7, "testObject_TeamConversationList_team_7.json"), (Test.Wire.API.Golden.Generated.TeamConversationList_team.testObject_TeamConversationList_team_8, "testObject_TeamConversationList_team_8.json"), (Test.Wire.API.Golden.Generated.TeamConversationList_team.testObject_TeamConversationList_team_9, "testObject_TeamConversationList_team_9.json"), (Test.Wire.API.Golden.Generated.TeamConversationList_team.testObject_TeamConversationList_team_10, "testObject_TeamConversationList_team_10.json"), (Test.Wire.API.Golden.Generated.TeamConversationList_team.testObject_TeamConversationList_team_11, "testObject_TeamConversationList_team_11.json"), (Test.Wire.API.Golden.Generated.TeamConversationList_team.testObject_TeamConversationList_team_12, "testObject_TeamConversationList_team_12.json"), (Test.Wire.API.Golden.Generated.TeamConversationList_team.testObject_TeamConversationList_team_13, "testObject_TeamConversationList_team_13.json"), (Test.Wire.API.Golden.Generated.TeamConversationList_team.testObject_TeamConversationList_team_14, "testObject_TeamConversationList_team_14.json"), (Test.Wire.API.Golden.Generated.TeamConversationList_team.testObject_TeamConversationList_team_15, "testObject_TeamConversationList_team_15.json"), (Test.Wire.API.Golden.Generated.TeamConversationList_team.testObject_TeamConversationList_team_16, "testObject_TeamConversationList_team_16.json"), (Test.Wire.API.Golden.Generated.TeamConversationList_team.testObject_TeamConversationList_team_17, "testObject_TeamConversationList_team_17.json"), (Test.Wire.API.Golden.Generated.TeamConversationList_team.testObject_TeamConversationList_team_18, "testObject_TeamConversationList_team_18.json"), (Test.Wire.API.Golden.Generated.TeamConversationList_team.testObject_TeamConversationList_team_19, "testObject_TeamConversationList_team_19.json"), (Test.Wire.API.Golden.Generated.TeamConversationList_team.testObject_TeamConversationList_team_20, "testObject_TeamConversationList_team_20.json")], + testGroup "Golden: TeamConversation_team_until_v2" $ + testObjects + [ ( Test.Wire.API.Golden.Generated.TeamConversation_team.testObject_TeamConversation_team_until_v2, + "testObject_TeamConversation_team_until_v2.json" + ) + ], + testGroup "Golden: TeamConversation_team_from_v2" $ + testObjects + [ ( Test.Wire.API.Golden.Generated.TeamConversation_team.testObject_TeamConversation_team_from_v2, + "testObject_TeamConversation_team_from_v2.json" + ) + ], + testGroup "Golden: TeamConversationList_team_until_v2" $ + testObjects + [ ( Test.Wire.API.Golden.Generated.TeamConversationList_team.testObject_TeamConversationList_team_until_v2, + "testObject_TeamConversationList_team_until_v2.json" + ) + ], + testGroup "Golden: TeamConversationList_team_from_v2" $ + testObjects + [ ( Test.Wire.API.Golden.Generated.TeamConversationList_team.testObject_TeamConversationList_team_from_v2, + "testObject_TeamConversationList_team_from_v2.json" + ) + ], testGroup "Golden: WithStatusNoLock_team 1" $ testObjects [ (Test.Wire.API.Golden.Generated.WithStatusNoLock_team.testObject_WithStatusNoLock_team_1, "testObject_WithStatusNoLock_team_1.json"), diff --git a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/ConvTeamInfo_user.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/ConvTeamInfo_user.hs index bbd2b16e299..7b7a3cfb52d 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/ConvTeamInfo_user.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/ConvTeamInfo_user.hs @@ -22,8 +22,8 @@ import qualified Data.UUID as UUID (fromString) import Imports (fromJust) import Wire.API.Conversation (ConvTeamInfo (..)) -testObject_ConvTeamInfo_user_1 :: ConvTeamInfo -testObject_ConvTeamInfo_user_1 = +testObject_ConvTeamInfo_user_1_2 :: ConvTeamInfo v +testObject_ConvTeamInfo_user_1_2 = ConvTeamInfo { cnvTeamId = Id (fromJust (UUID.fromString "0000003f-0000-0059-0000-002200000028")) } diff --git a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/NewConv_user.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/NewConv_user.hs index 571060d758e..ca52763bcb8 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/NewConv_user.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/NewConv_user.hs @@ -32,8 +32,8 @@ import Wire.API.Conversation.Role testDomain :: Domain testDomain = Domain "testdomain.example.com" -testObject_NewConv_user_1 :: NewConv -testObject_NewConv_user_1 = +testObject_NewConv_user_1_2 :: NewConv v +testObject_NewConv_user_1_2 = NewConv { newConvUsers = [ Id (fromJust (UUID.fromString "00000001-0000-0000-0000-000000000001")), @@ -56,7 +56,7 @@ testObject_NewConv_user_1 = newConvCreatorClient = Nothing } -testObject_NewConv_user_3 :: NewConv +testObject_NewConv_user_3 :: NewConv v testObject_NewConv_user_3 = NewConv { newConvUsers = [], diff --git a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/TeamConversationList_team.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/TeamConversationList_team.hs index 3bdf75b2bea..fdb1570a49a 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/TeamConversationList_team.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/TeamConversationList_team.hs @@ -22,463 +22,21 @@ module Test.Wire.API.Golden.Generated.TeamConversationList_team where import Data.Id (Id (Id)) import qualified Data.UUID as UUID (fromString) import Imports +import Wire.API.Routes.Version import Wire.API.Team.Conversation (TeamConversationList, newTeamConversation, newTeamConversationList) -testObject_TeamConversationList_team_1 :: TeamConversationList -testObject_TeamConversationList_team_1 = +testObject_TeamConversationList_team_until_v2 :: TeamConversationList (Until 'V2) +testObject_TeamConversationList_team_until_v2 = ( newTeamConversationList [ (newTeamConversation ((Id (fromJust (UUID.fromString "00000012-0000-0018-0000-00260000002b"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000002d-0000-0063-0000-006900000013"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000002e-0000-003c-0000-00440000000e"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000067-0000-003a-0000-006100000049"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000005f-0000-0003-0000-005a00000075"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000007f-0000-0018-0000-00250000007c"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000006a-0000-0020-0000-001a00000073"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000002e-0000-006a-0000-005f00000003"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000034-0000-0021-0000-00330000005b"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000048-0000-0011-0000-002a00000004"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000031-0000-0018-0000-00060000001a"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000056-0000-000e-0000-004300000028"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000067-0000-007f-0000-003600000031"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000066-0000-0053-0000-006a00000034"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000000f-0000-0071-0000-001b00000057"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000032-0000-0035-0000-00210000003b"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000004-0000-000d-0000-002100000067"))))) + (newTeamConversation ((Id (fromJust (UUID.fromString "0000002d-0000-0063-0000-006900000013"))))) ] ) -testObject_TeamConversationList_team_2 :: TeamConversationList -testObject_TeamConversationList_team_2 = +testObject_TeamConversationList_team_from_v2 :: TeamConversationList (From 'V2) +testObject_TeamConversationList_team_from_v2 = ( newTeamConversationList [ (newTeamConversation ((Id (fromJust (UUID.fromString "00000064-0000-0045-0000-007d00000023"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000000d-0000-0080-0000-00550000001b"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000004e-0000-0053-0000-004600000056"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000006e-0000-003c-0000-003200000071"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000067-0000-002f-0000-007a0000007f"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000000a-0000-0027-0000-004e0000005f"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000006-0000-0026-0000-000000000054"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000006e-0000-007e-0000-001600000035"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000002c-0000-0057-0000-007e00000070"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000074-0000-0053-0000-005f00000006"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000028-0000-005c-0000-00050000006b"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000018-0000-0061-0000-004a00000024"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000005a-0000-007b-0000-000800000033"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000027-0000-0043-0000-006800000068"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000056-0000-0018-0000-003f00000001"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000014-0000-0066-0000-00440000001b"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000007f-0000-0071-0000-007f0000001b"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000018-0000-004d-0000-005000000080"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000018-0000-003e-0000-00140000006e"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000033-0000-005c-0000-001e0000000d"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000004d-0000-0021-0000-00360000000e"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000057-0000-003f-0000-003700000065"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000006f-0000-003e-0000-000300000051"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000038-0000-0025-0000-00030000003b"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000003c-0000-0069-0000-005000000035"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000005f-0000-006b-0000-00260000004e"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000001c-0000-001c-0000-00530000000c"))))) - ] - ) - -testObject_TeamConversationList_team_3 :: TeamConversationList -testObject_TeamConversationList_team_3 = - ( newTeamConversationList - [ (newTeamConversation ((Id (fromJust (UUID.fromString "00000046-0000-0026-0000-005600000014"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000006b-0000-0042-0000-002c00000074"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000006d-0000-006d-0000-006100000027"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000079-0000-0024-0000-004600000011"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000044-0000-0005-0000-003800000008"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000052-0000-005e-0000-00200000001a"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000009-0000-0038-0000-001b00000065"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000029-0000-0045-0000-004500000078"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000001e-0000-0036-0000-006400000045"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000050-0000-0066-0000-000500000075"))))) - ] - ) - -testObject_TeamConversationList_team_4 :: TeamConversationList -testObject_TeamConversationList_team_4 = - ( newTeamConversationList - [ (newTeamConversation ((Id (fromJust (UUID.fromString "00000076-0000-0038-0000-003c00000043"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000046-0000-001f-0000-005800000080"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000023-0000-0070-0000-006f00000077"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000006-0000-0031-0000-004700000053"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000057-0000-0041-0000-001600000013"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000007b-0000-003c-0000-004800000063"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000028-0000-0009-0000-004c00000009"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000001a-0000-007b-0000-00460000007f"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000052-0000-002e-0000-001000000064"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000003d-0000-002a-0000-00290000007b"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000004-0000-0033-0000-00780000005e"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000006b-0000-007f-0000-001d0000002c"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000017-0000-0079-0000-001c00000066"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000002f-0000-0024-0000-001000000074"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000010-0000-000c-0000-001700000046"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000003-0000-0049-0000-003100000022"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000011-0000-0051-0000-003300000061"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000003e-0000-0077-0000-004c00000022"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000007e-0000-0048-0000-007200000056"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000006f-0000-0007-0000-00190000004f"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000002d-0000-0048-0000-001c0000007e"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000004c-0000-0071-0000-007a00000071"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000006-0000-0002-0000-002000000068"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000002e-0000-0037-0000-005e00000027"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000056-0000-006d-0000-004d00000024"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000004a-0000-0038-0000-001e0000003b"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000033-0000-001a-0000-004a0000001a"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000001a-0000-0070-0000-007000000019"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000006b-0000-0013-0000-004a00000018"))))) - ] - ) - -testObject_TeamConversationList_team_5 :: TeamConversationList -testObject_TeamConversationList_team_5 = - ( newTeamConversationList - [ (newTeamConversation ((Id (fromJust (UUID.fromString "00000073-0000-005a-0000-00250000000d"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000033-0000-005c-0000-006e00000014"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000017-0000-005d-0000-003b00000023"))))) - ] - ) - -testObject_TeamConversationList_team_6 :: TeamConversationList -testObject_TeamConversationList_team_6 = - ( newTeamConversationList - [ (newTeamConversation ((Id (fromJust (UUID.fromString "0000007c-0000-007f-0000-00730000000d"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000028-0000-0037-0000-000b00000016"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000021-0000-0064-0000-003900000002"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000064-0000-001f-0000-00350000001b"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000002d-0000-007b-0000-00770000003e"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000064-0000-0068-0000-007700000068"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000061-0000-000b-0000-00170000005c"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000005c-0000-0001-0000-004e00000003"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000008-0000-002b-0000-002d00000022"))))) - ] - ) - -testObject_TeamConversationList_team_7 :: TeamConversationList -testObject_TeamConversationList_team_7 = - ( newTeamConversationList - [ (newTeamConversation ((Id (fromJust (UUID.fromString "00000068-0000-0010-0000-002700000004"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000006d-0000-0036-0000-000e00000080"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000003-0000-0068-0000-000000000006"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000024-0000-0018-0000-005d00000050"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000040-0000-0001-0000-00670000002e"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000002-0000-0016-0000-004300000052"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000007b-0000-0073-0000-002700000048"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000003b-0000-0048-0000-002500000015"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000055-0000-007c-0000-001500000051"))))) - ] - ) - -testObject_TeamConversationList_team_8 :: TeamConversationList -testObject_TeamConversationList_team_8 = - ( newTeamConversationList - [ (newTeamConversation ((Id (fromJust (UUID.fromString "00000026-0000-0066-0000-00170000007b"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000064-0000-0015-0000-001f00000071"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000063-0000-0049-0000-004100000018"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000050-0000-002b-0000-000300000001"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000035-0000-006e-0000-002f00000057"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000006f-0000-0064-0000-003b0000002d"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000003e-0000-0009-0000-00630000001d"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000002a-0000-004d-0000-001b00000036"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000002d-0000-0073-0000-007d00000010"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000016-0000-0007-0000-00690000002d"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000043-0000-001f-0000-007500000002"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000002-0000-0012-0000-006200000028"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000019-0000-003a-0000-002300000023"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000050-0000-006d-0000-00610000000c"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000068-0000-0048-0000-003200000004"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000003-0000-0024-0000-002000000015"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000027-0000-0003-0000-007600000028"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000074-0000-005d-0000-00100000005d"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000071-0000-0075-0000-000a0000002c"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000012-0000-0071-0000-004d00000010"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000006f-0000-003f-0000-005a00000026"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000016-0000-0069-0000-00500000000a"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000033-0000-000b-0000-003000000046"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000002d-0000-005f-0000-007f0000001b"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000057-0000-0050-0000-002100000074"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000077-0000-0063-0000-00360000000e"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000058-0000-0011-0000-001200000005"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000004a-0000-0037-0000-003000000034"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000029-0000-0043-0000-006700000030"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000039-0000-003e-0000-008000000051"))))) - ] - ) - -testObject_TeamConversationList_team_9 :: TeamConversationList -testObject_TeamConversationList_team_9 = - ( newTeamConversationList - [ (newTeamConversation ((Id (fromJust (UUID.fromString "00000058-0000-007c-0000-002a0000005f"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000080-0000-0009-0000-006500000038"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000004e-0000-000a-0000-004e00000039"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000062-0000-001e-0000-004c00000058"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000004-0000-0021-0000-00670000000a"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000004f-0000-0063-0000-004a0000004b"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000044-0000-0017-0000-006300000067"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000006a-0000-0070-0000-002e0000000a"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000049-0000-0080-0000-006000000025"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000007d-0000-0040-0000-001700000066"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000057-0000-0045-0000-00610000006c"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000001-0000-0042-0000-005b00000057"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000048-0000-0032-0000-000000000069"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000003-0000-0022-0000-00370000005b"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000007-0000-0068-0000-00150000001f"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000003a-0000-0067-0000-00060000003e"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000001e-0000-0043-0000-002800000065"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000053-0000-001f-0000-001700000006"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000068-0000-0024-0000-004900000037"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000005-0000-0019-0000-00670000005c"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000029-0000-0003-0000-00520000004c"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000080-0000-002f-0000-002b0000006f"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000021-0000-002e-0000-004f0000005e"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000006a-0000-0023-0000-00560000001b"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000066-0000-007b-0000-00160000005c"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000004e-0000-0008-0000-006b00000049"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000005b-0000-0020-0000-005000000006"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000052-0000-0038-0000-003400000074"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000067-0000-006f-0000-00370000002e"))))) - ] - ) - -testObject_TeamConversationList_team_10 :: TeamConversationList -testObject_TeamConversationList_team_10 = - ( newTeamConversationList - [ (newTeamConversation ((Id (fromJust (UUID.fromString "00000070-0000-007d-0000-001400000009"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000065-0000-0057-0000-00190000004a"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000049-0000-0030-0000-006b00000005"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000007c-0000-0065-0000-001100000066"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000057-0000-0039-0000-000400000071"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000003e-0000-0053-0000-007f0000003c"))))) - ] - ) - -testObject_TeamConversationList_team_11 :: TeamConversationList -testObject_TeamConversationList_team_11 = - ( newTeamConversationList - [ (newTeamConversation ((Id (fromJust (UUID.fromString "00000038-0000-0030-0000-006700000067"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000000-0000-006a-0000-00220000007c"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000055-0000-004f-0000-005500000047"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000064-0000-003d-0000-006500000060"))))) - ] - ) - -testObject_TeamConversationList_team_12 :: TeamConversationList -testObject_TeamConversationList_team_12 = - ( newTeamConversationList - [ (newTeamConversation ((Id (fromJust (UUID.fromString "00000056-0000-0042-0000-00120000004e"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000010-0000-002b-0000-002600000066"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000006b-0000-0054-0000-005300000004"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000000e-0000-006f-0000-000c00000038"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000038-0000-0021-0000-005500000008"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000005b-0000-007a-0000-00230000002d"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000078-0000-000e-0000-004300000065"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000036-0000-0003-0000-000500000011"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000043-0000-0032-0000-005200000069"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000000c-0000-0003-0000-001400000018"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000002a-0000-0020-0000-005200000053"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000047-0000-007b-0000-00670000000b"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000001a-0000-005b-0000-00250000000c"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000004b-0000-005b-0000-004200000001"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000057-0000-0073-0000-003d00000006"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000053-0000-0038-0000-006600000048"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000000d-0000-0022-0000-00800000006f"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000005e-0000-0023-0000-000700000012"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000046-0000-0071-0000-005f00000070"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000056-0000-0024-0000-003400000018"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000054-0000-0056-0000-007000000058"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000046-0000-0011-0000-001500000007"))))) - ] - ) - -testObject_TeamConversationList_team_13 :: TeamConversationList -testObject_TeamConversationList_team_13 = - ( newTeamConversationList - [ (newTeamConversation ((Id (fromJust (UUID.fromString "0000006a-0000-0043-0000-007f00000048"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000007d-0000-005f-0000-000a00000024"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000007a-0000-0046-0000-003800000023"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000023-0000-006b-0000-002000000068"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000041-0000-0000-0000-007000000005"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000007a-0000-0075-0000-00200000007a"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000038-0000-0023-0000-001a00000022"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000035-0000-004f-0000-000400000072"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000065-0000-001a-0000-00680000004d"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000002f-0000-0037-0000-00020000000f"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000023-0000-0040-0000-005b0000001c"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000000-0000-0074-0000-007b00000019"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000004e-0000-0025-0000-006900000014"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000063-0000-0000-0000-002100000043"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000004e-0000-0018-0000-004d0000003a"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000052-0000-004e-0000-002700000075"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000046-0000-0014-0000-000100000040"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000049-0000-0004-0000-00280000000a"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000004-0000-0012-0000-00150000006e"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000009-0000-003c-0000-006400000055"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000008-0000-003d-0000-003c00000003"))))) - ] - ) - -testObject_TeamConversationList_team_14 :: TeamConversationList -testObject_TeamConversationList_team_14 = - ( newTeamConversationList - [ (newTeamConversation ((Id (fromJust (UUID.fromString "00000039-0000-005c-0000-000e00000044"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000080-0000-0061-0000-005d00000066"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000011-0000-0009-0000-006c00000065"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000002a-0000-0026-0000-001e00000007"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000023-0000-005e-0000-007300000058"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000056-0000-006a-0000-004100000045"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000006d-0000-0027-0000-00080000000d"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000024-0000-0028-0000-007700000051"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000004-0000-001c-0000-004c00000073"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000006f-0000-002f-0000-003400000023"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000005d-0000-0057-0000-00580000006a"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000034-0000-0016-0000-002500000036"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000033-0000-006c-0000-00420000003d"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000008-0000-005d-0000-004600000002"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000006a-0000-002b-0000-005800000035"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000006e-0000-0007-0000-005800000075"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000047-0000-002b-0000-000100000080"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000013-0000-001b-0000-003200000000"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000006-0000-0013-0000-004d0000006e"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000074-0000-0041-0000-007200000079"))))) - ] - ) - -testObject_TeamConversationList_team_15 :: TeamConversationList -testObject_TeamConversationList_team_15 = - ( newTeamConversationList - [ (newTeamConversation ((Id (fromJust (UUID.fromString "0000001a-0000-0013-0000-006400000036"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000070-0000-007e-0000-002f00000057"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000002-0000-006e-0000-006800000040"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000080-0000-005a-0000-000e00000024"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000069-0000-007c-0000-00550000002f"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000068-0000-0041-0000-000e0000003e"))))) - ] - ) - -testObject_TeamConversationList_team_16 :: TeamConversationList -testObject_TeamConversationList_team_16 = - ( newTeamConversationList - [ (newTeamConversation ((Id (fromJust (UUID.fromString "00000012-0000-0066-0000-003800000061"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000049-0000-0007-0000-003f0000001d"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000045-0000-0038-0000-005f00000072"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000032-0000-0069-0000-005b00000011"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000053-0000-0073-0000-00280000005d"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000046-0000-0068-0000-004f00000042"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000003-0000-0056-0000-00780000000f"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000006b-0000-0064-0000-001b00000024"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000004e-0000-0052-0000-004000000072"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000052-0000-0080-0000-005100000029"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000079-0000-0018-0000-000600000047"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000009-0000-0029-0000-003100000043"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000048-0000-002e-0000-00220000005b"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000003b-0000-004d-0000-001700000055"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000006c-0000-0028-0000-002100000076"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000033-0000-0052-0000-003300000080"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000004c-0000-005f-0000-00390000004d"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000007a-0000-004b-0000-00440000003e"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000052-0000-007a-0000-003d00000036"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000018-0000-0058-0000-003700000019"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000034-0000-0011-0000-007c00000011"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000056-0000-0057-0000-00630000002b"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000051-0000-0018-0000-00590000007a"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000004b-0000-0011-0000-002100000014"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000060-0000-0003-0000-00490000001b"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000042-0000-006e-0000-001e0000001a"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000005d-0000-0065-0000-004b00000045"))))) - ] - ) - -testObject_TeamConversationList_team_17 :: TeamConversationList -testObject_TeamConversationList_team_17 = - ( newTeamConversationList - [ (newTeamConversation ((Id (fromJust (UUID.fromString "00000053-0000-0070-0000-007f0000001c"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000036-0000-0017-0000-002a00000076"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000065-0000-004f-0000-00710000002d"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000067-0000-0037-0000-004d0000007b"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000004-0000-0071-0000-000800000015"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000047-0000-0062-0000-002900000024"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000072-0000-0027-0000-001300000046"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000000f-0000-0034-0000-00720000000f"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000021-0000-005d-0000-003300000024"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000023-0000-000b-0000-00160000000d"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000022-0000-0042-0000-003400000043"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000020-0000-0033-0000-00780000006b"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000074-0000-0067-0000-005f00000042"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000000f-0000-0079-0000-00630000007e"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000001a-0000-0045-0000-003900000053"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000000-0000-003e-0000-003d00000000"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000039-0000-0052-0000-000500000034"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000004e-0000-002d-0000-00030000005c"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000036-0000-0067-0000-007400000054"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000047-0000-0075-0000-001200000054"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000002e-0000-003d-0000-000700000080"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000005d-0000-0006-0000-00010000001a"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000012-0000-0073-0000-002000000058"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000073-0000-0015-0000-005e0000006e"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000047-0000-0019-0000-00510000005a"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000004b-0000-0074-0000-007000000021"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000007a-0000-0040-0000-006f00000075"))))) - ] - ) - -testObject_TeamConversationList_team_18 :: TeamConversationList -testObject_TeamConversationList_team_18 = - ( newTeamConversationList - [ (newTeamConversation ((Id (fromJust (UUID.fromString "00000049-0000-000d-0000-007600000068"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000002a-0000-0033-0000-006400000019"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000080-0000-0075-0000-00400000004e"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000062-0000-0073-0000-002a00000051"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000003b-0000-004b-0000-005c00000064"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000016-0000-001a-0000-00430000003d"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000002f-0000-0005-0000-004f00000031"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000000-0000-0043-0000-001a0000000c"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000003-0000-001c-0000-003a0000002b"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000001c-0000-007b-0000-00170000000a"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000073-0000-0073-0000-000000000074"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000005b-0000-0069-0000-00490000002d"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000003c-0000-0012-0000-000400000000"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000016-0000-004e-0000-003800000057"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000008-0000-0022-0000-002000000004"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000070-0000-0011-0000-00260000004a"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000002c-0000-007a-0000-00340000006e"))))) - ] - ) - -testObject_TeamConversationList_team_19 :: TeamConversationList -testObject_TeamConversationList_team_19 = - ( newTeamConversationList - [ (newTeamConversation ((Id (fromJust (UUID.fromString "00000000-0000-0041-0000-007b00000060"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000003f-0000-0059-0000-000700000073"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000065-0000-0056-0000-007e00000066"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000002b-0000-000b-0000-007a00000065"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000071-0000-003a-0000-001b00000027"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000070-0000-004f-0000-008000000008"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000003c-0000-000d-0000-00510000005a"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000045-0000-006e-0000-004200000072"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000001b-0000-003b-0000-007900000004"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000002d-0000-0077-0000-006400000054"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000001a-0000-005e-0000-003e00000012"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000057-0000-000c-0000-00370000003b"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000031-0000-0010-0000-006500000077"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000028-0000-004b-0000-00460000007b"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000005-0000-0040-0000-006400000024"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000042-0000-005b-0000-002d00000031"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000065-0000-0067-0000-00610000006d"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000007f-0000-0036-0000-00770000000d"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000058-0000-0042-0000-003700000054"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000002a-0000-0001-0000-000700000015"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000002f-0000-003c-0000-003b00000000"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "00000065-0000-0049-0000-00720000006c"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000000f-0000-0021-0000-004c00000055"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000005b-0000-002e-0000-00140000003d"))))) - ] - ) - -testObject_TeamConversationList_team_20 :: TeamConversationList -testObject_TeamConversationList_team_20 = - ( newTeamConversationList - [ (newTeamConversation ((Id (fromJust (UUID.fromString "00000007-0000-0017-0000-007500000074"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000003b-0000-0055-0000-003f00000059"))))) + (newTeamConversation ((Id (fromJust (UUID.fromString "0000000d-0000-0080-0000-00550000001b"))))) ] ) diff --git a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/TeamConversation_team.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/TeamConversation_team.hs index 8f519c4f5f1..78e5e48c7eb 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/TeamConversation_team.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/TeamConversation_team.hs @@ -1,5 +1,3 @@ -{-# LANGUAGE OverloadedLists #-} - -- This file is part of the Wire Server implementation. -- -- Copyright (C) 2022 Wire Swiss GmbH @@ -22,84 +20,13 @@ module Test.Wire.API.Golden.Generated.TeamConversation_team where import Data.Id (Id (Id)) import qualified Data.UUID as UUID (fromString) import Imports +import Wire.API.Routes.Version import Wire.API.Team.Conversation (TeamConversation, newTeamConversation) -testObject_TeamConversation_team_1 :: TeamConversation -testObject_TeamConversation_team_1 = - (newTeamConversation ((Id (fromJust (UUID.fromString "00000054-0000-0032-0000-001d0000003e"))))) - -testObject_TeamConversation_team_2 :: TeamConversation -testObject_TeamConversation_team_2 = - (newTeamConversation ((Id (fromJust (UUID.fromString "00000021-0000-0059-0000-00390000004c"))))) - -testObject_TeamConversation_team_3 :: TeamConversation -testObject_TeamConversation_team_3 = - (newTeamConversation ((Id (fromJust (UUID.fromString "00000020-0000-0022-0000-00550000003b"))))) - -testObject_TeamConversation_team_4 :: TeamConversation -testObject_TeamConversation_team_4 = - (newTeamConversation ((Id (fromJust (UUID.fromString "0000002d-0000-0034-0000-004600000023"))))) - -testObject_TeamConversation_team_5 :: TeamConversation -testObject_TeamConversation_team_5 = - (newTeamConversation ((Id (fromJust (UUID.fromString "0000007d-0000-005d-0000-003d00000076"))))) - -testObject_TeamConversation_team_6 :: TeamConversation -testObject_TeamConversation_team_6 = - (newTeamConversation ((Id (fromJust (UUID.fromString "0000000a-0000-0013-0000-00420000002e"))))) - -testObject_TeamConversation_team_7 :: TeamConversation -testObject_TeamConversation_team_7 = - (newTeamConversation ((Id (fromJust (UUID.fromString "0000005d-0000-0080-0000-002800000080"))))) - -testObject_TeamConversation_team_8 :: TeamConversation -testObject_TeamConversation_team_8 = - (newTeamConversation ((Id (fromJust (UUID.fromString "0000002e-0000-006d-0000-003700000042"))))) - -testObject_TeamConversation_team_9 :: TeamConversation -testObject_TeamConversation_team_9 = - (newTeamConversation ((Id (fromJust (UUID.fromString "0000000d-0000-001b-0000-006800000047"))))) - -testObject_TeamConversation_team_10 :: TeamConversation -testObject_TeamConversation_team_10 = - (newTeamConversation ((Id (fromJust (UUID.fromString "00000023-0000-0024-0000-003200000067"))))) - -testObject_TeamConversation_team_11 :: TeamConversation -testObject_TeamConversation_team_11 = - (newTeamConversation ((Id (fromJust (UUID.fromString "00000003-0000-0041-0000-002600000041"))))) - -testObject_TeamConversation_team_12 :: TeamConversation -testObject_TeamConversation_team_12 = - (newTeamConversation ((Id (fromJust (UUID.fromString "0000007d-0000-0049-0000-001f00000034"))))) - -testObject_TeamConversation_team_13 :: TeamConversation -testObject_TeamConversation_team_13 = - (newTeamConversation ((Id (fromJust (UUID.fromString "00000025-0000-003c-0000-003d00000032"))))) - -testObject_TeamConversation_team_14 :: TeamConversation -testObject_TeamConversation_team_14 = - (newTeamConversation ((Id (fromJust (UUID.fromString "0000005b-0000-0065-0000-002a00000060"))))) - -testObject_TeamConversation_team_15 :: TeamConversation -testObject_TeamConversation_team_15 = - (newTeamConversation ((Id (fromJust (UUID.fromString "0000001f-0000-0037-0000-005a0000004d"))))) - -testObject_TeamConversation_team_16 :: TeamConversation -testObject_TeamConversation_team_16 = - (newTeamConversation ((Id (fromJust (UUID.fromString "00000044-0000-000a-0000-007f0000001d"))))) - -testObject_TeamConversation_team_17 :: TeamConversation -testObject_TeamConversation_team_17 = - (newTeamConversation ((Id (fromJust (UUID.fromString "00000009-0000-0060-0000-005c00000049"))))) - -testObject_TeamConversation_team_18 :: TeamConversation -testObject_TeamConversation_team_18 = - (newTeamConversation ((Id (fromJust (UUID.fromString "0000005f-0000-0051-0000-003d00000026"))))) - -testObject_TeamConversation_team_19 :: TeamConversation -testObject_TeamConversation_team_19 = - (newTeamConversation ((Id (fromJust (UUID.fromString "0000003d-0000-0025-0000-00170000002e"))))) +testObject_TeamConversation_team_until_v2 :: TeamConversation (Until 'V2) +testObject_TeamConversation_team_until_v2 = + newTeamConversation (Id (fromJust (UUID.fromString "00000054-0000-0032-0000-001d0000003e"))) -testObject_TeamConversation_team_20 :: TeamConversation -testObject_TeamConversation_team_20 = - (newTeamConversation ((Id (fromJust (UUID.fromString "00000007-0000-0053-0000-001500000035"))))) +testObject_TeamConversation_team_from_v2 :: TeamConversation (From 'V2) +testObject_TeamConversation_team_from_v2 = + newTeamConversation (Id (fromJust (UUID.fromString "00000021-0000-0059-0000-00390000004c"))) diff --git a/libs/wire-api/test/golden/fromJSON/testObject_NewConvManaged_user_2.json b/libs/wire-api/test/golden/fromJSON/testObject_NewConvManaged_user_2.json deleted file mode 100644 index f3820d40cc6..00000000000 --- a/libs/wire-api/test/golden/fromJSON/testObject_NewConvManaged_user_2.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "access": [ - "private", - "invite", - "link" - ], - "access_role": "non_activated", - "conversation_role": "bewzponl1a3c_l6ou", - "message_timer": 5509522199847054, - "name": "󳂣\u001a5", - "qualified_users": [ - { - "domain": "test.example.com", - "id": "00000000-0000-0000-0000-000100000001" - } - ], - "team": { - "managed": false, - "teamid": "00000002-0000-0002-0000-000200000002" - }, - "users": [ - "00000002-0000-0001-0000-000400000000" - ] -} diff --git a/libs/wire-api/test/golden/fromJSON/testObject_NewConvUnmanaged_user_2.json b/libs/wire-api/test/golden/fromJSON/testObject_NewConvUnmanaged_user_2.json deleted file mode 100644 index aae8702ff67..00000000000 --- a/libs/wire-api/test/golden/fromJSON/testObject_NewConvUnmanaged_user_2.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "access": [], - "conversation_role": "vmao7psxph3fenvbpsu1u57fns5pfo53d67k98om378rnxr0crcpak_mpspn8q_3m1b02n2n133s1d7q5w3qgmt_5e_dgtvzon8an7dtauiecd32", - "message_timer": 2406292360203739, - "name": "😏􃉷", - "qualified_users": [ - { - "domain": "testdomain.example.com", - "id": "00000000-0000-0000-0000-000100000001" - } - ], - "receipt_mode": -1, - "team": { - "managed": true, - "teamid": "00000000-0000-0001-0000-000000000001" - }, - "users": [] -} diff --git a/libs/wire-api/test/golden/testObject_ConvTeamInfo_user_2.json b/libs/wire-api/test/golden/testObject_ConvTeamInfo_user_2.json new file mode 100644 index 00000000000..2e440e25997 --- /dev/null +++ b/libs/wire-api/test/golden/testObject_ConvTeamInfo_user_2.json @@ -0,0 +1,3 @@ +{ + "teamid": "0000003f-0000-0059-0000-002200000028" +} diff --git a/libs/wire-api/test/golden/fromJSON/testObject_NewConvUnmanaged_user_1.json b/libs/wire-api/test/golden/testObject_NewConv_user_2.json similarity index 81% rename from libs/wire-api/test/golden/fromJSON/testObject_NewConvUnmanaged_user_1.json rename to libs/wire-api/test/golden/testObject_NewConv_user_2.json index f58dad1b1a9..550a2b4de51 100644 --- a/libs/wire-api/test/golden/fromJSON/testObject_NewConvUnmanaged_user_1.json +++ b/libs/wire-api/test/golden/testObject_NewConv_user_2.json @@ -3,20 +3,21 @@ "private", "invite" ], + "access_role": "non_activated", "access_role_v2": [ "team_member", "guest" ], - "users": [ - "00000001-0000-0000-0000-000000000001", - "00000000-0000-0000-0000-000000000000" - ], "conversation_role": "8tp2gs7b6", + "message_timer": 3320987366258987, + "protocol": "proteus", + "qualified_users": [], + "receipt_mode": 1, "team": { - "managed": false, "teamid": "00000000-0000-0001-0000-000000000000" }, - "receipt_mode": 1, - "message_timer": 3320987366258987, - "qualified_users": [] + "users": [ + "00000001-0000-0000-0000-000000000001", + "00000000-0000-0000-0000-000000000000" + ] } diff --git a/libs/wire-api/test/golden/testObject_TeamConversationList_team_1.json b/libs/wire-api/test/golden/testObject_TeamConversationList_team_1.json deleted file mode 100644 index 3248c22295b..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversationList_team_1.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "conversations": [ - { - "conversation": "00000012-0000-0018-0000-00260000002b", - "managed": false - }, - { - "conversation": "0000002d-0000-0063-0000-006900000013", - "managed": false - }, - { - "conversation": "0000002e-0000-003c-0000-00440000000e", - "managed": false - }, - { - "conversation": "00000067-0000-003a-0000-006100000049", - "managed": false - }, - { - "conversation": "0000005f-0000-0003-0000-005a00000075", - "managed": false - }, - { - "conversation": "0000007f-0000-0018-0000-00250000007c", - "managed": false - }, - { - "conversation": "0000006a-0000-0020-0000-001a00000073", - "managed": false - }, - { - "conversation": "0000002e-0000-006a-0000-005f00000003", - "managed": false - }, - { - "conversation": "00000034-0000-0021-0000-00330000005b", - "managed": false - }, - { - "conversation": "00000048-0000-0011-0000-002a00000004", - "managed": false - }, - { - "conversation": "00000031-0000-0018-0000-00060000001a", - "managed": false - }, - { - "conversation": "00000056-0000-000e-0000-004300000028", - "managed": false - }, - { - "conversation": "00000067-0000-007f-0000-003600000031", - "managed": false - }, - { - "conversation": "00000066-0000-0053-0000-006a00000034", - "managed": false - }, - { - "conversation": "0000000f-0000-0071-0000-001b00000057", - "managed": false - }, - { - "conversation": "00000032-0000-0035-0000-00210000003b", - "managed": false - }, - { - "conversation": "00000004-0000-000d-0000-002100000067", - "managed": false - } - ] -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversationList_team_10.json b/libs/wire-api/test/golden/testObject_TeamConversationList_team_10.json deleted file mode 100644 index 5a7f04fd53d..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversationList_team_10.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "conversations": [ - { - "conversation": "00000070-0000-007d-0000-001400000009", - "managed": false - }, - { - "conversation": "00000065-0000-0057-0000-00190000004a", - "managed": false - }, - { - "conversation": "00000049-0000-0030-0000-006b00000005", - "managed": false - }, - { - "conversation": "0000007c-0000-0065-0000-001100000066", - "managed": false - }, - { - "conversation": "00000057-0000-0039-0000-000400000071", - "managed": false - }, - { - "conversation": "0000003e-0000-0053-0000-007f0000003c", - "managed": false - } - ] -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversationList_team_11.json b/libs/wire-api/test/golden/testObject_TeamConversationList_team_11.json deleted file mode 100644 index cd3dde1b948..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversationList_team_11.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "conversations": [ - { - "conversation": "00000038-0000-0030-0000-006700000067", - "managed": false - }, - { - "conversation": "00000000-0000-006a-0000-00220000007c", - "managed": false - }, - { - "conversation": "00000055-0000-004f-0000-005500000047", - "managed": false - }, - { - "conversation": "00000064-0000-003d-0000-006500000060", - "managed": false - } - ] -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversationList_team_12.json b/libs/wire-api/test/golden/testObject_TeamConversationList_team_12.json deleted file mode 100644 index 1ce03386ffd..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversationList_team_12.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "conversations": [ - { - "conversation": "00000056-0000-0042-0000-00120000004e", - "managed": false - }, - { - "conversation": "00000010-0000-002b-0000-002600000066", - "managed": false - }, - { - "conversation": "0000006b-0000-0054-0000-005300000004", - "managed": false - }, - { - "conversation": "0000000e-0000-006f-0000-000c00000038", - "managed": false - }, - { - "conversation": "00000038-0000-0021-0000-005500000008", - "managed": false - }, - { - "conversation": "0000005b-0000-007a-0000-00230000002d", - "managed": false - }, - { - "conversation": "00000078-0000-000e-0000-004300000065", - "managed": false - }, - { - "conversation": "00000036-0000-0003-0000-000500000011", - "managed": false - }, - { - "conversation": "00000043-0000-0032-0000-005200000069", - "managed": false - }, - { - "conversation": "0000000c-0000-0003-0000-001400000018", - "managed": false - }, - { - "conversation": "0000002a-0000-0020-0000-005200000053", - "managed": false - }, - { - "conversation": "00000047-0000-007b-0000-00670000000b", - "managed": false - }, - { - "conversation": "0000001a-0000-005b-0000-00250000000c", - "managed": false - }, - { - "conversation": "0000004b-0000-005b-0000-004200000001", - "managed": false - }, - { - "conversation": "00000057-0000-0073-0000-003d00000006", - "managed": false - }, - { - "conversation": "00000053-0000-0038-0000-006600000048", - "managed": false - }, - { - "conversation": "0000000d-0000-0022-0000-00800000006f", - "managed": false - }, - { - "conversation": "0000005e-0000-0023-0000-000700000012", - "managed": false - }, - { - "conversation": "00000046-0000-0071-0000-005f00000070", - "managed": false - }, - { - "conversation": "00000056-0000-0024-0000-003400000018", - "managed": false - }, - { - "conversation": "00000054-0000-0056-0000-007000000058", - "managed": false - }, - { - "conversation": "00000046-0000-0011-0000-001500000007", - "managed": false - } - ] -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversationList_team_13.json b/libs/wire-api/test/golden/testObject_TeamConversationList_team_13.json deleted file mode 100644 index 76a0c7ecc99..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversationList_team_13.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "conversations": [ - { - "conversation": "0000006a-0000-0043-0000-007f00000048", - "managed": false - }, - { - "conversation": "0000007d-0000-005f-0000-000a00000024", - "managed": false - }, - { - "conversation": "0000007a-0000-0046-0000-003800000023", - "managed": false - }, - { - "conversation": "00000023-0000-006b-0000-002000000068", - "managed": false - }, - { - "conversation": "00000041-0000-0000-0000-007000000005", - "managed": false - }, - { - "conversation": "0000007a-0000-0075-0000-00200000007a", - "managed": false - }, - { - "conversation": "00000038-0000-0023-0000-001a00000022", - "managed": false - }, - { - "conversation": "00000035-0000-004f-0000-000400000072", - "managed": false - }, - { - "conversation": "00000065-0000-001a-0000-00680000004d", - "managed": false - }, - { - "conversation": "0000002f-0000-0037-0000-00020000000f", - "managed": false - }, - { - "conversation": "00000023-0000-0040-0000-005b0000001c", - "managed": false - }, - { - "conversation": "00000000-0000-0074-0000-007b00000019", - "managed": false - }, - { - "conversation": "0000004e-0000-0025-0000-006900000014", - "managed": false - }, - { - "conversation": "00000063-0000-0000-0000-002100000043", - "managed": false - }, - { - "conversation": "0000004e-0000-0018-0000-004d0000003a", - "managed": false - }, - { - "conversation": "00000052-0000-004e-0000-002700000075", - "managed": false - }, - { - "conversation": "00000046-0000-0014-0000-000100000040", - "managed": false - }, - { - "conversation": "00000049-0000-0004-0000-00280000000a", - "managed": false - }, - { - "conversation": "00000004-0000-0012-0000-00150000006e", - "managed": false - }, - { - "conversation": "00000009-0000-003c-0000-006400000055", - "managed": false - }, - { - "conversation": "00000008-0000-003d-0000-003c00000003", - "managed": false - } - ] -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversationList_team_14.json b/libs/wire-api/test/golden/testObject_TeamConversationList_team_14.json deleted file mode 100644 index 3c118b9fcef..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversationList_team_14.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "conversations": [ - { - "conversation": "00000039-0000-005c-0000-000e00000044", - "managed": false - }, - { - "conversation": "00000080-0000-0061-0000-005d00000066", - "managed": false - }, - { - "conversation": "00000011-0000-0009-0000-006c00000065", - "managed": false - }, - { - "conversation": "0000002a-0000-0026-0000-001e00000007", - "managed": false - }, - { - "conversation": "00000023-0000-005e-0000-007300000058", - "managed": false - }, - { - "conversation": "00000056-0000-006a-0000-004100000045", - "managed": false - }, - { - "conversation": "0000006d-0000-0027-0000-00080000000d", - "managed": false - }, - { - "conversation": "00000024-0000-0028-0000-007700000051", - "managed": false - }, - { - "conversation": "00000004-0000-001c-0000-004c00000073", - "managed": false - }, - { - "conversation": "0000006f-0000-002f-0000-003400000023", - "managed": false - }, - { - "conversation": "0000005d-0000-0057-0000-00580000006a", - "managed": false - }, - { - "conversation": "00000034-0000-0016-0000-002500000036", - "managed": false - }, - { - "conversation": "00000033-0000-006c-0000-00420000003d", - "managed": false - }, - { - "conversation": "00000008-0000-005d-0000-004600000002", - "managed": false - }, - { - "conversation": "0000006a-0000-002b-0000-005800000035", - "managed": false - }, - { - "conversation": "0000006e-0000-0007-0000-005800000075", - "managed": false - }, - { - "conversation": "00000047-0000-002b-0000-000100000080", - "managed": false - }, - { - "conversation": "00000013-0000-001b-0000-003200000000", - "managed": false - }, - { - "conversation": "00000006-0000-0013-0000-004d0000006e", - "managed": false - }, - { - "conversation": "00000074-0000-0041-0000-007200000079", - "managed": false - } - ] -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversationList_team_15.json b/libs/wire-api/test/golden/testObject_TeamConversationList_team_15.json deleted file mode 100644 index 05b3262d3a0..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversationList_team_15.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "conversations": [ - { - "conversation": "0000001a-0000-0013-0000-006400000036", - "managed": false - }, - { - "conversation": "00000070-0000-007e-0000-002f00000057", - "managed": false - }, - { - "conversation": "00000002-0000-006e-0000-006800000040", - "managed": false - }, - { - "conversation": "00000080-0000-005a-0000-000e00000024", - "managed": false - }, - { - "conversation": "00000069-0000-007c-0000-00550000002f", - "managed": false - }, - { - "conversation": "00000068-0000-0041-0000-000e0000003e", - "managed": false - } - ] -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversationList_team_16.json b/libs/wire-api/test/golden/testObject_TeamConversationList_team_16.json deleted file mode 100644 index 04835850c9f..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversationList_team_16.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "conversations": [ - { - "conversation": "00000012-0000-0066-0000-003800000061", - "managed": false - }, - { - "conversation": "00000049-0000-0007-0000-003f0000001d", - "managed": false - }, - { - "conversation": "00000045-0000-0038-0000-005f00000072", - "managed": false - }, - { - "conversation": "00000032-0000-0069-0000-005b00000011", - "managed": false - }, - { - "conversation": "00000053-0000-0073-0000-00280000005d", - "managed": false - }, - { - "conversation": "00000046-0000-0068-0000-004f00000042", - "managed": false - }, - { - "conversation": "00000003-0000-0056-0000-00780000000f", - "managed": false - }, - { - "conversation": "0000006b-0000-0064-0000-001b00000024", - "managed": false - }, - { - "conversation": "0000004e-0000-0052-0000-004000000072", - "managed": false - }, - { - "conversation": "00000052-0000-0080-0000-005100000029", - "managed": false - }, - { - "conversation": "00000079-0000-0018-0000-000600000047", - "managed": false - }, - { - "conversation": "00000009-0000-0029-0000-003100000043", - "managed": false - }, - { - "conversation": "00000048-0000-002e-0000-00220000005b", - "managed": false - }, - { - "conversation": "0000003b-0000-004d-0000-001700000055", - "managed": false - }, - { - "conversation": "0000006c-0000-0028-0000-002100000076", - "managed": false - }, - { - "conversation": "00000033-0000-0052-0000-003300000080", - "managed": false - }, - { - "conversation": "0000004c-0000-005f-0000-00390000004d", - "managed": false - }, - { - "conversation": "0000007a-0000-004b-0000-00440000003e", - "managed": false - }, - { - "conversation": "00000052-0000-007a-0000-003d00000036", - "managed": false - }, - { - "conversation": "00000018-0000-0058-0000-003700000019", - "managed": false - }, - { - "conversation": "00000034-0000-0011-0000-007c00000011", - "managed": false - }, - { - "conversation": "00000056-0000-0057-0000-00630000002b", - "managed": false - }, - { - "conversation": "00000051-0000-0018-0000-00590000007a", - "managed": false - }, - { - "conversation": "0000004b-0000-0011-0000-002100000014", - "managed": false - }, - { - "conversation": "00000060-0000-0003-0000-00490000001b", - "managed": false - }, - { - "conversation": "00000042-0000-006e-0000-001e0000001a", - "managed": false - }, - { - "conversation": "0000005d-0000-0065-0000-004b00000045", - "managed": false - } - ] -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversationList_team_17.json b/libs/wire-api/test/golden/testObject_TeamConversationList_team_17.json deleted file mode 100644 index 7361261cb69..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversationList_team_17.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "conversations": [ - { - "conversation": "00000053-0000-0070-0000-007f0000001c", - "managed": false - }, - { - "conversation": "00000036-0000-0017-0000-002a00000076", - "managed": false - }, - { - "conversation": "00000065-0000-004f-0000-00710000002d", - "managed": false - }, - { - "conversation": "00000067-0000-0037-0000-004d0000007b", - "managed": false - }, - { - "conversation": "00000004-0000-0071-0000-000800000015", - "managed": false - }, - { - "conversation": "00000047-0000-0062-0000-002900000024", - "managed": false - }, - { - "conversation": "00000072-0000-0027-0000-001300000046", - "managed": false - }, - { - "conversation": "0000000f-0000-0034-0000-00720000000f", - "managed": false - }, - { - "conversation": "00000021-0000-005d-0000-003300000024", - "managed": false - }, - { - "conversation": "00000023-0000-000b-0000-00160000000d", - "managed": false - }, - { - "conversation": "00000022-0000-0042-0000-003400000043", - "managed": false - }, - { - "conversation": "00000020-0000-0033-0000-00780000006b", - "managed": false - }, - { - "conversation": "00000074-0000-0067-0000-005f00000042", - "managed": false - }, - { - "conversation": "0000000f-0000-0079-0000-00630000007e", - "managed": false - }, - { - "conversation": "0000001a-0000-0045-0000-003900000053", - "managed": false - }, - { - "conversation": "00000000-0000-003e-0000-003d00000000", - "managed": false - }, - { - "conversation": "00000039-0000-0052-0000-000500000034", - "managed": false - }, - { - "conversation": "0000004e-0000-002d-0000-00030000005c", - "managed": false - }, - { - "conversation": "00000036-0000-0067-0000-007400000054", - "managed": false - }, - { - "conversation": "00000047-0000-0075-0000-001200000054", - "managed": false - }, - { - "conversation": "0000002e-0000-003d-0000-000700000080", - "managed": false - }, - { - "conversation": "0000005d-0000-0006-0000-00010000001a", - "managed": false - }, - { - "conversation": "00000012-0000-0073-0000-002000000058", - "managed": false - }, - { - "conversation": "00000073-0000-0015-0000-005e0000006e", - "managed": false - }, - { - "conversation": "00000047-0000-0019-0000-00510000005a", - "managed": false - }, - { - "conversation": "0000004b-0000-0074-0000-007000000021", - "managed": false - }, - { - "conversation": "0000007a-0000-0040-0000-006f00000075", - "managed": false - } - ] -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversationList_team_18.json b/libs/wire-api/test/golden/testObject_TeamConversationList_team_18.json deleted file mode 100644 index 2ddbcdbac5e..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversationList_team_18.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "conversations": [ - { - "conversation": "00000049-0000-000d-0000-007600000068", - "managed": false - }, - { - "conversation": "0000002a-0000-0033-0000-006400000019", - "managed": false - }, - { - "conversation": "00000080-0000-0075-0000-00400000004e", - "managed": false - }, - { - "conversation": "00000062-0000-0073-0000-002a00000051", - "managed": false - }, - { - "conversation": "0000003b-0000-004b-0000-005c00000064", - "managed": false - }, - { - "conversation": "00000016-0000-001a-0000-00430000003d", - "managed": false - }, - { - "conversation": "0000002f-0000-0005-0000-004f00000031", - "managed": false - }, - { - "conversation": "00000000-0000-0043-0000-001a0000000c", - "managed": false - }, - { - "conversation": "00000003-0000-001c-0000-003a0000002b", - "managed": false - }, - { - "conversation": "0000001c-0000-007b-0000-00170000000a", - "managed": false - }, - { - "conversation": "00000073-0000-0073-0000-000000000074", - "managed": false - }, - { - "conversation": "0000005b-0000-0069-0000-00490000002d", - "managed": false - }, - { - "conversation": "0000003c-0000-0012-0000-000400000000", - "managed": false - }, - { - "conversation": "00000016-0000-004e-0000-003800000057", - "managed": false - }, - { - "conversation": "00000008-0000-0022-0000-002000000004", - "managed": false - }, - { - "conversation": "00000070-0000-0011-0000-00260000004a", - "managed": false - }, - { - "conversation": "0000002c-0000-007a-0000-00340000006e", - "managed": false - } - ] -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversationList_team_19.json b/libs/wire-api/test/golden/testObject_TeamConversationList_team_19.json deleted file mode 100644 index f8ff6ae2764..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversationList_team_19.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "conversations": [ - { - "conversation": "00000000-0000-0041-0000-007b00000060", - "managed": false - }, - { - "conversation": "0000003f-0000-0059-0000-000700000073", - "managed": false - }, - { - "conversation": "00000065-0000-0056-0000-007e00000066", - "managed": false - }, - { - "conversation": "0000002b-0000-000b-0000-007a00000065", - "managed": false - }, - { - "conversation": "00000071-0000-003a-0000-001b00000027", - "managed": false - }, - { - "conversation": "00000070-0000-004f-0000-008000000008", - "managed": false - }, - { - "conversation": "0000003c-0000-000d-0000-00510000005a", - "managed": false - }, - { - "conversation": "00000045-0000-006e-0000-004200000072", - "managed": false - }, - { - "conversation": "0000001b-0000-003b-0000-007900000004", - "managed": false - }, - { - "conversation": "0000002d-0000-0077-0000-006400000054", - "managed": false - }, - { - "conversation": "0000001a-0000-005e-0000-003e00000012", - "managed": false - }, - { - "conversation": "00000057-0000-000c-0000-00370000003b", - "managed": false - }, - { - "conversation": "00000031-0000-0010-0000-006500000077", - "managed": false - }, - { - "conversation": "00000028-0000-004b-0000-00460000007b", - "managed": false - }, - { - "conversation": "00000005-0000-0040-0000-006400000024", - "managed": false - }, - { - "conversation": "00000042-0000-005b-0000-002d00000031", - "managed": false - }, - { - "conversation": "00000065-0000-0067-0000-00610000006d", - "managed": false - }, - { - "conversation": "0000007f-0000-0036-0000-00770000000d", - "managed": false - }, - { - "conversation": "00000058-0000-0042-0000-003700000054", - "managed": false - }, - { - "conversation": "0000002a-0000-0001-0000-000700000015", - "managed": false - }, - { - "conversation": "0000002f-0000-003c-0000-003b00000000", - "managed": false - }, - { - "conversation": "00000065-0000-0049-0000-00720000006c", - "managed": false - }, - { - "conversation": "0000000f-0000-0021-0000-004c00000055", - "managed": false - }, - { - "conversation": "0000005b-0000-002e-0000-00140000003d", - "managed": false - } - ] -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversationList_team_2.json b/libs/wire-api/test/golden/testObject_TeamConversationList_team_2.json deleted file mode 100644 index 19a9f17bde5..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversationList_team_2.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "conversations": [ - { - "conversation": "00000064-0000-0045-0000-007d00000023", - "managed": false - }, - { - "conversation": "0000000d-0000-0080-0000-00550000001b", - "managed": false - }, - { - "conversation": "0000004e-0000-0053-0000-004600000056", - "managed": false - }, - { - "conversation": "0000006e-0000-003c-0000-003200000071", - "managed": false - }, - { - "conversation": "00000067-0000-002f-0000-007a0000007f", - "managed": false - }, - { - "conversation": "0000000a-0000-0027-0000-004e0000005f", - "managed": false - }, - { - "conversation": "00000006-0000-0026-0000-000000000054", - "managed": false - }, - { - "conversation": "0000006e-0000-007e-0000-001600000035", - "managed": false - }, - { - "conversation": "0000002c-0000-0057-0000-007e00000070", - "managed": false - }, - { - "conversation": "00000074-0000-0053-0000-005f00000006", - "managed": false - }, - { - "conversation": "00000028-0000-005c-0000-00050000006b", - "managed": false - }, - { - "conversation": "00000018-0000-0061-0000-004a00000024", - "managed": false - }, - { - "conversation": "0000005a-0000-007b-0000-000800000033", - "managed": false - }, - { - "conversation": "00000027-0000-0043-0000-006800000068", - "managed": false - }, - { - "conversation": "00000056-0000-0018-0000-003f00000001", - "managed": false - }, - { - "conversation": "00000014-0000-0066-0000-00440000001b", - "managed": false - }, - { - "conversation": "0000007f-0000-0071-0000-007f0000001b", - "managed": false - }, - { - "conversation": "00000018-0000-004d-0000-005000000080", - "managed": false - }, - { - "conversation": "00000018-0000-003e-0000-00140000006e", - "managed": false - }, - { - "conversation": "00000033-0000-005c-0000-001e0000000d", - "managed": false - }, - { - "conversation": "0000004d-0000-0021-0000-00360000000e", - "managed": false - }, - { - "conversation": "00000057-0000-003f-0000-003700000065", - "managed": false - }, - { - "conversation": "0000006f-0000-003e-0000-000300000051", - "managed": false - }, - { - "conversation": "00000038-0000-0025-0000-00030000003b", - "managed": false - }, - { - "conversation": "0000003c-0000-0069-0000-005000000035", - "managed": false - }, - { - "conversation": "0000005f-0000-006b-0000-00260000004e", - "managed": false - }, - { - "conversation": "0000001c-0000-001c-0000-00530000000c", - "managed": false - } - ] -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversationList_team_20.json b/libs/wire-api/test/golden/testObject_TeamConversationList_team_20.json deleted file mode 100644 index ac130821ff7..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversationList_team_20.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "conversations": [ - { - "conversation": "00000007-0000-0017-0000-007500000074", - "managed": false - }, - { - "conversation": "0000003b-0000-0055-0000-003f00000059", - "managed": false - } - ] -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversationList_team_3.json b/libs/wire-api/test/golden/testObject_TeamConversationList_team_3.json deleted file mode 100644 index c492ea34289..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversationList_team_3.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "conversations": [ - { - "conversation": "00000046-0000-0026-0000-005600000014", - "managed": false - }, - { - "conversation": "0000006b-0000-0042-0000-002c00000074", - "managed": false - }, - { - "conversation": "0000006d-0000-006d-0000-006100000027", - "managed": false - }, - { - "conversation": "00000079-0000-0024-0000-004600000011", - "managed": false - }, - { - "conversation": "00000044-0000-0005-0000-003800000008", - "managed": false - }, - { - "conversation": "00000052-0000-005e-0000-00200000001a", - "managed": false - }, - { - "conversation": "00000009-0000-0038-0000-001b00000065", - "managed": false - }, - { - "conversation": "00000029-0000-0045-0000-004500000078", - "managed": false - }, - { - "conversation": "0000001e-0000-0036-0000-006400000045", - "managed": false - }, - { - "conversation": "00000050-0000-0066-0000-000500000075", - "managed": false - } - ] -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversationList_team_4.json b/libs/wire-api/test/golden/testObject_TeamConversationList_team_4.json deleted file mode 100644 index 56cca582891..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversationList_team_4.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "conversations": [ - { - "conversation": "00000076-0000-0038-0000-003c00000043", - "managed": false - }, - { - "conversation": "00000046-0000-001f-0000-005800000080", - "managed": false - }, - { - "conversation": "00000023-0000-0070-0000-006f00000077", - "managed": false - }, - { - "conversation": "00000006-0000-0031-0000-004700000053", - "managed": false - }, - { - "conversation": "00000057-0000-0041-0000-001600000013", - "managed": false - }, - { - "conversation": "0000007b-0000-003c-0000-004800000063", - "managed": false - }, - { - "conversation": "00000028-0000-0009-0000-004c00000009", - "managed": false - }, - { - "conversation": "0000001a-0000-007b-0000-00460000007f", - "managed": false - }, - { - "conversation": "00000052-0000-002e-0000-001000000064", - "managed": false - }, - { - "conversation": "0000003d-0000-002a-0000-00290000007b", - "managed": false - }, - { - "conversation": "00000004-0000-0033-0000-00780000005e", - "managed": false - }, - { - "conversation": "0000006b-0000-007f-0000-001d0000002c", - "managed": false - }, - { - "conversation": "00000017-0000-0079-0000-001c00000066", - "managed": false - }, - { - "conversation": "0000002f-0000-0024-0000-001000000074", - "managed": false - }, - { - "conversation": "00000010-0000-000c-0000-001700000046", - "managed": false - }, - { - "conversation": "00000003-0000-0049-0000-003100000022", - "managed": false - }, - { - "conversation": "00000011-0000-0051-0000-003300000061", - "managed": false - }, - { - "conversation": "0000003e-0000-0077-0000-004c00000022", - "managed": false - }, - { - "conversation": "0000007e-0000-0048-0000-007200000056", - "managed": false - }, - { - "conversation": "0000006f-0000-0007-0000-00190000004f", - "managed": false - }, - { - "conversation": "0000002d-0000-0048-0000-001c0000007e", - "managed": false - }, - { - "conversation": "0000004c-0000-0071-0000-007a00000071", - "managed": false - }, - { - "conversation": "00000006-0000-0002-0000-002000000068", - "managed": false - }, - { - "conversation": "0000002e-0000-0037-0000-005e00000027", - "managed": false - }, - { - "conversation": "00000056-0000-006d-0000-004d00000024", - "managed": false - }, - { - "conversation": "0000004a-0000-0038-0000-001e0000003b", - "managed": false - }, - { - "conversation": "00000033-0000-001a-0000-004a0000001a", - "managed": false - }, - { - "conversation": "0000001a-0000-0070-0000-007000000019", - "managed": false - }, - { - "conversation": "0000006b-0000-0013-0000-004a00000018", - "managed": false - } - ] -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversationList_team_5.json b/libs/wire-api/test/golden/testObject_TeamConversationList_team_5.json deleted file mode 100644 index 9fc01c729f4..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversationList_team_5.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "conversations": [ - { - "conversation": "00000073-0000-005a-0000-00250000000d", - "managed": false - }, - { - "conversation": "00000033-0000-005c-0000-006e00000014", - "managed": false - }, - { - "conversation": "00000017-0000-005d-0000-003b00000023", - "managed": false - } - ] -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversationList_team_6.json b/libs/wire-api/test/golden/testObject_TeamConversationList_team_6.json deleted file mode 100644 index e3e2854092a..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversationList_team_6.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "conversations": [ - { - "conversation": "0000007c-0000-007f-0000-00730000000d", - "managed": false - }, - { - "conversation": "00000028-0000-0037-0000-000b00000016", - "managed": false - }, - { - "conversation": "00000021-0000-0064-0000-003900000002", - "managed": false - }, - { - "conversation": "00000064-0000-001f-0000-00350000001b", - "managed": false - }, - { - "conversation": "0000002d-0000-007b-0000-00770000003e", - "managed": false - }, - { - "conversation": "00000064-0000-0068-0000-007700000068", - "managed": false - }, - { - "conversation": "00000061-0000-000b-0000-00170000005c", - "managed": false - }, - { - "conversation": "0000005c-0000-0001-0000-004e00000003", - "managed": false - }, - { - "conversation": "00000008-0000-002b-0000-002d00000022", - "managed": false - } - ] -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversationList_team_7.json b/libs/wire-api/test/golden/testObject_TeamConversationList_team_7.json deleted file mode 100644 index a3a49965496..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversationList_team_7.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "conversations": [ - { - "conversation": "00000068-0000-0010-0000-002700000004", - "managed": false - }, - { - "conversation": "0000006d-0000-0036-0000-000e00000080", - "managed": false - }, - { - "conversation": "00000003-0000-0068-0000-000000000006", - "managed": false - }, - { - "conversation": "00000024-0000-0018-0000-005d00000050", - "managed": false - }, - { - "conversation": "00000040-0000-0001-0000-00670000002e", - "managed": false - }, - { - "conversation": "00000002-0000-0016-0000-004300000052", - "managed": false - }, - { - "conversation": "0000007b-0000-0073-0000-002700000048", - "managed": false - }, - { - "conversation": "0000003b-0000-0048-0000-002500000015", - "managed": false - }, - { - "conversation": "00000055-0000-007c-0000-001500000051", - "managed": false - } - ] -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversationList_team_8.json b/libs/wire-api/test/golden/testObject_TeamConversationList_team_8.json deleted file mode 100644 index cf6455ca885..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversationList_team_8.json +++ /dev/null @@ -1,124 +0,0 @@ -{ - "conversations": [ - { - "conversation": "00000026-0000-0066-0000-00170000007b", - "managed": false - }, - { - "conversation": "00000064-0000-0015-0000-001f00000071", - "managed": false - }, - { - "conversation": "00000063-0000-0049-0000-004100000018", - "managed": false - }, - { - "conversation": "00000050-0000-002b-0000-000300000001", - "managed": false - }, - { - "conversation": "00000035-0000-006e-0000-002f00000057", - "managed": false - }, - { - "conversation": "0000006f-0000-0064-0000-003b0000002d", - "managed": false - }, - { - "conversation": "0000003e-0000-0009-0000-00630000001d", - "managed": false - }, - { - "conversation": "0000002a-0000-004d-0000-001b00000036", - "managed": false - }, - { - "conversation": "0000002d-0000-0073-0000-007d00000010", - "managed": false - }, - { - "conversation": "00000016-0000-0007-0000-00690000002d", - "managed": false - }, - { - "conversation": "00000043-0000-001f-0000-007500000002", - "managed": false - }, - { - "conversation": "00000002-0000-0012-0000-006200000028", - "managed": false - }, - { - "conversation": "00000019-0000-003a-0000-002300000023", - "managed": false - }, - { - "conversation": "00000050-0000-006d-0000-00610000000c", - "managed": false - }, - { - "conversation": "00000068-0000-0048-0000-003200000004", - "managed": false - }, - { - "conversation": "00000003-0000-0024-0000-002000000015", - "managed": false - }, - { - "conversation": "00000027-0000-0003-0000-007600000028", - "managed": false - }, - { - "conversation": "00000074-0000-005d-0000-00100000005d", - "managed": false - }, - { - "conversation": "00000071-0000-0075-0000-000a0000002c", - "managed": false - }, - { - "conversation": "00000012-0000-0071-0000-004d00000010", - "managed": false - }, - { - "conversation": "0000006f-0000-003f-0000-005a00000026", - "managed": false - }, - { - "conversation": "00000016-0000-0069-0000-00500000000a", - "managed": false - }, - { - "conversation": "00000033-0000-000b-0000-003000000046", - "managed": false - }, - { - "conversation": "0000002d-0000-005f-0000-007f0000001b", - "managed": false - }, - { - "conversation": "00000057-0000-0050-0000-002100000074", - "managed": false - }, - { - "conversation": "00000077-0000-0063-0000-00360000000e", - "managed": false - }, - { - "conversation": "00000058-0000-0011-0000-001200000005", - "managed": false - }, - { - "conversation": "0000004a-0000-0037-0000-003000000034", - "managed": false - }, - { - "conversation": "00000029-0000-0043-0000-006700000030", - "managed": false - }, - { - "conversation": "00000039-0000-003e-0000-008000000051", - "managed": false - } - ] -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversationList_team_9.json b/libs/wire-api/test/golden/testObject_TeamConversationList_team_9.json deleted file mode 100644 index a9c45447710..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversationList_team_9.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "conversations": [ - { - "conversation": "00000058-0000-007c-0000-002a0000005f", - "managed": false - }, - { - "conversation": "00000080-0000-0009-0000-006500000038", - "managed": false - }, - { - "conversation": "0000004e-0000-000a-0000-004e00000039", - "managed": false - }, - { - "conversation": "00000062-0000-001e-0000-004c00000058", - "managed": false - }, - { - "conversation": "00000004-0000-0021-0000-00670000000a", - "managed": false - }, - { - "conversation": "0000004f-0000-0063-0000-004a0000004b", - "managed": false - }, - { - "conversation": "00000044-0000-0017-0000-006300000067", - "managed": false - }, - { - "conversation": "0000006a-0000-0070-0000-002e0000000a", - "managed": false - }, - { - "conversation": "00000049-0000-0080-0000-006000000025", - "managed": false - }, - { - "conversation": "0000007d-0000-0040-0000-001700000066", - "managed": false - }, - { - "conversation": "00000057-0000-0045-0000-00610000006c", - "managed": false - }, - { - "conversation": "00000001-0000-0042-0000-005b00000057", - "managed": false - }, - { - "conversation": "00000048-0000-0032-0000-000000000069", - "managed": false - }, - { - "conversation": "00000003-0000-0022-0000-00370000005b", - "managed": false - }, - { - "conversation": "00000007-0000-0068-0000-00150000001f", - "managed": false - }, - { - "conversation": "0000003a-0000-0067-0000-00060000003e", - "managed": false - }, - { - "conversation": "0000001e-0000-0043-0000-002800000065", - "managed": false - }, - { - "conversation": "00000053-0000-001f-0000-001700000006", - "managed": false - }, - { - "conversation": "00000068-0000-0024-0000-004900000037", - "managed": false - }, - { - "conversation": "00000005-0000-0019-0000-00670000005c", - "managed": false - }, - { - "conversation": "00000029-0000-0003-0000-00520000004c", - "managed": false - }, - { - "conversation": "00000080-0000-002f-0000-002b0000006f", - "managed": false - }, - { - "conversation": "00000021-0000-002e-0000-004f0000005e", - "managed": false - }, - { - "conversation": "0000006a-0000-0023-0000-00560000001b", - "managed": false - }, - { - "conversation": "00000066-0000-007b-0000-00160000005c", - "managed": false - }, - { - "conversation": "0000004e-0000-0008-0000-006b00000049", - "managed": false - }, - { - "conversation": "0000005b-0000-0020-0000-005000000006", - "managed": false - }, - { - "conversation": "00000052-0000-0038-0000-003400000074", - "managed": false - }, - { - "conversation": "00000067-0000-006f-0000-00370000002e", - "managed": false - } - ] -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversationList_team_from_v2.json b/libs/wire-api/test/golden/testObject_TeamConversationList_team_from_v2.json new file mode 100644 index 00000000000..2bf0434b45c --- /dev/null +++ b/libs/wire-api/test/golden/testObject_TeamConversationList_team_from_v2.json @@ -0,0 +1,10 @@ +{ + "conversations": [ + { + "conversation": "00000064-0000-0045-0000-007d00000023" + }, + { + "conversation": "0000000d-0000-0080-0000-00550000001b" + } + ] +} diff --git a/libs/wire-api/test/golden/testObject_TeamConversationList_team_until_v2.json b/libs/wire-api/test/golden/testObject_TeamConversationList_team_until_v2.json new file mode 100644 index 00000000000..8ff30f176f4 --- /dev/null +++ b/libs/wire-api/test/golden/testObject_TeamConversationList_team_until_v2.json @@ -0,0 +1,12 @@ +{ + "conversations": [ + { + "conversation": "00000012-0000-0018-0000-00260000002b", + "managed": false + }, + { + "conversation": "0000002d-0000-0063-0000-006900000013", + "managed": false + } + ] +} diff --git a/libs/wire-api/test/golden/testObject_TeamConversation_team_10.json b/libs/wire-api/test/golden/testObject_TeamConversation_team_10.json deleted file mode 100644 index ee720e2f877..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversation_team_10.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "conversation": "00000023-0000-0024-0000-003200000067", - "managed": false -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversation_team_11.json b/libs/wire-api/test/golden/testObject_TeamConversation_team_11.json deleted file mode 100644 index 25cf779c07c..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversation_team_11.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "conversation": "00000003-0000-0041-0000-002600000041", - "managed": false -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversation_team_12.json b/libs/wire-api/test/golden/testObject_TeamConversation_team_12.json deleted file mode 100644 index 815df368e29..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversation_team_12.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "conversation": "0000007d-0000-0049-0000-001f00000034", - "managed": false -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversation_team_13.json b/libs/wire-api/test/golden/testObject_TeamConversation_team_13.json deleted file mode 100644 index 08af5f0cbc1..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversation_team_13.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "conversation": "00000025-0000-003c-0000-003d00000032", - "managed": false -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversation_team_14.json b/libs/wire-api/test/golden/testObject_TeamConversation_team_14.json deleted file mode 100644 index 70ac6497480..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversation_team_14.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "conversation": "0000005b-0000-0065-0000-002a00000060", - "managed": false -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversation_team_15.json b/libs/wire-api/test/golden/testObject_TeamConversation_team_15.json deleted file mode 100644 index bc6c7526159..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversation_team_15.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "conversation": "0000001f-0000-0037-0000-005a0000004d", - "managed": false -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversation_team_16.json b/libs/wire-api/test/golden/testObject_TeamConversation_team_16.json deleted file mode 100644 index 842886be695..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversation_team_16.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "conversation": "00000044-0000-000a-0000-007f0000001d", - "managed": false -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversation_team_17.json b/libs/wire-api/test/golden/testObject_TeamConversation_team_17.json deleted file mode 100644 index 49f37f2faec..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversation_team_17.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "conversation": "00000009-0000-0060-0000-005c00000049", - "managed": false -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversation_team_18.json b/libs/wire-api/test/golden/testObject_TeamConversation_team_18.json deleted file mode 100644 index c74e29a2206..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversation_team_18.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "conversation": "0000005f-0000-0051-0000-003d00000026", - "managed": false -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversation_team_19.json b/libs/wire-api/test/golden/testObject_TeamConversation_team_19.json deleted file mode 100644 index f4165939bdc..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversation_team_19.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "conversation": "0000003d-0000-0025-0000-00170000002e", - "managed": false -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversation_team_2.json b/libs/wire-api/test/golden/testObject_TeamConversation_team_2.json deleted file mode 100644 index 98867bb28cc..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversation_team_2.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "conversation": "00000021-0000-0059-0000-00390000004c", - "managed": false -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversation_team_20.json b/libs/wire-api/test/golden/testObject_TeamConversation_team_20.json deleted file mode 100644 index 685a331cb2b..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversation_team_20.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "conversation": "00000007-0000-0053-0000-001500000035", - "managed": false -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversation_team_3.json b/libs/wire-api/test/golden/testObject_TeamConversation_team_3.json deleted file mode 100644 index 9f73a8d7200..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversation_team_3.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "conversation": "00000020-0000-0022-0000-00550000003b", - "managed": false -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversation_team_4.json b/libs/wire-api/test/golden/testObject_TeamConversation_team_4.json deleted file mode 100644 index 36244e41508..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversation_team_4.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "conversation": "0000002d-0000-0034-0000-004600000023", - "managed": false -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversation_team_5.json b/libs/wire-api/test/golden/testObject_TeamConversation_team_5.json deleted file mode 100644 index de418778915..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversation_team_5.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "conversation": "0000007d-0000-005d-0000-003d00000076", - "managed": false -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversation_team_6.json b/libs/wire-api/test/golden/testObject_TeamConversation_team_6.json deleted file mode 100644 index 16a96402ac7..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversation_team_6.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "conversation": "0000000a-0000-0013-0000-00420000002e", - "managed": false -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversation_team_7.json b/libs/wire-api/test/golden/testObject_TeamConversation_team_7.json deleted file mode 100644 index 56c320cc2cb..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversation_team_7.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "conversation": "0000005d-0000-0080-0000-002800000080", - "managed": false -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversation_team_8.json b/libs/wire-api/test/golden/testObject_TeamConversation_team_8.json deleted file mode 100644 index 32455b74b26..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversation_team_8.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "conversation": "0000002e-0000-006d-0000-003700000042", - "managed": false -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversation_team_9.json b/libs/wire-api/test/golden/testObject_TeamConversation_team_9.json deleted file mode 100644 index 4e9f0537f6c..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversation_team_9.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "conversation": "0000000d-0000-001b-0000-006800000047", - "managed": false -} diff --git a/libs/wire-api/test/golden/testObject_TeamConversation_team_from_v2.json b/libs/wire-api/test/golden/testObject_TeamConversation_team_from_v2.json new file mode 100644 index 00000000000..d41e3a51b87 --- /dev/null +++ b/libs/wire-api/test/golden/testObject_TeamConversation_team_from_v2.json @@ -0,0 +1,3 @@ +{ + "conversation": "00000021-0000-0059-0000-00390000004c" +} diff --git a/libs/wire-api/test/golden/testObject_TeamConversation_team_1.json b/libs/wire-api/test/golden/testObject_TeamConversation_team_until_v2.json similarity index 100% rename from libs/wire-api/test/golden/testObject_TeamConversation_team_1.json rename to libs/wire-api/test/golden/testObject_TeamConversation_team_until_v2.json diff --git a/libs/wire-api/test/unit/Test/Wire/API/Roundtrip/Aeson.hs b/libs/wire-api/test/unit/Test/Wire/API/Roundtrip/Aeson.hs index 27cd79e958d..dec698d6ef8 100644 --- a/libs/wire-api/test/unit/Test/Wire/API/Roundtrip/Aeson.hs +++ b/libs/wire-api/test/unit/Test/Wire/API/Roundtrip/Aeson.hs @@ -46,6 +46,7 @@ import qualified Wire.API.Provider.External as Provider.External import qualified Wire.API.Provider.Service as Provider.Service import qualified Wire.API.Provider.Service.Tag as Provider.Service.Tag import qualified Wire.API.Push.Token as Push.Token +import Wire.API.Routes.Version import qualified Wire.API.Team as Team import qualified Wire.API.Team.Conversation as Team.Conversation import qualified Wire.API.Team.Feature as Team.Feature @@ -102,7 +103,8 @@ tests = testRoundTrip @Conversation.AccessRoleV2, testRoundTrip @Conversation.ConvType, testRoundTrip @Conversation.ReceiptMode, - testRoundTrip @Conversation.ConvTeamInfo, + testRoundTrip @(Conversation.ConvTeamInfo (Until 'V2)), + testRoundTrip @(Conversation.ConvTeamInfo (From 'V2)), testRoundTrip @Conversation.ConversationCoverView, testRoundTrip @Conversation.Invite, testRoundTrip @Conversation.ConversationRename, @@ -186,8 +188,10 @@ tests = testRoundTrip @Team.TeamList, testRoundTrip @Team.TeamUpdateData, testRoundTrip @Team.TeamDeleteData, - testRoundTrip @Team.Conversation.TeamConversation, - testRoundTrip @Team.Conversation.TeamConversationList, + testRoundTrip @(Team.Conversation.TeamConversation (Until 'V2)), + testRoundTrip @(Team.Conversation.TeamConversation (From 'V2)), + testRoundTrip @(Team.Conversation.TeamConversationList (Until 'V2)), + testRoundTrip @(Team.Conversation.TeamConversationList (From 'V2)), testRoundTrip @(Team.Feature.WithStatus Team.Feature.LegalholdConfig), testRoundTrip @(Team.Feature.WithStatusPatch Team.Feature.LegalholdConfig), testRoundTrip @(Team.Feature.WithStatusPatch Team.Feature.SelfDeletingMessagesConfig), diff --git a/services/galley/src/Galley/API/Create.hs b/services/galley/src/Galley/API/Create.hs index 17e2ee5edf5..c0241d09b4e 100644 --- a/services/galley/src/Galley/API/Create.hs +++ b/services/galley/src/Galley/API/Create.hs @@ -103,7 +103,7 @@ createGroupConversation :: r => Local UserId -> ConnId -> - NewConv -> + NewConv v -> Sem r ConversationResponse createGroupConversation lusr conn newConv = do (nc, fromConvSize -> allUsers) <- newRegularConversation lusr newConv @@ -147,8 +147,8 @@ checkCreateConvPermissions :: ] r => Local UserId -> - NewConv -> - Maybe ConvTeamInfo -> + NewConv v -> + Maybe (ConvTeamInfo v) -> UserList UserId -> Sem r () checkCreateConvPermissions lusr _newConv Nothing allUsers = @@ -202,7 +202,7 @@ createSelfConversation lusr = do conversationCreated lusr c createOne2OneConversation :: - forall r. + forall r v. Members '[ BrigAccess, ConversationStore, @@ -228,7 +228,7 @@ createOne2OneConversation :: r => Local UserId -> ConnId -> - NewConv -> + NewConv v -> Sem r ConversationResponse createOne2OneConversation lusr zcon j = do let allUsers = newConvMembers lusr j @@ -484,7 +484,7 @@ createConnectConversation lusr conn j = do newRegularConversation :: Members '[ErrorS 'MLSNonEmptyMemberList, Error InvalidInput, Input Opts] r => Local UserId -> - NewConv -> + NewConv v -> Sem r (NewConversation, ConvSizeChecked UserList UserId) newRegularConversation lusr newConv = do o <- input @@ -578,15 +578,15 @@ toUUIDs a b = do b' <- U.fromUUID (toUUID b) & note InvalidUUID4 pure (a', b') -accessRoles :: NewConv -> Set AccessRoleV2 +accessRoles :: NewConv v -> Set AccessRoleV2 accessRoles b = fromMaybe Data.defRole (newConvAccessRoles b) -access :: NewConv -> [Access] +access :: NewConv v -> [Access] access a = case Set.toList (newConvAccess a) of [] -> Data.defRegularConvAccess (x : xs) -> x : xs -newConvMembers :: Local x -> NewConv -> UserList UserId +newConvMembers :: Local x -> NewConv v -> UserList UserId newConvMembers loc body = UserList (newConvUsers body) [] <> toUserList loc (newConvQualifiedUsers body) diff --git a/services/galley/src/Galley/API/Internal.hs b/services/galley/src/Galley/API/Internal.hs index 04497a56828..d83abd84201 100644 --- a/services/galley/src/Galley/API/Internal.hs +++ b/services/galley/src/Galley/API/Internal.hs @@ -101,6 +101,7 @@ import Wire.API.Routes.MultiVerb import Wire.API.Routes.Named import Wire.API.Routes.Public import Wire.API.Routes.Public.Galley +import Wire.API.Routes.Version import Wire.API.Team import Wire.API.Team.Feature import Wire.API.Team.Member @@ -757,7 +758,7 @@ deleteLoop = do doDelete usr con tid = do lusr <- qualifyLocal usr - Teams.uncheckedDeleteTeam lusr con tid + Teams.uncheckedDeleteTeam @(From 'V2) lusr con tid safeForever :: String -> App () -> App () safeForever funName action = diff --git a/services/galley/src/Galley/API/Public/Servant.hs b/services/galley/src/Galley/API/Public/Servant.hs index 21378d52784..f5665a37065 100644 --- a/services/galley/src/Galley/API/Public/Servant.hs +++ b/services/galley/src/Galley/API/Public/Servant.hs @@ -55,8 +55,10 @@ servantSitemap = <@> mkNamedAPI @"list-conversations-v1" listConversations <@> mkNamedAPI @"list-conversations" listConversations <@> mkNamedAPI @"get-conversation-by-reusable-code" (getConversationByReusableCode @Cassandra) + <@> mkNamedAPI @"create-group-conversation-v1" createGroupConversation <@> mkNamedAPI @"create-group-conversation" createGroupConversation <@> mkNamedAPI @"create-self-conversation" createSelfConversation + <@> mkNamedAPI @"create-one-to-one-conversation-v1" createOne2OneConversation <@> mkNamedAPI @"create-one-to-one-conversation" createOne2OneConversation <@> mkNamedAPI @"add-members-to-conversation-unqualified" addMembersUnqualified <@> mkNamedAPI @"add-members-to-conversation-unqualified2" addMembersUnqualifiedV2 @@ -89,7 +91,9 @@ servantSitemap = teamConversations :: API TeamConversationAPI GalleyEffects teamConversations = mkNamedAPI @"get-team-conversation-roles" getTeamConversationRoles + <@> mkNamedAPI @"get-team-conversations-v1" getTeamConversations <@> mkNamedAPI @"get-team-conversations" getTeamConversations + <@> mkNamedAPI @"get-team-conversation-v1" getTeamConversation <@> mkNamedAPI @"get-team-conversation" getTeamConversation <@> mkNamedAPI @"delete-team-conversation" deleteTeamConversation diff --git a/services/galley/src/Galley/API/Teams.hs b/services/galley/src/Galley/API/Teams.hs index ca2643e5618..e9e956eba94 100644 --- a/services/galley/src/Galley/API/Teams.hs +++ b/services/galley/src/Galley/API/Teams.hs @@ -15,6 +15,9 @@ -- You should have received a copy of the GNU Affero General Public License along -- with this program. If not, see . {-# LANGUAGE LambdaCase #-} +-- NOTE: GHC incorrectly infers that the 'v' type variable in the signature of +-- 'uncheckedDeleteTeam' is unused. +{-# OPTIONS_GHC -Wno-unused-foralls #-} module Galley.API.Teams ( createBindingTeam, @@ -397,7 +400,7 @@ internalDeleteBindingTeam tid force = do -- This function is "unchecked" because it does not validate that the user has the `DeleteTeam` permission. uncheckedDeleteTeam :: - forall r. + forall (v :: *) r. Members '[ BrigAccess, ExternalAccess, @@ -456,7 +459,7 @@ uncheckedDeleteTeam lusr zcon tid = do createConvDeleteEvents :: UTCTime -> [TeamMember] -> - TeamConversation -> + TeamConversation v -> ([Push], [(BotMember, Conv.Event)]) -> Sem r ([Push], [(BotMember, Conv.Event)]) createConvDeleteEvents now teamMembs c (pp, ee) = do @@ -1018,7 +1021,7 @@ getTeamConversations :: r => UserId -> TeamId -> - Sem r Public.TeamConversationList + Sem r (Public.TeamConversationList v) getTeamConversations zusr tid = do tm <- E.getTeamMember tid zusr @@ -1038,7 +1041,7 @@ getTeamConversation :: UserId -> TeamId -> ConvId -> - Sem r Public.TeamConversation + Sem r (Public.TeamConversation v) getTeamConversation zusr tid cid = do tm <- E.getTeamMember tid zusr diff --git a/services/galley/src/Galley/Cassandra/Instances.hs b/services/galley/src/Galley/Cassandra/Instances.hs index f25ffc2a279..3e0f9890527 100644 --- a/services/galley/src/Galley/Cassandra/Instances.hs +++ b/services/galley/src/Galley/Cassandra/Instances.hs @@ -113,14 +113,13 @@ instance Cql AccessRoleV2 where n -> Left $ "Unexpected AccessRoleV2 value: " ++ show n fromCql _ = Left "AccessRoleV2 value: int expected" -instance Cql ConvTeamInfo where +instance Cql (ConvTeamInfo v) where ctype = Tagged $ UdtColumn "teaminfo" [("teamid", UuidColumn), ("managed", BooleanColumn)] toCql t = CqlUdt [("teamid", toCql (cnvTeamId t)), ("managed", toCql False)] - fromCql (CqlUdt u) = do - t <- note "missing 'teamid' in teaminfo" ("teamid" `lookup` u) >>= fromCql - pure (ConvTeamInfo t) + fromCql (CqlUdt u) = + note "missing 'teamid' in teaminfo" ("teamid" `lookup` u) >>= fmap ConvTeamInfo . fromCql fromCql _ = Left "teaminfo: udt expected" instance Cql TeamBinding where diff --git a/services/galley/src/Galley/Cassandra/Team.hs b/services/galley/src/Galley/Cassandra/Team.hs index 3156f2fc613..08821c94879 100644 --- a/services/galley/src/Galley/Cassandra/Team.hs +++ b/services/galley/src/Galley/Cassandra/Team.hs @@ -156,12 +156,12 @@ getTeamName tid = fmap runIdentity <$> retry x1 (query1 Cql.selectTeamName (params LocalQuorum (Identity tid))) -teamConversation :: TeamId -> ConvId -> Client (Maybe TeamConversation) +teamConversation :: TeamId -> ConvId -> Client (Maybe (TeamConversation v)) teamConversation t c = fmap (newTeamConversation . runIdentity) <$> retry x1 (query1 Cql.selectTeamConv (params LocalQuorum (t, c))) -getTeamConversations :: TeamId -> Client [TeamConversation] +getTeamConversations :: TeamId -> Client [TeamConversation v] getTeamConversations t = map (newTeamConversation . runIdentity) <$> retry x1 (query Cql.selectTeamConvs (params LocalQuorum (Identity t))) @@ -335,7 +335,7 @@ deleteTeam tid = do removeConvs cnvs retry x5 $ write Cql.deleteTeam (params LocalQuorum (Deleted, tid)) where - removeConvs :: Page TeamConversation -> Client () + removeConvs :: Page (TeamConversation v) -> Client () removeConvs cnvs = do for_ (result cnvs) $ removeTeamConv tid . view conversationId unless (null $ result cnvs) $ @@ -415,7 +415,11 @@ newTeamMember' lh tid (uid, perms, minvu, minvt, fromMaybe defUserLegalHoldStatu mk Nothing Nothing = pure $ mkTeamMember uid perms Nothing lhStatus mk _ _ = throwM $ ErrorCall "TeamMember with incomplete metadata." -teamConversationsForPagination :: TeamId -> Maybe ConvId -> Range 1 HardTruncationLimit Int32 -> Client (Page TeamConversation) +teamConversationsForPagination :: + TeamId -> + Maybe ConvId -> + Range 1 HardTruncationLimit Int32 -> + Client (Page (TeamConversation v)) teamConversationsForPagination tid start (fromRange -> max) = fmap (newTeamConversation . runIdentity) <$> case start of Just c -> paginate Cql.selectTeamConvsFrom (paramsP LocalQuorum (tid, c) max) diff --git a/services/galley/src/Galley/Effects/TeamStore.hs b/services/galley/src/Galley/Effects/TeamStore.hs index bf2fdbb5664..94961c0a4b1 100644 --- a/services/galley/src/Galley/Effects/TeamStore.hs +++ b/services/galley/src/Galley/Effects/TeamStore.hs @@ -107,8 +107,8 @@ data TeamStore m a where GetBillingTeamMembers :: TeamId -> TeamStore m [UserId] GetTeam :: TeamId -> TeamStore m (Maybe TeamData) GetTeamName :: TeamId -> TeamStore m (Maybe Text) - GetTeamConversation :: TeamId -> ConvId -> TeamStore m (Maybe TeamConversation) - GetTeamConversations :: TeamId -> TeamStore m [TeamConversation] + GetTeamConversation :: TeamId -> ConvId -> TeamStore m (Maybe (TeamConversation v)) + GetTeamConversations :: TeamId -> TeamStore m [TeamConversation v] SelectTeams :: UserId -> [TeamId] -> TeamStore m [TeamId] GetTeamMember :: TeamId -> UserId -> TeamStore m (Maybe TeamMember) GetTeamMembersWithLimit :: TeamId -> Range 1 HardTruncationLimit Int32 -> TeamStore m TeamMemberList diff --git a/services/galley/test/integration/API.hs b/services/galley/test/integration/API.hs index b6fc4c9aa14..9c270396176 100644 --- a/services/galley/test/integration/API.hs +++ b/services/galley/test/integration/API.hs @@ -98,6 +98,7 @@ import Wire.API.Message import qualified Wire.API.Message as Message import Wire.API.Routes.MultiTablePaging import Wire.API.Routes.Named +import Wire.API.Routes.Version import qualified Wire.API.Team.Feature as Public import qualified Wire.API.Team.Member as Teams import Wire.API.User @@ -2042,8 +2043,20 @@ postConvQualifiedFederationNotEnabled = do -- FUTUREWORK: figure out how to use functions in the TestM monad inside withSettingsOverrides and remove this duplication postConvHelper :: (MonadIO m, MonadHttp m) => (Request -> Request) -> UserId -> [Qualified UserId] -> m ResponseLBS postConvHelper g zusr newUsers = do - let conv = NewConv [] newUsers (checked "gossip") (Set.fromList []) Nothing Nothing Nothing Nothing roleNameWireAdmin ProtocolProteusTag Nothing - post $ g . path "/conversations" . zUser zusr . zConn "conn" . zType "access" . json conv + let conv :: NewConv (From 'V2) = + NewConv + [] + newUsers + (checked "gossip") + (Set.fromList []) + Nothing + Nothing + Nothing + Nothing + roleNameWireAdmin + ProtocolProteusTag + Nothing + post $ g . path "/v2/conversations" . zUser zusr . zConn "conn" . zType "access" . json conv postSelfConvOk :: TestM () postSelfConvOk = do @@ -2071,8 +2084,20 @@ postConvO2OFailWithSelf :: TestM () postConvO2OFailWithSelf = do g <- view tsGalley alice <- randomUser - let inv = NewConv [alice] [] Nothing mempty Nothing Nothing Nothing Nothing roleNameWireAdmin ProtocolProteusTag Nothing - post (g . path "/conversations/one2one" . zUser alice . zConn "conn" . zType "access" . json inv) !!! do + let inv :: NewConv (From 'V2) = + NewConv + [alice] + [] + Nothing + mempty + Nothing + Nothing + Nothing + Nothing + roleNameWireAdmin + ProtocolProteusTag + Nothing + post (g . path "/v2/conversations/one2one" . zUser alice . zConn "conn" . zType "access" . json inv) !!! do const 403 === statusCode const (Just "invalid-op") === fmap label . responseJsonUnsafe diff --git a/services/galley/test/integration/API/MLS/Util.hs b/services/galley/test/integration/API/MLS/Util.hs index c4cca7bf2cd..2174b99da63 100644 --- a/services/galley/test/integration/API/MLS/Util.hs +++ b/services/galley/test/integration/API/MLS/Util.hs @@ -66,7 +66,7 @@ data CreateConv = CreateConv | CreateProteusConv | DontCreateConv data UserOrigin = LocalUser | RemoteUser Domain -createNewConv :: ClientId -> CreateConv -> Maybe NewConv +createNewConv :: ClientId -> CreateConv -> Maybe (NewConv v) createNewConv c CreateConv = Just (defNewMLSConv c) createNewConv _ CreateProteusConv = Just defNewProteusConv createNewConv _ DontCreateConv = Nothing diff --git a/services/galley/test/integration/API/Util.hs b/services/galley/test/integration/API/Util.hs index 4556a34a1bd..0f597beeed1 100644 --- a/services/galley/test/integration/API/Util.hs +++ b/services/galley/test/integration/API/Util.hs @@ -481,7 +481,7 @@ getInvitationCode t ref = do createTeamConvLegacy :: HasCallStack => UserId -> TeamId -> [UserId] -> Maybe Text -> TestM ConvId createTeamConvLegacy u tid us name = do g <- view tsGalley - let tinfo = ConvTeamInfo tid + let tinfo :: ConvTeamInfo (Until 'V2) = ConvTeamInfo tid let convPayload = object [ "users" .= us, @@ -490,7 +490,7 @@ createTeamConvLegacy u tid us name = do ] post ( g - . path "/conversations" + . path "/v1/conversations" . zUser u . zConn "conn" . zType "access" @@ -549,11 +549,11 @@ createTeamConvAccessRaw :: createTeamConvAccessRaw u tid us name acc role mtimer convRole = do g <- view tsGalley let tinfo = ConvTeamInfo tid - let conv = + let conv :: NewConv (From 'V2) = NewConv us [] (name >>= checked) (fromMaybe (Set.fromList []) acc) role (Just tinfo) mtimer Nothing (fromMaybe roleNameWireAdmin convRole) ProtocolProteusTag Nothing post ( g - . path "/conversations" + . path "/v2/conversations" . zUser u . zConn "conn" . zType "access" @@ -575,7 +575,7 @@ createMLSTeamConv :: m (Local ConvId) createMLSTeamConv lusr c tid users name access role timer convRole = do g <- viewGalley - let conv = + let conv :: NewConv (From 'V2) = NewConv { newConvUsers = [], newConvQualifiedUsers = ulAll lusr users, @@ -592,7 +592,7 @@ createMLSTeamConv lusr c tid users name access role timer convRole = do r <- post ( g - . path "/conversations" + . path "/v2/conversations" . zUser (tUnqualified lusr) . zConn "conn" . zType "access" @@ -616,9 +616,20 @@ updateTeamConv zusr convid upd = do createOne2OneTeamConv :: UserId -> UserId -> Maybe Text -> TeamId -> TestM ResponseLBS createOne2OneTeamConv u1 u2 n tid = do g <- view tsGalley - let conv = - NewConv [u2] [] (n >>= checked) mempty Nothing (Just $ ConvTeamInfo tid) Nothing Nothing roleNameWireAdmin ProtocolProteusTag Nothing - post $ g . path "/conversations/one2one" . zUser u1 . zConn "conn" . zType "access" . json conv + let conv :: NewConv (From 'V2) = + NewConv + [u2] + [] + (n >>= checked) + mempty + Nothing + (Just $ ConvTeamInfo tid) + Nothing + Nothing + roleNameWireAdmin + ProtocolProteusTag + Nothing + post $ g . path "/v2/conversations/one2one" . zUser u1 . zConn "conn" . zType "access" . json conv postConv :: UserId -> @@ -630,10 +641,10 @@ postConv :: TestM ResponseLBS postConv u us name a r mtimer = postConvWithRole u us name a r mtimer roleNameWireAdmin -defNewProteusConv :: NewConv +defNewProteusConv :: NewConv v defNewProteusConv = NewConv [] [] Nothing mempty Nothing Nothing Nothing Nothing roleNameWireAdmin ProtocolProteusTag Nothing -defNewMLSConv :: ClientId -> NewConv +defNewMLSConv :: ClientId -> NewConv v defNewMLSConv c = defNewProteusConv { newConvProtocol = ProtocolMLSTag, @@ -642,13 +653,13 @@ defNewMLSConv c = postConvQualified :: UserId -> - NewConv -> + NewConv (From 'V2) -> TestM ResponseLBS postConvQualified u n = do g <- viewGalley post $ g - . path "/conversations" + . path "/v2/conversations" . zUser u . zConn "conn" . zType "access" @@ -657,7 +668,7 @@ postConvQualified u n = do postConvWithRemoteUsers :: HasCallStack => UserId -> - NewConv -> + NewConv (From 'V2) -> TestM (Response (Maybe LByteString)) postConvWithRemoteUsers u n = fmap fst $ @@ -672,8 +683,20 @@ postConvWithRemoteUsers u n = postTeamConv :: TeamId -> UserId -> [UserId] -> Maybe Text -> [Access] -> Maybe (Set AccessRoleV2) -> Maybe Milliseconds -> TestM ResponseLBS postTeamConv tid u us name a r mtimer = do g <- view tsGalley - let conv = NewConv us [] (name >>= checked) (Set.fromList a) r (Just (ConvTeamInfo tid)) mtimer Nothing roleNameWireAdmin ProtocolProteusTag Nothing - post $ g . path "/conversations" . zUser u . zConn "conn" . zType "access" . json conv + let conv :: NewConv (From 'V2) = + NewConv + us + [] + (name >>= checked) + (Set.fromList a) + r + (Just (ConvTeamInfo tid)) + mtimer + Nothing + roleNameWireAdmin + ProtocolProteusTag + Nothing + post $ g . path "/v2/conversations" . zUser u . zConn "conn" . zType "access" . json conv deleteTeamConv :: (HasGalley m, MonadIO m, MonadHttp m) => TeamId -> ConvId -> UserId -> m ResponseLBS deleteTeamConv tid convId zusr = do @@ -709,8 +732,20 @@ postConvWithRole u members name access arole timer role = postConvWithReceipt :: UserId -> [UserId] -> Maybe Text -> [Access] -> Maybe (Set AccessRoleV2) -> Maybe Milliseconds -> ReceiptMode -> TestM ResponseLBS postConvWithReceipt u us name a r mtimer rcpt = do g <- view tsGalley - let conv = NewConv us [] (name >>= checked) (Set.fromList a) r Nothing mtimer (Just rcpt) roleNameWireAdmin ProtocolProteusTag Nothing - post $ g . path "/conversations" . zUser u . zConn "conn" . zType "access" . json conv + let conv :: NewConv (From 'V2) = + NewConv + us + [] + (name >>= checked) + (Set.fromList a) + r + Nothing + mtimer + (Just rcpt) + roleNameWireAdmin + ProtocolProteusTag + Nothing + post $ g . path "/v2/conversations" . zUser u . zConn "conn" . zType "access" . json conv postSelfConv :: UserId -> TestM ResponseLBS postSelfConv u = do @@ -720,8 +755,20 @@ postSelfConv u = do postO2OConv :: UserId -> UserId -> Maybe Text -> TestM ResponseLBS postO2OConv u1 u2 n = do g <- view tsGalley - let conv = NewConv [u2] [] (n >>= checked) mempty Nothing Nothing Nothing Nothing roleNameWireAdmin ProtocolProteusTag Nothing - post $ g . path "/conversations/one2one" . zUser u1 . zConn "conn" . zType "access" . json conv + let conv :: NewConv (From 'V2) = + NewConv + [u2] + [] + (n >>= checked) + mempty + Nothing + Nothing + Nothing + Nothing + roleNameWireAdmin + ProtocolProteusTag + Nothing + post $ g . path "/v2/conversations/one2one" . zUser u1 . zConn "conn" . zType "access" . json conv postConnectConv :: UserId -> UserId -> Text -> Text -> Maybe Text -> TestM ResponseLBS postConnectConv a b name msg email = do From 58281d887e38612829a6c59fe0c01cdd54bce133 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Dimja=C5=A1evi=C4=87?= Date: Mon, 14 Feb 2022 15:33:34 +0100 Subject: [PATCH 03/14] Add two changelogs --- changelog.d/1-api-changes/drop-managed-conv-json | 1 + changelog.d/5-internal/drop-managed-db-schema | 1 + 2 files changed, 2 insertions(+) create mode 100644 changelog.d/1-api-changes/drop-managed-conv-json create mode 100644 changelog.d/5-internal/drop-managed-db-schema diff --git a/changelog.d/1-api-changes/drop-managed-conv-json b/changelog.d/1-api-changes/drop-managed-conv-json new file mode 100644 index 00000000000..b989f0d86df --- /dev/null +++ b/changelog.d/1-api-changes/drop-managed-conv-json @@ -0,0 +1 @@ +Conversation endpoints no longer support the `managed` flag in their JSON form diff --git a/changelog.d/5-internal/drop-managed-db-schema b/changelog.d/5-internal/drop-managed-db-schema new file mode 100644 index 00000000000..265b0595cd9 --- /dev/null +++ b/changelog.d/5-internal/drop-managed-db-schema @@ -0,0 +1 @@ +Drop the `managed` column from `team_conv` table in Galley From bb867098171c7fd1e3a9a5a904ad6cba7be6ff83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Dimja=C5=A1evi=C4=87?= Date: Thu, 1 Sep 2022 12:13:05 +0200 Subject: [PATCH 04/14] fixup! Remove "managed" from JSON instances --- .../Network/Wire/Client/API/Conversation.hs | 19 +++++++++++++++++-- services/brig/src/Brig/IO/Intra.hs | 12 ++++++++++-- .../brig/test/integration/API/Provider.hs | 18 ++++++++++++++++-- .../brig/test/integration/API/Team/Util.hs | 19 ++++++++++++++++--- .../test/integration/Federation/End2end.hs | 6 ++++-- services/brig/test/integration/Util.hs | 11 +++++++---- 6 files changed, 70 insertions(+), 15 deletions(-) diff --git a/libs/api-client/src/Network/Wire/Client/API/Conversation.hs b/libs/api-client/src/Network/Wire/Client/API/Conversation.hs index da0324b4f7e..7ed47ed9e9c 100644 --- a/libs/api-client/src/Network/Wire/Client/API/Conversation.hs +++ b/libs/api-client/src/Network/Wire/Client/API/Conversation.hs @@ -48,6 +48,7 @@ import Wire.API.Conversation.Protocol as M import Wire.API.Conversation.Role (roleNameWireAdmin) import Wire.API.Event.Conversation as M (MemberUpdateData) import Wire.API.Message as M +import Wire.API.Routes.Version postOtrMessage :: MonadSession m => ConvId -> NewOtrMessage -> m ClientMismatch postOtrMessage cnv msg = sessionRequest req rsc readBody @@ -137,10 +138,24 @@ createConv :: m Conversation createConv users name = sessionRequest req rsc readBody where + v2 = toByteString' (toLower <$> show V2) req = method POST - . path "conversations" + . paths [v2, "conversations"] . acceptJson - . json (NewConv users [] (name >>= checked) mempty Nothing Nothing Nothing Nothing roleNameWireAdmin M.ProtocolProteusTag Nothing) + . json + ( NewConv @(From 'V2) + users + [] + (name >>= checked) + mempty + Nothing + Nothing + Nothing + Nothing + roleNameWireAdmin + M.ProtocolProteusTag + Nothing + ) $ empty rsc = status201 :| [] diff --git a/services/brig/src/Brig/IO/Intra.hs b/services/brig/src/Brig/IO/Intra.hs index c22c8a178ae..1c627f074c1 100644 --- a/services/brig/src/Brig/IO/Intra.hs +++ b/services/brig/src/Brig/IO/Intra.hs @@ -127,6 +127,7 @@ import Wire.API.Event.Conversation (Connect (Connect)) import Wire.API.Federation.API.Brig import Wire.API.Federation.Error import Wire.API.Properties +import Wire.API.Routes.Version import Wire.API.Team import qualified Wire.API.Team.Conversation as Conv import Wire.API.Team.Feature @@ -942,7 +943,7 @@ getTeamConv :: UserId -> TeamId -> ConvId -> - m (Maybe Conv.TeamConversation) + m (Maybe (Conv.TeamConversation (From 'V2))) getTeamConv usr tid cnv = do debug $ remote "galley" @@ -953,8 +954,15 @@ getTeamConv usr tid cnv = do 200 -> Just <$> decodeBody "galley" rs _ -> pure Nothing where + v2 = toByteString' (toLower <$> show V2) req = - paths ["teams", toByteString' tid, "conversations", toByteString' cnv] + paths + [ v2, + "teams", + toByteString' tid, + "conversations", + toByteString' cnv + ] . zUser usr . expect [status200, status404] diff --git a/services/brig/test/integration/API/Provider.hs b/services/brig/test/integration/API/Provider.hs index 3d3e81803af..9dd9aadef18 100644 --- a/services/brig/test/integration/API/Provider.hs +++ b/services/brig/test/integration/API/Provider.hs @@ -90,6 +90,7 @@ import qualified Wire.API.Provider.Bot as Ext import qualified Wire.API.Provider.External as Ext import Wire.API.Provider.Service import Wire.API.Provider.Service.Tag +import Wire.API.Routes.Version import Wire.API.Team.Feature (featureNameBS) import qualified Wire.API.Team.Feature as Public import Wire.API.Team.Permission @@ -1321,14 +1322,27 @@ createConvWithAccessRoles :: createConvWithAccessRoles ars g u us = post $ g - . path "/conversations" + . paths [v2, "conversations"] . header "Z-User" (toByteString' u) . header "Z-Type" "access" . header "Z-Connection" "conn" . contentJson . body (RequestBodyLBS (encode conv)) where - conv = NewConv us [] Nothing Set.empty ars Nothing Nothing Nothing roleNameWireAdmin ProtocolProteusTag Nothing + v2 = toByteString' (toLower <$> show V2) + conv :: NewConv (From 'V2) = + NewConv + us + [] + Nothing + Set.empty + ars + Nothing + Nothing + Nothing + roleNameWireAdmin + ProtocolProteusTag + Nothing postMessage :: Galley -> diff --git a/services/brig/test/integration/API/Team/Util.hs b/services/brig/test/integration/API/Team/Util.hs index 64e8120a6e3..38ef4fe87f0 100644 --- a/services/brig/test/integration/API/Team/Util.hs +++ b/services/brig/test/integration/API/Team/Util.hs @@ -42,6 +42,7 @@ import Wire.API.Connection import Wire.API.Conversation import Wire.API.Conversation.Protocol import Wire.API.Conversation.Role +import Wire.API.Routes.Version import Wire.API.Team hiding (newTeam) import Wire.API.Team.Feature (FeatureStatus (..)) import qualified Wire.API.Team.Feature as Public @@ -213,12 +214,24 @@ updatePermissions from tid (to, perm) galley = createTeamConv :: HasCallStack => Galley -> TeamId -> UserId -> [UserId] -> Maybe Milliseconds -> Http ConvId createTeamConv g tid u us mtimer = do let tinfo = Just $ ConvTeamInfo tid - let conv = - NewConv us [] Nothing (Set.fromList []) Nothing tinfo mtimer Nothing roleNameWireAdmin ProtocolProteusTag Nothing + let conv :: NewConv (From 'V2) = + NewConv + us + [] + Nothing + (Set.fromList []) + Nothing + tinfo + mtimer + Nothing + roleNameWireAdmin + ProtocolProteusTag + Nothing + v2 = toByteString' (toLower <$> show V2) r <- post ( g - . path "/conversations" + . paths [v2, "conversations"] . zUser u . zConn "conn" . contentJson diff --git a/services/brig/test/integration/Federation/End2end.hs b/services/brig/test/integration/Federation/End2end.hs index cd668f00283..a2e431986ed 100644 --- a/services/brig/test/integration/Federation/End2end.hs +++ b/services/brig/test/integration/Federation/End2end.hs @@ -65,6 +65,7 @@ import Wire.API.MLS.KeyPackage import Wire.API.MLS.Serialisation import Wire.API.Message import Wire.API.Routes.MultiTablePaging +import Wire.API.Routes.Version import Wire.API.User hiding (assetKey) import Wire.API.User.Client import Wire.API.User.Client.Prekey @@ -262,7 +263,7 @@ testAddRemoteUsersToLocalConv brig1 galley1 brig2 galley2 = do alice <- randomUser brig1 bob <- randomUser brig2 - let newConv = + let newConv :: NewConv (From 'V2) = NewConv [] [] @@ -275,11 +276,12 @@ testAddRemoteUsersToLocalConv brig1 galley1 brig2 galley2 = do roleNameWireAdmin ProtocolProteusTag Nothing + v2 = toByteString' (toLower <$> show V2) convId <- fmap cnvQualifiedId . responseJsonError =<< post ( galley1 - . path "/conversations" + . paths [v2, "conversations"] . zUser (userId alice) . zConn "conn" . header "Z-Type" "access" diff --git a/services/brig/test/integration/Util.hs b/services/brig/test/integration/Util.hs index 42db733b757..0363021ff22 100644 --- a/services/brig/test/integration/Util.hs +++ b/services/brig/test/integration/Util.hs @@ -111,6 +111,7 @@ import Wire.API.Federation.API import Wire.API.Federation.Domain import Wire.API.Internal.Notification import Wire.API.Routes.MultiTablePaging +import Wire.API.Routes.Version import Wire.API.Team.Member hiding (userId) import Wire.API.User import Wire.API.User.Activation @@ -684,7 +685,7 @@ getConversationQualified galley usr cnv = createMLSConversation :: (MonadIO m, MonadHttp m) => Galley -> UserId -> ClientId -> m ResponseLBS createMLSConversation galley zusr c = do - let conv = + let conv :: NewConv (From 'V2) = NewConv [] mempty @@ -697,16 +698,17 @@ createMLSConversation galley zusr c = do roleNameWireAdmin ProtocolMLSTag (Just c) + v2 = toByteString' (toLower <$> show V2) post $ galley - . path "/conversations" + . paths [v2, "conversations"] . zUser zusr . zConn "conn" . json conv createConversation :: (MonadIO m, MonadHttp m) => Galley -> UserId -> [Qualified UserId] -> m ResponseLBS createConversation galley zusr usersToAdd = do - let conv = + let conv :: NewConv (From 'V2) = NewConv [] usersToAdd @@ -719,9 +721,10 @@ createConversation galley zusr usersToAdd = do roleNameWireAdmin ProtocolProteusTag Nothing + v2 = toByteString' (toLower <$> show V2) post $ galley - . path "/conversations" + . paths [v2, "conversations"] . zUser zusr . zConn "conn" . json conv From 3d7dc8fa9726d01c2103991c1b814c72d76ffa3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Dimja=C5=A1evi=C4=87?= Date: Thu, 1 Sep 2022 12:15:49 +0200 Subject: [PATCH 05/14] fixup! Remove "managed" from JSON instances --- libs/wire-api/src/Wire/API/Routes/Public/Galley.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/wire-api/src/Wire/API/Routes/Public/Galley.hs b/libs/wire-api/src/Wire/API/Routes/Public/Galley.hs index a38a92739bc..86f89015634 100644 --- a/libs/wire-api/src/Wire/API/Routes/Public/Galley.hs +++ b/libs/wire-api/src/Wire/API/Routes/Public/Galley.hs @@ -106,7 +106,7 @@ instance fromUnion (Z (I c)) = CodeAlreadyExisted c fromUnion (S (Z (I e))) = CodeAdded e - fromUnion (S (S x)) = case x of + fromUnion (S (S x)) = case x of {} type ConvUpdateResponses = UpdateResponses "Conversation unchanged" "Conversation updated" Event From 18d8da078e7a8d501db21c7023784dddb2f864d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Dimja=C5=A1evi=C4=87?= Date: Mon, 5 Sep 2022 17:06:33 +0200 Subject: [PATCH 06/14] Revert NewConv and ConvTeamInfo - This puts them back to their old instances as we never output these types, and it doesn't really matter that we keep the "managed" key in JSON instances as it is ignored when parsing anyway. --- libs/wire-api/src/Wire/API/Conversation.hs | 225 ++++++------------ .../src/Wire/API/Routes/Public/Galley.hs | 46 +--- .../golden/Test/Wire/API/Golden/Generated.hs | 17 +- .../API/Golden/Generated/ConvTeamInfo_user.hs | 4 +- .../Wire/API/Golden/Generated/NewConv_user.hs | 6 +- .../testObject_ConvTeamInfo_user_2.json | 3 - .../golden/testObject_NewConv_user_2.json | 23 -- .../unit/Test/Wire/API/Roundtrip/Aeson.hs | 3 +- services/galley/src/Galley/API/Create.hs | 18 +- .../galley/src/Galley/API/Public/Servant.hs | 2 - .../galley/src/Galley/Cassandra/Instances.hs | 2 +- services/galley/test/integration/API.hs | 33 +-- .../galley/test/integration/API/MLS/Util.hs | 2 +- services/galley/test/integration/API/Util.hs | 87 ++----- 14 files changed, 120 insertions(+), 351 deletions(-) delete mode 100644 libs/wire-api/test/golden/testObject_ConvTeamInfo_user_2.json delete mode 100644 libs/wire-api/test/golden/testObject_NewConv_user_2.json diff --git a/libs/wire-api/src/Wire/API/Conversation.hs b/libs/wire-api/src/Wire/API/Conversation.hs index 1858028ba8e..d0200617d89 100644 --- a/libs/wire-api/src/Wire/API/Conversation.hs +++ b/libs/wire-api/src/Wire/API/Conversation.hs @@ -117,7 +117,6 @@ import Wire.API.Conversation.Protocol import Wire.API.Conversation.Role (RoleName, roleNameWireAdmin) import Wire.API.MLS.Group import Wire.API.Routes.MultiTablePaging -import Wire.API.Routes.Version import Wire.Arbitrary -------------------------------------------------------------------------------- @@ -634,10 +633,7 @@ modelNewConversation = Doc.defineModel "NewConversation" $ do Doc.description "Conversation receipt mode" Doc.optional --- FUTUREWORK: The version tag type argument can be dropped as soon as versions --- below V2 are not supported any more, at least as far as the 'newConvTeam' is --- considered. -data NewConv (v :: *) = NewConv +data NewConv = NewConv { newConvUsers :: [UserId], -- | A list of qualified users, which can include some local qualified users -- too. @@ -645,7 +641,7 @@ data NewConv (v :: *) = NewConv newConvName :: Maybe (Range 1 256 Text), newConvAccess :: Set Access, newConvAccessRoles :: Maybe (Set AccessRoleV2), - newConvTeam :: Maybe (ConvTeamInfo v), + newConvTeam :: Maybe ConvTeamInfo, newConvMessageTimer :: Maybe Milliseconds, newConvReceiptMode :: Maybe ReceiptMode, -- | Every member except for the creator will have this role @@ -657,147 +653,78 @@ data NewConv (v :: *) = NewConv newConvCreatorClient :: Maybe ClientId } deriving stock (Eq, Show, Generic) - deriving (Arbitrary) via (GenericUniform (NewConv v)) - -instance ToSchema (NewConv (Until 'V2)) where - schema = newConvSchema @(Until 'V2) - -instance ToSchema (NewConv (From 'V2)) where - schema = newConvSchema @(From 'V2) - -deriving via - Schema (NewConv (Until 'V2)) - instance - FromJSON (NewConv (Until 'V2)) - -deriving via - Schema (NewConv (Until 'V2)) - instance - ToJSON (NewConv (Until 'V2)) - -deriving via - Schema (NewConv (From 'V2)) - instance - FromJSON (NewConv (From 'V2)) - -deriving via - Schema (NewConv (From 'V2)) - instance - ToJSON (NewConv (From 'V2)) - -deriving via - Schema (NewConv (Until 'V2)) - instance - S.ToSchema (NewConv (Until 'V2)) - -deriving via - Schema (NewConv (From 'V2)) - instance - S.ToSchema (NewConv (From 'V2)) - -newConvSchema :: - forall v. - ToSchema (ConvTeamInfo v) => - ValueSchema NamedSwaggerDoc (NewConv v) -newConvSchema = - objectWithDocModifier - "NewConv" - (description ?~ "JSON object to create a new conversation. When using 'qualified_users' (preferred), you can omit 'users'") - $ NewConv - <$> newConvUsers - .= ( fieldWithDocModifier - "users" - (description ?~ usersDesc) - (array schema) - <|> pure [] - ) - <*> newConvQualifiedUsers - .= ( fieldWithDocModifier - "qualified_users" - (description ?~ qualifiedUsersDesc) - (array schema) - <|> pure [] - ) - <*> newConvName .= maybe_ (optField "name" schema) - <*> (Set.toList . newConvAccess) - .= (fromMaybe mempty <$> optField "access" (Set.fromList <$> array schema)) - <*> newConvAccessRoles .= accessRolesSchemaOpt - <*> newConvTeam - .= maybe_ - ( optFieldWithDocModifier - "team" - (description ?~ "Team information of this conversation") - (schema @(ConvTeamInfo v)) - ) - <*> newConvMessageTimer - .= maybe_ - ( optFieldWithDocModifier - "message_timer" - (description ?~ "Per-conversation message timer") - schema - ) - <*> newConvReceiptMode .= maybe_ (optField "receipt_mode" schema) - <*> newConvUsersRole - .= ( fieldWithDocModifier "conversation_role" (description ?~ usersRoleDesc) schema - <|> pure roleNameWireAdmin - ) - <*> newConvProtocol .= protocolTagSchema - <*> newConvCreatorClient .= maybe_ (optField "creator_client" schema) - where - usersDesc = - "List of user IDs (excluding the requestor) to be \ - \part of this conversation (deprecated)" - qualifiedUsersDesc = - "List of qualified user IDs (excluding the requestor) \ - \to be part of this conversation" - usersRoleDesc :: Text - usersRoleDesc = - cs $ - "The conversation permissions the users \ - \added in this request should have. \ - \Optional, defaults to '" - <> show roleNameWireAdmin - <> "' if unset." - --- FUTUREWORK: The version tag type argument can be dropped as soon as versions --- below V2 are not supported any more. -newtype ConvTeamInfo (v :: *) = ConvTeamInfo + deriving (Arbitrary) via (GenericUniform NewConv) + deriving (FromJSON, ToJSON, S.ToSchema) via (Schema NewConv) + +instance ToSchema NewConv where + schema = + objectWithDocModifier + "NewConv" + (description ?~ "JSON object to create a new conversation. When using 'qualified_users' (preferred), you can omit 'users'") + $ NewConv + <$> newConvUsers + .= ( fieldWithDocModifier + "users" + (description ?~ usersDesc) + (array schema) + <|> pure [] + ) + <*> newConvQualifiedUsers + .= ( fieldWithDocModifier + "qualified_users" + (description ?~ qualifiedUsersDesc) + (array schema) + <|> pure [] + ) + <*> newConvName .= maybe_ (optField "name" schema) + <*> (Set.toList . newConvAccess) + .= (fromMaybe mempty <$> optField "access" (Set.fromList <$> array schema)) + <*> newConvAccessRoles .= accessRolesSchemaOpt + <*> newConvTeam + .= maybe_ + ( optFieldWithDocModifier + "team" + (description ?~ "Team information of this conversation") + schema + ) + <*> newConvMessageTimer + .= maybe_ + ( optFieldWithDocModifier + "message_timer" + (description ?~ "Per-conversation message timer") + schema + ) + <*> newConvReceiptMode .= maybe_ (optField "receipt_mode" schema) + <*> newConvUsersRole + .= ( fieldWithDocModifier "conversation_role" (description ?~ usersRoleDesc) schema + <|> pure roleNameWireAdmin + ) + <*> newConvProtocol .= protocolTagSchema + <*> newConvCreatorClient .= maybe_ (optField "creator_client" schema) + where + usersDesc = + "List of user IDs (excluding the requestor) to be \ + \part of this conversation (deprecated)" + qualifiedUsersDesc = + "List of qualified user IDs (excluding the requestor) \ + \to be part of this conversation" + usersRoleDesc :: Text + usersRoleDesc = + cs $ + "The conversation permissions the users \ + \added in this request should have. \ + \Optional, defaults to '" + <> show roleNameWireAdmin + <> "' if unset." + +newtype ConvTeamInfo = ConvTeamInfo { cnvTeamId :: TeamId } deriving stock (Eq, Show, Generic) - deriving (Arbitrary) via (GenericUniform (ConvTeamInfo v)) - -deriving via - Schema (ConvTeamInfo (Until 'V2)) - instance - FromJSON (ConvTeamInfo (Until 'V2)) - -deriving via - Schema (ConvTeamInfo (Until 'V2)) - instance - ToJSON (ConvTeamInfo (Until 'V2)) - -deriving via - Schema (ConvTeamInfo (From 'V2)) - instance - FromJSON (ConvTeamInfo (From 'V2)) - -deriving via - Schema (ConvTeamInfo (From 'V2)) - instance - ToJSON (ConvTeamInfo (From 'V2)) - -deriving via - Schema (ConvTeamInfo (Until 'V2)) - instance - S.ToSchema (ConvTeamInfo (Until 'V2)) - -deriving via - Schema (ConvTeamInfo (From 'V2)) - instance - S.ToSchema (ConvTeamInfo (From 'V2)) - -instance ToSchema (ConvTeamInfo (Until 'V2)) where + deriving (Arbitrary) via (GenericUniform ConvTeamInfo) + deriving (FromJSON, ToJSON, S.ToSchema) via (Schema ConvTeamInfo) + +instance ToSchema ConvTeamInfo where schema = objectWithDocModifier "ConvTeamInfo" @@ -813,19 +740,13 @@ instance ToSchema (ConvTeamInfo (Until 'V2)) where c :: ToJSON a => a -> ValueSchema SwaggerDoc () c val = mkSchema mempty (const (pure ())) (const (pure (toJSON val))) -instance ToSchema (ConvTeamInfo (From 'V2)) where - schema = - objectWithDocModifier - "ConvTeamInfo" - (description ?~ "Team information") - $ ConvTeamInfo - <$> cnvTeamId .= field "teamid" schema - modelTeamInfo :: Doc.Model modelTeamInfo = Doc.defineModel "TeamInfo" $ do Doc.description "Team information" Doc.property "teamid" Doc.bytes' $ Doc.description "Team ID" + Doc.property "managed" Doc.bool' $ + Doc.description "(Not parsed any more) Is this a managed team conversation?" -------------------------------------------------------------------------------- -- invite diff --git a/libs/wire-api/src/Wire/API/Routes/Public/Galley.hs b/libs/wire-api/src/Wire/API/Routes/Public/Galley.hs index 86f89015634..44c9b6df0ac 100644 --- a/libs/wire-api/src/Wire/API/Routes/Public/Galley.hs +++ b/libs/wire-api/src/Wire/API/Routes/Public/Galley.hs @@ -309,27 +309,9 @@ type ConversationAPI = :> QueryParam' [Required, Strict] "code" Code.Value :> Get '[Servant.JSON] ConversationCoverView ) - :<|> Named - "create-group-conversation-v1" - ( Summary "Create a new conversation" - :> Until 'V2 - :> CanThrow 'ConvAccessDenied - :> CanThrow 'MLSNonEmptyMemberList - :> CanThrow 'NotConnected - :> CanThrow 'NotATeamMember - :> CanThrow OperationDenied - :> CanThrow 'MissingLegalholdConsent - :> Description "This returns 201 when a new conversation is created, and 200 when the conversation already existed" - :> ZLocalUser - :> ZConn - :> "conversations" - :> ReqBody '[Servant.JSON] (NewConv (Until 'V2)) - :> ConversationVerb - ) :<|> Named "create-group-conversation" ( Summary "Create a new conversation" - :> From 'V2 :> CanThrow 'ConvAccessDenied :> CanThrow 'MLSNonEmptyMemberList :> CanThrow 'NotConnected @@ -340,7 +322,7 @@ type ConversationAPI = :> ZLocalUser :> ZConn :> "conversations" - :> ReqBody '[Servant.JSON] (NewConv (From 'V2)) + :> ReqBody '[Servant.JSON] NewConv :> ConversationVerb ) :<|> Named @@ -354,33 +336,9 @@ type ConversationAPI = -- This endpoint can lead to the following events being sent: -- - ConvCreate event to members -- TODO: add note: "On 201, the conversation ID is the `Location` header" - :<|> Named - "create-one-to-one-conversation-v1" - ( Summary "Create a 1:1 conversation" - :> Until 'V2 - :> CanThrow 'ConvAccessDenied - :> CanThrow 'InvalidOperation - :> CanThrow 'NoBindingTeamMembers - :> CanThrow 'NonBindingTeam - :> CanThrow 'NotATeamMember - :> CanThrow 'NotConnected - :> CanThrow OperationDenied - :> CanThrow 'TeamNotFound - :> CanThrow 'MissingLegalholdConsent - :> ZLocalUser - :> ZConn - :> "conversations" - :> "one2one" - :> ReqBody '[Servant.JSON] (NewConv (Until 'V2)) - :> ConversationVerb - ) - -- This endpoint can lead to the following events being sent: - -- - ConvCreate event to members - -- TODO: add note: "On 201, the conversation ID is the `Location` header" :<|> Named "create-one-to-one-conversation" ( Summary "Create a 1:1 conversation" - :> From 'V2 :> CanThrow 'ConvAccessDenied :> CanThrow 'InvalidOperation :> CanThrow 'NoBindingTeamMembers @@ -394,7 +352,7 @@ type ConversationAPI = :> ZConn :> "conversations" :> "one2one" - :> ReqBody '[Servant.JSON] (NewConv (From 'V2)) + :> ReqBody '[Servant.JSON] NewConv :> ConversationVerb ) -- This endpoint can lead to the following events being sent: diff --git a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated.hs index 741b9cd78b7..95788e338fe 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated.hs @@ -235,7 +235,6 @@ import qualified Test.Wire.API.Golden.Generated.WithStatusPatch_team import qualified Test.Wire.API.Golden.Generated.WithStatus_team import qualified Test.Wire.API.Golden.Generated.Wrapped_20_22some_5fint_22_20Int_user import Test.Wire.API.Golden.Runner -import Wire.API.Routes.Version tests :: TestTree tests = @@ -388,15 +387,11 @@ tests = [ (Test.Wire.API.Golden.Generated.Conversation_user.testObject_Conversation_user_1, "testObject_Conversation_user_1.json"), (Test.Wire.API.Golden.Generated.Conversation_user.testObject_Conversation_user_2, "testObject_Conversation_user_2.json") ], - testGroup "Golden: NewConv_user (Until 'V2)" $ + testGroup "Golden: NewConv_user" $ testObjects - [ (Test.Wire.API.Golden.Generated.NewConv_user.testObject_NewConv_user_1_2 @(Until 'V2), "testObject_NewConv_user_1.json"), + [ (Test.Wire.API.Golden.Generated.NewConv_user.testObject_NewConv_user_1, "testObject_NewConv_user_1.json"), (Test.Wire.API.Golden.Generated.NewConv_user.testObject_NewConv_user_3, "testObject_NewConv_user_3.json") ], - testGroup "Golden: NewConv_user (From 'V2)" $ - testObjects - [ (Test.Wire.API.Golden.Generated.NewConv_user.testObject_NewConv_user_1_2 @(From 'V2), "testObject_NewConv_user_2.json") - ], testGroup "Golden: ConversationList_20_28Id_20_2a_20C_29_user" $ testObjects [ ( Test.Wire.API.Golden.Generated.ConversationList_20_28Id_20_2a_20C_29_user.testObject_ConversationList_20_28Id_20_2a_20C_29_user_1, @@ -441,13 +436,9 @@ tests = [ (Test.Wire.API.Golden.Generated.ReceiptMode_user.testObject_ReceiptMode_user_1, "testObject_ReceiptMode_user_1.json"), (Test.Wire.API.Golden.Generated.ReceiptMode_user.testObject_ReceiptMode_user_2, "testObject_ReceiptMode_user_2.json") ], - testGroup "Golden: ConvTeamInfo_user (Until 'V2)" $ - testObjects - [ (Test.Wire.API.Golden.Generated.ConvTeamInfo_user.testObject_ConvTeamInfo_user_1_2 @(Until 'V2), "testObject_ConvTeamInfo_user_1.json") - ], - testGroup "Golden: ConvTeamInfo_user (From 'V2)" $ + testGroup "Golden: ConvTeamInfo_user" $ testObjects - [ (Test.Wire.API.Golden.Generated.ConvTeamInfo_user.testObject_ConvTeamInfo_user_1_2 @(From 'V2), "testObject_ConvTeamInfo_user_2.json") + [ (Test.Wire.API.Golden.Generated.ConvTeamInfo_user.testObject_ConvTeamInfo_user_1, "testObject_ConvTeamInfo_user_1.json") ], testGroup "Golden: Invite_user" $ testObjects diff --git a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/ConvTeamInfo_user.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/ConvTeamInfo_user.hs index 7b7a3cfb52d..bbd2b16e299 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/ConvTeamInfo_user.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/ConvTeamInfo_user.hs @@ -22,8 +22,8 @@ import qualified Data.UUID as UUID (fromString) import Imports (fromJust) import Wire.API.Conversation (ConvTeamInfo (..)) -testObject_ConvTeamInfo_user_1_2 :: ConvTeamInfo v -testObject_ConvTeamInfo_user_1_2 = +testObject_ConvTeamInfo_user_1 :: ConvTeamInfo +testObject_ConvTeamInfo_user_1 = ConvTeamInfo { cnvTeamId = Id (fromJust (UUID.fromString "0000003f-0000-0059-0000-002200000028")) } diff --git a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/NewConv_user.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/NewConv_user.hs index ca52763bcb8..571060d758e 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/NewConv_user.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/NewConv_user.hs @@ -32,8 +32,8 @@ import Wire.API.Conversation.Role testDomain :: Domain testDomain = Domain "testdomain.example.com" -testObject_NewConv_user_1_2 :: NewConv v -testObject_NewConv_user_1_2 = +testObject_NewConv_user_1 :: NewConv +testObject_NewConv_user_1 = NewConv { newConvUsers = [ Id (fromJust (UUID.fromString "00000001-0000-0000-0000-000000000001")), @@ -56,7 +56,7 @@ testObject_NewConv_user_1_2 = newConvCreatorClient = Nothing } -testObject_NewConv_user_3 :: NewConv v +testObject_NewConv_user_3 :: NewConv testObject_NewConv_user_3 = NewConv { newConvUsers = [], diff --git a/libs/wire-api/test/golden/testObject_ConvTeamInfo_user_2.json b/libs/wire-api/test/golden/testObject_ConvTeamInfo_user_2.json deleted file mode 100644 index 2e440e25997..00000000000 --- a/libs/wire-api/test/golden/testObject_ConvTeamInfo_user_2.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "teamid": "0000003f-0000-0059-0000-002200000028" -} diff --git a/libs/wire-api/test/golden/testObject_NewConv_user_2.json b/libs/wire-api/test/golden/testObject_NewConv_user_2.json deleted file mode 100644 index 550a2b4de51..00000000000 --- a/libs/wire-api/test/golden/testObject_NewConv_user_2.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "access": [ - "private", - "invite" - ], - "access_role": "non_activated", - "access_role_v2": [ - "team_member", - "guest" - ], - "conversation_role": "8tp2gs7b6", - "message_timer": 3320987366258987, - "protocol": "proteus", - "qualified_users": [], - "receipt_mode": 1, - "team": { - "teamid": "00000000-0000-0001-0000-000000000000" - }, - "users": [ - "00000001-0000-0000-0000-000000000001", - "00000000-0000-0000-0000-000000000000" - ] -} diff --git a/libs/wire-api/test/unit/Test/Wire/API/Roundtrip/Aeson.hs b/libs/wire-api/test/unit/Test/Wire/API/Roundtrip/Aeson.hs index dec698d6ef8..5ff1373d5f6 100644 --- a/libs/wire-api/test/unit/Test/Wire/API/Roundtrip/Aeson.hs +++ b/libs/wire-api/test/unit/Test/Wire/API/Roundtrip/Aeson.hs @@ -103,8 +103,7 @@ tests = testRoundTrip @Conversation.AccessRoleV2, testRoundTrip @Conversation.ConvType, testRoundTrip @Conversation.ReceiptMode, - testRoundTrip @(Conversation.ConvTeamInfo (Until 'V2)), - testRoundTrip @(Conversation.ConvTeamInfo (From 'V2)), + testRoundTrip @Conversation.ConvTeamInfo, testRoundTrip @Conversation.ConversationCoverView, testRoundTrip @Conversation.Invite, testRoundTrip @Conversation.ConversationRename, diff --git a/services/galley/src/Galley/API/Create.hs b/services/galley/src/Galley/API/Create.hs index 13494c4f780..85fd3e3c00b 100644 --- a/services/galley/src/Galley/API/Create.hs +++ b/services/galley/src/Galley/API/Create.hs @@ -104,7 +104,7 @@ createGroupConversation :: r => Local UserId -> ConnId -> - NewConv v -> + NewConv -> Sem r ConversationResponse createGroupConversation lusr conn newConv = do (nc, fromConvSize -> allUsers) <- newRegularConversation lusr newConv @@ -148,8 +148,8 @@ checkCreateConvPermissions :: ] r => Local UserId -> - NewConv v -> - Maybe (ConvTeamInfo v) -> + NewConv -> + Maybe ConvTeamInfo -> UserList UserId -> Sem r () checkCreateConvPermissions lusr _newConv Nothing allUsers = @@ -203,7 +203,7 @@ createSelfConversation lusr = do conversationCreated lusr c createOne2OneConversation :: - forall r v. + forall r. Members '[ BrigAccess, ConversationStore, @@ -229,7 +229,7 @@ createOne2OneConversation :: r => Local UserId -> ConnId -> - NewConv v -> + NewConv -> Sem r ConversationResponse createOne2OneConversation lusr zcon j = do let allUsers = newConvMembers lusr j @@ -485,7 +485,7 @@ createConnectConversation lusr conn j = do newRegularConversation :: Members '[ErrorS 'MLSNonEmptyMemberList, Error InvalidInput, Input Opts] r => Local UserId -> - NewConv v -> + NewConv -> Sem r (NewConversation, ConvSizeChecked UserList UserId) newRegularConversation lusr newConv = do o <- input @@ -579,15 +579,15 @@ toUUIDs a b = do b' <- U.fromUUID (toUUID b) & note InvalidUUID4 pure (a', b') -accessRoles :: NewConv v -> Set AccessRoleV2 +accessRoles :: NewConv -> Set AccessRoleV2 accessRoles b = fromMaybe Data.defRole (newConvAccessRoles b) -access :: NewConv v -> [Access] +access :: NewConv -> [Access] access a = case Set.toList (newConvAccess a) of [] -> Data.defRegularConvAccess (x : xs) -> x : xs -newConvMembers :: Local x -> NewConv v -> UserList UserId +newConvMembers :: Local x -> NewConv -> UserList UserId newConvMembers loc body = UserList (newConvUsers body) [] <> toUserList loc (newConvQualifiedUsers body) diff --git a/services/galley/src/Galley/API/Public/Servant.hs b/services/galley/src/Galley/API/Public/Servant.hs index f5665a37065..ff573d56ff4 100644 --- a/services/galley/src/Galley/API/Public/Servant.hs +++ b/services/galley/src/Galley/API/Public/Servant.hs @@ -55,10 +55,8 @@ servantSitemap = <@> mkNamedAPI @"list-conversations-v1" listConversations <@> mkNamedAPI @"list-conversations" listConversations <@> mkNamedAPI @"get-conversation-by-reusable-code" (getConversationByReusableCode @Cassandra) - <@> mkNamedAPI @"create-group-conversation-v1" createGroupConversation <@> mkNamedAPI @"create-group-conversation" createGroupConversation <@> mkNamedAPI @"create-self-conversation" createSelfConversation - <@> mkNamedAPI @"create-one-to-one-conversation-v1" createOne2OneConversation <@> mkNamedAPI @"create-one-to-one-conversation" createOne2OneConversation <@> mkNamedAPI @"add-members-to-conversation-unqualified" addMembersUnqualified <@> mkNamedAPI @"add-members-to-conversation-unqualified2" addMembersUnqualifiedV2 diff --git a/services/galley/src/Galley/Cassandra/Instances.hs b/services/galley/src/Galley/Cassandra/Instances.hs index 3e0f9890527..a0dce48efdc 100644 --- a/services/galley/src/Galley/Cassandra/Instances.hs +++ b/services/galley/src/Galley/Cassandra/Instances.hs @@ -113,7 +113,7 @@ instance Cql AccessRoleV2 where n -> Left $ "Unexpected AccessRoleV2 value: " ++ show n fromCql _ = Left "AccessRoleV2 value: int expected" -instance Cql (ConvTeamInfo v) where +instance Cql ConvTeamInfo where ctype = Tagged $ UdtColumn "teaminfo" [("teamid", UuidColumn), ("managed", BooleanColumn)] toCql t = CqlUdt [("teamid", toCql (cnvTeamId t)), ("managed", toCql False)] diff --git a/services/galley/test/integration/API.hs b/services/galley/test/integration/API.hs index 9c270396176..b6fc4c9aa14 100644 --- a/services/galley/test/integration/API.hs +++ b/services/galley/test/integration/API.hs @@ -98,7 +98,6 @@ import Wire.API.Message import qualified Wire.API.Message as Message import Wire.API.Routes.MultiTablePaging import Wire.API.Routes.Named -import Wire.API.Routes.Version import qualified Wire.API.Team.Feature as Public import qualified Wire.API.Team.Member as Teams import Wire.API.User @@ -2043,20 +2042,8 @@ postConvQualifiedFederationNotEnabled = do -- FUTUREWORK: figure out how to use functions in the TestM monad inside withSettingsOverrides and remove this duplication postConvHelper :: (MonadIO m, MonadHttp m) => (Request -> Request) -> UserId -> [Qualified UserId] -> m ResponseLBS postConvHelper g zusr newUsers = do - let conv :: NewConv (From 'V2) = - NewConv - [] - newUsers - (checked "gossip") - (Set.fromList []) - Nothing - Nothing - Nothing - Nothing - roleNameWireAdmin - ProtocolProteusTag - Nothing - post $ g . path "/v2/conversations" . zUser zusr . zConn "conn" . zType "access" . json conv + let conv = NewConv [] newUsers (checked "gossip") (Set.fromList []) Nothing Nothing Nothing Nothing roleNameWireAdmin ProtocolProteusTag Nothing + post $ g . path "/conversations" . zUser zusr . zConn "conn" . zType "access" . json conv postSelfConvOk :: TestM () postSelfConvOk = do @@ -2084,20 +2071,8 @@ postConvO2OFailWithSelf :: TestM () postConvO2OFailWithSelf = do g <- view tsGalley alice <- randomUser - let inv :: NewConv (From 'V2) = - NewConv - [alice] - [] - Nothing - mempty - Nothing - Nothing - Nothing - Nothing - roleNameWireAdmin - ProtocolProteusTag - Nothing - post (g . path "/v2/conversations/one2one" . zUser alice . zConn "conn" . zType "access" . json inv) !!! do + let inv = NewConv [alice] [] Nothing mempty Nothing Nothing Nothing Nothing roleNameWireAdmin ProtocolProteusTag Nothing + post (g . path "/conversations/one2one" . zUser alice . zConn "conn" . zType "access" . json inv) !!! do const 403 === statusCode const (Just "invalid-op") === fmap label . responseJsonUnsafe diff --git a/services/galley/test/integration/API/MLS/Util.hs b/services/galley/test/integration/API/MLS/Util.hs index 35072870d2d..5e3feaae1f7 100644 --- a/services/galley/test/integration/API/MLS/Util.hs +++ b/services/galley/test/integration/API/MLS/Util.hs @@ -69,7 +69,7 @@ data CreateConv = CreateConv | CreateProteusConv | DontCreateConv data UserOrigin = LocalUser | RemoteUser Domain -createNewConv :: ClientId -> CreateConv -> Maybe (NewConv v) +createNewConv :: ClientId -> CreateConv -> Maybe NewConv createNewConv c CreateConv = Just (defNewMLSConv c) createNewConv _ CreateProteusConv = Just defNewProteusConv createNewConv _ DontCreateConv = Nothing diff --git a/services/galley/test/integration/API/Util.hs b/services/galley/test/integration/API/Util.hs index fe755495c06..e24b608ca88 100644 --- a/services/galley/test/integration/API/Util.hs +++ b/services/galley/test/integration/API/Util.hs @@ -484,7 +484,7 @@ getInvitationCode t ref = do createTeamConvLegacy :: HasCallStack => UserId -> TeamId -> [UserId] -> Maybe Text -> TestM ConvId createTeamConvLegacy u tid us name = do g <- view tsGalley - let tinfo :: ConvTeamInfo (Until 'V2) = ConvTeamInfo tid + let tinfo = ConvTeamInfo tid let convPayload = object [ "users" .= us, @@ -493,7 +493,7 @@ createTeamConvLegacy u tid us name = do ] post ( g - . path "/v1/conversations" + . path "/conversations" . zUser u . zConn "conn" . zType "access" @@ -552,11 +552,11 @@ createTeamConvAccessRaw :: createTeamConvAccessRaw u tid us name acc role mtimer convRole = do g <- view tsGalley let tinfo = ConvTeamInfo tid - let conv :: NewConv (From 'V2) = + let conv = NewConv us [] (name >>= checked) (fromMaybe (Set.fromList []) acc) role (Just tinfo) mtimer Nothing (fromMaybe roleNameWireAdmin convRole) ProtocolProteusTag Nothing post ( g - . path "/v2/conversations" + . path "/conversations" . zUser u . zConn "conn" . zType "access" @@ -578,7 +578,7 @@ createMLSTeamConv :: m (Local ConvId) createMLSTeamConv lusr c tid users name access role timer convRole = do g <- viewGalley - let conv :: NewConv (From 'V2) = + let conv = NewConv { newConvUsers = [], newConvQualifiedUsers = ulAll lusr users, @@ -595,7 +595,7 @@ createMLSTeamConv lusr c tid users name access role timer convRole = do r <- post ( g - . path "/v2/conversations" + . path "/conversations" . zUser (tUnqualified lusr) . zConn "conn" . zType "access" @@ -619,20 +619,9 @@ updateTeamConv zusr convid upd = do createOne2OneTeamConv :: UserId -> UserId -> Maybe Text -> TeamId -> TestM ResponseLBS createOne2OneTeamConv u1 u2 n tid = do g <- view tsGalley - let conv :: NewConv (From 'V2) = - NewConv - [u2] - [] - (n >>= checked) - mempty - Nothing - (Just $ ConvTeamInfo tid) - Nothing - Nothing - roleNameWireAdmin - ProtocolProteusTag - Nothing - post $ g . path "/v2/conversations/one2one" . zUser u1 . zConn "conn" . zType "access" . json conv + let conv = + NewConv [u2] [] (n >>= checked) mempty Nothing (Just $ ConvTeamInfo tid) Nothing Nothing roleNameWireAdmin ProtocolProteusTag Nothing + post $ g . path "/conversations/one2one" . zUser u1 . zConn "conn" . zType "access" . json conv postConv :: UserId -> @@ -644,10 +633,10 @@ postConv :: TestM ResponseLBS postConv u us name a r mtimer = postConvWithRole u us name a r mtimer roleNameWireAdmin -defNewProteusConv :: NewConv v +defNewProteusConv :: NewConv defNewProteusConv = NewConv [] [] Nothing mempty Nothing Nothing Nothing Nothing roleNameWireAdmin ProtocolProteusTag Nothing -defNewMLSConv :: ClientId -> NewConv v +defNewMLSConv :: ClientId -> NewConv defNewMLSConv c = defNewProteusConv { newConvProtocol = ProtocolMLSTag, @@ -656,13 +645,13 @@ defNewMLSConv c = postConvQualified :: UserId -> - NewConv (From 'V2) -> + NewConv -> TestM ResponseLBS postConvQualified u n = do g <- viewGalley post $ g - . path "/v2/conversations" + . path "/conversations" . zUser u . zConn "conn" . zType "access" @@ -671,7 +660,7 @@ postConvQualified u n = do postConvWithRemoteUsers :: HasCallStack => UserId -> - NewConv (From 'V2) -> + NewConv -> TestM (Response (Maybe LByteString)) postConvWithRemoteUsers u n = fmap fst $ @@ -686,20 +675,8 @@ postConvWithRemoteUsers u n = postTeamConv :: TeamId -> UserId -> [UserId] -> Maybe Text -> [Access] -> Maybe (Set AccessRoleV2) -> Maybe Milliseconds -> TestM ResponseLBS postTeamConv tid u us name a r mtimer = do g <- view tsGalley - let conv :: NewConv (From 'V2) = - NewConv - us - [] - (name >>= checked) - (Set.fromList a) - r - (Just (ConvTeamInfo tid)) - mtimer - Nothing - roleNameWireAdmin - ProtocolProteusTag - Nothing - post $ g . path "/v2/conversations" . zUser u . zConn "conn" . zType "access" . json conv + let conv = NewConv us [] (name >>= checked) (Set.fromList a) r (Just (ConvTeamInfo tid)) mtimer Nothing roleNameWireAdmin ProtocolProteusTag Nothing + post $ g . path "/conversations" . zUser u . zConn "conn" . zType "access" . json conv deleteTeamConv :: (HasGalley m, MonadIO m, MonadHttp m) => TeamId -> ConvId -> UserId -> m ResponseLBS deleteTeamConv tid convId zusr = do @@ -735,20 +712,8 @@ postConvWithRole u members name access arole timer role = postConvWithReceipt :: UserId -> [UserId] -> Maybe Text -> [Access] -> Maybe (Set AccessRoleV2) -> Maybe Milliseconds -> ReceiptMode -> TestM ResponseLBS postConvWithReceipt u us name a r mtimer rcpt = do g <- view tsGalley - let conv :: NewConv (From 'V2) = - NewConv - us - [] - (name >>= checked) - (Set.fromList a) - r - Nothing - mtimer - (Just rcpt) - roleNameWireAdmin - ProtocolProteusTag - Nothing - post $ g . path "/v2/conversations" . zUser u . zConn "conn" . zType "access" . json conv + let conv = NewConv us [] (name >>= checked) (Set.fromList a) r Nothing mtimer (Just rcpt) roleNameWireAdmin ProtocolProteusTag Nothing + post $ g . path "/conversations" . zUser u . zConn "conn" . zType "access" . json conv postSelfConv :: UserId -> TestM ResponseLBS postSelfConv u = do @@ -758,20 +723,8 @@ postSelfConv u = do postO2OConv :: UserId -> UserId -> Maybe Text -> TestM ResponseLBS postO2OConv u1 u2 n = do g <- view tsGalley - let conv :: NewConv (From 'V2) = - NewConv - [u2] - [] - (n >>= checked) - mempty - Nothing - Nothing - Nothing - Nothing - roleNameWireAdmin - ProtocolProteusTag - Nothing - post $ g . path "/v2/conversations/one2one" . zUser u1 . zConn "conn" . zType "access" . json conv + let conv = NewConv [u2] [] (n >>= checked) mempty Nothing Nothing Nothing Nothing roleNameWireAdmin ProtocolProteusTag Nothing + post $ g . path "/conversations/one2one" . zUser u1 . zConn "conn" . zType "access" . json conv postConnectConv :: UserId -> UserId -> Text -> Text -> Maybe Text -> TestM ResponseLBS postConnectConv a b name msg email = do From 34536b361b8e4f6f7a0592cc96e8ff9e94571280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Dimja=C5=A1evi=C4=87?= Date: Mon, 5 Sep 2022 22:36:50 +0200 Subject: [PATCH 07/14] fixup! Revert NewConv and ConvTeamInfo --- .../Network/Wire/Client/API/Conversation.hs | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/libs/api-client/src/Network/Wire/Client/API/Conversation.hs b/libs/api-client/src/Network/Wire/Client/API/Conversation.hs index 7ed47ed9e9c..da0324b4f7e 100644 --- a/libs/api-client/src/Network/Wire/Client/API/Conversation.hs +++ b/libs/api-client/src/Network/Wire/Client/API/Conversation.hs @@ -48,7 +48,6 @@ import Wire.API.Conversation.Protocol as M import Wire.API.Conversation.Role (roleNameWireAdmin) import Wire.API.Event.Conversation as M (MemberUpdateData) import Wire.API.Message as M -import Wire.API.Routes.Version postOtrMessage :: MonadSession m => ConvId -> NewOtrMessage -> m ClientMismatch postOtrMessage cnv msg = sessionRequest req rsc readBody @@ -138,24 +137,10 @@ createConv :: m Conversation createConv users name = sessionRequest req rsc readBody where - v2 = toByteString' (toLower <$> show V2) req = method POST - . paths [v2, "conversations"] + . path "conversations" . acceptJson - . json - ( NewConv @(From 'V2) - users - [] - (name >>= checked) - mempty - Nothing - Nothing - Nothing - Nothing - roleNameWireAdmin - M.ProtocolProteusTag - Nothing - ) + . json (NewConv users [] (name >>= checked) mempty Nothing Nothing Nothing Nothing roleNameWireAdmin M.ProtocolProteusTag Nothing) $ empty rsc = status201 :| [] From 0a8e47142f63c4b5c4b38e04edf68665ba23e7d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Dimja=C5=A1evi=C4=87?= Date: Mon, 5 Sep 2022 22:45:09 +0200 Subject: [PATCH 08/14] fixup! Revert NewConv and ConvTeamInfo --- .../brig/test/integration/API/Provider.hs | 18 ++---------------- .../brig/test/integration/API/Team/Util.hs | 19 +++---------------- .../test/integration/Federation/End2end.hs | 6 ++---- services/brig/test/integration/Util.hs | 11 ++++------- 4 files changed, 11 insertions(+), 43 deletions(-) diff --git a/services/brig/test/integration/API/Provider.hs b/services/brig/test/integration/API/Provider.hs index 9dd9aadef18..3d3e81803af 100644 --- a/services/brig/test/integration/API/Provider.hs +++ b/services/brig/test/integration/API/Provider.hs @@ -90,7 +90,6 @@ import qualified Wire.API.Provider.Bot as Ext import qualified Wire.API.Provider.External as Ext import Wire.API.Provider.Service import Wire.API.Provider.Service.Tag -import Wire.API.Routes.Version import Wire.API.Team.Feature (featureNameBS) import qualified Wire.API.Team.Feature as Public import Wire.API.Team.Permission @@ -1322,27 +1321,14 @@ createConvWithAccessRoles :: createConvWithAccessRoles ars g u us = post $ g - . paths [v2, "conversations"] + . path "/conversations" . header "Z-User" (toByteString' u) . header "Z-Type" "access" . header "Z-Connection" "conn" . contentJson . body (RequestBodyLBS (encode conv)) where - v2 = toByteString' (toLower <$> show V2) - conv :: NewConv (From 'V2) = - NewConv - us - [] - Nothing - Set.empty - ars - Nothing - Nothing - Nothing - roleNameWireAdmin - ProtocolProteusTag - Nothing + conv = NewConv us [] Nothing Set.empty ars Nothing Nothing Nothing roleNameWireAdmin ProtocolProteusTag Nothing postMessage :: Galley -> diff --git a/services/brig/test/integration/API/Team/Util.hs b/services/brig/test/integration/API/Team/Util.hs index 38ef4fe87f0..64e8120a6e3 100644 --- a/services/brig/test/integration/API/Team/Util.hs +++ b/services/brig/test/integration/API/Team/Util.hs @@ -42,7 +42,6 @@ import Wire.API.Connection import Wire.API.Conversation import Wire.API.Conversation.Protocol import Wire.API.Conversation.Role -import Wire.API.Routes.Version import Wire.API.Team hiding (newTeam) import Wire.API.Team.Feature (FeatureStatus (..)) import qualified Wire.API.Team.Feature as Public @@ -214,24 +213,12 @@ updatePermissions from tid (to, perm) galley = createTeamConv :: HasCallStack => Galley -> TeamId -> UserId -> [UserId] -> Maybe Milliseconds -> Http ConvId createTeamConv g tid u us mtimer = do let tinfo = Just $ ConvTeamInfo tid - let conv :: NewConv (From 'V2) = - NewConv - us - [] - Nothing - (Set.fromList []) - Nothing - tinfo - mtimer - Nothing - roleNameWireAdmin - ProtocolProteusTag - Nothing - v2 = toByteString' (toLower <$> show V2) + let conv = + NewConv us [] Nothing (Set.fromList []) Nothing tinfo mtimer Nothing roleNameWireAdmin ProtocolProteusTag Nothing r <- post ( g - . paths [v2, "conversations"] + . path "/conversations" . zUser u . zConn "conn" . contentJson diff --git a/services/brig/test/integration/Federation/End2end.hs b/services/brig/test/integration/Federation/End2end.hs index a2e431986ed..cd668f00283 100644 --- a/services/brig/test/integration/Federation/End2end.hs +++ b/services/brig/test/integration/Federation/End2end.hs @@ -65,7 +65,6 @@ import Wire.API.MLS.KeyPackage import Wire.API.MLS.Serialisation import Wire.API.Message import Wire.API.Routes.MultiTablePaging -import Wire.API.Routes.Version import Wire.API.User hiding (assetKey) import Wire.API.User.Client import Wire.API.User.Client.Prekey @@ -263,7 +262,7 @@ testAddRemoteUsersToLocalConv brig1 galley1 brig2 galley2 = do alice <- randomUser brig1 bob <- randomUser brig2 - let newConv :: NewConv (From 'V2) = + let newConv = NewConv [] [] @@ -276,12 +275,11 @@ testAddRemoteUsersToLocalConv brig1 galley1 brig2 galley2 = do roleNameWireAdmin ProtocolProteusTag Nothing - v2 = toByteString' (toLower <$> show V2) convId <- fmap cnvQualifiedId . responseJsonError =<< post ( galley1 - . paths [v2, "conversations"] + . path "/conversations" . zUser (userId alice) . zConn "conn" . header "Z-Type" "access" diff --git a/services/brig/test/integration/Util.hs b/services/brig/test/integration/Util.hs index 0363021ff22..42db733b757 100644 --- a/services/brig/test/integration/Util.hs +++ b/services/brig/test/integration/Util.hs @@ -111,7 +111,6 @@ import Wire.API.Federation.API import Wire.API.Federation.Domain import Wire.API.Internal.Notification import Wire.API.Routes.MultiTablePaging -import Wire.API.Routes.Version import Wire.API.Team.Member hiding (userId) import Wire.API.User import Wire.API.User.Activation @@ -685,7 +684,7 @@ getConversationQualified galley usr cnv = createMLSConversation :: (MonadIO m, MonadHttp m) => Galley -> UserId -> ClientId -> m ResponseLBS createMLSConversation galley zusr c = do - let conv :: NewConv (From 'V2) = + let conv = NewConv [] mempty @@ -698,17 +697,16 @@ createMLSConversation galley zusr c = do roleNameWireAdmin ProtocolMLSTag (Just c) - v2 = toByteString' (toLower <$> show V2) post $ galley - . paths [v2, "conversations"] + . path "/conversations" . zUser zusr . zConn "conn" . json conv createConversation :: (MonadIO m, MonadHttp m) => Galley -> UserId -> [Qualified UserId] -> m ResponseLBS createConversation galley zusr usersToAdd = do - let conv :: NewConv (From 'V2) = + let conv = NewConv [] usersToAdd @@ -721,10 +719,9 @@ createConversation galley zusr usersToAdd = do roleNameWireAdmin ProtocolProteusTag Nothing - v2 = toByteString' (toLower <$> show V2) post $ galley - . paths [v2, "conversations"] + . path "/conversations" . zUser zusr . zConn "conn" . json conv From 73d2e0a38931dd8954c557c744eea533937f870f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Dimja=C5=A1evi=C4=87?= Date: Wed, 7 Sep 2022 14:36:01 +0200 Subject: [PATCH 09/14] Improve a comment --- libs/wire-api/src/Wire/API/Team/Conversation.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/wire-api/src/Wire/API/Team/Conversation.hs b/libs/wire-api/src/Wire/API/Team/Conversation.hs index ffe0508f82f..9bc61dbeaea 100644 --- a/libs/wire-api/src/Wire/API/Team/Conversation.hs +++ b/libs/wire-api/src/Wire/API/Team/Conversation.hs @@ -51,6 +51,7 @@ import Wire.Arbitrary (Arbitrary, GenericUniform (..)) -- FUTUREWORK: The version tag type argument can be dropped as soon as versions -- below V2 are not supported any more. +-- Derivation of various JSON instances is verbose with this version tag type variable, but this can be simplified once the old version can be dropped. newtype TeamConversation (v :: *) = TeamConversation { _conversationId :: ConvId } From ab15e40d9db575fa988b0b9f20aa99e79f6e3d24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Dimja=C5=A1evi=C4=87?= Date: Wed, 7 Sep 2022 14:37:34 +0200 Subject: [PATCH 10/14] Add a comment about showing a version --- services/brig/src/Brig/IO/Intra.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/services/brig/src/Brig/IO/Intra.hs b/services/brig/src/Brig/IO/Intra.hs index 1c627f074c1..ff31704967b 100644 --- a/services/brig/src/Brig/IO/Intra.hs +++ b/services/brig/src/Brig/IO/Intra.hs @@ -954,6 +954,7 @@ getTeamConv usr tid cnv = do 200 -> Just <$> decodeBody "galley" rs _ -> pure Nothing where + -- Ensure we get a type error, and not a runtime error once we drop V2. v2 = toByteString' (toLower <$> show V2) req = paths From 9bc90708559c4d7c6f7dc4340d94e534c7b230c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Dimja=C5=A1evi=C4=87?= Date: Wed, 7 Sep 2022 14:52:48 +0200 Subject: [PATCH 11/14] Drop an unnecessary GHC option (no forall's) --- services/galley/src/Galley/API/Internal.hs | 3 +-- services/galley/src/Galley/API/Teams.hs | 5 +---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/services/galley/src/Galley/API/Internal.hs b/services/galley/src/Galley/API/Internal.hs index aad0225ce6e..120845565a8 100644 --- a/services/galley/src/Galley/API/Internal.hs +++ b/services/galley/src/Galley/API/Internal.hs @@ -104,7 +104,6 @@ import Wire.API.Routes.MultiVerb import Wire.API.Routes.Named import Wire.API.Routes.Public import Wire.API.Routes.Public.Galley -import Wire.API.Routes.Version import Wire.API.Team import Wire.API.Team.Feature import Wire.API.Team.Member @@ -767,7 +766,7 @@ deleteLoop = do doDelete usr con tid = do lusr <- qualifyLocal usr - Teams.uncheckedDeleteTeam @(From 'V2) lusr con tid + Teams.uncheckedDeleteTeam lusr con tid safeForever :: String -> App () -> App () safeForever funName action = diff --git a/services/galley/src/Galley/API/Teams.hs b/services/galley/src/Galley/API/Teams.hs index 7c72bbbff01..d0dcf1f40b1 100644 --- a/services/galley/src/Galley/API/Teams.hs +++ b/services/galley/src/Galley/API/Teams.hs @@ -15,9 +15,6 @@ -- You should have received a copy of the GNU Affero General Public License along -- with this program. If not, see . {-# LANGUAGE LambdaCase #-} --- NOTE: GHC incorrectly infers that the 'v' type variable in the signature of --- 'uncheckedDeleteTeam' is unused. -{-# OPTIONS_GHC -Wno-unused-foralls #-} module Galley.API.Teams ( createBindingTeam, @@ -400,7 +397,7 @@ internalDeleteBindingTeam tid force = do -- This function is "unchecked" because it does not validate that the user has the `DeleteTeam` permission. uncheckedDeleteTeam :: - forall (v :: *) r. + forall r. Members '[ BrigAccess, ExternalAccess, From 682cacb5faf14254915b8878b2b8c46e037b3b8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Dimja=C5=A1evi=C4=87?= Date: Thu, 8 Sep 2022 15:53:07 +0200 Subject: [PATCH 12/14] Drop version tags from team conversation types --- .../src/Wire/API/Routes/Public/Galley.hs | 32 +----- .../src/Wire/API/Team/Conversation.hs | 100 +++--------------- .../golden/Test/Wire/API/Golden/Generated.hs | 30 +++--- .../Generated/TeamConversationList_team.hs | 27 +++-- .../Golden/Generated/TeamConversation_team.hs | 9 +- ...stObject_TeamConversationList_team_1.json} | 0 ...stObject_TeamConversationList_team_2.json} | 6 +- ...> testObject_TeamConversation_team_1.json} | 0 .../testObject_TeamConversation_team_2.json | 4 + ...tObject_TeamConversation_team_from_v2.json | 3 - .../unit/Test/Wire/API/Roundtrip/Aeson.hs | 7 +- services/brig/src/Brig/IO/Intra.hs | 13 +-- .../galley/src/Galley/API/Public/Servant.hs | 2 - services/galley/src/Galley/API/Teams.hs | 6 +- services/galley/src/Galley/Cassandra/Team.hs | 8 +- .../galley/src/Galley/Effects/TeamStore.hs | 4 +- 16 files changed, 67 insertions(+), 184 deletions(-) rename libs/wire-api/test/golden/{testObject_TeamConversationList_team_until_v2.json => testObject_TeamConversationList_team_1.json} (100%) rename libs/wire-api/test/golden/{testObject_TeamConversationList_team_from_v2.json => testObject_TeamConversationList_team_2.json} (75%) rename libs/wire-api/test/golden/{testObject_TeamConversation_team_until_v2.json => testObject_TeamConversation_team_1.json} (100%) create mode 100644 libs/wire-api/test/golden/testObject_TeamConversation_team_2.json delete mode 100644 libs/wire-api/test/golden/testObject_TeamConversation_team_from_v2.json diff --git a/libs/wire-api/src/Wire/API/Routes/Public/Galley.hs b/libs/wire-api/src/Wire/API/Routes/Public/Galley.hs index 44c9b6df0ac..719fc9b33fc 100644 --- a/libs/wire-api/src/Wire/API/Routes/Public/Galley.hs +++ b/libs/wire-api/src/Wire/API/Routes/Public/Galley.hs @@ -873,48 +873,20 @@ type TeamConversationAPI = :> "roles" :> Get '[Servant.JSON] ConversationRolesList ) - :<|> Named - "get-team-conversations-v1" - ( Summary "Get team conversations" - :> Until 'V2 - :> CanThrow OperationDenied - :> CanThrow 'NotATeamMember - :> ZUser - :> "teams" - :> Capture "tid" TeamId - :> "conversations" - :> Get '[Servant.JSON] (TeamConversationList (Until 'V2)) - ) :<|> Named "get-team-conversations" ( Summary "Get team conversations" - :> From 'V2 - :> CanThrow OperationDenied - :> CanThrow 'NotATeamMember - :> ZUser - :> "teams" - :> Capture "tid" TeamId - :> "conversations" - :> Get '[Servant.JSON] (TeamConversationList (From 'V2)) - ) - :<|> Named - "get-team-conversation-v1" - ( Summary "Get one team conversation" - :> Until 'V2 - :> CanThrow 'ConvNotFound :> CanThrow OperationDenied :> CanThrow 'NotATeamMember :> ZUser :> "teams" :> Capture "tid" TeamId :> "conversations" - :> Capture "cid" ConvId - :> Get '[Servant.JSON] (TeamConversation (Until 'V2)) + :> Get '[Servant.JSON] TeamConversationList ) :<|> Named "get-team-conversation" ( Summary "Get one team conversation" - :> From 'V2 :> CanThrow 'ConvNotFound :> CanThrow OperationDenied :> CanThrow 'NotATeamMember @@ -923,7 +895,7 @@ type TeamConversationAPI = :> Capture "tid" TeamId :> "conversations" :> Capture "cid" ConvId - :> Get '[Servant.JSON] (TeamConversation (From 'V2)) + :> Get '[Servant.JSON] TeamConversation ) :<|> Named "delete-team-conversation" diff --git a/libs/wire-api/src/Wire/API/Team/Conversation.hs b/libs/wire-api/src/Wire/API/Team/Conversation.hs index 9bc61dbeaea..f5795539181 100644 --- a/libs/wire-api/src/Wire/API/Team/Conversation.hs +++ b/libs/wire-api/src/Wire/API/Team/Conversation.hs @@ -43,22 +43,19 @@ import Data.Schema import qualified Data.Swagger as S import qualified Data.Swagger.Build.Api as Doc import Imports -import Wire.API.Routes.Version import Wire.Arbitrary (Arbitrary, GenericUniform (..)) -------------------------------------------------------------------------------- -- TeamConversation --- FUTUREWORK: The version tag type argument can be dropped as soon as versions --- below V2 are not supported any more. --- Derivation of various JSON instances is verbose with this version tag type variable, but this can be simplified once the old version can be dropped. -newtype TeamConversation (v :: *) = TeamConversation +newtype TeamConversation = TeamConversation { _conversationId :: ConvId } deriving stock (Eq, Show, Generic) - deriving (Arbitrary) via (GenericUniform (TeamConversation v)) + deriving (Arbitrary) via (GenericUniform TeamConversation) + deriving (A.ToJSON, A.FromJSON, S.ToSchema) via (Schema TeamConversation) -instance ToSchema (TeamConversation (Until 'V2)) where +instance ToSchema TeamConversation where schema = objectWithDocModifier "TeamConversation" @@ -68,51 +65,15 @@ instance ToSchema (TeamConversation (Until 'V2)) where <* const () .= fieldWithDocModifier "managed" - (description ?~ "(Not parsed any more) Whether this is a managed team conversation") + ( description ?~ "This field MUST not be used by clients. " + <> "It is here only for backwards compatibility of the interface." + ) (c (False :: Bool)) where c :: A.ToJSON a => a -> ValueSchema SwaggerDoc () c val = mkSchema mempty (const (pure ())) (const (pure (A.toJSON val))) -instance ToSchema (TeamConversation (From 'V2)) where - schema = - objectWithDocModifier - "TeamConversation" - (description ?~ "Team conversation data") - $ TeamConversation - <$> _conversationId .= field "conversation" schema - -deriving via - Schema (TeamConversation (Until 'V2)) - instance - A.FromJSON (TeamConversation (Until 'V2)) - -deriving via - Schema (TeamConversation (Until 'V2)) - instance - A.ToJSON (TeamConversation (Until 'V2)) - -deriving via - Schema (TeamConversation (From 'V2)) - instance - A.FromJSON (TeamConversation (From 'V2)) - -deriving via - Schema (TeamConversation (From 'V2)) - instance - A.ToJSON (TeamConversation (From 'V2)) - -deriving via - Schema (TeamConversation (Until 'V2)) - instance - S.ToSchema (TeamConversation (Until 'V2)) - -deriving via - Schema (TeamConversation (From 'V2)) - instance - S.ToSchema (TeamConversation (From 'V2)) - -newTeamConversation :: ConvId -> TeamConversation v +newTeamConversation :: ConvId -> TeamConversation newTeamConversation = TeamConversation modelTeamConversation :: Doc.Model @@ -121,21 +82,22 @@ modelTeamConversation = Doc.defineModel "TeamConversation" $ do Doc.property "conversation" Doc.bytes' $ Doc.description "conversation ID" Doc.property "managed" Doc.bytes' $ - Doc.description "Whether the conversation is managed (deprecated)" + Doc.description $ + "This field MUST not be used by clients. " + <> "It is here only for backwards compatibility of the interface." -------------------------------------------------------------------------------- -- TeamConversationList --- FUTUREWORK: The version tag type argument can be dropped as soon as versions --- below V2 are not supported any more. -newtype TeamConversationList (v :: *) = TeamConversationList - { _teamConversations :: [TeamConversation v] +newtype TeamConversationList = TeamConversationList + { _teamConversations :: [TeamConversation] } deriving (Generic) deriving stock (Eq, Show) deriving newtype (Arbitrary) + deriving (A.ToJSON, A.FromJSON, S.ToSchema) via (Schema TeamConversationList) -instance ToSchema (TeamConversation v) => ToSchema (TeamConversationList v) where +instance ToSchema TeamConversationList where schema = objectWithDocModifier "TeamConversationList" @@ -143,37 +105,7 @@ instance ToSchema (TeamConversation v) => ToSchema (TeamConversationList v) wher $ TeamConversationList <$> _teamConversations .= field "conversations" (array schema) -deriving via - Schema (TeamConversationList (Until 'V2)) - instance - A.FromJSON (TeamConversationList (Until 'V2)) - -deriving via - Schema (TeamConversationList (Until 'V2)) - instance - A.ToJSON (TeamConversationList (Until 'V2)) - -deriving via - Schema (TeamConversationList (From 'V2)) - instance - A.FromJSON (TeamConversationList (From 'V2)) - -deriving via - Schema (TeamConversationList (From 'V2)) - instance - A.ToJSON (TeamConversationList (From 'V2)) - -deriving via - Schema (TeamConversationList (Until 'V2)) - instance - S.ToSchema (TeamConversationList (Until 'V2)) - -deriving via - Schema (TeamConversationList (From 'V2)) - instance - S.ToSchema (TeamConversationList (From 'V2)) - -newTeamConversationList :: [TeamConversation v] -> TeamConversationList v +newTeamConversationList :: [TeamConversation] -> TeamConversationList newTeamConversationList = TeamConversationList modelTeamConversationList :: Doc.Model diff --git a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated.hs index 95788e338fe..ccff53d7278 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated.hs @@ -1144,28 +1144,22 @@ tests = testObjects [(Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_1, "testObject_TeamUpdateData_team_1.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_2, "testObject_TeamUpdateData_team_2.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_3, "testObject_TeamUpdateData_team_3.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_4, "testObject_TeamUpdateData_team_4.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_5, "testObject_TeamUpdateData_team_5.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_6, "testObject_TeamUpdateData_team_6.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_7, "testObject_TeamUpdateData_team_7.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_8, "testObject_TeamUpdateData_team_8.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_9, "testObject_TeamUpdateData_team_9.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_10, "testObject_TeamUpdateData_team_10.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_11, "testObject_TeamUpdateData_team_11.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_12, "testObject_TeamUpdateData_team_12.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_13, "testObject_TeamUpdateData_team_13.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_14, "testObject_TeamUpdateData_team_14.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_15, "testObject_TeamUpdateData_team_15.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_16, "testObject_TeamUpdateData_team_16.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_17, "testObject_TeamUpdateData_team_17.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_18, "testObject_TeamUpdateData_team_18.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_19, "testObject_TeamUpdateData_team_19.json"), (Test.Wire.API.Golden.Generated.TeamUpdateData_team.testObject_TeamUpdateData_team_20, "testObject_TeamUpdateData_team_20.json")], testGroup "Golden: TeamDeleteData_team" $ testObjects [(Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_1, "testObject_TeamDeleteData_team_1.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_2, "testObject_TeamDeleteData_team_2.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_3, "testObject_TeamDeleteData_team_3.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_4, "testObject_TeamDeleteData_team_4.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_5, "testObject_TeamDeleteData_team_5.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_6, "testObject_TeamDeleteData_team_6.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_7, "testObject_TeamDeleteData_team_7.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_8, "testObject_TeamDeleteData_team_8.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_9, "testObject_TeamDeleteData_team_9.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_10, "testObject_TeamDeleteData_team_10.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_11, "testObject_TeamDeleteData_team_11.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_12, "testObject_TeamDeleteData_team_12.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_13, "testObject_TeamDeleteData_team_13.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_14, "testObject_TeamDeleteData_team_14.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_15, "testObject_TeamDeleteData_team_15.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_16, "testObject_TeamDeleteData_team_16.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_17, "testObject_TeamDeleteData_team_17.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_18, "testObject_TeamDeleteData_team_18.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_19, "testObject_TeamDeleteData_team_19.json"), (Test.Wire.API.Golden.Generated.TeamDeleteData_team.testObject_TeamDeleteData_team_20, "testObject_TeamDeleteData_team_20.json")], - testGroup "Golden: TeamConversation_team_until_v2" $ + testGroup "Golden: TeamConversation_team" $ testObjects - [ ( Test.Wire.API.Golden.Generated.TeamConversation_team.testObject_TeamConversation_team_until_v2, - "testObject_TeamConversation_team_until_v2.json" - ) - ], - testGroup "Golden: TeamConversation_team_from_v2" $ - testObjects - [ ( Test.Wire.API.Golden.Generated.TeamConversation_team.testObject_TeamConversation_team_from_v2, - "testObject_TeamConversation_team_from_v2.json" - ) - ], - testGroup "Golden: TeamConversationList_team_until_v2" $ - testObjects - [ ( Test.Wire.API.Golden.Generated.TeamConversationList_team.testObject_TeamConversationList_team_until_v2, - "testObject_TeamConversationList_team_until_v2.json" + [ ( Test.Wire.API.Golden.Generated.TeamConversation_team.testObject_TeamConversation_team_1, + "testObject_TeamConversation_team_1.json" + ), + ( Test.Wire.API.Golden.Generated.TeamConversation_team.testObject_TeamConversation_team_2, + "testObject_TeamConversation_team_2.json" ) ], - testGroup "Golden: TeamConversationList_team_from_v2" $ + testGroup "Golden: TeamConversationList_team" $ testObjects - [ ( Test.Wire.API.Golden.Generated.TeamConversationList_team.testObject_TeamConversationList_team_from_v2, - "testObject_TeamConversationList_team_from_v2.json" + [ ( Test.Wire.API.Golden.Generated.TeamConversationList_team.testObject_TeamConversationList_team_1, + "testObject_TeamConversationList_team_1.json" + ), + ( Test.Wire.API.Golden.Generated.TeamConversationList_team.testObject_TeamConversationList_team_2, + "testObject_TeamConversationList_team_2.json" ) ], testGroup "Golden: WithStatusNoLock_team 1" $ diff --git a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/TeamConversationList_team.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/TeamConversationList_team.hs index fdb1570a49a..ea25570d1bf 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/TeamConversationList_team.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/TeamConversationList_team.hs @@ -22,21 +22,18 @@ module Test.Wire.API.Golden.Generated.TeamConversationList_team where import Data.Id (Id (Id)) import qualified Data.UUID as UUID (fromString) import Imports -import Wire.API.Routes.Version import Wire.API.Team.Conversation (TeamConversationList, newTeamConversation, newTeamConversationList) -testObject_TeamConversationList_team_until_v2 :: TeamConversationList (Until 'V2) -testObject_TeamConversationList_team_until_v2 = - ( newTeamConversationList - [ (newTeamConversation ((Id (fromJust (UUID.fromString "00000012-0000-0018-0000-00260000002b"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000002d-0000-0063-0000-006900000013"))))) - ] - ) +testObject_TeamConversationList_team_1 :: TeamConversationList +testObject_TeamConversationList_team_1 = + newTeamConversationList + [ newTeamConversation (Id (fromJust (UUID.fromString "00000012-0000-0018-0000-00260000002b"))), + newTeamConversation (Id (fromJust (UUID.fromString "0000002d-0000-0063-0000-006900000013"))) + ] -testObject_TeamConversationList_team_from_v2 :: TeamConversationList (From 'V2) -testObject_TeamConversationList_team_from_v2 = - ( newTeamConversationList - [ (newTeamConversation ((Id (fromJust (UUID.fromString "00000064-0000-0045-0000-007d00000023"))))), - (newTeamConversation ((Id (fromJust (UUID.fromString "0000000d-0000-0080-0000-00550000001b"))))) - ] - ) +testObject_TeamConversationList_team_2 :: TeamConversationList +testObject_TeamConversationList_team_2 = + newTeamConversationList + [ newTeamConversation (Id (fromJust (UUID.fromString "00000064-0000-0045-0000-007d00000023"))), + newTeamConversation (Id (fromJust (UUID.fromString "0000000d-0000-0080-0000-00550000001b"))) + ] diff --git a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/TeamConversation_team.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/TeamConversation_team.hs index 78e5e48c7eb..cbcce2a5b7b 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/TeamConversation_team.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/TeamConversation_team.hs @@ -20,13 +20,12 @@ module Test.Wire.API.Golden.Generated.TeamConversation_team where import Data.Id (Id (Id)) import qualified Data.UUID as UUID (fromString) import Imports -import Wire.API.Routes.Version import Wire.API.Team.Conversation (TeamConversation, newTeamConversation) -testObject_TeamConversation_team_until_v2 :: TeamConversation (Until 'V2) -testObject_TeamConversation_team_until_v2 = +testObject_TeamConversation_team_1 :: TeamConversation +testObject_TeamConversation_team_1 = newTeamConversation (Id (fromJust (UUID.fromString "00000054-0000-0032-0000-001d0000003e"))) -testObject_TeamConversation_team_from_v2 :: TeamConversation (From 'V2) -testObject_TeamConversation_team_from_v2 = +testObject_TeamConversation_team_2 :: TeamConversation +testObject_TeamConversation_team_2 = newTeamConversation (Id (fromJust (UUID.fromString "00000021-0000-0059-0000-00390000004c"))) diff --git a/libs/wire-api/test/golden/testObject_TeamConversationList_team_until_v2.json b/libs/wire-api/test/golden/testObject_TeamConversationList_team_1.json similarity index 100% rename from libs/wire-api/test/golden/testObject_TeamConversationList_team_until_v2.json rename to libs/wire-api/test/golden/testObject_TeamConversationList_team_1.json diff --git a/libs/wire-api/test/golden/testObject_TeamConversationList_team_from_v2.json b/libs/wire-api/test/golden/testObject_TeamConversationList_team_2.json similarity index 75% rename from libs/wire-api/test/golden/testObject_TeamConversationList_team_from_v2.json rename to libs/wire-api/test/golden/testObject_TeamConversationList_team_2.json index 2bf0434b45c..e7dfd82620a 100644 --- a/libs/wire-api/test/golden/testObject_TeamConversationList_team_from_v2.json +++ b/libs/wire-api/test/golden/testObject_TeamConversationList_team_2.json @@ -1,10 +1,12 @@ { "conversations": [ { - "conversation": "00000064-0000-0045-0000-007d00000023" + "conversation": "00000064-0000-0045-0000-007d00000023", + "managed": false }, { - "conversation": "0000000d-0000-0080-0000-00550000001b" + "conversation": "0000000d-0000-0080-0000-00550000001b", + "managed": false } ] } diff --git a/libs/wire-api/test/golden/testObject_TeamConversation_team_until_v2.json b/libs/wire-api/test/golden/testObject_TeamConversation_team_1.json similarity index 100% rename from libs/wire-api/test/golden/testObject_TeamConversation_team_until_v2.json rename to libs/wire-api/test/golden/testObject_TeamConversation_team_1.json diff --git a/libs/wire-api/test/golden/testObject_TeamConversation_team_2.json b/libs/wire-api/test/golden/testObject_TeamConversation_team_2.json new file mode 100644 index 00000000000..98867bb28cc --- /dev/null +++ b/libs/wire-api/test/golden/testObject_TeamConversation_team_2.json @@ -0,0 +1,4 @@ +{ + "conversation": "00000021-0000-0059-0000-00390000004c", + "managed": false +} diff --git a/libs/wire-api/test/golden/testObject_TeamConversation_team_from_v2.json b/libs/wire-api/test/golden/testObject_TeamConversation_team_from_v2.json deleted file mode 100644 index d41e3a51b87..00000000000 --- a/libs/wire-api/test/golden/testObject_TeamConversation_team_from_v2.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "conversation": "00000021-0000-0059-0000-00390000004c" -} diff --git a/libs/wire-api/test/unit/Test/Wire/API/Roundtrip/Aeson.hs b/libs/wire-api/test/unit/Test/Wire/API/Roundtrip/Aeson.hs index 5ff1373d5f6..27cd79e958d 100644 --- a/libs/wire-api/test/unit/Test/Wire/API/Roundtrip/Aeson.hs +++ b/libs/wire-api/test/unit/Test/Wire/API/Roundtrip/Aeson.hs @@ -46,7 +46,6 @@ import qualified Wire.API.Provider.External as Provider.External import qualified Wire.API.Provider.Service as Provider.Service import qualified Wire.API.Provider.Service.Tag as Provider.Service.Tag import qualified Wire.API.Push.Token as Push.Token -import Wire.API.Routes.Version import qualified Wire.API.Team as Team import qualified Wire.API.Team.Conversation as Team.Conversation import qualified Wire.API.Team.Feature as Team.Feature @@ -187,10 +186,8 @@ tests = testRoundTrip @Team.TeamList, testRoundTrip @Team.TeamUpdateData, testRoundTrip @Team.TeamDeleteData, - testRoundTrip @(Team.Conversation.TeamConversation (Until 'V2)), - testRoundTrip @(Team.Conversation.TeamConversation (From 'V2)), - testRoundTrip @(Team.Conversation.TeamConversationList (Until 'V2)), - testRoundTrip @(Team.Conversation.TeamConversationList (From 'V2)), + testRoundTrip @Team.Conversation.TeamConversation, + testRoundTrip @Team.Conversation.TeamConversationList, testRoundTrip @(Team.Feature.WithStatus Team.Feature.LegalholdConfig), testRoundTrip @(Team.Feature.WithStatusPatch Team.Feature.LegalholdConfig), testRoundTrip @(Team.Feature.WithStatusPatch Team.Feature.SelfDeletingMessagesConfig), diff --git a/services/brig/src/Brig/IO/Intra.hs b/services/brig/src/Brig/IO/Intra.hs index ff31704967b..c22c8a178ae 100644 --- a/services/brig/src/Brig/IO/Intra.hs +++ b/services/brig/src/Brig/IO/Intra.hs @@ -127,7 +127,6 @@ import Wire.API.Event.Conversation (Connect (Connect)) import Wire.API.Federation.API.Brig import Wire.API.Federation.Error import Wire.API.Properties -import Wire.API.Routes.Version import Wire.API.Team import qualified Wire.API.Team.Conversation as Conv import Wire.API.Team.Feature @@ -943,7 +942,7 @@ getTeamConv :: UserId -> TeamId -> ConvId -> - m (Maybe (Conv.TeamConversation (From 'V2))) + m (Maybe Conv.TeamConversation) getTeamConv usr tid cnv = do debug $ remote "galley" @@ -954,16 +953,8 @@ getTeamConv usr tid cnv = do 200 -> Just <$> decodeBody "galley" rs _ -> pure Nothing where - -- Ensure we get a type error, and not a runtime error once we drop V2. - v2 = toByteString' (toLower <$> show V2) req = - paths - [ v2, - "teams", - toByteString' tid, - "conversations", - toByteString' cnv - ] + paths ["teams", toByteString' tid, "conversations", toByteString' cnv] . zUser usr . expect [status200, status404] diff --git a/services/galley/src/Galley/API/Public/Servant.hs b/services/galley/src/Galley/API/Public/Servant.hs index ff573d56ff4..21378d52784 100644 --- a/services/galley/src/Galley/API/Public/Servant.hs +++ b/services/galley/src/Galley/API/Public/Servant.hs @@ -89,9 +89,7 @@ servantSitemap = teamConversations :: API TeamConversationAPI GalleyEffects teamConversations = mkNamedAPI @"get-team-conversation-roles" getTeamConversationRoles - <@> mkNamedAPI @"get-team-conversations-v1" getTeamConversations <@> mkNamedAPI @"get-team-conversations" getTeamConversations - <@> mkNamedAPI @"get-team-conversation-v1" getTeamConversation <@> mkNamedAPI @"get-team-conversation" getTeamConversation <@> mkNamedAPI @"delete-team-conversation" deleteTeamConversation diff --git a/services/galley/src/Galley/API/Teams.hs b/services/galley/src/Galley/API/Teams.hs index d0dcf1f40b1..73ff6660d31 100644 --- a/services/galley/src/Galley/API/Teams.hs +++ b/services/galley/src/Galley/API/Teams.hs @@ -456,7 +456,7 @@ uncheckedDeleteTeam lusr zcon tid = do createConvDeleteEvents :: UTCTime -> [TeamMember] -> - TeamConversation v -> + TeamConversation -> ([Push], [(BotMember, Conv.Event)]) -> Sem r ([Push], [(BotMember, Conv.Event)]) createConvDeleteEvents now teamMembs c (pp, ee) = do @@ -1018,7 +1018,7 @@ getTeamConversations :: r => UserId -> TeamId -> - Sem r (Public.TeamConversationList v) + Sem r Public.TeamConversationList getTeamConversations zusr tid = do tm <- E.getTeamMember tid zusr @@ -1038,7 +1038,7 @@ getTeamConversation :: UserId -> TeamId -> ConvId -> - Sem r (Public.TeamConversation v) + Sem r Public.TeamConversation getTeamConversation zusr tid cid = do tm <- E.getTeamMember tid zusr diff --git a/services/galley/src/Galley/Cassandra/Team.hs b/services/galley/src/Galley/Cassandra/Team.hs index 08821c94879..7494b24b6d2 100644 --- a/services/galley/src/Galley/Cassandra/Team.hs +++ b/services/galley/src/Galley/Cassandra/Team.hs @@ -156,12 +156,12 @@ getTeamName tid = fmap runIdentity <$> retry x1 (query1 Cql.selectTeamName (params LocalQuorum (Identity tid))) -teamConversation :: TeamId -> ConvId -> Client (Maybe (TeamConversation v)) +teamConversation :: TeamId -> ConvId -> Client (Maybe TeamConversation) teamConversation t c = fmap (newTeamConversation . runIdentity) <$> retry x1 (query1 Cql.selectTeamConv (params LocalQuorum (t, c))) -getTeamConversations :: TeamId -> Client [TeamConversation v] +getTeamConversations :: TeamId -> Client [TeamConversation] getTeamConversations t = map (newTeamConversation . runIdentity) <$> retry x1 (query Cql.selectTeamConvs (params LocalQuorum (Identity t))) @@ -335,7 +335,7 @@ deleteTeam tid = do removeConvs cnvs retry x5 $ write Cql.deleteTeam (params LocalQuorum (Deleted, tid)) where - removeConvs :: Page (TeamConversation v) -> Client () + removeConvs :: Page TeamConversation -> Client () removeConvs cnvs = do for_ (result cnvs) $ removeTeamConv tid . view conversationId unless (null $ result cnvs) $ @@ -419,7 +419,7 @@ teamConversationsForPagination :: TeamId -> Maybe ConvId -> Range 1 HardTruncationLimit Int32 -> - Client (Page (TeamConversation v)) + Client (Page TeamConversation) teamConversationsForPagination tid start (fromRange -> max) = fmap (newTeamConversation . runIdentity) <$> case start of Just c -> paginate Cql.selectTeamConvsFrom (paramsP LocalQuorum (tid, c) max) diff --git a/services/galley/src/Galley/Effects/TeamStore.hs b/services/galley/src/Galley/Effects/TeamStore.hs index 94961c0a4b1..bf2fdbb5664 100644 --- a/services/galley/src/Galley/Effects/TeamStore.hs +++ b/services/galley/src/Galley/Effects/TeamStore.hs @@ -107,8 +107,8 @@ data TeamStore m a where GetBillingTeamMembers :: TeamId -> TeamStore m [UserId] GetTeam :: TeamId -> TeamStore m (Maybe TeamData) GetTeamName :: TeamId -> TeamStore m (Maybe Text) - GetTeamConversation :: TeamId -> ConvId -> TeamStore m (Maybe (TeamConversation v)) - GetTeamConversations :: TeamId -> TeamStore m [TeamConversation v] + GetTeamConversation :: TeamId -> ConvId -> TeamStore m (Maybe TeamConversation) + GetTeamConversations :: TeamId -> TeamStore m [TeamConversation] SelectTeams :: UserId -> [TeamId] -> TeamStore m [TeamId] GetTeamMember :: TeamId -> UserId -> TeamStore m (Maybe TeamMember) GetTeamMembersWithLimit :: TeamId -> Range 1 HardTruncationLimit Int32 -> TeamStore m TeamMemberList From 1dd76d2cf20fa23e7c71f6f7302d076fe8c5ffa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Dimja=C5=A1evi=C4=87?= Date: Thu, 8 Sep 2022 16:57:22 +0200 Subject: [PATCH 13/14] Improve the description of the managed key --- libs/wire-api/src/Wire/API/Conversation.hs | 9 +++++++-- libs/wire-api/src/Wire/API/Team/Conversation.hs | 13 +++++++------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/libs/wire-api/src/Wire/API/Conversation.hs b/libs/wire-api/src/Wire/API/Conversation.hs index d0200617d89..affad99eb3f 100644 --- a/libs/wire-api/src/Wire/API/Conversation.hs +++ b/libs/wire-api/src/Wire/API/Conversation.hs @@ -724,6 +724,11 @@ newtype ConvTeamInfo = ConvTeamInfo deriving (Arbitrary) via (GenericUniform ConvTeamInfo) deriving (FromJSON, ToJSON, S.ToSchema) via (Schema ConvTeamInfo) +managedDesc :: Text +managedDesc = + "This field MUST NOT be used by clients. " + <> "It is here only for backwards compatibility of the interface." + instance ToSchema ConvTeamInfo where schema = objectWithDocModifier @@ -734,7 +739,7 @@ instance ToSchema ConvTeamInfo where <* const () .= fieldWithDocModifier "managed" - (description ?~ "(Not parsed any more) Whether this is a managed team conversation") + (description ?~ managedDesc) (c (False :: Bool)) where c :: ToJSON a => a -> ValueSchema SwaggerDoc () @@ -746,7 +751,7 @@ modelTeamInfo = Doc.defineModel "TeamInfo" $ do Doc.property "teamid" Doc.bytes' $ Doc.description "Team ID" Doc.property "managed" Doc.bool' $ - Doc.description "(Not parsed any more) Is this a managed team conversation?" + Doc.description managedDesc -------------------------------------------------------------------------------- -- invite diff --git a/libs/wire-api/src/Wire/API/Team/Conversation.hs b/libs/wire-api/src/Wire/API/Team/Conversation.hs index f5795539181..207ba65422c 100644 --- a/libs/wire-api/src/Wire/API/Team/Conversation.hs +++ b/libs/wire-api/src/Wire/API/Team/Conversation.hs @@ -55,6 +55,11 @@ newtype TeamConversation = TeamConversation deriving (Arbitrary) via (GenericUniform TeamConversation) deriving (A.ToJSON, A.FromJSON, S.ToSchema) via (Schema TeamConversation) +managedDesc :: Text +managedDesc = + "This field MUST NOT be used by clients. " + <> "It is here only for backwards compatibility of the interface." + instance ToSchema TeamConversation where schema = objectWithDocModifier @@ -65,9 +70,7 @@ instance ToSchema TeamConversation where <* const () .= fieldWithDocModifier "managed" - ( description ?~ "This field MUST not be used by clients. " - <> "It is here only for backwards compatibility of the interface." - ) + (description ?~ managedDesc) (c (False :: Bool)) where c :: A.ToJSON a => a -> ValueSchema SwaggerDoc () @@ -82,9 +85,7 @@ modelTeamConversation = Doc.defineModel "TeamConversation" $ do Doc.property "conversation" Doc.bytes' $ Doc.description "conversation ID" Doc.property "managed" Doc.bytes' $ - Doc.description $ - "This field MUST not be used by clients. " - <> "It is here only for backwards compatibility of the interface." + Doc.description managedDesc -------------------------------------------------------------------------------- -- TeamConversationList From 871940a021079752a3a9c1168cd39365444621e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Dimja=C5=A1evi=C4=87?= Date: Thu, 8 Sep 2022 16:59:45 +0200 Subject: [PATCH 14/14] Remove an outdated changelog --- changelog.d/1-api-changes/drop-managed-conv-json | 1 - 1 file changed, 1 deletion(-) delete mode 100644 changelog.d/1-api-changes/drop-managed-conv-json diff --git a/changelog.d/1-api-changes/drop-managed-conv-json b/changelog.d/1-api-changes/drop-managed-conv-json deleted file mode 100644 index b989f0d86df..00000000000 --- a/changelog.d/1-api-changes/drop-managed-conv-json +++ /dev/null @@ -1 +0,0 @@ -Conversation endpoints no longer support the `managed` flag in their JSON form