ResponseDefinitions.php 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2023 Kate Döen <kate.doeen@nextcloud.com>
  5. *
  6. * @author Kate Döen <kate.doeen@nextcloud.com>
  7. *
  8. * @license GNU AGPL version 3 or any later version
  9. *
  10. * This program is free software: you can redistribute it and/or modify
  11. * it under the terms of the GNU Affero General Public License as
  12. * published by the Free Software Foundation, either version 3 of the
  13. * License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU Affero General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Affero General Public License
  21. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  22. *
  23. */
  24. namespace OCA\Files_Sharing;
  25. /**
  26. * @psalm-type FilesSharingShare = array{
  27. * attributes: ?string,
  28. * can_delete: bool,
  29. * can_edit: bool,
  30. * displayname_file_owner: string,
  31. * displayname_owner: string,
  32. * expiration: ?string,
  33. * file_parent: int,
  34. * file_source: int,
  35. * file_target: string,
  36. * has_preview: bool,
  37. * hide_download: 0|1,
  38. * id: string,
  39. * item_mtime: int,
  40. * item_permissions?: int,
  41. * item_size: float|int,
  42. * item_source: int,
  43. * item_type: 'file'|'folder',
  44. * label: string,
  45. * mail_send: 0|1,
  46. * mimetype: string,
  47. * note: string,
  48. * parent: null,
  49. * password?: string,
  50. * password_expiration_time?: ?string,
  51. * path: ?string,
  52. * permissions: int,
  53. * send_password_by_talk?: bool,
  54. * share_type: int,
  55. * share_with?: string,
  56. * share_with_avatar?: string,
  57. * share_with_displayname?: string,
  58. * share_with_displayname_unique?: ?string,
  59. * share_with_link?: string,
  60. * status?: array{clearAt?: int|null, icon?: ?string, message?: ?string, status?: string},
  61. * stime: int,
  62. * storage: int,
  63. * storage_id: string,
  64. * token: ?string,
  65. * uid_file_owner: string,
  66. * uid_owner: string,
  67. * url?: string,
  68. * }
  69. *
  70. * @psalm-type FilesSharingDeletedShare = array{
  71. * id: string,
  72. * share_type: int,
  73. * uid_owner: string,
  74. * displayname_owner: string,
  75. * permissions: int,
  76. * stime: int,
  77. * uid_file_owner: string,
  78. * displayname_file_owner: string,
  79. * path: string,
  80. * item_type: string,
  81. * mimetype: string,
  82. * storage: int,
  83. * item_source: int,
  84. * file_source: int,
  85. * file_parent: int,
  86. * file_target: int,
  87. * expiration: string|null,
  88. * share_with: string|null,
  89. * share_with_displayname: string|null,
  90. * share_with_link: string|null,
  91. * }
  92. *
  93. * @psalm-type FilesSharingRemoteShare = array{
  94. * accepted: bool,
  95. * file_id: int|null,
  96. * id: int,
  97. * mimetype: string|null,
  98. * mountpoint: string,
  99. * mtime: int|null,
  100. * name: string,
  101. * owner: string,
  102. * parent: int|null,
  103. * permissions: int|null,
  104. * remote: string,
  105. * remote_id: string,
  106. * share_token: string,
  107. * share_type: int,
  108. * type: string|null,
  109. * user: string,
  110. * }
  111. *
  112. * @psalm-type FilesSharingSharee = array{
  113. * count: int|null,
  114. * label: string,
  115. * }
  116. *
  117. * @psalm-type FilesSharingShareeValue = array{
  118. * shareType: int,
  119. * shareWith: string,
  120. * }
  121. *
  122. * @psalm-type FilesSharingShareeUser = FilesSharingSharee&array{
  123. * subline: string,
  124. * icon: string,
  125. * shareWithDisplayNameUnique: string,
  126. * status: array{
  127. * status: string,
  128. * message: string,
  129. * icon: string,
  130. * clearAt: int|null,
  131. * },
  132. * value: FilesSharingShareeValue,
  133. * }
  134. *
  135. * @psalm-type FilesSharingShareeRemoteGroup = FilesSharingSharee&array{
  136. * guid: string,
  137. * name: string,
  138. * value: FilesSharingShareeValue&array{
  139. * server: string,
  140. * }
  141. * }
  142. *
  143. * @psalm-type FilesSharingLookup = array{
  144. * value: string,
  145. * verified: int,
  146. * }
  147. *
  148. * @psalm-type FilesSharingShareeLookup = FilesSharingSharee&array{
  149. * extra: array{
  150. * federationId: string,
  151. * name: FilesSharingLookup|null,
  152. * email: FilesSharingLookup|null,
  153. * address: FilesSharingLookup|null,
  154. * website: FilesSharingLookup|null,
  155. * twitter: FilesSharingLookup|null,
  156. * phone: FilesSharingLookup|null,
  157. * twitter_signature: FilesSharingLookup|null,
  158. * website_signature: FilesSharingLookup|null,
  159. * userid: FilesSharingLookup|null,
  160. * },
  161. * value: FilesSharingShareeValue&array{
  162. * globalScale: bool,
  163. * }
  164. * }
  165. *
  166. * @psalm-type FilesSharingShareeEmail = FilesSharingSharee&array{
  167. * uuid: string,
  168. * name: string,
  169. * type: string,
  170. * shareWithDisplayNameUnique: string,
  171. * value: FilesSharingShareeValue,
  172. * }
  173. *
  174. * @psalm-type FilesSharingShareeRemote = FilesSharingSharee&array{
  175. * uuid: string,
  176. * name: string,
  177. * type: string,
  178. * value: FilesSharingShareeValue&array{
  179. * server: string,
  180. * }
  181. * }
  182. *
  183. * @psalm-type FilesSharingShareeCircle = FilesSharingSharee&array{
  184. * shareWithDescription: string,
  185. * value: FilesSharingShareeValue&array{
  186. * circle: string,
  187. * }
  188. * }
  189. *
  190. * @psalm-type FilesSharingShareesSearchResult = array{
  191. * exact: array{
  192. * circles: FilesSharingShareeCircle[],
  193. * emails: FilesSharingShareeEmail[],
  194. * groups: FilesSharingSharee[],
  195. * remote_groups: FilesSharingShareeRemoteGroup[],
  196. * remotes: FilesSharingShareeRemote[],
  197. * rooms: FilesSharingSharee[],
  198. * users: FilesSharingShareeUser[],
  199. * },
  200. * circles: FilesSharingShareeCircle[],
  201. * emails: FilesSharingShareeEmail[],
  202. * groups: FilesSharingSharee[],
  203. * lookup: FilesSharingShareeLookup[],
  204. * remote_groups: FilesSharingShareeRemoteGroup[],
  205. * remotes: FilesSharingShareeRemote[],
  206. * rooms: FilesSharingSharee[],
  207. * users: FilesSharingShareeUser[],
  208. * lookupEnabled: bool,
  209. * }
  210. *
  211. * @psalm-type FilesSharingShareesRecommendedResult = array{
  212. * exact: array{
  213. * emails: FilesSharingShareeEmail[],
  214. * groups: FilesSharingSharee[],
  215. * remote_groups: FilesSharingShareeRemoteGroup[],
  216. * remotes: FilesSharingShareeRemote[],
  217. * users: FilesSharingShareeUser[],
  218. * },
  219. * emails: FilesSharingShareeEmail[],
  220. * groups: FilesSharingSharee[],
  221. * remote_groups: FilesSharingShareeRemoteGroup[],
  222. * remotes: FilesSharingShareeRemote[],
  223. * users: FilesSharingShareeUser[],
  224. * }
  225. *
  226. * @psalm-type FilesSharingShareInfo = array{
  227. * id: int,
  228. * parentId: int,
  229. * mtime: int,
  230. * name: string,
  231. * permissions: int,
  232. * mimetype: string,
  233. * size: int|float,
  234. * type: string,
  235. * etag: string,
  236. * children?: array<string, mixed>[],
  237. * }
  238. */
  239. class ResponseDefinitions {
  240. }