diff --git a/CHANGELOG.md b/CHANGELOG.md index 426b55f..bd8a2a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ Only breaking changes, deprecations and the like are documented in this change log. +#### 2.0.1 + +- oresQueryRevisions() has been deprecated, since the [ORES service](https://ores.wikimedia.org/docs) is being deprecated in favour of [Lift Wing](https://wikitech.wikimedia.org/wiki/Machine_Learning/LiftWing). + #### 2.0.0 - Class names now follow the standard PascalCase convention. The older names are deprecated. diff --git a/README.md b/README.md index 90ff064..a028328 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,6 @@ Mwn works with both JavaScript and TypeScript. It is created with a design philo This library provides TypeScript type definitions for all its functions, as well as for MediaWiki API request objects (MW core + several extensions). API responses are also typed for the common operations. -In addition to the MediaWiki Action API, methods are provided to talk to the Wikimedia Pageviews API, the ORES API, and WikiWho API. - This library uses mocha and chai for tests, and has [extensive test coverage](https://coveralls.io/github/siddharthvp/mwn?branch=master). Testing is automated using a CI workflow on GitHub Actions. To install, run `npm install mwn`. diff --git a/package-lock.json b/package-lock.json index f16e53f..32df080 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "mwn", - "version": "2.0.0", + "version": "2.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "mwn", - "version": "2.0.0", + "version": "2.0.1", "license": "LGPL-3.0-or-later", "dependencies": { "@types/node": "^14.14.25", diff --git a/package.json b/package.json index 3968eda..d43ba64 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mwn", - "version": "2.0.0", + "version": "2.0.1", "description": "JavaScript & TypeScript MediaWiki bot framework for Node.js", "main": "./build/bot.js", "types": "./build/bot.d.ts", diff --git a/src/bot.ts b/src/bot.ts index 738b09a..9f78e04 100644 --- a/src/bot.ts +++ b/src/bot.ts @@ -1872,6 +1872,7 @@ export class Mwn { * @param {string} endpointUrl * @param {string[]} models * @param {string[]|number[]|string|number} revisions ID(s) + * @deprecated as ORES has been deprecated in favours of Lift Wing. */ oresQueryRevisions( endpointUrl: string, @@ -1879,7 +1880,9 @@ export class Mwn { revisions: string[] | number[] | string | number ): Promise { let response = {}; - const chunks = arrayChunk(revisions instanceof Array ? revisions : [revisions], 50); + const revs = revisions instanceof Array ? revisions : [revisions]; + const batchSize = Math.floor(20 / models.length); + const chunks = arrayChunk(revs, batchSize); return this.seriesBatchOperation( chunks, (chunk) => { diff --git a/website/docs/11-integration-with-other-apis.md b/website/docs/11-integration-with-other-apis.md index cfd9d3f..eb23d81 100644 --- a/website/docs/11-integration-with-other-apis.md +++ b/website/docs/11-integration-with-other-apis.md @@ -2,19 +2,6 @@ Apart from the [MediaWiki API](https://www.mediawiki.org/wiki/API:Main_page), Mwn integrates with a few other APIs for Wikimedia wikis: -### ORES - -See for details. -Get ORES scores for revisions: - -```js -await bot.oresQueryRevisions( - 'https://ores.wikimedia.org/', // ORES endpoint URL - ['articlequality', 'drafttopic'], // ORES models - ['76923582', '2387429'] // Revision IDs -); -``` - ### PageViews See @@ -41,6 +28,21 @@ const contributorData = await page.queryAuthors(); Return type is Promise<AuthorshipData>. +### ORES + +**Deprecated** as of v2.0.1 since ORES service has been deprecated in favour of [Lift Wing](https://wikitech.wikimedia.org/wiki/Machine_Learning/LiftWing). + +See for details. +Get ORES scores for revisions: + +```js +await bot.oresQueryRevisions( + 'https://ores.wikimedia.org/', // ORES endpoint URL + ['articlequality', 'drafttopic'], // ORES models + ['76923582', '2387429'] // Revision IDs +); +``` + ### EventStreams Methods for [EventStreams](https://wikitech.wikimedia.org/wiki/Event_Platform/EventStreams) access have been removed in v2. Consider using the dedicated library instead.