async-matrix 0.1.3 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (341) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +131 -0
  3. data/data/matrix-spec/api/client-server/account-data.yaml +389 -0
  4. data/data/matrix-spec/api/client-server/account_deactivation.yaml +149 -0
  5. data/data/matrix-spec/api/client-server/admin.yaml +512 -0
  6. data/data/matrix-spec/api/client-server/administrative_contact.yaml +620 -0
  7. data/data/matrix-spec/api/client-server/appservice_ping.yaml +183 -0
  8. data/data/matrix-spec/api/client-server/appservice_room_directory.yaml +104 -0
  9. data/data/matrix-spec/api/client-server/authed-content-repo.yaml +590 -0
  10. data/data/matrix-spec/api/client-server/banning.yaml +177 -0
  11. data/data/matrix-spec/api/client-server/capabilities.yaml +235 -0
  12. data/data/matrix-spec/api/client-server/content-repo.yaml +887 -0
  13. data/data/matrix-spec/api/client-server/create_room.yaml +306 -0
  14. data/data/matrix-spec/api/client-server/cross_signing.yaml +300 -0
  15. data/data/matrix-spec/api/client-server/definitions/auth_data.yaml +34 -0
  16. data/data/matrix-spec/api/client-server/definitions/auth_response.yaml +62 -0
  17. data/data/matrix-spec/api/client-server/definitions/client_device.yaml +44 -0
  18. data/data/matrix-spec/api/client-server/definitions/client_event.yaml +49 -0
  19. data/data/matrix-spec/api/client-server/definitions/client_event_without_room_id.yaml +147 -0
  20. data/data/matrix-spec/api/client-server/definitions/cross_signing_key.yaml +57 -0
  21. data/data/matrix-spec/api/client-server/definitions/device_keys.yaml +70 -0
  22. data/data/matrix-spec/api/client-server/definitions/errors/error.yaml +26 -0
  23. data/data/matrix-spec/api/client-server/definitions/errors/rate_limited.yaml +34 -0
  24. data/data/matrix-spec/api/client-server/definitions/event_batch.yaml +22 -0
  25. data/data/matrix-spec/api/client-server/definitions/event_filter.yaml +55 -0
  26. data/data/matrix-spec/api/client-server/definitions/invite_3pid.yaml +45 -0
  27. data/data/matrix-spec/api/client-server/definitions/key_backup_auth_data.yaml +36 -0
  28. data/data/matrix-spec/api/client-server/definitions/key_backup_data.yaml +50 -0
  29. data/data/matrix-spec/api/client-server/definitions/key_backup_session_data.yaml +57 -0
  30. data/data/matrix-spec/api/client-server/definitions/m.login.terms_params.yaml +83 -0
  31. data/data/matrix-spec/api/client-server/definitions/m.mentions.yaml +33 -0
  32. data/data/matrix-spec/api/client-server/definitions/m.oauth_params.yaml +30 -0
  33. data/data/matrix-spec/api/client-server/definitions/m.relates_to.yaml +45 -0
  34. data/data/matrix-spec/api/client-server/definitions/megolm_export_session_data.yaml +39 -0
  35. data/data/matrix-spec/api/client-server/definitions/olm_payload.yaml +88 -0
  36. data/data/matrix-spec/api/client-server/definitions/one_time_keys.yaml +27 -0
  37. data/data/matrix-spec/api/client-server/definitions/openid_token.yaml +37 -0
  38. data/data/matrix-spec/api/client-server/definitions/protocol.yaml +44 -0
  39. data/data/matrix-spec/api/client-server/definitions/public_rooms_chunk.yaml +74 -0
  40. data/data/matrix-spec/api/client-server/definitions/public_rooms_response.yaml +59 -0
  41. data/data/matrix-spec/api/client-server/definitions/push_condition.yaml +53 -0
  42. data/data/matrix-spec/api/client-server/definitions/push_rule.yaml +53 -0
  43. data/data/matrix-spec/api/client-server/definitions/push_ruleset.yaml +206 -0
  44. data/data/matrix-spec/api/client-server/definitions/recent_emoji.yaml +29 -0
  45. data/data/matrix-spec/api/client-server/definitions/request_email_validation.yaml +36 -0
  46. data/data/matrix-spec/api/client-server/definitions/request_msisdn_validation.yaml +36 -0
  47. data/data/matrix-spec/api/client-server/definitions/request_token_response.yaml +46 -0
  48. data/data/matrix-spec/api/client-server/definitions/room_event_filter.yaml +60 -0
  49. data/data/matrix-spec/api/client-server/definitions/room_key_backup.yaml +37 -0
  50. data/data/matrix-spec/api/client-server/definitions/room_summary.yaml +44 -0
  51. data/data/matrix-spec/api/client-server/definitions/security.yaml +47 -0
  52. data/data/matrix-spec/api/client-server/definitions/sso_login_flow.yaml +98 -0
  53. data/data/matrix-spec/api/client-server/definitions/state_event_batch.yaml +21 -0
  54. data/data/matrix-spec/api/client-server/definitions/sync_filter.yaml +86 -0
  55. data/data/matrix-spec/api/client-server/definitions/tag.yaml +24 -0
  56. data/data/matrix-spec/api/client-server/definitions/third_party_signed.yaml +45 -0
  57. data/data/matrix-spec/api/client-server/definitions/timeline_batch.yaml +36 -0
  58. data/data/matrix-spec/api/client-server/definitions/user_identifier.yaml +27 -0
  59. data/data/matrix-spec/api/client-server/definitions/wellknown/full.yaml +38 -0
  60. data/data/matrix-spec/api/client-server/definitions/wellknown/homeserver.yaml +25 -0
  61. data/data/matrix-spec/api/client-server/definitions/wellknown/identity_server.yaml +25 -0
  62. data/data/matrix-spec/api/client-server/device_management.yaml +314 -0
  63. data/data/matrix-spec/api/client-server/directory.yaml +318 -0
  64. data/data/matrix-spec/api/client-server/event_context.yaml +161 -0
  65. data/data/matrix-spec/api/client-server/filter.yaml +224 -0
  66. data/data/matrix-spec/api/client-server/inviting.yaml +149 -0
  67. data/data/matrix-spec/api/client-server/joining.yaml +238 -0
  68. data/data/matrix-spec/api/client-server/key_backup.yaml +993 -0
  69. data/data/matrix-spec/api/client-server/keys.yaml +482 -0
  70. data/data/matrix-spec/api/client-server/kicking.yaml +110 -0
  71. data/data/matrix-spec/api/client-server/knocking.yaml +152 -0
  72. data/data/matrix-spec/api/client-server/leaving.yaml +163 -0
  73. data/data/matrix-spec/api/client-server/list_joined_rooms.yaml +68 -0
  74. data/data/matrix-spec/api/client-server/list_public_rooms.yaml +280 -0
  75. data/data/matrix-spec/api/client-server/login.yaml +321 -0
  76. data/data/matrix-spec/api/client-server/login_token.yaml +138 -0
  77. data/data/matrix-spec/api/client-server/logout.yaml +86 -0
  78. data/data/matrix-spec/api/client-server/message_pagination.yaml +194 -0
  79. data/data/matrix-spec/api/client-server/notifications.yaml +152 -0
  80. data/data/matrix-spec/api/client-server/oauth_server_metadata.yaml +238 -0
  81. data/data/matrix-spec/api/client-server/old_sync.yaml +379 -0
  82. data/data/matrix-spec/api/client-server/openid.yaml +98 -0
  83. data/data/matrix-spec/api/client-server/password_management.yaml +246 -0
  84. data/data/matrix-spec/api/client-server/peeking_events.yaml +122 -0
  85. data/data/matrix-spec/api/client-server/policy_server.yaml +82 -0
  86. data/data/matrix-spec/api/client-server/presence.yaml +169 -0
  87. data/data/matrix-spec/api/client-server/profile.yaml +366 -0
  88. data/data/matrix-spec/api/client-server/pusher.yaml +303 -0
  89. data/data/matrix-spec/api/client-server/pushrules.yaml +633 -0
  90. data/data/matrix-spec/api/client-server/read_markers.yaml +103 -0
  91. data/data/matrix-spec/api/client-server/receipts.yaml +139 -0
  92. data/data/matrix-spec/api/client-server/redaction.yaml +116 -0
  93. data/data/matrix-spec/api/client-server/refresh.yaml +119 -0
  94. data/data/matrix-spec/api/client-server/registration.yaml +488 -0
  95. data/data/matrix-spec/api/client-server/registration_tokens.yaml +93 -0
  96. data/data/matrix-spec/api/client-server/relations.yaml +382 -0
  97. data/data/matrix-spec/api/client-server/report_content.yaml +283 -0
  98. data/data/matrix-spec/api/client-server/room_event_by_timestamp.yaml +147 -0
  99. data/data/matrix-spec/api/client-server/room_initial_sync.yaml +188 -0
  100. data/data/matrix-spec/api/client-server/room_send.yaml +130 -0
  101. data/data/matrix-spec/api/client-server/room_state.yaml +159 -0
  102. data/data/matrix-spec/api/client-server/room_summary.yaml +138 -0
  103. data/data/matrix-spec/api/client-server/room_upgrades.yaml +130 -0
  104. data/data/matrix-spec/api/client-server/rooms.yaml +380 -0
  105. data/data/matrix-spec/api/client-server/search.yaml +385 -0
  106. data/data/matrix-spec/api/client-server/space_hierarchy.yaml +237 -0
  107. data/data/matrix-spec/api/client-server/sso_login_redirect.yaml +135 -0
  108. data/data/matrix-spec/api/client-server/support.yaml +142 -0
  109. data/data/matrix-spec/api/client-server/sync.yaml +692 -0
  110. data/data/matrix-spec/api/client-server/tags.yaml +183 -0
  111. data/data/matrix-spec/api/client-server/third_party_lookup.yaml +324 -0
  112. data/data/matrix-spec/api/client-server/third_party_membership.yaml +139 -0
  113. data/data/matrix-spec/api/client-server/threads_list.yaml +167 -0
  114. data/data/matrix-spec/api/client-server/to_device.yaml +104 -0
  115. data/data/matrix-spec/api/client-server/typing.yaml +103 -0
  116. data/data/matrix-spec/api/client-server/users.yaml +136 -0
  117. data/data/matrix-spec/api/client-server/versions.yaml +108 -0
  118. data/data/matrix-spec/api/client-server/voip.yaml +93 -0
  119. data/data/matrix-spec/api/client-server/wellknown.yaml +60 -0
  120. data/data/matrix-spec/api/client-server/whoami.yaml +121 -0
  121. data/data/matrix-spec/event-schemas/examples/core/event.json +6 -0
  122. data/data/matrix-spec/event-schemas/examples/core/room_edu.json +3 -0
  123. data/data/matrix-spec/event-schemas/examples/core/room_event.json +11 -0
  124. data/data/matrix-spec/event-schemas/examples/core/state_event.json +4 -0
  125. data/data/matrix-spec/event-schemas/examples/invite_room_state.json +18 -0
  126. data/data/matrix-spec/event-schemas/examples/knock_room_state.json +18 -0
  127. data/data/matrix-spec/event-schemas/examples/m.accepted_terms.yaml +10 -0
  128. data/data/matrix-spec/event-schemas/examples/m.call.answer.yaml +21 -0
  129. data/data/matrix-spec/event-schemas/examples/m.call.candidates.yaml +16 -0
  130. data/data/matrix-spec/event-schemas/examples/m.call.hangup.yaml +10 -0
  131. data/data/matrix-spec/event-schemas/examples/m.call.invite.yaml +22 -0
  132. data/data/matrix-spec/event-schemas/examples/m.call.negotiate.yaml +22 -0
  133. data/data/matrix-spec/event-schemas/examples/m.call.reject.yaml +9 -0
  134. data/data/matrix-spec/event-schemas/examples/m.call.sdp_stream_metadata_changed.yaml +16 -0
  135. data/data/matrix-spec/event-schemas/examples/m.call.select_answer.yaml +10 -0
  136. data/data/matrix-spec/event-schemas/examples/m.direct.yaml +10 -0
  137. data/data/matrix-spec/event-schemas/examples/m.dummy.yaml +4 -0
  138. data/data/matrix-spec/event-schemas/examples/m.forwarded_room_key.yaml +14 -0
  139. data/data/matrix-spec/event-schemas/examples/m.fully_read.yaml +7 -0
  140. data/data/matrix-spec/event-schemas/examples/m.identity_server.yaml +7 -0
  141. data/data/matrix-spec/event-schemas/examples/m.ignored_user_list.yaml +9 -0
  142. data/data/matrix-spec/event-schemas/examples/m.invite_permission_config.yaml +7 -0
  143. data/data/matrix-spec/event-schemas/examples/m.key.verification.accept.yaml +12 -0
  144. data/data/matrix-spec/event-schemas/examples/m.key.verification.cancel.yaml +8 -0
  145. data/data/matrix-spec/event-schemas/examples/m.key.verification.done.yaml +6 -0
  146. data/data/matrix-spec/event-schemas/examples/m.key.verification.key.yaml +7 -0
  147. data/data/matrix-spec/event-schemas/examples/m.key.verification.mac.yaml +10 -0
  148. data/data/matrix-spec/event-schemas/examples/m.key.verification.ready.yaml +10 -0
  149. data/data/matrix-spec/event-schemas/examples/m.key.verification.request.yaml +11 -0
  150. data/data/matrix-spec/event-schemas/examples/m.key.verification.start$m.sas.v1.yaml +12 -0
  151. data/data/matrix-spec/event-schemas/examples/m.key.verification.start.yaml +8 -0
  152. data/data/matrix-spec/event-schemas/examples/m.key_backup.yaml +7 -0
  153. data/data/matrix-spec/event-schemas/examples/m.marked_unread.yaml +7 -0
  154. data/data/matrix-spec/event-schemas/examples/m.policy.rule.room.yaml +10 -0
  155. data/data/matrix-spec/event-schemas/examples/m.policy.rule.server.yaml +10 -0
  156. data/data/matrix-spec/event-schemas/examples/m.policy.rule.user.yaml +10 -0
  157. data/data/matrix-spec/event-schemas/examples/m.presence.yaml +12 -0
  158. data/data/matrix-spec/event-schemas/examples/m.push_rules.yaml +177 -0
  159. data/data/matrix-spec/event-schemas/examples/m.reaction.yaml +11 -0
  160. data/data/matrix-spec/event-schemas/examples/m.receipt.yaml +18 -0
  161. data/data/matrix-spec/event-schemas/examples/m.recent_emoji.yaml +16 -0
  162. data/data/matrix-spec/event-schemas/examples/m.room.avatar.yaml +14 -0
  163. data/data/matrix-spec/event-schemas/examples/m.room.canonical_alias.yaml +12 -0
  164. data/data/matrix-spec/event-schemas/examples/m.room.create.yaml +13 -0
  165. data/data/matrix-spec/event-schemas/examples/m.room.encrypted$megolm.yaml +11 -0
  166. data/data/matrix-spec/event-schemas/examples/m.room.encrypted$olm.yaml +14 -0
  167. data/data/matrix-spec/event-schemas/examples/m.room.encryption.yaml +10 -0
  168. data/data/matrix-spec/event-schemas/examples/m.room.guest_access.yaml +8 -0
  169. data/data/matrix-spec/event-schemas/examples/m.room.history_visibility.yaml +8 -0
  170. data/data/matrix-spec/event-schemas/examples/m.room.join_rules$restricted.yaml +18 -0
  171. data/data/matrix-spec/event-schemas/examples/m.room.join_rules.yaml +8 -0
  172. data/data/matrix-spec/event-schemas/examples/m.room.member$invite_room_state.yaml +15 -0
  173. data/data/matrix-spec/event-schemas/examples/m.room.member$join_authorised_via_users_server.yaml +12 -0
  174. data/data/matrix-spec/event-schemas/examples/m.room.member$knock_room_state.yaml +15 -0
  175. data/data/matrix-spec/event-schemas/examples/m.room.member$third_party_invite.yaml +20 -0
  176. data/data/matrix-spec/event-schemas/examples/m.room.member.yaml +12 -0
  177. data/data/matrix-spec/event-schemas/examples/m.room.message$m.audio.yaml +14 -0
  178. data/data/matrix-spec/event-schemas/examples/m.room.message$m.emote.yaml +10 -0
  179. data/data/matrix-spec/event-schemas/examples/m.room.message$m.file.yaml +14 -0
  180. data/data/matrix-spec/event-schemas/examples/m.room.message$m.image.yaml +16 -0
  181. data/data/matrix-spec/event-schemas/examples/m.room.message$m.key.verification.request.yaml +19 -0
  182. data/data/matrix-spec/event-schemas/examples/m.room.message$m.location.yaml +18 -0
  183. data/data/matrix-spec/event-schemas/examples/m.room.message$m.notice.yaml +10 -0
  184. data/data/matrix-spec/event-schemas/examples/m.room.message$m.server_notice.yaml +11 -0
  185. data/data/matrix-spec/event-schemas/examples/m.room.message$m.text.yaml +10 -0
  186. data/data/matrix-spec/event-schemas/examples/m.room.message$m.video.yaml +23 -0
  187. data/data/matrix-spec/event-schemas/examples/m.room.name.yaml +8 -0
  188. data/data/matrix-spec/event-schemas/examples/m.room.pinned_events.yaml +8 -0
  189. data/data/matrix-spec/event-schemas/examples/m.room.policy.yaml +11 -0
  190. data/data/matrix-spec/event-schemas/examples/m.room.power_levels.yaml +24 -0
  191. data/data/matrix-spec/event-schemas/examples/m.room.redaction.yaml +8 -0
  192. data/data/matrix-spec/event-schemas/examples/m.room.server_acl.yaml +10 -0
  193. data/data/matrix-spec/event-schemas/examples/m.room.third_party_invite.yaml +14 -0
  194. data/data/matrix-spec/event-schemas/examples/m.room.tombstone.yaml +9 -0
  195. data/data/matrix-spec/event-schemas/examples/m.room.topic.yaml +16 -0
  196. data/data/matrix-spec/event-schemas/examples/m.room_key.withheld.yaml +12 -0
  197. data/data/matrix-spec/event-schemas/examples/m.room_key.yaml +10 -0
  198. data/data/matrix-spec/event-schemas/examples/m.room_key_request$cancel_request.yaml +8 -0
  199. data/data/matrix-spec/event-schemas/examples/m.room_key_request$request.yaml +14 -0
  200. data/data/matrix-spec/event-schemas/examples/m.secret.request.yaml +9 -0
  201. data/data/matrix-spec/event-schemas/examples/m.secret.send.yaml +7 -0
  202. data/data/matrix-spec/event-schemas/examples/m.space.child.yaml +10 -0
  203. data/data/matrix-spec/event-schemas/examples/m.space.parent.yaml +9 -0
  204. data/data/matrix-spec/event-schemas/examples/m.sticker.yaml +22 -0
  205. data/data/matrix-spec/event-schemas/examples/m.tag.yaml +9 -0
  206. data/data/matrix-spec/event-schemas/examples/m.typing.yaml +7 -0
  207. data/data/matrix-spec/event-schemas/moderation_policy_rule.yaml +32 -0
  208. data/data/matrix-spec/event-schemas/schema/components/m_text_content_block.yaml +28 -0
  209. data/data/matrix-spec/event-schemas/schema/components/sdp_stream_metadata.yaml +43 -0
  210. data/data/matrix-spec/event-schemas/schema/components/signed_third_party_invite.yaml +48 -0
  211. data/data/matrix-spec/event-schemas/schema/core-event-schema/call_event.yaml +27 -0
  212. data/data/matrix-spec/event-schemas/schema/core-event-schema/event.yaml +16 -0
  213. data/data/matrix-spec/event-schemas/schema/core-event-schema/msgtype_infos/avatar_info.yaml +30 -0
  214. data/data/matrix-spec/event-schemas/schema/core-event-schema/msgtype_infos/image_info.yaml +52 -0
  215. data/data/matrix-spec/event-schemas/schema/core-event-schema/msgtype_infos/thumbnail_info.yaml +22 -0
  216. data/data/matrix-spec/event-schemas/schema/core-event-schema/room_event.yaml +17 -0
  217. data/data/matrix-spec/event-schemas/schema/core-event-schema/state_event.yaml +8 -0
  218. data/data/matrix-spec/event-schemas/schema/core-event-schema/stripped_state.yaml +48 -0
  219. data/data/matrix-spec/event-schemas/schema/core-event-schema/sync_room_event.yaml +49 -0
  220. data/data/matrix-spec/event-schemas/schema/core-event-schema/sync_state_event.yaml +36 -0
  221. data/data/matrix-spec/event-schemas/schema/core-event-schema/unsigned_prop.yaml +23 -0
  222. data/data/matrix-spec/event-schemas/schema/m.accepted_terms.yaml +25 -0
  223. data/data/matrix-spec/event-schemas/schema/m.call.answer.yaml +44 -0
  224. data/data/matrix-spec/event-schemas/schema/m.call.candidates.yaml +52 -0
  225. data/data/matrix-spec/event-schemas/schema/m.call.hangup.yaml +57 -0
  226. data/data/matrix-spec/event-schemas/schema/m.call.invite.yaml +53 -0
  227. data/data/matrix-spec/event-schemas/schema/m.call.negotiate.yaml +78 -0
  228. data/data/matrix-spec/event-schemas/schema/m.call.reject.yaml +29 -0
  229. data/data/matrix-spec/event-schemas/schema/m.call.sdp_stream_metadata_changed.yaml +24 -0
  230. data/data/matrix-spec/event-schemas/schema/m.call.select_answer.yaml +29 -0
  231. data/data/matrix-spec/event-schemas/schema/m.direct.yaml +29 -0
  232. data/data/matrix-spec/event-schemas/schema/m.dummy.yaml +25 -0
  233. data/data/matrix-spec/event-schemas/schema/m.forwarded_room_key.yaml +70 -0
  234. data/data/matrix-spec/event-schemas/schema/m.fully_read.yaml +26 -0
  235. data/data/matrix-spec/event-schemas/schema/m.identity_server.yaml +28 -0
  236. data/data/matrix-spec/event-schemas/schema/m.ignored_user_list.yaml +30 -0
  237. data/data/matrix-spec/event-schemas/schema/m.invite_permission_config.yaml +21 -0
  238. data/data/matrix-spec/event-schemas/schema/m.key.verification.accept.yaml +63 -0
  239. data/data/matrix-spec/event-schemas/schema/m.key.verification.cancel.yaml +72 -0
  240. data/data/matrix-spec/event-schemas/schema/m.key.verification.done.yaml +24 -0
  241. data/data/matrix-spec/event-schemas/schema/m.key.verification.key.yaml +31 -0
  242. data/data/matrix-spec/event-schemas/schema/m.key.verification.m.relates_to.yaml +23 -0
  243. data/data/matrix-spec/event-schemas/schema/m.key.verification.mac.yaml +43 -0
  244. data/data/matrix-spec/event-schemas/schema/m.key.verification.ready.yaml +41 -0
  245. data/data/matrix-spec/event-schemas/schema/m.key.verification.request.yaml +47 -0
  246. data/data/matrix-spec/event-schemas/schema/m.key.verification.start$m.reciprocate.v1.yaml +45 -0
  247. data/data/matrix-spec/event-schemas/schema/m.key.verification.start$m.sas.v1.yaml +76 -0
  248. data/data/matrix-spec/event-schemas/schema/m.key.verification.start.yaml +46 -0
  249. data/data/matrix-spec/event-schemas/schema/m.key_backup.yaml +24 -0
  250. data/data/matrix-spec/event-schemas/schema/m.marked_unread.yaml +26 -0
  251. data/data/matrix-spec/event-schemas/schema/m.policy.rule.room.yaml +17 -0
  252. data/data/matrix-spec/event-schemas/schema/m.policy.rule.server.yaml +17 -0
  253. data/data/matrix-spec/event-schemas/schema/m.policy.rule.user.yaml +17 -0
  254. data/data/matrix-spec/event-schemas/schema/m.presence.yaml +50 -0
  255. data/data/matrix-spec/event-schemas/schema/m.push_rules.yaml +23 -0
  256. data/data/matrix-spec/event-schemas/schema/m.reaction.yaml +45 -0
  257. data/data/matrix-spec/event-schemas/schema/m.receipt.yaml +65 -0
  258. data/data/matrix-spec/event-schemas/schema/m.recent_emoji.yaml +29 -0
  259. data/data/matrix-spec/event-schemas/schema/m.room.avatar.yaml +29 -0
  260. data/data/matrix-spec/event-schemas/schema/m.room.canonical_alias.yaml +40 -0
  261. data/data/matrix-spec/event-schemas/schema/m.room.create.yaml +86 -0
  262. data/data/matrix-spec/event-schemas/schema/m.room.encrypted.yaml +91 -0
  263. data/data/matrix-spec/event-schemas/schema/m.room.encryption.yaml +38 -0
  264. data/data/matrix-spec/event-schemas/schema/m.room.guest_access.yaml +28 -0
  265. data/data/matrix-spec/event-schemas/schema/m.room.history_visibility.yaml +30 -0
  266. data/data/matrix-spec/event-schemas/schema/m.room.join_rules.yaml +78 -0
  267. data/data/matrix-spec/event-schemas/schema/m.room.member.yaml +174 -0
  268. data/data/matrix-spec/event-schemas/schema/m.room.message$m.audio.yaml +73 -0
  269. data/data/matrix-spec/event-schemas/schema/m.room.message$m.emote.yaml +36 -0
  270. data/data/matrix-spec/event-schemas/schema/m.room.message$m.file.yaml +85 -0
  271. data/data/matrix-spec/event-schemas/schema/m.room.message$m.image.yaml +63 -0
  272. data/data/matrix-spec/event-schemas/schema/m.room.message$m.key.verification.request.yaml +70 -0
  273. data/data/matrix-spec/event-schemas/schema/m.room.message$m.location.yaml +50 -0
  274. data/data/matrix-spec/event-schemas/schema/m.room.message$m.notice.yaml +36 -0
  275. data/data/matrix-spec/event-schemas/schema/m.room.message$m.server_notice.yaml +41 -0
  276. data/data/matrix-spec/event-schemas/schema/m.room.message$m.text.yaml +36 -0
  277. data/data/matrix-spec/event-schemas/schema/m.room.message$m.video.yaml +95 -0
  278. data/data/matrix-spec/event-schemas/schema/m.room.message.yaml +25 -0
  279. data/data/matrix-spec/event-schemas/schema/m.room.name.yaml +35 -0
  280. data/data/matrix-spec/event-schemas/schema/m.room.pinned_events.yaml +27 -0
  281. data/data/matrix-spec/event-schemas/schema/m.room.policy.yaml +41 -0
  282. data/data/matrix-spec/event-schemas/schema/m.room.power_levels.yaml +139 -0
  283. data/data/matrix-spec/event-schemas/schema/m.room.redaction.yaml +29 -0
  284. data/data/matrix-spec/event-schemas/schema/m.room.server_acl.yaml +88 -0
  285. data/data/matrix-spec/event-schemas/schema/m.room.third_party_invite.yaml +79 -0
  286. data/data/matrix-spec/event-schemas/schema/m.room.tombstone.yaml +29 -0
  287. data/data/matrix-spec/event-schemas/schema/m.room.topic.yaml +53 -0
  288. data/data/matrix-spec/event-schemas/schema/m.room_key.withheld.yaml +88 -0
  289. data/data/matrix-spec/event-schemas/schema/m.room_key.yaml +38 -0
  290. data/data/matrix-spec/event-schemas/schema/m.room_key_request.yaml +73 -0
  291. data/data/matrix-spec/event-schemas/schema/m.secret.request.yaml +42 -0
  292. data/data/matrix-spec/event-schemas/schema/m.secret.send.yaml +35 -0
  293. data/data/matrix-spec/event-schemas/schema/m.space.child.yaml +50 -0
  294. data/data/matrix-spec/event-schemas/schema/m.space.parent.yaml +36 -0
  295. data/data/matrix-spec/event-schemas/schema/m.sticker.yaml +36 -0
  296. data/data/matrix-spec/event-schemas/schema/m.tag.yaml +28 -0
  297. data/data/matrix-spec/event-schemas/schema/m.typing.yaml +29 -0
  298. data/lib/async/matrix/api/chain.rb +575 -0
  299. data/lib/async/matrix/api/concat.rb +105 -0
  300. data/lib/async/matrix/api/path_tree.rb +208 -0
  301. data/lib/async/matrix/api.rb +204 -0
  302. data/lib/async/matrix/application_service/bot.rb +235 -0
  303. data/lib/async/matrix/application_service/config/schema/analytics.json +21 -0
  304. data/lib/async/matrix/application_service/config/schema/appservice.json +82 -0
  305. data/lib/async/matrix/application_service/config/schema/backfill.json +91 -0
  306. data/lib/async/matrix/application_service/config/schema/bridge.json +209 -0
  307. data/lib/async/matrix/application_service/config/schema/config.json +61 -0
  308. data/lib/async/matrix/application_service/config/schema/database.json +38 -0
  309. data/lib/async/matrix/application_service/config/schema/direct_media.json +35 -0
  310. data/lib/async/matrix/application_service/config/schema/double_puppet.json +24 -0
  311. data/lib/async/matrix/application_service/config/schema/encryption.json +164 -0
  312. data/lib/async/matrix/application_service/config/schema/homeserver.json +58 -0
  313. data/lib/async/matrix/application_service/config/schema/logging.json +50 -0
  314. data/lib/async/matrix/application_service/config/schema/management_room_texts.json +25 -0
  315. data/lib/async/matrix/application_service/config/schema/matrix.json +45 -0
  316. data/lib/async/matrix/application_service/config/schema/permissions.json +54 -0
  317. data/lib/async/matrix/application_service/config/schema/provisioning.json +23 -0
  318. data/lib/async/matrix/application_service/config/schema/public_media.json +39 -0
  319. data/lib/async/matrix/application_service/config/schema/relay.json +43 -0
  320. data/lib/async/matrix/application_service/config/vivify.rb +110 -0
  321. data/lib/async/matrix/application_service/config.rb +214 -123
  322. data/lib/async/matrix/application_service/dispatcher.rb +115 -113
  323. data/lib/async/matrix/application_service/error_response.rb +26 -26
  324. data/lib/async/matrix/application_service/event.rb +217 -1
  325. data/lib/async/matrix/application_service/server.rb +286 -215
  326. data/lib/async/matrix/application_service/transaction.rb +52 -52
  327. data/lib/async/matrix/application_service/transaction_store.rb +62 -62
  328. data/lib/async/matrix/client.rb +919 -179
  329. data/lib/async/matrix/connection.rb +8 -8
  330. data/lib/async/matrix/endpoint.rb +45 -45
  331. data/lib/async/matrix/error.rb +49 -43
  332. data/lib/async/matrix/media_client.rb +173 -0
  333. data/lib/async/matrix/notifier.rb +92 -92
  334. data/lib/async/matrix/schema/registry.rb +355 -0
  335. data/lib/async/matrix/schema/validation_error.rb +226 -0
  336. data/lib/async/matrix/schema.rb +174 -0
  337. data/lib/async/matrix/server.rb +7 -7
  338. data/lib/async/matrix/stream.rb +7 -7
  339. data/lib/async/matrix/version.rb +1 -1
  340. data/lib/async/matrix.rb +2 -2
  341. metadata +353 -1
