Global

Members

(route) accessToken

Route:
MethodPath
POST api/auth

Exchanges a refresh token for an access token.

Route Parameters:
Name Type Description
req request Should contain a single field of refreshToken which is retrieved from the database. Exchanges it for an access token and puts it in the response field 'accessToken'.
Source:

(route) AddEvent

Route:
MethodPath
POST api/calendar/addEvent

Adds an event to a user's Google Calendar.

Route Parameters:
Name Type Description
req request contains a field 'token' which contains an access token for the calendar, as well as a field 'event' which contains data about the event.
Source:

(route) ConfirmationEmail

Route:
MethodPath
POST api/confirmation

Sends the inviter and invitee confirmation email for a newly scheduled event.

Source:

(route) CreateInvitation

Route:
MethodPath
POST api/invitations

Create An Invitation & emails invitation link (appends id to invitation page)

Source:

(route) DeleteInvitation

Route:
MethodPath
POST api/invitations

Deletes an invitation once it is used (ie, the invitee schedules a meeting) based on its id.

Source:

(route) EditEvent

Route:
MethodPath
POST api/calendar/editEvent

Edits an event on a user's Google Calendar.

Route Parameters:
Name Type Description
req request contains a field 'token' which contains an access token for the calendar, a field 'id' which is the id of the event to edit, and 'event' which contains the new event info.
Source:

(route) GetCalendar

Route:
MethodPath
POST api/calendar/getcalendar

Returns a user's google calendar events.

Route Parameters:
Name Type Description
req request contains a field 'token' which contains an access token for the calendar.
Source:

(route) GetInvitation

Route:
MethodPath
GET api/invitations

Finds all invitations.

Source:

(route) InviterAccessToken

Route:
MethodPath
POST api/invitationpage

Get object id of invitation, and use the id to search the inviter's User object in the database. Then, use the inviter's refreshToken to receive a new accessToken.

Source:

(route) Register

Route:
MethodPath
POST api/auth

Registers a user if they don't exist and returns user info with access token.

Route Parameters:
Name Type Description
req request Should contain a single field of code, which is the access code given by the GoogleResponseOffline from the Google Login component. Will be exchanged for an access token, and if it is the user's first time logging in, a refresh token.
Source:

(route) RemoveEvent

Route:
MethodPath
POST api/calendar/removeEvent

Removes an event from a user's Google Calendar.

Route Parameters:
Name Type Description
req request contains a field 'token' which contains an access token for the calendar, and a field 'id' which is the id of the event to remove.
Source:

Methods

createOauthClient() → {OAuth2Client}

A helper function which builds a Google OAuth2Client.

Source:
Returns:
  • The new Oauth2Client.
Type
OAuth2Client

getAccessToken(refreshToken) → {String}

A helper function which takes a refresh token and uses it to retreive an access token.

Parameters:
Name Type Description
refreshToken String

The refresh token.

Source:
Returns:

accessToken - The new access token.

Type
String

getUserProfile(accessToken) → {UserProfile}

A helper function which gets a user profile from an OAuth2Client.

Parameters:
Name Type Description
accessToken String

The access token.

Source:
Returns:
  • The user object. No type defined.
Type
UserProfile