Merge branch 'php-backend' into develop

This commit is contained in:
dario-cfpt
2020-03-09 22:52:02 +01:00
55 changed files with 283 additions and 2546 deletions

View File

@ -140,12 +140,12 @@ function computeCharacterGrowthRatesWithClass(char) {
charData.name = charName;
charGrowthRates.forEach(gr => {
let grValue = gr.value;
let grValue = Number(gr.value);
if (classGrowthRates != null) {
// Compute the growth rates of the character with the growth rates of the class
let classGr = classGrowthRates.find(x => x.idStat == gr.idStat);
if (classGr != null) {
grValue += classGr.value;
grValue += Number(classGr.value);
}
}
statsValues.push(grValue);

View File

@ -3,16 +3,16 @@ File name : database.js
Description : Communicates with the server to ensure that the data is up to date.
*/
const BASE_URL = "http://localhost:3000/";
const BASE_URL = "http://localhost/";
let feData = JSON.parse(localStorage.getItem("feData"));
if (feData != null) {
let body = new FormData();
body.append('version', feData.version);
fetch(BASE_URL + "update", {
method: "POST",
body: JSON.stringify({version: feData.version}),
headers: {
'Content-Type': 'application/json'
},
body: body,
})
.then(res => {
if (res.ok) {
@ -47,7 +47,7 @@ if (feData != null) {
function updateData(data) {
// If the data received from the server are not empty then we can save them in the local storage
if (Object.keys(data).length > 0) {
if (data != null && Object.keys(data).length > 0) {
localStorage.setItem("feData", JSON.stringify(data));
feData = data;
}

View File

@ -29,7 +29,7 @@ function displayColumnChartOfClassGrowthRates() {
};
classGrowthRates.forEach(gr => {
statsValues.push(gr.value);
statsValues.push(Number(gr.value));
});
classData.data = statsValues;
@ -39,7 +39,7 @@ function displayColumnChartOfClassGrowthRates() {
function displayPolarSpiderOfClassGrowthRates() {
const classGrowthRates = getClassGrowthRates(actualClassId);
const statsNames = feData.stats.map(x => x.name);
const statsValues = classGrowthRates.map(x => x.value);
const statsValues = classGrowthRates.map(x => Number(x.value));
const classData = [{
name: feData.classes.find(x => x.id == actualClassId).name,

View File

@ -1,5 +0,0 @@
NODE_PORT=
DB_HOST=
DB_NAME=
DB_USER=
DB_PASSWORD=

5
server/.htaccess Normal file
View File

@ -0,0 +1,5 @@
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ index.php [QSA,L]

43
server/database.php Normal file
View File

@ -0,0 +1,43 @@
<?php
// Singleton to connect db.
class database
{
// Hold the class instance.
private static $instance = null;
private $conn;
private $host = 'localhost';
private $user = 'root';
private $pass = '';
private $name = 'fe_charts';
private $port = '';
// The db connection is established in the private constructor.
private function __construct()
{
try {
$this->conn = new PDO(
"mysql:host={$this->host};dbname={$this->name};port={$this->port}",
$this->user,
$this->pass
);
} catch (PDOException $e) {
die('Connection failed: ' . $e->getMessage());
}
}
public static function getInstance()
{
if (!self::$instance) {
self::$instance = new database();
}
return self::$instance;
}
public function getConnection()
{
return $this-> conn;
}
}

View File

@ -1,11 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const sequelize_1 = require("sequelize");
exports.Model = sequelize_1.Model;
exports.DataTypes = sequelize_1.DataTypes;
const sequelize = new sequelize_1.Sequelize(process.env.DB_NAME, process.env.DB_USER, process.env.DB_PASSWORD, {
host: process.env.DB_HOST,
dialect: "mysql",
});
exports.sequelize = sequelize;
//# sourceMappingURL=Sequelize.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"Sequelize.js","sourceRoot":"","sources":["../src/Sequelize.ts"],"names":[],"mappings":";;AAAA,yCAAsD;AAWnC,gBAXA,iBAAK,CAWA;AAAE,oBAXA,qBAAS,CAWA;AATnC,MAAM,SAAS,GAAG,IAAI,qBAAS,CAC3B,OAAO,CAAC,GAAG,CAAC,OAAO,EACnB,OAAO,CAAC,GAAG,CAAC,OAAO,EACnB,OAAO,CAAC,GAAG,CAAC,WAAW,EACvB;IACI,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO;IACzB,OAAO,EAAE,OAAO;CACnB,CAAC,CAAC;AAEC,8BAAS"}

View File

@ -1,67 +0,0 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
require("dotenv").config();
const axios = require('axios').default;
const cheerio = require('cheerio');
const { CharacterGrowthRate } = require("./mapping");
const index_1 = require("./index");
const url = "https://serenesforest.net/three-houses/characters/growth-rates/";
const mainCharName = "Byleth";
const mainCharAlternativeName = "Protagonist";
const nameIndex = 0;
function importCharGrowthRates() {
return __awaiter(this, void 0, void 0, function* () {
const characters = yield index_1.FE_Charts.getAllCharacters();
const stats = yield index_1.FE_Charts.getAllStats();
axios.get(url)
.then(res => {
// We need to remove all line breaks to avoid bad html format
const html = res.data.replace(/[\n\r]/g, "");
const $ = cheerio.load(html);
// parse each tables in the html
$("tbody").each(function (i, elem) {
// parse each rows of the table
elem.children.forEach((row, rowIndex) => {
// The first element is the header of the table, so we must skip it
if (rowIndex != 0) {
let name = $(row.children[nameIndex]).text();
if (name == mainCharAlternativeName) {
name = mainCharName;
}
const char = characters.find(x => x.firstName == name);
if (char !== undefined) {
for (let j = 0; j < stats.length; j++) {
const charGrowthRate = new CharacterGrowthRate();
charGrowthRate.idCharacter = char.id;
charGrowthRate.idStat = stats[j].id;
charGrowthRate.value = parseInt($(row.children[j + 1]).text()); // the first col of the table is for the name, so we have to add 1 to the index
CharacterGrowthRate.upsert({
Id_Character: charGrowthRate.idCharacter,
Id_Stat: charGrowthRate.idStat,
value: charGrowthRate.value,
}).catch(err => index_1.FE_Charts.logError(err));
}
}
else {
console.log(`Unknown character ${name}`);
}
}
});
});
})
.catch(err => {
index_1.FE_Charts.logError(err);
});
});
}
importCharGrowthRates();
//# sourceMappingURL=importCharGrowthRates.js.map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,CAAC;CAAA;AAED,qBAAqB,EAAE,CAAC"}

View File

@ -1,64 +0,0 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
require("dotenv").config();
const axios = require('axios').default;
const cheerio = require('cheerio');
const { ClassGrowthRate } = require("./mapping");
const index_1 = require("./index");
const url = "https://serenesforest.net/three-houses/classes/growth-rates/";
const nameIndex = 0;
function importClassGrowthRates() {
return __awaiter(this, void 0, void 0, function* () {
const classes = yield index_1.FE_Charts.getAllClasses();
const stats = yield index_1.FE_Charts.getAllStats();
axios.get(url)
.then(res => {
// We need to remove all line breaks to avoid bad html format
const html = res.data.replace(/[\n\r]/g, "");
const $ = cheerio.load(html);
$("#enemy").remove(); // Remove all contents for enemies
$("tbody").first().remove(); // Remove the first table who isn't for the growth rates
$("tbody").last().remove(); // Remove the last table who is for enemies and not playable character
// parse each tables in the html
$("tbody").each(function (i, elem) {
// parse each rows of the table
elem.children.forEach((row, rowIndex) => {
// The first element is the header of the table, so we must skip it
if (rowIndex != 0) {
const name = $(row.children[nameIndex]).text();
const feClass = classes.find(x => x.name == name);
if (feClass !== undefined) {
for (let j = 0; j < stats.length; j++) {
const classGrowthRate = new ClassGrowthRate();
classGrowthRate.idClass = feClass.id;
classGrowthRate.idStat = stats[j].id;
classGrowthRate.value = parseInt($(row.children[j + 1]).text()); // the first col of the table is for the name, so we have to add 1 to the index
if (classGrowthRate.value) {
ClassGrowthRate.upsert({
Id_Class: classGrowthRate.idClass,
Id_Stat: classGrowthRate.idStat,
value: classGrowthRate.value,
}).catch(err => index_1.FE_Charts.logError(err));
}
}
}
}
});
});
})
.catch(err => {
index_1.FE_Charts.logError(err);
});
});
}
importClassGrowthRates();
//# sourceMappingURL=importClassGrowthRates.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"importClassGrowthRates.js","sourceRoot":"","sources":["../src/importClassGrowthRates.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,CAAC;AAC3B,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC;AACvC,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AAEnC,MAAM,EAAC,eAAe,EAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAC/C,mCAAkC;AAElC,MAAM,GAAG,GAAU,8DAA8D,CAAC;AAClF,MAAM,SAAS,GAAU,CAAC,CAAC;AAG3B,SAAe,sBAAsB;;QACjC,MAAM,OAAO,GAAG,MAAM,iBAAS,CAAC,aAAa,EAAE,CAAC;QAChD,MAAM,KAAK,GAAG,MAAM,iBAAS,CAAC,WAAW,EAAE,CAAC;QAC5C,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC;aACT,IAAI,CAAC,GAAG,CAAC,EAAE;YACR,6DAA6D;YAC7D,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;YAC7C,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAE7B,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,kCAAkC;YACxD,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,wDAAwD;YACrF,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,sEAAsE;YAElG,gCAAgC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;qBACJ;gBACL,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;QACP,CAAC,CAAC;aACD,KAAK,CAAC,GAAG,CAAC,EAAE;YACT,iBAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QAC5B,CAAC,CAAC,CAAC;IACX,CAAC;CAAA;AAED,sBAAsB,EAAE,CAAC"}

View File

@ -1,106 +0,0 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
require("dotenv").config();
const axios = require('axios').default;
const cheerio = require('cheerio');
const { Catalogue, Character, CharacterGrowthRate, ClassGrowthRate, FE_Class, Gender, House, Stat, RestrictedCharacterClass } = require("./mapping");
const index_1 = require("./index");
function importCharGrowthRates() {
return __awaiter(this, void 0, void 0, function* () {
const characters = yield index_1.FE_Charts.getAllCharacters();
const stats = yield index_1.FE_Charts.getAllStats();
axios.get("https://serenesforest.net/three-houses/characters/growth-rates/")
.then(res => {
// We need to remove all line breaks to avoid bad html format
const html = res.data.replace(/[\n\r]/g, "");
const $ = cheerio.load(html);
// parse each tables in the html
$("tbody").each(function (i, elem) {
// parse each rows of the table
elem.children.forEach((row, rowIndex) => {
// The first element is the header of the table, so we must skip it
if (rowIndex != 0) {
let name = $(row.children[0]).text();
if (name == "Protagonist") {
name = "Byleth";
}
const char = characters.find(x => x.firstName == name);
if (char !== undefined) {
for (let j = 0; j < stats.length; j++) {
const charGrowthRate = new CharacterGrowthRate();
charGrowthRate.idCharacter = char.id;
charGrowthRate.idStat = stats[j].id;
charGrowthRate.value = parseInt($(row.children[j + 1]).text()); // the first col of the table is for the name, so we have to add 1 to the index
CharacterGrowthRate.upsert({
Id_Character: charGrowthRate.idCharacter,
Id_Stat: charGrowthRate.idStat,
value: charGrowthRate.value,
}).catch(err => index_1.FE_Charts.logError(err));
}
}
else {
console.log(`Unknown character ${name}`);
}
}
});
});
})
.catch(err => {
index_1.FE_Charts.logError(err);
});
});
}
function importClassGrowthRates() {
return __awaiter(this, void 0, void 0, function* () {
const classes = yield index_1.FE_Charts.getAllClasses();
const stats = yield index_1.FE_Charts.getAllStats();
axios.get("https://serenesforest.net/three-houses/classes/growth-rates/")
.then(res => {
// We need to remove all line breaks to avoid bad html format
const html = res.data.replace(/[\n\r]/g, "");
const $ = cheerio.load(html);
$("#enemy").remove(); // Remove all contents for enemies
$("tbody").first().remove(); // Remove the first table who isn't for the growth rates
$("tbody").last().remove(); // Remove the last table who is for enemies and not playable character
// parse each tables in the html
$("tbody").each(function (i, elem) {
// parse each rows of the table
elem.children.forEach((row, rowIndex) => {
// The first element is the header of the table, so we must skip it
if (rowIndex != 0) {
const name = $(row.children[0]).text();
const feClass = classes.find(x => x.name == name);
if (feClass !== undefined) {
for (let j = 0; j < stats.length; j++) {
const classGrowthRate = new ClassGrowthRate();
classGrowthRate.idClass = feClass.id;
classGrowthRate.idStat = stats[j].id;
classGrowthRate.value = parseInt($(row.children[j + 1]).text()); // the first col of the table is for the name, so we have to add 1 to the index
if (classGrowthRate.value) {
ClassGrowthRate.upsert({
Id_Class: classGrowthRate.idClass,
Id_Stat: classGrowthRate.idStat,
value: classGrowthRate.value,
}).catch(err => index_1.FE_Charts.logError(err));
}
}
}
}
});
});
})
.catch(err => {
index_1.FE_Charts.logError(err);
});
});
}
//# sourceMappingURL=importData.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"importData.js","sourceRoot":"","sources":["../src/importData.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,CA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CAAC,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,+EAA+E;gCAEhJ,IAAI,eAAe,CAAC,KAAK,EAAE;oCACvB,eAAe,CAAC,MAAM,CAAC;wCACnB,QAAQ,EAAE,eAAe,CAAC,OAAO;wCACjC,OAAO,EAAE,eAAe,CAAC,MAAM;wCAC/B,KAAK,EAAE,eAAe,CAAC,KAAK;qCAC/B,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,iBAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;iCAC5C;6BACJ;yBACJ;qBACJ;gBACL,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;QACP,CAAC,CAAC;aACD,KAAK,CAAC,GAAG,CAAC,EAAE;YACT,iBAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QAC5B,CAAC,CAAC,CAAC;IACX,CAAC;CAAA"}

202
server/dist/index.js vendored
View File

@ -1,202 +0,0 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
require("dotenv").config();
const axios = require('axios').default;
const cheerio = require('cheerio');
const semver = require('semver');
const express = require("express");
const bodyParser = require("body-parser");
const status = require("http-status");
const { Catalogue, Character, CharacterGrowthRate, ClassGrowthRate, FE_Class, Gender, House, Stat, RestrictedCharacterClass } = require("./mapping");
const app = express();
const port = process.env.NODE_PORT || 3000;
const argImport = "importing";
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
app.use(function (req, res, next) {
// Allow client to receive the data
// from : https://enable-cors.org/server_expressjs.html
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
next();
});
class FE_Charts {
static logError(err) {
// TODO: Log to file and manage the error
console.log(err);
}
static getAllCharacters() {
return __awaiter(this, void 0, void 0, function* () {
let characters = null;
yield Character.findAll().then(results => {
characters = results;
}).catch(err => FE_Charts.logError(err));
return characters;
});
}
static getAllCharactersGrowthRates() {
return __awaiter(this, void 0, void 0, function* () {
let charactersGrowRates = null;
yield CharacterGrowthRate.findAll({
attributes: ["value", "idCharacter", "idStat"]
}).then(results => {
charactersGrowRates = results;
}).catch(err => FE_Charts.logError(err));
return charactersGrowRates;
});
}
static getAllClassesGrowthRates() {
return __awaiter(this, void 0, void 0, function* () {
let classesGrowRates = null;
yield ClassGrowthRate.findAll({
attributes: ["value", "idClass", "idStat"]
}).then(results => {
classesGrowRates = results;
}).catch(err => FE_Charts.logError(err));
return classesGrowRates;
});
}
static getAllClasses() {
return __awaiter(this, void 0, void 0, function* () {
let classes = null;
yield FE_Class.findAll().then(results => {
classes = results;
}).catch(err => FE_Charts.logError(err));
return classes;
});
}
static getAllGenders() {
return __awaiter(this, void 0, void 0, function* () {
let genders = null;
yield Gender.findAll({
order: [
["id", "ASC"]
]
}).then(results => {
genders = results;
}).catch(err => FE_Charts.logError(err));
return genders;
});
}
static getAllHouses() {
return __awaiter(this, void 0, void 0, function* () {
let houses = null;
yield House.findAll({
order: [
["Id_House", "ASC"]
]
}).then(results => {
houses = results;
}).catch(err => FE_Charts.logError(err));
return houses;
});
}
static getAllRestrictedClasses() {
return __awaiter(this, void 0, void 0, function* () {
let restrictedClasses = null;
yield RestrictedCharacterClass.findAll({
attributes: ["idClass", "idCharacter"]
}).then(results => {
restrictedClasses = results;
}).catch(err => FE_Charts.logError(err));
return restrictedClasses;
});
}
static getAllStats() {
return __awaiter(this, void 0, void 0, function* () {
let stats = null;
yield Stat.findAll().then(results => {
stats = results;
}).catch(err => FE_Charts.logError(err));
return stats;
});
}
static getCatalogueLastVersion() {
return __awaiter(this, void 0, void 0, function* () {
let version = null;
yield Catalogue.findAll({
attributes: ["version", ["Dttm_Last_Update", "lastUpdate"]],
limit: 1,
order: [["Dttm_Last_Update", "DESC"]],
}).then(results => {
version = results[0].version;
}).catch(err => FE_Charts.logError(err));
return version;
});
}
static getAllData() {
return __awaiter(this, void 0, void 0, function* () {
const version = yield this.getCatalogueLastVersion();
const characters = yield FE_Charts.getAllCharacters();
const characterGrowthRates = yield FE_Charts.getAllCharactersGrowthRates();
const classesGrowthRates = yield FE_Charts.getAllClassesGrowthRates();
const classes = yield FE_Charts.getAllClasses();
const genders = yield FE_Charts.getAllGenders();
const houses = yield FE_Charts.getAllHouses();
const restrictedClasses = yield FE_Charts.getAllRestrictedClasses();
const stats = yield FE_Charts.getAllStats();
return {
version: version,
characters: characters,
charGrowthRates: characterGrowthRates,
classGrowthRates: classesGrowthRates,
classes: classes,
genders: genders,
houses: houses,
restrictedClasses: restrictedClasses,
stats: stats,
};
});
}
}
exports.FE_Charts = FE_Charts;
app.get('/', (req, res) => {
res.send('Hello World!');
});
app.get('/version', (req, res) => {
FE_Charts.getCatalogueLastVersion().then(version => {
res.status(status.OK).send(version);
});
});
app.get('/all', (req, res) => __awaiter(void 0, void 0, void 0, function* () {
const data = yield FE_Charts.getAllData();
res.status(status.OK).send(data);
}));
app.post('/update', (req, res) => __awaiter(void 0, void 0, void 0, function* () {
const clientVersion = req.body.version;
if (clientVersion) {
FE_Charts.getCatalogueLastVersion().then((version) => __awaiter(void 0, void 0, void 0, function* () {
try {
if (semver.gt(version, clientVersion)) {
const data = yield FE_Charts.getAllData();
res.status(status.OK).send(data);
}
else {
res.status(status.OK).send({}); // Catalogue up-to-date
}
}
catch (e) {
res.status(status.INTERNAL_SERVER_ERROR).send(e.message);
}
}));
}
else {
res.status(status.BAD_REQUEST).send("'version' parameter undefined");
}
}));
// Don't start the server if we're importing some data
if (process.argv.find(x => x == argImport) == undefined) {
app.listen(port, () => {
console.log(`Example app listening on port ${port}!`);
});
}
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

View File

@ -1,61 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Sequelize_1 = require("./Sequelize");
const Catalogue_1 = require("./models/Catalogue");
exports.Catalogue = Catalogue_1.Catalogue;
const Character_1 = require("./models/Character");
exports.Character = Character_1.Character;
const CharacterGrowthRate_1 = require("./models/CharacterGrowthRate");
exports.CharacterGrowthRate = CharacterGrowthRate_1.CharacterGrowthRate;
const ClassGrowthRate_1 = require("./models/ClassGrowthRate");
exports.ClassGrowthRate = ClassGrowthRate_1.ClassGrowthRate;
const FE_Class_1 = require("./models/FE_Class");
exports.FE_Class = FE_Class_1.FE_Class;
const Gender_1 = require("./models/Gender");
exports.Gender = Gender_1.Gender;
const House_1 = require("./models/House");
exports.House = House_1.House;
const RestrictedCharacterClass_1 = require("./models/RestrictedCharacterClass");
exports.RestrictedCharacterClass = RestrictedCharacterClass_1.RestrictedCharacterClass;
const Stat_1 = require("./models/Stat");
exports.Stat = Stat_1.Stat;
// Sequelize associations
House_1.House.hasMany(Character_1.Character, {
sourceKey: "id",
foreignKey: "idHouse",
});
Gender_1.Gender.hasMany(Character_1.Character, {
sourceKey: "id",
foreignKey: "idGender",
});
Gender_1.Gender.hasMany(FE_Class_1.FE_Class, {
sourceKey: "id",
foreignKey: "idGender",
});
Character_1.Character.belongsToMany(FE_Class_1.FE_Class, {
foreignKey: { name: "Id_Character" },
through: RestrictedCharacterClass_1.RestrictedCharacterClass,
});
FE_Class_1.FE_Class.belongsToMany(Character_1.Character, {
foreignKey: { name: "Id_Class" },
through: RestrictedCharacterClass_1.RestrictedCharacterClass,
});
Character_1.Character.belongsToMany(Stat_1.Stat, {
foreignKey: { name: "Id_Character" },
through: CharacterGrowthRate_1.CharacterGrowthRate,
});
Stat_1.Stat.belongsToMany(Character_1.Character, {
foreignKey: { name: "Id_Stat" },
through: CharacterGrowthRate_1.CharacterGrowthRate,
});
FE_Class_1.FE_Class.belongsToMany(Stat_1.Stat, {
foreignKey: { name: "Id_Class" },
through: ClassGrowthRate_1.ClassGrowthRate,
});
Stat_1.Stat.belongsToMany(FE_Class_1.FE_Class, {
foreignKey: { name: "Id_Stat" },
through: ClassGrowthRate_1.ClassGrowthRate,
});
// Create tables if not exists
Sequelize_1.sequelize.sync();
//# sourceMappingURL=mapping.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"mapping.js","sourceRoot":"","sources":["../src/mapping.ts"],"names":[],"mappings":";;AAAA,2CAAsC;AACtC,kDAA6C;AAyDrC,oBAzDA,qBAAS,CAyDA;AAxDjB,kDAA6C;AAwD1B,oBAxDX,qBAAS,CAwDW;AAvD5B,sEAAiE;AAuDnC,8BAvDtB,yCAAmB,CAuDsB;AAtDjD,8DAAyD;AAsDN,0BAtD3C,iCAAe,CAsD2C;AArDlE,gDAA2C;AAqDyB,mBArD5D,mBAAQ,CAqD4D;AApD5E,4CAAuC;AAoDuC,iBApDtE,eAAM,CAoDsE;AAnDpF,0CAAqC;AAmDiD,gBAnD9E,aAAK,CAmD8E;AAlD3F,gFAA2E;AAkDwB,mCAlD3F,mDAAwB,CAkD2F;AAjD3H,wCAAmC;AAiD0D,eAjDrF,WAAI,CAiDqF;AA/CjG,yBAAyB;AAEzB,aAAK,CAAC,OAAO,CAAC,qBAAS,EAAE;IACrB,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,SAAS;CACxB,CAAC,CAAC;AAEH,eAAM,CAAC,OAAO,CAAC,qBAAS,EAAE;IACtB,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,UAAU;CACzB,CAAC,CAAC;AAEH,eAAM,CAAC,OAAO,CAAC,mBAAQ,EAAE;IACrB,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,UAAU;CACzB,CAAC,CAAC;AAEH,qBAAS,CAAC,aAAa,CAAC,mBAAQ,EAAE;IAC9B,UAAU,EAAE,EAAC,IAAI,EAAE,cAAc,EAAC;IAClC,OAAO,EAAE,mDAAwB;CACpC,CAAC,CAAC;AACH,mBAAQ,CAAC,aAAa,CAAC,qBAAS,EAAE;IAC9B,UAAU,EAAE,EAAC,IAAI,EAAE,UAAU,EAAC;IAC9B,OAAO,EAAE,mDAAwB;CACpC,CAAC,CAAC;AAEH,qBAAS,CAAC,aAAa,CAAC,WAAI,EAAE;IAC1B,UAAU,EAAE,EAAC,IAAI,EAAE,cAAc,EAAC;IAClC,OAAO,EAAE,yCAAmB;CAC/B,CAAC,CAAC;AACH,WAAI,CAAC,aAAa,CAAC,qBAAS,EAAE;IAC1B,UAAU,EAAE,EAAC,IAAI,EAAE,SAAS,EAAC;IAC7B,OAAO,EAAE,yCAAmB;CAC/B,CAAC,CAAC;AAEH,mBAAQ,CAAC,aAAa,CAAC,WAAI,EAAE;IACzB,UAAU,EAAE,EAAC,IAAI,EAAE,UAAU,EAAC;IAC9B,OAAO,EAAE,iCAAe;CAC3B,CAAC,CAAC;AACH,WAAI,CAAC,aAAa,CAAC,mBAAQ,EAAE;IACzB,UAAU,EAAE,EAAC,IAAI,EAAE,SAAS,EAAC;IAC7B,OAAO,EAAE,iCAAe;CAC3B,CAAC,CAAC;AAEH,8BAA8B;AAC9B,qBAAS,CAAC,IAAI,EAAE,CAAC"}

View File

@ -1,36 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Sequelize_1 = require("../Sequelize");
class Catalogue extends Sequelize_1.Model {
}
exports.Catalogue = Catalogue;
const versionField = "No_Version";
Catalogue.init({
id: {
type: Sequelize_1.DataTypes.INTEGER.UNSIGNED,
autoIncrement: true,
primaryKey: true,
field: "Id_Catalogue",
},
version: {
type: Sequelize_1.DataTypes.STRING(16),
allowNull: false,
field: versionField
},
lastUpdate: {
type: Sequelize_1.DataTypes.DATE,
allowNull: false,
field: "Dttm_Last_Update"
},
}, {
indexes: [
{
unique: true,
fields: [versionField],
},
],
timestamps: false,
tableName: 'Tbl_Catalogue',
sequelize: Sequelize_1.sequelize,
});
//# sourceMappingURL=Catalogue.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"Catalogue.js","sourceRoot":"","sources":["../../src/models/Catalogue.ts"],"names":[],"mappings":";;AAAA,4CAAyD;AAEzD,MAAM,SAAU,SAAQ,iBAAK;CAI5B;AAiCO,8BAAS;AA/BjB,MAAM,YAAY,GAAG,YAAY,CAAC;AAElC,SAAS,CAAC,IAAI,CAAC;IACX,EAAE,EAAE;QACA,IAAI,EAAE,qBAAS,CAAC,OAAO,CAAC,QAAQ;QAChC,aAAa,EAAE,IAAI;QACnB,UAAU,EAAE,IAAI;QAChB,KAAK,EAAE,cAAc;KACxB;IACD,OAAO,EAAE;QACL,IAAI,EAAE,qBAAS,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1B,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,YAAY;KACtB;IACD,UAAU,EAAE;QACR,IAAI,EAAE,qBAAS,CAAC,IAAI;QACpB,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,kBAAkB;KAC5B;CACJ,EAAE;IACC,OAAO,EAAE;QACL;YACI,MAAM,EAAE,IAAI;YACZ,MAAM,EAAE,CAAC,YAAY,CAAC;SACzB;KACJ;IACD,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE,eAAe;IAC1B,SAAS,EAAE,qBAAS;CACvB,CAAC,CAAC"}

View File

@ -1,44 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Sequelize_1 = require("../Sequelize");
class Character extends Sequelize_1.Model {
}
exports.Character = Character;
Character.init({
id: {
type: Sequelize_1.DataTypes.INTEGER.UNSIGNED,
autoIncrement: true,
primaryKey: true,
field: "Id_Character",
},
firstName: {
type: Sequelize_1.DataTypes.STRING(32),
allowNull: true,
field: "Nm_First",
},
lastName: {
type: Sequelize_1.DataTypes.STRING(32),
allowNull: true,
field: "Nm_Last",
},
imgFileName: {
type: Sequelize_1.DataTypes.STRING(64),
allowNull: true,
field: "Nm_File_Img",
},
idHouse: {
type: Sequelize_1.DataTypes.INTEGER.UNSIGNED,
allowNull: false,
field: "Id_House",
},
idGender: {
type: Sequelize_1.DataTypes.INTEGER.UNSIGNED,
allowNull: false,
field: "Id_Gender",
},
}, {
timestamps: false,
tableName: 'Tbl_Character',
sequelize: Sequelize_1.sequelize,
});
//# sourceMappingURL=Character.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"Character.js","sourceRoot":"","sources":["../../src/models/Character.ts"],"names":[],"mappings":";;AAAA,4CAAyD;AAEzD,MAAM,SAAU,SAAQ,iBAAK;CAO5B;AAwCO,8BAAS;AAtCjB,SAAS,CAAC,IAAI,CAAC;IACX,EAAE,EAAE;QACA,IAAI,EAAE,qBAAS,CAAC,OAAO,CAAC,QAAQ;QAChC,aAAa,EAAE,IAAI;QACnB,UAAU,EAAE,IAAI;QAChB,KAAK,EAAE,cAAc;KACxB;IACD,SAAS,EAAE;QACP,IAAI,EAAE,qBAAS,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1B,SAAS,EAAE,IAAI;QACf,KAAK,EAAE,UAAU;KACpB;IACD,QAAQ,EAAE;QACN,IAAI,EAAE,qBAAS,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1B,SAAS,EAAE,IAAI;QACf,KAAK,EAAE,SAAS;KACnB;IACD,WAAW,EAAE;QACT,IAAI,EAAE,qBAAS,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1B,SAAS,EAAE,IAAI;QACf,KAAK,EAAE,aAAa;KACvB;IACD,OAAO,EAAE;QACL,IAAI,EAAE,qBAAS,CAAC,OAAO,CAAC,QAAQ;QAChC,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,UAAU;KACpB;IACD,QAAQ,EAAE;QACN,IAAI,EAAE,qBAAS,CAAC,OAAO,CAAC,QAAQ;QAChC,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,WAAW;KACrB;CACJ,EAAE;IACC,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE,eAAe;IAC1B,SAAS,EAAE,qBAAS;CACvB,CAAC,CAAC"}

View File

@ -1,29 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Sequelize_1 = require("../Sequelize");
class CharacterGrowthRate extends Sequelize_1.Model {
}
exports.CharacterGrowthRate = CharacterGrowthRate;
CharacterGrowthRate.init({
value: {
type: Sequelize_1.DataTypes.INTEGER,
defaultValue: 0,
allowNull: false,
field: "Nb_Value",
},
idCharacter: {
type: Sequelize_1.DataTypes.INTEGER.UNSIGNED,
allowNull: false,
field: "Id_Character",
},
idStat: {
type: Sequelize_1.DataTypes.INTEGER.UNSIGNED,
allowNull: false,
field: "Id_Stat",
},
}, {
timestamps: false,
tableName: 'Tbl_Character_Growth_Rate',
sequelize: Sequelize_1.sequelize,
});
//# sourceMappingURL=CharacterGrowthRate.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"CharacterGrowthRate.js","sourceRoot":"","sources":["../../src/models/CharacterGrowthRate.ts"],"names":[],"mappings":";;AAAA,4CAAyD;AAEzD,MAAM,mBAAoB,SAAQ,iBAAK;CAItC;AAyBO,kDAAmB;AAvB3B,mBAAmB,CAAC,IAAI,CAAC;IACrB,KAAK,EAAE;QACH,IAAI,EAAE,qBAAS,CAAC,OAAO;QACvB,YAAY,EAAE,CAAC;QACf,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,UAAU;KACpB;IACD,WAAW,EAAE;QACT,IAAI,EAAE,qBAAS,CAAC,OAAO,CAAC,QAAQ;QAChC,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,cAAc;KACxB;IACD,MAAM,EAAE;QACJ,IAAI,EAAE,qBAAS,CAAC,OAAO,CAAC,QAAQ;QAChC,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,SAAS;KACnB;CACJ,EAAE;IACC,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE,2BAA2B;IACtC,SAAS,EAAE,qBAAS;CACvB,CAAC,CAAC"}

View File

@ -1,29 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Sequelize_1 = require("../Sequelize");
class ClassGrowthRate extends Sequelize_1.Model {
}
exports.ClassGrowthRate = ClassGrowthRate;
ClassGrowthRate.init({
value: {
type: Sequelize_1.DataTypes.INTEGER,
defaultValue: 0,
allowNull: false,
field: "Nb_Value",
},
idClass: {
type: Sequelize_1.DataTypes.INTEGER.UNSIGNED,
allowNull: false,
field: "Id_Class",
},
idStat: {
type: Sequelize_1.DataTypes.INTEGER.UNSIGNED,
allowNull: false,
field: "Id_Stat",
},
}, {
timestamps: false,
tableName: 'Tbl_Class_Growth_Rate',
sequelize: Sequelize_1.sequelize,
});
//# sourceMappingURL=ClassGrowthRate.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"ClassGrowthRate.js","sourceRoot":"","sources":["../../src/models/ClassGrowthRate.ts"],"names":[],"mappings":";;AAAA,4CAAyD;AAEzD,MAAM,eAAgB,SAAQ,iBAAK;CAIlC;AAyBO,0CAAe;AAvBvB,eAAe,CAAC,IAAI,CAAC;IACjB,KAAK,EAAE;QACH,IAAI,EAAE,qBAAS,CAAC,OAAO;QACvB,YAAY,EAAE,CAAC;QACf,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,UAAU;KACpB;IACD,OAAO,EAAE;QACL,IAAI,EAAE,qBAAS,CAAC,OAAO,CAAC,QAAQ;QAChC,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,UAAU;KACpB;IACD,MAAM,EAAE;QACJ,IAAI,EAAE,qBAAS,CAAC,OAAO,CAAC,QAAQ;QAChC,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,SAAS;KACnB;CACJ,EAAE;IACC,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE,uBAAuB;IAClC,SAAS,EAAE,qBAAS;CACvB,CAAC,CAAC"}

View File

@ -1,41 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Sequelize_1 = require("../Sequelize");
class FE_Class extends Sequelize_1.Model {
}
exports.FE_Class = FE_Class;
const nameField = "Nm_Class";
FE_Class.init({
id: {
type: Sequelize_1.DataTypes.INTEGER.UNSIGNED,
autoIncrement: true,
primaryKey: true,
field: "Id_Class",
},
name: {
type: Sequelize_1.DataTypes.STRING(32),
allowNull: false,
field: nameField,
},
isAvailableForAll: {
type: Sequelize_1.DataTypes.BOOLEAN,
allowNull: false,
field: "Is_Available_For_All",
},
idGender: {
type: Sequelize_1.DataTypes.INTEGER.UNSIGNED,
allowNull: false,
field: "Id_Gender",
},
}, {
indexes: [
{
unique: true,
fields: [nameField],
},
],
timestamps: false,
tableName: 'Tbl_Class',
sequelize: Sequelize_1.sequelize,
});
//# sourceMappingURL=FE_Class.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"FE_Class.js","sourceRoot":"","sources":["../../src/models/FE_Class.ts"],"names":[],"mappings":";;AAAA,4CAAyD;AAEzD,MAAM,QAAS,SAAQ,iBAAK;CAK3B;AAsCO,4BAAQ;AApChB,MAAM,SAAS,GAAG,UAAU,CAAC;AAE7B,QAAQ,CAAC,IAAI,CAAC;IACV,EAAE,EAAE;QACA,IAAI,EAAE,qBAAS,CAAC,OAAO,CAAC,QAAQ;QAChC,aAAa,EAAE,IAAI;QACnB,UAAU,EAAE,IAAI;QAChB,KAAK,EAAE,UAAU;KACpB;IACD,IAAI,EAAE;QACF,IAAI,EAAE,qBAAS,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1B,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,SAAS;KACnB;IACD,iBAAiB,EAAE;QACf,IAAI,EAAE,qBAAS,CAAC,OAAO;QACvB,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,sBAAsB;KAChC;IACD,QAAQ,EAAE;QACN,IAAI,EAAE,qBAAS,CAAC,OAAO,CAAC,QAAQ;QAChC,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,WAAW;KACrB;CACJ,EAAE;IACC,OAAO,EAAE;QACL;YACI,MAAM,EAAE,IAAI;YACZ,MAAM,EAAE,CAAC,SAAS,CAAC;SACtB;KACJ;IACD,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,qBAAS;CACvB,CAAC,CAAC"}

View File

@ -1,31 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Sequelize_1 = require("../Sequelize");
class Gender extends Sequelize_1.Model {
}
exports.Gender = Gender;
const nameField = "Nm_Gender";
Gender.init({
id: {
type: Sequelize_1.DataTypes.INTEGER.UNSIGNED,
autoIncrement: true,
primaryKey: true,
field: "Id_Gender",
},
name: {
type: Sequelize_1.DataTypes.STRING(16),
allowNull: false,
field: nameField,
},
}, {
indexes: [
{
unique: true,
fields: [nameField],
}
],
timestamps: false,
tableName: 'Tbl_Gender',
sequelize: Sequelize_1.sequelize,
});
//# sourceMappingURL=Gender.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"Gender.js","sourceRoot":"","sources":["../../src/models/Gender.ts"],"names":[],"mappings":";;AAAA,4CAAyD;AAEzD,MAAM,MAAO,SAAQ,iBAAK;CAGzB;AA4BO,wBAAM;AA1Bd,MAAM,SAAS,GAAG,WAAW,CAAC;AAE9B,MAAM,CAAC,IAAI,CAAC;IACR,EAAE,EAAE;QACA,IAAI,EAAE,qBAAS,CAAC,OAAO,CAAC,QAAQ;QAChC,aAAa,EAAE,IAAI;QACnB,UAAU,EAAE,IAAI;QAChB,KAAK,EAAE,WAAW;KACrB;IACD,IAAI,EAAE;QACF,IAAI,EAAE,qBAAS,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1B,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,SAAS;KACnB;CACJ,EAAE;IACC,OAAO,EAAE;QACL;YACI,MAAM,EAAE,IAAI;YACZ,MAAM,EAAE,CAAC,SAAS,CAAC;SACtB;KACJ;IACD,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE,YAAY;IACvB,SAAS,EAAE,qBAAS;CACvB,CAAC,CAAC"}

View File

@ -1,31 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Sequelize_1 = require("../Sequelize");
class House extends Sequelize_1.Model {
}
exports.House = House;
const nameField = "Nm_House";
House.init({
id: {
type: Sequelize_1.DataTypes.INTEGER.UNSIGNED,
autoIncrement: true,
primaryKey: true,
field: "Id_House",
},
name: {
type: Sequelize_1.DataTypes.STRING(64),
allowNull: false,
field: nameField,
},
}, {
indexes: [
{
unique: true,
fields: [nameField],
}
],
timestamps: false,
tableName: 'Tbl_House',
sequelize: Sequelize_1.sequelize,
});
//# sourceMappingURL=House.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"House.js","sourceRoot":"","sources":["../../src/models/House.ts"],"names":[],"mappings":";;AAAA,4CAAyD;AAEzD,MAAM,KAAM,SAAQ,iBAAK;CAGxB;AA4BO,sBAAK;AA1Bb,MAAM,SAAS,GAAG,UAAU,CAAC;AAE7B,KAAK,CAAC,IAAI,CAAC;IACP,EAAE,EAAE;QACA,IAAI,EAAE,qBAAS,CAAC,OAAO,CAAC,QAAQ;QAChC,aAAa,EAAE,IAAI;QACnB,UAAU,EAAE,IAAI;QAChB,KAAK,EAAE,UAAU;KACpB;IACD,IAAI,EAAE;QACF,IAAI,EAAE,qBAAS,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1B,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,SAAS;KACnB;CACJ,EAAE;IACC,OAAO,EAAE;QACL;YACI,MAAM,EAAE,IAAI;YACZ,MAAM,EAAE,CAAC,SAAS,CAAC;SACtB;KACJ;IACD,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,qBAAS;CACvB,CAAC,CAAC"}

View File

@ -1,23 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Sequelize_1 = require("../Sequelize");
class RestrictedCharacterClass extends Sequelize_1.Model {
}
exports.RestrictedCharacterClass = RestrictedCharacterClass;
RestrictedCharacterClass.init({
idClass: {
type: Sequelize_1.DataTypes.INTEGER.UNSIGNED,
allowNull: false,
field: "Id_Class",
},
idCharacter: {
type: Sequelize_1.DataTypes.INTEGER.UNSIGNED,
allowNull: false,
field: "Id_Character",
},
}, {
timestamps: false,
tableName: 'Tbl_Character_Class',
sequelize: Sequelize_1.sequelize,
});
//# sourceMappingURL=RestrictedCharacterClass.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"RestrictedCharacterClass.js","sourceRoot":"","sources":["../../src/models/RestrictedCharacterClass.ts"],"names":[],"mappings":";;AAAA,4CAAyD;AAEzD,MAAM,wBAAyB,SAAQ,iBAAK;CAG3C;AAmBO,4DAAwB;AAjBhC,wBAAwB,CAAC,IAAI,CAAC;IAC1B,OAAO,EAAE;QACL,IAAI,EAAE,qBAAS,CAAC,OAAO,CAAC,QAAQ;QAChC,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,UAAU;KACpB;IACD,WAAW,EAAE;QACT,IAAI,EAAE,qBAAS,CAAC,OAAO,CAAC,QAAQ;QAChC,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,cAAc;KACxB;CACJ,EAAE;IACC,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE,qBAAqB;IAChC,SAAS,EAAE,qBAAS;CACvB,CAAC,CAAC"}

View File

@ -1,41 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Sequelize_1 = require("../Sequelize");
class Stat extends Sequelize_1.Model {
}
exports.Stat = Stat;
const nameField = "Nm_Stat";
const shortNameField = "Nm_Short";
Stat.init({
id: {
type: Sequelize_1.DataTypes.INTEGER.UNSIGNED,
autoIncrement: true,
primaryKey: true,
field: "Id_Stat",
},
name: {
type: Sequelize_1.DataTypes.STRING(16),
allowNull: false,
field: nameField,
},
shortName: {
type: Sequelize_1.DataTypes.STRING(3),
allowNull: false,
field: shortNameField,
},
}, {
indexes: [
{
unique: true,
fields: [nameField],
},
{
unique: true,
fields: [shortNameField],
}
],
timestamps: false,
tableName: 'Tbl_Stat',
sequelize: Sequelize_1.sequelize,
});
//# sourceMappingURL=Stat.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"Stat.js","sourceRoot":"","sources":["../../src/models/Stat.ts"],"names":[],"mappings":";;AAAA,4CAAyD;AAEzD,MAAM,IAAK,SAAQ,iBAAK;CAIvB;AAsCO,oBAAI;AApCZ,MAAM,SAAS,GAAG,SAAS,CAAC;AAC5B,MAAM,cAAc,GAAG,UAAU,CAAC;AAElC,IAAI,CAAC,IAAI,CAAC;IACN,EAAE,EAAE;QACA,IAAI,EAAE,qBAAS,CAAC,OAAO,CAAC,QAAQ;QAChC,aAAa,EAAE,IAAI;QACnB,UAAU,EAAE,IAAI;QAChB,KAAK,EAAE,SAAS;KACnB;IACD,IAAI,EAAE;QACF,IAAI,EAAE,qBAAS,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1B,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,SAAS;KACnB;IACD,SAAS,EAAE;QACP,IAAI,EAAE,qBAAS,CAAC,MAAM,CAAC,CAAC,CAAC;QACzB,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,cAAc;KACxB;CACJ,EAAE;IACC,OAAO,EAAE;QACL;YACI,MAAM,EAAE,IAAI;YACZ,MAAM,EAAE,CAAC,SAAS,CAAC;SACtB;QACD;YACI,MAAM,EAAE,IAAI;YACZ,MAAM,EAAE,CAAC,cAAc,CAAC;SAC3B;KACJ;IACD,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE,UAAU;IACrB,SAAS,EAAE,qBAAS;CACvB,CAAC,CAAC"}

181
server/fecharts.php Normal file
View File

@ -0,0 +1,181 @@
<?php
require('database.php');
class fecharts {
private $conn;
public function __construct()
{
$this->conn = database::getInstance()->getConnection();
}
private function getAllCharacters() {
$stmt = $this->conn->prepare("
SELECT
Id_Character as id,
Nm_First as firstName,
Nm_Last as lastName,
Nm_File_Img as imgFileName,
Id_House as idHouse,
Id_Gender as idGender
FROM Tbl_Character
");
$stmt->execute();
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
return $result;
}
private function getAllCharactersGrowthRates() {
$stmt = $this->conn->prepare("
SELECT
Nb_Value as value,
Id_Character as idCharacter,
Id_Stat as idStat
FROM Tbl_Character_Growth_Rate
");
$stmt->execute();
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
return $result;
}
private function getAllClassesGrowthRates() {
$stmt = $this->conn->prepare("
SELECT
Nb_Value as value,
Id_Class as idClass,
Id_Stat as idStat
FROM Tbl_Class_Growth_Rate
");
$stmt->execute();
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
return $result;
}
private function getAllClasses() {
$stmt = $this->conn->prepare("
SELECT
Id_Class as id,
Nm_Class as name,
Is_Available_For_All as isAvailableForAll,
Id_Gender as idGender
FROM Tbl_Class
");
$stmt->execute();
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
return $result;
}
private function getAllGenders() {
$stmt = $this->conn->prepare("
SELECT
Id_Gender as id,
Nm_Gender as name
FROM Tbl_Gender
ORDER BY id ASC
");
$stmt->execute();
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
return $result;
}
private function getAllHouses() {
$stmt = $this->conn->prepare("
SELECT
Id_House as id,
Nm_House as name
FROM Tbl_House
ORDER BY id ASC
");
$stmt->execute();
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
return $result;
}
public function getAllRestrictedClasses() {
$stmt = $this->conn->prepare("
SELECT
Id_Class as idClass,
Id_Character as idCharacter
FROM Tbl_Character_Class
");
$stmt->execute();
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
return $result;
}
private function getAllStats() {
$stmt = $this->conn->prepare("
SELECT
Id_Stat as id,
Nm_Stat as name,
Nm_Short as shortName
FROM Tbl_Stat
");
$stmt->execute();
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
return $result;
}
private function getCatalogueLastVersion() {
$stmt = $this->conn->prepare("
SELECT
No_Version as version,
Dttm_Last_Update as lastUpdate
FROM Tbl_Catalogue
ORDER BY lastUpdate DESC
LIMIT 1
");
$stmt->execute();
$result = $stmt->fetch(PDO::FETCH_ASSOC);
return array_values($result)[0];
}
public function getAllData() {
$data = new stdClass();
$data->version = $this->getCatalogueLastVersion();
$data->characters = $this->getAllCharacters();
$data->charGrowthRates = $this->getAllCharactersGrowthRates();
$data->classGrowthRates = $this->getAllClassesGrowthRates();
$data->classes = $this->getAllClasses();
$data->genders = $this->getAllGenders();
$data->houses = $this->getAllHouses();
$data->restrictedClasses = $this->getAllRestrictedClasses();
$data->stats = $this->getAllStats();
return $data;
}
public function getUpdatedData($clientVersion) {
$serverVersion = $this->getCatalogueLastVersion();
if (version_compare($clientVersion, $serverVersion, '<')) {
return $this->getAllData();
} else {
return null;
}
}
public function getCurrentVersion() {
$version = new stdClass();
$version->version = $this->getCatalogueLastVersion();
return $version;
}
}

44
server/index.php Normal file
View File

@ -0,0 +1,44 @@
<?php
require('fecharts.php');
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept');
$fecharts = new fecharts();
// Explode the URI
$request_uri = explode('/', $_SERVER['REQUEST_URI']);
// Define the router from the last element of the URI
switch (end($request_uri)) {
case '':
echo 'Hello world!';
break;
case 'all':
// Get all data
header('Content-Type: application/json; charset=UTF-8');
$data = json_encode($fecharts->getAllData());
echo $data;
break;
case 'update':
if (isset($_POST['version'])) {
$clientVersion = $_POST['version'];
header('Content-Type: application/json; charset=UTF-8');
$data = json_encode($fecharts->getUpdatedData($clientVersion));
echo $data;
} else {
echo 'Missing or invalid \'version\' parameter';
}
break;
case 'version':
// Get the current version of the catalogue
header('Content-Type: application/json; charset=UTF-8');
$version = json_encode($fecharts->getCurrentVersion());
echo $version;
break;
default:
header('HTTP/1.0 404 Not Found');
echo 'Unknown request';
break;
}

924
server/package-lock.json generated
View File

@ -1,924 +0,0 @@
{
"name": "fe-charts",
"version": "0.1.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@types/body-parser": {
"version": "1.17.1",
"resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.17.1.tgz",
"integrity": "sha512-RoX2EZjMiFMjZh9lmYrwgoP9RTpAjSHiJxdp4oidAQVO02T7HER3xj9UKue5534ULWeqVEkujhWcyvUce+d68w==",
"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/express": {
"version": "4.17.2",
"resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.2.tgz",
"integrity": "sha512-5mHFNyavtLoJmnusB8OKJ5bshSzw+qkMIBAobLrIM48HJvunFva9mOa6aBwh64lBFyNwBbs0xiEFuj4eU/NjCA==",
"requires": {
"@types/body-parser": "*",
"@types/express-serve-static-core": "*",
"@types/serve-static": "*"
}
},
"@types/express-serve-static-core": {
"version": "4.17.0",
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.0.tgz",
"integrity": "sha512-Xnub7w57uvcBqFdIGoRg1KhNOeEj0vB6ykUM7uFWyxvbdE89GFyqgmUcanAriMr4YOxNFZBAWkfcWIb4WBPt3g==",
"requires": {
"@types/node": "*",
"@types/range-parser": "*"
}
},
"@types/mime": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@types/mime/-/mime-2.0.1.tgz",
"integrity": "sha512-FwI9gX75FgVBJ7ywgnq/P7tw+/o1GUbtP0KzbtusLigAOgIgNISRK0ZPl4qertvXSIE8YbsVJueQ90cDt9YYyw=="
},
"@types/node": {
"version": "12.12.14",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.14.tgz",
"integrity": "sha512-u/SJDyXwuihpwjXy7hOOghagLEV1KdAST6syfnOk6QZAMzZuWZqXy5aYYZbh8Jdpd4escVFP0MvftHNDb9pruA=="
},
"@types/range-parser": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.3.tgz",
"integrity": "sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA=="
},
"@types/serve-static": {
"version": "1.13.3",
"resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.3.tgz",
"integrity": "sha512-oprSwp094zOglVrXdlo/4bAHtKTAxX6VT8FOZlBKrmyLbNvE1zxZyJ6yikMVtHIvwP45+ZQGJn+FdXGKTozq0g==",
"requires": {
"@types/express-serve-static-core": "*",
"@types/mime": "*"
}
},
"accepts": {
"version": "1.3.7",
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz",
"integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==",
"requires": {
"mime-types": "~2.1.24",
"negotiator": "0.6.2"
}
},
"ansicolors": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/ansicolors/-/ansicolors-0.3.2.tgz",
"integrity": "sha1-ZlWX3oap/+Oqm/vmyuXG6kJrSXk="
},
"any-promise": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz",
"integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8="
},
"array-flatten": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
"integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI="
},
"axios": {
"version": "0.19.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.19.0.tgz",
"integrity": "sha512-1uvKqKQta3KBxIz14F2v06AEHZ/dIoeKfbTRkK1E5oqjDnuEerLmYTgJB5AiQZHJcljpg1TuRzdjDR06qNk0DQ==",
"requires": {
"follow-redirects": "1.5.10",
"is-buffer": "^2.0.2"
}
},
"bluebird": {
"version": "3.7.1",
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.1.tgz",
"integrity": "sha512-DdmyoGCleJnkbp3nkbxTLJ18rjDsE4yCggEwKNXkeV123sPNfOCYeDoeuOY+F2FrSjO1YXcTU+dsy96KMy+gcg=="
},
"body-parser": {
"version": "1.19.0",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz",
"integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==",
"requires": {
"bytes": "3.1.0",
"content-type": "~1.0.4",
"debug": "2.6.9",
"depd": "~1.1.2",
"http-errors": "1.7.2",
"iconv-lite": "0.4.24",
"on-finished": "~2.3.0",
"qs": "6.7.0",
"raw-body": "2.4.0",
"type-is": "~1.6.17"
},
"dependencies": {
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"requires": {
"ms": "2.0.0"
}
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
}
}
},
"boolbase": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz",
"integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24="
},
"bytes": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz",
"integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg=="
},
"cardinal": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/cardinal/-/cardinal-2.1.1.tgz",
"integrity": "sha1-fMEFXYItISlU0HsIXeolHMe8VQU=",
"requires": {
"ansicolors": "~0.3.2",
"redeyed": "~2.1.0"
}
},
"cheerio": {
"version": "1.0.0-rc.3",
"resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.3.tgz",
"integrity": "sha512-0td5ijfUPuubwLUu0OBoe98gZj8C/AA+RW3v67GPlGOrvxWjZmBXiBCRU+I8VEiNyJzjth40POfHiz2RB3gImA==",
"requires": {
"css-select": "~1.2.0",
"dom-serializer": "~0.1.1",
"entities": "~1.1.1",
"htmlparser2": "^3.9.1",
"lodash": "^4.15.0",
"parse5": "^3.0.1"
}
},
"cls-bluebird": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/cls-bluebird/-/cls-bluebird-2.1.0.tgz",
"integrity": "sha1-N+8eCAqP+1XC9BZPU28ZGeeWiu4=",
"requires": {
"is-bluebird": "^1.0.2",
"shimmer": "^1.1.0"
}
},
"content-disposition": {
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz",
"integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==",
"requires": {
"safe-buffer": "5.1.2"
}
},
"content-type": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz",
"integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA=="
},
"cookie": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz",
"integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg=="
},
"cookie-signature": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
"integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw="
},
"css-select": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz",
"integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=",
"requires": {
"boolbase": "~1.0.0",
"css-what": "2.1",
"domutils": "1.5.1",
"nth-check": "~1.0.1"
}
},
"css-what": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.3.tgz",
"integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg=="
},
"debug": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
"integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
"requires": {
"ms": "^2.1.1"
}
},
"denque": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/denque/-/denque-1.4.1.tgz",
"integrity": "sha512-OfzPuSZKGcgr96rf1oODnfjqBFmr1DVoc/TrItj3Ohe0Ah1C5WX5Baquw/9U9KovnQ88EqmJbD66rKYUQYN1tQ=="
},
"depd": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
"integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak="
},
"destroy": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz",
"integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA="
},
"dom-serializer": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.1.tgz",
"integrity": "sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==",
"requires": {
"domelementtype": "^1.3.0",
"entities": "^1.1.1"
}
},
"domelementtype": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz",
"integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w=="
},
"domhandler": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz",
"integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==",
"requires": {
"domelementtype": "1"
}
},
"domutils": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz",
"integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=",
"requires": {
"dom-serializer": "0",
"domelementtype": "1"
}
},
"dotenv": {
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz",
"integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw=="
},
"dottie": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/dottie/-/dottie-2.0.1.tgz",
"integrity": "sha512-ch5OQgvGDK2u8pSZeSYAQaV/lczImd7pMJ7BcEPXmnFVjy4yJIzP6CsODJUTH8mg1tyH1Z2abOiuJO3DjZ/GBw=="
},
"ee-first": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
"integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
},
"encodeurl": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
"integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k="
},
"entities": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz",
"integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w=="
},
"escape-html": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
"integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg="
},
"esprima": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="
},
"etag": {
"version": "1.8.1",
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
"integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc="
},
"express": {
"version": "4.17.1",
"resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz",
"integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==",
"requires": {
"accepts": "~1.3.7",
"array-flatten": "1.1.1",
"body-parser": "1.19.0",
"content-disposition": "0.5.3",
"content-type": "~1.0.4",
"cookie": "0.4.0",
"cookie-signature": "1.0.6",
"debug": "2.6.9",
"depd": "~1.1.2",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
"finalhandler": "~1.1.2",
"fresh": "0.5.2",
"merge-descriptors": "1.0.1",
"methods": "~1.1.2",
"on-finished": "~2.3.0",
"parseurl": "~1.3.3",
"path-to-regexp": "0.1.7",
"proxy-addr": "~2.0.5",
"qs": "6.7.0",
"range-parser": "~1.2.1",
"safe-buffer": "5.1.2",
"send": "0.17.1",
"serve-static": "1.14.1",
"setprototypeof": "1.1.1",
"statuses": "~1.5.0",
"type-is": "~1.6.18",
"utils-merge": "1.0.1",
"vary": "~1.1.2"
},
"dependencies": {
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"requires": {
"ms": "2.0.0"
}
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
}
}
},
"finalhandler": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz",
"integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==",
"requires": {
"debug": "2.6.9",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"on-finished": "~2.3.0",
"parseurl": "~1.3.3",
"statuses": "~1.5.0",
"unpipe": "~1.0.0"
},
"dependencies": {
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"requires": {
"ms": "2.0.0"
}
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
}
}
},
"follow-redirects": {
"version": "1.5.10",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz",
"integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==",
"requires": {
"debug": "=3.1.0"
},
"dependencies": {
"debug": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
"requires": {
"ms": "2.0.0"
}
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
}
}
},
"forwarded": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz",
"integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ="
},
"fresh": {
"version": "0.5.2",
"resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
"integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac="
},
"generate-function": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz",
"integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==",
"requires": {
"is-property": "^1.0.2"
}
},
"htmlparser2": {
"version": "3.10.1",
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz",
"integrity": "sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==",
"requires": {
"domelementtype": "^1.3.1",
"domhandler": "^2.3.0",
"domutils": "^1.5.1",
"entities": "^1.1.1",
"inherits": "^2.0.1",
"readable-stream": "^3.1.1"
}
},
"http-errors": {
"version": "1.7.2",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz",
"integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==",
"requires": {
"depd": "~1.1.2",
"inherits": "2.0.3",
"setprototypeof": "1.1.1",
"statuses": ">= 1.5.0 < 2",
"toidentifier": "1.0.0"
}
},
"http-status": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/http-status/-/http-status-1.4.1.tgz",
"integrity": "sha512-nEg0G+mDyN+IkMkE3m+Sl6a0AeLAfuDBLraHeSSz8xB2V1O4BnHCW+waX2P2jDnp5yNEuK6NcvBByfWG2o/Unw=="
},
"iconv-lite": {
"version": "0.4.24",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
"requires": {
"safer-buffer": ">= 2.1.2 < 3"
}
},
"inflection": {
"version": "1.12.0",
"resolved": "https://registry.npmjs.org/inflection/-/inflection-1.12.0.tgz",
"integrity": "sha1-ogCTVlbW9fa8TcdQLhrstwMihBY="
},
"inherits": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
},
"ipaddr.js": {
"version": "1.9.0",
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz",
"integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA=="
},
"is-bluebird": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/is-bluebird/-/is-bluebird-1.0.2.tgz",
"integrity": "sha1-CWQ5Bg9KpBGr7hkUOoTWpVNG1uI="
},
"is-buffer": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz",
"integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A=="
},
"is-property": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz",
"integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ="
},
"lodash": {
"version": "4.17.15",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A=="
},
"long": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz",
"integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA=="
},
"lru-cache": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
"integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
"requires": {
"yallist": "^3.0.2"
}
},
"media-typer": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
"integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g="
},
"merge-descriptors": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
"integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E="
},
"methods": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
"integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4="
},
"mime": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg=="
},
"mime-db": {
"version": "1.42.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.42.0.tgz",
"integrity": "sha512-UbfJCR4UAVRNgMpfImz05smAXK7+c+ZntjaA26ANtkXLlOe947Aag5zdIcKQULAiF9Cq4WxBi9jUs5zkA84bYQ=="
},
"mime-types": {
"version": "2.1.25",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.25.tgz",
"integrity": "sha512-5KhStqB5xpTAeGqKBAMgwaYMnQik7teQN4IAzC7npDv6kzeU6prfkR67bc87J1kWMPGkoaZSq1npmexMgkmEVg==",
"requires": {
"mime-db": "1.42.0"
}
},
"moment": {
"version": "2.24.0",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz",
"integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg=="
},
"moment-timezone": {
"version": "0.5.27",
"resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.27.tgz",
"integrity": "sha512-EIKQs7h5sAsjhPCqN6ggx6cEbs94GK050254TIJySD1bzoM5JTYDwAU1IoVOeTOL6Gm27kYJ51/uuvq1kIlrbw==",
"requires": {
"moment": ">= 2.9.0"
}
},
"ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
"mysql2": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/mysql2/-/mysql2-2.0.1.tgz",
"integrity": "sha512-GbiolYnRPPgbkgI1Cbkkr15MvjBVcpbOsm5qBURhlNuokGkNUOv2I/ZYzKap7yirCf4zzyCUJ+qK6ZSWsr1m4A==",
"requires": {
"cardinal": "^2.1.1",
"denque": "^1.4.1",
"generate-function": "^2.3.1",
"iconv-lite": "^0.5.0",
"long": "^4.0.0",
"lru-cache": "^5.1.1",
"named-placeholders": "^1.1.2",
"seq-queue": "^0.0.5",
"sqlstring": "^2.3.1"
},
"dependencies": {
"iconv-lite": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.5.0.tgz",
"integrity": "sha512-NnEhI9hIEKHOzJ4f697DMz9IQEXr/MMJ5w64vN2/4Ai+wRnvV7SBrL0KLoRlwaKVghOc7LQ5YkPLuX146b6Ydw==",
"requires": {
"safer-buffer": ">= 2.1.2 < 3"
}
}
}
},
"named-placeholders": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.2.tgz",
"integrity": "sha512-wiFWqxoLL3PGVReSZpjLVxyJ1bRqe+KKJVbr4hGs1KWfTZTQyezHFBbuKj9hsizHyGV2ne7EMjHdxEGAybD5SA==",
"requires": {
"lru-cache": "^4.1.3"
},
"dependencies": {
"lru-cache": {
"version": "4.1.5",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz",
"integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==",
"requires": {
"pseudomap": "^1.0.2",
"yallist": "^2.1.2"
}
},
"yallist": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
"integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI="
}
}
},
"negotiator": {
"version": "0.6.2",
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz",
"integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw=="
},
"nth-check": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz",
"integrity": "sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==",
"requires": {
"boolbase": "~1.0.0"
}
},
"on-finished": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
"integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=",
"requires": {
"ee-first": "1.1.1"
}
},
"parse5": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/parse5/-/parse5-3.0.3.tgz",
"integrity": "sha512-rgO9Zg5LLLkfJF9E6CCmXlSE4UVceloys8JrFqCcHloC3usd/kJCyPDwH2SOlzix2j3xaP9sUX3e8+kvkuleAA==",
"requires": {
"@types/node": "*"
}
},
"parseurl": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
"integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="
},
"path-to-regexp": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
"integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
},
"proxy-addr": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.5.tgz",
"integrity": "sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ==",
"requires": {
"forwarded": "~0.1.2",
"ipaddr.js": "1.9.0"
}
},
"pseudomap": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz",
"integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM="
},
"qs": {
"version": "6.7.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz",
"integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ=="
},
"range-parser": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
"integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg=="
},
"raw-body": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz",
"integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==",
"requires": {
"bytes": "3.1.0",
"http-errors": "1.7.2",
"iconv-lite": "0.4.24",
"unpipe": "1.0.0"
}
},
"readable-stream": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz",
"integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==",
"requires": {
"inherits": "^2.0.3",
"string_decoder": "^1.1.1",
"util-deprecate": "^1.0.1"
}
},
"redeyed": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/redeyed/-/redeyed-2.1.1.tgz",
"integrity": "sha1-iYS1gV2ZyyIEacme7v/jiRPmzAs=",
"requires": {
"esprima": "~4.0.0"
}
},
"retry-as-promised": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/retry-as-promised/-/retry-as-promised-3.2.0.tgz",
"integrity": "sha512-CybGs60B7oYU/qSQ6kuaFmRd9sTZ6oXSc0toqePvV74Ac6/IFZSI1ReFQmtCN+uvW1Mtqdwpvt/LGOiCBAY2Mg==",
"requires": {
"any-promise": "^1.3.0"
}
},
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
},
"safer-buffer": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
},
"semver": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw=="
},
"send": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz",
"integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==",
"requires": {
"debug": "2.6.9",
"depd": "~1.1.2",
"destroy": "~1.0.4",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
"fresh": "0.5.2",
"http-errors": "~1.7.2",
"mime": "1.6.0",
"ms": "2.1.1",
"on-finished": "~2.3.0",
"range-parser": "~1.2.1",
"statuses": "~1.5.0"
},
"dependencies": {
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"requires": {
"ms": "2.0.0"
},
"dependencies": {
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
}
}
},
"ms": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg=="
}
}
},
"seq-queue": {
"version": "0.0.5",
"resolved": "https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz",
"integrity": "sha1-1WgS4cAXpuTnw+Ojeh2m143TyT4="
},
"sequelize": {
"version": "5.21.2",
"resolved": "https://registry.npmjs.org/sequelize/-/sequelize-5.21.2.tgz",
"integrity": "sha512-MEqJ9NwQi4oy/ylLb2WkfPmhki/BOXC/gJfc8uWUUTETcpLwD1y/5bI1kqVh+qWcECHNsE9G4lmhj5hFbsxqvA==",
"requires": {
"bluebird": "^3.5.0",
"cls-bluebird": "^2.1.0",
"debug": "^4.1.1",
"dottie": "^2.0.0",
"inflection": "1.12.0",
"lodash": "^4.17.15",
"moment": "^2.24.0",
"moment-timezone": "^0.5.21",
"retry-as-promised": "^3.2.0",
"semver": "^6.3.0",
"sequelize-pool": "^2.3.0",
"toposort-class": "^1.0.1",
"uuid": "^3.3.3",
"validator": "^10.11.0",
"wkx": "^0.4.8"
}
},
"sequelize-pool": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/sequelize-pool/-/sequelize-pool-2.3.0.tgz",
"integrity": "sha512-Ibz08vnXvkZ8LJTiUOxRcj1Ckdn7qafNZ2t59jYHMX1VIebTAOYefWdRYFt6z6+hy52WGthAHAoLc9hvk3onqA=="
},
"serve-static": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz",
"integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==",
"requires": {
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"parseurl": "~1.3.3",
"send": "0.17.1"
}
},
"setprototypeof": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz",
"integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw=="
},
"shimmer": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/shimmer/-/shimmer-1.2.1.tgz",
"integrity": "sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw=="
},
"sqlstring": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.1.tgz",
"integrity": "sha1-R1OT/56RR5rqYtyvDKPRSYOn+0A="
},
"statuses": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
"integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow="
},
"string_decoder": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
"integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
"requires": {
"safe-buffer": "~5.2.0"
},
"dependencies": {
"safe-buffer": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz",
"integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg=="
}
}
},
"toidentifier": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz",
"integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw=="
},
"toposort-class": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/toposort-class/-/toposort-class-1.0.1.tgz",
"integrity": "sha1-f/0feMi+KMO6Rc1OGj9e4ZO9mYg="
},
"type-is": {
"version": "1.6.18",
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
"integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
"requires": {
"media-typer": "0.3.0",
"mime-types": "~2.1.24"
}
},
"typescript": {
"version": "3.7.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.2.tgz",
"integrity": "sha512-ml7V7JfiN2Xwvcer+XAf2csGO1bPBdRbFCkYBczNZggrBZ9c7G3riSUeJmqEU5uOtXNPMhE3n+R4FA/3YOAWOQ==",
"dev": true
},
"unpipe": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
"integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw="
},
"util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
},
"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.3",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz",
"integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ=="
},
"validator": {
"version": "10.11.0",
"resolved": "https://registry.npmjs.org/validator/-/validator-10.11.0.tgz",
"integrity": "sha512-X/p3UZerAIsbBfN/IwahhYaBbY68EN/UQBWHtsbXGT5bfrH/p4NQzUCG1kF/rtKaNpnJ7jAu6NGTdSNtyNIXMw=="
},
"vary": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
"integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
},
"wkx": {
"version": "0.4.8",
"resolved": "https://registry.npmjs.org/wkx/-/wkx-0.4.8.tgz",
"integrity": "sha512-ikPXMM9IR/gy/LwiOSqWlSL3X/J5uk9EO2hHNRXS41eTLXaUFEVw9fn/593jW/tE5tedNg8YjT5HkCa4FqQZyQ==",
"requires": {
"@types/node": "*"
}
},
"yallist": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
"integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="
}
}
}

