Skip to content

Commit

Permalink
Add logs for API checks
Browse files Browse the repository at this point in the history
  • Loading branch information
audiodude committed Jan 3, 2025
1 parent a4db759 commit 191e6fb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/MediaWiki.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ class MediaWiki {
if (this.#hasWikimediaDesktopApi === null) {
this.wikimediaDesktopUrlDirector = new WikimediaDesktopURLDirector(this.wikimediaDesktopApiUrl.href)
this.#hasWikimediaDesktopApi = await checkApiAvailability(this.wikimediaDesktopUrlDirector.buildArticleURL(this.apiCheckArticleId))
logger.log('Checking for WikimediaDesktopApi at', this.wikimediaDesktopUrlDirector.buildArticleURL(this.apiCheckArticleId), '-- result is: ', this.#hasWikimediaDesktopApi)
return this.#hasWikimediaDesktopApi
}
return this.#hasWikimediaDesktopApi
Expand All @@ -185,6 +186,7 @@ class MediaWiki {
if (this.#hasWikimediaMobileApi === null) {
this.wikimediaMobileUrlDirector = new WikimediaMobileURLDirector(this.wikimediaMobileApiUrl.href)
this.#hasWikimediaMobileApi = await checkApiAvailability(this.wikimediaMobileUrlDirector.buildArticleURL(this.apiCheckArticleId))
logger.log('Checking for WikimediaMobileApi at', this.wikimediaMobileUrlDirector.buildArticleURL(this.apiCheckArticleId), '-- result is: ', this.#hasWikimediaMobileApi)
return this.#hasWikimediaMobileApi
}
return this.#hasWikimediaMobileApi
Expand All @@ -198,6 +200,7 @@ class MediaWiki {
'' /* empty login cookie */,
this.visualEditorUrlDirector.validMimeTypes,
)
logger.log('Checking for VisualEditorApi at', this.visualEditorUrlDirector.buildArticleURL(this.apiCheckArticleId), '-- result is: ', this.#hasVisualEditorApi)
return this.#hasVisualEditorApi
}
return this.#hasVisualEditorApi
Expand All @@ -207,6 +210,7 @@ class MediaWiki {
if (this.#hasRestApi === null) {
this.restApiUrlDirector = new RestApiURLDirector(this.restApiUrl.href)
this.#hasRestApi = await checkApiAvailability(this.restApiUrlDirector.buildArticleURL(this.apiCheckArticleId))
logger.log('Checking for RestApi at', this.restApiUrlDirector.buildArticleURL(this.apiCheckArticleId), '-- result is: ', this.#hasRestApi)
return this.#hasRestApi
}
return this.#hasRestApi
Expand Down

0 comments on commit 191e6fb

Please sign in to comment.