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