View File

@ -1,42 +0,0 @@
{
"name": "fe-charts",
"version": "0.1.0",
"description": "API for Fire Emblem Three Houses",
"main": "./dist/index.js",
"scripts": {
"start": "tsc && node ./dist/index.js",
"import-char-gr": "tsc && node ./dist/importCharGrowthRates.js importing",
"import-class-gr": "tsc && node ./dist/importClassGrowthRates.js importing",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/dario-cfpt/FE_Charts.git"
},
"keywords": [
"fire",
"emblem",
"three",
"houses"
],
"author": "Dario Genga",
"license": "MIT",
"bugs": {
"url": "https://github.com/dario-cfpt/FE_Charts/issues"
},
"homepage": "https://github.com/dario-cfpt/FE_Charts#readme",
"dependencies": {
"@types/express": "^4.17.2",
"axios": "^0.19.0",
"cheerio": "^1.0.0-rc.3",
"dotenv": "^8.2.0",
"express": "^4.17.1",
"http-status": "^1.4.1",
"mysql2": "^2.0.1",
"semver": "^6.3.0",
"sequelize": "^5.21.2"
},
"devDependencies": {
"typescript": "^3.7.2"
}
}

View File

@ -1,12 +0,0 @@
import {Sequelize, Model, DataTypes} from 'sequelize';
const sequelize = new Sequelize(
process.env.DB_NAME,
process.env.DB_USER,
process.env.DB_PASSWORD,
{
host: process.env.DB_HOST,
dialect: "mysql",
});
export {sequelize, Model, DataTypes};

