1.8.json 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. {
  2. "$schema": "http://json-schema.org/draft-07/schema",
  3. "$id": "https://schemas.premid.app/metadata/1.8",
  4. "title": "Metadata",
  5. "type": "object",
  6. "description": "Metadata that describes a presence.",
  7. "definitions": {
  8. "user": {
  9. "type": "object",
  10. "description": "User information.",
  11. "properties": {
  12. "name": {
  13. "type": "string",
  14. "description": "The name of the user.",
  15. "minLength": 1
  16. },
  17. "id": {
  18. "type": "string",
  19. "description": "The Discord snowflake of the user.",
  20. "pattern": "^\\d+$"
  21. }
  22. },
  23. "additionalProperties": false,
  24. "required": ["name", "id"]
  25. }
  26. },
  27. "properties": {
  28. "$schema": {
  29. "$comment": "This is required otherwise the schema will fail itself when it is applied to a document via $schema. This is optional so that validators that use this schema don't fail if the metadata doesn't have the $schema property.",
  30. "type": "string",
  31. "description": "The metadata schema URL.",
  32. "minLength": 1
  33. },
  34. "author": {
  35. "$ref": "#/definitions/user",
  36. "description": "The author of this presence."
  37. },
  38. "contributors": {
  39. "type": "array",
  40. "description": "Any extra contributors to this presence.",
  41. "items": {
  42. "$ref": "#/definitions/user"
  43. }
  44. },
  45. "service": {
  46. "type": "string",
  47. "description": "The service this presence is for.",
  48. "minLength": 1
  49. },
  50. "altnames": {
  51. "type": "array",
  52. "description": "Alternative names for the service.",
  53. "items": {
  54. "type": "string",
  55. "description": "An alternative name.",
  56. "minLength": 1
  57. },
  58. "minItems": 1
  59. },
  60. "description": {
  61. "type": "object",
  62. "description": "A description of the presence in multiple languages.",
  63. "propertyNames": {
  64. "type": "string",
  65. "description": "The language key. The key must be languagecode(_REGIONCODE).",
  66. "pattern": "^[a-z]{2}(?:_(?:[A-Z]{2}|[0-9]{1,3}))?$"
  67. },
  68. "patternProperties": {
  69. "^[a-z]{2}(?:_(?:[A-Z]{2}|[0-9]{1,3}))?$": {
  70. "type": "string",
  71. "description": "The description of the presence in the key's language.",
  72. "minLength": 1
  73. }
  74. },
  75. "additionalProperties": false,
  76. "required": ["en"]
  77. },
  78. "url": {
  79. "type": ["string", "array"],
  80. "description": "The service's website URL, or an array of URLs. Protocols should not be added.",
  81. "pattern": "^(([a-z0-9-]+\\.)*[0-9a-z_-]+(\\.[a-z]+)+|(\\d{1,3}\\.){3}\\d{1,3}|localhost)$",
  82. "items": {
  83. "type": "string",
  84. "description": "One of the service's website URLs.",
  85. "pattern": "^(([a-z0-9-]+\\.)*[0-9a-z_-]+(\\.[a-z]+)+|(\\d{1,3}\\.){3}\\d{1,3}|localhost)$",
  86. "minLength": 1
  87. },
  88. "minItems": 2,
  89. "minLength": 1
  90. },
  91. "version": {
  92. "type": "string",
  93. "description": "The SemVer version of the presence. Must just be major.minor.patch.",
  94. "pattern": "^\\d+\\.\\d+\\.\\d+$"
  95. },
  96. "logo": {
  97. "type": "string",
  98. "description": "The logo of the service this presence is for.",
  99. "pattern": "^https?://(i).(imgur).(com)/(.*?).(png|jpe?g|gif)$"
  100. },
  101. "thumbnail": {
  102. "type": "string",
  103. "description": "A thumbnail of the service this presence is for.",
  104. "pattern": "^https?://(i).(imgur).(com)/(.*?).(png|jpe?g)$"
  105. },
  106. "color": {
  107. "type": "string",
  108. "description": "The theme color of the service this presence is for. Must be either a 6 digit or a 3 digit hex code.",
  109. "pattern": "^#([A-Fa-f0-9]{3}){1,2}$"
  110. },
  111. "tags": {
  112. "type": ["array"],
  113. "description": "The tags for the presence.",
  114. "items": {
  115. "type": "string",
  116. "description": "A tag.",
  117. "pattern": "^[^A-Z\\s!\"#$%&'()*+,./:;<=>?@\\[\\\\\\]^_`{|}~]+$",
  118. "minLength": 1
  119. },
  120. "minItems": 1
  121. },
  122. "category": {
  123. "type": "string",
  124. "description": "The category the presence falls under.",
  125. "enum": ["anime", "games", "music", "socials", "videos", "other"]
  126. },
  127. "iframe": {
  128. "type": "boolean",
  129. "description": "Whether or not the presence should run in IFrames."
  130. },
  131. "readLogs": {
  132. "type": "boolean",
  133. "description": "Whether or not the extension should be reading logs."
  134. },
  135. "regExp": {
  136. "type": "string",
  137. "description": "A regular expression used to match URLs for the presence to inject into.",
  138. "minLength": 1
  139. },
  140. "iFrameRegExp": {
  141. "type": "string",
  142. "description": "A regular expression used to match IFrames for the presence to inject into.",
  143. "minLength": 1
  144. },
  145. "button": {
  146. "type": "boolean",
  147. "description": "Controls whether the presence is automatically added when the extension is installed. For partner presences only."
  148. },
  149. "warning": {
  150. "type": "boolean",
  151. "description": "Shows a warning saying that it requires additional steps for the presence to function correctly."
  152. },
  153. "settings": {
  154. "type": "array",
  155. "description": "An array of settings the user can change in the presence.",
  156. "items": {
  157. "type": "object",
  158. "description": "A setting.",
  159. "properties": {
  160. "id": {
  161. "type": "string",
  162. "description": "The ID of the setting.",
  163. "minLength": 1
  164. },
  165. "title": {
  166. "type": "string",
  167. "description": "The title of the setting. Required only if `multiLanguage` is disabled.",
  168. "minLength": 1
  169. },
  170. "icon": {
  171. "type": "string",
  172. "description": "The icon of the setting. Required only if `multiLanguage` is disabled.",
  173. "pattern": "^fa([bsdrlt]|([-](brands|solid|duotone|regular|light|thin))) fa-[0-9a-z-]+$"
  174. },
  175. "if": {
  176. "type": "object",
  177. "description": "Restrict showing this setting if another setting is the defined value.",
  178. "propertyNames": {
  179. "type": "string",
  180. "description": "The ID of the setting.",
  181. "minLength": 1
  182. },
  183. "patternProperties": {
  184. "": {
  185. "type": ["string", "number", "boolean"],
  186. "description": "The value of the setting.",
  187. "minLength": 1
  188. }
  189. },
  190. "additionalProperties": false
  191. },
  192. "placeholder": {
  193. "type": "string",
  194. "description": "The placeholder for settings that require input. Shown when the input is empty.",
  195. "minLength": 1
  196. },
  197. "value": {
  198. "type": ["string", "number", "boolean"],
  199. "description": "The default value of the setting. Not compatible with `values`.",
  200. "minLength": 1
  201. },
  202. "values": {
  203. "type": "array",
  204. "description": "The default values of the setting. Not compatible with `value`.",
  205. "items": {
  206. "type": ["string", "number", "boolean"],
  207. "description": "The value of the setting.",
  208. "minLength": 1
  209. }
  210. },
  211. "multiLanguage": {
  212. "type": ["string", "boolean", "array"],
  213. "description": "When false, multi-localization is disabled. When true, strings from the `general.json` file are available for use. When a string, it is the name of a file (excluding .json) of a used language from the localization GitHub repo. When an array of strings, it is all of the file names (excluding .json) of used languages from the localization GitHub repo.",
  214. "items": {
  215. "type": "string",
  216. "description": "The name of a file from the localization GitHub repository.",
  217. "minLength": 1
  218. },
  219. "minLength": 1
  220. }
  221. },
  222. "additionalProperties": false
  223. }
  224. }
  225. },
  226. "additionalProperties": false,
  227. "required": [
  228. "author",
  229. "service",
  230. "description",
  231. "url",
  232. "version",
  233. "logo",
  234. "thumbnail",
  235. "color",
  236. "tags",
  237. "category"
  238. ]
  239. }