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,96 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Reality::Describers::Wikidata::Impl
|
4
|
-
module Actions
|
5
|
-
# Undo the last edit to the page.
|
6
|
-
#
|
7
|
-
# Usage:
|
8
|
-
#
|
9
|
-
# ```ruby
|
10
|
-
# api.rollback.title(value).perform # returns string with raw output
|
11
|
-
# # or
|
12
|
-
# api.rollback.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 Rollback < Reality::Describers::Wikidata::Impl::Actions::Post
|
21
|
-
|
22
|
-
# Title of the page to roll back. Cannot be used together with pageid.
|
23
|
-
#
|
24
|
-
# @param value [String]
|
25
|
-
# @return [self]
|
26
|
-
def title(value)
|
27
|
-
merge(title: value.to_s)
|
28
|
-
end
|
29
|
-
|
30
|
-
# Page ID of the page to roll back. Cannot be used together with title.
|
31
|
-
#
|
32
|
-
# @param value [Integer]
|
33
|
-
# @return [self]
|
34
|
-
def pageid(value)
|
35
|
-
merge(pageid: value.to_s)
|
36
|
-
end
|
37
|
-
|
38
|
-
# Tags to apply to the rollback.
|
39
|
-
#
|
40
|
-
# @param values [Array<String>] Allowed values: "InfoboxExport gadget", "WE-Framework gadget".
|
41
|
-
# @return [self]
|
42
|
-
def tags(*values)
|
43
|
-
values.inject(self) { |res, val| res._tags(val) or fail ArgumentError, "Unknown value for tags: #{val}" }
|
44
|
-
end
|
45
|
-
|
46
|
-
# @private
|
47
|
-
def _tags(value)
|
48
|
-
defined?(super) && super || ["InfoboxExport gadget", "WE-Framework gadget"].include?(value.to_s) && merge(tags: value.to_s, replace: false)
|
49
|
-
end
|
50
|
-
|
51
|
-
# Name of the user whose edits are to be rolled back.
|
52
|
-
#
|
53
|
-
# @param value [String]
|
54
|
-
# @return [self]
|
55
|
-
def user(value)
|
56
|
-
merge(user: value.to_s)
|
57
|
-
end
|
58
|
-
|
59
|
-
# Custom edit summary. If empty, default summary will be used.
|
60
|
-
#
|
61
|
-
# @param value [String]
|
62
|
-
# @return [self]
|
63
|
-
def summary(value)
|
64
|
-
merge(summary: value.to_s)
|
65
|
-
end
|
66
|
-
|
67
|
-
# Mark the reverted edits and the revert as bot edits.
|
68
|
-
#
|
69
|
-
# @return [self]
|
70
|
-
def markbot()
|
71
|
-
merge(markbot: 'true')
|
72
|
-
end
|
73
|
-
|
74
|
-
# Unconditionally add or remove the page from the current user's watchlist, use preferences or do not change watch.
|
75
|
-
#
|
76
|
-
# @param value [String] One of "watch", "unwatch", "preferences", "nochange".
|
77
|
-
# @return [self]
|
78
|
-
def watchlist(value)
|
79
|
-
_watchlist(value) or fail ArgumentError, "Unknown value for watchlist: #{value}"
|
80
|
-
end
|
81
|
-
|
82
|
-
# @private
|
83
|
-
def _watchlist(value)
|
84
|
-
defined?(super) && super || ["watch", "unwatch", "preferences", "nochange"].include?(value.to_s) && merge(watchlist: value.to_s)
|
85
|
-
end
|
86
|
-
|
87
|
-
# A "rollback" token retrieved from action=query&meta=tokens
|
88
|
-
#
|
89
|
-
# @param value [String]
|
90
|
-
# @return [self]
|
91
|
-
def token(value)
|
92
|
-
merge(token: value.to_s)
|
93
|
-
end
|
94
|
-
end
|
95
|
-
end
|
96
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Reality::Describers::Wikidata::Impl
|
4
|
-
module Actions
|
5
|
-
# Export an RSD (Really Simple Discovery) schema.
|
6
|
-
#
|
7
|
-
# Usage:
|
8
|
-
#
|
9
|
-
# ```ruby
|
10
|
-
# api.rsd.perform # returns string with raw output
|
11
|
-
# # or
|
12
|
-
# api.rsd.response # returns output parsed and wrapped into Mash-like object
|
13
|
-
# ```
|
14
|
-
#
|
15
|
-
# This action has no parameters.
|
16
|
-
#
|
17
|
-
# See {Base} for generic explanation of working with MediaWiki actions and
|
18
|
-
# {Reality::Describers::Wikidata::Impl::Response} for working with action responses.
|
19
|
-
#
|
20
|
-
# All action's parameters are documented as its public methods, see below.
|
21
|
-
#
|
22
|
-
class Rsd < Reality::Describers::Wikidata::Impl::Actions::Get
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Reality::Describers::Wikidata::Impl
|
4
|
-
module Actions
|
5
|
-
# Performs data validation for Kartographer extension
|
6
|
-
#
|
7
|
-
# Usage:
|
8
|
-
#
|
9
|
-
# ```ruby
|
10
|
-
# api.sanitize-mapdata.title(value).perform # returns string with raw output
|
11
|
-
# # or
|
12
|
-
# api.sanitize-mapdata.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 SanitizeMapdata < Reality::Describers::Wikidata::Impl::Actions::Post
|
21
|
-
|
22
|
-
# Title of page on which this GeoJSON is supposed to be located. If no title is provided, a dummy one will be used.
|
23
|
-
#
|
24
|
-
# @param value [String]
|
25
|
-
# @return [self]
|
26
|
-
def title(value)
|
27
|
-
merge(title: value.to_s)
|
28
|
-
end
|
29
|
-
|
30
|
-
# GeoJSON to sanitize
|
31
|
-
#
|
32
|
-
# @param value [String]
|
33
|
-
# @return [self]
|
34
|
-
def text(value)
|
35
|
-
merge(text: value.to_s)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
@@ -1,62 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Reality::Describers::Wikidata::Impl
|
4
|
-
module Actions
|
5
|
-
# Internal module for servicing XHR requests from the Scribunto console.
|
6
|
-
#
|
7
|
-
# Usage:
|
8
|
-
#
|
9
|
-
# ```ruby
|
10
|
-
# api.scribunto-console.title(value).perform # returns string with raw output
|
11
|
-
# # or
|
12
|
-
# api.scribunto-console.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 ScribuntoConsole < Reality::Describers::Wikidata::Impl::Actions::Get
|
21
|
-
|
22
|
-
# The title of the module to test.
|
23
|
-
#
|
24
|
-
# @param value [String]
|
25
|
-
# @return [self]
|
26
|
-
def title(value)
|
27
|
-
merge(title: value.to_s)
|
28
|
-
end
|
29
|
-
|
30
|
-
# The new content of the module.
|
31
|
-
#
|
32
|
-
# @param value [String]
|
33
|
-
# @return [self]
|
34
|
-
def content(value)
|
35
|
-
merge(content: value.to_s)
|
36
|
-
end
|
37
|
-
|
38
|
-
# Session token.
|
39
|
-
#
|
40
|
-
# @param value [Integer]
|
41
|
-
# @return [self]
|
42
|
-
def session(value)
|
43
|
-
merge(session: value.to_s)
|
44
|
-
end
|
45
|
-
|
46
|
-
# The next line to evaluate as a script.
|
47
|
-
#
|
48
|
-
# @param value [String]
|
49
|
-
# @return [self]
|
50
|
-
def question(value)
|
51
|
-
merge(question: value.to_s)
|
52
|
-
end
|
53
|
-
|
54
|
-
# Set to clear the current session state.
|
55
|
-
#
|
56
|
-
# @return [self]
|
57
|
-
def clear()
|
58
|
-
merge(clear: 'true')
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
@@ -1,113 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Reality::Describers::Wikidata::Impl
|
4
|
-
module Actions
|
5
|
-
# Search translations.
|
6
|
-
#
|
7
|
-
# Usage:
|
8
|
-
#
|
9
|
-
# ```ruby
|
10
|
-
# api.searchtranslations.service(value).perform # returns string with raw output
|
11
|
-
# # or
|
12
|
-
# api.searchtranslations.service(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 Searchtranslations < Reality::Describers::Wikidata::Impl::Actions::Get
|
21
|
-
|
22
|
-
# Which of the available translation services to use.
|
23
|
-
#
|
24
|
-
# @param value [String] One of "eqiad", "codfw".
|
25
|
-
# @return [self]
|
26
|
-
def service(value)
|
27
|
-
_service(value) or fail ArgumentError, "Unknown value for service: #{value}"
|
28
|
-
end
|
29
|
-
|
30
|
-
# @private
|
31
|
-
def _service(value)
|
32
|
-
defined?(super) && super || ["eqiad", "codfw"].include?(value.to_s) && merge(service: value.to_s)
|
33
|
-
end
|
34
|
-
|
35
|
-
# The string to search for.
|
36
|
-
#
|
37
|
-
# @param value [String]
|
38
|
-
# @return [self]
|
39
|
-
def query(value)
|
40
|
-
merge(query: value.to_s)
|
41
|
-
end
|
42
|
-
|
43
|
-
# The language code of the source text.
|
44
|
-
#
|
45
|
-
# @param value [String]
|
46
|
-
# @return [self]
|
47
|
-
def sourcelanguage(value)
|
48
|
-
merge(sourcelanguage: value.to_s)
|
49
|
-
end
|
50
|
-
|
51
|
-
# The language code to search string for.
|
52
|
-
#
|
53
|
-
# @param value [String]
|
54
|
-
# @return [self]
|
55
|
-
def language(value)
|
56
|
-
merge(language: value.to_s)
|
57
|
-
end
|
58
|
-
|
59
|
-
# The group ID to search string in.
|
60
|
-
#
|
61
|
-
# @param value [String]
|
62
|
-
# @return [self]
|
63
|
-
def group(value)
|
64
|
-
merge(group: value.to_s)
|
65
|
-
end
|
66
|
-
|
67
|
-
# Message translation status filter.
|
68
|
-
#
|
69
|
-
# @param value [String] One of "translated", "fuzzy", "untranslated".
|
70
|
-
# @return [self]
|
71
|
-
def filter(value)
|
72
|
-
_filter(value) or fail ArgumentError, "Unknown value for filter: #{value}"
|
73
|
-
end
|
74
|
-
|
75
|
-
# @private
|
76
|
-
def _filter(value)
|
77
|
-
defined?(super) && super || ["translated", "fuzzy", "untranslated"].include?(value.to_s) && merge(filter: value.to_s)
|
78
|
-
end
|
79
|
-
|
80
|
-
# Match any/all search words.
|
81
|
-
#
|
82
|
-
# @param value [String]
|
83
|
-
# @return [self]
|
84
|
-
def match(value)
|
85
|
-
merge(match: value.to_s)
|
86
|
-
end
|
87
|
-
|
88
|
-
# Case (in)sensitive search.
|
89
|
-
#
|
90
|
-
# @param value [String]
|
91
|
-
# @return [self]
|
92
|
-
def case(value)
|
93
|
-
merge(case: value.to_s)
|
94
|
-
end
|
95
|
-
|
96
|
-
# Offset for the translations.
|
97
|
-
#
|
98
|
-
# @param value [Integer]
|
99
|
-
# @return [self]
|
100
|
-
def offset(value)
|
101
|
-
merge(offset: value.to_s)
|
102
|
-
end
|
103
|
-
|
104
|
-
# Size of the result.
|
105
|
-
#
|
106
|
-
# @param value [Integer]
|
107
|
-
# @return [self]
|
108
|
-
def limit(value)
|
109
|
-
merge(limit: value.to_s)
|
110
|
-
end
|
111
|
-
end
|
112
|
-
end
|
113
|
-
end
|
@@ -1,81 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Reality::Describers::Wikidata::Impl
|
4
|
-
module Actions
|
5
|
-
# Set a global user's status.
|
6
|
-
#
|
7
|
-
# Usage:
|
8
|
-
#
|
9
|
-
# ```ruby
|
10
|
-
# api.setglobalaccountstatus.user(value).perform # returns string with raw output
|
11
|
-
# # or
|
12
|
-
# api.setglobalaccountstatus.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 Setglobalaccountstatus < Reality::Describers::Wikidata::Impl::Actions::Post
|
21
|
-
|
22
|
-
# User to change the status of.
|
23
|
-
#
|
24
|
-
# @param value [String]
|
25
|
-
# @return [self]
|
26
|
-
def user(value)
|
27
|
-
merge(user: value.to_s)
|
28
|
-
end
|
29
|
-
|
30
|
-
# Change whether this user is locked or not.
|
31
|
-
#
|
32
|
-
# @param value [String] One of "lock", "unlock".
|
33
|
-
# @return [self]
|
34
|
-
def locked(value)
|
35
|
-
_locked(value) or fail ArgumentError, "Unknown value for locked: #{value}"
|
36
|
-
end
|
37
|
-
|
38
|
-
# @private
|
39
|
-
def _locked(value)
|
40
|
-
defined?(super) && super || ["lock", "unlock"].include?(value.to_s) && merge(locked: value.to_s)
|
41
|
-
end
|
42
|
-
|
43
|
-
# Change whether this user is not hidden, hidden from lists, or suppressed.
|
44
|
-
#
|
45
|
-
# @param value [String] One of "lists", "suppressed".
|
46
|
-
# @return [self]
|
47
|
-
def hidden(value)
|
48
|
-
_hidden(value) or fail ArgumentError, "Unknown value for hidden: #{value}"
|
49
|
-
end
|
50
|
-
|
51
|
-
# @private
|
52
|
-
def _hidden(value)
|
53
|
-
defined?(super) && super || ["lists", "suppressed"].include?(value.to_s) && merge(hidden: value.to_s)
|
54
|
-
end
|
55
|
-
|
56
|
-
# Reason for changing the user's status.
|
57
|
-
#
|
58
|
-
# @param value [String]
|
59
|
-
# @return [self]
|
60
|
-
def reason(value)
|
61
|
-
merge(reason: value.to_s)
|
62
|
-
end
|
63
|
-
|
64
|
-
# Optional MD5 of the expected current <username>:<hidden>:<locked>, to detect edit conflicts. Set <locked> to 1 for locked, 0 for unlocked.
|
65
|
-
#
|
66
|
-
# @param value [String]
|
67
|
-
# @return [self]
|
68
|
-
def statecheck(value)
|
69
|
-
merge(statecheck: value.to_s)
|
70
|
-
end
|
71
|
-
|
72
|
-
# A "setglobalaccountstatus" token retrieved from action=query&meta=tokens
|
73
|
-
#
|
74
|
-
# @param value [String]
|
75
|
-
# @return [self]
|
76
|
-
def token(value)
|
77
|
-
merge(token: value.to_s)
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
@@ -1,177 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Reality::Describers::Wikidata::Impl
|
4
|
-
module Actions
|
5
|
-
# Update the notification timestamp for watched pages.
|
6
|
-
#
|
7
|
-
# Usage:
|
8
|
-
#
|
9
|
-
# ```ruby
|
10
|
-
# api.setnotificationtimestamp.entirewatchlist(value).perform # returns string with raw output
|
11
|
-
# # or
|
12
|
-
# api.setnotificationtimestamp.entirewatchlist(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 Setnotificationtimestamp < Reality::Describers::Wikidata::Impl::Actions::Post
|
21
|
-
|
22
|
-
# Work on all watched pages.
|
23
|
-
#
|
24
|
-
# @return [self]
|
25
|
-
def entirewatchlist()
|
26
|
-
merge(entirewatchlist: 'true')
|
27
|
-
end
|
28
|
-
|
29
|
-
# Timestamp to which to set the notification timestamp.
|
30
|
-
#
|
31
|
-
# @param value [Time]
|
32
|
-
# @return [self]
|
33
|
-
def timestamp(value)
|
34
|
-
merge(timestamp: value.iso8601)
|
35
|
-
end
|
36
|
-
|
37
|
-
# Revision to set the notification timestamp to (one page only).
|
38
|
-
#
|
39
|
-
# @param value [Integer]
|
40
|
-
# @return [self]
|
41
|
-
def torevid(value)
|
42
|
-
merge(torevid: value.to_s)
|
43
|
-
end
|
44
|
-
|
45
|
-
# Revision to set the notification timestamp newer than (one page only).
|
46
|
-
#
|
47
|
-
# @param value [Integer]
|
48
|
-
# @return [self]
|
49
|
-
def newerthanrevid(value)
|
50
|
-
merge(newerthanrevid: value.to_s)
|
51
|
-
end
|
52
|
-
|
53
|
-
# When more results are available, use this to continue.
|
54
|
-
#
|
55
|
-
# @param value [String]
|
56
|
-
# @return [self]
|
57
|
-
def continue(value)
|
58
|
-
merge(continue: value.to_s)
|
59
|
-
end
|
60
|
-
|
61
|
-
# A list of titles to work on.
|
62
|
-
#
|
63
|
-
# @param values [Array<String>]
|
64
|
-
# @return [self]
|
65
|
-
def titles(*values)
|
66
|
-
values.inject(self) { |res, val| res._titles(val) }
|
67
|
-
end
|
68
|
-
|
69
|
-
# @private
|
70
|
-
def _titles(value)
|
71
|
-
merge(titles: value.to_s, replace: false)
|
72
|
-
end
|
73
|
-
|
74
|
-
# A list of page IDs to work on.
|
75
|
-
#
|
76
|
-
# @param values [Array<Integer>]
|
77
|
-
# @return [self]
|
78
|
-
def pageids(*values)
|
79
|
-
values.inject(self) { |res, val| res._pageids(val) }
|
80
|
-
end
|
81
|
-
|
82
|
-
# @private
|
83
|
-
def _pageids(value)
|
84
|
-
merge(pageids: value.to_s, replace: false)
|
85
|
-
end
|
86
|
-
|
87
|
-
# A list of revision IDs to work on.
|
88
|
-
#
|
89
|
-
# @param values [Array<Integer>]
|
90
|
-
# @return [self]
|
91
|
-
def revids(*values)
|
92
|
-
values.inject(self) { |res, val| res._revids(val) }
|
93
|
-
end
|
94
|
-
|
95
|
-
# @private
|
96
|
-
def _revids(value)
|
97
|
-
merge(revids: value.to_s, replace: false)
|
98
|
-
end
|
99
|
-
|
100
|
-
# Get the list of pages to work on by executing the specified query module.
|
101
|
-
#
|
102
|
-
# @param value [Symbol] Selecting an option includes tweaking methods from corresponding module:
|
103
|
-
# * `:allcategories` - {Reality::Describers::Wikidata::Impl::Modules::Allcategories} Enumerate all categories.
|
104
|
-
# * `:alldeletedrevisions` - {Reality::Describers::Wikidata::Impl::Modules::Alldeletedrevisions} List all deleted revisions by a user or in a namespace.
|
105
|
-
# * `:allfileusages` - {Reality::Describers::Wikidata::Impl::Modules::Allfileusages} List all file usages, including non-existing.
|
106
|
-
# * `:allimages` - {Reality::Describers::Wikidata::Impl::Modules::Allimages} Enumerate all images sequentially.
|
107
|
-
# * `:alllinks` - {Reality::Describers::Wikidata::Impl::Modules::Alllinks} Enumerate all links that point to a given namespace.
|
108
|
-
# * `:allpages` - {Reality::Describers::Wikidata::Impl::Modules::Allpages} Enumerate all pages sequentially in a given namespace.
|
109
|
-
# * `:allredirects` - {Reality::Describers::Wikidata::Impl::Modules::Allredirects} List all redirects to a namespace.
|
110
|
-
# * `:allrevisions` - {Reality::Describers::Wikidata::Impl::Modules::Allrevisions} List all revisions.
|
111
|
-
# * `:alltransclusions` - {Reality::Describers::Wikidata::Impl::Modules::Alltransclusions} List all transclusions (pages embedded using {{x}}), including non-existing.
|
112
|
-
# * `:backlinks` - {Reality::Describers::Wikidata::Impl::Modules::Backlinks} Find all pages that link to the given page.
|
113
|
-
# * `:categories` - {Reality::Describers::Wikidata::Impl::Modules::Categories} List all categories the pages belong to.
|
114
|
-
# * `:categorymembers` - {Reality::Describers::Wikidata::Impl::Modules::Categorymembers} List all pages in a given category.
|
115
|
-
# * `:deletedrevisions` - {Reality::Describers::Wikidata::Impl::Modules::Deletedrevisions} Get deleted revision information.
|
116
|
-
# * `:duplicatefiles` - {Reality::Describers::Wikidata::Impl::Modules::Duplicatefiles} List all files that are duplicates of the given files based on hash values.
|
117
|
-
# * `:embeddedin` - {Reality::Describers::Wikidata::Impl::Modules::Embeddedin} Find all pages that embed (transclude) the given title.
|
118
|
-
# * `:exturlusage` - {Reality::Describers::Wikidata::Impl::Modules::Exturlusage} Enumerate pages that contain a given URL.
|
119
|
-
# * `:fileusage` - {Reality::Describers::Wikidata::Impl::Modules::Fileusage} Find all pages that use the given files.
|
120
|
-
# * `:geosearch` - {Reality::Describers::Wikidata::Impl::Modules::Geosearch} Returns pages having coordinates that are located in a certain area.
|
121
|
-
# * `:images` - {Reality::Describers::Wikidata::Impl::Modules::Images} Returns all files contained on the given pages.
|
122
|
-
# * `:imageusage` - {Reality::Describers::Wikidata::Impl::Modules::Imageusage} Find all pages that use the given image title.
|
123
|
-
# * `:iwbacklinks` - {Reality::Describers::Wikidata::Impl::Modules::Iwbacklinks} Find all pages that link to the given interwiki link.
|
124
|
-
# * `:langbacklinks` - {Reality::Describers::Wikidata::Impl::Modules::Langbacklinks} Find all pages that link to the given language link.
|
125
|
-
# * `:links` - {Reality::Describers::Wikidata::Impl::Modules::Links} Returns all links from the given pages.
|
126
|
-
# * `:linkshere` - {Reality::Describers::Wikidata::Impl::Modules::Linkshere} Find all pages that link to the given pages.
|
127
|
-
# * `:messagecollection` - {Reality::Describers::Wikidata::Impl::Modules::Messagecollection} Query MessageCollection about translations.
|
128
|
-
# * `:mostviewed` - {Reality::Describers::Wikidata::Impl::Modules::Mostviewed} Lists the most viewed pages (based on last day's pageview count).
|
129
|
-
# * `:pageswithprop` - {Reality::Describers::Wikidata::Impl::Modules::Pageswithprop} List all pages using a given page property.
|
130
|
-
# * `:prefixsearch` - {Reality::Describers::Wikidata::Impl::Modules::Prefixsearch} Perform a prefix search for page titles.
|
131
|
-
# * `:protectedtitles` - {Reality::Describers::Wikidata::Impl::Modules::Protectedtitles} List all titles protected from creation.
|
132
|
-
# * `:querypage` - {Reality::Describers::Wikidata::Impl::Modules::Querypage} Get a list provided by a QueryPage-based special page.
|
133
|
-
# * `:random` - {Reality::Describers::Wikidata::Impl::Modules::Random} Get a set of random pages.
|
134
|
-
# * `:recentchanges` - {Reality::Describers::Wikidata::Impl::Modules::Recentchanges} Enumerate recent changes.
|
135
|
-
# * `:redirects` - {Reality::Describers::Wikidata::Impl::Modules::Redirects} Returns all redirects to the given pages.
|
136
|
-
# * `:revisions` - {Reality::Describers::Wikidata::Impl::Modules::Revisions} Get revision information.
|
137
|
-
# * `:search` - {Reality::Describers::Wikidata::Impl::Modules::Search} Perform a full text search.
|
138
|
-
# * `:templates` - {Reality::Describers::Wikidata::Impl::Modules::Templates} Returns all pages transcluded on the given pages.
|
139
|
-
# * `:transcludedin` - {Reality::Describers::Wikidata::Impl::Modules::Transcludedin} Find all pages that transclude the given pages.
|
140
|
-
# * `:watchlist` - {Reality::Describers::Wikidata::Impl::Modules::Watchlist} Get recent changes to pages in the current user's watchlist.
|
141
|
-
# * `:watchlistraw` - {Reality::Describers::Wikidata::Impl::Modules::Watchlistraw} Get all pages on the current user's watchlist.
|
142
|
-
# * `:wblistentityusage` - {Reality::Describers::Wikidata::Impl::Modules::Wblistentityusage} Returns all pages that use the given entity IDs.
|
143
|
-
# * `: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.
|
144
|
-
# @return [self]
|
145
|
-
def generator(value)
|
146
|
-
_generator(value) or fail ArgumentError, "Unknown value for generator: #{value}"
|
147
|
-
end
|
148
|
-
|
149
|
-
# @private
|
150
|
-
def _generator(value)
|
151
|
-
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])
|
152
|
-
end
|
153
|
-
|
154
|
-
# Automatically resolve redirects in titles, pageids, and revids, and in pages returned by generator.
|
155
|
-
#
|
156
|
-
# @return [self]
|
157
|
-
def redirects()
|
158
|
-
merge(redirects: 'true')
|
159
|
-
end
|
160
|
-
|
161
|
-
# 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.
|
162
|
-
#
|
163
|
-
# @return [self]
|
164
|
-
def converttitles()
|
165
|
-
merge(converttitles: 'true')
|
166
|
-
end
|
167
|
-
|
168
|
-
# A "csrf" token retrieved from action=query&meta=tokens
|
169
|
-
#
|
170
|
-
# @param value [String]
|
171
|
-
# @return [self]
|
172
|
-
def token(value)
|
173
|
-
merge(token: value.to_s)
|
174
|
-
end
|
175
|
-
end
|
176
|
-
end
|
177
|
-
end
|