types-mediawiki-response 1.0.1 → 1.1.1
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 +7 -12
- package/dist/core/block.d.ts +9 -11
- package/dist/core/changeauthenticationdata.d.ts +1 -2
- package/dist/core/changecontentmodel.d.ts +2 -2
- package/dist/core/checktoken.d.ts +1 -2
- package/dist/core/managetags.d.ts +2 -2
- package/dist/core/options.d.ts +1 -2
- package/dist/core/query/blocks.d.ts +1 -1
- package/dist/core/query/categorymembers.d.ts +2 -4
- package/dist/core/query/index.d.ts +1 -0
- package/dist/core/query/info.d.ts +2 -2
- package/dist/core/query/languageinfo.d.ts +2 -2
- package/dist/core/query/logevents.d.ts +6 -2
- package/dist/core/query/logparams.d.ts +283 -0
- package/dist/core/query/recentchanges.d.ts +6 -2
- package/dist/core/query/siteinfo.d.ts +45 -29
- package/dist/core/query/tags.d.ts +7 -2
- package/dist/core/query/userinfo.d.ts +2 -2
- package/dist/core/query/watchlist.d.ts +6 -2
- package/dist/core/removeauthenticationdata.d.ts +1 -2
- package/dist/core/unblock.d.ts +4 -5
- package/dist/core/userrights.d.ts +4 -5
- package/dist/extensions/betafeatures.d.ts +40 -0
- package/dist/extensions/centralauth.d.ts +328 -0
- package/dist/extensions/checkuser.d.ts +19 -1
- package/dist/extensions/discussiontools.d.ts +7 -4
- package/dist/extensions/echo.d.ts +19 -16
- package/dist/extensions/flaggedrevs.d.ts +2 -2
- package/dist/extensions/globalpreferences.d.ts +2 -3
- package/dist/extensions/massmessage.d.ts +2 -3
- package/dist/extensions/sitematrix.d.ts +2 -2
- package/dist/extensions/timedmediahandler.d.ts +7 -3
- package/dist/extensions/translate.d.ts +524 -0
- package/dist/extensions/uls.d.ts +52 -0
- package/dist/extensions/visualeditor.d.ts +20 -12
- package/package.json +2 -1
package/dist/common/index.d.ts
CHANGED
|
@@ -23,6 +23,11 @@ export type Expiry = Timestamp | "infinity";
|
|
|
23
23
|
* literal `infinite` for an indefinite block.
|
|
24
24
|
*/
|
|
25
25
|
export type BlockExpiry = Timestamp | "infinite";
|
|
26
|
+
/**
|
|
27
|
+
* Expiry of a watch: a timestamp, or `null` when the page is not watched or
|
|
28
|
+
* the watch is permanent.
|
|
29
|
+
*/
|
|
30
|
+
export type WatchlistExpiry = Timestamp | null;
|
|
26
31
|
/**
|
|
27
32
|
* A block of plain text (as opposed to HTML), e.g. a TextExtracts excerpt
|
|
28
33
|
* requested with `explaintext`. Kept distinct from HTML-bearing string fields.
|
|
@@ -30,16 +35,6 @@ export type BlockExpiry = Timestamp | "infinite";
|
|
|
30
35
|
export type PlainText = string;
|
|
31
36
|
/** Namespace index. Negative indexes are pseudo-namespaces. */
|
|
32
37
|
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 & {});
|
|
43
38
|
/**
|
|
44
39
|
* A structured in-band message — a serialized MediaWiki `Message`/`FatalError`
|
|
45
40
|
* spec (`{ message, params, code, type }`) nested inside an action result
|
|
@@ -81,7 +76,7 @@ export interface ApiWatchlistLabel {
|
|
|
81
76
|
* promote their own models by augmenting {@link ContentModelExtension}
|
|
82
77
|
* (e.g. `MassMessageListContent` from the MassMessage pack); consumers may
|
|
83
78
|
* augment the same interface for site-specific models registered through
|
|
84
|
-
* `$
|
|
79
|
+
* `$wgContentHandlers`.
|
|
85
80
|
*/
|
|
86
81
|
export type ContentModel = "wikitext" | "javascript" | "css" | "json" | "text" | "Scribunto" | ContentModelExtension[keyof ContentModelExtension] | (string & {});
|
|
87
82
|
/**
|
|
@@ -91,7 +86,7 @@ export type ContentModel = "wikitext" | "javascript" | "css" | "json" | "text" |
|
|
|
91
86
|
* {@link ContentModel}.
|
|
92
87
|
*
|
|
93
88
|
* @example
|
|
94
|
-
* // A site-specific model registered through $
|
|
89
|
+
* // A site-specific model registered through $wgContentHandlers:
|
|
95
90
|
* declare module "types-mediawiki-response" {
|
|
96
91
|
* interface ContentModelExtension {
|
|
97
92
|
* MyModel: "my-model";
|
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 { BlockExpiry, Timestamp } from "../common";
|
|
12
|
+
import type { BlockExpiry, Timestamp, WatchlistExpiry } from "../common";
|
|
13
13
|
import type { ApiEnvelope } from "../envelope";
|
|
14
14
|
/** The `block` object of an `action=block` response. */
|
|
15
15
|
export interface ApiBlockResult {
|
|
@@ -40,19 +40,17 @@ export interface ApiBlockResult {
|
|
|
40
40
|
/** Restrict the block to specific pages or namespaces instead of sitewide. */
|
|
41
41
|
partial: boolean;
|
|
42
42
|
/** Page restrictions of a partial block; `null` when sitewide. */
|
|
43
|
-
pagerestrictions:
|
|
43
|
+
pagerestrictions: string[] | null;
|
|
44
44
|
/** Namespace restrictions of a partial block; `null` when sitewide. */
|
|
45
|
-
namespacerestrictions:
|
|
45
|
+
namespacerestrictions: number[] | null;
|
|
46
|
+
/** Expiry applied to the watched user page. */
|
|
47
|
+
watchlistexpiry?: WatchlistExpiry;
|
|
46
48
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
+
* Restricted actions of a partial action block; `null` when the block
|
|
50
|
+
* restricts no actions. Only emitted on MediaWiki 1.39–1.44 when
|
|
51
|
+
* `$wgEnablePartialActionBlocks` is on.
|
|
49
52
|
*/
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Restricted actions of a partial action block; only emitted when
|
|
53
|
-
* `$wgEnablePartialActionBlocks` is enabled.
|
|
54
|
-
*/
|
|
55
|
-
actionrestrictions?: string[];
|
|
53
|
+
actionrestrictions?: string[] | null;
|
|
56
54
|
/**
|
|
57
55
|
* When the block was applied, in ISO 8601.
|
|
58
56
|
*
|
|
@@ -8,13 +8,12 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @see https://www.mediawiki.org/wiki/API:Changeauthenticationdata
|
|
10
10
|
*/
|
|
11
|
-
import type { SuccessStatus } from "../common";
|
|
12
11
|
import type { ApiEnvelope } from "../envelope";
|
|
13
12
|
/** Response of `action=changeauthenticationdata`. */
|
|
14
13
|
export interface ApiChangeAuthenticationDataResponse extends ApiEnvelope {
|
|
15
14
|
/** Result of `action=changeauthenticationdata`. */
|
|
16
15
|
changeauthenticationdata: {
|
|
17
16
|
/** Flow outcome; `success` when the change was applied. */
|
|
18
|
-
status:
|
|
17
|
+
status: "success";
|
|
19
18
|
};
|
|
20
19
|
}
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @see https://www.mediawiki.org/wiki/API:Changecontentmodel
|
|
8
8
|
*/
|
|
9
|
-
import type { ContentModel
|
|
9
|
+
import type { ContentModel } from "../common";
|
|
10
10
|
import type { ApiEnvelope } from "../envelope";
|
|
11
11
|
/** Response of `action=changecontentmodel`. */
|
|
12
12
|
export interface ApiChangeContentModelResponse extends ApiEnvelope {
|
|
13
13
|
/** Result of `action=changecontentmodel`. */
|
|
14
14
|
changecontentmodel: {
|
|
15
15
|
/** `Success` when the model was changed. */
|
|
16
|
-
result:
|
|
16
|
+
result: "Success";
|
|
17
17
|
/** Page title. */
|
|
18
18
|
title: string;
|
|
19
19
|
/** Page id. */
|
|
@@ -6,14 +6,13 @@
|
|
|
6
6
|
* `maxtokenage`), or `invalid`. `generated` is decoded from the submitted
|
|
7
7
|
* token itself (MediaWiki tokens embed their generation time), so it appears
|
|
8
8
|
* whenever the token carries a timestamp — an old token reports its own age.
|
|
9
|
-
* Modeled as an open union for forward compatibility.
|
|
10
9
|
*
|
|
11
10
|
* @see https://www.mediawiki.org/wiki/API:Checktoken
|
|
12
11
|
*/
|
|
13
12
|
import type { Timestamp } from "../common";
|
|
14
13
|
import type { ApiEnvelope } from "../envelope";
|
|
15
14
|
/** Result values of {@link ApiCheckTokenResponse}. */
|
|
16
|
-
export type ApiCheckTokenResult = "valid" | "expired" | "invalid"
|
|
15
|
+
export type ApiCheckTokenResult = "valid" | "expired" | "invalid";
|
|
17
16
|
/** Response of `action=checktoken`. */
|
|
18
17
|
export interface ApiCheckTokenResponse extends ApiEnvelope {
|
|
19
18
|
/** Result of `action=checktoken`. */
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import type { ApiSpecMessage } from "../common";
|
|
11
11
|
import type { ApiEnvelope, ApiMessage } from "../envelope";
|
|
12
|
-
/** `action=managetags` operation
|
|
13
|
-
export type ApiManageTagsOperation = "activate" | "create" | "deactivate" | "delete"
|
|
12
|
+
/** `action=managetags` operation, echoed from the request. */
|
|
13
|
+
export type ApiManageTagsOperation = "activate" | "create" | "deactivate" | "delete";
|
|
14
14
|
/** Response of `action=managetags`. */
|
|
15
15
|
export interface ApiManageTagsResponse extends ApiEnvelope {
|
|
16
16
|
/** Result of `action=managetags`. */
|
package/dist/core/options.d.ts
CHANGED
|
@@ -8,10 +8,9 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @see https://www.mediawiki.org/wiki/API:Options
|
|
10
10
|
*/
|
|
11
|
-
import type { SuccessStatus } from "../common";
|
|
12
11
|
import type { ApiEnvelope } from "../envelope";
|
|
13
12
|
/** Response of `action=options`. */
|
|
14
13
|
export interface ApiOptionsResponse extends ApiEnvelope {
|
|
15
14
|
/** Success sentinel (`"success"`); failures come back as a top-level error. */
|
|
16
|
-
options:
|
|
15
|
+
options: "success";
|
|
17
16
|
}
|
|
@@ -19,7 +19,7 @@ export interface ApiBlockRestrictions {
|
|
|
19
19
|
}[];
|
|
20
20
|
/** Restricted namespace ids. */
|
|
21
21
|
namespaces?: number[];
|
|
22
|
-
/** Restricted actions; only on
|
|
22
|
+
/** Restricted actions; only on action-type entries. Before MediaWiki 1.45 these require `$wgEnablePartialActionBlocks`. */
|
|
23
23
|
actions?: string[];
|
|
24
24
|
}
|
|
25
25
|
/** One block record. `bkprop` controls which fields appear. */
|
|
@@ -9,10 +9,8 @@
|
|
|
9
9
|
* @see https://www.mediawiki.org/wiki/API:Categorymembers
|
|
10
10
|
*/
|
|
11
11
|
import type { NamespaceIndex, Timestamp } from "../../common";
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
*/
|
|
15
|
-
export type CategoryMemberType = "page" | "subcat" | "file" | (string & {});
|
|
12
|
+
/** Member type (`cmtype` / `gcmtype`). */
|
|
13
|
+
export type CategoryMemberType = "page" | "subcat" | "file";
|
|
16
14
|
/** One category member. `cmprop` controls which fields appear. */
|
|
17
15
|
export interface ApiCategoryMember {
|
|
18
16
|
/** Page id. `cmprop=ids`. */
|
|
@@ -448,6 +448,7 @@ export interface ApiQueryResponse extends ApiEnvelope {
|
|
|
448
448
|
"query-noncontinue"?: Record<string, Record<string, string | number>>;
|
|
449
449
|
}
|
|
450
450
|
export * from "./shared";
|
|
451
|
+
export * from "./logparams";
|
|
451
452
|
export * from "./info";
|
|
452
453
|
export * from "./categories";
|
|
453
454
|
export * from "./revisions";
|
|
@@ -58,8 +58,8 @@ export interface ApiPageInfo {
|
|
|
58
58
|
pagelanguage?: string;
|
|
59
59
|
/** HTML `lang` attribute value for the page language. */
|
|
60
60
|
pagelanguagehtmlcode?: string;
|
|
61
|
-
/** Writing direction of the page language.
|
|
62
|
-
pagelanguagedir?: "ltr" | "rtl"
|
|
61
|
+
/** Writing direction of the page language. */
|
|
62
|
+
pagelanguagedir?: "ltr" | "rtl";
|
|
63
63
|
/** When the page was last touched (cache/link invalidation), not last edited. Existing pages only. */
|
|
64
64
|
touched?: Timestamp;
|
|
65
65
|
/** Revision id of the latest revision. Existing pages only. */
|
|
@@ -11,8 +11,8 @@ export interface ApiLanguageInfo {
|
|
|
11
11
|
code?: string;
|
|
12
12
|
/** BCP 47 language tag. `liprop=bcp47`. */
|
|
13
13
|
bcp47?: string;
|
|
14
|
-
/** Writing direction. `liprop=dir`.
|
|
15
|
-
dir?: "ltr" | "rtl"
|
|
14
|
+
/** Writing direction. `liprop=dir`. */
|
|
15
|
+
dir?: "ltr" | "rtl";
|
|
16
16
|
/** Name in the language itself. `liprop=autonym`. */
|
|
17
17
|
autonym?: string;
|
|
18
18
|
/** Name in the content/`uselang` language. `liprop=name`. */
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import type { Flag, NamespaceIndex, Timestamp } from "../../common";
|
|
11
11
|
import type { ApiHiddenFlags } from "./shared";
|
|
12
|
+
import type { ApiLogEventParams } from "./logparams";
|
|
12
13
|
/** One log event. `leprop` controls which fields appear. */
|
|
13
14
|
export interface ApiLogEvent extends ApiHiddenFlags {
|
|
14
15
|
/** Log record id. `leprop=ids`. */
|
|
@@ -31,8 +32,11 @@ export interface ApiLogEvent extends ApiHiddenFlags {
|
|
|
31
32
|
type?: string;
|
|
32
33
|
/** Log action, e.g. `create`, `delete`. `leprop=type`. */
|
|
33
34
|
action?: string;
|
|
34
|
-
/**
|
|
35
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Structured log details; shape varies by `type`/`action` — see
|
|
37
|
+
* {@link ApiLogEventParams}. `leprop=details`.
|
|
38
|
+
*/
|
|
39
|
+
params?: ApiLogEventParams;
|
|
36
40
|
/** Performing user name (or IP). `leprop=user`. */
|
|
37
41
|
user?: string;
|
|
38
42
|
/** Performing user id. `leprop=userid`. */
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured details of log events, shared by `logevents.params`,
|
|
3
|
+
* `recentchanges.logparams` and `watchlist.logparams`.
|
|
4
|
+
*/
|
|
5
|
+
import type { ContentModel, Expiry, Timestamp } from "../../common";
|
|
6
|
+
/**
|
|
7
|
+
* Structured log details — the `params` object of a log event (`leprop=details`
|
|
8
|
+
* on `list=logevents`, `logparams` under the log-info fields of
|
|
9
|
+
* `list=recentchanges` / `list=watchlist`).
|
|
10
|
+
*
|
|
11
|
+
* Each log action writes its own key set, which the server normalizes for the
|
|
12
|
+
* API. The keys below are the ones MediaWiki core itself writes; which of
|
|
13
|
+
* them a row carries depends on its `type`/`action`.
|
|
14
|
+
*
|
|
15
|
+
* The key space is open: extensions and site configuration can register
|
|
16
|
+
* further log actions, and rows written by older MediaWiki versions keep
|
|
17
|
+
* their historical key forms. Unknown keys therefore fall back to `unknown`
|
|
18
|
+
* instead of erroring. Consumers targeting one specific log action — or a
|
|
19
|
+
* site-custom one — can add its keys through interface merging:
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* declare module "types-mediawiki-response" {
|
|
23
|
+
* interface ApiLogEventParams {
|
|
24
|
+
* // a site-custom log action, or a legacy key form still in the data
|
|
25
|
+
* "4::target"?: string;
|
|
26
|
+
* }
|
|
27
|
+
* }
|
|
28
|
+
*/
|
|
29
|
+
export interface ApiLogEventParams {
|
|
30
|
+
/**
|
|
31
|
+
* Block duration as configured: `'infinity'` or the raw specifier
|
|
32
|
+
* (`'2 weeks'`, …), on `block/block`, `block/reblock`, `suppress/block` and
|
|
33
|
+
* `suppress/reblock` rows. Older rows without one are normalized to
|
|
34
|
+
* `'infinity'`.
|
|
35
|
+
*/
|
|
36
|
+
duration?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Options in force on the block. Rows written by very old MediaWiki
|
|
39
|
+
* versions may carry the legacy values `autoblock` or `angry-autoblock`
|
|
40
|
+
* instead of the current flag set. An array (`[]` when none).
|
|
41
|
+
*/
|
|
42
|
+
flags?: Array<"anononly" | "nocreate" | "noautoblock" | "noemail" | "nousertalk" | "hiddenname" | "autoblock" | "angry-autoblock">;
|
|
43
|
+
/**
|
|
44
|
+
* Absolute expiry of the block (ISO 8601), on rows with a finite duration.
|
|
45
|
+
*/
|
|
46
|
+
expiry?: Timestamp;
|
|
47
|
+
/** Whether the block covers the whole site (`false` for a partial block). */
|
|
48
|
+
sitewide?: boolean;
|
|
49
|
+
/** Scope of a partial block; absent for sitewide blocks. */
|
|
50
|
+
restrictions?: ApiLogBlockRestrictions;
|
|
51
|
+
/**
|
|
52
|
+
* Id of the block the row created or changed.
|
|
53
|
+
*
|
|
54
|
+
* @since MediaWiki 1.44
|
|
55
|
+
*/
|
|
56
|
+
blockId?: number;
|
|
57
|
+
/**
|
|
58
|
+
* Localized duration text (e.g. `'14 days'`, `'infinite'`), in the
|
|
59
|
+
* requesting user's language.
|
|
60
|
+
*
|
|
61
|
+
* @since MediaWiki 1.44
|
|
62
|
+
*/
|
|
63
|
+
"duration-l10n"?: string;
|
|
64
|
+
/** Namespace of the move destination (on `move/move` and `move/move_redir` rows). */
|
|
65
|
+
target_ns?: number;
|
|
66
|
+
/** Title of the move destination. */
|
|
67
|
+
target_title?: string;
|
|
68
|
+
/** Whether the move left no redirect behind. */
|
|
69
|
+
suppressredirect?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Content-language protection summary (e.g. `'[edit=autoconfirmed]
|
|
72
|
+
* (indefinite)'`), aimed at machine feeds; the structured data lives in
|
|
73
|
+
* {@link details}.
|
|
74
|
+
*/
|
|
75
|
+
description?: string;
|
|
76
|
+
/** Whether cascading protection was requested. */
|
|
77
|
+
cascade?: boolean;
|
|
78
|
+
/** Protection restrictions in force. */
|
|
79
|
+
details?: ApiLogProtectDetail[];
|
|
80
|
+
/** Namespace of the title the protection moved away from. */
|
|
81
|
+
oldtitle_ns?: number;
|
|
82
|
+
/** Title the protection moved away from. */
|
|
83
|
+
oldtitle_title?: string;
|
|
84
|
+
/**
|
|
85
|
+
* How many revisions and archived file versions the undeletion restored
|
|
86
|
+
* (`delete/restore`), how many revisions an import created
|
|
87
|
+
* (`import/upload`, `import/interwiki`), or how many uses a managed tag
|
|
88
|
+
* had (`managetags/activate|deactivate|delete`).
|
|
89
|
+
*/
|
|
90
|
+
count?: {
|
|
91
|
+
revisions: number;
|
|
92
|
+
files: number;
|
|
93
|
+
} | number;
|
|
94
|
+
/**
|
|
95
|
+
* What the visibility change targeted: `'revision'`, `'archive'`,
|
|
96
|
+
* `'oldimage'` or `'filearchive'` on `…/revision` rows; `'logging'` on
|
|
97
|
+
* `…/event` rows.
|
|
98
|
+
*/
|
|
99
|
+
type?: "revision" | "archive" | "oldimage" | "filearchive" | "logging";
|
|
100
|
+
/**
|
|
101
|
+
* Ids of the targeted revisions, file versions or log entries — numbers on
|
|
102
|
+
* current rows, strings on legacy ones.
|
|
103
|
+
*/
|
|
104
|
+
ids?: Array<number | string>;
|
|
105
|
+
/** Visibility state before the change. */
|
|
106
|
+
old?: ApiLogRevDelVisibility;
|
|
107
|
+
/** Visibility state after the change. */
|
|
108
|
+
new?: ApiLogRevDelVisibility;
|
|
109
|
+
/**
|
|
110
|
+
* Id of the account the row reports (on `newusers/create`, `newusers/create2`
|
|
111
|
+
* and `newusers/autocreate` rows).
|
|
112
|
+
*/
|
|
113
|
+
userid?: number;
|
|
114
|
+
/**
|
|
115
|
+
* Groups the target user belonged to before the change (on `rights/rights`
|
|
116
|
+
* and `rights/autopromote` rows).
|
|
117
|
+
*/
|
|
118
|
+
oldgroups?: string[];
|
|
119
|
+
/** Groups after the change. */
|
|
120
|
+
newgroups?: string[];
|
|
121
|
+
/**
|
|
122
|
+
* Per-group membership expiry, parallel to {@link oldgroups}; `[]` when the
|
|
123
|
+
* memberships were all permanent. Absent on `rights/autopromote` rows.
|
|
124
|
+
*/
|
|
125
|
+
oldmetadata?: ApiLogGroupMetadata[];
|
|
126
|
+
/**
|
|
127
|
+
* Per-group membership expiry, parallel to {@link newgroups}; `[]` when
|
|
128
|
+
* permanent. Absent on `rights/autopromote` rows.
|
|
129
|
+
*/
|
|
130
|
+
newmetadata?: ApiLogGroupMetadata[];
|
|
131
|
+
/**
|
|
132
|
+
* Content model before the change (on `contentmodel/change` and
|
|
133
|
+
* `contentmodel/new` rows).
|
|
134
|
+
*/
|
|
135
|
+
oldmodel?: ContentModel;
|
|
136
|
+
/** Content model after the change. */
|
|
137
|
+
newmodel?: ContentModel;
|
|
138
|
+
/** Namespace of the page the history was merged into. */
|
|
139
|
+
dest_ns?: number;
|
|
140
|
+
/** Title of the page the history was merged into. */
|
|
141
|
+
dest_title?: string;
|
|
142
|
+
/**
|
|
143
|
+
* Namespace of the page whose history was merged in (`merge/merge-into` row
|
|
144
|
+
* filed on the destination page).
|
|
145
|
+
*
|
|
146
|
+
* @since MediaWiki 1.45
|
|
147
|
+
*/
|
|
148
|
+
src_ns?: number;
|
|
149
|
+
/**
|
|
150
|
+
* Title of the page whose history was merged in (`merge/merge-into`).
|
|
151
|
+
*
|
|
152
|
+
* @since MediaWiki 1.45
|
|
153
|
+
*/
|
|
154
|
+
src_title?: string;
|
|
155
|
+
/**
|
|
156
|
+
* Revision the histories were interleaved at (ISO 8601), on `merge/merge`
|
|
157
|
+
* and `merge/merge-into` rows.
|
|
158
|
+
*/
|
|
159
|
+
mergepoint?: Timestamp;
|
|
160
|
+
/**
|
|
161
|
+
* Boundary revision id the merge stopped at; stored raw, so it appears as
|
|
162
|
+
* a number or its decimal string.
|
|
163
|
+
*
|
|
164
|
+
* @since MediaWiki 1.42
|
|
165
|
+
*/
|
|
166
|
+
mergerevid?: number | string;
|
|
167
|
+
/**
|
|
168
|
+
* Timestamp of the first revision kept out of the merge, when a start
|
|
169
|
+
* boundary was used (ISO 8601); the id of that revision is
|
|
170
|
+
* {@link mergestartid}. Only `merge/merge` rows carry it — `merge/merge-into`
|
|
171
|
+
* rows do not report the start boundary at all.
|
|
172
|
+
*
|
|
173
|
+
* @since MediaWiki 1.45
|
|
174
|
+
*/
|
|
175
|
+
mergestart?: Timestamp;
|
|
176
|
+
/**
|
|
177
|
+
* First revision id kept out of the merge; stored raw like
|
|
178
|
+
* {@link mergerevid}.
|
|
179
|
+
*
|
|
180
|
+
* @since MediaWiki 1.45
|
|
181
|
+
*/
|
|
182
|
+
mergestartid?: number | string;
|
|
183
|
+
/** Namespace of the source page on the foreign wiki (`import/interwiki`). */
|
|
184
|
+
interwiki_ns?: number;
|
|
185
|
+
/** Source page on the foreign wiki, with its interwiki prefix (`import/interwiki`). */
|
|
186
|
+
interwiki_title?: string;
|
|
187
|
+
/**
|
|
188
|
+
* SHA-1 of the uploaded file (base36), on `upload/upload`, `upload/overwrite`
|
|
189
|
+
* and `upload/revert` rows.
|
|
190
|
+
*/
|
|
191
|
+
img_sha1?: string;
|
|
192
|
+
/** File timestamp (ISO 8601), which can differ from the row's timestamp. */
|
|
193
|
+
img_timestamp?: Timestamp;
|
|
194
|
+
/** Revision id that was marked patrolled, on `patrol/patrol` rows. */
|
|
195
|
+
curid?: number;
|
|
196
|
+
/** Revision id the patrolled one followed. */
|
|
197
|
+
previd?: number;
|
|
198
|
+
/** Always `false`: automatic patrols are not logged. */
|
|
199
|
+
auto?: boolean;
|
|
200
|
+
/**
|
|
201
|
+
* Revision the tags were applied to (`tag/update` rows); a raw value from
|
|
202
|
+
* the tagging caller, so forms vary (a number, its decimal string, or
|
|
203
|
+
* `false` when the update targeted a log entry).
|
|
204
|
+
*/
|
|
205
|
+
revid?: number | string | false;
|
|
206
|
+
/**
|
|
207
|
+
* Log entry the tags were applied to, on rows that targeted one; a raw
|
|
208
|
+
* value like {@link revid} — `false` when the update targeted a revision.
|
|
209
|
+
*/
|
|
210
|
+
logid?: number | string | false;
|
|
211
|
+
/** Tags the update added. */
|
|
212
|
+
tagsAdded?: string[];
|
|
213
|
+
/** How many tags {@link tagsAdded} holds. */
|
|
214
|
+
tagsAddedCount?: number;
|
|
215
|
+
/** Tags the update removed. */
|
|
216
|
+
tagsRemoved?: string[];
|
|
217
|
+
/** How many tags {@link tagsRemoved} holds. */
|
|
218
|
+
tagsRemovedCount?: number;
|
|
219
|
+
/** Tags the target carried before the update. */
|
|
220
|
+
initialTags?: string[];
|
|
221
|
+
/** Name of the managed tag (`managetags/create|activate|deactivate|delete`). */
|
|
222
|
+
tag?: string;
|
|
223
|
+
/**
|
|
224
|
+
* Page language before the change, on `pagelang/pagelang` rows; the wiki's
|
|
225
|
+
* default language carries a `[def]` suffix (e.g. `'en[def]'`).
|
|
226
|
+
*/
|
|
227
|
+
oldlanguage?: string;
|
|
228
|
+
/** Page language after the change; also `[def]`-suffixed when set to default. */
|
|
229
|
+
newlanguage?: string;
|
|
230
|
+
/**
|
|
231
|
+
* Any other parameter a log action attaches — a log action registered by an
|
|
232
|
+
* extension or site configuration, or a legacy key form on rows written by
|
|
233
|
+
* an older MediaWiki version.
|
|
234
|
+
*/
|
|
235
|
+
[key: string]: unknown;
|
|
236
|
+
}
|
|
237
|
+
/** One page a partial block is restricted to (`restrictions.pages` entry). */
|
|
238
|
+
export interface ApiLogPageRef {
|
|
239
|
+
/** Namespace index. */
|
|
240
|
+
page_ns: number;
|
|
241
|
+
/** Full page title. */
|
|
242
|
+
page_title: string;
|
|
243
|
+
}
|
|
244
|
+
/** Scope of a partial block (`restrictions`). */
|
|
245
|
+
export interface ApiLogBlockRestrictions {
|
|
246
|
+
/** Pages the block is restricted to. */
|
|
247
|
+
pages?: ApiLogPageRef[];
|
|
248
|
+
/** Namespace indexes the block is restricted to. */
|
|
249
|
+
namespaces?: number[];
|
|
250
|
+
/** Action names the block is restricted to (e.g. `'edit'`). */
|
|
251
|
+
actions?: string[];
|
|
252
|
+
}
|
|
253
|
+
/** One protection restriction (`details` entry on `protect/protect`, `protect/modify`). */
|
|
254
|
+
export interface ApiLogProtectDetail {
|
|
255
|
+
/** Action being restricted (e.g. `'edit'`); `'create'` for title protection. */
|
|
256
|
+
type: string;
|
|
257
|
+
/** Protection level (e.g. `'autoconfirmed'`, `'sysop'`). */
|
|
258
|
+
level: string;
|
|
259
|
+
/** When the protection lapses (ISO 8601), or `'infinite'`. */
|
|
260
|
+
expiry: Timestamp | "infinite";
|
|
261
|
+
/** Whether this restriction cascades; absent on `'create'` entries. */
|
|
262
|
+
cascade?: boolean;
|
|
263
|
+
}
|
|
264
|
+
/** One visibility state (`old`/`new` on a RevisionDelete row). */
|
|
265
|
+
export interface ApiLogRevDelVisibility {
|
|
266
|
+
/** Raw visibility bitfield. */
|
|
267
|
+
bitmask: number;
|
|
268
|
+
/** Whether the content is hidden. */
|
|
269
|
+
content: boolean;
|
|
270
|
+
/** Whether the edit summary is hidden. */
|
|
271
|
+
comment: boolean;
|
|
272
|
+
/** Whether the performer is hidden. */
|
|
273
|
+
user: boolean;
|
|
274
|
+
/** Whether only suppressors can unhide. */
|
|
275
|
+
restricted: boolean;
|
|
276
|
+
}
|
|
277
|
+
/** One group-membership change with its expiry (`oldmetadata`/`newmetadata` entry). */
|
|
278
|
+
export interface ApiLogGroupMetadata {
|
|
279
|
+
/** Group name. */
|
|
280
|
+
group: string;
|
|
281
|
+
/** When the membership lapses. */
|
|
282
|
+
expiry: Expiry;
|
|
283
|
+
}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import type { Flag, NamespaceIndex, Timestamp } from "../../common";
|
|
11
11
|
import type { ApiHiddenFlags } from "./shared";
|
|
12
|
+
import type { ApiLogEventParams } from "./logparams";
|
|
12
13
|
/** Change type (`rctype`). Open union for forward compatibility. */
|
|
13
14
|
export type RecentChangeType = "edit" | "new" | "log" | "categorize" | "external" | (string & {});
|
|
14
15
|
/** One recent-changes entry. `rcprop` controls which fields appear. */
|
|
@@ -83,8 +84,11 @@ export interface ApiRecentChange extends ApiHiddenFlags {
|
|
|
83
84
|
logtype?: string;
|
|
84
85
|
/** Log action, e.g. `create`. `rcprop=loginfo`. */
|
|
85
86
|
logaction?: string;
|
|
86
|
-
/**
|
|
87
|
-
|
|
87
|
+
/**
|
|
88
|
+
* Structured log details — see {@link ApiLogEventParams}. `rcprop=loginfo`
|
|
89
|
+
* (only for `type=log`).
|
|
90
|
+
*/
|
|
91
|
+
logparams?: ApiLogEventParams;
|
|
88
92
|
}
|
|
89
93
|
declare module "./index" {
|
|
90
94
|
interface ApiQueryResult {
|