diff --git a/src/Internal/Api/All.elm b/src/Internal/Api/All.elm index a8bb707..020f92c 100644 --- a/src/Internal/Api/All.elm +++ b/src/Internal/Api/All.elm @@ -38,7 +38,7 @@ sendStateEvent = {-| Get the latest sync from the Matrix API. -} -syncCredentials : List String -> Sync.SyncInput -> Sync.SyncOutput +syncCredentials : List String -> Maybe (Sync.SyncInput -> Sync.SyncOutput) syncCredentials = Sync.sync diff --git a/src/Internal/Api/GetEvent/Main.elm b/src/Internal/Api/GetEvent/Main.elm index b4e6ea4..cde1f36 100644 --- a/src/Internal/Api/GetEvent/Main.elm +++ b/src/Internal/Api/GetEvent/Main.elm @@ -8,8 +8,12 @@ getEvent : List String -> Maybe (EventInput -> EventOutput) getEvent versions = VC.withBottomLayer { current = Api.getEventInputV1 - , version = "v1.2" + , version = "r0.5.0" } + |> VC.sameForVersion "r0.6.0" + |> VC.sameForVersion "r0.6.1" + |> VC.sameForVersion "v1.1" + |> VC.sameForVersion "v1.2" |> VC.sameForVersion "v1.3" |> VC.sameForVersion "v1.4" |> VC.sameForVersion "v1.5" diff --git a/src/Internal/Api/JoinedMembers/Api.elm b/src/Internal/Api/JoinedMembers/Api.elm index ef22cd6..cb899b7 100644 --- a/src/Internal/Api/JoinedMembers/Api.elm +++ b/src/Internal/Api/JoinedMembers/Api.elm @@ -17,8 +17,25 @@ type alias JoinedMembersOutputV1 = Task X.Error SO1.RoomMemberList -joinedMembersInputV1 : JoinedMembersInputV1 -> JoinedMembersOutputV1 -joinedMembersInputV1 data = +joinedMembersV1 : JoinedMembersInputV1 -> JoinedMembersOutputV1 +joinedMembersV1 data = + R.rawApiCall + { headers = R.WithAccessToken data.accessToken + , method = "GET" + , baseUrl = data.baseUrl + , path = "/_matrix/client/r0/rooms/{roomId}/joined_members" + , pathParams = + [ ( "roomId", data.roomId ) + ] + , queryParams = [] + , bodyParams = [] + , timeout = Nothing + , decoder = \_ -> SO1.roomMemberListDecoder + } + + +joinedMembersV2 : JoinedMembersInputV1 -> JoinedMembersOutputV1 +joinedMembersV2 data = R.rawApiCall { headers = R.WithAccessToken data.accessToken , method = "GET" diff --git a/src/Internal/Api/JoinedMembers/Main.elm b/src/Internal/Api/JoinedMembers/Main.elm index e341c2a..e21bc0c 100644 --- a/src/Internal/Api/JoinedMembers/Main.elm +++ b/src/Internal/Api/JoinedMembers/Main.elm @@ -7,9 +7,23 @@ import Internal.Tools.VersionControl as VC joinedMembers : List String -> Maybe (JoinedMembersInput -> JoinedMembersOutput) joinedMembers versions = VC.withBottomLayer - { current = Api.joinedMembersInputV1 - , version = "v1.1" + { current = Api.joinedMembersV1 + , version = "r0.0.0" } + |> VC.sameForVersion "r0.0.1" + |> VC.sameForVersion "r0.1.0" + |> VC.sameForVersion "r0.2.0" + |> VC.sameForVersion "r0.3.0" + |> VC.sameForVersion "r0.4.0" + |> VC.sameForVersion "r0.5.0" + |> VC.sameForVersion "r0.6.0" + |> VC.sameForVersion "r0.6.1" + |> VC.addMiddleLayer + { downcast = identity + , current = Api.joinedMembersV2 + , upcast = identity + , version = "v1.1" + } |> VC.sameForVersion "v1.2" |> VC.sameForVersion "v1.3" |> VC.sameForVersion "v1.4" diff --git a/src/Internal/Api/SendStateKey/V1/SpecObjects.elm b/src/Internal/Api/SendStateKey/V1/SpecObjects.elm index 3a4cf36..25208c1 100644 --- a/src/Internal/Api/SendStateKey/V1/SpecObjects.elm +++ b/src/Internal/Api/SendStateKey/V1/SpecObjects.elm @@ -1,37 +1,38 @@ -module Internal.Api.SendStateKey.V1.SpecObjects exposing ( - EventResponse +module Internal.Api.SendStateKey.V1.SpecObjects exposing + ( EventResponse , encodeEventResponse , eventResponseDecoder ) + {-| Automatically generated 'SpecObjects' -Last generated at Unix time 1675965633 +Last generated at Unix time 1676625734 + -} - import Internal.Tools.EncodeExtra exposing (maybeObject) - import Json.Decode as D import Json.Encode as E + {-| A response confirming that an event has been sent. -} -type alias EventResponse = { - eventId : String +type alias EventResponse = + { eventId : String } + encodeEventResponse : EventResponse -> E.Value encodeEventResponse data = - maybeObject [ - ("event_id", Just <| E.string data.eventId) - ] + maybeObject + [ ( "event_id", Just <| E.string data.eventId ) + ] eventResponseDecoder : D.Decoder EventResponse eventResponseDecoder = D.map (\a -> - { eventId=a}) - (D.field "event_id" D.string) - - + { eventId = a } + ) + (D.field "event_id" D.string)