Add one-off script for patch 7.3 stellar mission name changes
This commit is contained in:
parent
8e89e05756
commit
7b5357c050
2 changed files with 170 additions and 0 deletions
|
|
@ -162,6 +162,40 @@ export class MediaWikiClient {
|
|||
return body;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string} from The page's current name
|
||||
* @param {string} to The page's new name
|
||||
* @param {object} options
|
||||
* @param {string} options.reason Move reason
|
||||
* @param {boolean} options.redirect Whether to create a redirect from the
|
||||
* old name to the new name
|
||||
* @param {boolean} options.moveTalk Whether to move the page's talk page
|
||||
* from the old name to the new name
|
||||
* @param {boolean} options.moveSubpages Whether to move the page's subpages
|
||||
* from the old name to the new name
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
async movePage (from, to, {
|
||||
reason,
|
||||
redirect = true,
|
||||
moveTalk = true,
|
||||
moveSubpages = true,
|
||||
} = {}) {
|
||||
const csrfToken = await this.getCSRFToken();
|
||||
return this.fetchApiPost({
|
||||
action: 'move',
|
||||
from,
|
||||
to,
|
||||
reason,
|
||||
movetalk: moveTalk,
|
||||
movesubpages: moveSubpages,
|
||||
noredirect: !redirect,
|
||||
token: csrfToken,
|
||||
format: 'json',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the list of wiki pages that belong to the given category.
|
||||
* @param {string} name Category name including the `Category:` namespace.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue