Definitions.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016 Joas Schilling <coding@schilljs.com>
  4. *
  5. * @license GNU AGPL version 3 or any later version
  6. *
  7. * This program is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU Affero General Public License as
  9. * published by the Free Software Foundation, either version 3 of the
  10. * License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU Affero General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Affero General Public License
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. *
  20. */
  21. namespace OCP\RichObjectStrings;
  22. /**
  23. * Class Definitions
  24. *
  25. * @package OCP\RichObjectStrings
  26. * @since 11.0.0
  27. */
  28. class Definitions {
  29. /**
  30. * @var array
  31. * @since 11.0.0
  32. */
  33. public $definitions = [
  34. 'addressbook' => [
  35. 'author' => 'Nextcloud',
  36. 'app' => 'dav',
  37. 'since' => '11.0.0',
  38. 'parameters' => [
  39. 'id' => [
  40. 'since' => '11.0.0',
  41. 'required' => true,
  42. 'description' => 'The id used to identify the addressbook on the instance',
  43. 'example' => '42',
  44. ],
  45. 'name' => [
  46. 'since' => '11.0.0',
  47. 'required' => true,
  48. 'description' => 'The display name of the addressbook which should be used in the visual representation',
  49. 'example' => 'Contacts',
  50. ],
  51. ],
  52. ],
  53. 'addressbook-contact' => [
  54. 'author' => 'Nextcloud',
  55. 'app' => 'dav',
  56. 'since' => '11.0.0',
  57. 'parameters' => [
  58. 'id' => [
  59. 'since' => '11.0.0',
  60. 'required' => true,
  61. 'description' => 'The id used to identify the contact on the instance',
  62. 'example' => '42',
  63. ],
  64. 'name' => [
  65. 'since' => '11.0.0',
  66. 'required' => true,
  67. 'description' => 'The display name of the contact which should be used in the visual representation',
  68. 'example' => 'John Doe',
  69. ],
  70. ],
  71. ],
  72. 'announcement' => [
  73. 'author' => 'Joas Schilling',
  74. 'app' => 'announcementcenter',
  75. 'since' => '11.0.0',
  76. 'parameters' => [
  77. 'id' => [
  78. 'since' => '11.0.0',
  79. 'required' => true, 'description' => 'The id used to identify the announcement on the instance',
  80. 'example' => '42',
  81. ],
  82. 'name' => [
  83. 'since' => '11.0.0',
  84. 'required' => true,
  85. 'description' => 'The announcement subject which should be used in the visual representation',
  86. 'example' => 'file.txt',
  87. ],
  88. 'link' => [
  89. 'since' => '11.0.0',
  90. 'required' => false,
  91. 'description' => 'The full URL to the file',
  92. 'example' => 'http://localhost/index.php/apps/announcements/#23',
  93. ],
  94. ],
  95. ],
  96. 'app' => [
  97. 'author' => 'Nextcloud',
  98. 'app' => 'updatenotification',
  99. 'since' => '11.0.0',
  100. 'parameters' => [
  101. 'id' => [
  102. 'since' => '11.0.0',
  103. 'required' => true, 'description' => 'The app id',
  104. 'example' => 'updatenotification',
  105. ],
  106. 'name' => [
  107. 'since' => '11.0.0',
  108. 'required' => true,
  109. 'description' => 'The name of the app which should be used in the visual representation',
  110. 'example' => 'Update notification',
  111. ],
  112. ],
  113. ],
  114. 'calendar' => [
  115. 'author' => 'Nextcloud',
  116. 'app' => 'dav',
  117. 'since' => '11.0.0',
  118. 'parameters' => [
  119. 'id' => [
  120. 'since' => '11.0.0',
  121. 'required' => true,
  122. 'description' => 'The id used to identify the calendar on the instance',
  123. 'example' => '42',
  124. ],
  125. 'name' => [
  126. 'since' => '11.0.0',
  127. 'required' => true,
  128. 'description' => 'The display name of the calendar which should be used in the visual representation',
  129. 'example' => 'Personal',
  130. ],
  131. ],
  132. ],
  133. 'calendar-event' => [
  134. 'author' => 'Nextcloud',
  135. 'app' => 'dav',
  136. 'since' => '11.0.0',
  137. 'parameters' => [
  138. 'id' => [
  139. 'since' => '11.0.0',
  140. 'required' => true,
  141. 'description' => 'The id used to identify the event on the instance',
  142. 'example' => '42',
  143. ],
  144. 'name' => [
  145. 'since' => '11.0.0',
  146. 'required' => true,
  147. 'description' => 'The display name of the event which should be used in the visual representation',
  148. 'example' => 'Workout',
  149. ],
  150. ],
  151. ],
  152. 'call' => [
  153. 'author' => 'Nextcloud',
  154. 'app' => 'spreed',
  155. 'since' => '11.0.2',
  156. 'parameters' => [
  157. 'id' => [
  158. 'since' => '11.0.2',
  159. 'required' => true,
  160. 'description' => 'The id used to identify the call on the instance',
  161. 'example' => '42',
  162. ],
  163. 'name' => [
  164. 'since' => '11.0.2',
  165. 'required' => true,
  166. 'description' => 'The display name of the call which should be used in the visual representation',
  167. 'example' => 'Company call',
  168. ],
  169. 'call-type' => [
  170. 'since' => '11.0.2',
  171. 'required' => true,
  172. 'description' => 'The type of the call: one2one, group or public',
  173. 'example' => 'one2one',
  174. ],
  175. ],
  176. ],
  177. 'circle' => [
  178. 'author' => 'Maxence Lange',
  179. 'app' => 'circles',
  180. 'since' => '12.0.0',
  181. 'parameters' => [
  182. 'id' => [
  183. 'since' => '12.0.0',
  184. 'required' => true,
  185. 'description' => 'The id used to identify the circle on the instance',
  186. 'example' => '42',
  187. ],
  188. 'name' => [
  189. 'since' => '12.0.0',
  190. 'required' => true,
  191. 'description' => 'The display name of the circle which should be used in the visual representation',
  192. 'example' => 'My friends',
  193. ],
  194. 'link' => [
  195. 'since' => '12.0.0',
  196. 'required' => true,
  197. 'description' => 'The full URL to the circle',
  198. 'example' => 'http://localhost/index.php/apps/circles/#42',
  199. ],
  200. ],
  201. ],
  202. 'email' => [
  203. 'author' => 'Nextcloud',
  204. 'app' => 'sharebymail',
  205. 'since' => '11.0.0',
  206. 'parameters' => [
  207. 'id' => [
  208. 'since' => '11.0.0',
  209. 'required' => true,
  210. 'description' => 'The mail-address used to identify the event on the instance',
  211. 'example' => 'test@localhost',
  212. ],
  213. 'name' => [
  214. 'since' => '11.0.0',
  215. 'required' => true,
  216. 'description' => 'The display name of a matching contact or the email (fallback) which should be used in the visual representation',
  217. 'example' => 'Foo Bar',
  218. ],
  219. ],
  220. ],
  221. 'file' => [
  222. 'author' => 'Nextcloud',
  223. 'app' => 'dav',
  224. 'since' => '11.0.0',
  225. 'parameters' => [
  226. 'id' => [
  227. 'since' => '11.0.0',
  228. 'required' => true,
  229. 'description' => 'The id used to identify the file on the instance',
  230. 'example' => '42',
  231. ],
  232. 'name' => [
  233. 'since' => '11.0.0',
  234. 'required' => true,
  235. 'description' => 'The file name which should be used in the visual representation',
  236. 'example' => 'file.txt',
  237. ],
  238. 'path' => [
  239. 'since' => '11.0.0',
  240. 'required' => true,
  241. 'description' => 'The full path of the file for the user, should not start with a slash',
  242. 'example' => 'path/to/file.txt',
  243. ],
  244. 'link' => [
  245. 'since' => '11.0.0',
  246. 'required' => false,
  247. 'description' => 'The full URL to the file',
  248. 'example' => 'http://localhost/index.php/f/42',
  249. ],
  250. ],
  251. ],
  252. 'open-graph' => [
  253. 'author' => 'Maxence Lange',
  254. 'app' => 'mood',
  255. 'since' => '12.0.0',
  256. 'parameters' => [
  257. 'id' => [
  258. 'since' => '12.0.0',
  259. 'required' => true,
  260. 'description' => 'The id used to identify the open graph data on the instance',
  261. 'example' => '42',
  262. ],
  263. 'name' => [
  264. 'since' => '12.0.0',
  265. 'required' => true,
  266. 'description' => 'The open graph title of the website',
  267. 'example' => 'This is a website',
  268. ],
  269. 'description' => [
  270. 'since' => '12.0.0',
  271. 'required' => false,
  272. 'description' => 'The open graph description from the website',
  273. 'example' => 'This is the description of the website',
  274. ],
  275. 'thumb' => [
  276. 'since' => '12.0.0',
  277. 'required' => false,
  278. 'description' => 'The full URL of the open graph thumbnail',
  279. 'example' => 'http://localhost/index.php/apps/mood/data/image?url=https%3A%2F%2Fthumb.example.com%2Fimage.png',
  280. ],
  281. 'website' => [
  282. 'since' => '12.0.0',
  283. 'required' => false,
  284. 'description' => 'The name of the described website',
  285. 'example' => 'Nextcloud - App Store',
  286. ],
  287. 'link' => [
  288. 'since' => '12.0.0',
  289. 'required' => false,
  290. 'description' => 'The full link to the website',
  291. 'example' => 'https://apps.nextcloud.com/apps/mood',
  292. ],
  293. ],
  294. ],
  295. 'pending-federated-share' => [
  296. 'author' => 'Nextcloud',
  297. 'app' => 'dav',
  298. 'since' => '11.0.0',
  299. 'parameters' => [
  300. 'id' => [
  301. 'since' => '11.0.0',
  302. 'required' => true,
  303. 'description' => 'The id used to identify the federated share on the instance',
  304. 'example' => '42',
  305. ],
  306. 'name' => [
  307. 'since' => '11.0.0',
  308. 'required' => true,
  309. 'description' => 'The name of the shared item which should be used in the visual representation',
  310. 'example' => 'file.txt',
  311. ],
  312. ],
  313. ],
  314. 'systemtag' => [
  315. 'author' => 'Nextcloud',
  316. 'app' => 'core',
  317. 'since' => '11.0.0',
  318. 'parameters' => [
  319. 'id' => [
  320. 'since' => '11.0.0',
  321. 'required' => true,
  322. 'description' => 'The id used to identify the systemtag on the instance',
  323. 'example' => '23',
  324. ],
  325. 'name' => [
  326. 'since' => '11.0.0',
  327. 'required' => true,
  328. 'description' => 'The display name of the systemtag which should be used in the visual representation',
  329. 'example' => 'Project 1',
  330. ],
  331. 'visibility' => [
  332. 'since' => '11.0.0',
  333. 'required' => true,
  334. 'description' => 'If the user can see the systemtag',
  335. 'example' => '1',
  336. ],
  337. 'assignable' => [
  338. 'since' => '11.0.0',
  339. 'required' => true,
  340. 'description' => 'If the user can assign the systemtag',
  341. 'example' => '0',
  342. ],
  343. ],
  344. ],
  345. 'user' => [
  346. 'author' => 'Nextcloud',
  347. 'app' => 'core',
  348. 'since' => '11.0.0',
  349. 'parameters' => [
  350. 'id' => [
  351. 'since' => '11.0.0',
  352. 'required' => true,
  353. 'description' => 'The id used to identify the user on the instance',
  354. 'example' => 'johndoe',
  355. ],
  356. 'name' => [
  357. 'since' => '11.0.0',
  358. 'required' => true,
  359. 'description' => 'The display name of the user which should be used in the visual representation',
  360. 'example' => 'John Doe',
  361. ],
  362. 'server' => [
  363. 'since' => '11.0.0',
  364. 'required' => false,
  365. 'description' => 'The URL of the instance the user lives on',
  366. 'example' => 'localhost',
  367. ],
  368. ],
  369. ],
  370. 'user-group' => [
  371. 'author' => 'Nextcloud',
  372. 'app' => 'core',
  373. 'since' => '11.0.0',
  374. 'parameters' => [
  375. 'id' => [
  376. 'since' => '11.0.0',
  377. 'required' => true,
  378. 'description' => 'The id used to identify the group on the instance',
  379. 'example' => 'supportteam',
  380. ],
  381. 'name' => [
  382. 'since' => '11.0.0',
  383. 'required' => true,
  384. 'description' => 'The display name of the group which should be used in the visual representation',
  385. 'example' => 'Support Team',
  386. ],
  387. ],
  388. ],
  389. ];
  390. /**
  391. * @param string $type
  392. * @return array
  393. * @throws InvalidObjectExeption
  394. * @since 11.0.0
  395. */
  396. public function getDefinition($type) {
  397. if (isset($this->definitions[$type])) {
  398. return $this->definitions[$type];
  399. }
  400. throw new InvalidObjectExeption('Object type is undefined');
  401. }
  402. }