Definitions.php 19 KB

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