mirror of
https://github.com/matrix-construct/construct
synced 2025-01-13 08:23:56 +01:00
modules/client: Cleanup some numbering and descriptions.
This commit is contained in:
parent
050eacd142
commit
27a539f941
20 changed files with 173 additions and 137 deletions
|
@ -15,7 +15,7 @@ using namespace ircd;
|
|||
mapi::header
|
||||
IRCD_MODULE
|
||||
{
|
||||
"registers the resource 'client/account' to handle requests"
|
||||
"Client 3.4,3.5,3.6 :Account"
|
||||
};
|
||||
|
||||
resource
|
||||
|
@ -23,6 +23,6 @@ account_resource
|
|||
{
|
||||
"/_matrix/client/r0/account",
|
||||
{
|
||||
"Account management (3.3)"
|
||||
"(3.4,3.5,3.6) Account management"
|
||||
}
|
||||
};
|
||||
|
|
|
@ -10,21 +10,23 @@
|
|||
|
||||
using namespace ircd;
|
||||
|
||||
resource createroom
|
||||
mapi::header
|
||||
IRCD_MODULE
|
||||
{
|
||||
"Client 7.1.1 :Create Room"
|
||||
};
|
||||
|
||||
resource
|
||||
createroom
|
||||
{
|
||||
"/_matrix/client/r0/createRoom",
|
||||
{
|
||||
"Create a new room with various configuration options. (7.1.1)"
|
||||
"(7.1.1) Create a new room with various configuration options."
|
||||
}
|
||||
};
|
||||
|
||||
mapi::header IRCD_MODULE
|
||||
{
|
||||
"registers the resource 'client/createRoom' to handle requests"
|
||||
};
|
||||
|
||||
resource::response
|
||||
room_create(client &client, const resource::request &request)
|
||||
post__createroom(client &client, const resource::request &request)
|
||||
try
|
||||
{
|
||||
const auto name
|
||||
|
@ -78,9 +80,10 @@ catch(const db::not_found &e)
|
|||
};
|
||||
}
|
||||
|
||||
resource::method post_method
|
||||
resource::method
|
||||
post_method
|
||||
{
|
||||
createroom, "POST", room_create,
|
||||
createroom, "POST", post__createroom,
|
||||
{
|
||||
post_method.REQUIRES_AUTH
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ using namespace ircd;
|
|||
mapi::header
|
||||
IRCD_MODULE
|
||||
{
|
||||
"Client-Server 11.9 Device Management"
|
||||
"Client 11.9 Device Management"
|
||||
};
|
||||
|
||||
ircd::resource
|
||||
|
|
|
@ -10,9 +10,16 @@
|
|||
|
||||
using namespace ircd;
|
||||
|
||||
resource directory_room_resource
|
||||
mapi::header
|
||||
IRCD_MODULE
|
||||
{
|
||||
"/_matrix/client/r0/directory/room",
|
||||
"Client 7.2 :Room aliases"
|
||||
};
|
||||
|
||||
resource
|
||||
directory_room_resource
|
||||
{
|
||||
"/_matrix/client/r0/directory/room/",
|
||||
{
|
||||
"(7.2) Room aliases",
|
||||
directory_room_resource.DIRECTORY
|
||||
|
@ -33,12 +40,8 @@ get_directory_room(client &client, const resource::request &request)
|
|||
};
|
||||
}
|
||||
|
||||
resource::method directory_room_get
|
||||
resource::method
|
||||
directory_room_get
|
||||
{
|
||||
directory_room_resource, "GET", get_directory_room
|
||||
};
|
||||
|
||||
mapi::header IRCD_MODULE
|
||||
{
|
||||
"registers the resource 'client/directory/room' to manage the Matrix room directory"
|
||||
};
|
||||
|
|
|
@ -10,7 +10,14 @@
|
|||
|
||||
using namespace ircd;
|
||||
|
||||
resource events_resource
|
||||
mapi::header
|
||||
IRCD_MODULE
|
||||
{
|
||||
"Client 6.2.2 :Events"
|
||||
};
|
||||
|
||||
resource
|
||||
events_resource
|
||||
{
|
||||
"/_matrix/client/r0/events",
|
||||
{
|
||||
|
@ -19,7 +26,7 @@ resource events_resource
|
|||
};
|
||||
|
||||
resource::response
|
||||
get_events(client &client, const resource::request &request)
|
||||
get__events(client &client, const resource::request &request)
|
||||
{
|
||||
const m::room::id &room_id
|
||||
{
|
||||
|
@ -54,12 +61,8 @@ get_events(client &client, const resource::request &request)
|
|||
};
|
||||
}
|
||||
|
||||
resource::method method_get
|
||||
resource::method
|
||||
method_get
|
||||
{
|
||||
events_resource, "GET", get_events
|
||||
};
|
||||
|
||||
mapi::header IRCD_MODULE
|
||||
{
|
||||
"registers the resource 'client/events' and hosts the events database"
|
||||
events_resource, "GET", get__events
|
||||
};
|
||||
|
|
|
@ -10,22 +10,25 @@
|
|||
|
||||
using namespace ircd;
|
||||
|
||||
resource join_resource
|
||||
mapi::header
|
||||
IRCD_MODULE
|
||||
{
|
||||
"Client 7.4.2.3 :Join"
|
||||
};
|
||||
|
||||
resource
|
||||
join_resource
|
||||
{
|
||||
"/_matrix/client/r0/join/", resource::opts
|
||||
{
|
||||
"join",
|
||||
"(7.4.2.3) Join room_id or alias.",
|
||||
resource::DIRECTORY,
|
||||
}
|
||||
};
|
||||
|
||||
mapi::header IRCD_MODULE
|
||||
{
|
||||
"registers the resource 'client/join'"
|
||||
};
|
||||
|
||||
resource::response
|
||||
post_join(client &client, const resource::request &request)
|
||||
post__join(client &client,
|
||||
const resource::request &request)
|
||||
{
|
||||
if(request.parv.size() < 1)
|
||||
throw http::error
|
||||
|
@ -51,7 +54,7 @@ post_join(client &client, const resource::request &request)
|
|||
|
||||
resource::method method_post
|
||||
{
|
||||
join_resource, "POST", post_join,
|
||||
join_resource, "POST", post__join,
|
||||
{
|
||||
method_post.REQUIRES_AUTH
|
||||
}
|
||||
|
|
|
@ -10,12 +10,14 @@
|
|||
|
||||
using namespace ircd;
|
||||
|
||||
mapi::header IRCD_MODULE
|
||||
mapi::header
|
||||
IRCD_MODULE
|
||||
{
|
||||
"registers the resource 'client/keys'"
|
||||
"Client 11.10.2 :End-to-End Encryption Keys"
|
||||
};
|
||||
|
||||
ircd::resource keys_upload_resource
|
||||
ircd::resource
|
||||
keys_upload_resource
|
||||
{
|
||||
"/_matrix/client/unstable/keys/upload/", resource::opts
|
||||
{
|
||||
|
@ -25,8 +27,8 @@ ircd::resource keys_upload_resource
|
|||
};
|
||||
|
||||
resource::response
|
||||
post_keys_upload(client &client,
|
||||
const resource::request &request)
|
||||
post__keys_upload(client &client,
|
||||
const resource::request &request)
|
||||
{
|
||||
return resource::response
|
||||
{
|
||||
|
@ -34,9 +36,10 @@ post_keys_upload(client &client,
|
|||
};
|
||||
}
|
||||
|
||||
resource::method method_post
|
||||
resource::method
|
||||
method_post
|
||||
{
|
||||
keys_upload_resource, "POST", post_keys_upload,
|
||||
keys_upload_resource, "POST", post__keys_upload,
|
||||
{
|
||||
method_post.REQUIRES_AUTH
|
||||
}
|
||||
|
|
|
@ -10,12 +10,19 @@
|
|||
|
||||
using namespace ircd;
|
||||
|
||||
resource login_resource
|
||||
mapi::header
|
||||
IRCD_MODULE
|
||||
{
|
||||
"Client 3.3 :Login"
|
||||
};
|
||||
|
||||
resource
|
||||
login_resource
|
||||
{
|
||||
"/_matrix/client/r0/login",
|
||||
{
|
||||
"Authenticates the user by password, and issues an access token "
|
||||
"they can use to authorize themself in subsequent requests. (3.2.2)"
|
||||
"(3.3.1) Authenticates the user by password, and issues an access token "
|
||||
"they can use to authorize themself in subsequent requests."
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -149,12 +156,8 @@ get_login(client &client, const resource::request &request)
|
|||
};
|
||||
}
|
||||
|
||||
resource::method method_get
|
||||
resource::method
|
||||
method_get
|
||||
{
|
||||
login_resource, "GET", get_login
|
||||
};
|
||||
|
||||
mapi::header IRCD_MODULE
|
||||
{
|
||||
"registers the resource 'client/login' to handle requests"
|
||||
};
|
||||
|
|
|
@ -10,17 +10,24 @@
|
|||
|
||||
using namespace ircd;
|
||||
|
||||
resource logout_resource
|
||||
mapi::header
|
||||
IRCD_MODULE
|
||||
{
|
||||
"Client 3.3.2 :Logout"
|
||||
};
|
||||
|
||||
resource
|
||||
logout_resource
|
||||
{
|
||||
"/_matrix/client/r0/logout",
|
||||
{
|
||||
"Invalidates an existing access token, so that it can no longer be used for "
|
||||
"authorization. (3.2.3)"
|
||||
"(3.3.2) Invalidates an existing access token, so that it can no"
|
||||
" longer be used for authorization."
|
||||
}
|
||||
};
|
||||
|
||||
resource::response
|
||||
logout(client &client, const resource::request &request)
|
||||
post__logout(client &client, const resource::request &request)
|
||||
{
|
||||
const auto &access_token
|
||||
{
|
||||
|
@ -33,15 +40,11 @@ logout(client &client, const resource::request &request)
|
|||
};
|
||||
}
|
||||
|
||||
resource::method post_method
|
||||
resource::method
|
||||
post_method
|
||||
{
|
||||
logout_resource, "POST", logout,
|
||||
logout_resource, "POST", post__logout,
|
||||
{
|
||||
post_method.REQUIRES_AUTH
|
||||
}
|
||||
};
|
||||
|
||||
mapi::header IRCD_MODULE
|
||||
{
|
||||
"registers the resource 'client/logout' to handle requests"
|
||||
};
|
||||
|
|
|
@ -10,23 +10,25 @@
|
|||
|
||||
using namespace ircd;
|
||||
|
||||
mapi::header IRCD_MODULE
|
||||
mapi::header
|
||||
IRCD_MODULE
|
||||
{
|
||||
"registers the resource 'client/presence'"
|
||||
"Client 11.6 :Presence"
|
||||
};
|
||||
|
||||
ircd::resource presence_resource
|
||||
ircd::resource
|
||||
presence_resource
|
||||
{
|
||||
"/_matrix/client/r0/presence/", resource::opts
|
||||
{
|
||||
"Presence",
|
||||
"(11.6.2) Presence",
|
||||
resource::DIRECTORY,
|
||||
}
|
||||
};
|
||||
|
||||
resource::response
|
||||
put_presence(client &client,
|
||||
const resource::request &request)
|
||||
put__presence(client &client,
|
||||
const resource::request &request)
|
||||
{
|
||||
return resource::response
|
||||
{
|
||||
|
@ -34,9 +36,10 @@ put_presence(client &client,
|
|||
};
|
||||
}
|
||||
|
||||
resource::method method_put
|
||||
resource::method
|
||||
method_put
|
||||
{
|
||||
presence_resource, "PUT", put_presence,
|
||||
presence_resource, "PUT", put__presence,
|
||||
{
|
||||
method_put.REQUIRES_AUTH
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ using namespace ircd;
|
|||
mapi::header
|
||||
IRCD_MODULE
|
||||
{
|
||||
"Client-Server 8.2 Profiles"
|
||||
"Client 8.2 :Profiles"
|
||||
};
|
||||
|
||||
ircd::resource
|
||||
|
|
|
@ -10,12 +10,18 @@
|
|||
|
||||
using namespace ircd;
|
||||
|
||||
resource publicrooms_resource
|
||||
mapi::header
|
||||
IRCD_MODULE
|
||||
{
|
||||
"Client 7.5 :Public Rooms"
|
||||
};
|
||||
|
||||
resource
|
||||
publicrooms_resource
|
||||
{
|
||||
"/_matrix/client/r0/publicRooms",
|
||||
{
|
||||
"Lists the public rooms on the server. "
|
||||
"This API returns paginated responses. (7.5)"
|
||||
"(7.5) Lists the public rooms on the server. "
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -31,7 +37,8 @@ m::room public_
|
|||
};
|
||||
|
||||
resource::response
|
||||
get_publicrooms(client &client, const resource::request &request)
|
||||
get__publicrooms(client &client,
|
||||
const resource::request &request)
|
||||
{
|
||||
return resource::response
|
||||
{
|
||||
|
@ -39,12 +46,8 @@ get_publicrooms(client &client, const resource::request &request)
|
|||
};
|
||||
}
|
||||
|
||||
resource::method post
|
||||
resource::method
|
||||
get_method
|
||||
{
|
||||
publicrooms_resource, "GET", get_publicrooms
|
||||
};
|
||||
|
||||
mapi::header IRCD_MODULE
|
||||
{
|
||||
"registers the resource 'client/publicrooms' to manage Matrix rooms"
|
||||
publicrooms_resource, "GET", get__publicrooms
|
||||
};
|
||||
|
|
|
@ -10,23 +10,25 @@
|
|||
|
||||
using namespace ircd;
|
||||
|
||||
mapi::header IRCD_MODULE
|
||||
mapi::header
|
||||
IRCD_MODULE
|
||||
{
|
||||
"registers the resource 'client/pushers'"
|
||||
"Client 11.12 :Pushers"
|
||||
};
|
||||
|
||||
ircd::resource pushers_resource
|
||||
ircd::resource
|
||||
pushers_resource
|
||||
{
|
||||
"/_matrix/client/r0/pushers/", resource::opts
|
||||
{
|
||||
"pushers",
|
||||
"(11.12.1) Pushers",
|
||||
resource::DIRECTORY,
|
||||
}
|
||||
};
|
||||
|
||||
resource::response
|
||||
get_pushers(client &client,
|
||||
const resource::request &request)
|
||||
get__pushers(client &client,
|
||||
const resource::request &request)
|
||||
{
|
||||
return resource::response
|
||||
{
|
||||
|
@ -34,9 +36,10 @@ get_pushers(client &client,
|
|||
};
|
||||
}
|
||||
|
||||
resource::method method_get
|
||||
resource::method
|
||||
method_get
|
||||
{
|
||||
pushers_resource, "GET", get_pushers,
|
||||
pushers_resource, "GET", get__pushers,
|
||||
{
|
||||
method_get.REQUIRES_AUTH
|
||||
}
|
||||
|
|
|
@ -10,18 +10,19 @@
|
|||
|
||||
using namespace ircd;
|
||||
|
||||
static const auto description
|
||||
{R"(
|
||||
Retrieve all push rulesets for this user. Clients can "drill-down" on the rulesets by
|
||||
suffixing a scope to this path e.g. /pushrules/global/. This will return a subset of this data
|
||||
under the specified key e.g. the global key. (11.10.1.4.6)
|
||||
)"};
|
||||
mapi::header
|
||||
IRCD_MODULE
|
||||
{
|
||||
"Client 11.12.1.5 :Push Rules API"
|
||||
};
|
||||
|
||||
resource pushrules
|
||||
resource
|
||||
pushrules
|
||||
{
|
||||
"/_matrix/client/r0/pushrules",
|
||||
{
|
||||
description
|
||||
"(11.12.1.5) Clients can retrieve, add, modify and remove push"
|
||||
" rules globally or per-device"
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -49,12 +50,8 @@ catch(...)
|
|||
throw;
|
||||
}
|
||||
|
||||
resource::method get_method
|
||||
resource::method
|
||||
get_method
|
||||
{
|
||||
pushrules, "GET", get_pushrules
|
||||
};
|
||||
|
||||
mapi::header IRCD_MODULE
|
||||
{
|
||||
"registers the resource 'client/pushrules' to handle requests"
|
||||
};
|
||||
|
|
|
@ -10,6 +10,12 @@
|
|||
|
||||
using namespace ircd;
|
||||
|
||||
mapi::header
|
||||
IRCD_MODULE
|
||||
{
|
||||
"Client 3.4.1 :Register"
|
||||
};
|
||||
|
||||
namespace { namespace name
|
||||
{
|
||||
constexpr const auto username {"username"};
|
||||
|
@ -185,11 +191,6 @@ resource::method post
|
|||
register_resource, "POST", handle_post
|
||||
};
|
||||
|
||||
mapi::header IRCD_MODULE
|
||||
{
|
||||
"registers the resource 'client/register' to handle requests"
|
||||
};
|
||||
|
||||
void
|
||||
validate_user_id(const m::id::user &user_id)
|
||||
{
|
||||
|
|
|
@ -15,7 +15,7 @@ using namespace ircd;
|
|||
mapi::header
|
||||
IRCD_MODULE
|
||||
{
|
||||
"registers the resource 'client/rooms/'"
|
||||
"Client 7 :Rooms"
|
||||
};
|
||||
|
||||
resource
|
||||
|
@ -23,7 +23,7 @@ rooms_resource
|
|||
{
|
||||
"/_matrix/client/r0/rooms/",
|
||||
{
|
||||
"Rooms (7.0)",
|
||||
"(7.0) Rooms",
|
||||
resource::DIRECTORY,
|
||||
}
|
||||
};
|
||||
|
|
|
@ -13,7 +13,7 @@ using namespace ircd;
|
|||
const auto sync_description
|
||||
{R"(
|
||||
|
||||
6.2.
|
||||
6.2.1
|
||||
|
||||
Synchronise the client's state with the latest state on the server. Clients
|
||||
use this API when they first log in to get an initial snapshot of the state
|
||||
|
@ -59,9 +59,10 @@ const auto on_unload{[]
|
|||
synchronizer_timeout_context.join();
|
||||
}};
|
||||
|
||||
mapi::header IRCD_MODULE
|
||||
mapi::header
|
||||
IRCD_MODULE
|
||||
{
|
||||
"registers the resource 'client/sync' to handle requests.",
|
||||
"Client 6.2.1 :Sync",
|
||||
nullptr,
|
||||
on_unload
|
||||
};
|
||||
|
@ -74,7 +75,8 @@ initial_sync(client &client,
|
|||
const string_view &set_presence);
|
||||
|
||||
resource::response
|
||||
sync(client &client, const resource::request &request)
|
||||
sync(client &client,
|
||||
const resource::request &request)
|
||||
{
|
||||
// 6.2.1 The ID of a filter created using the filter API or a filter JSON object
|
||||
// encoded as a string. The server will detect whether it is an ID or a JSON object
|
||||
|
|
|
@ -15,7 +15,7 @@ using namespace ircd;
|
|||
mapi::header
|
||||
IRCD_MODULE
|
||||
{
|
||||
"registers the resource 'client/user' to handle requests"
|
||||
"Client X.X :User endpoints"
|
||||
};
|
||||
|
||||
resource
|
||||
|
|
|
@ -10,11 +10,18 @@
|
|||
|
||||
using namespace ircd;
|
||||
|
||||
resource versions_resource
|
||||
mapi::header
|
||||
IRCD_MODULE
|
||||
{
|
||||
"Client 2.1 :Versions"
|
||||
};
|
||||
|
||||
resource
|
||||
versions_resource
|
||||
{
|
||||
"/_matrix/client/versions", resource::opts
|
||||
{
|
||||
"Gets the versions of the specification supported by the server (2.1)"
|
||||
"(2.1) Gets the versions of the specification supported by the server."
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -24,7 +31,7 @@ get_versions(client &client,
|
|||
{
|
||||
static const json::object object
|
||||
{
|
||||
R"({"versions":["r2.0.0"]})"
|
||||
R"({"versions":["r0.3.0"]})"
|
||||
};
|
||||
|
||||
return resource::response
|
||||
|
@ -33,12 +40,8 @@ get_versions(client &client,
|
|||
};
|
||||
}
|
||||
|
||||
resource::method getter
|
||||
resource::method
|
||||
getter
|
||||
{
|
||||
versions_resource, "GET", get_versions
|
||||
};
|
||||
|
||||
mapi::header IRCD_MODULE
|
||||
{
|
||||
"registers the resource 'client/versions' to handle requests"
|
||||
};
|
||||
|
|
|
@ -10,22 +10,24 @@
|
|||
|
||||
using namespace ircd;
|
||||
|
||||
mapi::header IRCD_MODULE
|
||||
mapi::header
|
||||
IRCD_MODULE
|
||||
{
|
||||
"registers the resource 'client/voip/turnserver' to handle requests."
|
||||
"Client 11.3 :Voice over IP"
|
||||
};
|
||||
|
||||
resource turnserver_resource
|
||||
resource
|
||||
turnserver_resource
|
||||
{
|
||||
"/_matrix/client/r0/voip/turnServer",
|
||||
{
|
||||
"(11.3.3) "
|
||||
"This API provides credentials for the client to use when initiating calls."
|
||||
"(11.3.3) This API provides credentials for the client to use"
|
||||
" when initiating calls."
|
||||
}
|
||||
};
|
||||
|
||||
resource::response
|
||||
get_turnserver(client &client, const resource::request &request)
|
||||
get__turnserver(client &client, const resource::request &request)
|
||||
{
|
||||
return resource::response
|
||||
{
|
||||
|
@ -33,9 +35,10 @@ get_turnserver(client &client, const resource::request &request)
|
|||
};
|
||||
}
|
||||
|
||||
resource::method turnserver_get
|
||||
resource::method
|
||||
turnserver_get
|
||||
{
|
||||
turnserver_resource, "GET", get_turnserver,
|
||||
turnserver_resource, "GET", get__turnserver,
|
||||
{
|
||||
//get_turnserver.REQUIRES_AUTH
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue