Definitions.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436
  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. ],
  255. ],
  256. 'highlight' => [
  257. 'author' => 'Nextcloud',
  258. 'app' => 'core',
  259. 'since' => '13.0.0',
  260. 'parameters' => [
  261. 'id' => [
  262. 'since' => '13.0.0',
  263. 'required' => true,
  264. 'description' => 'The id used to identify the highlighted object on the instance',
  265. 'example' => '42',
  266. ],
  267. 'name' => [
  268. 'since' => '13.0.0',
  269. 'required' => true,
  270. 'description' => 'The string that should be highlighted.',
  271. 'example' => 'Hello World',
  272. ],
  273. 'link' => [
  274. 'since' => '13.0.0',
  275. 'required' => false,
  276. 'description' => 'The full URL that should be opened when clicking the highlighted text.',
  277. 'example' => 'http://localhost/index.php/f/42',
  278. ],
  279. ],
  280. ],
  281. 'open-graph' => [
  282. 'author' => 'Maxence Lange',
  283. 'app' => 'mood',
  284. 'since' => '12.0.0',
  285. 'parameters' => [
  286. 'id' => [
  287. 'since' => '12.0.0',
  288. 'required' => true,
  289. 'description' => 'The id used to identify the open graph data on the instance',
  290. 'example' => '42',
  291. ],
  292. 'name' => [
  293. 'since' => '12.0.0',
  294. 'required' => true,
  295. 'description' => 'The open graph title of the website',
  296. 'example' => 'This is a website',
  297. ],
  298. 'description' => [
  299. 'since' => '12.0.0',
  300. 'required' => false,
  301. 'description' => 'The open graph description from the website',
  302. 'example' => 'This is the description of the website',
  303. ],
  304. 'thumb' => [
  305. 'since' => '12.0.0',
  306. 'required' => false,
  307. 'description' => 'The full URL of the open graph thumbnail',
  308. 'example' => 'http://localhost/index.php/apps/mood/data/image?url=https%3A%2F%2Fthumb.example.com%2Fimage.png',
  309. ],
  310. 'website' => [
  311. 'since' => '12.0.0',
  312. 'required' => false,
  313. 'description' => 'The name of the described website',
  314. 'example' => 'Nextcloud - App Store',
  315. ],
  316. 'link' => [
  317. 'since' => '12.0.0',
  318. 'required' => false,
  319. 'description' => 'The full link to the website',
  320. 'example' => 'https://apps.nextcloud.com/apps/mood',
  321. ],
  322. ],
  323. ],
  324. 'pending-federated-share' => [
  325. 'author' => 'Nextcloud',
  326. 'app' => 'dav',
  327. 'since' => '11.0.0',
  328. 'parameters' => [
  329. 'id' => [
  330. 'since' => '11.0.0',
  331. 'required' => true,
  332. 'description' => 'The id used to identify the federated share on the instance',
  333. 'example' => '42',
  334. ],
  335. 'name' => [
  336. 'since' => '11.0.0',
  337. 'required' => true,
  338. 'description' => 'The name of the shared item which should be used in the visual representation',
  339. 'example' => 'file.txt',
  340. ],
  341. ],
  342. ],
  343. 'systemtag' => [
  344. 'author' => 'Nextcloud',
  345. 'app' => 'core',
  346. 'since' => '11.0.0',
  347. 'parameters' => [
  348. 'id' => [
  349. 'since' => '11.0.0',
  350. 'required' => true,
  351. 'description' => 'The id used to identify the systemtag on the instance',
  352. 'example' => '23',
  353. ],
  354. 'name' => [
  355. 'since' => '11.0.0',
  356. 'required' => true,
  357. 'description' => 'The display name of the systemtag which should be used in the visual representation',
  358. 'example' => 'Project 1',
  359. ],
  360. 'visibility' => [
  361. 'since' => '11.0.0',
  362. 'required' => true,
  363. 'description' => 'If the user can see the systemtag',
  364. 'example' => '1',
  365. ],
  366. 'assignable' => [
  367. 'since' => '11.0.0',
  368. 'required' => true,
  369. 'description' => 'If the user can assign the systemtag',
  370. 'example' => '0',
  371. ],
  372. ],
  373. ],
  374. 'user' => [
  375. 'author' => 'Nextcloud',
  376. 'app' => 'core',
  377. 'since' => '11.0.0',
  378. 'parameters' => [
  379. 'id' => [
  380. 'since' => '11.0.0',
  381. 'required' => true,
  382. 'description' => 'The id used to identify the user on the instance',
  383. 'example' => 'johndoe',
  384. ],
  385. 'name' => [
  386. 'since' => '11.0.0',
  387. 'required' => true,
  388. 'description' => 'The display name of the user which should be used in the visual representation',
  389. 'example' => 'John Doe',
  390. ],
  391. 'server' => [
  392. 'since' => '11.0.0',
  393. 'required' => false,
  394. 'description' => 'The URL of the instance the user lives on',
  395. 'example' => 'localhost',
  396. ],
  397. ],
  398. ],
  399. 'user-group' => [
  400. 'author' => 'Nextcloud',
  401. 'app' => 'core',
  402. 'since' => '11.0.0',
  403. 'parameters' => [
  404. 'id' => [
  405. 'since' => '11.0.0',
  406. 'required' => true,
  407. 'description' => 'The id used to identify the group on the instance',
  408. 'example' => 'supportteam',
  409. ],
  410. 'name' => [
  411. 'since' => '11.0.0',
  412. 'required' => true,
  413. 'description' => 'The display name of the group which should be used in the visual representation',
  414. 'example' => 'Support Team',
  415. ],
  416. ],
  417. ],
  418. ];
  419. /**
  420. * @param string $type
  421. * @return array
  422. * @throws InvalidObjectExeption
  423. * @since 11.0.0
  424. */
  425. public function getDefinition($type) {
  426. if (isset($this->definitions[$type])) {
  427. return $this->definitions[$type];
  428. }
  429. throw new InvalidObjectExeption('Object type is undefined');
  430. }
  431. }