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,887 @@
1
+ # Copyright 2016 OpenMarket Ltd
2
+ # Copyright 2019 The Matrix.org Foundation C.I.C.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ openapi: 3.1.0
16
+ info:
17
+ title: Matrix Client-Server Content Repository API
18
+ version: 1.0.0
19
+ paths:
20
+ /media/v3/upload:
21
+ post:
22
+ summary: Upload some content to the content repository.
23
+ operationId: uploadContent
24
+ security:
25
+ - accessTokenQuery: []
26
+ - accessTokenBearer: []
27
+ parameters:
28
+ - $ref: '#/components/parameters/contentType'
29
+ - $ref: '#/components/parameters/filename'
30
+ requestBody:
31
+ $ref: '#/components/requestBodies/bytes'
32
+ responses:
33
+ "200":
34
+ description: The [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris) for
35
+ the uploaded content.
36
+ content:
37
+ application/json:
38
+ schema:
39
+ type: object
40
+ required:
41
+ - content_uri
42
+ properties:
43
+ content_uri:
44
+ type: string
45
+ format: mx-mxc-uri
46
+ pattern: "^mxc:\\/\\/"
47
+ description: The [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris) to
48
+ the uploaded content.
49
+ examples:
50
+ response:
51
+ value: {
52
+ "content_uri": "mxc://example.com/AQwafuaFswefuhsfAFAgsw"
53
+ }
54
+ "403":
55
+ description: |-
56
+ The user does not have permission to upload the content. Some reasons for this error include:
57
+
58
+ - The server does not permit the file type.
59
+ - The user has reached a quota for uploaded content.
60
+ content:
61
+ application/json:
62
+ schema:
63
+ $ref: definitions/errors/error.yaml
64
+ examples:
65
+ response:
66
+ value: {
67
+ "errcode": "M_FORBIDDEN",
68
+ "error": "Cannot upload this content"
69
+ }
70
+ "413":
71
+ $ref: '#/components/responses/uploadTooLarge'
72
+ "429":
73
+ $ref: '#/components/responses/rateLimited'
74
+ tags:
75
+ - Media
76
+ "/media/v3/upload/{serverName}/{mediaId}":
77
+ put:
78
+ summary: Upload content to an `mxc://` URI that was created earlier.
79
+ description: |-
80
+ This endpoint permits uploading content to an `mxc://` URI that was created
81
+ earlier via [POST /_matrix/media/v1/create](/client-server-api/#post_matrixmediav1create).
82
+ operationId: uploadContentToMXC
83
+ x-addedInMatrixVersion: "1.7"
84
+ security:
85
+ - accessTokenQuery: []
86
+ - accessTokenBearer: []
87
+ parameters:
88
+ - $ref: '#/components/parameters/serverName'
89
+ description: |
90
+ The server name from the `mxc://` URI returned by `POST /_matrix/media/v1/create` (the authority component).
91
+ - $ref: '#/components/parameters/mediaId'
92
+ description: |
93
+ The media ID from the `mxc://` URI returned by `POST /_matrix/media/v1/create` (the path component).
94
+ - $ref: '#/components/parameters/contentType'
95
+ - $ref: '#/components/parameters/filename'
96
+ requestBody:
97
+ $ref: '#/components/requestBodies/bytes'
98
+ responses:
99
+ "200":
100
+ description: The upload was successful.
101
+ content:
102
+ application/json:
103
+ schema:
104
+ type: object
105
+ examples:
106
+ response:
107
+ value: {}
108
+ "403":
109
+ description: |-
110
+ The user does not have permission to upload the content. Some reasons for this error include:
111
+
112
+ - The server does not permit the file type.
113
+ - The user has reached a quota for uploaded content.
114
+ - The request comes from a different user than the one that called
115
+ [POST /_matrix/media/v1/create](/client-server-api/#post_matrixmediav1create).
116
+
117
+ A [standard error response](/client-server-api/#standard-error-response)
118
+ will be returned with the `errcode` `M_FORBIDDEN`.
119
+ content:
120
+ application/json:
121
+ schema:
122
+ $ref: definitions/errors/error.yaml
123
+ examples:
124
+ response:
125
+ value: {
126
+ "errcode": "M_FORBIDDEN",
127
+ "error": "Cannot upload this content"
128
+ }
129
+ "404":
130
+ description: |-
131
+ The user has provided an invalid MXC ID. Some reasons for this error include:
132
+
133
+ - The MXC ID was not created with [POST /_matrix/media/v1/create](/client-server-api/#post_matrixmediav1create).
134
+ - The MXC ID has expired.
135
+
136
+ A [standard error response](/client-server-api/#standard-error-response)
137
+ will be returned with the `errcode` `M_NOT_FOUND`.
138
+ content:
139
+ application/json:
140
+ schema:
141
+ $ref: definitions/errors/error.yaml
142
+ examples:
143
+ response:
144
+ value: {
145
+ "errcode": "M_NOT_FOUND",
146
+ "error": "Unknown media ID"
147
+ }
148
+ "409":
149
+ description: |-
150
+ The endpoint was called with a media ID that already has content. A
151
+ [standard error response](/client-server-api/#standard-error-response)
152
+ will be returned with the `errcode` `M_CANNOT_OVERWRITE_MEDIA`.
153
+ content:
154
+ application/json:
155
+ schema:
156
+ $ref: definitions/errors/error.yaml
157
+ examples:
158
+ response:
159
+ value: {
160
+ "errcode": "M_CANNOT_OVERWRITE_MEDIA",
161
+ "error": "Media already uploaded"
162
+ }
163
+ "413":
164
+ $ref: '#/components/responses/uploadTooLarge'
165
+ "429":
166
+ $ref: '#/components/responses/rateLimited'
167
+ tags:
168
+ - Media
169
+ /media/v1/create:
170
+ post:
171
+ summary: Create a new `mxc://` URI without uploading the content.
172
+ description: |-
173
+ Creates a new `mxc://` URI, independently of the content being uploaded. The content must be provided later
174
+ via [`PUT /_matrix/media/v3/upload/{serverName}/{mediaId}`](/client-server-api/#put_matrixmediav3uploadservernamemediaid).
175
+
176
+ The server may optionally enforce a maximum age for unused IDs,
177
+ and delete media IDs when the client doesn't start the upload in time,
178
+ or when the upload was interrupted and not resumed in time. The server
179
+ should include the maximum POSIX millisecond timestamp to complete the
180
+ upload in the `unused_expires_at` field in the response JSON. The
181
+ recommended default expiration is 24 hours which should be enough time
182
+ to accommodate users on poor connection who find a better connection to
183
+ complete the upload.
184
+
185
+ As well as limiting the rate of requests to create `mxc://` URIs, the server
186
+ should limit the number of concurrent *pending media uploads* a given
187
+ user can have. A pending media upload is a created `mxc://` URI where (a)
188
+ the media has not yet been uploaded, and (b) has not yet expired (the
189
+ `unused_expires_at` timestamp has not yet passed). In both cases, the
190
+ server should respond with an HTTP 429 error with an errcode of
191
+ `M_LIMIT_EXCEEDED`.
192
+ operationId: createContent
193
+ x-addedInMatrixVersion: "1.7"
194
+ security:
195
+ - accessTokenQuery: []
196
+ - accessTokenBearer: []
197
+ # empty json object
198
+ responses:
199
+ "200":
200
+ description: The [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris) for
201
+ the uploaded content.
202
+ content:
203
+ application/json:
204
+ schema:
205
+ type: object
206
+ required:
207
+ - content_uri
208
+ properties:
209
+ content_uri:
210
+ type: string
211
+ format: mx-mxc-uri
212
+ pattern: "^mxc:\\/\\/"
213
+ description: |-
214
+ The [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris) at
215
+ which the content will be available, once it is uploaded.
216
+ example: mxc://example.com/AQwafuaFswefuhsfAFAgsw
217
+ unused_expires_at:
218
+ type: integer
219
+ format: int64
220
+ description: |-
221
+ The timestamp (in milliseconds since the unix epoch) when the
222
+ generated media id will expire, if media is not uploaded.
223
+ example: 1647257217083
224
+ "403":
225
+ description: The user does not have permission to upload the content.
226
+ content:
227
+ application/json:
228
+ schema:
229
+ $ref: definitions/errors/error.yaml
230
+ examples:
231
+ response:
232
+ value: {
233
+ "errcode": "M_FORBIDDEN",
234
+ "error": "Cannot upload this content"
235
+ }
236
+ "429":
237
+ $ref: '#/components/responses/rateLimited'
238
+ tags:
239
+ - Media
240
+ "/media/v3/download/{serverName}/{mediaId}":
241
+ get:
242
+ deprecated: true
243
+ summary: Download content from the content repository.
244
+ description: |-
245
+ {{% boxes/note %}}
246
+ Replaced by [`GET /_matrix/client/v1/media/download/{serverName}/{mediaId}`](/client-server-api/#get_matrixclientv1mediadownloadservernamemediaid)
247
+ (requires authentication).
248
+ {{% /boxes/note %}}
249
+
250
+ {{% boxes/warning %}}
251
+ {{% changed-in v="1.11" %}} This endpoint MAY return `404 M_NOT_FOUND`
252
+ for media which exists, but is after the server froze unauthenticated
253
+ media access. See [Client Behaviour](/client-server-api/#content-repo-client-behaviour) for more
254
+ information.
255
+ {{% /boxes/warning %}}
256
+ operationId: getContent
257
+ parameters:
258
+ - $ref: '#/components/parameters/serverName'
259
+ - $ref: '#/components/parameters/mediaId'
260
+ - $ref: '#/components/parameters/allow_remote'
261
+ - $ref: '#/components/parameters/timeout_ms'
262
+ - $ref: '#/components/parameters/allow_redirect'
263
+ responses:
264
+ "200":
265
+ description: The content that was previously uploaded.
266
+ headers:
267
+ Content-Type:
268
+ $ref: '#/components/headers/downloadContentType'
269
+ Content-Disposition:
270
+ x-changedInMatrixVersion:
271
+ "1.12": This header became required.
272
+ description: |
273
+ The [disposition](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition)
274
+ of the returned content. MUST be one of `inline` or `attachment`,
275
+ and SHOULD contain a file name.
276
+
277
+ If the `Content-Type` is allowed in the [restrictions for serving
278
+ inline content](/client-server-api/#serving-inline-content),
279
+ servers SHOULD use `inline`, otherwise they SHOULD use
280
+ `attachment`.
281
+
282
+ If the upload was made with a `filename`, this header MUST
283
+ contain the same `filename`. Otherwise, `filename` is excluded
284
+ from the header. If the media being downloaded is remote, the
285
+ remote server's `filename` in the `Content-Disposition` header
286
+ is used as the `filename` instead. When the header is not
287
+ supplied, or does not supply a `filename`, the local download
288
+ response does not include a `filename`.
289
+ required: true
290
+ schema:
291
+ type: string
292
+ example: "inline; filename=\"filename.jpg\""
293
+ content:
294
+ application/octet-stream:
295
+ schema:
296
+ # This is a workaround for us not being able to say the response is required.
297
+ description: "**Required.** The bytes for the uploaded file."
298
+ "307":
299
+ $ref: '#/components/responses/downloadRedirect'
300
+ "308":
301
+ $ref: '#/components/responses/downloadRedirect'
302
+ "429":
303
+ $ref: '#/components/responses/rateLimited'
304
+ "502":
305
+ $ref: '#/components/responses/downloadTooLarge'
306
+ "504":
307
+ $ref: '#/components/responses/notYetUploaded'
308
+ tags:
309
+ - Media
310
+ "/media/v3/download/{serverName}/{mediaId}/{fileName}":
311
+ get:
312
+ deprecated: true
313
+ summary: Download content from the content repository overriding the file name
314
+ description: |-
315
+ {{% boxes/note %}}
316
+ Replaced by [`GET /_matrix/client/v1/media/download/{serverName}/{mediaId}/{fileName}`](/client-server-api/#get_matrixclientv1mediadownloadservernamemediaidfilename)
317
+ (requires authentication).
318
+ {{% /boxes/note %}}
319
+
320
+ This will download content from the content repository (same as
321
+ the previous endpoint) but replace the target file name with the one
322
+ provided by the caller.
323
+
324
+ {{% boxes/warning %}}
325
+ {{% changed-in v="1.11" %}} This endpoint MAY return `404 M_NOT_FOUND`
326
+ for media which exists, but is after the server froze unauthenticated
327
+ media access. See [Client Behaviour](/client-server-api/#content-repo-client-behaviour) for more
328
+ information.
329
+ {{% /boxes/warning %}}
330
+ operationId: getContentOverrideName
331
+ parameters:
332
+ - $ref: '#/components/parameters/serverName'
333
+ - $ref: '#/components/parameters/mediaId'
334
+ - in: path
335
+ name: fileName
336
+ required: true
337
+ description: A filename to give in the `Content-Disposition` header.
338
+ example: filename.jpg
339
+ schema:
340
+ type: string
341
+ - $ref: '#/components/parameters/allow_remote'
342
+ - $ref: '#/components/parameters/timeout_ms'
343
+ - $ref: '#/components/parameters/allow_redirect'
344
+ responses:
345
+ "200":
346
+ description: The content that was previously uploaded.
347
+ headers:
348
+ Content-Type:
349
+ $ref: '#/components/headers/downloadContentType'
350
+ Content-Disposition:
351
+ x-changedInMatrixVersion:
352
+ "1.12": This header became required.
353
+ description: |
354
+ The [disposition](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition)
355
+ of the returned content. MUST be one of `inline` or `attachment`,
356
+ and MUST contain the file name requested in the path.
357
+
358
+ If the `Content-Type` is allowed in the [restrictions for serving
359
+ inline content](/client-server-api/#serving-inline-content),
360
+ servers SHOULD use `inline`, otherwise they SHOULD use
361
+ `attachment`.
362
+ required: true
363
+ schema:
364
+ type: string
365
+ example: "inline; filename=\"filename.jpg\""
366
+ content:
367
+ application/octet-stream:
368
+ schema:
369
+ # This is a workaround for us not being able to say the response is required.
370
+ description: "**Required.** The bytes for the uploaded file."
371
+ "307":
372
+ $ref: '#/components/responses/downloadRedirect'
373
+ "308":
374
+ $ref: '#/components/responses/downloadRedirect'
375
+ "429":
376
+ $ref: '#/components/responses/rateLimited'
377
+ "502":
378
+ $ref: '#/components/responses/downloadTooLarge'
379
+ "504":
380
+ $ref: '#/components/responses/notYetUploaded'
381
+ tags:
382
+ - Media
383
+ "/media/v3/thumbnail/{serverName}/{mediaId}":
384
+ get:
385
+ deprecated: true
386
+ summary: Download a thumbnail of content from the content repository
387
+ description: |-
388
+ {{% boxes/note %}}
389
+ Replaced by [`GET /_matrix/client/v1/media/thumbnail/{serverName}/{mediaId}`](/client-server-api/#get_matrixclientv1mediathumbnailservernamemediaid)
390
+ (requires authentication).
391
+ {{% /boxes/note %}}
392
+
393
+ Download a thumbnail of content from the content repository.
394
+ See the [Thumbnails](/client-server-api/#thumbnails) section for more information.
395
+
396
+ {{% boxes/warning %}}
397
+ {{% changed-in v="1.11" %}} This endpoint MAY return `404 M_NOT_FOUND`
398
+ for media which exists, but is after the server froze unauthenticated
399
+ media access. See [Client Behaviour](/client-server-api/#content-repo-client-behaviour) for more
400
+ information.
401
+ {{% /boxes/warning %}}
402
+ operationId: getContentThumbnail
403
+ parameters:
404
+ - $ref: '#/components/parameters/serverName'
405
+ - $ref: '#/components/parameters/mediaId'
406
+ - in: query
407
+ name: width
408
+ required: true
409
+ description: |-
410
+ The *desired* width of the thumbnail. The actual thumbnail may be
411
+ larger than the size specified.
412
+ example: 64
413
+ schema:
414
+ type: integer
415
+ - in: query
416
+ name: height
417
+ required: true
418
+ description: |-
419
+ The *desired* height of the thumbnail. The actual thumbnail may be
420
+ larger than the size specified.
421
+ example: 64
422
+ schema:
423
+ type: integer
424
+ - in: query
425
+ name: method
426
+ description: |-
427
+ The desired resizing method. See the [Thumbnails](/client-server-api/#thumbnails)
428
+ section for more information.
429
+ example: scale
430
+ schema:
431
+ type: string
432
+ enum:
433
+ - crop
434
+ - scale
435
+ - $ref: '#/components/parameters/allow_remote'
436
+ - $ref: '#/components/parameters/timeout_ms'
437
+ - $ref: '#/components/parameters/allow_redirect'
438
+ - in: query
439
+ name: animated
440
+ x-addedInMatrixVersion: "1.11"
441
+ required: false
442
+ description: |
443
+ Indicates preference for an animated thumbnail from the server, if possible. Animated
444
+ thumbnails typically use the content types `image/gif`, `image/png` (with APNG format),
445
+ `image/apng`, and `image/webp` instead of the common static `image/png` or `image/jpeg`
446
+ content types.
447
+
448
+ When `true`, the server SHOULD return an animated thumbnail if possible and supported.
449
+ When `false`, the server MUST NOT return an animated thumbnail. For example, returning a
450
+ static `image/png` or `image/jpeg` thumbnail. When not provided, the server SHOULD NOT
451
+ return an animated thumbnail.
452
+
453
+ Servers SHOULD prefer to return `image/webp` thumbnails when supporting animation.
454
+
455
+ When `true` and the media cannot be animated, such as in the case of a JPEG or PDF, the
456
+ server SHOULD behave as though `animated` is `false`.
457
+ example: false
458
+ schema:
459
+ type: boolean
460
+ responses:
461
+ "200":
462
+ description: A thumbnail of the requested content.
463
+ headers:
464
+ Content-Disposition:
465
+ x-addedInMatrixVersion: "1.12"
466
+ description: |
467
+ The [disposition](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition)
468
+ of the returned content. MUST be `inline`, and SHOULD contain a file name (e.g. `thumbnail.png`).
469
+
470
+ Servers should note the [Content-Type restrictions for serving inline content](/client-server-api/#serving-inline-content),
471
+ as these limitations imply which formats should be used for thumbnail generation.
472
+ required: true
473
+ schema:
474
+ type: string
475
+ example: "inline; filename=\"thumbnail.png\""
476
+ Content-Type:
477
+ x-changedInMatrixVersion:
478
+ "1.12": |
479
+ This header became required in order to support `Content-Disposition`.
480
+ description: The content type of the thumbnail.
481
+ required: true
482
+ schema:
483
+ type: string
484
+ enum:
485
+ - image/jpeg
486
+ - image/png
487
+ - image/apng
488
+ - image/gif
489
+ - image/webp
490
+ content:
491
+ image/jpeg:
492
+ schema:
493
+ # This is a workaround for us not being able to say the response is required.
494
+ description: "**Required.** The bytes for the thumbnail."
495
+ image/png:
496
+ schema:
497
+ x-changedInMatrixVersion:
498
+ "1.11": The PNG may be of the APNG variety if animation is supported and requested.
499
+ description: |
500
+ **Required.** The bytes for the thumbnail. The thumbnail MAY use an animated
501
+ format if `animated=true`.
502
+ image/apng:
503
+ schema:
504
+ x-addedInMatrixVersion: "1.11"
505
+ description: "**Required.** The bytes for the *animated* thumbnail."
506
+ image/gif:
507
+ schema:
508
+ x-addedInMatrixVersion: "1.11"
509
+ description: "**Required.** The bytes for the *animated* thumbnail."
510
+ image/webp:
511
+ schema:
512
+ x-addedInMatrixVersion: "1.11"
513
+ description: "**Required.** The bytes for the *animated* thumbnail."
514
+ "307":
515
+ $ref: '#/components/responses/thumbnailRedirect'
516
+ "308":
517
+ $ref: '#/components/responses/thumbnailRedirect'
518
+ "400":
519
+ description: |-
520
+ The request does not make sense to the server, or the server cannot thumbnail
521
+ the content. For example, the client requested non-integer dimensions or asked
522
+ for negatively-sized images.
523
+ content:
524
+ application/json:
525
+ schema:
526
+ $ref: definitions/errors/error.yaml
527
+ examples:
528
+ response:
529
+ value: {
530
+ "errcode": "M_UNKNOWN",
531
+ "error": "Cannot generate thumbnails for the requested content"
532
+ }
533
+ "413":
534
+ description: The local content is too large for the server to thumbnail.
535
+ content:
536
+ application/json:
537
+ schema:
538
+ $ref: definitions/errors/error.yaml
539
+ examples:
540
+ response:
541
+ value: {
542
+ "errcode": "M_TOO_LARGE",
543
+ "error": "Content is too large to thumbnail"
544
+ }
545
+ "429":
546
+ $ref: '#/components/responses/rateLimited'
547
+ "502":
548
+ description: The remote content is too large for the server to thumbnail.
549
+ content:
550
+ application/json:
551
+ schema:
552
+ $ref: definitions/errors/error.yaml
553
+ examples:
554
+ response:
555
+ value: {
556
+ "errcode": "M_TOO_LARGE",
557
+ "error": "Content is too large to thumbnail"
558
+ }
559
+ "504":
560
+ $ref: '#/components/responses/notYetUploaded'
561
+ tags:
562
+ - Media
563
+ /media/v3/preview_url:
564
+ get:
565
+ deprecated: true
566
+ summary: Get information about a URL for a client
567
+ description: |-
568
+ {{% boxes/note %}}
569
+ Replaced by [`GET /_matrix/client/v1/media/preview_url`](/client-server-api/#get_matrixclientv1mediapreview_url).
570
+ {{% /boxes/note %}}
571
+
572
+ Get information about a URL for the client. Typically this is called when a
573
+ client sees a URL in a message and wants to render a preview for the user.
574
+
575
+ **Note:**
576
+ Clients should consider avoiding this endpoint for URLs posted in encrypted
577
+ rooms. Encrypted rooms often contain more sensitive information the users
578
+ do not want to share with the homeserver, and this can mean that the URLs
579
+ being shared should also not be shared with the homeserver.
580
+ operationId: getUrlPreview
581
+ security:
582
+ - accessTokenQuery: []
583
+ - accessTokenBearer: []
584
+ parameters:
585
+ - in: query
586
+ name: url
587
+ description: The URL to get a preview of.
588
+ required: true
589
+ example: https://matrix.org
590
+ schema:
591
+ type: string
592
+ format: uri
593
+ - in: query
594
+ name: ts
595
+ description: |-
596
+ The preferred point in time to return a preview for. The server may
597
+ return a newer version if it does not have the requested version
598
+ available.
599
+ example: 1510610716656
600
+ schema:
601
+ type: integer
602
+ format: int64
603
+ responses:
604
+ "200":
605
+ description: |-
606
+ The OpenGraph data for the URL, which may be empty. Some values are
607
+ replaced with matrix equivalents if they are provided in the response.
608
+ The differences from the [OpenGraph](https://ogp.me/) protocol are
609
+ described here.
610
+ content:
611
+ application/json:
612
+ schema:
613
+ type: object
614
+ properties:
615
+ matrix:image:size:
616
+ type: integer
617
+ format: int64
618
+ description: The byte-size of the image. Omitted if there is no image attached.
619
+ og:image:
620
+ type: string
621
+ format: uri
622
+ description: An [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris) to
623
+ the image. Omitted if there is no image.
624
+ additionalProperties:
625
+ description: |-
626
+ Additional properties as per the [OpenGraph](https://ogp.me/) protocol.
627
+ examples:
628
+ response:
629
+ value: {
630
+ "og:title": "Matrix Blog Post",
631
+ "og:description": "This is a really cool blog post from matrix.org",
632
+ "og:image": "mxc://example.com/ascERGshawAWawugaAcauga",
633
+ "og:image:type": "image/png",
634
+ "og:image:height": 48,
635
+ "og:image:width": 48,
636
+ "matrix:image:size": 102400
637
+ }
638
+ "429":
639
+ $ref: '#/components/responses/rateLimited'
640
+ tags:
641
+ - Media
642
+ /media/v3/config:
643
+ get:
644
+ deprecated: true
645
+ summary: Get the configuration for the content repository.
646
+ description: |-
647
+ {{% boxes/note %}}
648
+ Replaced by [`GET /_matrix/client/v1/media/config`](/client-server-api/#get_matrixclientv1mediaconfig).
649
+ {{% /boxes/note %}}
650
+
651
+ This endpoint allows clients to retrieve the configuration of the content
652
+ repository, such as upload limitations.
653
+ Clients SHOULD use this as a guide when using content repository endpoints.
654
+ All values are intentionally left optional. Clients SHOULD follow
655
+ the advice given in the field description when the field is not available.
656
+
657
+ **NOTE:** Both clients and server administrators should be aware that proxies
658
+ between the client and the server may affect the apparent behaviour of content
659
+ repository APIs, for example, proxies may enforce a lower upload size limit
660
+ than is advertised by the server on this endpoint.
661
+ operationId: getConfig
662
+ security:
663
+ - accessTokenQuery: []
664
+ - accessTokenBearer: []
665
+ responses:
666
+ "200":
667
+ description: The public content repository configuration for the matrix server.
668
+ content:
669
+ application/json:
670
+ schema:
671
+ type: object
672
+ properties:
673
+ m.upload.size:
674
+ type: integer
675
+ format: int64
676
+ description: |-
677
+ The maximum size an upload can be in bytes.
678
+ Clients SHOULD use this as a guide when uploading content.
679
+ If not listed or null, the size limit should be treated as unknown.
680
+ examples:
681
+ response:
682
+ value: {
683
+ "m.upload.size": 50000000
684
+ }
685
+ "429":
686
+ $ref: '#/components/responses/rateLimited'
687
+ tags:
688
+ - Media
689
+ servers:
690
+ - url: "{protocol}://{hostname}{basePath}"
691
+ variables:
692
+ protocol:
693
+ enum:
694
+ - http
695
+ - https
696
+ default: https
697
+ hostname:
698
+ default: localhost:8008
699
+ basePath:
700
+ default: /_matrix
701
+ components:
702
+ securitySchemes:
703
+ accessTokenQuery:
704
+ $ref: definitions/security.yaml#/accessTokenQuery
705
+ accessTokenBearer:
706
+ $ref: definitions/security.yaml#/accessTokenBearer
707
+ parameters:
708
+ contentType:
709
+ in: header
710
+ name: Content-Type
711
+ description: |
712
+ **Optional.** The content type of the file being uploaded.
713
+
714
+ Clients SHOULD always supply this header.
715
+
716
+ Defaults to `application/octet-stream` if it is not set.
717
+ x-changedInMatrixVersion:
718
+ "1.12": |
719
+ This header became explicitly optional with a default value.
720
+ example: application/pdf
721
+ schema:
722
+ type: string
723
+ filename:
724
+ in: query
725
+ name: filename
726
+ description: The name of the file being uploaded
727
+ example: War and Peace.pdf
728
+ schema:
729
+ type: string
730
+ serverName:
731
+ in: path
732
+ name: serverName
733
+ required: true
734
+ description: |
735
+ The server name from the `mxc://` URI (the authority component).
736
+ example: matrix.org
737
+ schema:
738
+ type: string
739
+ format: mx-server-name
740
+ mediaId:
741
+ in: path
742
+ name: mediaId
743
+ required: true
744
+ description: |
745
+ The media ID from the `mxc://` URI (the path component).
746
+ example: ascERGshawAWawugaAcauga
747
+ schema:
748
+ type: string
749
+ allow_remote:
750
+ in: query
751
+ name: allow_remote
752
+ required: false
753
+ description: |-
754
+ Indicates to the server that it should not attempt to fetch the media if
755
+ it is deemed remote. This is to prevent routing loops where the server
756
+ contacts itself.
757
+
758
+ Defaults to `true` if not provided.
759
+ example: false
760
+ schema:
761
+ type: boolean
762
+ default: true
763
+ timeout_ms:
764
+ in: query
765
+ name: timeout_ms
766
+ x-addedInMatrixVersion: "1.7"
767
+ description: |
768
+ The maximum number of milliseconds that the client is willing to wait to
769
+ start receiving data, in the case that the content has not yet been
770
+ uploaded. The default value is 20000 (20 seconds). The content
771
+ repository SHOULD impose a maximum value for this parameter. The
772
+ content repository MAY respond before the timeout.
773
+ example: 5000
774
+ schema:
775
+ type: integer
776
+ format: int64
777
+ default: 20000
778
+ allow_redirect:
779
+ in: query
780
+ name: allow_redirect
781
+ x-addedInMatrixVersion: "1.7"
782
+ required: false
783
+ description: |
784
+ Indicates to the server that it may return a 307 or 308 redirect
785
+ response that points at the relevant media content. When not explicitly
786
+ set to `true` the server must return the media content itself.
787
+ example: false
788
+ schema:
789
+ type: boolean
790
+ default: false
791
+ requestBodies:
792
+ bytes:
793
+ content:
794
+ application/octet-stream:
795
+ schema:
796
+ description: The content to be uploaded.
797
+ example: <bytes>
798
+ required: true
799
+ responses:
800
+ uploadTooLarge:
801
+ description: The uploaded content is too large for the server.
802
+ content:
803
+ application/json:
804
+ schema:
805
+ $ref: definitions/errors/error.yaml
806
+ examples:
807
+ response:
808
+ value: {
809
+ "errcode": "M_TOO_LARGE",
810
+ "error": "Cannot upload files larger than 100mb"
811
+ }
812
+ rateLimited:
813
+ description: This request was rate-limited.
814
+ content:
815
+ application/json:
816
+ schema:
817
+ $ref: definitions/errors/rate_limited.yaml
818
+ notYetUploaded:
819
+ description: |-
820
+ The content is not yet available. A [standard error response](/client-server-api/#standard-error-response)
821
+ will be returned with the `errcode` `M_NOT_YET_UPLOADED`.
822
+ content:
823
+ application/json:
824
+ schema:
825
+ $ref: definitions/errors/error.yaml
826
+ examples:
827
+ response:
828
+ value: {
829
+ "errcode": "M_NOT_YET_UPLOADED",
830
+ "error": "Content has not yet been uploaded"
831
+ }
832
+ downloadRedirect:
833
+ description: A redirect to the requested content.
834
+ headers:
835
+ Location:
836
+ description: The URL of the content.
837
+ schema:
838
+ type: string
839
+ format: uri
840
+ downloadTooLarge:
841
+ description: The content is too large for the server to serve.
842
+ content:
843
+ application/json:
844
+ schema:
845
+ $ref: definitions/errors/error.yaml
846
+ examples:
847
+ response:
848
+ value: {
849
+ "errcode": "M_TOO_LARGE",
850
+ "error": "Content is too large to serve"
851
+ }
852
+ thumbnailRedirect:
853
+ description: A redirect to the thumbnail of the requested content.
854
+ headers:
855
+ Location:
856
+ description: The URL of the thumbnail content.
857
+ schema:
858
+ type: string
859
+ format: uri
860
+ headers:
861
+ downloadContentType:
862
+ description: |
863
+ The content type of the file that was previously uploaded.
864
+
865
+ The server MUST return a `Content-Type` which is either exactly the same
866
+ as the original upload, or reasonably close. The bounds of "reasonable"
867
+ are:
868
+
869
+ * Adding a charset to `text/*` content types.
870
+ * Detecting HTML and using `text/html` instead of `text/plain`.
871
+ * Using `application/octet-stream` when the server determines the
872
+ content type is obviously wrong. For example, an encrypted file being
873
+ claimed as `image/png`.
874
+ * Returning `application/octet-stream` when the media has an
875
+ unknown/unprovided `Content-Type`. For example, being uploaded before
876
+ the server tracked content types or when the remote server is
877
+ non-compliantly omitting the header entirely.
878
+
879
+ Actions not in the spirit of the above are not considered "reasonable".
880
+ x-changedInMatrixVersion:
881
+ "1.12": |
882
+ This header became required in order to support `Content-Disposition`,
883
+ and the behaviour to compute its value was clarified.
884
+ required: true
885
+ schema:
886
+ type: string
887
+