bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/join-handler/presenceManager/queries.ts
2024-03-07 10:28:34 -03:00

81 lines
1.3 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;
meeting: {
ended: boolean;
endedReasonCode: string;
endedByUserName: string;
};
}>;
}
export interface GetUserInfoResponse {
meeting: Array<{
meetingId: string;
name: string;
logoutUrl: string;
bannerColor: string;
bannerText: string;
}>;
user_current: Array<{
extId: string;
name: string;
userId: string;
}>;
}
export const getUserInfo = gql`
query getUserInfo {
meeting {
meetingId
name
logoutUrl
bannerColor
bannerText
}
user_current {
extId
name
userId
}
}
`;
export const getUserCurrent = gql`
subscription getUserCurrent {
user_current {
userId
authToken
joinErrorCode
joinErrorMessage
joined
ejectReasonCode
meeting {
ended
endedReasonCode
endedByUserName
}
}
}
`;
export const userJoinMutation = gql`
mutation UserJoin($authToken: String!, $clientType: String!) {
userJoinMeeting(
authToken: $authToken,
clientType: $clientType,
)
}
`;
export default {
getUserCurrent,
userJoinMutation,
getUserInfo,
};