View File

@ -1,61 +0,0 @@
require("dotenv").config();
const axios = require('axios').default;
const cheerio = require('cheerio');
const {CharacterGrowthRate} = require("./mapping");
import {FE_Charts} from "./index";
const url:string = "https://serenesforest.net/three-houses/characters/growth-rates/";
const mainCharName:string = "Byleth";
const mainCharAlternativeName:string = "Protagonist";
const nameIndex:number = 0;
async function importCharGrowthRates() {
const characters = await FE_Charts.getAllCharacters();
const stats = await FE_Charts.getAllStats();
axios.get(url)
.then(res => {
// We need to remove all line breaks to avoid bad html format
const html = res.data.replace(/[\n\r]/g, "");
const $ = cheerio.load(html);
// parse each tables in the html
$("tbody").each(function (i, elem) {
// parse each rows of the table
elem.children.forEach((row, rowIndex) => {
// The first element is the header of the table, so we must skip it
if (rowIndex != 0) {
let name = $(row.children[nameIndex]).text();
if (name == mainCharAlternativeName) {
name = mainCharName;
}
const char = characters.find(x => x.firstName == name);
if (char !== undefined) {
for (let j = 0; j < stats.length; j++) {
const charGrowthRate = new CharacterGrowthRate();
charGrowthRate.idCharacter = char.id;
charGrowthRate.idStat = stats[j].id;
charGrowthRate.value = parseInt($(row.children[j + 1]).text()); // the first col of the table is for the name, so we have to add 1 to the index
CharacterGrowthRate.upsert({
Id_Character: charGrowthRate.idCharacter,
Id_Stat: charGrowthRate.idStat,
value: charGrowthRate.value,
}).catch(err => FE_Charts.logError(err));
}
} else {
console.log(`Unknown character ${name}`);
}
}
});
});
})
.catch(err => {
FE_Charts.logError(err);
});
}
importCharGrowthRates();