@@ -0,0 +1,382 @@
1
+ # Copyright 2022,2024 The Matrix.org Foundation C.I.C.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ openapi: 3.1.0
15
+ info:
16
+ title: Matrix Client-Server Relations API
17
+ version: 1.0.0
18
+ paths:
19
+ "/rooms/{roomId}/relations/{eventId}":
20
+ get:
21
+ summary: Get the child events for a given parent event.
22
+ description: |-
23
+ Retrieve all of the child events for a given parent event.
24
+
25
+ Note that when paginating the `from` token should be "after" the `to` token in
26
+ terms of topological ordering, because it is only possible to paginate "backwards"
27
+ through events, starting at `from`.
28
+
29
+ For example, passing a `from` token from page 2 of the results, and a `to` token
30
+ from page 1, would return the empty set. The caller can use a `from` token from
31
+ page 1 and a `to` token from page 2 to paginate over the same range, however.
32
+ operationId: getRelatingEvents
33
+ security:
34
+ - accessTokenQuery: []
35
+ - accessTokenBearer: []
36
+ parameters:
37
+ - $ref: '#/components/parameters/roomId'
38
+ - $ref: '#/components/parameters/eventId'
39
+ - $ref: '#/components/parameters/from'
40
+ - $ref: '#/components/parameters/to'
41
+ - $ref: '#/components/parameters/limit'
42
+ - $ref: '#/components/parameters/dir'
43
+ - $ref: '#/components/parameters/recurse'
44
+ responses:
45
+ # note: this endpoint deliberately does not support rate limiting, therefore a
46
+ # 429 error response is not included.
47
+ "200":
48
+ description: |-
49
+ The paginated child events which point to the parent. If no events are
50
+ pointing to the parent or the pagination yields no results, an empty `chunk`
51
+ is returned.
52
+ content:
53
+ application/json:
54
+ schema:
55
+ allOf:
56
+ - $ref: '#/components/schemas/response'
57
+ - type: object
58
+ properties:
59
+ chunk:
60
+ title: ChildEventsChunk
61
+ type: array
62
+ description: The child events of the requested event, ordered topologically
63
+ most-recent first.
64
+ items:
65
+ $ref: definitions/client_event.yaml
66
+ required:
67
+ - chunk
68
+ examples:
69
+ response:
70
+ $ref: '#/components/examples/response'
71
+ "404":
72
+ $ref: '#/components/responses/404'
73
+ tags:
74
+ - Event relationships
75
+ # The same as above, with added `/{relType}`
76
+ "/rooms/{roomId}/relations/{eventId}/{relType}":
77
+ get:
78
+ summary: Get the child events for a given parent event, with a given `relType`.
79
+ description: |-
80
+ Retrieve all of the child events for a given parent event which relate to the parent
81
+ using the given `relType`.
82
+
83
+ Note that when paginating the `from` token should be "after" the `to` token in
84
+ terms of topological ordering, because it is only possible to paginate "backwards"
85
+ through events, starting at `from`.
86
+
87
+ For example, passing a `from` token from page 2 of the results, and a `to` token
88
+ from page 1, would return the empty set. The caller can use a `from` token from
89
+ page 1 and a `to` token from page 2 to paginate over the same range, however.
90
+ operationId: getRelatingEventsWithRelType
91
+ security:
92
+ - accessTokenQuery: []
93
+ - accessTokenBearer: []
94
+ parameters:
95
+ - $ref: '#/components/parameters/roomId'
96
+ - $ref: '#/components/parameters/eventId'
97
+ - $ref: '#/components/parameters/relType'
98
+ - $ref: '#/components/parameters/from'
99
+ - $ref: '#/components/parameters/to'
100
+ - $ref: '#/components/parameters/limit'
101
+ - $ref: '#/components/parameters/dir'
102
+ - $ref: '#/components/parameters/recurse'
103
+ responses:
104
+ # note: this endpoint deliberately does not support rate limiting, therefore a
105
+ # 429 error response is not included.
106
+ "200":
107
+ description: |-
108
+ The paginated child events which point to the parent. If no events are
109
+ pointing to the parent or the pagination yields no results, an empty `chunk`
110
+ is returned.
111
+ content:
112
+ application/json:
113
+ schema:
114
+ allOf:
115
+ - $ref: '#/components/schemas/response'
116
+ - type: object
117
+ properties:
118
+ chunk:
119
+ title: ChildEventsChunk
120
+ type: array
121
+ description: |-
122
+ The child events of the requested event, ordered topologically
123
+ most-recent first. The events returned will match the `relType`
124
+ supplied in the URL.
125
+ items:
126
+ $ref: definitions/client_event.yaml
127
+ required:
128
+ - chunk
129
+ examples:
130
+ response:
131
+ $ref: '#/components/examples/response'
132
+ "404":
133
+ $ref: '#/components/responses/404'
134
+ tags:
135
+ - Event relationships
136
+ # The same as above, with added `/{eventType}`
137
+ "/rooms/{roomId}/relations/{eventId}/{relType}/{eventType}":
138
+ get:
139
+ summary: Get the child events for a given parent event, with a given `relType`
140
+ and `eventType`.
141
+ description: |-
142
+ Retrieve all of the child events for a given parent event which relate to the parent
143
+ using the given `relType` and have the given `eventType`.
144
+
145
+ Note that when paginating the `from` token should be "after" the `to` token in
146
+ terms of topological ordering, because it is only possible to paginate "backwards"
147
+ through events, starting at `from`.
148
+
149
+ For example, passing a `from` token from page 2 of the results, and a `to` token
150
+ from page 1, would return the empty set. The caller can use a `from` token from
151
+ page 1 and a `to` token from page 2 to paginate over the same range, however.
152
+ operationId: getRelatingEventsWithRelTypeAndEventType
153
+ security:
154
+ - accessTokenQuery: []
155
+ - accessTokenBearer: []
156
+ parameters:
157
+ - $ref: '#/components/parameters/roomId'
158
+ - $ref: '#/components/parameters/eventId'
159
+ - $ref: '#/components/parameters/relType'
160
+ - in: path
161
+ name: eventType
162
+ description: |-
163
+ The event type of child events to search for.
164
+
165
+ Note that in encrypted rooms this will typically always be `m.room.encrypted`
166
+ regardless of the event type contained within the encrypted payload.
167
+ required: true
168
+ example: m.room.message
169
+ schema:
170
+ type: string
171
+ - $ref: '#/components/parameters/from'
172
+ - $ref: '#/components/parameters/to'
173
+ - $ref: '#/components/parameters/limit'
174
+ - $ref: '#/components/parameters/dir'
175
+ - $ref: '#/components/parameters/recurse'
176
+ responses:
177
+ # note: this endpoint deliberately does not support rate limiting, therefore a
178
+ # 429 error response is not included.
179
+ "200":
180
+ description: |-
181
+ The paginated child events which point to the parent. If no events are
182
+ pointing to the parent or the pagination yields no results, an empty `chunk`
183
+ is returned.
184
+ content:
185
+ application/json:
186
+ schema:
187
+ allOf:
188
+ - $ref: '#/components/schemas/response'
189
+ - type: object
190
+ properties:
191
+ chunk:
192
+ title: ChildEventsChunk
193
+ type: array
194
+ description: |-
195
+ The child events of the requested event, ordered topologically most-recent
196
+ first. The events returned will match the `relType` and `eventType` supplied
197
+ in the URL.
198
+ items:
199
+ $ref: definitions/client_event.yaml
200
+ required:
201
+ - chunk
202
+ examples:
203
+ response:
204
+ $ref: '#/components/examples/response'
205
+ "404":
206
+ $ref: '#/components/responses/404'
207
+ tags:
208
+ - Event relationships
209
+ servers:
210
+ - url: "{protocol}://{hostname}{basePath}"
211
+ variables:
212
+ protocol:
213
+ enum:
214
+ - http
215
+ - https
216
+ default: https
217
+ hostname:
218
+ default: localhost:8008
219
+ basePath:
220
+ default: /_matrix/client/v1
221
+ components:
222
+ securitySchemes:
223
+ accessTokenQuery:
224
+ $ref: definitions/security.yaml#/accessTokenQuery
225
+ accessTokenBearer:
226
+ $ref: definitions/security.yaml#/accessTokenBearer
227
+ parameters:
228
+ roomId:
229
+ in: path
230
+ name: roomId
231
+ description: The ID of the room containing the parent event.
232
+ required: true
233
+ example: "!636q39766251:matrix.org"
234
+ schema:
235
+ type: string
236
+ format: mx-room-id
237
+ pattern: "^!"
238
+ eventId:
239
+ in: path
240
+ name: eventId
241
+ description: The ID of the parent event whose child events are to be returned.
242
+ required: true
243
+ example: $asfDuShaf7Gafaw
244
+ schema:
245
+ type: string
246
+ format: mx-event-id
247
+ pattern: "^\\$"
248
+ from:
249
+ in: query
250
+ name: from
251
+ description: |-
252
+ The pagination token to start returning results from. If not supplied, results
253
+ start at the most recent topological event known to the server.
254
+
255
+ Can be a `next_batch` or `prev_batch` token from a previous call, or a returned
256
+ `start` token from [`/messages`](/client-server-api/#get_matrixclientv3roomsroomidmessages),
257
+ or a `next_batch` token from [`/sync`](/client-server-api/#get_matrixclientv3sync).
258
+ required: false
259
+ example: page2_token
260
+ schema:
261
+ type: string
262
+ to:
263
+ in: query
264
+ name: to
265
+ description: |-
266
+ The pagination token to stop returning results at. If not supplied, results
267
+ continue up to `limit` or until there are no more events.
268
+
269
+ Like `from`, this can be a previous token from a prior call to this endpoint
270
+ or from `/messages` or `/sync`.
271
+ required: false
272
+ example: page3_token
273
+ schema:
274
+ type: string
275
+ limit:
276
+ in: query
277
+ name: limit
278
+ description: |-
279
+ The maximum number of results to return in a single `chunk`. The server can
280
+ and should apply a maximum value to this parameter to avoid large responses.
281
+
282
+ Similarly, the server should apply a default value when not supplied.
283
+ required: false
284
+ example: 20
285
+ schema:
286
+ type: integer
287
+ dir:
288
+ in: query
289
+ name: dir
290
+ x-addedInMatrixVersion: "1.4"
291
+ description: |-
292
+ Optional (default `b`) direction to return events from. If this is set to `f`, events
293
+ will be returned in chronological order starting at `from`. If it
294
+ is set to `b`, events will be returned in *reverse* chronological
295
+ order, again starting at `from`.
296
+ schema:
297
+ type: string
298
+ enum:
299
+ - b
300
+ - f
301
+ relType:
302
+ in: path
303
+ name: relType
304
+ description: The [relationship type](/client-server-api/#relationship-types) to
305
+ search for.
306
+ required: true
307
+ example: org.example.my_relation
308
+ schema:
309
+ type: string
310
+ recurse:
311
+ in: query
312
+ name: recurse
313
+ x-addedInMatrixVersion: "1.10"
314
+ required: false
315
+ description: |-
316
+ Whether to additionally include events which only relate indirectly to the
317
+ given event, i.e. events related to the given event via two or more direct relationships.
318
+
319
+ If set to `false`, only events which have a direct relation with the given
320
+ event will be included.
321
+
322
+ If set to `true`, events which have an indirect relation with the given event
323
+ will be included additionally up to a certain depth level. Homeservers SHOULD traverse
324
+ at least 3 levels of relationships. Implementations MAY perform more but MUST be careful
325
+ to not infinitely recurse.
326
+
327
+ The default value is `false`.
328
+ schema:
329
+ type: boolean
330
+ schemas:
331
+ response:
332
+ type: object
333
+ properties:
334
+ next_batch:
335
+ type: string
336
+ description: |-
337
+ An opaque string representing a pagination token. The absence of this token
338
+ means there are no more results to fetch and the client should stop paginating.
339
+ prev_batch:
340
+ type: string
341
+ description: |-
342
+ An opaque string representing a pagination token. The absence of this token
343
+ means this is the start of the result set, i.e. this is the first batch/page.
344
+ recursion_depth:
345
+ type: integer
346
+ description: |-
347
+ If the `recurse` parameter was supplied by the client, this response field is
348
+ mandatory and gives the actual depth to which the server recursed. If the client
349
+ did not specify the `recurse` parameter, this field must be absent.
350
+ responses:
351
+ "404":
352
+ description: |-
353
+ The parent event was not found or the user does not have permission to read
354
+ this event (it might be contained in history that is not accessible to the user).
355
+ content:
356
+ application/json:
357
+ schema:
358
+ $ref: definitions/errors/error.yaml
359
+ examples:
360
+ response:
361
+ value: {
362
+ "errcode": "M_NOT_FOUND",
363
+ "error": "Event not found."
364
+ }
365
+ examples:
366
+ response:
367
+ value: {
368
+ "chunk": [
369
+ {
370
+ "room_id": "!636q39766251:matrix.org",
371
+ "$ref": "../../event-schemas/examples/m.room.message$m.text.yaml",
372
+ "content": {
373
+ "m.relates_to": {
374
+ "rel_type": "org.example.my_relation",
375
+ "event_id": "$asfDuShaf7Gafaw"
376
+ }
377
+ }
378
+ }
379
+ ],
380
+ "next_batch": "page2_token",
381
+ "prev_batch": "page1_token"
382
+ }
@@ -0,0 +1,283 @@
1
+ # Copyright 2018 Travis Ralston
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ openapi: 3.1.0
15
+ info:
16
+ title: Matrix Client-Server Report Content API
17
+ version: 1.0.0
18
+ paths:
19
+ "/rooms/{roomId}/report":
20
+ post:
21
+ x-addedInMatrixVersion: "1.13"
22
+ summary: Report a room as inappropriate.
23
+ description: |-
24
+ Reports a room as inappropriate to the server, which may then notify
25
+ the appropriate people. How such information is delivered is left up to
26
+ implementations. The caller is not required to be joined to the room to
27
+ report it.
28
+
29
+ Clients could infer whether a reported room exists based on the 404 response.
30
+ Homeservers that wish to conceal this information MAY return 200 responses
31
+ regardless of the existence of the reported room.
32
+
33
+ Furthermore, it might be possible for clients to deduce whether a reported
34
+ room exists by timing the response. This is because only a report for an
35
+ existing room will require the homeserver to do further processing. To
36
+ combat this, homeservers MAY add a random delay when generating a response.
37
+ operationId: reportRoom
38
+ parameters:
39
+ - in: path
40
+ name: roomId
41
+ description: The room being reported.
42
+ required: true
43
+ example: "!637q39766251:example.com"
44
+ schema:
45
+ type: string
46
+ requestBody:
47
+ content:
48
+ application/json:
49
+ schema:
50
+ type: object
51
+ example: {
52
+ "reason": "this makes me sad"
53
+ }
54
+ properties:
55
+ reason:
56
+ type: string
57
+ description: The reason the room is being reported. May be blank.
58
+ required:
59
+ - reason
60
+ required: true
61
+ security:
62
+ - accessTokenQuery: []
63
+ - accessTokenBearer: []
64
+ x-changedInMatrixVersion:
65
+ 1.18: |
66
+ Servers MAY prevent room ID enumeration by using the 200 response
67
+ regardless of the existence of the reported room and/or by adding
68
+ a random delay when generating responses.
69
+ responses:
70
+ "200":
71
+ description: The room has been reported successfully.
72
+ content:
73
+ application/json:
74
+ schema:
75
+ type: object
76
+ examples:
77
+ response:
78
+ value: {}
79
+ "404":
80
+ description: |-
81
+ The room was not found on the homeserver.
82
+ content:
83
+ application/json:
84
+ schema:
85
+ $ref: definitions/errors/error.yaml
86
+ examples:
87
+ response:
88
+ value: {
89
+ "errcode": "M_NOT_FOUND",
90
+ "error": "The room was not found."
91
+ }
92
+ "429":
93
+ description: This request was rate-limited.
94
+ content:
95
+ application/json:
96
+ schema:
97
+ $ref: definitions/errors/rate_limited.yaml
98
+ tags:
99
+ - Reporting content
100
+ "/rooms/{roomId}/report/{eventId}":
101
+ post:
102
+ summary: Report an event in a joined room as inappropriate.
103
+ description: |-
104
+ Reports an event as inappropriate to the server, which may then notify
105
+ the appropriate people. The caller must be joined to the room to report
106
+ it.
107
+
108
+ Clients could infer whether a reported event or room exists based on the 404
109
+ response. Homeservers that wish to conceal this information MAY return 200
110
+ responses regardless of the existence of the reported event or room.
111
+
112
+ Furthermore, it might be possible for clients to deduce whether a reported
113
+ event exists by timing the response. This is because only a report for an
114
+ existing event will require the homeserver to do further processing. To
115
+ combat this, homeservers MAY add a random delay when generating a response.
116
+ operationId: reportEvent
117
+ parameters:
118
+ - in: path
119
+ name: roomId
120
+ description: The room in which the event being reported is located.
121
+ required: true
122
+ example: "!637q39766251:example.com"
123
+ schema:
124
+ type: string
125
+ - in: path
126
+ name: eventId
127
+ description: The event to report.
128
+ required: true
129
+ example: $something:example.org
130
+ schema:
131
+ type: string
132
+ requestBody:
133
+ content:
134
+ application/json:
135
+ schema:
136
+ type: object
137
+ example: {
138
+ "reason": "this makes me sad"
139
+ }
140
+ properties:
141
+ reason:
142
+ type: string
143
+ description: The reason the content is being reported.
144
+ required: true
145
+ security:
146
+ - accessTokenQuery: []
147
+ - accessTokenBearer: []
148
+ x-changedInMatrixVersion:
149
+ 1.8: |
150
+ This endpoint now requires the user to be joined to the room.
151
+ 1.18: |
152
+ The `score` request parameter was removed. Additionally, servers
153
+ may prevent event/room ID enumeration by using the 200 response
154
+ regardless of the existence of the reported event/room.
155
+ responses:
156
+ "200":
157
+ description: The event has been reported successfully.
158
+ content:
159
+ application/json:
160
+ schema:
161
+ type: object
162
+ examples:
163
+ response:
164
+ value: {}
165
+ "404":
166
+ description: |-
167
+ The event was not found or you are not joined to the room where the
168
+ event resides.
169
+
170
+ Homeserver implementations can additionally return this error if the
171
+ reported event has been redacted.
172
+ content:
173
+ application/json:
174
+ schema:
175
+ $ref: definitions/errors/error.yaml
176
+ examples:
177
+ response:
178
+ value: {
179
+ "errcode": "M_NOT_FOUND",
180
+ "error": "The event was not found or you are not joined to the room."
181
+ }
182
+ tags:
183
+ - Reporting content
184
+ "/users/{userId}/report":
185
+ post:
186
+ x-addedInMatrixVersion: "1.14"
187
+ summary: Report a user as inappropriate.
188
+ description: |-
189
+ Reports a user as inappropriate to the server, which may then notify
190
+ the appropriate people. How such information is delivered is left up to
191
+ implementations. The caller is not required to be joined to any rooms
192
+ that the reported user is joined to.
193
+
194
+ Clients may wish to [ignore](#ignoring-users) users after reporting them.
195
+
196
+ Clients could infer whether a reported user exists based on the 404 response.
197
+ Homeservers that wish to conceal this information MAY return 200 responses
198
+ regardless of the existence of the reported user.
199
+
200
+ Furthermore, it might be possible for clients to deduce whether a reported
201
+ user exists by timing the response. This is because only a report for an
202
+ existing user will require the homeserver to do further processing. To
203
+ combat this, homeservers MAY add a random delay when generating a response.
204
+ operationId: reportUser
205
+ parameters:
206
+ - in: path
207
+ name: userId
208
+ description: The user being reported.
209
+ required: true
210
+ example: "@someguy:example.com"
211
+ schema:
212
+ type: string
213
+ format: mx-user-id
214
+ pattern: "^@"
215
+ requestBody:
216
+ content:
217
+ application/json:
218
+ schema:
219
+ type: object
220
+ example: {
221
+ "reason": "this makes me sad"
222
+ }
223
+ properties:
224
+ reason:
225
+ type: string
226
+ description: The reason the room is being reported. May be blank.
227
+ required:
228
+ - reason
229
+ required: true
230
+ security:
231
+ - accessTokenQuery: []
232
+ - accessTokenBearer: []
233
+ responses:
234
+ "200":
235
+ description: |
236
+ The user has been reported successfully or the server chose
237
+ to not disclose whether the users exists.
238
+ content:
239
+ application/json:
240
+ schema:
241
+ type: object
242
+ examples:
243
+ response:
244
+ value: {}
245
+ "404":
246
+ description: |-
247
+ The user was not found on the homeserver.
248
+ content:
249
+ application/json:
250
+ schema:
251
+ $ref: definitions/errors/error.yaml
252
+ examples:
253
+ response:
254
+ value: {
255
+ "errcode": "M_NOT_FOUND",
256
+ "error": "The user was not found."
257
+ }
258
+ "429":
259
+ description: This request was rate-limited.
260
+ content:
261
+ application/json:
262
+ schema:
263
+ $ref: definitions/errors/rate_limited.yaml
264
+ tags:
265
+ - Reporting content
266
+ servers:
267
+ - url: "{protocol}://{hostname}{basePath}"
268
+ variables:
269
+ protocol:
270
+ enum:
271
+ - http
272
+ - https
273
+ default: https
274
+ hostname:
275
+ default: localhost:8008
276
+ basePath:
277
+ default: /_matrix/client/v3
278
+ components:
279
+ securitySchemes:
280
+ accessTokenQuery:
281
+ $ref: definitions/security.yaml#/accessTokenQuery
282
+ accessTokenBearer:
283
+ $ref: definitions/security.yaml#/accessTokenBearer