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.

routes.php 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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' => 'DirectEditingView#edit',
  128. 'url' => '/directEditing/{token}',
  129. 'verb' => 'GET'
  130. ],
  131. [
  132. 'name' => 'Api#serviceWorker',
  133. 'url' => '/preview-service-worker.js',
  134. 'verb' => 'GET'
  135. ],
  136. [
  137. 'name' => 'view#indexView',
  138. 'url' => '/{view}',
  139. 'verb' => 'GET',
  140. ],
  141. [
  142. 'name' => 'view#indexViewFileid',
  143. 'url' => '/{view}/{fileid}',
  144. 'verb' => 'GET',
  145. ],
  146. ],
  147. 'ocs' => [
  148. [
  149. 'name' => 'DirectEditing#info',
  150. 'url' => '/api/v1/directEditing',
  151. 'verb' => 'GET'
  152. ],
  153. [
  154. 'name' => 'DirectEditing#templates',
  155. 'url' => '/api/v1/directEditing/templates/{editorId}/{creatorId}',
  156. 'verb' => 'GET'
  157. ],
  158. [
  159. 'name' => 'DirectEditing#open',
  160. 'url' => '/api/v1/directEditing/open',
  161. 'verb' => 'POST'
  162. ],
  163. [
  164. 'name' => 'DirectEditing#create',
  165. 'url' => '/api/v1/directEditing/create',
  166. 'verb' => 'POST'
  167. ],
  168. [
  169. 'name' => 'Template#list',
  170. 'url' => '/api/v1/templates',
  171. 'verb' => 'GET'
  172. ],
  173. [
  174. 'name' => 'Template#create',
  175. 'url' => '/api/v1/templates/create',
  176. 'verb' => 'POST'
  177. ],
  178. [
  179. 'name' => 'Template#path',
  180. 'url' => '/api/v1/templates/path',
  181. 'verb' => 'POST'
  182. ],
  183. [
  184. 'name' => 'TransferOwnership#transfer',
  185. 'url' => '/api/v1/transferownership',
  186. 'verb' => 'POST',
  187. ],
  188. [
  189. 'name' => 'TransferOwnership#accept',
  190. 'url' => '/api/v1/transferownership/{id}',
  191. 'verb' => 'POST',
  192. ],
  193. [
  194. 'name' => 'TransferOwnership#reject',
  195. 'url' => '/api/v1/transferownership/{id}',
  196. 'verb' => 'DELETE',
  197. ],
  198. [
  199. /** @see OpenLocalEditorController::create() */
  200. 'name' => 'OpenLocalEditor#create',
  201. 'url' => '/api/v1/openlocaleditor',
  202. 'verb' => 'POST',
  203. ],
  204. [
  205. /** @see OpenLocalEditorController::validate() */
  206. 'name' => 'OpenLocalEditor#validate',
  207. 'url' => '/api/v1/openlocaleditor/{token}',
  208. 'verb' => 'POST',
  209. ],
  210. ],
  211. ]
  212. );