Skip to content
This repository was archived by the owner on Mar 18, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions HackMerced/2017F/src/server/src/handlers/hacker.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ export const hackerHandlers = {
});
},
postLogin: (req, reply) => {


const email = req.payload.email ? req.payload.email.toLowerCase() : 'bad'

axios
Expand Down
2 changes: 0 additions & 2 deletions HackMerced/2017F/src/server/src/validators/hacker.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ import { notMercedOptions } from '../../../app/src/constants'

export const hackerValidators = {
postLogin: {
// tomoe handles this
},
postSignup: {
// tomoe handles this
},
getMe:{
payload:{
Expand Down
1 change: 1 addition & 0 deletions Tomoe/Cloud/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Tomoe cloud handler/website and directives
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions Tomoe/package.json → Tomoe/Core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Tomoe",
"version": "2.0.0",
"version": "2.1.0",
"description": "Centralized API user platform for Hackathons",
"main": "production.js",
"scripts": {
Expand All @@ -10,7 +10,7 @@
"generate": "node ./build/core",
"build": "npm run clean && cross-env NODE_ENV=production npm run compile",
"start": "node ./build/imports && cross-env NODE_ENV=development node ./src/app/build/scripts/start",
"api": "nodemon -e js -w ./src/server ./src/server/index.js",
"api": "nodemon -e js --watch './src/server' --watch './src/extensions/**/server/**/*' ./src/server/index.js",
"test_server": "cross-env NODE_ENV=test nyc node ./build/tests",
"test_app": "cross-env NODE_ENV=test karma start ./src/app/build/karma.config",
"test": "npm run test_server",
Expand Down
8 changes: 8 additions & 0 deletions Tomoe/Core/src/extensions/admissions/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "admissions",
"displayName": "Admissions",
"injectables": {
"routes": "server/routes/index.js"
},
"interface": "sidebar"
}
1 change: 1 addition & 0 deletions Tomoe/Core/src/extensions/admissions/importable.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '../'
11 changes: 11 additions & 0 deletions Tomoe/Core/src/extensions/admissions/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "Tomoe-Admissions",
"version": "1.0.0",
"description": "Admissions utility for Tomoe",
"main": " ",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "HackMerced",
"license": "MIT"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { User } from './';
import { User } from '../../../importable';

export class Hacker extends User{
constructor(data = {}){
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './Hacker'
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Hacker } from '../collections'
import { operatorSearch, respond, transformData, setSearchParam } from '../util';
import { Hacker } from '../classes'
import { operatorSearch, respond, transformData, setSearchParam } from '../../../importable';
import Joi from 'joi';
import Boom from 'boom';

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './hacker'
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import hackerRoutes from './hacker';

const routes = [
...hackerRoutes,
];

export default routes;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './hacker'
1 change: 1 addition & 0 deletions Tomoe/Core/src/extensions/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '../server/exportable';
1 change: 1 addition & 0 deletions Tomoe/Core/src/extensions/template/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#
7 changes: 7 additions & 0 deletions Tomoe/Core/src/extensions/template/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "template",
"displayName": "template",
"injectables": {
},
"interface": "sidebar"
}
1 change: 1 addition & 0 deletions Tomoe/Core/src/extensions/template/importable.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '../'
11 changes: 11 additions & 0 deletions Tomoe/Core/src/extensions/template/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "template",
"version": "1.0.0",
"description": "A template for Tomoe Extensions",
"main": " ",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "HackMerced",
"license": "MIT"
}
1 change: 1 addition & 0 deletions Tomoe/Core/src/extensions/volunteers/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#
7 changes: 7 additions & 0 deletions Tomoe/Core/src/extensions/volunteers/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "template",
"displayName": "template",
"injectables": {
},
"interface": "sidebar"
}
1 change: 1 addition & 0 deletions Tomoe/Core/src/extensions/volunteers/importable.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '../'
11 changes: 11 additions & 0 deletions Tomoe/Core/src/extensions/volunteers/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "template",
"version": "1.0.0",
"description": "A template for Tomoe Extensions",
"main": " ",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "HackMerced",
"license": "MIT"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { User } from './';
import { User } from '../../../importable';

export class Volunteer extends User{
constructor(data = {}){
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './Volunteer'
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './volunteer'
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Volunteer } from '../collections'
import { operatorSearch, respond, transformData, setSearchParam } from '../util';
import { Volunteer } from '../classes'
import { operatorSearch, respond, transformData, setSearchParam } from '../../../importable';
import Joi from 'joi';
import Boom from 'boom';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import hackerRoutes from './hacker';
import adminRoutes from './admin';
import volunteerRoutes from './volunteer';

const routes = [
...hackerRoutes,
...adminRoutes,
...volunteerRoutes,
];

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './volunteer'
4 changes: 4 additions & 0 deletions Tomoe/Core/src/server/exportable.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// content that can be utilized by extensions

export * from './src/classes';
export * from './src/util';
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const transporter = nodemailer.createTransport({

export class Email {
constructor(data = {}){
super(data);

}

Expand Down
19 changes: 19 additions & 0 deletions Tomoe/Core/src/server/src/classes/generic/Event.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import uuidv4 from 'uuid/v4'

export class Event {
constructor({ id = uuidv4(), date = null }){
this.id = id;
this.date = date;
}

static getCollection(){
return db.collection('event');
}

_get(){
return {
id: this.id,
date: this.date,
}
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { aql } from 'arangojs';
import { Tomoe } from './';
import uuidv4 from 'uuid/v4'
import sha256 from 'sha256';
import Boom from 'boom';

export class User{
export class User {
constructor(data = {}){
// user information
this.id = data.id || uuidv4();
Expand Down
2 changes: 2 additions & 0 deletions Tomoe/Core/src/server/src/classes/generic/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './User';
export * from './Event';
2 changes: 2 additions & 0 deletions Tomoe/Core/src/server/src/classes/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './generic';
export * from './strict';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { User } from './';
import { User } from '../';

export class Admin extends User{
constructor(data = {}){
Expand Down
1 change: 1 addition & 0 deletions Tomoe/Core/src/server/src/classes/strict/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './Admin';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Admin } from '../collections'
import { Admin } from '../classes'
import { operatorSearch, respond, transformData, setSearchParam } from '../util';
import Joi from 'joi';
import Boom from 'boom';
Expand Down
1 change: 1 addition & 0 deletions Tomoe/Core/src/server/src/handlers/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './admin'
10 changes: 10 additions & 0 deletions Tomoe/Core/src/server/src/routes/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import adminRoutes from './admin';

import { getExtensionContent } from '../util';

const routes = [
...adminRoutes,
...getExtensionContent('routes'),
];

export default routes;
14 changes: 14 additions & 0 deletions Tomoe/Core/src/server/src/util/extension-handler.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const { extensions } = TOMOE_CONFIG;
const EXTENSION_ROOT = '../../../extensions';

export function getExtensionContent(extensionType){
return extensions.map((extName) => {
const extRoute = require(`${EXTENSION_ROOT}/${extName}/config.json`).injectables[extensionType];

if(extRoute) {
return require(`${EXTENSION_ROOT}/${extName}/src/${extRoute}`).default;
}

return null;
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export * from './operator-search';
export * from './respond';
export * from './transform-data'
export * from './set-search-param'
export * from './extension-handler'
1 change: 1 addition & 0 deletions Tomoe/Core/src/server/src/validators/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './admin'
File renamed without changes.
4 changes: 0 additions & 4 deletions Tomoe/src/server/src/collections/index.js

This file was deleted.

3 changes: 0 additions & 3 deletions Tomoe/src/server/src/handlers/index.js

This file was deleted.

3 changes: 0 additions & 3 deletions Tomoe/src/server/src/validators/index.js

This file was deleted.