Added result properties to action=paraminfo

Added information about the properties of the results of API calls
to action=paraminfo, including information about "property groups":
what should the prop parameter be set to to get that property.

Uses the same format for types as parameters already do.
The output format of some modules doesn't fit this, so the result
properties for them weren't added, or only partially.

Partially implemented modules:
* expandtemplates:
  parsetree is in its own tag
* protect, allusers, backlinks, deletedrevs, info, imageinfo,
  logevents, querypage, recentchanges, revisions, searchinfo,
  usercontribs, userinfo, users, watchlist, upload:
  response with partially complex structure

Not implemented modules:
* feedcontributions, feedwatchlist, opensearch, rds:
  non-standard reponse
* help:
  error is normal response; not very useful for automated tools anyway
* paraminfo, parse, pageprops, siteinfo, userrights:
  response with complex structure

Change-Id: Iff2a9bef79f994e73eef3062b4dd5461bff968ab
This commit is contained in:
Petr Onderka 2012-05-02 17:00:30 +02:00
parent a07531a628
commit 80aa025528
63 changed files with 1789 additions and 6 deletions

View file

@ -132,6 +132,7 @@ upgrade PHP if you have not done so prior to upgrading MediaWiki.
* (bug 33224) add variants of content language to meta=siteinfo
* (bug 36761) "Mark pages as visited" now submits previously established filter options
* (bug 32643) action=purge with forcelinkupdate no longer crashes when ratelimit is reached
* The paraminfo module now also contains result properties for most modules
=== Languages updated in 1.20 ===

View file

@ -331,6 +331,11 @@ descriptions.
&$module: ApiBase Module object
&$desc: Array of parameter descriptions
'APIGetResultProperties': use this hook to mofify the properties
in a module's result.
&$module: ApiBase Module object
&$properties: Array of properties
'APIQueryAfterExecute': after calling the execute() method of an
action=query submodule. Use this to extend core API modules.
&$module: Module object

View file