View File

@ -1,60 +0,0 @@
require("dotenv").config();
const axios = require('axios').default;
const cheerio = require('cheerio');
const {ClassGrowthRate} = require("./mapping");
import {FE_Charts} from "./index";
const url:string = "https://serenesforest.net/three-houses/classes/growth-rates/";
const nameIndex:number = 0;
async function importClassGrowthRates() {
const classes = await FE_Charts.getAllClasses();
const stats = await FE_Charts.getAllStats();
axios.get(url)
.then(res => {
// We need to remove all line breaks to avoid bad html format
const html = res.data.replace(/[\n\r]/g, "");
const $ = cheerio.load(html);
$("#enemy").remove(); // Remove all contents for enemies
$("tbody").first().remove(); // Remove the first table who isn't for the growth rates
$("tbody").last().remove(); // Remove the last table who is for enemies and not playable character
// parse each tables in the html
$("tbody").each(function (i, elem) {
// parse each rows of the table
elem.children.forEach((row, rowIndex) => {
// The first element is the header of the table, so we must skip it
if (rowIndex != 0) {
const name = $(row.children[nameIndex]).text();
const feClass = classes.find(x => x.name == name);
if (feClass !== undefined) {
for (let j = 0; j < stats.length; j++) {
const classGrowthRate = new ClassGrowthRate();
classGrowthRate.idClass = feClass.id;
classGrowthRate.idStat = stats[j].id;
classGrowthRate.value = parseInt($(row.children[j + 1]).text()); // the first col of the table is for the name, so we have to add 1 to the index
if (classGrowthRate.value) {
ClassGrowthRate.upsert({
Id_Class: classGrowthRate.idClass,
Id_Stat: classGrowthRate.idStat,
value: classGrowthRate.value,
}).catch(err => FE_Charts.logError(err));
}
}
}
}
});
});
})
.catch(err => {
FE_Charts.logError(err);
});
}
importClassGrowthRates();

