You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

403 lines
11 KiB

  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCA\Talk;
  8. /**
  9. * @psalm-type TalkActorTypes = 'users'|'groups'|'guests'|'emails'|'circles'|'bridged'|'bots'|'federated_users'|'phones'
  10. *
  11. * @psalm-type TalkBan = array{
  12. * id: int,
  13. * moderatorActorType: string,
  14. * moderatorActorId: string,
  15. * moderatorDisplayName: string,
  16. * bannedActorType: string,
  17. * bannedActorId: string,
  18. * bannedDisplayName: string,
  19. * bannedTime: int,
  20. * internalNote: string,
  21. * }
  22. *
  23. * @psalm-type TalkBot = array{
  24. * description: ?string,
  25. * id: int,
  26. * name: string,
  27. * state: int,
  28. * }
  29. *
  30. * @psalm-type TalkBotWithDetails = TalkBot&array{
  31. * error_count: int,
  32. * features: int,
  33. * last_error_date: int,
  34. * last_error_message: string,
  35. * url: string,
  36. * url_hash: string,
  37. * }
  38. *
  39. * @psalm-type TalkCallPeer = array{
  40. * actorId: string,
  41. * actorType: string,
  42. * displayName: string,
  43. * lastPing: int,
  44. * sessionId: string,
  45. * token: string,
  46. * }
  47. *
  48. * @psalm-type TalkChatMentionSuggestion = array{
  49. * id: string,
  50. * label: string,
  51. * source: string,
  52. * mentionId: string,
  53. * details?: string,
  54. * status?: string,
  55. * statusClearAt?: ?int,
  56. * statusIcon?: ?string,
  57. * statusMessage?: ?string,
  58. * }
  59. *
  60. * @psalm-type TalkRichObjectParameter = array{
  61. * type: string,
  62. * id: string,
  63. * name: string,
  64. * server?: string,
  65. * link?: string,
  66. * 'call-type'?: 'one2one'|'group'|'public',
  67. * 'icon-url'?: string,
  68. * 'message-id'?: string,
  69. * boardname?: string,
  70. * stackname?: string,
  71. * size?: string,
  72. * path?: string,
  73. * mimetype?: string,
  74. * 'preview-available'?: 'yes'|'no',
  75. * mtime?: string,
  76. * latitude?: string,
  77. * longitude?: string,
  78. * description?: string,
  79. * thumb?: string,
  80. * website?: string,
  81. * visibility?: '0'|'1',
  82. * assignable?: '0'|'1',
  83. * conversation?: string,
  84. * etag?: string,
  85. * permissions?: string,
  86. * width?: string,
  87. * height?: string,
  88. * blurhash?: string,
  89. * }
  90. *
  91. * @psalm-type TalkBaseMessage = array{
  92. * actorDisplayName: string,
  93. * actorId: string,
  94. * actorType: string,
  95. * expirationTimestamp: int,
  96. * message: string,
  97. * messageParameters: array<string, TalkRichObjectParameter>,
  98. * messageType: string,
  99. * systemMessage: string,
  100. * }
  101. *
  102. * @psalm-type TalkChatMessage = TalkBaseMessage&array{
  103. * deleted?: true,
  104. * id: int,
  105. * isReplyable: bool,
  106. * markdown: bool,
  107. * reactions: array<string, integer>|\stdClass,
  108. * reactionsSelf?: list<string>,
  109. * referenceId: string,
  110. * timestamp: int,
  111. * token: string,
  112. * lastEditActorDisplayName?: string,
  113. * lastEditActorId?: string,
  114. * lastEditActorType?: string,
  115. * lastEditTimestamp?: int,
  116. * silent?: bool,
  117. * }
  118. *
  119. * @psalm-type TalkChatProxyMessage = TalkBaseMessage
  120. *
  121. * @psalm-type TalkRoomLastMessage = TalkChatMessage|TalkChatProxyMessage
  122. *
  123. * @psalm-type TalkDeletedChatMessage = array{
  124. * id: int,
  125. * deleted: true,
  126. * }
  127. *
  128. * @psalm-type TalkChatMessageWithParent = TalkChatMessage&array{parent?: TalkChatMessage|TalkDeletedChatMessage}
  129. *
  130. * @psalm-type TalkChatReminder = array{
  131. * messageId: int,
  132. * timestamp: int,
  133. * token: string,
  134. * userId: string
  135. * }
  136. *
  137. * @psalm-type TalkFederationInvite = array{
  138. * id: int,
  139. * state: int,
  140. * localCloudId: string,
  141. * localToken: string,
  142. * remoteAttendeeId: int,
  143. * remoteServerUrl: string,
  144. * remoteToken: string,
  145. * roomName: string,
  146. * userId: string,
  147. * inviterCloudId: string,
  148. * inviterDisplayName: string,
  149. * }
  150. *
  151. * @psalm-type TalkMatterbridgeConfigFields = list<array<string, mixed>>
  152. *
  153. * @psalm-type TalkMatterbridge = array{
  154. * enabled: bool,
  155. * parts: TalkMatterbridgeConfigFields,
  156. * pid: int,
  157. * }
  158. *
  159. * @psalm-type TalkMatterbridgeProcessState = array{
  160. * log: string,
  161. * running: bool,
  162. * }
  163. *
  164. * @psalm-type TalkMatterbridgeWithProcessState = TalkMatterbridge&TalkMatterbridgeProcessState
  165. *
  166. * @psalm-type TalkParticipant = array{
  167. * actorId: string,
  168. * invitedActorId?: string,
  169. * actorType: string,
  170. * attendeeId: int,
  171. * attendeePermissions: int,
  172. * attendeePin: string,
  173. * displayName: string,
  174. * inCall: int,
  175. * lastPing: int,
  176. * participantType: int,
  177. * permissions: int,
  178. * roomToken: string,
  179. * sessionIds: list<string>,
  180. * status?: string,
  181. * statusClearAt?: ?int,
  182. * statusIcon?: ?string,
  183. * statusMessage?: ?string,
  184. * phoneNumber?: ?string,
  185. * callId?: ?string,
  186. * }
  187. *
  188. * @psalm-type TalkPollVote = array{
  189. * actorDisplayName: string,
  190. * actorId: string,
  191. * actorType: string,
  192. * optionId: int,
  193. * }
  194. *
  195. * @psalm-type TalkPollDraft = array{
  196. * actorDisplayName: string,
  197. * actorId: non-empty-string,
  198. * actorType: TalkActorTypes,
  199. * id: int<1, max>,
  200. * maxVotes: int<0, max>,
  201. * options: list<string>,
  202. * question: non-empty-string,
  203. * resultMode: 0|1,
  204. * status: 0|1|2,
  205. * }
  206. *
  207. * @psalm-type TalkPoll = TalkPollDraft&array{
  208. * details?: list<TalkPollVote>,
  209. * numVoters?: int<0, max>,
  210. * votedSelf?: list<int>,
  211. * votes?: array<string, int>,
  212. * }
  213. *
  214. * @psalm-type TalkReaction = array{
  215. * actorDisplayName: string,
  216. * actorId: string,
  217. * actorType: string,
  218. * timestamp: int,
  219. * }
  220. *
  221. * @psalm-type TalkInvitationList = array{
  222. * users?: list<string>,
  223. * federated_users?: list<string>,
  224. * groups?: list<string>,
  225. * emails?: list<string>,
  226. * phones?: list<string>,
  227. * teams?: list<string>,
  228. * }
  229. *
  230. * @psalm-type TalkRoom = array{
  231. * actorId: string,
  232. * invitedActorId?: string,
  233. * actorType: string,
  234. * attendeeId: int,
  235. * attendeePermissions: int,
  236. * attendeePin: ?string,
  237. * avatarVersion: string,
  238. * breakoutRoomMode: int,
  239. * breakoutRoomStatus: int,
  240. * callFlag: int,
  241. * callPermissions: int,
  242. * callRecording: int,
  243. * callStartTime: int,
  244. * canDeleteConversation: bool,
  245. * canEnableSIP: bool,
  246. * canLeaveConversation: bool,
  247. * canStartCall: bool,
  248. * defaultPermissions: int,
  249. * description: string,
  250. * displayName: string,
  251. * hasCall: bool,
  252. * hasPassword: bool,
  253. * id: int,
  254. * isCustomAvatar: bool,
  255. * isFavorite: bool,
  256. * lastActivity: int,
  257. * lastCommonReadMessage: int,
  258. * lastMessage?: TalkRoomLastMessage,
  259. * lastPing: int,
  260. * lastReadMessage: int,
  261. * listable: int,
  262. * lobbyState: int,
  263. * lobbyTimer: int,
  264. * mentionPermissions: int,
  265. * messageExpiration: int,
  266. * name: string,
  267. * notificationCalls: int,
  268. * notificationLevel: int,
  269. * objectId: string,
  270. * objectType: string,
  271. * participantFlags: int,
  272. * participantType: int,
  273. * permissions: int,
  274. * readOnly: int,
  275. * recordingConsent: int,
  276. * remoteServer?: string,
  277. * remoteToken?: string,
  278. * sessionId: string,
  279. * sipEnabled: int,
  280. * status?: string,
  281. * statusClearAt?: ?int,
  282. * statusIcon?: ?string,
  283. * statusMessage?: ?string,
  284. * token: string,
  285. * type: int,
  286. * unreadMention: bool,
  287. * unreadMentionDirect: bool,
  288. * unreadMessages: int,
  289. * isArchived: bool,
  290. * // Required capability: `important-conversations`
  291. * isImportant: bool,
  292. * }
  293. *
  294. * @psalm-type TalkRoomWithInvalidInvitations = TalkRoom&array{
  295. * invalidParticipants: TalkInvitationList,
  296. * }
  297. *
  298. * @psalm-type TalkSignalingSession = array{
  299. * actorId: string,
  300. * actorType: string,
  301. * inCall: int,
  302. * lastPing: int,
  303. * participantPermissions: int,
  304. * roomId: int,
  305. * sessionId: string,
  306. * userId: string,
  307. * }
  308. *
  309. * @psalm-type TalkSignalingFederationSettings = array{
  310. * server: string,
  311. * nextcloudServer: string,
  312. * helloAuthParams: array{
  313. * token: string,
  314. * },
  315. * roomId: string,
  316. * }
  317. *
  318. * @psalm-type TalkSignalingSettings = array{
  319. * federation: TalkSignalingFederationSettings|null,
  320. * helloAuthParams: array{
  321. * "1.0": array{
  322. * userid: ?string,
  323. * ticket: string,
  324. * },
  325. * "2.0": array{
  326. * token: string,
  327. * },
  328. * },
  329. * hideWarning: bool,
  330. * server: string,
  331. * signalingMode: string,
  332. * sipDialinInfo: string,
  333. * stunservers: list<array{urls: list<string>}>,
  334. * ticket: string,
  335. * turnservers: list<array{urls: list<string>, username: string, credential: mixed}>,
  336. * userId: ?string,
  337. * }
  338. *
  339. * @psalm-type TalkCapabilities = array{
  340. * features: list<string>,
  341. * features-local: list<string>,
  342. * config: array{
  343. * attachments: array{
  344. * allowed: bool,
  345. * folder?: string,
  346. * },
  347. * call: array{
  348. * enabled: bool,
  349. * breakout-rooms: bool,
  350. * recording: bool,
  351. * recording-consent: int,
  352. * supported-reactions: list<string>,
  353. * // List of file names relative to the spreed/img/backgrounds/ web path, e.g. `2_home.jpg`
  354. * predefined-backgrounds: list<string>,
  355. * // List of file paths relative to the server web root with leading slash, e.g. `/apps/spreed/img/backgrounds/2_home.jpg`
  356. * predefined-backgrounds-v2: list<string>,
  357. * can-upload-background: bool,
  358. * sip-enabled: bool,
  359. * sip-dialout-enabled: bool,
  360. * can-enable-sip: bool,
  361. * start-without-media: bool,
  362. * max-duration: int,
  363. * blur-virtual-background: bool,
  364. * end-to-end-encryption: bool,
  365. * },
  366. * chat: array{
  367. * max-length: int,
  368. * read-privacy: int,
  369. * has-translation-providers: bool,
  370. * has-translation-task-providers: bool,
  371. * typing-privacy: int,
  372. * summary-threshold: positive-int,
  373. * },
  374. * conversations: array{
  375. * can-create: bool,
  376. * force-passwords: bool,
  377. * list-style: 'two-lines'|'compact',
  378. * description-length: positive-int,
  379. * },
  380. * federation: array{
  381. * enabled: bool,
  382. * incoming-enabled: bool,
  383. * outgoing-enabled: bool,
  384. * only-trusted-servers: bool,
  385. * },
  386. * previews: array{
  387. * max-gif-size: int,
  388. * },
  389. * signaling: array{
  390. * session-ping-limit: int,
  391. * hello-v2-token-key?: string,
  392. * },
  393. * },
  394. * config-local: array<string, list<string>>,
  395. * version: string,
  396. * }
  397. */
  398. class ResponseDefinitions {
  399. }