wikibase/javascript-api: main (log #1828774)

sourcepatches

This run took 88 seconds.

From 0ea9b1e68fbbdd2c776db4924d8810c1b613f147 Mon Sep 17 00:00:00 2001
From: libraryupgrader <tools.libraryupgrader@tools.wmflabs.org>
Date: Mon, 31 Mar 2025 09:43:54 +0000
Subject: [PATCH] build: Updating eslint-config-wikimedia to 0.29.1

The following rules are failing and were disabled:
* no-jquery/no-done-fail

Change-Id: I98705ea23130da4e9a5fcb42233f9a7bbbe89570
---
 .eslintrc.json                  |  3 +-
 package-lock.json               | 33 +++++++-------
 package.json                    |  2 +-
 src/FormatValueCaller.js        | 10 ++---
 src/ParseValueCaller.js         | 16 +++----
 src/RepoApi.js                  | 32 +++++++-------
 src/RepoApiError.js             | 14 +++---
 src/getLocationAgnosticMwApi.js |  4 +-
 tests/RepoApi.tests.js          | 78 ++++++++++++++++-----------------
 tests/RepoApiError.tests.js     | 20 ++++-----
 10 files changed, 108 insertions(+), 104 deletions(-)

diff --git a/.eslintrc.json b/.eslintrc.json
index 042bd3c..3c0a780 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -18,6 +18,7 @@
 		"jsdoc/newline-after-description": "off",
 		"jsdoc/require-returns": "off",
 		"jsdoc/require-returns-check": "off",
-		"no-jquery/no-extend": "warn"
+		"no-jquery/no-extend": "warn",
+		"no-jquery/no-done-fail": "warn"
 	}
 }
diff --git a/package-lock.json b/package-lock.json
index ccb9fe2..52f9c24 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -13,7 +13,7 @@
 				"wikibase-data-values": "^0.10.0"
 			},
 			"devDependencies": {
-				"eslint-config-wikimedia": "0.28.2",
+				"eslint-config-wikimedia": "0.29.1",
 				"grunt": "1.6.1",
 				"grunt-contrib-qunit": "^5.1.0",
 				"grunt-eslint": "24.3.0",
@@ -1337,9 +1337,9 @@
 			}
 		},
 		"node_modules/eslint-config-wikimedia": {
-			"version": "0.28.2",
-			"resolved": "https://registry.npmjs.org/eslint-config-wikimedia/-/eslint-config-wikimedia-0.28.2.tgz",
-			"integrity": "sha512-5+rdnT7wH1gpKAO6tHYThg78eMhZMruJzvqku3Y5iaEY/A7kSKLFpA/vOj/snys9fKjDHC9BXmArQh+agkOoJQ==",
+			"version": "0.29.1",
+			"resolved": "https://registry.npmjs.org/eslint-config-wikimedia/-/eslint-config-wikimedia-0.29.1.tgz",
+			"integrity": "sha512-4dbL5o3hKGSvreyrGZWLPoTDLFubZ575IQOPhUaTcpbTsi0u05TBEMsOyYkthTaK21vsFQqhSYtxp/xU93BSdA==",
 			"dev": true,
 			"dependencies": {
 				"browserslist-config-wikimedia": "^0.7.0",
@@ -1352,13 +1352,16 @@
 				"eslint-plugin-mediawiki": "^0.7.0",
 				"eslint-plugin-mocha": "^10.4.3",
 				"eslint-plugin-n": "^17.7.0",
-				"eslint-plugin-no-jquery": "^3.0.1",
+				"eslint-plugin-no-jquery": "^3.1.1",
 				"eslint-plugin-qunit": "^8.1.1",
 				"eslint-plugin-security": "^1.7.1",
 				"eslint-plugin-unicorn": "^53.0.0",
 				"eslint-plugin-vue": "^9.26.0",
 				"eslint-plugin-wdio": "^8.24.12",
 				"eslint-plugin-yml": "^1.14.0"
+			},
+			"engines": {
+				"node": ">=18 <23"
 			}
 		},
 		"node_modules/eslint-plugin-compat": {
@@ -1617,9 +1620,9 @@
 			}
 		},
 		"node_modules/eslint-plugin-no-jquery": {
-			"version": "3.0.2",
-			"resolved": "https://registry.npmjs.org/eslint-plugin-no-jquery/-/eslint-plugin-no-jquery-3.0.2.tgz",
-			"integrity": "sha512-n/+6p6PFhWDNPVLJj1463hw4OTIRBbROGcbhmtOHTgw7yihSKzkwZiQ00EJTneyeR3jRiw5lpWSMCCBhtb8t2g==",
+			"version": "3.1.1",
+			"resolved": "https://registry.npmjs.org/eslint-plugin-no-jquery/-/eslint-plugin-no-jquery-3.1.1.tgz",
+			"integrity": "sha512-LTLO3jH/Tjr1pmxCEqtV6qmt+OChv8La4fwgG470JRpgxyFF4NOzoC9CRy92GIWD3Yjl0qLEgPmD2FLQWcNEjg==",
 			"dev": true,
 			"peerDependencies": {
 				"eslint": ">=8.0.0"
@@ -6103,9 +6106,9 @@
 			}
 		},
 		"eslint-config-wikimedia": {
-			"version": "0.28.2",
-			"resolved": "https://registry.npmjs.org/eslint-config-wikimedia/-/eslint-config-wikimedia-0.28.2.tgz",
-			"integrity": "sha512-5+rdnT7wH1gpKAO6tHYThg78eMhZMruJzvqku3Y5iaEY/A7kSKLFpA/vOj/snys9fKjDHC9BXmArQh+agkOoJQ==",
+			"version": "0.29.1",
+			"resolved": "https://registry.npmjs.org/eslint-config-wikimedia/-/eslint-config-wikimedia-0.29.1.tgz",
+			"integrity": "sha512-4dbL5o3hKGSvreyrGZWLPoTDLFubZ575IQOPhUaTcpbTsi0u05TBEMsOyYkthTaK21vsFQqhSYtxp/xU93BSdA==",
 			"dev": true,
 			"requires": {
 				"browserslist-config-wikimedia": "^0.7.0",
@@ -6118,7 +6121,7 @@
 				"eslint-plugin-mediawiki": "^0.7.0",
 				"eslint-plugin-mocha": "^10.4.3",
 				"eslint-plugin-n": "^17.7.0",
-				"eslint-plugin-no-jquery": "^3.0.1",
+				"eslint-plugin-no-jquery": "^3.1.1",
 				"eslint-plugin-qunit": "^8.1.1",
 				"eslint-plugin-security": "^1.7.1",
 				"eslint-plugin-unicorn": "^53.0.0",
@@ -6292,9 +6295,9 @@
 			}
 		},
 		"eslint-plugin-no-jquery": {
-			"version": "3.0.2",
-			"resolved": "https://registry.npmjs.org/eslint-plugin-no-jquery/-/eslint-plugin-no-jquery-3.0.2.tgz",
-			"integrity": "sha512-n/+6p6PFhWDNPVLJj1463hw4OTIRBbROGcbhmtOHTgw7yihSKzkwZiQ00EJTneyeR3jRiw5lpWSMCCBhtb8t2g==",
+			"version": "3.1.1",
+			"resolved": "https://registry.npmjs.org/eslint-plugin-no-jquery/-/eslint-plugin-no-jquery-3.1.1.tgz",
+			"integrity": "sha512-LTLO3jH/Tjr1pmxCEqtV6qmt+OChv8La4fwgG470JRpgxyFF4NOzoC9CRy92GIWD3Yjl0qLEgPmD2FLQWcNEjg==",
 			"dev": true,
 			"requires": {}
 		},
