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.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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. /** @var Application $application */
  39. $application = \OC::$server->query(Application::class);
  40. $application->registerRoutes(
  41. $this,
  42. [
  43. 'routes' => [
  44. [
  45. 'name' => 'view#index',
  46. 'url' => '/',
  47. 'verb' => 'GET',
  48. ],
  49. [
  50. 'name' => 'view#index',
  51. 'url' => '/{view}',
  52. 'verb' => 'GET',
  53. 'postfix' => 'view',
  54. ],
  55. [
  56. 'name' => 'view#index',
  57. 'url' => '/{view}/{fileid}',
  58. 'verb' => 'GET',
  59. 'postfix' => 'fileid',
  60. ],
  61. [
  62. 'name' => 'View#showFile',
  63. 'url' => '/f/{fileid}',
  64. 'verb' => 'GET',
  65. 'root' => '',
  66. ],
  67. [
  68. 'name' => 'ajax#getStorageStats',
  69. 'url' => '/ajax/getstoragestats',
  70. 'verb' => 'GET',
  71. ],
  72. [
  73. 'name' => 'API#getThumbnail',
  74. 'url' => '/api/v1/thumbnail/{x}/{y}/{file}',
  75. 'verb' => 'GET',
  76. 'requirements' => ['file' => '.+']
  77. ],
  78. [
  79. 'name' => 'API#updateFileTags',
  80. 'url' => '/api/v1/files/{path}',
  81. 'verb' => 'POST',
  82. 'requirements' => ['path' => '.+'],
  83. ],
  84. [
  85. 'name' => 'API#getRecentFiles',
  86. 'url' => '/api/v1/recent/',
  87. 'verb' => 'GET'
  88. ],
  89. [
  90. 'name' => 'API#updateFileSorting',
  91. 'url' => '/api/v1/sorting',
  92. 'verb' => 'POST'
  93. ],
  94. [
  95. 'name' => 'API#showHiddenFiles',
  96. 'url' => '/api/v1/showhidden',
  97. 'verb' => 'POST'
  98. ],
  99. [
  100. 'name' => 'API#cropImagePreviews',
  101. 'url' => '/api/v1/cropimagepreviews',
  102. 'verb' => 'POST'
  103. ],
  104. [
  105. 'name' => 'API#showGridView',
  106. 'url' => '/api/v1/showgridview',
  107. 'verb' => 'POST'
  108. ],
  109. [
  110. 'name' => 'API#getGridView',
  111. 'url' => '/api/v1/showgridview',
  112. 'verb' => 'GET'
  113. ],
  114. [
  115. 'name' => 'API#toggleShowFolder',
  116. 'url' => '/api/v1/toggleShowFolder/{key}',
  117. 'verb' => 'POST'
  118. ],
  119. [
  120. 'name' => 'API#getNodeType',
  121. 'url' => '/api/v1/quickaccess/get/NodeType',
  122. 'verb' => 'GET',
  123. ],
  124. [
  125. 'name' => 'DirectEditingView#edit',
  126. 'url' => '/directEditing/{token}',
  127. 'verb' => 'GET'
  128. ],
  129. ],
  130. 'ocs' => [
  131. [
  132. 'name' => 'DirectEditing#info',
  133. 'url' => '/api/v1/directEditing',
  134. 'verb' => 'GET'
  135. ],
  136. [
  137. 'name' => 'DirectEditing#templates',
  138. 'url' => '/api/v1/directEditing/templates/{editorId}/{creatorId}',
  139. 'verb' => 'GET'
  140. ],
  141. [
  142. 'name' => 'DirectEditing#open',
  143. 'url' => '/api/v1/directEditing/open',
  144. 'verb' => 'POST'
  145. ],
  146. [
  147. 'name' => 'DirectEditing#create',
  148. 'url' => '/api/v1/directEditing/create',
  149. 'verb' => 'POST'
  150. ],
  151. [
  152. 'name' => 'Template#list',
  153. 'url' => '/api/v1/templates',
  154. 'verb' => 'GET'
  155. ],
  156. [
  157. 'name' => 'Template#create',
  158. 'url' => '/api/v1/templates/create',
  159. 'verb' => 'POST'
  160. ],
  161. [
  162. 'name' => 'Template#path',
  163. 'url' => '/api/v1/templates/path',
  164. 'verb' => 'POST'
  165. ],
  166. [
  167. 'name' => 'TransferOwnership#transfer',
  168. 'url' => '/api/v1/transferownership',
  169. 'verb' => 'POST',
  170. ],
  171. [
  172. 'name' => 'TransferOwnership#accept',
  173. 'url' => '/api/v1/transferownership/{id}',
  174. 'verb' => 'POST',
  175. ],
  176. [
  177. 'name' => 'TransferOwnership#reject',
  178. 'url' => '/api/v1/transferownership/{id}',
  179. 'verb' => 'DELETE',
  180. ],
  181. [
  182. /** @see OpenLocalEditorController::create() */
  183. 'name' => 'OpenLocalEditor#create',
  184. 'url' => '/api/v1/openlocaleditor',
  185. 'verb' => 'POST',
  186. ],
  187. [
  188. /** @see OpenLocalEditorController::validate() */
  189. 'name' => 'OpenLocalEditor#validate',
  190. 'url' => '/api/v1/openlocaleditor/{token}',
  191. 'verb' => 'POST',
  192. ],
  193. ],
  194. ]
  195. );
  196. /** @var $this \OC\Route\Router */
  197. $this->create('files_ajax_download', 'apps/files/ajax/download.php')
  198. ->actionInclude('files/ajax/download.php');
  199. $this->create('files_ajax_list', 'apps/files/ajax/list.php')
  200. ->actionInclude('files/ajax/list.php');