]> gitweb.factorcode.org Git - factor.git/commitdiff
mediawiki.api: Fix documentation, improvements
authorGiftpflanze <gifti@tools.wmflabs.org>
Sun, 27 Mar 2022 19:59:10 +0000 (21:59 +0200)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 27 Mar 2022 23:24:46 +0000 (16:24 -0700)
extra/mediawiki/api/api-docs.factor
extra/mediawiki/api/api.factor

index 289da60adf05d930ff322ceb98083b2b5357e167..bbb01cf531817970501f69784c29a562a8188b69 100644 (file)
@@ -108,7 +108,7 @@ $nl
 "{"
 "    { \"action\" \"query\" }"
 "    { \"list\" \"watchlistraw\" }"
-"} api-query"
+"} api-call"
 "\"watchlistraw\" of" }
 { $code " { { \"list\" \"watchlistraw\" } } query" } } ;
 
index bff09f613fd79da80749a57d888a94f052c00a5d..04b9634fb025900481c1966d636f94ccf1a093b0 100644 (file)
@@ -1,9 +1,9 @@
 ! Copyright (C) 2021 Giftpflanze.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: arrays accessors assocs calendar combinators
-continuations formatting http http.client io json.reader kernel
-locals make math math.parser namespaces oauth1 prettyprint
-sequences strings system threads ;
+USING: arrays accessors assocs assocs.extras calendar
+combinators continuations formatting http http.client io
+json.reader kernel locals make math math.parser namespaces
+oauth1 prettyprint sequences strings system threads ;
 IN: mediawiki.api
 
 TUPLE: oauth-login consumer-token consumer-secret access-token
@@ -13,8 +13,14 @@ TUPLE: password-login username password ;
 C: <oauth-login> oauth-login
 C: <password-login> password-login
 
-SYMBOLS: basetimestamp endpoint botflag contact cookies
-curtimestamp oauth-login password-login csrf-token ;
+SYMBOLS: botflag contact cookies csrf-token endpoint oauth-login
+password-login ;
+
+<PRIVATE
+
+SYMBOLS: basetimestamp curtimestamp ;
+
+PRIVATE>
 
 t botflag set-global
 
@@ -135,8 +141,7 @@ PRIVATE>
     { { "action" "query" } } params assoc-union api-call dup
     dup "query" of [ nip ] when*
     "siprop" params key? [
-        params "prop" "list" "meta" [ of ] tri-curry@ tri or or
-        of
+        params { "prop" "list" "meta" } values-of sift first of
     ] unless swap ;
 
 PRIVATE>