diff --git a/package.json b/package.json
index 96319f0..6366780 100644
--- a/package.json
+++ b/package.json
@@ -28,7 +28,7 @@
 		"wikibase-data-values": "^0.10.0"
 	},
 	"devDependencies": {
-		"eslint-config-wikimedia": "0.28.2",
+		"eslint-config-wikimedia": "0.29.1",
 		"grunt": "1.6.1",
 		"grunt-contrib-qunit": "^5.1.0",
 		"grunt-eslint": "24.3.0",
diff --git a/src/FormatValueCaller.js b/src/FormatValueCaller.js
index c293d09..ade4565 100644
--- a/src/FormatValueCaller.js
+++ b/src/FormatValueCaller.js
@@ -1,7 +1,7 @@
 ( function ( wb ) {
 	'use strict';
 
-	var MODULE = wb.api;
+	const MODULE = wb.api;
 
 	/**
 	 * @class wikibase.api.FormatValueCaller
@@ -14,7 +14,7 @@
 	 * @param {wikibase.api.RepoApi} api
 	 * @param {dataTypes.DataTypeStore} dataTypeStore
 	 */
-	var SELF = MODULE.FormatValueCaller = function WbApiFormatValueCaller( api, dataTypeStore ) {
+	const SELF = MODULE.FormatValueCaller = function WbApiFormatValueCaller( api, dataTypeStore ) {
 		this._api = api;
 		this._dataTypeStore = dataTypeStore;
 	};
@@ -78,7 +78,7 @@
 				}
 			}
 
-			var deferred = $.Deferred();
+			const deferred = $.Deferred();
 
 			this._api.formatValue(
 				{
@@ -89,7 +89,7 @@
 				dataType,
 				outputFormat,
 				propertyId
-			).done( function ( apiResult ) {
+			).done( ( apiResult ) => {
 				if ( apiResult.result ) {
 					deferred.resolve( apiResult.result );
 				} else {
@@ -98,7 +98,7 @@
 						'The formatter API returned an unexpected result'
 					) );
 				}
-			} ).fail( function ( errorCode, error ) {
+			} ).fail( ( errorCode, error ) => {
 				deferred.reject( wb.api.RepoApiError.newFromApiResponse( error ) );
 			} );
 
diff --git a/src/ParseValueCaller.js b/src/ParseValueCaller.js
index 40569a0..a235abf 100644
--- a/src/ParseValueCaller.js
+++ b/src/ParseValueCaller.js
@@ -1,7 +1,7 @@
 ( function ( wb ) {
 	'use strict';
 
-	var MODULE = wb.api;
+	const MODULE = wb.api;
 
 	/**
 	 * Provides functionality to parse a value using the API.
@@ -16,7 +16,7 @@
 	 *
 	 * @param {wikibase.api.RepoApi} api
 	 */
-	var SELF = MODULE.ParseValueCaller = function WbApiParseValueCaller( api ) {
+	const SELF = MODULE.ParseValueCaller = function WbApiParseValueCaller( api ) {
 		this._api = api;
 	};
 
@@ -43,11 +43,11 @@
 		 * @return {wikibase.api.RepoApiError} return.fail.error
 		 */
 		parseValues: function ( parser, values, options ) {
-			var deferred = $.Deferred();
+			const deferred = $.Deferred();
 
 			options = options || {};
 
-			this._api.parseValue( parser, values, options ).done( function ( response ) {
+			this._api.parseValue( parser, values, options ).done( ( response ) => {
 				if ( !response.results ) {
 					deferred.reject( new wb.api.RepoApiError(
 						'result-unexpected',
@@ -56,10 +56,10 @@
 					return;
 				}
 
-				var dataValuesSerializations = [];
+				const dataValuesSerializations = [];
 
-				for ( var i in response.results ) {
-					var result = response.results[ i ];
+				for ( const i in response.results ) {
+					const result = response.results[ i ];
 
 					if ( result.error ) {
 						// This is a really strange error format, and it's not supported by
@@ -88,7 +88,7 @@
 
 				deferred.resolve( dataValuesSerializations );
 
-			} ).fail( function ( errorCode, error ) {
+			} ).fail( ( errorCode, error ) => {
 				deferred.reject( wb.api.RepoApiError.newFromApiResponse( error ) );
 			} );
 
diff --git a/src/RepoApi.js b/src/RepoApi.js
index 3e73aa1..af77d22 100644
--- a/src/RepoApi.js
+++ b/src/RepoApi.js
@@ -1,7 +1,7 @@
 ( function ( wb ) {
 	'use strict';
 
-	var MODULE = wb.api;
+	const MODULE = wb.api;
 
 	/**
 	 * Constructor to create an API object for interaction with the repo Wikibase API.
@@ -28,7 +28,7 @@
 	 *
 	 * @throws {Error} if no `mediaWiki.Api` instance is provided.
 	 */
-	var SELF = MODULE.RepoApi = function WbApiRepoApi( api, uselang, tags ) {
+	const SELF = MODULE.RepoApi = function WbApiRepoApi( api, uselang, tags ) {
 		if ( api === undefined ) {
 			throw new Error( 'mediaWiki.Api instance needs to be provided' );
 		}
@@ -77,7 +77,7 @@
 				throw new Error( 'Parameter not specified properly' );
 			}
 
-			var params = {
+			const params = {
 				action: 'wbeditentity',
 				new: type,
 				data: JSON.stringify( data || {} )
@@ -117,7 +117,7 @@
 				throw new Error( 'Parameter not specified properly' );
 			}
 
-			var params = {
+			const params = {
 				action: 'wbeditentity',
 				id: id,
 				baserevid: baseRevId,
@@ -164,7 +164,7 @@
 				throw new Error( 'Parameter not specified properly' );
 			}
 
-			var params = {
+			const params = {
 				action: 'wbformatvalue',
 				datavalue: JSON.stringify( dataValue )
 			};
@@ -210,7 +210,7 @@
 				throw new Error( 'Parameter not specified properly' );
 			}
 
-			var params = {
+			const params = {
 				action: 'wbgetentities',
 				ids: this.normalizeMultiValue( ids )
 			};
@@ -264,7 +264,7 @@
 				throw new Error( 'sites and titles may not be passed as arrays at the same time' );
 			}
 
-			var params = {
+			const params = {
 				action: 'wbgetentities',
 				sites: this.normalizeMultiValue( sites ),
 				titles: this.normalizeMultiValue( titles ),
@@ -307,7 +307,7 @@
 				throw new Error( 'Parameter not specified properly' );
 			}
 
-			var params = {
+			const params = {
 				action: 'wbparsevalue',
 				parser: parser,
 				values: this.normalizeMultiValue( values )
@@ -343,7 +343,7 @@
 				throw new Error( 'Parameter not specified properly' );
 			}
 
-			var params = {
+			const params = {
 				action: 'wbsetlabel',
 				id: id,
 				value: label,
@@ -385,7 +385,7 @@
 				throw new Error( 'Parameter not specified properly' );
 			}
 
-			var params = {
+			const params = {
 				action: 'wbsetdescription',
 				id: id,
 				value: description,
@@ -430,7 +430,7 @@
 				throw new Error( 'Parameter not specified properly' );
 			}
 
-			var params = {
+			const params = {
 				action: 'wbsetaliases',
 				id: id,
 				add: this.normalizeMultiValue( add ),
@@ -468,7 +468,7 @@
 				throw new Error( 'Parameter not specified properly' );
 			}
 
-			var params = {
+			const params = {
 				action: 'wbsetclaim',
 				claim: JSON.stringify( claim ),
 				baserevid: baseRevId
@@ -508,7 +508,7 @@
 				throw new Error( 'Parameter not specified properly' );
 			}
 
-			var params = {
+			const params = {
 				action: 'wbremoveclaims',
 				claim: claimGuid
 			};
@@ -552,7 +552,7 @@
 				throw new Error( 'Parameter not specified properly' );
 			}
 
-			var params = {
+			const params = {
 				action: 'wbsetsitelink',
 				id: id,
 				linksite: site,
@@ -599,7 +599,7 @@
 				throw new Error( 'Parameter not specified properly' );
 			}
 
-			var params = {
+			const params = {
 				action: 'wbmergeitems',
 				fromid: fromId,
 				toid: toId
@@ -712,7 +712,7 @@
 				params.uselang = this._uselang;
 			}
 
-			Object.keys( params ).forEach( function ( key ) {
+			Object.keys( params ).forEach( ( key ) => {
 				if ( key === undefined || params[ key ] === null ) {
 					throw new Error( 'Parameter "' + key + '" is not specified properly.' );
 				}
diff --git a/src/RepoApiError.js b/src/RepoApiError.js
index a2ee34d..228e5d7 100644
--- a/src/RepoApiError.js
+++ b/src/RepoApiError.js
@@ -1,7 +1,7 @@
 ( function ( wb ) {
 	'use strict';
 
-	var MODULE = wb.api;
+	const MODULE = wb.api;
 
 	/**
 	 * Wikibase Repo API Error.
@@ -20,7 +20,7 @@
 	 * @param {string} [action] Generic API action (e.g. "save" or "cancel") used to determine a
 	 *        specific message.
 	 */
-	var SELF = MODULE.RepoApiError = function WbRepoApiError(
+	const SELF = MODULE.RepoApiError = function WbRepoApiError(
 		code,
 		detailedMessage,
 		parameters,
@@ -68,7 +68,7 @@
 			 * @return {string}
 			 */
 			getMessage: function ( parameters ) {
-				var msgKey = this.API_ERROR_MESSAGE[ this.code ];
+				let msgKey = this.API_ERROR_MESSAGE[ this.code ];
 
 				if ( !msgKey || typeof msgKey !== 'string' ) {
 					if ( msgKey && this.action && msgKey[ this.action ] ) {
@@ -98,7 +98,7 @@
 	 * @return {wikibase.api.RepoApiError}
 	 */
 	SELF.newFromApiResponse = function ( details, apiAction ) {
-		var errorCode = '',
+		let errorCode = '',
 			parameters = [],
 			detailedMessage = '';
 
@@ -116,7 +116,7 @@
 			}
 		} else if ( details.errors ) {
 			// API response, when 'errorformat=plaintext' was requested
-			var preferredError = 0,
+			let preferredError = 0,
 				curError, i;
 
 			// If we have multiple errors, report the nicest formatted one.
@@ -155,8 +155,8 @@
 	function messagesObjectToHtml( messages ) {
 		// Can't use length, it's not an array!
 		if ( messages[ 1 ] && messages[ 1 ].html ) {
-			var html = '<ul>';
-			for ( var i = 0; messages[ i ]; i++ ) {
+			let html = '<ul>';
+			for ( let i = 0; messages[ i ]; i++ ) {
 				html += '<li>' + messages[ i ].html[ '*' ] + '</li>';
 			}
 			return html + '</ul>';
diff --git a/src/getLocationAgnosticMwApi.js b/src/getLocationAgnosticMwApi.js
index 1b1ccda..2520080 100644
--- a/src/getLocationAgnosticMwApi.js
+++ b/src/getLocationAgnosticMwApi.js
@@ -13,7 +13,7 @@
 			url = location.protocol + url;
 		}
 
-		var parser = document.createElement( 'A' );
+		const parser = document.createElement( 'A' );
 		parser.href = url;
 		return parser.host;
 	}
@@ -38,7 +38,7 @@
 			return new mw.ForeignApi( apiEndpoint, options );
 		}
 
-		var mwApiOptions = Object.assign( {}, options, {
+		const mwApiOptions = Object.assign( {}, options, {
 			ajax: {
 				url: apiEndpoint
 			}
diff --git a/tests/RepoApi.tests.js b/tests/RepoApi.tests.js
index e68d212..8da141b 100644
--- a/tests/RepoApi.tests.js
+++ b/tests/RepoApi.tests.js
@@ -23,7 +23,7 @@
  * @return {Object}
  */
 	function mockApi( getOrPost, tags ) {
-		var api = {
+		const api = {
 				postWithToken: function () {},
 				get: function () {}
 			},
@@ -59,8 +59,8 @@
 		return getParams( spy, callIndex || 0 )[ paramName ];
 	}
 
-	QUnit.test( 'createEntity()', function ( assert ) {
-		var mock = mockApi();
+	QUnit.test( 'createEntity()', ( assert ) => {
+		const mock = mockApi();
 
 		mock.api.createEntity( 'item' );
 		mock.api.createEntity( 'property', { 'I am': 'data' } );
@@ -96,8 +96,8 @@
 		assert.strictEqual( getParam( mock.spy, 'tags' ), '\x1fa\x1fb' );
 	} );
 
-	QUnit.test( 'editEntity()', function ( assert ) {
-		var mock = mockApi();
+	QUnit.test( 'editEntity()', ( assert ) => {
+		const mock = mockApi();
 
 		mock.api.editEntity( 'entity id', 12345, { 'I am': 'entity data' }, true );
 
@@ -118,8 +118,8 @@
 		assert.strictEqual( getParam( mock.spy, 'tags' ), '\x1fa\x1fb' );
 	} );
 
-	QUnit.test( 'formatValue()', function ( assert ) {
-		var mock = mockApi( 'get' );
+	QUnit.test( 'formatValue()', ( assert ) => {
+		const mock = mockApi( 'get' );
 
 		mock.api.formatValue(
 			{ 'I am': 'DataValue serialization' },
@@ -183,8 +183,8 @@
 		assert.strictEqual( getParam( mock.spy, 'property', 2 ), 'property id' );
 	} );
 
-	QUnit.test( 'getEntities()', function ( assert ) {
-		var mock = mockApi( 'get' );
+	QUnit.test( 'getEntities()', ( assert ) => {
+		const mock = mockApi( 'get' );
 
 		mock.api.getEntities(
 			[ 'entity id 1', 'entity id 2' ],
@@ -223,8 +223,8 @@
 		assert.strictEqual( getParam( mock.spy, 'languages', 2 ), undefined );
 	} );
 
-	QUnit.test( 'getEntitiesByPage()', function ( assert ) {
-		var mock = mockApi( 'get' );
+	QUnit.test( 'getEntitiesByPage()', ( assert ) => {
+		const mock = mockApi( 'get' );
 
 		mock.api.getEntitiesByPage(
 			[ 'site id 1', 'site id 2' ],
@@ -301,8 +301,8 @@
 		assert.strictEqual( getParam( mock.spy, 'normalize', 5 ), undefined );
 	} );
 
-	QUnit.test( 'parseValue()', function ( assert ) {
-		var mock = mockApi( 'get' );
+	QUnit.test( 'parseValue()', ( assert ) => {
+		const mock = mockApi( 'get' );
 
 		mock.api.parseValue(
 			'parser id',
@@ -335,11 +335,11 @@
 		assert.strictEqual( getParam( mock.spy, 'options', 1 ), undefined );
 	} );
 
-	QUnit.test( 'setLabel(), setDescription()', function ( assert ) {
-		var subjects = [ 'Label', 'Description' ];
+	QUnit.test( 'setLabel(), setDescription()', ( assert ) => {
+		const subjects = [ 'Label', 'Description' ];
 
-		for ( var i = 0; i < subjects.length; i++ ) {
-			var mock = mockApi();
+		for ( let i = 0; i < subjects.length; i++ ) {
+			const mock = mockApi();
 
 			mock.api[ 'set' + subjects[ i ] ]( 'entity id', 12345, 'text', 'language code' );
 
@@ -360,8 +360,8 @@
 		}
 	} );
 
-	QUnit.test( 'setAliases()', function ( assert ) {
-		var mock = mockApi();
+	QUnit.test( 'setAliases()', ( assert ) => {
+		const mock = mockApi();
 
 		mock.api.setAliases(
 			'entity id', 12345, [ 'alias1', 'alias2' ], [ 'alias-remove with p|pe' ], 'language code'
@@ -386,8 +386,8 @@
 		assert.strictEqual( getParam( mock.spy, 'returnto' ), 'currentPage' );
 	} );
 
-	QUnit.test( 'setClaim()', function ( assert ) {
-		var mock = mockApi();
+	QUnit.test( 'setClaim()', ( assert ) => {
+		const mock = mockApi();
 
 		mock.api.setClaim( { 'I am': 'a Claim serialization' }, 12345, 67890 );
 		mock.api.setClaim( { 'I am': 'a Claim serialization' }, 12345 );
@@ -419,8 +419,8 @@
 		assert.strictEqual( getParam( mock.spy, 'index', 1 ), undefined );
 	} );
 
-	QUnit.test( 'removeClaim()', function ( assert ) {
-		var mock = mockApi();
+	QUnit.test( 'removeClaim()', ( assert ) => {
+		const mock = mockApi();
 
 		mock.api.removeClaim( 'claim GUID', 12345 );
 		mock.api.removeClaim( 'claim GUID' );
@@ -444,8 +444,8 @@
 		assert.strictEqual( getParam( mock.spy, 'baserevid', 1 ), undefined );
 	} );
 
-	QUnit.test( 'removeClaim() without tags', function ( assert ) {
-		var mock = mockApi( undefined, [] );
+	QUnit.test( 'removeClaim() without tags', ( assert ) => {
+		const mock = mockApi( undefined, [] );
 
 		mock.api.removeClaim( 'claim GUID', 12345 );
 
@@ -455,8 +455,8 @@
 		assert.strictEqual( getParam( mock.spy, 'tags' ), undefined );
 	} );
 
-	QUnit.test( 'setSitelink()', function ( assert ) {
-		var mock = mockApi();
+	QUnit.test( 'setSitelink()', ( assert ) => {
+		const mock = mockApi();
 
 		mock.api.setSitelink(
 			'entity id', 12345, 'site id', 'page name', [ 'entity id of badge1', 'entity id of badge 2' ]
@@ -491,8 +491,8 @@
 		assert.strictEqual( getParam( mock.spy, 'returnto' ), 'currentPage' );
 	} );
 
-	QUnit.test( 'mergeItems() - no ignoreConflicts', function ( assert ) {
-		var mock = mockApi();
+	QUnit.test( 'mergeItems() - no ignoreConflicts', ( assert ) => {
+		const mock = mockApi();
 
 		mock.api.mergeItems( 'entity id from', 'entity id to' );
 
@@ -514,8 +514,8 @@
 		assert.strictEqual( getParam( mock.spy, 'returnto' ), 'currentPage' );
 	} );
 
-	QUnit.test( 'mergeItems() - single ignoreConflicts', function ( assert ) {
-		var mock = mockApi();
+	QUnit.test( 'mergeItems() - single ignoreConflicts', ( assert ) => {
+		const mock = mockApi();
 
 		mock.api.mergeItems(
 			'entity id from',
@@ -541,8 +541,8 @@
 		assert.strictEqual( getParam( mock.spy, 'summary' ), 'edit summary' );
 	} );
 
-	QUnit.test( 'mergeItems() - multiple ignoreConflicts', function ( assert ) {
-		var mock = mockApi();
+	QUnit.test( 'mergeItems() - multiple ignoreConflicts', ( assert ) => {
+		const mock = mockApi();
 
 		mock.api.mergeItems(
 			'entity id from',
@@ -568,8 +568,8 @@
 		assert.strictEqual( getParam( mock.spy, 'summary' ), 'edit summary' );
 	} );
 
-	QUnit.test( 'normalizeMultiValue()', function ( assert ) {
-		var mock = mockApi();
+	QUnit.test( 'normalizeMultiValue()', ( assert ) => {
+		const mock = mockApi();
 
 		assert.strictEqual( mock.api.normalizeMultiValue( [] ), '', 'empty array -> empty string' );
 		assert.strictEqual(
@@ -579,16 +579,16 @@
 		);
 	} );
 
-	QUnit.test( 'check post asserts user and does not set returnto when logged in ', function ( assert ) {
-		var mock = mockApi();
+	QUnit.test( 'check post asserts user and does not set returnto when logged in ', ( assert ) => {
+		const mock = mockApi();
 		mw._mockUser = 'fooBarUser';
 		mock.api.post( { action: 'foobar' } );
 		assert.strictEqual( getParam( mock.spy, 'assertuser' ), 'fooBarUser' );
 		assert.strictEqual( getParam( mock.spy, 'returnto' ), undefined );
 	} );
 
-	QUnit.test( 'check post does not assert user and does set returnto when not logged in ', function ( assert ) {
-		var mock = mockApi();
+	QUnit.test( 'check post does not assert user and does set returnto when not logged in ', ( assert ) => {
+		const mock = mockApi();
 
 		mock.api.post( { action: 'foobar' } );
 		assert.strictEqual( getParam( mock.spy, 'assertuser' ), undefined );
diff --git a/tests/RepoApiError.tests.js b/tests/RepoApiError.tests.js
index 611e769..f562a53 100644
--- a/tests/RepoApiError.tests.js
+++ b/tests/RepoApiError.tests.js
@@ -11,8 +11,8 @@
 
 	QUnit.module( 'wikibase.api.RepoApiError' );
 
-	QUnit.test( 'Create and validate errors', function ( assert ) {
-		var error = new wb.api.RepoApiError( 'error-code', 'detailed message' );
+	QUnit.test( 'Create and validate errors', ( assert ) => {
+		let error = new wb.api.RepoApiError( 'error-code', 'detailed message' );
 
 		assert.strictEqual(
 			error.code,
@@ -52,8 +52,8 @@
 	} );
 
 	QUnit.test( 'Validate errors created via factory method, requested with unspecified errorformat',
-		function ( assert ) {
-			var error = wb.api.RepoApiError.newFromApiResponse(
+		( assert ) => {
+			let error = wb.api.RepoApiError.newFromApiResponse(
 				{ error: { code: 'error-code', info: 'detailed message' } },
 				'wbaction'
 			);
@@ -131,8 +131,8 @@
 		} );
 
 	QUnit.test( 'Validate parameterised message for API response, requested with unspecified errorformat',
-		function ( assert ) {
-			var expectedMessageKey = 'wikibase-error-ui-no-external-page',
+		( assert ) => {
+			const expectedMessageKey = 'wikibase-error-ui-no-external-page',
 				messageParams = [ 'external-client-parameter', 'page-parameter' ],
 				expectedMessage = 'some formatted error message with parameters',
 				mwMsgMock = sinon.stub( mw, 'msg' ).returns( expectedMessage ),
@@ -160,8 +160,8 @@
 		} );
 
 	QUnit.test( 'Validate errors created via factory method, requested with errorformat=plaintext',
-		function ( assert ) {
-			var error = wb.api.RepoApiError.newFromApiResponse( {
+		( assert ) => {
+			let error = wb.api.RepoApiError.newFromApiResponse( {
 				errors: [ { code: 'error-code', '*': 'detailed message' } ]
 			}
 			);
@@ -250,8 +250,8 @@
 		} );
 
 	QUnit.test( 'Validate parameterised message for API response, requested with `errorformat=plaintext`',
-		function ( assert ) {
-			var expectedMessageKey = 'wikibase-error-ui-no-external-page',
+		( assert ) => {
+			const expectedMessageKey = 'wikibase-error-ui-no-external-page',
 				messageParams = [ 'external-client-parameter', 'page-parameter' ],
 				expectedMessage = 'some formatted error message with parameters',
 				mwMsgMock = sinon.stub( mw, 'msg' ).returns( expectedMessage ),
-- 
2.39.2

$ date
--- stdout ---
Mon Mar 31 09:42:29 UTC 2025

--- end ---
$ git clone file:///srv/git/wikibase-javascript-api.git repo --depth=1 -b master
--- stderr ---
Cloning into 'repo'...
--- stdout ---

--- end ---
$ git config user.name libraryupgrader
--- stdout ---

--- end ---
$ git config user.email tools.libraryupgrader@tools.wmflabs.org
--- stdout ---

--- end ---
$ git submodule update --init
--- stdout ---

--- end ---
$ grr init
--- stdout ---
Installed commit-msg hook.

--- end ---
$ git show-ref refs/heads/master
--- stdout ---
edb3076fea7f56b46f3c57392c18c48404116640 refs/heads/master

--- end ---
$ /usr/bin/npm audit --json
--- stdout ---
{
  "auditReportVersion": 2,
  "vulnerabilities": {
    "phantomjs-prebuilt": {
      "name": "phantomjs-prebuilt",
      "severity": "moderate",
      "isDirect": true,
      "via": [
        "request"
      ],
      "effects": [],
      "range": "*",
      "nodes": [
        "node_modules/phantomjs-prebuilt"
      ],
      "fixAvailable": false
    },
    "request": {
      "name": "request",
      "severity": "moderate",
      "isDirect": false,
      "via": [
        {
          "source": 1096727,
          "name": "request",
          "dependency": "request",
          "title": "Server-Side Request Forgery in Request",
          "url": "https://github.com/advisories/GHSA-p8p7-x288-28g6",
          "severity": "moderate",
          "cwe": [
            "CWE-918"
          ],
          "cvss": {
            "score": 6.1,
            "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
          },
          "range": "<=2.88.2"
        },
        "tough-cookie"
      ],
      "effects": [
        "phantomjs-prebuilt"
      ],
      "range": "*",
      "nodes": [
        "node_modules/request"
      ],
      "fixAvailable": false
    },
    "tough-cookie": {
      "name": "tough-cookie",
      "severity": "moderate",
      "isDirect": false,
      "via": [
        {
          "source": 1097682,
          "name": "tough-cookie",
          "dependency": "tough-cookie",
          "title": "tough-cookie Prototype Pollution vulnerability",
          "url": "https://github.com/advisories/GHSA-72xf-g2v4-qvf3",
          "severity": "moderate",
          "cwe": [
            "CWE-1321"
          ],
          "cvss": {
            "score": 6.5,
            "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N"
          },
          "range": "<4.1.3"
        }
      ],
      "effects": [
        "request"
      ],
      "range": "<4.1.3",
      "nodes": [
        "node_modules/tough-cookie"
      ],
      "fixAvailable": false
    }
  },
  "metadata": {
    "vulnerabilities": {
      "info": 0,
      "low": 0,
      "moderate": 3,
      "high": 0,
      "critical": 0,
      "total": 3
    },
    "dependencies": {
      "prod": 3,
      "dev": 440,
      "optional": 2,
      "peer": 1,
      "peerOptional": 0,
      "total": 442
    }
  }
}

--- end ---
Upgrading n:eslint-config-wikimedia from 0.28.2 -> 0.29.1
$ /usr/bin/npm install
--- stderr ---
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated phantomjs-prebuilt@2.1.16: this package is now deprecated
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated puppeteer@5.5.0: Version no longer supported. Upgrade to @latest
--- stdout ---

added 442 packages, and audited 443 packages in 15s

67 packages are looking for funding
  run `npm fund` for details

3 moderate severity vulnerabilities

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.

--- end ---
$ package-lock-lint package-lock.json
--- stdout ---
Checking package-lock.json

--- end ---
$ /usr/bin/npm install grunt-eslint@24.3.0 --save-exact
--- stdout ---

up to date, audited 443 packages in 926ms

67 packages are looking for funding
  run `npm fund` for details

3 moderate severity vulnerabilities

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.

--- end ---
$ package-lock-lint package-lock.json
--- stdout ---
Checking package-lock.json

--- end ---
$ ./node_modules/.bin/eslint tests/RepoApi.tests.js tests/RepoApiError.tests.js src/RepoApiError.js package.json package-lock.json src/RepoApi.js src/namespace.js tests/mediaWiki.mock.js Gruntfile.js src/ParseValueCaller.js src/FormatValueCaller.js src/getLocationAgnosticMwApi.js composer.json --fix
--- stdout ---

/src/repo/src/FormatValueCaller.js
  15:1  warning  The type 'dataTypes' is undefined   jsdoc/no-undefined-types
  31:1  warning  The type 'dataTypes' is undefined   jsdoc/no-undefined-types
  41:1  warning  The type 'dataValues' is undefined  jsdoc/no-undefined-types
  83:4  error    Prefer .then to .done               no-jquery/no-done-fail
  83:4  error    Prefer .then to .fail               no-jquery/no-done-fail

/src/repo/src/ParseValueCaller.js
  50:4  error  Prefer .then to .done  no-jquery/no-done-fail
  50:4  error  Prefer .then to .fail  no-jquery/no-done-fail

/src/repo/src/RepoApi.js
   25:1  warning  The type 'mediaWiki' is undefined  jsdoc/no-undefined-types
   43:1  warning  The type 'mediaWiki' is undefined  jsdoc/no-undefined-types
   68:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  103:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  149:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  197:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  245:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  294:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  329:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  371:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  415:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  459:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  496:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  538:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  584:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  649:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  681:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types

/src/repo/src/getLocationAgnosticMwApi.js
  33:1  warning  The type 'mediaWiki' is undefined  jsdoc/no-undefined-types

/src/repo/tests/RepoApi.tests.js
  2:1  warning  Missing JSDoc @param "wb" type     jsdoc/require-param-type
  3:1  warning  Missing JSDoc @param "QUnit" type  jsdoc/require-param-type
  4:1  warning  Missing JSDoc @param "sinon" type  jsdoc/require-param-type

/src/repo/tests/RepoApiError.tests.js
  2:1  warning  Missing JSDoc @param "wb" type     jsdoc/require-param-type
  3:1  warning  Missing JSDoc @param "QUnit" type  jsdoc/require-param-type
  4:1  warning  Missing JSDoc @param "sinon" type  jsdoc/require-param-type

✖ 31 problems (4 errors, 27 warnings)


--- end ---
$ ./node_modules/.bin/eslint tests/RepoApi.tests.js tests/RepoApiError.tests.js src/RepoApiError.js package.json package-lock.json src/RepoApi.js src/namespace.js tests/mediaWiki.mock.js Gruntfile.js src/ParseValueCaller.js src/FormatValueCaller.js src/getLocationAgnosticMwApi.js composer.json -f json
--- stdout ---
[{"filePath":"/src/repo/Gruntfile.js","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-spacing","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"indent","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multi-spaces","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"spaced-comment","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"wrap-iife","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/composer.json","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[{"ruleId":"indent","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"no-extra-parens","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-spacing","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multi-spaces","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"spaced-comment","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"wrap-iife","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/package-lock.json","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[{"ruleId":"indent","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"no-extra-parens","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-spacing","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multi-spaces","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"spaced-comment","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"wrap-iife","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/package.json","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[{"ruleId":"indent","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"no-extra-parens","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-spacing","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multi-spaces","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"spaced-comment","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"wrap-iife","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/src/FormatValueCaller.js","messages":[{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'dataTypes' is undefined.","line":15,"column":1,"nodeType":"Block","endLine":15,"endColumn":1},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'dataTypes' is undefined.","line":31,"column":1,"nodeType":"Block","endLine":31,"endColumn":1},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'dataValues' is undefined.","line":41,"column":1,"nodeType":"Block","endLine":41,"endColumn":1},{"ruleId":"no-jquery/no-done-fail","severity":2,"message":"Prefer .then to .done","line":83,"column":4,"nodeType":"CallExpression","endLine":101,"endColumn":7},{"ruleId":"no-jquery/no-done-fail","severity":2,"message":"Prefer .then to .fail","line":83,"column":4,"nodeType":"CallExpression","endLine":103,"endColumn":7}],"suppressedMessages":[],"errorCount":2,"fatalErrorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"( function ( wb ) {\n\t'use strict';\n\n\tconst MODULE = wb.api;\n\n\t/**\n\t * @class wikibase.api.FormatValueCaller\n\t * @since 1.0\n\t * @license GPL-2.0+\n\t * @author H. Snater < mediawiki@snater.com >\n\t *\n\t * @constructor\n\t *\n\t * @param {wikibase.api.RepoApi} api\n\t * @param {dataTypes.DataTypeStore} dataTypeStore\n\t */\n\tconst SELF = MODULE.FormatValueCaller = function WbApiFormatValueCaller( api, dataTypeStore ) {\n\t\tthis._api = api;\n\t\tthis._dataTypeStore = dataTypeStore;\n\t};\n\n\tObject.assign( SELF.prototype, {\n\n\t\t/**\n\t\t * @property {wikibase.api.RepoApi}\n\t\t * @private\n\t\t */\n\t\t_api: null,\n\n\t\t/**\n\t\t * @property {dataTypes.DataTypeStore}\n\t\t * @private\n\t\t */\n\t\t_dataTypeStore: null,\n\n\t\t/**\n\t\t * Makes a request to the API to format values on the server side. Will return a\n\t\t * `jQuery.Promise` which will be resolved if formatting is successful or rejected if it\n\t\t * fails or the API cannot be reached.\n\t\t *\n\t\t * @param {dataValues.DataValue} dataValue\n\t\t * @param {string|Object} [dataType] `DataType` id.\n\t\t *        Assumed to be `outputFormat` if the `dataTypeStore` the `FormatValueCaller` has\n\t\t *        been initialized with, does not contain a data type whose id matches the string\n\t\t *        supplied via this argument.\n\t\t *        Assumed to be `options` if {Object} and no additional arguments are provided.\n\t\t * @param {string|Object} [outputFormat]\n\t\t *        Assumed to be `options` if {Object} and no additional arguments are provided.\n\t\t * @param {string|Object} [propertyId]\n\t\t *        Assumed to be `options` if {Object} and no additional arguments are provided.\n\t\t * @param {Object} [options]\n\t\t * @return {Object} jQuery.Promise\n\t\t * @return {Function} return.done\n\t\t * @return {string} return.done.formattedValue Formatted `DataValue`.\n\t\t * @return {Function} return.fail\n\t\t * @return {wikibase.api.RepoApiError} error\n\t\t */\n\t\tformatValue: function ( dataValue, dataType, outputFormat, propertyId, options ) {\n\n\t\t\t// Evaluate optional arguments:\n\t\t\tif ( outputFormat === undefined ) {\n\t\t\t\tif ( $.isPlainObject( dataType ) ) {\n\t\t\t\t\toptions = dataType;\n\t\t\t\t\tdataType = undefined;\n\t\t\t\t} else if ( !this._dataTypeStore.hasDataType( dataType ) ) {\n\t\t\t\t\toutputFormat = dataType;\n\t\t\t\t\tdataType = undefined;\n\t\t\t\t}\n\t\t\t} else if ( propertyId === undefined ) {\n\t\t\t\tif ( $.isPlainObject( outputFormat ) ) {\n\t\t\t\t\toptions = outputFormat;\n\t\t\t\t\toutputFormat = undefined;\n\t\t\t\t}\n\t\t\t} else if ( options === undefined ) {\n\t\t\t\tif ( $.isPlainObject( propertyId ) ) {\n\t\t\t\t\toptions = propertyId;\n\t\t\t\t\tpropertyId = undefined;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst deferred = $.Deferred();\n\n\t\t\tthis._api.formatValue(\n\t\t\t\t{\n\t\t\t\t\tvalue: dataValue.toJSON(),\n\t\t\t\t\ttype: dataValue.getType()\n\t\t\t\t},\n\t\t\t\toptions,\n\t\t\t\tdataType,\n\t\t\t\toutputFormat,\n\t\t\t\tpropertyId\n\t\t\t).done( ( apiResult ) => {\n\t\t\t\tif ( apiResult.result ) {\n\t\t\t\t\tdeferred.resolve( apiResult.result );\n\t\t\t\t} else {\n\t\t\t\t\tdeferred.reject( new wb.api.RepoApiError(\n\t\t\t\t\t\t'unexpected-result',\n\t\t\t\t\t\t'The formatter API returned an unexpected result'\n\t\t\t\t\t) );\n\t\t\t\t}\n\t\t\t} ).fail( ( errorCode, error ) => {\n\t\t\t\tdeferred.reject( wb.api.RepoApiError.newFromApiResponse( error ) );\n\t\t\t} );\n\n\t\t\treturn deferred.promise();\n\t\t}\n\n\t} );\n\n}( wikibase ) );\n","usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-spacing","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"indent","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multi-spaces","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"spaced-comment","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"wrap-iife","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/src/ParseValueCaller.js","messages":[{"ruleId":"no-jquery/no-done-fail","severity":2,"message":"Prefer .then to .done","line":50,"column":4,"nodeType":"CallExpression","endLine":91,"endColumn":7},{"ruleId":"no-jquery/no-done-fail","severity":2,"message":"Prefer .then to .fail","line":50,"column":4,"nodeType":"CallExpression","endLine":93,"endColumn":7}],"suppressedMessages":[],"errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"( function ( wb ) {\n\t'use strict';\n\n\tconst MODULE = wb.api;\n\n\t/**\n\t * Provides functionality to parse a value using the API.\n\t *\n\t * @class wikibase.api.ParseValueCaller\n\t * @since 1.0\n\t * @license GPL-2.0+\n\t * @author Jeroen De Dauw < jeroendedauw@gmail.com >\n\t * @author H. Snater < mediawiki@snater.com >\n\t *\n\t * @constructor\n\t *\n\t * @param {wikibase.api.RepoApi} api\n\t */\n\tconst SELF = MODULE.ParseValueCaller = function WbApiParseValueCaller( api ) {\n\t\tthis._api = api;\n\t};\n\n\tObject.assign( SELF.prototype, {\n\n\t\t/**\n\t\t * @property {wikibase.api.RepoApi}\n\t\t * @private\n\t\t */\n\t\t_api: null,\n\n\t\t/**\n\t\t * Makes a request to the API to parse values on the server side. Will return a jQuery.Promise\n\t\t * which will be resolved if the call is successful or rejected if the API fails or can't be\n\t\t * reached.\n\t\t *\n\t\t * @param {string} parser Parser id.\n\t\t * @param {string[]} values `DataValue` serializations.\n\t\t * @param {Object} [options={}]\n\t\t * @return {Object} jQuery.Promise\n\t\t * @return {Function} return.done\n\t\t * @return {Object[]} return.done.serializations `DataValue` serializations.\n\t\t * @return {Function} return.fail\n\t\t * @return {wikibase.api.RepoApiError} return.fail.error\n\t\t */\n\t\tparseValues: function ( parser, values, options ) {\n\t\t\tconst deferred = $.Deferred();\n\n\t\t\toptions = options || {};\n\n\t\t\tthis._api.parseValue( parser, values, options ).done( ( response ) => {\n\t\t\t\tif ( !response.results ) {\n\t\t\t\t\tdeferred.reject( new wb.api.RepoApiError(\n\t\t\t\t\t\t'result-unexpected',\n\t\t\t\t\t\t'The parse API returned an unexpected result'\n\t\t\t\t\t) );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst dataValuesSerializations = [];\n\n\t\t\t\tfor ( const i in response.results ) {\n\t\t\t\t\tconst result = response.results[ i ];\n\n\t\t\t\t\tif ( result.error ) {\n\t\t\t\t\t\t// This is a really strange error format, and it's not supported by\n\t\t\t\t\t\t// wikibase.api.RepoApiError.newFromApiResponse, so we have to parse it manually\n\t\t\t\t\t\t// here. See bug 72947.\n\t\t\t\t\t\tdeferred.reject( new wb.api.RepoApiError(\n\t\t\t\t\t\t\tresult.messages[ 0 ].name,\n\t\t\t\t\t\t\tresult.messages[ 0 ].html[ '*' ]\n\t\t\t\t\t\t) );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !( result.value && result.type ) ) {\n\t\t\t\t\t\tdeferred.reject( new wb.api.RepoApiError(\n\t\t\t\t\t\t\t'result-unexpected',\n\t\t\t\t\t\t\t'Unknown API error'\n\t\t\t\t\t\t) );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tdataValuesSerializations.push( {\n\t\t\t\t\t\ttype: result.type,\n\t\t\t\t\t\tvalue: result.value\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\tdeferred.resolve( dataValuesSerializations );\n\n\t\t\t} ).fail( ( errorCode, error ) => {\n\t\t\t\tdeferred.reject( wb.api.RepoApiError.newFromApiResponse( error ) );\n\t\t\t} );\n\n\t\t\treturn deferred.promise();\n\t\t}\n\t} );\n\n}( wikibase ) );\n","usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-spacing","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"indent","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multi-spaces","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"spaced-comment","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"wrap-iife","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/src/RepoApi.js","messages":[{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'mediaWiki' is undefined.","line":25,"column":1,"nodeType":"Block","endLine":25,"endColumn":1},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'mediaWiki' is undefined.","line":43,"column":1,"nodeType":"Block","endLine":43,"endColumn":1},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'jqXHR' is undefined.","line":68,"column":1,"nodeType":"Block","endLine":68,"endColumn":1},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'jqXHR' is undefined.","line":103,"column":1,"nodeType":"Block","endLine":103,"endColumn":1},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'jqXHR' is undefined.","line":149,"column":1,"nodeType":"Block","endLine":149,"endColumn":1},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'jqXHR' is undefined.","line":197,"column":1,"nodeType":"Block","endLine":197,"endColumn":1},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'jqXHR' is undefined.","line":245,"column":1,"nodeType":"Block","endLine":245,"endColumn":1},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'jqXHR' is undefined.","line":294,"column":1,"nodeType":"Block","endLine":294,"endColumn":1},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'jqXHR' is undefined.","line":329,"column":1,"nodeType":"Block","endLine":329,"endColumn":1},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'jqXHR' is undefined.","line":371,"column":1,"nodeType":"Block","endLine":371,"endColumn":1},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'jqXHR' is undefined.","line":415,"column":1,"nodeType":"Block","endLine":415,"endColumn":1},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'jqXHR' is undefined.","line":459,"column":1,"nodeType":"Block","endLine":459,"endColumn":1},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'jqXHR' is undefined.","line":496,"column":1,"nodeType":"Block","endLine":496,"endColumn":1},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'jqXHR' is undefined.","line":538,"column":1,"nodeType":"Block","endLine":538,"endColumn":1},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'jqXHR' is undefined.","line":584,"column":1,"nodeType":"Block","endLine":584,"endColumn":1},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'jqXHR' is undefined.","line":649,"column":1,"nodeType":"Block","endLine":649,"endColumn":1},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'jqXHR' is undefined.","line":681,"column":1,"nodeType":"Block","endLine":681,"endColumn":1}],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":17,"fixableErrorCount":0,"fixableWarningCount":0,"source":"( function ( wb ) {\n\t'use strict';\n\n\tconst MODULE = wb.api;\n\n\t/**\n\t * Constructor to create an API object for interaction with the repo Wikibase API.\n\t * Functions of `wikibase.api.RepoApi` act on serializations. Before passing native\n\t * `wikibase.datamodel` objects to a function, such objects need to be serialized, just like return\n\t * values of `wikibase.api.RepoApi` may be used to construct `wikibase.datamodel` objects.\n\t *\n\t * @see wikibase.datamodel\n\t * @see wikibase.serialization\n\t *\n\t * @class wikibase.api.RepoApi\n\t * @since 1.0\n\t * @license GPL-2.0+\n\t * @author Daniel Werner < daniel.a.r.werner@gmail.com >\n\t * @author Tobias Gritschacher\n\t * @author H. Snater < mediawiki@snater.com >\n\t * @author Marius Hoch < hoo@online.de >\n\t *\n\t * @constructor\n\t *\n\t * @param {mediaWiki.Api} api\n\t * @param {string|null} uselang\n\t * @param {string[]} [tags] Change tags to add to edits made through this instance.\n\t *\n\t * @throws {Error} if no `mediaWiki.Api` instance is provided.\n\t */\n\tconst SELF = MODULE.RepoApi = function WbApiRepoApi( api, uselang, tags ) {\n\t\tif ( api === undefined ) {\n\t\t\tthrow new Error( 'mediaWiki.Api instance needs to be provided' );\n\t\t}\n\n\t\tthis._api = api;\n\t\tthis._uselang = uselang;\n\t\tthis._tags = tags || [];\n\t};\n\n\tObject.assign( SELF.prototype, {\n\t\t/**\n\t\t * @property {mediaWiki.Api}\n\t\t * @private\n\t\t */\n\t\t_api: null,\n\n\t\t/**\n\t\t * @property {string|null}\n\t\t * @private\n\t\t */\n\t\t_uselang: null,\n\n\t\t/**\n\t\t * @property {string[]}\n\t\t * @private\n\t\t */\n\t\t_tags: null,\n\n\t\t/**\n\t\t * Creates a new entity with the given type and data.\n\t\t *\n\t\t * @param {string} type The type of the `Entity` that should be created.\n\t\t * @param {Object} [data={}] The `Entity` data (may be omitted to create an empty `Entity`).\n\t\t * @return {Object} jQuery.Promise\n\t\t * @return {Function} return.done\n\t\t * @return {*} return.done.result\n\t\t * @return {jqXHR} return.done.jqXHR\n\t\t * @return {Function} return.fail\n\t\t * @return {string} return.fail.code\n\t\t * @return {*} return.fail.error\n\t\t *\n\t\t * @throws {Error} if a parameter is not specified properly.\n\t\t */\n\t\tcreateEntity: function ( type, data ) {\n\t\t\tif ( typeof type !== 'string' || data && typeof data !== 'object' ) {\n\t\t\t\tthrow new Error( 'Parameter not specified properly' );\n\t\t\t}\n\n\t\t\tconst params = {\n\t\t\t\taction: 'wbeditentity',\n\t\t\t\tnew: type,\n\t\t\t\tdata: JSON.stringify( data || {} )\n\t\t\t};\n\n\t\t\tif ( this._tags.length ) {\n\t\t\t\tparams.tags = this.normalizeMultiValue( this._tags );\n\t\t\t}\n\n\t\t\treturn this.post( params );\n\t\t},\n\n\t\t/**\n\t\t * Edits an `Entity`.\n\t\t *\n\t\t * @param {string} id `Entity` id.\n\t\t * @param {number} baseRevId Revision id the edit shall be performed on.\n\t\t * @param {Object} data The `Entity`'s structure.\n\t\t * @param {boolean} [clear] Whether to clear whole entity before editing.\n\t\t * @return {Object} jQuery.Promise\n\t\t * @return {Function} return.done\n\t\t * @return {*} return.done.result\n\t\t * @return {jqXHR} return.done.jqXHR\n\t\t * @return {Function} return.fail\n\t\t * @return {string} return.fail.code\n\t\t * @return {*} return.fail.error\n\t\t *\n\t\t * @throws {Error} if a parameter is not specified properly.\n\t\t */\n\t\teditEntity: function ( id, baseRevId, data, clear ) {\n\t\t\tif (\n\t\t\t\ttypeof id !== 'string'\n\t\t\t\t|| typeof baseRevId !== 'number'\n\t\t\t\t|| typeof data !== 'object'\n\t\t\t\t|| clear && typeof clear !== 'boolean'\n\t\t\t) {\n\t\t\t\tthrow new Error( 'Parameter not specified properly' );\n\t\t\t}\n\n\t\t\tconst params = {\n\t\t\t\taction: 'wbeditentity',\n\t\t\t\tid: id,\n\t\t\t\tbaserevid: baseRevId,\n\t\t\t\tdata: JSON.stringify( data )\n\t\t\t};\n\n\t\t\tif ( clear ) {\n\t\t\t\tparams.clear = clear;\n\t\t\t}\n\n\t\t\tif ( this._tags.length ) {\n\t\t\t\tparams.tags = this.normalizeMultiValue( this._tags );\n\t\t\t}\n\n\t\t\treturn this.post( params );\n\t\t},\n\n\t\t/**\n\t\t * Formats values (`dataValues.DataValue`s).\n\t\t *\n\t\t * @param {Object} dataValue `DataValue` serialization.\n\t\t * @param {Object} [options]\n\t\t * @param {string} [dataType] `dataTypes.DataType` id.\n\t\t * @param {string} [outputFormat]\n\t\t * @param {string} [propertyId] replaces `dataType`\n\t\t * @return {Object} jQuery.Promise\n\t\t * @return {Function} return.done\n\t\t * @return {*} return.done.result\n\t\t * @return {jqXHR} return.done.jqXHR\n\t\t * @return {Function} return.fail\n\t\t * @return {string} return.fail.code\n\t\t * @return {*} return.fail.error\n\t\t *\n\t\t * @throws {Error} if a parameter is not specified properly.\n\t\t */\n\t\tformatValue: function ( dataValue, options, dataType, outputFormat, propertyId ) {\n\t\t\tif (\n\t\t\t\ttypeof dataValue !== 'object'\n\t\t\t\t|| options && typeof options !== 'object'\n\t\t\t\t|| dataType && typeof dataType !== 'string'\n\t\t\t\t|| outputFormat && typeof outputFormat !== 'string'\n\t\t\t\t|| propertyId && typeof propertyId !== 'string'\n\t\t\t) {\n\t\t\t\tthrow new Error( 'Parameter not specified properly' );\n\t\t\t}\n\n\t\t\tconst params = {\n\t\t\t\taction: 'wbformatvalue',\n\t\t\t\tdatavalue: JSON.stringify( dataValue )\n\t\t\t};\n\n\t\t\tif ( outputFormat ) {\n\t\t\t\tparams.generate = outputFormat;\n\t\t\t}\n\n\t\t\tif ( propertyId ) {\n\t\t\t\tparams.property = propertyId;\n\t\t\t} else if ( dataType ) {\n\t\t\t\tparams.datatype = dataType;\n\t\t\t}\n\n\t\t\treturn this.get( params, options );\n\t\t},\n\n\t\t/**\n\t\t * Gets one or more `Entity`s.\n\t\t *\n\t\t * @param {string|string[]} ids `Entity` id(s).\n\t\t * @param {string|string[]|null} [props] Key(s) of property/ies to retrieve from the API.\n\t\t *        Omitting/`null` will return all properties.\n\t\t * @param {string|string[]|null} [languages] Language code(s) of the languages the\n\t\t *        property/ies values should be retrieved in. Omitting/`null` returns values in all\n\t\t *        languages.\n\t\t * @return {Object} jQuery.Promise\n\t\t * @return {Function} return.done\n\t\t * @return {*} return.done.result\n\t\t * @return {jqXHR} return.done.jqXHR\n\t\t * @return {Function} return.fail\n\t\t * @return {string} return.fail.code\n\t\t * @return {*} return.fail.error\n\t\t *\n\t\t * @throws {Error} if a parameter is not specified properly.\n\t\t */\n\t\tgetEntities: function ( ids, props, languages ) {\n\t\t\tif (\n\t\t\t\t( typeof ids !== 'string' && !Array.isArray( ids ) )\n\t\t\t\t|| props && ( typeof props !== 'string' && !Array.isArray( props ) )\n\t\t\t\t|| languages && ( typeof languages !== 'string' && !Array.isArray( languages ) )\n\t\t\t) {\n\t\t\t\tthrow new Error( 'Parameter not specified properly' );\n\t\t\t}\n\n\t\t\tconst params = {\n\t\t\t\taction: 'wbgetentities',\n\t\t\t\tids: this.normalizeMultiValue( ids )\n\t\t\t};\n\n\t\t\tif ( props ) {\n\t\t\t\tparams.props = this.normalizeMultiValue( props );\n\t\t\t}\n\n\t\t\tif ( languages ) {\n\t\t\t\tparams.languages = this.normalizeMultiValue( languages );\n\t\t\t}\n\n\t\t\treturn this.get( params );\n\t\t},\n\n\t\t/**\n\t\t * Gets an `Entity` which is linked with on or more specific sites/pages.\n\t\t *\n\t\t * @param {string|string[]} sites `Site`(s). May be used with `titles`. May not be a list when\n\t\t *        `titles` is a list.\n\t\t * @param {string|string[]} titles Linked page(s). May be used with `sites`. May not be a list\n\t\t *        when `sites` is a list.\n\t\t * @param {string|string[]|null} [props] Key(s) of property/ies to retrieve from the API.\n\t\t *        Omitting/`null` returns all properties.\n\t\t * @param {string|string[]|null} [languages] Language code(s) of the languages the\n\t\t *        property/ies values should be retrieved in. Omitting/`null` returns values in all\n\t\t *        languages.\n\t\t * @param {boolean} [normalize] Whether to normalize titles server side\n\t\t * @return {Object} jQuery.Promise\n\t\t * @return {Function} return.done\n\t\t * @return {*} return.done.result\n\t\t * @return {jqXHR} return.done.jqXHR\n\t\t * @return {Function} return.fail\n\t\t * @return {string} return.fail.code\n\t\t * @return {*} return.fail.error\n\t\t *\n\t\t * @throws {Error} if a parameter is not specified properly.\n\t\t * @throws {Error} if both, `sites` and `titles`, are passed as `array`s.\n\t\t */\n\t\tgetEntitiesByPage: function ( sites, titles, props, languages, normalize ) {\n\t\t\tif (\n\t\t\t\t( typeof sites !== 'string' && !Array.isArray( sites ) )\n\t\t\t\t|| ( typeof titles !== 'string' && !Array.isArray( titles ) )\n\t\t\t\t|| props && ( typeof props !== 'string' && !Array.isArray( props ) )\n\t\t\t\t|| languages && ( typeof languages !== 'string' && !Array.isArray( languages ) )\n\t\t\t) {\n\t\t\t\tthrow new Error( 'Parameter not specified properly' );\n\t\t\t}\n\n\t\t\tif ( Array.isArray( sites ) && Array.isArray( titles ) ) {\n\t\t\t\tthrow new Error( 'sites and titles may not be passed as arrays at the same time' );\n\t\t\t}\n\n\t\t\tconst params = {\n\t\t\t\taction: 'wbgetentities',\n\t\t\t\tsites: this.normalizeMultiValue( sites ),\n\t\t\t\ttitles: this.normalizeMultiValue( titles ),\n\t\t\t\tnormalize: typeof normalize === 'boolean' ? normalize : undefined\n\t\t\t};\n\n\t\t\tif ( props ) {\n\t\t\t\tparams.props = this.normalizeMultiValue( props );\n\t\t\t}\n\n\t\t\tif ( languages ) {\n\t\t\t\tparams.languages = this.normalizeMultiValue( languages );\n\t\t\t}\n\n\t\t\treturn this.get( params );\n\t\t},\n\n\t\t/**\n\t\t * Parses values (`dataValues.DataValue`s).\n\t\t *\n\t\t * @param {string} parser Parser id.\n\t\t * @param {string[]} values `DataValue` serializations.\n\t\t * @param {Object} [options]\n\t\t * @return {Object} jQuery.Promise\n\t\t * @return {Function} return.done\n\t\t * @return {*} return.done.result\n\t\t * @return {jqXHR} return.done.jqXHR\n\t\t * @return {Function} return.fail\n\t\t * @return {string} return.fail.code\n\t\t * @return {*} return.fail.error\n\t\t *\n\t\t * @throws {Error} if a parameter is not specified properly.\n\t\t */\n\t\tparseValue: function ( parser, values, options ) {\n\t\t\tif (\n\t\t\t\ttypeof parser !== 'string'\n\t\t\t\t|| !Array.isArray( values )\n\t\t\t\t|| options && typeof options !== 'object'\n\t\t\t) {\n\t\t\t\tthrow new Error( 'Parameter not specified properly' );\n\t\t\t}\n\n\t\t\tconst params = {\n\t\t\t\taction: 'wbparsevalue',\n\t\t\t\tparser: parser,\n\t\t\t\tvalues: this.normalizeMultiValue( values )\n\t\t\t};\n\n\t\t\treturn this.get( params, options );\n\t\t},\n\n\t\t/**\n\t\t * Sets the label of an `Entity`.\n\t\t *\n\t\t * @param {string} id `Entity` id.\n\t\t * @param {number} baseRevId Revision id the edit shall be performed on.\n\t\t * @param {string} label New label text.\n\t\t * @param {string} language Language code of the language the new label should be set in.\n\t\t * @return {Object} jQuery.Promise\n\t\t * @return {Function} return.done\n\t\t * @return {*} return.done.result\n\t\t * @return {jqXHR} return.done.jqXHR\n\t\t * @return {Function} return.fail\n\t\t * @return {string} return.fail.code\n\t\t * @return {*} return.fail.error\n\t\t *\n\t\t * @throws {Error} if a parameter is not specified properly.\n\t\t */\n\t\tsetLabel: function ( id, baseRevId, label, language ) {\n\t\t\tif (\n\t\t\t\ttypeof id !== 'string'\n\t\t\t\t|| typeof baseRevId !== 'number'\n\t\t\t\t|| typeof label !== 'string'\n\t\t\t\t|| typeof language !== 'string'\n\t\t\t) {\n\t\t\t\tthrow new Error( 'Parameter not specified properly' );\n\t\t\t}\n\n\t\t\tconst params = {\n\t\t\t\taction: 'wbsetlabel',\n\t\t\t\tid: id,\n\t\t\t\tvalue: label,\n\t\t\t\tlanguage: language,\n\t\t\t\tbaserevid: baseRevId\n\t\t\t};\n\n\t\t\tif ( this._tags.length ) {\n\t\t\t\tparams.tags = this.normalizeMultiValue( this._tags );\n\t\t\t}\n\n\t\t\treturn this.post( params );\n\t\t},\n\n\t\t/**\n\t\t * Sets the description of an `Entity`.\n\t\t *\n\t\t * @param {string} id `Entity` id.\n\t\t * @param {number} baseRevId Revision id the edit shall be performed on.\n\t\t * @param {string} description New description text.\n\t\t * @param {string} language Language code of the language the new description should be set in.\n\t\t * @return {Object} jQuery.Promise\n\t\t * @return {Function} return.done\n\t\t * @return {*} return.done.result\n\t\t * @return {jqXHR} return.done.jqXHR\n\t\t * @return {Function} return.fail\n\t\t * @return {string} return.fail.code\n\t\t * @return {*} return.fail.error\n\t\t *\n\t\t * @throws {Error} if a parameter is not specified properly.\n\t\t */\n\t\tsetDescription: function ( id, baseRevId, description, language ) {\n\t\t\tif (\n\t\t\t\ttypeof id !== 'string'\n\t\t\t\t|| typeof baseRevId !== 'number'\n\t\t\t\t|| typeof description !== 'string'\n\t\t\t\t|| typeof language !== 'string'\n\t\t\t) {\n\t\t\t\tthrow new Error( 'Parameter not specified properly' );\n\t\t\t}\n\n\t\t\tconst params = {\n\t\t\t\taction: 'wbsetdescription',\n\t\t\t\tid: id,\n\t\t\t\tvalue: description,\n\t\t\t\tlanguage: language,\n\t\t\t\tbaserevid: baseRevId\n\t\t\t};\n\n\t\t\tif ( this._tags.length ) {\n\t\t\t\tparams.tags = this.normalizeMultiValue( this._tags );\n\t\t\t}\n\n\t\t\treturn this.post( params );\n\t\t},\n\n\t\t/**\n\t\t * Adds and/or remove a number of aliases of an `Entity`.\n\t\t *\n\t\t * @param {string} id `Entity` id.\n\t\t * @param {number} baseRevId Revision id the edit shall be performed on.\n\t\t * @param {string[]} add Aliases to add.\n\t\t * @param {string[]} remove Aliases to remove.\n\t\t * @param {string} language Language code of the language the aliases should be added/removed\n\t\t *        in.\n\t\t * @return {Object} jQuery.Promise\n\t\t * @return {Function} return.done\n\t\t * @return {*} return.done.result\n\t\t * @return {jqXHR} return.done.jqXHR\n\t\t * @return {Function} return.fail\n\t\t * @return {string} return.fail.code\n\t\t * @return {*} return.fail.error\n\t\t *\n\t\t * @throws {Error} if a parameter is not specified properly.\n\t\t */\n\t\tsetAliases: function ( id, baseRevId, add, remove, language ) {\n\t\t\tif (\n\t\t\t\ttypeof id !== 'string'\n\t\t\t\t|| typeof baseRevId !== 'number'\n\t\t\t\t|| !Array.isArray( add )\n\t\t\t\t|| !Array.isArray( remove )\n\t\t\t\t|| typeof language !== 'string'\n\t\t\t) {\n\t\t\t\tthrow new Error( 'Parameter not specified properly' );\n\t\t\t}\n\n\t\t\tconst params = {\n\t\t\t\taction: 'wbsetaliases',\n\t\t\t\tid: id,\n\t\t\t\tadd: this.normalizeMultiValue( add ),\n\t\t\t\tremove: this.normalizeMultiValue( remove ),\n\t\t\t\tlanguage: language,\n\t\t\t\tbaserevid: baseRevId\n\t\t\t};\n\n\t\t\tif ( this._tags.length ) {\n\t\t\t\tparams.tags = this.normalizeMultiValue( this._tags );\n\t\t\t}\n\n\t\t\treturn this.post( params );\n\t\t},\n\n\t\t/**\n\t\t * Creates/Updates an entire `Claim`.\n\t\t *\n\t\t * @param {Object} claim `Claim` serialization.\n\t\t * @param {number} baseRevId Revision id the edit shall be performed on.\n\t\t * @param {number} [index] The `Claim`'s index. Only needs to be specified if the `Claim`'s\n\t\t *        index within the list of all `Claim`s of the parent `Entity` shall be changed.\n\t\t * @return {Object} jQuery.Promise\n\t\t * @return {Function} return.done\n\t\t * @return {*} return.done.result\n\t\t * @return {jqXHR} return.done.jqXHR\n\t\t * @return {Function} return.fail\n\t\t * @return {string} return.fail.code\n\t\t * @return {*} return.fail.error\n\t\t *\n\t\t * @throws {Error} if a parameter is not specified properly.\n\t\t */\n\t\tsetClaim: function ( claim, baseRevId, index ) {\n\t\t\tif ( typeof claim !== 'object' || typeof baseRevId !== 'number' ) {\n\t\t\t\tthrow new Error( 'Parameter not specified properly' );\n\t\t\t}\n\n\t\t\tconst params = {\n\t\t\t\taction: 'wbsetclaim',\n\t\t\t\tclaim: JSON.stringify( claim ),\n\t\t\t\tbaserevid: baseRevId\n\t\t\t};\n\n\t\t\tif ( typeof index === 'number' ) {\n\t\t\t\tparams.index = index;\n\t\t\t}\n\n\t\t\tif ( this._tags.length ) {\n\t\t\t\tparams.tags = this.normalizeMultiValue( this._tags );\n\t\t\t}\n\n\t\t\treturn this.post( params );\n\t\t},\n\n\t\t/**\n\t\t * Removes a `Claim`.\n\t\t *\n\t\t * @param {string} claimGuid The GUID of the `Claim` to be removed.\n\t\t * @param {number} [claimRevisionId] Revision id the edit shall be performed on.\n\t\t * @return {Object} jQuery.Promise\n\t\t * @return {Function} return.done\n\t\t * @return {*} return.done.result\n\t\t * @return {jqXHR} return.done.jqXHR\n\t\t * @return {Function} return.fail\n\t\t * @return {string} return.fail.code\n\t\t * @return {*} return.fail.error\n\t\t *\n\t\t * @throws {Error} if a parameter is not specified properly.\n\t\t */\n\t\tremoveClaim: function ( claimGuid, claimRevisionId ) {\n\t\t\tif (\n\t\t\t\ttypeof claimGuid !== 'string'\n\t\t\t\t|| claimRevisionId && typeof claimRevisionId !== 'number'\n\t\t\t) {\n\t\t\t\tthrow new Error( 'Parameter not specified properly' );\n\t\t\t}\n\n\t\t\tconst params = {\n\t\t\t\taction: 'wbremoveclaims',\n\t\t\t\tclaim: claimGuid\n\t\t\t};\n\n\t\t\tif ( claimRevisionId ) {\n\t\t\t\tparams.baserevid = claimRevisionId;\n\t\t\t}\n\n\t\t\tif ( this._tags.length ) {\n\t\t\t\tparams.tags = this.normalizeMultiValue( this._tags );\n\t\t\t}\n\n\t\t\treturn this.post( params );\n\t\t},\n\n\t\t/**\n\t\t * Sets a `SiteLink` for an item via the API.\n\t\t *\n\t\t * @param {string} id `Entity` id.\n\t\t * @param {number} baseRevId Revision id the edit shall be performed on.\n\t\t * @param {string} site Site of the link.\n\t\t * @param {string} title Title to link to.\n\t\t * @param {string[]|string} [badges] List of `Entity` ids to be assigned as badges.\n\t\t * @return {Object} jQuery.Promise\n\t\t * @return {Function} return.done\n\t\t * @return {*} return.done.result\n\t\t * @return {jqXHR} return.done.jqXHR\n\t\t * @return {Function} return.fail\n\t\t * @return {string} return.fail.code\n\t\t * @return {*} return.fail.error\n\t\t *\n\t\t * @throws {Error} if a parameter is not specified properly.\n\t\t */\n\t\tsetSitelink: function ( id, baseRevId, site, title, badges ) {\n\t\t\tif ( typeof id !== 'string'\n\t\t\t|| typeof baseRevId !== 'number'\n\t\t\t|| typeof site !== 'string'\n\t\t\t|| typeof title !== 'string'\n\t\t\t|| badges && typeof badges !== 'string' && !Array.isArray( badges )\n\t\t\t) {\n\t\t\t\tthrow new Error( 'Parameter not specified properly' );\n\t\t\t}\n\n\t\t\tconst params = {\n\t\t\t\taction: 'wbsetsitelink',\n\t\t\t\tid: id,\n\t\t\t\tlinksite: site,\n\t\t\t\tlinktitle: title,\n\t\t\t\tbaserevid: baseRevId\n\t\t\t};\n\n\t\t\tif ( badges ) {\n\t\t\t\tparams.badges = this.normalizeMultiValue( badges );\n\t\t\t}\n\n\t\t\tif ( this._tags.length ) {\n\t\t\t\tparams.tags = this.normalizeMultiValue( this._tags );\n\t\t\t}\n\n\t\t\treturn this.post( params );\n\t\t},\n\n\t\t/**\n\t\t * Sets a site link for an item via the API.\n\t\t *\n\t\t * @param {string} fromId `Entity` id to merge from.\n\t\t * @param {string} toId `Entity` id to merge to.\n\t\t * @param {string[]|string} [ignoreConflicts] Elements of the `Item` to ignore conflicts for.\n\t\t * @param {string} [summary] Summary for the edit.\n\t\t * @return {Object} jQuery.Promise\n\t\t * @return {Function} return.done\n\t\t * @return {*} return.done.result\n\t\t * @return {jqXHR} return.done.jqXHR\n\t\t * @return {Function} return.fail\n\t\t * @return {string} return.fail.code\n\t\t * @return {*} return.fail.error\n\t\t *\n\t\t * @throws {Error} if a parameter is not specified properly.\n\t\t */\n\t\tmergeItems: function ( fromId, toId, ignoreConflicts, summary ) {\n\t\t\tif ( typeof fromId !== 'string'\n\t\t\t|| typeof toId !== 'string'\n\t\t\t|| ignoreConflicts\n\t\t\t\t&& typeof ignoreConflicts !== 'string'\n\t\t\t\t&& !Array.isArray( ignoreConflicts )\n\t\t\t|| summary && typeof summary !== 'string'\n\t\t\t) {\n\t\t\t\tthrow new Error( 'Parameter not specified properly' );\n\t\t\t}\n\n\t\t\tconst params = {\n\t\t\t\taction: 'wbmergeitems',\n\t\t\t\tfromid: fromId,\n\t\t\t\ttoid: toId\n\t\t\t};\n\n\t\t\tif ( ignoreConflicts ) {\n\t\t\t\tparams.ignoreconflicts = this.normalizeMultiValue( ignoreConflicts );\n\t\t\t}\n\n\t\t\tif ( summary ) {\n\t\t\t\tparams.summary = summary;\n\t\t\t}\n\n\t\t\tif ( this._tags.length ) {\n\t\t\t\tparams.tags = this.normalizeMultiValue( this._tags );\n\t\t\t}\n\n\t\t\treturn this.post( params );\n\t\t},\n\n\t\t/**\n\t\t * Converts the given value into a string usable by the API.\n\t\t *\n\t\t * @private\n\t\t *\n\t\t * @param {string[]|string|null} [value]\n\t\t * @return {string}\n\t\t */\n\t\tnormalizeMultiValue: function ( value ) {\n\t\t\tif ( Array.isArray( value ) ) {\n\t\t\t\tvalue = value.join( '\\x1f' );\n\t\t\t}\n\n\t\t\t// We must enforce the alternative separation character, see ApiBase.php::explodeMultiValue.\n\t\t\treturn value ? '\\x1f' + value : '';\n\t\t},\n\n\t\t/**\n\t\t * Submits a GET request to the API with added 'errorformat' and 'uselang' parameters as\n\t\t * well as stringified options.\n\t\t *\n\t\t * @param {Object} params parameters for the API call.\n\t\t * @param {Object} [options]\n\t\t * @return {Object} jQuery.Promise\n\t\t * @return {Function} return.done\n\t\t * @return {*} return.done.result\n\t\t * @return {jqXHR} return.done.jqXHR\n\t\t * @return {Function} return.fail\n\t\t * @return {string} return.fail.code\n\t\t * @return {*} return.fail.error\n\t\t */\n\t\tget: function ( params, options ) {\n\t\t\tparams.errorformat = 'plaintext';\n\t\t\tif ( this._uselang ) {\n\t\t\t\tparams.uselang = this._uselang;\n\t\t\t}\n\n\t\t\tif ( options ) {\n\t\t\t\tparams.options = JSON.stringify( options );\n\n\t\t\t\t// override 'uselang' parameter if passed via options\n\t\t\t\tif ( options.lang ) {\n\t\t\t\t\tparams.uselang = options.lang;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this._api.get( params );\n\t\t},\n\n\t\t/**\n\t\t * Submits the AJAX request to the API of the repo and triggers on the response. This will\n\t\t * automatically add the required 'token' information for editing into the given parameters\n\t\t * sent to the API. Additionally, it sets the 'errorformat' and 'uselang' parameters.\n\t\t *\n\t\t * @param {Object} params parameters for the API call.\n\t\t * @return {Object} jQuery.Promise\n\t\t * @return {Function} return.done\n\t\t * @return {*} return.done.result\n\t\t * @return {jqXHR} return.done.jqXHR\n\t\t * @return {Function} return.fail\n\t\t * @return {string} return.fail.code\n\t\t * @return {*} return.fail.error A plain object with information about the error if `code` is\n\t\t *         \"http\", a string, if the call was successful but the response is empty or the result\n\t\t *         result if it contains an `error` field.\n\t\t *\n\t\t * @throws {Error} if a parameter is not specified properly.\n\t\t */\n\t\tpost: function ( params ) {\n\t\t\t/**\n\t\t\t * Unconditionally set the bot parameter to match the UI behavior of core.\n\t\t\t * In normal page editing, if you have the \"bot\" user right and edit through the GUI\n\t\t\t * interface, your edit is marked as bot no matter what.\n\t\t\t *\n\t\t\t * @see https://gerrit.wikimedia.org/r/71246\n\t\t\t * @see https://phabricator.wikimedia.org/T189477\n\t\t\t */\n\t\t\tparams.bot = 1;\n\n\t\t\t// assert the api user matches the browser user in case one has logged out after page load.\n\t\t\tif ( !mw.user.isAnon() ) {\n\t\t\t\tparams.assertuser = mw.user.getName();\n\t\t\t} else {\n\t\t\t\t// Edits by anonymous users may result in tempuser creation, triggering a redirect.\n\t\t\t\t// Set returnto so that user is redirected back to the same page.\n\t\t\t\tparams.returnto = mw.config.get( 'wgPageName' );\n\t\t\t}\n\n\t\t\tparams.errorformat = 'plaintext';\n\t\t\tif ( this._uselang ) {\n\t\t\t\tparams.uselang = this._uselang;\n\t\t\t}\n\n\t\t\tObject.keys( params ).forEach( ( key ) => {\n\t\t\t\tif ( key === undefined || params[ key ] === null ) {\n\t\t\t\t\tthrow new Error( 'Parameter \"' + key + '\" is not specified properly.' );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\treturn this._api.postWithToken( 'csrf', params );\n\t\t}\n\t} );\n\n}( wikibase ) );\n","usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-spacing","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"indent","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multi-spaces","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"spaced-comment","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"wrap-iife","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/src/RepoApiError.js","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-spacing","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"indent","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multi-spaces","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"spaced-comment","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"wrap-iife","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/src/getLocationAgnosticMwApi.js","messages":[{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'mediaWiki' is undefined.","line":33,"column":1,"nodeType":"Block","endLine":33,"endColumn":1}],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"( function ( wb ) {\n\t'use strict';\n\n\t/**\n\t * @ignore\n\t *\n\t * @param {string} url\n\t * @return {string}\n\t */\n\tfunction getHost( url ) {\n\t\t// Internet Explorer returns an incomplete host (without port) when the protocol is missing.\n\t\tif ( /^\\/\\//.test( url ) ) {\n\t\t\turl = location.protocol + url;\n\t\t}\n\n\t\tconst parser = document.createElement( 'A' );\n\t\tparser.href = url;\n\t\treturn parser.host;\n\t}\n\n\t// TODO: Merge this into mw.Api\n\t/**\n\t * Returns a `mediaWiki.Api` instance which can transparently interact with remote APIs.\n\t *\n\t * @member wikibase.api\n\t * @method getLocationAgnosticMwApi\n\t * @since 1.0\n\t * @license GPL-2.0+\n\t * @author Adrian Lang < adrian.lang@wikimedia.de >\n\t *\n\t * @param {string} apiEndpoint\n\t * @param {Object} [options]\n\t * @return {mediaWiki.Api}\n\t */\n\twb.api.getLocationAgnosticMwApi = function ( apiEndpoint, options ) {\n\t\tif ( getHost( apiEndpoint ) !== getHost( location.href ) ) {\n\t\t\t// Use mw.ForeignApi if the api we want to use is on a different domain.\n\t\t\treturn new mw.ForeignApi( apiEndpoint, options );\n\t\t}\n\n\t\tconst mwApiOptions = Object.assign( {}, options, {\n\t\t\tajax: {\n\t\t\t\turl: apiEndpoint\n\t\t\t}\n\t\t} );\n\n\t\treturn new mw.Api( mwApiOptions );\n\t};\n\n}( wikibase ) );\n","usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-spacing","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"indent","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multi-spaces","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"spaced-comment","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"wrap-iife","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/src/namespace.js","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-spacing","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"indent","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multi-spaces","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"spaced-comment","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"wrap-iife","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/tests/RepoApi.tests.js","messages":[{"ruleId":"jsdoc/require-param-type","severity":1,"message":"Missing JSDoc @param \"wb\" type.","line":2,"column":1,"nodeType":"Block","endLine":2,"endColumn":1},{"ruleId":"jsdoc/require-param-type","severity":1,"message":"Missing JSDoc @param \"QUnit\" type.","line":3,"column":1,"nodeType":"Block","endLine":3,"endColumn":1},{"ruleId":"jsdoc/require-param-type","severity":1,"message":"Missing JSDoc @param \"sinon\" type.","line":4,"column":1,"nodeType":"Block","endLine":4,"endColumn":1}],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"/**\n * @param wb\n * @param QUnit\n * @param sinon\n * @license GPL-2.0+\n * @author H. Snater < mediawiki@snater.com >\n */\n( function ( wb, QUnit, sinon ) {\n\t'use strict';\n\n\tQUnit.module( 'wikibase.api.RepoApi', {\n\t\tbeforeEach: function () {\n\t\t\tmw._mockUser = null;\n\t\t}\n\t} );\n\n\t/**\n * Instantiates a `wikibase.api.RepoApi` object with the relevant method being overwritten and\n * having applied a SinonJS spy.\n *\n * @param {string} [getOrPost='post'] Whether to mock/spy the `get` or `post` request.\n * @param {string[]} [tags] Which tags to configure in the RepoApi.\n * @return {Object}\n */\n\tfunction mockApi( getOrPost, tags ) {\n\t\tconst api = {\n\t\t\t\tpostWithToken: function () {},\n\t\t\t\tget: function () {}\n\t\t\t},\n\t\t\tspyMethod = getOrPost !== 'get' ? 'postWithToken' : 'get';\n\n\t\treturn {\n\t\t\tspy: sinon.spy( api, spyMethod ),\n\t\t\tapi: new wb.api.RepoApi( api, 'testlanguage', tags || [ 'a', 'b' ] )\n\t\t};\n\t}\n\n\t/**\n * Returns all request parameters submitted to the function performing the `get` or `post` request.\n *\n * @param {Object} spy The SinonJS spy to extract the parameters from.\n * @param {number} [callIndex=0] The call index if multiple API calls have been performed on the same spy.\n * @return {Object}\n */\n\tfunction getParams( spy, callIndex ) {\n\t\tcallIndex = callIndex || 0;\n\t\treturn spy.displayName === 'postWithToken' ? spy.args[ callIndex ][ 1 ] : spy.args[ callIndex ][ 0 ];\n\t}\n\n\t/**\n * Returns a specific parameter submitted to the function performing the `get` or `post` request.\n *\n * @param {Object} spy The SinonJS spy to extract the parameters from.\n * @param {string} paramName\n * @param {number} [callIndex=0] The call index if multiple API calls have been performed on the same spy.\n * @return {string}\n */\n\tfunction getParam( spy, paramName, callIndex ) {\n\t\treturn getParams( spy, callIndex || 0 )[ paramName ];\n\t}\n\n\tQUnit.test( 'createEntity()', ( assert ) => {\n\t\tconst mock = mockApi();\n\n\t\tmock.api.createEntity( 'item' );\n\t\tmock.api.createEntity( 'property', { 'I am': 'data' } );\n\n\t\tassert.true( mock.spy.calledTwice, 'Triggered API calls.' );\n\n\t\tassert.strictEqual(\n\t\t\tgetParam( mock.spy, 'action' ),\n\t\t\t'wbeditentity',\n\t\t\t'Verified API module being called.'\n\t\t);\n\n\t\tassert.strictEqual(\n\t\t\tgetParam( mock.spy, 'new' ),\n\t\t\t'item',\n\t\t\t'Verified submitting entity type.'\n\t\t);\n\n\t\tassert.strictEqual(\n\t\t\tgetParam( mock.spy, 'data' ),\n\t\t\tJSON.stringify( {} ),\n\t\t\t'Verified not submitting any data by default.'\n\t\t);\n\n\t\tassert.strictEqual(\n\t\t\tgetParam( mock.spy, 'data', 1 ),\n\t\t\tJSON.stringify( { 'I am': 'data' } ),\n\t\t\t'Verified submitting \"data\" field.'\n\t\t);\n\n\t\tassert.strictEqual( getParam( mock.spy, 'errorformat' ), 'plaintext' );\n\t\tassert.strictEqual( getParam( mock.spy, 'uselang' ), 'testlanguage' );\n\t\tassert.strictEqual( getParam( mock.spy, 'tags' ), '\\x1fa\\x1fb' );\n\t} );\n\n\tQUnit.test( 'editEntity()', ( assert ) => {\n\t\tconst mock = mockApi();\n\n\t\tmock.api.editEntity( 'entity id', 12345, { 'I am': 'entity data' }, true );\n\n\t\tassert.true( mock.spy.calledOnce, 'Triggered API call.' );\n\n\t\tassert.strictEqual(\n\t\t\tgetParam( mock.spy, 'action' ),\n\t\t\t'wbeditentity',\n\t\t\t'Verified API module being called.'\n\t\t);\n\n\t\tassert.strictEqual( getParam( mock.spy, 'id' ), 'entity id' );\n\t\tassert.strictEqual( getParam( mock.spy, 'baserevid' ), 12345 );\n\t\tassert.strictEqual( getParam( mock.spy, 'data' ), JSON.stringify( { 'I am': 'entity data' } ) );\n\t\tassert.strictEqual( getParam( mock.spy, 'clear' ), true );\n\t\tassert.strictEqual( getParam( mock.spy, 'errorformat' ), 'plaintext' );\n\t\tassert.strictEqual( getParam( mock.spy, 'uselang' ), 'testlanguage' );\n\t\tassert.strictEqual( getParam( mock.spy, 'tags' ), '\\x1fa\\x1fb' );\n\t} );\n\n\tQUnit.test( 'formatValue()', ( assert ) => {\n\t\tconst mock = mockApi( 'get' );\n\n\t\tmock.api.formatValue(\n\t\t\t{ 'I am': 'DataValue serialization' },\n\t\t\t{ lang: 'language code', option: 'option value' },\n\t\t\t'data type id',\n\t\t\t'output format'\n\t\t);\n\n\t\tmock.api.formatValue( { 'I am': 'DataValue serialization' } );\n\n\t\t// make sure that property id overrides data type id\n\t\tmock.api.formatValue(\n\t\t\t{ 'I am': 'DataValue serialization' },\n\t\t\t{ option: 'option value' },\n\t\t\t'data type id',\n\t\t\t'output format',\n\t\t\t'property id'\n\t\t);\n\n\t\tassert.true( mock.spy.calledThrice, 'Triggered API call.' );\n\n\t\tassert.strictEqual(\n\t\t\tgetParam( mock.spy, 'action' ),\n\t\t\t'wbformatvalue',\n\t\t\t'Verified API module being called.'\n\t\t);\n\n\t\tassert.strictEqual(\n\t\t\tgetParam( mock.spy, 'datavalue' ),\n\t\t\tJSON.stringify( { 'I am': 'DataValue serialization' } )\n\t\t);\n\t\tassert.strictEqual(\n\t\t\tgetParam( mock.spy, 'options' ),\n\t\t\tJSON.stringify( { lang: 'language code', option: 'option value' } )\n\t\t);\n\t\tassert.strictEqual( getParam( mock.spy, 'datatype' ), 'data type id' );\n\t\tassert.strictEqual( getParam( mock.spy, 'generate' ), 'output format' );\n\t\tassert.strictEqual( getParam( mock.spy, 'property' ), undefined );\n\t\tassert.strictEqual( getParam( mock.spy, 'errorformat' ), 'plaintext' );\n\t\tassert.strictEqual( getParam( mock.spy, 'uselang' ), 'language code' );\n\n\t\tassert.strictEqual(\n\t\t\tgetParam( mock.spy, 'datavalue', 1 ),\n\t\t\tJSON.stringify( { 'I am': 'DataValue serialization' } )\n\t\t);\n\t\tassert.strictEqual( getParam( mock.spy, 'options', 1 ), undefined );\n\t\tassert.strictEqual( getParam( mock.spy, 'datatype', 1 ), undefined );\n\t\tassert.strictEqual( getParam( mock.spy, 'generate', 1 ), undefined );\n\t\tassert.strictEqual( getParam( mock.spy, 'property', 1 ), undefined );\n\n\t\tassert.strictEqual(\n\t\t\tgetParam( mock.spy, 'datavalue', 2 ),\n\t\t\tJSON.stringify( { 'I am': 'DataValue serialization' } )\n\t\t);\n\t\tassert.strictEqual(\n\t\t\tgetParam( mock.spy, 'options', 2 ),\n\t\t\tJSON.stringify( { option: 'option value' } )\n\t\t);\n\t\tassert.strictEqual( getParam( mock.spy, 'datatype', 2 ), undefined );\n\t\tassert.strictEqual( getParam( mock.spy, 'generate', 2 ), 'output format' );\n\t\tassert.strictEqual( getParam( mock.spy, 'property', 2 ), 'property id' );\n\t} );\n\n\tQUnit.test( 'getEntities()', ( assert ) => {\n\t\tconst mock = mockApi( 'get' );\n\n\t\tmock.api.getEntities(\n\t\t\t[ 'entity id 1', 'entity id 2' ],\n\t\t\t[ 'property1', 'property2' ],\n\t\t\t[ 'language code 1', 'language code 2' ]\n\t\t);\n\n\t\tmock.api.getEntities(\n\t\t\t'entity id',\n\t\t\t'property',\n\t\t\t'language code'\n\t\t);\n\n\t\tmock.api.getEntities( 'entity id' );\n\n\t\tassert.true( mock.spy.calledThrice, 'Triggered API calls.' );\n\n\t\tassert.strictEqual(\n\t\t\tgetParam( mock.spy, 'action' ),\n\t\t\t'wbgetentities',\n\t\t\t'Verified API module being called.'\n\t\t);\n\n\t\tassert.strictEqual( getParam( mock.spy, 'ids' ), '\\x1fentity id 1\\x1fentity id 2' );\n\t\tassert.strictEqual( getParam( mock.spy, 'props' ), '\\x1fproperty1\\x1fproperty2' );\n\t\tassert.strictEqual( getParam( mock.spy, 'languages' ), '\\x1flanguage code 1\\x1flanguage code 2' );\n\t\tassert.strictEqual( getParam( mock.spy, 'errorformat' ), 'plaintext' );\n\t\tassert.strictEqual( getParam( mock.spy, 'uselang' ), 'testlanguage' );\n\n\t\tassert.strictEqual( getParam( mock.spy, 'ids', 1 ), '\\x1fentity id' );\n\t\tassert.strictEqual( getParam( mock.spy, 'props', 1 ), '\\x1fproperty' );\n\t\tassert.strictEqual( getParam( mock.spy, 'languages', 1 ), '\\x1flanguage code' );\n\n\t\tassert.strictEqual( getParam( mock.spy, 'ids', 2 ), '\\x1fentity id' );\n\t\tassert.strictEqual( getParam( mock.spy, 'props', 2 ), undefined );\n\t\tassert.strictEqual( getParam( mock.spy, 'languages', 2 ), undefined );\n\t} );\n\n\tQUnit.test( 'getEntitiesByPage()', ( assert ) => {\n\t\tconst mock = mockApi( 'get' );\n\n\t\tmock.api.getEntitiesByPage(\n\t\t\t[ 'site id 1', 'site id 2' ],\n\t\t\t'title',\n\t\t\t[ 'property1', 'property2' ],\n\t\t\t[ 'language code 1', 'language code 2' ],\n\t\t\ttrue\n\t\t);\n\n\t\tmock.api.getEntitiesByPage(\n\t\t\t'site id',\n\t\t\t[ 'title1', 'title2' ],\n\t\t\t[ 'property1', 'property2' ],\n\t\t\t[ 'language code 1', 'language code 2' ],\n\t\t\ttrue\n\t\t);\n\n\t\tmock.api.getEntitiesByPage(\n\t\t\t'site id',\n\t\t\t'title',\n\t\t\t'property',\n\t\t\t'language code',\n\t\t\tfalse\n\t\t);\n\n\t\tmock.api.getEntitiesByPage( 'site id', 'title' );\n\t\tmock.api.getEntitiesByPage( [ 'site id' ], 'title' );\n\t\tmock.api.getEntitiesByPage( 'site id', [ 'title' ] );\n\n\t\tassert.strictEqual( mock.spy.callCount, 6, 'Triggered API calls.' );\n\n\t\tassert.strictEqual(\n\t\t\tgetParam( mock.spy, 'action' ),\n\t\t\t'wbgetentities',\n\t\t\t'Verified API module being called.'\n\t\t);\n\n\t\tassert.strictEqual( getParam( mock.spy, 'sites' ), '\\x1fsite id 1\\x1fsite id 2' );\n\t\tassert.strictEqual( getParam( mock.spy, 'titles' ), '\\x1ftitle' );\n\t\tassert.strictEqual( getParam( mock.spy, 'props' ), '\\x1fproperty1\\x1fproperty2' );\n\t\tassert.strictEqual( getParam( mock.spy, 'languages' ), '\\x1flanguage code 1\\x1flanguage code 2' );\n\t\tassert.strictEqual( getParam( mock.spy, 'normalize' ), true );\n\t\tassert.strictEqual( getParam( mock.spy, 'errorformat' ), 'plaintext' );\n\t\tassert.strictEqual( getParam( mock.spy, 'uselang' ), 'testlanguage' );\n\n\t\tassert.strictEqual( getParam( mock.spy, 'sites', 1 ), '\\x1fsite id' );\n\t\tassert.strictEqual( getParam( mock.spy, 'titles', 1 ), '\\x1ftitle1\\x1ftitle2' );\n\t\tassert.strictEqual( getParam( mock.spy, 'props', 1 ), '\\x1fproperty1\\x1fproperty2' );\n\t\tassert.strictEqual( getParam( mock.spy, 'languages' ), '\\x1flanguage code 1\\x1flanguage code 2' );\n\t\tassert.strictEqual( getParam( mock.spy, 'normalize', 1 ), true );\n\n\t\tassert.strictEqual( getParam( mock.spy, 'sites', 2 ), '\\x1fsite id' );\n\t\tassert.strictEqual( getParam( mock.spy, 'titles', 2 ), '\\x1ftitle' );\n\t\tassert.strictEqual( getParam( mock.spy, 'props', 2 ), '\\x1fproperty' );\n\t\tassert.strictEqual( getParam( mock.spy, 'languages', 2 ), '\\x1flanguage code' );\n\t\tassert.strictEqual( getParam( mock.spy, 'normalize', 2 ), false );\n\n\t\tassert.strictEqual( getParam( mock.spy, 'sites', 3 ), '\\x1fsite id' );\n\t\tassert.strictEqual( getParam( mock.spy, 'titles', 3 ), '\\x1ftitle' );\n\t\tassert.strictEqual( getParam( mock.spy, 'props', 3 ), undefined );\n\t\tassert.strictEqual( getParam( mock.spy, 'languages', 3 ), undefined );\n\t\tassert.strictEqual( getParam( mock.spy, 'normalize', 3 ), undefined );\n\n\t\tassert.strictEqual( getParam( mock.spy, 'sites', 4 ), '\\x1fsite id' );\n\t\tassert.strictEqual( getParam( mock.spy, 'titles', 4 ), '\\x1ftitle' );\n\t\tassert.strictEqual( getParam( mock.spy, 'props', 4 ), undefined );\n\t\tassert.strictEqual( getParam( mock.spy, 'languages', 4 ), undefined );\n\t\tassert.strictEqual( getParam( mock.spy, 'normalize', 4 ), undefined );\n\n\t\tassert.strictEqual( getParam( mock.spy, 'sites', 5 ), '\\x1fsite id' );\n\t\tassert.strictEqual( getParam( mock.spy, 'titles', 5 ), '\\x1ftitle' );\n\t\tassert.strictEqual( getParam( mock.spy, 'props', 5 ), undefined );\n\t\tassert.strictEqual( getParam( mock.spy, 'languages', 5 ), undefined );\n\t\tassert.strictEqual( getParam( mock.spy, 'normalize', 5 ), undefined );\n\t} );\n\n\tQUnit.test( 'parseValue()', ( assert ) => {\n\t\tconst mock = mockApi( 'get' );\n\n\t\tmock.api.parseValue(\n\t\t\t'parser id',\n\t\t\t[ 'serialization1', 'serialization2' ],\n\t\t\t{ lang: 'language code', option: 'option value' }\n\t\t);\n\t\tmock.api.parseValue( 'parser id', [ 'serialization with p|pe' ] );\n\n\t\tassert.true( mock.spy.calledTwice, 'Triggered API call.' );\n\n\t\tassert.strictEqual(\n\t\t\tgetParam( mock.spy, 'action' ),\n\t\t\t'wbparsevalue',\n\t\t\t'Verified API module being called.'\n\t\t);\n\n\t\tassert.strictEqual( getParam( mock.spy, 'parser' ), 'parser id' );\n\t\tassert.strictEqual( getParam( mock.spy, 'values' ), '\\x1fserialization1\\x1fserialization2' );\n\t\tassert.strictEqual( getParam( mock.spy, 'errorformat' ), 'plaintext' );\n\t\tassert.strictEqual( getParam( mock.spy, 'uselang' ), 'language code' );\n\t\tassert.strictEqual(\n\t\t\tgetParam( mock.spy, 'options' ),\n\t\t\tJSON.stringify( { lang: 'language code', option: 'option value' } )\n\t\t);\n\n\t\tassert.strictEqual( getParam( mock.spy, 'parser', 1 ), 'parser id' );\n\t\tassert.strictEqual( getParam( mock.spy, 'values', 1 ), '\\x1fserialization with p|pe' );\n\t\tassert.strictEqual( getParam( mock.spy, 'errorformat', 1 ), 'plaintext' );\n\t\tassert.strictEqual( getParam( mock.spy, 'uselang', 1 ), 'testlanguage' );\n\t\tassert.strictEqual( getParam( mock.spy, 'options', 1 ), undefined );\n\t} );\n\n\tQUnit.test( 'setLabel(), setDescription()', ( assert ) => {\n\t\tconst subjects = [ 'Label', 'Description' ];\n\n\t\tfor ( let i = 0; i < subjects.length; i++ ) {\n\t\t\tconst mock = mockApi();\n\n\t\t\tmock.api[ 'set' + subjects[ i ] ]( 'entity id', 12345, 'text', 'language code' );\n\n\t\t\tassert.true( mock.spy.calledOnce, 'Triggered API call.' );\n\n\t\t\tassert.strictEqual(\n\t\t\t\tgetParam( mock.spy, 'action' ),\n\t\t\t\t'wbset' + subjects[ i ].toLowerCase(),\n\t\t\t\t'Verified API module being called.'\n\t\t\t);\n\n\t\t\tassert.strictEqual( getParam( mock.spy, 'id' ), 'entity id' );\n\t\t\tassert.strictEqual( getParam( mock.spy, 'baserevid' ), 12345 );\n\t\t\tassert.strictEqual( getParam( mock.spy, 'value' ), 'text' );\n\t\t\tassert.strictEqual( getParam( mock.spy, 'language' ), 'language code' );\n\t\t\tassert.strictEqual( getParam( mock.spy, 'tags' ), '\\x1fa\\x1fb' );\n\t\t\tassert.strictEqual( getParam( mock.spy, 'returnto' ), 'currentPage' );\n\t\t}\n\t} );\n\n\tQUnit.test( 'setAliases()', ( assert ) => {\n\t\tconst mock = mockApi();\n\n\t\tmock.api.setAliases(\n\t\t\t'entity id', 12345, [ 'alias1', 'alias2' ], [ 'alias-remove with p|pe' ], 'language code'\n\t\t);\n\n\t\tassert.true( mock.spy.calledOnce, 'Triggered API call.' );\n\n\t\tassert.strictEqual(\n\t\t\tgetParam( mock.spy, 'action' ),\n\t\t\t'wbsetaliases',\n\t\t\t'Verified API module being called.'\n\t\t);\n\n\t\tassert.strictEqual( getParam( mock.spy, 'id' ), 'entity id' );\n\t\tassert.strictEqual( getParam( mock.spy, 'baserevid' ), 12345 );\n\t\tassert.strictEqual( getParam( mock.spy, 'add' ), '\\x1falias1\\x1falias2' );\n\t\tassert.strictEqual( getParam( mock.spy, 'remove' ), '\\x1falias-remove with p|pe' );\n\t\tassert.strictEqual( getParam( mock.spy, 'language' ), 'language code' );\n\t\tassert.strictEqual( getParam( mock.spy, 'errorformat' ), 'plaintext' );\n\t\tassert.strictEqual( getParam( mock.spy, 'uselang' ), 'testlanguage' );\n\t\tassert.strictEqual( getParam( mock.spy, 'tags' ), '\\x1fa\\x1fb' );\n\t\tassert.strictEqual( getParam( mock.spy, 'returnto' ), 'currentPage' );\n\t} );\n\n\tQUnit.test( 'setClaim()', ( assert ) => {\n\t\tconst mock = mockApi();\n\n\t\tmock.api.setClaim( { 'I am': 'a Claim serialization' }, 12345, 67890 );\n\t\tmock.api.setClaim( { 'I am': 'a Claim serialization' }, 12345 );\n\n\t\tassert.true( mock.spy.calledTwice, 'Triggered API call.' );\n\n\t\tassert.strictEqual(\n\t\t\tgetParam( mock.spy, 'action' ),\n\t\t\t'wbsetclaim',\n\t\t\t'Verified API module being called.'\n\t\t);\n\n\t\tassert.strictEqual(\n\t\t\tgetParam( mock.spy, 'claim' ),\n\t\t\tJSON.stringify( { 'I am': 'a Claim serialization' } )\n\t\t);\n\t\tassert.strictEqual( getParam( mock.spy, 'baserevid' ), 12345 );\n\t\tassert.strictEqual( getParam( mock.spy, 'index' ), 67890 );\n\t\tassert.strictEqual( getParam( mock.spy, 'errorformat' ), 'plaintext' );\n\t\tassert.strictEqual( getParam( mock.spy, 'uselang' ), 'testlanguage' );\n\t\tassert.strictEqual( getParam( mock.spy, 'tags' ), '\\x1fa\\x1fb' );\n\t\tassert.strictEqual( getParam( mock.spy, 'returnto' ), 'currentPage' );\n\n\t\tassert.strictEqual(\n\t\t\tgetParam( mock.spy, 'claim', 1 ),\n\t\t\tJSON.stringify( { 'I am': 'a Claim serialization' } )\n\t\t);\n\t\tassert.strictEqual( getParam( mock.spy, 'baserevid', 1 ), 12345 );\n\t\tassert.strictEqual( getParam( mock.spy, 'index', 1 ), undefined );\n\t} );\n\n\tQUnit.test( 'removeClaim()', ( assert ) => {\n\t\tconst mock = mockApi();\n\n\t\tmock.api.removeClaim( 'claim GUID', 12345 );\n\t\tmock.api.removeClaim( 'claim GUID' );\n\n\t\tassert.true( mock.spy.calledTwice, 'Triggered API call.' );\n\n\t\tassert.strictEqual(\n\t\t\tgetParam( mock.spy, 'action' ),\n\t\t\t'wbremoveclaims',\n\t\t\t'Verified API module being called.'\n\t\t);\n\n\t\tassert.strictEqual( getParam( mock.spy, 'claim' ), 'claim GUID' );\n\t\tassert.strictEqual( getParam( mock.spy, 'baserevid' ), 12345 );\n\t\tassert.strictEqual( getParam( mock.spy, 'errorformat' ), 'plaintext' );\n\t\tassert.strictEqual( getParam( mock.spy, 'uselang' ), 'testlanguage' );\n\t\tassert.strictEqual( getParam( mock.spy, 'tags' ), '\\x1fa\\x1fb' );\n\t\tassert.strictEqual( getParam( mock.spy, 'returnto' ), 'currentPage' );\n\n\t\tassert.strictEqual( getParam( mock.spy, 'claim', 1 ), 'claim GUID' );\n\t\tassert.strictEqual( getParam( mock.spy, 'baserevid', 1 ), undefined );\n\t} );\n\n\tQUnit.test( 'removeClaim() without tags', ( assert ) => {\n\t\tconst mock = mockApi( undefined, [] );\n\n\t\tmock.api.removeClaim( 'claim GUID', 12345 );\n\n\t\tassert.true( mock.spy.calledOnce, 'Triggered API call.' );\n\n\t\tassert.strictEqual( getParam( mock.spy, 'action' ), 'wbremoveclaims' );\n\t\tassert.strictEqual( getParam( mock.spy, 'tags' ), undefined );\n\t} );\n\n\tQUnit.test( 'setSitelink()', ( assert ) => {\n\t\tconst mock = mockApi();\n\n\t\tmock.api.setSitelink(\n\t\t\t'entity id', 12345, 'site id', 'page name', [ 'entity id of badge1', 'entity id of badge 2' ]\n\t\t);\n\t\tmock.api.setSitelink( 'entity id', 12345, 'site id', 'page name' );\n\n\t\tassert.true( mock.spy.calledTwice, 'Triggered API call.' );\n\n\t\tassert.strictEqual(\n\t\t\tgetParam( mock.spy, 'action' ),\n\t\t\t'wbsetsitelink',\n\t\t\t'Verified API module being called.'\n\t\t);\n\n\t\tassert.strictEqual( getParam( mock.spy, 'id' ), 'entity id' );\n\t\tassert.strictEqual( getParam( mock.spy, 'baserevid' ), 12345 );\n\t\tassert.strictEqual( getParam( mock.spy, 'linksite' ), 'site id' );\n\t\tassert.strictEqual( getParam( mock.spy, 'linktitle' ), 'page name' );\n\t\tassert.strictEqual(\n\t\t\tgetParam( mock.spy, 'badges' ),\n\t\t\t'\\x1fentity id of badge1\\x1fentity id of badge 2'\n\t\t);\n\t\tassert.strictEqual( getParam( mock.spy, 'errorformat' ), 'plaintext' );\n\t\tassert.strictEqual( getParam( mock.spy, 'uselang' ), 'testlanguage' );\n\t\tassert.strictEqual( getParam( mock.spy, 'tags' ), '\\x1fa\\x1fb' );\n\n\t\tassert.strictEqual( getParam( mock.spy, 'id', 1 ), 'entity id' );\n\t\tassert.strictEqual( getParam( mock.spy, 'baserevid', 1 ), 12345 );\n\t\tassert.strictEqual( getParam( mock.spy, 'linksite', 1 ), 'site id' );\n\t\tassert.strictEqual( getParam( mock.spy, 'linktitle', 1 ), 'page name' );\n\t\tassert.strictEqual( getParam( mock.spy, 'badges', 1 ), undefined );\n\t\tassert.strictEqual( getParam( mock.spy, 'returnto' ), 'currentPage' );\n\t} );\n\n\tQUnit.test( 'mergeItems() - no ignoreConflicts', ( assert ) => {\n\t\tconst mock = mockApi();\n\n\t\tmock.api.mergeItems( 'entity id from', 'entity id to' );\n\n\t\tassert.true( mock.spy.calledOnce, 'Triggered API calls.' );\n\n\t\tassert.strictEqual(\n\t\t\tgetParam( mock.spy, 'action' ),\n\t\t\t'wbmergeitems',\n\t\t\t'Verified API module being called.'\n\t\t);\n\n\t\tassert.strictEqual( getParam( mock.spy, 'fromid' ), 'entity id from' );\n\t\tassert.strictEqual( getParam( mock.spy, 'toid' ), 'entity id to' );\n\t\tassert.strictEqual( getParam( mock.spy, 'ignoreconflicts' ), undefined );\n\t\tassert.strictEqual( getParam( mock.spy, 'summary' ), undefined );\n\t\tassert.strictEqual( getParam( mock.spy, 'errorformat' ), 'plaintext' );\n\t\tassert.strictEqual( getParam( mock.spy, 'uselang' ), 'testlanguage' );\n\t\tassert.strictEqual( getParam( mock.spy, 'tags' ), '\\x1fa\\x1fb' );\n\t\tassert.strictEqual( getParam( mock.spy, 'returnto' ), 'currentPage' );\n\t} );\n\n\tQUnit.test( 'mergeItems() - single ignoreConflicts', ( assert ) => {\n\t\tconst mock = mockApi();\n\n\t\tmock.api.mergeItems(\n\t\t\t'entity id from',\n\t\t\t'entity id to',\n\t\t\t'property to ignore conflict for',\n\t\t\t'edit summary'\n\t\t);\n\n\t\tassert.true( mock.spy.calledOnce, 'Triggered API calls.' );\n\n\t\tassert.strictEqual(\n\t\t\tgetParam( mock.spy, 'action' ),\n\t\t\t'wbmergeitems',\n\t\t\t'Verified API module being called.'\n\t\t);\n\n\t\tassert.strictEqual( getParam( mock.spy, 'fromid' ), 'entity id from' );\n\t\tassert.strictEqual( getParam( mock.spy, 'toid' ), 'entity id to' );\n\t\tassert.strictEqual(\n\t\t\tgetParam( mock.spy, 'ignoreconflicts' ),\n\t\t\t'\\x1fproperty to ignore conflict for'\n\t\t);\n\t\tassert.strictEqual( getParam( mock.spy, 'summary' ), 'edit summary' );\n\t} );\n\n\tQUnit.test( 'mergeItems() - multiple ignoreConflicts', ( assert ) => {\n\t\tconst mock = mockApi();\n\n\t\tmock.api.mergeItems(\n\t\t\t'entity id from',\n\t\t\t'entity id to',\n\t\t\t[ 'property to ignore conflict for 1', 'property to ignore conflict for 2' ],\n\t\t\t'edit summary'\n\t\t);\n\n\t\tassert.true( mock.spy.calledOnce, 'Triggered API calls.' );\n\n\t\tassert.strictEqual(\n\t\t\tgetParam( mock.spy, 'action' ),\n\t\t\t'wbmergeitems',\n\t\t\t'Verified API module being called.'\n\t\t);\n\n\t\tassert.strictEqual( getParam( mock.spy, 'fromid' ), 'entity id from' );\n\t\tassert.strictEqual( getParam( mock.spy, 'toid' ), 'entity id to' );\n\t\tassert.strictEqual(\n\t\t\tgetParam( mock.spy, 'ignoreconflicts' ),\n\t\t\t'\\x1fproperty to ignore conflict for 1\\x1fproperty to ignore conflict for 2'\n\t\t);\n\t\tassert.strictEqual( getParam( mock.spy, 'summary' ), 'edit summary' );\n\t} );\n\n\tQUnit.test( 'normalizeMultiValue()', ( assert ) => {\n\t\tconst mock = mockApi();\n\n\t\tassert.strictEqual( mock.api.normalizeMultiValue( [] ), '', 'empty array -> empty string' );\n\t\tassert.strictEqual(\n\t\t\tmock.api.normalizeMultiValue( [ 'val1', 'val2' ] ),\n\t\t\t'\\x1fval1\\x1fval2',\n\t\t\t'array values are prefixed with `\\\\x1f`'\n\t\t);\n\t} );\n\n\tQUnit.test( 'check post asserts user and does not set returnto when logged in ', ( assert ) => {\n\t\tconst mock = mockApi();\n\t\tmw._mockUser = 'fooBarUser';\n\t\tmock.api.post( { action: 'foobar' } );\n\t\tassert.strictEqual( getParam( mock.spy, 'assertuser' ), 'fooBarUser' );\n\t\tassert.strictEqual( getParam( mock.spy, 'returnto' ), undefined );\n\t} );\n\n\tQUnit.test( 'check post does not assert user and does set returnto when not logged in ', ( assert ) => {\n\t\tconst mock = mockApi();\n\n\t\tmock.api.post( { action: 'foobar' } );\n\t\tassert.strictEqual( getParam( mock.spy, 'assertuser' ), undefined );\n\t\tassert.strictEqual( getParam( mock.spy, 'returnto' ), 'currentPage' );\n\t} );\n\n}( wikibase, QUnit, sinon ) );\n","usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-spacing","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"indent","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multi-spaces","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"spaced-comment","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"wrap-iife","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/tests/RepoApiError.tests.js","messages":[{"ruleId":"jsdoc/require-param-type","severity":1,"message":"Missing JSDoc @param \"wb\" type.","line":2,"column":1,"nodeType":"Block","endLine":2,"endColumn":1},{"ruleId":"jsdoc/require-param-type","severity":1,"message":"Missing JSDoc @param \"QUnit\" type.","line":3,"column":1,"nodeType":"Block","endLine":3,"endColumn":1},{"ruleId":"jsdoc/require-param-type","severity":1,"message":"Missing JSDoc @param \"sinon\" type.","line":4,"column":1,"nodeType":"Block","endLine":4,"endColumn":1}],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"/**\n * @param wb\n * @param QUnit\n * @param sinon\n * @license GPL-2.0+\n * @author H. Snater < mediawiki@snater.com >\n */\n\n( function ( wb, QUnit, sinon ) {\n\t'use strict';\n\n\tQUnit.module( 'wikibase.api.RepoApiError' );\n\n\tQUnit.test( 'Create and validate errors', ( assert ) => {\n\t\tlet error = new wb.api.RepoApiError( 'error-code', 'detailed message' );\n\n\t\tassert.strictEqual(\n\t\t\terror.code,\n\t\t\t'error-code',\n\t\t\t'Validated error code.'\n\t\t);\n\n\t\tassert.strictEqual(\n\t\t\terror.detailedMessage,\n\t\t\t'detailed message',\n\t\t\t'Validated error message.'\n\t\t);\n\n\t\tassert.strictEqual(\n\t\t\terror.message,\n\t\t\tmw.msg( 'wikibase-error-unknown' ),\n\t\t\t'Unknown error code: Used default generic unknown error message.'\n\t\t);\n\n\t\t// Check generic error message with parameters\n\t\terror = new wb.api.RepoApiError( 'error-code', 'detailed message', [ 'mock parameter' ] );\n\n\t\tassert.strictEqual(\n\t\t\terror.message,\n\t\t\tmw.msg( 'wikibase-error-unexpected' ),\n\t\t\t'Unexpected error code: Used default generic error message with parameters.'\n\t\t);\n\n\t\terror = new wb.api.RepoApiError( 'timeout', 'detailed message', [], 'remove' );\n\n\t\tassert.strictEqual(\n\t\t\terror.message,\n\t\t\tmw.msg( 'wikibase-error-remove-timeout' ),\n\t\t\t'Picked specific message according to passed \"action\" parameter.'\n\t\t);\n\n\t} );\n\n\tQUnit.test( 'Validate errors created via factory method, requested with unspecified errorformat',\n\t\t( assert ) => {\n\t\t\tlet error = wb.api.RepoApiError.newFromApiResponse(\n\t\t\t\t{ error: { code: 'error-code', info: 'detailed message' } },\n\t\t\t\t'wbaction'\n\t\t\t);\n\n\t\t\tassert.strictEqual(\n\t\t\t\terror.code,\n\t\t\t\t'error-code',\n\t\t\t\t'Created error object via factory method.'\n\t\t\t);\n\n\t\t\tassert.strictEqual(\n\t\t\t\terror.detailedMessage,\n\t\t\t\t'detailed message',\n\t\t\t\t'Validated detailed message of error created via factory method.'\n\t\t\t);\n\n\t\t\tassert.strictEqual(\n\t\t\t\terror.action,\n\t\t\t\t'wbaction',\n\t\t\t\t'Validated API action'\n\t\t\t);\n\n\t\t\terror = wb.api.RepoApiError.newFromApiResponse( {\n\t\t\t\terror: { code: 'error-code', messages: { html: { '*': \"messages.html['*']\" } } }\n\t\t\t} );\n\n\t\t\tassert.strictEqual(\n\t\t\t\terror.detailedMessage,\n\t\t\t\t\"messages.html['*']\",\n\t\t\t\t'Non-array-like object structure kept for compatibility reasons'\n\t\t\t);\n\n\t\t\terror = wb.api.RepoApiError.newFromApiResponse( {\n\t\t\t\terror: {\n\t\t\t\t\tcode: 'error-code',\n\t\t\t\t\tmessages: [ { html: { '*': \"messages[0].html['*']\" } } ]\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\tassert.strictEqual(\n\t\t\t\terror.detailedMessage,\n\t\t\t\t\"messages[0].html['*']\",\n\t\t\t\t'Array-like object structure with a single message'\n\t\t\t);\n\n\t\t\terror = wb.api.RepoApiError.newFromApiResponse( {\n\t\t\t\terror: { code: 'error-code', messages: [\n\t\t\t\t\t{ html: { '*': \"messages[0].html['*']\" } },\n\t\t\t\t\t{ html: { '*': \"messages[1].html['*']\" } }\n\t\t\t\t] }\n\t\t\t} );\n\n\t\t\tassert.strictEqual(\n\t\t\t\terror.detailedMessage,\n\t\t\t\t\"<ul><li>messages[0].html['*']</li><li>messages[1].html['*']</li></ul>\",\n\t\t\t\t'Array-like object structure with multiple messages'\n\t\t\t);\n\n\t\t\terror = wb.api.RepoApiError.newFromApiResponse( {\n\t\t\t\ttextStatus: 'textStatus', exception: 'exception'\n\t\t\t} );\n\n\t\t\tassert.strictEqual(\n\t\t\t\terror.code,\n\t\t\t\t'textStatus',\n\t\t\t\t'Created error via factory method passing an AJAX exception.'\n\t\t\t);\n\n\t\t\tassert.strictEqual(\n\t\t\t\terror.detailedMessage,\n\t\t\t\t'exception',\n\t\t\t\t'Validated detailed message of error created via factory method passing an AJAX '\n\t\t\t\t+ 'exception.'\n\t\t\t);\n\t\t} );\n\n\tQUnit.test( 'Validate parameterised message for API response, requested with unspecified errorformat',\n\t\t( assert ) => {\n\t\t\tconst expectedMessageKey = 'wikibase-error-ui-no-external-page',\n\t\t\t\tmessageParams = [ 'external-client-parameter', 'page-parameter' ],\n\t\t\t\texpectedMessage = 'some formatted error message with parameters',\n\t\t\t\tmwMsgMock = sinon.stub( mw, 'msg' ).returns( expectedMessage ),\n\t\t\t\terror = wb.api.RepoApiError.newFromApiResponse(\n\t\t\t\t\t{ error: {\n\t\t\t\t\t\tcode: 'no-external-page',\n\t\t\t\t\t\tmessages: [ {\n\t\t\t\t\t\t\tparameters: messageParams\n\t\t\t\t\t\t} ]\n\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t'wbeditentity'\n\t\t\t\t);\n\n\t\t\tassert.true(\n\t\t\t\tmwMsgMock.calledWith( expectedMessageKey, messageParams[ 0 ], messageParams[ 1 ] ),\n\t\t\t\t'Called mw.msg with the correct msgKey and parameters to build the error message.'\n\t\t\t);\n\t\t\tassert.strictEqual(\n\t\t\t\terror.message,\n\t\t\t\texpectedMessage\n\t\t\t);\n\n\t\t\tmwMsgMock.restore();\n\t\t} );\n\n\tQUnit.test( 'Validate errors created via factory method, requested with errorformat=plaintext',\n\t\t( assert ) => {\n\t\t\tlet error = wb.api.RepoApiError.newFromApiResponse( {\n\t\t\t\terrors: [ { code: 'error-code', '*': 'detailed message' } ]\n\t\t\t}\n\t\t\t);\n\n\t\t\tassert.strictEqual(\n\t\t\t\terror.code,\n\t\t\t\t'error-code',\n\t\t\t\t'Created error object via factory method.'\n\t\t\t);\n\n\t\t\tassert.strictEqual(\n\t\t\t\terror.detailedMessage,\n\t\t\t\t'detailed message',\n\t\t\t\t'Validated detailed message of error created via factory method.'\n\t\t\t);\n\n\t\t\terror = wb.api.RepoApiError.newFromApiResponse( {\n\t\t\t\terrors: [ {\n\t\t\t\t\tcode: 'error-code',\n\t\t\t\t\tdata: { messages: { html: { '*': \"messages.html['*']\" } } }\n\t\t\t\t} ]\n\t\t\t}\n\t\t\t);\n\n\t\t\tassert.strictEqual(\n\t\t\t\terror.detailedMessage,\n\t\t\t\t\"messages.html['*']\",\n\t\t\t\t'Non-array-like object structure kept for compatibility reasons'\n\t\t\t);\n\n\t\t\terror = wb.api.RepoApiError.newFromApiResponse( {\n\t\t\t\terrors: [\n\t\t\t\t\t{\n\t\t\t\t\t\tcode: 'error-code',\n\t\t\t\t\t\t'*': 'This is not very nice and will be ignored in favour of the next error.'\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tcode: 'error-code',\n\t\t\t\t\t\tdata: { messages: [\n\t\t\t\t\t\t\t{ html: { '*': \"messages[0].html['*']\" } }\n\t\t\t\t\t\t] }\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t} );\n\n\t\t\tassert.strictEqual(\n\t\t\t\terror.detailedMessage,\n\t\t\t\t\"messages[0].html['*']\",\n\t\t\t\t'Array-like object structure with a single message'\n\t\t\t);\n\n\t\t\terror = wb.api.RepoApiError.newFromApiResponse( {\n\t\t\t\terrors: [\n\t\t\t\t\t{\n\t\t\t\t\t\tcode: 'error-code',\n\t\t\t\t\t\tdata: { messages: [\n\t\t\t\t\t\t\t{ html: { '*': \"messages[0].html['*']\" } },\n\t\t\t\t\t\t\t{ html: { '*': \"messages[1].html['*']\" } }\n\t\t\t\t\t\t] }\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t} );\n\n\t\t\tassert.strictEqual(\n\t\t\t\terror.detailedMessage,\n\t\t\t\t\"<ul><li>messages[0].html['*']</li><li>messages[1].html['*']</li></ul>\",\n\t\t\t\t'Array-like object structure with multiple messages'\n\t\t\t);\n\n\t\t\terror = wb.api.RepoApiError.newFromApiResponse( {\n\t\t\t\ttextStatus: 'textStatus', exception: 'exception'\n\t\t\t} );\n\n\t\t\tassert.strictEqual(\n\t\t\t\terror.code,\n\t\t\t\t'textStatus',\n\t\t\t\t'Created error via factory method passing an AJAX exception.'\n\t\t\t);\n\n\t\t\tassert.strictEqual(\n\t\t\t\terror.detailedMessage,\n\t\t\t\t'exception',\n\t\t\t\t'Validated detailed message of error created via factory method passing an AJAX '\n\t\t\t\t+ 'exception.'\n\t\t\t);\n\t\t} );\n\n\tQUnit.test( 'Validate parameterised message for API response, requested with `errorformat=plaintext`',\n\t\t( assert ) => {\n\t\t\tconst expectedMessageKey = 'wikibase-error-ui-no-external-page',\n\t\t\t\tmessageParams = [ 'external-client-parameter', 'page-parameter' ],\n\t\t\t\texpectedMessage = 'some formatted error message with parameters',\n\t\t\t\tmwMsgMock = sinon.stub( mw, 'msg' ).returns( expectedMessage ),\n\t\t\t\terror = wb.api.RepoApiError.newFromApiResponse(\n\t\t\t\t\t{ errors: [ {\n\t\t\t\t\t\tcode: 'no-external-page',\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\tmessages: [ {\n\t\t\t\t\t\t\t\tparameters: messageParams\n\t\t\t\t\t\t\t} ]\n\t\t\t\t\t\t}\n\t\t\t\t\t} ]\n\t\t\t\t\t},\n\t\t\t\t\t'wbeditentity'\n\t\t\t\t);\n\n\t\t\tassert.true(\n\t\t\t\tmwMsgMock.calledWith( expectedMessageKey, messageParams[ 0 ], messageParams[ 1 ] ),\n\t\t\t\t'calls mw.msg with the correct parameters to build the error message'\n\t\t\t);\n\t\t\tassert.strictEqual(\n\t\t\t\terror.message,\n\t\t\t\texpectedMessage\n\t\t\t);\n\n\t\t\tmwMsgMock.restore();\n\t\t} );\n}( wikibase, QUnit, sinon ) );\n","usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-spacing","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"indent","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multi-spaces","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"spaced-comment","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"wrap-iife","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/tests/mediaWiki.mock.js","messages":[],"suppressedMessages":[{"ruleId":"no-implicit-globals","severity":2,"message":"Unexpected assignment to read-only global variable.","line":2,"column":1,"nodeType":"AssignmentExpression","messageId":"assignmentToReadonlyGlobal","endLine":28,"endColumn":2,"suppressions":[{"kind":"directive","justification":""}]},{"ruleId":"no-global-assign","severity":2,"message":"Read-only global 'mw' should not be modified.","line":2,"column":1,"nodeType":"Identifier","messageId":"globalShouldNotBeModified","endLine":2,"endColumn":3,"suppressions":[{"kind":"directive","justification":""}]}],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-spacing","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"indent","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multi-spaces","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"spaced-comment","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"wrap-iife","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]}]

--- end ---
Disabling eslint rule 'no-jquery/no-done-fail' (broken in .eslintrc.json) on .eslintrc.json
Disabling eslint rule 'no-jquery/no-done-fail' (broken in .eslintrc.json) on .eslintrc.json
$ /usr/bin/npm ci
--- stderr ---
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated phantomjs-prebuilt@2.1.16: this package is now deprecated
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated puppeteer@5.5.0: Version no longer supported. Upgrade to @latest
--- stdout ---

added 442 packages, and audited 443 packages in 16s

67 packages are looking for funding
  run `npm fund` for details

3 moderate severity vulnerabilities

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.

--- end ---
$ /usr/bin/npm test
--- stdout ---

> wikibase-api@3.1.1 test
> grunt test

Running "eslint:all" (eslint) task

/src/repo/src/FormatValueCaller.js
  15:1  warning  The type 'dataTypes' is undefined   jsdoc/no-undefined-types
  31:1  warning  The type 'dataTypes' is undefined   jsdoc/no-undefined-types
  41:1  warning  The type 'dataValues' is undefined  jsdoc/no-undefined-types
  83:4  warning  Prefer .then to .done               no-jquery/no-done-fail
  83:4  warning  Prefer .then to .fail               no-jquery/no-done-fail

/src/repo/src/ParseValueCaller.js
  50:4  warning  Prefer .then to .done  no-jquery/no-done-fail
  50:4  warning  Prefer .then to .fail  no-jquery/no-done-fail

/src/repo/src/RepoApi.js
   25:1  warning  The type 'mediaWiki' is undefined  jsdoc/no-undefined-types
   43:1  warning  The type 'mediaWiki' is undefined  jsdoc/no-undefined-types
   68:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  103:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  149:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  197:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  245:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  294:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  329:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  371:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  415:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  459:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  496:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  538:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  584:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  649:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  681:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types

/src/repo/src/getLocationAgnosticMwApi.js
  33:1  warning  The type 'mediaWiki' is undefined  jsdoc/no-undefined-types

/src/repo/tests/RepoApi.tests.js
  2:1  warning  Missing JSDoc @param "wb" type     jsdoc/require-param-type
  3:1  warning  Missing JSDoc @param "QUnit" type  jsdoc/require-param-type
  4:1  warning  Missing JSDoc @param "sinon" type  jsdoc/require-param-type

/src/repo/tests/RepoApiError.tests.js
  2:1  warning  Missing JSDoc @param "wb" type     jsdoc/require-param-type
  3:1  warning  Missing JSDoc @param "QUnit" type  jsdoc/require-param-type
  4:1  warning  Missing JSDoc @param "sinon" type  jsdoc/require-param-type

✖ 31 problems (0 errors, 31 warnings)


Running "qunit:all" (qunit) task
Testing tests/index.html Failed to load resource: net::ERR_FILE_NOT_FOUND
.......................OK
>> 23 tests completed with 0 failed, 0 skipped, and 0 todo. 
>> 215 assertions (in 69ms), passed: 215, failed: 0

Done.

--- end ---
$ /usr/bin/npm audit --json
--- stdout ---
{
  "auditReportVersion": 2,
  "vulnerabilities": {
    "phantomjs-prebuilt": {
      "name": "phantomjs-prebuilt",
      "severity": "moderate",
      "isDirect": true,
      "via": [
        "request"
      ],
      "effects": [],
      "range": "*",
      "nodes": [
        "node_modules/phantomjs-prebuilt"
      ],
      "fixAvailable": false
    },
    "request": {
      "name": "request",
      "severity": "moderate",
      "isDirect": false,
      "via": [
        {
          "source": 1096727,
          "name": "request",
          "dependency": "request",
          "title": "Server-Side Request Forgery in Request",
          "url": "https://github.com/advisories/GHSA-p8p7-x288-28g6",
          "severity": "moderate",
          "cwe": [
            "CWE-918"
          ],
          "cvss": {
            "score": 6.1,
            "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
          },
          "range": "<=2.88.2"
        },
        "tough-cookie"
      ],
      "effects": [
        "phantomjs-prebuilt"
      ],
      "range": "*",
      "nodes": [
        "node_modules/request"
      ],
      "fixAvailable": false
    },
    "tough-cookie": {
      "name": "tough-cookie",
      "severity": "moderate",
      "isDirect": false,
      "via": [
        {
          "source": 1097682,
          "name": "tough-cookie",
          "dependency": "tough-cookie",
          "title": "tough-cookie Prototype Pollution vulnerability",
          "url": "https://github.com/advisories/GHSA-72xf-g2v4-qvf3",
          "severity": "moderate",
          "cwe": [
            "CWE-1321"
          ],
          "cvss": {
            "score": 6.5,
            "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N"
          },
          "range": "<4.1.3"
        }
      ],
      "effects": [
        "request"
      ],
      "range": "<4.1.3",
      "nodes": [
        "node_modules/tough-cookie"
      ],
      "fixAvailable": false
    }
  },
  "metadata": {
    "vulnerabilities": {
      "info": 0,
      "low": 0,
      "moderate": 3,
      "high": 0,
      "critical": 0,
      "total": 3
    },
    "dependencies": {
      "prod": 3,
      "dev": 440,
      "optional": 2,
      "peer": 1,
      "peerOptional": 0,
      "total": 442
    }
  }
}

--- end ---
Attempting to npm audit fix
$ /usr/bin/npm audit fix --dry-run --only=dev --json
--- stderr ---
npm WARN invalid config only="dev" set in command line options
npm WARN invalid config Must be one of: null, prod, production
--- stdout ---
{
  "added": 0,
  "removed": 0,
  "changed": 0,
  "audited": 443,
  "funding": 67,
  "audit": {
    "auditReportVersion": 2,
    "vulnerabilities": {
      "phantomjs-prebuilt": {
        "name": "phantomjs-prebuilt",
        "severity": "moderate",
        "isDirect": true,
        "via": [
          "request"
        ],
        "effects": [],
        "range": "*",
        "nodes": [
          "node_modules/phantomjs-prebuilt"
        ],
        "fixAvailable": false
      },
      "request": {
        "name": "request",
        "severity": "moderate",
        "isDirect": false,
        "via": [
          {
            "source": 1096727,
            "name": "request",
            "dependency": "request",
            "title": "Server-Side Request Forgery in Request",
            "url": "https://github.com/advisories/GHSA-p8p7-x288-28g6",
            "severity": "moderate",
            "cwe": [
              "CWE-918"
            ],
            "cvss": {
              "score": 6.1,
              "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
            },
            "range": "<=2.88.2"
          },
          "tough-cookie"
        ],
        "effects": [
          "phantomjs-prebuilt"
        ],
        "range": "*",
        "nodes": [
          "node_modules/request"
        ],
        "fixAvailable": false
      },
      "tough-cookie": {
        "name": "tough-cookie",
        "severity": "moderate",
        "isDirect": false,
        "via": [
          {
            "source": 1097682,
            "name": "tough-cookie",
            "dependency": "tough-cookie",
            "title": "tough-cookie Prototype Pollution vulnerability",
            "url": "https://github.com/advisories/GHSA-72xf-g2v4-qvf3",
            "severity": "moderate",
            "cwe": [
              "CWE-1321"
            ],
            "cvss": {
              "score": 6.5,
              "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N"
            },
            "range": "<4.1.3"
          }
        ],
        "effects": [
          "request"
        ],
        "range": "<4.1.3",
        "nodes": [
          "node_modules/tough-cookie"
        ],
        "fixAvailable": false
      }
    },
    "metadata": {
      "vulnerabilities": {
        "info": 0,
        "low": 0,
        "moderate": 3,
        "high": 0,
        "critical": 0,
        "total": 3
      },
      "dependencies": {
        "prod": 3,
        "dev": 440,
        "optional": 2,
        "peer": 1,
        "peerOptional": 0,
        "total": 442
      }
    }
  }
}

--- end ---
{"added": 0, "removed": 0, "changed": 0, "audited": 443, "funding": 67, "audit": {"auditReportVersion": 2, "vulnerabilities": {"phantomjs-prebuilt": {"name": "phantomjs-prebuilt", "severity": "moderate", "isDirect": true, "via": ["request"], "effects": [], "range": "*", "nodes": ["node_modules/phantomjs-prebuilt"], "fixAvailable": false}, "request": {"name": "request", "severity": "moderate", "isDirect": false, "via": [{"source": 1096727, "name": "request", "dependency": "request", "title": "Server-Side Request Forgery in Request", "url": "https://github.com/advisories/GHSA-p8p7-x288-28g6", "severity": "moderate", "cwe": ["CWE-918"], "cvss": {"score": 6.1, "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"}, "range": "<=2.88.2"}, "tough-cookie"], "effects": ["phantomjs-prebuilt"], "range": "*", "nodes": ["node_modules/request"], "fixAvailable": false}, "tough-cookie": {"name": "tough-cookie", "severity": "moderate", "isDirect": false, "via": [{"source": 1097682, "name": "tough-cookie", "dependency": "tough-cookie", "title": "tough-cookie Prototype Pollution vulnerability", "url": "https://github.com/advisories/GHSA-72xf-g2v4-qvf3", "severity": "moderate", "cwe": ["CWE-1321"], "cvss": {"score": 6.5, "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N"}, "range": "<4.1.3"}], "effects": ["request"], "range": "<4.1.3", "nodes": ["node_modules/tough-cookie"], "fixAvailable": false}}, "metadata": {"vulnerabilities": {"info": 0, "low": 0, "moderate": 3, "high": 0, "critical": 0, "total": 3}, "dependencies": {"prod": 3, "dev": 440, "optional": 2, "peer": 1, "peerOptional": 0, "total": 442}}}}
$ /usr/bin/npm audit fix --only=dev
--- stderr ---
npm WARN invalid config only="dev" set in command line options
npm WARN invalid config Must be one of: null, prod, production
--- stdout ---

up to date, audited 443 packages in 1s

67 packages are looking for funding
  run `npm fund` for details

# npm audit report

request  *
Severity: moderate
Server-Side Request Forgery in Request - https://github.com/advisories/GHSA-p8p7-x288-28g6
Depends on vulnerable versions of tough-cookie
No fix available
node_modules/request
  phantomjs-prebuilt  *
  Depends on vulnerable versions of request
  node_modules/phantomjs-prebuilt

tough-cookie  <4.1.3
Severity: moderate
tough-cookie Prototype Pollution vulnerability - https://github.com/advisories/GHSA-72xf-g2v4-qvf3
No fix available
node_modules/tough-cookie

3 moderate severity vulnerabilities

Some issues need review, and may require choosing
a different dependency.

--- end ---
Verifying that tests still pass
$ /usr/bin/npm ci
--- stderr ---
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated phantomjs-prebuilt@2.1.16: this package is now deprecated
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated puppeteer@5.5.0: Version no longer supported. Upgrade to @latest
--- stdout ---

added 442 packages, and audited 443 packages in 15s

67 packages are looking for funding
  run `npm fund` for details

3 moderate severity vulnerabilities

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.

--- end ---
$ /usr/bin/npm test
--- stdout ---

> wikibase-api@3.1.1 test
> grunt test

Running "eslint:all" (eslint) task

/src/repo/src/FormatValueCaller.js
  15:1  warning  The type 'dataTypes' is undefined   jsdoc/no-undefined-types
  31:1  warning  The type 'dataTypes' is undefined   jsdoc/no-undefined-types
  41:1  warning  The type 'dataValues' is undefined  jsdoc/no-undefined-types
  83:4  warning  Prefer .then to .done               no-jquery/no-done-fail
  83:4  warning  Prefer .then to .fail               no-jquery/no-done-fail

/src/repo/src/ParseValueCaller.js
  50:4  warning  Prefer .then to .done  no-jquery/no-done-fail
  50:4  warning  Prefer .then to .fail  no-jquery/no-done-fail

/src/repo/src/RepoApi.js
   25:1  warning  The type 'mediaWiki' is undefined  jsdoc/no-undefined-types
   43:1  warning  The type 'mediaWiki' is undefined  jsdoc/no-undefined-types
   68:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  103:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  149:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  197:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  245:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  294:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  329:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  371:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  415:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  459:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  496:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  538:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  584:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  649:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  681:1  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types

/src/repo/src/getLocationAgnosticMwApi.js
  33:1  warning  The type 'mediaWiki' is undefined  jsdoc/no-undefined-types

/src/repo/tests/RepoApi.tests.js
  2:1  warning  Missing JSDoc @param "wb" type     jsdoc/require-param-type
  3:1  warning  Missing JSDoc @param "QUnit" type  jsdoc/require-param-type
  4:1  warning  Missing JSDoc @param "sinon" type  jsdoc/require-param-type

/src/repo/tests/RepoApiError.tests.js
  2:1  warning  Missing JSDoc @param "wb" type     jsdoc/require-param-type
  3:1  warning  Missing JSDoc @param "QUnit" type  jsdoc/require-param-type
  4:1  warning  Missing JSDoc @param "sinon" type  jsdoc/require-param-type

✖ 31 problems (0 errors, 31 warnings)


Running "qunit:all" (qunit) task
Testing tests/index.html Failed to load resource: net::ERR_FILE_NOT_FOUND
.......................OK
>> 23 tests completed with 0 failed, 0 skipped, and 0 todo. 
>> 215 assertions (in 62ms), passed: 215, failed: 0

Done.

--- end ---
$ package-lock-lint package-lock.json
--- stdout ---
Checking package-lock.json

--- end ---
build: Updating eslint-config-wikimedia to 0.29.1

The following rules are failing and were disabled:
* no-jquery/no-done-fail

$ git add .
--- stdout ---

--- end ---
$ git commit -F /tmp/tmpw3sghdg6
--- stdout ---
[master 0ea9b1e] build: Updating eslint-config-wikimedia to 0.29.1
 10 files changed, 108 insertions(+), 104 deletions(-)

--- end ---
$ git format-patch HEAD~1 --stdout
--- stdout ---
From 0ea9b1e68fbbdd2c776db4924d8810c1b613f147 Mon Sep 17 00:00:00 2001
From: libraryupgrader <tools.libraryupgrader@tools.wmflabs.org>
Date: Mon, 31 Mar 2025 09:43:54 +0000
Subject: [PATCH] build: Updating eslint-config-wikimedia to 0.29.1

The following rules are failing and were disabled:
* no-jquery/no-done-fail

Change-Id: I98705ea23130da4e9a5fcb42233f9a7bbbe89570
---
 .eslintrc.json                  |  3 +-
 package-lock.json               | 33 +++++++-------
 package.json                    |  2 +-
 src/FormatValueCaller.js        | 10 ++---
 src/ParseValueCaller.js         | 16 +++----
 src/RepoApi.js                  | 32 +++++++-------
 src/RepoApiError.js             | 14 +++---
 src/getLocationAgnosticMwApi.js |  4 +-
 tests/RepoApi.tests.js          | 78 ++++++++++++++++-----------------
 tests/RepoApiError.tests.js     | 20 ++++-----
 10 files changed, 108 insertions(+), 104 deletions(-)

diff --git a/.eslintrc.json b/.eslintrc.json
index 042bd3c..3c0a780 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -18,6 +18,7 @@
 		"jsdoc/newline-after-description": "off",
 		"jsdoc/require-returns": "off",
 		"jsdoc/require-returns-check": "off",
-		"no-jquery/no-extend": "warn"
+		"no-jquery/no-extend": "warn",
+		"no-jquery/no-done-fail": "warn"
 	}
 }
diff --git a/package-lock.json b/package-lock.json
index ccb9fe2..52f9c24 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -13,7 +13,7 @@
 				"wikibase-data-values": "^0.10.0"
 			},
 			"devDependencies": {
-				"eslint-config-wikimedia": "0.28.2",
+				"eslint-config-wikimedia": "0.29.1",
 				"grunt": "1.6.1",
 				"grunt-contrib-qunit": "^5.1.0",
 				"grunt-eslint": "24.3.0",
@@ -1337,9 +1337,9 @@
 			}
 		},
 		"node_modules/eslint-config-wikimedia": {
-			"version": "0.28.2",
-			"resolved": "https://registry.npmjs.org/eslint-config-wikimedia/-/eslint-config-wikimedia-0.28.2.tgz",
-			"integrity": "sha512-5+rdnT7wH1gpKAO6tHYThg78eMhZMruJzvqku3Y5iaEY/A7kSKLFpA/vOj/snys9fKjDHC9BXmArQh+agkOoJQ==",
+			"version": "0.29.1",
+			"resolved": "https://registry.npmjs.org/eslint-config-wikimedia/-/eslint-config-wikimedia-0.29.1.tgz",
+			"integrity": "sha512-4dbL5o3hKGSvreyrGZWLPoTDLFubZ575IQOPhUaTcpbTsi0u05TBEMsOyYkthTaK21vsFQqhSYtxp/xU93BSdA==",
 			"dev": true,
 			"dependencies": {
 				"browserslist-config-wikimedia": "^0.7.0",
@@ -1352,13 +1352,16 @@
 				"eslint-plugin-mediawiki": "^0.7.0",
 				"eslint-plugin-mocha": "^10.4.3",
 				"eslint-plugin-n": "^17.7.0",
-				"eslint-plugin-no-jquery": "^3.0.1",
+				"eslint-plugin-no-jquery": "^3.1.1",
 				"eslint-plugin-qunit": "^8.1.1",
 				"eslint-plugin-security": "^1.7.1",
 				"eslint-plugin-unicorn": "^53.0.0",
 				"eslint-plugin-vue": "^9.26.0",
 				"eslint-plugin-wdio": "^8.24.12",
 				"eslint-plugin-yml": "^1.14.0"
+			},
+			"engines": {
+				"node": ">=18 <23"
 			}
 		},
 		"node_modules/eslint-plugin-compat": {
@@ -1617,9 +1620,9 @@
 			}
 		},
 		"node_modules/eslint-plugin-no-jquery": {
-			"version": "3.0.2",
-			"resolved": "https://registry.npmjs.org/eslint-plugin-no-jquery/-/eslint-plugin-no-jquery-3.0.2.tgz",
-			"integrity": "sha512-n/+6p6PFhWDNPVLJj1463hw4OTIRBbROGcbhmtOHTgw7yihSKzkwZiQ00EJTneyeR3jRiw5lpWSMCCBhtb8t2g==",
+			"version": "3.1.1",
+			"resolved": "https://registry.npmjs.org/eslint-plugin-no-jquery/-/eslint-plugin-no-jquery-3.1.1.tgz",
+			"integrity": "sha512-LTLO3jH/Tjr1pmxCEqtV6qmt+OChv8La4fwgG470JRpgxyFF4NOzoC9CRy92GIWD3Yjl0qLEgPmD2FLQWcNEjg==",
 			"dev": true,
 			"peerDependencies": {
 				"eslint": ">=8.0.0"
@@ -6103,9 +6106,9 @@
 			}
 		},
 		"eslint-config-wikimedia": {
-			"version": "0.28.2",
-			"resolved": "https://registry.npmjs.org/eslint-config-wikimedia/-/eslint-config-wikimedia-0.28.2.tgz",
-			"integrity": "sha512-5+rdnT7wH1gpKAO6tHYThg78eMhZMruJzvqku3Y5iaEY/A7kSKLFpA/vOj/snys9fKjDHC9BXmArQh+agkOoJQ==",
+			"version": "0.29.1",
+			"resolved": "https://registry.npmjs.org/eslint-config-wikimedia/-/eslint-config-wikimedia-0.29.1.tgz",
+			"integrity": "sha512-4dbL5o3hKGSvreyrGZWLPoTDLFubZ575IQOPhUaTcpbTsi0u05TBEMsOyYkthTaK21vsFQqhSYtxp/xU93BSdA==",
 			"dev": true,
 			"requires": {
 				"browserslist-config-wikimedia": "^0.7.0",
@@ -6118,7 +6121,7 @@
 				"eslint-plugin-mediawiki": "^0.7.0",
 				"eslint-plugin-mocha": "^10.4.3",
 				"eslint-plugin-n": "^17.7.0",
-				"eslint-plugin-no-jquery": "^3.0.1",
+				"eslint-plugin-no-jquery": "^3.1.1",
 				"eslint-plugin-qunit": "^8.1.1",
 				"eslint-plugin-security": "^1.7.1",
 				"eslint-plugin-unicorn": "^53.0.0",
@@ -6292,9 +6295,9 @@
 			}
 		},
 		"eslint-plugin-no-jquery": {
-			"version": "3.0.2",
-			"resolved": "https://registry.npmjs.org/eslint-plugin-no-jquery/-/eslint-plugin-no-jquery-3.0.2.tgz",
-			"integrity": "sha512-n/+6p6PFhWDNPVLJj1463hw4OTIRBbROGcbhmtOHTgw7yihSKzkwZiQ00EJTneyeR3jRiw5lpWSMCCBhtb8t2g==",
+			"version": "3.1.1",
+			"resolved": "https://registry.npmjs.org/eslint-plugin-no-jquery/-/eslint-plugin-no-jquery-3.1.1.tgz",
+			"integrity": "sha512-LTLO3jH/Tjr1pmxCEqtV6qmt+OChv8La4fwgG470JRpgxyFF4NOzoC9CRy92GIWD3Yjl0qLEgPmD2FLQWcNEjg==",
 			"dev": true,
 			"requires": {}
 		},
diff --git a/package.json b/package.json
index 96319f0..6366780 100644
--- a/package.json
+++ b/package.json
@@ -28,7 +28,7 @@
 		"wikibase-data-values": "^0.10.0"
 	},
 	"devDependencies": {
-		"eslint-config-wikimedia": "0.28.2",
+		"eslint-config-wikimedia": "0.29.1",
 		"grunt": "1.6.1",
 		"grunt-contrib-qunit": "^5.1.0",
 		"grunt-eslint": "24.3.0",
diff --git a/src/FormatValueCaller.js b/src/FormatValueCaller.js
index c293d09..ade4565 100644
--- a/src/FormatValueCaller.js
+++ b/src/FormatValueCaller.js
@@ -1,7 +1,7 @@
 ( function ( wb ) {
 	'use strict';
 
-	var MODULE = wb.api;
+	const MODULE = wb.api;
 
 	/**
 	 * @class wikibase.api.FormatValueCaller
@@ -14,7 +14,7 @@
 	 * @param {wikibase.api.RepoApi} api
 	 * @param {dataTypes.DataTypeStore} dataTypeStore
 	 */
-	var SELF = MODULE.FormatValueCaller = function WbApiFormatValueCaller( api, dataTypeStore ) {
+	const SELF = MODULE.FormatValueCaller = function WbApiFormatValueCaller( api, dataTypeStore ) {
 		this._api = api;
 		this._dataTypeStore = dataTypeStore;
 	};
@@ -78,7 +78,7 @@
 				}
 			}
 
-			var deferred = $.Deferred();
+			const deferred = $.Deferred();
 
 			this._api.formatValue(
 				{
@@ -89,7 +89,7 @@
 				dataType,
 				outputFormat,
 				propertyId
-			).done( function ( apiResult ) {
+			).done( ( apiResult ) => {
 				if ( apiResult.result ) {
 					deferred.resolve( apiResult.result );
 				} else {
@@ -98,7 +98,7 @@
 						'The formatter API returned an unexpected result'
 					) );
 				}
-			} ).fail( function ( errorCode, error ) {
+			} ).fail( ( errorCode, error ) => {
 				deferred.reject( wb.api.RepoApiError.newFromApiResponse( error ) );
 			} );
 
diff --git a/src/ParseValueCaller.js b/src/ParseValueCaller.js
index 40569a0..a235abf 100644
--- a/src/ParseValueCaller.js
+++ b/src/ParseValueCaller.js
@@ -1,7 +1,7 @@
 ( function ( wb ) {
 	'use strict';
 
-	var MODULE = wb.api;
+	const MODULE = wb.api;
 
 	/**
 	 * Provides functionality to parse a value using the API.
@@ -16,7 +16,7 @@
 	 *
 	 * @param {wikibase.api.RepoApi} api
 	 */
-	var SELF = MODULE.ParseValueCaller = function WbApiParseValueCaller( api ) {
+	const SELF = MODULE.ParseValueCaller = function WbApiParseValueCaller( api ) {
 		this._api = api;
 	};
 
@@ -43,11 +43,11 @@
 		 * @return {wikibase.api.RepoApiError} return.fail.error
 		 */
 		parseValues: function ( parser, values, options ) {
-			var deferred = $.Deferred();
+			const deferred = $.Deferred();
 
 			options = options || {};
 
-			this._api.parseValue( parser, values, options ).done( function ( response ) {
+			this._api.parseValue( parser, values, options ).done( ( response ) => {
 				if ( !response.results ) {
 					deferred.reject( new wb.api.RepoApiError(
 						'result-unexpected',
@@ -56,10 +56,10 @@
 					return;
 				}
 
-				var dataValuesSerializations = [];
+				const dataValuesSerializations = [];
 
-				for ( var i in response.results ) {
-					var result = response.results[ i ];
+				for ( const i in response.results ) {
+					const result = response.results[ i ];
 
 					if ( result.error ) {
 						// This is a really strange error format, and it's not supported by
@@ -88,7 +88,7 @@
 
 				deferred.resolve( dataValuesSerializations );
 
-			} ).fail( function ( errorCode, error ) {
+			} ).fail( ( errorCode, error ) => {
 				deferred.reject( wb.api.RepoApiError.newFromApiResponse( error ) );
 			} );
 
diff --git a/src/RepoApi.js b/src/RepoApi.js
index 3e73aa1..af77d22 100644
--- a/src/RepoApi.js
+++ b/src/RepoApi.js
@@ -1,7 +1,7 @@
 ( function ( wb ) {
 	'use strict';
 
-	var MODULE = wb.api;
+	const MODULE = wb.api;
 
 	/**
 	 * Constructor to create an API object for interaction with the repo Wikibase API.
@@ -28,7 +28,7 @@
 	 *
 	 * @throws {Error} if no `mediaWiki.Api` instance is provided.
 	 */
-	var SELF = MODULE.RepoApi = function WbApiRepoApi( api, uselang, tags ) {
+	const SELF = MODULE.RepoApi = function WbApiRepoApi( api, uselang, tags ) {
 		if ( api === undefined ) {
 			throw new Error( 'mediaWiki.Api instance needs to be provided' );
 		}
@@ -77,7 +77,7 @@
 				throw new Error( 'Parameter not specified properly' );
 			}
 
-			var params = {
+			const params = {
 				action: 'wbeditentity',
 				new: type,
 				data: JSON.stringify( data || {} )
@@ -117,7 +117,7 @@
 				throw new Error( 'Parameter not specified properly' );
 			}
 
-			var params = {
+			const params = {
 				action: 'wbeditentity',
 				id: id,
 				baserevid: baseRevId,
@@ -164,7 +164,7 @@
 				throw new Error( 'Parameter not specified properly' );
 			}
 
-			var params = {
+			const params = {
 				action: 'wbformatvalue',
 				datavalue: JSON.stringify( dataValue )
 			};
@@ -210,7 +210,7 @@
 				throw new Error( 'Parameter not specified properly' );
 			}
 
-			var params = {
+			const params = {
 				action: 'wbgetentities',
 				ids: this.normalizeMultiValue( ids )
 			};
@@ -264,7 +264,7 @@
 				throw new Error( 'sites and titles may not be passed as arrays at the same time' );
 			}
 
-			var params = {
+			const params = {
 				action: 'wbgetentities',
 				sites: this.normalizeMultiValue( sites ),
 				titles: this.normalizeMultiValue( titles ),
@@ -307,7 +307,7 @@
 				throw new Error( 'Parameter not specified properly' );
 			}
 
-			var params = {
+			const params = {
 				action: 'wbparsevalue',
 				parser: parser,
 				values: this.normalizeMultiValue( values )
@@ -343,7 +343,7 @@
 				throw new Error( 'Parameter not specified properly' );
 			}
 
-			var params = {
+			const params = {
 				action: 'wbsetlabel',
 				id: id,
 				value: label,
@@ -385,7 +385,7 @@
 				throw new Error( 'Parameter not specified properly' );
 			}
 
-			var params = {
+			const params = {
 				action: 'wbsetdescription',
 				id: id,
 				value: description,
@@ -430,7 +430,7 @@
 				throw new Error( 'Parameter not specified properly' );
 			}
 
-			var params = {
+			const params = {
 				action: 'wbsetaliases',
 				id: id,
 				add: this.normalizeMultiValue( add ),
@@ -468,7 +468,7 @@
 				throw new Error( 'Parameter not specified properly' );
 			}
 
-			var params = {
+			const params = {
 				action: 'wbsetclaim',
 				claim: JSON.stringify( claim ),
 				baserevid: baseRevId
@@ -508,7 +508,7 @@
 				throw new Error( 'Parameter not specified properly' );
 			}
 
-			var params = {
+			const params = {
 				action: 'wbremoveclaims',
 				claim: claimGuid
 			};
@@ -552,7 +552,7 @@
 				throw new Error( 'Parameter not specified properly' );
 			}
 
-			var params = {
+			const params = {
 				action: 'wbsetsitelink',
 				id: id,
 				linksite: site,
@@ -599,7 +599,7 @@
 				throw new Error( 'Parameter not specified properly' );
 			}
 
-			var params = {
+			const params = {
 				action: 'wbmergeitems',
 				fromid: fromId,
 				toid: toId
@@ -712,7 +712,7 @@
 				params.uselang = this._uselang;
 			}
 
-			Object.keys( params ).forEach( function ( key ) {
+			Object.keys( params ).forEach( ( key ) => {
 				if ( key === undefined || params[ key ] === null ) {
 					throw new Error( 'Parameter "' + key + '" is not specified properly.' );
 				}
diff --git a/src/RepoApiError.js b/src/RepoApiError.js
index a2ee34d..228e5d7 100644
--- a/src/RepoApiError.js
+++ b/src/RepoApiError.js
@@ -1,7 +1,7 @@
 ( function ( wb ) {
 	'use strict';
 
-	var MODULE = wb.api;
+	const MODULE = wb.api;
 
 	/**
 	 * Wikibase Repo API Error.
@@ -20,7 +20,7 @@
 	 * @param {string} [action] Generic API action (e.g. "save" or "cancel") used to determine a
 	 *        specific message.
 	 */
-	var SELF = MODULE.RepoApiError = function WbRepoApiError(
+	const SELF = MODULE.RepoApiError = function WbRepoApiError(
 		code,
 		detailedMessage,
 		parameters,
@@ -68,7 +68,7 @@
 			 * @return {string}
 			 */
 			getMessage: function ( parameters ) {
-				var msgKey = this.API_ERROR_MESSAGE[ this.code ];
+				let msgKey = this.API_ERROR_MESSAGE[ this.code ];
 
 				if ( !msgKey || typeof msgKey !== 'string' ) {
 					if ( msgKey && this.action && msgKey[ this.action ] ) {
@@ -98,7 +98,7 @@
 	 * @return {wikibase.api.RepoApiError}
 	 */
 	SELF.newFromApiResponse = function ( details, apiAction ) {
-		var errorCode = '',
+		let errorCode = '',
 			parameters = [],
 			detailedMessage = '';
 
@@ -116,7 +116,7 @@
 			}
 		} else if ( details.errors ) {
 			// API response, when 'errorformat=plaintext' was requested
-			var preferredError = 0,
+			let preferredError = 0,
 				curError, i;
 
 			// If we have multiple errors, report the nicest formatted one.
@@ -155,8 +155,8 @@
 	function messagesObjectToHtml( messages ) {
 		// Can't use length, it's not an array!
 		if ( messages[ 1 ] && messages[ 1 ].html ) {
-			var html = '<ul>';
-			for ( var i = 0; messages[ i ]; i++ ) {
+			let html = '<ul>';
+			for ( let i = 0; messages[ i ]; i++ ) {
 				html += '<li>' + messages[ i ].html[ '*' ] + '</li>';
 			}
 			return html + '</ul>';
diff --git a/src/getLocationAgnosticMwApi.js b/src/getLocationAgnosticMwApi.js
index 1b1ccda..2520080 100644
--- a/src/getLocationAgnosticMwApi.js
+++ b/src/getLocationAgnosticMwApi.js
@@ -13,7 +13,7 @@
 			url = location.protocol + url;
 		}
 
-		var parser = document.createElement( 'A' );
+		const parser = document.createElement( 'A' );
 		parser.href = url;
 		return parser.host;
 	}
@@ -38,7 +38,7 @@
 			return new mw.ForeignApi( apiEndpoint, options );
 		}
 
-		var mwApiOptions = Object.assign( {}, options, {
+		const mwApiOptions = Object.assign( {}, options, {
 			ajax: {
 				url: apiEndpoint
 			}
diff --git a/tests/RepoApi.tests.js b/tests/RepoApi.tests.js
index e68d212..8da141b 100644
--- a/tests/RepoApi.tests.js
+++ b/tests/RepoApi.tests.js
@@ -23,7 +23,7 @@
  * @return {Object}
  */
 	function mockApi( getOrPost, tags ) {
-		var api = {
+		const api = {
 				postWithToken: function () {},
 				get: function () {}
 			},
@@ -59,8 +59,8 @@
 		return getParams( spy, callIndex || 0 )[ paramName ];
 	}
 
-	QUnit.test( 'createEntity()', function ( assert ) {
-		var mock = mockApi();
+	QUnit.test( 'createEntity()', ( assert ) => {
+		const mock = mockApi();
 
 		mock.api.createEntity( 'item' );
 		mock.api.createEntity( 'property', { 'I am': 'data' } );
@@ -96,8 +96,8 @@
 		assert.strictEqual( getParam( mock.spy, 'tags' ), '\x1fa\x1fb' );
 	} );
 
-	QUnit.test( 'editEntity()', function ( assert ) {
-		var mock = mockApi();
+	QUnit.test( 'editEntity()', ( assert ) => {
+		const mock = mockApi();
 
 		mock.api.editEntity( 'entity id', 12345, { 'I am': 'entity data' }, true );
 
@@ -118,8 +118,8 @@
 		assert.strictEqual( getParam( mock.spy, 'tags' ), '\x1fa\x1fb' );
 	} );
 
-	QUnit.test( 'formatValue()', function ( assert ) {
-		var mock = mockApi( 'get' );
+	QUnit.test( 'formatValue()', ( assert ) => {
+		const mock = mockApi( 'get' );
 
 		mock.api.formatValue(
 			{ 'I am': 'DataValue serialization' },
@@ -183,8 +183,8 @@
 		assert.strictEqual( getParam( mock.spy, 'property', 2 ), 'property id' );
 	} );
 
-	QUnit.test( 'getEntities()', function ( assert ) {
-		var mock = mockApi( 'get' );
+	QUnit.test( 'getEntities()', ( assert ) => {
+		const mock = mockApi( 'get' );
 
 		mock.api.getEntities(
 			[ 'entity id 1', 'entity id 2' ],
@@ -223,8 +223,8 @@
 		assert.strictEqual( getParam( mock.spy, 'languages', 2 ), undefined );
 	} );
 
-	QUnit.test( 'getEntitiesByPage()', function ( assert ) {
-		var mock = mockApi( 'get' );
+	QUnit.test( 'getEntitiesByPage()', ( assert ) => {
+		const mock = mockApi( 'get' );
 
 		mock.api.getEntitiesByPage(
 			[ 'site id 1', 'site id 2' ],
@@ -301,8 +301,8 @@
 		assert.strictEqual( getParam( mock.spy, 'normalize', 5 ), undefined );
 	} );
 
-	QUnit.test( 'parseValue()', function ( assert ) {
-		var mock = mockApi( 'get' );
+	QUnit.test( 'parseValue()', ( assert ) => {
+		const mock = mockApi( 'get' );
 
 		mock.api.parseValue(
 			'parser id',
@@ -335,11 +335,11 @@
 		assert.strictEqual( getParam( mock.spy, 'options', 1 ), undefined );
 	} );
 
-	QUnit.test( 'setLabel(), setDescription()', function ( assert ) {
-		var subjects = [ 'Label', 'Description' ];
+	QUnit.test( 'setLabel(), setDescription()', ( assert ) => {
+		const subjects = [ 'Label', 'Description' ];
 
-		for ( var i = 0; i < subjects.length; i++ ) {
-			var mock = mockApi();
+		for ( let i = 0; i < subjects.length; i++ ) {
+			const mock = mockApi();
 
 			mock.api[ 'set' + subjects[ i ] ]( 'entity id', 12345, 'text', 'language code' );
 
@@ -360,8 +360,8 @@
 		}
 	} );
 
-	QUnit.test( 'setAliases()', function ( assert ) {
-		var mock = mockApi();
+	QUnit.test( 'setAliases()', ( assert ) => {
+		const mock = mockApi();
 
 		mock.api.setAliases(
 			'entity id', 12345, [ 'alias1', 'alias2' ], [ 'alias-remove with p|pe' ], 'language code'
@@ -386,8 +386,8 @@
 		assert.strictEqual( getParam( mock.spy, 'returnto' ), 'currentPage' );
 	} );
 
-	QUnit.test( 'setClaim()', function ( assert ) {
-		var mock = mockApi();
+	QUnit.test( 'setClaim()', ( assert ) => {
+		const mock = mockApi();
 
 		mock.api.setClaim( { 'I am': 'a Claim serialization' }, 12345, 67890 );
 		mock.api.setClaim( { 'I am': 'a Claim serialization' }, 12345 );
@@ -419,8 +419,8 @@
 		assert.strictEqual( getParam( mock.spy, 'index', 1 ), undefined );
 	} );
 
-	QUnit.test( 'removeClaim()', function ( assert ) {
-		var mock = mockApi();
+	QUnit.test( 'removeClaim()', ( assert ) => {
+		const mock = mockApi();
 
 		mock.api.removeClaim( 'claim GUID', 12345 );
 		mock.api.removeClaim( 'claim GUID' );
@@ -444,8 +444,8 @@
 		assert.strictEqual( getParam( mock.spy, 'baserevid', 1 ), undefined );
 	} );
 
-	QUnit.test( 'removeClaim() without tags', function ( assert ) {
-		var mock = mockApi( undefined, [] );
+	QUnit.test( 'removeClaim() without tags', ( assert ) => {
+		const mock = mockApi( undefined, [] );
 
 		mock.api.removeClaim( 'claim GUID', 12345 );
 
@@ -455,8 +455,8 @@
 		assert.strictEqual( getParam( mock.spy, 'tags' ), undefined );
 	} );
 
-	QUnit.test( 'setSitelink()', function ( assert ) {
-		var mock = mockApi();
+	QUnit.test( 'setSitelink()', ( assert ) => {
+		const mock = mockApi();
 
 		mock.api.setSitelink(
 			'entity id', 12345, 'site id', 'page name', [ 'entity id of badge1', 'entity id of badge 2' ]
@@ -491,8 +491,8 @@
 		assert.strictEqual( getParam( mock.spy, 'returnto' ), 'currentPage' );
 	} );
 
-	QUnit.test( 'mergeItems() - no ignoreConflicts', function ( assert ) {
-		var mock = mockApi();
+	QUnit.test( 'mergeItems() - no ignoreConflicts', ( assert ) => {
+		const mock = mockApi();
 
 		mock.api.mergeItems( 'entity id from', 'entity id to' );
 
@@ -514,8 +514,8 @@
 		assert.strictEqual( getParam( mock.spy, 'returnto' ), 'currentPage' );
 	} );
 
-	QUnit.test( 'mergeItems() - single ignoreConflicts', function ( assert ) {
-		var mock = mockApi();
+	QUnit.test( 'mergeItems() - single ignoreConflicts', ( assert ) => {
+		const mock = mockApi();
 
 		mock.api.mergeItems(
 			'entity id from',
@@ -541,8 +541,8 @@
 		assert.strictEqual( getParam( mock.spy, 'summary' ), 'edit summary' );
 	} );
 
-	QUnit.test( 'mergeItems() - multiple ignoreConflicts', function ( assert ) {
-		var mock = mockApi();
+	QUnit.test( 'mergeItems() - multiple ignoreConflicts', ( assert ) => {
+		const mock = mockApi();
 
 		mock.api.mergeItems(
 			'entity id from',
@@ -568,8 +568,8 @@
 		assert.strictEqual( getParam( mock.spy, 'summary' ), 'edit summary' );
 	} );
 
-	QUnit.test( 'normalizeMultiValue()', function ( assert ) {
-		var mock = mockApi();
+	QUnit.test( 'normalizeMultiValue()', ( assert ) => {
+		const mock = mockApi();
 
 		assert.strictEqual( mock.api.normalizeMultiValue( [] ), '', 'empty array -> empty string' );
 		assert.strictEqual(
@@ -579,16 +579,16 @@
 		);
 	} );
 
-	QUnit.test( 'check post asserts user and does not set returnto when logged in ', function ( assert ) {
-		var mock = mockApi();
+	QUnit.test( 'check post asserts user and does not set returnto when logged in ', ( assert ) => {
+		const mock = mockApi();
 		mw._mockUser = 'fooBarUser';
 		mock.api.post( { action: 'foobar' } );
 		assert.strictEqual( getParam( mock.spy, 'assertuser' ), 'fooBarUser' );
 		assert.strictEqual( getParam( mock.spy, 'returnto' ), undefined );
 	} );
 
-	QUnit.test( 'check post does not assert user and does set returnto when not logged in ', function ( assert ) {
-		var mock = mockApi();
+	QUnit.test( 'check post does not assert user and does set returnto when not logged in ', ( assert ) => {
+		const mock = mockApi();
 
 		mock.api.post( { action: 'foobar' } );
 		assert.strictEqual( getParam( mock.spy, 'assertuser' ), undefined );
diff --git a/tests/RepoApiError.tests.js b/tests/RepoApiError.tests.js
index 611e769..f562a53 100644
--- a/tests/RepoApiError.tests.js
+++ b/tests/RepoApiError.tests.js
@@ -11,8 +11,8 @@
 
 	QUnit.module( 'wikibase.api.RepoApiError' );
 
-	QUnit.test( 'Create and validate errors', function ( assert ) {
-		var error = new wb.api.RepoApiError( 'error-code', 'detailed message' );
+	QUnit.test( 'Create and validate errors', ( assert ) => {
+		let error = new wb.api.RepoApiError( 'error-code', 'detailed message' );
 
 		assert.strictEqual(
 			error.code,
@@ -52,8 +52,8 @@
 	} );
 
 	QUnit.test( 'Validate errors created via factory method, requested with unspecified errorformat',
-		function ( assert ) {
-			var error = wb.api.RepoApiError.newFromApiResponse(
+		( assert ) => {
+			let error = wb.api.RepoApiError.newFromApiResponse(
 				{ error: { code: 'error-code', info: 'detailed message' } },
 				'wbaction'
 			);
@@ -131,8 +131,8 @@
 		} );
 
 	QUnit.test( 'Validate parameterised message for API response, requested with unspecified errorformat',
-		function ( assert ) {
-			var expectedMessageKey = 'wikibase-error-ui-no-external-page',
+		( assert ) => {
+			const expectedMessageKey = 'wikibase-error-ui-no-external-page',
 				messageParams = [ 'external-client-parameter', 'page-parameter' ],
 				expectedMessage = 'some formatted error message with parameters',
 				mwMsgMock = sinon.stub( mw, 'msg' ).returns( expectedMessage ),
@@ -160,8 +160,8 @@
 		} );
 
 	QUnit.test( 'Validate errors created via factory method, requested with errorformat=plaintext',
-		function ( assert ) {
-			var error = wb.api.RepoApiError.newFromApiResponse( {
+		( assert ) => {
+			let error = wb.api.RepoApiError.newFromApiResponse( {
 				errors: [ { code: 'error-code', '*': 'detailed message' } ]
 			}
 			);
@@ -250,8 +250,8 @@
 		} );
 
 	QUnit.test( 'Validate parameterised message for API response, requested with `errorformat=plaintext`',
-		function ( assert ) {
-			var expectedMessageKey = 'wikibase-error-ui-no-external-page',
+		( assert ) => {
+			const expectedMessageKey = 'wikibase-error-ui-no-external-page',
 				messageParams = [ 'external-client-parameter', 'page-parameter' ],
 				expectedMessage = 'some formatted error message with parameters',
 				mwMsgMock = sinon.stub( mw, 'msg' ).returns( expectedMessage ),
-- 
2.39.2


--- end ---
Source code is licensed under the AGPL.