@councilbox/shutter-js
Version:
Shutter API - javascript SDK
68 lines (58 loc) • 925 B
JavaScript
const { getOperationName } = require('./utils');
const ADD_EVENT = `
mutation addEvent($event: EventInfo!) {
addEvent(event: $event) {
id
type
roomNumber
attendeeID
date
ip
platform {
osName
osVersion
browserName
browserVersion
userAgent
}
audioSource
videoSource
audioDevices {
deviceId
label
kind
groupId
}
videoDevices {
deviceId
label
kind
groupId
}
peerID
displayName
error
reason
content
old
}
}
`;
module.exports = class Events {
constructor(shutterFetch) {
this.
}
async create(event) {
const variables = {
event
};
const response = await this.
query: ADD_EVENT,
variables,
operationName: getOperationName(ADD_EVENT)
});
if (response.errors) throw response.errors;
return response.data.addEvent;
}
};