Skip to content

Commit

Permalink
Merge pull request #94 from SayakMukhopadhyay/wip
Browse files Browse the repository at this point in the history
Added stations
  • Loading branch information
SayakMukhopadhyay authored Jan 27, 2018
2 parents f7dc355 + 9e0fffe commit 1c051ba
Show file tree
Hide file tree
Showing 44 changed files with 1,676 additions and 58 deletions.
7 changes: 5 additions & 2 deletions .angular-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,15 @@
"styles": [
"styles.scss",
"../node_modules/clarity-icons/clarity-icons.min.css",
"../node_modules/clarity-ui/clarity-ui.min.css"
"../node_modules/clarity-ui/clarity-ui.min.css",
"../node_modules/prismjs/themes/prism.css"
],
"scripts": [
"../node_modules/mutationobserver-shim/dist/mutationobserver.min.js",
"../node_modules/@webcomponents/custom-elements/custom-elements.min.js",
"../node_modules/clarity-icons/clarity-icons.min.js"
"../node_modules/clarity-icons/clarity-icons.min.js",
"../node_modules/prismjs/prism.js",
"../node_modules/prismjs/components/prism-json.min.js"
],
"environmentSource": "environments/environment.ts",
"environments": {
Expand Down
50 changes: 48 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "elitebgs",
"version": "1.4.4",
"version": "1.6.0",
"license": "Apache-2.0",
"scripts": {
"ng": "ng",
Expand Down Expand Up @@ -53,6 +53,7 @@
"passport": "^0.3.2",
"passport-discord": "^0.1.2",
"passport-http": "^0.3.0",
"prismjs": "^1.10.0",
"request": "^2.81.0",
"request-progress": "^3.0.0",
"request-promise-native": "^1.0.4",
Expand Down
2 changes: 2 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const ebgsSystemsV3 = require('./server/routes/elite_bgs_api/v3/systems');

const ebgsFactionsV4 = require('./server/routes/elite_bgs_api/v4/factions');
const ebgsSystemsV4 = require('./server/routes/elite_bgs_api/v4/systems');
const ebgsStationsV4 = require('./server/routes/elite_bgs_api/v4/stations');

const authCheck = require('./server/routes/auth/auth_check');
const authDiscord = require('./server/routes/auth/discord');
Expand Down Expand Up @@ -182,6 +183,7 @@ app.use('/api/ebgs/v3/systems', ebgsSystemsV3);

app.use('/api/ebgs/v4/factions', ebgsFactionsV4);
app.use('/api/ebgs/v4/systems', ebgsSystemsV4);
app.use('/api/ebgs/v4/stations', ebgsStationsV4);

app.use('/auth/check', authCheck);
app.use('/auth/discord', authDiscord);
Expand Down
45 changes: 45 additions & 0 deletions server/models/ebgs_history_station_v4.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* KodeBlox Copyright 2017 Sayak Mukhopadhyay
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http: //www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

"use strict";

module.exports = new Promise((resolve, reject) => {
let db = require('../db');
let connection = db.elite_bgs;
let mongoose = db.mongoose;
let Schema = mongoose.Schema;
let ObjectId = mongoose.Schema.Types.ObjectId;

let ebgsHistoryStation = new Schema({
station_id: { type: ObjectId, index: true },
station_name_lower: { type: String, lowercase: true },
updated_at: { type: Date, index: true },
updated_by: String,
government: { type: String, lowercase: true },
allegiance: { type: String, lowercase: true },
state: { type: String, lowercase: true },
controlling_minor_faction: { type: String, lowercase: true },
services: [{
_id: false,
name: String,
name_lower: { type: String, lowercase: true }
}]
}, { runSettersOnQuery: true });

let model = connection.model('ebgsHistoryStationV4', ebgsHistoryStation);

resolve(model);
})
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,26 @@ module.exports = new Promise((resolve, reject) => {
eddb_id: Number,
name: String,
name_lower: { type: String, lowercase: true, index: true },
type: { type: String, lowercase: true, index: true },
system: String,
system_lower: { type: String, lowercase: true },
system_lower: { type: String, lowercase: true, index: true },
updated_at: Date,
government: { type: String, lowercase: true, index: true },
economy: { type: String, lowercase: true, index: true },
allegiance: { type: String, lowercase: true, index: true },
state: { type: String, lowercase: true },
state: { type: String, lowercase: true, index: true },
distance_from_star: Number,
controlling_minor_faction: { type: String, lowercase: true, index: true },
history: [{
services: [{
_id: false,
updated_at: Date,
government: { type: String, lowercase: true },
allegiance: { type: String, lowercase: true },
state: { type: String, lowercase: true },
controlling_minor_faction: { type: String, lowercase: true },
name: String,
name_lower: { type: String, lowercase: true }
}]
}, { runSettersOnQuery: true });

ebgsStation.plugin(mongoosePaginate);

let model = connection.model('ebgsStationV3', ebgsStation);
let model = connection.model('ebgsStationV4', ebgsStation);

resolve(model);
})
5 changes: 5 additions & 0 deletions server/models/ebgs_users.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ module.exports = new Promise((resolve, reject) => {
name: String,
name_lower: String
}],
stations: [{
_id: false,
name: String,
name_lower: String
}],
editable_factions: [{
_id: false,
name: String,
Expand Down
Loading

0 comments on commit 1c051ba

Please sign in to comment.