View File

@ -1,190 +0,0 @@
require("dotenv").config();
const axios = require('axios').default;
const cheerio = require('cheerio');
const semver = require('semver');
import * as express from "express";
import * as bodyParser from "body-parser";
import * as status from "http-status";
const {Catalogue, Character, CharacterGrowthRate, ClassGrowthRate, FE_Class, Gender, House, Stat, RestrictedCharacterClass} = require("./mapping");
const app = express();
const port = process.env.NODE_PORT || 3000;
const argImport: string = "importing";
app.use(bodyParser.urlencoded({extended: false}));
app.use(bodyParser.json());
app.use(function (req, res, next) {
// Allow client to receive the data
// from : https://enable-cors.org/server_expressjs.html
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
next();
});
abstract class FE_Charts {
static logError(err) {
// TODO: Log to file and manage the error
console.log(err);
}
static async getAllCharacters() {
let characters = null;
await Character.findAll().then(results => {
characters = results;
}).catch(err => FE_Charts.logError(err));
return characters;
}
static async getAllCharactersGrowthRates() {
let charactersGrowRates = null;
await CharacterGrowthRate.findAll({
attributes: ["value", "idCharacter", "idStat"]
}).then(results => {
charactersGrowRates = results
}).catch(err => FE_Charts.logError(err));
return charactersGrowRates;
}
static async getAllClassesGrowthRates() {
let classesGrowRates = null;
await ClassGrowthRate.findAll({
attributes: ["value", "idClass", "idStat"]
}).then(results => {
classesGrowRates = results
}).catch(err => FE_Charts.logError(err));
return classesGrowRates;
}
static async getAllClasses() {
let classes = null;
await FE_Class.findAll().then(results => {
classes = results
}).catch(err => FE_Charts.logError(err));
return classes;
}
static async getAllGenders() {
let genders = null;
await Gender.findAll({
order: [
["id", "ASC"]
]
}).then(results => {
genders = results
}).catch(err => FE_Charts.logError(err));
return genders;
}
static async getAllHouses() {
let houses = null;
await House.findAll({
order: [
["Id_House", "ASC"]
]
}).then(results => {
houses = results
}).catch(err => FE_Charts.logError(err));
return houses;
}
static async getAllRestrictedClasses() {
let restrictedClasses = null;
await RestrictedCharacterClass.findAll({
attributes: ["idClass", "idCharacter"]
}).then(results => {
restrictedClasses = results
}).catch(err => FE_Charts.logError(err));
return restrictedClasses;
}
static async getAllStats() {
let stats = null;
await Stat.findAll().then(results => {
stats = results
}).catch(err => FE_Charts.logError(err));
return stats;
}
static async getCatalogueLastVersion() {
let version = null;
await Catalogue.findAll({
attributes: ["version", ["Dttm_Last_Update", "lastUpdate"]],
limit: 1,
order: [["Dttm_Last_Update", "DESC"]],
}).then(results => {
version = results[0].version;
}).catch(err => FE_Charts.logError(err));
return version;
}
static async getAllData() {
const version = await this.getCatalogueLastVersion();
const characters = await FE_Charts.getAllCharacters();
const characterGrowthRates = await FE_Charts.getAllCharactersGrowthRates();
const classesGrowthRates = await FE_Charts.getAllClassesGrowthRates();
const classes = await FE_Charts.getAllClasses();
const genders = await FE_Charts.getAllGenders();
const houses = await FE_Charts.getAllHouses();
const restrictedClasses = await FE_Charts.getAllRestrictedClasses();
const stats = await FE_Charts.getAllStats();
return {
version: version,
characters: characters,
charGrowthRates: characterGrowthRates,
classGrowthRates: classesGrowthRates,
classes: classes,
genders: genders,
houses: houses,
restrictedClasses: restrictedClasses,
stats: stats,
};
}
}
app.get('/', (req, res) => {
res.send('Hello World!');
});
app.get('/version', (req, res) => {
FE_Charts.getCatalogueLastVersion().then(version => {
res.status(status.OK).send(version);
});
});
app.get('/all', async (req, res) => {
const data = await FE_Charts.getAllData();
res.status(status.OK).send(data);
});
app.post('/update', async (req, res) => {
const clientVersion = req.body.version;
if (clientVersion) {
FE_Charts.getCatalogueLastVersion().then(async (version) => {
try {
if (semver.gt(version, clientVersion)) {
const data = await FE_Charts.getAllData();
res.status(status.OK).send(data);
} else {
res.status(status.OK).send({}); // Catalogue up-to-date
}
} catch (e) {
res.status(status.INTERNAL_SERVER_ERROR).send(e.message);
}
});
} else {
res.status(status.BAD_REQUEST).send("'version' parameter undefined");
}
});
// Don't start the server if we're importing some data
if (process.argv.find(x => x == argImport) == undefined) {
app.listen(port, () => {
console.log(`Example app listening on port ${port}!`);
});
}
export {FE_Charts}

