You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

516 lines
14 KiB

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