@ -56,6 +56,11 @@ abstract class ApiBase extends ContextSource {
/// @since 1.17
const PARAM_RANGE_ENFORCE = 9; // Boolean, if MIN/MAX are set, enforce (die) these? Only applies if TYPE='integer' Use with extreme caution
const PROP_ROOT = 'ROOT'; // Name of property group that is on the root element of the result, i.e. not part of a list
const PROP_LIST = 'LIST'; // Boolean, is the result multiple items? Defaults to true for query modules, to false for other modules
const PROP_TYPE = 0; // Type of the property, uses same format as PARAM_TYPE
const PROP_NULLABLE = 1; // Boolean, can the property be not included in the result? Defaults to false
const LIMIT_BIG1 = 500; // Fast query, std user limit
const LIMIT_BIG2 = 5000; // Fast query, bot/sysop limit
const LIMIT_SML1 = 50; // Slow query, std user limit
@ -572,6 +577,51 @@ abstract class ApiBase extends ContextSource {
return $desc;
}
/**
* Returns possible properties in the result, grouped by the value of the prop parameter
* that shows them.
*
* Properties that are shown always are in a group with empty string as a key.
* Properties that can be shown by several values of prop are included multiple times.
* If some properties are part of a list and some are on the root object (see ApiQueryQueryPage),
* those on the root object are under the key PROP_ROOT.
* The array can also contain a boolean under the key PROP_LIST,
* indicating whether the result is a list.
*
* Don't call this functon directly: use getFinalResultProperties() to
* allow hooks to modify descriptions as needed.
*
* @return array|bool False on no properties
*/
protected function getResultProperties() {
return false;
}
/**
* Get final possible result properties, after hooks have had a chance to tweak it as
* needed.
*
* @return array
*/
public function getFinalResultProperties() {
$properties = $this->getResultProperties();
wfRunHooks( 'APIGetResultProperties', array( $this, &$properties ) );
return $properties;
}
/**
* Add token properties to the array used by getResultProperties,
* based on a token functions mapping.
*/
protected static function addTokenProperties( &$props, $tokenFunctions ) {
foreach ( array_keys( $tokenFunctions ) as $token ) {
$props[''][$token . 'token'] = array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
);
}
}
/**
* Get final module description, after hooks have had a chance to tweak it as
* needed.

View file

@ -186,6 +186,44 @@ class ApiBlock extends ApiBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'blocktoken' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'user' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'userID' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
),
'expiry' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'id' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
),
'reason' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'anononly' => 'boolean',
'nocreate' => 'boolean',
'autoblock' => 'boolean',
'noemail' => 'boolean',
'hidename' => 'boolean',
'allowusertalk' => 'boolean',
'watchuser' => 'boolean'
)
);
}
public function getDescription() {
return 'Block a user';
}

View file

@ -124,6 +124,25 @@ class ApiComparePages extends ApiBase {
'torev' => 'Second revision to compare',
);
}
public function getResultProperties() {
return array(
'' => array(
'fromtitle' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'fromrevid' => 'integer',
'totitle' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'torevid' => 'integer',
'*' => 'string'
)
);
}
public function getDescription() {
return array(
'Get the difference between 2 pages',

View file

@ -221,6 +221,15 @@ class ApiDelete extends ApiBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'title' => 'string',
'reason' => 'string'
)
);
}
public function getDescription() {
return 'Delete a page';
}

View file

@ -494,6 +494,41 @@ class ApiEditPage extends ApiBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'new' => 'boolean',
'result' => array(
ApiBase::PROP_TYPE => array(
'Success',
'Failure'
),
),
'pageid' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
),
'title' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'nochange' => 'boolean',
'oldrevid' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
),
'newrevid' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
),
'newtimestamp' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
)
);
}
public function needsToken() {
return true;
}

View file

@ -113,6 +113,23 @@ class ApiEmailUser extends ApiBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'result' => array(
ApiBase::PROP_TYPE => array(
'Success',
'Failure'
),
),
'message' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
)
);
}
public function getDescription() {
return 'Email a user.';
}

View file

@ -103,6 +103,14 @@ class ApiExpandTemplates extends ApiBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'*' => 'string'
)
);
}
public function getDescription() {
return 'Expands all templates in wikitext';
}

View file

@ -132,15 +132,29 @@ class ApiFileRevert extends ApiBase {
}
public function getParamDescription() {
$params = array(
return array(
'filename' => 'Target filename without the File: prefix',
'token' => 'Edit token. You can get one of these through prop=info',
'comment' => 'Upload comment',
'archivename' => 'Archive name of the revision to revert to',
);
}
return $params;
public function getResultProperties() {
return array(
'' => array(
'result' => array(
ApiBase::PROP_TYPE => array(
'Success',
'Failure'
)
),
'errors' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
)
);
}
public function getDescription() {

View file

@ -126,6 +126,17 @@ class ApiImport extends ApiBase {
);
}
public function getResultProperties() {
return array(
ApiBase::PROP_LIST => true,
'' => array(
'ns' => 'namespace',
'title' => 'string',
'revisions' => 'integer'
)
);
}
public function getDescription() {
return array(
'Import a page from another wiki, or an XML file.' ,
@ -187,11 +198,11 @@ class ApiImportReporter extends ImportReporter {
// Add a result entry
$r = array();
if ( $title === null ) {
if ( $title === null ) {
# Invalid or non-importable title
$r['title'] = $pageInfo['title'];
$r['invalid'] = '';
} else {
$r['invalid'] = '';
} else {
ApiQueryBase::addTitleInfo( $r, $title );
$r['revisions'] = intval( $successCount );
}

View file

@ -181,6 +181,66 @@ class ApiLogin extends ApiBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'result' => array(
ApiBase::PROP_TYPE => array(
'Success',
'NeedToken',
'WrongToken',
'NoName',
'Illegal',
'WrongPluginPass',
'NotExists',
'WrongPass',
'EmptyPass',
'CreateBlocked',
'Throttled',
'Blocked',
'Aborted'
)
),
'lguserid' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
),
'lgusername' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'lgtoken' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'cookieprefix' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'sessionid' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'token' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'details' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'wait' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
),
'reason' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
)
);
}
public function getDescription() {
return array(
'Log in and get the authentication tokens. ',

View file

@ -54,6 +54,10 @@ class ApiLogout extends ApiBase {
return array();
}
public function getResultProperties() {
return array();
}
public function getParamDescription() {
return array();
}

View file

@ -224,6 +224,33 @@ class ApiMove extends ApiBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'from' => 'string',
'to' => 'string',
'reason' => 'string',
'redirectcreated' => 'boolean',
'talkfrom' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'talkto' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'talkmove-error-code' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'talkmove-error-info' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
)
);
}
public function getDescription() {
return 'Move a page';
}

View file

@ -107,6 +107,18 @@ class ApiOptions extends ApiBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'*' => array(
ApiBase::PROP_TYPE => array(
'success'
)
)
)
);
}
public function getParamDescription() {
return array(
'token' => 'An options token previously obtained through the action=tokens',

View file

@ -251,6 +251,62 @@ class ApiParamInfo extends ApiBase {
}
$result->setIndexedTagName( $retval['parameters'], 'param' );
$props = $obj->getFinalResultProperties();
$listResult = null;
if ( $props !== false ) {
$retval['props'] = array();
foreach ( $props as $prop => $properties ) {
$propResult = array();
if ( $prop == ApiBase::PROP_LIST ) {
$listResult = $properties;
continue;
}
if ( $prop != ApiBase::PROP_ROOT ) {
$propResult['name'] = $prop;
}
$propResult['properties'] = array();
foreach ( $properties as $name => $p ) {
$propertyResult = array();
$propertyResult['name'] = $name;
if ( !is_array( $p ) ) {
$p = array( ApiBase::PROP_TYPE => $p );
}
$propertyResult['type'] = $p[ApiBase::PROP_TYPE];
if ( is_array( $propertyResult['type'] ) ) {
$propertyResult['type'] = array_values( $propertyResult['type'] );
$result->setIndexedTagName( $propertyResult['type'], 't' );
}
$nullable = null;
if ( isset( $p[ApiBase::PROP_NULLABLE] ) ) {
$nullable = $p[ApiBase::PROP_NULLABLE];
}
if ( $nullable === true ) {
$propertyResult['nullable'] = '';
}
$propResult['properties'][] = $propertyResult;
}
$result->setIndexedTagName( $propResult['properties'], 'property' );
$retval['props'][] = $propResult;
}
// default is true for query modules, false for other modules, overriden by ApiBase::PROP_LIST
if ( $listResult === true || ( $listResult !== false && $obj instanceof ApiQueryBase ) ) {
$retval['listresult'] = '';
}
$result->setIndexedTagName( $retval['props'], 'prop' );
}
// Errors
$retval['errors'] = $this->parseErrors( $obj->getPossibleErrors() );
$result->setIndexedTagName( $retval['errors'], 'error' );

View file

@ -80,6 +80,16 @@ class ApiPatrol extends ApiBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'rcid' => 'integer',
'ns' => 'namespace',
'title' => 'string'
)
);
}
public function getDescription() {
return 'Patrol a page or revision';
}

View file

@ -184,6 +184,16 @@ class ApiProtect extends ApiBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'title' => 'string',
'reason' => 'string',
'cascade' => 'boolean'
)
);
}
public function getDescription() {
return 'Change the protection level of a page';
}

View file

@ -135,6 +135,34 @@ class ApiPurge extends ApiBase {
);
}
public function getResultProperties() {
return array(
ApiBase::PROP_LIST => true,
'' => array(
'ns' => array(
ApiBase::PROP_TYPE => 'namespace',
ApiBase::PROP_NULLABLE => true
),
'title' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'pageid' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
),
'revid' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
),
'invalid' => 'boolean',
'missing' => 'boolean',
'purged' => 'boolean',
'linkupdate' => 'boolean'
)
);
}
public function getDescription() {
return array( 'Purge the cache for the given titles.',
'Requires a POST request if the user is not logged in.'

View file

@ -192,6 +192,23 @@ class ApiQueryAllCategories extends ApiQueryGeneratorBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'*' => 'string'
),
'size' => array(
'size' => 'integer',
'pages' => 'integer',
'files' => 'integer',
'subcats' => 'integer'
),
'hidden' => array(
'hidden' => 'boolean'
)
);
}
public function getDescription() {
return 'Enumerate all categories';
}

View file

@ -230,6 +230,19 @@ class ApiQueryAllImages extends ApiQueryGeneratorBase {
private $propertyFilter = array( 'archivename' );
public function getResultProperties() {
return array_merge(
array(
'' => array(
'name' => 'string',
'ns' => 'namespace',
'title' => 'string'
)
),
ApiQueryImageInfo::getResultPropertiesFiltered( $this->propertyFilter )
);
}
public function getDescription() {
return 'Enumerate all images sequentially';
}

View file

@ -205,6 +205,18 @@ class ApiQueryAllLinks extends ApiQueryGeneratorBase {
);
}
public function getResultProperties() {
return array(
'ids' => array(
'fromid' => 'integer'
),
'title' => array(
'ns' => 'namespace',
'title' => 'string'
)
);
}
public function getDescription() {
return 'Enumerate all links that point to a given namespace';
}

View file

@ -256,6 +256,27 @@ class ApiQueryAllMessages extends ApiQueryBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'name' => 'string',
'customised' => 'boolean',
'missing' => 'boolean',
'*' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
),
'default' => array(
'defaultmissing' => 'boolean',
'default' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
)
);
}
public function getDescription() {
return 'Return messages from this site';
}

View file

@ -296,6 +296,16 @@ class ApiQueryAllPages extends ApiQueryGeneratorBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'pageid' => 'integer',
'ns' => 'namespace',
'title' => 'string'
)
);
}
public function getDescription() {
return 'Enumerate all pages sequentially in a given namespace';
}

View file

@ -377,6 +377,48 @@ class ApiQueryAllUsers extends ApiQueryBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'userid' => 'integer',
'name' => 'string',
'recenteditcount' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
)
),
'blockinfo' => array(
'blockid' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
),
'blockedby' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'blockedbyid' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
),
'blockedreason' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'blockedexpiry' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'hidden' => 'boolean'
),
'editcount' => array(
'editcount' => 'integer'
),
'registration' => array(
'registration' => 'string'
)
);
}
public function getDescription() {
return 'Enumerate all registered users';
}

View file

@ -481,6 +481,17 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase {
) );
}
public function getResultProperties() {
return array(
'' => array(
'pageid' => 'integer',
'ns' => 'namespace',
'title' => 'string',
'redirect' => 'boolean'
)
);
}
public function getDescription() {
switch ( $this->getModuleName() ) {
case 'backlinks':

View file

@ -324,6 +324,60 @@ class ApiQueryBlocks extends ApiQueryBase {
);
}
public function getResultProperties() {
return array(
'id' => array(
'id' => 'integer'
),
'user' => array(
'user' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
),
'userid' => array(
'userid' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
)
),
'by' => array(
'by' => 'string'
),
'byid' => array(
'byid' => 'integer'
),
'timestamp' => array(
'timestamp' => 'timestamp'
),
'expiry' => array(
'expiry' => 'timestamp'
),
'reason' => array(
'reason' => 'string'
),
'range' => array(
'rangestart' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'rangeend' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
),
'flags' => array(
'automatic' => 'boolean',
'anononly' => 'boolean',
'nocreate' => 'boolean',
'autoblock' => 'boolean',
'noemail' => 'boolean',
'hidden' => 'boolean',
'allowusertalk' => 'boolean'
)
);
}
public function getDescription() {
return 'List all blocked users and IP addresses';
}

View file

@ -240,6 +240,25 @@ class ApiQueryCategories extends ApiQueryGeneratorBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'ns' => 'namespace',
'title' => 'string'
),
'sortkey' => array(
'sortkey' => 'string',
'sortkeyprefix' => 'string'
),
'timestamp' => array(
'timestamp' => 'timestamp'
),
'hidden' => array(
'hidden' => 'boolean'
)
);
}
public function getDescription() {
return 'List all categories the page(s) belong to';
}

View file

@ -106,6 +106,34 @@ class ApiQueryCategoryInfo extends ApiQueryBase {
);
}
public function getResultProperties() {
return array(
ApiBase::PROP_LIST => false,
'' => array(
'size' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => false
),
'pages' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => false
),
'files' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => false
),
'subcats' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => false
),
'hidden' => array(
ApiBase::PROP_TYPE => 'boolean',
ApiBase::PROP_NULLABLE => false
)
)
);
}
public function getDescription() {
return 'Returns information about the given categories';
}

View file

@ -364,6 +364,36 @@ class ApiQueryCategoryMembers extends ApiQueryGeneratorBase {
return $desc;
}
public function getResultProperties() {
return array(
'ids' => array(
'pageid' => 'integer'
),
'title' => array(
'ns' => 'namespace',
'title' => 'string'
),
'sortkey' => array(
'sortkey' => 'string'
),
'sortkeyprefix' => array(
'sortkeyprefix' => 'string'
),
'type' => array(
'type' => array(
ApiBase::PROP_TYPE => array(
'page',
'subcat',
'file'
)
)
),
'timestamp' => array(
'timestamp' => 'timestamp'
)
);
}
public function getDescription() {
return 'List all pages in a given category';
}

View file

@ -366,6 +366,18 @@ class ApiQueryDeletedrevs extends ApiQueryBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'ns' => 'namespace',
'title' => 'string'
),
'token' => array(
'token' => 'string'
)
);
}
public function getDescription() {
$p = $this->getModulePrefix();
return array(

View file

@ -165,6 +165,16 @@ class ApiQueryDuplicateFiles extends ApiQueryGeneratorBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'name' => 'string',
'user' => 'string',
'timestamp' => 'timestamp'
)
);
}
public function getDescription() {
return 'List all files that are duplicates of the given file(s)';
}

View file

@ -232,6 +232,21 @@ class ApiQueryExtLinksUsage extends ApiQueryGeneratorBase {
return $desc;
}
public function getResultProperties() {
return array(
'ids' => array(
'pageid' => 'integer'
),
'title' => array(
'ns' => 'namespace',
'title' => 'string'
),
'url' => array(
'url' => 'string'
)
);
}
public function getDescription() {
return 'Enumerate pages that contain a given URL';
}

View file

@ -133,6 +133,14 @@ class ApiQueryExternalLinks extends ApiQueryBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'*' => 'string'
)
);
}
public function getDescription() {
return 'Returns all external urls (not interwikies) from the given page(s)';
}

View file

@ -274,6 +274,67 @@ class ApiQueryFilearchive extends ApiQueryBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'name' => 'string',
'ns' => 'namespace',
'title' => 'string',
'filehidden' => 'boolean',
'commenthidden' => 'boolean',
'userhidden' => 'boolean',
'suppressed' => 'boolean'
),
'sha1' => array(
'sha1' => 'string'
),
'timestamp' => array(
'timestamp' => 'timestamp'
),
'user' => array(
'userid' => 'integer',
'user' => 'string'
),
'size' => array(
'size' => 'integer',
'pagecount' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
),
'height' => 'integer',
'width' => 'integer'
),
'dimensions' => array(
'size' => 'integer',
'pagecount' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
),
'height' => 'integer',
'width' => 'integer'
),
'description' => array(
'description' => 'string'
),
'parseddescription' => array(
'description' => 'string',
'parseddescription' => 'string'
),
'metadata' => array(
'metadata' => 'string'
),
'bitdepth' => array(
'bitdepth' => 'integer'
),
'mime' => array(
'mime' => 'string'
),
'mediatype' => array(
'mediatype' => 'string'
)
);
}
public function getDescription() {
return 'Enumerate all deleted files sequentially';
}

View file

@ -195,6 +195,23 @@ class ApiQueryIWBacklinks extends ApiQueryGeneratorBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'pageid' => 'integer',
'ns' => 'namespace',
'title' => 'string',
'redirect' => 'boolean'
),
'iwprefix' => array(
'iwprefix' => 'string'
),
'iwtitle' => array(
'iwtitle' => 'string'
)
);
}
public function getDescription() {
return array( 'Find all pages that link to the given interwiki link.',
'Can be used to find all links with a prefix, or',

View file

@ -167,6 +167,19 @@ class ApiQueryIWLinks extends ApiQueryBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'prefix' => 'string',
'url' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'*' => 'string'
)
);
}
public function getDescription() {
return 'Returns all interwiki links from the given page(s)';
}

View file

@ -547,6 +547,114 @@ class ApiQueryImageInfo extends ApiQueryBase {
);
}
public static function getResultPropertiesFiltered( $filter = array() ) {
$props = array(
'timestamp' => array(
'timestamp' => 'timestamp'
),
'user' => array(
'userhidden' => 'boolean',
'user' => 'string',
'anon' => 'boolean'
),
'userid' => array(
'userhidden' => 'boolean',
'userid' => 'integer',
'anon' => 'boolean'
),
'size' => array(
'size' => 'integer',
'width' => 'integer',
'height' => 'integer',
'pagecount' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
)
),
'comment' => array(
'commenthidden' => 'boolean',
'comment' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
),
'parsedcomment' => array(
'commenthidden' => 'boolean',
'parsedcomment' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
),
'url' => array(
'filehidden' => 'boolean',
'thumburl' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'thumbwidth' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
),
'thumbheight' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
),
'thumberror' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'url' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'descriptionurl' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
),
'sha1' => array(
'filehidden' => 'boolean',
'sha1' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
),
'mime' => array(
'filehidden' => 'boolean',
'mime' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
),
'mediatype' => array(
'filehidden' => 'boolean',
'mediatype' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
),
'archivename' => array(
'filehidden' => 'boolean',
'archivename' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
),
'bitdepth' => array(
'filehidden' => 'boolean',
'bitdepth' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
)
),
);
return array_diff_key( $props, array_flip( $filter ) );
}
public function getResultProperties() {
return self::getResultPropertiesFiltered();
}
public function getDescription() {
return 'Returns image information and upload history';
}

View file

@ -174,6 +174,15 @@ class ApiQueryImages extends ApiQueryGeneratorBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'ns' => 'namespace',
'title' => 'string'
)
);
}
public function getDescription() {
return 'Returns all images contained on the given page(s)';
}

View file

@ -721,6 +721,59 @@ class ApiQueryInfo extends ApiQueryBase {
);
}
public function getResultProperties() {
$props = array(
ApiBase::PROP_LIST => false,
'' => array(
'touched' => 'timestamp',
'lastrevid' => 'integer',
'counter' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
),
'length' => 'integer',
'redirect' => 'boolean',
'new' => 'boolean',
'starttimestamp' => array(
ApiBase::PROP_TYPE => 'timestamp',
ApiBase::PROP_NULLABLE => true
)
),
'watched' => array(
'watched' => 'boolean'
),
'talkid' => array(
'talkid' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
)
),
'subjectid' => array(
'subjectid' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
)
),
'url' => array(
'fullurl' => 'string',
'editurl' => 'string'
),
'readable' => array(
'readable' => 'boolean'
),
'preload' => array(
'preload' => 'string'
),
'displaytitle' => array(
'displaytitle' => 'string'
)
);
self::addTokenProperties( $props, $this->getTokenFunctions() );
return $props;
}
public function getDescription() {
return 'Get basic page information such as namespace, title, last touched date, ...';
}

View file

@ -195,6 +195,23 @@ class ApiQueryLangBacklinks extends ApiQueryGeneratorBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'pageid' => 'integer',
'ns' => 'namespace',
'title' => 'string',
'redirect' => 'boolean'
),
'lllang' => array(
'lllang' => 'string'
),
'lltitle' => array(
'lltitle' => 'string'
)
);
}
public function getDescription() {
return array( 'Find all pages that link to the given language link.',
'Can be used to find all links with a language code, or',

View file

@ -159,6 +159,19 @@ class ApiQueryLangLinks extends ApiQueryBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'lang' => 'string',
'url' => array(
ApiBase::PROP_TYPE => 'string',
Apibase::PROP_NULLABLE => true
),
'*' => 'string'
)
);
}
public function getDescription() {
return 'Returns all interlanguage links from the given page(s)';
}

View file

@ -227,6 +227,15 @@ class ApiQueryLinks extends ApiQueryGeneratorBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'ns' => 'namespace',
'title' => 'string'
)
);
}
public function getDescription() {
return "Returns all {$this->description}s from the given page(s)";
}

View file

@ -447,6 +447,62 @@ class ApiQueryLogEvents extends ApiQueryBase {
);
}
public function getResultProperties() {
global $wgLogTypes;
return array(
'ids' => array(
'logid' => 'integer',
'pageid' => 'integer'
),
'title' => array(
'ns' => 'namespace',
'title' => 'string'
),
'type' => array(
'type' => array(
ApiBase::PROP_TYPE => $wgLogTypes
),
'action' => 'string'
),
'details' => array(
'actionhidden' => 'boolean'
),
'user' => array(
'userhidden' => 'boolean',
'user' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'anon' => 'boolean'
),
'userid' => array(
'userhidden' => 'boolean',
'userid' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
),
'anon' => 'boolean'
),
'timestamp' => array(
'timestamp' => 'timestamp'
),
'comment' => array(
'commenthidden' => 'boolean',
'comment' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
),
'parsedcomment' => array(
'commenthidden' => 'boolean',
'parsedcomment' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
)
);
}
public function getDescription() {
return 'Get events from logs';
}

View file

@ -214,6 +214,40 @@ class ApiQueryProtectedTitles extends ApiQueryGeneratorBase {
);
}
public function getResultProperties() {
global $wgRestrictionLevels;
return array(
'' => array(
'ns' => 'namespace',
'title' => 'string'
),
'timestamp' => array(
'timestamp' => 'timestamp'
),
'user' => array(
'user' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'userid' => 'integer'
),
'comment' => array(
'comment' => 'string'
),
'parsedcomment' => array(
'parsedcomment' => 'string'
),
'expiry' => array(
'expiry' => 'timestamp'
),
'level' => array(
'level' => array(
ApiBase::PROP_TYPE => array_diff( $wgRestrictionLevels, array( '' ) )
)
)
);
}
public function getDescription() {
return 'List all titles protected from creation';
}

View file

@ -173,6 +173,38 @@ class ApiQueryQueryPage extends ApiQueryGeneratorBase {
);
}
public function getResultProperties() {
return array(
ApiBase::PROP_ROOT => array(
'name' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => false
),
'disabled' => array(
ApiBase::PROP_TYPE => 'boolean',
ApiBase::PROP_NULLABLE => false
),
'cached' => array(
ApiBase::PROP_TYPE => 'boolean',
Apibase::PROP_NULLABLE => false
),
'cachedtimestamp' => array(
ApiBase::PROP_TYPE => 'timestamp',
ApiBase::PROP_NULLABLE => true
)
),
'' => array(
'value' => 'string',
'timestamp' => array(
ApiBase::PROP_TYPE => 'timestamp',
ApiBase::PROP_NULLABLE => true
),
'ns' => 'namespace',
'title' => 'string'
)
);
}
public function getDescription() {
return 'Get a list provided by a QueryPage-based special page';
}

View file

@ -161,6 +161,16 @@ class ApiQueryRandom extends ApiQueryGeneratorBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'id' => 'integer',
'ns' => 'namespace',
'title' => 'string'
)
);
}
public function getDescription() {
return array(
'Get a set of random pages',

View file

@ -629,6 +629,97 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase {
);
}
public function getResultProperties() {
global $wgLogTypes;
$props = array(
'' => array(
'type' => array(
ApiBase::PROP_TYPE => array(
'edit',
'new',
'move',
'log',
'move over redirect'
)
)
),
'title' => array(
'ns' => 'namespace',
'title' => 'string',
'new_ns' => array(
ApiBase::PROP_TYPE => 'namespace',
Apibase::PROP_NULLABLE => true
),
'new_title' => array(
ApiBase::PROP_TYPE => 'string',
Apibase::PROP_NULLABLE => true
)
),
'ids' => array(
'rcid' => 'integer',
'pageid' => 'integer',
'revid' => 'integer',
'old_revid' => 'integer'
),
'user' => array(
'user' => 'string',
'anon' => 'boolean'
),
'userid' => array(
'userid' => 'integer',
'anon' => 'boolean'
),
'flags' => array(
'bot' => 'boolean',
'new' => 'boolean',
'minor' => 'boolean'
),
'sizes' => array(
'oldlen' => 'integer',
'newlen' => 'integer'
),
'timestamp' => array(
'timestamp' => 'timestamp'
),
'comment' => array(
'comment' => array(
ApiBase::PROP_TYPE => 'string',
Apibase::PROP_NULLABLE => true
)
),
'parsedcomment' => array(
'parsedcomment' => array(
ApiBase::PROP_TYPE => 'string',
Apibase::PROP_NULLABLE => true
)
),
'redirect' => array(
'redirect' => 'boolean'
),
'patrolled' => array(
'patrolled' => 'boolean'
),
'loginfo' => array(
'logid' => array(
ApiBase::PROP_TYPE => 'integer',
Apibase::PROP_NULLABLE => true
),
'logtype' => array(
ApiBase::PROP_TYPE => $wgLogTypes,
Apibase::PROP_NULLABLE => true
),
'logaction' => array(
ApiBase::PROP_TYPE => 'string',
Apibase::PROP_NULLABLE => true
)
)
);
self::addTokenProperties( $props, $this->getTokenFunctions() );
return $props;
}
public function getDescription() {
return 'Enumerate recent changes';
}

View file

@ -648,6 +648,66 @@ class ApiQueryRevisions extends ApiQueryBase {
);
}
public function getResultProperties() {
$props = array(
'' => array(),
'ids' => array(
'revid' => 'integer',
'parentid' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
)
),
'flags' => array(
'minor' => 'boolean'
),
'user' => array(
'userhidden' => 'boolean',
'user' => 'string',
'anon' => 'boolean'
),
'userid' => array(
'userhidden' => 'boolean',
'userid' => 'integer',
'anon' => 'boolean'
),
'timestamp' => array(
'timestamp' => 'timestamp'
),
'size' => array(
'size' => 'integer'
),
'sha1' => array(
'sha1' => 'string'
),
'comment' => array(
'commenthidden' => 'boolean',
'comment' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
),
'parsedcomment' => array(
'commenthidden' => 'boolean',
'parsedcomment' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
),
'content' => array(
'*' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'texthidden' => 'boolean'
)
);
self::addTokenProperties( $props, $this->getTokenFunctions() );
return $props;
}
public function getDescription() {
return array(
'Get revision information',

View file

@ -280,6 +280,63 @@ class ApiQuerySearch extends ApiQueryGeneratorBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'ns' => 'namespace',
'title' => 'string'
),
'snippet' => array(
'snippet' => 'string'
),
'size' => array(
'size' => 'integer'
),
'wordcount' => array(
'wordcount' => 'integer'
),
'timestamp' => array(
'timestamp' => 'timestamp'
),
'score' => array(
'score' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
),
'titlesnippet' => array(
'titlesnippet' => 'string'
),
'redirecttitle' => array(
'redirecttitle' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
),
'redirectsnippet' => array(
'redirectsnippet' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
),
'sectiontitle' => array(
'sectiontitle' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
),
'sectionsnippet' => array(
'sectionsnippet' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
),
'hasrelated' => array(
'hasrelated' => 'boolean'
)
);
}
public function getDescription() {
return 'Perform a full text search';
}

View file

@ -123,6 +123,10 @@ class ApiQueryStashImageInfo extends ApiQueryImageInfo {
);
}
public function getResultProperties() {
return ApiQueryImageInfo::getResultPropertiesFiltered( $this->propertyFilter );
}
public function getDescription() {
return 'Returns image information for stashed images';
}

View file

@ -169,6 +169,23 @@ class ApiQueryTags extends ApiQueryBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'name' => 'string'
),
'displayname' => array(
'displayname' => 'string'
),
'description' => array(
'description' => 'string'
),
'hitcount' => array(
'hitcount' => 'integer'
)
);
}
public function getDescription() {
return 'List change tags';
}

View file

@ -448,6 +448,55 @@ class ApiQueryContributions extends ApiQueryBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'userid' => 'integer',
'user' => 'string',
'userhidden' => 'boolean'
),
'ids' => array(
'pageid' => 'integer',
'revid' => 'integer'
),
'title' => array(
'ns' => 'namespace',
'title' => 'string'
),
'timestamp' => array(
'timestamp' => 'timestamp'
),
'flags' => array(
'new' => 'boolean',
'minor' => 'boolean',
'top' => 'boolean'
),
'comment' => array(
'commenthidden' => 'boolean',
'comment' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
),
'parsedcomment' => array(
'commenthidden' => 'boolean',
'parsedcomment' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
),
'patrolled' => array(
'patrolled' => 'boolean'
),
'size' => array(
'size' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
)
)
);
}
public function getDescription() {
return 'Get all edits by a user';
}

View file

@ -234,6 +234,63 @@ class ApiQueryUserInfo extends ApiQueryBase {
);
}
public function getResultProperties() {
return array(
ApiBase::PROP_LIST => false,
'' => array(
'id' => 'integer',
'name' => 'string',
'anon' => 'boolean'
),
'blockinfo' => array(
'blockid' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
),
'blockedby' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'blockedbyid' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
),
'blockedreason' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
),
'hasmsg' => array(
'messages' => 'boolean'
),
'preferencestoken' => array(
'preferencestoken' => 'string'
),
'editcount' => array(
'editcount' => 'integer'
),
'realname' => array(
'realname' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
),
'email' => array(
'email' => 'string',
'emailauthenticated' => array(
ApiBase::PROP_TYPE => 'timestamp',
ApiBase::PROP_NULLABLE => true
)
),
'registrationdate' => array(
'registrationdate' => array(
ApiBase::PROP_TYPE => 'timestamp',
ApiBase::PROP_NULLABLE => true
)
)
);
}
public function getDescription() {
return 'Get information about the current user';
}

View file

@ -315,6 +315,73 @@ class ApiQueryUsers extends ApiQueryBase {
);
}
public function getResultProperties() {
$props = array(
'' => array(
'userid' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
),
'name' => 'string',
'invalid' => 'boolean',
'hidden' => 'boolean',
'interwiki' => 'boolean',
'missing' => 'boolean'
),
'editcount' => array(
'editcount' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
)
),
'registration' => array(
'registration' => array(
ApiBase::PROP_TYPE => 'timestamp',
ApiBase::PROP_NULLABLE => true
)
),
'blockinfo' => array(
'blockid' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
),
'blockedby' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'blockedbyid' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
),
'blockedreason' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'blockedexpiry' => array(
ApiBase::PROP_TYPE => 'timestamp',
ApiBase::PROP_NULLABLE => true
)
),
'emailable' => array(
'emailable' => 'boolean'
),
'gender' => array(
'gender' => array(
ApiBase::PROP_TYPE => array(
'male',
'female',
'unknown'
),
ApiBase::PROP_NULLABLE => true
)
)
);
self::addTokenProperties( $props, $this->getTokenFunctions() );
return $props;
}
public function getDescription() {
return 'Get information about a list of users';
}

View file

@ -418,6 +418,76 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase {
);
}
public function getResultProperties() {
global $wgLogTypes;
return array(
'ids' => array(
'pageid' => 'integer',
'revid' => 'integer',
'old_revid' => 'integer'
),
'title' => array(
'ns' => 'namespace',
'title' => 'string'
),
'user' => array(
'user' => 'string',
'anon' => 'boolean'
),
'userid' => array(
'userid' => 'integer',
'anon' => 'boolean'
),
'flags' => array(
'new' => 'boolean',
'minor' => 'boolean',
'bot' => 'boolean'
),
'patrol' => array(
'patrolled' => 'boolean'
),
'timestamp' => array(
'timestamp' => 'timestamp'
),
'sizes' => array(
'oldlen' => 'integer',
'newlen' => 'integer'
),
'notificationtimestamp' => array(
'notificationtimestamp' => array(
ApiBase::PROP_TYPE => 'timestamp',
ApiBase::PROP_NULLABLE => true
)
),
'comment' => array(
'comment' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
),
'parsedcomment' => array(
'parsedcomment' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
),
'loginfo' => array(
'logid' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
),
'logtype' => array(
ApiBase::PROP_TYPE => $wgLogTypes,
ApiBase::PROP_NULLABLE => true
),
'logaction' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
)
);
}
public function getDescription() {
return "Get all recent changes to pages in the logged in user's watchlist";
}

View file

@ -192,6 +192,21 @@ class ApiQueryWatchlistRaw extends ApiQueryGeneratorBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'ns' => 'namespace',
'title' => 'string'
),
'changed' => array(
'changed' => array(
ApiBase::PROP_TYPE => 'timestamp',
ApiBase::PROP_NULLABLE => true
)
)
);
}
public function getDescription() {
return "Get all pages on the logged in user's watchlist";
}

View file

@ -116,6 +116,19 @@ class ApiRollback extends ApiBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'title' => 'string',
'pageid' => 'integer',
'summary' => 'string',
'revid' => 'integer',
'old_revid' => 'integer',
'last_revid' => 'integer'
)
);
}
public function getDescription() {
return array(
'Undo the last edit to the page. If the last user who edited the page made multiple edits in a row,',

View file

@ -84,6 +84,57 @@ class ApiTokens extends ApiBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'patroltoken' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'edittoken' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'deletetoken' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'protecttoken' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'movetoken' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'blocktoken' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'unblocktoken' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'emailtoken' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'importtoken' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'watchtoken' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'optionstoken' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
)
);
}
public function getParamDescription() {
return array(
'type' => 'Type of token(s) to request'

View file

@ -119,6 +119,33 @@ class ApiUnblock extends ApiBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'unblocktoken' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'id' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
),
'user' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'userid' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
),
'reason' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
)
);
}
public function getDescription() {
return 'Unblock a user';
}

View file

@ -122,6 +122,17 @@ class ApiUndelete extends ApiBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'title' => 'string',
'revisions' => 'integer',
'filerevisions' => 'integer',
'reason' => 'string'
)
);
}
public function getDescription() {
return array(
'Restore certain revisions of a deleted page. A list of deleted revisions (including timestamps) can be',

View file

@ -623,6 +623,41 @@ class ApiUpload extends ApiBase {
}
public function getResultProperties() {
return array(
'' => array(
'result' => array(
ApiBase::PROP_TYPE => array(
'Success',
'Warning',
'Continue',
'Queued'
),
),
'filekey' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'sessionkey' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'offset' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
),
'statuskey' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
),
'filename' => array(
ApiBase::PROP_TYPE => 'string',
ApiBase::PROP_NULLABLE => true
)
)
);
}
public function getDescription() {
return array(
'Upload a file, or get the status of pending uploads. Several methods are available:',

View file

@ -100,6 +100,17 @@ class ApiWatch extends ApiBase {
);
}
public function getResultProperties() {
return array(
'' => array(
'title' => 'string',
'unwatched' => 'boolean',
'watched' => 'boolean',
'message' => 'string'
)
);
}
public function getDescription() {
return 'Add or remove a page from/to the current user\'s watchlist';
}