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