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.

504 lines
19 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 TalkChatReminderUpcoming = array{
  138. * actorDisplayName: string,
  139. * actorId: string,
  140. * actorType: string,
  141. * message: string,
  142. * messageId: int,
  143. * messageParameters: array<string, TalkRichObjectParameter>,
  144. * reminderTimestamp: int,
  145. * roomToken: string,
  146. * }
  147. *
  148. * @psalm-type TalkFederationInvite = array{
  149. * id: int,
  150. * state: int,
  151. * localCloudId: string,
  152. * localToken: string,
  153. * remoteAttendeeId: int,
  154. * remoteServerUrl: string,
  155. * remoteToken: string,
  156. * roomName: string,
  157. * userId: string,
  158. * inviterCloudId: string,
  159. * inviterDisplayName: string,
  160. * }
  161. *
  162. * @psalm-type TalkMatterbridgeConfigFields = list<array<string, mixed>>
  163. *
  164. * @psalm-type TalkMatterbridge = array{
  165. * enabled: bool,
  166. * parts: TalkMatterbridgeConfigFields,
  167. * pid: int,
  168. * }
  169. *
  170. * @psalm-type TalkMatterbridgeProcessState = array{
  171. * log: string,
  172. * running: bool,
  173. * }
  174. *
  175. * @psalm-type TalkMatterbridgeWithProcessState = TalkMatterbridge&TalkMatterbridgeProcessState
  176. *
  177. * @psalm-type TalkParticipant = array{
  178. * actorId: string,
  179. * invitedActorId?: string,
  180. * actorType: string,
  181. * attendeeId: int,
  182. * attendeePermissions: int,
  183. * attendeePin: string,
  184. * displayName: string,
  185. * inCall: int,
  186. * lastPing: int,
  187. * participantType: int,
  188. * permissions: int,
  189. * roomToken: string,
  190. * sessionIds: list<string>,
  191. * status?: string,
  192. * statusClearAt?: ?int,
  193. * statusIcon?: ?string,
  194. * statusMessage?: ?string,
  195. * phoneNumber?: ?string,
  196. * callId?: ?string,
  197. * }
  198. *
  199. * @psalm-type TalkPollVote = array{
  200. * actorDisplayName: string,
  201. * actorId: string,
  202. * actorType: string,
  203. * optionId: int,
  204. * }
  205. *
  206. * @psalm-type TalkPollDraft = array{
  207. * actorDisplayName: string,
  208. * actorId: non-empty-string,
  209. * actorType: TalkActorTypes,
  210. * id: int<1, max>,
  211. * maxVotes: int<0, max>,
  212. * options: list<string>,
  213. * question: non-empty-string,
  214. * resultMode: 0|1,
  215. * status: 0|1|2,
  216. * }
  217. *
  218. * @psalm-type TalkPoll = TalkPollDraft&array{
  219. * details?: list<TalkPollVote>,
  220. * numVoters?: int<0, max>,
  221. * votedSelf?: list<int>,
  222. * votes?: array<string, int>,
  223. * }
  224. *
  225. * @psalm-type TalkReaction = array{
  226. * actorDisplayName: string,
  227. * actorId: string,
  228. * actorType: string,
  229. * timestamp: int,
  230. * }
  231. *
  232. * @psalm-type TalkInvitationList = array{
  233. * users?: list<string>,
  234. * federated_users?: list<string>,
  235. * groups?: list<string>,
  236. * emails?: list<string>,
  237. * phones?: list<string>,
  238. * teams?: list<string>,
  239. * }
  240. *
  241. * @psalm-type TalkRoom = array{
  242. * // The unique identifier for the given actor type
  243. * actorId: string,
  244. * // The cloud id of the invited user
  245. * invitedActorId?: string,
  246. * // Actor type of the current user (see [constants list](https://nextcloud-talk.readthedocs.io/en/latest/constants#attendee-types))
  247. * actorType: string,
  248. * // Unique attendee id
  249. * attendeeId: int,
  250. * // Dedicated permissions for the current participant, if not `Custom` this are not the resulting permissions (see [constants list](https://nextcloud-talk.readthedocs.io/en/latest/constants#attendee-permissions))
  251. * attendeePermissions: int,
  252. * // Unique dial-in authentication code for this user, when the conversation has SIP enabled (see `sipEnabled` attribute)
  253. * attendeePin: ?string,
  254. * // Version of conversation avatar used to easier expiration of the avatar in case a moderator updates it, since the avatar endpoint should be cached for 24 hours. (only available with `avatar` capability)
  255. * avatarVersion: string,
  256. * // Breakout room configuration mode (see [constants list](https://nextcloud-talk.readthedocs.io/en/latest/constants#breakout-room-modes)) (only available with `breakout-rooms-v1` capability)
  257. * breakoutRoomMode: int,
  258. * // Breakout room status (see [constants list](https://nextcloud-talk.readthedocs.io/en/latest/constants#breakout-room-status)) (only available with `breakout-rooms-v1` capability)
  259. * breakoutRoomStatus: int,
  260. * // Combined flag of all participants in the current call (see [constants list](https://nextcloud-talk.readthedocs.io/en/latest/constants#participant-in-call-flag), only available with `conversation-call-flags` capability)
  261. * callFlag: int,
  262. * // Call permissions, if not `Custom` this are not the resulting permissions, if set they will reset after the end of the call (see [constants list](https://nextcloud-talk.readthedocs.io/en/latest/constants#attendee-permissions))
  263. * callPermissions: int,
  264. * callRecording: int,
  265. * callStartTime: int,
  266. * // Flag if the user can delete the conversation for everyone (not possible without moderator permissions or in one-to-one conversations)
  267. * canDeleteConversation: bool,
  268. * // Whether the given user can enable SIP for this conversation. Note that when the token is not-numeric only, SIP can not be enabled even if the user is permitted and a moderator of the conversation
  269. * canEnableSIP: bool,
  270. * // Flag if the user can leave the conversation (not possible for the last user with moderator permissions)
  271. * canLeaveConversation: bool,
  272. * // Flag if the user can start a new call in this conversation (joining is always possible) (only available with `start-call-flag` capability)
  273. * canStartCall: bool,
  274. * // Default permissions for new participants (see [constants list](https://nextcloud-talk.readthedocs.io/en/latest/constants#attendee-permissions))
  275. * defaultPermissions: int,
  276. * // Description of the conversation (can also be empty) (only available with `room-description` capability)
  277. * description: string,
  278. * // `name` if non-empty, otherwise it falls back to a list of participants
  279. * displayName: string,
  280. * // Flag if the conversation has an active call
  281. * hasCall: bool,
  282. * // Flag if the conversation has a password
  283. * hasPassword: bool,
  284. * // Numeric identifier of the conversation
  285. * id: int,
  286. * // Flag if the conversation has a custom avatar (only available with `avatar` capability)
  287. * isCustomAvatar: bool,
  288. * // Flag if the conversation is favorited by the user
  289. * isFavorite: bool,
  290. * // Timestamp of the last activity in the conversation, in seconds and UTC time zone
  291. * lastActivity: int,
  292. * // ID of the last message read by every user that has read privacy set to public in a room. When the user themself has it set to private the value is `0` (only available with `chat-read-status` capability)
  293. * lastCommonReadMessage: int,
  294. * // Last message in a conversation if available, otherwise empty. **Note:** Even when given the message will not contain the `parent` or `reactionsSelf` attribute due to performance reasons
  295. * lastMessage?: TalkRoomLastMessage,
  296. * // Timestamp of the user's session making the request
  297. * lastPing: int,
  298. * // ID of the last read message in a room (only available with `chat-read-marker` capability)
  299. * lastReadMessage: int,
  300. * // Listable scope for the room (only available with `listable-rooms` capability)
  301. * listable: int,
  302. * // Webinar lobby restriction (0-1), if the participant is a moderator they can always join the conversation (only available with `webinary-lobby` capability) (See [Webinar lobby states](https://nextcloud-talk.readthedocs.io/en/latest/constants#webinar-lobby-states))
  303. * lobbyState: int,
  304. * // Timestamp when the lobby will be automatically disabled (only available with `webinary-lobby` capability)
  305. * lobbyTimer: int,
  306. * mentionPermissions: int,
  307. * messageExpiration: int,
  308. * // Name of the conversation (can also be empty)
  309. * name: string,
  310. * notificationCalls: int,
  311. * // The notification level for the user (See [Participant notification levels](https://nextcloud-talk.readthedocs.io/en/latest/constants#participant-notification-levels))
  312. * notificationLevel: int,
  313. * // See [Object types](https://nextcloud-talk.readthedocs.io/en/latest/constants#object-types) documentation for explanation
  314. * objectId: string,
  315. * // The type of object that the conversation is associated with (See [Object types](https://nextcloud-talk.readthedocs.io/en/latest/constants#object-types))
  316. * objectType: string,
  317. * // "In call" flags of the user's session making the request (only available with `in-call-flags` capability)
  318. * participantFlags: int,
  319. * // Permissions level of the current user
  320. * participantType: int,
  321. * // Combined final permissions for the current participant, permissions are picked in order of attendee then call then default and the first which is `Custom` will apply (see [constants list](https://nextcloud-talk.readthedocs.io/en/latest/constants#attendee-permissions))
  322. * permissions: int,
  323. * // Read-only state for the current user (only available with `read-only-rooms` capability)
  324. * readOnly: int,
  325. * // Whether recording consent is required before joining a call (Only 0 and 1 will be returned, see [constants list](https://nextcloud-talk.readthedocs.io/en/latest/constants#recording-consent-required)) (only available with `recording-consent` capability)
  326. * recordingConsent: int,
  327. * remoteServer?: string,
  328. * remoteToken?: string,
  329. * // `'0'` if not connected, otherwise an up to 512 character long string that is the identifier of the user's session making the request. Should only be used to pre-check if the user joined already with this session, but this might be outdated by the time of usage, so better check via [Get list of participants in a conversation](https://nextcloud-talk.readthedocs.io/en/latest/participant/#get-list-of-participants-in-a-conversation)
  330. * sessionId: string,
  331. * // SIP enable status (see [constants list](https://nextcloud-talk.readthedocs.io/en/latest/constants#sip-states))
  332. * sipEnabled: int,
  333. * // Optional: Only available for one-to-one conversations, when `includeStatus=true` is set and the user has a status
  334. * status?: string,
  335. * // Optional: Only available for one-to-one conversations, when `includeStatus=true` is set and the user has a status, can still be null even with a status
  336. * statusClearAt?: ?int,
  337. * // Optional: Only available for one-to-one conversations, when `includeStatus=true` is set and the user has a status, can still be null even with a status
  338. * statusIcon?: ?string,
  339. * // Optional: Only available for one-to-one conversations, when `includeStatus=true` is set and the user has a status, can still be null even with a status
  340. * statusMessage?: ?string,
  341. * // Token identifier of the conversation which is used for further interaction
  342. * token: string,
  343. * // See list of conversation types in the [constants list](https://nextcloud-talk.readthedocs.io/en/latest/constants/#conversation-types)
  344. * type: int,
  345. * // Flag if the user was mentioned since their last visit
  346. * unreadMention: bool,
  347. * // Flag if the user was mentioned directly (ignoring `@all` mentions) since their last visit (only available with `direct-mention-flag` capability)
  348. * unreadMentionDirect: bool,
  349. * // Number of unread chat messages in the conversation (only available with `chat-v2` capability)
  350. * unreadMessages: int,
  351. * // Flag if the conversation is archived by the user (only available with `archived-conversations-v2` capability)
  352. * isArchived: bool,
  353. * // Required capability: `important-conversations`
  354. * isImportant: bool,
  355. * }
  356. *
  357. * @psalm-type TalkDashboardEventAttachment = array{
  358. * calendars: list<string>,
  359. * fmttype: string,
  360. * filename: string,
  361. * fileId: int,
  362. * hasPreview: boolean,
  363. * previewUrl: ?string,
  364. * }
  365. *
  366. * @psalm-type TalkDashboardEventCalendar = array{
  367. * principalUri: string,
  368. * calendarName: string,
  369. * calendarColor: ?string,
  370. * }
  371. *
  372. * @psalm-type TalkDashboardEvent = array{
  373. * calendars: list<TalkDashboardEventCalendar>,
  374. * eventName: string,
  375. * eventDescription: ?string,
  376. * eventAttachments: list<TalkDashboardEventAttachment>,
  377. * eventLink: string,
  378. * start: int,
  379. * end: int,
  380. * roomToken: string,
  381. * roomAvatarVersion: string,
  382. * roomName: string,
  383. * roomDisplayName: string,
  384. * roomType: int,
  385. * roomActiveSince: ?int,
  386. * invited: ?int,
  387. * accepted: ?int,
  388. * tentative: ?int,
  389. * declined: ?int,
  390. * }
  391. *
  392. * @psalm-type TalkRoomWithInvalidInvitations = TalkRoom&array{
  393. * invalidParticipants: TalkInvitationList,
  394. * }
  395. *
  396. * @psalm-type TalkSignalingSession = array{
  397. * actorId: string,
  398. * actorType: string,
  399. * inCall: int,
  400. * lastPing: int,
  401. * participantPermissions: int,
  402. * roomId: int,
  403. * sessionId: string,
  404. * userId: string,
  405. * }
  406. *
  407. * @psalm-type TalkSignalingFederationSettings = array{
  408. * server: string,
  409. * nextcloudServer: string,
  410. * helloAuthParams: array{
  411. * token: string,
  412. * },
  413. * roomId: string,
  414. * }
  415. *
  416. * @psalm-type TalkSignalingSettings = array{
  417. * federation: TalkSignalingFederationSettings|null,
  418. * helloAuthParams: array{
  419. * "1.0": array{
  420. * userid: ?string,
  421. * ticket: string,
  422. * },
  423. * "2.0": array{
  424. * token: string,
  425. * },
  426. * },
  427. * hideWarning: bool,
  428. * server: string,
  429. * signalingMode: string,
  430. * sipDialinInfo: string,
  431. * stunservers: list<array{urls: list<string>}>,
  432. * ticket: string,
  433. * turnservers: list<array{urls: list<string>, username: string, credential: mixed}>,
  434. * userId: ?string,
  435. * }
  436. *
  437. * @psalm-type TalkCapabilities = array{
  438. * features: list<string>,
  439. * features-local: list<string>,
  440. * config: array{
  441. * attachments: array{
  442. * allowed: bool,
  443. * folder?: string,
  444. * },
  445. * call: array{
  446. * enabled: bool,
  447. * breakout-rooms: bool,
  448. * recording: bool,
  449. * recording-consent: int,
  450. * supported-reactions: list<string>,
  451. * // List of file names relative to the spreed/img/backgrounds/ web path, e.g. `2_home.jpg`
  452. * predefined-backgrounds: list<string>,
  453. * // List of file paths relative to the server web root with leading slash, e.g. `/apps/spreed/img/backgrounds/2_home.jpg`
  454. * predefined-backgrounds-v2: list<string>,
  455. * can-upload-background: bool,
  456. * sip-enabled: bool,
  457. * sip-dialout-enabled: bool,
  458. * can-enable-sip: bool,
  459. * start-without-media: bool,
  460. * max-duration: int,
  461. * blur-virtual-background: bool,
  462. * end-to-end-encryption: bool,
  463. * },
  464. * chat: array{
  465. * max-length: int,
  466. * read-privacy: int,
  467. * has-translation-providers: bool,
  468. * has-translation-task-providers: bool,
  469. * typing-privacy: int,
  470. * summary-threshold: positive-int,
  471. * },
  472. * conversations: array{
  473. * can-create: bool,
  474. * force-passwords: bool,
  475. * list-style: 'two-lines'|'compact',
  476. * description-length: positive-int,
  477. * retention-event: non-negative-int,
  478. * retention-phone: non-negative-int,
  479. * retention-instant-meetings: non-negative-int,
  480. * },
  481. * federation: array{
  482. * enabled: bool,
  483. * incoming-enabled: bool,
  484. * outgoing-enabled: bool,
  485. * only-trusted-servers: bool,
  486. * },
  487. * previews: array{
  488. * max-gif-size: int,
  489. * },
  490. * signaling: array{
  491. * session-ping-limit: int,
  492. * hello-v2-token-key?: string,
  493. * },
  494. * },
  495. * config-local: array<string, list<string>>,
  496. * version: string,
  497. * }
  498. */
  499. class ResponseDefinitions {
  500. }