1
0

routes.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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 \OC\Route\Router $this */
  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->get(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#setViewConfig',
  83. 'url' => '/api/v1/views/{view}/{key}',
  84. 'verb' => 'PUT'
  85. ],
  86. [
  87. 'name' => 'API#getViewConfigs',
  88. 'url' => '/api/v1/views',
  89. 'verb' => 'GET'
  90. ],
  91. [
  92. 'name' => 'API#getViewConfig',
  93. 'url' => '/api/v1/views/{view}',
  94. 'verb' => 'GET'
  95. ],
  96. [
  97. 'name' => 'API#setConfig',
  98. 'url' => '/api/v1/config/{key}',
  99. 'verb' => 'PUT'
  100. ],
  101. [
  102. 'name' => 'API#getConfigs',
  103. 'url' => '/api/v1/configs',
  104. 'verb' => 'GET'
  105. ],
  106. [
  107. 'name' => 'API#showHiddenFiles',
  108. 'url' => '/api/v1/showhidden',
  109. 'verb' => 'POST'
  110. ],
  111. [
  112. 'name' => 'API#cropImagePreviews',
  113. 'url' => '/api/v1/cropimagepreviews',
  114. 'verb' => 'POST'
  115. ],
  116. [
  117. 'name' => 'API#showGridView',
  118. 'url' => '/api/v1/showgridview',
  119. 'verb' => 'POST'
  120. ],
  121. [
  122. 'name' => 'API#getGridView',
  123. 'url' => '/api/v1/showgridview',
  124. 'verb' => 'GET'
  125. ],
  126. [
  127. 'name' => 'API#getNodeType',
  128. 'url' => '/api/v1/quickaccess/get/NodeType',
  129. 'verb' => 'GET',
  130. ],
  131. [
  132. 'name' => 'DirectEditingView#edit',
  133. 'url' => '/directEditing/{token}',
  134. 'verb' => 'GET'
  135. ],
  136. [
  137. 'name' => 'api#serviceWorker',
  138. 'url' => '/preview-service-worker.js',
  139. 'verb' => 'GET'
  140. ],
  141. [
  142. 'name' => 'view#index',
  143. 'url' => '/{view}',
  144. 'verb' => 'GET',
  145. 'postfix' => 'view',
  146. ],
  147. [
  148. 'name' => 'view#index',
  149. 'url' => '/{view}/{fileid}',
  150. 'verb' => 'GET',
  151. 'postfix' => 'fileid',
  152. ],
  153. ],
  154. 'ocs' => [
  155. [
  156. 'name' => 'DirectEditing#info',
  157. 'url' => '/api/v1/directEditing',
  158. 'verb' => 'GET'
  159. ],
  160. [
  161. 'name' => 'DirectEditing#templates',
  162. 'url' => '/api/v1/directEditing/templates/{editorId}/{creatorId}',
  163. 'verb' => 'GET'
  164. ],
  165. [
  166. 'name' => 'DirectEditing#open',
  167. 'url' => '/api/v1/directEditing/open',
  168. 'verb' => 'POST'
  169. ],
  170. [
  171. 'name' => 'DirectEditing#create',
  172. 'url' => '/api/v1/directEditing/create',
  173. 'verb' => 'POST'
  174. ],
  175. [
  176. 'name' => 'Template#list',
  177. 'url' => '/api/v1/templates',
  178. 'verb' => 'GET'
  179. ],
  180. [
  181. 'name' => 'Template#create',
  182. 'url' => '/api/v1/templates/create',
  183. 'verb' => 'POST'
  184. ],
  185. [
  186. 'name' => 'Template#path',
  187. 'url' => '/api/v1/templates/path',
  188. 'verb' => 'POST'
  189. ],
  190. [
  191. 'name' => 'TransferOwnership#transfer',
  192. 'url' => '/api/v1/transferownership',
  193. 'verb' => 'POST',
  194. ],
  195. [
  196. 'name' => 'TransferOwnership#accept',
  197. 'url' => '/api/v1/transferownership/{id}',
  198. 'verb' => 'POST',
  199. ],
  200. [
  201. 'name' => 'TransferOwnership#reject',
  202. 'url' => '/api/v1/transferownership/{id}',
  203. 'verb' => 'DELETE',
  204. ],
  205. [
  206. /** @see OpenLocalEditorController::create() */
  207. 'name' => 'OpenLocalEditor#create',
  208. 'url' => '/api/v1/openlocaleditor',
  209. 'verb' => 'POST',
  210. ],
  211. [
  212. /** @see OpenLocalEditorController::validate() */
  213. 'name' => 'OpenLocalEditor#validate',
  214. 'url' => '/api/v1/openlocaleditor/{token}',
  215. 'verb' => 'POST',
  216. ],
  217. ],
  218. ]
  219. );