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

sourcepatches

This run took 88 seconds.

$ date
--- stdout ---
Wed Jun 22 12:27:32 UTC 2022

--- 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 ---
e93dfe4a2571298f7dbac581d8795cafd2843062 refs/heads/master

--- end ---
$ /usr/bin/npm audit --json --legacy-peer-deps
--- stdout ---
{
  "auditReportVersion": 2,
  "vulnerabilities": {
    "async": {
      "name": "async",
      "severity": "high",
      "via": [
        {
          "source": 1070443,
          "name": "async",
          "dependency": "async",
          "title": "Prototype Pollution in async",
          "url": "https://github.com/advisories/GHSA-fwr7-v2mv-hh25",
          "severity": "high",
          "range": ">=3.0.0 <3.2.2"
        }
      ],
      "effects": [],
      "range": "3.0.0 - 3.2.1",
      "nodes": [
        "node_modules/async"
      ],
      "fixAvailable": true
    },
    "grunt": {
      "name": "grunt",
      "severity": "high",
      "via": [
        {
          "source": 1070249,
          "name": "grunt",
          "dependency": "grunt",
          "title": "Path Traversal in Grunt",
          "url": "https://github.com/advisories/GHSA-j383-35pm-c5h4",
          "severity": "moderate",
          "range": "<1.5.2"
        },
        {
          "source": 1070402,
          "name": "grunt",
          "dependency": "grunt",
          "title": "Race Condition in Grunt",
          "url": "https://github.com/advisories/GHSA-rm36-94g8-835r",
          "severity": "high",
          "range": "<1.5.3"
        }
      ],
      "effects": [],
      "range": "<=1.5.2",
      "nodes": [
        "node_modules/grunt"
      ],
      "fixAvailable": true
    },
    "minimist": {
      "name": "minimist",
      "severity": "critical",
      "via": [
        {
          "source": 1067342,
          "name": "minimist",
          "dependency": "minimist",
          "title": "Prototype Pollution in minimist",
          "url": "https://github.com/advisories/GHSA-xvch-5gv4-984h",
          "severity": "critical",
          "range": "<1.2.6"
        }
      ],
      "effects": [],
      "range": "<1.2.6",
      "nodes": [
        "node_modules/minimist"
      ],
      "fixAvailable": true
    },
    "node-fetch": {
      "name": "node-fetch",
      "severity": "high",
      "via": [
        {
          "source": 1070022,
          "name": "node-fetch",
          "dependency": "node-fetch",
          "title": "node-fetch is vulnerable to Exposure of Sensitive Information to an Unauthorized Actor",
          "url": "https://github.com/advisories/GHSA-r683-j2x4-v87g",
          "severity": "high",
          "range": "<2.6.7"
        }
      ],
      "effects": [],
      "range": "<2.6.7",
      "nodes": [
        "node_modules/node-fetch"
      ],
      "fixAvailable": true
    }
  },
  "metadata": {
    "vulnerabilities": {
      "info": 0,
      "low": 0,
      "moderate": 0,
      "high": 3,
      "critical": 1,
      "total": 4
    },
    "dependencies": {
      "prod": 3,
      "dev": 361,
      "optional": 2,
      "peer": 0,
      "peerOptional": 0,
      "total": 363
    }
  }
}

--- end ---
$ /usr/bin/composer install
--- stderr ---
No lock file found. Updating dependencies instead of installing from lock file. Use composer update over composer install if you do not have a lock file.
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Writing lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating autoload files
--- stdout ---

--- end ---
Upgrading n:eslint-config-wikimedia from 0.20.0 -> 0.22.1
Upgrading n:grunt from ^1.4.1 -> 1.5.2
Upgrading n:grunt-eslint from 23.0.0 -> 24.0.0
$ /usr/bin/npm install
--- stdout ---

added 407 packages, and audited 408 packages in 43s

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

