async-matrix 0.1.3 → 1.1.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 (365) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +131 -0
  3. data/data/discord-api-spec/openapi.json +40404 -0
  4. data/data/matrix-spec/api/client-server/account-data.yaml +389 -0
  5. data/data/matrix-spec/api/client-server/account_deactivation.yaml +149 -0
  6. data/data/matrix-spec/api/client-server/admin.yaml +512 -0
  7. data/data/matrix-spec/api/client-server/administrative_contact.yaml +620 -0
  8. data/data/matrix-spec/api/client-server/appservice_ping.yaml +183 -0
  9. data/data/matrix-spec/api/client-server/appservice_room_directory.yaml +104 -0
  10. data/data/matrix-spec/api/client-server/authed-content-repo.yaml +590 -0
  11. data/data/matrix-spec/api/client-server/banning.yaml +177 -0
  12. data/data/matrix-spec/api/client-server/capabilities.yaml +235 -0
  13. data/data/matrix-spec/api/client-server/content-repo.yaml +887 -0
  14. data/data/matrix-spec/api/client-server/create_room.yaml +306 -0
  15. data/data/matrix-spec/api/client-server/cross_signing.yaml +300 -0
  16. data/data/matrix-spec/api/client-server/definitions/auth_data.yaml +34 -0
  17. data/data/matrix-spec/api/client-server/definitions/auth_response.yaml +62 -0
  18. data/data/matrix-spec/api/client-server/definitions/client_device.yaml +44 -0
  19. data/data/matrix-spec/api/client-server/definitions/client_event.yaml +49 -0
  20. data/data/matrix-spec/api/client-server/definitions/client_event_without_room_id.yaml +147 -0
  21. data/data/matrix-spec/api/client-server/definitions/cross_signing_key.yaml +57 -0
  22. data/data/matrix-spec/api/client-server/definitions/device_keys.yaml +70 -0
  23. data/data/matrix-spec/api/client-server/definitions/errors/error.yaml +26 -0
  24. data/data/matrix-spec/api/client-server/definitions/errors/rate_limited.yaml +34 -0
  25. data/data/matrix-spec/api/client-server/definitions/event_batch.yaml +22 -0
  26. data/data/matrix-spec/api/client-server/definitions/event_filter.yaml +55 -0
  27. data/data/matrix-spec/api/client-server/definitions/invite_3pid.yaml +45 -0
  28. data/data/matrix-spec/api/client-server/definitions/key_backup_auth_data.yaml +36 -0
  29. data/data/matrix-spec/api/client-server/definitions/key_backup_data.yaml +50 -0
  30. data/data/matrix-spec/api/client-server/definitions/key_backup_session_data.yaml +57 -0
  31. data/data/matrix-spec/api/client-server/definitions/m.login.terms_params.yaml +83 -0
  32. data/data/matrix-spec/api/client-server/definitions/m.mentions.yaml +33 -0
  33. data/data/matrix-spec/api/client-server/definitions/m.oauth_params.yaml +30 -0
  34. data/data/matrix-spec/api/client-server/definitions/m.relates_to.yaml +45 -0
  35. data/data/matrix-spec/api/client-server/definitions/megolm_export_session_data.yaml +39 -0
  36. data/data/matrix-spec/api/client-server/definitions/olm_payload.yaml +88 -0
  37. data/data/matrix-spec/api/client-server/definitions/one_time_keys.yaml +27 -0
  38. data/data/matrix-spec/api/client-server/definitions/openid_token.yaml +37 -0
  39. data/data/matrix-spec/api/client-server/definitions/protocol.yaml +44 -0
  40. data/data/matrix-spec/api/client-server/definitions/public_rooms_chunk.yaml +74 -0
  41. data/data/matrix-spec/api/client-server/definitions/public_rooms_response.yaml +59 -0
  42. data/data/matrix-spec/api/client-server/definitions/push_condition.yaml +53 -0
  43. data/data/matrix-spec/api/client-server/definitions/push_rule.yaml +53 -0
  44. data/data/matrix-spec/api/client-server/definitions/push_ruleset.yaml +206 -0
  45. data/data/matrix-spec/api/client-server/definitions/recent_emoji.yaml +29 -0
  46. data/data/matrix-spec/api/client-server/definitions/request_email_validation.yaml +36 -0
  47. data/data/matrix-spec/api/client-server/definitions/request_msisdn_validation.yaml +36 -0
  48. data/data/matrix-spec/api/client-server/definitions/request_token_response.yaml +46 -0
  49. data/data/matrix-spec/api/client-server/definitions/room_event_filter.yaml +60 -0
  50. data/data/matrix-spec/api/client-server/definitions/room_key_backup.yaml +37 -0
  51. data/data/matrix-spec/api/client-server/definitions/room_summary.yaml +44 -0
  52. data/data/matrix-spec/api/client-server/definitions/security.yaml +47 -0
  53. data/data/matrix-spec/api/client-server/definitions/sso_login_flow.yaml +98 -0
  54. data/data/matrix-spec/api/client-server/definitions/state_event_batch.yaml +21 -0
  55. data/data/matrix-spec/api/client-server/definitions/sync_filter.yaml +86 -0
  56. data/data/matrix-spec/api/client-server/definitions/tag.yaml +24 -0
  57. data/data/matrix-spec/api/client-server/definitions/third_party_signed.yaml +45 -0
  58. data/data/matrix-spec/api/client-server/definitions/timeline_batch.yaml +36 -0
  59. data/data/matrix-spec/api/client-server/definitions/user_identifier.yaml +27 -0
  60. data/data/matrix-spec/api/client-server/definitions/wellknown/full.yaml +38 -0
  61. data/data/matrix-spec/api/client-server/definitions/wellknown/homeserver.yaml +25 -0
  62. data/data/matrix-spec/api/client-server/definitions/wellknown/identity_server.yaml +25 -0
  63. data/data/matrix-spec/api/client-server/device_management.yaml +314 -0
  64. data/data/matrix-spec/api/client-server/directory.yaml +318 -0
  65. data/data/matrix-spec/api/client-server/event_context.yaml +161 -0
  66. data/data/matrix-spec/api/client-server/filter.yaml +224 -0
  67. data/data/matrix-spec/api/client-server/inviting.yaml +149 -0
  68. data/data/matrix-spec/api/client-server/joining.yaml +238 -0
  69. data/data/matrix-spec/api/client-server/key_backup.yaml +993 -0
  70. data/data/matrix-spec/api/client-server/keys.yaml +482 -0
  71. data/data/matrix-spec/api/client-server/kicking.yaml +110 -0
  72. data/data/matrix-spec/api/client-server/knocking.yaml +152 -0
  73. data/data/matrix-spec/api/client-server/leaving.yaml +163 -0
  74. data/data/matrix-spec/api/client-server/list_joined_rooms.yaml +68 -0
  75. data/data/matrix-spec/api/client-server/list_public_rooms.yaml +280 -0
  76. data/data/matrix-spec/api/client-server/login.yaml +321 -0
  77. data/data/matrix-spec/api/client-server/login_token.yaml +138 -0
  78. data/data/matrix-spec/api/client-server/logout.yaml +86 -0
  79. data/data/matrix-spec/api/client-server/message_pagination.yaml +194 -0
  80. data/data/matrix-spec/api/client-server/notifications.yaml +152 -0
  81. data/data/matrix-spec/api/client-server/oauth_server_metadata.yaml +238 -0
  82. data/data/matrix-spec/api/client-server/old_sync.yaml +379 -0
  83. data/data/matrix-spec/api/client-server/openid.yaml +98 -0
  84. data/data/matrix-spec/api/client-server/password_management.yaml +246 -0
  85. data/data/matrix-spec/api/client-server/peeking_events.yaml +122 -0
  86. data/data/matrix-spec/api/client-server/policy_server.yaml +82 -0
  87. data/data/matrix-spec/api/client-server/presence.yaml +169 -0
  88. data/data/matrix-spec/api/client-server/profile.yaml +366 -0
  89. data/data/matrix-spec/api/client-server/pusher.yaml +303 -0
  90. data/data/matrix-spec/api/client-server/pushrules.yaml +633 -0
  91. data/data/matrix-spec/api/client-server/read_markers.yaml +103 -0
  92. data/data/matrix-spec/api/client-server/receipts.yaml +139 -0
  93. data/data/matrix-spec/api/client-server/redaction.yaml +116 -0
  94. data/data/matrix-spec/api/client-server/refresh.yaml +119 -0
  95. data/data/matrix-spec/api/client-server/registration.yaml +488 -0
  96. data/data/matrix-spec/api/client-server/registration_tokens.yaml +93 -0
  97. data/data/matrix-spec/api/client-server/relations.yaml +382 -0
  98. data/data/matrix-spec/api/client-server/report_content.yaml +283 -0
  99. data/data/matrix-spec/api/client-server/room_event_by_timestamp.yaml +147 -0
  100. data/data/matrix-spec/api/client-server/room_initial_sync.yaml +188 -0
  101. data/data/matrix-spec/api/client-server/room_send.yaml +130 -0
  102. data/data/matrix-spec/api/client-server/room_state.yaml +159 -0
  103. data/data/matrix-spec/api/client-server/room_summary.yaml +138 -0
  104. data/data/matrix-spec/api/client-server/room_upgrades.yaml +130 -0
  105. data/data/matrix-spec/api/client-server/rooms.yaml +380 -0
  106. data/data/matrix-spec/api/client-server/search.yaml +385 -0
  107. data/data/matrix-spec/api/client-server/space_hierarchy.yaml +237 -0
  108. data/data/matrix-spec/api/client-server/sso_login_redirect.yaml +135 -0
  109. data/data/matrix-spec/api/client-server/support.yaml +142 -0
  110. data/data/matrix-spec/api/client-server/sync.yaml +692 -0
  111. data/data/matrix-spec/api/client-server/tags.yaml +183 -0
  112. data/data/matrix-spec/api/client-server/third_party_lookup.yaml +324 -0
  113. data/data/matrix-spec/api/client-server/third_party_membership.yaml +139 -0
  114. data/data/matrix-spec/api/client-server/threads_list.yaml +167 -0
  115. data/data/matrix-spec/api/client-server/to_device.yaml +104 -0
  116. data/data/matrix-spec/api/client-server/typing.yaml +103 -0
  117. data/data/matrix-spec/api/client-server/users.yaml +136 -0
  118. data/data/matrix-spec/api/client-server/versions.yaml +108 -0
  119. data/data/matrix-spec/api/client-server/voip.yaml +93 -0
  120. data/data/matrix-spec/api/client-server/wellknown.yaml +60 -0
  121. data/data/matrix-spec/api/client-server/whoami.yaml +121 -0
  122. data/data/matrix-spec/event-schemas/examples/core/event.json +6 -0
  123. data/data/matrix-spec/event-schemas/examples/core/room_edu.json +3 -0
  124. data/data/matrix-spec/event-schemas/examples/core/room_event.json +11 -0
  125. data/data/matrix-spec/event-schemas/examples/core/state_event.json +4 -0
  126. data/data/matrix-spec/event-schemas/examples/invite_room_state.json +18 -0
  127. data/data/matrix-spec/event-schemas/examples/knock_room_state.json +18 -0
  128. data/data/matrix-spec/event-schemas/examples/m.accepted_terms.yaml +10 -0
  129. data/data/matrix-spec/event-schemas/examples/m.call.answer.yaml +21 -0
  130. data/data/matrix-spec/event-schemas/examples/m.call.candidates.yaml +16 -0
  131. data/data/matrix-spec/event-schemas/examples/m.call.hangup.yaml +10 -0
  132. data/data/matrix-spec/event-schemas/examples/m.call.invite.yaml +22 -0
  133. data/data/matrix-spec/event-schemas/examples/m.call.negotiate.yaml +22 -0
  134. data/data/matrix-spec/event-schemas/examples/m.call.reject.yaml +9 -0
  135. data/data/matrix-spec/event-schemas/examples/m.call.sdp_stream_metadata_changed.yaml +16 -0
  136. data/data/matrix-spec/event-schemas/examples/m.call.select_answer.yaml +10 -0
  137. data/data/matrix-spec/event-schemas/examples/m.direct.yaml +10 -0
  138. data/data/matrix-spec/event-schemas/examples/m.dummy.yaml +4 -0
  139. data/data/matrix-spec/event-schemas/examples/m.forwarded_room_key.yaml +14 -0
  140. data/data/matrix-spec/event-schemas/examples/m.fully_read.yaml +7 -0
  141. data/data/matrix-spec/event-schemas/examples/m.identity_server.yaml +7 -0
  142. data/data/matrix-spec/event-schemas/examples/m.ignored_user_list.yaml +9 -0
  143. data/data/matrix-spec/event-schemas/examples/m.invite_permission_config.yaml +7 -0
  144. data/data/matrix-spec/event-schemas/examples/m.key.verification.accept.yaml +12 -0
  145. data/data/matrix-spec/event-schemas/examples/m.key.verification.cancel.yaml +8 -0
  146. data/data/matrix-spec/event-schemas/examples/m.key.verification.done.yaml +6 -0
  147. data/data/matrix-spec/event-schemas/examples/m.key.verification.key.yaml +7 -0
  148. data/data/matrix-spec/event-schemas/examples/m.key.verification.mac.yaml +10 -0
  149. data/data/matrix-spec/event-schemas/examples/m.key.verification.ready.yaml +10 -0
  150. data/data/matrix-spec/event-schemas/examples/m.key.verification.request.yaml +11 -0
  151. data/data/matrix-spec/event-schemas/examples/m.key.verification.start$m.sas.v1.yaml +12 -0
  152. data/data/matrix-spec/event-schemas/examples/m.key.verification.start.yaml +8 -0
  153. data/data/matrix-spec/event-schemas/examples/m.key_backup.yaml +7 -0
  154. data/data/matrix-spec/event-schemas/examples/m.marked_unread.yaml +7 -0
  155. data/data/matrix-spec/event-schemas/examples/m.policy.rule.room.yaml +10 -0
  156. data/data/matrix-spec/event-schemas/examples/m.policy.rule.server.yaml +10 -0
  157. data/data/matrix-spec/event-schemas/examples/m.policy.rule.user.yaml +10 -0
  158. data/data/matrix-spec/event-schemas/examples/m.presence.yaml +12 -0
  159. data/data/matrix-spec/event-schemas/examples/m.push_rules.yaml +177 -0
  160. data/data/matrix-spec/event-schemas/examples/m.reaction.yaml +11 -0
  161. data/data/matrix-spec/event-schemas/examples/m.receipt.yaml +18 -0
  162. data/data/matrix-spec/event-schemas/examples/m.recent_emoji.yaml +16 -0
  163. data/data/matrix-spec/event-schemas/examples/m.room.avatar.yaml +14 -0
  164. data/data/matrix-spec/event-schemas/examples/m.room.canonical_alias.yaml +12 -0
  165. data/data/matrix-spec/event-schemas/examples/m.room.create.yaml +13 -0
  166. data/data/matrix-spec/event-schemas/examples/m.room.encrypted$megolm.yaml +11 -0
  167. data/data/matrix-spec/event-schemas/examples/m.room.encrypted$olm.yaml +14 -0
  168. data/data/matrix-spec/event-schemas/examples/m.room.encryption.yaml +10 -0
  169. data/data/matrix-spec/event-schemas/examples/m.room.guest_access.yaml +8 -0
  170. data/data/matrix-spec/event-schemas/examples/m.room.history_visibility.yaml +8 -0
  171. data/data/matrix-spec/event-schemas/examples/m.room.join_rules$restricted.yaml +18 -0
  172. data/data/matrix-spec/event-schemas/examples/m.room.join_rules.yaml +8 -0
  173. data/data/matrix-spec/event-schemas/examples/m.room.member$invite_room_state.yaml +15 -0
  174. data/data/matrix-spec/event-schemas/examples/m.room.member$join_authorised_via_users_server.yaml +12 -0
  175. data/data/matrix-spec/event-schemas/examples/m.room.member$knock_room_state.yaml +15 -0
  176. data/data/matrix-spec/event-schemas/examples/m.room.member$third_party_invite.yaml +20 -0
  177. data/data/matrix-spec/event-schemas/examples/m.room.member.yaml +12 -0
  178. data/data/matrix-spec/event-schemas/examples/m.room.message$m.audio.yaml +14 -0
  179. data/data/matrix-spec/event-schemas/examples/m.room.message$m.emote.yaml +10 -0
  180. data/data/matrix-spec/event-schemas/examples/m.room.message$m.file.yaml +14 -0
  181. data/data/matrix-spec/event-schemas/examples/m.room.message$m.image.yaml +16 -0
  182. data/data/matrix-spec/event-schemas/examples/m.room.message$m.key.verification.request.yaml +19 -0
  183. data/data/matrix-spec/event-schemas/examples/m.room.message$m.location.yaml +18 -0
  184. data/data/matrix-spec/event-schemas/examples/m.room.message$m.notice.yaml +10 -0
  185. data/data/matrix-spec/event-schemas/examples/m.room.message$m.server_notice.yaml +11 -0
  186. data/data/matrix-spec/event-schemas/examples/m.room.message$m.text.yaml +10 -0
  187. data/data/matrix-spec/event-schemas/examples/m.room.message$m.video.yaml +23 -0
  188. data/data/matrix-spec/event-schemas/examples/m.room.name.yaml +8 -0
  189. data/data/matrix-spec/event-schemas/examples/m.room.pinned_events.yaml +8 -0
  190. data/data/matrix-spec/event-schemas/examples/m.room.policy.yaml +11 -0
  191. data/data/matrix-spec/event-schemas/examples/m.room.power_levels.yaml +24 -0
  192. data/data/matrix-spec/event-schemas/examples/m.room.redaction.yaml +8 -0
  193. data/data/matrix-spec/event-schemas/examples/m.room.server_acl.yaml +10 -0
  194. data/data/matrix-spec/event-schemas/examples/m.room.third_party_invite.yaml +14 -0
  195. data/data/matrix-spec/event-schemas/examples/m.room.tombstone.yaml +9 -0
  196. data/data/matrix-spec/event-schemas/examples/m.room.topic.yaml +16 -0
  197. data/data/matrix-spec/event-schemas/examples/m.room_key.withheld.yaml +12 -0
  198. data/data/matrix-spec/event-schemas/examples/m.room_key.yaml +10 -0
  199. data/data/matrix-spec/event-schemas/examples/m.room_key_request$cancel_request.yaml +8 -0
  200. data/data/matrix-spec/event-schemas/examples/m.room_key_request$request.yaml +14 -0
  201. data/data/matrix-spec/event-schemas/examples/m.secret.request.yaml +9 -0
  202. data/data/matrix-spec/event-schemas/examples/m.secret.send.yaml +7 -0
  203. data/data/matrix-spec/event-schemas/examples/m.space.child.yaml +10 -0
  204. data/data/matrix-spec/event-schemas/examples/m.space.parent.yaml +9 -0
  205. data/data/matrix-spec/event-schemas/examples/m.sticker.yaml +22 -0
  206. data/data/matrix-spec/event-schemas/examples/m.tag.yaml +9 -0
  207. data/data/matrix-spec/event-schemas/examples/m.typing.yaml +7 -0
  208. data/data/matrix-spec/event-schemas/moderation_policy_rule.yaml +32 -0
  209. data/data/matrix-spec/event-schemas/schema/components/m_text_content_block.yaml +28 -0
  210. data/data/matrix-spec/event-schemas/schema/components/sdp_stream_metadata.yaml +43 -0
  211. data/data/matrix-spec/event-schemas/schema/components/signed_third_party_invite.yaml +48 -0
  212. data/data/matrix-spec/event-schemas/schema/core-event-schema/call_event.yaml +27 -0
  213. data/data/matrix-spec/event-schemas/schema/core-event-schema/event.yaml +16 -0
  214. data/data/matrix-spec/event-schemas/schema/core-event-schema/msgtype_infos/avatar_info.yaml +30 -0
  215. data/data/matrix-spec/event-schemas/schema/core-event-schema/msgtype_infos/image_info.yaml +52 -0
  216. data/data/matrix-spec/event-schemas/schema/core-event-schema/msgtype_infos/thumbnail_info.yaml +22 -0
  217. data/data/matrix-spec/event-schemas/schema/core-event-schema/room_event.yaml +17 -0
  218. data/data/matrix-spec/event-schemas/schema/core-event-schema/state_event.yaml +8 -0
  219. data/data/matrix-spec/event-schemas/schema/core-event-schema/stripped_state.yaml +48 -0
  220. data/data/matrix-spec/event-schemas/schema/core-event-schema/sync_room_event.yaml +49 -0
  221. data/data/matrix-spec/event-schemas/schema/core-event-schema/sync_state_event.yaml +36 -0
  222. data/data/matrix-spec/event-schemas/schema/core-event-schema/unsigned_prop.yaml +23 -0
  223. data/data/matrix-spec/event-schemas/schema/m.accepted_terms.yaml +25 -0
  224. data/data/matrix-spec/event-schemas/schema/m.call.answer.yaml +44 -0
  225. data/data/matrix-spec/event-schemas/schema/m.call.candidates.yaml +52 -0
  226. data/data/matrix-spec/event-schemas/schema/m.call.hangup.yaml +57 -0
  227. data/data/matrix-spec/event-schemas/schema/m.call.invite.yaml +53 -0
  228. data/data/matrix-spec/event-schemas/schema/m.call.negotiate.yaml +78 -0
  229. data/data/matrix-spec/event-schemas/schema/m.call.reject.yaml +29 -0
  230. data/data/matrix-spec/event-schemas/schema/m.call.sdp_stream_metadata_changed.yaml +24 -0
  231. data/data/matrix-spec/event-schemas/schema/m.call.select_answer.yaml +29 -0
  232. data/data/matrix-spec/event-schemas/schema/m.direct.yaml +29 -0
  233. data/data/matrix-spec/event-schemas/schema/m.dummy.yaml +25 -0
  234. data/data/matrix-spec/event-schemas/schema/m.forwarded_room_key.yaml +70 -0
  235. data/data/matrix-spec/event-schemas/schema/m.fully_read.yaml +26 -0
  236. data/data/matrix-spec/event-schemas/schema/m.identity_server.yaml +28 -0
  237. data/data/matrix-spec/event-schemas/schema/m.ignored_user_list.yaml +30 -0
  238. data/data/matrix-spec/event-schemas/schema/m.invite_permission_config.yaml +21 -0
  239. data/data/matrix-spec/event-schemas/schema/m.key.verification.accept.yaml +63 -0
  240. data/data/matrix-spec/event-schemas/schema/m.key.verification.cancel.yaml +72 -0
  241. data/data/matrix-spec/event-schemas/schema/m.key.verification.done.yaml +24 -0
  242. data/data/matrix-spec/event-schemas/schema/m.key.verification.key.yaml +31 -0
  243. data/data/matrix-spec/event-schemas/schema/m.key.verification.m.relates_to.yaml +23 -0
  244. data/data/matrix-spec/event-schemas/schema/m.key.verification.mac.yaml +43 -0
  245. data/data/matrix-spec/event-schemas/schema/m.key.verification.ready.yaml +41 -0
  246. data/data/matrix-spec/event-schemas/schema/m.key.verification.request.yaml +47 -0
  247. data/data/matrix-spec/event-schemas/schema/m.key.verification.start$m.reciprocate.v1.yaml +45 -0
  248. data/data/matrix-spec/event-schemas/schema/m.key.verification.start$m.sas.v1.yaml +76 -0
  249. data/data/matrix-spec/event-schemas/schema/m.key.verification.start.yaml +46 -0
  250. data/data/matrix-spec/event-schemas/schema/m.key_backup.yaml +24 -0
  251. data/data/matrix-spec/event-schemas/schema/m.marked_unread.yaml +26 -0
  252. data/data/matrix-spec/event-schemas/schema/m.policy.rule.room.yaml +17 -0
  253. data/data/matrix-spec/event-schemas/schema/m.policy.rule.server.yaml +17 -0
  254. data/data/matrix-spec/event-schemas/schema/m.policy.rule.user.yaml +17 -0
  255. data/data/matrix-spec/event-schemas/schema/m.presence.yaml +50 -0
  256. data/data/matrix-spec/event-schemas/schema/m.push_rules.yaml +23 -0
  257. data/data/matrix-spec/event-schemas/schema/m.reaction.yaml +45 -0
  258. data/data/matrix-spec/event-schemas/schema/m.receipt.yaml +65 -0
  259. data/data/matrix-spec/event-schemas/schema/m.recent_emoji.yaml +29 -0
  260. data/data/matrix-spec/event-schemas/schema/m.room.avatar.yaml +29 -0
  261. data/data/matrix-spec/event-schemas/schema/m.room.canonical_alias.yaml +40 -0
  262. data/data/matrix-spec/event-schemas/schema/m.room.create.yaml +86 -0
  263. data/data/matrix-spec/event-schemas/schema/m.room.encrypted.yaml +91 -0
  264. data/data/matrix-spec/event-schemas/schema/m.room.encryption.yaml +38 -0
  265. data/data/matrix-spec/event-schemas/schema/m.room.guest_access.yaml +28 -0
  266. data/data/matrix-spec/event-schemas/schema/m.room.history_visibility.yaml +30 -0
  267. data/data/matrix-spec/event-schemas/schema/m.room.join_rules.yaml +78 -0
  268. data/data/matrix-spec/event-schemas/schema/m.room.member.yaml +174 -0
  269. data/data/matrix-spec/event-schemas/schema/m.room.message$m.audio.yaml +73 -0
  270. data/data/matrix-spec/event-schemas/schema/m.room.message$m.emote.yaml +36 -0
  271. data/data/matrix-spec/event-schemas/schema/m.room.message$m.file.yaml +85 -0
  272. data/data/matrix-spec/event-schemas/schema/m.room.message$m.image.yaml +63 -0
  273. data/data/matrix-spec/event-schemas/schema/m.room.message$m.key.verification.request.yaml +70 -0
  274. data/data/matrix-spec/event-schemas/schema/m.room.message$m.location.yaml +50 -0
  275. data/data/matrix-spec/event-schemas/schema/m.room.message$m.notice.yaml +36 -0
  276. data/data/matrix-spec/event-schemas/schema/m.room.message$m.server_notice.yaml +41 -0
  277. data/data/matrix-spec/event-schemas/schema/m.room.message$m.text.yaml +36 -0
  278. data/data/matrix-spec/event-schemas/schema/m.room.message$m.video.yaml +95 -0
  279. data/data/matrix-spec/event-schemas/schema/m.room.message.yaml +25 -0
  280. data/data/matrix-spec/event-schemas/schema/m.room.name.yaml +35 -0
  281. data/data/matrix-spec/event-schemas/schema/m.room.pinned_events.yaml +27 -0
  282. data/data/matrix-spec/event-schemas/schema/m.room.policy.yaml +41 -0
  283. data/data/matrix-spec/event-schemas/schema/m.room.power_levels.yaml +139 -0
  284. data/data/matrix-spec/event-schemas/schema/m.room.redaction.yaml +29 -0
  285. data/data/matrix-spec/event-schemas/schema/m.room.server_acl.yaml +88 -0
  286. data/data/matrix-spec/event-schemas/schema/m.room.third_party_invite.yaml +79 -0
  287. data/data/matrix-spec/event-schemas/schema/m.room.tombstone.yaml +29 -0
  288. data/data/matrix-spec/event-schemas/schema/m.room.topic.yaml +53 -0
  289. data/data/matrix-spec/event-schemas/schema/m.room_key.withheld.yaml +88 -0
  290. data/data/matrix-spec/event-schemas/schema/m.room_key.yaml +38 -0
  291. data/data/matrix-spec/event-schemas/schema/m.room_key_request.yaml +73 -0
  292. data/data/matrix-spec/event-schemas/schema/m.secret.request.yaml +42 -0
  293. data/data/matrix-spec/event-schemas/schema/m.secret.send.yaml +35 -0
  294. data/data/matrix-spec/event-schemas/schema/m.space.child.yaml +50 -0
  295. data/data/matrix-spec/event-schemas/schema/m.space.parent.yaml +36 -0
  296. data/data/matrix-spec/event-schemas/schema/m.sticker.yaml +36 -0
  297. data/data/matrix-spec/event-schemas/schema/m.tag.yaml +28 -0
  298. data/data/matrix-spec/event-schemas/schema/m.typing.yaml +29 -0
  299. data/lib/async/discord/api/path_tree.rb +130 -0
  300. data/lib/async/discord/api.rb +156 -0
  301. data/lib/async/discord/client.rb +286 -0
  302. data/lib/async/discord/error.rb +88 -0
  303. data/lib/async/discord/gateway.rb +362 -0
  304. data/lib/async/discord.rb +16 -0
  305. data/lib/async/matrix/api/chain.rb +584 -0
  306. data/lib/async/matrix/api/concat.rb +105 -0
  307. data/lib/async/matrix/api/path_tree.rb +208 -0
  308. data/lib/async/matrix/api.rb +204 -0
  309. data/lib/async/matrix/application_service/bot.rb +235 -0
  310. data/lib/async/matrix/application_service/config/schema/analytics.json +21 -0
  311. data/lib/async/matrix/application_service/config/schema/appservice.json +82 -0
  312. data/lib/async/matrix/application_service/config/schema/backfill.json +91 -0
  313. data/lib/async/matrix/application_service/config/schema/bridge.json +209 -0
  314. data/lib/async/matrix/application_service/config/schema/config.json +61 -0
  315. data/lib/async/matrix/application_service/config/schema/database.json +38 -0
  316. data/lib/async/matrix/application_service/config/schema/direct_media.json +35 -0
  317. data/lib/async/matrix/application_service/config/schema/double_puppet.json +24 -0
  318. data/lib/async/matrix/application_service/config/schema/encryption.json +164 -0
  319. data/lib/async/matrix/application_service/config/schema/homeserver.json +58 -0
  320. data/lib/async/matrix/application_service/config/schema/logging.json +50 -0
  321. data/lib/async/matrix/application_service/config/schema/management_room_texts.json +25 -0
  322. data/lib/async/matrix/application_service/config/schema/matrix.json +45 -0
  323. data/lib/async/matrix/application_service/config/schema/permissions.json +54 -0
  324. data/lib/async/matrix/application_service/config/schema/provisioning.json +23 -0
  325. data/lib/async/matrix/application_service/config/schema/public_media.json +39 -0
  326. data/lib/async/matrix/application_service/config/schema/relay.json +43 -0
  327. data/lib/async/matrix/application_service/config/vivify.rb +113 -0
  328. data/lib/async/matrix/application_service/config.rb +214 -123
  329. data/lib/async/matrix/application_service/dispatcher.rb +115 -113
  330. data/lib/async/matrix/application_service/error_response.rb +26 -26
  331. data/lib/async/matrix/application_service/event.rb +206 -1
  332. data/lib/async/matrix/application_service/server.rb +286 -215
  333. data/lib/async/matrix/application_service/transaction.rb +52 -52
  334. data/lib/async/matrix/application_service/transaction_store.rb +62 -62
  335. data/lib/async/matrix/bridge/discord/db/connection.rb +143 -0
  336. data/lib/async/matrix/bridge/discord/db/file.rb +120 -0
  337. data/lib/async/matrix/bridge/discord/db/guild.rb +122 -0
  338. data/lib/async/matrix/bridge/discord/db/message.rb +162 -0
  339. data/lib/async/matrix/bridge/discord/db/migrations/001_create_users.rb +14 -0
  340. data/lib/async/matrix/bridge/discord/db/migrations/002_create_guilds.rb +14 -0
  341. data/lib/async/matrix/bridge/discord/db/migrations/003_create_portals.rb +23 -0
  342. data/lib/async/matrix/bridge/discord/db/migrations/004_create_puppets.rb +19 -0
  343. data/lib/async/matrix/bridge/discord/db/migrations/005_create_messages.rb +20 -0
  344. data/lib/async/matrix/bridge/discord/db/migrations/006_create_reactions.rb +19 -0
  345. data/lib/async/matrix/bridge/discord/db/migrations/007_create_files.rb +18 -0
  346. data/lib/async/matrix/bridge/discord/db/portal.rb +152 -0
  347. data/lib/async/matrix/bridge/discord/db/puppet.rb +130 -0
  348. data/lib/async/matrix/bridge/discord/db/reaction.rb +167 -0
  349. data/lib/async/matrix/bridge/discord/db/user.rb +114 -0
  350. data/lib/async/matrix/bridge/discord/db.rb +140 -0
  351. data/lib/async/matrix/client.rb +919 -179
  352. data/lib/async/matrix/connection.rb +8 -8
  353. data/lib/async/matrix/double_puppet_client.rb +84 -0
  354. data/lib/async/matrix/endpoint.rb +45 -45
  355. data/lib/async/matrix/error.rb +49 -43
  356. data/lib/async/matrix/media_client.rb +173 -0
  357. data/lib/async/matrix/notifier.rb +92 -92
  358. data/lib/async/matrix/schema/registry.rb +355 -0
  359. data/lib/async/matrix/schema/validation_error.rb +226 -0
  360. data/lib/async/matrix/schema.rb +174 -0
  361. data/lib/async/matrix/server.rb +8 -7
  362. data/lib/async/matrix/stream.rb +7 -7
  363. data/lib/async/matrix/version.rb +1 -1
  364. data/lib/async/matrix.rb +4 -2
  365. metadata +419 -1
