routes.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  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#setViewConfig',
  60. 'url' => '/api/v1/views',
  61. 'verb' => 'PUT'
  62. ],
  63. [
  64. 'name' => 'Api#getViewConfigs',
  65. 'url' => '/api/v1/views',
  66. 'verb' => 'GET'
  67. ],
  68. [
  69. 'name' => 'Api#setConfig',
  70. 'url' => '/api/v1/config/{key}',
  71. 'verb' => 'PUT'
  72. ],
  73. [
  74. 'name' => 'Api#getConfigs',
  75. 'url' => '/api/v1/configs',
  76. 'verb' => 'GET'
  77. ],
  78. [
  79. 'name' => 'Api#showHiddenFiles',
  80. 'url' => '/api/v1/showhidden',
  81. 'verb' => 'POST'
  82. ],
  83. [
  84. 'name' => 'Api#cropImagePreviews',
  85. 'url' => '/api/v1/cropimagepreviews',
  86. 'verb' => 'POST'
  87. ],
  88. [
  89. 'name' => 'Api#showGridView',
  90. 'url' => '/api/v1/showgridview',
  91. 'verb' => 'POST'
  92. ],
  93. [
  94. 'name' => 'Api#getGridView',
  95. 'url' => '/api/v1/showgridview',
  96. 'verb' => 'GET'
  97. ],
  98. [
  99. 'name' => 'DirectEditingView#edit',
  100. 'url' => '/directEditing/{token}',
  101. 'verb' => 'GET'
  102. ],
  103. [
  104. 'name' => 'Api#serviceWorker',
  105. 'url' => '/preview-service-worker.js',
  106. 'verb' => 'GET'
  107. ],
  108. [
  109. 'name' => 'view#indexView',
  110. 'url' => '/{view}',
  111. 'verb' => 'GET',
  112. ],
  113. [
  114. 'name' => 'view#indexViewFileid',
  115. 'url' => '/{view}/{fileid}',
  116. 'verb' => 'GET',
  117. ],
  118. ],
  119. 'ocs' => [
  120. [
  121. 'name' => 'DirectEditing#info',
  122. 'url' => '/api/v1/directEditing',
  123. 'verb' => 'GET'
  124. ],
  125. [
  126. 'name' => 'DirectEditing#templates',
  127. 'url' => '/api/v1/directEditing/templates/{editorId}/{creatorId}',
  128. 'verb' => 'GET'
  129. ],
  130. [
  131. 'name' => 'DirectEditing#open',
  132. 'url' => '/api/v1/directEditing/open',
  133. 'verb' => 'POST'
  134. ],
  135. [
  136. 'name' => 'DirectEditing#create',
  137. 'url' => '/api/v1/directEditing/create',
  138. 'verb' => 'POST'
  139. ],
  140. [
  141. 'name' => 'Template#list',
  142. 'url' => '/api/v1/templates',
  143. 'verb' => 'GET'
  144. ],
  145. [
  146. 'name' => 'Template#create',
  147. 'url' => '/api/v1/templates/create',
  148. 'verb' => 'POST'
  149. ],
  150. [
  151. 'name' => 'Template#path',
  152. 'url' => '/api/v1/templates/path',
  153. 'verb' => 'POST'
  154. ],
  155. [
  156. 'name' => 'TransferOwnership#transfer',
  157. 'url' => '/api/v1/transferownership',
  158. 'verb' => 'POST',
  159. ],
  160. [
  161. 'name' => 'TransferOwnership#accept',
  162. 'url' => '/api/v1/transferownership/{id}',
  163. 'verb' => 'POST',
  164. ],
  165. [
  166. 'name' => 'TransferOwnership#reject',
  167. 'url' => '/api/v1/transferownership/{id}',
  168. 'verb' => 'DELETE',
  169. ],
  170. [
  171. /** @see OpenLocalEditorController::create() */
  172. 'name' => 'OpenLocalEditor#create',
  173. 'url' => '/api/v1/openlocaleditor',
  174. 'verb' => 'POST',
  175. ],
  176. [
  177. /** @see OpenLocalEditorController::validate() */
  178. 'name' => 'OpenLocalEditor#validate',
  179. 'url' => '/api/v1/openlocaleditor/{token}',
  180. 'verb' => 'POST',
  181. ],
  182. ],
  183. ]
  184. );