routes.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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) <skjnldsv@protonmail.com>
  13. * @author Julius Härtl <jus@bitgrid.net>
  14. * @author Lukas Reschke <lukas@statuscode.ch>
  15. * @author Robin Appelman <robin@icewind.nl>
  16. * @author Roeland Jago Douma <roeland@famdouma.nl>
  17. * @author Tobias Kaminsky <tobias@kaminsky.me>
  18. * @author Vincent Petry <vincent@nextcloud.com>
  19. *
  20. * @license AGPL-3.0
  21. *
  22. * This code is free software: you can redistribute it and/or modify
  23. * it under the terms of the GNU Affero General Public License, version 3,
  24. * as published by the Free Software Foundation.
  25. *
  26. * This program is distributed in the hope that it will be useful,
  27. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  28. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  29. * GNU Affero General Public License for more details.
  30. *
  31. * You should have received a copy of the GNU Affero General Public License, version 3,
  32. * along with this program. If not, see <http://www.gnu.org/licenses/>
  33. *
  34. */
  35. namespace OCA\Files\AppInfo;
  36. /** @var Application $application */
  37. $application = \OC::$server->query(Application::class);
  38. $application->registerRoutes(
  39. $this,
  40. [
  41. 'routes' => [
  42. [
  43. 'name' => 'View#showFile',
  44. 'url' => '/f/{fileid}',
  45. 'verb' => 'GET',
  46. 'root' => '',
  47. ],
  48. [
  49. 'name' => 'API#getThumbnail',
  50. 'url' => '/api/v1/thumbnail/{x}/{y}/{file}',
  51. 'verb' => 'GET',
  52. 'requirements' => ['file' => '.+']
  53. ],
  54. [
  55. 'name' => 'API#updateFileTags',
  56. 'url' => '/api/v1/files/{path}',
  57. 'verb' => 'POST',
  58. 'requirements' => ['path' => '.+'],
  59. ],
  60. [
  61. 'name' => 'API#getRecentFiles',
  62. 'url' => '/api/v1/recent/',
  63. 'verb' => 'GET'
  64. ],
  65. [
  66. 'name' => 'API#updateFileSorting',
  67. 'url' => '/api/v1/sorting',
  68. 'verb' => 'POST'
  69. ],
  70. [
  71. 'name' => 'API#showHiddenFiles',
  72. 'url' => '/api/v1/showhidden',
  73. 'verb' => 'POST'
  74. ],
  75. [
  76. 'name' => 'API#showGridView',
  77. 'url' => '/api/v1/showgridview',
  78. 'verb' => 'POST'
  79. ],
  80. [
  81. 'name' => 'API#getGridView',
  82. 'url' => '/api/v1/showgridview',
  83. 'verb' => 'GET'
  84. ],
  85. [
  86. 'name' => 'view#index',
  87. 'url' => '/',
  88. 'verb' => 'GET',
  89. ],
  90. [
  91. 'name' => 'ajax#getStorageStats',
  92. 'url' => '/ajax/getstoragestats.php',
  93. 'verb' => 'GET',
  94. ],
  95. [
  96. 'name' => 'API#toggleShowFolder',
  97. 'url' => '/api/v1/toggleShowFolder/{key}',
  98. 'verb' => 'POST'
  99. ],
  100. [
  101. 'name' => 'API#getNodeType',
  102. 'url' => '/api/v1/quickaccess/get/NodeType',
  103. 'verb' => 'GET',
  104. ],
  105. [
  106. 'name' => 'DirectEditingView#edit',
  107. 'url' => '/directEditing/{token}',
  108. 'verb' => 'GET'
  109. ],
  110. ],
  111. 'ocs' => [
  112. [
  113. 'name' => 'DirectEditing#info',
  114. 'url' => '/api/v1/directEditing',
  115. 'verb' => 'GET'
  116. ],
  117. [
  118. 'name' => 'DirectEditing#templates',
  119. 'url' => '/api/v1/directEditing/templates/{editorId}/{creatorId}',
  120. 'verb' => 'GET'
  121. ],
  122. [
  123. 'name' => 'DirectEditing#open',
  124. 'url' => '/api/v1/directEditing/open',
  125. 'verb' => 'POST'
  126. ],
  127. [
  128. 'name' => 'DirectEditing#create',
  129. 'url' => '/api/v1/directEditing/create',
  130. 'verb' => 'POST'
  131. ],
  132. [
  133. 'name' => 'TransferOwnership#transfer',
  134. 'url' => '/api/v1/transferownership',
  135. 'verb' => 'POST',
  136. ],
  137. [
  138. 'name' => 'TransferOwnership#accept',
  139. 'url' => '/api/v1/transferownership/{id}',
  140. 'verb' => 'POST',
  141. ],
  142. [
  143. 'name' => 'TransferOwnership#reject',
  144. 'url' => '/api/v1/transferownership/{id}',
  145. 'verb' => 'DELETE',
  146. ],
  147. ],
  148. ]
  149. );
  150. /** @var $this \OC\Route\Router */
  151. $this->create('files_ajax_download', 'apps/files/ajax/download.php')
  152. ->actionInclude('files/ajax/download.php');
  153. $this->create('files_ajax_list', 'apps/files/ajax/list.php')
  154. ->actionInclude('files/ajax/list.php');