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