Definitions.php 12 KB

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