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.
- checksums.yaml +4 -4
- data/lib/reality/describers/wikidata.rb +2 -1
- data/lib/reality/describers/wikidata/sparql.rb +0 -1
- data/lib/reality/version.rb +1 -1
- metadata +2 -124
- data/lib/reality/describers/wikidata/actions/abusefiltercheckmatch.rb +0 -55
- data/lib/reality/describers/wikidata/actions/abusefilterchecksyntax.rb +0 -31
- data/lib/reality/describers/wikidata/actions/abusefilterevalexpression.rb +0 -31
- data/lib/reality/describers/wikidata/actions/abusefilterunblockautopromote.rb +0 -39
- data/lib/reality/describers/wikidata/actions/aggregategroups.rb +0 -76
- data/lib/reality/describers/wikidata/actions/antispoof.rb +0 -31
- data/lib/reality/describers/wikidata/actions/block.rb +0 -132
- data/lib/reality/describers/wikidata/actions/bouncehandler.rb +0 -31
- data/lib/reality/describers/wikidata/actions/categorytree.rb +0 -39
- data/lib/reality/describers/wikidata/actions/centralauthtoken.rb +0 -25
- data/lib/reality/describers/wikidata/actions/centralnoticechoicedata.rb +0 -39
- data/lib/reality/describers/wikidata/actions/centralnoticequerycampaign.rb +0 -31
- data/lib/reality/describers/wikidata/actions/changeauthenticationdata.rb +0 -39
- data/lib/reality/describers/wikidata/actions/checktoken.rb +0 -52
- data/lib/reality/describers/wikidata/actions/cirrus-config-dump.rb +0 -25
- data/lib/reality/describers/wikidata/actions/cirrus-mapping-dump.rb +0 -25
- data/lib/reality/describers/wikidata/actions/cirrus-settings-dump.rb +0 -25
- data/lib/reality/describers/wikidata/actions/clearhasmsg.rb +0 -25
- data/lib/reality/describers/wikidata/actions/clientlogin.rb +0 -86
- data/lib/reality/describers/wikidata/actions/compare.rb +0 -71
- data/lib/reality/describers/wikidata/actions/createaccount.rb +0 -86
- data/lib/reality/describers/wikidata/actions/cspreport.rb +0 -38
- data/lib/reality/describers/wikidata/actions/delete.rb +0 -103
- data/lib/reality/describers/wikidata/actions/deleteglobalaccount.rb +0 -47
- data/lib/reality/describers/wikidata/actions/echomarkread.rb +0 -77
- data/lib/reality/describers/wikidata/actions/echomarkseen.rb +0 -57
- data/lib/reality/describers/wikidata/actions/edit.rb +0 -266
- data/lib/reality/describers/wikidata/actions/editmassmessagelist.rb +0 -65
- data/lib/reality/describers/wikidata/actions/emailuser.rb +0 -62
- data/lib/reality/describers/wikidata/actions/expandtemplates.rb +0 -129
- data/lib/reality/describers/wikidata/actions/fancycaptchareload.rb +0 -25
- data/lib/reality/describers/wikidata/actions/featuredfeed.rb +0 -57
- data/lib/reality/describers/wikidata/actions/feedcontributions.rb +0 -121
- data/lib/reality/describers/wikidata/actions/feedrecentchanges.rb +0 -159
- data/lib/reality/describers/wikidata/actions/feedwatchlist.rb +0 -108
- data/lib/reality/describers/wikidata/actions/filerevert.rb +0 -55
- data/lib/reality/describers/wikidata/actions/flow-parsoid-utils.rb +0 -73
- data/lib/reality/describers/wikidata/actions/flow.rb +0 -72
- data/lib/reality/describers/wikidata/actions/flowthank.rb +0 -39
- data/lib/reality/describers/wikidata/actions/globalblock.rb +0 -76
- data/lib/reality/describers/wikidata/actions/globaluserrights.rb +0 -94
- data/lib/reality/describers/wikidata/actions/graph.rb +0 -47
- data/lib/reality/describers/wikidata/actions/groupreview.rb +0 -55
- data/lib/reality/describers/wikidata/actions/help.rb +0 -64
- data/lib/reality/describers/wikidata/actions/imagerotate.rb +0 -25
- data/lib/reality/describers/wikidata/actions/import.rb +0 -116
- data/lib/reality/describers/wikidata/actions/jsonconfig.rb +0 -60
- data/lib/reality/describers/wikidata/actions/jsondata.rb +0 -31
- data/lib/reality/describers/wikidata/actions/languagesearch.rb +0 -39
- data/lib/reality/describers/wikidata/actions/linkaccount.rb +0 -79
- data/lib/reality/describers/wikidata/actions/login.rb +0 -55
- data/lib/reality/describers/wikidata/actions/logout.rb +0 -25
- data/lib/reality/describers/wikidata/actions/managetags.rb +0 -80
- data/lib/reality/describers/wikidata/actions/massmessage.rb +0 -55
- data/lib/reality/describers/wikidata/actions/mergehistory.rb +0 -79
- data/lib/reality/describers/wikidata/actions/mobileview.rb +0 -170
- data/lib/reality/describers/wikidata/actions/move.rb +0 -131
- data/lib/reality/describers/wikidata/actions/oathvalidate.rb +0 -47
- data/lib/reality/describers/wikidata/actions/opensearch.rb +0 -92
- data/lib/reality/describers/wikidata/actions/options.rb +0 -80
- data/lib/reality/describers/wikidata/actions/paraminfo.rb +0 -91
- data/lib/reality/describers/wikidata/actions/parsoid-batch.rb +0 -31
- data/lib/reality/describers/wikidata/actions/patrol.rb +0 -60
- data/lib/reality/describers/wikidata/actions/protect.rb +0 -121
- data/lib/reality/describers/wikidata/actions/purge.rb +0 -152
- data/lib/reality/describers/wikidata/actions/removeauthenticationdata.rb +0 -39
- data/lib/reality/describers/wikidata/actions/resetpassword.rb +0 -47
- data/lib/reality/describers/wikidata/actions/revisiondelete.rb +0 -125
- data/lib/reality/describers/wikidata/actions/rollback.rb +0 -96
- data/lib/reality/describers/wikidata/actions/rsd.rb +0 -25
- data/lib/reality/describers/wikidata/actions/sanitize-mapdata.rb +0 -39
- data/lib/reality/describers/wikidata/actions/scribunto-console.rb +0 -62
- data/lib/reality/describers/wikidata/actions/searchtranslations.rb +0 -113
- data/lib/reality/describers/wikidata/actions/setglobalaccountstatus.rb +0 -81
- data/lib/reality/describers/wikidata/actions/setnotificationtimestamp.rb +0 -177
- data/lib/reality/describers/wikidata/actions/setpagelanguage.rb +0 -81
- data/lib/reality/describers/wikidata/actions/shortenurl.rb +0 -31
- data/lib/reality/describers/wikidata/actions/sitematrix.rb +0 -91
- data/lib/reality/describers/wikidata/actions/spamblacklist.rb +0 -36
- data/lib/reality/describers/wikidata/actions/stashedit.rb +0 -113
- data/lib/reality/describers/wikidata/actions/strikevote.rb +0 -60
- data/lib/reality/describers/wikidata/actions/tag.rb +0 -117
- data/lib/reality/describers/wikidata/actions/templatedata.rb +0 -145
- data/lib/reality/describers/wikidata/actions/thank.rb +0 -47
- data/lib/reality/describers/wikidata/actions/titleblacklist.rb +0 -51
- data/lib/reality/describers/wikidata/actions/tokens.rb +0 -36
- data/lib/reality/describers/wikidata/actions/transcodereset.rb +0 -47
- data/lib/reality/describers/wikidata/actions/translatesandbox.rb +0 -81
- data/lib/reality/describers/wikidata/actions/translationaids.rb +0 -52
- data/lib/reality/describers/wikidata/actions/translationreview.rb +0 -39
- data/lib/reality/describers/wikidata/actions/translationstash.rb +0 -76
- data/lib/reality/describers/wikidata/actions/ttmserver.rb +0 -60
- data/lib/reality/describers/wikidata/actions/ulslocalization.rb +0 -31
- data/lib/reality/describers/wikidata/actions/unblock.rb +0 -76
- data/lib/reality/describers/wikidata/actions/undelete.rb +0 -99
- data/lib/reality/describers/wikidata/actions/unlinkaccount.rb +0 -39
- data/lib/reality/describers/wikidata/actions/upload.rb +0 -172
- data/lib/reality/describers/wikidata/actions/userrights.rb +0 -107
- data/lib/reality/describers/wikidata/actions/validatepassword.rb +0 -55
- data/lib/reality/describers/wikidata/actions/visualeditor.rb +0 -96
- data/lib/reality/describers/wikidata/actions/visualeditoredit.rb +0 -164
- data/lib/reality/describers/wikidata/actions/watch.rb +0 -161
- data/lib/reality/describers/wikidata/actions/wbavailablebadges.rb +0 -25
- data/lib/reality/describers/wikidata/actions/wbcheckconstraints.rb +0 -62
- data/lib/reality/describers/wikidata/actions/wbcreateclaim.rb +0 -91
- data/lib/reality/describers/wikidata/actions/wbcreateredirect.rb +0 -54
- data/lib/reality/describers/wikidata/actions/wbeditentity.rb +0 -111
- data/lib/reality/describers/wikidata/actions/wblinktitles.rb +0 -80
- data/lib/reality/describers/wikidata/actions/wbmergeitems.rb +0 -75
- data/lib/reality/describers/wikidata/actions/wbremoveclaims.rb +0 -67
- data/lib/reality/describers/wikidata/actions/wbremovequalifiers.rb +0 -75
- data/lib/reality/describers/wikidata/actions/wbremovereferences.rb +0 -75
- data/lib/reality/describers/wikidata/actions/wbsetaliases.rb +0 -148
- data/lib/reality/describers/wikidata/actions/wbsetclaim.rb +0 -70
- data/lib/reality/describers/wikidata/actions/wbsetclaimvalue.rb +0 -83
- data/lib/reality/describers/wikidata/actions/wbsetdescription.rb +0 -117
- data/lib/reality/describers/wikidata/actions/wbsetlabel.rb +0 -117
- data/lib/reality/describers/wikidata/actions/wbsetqualifier.rb +0 -99
- data/lib/reality/describers/wikidata/actions/wbsetreference.rb +0 -94
- data/lib/reality/describers/wikidata/actions/wbsetsitelink.rb +0 -130
- data/lib/reality/describers/wikidata/actions/wbsgetsuggestions.rb +0 -94
- data/lib/reality/describers/wikidata/actions/webapp-manifest.rb +0 -25
@@ -1,131 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Reality::Describers::Wikidata::Impl
|
4
|
-
module Actions
|
5
|
-
# Move a page.
|
6
|
-
#
|
7
|
-
# Usage:
|
8
|
-
#
|
9
|
-
# ```ruby
|
10
|
-
# api.move.from(value).perform # returns string with raw output
|
11
|
-
# # or
|
12
|
-
# api.move.from(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 Move < Reality::Describers::Wikidata::Impl::Actions::Post
|
21
|
-
|
22
|
-
# Title of the page to rename. Cannot be used together with fromid.
|
23
|
-
#
|
24
|
-
# @param value [String]
|
25
|
-
# @return [self]
|
26
|
-
def from(value)
|
27
|
-
merge(from: value.to_s)
|
28
|
-
end
|
29
|
-
|
30
|
-
# Page ID of the page to rename. Cannot be used together with from.
|
31
|
-
#
|
32
|
-
# @param value [Integer]
|
33
|
-
# @return [self]
|
34
|
-
def fromid(value)
|
35
|
-
merge(fromid: value.to_s)
|
36
|
-
end
|
37
|
-
|
38
|
-
# Title to rename the page to.
|
39
|
-
#
|
40
|
-
# @param value [String]
|
41
|
-
# @return [self]
|
42
|
-
def to(value)
|
43
|
-
merge(to: value.to_s)
|
44
|
-
end
|
45
|
-
|
46
|
-
# Reason for the rename.
|
47
|
-
#
|
48
|
-
# @param value [String]
|
49
|
-
# @return [self]
|
50
|
-
def reason(value)
|
51
|
-
merge(reason: value.to_s)
|
52
|
-
end
|
53
|
-
|
54
|
-
# Rename the talk page, if it exists.
|
55
|
-
#
|
56
|
-
# @return [self]
|
57
|
-
def movetalk()
|
58
|
-
merge(movetalk: 'true')
|
59
|
-
end
|
60
|
-
|
61
|
-
# Rename subpages, if applicable.
|
62
|
-
#
|
63
|
-
# @return [self]
|
64
|
-
def movesubpages()
|
65
|
-
merge(movesubpages: 'true')
|
66
|
-
end
|
67
|
-
|
68
|
-
# Don't create a redirect.
|
69
|
-
#
|
70
|
-
# @return [self]
|
71
|
-
def noredirect()
|
72
|
-
merge(noredirect: 'true')
|
73
|
-
end
|
74
|
-
|
75
|
-
# Add the page and the redirect to the current user's watchlist.
|
76
|
-
#
|
77
|
-
# @return [self]
|
78
|
-
def watch()
|
79
|
-
merge(watch: 'true')
|
80
|
-
end
|
81
|
-
|
82
|
-
# Remove the page and the redirect from the current user's watchlist.
|
83
|
-
#
|
84
|
-
# @return [self]
|
85
|
-
def unwatch()
|
86
|
-
merge(unwatch: 'true')
|
87
|
-
end
|
88
|
-
|
89
|
-
# Unconditionally add or remove the page from the current user's watchlist, use preferences or do not change watch.
|
90
|
-
#
|
91
|
-
# @param value [String] One of "watch", "unwatch", "preferences", "nochange".
|
92
|
-
# @return [self]
|
93
|
-
def watchlist(value)
|
94
|
-
_watchlist(value) or fail ArgumentError, "Unknown value for watchlist: #{value}"
|
95
|
-
end
|
96
|
-
|
97
|
-
# @private
|
98
|
-
def _watchlist(value)
|
99
|
-
defined?(super) && super || ["watch", "unwatch", "preferences", "nochange"].include?(value.to_s) && merge(watchlist: value.to_s)
|
100
|
-
end
|
101
|
-
|
102
|
-
# Ignore any warnings.
|
103
|
-
#
|
104
|
-
# @return [self]
|
105
|
-
def ignorewarnings()
|
106
|
-
merge(ignorewarnings: 'true')
|
107
|
-
end
|
108
|
-
|
109
|
-
# Change tags to apply to the entry in the move log and to the null revision on the destination page.
|
110
|
-
#
|
111
|
-
# @param values [Array<String>] Allowed values: "InfoboxExport gadget", "WE-Framework gadget".
|
112
|
-
# @return [self]
|
113
|
-
def tags(*values)
|
114
|
-
values.inject(self) { |res, val| res._tags(val) or fail ArgumentError, "Unknown value for tags: #{val}" }
|
115
|
-
end
|
116
|
-
|
117
|
-
# @private
|
118
|
-
def _tags(value)
|
119
|
-
defined?(super) && super || ["InfoboxExport gadget", "WE-Framework gadget"].include?(value.to_s) && merge(tags: value.to_s, replace: false)
|
120
|
-
end
|
121
|
-
|
122
|
-
# A "csrf" token retrieved from action=query&meta=tokens
|
123
|
-
#
|
124
|
-
# @param value [String]
|
125
|
-
# @return [self]
|
126
|
-
def token(value)
|
127
|
-
merge(token: value.to_s)
|
128
|
-
end
|
129
|
-
end
|
130
|
-
end
|
131
|
-
end
|
@@ -1,47 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Reality::Describers::Wikidata::Impl
|
4
|
-
module Actions
|
5
|
-
# Validate a two-factor authentication (OATH) token.
|
6
|
-
#
|
7
|
-
# Usage:
|
8
|
-
#
|
9
|
-
# ```ruby
|
10
|
-
# api.oathvalidate.user(value).perform # returns string with raw output
|
11
|
-
# # or
|
12
|
-
# api.oathvalidate.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
|
-
# {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 Oathvalidate < Reality::Describers::Wikidata::Impl::Actions::Post
|
21
|
-
|
22
|
-
# User to validate token for. Defaults to the current user.
|
23
|
-
#
|
24
|
-
# @param value [String]
|
25
|
-
# @return [self]
|
26
|
-
def user(value)
|
27
|
-
merge(user: value.to_s)
|
28
|
-
end
|
29
|
-
|
30
|
-
# Two-factor authentication (OATH) token.
|
31
|
-
#
|
32
|
-
# @param value [String]
|
33
|
-
# @return [self]
|
34
|
-
def totp(value)
|
35
|
-
merge(totp: 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,92 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Reality::Describers::Wikidata::Impl
|
4
|
-
module Actions
|
5
|
-
# Search the wiki using the OpenSearch protocol.
|
6
|
-
#
|
7
|
-
# Usage:
|
8
|
-
#
|
9
|
-
# ```ruby
|
10
|
-
# api.opensearch.search(value).perform # returns string with raw output
|
11
|
-
# # or
|
12
|
-
# api.opensearch.search(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 Opensearch < Reality::Describers::Wikidata::Impl::Actions::Get
|
21
|
-
|
22
|
-
# Search string.
|
23
|
-
#
|
24
|
-
# @param value [String]
|
25
|
-
# @return [self]
|
26
|
-
def search(value)
|
27
|
-
merge(search: value.to_s)
|
28
|
-
end
|
29
|
-
|
30
|
-
# Namespaces to search.
|
31
|
-
#
|
32
|
-
# @param values [Array<String>] Allowed values: "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "120", "121", "122", "123", "828", "829", "1198", "1199", "2300", "2301", "2302", "2303", "2600".
|
33
|
-
# @return [self]
|
34
|
-
def namespace(*values)
|
35
|
-
values.inject(self) { |res, val| res._namespace(val) or fail ArgumentError, "Unknown value for namespace: #{val}" }
|
36
|
-
end
|
37
|
-
|
38
|
-
# @private
|
39
|
-
def _namespace(value)
|
40
|
-
defined?(super) && super || ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "120", "121", "122", "123", "828", "829", "1198", "1199", "2300", "2301", "2302", "2303", "2600"].include?(value.to_s) && merge(namespace: value.to_s, replace: false)
|
41
|
-
end
|
42
|
-
|
43
|
-
# Maximum number of results to return.
|
44
|
-
#
|
45
|
-
# @param value [Integer, "max"]
|
46
|
-
# @return [self]
|
47
|
-
def limit(value)
|
48
|
-
merge(limit: value.to_s)
|
49
|
-
end
|
50
|
-
|
51
|
-
# Do nothing if $wgEnableOpenSearchSuggest is false.
|
52
|
-
#
|
53
|
-
# @return [self]
|
54
|
-
def suggest()
|
55
|
-
merge(suggest: 'true')
|
56
|
-
end
|
57
|
-
|
58
|
-
# How to handle redirects:
|
59
|
-
#
|
60
|
-
# @param value [String] One of "return" (Return the redirect itself), "resolve" (Return the target page. May return fewer than limit results).
|
61
|
-
# @return [self]
|
62
|
-
def redirects(value)
|
63
|
-
_redirects(value) or fail ArgumentError, "Unknown value for redirects: #{value}"
|
64
|
-
end
|
65
|
-
|
66
|
-
# @private
|
67
|
-
def _redirects(value)
|
68
|
-
defined?(super) && super || ["return", "resolve"].include?(value.to_s) && merge(redirects: value.to_s)
|
69
|
-
end
|
70
|
-
|
71
|
-
# The format of the output.
|
72
|
-
#
|
73
|
-
# @param value [String] One of "json", "jsonfm", "xml", "xmlfm".
|
74
|
-
# @return [self]
|
75
|
-
def format(value)
|
76
|
-
_format(value) or fail ArgumentError, "Unknown value for format: #{value}"
|
77
|
-
end
|
78
|
-
|
79
|
-
# @private
|
80
|
-
def _format(value)
|
81
|
-
defined?(super) && super || ["json", "jsonfm", "xml", "xmlfm"].include?(value.to_s) && merge(format: value.to_s)
|
82
|
-
end
|
83
|
-
|
84
|
-
# If warnings are raised with format=json, return an API error instead of ignoring them.
|
85
|
-
#
|
86
|
-
# @return [self]
|
87
|
-
def warningsaserror()
|
88
|
-
merge(warningsaserror: 'true')
|
89
|
-
end
|
90
|
-
end
|
91
|
-
end
|
92
|
-
end
|
@@ -1,80 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Reality::Describers::Wikidata::Impl
|
4
|
-
module Actions
|
5
|
-
# Change preferences of the current user.
|
6
|
-
#
|
7
|
-
# Usage:
|
8
|
-
#
|
9
|
-
# ```ruby
|
10
|
-
# api.options.reset(value).perform # returns string with raw output
|
11
|
-
# # or
|
12
|
-
# api.options.reset(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 Options < Reality::Describers::Wikidata::Impl::Actions::Post
|
21
|
-
|
22
|
-
# Resets preferences to the site defaults.
|
23
|
-
#
|
24
|
-
# @return [self]
|
25
|
-
def reset()
|
26
|
-
merge(reset: 'true')
|
27
|
-
end
|
28
|
-
|
29
|
-
# List of types of options to reset when the reset option is set.
|
30
|
-
#
|
31
|
-
# @param values [Array<String>] Allowed values: "registered", "registered-multiselect", "registered-checkmatrix", "userjs", "special", "unused", "all".
|
32
|
-
# @return [self]
|
33
|
-
def resetkinds(*values)
|
34
|
-
values.inject(self) { |res, val| res._resetkinds(val) or fail ArgumentError, "Unknown value for resetkinds: #{val}" }
|
35
|
-
end
|
36
|
-
|
37
|
-
# @private
|
38
|
-
def _resetkinds(value)
|
39
|
-
defined?(super) && super || ["registered", "registered-multiselect", "registered-checkmatrix", "userjs", "special", "unused", "all"].include?(value.to_s) && merge(resetkinds: value.to_s, replace: false)
|
40
|
-
end
|
41
|
-
|
42
|
-
# List of changes, formatted name=value (e.g. skin=vector). If no value is given (not even an equals sign), e.g., optionname|otheroption|..., the option will be reset to its default value. If any value passed contains the pipe character (|), use the alternative multiple-value separator for correct operation.
|
43
|
-
#
|
44
|
-
# @param values [Array<String>]
|
45
|
-
# @return [self]
|
46
|
-
def change(*values)
|
47
|
-
values.inject(self) { |res, val| res._change(val) }
|
48
|
-
end
|
49
|
-
|
50
|
-
# @private
|
51
|
-
def _change(value)
|
52
|
-
merge(change: value.to_s, replace: false)
|
53
|
-
end
|
54
|
-
|
55
|
-
# The name of the option that should be set to the value given by optionvalue.
|
56
|
-
#
|
57
|
-
# @param value [String]
|
58
|
-
# @return [self]
|
59
|
-
def optionname(value)
|
60
|
-
merge(optionname: value.to_s)
|
61
|
-
end
|
62
|
-
|
63
|
-
# The value for the option specified by optionname.
|
64
|
-
#
|
65
|
-
# @param value [String]
|
66
|
-
# @return [self]
|
67
|
-
def optionvalue(value)
|
68
|
-
merge(optionvalue: value.to_s)
|
69
|
-
end
|
70
|
-
|
71
|
-
# A "csrf" token retrieved from action=query&meta=tokens
|
72
|
-
#
|
73
|
-
# @param value [String]
|
74
|
-
# @return [self]
|
75
|
-
def token(value)
|
76
|
-
merge(token: value.to_s)
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
@@ -1,91 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Reality::Describers::Wikidata::Impl
|
4
|
-
module Actions
|
5
|
-
# Obtain information about API modules.
|
6
|
-
#
|
7
|
-
# Usage:
|
8
|
-
#
|
9
|
-
# ```ruby
|
10
|
-
# api.paraminfo.modules(value).perform # returns string with raw output
|
11
|
-
# # or
|
12
|
-
# api.paraminfo.modules(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 Paraminfo < Reality::Describers::Wikidata::Impl::Actions::Get
|
21
|
-
|
22
|
-
# List of module names (values of the action and format parameters, or main). Can specify submodules with a +, or all submodules with +*, or all submodules recursively with +**.
|
23
|
-
#
|
24
|
-
# @param values [Array<String>]
|
25
|
-
# @return [self]
|
26
|
-
def modules(*values)
|
27
|
-
values.inject(self) { |res, val| res._modules(val) }
|
28
|
-
end
|
29
|
-
|
30
|
-
# @private
|
31
|
-
def _modules(value)
|
32
|
-
merge(modules: value.to_s, replace: false)
|
33
|
-
end
|
34
|
-
|
35
|
-
# Format of help strings.
|
36
|
-
#
|
37
|
-
# @param value [String] One of "html", "wikitext", "raw", "none".
|
38
|
-
# @return [self]
|
39
|
-
def helpformat(value)
|
40
|
-
_helpformat(value) or fail ArgumentError, "Unknown value for helpformat: #{value}"
|
41
|
-
end
|
42
|
-
|
43
|
-
# @private
|
44
|
-
def _helpformat(value)
|
45
|
-
defined?(super) && super || ["html", "wikitext", "raw", "none"].include?(value.to_s) && merge(helpformat: value.to_s)
|
46
|
-
end
|
47
|
-
|
48
|
-
# List of query module names (value of prop, meta or list parameter). Use modules=query+foo instead of querymodules=foo.
|
49
|
-
#
|
50
|
-
# @param values [Array<String>] Allowed values: "abusefilters", "abuselog", "allcategories", "alldeletedrevisions", "allfileusages", "allimages", "alllinks", "allmessages", "allpages", "allredirects", "allrevisions", "alltransclusions", "allusers", "authmanagerinfo", "babel", "backlinks", "betafeatures", "blocks", "categories", "categoryinfo", "categorymembers", "centralnoticelogs", "checkuser", "checkuserlog", "contributors", "coordinates", "deletedrevisions", "deletedrevs", "duplicatefiles", "embeddedin", "extlinks", "extracts", "exturlusage", "featureusage", "filearchive", "filerepoinfo", "fileusage", "flowinfo", "gadgetcategories", "gadgets", "geosearch", "globalallusers", "globalblocks", "globalgroups", "globalusage", "globaluserinfo", "imageinfo", "images", "imageusage", "info", "iwbacklinks", "iwlinks", "langbacklinks", "langlinks", "languagestats", "links", "linkshere", "logevents", "mapdata", "messagecollection", "messagegroups", "messagegroupstats", "messagetranslations", "mmsites", "mostviewed", "mystashedfiles", "notifications", "oath", "ores", "pageimages", "pagepropnames", "pageprops", "pageswithprop", "pageterms", "pageviews", "prefixsearch", "protectedtitles", "querypage", "random", "recentchanges", "redirects", "references", "revisions", "search", "siteinfo", "siteviews", "stashimageinfo", "tags", "templates", "tokens", "transcludedin", "transcodestatus", "unreadnotificationpages", "usercontribs", "userinfo", "users", "videoinfo", "watchlist", "watchlistraw", "wbentityusage", "wblistentityusage", "wbsearch", "wbsubscribers", "wikibase", "wikisets".
|
51
|
-
# @return [self]
|
52
|
-
def querymodules(*values)
|
53
|
-
values.inject(self) { |res, val| res._querymodules(val) or fail ArgumentError, "Unknown value for querymodules: #{val}" }
|
54
|
-
end
|
55
|
-
|
56
|
-
# @private
|
57
|
-
def _querymodules(value)
|
58
|
-
defined?(super) && super || ["abusefilters", "abuselog", "allcategories", "alldeletedrevisions", "allfileusages", "allimages", "alllinks", "allmessages", "allpages", "allredirects", "allrevisions", "alltransclusions", "allusers", "authmanagerinfo", "babel", "backlinks", "betafeatures", "blocks", "categories", "categoryinfo", "categorymembers", "centralnoticelogs", "checkuser", "checkuserlog", "contributors", "coordinates", "deletedrevisions", "deletedrevs", "duplicatefiles", "embeddedin", "extlinks", "extracts", "exturlusage", "featureusage", "filearchive", "filerepoinfo", "fileusage", "flowinfo", "gadgetcategories", "gadgets", "geosearch", "globalallusers", "globalblocks", "globalgroups", "globalusage", "globaluserinfo", "imageinfo", "images", "imageusage", "info", "iwbacklinks", "iwlinks", "langbacklinks", "langlinks", "languagestats", "links", "linkshere", "logevents", "mapdata", "messagecollection", "messagegroups", "messagegroupstats", "messagetranslations", "mmsites", "mostviewed", "mystashedfiles", "notifications", "oath", "ores", "pageimages", "pagepropnames", "pageprops", "pageswithprop", "pageterms", "pageviews", "prefixsearch", "protectedtitles", "querypage", "random", "recentchanges", "redirects", "references", "revisions", "search", "siteinfo", "siteviews", "stashimageinfo", "tags", "templates", "tokens", "transcludedin", "transcodestatus", "unreadnotificationpages", "usercontribs", "userinfo", "users", "videoinfo", "watchlist", "watchlistraw", "wbentityusage", "wblistentityusage", "wbsearch", "wbsubscribers", "wikibase", "wikisets"].include?(value.to_s) && merge(querymodules: value.to_s, replace: false)
|
59
|
-
end
|
60
|
-
|
61
|
-
# Get information about the main (top-level) module as well. Use modules=main instead.
|
62
|
-
#
|
63
|
-
# @param value [String]
|
64
|
-
# @return [self]
|
65
|
-
def mainmodule(value)
|
66
|
-
merge(mainmodule: value.to_s)
|
67
|
-
end
|
68
|
-
|
69
|
-
# Get information about the pageset module (providing titles= and friends) as well.
|
70
|
-
#
|
71
|
-
# @param value [String]
|
72
|
-
# @return [self]
|
73
|
-
def pagesetmodule(value)
|
74
|
-
merge(pagesetmodule: value.to_s)
|
75
|
-
end
|
76
|
-
|
77
|
-
# List of format module names (value of format parameter). Use modules instead.
|
78
|
-
#
|
79
|
-
# @param values [Array<String>] Allowed values: "json", "jsonfm", "none", "php", "phpfm", "rawfm", "xml", "xmlfm".
|
80
|
-
# @return [self]
|
81
|
-
def formatmodules(*values)
|
82
|
-
values.inject(self) { |res, val| res._formatmodules(val) or fail ArgumentError, "Unknown value for formatmodules: #{val}" }
|
83
|
-
end
|
84
|
-
|
85
|
-
# @private
|
86
|
-
def _formatmodules(value)
|
87
|
-
defined?(super) && super || ["json", "jsonfm", "none", "php", "phpfm", "rawfm", "xml", "xmlfm"].include?(value.to_s) && merge(formatmodules: value.to_s, replace: false)
|
88
|
-
end
|
89
|
-
end
|
90
|
-
end
|
91
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Reality::Describers::Wikidata::Impl
|
4
|
-
module Actions
|
5
|
-
#
|
6
|
-
#
|
7
|
-
# Usage:
|
8
|
-
#
|
9
|
-
# ```ruby
|
10
|
-
# api.parsoid-batch.batch(value).perform # returns string with raw output
|
11
|
-
# # or
|
12
|
-
# api.parsoid-batch.batch(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 ParsoidBatch < Reality::Describers::Wikidata::Impl::Actions::Get
|
21
|
-
|
22
|
-
#
|
23
|
-
#
|
24
|
-
# @param value [String]
|
25
|
-
# @return [self]
|
26
|
-
def batch(value)
|
27
|
-
merge(batch: value.to_s)
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|