routes.php 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2016, ownCloud, Inc.
  5. *
  6. * @author Bart Visscher <bartv@thisnet.nl>
  7. * @author Christoph Wurst <christoph@winzerhof-wurst.at>
  8. * @author Felix Nüsse <Felix.nuesse@t-online.de>
  9. * @author fnuesse <felix.nuesse@t-online.de>
  10. * @author fnuesse <fnuesse@techfak.uni-bielefeld.de>
  11. * @author Joas Schilling <coding@schilljs.com>
  12. * @author John Molakvoæ <skjnldsv@protonmail.com>
  13. * @author Julius Härtl <jus@bitgrid.net>
  14. * @author Lukas Reschke <lukas@statuscode.ch>
  15. * @author Nina Pypchenko <22447785+nina-py@users.noreply.github.com>
  16. * @author Robin Appelman <robin@icewind.nl>
  17. * @author Roeland Jago Douma <roeland@famdouma.nl>
  18. * @author Tobias Kaminsky <tobias@kaminsky.me>
  19. * @author Vincent Petry <vincent@nextcloud.com>
  20. *
  21. * @license AGPL-3.0
  22. *
  23. * This code is free software: you can redistribute it and/or modify
  24. * it under the terms of the GNU Affero General Public License, version 3,
  25. * as published by the Free Software Foundation.
  26. *
  27. * This program is distributed in the hope that it will be useful,
  28. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  29. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  30. * GNU Affero General Public License for more details.
  31. *
  32. * You should have received a copy of the GNU Affero General Public License, version 3,
  33. * along with this program. If not, see <http://www.gnu.org/licenses/>
  34. *
  35. */
  36. namespace OCA\Files\AppInfo;
  37. use OCA\Files\Controller\OpenLocalEditorController;
  38. // Legacy routes above
  39. /** @var $this \OC\Route\Router */
  40. $this->create('files_ajax_download', 'apps/files/ajax/download.php')
  41. ->actionInclude('files/ajax/download.php');
  42. /** @var Application $application */
  43. $application = \OC::$server->query(Application::class);
  44. $application->registerRoutes(
  45. $this,
  46. [
  47. 'routes' => [
  48. [
  49. 'name' => 'view#index',
  50. 'url' => '/',
  51. 'verb' => 'GET',
  52. ],
  53. [
  54. 'name' => 'View#showFile',
  55. 'url' => '/f/{fileid}',
  56. 'verb' => 'GET',
  57. 'root' => '',
  58. ],
  59. [
  60. 'name' => 'API#getThumbnail',
  61. 'url' => '/api/v1/thumbnail/{x}/{y}/{file}',
  62. 'verb' => 'GET',
  63. 'requirements' => ['file' => '.+']
  64. ],
  65. [
  66. 'name' => 'API#updateFileTags',
  67. 'url' => '/api/v1/files/{path}',
  68. 'verb' => 'POST',
  69. 'requirements' => ['path' => '.+'],
  70. ],
  71. [
  72. 'name' => 'API#getRecentFiles',
  73. 'url' => '/api/v1/recent/',
  74. 'verb' => 'GET'
  75. ],
  76. [
  77. 'name' => 'API#getStorageStats',
  78. 'url' => '/api/v1/stats',
  79. 'verb' => 'GET'
  80. ],
  81. [
  82. 'name' => 'API#setConfig',
  83. 'url' => '/api/v1/config/{key}',
  84. 'verb' => 'POST'
  85. ],
  86. [
  87. 'name' => 'API#getConfigs',
  88. 'url' => '/api/v1/configs',
  89. 'verb' => 'GET'
  90. ],
  91. [
  92. 'name' => 'API#updateFileSorting',
  93. 'url' => '/api/v1/sorting',
  94. 'verb' => 'POST'
  95. ],
  96. [
  97. 'name' => 'API#showHiddenFiles',
  98. 'url' => '/api/v1/showhidden',
  99. 'verb' => 'POST'
  100. ],
  101. [
  102. 'name' => 'API#cropImagePreviews',
  103. 'url' => '/api/v1/cropimagepreviews',
  104. 'verb' => 'POST'
  105. ],
  106. [
  107. 'name' => 'API#showGridView',
  108. 'url' => '/api/v1/showgridview',
  109. 'verb' => 'POST'
  110. ],
  111. [
  112. 'name' => 'API#getGridView',
  113. 'url' => '/api/v1/showgridview',
  114. 'verb' => 'GET'
  115. ],
  116. [
  117. 'name' => 'API#toggleShowFolder',
  118. 'url' => '/api/v1/toggleShowFolder/{key}',
  119. 'verb' => 'POST'
  120. ],
  121. [
  122. 'name' => 'API#getNodeType',
  123. 'url' => '/api/v1/quickaccess/get/NodeType',
  124. 'verb' => 'GET',
  125. ],
  126. [
  127. 'name' => 'DirectEditingView#edit',
  128. 'url' => '/directEditing/{token}',
  129. 'verb' => 'GET'
  130. ],
  131. [
  132. 'name' => 'view#index',
  133. 'url' => '/{view}',
  134. 'verb' => 'GET',
  135. 'postfix' => 'view',
  136. ],
  137. [
  138. 'name' => 'view#index',
  139. 'url' => '/{view}/{fileid}',
  140. 'verb' => 'GET',
  141. 'postfix' => 'fileid',
  142. ],
  143. ],
  144. 'ocs' => [
  145. [
  146. 'name' => 'DirectEditing#info',
  147. 'url' => '/api/v1/directEditing',
  148. 'verb' => 'GET'
  149. ],
  150. [
  151. 'name' => 'DirectEditing#templates',
  152. 'url' => '/api/v1/directEditing/templates/{editorId}/{creatorId}',
  153. 'verb' => 'GET'
  154. ],
  155. [
  156. 'name' => 'DirectEditing#open',
  157. 'url' => '/api/v1/directEditing/open',
  158. 'verb' => 'POST'
  159. ],
  160. [
  161. 'name' => 'DirectEditing#create',
  162. 'url' => '/api/v1/directEditing/create',
  163. 'verb' => 'POST'
  164. ],
  165. [
  166. 'name' => 'Template#list',
  167. 'url' => '/api/v1/templates',
  168. 'verb' => 'GET'
  169. ],
  170. [
  171. 'name' => 'Template#create',
  172. 'url' => '/api/v1/templates/create',
  173. 'verb' => 'POST'
  174. ],
  175. [
  176. 'name' => 'Template#path',
  177. 'url' => '/api/v1/templates/path',
  178. 'verb' => 'POST'
  179. ],
  180. [
  181. 'name' => 'TransferOwnership#transfer',
  182. 'url' => '/api/v1/transferownership',
  183. 'verb' => 'POST',
  184. ],
  185. [
  186. 'name' => 'TransferOwnership#accept',
  187. 'url' => '/api/v1/transferownership/{id}',
  188. 'verb' => 'POST',
  189. ],
  190. [
  191. 'name' => 'TransferOwnership#reject',
  192. 'url' => '/api/v1/transferownership/{id}',
  193. 'verb' => 'DELETE',
  194. ],
  195. [
  196. /** @see OpenLocalEditorController::create() */
  197. 'name' => 'OpenLocalEditor#create',
  198. 'url' => '/api/v1/openlocaleditor',
  199. 'verb' => 'POST',
  200. ],
  201. [
  202. /** @see OpenLocalEditorController::validate() */
  203. 'name' => 'OpenLocalEditor#validate',
  204. 'url' => '/api/v1/openlocaleditor/{token}',
  205. 'verb' => 'POST',
  206. ],
  207. [
  208. /** @see DownloadController::index() */
  209. 'name' => 'Download#index',
  210. 'url' => '/api/v1/download',
  211. 'verb' => 'GET',
  212. ],
  213. ],
  214. ]
  215. );