Definitions.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016 Joas Schilling <coding@schilljs.com>
  4. *
  5. * @author Joas Schilling <coding@schilljs.com>
  6. * @author Jonas Rittershofer <jotoeri@users.noreply.github.com>
  7. * @author Julius Härtl <jus@bitgrid.net>
  8. * @author Maxence Lange <maxence@nextcloud.com>
  9. * @author Roeland Jago Douma <roeland@famdouma.nl>
  10. * @author Thomas Citharel <nextcloud@tcit.fr>
  11. * @author Vincent Petry <vincent@nextcloud.com>
  12. * @author Vitor Mattos <vitor@php.rio>
  13. *
  14. * @license GNU AGPL version 3 or any later version
  15. *
  16. * This program is free software: you can redistribute it and/or modify
  17. * it under the terms of the GNU Affero General Public License as
  18. * published by the Free Software Foundation, either version 3 of the
  19. * License, or (at your option) any later version.
  20. *
  21. * This program is distributed in the hope that it will be useful,
  22. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24. * GNU Affero General Public License for more details.
  25. *
  26. * You should have received a copy of the GNU Affero General Public License
  27. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  28. *
  29. */
  30. namespace OCP\RichObjectStrings;
  31. /**
  32. * Class Definitions
  33. *
  34. * @since 11.0.0
  35. */
  36. class Definitions {
  37. /**
  38. * @var array
  39. * @since 11.0.0
  40. */
  41. public $definitions = [
  42. 'addressbook' => [
  43. 'author' => 'Nextcloud',
  44. 'app' => 'dav',
  45. 'since' => '11.0.0',
  46. 'parameters' => [
  47. 'id' => [
  48. 'since' => '11.0.0',
  49. 'required' => true,
  50. 'description' => 'The id used to identify the addressbook on the instance',
  51. 'example' => '42',
  52. ],
  53. 'name' => [
  54. 'since' => '11.0.0',
  55. 'required' => true,
  56. 'description' => 'The display name of the addressbook which should be used in the visual representation',
  57. 'example' => 'Contacts',
  58. ],
  59. ],
  60. ],
  61. 'addressbook-contact' => [
  62. 'author' => 'Nextcloud',
  63. 'app' => 'dav',
  64. 'since' => '11.0.0',
  65. 'parameters' => [
  66. 'id' => [
  67. 'since' => '11.0.0',
  68. 'required' => true,
  69. 'description' => 'The id used to identify the contact on the instance',
  70. 'example' => '42',
  71. ],
  72. 'name' => [
  73. 'since' => '11.0.0',
  74. 'required' => true,
  75. 'description' => 'The display name of the contact which should be used in the visual representation',
  76. 'example' => 'John Doe',
  77. ],
  78. ],
  79. ],
  80. 'announcement' => [
  81. 'author' => 'Joas Schilling',
  82. 'app' => 'announcementcenter',
  83. 'since' => '11.0.0',
  84. 'parameters' => [
  85. 'id' => [
  86. 'since' => '11.0.0',
  87. 'required' => true, 'description' => 'The id used to identify the announcement on the instance',
  88. 'example' => '42',
  89. ],
  90. 'name' => [
  91. 'since' => '11.0.0',
  92. 'required' => true,
  93. 'description' => 'The announcement subject which should be used in the visual representation',
  94. 'example' => 'file.txt',
  95. ],
  96. 'link' => [
  97. 'since' => '11.0.0',
  98. 'required' => false,
  99. 'description' => 'The full URL to the file',
  100. 'example' => 'http://localhost/index.php/apps/announcements/#23',
  101. ],
  102. ],
  103. ],
  104. 'app' => [
  105. 'author' => 'Nextcloud',
  106. 'app' => 'updatenotification',
  107. 'since' => '11.0.0',
  108. 'parameters' => [
  109. 'id' => [
  110. 'since' => '11.0.0',
  111. 'required' => true, 'description' => 'The app id',
  112. 'example' => 'updatenotification',
  113. ],
  114. 'name' => [
  115. 'since' => '11.0.0',
  116. 'required' => true,
  117. 'description' => 'The name of the app which should be used in the visual representation',
  118. 'example' => 'Update notification',
  119. ],
  120. ],
  121. ],
  122. 'calendar' => [
  123. 'author' => 'Nextcloud',
  124. 'app' => 'dav',
  125. 'since' => '11.0.0',
  126. 'parameters' => [
  127. 'id' => [
  128. 'since' => '11.0.0',
  129. 'required' => true,
  130. 'description' => 'The id used to identify the calendar on the instance',
  131. 'example' => '42',
  132. ],
  133. 'name' => [
  134. 'since' => '11.0.0',
  135. 'required' => true,
  136. 'description' => 'The display name of the calendar which should be used in the visual representation',
  137. 'example' => 'Personal',
  138. ],
  139. ],
  140. ],
  141. 'calendar-event' => [
  142. 'author' => 'Nextcloud',
  143. 'app' => 'dav',
  144. 'since' => '11.0.0',
  145. 'parameters' => [
  146. 'id' => [
  147. 'since' => '11.0.0',
  148. 'required' => true,
  149. 'description' => 'The id used to identify the event on the instance',
  150. 'example' => '42',
  151. ],
  152. 'name' => [
  153. 'since' => '11.0.0',
  154. 'required' => true,
  155. 'description' => 'The display name of the event which should be used in the visual representation',
  156. 'example' => 'Workout',
  157. ],
  158. 'link' => [
  159. 'since' => '19.0.0',
  160. 'required' => false,
  161. 'description' => 'A link to the page displaying the calendar',
  162. 'example' => 'http://localhost/index.php/apps/calendar/dayGridMonth/2020-01-20/edit/sidebar/base64string/1579046400'
  163. ]
  164. ],
  165. ],
  166. 'call' => [
  167. 'author' => 'Nextcloud',
  168. 'app' => 'spreed',
  169. 'since' => '11.0.2',
  170. 'parameters' => [
  171. 'id' => [
  172. 'since' => '11.0.2',
  173. 'required' => true,
  174. 'description' => 'The id used to identify the call on the instance',
  175. 'example' => '42',
  176. ],
  177. 'name' => [
  178. 'since' => '11.0.2',
  179. 'required' => true,
  180. 'description' => 'The display name of the call which should be used in the visual representation',
  181. 'example' => 'Company call',
  182. ],
  183. 'call-type' => [
  184. 'since' => '11.0.2',
  185. 'required' => true,
  186. 'description' => 'The type of the call: one2one, group or public',
  187. 'example' => 'one2one',
  188. ],
  189. 'link' => [
  190. 'since' => '19.0.0',
  191. 'required' => false,
  192. 'description' => 'The link to the conversation',
  193. 'example' => 'https://localhost/index.php/call/R4nd0mToken',
  194. ],
  195. 'icon-url' => [
  196. 'since' => '27.0.0',
  197. 'required' => false,
  198. 'description' => 'The icon url to use as avatar',
  199. 'example' => 'https://localhost/ocs/v2.php/apps/spreed/api/v1/room/R4nd0mToken/avatar'
  200. ],
  201. 'message-id' => [
  202. 'since' => '27.0.0',
  203. 'required' => false,
  204. 'description' => 'The id of a message that was referred to',
  205. 'example' => '12345',
  206. ],
  207. ],
  208. ],
  209. 'circle' => [
  210. 'author' => 'Maxence Lange',
  211. 'app' => 'circles',
  212. 'since' => '12.0.0',
  213. 'parameters' => [
  214. 'id' => [
  215. 'since' => '12.0.0',
  216. 'required' => true,
  217. 'description' => 'The id used to identify the circle on the instance',
  218. 'example' => '42',
  219. ],
  220. 'name' => [
  221. 'since' => '12.0.0',
  222. 'required' => true,
  223. 'description' => 'The display name of the circle which should be used in the visual representation',
  224. 'example' => 'My friends',
  225. ],
  226. 'link' => [
  227. 'since' => '12.0.0',
  228. 'required' => true,
  229. 'description' => 'The full URL to the circle',
  230. 'example' => 'http://localhost/index.php/apps/circles/#42',
  231. ],
  232. ],
  233. ],
  234. 'deck-board' => [
  235. 'author' => 'Nextcloud',
  236. 'app' => 'deck',
  237. 'since' => '21.0.0',
  238. 'parameters' => [
  239. 'id' => [
  240. 'since' => '21.0.0',
  241. 'required' => true,
  242. 'description' => 'The id used to identify the board on the instance',
  243. 'example' => '1',
  244. ],
  245. 'name' => [
  246. 'since' => '21.0.0',
  247. 'required' => true,
  248. 'description' => 'The display name of the deck board',
  249. 'example' => 'Personal',
  250. ],
  251. 'link' => [
  252. 'since' => '21.0.0',
  253. 'required' => true,
  254. 'description' => 'The full URL to the board',
  255. 'example' => 'http://localhost/index.php/apps/deck/#/board/1',
  256. ],
  257. ],
  258. ],
  259. 'deck-card' => [
  260. 'author' => 'Nextcloud',
  261. 'app' => 'deck',
  262. 'since' => '21.0.0',
  263. 'parameters' => [
  264. 'id' => [
  265. 'since' => '21.0.0',
  266. 'required' => true,
  267. 'description' => 'The id used to identify the card on the instance',
  268. 'example' => '1',
  269. ],
  270. 'name' => [
  271. 'since' => '21.0.0',
  272. 'required' => true,
  273. 'description' => 'The title of the deck card',
  274. 'example' => 'Foo Bar',
  275. ],
  276. 'boardname' => [
  277. 'since' => '21.0.0',
  278. 'required' => true,
  279. 'description' => 'The display name of board which contains the card',
  280. 'example' => 'Personal',
  281. ],
  282. 'stackname' => [
  283. 'since' => '21.0.0',
  284. 'required' => true,
  285. 'description' => 'The display name of the stack which contains the card in the board',
  286. 'example' => 'To do',
  287. ],
  288. 'link' => [
  289. 'since' => '21.0.0',
  290. 'required' => true,
  291. 'description' => 'The full URL to the card directly',
  292. 'example' => 'https://nextcloud21.local/index.php/apps/deck/#/board/1/card/1',
  293. ],
  294. ],
  295. ],
  296. 'email' => [
  297. 'author' => 'Nextcloud',
  298. 'app' => 'sharebymail',
  299. 'since' => '11.0.0',
  300. 'parameters' => [
  301. 'id' => [
  302. 'since' => '11.0.0',
  303. 'required' => true,
  304. 'description' => 'The mail-address used to identify the event on the instance',
  305. 'example' => 'test@localhost',
  306. ],
  307. 'name' => [
  308. 'since' => '11.0.0',
  309. 'required' => true,
  310. 'description' => 'The display name of a matching contact or the email (fallback) which should be used in the visual representation',
  311. 'example' => 'Foo Bar',
  312. ],
  313. ],
  314. ],
  315. 'file' => [
  316. 'author' => 'Nextcloud',
  317. 'app' => 'dav',
  318. 'since' => '11.0.0',
  319. 'parameters' => [
  320. 'id' => [
  321. 'since' => '11.0.0',
  322. 'required' => true,
  323. 'description' => 'The id used to identify the file on the instance',
  324. 'example' => '42',
  325. ],
  326. 'name' => [
  327. 'since' => '11.0.0',
  328. 'required' => true,
  329. 'description' => 'The file name which should be used in the visual representation',
  330. 'example' => 'file.txt',
  331. ],
  332. 'size' => [
  333. 'since' => '21.0.0',
  334. 'required' => false,
  335. 'description' => 'The file size in bytes',
  336. 'example' => '3145728',
  337. ],
  338. 'path' => [
  339. 'since' => '11.0.0',
  340. 'required' => true,
  341. 'description' => 'The full path of the file for the user, should not start with a slash',
  342. 'example' => 'path/to/file.txt',
  343. ],
  344. 'link' => [
  345. 'since' => '11.0.0',
  346. 'required' => false,
  347. 'description' => 'The full URL to the file',
  348. 'example' => 'http://localhost/index.php/f/42',
  349. ],
  350. 'mimetype' => [
  351. 'since' => '16.0.0',
  352. 'required' => false,
  353. 'description' => 'The mimetype of the file/folder to allow clients to show a placeholder',
  354. 'example' => 'text/plain',
  355. ],
  356. 'preview-available' => [
  357. 'since' => '16.0.0',
  358. 'required' => false,
  359. 'description' => 'Whether or not a preview is available. If `no` the mimetype icon should be used',
  360. 'example' => 'yes',
  361. ],
  362. 'mtime' => [
  363. 'since' => '25.0.0',
  364. 'required' => false,
  365. 'description' => 'The mtime of the file/folder as unix timestamp',
  366. 'example' => '1661854213',
  367. ],
  368. ],
  369. ],
  370. 'forms-form' => [
  371. 'author' => 'Nextcloud',
  372. 'app' => 'forms',
  373. 'since' => '21.0.1',
  374. 'parameters' => [
  375. 'id' => [
  376. 'since' => '21.0.1',
  377. 'required' => true,
  378. 'description' => 'The form-hash of the form',
  379. 'example' => 'q72GGqbfbLBC6xNB',
  380. ],
  381. 'name' => [
  382. 'since' => '21.0.1',
  383. 'required' => true,
  384. 'description' => 'The title of the form',
  385. 'example' => 'Nice Form',
  386. ],
  387. 'link' => [
  388. 'since' => '21.0.1',
  389. 'required' => true,
  390. 'description' => 'The full URL to the board',
  391. 'example' => 'http://localhost/index.php/apps/forms/q72GGqbfbLBC6xNB',
  392. ],
  393. ],
  394. ],
  395. 'guest' => [
  396. 'author' => 'Nextcloud',
  397. 'app' => 'spreed',
  398. 'since' => '17.0.0',
  399. 'parameters' => [
  400. 'id' => [
  401. 'since' => '17.0.0',
  402. 'required' => true,
  403. 'description' => 'The id used to identify the guest user',
  404. 'example' => '42',
  405. ],
  406. 'name' => [
  407. 'since' => '17.0.0',
  408. 'required' => true,
  409. 'description' => 'Potential displayname of the guest user',
  410. 'example' => 'Foobar Cats',
  411. ],
  412. ],
  413. ],
  414. 'highlight' => [
  415. 'author' => 'Nextcloud',
  416. 'app' => 'core',
  417. 'since' => '13.0.0',
  418. 'parameters' => [
  419. 'id' => [
  420. 'since' => '13.0.0',
  421. 'required' => true,
  422. 'description' => 'The id used to identify the highlighted object on the instance',
  423. 'example' => '42',
  424. ],
  425. 'name' => [
  426. 'since' => '13.0.0',
  427. 'required' => true,
  428. 'description' => 'The string that should be highlighted.',
  429. 'example' => 'Hello World',
  430. ],
  431. 'link' => [
  432. 'since' => '13.0.0',
  433. 'required' => false,
  434. 'description' => 'The full URL that should be opened when clicking the highlighted text.',
  435. 'example' => 'http://localhost/index.php/f/42',
  436. ],
  437. ],
  438. ],
  439. 'geo-location' => [
  440. 'author' => 'Nextcloud',
  441. 'app' => 'core',
  442. 'since' => '22.0.0',
  443. 'parameters' => [
  444. 'id' => [
  445. 'since' => '22.0.0',
  446. 'required' => true,
  447. 'description' => 'The geo URI (https://en.wikipedia.org/wiki/Geo_URI_scheme) to identify the location',
  448. 'example' => 'geo:52.5450511,13.3741463',
  449. ],
  450. 'name' => [
  451. 'since' => '22.0.0',
  452. 'required' => true,
  453. 'description' => 'A description of the location',
  454. 'example' => 'Nextcloud Berlin Office',
  455. ],
  456. 'latitude' => [
  457. 'since' => '22.0.0',
  458. 'required' => true,
  459. 'description' => 'The latitude of the location MUST be the same as in the id',
  460. 'example' => '52.5450511',
  461. ],
  462. 'longitude' => [
  463. 'since' => '22.0.0',
  464. 'required' => true,
  465. 'description' => 'The longitude of the location MUST be the same as in the id',
  466. 'example' => '13.3741463',
  467. ],
  468. ],
  469. ],
  470. 'open-graph' => [
  471. 'author' => 'Maxence Lange',
  472. 'app' => 'mood',
  473. 'since' => '12.0.0',
  474. 'parameters' => [
  475. 'id' => [
  476. 'since' => '12.0.0',
  477. 'required' => true,
  478. 'description' => 'The id used to identify the open graph data on the instance',
  479. 'example' => '42',
  480. ],
  481. 'name' => [
  482. 'since' => '12.0.0',
  483. 'required' => true,
  484. 'description' => 'The open graph title of the website',
  485. 'example' => 'This is a website',
  486. ],
  487. 'description' => [
  488. 'since' => '12.0.0',
  489. 'required' => false,
  490. 'description' => 'The open graph description from the website',
  491. 'example' => 'This is the description of the website',
  492. ],
  493. 'thumb' => [
  494. 'since' => '12.0.0',
  495. 'required' => false,
  496. 'description' => 'The full URL of the open graph thumbnail',
  497. 'example' => 'http://localhost/index.php/apps/mood/data/image?url=https%3A%2F%2Fthumb.example.com%2Fimage.png',
  498. ],
  499. 'website' => [
  500. 'since' => '12.0.0',
  501. 'required' => false,
  502. 'description' => 'The name of the described website',
  503. 'example' => 'Nextcloud - App Store',
  504. ],
  505. 'link' => [
  506. 'since' => '12.0.0',
  507. 'required' => false,
  508. 'description' => 'The full link to the website',
  509. 'example' => 'https://apps.nextcloud.com/apps/mood',
  510. ],
  511. ],
  512. ],
  513. 'pending-federated-share' => [
  514. 'author' => 'Nextcloud',
  515. 'app' => 'dav',
  516. 'since' => '11.0.0',
  517. 'parameters' => [
  518. 'id' => [
  519. 'since' => '11.0.0',
  520. 'required' => true,
  521. 'description' => 'The id used to identify the federated share on the instance',
  522. 'example' => '42',
  523. ],
  524. 'name' => [
  525. 'since' => '11.0.0',
  526. 'required' => true,
  527. 'description' => 'The name of the shared item which should be used in the visual representation',
  528. 'example' => 'file.txt',
  529. ],
  530. ],
  531. ],
  532. 'systemtag' => [
  533. 'author' => 'Nextcloud',
  534. 'app' => 'core',
  535. 'since' => '11.0.0',
  536. 'parameters' => [
  537. 'id' => [
  538. 'since' => '11.0.0',
  539. 'required' => true,
  540. 'description' => 'The id used to identify the systemtag on the instance',
  541. 'example' => '23',
  542. ],
  543. 'name' => [
  544. 'since' => '11.0.0',
  545. 'required' => true,
  546. 'description' => 'The display name of the systemtag which should be used in the visual representation',
  547. 'example' => 'Project 1',
  548. ],
  549. 'visibility' => [
  550. 'since' => '11.0.0',
  551. 'required' => true,
  552. 'description' => 'If the user can see the systemtag',
  553. 'example' => '1',
  554. ],
  555. 'assignable' => [
  556. 'since' => '11.0.0',
  557. 'required' => true,
  558. 'description' => 'If the user can assign the systemtag',
  559. 'example' => '0',
  560. ],
  561. ],
  562. ],
  563. 'talk-attachment' => [
  564. 'author' => 'Nextcloud',
  565. 'app' => 'talk',
  566. 'since' => '18.0.0',
  567. 'parameters' => [
  568. 'id' => [
  569. 'since' => '18.0.0',
  570. 'required' => true,
  571. 'description' => 'The id used to identify the attachment on the instance',
  572. 'example' => '12345',
  573. ],
  574. 'name' => [
  575. 'since' => '18.0.0',
  576. 'required' => true,
  577. 'description' => 'The name of the attachment',
  578. 'example' => 'John Doe',
  579. ],
  580. 'conversation' => [
  581. 'since' => '18.0.0',
  582. 'required' => true,
  583. 'description' => 'The token of the conversation',
  584. 'example' => 'a1b2c3d4',
  585. ],
  586. 'mimetype' => [
  587. 'since' => '18.0.0',
  588. 'required' => false,
  589. 'description' => 'The mimetype of the file/folder to allow clients to show a placeholder',
  590. 'example' => 'text/plain',
  591. ],
  592. 'preview-available' => [
  593. 'since' => '18.0.0',
  594. 'required' => false,
  595. 'description' => 'Whether or not a preview is available. If `no` the mimetype icon should be used',
  596. 'example' => 'yes',
  597. ],
  598. ],
  599. ],
  600. 'talk-poll' => [
  601. 'author' => 'Nextcloud',
  602. 'app' => 'talk',
  603. 'since' => '25.0.0',
  604. 'parameters' => [
  605. 'id' => [
  606. 'since' => '25.0.0',
  607. 'required' => true,
  608. 'description' => 'The id used to identify the poll on the instance',
  609. 'example' => '12345',
  610. ],
  611. 'name' => [
  612. 'since' => '25.0.0',
  613. 'required' => true,
  614. 'description' => 'The poll question',
  615. 'example' => 'What is the question?',
  616. ],
  617. ],
  618. ],
  619. 'user' => [
  620. 'author' => 'Nextcloud',
  621. 'app' => 'core',
  622. 'since' => '11.0.0',
  623. 'parameters' => [
  624. 'id' => [
  625. 'since' => '11.0.0',
  626. 'required' => true,
  627. 'description' => 'The id used to identify the user on the instance',
  628. 'example' => 'johndoe',
  629. ],
  630. 'name' => [
  631. 'since' => '11.0.0',
  632. 'required' => true,
  633. 'description' => 'The display name of the user which should be used in the visual representation',
  634. 'example' => 'John Doe',
  635. ],
  636. 'server' => [
  637. 'since' => '11.0.0',
  638. 'required' => false,
  639. 'description' => 'The URL of the instance the user lives on',
  640. 'example' => 'localhost',
  641. ],
  642. ],
  643. ],
  644. 'user-group' => [
  645. 'author' => 'Nextcloud',
  646. 'app' => 'core',
  647. 'since' => '11.0.0',
  648. 'parameters' => [
  649. 'id' => [
  650. 'since' => '11.0.0',
  651. 'required' => true,
  652. 'description' => 'The id used to identify the group on the instance',
  653. 'example' => 'supportteam',
  654. ],
  655. 'name' => [
  656. 'since' => '11.0.0',
  657. 'required' => true,
  658. 'description' => 'The display name of the group which should be used in the visual representation',
  659. 'example' => 'Support Team',
  660. ],
  661. ],
  662. ],
  663. ];
  664. /**
  665. * @param string $type
  666. * @return array
  667. * @throws InvalidObjectExeption
  668. * @since 11.0.0
  669. */
  670. public function getDefinition($type) {
  671. if (isset($this->definitions[$type])) {
  672. return $this->definitions[$type];
  673. }
  674. throw new InvalidObjectExeption('Object type is undefined');
  675. }
  676. }