4 vulnerabilities (3 high, 1 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues, run:
  npm audit fix --force

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.0.0 --save-exact
--- stdout ---

up to date, audited 408 packages in 2s

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

4 vulnerabilities (3 high, 1 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues, run:
  npm audit fix --force

Run `npm audit` for details.

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

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

/src/repo/src/FormatValueCaller.js
  15:0  warning  The type 'dataTypes' is undefined   jsdoc/no-undefined-types
  31:0  warning  The type 'dataTypes' is undefined   jsdoc/no-undefined-types
  41:0  warning  The type 'dataValues' is undefined  jsdoc/no-undefined-types

/src/repo/src/RepoApi.js
   24:0  warning  The type 'mediaWiki' is undefined  jsdoc/no-undefined-types
   42:0  warning  The type 'mediaWiki' is undefined  jsdoc/no-undefined-types
   67:0  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  102:0  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  148:0  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  196:0  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  244:0  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  293:0  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  328:0  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  370:0  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  414:0  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  458:0  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  495:0  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  537:0  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  583:0  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  647:0  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types
  679:0  warning  The type 'jqXHR' is undefined      jsdoc/no-undefined-types

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

/src/repo/tests/RepoApi.tests.js
    2:0  warning  Missing JSDoc @param "wb" type                                                                              jsdoc/require-param-type
    3:0  warning  Missing JSDoc @param "QUnit" type                                                                           jsdoc/require-param-type
    4:0  warning  Missing JSDoc @param "sinon" type                                                                           jsdoc/require-param-type
   68:3  error    Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual  qunit/no-loose-assertions
  104:3  error    Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual  qunit/no-loose-assertions
  142:3  error    Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual  qunit/no-loose-assertions
  203:3  error    Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual  qunit/no-loose-assertions
  314:3  error    Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual  qunit/no-loose-assertions
  346:4  error    Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual  qunit/no-loose-assertions
  369:3  error    Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual  qunit/no-loose-assertions
  393:3  error    Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual  qunit/no-loose-assertions
  425:3  error    Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual  qunit/no-loose-assertions
  448:3  error    Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual  qunit/no-loose-assertions
  462:3  error    Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual  qunit/no-loose-assertions
  494:3  error    Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual  qunit/no-loose-assertions
  521:3  error    Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual  qunit/no-loose-assertions
  548:3  error    Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual  qunit/no-loose-assertions

/src/repo/tests/RepoApiError.tests.js
  147:4  error  Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual  qunit/no-loose-assertions
  268:4  error  Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual  qunit/no-loose-assertions

✖ 40 problems (16 errors, 24 warnings)


--- end ---
$ ./node_modules/.bin/eslint Gruntfile.js package.json tests/RepoApi.tests.js src/RepoApi.js src/ParseValueCaller.js tests/mediaWiki.mock.js src/namespace.js src/FormatValueCaller.js src/getLocationAgnosticMwApi.js composer.json src/RepoApiError.js tests/RepoApiError.tests.js package-lock.json -f json
--- stdout ---
[{"filePath":"/src/repo/Gruntfile.js","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/src/repo/composer.json","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/src/repo/package-lock.json","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/src/repo/package.json","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/src/repo/src/FormatValueCaller.js","messages":[{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'dataTypes' is undefined.","line":15,"column":null,"nodeType":"Block","endLine":15,"endColumn":null},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'dataTypes' is undefined.","line":31,"column":null,"nodeType":"Block","endLine":31,"endColumn":null},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'dataValues' is undefined.","line":41,"column":null,"nodeType":"Block","endLine":41,"endColumn":null}],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"( function ( wb ) {\n\t'use strict';\n\n\tvar 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\tvar SELF = MODULE.FormatValueCaller = function WbApiFormatValueCaller( api, dataTypeStore ) {\n\t\tthis._api = api;\n\t\tthis._dataTypeStore = dataTypeStore;\n\t};\n\n\t$.extend( 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\tvar 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( function ( 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( function ( 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":[]},{"filePath":"/src/repo/src/ParseValueCaller.js","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/src/repo/src/RepoApi.js","messages":[{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'mediaWiki' is undefined.","line":24,"column":null,"nodeType":"Block","endLine":24,"endColumn":null},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'mediaWiki' is undefined.","line":42,"column":null,"nodeType":"Block","endLine":42,"endColumn":null},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'jqXHR' is undefined.","line":67,"column":null,"nodeType":"Block","endLine":67,"endColumn":null},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'jqXHR' is undefined.","line":102,"column":null,"nodeType":"Block","endLine":102,"endColumn":null},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'jqXHR' is undefined.","line":148,"column":null,"nodeType":"Block","endLine":148,"endColumn":null},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'jqXHR' is undefined.","line":196,"column":null,"nodeType":"Block","endLine":196,"endColumn":null},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'jqXHR' is undefined.","line":244,"column":null,"nodeType":"Block","endLine":244,"endColumn":null},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'jqXHR' is undefined.","line":293,"column":null,"nodeType":"Block","endLine":293,"endColumn":null},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'jqXHR' is undefined.","line":328,"column":null,"nodeType":"Block","endLine":328,"endColumn":null},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'jqXHR' is undefined.","line":370,"column":null,"nodeType":"Block","endLine":370,"endColumn":null},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'jqXHR' is undefined.","line":414,"column":null,"nodeType":"Block","endLine":414,"endColumn":null},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'jqXHR' is undefined.","line":458,"column":null,"nodeType":"Block","endLine":458,"endColumn":null},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'jqXHR' is undefined.","line":495,"column":null,"nodeType":"Block","endLine":495,"endColumn":null},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'jqXHR' is undefined.","line":537,"column":null,"nodeType":"Block","endLine":537,"endColumn":null},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'jqXHR' is undefined.","line":583,"column":null,"nodeType":"Block","endLine":583,"endColumn":null},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'jqXHR' is undefined.","line":647,"column":null,"nodeType":"Block","endLine":647,"endColumn":null},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'jqXHR' is undefined.","line":679,"column":null,"nodeType":"Block","endLine":679,"endColumn":null}],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":17,"fixableErrorCount":0,"fixableWarningCount":0,"source":"( function ( wb ) {\n\t'use strict';\n\n\tvar 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 * @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\tvar 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\t$.extend( 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\tvar 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\tvar 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\tvar 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\tvar 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\tvar 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\tvar 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\tvar 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\tvar 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\tvar 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\tvar 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\tvar 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\tvar 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\tvar 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 * @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 * @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}\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( function ( 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":[]},{"filePath":"/src/repo/src/RepoApiError.js","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/src/repo/src/getLocationAgnosticMwApi.js","messages":[{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'mediaWiki' is undefined.","line":32,"column":null,"nodeType":"Block","endLine":32,"endColumn":null}],"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\tvar 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 * @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\tvar mwApiOptions = $.extend( {}, 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":[]},{"filePath":"/src/repo/src/namespace.js","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/src/repo/tests/RepoApi.tests.js","messages":[{"ruleId":"jsdoc/require-param-type","severity":1,"message":"Missing JSDoc @param \"wb\" type.","line":2,"column":null,"nodeType":"Block","endLine":2,"endColumn":null},{"ruleId":"jsdoc/require-param-type","severity":1,"message":"Missing JSDoc @param \"QUnit\" type.","line":3,"column":null,"nodeType":"Block","endLine":3,"endColumn":null},{"ruleId":"jsdoc/require-param-type","severity":1,"message":"Missing JSDoc @param \"sinon\" type.","line":4,"column":null,"nodeType":"Block","endLine":4,"endColumn":null},{"ruleId":"qunit/no-loose-assertions","severity":2,"message":"Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual.","line":68,"column":3,"nodeType":"CallExpression","messageId":"unexpectedLocalLooseAssertion","endLine":68,"endColumn":60},{"ruleId":"qunit/no-loose-assertions","severity":2,"message":"Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual.","line":104,"column":3,"nodeType":"CallExpression","messageId":"unexpectedLocalLooseAssertion","endLine":104,"endColumn":58},{"ruleId":"qunit/no-loose-assertions","severity":2,"message":"Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual.","line":142,"column":3,"nodeType":"CallExpression","messageId":"unexpectedLocalLooseAssertion","endLine":142,"endColumn":60},{"ruleId":"qunit/no-loose-assertions","severity":2,"message":"Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual.","line":203,"column":3,"nodeType":"CallExpression","messageId":"unexpectedLocalLooseAssertion","endLine":203,"endColumn":61},{"ruleId":"qunit/no-loose-assertions","severity":2,"message":"Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual.","line":314,"column":3,"nodeType":"CallExpression","messageId":"unexpectedLocalLooseAssertion","endLine":314,"endColumn":59},{"ruleId":"qunit/no-loose-assertions","severity":2,"message":"Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual.","line":346,"column":4,"nodeType":"CallExpression","messageId":"unexpectedLocalLooseAssertion","endLine":346,"endColumn":59},{"ruleId":"qunit/no-loose-assertions","severity":2,"message":"Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual.","line":369,"column":3,"nodeType":"CallExpression","messageId":"unexpectedLocalLooseAssertion","endLine":369,"endColumn":58},{"ruleId":"qunit/no-loose-assertions","severity":2,"message":"Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual.","line":393,"column":3,"nodeType":"CallExpression","messageId":"unexpectedLocalLooseAssertion","endLine":393,"endColumn":59},{"ruleId":"qunit/no-loose-assertions","severity":2,"message":"Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual.","line":425,"column":3,"nodeType":"CallExpression","messageId":"unexpectedLocalLooseAssertion","endLine":425,"endColumn":59},{"ruleId":"qunit/no-loose-assertions","severity":2,"message":"Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual.","line":448,"column":3,"nodeType":"CallExpression","messageId":"unexpectedLocalLooseAssertion","endLine":448,"endColumn":58},{"ruleId":"qunit/no-loose-assertions","severity":2,"message":"Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual.","line":462,"column":3,"nodeType":"CallExpression","messageId":"unexpectedLocalLooseAssertion","endLine":462,"endColumn":59},{"ruleId":"qunit/no-loose-assertions","severity":2,"message":"Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual.","line":494,"column":3,"nodeType":"CallExpression","messageId":"unexpectedLocalLooseAssertion","endLine":494,"endColumn":59},{"ruleId":"qunit/no-loose-assertions","severity":2,"message":"Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual.","line":521,"column":3,"nodeType":"CallExpression","messageId":"unexpectedLocalLooseAssertion","endLine":521,"endColumn":59},{"ruleId":"qunit/no-loose-assertions","severity":2,"message":"Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual.","line":548,"column":3,"nodeType":"CallExpression","messageId":"unexpectedLocalLooseAssertion","endLine":548,"endColumn":59}],"suppressedMessages":[],"errorCount":14,"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\tvar 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()', function ( assert ) {\n\t\tvar mock = mockApi();\n\n\t\tmock.api.createEntity( 'item' );\n\t\tmock.api.createEntity( 'property', { 'I am': 'data' } );\n\n\t\tassert.ok( 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()', function ( assert ) {\n\t\tvar mock = mockApi();\n\n\t\tmock.api.editEntity( 'entity id', 12345, { 'I am': 'entity data' }, true );\n\n\t\tassert.ok( 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()', function ( assert ) {\n\t\tvar 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.ok( 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()', function ( assert ) {\n\t\tvar 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.ok( 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()', function ( assert ) {\n\t\tvar 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()', function ( assert ) {\n\t\tvar 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.ok( 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()', function ( assert ) {\n\t\tvar subjects = [ 'Label', 'Description' ];\n\n\t\tfor ( var i = 0; i < subjects.length; i++ ) {\n\t\t\tvar mock = mockApi();\n\n\t\t\tmock.api[ 'set' + subjects[ i ] ]( 'entity id', 12345, 'text', 'language code' );\n\n\t\t\tassert.ok( 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}\n\t} );\n\n\tQUnit.test( 'setAliases()', function ( assert ) {\n\t\tvar 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.ok( 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} );\n\n\tQUnit.test( 'setClaim()', function ( assert ) {\n\t\tvar 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.ok( 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\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()', function ( assert ) {\n\t\tvar mock = mockApi();\n\n\t\tmock.api.removeClaim( 'claim GUID', 12345 );\n\t\tmock.api.removeClaim( 'claim GUID' );\n\n\t\tassert.ok( 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\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', function ( assert ) {\n\t\tvar mock = mockApi( undefined, [] );\n\n\t\tmock.api.removeClaim( 'claim GUID', 12345 );\n\n\t\tassert.ok( 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()', function ( assert ) {\n\t\tvar 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.ok( 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} );\n\n\tQUnit.test( 'mergeItems() - no ignoreConflicts', function ( assert ) {\n\t\tvar mock = mockApi();\n\n\t\tmock.api.mergeItems( 'entity id from', 'entity id to' );\n\n\t\tassert.ok( 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} );\n\n\tQUnit.test( 'mergeItems() - single ignoreConflicts', function ( assert ) {\n\t\tvar 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.ok( 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', function ( assert ) {\n\t\tvar 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.ok( 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()', function ( assert ) {\n\t\tvar 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 when logged in ', function ( assert ) {\n\t\tvar 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} );\n\n\tQUnit.test( 'check post does not assert user when not logged in ', function ( assert ) {\n\t\tvar mock = mockApi();\n\n\t\tmock.api.post( { action: 'foobar' } );\n\t\tassert.strictEqual( getParam( mock.spy, 'assertuser' ), undefined );\n\t} );\n\n}( wikibase, QUnit, sinon ) );\n","usedDeprecatedRules":[]},{"filePath":"/src/repo/tests/RepoApiError.tests.js","messages":[{"ruleId":"qunit/no-loose-assertions","severity":2,"message":"Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual.","line":147,"column":4,"nodeType":"CallExpression","messageId":"unexpectedLocalLooseAssertion","endLine":150,"endColumn":5},{"ruleId":"qunit/no-loose-assertions","severity":2,"message":"Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual.","line":268,"column":4,"nodeType":"CallExpression","messageId":"unexpectedLocalLooseAssertion","endLine":271,"endColumn":5}],"suppressedMessages":[],"errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"/**\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', function ( assert ) {\n\t\tvar 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\tfunction ( assert ) {\n\t\t\tvar 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\tfunction ( assert ) {\n\t\t\tvar 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.ok(\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\tfunction ( assert ) {\n\t\t\tvar 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\tfunction ( assert ) {\n\t\t\tvar 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.ok(\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":[]},{"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":20,"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":[]}]

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

added 407 packages, and audited 408 packages in 18s

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

4 vulnerabilities (3 high, 1 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues, run:
  npm audit fix --force

Run `npm audit` for details.

--- end ---
$ /usr/bin/npm test
--- stderr ---
npm ERR! code 3
npm ERR! path /src/repo
npm ERR! command failed
npm ERR! command sh -c grunt test

npm ERR! A complete log of this run can be found in:
npm ERR!     /cache/_logs/2022-06-22T12_28_57_990Z-debug.log
--- stdout ---

> wikibase-api@3.1.1 test
> grunt test

Running "eslint:all" (eslint) task

/src/repo/Gruntfile.js
  1:1  error  Definition for rule 'qunit/no-loose-assertions' was not found  qunit/no-loose-assertions

/src/repo/composer.json
  1:1  error  Definition for rule 'qunit/no-loose-assertions' was not found  qunit/no-loose-assertions

/src/repo/package-lock.json
  1:1  error  Definition for rule 'qunit/no-loose-assertions' was not found  qunit/no-loose-assertions

/src/repo/package.json
  1:1  error  Definition for rule 'qunit/no-loose-assertions' was not found  qunit/no-loose-assertions

/src/repo/src/FormatValueCaller.js
   1:1  error    Definition for rule 'qunit/no-loose-assertions' was not found  qunit/no-loose-assertions
  15:0  warning  The type 'dataTypes' is undefined                              jsdoc/no-undefined-types
  31:0  warning  The type 'dataTypes' is undefined                              jsdoc/no-undefined-types
  41:0  warning  The type 'dataValues' is undefined                             jsdoc/no-undefined-types

/src/repo/src/ParseValueCaller.js
  1:1  error  Definition for rule 'qunit/no-loose-assertions' was not found  qunit/no-loose-assertions

/src/repo/src/RepoApi.js
    1:1  error    Definition for rule 'qunit/no-loose-assertions' was not found  qunit/no-loose-assertions
   24:0  warning  The type 'mediaWiki' is undefined                              jsdoc/no-undefined-types
   42:0  warning  The type 'mediaWiki' is undefined                              jsdoc/no-undefined-types
   67:0  warning  The type 'jqXHR' is undefined                                  jsdoc/no-undefined-types
  102:0  warning  The type 'jqXHR' is undefined                                  jsdoc/no-undefined-types
  148:0  warning  The type 'jqXHR' is undefined                                  jsdoc/no-undefined-types
  196:0  warning  The type 'jqXHR' is undefined                                  jsdoc/no-undefined-types
  244:0  warning  The type 'jqXHR' is undefined                                  jsdoc/no-undefined-types
  293:0  warning  The type 'jqXHR' is undefined                                  jsdoc/no-undefined-types
  328:0  warning  The type 'jqXHR' is undefined                                  jsdoc/no-undefined-types
  370:0  warning  The type 'jqXHR' is undefined                                  jsdoc/no-undefined-types
  414:0  warning  The type 'jqXHR' is undefined                                  jsdoc/no-undefined-types
  458:0  warning  The type 'jqXHR' is undefined                                  jsdoc/no-undefined-types
  495:0  warning  The type 'jqXHR' is undefined                                  jsdoc/no-undefined-types
  537:0  warning  The type 'jqXHR' is undefined                                  jsdoc/no-undefined-types
  583:0  warning  The type 'jqXHR' is undefined                                  jsdoc/no-undefined-types
  647:0  warning  The type 'jqXHR' is undefined                                  jsdoc/no-undefined-types
  679:0  warning  The type 'jqXHR' is undefined                                  jsdoc/no-undefined-types

/src/repo/src/RepoApiError.js
  1:1  error  Definition for rule 'qunit/no-loose-assertions' was not found  qunit/no-loose-assertions

/src/repo/src/getLocationAgnosticMwApi.js
   1:1  error    Definition for rule 'qunit/no-loose-assertions' was not found  qunit/no-loose-assertions
  32:0  warning  The type 'mediaWiki' is undefined                              jsdoc/no-undefined-types

/src/repo/src/namespace.js
  1:1  error  Definition for rule 'qunit/no-loose-assertions' was not found  qunit/no-loose-assertions

/src/repo/tests/RepoApi.tests.js
    2:0  warning  Missing JSDoc @param "wb" type                                                                              jsdoc/require-param-type
    3:0  warning  Missing JSDoc @param "QUnit" type                                                                           jsdoc/require-param-type
    4:0  warning  Missing JSDoc @param "sinon" type                                                                           jsdoc/require-param-type
   68:3  warning  Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual  qunit/no-loose-assertions
  104:3  warning  Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual  qunit/no-loose-assertions
  142:3  warning  Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual  qunit/no-loose-assertions
  203:3  warning  Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual  qunit/no-loose-assertions
  314:3  warning  Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual  qunit/no-loose-assertions
  346:4  warning  Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual  qunit/no-loose-assertions
  369:3  warning  Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual  qunit/no-loose-assertions
  393:3  warning  Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual  qunit/no-loose-assertions
  425:3  warning  Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual  qunit/no-loose-assertions
  448:3  warning  Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual  qunit/no-loose-assertions
  462:3  warning  Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual  qunit/no-loose-assertions
  494:3  warning  Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual  qunit/no-loose-assertions
  521:3  warning  Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual  qunit/no-loose-assertions
  548:3  warning  Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual  qunit/no-loose-assertions

/src/repo/tests/RepoApiError.tests.js
  147:4  warning  Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual  qunit/no-loose-assertions
  268:4  warning  Unexpected assert.ok. Use assert.strictEqual, assert.notStrictEqual, assert.deepEqual, or assert.propEqual  qunit/no-loose-assertions

/src/repo/vendor/composer/installed.json
  0:0  warning  File ignored because of a matching ignore pattern. Use "--no-ignore" to override

✖ 51 problems (10 errors, 41 warnings)

Warning: Task "eslint:all" failed. Use --force to continue.

Aborted due to warnings.

--- end ---
Traceback (most recent call last):
  File "/venv/lib/python3.9/site-packages/runner-0.1.0-py3.9.egg/runner/__init__.py", line 1400, in main
    libup.run(args.repo, args.output, args.branch)
  File "/venv/lib/python3.9/site-packages/runner-0.1.0-py3.9.egg/runner/__init__.py", line 1338, in run
    self.npm_upgrade(plan)
  File "/venv/lib/python3.9/site-packages/runner-0.1.0-py3.9.egg/runner/__init__.py", line 1049, in npm_upgrade
    self.npm_test()
  File "/venv/lib/python3.9/site-packages/runner-0.1.0-py3.9.egg/runner/__init__.py", line 287, in npm_test
    self.check_call(['npm', 'test'])
  File "/venv/lib/python3.9/site-packages/runner-0.1.0-py3.9.egg/runner/shell2.py", line 54, in check_call
    res.check_returncode()
  File "/usr/lib/python3.9/subprocess.py", line 460, in check_returncode
    raise CalledProcessError(self.returncode, self.args, self.stdout,
subprocess.CalledProcessError: Command '['/usr/bin/npm', 'test']' returned non-zero exit status 3.
Source code is licensed under the AGPL.