1
0

routes.php 4.9 KB

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