routes.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-only
  6. */
  7. return [
  8. 'resources' => [
  9. 'ExternalShares' => ['url' => '/api/externalShares'],
  10. ],
  11. 'routes' => [
  12. [
  13. 'name' => 'Share#showShare',
  14. 'url' => '/s/{token}',
  15. 'verb' => 'GET',
  16. 'root' => '',
  17. ],
  18. [
  19. 'name' => 'Share#showAuthenticate',
  20. 'url' => '/s/{token}/authenticate/{redirect}',
  21. 'verb' => 'GET',
  22. 'root' => '',
  23. ],
  24. [
  25. 'name' => 'Share#authenticate',
  26. 'url' => '/s/{token}/authenticate/{redirect}',
  27. 'verb' => 'POST',
  28. 'root' => '',
  29. ],
  30. [
  31. 'name' => 'Share#downloadShare',
  32. 'url' => '/s/{token}/download/{filename}',
  33. 'verb' => 'GET',
  34. 'root' => '',
  35. 'defaults' => ['filename' => '']
  36. ],
  37. [
  38. 'name' => 'PublicPreview#directLink',
  39. 'url' => '/s/{token}/preview',
  40. 'verb' => 'GET',
  41. 'root' => '',
  42. ],
  43. [
  44. 'name' => 'externalShares#testRemote',
  45. 'url' => '/testremote',
  46. 'verb' => 'GET'
  47. ],
  48. [
  49. 'name' => 'PublicPreview#getPreview',
  50. 'url' => '/publicpreview/{token}',
  51. 'verb' => 'GET',
  52. ],
  53. [
  54. 'name' => 'ShareInfo#info',
  55. 'url' => '/shareinfo',
  56. 'verb' => 'POST',
  57. ],
  58. [
  59. 'name' => 'Settings#setDefaultAccept',
  60. 'url' => '/settings/defaultAccept',
  61. 'verb' => 'PUT',
  62. ],
  63. [
  64. 'name' => 'Settings#setUserShareFolder',
  65. 'url' => '/settings/shareFolder',
  66. 'verb' => 'PUT',
  67. ],
  68. [
  69. 'name' => 'Settings#resetUserShareFolder',
  70. 'url' => '/settings/shareFolder',
  71. 'verb' => 'DELETE',
  72. ],
  73. [
  74. 'name' => 'Accept#accept',
  75. 'url' => '/accept/{shareId}',
  76. 'verb' => 'GET',
  77. ],
  78. ],
  79. 'ocs' => [
  80. /*
  81. * OCS Share API
  82. */
  83. [
  84. 'name' => 'ShareAPI#getShares',
  85. 'url' => '/api/v1/shares',
  86. 'verb' => 'GET',
  87. ],
  88. [
  89. 'name' => 'ShareAPI#getInheritedShares',
  90. 'url' => '/api/v1/shares/inherited',
  91. 'verb' => 'GET',
  92. ],
  93. [
  94. 'name' => 'ShareAPI#createShare',
  95. 'url' => '/api/v1/shares',
  96. 'verb' => 'POST',
  97. ],
  98. [
  99. 'name' => 'ShareAPI#pendingShares',
  100. 'url' => '/api/v1/shares/pending',
  101. 'verb' => 'GET',
  102. ],
  103. [
  104. 'name' => 'ShareAPI#getShare',
  105. 'url' => '/api/v1/shares/{id}',
  106. 'verb' => 'GET',
  107. ],
  108. [
  109. 'name' => 'ShareAPI#updateShare',
  110. 'url' => '/api/v1/shares/{id}',
  111. 'verb' => 'PUT',
  112. ],
  113. [
  114. 'name' => 'ShareAPI#deleteShare',
  115. 'url' => '/api/v1/shares/{id}',
  116. 'verb' => 'DELETE',
  117. ],
  118. [
  119. 'name' => 'ShareAPI#sendShareEmail',
  120. 'url' => '/api/v1/shares/{id}/send-email',
  121. 'verb' => 'POST',
  122. ],
  123. [
  124. 'name' => 'ShareAPI#acceptShare',
  125. 'url' => '/api/v1/shares/pending/{id}',
  126. 'verb' => 'POST',
  127. ],
  128. /*
  129. * Deleted Shares
  130. */
  131. [
  132. 'name' => 'DeletedShareAPI#index',
  133. 'url' => '/api/v1/deletedshares',
  134. 'verb' => 'GET',
  135. ],
  136. [
  137. 'name' => 'DeletedShareAPI#undelete',
  138. 'url' => '/api/v1/deletedshares/{id}',
  139. 'verb' => 'POST',
  140. ],
  141. /*
  142. * OCS Sharee API
  143. */
  144. [
  145. 'name' => 'ShareesAPI#search',
  146. 'url' => '/api/v1/sharees',
  147. 'verb' => 'GET',
  148. ],
  149. [
  150. 'name' => 'ShareesAPI#findRecommended',
  151. 'url' => '/api/v1/sharees_recommended',
  152. 'verb' => 'GET',
  153. ],
  154. /*
  155. * Remote Shares
  156. */
  157. [
  158. 'name' => 'Remote#getShares',
  159. 'url' => '/api/v1/remote_shares',
  160. 'verb' => 'GET',
  161. ],
  162. [
  163. 'name' => 'Remote#getOpenShares',
  164. 'url' => '/api/v1/remote_shares/pending',
  165. 'verb' => 'GET',
  166. ],
  167. [
  168. 'name' => 'Remote#acceptShare',
  169. 'url' => '/api/v1/remote_shares/pending/{id}',
  170. 'verb' => 'POST',
  171. ],
  172. [
  173. 'name' => 'Remote#declineShare',
  174. 'url' => '/api/v1/remote_shares/pending/{id}',
  175. 'verb' => 'DELETE',
  176. ],
  177. [
  178. 'name' => 'Remote#getShare',
  179. 'url' => '/api/v1/remote_shares/{id}',
  180. 'verb' => 'GET',
  181. ],
  182. [
  183. 'name' => 'Remote#unshare',
  184. 'url' => '/api/v1/remote_shares/{id}',
  185. 'verb' => 'DELETE',
  186. ],
  187. ],
  188. ];