bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/join-handler/presenceManager/queries.ts
João Victor Nunes 5d3178f15d
refactor(guest-wait): turn guest wait page into a React component (#20344)
* refactor(guest-wait): turn guest wait page into a React component

* Fix rendering when the meeting is ended

* refactor(guest-wait): Backend portion for migration of `guest-wait` to Graphql

* Add message timeout

* Remove static guest wait page

---------

Co-authored-by: Gustavo Trott <gustavo@trott.com.br>
2024-06-05 17:41:23 -03:00

100 lines
1.8 KiB
TypeScript

import { gql } from '@apollo/client';
export interface GetUserCurrentResponse {
user_current: Array<{
userId: string;
authToken: string;
joined: boolean;
joinErrorCode: string;
joinErrorMessage: string;
ejectReasonCode: string;
loggedOut: boolean;
guestStatus: string;
guestStatusDetails: {
guestLobbyMessage: string | null;
positionInWaitingQueue: number;
isAllowed: boolean;
} | null;
meeting: {
ended: boolean;
endedReasonCode: string;
endedByUserName: string;
logoutUrl: string;
};
}>;
}
export interface GetUserInfoResponse {
meeting: Array<{
meetingId: string;
name: string;
logoutUrl: string;
bannerColor: string;
bannerText: string;
customLogoUrl: string;
}>;
user_current: Array<{
extId: string;
name: string;
userId: string;
}>;
}
export const getUserInfo = gql`
query getUserInfo {
meeting {
meetingId
name
logoutUrl
bannerColor
bannerText
customLogoUrl
}
user_current {
extId
name
userId
}
}
`;
export const getUserCurrent = gql`
subscription getUserCurrent {
user_current {
userId
authToken
joinErrorCode
joinErrorMessage
joined
ejectReasonCode
loggedOut
guestStatus
meeting {
ended
endedReasonCode
endedByUserName
logoutUrl
}
guestStatusDetails {
guestLobbyMessage
positionInWaitingQueue
isAllowed
}
}
}
`;
export const userJoinMutation = gql`
mutation UserJoin($authToken: String!, $clientType: String!, $clientIsMobile: Boolean!) {
userJoinMeeting(
authToken: $authToken,
clientType: $clientType,
clientIsMobile: $clientIsMobile,
)
}
`;
export default {
getUserCurrent,
userJoinMutation,
getUserInfo,
};