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