@@ -0,0 +1,366 @@
1
+ # Copyright 2016 OpenMarket Ltd
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ openapi: 3.1.0
15
+ info:
16
+ title: Matrix Client-Server Profile API
17
+ version: 1.0.0
18
+ paths:
19
+ "/profile/{userId}/{keyName}":
20
+ put:
21
+ x-changedInMatrixVersion:
22
+ "1.16": This endpoint now accepts a variable `keyName` parameter and `m.tz` was added as a defined key. Previously only `displayname` and `avatar_url` were accepted.
23
+ summary: Set a profile field for a user.
24
+ description: |-
25
+ Set or update a profile field for a user. Must be authenticated with an
26
+ access token authorised to make changes. Servers MAY impose size limits
27
+ on individual fields, and the total profile MUST be under 64 KiB.
28
+
29
+ Servers MAY reject `null` values. Servers that accept `null` values SHOULD store
30
+ them rather than treating `null` as a deletion request. Clients that want to delete a
31
+ field, including its key and value, SHOULD use the `DELETE` endpoint instead.
32
+
33
+ This endpoint uses [capabilities negotiation](/client-server-api/#capabilities-negotiation)
34
+ depending on the `keyName`. Clients SHOULD check the value of the
35
+ [`m.profile_fields` capability](/client-server-api/#mprofile_fields-capability) to detect
36
+ which `keyName`s they are allowed to modify.
37
+ operationId: setProfileField
38
+ security:
39
+ - accessTokenQuery: []
40
+ - accessTokenBearer: []
41
+ parameters:
42
+ - in: path
43
+ name: userId
44
+ description: The user whose profile field should be set.
45
+ required: true
46
+ example: "@alice:example.com"
47
+ schema:
48
+ type: string
49
+ - in: path
50
+ name: keyName
51
+ description: The name of the profile field to set. This MUST be either
52
+ `avatar_url`, `displayname`, `m.tz`, or a custom field following the
53
+ [Common Namespaced Identifier Grammar](/appendices/#common-namespaced-identifier-grammar).
54
+ required: true
55
+ example: "displayname"
56
+ schema:
57
+ type: string
58
+ pattern: '^(avatar_url|displayname|m\.tz|[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)+)$'
59
+ requestBody:
60
+ description: A JSON object containing the property whose name matches
61
+ the `keyName` specified in the URL. See `additionalProperties` for
62
+ further details.
63
+ required: true
64
+ content:
65
+ application/json:
66
+ schema:
67
+ type: object
68
+ minProperties: 1
69
+ description: |
70
+ An object which contains exactly one property. The key
71
+ of that property MUST match the `keyName` specified in the URL.
72
+
73
+ For `avatar_url`, the value MUST be an MXC URI string.
74
+
75
+ For `displayname`, the value MUST be a string.
76
+
77
+ For `m.tz`, the value MUST be a valid identifier from the [IANA Time Zone Database](https://www.iana.org/time-zones).
78
+ Servers MAY choose to validate the value. Clients MUST expect unknown or invalid
79
+ values.
80
+
81
+ For custom keys, any JSON type is allowed. Servers MAY not validate
82
+ these values, but clients SHOULD follow the format defined for that key.
83
+ additionalProperties: true
84
+ example: { "displayname": "Alice Wonderland" }
85
+ responses:
86
+ "200":
87
+ description: The profile field was set.
88
+ content:
89
+ application/json:
90
+ schema:
91
+ type: object # empty JSON object
92
+ examples:
93
+ response:
94
+ value: {}
95
+ "400":
96
+ description: |
97
+ The input was invalid in some way. This can include one
98
+ of the following error codes:
99
+
100
+ - `M_BAD_JSON`: The provided value is not valid JSON.
101
+ - `M_MISSING_PARAM`: The required `keyName` property is
102
+ missing from the request body.
103
+ - `M_PROFILE_TOO_LARGE`: Storing the supplied value would
104
+ make the profile exceed its maximum allowed size of 64 KiB.
105
+ - `M_KEY_TOO_LARGE`: The supplied profile key exceeds the
106
+ maximum allowed key length of 255 bytes.
107
+ content:
108
+ application/json:
109
+ schema:
110
+ $ref: definitions/errors/error.yaml
111
+ examples:
112
+ bad_json:
113
+ value:
114
+ {
115
+ "errcode": "M_BAD_JSON",
116
+ "error": "Malformed JSON payload.",
117
+ }
118
+ invalid_key:
119
+ value:
120
+ {
121
+ "errcode": "M_INVALID_PARAM",
122
+ "error": "Invalid profile key.",
123
+ }
124
+ "403":
125
+ description: The server is unwilling to perform the operation, either
126
+ due to insufficient permissions or because profile modifications
127
+ are disabled.
128
+ content:
129
+ application/json:
130
+ schema:
131
+ $ref: definitions/errors/error.yaml
132
+ examples:
133
+ forbidden:
134
+ value:
135
+ {
136
+ "errcode": "M_FORBIDDEN",
137
+ "error": "Profile modification is not permitted.",
138
+ }
139
+ "429":
140
+ description: This request was rate-limited.
141
+ content:
142
+ application/json:
143
+ schema:
144
+ $ref: definitions/errors/rate_limited.yaml
145
+ tags:
146
+ - User data
147
+ get:
148
+ x-changedInMatrixVersion:
149
+ "1.16": This endpoint now accepts a variable `keyName` parameter and `m.tz` was added as a defined key. Previously only `displayname` and `avatar_url` were accepted.
150
+ summary: Get a profile field for a user.
151
+ description: Get the value of a profile field for a user.
152
+ operationId: getProfileField
153
+ parameters:
154
+ - in: path
155
+ name: userId
156
+ description: The user whose profile field should be returned.
157
+ required: true
158
+ example: "@alice:example.com"
159
+ schema:
160
+ type: string
161
+ - in: path
162
+ name: keyName
163
+ description: The name of the profile field to retrieve.
164
+ required: true
165
+ example: "displayname"
166
+ schema:
167
+ type: string
168
+ pattern: '^(avatar_url|displayname|m\.tz|[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)+)$'
169
+ responses:
170
+ "200":
171
+ description: The profile field value was retrieved.
172
+ content:
173
+ application/json:
174
+ schema:
175
+ type: object
176
+ description: |
177
+ An object with one property, whose key matches the `keyName` specified
178
+ in the URL, and whose value is the current setting of that profile field.
179
+ additionalProperties: true
180
+ examples:
181
+ response:
182
+ value: { "displayname": "Alice" }
183
+ "403":
184
+ x-addedInMatrixVersion: "1.12"
185
+ description: The server is unwilling to disclose whether the user
186
+ exists and/or has the specified profile field.
187
+ content:
188
+ application/json:
189
+ schema:
190
+ $ref: definitions/errors/error.yaml
191
+ examples:
192
+ response:
193
+ value:
194
+ {
195
+ "errcode": "M_FORBIDDEN",
196
+ "error": "Profile lookup is disabled on this homeserver",
197
+ }
198
+ "404":
199
+ description: There is no profile field with this key for this user, or
200
+ the user does not exist.
201
+ tags:
202
+ - User data
203
+ delete:
204
+ x-addedInMatrixVersion: "1.16"
205
+ summary: Remove a profile field from a user.
206
+ description: Remove a specific field from a user's profile.
207
+ operationId: deleteProfileField
208
+ security:
209
+ - accessTokenQuery: []
210
+ - accessTokenBearer: []
211
+ parameters:
212
+ - in: path
213
+ name: userId
214
+ description: The user whose profile field should be deleted.
215
+ required: true
216
+ example: "@alice:example.com"
217
+ schema:
218
+ type: string
219
+ - in: path
220
+ name: keyName
221
+ description: The name of the profile field to delete.
222
+ required: true
223
+ example: "displayname"
224
+ schema:
225
+ type: string
226
+ pattern: '^(avatar_url|displayname|m\.tz|[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)+)$'
227
+ responses:
228
+ "200":
229
+ description: The profile field was deleted or it doesn't exist.
230
+ content:
231
+ application/json:
232
+ schema:
233
+ type: object
234
+ examples:
235
+ response:
236
+ value: {}
237
+ "400":
238
+ description: The request is malformed, contains invalid JSON, or
239
+ specifies an invalid key.
240
+ content:
241
+ application/json:
242
+ schema:
243
+ $ref: definitions/errors/error.yaml
244
+ examples:
245
+ bad_json:
246
+ value:
247
+ { "errcode": "M_BAD_JSON", "error": "Malformed request." }
248
+ invalid_key:
249
+ value:
250
+ {
251
+ "errcode": "M_INVALID_PARAM",
252
+ "error": "Invalid profile key.",
253
+ }
254
+ "403":
255
+ description: The user is not authorised to delete this profile field.
256
+ content:
257
+ application/json:
258
+ schema:
259
+ $ref: definitions/errors/error.yaml
260
+ examples:
261
+ forbidden:
262
+ value:
263
+ {
264
+ "errcode": "M_FORBIDDEN",
265
+ "error": "Profile deletion is not permitted.",
266
+ }
267
+ "429":
268
+ description: This request was rate-limited.
269
+ content:
270
+ application/json:
271
+ schema:
272
+ $ref: definitions/errors/rate_limited.yaml
273
+ tags:
274
+ - User data
275
+ "/profile/{userId}":
276
+ get:
277
+ summary: Get all profile information for a user.
278
+ description: |-
279
+ Get the complete profile for a user.
280
+ operationId: getUserProfile
281
+ parameters:
282
+ - in: path
283
+ name: userId
284
+ description: The user whose profile information to get.
285
+ required: true
286
+ example: "@alice:example.com"
287
+ schema:
288
+ type: string
289
+ responses:
290
+ "200":
291
+ description: The profile information for this user.
292
+ content:
293
+ application/json:
294
+ schema:
295
+ type: object
296
+ properties:
297
+ avatar_url:
298
+ type: string
299
+ format: mx-mxc-uri
300
+ description: The user's avatar URL if they have set one, otherwise not present.
301
+ displayname:
302
+ type: string
303
+ description: The user's display name if they have set one, otherwise not
304
+ present.
305
+ m.tz:
306
+ x-addedInMatrixVersion: "1.16"
307
+ type: string
308
+ description: The user's time zone.
309
+ additionalProperties:
310
+ x-addedInMatrixVersion: "1.16"
311
+ description: Additional profile fields.
312
+ examples:
313
+ response:
314
+ value:
315
+ {
316
+ "avatar_url": "mxc://matrix.org/SDGdghriugerRg",
317
+ "displayname": "Alice Margatroid",
318
+ "m.tz": "Europe/London",
319
+ "m.example_field": "custom_value",
320
+ }
321
+ "403":
322
+ x-addedInMatrixVersion: "1.2"
323
+ description: The server is unwilling to disclose whether the user
324
+ exists and/or has profile information.
325
+ content:
326
+ application/json:
327
+ schema:
328
+ $ref: definitions/errors/error.yaml
329
+ examples:
330
+ response:
331
+ value:
332
+ {
333
+ "errcode": "M_FORBIDDEN",
334
+ "error": "Profile lookup is disabled on this homeserver",
335
+ }
336
+ "404":
337
+ description: There is no profile information for this user or this
338
+ user does not exist.
339
+ content:
340
+ application/json:
341
+ schema:
342
+ $ref: definitions/errors/error.yaml
343
+ examples:
344
+ response:
345
+ value:
346
+ { "errcode": "M_NOT_FOUND", "error": "Profile not found" }
347
+ tags:
348
+ - User data
349
+ servers:
350
+ - url: "{protocol}://{hostname}{basePath}"
351
+ variables:
352
+ protocol:
353
+ enum:
354
+ - http
355
+ - https
356
+ default: https
357
+ hostname:
358
+ default: localhost:8008
359
+ basePath:
360
+ default: /_matrix/client/v3
361
+ components:
362
+ securitySchemes:
363
+ accessTokenQuery:
364
+ $ref: definitions/security.yaml#/accessTokenQuery
365
+ accessTokenBearer:
366
+ $ref: definitions/security.yaml#/accessTokenBearer
@@ -0,0 +1,303 @@
1
+ # Copyright 2016 OpenMarket Ltd
2
+ # Copyright 2018 New Vector Ltd
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 Push API
18
+ version: 1.0.0
19
+ paths:
20
+ /pushers:
21
+ get:
22
+ summary: Gets the current pushers for the authenticated user
23
+ description: Gets all currently active pushers for the authenticated user.
24
+ operationId: getPushers
25
+ security:
26
+ - accessTokenQuery: []
27
+ - accessTokenBearer: []
28
+ responses:
29
+ "200":
30
+ description: The pushers for this user.
31
+ content:
32
+ application/json:
33
+ schema:
34
+ type: object
35
+ properties:
36
+ pushers:
37
+ type: array
38
+ title: Pushers
39
+ description: An array containing the current pushers for the user
40
+ items:
41
+ type: object
42
+ title: Pusher
43
+ properties:
44
+ pushkey:
45
+ type: string
46
+ description: |-
47
+ This is a unique identifier for this pusher. See `/set` for
48
+ more detail.
49
+ Max length, 512 bytes.
50
+ kind:
51
+ type: string
52
+ description: |-
53
+ The kind of pusher. `"http"` is a pusher that
54
+ sends HTTP pokes.
55
+ app_id:
56
+ type: string
57
+ description: |-
58
+ This is a reverse-DNS style identifier for the application.
59
+ Max length, 64 chars.
60
+ app_display_name:
61
+ type: string
62
+ description: |-
63
+ A string that will allow the user to identify what application
64
+ owns this pusher.
65
+ device_display_name:
66
+ type: string
67
+ description: |-
68
+ A string that will allow the user to identify what device owns
69
+ this pusher.
70
+ profile_tag:
71
+ type: string
72
+ description: |-
73
+ This string determines which set of device specific rules this
74
+ pusher executes.
75
+ lang:
76
+ type: string
77
+ description: |-
78
+ The preferred language for receiving notifications (e.g. 'en'
79
+ or 'en-US')
80
+ data:
81
+ type: object
82
+ description: |-
83
+ A dictionary of information for the pusher implementation
84
+ itself.
85
+ title: PusherData
86
+ properties:
87
+ url:
88
+ type: string
89
+ format: uri
90
+ description: |-
91
+ Required if `kind` is `http`. The URL to use to send
92
+ notifications to.
93
+ format:
94
+ type: string
95
+ description: |-
96
+ The format to use when sending notifications to the Push
97
+ Gateway.
98
+ required:
99
+ - pushkey
100
+ - app_id
101
+ - kind
102
+ - app_display_name
103
+ - device_display_name
104
+ - lang
105
+ - data
106
+ examples:
107
+ response:
108
+ value: {
109
+ "pushers": [
110
+ {
111
+ "pushkey": "Xp/MzCt8/9DcSNE9cuiaoT5Ac55job3TdLSSmtmYl4A=",
112
+ "kind": "http",
113
+ "app_id": "face.mcapp.appy.prod",
114
+ "app_display_name": "Appy McAppface",
115
+ "device_display_name": "Alice's Phone",
116
+ "profile_tag": "xyz",
117
+ "lang": "en-US",
118
+ "data": {
119
+ "url": "https://example.com/_matrix/push/v1/notify"
120
+ }
121
+ }
122
+ ]
123
+ }
124
+ tags:
125
+ - Push notifications
126
+ /pushers/set:
127
+ post:
128
+ summary: Modify a pusher for this user on the homeserver.
129
+ description: |-
130
+ This endpoint allows the creation, modification and deletion of [pushers](/client-server-api/#push-notifications)
131
+ for this user ID. The behaviour of this endpoint varies depending on the
132
+ values in the JSON body.
133
+
134
+ If `kind` is not `null`, the pusher with this `app_id` and `pushkey`
135
+ for this user is updated, or it is created if it doesn't exist. If
136
+ `kind` is `null`, the pusher with this `app_id` and `pushkey` for this
137
+ user is deleted.
138
+ operationId: postPusher
139
+ security:
140
+ - accessTokenQuery: []
141
+ - accessTokenBearer: []
142
+ requestBody:
143
+ content:
144
+ application/json:
145
+ schema:
146
+ type: object
147
+ example: {
148
+ "lang": "en",
149
+ "kind": "http",
150
+ "app_display_name": "Mat Rix",
151
+ "device_display_name": "iPhone 9",
152
+ "profile_tag": "xxyyzz",
153
+ "app_id": "com.example.app.ios",
154
+ "pushkey": "APA91bHPRgkF3JUikC4ENAHEeMrd41Zxv3hVZjC9KtT8OvPVGJ-hQMRKRrZuJAEcl7B338qju59zJMjw2DELjzEvxwYv7hH5Ynpc1ODQ0aT4U4OFEeco8ohsN5PjL1iC2dNtk2BAokeMCg2ZXKqpc8FXKmhX94kIxQ",
155
+ "data": {
156
+ "url": "https://push-gateway.location.here/_matrix/push/v1/notify",
157
+ "format": "event_id_only"
158
+ },
159
+ "append": false
160
+ }
161
+ properties:
162
+ pushkey:
163
+ type: string
164
+ description: |-
165
+ This is a unique identifier for this pusher. The value you
166
+ should use for this is the routing or destination address
167
+ information for the notification, for example, the APNS token
168
+ for APNS or the Registration ID for GCM. If your notification
169
+ client has no such concept, use any unique identifier.
170
+ Max length, 512 bytes.
171
+
172
+ If the `kind` is `"email"`, this is the email address to
173
+ send notifications to.
174
+ kind:
175
+ description: |-
176
+ The kind of pusher to configure. `"http"` makes a pusher that
177
+ sends HTTP pokes. `"email"` makes a pusher that emails the
178
+ user with unread notifications. `null` deletes the pusher.
179
+ type: ["string", "null"]
180
+ app_id:
181
+ type: string
182
+ description: |-
183
+ This is a reverse-DNS style identifier for the application.
184
+ It is recommended that this end with the platform, such that
185
+ different platform versions get different app identifiers.
186
+ Max length, 64 chars.
187
+
188
+ If the `kind` is `"email"`, this is `"m.email"`.
189
+ app_display_name:
190
+ type: string
191
+ description: |-
192
+ Required if `kind` is not `null`. A string that will allow the
193
+ user to identify what application owns this pusher.
194
+ device_display_name:
195
+ type: string
196
+ description: |-
197
+ Required if `kind` is not `null`. A string that will allow the
198
+ user to identify what device owns this pusher.
199
+ profile_tag:
200
+ type: string
201
+ description: |-
202
+ This string determines which set of device specific rules this
203
+ pusher executes.
204
+ lang:
205
+ type: string
206
+ description: |-
207
+ Required if `kind` is not `null`. The preferred language for
208
+ receiving notifications (e.g. 'en' or 'en-US').
209
+ data:
210
+ type: object
211
+ description: |-
212
+ Required if `kind` is not `null`. A dictionary of information
213
+ for the pusher implementation itself.
214
+
215
+ If `kind` is `http`, this MUST contain `url` which is the URL
216
+ to use for sending notifications. Clients MAY use this object
217
+ to pass custom data to their push gateway. Servers MUST forward
218
+ the entire content including `format` and any custom keys but excluding `url`
219
+ when calling [`/_matrix/push/v1/notify`](/push-gateway-api/#post_matrixpushv1notify).
220
+ title: PusherData
221
+ properties:
222
+ url:
223
+ type: string
224
+ format: uri
225
+ description: |-
226
+ Required if `kind` is `http`. The URL to use for sending
227
+ notifications. MUST be an HTTPS URL with a path of
228
+ `/_matrix/push/v1/notify`.
229
+ example: https://push-gateway.location.here/_matrix/push/v1/notify
230
+ format:
231
+ type: string
232
+ description: |-
233
+ The format in which to send notifications to the push gateway
234
+ if the `kind` is `http`. The details about what fields the
235
+ homeserver should include are defined in the
236
+ [Push Gateway Specification](/push-gateway-api/). If omitted,
237
+ the server is expected to populate all of the event-related fields
238
+ specified in [`/_matrix/push/v1/notify`](/push-gateway-api/#post_matrixpushv1notify).
239
+ enum:
240
+ - "event_id_only"
241
+ append:
242
+ type: boolean
243
+ description: |-
244
+ If true, the homeserver should add another pusher with the
245
+ given pushkey and App ID in addition to any others with
246
+ different user IDs. Otherwise, the homeserver must remove any
247
+ other pushers with the same App ID and pushkey for different
248
+ users. The default is `false`.
249
+ required:
250
+ - kind
251
+ - app_id
252
+ - pushkey
253
+ description: The pusher information.
254
+ required: true
255
+ responses:
256
+ "200":
257
+ description: The pusher was set.
258
+ content:
259
+ application/json:
260
+ schema:
261
+ type: object
262
+ description: An empty object.
263
+ examples:
264
+ response:
265
+ value: {}
266
+ "400":
267
+ description: One or more of the pusher values were invalid.
268
+ content:
269
+ application/json:
270
+ schema:
271
+ $ref: definitions/errors/error.yaml
272
+ examples:
273
+ response:
274
+ value: {
275
+ "error": "Missing parameters: lang, data",
276
+ "errcode": "M_MISSING_PARAM"
277
+ }
278
+ "429":
279
+ description: This request was rate-limited.
280
+ content:
281
+ application/json:
282
+ schema:
283
+ $ref: definitions/errors/rate_limited.yaml
284
+ tags:
285
+ - Push notifications
286
+ servers:
287
+ - url: "{protocol}://{hostname}{basePath}"
288
+ variables:
289
+ protocol:
290
+ enum:
291
+ - http
292
+ - https
293
+ default: https
294
+ hostname:
295
+ default: localhost:8008
296
+ basePath:
297
+ default: /_matrix/client/v3
298
+ components:
299
+ securitySchemes:
300
+ accessTokenQuery:
301
+ $ref: definitions/security.yaml#/accessTokenQuery
302
+ accessTokenBearer:
303
+ $ref: definitions/security.yaml#/accessTokenBearer