async-matrix 0.1.2 → 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 +5 -2
  341. metadata +353 -1
@@ -0,0 +1,590 @@
1
+ # Copyright 2016 OpenMarket Ltd
2
+ # Copyright 2019-2024 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 (Authenticated) Content Repository API
18
+ version: 1.0.0
19
+ paths:
20
+ "/media/download/{serverName}/{mediaId}":
21
+ get:
22
+ x-addedInMatrixVersion: "1.11"
23
+ summary: Download content from the content repository.
24
+ description: |-
25
+ {{% boxes/note %}}
26
+ Clients SHOULD NOT generate or use URLs which supply the access token in
27
+ the query string. These URLs may be copied by users verbatim and provided
28
+ in a chat message to another user, disclosing the sender's access token.
29
+ {{% /boxes/note %}}
30
+
31
+ Clients MAY be redirected using the 307/308 responses below to download
32
+ the request object. This is typical when the homeserver uses a Content
33
+ Delivery Network (CDN).
34
+ operationId: getContentAuthed
35
+ security:
36
+ - accessTokenQuery: []
37
+ - accessTokenBearer: []
38
+ parameters:
39
+ - $ref: '#/components/parameters/serverName'
40
+ - $ref: '#/components/parameters/mediaId'
41
+ - $ref: '#/components/parameters/timeout_ms'
42
+ responses:
43
+ "200":
44
+ description: The content that was previously uploaded.
45
+ headers:
46
+ Content-Type:
47
+ $ref: '#/components/headers/downloadContentType'
48
+ Content-Disposition:
49
+ x-changedInMatrixVersion:
50
+ "1.12": This header became required.
51
+ description: |
52
+ The [disposition](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition)
53
+ of the returned content. MUST be one of `inline` or `attachment`,
54
+ and SHOULD contain a file name.
55
+
56
+ If the `Content-Type` is allowed in the [restrictions for serving
57
+ inline content](/client-server-api/#serving-inline-content),
58
+ servers SHOULD use `inline`, otherwise they SHOULD use
59
+ `attachment`.
60
+
61
+ If the upload was made with a `filename`, this header MUST
62
+ contain the same `filename`. Otherwise, `filename` is excluded
63
+ from the header. If the media being downloaded is remote, the
64
+ remote server's `filename` in the `Content-Disposition` header
65
+ is used as the `filename` instead. When the header is not
66
+ supplied, or does not supply a `filename`, the local download
67
+ response does not include a `filename`.
68
+ required: true
69
+ schema:
70
+ type: string
71
+ example: "inline; filename=\"filename.jpg\""
72
+ content:
73
+ application/octet-stream:
74
+ schema:
75
+ # This is a workaround for us not being able to say the response is required.
76
+ description: "**Required.** The bytes for the uploaded file."
77
+ "307":
78
+ $ref: '#/components/responses/downloadRedirect'
79
+ "308":
80
+ $ref: '#/components/responses/downloadRedirect'
81
+ "429":
82
+ $ref: '#/components/responses/rateLimited'
83
+ "502":
84
+ $ref: '#/components/responses/downloadTooLarge'
85
+ "504":
86
+ $ref: '#/components/responses/notYetUploaded'
87
+ tags:
88
+ - Media
89
+ "/media/download/{serverName}/{mediaId}/{fileName}":
90
+ get:
91
+ x-addedInMatrixVersion: "1.11"
92
+ summary: Download content from the content repository overriding the file name.
93
+ description: |-
94
+ This will download content from the content repository (same as
95
+ the previous endpoint) but replaces the target file name with the one
96
+ provided by the caller.
97
+
98
+ {{% boxes/note %}}
99
+ Clients SHOULD NOT generate or use URLs which supply the access token in
100
+ the query string. These URLs may be copied by users verbatim and provided
101
+ in a chat message to another user, disclosing the sender's access token.
102
+ {{% /boxes/note %}}
103
+
104
+ Clients MAY be redirected using the 307/308 responses below to download
105
+ the request object. This is typical when the homeserver uses a Content
106
+ Delivery Network (CDN).
107
+ operationId: getContentOverrideNameAuthed
108
+ security:
109
+ - accessTokenQuery: []
110
+ - accessTokenBearer: []
111
+ parameters:
112
+ - $ref: '#/components/parameters/serverName'
113
+ - $ref: '#/components/parameters/mediaId'
114
+ - in: path
115
+ name: fileName
116
+ required: true
117
+ description: A filename to give in the `Content-Disposition` header.
118
+ example: filename.jpg
119
+ schema:
120
+ type: string
121
+ - $ref: '#/components/parameters/timeout_ms'
122
+ responses:
123
+ "200":
124
+ description: The content that was previously uploaded.
125
+ headers:
126
+ Content-Type:
127
+ $ref: '#/components/headers/downloadContentType'
128
+ Content-Disposition:
129
+ x-changedInMatrixVersion:
130
+ "1.12": This header became required.
131
+ description: |
132
+ The [disposition](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition)
133
+ of the returned content. MUST be one of `inline` or `attachment`,
134
+ and MUST contain the file name requested in the path.
135
+
136
+ If the `Content-Type` is allowed in the [restrictions for serving
137
+ inline content](/client-server-api/#serving-inline-content),
138
+ servers SHOULD use `inline`, otherwise they SHOULD use
139
+ `attachment`.
140
+ required: true
141
+ schema:
142
+ type: string
143
+ example: "inline; filename=\"filename.jpg\""
144
+ content:
145
+ application/octet-stream:
146
+ schema:
147
+ # This is a workaround for us not being able to say the response is required.
148
+ description: "**Required.** The bytes for the uploaded file."
149
+ "307":
150
+ $ref: '#/components/responses/downloadRedirect'
151
+ "308":
152
+ $ref: '#/components/responses/downloadRedirect'
153
+ "429":
154
+ $ref: '#/components/responses/rateLimited'
155
+ "502":
156
+ $ref: '#/components/responses/downloadTooLarge'
157
+ "504":
158
+ $ref: '#/components/responses/notYetUploaded'
159
+ tags:
160
+ - Media
161
+ "/media/thumbnail/{serverName}/{mediaId}":
162
+ get:
163
+ x-addedInMatrixVersion: "1.11"
164
+ summary: Download a thumbnail of content from the content repository
165
+ description: |-
166
+ Download a thumbnail of content from the content repository.
167
+ See the [Thumbnails](/client-server-api/#thumbnails) section for more information.
168
+
169
+ {{% boxes/note %}}
170
+ Clients SHOULD NOT generate or use URLs which supply the access token in
171
+ the query string. These URLs may be copied by users verbatim and provided
172
+ in a chat message to another user, disclosing the sender's access token.
173
+ {{% /boxes/note %}}
174
+
175
+ Clients MAY be redirected using the 307/308 responses below to download
176
+ the request object. This is typical when the homeserver uses a Content
177
+ Delivery Network (CDN).
178
+ operationId: getContentThumbnailAuthed
179
+ security:
180
+ - accessTokenQuery: []
181
+ - accessTokenBearer: []
182
+ parameters:
183
+ - $ref: '#/components/parameters/serverName'
184
+ - $ref: '#/components/parameters/mediaId'
185
+ - in: query
186
+ name: width
187
+ required: true
188
+ description: |-
189
+ The *desired* width of the thumbnail. The actual thumbnail may be
190
+ larger than the size specified.
191
+ example: 64
192
+ schema:
193
+ type: integer
194
+ - in: query
195
+ name: height
196
+ required: true
197
+ description: |-
198
+ The *desired* height of the thumbnail. The actual thumbnail may be
199
+ larger than the size specified.
200
+ example: 64
201
+ schema:
202
+ type: integer
203
+ - in: query
204
+ name: method
205
+ description: |-
206
+ The desired resizing method. See the [Thumbnails](/client-server-api/#thumbnails)
207
+ section for more information.
208
+ example: scale
209
+ schema:
210
+ type: string
211
+ enum:
212
+ - crop
213
+ - scale
214
+ - $ref: '#/components/parameters/timeout_ms'
215
+ - in: query
216
+ name: animated
217
+ x-addedInMatrixVersion: "1.11"
218
+ required: false
219
+ description: |
220
+ Indicates preference for an animated thumbnail from the server, if possible. Animated
221
+ thumbnails typically use the content types `image/gif`, `image/png` (with APNG format),
222
+ `image/apng`, and `image/webp` instead of the common static `image/png` or `image/jpeg`
223
+ content types.
224
+
225
+ When `true`, the server SHOULD return an animated thumbnail if possible and supported.
226
+ When `false`, the server MUST NOT return an animated thumbnail. For example, returning a
227
+ static `image/png` or `image/jpeg` thumbnail. When not provided, the server SHOULD NOT
228
+ return an animated thumbnail.
229
+
230
+ Servers SHOULD prefer to return `image/webp` thumbnails when supporting animation.
231
+
232
+ When `true` and the media cannot be animated, such as in the case of a JPEG or PDF, the
233
+ server SHOULD behave as though `animated` is `false`.
234
+ example: false
235
+ schema:
236
+ type: boolean
237
+ responses:
238
+ "200":
239
+ description: A thumbnail of the requested content.
240
+ headers:
241
+ Content-Disposition:
242
+ x-addedInMatrixVersion: "1.12"
243
+ description: |
244
+ The [disposition](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition)
245
+ of the returned content. MUST be `inline`, and SHOULD contain a file name (e.g. `thumbnail.png`).
246
+
247
+ Servers should note the [Content-Type restrictions for serving inline content](/client-server-api/#serving-inline-content),
248
+ as these limitations imply which formats should be used for thumbnail generation.
249
+ required: true
250
+ schema:
251
+ type: string
252
+ example: "inline; filename=\"thumbnail.png\""
253
+ Content-Type:
254
+ x-changedInMatrixVersion:
255
+ "1.12": |
256
+ This header became required in order to support `Content-Disposition`.
257
+ description: The content type of the thumbnail.
258
+ required: true
259
+ schema:
260
+ type: string
261
+ enum:
262
+ - image/jpeg
263
+ - image/png
264
+ - image/apng
265
+ - image/gif
266
+ - image/webp
267
+ content:
268
+ image/jpeg:
269
+ schema:
270
+ # This is a workaround for us not being able to say the response is required.
271
+ description: "**Required.** The bytes for the thumbnail."
272
+ image/png:
273
+ schema:
274
+ x-changedInMatrixVersion:
275
+ "1.11": The PNG may be of the APNG variety if animation is supported and requested.
276
+ description: |
277
+ **Required.** The bytes for the thumbnail. The thumbnail MAY use an animated
278
+ format if `animated=true`.
279
+ image/apng:
280
+ schema:
281
+ x-addedInMatrixVersion: "1.11"
282
+ description: "**Required.** The bytes for the *animated* thumbnail."
283
+ image/gif:
284
+ schema:
285
+ x-addedInMatrixVersion: "1.11"
286
+ description: "**Required.** The bytes for the *animated* thumbnail."
287
+ image/webp:
288
+ schema:
289
+ x-addedInMatrixVersion: "1.11"
290
+ description: "**Required.** The bytes for the *animated* thumbnail."
291
+ "307":
292
+ $ref: '#/components/responses/thumbnailRedirect'
293
+ "308":
294
+ $ref: '#/components/responses/thumbnailRedirect'
295
+ "400":
296
+ description: |-
297
+ The request does not make sense to the server, or the server cannot thumbnail
298
+ the content. For example, the client requested non-integer dimensions or asked
299
+ for negatively-sized images.
300
+ content:
301
+ application/json:
302
+ schema:
303
+ $ref: definitions/errors/error.yaml
304
+ examples:
305
+ response:
306
+ value: {
307
+ "errcode": "M_UNKNOWN",
308
+ "error": "Cannot generate thumbnails for the requested content"
309
+ }
310
+ "413":
311
+ description: The local content is too large for the server to thumbnail.
312
+ content:
313
+ application/json:
314
+ schema:
315
+ $ref: definitions/errors/error.yaml
316
+ examples:
317
+ response:
318
+ value: {
319
+ "errcode": "M_TOO_LARGE",
320
+ "error": "Content is too large to thumbnail"
321
+ }
322
+ "429":
323
+ $ref: '#/components/responses/rateLimited'
324
+ "502":
325
+ description: The remote content is too large for the server to thumbnail.
326
+ content:
327
+ application/json:
328
+ schema:
329
+ $ref: definitions/errors/error.yaml
330
+ examples:
331
+ response:
332
+ value: {
333
+ "errcode": "M_TOO_LARGE",
334
+ "error": "Content is too large to thumbnail"
335
+ }
336
+ "504":
337
+ $ref: '#/components/responses/notYetUploaded'
338
+ tags:
339
+ - Media
340
+ /media/preview_url:
341
+ get:
342
+ x-addedInMatrixVersion: "1.11"
343
+ summary: Get information about a URL for a client
344
+ description: |-
345
+ Get information about a URL for the client. Typically this is called when a
346
+ client sees a URL in a message and wants to render a preview for the user.
347
+
348
+ {{% boxes/note %}}
349
+ Clients should consider avoiding this endpoint for URLs posted in encrypted
350
+ rooms. Encrypted rooms often contain more sensitive information the users
351
+ do not want to share with the homeserver, and this can mean that the URLs
352
+ being shared should also not be shared with the homeserver.
353
+ {{% /boxes/note %}}
354
+ operationId: getUrlPreviewAuthed
355
+ security:
356
+ - accessTokenQuery: []
357
+ - accessTokenBearer: []
358
+ parameters:
359
+ - in: query
360
+ name: url
361
+ description: The URL to get a preview of.
362
+ required: true
363
+ example: https://matrix.org
364
+ schema:
365
+ type: string
366
+ format: uri
367
+ - in: query
368
+ name: ts
369
+ description: |-
370
+ The preferred point in time to return a preview for. The server may
371
+ return a newer version if it does not have the requested version
372
+ available.
373
+ example: 1510610716656
374
+ schema:
375
+ type: integer
376
+ format: int64
377
+ responses:
378
+ "200":
379
+ description: |-
380
+ The OpenGraph data for the URL, which may be empty. Some values are
381
+ replaced with matrix equivalents if they are provided in the response.
382
+ The differences from the [OpenGraph protocol](https://ogp.me/) are
383
+ described here.
384
+ content:
385
+ application/json:
386
+ schema:
387
+ type: object
388
+ properties:
389
+ matrix:image:size:
390
+ type: integer
391
+ format: int64
392
+ description: The byte-size of the image. Omitted if there is no image attached.
393
+ og:image:
394
+ type: string
395
+ format: uri
396
+ description: An [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris) to
397
+ the image. Omitted if there is no image.
398
+ additionalProperties:
399
+ description: |-
400
+ Additional properties as per the [OpenGraph](https://ogp.me/) protocol.
401
+ examples:
402
+ response:
403
+ value: {
404
+ "og:title": "Matrix Blog Post",
405
+ "og:description": "This is a really cool blog post from matrix.org",
406
+ "og:image": "mxc://example.com/ascERGshawAWawugaAcauga",
407
+ "og:image:type": "image/png",
408
+ "og:image:height": 48,
409
+ "og:image:width": 48,
410
+ "matrix:image:size": 102400
411
+ }
412
+ "429":
413
+ $ref: '#/components/responses/rateLimited'
414
+ tags:
415
+ - Media
416
+ /media/config:
417
+ get:
418
+ x-addedInMatrixVersion: "1.11"
419
+ summary: Get the configuration for the content repository.
420
+ description: |-
421
+ This endpoint allows clients to retrieve the configuration of the content
422
+ repository, such as upload limitations.
423
+ Clients SHOULD use this as a guide when using content repository endpoints.
424
+ All values are intentionally left optional. Clients SHOULD follow
425
+ the advice given in the field description when the field is not available.
426
+
427
+ {{% boxes/note %}}
428
+ Both clients and server administrators should be aware that proxies
429
+ between the client and the server may affect the apparent behaviour of content
430
+ repository APIs, for example, proxies may enforce a lower upload size limit
431
+ than is advertised by the server on this endpoint.
432
+ {{% /boxes/note %}}
433
+ operationId: getConfigAuthed
434
+ security:
435
+ - accessTokenQuery: []
436
+ - accessTokenBearer: []
437
+ responses:
438
+ "200":
439
+ description: The public content repository configuration for the matrix server.
440
+ content:
441
+ application/json:
442
+ schema:
443
+ type: object
444
+ properties:
445
+ m.upload.size:
446
+ type: integer
447
+ format: int64
448
+ description: |-
449
+ The maximum size an upload can be in bytes.
450
+ Clients SHOULD use this as a guide when uploading content.
451
+ If not listed or null, the size limit should be treated as unknown.
452
+ examples:
453
+ response:
454
+ value: {
455
+ "m.upload.size": 50000000
456
+ }
457
+ "429":
458
+ $ref: '#/components/responses/rateLimited'
459
+ tags:
460
+ - Media
461
+ servers:
462
+ - url: "{protocol}://{hostname}{basePath}"
463
+ variables:
464
+ protocol:
465
+ enum:
466
+ - http
467
+ - https
468
+ default: https
469
+ hostname:
470
+ default: localhost:8008
471
+ basePath:
472
+ default: /_matrix/client/v1
473
+ components:
474
+ securitySchemes:
475
+ accessTokenQuery:
476
+ $ref: definitions/security.yaml#/accessTokenQuery
477
+ accessTokenBearer:
478
+ $ref: definitions/security.yaml#/accessTokenBearer
479
+ parameters:
480
+ serverName:
481
+ in: path
482
+ name: serverName
483
+ required: true
484
+ description: |
485
+ The server name from the `mxc://` URI (the authority component).
486
+ example: matrix.org
487
+ schema:
488
+ type: string
489
+ format: mx-server-name
490
+ mediaId:
491
+ in: path
492
+ name: mediaId
493
+ required: true
494
+ description: |
495
+ The media ID from the `mxc://` URI (the path component).
496
+ example: ascERGshawAWawugaAcauga
497
+ schema:
498
+ type: string
499
+ timeout_ms:
500
+ in: query
501
+ name: timeout_ms
502
+ x-addedInMatrixVersion: "1.7"
503
+ description: |
504
+ The maximum number of milliseconds that the client is willing to wait to
505
+ start receiving data, in the case that the content has not yet been
506
+ uploaded. The default value is 20000 (20 seconds). The content
507
+ repository SHOULD impose a maximum value for this parameter. The
508
+ content repository MAY respond before the timeout.
509
+ example: 5000
510
+ schema:
511
+ type: integer
512
+ format: int64
513
+ default: 20000
514
+ responses:
515
+ rateLimited:
516
+ description: This request was rate-limited.
517
+ content:
518
+ application/json:
519
+ schema:
520
+ $ref: definitions/errors/rate_limited.yaml
521
+ notYetUploaded:
522
+ description: |-
523
+ The content is not yet available. A [standard error response](/client-server-api/#standard-error-response)
524
+ will be returned with the `errcode` `M_NOT_YET_UPLOADED`.
525
+ content:
526
+ application/json:
527
+ schema:
528
+ $ref: definitions/errors/error.yaml
529
+ examples:
530
+ response:
531
+ value: {
532
+ "errcode": "M_NOT_YET_UPLOADED",
533
+ "error": "Content has not yet been uploaded"
534
+ }
535
+ downloadRedirect:
536
+ description: A redirect to the requested content.
537
+ headers:
538
+ Location:
539
+ description: The URL of the content.
540
+ schema:
541
+ type: string
542
+ format: uri
543
+ downloadTooLarge:
544
+ description: The content is too large for the server to serve.
545
+ content:
546
+ application/json:
547
+ schema:
548
+ $ref: definitions/errors/error.yaml
549
+ examples:
550
+ response:
551
+ value: {
552
+ "errcode": "M_TOO_LARGE",
553
+ "error": "Content is too large to serve"
554
+ }
555
+ thumbnailRedirect:
556
+ description: A redirect to the thumbnail of the requested content.
557
+ headers:
558
+ Location:
559
+ description: The URL of the thumbnail content.
560
+ schema:
561
+ type: string
562
+ format: uri
563
+ headers:
564
+ downloadContentType:
565
+ description: |
566
+ The content type of the file that was previously uploaded.
567
+
568
+ The server MUST return a `Content-Type` which is either exactly the same
569
+ as the original upload, or reasonably close. The bounds of "reasonable"
570
+ are:
571
+
572
+ * Adding a charset to `text/*` content types.
573
+ * Detecting HTML and using `text/html` instead of `text/plain`.
574
+ * Using `application/octet-stream` when the server determines the
575
+ content type is obviously wrong. For example, an encrypted file being
576
+ claimed as `image/png`.
577
+ * Returning `application/octet-stream` when the media has an
578
+ unknown/unprovided `Content-Type`. For example, being uploaded before
579
+ the server tracked content types or when the remote server is
580
+ non-compliantly omitting the header entirely.
581
+
582
+ Actions not in the spirit of the above are not considered "reasonable".
583
+ x-changedInMatrixVersion:
584
+ "1.12": |
585
+ This header became required in order to support `Content-Disposition`,
586
+ and the behaviour to compute its value was clarified.
587
+ required: true
588
+ schema:
589
+ type: string
590
+