From 01f97255fec40415a957c8a54a4fab4aac2014cf Mon Sep 17 00:00:00 2001 From: Bram van den Heuvel Date: Fri, 31 Mar 2023 13:50:05 +0200 Subject: [PATCH] contentType --> eventType --- development/build_objects.py | 4 +- src/Demos/Cookie.elm | 2 +- src/Demos/Cookies.html | 42 +++++++++---------- src/Internal/Api/GetEvent/V1/SpecObjects.elm | 8 ++-- .../Api/GetMessages/V1/SpecObjects.elm | 8 ++-- .../Api/GetMessages/V2/SpecObjects.elm | 8 ++-- src/Internal/Api/GetMessages/V2/Upcast.elm | 2 +- .../Api/GetMessages/V3/SpecObjects.elm | 14 +++---- src/Internal/Api/GetMessages/V3/Upcast.elm | 2 +- .../Api/GetMessages/V4/SpecObjects.elm | 8 ++-- src/Internal/Api/GetMessages/V4/Upcast.elm | 4 +- src/Internal/Api/Sync/V1/SpecObjects.elm | 20 ++++----- src/Internal/Api/Sync/V2/SpecObjects.elm | 20 ++++----- src/Internal/Api/Sync/V2/Upcast.elm | 2 +- src/Internal/Event.elm | 12 +++--- src/Internal/Invite.elm | 2 +- src/Internal/Room.elm | 7 +++- src/Internal/Values/Event.elm | 14 +++---- src/Internal/Values/RoomInvite.elm | 16 +++---- src/Internal/Values/StateManager.elm | 2 +- src/Matrix/Event.elm | 10 ++--- src/Matrix/RoomInvite.elm | 12 +++--- 22 files changed, 113 insertions(+), 106 deletions(-) diff --git a/development/build_objects.py b/development/build_objects.py index e063398..0506398 100644 --- a/development/build_objects.py +++ b/development/build_objects.py @@ -179,6 +179,8 @@ def main(in_file, out_file): return DictField(str_to_field(value[1:-1])) if value in OBJECTS: return SpecObjectField(value) + if value.startswith('Enums.'): + return EnumField(value[len('Enums.'):]) match value: case 'value': @@ -210,7 +212,7 @@ def main(in_file, out_file): @property def elm_name(self): if self.key == 'type': - return 'contentType' + return 'eventType' else: words = self.key.lower().replace('_', ' ').replace('.', ' ').split(' ') words = ''.join([w.capitalize() for w in words]) diff --git a/src/Demos/Cookie.elm b/src/Demos/Cookie.elm index f679c45..d493d21 100644 --- a/src/Demos/Cookie.elm +++ b/src/Demos/Cookie.elm @@ -139,7 +139,7 @@ cookies = |> Matrix.Room.mostRecentEvents |> List.filterMap (\event -> - case Matrix.Event.contentType event of + case Matrix.Event.eventType event of "me.noordstar.demo_cookie" -> Just (Matrix.Event.sender event) diff --git a/src/Demos/Cookies.html b/src/Demos/Cookies.html index 0dfe20f..43cf220 100644 --- a/src/Demos/Cookies.html +++ b/src/Demos/Cookies.html @@ -11527,7 +11527,7 @@ function $noordstar$elm_matrix_sdk$Internal$Api$GetEvent$V1$SpecObjects$cyclic$c $elm$json$Json$Decode$map8, F8( function (a, b, c, d, e, f, g, h) { - return {content: a, contentType: g, eventId: b, originServerTs: c, roomId: d, sender: e, stateKey: f, unsigned: h}; + return {content: a, eventType: g, eventId: b, originServerTs: c, roomId: d, sender: e, stateKey: f, unsigned: h}; }), A2($elm$json$Json$Decode$field, 'content', $elm$json$Json$Decode$value), A2($elm$json$Json$Decode$field, 'event_id', $elm$json$Json$Decode$string), @@ -14436,7 +14436,7 @@ var $noordstar$elm_matrix_sdk$Internal$Api$Sync$V1$SpecObjects$eventDecoder = A3 $elm$json$Json$Decode$map2, F2( function (a, b) { - return {content: a, contentType: b}; + return {content: a, eventType: b}; }), A2($elm$json$Json$Decode$field, 'content', $elm$json$Json$Decode$value), A2($elm$json$Json$Decode$field, 'type', $elm$json$Json$Decode$string)); @@ -14464,7 +14464,7 @@ var $noordstar$elm_matrix_sdk$Internal$Api$Sync$V1$SpecObjects$strippedStateEven $elm$json$Json$Decode$map4, F4( function (a, b, c, d) { - return {content: a, contentType: d, sender: b, stateKey: c}; + return {content: a, eventType: d, sender: b, stateKey: c}; }), A2($elm$json$Json$Decode$field, 'content', $elm$json$Json$Decode$value), A2($elm$json$Json$Decode$field, 'sender', $elm$json$Json$Decode$string), @@ -14532,7 +14532,7 @@ function $noordstar$elm_matrix_sdk$Internal$Api$Sync$V1$SpecObjects$cyclic$clien $elm$json$Json$Decode$map7, F7( function (a, b, c, d, e, f, g) { - return {content: a, contentType: f, eventId: b, originServerTs: c, sender: d, stateKey: e, unsigned: g}; + return {content: a, eventType: f, eventId: b, originServerTs: c, sender: d, stateKey: e, unsigned: g}; }), A2($elm$json$Json$Decode$field, 'content', $elm$json$Json$Decode$value), A2($elm$json$Json$Decode$field, 'event_id', $elm$json$Json$Decode$string), @@ -14708,7 +14708,7 @@ var $noordstar$elm_matrix_sdk$Internal$Api$Sync$V2$SpecObjects$eventDecoder = A3 $elm$json$Json$Decode$map2, F2( function (a, b) { - return {content: a, contentType: b}; + return {content: a, eventType: b}; }), A2($elm$json$Json$Decode$field, 'content', $elm$json$Json$Decode$value), A2($elm$json$Json$Decode$field, 'type', $elm$json$Json$Decode$string)); @@ -14736,7 +14736,7 @@ var $noordstar$elm_matrix_sdk$Internal$Api$Sync$V2$SpecObjects$strippedStateEven $elm$json$Json$Decode$map4, F4( function (a, b, c, d) { - return {content: a, contentType: d, sender: b, stateKey: c}; + return {content: a, eventType: d, sender: b, stateKey: c}; }), A2($elm$json$Json$Decode$field, 'content', $elm$json$Json$Decode$value), A2($elm$json$Json$Decode$field, 'sender', $elm$json$Json$Decode$string), @@ -14804,7 +14804,7 @@ function $noordstar$elm_matrix_sdk$Internal$Api$Sync$V2$SpecObjects$cyclic$clien $elm$json$Json$Decode$map7, F7( function (a, b, c, d, e, f, g) { - return {content: a, contentType: f, eventId: b, originServerTs: c, sender: d, stateKey: e, unsigned: g}; + return {content: a, eventType: f, eventId: b, originServerTs: c, sender: d, stateKey: e, unsigned: g}; }), A2($elm$json$Json$Decode$field, 'content', $elm$json$Json$Decode$value), A2($elm$json$Json$Decode$field, 'event_id', $elm$json$Json$Decode$string), @@ -14980,7 +14980,7 @@ var $noordstar$elm_matrix_sdk$Internal$Api$Sync$Api$syncV2 = function (data) { var $noordstar$elm_matrix_sdk$Internal$Api$Sync$V2$Upcast$upcastClientEventWithoutRoomId = function (old) { return { content: old.content, - contentType: old.contentType, + eventType: old.eventType, eventId: old.eventId, originServerTs: old.originServerTs, sender: old.sender, @@ -15175,9 +15175,9 @@ var $noordstar$elm_matrix_sdk$Internal$Values$Timeline$Timeline = function (a) { return {$: 'Timeline', a: a}; }; var $noordstar$elm_matrix_sdk$Internal$Values$StateManager$empty = $elm$core$Dict$empty; -var $noordstar$elm_matrix_sdk$Internal$Values$Event$contentType = function (_v0) { +var $noordstar$elm_matrix_sdk$Internal$Values$Event$eventType = function (_v0) { var e = _v0.a; - return e.contentType; + return e.eventType; }; var $noordstar$elm_matrix_sdk$Internal$Values$Event$stateKey = function (_v0) { var e = _v0.a; @@ -15191,7 +15191,7 @@ var $noordstar$elm_matrix_sdk$Internal$Values$StateManager$addEvent = F2( return A3( $elm$core$Dict$insert, _Utils_Tuple2( - $noordstar$elm_matrix_sdk$Internal$Values$Event$contentType(event), + $noordstar$elm_matrix_sdk$Internal$Values$Event$eventType(event), key), event, oldManager); @@ -15330,7 +15330,7 @@ var $noordstar$elm_matrix_sdk$Internal$Event$initFromClientEventWithoutRoomId = return $noordstar$elm_matrix_sdk$Internal$Values$Event$init( { content: output.content, - contentType: output.contentType, + eventType: output.eventType, eventId: output.eventId, originServerTs: output.originServerTs, roomId: rId, @@ -15357,7 +15357,7 @@ var $noordstar$elm_matrix_sdk$Internal$Event$initFromGetEvent = function (output return $noordstar$elm_matrix_sdk$Internal$Values$Event$init( { content: output.content, - contentType: output.contentType, + eventType: output.eventType, eventId: output.eventId, originServerTs: output.originServerTs, roomId: output.roomId, @@ -15381,7 +15381,7 @@ var $noordstar$elm_matrix_sdk$Internal$Event$initFromGetMessages = function (out return $noordstar$elm_matrix_sdk$Internal$Values$Event$init( { content: output.content, - contentType: output.contentType, + eventType: output.eventType, eventId: output.eventId, originServerTs: output.originServerTs, roomId: output.roomId, @@ -15454,9 +15454,9 @@ var $noordstar$elm_matrix_sdk$Internal$Room$initFromJoinedRoom = F2( A2( $elm$core$List$map, function (_v0) { - var contentType = _v0.contentType; + var eventType = _v0.eventType; var content = _v0.content; - return _Utils_Tuple2(contentType, content); + return _Utils_Tuple2(eventType, content); }, A2( $elm$core$Maybe$withDefault, @@ -15544,7 +15544,7 @@ var $noordstar$elm_matrix_sdk$Internal$Values$RoomInvite$init = function (data) $elm$core$List$map, function (event) { return _Utils_Tuple2( - _Utils_Tuple2(event.contentType, event.stateKey), + _Utils_Tuple2(event.eventType, event.stateKey), $noordstar$elm_matrix_sdk$Internal$Values$RoomInvite$RoomInviteEvent(event)); }, data.events))); @@ -16115,8 +16115,8 @@ var $noordstar$elm_matrix_sdk$Internal$Event$withoutCredentials = function (_v0) }; var $noordstar$elm_matrix_sdk$Internal$Event$content = A2($elm$core$Basics$composeR, $noordstar$elm_matrix_sdk$Internal$Event$withoutCredentials, $noordstar$elm_matrix_sdk$Internal$Values$Event$content); var $noordstar$elm_matrix_sdk$Matrix$Event$content = $noordstar$elm_matrix_sdk$Internal$Event$content; -var $noordstar$elm_matrix_sdk$Internal$Event$contentType = A2($elm$core$Basics$composeR, $noordstar$elm_matrix_sdk$Internal$Event$withoutCredentials, $noordstar$elm_matrix_sdk$Internal$Values$Event$contentType); -var $noordstar$elm_matrix_sdk$Matrix$Event$contentType = $noordstar$elm_matrix_sdk$Internal$Event$contentType; +var $noordstar$elm_matrix_sdk$Internal$Event$eventType = A2($elm$core$Basics$composeR, $noordstar$elm_matrix_sdk$Internal$Event$withoutCredentials, $noordstar$elm_matrix_sdk$Internal$Values$Event$eventType); +var $noordstar$elm_matrix_sdk$Matrix$Event$eventType = $noordstar$elm_matrix_sdk$Internal$Event$eventType; var $noordstar$elm_matrix_sdk$Internal$Values$Timeline$mostRecentEvents = function (_v0) { var t = _v0.a; return t.events; @@ -16167,7 +16167,7 @@ var $noordstar$elm_matrix_sdk$Demos$Cookie$cookies = function () { A2( $elm$core$List$filterMap, function (event) { - var _v0 = $noordstar$elm_matrix_sdk$Matrix$Event$contentType(event); + var _v0 = $noordstar$elm_matrix_sdk$Matrix$Event$eventType(event); if (_v0 === 'me.noordstar.demo_cookie') { return $elm$core$Maybe$Just( $noordstar$elm_matrix_sdk$Matrix$Event$sender(event)); @@ -16453,7 +16453,7 @@ var $noordstar$elm_matrix_sdk$Demos$Cookie$view = function (model) { var $noordstar$elm_matrix_sdk$Demos$Cookie$main = $elm$browser$Browser$element( {init: $noordstar$elm_matrix_sdk$Demos$Cookie$init, subscriptions: $noordstar$elm_matrix_sdk$Demos$Cookie$subscriptions, update: $noordstar$elm_matrix_sdk$Demos$Cookie$update, view: $noordstar$elm_matrix_sdk$Demos$Cookie$view}); _Platform_export({'Demos':{'Cookie':{'init':$noordstar$elm_matrix_sdk$Demos$Cookie$main( - $elm$json$Json$Decode$succeed(_Utils_Tuple0))({"versions":{"elm":"0.19.1"},"types":{"message":"Demos.Cookie.Msg","aliases":{"Matrix.VaultUpdate":{"args":[],"type":"Internal.Api.VaultUpdate.VaultUpdate"},"Internal.Api.Sync.V2.SpecObjects.AccountData":{"args":[],"type":"{ events : List.List Internal.Api.Sync.V2.SpecObjects.Event }"},"Internal.Api.Ban.Main.BanInput":{"args":[],"type":"Internal.Api.Ban.Api.BanInputV1"},"Internal.Api.Ban.Api.BanInputV1":{"args":[],"type":"{ reason : Maybe.Maybe String.String, roomId : String.String, userId : String.String }"},"Internal.Api.Ban.Main.BanOutput":{"args":[],"type":"Internal.Api.Ban.Api.BanOutputV1"},"Internal.Api.Ban.Api.BanOutputV1":{"args":[],"type":"()"},"Internal.Api.GetEvent.V1.SpecObjects.ClientEvent":{"args":[],"type":"{ content : Json.Encode.Value, eventId : String.String, originServerTs : Internal.Tools.Timestamp.Timestamp, roomId : String.String, sender : String.String, stateKey : Maybe.Maybe String.String, contentType : String.String, unsigned : Maybe.Maybe Internal.Api.GetEvent.V1.SpecObjects.UnsignedData }"},"Internal.Api.GetMessages.V4.SpecObjects.ClientEvent":{"args":[],"type":"{ content : Json.Encode.Value, eventId : String.String, originServerTs : Internal.Tools.Timestamp.Timestamp, roomId : String.String, sender : String.String, stateKey : Maybe.Maybe String.String, contentType : String.String, unsigned : Maybe.Maybe Internal.Api.GetMessages.V4.SpecObjects.UnsignedData }"},"Internal.Api.Sync.V2.SpecObjects.ClientEventWithoutRoomId":{"args":[],"type":"{ content : Json.Encode.Value, eventId : String.String, originServerTs : Internal.Tools.Timestamp.Timestamp, sender : String.String, stateKey : Maybe.Maybe String.String, contentType : String.String, unsigned : Maybe.Maybe Internal.Api.Sync.V2.SpecObjects.UnsignedData }"},"Internal.Api.LoginWithUsernameAndPassword.V5.Login.DiscoveryInformation":{"args":[],"type":"{ mHomeserver : Internal.Api.LoginWithUsernameAndPassword.V5.Login.HomeserverInformation, mIdentityServer : Maybe.Maybe Internal.Api.LoginWithUsernameAndPassword.V5.Login.IdentityServerInformation }"},"Internal.Api.Sync.V2.SpecObjects.Ephemeral":{"args":[],"type":"{ events : List.List Internal.Api.Sync.V2.SpecObjects.Event }"},"Internal.Api.Sync.V2.SpecObjects.Event":{"args":[],"type":"{ content : Json.Encode.Value, contentType : String.String }"},"Internal.Api.GetEvent.Main.EventInput":{"args":[],"type":"Internal.Api.GetEvent.Api.GetEventInputV1"},"Internal.Api.GetEvent.Main.EventOutput":{"args":[],"type":"Internal.Api.GetEvent.Api.GetEventOutputV1"},"Internal.Api.SendMessageEvent.V1.SpecObjects.EventResponse":{"args":[],"type":"{ eventId : String.String }"},"Internal.Api.SendStateKey.V1.SpecObjects.EventResponse":{"args":[],"type":"{ eventId : String.String }"},"Internal.Api.GetEvent.Api.GetEventInputV1":{"args":[],"type":"{ roomId : String.String }"},"Internal.Api.GetEvent.Api.GetEventOutputV1":{"args":[],"type":"Internal.Api.GetEvent.V1.SpecObjects.ClientEvent"},"Internal.Api.GetMessages.Main.GetMessagesInput":{"args":[],"type":"Internal.Api.GetMessages.Api.GetMessagesInputV4"},"Internal.Api.GetMessages.Api.GetMessagesInputV4":{"args":[],"type":"{ direction : Internal.Tools.SpecEnums.EventOrder, filter : Maybe.Maybe String.String, from : Maybe.Maybe String.String, limit : Maybe.Maybe Basics.Int, roomId : String.String, to : Maybe.Maybe String.String }"},"Internal.Api.GetMessages.Main.GetMessagesOutput":{"args":[],"type":"Internal.Api.GetMessages.Api.GetMessagesOutputV4"},"Internal.Api.GetMessages.Api.GetMessagesOutputV4":{"args":[],"type":"Internal.Api.GetMessages.V4.SpecObjects.MessagesResponse"},"Internal.Api.LoginWithUsernameAndPassword.V5.Login.HomeserverInformation":{"args":[],"type":"{ baseUrl : String.String }"},"Internal.Api.LoginWithUsernameAndPassword.V5.Login.IdentityServerInformation":{"args":[],"type":"{ baseUrl : String.String }"},"Internal.Api.Invite.Main.InviteInput":{"args":[],"type":"Internal.Api.Invite.Api.InviteInputV2"},"Internal.Api.Invite.Api.InviteInputV2":{"args":[],"type":"{ reason : Maybe.Maybe String.String, roomId : String.String, userId : String.String }"},"Internal.Api.Invite.Main.InviteOutput":{"args":[],"type":"Internal.Api.Invite.Api.InviteOutputV1"},"Internal.Api.Invite.Api.InviteOutputV1":{"args":[],"type":"()"},"Internal.Api.Sync.V2.SpecObjects.InviteState":{"args":[],"type":"{ events : List.List Internal.Api.Sync.V2.SpecObjects.StrippedStateEvent }"},"Internal.Api.Sync.V2.SpecObjects.InvitedRoom":{"args":[],"type":"{ inviteState : Maybe.Maybe Internal.Api.Sync.V2.SpecObjects.InviteState }"},"Internal.Api.JoinRoomById.Main.JoinRoomByIdInput":{"args":[],"type":"Internal.Api.JoinRoomById.Api.JoinRoomByIdInputV2"},"Internal.Api.JoinRoomById.Api.JoinRoomByIdInputV2":{"args":[],"type":"{ roomId : String.String, reason : Maybe.Maybe String.String }"},"Internal.Api.JoinRoomById.Main.JoinRoomByIdOutput":{"args":[],"type":"Internal.Api.JoinRoomById.Api.JoinRoomByIdOutputV1"},"Internal.Api.JoinRoomById.Api.JoinRoomByIdOutputV1":{"args":[],"type":"{ roomId : String.String }"},"Internal.Api.JoinedMembers.Main.JoinedMembersInput":{"args":[],"type":"Internal.Api.JoinedMembers.Api.JoinedMembersInputV1"},"Internal.Api.JoinedMembers.Api.JoinedMembersInputV1":{"args":[],"type":"{ roomId : String.String }"},"Internal.Api.JoinedMembers.Main.JoinedMembersOutput":{"args":[],"type":"Internal.Api.JoinedMembers.Api.JoinedMembersOutputV1"},"Internal.Api.JoinedMembers.Api.JoinedMembersOutputV1":{"args":[],"type":"Internal.Api.JoinedMembers.V1.SpecObjects.RoomMemberList"},"Internal.Api.Sync.V2.SpecObjects.JoinedRoom":{"args":[],"type":"{ accountData : Maybe.Maybe Internal.Api.Sync.V2.SpecObjects.AccountData, ephemeral : Maybe.Maybe Internal.Api.Sync.V2.SpecObjects.Ephemeral, state : Maybe.Maybe Internal.Api.Sync.V2.SpecObjects.State, summary : Maybe.Maybe Internal.Api.Sync.V2.SpecObjects.RoomSummary, timeline : Maybe.Maybe Internal.Api.Sync.V2.SpecObjects.Timeline, unreadNotifications : Maybe.Maybe Internal.Api.Sync.V2.SpecObjects.UnreadNotificationCounts, unreadThreadNotifications : Dict.Dict String.String Internal.Api.Sync.V2.SpecObjects.ThreadNotificationCounts }"},"Internal.Api.Sync.V2.SpecObjects.KnockState":{"args":[],"type":"{ events : List.List Internal.Api.Sync.V2.SpecObjects.StrippedStateEvent }"},"Internal.Api.Sync.V2.SpecObjects.KnockedRoom":{"args":[],"type":"{ knockState : Maybe.Maybe Internal.Api.Sync.V2.SpecObjects.KnockState }"},"Internal.Api.Leave.Main.LeaveInput":{"args":[],"type":"Internal.Api.Leave.Api.LeaveInputV2"},"Internal.Api.Leave.Api.LeaveInputV2":{"args":[],"type":"{ roomId : String.String, reason : Maybe.Maybe String.String }"},"Internal.Api.Leave.Main.LeaveOutput":{"args":[],"type":"Internal.Api.Leave.Api.LeaveOutputV1"},"Internal.Api.Leave.Api.LeaveOutputV1":{"args":[],"type":"()"},"Internal.Api.Sync.V2.SpecObjects.LeftRoom":{"args":[],"type":"{ accountData : Maybe.Maybe Internal.Api.Sync.V2.SpecObjects.AccountData, state : Maybe.Maybe Internal.Api.Sync.V2.SpecObjects.State, timeline : Maybe.Maybe Internal.Api.Sync.V2.SpecObjects.Timeline }"},"Internal.Api.LoginWithUsernameAndPassword.V5.Login.LoggedInResponse":{"args":[],"type":"{ accessToken : String.String, deviceId : Maybe.Maybe String.String, expiresInMs : Maybe.Maybe Basics.Int, homeServer : Maybe.Maybe String.String, refreshToken : Maybe.Maybe String.String, userId : String.String, wellKnown : Maybe.Maybe Internal.Api.LoginWithUsernameAndPassword.V5.Login.DiscoveryInformation }"},"Internal.Api.LoginWithUsernameAndPassword.Main.LoginWithUsernameAndPasswordInput":{"args":[],"type":"Internal.Api.LoginWithUsernameAndPassword.Api.LoginWithUsernameAndPasswordInputV2"},"Internal.Api.LoginWithUsernameAndPassword.Api.LoginWithUsernameAndPasswordInputV2":{"args":[],"type":"{ deviceId : Maybe.Maybe String.String, initialDeviceDisplayName : Maybe.Maybe String.String, password : String.String, username : String.String }"},"Internal.Api.LoginWithUsernameAndPassword.Main.LoginWithUsernameAndPasswordOutput":{"args":[],"type":"Internal.Api.LoginWithUsernameAndPassword.Api.LoginWithUsernameAndPasswordOutputV5"},"Internal.Api.LoginWithUsernameAndPassword.Api.LoginWithUsernameAndPasswordOutputV5":{"args":[],"type":"Internal.Api.LoginWithUsernameAndPassword.V5.Login.LoggedInResponse"},"Internal.Api.GetMessages.V4.SpecObjects.MessagesResponse":{"args":[],"type":"{ chunk : List.List Internal.Api.GetMessages.V4.SpecObjects.ClientEvent, end : Maybe.Maybe String.String, start : String.String, state : List.List Internal.Api.GetMessages.V4.SpecObjects.ClientEvent }"},"Internal.Api.Sync.V2.SpecObjects.Presence":{"args":[],"type":"{ events : List.List Internal.Api.Sync.V2.SpecObjects.Event }"},"Internal.Api.Redact.Main.RedactInput":{"args":[],"type":"Internal.Api.Redact.Api.RedactInputV1"},"Internal.Api.Redact.Api.RedactInputV1":{"args":[],"type":"{ roomId : String.String, eventId : String.String, reason : Maybe.Maybe String.String }"},"Internal.Api.Redact.Main.RedactOutput":{"args":[],"type":"Internal.Api.Redact.Api.RedactOutputV1"},"Internal.Api.Redact.Api.RedactOutputV1":{"args":[],"type":"Internal.Api.Redact.V1.SpecObjects.Redaction"},"Internal.Api.Redact.V1.SpecObjects.Redaction":{"args":[],"type":"{ eventId : String.String }"},"Internal.Api.JoinedMembers.V1.SpecObjects.RoomMember":{"args":[],"type":"{ avatarUrl : Maybe.Maybe String.String, displayName : Maybe.Maybe String.String }"},"Internal.Api.JoinedMembers.V1.SpecObjects.RoomMemberList":{"args":[],"type":"{ joined : Dict.Dict String.String Internal.Api.JoinedMembers.V1.SpecObjects.RoomMember }"},"Internal.Api.Sync.V2.SpecObjects.RoomSummary":{"args":[],"type":"{ mHeroes : Maybe.Maybe (List.List String.String), mInvitedMemberCount : Maybe.Maybe Basics.Int, mJoinedMemberCount : Maybe.Maybe Basics.Int }"},"Internal.Api.Sync.V2.SpecObjects.Rooms":{"args":[],"type":"{ invite : Dict.Dict String.String Internal.Api.Sync.V2.SpecObjects.InvitedRoom, join : Dict.Dict String.String Internal.Api.Sync.V2.SpecObjects.JoinedRoom, knock : Dict.Dict String.String Internal.Api.Sync.V2.SpecObjects.KnockedRoom, leave : Dict.Dict String.String Internal.Api.Sync.V2.SpecObjects.LeftRoom }"},"Internal.Api.SendMessageEvent.Main.SendMessageEventInput":{"args":[],"type":"Internal.Api.SendMessageEvent.Api.SendMessageEventInputV1"},"Internal.Api.SendMessageEvent.Api.SendMessageEventInputV1":{"args":[],"type":"{ content : Json.Decode.Value, eventType : String.String, roomId : String.String }"},"Internal.Api.SendMessageEvent.Main.SendMessageEventOutput":{"args":[],"type":"Internal.Api.SendMessageEvent.Api.SendMessageEventOutputV1"},"Internal.Api.SendMessageEvent.Api.SendMessageEventOutputV1":{"args":[],"type":"Internal.Api.SendMessageEvent.V1.SpecObjects.EventResponse"},"Internal.Api.SendStateKey.Main.SendStateKeyInput":{"args":[],"type":"Internal.Api.SendStateKey.Api.SendStateKeyInputV1"},"Internal.Api.SendStateKey.Api.SendStateKeyInputV1":{"args":[],"type":"{ content : Json.Decode.Value, eventType : String.String, roomId : String.String, stateKey : String.String }"},"Internal.Api.SendStateKey.Main.SendStateKeyOutput":{"args":[],"type":"Internal.Api.SendStateKey.Api.SendStateKeyOutputV1"},"Internal.Api.SendStateKey.Api.SendStateKeyOutputV1":{"args":[],"type":"Internal.Api.SendStateKey.V1.SpecObjects.EventResponse"},"Internal.Api.Sync.V2.SpecObjects.State":{"args":[],"type":"{ events : List.List Internal.Api.Sync.V2.SpecObjects.ClientEventWithoutRoomId }"},"Internal.Api.Sync.V2.SpecObjects.StrippedStateEvent":{"args":[],"type":"{ content : Json.Encode.Value, sender : String.String, stateKey : String.String, contentType : String.String }"},"Internal.Api.Sync.V2.SpecObjects.Sync":{"args":[],"type":"{ accountData : Maybe.Maybe Internal.Api.Sync.V2.SpecObjects.AccountData, nextBatch : String.String, presence : Maybe.Maybe Internal.Api.Sync.V2.SpecObjects.Presence, rooms : Maybe.Maybe Internal.Api.Sync.V2.SpecObjects.Rooms }"},"Internal.Api.Sync.Main.SyncInput":{"args":[],"type":"Internal.Api.Sync.Api.SyncInputV1"},"Internal.Api.Sync.Api.SyncInputV1":{"args":[],"type":"{ filter : Maybe.Maybe String.String, fullState : Maybe.Maybe Basics.Bool, setPresence : Maybe.Maybe Internal.Tools.SpecEnums.UserPresence, since : Maybe.Maybe String.String, timeout : Maybe.Maybe Basics.Int }"},"Internal.Api.Sync.Main.SyncOutput":{"args":[],"type":"Internal.Api.Sync.Api.SyncOutputV2"},"Internal.Api.Sync.Api.SyncOutputV2":{"args":[],"type":"Internal.Api.Sync.V2.SpecObjects.Sync"},"Internal.Api.Sync.V2.SpecObjects.ThreadNotificationCounts":{"args":[],"type":"{ highlightCount : Maybe.Maybe Basics.Int, notificationCount : Maybe.Maybe Basics.Int }"},"Internal.Api.Sync.V2.SpecObjects.Timeline":{"args":[],"type":"{ events : List.List Internal.Api.Sync.V2.SpecObjects.ClientEventWithoutRoomId, limited : Basics.Bool, prevBatch : Maybe.Maybe String.String }"},"Internal.Tools.Timestamp.Timestamp":{"args":[],"type":"Time.Posix"},"Internal.Api.Sync.V2.SpecObjects.UnreadNotificationCounts":{"args":[],"type":"{ highlightCount : Maybe.Maybe Basics.Int, notificationCount : Maybe.Maybe Basics.Int }"},"Json.Decode.Value":{"args":[],"type":"Json.Encode.Value"},"Internal.Api.Versions.V1.Versions.Versions":{"args":[],"type":"{ unstableFeatures : Dict.Dict String.String Basics.Bool, versions : List.List String.String }"},"Internal.Api.WhoAmI.Main.WhoAmIOutput":{"args":[],"type":"Internal.Api.WhoAmI.Api.WhoAmIOutputV3"},"Internal.Api.WhoAmI.Api.WhoAmIOutputV3":{"args":[],"type":"Internal.Api.WhoAmI.V3.SpecObjects.WhoAmIResponse"},"Internal.Api.WhoAmI.V3.SpecObjects.WhoAmIResponse":{"args":[],"type":"{ deviceId : Maybe.Maybe String.String, isGuest : Basics.Bool, userId : String.String }"}},"unions":{"Demos.Cookie.Msg":{"args":[],"tags":{"Login":["{ accessToken : String.String, baseUrl : String.String }"],"SendEventToRoom":["String.String"],"SyncVault":[],"VaultUpdate":["Result.Result Internal.Tools.Exceptions.Error Matrix.VaultUpdate"],"WriteAccessToken":["String.String"],"WriteBaseUrl":["String.String"]}},"Internal.Tools.Exceptions.Error":{"args":[],"tags":{"InternetException":["Http.Error"],"SDKException":["Internal.Tools.Exceptions.ClientError"],"ServerException":["Internal.Tools.Exceptions.ServerError"],"UnsupportedSpecVersion":[]}},"Result.Result":{"args":["error","value"],"tags":{"Ok":["value"],"Err":["error"]}},"String.String":{"args":[],"tags":{"String":[]}},"Internal.Api.VaultUpdate.VaultUpdate":{"args":[],"tags":{"MultipleUpdates":["List.List Internal.Api.VaultUpdate.VaultUpdate"],"BanUser":["Internal.Api.Ban.Main.BanInput","Internal.Api.Ban.Main.BanOutput"],"GetEvent":["Internal.Api.GetEvent.Main.EventInput","Internal.Api.GetEvent.Main.EventOutput"],"GetMessages":["Internal.Api.GetMessages.Main.GetMessagesInput","Internal.Api.GetMessages.Main.GetMessagesOutput"],"InviteSent":["Internal.Api.Invite.Main.InviteInput","Internal.Api.Invite.Main.InviteOutput"],"JoinedMembersToRoom":["Internal.Api.JoinedMembers.Main.JoinedMembersInput","Internal.Api.JoinedMembers.Main.JoinedMembersOutput"],"JoinedRoom":["Internal.Api.JoinRoomById.Main.JoinRoomByIdInput","Internal.Api.JoinRoomById.Main.JoinRoomByIdOutput"],"LeftRoom":["Internal.Api.Leave.Main.LeaveInput","Internal.Api.Leave.Main.LeaveOutput"],"LoggedInWithUsernameAndPassword":["Internal.Api.LoginWithUsernameAndPassword.Main.LoginWithUsernameAndPasswordInput","Internal.Api.LoginWithUsernameAndPassword.Main.LoginWithUsernameAndPasswordOutput"],"MessageEventSent":["Internal.Api.SendMessageEvent.Main.SendMessageEventInput","Internal.Api.SendMessageEvent.Main.SendMessageEventOutput"],"RedactedEvent":["Internal.Api.Redact.Main.RedactInput","Internal.Api.Redact.Main.RedactOutput"],"StateEventSent":["Internal.Api.SendStateKey.Main.SendStateKeyInput","Internal.Api.SendStateKey.Main.SendStateKeyOutput"],"SyncUpdate":["Internal.Api.Sync.Main.SyncInput","Internal.Api.Sync.Main.SyncOutput"],"UpdateAccessToken":["String.String"],"UpdateVersions":["Internal.Api.Versions.V1.Versions.Versions"],"UpdateRawAccessToken":["String.String","Internal.Api.WhoAmI.Main.WhoAmIOutput"]}},"Basics.Bool":{"args":[],"tags":{"True":[],"False":[]}},"Internal.Tools.Exceptions.ClientError":{"args":[],"tags":{"ServerReturnsBadJSON":["String.String"],"NotSupportedYet":["String.String"],"NoAccessToken":[]}},"Dict.Dict":{"args":["k","v"],"tags":{"RBNode_elm_builtin":["Dict.NColor","k","v","Dict.Dict k v","Dict.Dict k v"],"RBEmpty_elm_builtin":[]}},"Http.Error":{"args":[],"tags":{"BadUrl":["String.String"],"Timeout":[],"NetworkError":[],"BadStatus":["Basics.Int"],"BadBody":["String.String"]}},"Internal.Tools.SpecEnums.EventOrder":{"args":[],"tags":{"Chronological":[],"ReverseChronological":[]}},"Basics.Int":{"args":[],"tags":{"Int":[]}},"List.List":{"args":["a"],"tags":{}},"Maybe.Maybe":{"args":["a"],"tags":{"Just":["a"],"Nothing":[]}},"Time.Posix":{"args":[],"tags":{"Posix":["Basics.Int"]}},"Internal.Tools.Exceptions.ServerError":{"args":[],"tags":{"M_FORBIDDEN":["{ error : Maybe.Maybe String.String }"],"M_UNKNOWN_TOKEN":["{ error : Maybe.Maybe String.String, soft_logout : Maybe.Maybe Basics.Bool }"],"M_MISSING_TOKEN":["{ error : Maybe.Maybe String.String, soft_logout : Maybe.Maybe Basics.Bool }"],"M_BAD_JSON":["{ error : Maybe.Maybe String.String }"],"M_NOT_JSON":["{ error : Maybe.Maybe String.String }"],"M_NOT_FOUND":["{ error : Maybe.Maybe String.String }"],"M_LIMIT_EXCEEDED":["{ error : Maybe.Maybe String.String, retryAfterMs : Maybe.Maybe Basics.Int }"],"M_UNKNOWN":["{ error : Maybe.Maybe String.String }"],"M_UNRECOGNIZED":["{ error : Maybe.Maybe String.String }"],"M_UNAUTHORIZED":["{ error : Maybe.Maybe String.String }"],"M_USER_DEACTIVATED":["{ error : Maybe.Maybe String.String }"],"M_USER_IN_USE":["{ error : Maybe.Maybe String.String }"],"M_INVALID_USERNAME":["{ error : Maybe.Maybe String.String }"],"M_ROOM_IN_USE":["{ error : Maybe.Maybe String.String }"],"M_INVALID_ROOM_STATE":["{ error : Maybe.Maybe String.String }"],"M_THREEPID_IN_USE":["{ error : Maybe.Maybe String.String }"],"M_THREEPID_NOT_FOUND":["{ error : Maybe.Maybe String.String }"],"M_THREEPID_AUTH_FAILED":["{ error : Maybe.Maybe String.String }"],"M_THREEPID_DENIED":["{ error : Maybe.Maybe String.String }"],"M_SERVER_NOT_TRUSTED":["{ error : Maybe.Maybe String.String }"],"M_UNSUPPORTED_ROOM_VERSION":["{ error : Maybe.Maybe String.String }"],"M_INCOMPATIBLE_ROOM_VERSION":["{ error : Maybe.Maybe String.String, room_version : Maybe.Maybe String.String }"],"M_BAD_STATE":["{ error : Maybe.Maybe String.String }"],"M_GUEST_ACCESS_FORBIDDEN":["{ error : Maybe.Maybe String.String }"],"M_CAPTCHA_NEEDED":["{ error : Maybe.Maybe String.String }"],"M_CAPTCHA_INVALID":["{ error : Maybe.Maybe String.String }"],"M_MISSING_PARAM":["{ error : Maybe.Maybe String.String }"],"M_INVALID_PARAM":["{ error : Maybe.Maybe String.String }"],"M_TOO_LARGE":["{ error : Maybe.Maybe String.String }"],"M_EXCLUSIVE":["{ error : Maybe.Maybe String.String }"],"M_RESOURCE_LIMIT_EXCEEDED":["{ error : Maybe.Maybe String.String, adminContact : String.String }"],"M_CANNOT_LEAVE_SERVER_NOTICE_ROOM":["{ error : Maybe.Maybe String.String }"],"RequiresUserInteractiveAuthentication":["{ completed : List.List String.String, flows : List.List (List.List String.String), params : Dict.Dict String.String (Dict.Dict String.String String.String), session : Maybe.Maybe String.String }"],"CustomServerError":["{ errcode : String.String, fullError : Json.Encode.Value, statusCode : Basics.Int }"]}},"Internal.Api.GetEvent.V1.SpecObjects.UnsignedData":{"args":[],"tags":{"UnsignedData":["{ age : Maybe.Maybe Basics.Int, prevContent : Maybe.Maybe Json.Encode.Value, redactedBecause : Maybe.Maybe Internal.Api.GetEvent.V1.SpecObjects.ClientEvent, transactionId : Maybe.Maybe String.String }"]}},"Internal.Api.GetMessages.V4.SpecObjects.UnsignedData":{"args":[],"tags":{"UnsignedData":["{ age : Maybe.Maybe Basics.Int, prevContent : Maybe.Maybe Json.Encode.Value, redactedBecause : Maybe.Maybe Internal.Api.GetMessages.V4.SpecObjects.ClientEvent, transactionId : Maybe.Maybe String.String }"]}},"Internal.Api.Sync.V2.SpecObjects.UnsignedData":{"args":[],"tags":{"UnsignedData":["{ age : Maybe.Maybe Basics.Int, prevContent : Maybe.Maybe Json.Encode.Value, redactedBecause : Maybe.Maybe Internal.Api.Sync.V2.SpecObjects.ClientEventWithoutRoomId, transactionId : Maybe.Maybe String.String }"]}},"Internal.Tools.SpecEnums.UserPresence":{"args":[],"tags":{"Offline":[],"Online":[],"UserUnavailable":[]}},"Json.Encode.Value":{"args":[],"tags":{"Value":[]}},"Dict.NColor":{"args":[],"tags":{"Red":[],"Black":[]}}}}})}}});}(this)); + $elm$json$Json$Decode$succeed(_Utils_Tuple0))({"versions":{"elm":"0.19.1"},"types":{"message":"Demos.Cookie.Msg","aliases":{"Matrix.VaultUpdate":{"args":[],"type":"Internal.Api.VaultUpdate.VaultUpdate"},"Internal.Api.Sync.V2.SpecObjects.AccountData":{"args":[],"type":"{ events : List.List Internal.Api.Sync.V2.SpecObjects.Event }"},"Internal.Api.Ban.Main.BanInput":{"args":[],"type":"Internal.Api.Ban.Api.BanInputV1"},"Internal.Api.Ban.Api.BanInputV1":{"args":[],"type":"{ reason : Maybe.Maybe String.String, roomId : String.String, userId : String.String }"},"Internal.Api.Ban.Main.BanOutput":{"args":[],"type":"Internal.Api.Ban.Api.BanOutputV1"},"Internal.Api.Ban.Api.BanOutputV1":{"args":[],"type":"()"},"Internal.Api.GetEvent.V1.SpecObjects.ClientEvent":{"args":[],"type":"{ content : Json.Encode.Value, eventId : String.String, originServerTs : Internal.Tools.Timestamp.Timestamp, roomId : String.String, sender : String.String, stateKey : Maybe.Maybe String.String, eventType : String.String, unsigned : Maybe.Maybe Internal.Api.GetEvent.V1.SpecObjects.UnsignedData }"},"Internal.Api.GetMessages.V4.SpecObjects.ClientEvent":{"args":[],"type":"{ content : Json.Encode.Value, eventId : String.String, originServerTs : Internal.Tools.Timestamp.Timestamp, roomId : String.String, sender : String.String, stateKey : Maybe.Maybe String.String, eventType : String.String, unsigned : Maybe.Maybe Internal.Api.GetMessages.V4.SpecObjects.UnsignedData }"},"Internal.Api.Sync.V2.SpecObjects.ClientEventWithoutRoomId":{"args":[],"type":"{ content : Json.Encode.Value, eventId : String.String, originServerTs : Internal.Tools.Timestamp.Timestamp, sender : String.String, stateKey : Maybe.Maybe String.String, eventType : String.String, unsigned : Maybe.Maybe Internal.Api.Sync.V2.SpecObjects.UnsignedData }"},"Internal.Api.LoginWithUsernameAndPassword.V5.Login.DiscoveryInformation":{"args":[],"type":"{ mHomeserver : Internal.Api.LoginWithUsernameAndPassword.V5.Login.HomeserverInformation, mIdentityServer : Maybe.Maybe Internal.Api.LoginWithUsernameAndPassword.V5.Login.IdentityServerInformation }"},"Internal.Api.Sync.V2.SpecObjects.Ephemeral":{"args":[],"type":"{ events : List.List Internal.Api.Sync.V2.SpecObjects.Event }"},"Internal.Api.Sync.V2.SpecObjects.Event":{"args":[],"type":"{ content : Json.Encode.Value, eventType : String.String }"},"Internal.Api.GetEvent.Main.EventInput":{"args":[],"type":"Internal.Api.GetEvent.Api.GetEventInputV1"},"Internal.Api.GetEvent.Main.EventOutput":{"args":[],"type":"Internal.Api.GetEvent.Api.GetEventOutputV1"},"Internal.Api.SendMessageEvent.V1.SpecObjects.EventResponse":{"args":[],"type":"{ eventId : String.String }"},"Internal.Api.SendStateKey.V1.SpecObjects.EventResponse":{"args":[],"type":"{ eventId : String.String }"},"Internal.Api.GetEvent.Api.GetEventInputV1":{"args":[],"type":"{ roomId : String.String }"},"Internal.Api.GetEvent.Api.GetEventOutputV1":{"args":[],"type":"Internal.Api.GetEvent.V1.SpecObjects.ClientEvent"},"Internal.Api.GetMessages.Main.GetMessagesInput":{"args":[],"type":"Internal.Api.GetMessages.Api.GetMessagesInputV4"},"Internal.Api.GetMessages.Api.GetMessagesInputV4":{"args":[],"type":"{ direction : Internal.Tools.SpecEnums.EventOrder, filter : Maybe.Maybe String.String, from : Maybe.Maybe String.String, limit : Maybe.Maybe Basics.Int, roomId : String.String, to : Maybe.Maybe String.String }"},"Internal.Api.GetMessages.Main.GetMessagesOutput":{"args":[],"type":"Internal.Api.GetMessages.Api.GetMessagesOutputV4"},"Internal.Api.GetMessages.Api.GetMessagesOutputV4":{"args":[],"type":"Internal.Api.GetMessages.V4.SpecObjects.MessagesResponse"},"Internal.Api.LoginWithUsernameAndPassword.V5.Login.HomeserverInformation":{"args":[],"type":"{ baseUrl : String.String }"},"Internal.Api.LoginWithUsernameAndPassword.V5.Login.IdentityServerInformation":{"args":[],"type":"{ baseUrl : String.String }"},"Internal.Api.Invite.Main.InviteInput":{"args":[],"type":"Internal.Api.Invite.Api.InviteInputV2"},"Internal.Api.Invite.Api.InviteInputV2":{"args":[],"type":"{ reason : Maybe.Maybe String.String, roomId : String.String, userId : String.String }"},"Internal.Api.Invite.Main.InviteOutput":{"args":[],"type":"Internal.Api.Invite.Api.InviteOutputV1"},"Internal.Api.Invite.Api.InviteOutputV1":{"args":[],"type":"()"},"Internal.Api.Sync.V2.SpecObjects.InviteState":{"args":[],"type":"{ events : List.List Internal.Api.Sync.V2.SpecObjects.StrippedStateEvent }"},"Internal.Api.Sync.V2.SpecObjects.InvitedRoom":{"args":[],"type":"{ inviteState : Maybe.Maybe Internal.Api.Sync.V2.SpecObjects.InviteState }"},"Internal.Api.JoinRoomById.Main.JoinRoomByIdInput":{"args":[],"type":"Internal.Api.JoinRoomById.Api.JoinRoomByIdInputV2"},"Internal.Api.JoinRoomById.Api.JoinRoomByIdInputV2":{"args":[],"type":"{ roomId : String.String, reason : Maybe.Maybe String.String }"},"Internal.Api.JoinRoomById.Main.JoinRoomByIdOutput":{"args":[],"type":"Internal.Api.JoinRoomById.Api.JoinRoomByIdOutputV1"},"Internal.Api.JoinRoomById.Api.JoinRoomByIdOutputV1":{"args":[],"type":"{ roomId : String.String }"},"Internal.Api.JoinedMembers.Main.JoinedMembersInput":{"args":[],"type":"Internal.Api.JoinedMembers.Api.JoinedMembersInputV1"},"Internal.Api.JoinedMembers.Api.JoinedMembersInputV1":{"args":[],"type":"{ roomId : String.String }"},"Internal.Api.JoinedMembers.Main.JoinedMembersOutput":{"args":[],"type":"Internal.Api.JoinedMembers.Api.JoinedMembersOutputV1"},"Internal.Api.JoinedMembers.Api.JoinedMembersOutputV1":{"args":[],"type":"Internal.Api.JoinedMembers.V1.SpecObjects.RoomMemberList"},"Internal.Api.Sync.V2.SpecObjects.JoinedRoom":{"args":[],"type":"{ accountData : Maybe.Maybe Internal.Api.Sync.V2.SpecObjects.AccountData, ephemeral : Maybe.Maybe Internal.Api.Sync.V2.SpecObjects.Ephemeral, state : Maybe.Maybe Internal.Api.Sync.V2.SpecObjects.State, summary : Maybe.Maybe Internal.Api.Sync.V2.SpecObjects.RoomSummary, timeline : Maybe.Maybe Internal.Api.Sync.V2.SpecObjects.Timeline, unreadNotifications : Maybe.Maybe Internal.Api.Sync.V2.SpecObjects.UnreadNotificationCounts, unreadThreadNotifications : Dict.Dict String.String Internal.Api.Sync.V2.SpecObjects.ThreadNotificationCounts }"},"Internal.Api.Sync.V2.SpecObjects.KnockState":{"args":[],"type":"{ events : List.List Internal.Api.Sync.V2.SpecObjects.StrippedStateEvent }"},"Internal.Api.Sync.V2.SpecObjects.KnockedRoom":{"args":[],"type":"{ knockState : Maybe.Maybe Internal.Api.Sync.V2.SpecObjects.KnockState }"},"Internal.Api.Leave.Main.LeaveInput":{"args":[],"type":"Internal.Api.Leave.Api.LeaveInputV2"},"Internal.Api.Leave.Api.LeaveInputV2":{"args":[],"type":"{ roomId : String.String, reason : Maybe.Maybe String.String }"},"Internal.Api.Leave.Main.LeaveOutput":{"args":[],"type":"Internal.Api.Leave.Api.LeaveOutputV1"},"Internal.Api.Leave.Api.LeaveOutputV1":{"args":[],"type":"()"},"Internal.Api.Sync.V2.SpecObjects.LeftRoom":{"args":[],"type":"{ accountData : Maybe.Maybe Internal.Api.Sync.V2.SpecObjects.AccountData, state : Maybe.Maybe Internal.Api.Sync.V2.SpecObjects.State, timeline : Maybe.Maybe Internal.Api.Sync.V2.SpecObjects.Timeline }"},"Internal.Api.LoginWithUsernameAndPassword.V5.Login.LoggedInResponse":{"args":[],"type":"{ accessToken : String.String, deviceId : Maybe.Maybe String.String, expiresInMs : Maybe.Maybe Basics.Int, homeServer : Maybe.Maybe String.String, refreshToken : Maybe.Maybe String.String, userId : String.String, wellKnown : Maybe.Maybe Internal.Api.LoginWithUsernameAndPassword.V5.Login.DiscoveryInformation }"},"Internal.Api.LoginWithUsernameAndPassword.Main.LoginWithUsernameAndPasswordInput":{"args":[],"type":"Internal.Api.LoginWithUsernameAndPassword.Api.LoginWithUsernameAndPasswordInputV2"},"Internal.Api.LoginWithUsernameAndPassword.Api.LoginWithUsernameAndPasswordInputV2":{"args":[],"type":"{ deviceId : Maybe.Maybe String.String, initialDeviceDisplayName : Maybe.Maybe String.String, password : String.String, username : String.String }"},"Internal.Api.LoginWithUsernameAndPassword.Main.LoginWithUsernameAndPasswordOutput":{"args":[],"type":"Internal.Api.LoginWithUsernameAndPassword.Api.LoginWithUsernameAndPasswordOutputV5"},"Internal.Api.LoginWithUsernameAndPassword.Api.LoginWithUsernameAndPasswordOutputV5":{"args":[],"type":"Internal.Api.LoginWithUsernameAndPassword.V5.Login.LoggedInResponse"},"Internal.Api.GetMessages.V4.SpecObjects.MessagesResponse":{"args":[],"type":"{ chunk : List.List Internal.Api.GetMessages.V4.SpecObjects.ClientEvent, end : Maybe.Maybe String.String, start : String.String, state : List.List Internal.Api.GetMessages.V4.SpecObjects.ClientEvent }"},"Internal.Api.Sync.V2.SpecObjects.Presence":{"args":[],"type":"{ events : List.List Internal.Api.Sync.V2.SpecObjects.Event }"},"Internal.Api.Redact.Main.RedactInput":{"args":[],"type":"Internal.Api.Redact.Api.RedactInputV1"},"Internal.Api.Redact.Api.RedactInputV1":{"args":[],"type":"{ roomId : String.String, eventId : String.String, reason : Maybe.Maybe String.String }"},"Internal.Api.Redact.Main.RedactOutput":{"args":[],"type":"Internal.Api.Redact.Api.RedactOutputV1"},"Internal.Api.Redact.Api.RedactOutputV1":{"args":[],"type":"Internal.Api.Redact.V1.SpecObjects.Redaction"},"Internal.Api.Redact.V1.SpecObjects.Redaction":{"args":[],"type":"{ eventId : String.String }"},"Internal.Api.JoinedMembers.V1.SpecObjects.RoomMember":{"args":[],"type":"{ avatarUrl : Maybe.Maybe String.String, displayName : Maybe.Maybe String.String }"},"Internal.Api.JoinedMembers.V1.SpecObjects.RoomMemberList":{"args":[],"type":"{ joined : Dict.Dict String.String Internal.Api.JoinedMembers.V1.SpecObjects.RoomMember }"},"Internal.Api.Sync.V2.SpecObjects.RoomSummary":{"args":[],"type":"{ mHeroes : Maybe.Maybe (List.List String.String), mInvitedMemberCount : Maybe.Maybe Basics.Int, mJoinedMemberCount : Maybe.Maybe Basics.Int }"},"Internal.Api.Sync.V2.SpecObjects.Rooms":{"args":[],"type":"{ invite : Dict.Dict String.String Internal.Api.Sync.V2.SpecObjects.InvitedRoom, join : Dict.Dict String.String Internal.Api.Sync.V2.SpecObjects.JoinedRoom, knock : Dict.Dict String.String Internal.Api.Sync.V2.SpecObjects.KnockedRoom, leave : Dict.Dict String.String Internal.Api.Sync.V2.SpecObjects.LeftRoom }"},"Internal.Api.SendMessageEvent.Main.SendMessageEventInput":{"args":[],"type":"Internal.Api.SendMessageEvent.Api.SendMessageEventInputV1"},"Internal.Api.SendMessageEvent.Api.SendMessageEventInputV1":{"args":[],"type":"{ content : Json.Decode.Value, eventType : String.String, roomId : String.String }"},"Internal.Api.SendMessageEvent.Main.SendMessageEventOutput":{"args":[],"type":"Internal.Api.SendMessageEvent.Api.SendMessageEventOutputV1"},"Internal.Api.SendMessageEvent.Api.SendMessageEventOutputV1":{"args":[],"type":"Internal.Api.SendMessageEvent.V1.SpecObjects.EventResponse"},"Internal.Api.SendStateKey.Main.SendStateKeyInput":{"args":[],"type":"Internal.Api.SendStateKey.Api.SendStateKeyInputV1"},"Internal.Api.SendStateKey.Api.SendStateKeyInputV1":{"args":[],"type":"{ content : Json.Decode.Value, eventType : String.String, roomId : String.String, stateKey : String.String }"},"Internal.Api.SendStateKey.Main.SendStateKeyOutput":{"args":[],"type":"Internal.Api.SendStateKey.Api.SendStateKeyOutputV1"},"Internal.Api.SendStateKey.Api.SendStateKeyOutputV1":{"args":[],"type":"Internal.Api.SendStateKey.V1.SpecObjects.EventResponse"},"Internal.Api.Sync.V2.SpecObjects.State":{"args":[],"type":"{ events : List.List Internal.Api.Sync.V2.SpecObjects.ClientEventWithoutRoomId }"},"Internal.Api.Sync.V2.SpecObjects.StrippedStateEvent":{"args":[],"type":"{ content : Json.Encode.Value, sender : String.String, stateKey : String.String, eventType : String.String }"},"Internal.Api.Sync.V2.SpecObjects.Sync":{"args":[],"type":"{ accountData : Maybe.Maybe Internal.Api.Sync.V2.SpecObjects.AccountData, nextBatch : String.String, presence : Maybe.Maybe Internal.Api.Sync.V2.SpecObjects.Presence, rooms : Maybe.Maybe Internal.Api.Sync.V2.SpecObjects.Rooms }"},"Internal.Api.Sync.Main.SyncInput":{"args":[],"type":"Internal.Api.Sync.Api.SyncInputV1"},"Internal.Api.Sync.Api.SyncInputV1":{"args":[],"type":"{ filter : Maybe.Maybe String.String, fullState : Maybe.Maybe Basics.Bool, setPresence : Maybe.Maybe Internal.Tools.SpecEnums.UserPresence, since : Maybe.Maybe String.String, timeout : Maybe.Maybe Basics.Int }"},"Internal.Api.Sync.Main.SyncOutput":{"args":[],"type":"Internal.Api.Sync.Api.SyncOutputV2"},"Internal.Api.Sync.Api.SyncOutputV2":{"args":[],"type":"Internal.Api.Sync.V2.SpecObjects.Sync"},"Internal.Api.Sync.V2.SpecObjects.ThreadNotificationCounts":{"args":[],"type":"{ highlightCount : Maybe.Maybe Basics.Int, notificationCount : Maybe.Maybe Basics.Int }"},"Internal.Api.Sync.V2.SpecObjects.Timeline":{"args":[],"type":"{ events : List.List Internal.Api.Sync.V2.SpecObjects.ClientEventWithoutRoomId, limited : Basics.Bool, prevBatch : Maybe.Maybe String.String }"},"Internal.Tools.Timestamp.Timestamp":{"args":[],"type":"Time.Posix"},"Internal.Api.Sync.V2.SpecObjects.UnreadNotificationCounts":{"args":[],"type":"{ highlightCount : Maybe.Maybe Basics.Int, notificationCount : Maybe.Maybe Basics.Int }"},"Json.Decode.Value":{"args":[],"type":"Json.Encode.Value"},"Internal.Api.Versions.V1.Versions.Versions":{"args":[],"type":"{ unstableFeatures : Dict.Dict String.String Basics.Bool, versions : List.List String.String }"},"Internal.Api.WhoAmI.Main.WhoAmIOutput":{"args":[],"type":"Internal.Api.WhoAmI.Api.WhoAmIOutputV3"},"Internal.Api.WhoAmI.Api.WhoAmIOutputV3":{"args":[],"type":"Internal.Api.WhoAmI.V3.SpecObjects.WhoAmIResponse"},"Internal.Api.WhoAmI.V3.SpecObjects.WhoAmIResponse":{"args":[],"type":"{ deviceId : Maybe.Maybe String.String, isGuest : Basics.Bool, userId : String.String }"}},"unions":{"Demos.Cookie.Msg":{"args":[],"tags":{"Login":["{ accessToken : String.String, baseUrl : String.String }"],"SendEventToRoom":["String.String"],"SyncVault":[],"VaultUpdate":["Result.Result Internal.Tools.Exceptions.Error Matrix.VaultUpdate"],"WriteAccessToken":["String.String"],"WriteBaseUrl":["String.String"]}},"Internal.Tools.Exceptions.Error":{"args":[],"tags":{"InternetException":["Http.Error"],"SDKException":["Internal.Tools.Exceptions.ClientError"],"ServerException":["Internal.Tools.Exceptions.ServerError"],"UnsupportedSpecVersion":[]}},"Result.Result":{"args":["error","value"],"tags":{"Ok":["value"],"Err":["error"]}},"String.String":{"args":[],"tags":{"String":[]}},"Internal.Api.VaultUpdate.VaultUpdate":{"args":[],"tags":{"MultipleUpdates":["List.List Internal.Api.VaultUpdate.VaultUpdate"],"BanUser":["Internal.Api.Ban.Main.BanInput","Internal.Api.Ban.Main.BanOutput"],"GetEvent":["Internal.Api.GetEvent.Main.EventInput","Internal.Api.GetEvent.Main.EventOutput"],"GetMessages":["Internal.Api.GetMessages.Main.GetMessagesInput","Internal.Api.GetMessages.Main.GetMessagesOutput"],"InviteSent":["Internal.Api.Invite.Main.InviteInput","Internal.Api.Invite.Main.InviteOutput"],"JoinedMembersToRoom":["Internal.Api.JoinedMembers.Main.JoinedMembersInput","Internal.Api.JoinedMembers.Main.JoinedMembersOutput"],"JoinedRoom":["Internal.Api.JoinRoomById.Main.JoinRoomByIdInput","Internal.Api.JoinRoomById.Main.JoinRoomByIdOutput"],"LeftRoom":["Internal.Api.Leave.Main.LeaveInput","Internal.Api.Leave.Main.LeaveOutput"],"LoggedInWithUsernameAndPassword":["Internal.Api.LoginWithUsernameAndPassword.Main.LoginWithUsernameAndPasswordInput","Internal.Api.LoginWithUsernameAndPassword.Main.LoginWithUsernameAndPasswordOutput"],"MessageEventSent":["Internal.Api.SendMessageEvent.Main.SendMessageEventInput","Internal.Api.SendMessageEvent.Main.SendMessageEventOutput"],"RedactedEvent":["Internal.Api.Redact.Main.RedactInput","Internal.Api.Redact.Main.RedactOutput"],"StateEventSent":["Internal.Api.SendStateKey.Main.SendStateKeyInput","Internal.Api.SendStateKey.Main.SendStateKeyOutput"],"SyncUpdate":["Internal.Api.Sync.Main.SyncInput","Internal.Api.Sync.Main.SyncOutput"],"UpdateAccessToken":["String.String"],"UpdateVersions":["Internal.Api.Versions.V1.Versions.Versions"],"UpdateRawAccessToken":["String.String","Internal.Api.WhoAmI.Main.WhoAmIOutput"]}},"Basics.Bool":{"args":[],"tags":{"True":[],"False":[]}},"Internal.Tools.Exceptions.ClientError":{"args":[],"tags":{"ServerReturnsBadJSON":["String.String"],"NotSupportedYet":["String.String"],"NoAccessToken":[]}},"Dict.Dict":{"args":["k","v"],"tags":{"RBNode_elm_builtin":["Dict.NColor","k","v","Dict.Dict k v","Dict.Dict k v"],"RBEmpty_elm_builtin":[]}},"Http.Error":{"args":[],"tags":{"BadUrl":["String.String"],"Timeout":[],"NetworkError":[],"BadStatus":["Basics.Int"],"BadBody":["String.String"]}},"Internal.Tools.SpecEnums.EventOrder":{"args":[],"tags":{"Chronological":[],"ReverseChronological":[]}},"Basics.Int":{"args":[],"tags":{"Int":[]}},"List.List":{"args":["a"],"tags":{}},"Maybe.Maybe":{"args":["a"],"tags":{"Just":["a"],"Nothing":[]}},"Time.Posix":{"args":[],"tags":{"Posix":["Basics.Int"]}},"Internal.Tools.Exceptions.ServerError":{"args":[],"tags":{"M_FORBIDDEN":["{ error : Maybe.Maybe String.String }"],"M_UNKNOWN_TOKEN":["{ error : Maybe.Maybe String.String, soft_logout : Maybe.Maybe Basics.Bool }"],"M_MISSING_TOKEN":["{ error : Maybe.Maybe String.String, soft_logout : Maybe.Maybe Basics.Bool }"],"M_BAD_JSON":["{ error : Maybe.Maybe String.String }"],"M_NOT_JSON":["{ error : Maybe.Maybe String.String }"],"M_NOT_FOUND":["{ error : Maybe.Maybe String.String }"],"M_LIMIT_EXCEEDED":["{ error : Maybe.Maybe String.String, retryAfterMs : Maybe.Maybe Basics.Int }"],"M_UNKNOWN":["{ error : Maybe.Maybe String.String }"],"M_UNRECOGNIZED":["{ error : Maybe.Maybe String.String }"],"M_UNAUTHORIZED":["{ error : Maybe.Maybe String.String }"],"M_USER_DEACTIVATED":["{ error : Maybe.Maybe String.String }"],"M_USER_IN_USE":["{ error : Maybe.Maybe String.String }"],"M_INVALID_USERNAME":["{ error : Maybe.Maybe String.String }"],"M_ROOM_IN_USE":["{ error : Maybe.Maybe String.String }"],"M_INVALID_ROOM_STATE":["{ error : Maybe.Maybe String.String }"],"M_THREEPID_IN_USE":["{ error : Maybe.Maybe String.String }"],"M_THREEPID_NOT_FOUND":["{ error : Maybe.Maybe String.String }"],"M_THREEPID_AUTH_FAILED":["{ error : Maybe.Maybe String.String }"],"M_THREEPID_DENIED":["{ error : Maybe.Maybe String.String }"],"M_SERVER_NOT_TRUSTED":["{ error : Maybe.Maybe String.String }"],"M_UNSUPPORTED_ROOM_VERSION":["{ error : Maybe.Maybe String.String }"],"M_INCOMPATIBLE_ROOM_VERSION":["{ error : Maybe.Maybe String.String, room_version : Maybe.Maybe String.String }"],"M_BAD_STATE":["{ error : Maybe.Maybe String.String }"],"M_GUEST_ACCESS_FORBIDDEN":["{ error : Maybe.Maybe String.String }"],"M_CAPTCHA_NEEDED":["{ error : Maybe.Maybe String.String }"],"M_CAPTCHA_INVALID":["{ error : Maybe.Maybe String.String }"],"M_MISSING_PARAM":["{ error : Maybe.Maybe String.String }"],"M_INVALID_PARAM":["{ error : Maybe.Maybe String.String }"],"M_TOO_LARGE":["{ error : Maybe.Maybe String.String }"],"M_EXCLUSIVE":["{ error : Maybe.Maybe String.String }"],"M_RESOURCE_LIMIT_EXCEEDED":["{ error : Maybe.Maybe String.String, adminContact : String.String }"],"M_CANNOT_LEAVE_SERVER_NOTICE_ROOM":["{ error : Maybe.Maybe String.String }"],"RequiresUserInteractiveAuthentication":["{ completed : List.List String.String, flows : List.List (List.List String.String), params : Dict.Dict String.String (Dict.Dict String.String String.String), session : Maybe.Maybe String.String }"],"CustomServerError":["{ errcode : String.String, fullError : Json.Encode.Value, statusCode : Basics.Int }"]}},"Internal.Api.GetEvent.V1.SpecObjects.UnsignedData":{"args":[],"tags":{"UnsignedData":["{ age : Maybe.Maybe Basics.Int, prevContent : Maybe.Maybe Json.Encode.Value, redactedBecause : Maybe.Maybe Internal.Api.GetEvent.V1.SpecObjects.ClientEvent, transactionId : Maybe.Maybe String.String }"]}},"Internal.Api.GetMessages.V4.SpecObjects.UnsignedData":{"args":[],"tags":{"UnsignedData":["{ age : Maybe.Maybe Basics.Int, prevContent : Maybe.Maybe Json.Encode.Value, redactedBecause : Maybe.Maybe Internal.Api.GetMessages.V4.SpecObjects.ClientEvent, transactionId : Maybe.Maybe String.String }"]}},"Internal.Api.Sync.V2.SpecObjects.UnsignedData":{"args":[],"tags":{"UnsignedData":["{ age : Maybe.Maybe Basics.Int, prevContent : Maybe.Maybe Json.Encode.Value, redactedBecause : Maybe.Maybe Internal.Api.Sync.V2.SpecObjects.ClientEventWithoutRoomId, transactionId : Maybe.Maybe String.String }"]}},"Internal.Tools.SpecEnums.UserPresence":{"args":[],"tags":{"Offline":[],"Online":[],"UserUnavailable":[]}},"Json.Encode.Value":{"args":[],"tags":{"Value":[]}},"Dict.NColor":{"args":[],"tags":{"Red":[],"Black":[]}}}}})}}});}(this)); var app = Elm.Demos.Cookie.init({ node: document.getElementById("elm") }); } diff --git a/src/Internal/Api/GetEvent/V1/SpecObjects.elm b/src/Internal/Api/GetEvent/V1/SpecObjects.elm index fc30d61..b28681a 100644 --- a/src/Internal/Api/GetEvent/V1/SpecObjects.elm +++ b/src/Internal/Api/GetEvent/V1/SpecObjects.elm @@ -9,7 +9,7 @@ module Internal.Api.GetEvent.V1.SpecObjects exposing {-| Automatically generated 'SpecObjects' -Last generated at Unix time 1676311233 +Last generated at Unix time 1680263083 -} @@ -29,7 +29,7 @@ type alias ClientEvent = , roomId : String , sender : String , stateKey : Maybe String - , contentType : String + , eventType : String , unsigned : Maybe UnsignedData } @@ -43,7 +43,7 @@ encodeClientEvent data = , ( "room_id", Just <| E.string data.roomId ) , ( "sender", Just <| E.string data.sender ) , ( "state_key", Maybe.map E.string data.stateKey ) - , ( "type", Just <| E.string data.contentType ) + , ( "type", Just <| E.string data.eventType ) , ( "unsigned", Maybe.map encodeUnsignedData data.unsigned ) ] @@ -52,7 +52,7 @@ clientEventDecoder : D.Decoder ClientEvent clientEventDecoder = D.map8 (\a b c d e f g h -> - { content = a, eventId = b, originServerTs = c, roomId = d, sender = e, stateKey = f, contentType = g, unsigned = h } + { content = a, eventId = b, originServerTs = c, roomId = d, sender = e, stateKey = f, eventType = g, unsigned = h } ) (D.field "content" D.value) (D.field "event_id" D.string) diff --git a/src/Internal/Api/GetMessages/V1/SpecObjects.elm b/src/Internal/Api/GetMessages/V1/SpecObjects.elm index cc7525f..163b297 100644 --- a/src/Internal/Api/GetMessages/V1/SpecObjects.elm +++ b/src/Internal/Api/GetMessages/V1/SpecObjects.elm @@ -9,7 +9,7 @@ module Internal.Api.GetMessages.V1.SpecObjects exposing {-| Automatically generated 'SpecObjects' -Last generated at Unix time 1679486096 +Last generated at Unix time 1680263083 -} @@ -59,7 +59,7 @@ type alias RoomEvent = , prevContent : Maybe E.Value , roomId : String , stateKey : Maybe String - , contentType : String + , eventType : String , userId : String } @@ -74,7 +74,7 @@ encodeRoomEvent data = , ( "prev_content", data.prevContent ) , ( "room_id", Just <| E.string data.roomId ) , ( "state_key", Maybe.map E.string data.stateKey ) - , ( "type", Just <| E.string data.contentType ) + , ( "type", Just <| E.string data.eventType ) , ( "user_id", Just <| E.string data.userId ) ] @@ -83,7 +83,7 @@ roomEventDecoder : D.Decoder RoomEvent roomEventDecoder = D.map9 (\a b c d e f g h i -> - { age = a, content = b, eventId = c, originServerTs = d, prevContent = e, roomId = f, stateKey = g, contentType = h, userId = i } + { age = a, content = b, eventId = c, originServerTs = d, prevContent = e, roomId = f, stateKey = g, eventType = h, userId = i } ) (opField "age" D.int) (D.field "content" D.value) diff --git a/src/Internal/Api/GetMessages/V2/SpecObjects.elm b/src/Internal/Api/GetMessages/V2/SpecObjects.elm index ac6587c..6571a3e 100644 --- a/src/Internal/Api/GetMessages/V2/SpecObjects.elm +++ b/src/Internal/Api/GetMessages/V2/SpecObjects.elm @@ -12,7 +12,7 @@ module Internal.Api.GetMessages.V2.SpecObjects exposing {-| Automatically generated 'SpecObjects' -Last generated at Unix time 1679486096 +Last generated at Unix time 1680263083 -} @@ -62,7 +62,7 @@ type alias RoomEvent = , roomId : String , sender : String , stateKey : Maybe String - , contentType : String + , eventType : String , unsigned : Maybe UnsignedData } @@ -77,7 +77,7 @@ encodeRoomEvent data = , ( "room_id", Just <| E.string data.roomId ) , ( "sender", Just <| E.string data.sender ) , ( "state_key", Maybe.map E.string data.stateKey ) - , ( "type", Just <| E.string data.contentType ) + , ( "type", Just <| E.string data.eventType ) , ( "unsigned", Maybe.map encodeUnsignedData data.unsigned ) ] @@ -86,7 +86,7 @@ roomEventDecoder : D.Decoder RoomEvent roomEventDecoder = D.map9 (\a b c d e f g h i -> - { content = a, eventId = b, originServerTs = c, prevContent = d, roomId = e, sender = f, stateKey = g, contentType = h, unsigned = i } + { content = a, eventId = b, originServerTs = c, prevContent = d, roomId = e, sender = f, stateKey = g, eventType = h, unsigned = i } ) (D.field "content" D.value) (D.field "event_id" D.string) diff --git a/src/Internal/Api/GetMessages/V2/Upcast.elm b/src/Internal/Api/GetMessages/V2/Upcast.elm index 824842c..dcf9beb 100644 --- a/src/Internal/Api/GetMessages/V2/Upcast.elm +++ b/src/Internal/Api/GetMessages/V2/Upcast.elm @@ -19,7 +19,7 @@ upcastRoomEvent old = , originServerTs = old.originServerTs , roomId = old.roomId , sender = old.userId - , contentType = old.contentType + , eventType = old.eventType , prevContent = old.prevContent , stateKey = old.stateKey , unsigned = diff --git a/src/Internal/Api/GetMessages/V3/SpecObjects.elm b/src/Internal/Api/GetMessages/V3/SpecObjects.elm index ef6eba9..951c95e 100644 --- a/src/Internal/Api/GetMessages/V3/SpecObjects.elm +++ b/src/Internal/Api/GetMessages/V3/SpecObjects.elm @@ -15,7 +15,7 @@ module Internal.Api.GetMessages.V3.SpecObjects exposing {-| Automatically generated 'SpecObjects' -Last generated at Unix time 1679486096 +Last generated at Unix time 1680263083 -} @@ -68,7 +68,7 @@ type alias RoomEvent = , roomId : String , sender : String , stateKey : Maybe String - , contentType : String + , eventType : String , unsigned : Maybe UnsignedData } @@ -83,7 +83,7 @@ encodeRoomEvent data = , ( "room_id", Just <| E.string data.roomId ) , ( "sender", Just <| E.string data.sender ) , ( "state_key", Maybe.map E.string data.stateKey ) - , ( "type", Just <| E.string data.contentType ) + , ( "type", Just <| E.string data.eventType ) , ( "unsigned", Maybe.map encodeUnsignedData data.unsigned ) ] @@ -92,7 +92,7 @@ roomEventDecoder : D.Decoder RoomEvent roomEventDecoder = D.map9 (\a b c d e f g h i -> - { content = a, eventId = b, originServerTs = c, prevContent = d, roomId = e, sender = f, stateKey = g, contentType = h, unsigned = i } + { content = a, eventId = b, originServerTs = c, prevContent = d, roomId = e, sender = f, stateKey = g, eventType = h, unsigned = i } ) (D.field "content" D.value) (D.field "event_id" D.string) @@ -115,7 +115,7 @@ type alias RoomStateEvent = , roomId : String , sender : String , stateKey : String - , contentType : String + , eventType : String , unsigned : Maybe UnsignedData } @@ -130,7 +130,7 @@ encodeRoomStateEvent data = , ( "room_id", Just <| E.string data.roomId ) , ( "sender", Just <| E.string data.sender ) , ( "state_key", Just <| E.string data.stateKey ) - , ( "type", Just <| E.string data.contentType ) + , ( "type", Just <| E.string data.eventType ) , ( "unsigned", Maybe.map encodeUnsignedData data.unsigned ) ] @@ -139,7 +139,7 @@ roomStateEventDecoder : D.Decoder RoomStateEvent roomStateEventDecoder = D.map9 (\a b c d e f g h i -> - { content = a, eventId = b, originServerTs = c, prevContent = d, roomId = e, sender = f, stateKey = g, contentType = h, unsigned = i } + { content = a, eventId = b, originServerTs = c, prevContent = d, roomId = e, sender = f, stateKey = g, eventType = h, unsigned = i } ) (D.field "content" D.value) (D.field "event_id" D.string) diff --git a/src/Internal/Api/GetMessages/V3/Upcast.elm b/src/Internal/Api/GetMessages/V3/Upcast.elm index 33e4e5b..d243e3f 100644 --- a/src/Internal/Api/GetMessages/V3/Upcast.elm +++ b/src/Internal/Api/GetMessages/V3/Upcast.elm @@ -20,7 +20,7 @@ upcastRoomEvent old = , originServerTs = old.originServerTs , roomId = old.roomId , sender = old.sender - , contentType = old.contentType + , eventType = old.eventType , prevContent = old.prevContent , stateKey = old.stateKey , unsigned = diff --git a/src/Internal/Api/GetMessages/V4/SpecObjects.elm b/src/Internal/Api/GetMessages/V4/SpecObjects.elm index d8f3e9a..74fc8ed 100644 --- a/src/Internal/Api/GetMessages/V4/SpecObjects.elm +++ b/src/Internal/Api/GetMessages/V4/SpecObjects.elm @@ -12,7 +12,7 @@ module Internal.Api.GetMessages.V4.SpecObjects exposing {-| Automatically generated 'SpecObjects' -Last generated at Unix time 1679486096 +Last generated at Unix time 1680263084 -} @@ -32,7 +32,7 @@ type alias ClientEvent = , roomId : String , sender : String , stateKey : Maybe String - , contentType : String + , eventType : String , unsigned : Maybe UnsignedData } @@ -46,7 +46,7 @@ encodeClientEvent data = , ( "room_id", Just <| E.string data.roomId ) , ( "sender", Just <| E.string data.sender ) , ( "state_key", Maybe.map E.string data.stateKey ) - , ( "type", Just <| E.string data.contentType ) + , ( "type", Just <| E.string data.eventType ) , ( "unsigned", Maybe.map encodeUnsignedData data.unsigned ) ] @@ -55,7 +55,7 @@ clientEventDecoder : D.Decoder ClientEvent clientEventDecoder = D.map8 (\a b c d e f g h -> - { content = a, eventId = b, originServerTs = c, roomId = d, sender = e, stateKey = f, contentType = g, unsigned = h } + { content = a, eventId = b, originServerTs = c, roomId = d, sender = e, stateKey = f, eventType = g, unsigned = h } ) (D.field "content" D.value) (D.field "event_id" D.string) diff --git a/src/Internal/Api/GetMessages/V4/Upcast.elm b/src/Internal/Api/GetMessages/V4/Upcast.elm index fd29c97..e143dfe 100644 --- a/src/Internal/Api/GetMessages/V4/Upcast.elm +++ b/src/Internal/Api/GetMessages/V4/Upcast.elm @@ -22,7 +22,7 @@ upcastRoomEvent old = , roomId = old.roomId , sender = old.sender , stateKey = old.stateKey - , contentType = old.contentType + , eventType = old.eventType , unsigned = Maybe.map (upcastUnsigned old.prevContent) old.unsigned } @@ -35,7 +35,7 @@ upcastRoomStateEvent old = , roomId = old.roomId , sender = old.sender , stateKey = Just old.stateKey - , contentType = old.contentType + , eventType = old.eventType , unsigned = Maybe.map (upcastUnsigned old.prevContent) old.unsigned } diff --git a/src/Internal/Api/Sync/V1/SpecObjects.elm b/src/Internal/Api/Sync/V1/SpecObjects.elm index a61bd9c..6064155 100644 --- a/src/Internal/Api/Sync/V1/SpecObjects.elm +++ b/src/Internal/Api/Sync/V1/SpecObjects.elm @@ -60,7 +60,7 @@ module Internal.Api.Sync.V1.SpecObjects exposing {-| Automatically generated 'SpecObjects' -Last generated at Unix time 1676625734 +Last generated at Unix time 1680263084 -} @@ -103,7 +103,7 @@ type alias ClientEventWithoutRoomId = , originServerTs : Timestamp , sender : String , stateKey : Maybe String - , contentType : String + , eventType : String , unsigned : Maybe UnsignedData } @@ -116,7 +116,7 @@ encodeClientEventWithoutRoomId data = , ( "origin_server_ts", Just <| encodeTimestamp data.originServerTs ) , ( "sender", Just <| E.string data.sender ) , ( "state_key", Maybe.map E.string data.stateKey ) - , ( "type", Just <| E.string data.contentType ) + , ( "type", Just <| E.string data.eventType ) , ( "unsigned", Maybe.map encodeUnsignedData data.unsigned ) ] @@ -125,7 +125,7 @@ clientEventWithoutRoomIdDecoder : D.Decoder ClientEventWithoutRoomId clientEventWithoutRoomIdDecoder = D.map7 (\a b c d e f g -> - { content = a, eventId = b, originServerTs = c, sender = d, stateKey = e, contentType = f, unsigned = g } + { content = a, eventId = b, originServerTs = c, sender = d, stateKey = e, eventType = f, unsigned = g } ) (D.field "content" D.value) (D.field "event_id" D.string) @@ -163,7 +163,7 @@ ephemeralDecoder = -} type alias Event = { content : E.Value - , contentType : String + , eventType : String } @@ -171,7 +171,7 @@ encodeEvent : Event -> E.Value encodeEvent data = maybeObject [ ( "content", Just <| data.content ) - , ( "type", Just <| E.string data.contentType ) + , ( "type", Just <| E.string data.eventType ) ] @@ -179,7 +179,7 @@ eventDecoder : D.Decoder Event eventDecoder = D.map2 (\a b -> - { content = a, contentType = b } + { content = a, eventType = b } ) (D.field "content" D.value) (D.field "type" D.string) @@ -457,7 +457,7 @@ type alias StrippedStateEvent = { content : E.Value , sender : String , stateKey : String - , contentType : String + , eventType : String } @@ -467,7 +467,7 @@ encodeStrippedStateEvent data = [ ( "content", Just <| data.content ) , ( "sender", Just <| E.string data.sender ) , ( "state_key", Just <| E.string data.stateKey ) - , ( "type", Just <| E.string data.contentType ) + , ( "type", Just <| E.string data.eventType ) ] @@ -475,7 +475,7 @@ strippedStateEventDecoder : D.Decoder StrippedStateEvent strippedStateEventDecoder = D.map4 (\a b c d -> - { content = a, sender = b, stateKey = c, contentType = d } + { content = a, sender = b, stateKey = c, eventType = d } ) (D.field "content" D.value) (D.field "sender" D.string) diff --git a/src/Internal/Api/Sync/V2/SpecObjects.elm b/src/Internal/Api/Sync/V2/SpecObjects.elm index 70604f3..990e2dd 100644 --- a/src/Internal/Api/Sync/V2/SpecObjects.elm +++ b/src/Internal/Api/Sync/V2/SpecObjects.elm @@ -63,7 +63,7 @@ module Internal.Api.Sync.V2.SpecObjects exposing {-| Automatically generated 'SpecObjects' -Last generated at Unix time 1676625735 +Last generated at Unix time 1680263084 -} @@ -106,7 +106,7 @@ type alias ClientEventWithoutRoomId = , originServerTs : Timestamp , sender : String , stateKey : Maybe String - , contentType : String + , eventType : String , unsigned : Maybe UnsignedData } @@ -119,7 +119,7 @@ encodeClientEventWithoutRoomId data = , ( "origin_server_ts", Just <| encodeTimestamp data.originServerTs ) , ( "sender", Just <| E.string data.sender ) , ( "state_key", Maybe.map E.string data.stateKey ) - , ( "type", Just <| E.string data.contentType ) + , ( "type", Just <| E.string data.eventType ) , ( "unsigned", Maybe.map encodeUnsignedData data.unsigned ) ] @@ -128,7 +128,7 @@ clientEventWithoutRoomIdDecoder : D.Decoder ClientEventWithoutRoomId clientEventWithoutRoomIdDecoder = D.map7 (\a b c d e f g -> - { content = a, eventId = b, originServerTs = c, sender = d, stateKey = e, contentType = f, unsigned = g } + { content = a, eventId = b, originServerTs = c, sender = d, stateKey = e, eventType = f, unsigned = g } ) (D.field "content" D.value) (D.field "event_id" D.string) @@ -166,7 +166,7 @@ ephemeralDecoder = -} type alias Event = { content : E.Value - , contentType : String + , eventType : String } @@ -174,7 +174,7 @@ encodeEvent : Event -> E.Value encodeEvent data = maybeObject [ ( "content", Just <| data.content ) - , ( "type", Just <| E.string data.contentType ) + , ( "type", Just <| E.string data.eventType ) ] @@ -182,7 +182,7 @@ eventDecoder : D.Decoder Event eventDecoder = D.map2 (\a b -> - { content = a, contentType = b } + { content = a, eventType = b } ) (D.field "content" D.value) (D.field "type" D.string) @@ -463,7 +463,7 @@ type alias StrippedStateEvent = { content : E.Value , sender : String , stateKey : String - , contentType : String + , eventType : String } @@ -473,7 +473,7 @@ encodeStrippedStateEvent data = [ ( "content", Just <| data.content ) , ( "sender", Just <| E.string data.sender ) , ( "state_key", Just <| E.string data.stateKey ) - , ( "type", Just <| E.string data.contentType ) + , ( "type", Just <| E.string data.eventType ) ] @@ -481,7 +481,7 @@ strippedStateEventDecoder : D.Decoder StrippedStateEvent strippedStateEventDecoder = D.map4 (\a b c d -> - { content = a, sender = b, stateKey = c, contentType = d } + { content = a, sender = b, stateKey = c, eventType = d } ) (D.field "content" D.value) (D.field "sender" D.string) diff --git a/src/Internal/Api/Sync/V2/Upcast.elm b/src/Internal/Api/Sync/V2/Upcast.elm index a85066d..3f872fe 100644 --- a/src/Internal/Api/Sync/V2/Upcast.elm +++ b/src/Internal/Api/Sync/V2/Upcast.elm @@ -47,7 +47,7 @@ upcastClientEventWithoutRoomId old = , originServerTs = old.originServerTs , sender = old.sender , stateKey = old.stateKey - , contentType = old.contentType + , eventType = old.eventType , unsigned = Maybe.map upcastUnsigned old.unsigned } diff --git a/src/Internal/Event.elm b/src/Internal/Event.elm index 3df1122..fb189e9 100644 --- a/src/Internal/Event.elm +++ b/src/Internal/Event.elm @@ -49,7 +49,7 @@ initFromGetEvent output = , roomId = output.roomId , sender = output.sender , stateKey = output.stateKey - , contentType = output.contentType + , eventType = output.eventType , unsigned = output.unsigned |> Maybe.map @@ -75,7 +75,7 @@ initFromGetMessages output = , roomId = output.roomId , sender = output.sender , stateKey = output.stateKey - , contentType = output.contentType + , eventType = output.eventType , unsigned = output.unsigned |> Maybe.map @@ -101,7 +101,7 @@ initFromClientEventWithoutRoomId rId output = , roomId = rId , sender = output.sender , stateKey = output.stateKey - , contentType = output.contentType + , eventType = output.eventType , unsigned = output.unsigned |> Maybe.map @@ -156,9 +156,9 @@ stateKey = withoutCredentials >> Internal.stateKey -contentType : Event -> String -contentType = - withoutCredentials >> Internal.contentType +eventType : Event -> String +eventType = + withoutCredentials >> Internal.eventType age : Event -> Maybe Int diff --git a/src/Internal/Invite.elm b/src/Internal/Invite.elm index 4c4a36e..f1335f2 100644 --- a/src/Internal/Invite.elm +++ b/src/Internal/Invite.elm @@ -39,7 +39,7 @@ withoutCredentials (RoomInvite { invite }) = invite -getEvent : { contentType : String, stateKey : String } -> RoomInvite -> Maybe Internal.RoomInviteEvent +getEvent : { eventType : String, stateKey : String } -> RoomInvite -> Maybe Internal.RoomInviteEvent getEvent data = withoutCredentials >> Internal.getEvent data diff --git a/src/Internal/Room.elm b/src/Internal/Room.elm index fa26114..58bf907 100644 --- a/src/Internal/Room.elm +++ b/src/Internal/Room.elm @@ -44,7 +44,7 @@ initFromJoinedRoom data jroom = jroom.accountData |> Maybe.map .events |> Maybe.withDefault [] - |> List.map (\{ contentType, content } -> ( contentType, content )) + |> List.map (\{ eventType, content } -> ( eventType, content )) |> Dict.fromList , ephemeral = jroom.ephemeral @@ -86,6 +86,11 @@ initFromJoinedRoom data jroom = } +accountData : String -> Room -> Maybe E.Value +accountData key = + withoutCredentials >> Internal.accountData key + + {-| Adds an internal event to the `Room`. An internal event is a custom event that has been generated by the client. -} diff --git a/src/Internal/Values/Event.elm b/src/Internal/Values/Event.elm index 2ac8640..901ca62 100644 --- a/src/Internal/Values/Event.elm +++ b/src/Internal/Values/Event.elm @@ -12,7 +12,7 @@ type IEvent , roomId : String , sender : String , stateKey : Maybe String - , contentType : String + , eventType : String , unsigned : Maybe { age : Maybe Int @@ -30,7 +30,7 @@ init : , roomId : String , sender : String , stateKey : Maybe String - , contentType : String + , eventType : String , unsigned : Maybe { age : Maybe Int @@ -78,9 +78,9 @@ stateKey (IEvent e) = e.stateKey -contentType : IEvent -> String -contentType (IEvent e) = - e.contentType +eventType : IEvent -> String +eventType (IEvent e) = + e.eventType age : IEvent -> Maybe Int @@ -102,7 +102,7 @@ transactionId (IEvent e) = type BlindEvent - = BlindEvent { contentType : String, content : E.Value } + = BlindEvent { eventType : String, content : E.Value } blindContent : BlindEvent -> E.Value @@ -112,4 +112,4 @@ blindContent (BlindEvent be) = blindContentType : BlindEvent -> String blindContentType (BlindEvent be) = - be.contentType + be.eventType diff --git a/src/Internal/Values/RoomInvite.elm b/src/Internal/Values/RoomInvite.elm index 9819f5b..d4f858e 100644 --- a/src/Internal/Values/RoomInvite.elm +++ b/src/Internal/Values/RoomInvite.elm @@ -19,24 +19,24 @@ type RoomInviteEvent { content : E.Value , sender : String , stateKey : String - , contentType : String + , eventType : String } -init : { roomId : String, events : List { content : E.Value, sender : String, stateKey : String, contentType : String } } -> IRoomInvite +init : { roomId : String, events : List { content : E.Value, sender : String, stateKey : String, eventType : String } } -> IRoomInvite init data = data.events |> List.map (\event -> - ( ( event.contentType, event.stateKey ), RoomInviteEvent event ) + ( ( event.eventType, event.stateKey ), RoomInviteEvent event ) ) |> Dict.fromList |> (\e -> IRoomInvite { roomId = data.roomId, events = e }) -getEvent : { contentType : String, stateKey : String } -> IRoomInvite -> Maybe RoomInviteEvent +getEvent : { eventType : String, stateKey : String } -> IRoomInvite -> Maybe RoomInviteEvent getEvent data (IRoomInvite { events }) = - Dict.get ( data.contentType, data.stateKey ) events + Dict.get ( data.eventType, data.stateKey ) events getAllEvents : IRoomInvite -> List RoomInviteEvent @@ -64,6 +64,6 @@ stateKey (RoomInviteEvent data) = data.stateKey -contentType : RoomInviteEvent -> String -contentType (RoomInviteEvent data) = - data.contentType +eventType : RoomInviteEvent -> String +eventType (RoomInviteEvent data) = + data.eventType diff --git a/src/Internal/Values/StateManager.elm b/src/Internal/Values/StateManager.elm index d83aad3..705397a 100644 --- a/src/Internal/Values/StateManager.elm +++ b/src/Internal/Values/StateManager.elm @@ -12,7 +12,7 @@ addEvent : IEvent -> StateManager -> StateManager addEvent event oldManager = case Event.stateKey event of Just key -> - Dict.insert ( Event.contentType event, key ) event oldManager + Dict.insert ( Event.eventType event, key ) event oldManager Nothing -> oldManager diff --git a/src/Matrix/Event.elm b/src/Matrix/Event.elm index 5abc4c9..b547a20 100644 --- a/src/Matrix/Event.elm +++ b/src/Matrix/Event.elm @@ -1,5 +1,5 @@ module Matrix.Event exposing - ( Event, contentType, content, stateKey + ( Event, eventType, content, stateKey , eventId, roomId, sender, originServerTs, redactedBecause ) @@ -8,7 +8,7 @@ module Matrix.Event exposing # Event -@docs Event, contentType, content, stateKey +@docs Event, eventType, content, stateKey ## Getting metadata @@ -75,9 +75,9 @@ stateKey = {-| This is the type of the event's content. For example, `m.room.message` indicates that it was a message. -} -contentType : Event -> String -contentType = - Internal.contentType +eventType : Event -> String +eventType = + Internal.eventType {-| In case the event was redacted, this event will point you to the event that redacted it. diff --git a/src/Matrix/RoomInvite.elm b/src/Matrix/RoomInvite.elm index 8bd4769..49e6021 100644 --- a/src/Matrix/RoomInvite.elm +++ b/src/Matrix/RoomInvite.elm @@ -1,7 +1,7 @@ module Matrix.RoomInvite exposing ( RoomInvite, accept, reject, acceptWithReason, rejectWithReason , roomId, RoomInviteEvent, getEvent, getAllEvents - , sender, stateKey, contentType, content + , sender, stateKey, eventType, content ) {-| Sometimes, your user will be invited to a new room! @@ -26,7 +26,7 @@ want to see. Once you have the event you want, you can explore it with the following functions. -@docs sender, stateKey, contentType, content +@docs sender, stateKey, eventType, content -} @@ -105,9 +105,9 @@ content = {-| Get the event's content type. -} -contentType : RoomInviteEvent -> String -contentType = - IR.contentType +eventType : RoomInviteEvent -> String +eventType = + IR.eventType {-| Get the event's state key. @@ -119,7 +119,7 @@ stateKey = {-| Get a specific event with a specific event content type and state key, if it exists. -} -getEvent : { contentType : String, stateKey : String } -> RoomInvite -> Maybe RoomInviteEvent +getEvent : { eventType : String, stateKey : String } -> RoomInvite -> Maybe RoomInviteEvent getEvent data invite = invite |> Internal.withoutCredentials