View File

@ -1,59 +0,0 @@
import {sequelize} from "./Sequelize";
import {Catalogue} from "./models/Catalogue";
import {Character} from "./models/Character";
import {CharacterGrowthRate} from "./models/CharacterGrowthRate";
import {ClassGrowthRate} from "./models/ClassGrowthRate";
import {FE_Class} from "./models/FE_Class";
import {Gender} from "./models/Gender";
import {House} from "./models/House";
import {RestrictedCharacterClass} from "./models/RestrictedCharacterClass";
import {Stat} from "./models/Stat";
// Sequelize associations
House.hasMany(Character, {
sourceKey: "id",
foreignKey: "idHouse",
});
Gender.hasMany(Character, {
sourceKey: "id",
foreignKey: "idGender",
});
Gender.hasMany(FE_Class, {
sourceKey: "id",
foreignKey: "idGender",
});
Character.belongsToMany(FE_Class, {
foreignKey: {name: "Id_Character"},
through: RestrictedCharacterClass,
});
FE_Class.belongsToMany(Character, {
foreignKey: {name: "Id_Class"},
through: RestrictedCharacterClass,
});
Character.belongsToMany(Stat, {
foreignKey: {name: "Id_Character"},
through: CharacterGrowthRate,
});
Stat.belongsToMany(Character, {
foreignKey: {name: "Id_Stat"},
through: CharacterGrowthRate,
});
FE_Class.belongsToMany(Stat, {
foreignKey: {name: "Id_Class"},
through: ClassGrowthRate,
});
Stat.belongsToMany(FE_Class, {
foreignKey: {name: "Id_Stat"},
through: ClassGrowthRate,
});
// Create tables if not exists
sequelize.sync();
export {Catalogue, Character, CharacterGrowthRate, ClassGrowthRate, FE_Class, Gender, House, Stat, RestrictedCharacterClass};

