Merge branch 'master' into spec-restructure-modules
This commit is contained in:
commit
b0eb985523
30 changed files with 478 additions and 73 deletions
448
api/client-server/v1/rooms.yaml
Normal file
448
api/client-server/v1/rooms.yaml
Normal file
|
@ -0,0 +1,448 @@
|
||||||
|
swagger: '2.0'
|
||||||
|
info:
|
||||||
|
title: "Matrix Client-Server v1 Rooms API"
|
||||||
|
version: "1.0.0"
|
||||||
|
host: localhost:8008
|
||||||
|
schemes:
|
||||||
|
- https
|
||||||
|
- http
|
||||||
|
basePath: /_matrix/client/api/v1
|
||||||
|
consumes:
|
||||||
|
- application/json
|
||||||
|
produces:
|
||||||
|
- application/json
|
||||||
|
securityDefinitions:
|
||||||
|
accessToken:
|
||||||
|
type: apiKey
|
||||||
|
description: The user_id or application service access_token
|
||||||
|
name: access_token
|
||||||
|
in: query
|
||||||
|
paths:
|
||||||
|
"/rooms/{roomId}/state/{eventType}/{stateKey}":
|
||||||
|
get:
|
||||||
|
summary: Get the state identified by the type and key.
|
||||||
|
description: |-
|
||||||
|
Looks up the contents of a state event in a room. If the user is
|
||||||
|
joined to the room then the state is taken from the current
|
||||||
|
state of the room. If the user has left the room then the state is
|
||||||
|
taken from the state of the room when they left.
|
||||||
|
security:
|
||||||
|
- accessToken: []
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
type: string
|
||||||
|
name: roomId
|
||||||
|
description: The room to look up the state in.
|
||||||
|
required: true
|
||||||
|
x-example: "!636q39766251:example.com"
|
||||||
|
- in: path
|
||||||
|
type: string
|
||||||
|
name: eventType
|
||||||
|
description: The type of state to look up.
|
||||||
|
required: true
|
||||||
|
x-example: "m.room.name"
|
||||||
|
- in: path
|
||||||
|
type: string
|
||||||
|
name: stateKey
|
||||||
|
description: The key of the state to look up. Defaults to the empty string.
|
||||||
|
required: true
|
||||||
|
x-example: ""
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: The content of the state event.
|
||||||
|
examples:
|
||||||
|
application/json: |-
|
||||||
|
{"name": "Example room name"}
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
404:
|
||||||
|
description: The room has no state with the given type or key.
|
||||||
|
403:
|
||||||
|
description: >
|
||||||
|
You aren't a member of the room and weren't previously a
|
||||||
|
member of the room.
|
||||||
|
|
||||||
|
"/rooms/{roomId}/state":
|
||||||
|
get:
|
||||||
|
summary: Get all state events in the current state of a room.
|
||||||
|
description: |-
|
||||||
|
Get the state events for the current state of a room.
|
||||||
|
security:
|
||||||
|
- accessToken: []
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
type: string
|
||||||
|
name: roomId
|
||||||
|
description: The room to look up the state for.
|
||||||
|
required: true
|
||||||
|
x-example: "!636q39766251:example.com"
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: The current state of the room
|
||||||
|
examples:
|
||||||
|
application/json: |-
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"age": 7148266897,
|
||||||
|
"content": {
|
||||||
|
"join_rule": "public"
|
||||||
|
},
|
||||||
|
"event_id": "$14259997323TLwtb:example.com",
|
||||||
|
"origin_server_ts": 1425999732392,
|
||||||
|
"room_id": "!636q39766251:example.com",
|
||||||
|
"state_key": "",
|
||||||
|
"type": "m.room.join_rules",
|
||||||
|
"user_id": "@alice:example.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"age": 6547561012,
|
||||||
|
"content": {
|
||||||
|
"avatar_url": "mxc://example.com/fzysBrHpPEeTGANCVLXWXNMI#auto",
|
||||||
|
"displayname": null,
|
||||||
|
"membership": "join"
|
||||||
|
},
|
||||||
|
"event_id": "$1426600438280zExKY:example.com",
|
||||||
|
"membership": "join",
|
||||||
|
"origin_server_ts": 1426600438277,
|
||||||
|
"room_id": "!636q39766251:example.com",
|
||||||
|
"state_key": "@alice:example.com",
|
||||||
|
"type": "m.room.member",
|
||||||
|
"user_id": "@alice:example.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"age": 7148267200,
|
||||||
|
"content": {
|
||||||
|
"creator": "@alice:example.com"
|
||||||
|
},
|
||||||
|
"event_id": "$14259997320KhbwJ:example.com",
|
||||||
|
"origin_server_ts": 1425999732089,
|
||||||
|
"room_id": "!636q39766251:example.com",
|
||||||
|
"state_key": "",
|
||||||
|
"type": "m.room.create",
|
||||||
|
"user_id": "@alice:example.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"age": 1622568720,
|
||||||
|
"content": {
|
||||||
|
"avatar_url": "mxc://example.com/GCmhgzMPRjqgpODLsNQzVuHZ#auto",
|
||||||
|
"displayname": "Bob",
|
||||||
|
"membership": "join"
|
||||||
|
},
|
||||||
|
"event_id": "$1431525430134MxlLX:example.com",
|
||||||
|
"origin_server_ts": 1431525430569,
|
||||||
|
"replaces_state": "$142652023736BSXcM:example.com",
|
||||||
|
"room_id": "!636q39766251:example.com",
|
||||||
|
"state_key": "@bob:example.com",
|
||||||
|
"type": "m.room.member",
|
||||||
|
"user_id": "@bob:example.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"age": 7148267004,
|
||||||
|
"content": {
|
||||||
|
"ban": 50,
|
||||||
|
"events": {
|
||||||
|
"m.room.name": 100,
|
||||||
|
"m.room.power_levels": 100
|
||||||
|
},
|
||||||
|
"events_default": 0,
|
||||||
|
"kick": 50,
|
||||||
|
"redact": 50,
|
||||||
|
"state_default": 50,
|
||||||
|
"users": {
|
||||||
|
"@alice:example.com": 100
|
||||||
|
},
|
||||||
|
"users_default": 0
|
||||||
|
},
|
||||||
|
"event_id": "$14259997322mqfaq:example.com",
|
||||||
|
"origin_server_ts": 1425999732285,
|
||||||
|
"room_id": "!636q39766251:example.com",
|
||||||
|
"state_key": "",
|
||||||
|
"type": "m.room.power_levels",
|
||||||
|
"user_id": "@alice:example.com"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
schema:
|
||||||
|
type: array
|
||||||
|
title: RoomState
|
||||||
|
description: |-
|
||||||
|
If the user is a member of the room this will be the
|
||||||
|
current state of the room as a list of events. If the user
|
||||||
|
has left the room then this will be the state of the room
|
||||||
|
when they left as a list of events.
|
||||||
|
items:
|
||||||
|
title: StateEvent
|
||||||
|
type: object
|
||||||
|
allOf:
|
||||||
|
- "$ref": "core-event-schema/state_event.json"
|
||||||
|
403:
|
||||||
|
description: >
|
||||||
|
You aren't a member of the room and weren't previously a
|
||||||
|
member of the room.
|
||||||
|
|
||||||
|
"/rooms/{roomId}/initialSync":
|
||||||
|
get:
|
||||||
|
summary: Snapshot the current state of a room and its most recent messages.
|
||||||
|
description: |-
|
||||||
|
Get a copy of the current state and the most recent messages in a room.
|
||||||
|
security:
|
||||||
|
- accessToken: []
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
type: string
|
||||||
|
name: roomId
|
||||||
|
description: The room to get the data.
|
||||||
|
required: true
|
||||||
|
x-example: "!636q39766251:example.com"
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: The current state of the room
|
||||||
|
examples:
|
||||||
|
application/json: |-
|
||||||
|
{
|
||||||
|
"membership": "join",
|
||||||
|
"messages": {
|
||||||
|
"chunk": [
|
||||||
|
{
|
||||||
|
"age": 343513403,
|
||||||
|
"content": {
|
||||||
|
"body": "foo",
|
||||||
|
"msgtype": "m.text"
|
||||||
|
},
|
||||||
|
"event_id": "$14328044851tzTJS:example.com",
|
||||||
|
"origin_server_ts": 1432804485886,
|
||||||
|
"room_id": "!636q39766251:example.com",
|
||||||
|
"type": "m.room.message",
|
||||||
|
"user_id": "@alice:example.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"age": 343511809,
|
||||||
|
"content": {
|
||||||
|
"body": "bar",
|
||||||
|
"msgtype": "m.text"
|
||||||
|
},
|
||||||
|
"event_id": "$14328044872spjFg:example.com",
|
||||||
|
"origin_server_ts": 1432804487480,
|
||||||
|
"room_id": "!636q39766251:example.com",
|
||||||
|
"type": "m.room.message",
|
||||||
|
"user_id": "@bob:example.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"end": "s3456_9_0",
|
||||||
|
"start": "t44-3453_9_0"
|
||||||
|
},
|
||||||
|
"room_id": "!636q39766251:example.com",
|
||||||
|
"state": [
|
||||||
|
{
|
||||||
|
"age": 7148266897,
|
||||||
|
"content": {
|
||||||
|
"join_rule": "public"
|
||||||
|
},
|
||||||
|
"event_id": "$14259997323TLwtb:example.com",
|
||||||
|
"origin_server_ts": 1425999732392,
|
||||||
|
"room_id": "!636q39766251:example.com",
|
||||||
|
"state_key": "",
|
||||||
|
"type": "m.room.join_rules",
|
||||||
|
"user_id": "@alice:example.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"age": 6547561012,
|
||||||
|
"content": {
|
||||||
|
"avatar_url": "mxc://example.com/fzysBrHpPEeTGANCVLXWXNMI#auto",
|
||||||
|
"displayname": null,
|
||||||
|
"membership": "join"
|
||||||
|
},
|
||||||
|
"event_id": "$1426600438280zExKY:example.com",
|
||||||
|
"membership": "join",
|
||||||
|
"origin_server_ts": 1426600438277,
|
||||||
|
"room_id": "!636q39766251:example.com",
|
||||||
|
"state_key": "@alice:example.com",
|
||||||
|
"type": "m.room.member",
|
||||||
|
"user_id": "@alice:example.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"age": 7148267200,
|
||||||
|
"content": {
|
||||||
|
"creator": "@alice:example.com"
|
||||||
|
},
|
||||||
|
"event_id": "$14259997320KhbwJ:example.com",
|
||||||
|
"origin_server_ts": 1425999732089,
|
||||||
|
"room_id": "!636q39766251:example.com",
|
||||||
|
"state_key": "",
|
||||||
|
"type": "m.room.create",
|
||||||
|
"user_id": "@alice:example.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"age": 1622568720,
|
||||||
|
"content": {
|
||||||
|
"avatar_url": "mxc://example.com/GCmhgzMPRjqgpODLsNQzVuHZ#auto",
|
||||||
|
"displayname": "Bob",
|
||||||
|
"membership": "join"
|
||||||
|
},
|
||||||
|
"event_id": "$1431525430134MxlLX:example.com",
|
||||||
|
"origin_server_ts": 1431525430569,
|
||||||
|
"replaces_state": "$142652023736BSXcM:example.com",
|
||||||
|
"room_id": "!636q39766251:example.com",
|
||||||
|
"state_key": "@bob:example.com",
|
||||||
|
"type": "m.room.member",
|
||||||
|
"user_id": "@bob:example.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"age": 7148267004,
|
||||||
|
"content": {
|
||||||
|
"ban": 50,
|
||||||
|
"events": {
|
||||||
|
"m.room.name": 100,
|
||||||
|
"m.room.power_levels": 100
|
||||||
|
},
|
||||||
|
"events_default": 0,
|
||||||
|
"kick": 50,
|
||||||
|
"redact": 50,
|
||||||
|
"state_default": 50,
|
||||||
|
"users": {
|
||||||
|
"@alice:example.com": 100
|
||||||
|
},
|
||||||
|
"users_default": 0
|
||||||
|
},
|
||||||
|
"event_id": "$14259997322mqfaq:example.com",
|
||||||
|
"origin_server_ts": 1425999732285,
|
||||||
|
"room_id": "!636q39766251:example.com",
|
||||||
|
"state_key": "",
|
||||||
|
"type": "m.room.power_levels",
|
||||||
|
"user_id": "@alice:example.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"visibility": "private"
|
||||||
|
}
|
||||||
|
schema:
|
||||||
|
title: RoomInfo
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
room_id:
|
||||||
|
type: string
|
||||||
|
description: "The ID of this room."
|
||||||
|
membership:
|
||||||
|
type: string
|
||||||
|
description: "The user's membership state in this room."
|
||||||
|
enum: ["invite", "join", "leave", "ban"]
|
||||||
|
messages:
|
||||||
|
type: object
|
||||||
|
title: PaginationChunk
|
||||||
|
description: "The pagination chunk for this room."
|
||||||
|
properties:
|
||||||
|
start:
|
||||||
|
type: string
|
||||||
|
description: |-
|
||||||
|
A token which correlates to the first value in ``chunk``.
|
||||||
|
Used for pagination.
|
||||||
|
end:
|
||||||
|
type: string
|
||||||
|
description: |-
|
||||||
|
A token which correlates to the last value in ``chunk``.
|
||||||
|
Used for pagination.
|
||||||
|
chunk:
|
||||||
|
type: array
|
||||||
|
description: |-
|
||||||
|
If the user is a member of the room this will be a
|
||||||
|
list of the most recent messages for this room. If
|
||||||
|
the user has left the room this will be the
|
||||||
|
messages that preceeded them leaving. This array
|
||||||
|
will consist of at most ``limit`` elements.
|
||||||
|
items:
|
||||||
|
type: object
|
||||||
|
title: RoomEvent
|
||||||
|
allOf:
|
||||||
|
- "$ref": "core-event-schema/room_event.json"
|
||||||
|
required: ["start", "end", "chunk"]
|
||||||
|
state:
|
||||||
|
type: array
|
||||||
|
description: |-
|
||||||
|
If the user is a member of the room this will be the
|
||||||
|
current state of the room as a list of events. If the
|
||||||
|
user has left the room this will be the state of the
|
||||||
|
room when they left it.
|
||||||
|
items:
|
||||||
|
title: StateEvent
|
||||||
|
type: object
|
||||||
|
allOf:
|
||||||
|
- "$ref": "core-event-schema/state_event.json"
|
||||||
|
visibility:
|
||||||
|
type: string
|
||||||
|
enum: ["private", "public"]
|
||||||
|
description: |-
|
||||||
|
Whether this room is visible to the ``/publicRooms`` API
|
||||||
|
or not."
|
||||||
|
required: ["room_id", "membership"]
|
||||||
|
403:
|
||||||
|
description: >
|
||||||
|
You aren't a member of the room and weren't previously a
|
||||||
|
member of the room.
|
||||||
|
|
||||||
|
"/rooms/{roomId}/members":
|
||||||
|
get:
|
||||||
|
summary: Get the m.room.member events for the room.
|
||||||
|
description:
|
||||||
|
Get the list of members for this room.
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
type: string
|
||||||
|
name: roomId
|
||||||
|
description: The room to get the member events for.
|
||||||
|
required: true
|
||||||
|
x-example: "!636q39766251:example.com"
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: |-
|
||||||
|
A list of members of the room. If you are joined to the room then
|
||||||
|
this will be the current members of the room. If you have left te
|
||||||
|
room then this will be the members of the room when you left.
|
||||||
|
examples:
|
||||||
|
application/json: |-
|
||||||
|
{
|
||||||
|
"chunk": [
|
||||||
|
{
|
||||||
|
"age": 6547561012,
|
||||||
|
"content": {
|
||||||
|
"avatar_url": "mxc://example.com/fzysBrHpPEeTGANCVLXWXNMI#auto",
|
||||||
|
"displayname": null,
|
||||||
|
"membership": "join"
|
||||||
|
},
|
||||||
|
"event_id": "$1426600438280zExKY:example.com",
|
||||||
|
"membership": "join",
|
||||||
|
"origin_server_ts": 1426600438277,
|
||||||
|
"room_id": "!636q39766251:example.com",
|
||||||
|
"state_key": "@alice:example.com",
|
||||||
|
"type": "m.room.member",
|
||||||
|
"user_id": "@alice:example.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"age": 1622568720,
|
||||||
|
"content": {
|
||||||
|
"avatar_url": "mxc://example.com/GCmhgzMPRjqgpODLsNQzVuHZ#auto",
|
||||||
|
"displayname": "Bob",
|
||||||
|
"membership": "join"
|
||||||
|
},
|
||||||
|
"event_id": "$1431525430134MxlLX:example.com",
|
||||||
|
"origin_server_ts": 1431525430569,
|
||||||
|
"replaces_state": "$142652023736BSXcM:example.com",
|
||||||
|
"room_id": "!636q39766251:example.com",
|
||||||
|
"state_key": "@bob:example.com",
|
||||||
|
"type": "m.room.member",
|
||||||
|
"user_id": "@bob:example.com"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
chunk:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
title: MemberEvent
|
||||||
|
type: object
|
||||||
|
allOf:
|
||||||
|
- "$ref": "v1-event-schema/m.room.member"
|
||||||
|
403:
|
||||||
|
description: >
|
||||||
|
You aren't a member of the room and weren't previously a
|
||||||
|
member of the room.
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"description": "This event is sent by the callee when they wish to answer the call.",
|
"description": "This event is sent by the callee when they wish to answer the call.",
|
||||||
"allOf": [{
|
"allOf": [{
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"description": "This event is sent by callers after sending an invite and by the callee after answering. Its purpose is to give the other party additional ICE candidates to try using to communicate.",
|
"description": "This event is sent by callers after sending an invite and by the callee after answering. Its purpose is to give the other party additional ICE candidates to try using to communicate.",
|
||||||
"allOf": [{
|
"allOf": [{
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"description": "Sent by either party to signal their termination of the call. This can be sent either once the call has has been established or before to abort the call.",
|
"description": "Sent by either party to signal their termination of the call. This can be sent either once the call has has been established or before to abort the call.",
|
||||||
"allOf": [{
|
"allOf": [{
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"description": "This event is sent by the caller when they wish to establish a call.",
|
"description": "This event is sent by the caller when they wish to establish a call.",
|
||||||
"allOf": [{
|
"allOf": [{
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"title": "Presence Event",
|
"title": "Presence Event",
|
||||||
"description": "Informs the client of a user's presence state change.",
|
"description": "Informs the client of a user's presence state change.",
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"title": "Receipt Event",
|
"title": "Receipt Event",
|
||||||
"description": "Informs the client of new receipts.",
|
"description": "Informs the client of new receipts.",
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"title": "Informs the room about what room aliases it has been given.",
|
"title": "Informs the room about what room aliases it has been given.",
|
||||||
"description": "This event is sent by a homeserver directly to inform of changes to the list of aliases it knows about for that room. The ``state_key`` for this event is set to the homeserver which owns the room alias. The entire set of known aliases for the room is the union of all the ``m.room.aliases`` events, one for each homeserver. Clients **should** check the validity of any room alias given in this list before presenting it to the user as trusted fact. The lists given by this event should be considered simply as advice on which aliases might exist, for which the client can perform the lookup to confirm whether it receives the correct room ID.",
|
"description": "This event is sent by a homeserver directly to inform of changes to the list of aliases it knows about for that room. The ``state_key`` for this event is set to the homeserver which owns the room alias. The entire set of known aliases for the room is the union of all the ``m.room.aliases`` events, one for each homeserver. Clients **should** check the validity of any room alias given in this list before presenting it to the user as trusted fact. The lists given by this event should be considered simply as advice on which aliases might exist, for which the client can perform the lookup to confirm whether it receives the correct room ID.",
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"title": "Informs the room as to which alias is the canonical one.",
|
"title": "Informs the room as to which alias is the canonical one.",
|
||||||
"description": "This event is used to inform the room about which alias should be considered the canonical one. This could be for display purposes or as suggestion to users which alias to use to advertise the room.",
|
"description": "This event is used to inform the room about which alias should be considered the canonical one. This could be for display purposes or as suggestion to users which alias to use to advertise the room.",
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"title": "The first event in the room.",
|
"title": "The first event in the room.",
|
||||||
"description": "This is the first event in a room and cannot be changed. It acts as the root of all other events.",
|
"description": "This is the first event in a room and cannot be changed. It acts as the root of all other events.",
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"title": "Controls visibility of history.",
|
"title": "Controls visibility of history.",
|
||||||
"description": "This event controls whether a member of a room can see the events that happened in a room from before they joined.",
|
"description": "This event controls whether a member of a room can see the events that happened in a room from before they joined.",
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"title": "Describes how users are allowed to join the room.",
|
"title": "Describes how users are allowed to join the room.",
|
||||||
"description": "A room may be ``public`` meaning anyone can join the room without any prior action. Alternatively, it can be ``invite`` meaning that a user who wishes to join the room must first receive an invite to the room from someone already inside of the room. Currently, ``knock`` and ``private`` are reserved keywords which are not implemented.",
|
"description": "A room may be ``public`` meaning anyone can join the room without any prior action. Alternatively, it can be ``invite`` meaning that a user who wishes to join the room must first receive an invite to the room from someone already inside of the room. Currently, ``knock`` and ``private`` are reserved keywords which are not implemented.",
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"title": "The current membership state of a user in the room.",
|
"title": "The current membership state of a user in the room.",
|
||||||
"description": "Adjusts the membership state for a user in a room. It is preferable to use the membership APIs (``/rooms/<room id>/invite`` etc) when performing membership actions rather than adjusting the state directly as there are a restricted set of valid transformations. For example, user A cannot force user B to join a room, and trying to force this state change directly will fail.",
|
"description": "Adjusts the membership state for a user in a room. It is preferable to use the membership APIs (``/rooms/<room id>/invite`` etc) when performing membership actions rather than adjusting the state directly as there are a restricted set of valid transformations. For example, user A cannot force user B to join a room, and trying to force this state change directly will fail.",
|
||||||
|
@ -20,7 +19,7 @@
|
||||||
"description": "The avatar URL for this user, if any. This is added by the homeserver."
|
"description": "The avatar URL for this user, if any. This is added by the homeserver."
|
||||||
},
|
},
|
||||||
"displayname": {
|
"displayname": {
|
||||||
"type": "string",
|
"type": ["string", "null"],
|
||||||
"description": "The display name for this user, if any. This is added by the homeserver."
|
"description": "The display name for this user, if any. This is added by the homeserver."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"title": "Message",
|
"title": "Message",
|
||||||
"description": "This event is used when sending messages in a room. Messages are not limited to be text. The ``msgtype`` key outlines the type of message, e.g. text, audio, image, video, etc. The ``body`` key is text and MUST be used with every kind of ``msgtype`` as a fallback mechanism for when a client cannot render a message.",
|
"description": "This event is used when sending messages in a room. Messages are not limited to be text. The ``msgtype`` key outlines the type of message, e.g. text, audio, image, video, etc. The ``body`` key is text and MUST be used with every kind of ``msgtype`` as a fallback mechanism for when a client cannot render a message.",
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"title": "AudioMessage",
|
"title": "AudioMessage",
|
||||||
"description": "This message represents a single audio clip.",
|
"description": "This message represents a single audio clip.",
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"title": "EmoteMessage",
|
"title": "EmoteMessage",
|
||||||
"description": "This message is similar to ``m.text`` except that the sender is 'performing' the action contained in the ``body`` key, similar to ``/me`` in IRC. This message should be prefixed by the name of the sender. This message could also be represented in a different colour to distinguish it from regular ``m.text`` messages.",
|
"description": "This message is similar to ``m.text`` except that the sender is 'performing' the action contained in the ``body`` key, similar to ``/me`` in IRC. This message should be prefixed by the name of the sender. This message could also be represented in a different colour to distinguish it from regular ``m.text`` messages.",
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"title": "FileMessage",
|
"title": "FileMessage",
|
||||||
"description": "This message represents a generic file.",
|
"description": "This message represents a generic file.",
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"title": "ImageMessage",
|
"title": "ImageMessage",
|
||||||
"description": "This message represents a single image and an optional thumbnail.",
|
"description": "This message represents a single image and an optional thumbnail.",
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"title": "LocationMessage",
|
"title": "LocationMessage",
|
||||||
"description": "This message represents a real-world location.",
|
"description": "This message represents a real-world location.",
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"title": "NoticeMessage",
|
"title": "NoticeMessage",
|
||||||
"description": "A m.notice message should be considered similar to a plain m.text message except that clients should visually distinguish it in some way. It is intended to be used by automated clients, such as bots, bridges, and other entities, rather than humans. Additionally, such automated agents which watch a room for messages and respond to them ought to ignore m.notice messages. This helps to prevent infinite-loop situations where two automated clients continuously exchange messages, as each responds to the other.",
|
"description": "A m.notice message should be considered similar to a plain m.text message except that clients should visually distinguish it in some way. It is intended to be used by automated clients, such as bots, bridges, and other entities, rather than humans. Additionally, such automated agents which watch a room for messages and respond to them ought to ignore m.notice messages. This helps to prevent infinite-loop situations where two automated clients continuously exchange messages, as each responds to the other.",
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"title": "TextMessage",
|
"title": "TextMessage",
|
||||||
"description": "This message is the most basic message and is used to represent text.",
|
"description": "This message is the most basic message and is used to represent text.",
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"title": "VideoMessage",
|
"title": "VideoMessage",
|
||||||
"description": "This message represents a single video clip.",
|
"description": "This message represents a single video clip.",
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"title": "MessageFeedback",
|
"title": "MessageFeedback",
|
||||||
"description": "Feedback events are events sent to acknowledge a message in some way. There are two supported acknowledgements: ``delivered`` (sent when the event has been received) and ``read`` (sent when the event has been observed by the end-user). The ``target_event_id`` should reference the ``m.room.message`` event being acknowledged. N.B. not implemented in Synapse, and superceded in v2 CS API by the ``relates_to`` event field.",
|
"description": "Feedback events are events sent to acknowledge a message in some way. There are two supported acknowledgements: ``delivered`` (sent when the event has been received) and ``read`` (sent when the event has been observed by the end-user). The ``target_event_id`` should reference the ``m.room.message`` event being acknowledged. N.B. not implemented in Synapse, and superceded in v2 CS API by the ``relates_to`` event field.",
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
||||||
"title": "RoomName",
|
"title": "RoomName",
|
||||||
"description": "A room has an opaque room ID which is not human-friendly to read. A room alias is human-friendly, but not all rooms have room aliases. The room name is a human-friendly string designed to be displayed to the end-user. The room name is not unique, as multiple rooms can have the same room name set. The room name can also be set when creating a room using ``/createRoom`` with the ``name`` key.",
|
"description": "A room has an opaque room ID which is not human-friendly to read. A room alias is human-friendly, but not all rooms have room aliases. The room name is a human-friendly string designed to be displayed to the end-user. The room name is not unique, as multiple rooms can have the same room name set. The room name can also be set when creating a room using ``/createRoom`` with the ``name`` key.",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"title": "Defines the power levels (privileges) of users in the room.",
|
"title": "Defines the power levels (privileges) of users in the room.",
|
||||||
"description": "This event specifies the minimum level a user must have in order to perform a certain action. It also specifies the levels of each user in the room. If a ``user_id`` is in the ``users`` list, then that ``user_id`` has the associated power level. Otherwise they have the default level ``users_default``. If ``users_default`` is not supplied, it is assumed to be 0. The level required to send a certain event is governed by ``events``, ``state_default`` and ``events_default``. If an event type is specified in ``events``, then the user must have at least the level specified in order to send that event. If the event type is not supplied, it defaults to ``events_default`` for Message Events and ``state_default`` for State Events.",
|
"description": "This event specifies the minimum level a user must have in order to perform a certain action. It also specifies the levels of each user in the room. If a ``user_id`` is in the ``users`` list, then that ``user_id`` has the associated power level. Otherwise they have the default level ``users_default``. If ``users_default`` is not supplied, it is assumed to be 0. The level required to send a certain event is governed by ``events``, ``state_default`` and ``events_default``. If an event type is specified in ``events``, then the user must have at least the level specified in order to send that event. If the event type is not supplied, it defaults to ``events_default`` for Message Events and ``state_default`` for State Events.",
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"title": "Redaction",
|
"title": "Redaction",
|
||||||
"description": "Events can be redacted by either room or server admins. Redacting an event means that all keys not required by the protocol are stripped off, allowing admins to remove offensive or illegal content that may have been attached to any event. This cannot be undone, allowing server owners to physically delete the offending data. There is also a concept of a moderator hiding a message event, which can be undone, but cannot be applied to state events. The event that has been redacted is specified in the ``redacts`` event level key.",
|
"description": "Events can be redacted by either room or server admins. Redacting an event means that all keys not required by the protocol are stripped off, allowing admins to remove offensive or illegal content that may have been attached to any event. This cannot be undone, allowing server owners to physically delete the offending data. There is also a concept of a moderator hiding a message event, which can be undone, but cannot be applied to state events. The event that has been redacted is specified in the ``redacts`` event level key.",
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"title": "Topic",
|
"title": "Topic",
|
||||||
"description": "A topic is a short message detailing what is currently being discussed in the room. It can also be used as a way to display extra information about the room, which may not be suitable for the room name. The room topic can also be set when creating a room using ``/createRoom`` with the ``topic`` key.",
|
"description": "A topic is a short message detailing what is currently being discussed in the room. It can also be used as a way to display extra information about the room, which may not be suitable for the room name. The room topic can also be set when creating a room using ``/createRoom`` with the ``topic`` key.",
|
||||||
|
|
|
@ -631,49 +631,7 @@ Getting events for a room
|
||||||
|
|
||||||
There are several APIs provided to ``GET`` events for a room:
|
There are several APIs provided to ``GET`` events for a room:
|
||||||
|
|
||||||
``/rooms/<room id>/state/<event type>/<state key>``
|
{{rooms_http_api}}
|
||||||
Description:
|
|
||||||
Get the state event identified.
|
|
||||||
Response format:
|
|
||||||
A JSON object representing the state event **content**.
|
|
||||||
Example:
|
|
||||||
``/rooms/!room:domain.com/state/m.room.name`` returns ``{ "name": "Room name" }``
|
|
||||||
|
|
||||||
|/rooms/<room_id>/state|_
|
|
||||||
Description:
|
|
||||||
Get all state events for a room.
|
|
||||||
Response format:
|
|
||||||
``[ { state event }, { state event }, ... ]``
|
|
||||||
Example:
|
|
||||||
TODO-doc
|
|
||||||
|
|
||||||
|/rooms/<room_id>/members|_
|
|
||||||
Description:
|
|
||||||
Get all ``m.room.member`` state events.
|
|
||||||
Response format:
|
|
||||||
``{ "start": "<token>", "end": "<token>", "chunk": [ { m.room.member event }, ... ] }``
|
|
||||||
Example:
|
|
||||||
TODO-doc
|
|
||||||
|
|
||||||
|/rooms/<room_id>/messages|_
|
|
||||||
Description:
|
|
||||||
Get all events from the room's timeline. This API supports
|
|
||||||
pagination using ``from`` and ``to`` query parameters, coupled with the
|
|
||||||
``start`` and ``end`` tokens from an |initialSync|_ API.
|
|
||||||
|
|
||||||
Response format:
|
|
||||||
``{ "start": "<token>", "end": "<token>" }``
|
|
||||||
Example:
|
|
||||||
TODO-doc
|
|
||||||
|
|
||||||
|/rooms/<room_id>/initialSync|_
|
|
||||||
Description:
|
|
||||||
Get all relevant events for a room. This includes state events, paginated
|
|
||||||
non-state events and presence events.
|
|
||||||
Response format:
|
|
||||||
`` { TODO-doc } ``
|
|
||||||
Example:
|
|
||||||
TODO-doc
|
|
||||||
|
|
||||||
Redactions
|
Redactions
|
||||||
~~~~~~~~~~
|
~~~~~~~~~~
|
||||||
|
|
|
@ -103,6 +103,12 @@ class MatrixSections(Sections):
|
||||||
"login"
|
"login"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def render_rooms_http_api(self):
|
||||||
|
return self._render_http_api_group(
|
||||||
|
"rooms",
|
||||||
|
title_kind="+"
|
||||||
|
)
|
||||||
|
|
||||||
def render_room_events(self):
|
def render_room_events(self):
|
||||||
def filterFn(eventType):
|
def filterFn(eventType):
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -162,8 +162,8 @@ class MatrixUnits(Units):
|
||||||
# object with some keys; we'll add entries f.e one)
|
# object with some keys; we'll add entries f.e one)
|
||||||
if "schema" not in param:
|
if "schema" not in param:
|
||||||
raise Exception(
|
raise Exception(
|
||||||
"API endpoint group=%s path=%s method=%s param=%s"+
|
("API endpoint group=%s path=%s method=%s param=%s"+
|
||||||
" has no valid parameter value." % (
|
" has no valid parameter value.") % (
|
||||||
group_name, path, method, param
|
group_name, path, method, param
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -248,7 +248,8 @@ class MatrixUnits(Units):
|
||||||
"rows": [{
|
"rows": [{
|
||||||
"key": good_response["schema"].get("name", ""),
|
"key": good_response["schema"].get("name", ""),
|
||||||
"type": res_type,
|
"type": res_type,
|
||||||
"desc": res.get("description", "")
|
"desc": res.get("description", ""),
|
||||||
|
"req_str": ""
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
elif res_type and Units.prop(good_response, "schema/properties"):
|
elif res_type and Units.prop(good_response, "schema/properties"):
|
||||||
|
@ -258,6 +259,24 @@ class MatrixUnits(Units):
|
||||||
for table in res_tables:
|
for table in res_tables:
|
||||||
if "no-table" not in table:
|
if "no-table" not in table:
|
||||||
endpoint["res_tables"].append(table)
|
endpoint["res_tables"].append(table)
|
||||||
|
elif res_type and Units.prop(good_response, "schema/items"):
|
||||||
|
# response is an array:
|
||||||
|
# FIXME: Doesn't recurse at all.
|
||||||
|
schema = good_response["schema"]
|
||||||
|
array_type = Units.prop(schema, "items/type")
|
||||||
|
if Units.prop(schema, "items/allOf"):
|
||||||
|
array_type = (
|
||||||
|
Units.prop(schema, "items/title")
|
||||||
|
)
|
||||||
|
endpoint["res_tables"].append({
|
||||||
|
"title": schema.get("title", ""),
|
||||||
|
"rows": [{
|
||||||
|
"key": "N/A",
|
||||||
|
"type": ("[%s]" % array_type),
|
||||||
|
"desc": schema.get("description", ""),
|
||||||
|
"req_str": ""
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
|
||||||
endpoints.append(endpoint)
|
endpoints.append(endpoint)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue