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