1
0

routes.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Björn Schießle <bjoern@schiessle.org>
  6. * @author Christoph Wurst <christoph@winzerhof-wurst.at>
  7. * @author Joas Schilling <coding@schilljs.com>
  8. * @author John Molakvoæ <skjnldsv@protonmail.com>
  9. * @author Lukas Reschke <lukas@statuscode.ch>
  10. * @author Maxence Lange <maxence@artificial-owl.com>
  11. * @author Roeland Jago Douma <roeland@famdouma.nl>
  12. * @author Hinrich Mahler <nextcloud@mahlerhome.de>
  13. *
  14. * @license AGPL-3.0
  15. *
  16. * This code is free software: you can redistribute it and/or modify
  17. * it under the terms of the GNU Affero General Public License, version 3,
  18. * as published by the Free Software Foundation.
  19. *
  20. * This program is distributed in the hope that it will be useful,
  21. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  22. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  23. * GNU Affero General Public License for more details.
  24. *
  25. * You should have received a copy of the GNU Affero General Public License, version 3,
  26. * along with this program. If not, see <http://www.gnu.org/licenses/>
  27. *
  28. */
  29. return [
  30. 'resources' => [
  31. 'ExternalShares' => ['url' => '/api/externalShares'],
  32. ],
  33. 'routes' => [
  34. [
  35. 'name' => 'Share#showShare',
  36. 'url' => '/s/{token}',
  37. 'verb' => 'GET',
  38. 'root' => '',
  39. ],
  40. [
  41. 'name' => 'Share#showAuthenticate',
  42. 'url' => '/s/{token}/authenticate/{redirect}',
  43. 'verb' => 'GET',
  44. 'root' => '',
  45. ],
  46. [
  47. 'name' => 'Share#authenticate',
  48. 'url' => '/s/{token}/authenticate/{redirect}',
  49. 'verb' => 'POST',
  50. 'root' => '',
  51. ],
  52. [
  53. 'name' => 'Share#downloadShare',
  54. 'url' => '/s/{token}/download/{filename}',
  55. 'verb' => 'GET',
  56. 'root' => '',
  57. 'defaults' => ['filename' => '']
  58. ],
  59. [
  60. 'name' => 'PublicPreview#directLink',
  61. 'url' => '/s/{token}/preview',
  62. 'verb' => 'GET',
  63. 'root' => '',
  64. ],
  65. [
  66. 'name' => 'externalShares#testRemote',
  67. 'url' => '/testremote',
  68. 'verb' => 'GET'
  69. ],
  70. [
  71. 'name' => 'PublicPreview#getPreview',
  72. 'url' => '/publicpreview/{token}',
  73. 'verb' => 'GET',
  74. ],
  75. [
  76. 'name' => 'ShareInfo#info',
  77. 'url' => '/shareinfo',
  78. 'verb' => 'POST',
  79. ],
  80. [
  81. 'name' => 'Settings#setDefaultAccept',
  82. 'url' => '/settings/defaultAccept',
  83. 'verb' => 'PUT',
  84. ],
  85. [
  86. 'name' => 'Settings#setUserShareFolder',
  87. 'url' => '/settings/shareFolder',
  88. 'verb' => 'PUT',
  89. ],
  90. [
  91. 'name' => 'Settings#resetUserShareFolder',
  92. 'url' => '/settings/shareFolder',
  93. 'verb' => 'DELETE',
  94. ],
  95. [
  96. 'name' => 'Accept#accept',
  97. 'url' => '/accept/{shareId}',
  98. 'verb' => 'GET',
  99. ],
  100. ],
  101. 'ocs' => [
  102. /*
  103. * OCS Share API
  104. */
  105. [
  106. 'name' => 'ShareAPI#getShares',
  107. 'url' => '/api/v1/shares',
  108. 'verb' => 'GET',
  109. ],
  110. [
  111. 'name' => 'ShareAPI#getInheritedShares',
  112. 'url' => '/api/v1/shares/inherited',
  113. 'verb' => 'GET',
  114. ],
  115. [
  116. 'name' => 'ShareAPI#createShare',
  117. 'url' => '/api/v1/shares',
  118. 'verb' => 'POST',
  119. ],
  120. [
  121. 'name' => 'ShareAPI#pendingShares',
  122. 'url' => '/api/v1/shares/pending',
  123. 'verb' => 'GET',
  124. ],
  125. [
  126. 'name' => 'ShareAPI#getShare',
  127. 'url' => '/api/v1/shares/{id}',
  128. 'verb' => 'GET',
  129. ],
  130. [
  131. 'name' => 'ShareAPI#updateShare',
  132. 'url' => '/api/v1/shares/{id}',
  133. 'verb' => 'PUT',
  134. ],
  135. [
  136. 'name' => 'ShareAPI#deleteShare',
  137. 'url' => '/api/v1/shares/{id}',
  138. 'verb' => 'DELETE',
  139. ],
  140. [
  141. 'name' => 'ShareAPI#acceptShare',
  142. 'url' => '/api/v1/shares/pending/{id}',
  143. 'verb' => 'POST',
  144. ],
  145. /*
  146. * Deleted Shares
  147. */
  148. [
  149. 'name' => 'DeletedShareAPI#index',
  150. 'url' => '/api/v1/deletedshares',
  151. 'verb' => 'GET',
  152. ],
  153. [
  154. 'name' => 'DeletedShareAPI#undelete',
  155. 'url' => '/api/v1/deletedshares/{id}',
  156. 'verb' => 'POST',
  157. ],
  158. /*
  159. * OCS Sharee API
  160. */
  161. [
  162. 'name' => 'ShareesAPI#search',
  163. 'url' => '/api/v1/sharees',
  164. 'verb' => 'GET',
  165. ],
  166. [
  167. 'name' => 'ShareesAPI#findRecommended',
  168. 'url' => '/api/v1/sharees_recommended',
  169. 'verb' => 'GET',
  170. ],
  171. /*
  172. * Remote Shares
  173. */
  174. [
  175. 'name' => 'Remote#getShares',
  176. 'url' => '/api/v1/remote_shares',
  177. 'verb' => 'GET',
  178. ],
  179. [
  180. 'name' => 'Remote#getOpenShares',
  181. 'url' => '/api/v1/remote_shares/pending',
  182. 'verb' => 'GET',
  183. ],
  184. [
  185. 'name' => 'Remote#acceptShare',
  186. 'url' => '/api/v1/remote_shares/pending/{id}',
  187. 'verb' => 'POST',
  188. ],
  189. [
  190. 'name' => 'Remote#declineShare',
  191. 'url' => '/api/v1/remote_shares/pending/{id}',
  192. 'verb' => 'DELETE',
  193. ],
  194. [
  195. 'name' => 'Remote#getShare',
  196. 'url' => '/api/v1/remote_shares/{id}',
  197. 'verb' => 'GET',
  198. ],
  199. [
  200. 'name' => 'Remote#unshare',
  201. 'url' => '/api/v1/remote_shares/{id}',
  202. 'verb' => 'DELETE',
  203. ],
  204. ],
  205. ];