Merge "Improve docs for Title::getInternalURL/getCanonicalURL"
[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 "patternProperties": {
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 "packageFiles": {
258 "type": ["object", "array"],
259 "description": "Package files that can be require()d"
260 }
261 }
262 },
263 {
264 "description": "A ResourceLoaderWikiModule definition",
265 "additionalProperties": false,
266 "properties": {
267 "class": {
268 "enum": ["ResourceLoaderWikiModule"]
269 },
270 "group": {
271 "type": "string",
272 "description": "Group which this module should be loaded together with"
273 },
274 "position": {
275 "type": "string",
276 "description": "Position on the page to load this module at",
277 "enum": [
278 "bottom",
279 "top"
280 ]
281 },
282 "targets": {
283 "type": ["string", "array"],
284 "description": "ResourceLoader target the module can run on",
285 "items": {
286 "type": "string"
287 }
288 },
289 "scripts": {
290 "type": "array",
291 "items": {
292 "type": "string"
293 }
294 },
295 "styles": {
296 "type": "array",
297 "items": {
298 "type": "string"
299 }
300 }
301 }
302 },
303 {
304 "description": "A ResourceLoaderImageModule definition",
305 "additionalProperties": false,
306 "properties": {
307 "class": {
308 "enum": ["ResourceLoaderImageModule"]
309 },
310 "defaultColor": {
311 "type": "string"
312 },
313 "data": {
314 "type": "string"
315 },
316 "prefix": {
317 "type": "string"
318 },
319 "selector": {
320 "type": "string"
321 },
322 "selectorWithoutVariant": {
323 "type": "string"
324 },
325 "selectorWithVariant": {
326 "type": "string"
327 },
328 "useDataURI": {
329 "type": "boolean"
330 },
331 "variants": {
332 "type": "object"
333 },
334 "images": {
335 "type": "object"
336 },
337 "position": {
338 "enum": [
339 "top",
340 "bottom"
341 ]
342 }
343 }
344 },
345 {
346 "description": "An arbitrary ResourceLoaderModule definition",
347 "properties": {
348 "class": {
349 "type": "string",
350 "pattern": "^(?!ResourceLoader(File|Image|Wiki)Module).*$"
351 }
352 },
353 "required": ["class"]
354 }
355 ]
356 }
357 }
358 },
359 "ResourceModuleSkinStyles": {
360 "type": "object",
361 "description": "ResourceLoader modules for custom skin styles"
362 },
363 "ResourceLoaderSources": {
364 "type": "object",
365 "description": "ResourceLoader sources to register"
366 },
367 "QUnitTestModule": {
368 "type": "object",
369 "description": "A ResourceLoaderFileModule definition registered only when wgEnableJavaScriptTest is true."
370 },
371 "ConfigRegistry": {
372 "type": "object",
373 "description": "Registry of factory functions to create Config objects"
374 },
375 "SessionProviders": {
376 "type": "object",
377 "description": "Session providers"
378 },
379 "AuthManagerAutoConfig": {
380 "type": "object",
381 "description": "AuthManager auto-configuration",
382 "additionalProperties": false,
383 "properties": {
384 "preauth": {
385 "type": "object",
386 "description": "Pre-authentication providers"
387 },
388 "primaryauth": {
389 "type": "object",
390 "description": "Primary authentication providers"
391 },
392 "secondaryauth": {
393 "type": "object",
394 "description": "Secondary authentication providers"
395 }
396 }
397 },
398 "CentralIdLookupProviders": {
399 "type": "object",
400 "description": "Central ID lookup providers"
401 },
402 "namespaces": {
403 "type": "array",
404 "description": "Method to add extra namespaces",
405 "items": {
406 "type": "object",
407 "properties": {
408 "id": {
409 "type": "integer"
410 },
411 "constant": {
412 "type": "string"
413 },
414 "name": {
415 "type": "string"
416 },
417 "gender": {
418 "type": "object",
419 "properties": {
420 "male": {
421 "type": "string"
422 },
423 "female": {
424 "type": "string"
425 }
426 }
427 },
428 "subpages": {
429 "type": "boolean",
430 "default": false
431 },
432 "content": {
433 "type": "boolean",
434 "default": false
435 },
436 "defaultcontentmodel": {
437 "type": "string"
438 },
439 "protection": {
440 "type": ["string", "array"],
441 "description": "Userright(s) required to edit in this namespace"
442 },
443 "capitallinkoverride": {
444 "type": "boolean",
445 "description": "Set $wgCapitalLinks on a per-namespace basis"
446 },
447 "conditional": {
448 "type": "boolean",
449 "description": "Whether the namespace is conditional upon configuration and should not be registered (requires separate registration via a hook)",
450 "default": false
451 }
452 },
453 "required": ["id", "constant", "name"]
454 }
455 },
456 "TrackingCategories": {
457 "type": "array",
458 "description": "Tracking category message keys",
459 "items": {
460 "type": "string"
461 }
462 },
463 "DefaultUserOptions": {
464 "type": "object",
465 "description": "Default values of user options"
466 },
467 "HiddenPrefs": {
468 "type": "array",
469 "description": "Preferences users cannot set",
470 "items": {
471 "type": "string"
472 }
473 },
474 "GroupPermissions": {
475 "type": "object",
476 "description": "Default permissions to give to user groups",
477 "patternProperties": {
478 "^[a-z]+$": {
479 "type": "object",
480 "patternProperties": {
481 "^[a-z]+$": {
482 "type": "boolean"
483 }
484 }
485 }
486 }
487 },
488 "RevokePermissions": {
489 "type": "object",
490 "description": "Default permissions to revoke from user groups",
491 "patternProperties": {
492 "^[a-z]+$": {
493 "type": "object",
494 "patternProperties": {
495 "^[a-z]+$": {
496 "type": "boolean"
497 }
498 }
499 }
500 }
501 },
502 "GrantPermissions": {
503 "type": "object",
504 "description": "Map of permissions granted to authorized consumers to their bundles, called 'grants'",
505 "patternProperties": {
506 "^[a-z]+$": {
507 "type": "object",
508 "patternProperties": {
509 "^[a-z]+$": {
510 "type": "boolean"
511 }
512 }
513 }
514 }
515 },
516 "GrantPermissionGroups": {
517 "type": "object",
518 "description": "Map of grants to their UI grouping",
519 "patternProperties": {
520 "^[a-z]+$": {
521 "type": "string"
522 }
523 }
524 },
525 "ImplicitGroups": {
526 "type": "array",
527 "description": "Implicit groups"
528 },
529 "GroupsAddToSelf": {
530 "type": "object",
531 "description": "Groups a user can add to themselves"
532 },
533 "GroupsRemoveFromSelf": {
534 "type": "object",
535 "description": "Groups a user can remove from themselves"
536 },
537 "AddGroups": {
538 "type": "object",
539 "description": "Groups a user can add to users"
540 },
541 "RemoveGroups": {
542 "type": "object",
543 "description": "Groups a user can remove from users"
544 },
545 "AvailableRights": {
546 "type": "array",
547 "description": "User rights added by the extension",
548 "items": {
549 "type": "string"
550 }
551 },
552 "ContentHandlers": {
553 "type": "object",
554 "description": "Mapping of model ID to class name",
555 "patternProperties": {
556 "^[A-Za-z]+$": {
557 "type": "string"
558 }
559 }
560 },
561 "RateLimits": {
562 "type": "object",
563 "description": "Rate limits"
564 },
565 "RecentChangesFlags": {
566 "type": "object",
567 "description": "Flags (letter symbols) shown on RecentChanges pages"
568 },
569 "MediaHandlers": {
570 "type": "object",
571 "description": "Plugins for media file type handling. Each entry in the array maps a MIME type to a PHP class name."
572 },
573 "ExtensionFunctions": {
574 "type": [
575 "array",
576 "string"
577 ],
578 "description": "Function to call after setup has finished",
579 "items": {
580 "type": "string"
581 }
582 },
583 "ExtensionMessagesFiles": {
584 "type": "object",
585 "description": "File paths containing PHP internationalization data"
586 },
587 "MessagesDirs": {
588 "type": "object",
589 "description": "Directory paths containing JSON internationalization data"
590 },
591 "ExtensionEntryPointListFiles": {
592 "type": "object"
593 },
594 "SpecialPages": {
595 "type": "object",
596 "description": "SpecialPages implemented in this extension (mapping of page name to class name)"
597 },
598 "AutoloadNamespaces": {
599 "type": "object",
600 "description": "Mapping of PSR-4 compliant namespace to directory for autoloading",
601 "patternProperties": {
602 "^[A-Za-z0-9\\\\]+\\\\$": {
603 "type": "string"
604 }
605 },
606 "additionalProperties": false
607 },
608 "AutoloadClasses": {
609 "type": "object"
610 },
611 "Hooks": {
612 "type": [ "string", "object" ],
613 "description": "Hooks this extension uses (mapping of hook name to callback)"
614 },
615 "JobClasses": {
616 "type": "object",
617 "description": "Job types this extension implements (mapping of job type to class name or factory function)"
618 },
619 "LogTypes": {
620 "type": "array",
621 "description": "List of new log types this extension uses"
622 },
623 "LogRestrictions": {
624 "type": "object"
625 },
626 "FilterLogTypes": {
627 "type": "object"
628 },
629 "ActionFilteredLogs": {
630 "type": "object",
631 "description": "List of log types which can be filtered by log actions",
632 "patternProperties": {
633 "^[a-z-]+$": {
634 "type": "object",
635 "patternProperties": {
636 "^[a-z-]+$": {
637 "type": "array",
638 "items": {
639 "type": "string"
640 }
641 }
642 }
643 }
644 }
645 },
646 "LogNames": {
647 "type": "object"
648 },
649 "LogHeaders": {
650 "type": "object"
651 },
652 "LogActions": {
653 "type": "object"
654 },
655 "LogActionsHandlers": {
656 "type": "object"
657 },
658 "Actions": {
659 "type": "object"
660 },
661 "APIModules": {
662 "type": "object"
663 },
664 "APIFormatModules": {
665 "type": "object"
666 },
667 "APIMetaModules": {
668 "type": "object"
669 },
670 "APIPropModules": {
671 "type": "object"
672 },
673 "APIListModules": {
674 "type": "object"
675 },
676 "ValidSkinNames": {
677 "type": "object"
678 },
679 "FeedClasses": {
680 "type": "object",
681 "description": "Available feeds objects"
682 },
683 "SkinOOUIThemes": {
684 "type": "object"
685 },
686 "PasswordPolicy": {
687 "type": "object",
688 "description": "Password policies"
689 },
690 "FileExtensions": {
691 "type": "array",
692 "description": "Preferred file extensions for uploading",
693 "items": {
694 "type": "string"
695 }
696 },
697 "RawHtmlMessages": {
698 "type": "array",
699 "description": "Messages which are rendered as raw HTML",
700 "items": {
701 "type": "string"
702 }
703 },
704 "ReauthenticateTime": {
705 "type": "object",
706 "patternProperties": {
707 ".*": {
708 "type": "integer"
709 }
710 }
711 },
712 "callback": {
713 "type": [
714 "array",
715 "string"
716 ],
717 "description": "A function to be called right after MediaWiki processes this file"
718 },
719 "config": {
720 "type": "object",
721 "description": "Configuration options for this extension",
722 "properties": {
723 "_prefix": {
724 "type": "string",
725 "default": "wg",
726 "description": "Prefix to put in front of configuration settings when exporting them to $GLOBALS"
727 }
728 },
729 "patternProperties": {
730 "^[a-zA-Z_\u007f-\u00ff][a-zA-Z0-9_\u007f-\u00ff]*$": {
731 "properties": {
732 "_merge_strategy": {
733 "type": "string",
734 "enum": [
735 "array_merge_recursive",
736 "array_replace_recursive",
737 "array_plus_2d",
738 "array_plus",
739 "array_merge"
740 ],
741 "default": "array_merge"
742 }
743 }
744 }
745 }
746 },
747 "ParserTestFiles": {
748 "type": "array",
749 "description": "Parser test suite files to be run by parserTests.php when no specific filename is passed to it"
750 },
751 "ServiceWiringFiles": {
752 "type": "array",
753 "description": "List of service wiring files to be loaded by the default instance of MediaWikiServices"
754 },
755 "load_composer_autoloader": {
756 "type": "boolean",
757 "description": "Load the composer autoloader for this extension, if one is present"
758 }
759 }
760 }