Add graphql actions for BreakoutRooms

This commit is contained in:
Gustavo Trott 2023-12-05 16:54:26 -03:00
parent f35deac405
commit dfdd4f2c4d
9 changed files with 291 additions and 1 deletions

View File

@ -0,0 +1,39 @@
import { RedisMessage } from '../types';
import {throwErrorIfNotModerator} from "../imports/validation";
export default function buildRedisMessage(sessionVariables: Record<string, unknown>, input: Record<string, unknown>): RedisMessage {
throwErrorIfNotModerator(sessionVariables);
const eventName = 'CreateBreakoutRoomsCmdMsg';
const routing = {
meetingId: sessionVariables['x-hasura-meetingid'] as String,
userId: sessionVariables['x-hasura-userid'] as String
};
const header = {
name: eventName,
meetingId: routing.meetingId,
userId: routing.userId
};
const body = {
meetingId: routing.meetingId,
record: input.record,
captureNotes: input.captureNotes,
captureSlides: input.captureSlides,
durationInMinutes: input.durationInMinutes,
sendInviteToModerators: input.sendInviteToModerators,
rooms: input.rooms,
};
// TODO check if akka-apps apply this validation
// const BREAKOUT_LIM = Meteor.settings.public.app.breakouts.breakoutRoomLimit;
// const MIN_BREAKOUT_ROOMS = 2;
// const MAX_BREAKOUT_ROOMS = BREAKOUT_LIM > MIN_BREAKOUT_ROOMS ? BREAKOUT_LIM : MIN_BREAKOUT_ROOMS;
// if (rooms.length > MAX_BREAKOUT_ROOMS) {
// Logger.info(`Attempt to create breakout rooms with invalid number of rooms in meeting id=${meetingId}`);
// return;
// }
return { eventName, routing, header, body };
}

View File

@ -0,0 +1,24 @@
import { RedisMessage } from '../types';
import {throwErrorIfNotModerator} from "../imports/validation";
export default function buildRedisMessage(sessionVariables: Record<string, unknown>, input: Record<string, unknown>): RedisMessage {
throwErrorIfNotModerator(sessionVariables);
const eventName = 'EndAllBreakoutRoomsMsg';
const routing = {
meetingId: sessionVariables['x-hasura-meetingid'] as String,
userId: sessionVariables['x-hasura-userid'] as String
};
const header = {
name: eventName,
meetingId: routing.meetingId,
userId: routing.userId
};
const body = {
meetingId: routing.meetingId
};
return { eventName, routing, header, body };
}

View File

@ -0,0 +1,27 @@
import { RedisMessage } from '../types';
import {throwErrorIfNotModerator} from "../imports/validation";
export default function buildRedisMessage(sessionVariables: Record<string, unknown>, input: Record<string, unknown>): RedisMessage {
throwErrorIfNotModerator(sessionVariables);
const eventName = 'ChangeUserBreakoutReqMsg';
const routing = {
meetingId: sessionVariables['x-hasura-meetingid'] as String,
userId: sessionVariables['x-hasura-userid'] as String
};
const header = {
name: eventName,
meetingId: routing.meetingId,
userId: routing.userId
};
const body = {
meetingId: routing.meetingId,
userId: input.userId,
fromBreakoutId: input.fromBreakoutRoomId,
toBreakoutId: input.toBreakoutRoomId,
};
return { eventName, routing, header, body };
}

View File

@ -0,0 +1,24 @@
import { RedisMessage } from '../types';
export default function buildRedisMessage(sessionVariables: Record<string, unknown>, input: Record<string, unknown>): RedisMessage {
const eventName = 'RequestBreakoutJoinURLReqMsg';
const routing = {
meetingId: sessionVariables['x-hasura-meetingid'] as String,
userId: sessionVariables['x-hasura-userid'] as String
};
const header = {
name: eventName,
meetingId: routing.meetingId,
userId: routing.userId
};
const body = {
meetingId: routing.meetingId,
userId: routing.userId,
breakoutId: input.breakoutRoomId,
};
return { eventName, routing, header, body };
}

View File

@ -0,0 +1,25 @@
import { RedisMessage } from '../types';
import {throwErrorIfNotModerator} from "../imports/validation";
export default function buildRedisMessage(sessionVariables: Record<string, unknown>, input: Record<string, unknown>): RedisMessage {
throwErrorIfNotModerator(sessionVariables);
const eventName = 'SendMessageToAllBreakoutRoomsReqMsg';
const routing = {
meetingId: sessionVariables['x-hasura-meetingid'] as String,
userId: sessionVariables['x-hasura-userid'] as String
};
const header = {
name: eventName,
meetingId: routing.meetingId,
userId: routing.userId
};
const body = {
meetingId: routing.meetingId,
msg: input.message,
};
return { eventName, routing, header, body };
}

View File