View File

@ -1,40 +0,0 @@
import {sequelize, Model, DataTypes} from "../Sequelize";
class Catalogue extends Model {
public id!: number;
public version!: string;
public lastUpdate!: Date;
}
const versionField = "No_Version";
Catalogue.init({
id: {
type: DataTypes.INTEGER.UNSIGNED,
autoIncrement: true,
primaryKey: true,
field: "Id_Catalogue",
},
version: {
type: DataTypes.STRING(16),
allowNull: false,
field: versionField
},
lastUpdate: {
type: DataTypes.DATE,
allowNull: false,
field: "Dttm_Last_Update"
},
}, {
indexes: [
{
unique: true,
fields: [versionField],
},
],
timestamps: false,
tableName: 'Tbl_Catalogue',
sequelize: sequelize,
});
export {Catalogue}

View File

@ -1,50 +0,0 @@
import {sequelize, Model, DataTypes} from "../Sequelize";
class Character extends Model {
public id!: number;
public firstName: string;
public lastName: string;
public imgFileName: string;
public idHouse!: number;
public idGender!: number;
}
Character.init({
id: {
type: DataTypes.INTEGER.UNSIGNED,
autoIncrement: true,
primaryKey: true,
field: "Id_Character",
},
firstName: {
type: DataTypes.STRING(32),
allowNull: true,
field: "Nm_First",
},
lastName: {
type: DataTypes.STRING(32),
allowNull: true,
field: "Nm_Last",
},
imgFileName: {
type: DataTypes.STRING(64),
allowNull: true,
field: "Nm_File_Img",
},
idHouse: {
type: DataTypes.INTEGER.UNSIGNED,
allowNull: false,
field: "Id_House",
},
idGender: {
type: DataTypes.INTEGER.UNSIGNED,
allowNull: false,
field: "Id_Gender",
},
}, {
timestamps: false,
tableName: 'Tbl_Character',
sequelize: sequelize,
});
export {Character}

