aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatias Linares <matiaslina@gmail.com>2020-05-17 20:25:25 -0300
committerMatias Linares <matiaslina@gmail.com>2020-05-17 20:25:25 -0300
commit4b01ebdcaa8d7df0ec34c758ae9f3b8ec32fdcd0 (patch)
tree850bd8a62e481a4b8beb47f64d98eac5ff7ff946
parent4823babb29e8d2c2f65b775e72210aac7a2175c5 (diff)
downloadperl6-matrix-client-4b01ebdcaa8d7df0ec34c758ae9f3b8ec32fdcd0.tar.gz
Fix missing multi methods on the endpoints TODO generator
-rw-r--r--endpoints.md16
-rw-r--r--lib/Matrix/Client/MediaStore.rakumod4
-rwxr-xr-xscripts/load-docs.p65
3 files changed, 14 insertions, 11 deletions
diff --git a/endpoints.md b/endpoints.md
index 2ddf2c3..c77b6c4 100644
--- a/endpoints.md
+++ b/endpoints.md
@@ -30,7 +30,7 @@ from matrix.org. This will give you an overview about what's implemented in the
## Media
- [ ] GET - /_matrix/media/r0/config
-- [ ] GET - /_matrix/media/r0/download/{serverName}/{mediaId}
+- [X] GET - /_matrix/media/r0/download/{serverName}/{mediaId}
- [ ] GET - /_matrix/media/r0/download/{serverName}/{mediaId}/{fileName}
- [ ] GET - /_matrix/media/r0/preview_url
- [ ] GET - /_matrix/media/r0/thumbnail/{serverName}/{mediaId}
@@ -104,9 +104,9 @@ from matrix.org. This will give you an overview about what's implemented in the
- [X] GET - /_matrix/client/r0/rooms/{roomId}/joined_members
- [ ] GET - /_matrix/client/r0/rooms/{roomId}/members
- [X] GET - /_matrix/client/r0/rooms/{roomId}/messages
-- [ ] GET - /_matrix/client/r0/rooms/{roomId}/state
+- [X] GET - /_matrix/client/r0/rooms/{roomId}/state
- [ ] GET - /_matrix/client/r0/rooms/{roomId}/state/{eventType}/{stateKey}
-- [ ] GET - /_matrix/client/r0/sync
+- [X] GET - /_matrix/client/r0/sync
- [ ] GET - /_matrix/client/r0/user/{userId}/filter/{filterId}
- [ ] POST - /_matrix/client/r0/rooms/{roomId}/receipt/{receiptType}/{eventId}
- [ ] POST - /_matrix/client/r0/user/{userId}/filter
@@ -136,7 +136,7 @@ from matrix.org. This will give you an overview about what's implemented in the
## Session management
- [ ] GET - /_matrix/client/r0/login
-- [ ] POST - /_matrix/client/r0/login
+- [X] POST - /_matrix/client/r0/login
- [X] POST - /_matrix/client/r0/logout
- [ ] POST - /_matrix/client/r0/logout/all
@@ -151,18 +151,20 @@ from matrix.org. This will give you an overview about what's implemented in the
- [ ] GET - /_matrix/client/r0/register/available
- [ ] GET - /_matrix/client/r0/user/{userId}/account_data/{type}
- [ ] GET - /_matrix/client/r0/user/{userId}/rooms/{roomId}/account_data/{type}
-- [ ] GET - /_matrix/client/r0/user/{userId}/rooms/{roomId}/tags
+- [X] GET - /_matrix/client/r0/user/{userId}/rooms/{roomId}/tags
- [ ] POST - /_matrix/client/r0/account/3pid
+- [ ] POST - /_matrix/client/r0/account/3pid/bind
- [ ] POST - /_matrix/client/r0/account/3pid/delete
+- [ ] POST - /_matrix/client/r0/account/3pid/unbind
- [ ] POST - /_matrix/client/r0/account/deactivate
- [ ] POST - /_matrix/client/r0/account/password
- [X] POST - /_matrix/client/r0/register
- [ ] POST - /_matrix/client/r0/user_directory/search
-- [ ] PUT - /_matrix/client/r0/profile/{userId}/avatar_url
+- [X] PUT - /_matrix/client/r0/profile/{userId}/avatar_url
- [X] PUT - /_matrix/client/r0/profile/{userId}/displayname
- [ ] PUT - /_matrix/client/r0/user/{userId}/account_data/{type}
- [ ] PUT - /_matrix/client/r0/user/{userId}/rooms/{roomId}/account_data/{type}
-- [ ] PUT - /_matrix/client/r0/user/{userId}/rooms/{roomId}/tags/{tag}
+- [X] PUT - /_matrix/client/r0/user/{userId}/rooms/{roomId}/tags/{tag}
## VOIP
diff --git a/lib/Matrix/Client/MediaStore.rakumod b/lib/Matrix/Client/MediaStore.rakumod
index 34fbda3..7086083 100644
--- a/lib/Matrix/Client/MediaStore.rakumod
+++ b/lib/Matrix/Client/MediaStore.rakumod
@@ -46,14 +46,14 @@ method upload(IO::Path $path, Str $filename?, Str :$content-type is copy = "imag
$data<content_uri> // "";
}
-# GET - /_matrix/media/r0/download/{serverName}/{mediaId}
+#| GET - /_matrix/media/r0/download/{serverName}/{mediaId}
multi method download(Str $mxc-uri, :$allow-remote = True) {
my $mxc = self.parse-mxc($mxc-uri);
samewith($mxc<server-name>, $mxc<media-id>, :$allow-remote)
}
-# GET - /_matrix/media/r0/download/{serverName}/{mediaId}
+#| GET - /_matrix/media/r0/download/{serverName}/{mediaId}
multi method download(Str $server-name, Str $media-id, Bool :$allow-remote = True) {
my $response = $.get(
"/download/{$server-name}/{$media-id}",
diff --git a/scripts/load-docs.p6 b/scripts/load-docs.p6
index b20dd86..87ef0d4 100755
--- a/scripts/load-docs.p6
+++ b/scripts/load-docs.p6
@@ -34,8 +34,9 @@ sub get-api-docs {
sub MAIN(:$spec?) {
my %tags = get-api-docs;
- my $implemented-methods = (Matrix::Client, Matrix::Client::Room).map(*.^methods)
- .flat.map(
+ my $implemented-methods = (
+ Matrix::Client, Matrix::Client::Room, Matrix::Client::MediaStore
+ ).map(*.^methodsĀ».candidates).flat.map(
{
quietly try { .WHY.Str } or ""
}).grep(/_matrix/).SetHash;