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,107 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Reality::Describers::Wikidata::Impl
|
4
|
-
module Actions
|
5
|
-
# Change a user's group membership.
|
6
|
-
#
|
7
|
-
# Usage:
|
8
|
-
#
|
9
|
-
# ```ruby
|
10
|
-
# api.userrights.user(value).perform # returns string with raw output
|
11
|
-
# # or
|
12
|
-
# api.userrights.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 Userrights < Reality::Describers::Wikidata::Impl::Actions::Post
|
21
|
-
|
22
|
-
# User name.
|
23
|
-
#
|
24
|
-
# @param value [String]
|
25
|
-
# @return [self]
|
26
|
-
def user(value)
|
27
|
-
merge(user: value.to_s)
|
28
|
-
end
|
29
|
-
|
30
|
-
# User ID.
|
31
|
-
#
|
32
|
-
# @param value [Integer]
|
33
|
-
# @return [self]
|
34
|
-
def userid(value)
|
35
|
-
merge(userid: value.to_s)
|
36
|
-
end
|
37
|
-
|
38
|
-
# Add the user to these groups, or if they are already a member, update the expiry of their membership in that group.
|
39
|
-
#
|
40
|
-
# @param values [Array<String>] Allowed values: "bot", "sysop", "bureaucrat", "steward", "accountcreator", "import", "transwiki", "ipblock-exempt", "oversight", "rollbacker", "propertycreator", "wikidata-staff", "flood", "translationadmin", "confirmed", "flow-bot", "checkuser".
|
41
|
-
# @return [self]
|
42
|
-
def add(*values)
|
43
|
-
values.inject(self) { |res, val| res._add(val) or fail ArgumentError, "Unknown value for add: #{val}" }
|
44
|
-
end
|
45
|
-
|
46
|
-
# @private
|
47
|
-
def _add(value)
|
48
|
-
defined?(super) && super || ["bot", "sysop", "bureaucrat", "steward", "accountcreator", "import", "transwiki", "ipblock-exempt", "oversight", "rollbacker", "propertycreator", "wikidata-staff", "flood", "translationadmin", "confirmed", "flow-bot", "checkuser"].include?(value.to_s) && merge(add: value.to_s, replace: false)
|
49
|
-
end
|
50
|
-
|
51
|
-
# Expiry timestamps. May be relative (e.g. 5 months or 2 weeks) or absolute (e.g. 2014-09-18T12:34:56Z). If only one timestamp is set, it will be used for all groups passed to the add parameter. Use infinite, indefinite, infinity, or never for a never-expiring user group.
|
52
|
-
#
|
53
|
-
# @param values [Array<String>]
|
54
|
-
# @return [self]
|
55
|
-
def expiry(*values)
|
56
|
-
values.inject(self) { |res, val| res._expiry(val) }
|
57
|
-
end
|
58
|
-
|
59
|
-
# @private
|
60
|
-
def _expiry(value)
|
61
|
-
merge(expiry: value.to_s, replace: false)
|
62
|
-
end
|
63
|
-
|
64
|
-
# Remove the user from these groups.
|
65
|
-
#
|
66
|
-
# @param values [Array<String>] Allowed values: "bot", "sysop", "bureaucrat", "steward", "accountcreator", "import", "transwiki", "ipblock-exempt", "oversight", "rollbacker", "propertycreator", "wikidata-staff", "flood", "translationadmin", "confirmed", "flow-bot", "checkuser".
|
67
|
-
# @return [self]
|
68
|
-
def remove(*values)
|
69
|
-
values.inject(self) { |res, val| res._remove(val) or fail ArgumentError, "Unknown value for remove: #{val}" }
|
70
|
-
end
|
71
|
-
|
72
|
-
# @private
|
73
|
-
def _remove(value)
|
74
|
-
defined?(super) && super || ["bot", "sysop", "bureaucrat", "steward", "accountcreator", "import", "transwiki", "ipblock-exempt", "oversight", "rollbacker", "propertycreator", "wikidata-staff", "flood", "translationadmin", "confirmed", "flow-bot", "checkuser"].include?(value.to_s) && merge(remove: value.to_s, replace: false)
|
75
|
-
end
|
76
|
-
|
77
|
-
# Reason for the change.
|
78
|
-
#
|
79
|
-
# @param value [String]
|
80
|
-
# @return [self]
|
81
|
-
def reason(value)
|
82
|
-
merge(reason: value.to_s)
|
83
|
-
end
|
84
|
-
|
85
|
-
# A "userrights" token retrieved from action=query&meta=tokens
|
86
|
-
#
|
87
|
-
# @param value [String]
|
88
|
-
# @return [self]
|
89
|
-
def token(value)
|
90
|
-
merge(token: value.to_s)
|
91
|
-
end
|
92
|
-
|
93
|
-
# Change tags to apply to the entry in the user rights log.
|
94
|
-
#
|
95
|
-
# @param values [Array<String>] Allowed values: "InfoboxExport gadget", "WE-Framework gadget".
|
96
|
-
# @return [self]
|
97
|
-
def tags(*values)
|
98
|
-
values.inject(self) { |res, val| res._tags(val) or fail ArgumentError, "Unknown value for tags: #{val}" }
|
99
|
-
end
|
100
|
-
|
101
|
-
# @private
|
102
|
-
def _tags(value)
|
103
|
-
defined?(super) && super || ["InfoboxExport gadget", "WE-Framework gadget"].include?(value.to_s) && merge(tags: value.to_s, replace: false)
|
104
|
-
end
|
105
|
-
end
|
106
|
-
end
|
107
|
-
end
|
@@ -1,55 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Reality::Describers::Wikidata::Impl
|
4
|
-
module Actions
|
5
|
-
# Validate a password against the wiki's password policies.
|
6
|
-
#
|
7
|
-
# Usage:
|
8
|
-
#
|
9
|
-
# ```ruby
|
10
|
-
# api.validatepassword.password(value).perform # returns string with raw output
|
11
|
-
# # or
|
12
|
-
# api.validatepassword.password(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 Validatepassword < Reality::Describers::Wikidata::Impl::Actions::Post
|
21
|
-
|
22
|
-
# Password to validate.
|
23
|
-
#
|
24
|
-
# @param value [String]
|
25
|
-
# @return [self]
|
26
|
-
def password(value)
|
27
|
-
merge(password: value.to_s)
|
28
|
-
end
|
29
|
-
|
30
|
-
# User name, for use when testing account creation. The named user must not exist.
|
31
|
-
#
|
32
|
-
# @param value [String]
|
33
|
-
# @return [self]
|
34
|
-
def user(value)
|
35
|
-
merge(user: value.to_s)
|
36
|
-
end
|
37
|
-
|
38
|
-
# Email address, for use when testing account creation.
|
39
|
-
#
|
40
|
-
# @param value [String]
|
41
|
-
# @return [self]
|
42
|
-
def email(value)
|
43
|
-
merge(email: value.to_s)
|
44
|
-
end
|
45
|
-
|
46
|
-
# Real name, for use when testing account creation.
|
47
|
-
#
|
48
|
-
# @param value [String]
|
49
|
-
# @return [self]
|
50
|
-
def realname(value)
|
51
|
-
merge(realname: value.to_s)
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
@@ -1,96 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Reality::Describers::Wikidata::Impl
|
4
|
-
module Actions
|
5
|
-
# Returns HTML5 for a page from the Parsoid service.
|
6
|
-
#
|
7
|
-
# Usage:
|
8
|
-
#
|
9
|
-
# ```ruby
|
10
|
-
# api.visualeditor.page(value).perform # returns string with raw output
|
11
|
-
# # or
|
12
|
-
# api.visualeditor.page(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 Visualeditor < Reality::Describers::Wikidata::Impl::Actions::Get
|
21
|
-
|
22
|
-
# The page to perform actions on.
|
23
|
-
#
|
24
|
-
# @param value [String]
|
25
|
-
# @return [self]
|
26
|
-
def page(value)
|
27
|
-
merge(page: value.to_s)
|
28
|
-
end
|
29
|
-
|
30
|
-
#
|
31
|
-
#
|
32
|
-
# @param value [String] One of "json", "jsonfm".
|
33
|
-
# @return [self]
|
34
|
-
def format(value)
|
35
|
-
_format(value) or fail ArgumentError, "Unknown value for format: #{value}"
|
36
|
-
end
|
37
|
-
|
38
|
-
# @private
|
39
|
-
def _format(value)
|
40
|
-
defined?(super) && super || ["json", "jsonfm"].include?(value.to_s) && merge(format: value.to_s)
|
41
|
-
end
|
42
|
-
|
43
|
-
# Action to perform.
|
44
|
-
#
|
45
|
-
# @param value [String] One of "parse", "metadata", "wikitext", "parsefragment", "getlanglinks".
|
46
|
-
# @return [self]
|
47
|
-
def paction(value)
|
48
|
-
_paction(value) or fail ArgumentError, "Unknown value for paction: #{value}"
|
49
|
-
end
|
50
|
-
|
51
|
-
# @private
|
52
|
-
def _paction(value)
|
53
|
-
defined?(super) && super || ["parse", "metadata", "wikitext", "parsefragment", "getlanglinks"].include?(value.to_s) && merge(paction: value.to_s)
|
54
|
-
end
|
55
|
-
|
56
|
-
# Wikitext to send to Parsoid to convert to HTML (paction=parsefragment).
|
57
|
-
#
|
58
|
-
# @param value [String]
|
59
|
-
# @return [self]
|
60
|
-
def wikitext(value)
|
61
|
-
merge(wikitext: value.to_s)
|
62
|
-
end
|
63
|
-
|
64
|
-
# The section on which to act.
|
65
|
-
#
|
66
|
-
# @param value [String]
|
67
|
-
# @return [self]
|
68
|
-
def section(value)
|
69
|
-
merge(section: value.to_s)
|
70
|
-
end
|
71
|
-
|
72
|
-
# The revision number to use (defaults to latest revision).
|
73
|
-
#
|
74
|
-
# @param value [String]
|
75
|
-
# @return [self]
|
76
|
-
def oldid(value)
|
77
|
-
merge(oldid: value.to_s)
|
78
|
-
end
|
79
|
-
|
80
|
-
# Edit intro to add to notices.
|
81
|
-
#
|
82
|
-
# @param value [String]
|
83
|
-
# @return [self]
|
84
|
-
def editintro(value)
|
85
|
-
merge(editintro: value.to_s)
|
86
|
-
end
|
87
|
-
|
88
|
-
# Pre-save transform wikitext before sending it to Parsoid (paction=parsefragment).
|
89
|
-
#
|
90
|
-
# @return [self]
|
91
|
-
def pst()
|
92
|
-
merge(pst: 'true')
|
93
|
-
end
|
94
|
-
end
|
95
|
-
end
|
96
|
-
end
|
@@ -1,164 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Reality::Describers::Wikidata::Impl
|
4
|
-
module Actions
|
5
|
-
# Save an HTML5 page to MediaWiki (converted to wikitext via the Parsoid service).
|
6
|
-
#
|
7
|
-
# Usage:
|
8
|
-
#
|
9
|
-
# ```ruby
|
10
|
-
# api.visualeditoredit.paction(value).perform # returns string with raw output
|
11
|
-
# # or
|
12
|
-
# api.visualeditoredit.paction(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 Visualeditoredit < Reality::Describers::Wikidata::Impl::Actions::Post
|
21
|
-
|
22
|
-
# Action to perform.
|
23
|
-
#
|
24
|
-
# @param value [String] One of "serialize", "serializeforcache", "diff", "save".
|
25
|
-
# @return [self]
|
26
|
-
def paction(value)
|
27
|
-
_paction(value) or fail ArgumentError, "Unknown value for paction: #{value}"
|
28
|
-
end
|
29
|
-
|
30
|
-
# @private
|
31
|
-
def _paction(value)
|
32
|
-
defined?(super) && super || ["serialize", "serializeforcache", "diff", "save"].include?(value.to_s) && merge(paction: value.to_s)
|
33
|
-
end
|
34
|
-
|
35
|
-
# The page to perform actions on.
|
36
|
-
#
|
37
|
-
# @param value [String]
|
38
|
-
# @return [self]
|
39
|
-
def page(value)
|
40
|
-
merge(page: value.to_s)
|
41
|
-
end
|
42
|
-
|
43
|
-
# A "csrf" token retrieved from action=query&meta=tokens
|
44
|
-
#
|
45
|
-
# @param value [String]
|
46
|
-
# @return [self]
|
47
|
-
def token(value)
|
48
|
-
merge(token: value.to_s)
|
49
|
-
end
|
50
|
-
|
51
|
-
#
|
52
|
-
#
|
53
|
-
# @param value [String]
|
54
|
-
# @return [self]
|
55
|
-
def wikitext(value)
|
56
|
-
merge(wikitext: value.to_s)
|
57
|
-
end
|
58
|
-
|
59
|
-
# The section on which to act.
|
60
|
-
#
|
61
|
-
# @param value [String]
|
62
|
-
# @return [self]
|
63
|
-
def section(value)
|
64
|
-
merge(section: value.to_s)
|
65
|
-
end
|
66
|
-
|
67
|
-
# Title for new section.
|
68
|
-
#
|
69
|
-
# @param value [String]
|
70
|
-
# @return [self]
|
71
|
-
def sectiontitle(value)
|
72
|
-
merge(sectiontitle: value.to_s)
|
73
|
-
end
|
74
|
-
|
75
|
-
# When saving, set this to the timestamp of the revision that was edited. Used to detect edit conflicts.
|
76
|
-
#
|
77
|
-
# @param value [String]
|
78
|
-
# @return [self]
|
79
|
-
def basetimestamp(value)
|
80
|
-
merge(basetimestamp: value.to_s)
|
81
|
-
end
|
82
|
-
|
83
|
-
# When saving, set this to the timestamp of when the page was loaded. Used to detect edit conflicts.
|
84
|
-
#
|
85
|
-
# @param value [String]
|
86
|
-
# @return [self]
|
87
|
-
def starttimestamp(value)
|
88
|
-
merge(starttimestamp: value.to_s)
|
89
|
-
end
|
90
|
-
|
91
|
-
# The revision number to use. Defaults to latest revision. Use 0 for a new page.
|
92
|
-
#
|
93
|
-
# @param value [String]
|
94
|
-
# @return [self]
|
95
|
-
def oldid(value)
|
96
|
-
merge(oldid: value.to_s)
|
97
|
-
end
|
98
|
-
|
99
|
-
# Flag for minor edit.
|
100
|
-
#
|
101
|
-
# @param value [String]
|
102
|
-
# @return [self]
|
103
|
-
def minor(value)
|
104
|
-
merge(minor: value.to_s)
|
105
|
-
end
|
106
|
-
|
107
|
-
#
|
108
|
-
#
|
109
|
-
# @param value [String]
|
110
|
-
# @return [self]
|
111
|
-
def watch(value)
|
112
|
-
merge(watch: value.to_s)
|
113
|
-
end
|
114
|
-
|
115
|
-
# HTML to send to Parsoid in exchange for wikitext.
|
116
|
-
#
|
117
|
-
# @param value [String]
|
118
|
-
# @return [self]
|
119
|
-
def html(value)
|
120
|
-
merge(html: value.to_s)
|
121
|
-
end
|
122
|
-
|
123
|
-
# ETag to send.
|
124
|
-
#
|
125
|
-
# @param value [String]
|
126
|
-
# @return [self]
|
127
|
-
def etag(value)
|
128
|
-
merge(etag: value.to_s)
|
129
|
-
end
|
130
|
-
|
131
|
-
# Edit summary.
|
132
|
-
#
|
133
|
-
# @param value [String]
|
134
|
-
# @return [self]
|
135
|
-
def summary(value)
|
136
|
-
merge(summary: value.to_s)
|
137
|
-
end
|
138
|
-
|
139
|
-
# Captcha ID (when saving with a captcha response).
|
140
|
-
#
|
141
|
-
# @param value [String]
|
142
|
-
# @return [self]
|
143
|
-
def captchaid(value)
|
144
|
-
merge(captchaid: value.to_s)
|
145
|
-
end
|
146
|
-
|
147
|
-
# Answer to the captcha (when saving with a captcha response).
|
148
|
-
#
|
149
|
-
# @param value [String]
|
150
|
-
# @return [self]
|
151
|
-
def captchaword(value)
|
152
|
-
merge(captchaword: value.to_s)
|
153
|
-
end
|
154
|
-
|
155
|
-
# Use the result of a previous serializeforcache request with this key. Overrides html.
|
156
|
-
#
|
157
|
-
# @param value [String]
|
158
|
-
# @return [self]
|
159
|
-
def cachekey(value)
|
160
|
-
merge(cachekey: value.to_s)
|
161
|
-
end
|
162
|
-
end
|
163
|
-
end
|
164
|
-
end
|
@@ -1,161 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Reality::Describers::Wikidata::Impl
|
4
|
-
module Actions
|
5
|
-
# Add or remove pages from the current user's watchlist.
|
6
|
-
#
|
7
|
-
# Usage:
|
8
|
-
#
|
9
|
-
# ```ruby
|
10
|
-
# api.watch.title(value).perform # returns string with raw output
|
11
|
-
# # or
|
12
|
-
# api.watch.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 Watch < Reality::Describers::Wikidata::Impl::Actions::Post
|
21
|
-
|
22
|
-
# The page to (un)watch. Use titles instead.
|
23
|
-
#
|
24
|
-
# @param value [String]
|
25
|
-
# @return [self]
|
26
|
-
def title(value)
|
27
|
-
merge(title: value.to_s)
|
28
|
-
end
|
29
|
-
|
30
|
-
# If set the page will be unwatched rather than watched.
|
31
|
-
#
|
32
|
-
# @return [self]
|
33
|
-
def unwatch()
|
34
|
-
merge(unwatch: 'true')
|
35
|
-
end
|
36
|
-
|
37
|
-
# When more results are available, use this to continue.
|
38
|
-
#
|
39
|
-
# @param value [String]
|
40
|
-
# @return [self]
|
41
|
-
def continue(value)
|
42
|
-
merge(continue: value.to_s)
|
43
|
-
end
|
44
|
-
|
45
|
-
# A list of titles to work on.
|
46
|
-
#
|
47
|
-
# @param values [Array<String>]
|
48
|
-
# @return [self]
|
49
|
-
def titles(*values)
|
50
|
-
values.inject(self) { |res, val| res._titles(val) }
|
51
|
-
end
|
52
|
-
|
53
|
-
# @private
|
54
|
-
def _titles(value)
|
55
|
-
merge(titles: value.to_s, replace: false)
|
56
|
-
end
|
57
|
-
|
58
|
-
# A list of page IDs to work on.
|
59
|
-
#
|
60
|
-
# @param values [Array<Integer>]
|
61
|
-
# @return [self]
|
62
|
-
def pageids(*values)
|
63
|
-
values.inject(self) { |res, val| res._pageids(val) }
|
64
|
-
end
|
65
|
-
|
66
|
-
# @private
|
67
|
-
def _pageids(value)
|
68
|
-
merge(pageids: value.to_s, replace: false)
|
69
|
-
end
|
70
|
-
|
71
|
-
# A list of revision IDs to work on.
|
72
|
-
#
|
73
|
-
# @param values [Array<Integer>]
|
74
|
-
# @return [self]
|
75
|
-
def revids(*values)
|
76
|
-
values.inject(self) { |res, val| res._revids(val) }
|
77
|
-
end
|
78
|
-
|
79
|
-
# @private
|
80
|
-
def _revids(value)
|
81
|
-
merge(revids: value.to_s, replace: false)
|
82
|
-
end
|
83
|
-
|
84
|
-
# Get the list of pages to work on by executing the specified query module.
|
85
|
-
#
|
86
|
-
# @param value [Symbol] Selecting an option includes tweaking methods from corresponding module:
|
87
|
-
# * `:allcategories` - {Reality::Describers::Wikidata::Impl::Modules::Allcategories} Enumerate all categories.
|
88
|
-
# * `:alldeletedrevisions` - {Reality::Describers::Wikidata::Impl::Modules::Alldeletedrevisions} List all deleted revisions by a user or in a namespace.
|
89
|
-
# * `:allfileusages` - {Reality::Describers::Wikidata::Impl::Modules::Allfileusages} List all file usages, including non-existing.
|
90
|
-
# * `:allimages` - {Reality::Describers::Wikidata::Impl::Modules::Allimages} Enumerate all images sequentially.
|
91
|
-
# * `:alllinks` - {Reality::Describers::Wikidata::Impl::Modules::Alllinks} Enumerate all links that point to a given namespace.
|
92
|
-
# * `:allpages` - {Reality::Describers::Wikidata::Impl::Modules::Allpages} Enumerate all pages sequentially in a given namespace.
|
93
|
-
# * `:allredirects` - {Reality::Describers::Wikidata::Impl::Modules::Allredirects} List all redirects to a namespace.
|
94
|
-
# * `:allrevisions` - {Reality::Describers::Wikidata::Impl::Modules::Allrevisions} List all revisions.
|
95
|
-
# * `:alltransclusions` - {Reality::Describers::Wikidata::Impl::Modules::Alltransclusions} List all transclusions (pages embedded using {{x}}), including non-existing.
|
96
|
-
# * `:backlinks` - {Reality::Describers::Wikidata::Impl::Modules::Backlinks} Find all pages that link to the given page.
|
97
|
-
# * `:categories` - {Reality::Describers::Wikidata::Impl::Modules::Categories} List all categories the pages belong to.
|
98
|
-
# * `:categorymembers` - {Reality::Describers::Wikidata::Impl::Modules::Categorymembers} List all pages in a given category.
|
99
|
-
# * `:deletedrevisions` - {Reality::Describers::Wikidata::Impl::Modules::Deletedrevisions} Get deleted revision information.
|
100
|
-
# * `:duplicatefiles` - {Reality::Describers::Wikidata::Impl::Modules::Duplicatefiles} List all files that are duplicates of the given files based on hash values.
|
101
|
-
# * `:embeddedin` - {Reality::Describers::Wikidata::Impl::Modules::Embeddedin} Find all pages that embed (transclude) the given title.
|
102
|
-
# * `:exturlusage` - {Reality::Describers::Wikidata::Impl::Modules::Exturlusage} Enumerate pages that contain a given URL.
|
103
|
-
# * `:fileusage` - {Reality::Describers::Wikidata::Impl::Modules::Fileusage} Find all pages that use the given files.
|
104
|
-
# * `:geosearch` - {Reality::Describers::Wikidata::Impl::Modules::Geosearch} Returns pages having coordinates that are located in a certain area.
|
105
|
-
# * `:images` - {Reality::Describers::Wikidata::Impl::Modules::Images} Returns all files contained on the given pages.
|
106
|
-
# * `:imageusage` - {Reality::Describers::Wikidata::Impl::Modules::Imageusage} Find all pages that use the given image title.
|
107
|
-
# * `:iwbacklinks` - {Reality::Describers::Wikidata::Impl::Modules::Iwbacklinks} Find all pages that link to the given interwiki link.
|
108
|
-
# * `:langbacklinks` - {Reality::Describers::Wikidata::Impl::Modules::Langbacklinks} Find all pages that link to the given language link.
|
109
|
-
# * `:links` - {Reality::Describers::Wikidata::Impl::Modules::Links} Returns all links from the given pages.
|
110
|
-
# * `:linkshere` - {Reality::Describers::Wikidata::Impl::Modules::Linkshere} Find all pages that link to the given pages.
|
111
|
-
# * `:messagecollection` - {Reality::Describers::Wikidata::Impl::Modules::Messagecollection} Query MessageCollection about translations.
|
112
|
-
# * `:mostviewed` - {Reality::Describers::Wikidata::Impl::Modules::Mostviewed} Lists the most viewed pages (based on last day's pageview count).
|
113
|
-
# * `:pageswithprop` - {Reality::Describers::Wikidata::Impl::Modules::Pageswithprop} List all pages using a given page property.
|
114
|
-
# * `:prefixsearch` - {Reality::Describers::Wikidata::Impl::Modules::Prefixsearch} Perform a prefix search for page titles.
|
115
|
-
# * `:protectedtitles` - {Reality::Describers::Wikidata::Impl::Modules::Protectedtitles} List all titles protected from creation.
|
116
|
-
# * `:querypage` - {Reality::Describers::Wikidata::Impl::Modules::Querypage} Get a list provided by a QueryPage-based special page.
|
117
|
-
# * `:random` - {Reality::Describers::Wikidata::Impl::Modules::Random} Get a set of random pages.
|
118
|
-
# * `:recentchanges` - {Reality::Describers::Wikidata::Impl::Modules::Recentchanges} Enumerate recent changes.
|
119
|
-
# * `:redirects` - {Reality::Describers::Wikidata::Impl::Modules::Redirects} Returns all redirects to the given pages.
|
120
|
-
# * `:revisions` - {Reality::Describers::Wikidata::Impl::Modules::Revisions} Get revision information.
|
121
|
-
# * `:search` - {Reality::Describers::Wikidata::Impl::Modules::Search} Perform a full text search.
|
122
|
-
# * `:templates` - {Reality::Describers::Wikidata::Impl::Modules::Templates} Returns all pages transcluded on the given pages.
|
123
|
-
# * `:transcludedin` - {Reality::Describers::Wikidata::Impl::Modules::Transcludedin} Find all pages that transclude the given pages.
|
124
|
-
# * `:watchlist` - {Reality::Describers::Wikidata::Impl::Modules::Watchlist} Get recent changes to pages in the current user's watchlist.
|
125
|
-
# * `:watchlistraw` - {Reality::Describers::Wikidata::Impl::Modules::Watchlistraw} Get all pages on the current user's watchlist.
|
126
|
-
# * `:wblistentityusage` - {Reality::Describers::Wikidata::Impl::Modules::Wblistentityusage} Returns all pages that use the given entity IDs.
|
127
|
-
# * `: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.
|
128
|
-
# @return [self]
|
129
|
-
def generator(value)
|
130
|
-
_generator(value) or fail ArgumentError, "Unknown value for generator: #{value}"
|
131
|
-
end
|
132
|
-
|
133
|
-
# @private
|
134
|
-
def _generator(value)
|
135
|
-
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])
|
136
|
-
end
|
137
|
-
|
138
|
-
# Automatically resolve redirects in titles, pageids, and revids, and in pages returned by generator.
|
139
|
-
#
|
140
|
-
# @return [self]
|
141
|
-
def redirects()
|
142
|
-
merge(redirects: 'true')
|
143
|
-
end
|
144
|
-
|
145
|
-
# 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.
|
146
|
-
#
|
147
|
-
# @return [self]
|
148
|
-
def converttitles()
|
149
|
-
merge(converttitles: 'true')
|
150
|
-
end
|
151
|
-
|
152
|
-
# A "watch" token retrieved from action=query&meta=tokens
|
153
|
-
#
|
154
|
-
# @param value [String]
|
155
|
-
# @return [self]
|
156
|
-
def token(value)
|
157
|
-
merge(token: value.to_s)
|
158
|
-
end
|
159
|
-
end
|
160
|
-
end
|
161
|
-
end
|