From 4b01ebdcaa8d7df0ec34c758ae9f3b8ec32fdcd0 Mon Sep 17 00:00:00 2001 From: Matias Linares Date: Sun, 17 May 2020 20:25:25 -0300 Subject: Fix missing multi methods on the endpoints TODO generator --- scripts/load-docs.p6 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scripts') 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; -- cgit v1.2.3-70-g09d2 From ab2a237e5cff43f9b8cd806b7e9e271ffb01b461 Mon Sep 17 00:00:00 2001 From: Matias Linares Date: Sun, 6 Sep 2020 19:51:23 -0300 Subject: Update endpoints script. Show the total of endpoints implemented at the end --- endpoints.md | 12 ++++++++++-- lib/Matrix/Client/MediaStore.rakumod | 1 + scripts/load-docs.p6 | 12 ++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/endpoints.md b/endpoints.md index c77b6c4..f47105b 100644 --- a/endpoints.md +++ b/endpoints.md @@ -29,7 +29,7 @@ from matrix.org. This will give you an overview about what's implemented in the ## Media -- [ ] GET - /_matrix/media/r0/config +- [X] GET - /_matrix/media/r0/config - [X] GET - /_matrix/media/r0/download/{serverName}/{mediaId} - [ ] GET - /_matrix/media/r0/download/{serverName}/{mediaId}/{fileName} - [ ] GET - /_matrix/media/r0/preview_url @@ -52,6 +52,8 @@ from matrix.org. This will give you an overview about what's implemented in the - [ ] GET - /_matrix/client/r0/pushers - [ ] GET - /_matrix/client/r0/pushrules/ - [ ] GET - /_matrix/client/r0/pushrules/{scope}/{kind}/{ruleId} +- [ ] GET - /_matrix/client/r0/pushrules/{scope}/{kind}/{ruleId}/actions +- [ ] GET - /_matrix/client/r0/pushrules/{scope}/{kind}/{ruleId}/enabled - [ ] POST - /_matrix/client/r0/pushers/set - [ ] PUT - /_matrix/client/r0/pushrules/{scope}/{kind}/{ruleId} - [ ] PUT - /_matrix/client/r0/pushrules/{scope}/{kind}/{ruleId}/actions @@ -73,6 +75,7 @@ from matrix.org. This will give you an overview about what's implemented in the - [X] DELETE - /_matrix/client/r0/directory/room/{roomAlias} - [X] GET - /_matrix/client/r0/directory/room/{roomAlias} +- [ ] GET - /_matrix/client/r0/rooms/{roomId}/aliases - [X] PUT - /_matrix/client/r0/directory/room/{roomAlias} ## Room discovery @@ -115,7 +118,7 @@ from matrix.org. This will give you an overview about what's implemented in the - [X] PUT - /_matrix/client/r0/rooms/{roomId}/state/{eventType}/{stateKey} - [ ] PUT - /_matrix/client/r0/rooms/{roomId}/typing/{userId} -## Room ugprades +## Room upgrades - [ ] POST - /_matrix/client/r0/rooms/{roomId}/upgrade @@ -170,3 +173,8 @@ from matrix.org. This will give you an overview about what's implemented in the - [ ] GET - /_matrix/client/r0/voip/turnServer + +# Endpoint completion + +0.378641% - (39/103) + diff --git a/lib/Matrix/Client/MediaStore.rakumod b/lib/Matrix/Client/MediaStore.rakumod index 7afa9e3..cb59626 100644 --- a/lib/Matrix/Client/MediaStore.rakumod +++ b/lib/Matrix/Client/MediaStore.rakumod @@ -70,6 +70,7 @@ multi method download(Str $server-name, Str $media-id, Bool :$allow-remote = Tru ) } +#| GET - /_matrix/media/r0/config method config(--> Matrix::Response::MediaStore::Config) { my $response = $.get("/config"); Matrix::Response::MediaStore::Config.new(from-json($response.content)) diff --git a/scripts/load-docs.p6 b/scripts/load-docs.p6 index 87ef0d4..2392a3a 100755 --- a/scripts/load-docs.p6 +++ b/scripts/load-docs.p6 @@ -34,6 +34,8 @@ sub get-api-docs { sub MAIN(:$spec?) { my %tags = get-api-docs; + my $total = 0; + my $completed = 0; my $implemented-methods = ( Matrix::Client, Matrix::Client::Room, Matrix::Client::MediaStore ).map(*.^methodsĀ».candidates).flat.map( @@ -58,6 +60,9 @@ sub MAIN(:$spec?) { for $methods.Seq.sort -> $m { my Str $method = $m.trim; my $checked = $implemented-methods{$m} ?? "X" !! " "; + $completed++ if $implemented-methods{$m}; + $total++; + if $spec { $method = $m.subst(/unstable/, $spec) } @@ -65,4 +70,11 @@ sub MAIN(:$spec?) { } say ""; } + + say qq:to/EOF/; + + # Endpoint completion + + {$completed/$total}% - ($completed/$total) + EOF } -- cgit v1.2.3-70-g09d2