routes.php 4.2 KB

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