View File

@ -1,32 +0,0 @@
import {sequelize, Model, DataTypes} from "../Sequelize";
class CharacterGrowthRate extends Model {
public value!: number;
public idCharacter!: number;
public idStat!: number;
}
CharacterGrowthRate.init({
value: {
type: DataTypes.INTEGER,
defaultValue: 0,
allowNull: false,
field: "Nb_Value",
},
idCharacter: {
type: DataTypes.INTEGER.UNSIGNED,
allowNull: false,
field: "Id_Character",
},
idStat: {
type: DataTypes.INTEGER.UNSIGNED,
allowNull: false,
field: "Id_Stat",
},
}, {
timestamps: false,
tableName: 'Tbl_Character_Growth_Rate',
sequelize: sequelize,
});
export {CharacterGrowthRate};

View File

@ -1,32 +0,0 @@
import {sequelize, Model, DataTypes} from "../Sequelize";
class ClassGrowthRate extends Model {
public value!: number;
public idClass!: number;
public idStat!: number;
}
ClassGrowthRate.init({
value: {
type: DataTypes.INTEGER,
defaultValue: 0,
allowNull: false,
field: "Nb_Value",
},
idClass: {
type: DataTypes.INTEGER.UNSIGNED,
allowNull: false,
field: "Id_Class",
},
idStat: {
type: DataTypes.INTEGER.UNSIGNED,
allowNull: false,
field: "Id_Stat",
},
}, {
timestamps: false,
tableName: 'Tbl_Class_Growth_Rate',
sequelize: sequelize,
});
export {ClassGrowthRate};

View File

@ -1,46 +0,0 @@
import {sequelize, Model, DataTypes} from "../Sequelize";
class FE_Class extends Model {
public id!: number;
public name!: string;
public isAvailableForAll!: boolean;
public idGender!: number;
}
const nameField = "Nm_Class";
FE_Class.init({
id: {
type: DataTypes.INTEGER.UNSIGNED,
autoIncrement: true,
primaryKey: true,
field: "Id_Class",
},
name: {
type: DataTypes.STRING(32),
allowNull: false,
field: nameField,
},
isAvailableForAll: {
type: DataTypes.BOOLEAN,
allowNull: false,
field: "Is_Available_For_All",
},
idGender: {
type: DataTypes.INTEGER.UNSIGNED,
allowNull: false,
field: "Id_Gender",
},
}, {
indexes: [
{
unique: true,
fields: [nameField],
},
],
timestamps: false,
tableName: 'Tbl_Class',
sequelize: sequelize,
});
export {FE_Class}

View File

@ -1,34 +0,0 @@
import {sequelize, Model, DataTypes} from "../Sequelize";
class Gender extends Model {
public id!: number;
public name!: string;
}
const nameField = "Nm_Gender";
Gender.init({
id: {
type: DataTypes.INTEGER.UNSIGNED,
autoIncrement: true,
primaryKey: true,
field: "Id_Gender",
},
name: {
type: DataTypes.STRING(16),
allowNull: false,
field: nameField,
},
}, {
indexes: [
{
unique: true,
fields: [nameField],
}
],
timestamps: false,
tableName: 'Tbl_Gender',
sequelize: sequelize,
});
export {Gender}

View File

@ -1,34 +0,0 @@
import {sequelize, Model, DataTypes} from "../Sequelize";
class House extends Model {
public id!: number;
public name!: string;
}
const nameField = "Nm_House";
House.init({
id: {
type: DataTypes.INTEGER.UNSIGNED,
autoIncrement: true,
primaryKey: true,
field: "Id_House",
},
name: {
type: DataTypes.STRING(64),
allowNull: false,
field: nameField,
},
}, {
indexes: [
{
unique: true,
fields: [nameField],
}
],
timestamps: false,
tableName: 'Tbl_House',
sequelize: sequelize,
});
export {House}

View File

@ -1,25 +0,0 @@
import {sequelize, Model, DataTypes} from "../Sequelize";
class RestrictedCharacterClass extends Model {
public idClass!: number;
public idCharacter!: number;
}
RestrictedCharacterClass.init({
idClass: {
type: DataTypes.INTEGER.UNSIGNED,
allowNull: false,
field: "Id_Class",
},
idCharacter: {
type: DataTypes.INTEGER.UNSIGNED,
allowNull: false,
field: "Id_Character",
},
}, {
timestamps: false,
tableName: 'Tbl_Character_Class',
sequelize: sequelize,
});
export {RestrictedCharacterClass};

View File

@ -1,45 +0,0 @@
import {sequelize, Model, DataTypes} from "../Sequelize";
class Stat extends Model {
public id!: number;
public name!: string;
public shortName!: string;
}
const nameField = "Nm_Stat";
const shortNameField = "Nm_Short";
Stat.init({
id: {
type: DataTypes.INTEGER.UNSIGNED,
autoIncrement: true,
primaryKey: true,
field: "Id_Stat",
},
name: {
type: DataTypes.STRING(16),
allowNull: false,
field: nameField,
},
shortName: {
type: DataTypes.STRING(3),
allowNull: false,
field: shortNameField,
},
}, {
indexes: [
{
unique: true,
fields: [nameField],
},
{
unique: true,
fields: [shortNameField],
}
],
timestamps: false,
tableName: 'Tbl_Stat',
sequelize: sequelize,
});
export {Stat}

View File

@ -1,14 +0,0 @@
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"outDir": "dist",
"sourceMap": true
},
"include": [
"src/**/*.ts"
],
"exclude": [
"node_modules"
]
}