From 47aaf852798acb30f32f3e3ae7ca0fe28e9ac18e Mon Sep 17 00:00:00 2001 From: Matias Linares Date: Sun, 14 Oct 2018 18:28:06 -0300 Subject: Add script to get all endpoints for documentation. Also the first endpoints.md with all the implemented methods --- endpoints.md | 164 +++++++++++++++++++++++++++++++++++++++++++++++++++ scripts/load-docs.p6 | 51 ++++++++++++++++ 2 files changed, 215 insertions(+) create mode 100644 endpoints.md create mode 100755 scripts/load-docs.p6 diff --git a/endpoints.md b/endpoints.md new file mode 100644 index 0000000..c4aeace --- /dev/null +++ b/endpoints.md @@ -0,0 +1,164 @@ +# List of implemented endpoints + +This list was generated by the `load-docs.p6` script that gets the data +from the [api-docs.json](https://matrix.org/docs/api/client-server/json/api-docs.json) +from matrix.org. This will give you an overview about what's implemented in the library. + +## Application service room directory management + +- [ ] PUT - /_matrix/client/r0/directory/list/appservice/{networkId}/{roomId} + +## Device management + +- [ ] DELETE - /_matrix/client/r0/devices/{deviceId} +- [ ] GET - /_matrix/client/r0/devices/{deviceId} +- [ ] PUT - /_matrix/client/r0/devices/{deviceId} +- [ ] GET - /_matrix/client/r0/devices +- [ ] POST - /_matrix/client/r0/delete_devices + +## End-to-end encryption + +- [ ] GET - /_matrix/client/r0/keys/changes +- [ ] POST - /_matrix/client/r0/keys/claim +- [ ] POST - /_matrix/client/r0/keys/upload +- [ ] POST - /_matrix/client/r0/keys/query + +## Media + +- [ ] GET - /_matrix/media/r0/download/{serverName}/{mediaId}/{fileName} +- [ ] GET - /_matrix/media/r0/config +- [ ] GET - /_matrix/media/r0/thumbnail/{serverName}/{mediaId} +- [ ] GET - /_matrix/media/r0/download/{serverName}/{mediaId} +- [x] POST - /_matrix/media/r0/upload +- [ ] GET - /_matrix/media/r0/preview_url + +## OpenID + +- [ ] POST - /_matrix/client/r0/user/{userId}/openid/request_token + +## Presence + +- [x] GET - /_matrix/client/r0/presence/{userId}/status +- [x] PUT - /_matrix/client/r0/presence/{userId}/status +- [ ] POST - /_matrix/client/r0/presence/list/{userId} +- [ ] GET - /_matrix/client/r0/presence/list/{userId} + +## Push notifications + +- [ ] GET - /_matrix/client/r0/pushers +- [ ] GET - /_matrix/client/r0/pushrules/ +- [ ] POST - /_matrix/client/r0/pushers/set +- [ ] GET - /_matrix/client/r0/notifications +- [ ] PUT - /_matrix/client/r0/pushrules/{scope}/{kind}/{ruleId}/actions +- [ ] PUT - /_matrix/client/r0/pushrules/{scope}/{kind}/{ruleId}/enabled +- [ ] PUT - /_matrix/client/r0/pushrules/{scope}/{kind}/{ruleId} +- [ ] GET - /_matrix/client/r0/pushrules/{scope}/{kind}/{ruleId} +- [ ] DELETE - /_matrix/client/r0/pushrules/{scope}/{kind}/{ruleId} + +## Read Markers + +- [ ] POST - /_matrix/client/r0/rooms/{roomId}/read_markers + +## Reporting content + +- [ ] POST - /_matrix/client/r0/rooms/{roomId}/report/{eventId} + +## Room creation + +- [x] POST - /_matrix/client/r0/createRoom + +## Room directory + +- [x] PUT - /_matrix/client/r0/directory/room/{roomAlias} +- [x] DELETE - /_matrix/client/r0/directory/room/{roomAlias} +- [x] GET - /_matrix/client/r0/directory/room/{roomAlias} + +## Room discovery + +- [ ] POST - /_matrix/client/r0/publicRooms +- [x] GET - /_matrix/client/r0/publicRooms + +## Room membership + +- [ ] POST - /_matrix/client/r0/rooms/{roomId}/join +- [ ] POST - /_matrix/client/r0/join/{roomIdOrAlias} +- [ ] POST - /_matrix/client/r0/rooms/{roomId}/kick +- [ ] POST - /_matrix/client/r0/rooms/{roomId}/leave +- [x] GET - /_matrix/client/r0/joined_rooms +- [ ] POST - /_matrix/client/r0/rooms/{roomId}/invite +- [ ] POST - /_matrix/client/r0/rooms/{roomId}/unban +- [ ] POST - /_matrix/client/r0/rooms/{roomId}/ban +- [ ] POST - /_matrix/client/r0/rooms/{roomId}/forget +- [ ] POST - /_matrix/client/r0/rooms/{roomId}/invite + +## Room participation + +- [ ] GET - /_matrix/client/r0/rooms/{roomId}/state/{eventType}/{stateKey} +- [x] PUT - /_matrix/client/r0/rooms/{roomId}/state/{eventType}/{stateKey} +- [x] GET - /_matrix/client/r0/rooms/{roomId}/state +- [ ] GET - /_matrix/client/r0/rooms/{roomId}/context/{eventId} +- [ ] GET - /_matrix/client/r0/events +- [ ] GET - /_matrix/client/r0/rooms/{roomId}/joined_members +- [ ] POST - /_matrix/client/r0/user/{userId}/filter +- [ ] GET - /_matrix/client/r0/rooms/{roomId}/initialSync +- [x] PUT - /_matrix/client/r0/rooms/{roomId}/send/{eventType}/{txnId} (partial) +- [ ] GET - /_matrix/client/r0/initialSync (deprecated) +- [x] GET - /_matrix/client/r0/rooms/{roomId}/messages +- [ ] GET - /_matrix/client/r0/rooms/{roomId}/event/{eventId} +- [ ] GET - /_matrix/client/r0/user/{userId}/filter/{filterId} +- [x] GET - /_matrix/client/r0/sync +- [ ] GET - /_matrix/client/r0/rooms/{roomId}/members +- [ ] GET - /_matrix/client/r0/events/{eventId} +- [ ] PUT - /_matrix/client/r0/rooms/{roomId}/redact/{eventId}/{txnId} +- [ ] POST - /_matrix/client/r0/rooms/{roomId}/receipt/{receiptType}/{eventId} +- [x] PUT - /_matrix/client/r0/rooms/{roomId}/state/{eventType} +- [x] GET - /_matrix/client/r0/rooms/{roomId}/state/{eventType} +- [ ] PUT - /_matrix/client/r0/rooms/{roomId}/typing/{userId} + +## Search + +- [ ] POST - /_matrix/client/r0/search + +## Send-to-Device messaging + +- [ ] PUT - /_matrix/client/r0/sendToDevice/{eventType}/{txnId} + +## Server administration + +- [ ] GET - /.well-known/matrix/client +- [ ] GET - /_matrix/client/versions +- [ ] GET - /_matrix/client/r0/admin/whois/{userId} + +## Session management + +- [x] POST - /_matrix/client/r0/logout +- [ ] GET - /_matrix/client/r0/login +- [x] POST - /_matrix/client/r0/login +- [ ] POST - /_matrix/client/r0/logout/all + +## User data + +- [ ] POST - /_matrix/client/r0/account/password +- [ ] POST - /_matrix/client/r0/user_directory/search +- [ ] PUT - /_matrix/client/r0/user/{userId}/rooms/{roomId}/account_data/{type} +- [x] GET - /_matrix/client/r0/profile/{userId}/displayname +- [x] PUT - /_matrix/client/r0/profile/{userId}/displayname +- [x] GET - /_matrix/client/r0/profile/{userId}/avatar_url +- [x] PUT - /_matrix/client/r0/profile/{userId}/avatar_url +- [x] GET - /_matrix/client/r0/account/whoami +- [ ] GET - /_matrix/client/r0/register/available +- [x] POST - /_matrix/client/r0/register +- [x] GET - /_matrix/client/r0/profile/{userId} +- [ ] GET - /_matrix/client/r0/account/3pid +- [ ] POST - /_matrix/client/r0/account/3pid +- [ ] PUT - /_matrix/client/r0/user/{userId}/account_data/{type} +- [ ] PUT - /_matrix/client/r0/user/{userId}/rooms/{roomId}/tags/{tag} +- [ ] DELETE - /_matrix/client/r0/user/{userId}/rooms/{roomId}/tags/{tag} +- [ ] GET - /_matrix/client/r0/user/{userId}/rooms/{roomId}/tags +- [ ] POST - /_matrix/client/r0/account/deactivate +- [ ] POST - /_matrix/client/r0/account/3pid/delete + +## VOIP + +- [ ] GET - /_matrix/client/r0/voip/turnServer + diff --git a/scripts/load-docs.p6 b/scripts/load-docs.p6 new file mode 100755 index 0000000..d3a1f81 --- /dev/null +++ b/scripts/load-docs.p6 @@ -0,0 +1,51 @@ +#!/usr/bin/env perl6 +use v6; +use HTTP::UserAgent; +use JSON::Fast; + +sub get-api-docs { + my $url = "https://matrix.org/docs/api/client-server/json/api-docs.json"; + my $ua = HTTP::UserAgent.new; + + my $res = $ua.get($url); + die "Cannot get response $res" unless $res.is-success; + + my $data = from-json($res.content); + + my %tags; + + for $data -> $path { + $path.kv.map: -> $p, $methods { + for $methods.kv -> $method, $description { + for $description -> $tag { + unless %tags{$tag}:exists { + %tags{$tag} = Array.new; + } + %tags{$tag}.push("{$method.uc} - $p"); + } + } + } + } + + %tags +} + +sub MAIN(:$spec?) { + my %tags = get-api-docs; + for %tags.sort -> $pair { + my $tag = $pair.key; + my $methods = $pair.value; + say qq:to/EOF/; + # $tag + EOF + + for $methods.Seq -> $m { + my Str $method = $m; + if $spec { + $method = $m.subst(/unstable/, $spec) + } + say "- [ ] " ~ $method; + } + say ""; + } +} -- cgit v1.2.3-70-g09d2