-
-
this.clearTempStates()} />
-
- )}
-
- )
- }
-}
-
-export default New
diff --git a/client/src/Components/HostedEvents/index.js b/client/src/Components/HostedEvents/index.js
index 248d0d929..0a1305b0f 100644
--- a/client/src/Components/HostedEvents/index.js
+++ b/client/src/Components/HostedEvents/index.js
@@ -1,81 +1,38 @@
-import React from 'react'
-import { Query } from 'react-apollo'
+import React from 'react';
+import { Query } from 'react-apollo';
-import {
- Button,
- Dialog,
- DialogContent,
- DialogContentText,
- DialogTitle
-} from '@material-ui/core'
+import BannerTopBar from '../BannerTopBar';
-import { withStyles } from '@material-ui/core/styles'
-import styles from './styles'
+import { hostedEventsCalls } from '../../GraphQL/Calls/index';
-import { hostedEventsCalls } from '../../GraphQL/Calls/index'
+import Event from './Event';
-import New from './New'
-import Event from './Event'
+const HostedEvent = () => (
+
+
+
+ {({ loading, error, data }) => {
+ if (loading) return 'Loading...';
+ if (error) return `Error! ${error.message}`;
+ const list = data.events_EventsByHost.map((event, index) => (
+
+ ));
+ return (
+
+ { list }
+
+ );
+ }}
+
+
+);
-class HostedEvent extends React.Component {
- constructor (props) {
- super(props)
- this.state = {
- isNewEventOpen: false
- }
- }
- handleNewEvent = (event) => {
- this.props.history.push(`/edit/${event.designator}`)
- };
-
- render () {
- const { classes } = this.props
- return (
-
-
-
-
- {({ loading, error, data }) => {
- if (loading) return 'Loading...'
- if (error) return `Error! ${error.message}`
- const list = data.events_EventsByHost.map((event, index) => {
- return (
-
- )
- })
- return (
-
- { list }
-
- )
- }}
-
-
-
-
- )
- }
-}
-
-export default withStyles(styles)(HostedEvent)
+export default HostedEvent;
diff --git a/client/src/Components/HostedEvents/styles.js b/client/src/Components/HostedEvents/styles.js
index e867e8174..866f1e2fc 100644
--- a/client/src/Components/HostedEvents/styles.js
+++ b/client/src/Components/HostedEvents/styles.js
@@ -5,22 +5,15 @@ const styles = theme => ({
marginTop: 20,
marginBottom: 20,
marginLeft: 400,
- marginRight: 400
+ marginRight: 400,
},
buttonList: {
margin: theme.spacing.unit,
- float: 'right'
+ float: 'right',
},
buttonGrid: {
- marginTop: -20
+ marginTop: -20,
},
- addButton: {
- display: 'block',
- padding: 20,
- marginTop: 20,
- marginRight: 20,
- marginLeft: 'auto'
- }
-})
+});
-export default styles
+export default styles;
diff --git a/client/src/Components/Search/Event.js b/client/src/Components/Search/Event.js
index 8a3579416..1736098ee 100644
--- a/client/src/Components/Search/Event.js
+++ b/client/src/Components/Search/Event.js
@@ -1,27 +1,27 @@
-import React from 'react'
-import { Link } from 'react-router-dom'
+import React from 'react';
+import { Link } from 'react-router-dom';
import {
Grid, Paper,
Typography,
- Button
-} from '@material-ui/core'
-import { withStyles } from '@material-ui/core/styles'
-import styles from './styles'
+ Button,
+} from '@material-ui/core';
+import { withStyles } from '@material-ui/core/styles';
+import styles from './styles';
-import { toLocalTime } from '../../utils'
+import { toLocalTime } from '../../utils';
class Event extends React.Component {
- render () {
- const classes = this.props.classes
+ render() {
+ const { classes } = this.props;
const {
+ id,
name,
- designator,
startDatetime,
finishDatetime,
host,
- description
- } = this.props.event
+ description,
+ } = this.props.event;
return (
@@ -31,7 +31,9 @@ class Event extends React.Component {
To : {toLocalTime(finishDatetime)}
- Hosted by: {host.alias} ({host.lastName} {host.firstName})
+
+ Hosted by: {host.alias} ({host.lastName} {host.firstName})
+
Formula:
First prize:
@@ -48,7 +50,7 @@ class Event extends React.Component {
color='primary'
size='small'
component={Link}
- to={'/show/' + designator}
+ to={`/events/show/${id}`}
>
Show
@@ -57,8 +59,8 @@ class Event extends React.Component {
- )
+ );
}
}
-export default withStyles(styles)(Event)
+export default withStyles(styles)(Event);
diff --git a/client/src/Components/Search/Tabs/Future.js b/client/src/Components/Search/Tabs/Future.js
index 2a46f4995..d5dbfc089 100644
--- a/client/src/Components/Search/Tabs/Future.js
+++ b/client/src/Components/Search/Tabs/Future.js
@@ -1,21 +1,19 @@
-import React from 'react'
-import { Typography } from '@material-ui/core'
+import React from 'react';
+import { Typography } from '@material-ui/core';
-import { withStyles } from '@material-ui/core/styles'
-import styles from '../styles'
+import { withStyles } from '@material-ui/core/styles';
+import styles from '../styles';
-import Event from '../Event'
+import Event from '../Event';
class Future extends React.Component {
- render () {
- const classes = this.props.classes
- const { FutureEvents } = this.props
+ render() {
+ const { classes } = this.props;
+ const { FutureEvents } = this.props;
- const futureEvents = FutureEvents.map((event, index) => {
- return (
-
- )
- })
+ const futureEvents = FutureEvents.map((event, index) => (
+
+ ));
return (
{futureEvents}
- )
+ );
}
}
-export default withStyles(styles)(Future)
+export default withStyles(styles)(Future);
diff --git a/client/src/Components/Search/Tabs/History.js b/client/src/Components/Search/Tabs/History.js
index 0db046e5c..21d848289 100644
--- a/client/src/Components/Search/Tabs/History.js
+++ b/client/src/Components/Search/Tabs/History.js
@@ -1,12 +1,12 @@
-import React from 'react'
-import { Typography } from '@material-ui/core'
+import React from 'react';
+import { Typography } from '@material-ui/core';
-import { withStyles } from '@material-ui/core/styles'
-import styles from '../styles'
+import { withStyles } from '@material-ui/core/styles';
+import styles from '../styles';
class History extends React.Component {
- render () {
- const classes = this.props.classes
+ render() {
+ const { classes } = this.props;
return (
Your old events (maybe here, maybe not, who knows)
- )
+ );
}
}
-export default withStyles(styles)(History)
+export default withStyles(styles)(History);
diff --git a/client/src/Components/Search/Tabs/Incoming.js b/client/src/Components/Search/Tabs/Incoming.js
index 3956aa6d7..ab6b070dc 100644
--- a/client/src/Components/Search/Tabs/Incoming.js
+++ b/client/src/Components/Search/Tabs/Incoming.js
@@ -1,26 +1,22 @@
-import React from 'react'
-import { Typography } from '@material-ui/core'
+import React from 'react';
+import { Typography } from '@material-ui/core';
-import { withStyles } from '@material-ui/core/styles'
-import styles from '../styles'
+import { withStyles } from '@material-ui/core/styles';
+import styles from '../styles';
-import Event from '../Event'
+import Event from '../Event';
class Incoming extends React.Component {
- render () {
- const classes = this.props.classes
- const { IncomingEvents, OngoingEvents } = this.props
+ render() {
+ const { classes } = this.props;
+ const { IncomingEvents, OngoingEvents } = this.props;
- const incomingEvents = IncomingEvents.map((event, index) => {
- return (
-
- )
- })
- const ongoingEvents = OngoingEvents.map((event, index) => {
- return (
-
- )
- })
+ const incomingEvents = IncomingEvents.map((event, index) => (
+
+ ));
+ const ongoingEvents = OngoingEvents.map((event, index) => (
+
+ ));
return (
{incomingEvents}
- )
+ );
}
}
-export default withStyles(styles)(Incoming)
+export default withStyles(styles)(Incoming);
diff --git a/client/src/Components/Search/Tabs/Past.js b/client/src/Components/Search/Tabs/Past.js
index 60a6bc5aa..b01cb0684 100644
--- a/client/src/Components/Search/Tabs/Past.js
+++ b/client/src/Components/Search/Tabs/Past.js
@@ -1,21 +1,19 @@
-import React from 'react'
-import { Typography } from '@material-ui/core'
+import React from 'react';
+import { Typography } from '@material-ui/core';
-import { withStyles } from '@material-ui/core/styles'
-import styles from '../styles'
+import { withStyles } from '@material-ui/core/styles';
+import styles from '../styles';
-import Event from '../Event'
+import Event from '../Event';
class Past extends React.Component {
- render () {
- const classes = this.props.classes
- const { PastEvents } = this.props
+ render() {
+ const { classes } = this.props;
+ const { PastEvents } = this.props;
- const pastEvents = PastEvents.map((event, index) => {
- return (
-
- )
- })
+ const pastEvents = PastEvents.map((event, index) => (
+
+ ));
return (
{pastEvents}
- )
+ );
}
}
-export default withStyles(styles)(Past)
+export default withStyles(styles)(Past);
diff --git a/client/src/Components/Search/Tabs/index.js b/client/src/Components/Search/Tabs/index.js
index a4077c1ac..d15abeb9c 100644
--- a/client/src/Components/Search/Tabs/index.js
+++ b/client/src/Components/Search/Tabs/index.js
@@ -1,11 +1,11 @@
-import Future from './Future'
-import History from './History'
-import Incoming from './Incoming'
-import Past from './Past'
+import Future from './Future';
+import History from './History';
+import Incoming from './Incoming';
+import Past from './Past';
export {
Future,
History,
Incoming,
- Past
-}
+ Past,
+};
diff --git a/client/src/Components/Search/index.js b/client/src/Components/Search/index.js
index 0d50b2f86..4c07b3071 100644
--- a/client/src/Components/Search/index.js
+++ b/client/src/Components/Search/index.js
@@ -1,114 +1,128 @@
-import React from 'react'
-import { Query } from 'react-apollo'
-import { DateTime } from 'luxon'
+import React from 'react';
+import { Query } from 'react-apollo';
+import { DateTime } from 'luxon';
import {
Typography,
AppBar,
Tabs,
- Tab
-} from '@material-ui/core'
+ Tab,
+} from '@material-ui/core';
import {
GetApp as IncomingIcon,
AlarmAdd as FutureIcon,
- History as HistoryIcon
-} from '@material-ui/icons'
+ History as HistoryIcon,
+} from '@material-ui/icons';
-import { withStyles } from '@material-ui/core/styles'
-import styles from './styles'
+import { withStyles } from '@material-ui/core/styles';
+import styles from './styles';
-import { listEventsCalls } from '../../GraphQL/Calls/index'
+import BannerTopBar from '../BannerTopBar';
+
+import { listEventsCalls } from '../../GraphQL/Calls/index';
import {
Future,
History,
Incoming,
- Past
-} from './Tabs'
+ Past,
+} from './Tabs';
-function TabContainer (props) {
+function TabContainer(props) {
return (
{props.children}
- )
+ );
}
class Search extends React.Component {
- constructor (props) {
- super(props)
+ constructor(props) {
+ super(props);
this.state = {
- value: 0
- }
+ value: 0,
+ };
}
handleChange = (event, value) => {
- this.setState({ value })
+ this.setState({ value });
}
- render () {
- const classes = this.props.classes
- const { value } = this.state
+ render() {
+ const { classes } = this.props;
+ const { value } = this.state;
return (
-
- {({ loading, error, data }) => {
- if (loading) return 'Loading...'
- if (error) return `Error! ${error.message}`
- const now = ~~(DateTime.local().valueOf() / 1000)
- const inTwoWeeks = ~~(DateTime.local().plus({ weeks: 2 }).valueOf() / 1000)
+
+
+
+ {({ loading, error, data }) => {
+ if (loading) return 'Loading...';
+ if (error) return `Error! ${error.message}`;
+ const now = Math.floor(DateTime.local().valueOf() / 1000);
+ const inTwoWeeks = Math.floor(DateTime.local().plus({ weeks: 2 }).valueOf() / 1000);
- const IncomingEvents = data.events_Events.filter(event => event.startDatetime > now && event.startDatetime < inTwoWeeks)
- const OngoingEvents = data.events_Events.filter(event => event.finishDatetime > now && event.startDatetime < now)
- const FutureEvents = data.events_Events.filter(event => event.startDatetime > now)
- const PastEvents = data.events_Events.filter(event => event.finishDatetime < now)
+ const IncomingEvents = data.events_Events.filter(event => event.startDatetime > now
+ && event.startDatetime < inTwoWeeks);
+ const OngoingEvents = data.events_Events.filter(event => event.finishDatetime > now
+ && event.startDatetime < now);
+ const FutureEvents = data.events_Events.filter(event => event.startDatetime > now);
+ const PastEvents = data.events_Events.filter(event => event.finishDatetime < now);
- return (
-
-
-
-
- }
- />
- }
- />
- }
- />
- }
- />
-
-
- {value === 0 &&
}
- {value === 1 &&
}
- {value === 2 &&
}
- {value === 3 &&
}
-
-
- )
- }}
-
- )
+ return (
+
+
+
+
+ }
+ />
+ }
+ />
+ }
+ />
+ }
+ />
+
+
+ {value === 0 &&
+
+ }
+ {value === 1 &&
}
+ {value === 2 &&
}
+ {value === 3 &&
}
+
+
+ );
+ }}
+
+
+ );
}
}
-export default withStyles(styles)(Search)
+export default withStyles(styles)(Search);
diff --git a/client/src/Components/Search/styles.js b/client/src/Components/Search/styles.js
index 9981d904a..139e732cb 100644
--- a/client/src/Components/Search/styles.js
+++ b/client/src/Components/Search/styles.js
@@ -4,11 +4,11 @@ const styles = theme => ({
width: '100%',
backgroundColor: theme.palette.background.paper,
padding: 0,
- margin: 0
+ margin: 0,
},
tabTitle: {
width: '25%',
- maxWidth: 'none'
+ maxWidth: 'none',
},
card: {
flexGrow: 1,
@@ -16,18 +16,18 @@ const styles = theme => ({
marginTop: 20,
marginBottom: 20,
marginLeft: 400,
- marginRight: 400
+ marginRight: 400,
},
buttonList: {
margin: theme.spacing.unit,
- float: 'right'
+ float: 'right',
},
buttonGrid: {
- marginTop: -20
+ marginTop: -20,
},
title: {
- marginTop: 20
- }
-})
+ marginTop: 20,
+ },
+});
-export default styles
+export default styles;
diff --git a/client/src/Components/TopBar/data.js b/client/src/Components/TopBar/data.js
deleted file mode 100644
index 8726e606d..000000000
--- a/client/src/Components/TopBar/data.js
+++ /dev/null
@@ -1,11 +0,0 @@
-import GamesIcon from '@material-ui/icons/Games'
-import SearchIcon from '@material-ui/icons/Search'
-import LibraryAddIcon from '@material-ui/icons/LibraryAdd'
-
-const data = [
- { title: 'Look for an event', to: '/', icon: SearchIcon, text: '' },
- { title: 'Events you are enrolled in', to: '/my', icon: GamesIcon, text: '' },
- { title: 'Host your own competition', to: '/host', icon: LibraryAddIcon, text: '' }
-]
-
-export default data
diff --git a/client/src/Components/TopBar/index.js b/client/src/Components/TopBar/index.js
deleted file mode 100644
index 06fe761f6..000000000
--- a/client/src/Components/TopBar/index.js
+++ /dev/null
@@ -1,42 +0,0 @@
-import React from 'react'
-import { Link } from 'react-router-dom'
-import classNames from 'classnames'
-
-import { AppBar, Toolbar, Typography, Button } from '@material-ui/core'
-import { withStyles } from '@material-ui/core/styles'
-
-import datas from './data'
-import styles from './styles'
-
-const TopBar = ({ classes, user, match }) => {
- const buttons = datas.map((data, index) => {
- const Icon = data.icon
- return (
-
)
- }
- )
- return (
-
-
-
-
- Manage competition
-
- {buttons}
-
-
-
- )
-}
-
-export default withStyles(styles)(TopBar)
diff --git a/client/src/Components/TopBar/styles.js b/client/src/Components/TopBar/styles.js
deleted file mode 100644
index 25cf9ab3b..000000000
--- a/client/src/Components/TopBar/styles.js
+++ /dev/null
@@ -1,37 +0,0 @@
-const styles = theme => ({
- root: {
- flexGrow: 1
- },
- flex: {
- flexGrow: 1,
- marginLeft: 30
- },
- menuButton: {
- marginLeft: -12,
- marginRight: 20
- },
- cssRoot: {
- color: '#FFFFFF',
- backgroundColor: theme.palette.secondary,
- '&:hover': {
- backgroundColor: theme.palette.dark
- },
- whiteSpace: 'nowrap',
- paddingRight: 2 * theme.spacing.unit,
- paddingLeft: 2 * theme.spacing.unit
- },
- button: {
- margin: theme.spacing.unit
- },
- leftIcon: {
- marginRight: theme.spacing.unit
- },
- rightIcon: {
- marginLeft: theme.spacing.unit
- },
- iconSmall: {
- fontSize: 20
- }
-})
-
-export default styles
diff --git a/client/src/GraphQL/Calls/getOptions.js b/client/src/GraphQL/Calls/getOptions.js
new file mode 100644
index 000000000..979ab6d2b
--- /dev/null
+++ b/client/src/GraphQL/Calls/getOptions.js
@@ -0,0 +1,45 @@
+import gql from 'graphql-tag';
+import { formulaInfo, plotterInfo } from '../Fragments';
+
+const EVENTS_FORMULAS = gql`
+ query Events_Formulas{
+ events_Formulas {
+ ...FormulaInfo
+ }
+ }
+ ${formulaInfo}
+`;
+
+const EVENTS_PLOTTERS = gql`
+ query Events_Plotters{
+ events_Plotters {
+ ...PlotterInfo
+ }
+ }
+ ${plotterInfo}
+`;
+
+const EVENTS_CREATEFORMULA = gql`
+ mutation Events_CreateFormula($formula: events_FormulaInput!) {
+ events_CreateFormula(formula: $formula) {
+ ...FormulaInfo
+ }
+ }
+ ${formulaInfo}
+`;
+
+const EVENTS_CREATEPLOTTER = gql`
+ mutation Events_CreatePlotter($plotter: events_PlotterInput!) {
+ events_CreatePlotter(plotter: $plotter) {
+ ...PlotterInfo
+ }
+ }
+ ${plotterInfo}
+`;
+
+export default {
+ EVENTS_PLOTTERS,
+ EVENTS_FORMULAS,
+ EVENTS_CREATEFORMULA,
+ EVENTS_CREATEPLOTTER,
+};
diff --git a/client/src/GraphQL/Calls/hostedEvents.js b/client/src/GraphQL/Calls/hostedEvents.js
index 05b3f77f2..563a9db2b 100644
--- a/client/src/GraphQL/Calls/hostedEvents.js
+++ b/client/src/GraphQL/Calls/hostedEvents.js
@@ -1,23 +1,23 @@
-import gql from 'graphql-tag'
-import { eventMinimalInfo } from '../Fragments'
+import gql from 'graphql-tag';
+import { eventMinimalInfo } from '../Fragments';
-const EVENTS_HOSTEVENT = gql`
- mutation Hosts_HostEvent($name: String!, $description: String!, $startDatetime: Int!, $finishDatetime: Int!) {
- events_HostEvent(name: $name, description: $description, startDatetime: $startDatetime, finishDatetime: $finishDatetime) {
+const EVENTS_CREATEEVENT = gql`
+ mutation Events_CreateEvent($event: events_EventInput!) {
+ events_CreateEvent(event: $event) {
...EventMinimalInfo
}
}
${eventMinimalInfo}
-`
+`;
const EVENTS_EVENTSBYHOST = gql`
- query Hosts_EventsByHost{
+ query Events_EventsByHost{
events_EventsByHost {
...EventMinimalInfo
}
}
${eventMinimalInfo}
-`
+`;
export default {
- EVENTS_HOSTEVENT,
- EVENTS_EVENTSBYHOST
-}
+ EVENTS_CREATEEVENT,
+ EVENTS_EVENTSBYHOST,
+};
diff --git a/client/src/GraphQL/Calls/index.js b/client/src/GraphQL/Calls/index.js
index d3fe57c6d..b8225b64b 100644
--- a/client/src/GraphQL/Calls/index.js
+++ b/client/src/GraphQL/Calls/index.js
@@ -1,9 +1,11 @@
-import hostedEventsCalls from './hostedEvents'
-import listEventsCalls from './listEvents'
-import showEventCalls from './showEvent'
+import hostedEventsCalls from './hostedEvents';
+import listEventsCalls from './listEvents';
+import showEventCalls from './showEvent';
+import getOptionsCalls from './getOptions';
export {
hostedEventsCalls,
listEventsCalls,
- showEventCalls
-}
+ showEventCalls,
+ getOptionsCalls,
+};
diff --git a/client/src/GraphQL/Calls/listEvents.js b/client/src/GraphQL/Calls/listEvents.js
index c115eb746..6941002fc 100644
--- a/client/src/GraphQL/Calls/listEvents.js
+++ b/client/src/GraphQL/Calls/listEvents.js
@@ -1,14 +1,14 @@
-import gql from 'graphql-tag'
-import { eventMinimalInfo } from '../Fragments'
+import gql from 'graphql-tag';
+import { eventMinimalInfo } from '../Fragments';
const EVENTS_EVENTS = gql`
- query Hosts_Events{
+ query Events_Events{
events_Events {
...EventMinimalInfo
}
}
${eventMinimalInfo}
-`
+`;
export default {
- EVENTS_EVENTS
-}
+ EVENTS_EVENTS,
+};
diff --git a/client/src/GraphQL/Calls/showEvent.js b/client/src/GraphQL/Calls/showEvent.js
index b26b0e0dc..855c9b510 100644
--- a/client/src/GraphQL/Calls/showEvent.js
+++ b/client/src/GraphQL/Calls/showEvent.js
@@ -1,15 +1,15 @@
-import gql from 'graphql-tag'
-import { eventFullInfo } from '../Fragments'
+import gql from 'graphql-tag';
+import { eventFullInfo } from '../Fragments';
const EVENTS_EVENT = gql`
- query Hosts_Event($designator: ID!) {
- events_Event(designator: $designator) {
+ query Events_Event($eventId: ID!) {
+ events_Event(eventId: $eventId) {
...EventFullInfo
}
}
${eventFullInfo}
-`
+`;
export default {
- EVENTS_EVENT
-}
+ EVENTS_EVENT,
+};
diff --git a/client/src/GraphQL/Fragments/event.js b/client/src/GraphQL/Fragments/event.js
index 9fd7a4610..96be79f08 100644
--- a/client/src/GraphQL/Fragments/event.js
+++ b/client/src/GraphQL/Fragments/event.js
@@ -1,9 +1,10 @@
-import gql from 'graphql-tag'
+import gql from 'graphql-tag';
export const eventMinimalInfo = gql`
fragment EventMinimalInfo on events_Event {
+ id
+ state
name
- designator
startDatetime
finishDatetime
host {
@@ -13,11 +14,12 @@ export const eventMinimalInfo = gql`
}
description
}
-`
+`;
export const eventFullInfo = gql`
fragment EventFullInfo on events_Event {
- designator
+ id
+ state
name
host{
alias
@@ -58,4 +60,4 @@ export const eventFullInfo = gql`
}
}
}
-`
+`;
diff --git a/client/src/GraphQL/Fragments/index.js b/client/src/GraphQL/Fragments/index.js
index 93d8f9971..a28f9ce7c 100644
--- a/client/src/GraphQL/Fragments/index.js
+++ b/client/src/GraphQL/Fragments/index.js
@@ -1,9 +1,15 @@
import {
eventMinimalInfo,
- eventFullInfo
-} from './event'
+ eventFullInfo,
+} from './event';
+import {
+ formulaInfo,
+ plotterInfo,
+} from './options';
export {
eventMinimalInfo,
- eventFullInfo
-}
+ eventFullInfo,
+ formulaInfo,
+ plotterInfo,
+};
diff --git a/client/src/GraphQL/Fragments/options.js b/client/src/GraphQL/Fragments/options.js
new file mode 100644
index 000000000..c25a82d08
--- /dev/null
+++ b/client/src/GraphQL/Fragments/options.js
@@ -0,0 +1,22 @@
+import gql from 'graphql-tag';
+
+export const plotterInfo = gql`
+ fragment PlotterInfo on events_Plotter {
+ id
+ ownerId
+ isTemplate
+ name
+ host
+ repo
+ moduleName
+ }
+`;
+
+export const formulaInfo = gql`
+ fragment FormulaInfo on events_Formula {
+ id
+ ownerId
+ isTemplate
+ name
+ }
+`;
diff --git a/client/src/index.js b/client/src/index.js
index 6989c8551..cdcd36eb2 100644
--- a/client/src/index.js
+++ b/client/src/index.js
@@ -1,58 +1,26 @@
-import React, { Component } from 'react'
-import { Route, BrowserRouter, Switch } from 'react-router-dom'
+import React from 'react';
+import { Route, Switch } from 'react-router-dom';
-import { MuiPickersUtilsProvider } from 'material-ui-pickers'
-import LuxonUtils from 'material-ui-pickers/utils/luxon-utils'
+import { MuiPickersUtilsProvider } from 'material-ui-pickers';
+import LuxonUtils from 'material-ui-pickers/utils/luxon-utils';
-import { getItem } from './utils/local-storage'
+import Search from './Components/Search';
+import Events from './Components/Events';
+import HostedEvents from './Components/HostedEvents';
+import EditEvent from './Components/Event/Edit';
+import CreateEvent from './Components/Event/Create';
-import TopBar from './Components/TopBar'
-import Search from './Components/Search'
-import Events from './Components/Events'
-import HostedEvents from './Components/HostedEvents'
-import EditEvent from './Components/Event/Edit'
+const App = () => (
+
+
+
+
+
+
+
+
+
+
+);
-class App extends Component {
- constructor (props) {
- super(props)
- this.state = {
- user: null
- }
- }
-
- async componentDidMount () {
- let user = await getItem('user')
-
- if (user !== null && user !== undefined && user !== 'undefined') {
- user = JSON.parse(user)
- this.setState({ user })
- }
- }
-
- render () {
- let loggedIn
- if (this.state.user !== null) {
- loggedIn = (
)
- } else {
- loggedIn = ''
- }
- return (
-
-
-
- {loggedIn}
-
-
-
-
-
-
-
-
-
-
- )
- }
-}
-
-export default App
+export default App;
diff --git a/client/src/utils/index.js b/client/src/utils/index.js
index 36ed3a467..2d2a69e07 100644
--- a/client/src/utils/index.js
+++ b/client/src/utils/index.js
@@ -1,10 +1,12 @@
export const toLocalTime = (epoch) => {
- let localDate = new Date(0)
- localDate.setUTCSeconds(epoch)
- var options = { year: 'numeric', month: 'long', day: '2-digit' }
+ const localDate = new Date(0);
+ localDate.setUTCSeconds(epoch);
+ const options = { year: 'numeric', month: 'long', day: '2-digit' };
return (
- localDate.toLocaleDateString(options) +
- ' at ' +
- localDate.toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit' })
- )
-}
+ `${localDate.toLocaleDateString(options)
+ } at ${
+ localDate.toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit' })}`
+ );
+};
+
+export const temporaryFunction = input => input;
diff --git a/client/src/utils/local-storage.js b/client/src/utils/local-storage.js
index 963ba0f36..9da53f424 100644
--- a/client/src/utils/local-storage.js
+++ b/client/src/utils/local-storage.js
@@ -1,9 +1,9 @@
-const getItem = async name => window.localStorage.getItem(name)
-const setItem = async (name, value) => window.localStorage.setItem(name, value)
-const removeItem = async name => window.localStorage.removeItem(name)
+const getItem = async name => window.localStorage.getItem(name);
+const setItem = async (name, value) => window.localStorage.setItem(name, value);
+const removeItem = async name => window.localStorage.removeItem(name);
export {
getItem,
setItem,
- removeItem
-}
+ removeItem,
+};
diff --git a/server/.env.example b/server/.env.example
index a96aeb926..25c16847a 100644
--- a/server/.env.example
+++ b/server/.env.example
@@ -1,3 +1,5 @@
+PRESHARED_GATEWAY_KEY=SECRET_STUFF
+
PORT=3000
DB_USERNAME=example_name
DB_PASSWORD=example_password
@@ -5,4 +7,4 @@ DB_DOMAIN=example.com:1234/example_name
SENTRY_DNS=https://some-val@sentry.io/some-id
-TEAMS_ENDPOINT=https://teams-api.advancedalgos.net/graphql/
+GATEWAY_ENDPOINT=https://app-api.advancedalgos.net/graphql/
diff --git a/server/.eslintrc.js b/server/.eslintrc.js
index b41dc444e..c06bffbce 100644
--- a/server/.eslintrc.js
+++ b/server/.eslintrc.js
@@ -2,7 +2,8 @@ module.exports = {
parser: 'babel-eslint',
extends: 'airbnb-base',
rules: {
+ 'max-len': ['error', 140, 2],
'no-underscore-dangle': 'off',
- 'no-param-reassign': 'off'
+ 'no-param-reassign': 'off',
}
};
diff --git a/server/package-lock.json b/server/package-lock.json
index c44492725..355ae2dcc 100644
--- a/server/package-lock.json
+++ b/server/package-lock.json
@@ -4,6 +4,21 @@
"lockfileVersion": 1,
"requires": true,
"dependencies": {
+ "@apollographql/apollo-upload-server": {
+ "version": "5.0.3",
+ "resolved": "https://registry.npmjs.org/@apollographql/apollo-upload-server/-/apollo-upload-server-5.0.3.tgz",
+ "integrity": "sha512-tGAp3ULNyoA8b5o9LsU2Lq6SwgVPUOKAqKywu2liEtTvrFSGPrObwanhYwArq3GPeOqp2bi+JknSJCIU3oQN1Q==",
+ "requires": {
+ "@babel/runtime-corejs2": "^7.0.0-rc.1",
+ "busboy": "^0.2.14",
+ "object-path": "^0.11.4"
+ }
+ },
+ "@apollographql/graphql-playground-html": {
+ "version": "1.6.4",
+ "resolved": "https://registry.npmjs.org/@apollographql/graphql-playground-html/-/graphql-playground-html-1.6.4.tgz",
+ "integrity": "sha512-gwvaQO6/Hv4DEwhDLmmu2tzCU9oPjC5Xl9Kk8Yd0IxyKhYLlLalmkMMjsZLzU5H3fGaalLD96OYfxHL0ClVUDQ=="
+ },
"@babel/code-frame": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz",
@@ -14,12 +29,12 @@
}
},
"@babel/generator": {
- "version": "7.1.3",
- "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.1.3.tgz",
- "integrity": "sha512-ZoCZGcfIJFJuZBqxcY9OjC1KW2lWK64qrX1o4UYL3yshVhwKFYgzpWZ0vvtGMNJdTlvkw0W+HR1VnYN8q3QPFQ==",
+ "version": "7.1.5",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.1.5.tgz",
+ "integrity": "sha512-IO31r62xfMI+wBJVmgx0JR9ZOHty8HkoYpQAjRWUGG9vykBTlGHdArZ8zoFtpUu2gs17K7qTl/TtPpiSi6t+MA==",
"dev": true,
"requires": {
- "@babel/types": "^7.1.3",
+ "@babel/types": "^7.1.5",
"jsesc": "^2.5.1",
"lodash": "^4.17.10",
"source-map": "^0.5.0",
@@ -27,9 +42,9 @@
},
"dependencies": {
"jsesc": {
- "version": "2.5.1",
- "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.1.tgz",
- "integrity": "sha1-5CGiqOINawgZ3yiQj3glJrlt0f4=",
+ "version": "2.5.2",
+ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz",
+ "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==",
"dev": true
}
}
@@ -112,11 +127,20 @@
}
},
"@babel/parser": {
- "version": "7.1.3",
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.1.3.tgz",
- "integrity": "sha512-gqmspPZOMW3MIRb9HlrnbZHXI1/KHTOroBwN1NcLL6pWxzqzEKGvRTq0W/PxS45OtQGbaFikSQpkS5zbnsQm2w==",
+ "version": "7.1.5",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.1.5.tgz",
+ "integrity": "sha512-WXKf5K5HT6X0kKiCOezJZFljsfxKV1FpU8Tf1A7ZpGvyd/Q4hlrJm2EwoH2onaUq3O4tLDp+4gk0hHPsMyxmOg==",
"dev": true
},
+ "@babel/runtime-corejs2": {
+ "version": "7.1.5",
+ "resolved": "https://registry.npmjs.org/@babel/runtime-corejs2/-/runtime-corejs2-7.1.5.tgz",
+ "integrity": "sha512-WsYRwQsFhVmxkAqwypPTZyV9GpkqMEaAr2zOItOmqSX2GBFaI+eq98CN81e13o0zaUKJOQGYyjhNVqj56nnkYg==",
+ "requires": {
+ "core-js": "^2.5.7",
+ "regenerator-runtime": "^0.12.0"
+ }
+ },
"@babel/template": {
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.1.2.tgz",
@@ -129,17 +153,17 @@
}
},
"@babel/traverse": {
- "version": "7.1.4",
- "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.1.4.tgz",
- "integrity": "sha512-my9mdrAIGdDiSVBuMjpn/oXYpva0/EZwWL3sm3Wcy/AVWO2eXnsoZruOT9jOGNRXU8KbCIu5zsKnXcAJ6PcV6Q==",
+ "version": "7.1.5",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.1.5.tgz",
+ "integrity": "sha512-eU6XokWypl0MVJo+MTSPUtlfPePkrqsF26O+l1qFGlCKWwmiYAYy2Sy44Qw8m2u/LbPCsxYt90rghmqhYMGpPA==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.0.0",
- "@babel/generator": "^7.1.3",
+ "@babel/generator": "^7.1.5",
"@babel/helper-function-name": "^7.1.0",
"@babel/helper-split-export-declaration": "^7.0.0",
- "@babel/parser": "^7.1.3",
- "@babel/types": "^7.1.3",
+ "@babel/parser": "^7.1.5",
+ "@babel/types": "^7.1.5",
"debug": "^3.1.0",
"globals": "^11.1.0",
"lodash": "^4.17.10"
@@ -169,9 +193,9 @@
}
},
"@babel/types": {
- "version": "7.1.3",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.1.3.tgz",
- "integrity": "sha512-RpPOVfK+yatXyn8n4PB1NW6k9qjinrXrRR8ugBN8fD6hCy5RXI6PSbVqpOJBO9oSaY7Nom4ohj35feb0UR9hSA==",
+ "version": "7.1.5",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.1.5.tgz",
+ "integrity": "sha512-sJeqa/d9eM/bax8Ivg+fXF7FpN3E/ZmTrWbkk6r+g7biVYfALMnLin4dKijsaqEhpd2xvOGfQTkQkD31YCVV4A==",
"dev": true,
"requires": {
"esutils": "^2.0.2",
@@ -187,44 +211,98 @@
}
}
},
- "@sentry/core": {
- "version": "4.1.1",
- "resolved": "https://registry.npmjs.org/@sentry/core/-/core-4.1.1.tgz",
- "integrity": "sha512-QJExTxZ1ZA5P/To5gOwd3sowukXW0N/Q9nfu8biRDNa+YURn6ElLjO0fD6eIBqX1f3npo/kTiWZwFBc7LXEzSg==",
+ "@protobufjs/aspromise": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz",
+ "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78="
+ },
+ "@protobufjs/base64": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz",
+ "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg=="
+ },
+ "@protobufjs/codegen": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz",
+ "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg=="
+ },
+ "@protobufjs/eventemitter": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz",
+ "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A="
+ },
+ "@protobufjs/fetch": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz",
+ "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=",
"requires": {
- "@sentry/hub": "4.1.1",
- "@sentry/minimal": "4.1.1",
- "@sentry/types": "4.1.0",
- "@sentry/utils": "4.1.1"
+ "@protobufjs/aspromise": "^1.1.1",
+ "@protobufjs/inquire": "^1.1.0"
+ }
+ },
+ "@protobufjs/float": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz",
+ "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E="
+ },
+ "@protobufjs/inquire": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz",
+ "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik="
+ },
+ "@protobufjs/path": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz",
+ "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0="
+ },
+ "@protobufjs/pool": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz",
+ "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q="
+ },
+ "@protobufjs/utf8": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz",
+ "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA="
+ },
+ "@sentry/core": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/@sentry/core/-/core-4.3.0.tgz",
+ "integrity": "sha512-VEMRshyF2J2IJkGTF9fnAd2/a/wR+42qrKwCLVeNxHzZm53VAnSfJd8ZA5jnN5RiydQVGDOylqvdfij/LmmsuQ==",
+ "requires": {
+ "@sentry/hub": "4.3.0",
+ "@sentry/minimal": "4.3.0",
+ "@sentry/types": "4.3.0",
+ "@sentry/utils": "4.3.0"
}
},
"@sentry/hub": {
- "version": "4.1.1",
- "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-4.1.1.tgz",
- "integrity": "sha512-VmcZOgcbFjJzK1oQNwcFP/wgfoWQr24dFv1C0uwdXldNXx3mwyUVkomvklBHz90HwiahsI/gCc+ZmbC3ECQk2Q==",
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-4.3.0.tgz",
+ "integrity": "sha512-9nh4Hcx2tZQVHr5JGy1XZd1RgwC2C+1tNFXu06rcxYB20nhKOKtOAH9STrv64vpnK+70AC4miRdlCgqHOKLdxA==",
"requires": {
- "@sentry/types": "4.1.0",
- "@sentry/utils": "4.1.1"
+ "@sentry/types": "4.3.0",
+ "@sentry/utils": "4.3.0"
}
},
"@sentry/minimal": {
- "version": "4.1.1",
- "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-4.1.1.tgz",
- "integrity": "sha512-xRKWA46OGnZinJyTljDUel53emPP9mb/XNi/kF6SBaVDOUXl7HAB8kP7Bn7eLBwOanxN8PbYoAzh/lIQXWTmDg==",
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-4.3.0.tgz",
+ "integrity": "sha512-yRN+L3O9mlcjqpWiivqJsm3Cy/YNh0ejQKpxxxPD186tl5nzEkAqRq5jCYelYIAdH1eBvg87H5VNNFr/shHxaQ==",
"requires": {
- "@sentry/hub": "4.1.1",
- "@sentry/types": "4.1.0"
+ "@sentry/hub": "4.3.0",
+ "@sentry/types": "4.3.0"
}
},
"@sentry/node": {
- "version": "4.1.1",
- "resolved": "https://registry.npmjs.org/@sentry/node/-/node-4.1.1.tgz",
- "integrity": "sha512-wbo8F2IqZW+exlOyQzQ7+bPNPXIYmG2g73ZgHFh0x3MHVOTSKgfiO3BzCqmFyUDhxqkEL23PQqLhM07GEtH3Bw==",
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/@sentry/node/-/node-4.3.0.tgz",
+ "integrity": "sha512-2TZHi0XYpSVzKGT/M7mMlXidya4+ZmSZxZCMJ8KlWPljuQxzPoUeGwmYGXOHEsktOGG2eGajDv1hjGtHfamlnA==",
"requires": {
- "@sentry/core": "4.1.1",
- "@sentry/hub": "4.1.1",
- "@sentry/types": "4.1.0",
- "@sentry/utils": "4.1.1",
+ "@sentry/core": "4.3.0",
+ "@sentry/hub": "4.3.0",
+ "@sentry/types": "4.3.0",
+ "@sentry/utils": "4.3.0",
"cookie": "0.3.1",
"lsmod": "1.0.0",
"md5": "2.2.1",
@@ -232,16 +310,112 @@
}
},
"@sentry/types": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/@sentry/types/-/types-4.1.0.tgz",
- "integrity": "sha512-KY7B9wYs1NACHlYzG4OuP6k4uQJkyDPJppftjj3NJYShfwdDTO1I2Swkhhb5dJMEMMMpBJGxXmiqZ2mX5ErISQ=="
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/@sentry/types/-/types-4.3.0.tgz",
+ "integrity": "sha512-oBAusA+/JFJJlNfHgikyBPTyvmCr/YxZsLWL2FNOBNJkMClW+m7tQ63x/ZAqRSEd8lnJQxJSU7LfAYDH6LcChQ=="
},
"@sentry/utils": {
- "version": "4.1.1",
- "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-4.1.1.tgz",
- "integrity": "sha512-XMvGqAWATBrRkOF0lkt0Ij8of2mRmp4WeFTUAgiKzCekxfUBLBaTb4wTaFXz1cnnnjVTwcAq72qBRMhHwQ0IIg==",
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-4.3.0.tgz",
+ "integrity": "sha512-cEGygJbyc1SUGxbanvk3+JYadiywJupdEkp6L8rRfxur/nNQZq1Jd7tkdm4I2rz5YFVg+yayadAquvr4DIu9nA==",
"requires": {
- "@sentry/types": "4.1.0"
+ "@sentry/types": "4.3.0"
+ }
+ },
+ "@types/accepts": {
+ "version": "1.3.5",
+ "resolved": "http://registry.npmjs.org/@types/accepts/-/accepts-1.3.5.tgz",
+ "integrity": "sha512-jOdnI/3qTpHABjM5cx1Hc0sKsPoYCp+DP/GJRGtDlPd7fiV9oXGGIcjW/ZOxLIvjGz8MA+uMZI9metHlgqbgwQ==",
+ "requires": {
+ "@types/node": "*"
+ }
+ },
+ "@types/body-parser": {
+ "version": "1.17.0",
+ "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.17.0.tgz",
+ "integrity": "sha512-a2+YeUjPkztKJu5aIF2yArYFQQp8d51wZ7DavSHjFuY1mqVgidGyzEQ41JIVNy82fXj8yPgy2vJmfIywgESW6w==",
+ "requires": {
+ "@types/connect": "*",
+ "@types/node": "*"
+ }
+ },
+ "@types/connect": {
+ "version": "3.4.32",
+ "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.32.tgz",
+ "integrity": "sha512-4r8qa0quOvh7lGD0pre62CAb1oni1OO6ecJLGCezTmhQ8Fz50Arx9RUszryR8KlgK6avuSXvviL6yWyViQABOg==",
+ "requires": {
+ "@types/node": "*"
+ }
+ },
+ "@types/cors": {
+ "version": "2.8.4",
+ "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.4.tgz",
+ "integrity": "sha512-ipZjBVsm2tF/n8qFGOuGBkUij9X9ZswVi9G3bx/6dz7POpVa6gVHcj1wsX/LVEn9MMF41fxK/PnZPPoTD1UFPw==",
+ "requires": {
+ "@types/express": "*"
+ }
+ },
+ "@types/events": {
+ "version": "1.2.0",
+ "resolved": "http://registry.npmjs.org/@types/events/-/events-1.2.0.tgz",
+ "integrity": "sha512-KEIlhXnIutzKwRbQkGWb/I4HFqBuUykAdHgDED6xqwXJfONCjF5VoE0cXEiurh3XauygxzeDzgtXUqvLkxFzzA=="
+ },
+ "@types/express": {
+ "version": "4.16.0",
+ "resolved": "https://registry.npmjs.org/@types/express/-/express-4.16.0.tgz",
+ "integrity": "sha512-TtPEYumsmSTtTetAPXlJVf3kEqb6wZK0bZojpJQrnD/djV4q1oB6QQ8aKvKqwNPACoe02GNiy5zDzcYivR5Z2w==",
+ "requires": {
+ "@types/body-parser": "*",
+ "@types/express-serve-static-core": "*",
+ "@types/serve-static": "*"
+ }
+ },
+ "@types/express-serve-static-core": {
+ "version": "4.16.0",
+ "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.16.0.tgz",
+ "integrity": "sha512-lTeoCu5NxJU4OD9moCgm0ESZzweAx0YqsAcab6OB0EB3+As1OaHtKnaGJvcngQxYsi9UNv0abn4/DRavrRxt4w==",
+ "requires": {
+ "@types/events": "*",
+ "@types/node": "*",
+ "@types/range-parser": "*"
+ }
+ },
+ "@types/long": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.0.tgz",
+ "integrity": "sha512-1w52Nyx4Gq47uuu0EVcsHBxZFJgurQ+rTKS3qMHxR1GY2T8c2AJYd6vZoZ9q1rupaDjU0yT+Jc2XTyXkjeMA+Q=="
+ },
+ "@types/mime": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/@types/mime/-/mime-2.0.0.tgz",
+ "integrity": "sha512-A2TAGbTFdBw9azHbpVd+/FkdW2T6msN1uct1O9bH3vTerEHKZhTXJUQXy+hNq1B0RagfU8U+KBdqiZpxjhOUQA=="
+ },
+ "@types/node": {
+ "version": "10.12.4",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.4.tgz",
+ "integrity": "sha512-0aFZiYCvoxyKP/Mg6PvqBb2UtWGIPf63r6rOAvRBrgyJOfanbL60yUH2U4FSpg+Yn6FW+JVYWtzn6hLTy745Fg=="
+ },
+ "@types/range-parser": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.2.tgz",
+ "integrity": "sha512-HtKGu+qG1NPvYe1z7ezLsyIaXYyi8SoAVqWDZgDQ8dLrsZvSzUNCwZyfX33uhWxL/SU0ZDQZ3nwZ0nimt507Kw=="
+ },
+ "@types/serve-static": {
+ "version": "1.13.2",
+ "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.2.tgz",
+ "integrity": "sha512-/BZ4QRLpH/bNYgZgwhKEh+5AsboDBcUdlBYgzoLX0fpj3Y2gp6EApyOlM3bK53wQS/OE1SrdSYBAbux2D1528Q==",
+ "requires": {
+ "@types/express-serve-static-core": "*",
+ "@types/mime": "*"
+ }
+ },
+ "@types/ws": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/@types/ws/-/ws-6.0.1.tgz",
+ "integrity": "sha512-EzH8k1gyZ4xih/MaZTXwT2xOkPiIMSrhQ9b8wrlX88L0T02eYsddatQlwVFlEPyEqV0ChpdpNnE51QPH6NVT4Q==",
+ "requires": {
+ "@types/events": "*",
+ "@types/node": "*"
}
},
"abbrev": {
@@ -260,9 +434,9 @@
}
},
"acorn": {
- "version": "6.0.2",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.2.tgz",
- "integrity": "sha512-GXmKIvbrN3TV7aVqAzVFaMW8F8wzVX7voEBRO3bDA64+EX37YSayggRJP5Xig6HYHBkWKpFg9W5gg6orklubhg==",
+ "version": "6.0.4",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.4.tgz",
+ "integrity": "sha512-VY4i5EKSKkofY2I+6QLTbTTN/UvEQPCo6eiwzzSaSWfpaDhOmStMCMod6wmuPciNq+XS0faCglFu2lHZpdHUtg==",
"dev": true
},
"acorn-jsx": {
@@ -272,9 +446,9 @@
"dev": true
},
"ajv": {
- "version": "6.5.4",
- "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.4.tgz",
- "integrity": "sha512-4Wyjt8+t6YszqaXnLDfMmG/8AlO5Zbcsy3ATHncCzjW/NoPzAId8AK6749Ybjmdt+kUY1gP60fCu46oDxPv/mg==",
+ "version": "6.5.5",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.5.tgz",
+ "integrity": "sha512-7q7gtRQDJSyuEHjuVgHoUa2VuemFiCMrfQc9Tc08XTAc4Zj/5U1buQJ0HU6i7fKjXU09SVgSmxa4sLvuvS8Iyg==",
"dev": true,
"requires": {
"fast-deep-equal": "^2.0.1",
@@ -294,7 +468,7 @@
},
"ansi-escapes": {
"version": "3.1.0",
- "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz",
+ "resolved": "http://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz",
"integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==",
"dev": true
},
@@ -321,10 +495,148 @@
"normalize-path": "^2.0.0"
}
},
+ "apollo-cache-control": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/apollo-cache-control/-/apollo-cache-control-0.3.0.tgz",
+ "integrity": "sha512-XtkinmravL9/IEAPXzJod9fKx4iesS0TNBV/619xwurv8eopZkbAiKVZ3WB4rbjoGQpBgEs0bekWIAhYGWLyOw==",
+ "requires": {
+ "apollo-server-env": "2.2.0",
+ "graphql-extensions": "0.3.0"
+ }
+ },
+ "apollo-datasource": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/apollo-datasource/-/apollo-datasource-0.2.0.tgz",
+ "integrity": "sha512-WJM9Ix3uogIfAG7mjL1NZQM9+45rcikn4mPWhE1Iuyw2+Y857J3uKJqQgF5h9Fg64SlCJh9u5WL3N7N5mg1fVw==",
+ "requires": {
+ "apollo-server-caching": "0.2.0",
+ "apollo-server-env": "2.2.0"
+ }
+ },
+ "apollo-engine-reporting": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/apollo-engine-reporting/-/apollo-engine-reporting-0.1.0.tgz",
+ "integrity": "sha512-OjG9MmNWRS3ZMSDc44Z6QMFQ66VDzs/E4H1yZELZ77BVrLsDx4i8Fft95byywACUpLvXhrCRtOdSZIwRPDq+cw==",
+ "requires": {
+ "apollo-engine-reporting-protobuf": "0.1.0",
+ "apollo-server-env": "2.2.0",
+ "async-retry": "^1.2.1",
+ "graphql-extensions": "0.3.0",
+ "lodash": "^4.17.10"
+ }
+ },
+ "apollo-engine-reporting-protobuf": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/apollo-engine-reporting-protobuf/-/apollo-engine-reporting-protobuf-0.1.0.tgz",
+ "integrity": "sha512-GReJtAYTmpwg0drb9VgFtqObYYTCHkJhlHEYCeXY8bJV4fOgXsAZ7CIXR9nPKO0mBaoHIHaGYvXGcyCLrZ36VA==",
+ "requires": {
+ "protobufjs": "^6.8.6"
+ }
+ },
+ "apollo-link": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/apollo-link/-/apollo-link-1.2.3.tgz",
+ "integrity": "sha512-iL9yS2OfxYhigme5bpTbmRyC+Htt6tyo2fRMHT3K1XRL/C5IQDDz37OjpPy4ndx7WInSvfSZaaOTKFja9VWqSw==",
+ "requires": {
+ "apollo-utilities": "^1.0.0",
+ "zen-observable-ts": "^0.8.10"
+ }
+ },
+ "apollo-server-caching": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/apollo-server-caching/-/apollo-server-caching-0.2.0.tgz",
+ "integrity": "sha512-/v7xWEcyyahs3hwX4baH/GekuHz3LRt9NoIYwg869G1eeqjuwY6NsowRIujZ100anJQwm9v5A9/sLtHBFvbgYg==",
+ "requires": {
+ "lru-cache": "^4.1.3"
+ }
+ },
+ "apollo-server-core": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/apollo-server-core/-/apollo-server-core-2.2.0.tgz",
+ "integrity": "sha512-Pd9YpC/xSzpVOr6KM5bDHQdcI8jjKu3hb8x7eyevh/Q7eyrF+ClmfPZvY5EnG4ETIJsTS0+fU1dnoGMmyxCBKw==",
+ "requires": {
+ "@apollographql/apollo-upload-server": "^5.0.3",
+ "@apollographql/graphql-playground-html": "^1.6.4",
+ "@types/ws": "^6.0.0",
+ "apollo-cache-control": "0.3.0",
+ "apollo-datasource": "0.2.0",
+ "apollo-engine-reporting": "0.1.0",
+ "apollo-server-caching": "0.2.0",
+ "apollo-server-env": "2.2.0",
+ "apollo-server-errors": "2.2.0",
+ "apollo-server-plugin-base": "0.1.0",
+ "apollo-tracing": "0.3.0",
+ "graphql-extensions": "0.3.0",
+ "graphql-subscriptions": "^1.0.0",
+ "graphql-tag": "^2.9.2",
+ "graphql-tools": "^4.0.0",
+ "json-stable-stringify": "^1.0.1",
+ "lodash": "^4.17.10",
+ "subscriptions-transport-ws": "^0.9.11",
+ "ws": "^6.0.0"
+ }
+ },
+ "apollo-server-env": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/apollo-server-env/-/apollo-server-env-2.2.0.tgz",
+ "integrity": "sha512-wjJiI5nQWPBpNmpiLP389Ezpstp71szS6DHAeTgYLb/ulCw3CTuuA+0/E1bsThVWiQaDeHZE0sE3yI8q2zrYiA==",
+ "requires": {
+ "node-fetch": "^2.1.2",
+ "util.promisify": "^1.0.0"
+ }
+ },
+ "apollo-server-errors": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/apollo-server-errors/-/apollo-server-errors-2.2.0.tgz",
+ "integrity": "sha512-gV9EZG2tovFtT1cLuCTavnJu2DaKxnXPRNGSTo+SDI6IAk6cdzyW0Gje5N2+3LybI0Wq5KAbW6VLei31S4MWmg=="
+ },
+ "apollo-server-express": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/apollo-server-express/-/apollo-server-express-2.2.0.tgz",
+ "integrity": "sha512-E6WpImvCHKR9MHs64gTHhMrehk6/1NRE2+bblsHZg7ot8Iy6hVmzsCIzSmlPYh5uozpcyeRdC1pV0nwERtQKog==",
+ "requires": {
+ "@apollographql/apollo-upload-server": "^5.0.3",
+ "@apollographql/graphql-playground-html": "^1.6.4",
+ "@types/accepts": "^1.3.5",
+ "@types/body-parser": "1.17.0",
+ "@types/cors": "^2.8.4",
+ "@types/express": "4.16.0",
+ "accepts": "^1.3.5",
+ "apollo-server-core": "2.2.0",
+ "body-parser": "^1.18.3",
+ "cors": "^2.8.4",
+ "graphql-subscriptions": "^1.0.0",
+ "graphql-tools": "^4.0.0",
+ "type-is": "^1.6.16"
+ }
+ },
+ "apollo-server-plugin-base": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/apollo-server-plugin-base/-/apollo-server-plugin-base-0.1.0.tgz",
+ "integrity": "sha512-ptaVBjR+Q1swdzsh84tY5Qb0yyTMO/IOBsBJzCdxuAKs+PAVFw7ZMQoe5bT0DJjKJXHjtfMiTF77mRLLBq2dEw=="
+ },
+ "apollo-tracing": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/apollo-tracing/-/apollo-tracing-0.3.0.tgz",
+ "integrity": "sha512-fkSpvzldDo1jBFap0d5lJYghEiH55eRVQzrC6vGvwr7rZNK5Moznwn9sBqy+4QsOaIp+wYc6pz/a+hwG4pasig==",
+ "requires": {
+ "apollo-server-env": "2.2.0",
+ "graphql-extensions": "0.3.0"
+ }
+ },
+ "apollo-utilities": {
+ "version": "1.0.25",
+ "resolved": "https://registry.npmjs.org/apollo-utilities/-/apollo-utilities-1.0.25.tgz",
+ "integrity": "sha512-AXvqkhni3Ir1ffm4SA1QzXn8k8I5BBl4PVKEyak734i4jFdp+xgfUyi2VCqF64TJlFTA/B73TRDUvO2D+tKtZg==",
+ "requires": {
+ "fast-json-stable-stringify": "^2.0.0"
+ }
+ },
"argparse": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
"integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
+ "dev": true,
"requires": {
"sprintf-js": "~1.0.2"
}
@@ -378,24 +690,39 @@
"dev": true,
"optional": true
},
- "arrify": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz",
- "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=",
- "dev": true
- },
"assign-symbols": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz",
"integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=",
"dev": true
},
+ "async": {
+ "version": "2.6.1",
+ "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz",
+ "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==",
+ "requires": {
+ "lodash": "^4.17.10"
+ }
+ },
"async-each": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz",
"integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=",
"dev": true
},
+ "async-limiter": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz",
+ "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg=="
+ },
+ "async-retry": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/async-retry/-/async-retry-1.2.3.tgz",
+ "integrity": "sha512-tfDb02Th6CE6pJUF2gjW5ZVjsgwlucVXOEQMvEX9JgSJMs9gAX+Nz3xRuJBKuUYjTSYORqvDBORdAQ3LU59g7Q==",
+ "requires": {
+ "retry": "0.12.0"
+ }
+ },
"atob": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz",
@@ -484,18 +811,6 @@
"@babel/types": "^7.0.0",
"eslint-scope": "3.7.1",
"eslint-visitor-keys": "^1.0.0"
- },
- "dependencies": {
- "eslint-scope": {
- "version": "3.7.1",
- "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz",
- "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=",
- "dev": true,
- "requires": {
- "esrecurse": "^4.1.0",
- "estraverse": "^4.1.1"
- }
- }
}
},
"babel-generator": {
@@ -1166,6 +1481,14 @@
"requires": {
"core-js": "^2.4.0",
"regenerator-runtime": "^0.11.0"
+ },
+ "dependencies": {
+ "regenerator-runtime": {
+ "version": "0.11.1",
+ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz",
+ "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==",
+ "dev": true
+ }
}
},
"babel-template": {
@@ -1216,10 +1539,16 @@
"integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==",
"dev": true
},
+ "backo2": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz",
+ "integrity": "sha1-MasayLEpNjRj41s+u2n038+6eUc="
+ },
"balanced-match": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
- "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
+ "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
+ "dev": true
},
"base": {
"version": "0.11.2",
@@ -1366,6 +1695,7 @@
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
+ "dev": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@@ -1394,9 +1724,9 @@
}
},
"bson": {
- "version": "1.0.9",
- "resolved": "https://registry.npmjs.org/bson/-/bson-1.0.9.tgz",
- "integrity": "sha512-IQX9/h7WdMBIW/q/++tGd+emQr0XMdeZ6icnT/74Xk9fnabWn+gZgpE+9V+gujL3hhJOoNrnDVY7tWdzc7NUTg=="
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/bson/-/bson-1.1.0.tgz",
+ "integrity": "sha512-9Aeai9TacfNtWXOYarkFJRW2CWo+dRon+fuLZYJmvLV3+MiUp0bEI6IAZfXEIg7/Pl/7IWlLaDnhzTsD81etQA=="
},
"builtin-modules": {
"version": "1.1.1",
@@ -1404,6 +1734,15 @@
"integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=",
"dev": true
},
+ "busboy": {
+ "version": "0.2.14",
+ "resolved": "https://registry.npmjs.org/busboy/-/busboy-0.2.14.tgz",
+ "integrity": "sha1-bCpiLvz0fFe7vh4qnDetNseSVFM=",
+ "requires": {
+ "dicer": "0.2.5",
+ "readable-stream": "1.1.x"
+ }
+ },
"bytes": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz",
@@ -1456,9 +1795,9 @@
"dev": true
},
"caniuse-lite": {
- "version": "1.0.30000892",
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000892.tgz",
- "integrity": "sha512-X9rxMaWZNbJB5qjkDqPtNv/yfViTeUL6ILk0QJNxLV3OhKC5Acn5vxsuUvllR6B48mog8lmS+whwHq/QIYSL9w==",
+ "version": "1.0.30000907",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000907.tgz",
+ "integrity": "sha512-No5sQ/OB2Nmka8MNOOM6nJx+Hxt6MQ6h7t7kgJFu9oTuwjykyKRSBP/+i/QAyFHxeHB+ddE0Da1CG5ihx9oehQ==",
"dev": true
},
"capture-stack-trace": {
@@ -1611,7 +1950,8 @@
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
- "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
+ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
+ "dev": true
},
"configstore": {
"version": "3.1.2",
@@ -1671,19 +2011,17 @@
"core-js": {
"version": "2.5.7",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz",
- "integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==",
- "dev": true
+ "integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw=="
},
"core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
- "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
- "dev": true
+ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
},
"cors": {
- "version": "2.8.4",
- "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.4.tgz",
- "integrity": "sha1-K9OB8usgECAQXNUOpZ2mMJBpRoY=",
+ "version": "2.8.5",
+ "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz",
+ "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==",
"requires": {
"object-assign": "^4",
"vary": "^1"
@@ -1698,22 +2036,15 @@
"capture-stack-trace": "^1.0.0"
}
},
- "cross-fetch": {
- "version": "2.2.2",
- "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-2.2.2.tgz",
- "integrity": "sha1-pH/09/xxLauo9qaVoRyUhEDUVyM=",
- "requires": {
- "node-fetch": "2.1.2",
- "whatwg-fetch": "2.0.4"
- }
- },
"cross-spawn": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
- "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=",
+ "version": "6.0.5",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
+ "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
"dev": true,
"requires": {
- "lru-cache": "^4.0.1",
+ "nice-try": "^1.0.4",
+ "path-key": "^2.0.1",
+ "semver": "^5.5.0",
"shebang-command": "^1.2.0",
"which": "^1.2.9"
}
@@ -1759,7 +2090,6 @@
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
"integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==",
- "dev": true,
"requires": {
"object-keys": "^1.0.12"
}
@@ -1818,26 +2148,17 @@
}
},
"del": {
- "version": "2.2.2",
- "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz",
- "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=",
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/del/-/del-3.0.0.tgz",
+ "integrity": "sha1-U+z2mf/LyzljdpGrE7rxYIGXZuU=",
"dev": true,
"requires": {
- "globby": "^5.0.0",
+ "globby": "^6.1.0",
"is-path-cwd": "^1.0.0",
"is-path-in-cwd": "^1.0.0",
- "object-assign": "^4.0.1",
- "pify": "^2.0.0",
- "pinkie-promise": "^2.0.0",
+ "p-map": "^1.1.1",
+ "pify": "^3.0.0",
"rimraf": "^2.2.8"
- },
- "dependencies": {
- "pify": {
- "version": "2.3.0",
- "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
- "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
- "dev": true
- }
}
},
"depd": {
@@ -1845,6 +2166,11 @@
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
"integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak="
},
+ "deprecated-decorator": {
+ "version": "0.1.6",
+ "resolved": "https://registry.npmjs.org/deprecated-decorator/-/deprecated-decorator-0.1.6.tgz",
+ "integrity": "sha1-AJZjF7ehL+kvPMgx91g68ym4bDc="
+ },
"destroy": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz",
@@ -1859,6 +2185,15 @@
"repeating": "^2.0.0"
}
},
+ "dicer": {
+ "version": "0.2.5",
+ "resolved": "https://registry.npmjs.org/dicer/-/dicer-0.2.5.tgz",
+ "integrity": "sha1-WZbAhrszIYyBLAkL3cCc0S+stw8=",
+ "requires": {
+ "readable-stream": "1.1.x",
+ "streamsearch": "0.1.2"
+ }
+ },
"doctrine": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz",
@@ -1900,9 +2235,9 @@
"integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
},
"electron-to-chromium": {
- "version": "1.3.79",
- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.79.tgz",
- "integrity": "sha512-LQdY3j4PxuUl6xfxiFruTSlCniTrTrzAd8/HfsLEMi0PUpaQ0Iy+Pr4N4VllDYjs0Hyu2lkTbvzqlG+PX9NsNw==",
+ "version": "1.3.84",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.84.tgz",
+ "integrity": "sha512-IYhbzJYOopiTaNWMBp7RjbecUBsbnbDneOP86f3qvS0G0xfzwNSvMJpTrvi5/Y1gU7tg2NAgeg8a8rCYvW9Whw==",
"dev": true
},
"encodeurl": {
@@ -1923,7 +2258,6 @@
"version": "1.12.0",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz",
"integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==",
- "dev": true,
"requires": {
"es-to-primitive": "^1.1.1",
"function-bind": "^1.1.1",
@@ -1936,7 +2270,6 @@
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz",
"integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==",
- "dev": true,
"requires": {
"is-callable": "^1.1.4",
"is-date-object": "^1.0.1",
@@ -2026,19 +2359,6 @@
"supports-color": "^5.3.0"
}
},
- "cross-spawn": {
- "version": "6.0.5",
- "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
- "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
- "dev": true,
- "requires": {
- "nice-try": "^1.0.4",
- "path-key": "^2.0.1",
- "semver": "^5.5.0",
- "shebang-command": "^1.2.0",
- "which": "^1.2.9"
- }
- },
"debug": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.0.tgz",
@@ -2048,6 +2368,16 @@
"ms": "^2.1.1"
}
},
+ "eslint-scope": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz",
+ "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==",
+ "dev": true,
+ "requires": {
+ "esrecurse": "^4.1.0",
+ "estraverse": "^4.1.1"
+ }
+ },
"globals": {
"version": "11.8.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-11.8.0.tgz",
@@ -2138,6 +2468,12 @@
"esutils": "^2.0.2",
"isarray": "^1.0.0"
}
+ },
+ "isarray": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
+ "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
+ "dev": true
}
}
},
@@ -2148,9 +2484,9 @@
"dev": true
},
"eslint-scope": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz",
- "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==",
+ "version": "3.7.1",
+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz",
+ "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=",
"dev": true,
"requires": {
"esrecurse": "^4.1.0",
@@ -2183,7 +2519,8 @@
"esprima": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
- "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="
+ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
+ "dev": true
},
"esquery": {
"version": "1.0.1",
@@ -2236,6 +2573,11 @@
"through": "^2.3.8"
}
},
+ "eventemitter3": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.0.tgz",
+ "integrity": "sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA=="
+ },
"execa": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz",
@@ -2249,6 +2591,19 @@
"p-finally": "^1.0.0",
"signal-exit": "^3.0.0",
"strip-eof": "^1.0.0"
+ },
+ "dependencies": {
+ "cross-spawn": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
+ "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=",
+ "dev": true,
+ "requires": {
+ "lru-cache": "^4.0.1",
+ "shebang-command": "^1.2.0",
+ "which": "^1.2.9"
+ }
+ }
}
},
"expand-brackets": {
@@ -2306,17 +2661,13 @@
"type-is": "~1.6.16",
"utils-merge": "1.0.1",
"vary": "~1.1.2"
- }
- },
- "express-graphql": {
- "version": "0.6.12",
- "resolved": "http://registry.npmjs.org/express-graphql/-/express-graphql-0.6.12.tgz",
- "integrity": "sha512-ouLWV0hRw4hnaLtXzzwhdC79ewxKbY2PRvm05mPc/zOH5W5WVCHDQ1SmNxEPBQdUeeSNh29aIqW9zEQkA3kMuA==",
- "requires": {
- "accepts": "^1.3.0",
- "content-type": "^1.0.4",
- "http-errors": "^1.3.0",
- "raw-body": "^2.3.2"
+ },
+ "dependencies": {
+ "statuses": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz",
+ "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew=="
+ }
}
},
"extend-shallow": {
@@ -2381,8 +2732,7 @@
"fast-json-stable-stringify": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz",
- "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=",
- "dev": true
+ "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I="
},
"fast-levenshtein": {
"version": "2.0.6",
@@ -2442,6 +2792,13 @@
"parseurl": "~1.3.2",
"statuses": "~1.4.0",
"unpipe": "~1.0.0"
+ },
+ "dependencies": {
+ "statuses": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz",
+ "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew=="
+ }
}
},
"find-up": {
@@ -2455,13 +2812,13 @@
}
},
"flat-cache": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz",
- "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=",
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.2.tgz",
+ "integrity": "sha512-KByBY8c98sLUAGpnmjEdWTrtrLZRtZdwds+kAL/ciFXTCb7AZgqKsAnVnYFQj1hxepwO8JKN/8AsRWwLq+RK0A==",
"dev": true,
"requires": {
"circular-json": "^0.3.1",
- "del": "^2.0.2",
+ "del": "^3.0.0",
"graceful-fs": "^4.1.2",
"write": "^0.2.1"
}
@@ -3075,8 +3432,7 @@
"function-bind": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
- "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
- "dev": true
+ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
},
"functional-red-black-tree": {
"version": "1.0.1",
@@ -3146,13 +3502,12 @@
"dev": true
},
"globby": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz",
- "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=",
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz",
+ "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=",
"dev": true,
"requires": {
"array-union": "^1.0.1",
- "arrify": "^1.0.0",
"glob": "^7.0.3",
"object-assign": "^4.0.1",
"pify": "^2.0.0",
@@ -3187,76 +3542,53 @@
}
},
"graceful-fs": {
- "version": "4.1.11",
- "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz",
- "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=",
+ "version": "4.1.15",
+ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz",
+ "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==",
"dev": true
},
"graphql": {
- "version": "14.0.2",
- "resolved": "https://registry.npmjs.org/graphql/-/graphql-14.0.2.tgz",
- "integrity": "sha512-gUC4YYsaiSJT1h40krG3J+USGlwhzNTXSb4IOZljn9ag5Tj+RkoXrWp+Kh7WyE3t1NCfab5kzCuxBIvOMERMXw==",
+ "version": "0.13.2",
+ "resolved": "http://registry.npmjs.org/graphql/-/graphql-0.13.2.tgz",
+ "integrity": "sha512-QZ5BL8ZO/B20VA8APauGBg3GyEgZ19eduvpLWoq5x7gMmWnHoy8rlQWPLmWgFvo1yNgjSEFMesmS4R6pPr7xog==",
"requires": {
- "iterall": "^1.2.2"
+ "iterall": "^1.2.1"
}
},
- "graphql-config": {
- "version": "2.2.1",
- "resolved": "https://registry.npmjs.org/graphql-config/-/graphql-config-2.2.1.tgz",
- "integrity": "sha512-U8+1IAhw9m6WkZRRcyj8ZarK96R6lQBQ0an4lp76Ps9FyhOXENC5YQOxOFGm5CxPrX2rD0g3Je4zG5xdNJjwzQ==",
+ "graphql-extensions": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/graphql-extensions/-/graphql-extensions-0.3.0.tgz",
+ "integrity": "sha512-+ppyD7g6acX0y2vj5hm5mRlCBngdHD2dE1jW7abAG4PAWg275TrczA3WXUxB6P9Q4uw0XA886Q+aagI5EmTSaA=="
+ },
+ "graphql-subscriptions": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/graphql-subscriptions/-/graphql-subscriptions-1.0.0.tgz",
+ "integrity": "sha512-+ytmryoHF1LVf58NKEaNPRUzYyXplm120ntxfPcgOBC7TnK7Tv/4VRHeh4FAR9iL+O1bqhZs4nkibxQ+OA5cDQ==",
"requires": {
- "graphql-import": "^0.7.1",
- "graphql-request": "^1.5.0",
- "js-yaml": "^3.10.0",
- "lodash": "^4.17.4",
- "minimatch": "^3.0.4"
+ "iterall": "^1.2.1"
}
},
- "graphql-import": {
- "version": "0.7.1",
- "resolved": "https://registry.npmjs.org/graphql-import/-/graphql-import-0.7.1.tgz",
- "integrity": "sha512-YpwpaPjRUVlw2SN3OPljpWbVRWAhMAyfSba5U47qGMOSsPLi2gYeJtngGpymjm9nk57RFWEpjqwh4+dpYuFAPw==",
- "requires": {
- "lodash": "^4.17.4",
- "resolve-from": "^4.0.0"
- },
- "dependencies": {
- "resolve-from": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
- "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g=="
- }
- }
+ "graphql-tag": {
+ "version": "2.10.0",
+ "resolved": "https://registry.npmjs.org/graphql-tag/-/graphql-tag-2.10.0.tgz",
+ "integrity": "sha512-9FD6cw976TLLf9WYIUPCaaTpniawIjHWZSwIRZSjrfufJamcXbVVYfN2TWvJYbw0Xf2JjYbl1/f2+wDnBVw3/w=="
},
- "graphql-playground-html": {
- "version": "1.6.4",
- "resolved": "https://registry.npmjs.org/graphql-playground-html/-/graphql-playground-html-1.6.4.tgz",
- "integrity": "sha512-mnpAVYSR3TesYsJ5OLJVJMA0muTCw4npsCI1cKMtW35lbA6KljZkLkz3ZWXhEIYPnHKIeUHEtbn1ZGkEXtAxLg==",
+ "graphql-tools": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/graphql-tools/-/graphql-tools-4.0.3.tgz",
+ "integrity": "sha512-NNZM0WSnVLX1zIMUxu7SjzLZ4prCp15N5L2T2ro02OVyydZ0fuCnZYRnx/yK9xjGWbZA0Q58yEO//Bv/psJWrg==",
"requires": {
- "graphql-config": "2.2.1"
- }
- },
- "graphql-playground-middleware-express": {
- "version": "1.7.6",
- "resolved": "https://registry.npmjs.org/graphql-playground-middleware-express/-/graphql-playground-middleware-express-1.7.6.tgz",
- "integrity": "sha512-fICPxYGIdhCxtFlwCnP3uZ2uRWeQ9wj7OkcWUiHNwaFma2TbRD5nNKaPA2u21YWha9xv26qIDxxcdW27F/lcbQ==",
- "requires": {
- "graphql-playground-html": "1.6.4"
- }
- },
- "graphql-request": {
- "version": "1.8.2",
- "resolved": "https://registry.npmjs.org/graphql-request/-/graphql-request-1.8.2.tgz",
- "integrity": "sha512-dDX2M+VMsxXFCmUX0Vo0TopIZIX4ggzOtiCsThgtrKR4niiaagsGTDIHj3fsOMFETpa064vzovI+4YV4QnMbcg==",
- "requires": {
- "cross-fetch": "2.2.2"
+ "apollo-link": "^1.2.3",
+ "apollo-utilities": "^1.0.1",
+ "deprecated-decorator": "^0.1.6",
+ "iterall": "^1.1.3",
+ "uuid": "^3.1.0"
}
},
"has": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
"integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
- "dev": true,
"requires": {
"function-bind": "^1.1.1"
}
@@ -3279,8 +3611,7 @@
"has-symbols": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz",
- "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=",
- "dev": true
+ "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q="
},
"has-value": {
"version": "1.0.0",
@@ -3544,8 +3875,7 @@
"is-callable": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz",
- "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==",
- "dev": true
+ "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA=="
},
"is-ci": {
"version": "1.2.1",
@@ -3568,8 +3898,7 @@
"is-date-object": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz",
- "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=",
- "dev": true
+ "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY="
},
"is-descriptor": {
"version": "0.1.6",
@@ -3746,7 +4075,6 @@
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz",
"integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=",
- "dev": true,
"requires": {
"has": "^1.0.1"
}
@@ -3773,7 +4101,6 @@
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz",
"integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==",
- "dev": true,
"requires": {
"has-symbols": "^1.0.0"
}
@@ -3785,10 +4112,9 @@
"dev": true
},
"isarray": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
- "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
- "dev": true
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
+ "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8="
},
"isexe": {
"version": "2.0.0",
@@ -3804,6 +4130,15 @@
"optional": true,
"requires": {
"isarray": "1.0.0"
+ },
+ "dependencies": {
+ "isarray": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
+ "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
+ "dev": true,
+ "optional": true
+ }
}
},
"iterall": {
@@ -3821,6 +4156,7 @@
"version": "3.12.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz",
"integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==",
+ "dev": true,
"requires": {
"argparse": "^1.0.7",
"esprima": "^4.0.0"
@@ -3828,7 +4164,7 @@
},
"jsesc": {
"version": "1.3.0",
- "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz",
+ "resolved": "http://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz",
"integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=",
"dev": true
},
@@ -3838,6 +4174,14 @@
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
"dev": true
},
+ "json-stable-stringify": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz",
+ "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=",
+ "requires": {
+ "jsonify": "~0.0.0"
+ }
+ },
"json-stable-stringify-without-jsonify": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
@@ -3850,6 +4194,11 @@
"integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=",
"dev": true
},
+ "jsonify": {
+ "version": "0.0.0",
+ "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz",
+ "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM="
+ },
"kareem": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/kareem/-/kareem-2.3.0.tgz",
@@ -3937,6 +4286,11 @@
"resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz",
"integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk="
},
+ "long": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz",
+ "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA=="
+ },
"loose-envify": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
@@ -3953,13 +4307,12 @@
"dev": true
},
"lru-cache": {
- "version": "4.0.2",
- "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.0.2.tgz",
- "integrity": "sha1-HRdnnAac2l0ECZGgnbwsDbN35V4=",
- "dev": true,
+ "version": "4.1.3",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz",
+ "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==",
"requires": {
- "pseudomap": "^1.0.1",
- "yallist": "^2.0.0"
+ "pseudomap": "^1.0.2",
+ "yallist": "^2.1.2"
}
},
"lsmod": {
@@ -4063,16 +4416,16 @@
"integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ=="
},
"mime-db": {
- "version": "1.36.0",
- "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.36.0.tgz",
- "integrity": "sha512-L+xvyD9MkoYMXb1jAmzI/lWYAxAMCPvIBSWur0PZ5nOf5euahRLVqH//FKW9mWp2lkqUgYiXPgkzfMUFi4zVDw=="
+ "version": "1.37.0",
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz",
+ "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg=="
},
"mime-types": {
- "version": "2.1.20",
- "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.20.tgz",
- "integrity": "sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A==",
+ "version": "2.1.21",
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz",
+ "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==",
"requires": {
- "mime-db": "~1.36.0"
+ "mime-db": "~1.37.0"
}
},
"mimic-fn": {
@@ -4085,6 +4438,7 @@
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
+ "dev": true,
"requires": {
"brace-expansion": "^1.1.7"
}
@@ -4126,43 +4480,36 @@
}
},
"mongodb": {
- "version": "3.1.6",
- "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.1.6.tgz",
- "integrity": "sha512-E5QJuXQoMlT7KyCYqNNMfAkhfQD79AT4F8Xd+6x37OX+8BL17GyXyWvfm6wuyx4wnzCCPoCSLeMeUN2S7dU9yw==",
+ "version": "3.1.8",
+ "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.1.8.tgz",
+ "integrity": "sha512-yNKwYxQ6m00NV6+pMoWoheFTHSQVv1KkSrfOhRDYMILGWDYtUtQRqHrFqU75rmPIY8hMozVft8zdC4KYMWaM3Q==",
"requires": {
- "mongodb-core": "3.1.5",
+ "mongodb-core": "3.1.7",
"safe-buffer": "^5.1.2"
}
},
"mongodb-core": {
- "version": "3.1.5",
- "resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-3.1.5.tgz",
- "integrity": "sha512-emT/tM4ZBinqd6RZok+EzDdtN4LjYJIckv71qQVOEFmvXgT5cperZegVmTgox/1cx4XQu6LJ5ZuIwipP/eKdQg==",
+ "version": "3.1.7",
+ "resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-3.1.7.tgz",
+ "integrity": "sha512-YffpSrLmgFNmrvkGx+yX00KyBNk64C0BalfEn6vHHkXtcMUGXw8nxrMmhq5eXPLLlYeBpD/CsgNxE2Chf0o4zQ==",
"requires": {
"bson": "^1.1.0",
"require_optional": "^1.0.1",
"safe-buffer": "^5.1.2",
"saslprep": "^1.0.0"
- },
- "dependencies": {
- "bson": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/bson/-/bson-1.1.0.tgz",
- "integrity": "sha512-9Aeai9TacfNtWXOYarkFJRW2CWo+dRon+fuLZYJmvLV3+MiUp0bEI6IAZfXEIg7/Pl/7IWlLaDnhzTsD81etQA=="
- }
}
},
"mongoose": {
- "version": "5.3.4",
- "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.3.4.tgz",
- "integrity": "sha512-DIUWOyYgZv2zGi/BoFEaFiaCVuDonnzGhW3cnc3JFjBScYn6z24tS2j3VB0dtMoX8FFjxmmMVnlmHPEIbV4PKA==",
+ "version": "5.3.10",
+ "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.3.10.tgz",
+ "integrity": "sha512-h2cW/vR/7UFOAlOoGMpyWdXE75fvfC61TdX63tXnz8L95OU5p7Lj11FxZoznBKjfBPGUk79tmMz6zxPLyBkClQ==",
"requires": {
"async": "2.6.1",
- "bson": "~1.0.5",
+ "bson": "~1.1.0",
"kareem": "2.3.0",
"lodash.get": "4.4.2",
- "mongodb": "3.1.6",
- "mongodb-core": "3.1.5",
+ "mongodb": "3.1.8",
+ "mongodb-core": "3.1.7",
"mongoose-legacy-pluralize": "1.0.2",
"mpath": "0.5.1",
"mquery": "3.2.0",
@@ -4170,16 +4517,6 @@
"regexp-clone": "0.0.1",
"safe-buffer": "5.1.2",
"sliced": "1.0.1"
- },
- "dependencies": {
- "async": {
- "version": "2.6.1",
- "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz",
- "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==",
- "requires": {
- "lodash": "^4.17.10"
- }
- }
}
},
"mongoose-legacy-pluralize": {
@@ -4289,17 +4626,17 @@
"dev": true
},
"node-fetch": {
- "version": "2.1.2",
- "resolved": "http://registry.npmjs.org/node-fetch/-/node-fetch-2.1.2.tgz",
- "integrity": "sha1-q4hOjn5X44qUR1POxwb3iNF2i7U="
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.2.1.tgz",
+ "integrity": "sha512-ObXBpNCD3A/vYQiQtEWl7DuqjAXjfptYFuGHLdPl5U19/6kJuZV+8uMHLrkj3wJrJoyfg4nhgyFixZdaZoAiEQ=="
},
"nodemon": {
- "version": "1.18.4",
- "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.18.4.tgz",
- "integrity": "sha512-hyK6vl65IPnky/ee+D3IWvVGgJa/m3No2/Xc/3wanS6Ce1MWjCzH6NnhPJ/vZM+6JFym16jtHx51lmCMB9HDtg==",
+ "version": "1.18.6",
+ "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.18.6.tgz",
+ "integrity": "sha512-4pHQNYEZun+IkIC2jCaXEhkZnfA7rQe73i8RkdRyDJls/K+WxR7IpI5uNUsAvQ0zWvYcCDNGD+XVtw2ZG86/uQ==",
"dev": true,
"requires": {
- "chokidar": "^2.0.2",
+ "chokidar": "^2.0.4",
"debug": "^3.1.0",
"ignore-by-default": "^1.0.1",
"minimatch": "^3.0.4",
@@ -4764,8 +5101,12 @@
"object-keys": {
"version": "1.0.12",
"resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz",
- "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==",
- "dev": true
+ "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag=="
+ },
+ "object-path": {
+ "version": "0.11.4",
+ "resolved": "https://registry.npmjs.org/object-path/-/object-path-0.11.4.tgz",
+ "integrity": "sha1-NwrnUvvzfePqcKhhwju6iRVpGUk="
},
"object-visit": {
"version": "1.0.1",
@@ -4808,6 +5149,15 @@
"has": "^1.0.1"
}
},
+ "object.getownpropertydescriptors": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz",
+ "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=",
+ "requires": {
+ "define-properties": "^1.1.2",
+ "es-abstract": "^1.5.1"
+ }
+ },
"object.omit": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz",
@@ -4878,13 +5228,13 @@
},
"os-homedir": {
"version": "1.0.2",
- "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
+ "resolved": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
"integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=",
"dev": true
},
"os-tmpdir": {
"version": "1.0.2",
- "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
+ "resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
"dev": true
},
@@ -4923,6 +5273,12 @@
"p-limit": "^1.1.0"
}
},
+ "p-map": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/p-map/-/p-map-1.2.0.tgz",
+ "integrity": "sha512-r6zKACMNhjPJMTl8KcFH4li//gkrXWfbD6feV8l6doRHlzljFWGJ2AP6iKaCJXyZmAUMOPtvbW7EXkbWO/pLEA==",
+ "dev": true
+ },
"p-try": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz",
@@ -4991,7 +5347,7 @@
},
"path-is-absolute": {
"version": "1.0.1",
- "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
+ "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
"dev": true
},
@@ -5123,6 +5479,26 @@
"integrity": "sha512-OE+a6vzqazc+K6LxJrX5UPyKFvGnL5CYmq2jFGNIBWHpc4QyE49/YOumcrpQFJpfejmvRtbJzgO1zPmMCqlbBg==",
"dev": true
},
+ "protobufjs": {
+ "version": "6.8.8",
+ "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.8.8.tgz",
+ "integrity": "sha512-AAmHtD5pXgZfi7GMpllpO3q1Xw1OYldr+dMUlAnffGTAhqkg72WdmSY71uKBF/JuyiKs8psYbtKrhi0ASCD8qw==",
+ "requires": {
+ "@protobufjs/aspromise": "^1.1.2",
+ "@protobufjs/base64": "^1.1.2",
+ "@protobufjs/codegen": "^2.0.4",
+ "@protobufjs/eventemitter": "^1.1.0",
+ "@protobufjs/fetch": "^1.1.0",
+ "@protobufjs/float": "^1.0.2",
+ "@protobufjs/inquire": "^1.1.0",
+ "@protobufjs/path": "^1.1.2",
+ "@protobufjs/pool": "^1.1.0",
+ "@protobufjs/utf8": "^1.1.0",
+ "@types/long": "^4.0.0",
+ "@types/node": "^10.1.0",
+ "long": "^4.0.0"
+ }
+ },
"proxy-addr": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.4.tgz",
@@ -5144,8 +5520,7 @@
"pseudomap": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz",
- "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=",
- "dev": true
+ "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM="
},
"pstree.remy": {
"version": "1.1.0",
@@ -5168,9 +5543,9 @@
"integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA=="
},
"randomatic": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.0.tgz",
- "integrity": "sha512-KnGPVE0lo2WoXxIZ7cPR8YBpiol4gsSuOwDSg410oHh80ZMp5EiypNqL2K4Z77vJn6lB5rap7IkAmcUlalcnBQ==",
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz",
+ "integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==",
"dev": true,
"optional": true,
"requires": {
@@ -5264,18 +5639,14 @@
}
},
"readable-stream": {
- "version": "2.3.6",
- "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
- "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
- "dev": true,
+ "version": "1.1.14",
+ "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
+ "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=",
"requires": {
"core-util-is": "~1.0.0",
- "inherits": "~2.0.3",
- "isarray": "~1.0.0",
- "process-nextick-args": "~2.0.0",
- "safe-buffer": "~5.1.1",
- "string_decoder": "~1.1.1",
- "util-deprecate": "~1.0.1"
+ "inherits": "~2.0.1",
+ "isarray": "0.0.1",
+ "string_decoder": "~0.10.x"
}
},
"readdirp": {
@@ -5530,6 +5901,12 @@
}
}
},
+ "isarray": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
+ "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
+ "dev": true
+ },
"isobject": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
@@ -5562,6 +5939,30 @@
"snapdragon": "^0.8.1",
"to-regex": "^3.0.2"
}
+ },
+ "readable-stream": {
+ "version": "2.3.6",
+ "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
+ "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
+ "dev": true,
+ "requires": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
+ }
+ },
+ "string_decoder": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+ "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+ "dev": true,
+ "requires": {
+ "safe-buffer": "~5.1.0"
+ }
}
}
},
@@ -5572,10 +5973,9 @@
"dev": true
},
"regenerator-runtime": {
- "version": "0.11.1",
- "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz",
- "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==",
- "dev": true
+ "version": "0.12.1",
+ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz",
+ "integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg=="
},
"regenerator-transform": {
"version": "0.10.1",
@@ -5666,7 +6066,7 @@
"dependencies": {
"jsesc": {
"version": "0.5.0",
- "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz",
+ "resolved": "http://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz",
"integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=",
"dev": true
}
@@ -5701,7 +6101,7 @@
},
"require-uncached": {
"version": "1.0.3",
- "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz",
+ "resolved": "http://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz",
"integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=",
"dev": true,
"requires": {
@@ -5762,6 +6162,11 @@
"integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==",
"dev": true
},
+ "retry": {
+ "version": "0.12.0",
+ "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz",
+ "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs="
+ },
"rimraf": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz",
@@ -5849,6 +6254,13 @@
"on-finished": "~2.3.0",
"range-parser": "~1.2.0",
"statuses": "~1.4.0"
+ },
+ "dependencies": {
+ "statuses": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz",
+ "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew=="
+ }
}
},
"serve-static": {
@@ -6135,7 +6547,8 @@
"sprintf-js": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
- "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw="
+ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
+ "dev": true
},
"stack-trace": {
"version": "0.0.10",
@@ -6164,9 +6577,9 @@
}
},
"statuses": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz",
- "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew=="
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
+ "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow="
},
"stream-combiner": {
"version": "0.2.2",
@@ -6178,6 +6591,11 @@
"through": "~2.3.4"
}
},
+ "streamsearch": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-0.1.2.tgz",
+ "integrity": "sha1-gIudDlb8Jz2Am6VzOOkpkZoanxo="
+ },
"string-width": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
@@ -6206,13 +6624,9 @@
}
},
"string_decoder": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
- "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
- "dev": true,
- "requires": {
- "safe-buffer": "~5.1.0"
- }
+ "version": "0.10.31",
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
+ "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ="
},
"strip-ansi": {
"version": "3.0.1",
@@ -6241,12 +6655,39 @@
"integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=",
"dev": true
},
+ "subscriptions-transport-ws": {
+ "version": "0.9.15",
+ "resolved": "https://registry.npmjs.org/subscriptions-transport-ws/-/subscriptions-transport-ws-0.9.15.tgz",
+ "integrity": "sha512-f9eBfWdHsePQV67QIX+VRhf++dn1adyC/PZHP6XI5AfKnZ4n0FW+v5omxwdHVpd4xq2ZijaHEcmlQrhBY79ZWQ==",
+ "requires": {
+ "backo2": "^1.0.2",
+ "eventemitter3": "^3.1.0",
+ "iterall": "^1.2.1",
+ "symbol-observable": "^1.0.4",
+ "ws": "^5.2.0"
+ },
+ "dependencies": {
+ "ws": {
+ "version": "5.2.2",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz",
+ "integrity": "sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==",
+ "requires": {
+ "async-limiter": "~1.0.0"
+ }
+ }
+ }
+ },
"supports-color": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
"dev": true
},
+ "symbol-observable": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz",
+ "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ=="
+ },
"table": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/table/-/table-5.1.0.tgz",
@@ -6478,6 +6919,12 @@
"integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=",
"dev": true
},
+ "isarray": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
+ "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
+ "dev": true
+ },
"isobject": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
@@ -6589,11 +7036,25 @@
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
"dev": true
},
+ "util.promisify": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz",
+ "integrity": "sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA==",
+ "requires": {
+ "define-properties": "^1.1.2",
+ "object.getownpropertydescriptors": "^2.0.3"
+ }
+ },
"utils-merge": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
"integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
},
+ "uuid": {
+ "version": "3.3.2",
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz",
+ "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA=="
+ },
"v8flags": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/v8flags/-/v8flags-2.1.1.tgz",
@@ -6618,11 +7079,6 @@
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
"integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
},
- "whatwg-fetch": {
- "version": "2.0.4",
- "resolved": "http://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz",
- "integrity": "sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng=="
- },
"which": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
@@ -6673,6 +7129,14 @@
"signal-exit": "^3.0.2"
}
},
+ "ws": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-6.1.0.tgz",
+ "integrity": "sha512-H3dGVdGvW2H8bnYpIDc3u3LH8Wue3Qh+Zto6aXXFzvESkTVT6rAfKR6tR/+coaUvxs8yHtmNV0uioBF62ZGSTg==",
+ "requires": {
+ "async-limiter": "~1.0.0"
+ }
+ },
"xdg-basedir": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz",
@@ -6682,8 +7146,20 @@
"yallist": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
- "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=",
- "dev": true
+ "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI="
+ },
+ "zen-observable": {
+ "version": "0.8.11",
+ "resolved": "https://registry.npmjs.org/zen-observable/-/zen-observable-0.8.11.tgz",
+ "integrity": "sha512-N3xXQVr4L61rZvGMpWe8XoCGX8vhU35dPyQ4fm5CY/KDlG0F75un14hjbckPXTDuKUY6V0dqR2giT6xN8Y4GEQ=="
+ },
+ "zen-observable-ts": {
+ "version": "0.8.10",
+ "resolved": "https://registry.npmjs.org/zen-observable-ts/-/zen-observable-ts-0.8.10.tgz",
+ "integrity": "sha512-5vqMtRggU/2GhePC9OU4sYEWOdvmayp2k3gjPf4F0mXwB3CSbbNznfDUvDJx9O2ZTa1EIXdJhPchQveFKwNXPQ==",
+ "requires": {
+ "zen-observable": "^0.8.0"
+ }
}
}
}
diff --git a/server/package.json b/server/package.json
index 73c601f30..c4367cb30 100644
--- a/server/package.json
+++ b/server/package.json
@@ -26,13 +26,11 @@
},
"dependencies": {
"@sentry/node": "^4.1.1",
+ "apollo-server-express": "^2.1.0",
"axios": "^0.18.0",
- "cors": "^2.8.4",
"dotenv": "^6.0.0",
"express": "^4.16.3",
- "express-graphql": "^0.6.12",
- "graphql": "^14.0.0",
- "graphql-playground-middleware-express": "^1.7.6",
+ "graphql": "^0.13.2",
"mongoose": "^5.3.4"
}
}
diff --git a/server/src/app.js b/server/src/app.js
index b36f54aef..a146d25d9 100644
--- a/server/src/app.js
+++ b/server/src/app.js
@@ -1,10 +1,9 @@
import 'dotenv/config';
import express from 'express';
-import cors from 'cors';
-import graphqlHTTP from 'express-graphql';
-import expressPlayground from 'graphql-playground-middleware-express';
+import { ApolloServer } from 'apollo-server-express';
import * as Sentry from '@sentry/node';
import schema from './schema';
+import wrongPreshared from './errors/notAllowed.json';
const app = express();
@@ -12,27 +11,40 @@ const app = express();
Sentry.init({ dsn: process.env.SENTRY_DNS });
app.use(Sentry.Handlers.requestHandler());
-// authorising CORS
-app.use(cors());
+app.post('/graphql', (req, res, next) => {
+ if (req.headers.preshared === process.env.PRESHARED_GATEWAY_KEY) {
+ next();
+ } else {
+ res.send(wrongPreshared);
+ }
+});
+
// Starting the graphql server
-app.use('/graphql', graphqlHTTP(req => ({
+const server = new ApolloServer({
schema,
- context: {
+ playground: {
+ settings: {
+ 'editor.theme': 'dark',
+ 'editor.cursorShape': 'line',
+ },
+ },
+ context: ({ req }) => ({
userId: req.headers.userid,
authorization: req.headers.authorization,
- },
- formatError(err) {
- return {
- message: err.message,
- code: err.originalError && err.originalError.code,
- path: err.path,
- };
- },
-})));
+ }),
+ formatError: error => ({
+ code: error.extensions.exception.code,
+ message: error.message,
+ path: error.path,
+ }),
+ introspection: true,
+});
-// Starting the graphql server
-app.get('/playground', expressPlayground({ endpoint: '/graphql' }));
+server.applyMiddleware({
+ app,
+ cors: true,
+});
// Sentry error handling middleware if anything pass through
app.use(Sentry.Handlers.errorHandler());
diff --git a/server/src/db.js b/server/src/db.js
index 4492e884f..4ed47a0c2 100644
--- a/server/src/db.js
+++ b/server/src/db.js
@@ -2,6 +2,8 @@ import 'dotenv/config';
import mongoose from 'mongoose';
mongoose.connect(`mongodb://${process.env.DB_USERNAME}:${process.env.DB_PASSWORD}@${process.env.DB_DOMAIN}`, { useNewUrlParser: true });
+mongoose.set('useCreateIndex', true);
+mongoose.set('useFindAndModify', false);
mongoose.Promise = global.Promise;
const db = mongoose.connection;
diff --git a/server/src/enums/EventStatus.js b/server/src/enums/EventState.js
similarity index 73%
rename from server/src/enums/EventStatus.js
rename to server/src/enums/EventState.js
index 50a4bc53e..4541a47ef 100644
--- a/server/src/enums/EventStatus.js
+++ b/server/src/enums/EventState.js
@@ -4,14 +4,16 @@ export const CANCELLED = 'CANCELLED';
export const RUNNING = 'RUNNING';
export const INTERRUPTED = 'INTERRUPTED';
export const FINISHED = 'FINISHED';
+export const ARCHIVED = 'ARCHIVED';
-export const EventStatusEnum = [
+export const EventStateEnum = [
UNPUBLISHED,
PUBLISHED,
CANCELLED,
RUNNING,
INTERRUPTED,
FINISHED,
+ ARCHIVED,
];
-export default EventStatusEnum;
+export default EventStateEnum;
diff --git a/server/src/errors/notAllowed.json b/server/src/errors/notAllowed.json
new file mode 100644
index 000000000..b76604aa2
--- /dev/null
+++ b/server/src/errors/notAllowed.json
@@ -0,0 +1,8 @@
+{
+ "errors": [
+ {
+ "code": 401,
+ "message": "Wait, you're not supposed to be here, go through the gate as everyone else"
+ }
+ ]
+}
diff --git a/server/src/models/event.js b/server/src/models/event.js
index c72ce3187..c95ef5744 100644
--- a/server/src/models/event.js
+++ b/server/src/models/event.js
@@ -3,45 +3,98 @@ import Plotter from './plotter';
import Formula from './formula';
import {
UNPUBLISHED,
- EventStatusEnum,
-} from '../enums/EventStatus';
+ EventStateEnum,
+} from '../enums/EventState';
+
+const { ObjectId } = Schema.Types;
const eventSchema = new Schema({
- designator: { type: String, required: true },
- status: { type: String, enum: EventStatusEnum, default: UNPUBLISHED },
- name: { type: String, required: true },
- hostId: { type: String, required: true },
- description: String,
- startDatetime: { type: Number, required: true },
- finishDatetime: { type: Number, required: true },
- formula: { type: Schema.Types.ObjectId, ref: Formula.modelName },
- plotter: { type: Schema.Types.ObjectId, ref: Plotter.modelName },
+ state: {
+ type: String,
+ enum: EventStateEnum,
+ default: UNPUBLISHED,
+ },
+ name: {
+ type: String,
+ required: true,
+ },
+ hostId: {
+ type: String,
+ required: true,
+ },
+ description: {
+ type: String,
+ },
+ startDatetime: {
+ type: Number,
+ required: true,
+ },
+ finishDatetime: {
+ type: Number,
+ required: true,
+ },
+ formulaId: {
+ type: ObjectId,
+ ref: Formula.modelName,
+ },
+ plotterId: {
+ type: ObjectId,
+ ref: Plotter.modelName,
+ },
rules: [{
- position: { type: Number, required: true },
- title: { type: String, required: true },
- description: String,
+ position: {
+ type: Number,
+ required: true,
+ },
+ title: {
+ type: String,
+ required: true,
+ },
+ description: {
+ type: String,
+ },
}],
prizes: [{
- rank: { type: Number, required: true },
- amount: { type: Number, required: true },
+ rank: {
+ type: Number,
+ required: true,
+ },
+ amount: {
+ type: Number,
+ required: true,
+ },
additional: [{
condition: String,
- amount: { type: Number, required: true },
- asset: { type: String, required: true },
+ amount: {
+ type: Number,
+ required: true,
+ },
+ asset: {
+ type: String,
+ required: true,
+ },
}],
}],
participants: [{
- teamId: { type: String, required: true },
+ teamId: {
+ type: String,
+ required: true,
+ },
botId: String,
releaseId: String,
}],
});
eventSchema.pre('find', function populate() {
- this.populate('formula').populate('plotter');
+ this.populate('formulaId').populate('plotterId');
});
eventSchema.post('save', (doc, next) => {
- doc.populate('formula').populate('plotter').execPopulate().then(() => {
+ doc.populate('formulaId').populate('plotterId').execPopulate().then(() => {
+ next();
+ });
+});
+eventSchema.post('findOneAndUpdate', (doc, next) => {
+ doc.populate('formulaId').populate('plotterId').execPopulate().then(() => {
next();
});
});
diff --git a/server/src/models/formula.js b/server/src/models/formula.js
index 43132bbf2..ccc774334 100644
--- a/server/src/models/formula.js
+++ b/server/src/models/formula.js
@@ -1,9 +1,18 @@
import mongoose, { Schema } from 'mongoose';
const formulaSchema = new Schema({
- ownerId: { type: String, required: true },
- isTemplate: { type: Boolean, default: false },
- name: { type: String, required: true },
+ ownerId: {
+ type: String,
+ required: true,
+ },
+ isTemplate: {
+ type: Boolean,
+ default: false,
+ },
+ name: {
+ type: String,
+ required: true,
+ },
});
const Formula = mongoose.model('Formula', formulaSchema);
diff --git a/server/src/models/plotter.js b/server/src/models/plotter.js
index 77f274206..a9a7feb92 100644
--- a/server/src/models/plotter.js
+++ b/server/src/models/plotter.js
@@ -1,12 +1,30 @@
import mongoose, { Schema } from 'mongoose';
const plotterSchema = new Schema({
- ownerId: { type: String, required: true },
- isTemplate: { type: Boolean, default: false },
- name: { type: String, required: true },
- host: { type: String, required: true },
- repo: { type: String, required: true },
- moduleName: { type: String, required: true },
+ ownerId: {
+ type: String,
+ required: true,
+ },
+ isTemplate: {
+ type: Boolean,
+ default: false,
+ },
+ name: {
+ type: String,
+ required: true,
+ },
+ host: {
+ type: String,
+ required: true,
+ },
+ repo: {
+ type: String,
+ required: true,
+ },
+ moduleName: {
+ type: String,
+ required: true,
+ },
});
const Plotter = mongoose.model('Plotter', plotterSchema);
diff --git a/server/src/schema/mutations/AddPrize.js b/server/src/schema/mutations/AddPrize.js
deleted file mode 100644
index ff22e69ab..000000000
--- a/server/src/schema/mutations/AddPrize.js
+++ /dev/null
@@ -1,62 +0,0 @@
-import {
- GraphQLNonNull,
- GraphQLID,
- GraphQLInt,
-} from 'graphql';
-import {
- AuthentificationError,
- DatabaseError,
- WrongArgumentsError,
-} from '../../errors';
-import { EventType } from '../types';
-import { Event } from '../../models';
-
-const args = {
- eventDesignator: { type: new GraphQLNonNull(GraphQLID) },
- rank: { type: new GraphQLNonNull(GraphQLInt) },
- amount: { type: new GraphQLNonNull(GraphQLInt) },
-};
-
-const resolve = (parent, { eventDesignator, rank, amount }, context) => {
- const hostId = context.userId;
- if (!hostId) {
- throw new AuthentificationError();
- }
- return new Promise((res, rej) => {
- Event.findOne({ designator: eventDesignator, hostId }).exec((err, event) => {
- if (err) {
- rej(err);
- return;
- }
- if (!event) {
- rej(new DatabaseError('None of the events you own respond to that designator'));
- return;
- }
- if (event.prizes.some(prize => prize.rank === rank)) {
- rej(new WrongArgumentsError('A prize for that rank already exists'));
- return;
- }
- event.prizes.push({
- rank,
- amount,
- });
- event.save((error) => {
- if (error) {
- rej(error);
- return;
- }
- res(event);
- });
- });
- });
-};
-
-const mutation = {
- addPrize: {
- type: EventType,
- args,
- resolve,
- },
-};
-
-export default mutation;
diff --git a/server/src/schema/mutations/AddRule.js b/server/src/schema/mutations/AddRule.js
deleted file mode 100644
index c7b43cdb5..000000000
--- a/server/src/schema/mutations/AddRule.js
+++ /dev/null
@@ -1,70 +0,0 @@
-import {
- GraphQLNonNull,
- GraphQLID,
- GraphQLString,
-} from 'graphql';
-import {
- AuthentificationError,
- DatabaseError,
- WrongArgumentsError,
-} from '../../errors';
-import { EventType } from '../types';
-import { Event } from '../../models';
-
-const args = {
- eventDesignator: { type: new GraphQLNonNull(GraphQLID) },
- title: { type: new GraphQLNonNull(GraphQLString) },
- description: { type: new GraphQLNonNull(GraphQLString) },
-};
-
-const resolve = (parent, { eventDesignator, title, description }, context) => {
- const hostId = context.userId;
- if (!hostId) {
- throw new AuthentificationError();
- }
- return new Promise((res, rej) => {
- Event.findOne({ designator: eventDesignator, hostId }).exec((err, event) => {
- if (err) {
- rej(err);
- return;
- }
- if (!event) {
- rej(new DatabaseError('None of the events you own respond to that designator'));
- return;
- }
- if (event.rules.some(rule => rule.title === title)) {
- rej(new WrongArgumentsError('A prize for that rank already exists'));
- return;
- }
- const isFree = pos => event.rules.some(rule => rule.pos === pos);
- let position = 1;
- let shouldGrow = isFree(position);
- while (shouldGrow) {
- position += 1;
- shouldGrow = isFree(position);
- }
- event.rules.push({
- position,
- title,
- description,
- });
- event.save((error) => {
- if (error) {
- rej(error);
- return;
- }
- res(event);
- });
- });
- });
-};
-
-const mutation = {
- addRule: {
- type: EventType,
- args,
- resolve,
- },
-};
-
-export default mutation;
diff --git a/server/src/schema/mutations/ChangeEventState.js b/server/src/schema/mutations/ChangeEventState.js
new file mode 100644
index 000000000..ada9367b8
--- /dev/null
+++ b/server/src/schema/mutations/ChangeEventState.js
@@ -0,0 +1,39 @@
+import {
+ GraphQLNonNull,
+ GraphQLID,
+} from 'graphql';
+import { AuthentificationError } from '../../errors';
+import { EventType } from '../types';
+import { Event } from '../../models';
+import EventStateEnum from '../types/enum/EventState';
+
+const args = {
+ eventId: { type: new GraphQLNonNull(GraphQLID) },
+ state: { type: EventStateEnum },
+};
+
+const resolve = (parent, { eventId: _id, state }, { userId: hostId }) => {
+ if (!hostId) {
+ throw new AuthentificationError();
+ }
+
+ return new Promise((res, rej) => {
+ Event.findOneAndUpdate({ _id, hostId }, { state }, { new: true }, (err, modifiedEvent) => {
+ if (err) {
+ rej(err);
+ return;
+ }
+ res(modifiedEvent);
+ });
+ });
+};
+
+const mutation = {
+ changeEventState: {
+ type: EventType,
+ args,
+ resolve,
+ },
+};
+
+export default mutation;
diff --git a/server/src/schema/mutations/CreateAndSetFormula.js b/server/src/schema/mutations/CreateAndSetFormula.js
deleted file mode 100644
index d1d45970f..000000000
--- a/server/src/schema/mutations/CreateAndSetFormula.js
+++ /dev/null
@@ -1,56 +0,0 @@
-import {
- GraphQLNonNull,
- GraphQLString,
-} from 'graphql';
-import { AuthentificationError, DatabaseError } from '../../errors';
-import { EventType } from '../types';
-import { Event, Formula } from '../../models';
-
-const args = {
- eventDesignator: { type: new GraphQLNonNull(GraphQLString) },
- name: { type: new GraphQLNonNull(GraphQLString) },
-};
-
-const resolve = (parent, { name, eventDesignator }, context) => {
- const ownerId = context.userId;
- if (!ownerId) {
- throw new AuthentificationError();
- }
- const newFormula = new Formula({ name, ownerId });
- return new Promise((res, reject) => {
- Event.findOne({ designator: eventDesignator, hostId: ownerId }).exec((err, event) => {
- if (err) {
- reject(err);
- return;
- }
- if (!event) {
- reject(new DatabaseError('None of the events you own respond to that designator'));
- return;
- }
- newFormula.save((error) => {
- if (error) {
- reject(error);
- return;
- }
- event.formula = newFormula._id;
- event.save((eventError) => {
- if (eventError) {
- reject(eventError);
- return;
- }
- res(event);
- });
- });
- });
- });
-};
-
-const mutation = {
- createAndSetFormula: {
- type: EventType,
- args,
- resolve,
- },
-};
-
-export default mutation;
diff --git a/server/src/schema/mutations/CreateAndSetPlotter.js b/server/src/schema/mutations/CreateAndSetPlotter.js
deleted file mode 100644
index 11cbfe846..000000000
--- a/server/src/schema/mutations/CreateAndSetPlotter.js
+++ /dev/null
@@ -1,65 +0,0 @@
-import {
- GraphQLNonNull,
- GraphQLString,
-} from 'graphql';
-import { AuthentificationError, DatabaseError } from '../../errors';
-import { EventType } from '../types';
-import { Event, Plotter } from '../../models';
-
-const args = {
- eventDesignator: { type: new GraphQLNonNull(GraphQLString) },
- name: { type: new GraphQLNonNull(GraphQLString) },
- host: { type: new GraphQLNonNull(GraphQLString) },
- repo: { type: new GraphQLNonNull(GraphQLString) },
- moduleName: { type: new GraphQLNonNull(GraphQLString) },
-};
-
-const resolve = (parent, {
- name, host, repo, moduleName, eventDesignator,
-}, context) => {
- const ownerId = context.userId;
- if (!ownerId) {
- throw new AuthentificationError();
- }
- const newPlotter = new Plotter({
- name, host, repo, moduleName, ownerId,
- });
- return new Promise((res, rej) => {
- Event.findOne({ designator: eventDesignator, hostId: ownerId }).exec((err, event) => {
- if (err) {
- rej(err);
- return;
- }
- if (!event) {
- rej(new DatabaseError('None of the events you own respond to that designator'));
- return;
- }
-
- newPlotter.save((error) => {
- if (error) {
- rej(error);
- return;
- }
-
- event.plotter = newPlotter._id;
- event.save((eventError) => {
- if (eventError) {
- rej(eventError);
- return;
- }
- res(event);
- });
- });
- });
- });
-};
-
-const mutation = {
- createAndSetPlotter: {
- type: EventType,
- args,
- resolve,
- },
-};
-
-export default mutation;
diff --git a/server/src/schema/mutations/CreateEvent.js b/server/src/schema/mutations/CreateEvent.js
new file mode 100644
index 000000000..2704f53e7
--- /dev/null
+++ b/server/src/schema/mutations/CreateEvent.js
@@ -0,0 +1,37 @@
+import { AuthentificationError } from '../../errors';
+import { EventType } from '../types';
+import { Event } from '../../models';
+import { EventInputType } from '../types/input';
+
+export const args = {
+ event: { type: EventInputType },
+};
+
+const resolve = (parent, { event }, { userId: hostId }) => {
+ if (!hostId) {
+ throw new AuthentificationError();
+ }
+
+ event.hostId = hostId;
+ const newEvent = new Event(event);
+
+ return new Promise((res, rej) => {
+ newEvent.save((err) => {
+ if (err) {
+ rej(err);
+ return;
+ }
+ res(newEvent);
+ });
+ });
+};
+
+const mutation = {
+ createEvent: {
+ type: EventType,
+ args,
+ resolve,
+ },
+};
+
+export default mutation;
diff --git a/server/src/schema/mutations/CreateFormula.js b/server/src/schema/mutations/CreateFormula.js
index 4ff97b8c1..198c1fd0e 100644
--- a/server/src/schema/mutations/CreateFormula.js
+++ b/server/src/schema/mutations/CreateFormula.js
@@ -1,21 +1,20 @@
-import {
- GraphQLNonNull,
- GraphQLString,
-} from 'graphql';
import { AuthentificationError } from '../../errors';
import { FormulaType } from '../types';
import { Formula } from '../../models';
+import { FormulaInputType } from '../types/input';
const args = {
- name: { type: new GraphQLNonNull(GraphQLString) },
+ formula: { type: FormulaInputType },
};
-const resolve = (parent, { name }, context) => {
- const ownerId = context.userId;
+const resolve = (parent, { formula }, { userId: ownerId }) => {
if (!ownerId) {
throw new AuthentificationError();
}
- const newFormula = new Formula({ name, ownerId });
+
+ formula.ownerId = ownerId;
+ const newFormula = new Formula(formula);
+
return new Promise((res, rej) => {
newFormula.save((err) => {
if (err) {
diff --git a/server/src/schema/mutations/CreatePlotter.js b/server/src/schema/mutations/CreatePlotter.js
index a4fcdf26a..6cf060fbf 100644
--- a/server/src/schema/mutations/CreatePlotter.js
+++ b/server/src/schema/mutations/CreatePlotter.js
@@ -1,28 +1,20 @@
-import {
- GraphQLNonNull,
- GraphQLString,
-} from 'graphql';
import { AuthentificationError } from '../../errors';
import { PlotterType } from '../types';
import { Plotter } from '../../models';
+import { PlotterInputType } from '../types/input';
const args = {
- name: { type: new GraphQLNonNull(GraphQLString) },
- host: { type: new GraphQLNonNull(GraphQLString) },
- repo: { type: new GraphQLNonNull(GraphQLString) },
- moduleName: { type: new GraphQLNonNull(GraphQLString) },
+ plotter: { type: PlotterInputType },
};
-const resolve = (parent, {
- name, host, repo, moduleName,
-}, context) => {
- const ownerId = context.userId;
+const resolve = (parent, { plotter }, { userId: ownerId }) => {
if (!ownerId) {
throw new AuthentificationError();
}
- const newPlotter = new Plotter({
- name, host, repo, moduleName, ownerId,
- });
+
+ plotter.ownerId = ownerId;
+ const newPlotter = new Plotter(plotter);
+
return new Promise((res, reject) => {
newPlotter.save((err) => {
if (err) {
diff --git a/server/src/schema/mutations/EditEvent.js b/server/src/schema/mutations/EditEvent.js
index e60cf6cbd..093376207 100644
--- a/server/src/schema/mutations/EditEvent.js
+++ b/server/src/schema/mutations/EditEvent.js
@@ -1,54 +1,29 @@
import {
GraphQLNonNull,
GraphQLID,
- GraphQLInt,
- GraphQLString,
} from 'graphql';
-import { AuthentificationError, DatabaseError } from '../../errors';
+import { AuthentificationError } from '../../errors';
import { EventType } from '../types';
import { Event } from '../../models';
+import { EventInputType } from '../types/input';
const args = {
- designator: { type: new GraphQLNonNull(GraphQLID) },
- name: { type: GraphQLString },
- description: { type: GraphQLString },
- startDatetime: { type: GraphQLInt },
- finishDatetime: { type: GraphQLInt },
- formulaId: { type: GraphQLString },
- plotterId: { type: GraphQLString },
+ eventId: { type: new GraphQLNonNull(GraphQLID) },
+ event: { type: EventInputType },
};
-const resolve = (parent, {
- designator, name, description, startDatetime, finishDatetime, formulaId, plotterId,
-}, context) => {
- const hostId = context.userId;
+const resolve = (parent, { eventId: _id, event }, { userId: hostId }) => {
if (!hostId) {
throw new AuthentificationError();
}
+
return new Promise((res, rej) => {
- Event.findOne({ designator, hostId }).exec((err, event) => {
+ Event.findOneAndUpdate({ _id, hostId }, event, { new: true }, (err, modifiedEvent) => {
if (err) {
rej(err);
return;
}
- if (!event) {
- rej(new DatabaseError('None of the events you own respond to that designator'));
- return;
- }
- event.name = name || event.name;
- event.description = description || event.description;
- event.startDatetime = startDatetime || event.startDatetime;
- event.finishDatetime = finishDatetime || event.finishDatetime;
- event.formula = formulaId || event.formula;
- event.plotter = plotterId || event.plotter;
-
- event.save((error) => {
- if (error) {
- rej(error);
- return;
- }
- res(event);
- });
+ res(modifiedEvent);
});
});
};
diff --git a/server/src/schema/mutations/EditParticipant.js b/server/src/schema/mutations/EditParticipant.js
index 0abb8db32..a241f34b4 100644
--- a/server/src/schema/mutations/EditParticipant.js
+++ b/server/src/schema/mutations/EditParticipant.js
@@ -1,7 +1,6 @@
import {
GraphQLNonNull,
GraphQLID,
- GraphQLString,
} from 'graphql';
import axios from 'axios';
import {
@@ -11,45 +10,40 @@ import {
} from '../../errors';
import { EventType } from '../types';
import { Event } from '../../models';
+import { ParticipantInputType } from '../types/input';
const args = {
- eventDesignator: { type: new GraphQLNonNull(GraphQLID) },
- teamId: { type: new GraphQLNonNull(GraphQLString) },
- botId: { type: GraphQLString },
- releaseId: { type: GraphQLString },
+ eventId: { type: new GraphQLNonNull(GraphQLID) },
+ participant: { type: ParticipantInputType },
};
-const resolve = (parent, {
- eventDesignator, teamId, botId, releaseId,
-}, context) => {
- const userid = context.userId;
- if (!userid) {
+const resolve = (parent,
+ { eventId: _id, participant: { teamId, botId, releaseId } },
+ { userId, authorization }) => {
+ if (!userId) {
throw new AuthentificationError();
}
return new Promise((res, rej) => {
axios({
- url: process.env.TEAMS_ENDPOINT,
+ url: process.env.GATEWAY_ENDPOINT,
method: 'post',
data: {
query: `
{
- teamsByRole{
+ teams_TeamsByRole{
id
}
}
`,
},
- headers: {
- userid,
- authorization: context.authorization,
- },
+ headers: { authorization },
}).then(
(result) => {
if (!result.data.data.teamsByRole.some(team => team.id === teamId)) {
- rej(new WrongArgumentsError('You are not eligible to register this team'));
+ rej(new WrongArgumentsError('You are not eligible to edit this team'));
return;
}
- Event.findOne({ designator: eventDesignator }).exec((err, event) => {
+ Event.findOne({ _id }).exec((err, event) => {
if (err) {
rej(err);
return;
diff --git a/server/src/schema/mutations/EditPrize.js b/server/src/schema/mutations/EditPrize.js
deleted file mode 100644
index 279733d85..000000000
--- a/server/src/schema/mutations/EditPrize.js
+++ /dev/null
@@ -1,56 +0,0 @@
-import {
- GraphQLNonNull,
- GraphQLID,
- GraphQLInt,
-} from 'graphql';
-import { AuthentificationError, DatabaseError } from '../../errors';
-import { EventType } from '../types';
-import { Event } from '../../models';
-
-const args = {
- eventDesignator: { type: new GraphQLNonNull(GraphQLID) },
- rank: { type: new GraphQLNonNull(GraphQLInt) },
- amount: { type: GraphQLInt },
-};
-
-const resolve = (parent, { eventDesignator, rank, amount }, context) => {
- const hostId = context.userId;
- if (!hostId) {
- throw new AuthentificationError();
- }
- return new Promise((res, rej) => {
- Event.findOne({ designator: eventDesignator, hostId }).exec((err, event) => {
- if (err) {
- rej(err);
- return;
- }
- if (!event) {
- rej(new DatabaseError('None of the events you own respond to that designator'));
- return;
- }
- const prizeIndex = event.prizes.findIndex(prize => prize.rank === rank);
- if (!prizeIndex) {
- rej(new DatabaseError('There is no prize for that index'));
- return;
- }
- event.prizes[prizeIndex].amount = amount || event.prizes[prizeIndex].amount;
- event.save((error) => {
- if (error) {
- rej(error);
- return;
- }
- res(event);
- });
- });
- });
-};
-
-const mutation = {
- editPrize: {
- type: EventType,
- args,
- resolve,
- },
-};
-
-export default mutation;
diff --git a/server/src/schema/mutations/EditRule.js b/server/src/schema/mutations/EditRule.js
deleted file mode 100644
index c931151ce..000000000
--- a/server/src/schema/mutations/EditRule.js
+++ /dev/null
@@ -1,64 +0,0 @@
-import {
- GraphQLNonNull,
- GraphQLID,
- GraphQLString,
-} from 'graphql';
-import { AuthentificationError, DatabaseError, WrongArgumentsError } from '../../errors';
-import { EventType } from '../types';
-import { Event } from '../../models';
-
-const args = {
- eventDesignator: { type: new GraphQLNonNull(GraphQLID) },
- title: { type: new GraphQLNonNull(GraphQLString) },
- newtitle: { type: GraphQLString },
- description: { type: GraphQLString },
-};
-
-const resolve = (parent, {
- eventDesignator, title, newtitle, description,
-}, context) => {
- const hostId = context.userId;
- if (!hostId) {
- throw new AuthentificationError();
- }
- return new Promise((res, rej) => {
- Event.findOne({ designator: eventDesignator, hostId }).exec((err, event) => {
- if (err) {
- rej(err);
- return;
- }
- if (!event) {
- rej(new DatabaseError('None of the events you own respond to that designator'));
- return;
- }
- const ruleIndex = event.rules.findIndex(rule => rule.title === title);
- if (!ruleIndex) {
- rej(new DatabaseError('There is no rule with that title'));
- return;
- }
- event.rules[ruleIndex].description = description || event.rules[ruleIndex].description;
- if (event.rules.some(rule => rule.title === newtitle)) {
- rej(new WrongArgumentsError('There is already a rule using your new title'));
- return;
- }
- event.rules[ruleIndex].title = newtitle || event.rules[ruleIndex].title;
- event.save((error) => {
- if (error) {
- rej(error);
- return;
- }
- res(event);
- });
- });
- });
-};
-
-const mutation = {
- editRule: {
- type: EventType,
- args,
- resolve,
- },
-};
-
-export default mutation;
diff --git a/server/src/schema/mutations/HostEvent.js b/server/src/schema/mutations/HostEvent.js
deleted file mode 100644
index 13fd6b494..000000000
--- a/server/src/schema/mutations/HostEvent.js
+++ /dev/null
@@ -1,52 +0,0 @@
-import {
- GraphQLNonNull,
- GraphQLInt,
- GraphQLString,
-} from 'graphql';
-import { AuthentificationError } from '../../errors';
-import { EventType } from '../types';
-import { Event } from '../../models';
-import { slugify } from '../../utils/functions';
-
-const args = {
- name: { type: new GraphQLNonNull(GraphQLString) },
- description: { type: new GraphQLNonNull(GraphQLString) },
- startDatetime: { type: new GraphQLNonNull(GraphQLInt) },
- finishDatetime: { type: new GraphQLNonNull(GraphQLInt) },
-};
-
-const resolve = (parent, {
- name, description, startDatetime, finishDatetime,
-}, context) => {
- const hostId = context.userId;
- if (!hostId) {
- throw new AuthentificationError();
- }
- const newEvent = new Event({
- hostId,
- name,
- description,
- startDatetime,
- finishDatetime,
- });
- newEvent.designator = `${slugify(newEvent.name)}-${newEvent._id}`;
- return new Promise((res, rej) => {
- newEvent.save((err) => {
- if (err) {
- rej(err);
- return;
- }
- res(newEvent);
- });
- });
-};
-
-const mutation = {
- hostEvent: {
- type: EventType,
- args,
- resolve,
- },
-};
-
-export default mutation;
diff --git a/server/src/schema/mutations/RegisterToEvent.js b/server/src/schema/mutations/RegisterToEvent.js
index 7b3ee5050..445e26628 100644
--- a/server/src/schema/mutations/RegisterToEvent.js
+++ b/server/src/schema/mutations/RegisterToEvent.js
@@ -2,7 +2,6 @@ import 'dotenv/config';
import {
GraphQLNonNull,
GraphQLID,
- GraphQLString,
} from 'graphql';
import axios from 'axios';
import {
@@ -12,45 +11,40 @@ import {
} from '../../errors';
import { EventType } from '../types';
import { Event } from '../../models';
+import { ParticipantInputType } from '../types/input';
const args = {
- designator: { type: new GraphQLNonNull(GraphQLID) },
- teamId: { type: new GraphQLNonNull(GraphQLString) },
- botId: { type: GraphQLString },
- releaseId: { type: GraphQLString },
+ eventId: { type: new GraphQLNonNull(GraphQLID) },
+ participant: { type: ParticipantInputType },
};
-const resolve = (parent, {
- designator, teamId, botId, releaseId,
-}, context) => {
- const userid = context.userId;
- if (!userid) {
+const resolve = (parent,
+ { eventId: _id, participant: { teamId, botId, releaseId } },
+ { userId, authorization }) => {
+ if (!userId) {
throw new AuthentificationError();
}
return new Promise((res, rej) => {
axios({
- url: process.env.TEAMS_ENDPOINT,
+ url: process.env.GATEWAY_ENDPOINT,
method: 'post',
data: {
query: `
{
- teamsByRole{
+ teams_TeamsByRole{
id
}
}
`,
},
- headers: {
- userid,
- authorization: context.authorization,
- },
+ headers: { authorization },
}).then(
(result) => {
if (!result.data.data.teamsByRole.some(team => team.id === teamId)) {
rej(new WrongArgumentsError('You are not eligible to register this team'));
return;
}
- Event.findOne({ designator }).exec((err, event) => {
+ Event.findOne({ _id }).exec((err, event) => {
if (err) {
rej(err);
return;
diff --git a/server/src/schema/mutations/ReorderRules.js b/server/src/schema/mutations/ReorderRules.js
deleted file mode 100644
index 8f16546aa..000000000
--- a/server/src/schema/mutations/ReorderRules.js
+++ /dev/null
@@ -1,60 +0,0 @@
-import {
- GraphQLNonNull,
- GraphQLID,
- GraphQLInt,
-} from 'graphql';
-import { AuthentificationError, DatabaseError } from '../../errors';
-import { isBetween } from '../../utils/functions';
-import { EventType } from '../types';
-import { Event } from '../../models';
-
-const args = {
- eventDesignator: { type: new GraphQLNonNull(GraphQLID) },
- fromPosition: { type: new GraphQLNonNull(GraphQLInt) },
- toPosition: { type: new GraphQLNonNull(GraphQLInt) },
-};
-
-const resolve = (parent, { eventDesignator, fromPosition, toPosition }, context) => {
- const hostId = context.userId;
- if (!hostId) {
- throw new AuthentificationError();
- }
- return new Promise((res, rej) => {
- Event.findOne({ designator: eventDesignator, hostId: context.userId }).exec((err, event) => {
- if (err) {
- rej(err);
- return;
- }
- if (!event) {
- rej(new DatabaseError('None of the events you own respond to that designator'));
- return;
- }
- const delta = fromPosition > toPosition ? 1 : -1;
- event.rules.forEach((part) => {
- if (part.position === fromPosition) {
- part.position = toPosition;
- } else if (isBetween(part.position, fromPosition, toPosition)) {
- part.position += delta;
- }
- });
-
- event.save((error) => {
- if (error) {
- rej(error);
- return;
- }
- res(event);
- });
- });
- });
-};
-
-const mutation = {
- reorderRules: {
- type: EventType,
- args,
- resolve,
- },
-};
-
-export default mutation;
diff --git a/server/src/schema/mutations/index.js b/server/src/schema/mutations/index.js
index ffefe7dcf..2bd29dc34 100644
--- a/server/src/schema/mutations/index.js
+++ b/server/src/schema/mutations/index.js
@@ -2,36 +2,24 @@ import {
GraphQLObjectType,
} from 'graphql';
-import HostEventMutation from './HostEvent';
+import CreateEventMutation from './CreateEvent';
import EditEventMutation from './EditEvent';
import RegisterToEventMutation from './RegisterToEvent';
import EditParticipantMutation from './EditParticipant';
-import AddRuleMutation from './AddRule';
-import EditRuleMutation from './EditRule';
-import ReorderRulesMutation from './ReorderRules';
-import AddPrizeMutation from './AddPrize';
-import EditPrizeMutation from './EditPrize';
import CreateFormulaMutation from './CreateFormula';
-import CreateAndSetFormulaMutation from './CreateAndSetFormula';
import CreatePlotterMutation from './CreatePlotter';
-import CreateAndSetPlotterMutation from './CreateAndSetPlotter';
+import ChangeEventStateMutation from './ChangeEventState';
const Mutation = new GraphQLObjectType({
name: 'Mutation',
fields: Object.assign(
- HostEventMutation,
+ CreateEventMutation,
EditEventMutation,
RegisterToEventMutation,
EditParticipantMutation,
- AddRuleMutation,
- EditRuleMutation,
- ReorderRulesMutation,
- AddPrizeMutation,
- EditPrizeMutation,
CreateFormulaMutation,
- CreateAndSetFormulaMutation,
CreatePlotterMutation,
- CreateAndSetPlotterMutation,
+ ChangeEventStateMutation,
),
});
diff --git a/server/src/schema/queries/Event.js b/server/src/schema/queries/Event.js
index c35d48f47..590aac259 100644
--- a/server/src/schema/queries/Event.js
+++ b/server/src/schema/queries/Event.js
@@ -7,17 +7,17 @@ import { EventType } from '../types';
import { Event } from '../../models';
const args = {
- designator: { type: new GraphQLNonNull(GraphQLID) },
+ eventId: { type: new GraphQLNonNull(GraphQLID) },
};
-const resolve = (parent, { designator }) => new Promise((res, rej) => {
- Event.findOne({ designator }).exec((err, event) => {
+const resolve = (parent, { eventId: _id }) => new Promise((res, rej) => {
+ Event.findOne({ _id }).exec((err, event) => {
if (err) {
rej(err);
return;
}
if (!event) {
- rej(new DatabaseError('None of the events respond to that designator'));
+ rej(new DatabaseError('None of the events respond to that id'));
return;
}
res(event);
diff --git a/server/src/schema/queries/Events.js b/server/src/schema/queries/Events.js
index c5b1b5e9f..fae289a5b 100644
--- a/server/src/schema/queries/Events.js
+++ b/server/src/schema/queries/Events.js
@@ -4,6 +4,7 @@ import {
} from 'graphql';
import { EventType } from '../types';
import { Event } from '../../models';
+import { UNPUBLISHED, ARCHIVED } from '../../enums/EventState';
const args = {
minDate: { type: GraphQLInt },
@@ -12,6 +13,7 @@ const args = {
const resolve = (parent, { minDate, maxDate }) => Event.find(
Object.assign(
+ { state: { $nin: [UNPUBLISHED, ARCHIVED] } },
minDate || maxDate
? {
startDatetime:
diff --git a/server/src/schema/queries/EventsByHost.js b/server/src/schema/queries/EventsByHost.js
index ac4975f40..6941570d4 100644
--- a/server/src/schema/queries/EventsByHost.js
+++ b/server/src/schema/queries/EventsByHost.js
@@ -5,6 +5,7 @@ import {
} from 'graphql';
import { EventType } from '../types';
import { Event } from '../../models';
+import { UNPUBLISHED, ARCHIVED } from '../../enums/EventState';
const args = {
hostId: { type: GraphQLString },
@@ -14,7 +15,7 @@ const args = {
const resolve = (parent, { hostId, minDate, maxDate }, context) => Event.find(
Object.assign(
- hostId ? { hostId } : { hostId: context.userId },
+ hostId ? { hostId, state: { $nin: [UNPUBLISHED, ARCHIVED] } } : { hostId: context.userId },
minDate || maxDate
? {
startDatetime:
diff --git a/server/src/schema/queries/EventsByTeam.js b/server/src/schema/queries/EventsByTeam.js
index 10a914288..e9147e9b9 100644
--- a/server/src/schema/queries/EventsByTeam.js
+++ b/server/src/schema/queries/EventsByTeam.js
@@ -6,6 +6,7 @@ import {
} from 'graphql';
import { EventType } from '../types';
import { Event } from '../../models';
+import { UNPUBLISHED, ARCHIVED } from '../../enums/EventState';
const args = {
teamId: { type: new GraphQLNonNull(GraphQLString) },
@@ -15,7 +16,11 @@ const args = {
const resolve = (parent, { teamId, minDate, maxDate }) => Event.find(
Object.assign(
- { participants: { $elemMatch: { teamId } } },
+ {
+ participants: { $elemMatch: { teamId } },
+ state: { $nin: [UNPUBLISHED, ARCHIVED] },
+ },
+
minDate || maxDate
? {
startDatetime:
diff --git a/server/src/schema/types/AdditionalPrize.js b/server/src/schema/types/AdditionalPrize.js
index ee3a791ff..1c888b687 100644
--- a/server/src/schema/types/AdditionalPrize.js
+++ b/server/src/schema/types/AdditionalPrize.js
@@ -1,15 +1,17 @@
import {
GraphQLObjectType,
+ GraphQLNonNull,
GraphQLString,
GraphQLInt,
} from 'graphql';
const AdditionalPrizeType = new GraphQLObjectType({
- name: 'OtherPrize',
+ name: 'AdditionalPrize',
+ description: 'Non algo complementary prize',
fields: () => ({
condition: { type: GraphQLString },
- amount: { type: GraphQLInt },
- asset: { type: GraphQLString },
+ amount: { type: new GraphQLNonNull(GraphQLInt) },
+ asset: { type: new GraphQLNonNull(GraphQLString) },
}),
});
diff --git a/server/src/schema/types/Event.js b/server/src/schema/types/Event.js
index 7917e3032..e4582e346 100644
--- a/server/src/schema/types/Event.js
+++ b/server/src/schema/types/Event.js
@@ -12,11 +12,14 @@ import {
ParticipantType,
PrizeType,
} from './index';
+import EventStateEnumType from './enum/EventState';
const EventType = new GraphQLObjectType({
name: 'Event',
+ description: 'Everything you need to know about an event',
fields: () => ({
- designator: { type: GraphQLID },
+ id: { type: GraphQLID },
+ state: { type: EventStateEnumType },
name: { type: GraphQLString },
hostId: { type: GraphQLString },
description: { type: GraphQLString },
@@ -25,13 +28,13 @@ const EventType = new GraphQLObjectType({
formula: {
type: FormulaType,
resolve(parent) {
- return parent.formula;
+ return parent.formulaId;
},
},
plotter: {
type: PlotterType,
resolve(parent) {
- return parent.plotter;
+ return parent.plotterId;
},
},
rules: {
diff --git a/server/src/schema/types/Formula.js b/server/src/schema/types/Formula.js
index f5d312327..934cbcd60 100644
--- a/server/src/schema/types/Formula.js
+++ b/server/src/schema/types/Formula.js
@@ -6,6 +6,7 @@ import {
const FormulaType = new GraphQLObjectType({
name: 'Formula',
+ description: 'For now it\'s simplay a named field',
fields: () => ({
id: { type: GraphQLString },
ownerId: { type: GraphQLString },
diff --git a/server/src/schema/types/Participant.js b/server/src/schema/types/Participant.js
index f3afb7745..28c2833df 100644
--- a/server/src/schema/types/Participant.js
+++ b/server/src/schema/types/Participant.js
@@ -5,6 +5,7 @@ import {
const ParticipantType = new GraphQLObjectType({
name: 'Participant',
+ description: 'Informations about the participant of an event',
fields: () => ({
teamId: { type: GraphQLString },
botId: { type: GraphQLString },
diff --git a/server/src/schema/types/Plotter.js b/server/src/schema/types/Plotter.js
index 9e86390a5..798d197af 100644
--- a/server/src/schema/types/Plotter.js
+++ b/server/src/schema/types/Plotter.js
@@ -6,6 +6,7 @@ import {
const PlotterType = new GraphQLObjectType({
name: 'Plotter',
+ description: 'Will soon change in order to use contained plotter objects',
fields: () => ({
id: { type: GraphQLString },
ownerId: { type: GraphQLString },
diff --git a/server/src/schema/types/Prize.js b/server/src/schema/types/Prize.js
index 4b2fc8aba..7a81a702a 100644
--- a/server/src/schema/types/Prize.js
+++ b/server/src/schema/types/Prize.js
@@ -2,14 +2,16 @@ import {
GraphQLObjectType,
GraphQLList,
GraphQLInt,
+ GraphQLNonNull,
} from 'graphql';
import { AdditionalPrizeType } from './index';
const PrizeType = new GraphQLObjectType({
name: 'Prize',
+ description: 'Prize, by default in algos',
fields: () => ({
- rank: { type: GraphQLInt },
- amount: { type: GraphQLInt },
+ rank: { type: new GraphQLNonNull(GraphQLInt) },
+ amount: { type: new GraphQLNonNull(GraphQLInt) },
additional: {
type: new GraphQLList(AdditionalPrizeType),
resolve(parent) {
diff --git a/server/src/schema/types/Rule.js b/server/src/schema/types/Rule.js
index e39a877fc..46358242d 100644
--- a/server/src/schema/types/Rule.js
+++ b/server/src/schema/types/Rule.js
@@ -6,6 +6,7 @@ import {
const RuleType = new GraphQLObjectType({
name: 'Rule',
+ description: 'Textual rules of an event',
fields: () => ({
position: { type: GraphQLInt },
title: { type: GraphQLString },
diff --git a/server/src/schema/types/enum/EventState.js b/server/src/schema/types/enum/EventState.js
new file mode 100644
index 000000000..d4ef1304f
--- /dev/null
+++ b/server/src/schema/types/enum/EventState.js
@@ -0,0 +1,19 @@
+import {
+ GraphQLEnumType,
+} from 'graphql';
+
+import { EventStateEnum } from '../../../enums/EventState';
+
+const values = {};
+EventStateEnum.forEach((EventState) => {
+ values[EventState] = { value: EventState };
+});
+
+const EventStateEnumType = new GraphQLEnumType({
+ name: 'EventStateEnum',
+ values,
+});
+
+export {
+ EventStateEnumType as default,
+};
diff --git a/server/src/schema/types/input/AdditionalPrize.js b/server/src/schema/types/input/AdditionalPrize.js
new file mode 100644
index 000000000..0fe28c2f0
--- /dev/null
+++ b/server/src/schema/types/input/AdditionalPrize.js
@@ -0,0 +1,18 @@
+import {
+ GraphQLInputObjectType,
+ GraphQLNonNull,
+ GraphQLString,
+ GraphQLInt,
+} from 'graphql';
+
+const Type = new GraphQLInputObjectType({
+ name: 'AdditionalPrizeInput',
+ description: 'Payload for formula input',
+ fields: () => ({
+ condition: { type: GraphQLString },
+ amount: { type: new GraphQLNonNull(GraphQLInt) },
+ asset: { type: new GraphQLNonNull(GraphQLString) },
+ }),
+});
+
+export default Type;
diff --git a/server/src/schema/types/input/Event.js b/server/src/schema/types/input/Event.js
new file mode 100644
index 000000000..eb34c274f
--- /dev/null
+++ b/server/src/schema/types/input/Event.js
@@ -0,0 +1,25 @@
+import {
+ GraphQLString,
+ GraphQLInt,
+ GraphQLInputObjectType,
+ GraphQLList,
+} from 'graphql';
+import InputPrizeType from './Prize';
+import InputRuleType from './Rule';
+
+const Type = new GraphQLInputObjectType({
+ name: 'EventInput',
+ description: 'Payload for event input',
+ fields: () => ({
+ name: { type: GraphQLString },
+ description: { type: GraphQLString },
+ startDatetime: { type: GraphQLInt },
+ finishDatetime: { type: GraphQLInt },
+ formulaId: { type: GraphQLString },
+ plotterId: { type: GraphQLString },
+ prizes: { type: new GraphQLList(InputPrizeType) },
+ rules: { type: new GraphQLList(InputRuleType) },
+ }),
+});
+
+export default Type;
diff --git a/server/src/schema/types/input/Formula.js b/server/src/schema/types/input/Formula.js
new file mode 100644
index 000000000..bd9d070f1
--- /dev/null
+++ b/server/src/schema/types/input/Formula.js
@@ -0,0 +1,15 @@
+import {
+ GraphQLNonNull,
+ GraphQLString,
+ GraphQLInputObjectType,
+} from 'graphql';
+
+const Type = new GraphQLInputObjectType({
+ name: 'FormulaInput',
+ description: 'Payload for formula input',
+ fields: () => ({
+ name: { type: new GraphQLNonNull(GraphQLString) },
+ }),
+});
+
+export default Type;
diff --git a/server/src/schema/types/input/Participant.js b/server/src/schema/types/input/Participant.js
new file mode 100644
index 000000000..c3853df83
--- /dev/null
+++ b/server/src/schema/types/input/Participant.js
@@ -0,0 +1,17 @@
+import {
+ GraphQLInputObjectType,
+ GraphQLString,
+ GraphQLNonNull,
+} from 'graphql';
+
+const Type = new GraphQLInputObjectType({
+ name: 'ParticipantInput',
+ description: 'Payload for formula input',
+ fields: () => ({
+ teamId: { type: new GraphQLNonNull(GraphQLString) },
+ botId: { type: GraphQLString },
+ releaseId: { type: GraphQLString },
+ }),
+});
+
+export default Type;
diff --git a/server/src/schema/types/input/Plotter.js b/server/src/schema/types/input/Plotter.js
new file mode 100644
index 000000000..1368aecf9
--- /dev/null
+++ b/server/src/schema/types/input/Plotter.js
@@ -0,0 +1,18 @@
+import {
+ GraphQLNonNull,
+ GraphQLString,
+ GraphQLInputObjectType,
+} from 'graphql';
+
+const Type = new GraphQLInputObjectType({
+ name: 'PlotterInput',
+ description: 'Payload for plotter input',
+ fields: () => ({
+ name: { type: new GraphQLNonNull(GraphQLString) },
+ host: { type: GraphQLString },
+ repo: { type: GraphQLString },
+ moduleName: { type: GraphQLString },
+ }),
+});
+
+export default Type;
diff --git a/server/src/schema/types/input/Prize.js b/server/src/schema/types/input/Prize.js
new file mode 100644
index 000000000..5be06f0f2
--- /dev/null
+++ b/server/src/schema/types/input/Prize.js
@@ -0,0 +1,21 @@
+import {
+ GraphQLInputObjectType,
+ GraphQLList,
+ GraphQLInt,
+ GraphQLNonNull,
+} from 'graphql';
+import InputAdditionalPrizeType from './AdditionalPrize';
+
+const Type = new GraphQLInputObjectType({
+ name: 'PrizeInput',
+ description: 'Payload for formula input',
+ fields: () => ({
+ rank: { type: new GraphQLNonNull(GraphQLInt) },
+ amount: { type: new GraphQLNonNull(GraphQLInt) },
+ additional: {
+ type: new GraphQLList(InputAdditionalPrizeType),
+ },
+ }),
+});
+
+export default Type;
diff --git a/server/src/schema/types/input/Rule.js b/server/src/schema/types/input/Rule.js
new file mode 100644
index 000000000..220b99412
--- /dev/null
+++ b/server/src/schema/types/input/Rule.js
@@ -0,0 +1,18 @@
+import {
+ GraphQLNonNull,
+ GraphQLString,
+ GraphQLInt,
+ GraphQLInputObjectType,
+} from 'graphql';
+
+const Type = new GraphQLInputObjectType({
+ name: 'RuleInput',
+ description: 'Payload for rule input',
+ fields: () => ({
+ position: { type: GraphQLInt },
+ title: { type: new GraphQLNonNull(GraphQLString) },
+ description: { type: GraphQLString },
+ }),
+});
+
+export default Type;
diff --git a/server/src/schema/types/input/index.js b/server/src/schema/types/input/index.js
new file mode 100644
index 000000000..5bab6702a
--- /dev/null
+++ b/server/src/schema/types/input/index.js
@@ -0,0 +1,17 @@
+import PlotterInputType from './Plotter';
+import RuleInputType from './Rule';
+import PrizeInputType from './Prize';
+import FormulaInputType from './Formula';
+import EventInputType from './Event';
+import AdditionalPrizeInputType from './AdditionalPrize';
+import ParticipantInputType from './Participant';
+
+export {
+ PlotterInputType,
+ RuleInputType,
+ PrizeInputType,
+ FormulaInputType,
+ EventInputType,
+ AdditionalPrizeInputType,
+ ParticipantInputType,
+};