Expand all

WatchstarGateway

API for retrieving and modifying page watch statuses. This module interacts with two endpoints, API:Info for GETs and API:Watch and for POSTs.

Constructor

new WatchstarGateway(api) #

Parameters:

Name Type Description
api mw.Api
Source:

Methods

getStatuses(ids, titles) → {jQuery.Deferred.<WatchStatusMap>} #

Issues zero to two asynchronous HTTP requests for the watch status of each page ID and title passed.

Every watch entry has a title but not necessarily a page ID. Entries without IDs are missing pages, i.e., pages that do not exist. These entries are used to observe when a page with a given title is created. Although it is convenient to use titles because they're always present, IDs are preferred since they're far less likely to exceed the URL length limit.

No request is issued when no IDs and no titles are passed. Given that the server state does not change between the two requests, overlapping title and ID members will behave as expected but there is no reason to issue such a request.

Parameters:

Name Type Description
ids Array.<PageID>
titles Array.<PageTitle>
Source:

Returns:

Type
jQuery.Deferred.<WatchStatusMap>

Issues zero to two asynchronous HTTP requests for the watch status of each page ID and title passed.

getStatusesByID(ids) → {jQuery.Deferred.<WatchStatusMap>} #

Parameters:

Name Type Description
ids Array.<PageID>
Source:

Returns:

Type
jQuery.Deferred.<WatchStatusMap>

getStatusesByTitle(titles) → {jQuery.Deferred.<WatchStatusMap>} #

Parameters:

Name Type Description
titles Array.<PageTitle>
Source:

Returns:

Type
jQuery.Deferred.<WatchStatusMap>

postStatusesByTitle(titles, watched) → {jQuery.Deferred} #

Parameters:

Name Type Description
titles Array.<PageTitle>
watched
Source:

Returns:

Type
jQuery.Deferred