types-mediawiki-response 1.0.0-alpha.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/index.d.ts +21 -0
- package/dist/core/block.d.ts +6 -6
- package/dist/core/changeauthenticationdata.d.ts +3 -1
- package/dist/core/changecontentmodel.d.ts +3 -2
- package/dist/core/checktoken.d.ts +1 -0
- package/dist/core/clientlogin.d.ts +1 -0
- package/dist/core/compare.d.ts +1 -0
- package/dist/core/createaccount.d.ts +6 -6
- package/dist/core/delete.d.ts +2 -0
- package/dist/core/edit.d.ts +23 -3
- package/dist/core/emailuser.d.ts +1 -0
- package/dist/core/expandtemplates.d.ts +1 -0
- package/dist/core/filerevert.d.ts +1 -0
- package/dist/core/imagerotate.d.ts +4 -18
- package/dist/core/import.d.ts +2 -2
- package/dist/core/login.d.ts +1 -0
- package/dist/core/managetags.d.ts +1 -0
- package/dist/core/mergehistory.d.ts +1 -0
- package/dist/core/move.d.ts +3 -2
- package/dist/core/options.d.ts +2 -1
- package/dist/core/parse.d.ts +8 -14
- package/dist/core/patrol.d.ts +1 -0
- package/dist/core/protect.d.ts +1 -0
- package/dist/core/purge.d.ts +5 -27
- package/dist/core/query/allcategories.d.ts +1 -4
- package/dist/core/query/alldeletedrevisions.d.ts +2 -6
- package/dist/core/query/alllinks.d.ts +2 -2
- package/dist/core/query/allpages.d.ts +2 -8
- package/dist/core/query/allrevisions.d.ts +2 -8
- package/dist/core/query/allusers.d.ts +1 -1
- package/dist/core/query/authmanagerinfo.d.ts +0 -2
- package/dist/core/query/backlinks.d.ts +4 -9
- package/dist/core/query/blocks.d.ts +5 -2
- package/dist/core/query/contributors.d.ts +17 -5
- package/dist/core/query/deletedrevs.d.ts +4 -10
- package/dist/core/query/duplicatefiles.d.ts +1 -2
- package/dist/core/query/embeddedin.d.ts +4 -9
- package/dist/core/query/filearchive.d.ts +3 -8
- package/dist/core/query/imageinfo.d.ts +40 -27
- package/dist/core/query/imageusage.d.ts +4 -9
- package/dist/core/query/index.d.ts +27 -5
- package/dist/core/query/info.d.ts +172 -154
- package/dist/core/query/iwbacklinks.d.ts +3 -8
- package/dist/core/query/langbacklinks.d.ts +3 -8
- package/dist/core/query/langlinks.d.ts +1 -2
- package/dist/core/query/logevents.d.ts +2 -10
- package/dist/core/query/protectedtitles.d.ts +2 -2
- package/dist/core/query/recentchanges.d.ts +3 -12
- package/dist/core/query/revisions.d.ts +3 -8
- package/dist/core/query/search.d.ts +6 -0
- package/dist/core/query/shared.d.ts +29 -0
- package/dist/core/query/siteinfo.d.ts +37 -11
- package/dist/core/query/tags.d.ts +1 -4
- package/dist/core/query/usercontribs.d.ts +4 -10
- package/dist/core/query/userinfo.d.ts +8 -19
- package/dist/core/query/users.d.ts +25 -21
- package/dist/core/query/watchlist.d.ts +2 -6
- package/dist/core/query/watchlistraw.d.ts +1 -0
- package/dist/core/removeauthenticationdata.d.ts +3 -1
- package/dist/core/resetpassword.d.ts +1 -0
- package/dist/core/revisiondelete.d.ts +1 -0
- package/dist/core/rollback.d.ts +1 -0
- package/dist/core/setnotificationtimestamp.d.ts +1 -0
- package/dist/core/setpagelanguage.d.ts +1 -0
- package/dist/core/stashedit.d.ts +1 -0
- package/dist/core/tag.d.ts +1 -0
- package/dist/core/upload.d.ts +3 -0
- package/dist/core/userrights.d.ts +6 -7
- package/dist/core/validatepassword.d.ts +1 -0
- package/dist/core/watch.d.ts +5 -4
- package/dist/envelope/index.d.ts +29 -10
- package/dist/extensions/abusefilters.d.ts +12 -4
- package/dist/extensions/babel.d.ts +1 -0
- package/dist/extensions/categorytree.d.ts +5 -53
- package/dist/extensions/checkuser.d.ts +3 -2
- package/dist/extensions/description.d.ts +2 -0
- package/dist/extensions/discussiontools.d.ts +11 -3
- package/dist/extensions/echo.d.ts +27 -12
- package/dist/extensions/extracts.d.ts +1 -0
- package/dist/extensions/flaggedrevs.d.ts +24 -26
- package/dist/extensions/gadgets.d.ts +2 -0
- package/dist/extensions/globalblocks.d.ts +20 -11
- package/dist/extensions/globalpreferences.d.ts +6 -2
- package/dist/extensions/globalusage.d.ts +2 -4
- package/dist/extensions/globaluserinfo.d.ts +3 -2
- package/dist/extensions/linter.d.ts +8 -11
- package/dist/extensions/massmessage.d.ts +6 -2
- package/dist/extensions/oathauth.d.ts +9 -0
- package/dist/extensions/pageimages.d.ts +3 -0
- package/dist/extensions/scribunto.d.ts +1 -1
- package/dist/extensions/sitematrix.d.ts +2 -1
- package/dist/extensions/spamblacklist.d.ts +1 -0
- package/dist/extensions/templatedata.d.ts +8 -6
- package/dist/extensions/thanks.d.ts +4 -4
- package/dist/extensions/timedmediahandler.d.ts +29 -10
- package/dist/extensions/titleblacklist.d.ts +1 -0
- package/dist/extensions/urlshortener.d.ts +1 -0
- package/dist/extensions/visualeditor.d.ts +11 -3
- package/dist/extensions/wikibase.d.ts +2 -1
- package/dist/extensions/wikilove.d.ts +1 -0
- package/package.json +6 -2
package/dist/common/index.d.ts
CHANGED
|
@@ -12,6 +12,17 @@ export type Flag = true;
|
|
|
12
12
|
* e.g. `2024-01-15T08:30:00Z`.
|
|
13
13
|
*/
|
|
14
14
|
export type Timestamp = string;
|
|
15
|
+
/**
|
|
16
|
+
* Expiry of a temporary state: a timestamp, or the literal `infinity` when it
|
|
17
|
+
* does not expire. Block records spell the permanent case `infinite` instead
|
|
18
|
+
* — see {@link BlockExpiry}.
|
|
19
|
+
*/
|
|
20
|
+
export type Expiry = Timestamp | "infinity";
|
|
21
|
+
/**
|
|
22
|
+
* Expiry of a block as an action result reports it: a timestamp, or the
|
|
23
|
+
* literal `infinite` for an indefinite block.
|
|
24
|
+
*/
|
|
25
|
+
export type BlockExpiry = Timestamp | "infinite";
|
|
15
26
|
/**
|
|
16
27
|
* A block of plain text (as opposed to HTML), e.g. a TextExtracts excerpt
|
|
17
28
|
* requested with `explaintext`. Kept distinct from HTML-bearing string fields.
|
|
@@ -19,6 +30,16 @@ export type Timestamp = string;
|
|
|
19
30
|
export type PlainText = string;
|
|
20
31
|
/** Namespace index. Negative indexes are pseudo-namespaces. */
|
|
21
32
|
export type NamespaceIndex = number;
|
|
33
|
+
/**
|
|
34
|
+
* `success` — or the actual outcome string when an operation did not succeed.
|
|
35
|
+
* **Open union**: `(string & {})` keeps other outcomes forward-compatible.
|
|
36
|
+
*/
|
|
37
|
+
export type SuccessStatus = "success" | (string & {});
|
|
38
|
+
/**
|
|
39
|
+
* `Success` — or the actual result string when an operation did not succeed.
|
|
40
|
+
* **Open union**: `(string & {})` keeps other outcomes forward-compatible.
|
|
41
|
+
*/
|
|
42
|
+
export type SuccessResult = "Success" | (string & {});
|
|
22
43
|
/**
|
|
23
44
|
* A structured in-band message — a serialized MediaWiki `Message`/`FatalError`
|
|
24
45
|
* spec (`{ message, params, code, type }`) nested inside an action result
|
package/dist/core/block.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*
|
|
10
10
|
* @see https://www.mediawiki.org/wiki/API:Block
|
|
11
11
|
*/
|
|
12
|
-
import type { Timestamp } from "../common";
|
|
12
|
+
import type { BlockExpiry, Timestamp } from "../common";
|
|
13
13
|
import type { ApiEnvelope } from "../envelope";
|
|
14
14
|
/** The `block` object of an `action=block` response. */
|
|
15
15
|
export interface ApiBlockResult {
|
|
@@ -20,7 +20,7 @@ export interface ApiBlockResult {
|
|
|
20
20
|
/** Block id. */
|
|
21
21
|
id: number;
|
|
22
22
|
/** Expiry timestamp, or `infinite` for an indefinite block. */
|
|
23
|
-
expiry:
|
|
23
|
+
expiry: BlockExpiry;
|
|
24
24
|
/** Block reason (echoed back). */
|
|
25
25
|
reason: string;
|
|
26
26
|
/** Block only anonymous users editing from an IP address range. */
|
|
@@ -60,10 +60,8 @@ export interface ApiBlockResult {
|
|
|
60
60
|
*/
|
|
61
61
|
timestamp?: Timestamp;
|
|
62
62
|
/**
|
|
63
|
-
* Extra statuses set by extensions during a successful block
|
|
64
|
-
*
|
|
65
|
-
* is on and an extension populates it via the `ApiBlockSucceeded` hook, in
|
|
66
|
-
* which case a PHP map (thus the `unknown[]` empty case).
|
|
63
|
+
* Extra statuses set by extensions during a successful block; `[]` when none
|
|
64
|
+
* is set.
|
|
67
65
|
*
|
|
68
66
|
* @since MediaWiki 1.46
|
|
69
67
|
*/
|
|
@@ -71,6 +69,7 @@ export interface ApiBlockResult {
|
|
|
71
69
|
}
|
|
72
70
|
/** Response of `action=block`. */
|
|
73
71
|
export interface ApiBlockResponse extends ApiEnvelope {
|
|
72
|
+
/** Result of `action=block`. */
|
|
74
73
|
block: ApiBlockResult;
|
|
75
74
|
}
|
|
76
75
|
/** The `unblock` object of an `action=unblock` response. */
|
|
@@ -94,5 +93,6 @@ export interface ApiUnblockResult {
|
|
|
94
93
|
}
|
|
95
94
|
/** Response of `action=unblock`. */
|
|
96
95
|
export interface ApiUnblockResponse extends ApiEnvelope {
|
|
96
|
+
/** Result of `action=unblock`. */
|
|
97
97
|
unblock: ApiUnblockResult;
|
|
98
98
|
}
|
|
@@ -8,11 +8,13 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @see https://www.mediawiki.org/wiki/API:Changeauthenticationdata
|
|
10
10
|
*/
|
|
11
|
+
import type { SuccessStatus } from "../common";
|
|
11
12
|
import type { ApiEnvelope } from "../envelope";
|
|
12
13
|
/** Response of `action=changeauthenticationdata`. */
|
|
13
14
|
export interface ApiChangeAuthenticationDataResponse extends ApiEnvelope {
|
|
15
|
+
/** Result of `action=changeauthenticationdata`. */
|
|
14
16
|
changeauthenticationdata: {
|
|
15
17
|
/** Flow outcome; `success` when the change was applied. */
|
|
16
|
-
status:
|
|
18
|
+
status: SuccessStatus;
|
|
17
19
|
};
|
|
18
20
|
}
|
|
@@ -6,13 +6,14 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @see https://www.mediawiki.org/wiki/API:Changecontentmodel
|
|
8
8
|
*/
|
|
9
|
-
import type { ContentModel } from "../common";
|
|
9
|
+
import type { ContentModel, SuccessResult } from "../common";
|
|
10
10
|
import type { ApiEnvelope } from "../envelope";
|
|
11
11
|
/** Response of `action=changecontentmodel`. */
|
|
12
12
|
export interface ApiChangeContentModelResponse extends ApiEnvelope {
|
|
13
|
+
/** Result of `action=changecontentmodel`. */
|
|
13
14
|
changecontentmodel: {
|
|
14
15
|
/** `Success` when the model was changed. */
|
|
15
|
-
result:
|
|
16
|
+
result: SuccessResult;
|
|
16
17
|
/** Page title. */
|
|
17
18
|
title: string;
|
|
18
19
|
/** Page id. */
|
|
@@ -16,6 +16,7 @@ import type { ApiEnvelope } from "../envelope";
|
|
|
16
16
|
export type ApiCheckTokenResult = "valid" | "expired" | "invalid" | (string & {});
|
|
17
17
|
/** Response of `action=checktoken`. */
|
|
18
18
|
export interface ApiCheckTokenResponse extends ApiEnvelope {
|
|
19
|
+
/** Result of `action=checktoken`. */
|
|
19
20
|
checktoken: {
|
|
20
21
|
/** Outcome of the token check. */
|
|
21
22
|
result: ApiCheckTokenResult;
|
package/dist/core/compare.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `action=createaccount` response — AuthManager-driven account creation. The
|
|
3
|
-
* result keys under `createaccount
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* `REDIRECT`), and failures carry `message`/`messagecode`.
|
|
3
|
+
* result keys under `createaccount`: `status` drives the flow (`PASS` on
|
|
4
|
+
* success, plus in-band `FAIL`/`UI`/`RESTART`/`REDIRECT`), and failures carry
|
|
5
|
+
* `message`/`messagecode`.
|
|
7
6
|
*
|
|
8
7
|
* These are **in-band** AuthManager outcomes, not a top-level
|
|
9
8
|
* {@link ApiErrorResponse}. `username` appears on `PASS`; `UI`/`RESTART`/
|
|
@@ -12,10 +11,11 @@
|
|
|
12
11
|
*
|
|
13
12
|
* @see https://www.mediawiki.org/wiki/API:Createaccount
|
|
14
13
|
*/
|
|
15
|
-
import type { ApiAuthManagerMessage, ApiAuthManagerStatus } from "./query/authmanagerinfo";
|
|
14
|
+
import type { ApiAuthManagerMessage, ApiAuthManagerStatus, ApiQueryAuthManagerInfoRequest } from "./query/authmanagerinfo";
|
|
16
15
|
import type { ApiEnvelope } from "../envelope";
|
|
17
16
|
/** Response of `action=createaccount`. */
|
|
18
17
|
export interface ApiCreateAccountResponse extends ApiEnvelope {
|
|
18
|
+
/** Result of `action=createaccount`. */
|
|
19
19
|
createaccount: {
|
|
20
20
|
/** AuthManager outcome of the account-creation flow. */
|
|
21
21
|
status?: ApiAuthManagerStatus;
|
|
@@ -36,6 +36,6 @@ export interface ApiCreateAccountResponse extends ApiEnvelope {
|
|
|
36
36
|
/** Extra API data accompanying a `REDIRECT` outcome. */
|
|
37
37
|
redirectdata?: Record<string, unknown>;
|
|
38
38
|
/** AuthManager request descriptors for interactive (`UI`/`RESTART`) and `REDIRECT` steps. */
|
|
39
|
-
requests?:
|
|
39
|
+
requests?: ApiQueryAuthManagerInfoRequest[];
|
|
40
40
|
};
|
|
41
41
|
}
|
package/dist/core/delete.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export interface ApiDeleteResult {
|
|
|
26
26
|
}
|
|
27
27
|
/** Response of `action=delete`. */
|
|
28
28
|
export interface ApiDeleteResponse extends ApiEnvelope {
|
|
29
|
+
/** Result of `action=delete`. */
|
|
29
30
|
delete: ApiDeleteResult;
|
|
30
31
|
}
|
|
31
32
|
/** The `undelete` object of an `action=undelete` response. */
|
|
@@ -41,5 +42,6 @@ export interface ApiUndeleteResult {
|
|
|
41
42
|
}
|
|
42
43
|
/** Response of `action=undelete`. */
|
|
43
44
|
export interface ApiUndeleteResponse extends ApiEnvelope {
|
|
45
|
+
/** Result of `action=undelete`. */
|
|
44
46
|
undelete: ApiUndeleteResult;
|
|
45
47
|
}
|
package/dist/core/edit.d.ts
CHANGED
|
@@ -6,9 +6,11 @@
|
|
|
6
6
|
* - create: `new: true` plus `oldrevid: 0` / `newrevid` / `newtimestamp`;
|
|
7
7
|
* - changed: `oldrevid` / `newrevid` / `newtimestamp` (no `new`);
|
|
8
8
|
* - nochange: `nochange: true`, no revision ids.
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* A save aborted by a hook that carries status data (ConfirmEdit's captcha
|
|
10
|
+
* challenge) returns the in-band failure branch: `result: "Failure"` plus that
|
|
11
|
+
* data and no revision ids. Most hard failures (bad token, protected page,
|
|
12
|
+
* `createonly` on an existing page) surface as a top-level
|
|
13
|
+
* {@link ApiErrorResponse}, not `result: "Failure"`.
|
|
12
14
|
*
|
|
13
15
|
* @see https://www.mediawiki.org/wiki/API:Edit
|
|
14
16
|
*/
|
|
@@ -59,8 +61,26 @@ export interface ApiEditResult {
|
|
|
59
61
|
code?: string;
|
|
60
62
|
/** Human-readable failure description. */
|
|
61
63
|
info?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Captcha challenge returned when ConfirmEdit aborted the save. Present only
|
|
66
|
+
* in the in-band failure branch; {@link ApiEditCaptcha.id} and
|
|
67
|
+
* {@link ApiEditCaptcha.question} are per-request random values.
|
|
68
|
+
*/
|
|
69
|
+
captcha?: ApiEditCaptcha;
|
|
70
|
+
}
|
|
71
|
+
/** The captcha challenge of a `result: "Failure"` edit, as emitted by ConfirmEdit. */
|
|
72
|
+
export interface ApiEditCaptcha {
|
|
73
|
+
/** Captcha implementation, e.g. `simple` (arithmetic challenge) or `image`. Open union. */
|
|
74
|
+
type?: string;
|
|
75
|
+
/** MIME type the challenge renders as, e.g. `text/plain`, `image/png`, `text/html`. */
|
|
76
|
+
mime?: string;
|
|
77
|
+
/** Cache key of the pending challenge; pass it back as `captchaid` alongside the `captchaword` answer. */
|
|
78
|
+
id?: string;
|
|
79
|
+
/** Challenge text: an arithmetic expression for the sample implementation, the prompt for a question captcha. */
|
|
80
|
+
question?: string;
|
|
62
81
|
}
|
|
63
82
|
/** Response of `action=edit`. */
|
|
64
83
|
export interface ApiEditResponse extends ApiEnvelope {
|
|
84
|
+
/** Result of `action=edit`. */
|
|
65
85
|
edit: ApiEditResult;
|
|
66
86
|
}
|
package/dist/core/emailuser.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ import type { ApiSpecMessage } from "../common";
|
|
|
16
16
|
import type { ApiEnvelope } from "../envelope";
|
|
17
17
|
/** Response of `action=emailuser`. */
|
|
18
18
|
export interface ApiEmailUserResponse extends ApiEnvelope {
|
|
19
|
+
/** Result of `action=emailuser`. */
|
|
19
20
|
emailuser: {
|
|
20
21
|
/** Whether the message was accepted, or accepted with warnings, or failed. */
|
|
21
22
|
result: "Success" | "Warnings" | "Failure" | (string & {});
|
|
@@ -53,6 +53,7 @@ export interface ApiExpandTemplatesResult {
|
|
|
53
53
|
}
|
|
54
54
|
/** Response of `action=expandtemplates`. */
|
|
55
55
|
export interface ApiExpandTemplatesResponse extends ApiEnvelope {
|
|
56
|
+
/** Result of `action=expandtemplates`. */
|
|
56
57
|
expandtemplates: ApiExpandTemplatesResult;
|
|
57
58
|
/**
|
|
58
59
|
* XML parse tree of the input wikitext, emitted at the root level (outside
|
|
@@ -11,6 +11,7 @@ import type { ApiSpecMessage } from "../common";
|
|
|
11
11
|
import type { ApiEnvelope } from "../envelope";
|
|
12
12
|
/** Response of `action=filerevert`. */
|
|
13
13
|
export interface ApiFileRevertResponse extends ApiEnvelope {
|
|
14
|
+
/** Result of `action=filerevert`. */
|
|
14
15
|
filerevert: {
|
|
15
16
|
/** Outcome of the revert. */
|
|
16
17
|
result: "Success" | "Failure" | (string & {});
|
|
@@ -14,30 +14,15 @@
|
|
|
14
14
|
*
|
|
15
15
|
* @see https://www.mediawiki.org/wiki/API:Imagerotate
|
|
16
16
|
*/
|
|
17
|
-
import type {
|
|
17
|
+
import type { ApiSpecMessage } from "../common";
|
|
18
18
|
import type { ApiEnvelope } from "../envelope";
|
|
19
|
+
import type { ApiPageIdentity } from "./query";
|
|
19
20
|
/** One file entry of an `action=imagerotate` response. */
|
|
20
|
-
export interface ApiImageRotateEntry {
|
|
21
|
+
export interface ApiImageRotateEntry extends ApiPageIdentity {
|
|
21
22
|
/** Page id of the file (keyed as `id`, not `pageid`). */
|
|
22
23
|
id?: number;
|
|
23
|
-
/** Page id, for entries describing a `pageid=` that did not resolve. */
|
|
24
|
-
pageid?: number;
|
|
25
24
|
/** Revision id, for entries describing a `revid=` that did not resolve. */
|
|
26
25
|
revid?: number;
|
|
27
|
-
/** Namespace index (6 = File). */
|
|
28
|
-
ns?: NamespaceIndex;
|
|
29
|
-
/** File title. */
|
|
30
|
-
title?: string;
|
|
31
|
-
/** The title does not correspond to an existing page. A {@link Flag}. */
|
|
32
|
-
missing?: Flag;
|
|
33
|
-
/** A `missing` title that is nonetheless "known" (e.g. a redlinked file). A {@link Flag}. */
|
|
34
|
-
known?: Flag;
|
|
35
|
-
/** The requested title is malformed or otherwise invalid. A {@link Flag}. */
|
|
36
|
-
invalid?: Flag;
|
|
37
|
-
/** Reason the title is invalid (localized wikitext), alongside `invalid`. */
|
|
38
|
-
invalidreason?: string;
|
|
39
|
-
/** The requested title is a Special: page (not rotated). A {@link Flag}. */
|
|
40
|
-
special?: Flag;
|
|
41
26
|
/** Interwiki prefix, for entries describing an interwiki title. */
|
|
42
27
|
iw?: string;
|
|
43
28
|
/** Per-file outcome. */
|
|
@@ -47,5 +32,6 @@ export interface ApiImageRotateEntry {
|
|
|
47
32
|
}
|
|
48
33
|
/** Response of `action=imagerotate`. */
|
|
49
34
|
export interface ApiImageRotateResponse extends ApiEnvelope {
|
|
35
|
+
/** Result of `action=imagerotate`; one entry per rotated image. */
|
|
50
36
|
imagerotate: ApiImageRotateEntry[];
|
|
51
37
|
}
|
package/dist/core/import.d.ts
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
* uploads) right. The result is a top-level `import` **array**, one entry per
|
|
5
5
|
* imported page.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
* a successful page carries `ns`/`title` plus a `revisions` count; an
|
|
7
|
+
* A successful page carries `ns`/`title` plus a `revisions` count; an
|
|
9
8
|
* un-importable title carries `title` + an `invalid` flag.
|
|
10
9
|
*
|
|
11
10
|
* @see https://www.mediawiki.org/wiki/API:Import
|
|
@@ -25,5 +24,6 @@ export interface ApiImportEntry {
|
|
|
25
24
|
}
|
|
26
25
|
/** Response of `action=import`. */
|
|
27
26
|
export interface ApiImportResponse extends ApiEnvelope {
|
|
27
|
+
/** Result of `action=import`; one entry per imported page. */
|
|
28
28
|
import: ApiImportEntry[];
|
|
29
29
|
}
|
package/dist/core/login.d.ts
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
import type { ApiEnvelope } from "../envelope";
|
|
16
16
|
/** Response of the deprecated `action=login`. */
|
|
17
17
|
export interface ApiLoginResponse extends ApiEnvelope {
|
|
18
|
+
/** Result of `action=login`. */
|
|
18
19
|
login: {
|
|
19
20
|
/** Login outcome. */
|
|
20
21
|
result: "Success" | "Failed" | "NeedToken" | "WrongToken" | "Aborted" | (string & {});
|
|
@@ -13,6 +13,7 @@ import type { ApiEnvelope } from "../envelope";
|
|
|
13
13
|
export type ApiManageTagsOperation = "activate" | "create" | "deactivate" | "delete" | (string & {});
|
|
14
14
|
/** Response of `action=managetags`. */
|
|
15
15
|
export interface ApiManageTagsResponse extends ApiEnvelope {
|
|
16
|
+
/** Result of `action=managetags`. */
|
|
16
17
|
managetags: {
|
|
17
18
|
/** The operation that was performed. */
|
|
18
19
|
operation: ApiManageTagsOperation;
|
|
@@ -9,6 +9,7 @@ import type { Timestamp } from "../common";
|
|
|
9
9
|
import type { ApiEnvelope } from "../envelope";
|
|
10
10
|
/** Response of `action=mergehistory`. */
|
|
11
11
|
export interface ApiMergeHistoryResponse extends ApiEnvelope {
|
|
12
|
+
/** Result of `action=mergehistory`. */
|
|
12
13
|
mergehistory: {
|
|
13
14
|
/** Source page title (history moved out of). */
|
|
14
15
|
from: string;
|
package/dist/core/move.d.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Note under `formatversion=2`: `redirectcreated` / `moveoverredirect` /
|
|
6
6
|
* `talkmoveoverredirect` are real booleans (present as `false`), `reason` is
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* `''` when none was supplied, and there is **no `result` key** on a
|
|
8
|
+
* successful move. `subpages` is polymorphic: an array of per-subpage
|
|
9
9
|
* outcomes when any subpage could be processed, or an object `{ errors }` when
|
|
10
10
|
* the whole subpage move failed (e.g. the namespace forbids them).
|
|
11
11
|
*
|
|
@@ -58,5 +58,6 @@ export interface ApiMoveResult {
|
|
|
58
58
|
}
|
|
59
59
|
/** Response of `action=move`. */
|
|
60
60
|
export interface ApiMoveResponse extends ApiEnvelope {
|
|
61
|
+
/** Result of `action=move`. */
|
|
61
62
|
move: ApiMoveResult;
|
|
62
63
|
}
|
package/dist/core/options.d.ts
CHANGED
|
@@ -8,9 +8,10 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @see https://www.mediawiki.org/wiki/API:Options
|
|
10
10
|
*/
|
|
11
|
+
import type { SuccessStatus } from "../common";
|
|
11
12
|
import type { ApiEnvelope } from "../envelope";
|
|
12
13
|
/** Response of `action=options`. */
|
|
13
14
|
export interface ApiOptionsResponse extends ApiEnvelope {
|
|
14
15
|
/** Success sentinel (`"success"`); failures come back as a top-level error. */
|
|
15
|
-
options:
|
|
16
|
+
options: SuccessStatus;
|
|
16
17
|
}
|
package/dist/core/parse.d.ts
CHANGED
|
@@ -42,12 +42,12 @@ export interface ApiParseLangLink {
|
|
|
42
42
|
/** Full URL of the target page. */
|
|
43
43
|
url?: string;
|
|
44
44
|
/**
|
|
45
|
-
* Localized language name, in the request `uselang` language.
|
|
46
|
-
*
|
|
45
|
+
* Localized language name, in the request `uselang` language. Present when
|
|
46
|
+
* the target title is valid (`action=parse` has no `llprop` parameter).
|
|
47
47
|
*/
|
|
48
48
|
langname?: string;
|
|
49
49
|
/**
|
|
50
|
-
* Native language name.
|
|
50
|
+
* Native language name. Present when the target title is valid
|
|
51
51
|
* (`action=parse` has no `llprop` parameter).
|
|
52
52
|
*/
|
|
53
53
|
autonym?: string;
|
|
@@ -74,10 +74,7 @@ export interface ApiParseRedirect {
|
|
|
74
74
|
* A table-of-contents entry (`prop=sections`) — the legacy projection of the
|
|
75
75
|
* same outline `prop=tocdata` emits, with lowercase keys here (`fromtitle`,
|
|
76
76
|
* `byteoffset`) against camelCase there (`fromTitle`, `codepointOffset`); see
|
|
77
|
-
* {@link ApiParseTocSection}.
|
|
78
|
-
*
|
|
79
|
-
* `SectionMetadata::toLegacy()` fills every key below unconditionally except
|
|
80
|
-
* `extensionData`, which is only emitted when non-empty.
|
|
77
|
+
* {@link ApiParseTocSection}. `extensionData` appears only when non-empty.
|
|
81
78
|
*/
|
|
82
79
|
export interface ApiParseSection {
|
|
83
80
|
/** Nesting level in the TOC. */
|
|
@@ -139,11 +136,7 @@ export interface ApiParseTocSection {
|
|
|
139
136
|
/** Extension-supplied data for this section; `[]` when empty. */
|
|
140
137
|
extensionData?: Record<string, unknown> | unknown[];
|
|
141
138
|
}
|
|
142
|
-
/**
|
|
143
|
-
* The `tocdata` object (`prop=tocdata`). `TOCData::toJsonArray()` writes both
|
|
144
|
-
* keys unconditionally; individual section keys are the conditional ones (see
|
|
145
|
-
* {@link ApiParseTocSection}).
|
|
146
|
-
*/
|
|
139
|
+
/** The `tocdata` object (`prop=tocdata`). */
|
|
147
140
|
export interface ApiParseTocData {
|
|
148
141
|
/** The outline, in camelCase keys. */
|
|
149
142
|
sections: ApiParseTocSection[];
|
|
@@ -248,8 +241,7 @@ export interface ApiParse {
|
|
|
248
241
|
/**
|
|
249
242
|
* The script-bearing subset of {@link modules}.
|
|
250
243
|
*
|
|
251
|
-
* @deprecated since MediaWiki 1.32 —
|
|
252
|
-
* empty; read {@link modules} instead.
|
|
244
|
+
* @deprecated since MediaWiki 1.32 — always empty; read {@link modules} instead.
|
|
253
245
|
*/
|
|
254
246
|
modulescripts?: never[];
|
|
255
247
|
/**
|
|
@@ -305,6 +297,7 @@ export interface ApiParse {
|
|
|
305
297
|
}
|
|
306
298
|
/** Response of `action=parse`. */
|
|
307
299
|
export interface ApiParseResponse extends ApiEnvelope {
|
|
300
|
+
/** Result of `action=parse`. */
|
|
308
301
|
parse: ApiParse;
|
|
309
302
|
}
|
|
310
303
|
/**
|
|
@@ -313,6 +306,7 @@ export interface ApiParseResponse extends ApiEnvelope {
|
|
|
313
306
|
* `title`/`pageid` and none of the `prop` sub-objects of {@link ApiParse}.
|
|
314
307
|
*/
|
|
315
308
|
export interface ApiParseOnlyPstResponse extends ApiEnvelope {
|
|
309
|
+
/** Result of `action=parse&onlypst=1`. */
|
|
316
310
|
parse: {
|
|
317
311
|
/** Pre-save-transformed wikitext. */
|
|
318
312
|
text: string;
|
package/dist/core/patrol.d.ts
CHANGED
package/dist/core/protect.d.ts
CHANGED
package/dist/core/purge.d.ts
CHANGED
|
@@ -6,15 +6,11 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @see https://www.mediawiki.org/wiki/API:Purge
|
|
8
8
|
*/
|
|
9
|
-
import type { Flag
|
|
9
|
+
import type { Flag } from "../common";
|
|
10
10
|
import type { ApiEnvelope } from "../envelope";
|
|
11
|
-
import type { ApiQueryNormalized, ApiQueryTitlePair } from "./query";
|
|
11
|
+
import type { ApiPageIdentity, ApiQueryNormalized, ApiQueryTitlePair } from "./query";
|
|
12
12
|
/** One purged page. */
|
|
13
|
-
export interface ApiPurgeEntry {
|
|
14
|
-
/** Namespace index. */
|
|
15
|
-
ns?: NamespaceIndex;
|
|
16
|
-
/** Page title. */
|
|
17
|
-
title?: string;
|
|
13
|
+
export interface ApiPurgeEntry extends ApiPageIdentity {
|
|
18
14
|
/** Whether the page was actually purged. A {@link Flag} (appears when purged). */
|
|
19
15
|
purged?: Flag;
|
|
20
16
|
/**
|
|
@@ -22,32 +18,14 @@ export interface ApiPurgeEntry {
|
|
|
22
18
|
* `forcerecursivelinkupdate`). A {@link Flag}.
|
|
23
19
|
*/
|
|
24
20
|
linkupdate?: Flag;
|
|
25
|
-
/** Page id, for entries describing a `pageids=` value that did not resolve. */
|
|
26
|
-
pageid?: number;
|
|
27
21
|
/** Revision id, for entries describing a `revids=` value that did not resolve. */
|
|
28
22
|
revid?: number;
|
|
29
|
-
/** The requested title does not correspond to an existing page. A {@link Flag}. */
|
|
30
|
-
missing?: Flag;
|
|
31
|
-
/** A `missing` title that is nonetheless "known" (e.g. a redlinked page). A {@link Flag}. */
|
|
32
|
-
known?: Flag;
|
|
33
|
-
/** The requested title is malformed or otherwise invalid. A {@link Flag}. */
|
|
34
|
-
invalid?: Flag;
|
|
35
|
-
/** Reason the title is invalid (localized wikitext), alongside `invalid`. */
|
|
36
|
-
invalidreason?: string;
|
|
37
|
-
/** The requested title is a Special: page (not purged). A {@link Flag}. */
|
|
38
|
-
special?: Flag;
|
|
39
23
|
/** Interwiki prefix, for entries describing an interwiki title. */
|
|
40
24
|
iw?: string;
|
|
41
25
|
}
|
|
42
|
-
/** One resolved redirect (with `redirects=1`). */
|
|
43
|
-
export interface ApiPurgeRedirect {
|
|
44
|
-
/** Redirect source title. */
|
|
45
|
-
from?: string;
|
|
46
|
-
/** Title the redirect points to. */
|
|
47
|
-
to?: string;
|
|
48
|
-
}
|
|
49
26
|
/** Response of `action=purge`. */
|
|
50
27
|
export interface ApiPurgeResponse extends ApiEnvelope {
|
|
28
|
+
/** Result of `action=purge`; one entry per targeted page. */
|
|
51
29
|
purge: ApiPurgeEntry[];
|
|
52
30
|
/**
|
|
53
31
|
* Title normalizations the pageSet applied before the purge (e.g. underscore
|
|
@@ -57,5 +35,5 @@ export interface ApiPurgeResponse extends ApiEnvelope {
|
|
|
57
35
|
/** Title conversions on a language-variant wiki, same shape as `query.converted`. */
|
|
58
36
|
converted?: ApiQueryTitlePair[];
|
|
59
37
|
/** Redirect resolutions (with `redirects=1`). */
|
|
60
|
-
redirects?:
|
|
38
|
+
redirects?: ApiQueryTitlePair[];
|
|
61
39
|
}
|
|
@@ -4,10 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @see https://www.mediawiki.org/wiki/API:Allcategories
|
|
6
6
|
*/
|
|
7
|
-
/**
|
|
8
|
-
* One category summary. `acprop=size|hidden` selects the optional fields;
|
|
9
|
-
* `category` is always present.
|
|
10
|
-
*/
|
|
7
|
+
/** One category summary. `acprop=size|hidden` selects the optional fields. */
|
|
11
8
|
export interface ApiAllCategory {
|
|
12
9
|
/** Category name, without the `Category:` prefix. */
|
|
13
10
|
category: string;
|
|
@@ -8,16 +8,12 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @see https://www.mediawiki.org/wiki/API:Alldeletedrevisions
|
|
10
10
|
*/
|
|
11
|
-
import type {
|
|
11
|
+
import type { ApiPageRef } from "./shared";
|
|
12
12
|
import type { ApiRevision } from "./revisions";
|
|
13
13
|
/** One page carrying at least one deleted revision. */
|
|
14
|
-
export interface ApiAllDeletedRevisions {
|
|
14
|
+
export interface ApiAllDeletedRevisions extends ApiPageRef {
|
|
15
15
|
/** Page id; `0` when the whole page is deleted. */
|
|
16
16
|
pageid: number;
|
|
17
|
-
/** Namespace index. */
|
|
18
|
-
ns: NamespaceIndex;
|
|
19
|
-
/** Full page title. */
|
|
20
|
-
title: string;
|
|
21
17
|
/** The page's deleted revisions, ordered per `ardir` (default `older`). */
|
|
22
18
|
revisions: ApiRevision[];
|
|
23
19
|
}
|
|
@@ -14,8 +14,8 @@ export interface ApiAllLink {
|
|
|
14
14
|
/**
|
|
15
15
|
* Page id of the page holding the link (`alprop=ids`). Without `alunique` a
|
|
16
16
|
* target appears once per linking page, each row carrying that page's id;
|
|
17
|
-
* `alunique`
|
|
18
|
-
*
|
|
17
|
+
* `alunique` lists each target once and drops the source page id, so it
|
|
18
|
+
* cannot be combined with `*prop=ids`.
|
|
19
19
|
*/
|
|
20
20
|
fromid?: number;
|
|
21
21
|
/** Namespace index of the linked title. `alprop=title` (default). */
|
|
@@ -5,15 +5,9 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @see https://www.mediawiki.org/wiki/API:Allpages
|
|
7
7
|
*/
|
|
8
|
-
import type {
|
|
8
|
+
import type { ApiPageRef } from "./shared";
|
|
9
9
|
/** One page listed by `list=allpages`. */
|
|
10
|
-
export interface ApiAllPage {
|
|
11
|
-
/** Page id. */
|
|
12
|
-
pageid: number;
|
|
13
|
-
/** Namespace index. */
|
|
14
|
-
ns: NamespaceIndex;
|
|
15
|
-
/** Page title. */
|
|
16
|
-
title: string;
|
|
10
|
+
export interface ApiAllPage extends ApiPageRef {
|
|
17
11
|
}
|
|
18
12
|
declare module "./index" {
|
|
19
13
|
interface ApiQueryResult {
|
|
@@ -9,16 +9,10 @@
|
|
|
9
9
|
*
|
|
10
10
|
* @see https://www.mediawiki.org/wiki/API:Allrevisions
|
|
11
11
|
*/
|
|
12
|
-
import type {
|
|
12
|
+
import type { ApiPageRef } from "./shared";
|
|
13
13
|
import type { ApiRevision } from "./revisions";
|
|
14
14
|
/** One page with the revisions requested for it. */
|
|
15
|
-
export interface ApiAllRevisions {
|
|
16
|
-
/** Page id. */
|
|
17
|
-
pageid: number;
|
|
18
|
-
/** Namespace index. */
|
|
19
|
-
ns: NamespaceIndex;
|
|
20
|
-
/** Full page title. */
|
|
21
|
-
title: string;
|
|
15
|
+
export interface ApiAllRevisions extends ApiPageRef {
|
|
22
16
|
/** Revisions of the page, ordered per `arvdir`. */
|
|
23
17
|
revisions: ApiRevision[];
|
|
24
18
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `list=allusers` — enumerate all registered users, merged into
|
|
3
3
|
* {@link ApiQueryResult} via declaration merging. `auprop` selects which fields
|
|
4
|
-
* appear, and every entry
|
|
4
|
+
* appear, and every entry carries `userid` and `name`.
|
|
5
5
|
*
|
|
6
6
|
* Entries share the `list=users` shape ({@link ApiUser}) minus the fields this
|
|
7
7
|
* module can never emit: `gender`, `emailable`, `cancreate`,
|
|
@@ -57,8 +57,6 @@ export interface ApiQueryAuthManagerField {
|
|
|
57
57
|
optional?: boolean;
|
|
58
58
|
/** The field carries a secret (password) and is masked. */
|
|
59
59
|
sensitive?: boolean;
|
|
60
|
-
/** Additional provider-specific field metadata. */
|
|
61
|
-
[extra: string]: unknown;
|
|
62
60
|
}
|
|
63
61
|
/** The `authmanagerinfo` object returned under `query`. */
|
|
64
62
|
export interface ApiQueryAuthManagerInfo {
|