reality 0.1.0.alpha → 0.1.0.alpha2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. checksums.yaml +4 -4
  2. data/lib/reality/describers/wikidata.rb +2 -1
  3. data/lib/reality/describers/wikidata/sparql.rb +0 -1
  4. data/lib/reality/version.rb +1 -1
  5. metadata +2 -124
  6. data/lib/reality/describers/wikidata/actions/abusefiltercheckmatch.rb +0 -55
  7. data/lib/reality/describers/wikidata/actions/abusefilterchecksyntax.rb +0 -31
  8. data/lib/reality/describers/wikidata/actions/abusefilterevalexpression.rb +0 -31
  9. data/lib/reality/describers/wikidata/actions/abusefilterunblockautopromote.rb +0 -39
  10. data/lib/reality/describers/wikidata/actions/aggregategroups.rb +0 -76
  11. data/lib/reality/describers/wikidata/actions/antispoof.rb +0 -31
  12. data/lib/reality/describers/wikidata/actions/block.rb +0 -132
  13. data/lib/reality/describers/wikidata/actions/bouncehandler.rb +0 -31
  14. data/lib/reality/describers/wikidata/actions/categorytree.rb +0 -39
  15. data/lib/reality/describers/wikidata/actions/centralauthtoken.rb +0 -25
  16. data/lib/reality/describers/wikidata/actions/centralnoticechoicedata.rb +0 -39
  17. data/lib/reality/describers/wikidata/actions/centralnoticequerycampaign.rb +0 -31
  18. data/lib/reality/describers/wikidata/actions/changeauthenticationdata.rb +0 -39
  19. data/lib/reality/describers/wikidata/actions/checktoken.rb +0 -52
  20. data/lib/reality/describers/wikidata/actions/cirrus-config-dump.rb +0 -25
  21. data/lib/reality/describers/wikidata/actions/cirrus-mapping-dump.rb +0 -25
  22. data/lib/reality/describers/wikidata/actions/cirrus-settings-dump.rb +0 -25
  23. data/lib/reality/describers/wikidata/actions/clearhasmsg.rb +0 -25
  24. data/lib/reality/describers/wikidata/actions/clientlogin.rb +0 -86
  25. data/lib/reality/describers/wikidata/actions/compare.rb +0 -71
  26. data/lib/reality/describers/wikidata/actions/createaccount.rb +0 -86
  27. data/lib/reality/describers/wikidata/actions/cspreport.rb +0 -38
  28. data/lib/reality/describers/wikidata/actions/delete.rb +0 -103
  29. data/lib/reality/describers/wikidata/actions/deleteglobalaccount.rb +0 -47
  30. data/lib/reality/describers/wikidata/actions/echomarkread.rb +0 -77
  31. data/lib/reality/describers/wikidata/actions/echomarkseen.rb +0 -57
  32. data/lib/reality/describers/wikidata/actions/edit.rb +0 -266
  33. data/lib/reality/describers/wikidata/actions/editmassmessagelist.rb +0 -65
  34. data/lib/reality/describers/wikidata/actions/emailuser.rb +0 -62
  35. data/lib/reality/describers/wikidata/actions/expandtemplates.rb +0 -129
  36. data/lib/reality/describers/wikidata/actions/fancycaptchareload.rb +0 -25
  37. data/lib/reality/describers/wikidata/actions/featuredfeed.rb +0 -57
  38. data/lib/reality/describers/wikidata/actions/feedcontributions.rb +0 -121
  39. data/lib/reality/describers/wikidata/actions/feedrecentchanges.rb +0 -159
  40. data/lib/reality/describers/wikidata/actions/feedwatchlist.rb +0 -108
  41. data/lib/reality/describers/wikidata/actions/filerevert.rb +0 -55
  42. data/lib/reality/describers/wikidata/actions/flow-parsoid-utils.rb +0 -73
  43. data/lib/reality/describers/wikidata/actions/flow.rb +0 -72
  44. data/lib/reality/describers/wikidata/actions/flowthank.rb +0 -39
  45. data/lib/reality/describers/wikidata/actions/globalblock.rb +0 -76
  46. data/lib/reality/describers/wikidata/actions/globaluserrights.rb +0 -94
  47. data/lib/reality/describers/wikidata/actions/graph.rb +0 -47
  48. data/lib/reality/describers/wikidata/actions/groupreview.rb +0 -55
  49. data/lib/reality/describers/wikidata/actions/help.rb +0 -64
  50. data/lib/reality/describers/wikidata/actions/imagerotate.rb +0 -25
  51. data/lib/reality/describers/wikidata/actions/import.rb +0 -116
  52. data/lib/reality/describers/wikidata/actions/jsonconfig.rb +0 -60
  53. data/lib/reality/describers/wikidata/actions/jsondata.rb +0 -31
  54. data/lib/reality/describers/wikidata/actions/languagesearch.rb +0 -39
  55. data/lib/reality/describers/wikidata/actions/linkaccount.rb +0 -79
  56. data/lib/reality/describers/wikidata/actions/login.rb +0 -55
  57. data/lib/reality/describers/wikidata/actions/logout.rb +0 -25
  58. data/lib/reality/describers/wikidata/actions/managetags.rb +0 -80
  59. data/lib/reality/describers/wikidata/actions/massmessage.rb +0 -55
  60. data/lib/reality/describers/wikidata/actions/mergehistory.rb +0 -79
  61. data/lib/reality/describers/wikidata/actions/mobileview.rb +0 -170
  62. data/lib/reality/describers/wikidata/actions/move.rb +0 -131
  63. data/lib/reality/describers/wikidata/actions/oathvalidate.rb +0 -47
  64. data/lib/reality/describers/wikidata/actions/opensearch.rb +0 -92
  65. data/lib/reality/describers/wikidata/actions/options.rb +0 -80
  66. data/lib/reality/describers/wikidata/actions/paraminfo.rb +0 -91
  67. data/lib/reality/describers/wikidata/actions/parsoid-batch.rb +0 -31
  68. data/lib/reality/describers/wikidata/actions/patrol.rb +0 -60
  69. data/lib/reality/describers/wikidata/actions/protect.rb +0 -121
  70. data/lib/reality/describers/wikidata/actions/purge.rb +0 -152
  71. data/lib/reality/describers/wikidata/actions/removeauthenticationdata.rb +0 -39
  72. data/lib/reality/describers/wikidata/actions/resetpassword.rb +0 -47
  73. data/lib/reality/describers/wikidata/actions/revisiondelete.rb +0 -125
  74. data/lib/reality/describers/wikidata/actions/rollback.rb +0 -96
  75. data/lib/reality/describers/wikidata/actions/rsd.rb +0 -25
  76. data/lib/reality/describers/wikidata/actions/sanitize-mapdata.rb +0 -39
  77. data/lib/reality/describers/wikidata/actions/scribunto-console.rb +0 -62
  78. data/lib/reality/describers/wikidata/actions/searchtranslations.rb +0 -113
  79. data/lib/reality/describers/wikidata/actions/setglobalaccountstatus.rb +0 -81
  80. data/lib/reality/describers/wikidata/actions/setnotificationtimestamp.rb +0 -177
  81. data/lib/reality/describers/wikidata/actions/setpagelanguage.rb +0 -81
  82. data/lib/reality/describers/wikidata/actions/shortenurl.rb +0 -31
  83. data/lib/reality/describers/wikidata/actions/sitematrix.rb +0 -91
  84. data/lib/reality/describers/wikidata/actions/spamblacklist.rb +0 -36
  85. data/lib/reality/describers/wikidata/actions/stashedit.rb +0 -113
  86. data/lib/reality/describers/wikidata/actions/strikevote.rb +0 -60
  87. data/lib/reality/describers/wikidata/actions/tag.rb +0 -117
  88. data/lib/reality/describers/wikidata/actions/templatedata.rb +0 -145
  89. data/lib/reality/describers/wikidata/actions/thank.rb +0 -47
  90. data/lib/reality/describers/wikidata/actions/titleblacklist.rb +0 -51
  91. data/lib/reality/describers/wikidata/actions/tokens.rb +0 -36
  92. data/lib/reality/describers/wikidata/actions/transcodereset.rb +0 -47
  93. data/lib/reality/describers/wikidata/actions/translatesandbox.rb +0 -81
  94. data/lib/reality/describers/wikidata/actions/translationaids.rb +0 -52
  95. data/lib/reality/describers/wikidata/actions/translationreview.rb +0 -39
  96. data/lib/reality/describers/wikidata/actions/translationstash.rb +0 -76
  97. data/lib/reality/describers/wikidata/actions/ttmserver.rb +0 -60
  98. data/lib/reality/describers/wikidata/actions/ulslocalization.rb +0 -31
  99. data/lib/reality/describers/wikidata/actions/unblock.rb +0 -76
  100. data/lib/reality/describers/wikidata/actions/undelete.rb +0 -99
  101. data/lib/reality/describers/wikidata/actions/unlinkaccount.rb +0 -39
  102. data/lib/reality/describers/wikidata/actions/upload.rb +0 -172
  103. data/lib/reality/describers/wikidata/actions/userrights.rb +0 -107
  104. data/lib/reality/describers/wikidata/actions/validatepassword.rb +0 -55
  105. data/lib/reality/describers/wikidata/actions/visualeditor.rb +0 -96
  106. data/lib/reality/describers/wikidata/actions/visualeditoredit.rb +0 -164
  107. data/lib/reality/describers/wikidata/actions/watch.rb +0 -161
  108. data/lib/reality/describers/wikidata/actions/wbavailablebadges.rb +0 -25
  109. data/lib/reality/describers/wikidata/actions/wbcheckconstraints.rb +0 -62
  110. data/lib/reality/describers/wikidata/actions/wbcreateclaim.rb +0 -91
  111. data/lib/reality/describers/wikidata/actions/wbcreateredirect.rb +0 -54
  112. data/lib/reality/describers/wikidata/actions/wbeditentity.rb +0 -111
  113. data/lib/reality/describers/wikidata/actions/wblinktitles.rb +0 -80
  114. data/lib/reality/describers/wikidata/actions/wbmergeitems.rb +0 -75
  115. data/lib/reality/describers/wikidata/actions/wbremoveclaims.rb +0 -67
  116. data/lib/reality/describers/wikidata/actions/wbremovequalifiers.rb +0 -75
  117. data/lib/reality/describers/wikidata/actions/wbremovereferences.rb +0 -75
  118. data/lib/reality/describers/wikidata/actions/wbsetaliases.rb +0 -148
  119. data/lib/reality/describers/wikidata/actions/wbsetclaim.rb +0 -70
  120. data/lib/reality/describers/wikidata/actions/wbsetclaimvalue.rb +0 -83
  121. data/lib/reality/describers/wikidata/actions/wbsetdescription.rb +0 -117
  122. data/lib/reality/describers/wikidata/actions/wbsetlabel.rb +0 -117
  123. data/lib/reality/describers/wikidata/actions/wbsetqualifier.rb +0 -99
  124. data/lib/reality/describers/wikidata/actions/wbsetreference.rb +0 -94
  125. data/lib/reality/describers/wikidata/actions/wbsetsitelink.rb +0 -130
  126. data/lib/reality/describers/wikidata/actions/wbsgetsuggestions.rb +0 -94
  127. data/lib/reality/describers/wikidata/actions/webapp-manifest.rb +0 -25
