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