extension.schema.v2.json 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768
  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", "string", "boolean"],
  215. "description": "Whether the module is deprecated and usage is discouraged. Either a boolean, or a string or an object with key message can be used to customise deprecation message."
  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. "AutoloadNamespaces": {
  592. "type": "object",
  593. "description": "Mapping of PSR-4 compliant namespace to directory for autoloading"
  594. },
  595. "AutoloadClasses": {
  596. "type": "object"
  597. },
  598. "Hooks": {
  599. "type": [ "string", "object" ],
  600. "description": "Hooks this extension uses (mapping of hook name to callback)"
  601. },
  602. "JobClasses": {
  603. "type": "object",
  604. "description": "Job types this extension implements (mapping of job type to class name or factory function)"
  605. },
  606. "LogTypes": {
  607. "type": "array",
  608. "description": "List of new log types this extension uses"
  609. },
  610. "LogRestrictions": {
  611. "type": "object"
  612. },
  613. "FilterLogTypes": {
  614. "type": "object"
  615. },
  616. "ActionFilteredLogs": {
  617. "type": "object",
  618. "description": "List of log types which can be filtered by log actions",
  619. "patternProperties": {
  620. "^[a-z-]+$": {
  621. "type": "object",
  622. "patternProperties": {
  623. "^[a-z-]+$": {
  624. "type": "array",
  625. "items": {
  626. "type": "string"
  627. }
  628. }
  629. }
  630. }
  631. }
  632. },
  633. "LogNames": {
  634. "type": "object"
  635. },
  636. "LogHeaders": {
  637. "type": "object"
  638. },
  639. "LogActions": {
  640. "type": "object"
  641. },
  642. "LogActionsHandlers": {
  643. "type": "object"
  644. },
  645. "Actions": {
  646. "type": "object"
  647. },
  648. "APIModules": {
  649. "type": "object"
  650. },
  651. "APIFormatModules": {
  652. "type": "object"
  653. },
  654. "APIMetaModules": {
  655. "type": "object"
  656. },
  657. "APIPropModules": {
  658. "type": "object"
  659. },
  660. "APIListModules": {
  661. "type": "object"
  662. },
  663. "ValidSkinNames": {
  664. "type": "object"
  665. },
  666. "FeedClasses": {
  667. "type": "object",
  668. "description": "Available feeds objects"
  669. },
  670. "SkinOOUIThemes": {
  671. "type": "object",
  672. "description": "Map of skin names to OOUI themes to use. Same format as ResourceLoaderOOUIModule::$builtinSkinThemeMap."
  673. },
  674. "PasswordPolicy": {
  675. "type": "object",
  676. "description": "Password policies"
  677. },
  678. "FileExtensions": {
  679. "type": "array",
  680. "description": "Preferred file extensions for uploading",
  681. "items": {
  682. "type": "string"
  683. }
  684. },
  685. "callback": {
  686. "type": [
  687. "array",
  688. "string"
  689. ],
  690. "description": "A function to be called right after MediaWiki processes this file"
  691. },
  692. "config_prefix": {
  693. "type": "string",
  694. "default": "wg",
  695. "description": "Prefix to put in front of configuration settings when exporting them to $GLOBALS"
  696. },
  697. "config": {
  698. "type": "object",
  699. "description": "Configuration options for this extension",
  700. "patternProperties": {
  701. "^[a-zA-Z_\u007f-\u00ff][a-zA-Z0-9_\u007f-\u00ff]*$": {
  702. "type": "object",
  703. "properties": {
  704. "value": {
  705. "required": true
  706. },
  707. "merge_strategy": {
  708. "type": "string",
  709. "enum": [
  710. "array_merge_recursive",
  711. "array_replace_recursive",
  712. "array_plus_2d",
  713. "array_plus",
  714. "array_merge"
  715. ],
  716. "default": "array_merge"
  717. },
  718. "path": {
  719. "description": "Whether this should be interpreted as a filesystem path, relative to extension directory root",
  720. "type": "boolean",
  721. "default": false
  722. },
  723. "description": {
  724. "type": ["string", "array"],
  725. "description": "A description of the config setting, mostly for documentation/developers"
  726. },
  727. "decriptionmsg": {
  728. "type": "string",
  729. "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."
  730. },
  731. "public": {
  732. "type": "boolean",
  733. "default": false,
  734. "description": "Whether this configuration option and its value is allowed to be revealed in public or not."
  735. }
  736. }
  737. }
  738. }
  739. },
  740. "ParserTestFiles": {
  741. "type": "array",
  742. "description": "Parser test suite files to be run by parserTests.php when no specific filename is passed to it"
  743. },
  744. "ServiceWiringFiles": {
  745. "type": "array",
  746. "description": "List of service wiring files to be loaded by the default instance of MediaWikiServices"
  747. },
  748. "attributes": {
  749. "description":"Registration information for other extensions",
  750. "type": "object",
  751. "patternProperties": {
  752. ".*": {
  753. "type": "object",
  754. "patternProperties": {
  755. ".*": {
  756. "type": ["array", "object"]
  757. }
  758. }
  759. }
  760. }
  761. },
  762. "load_composer_autoloader": {
  763. "type": "boolean",
  764. "description": "Load the composer autoloader for this extension, if one is present"
  765. }
  766. }
  767. }