reality 0.1.0.alpha → 0.1.0.alpha2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,39 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Reality::Describers::Wikidata::Impl
|
|
4
|
-
module Actions
|
|
5
|
-
# Mark translations reviewed.
|
|
6
|
-
#
|
|
7
|
-
# Usage:
|
|
8
|
-
#
|
|
9
|
-
# ```ruby
|
|
10
|
-
# api.translationreview.revision(value).perform # returns string with raw output
|
|
11
|
-
# # or
|
|
12
|
-
# api.translationreview.revision(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 Translationreview < Reality::Describers::Wikidata::Impl::Actions::Post
|
|
21
|
-
|
|
22
|
-
# The revision number to review.
|
|
23
|
-
#
|
|
24
|
-
# @param value [Integer]
|
|
25
|
-
# @return [self]
|
|
26
|
-
def revision(value)
|
|
27
|
-
merge(revision: value.to_s)
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
# A "csrf" token retrieved from action=query&meta=tokens
|
|
31
|
-
#
|
|
32
|
-
# @param value [String]
|
|
33
|
-
# @return [self]
|
|
34
|
-
def token(value)
|
|
35
|
-
merge(token: value.to_s)
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
end
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Reality::Describers::Wikidata::Impl
|
|
4
|
-
module Actions
|
|
5
|
-
# Add translations to stash.
|
|
6
|
-
#
|
|
7
|
-
# Usage:
|
|
8
|
-
#
|
|
9
|
-
# ```ruby
|
|
10
|
-
# api.translationstash.subaction(value).perform # returns string with raw output
|
|
11
|
-
# # or
|
|
12
|
-
# api.translationstash.subaction(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 Translationstash < Reality::Describers::Wikidata::Impl::Actions::Post
|
|
21
|
-
|
|
22
|
-
# Action.
|
|
23
|
-
#
|
|
24
|
-
# @param value [String] One of "add", "query".
|
|
25
|
-
# @return [self]
|
|
26
|
-
def subaction(value)
|
|
27
|
-
_subaction(value) or fail ArgumentError, "Unknown value for subaction: #{value}"
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
# @private
|
|
31
|
-
def _subaction(value)
|
|
32
|
-
defined?(super) && super || ["add", "query"].include?(value.to_s) && merge(subaction: value.to_s)
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
# Title of the translation unit page.
|
|
36
|
-
#
|
|
37
|
-
# @param value [String]
|
|
38
|
-
# @return [self]
|
|
39
|
-
def title(value)
|
|
40
|
-
merge(title: value.to_s)
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
# Translation made by the user.
|
|
44
|
-
#
|
|
45
|
-
# @param value [String]
|
|
46
|
-
# @return [self]
|
|
47
|
-
def translation(value)
|
|
48
|
-
merge(translation: value.to_s)
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
# JSON object.
|
|
52
|
-
#
|
|
53
|
-
# @param value [String]
|
|
54
|
-
# @return [self]
|
|
55
|
-
def metadata(value)
|
|
56
|
-
merge(metadata: value.to_s)
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
# A "csrf" token retrieved from action=query&meta=tokens
|
|
60
|
-
#
|
|
61
|
-
# @param value [String]
|
|
62
|
-
# @return [self]
|
|
63
|
-
def token(value)
|
|
64
|
-
merge(token: value.to_s)
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
# Optionally the user whose stash to get. Only privileged users can do this.
|
|
68
|
-
#
|
|
69
|
-
# @param value [String]
|
|
70
|
-
# @return [self]
|
|
71
|
-
def username(value)
|
|
72
|
-
merge(username: value.to_s)
|
|
73
|
-
end
|
|
74
|
-
end
|
|
75
|
-
end
|
|
76
|
-
end
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Reality::Describers::Wikidata::Impl
|
|
4
|
-
module Actions
|
|
5
|
-
# Query suggestions from translation memories.
|
|
6
|
-
#
|
|
7
|
-
# Usage:
|
|
8
|
-
#
|
|
9
|
-
# ```ruby
|
|
10
|
-
# api.ttmserver.service(value).perform # returns string with raw output
|
|
11
|
-
# # or
|
|
12
|
-
# api.ttmserver.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 Ttmserver < Reality::Describers::Wikidata::Impl::Actions::Get
|
|
21
|
-
|
|
22
|
-
# Which of the available translation services to use.
|
|
23
|
-
#
|
|
24
|
-
# @param value [String] One of "".
|
|
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 || [""].include?(value.to_s) && merge(service: value.to_s)
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
# The language code of the source text.
|
|
36
|
-
#
|
|
37
|
-
# @param value [String]
|
|
38
|
-
# @return [self]
|
|
39
|
-
def sourcelanguage(value)
|
|
40
|
-
merge(sourcelanguage: value.to_s)
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
# The language code of the suggestion.
|
|
44
|
-
#
|
|
45
|
-
# @param value [String]
|
|
46
|
-
# @return [self]
|
|
47
|
-
def targetlanguage(value)
|
|
48
|
-
merge(targetlanguage: value.to_s)
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
# The text to find suggestions for.
|
|
52
|
-
#
|
|
53
|
-
# @param value [String]
|
|
54
|
-
# @return [self]
|
|
55
|
-
def text(value)
|
|
56
|
-
merge(text: value.to_s)
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
end
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Reality::Describers::Wikidata::Impl
|
|
4
|
-
module Actions
|
|
5
|
-
# Get the localization of ULS in the given language.
|
|
6
|
-
#
|
|
7
|
-
# Usage:
|
|
8
|
-
#
|
|
9
|
-
# ```ruby
|
|
10
|
-
# api.ulslocalization.language(value).perform # returns string with raw output
|
|
11
|
-
# # or
|
|
12
|
-
# api.ulslocalization.language(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 Ulslocalization < Reality::Describers::Wikidata::Impl::Actions::Get
|
|
21
|
-
|
|
22
|
-
# Language code.
|
|
23
|
-
#
|
|
24
|
-
# @param value [String]
|
|
25
|
-
# @return [self]
|
|
26
|
-
def language(value)
|
|
27
|
-
merge(language: value.to_s)
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
end
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Reality::Describers::Wikidata::Impl
|
|
4
|
-
module Actions
|
|
5
|
-
# Unblock a user.
|
|
6
|
-
#
|
|
7
|
-
# Usage:
|
|
8
|
-
#
|
|
9
|
-
# ```ruby
|
|
10
|
-
# api.unblock.id(value).perform # returns string with raw output
|
|
11
|
-
# # or
|
|
12
|
-
# api.unblock.id(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 Unblock < Reality::Describers::Wikidata::Impl::Actions::Post
|
|
21
|
-
|
|
22
|
-
# ID of the block to unblock (obtained through list=blocks). Cannot be used together with user or userid.
|
|
23
|
-
#
|
|
24
|
-
# @param value [Integer]
|
|
25
|
-
# @return [self]
|
|
26
|
-
def id(value)
|
|
27
|
-
merge(id: value.to_s)
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
# Username, IP address or IP address range to unblock. Cannot be used together with id or userid.
|
|
31
|
-
#
|
|
32
|
-
# @param value [String]
|
|
33
|
-
# @return [self]
|
|
34
|
-
def user(value)
|
|
35
|
-
merge(user: value.to_s)
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
# User ID to unblock. Cannot be used together with id or user.
|
|
39
|
-
#
|
|
40
|
-
# @param value [Integer]
|
|
41
|
-
# @return [self]
|
|
42
|
-
def userid(value)
|
|
43
|
-
merge(userid: value.to_s)
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
# Reason for unblock.
|
|
47
|
-
#
|
|
48
|
-
# @param value [String]
|
|
49
|
-
# @return [self]
|
|
50
|
-
def reason(value)
|
|
51
|
-
merge(reason: value.to_s)
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
# Change tags to apply to the entry in the block log.
|
|
55
|
-
#
|
|
56
|
-
# @param values [Array<String>] Allowed values: "InfoboxExport gadget", "WE-Framework gadget".
|
|
57
|
-
# @return [self]
|
|
58
|
-
def tags(*values)
|
|
59
|
-
values.inject(self) { |res, val| res._tags(val) or fail ArgumentError, "Unknown value for tags: #{val}" }
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
# @private
|
|
63
|
-
def _tags(value)
|
|
64
|
-
defined?(super) && super || ["InfoboxExport gadget", "WE-Framework gadget"].include?(value.to_s) && merge(tags: value.to_s, replace: false)
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
# A "csrf" token retrieved from action=query&meta=tokens
|
|
68
|
-
#
|
|
69
|
-
# @param value [String]
|
|
70
|
-
# @return [self]
|
|
71
|
-
def token(value)
|
|
72
|
-
merge(token: value.to_s)
|
|
73
|
-
end
|
|
74
|
-
end
|
|
75
|
-
end
|
|
76
|
-
end
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Reality::Describers::Wikidata::Impl
|
|
4
|
-
module Actions
|
|
5
|
-
# Restore revisions of a deleted page.
|
|
6
|
-
#
|
|
7
|
-
# Usage:
|
|
8
|
-
#
|
|
9
|
-
# ```ruby
|
|
10
|
-
# api.undelete.title(value).perform # returns string with raw output
|
|
11
|
-
# # or
|
|
12
|
-
# api.undelete.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 Undelete < Reality::Describers::Wikidata::Impl::Actions::Post
|
|
21
|
-
|
|
22
|
-
# Title of the page to restore.
|
|
23
|
-
#
|
|
24
|
-
# @param value [String]
|
|
25
|
-
# @return [self]
|
|
26
|
-
def title(value)
|
|
27
|
-
merge(title: value.to_s)
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
# Reason for restoring.
|
|
31
|
-
#
|
|
32
|
-
# @param value [String]
|
|
33
|
-
# @return [self]
|
|
34
|
-
def reason(value)
|
|
35
|
-
merge(reason: value.to_s)
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
# Change tags to apply to the entry in the deletion log.
|
|
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
|
-
# Timestamps of the revisions to restore. If both timestamps and fileids are empty, all will be restored.
|
|
52
|
-
#
|
|
53
|
-
# @param values [Array<Time>]
|
|
54
|
-
# @return [self]
|
|
55
|
-
def timestamps(*values)
|
|
56
|
-
values.inject(self) { |res, val| res._timestamps(val) }
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
# @private
|
|
60
|
-
def _timestamps(value)
|
|
61
|
-
merge(timestamps: value.iso8601, replace: false)
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
# IDs of the file revisions to restore. If both timestamps and fileids are empty, all will be restored.
|
|
65
|
-
#
|
|
66
|
-
# @param values [Array<Integer>]
|
|
67
|
-
# @return [self]
|
|
68
|
-
def fileids(*values)
|
|
69
|
-
values.inject(self) { |res, val| res._fileids(val) }
|
|
70
|
-
end
|
|
71
|
-
|
|
72
|
-
# @private
|
|
73
|
-
def _fileids(value)
|
|
74
|
-
merge(fileids: value.to_s, replace: false)
|
|
75
|
-
end
|
|
76
|
-
|
|
77
|
-
# Unconditionally add or remove the page from the current user's watchlist, use preferences or do not change watch.
|
|
78
|
-
#
|
|
79
|
-
# @param value [String] One of "watch", "unwatch", "preferences", "nochange".
|
|
80
|
-
# @return [self]
|
|
81
|
-
def watchlist(value)
|
|
82
|
-
_watchlist(value) or fail ArgumentError, "Unknown value for watchlist: #{value}"
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
# @private
|
|
86
|
-
def _watchlist(value)
|
|
87
|
-
defined?(super) && super || ["watch", "unwatch", "preferences", "nochange"].include?(value.to_s) && merge(watchlist: value.to_s)
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
# A "csrf" token retrieved from action=query&meta=tokens
|
|
91
|
-
#
|
|
92
|
-
# @param value [String]
|
|
93
|
-
# @return [self]
|
|
94
|
-
def token(value)
|
|
95
|
-
merge(token: value.to_s)
|
|
96
|
-
end
|
|
97
|
-
end
|
|
98
|
-
end
|
|
99
|
-
end
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Reality::Describers::Wikidata::Impl
|
|
4
|
-
module Actions
|
|
5
|
-
# Remove a linked third-party account from the current user.
|
|
6
|
-
#
|
|
7
|
-
# Usage:
|
|
8
|
-
#
|
|
9
|
-
# ```ruby
|
|
10
|
-
# api.unlinkaccount.request(value).perform # returns string with raw output
|
|
11
|
-
# # or
|
|
12
|
-
# api.unlinkaccount.request(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 Unlinkaccount < Reality::Describers::Wikidata::Impl::Actions::Post
|
|
21
|
-
|
|
22
|
-
# Use this authentication request, by the id returned from action=query&meta=authmanagerinfo with amirequestsfor=unlink.
|
|
23
|
-
#
|
|
24
|
-
# @param value [String]
|
|
25
|
-
# @return [self]
|
|
26
|
-
def request(value)
|
|
27
|
-
merge(request: value.to_s)
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
# A "csrf" token retrieved from action=query&meta=tokens
|
|
31
|
-
#
|
|
32
|
-
# @param value [String]
|
|
33
|
-
# @return [self]
|
|
34
|
-
def token(value)
|
|
35
|
-
merge(token: value.to_s)
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
end
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Reality::Describers::Wikidata::Impl
|
|
4
|
-
module Actions
|
|
5
|
-
# Upload a file, or get the status of pending uploads.
|
|
6
|
-
#
|
|
7
|
-
# Usage:
|
|
8
|
-
#
|
|
9
|
-
# ```ruby
|
|
10
|
-
# api.upload.filename(value).perform # returns string with raw output
|
|
11
|
-
# # or
|
|
12
|
-
# api.upload.filename(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 Upload < Reality::Describers::Wikidata::Impl::Actions::Post
|
|
21
|
-
|
|
22
|
-
# Target filename.
|
|
23
|
-
#
|
|
24
|
-
# @param value [String]
|
|
25
|
-
# @return [self]
|
|
26
|
-
def filename(value)
|
|
27
|
-
merge(filename: value.to_s)
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
# Upload comment. Also used as the initial page text for new files if text is not specified.
|
|
31
|
-
#
|
|
32
|
-
# @param value [String]
|
|
33
|
-
# @return [self]
|
|
34
|
-
def comment(value)
|
|
35
|
-
merge(comment: value.to_s)
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
# Change tags to apply to the upload log entry and file page revision.
|
|
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
|
-
# Initial page text for new files.
|
|
52
|
-
#
|
|
53
|
-
# @param value [String]
|
|
54
|
-
# @return [self]
|
|
55
|
-
def text(value)
|
|
56
|
-
merge(text: value.to_s)
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
# Watch the page.
|
|
60
|
-
#
|
|
61
|
-
# @return [self]
|
|
62
|
-
def watch()
|
|
63
|
-
merge(watch: 'true')
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
# Unconditionally add or remove the page from the current user's watchlist, use preferences or do not change watch.
|
|
67
|
-
#
|
|
68
|
-
# @param value [String] One of "watch", "preferences", "nochange".
|
|
69
|
-
# @return [self]
|
|
70
|
-
def watchlist(value)
|
|
71
|
-
_watchlist(value) or fail ArgumentError, "Unknown value for watchlist: #{value}"
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
# @private
|
|
75
|
-
def _watchlist(value)
|
|
76
|
-
defined?(super) && super || ["watch", "preferences", "nochange"].include?(value.to_s) && merge(watchlist: value.to_s)
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
-
# Ignore any warnings.
|
|
80
|
-
#
|
|
81
|
-
# @return [self]
|
|
82
|
-
def ignorewarnings()
|
|
83
|
-
merge(ignorewarnings: 'true')
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
# File contents.
|
|
87
|
-
#
|
|
88
|
-
# @param value [String]
|
|
89
|
-
# @return [self]
|
|
90
|
-
def file(value)
|
|
91
|
-
merge(file: value.to_s)
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
# URL to fetch the file from.
|
|
95
|
-
#
|
|
96
|
-
# @param value [String]
|
|
97
|
-
# @return [self]
|
|
98
|
-
def url(value)
|
|
99
|
-
merge(url: value.to_s)
|
|
100
|
-
end
|
|
101
|
-
|
|
102
|
-
# Key that identifies a previous upload that was stashed temporarily.
|
|
103
|
-
#
|
|
104
|
-
# @param value [String]
|
|
105
|
-
# @return [self]
|
|
106
|
-
def filekey(value)
|
|
107
|
-
merge(filekey: value.to_s)
|
|
108
|
-
end
|
|
109
|
-
|
|
110
|
-
# Same as filekey, maintained for backward compatibility.
|
|
111
|
-
#
|
|
112
|
-
# @param value [String]
|
|
113
|
-
# @return [self]
|
|
114
|
-
def sessionkey(value)
|
|
115
|
-
merge(sessionkey: value.to_s)
|
|
116
|
-
end
|
|
117
|
-
|
|
118
|
-
# If set, the server will stash the file temporarily instead of adding it to the repository.
|
|
119
|
-
#
|
|
120
|
-
# @return [self]
|
|
121
|
-
def stash()
|
|
122
|
-
merge(stash: 'true')
|
|
123
|
-
end
|
|
124
|
-
|
|
125
|
-
# Filesize of entire upload.
|
|
126
|
-
#
|
|
127
|
-
# @param value [Integer]
|
|
128
|
-
# @return [self]
|
|
129
|
-
def filesize(value)
|
|
130
|
-
merge(filesize: value.to_s)
|
|
131
|
-
end
|
|
132
|
-
|
|
133
|
-
# Offset of chunk in bytes.
|
|
134
|
-
#
|
|
135
|
-
# @param value [Integer]
|
|
136
|
-
# @return [self]
|
|
137
|
-
def offset(value)
|
|
138
|
-
merge(offset: value.to_s)
|
|
139
|
-
end
|
|
140
|
-
|
|
141
|
-
# Chunk contents.
|
|
142
|
-
#
|
|
143
|
-
# @param value [String]
|
|
144
|
-
# @return [self]
|
|
145
|
-
def chunk(value)
|
|
146
|
-
merge(chunk: value.to_s)
|
|
147
|
-
end
|
|
148
|
-
|
|
149
|
-
# Make potentially large file operations asynchronous when possible.
|
|
150
|
-
#
|
|
151
|
-
# @return [self]
|
|
152
|
-
def async()
|
|
153
|
-
merge(async: 'true')
|
|
154
|
-
end
|
|
155
|
-
|
|
156
|
-
# Only fetch the upload status for the given file key.
|
|
157
|
-
#
|
|
158
|
-
# @return [self]
|
|
159
|
-
def checkstatus()
|
|
160
|
-
merge(checkstatus: 'true')
|
|
161
|
-
end
|
|
162
|
-
|
|
163
|
-
# A "csrf" token retrieved from action=query&meta=tokens
|
|
164
|
-
#
|
|
165
|
-
# @param value [String]
|
|
166
|
-
# @return [self]
|
|
167
|
-
def token(value)
|
|
168
|
-
merge(token: value.to_s)
|
|
169
|
-
end
|
|
170
|
-
end
|
|
171
|
-
end
|
|
172
|
-
end
|