@ -0,0 +1,25 @@
import { RedisMessage } from '../types';
import {throwErrorIfNotModerator} from "../imports/validation";
export default function buildRedisMessage(sessionVariables: Record<string, unknown>, input: Record<string, unknown>): RedisMessage {
throwErrorIfNotModerator(sessionVariables);
const eventName = 'UpdateBreakoutRoomsTimeReqMsg';
const routing = {
meetingId: sessionVariables['x-hasura-meetingid'] as String,
userId: sessionVariables['x-hasura-userid'] as String
};
const header = {
name: eventName,
meetingId: routing.meetingId,
userId: routing.userId
};
const body = {
meetingId: routing.meetingId,
timeInMinutes: input.timeInMinutes
};
return { eventName, routing, header, body };
}

View File

@ -0,0 +1,24 @@
import { RedisMessage } from '../types';
export default function buildRedisMessage(sessionVariables: Record<string, unknown>, input: Record<string, unknown>): RedisMessage {
const eventName = 'TransferUserToMeetingRequestMsg';
const routing = {
meetingId: sessionVariables['x-hasura-meetingid'] as String,
userId: sessionVariables['x-hasura-userid'] as String
};
const header = {
name: eventName,
meetingId: routing.meetingId,
userId: routing.userId
};
const body = {
userId: routing.userId,
fromMeetingId: input.fromMeetingId,
toMeetingId: input.toMeetingId
};
return { eventName, routing, header, body };
}

View File

@ -6,6 +6,47 @@ type Mutation {
allUsersClearReaction: Boolean
}
type Mutation {
breakoutRoomCreate(
record: Boolean!
captureNotes: Boolean!
captureSlides: Boolean!
durationInMinutes: Int!
sendInviteToModerators: Boolean!
rooms: [BreakoutRoom]!
): Boolean
}
type Mutation {
breakoutRoomEndAll: Boolean
}
type Mutation {
breakoutRoomMoveUser(
userId: String!
fromBreakoutRoomId: String!
toBreakoutRoomId: String!
): Boolean
}
type Mutation {
breakoutRoomRequestJoinUrl(
breakoutRoomId: String!
): Boolean
}
type Mutation {
breakoutRoomSendMessageToAll(
msg: String!
): Boolean
}
type Mutation {
breakoutRoomSetTime(
timeInMinutes: Int!
): Boolean
}
type Mutation {
chatCreateWithUser(
userId: String!
@ -279,3 +320,21 @@ type Mutation {
): Boolean
}
type Mutation {
userTransferVoiceToMeeting(
fromMeetingId: String!
toMeetingId: String!
): Boolean
}
input BreakoutRoom {
captureNotesFilename: String!
captureSlidesFilename: String!
freeJoin: Boolean!
isDefaultName: Boolean!
name: String!
sequence: Int!
shortName: String!
users: [String]!
}

View File

@ -11,6 +11,42 @@ actions:
handler: '{{HASURA_BBB_GRAPHQL_ACTIONS_ADAPTER_URL}}'
permissions:
- role: bbb_client
- name: breakoutRoomCreate
definition:
kind: synchronous
handler: '{{HASURA_BBB_GRAPHQL_ACTIONS_ADAPTER_URL}}'
permissions:
- role: bbb_client
- name: breakoutRoomEndAll
definition:
kind: synchronous
handler: '{{HASURA_BBB_GRAPHQL_ACTIONS_ADAPTER_URL}}'
permissions:
- role: bbb_client
- name: breakoutRoomMoveUser
definition:
kind: synchronous
handler: '{{HASURA_BBB_GRAPHQL_ACTIONS_ADAPTER_URL}}'
permissions:
- role: bbb_client
- name: breakoutRoomRequestJoinUrl
definition:
kind: synchronous
handler: '{{HASURA_BBB_GRAPHQL_ACTIONS_ADAPTER_URL}}'
permissions:
- role: bbb_client
- name: breakoutRoomSendMessageToAll
definition:
kind: synchronous
handler: '{{HASURA_BBB_GRAPHQL_ACTIONS_ADAPTER_URL}}'
permissions:
- role: bbb_client
- name: breakoutRoomSetTime
definition:
kind: synchronous
handler: '{{HASURA_BBB_GRAPHQL_ACTIONS_ADAPTER_URL}}'
permissions:
- role: bbb_client
- name: chatCreateWithUser
definition:
kind: synchronous
@ -270,8 +306,15 @@ actions:
handler: '{{HASURA_BBB_GRAPHQL_ACTIONS_ADAPTER_URL}}'
permissions:
- role: bbb_client
- name: userTransferVoiceToMeeting
definition:
kind: synchronous
handler: '{{HASURA_BBB_GRAPHQL_ACTIONS_ADAPTER_URL}}'
permissions:
- role: bbb_client
custom_types:
enums: []
input_objects: []
input_objects:
- name: BreakoutRoom
objects: []
scalars: []