@@ -1,145 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Reality::Describers::Wikidata::Impl
4
- module Actions
5
- # Fetch data stored by the TemplateData extension.
6
- #
7
- # Usage:
8
- #
9
- # ```ruby
10
- # api.templatedata.titles(value).perform # returns string with raw output
11
- # # or
12
- # api.templatedata.titles(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
- # {Reality::Describers::Wikidata::Impl::Response} for working with action responses.
17
- #
18
- # All action's parameters are documented as its public methods, see below.
19
- #
20
- class Templatedata < Reality::Describers::Wikidata::Impl::Actions::Get
21
-
22
- # A list of titles to work on.
23
- #
24
- # @param values [Array<String>]
25
- # @return [self]
26
- def titles(*values)
27
- values.inject(self) { |res, val| res._titles(val) }
28
- end
29
-
30
- # @private
31
- def _titles(value)
32
- merge(titles: value.to_s, replace: false)
33
- end
34
-
35
- # A list of page IDs to work on.
36
- #
37
- # @param values [Array<Integer>]
38
- # @return [self]
39
- def pageids(*values)
40
- values.inject(self) { |res, val| res._pageids(val) }
41
- end
42
-
43
- # @private
44
- def _pageids(value)
45
- merge(pageids: value.to_s, replace: false)
46
- end
47
-
48
- # A list of revision IDs to work on.
49
- #
50
- # @param values [Array<Integer>]
51
- # @return [self]
52
- def revids(*values)
53
- values.inject(self) { |res, val| res._revids(val) }
54
- end
55
-
56
- # @private
57
- def _revids(value)
58
- merge(revids: value.to_s, replace: false)
59
- end
60
-
61
- # Get the list of pages to work on by executing the specified query module.
62
- #
63
- # @param value [Symbol] Selecting an option includes tweaking methods from corresponding module:
64
- # * `:allcategories` - {Reality::Describers::Wikidata::Impl::Modules::Allcategories} Enumerate all categories.
65
- # * `:alldeletedrevisions` - {Reality::Describers::Wikidata::Impl::Modules::Alldeletedrevisions} List all deleted revisions by a user or in a namespace.
66
- # * `:allfileusages` - {Reality::Describers::Wikidata::Impl::Modules::Allfileusages} List all file usages, including non-existing.
67
- # * `:allimages` - {Reality::Describers::Wikidata::Impl::Modules::Allimages} Enumerate all images sequentially.
68
- # * `:alllinks` - {Reality::Describers::Wikidata::Impl::Modules::Alllinks} Enumerate all links that point to a given namespace.
69
- # * `:allpages` - {Reality::Describers::Wikidata::Impl::Modules::Allpages} Enumerate all pages sequentially in a given namespace.
70
- # * `:allredirects` - {Reality::Describers::Wikidata::Impl::Modules::Allredirects} List all redirects to a namespace.
71
- # * `:allrevisions` - {Reality::Describers::Wikidata::Impl::Modules::Allrevisions} List all revisions.
72
- # * `:alltransclusions` - {Reality::Describers::Wikidata::Impl::Modules::Alltransclusions} List all transclusions (pages embedded using {{x}}), including non-existing.
73
- # * `:backlinks` - {Reality::Describers::Wikidata::Impl::Modules::Backlinks} Find all pages that link to the given page.
74
- # * `:categories` - {Reality::Describers::Wikidata::Impl::Modules::Categories} List all categories the pages belong to.
75
- # * `:categorymembers` - {Reality::Describers::Wikidata::Impl::Modules::Categorymembers} List all pages in a given category.
76
- # * `:deletedrevisions` - {Reality::Describers::Wikidata::Impl::Modules::Deletedrevisions} Get deleted revision information.
77
- # * `:duplicatefiles` - {Reality::Describers::Wikidata::Impl::Modules::Duplicatefiles} List all files that are duplicates of the given files based on hash values.
78
- # * `:embeddedin` - {Reality::Describers::Wikidata::Impl::Modules::Embeddedin} Find all pages that embed (transclude) the given title.
79
- # * `:exturlusage` - {Reality::Describers::Wikidata::Impl::Modules::Exturlusage} Enumerate pages that contain a given URL.
80
- # * `:fileusage` - {Reality::Describers::Wikidata::Impl::Modules::Fileusage} Find all pages that use the given files.
81
- # * `:geosearch` - {Reality::Describers::Wikidata::Impl::Modules::Geosearch} Returns pages having coordinates that are located in a certain area.
82
- # * `:images` - {Reality::Describers::Wikidata::Impl::Modules::Images} Returns all files contained on the given pages.
83
- # * `:imageusage` - {Reality::Describers::Wikidata::Impl::Modules::Imageusage} Find all pages that use the given image title.
84
- # * `:iwbacklinks` - {Reality::Describers::Wikidata::Impl::Modules::Iwbacklinks} Find all pages that link to the given interwiki link.
85
- # * `:langbacklinks` - {Reality::Describers::Wikidata::Impl::Modules::Langbacklinks} Find all pages that link to the given language link.
86
- # * `:links` - {Reality::Describers::Wikidata::Impl::Modules::Links} Returns all links from the given pages.
87
- # * `:linkshere` - {Reality::Describers::Wikidata::Impl::Modules::Linkshere} Find all pages that link to the given pages.
88
- # * `:messagecollection` - {Reality::Describers::Wikidata::Impl::Modules::Messagecollection} Query MessageCollection about translations.
89
- # * `:mostviewed` - {Reality::Describers::Wikidata::Impl::Modules::Mostviewed} Lists the most viewed pages (based on last day's pageview count).
90
- # * `:pageswithprop` - {Reality::Describers::Wikidata::Impl::Modules::Pageswithprop} List all pages using a given page property.
91
- # * `:prefixsearch` - {Reality::Describers::Wikidata::Impl::Modules::Prefixsearch} Perform a prefix search for page titles.
92
- # * `:protectedtitles` - {Reality::Describers::Wikidata::Impl::Modules::Protectedtitles} List all titles protected from creation.
93
- # * `:querypage` - {Reality::Describers::Wikidata::Impl::Modules::Querypage} Get a list provided by a QueryPage-based special page.
94
- # * `:random` - {Reality::Describers::Wikidata::Impl::Modules::Random} Get a set of random pages.
95
- # * `:recentchanges` - {Reality::Describers::Wikidata::Impl::Modules::Recentchanges} Enumerate recent changes.
96
- # * `:redirects` - {Reality::Describers::Wikidata::Impl::Modules::Redirects} Returns all redirects to the given pages.
97
- # * `:revisions` - {Reality::Describers::Wikidata::Impl::Modules::Revisions} Get revision information.
98
- # * `:search` - {Reality::Describers::Wikidata::Impl::Modules::Search} Perform a full text search.
99
- # * `:templates` - {Reality::Describers::Wikidata::Impl::Modules::Templates} Returns all pages transcluded on the given pages.
100
- # * `:transcludedin` - {Reality::Describers::Wikidata::Impl::Modules::Transcludedin} Find all pages that transclude the given pages.
101
- # * `:watchlist` - {Reality::Describers::Wikidata::Impl::Modules::Watchlist} Get recent changes to pages in the current user's watchlist.
102
- # * `:watchlistraw` - {Reality::Describers::Wikidata::Impl::Modules::Watchlistraw} Get all pages on the current user's watchlist.
103
- # * `:wblistentityusage` - {Reality::Describers::Wikidata::Impl::Modules::Wblistentityusage} Returns all pages that use the given entity IDs.
104
- # * `:wbsearch` - {Reality::Describers::Wikidata::Impl::Modules::Wbsearch} Searches for entities using labels and aliases. This can be used as a generator for other queries. Returns the matched term that should be displayed.
105
- # @return [self]
106
- def generator(value)
107
- _generator(value) or fail ArgumentError, "Unknown value for generator: #{value}"
108
- end
109
-
110
- # @private
111
- def _generator(value)
112
- defined?(super) && super || [:allcategories, :alldeletedrevisions, :allfileusages, :allimages, :alllinks, :allpages, :allredirects, :allrevisions, :alltransclusions, :backlinks, :categories, :categorymembers, :deletedrevisions, :duplicatefiles, :embeddedin, :exturlusage, :fileusage, :geosearch, :images, :imageusage, :iwbacklinks, :langbacklinks, :links, :linkshere, :messagecollection, :mostviewed, :pageswithprop, :prefixsearch, :protectedtitles, :querypage, :random, :recentchanges, :redirects, :revisions, :search, :templates, :transcludedin, :watchlist, :watchlistraw, :wblistentityusage, :wbsearch].include?(value.to_sym) && merge(generator: value.to_s).submodule({allcategories: Modules::Allcategories, alldeletedrevisions: Modules::Alldeletedrevisions, allfileusages: Modules::Allfileusages, allimages: Modules::Allimages, alllinks: Modules::Alllinks, allpages: Modules::Allpages, allredirects: Modules::Allredirects, allrevisions: Modules::Allrevisions, alltransclusions: Modules::Alltransclusions, backlinks: Modules::Backlinks, categories: Modules::Categories, categorymembers: Modules::Categorymembers, deletedrevisions: Modules::Deletedrevisions, duplicatefiles: Modules::Duplicatefiles, embeddedin: Modules::Embeddedin, exturlusage: Modules::Exturlusage, fileusage: Modules::Fileusage, geosearch: Modules::Geosearch, images: Modules::Images, imageusage: Modules::Imageusage, iwbacklinks: Modules::Iwbacklinks, langbacklinks: Modules::Langbacklinks, links: Modules::Links, linkshere: Modules::Linkshere, messagecollection: Modules::Messagecollection, mostviewed: Modules::Mostviewed, pageswithprop: Modules::Pageswithprop, prefixsearch: Modules::Prefixsearch, protectedtitles: Modules::Protectedtitles, querypage: Modules::Querypage, random: Modules::Random, recentchanges: Modules::Recentchanges, redirects: Modules::Redirects, revisions: Modules::Revisions, search: Modules::Search, templates: Modules::Templates, transcludedin: Modules::Transcludedin, watchlist: Modules::Watchlist, watchlistraw: Modules::Watchlistraw, wblistentityusage: Modules::Wblistentityusage, wbsearch: Modules::Wbsearch}[value.to_sym])
113
- end
114
-
115
- # Automatically resolve redirects in titles, pageids, and revids, and in pages returned by generator.
116
- #
117
- # @return [self]
118
- def redirects()
119
- merge(redirects: 'true')
120
- end
121
-
122
- # Convert titles to other variants if necessary. Only works if the wiki's content language supports variant conversion. Languages that support variant conversion include gan, iu, kk, ku, shi, sr, tg, uz and zh.
123
- #
124
- # @return [self]
125
- def converttitles()
126
- merge(converttitles: 'true')
127
- end
128
-
129
- # Return data about titles even if they are missing or lack TemplateData. By default (for backwards compatibility) titles are only returned if they exist and have TemplateData.
130
- #
131
- # @return [self]
132
- def doNotIgnoreMissingTitles()
133
- merge(doNotIgnoreMissingTitles: 'true')
134
- end
135
-
136
- # Return localized values in this language. By default all available translations are returned.
137
- #
138
- # @param value [String]
139
- # @return [self]
140
- def lang(value)
141
- merge(lang: value.to_s)
142
- end
143
- end
144
- end
145
- end
@@ -1,47 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Reality::Describers::Wikidata::Impl
4
- module Actions
5
- # Send a thank-you notification to an editor.
6
- #
7
- # Usage:
8
- #
9
- # ```ruby
10
- # api.thank.rev(value).perform # returns string with raw output
11
- # # or
12
- # api.thank.rev(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
- # {Reality::Describers::Wikidata::Impl::Response} for working with action responses.
17
- #
18
- # All action's parameters are documented as its public methods, see below.
19
- #
20
- class Thank < Reality::Describers::Wikidata::Impl::Actions::Post
21
-
22
- # Revision ID to thank someone for.
23
- #
24
- # @param value [Integer]
25
- # @return [self]
26
- def rev(value)
27
- merge(rev: 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
-
38
- # A short string describing the source of the request, for example diff or history.
39
- #
40
- # @param value [String]
41
- # @return [self]
42
- def source(value)
43
- merge(source: value.to_s)
44
- end
45
- end
46
- end
47
- end
@@ -1,51 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Reality::Describers::Wikidata::Impl
4
- module Actions
5
- # Validate an article title, filename, or username against the TitleBlacklist.
6
- #
7
- # Usage:
8
- #
9
- # ```ruby
10
- # api.titleblacklist.title(value).perform # returns string with raw output
11
- # # or
12
- # api.titleblacklist.title(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
- # {Reality::Describers::Wikidata::Impl::Response} for working with action responses.
17
- #
18
- # All action's parameters are documented as its public methods, see below.
19
- #
20
- class Titleblacklist < Reality::Describers::Wikidata::Impl::Actions::Get
21
-
22
- # The string to validate against the blacklist.
23
- #
24
- # @param value [String]
25
- # @return [self]
26
- def title(value)
27
- merge(tbtitle: value.to_s)
28
- end
29
-
30
- # The action to be checked.
31
- #
32
- # @param value [String] One of "create", "edit", "upload", "createtalk", "createpage", "move", "new-account".
33
- # @return [self]
34
- def action(value)
35
- _action(value) or fail ArgumentError, "Unknown value for action: #{value}"
36
- end
37
-
38
- # @private
39
- def _action(value)
40
- defined?(super) && super || ["create", "edit", "upload", "createtalk", "createpage", "move", "new-account"].include?(value.to_s) && merge(tbaction: value.to_s)
41
- end
42
-
43
- # Don't try to override the titleblacklist.
44
- #
45
- # @return [self]
46
- def nooverride()
47
- merge(tbnooverride: 'true')
48
- end
49
- end
50
- end
51
- end
@@ -1,36 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Reality::Describers::Wikidata::Impl
4
- module Actions
5
- # Get tokens for data-modifying actions.
6
- #
7
- # Usage:
8
- #
9
- # ```ruby
10
- # api.tokens.type(value).perform # returns string with raw output
11
- # # or
12
- # api.tokens.type(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
- # {Reality::Describers::Wikidata::Impl::Response} for working with action responses.
17
- #
18
- # All action's parameters are documented as its public methods, see below.
19
- #
20
- class Tokens < Reality::Describers::Wikidata::Impl::Actions::Get
21
-
22
- # Types of token to request.
23
- #
24
- # @param values [Array<String>] Allowed values: "block", "createaccount", "csrf", "delete", "deleteglobalaccount", "edit", "email", "import", "login", "move", "options", "patrol", "protect", "rollback", "setglobalaccountstatus", "unblock", "userrights", "watch".
25
- # @return [self]
26
- def type(*values)
27
- values.inject(self) { |res, val| res._type(val) or fail ArgumentError, "Unknown value for type: #{val}" }
28
- end
29
-
30
- # @private
31
- def _type(value)
32
- defined?(super) && super || ["block", "createaccount", "csrf", "delete", "deleteglobalaccount", "edit", "email", "import", "login", "move", "options", "patrol", "protect", "rollback", "setglobalaccountstatus", "unblock", "userrights", "watch"].include?(value.to_s) && merge(type: value.to_s, replace: false)
33
- end
34
- end
35
- end
36
- end
@@ -1,47 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Reality::Describers::Wikidata::Impl
4
- module Actions
5
- # Users with the 'transcode-reset' right can reset and re-run a transcode job.
6
- #
7
- # Usage:
8
- #
9
- # ```ruby
10
- # api.transcodereset.title(value).perform # returns string with raw output
11
- # # or
12
- # api.transcodereset.title(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
- # {Reality::Describers::Wikidata::Impl::Response} for working with action responses.
17
- #
18
- # All action's parameters are documented as its public methods, see below.
19
- #
20
- class Transcodereset < Reality::Describers::Wikidata::Impl::Actions::Post
21
-
22
- # The media file title.
23
- #
24
- # @param value [String]
25
- # @return [self]
26
- def title(value)
27
- merge(title: value.to_s)
28
- end
29
-
30
- # The transcode key you wish to reset. Fetch from action=query&prop=transcodestatus.
31
- #
32
- # @param value [String]
33
- # @return [self]
34
- def transcodekey(value)
35
- merge(transcodekey: value.to_s)
36
- end
37
-
38
- # A "csrf" token retrieved from action=query&meta=tokens
39
- #
40
- # @param value [String]
41
- # @return [self]
42
- def token(value)
43
- merge(token: value.to_s)
44
- end
45
- end
46
- end
47
- end
@@ -1,81 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Reality::Describers::Wikidata::Impl
4
- module Actions
5
- # Signup and manage sandboxed users.
6
- #
7
- # Usage:
8
- #
9
- # ```ruby
10
- # api.translatesandbox.do(value).perform # returns string with raw output
11
- # # or
12
- # api.translatesandbox.do(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
- # {Reality::Describers::Wikidata::Impl::Response} for working with action responses.
17
- #
18
- # All action's parameters are documented as its public methods, see below.
19
- #
20
- class Translatesandbox < Reality::Describers::Wikidata::Impl::Actions::Post
21
-
22
- # What to do.
23
- #
24
- # @param value [String] One of "create", "delete", "promote", "remind".
25
- # @return [self]
26
- def do(value)
27
- _do(value) or fail ArgumentError, "Unknown value for do: #{value}"
28
- end
29
-
30
- # @private
31
- def _do(value)
32
- defined?(super) && super || ["create", "delete", "promote", "remind"].include?(value.to_s) && merge(do: value.to_s)
33
- end
34
-
35
- # User IDs of the users being managed. Use 0 for creations.
36
- #
37
- # @param values [Array<Integer>]
38
- # @return [self]
39
- def userid(*values)
40
- values.inject(self) { |res, val| res._userid(val) }
41
- end
42
-
43
- # @private
44
- def _userid(value)
45
- merge(userid: value.to_s, replace: false)
46
- end
47
-
48
- # A "csrf" token retrieved from action=query&meta=tokens
49
- #
50
- # @param value [String]
51
- # @return [self]
52
- def token(value)
53
- merge(token: value.to_s)
54
- end
55
-
56
- # Username when creating user.
57
- #
58
- # @param value [String]
59
- # @return [self]
60
- def username(value)
61
- merge(username: value.to_s)
62
- end
63
-
64
- # Password when creating user.
65
- #
66
- # @param value [String]
67
- # @return [self]
68
- def password(value)
69
- merge(password: value.to_s)
70
- end
71
-
72
- # Email when creating user.
73
- #
74
- # @param value [String]
75
- # @return [self]
76
- def email(value)
77
- merge(email: value.to_s)
78
- end
79
- end
80
- end
81
- end
@@ -1,52 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Reality::Describers::Wikidata::Impl
4
- module Actions
5
- # Query all translations aids.
6
- #
7
- # Usage:
8
- #
9
- # ```ruby
10
- # api.translationaids.title(value).perform # returns string with raw output
11
- # # or
12
- # api.translationaids.title(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
- # {Reality::Describers::Wikidata::Impl::Response} for working with action responses.
17
- #
18
- # All action's parameters are documented as its public methods, see below.
19
- #
20
- class Translationaids < Reality::Describers::Wikidata::Impl::Actions::Get
21
-
22
- # Full title of a known message.
23
- #
24
- # @param value [String]
25
- # @return [self]
26
- def title(value)
27
- merge(title: value.to_s)
28
- end
29
-
30
- # Message group the message belongs to. If empty then primary group is used.
31
- #
32
- # @param value [String]
33
- # @return [self]
34
- def group(value)
35
- merge(group: value.to_s)
36
- end
37
-
38
- # Which translation helpers to include.
39
- #
40
- # @param values [Array<String>] Allowed values: "definition", "translation", "inotherlanguages", "documentation", "mt", "definitiondiff", "ttmserver", "support", "gettext", "insertables".
41
- # @return [self]
42
- def prop(*values)
43
- values.inject(self) { |res, val| res._prop(val) or fail ArgumentError, "Unknown value for prop: #{val}" }
44
- end
45
-
46
- # @private
47
- def _prop(value)
48
- defined?(super) && super || ["definition", "translation", "inotherlanguages", "documentation", "mt", "definitiondiff", "ttmserver", "support", "gettext", "insertables"].include?(value.to_s) && merge(prop: value.to_s, replace: false)
49
- end
50
- end
51
- end
52
- end