ApiQueryRevisions: Fix error message key
[lhc/web/wiklou.git] / docs / extension.schema.v1.json
1 {
2 "$schema": "http://json-schema.org/schema#",
3 "description": "MediaWiki extension.json schema",
4 "type": "object",
5 "properties": {
6 "manifest_version": {
7 "type": "integer",
8 "description": "Version of the extension.json schema the extension.json file is in.",
9 "required": true
10 },
11 "name": {
12 "type": "string",
13 "description": "The extension's canonical name.",
14 "required": true
15 },
16 "namemsg": {
17 "type": "string",
18 "description": "i18n message key of the extension's name."
19 },
20 "type": {
21 "type": "string",
22 "description": "The extension's type, as an index to $wgExtensionCredits.",
23 "default": "other"
24 },
25 "author": {
26 "type": [
27 "string",
28 "array"
29 ],
30 "description": "Extension's authors.",
31 "items": {
32 "type": "string"
33 }
34 },
35 "version": {
36 "type": "string",
37 "description": "The version of this release of the extension."
38 },
39 "url": {
40 "type": "string",
41 "description": "URL to the homepage for the extension.",
42 "format": "uri-reference"
43 },
44 "description": {
45 "type": "string",
46 "description": "Raw description of the extension."
47 },
48 "descriptionmsg": {
49 "type": "string",
50 "description": "Message key for a i18n message describing the extension."
51 },
52 "license-name": {
53 "type": "string",
54 "description": "SPDX identifier for the license under which the extension is released."
55 },
56 "requires": {
57 "type": "object",
58 "description": "Indicates what versions of PHP, MediaWiki core or extensions are required. This syntax may be extended in the future, for example to check dependencies between other services.",
59 "additionalProperties": false,
60 "properties": {
61 "MediaWiki": {
62 "type": "string",
63 "description": "Version constraint string against MediaWiki core."
64 },
65 "platform": {
66 "type": "object",
67 "description": "Indicates version constraints against platform services.",
68 "additionalProperties": false,
69 "properties": {
70 "php": {
71 "type": "string",
72 "description": "Version constraint string against PHP."
73 },
74 "ability-shell": {
75 "type": "boolean",
76 "default": false,
77 "description": "Whether this extension requires shell access."
78 }
79 },
80 "patternProperties": {
81 "^ext-": {
82 "type": "string",
83 "description": "Required PHP extension.",
84 "enum": ["*"]
85 }
86 }
87 },
88 "extensions": {
89 "type": "object",
90 "description": "Set of version constraint strings against specific extensions."
91 },
92 "skins": {
93 "type": "object",
94 "description": "Set of version constraint strings against specific skins."
95 }
96 }
97 },
98 "ResourceFileModulePaths": {
99 "type": "object",
100 "description": "Default paths to use for all ResourceLoader file modules",
101 "additionalProperties": false,
102 "properties": {
103 "localBasePath": {
104 "type": "string",
105 "description": "Base path to prepend to all local paths, relative to current directory"
106 },
107 "remoteExtPath": {
108 "type": "string",
109 "description": "Base path to prepend to all remote paths, relative to $wgExtensionAssetsPath"
110 },
111 "remoteSkinPath": {
112 "type": "string",
113 "description": "Base path to prepend to all remote paths, relative to $wgStylePath"
114 }
115 }
116 },
117 "ResourceModules": {
118 "type": "object",
119 "description": "ResourceLoader modules to register",
120 "patternProperties": {
121 "^[a-zA-Z0-9-\\.]+$": {
122 "type": "object",
123 "anyOf": [
124 {
125 "description": "A ResourceLoaderFileModule definition",
126 "additionalProperties": false,
127 "properties": {
128 "localBasePath": {
129 "type": "string",
130 "description": "Base path to prepend to all local paths in $options. Defaults to $IP"
131 },
132 "remoteBasePath": {
133 "type": "string",
134 "description": "Base path to prepend to all remote paths in $options. Defaults to $wgScriptPath"
135 },
136 "remoteExtPath": {
137 "type": "string",
138 "description": "Equivalent of remoteBasePath, but relative to $wgExtensionAssetsPath"
139 },
140 "skipFunction": {
141 "type": "string",
142 "description": "Path to a file containing a JavaScript \"skip function\", if desired."
143 },
144 "scripts": {
145 "type": ["string", "array"],
146 "description": "Scripts to always include (array of file paths)",
147 "items": {
148 "type": "string"
149 }
150 },
151 "languageScripts": {
152 "type": "object",
153 "description": "Scripts to include in specific language contexts (mapping of language code to file path(s))",
154 "patternProperties": {
155 "^[a-zA-Z0-9-]{2,}$": {
156 "type": [
157 "string",
158 "array"
159 ],
160 "items": {
161 "type": "string"
162 }
163 }
164 }
165 },
166 "skinScripts": {
167 "type": "object",
168 "description": "Scripts to include in specific skin contexts (mapping of skin name to script(s)",
169 "patternProperties": {
170 ".+": {
171 "type": [
172 "string",
173 "array"
174 ],
175 "items": {
176 "type": "string"
177 }
178 }
179 }
180 },
181 "debugScripts": {
182 "type": ["string", "array"],
183 "description": "Scripts to include in debug contexts",
184 "items": {
185 "type": "string"
186 }
187 },
188 "loaderScripts": {
189 "type": ["string", "array"],
190 "description": "Scripts to include in the startup module",
191 "items": {
192 "type": "string"
193 }
194 },
195 "dependencies": {
196 "type": ["string", "array"],
197 "description": "Modules which must be loaded before this module",
198 "items": {
199 "type": "string"
200 }
201 },
202 "styles": {
203 "type": ["string", "array", "object"],
204 "description": "Styles to always load",
205 "items": {
206 "type": "string"
207 }
208 },
209 "skinStyles": {
210 "type": "object",
211 "description": "Styles to include in specific skin contexts (mapping of skin name to style(s))",
212 "patternProperties": {
213 ".+": {
214 "type": [
215 "string",
216 "array"
217 ],
218 "items": {
219 "type": "string"
220 }
221 }
222 }
223 },
224 "messages": {
225 "type": ["string", "array"],
226 "description": "Messages to always load",
227 "items": {
228 "type": "string"
229 }
230 },
231 "group": {
232 "type": "string",
233 "description": "Group which this module should be loaded together with"
234 },
235 "deprecated": {
236 "type": ["object", "string", "boolean"],
237 "description": "Whether the module is deprecated and usage is discouraged. Either a boolean, or a string or an object with key message can be used to customise deprecation message."
238 },
239 "position": {
240 "type": "string",
241 "description": "Position on the page to load this module at",
242 "enum": [
243 "bottom",
244 "top"
245 ]
246 },
247 "templates": {
248 "type": ["object", "array"],
249 "description": "Templates to be loaded for client-side usage"
250 },
251 "targets": {
252 "type": ["string", "array"],
253 "description": "ResourceLoader target the module can run on",
254 "items": {
255 "type": "string"
256 }
257 },
258 "noflip": {
259 "type": "boolean",
260 "description": "Whether to skip CSSJanus LTR-to-RTL flipping for this module. Recommended for styles imported from libraries that already properly handle their RTL styles. Default is false, meaning CSSJanus will be applied on RTL-mode output."
261 },
262 "packageFiles": {
263 "type": ["object", "array"],
264 "description": "Package files that can be require()d"
265 }
266 }
267 },
268 {
269 "description": "A ResourceLoaderWikiModule definition",
270 "additionalProperties": false,
271 "properties": {
272 "class": {
273 "enum": ["ResourceLoaderWikiModule"]
274 },
275 "group": {
276 "type": "string",
277 "description": "Group which this module should be loaded together with"
278 },
279 "position": {
280 "type": "string",
281 "description": "Position on the page to load this module at",
282 "enum": [
283 "bottom",
284 "top"
285 ]
286 },
287 "targets": {
288 "type": ["string", "array"],
289 "description": "ResourceLoader target the module can run on",
290 "items": {
291 "type": "string"
292 }
293 },
294 "scripts": {
295 "type": "array",
296 "items": {
297 "type": "string"
298 }
299 },
300 "styles": {
301 "type": "array",
302 "items": {
303 "type": "string"
304 }
305 }
306 }
307 },
308 {
309 "description": "A ResourceLoaderImageModule definition",
310 "additionalProperties": false,
311 "properties": {
312 "class": {
313 "enum": ["ResourceLoaderImageModule"]
314 },
315 "defaultColor": {
316 "type": "string"
317 },
318 "data": {
319 "type": "string"
320 },
321 "prefix": {
322 "type": "string"
323 },
324 "selector": {
325 "type": "string"
326 },
327 "selectorWithoutVariant": {
328 "type": "string"
329 },
330 "selectorWithVariant": {
331 "type": "string"
332 },
333 "useDataURI": {
334 "type": "boolean"
335 },
336 "variants": {
337 "type": "object"
338 },
339 "images": {
340 "type": "object"
341 },
342 "position": {
343 "enum": [
344 "top",
345 "bottom"
346 ]
347 }
348 }
349 },
350 {
351 "description": "An arbitrary ResourceLoaderModule definition",
352 "properties": {
353 "class": {
354 "type": "string",
355 "pattern": "^(?!ResourceLoader(File|Image|Wiki)Module).*$"
356 }
357 },
358 "required": ["class"]
359 }
360 ]
361 }
362 }
363 },
364 "ResourceModuleSkinStyles": {
365 "type": "object",
366 "description": "ResourceLoader modules for custom skin styles"
367 },
368 "ResourceLoaderSources": {
369 "type": "object",
370 "description": "ResourceLoader sources to register"
371 },
372 "QUnitTestModule": {
373 "type": "object",
374 "description": "A ResourceLoaderFileModule definition registered only when wgEnableJavaScriptTest is true."
375 },
376 "ConfigRegistry": {
377 "type": "object",
378 "description": "Registry of factory functions to create Config objects"
379 },
380 "SessionProviders": {
381 "type": "object",
382 "description": "Session providers"
383 },
384 "AuthManagerAutoConfig": {
385 "type": "object",
386 "description": "AuthManager auto-configuration",
387 "additionalProperties": false,
388 "properties": {
389 "preauth": {
390 "type": "object",
391 "description": "Pre-authentication providers"
392 },
393 "primaryauth": {
394 "type": "object",
395 "description": "Primary authentication providers"
396 },
397 "secondaryauth": {
398 "type": "object",
399 "description": "Secondary authentication providers"
400 }
401 }
402 },
403 "CentralIdLookupProviders": {
404 "type": "object",
405 "description": "Central ID lookup providers"
406 },
407 "namespaces": {
408 "type": "array",
409 "description": "Method to add extra namespaces",
410 "items": {
411 "type": "object",
412 "properties": {
413 "id": {
414 "type": "integer"
415 },
416 "constant": {
417 "type": "string"
418 },
419 "name": {
420 "type": "string"
421 },
422 "gender": {
423 "type": "object",
424 "properties": {
425 "male": {
426 "type": "string"
427 },
428 "female": {
429 "type": "string"
430 }
431 }
432 },
433 "subpages": {
434 "type": "boolean",
435 "default": false
436 },
437 "content": {
438 "type": "boolean",
439 "default": false
440 },
441 "defaultcontentmodel": {
442 "type": "string"
443 },
444 "protection": {
445 "type": ["string", "array"],
446 "description": "Userright(s) required to edit in this namespace"
447 },
448 "capitallinkoverride": {
449 "type": "boolean",
450 "description": "Set $wgCapitalLinks on a per-namespace basis"
451 },
452 "conditional": {
453 "type": "boolean",
454 "description": "Whether the namespace is conditional upon configuration and should not be registered (requires separate registration via a hook)",
455 "default": false
456 }
457 },
458 "required": ["id", "constant", "name"]
459 }
460 },
461 "TrackingCategories": {
462 "type": "array",
463 "description": "Tracking category message keys",
464 "items": {
465 "type": "string"
466 }
467 },
468 "DefaultUserOptions": {
469 "type": "object",
470 "description": "Default values of user options"
471 },
472 "HiddenPrefs": {
473 "type": "array",
474 "description": "Preferences users cannot set",
475 "items": {
476 "type": "string"
477 }
478 },
479 "GroupPermissions": {
480 "type": "object",
481 "description": "Default permissions to give to user groups",
482 "patternProperties": {
483 "^[a-z]+$": {
484 "type": "object",
485 "patternProperties": {
486 "^[a-z]+$": {
487 "type": "boolean"
488 }
489 }
490 }
491 }
492 },
493 "RevokePermissions": {
494 "type": "object",
495 "description": "Default permissions to revoke from user groups",
496 "patternProperties": {
497 "^[a-z]+$": {
498 "type": "object",
499 "patternProperties": {
500 "^[a-z]+$": {
501 "type": "boolean"
502 }
503 }
504 }
505 }
506 },
507 "GrantPermissions": {
508 "type": "object",
509 "description": "Map of permissions granted to authorized consumers to their bundles, called 'grants'",
510 "patternProperties": {
511 "^[a-z]+$": {
512 "type": "object",
513 "patternProperties": {
514 "^[a-z]+$": {
515 "type": "boolean"
516 }
517 }
518 }
519 }
520 },
521 "GrantPermissionGroups": {
522 "type": "object",
523 "description": "Map of grants to their UI grouping",
524 "patternProperties": {
525 "^[a-z]+$": {
526 "type": "string"
527 }
528 }
529 },
530 "ImplicitGroups": {
531 "type": "array",
532 "description": "Implicit groups"
533 },
534 "GroupsAddToSelf": {
535 "type": "object",
536 "description": "Groups a user can add to themselves"
537 },
538 "GroupsRemoveFromSelf": {
539 "type": "object",
540 "description": "Groups a user can remove from themselves"
541 },
542 "AddGroups": {
543 "type": "object",
544 "description": "Groups a user can add to users"
545 },
546 "RemoveGroups": {
547 "type": "object",
548 "description": "Groups a user can remove from users"
549 },
550 "AvailableRights": {
551 "type": "array",
552 "description": "User rights added by the extension",
553 "items": {
554 "type": "string"
555 }
556 },
557 "ContentHandlers": {
558 "type": "object",
559 "description": "Mapping of model ID to class name",
560 "patternProperties": {
561 "^[A-Za-z]+$": {
562 "type": "string"
563 }
564 }
565 },
566 "RateLimits": {
567 "type": "object",
568 "description": "Rate limits"
569 },
570 "RecentChangesFlags": {
571 "type": "object",
572 "description": "Flags (letter symbols) shown on RecentChanges pages"
573 },
574 "MediaHandlers": {
575 "type": "object",
576 "description": "Plugins for media file type handling. Each entry in the array maps a MIME type to a PHP class name."
577 },
578 "ExtensionFunctions": {
579 "type": [
580 "array",
581 "string"
582 ],
583 "description": "Function to call after setup has finished",
584 "items": {
585 "type": "string"
586 }
587 },
588 "ExtensionMessagesFiles": {
589 "type": "object",
590 "description": "File paths containing PHP internationalization data"
591 },
592 "MessagesDirs": {
593 "type": "object",
594 "description": "Directory paths containing JSON internationalization data"
595 },
596 "ExtensionEntryPointListFiles": {
597 "type": "object"
598 },
599 "SpecialPages": {
600 "type": "object",
601 "description": "SpecialPages implemented in this extension (mapping of page name to class name)"
602 },
603 "AutoloadNamespaces": {
604 "type": "object",
605 "description": "Mapping of PSR-4 compliant namespace to directory for autoloading",
606 "patternProperties": {
607 "^[A-Za-z0-9\\\\]+\\\\$": {
608 "type": "string"
609 }
610 },
611 "additionalProperties": false
612 },
613 "AutoloadClasses": {
614 "type": "object"
615 },
616 "Hooks": {
617 "type": [ "string", "object" ],
618 "description": "Hooks this extension uses (mapping of hook name to callback)"
619 },
620 "JobClasses": {
621 "type": "object",
622 "description": "Job types this extension implements (mapping of job type to class name or factory function)"
623 },
624 "LogTypes": {
625 "type": "array",
626 "description": "List of new log types this extension uses"
627 },
628 "LogRestrictions": {
629 "type": "object"
630 },
631 "FilterLogTypes": {
632 "type": "object"
633 },
634 "ActionFilteredLogs": {
635 "type": "object",
636 "description": "List of log types which can be filtered by log actions",
637 "patternProperties": {
638 "^[a-z-]+$": {
639 "type": "object",
640 "patternProperties": {
641 "^[a-z-]+$": {
642 "type": "array",
643 "items": {
644 "type": "string"
645 }
646 }
647 }
648 }
649 }
650 },
651 "LogNames": {
652 "type": "object"
653 },
654 "LogHeaders": {
655 "type": "object"
656 },
657 "LogActions": {
658 "type": "object"
659 },
660 "LogActionsHandlers": {
661 "type": "object"
662 },
663 "Actions": {
664 "type": "object"
665 },
666 "APIModules": {
667 "type": "object"
668 },
669 "APIFormatModules": {
670 "type": "object"
671 },
672 "APIMetaModules": {
673 "type": "object"
674 },
675 "APIPropModules": {
676 "type": "object"
677 },
678 "APIListModules": {
679 "type": "object"
680 },
681 "ValidSkinNames": {
682 "type": "object"
683 },
684 "FeedClasses": {
685 "type": "object",
686 "description": "Available feeds objects"
687 },
688 "SkinOOUIThemes": {
689 "type": "object"
690 },
691 "PasswordPolicy": {
692 "type": "object",
693 "description": "Password policies"
694 },
695 "FileExtensions": {
696 "type": "array",
697 "description": "Preferred file extensions for uploading",
698 "items": {
699 "type": "string"
700 }
701 },
702 "RawHtmlMessages": {
703 "type": "array",
704 "description": "Messages which are rendered as raw HTML",
705 "items": {
706 "type": "string"
707 }
708 },
709 "ReauthenticateTime": {
710 "type": "object",
711 "patternProperties": {
712 ".*": {
713 "type": "integer"
714 }
715 }
716 },
717 "callback": {
718 "type": [
719 "array",
720 "string"
721 ],
722 "description": "A function to be called right after MediaWiki processes this file"
723 },
724 "config": {
725 "type": "object",
726 "description": "Configuration options for this extension",
727 "properties": {
728 "_prefix": {
729 "type": "string",
730 "default": "wg",
731 "description": "Prefix to put in front of configuration settings when exporting them to $GLOBALS"
732 }
733 },
734 "patternProperties": {
735 "^[a-zA-Z_\u007f-\u00ff][a-zA-Z0-9_\u007f-\u00ff]*$": {
736 "properties": {
737 "_merge_strategy": {
738 "type": "string",
739 "enum": [
740 "array_merge_recursive",
741 "array_replace_recursive",
742 "array_plus_2d",
743 "array_plus",
744 "array_merge"
745 ],
746 "default": "array_merge"
747 }
748 }
749 }
750 }
751 },
752 "ParserTestFiles": {
753 "type": "array",
754 "description": "Parser test suite files to be run by parserTests.php when no specific filename is passed to it"
755 },
756 "ServiceWiringFiles": {
757 "type": "array",
758 "description": "List of service wiring files to be loaded by the default instance of MediaWikiServices"
759 },
760 "load_composer_autoloader": {
761 "type": "boolean",
762 "description": "Load the composer autoloader for this extension, if one is present"
763 }
764 }
765 }