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,47 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Reality::Describers::Wikidata::Impl
|
4
|
-
module Actions
|
5
|
-
# Access graph tag functionality.
|
6
|
-
#
|
7
|
-
# Usage:
|
8
|
-
#
|
9
|
-
# ```ruby
|
10
|
-
# api.graph.hash(value).perform # returns string with raw output
|
11
|
-
# # or
|
12
|
-
# api.graph.hash(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 Graph < Reality::Describers::Wikidata::Impl::Actions::Get
|
21
|
-
|
22
|
-
# Hash value of the graph
|
23
|
-
#
|
24
|
-
# @param value [String]
|
25
|
-
# @return [self]
|
26
|
-
def hash(value)
|
27
|
-
merge(hash: value.to_s)
|
28
|
-
end
|
29
|
-
|
30
|
-
# Title of the article with the graph
|
31
|
-
#
|
32
|
-
# @param value [String]
|
33
|
-
# @return [self]
|
34
|
-
def title(value)
|
35
|
-
merge(title: value.to_s)
|
36
|
-
end
|
37
|
-
|
38
|
-
# Text of the graph to be converted to JSON. Must be posted and used without title and hash parameters
|
39
|
-
#
|
40
|
-
# @param value [String]
|
41
|
-
# @return [self]
|
42
|
-
def text(value)
|
43
|
-
merge(text: value.to_s)
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
@@ -1,55 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Reality::Describers::Wikidata::Impl
|
4
|
-
module Actions
|
5
|
-
# Set message group workflow states.
|
6
|
-
#
|
7
|
-
# Usage:
|
8
|
-
#
|
9
|
-
# ```ruby
|
10
|
-
# api.groupreview.group(value).perform # returns string with raw output
|
11
|
-
# # or
|
12
|
-
# api.groupreview.group(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 Groupreview < Reality::Describers::Wikidata::Impl::Actions::Post
|
21
|
-
|
22
|
-
# Message group.
|
23
|
-
#
|
24
|
-
# @param value [String]
|
25
|
-
# @return [self]
|
26
|
-
def group(value)
|
27
|
-
merge(group: value.to_s)
|
28
|
-
end
|
29
|
-
|
30
|
-
# Language code.
|
31
|
-
#
|
32
|
-
# @param value [String]
|
33
|
-
# @return [self]
|
34
|
-
def language(value)
|
35
|
-
merge(language: value.to_s)
|
36
|
-
end
|
37
|
-
|
38
|
-
# The new state for the group.
|
39
|
-
#
|
40
|
-
# @param value [String]
|
41
|
-
# @return [self]
|
42
|
-
def state(value)
|
43
|
-
merge(state: value.to_s)
|
44
|
-
end
|
45
|
-
|
46
|
-
# A "csrf" token retrieved from action=query&meta=tokens
|
47
|
-
#
|
48
|
-
# @param value [String]
|
49
|
-
# @return [self]
|
50
|
-
def token(value)
|
51
|
-
merge(token: value.to_s)
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
@@ -1,64 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Reality::Describers::Wikidata::Impl
|
4
|
-
module Actions
|
5
|
-
# Display help for the specified modules.
|
6
|
-
#
|
7
|
-
# Usage:
|
8
|
-
#
|
9
|
-
# ```ruby
|
10
|
-
# api.help.modules(value).perform # returns string with raw output
|
11
|
-
# # or
|
12
|
-
# api.help.modules(value).response # returns output parsed and wrapped into Response object
|
13
|
-
# ```
|
14
|
-
#
|
15
|
-
# See {Base} for generic explanation of working with MediaWiki actions and
|
16
|
-
# {Reality::Describers::Wikidata::Impl::Response} for working with action responses.
|
17
|
-
#
|
18
|
-
# All action's parameters are documented as its public methods, see below.
|
19
|
-
#
|
20
|
-
class Help < Reality::Describers::Wikidata::Impl::Actions::Get
|
21
|
-
|
22
|
-
# Modules to display help for (values of the action and format parameters, or main). Can specify submodules with a +.
|
23
|
-
#
|
24
|
-
# @param values [Array<String>]
|
25
|
-
# @return [self]
|
26
|
-
def modules(*values)
|
27
|
-
values.inject(self) { |res, val| res._modules(val) }
|
28
|
-
end
|
29
|
-
|
30
|
-
# @private
|
31
|
-
def _modules(value)
|
32
|
-
merge(modules: value.to_s, replace: false)
|
33
|
-
end
|
34
|
-
|
35
|
-
# Include help for submodules of the named module.
|
36
|
-
#
|
37
|
-
# @return [self]
|
38
|
-
def submodules()
|
39
|
-
merge(submodules: 'true')
|
40
|
-
end
|
41
|
-
|
42
|
-
# Include help for submodules recursively.
|
43
|
-
#
|
44
|
-
# @return [self]
|
45
|
-
def recursivesubmodules()
|
46
|
-
merge(recursivesubmodules: 'true')
|
47
|
-
end
|
48
|
-
|
49
|
-
# Wrap the output in a standard API response structure.
|
50
|
-
#
|
51
|
-
# @return [self]
|
52
|
-
def wrap()
|
53
|
-
merge(wrap: 'true')
|
54
|
-
end
|
55
|
-
|
56
|
-
# Include a table of contents in the HTML output.
|
57
|
-
#
|
58
|
-
# @return [self]
|
59
|
-
def toc()
|
60
|
-
merge(toc: 'true')
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Reality::Describers::Wikidata::Impl
|
4
|
-
module Actions
|
5
|
-
# This module has been disabled.
|
6
|
-
#
|
7
|
-
# Usage:
|
8
|
-
#
|
9
|
-
# ```ruby
|
10
|
-
# api.imagerotate.perform # returns string with raw output
|
11
|
-
# # or
|
12
|
-
# api.imagerotate.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 Imagerotate < Reality::Describers::Wikidata::Impl::Actions::Get
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,116 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Reality::Describers::Wikidata::Impl
|
4
|
-
module Actions
|
5
|
-
# Import a page from another wiki, or from an XML file.
|
6
|
-
#
|
7
|
-
# Usage:
|
8
|
-
#
|
9
|
-
# ```ruby
|
10
|
-
# api.import.summary(value).perform # returns string with raw output
|
11
|
-
# # or
|
12
|
-
# api.import.summary(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 Import < Reality::Describers::Wikidata::Impl::Actions::Post
|
21
|
-
|
22
|
-
# Log entry import summary.
|
23
|
-
#
|
24
|
-
# @param value [String]
|
25
|
-
# @return [self]
|
26
|
-
def summary(value)
|
27
|
-
merge(summary: value.to_s)
|
28
|
-
end
|
29
|
-
|
30
|
-
# Uploaded XML file.
|
31
|
-
#
|
32
|
-
# @param value [String]
|
33
|
-
# @return [self]
|
34
|
-
def xml(value)
|
35
|
-
merge(xml: value.to_s)
|
36
|
-
end
|
37
|
-
|
38
|
-
# For interwiki imports: wiki to import from.
|
39
|
-
#
|
40
|
-
# @param value [String] One of "meta", "commons", "en", "de", "fr", "es".
|
41
|
-
# @return [self]
|
42
|
-
def interwikisource(value)
|
43
|
-
_interwikisource(value) or fail ArgumentError, "Unknown value for interwikisource: #{value}"
|
44
|
-
end
|
45
|
-
|
46
|
-
# @private
|
47
|
-
def _interwikisource(value)
|
48
|
-
defined?(super) && super || ["meta", "commons", "en", "de", "fr", "es"].include?(value.to_s) && merge(interwikisource: value.to_s)
|
49
|
-
end
|
50
|
-
|
51
|
-
# For interwiki imports: page to import.
|
52
|
-
#
|
53
|
-
# @param value [String]
|
54
|
-
# @return [self]
|
55
|
-
def interwikipage(value)
|
56
|
-
merge(interwikipage: value.to_s)
|
57
|
-
end
|
58
|
-
|
59
|
-
# For interwiki imports: import the full history, not just the current version.
|
60
|
-
#
|
61
|
-
# @return [self]
|
62
|
-
def fullhistory()
|
63
|
-
merge(fullhistory: 'true')
|
64
|
-
end
|
65
|
-
|
66
|
-
# For interwiki imports: import all included templates as well.
|
67
|
-
#
|
68
|
-
# @return [self]
|
69
|
-
def templates()
|
70
|
-
merge(templates: 'true')
|
71
|
-
end
|
72
|
-
|
73
|
-
# Import to this namespace. Cannot be used together with rootpage.
|
74
|
-
#
|
75
|
-
# @param value [String] One of "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "120", "121", "122", "123", "828", "829", "1198", "1199", "2300", "2301", "2302", "2303", "2600".
|
76
|
-
# @return [self]
|
77
|
-
def namespace(value)
|
78
|
-
_namespace(value) or fail ArgumentError, "Unknown value for namespace: #{value}"
|
79
|
-
end
|
80
|
-
|
81
|
-
# @private
|
82
|
-
def _namespace(value)
|
83
|
-
defined?(super) && super || ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "120", "121", "122", "123", "828", "829", "1198", "1199", "2300", "2301", "2302", "2303", "2600"].include?(value.to_s) && merge(namespace: value.to_s)
|
84
|
-
end
|
85
|
-
|
86
|
-
# Import as subpage of this page. Cannot be used together with namespace.
|
87
|
-
#
|
88
|
-
# @param value [String]
|
89
|
-
# @return [self]
|
90
|
-
def rootpage(value)
|
91
|
-
merge(rootpage: value.to_s)
|
92
|
-
end
|
93
|
-
|
94
|
-
# Change tags to apply to the entry in the import log and to the null revision on the imported pages.
|
95
|
-
#
|
96
|
-
# @param values [Array<String>] Allowed values: "InfoboxExport gadget", "WE-Framework gadget".
|
97
|
-
# @return [self]
|
98
|
-
def tags(*values)
|
99
|
-
values.inject(self) { |res, val| res._tags(val) or fail ArgumentError, "Unknown value for tags: #{val}" }
|
100
|
-
end
|
101
|
-
|
102
|
-
# @private
|
103
|
-
def _tags(value)
|
104
|
-
defined?(super) && super || ["InfoboxExport gadget", "WE-Framework gadget"].include?(value.to_s) && merge(tags: value.to_s, replace: false)
|
105
|
-
end
|
106
|
-
|
107
|
-
# A "csrf" token retrieved from action=query&meta=tokens
|
108
|
-
#
|
109
|
-
# @param value [String]
|
110
|
-
# @return [self]
|
111
|
-
def token(value)
|
112
|
-
merge(token: value.to_s)
|
113
|
-
end
|
114
|
-
end
|
115
|
-
end
|
116
|
-
end
|
@@ -1,60 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Reality::Describers::Wikidata::Impl
|
4
|
-
module Actions
|
5
|
-
# Allows direct access to JsonConfig subsystem.
|
6
|
-
#
|
7
|
-
# Usage:
|
8
|
-
#
|
9
|
-
# ```ruby
|
10
|
-
# api.jsonconfig.command(value).perform # returns string with raw output
|
11
|
-
# # or
|
12
|
-
# api.jsonconfig.command(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 Jsonconfig < Reality::Describers::Wikidata::Impl::Actions::Get
|
21
|
-
|
22
|
-
# Which sub-action to perform on JsonConfig:
|
23
|
-
#
|
24
|
-
# @param value [String] One of "status" (Shows JsonConfig configuration), "reset" (Clears configurations from cache. Requires title parameter and jsonconfig-reset right), "reload" (Reloads and caches configurations from config store. Requires title parameter and jsonconfig-reset right).
|
25
|
-
# @return [self]
|
26
|
-
def command(value)
|
27
|
-
_command(value) or fail ArgumentError, "Unknown value for command: #{value}"
|
28
|
-
end
|
29
|
-
|
30
|
-
# @private
|
31
|
-
def _command(value)
|
32
|
-
defined?(super) && super || ["status", "reset", "reload"].include?(value.to_s) && merge(command: value.to_s)
|
33
|
-
end
|
34
|
-
|
35
|
-
# Namespace number of the title to process.
|
36
|
-
#
|
37
|
-
# @param value [Integer]
|
38
|
-
# @return [self]
|
39
|
-
def namespace(value)
|
40
|
-
merge(namespace: value.to_s)
|
41
|
-
end
|
42
|
-
|
43
|
-
# Title to process without namespace prefix.
|
44
|
-
#
|
45
|
-
# @param value [String]
|
46
|
-
# @return [self]
|
47
|
-
def title(value)
|
48
|
-
merge(title: value.to_s)
|
49
|
-
end
|
50
|
-
|
51
|
-
# For command=reload, use this content instead.
|
52
|
-
#
|
53
|
-
# @param value [String]
|
54
|
-
# @return [self]
|
55
|
-
def content(value)
|
56
|
-
merge(content: 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
|
-
# Retrieve localized JSON data.
|
6
|
-
#
|
7
|
-
# Usage:
|
8
|
-
#
|
9
|
-
# ```ruby
|
10
|
-
# api.jsondata.title(value).perform # returns string with raw output
|
11
|
-
# # or
|
12
|
-
# api.jsondata.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 Jsondata < Reality::Describers::Wikidata::Impl::Actions::Get
|
21
|
-
|
22
|
-
# Title to get. By default assumes namespace to be "Data:"
|
23
|
-
#
|
24
|
-
# @param value [String]
|
25
|
-
# @return [self]
|
26
|
-
def title(value)
|
27
|
-
merge(title: value.to_s)
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Reality::Describers::Wikidata::Impl
|
4
|
-
module Actions
|
5
|
-
# Search for language names in any script.
|
6
|
-
#
|
7
|
-
# Usage:
|
8
|
-
#
|
9
|
-
# ```ruby
|
10
|
-
# api.languagesearch.search(value).perform # returns string with raw output
|
11
|
-
# # or
|
12
|
-
# api.languagesearch.search(value).response # returns output parsed and wrapped into Response object
|
13
|
-
# ```
|
14
|
-
#
|
15
|
-
# See {Base} for generic explanation of working with MediaWiki actions and
|
16
|
-
# {Reality::Describers::Wikidata::Impl::Response} for working with action responses.
|
17
|
-
#
|
18
|
-
# All action's parameters are documented as its public methods, see below.
|
19
|
-
#
|
20
|
-
class Languagesearch < Reality::Describers::Wikidata::Impl::Actions::Get
|
21
|
-
|
22
|
-
# Search string.
|
23
|
-
#
|
24
|
-
# @param value [String]
|
25
|
-
# @return [self]
|
26
|
-
def search(value)
|
27
|
-
merge(search: value.to_s)
|
28
|
-
end
|
29
|
-
|
30
|
-
# Number of spelling mistakes allowed in the search string.
|
31
|
-
#
|
32
|
-
# @param value [Integer]
|
33
|
-
# @return [self]
|
34
|
-
def typos(value)
|
35
|
-
merge(typos: value.to_s)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
@@ -1,79 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Reality::Describers::Wikidata::Impl
|
4
|
-
module Actions
|
5
|
-
# Link an account from a third-party provider to the current user.
|
6
|
-
#
|
7
|
-
# Usage:
|
8
|
-
#
|
9
|
-
# ```ruby
|
10
|
-
# api.linkaccount.requests(value).perform # returns string with raw output
|
11
|
-
# # or
|
12
|
-
# api.linkaccount.requests(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 Linkaccount < Reality::Describers::Wikidata::Impl::Actions::Post
|
21
|
-
|
22
|
-
# Only use these authentication requests, by the id returned from action=query&meta=authmanagerinfo with amirequestsfor=link or from a previous response from this module.
|
23
|
-
#
|
24
|
-
# @param values [Array<String>]
|
25
|
-
# @return [self]
|
26
|
-
def requests(*values)
|
27
|
-
values.inject(self) { |res, val| res._requests(val) }
|
28
|
-
end
|
29
|
-
|
30
|
-
# @private
|
31
|
-
def _requests(value)
|
32
|
-
merge(linkrequests: value.to_s, replace: false)
|
33
|
-
end
|
34
|
-
|
35
|
-
# Format to use for returning messages.
|
36
|
-
#
|
37
|
-
# @param value [String] One of "html", "wikitext", "raw", "none".
|
38
|
-
# @return [self]
|
39
|
-
def messageformat(value)
|
40
|
-
_messageformat(value) or fail ArgumentError, "Unknown value for messageformat: #{value}"
|
41
|
-
end
|
42
|
-
|
43
|
-
# @private
|
44
|
-
def _messageformat(value)
|
45
|
-
defined?(super) && super || ["html", "wikitext", "raw", "none"].include?(value.to_s) && merge(linkmessageformat: value.to_s)
|
46
|
-
end
|
47
|
-
|
48
|
-
# Merge field information for all authentication requests into one array.
|
49
|
-
#
|
50
|
-
# @return [self]
|
51
|
-
def mergerequestfields()
|
52
|
-
merge(linkmergerequestfields: 'true')
|
53
|
-
end
|
54
|
-
|
55
|
-
# Return URL for third-party authentication flows, must be absolute. Either this or linkcontinue is required.
|
56
|
-
#
|
57
|
-
# @param value [String]
|
58
|
-
# @return [self]
|
59
|
-
def returnurl(value)
|
60
|
-
merge(linkreturnurl: value.to_s)
|
61
|
-
end
|
62
|
-
|
63
|
-
# This request is a continuation after an earlier UI or REDIRECT response. Either this or linkreturnurl is required.
|
64
|
-
#
|
65
|
-
# @return [self]
|
66
|
-
def continue()
|
67
|
-
merge(linkcontinue: 'true')
|
68
|
-
end
|
69
|
-
|
70
|
-
# A "csrf" token retrieved from action=query&meta=tokens
|
71
|
-
#
|
72
|
-
# @param value [String]
|
73
|
-
# @return [self]
|
74
|
-
def token(value)
|
75
|
-
merge(linktoken: value.to_s)
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|