routes.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  6. * SPDX-License-Identifier: AGPL-3.0-only
  7. */
  8. namespace OCA\Files\AppInfo;
  9. use OCA\Files\Controller\OpenLocalEditorController;
  10. // Legacy routes above
  11. /** @var \OC\Route\Router $this */
  12. $this->create('files_ajax_download', 'apps/files/ajax/download.php')
  13. ->actionInclude('files/ajax/download.php');
  14. /** @var Application $application */
  15. $application = \OC::$server->get(Application::class);
  16. $application->registerRoutes(
  17. $this,
  18. [
  19. 'routes' => [
  20. [
  21. 'name' => 'view#index',
  22. 'url' => '/',
  23. 'verb' => 'GET',
  24. ],
  25. [
  26. 'name' => 'View#showFile',
  27. 'url' => '/f/{fileid}',
  28. 'verb' => 'GET',
  29. 'root' => '',
  30. ],
  31. [
  32. 'name' => 'Api#getThumbnail',
  33. 'url' => '/api/v1/thumbnail/{x}/{y}/{file}',
  34. 'verb' => 'GET',
  35. 'requirements' => ['file' => '.+']
  36. ],
  37. [
  38. 'name' => 'Api#updateFileTags',
  39. 'url' => '/api/v1/files/{path}',
  40. 'verb' => 'POST',
  41. 'requirements' => ['path' => '.+'],
  42. ],
  43. [
  44. 'name' => 'Api#getRecentFiles',
  45. 'url' => '/api/v1/recent/',
  46. 'verb' => 'GET'
  47. ],
  48. [
  49. 'name' => 'Api#getStorageStats',
  50. 'url' => '/api/v1/stats',
  51. 'verb' => 'GET'
  52. ],
  53. [
  54. 'name' => 'Api#setViewConfig',
  55. 'url' => '/api/v1/views/{view}/{key}',
  56. 'verb' => 'PUT'
  57. ],
  58. [
  59. 'name' => 'Api#getViewConfigs',
  60. 'url' => '/api/v1/views',
  61. 'verb' => 'GET'
  62. ],
  63. [
  64. 'name' => 'Api#setConfig',
  65. 'url' => '/api/v1/config/{key}',
  66. 'verb' => 'PUT'
  67. ],
  68. [
  69. 'name' => 'Api#getConfigs',
  70. 'url' => '/api/v1/configs',
  71. 'verb' => 'GET'
  72. ],
  73. [
  74. 'name' => 'Api#showHiddenFiles',
  75. 'url' => '/api/v1/showhidden',
  76. 'verb' => 'POST'
  77. ],
  78. [
  79. 'name' => 'Api#cropImagePreviews',
  80. 'url' => '/api/v1/cropimagepreviews',
  81. 'verb' => 'POST'
  82. ],
  83. [
  84. 'name' => 'Api#showGridView',
  85. 'url' => '/api/v1/showgridview',
  86. 'verb' => 'POST'
  87. ],
  88. [
  89. 'name' => 'Api#getGridView',
  90. 'url' => '/api/v1/showgridview',
  91. 'verb' => 'GET'
  92. ],
  93. [
  94. 'name' => 'DirectEditingView#edit',
  95. 'url' => '/directEditing/{token}',
  96. 'verb' => 'GET'
  97. ],
  98. [
  99. 'name' => 'Api#serviceWorker',
  100. 'url' => '/preview-service-worker.js',
  101. 'verb' => 'GET'
  102. ],
  103. [
  104. 'name' => 'view#indexView',
  105. 'url' => '/{view}',
  106. 'verb' => 'GET',
  107. ],
  108. [
  109. 'name' => 'view#indexViewFileid',
  110. 'url' => '/{view}/{fileid}',
  111. 'verb' => 'GET',
  112. ],
  113. ],
  114. 'ocs' => [
  115. [
  116. 'name' => 'DirectEditing#info',
  117. 'url' => '/api/v1/directEditing',
  118. 'verb' => 'GET'
  119. ],
  120. [
  121. 'name' => 'DirectEditing#templates',
  122. 'url' => '/api/v1/directEditing/templates/{editorId}/{creatorId}',
  123. 'verb' => 'GET'
  124. ],
  125. [
  126. 'name' => 'DirectEditing#open',
  127. 'url' => '/api/v1/directEditing/open',
  128. 'verb' => 'POST'
  129. ],
  130. [
  131. 'name' => 'DirectEditing#create',
  132. 'url' => '/api/v1/directEditing/create',
  133. 'verb' => 'POST'
  134. ],
  135. [
  136. 'name' => 'Template#list',
  137. 'url' => '/api/v1/templates',
  138. 'verb' => 'GET'
  139. ],
  140. [
  141. 'name' => 'Template#create',
  142. 'url' => '/api/v1/templates/create',
  143. 'verb' => 'POST'
  144. ],
  145. [
  146. 'name' => 'Template#path',
  147. 'url' => '/api/v1/templates/path',
  148. 'verb' => 'POST'
  149. ],
  150. [
  151. 'name' => 'TransferOwnership#transfer',
  152. 'url' => '/api/v1/transferownership',
  153. 'verb' => 'POST',
  154. ],
  155. [
  156. 'name' => 'TransferOwnership#accept',
  157. 'url' => '/api/v1/transferownership/{id}',
  158. 'verb' => 'POST',
  159. ],
  160. [
  161. 'name' => 'TransferOwnership#reject',
  162. 'url' => '/api/v1/transferownership/{id}',
  163. 'verb' => 'DELETE',
  164. ],
  165. [
  166. /** @see OpenLocalEditorController::create() */
  167. 'name' => 'OpenLocalEditor#create',
  168. 'url' => '/api/v1/openlocaleditor',
  169. 'verb' => 'POST',
  170. ],
  171. [
  172. /** @see OpenLocalEditorController::validate() */
  173. 'name' => 'OpenLocalEditor#validate',
  174. 'url' => '/api/v1/openlocaleditor/{token}',
  175. 'verb' => 'POST',
  176. ],
  177. ],
  178. ]
  179. );