extension.schema.v1.json 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712
  1. {
  2. "$schema": "http://json-schema.org/schema#",
  3. "description": "MediaWiki extension.json schema",
  4. "type": "object",
  5. "properties": {
  6. "manifest_version": {
  7. "type": "integer",
  8. "description": "Version of the extension.json schema the extension.json file is in.",
  9. "required": true
  10. },
  11. "name": {
  12. "type": "string",
  13. "description": "The extension's canonical name.",
  14. "required": true
  15. },
  16. "namemsg": {
  17. "type": "string",
  18. "description": "i18n message key of the extension's name."
  19. },
  20. "type": {
  21. "type": "string",
  22. "description": "The extension's type, as an index to $wgExtensionCredits.",
  23. "default": "other"
  24. },
  25. "author": {
  26. "type": [
  27. "string",
  28. "array"
  29. ],
  30. "description": "Extension's authors.",
  31. "items": {
  32. "type": "string"
  33. }
  34. },
  35. "version": {
  36. "type": "string",
  37. "description": "The version of this release of the extension."
  38. },
  39. "url": {
  40. "type": "string",
  41. "description": "URL to the homepage for the extension.",
  42. "format": "uri-reference"
  43. },
  44. "description": {
  45. "type": "string",
  46. "description": "Raw description of the extension."
  47. },
  48. "descriptionmsg": {
  49. "type": "string",
  50. "description": "Message key for a i18n message describing the extension."
  51. },
  52. "license-name": {
  53. "type": "string",
  54. "description": "SPDX identifier for the license under which the extension is released."
  55. },
  56. "requires": {
  57. "type": "object",
  58. "description": "Indicates what versions of MediaWiki core or extensions are required. This syntax may be extended in the future, for example to check dependencies between other services.",
  59. "additionalProperties": false,
  60. "properties": {
  61. "MediaWiki": {
  62. "type": "string",
  63. "description": "Version constraint string against MediaWiki core."
  64. },
  65. "extensions": {
  66. "type": "object",
  67. "description": "Set of version constraint strings against specific extensions."
  68. },
  69. "skins": {
  70. "type": "object",
  71. "description": "Set of version constraint strings against specific skins."
  72. }
  73. }
  74. },
  75. "ResourceFileModulePaths": {
  76. "type": "object",
  77. "description": "Default paths to use for all ResourceLoader file modules",
  78. "additionalProperties": false,
  79. "properties": {
  80. "localBasePath": {
  81. "type": "string",
  82. "description": "Base path to prepend to all local paths, relative to current directory"
  83. },
  84. "remoteExtPath": {
  85. "type": "string",
  86. "description": "Base path to prepend to all remote paths, relative to $wgExtensionAssetsPath"
  87. },
  88. "remoteSkinPath": {
  89. "type": "string",
  90. "description": "Base path to prepend to all remote paths, relative to $wgStylePath"
  91. }
  92. }
  93. },
  94. "ResourceModules": {
  95. "type": "object",
  96. "description": "ResourceLoader modules to register",
  97. "patternProperties": {
  98. "^[a-zA-Z0-9-\\.]+$": {
  99. "type": "object",
  100. "anyOf": [
  101. {
  102. "description": "A ResourceLoaderFileModule definition",
  103. "additionalProperties": false,
  104. "properties": {
  105. "localBasePath": {
  106. "type": "string",
  107. "description": "Base path to prepend to all local paths in $options. Defaults to $IP"
  108. },
  109. "remoteBasePath": {
  110. "type": "string",
  111. "description": "Base path to prepend to all remote paths in $options. Defaults to $wgScriptPath"
  112. },
  113. "remoteExtPath": {
  114. "type": "string",
  115. "description": "Equivalent of remoteBasePath, but relative to $wgExtensionAssetsPath"
  116. },
  117. "skipFunction": {
  118. "type": "string",
  119. "description": "Path to a file containing a JavaScript \"skip function\", if desired."
  120. },
  121. "scripts": {
  122. "type": ["string", "array"],
  123. "description": "Scripts to always include (array of file paths)",
  124. "items": {
  125. "type": "string"
  126. }
  127. },
  128. "languageScripts": {
  129. "type": "object",
  130. "description": "Scripts to include in specific language contexts (mapping of language code to file path(s))",
  131. "patternProperties": {
  132. "^[a-zA-Z0-9-]{2,}$": {
  133. "type": [
  134. "string",
  135. "array"
  136. ],
  137. "items": {
  138. "type": "string"
  139. }
  140. }
  141. }
  142. },
  143. "skinScripts": {
  144. "type": "object",
  145. "description": "Scripts to include in specific skin contexts (mapping of skin name to script(s)",
  146. "patternProperties": {
  147. ".+": {
  148. "type": [
  149. "string",
  150. "array"
  151. ],
  152. "items": {
  153. "type": "string"
  154. }
  155. }
  156. }
  157. },
  158. "debugScripts": {
  159. "type": ["string", "array"],
  160. "description": "Scripts to include in debug contexts",
  161. "items": {
  162. "type": "string"
  163. }
  164. },
  165. "loaderScripts": {
  166. "type": ["string", "array"],
  167. "description": "Scripts to include in the startup module",
  168. "items": {
  169. "type": "string"
  170. }
  171. },
  172. "dependencies": {
  173. "type": ["string", "array"],
  174. "description": "Modules which must be loaded before this module",
  175. "items": {
  176. "type": "string"
  177. }
  178. },
  179. "styles": {
  180. "type": ["string", "array", "object"],
  181. "description": "Styles to always load",
  182. "items": {
  183. "type": "string"
  184. }
  185. },
  186. "skinStyles": {
  187. "type": "object",
  188. "description": "Styles to include in specific skin contexts (mapping of skin name to style(s))",
  189. "patternProperties": {
  190. ".+": {
  191. "type": [
  192. "string",
  193. "array"
  194. ],
  195. "items": {
  196. "type": "string"
  197. }
  198. }
  199. }
  200. },
  201. "messages": {
  202. "type": ["string", "array"],
  203. "description": "Messages to always load",
  204. "items": {
  205. "type": "string"
  206. }
  207. },
  208. "group": {
  209. "type": "string",
  210. "description": "Group which this module should be loaded together with"
  211. },
  212. "deprecated": {
  213. "type": ["object", "string", "boolean"],
  214. "description": "Whether the module is deprecated and usage is discouraged. Either a boolean, or a string or an object with key message can be used to customise deprecation message."
  215. },
  216. "position": {
  217. "type": "string",
  218. "description": "Position on the page to load this module at",
  219. "enum": [
  220. "bottom",
  221. "top"
  222. ]
  223. },
  224. "templates": {
  225. "type": ["object", "array"],
  226. "description": "Templates to be loaded for client-side usage"
  227. },
  228. "targets": {
  229. "type": ["string", "array"],
  230. "description": "ResourceLoader target the module can run on",
  231. "items": {
  232. "type": "string"
  233. }
  234. },
  235. "noflip": {
  236. "type": "boolean",
  237. "description": "Whether to skip CSSJanus LTR-to-RTL flipping for this module. Recommended for styles imported from libraries that already properly handle their RTL styles. Default is false, meaning CSSJanus will be applied on RTL-mode output."
  238. }
  239. }
  240. },
  241. {
  242. "description": "A ResourceLoaderWikiModule definition",
  243. "additionalProperties": false,
  244. "properties": {
  245. "class": {
  246. "enum": ["ResourceLoaderWikiModule"]
  247. },
  248. "group": {
  249. "type": "string",
  250. "description": "Group which this module should be loaded together with"
  251. },
  252. "position": {
  253. "type": "string",
  254. "description": "Position on the page to load this module at",
  255. "enum": [
  256. "bottom",
  257. "top"
  258. ]
  259. },
  260. "targets": {
  261. "type": ["string", "array"],
  262. "description": "ResourceLoader target the module can run on",
  263. "items": {
  264. "type": "string"
  265. }
  266. },
  267. "scripts": {
  268. "type": "array",
  269. "items": {
  270. "type": "string"
  271. }
  272. },
  273. "styles": {
  274. "type": "array",
  275. "items": {
  276. "type": "string"
  277. }
  278. }
  279. }
  280. },
  281. {
  282. "description": "A ResourceLoaderImageModule definition",
  283. "additionalProperties": false,
  284. "properties": {
  285. "class": {
  286. "enum": ["ResourceLoaderImageModule"]
  287. },
  288. "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. "AutoloadNamespaces": {
  571. "type": "object",
  572. "description": "Mapping of PSR-4 compliant namespace to directory for autoloading"
  573. },
  574. "AutoloadClasses": {
  575. "type": "object"
  576. },
  577. "Hooks": {
  578. "type": [ "string", "object" ],
  579. "description": "Hooks this extension uses (mapping of hook name to callback)"
  580. },
  581. "JobClasses": {
  582. "type": "object",
  583. "description": "Job types this extension implements (mapping of job type to class name or factory function)"
  584. },
  585. "LogTypes": {
  586. "type": "array",
  587. "description": "List of new log types this extension uses"
  588. },
  589. "LogRestrictions": {
  590. "type": "object"
  591. },
  592. "FilterLogTypes": {
  593. "type": "object"
  594. },
  595. "ActionFilteredLogs": {
  596. "type": "object",
  597. "description": "List of log types which can be filtered by log actions",
  598. "patternProperties": {
  599. "^[a-z-]+$": {
  600. "type": "object",
  601. "patternProperties": {
  602. "^[a-z-]+$": {
  603. "type": "array",
  604. "items": {
  605. "type": "string"
  606. }
  607. }
  608. }
  609. }
  610. }
  611. },
  612. "LogNames": {
  613. "type": "object"
  614. },
  615. "LogHeaders": {
  616. "type": "object"
  617. },
  618. "LogActions": {
  619. "type": "object"
  620. },
  621. "LogActionsHandlers": {
  622. "type": "object"
  623. },
  624. "Actions": {
  625. "type": "object"
  626. },
  627. "APIModules": {
  628. "type": "object"
  629. },
  630. "APIFormatModules": {
  631. "type": "object"
  632. },
  633. "APIMetaModules": {
  634. "type": "object"
  635. },
  636. "APIPropModules": {
  637. "type": "object"
  638. },
  639. "APIListModules": {
  640. "type": "object"
  641. },
  642. "ValidSkinNames": {
  643. "type": "object"
  644. },
  645. "FeedClasses": {
  646. "type": "object",
  647. "description": "Available feeds objects"
  648. },
  649. "SkinOOUIThemes": {
  650. "type": "object"
  651. },
  652. "PasswordPolicy": {
  653. "type": "object",
  654. "description": "Password policies"
  655. },
  656. "FileExtensions": {
  657. "type": "array",
  658. "description": "Preferred file extensions for uploading",
  659. "items": {
  660. "type": "string"
  661. }
  662. },
  663. "callback": {
  664. "type": [
  665. "array",
  666. "string"
  667. ],
  668. "description": "A function to be called right after MediaWiki processes this file"
  669. },
  670. "config": {
  671. "type": "object",
  672. "description": "Configuration options for this extension",
  673. "properties": {
  674. "_prefix": {
  675. "type": "string",
  676. "default": "wg",
  677. "description": "Prefix to put in front of configuration settings when exporting them to $GLOBALS"
  678. }
  679. },
  680. "patternProperties": {
  681. "^[a-zA-Z_\u007f-\u00ff][a-zA-Z0-9_\u007f-\u00ff]*$": {
  682. "properties": {
  683. "_merge_strategy": {
  684. "type": "string",
  685. "enum": [
  686. "array_merge_recursive",
  687. "array_replace_recursive",
  688. "array_plus_2d",
  689. "array_plus",
  690. "array_merge"
  691. ],
  692. "default": "array_merge"
  693. }
  694. }
  695. }
  696. }
  697. },
  698. "ParserTestFiles": {
  699. "type": "array",
  700. "description": "Parser test suite files to be run by parserTests.php when no specific filename is passed to it"
  701. },
  702. "ServiceWiringFiles": {
  703. "type": "array",
  704. "description": "List of service wiring files to be loaded by the default instance of MediaWikiServices"
  705. },
  706. "load_composer_autoloader": {
  707. "type": "boolean",
  708. "description": "Load the composer autoloader for this extension, if one is present"
  709. }
  710. }
  711. }