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