1
0

routes.php 5.1 KB

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