mediawiktory 0.0.3 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.dokaz +1 -0
- data/.rubocop_todo.yml +16 -0
- data/.yardopts +2 -0
- data/CHANGELOG.md +10 -4
- data/CONTRIBUTING.md +6 -9
- data/README.md +153 -72
- data/bin/mediawiktory-gen +35 -0
- data/lib/media_wiktory.rb +2 -0
- data/lib/mediawiktory.rb +13 -14
- data/lib/mediawiktory/generator.rb +107 -0
- data/lib/mediawiktory/generator/api.rb +75 -0
- data/lib/mediawiktory/generator/module.rb +105 -0
- data/lib/mediawiktory/generator/param.rb +271 -0
- data/lib/mediawiktory/generator/renderable.rb +59 -0
- data/lib/mediawiktory/generator/templates/_action_method.erb +20 -0
- data/lib/mediawiktory/generator/templates/_module_in_param_docs.erb +2 -0
- data/lib/mediawiktory/generator/templates/_param_impl_boolean.erb +1 -0
- data/lib/mediawiktory/generator/templates/_param_impl_enum.erb +1 -0
- data/lib/mediawiktory/generator/templates/_param_impl_enum_of_modules.erb +1 -0
- data/lib/mediawiktory/generator/templates/_param_impl_string.erb +1 -0
- data/lib/mediawiktory/generator/templates/_param_impl_timestamp.erb +1 -0
- data/lib/mediawiktory/generator/templates/_param_method.erb +14 -0
- data/lib/mediawiktory/generator/templates/action.rb.erb +204 -0
- data/lib/mediawiktory/generator/templates/action_class.rb.erb +30 -0
- data/lib/mediawiktory/generator/templates/actions.rb.erb +31 -0
- data/lib/mediawiktory/generator/templates/api.rb.erb +65 -0
- data/lib/mediawiktory/{client.rb → generator/templates/client.rb.erb} +24 -10
- data/lib/mediawiktory/generator/templates/module_class.rb.erb +22 -0
- data/lib/mediawiktory/generator/templates/response.rb.erb +122 -0
- data/lib/mediawiktory/version.rb +4 -2
- data/lib/mediawiktory/wikipedia/actions.rb +2296 -0
- data/lib/mediawiktory/wikipedia/actions/abusefiltercheckmatch.rb +55 -0
- data/lib/mediawiktory/wikipedia/actions/abusefilterchecksyntax.rb +31 -0
- data/lib/mediawiktory/wikipedia/actions/abusefilterevalexpression.rb +31 -0
- data/lib/mediawiktory/wikipedia/actions/abusefilterunblockautopromote.rb +39 -0
- data/lib/mediawiktory/wikipedia/actions/addstudents.rb +52 -0
- data/lib/mediawiktory/wikipedia/actions/antispoof.rb +31 -0
- data/lib/mediawiktory/wikipedia/actions/base.rb +351 -0
- data/lib/mediawiktory/wikipedia/actions/block.rb +132 -0
- data/lib/mediawiktory/wikipedia/actions/bouncehandler.rb +31 -0
- data/lib/mediawiktory/wikipedia/actions/categorytree.rb +39 -0
- data/lib/mediawiktory/wikipedia/actions/centralauthtoken.rb +25 -0
- data/lib/mediawiktory/wikipedia/actions/centralnoticechoicedata.rb +39 -0
- data/lib/mediawiktory/wikipedia/actions/centralnoticequerycampaign.rb +31 -0
- data/lib/mediawiktory/wikipedia/actions/changeauthenticationdata.rb +39 -0
- data/lib/mediawiktory/wikipedia/actions/checktoken.rb +52 -0
- data/lib/mediawiktory/wikipedia/actions/cirrus-config-dump.rb +25 -0
- data/lib/mediawiktory/wikipedia/actions/cirrus-mapping-dump.rb +25 -0
- data/lib/mediawiktory/wikipedia/actions/cirrus-settings-dump.rb +25 -0
- data/lib/mediawiktory/wikipedia/actions/clearhasmsg.rb +25 -0
- data/lib/mediawiktory/wikipedia/actions/clientlogin.rb +86 -0
- data/lib/mediawiktory/wikipedia/actions/compare.rb +71 -0
- data/lib/mediawiktory/wikipedia/actions/createaccount.rb +86 -0
- data/lib/mediawiktory/wikipedia/actions/cspreport.rb +38 -0
- data/lib/mediawiktory/wikipedia/actions/cxconfiguration.rb +39 -0
- data/lib/mediawiktory/wikipedia/actions/cxdelete.rb +55 -0
- data/lib/mediawiktory/wikipedia/actions/cxpublish.rb +95 -0
- data/lib/mediawiktory/wikipedia/actions/cxsave.rb +87 -0
- data/lib/mediawiktory/wikipedia/actions/cxsuggestionlist.rb +81 -0
- data/lib/mediawiktory/wikipedia/actions/cxtoken.rb +31 -0
- data/lib/mediawiktory/wikipedia/actions/delete.rb +103 -0
- data/lib/mediawiktory/wikipedia/actions/deleteeducation.rb +65 -0
- data/lib/mediawiktory/wikipedia/actions/deleteglobalaccount.rb +47 -0
- data/lib/mediawiktory/wikipedia/actions/echomarkread.rb +77 -0
- data/lib/mediawiktory/wikipedia/actions/echomarkseen.rb +57 -0
- data/lib/mediawiktory/wikipedia/actions/edit.rb +266 -0
- data/lib/mediawiktory/wikipedia/actions/editmassmessagelist.rb +65 -0
- data/lib/mediawiktory/wikipedia/actions/emailuser.rb +62 -0
- data/lib/mediawiktory/wikipedia/actions/enlist.rb +89 -0
- data/lib/mediawiktory/wikipedia/actions/expandtemplates.rb +129 -0
- data/lib/mediawiktory/wikipedia/actions/fancycaptchareload.rb +25 -0
- data/lib/mediawiktory/wikipedia/actions/featuredfeed.rb +57 -0
- data/lib/mediawiktory/wikipedia/actions/feedcontributions.rb +121 -0
- data/lib/mediawiktory/wikipedia/actions/feedrecentchanges.rb +159 -0
- data/lib/mediawiktory/wikipedia/actions/feedwatchlist.rb +108 -0
- data/lib/mediawiktory/wikipedia/actions/filerevert.rb +55 -0
- data/lib/mediawiktory/wikipedia/actions/flagconfig.rb +25 -0
- data/lib/mediawiktory/wikipedia/actions/globalblock.rb +76 -0
- data/lib/mediawiktory/wikipedia/actions/globaluserrights.rb +94 -0
- data/lib/mediawiktory/wikipedia/actions/graph.rb +47 -0
- data/lib/mediawiktory/wikipedia/actions/help.rb +64 -0
- data/lib/mediawiktory/wikipedia/actions/imagerotate.rb +25 -0
- data/lib/mediawiktory/wikipedia/actions/import.rb +116 -0
- data/lib/mediawiktory/wikipedia/actions/jsonconfig.rb +60 -0
- data/lib/mediawiktory/wikipedia/actions/jsondata.rb +31 -0
- data/lib/mediawiktory/wikipedia/actions/languagesearch.rb +39 -0
- data/lib/mediawiktory/wikipedia/actions/linkaccount.rb +79 -0
- data/lib/mediawiktory/wikipedia/actions/liststudents.rb +63 -0
- data/lib/mediawiktory/wikipedia/actions/login.rb +55 -0
- data/lib/mediawiktory/wikipedia/actions/logout.rb +25 -0
- data/lib/mediawiktory/wikipedia/actions/managetags.rb +80 -0
- data/lib/mediawiktory/wikipedia/actions/massmessage.rb +55 -0
- data/lib/mediawiktory/wikipedia/actions/mergehistory.rb +79 -0
- data/lib/mediawiktory/wikipedia/actions/mobileview.rb +170 -0
- data/lib/mediawiktory/wikipedia/actions/move.rb +131 -0
- data/lib/mediawiktory/wikipedia/actions/oathvalidate.rb +47 -0
- data/lib/mediawiktory/wikipedia/actions/opensearch.rb +105 -0
- data/lib/mediawiktory/wikipedia/actions/options.rb +80 -0
- data/lib/mediawiktory/wikipedia/actions/pagetriageaction.rb +67 -0
- data/lib/mediawiktory/wikipedia/actions/pagetriagelist.rb +142 -0
- data/lib/mediawiktory/wikipedia/actions/pagetriagestats.rb +59 -0
- data/lib/mediawiktory/wikipedia/actions/pagetriagetagging.rb +83 -0
- data/lib/mediawiktory/wikipedia/actions/pagetriagetemplate.rb +39 -0
- data/lib/mediawiktory/wikipedia/actions/paraminfo.rb +91 -0
- data/lib/mediawiktory/wikipedia/actions/parse.rb +286 -0
- data/lib/mediawiktory/wikipedia/actions/parsoid-batch.rb +31 -0
- data/lib/mediawiktory/wikipedia/actions/patrol.rb +60 -0
- data/lib/mediawiktory/wikipedia/actions/protect.rb +121 -0
- data/lib/mediawiktory/wikipedia/actions/purge.rb +155 -0
- data/lib/mediawiktory/wikipedia/actions/query.rb +325 -0
- data/lib/mediawiktory/wikipedia/actions/refresheducation.rb +57 -0
- data/lib/mediawiktory/wikipedia/actions/removeauthenticationdata.rb +39 -0
- data/lib/mediawiktory/wikipedia/actions/resetpassword.rb +47 -0
- data/lib/mediawiktory/wikipedia/actions/review.rb +54 -0
- data/lib/mediawiktory/wikipedia/actions/reviewactivity.rb +60 -0
- data/lib/mediawiktory/wikipedia/actions/revisiondelete.rb +125 -0
- data/lib/mediawiktory/wikipedia/actions/rollback.rb +96 -0
- data/lib/mediawiktory/wikipedia/actions/rsd.rb +25 -0
- data/lib/mediawiktory/wikipedia/actions/sanitize-mapdata.rb +39 -0
- data/lib/mediawiktory/wikipedia/actions/scribunto-console.rb +62 -0
- data/lib/mediawiktory/wikipedia/actions/setglobalaccountstatus.rb +81 -0
- data/lib/mediawiktory/wikipedia/actions/setnotificationtimestamp.rb +180 -0
- data/lib/mediawiktory/wikipedia/actions/setpagelanguage.rb +81 -0
- data/lib/mediawiktory/wikipedia/actions/shortenurl.rb +31 -0
- data/lib/mediawiktory/wikipedia/actions/sitematrix.rb +91 -0
- data/lib/mediawiktory/wikipedia/actions/spamblacklist.rb +36 -0
- data/lib/mediawiktory/wikipedia/actions/stabilize.rb +76 -0
- data/lib/mediawiktory/wikipedia/actions/stashedit.rb +113 -0
- data/lib/mediawiktory/wikipedia/actions/strikevote.rb +60 -0
- data/lib/mediawiktory/wikipedia/actions/tag.rb +117 -0
- data/lib/mediawiktory/wikipedia/actions/templatedata.rb +148 -0
- data/lib/mediawiktory/wikipedia/actions/thank.rb +47 -0
- data/lib/mediawiktory/wikipedia/actions/titleblacklist.rb +51 -0
- data/lib/mediawiktory/wikipedia/actions/tokens.rb +36 -0
- data/lib/mediawiktory/wikipedia/actions/transcodereset.rb +47 -0
- data/lib/mediawiktory/wikipedia/actions/ulslocalization.rb +31 -0
- data/lib/mediawiktory/wikipedia/actions/unblock.rb +76 -0
- data/lib/mediawiktory/wikipedia/actions/undelete.rb +99 -0
- data/lib/mediawiktory/wikipedia/actions/unlinkaccount.rb +39 -0
- data/lib/mediawiktory/wikipedia/actions/upload.rb +172 -0
- data/lib/mediawiktory/wikipedia/actions/userrights.rb +107 -0
- data/lib/mediawiktory/wikipedia/actions/validatepassword.rb +55 -0
- data/lib/mediawiktory/wikipedia/actions/visualeditor.rb +96 -0
- data/lib/mediawiktory/wikipedia/actions/visualeditoredit.rb +164 -0
- data/lib/mediawiktory/wikipedia/actions/watch.rb +164 -0
- data/lib/mediawiktory/wikipedia/actions/webapp-manifest.rb +25 -0
- data/lib/mediawiktory/wikipedia/actions/wikilove.rb +79 -0
- data/lib/mediawiktory/wikipedia/actions/zeroconfig.rb +44 -0
- data/lib/mediawiktory/wikipedia/api.rb +80 -0
- data/lib/mediawiktory/wikipedia/client.rb +61 -0
- data/lib/mediawiktory/wikipedia/modules/abusefilters.rb +85 -0
- data/lib/mediawiktory/wikipedia/modules/abuselog.rb +101 -0
- data/lib/mediawiktory/wikipedia/modules/allcategories.rb +104 -0
- data/lib/mediawiktory/wikipedia/modules/alldeletedrevisions.rb +213 -0
- data/lib/mediawiktory/wikipedia/modules/allfileusages.rb +95 -0
- data/lib/mediawiktory/wikipedia/modules/allimages.rb +183 -0
- data/lib/mediawiktory/wikipedia/modules/alllinks.rb +108 -0
- data/lib/mediawiktory/wikipedia/modules/allmessages.rb +143 -0
- data/lib/mediawiktory/wikipedia/modules/allpages.rb +182 -0
- data/lib/mediawiktory/wikipedia/modules/allredirects.rb +108 -0
- data/lib/mediawiktory/wikipedia/modules/allrevisions.rb +181 -0
- data/lib/mediawiktory/wikipedia/modules/alltransclusions.rb +108 -0
- data/lib/mediawiktory/wikipedia/modules/allusers.rb +141 -0
- data/lib/mediawiktory/wikipedia/modules/authmanagerinfo.rb +63 -0
- data/lib/mediawiktory/wikipedia/modules/babel.rb +30 -0
- data/lib/mediawiktory/wikipedia/modules/backlinks.rb +100 -0
- data/lib/mediawiktory/wikipedia/modules/betafeatures.rb +30 -0
- data/lib/mediawiktory/wikipedia/modules/blocks.rb +127 -0
- data/lib/mediawiktory/wikipedia/modules/categories.rb +90 -0
- data/lib/mediawiktory/wikipedia/modules/categoryinfo.rb +30 -0
- data/lib/mediawiktory/wikipedia/modules/categorymembers.rb +183 -0
- data/lib/mediawiktory/wikipedia/modules/centralnoticelogs.rb +70 -0
- data/lib/mediawiktory/wikipedia/modules/checkuser.rb +83 -0
- data/lib/mediawiktory/wikipedia/modules/checkuserlog.rb +83 -0
- data/lib/mediawiktory/wikipedia/modules/contenttranslation.rb +83 -0
- data/lib/mediawiktory/wikipedia/modules/contenttranslationcorpora.rb +50 -0
- data/lib/mediawiktory/wikipedia/modules/contenttranslationlangtrend.rb +51 -0
- data/lib/mediawiktory/wikipedia/modules/contenttranslationstats.rb +22 -0
- data/lib/mediawiktory/wikipedia/modules/contenttranslationsuggestions.rb +70 -0
- data/lib/mediawiktory/wikipedia/modules/contributors.rb +90 -0
- data/lib/mediawiktory/wikipedia/modules/coordinates.rb +80 -0
- data/lib/mediawiktory/wikipedia/modules/cxpublishedtranslations.rb +54 -0
- data/lib/mediawiktory/wikipedia/modules/cxtranslatorstats.rb +30 -0
- data/lib/mediawiktory/wikipedia/modules/deletedrevisions.rb +169 -0
- data/lib/mediawiktory/wikipedia/modules/deletedrevs.rb +148 -0
- data/lib/mediawiktory/wikipedia/modules/duplicatefiles.rb +58 -0
- data/lib/mediawiktory/wikipedia/modules/embeddedin.rb +93 -0
- data/lib/mediawiktory/wikipedia/modules/extlinks.rb +66 -0
- data/lib/mediawiktory/wikipedia/modules/extracts.rb +81 -0
- data/lib/mediawiktory/wikipedia/modules/exturlusage.rb +92 -0
- data/lib/mediawiktory/wikipedia/modules/featureusage.rb +59 -0
- data/lib/mediawiktory/wikipedia/modules/filearchive.rb +104 -0
- data/lib/mediawiktory/wikipedia/modules/filerepoinfo.rb +35 -0
- data/lib/mediawiktory/wikipedia/modules/fileusage.rb +77 -0
- data/lib/mediawiktory/wikipedia/modules/flagged.rb +22 -0
- data/lib/mediawiktory/wikipedia/modules/g-allcategories.rb +91 -0
- data/lib/mediawiktory/wikipedia/modules/g-alldeletedrevisions.rb +200 -0
- data/lib/mediawiktory/wikipedia/modules/g-allfileusages.rb +82 -0
- data/lib/mediawiktory/wikipedia/modules/g-allimages.rb +170 -0
- data/lib/mediawiktory/wikipedia/modules/g-alllinks.rb +95 -0
- data/lib/mediawiktory/wikipedia/modules/g-allpages.rb +182 -0
- data/lib/mediawiktory/wikipedia/modules/g-allredirects.rb +95 -0
- data/lib/mediawiktory/wikipedia/modules/g-allrevisions.rb +168 -0
- data/lib/mediawiktory/wikipedia/modules/g-alltransclusions.rb +95 -0
- data/lib/mediawiktory/wikipedia/modules/g-backlinks.rb +100 -0
- data/lib/mediawiktory/wikipedia/modules/g-categories.rb +77 -0
- data/lib/mediawiktory/wikipedia/modules/g-categorymembers.rb +170 -0
- data/lib/mediawiktory/wikipedia/modules/g-contenttranslation.rb +83 -0
- data/lib/mediawiktory/wikipedia/modules/g-contenttranslationsuggestions.rb +70 -0
- data/lib/mediawiktory/wikipedia/modules/g-deletedrevisions.rb +156 -0
- data/lib/mediawiktory/wikipedia/modules/g-duplicatefiles.rb +58 -0
- data/lib/mediawiktory/wikipedia/modules/g-embeddedin.rb +93 -0
- data/lib/mediawiktory/wikipedia/modules/g-exturlusage.rb +79 -0
- data/lib/mediawiktory/wikipedia/modules/g-fileusage.rb +64 -0
- data/lib/mediawiktory/wikipedia/modules/g-geosearch.rb +116 -0
- data/lib/mediawiktory/wikipedia/modules/g-gettingstartedgetpages.rb +46 -0
- data/lib/mediawiktory/wikipedia/modules/g-images.rb +64 -0
- data/lib/mediawiktory/wikipedia/modules/g-imageusage.rb +100 -0
- data/lib/mediawiktory/wikipedia/modules/g-iwbacklinks.rb +67 -0
- data/lib/mediawiktory/wikipedia/modules/g-langbacklinks.rb +67 -0
- data/lib/mediawiktory/wikipedia/modules/g-links.rb +77 -0
- data/lib/mediawiktory/wikipedia/modules/g-linkshere.rb +64 -0
- data/lib/mediawiktory/wikipedia/modules/g-mostviewed.rb +51 -0
- data/lib/mediawiktory/wikipedia/modules/g-oldreviewedpages.rb +114 -0
- data/lib/mediawiktory/wikipedia/modules/g-pageswithprop.rb +59 -0
- data/lib/mediawiktory/wikipedia/modules/g-prefixsearch.rb +72 -0
- data/lib/mediawiktory/wikipedia/modules/g-projectpages.rb +58 -0
- data/lib/mediawiktory/wikipedia/modules/g-protectedtitles.rb +93 -0
- data/lib/mediawiktory/wikipedia/modules/g-querypage.rb +51 -0
- data/lib/mediawiktory/wikipedia/modules/g-random.rb +71 -0
- data/lib/mediawiktory/wikipedia/modules/g-recentchanges.rb +157 -0
- data/lib/mediawiktory/wikipedia/modules/g-redirects.rb +64 -0
- data/lib/mediawiktory/wikipedia/modules/g-revisions.rb +185 -0
- data/lib/mediawiktory/wikipedia/modules/g-search.rb +112 -0
- data/lib/mediawiktory/wikipedia/modules/g-templates.rb +77 -0
- data/lib/mediawiktory/wikipedia/modules/g-transcludedin.rb +64 -0
- data/lib/mediawiktory/wikipedia/modules/g-watchlist.rb +145 -0
- data/lib/mediawiktory/wikipedia/modules/g-watchlistraw.rb +109 -0
- data/lib/mediawiktory/wikipedia/modules/g-wblistentityusage.rb +64 -0
- data/lib/mediawiktory/wikipedia/modules/gadgetcategories.rb +48 -0
- data/lib/mediawiktory/wikipedia/modules/gadgets.rb +75 -0
- data/lib/mediawiktory/wikipedia/modules/geosearch.rb +129 -0
- data/lib/mediawiktory/wikipedia/modules/gettingstartedgetpages.rb +46 -0
- data/lib/mediawiktory/wikipedia/modules/globalallusers.rb +106 -0
- data/lib/mediawiktory/wikipedia/modules/globalblocks.rb +106 -0
- data/lib/mediawiktory/wikipedia/modules/globalgroups.rb +35 -0
- data/lib/mediawiktory/wikipedia/modules/globalusage.rb +58 -0
- data/lib/mediawiktory/wikipedia/modules/globaluserinfo.rb +43 -0
- data/lib/mediawiktory/wikipedia/modules/imageinfo.rb +142 -0
- data/lib/mediawiktory/wikipedia/modules/images.rb +64 -0
- data/lib/mediawiktory/wikipedia/modules/imageusage.rb +100 -0
- data/lib/mediawiktory/wikipedia/modules/info.rb +69 -0
- data/lib/mediawiktory/wikipedia/modules/iwbacklinks.rb +80 -0
- data/lib/mediawiktory/wikipedia/modules/iwlinks.rb +87 -0
- data/lib/mediawiktory/wikipedia/modules/json.rb +57 -0
- data/lib/mediawiktory/wikipedia/modules/jsonfm.rb +64 -0
- data/lib/mediawiktory/wikipedia/modules/langbacklinks.rb +80 -0
- data/lib/mediawiktory/wikipedia/modules/langlinks.rb +95 -0
- data/lib/mediawiktory/wikipedia/modules/links.rb +77 -0
- data/lib/mediawiktory/wikipedia/modules/linkshere.rb +77 -0
- data/lib/mediawiktory/wikipedia/modules/logevents.rb +151 -0
- data/lib/mediawiktory/wikipedia/modules/mapdata.rb +46 -0
- data/lib/mediawiktory/wikipedia/modules/mmsites.rb +30 -0
- data/lib/mediawiktory/wikipedia/modules/mostviewed.rb +51 -0
- data/lib/mediawiktory/wikipedia/modules/mystashedfiles.rb +51 -0
- data/lib/mediawiktory/wikipedia/modules/none.rb +22 -0
- data/lib/mediawiktory/wikipedia/modules/notifications.rb +174 -0
- data/lib/mediawiktory/wikipedia/modules/oath.rb +30 -0
- data/lib/mediawiktory/wikipedia/modules/oldreviewedpages.rb +114 -0
- data/lib/mediawiktory/wikipedia/modules/ores.rb +22 -0
- data/lib/mediawiktory/wikipedia/modules/pageassessments.rb +45 -0
- data/lib/mediawiktory/wikipedia/modules/pageimages.rb +72 -0
- data/lib/mediawiktory/wikipedia/modules/pagepropnames.rb +38 -0
- data/lib/mediawiktory/wikipedia/modules/pageprops.rb +43 -0
- data/lib/mediawiktory/wikipedia/modules/pageswithprop.rb +72 -0
- data/lib/mediawiktory/wikipedia/modules/pageterms.rb +43 -0
- data/lib/mediawiktory/wikipedia/modules/pageviews.rb +51 -0
- data/lib/mediawiktory/wikipedia/modules/php.rb +35 -0
- data/lib/mediawiktory/wikipedia/modules/phpfm.rb +42 -0
- data/lib/mediawiktory/wikipedia/modules/prefixsearch.rb +72 -0
- data/lib/mediawiktory/wikipedia/modules/projectpages.rb +58 -0
- data/lib/mediawiktory/wikipedia/modules/projects.rb +29 -0
- data/lib/mediawiktory/wikipedia/modules/protectedtitles.rb +106 -0
- data/lib/mediawiktory/wikipedia/modules/querypage.rb +51 -0
- data/lib/mediawiktory/wikipedia/modules/random.rb +71 -0
- data/lib/mediawiktory/wikipedia/modules/rawfm.rb +29 -0
- data/lib/mediawiktory/wikipedia/modules/recentchanges.rb +170 -0
- data/lib/mediawiktory/wikipedia/modules/redirects.rb +77 -0
- data/lib/mediawiktory/wikipedia/modules/references.rb +30 -0
- data/lib/mediawiktory/wikipedia/modules/revisions.rb +198 -0
- data/lib/mediawiktory/wikipedia/modules/search.rb +125 -0
- data/lib/mediawiktory/wikipedia/modules/siteinfo.rb +70 -0
- data/lib/mediawiktory/wikipedia/modules/siteviews.rb +43 -0
- data/lib/mediawiktory/wikipedia/modules/stashimageinfo.rb +85 -0
- data/lib/mediawiktory/wikipedia/modules/tags.rb +51 -0
- data/lib/mediawiktory/wikipedia/modules/templates.rb +77 -0
- data/lib/mediawiktory/wikipedia/modules/tokens.rb +35 -0
- data/lib/mediawiktory/wikipedia/modules/transcludedin.rb +77 -0
- data/lib/mediawiktory/wikipedia/modules/transcodestatus.rb +22 -0
- data/lib/mediawiktory/wikipedia/modules/unreadnotificationpages.rb +50 -0
- data/lib/mediawiktory/wikipedia/modules/usercontribs.rb +155 -0
- data/lib/mediawiktory/wikipedia/modules/userinfo.rb +43 -0
- data/lib/mediawiktory/wikipedia/modules/users.rb +82 -0
- data/lib/mediawiktory/wikipedia/modules/videoinfo.rb +143 -0
- data/lib/mediawiktory/wikipedia/modules/watchlist.rb +158 -0
- data/lib/mediawiktory/wikipedia/modules/watchlistraw.rb +122 -0
- data/lib/mediawiktory/wikipedia/modules/wbentityusage.rb +77 -0
- data/lib/mediawiktory/wikipedia/modules/wblistentityusage.rb +77 -0
- data/lib/mediawiktory/wikipedia/modules/wikibase.rb +35 -0
- data/lib/mediawiktory/wikipedia/modules/wikisets.rb +58 -0
- data/lib/mediawiktory/wikipedia/modules/xml.rb +37 -0
- data/lib/mediawiktory/wikipedia/modules/xmlfm.rb +44 -0
- data/lib/mediawiktory/wikipedia/response.rb +122 -0
- data/lib/nokogiri/more.rb +12 -12
- data/mediawiktory.gemspec +4 -0
- metadata +350 -257
- data/bin/mediawiktory +0 -13
- data/doc/mediawiki_api_types.md +0 -14
- data/examples/query.rb +0 -15
- data/examples/query_generator.rb +0 -15
- data/lib/faraday/naive_cache.rb +0 -40
- data/lib/mediawiktory/action.rb +0 -61
- data/lib/mediawiktory/generated/abusefiltercheckmatch.rb +0 -9
- data/lib/mediawiktory/generated/abusefilterchecksyntax.rb +0 -6
- data/lib/mediawiktory/generated/abusefilterevalexpression.rb +0 -6
- data/lib/mediawiktory/generated/abusefilters.rb +0 -12
- data/lib/mediawiktory/generated/abusefilterunblockautopromote.rb +0 -8
- data/lib/mediawiktory/generated/abuselog.rb +0 -14
- data/lib/mediawiktory/generated/actions_mixin.rb +0 -352
- data/lib/mediawiktory/generated/addstudents.rb +0 -9
- data/lib/mediawiktory/generated/allcategories.rb +0 -15
- data/lib/mediawiktory/generated/alldeletedrevisions.rb +0 -28
- data/lib/mediawiktory/generated/allfileusages.rb +0 -14
- data/lib/mediawiktory/generated/allimages.rb +0 -23
- data/lib/mediawiktory/generated/alllinks.rb +0 -15
- data/lib/mediawiktory/generated/allmessages.rb +0 -19
- data/lib/mediawiktory/generated/allpages.rb +0 -21
- data/lib/mediawiktory/generated/allredirects.rb +0 -15
- data/lib/mediawiktory/generated/allrevisions.rb +0 -24
- data/lib/mediawiktory/generated/alltransclusions.rb +0 -15
- data/lib/mediawiktory/generated/allusers.rb +0 -18
- data/lib/mediawiktory/generated/antispoof.rb +0 -6
- data/lib/mediawiktory/generated/authmanagerinfo.rb +0 -10
- data/lib/mediawiktory/generated/babel.rb +0 -7
- data/lib/mediawiktory/generated/backlinks.rb +0 -14
- data/lib/mediawiktory/generated/betafeatures.rb +0 -7
- data/lib/mediawiktory/generated/block.rb +0 -20
- data/lib/mediawiktory/generated/blocks.rb +0 -16
- data/lib/mediawiktory/generated/bouncehandler.rb +0 -7
- data/lib/mediawiktory/generated/categories.rb +0 -12
- data/lib/mediawiktory/generated/categoryinfo.rb +0 -7
- data/lib/mediawiktory/generated/categorymembers.rb +0 -23
- data/lib/mediawiktory/generated/categorytree.rb +0 -7
- data/lib/mediawiktory/generated/centralauthtoken.rb +0 -5
- data/lib/mediawiktory/generated/centralnoticechoicedata.rb +0 -7
- data/lib/mediawiktory/generated/centralnoticelogs.rb +0 -11
- data/lib/mediawiktory/generated/centralnoticequerycampaign.rb +0 -6
- data/lib/mediawiktory/generated/changeauthenticationdata.rb +0 -10
- data/lib/mediawiktory/generated/checktoken.rb +0 -8
- data/lib/mediawiktory/generated/checkuser.rb +0 -14
- data/lib/mediawiktory/generated/checkuserlog.rb +0 -13
- data/lib/mediawiktory/generated/cirrus-config-dump.rb +0 -5
- data/lib/mediawiktory/generated/cirrus-mapping-dump.rb +0 -5
- data/lib/mediawiktory/generated/cirrus-settings-dump.rb +0 -5
- data/lib/mediawiktory/generated/clearhasmsg.rb +0 -6
- data/lib/mediawiktory/generated/clientlogin.rb +0 -15
- data/lib/mediawiktory/generated/compare.rb +0 -11
- data/lib/mediawiktory/generated/contenttranslation.rb +0 -12
- data/lib/mediawiktory/generated/contenttranslationcorpora.rb +0 -8
- data/lib/mediawiktory/generated/contenttranslationlangtrend.rb +0 -8
- data/lib/mediawiktory/generated/contenttranslationstats.rb +0 -5
- data/lib/mediawiktory/generated/contenttranslationsuggestions.rb +0 -11
- data/lib/mediawiktory/generated/contributors.rb +0 -12
- data/lib/mediawiktory/generated/coordinates.rb +0 -12
- data/lib/mediawiktory/generated/createaccount.rb +0 -15
- data/lib/mediawiktory/generated/cspreport.rb +0 -8
- data/lib/mediawiktory/generated/cxconfiguration.rb +0 -7
- data/lib/mediawiktory/generated/cxdelete.rb +0 -10
- data/lib/mediawiktory/generated/cxpublish.rb +0 -15
- data/lib/mediawiktory/generated/cxpublishedtranslations.rb +0 -9
- data/lib/mediawiktory/generated/cxsave.rb +0 -14
- data/lib/mediawiktory/generated/cxsuggestionlist.rb +0 -12
- data/lib/mediawiktory/generated/cxtoken.rb +0 -7
- data/lib/mediawiktory/generated/cxtranslatorstats.rb +0 -6
- data/lib/mediawiktory/generated/delete.rb +0 -15
- data/lib/mediawiktory/generated/deletedrevisions.rb +0 -23
- data/lib/mediawiktory/generated/deletedrevs.rb +0 -20
- data/lib/mediawiktory/generated/deleteeducation.rb +0 -10
- data/lib/mediawiktory/generated/deleteglobalaccount.rb +0 -9
- data/lib/mediawiktory/generated/duplicatefiles.rb +0 -10
- data/lib/mediawiktory/generated/echomarkread.rb +0 -11
- data/lib/mediawiktory/generated/echomarkseen.rb +0 -9
- data/lib/mediawiktory/generated/edit.rb +0 -35
- data/lib/mediawiktory/generated/editmassmessagelist.rb +0 -10
- data/lib/mediawiktory/generated/emailuser.rb +0 -11
- data/lib/mediawiktory/generated/embeddedin.rb +0 -13
- data/lib/mediawiktory/generated/enlist.rb +0 -13
- data/lib/mediawiktory/generated/expandtemplates.rb +0 -16
- data/lib/mediawiktory/generated/extlinks.rb +0 -11
- data/lib/mediawiktory/generated/extracts.rb +0 -13
- data/lib/mediawiktory/generated/exturlusage.rb +0 -13
- data/lib/mediawiktory/generated/fancycaptchareload.rb +0 -5
- data/lib/mediawiktory/generated/featuredfeed.rb +0 -8
- data/lib/mediawiktory/generated/featureusage.rb +0 -10
- data/lib/mediawiktory/generated/feedcontributions.rb +0 -16
- data/lib/mediawiktory/generated/feedrecentchanges.rb +0 -22
- data/lib/mediawiktory/generated/feedwatchlist.rb +0 -14
- data/lib/mediawiktory/generated/filearchive.rb +0 -15
- data/lib/mediawiktory/generated/filerepoinfo.rb +0 -7
- data/lib/mediawiktory/generated/filerevert.rb +0 -10
- data/lib/mediawiktory/generated/fileusage.rb +0 -11
- data/lib/mediawiktory/generated/flagconfig.rb +0 -5
- data/lib/mediawiktory/generated/flagged.rb +0 -5
- data/lib/mediawiktory/generated/gadgetcategories.rb +0 -8
- data/lib/mediawiktory/generated/gadgets.rb +0 -11
- data/lib/mediawiktory/generated/geosearch.rb +0 -17
- data/lib/mediawiktory/generated/gettingstartedgetpages.rb +0 -9
- data/lib/mediawiktory/generated/globalallusers.rb +0 -14
- data/lib/mediawiktory/generated/globalblock.rb +0 -13
- data/lib/mediawiktory/generated/globalblocks.rb +0 -14
- data/lib/mediawiktory/generated/globalgroups.rb +0 -7
- data/lib/mediawiktory/generated/globalusage.rb +0 -10
- data/lib/mediawiktory/generated/globaluserinfo.rb +0 -8
- data/lib/mediawiktory/generated/globaluserrights.rb +0 -13
- data/lib/mediawiktory/generated/graph.rb +0 -8
- data/lib/mediawiktory/generated/help.rb +0 -10
- data/lib/mediawiktory/generated/imageinfo.rb +0 -20
- data/lib/mediawiktory/generated/imagerotate.rb +0 -5
- data/lib/mediawiktory/generated/images.rb +0 -10
- data/lib/mediawiktory/generated/imageusage.rb +0 -14
- data/lib/mediawiktory/generated/import.rb +0 -16
- data/lib/mediawiktory/generated/info.rb +0 -10
- data/lib/mediawiktory/generated/iwbacklinks.rb +0 -12
- data/lib/mediawiktory/generated/iwlinks.rb +0 -13
- data/lib/mediawiktory/generated/jsonconfig.rb +0 -9
- data/lib/mediawiktory/generated/jsondata.rb +0 -6
- data/lib/mediawiktory/generated/langbacklinks.rb +0 -12
- data/lib/mediawiktory/generated/langlinks.rb +0 -14
- data/lib/mediawiktory/generated/languagesearch.rb +0 -7
- data/lib/mediawiktory/generated/linkaccount.rb +0 -14
- data/lib/mediawiktory/generated/links.rb +0 -11
- data/lib/mediawiktory/generated/linkshere.rb +0 -11
- data/lib/mediawiktory/generated/liststudents.rb +0 -9
- data/lib/mediawiktory/generated/logevents.rb +0 -19
- data/lib/mediawiktory/generated/login.rb +0 -11
- data/lib/mediawiktory/generated/logout.rb +0 -5
- data/lib/mediawiktory/generated/managetags.rb +0 -12
- data/lib/mediawiktory/generated/mapdata.rb +0 -9
- data/lib/mediawiktory/generated/massmessage.rb +0 -10
- data/lib/mediawiktory/generated/mergehistory.rb +0 -13
- data/lib/mediawiktory/generated/mmsites.rb +0 -6
- data/lib/mediawiktory/generated/mobileview.rb +0 -22
- data/lib/mediawiktory/generated/mostviewed.rb +0 -9
- data/lib/mediawiktory/generated/move.rb +0 -19
- data/lib/mediawiktory/generated/mystashedfiles.rb +0 -9
- data/lib/mediawiktory/generated/notifications.rb +0 -22
- data/lib/mediawiktory/generated/oath.rb +0 -7
- data/lib/mediawiktory/generated/oathvalidate.rb +0 -9
- data/lib/mediawiktory/generated/oldreviewedpages.rb +0 -15
- data/lib/mediawiktory/generated/opensearch.rb +0 -12
- data/lib/mediawiktory/generated/options.rb +0 -12
- data/lib/mediawiktory/generated/ores.rb +0 -6
- data/lib/mediawiktory/generated/pageassessments.rb +0 -9
- data/lib/mediawiktory/generated/pageimages.rb +0 -11
- data/lib/mediawiktory/generated/pagepropnames.rb +0 -8
- data/lib/mediawiktory/generated/pageprops.rb +0 -8
- data/lib/mediawiktory/generated/pageswithprop.rb +0 -11
- data/lib/mediawiktory/generated/pageterms.rb +0 -8
- data/lib/mediawiktory/generated/pagetriageaction.rb +0 -11
- data/lib/mediawiktory/generated/pagetriagelist.rb +0 -21
- data/lib/mediawiktory/generated/pagetriagestats.rb +0 -10
- data/lib/mediawiktory/generated/pagetriagetagging.rb +0 -13
- data/lib/mediawiktory/generated/pagetriagetemplate.rb +0 -7
- data/lib/mediawiktory/generated/pageviews.rb +0 -9
- data/lib/mediawiktory/generated/paraminfo.rb +0 -11
- data/lib/mediawiktory/generated/parse.rb +0 -36
- data/lib/mediawiktory/generated/parsoid-batch.rb +0 -6
- data/lib/mediawiktory/generated/patrol.rb +0 -10
- data/lib/mediawiktory/generated/prefixsearch.rb +0 -10
- data/lib/mediawiktory/generated/projectpages.rb +0 -10
- data/lib/mediawiktory/generated/projects.rb +0 -7
- data/lib/mediawiktory/generated/protect.rb +0 -16
- data/lib/mediawiktory/generated/protectedtitles.rb +0 -14
- data/lib/mediawiktory/generated/purge.rb +0 -15
- data/lib/mediawiktory/generated/query.rb +0 -20
- data/lib/mediawiktory/generated/querypage.rb +0 -9
- data/lib/mediawiktory/generated/random.rb +0 -11
- data/lib/mediawiktory/generated/recentchanges.rb +0 -21
- data/lib/mediawiktory/generated/redirects.rb +0 -11
- data/lib/mediawiktory/generated/references.rb +0 -7
- data/lib/mediawiktory/generated/refresheducation.rb +0 -9
- data/lib/mediawiktory/generated/removeauthenticationdata.rb +0 -8
- data/lib/mediawiktory/generated/resetpassword.rb +0 -9
- data/lib/mediawiktory/generated/review.rb +0 -10
- data/lib/mediawiktory/generated/reviewactivity.rb +0 -10
- data/lib/mediawiktory/generated/revisiondelete.rb +0 -15
- data/lib/mediawiktory/generated/revisions.rb +0 -26
- data/lib/mediawiktory/generated/rollback.rb +0 -14
- data/lib/mediawiktory/generated/rsd.rb +0 -5
- data/lib/mediawiktory/generated/sanitize-mapdata.rb +0 -8
- data/lib/mediawiktory/generated/scribunto-console.rb +0 -10
- data/lib/mediawiktory/generated/search.rb +0 -16
- data/lib/mediawiktory/generated/setglobalaccountstatus.rb +0 -12
- data/lib/mediawiktory/generated/setnotificationtimestamp.rb +0 -18
- data/lib/mediawiktory/generated/setpagelanguage.rb +0 -12
- data/lib/mediawiktory/generated/shortenurl.rb +0 -7
- data/lib/mediawiktory/generated/siteinfo.rb +0 -11
- data/lib/mediawiktory/generated/sitematrix.rb +0 -12
- data/lib/mediawiktory/generated/siteviews.rb +0 -8
- data/lib/mediawiktory/generated/spamblacklist.rb +0 -6
- data/lib/mediawiktory/generated/stabilize.rb +0 -12
- data/lib/mediawiktory/generated/stashedit.rb +0 -16
- data/lib/mediawiktory/generated/stashimageinfo.rb +0 -12
- data/lib/mediawiktory/generated/strikevote.rb +0 -10
- data/lib/mediawiktory/generated/tag.rb +0 -14
- data/lib/mediawiktory/generated/tags.rb +0 -9
- data/lib/mediawiktory/generated/templatedata.rb +0 -12
- data/lib/mediawiktory/generated/templates.rb +0 -11
- data/lib/mediawiktory/generated/thank.rb +0 -9
- data/lib/mediawiktory/generated/titleblacklist.rb +0 -9
- data/lib/mediawiktory/generated/tokens.rb +0 -6
- data/lib/mediawiktory/generated/transcludedin.rb +0 -11
- data/lib/mediawiktory/generated/transcodereset.rb +0 -9
- data/lib/mediawiktory/generated/transcodestatus.rb +0 -5
- data/lib/mediawiktory/generated/ulslocalization.rb +0 -6
- data/lib/mediawiktory/generated/unblock.rb +0 -12
- data/lib/mediawiktory/generated/undelete.rb +0 -13
- data/lib/mediawiktory/generated/unlinkaccount.rb +0 -8
- data/lib/mediawiktory/generated/unreadnotificationpages.rb +0 -9
- data/lib/mediawiktory/generated/upload.rb +0 -24
- data/lib/mediawiktory/generated/usercontribs.rb +0 -19
- data/lib/mediawiktory/generated/userinfo.rb +0 -8
- data/lib/mediawiktory/generated/userrights.rb +0 -13
- data/lib/mediawiktory/generated/users.rb +0 -11
- data/lib/mediawiktory/generated/validatepassword.rb +0 -10
- data/lib/mediawiktory/generated/videoinfo.rb +0 -20
- data/lib/mediawiktory/generated/visualeditor.rb +0 -13
- data/lib/mediawiktory/generated/visualeditoredit.rb +0 -23
- data/lib/mediawiktory/generated/watch.rb +0 -16
- data/lib/mediawiktory/generated/watchlist.rb +0 -20
- data/lib/mediawiktory/generated/watchlistraw.rb +0 -16
- data/lib/mediawiktory/generated/wbentityusage.rb +0 -11
- data/lib/mediawiktory/generated/wblistentityusage.rb +0 -11
- data/lib/mediawiktory/generated/webapp-manifest.rb +0 -5
- data/lib/mediawiktory/generated/wikibase.rb +0 -7
- data/lib/mediawiktory/generated/wikilove.rb +0 -13
- data/lib/mediawiktory/generated/wikisets.rb +0 -10
- data/lib/mediawiktory/generated/zeroconfig.rb +0 -7
- data/lib/mediawiktory/mw_module.rb +0 -324
- data/lib/mediawiktory/page.rb +0 -50
- data/lib/mediawiktory/query.rb +0 -58
- data/script/data/api.yaml +0 -40414
- data/script/lib/api.rb +0 -14
- data/script/lib/module.rb +0 -132
- data/script/lib/parameter.rb +0 -133
- data/script/parse_api.rb +0 -21
- data/test/cache.rb +0 -15
@@ -0,0 +1,55 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module MediaWiktory::Wikipedia
|
4
|
+
module Actions
|
5
|
+
# Check to see if an AbuseFilter matches a set of variables, editor logged AbuseFilter event.
|
6
|
+
#
|
7
|
+
# Usage:
|
8
|
+
#
|
9
|
+
# ```ruby
|
10
|
+
# api.abusefiltercheckmatch.filter(value).perform # returns string with raw output
|
11
|
+
# # or
|
12
|
+
# api.abusefiltercheckmatch.filter(value).response # returns output parsed and wrapped into Response object
|
13
|
+
# ```
|
14
|
+
#
|
15
|
+
# See {Base} for generic explanation of working with MediaWiki actions and
|
16
|
+
# {MediaWiktory::Wikipedia::Response} for working with action responses.
|
17
|
+
#
|
18
|
+
# All action's parameters are documented as its public methods, see below.
|
19
|
+
#
|
20
|
+
class Abusefiltercheckmatch < MediaWiktory::Wikipedia::Actions::Get
|
21
|
+
|
22
|
+
# The full filter text to check for a match.
|
23
|
+
#
|
24
|
+
# @param value [String]
|
25
|
+
# @return [self]
|
26
|
+
def filter(value)
|
27
|
+
merge(filter: value.to_s)
|
28
|
+
end
|
29
|
+
|
30
|
+
# JSON encoded array of variables to test against.
|
31
|
+
#
|
32
|
+
# @param value [String]
|
33
|
+
# @return [self]
|
34
|
+
def vars(value)
|
35
|
+
merge(vars: value.to_s)
|
36
|
+
end
|
37
|
+
|
38
|
+
# Recent change ID to check against.
|
39
|
+
#
|
40
|
+
# @param value [Integer]
|
41
|
+
# @return [self]
|
42
|
+
def rcid(value)
|
43
|
+
merge(rcid: value.to_s)
|
44
|
+
end
|
45
|
+
|
46
|
+
# Abuse filter log ID to check against.
|
47
|
+
#
|
48
|
+
# @param value [Integer]
|
49
|
+
# @return [self]
|
50
|
+
def logid(value)
|
51
|
+
merge(logid: value.to_s)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module MediaWiktory::Wikipedia
|
4
|
+
module Actions
|
5
|
+
# Check syntax of an AbuseFilter filter.
|
6
|
+
#
|
7
|
+
# Usage:
|
8
|
+
#
|
9
|
+
# ```ruby
|
10
|
+
# api.abusefilterchecksyntax.filter(value).perform # returns string with raw output
|
11
|
+
# # or
|
12
|
+
# api.abusefilterchecksyntax.filter(value).response # returns output parsed and wrapped into Response object
|
13
|
+
# ```
|
14
|
+
#
|
15
|
+
# See {Base} for generic explanation of working with MediaWiki actions and
|
16
|
+
# {MediaWiktory::Wikipedia::Response} for working with action responses.
|
17
|
+
#
|
18
|
+
# All action's parameters are documented as its public methods, see below.
|
19
|
+
#
|
20
|
+
class Abusefilterchecksyntax < MediaWiktory::Wikipedia::Actions::Get
|
21
|
+
|
22
|
+
# The full filter text to check syntax on.
|
23
|
+
#
|
24
|
+
# @param value [String]
|
25
|
+
# @return [self]
|
26
|
+
def filter(value)
|
27
|
+
merge(filter: value.to_s)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module MediaWiktory::Wikipedia
|
4
|
+
module Actions
|
5
|
+
# Evaluates an AbuseFilter expression.
|
6
|
+
#
|
7
|
+
# Usage:
|
8
|
+
#
|
9
|
+
# ```ruby
|
10
|
+
# api.abusefilterevalexpression.expression(value).perform # returns string with raw output
|
11
|
+
# # or
|
12
|
+
# api.abusefilterevalexpression.expression(value).response # returns output parsed and wrapped into Response object
|
13
|
+
# ```
|
14
|
+
#
|
15
|
+
# See {Base} for generic explanation of working with MediaWiki actions and
|
16
|
+
# {MediaWiktory::Wikipedia::Response} for working with action responses.
|
17
|
+
#
|
18
|
+
# All action's parameters are documented as its public methods, see below.
|
19
|
+
#
|
20
|
+
class Abusefilterevalexpression < MediaWiktory::Wikipedia::Actions::Get
|
21
|
+
|
22
|
+
# The expression to evaluate.
|
23
|
+
#
|
24
|
+
# @param value [String]
|
25
|
+
# @return [self]
|
26
|
+
def expression(value)
|
27
|
+
merge(expression: value.to_s)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module MediaWiktory::Wikipedia
|
4
|
+
module Actions
|
5
|
+
# Unblocks a user from receiving autopromotions due to an abusefilter consequence.
|
6
|
+
#
|
7
|
+
# Usage:
|
8
|
+
#
|
9
|
+
# ```ruby
|
10
|
+
# api.abusefilterunblockautopromote.user(value).perform # returns string with raw output
|
11
|
+
# # or
|
12
|
+
# api.abusefilterunblockautopromote.user(value).response # returns output parsed and wrapped into Response object
|
13
|
+
# ```
|
14
|
+
#
|
15
|
+
# See {Base} for generic explanation of working with MediaWiki actions and
|
16
|
+
# {MediaWiktory::Wikipedia::Response} for working with action responses.
|
17
|
+
#
|
18
|
+
# All action's parameters are documented as its public methods, see below.
|
19
|
+
#
|
20
|
+
class Abusefilterunblockautopromote < MediaWiktory::Wikipedia::Actions::Post
|
21
|
+
|
22
|
+
# Username of the user you want to unblock.
|
23
|
+
#
|
24
|
+
# @param value [String]
|
25
|
+
# @return [self]
|
26
|
+
def user(value)
|
27
|
+
merge(user: value.to_s)
|
28
|
+
end
|
29
|
+
|
30
|
+
# A "csrf" token retrieved from action=query&meta=tokens
|
31
|
+
#
|
32
|
+
# @param value [String]
|
33
|
+
# @return [self]
|
34
|
+
def token(value)
|
35
|
+
merge(token: value.to_s)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module MediaWiktory::Wikipedia
|
4
|
+
module Actions
|
5
|
+
# Add multiple students to a course.
|
6
|
+
#
|
7
|
+
# Usage:
|
8
|
+
#
|
9
|
+
# ```ruby
|
10
|
+
# api.addstudents.studentusernames(value).perform # returns string with raw output
|
11
|
+
# # or
|
12
|
+
# api.addstudents.studentusernames(value).response # returns output parsed and wrapped into Response object
|
13
|
+
# ```
|
14
|
+
#
|
15
|
+
# See {Base} for generic explanation of working with MediaWiki actions and
|
16
|
+
# {MediaWiktory::Wikipedia::Response} for working with action responses.
|
17
|
+
#
|
18
|
+
# All action's parameters are documented as its public methods, see below.
|
19
|
+
#
|
20
|
+
class Addstudents < MediaWiktory::Wikipedia::Actions::Post
|
21
|
+
|
22
|
+
# The usernames of the students to add to the course.
|
23
|
+
#
|
24
|
+
# @param values [Array<String>]
|
25
|
+
# @return [self]
|
26
|
+
def studentusernames(*values)
|
27
|
+
values.inject(self) { |res, val| res._studentusernames(val) }
|
28
|
+
end
|
29
|
+
|
30
|
+
# @private
|
31
|
+
def _studentusernames(value)
|
32
|
+
merge(studentusernames: value.to_s, replace: false)
|
33
|
+
end
|
34
|
+
|
35
|
+
# The ID of the course to which the students should be added/removed.
|
36
|
+
#
|
37
|
+
# @param value [Integer]
|
38
|
+
# @return [self]
|
39
|
+
def courseid(value)
|
40
|
+
merge(courseid: value.to_s)
|
41
|
+
end
|
42
|
+
|
43
|
+
# A "csrf" token retrieved from action=query&meta=tokens
|
44
|
+
#
|
45
|
+
# @param value [String]
|
46
|
+
# @return [self]
|
47
|
+
def token(value)
|
48
|
+
merge(token: value.to_s)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module MediaWiktory::Wikipedia
|
4
|
+
module Actions
|
5
|
+
# Check a username against AntiSpoof's normalisation checks.
|
6
|
+
#
|
7
|
+
# Usage:
|
8
|
+
#
|
9
|
+
# ```ruby
|
10
|
+
# api.antispoof.username(value).perform # returns string with raw output
|
11
|
+
# # or
|
12
|
+
# api.antispoof.username(value).response # returns output parsed and wrapped into Response object
|
13
|
+
# ```
|
14
|
+
#
|
15
|
+
# See {Base} for generic explanation of working with MediaWiki actions and
|
16
|
+
# {MediaWiktory::Wikipedia::Response} for working with action responses.
|
17
|
+
#
|
18
|
+
# All action's parameters are documented as its public methods, see below.
|
19
|
+
#
|
20
|
+
class Antispoof < MediaWiktory::Wikipedia::Actions::Get
|
21
|
+
|
22
|
+
# The username to check against AntiSpoof.
|
23
|
+
#
|
24
|
+
# @param value [String]
|
25
|
+
# @return [self]
|
26
|
+
def username(value)
|
27
|
+
merge(username: value.to_s)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,351 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../response'
|
4
|
+
|
5
|
+
module MediaWiktory::Wikipedia
|
6
|
+
module Actions
|
7
|
+
# Global setup methods included into every action through {Base}.
|
8
|
+
module GlobalParams
|
9
|
+
|
10
|
+
# The format of the output.
|
11
|
+
#
|
12
|
+
# @param value [Symbol] Selecting an option includes tweaking methods from corresponding module:
|
13
|
+
# * `:json` - {MediaWiktory::Wikipedia::Modules::Json} Output data in JSON format.
|
14
|
+
# * `:jsonfm` - {MediaWiktory::Wikipedia::Modules::Jsonfm} Output data in JSON format (pretty-print in HTML).
|
15
|
+
# * `:none` - {MediaWiktory::Wikipedia::Modules::None} Output nothing.
|
16
|
+
# * `:php` - {MediaWiktory::Wikipedia::Modules::Php} Output data in serialized PHP format.
|
17
|
+
# * `:phpfm` - {MediaWiktory::Wikipedia::Modules::Phpfm} Output data in serialized PHP format (pretty-print in HTML).
|
18
|
+
# * `:rawfm` - {MediaWiktory::Wikipedia::Modules::Rawfm} Output data, including debugging elements, in JSON format (pretty-print in HTML).
|
19
|
+
# * `:xml` - {MediaWiktory::Wikipedia::Modules::Xml} Output data in XML format.
|
20
|
+
# * `:xmlfm` - {MediaWiktory::Wikipedia::Modules::Xmlfm} Output data in XML format (pretty-print in HTML).
|
21
|
+
# @return [self]
|
22
|
+
def format(value)
|
23
|
+
_format(value) or fail ArgumentError, "Unknown value for format: #{value}"
|
24
|
+
end
|
25
|
+
|
26
|
+
# @private
|
27
|
+
def _format(value)
|
28
|
+
[:json, :jsonfm, :none, :php, :phpfm, :rawfm, :xml, :xmlfm].include?(value.to_sym) && merge(format: value.to_s).submodule({json: Modules::Json, jsonfm: Modules::Jsonfm, none: Modules::None, php: Modules::Php, phpfm: Modules::Phpfm, rawfm: Modules::Rawfm, xml: Modules::Xml, xmlfm: Modules::Xmlfm}[value.to_sym])
|
29
|
+
end
|
30
|
+
|
31
|
+
# Maximum lag can be used when MediaWiki is installed on a database replicated cluster. To save actions causing any more site replication lag, this parameter can make the client wait until the replication lag is less than the specified value. In case of excessive lag, error code maxlag is returned with a message like Waiting for $host: $lag seconds lagged.See Manual: Maxlag parameter for more information.
|
32
|
+
#
|
33
|
+
# @param value [Integer]
|
34
|
+
# @return [self]
|
35
|
+
def maxlag(value)
|
36
|
+
merge(maxlag: value.to_s)
|
37
|
+
end
|
38
|
+
|
39
|
+
# Set the s-maxage HTTP cache control header to this many seconds. Errors are never cached.
|
40
|
+
#
|
41
|
+
# @param value [Integer]
|
42
|
+
# @return [self]
|
43
|
+
def smaxage(value)
|
44
|
+
merge(smaxage: value.to_s)
|
45
|
+
end
|
46
|
+
|
47
|
+
# Set the max-age HTTP cache control header to this many seconds. Errors are never cached.
|
48
|
+
#
|
49
|
+
# @param value [Integer]
|
50
|
+
# @return [self]
|
51
|
+
def maxage(value)
|
52
|
+
merge(maxage: value.to_s)
|
53
|
+
end
|
54
|
+
|
55
|
+
# Verify the user is logged in if set to user, or has the bot user right if bot.
|
56
|
+
#
|
57
|
+
# @param value [String] One of "user", "bot".
|
58
|
+
# @return [self]
|
59
|
+
def assert(value)
|
60
|
+
_assert(value) or fail ArgumentError, "Unknown value for assert: #{value}"
|
61
|
+
end
|
62
|
+
|
63
|
+
# @private
|
64
|
+
def _assert(value)
|
65
|
+
defined?(super) && super || ["user", "bot"].include?(value.to_s) && merge(assert: value.to_s)
|
66
|
+
end
|
67
|
+
|
68
|
+
# Verify the current user is the named user.
|
69
|
+
#
|
70
|
+
# @param value [String]
|
71
|
+
# @return [self]
|
72
|
+
def assertuser(value)
|
73
|
+
merge(assertuser: value.to_s)
|
74
|
+
end
|
75
|
+
|
76
|
+
# Any value given here will be included in the response. May be used to distinguish requests.
|
77
|
+
#
|
78
|
+
# @param value [String]
|
79
|
+
# @return [self]
|
80
|
+
def requestid(value)
|
81
|
+
merge(requestid: value.to_s)
|
82
|
+
end
|
83
|
+
|
84
|
+
# Include the hostname that served the request in the results.
|
85
|
+
#
|
86
|
+
# @return [self]
|
87
|
+
def servedby()
|
88
|
+
merge(servedby: 'true')
|
89
|
+
end
|
90
|
+
|
91
|
+
# Include the current timestamp in the result.
|
92
|
+
#
|
93
|
+
# @return [self]
|
94
|
+
def curtimestamp()
|
95
|
+
merge(curtimestamp: 'true')
|
96
|
+
end
|
97
|
+
|
98
|
+
# Include the languages used for uselang and errorlang in the result.
|
99
|
+
#
|
100
|
+
# @return [self]
|
101
|
+
def responselanginfo()
|
102
|
+
merge(responselanginfo: 'true')
|
103
|
+
end
|
104
|
+
|
105
|
+
# When accessing the API using a cross-domain AJAX request (CORS), set this to the originating domain. This must be included in any pre-flight request, and therefore must be part of the request URI (not the POST body).
|
106
|
+
#
|
107
|
+
# @param value [String]
|
108
|
+
# @return [self]
|
109
|
+
def origin(value)
|
110
|
+
merge(origin: value.to_s)
|
111
|
+
end
|
112
|
+
|
113
|
+
# Language to use for message translations. action=query&meta=siteinfo with siprop=languages returns a list of language codes, or specify user to use the current user's language preference, or specify content to use this wiki's content language.
|
114
|
+
#
|
115
|
+
# @param value [String]
|
116
|
+
# @return [self]
|
117
|
+
def uselang(value)
|
118
|
+
merge(uselang: value.to_s)
|
119
|
+
end
|
120
|
+
|
121
|
+
# Format to use for warning and error text output.
|
122
|
+
#
|
123
|
+
# @param value [String] One of " plaintext" ( Wikitext with HTML tags removed and entities replaced), " wikitext" ( Unparsed wikitext), " html" ( HTML), " raw" ( Message key and parameters), " none" ( No text output, only the error codes), " bc" ( Format used prior to MediaWiki 1.29. errorlang and errorsuselocal are ignored).
|
124
|
+
# @return [self]
|
125
|
+
def errorformat(value)
|
126
|
+
_errorformat(value) or fail ArgumentError, "Unknown value for errorformat: #{value}"
|
127
|
+
end
|
128
|
+
|
129
|
+
# @private
|
130
|
+
def _errorformat(value)
|
131
|
+
defined?(super) && super || [" plaintext", " wikitext", " html", " raw", " none", " bc"].include?(value.to_s) && merge(errorformat: value.to_s)
|
132
|
+
end
|
133
|
+
|
134
|
+
# Language to use for warnings and errors. action=query&meta=siteinfo with siprop=languages returns a list of language codes, or specify content to use this wiki's content language, or specify uselang to use the same value as the uselang parameter.
|
135
|
+
#
|
136
|
+
# @param value [String]
|
137
|
+
# @return [self]
|
138
|
+
def errorlang(value)
|
139
|
+
merge(errorlang: value.to_s)
|
140
|
+
end
|
141
|
+
|
142
|
+
# If given, error texts will use locally-customized messages from the MediaWiki namespace.
|
143
|
+
#
|
144
|
+
# @return [self]
|
145
|
+
def errorsuselocal()
|
146
|
+
merge(errorsuselocal: 'true')
|
147
|
+
end
|
148
|
+
|
149
|
+
# When accessing the API using a cross-domain AJAX request (CORS), use this to authenticate as the current SUL user. Use action=centralauthtoken on this wiki to retrieve the token, before making the CORS request. Each token may only be used once, and expires after 10 seconds. This should be included in any pre-flight request, and therefore should be included in the request URI (not the POST body).
|
150
|
+
#
|
151
|
+
# @param value [String]
|
152
|
+
# @return [self]
|
153
|
+
def centralauthtoken(value)
|
154
|
+
merge(centralauthtoken: value.to_s)
|
155
|
+
end
|
156
|
+
|
157
|
+
end
|
158
|
+
|
159
|
+
# Base class for all {MediaWiktory::Wikipedia::Api} actions. "Actions" is MediaWiki's term for
|
160
|
+
# different request types. Everything you are doing with your target MediaWiki installation, you
|
161
|
+
# are doing by _performing actions_.
|
162
|
+
#
|
163
|
+
# Typically, you should never instantiate this class or its descendants directly, but rather by
|
164
|
+
# {MediaWiktory::Wikipedia::Api Api} methods (included from {MediaWiktory::Wikipedia::Actions Actions}
|
165
|
+
# module).
|
166
|
+
#
|
167
|
+
# The usual workflow with actions is:
|
168
|
+
#
|
169
|
+
# * Create it with `api.action_name`
|
170
|
+
# * Set action params with subsequent `paramname(paramvalue)` calls;
|
171
|
+
# * Perform action with {#perform} (returns row MediaWiki response as a string) or {#response}
|
172
|
+
# (returns {MediaWiktory::Wikipedia::Response} class with parsed data and helper methods).
|
173
|
+
#
|
174
|
+
# Note that some of `paramname(value)` calls include new {Modules} into action, which provides
|
175
|
+
# new params & methods. For example:
|
176
|
+
#
|
177
|
+
# ```ruby
|
178
|
+
# api.query.generator(:categorymembers) # includes new methods of GCategorymembers module
|
179
|
+
# .title('Category:DOS_games') # one of GCategorymembers methods, adds gcmtitle=Category:DOS_games to URL
|
180
|
+
# .limit(20)
|
181
|
+
# ```
|
182
|
+
#
|
183
|
+
# Sometimes new modules inclusion can change a sense of already existing methods:
|
184
|
+
#
|
185
|
+
# ```ruby
|
186
|
+
# api.query.titles('Argentina')
|
187
|
+
# .prop(:revisions) # .prop method from Query action, adds prop=revisions to URL and includes Revisions module
|
188
|
+
# .prop(:content) # .prop method from Revisions module, adds rvprop=content to URL
|
189
|
+
# ```
|
190
|
+
#
|
191
|
+
# Despite of how questionable this practice looks, it provides the most obvious method chains even
|
192
|
+
# for most complicated cases.
|
193
|
+
#
|
194
|
+
# Some setup methods shared between all the actions (like output format and TTL settings of
|
195
|
+
# response) are defined in {GlobalParams}.
|
196
|
+
#
|
197
|
+
# Full action usage example:
|
198
|
+
#
|
199
|
+
# ```ruby
|
200
|
+
# api = MediaWiktory::Wikipedia::Api.new
|
201
|
+
# action = api.new.query.titles('Argentina').prop(:revisions).prop(:content).meta(:siteinfo)
|
202
|
+
# # => #<MediaWiktory::Wikipedia::Actions::Query {"titles"=>"Argentina", "prop"=>"revisions", "rvprop"=>"content", "meta"=>"siteinfo"}>
|
203
|
+
# response = action.response
|
204
|
+
# # => #<MediaWiktory::Wikipedia::Response(query): pages, general>
|
205
|
+
# puts response['pages'].values # all pages...
|
206
|
+
# .first['revisions'] # take revisions from first...
|
207
|
+
# .first['*'] # take content from first revision...
|
208
|
+
# .split("\n").first(3) # and first 3 paragrapahs
|
209
|
+
# # {{other uses}}
|
210
|
+
# # {{pp-semi|small=yes}}
|
211
|
+
# # {{Use dmy dates|date=March 2017}}
|
212
|
+
# response.dig('general', 'sitename')
|
213
|
+
# # => "Wikipedia"
|
214
|
+
# ```
|
215
|
+
#
|
216
|
+
class Base
|
217
|
+
# @private
|
218
|
+
attr_reader :client
|
219
|
+
|
220
|
+
# @private
|
221
|
+
def initialize(client, options = {})
|
222
|
+
@client = client
|
223
|
+
@params = stringify_hash(options)
|
224
|
+
@submodules = []
|
225
|
+
end
|
226
|
+
|
227
|
+
# @return [String]
|
228
|
+
def inspect
|
229
|
+
"#<#{self.class.name} #{to_h}>"
|
230
|
+
end
|
231
|
+
|
232
|
+
# Make new action, with additional params passed as `hash`. No params validations are made.
|
233
|
+
#
|
234
|
+
# @param hash [Hash] Params to merge. All keys and values would be stringified.
|
235
|
+
# @return [Action] Produced action of the same type as current action was, with all passed
|
236
|
+
# params applied.
|
237
|
+
def merge(hash)
|
238
|
+
replace = hash.fetch(:replace, true)
|
239
|
+
hash.delete(:replace)
|
240
|
+
self.class
|
241
|
+
.new(@client, @params.merge(stringify_hash(hash)) { |_, o, n| replace ? n : [o, n].compact.uniq.join('|') })
|
242
|
+
.tap { |action| @submodules.each { |sm| action.submodule(sm) } }
|
243
|
+
end
|
244
|
+
|
245
|
+
# All action's params in a ready to passing to URL form (string keys & string values).
|
246
|
+
#
|
247
|
+
# @example
|
248
|
+
# api.query.titles('Argentina', 'Bolivia').format(:json).to_h
|
249
|
+
# # => {"titles"=>"Argentina|Bolivia", "format"=>"json"}
|
250
|
+
#
|
251
|
+
# @return [Hash{String => String}]
|
252
|
+
def to_h
|
253
|
+
@params.dup
|
254
|
+
end
|
255
|
+
|
256
|
+
# Action's name on MediaWiki API (e.g. "query" for `Query` action, "parsoid-batch" for
|
257
|
+
# `ParsoidBatch` action and so on).
|
258
|
+
#
|
259
|
+
# @return [String]
|
260
|
+
def name
|
261
|
+
# Query # => query
|
262
|
+
# ParsoidBatch # => parsoid-batch
|
263
|
+
self.class.name.split('::').last.gsub(/([a-z])([A-Z])/, '\1-\2').downcase or
|
264
|
+
fail ArgumentError, "Can't guess action name from #{self.class.name}"
|
265
|
+
end
|
266
|
+
|
267
|
+
# All action's params in a ready to passing to URL form (string keys & string values). Unlike
|
268
|
+
# {#to_h}, includes also action name.
|
269
|
+
#
|
270
|
+
# @example
|
271
|
+
# api.query.titles('Argentina', 'Bolivia').format(:json).to_param
|
272
|
+
# # => {"titles"=>"Argentina|Bolivia", "format"=>"json", "action"=>"query"}
|
273
|
+
#
|
274
|
+
# @return [Hash{String => String}]
|
275
|
+
def to_param
|
276
|
+
to_h.merge('action' => name)
|
277
|
+
end
|
278
|
+
|
279
|
+
# Full URL for this action invocation.
|
280
|
+
#
|
281
|
+
# @example
|
282
|
+
# api.query.titles('Argentina', 'Bolivia').format(:json).to_url
|
283
|
+
# # => "https://en.wikipedia.org/w/api.php?action=query&format=json&titles=Argentina%7CBolivia"
|
284
|
+
#
|
285
|
+
# @return [String]
|
286
|
+
def to_url
|
287
|
+
url = @client.url
|
288
|
+
url.query_values = to_param
|
289
|
+
url.to_s
|
290
|
+
end
|
291
|
+
|
292
|
+
# Performs action (through `GET` or `POST` request, depending on action's type) and returns
|
293
|
+
# raw body of response.
|
294
|
+
#
|
295
|
+
# @return [String]
|
296
|
+
def perform
|
297
|
+
fail NotImplementedError,
|
298
|
+
'Action is abstract, all actions should descend from Actions::Get or Actions::Post'
|
299
|
+
end
|
300
|
+
|
301
|
+
# Performs action (as in {#perform}) and returns an instance of {Response}. It is a thing
|
302
|
+
# wrapper around parsed action's JSON response, which separates "content" and "meta" (paging,
|
303
|
+
# warnings/erros) fields.
|
304
|
+
#
|
305
|
+
# Note, that not all actions return a JSON suitable for parsing into {Response}. For example,
|
306
|
+
# Wikipedia's [opensearch](https://en.wikipedia.org/w/api.php?action=help&modules=opensearch)
|
307
|
+
# action returns absolutely different JSON structure, corresponding to global
|
308
|
+
# [OpenSearch](https://en.wikipedia.org/wiki/OpenSearch) standard.
|
309
|
+
#
|
310
|
+
# Note also, that on erroneous request (when response contains `"error"` key), this method
|
311
|
+
# will raise {Response::Error}.
|
312
|
+
#
|
313
|
+
# @return [Response]
|
314
|
+
def response
|
315
|
+
jsonable = format(:json)
|
316
|
+
Response.parse(jsonable, jsonable.perform)
|
317
|
+
end
|
318
|
+
|
319
|
+
include GlobalParams
|
320
|
+
|
321
|
+
private
|
322
|
+
|
323
|
+
# Not in indepented module to decrease generated files/modules list
|
324
|
+
def stringify_hash(hash, recursive: false)
|
325
|
+
hash.map { |k, v|
|
326
|
+
[k.to_s, v.is_a?(Hash) && recursive ? stringify_hash(v, recursive: true) : v.to_s]
|
327
|
+
}.to_h
|
328
|
+
end
|
329
|
+
|
330
|
+
protected
|
331
|
+
|
332
|
+
def submodule(mod)
|
333
|
+
extend(mod)
|
334
|
+
@submodules << mod
|
335
|
+
self
|
336
|
+
end
|
337
|
+
end
|
338
|
+
|
339
|
+
class Get < Base
|
340
|
+
def perform
|
341
|
+
client.get(to_param)
|
342
|
+
end
|
343
|
+
end
|
344
|
+
|
345
|
+
class Post < Base
|
346
|
+
def perform
|
347
|
+
client.post(to_param)
|
348
|
+
end
|
349
|
+
end
|
350
|
+
end
|
351
|
+
end
|