Compare commits
46 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 200c933208 | |||
| 0046a045d8 | |||
| 0b9677351b | |||
| ad82fab926 | |||
| 2e06ca28ea | |||
| 3df51cc121 | |||
| bec473f906 | |||
| b4d59da25a | |||
| c24ddc4cf5 | |||
| 766f79b9d1 | |||
| 0de76b2a2e | |||
| fc4c38e80d | |||
| 16c0ac5f6b | |||
| 7b4e7c20da | |||
| b30bc5a55b | |||
| 51d80ac825 | |||
| 943f2b065e | |||
| cf2fc5bce5 | |||
| cc1f7770fd | |||
| 9936184944 | |||
| 7d689c103a | |||
| 78f2ae4a77 | |||
| 7e99f242c4 | |||
| ccbc286369 | |||
| 055f10d7c4 | |||
| 3b9a9492c2 | |||
| 061ea3abe1 | |||
| a858262619 | |||
| 4701ee1a88 | |||
| 22ac369b47 | |||
| f4f91d5c14 | |||
| ef328ecf8a | |||
| 57eb20271b | |||
| bc9bffd0c9 | |||
| 9a2c5640f3 | |||
| 7dfe5576d9 | |||
| a933e665ed | |||
| 758c23d345 | |||
| 43a6d7be6f | |||
| 1562ea1a77 | |||
| da2a5eb901 | |||
| 2b232f2c03 | |||
| 11e0e4701b | |||
| 4a7618a682 | |||
| 1ae438a299 | |||
| 013a6b27ea |
@@ -0,0 +1,19 @@
|
||||
TYPEDB = mariadb
|
||||
|
||||
DB = ejemploCenso
|
||||
|
||||
USERDB = censoDev
|
||||
|
||||
PASSDB = holaC3ns0
|
||||
|
||||
HOSTDB = localhost
|
||||
|
||||
PORT = 3000
|
||||
|
||||
TOKEN_SEED = seedAcatlan
|
||||
|
||||
TOKEN_EXP = 1d
|
||||
|
||||
EMAIL = censo@acatlan.unam.mx
|
||||
|
||||
EMAILPASS = C3ns0-4cTln
|
||||
@@ -0,0 +1,19 @@
|
||||
TYPEDB =
|
||||
|
||||
DB =
|
||||
|
||||
USERDB =
|
||||
|
||||
PASSDB =
|
||||
|
||||
HOSTDB =
|
||||
|
||||
PORT =
|
||||
|
||||
TOKEN_SEED =
|
||||
|
||||
TOKEN_EXP =
|
||||
|
||||
EMAIL =
|
||||
|
||||
EMAILPASS =
|
||||
@@ -36,6 +36,9 @@ build/Release
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
./.env
|
||||
scratch/
|
||||
./server/controller/api
|
||||
|
||||
# TypeScript v1 declaration files
|
||||
typings/
|
||||
|
||||
@@ -0,0 +1,222 @@
|
||||
const fillActivoFijo = require('./tables/ActivoFijo');
|
||||
const fillEquipo = require('./tables/Equipo');
|
||||
const fillInventario = require('./tables/Inventario');
|
||||
const fillMarca = require('./tables/Marca');
|
||||
const fillOS = require('./tables/OS');
|
||||
const fillPrinters = require('./tables/Printers');
|
||||
const fillTipo = require('./tables/Tipo');
|
||||
const fillUbicacion = require('./tables/Ubicacion');
|
||||
const fillUResponsable = require('./tables/UResponsable');
|
||||
const fillUso = require('./tables/Uso');
|
||||
|
||||
const faker = require('faker');
|
||||
faker.locale = "es_MX";
|
||||
|
||||
const colors = require('colors');
|
||||
const symbols = require('log-symbols');
|
||||
const progress = require('cli-progress');
|
||||
const Inventario = require('../server/models/tablas/Inventario');
|
||||
|
||||
let rows = 100;
|
||||
let faileds = 0;
|
||||
let ok = 0;
|
||||
let censo = 0;
|
||||
|
||||
async function fillingEquipo() {
|
||||
let count = 1;
|
||||
let barinventario = new progress.SingleBar({
|
||||
format: 'inventario [' + colors.cyan('{bar}') + '] {percentage}%' + '|| {value}/{total} records created.',
|
||||
barCompleteChar: '\u2588',
|
||||
barIncompleteChar: '\u2591',
|
||||
hideCursor: true,
|
||||
stopOnComplete: true,
|
||||
barsize: 30,
|
||||
align: 'right'
|
||||
});
|
||||
let barequipo = new progress.SingleBar({
|
||||
format: 'equipo [' + colors.cyan('{bar}') + '] {percentage}%' + '|| {value}/{total} records created.',
|
||||
barCompleteChar: '\u2588',
|
||||
barIncompleteChar: '\u2591',
|
||||
hideCursor: true,
|
||||
stopOnComplete: true,
|
||||
barsize: 30,
|
||||
align: 'right'
|
||||
});
|
||||
barinventario.start(rows, 0);
|
||||
barequipo.start(rows, 0);
|
||||
for (let i = 0; i < rows; i++) {
|
||||
let noInventario = faker.phone.phoneNumber("2######");
|
||||
let idActivoFijo = idUso = faker.random.number({
|
||||
min: 1,
|
||||
max: 5
|
||||
});
|
||||
|
||||
await fillInventario(noInventario, idActivoFijo)
|
||||
.then(() => censo++)
|
||||
.catch(() => {
|
||||
console.log(symbols.warning, 'Error creating «inventario-equipo»');
|
||||
barinventario.stop();
|
||||
throw new Error();
|
||||
});
|
||||
await fillEquipo(noInventario, idActivoFijo)
|
||||
.catch(async() => {
|
||||
await Inventario.destroy({
|
||||
where: noInventario
|
||||
})
|
||||
then(() => censo--);
|
||||
console.log(symbols.warning, 'Error creating «equipo»');
|
||||
barequipo.stop();
|
||||
throw new Error();
|
||||
});
|
||||
barinventario.increment();
|
||||
barequipo.increment();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
async function fillingPrinters() {
|
||||
let pInventario = new progress.SingleBar({
|
||||
format: 'inventario [' + colors.cyan('{bar}') + '] {percentage}%' + '|| {value}/{total} records created.',
|
||||
barCompleteChar: '\u2588',
|
||||
barIncompleteChar: '\u2591',
|
||||
hideCursor: true,
|
||||
stopOnComplete: true,
|
||||
barsize: 30,
|
||||
align: 'right'
|
||||
});
|
||||
let barprinters = new progress.SingleBar({
|
||||
format: 'printers [' + colors.cyan('{bar}') + '] {percentage}%' + '|| {value}/{total} records created.',
|
||||
barCompleteChar: '\u2588',
|
||||
barIncompleteChar: '\u2591',
|
||||
hideCursor: true,
|
||||
stopOnComplete: true,
|
||||
barsize: 30,
|
||||
align: 'right'
|
||||
});
|
||||
pInventario.start(rows, 0);
|
||||
barprinters.start(rows, 0);
|
||||
for (let i = 1; i <= rows; i++) {
|
||||
let noInventario = faker.phone.phoneNumber("2######");
|
||||
let idActivoFijo = 6;
|
||||
|
||||
await fillInventario(noInventario, idActivoFijo)
|
||||
.then(() => censo++)
|
||||
.catch(() => {
|
||||
console.log(symbols.warning, 'Error creating «inventario-printers»');
|
||||
pInventario.stop();
|
||||
throw new Error();
|
||||
});
|
||||
await fillPrinters(noInventario, idActivoFijo)
|
||||
.catch(async() => {
|
||||
await Inventario.destroy({
|
||||
where: noInventario
|
||||
})
|
||||
.then(() => censo--);
|
||||
console.log(symbols.warning, 'Error creating «printers»');
|
||||
barprinters.stop();
|
||||
throw new Error();
|
||||
});
|
||||
pInventario.increment();
|
||||
barprinters.increment();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
async function exec() {
|
||||
await fillActivoFijo()
|
||||
.then(() => {
|
||||
console.log(symbols.success, '«activoFijo» filled out.'.green.bold)
|
||||
ok++;
|
||||
})
|
||||
.catch(() => {
|
||||
// console.log('\n');
|
||||
console.log(symbols.warning, 'Error creating «activoFijo».'.yellow.bold);
|
||||
faileds++;
|
||||
});
|
||||
await fillMarca()
|
||||
.then(() => {
|
||||
console.log(symbols.success, '«marca» filled out.'.green.bold)
|
||||
ok++;
|
||||
})
|
||||
.catch(() => {
|
||||
console.log(symbols.warning, 'Error creating marca».'.yellow.bold);
|
||||
faileds++;
|
||||
});
|
||||
await fillOS()
|
||||
.then(() => {
|
||||
console.log(symbols.success, '«OS» filled out.'.green.bold)
|
||||
ok++;
|
||||
})
|
||||
.catch(() => {
|
||||
console.log(symbols.warning, 'Error creating «OS».'.yellow.bold);
|
||||
faileds++;
|
||||
});
|
||||
await fillTipo()
|
||||
.then(() => {
|
||||
console.log(symbols.success, '«tipo» filled out.'.green.bold)
|
||||
ok++;
|
||||
})
|
||||
.catch(() => {
|
||||
console.log(symbols.warning, 'Error creating «tipo».'.yellow.bold);
|
||||
faileds++;
|
||||
});
|
||||
await fillUResponsable()
|
||||
.then((records) => {
|
||||
console.log(symbols.success, `${ records } records filled out.`.green.bold)
|
||||
ok++;
|
||||
})
|
||||
.catch(() => {
|
||||
console.log(symbols.warning, 'Error creating «uResponsable».'.yellow.bold);
|
||||
faileds++;
|
||||
});
|
||||
await fillUbicacion()
|
||||
.then(() => {
|
||||
console.log(symbols.success, '«ubicacion» filled out.'.green.bold)
|
||||
ok++;
|
||||
})
|
||||
.catch(() => {
|
||||
console.log(symbols.warning, 'Error creating «ubicacion».'.yellow.bold);
|
||||
faileds++;
|
||||
});
|
||||
await fillUso()
|
||||
.then(() => {
|
||||
console.log(symbols.success, '«uso» filled out.'.green.bold)
|
||||
ok++;
|
||||
})
|
||||
.catch(() => {
|
||||
console.log(symbols.warning, 'Error creating «uso».'.yellow.bold);
|
||||
faileds++;
|
||||
});
|
||||
|
||||
console.log(`\nFilling out ${ rows } records on equipo, printers and inventario. Please wait...\n`.cyan.italic.bold);
|
||||
|
||||
// await fillingEquipo()
|
||||
// .then(() => {
|
||||
// console.log(symbols.success, `${ rows } records created on equipo.\n`.green.bold);
|
||||
// ok++;
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// console.log(symbols.warning, 'Error creating «equipo».\n', e);
|
||||
// faileds++;
|
||||
// });
|
||||
// await fillingPrinters()
|
||||
// .then(() => {
|
||||
// console.log(symbols.success, `${ rows } records created on printers.\n`.green.bold);
|
||||
// ok++;
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// console.log(symbols.warning, 'Error creating «printers».\n', e);
|
||||
// faileds++;
|
||||
// });
|
||||
|
||||
// if (censo / 2 === rows) ok++;
|
||||
// else faileds++;
|
||||
|
||||
// console.log(symbols.success, `${ censo } records added on inventario`.green.bold);
|
||||
console.log(`\n${ symbols.success }`, ` ${ ok } tables filled out succesfully.`.green.bold);
|
||||
console.log(symbols.error, ` ${ faileds } tables wasn't filled out successfully.`.red.bold);
|
||||
|
||||
process.exit();
|
||||
}
|
||||
|
||||
exec();
|
||||
@@ -0,0 +1,55 @@
|
||||
const symbols = require('log-symbols');
|
||||
const generator = require('generate-password');
|
||||
const admin = require('../server/models/tablas/Admin');
|
||||
const bcrypt = require('bcrypt');
|
||||
const colors = require('colors');
|
||||
|
||||
const send = require('gmail-send')({
|
||||
user: process.env.EMAIL,
|
||||
pass: process.env.EMAILPASS,
|
||||
subject: 'Credenciales para ingreso a sistema de censo.'
|
||||
});
|
||||
|
||||
const emails = [
|
||||
'alfredo.lima@acatlan.unam.mx',
|
||||
'312047278@pcpuma.acatlan.unam.mx',
|
||||
'enrique.mg.cd@gmail.com'
|
||||
];
|
||||
|
||||
const nombres = [
|
||||
'Alfredo Lima',
|
||||
'José Alfredo',
|
||||
'Enrique Maquinola'
|
||||
]
|
||||
|
||||
emails.forEach(async(email, index) => {
|
||||
|
||||
let tempPass = generator.generate({
|
||||
length: 8,
|
||||
numbers: true,
|
||||
symbols: true,
|
||||
exclude: `"`,
|
||||
strict: true
|
||||
});
|
||||
|
||||
console.log(symbols.info, `Creating user ${email}...`.blue.bold);
|
||||
let tempUser = await admin.create({
|
||||
name: email,
|
||||
userName: nombres[index],
|
||||
password: bcrypt.hashSync(tempPass, 10),
|
||||
isAdmin: false
|
||||
});
|
||||
if (!tempUser)
|
||||
return console.log(symbols.error, 'Error creating user.'.red.bold);
|
||||
console.log(symbols.info, `Sending email to ${email}`.blue);
|
||||
await send({
|
||||
to: email,
|
||||
text: `Usuario: ${email}\nContraseña: ${tempPass}\nSaludos.`
|
||||
},
|
||||
async(err, res, resFull) => {
|
||||
if (err)
|
||||
return console.log(symbols.error, err);
|
||||
console.log(symbols.success, 'User created. Email sent.'.green.bold);
|
||||
});
|
||||
|
||||
})
|
||||
@@ -0,0 +1,45 @@
|
||||
const ActivoFijo = require('../../server/models/tablas/ActivoFijo');
|
||||
const progress = require('cli-progress');
|
||||
const colors = require('colors');
|
||||
|
||||
async function fillActivoFijo() {
|
||||
let limit = 6;
|
||||
|
||||
const bar = new progress.SingleBar({
|
||||
format: 'activoFijo |' + colors.cyan('{bar}') + '| {percentage}%' + ' || {value}/{total} records created.',
|
||||
barCompleteChar: '\u2588',
|
||||
barIncompleteChar: '\u2591',
|
||||
hideCursor: true,
|
||||
stopOnComplete: true,
|
||||
barsize: 30,
|
||||
align: 'right'
|
||||
});
|
||||
|
||||
console.log('\n\tFilling out «activoFijo».'.cyan.italic.bold);
|
||||
|
||||
let af = [
|
||||
"PC",
|
||||
"Laptop",
|
||||
"Servidor",
|
||||
"Ipad",
|
||||
"Chromebook",
|
||||
"Impresora"
|
||||
];
|
||||
|
||||
bar.start(limit, 0);
|
||||
for (activoFijo of af) {
|
||||
await ActivoFijo.create({
|
||||
activoFijo
|
||||
})
|
||||
.then(() => {
|
||||
// console.log(`${ count }/${ limit }\trecords created.`);
|
||||
})
|
||||
.catch(() => {
|
||||
bar.stop();
|
||||
throw new Error()
|
||||
});
|
||||
bar.increment();
|
||||
};
|
||||
};
|
||||
|
||||
module.exports = fillActivoFijo;
|
||||
@@ -0,0 +1,72 @@
|
||||
const Equipo = require('../../server/models/tablas/Equipo');
|
||||
|
||||
const faker = require('faker');
|
||||
faker.locale = "es_MX";
|
||||
|
||||
async function fillEquipo(noInventario, idActivoFijo) {
|
||||
let modelo = faker.vehicle.model();
|
||||
let noSerie = faker.vehicle.vin();
|
||||
let idMarca = faker.random.number({
|
||||
min: 1,
|
||||
max: 11
|
||||
});
|
||||
let idOS = faker.random.number({
|
||||
min: 1,
|
||||
max: 7
|
||||
});
|
||||
let procesador = faker.random.arrayElement([
|
||||
"Intel Core i3",
|
||||
"Intel Core i5",
|
||||
"Intel Core i7",
|
||||
"Ryzen 3",
|
||||
"Ryzen 5",
|
||||
"Ryzen 7",
|
||||
]);
|
||||
let vProcesador = faker.random.number({ min: 2000, max: 4500 })
|
||||
let memoria = faker.random.arrayElement([
|
||||
"DDR2",
|
||||
"DDR3",
|
||||
"DDR4"
|
||||
]);
|
||||
let memoriasz = faker.random.arrayElement([
|
||||
4096,
|
||||
2048,
|
||||
8192
|
||||
]);
|
||||
let vMemoria = faker.random.number({ min: 1400, max: 1800, precision: 4 });
|
||||
let graficos = faker.random.arrayElement([
|
||||
"Intel HD Graphics",
|
||||
"Intel Iris",
|
||||
"Intel Iris Plus",
|
||||
"Radeon Vega 8",
|
||||
"Radeon Vega 7",
|
||||
"Radeon Vega Plus",
|
||||
"Radeon Vega Graphics",
|
||||
]);
|
||||
let hdd = faker.random.number({
|
||||
min: 80,
|
||||
max: 990,
|
||||
precision: 2
|
||||
});
|
||||
|
||||
await Equipo.create({
|
||||
modelo,
|
||||
noSerie,
|
||||
procesador,
|
||||
vProcesador,
|
||||
memoria,
|
||||
memoriasz,
|
||||
vMemoria,
|
||||
graficos,
|
||||
hdd,
|
||||
noInventario,
|
||||
idMarca,
|
||||
idOS,
|
||||
idActivoFijo
|
||||
})
|
||||
.catch(() => {
|
||||
throw new Error();
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = fillEquipo;
|
||||
@@ -0,0 +1,39 @@
|
||||
const Inventario = require('../../server/models/tablas/Inventario');
|
||||
|
||||
const faker = require('faker');
|
||||
faker.locale = "es_MX";
|
||||
|
||||
async function fillInventario(noInventario, idActivoFijo) {
|
||||
let idUbicacion = faker.random.number({
|
||||
min: 1,
|
||||
max: 15
|
||||
});
|
||||
let idUnidadResponsable = faker.random.number({
|
||||
min: 1,
|
||||
max: 101
|
||||
});
|
||||
let idUso = faker.random.number({
|
||||
min: 1,
|
||||
max: 6
|
||||
});
|
||||
let noResguardo = faker.phone.phoneNumber("#####")
|
||||
// console.log("Inventario: ", noInventario, "\nResguardo: ", noResguardo);
|
||||
|
||||
await Inventario.create({
|
||||
noResguardo,
|
||||
idActivoFijo,
|
||||
noInventario,
|
||||
idUnidadResponsable,
|
||||
idUbicacion,
|
||||
idUso
|
||||
})
|
||||
.then(() => {
|
||||
// console.log(`${ count }/${ limit }\trecords created.`);
|
||||
// count++;
|
||||
})
|
||||
.catch(() => {
|
||||
throw new Error();
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = fillInventario;
|
||||
@@ -0,0 +1,49 @@
|
||||
const Marca = require('../../server/models/tablas/Marca');
|
||||
const progress = require('cli-progress');
|
||||
const colors = require('colors');
|
||||
|
||||
async function fillMarca() {
|
||||
let limit = 11;
|
||||
const bar = new progress.SingleBar({
|
||||
format: 'marca |' + colors.cyan('{bar}') + '| {percentage}%' + ' || {value}/{total} records created.',
|
||||
barCompleteChar: '\u2588',
|
||||
barIncompleteChar: '\u2591',
|
||||
hideCursor: true,
|
||||
stopOnComplete: true,
|
||||
barsize: 30,
|
||||
align: 'right'
|
||||
});
|
||||
|
||||
let marcas = [
|
||||
"HP",
|
||||
"ECOIN",
|
||||
"SONY",
|
||||
"LENOVO",
|
||||
"DELL",
|
||||
"ACER",
|
||||
"ASUS",
|
||||
"APPLE",
|
||||
"COMPAQ",
|
||||
"GATEWAY",
|
||||
"IBM"
|
||||
];
|
||||
|
||||
console.log('\n\tFilling out «marca».'.cyan.italic.bold);
|
||||
|
||||
bar.start(limit, 0);
|
||||
for (marca of marcas) {
|
||||
await Marca.create({
|
||||
marca
|
||||
})
|
||||
.then(() => {
|
||||
// console.log(`${ count }/${ limit }\trecords created.`);
|
||||
})
|
||||
.catch(() => {
|
||||
bar.stop();
|
||||
throw new Error();
|
||||
});
|
||||
bar.increment();
|
||||
};
|
||||
};
|
||||
|
||||
module.exports = fillMarca;
|
||||
@@ -0,0 +1,41 @@
|
||||
const OS = require('../../server/models/tablas/OS');
|
||||
const colors = require('colors');
|
||||
const progress = require('cli-progress');
|
||||
|
||||
async function fillOS() {
|
||||
let limit = 7;
|
||||
const bar = new progress.SingleBar({
|
||||
format: 'OS |' + colors.cyan('{bar}') + '| {percentage}%' + ' || {value}/{total} records created.',
|
||||
barCompleteChar: '\u2588',
|
||||
barIncompleteChar: '\u2591',
|
||||
hideCursor: true,
|
||||
stopOnComplete: true,
|
||||
barsize: 30,
|
||||
align: 'right'
|
||||
});
|
||||
let sistemas = [
|
||||
"Windows 7",
|
||||
"Windows 10",
|
||||
"Debian",
|
||||
"Fedora",
|
||||
"CentOS",
|
||||
"Ubuntu",
|
||||
"MacOS"
|
||||
];
|
||||
|
||||
console.log('\n\tFilling out «OS».'.cyan.italic.bold);
|
||||
|
||||
bar.start(limit, 0);
|
||||
for (osname of sistemas) {
|
||||
await OS.create({
|
||||
osname
|
||||
})
|
||||
.catch(() => {
|
||||
bar.stop();
|
||||
throw new Error();
|
||||
});
|
||||
bar.increment();
|
||||
};
|
||||
};
|
||||
|
||||
module.exports = fillOS;
|
||||
@@ -0,0 +1,31 @@
|
||||
const Printers = require('../../server/models/tablas/Printers');
|
||||
|
||||
const faker = require('faker');
|
||||
faker.locale = "es_MX";
|
||||
|
||||
async function fillPrinters(noInventario, idActivoFijo) {
|
||||
let noSerie = faker.vehicle.vin();
|
||||
let idMarca = faker.random.number({
|
||||
min: 1,
|
||||
max: 11
|
||||
});
|
||||
let idTipo = faker.random.number({
|
||||
min: 1,
|
||||
max: 4
|
||||
});
|
||||
let descripcion = faker.lorem.sentence();
|
||||
let modelo = faker.vehicle.model();
|
||||
// console.log("Número de serie impresora: ", noSerie);
|
||||
|
||||
await Printers.create({
|
||||
noInventario,
|
||||
noSerie,
|
||||
modelo,
|
||||
descripcion,
|
||||
idMarca,
|
||||
idTipo,
|
||||
idActivoFijo
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = fillPrinters;
|
||||
@@ -0,0 +1,42 @@
|
||||
const Tipo = require('../../server/models/tablas/Tipo');
|
||||
const progress = require('cli-progress');
|
||||
const colors = require('colors');
|
||||
|
||||
async function fillTipo() {
|
||||
let limit = 4;
|
||||
const bar = new progress.SingleBar({
|
||||
format: 'tipo |' + colors.cyan('{bar}') + '| {percentage}%' + ' || {value}/{total} records created.',
|
||||
barCompleteChar: '\u2588',
|
||||
barIncompleteChar: '\u2591',
|
||||
hideCursor: true,
|
||||
stopOnComplete: true,
|
||||
barsize: 30,
|
||||
align: 'right'
|
||||
});
|
||||
let tipos = [
|
||||
"Impresora",
|
||||
"Multifuncional",
|
||||
"Láser",
|
||||
"Plotter"
|
||||
];
|
||||
|
||||
console.log('\n\tFilling out «tipo».'.cyan.italic.bold);
|
||||
|
||||
bar.start(limit, 0);
|
||||
for (tipo of tipos) {
|
||||
await Tipo.create({
|
||||
tipo
|
||||
})
|
||||
// .then(() => {
|
||||
// console.log(`${ count }/${ limit }\trecords created.`);
|
||||
// count++;
|
||||
// })
|
||||
.catch(() => {
|
||||
bar.stop();
|
||||
throw new Error();
|
||||
});
|
||||
bar.increment();
|
||||
};
|
||||
};
|
||||
|
||||
module.exports = fillTipo;
|
||||
@@ -0,0 +1,43 @@
|
||||
const UResponsable = require('../../server/models/tablas/UResponsable');
|
||||
const progress = require('cli-progress');
|
||||
const colors = require('colors');
|
||||
|
||||
const faker = require('faker');
|
||||
faker.locale = 'es_MX';
|
||||
|
||||
async function fillUResponsable() {
|
||||
let unidades = require('./unidades.json');
|
||||
var nombres = require('./nombres.json');
|
||||
let limit = unidades.length;
|
||||
let count = 0;
|
||||
|
||||
const bar = new progress.SingleBar({
|
||||
format: 'uResponsable |' + colors.cyan('{bar}') + '| {percentage}%' + ' || {value}/{total} records created.',
|
||||
barCompleteChar: '\u2588',
|
||||
barIncompleteChar: '\u2591',
|
||||
hideCursor: true,
|
||||
stopOnComplete: true,
|
||||
barsize: 30,
|
||||
align: 'right'
|
||||
});
|
||||
|
||||
console.log(`\n\tFilling out with ${ limit } records on uResponsable, please wait...`.cyan.italic.bold);
|
||||
|
||||
bar.start(limit, 0);
|
||||
for (uResponsable of unidades) {
|
||||
nombreResponsable = nombres[count];
|
||||
await UResponsable.create({
|
||||
uResponsable,
|
||||
nombreResponsable
|
||||
})
|
||||
.catch(() => {
|
||||
bar.stop();
|
||||
throw new Error();
|
||||
});
|
||||
bar.increment();
|
||||
count++;
|
||||
};
|
||||
return limit;
|
||||
};
|
||||
|
||||
module.exports = fillUResponsable;
|
||||
@@ -0,0 +1,36 @@
|
||||
const Ubicacion = require('../../server/models/tablas/Ubicacion');
|
||||
const progress = require('cli-progress');
|
||||
const colors = require('colors');
|
||||
|
||||
const faker = require('faker');
|
||||
faker.locale = "es_MX";
|
||||
|
||||
async function fillUbicacion() {
|
||||
let ubicaciones = require('./ubicaciones');
|
||||
let limit = ubicaciones.length;
|
||||
const bar = new progress.SingleBar({
|
||||
format: 'ubicacion |' + colors.cyan('{bar}') + '| {percentage}%' + ' || {value}/{total} records created.',
|
||||
barCompleteChar: '\u2588',
|
||||
barIncompleteChar: '\u2591',
|
||||
hideCursor: true,
|
||||
stopOnComplete: true,
|
||||
barsize: 30,
|
||||
align: 'right'
|
||||
});
|
||||
|
||||
console.log('\n\tFilling out «ubicacion».'.cyan.italic.bold);
|
||||
|
||||
bar.start(limit, 0);
|
||||
for (ubicacion of ubicaciones) {
|
||||
await Ubicacion.create({
|
||||
ubicacion
|
||||
})
|
||||
.catch(() => {
|
||||
bar.stop();
|
||||
throw new Error();
|
||||
});
|
||||
bar.increment();
|
||||
};
|
||||
};
|
||||
|
||||
module.exports = fillUbicacion;
|
||||
@@ -0,0 +1,33 @@
|
||||
const Uso = require('../../server/models/tablas/Uso');
|
||||
const progress = require('cli-progress');
|
||||
const colors = require('colors');
|
||||
|
||||
async function fillUso() {
|
||||
let usos = require('./usos.json');
|
||||
|
||||
let limit = 6;
|
||||
const bar = new progress.SingleBar({
|
||||
format: 'uso |' + colors.cyan('{bar}') + '| {percentage}%' + ' || {value}/{total} records created.',
|
||||
barCompleteChar: '\u2588',
|
||||
barIncompleteChar: '\u2591',
|
||||
hideCursor: true,
|
||||
stopOnComplete: true,
|
||||
barsize: 30,
|
||||
align: 'right'
|
||||
});
|
||||
|
||||
console.log('\n\tFilling out «uso».'.cyan.italic.bold);
|
||||
|
||||
bar.start(limit, 0);
|
||||
for (uso of usos) {
|
||||
await Uso.create({
|
||||
uso
|
||||
})
|
||||
.catch(() => {
|
||||
bar.stop();
|
||||
throw new Error();
|
||||
});
|
||||
bar.increment();
|
||||
};
|
||||
}
|
||||
module.exports = fillUso;
|
||||
@@ -0,0 +1,100 @@
|
||||
[
|
||||
"Lic. María Claudia Otake González",
|
||||
"Mtro. José Luis Castañón Zurita",
|
||||
"Lic. Fernando Israel González Trejo",
|
||||
"Dra. Lucía Elena Acosta Ugalde",
|
||||
"Lic. Gloria Isabel Moctezuma Nájera",
|
||||
"Lic. Verónica Puma Galicia",
|
||||
"Ing. Carlos Rojas Gutiérrez",
|
||||
"Mtra. Laura Angélica Chávez Tovar",
|
||||
"Ing. Gabriel Alejandro López Campos",
|
||||
"Lic. Alberto Guerrero Meneses",
|
||||
"Mtro. Christian Roberto Salazar Montiel",
|
||||
"Dr. Felipe Cruz Díaz",
|
||||
"Mtro. Fernando Martínez Ramírez",
|
||||
"Dra. Ericka Judith Arias Guzmán",
|
||||
"NO HAY",
|
||||
"Profa. Yuritzia Navarrete Avila",
|
||||
"Lic. Cynthia Maricela Uribe Pacheco",
|
||||
"Lic. Gloria Elena Araiza Ledezma",
|
||||
"Prof. Carlos Gerardo Cabrera Lerma",
|
||||
"Lic. José Ángel Hernández Rivera",
|
||||
"Ing. Carlos Arce León",
|
||||
"Prof. Emmanuel Castañeda Pérez",
|
||||
"Mtra. Heidy Jojana Oliva Tello",
|
||||
"Lic. Eva Ocaña Islas",
|
||||
"Mtro. Juan José Sanabria López",
|
||||
"Mtra. Nancy Lara Hernández",
|
||||
"Mtro. Adrián Luis Maldonado González",
|
||||
"Lic. José Antonio González Santos",
|
||||
"Lic. Adriana Zúñiga Pérez",
|
||||
"No es Adscripción",
|
||||
"Lic. Leticia Juárez Ortega",
|
||||
"Lic. María Patricia Javier Pérez",
|
||||
"Dra. Rosa Martha Gutiérrez Rodríguez",
|
||||
"Lic. Miguel Ángel De La Calleja López",
|
||||
"Prof. David Rey Ávila",
|
||||
"Arq. Miguel Ángel Guevara Reyes",
|
||||
"Dra. Graciela Carrazco López",
|
||||
"C. Marfides Oralia Godoy Cortés",
|
||||
"Lic. Edna Cristina Gutiérrez López",
|
||||
"Lic. Omar Alberto González Contreras",
|
||||
"Lic. José Alberto Bravo Hernández",
|
||||
"Lic. Fabiola Virginia Lara Treviño",
|
||||
"Lic. Jesús Jiménez Cruz",
|
||||
"Lic. José Roberto Bautista Mora",
|
||||
"Mtro. Gilberto González Pérez",
|
||||
"Mtra. María Guadalupe Durán Pérez",
|
||||
"Lic. Sandra Trejo Legorreta",
|
||||
"D. G. Hugo Enrique García Ruiz",
|
||||
"Mtra. Adriana Roque Del Angel",
|
||||
"NO HAY",
|
||||
"Lic. Juan Carlos Ramírez Martínez",
|
||||
"Lic. Araceli Perez Palma",
|
||||
"C. Francisco Gutiérrez Pérez",
|
||||
"Lic. Anabel Moreno Baltazar",
|
||||
"Arq. Erick Eduardo Casas Gutiérrez",
|
||||
"Lic. Jesús Cervantes Arias",
|
||||
"Ing. Leydi Rubí Pérez Vera",
|
||||
"D. G. Laura Gutiérrez Ochoa",
|
||||
"Lic. Gerardo Gabriel Mares Velasco",
|
||||
"Lic. César Gómez Gómez",
|
||||
"Lic. Erasmo González Castro",
|
||||
"Lic. Jorge Reyes Caldera Arroyo",
|
||||
"Dra. Claudia Márquez Díaz",
|
||||
"Mtro. Rubén Juárez Santana",
|
||||
"Mtra. María Luisa Morales Martínez",
|
||||
"Act. Luz María Lavín Alanís",
|
||||
"Lic. Aída Villalobos Sosa",
|
||||
"Mtra. Marisela Rodríguez Pacheco",
|
||||
"Act. Mahil Herrera Maldonado",
|
||||
"Arq. Marcial Álvarez Salgado",
|
||||
"Lic. Ariadna Uribe Ortiz",
|
||||
"Mtra. Lidia Chávez Fonseca",
|
||||
"Mtro. Esteban Piña Pérez",
|
||||
"Lic. Jorge Villegas Hernández",
|
||||
"Mtra. Xóchitl Adriana Hernández Martínez",
|
||||
"Mtro. Ernesto de Icaza Villalpando",
|
||||
"Ing. Omar Ulises Morales Dávila",
|
||||
"Lic. Christian Carlos Delgado Elizondo",
|
||||
"Mtra. María de Jesús Solís Solís",
|
||||
"Lic. María Elena González Lupercio",
|
||||
"Lic. María Guadalupe Alonso Quintana",
|
||||
"Mtro. José Luis Castañón Zurita",
|
||||
"Mtro. Carlos Nandayapa Hernández",
|
||||
"Dr. Alejandro Byrd Orozco",
|
||||
"Dr. David Morales González",
|
||||
"Dra. Laura Páez Díaz de León",
|
||||
"Mtra. Nora Del Consuelo Goris Mayans",
|
||||
"Médico Lorena Hortensia Vázquez Bustos",
|
||||
"Ing. Hugo César González Ramírez",
|
||||
"Prof. Aarón Juárez Chávez",
|
||||
"Lic. Roberto Carlos Castro Azcué",
|
||||
"Lic. Yareth Perez Salgado",
|
||||
"Lic. Samuel Ornelas Rosales",
|
||||
"NO HAY",
|
||||
"C. Carlos Armando Rosas Cruz",
|
||||
"Profa. Norma Guadalupe Rojas Borja",
|
||||
"Lic. José Gerardo Pérez Aguilar",
|
||||
"Lic. Sara Luz Alvarado Aranda"
|
||||
]
|
||||
@@ -0,0 +1,3 @@
|
||||
[
|
||||
"Aula 1"
|
||||
]
|
||||
@@ -0,0 +1,100 @@
|
||||
[
|
||||
"ÁREA DE CURSOS",
|
||||
"AREA DE SERVICIOS DE COMPUTO DE LA SECRETARIA ADMINISTRATIVA",
|
||||
"CENTRO DE DESARROLLO TECNOLOGICO",
|
||||
"CENTRO DE DIFUSION CULTURAL",
|
||||
"CENTRO DE EDUCACION CONTINUA",
|
||||
"CENTRO DE ENSEñANZA DE IDIOMAS",
|
||||
"CENTRO DE ESTUDIOS MUNICIPALES Y METROPOLITANOS",
|
||||
"CENTRO TECNOLÓGICO PARA LA EDUCACION A DISTANCIA, CETED",
|
||||
"COORDINACION DE ACTIVIDADES DEPORTIVAS Y RECREATIVAS",
|
||||
"COORDINACION DE COMUNICACION SOCIAL",
|
||||
"COORDINACIÓN DE GESTIÓN DE LA DIRECCIÓN",
|
||||
"COORDINACIÓN DE INVESTIGACIÓN MULTIDISCIPLINARIA",
|
||||
"COORDINACIÓN DE SERVICIOS ACADEMICOS",
|
||||
"COORDINACION DE ESTUDIOS DE POSGRADO",
|
||||
"DEPARTAMENTO DE HEMEROTECA Y DOCUMENTACION",
|
||||
"DEPARTAMENTO DE ACTIVIDADES CULTURALES Y DIFUSIÓN",
|
||||
"DEPARTAMENTO DE ADQUISICIONES",
|
||||
"DEPARTAMENTO DE ADQUISICIONES BIBLIOGRAFICAS Y PROCESOS TECNICOS",
|
||||
"DEPARTAMENTO DE ALEMAN, GRIEGO Y RUSO",
|
||||
"DEPARTAMENTO DE ALMACENES E INVENTARIOS",
|
||||
"DEPARTAMENTO DE ANALISIS DE RIESGOS NATURALES Y ANTROPOENICOS (UIM)",
|
||||
"DEPARTAMENTO DE APOYO TECNICO AL CENTRO CULTURAL",
|
||||
"DEPARTAMENTO DE CONSULTA",
|
||||
"DEPARTAMENTO DE ESPAÑOL PARA EXT. Y LENGUAS NO INDOEUROPEAS",
|
||||
"DEPARTAMENTO DE ESTUDIOS DE GOBIERNO Y POLÍTICAS PÚBLICAS",
|
||||
"DEPARTAMENTO DE ESTUDIOS DE PROCURACION DE JUSTICIA Y SEGURIDAD PUBLICA",
|
||||
"DEPARTAMENTO DE EXTENSION CULTURAL",
|
||||
"DEPARTAMENTO DE FORMACION DOCENTE Y SUPERACION ACADEMICA",
|
||||
"DEPARTAMENTO DE FRANCES",
|
||||
"DEPARTAMENTO DE IMAGEN CORPORATIVA E INSTITUCIONAL",
|
||||
"DEPARTAMENTO DE INGLÉS",
|
||||
"DEPARTAMENTO DE INTENDENCIA",
|
||||
"DEPARTAMENTO DE INVESTIGACION EDUCATIVA",
|
||||
"DEPARTAMENTO DE DESARROLLO E INVESTIGACIÓN EN COMUNICACIÓN Y ESTUDIOS CULTURALES",
|
||||
"DEPARTAMENTO DE ITALIANO Y LATÍN",
|
||||
"DEPARTAMENTO DE OBRA CIVIL Y PROYECTOS",
|
||||
"DEPARTAMENTO DE ORIENTACION EDUCATIVA",
|
||||
"DEPARTAMENTO DE PERSONAL",
|
||||
"DEPARTAMENTO DE PORTUGUES",
|
||||
"DEPARTAMENTO DE PRESUPUESTO",
|
||||
"DEPARTAMENTO DE PROMOCION Y ORGANIZACION DEPORTIVA",
|
||||
"DEPARTAMENTO DE DESARROLLO EMPRESARIAL E INTERCAMBIO Y COLABORACION",
|
||||
"DEPARTAMENTO DE PROYECTOS ADMINISTRATIVOS",
|
||||
"DEPARTAMENTO DE REDES Y SOPORTE TÉCNICO (CEDETEC)",
|
||||
"DEPARTAMENTO DE REGISTRO Y CERTIFICACION DE LA DIVISION S. U. A.",
|
||||
"DEPARTAMENTO DE REGISTRO Y CERTIFICACION DE POSGRADO",
|
||||
"DEPARTAMENTO DE REGISTRO Y CERTIFICACION DEL C.E.I.",
|
||||
"DEPARTAMENTO DE REPRODUCCIONES GRAFICAS",
|
||||
"DEPARTAMENTO DE SERVICIO SOCIAL Y BOLSA DE TRABAJO",
|
||||
"DEPARTAMENTO DE SERVICIOS AL PUBLICO (CID)",
|
||||
"DEPARTAMENTO DE SERVICIOS AUDIOVISUALES",
|
||||
"DEPARTAMENTO DE SERVICIOS DE COMPUTO",
|
||||
"DEPARTAMENTO DE SERVICIOS GENERALES DE MANTENIMIENTO",
|
||||
"DEPARTAMENTO DE SISTEMAS DE INFORMACIÓN",
|
||||
"DEPARTAMENTO DE SUPERVISION TECNICA",
|
||||
"DEPARTAMENTO DE TALLERES Y LABORATORIOS",
|
||||
"DEPARTAMENTO DE TECNOLOGIA AMBIENTAL (UIM)",
|
||||
"DEPARTAMENTO DE TIPOGRAFIA Y DISEÑO",
|
||||
"DEPARTAMENTO DE TITULOS PROFESIONALES Y CERTIFICACION",
|
||||
"DEPARTAMENTO DE TRANSPORTES Y SERVICIOS DE APOYO",
|
||||
"DEPARTAMENTO DE VIGILANCIA",
|
||||
"DIVISION DE CIENCIAS JURIDICAS",
|
||||
"DIVISION DE CIENCIAS SOCIOECONOMICAS",
|
||||
"DIVISION DE DISEÑO Y EDIFICACION",
|
||||
"DIVISION DE HUMANIDADES",
|
||||
"DIVISIÓN DE MATEMÁTICAS E INGENIERÍA",
|
||||
"DIVISION DEL SISTEMA DE UNIVERSIDAD ABIERTA Y EDUCACIÓN A A DISTANCIA",
|
||||
"LIBRERIA UNIVERSITARIA DE LA FES ACATLAN",
|
||||
"PROGRAMA DE ACTUARIA",
|
||||
"PROGRAMA DE ARQUITECTURA",
|
||||
"PROGRAMA DE COMUNICACIÓN",
|
||||
"PROGRAMA DE DERECHO",
|
||||
"PROGRAMA DE DISEÑO GRAFICO",
|
||||
"PROGRAMA DE ECONOMIA",
|
||||
"PROGRAMA DE ENSEÑANZA DEL INGLES",
|
||||
"PROGRAMA DE HUMANIDADES",
|
||||
"PROGRAMA DE INGENIERIA CIVIL",
|
||||
"PROGRAMA DE MATEMATICAS APLICADAS Y COMPUTACION",
|
||||
"PROGRAMA DE PEDAGOGIA",
|
||||
"PROGRAMA DE SOCIOLOGIA",
|
||||
"PROGRAMA POLITICO",
|
||||
"SECRETARÍA ADMINISTRATIVA",
|
||||
"SECRETARÍA DE ESTUDIOS PROFESIONALES",
|
||||
"SECRETARÍA DE EXTENSION UNIVERSITARIA Y VINCULACIÓN INSTITUCIONAL",
|
||||
"SECRETARÍA DE LA DIRECCIÓN",
|
||||
"SECRETARÍA DE POSGRADO E INVESTIGACIÓN",
|
||||
"SECRETARIA GENERAL",
|
||||
"SERVICIO MEDICO",
|
||||
"SUPERINTENDENCIA DE OBRAS Y MANTENIMIENTO",
|
||||
"UNIDAD DE ADMINISTRACION ESCOLAR",
|
||||
"UNIDAD DE ADMINISTRACION Y RECURSOS",
|
||||
"UNIDAD DE LA OFICINA JURIDICA",
|
||||
"UNIDAD DE PLANEACION",
|
||||
"UNIDAD DE PROCESO (U.P.A.)",
|
||||
"UNIDAD DE SERVICIOS A LA COMUNIDAD",
|
||||
"UNIDAD DE SERVICIOS EDITORIALES",
|
||||
"UNIDAD DE TALLERES, LABORATORIOS Y AUDIOVISUALES",
|
||||
"UNIDAD DEL CENTRO DE INFORMACIÓN Y DOCUMENTACIÓN"
|
||||
]
|
||||
@@ -0,0 +1 @@
|
||||
["Analista","Estratega","Especialista","Product Owner","Asistente","Gerente"]
|
||||
Generated
+320
-10
@@ -22,8 +22,12 @@
|
||||
"@types/color-name": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz",
|
||||
"integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==",
|
||||
"dev": true
|
||||
"integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ=="
|
||||
},
|
||||
"@types/geojson": {
|
||||
"version": "7946.0.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.7.tgz",
|
||||
"integrity": "sha512-wE2v81i4C4Ol09RtsWFAqg3BUitWbHSpSlIo+bNdsCJijO9sjme+zm+73ZMCa/qMC8UEERxzGbvmr1cffo2SiQ=="
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "14.0.27",
|
||||
@@ -44,6 +48,15 @@
|
||||
"negotiator": "0.6.2"
|
||||
}
|
||||
},
|
||||
"adler-32": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/adler-32/-/adler-32-1.2.0.tgz",
|
||||
"integrity": "sha1-aj5r8KY5ALoVZSgIyxXGgT0aXyU=",
|
||||
"requires": {
|
||||
"exit-on-epipe": "~1.0.1",
|
||||
"printj": "~1.1.0"
|
||||
}
|
||||
},
|
||||
"ansi-align": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz",
|
||||
@@ -96,7 +109,6 @@
|
||||
"version": "4.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz",
|
||||
"integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/color-name": "^1.1.1",
|
||||
"color-convert": "^2.0.1"
|
||||
@@ -272,6 +284,19 @@
|
||||
"resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz",
|
||||
"integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk="
|
||||
},
|
||||
"buffer-from": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
|
||||
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A=="
|
||||
},
|
||||
"busboy": {
|
||||
"version": "0.3.1",
|
||||
"resolved": "https://registry.npmjs.org/busboy/-/busboy-0.3.1.tgz",
|
||||
"integrity": "sha512-y7tTxhGKXcyBxRKAni+awqx8uqaJKrSFSNFSeRG5CsWNdmy2BIK+6VGWEW7TZnIO/533mtMEA4rOevQV815YJw==",
|
||||
"requires": {
|
||||
"dicer": "0.3.0"
|
||||
}
|
||||
},
|
||||
"bytes": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz",
|
||||
@@ -324,6 +349,16 @@
|
||||
"redeyed": "~2.1.0"
|
||||
}
|
||||
},
|
||||
"cfb": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/cfb/-/cfb-1.2.0.tgz",
|
||||
"integrity": "sha512-sXMvHsKCICVR3Naq+J556K+ExBo9n50iKl6LGarlnvuA2035uMlGA/qVrc0wQtow5P1vJEw9UyrKLCbtIKz+TQ==",
|
||||
"requires": {
|
||||
"adler-32": "~1.2.0",
|
||||
"crc-32": "~1.2.0",
|
||||
"printj": "~1.1.2"
|
||||
}
|
||||
},
|
||||
"chalk": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz",
|
||||
@@ -384,6 +419,56 @@
|
||||
"integrity": "sha512-gpaBrMAizVEANOpfZp/EEUixTXDyGt7DFzdK5hU+UbWt/J0lB0w20ncZj59Z9a93xHb9u12zF5BS6i9RKbtg4w==",
|
||||
"dev": true
|
||||
},
|
||||
"cli-progress": {
|
||||
"version": "3.8.2",
|
||||
"resolved": "https://registry.npmjs.org/cli-progress/-/cli-progress-3.8.2.tgz",
|
||||
"integrity": "sha512-qRwBxLldMSfxB+YGFgNRaj5vyyHe1yMpVeDL79c+7puGujdKJHQHydgqXDcrkvQgJ5U/d3lpf6vffSoVVUftVQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"colors": "^1.1.2",
|
||||
"string-width": "^4.2.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"ansi-regex": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
|
||||
"integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
|
||||
"dev": true
|
||||
},
|
||||
"emoji-regex": {
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
|
||||
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
|
||||
"dev": true
|
||||
},
|
||||
"is-fullwidth-code-point": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
|
||||
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
|
||||
"dev": true
|
||||
},
|
||||
"string-width": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz",
|
||||
"integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"emoji-regex": "^8.0.0",
|
||||
"is-fullwidth-code-point": "^3.0.0",
|
||||
"strip-ansi": "^6.0.0"
|
||||
}
|
||||
},
|
||||
"strip-ansi": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
|
||||
"integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-regex": "^5.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"clone-response": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz",
|
||||
@@ -398,11 +483,26 @@
|
||||
"resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
|
||||
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c="
|
||||
},
|
||||
"codepage": {
|
||||
"version": "1.14.0",
|
||||
"resolved": "https://registry.npmjs.org/codepage/-/codepage-1.14.0.tgz",
|
||||
"integrity": "sha1-jL4lSBMjVZ19MHVxsP/5HnodL5k=",
|
||||
"requires": {
|
||||
"commander": "~2.14.1",
|
||||
"exit-on-epipe": "~1.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"commander": {
|
||||
"version": "2.14.1",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.14.1.tgz",
|
||||
"integrity": "sha512-+YR16o3rK53SmWHU3rEM3tPAh2rwb1yPcQX5irVn7mb0gXbwuCCrnkbV5+PBfETdfg1vui07nM6PCG1zndcjQw=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"color-convert": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
|
||||
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"color-name": "~1.1.4"
|
||||
}
|
||||
@@ -410,8 +510,17 @@
|
||||
"color-name": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
|
||||
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
|
||||
"dev": true
|
||||
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
|
||||
},
|
||||
"colors": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz",
|
||||
"integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA=="
|
||||
},
|
||||
"commander": {
|
||||
"version": "2.17.1",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz",
|
||||
"integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg=="
|
||||
},
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
@@ -474,6 +583,15 @@
|
||||
"vary": "^1"
|
||||
}
|
||||
},
|
||||
"crc-32": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.0.tgz",
|
||||
"integrity": "sha512-1uBwHxF+Y/4yF5G48fwnKq6QsIXheor3ZLPT80yGBV1oEUwpPojlEhQbWKVw1VwcTQyMGHK1/XMmTjmlsmTTGA==",
|
||||
"requires": {
|
||||
"exit-on-epipe": "~1.0.1",
|
||||
"printj": "~1.1.0"
|
||||
}
|
||||
},
|
||||
"crypto-random-string": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz",
|
||||
@@ -533,6 +651,14 @@
|
||||
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz",
|
||||
"integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups="
|
||||
},
|
||||
"dicer": {
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/dicer/-/dicer-0.3.0.tgz",
|
||||
"integrity": "sha512-MdceRRWqltEG2dZqO769g27N/3PXfcKl04VhYnBlo2YhH7zPi88VebsjTKclaOyiuMaGU72hTfw3VkUitGcVCA==",
|
||||
"requires": {
|
||||
"streamsearch": "0.1.2"
|
||||
}
|
||||
},
|
||||
"dot-prop": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.2.0.tgz",
|
||||
@@ -612,6 +738,11 @@
|
||||
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
|
||||
"integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc="
|
||||
},
|
||||
"exit-on-epipe": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz",
|
||||
"integrity": "sha512-h2z5mrROTxce56S+pnvAV890uu7ls7f1kEvVGJbw1OlFH3/mlJ5bkXu0KRyW94v37zzHPiUd55iLn3DA7TjWpw=="
|
||||
},
|
||||
"express": {
|
||||
"version": "4.17.1",
|
||||
"resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz",
|
||||
@@ -664,6 +795,20 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"express-fileupload": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/express-fileupload/-/express-fileupload-1.2.0.tgz",
|
||||
"integrity": "sha512-oe4WpKcSppXnl5peornawWUa6tKmIc1/kJxMNRGJR1A0v4zyLL6VsFR6wZ8P2a4Iq3aGx8xae3Vlr+MOMQhFPw==",
|
||||
"requires": {
|
||||
"busboy": "^0.3.1"
|
||||
}
|
||||
},
|
||||
"faker": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/faker/-/faker-5.1.0.tgz",
|
||||
"integrity": "sha512-RrWKFSSA/aNLP0g3o2WW1Zez7/MnMr7xkiZmoCfAGZmdkDQZ6l2KtuXHN5XjdvpRjDl8+3vf+Rrtl06Z352+Mw==",
|
||||
"dev": true
|
||||
},
|
||||
"fill-range": {
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
||||
@@ -707,6 +852,11 @@
|
||||
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz",
|
||||
"integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ="
|
||||
},
|
||||
"frac": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/frac/-/frac-1.1.2.tgz",
|
||||
"integrity": "sha512-w/XBfkibaTl3YDqASwfDUqkna4Z2p9cFSr1aHDt0WoMTECnRfBOv2WArlZILlqgWlmdIlALXGpM2AOhEk5W3IA=="
|
||||
},
|
||||
"fresh": {
|
||||
"version": "0.5.2",
|
||||
"resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
|
||||
@@ -755,6 +905,12 @@
|
||||
"is-property": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"generate-password": {
|
||||
"version": "1.5.1",
|
||||
"resolved": "https://registry.npmjs.org/generate-password/-/generate-password-1.5.1.tgz",
|
||||
"integrity": "sha512-XdsyfiF4mKoOEuzA44w9jSNav50zOurdWOV3V8DbA7SJIxR3Xm9ob14HKYTnMQOPX3ylqiJMnQF0wEa8gXZIMw==",
|
||||
"dev": true
|
||||
},
|
||||
"get-stream": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
|
||||
@@ -795,6 +951,16 @@
|
||||
"ini": "^1.3.5"
|
||||
}
|
||||
},
|
||||
"gmail-send": {
|
||||
"version": "1.8.10",
|
||||
"resolved": "https://registry.npmjs.org/gmail-send/-/gmail-send-1.8.10.tgz",
|
||||
"integrity": "sha512-QMpWwzeA64U69HzOEzI37UNc73xXkhTg8LuqsfKX9W7LjiQY3yRvViVn7ZhuJWLTV4136vsLJf2sXiZKmdykbw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"lodash": "^4.17.15",
|
||||
"nodemailer": "^6.3.0"
|
||||
}
|
||||
},
|
||||
"got": {
|
||||
"version": "9.6.0",
|
||||
"resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz",
|
||||
@@ -817,8 +983,7 @@
|
||||
"graceful-fs": {
|
||||
"version": "4.2.4",
|
||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz",
|
||||
"integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==",
|
||||
"dev": true
|
||||
"integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw=="
|
||||
},
|
||||
"has-flag": {
|
||||
"version": "3.0.0",
|
||||
@@ -893,8 +1058,7 @@
|
||||
"imurmurhash": {
|
||||
"version": "0.1.4",
|
||||
"resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
|
||||
"integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=",
|
||||
"dev": true
|
||||
"integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o="
|
||||
},
|
||||
"inflection": {
|
||||
"version": "1.12.0",
|
||||
@@ -1122,6 +1286,38 @@
|
||||
"resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz",
|
||||
"integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w="
|
||||
},
|
||||
"log-symbols": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz",
|
||||
"integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==",
|
||||
"requires": {
|
||||
"chalk": "^4.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"chalk": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
|
||||
"integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
|
||||
"requires": {
|
||||
"ansi-styles": "^4.1.0",
|
||||
"supports-color": "^7.1.0"
|
||||
}
|
||||
},
|
||||
"has-flag": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
|
||||
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="
|
||||
},
|
||||
"supports-color": {
|
||||
"version": "7.1.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz",
|
||||
"integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==",
|
||||
"requires": {
|
||||
"has-flag": "^4.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"long": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz",
|
||||
@@ -1158,6 +1354,35 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"mariadb": {
|
||||
"version": "2.4.2",
|
||||
"resolved": "https://registry.npmjs.org/mariadb/-/mariadb-2.4.2.tgz",
|
||||
"integrity": "sha512-ybK520CO/8Z74MNJ77dEwXjRMhxMbQdpPia+/uJakJWiZoLEmuwSHqs51qWr4FE5WcgHQfL5KCmOiHErR/LpTg==",
|
||||
"requires": {
|
||||
"@types/geojson": "^7946.0.7",
|
||||
"@types/node": "^13.9.8",
|
||||
"denque": "^1.4.1",
|
||||
"iconv-lite": "^0.5.1",
|
||||
"long": "^4.0.0",
|
||||
"moment-timezone": "^0.5.31",
|
||||
"please-upgrade-node": "^3.2.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/node": {
|
||||
"version": "13.13.15",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.15.tgz",
|
||||
"integrity": "sha512-kwbcs0jySLxzLsa2nWUAGOd/s21WU1jebrEdtzhsj1D4Yps1EOuyI1Qcu+FD56dL7NRNIJtDDjcqIG22NwkgLw=="
|
||||
},
|
||||
"iconv-lite": {
|
||||
"version": "0.5.2",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.5.2.tgz",
|
||||
"integrity": "sha512-kERHXvpSaB4aU3eANwidg79K8FlrN77m8G9V+0vOR3HYaRifrlwMEpT7ZBJqLSEIHnEgJTHcWK82wwLwwKwtag==",
|
||||
"requires": {
|
||||
"safer-buffer": ">= 2.1.2 < 3"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"media-typer": {
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
|
||||
@@ -1323,6 +1548,26 @@
|
||||
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.0.0.tgz",
|
||||
"integrity": "sha512-sSHCgWfJ+Lui/u+0msF3oyCgvdkhxDbkCS6Q8uiJquzOimkJBvX6hl5aSSA7DR1XbMpdM8r7phjcF63sF4rkKg=="
|
||||
},
|
||||
"node-localstorage": {
|
||||
"version": "2.1.6",
|
||||
"resolved": "https://registry.npmjs.org/node-localstorage/-/node-localstorage-2.1.6.tgz",
|
||||
"integrity": "sha512-yE7AycE5G2hU55d+F7Ona9nx97C+enJzWWx6jrsji7fuPZFJOvuW3X/LKKAcXRBcEIJPDOKt8ZiFWFmShR/irg==",
|
||||
"requires": {
|
||||
"write-file-atomic": "^1.1.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"write-file-atomic": {
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz",
|
||||
"integrity": "sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8=",
|
||||
"requires": {
|
||||
"graceful-fs": "^4.1.11",
|
||||
"imurmurhash": "^0.1.4",
|
||||
"slide": "^1.1.5"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"node-pre-gyp": {
|
||||
"version": "0.15.0",
|
||||
"resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.15.0.tgz",
|
||||
@@ -1340,6 +1585,21 @@
|
||||
"tar": "^4.4.2"
|
||||
}
|
||||
},
|
||||
"node-xlsx": {
|
||||
"version": "0.15.0",
|
||||
"resolved": "https://registry.npmjs.org/node-xlsx/-/node-xlsx-0.15.0.tgz",
|
||||
"integrity": "sha512-rQyhWDJ/k60wQemov7a8MlToastWTidrAVFRwTWV+s53LN/SRwU4lnmc5xuFXx/ay+uaLAsAQBp6BkVob5OjOA==",
|
||||
"requires": {
|
||||
"buffer-from": "^1.1.0",
|
||||
"xlsx": "^0.14.1"
|
||||
}
|
||||
},
|
||||
"nodemailer": {
|
||||
"version": "6.4.11",
|
||||
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.4.11.tgz",
|
||||
"integrity": "sha512-BVZBDi+aJV4O38rxsUh164Dk1NCqgh6Cm0rQSb9SK/DHGll/DrCMnycVDD7msJgZCnmVa8ASo8EZzR7jsgTukQ==",
|
||||
"dev": true
|
||||
},
|
||||
"nodemon": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.4.tgz",
|
||||
@@ -1505,12 +1765,25 @@
|
||||
"integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==",
|
||||
"dev": true
|
||||
},
|
||||
"please-upgrade-node": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz",
|
||||
"integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==",
|
||||
"requires": {
|
||||
"semver-compare": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"prepend-http": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz",
|
||||
"integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=",
|
||||
"dev": true
|
||||
},
|
||||
"printj": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/printj/-/printj-1.1.2.tgz",
|
||||
"integrity": "sha512-zA2SmoLaxZyArQTOPj5LXecR+RagfPSU5Kw1qP+jkWeNlrq+eJZyY2oS68SU1Z/7/myXM4lo9716laOFAVStCQ=="
|
||||
},
|
||||
"process-nextick-args": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
||||
@@ -1681,6 +1954,11 @@
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
|
||||
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ=="
|
||||
},
|
||||
"semver-compare": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz",
|
||||
"integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w="
|
||||
},
|
||||
"semver-diff": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz",
|
||||
@@ -1811,16 +2089,34 @@
|
||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz",
|
||||
"integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA=="
|
||||
},
|
||||
"slide": {
|
||||
"version": "1.1.6",
|
||||
"resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz",
|
||||
"integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc="
|
||||
},
|
||||
"sqlstring": {
|
||||
"version": "2.3.2",
|
||||
"resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.2.tgz",
|
||||
"integrity": "sha512-vF4ZbYdKS8OnoJAWBmMxCQDkiEBkGQYU7UZPtL8flbDRSNkhaXvRJ279ZtI6M+zDaQovVU4tuRgzK5fVhvFAhg=="
|
||||
},
|
||||
"ssf": {
|
||||
"version": "0.10.3",
|
||||
"resolved": "https://registry.npmjs.org/ssf/-/ssf-0.10.3.tgz",
|
||||
"integrity": "sha512-pRuUdW0WwyB2doSqqjWyzwCD6PkfxpHAHdZp39K3dp/Hq7f+xfMwNAWIi16DyrRg4gg9c/RvLYkJTSawTPTm1w==",
|
||||
"requires": {
|
||||
"frac": "~1.1.2"
|
||||
}
|
||||
},
|
||||
"statuses": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
|
||||
"integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow="
|
||||
},
|
||||
"streamsearch": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-0.1.2.tgz",
|
||||
"integrity": "sha1-gIudDlb8Jz2Am6VzOOkpkZoanxo="
|
||||
},
|
||||
"string-width": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
|
||||
@@ -2133,6 +2429,20 @@
|
||||
"integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==",
|
||||
"dev": true
|
||||
},
|
||||
"xlsx": {
|
||||
"version": "0.14.5",
|
||||
"resolved": "https://registry.npmjs.org/xlsx/-/xlsx-0.14.5.tgz",
|
||||
"integrity": "sha512-s/5f4/mjeWREmIWZ+HtDfh/rnz51ar+dZ4LWKZU3u9VBx2zLdSIWTdXgoa52/pnZ9Oe/Vu1W1qzcKzLVe+lq4w==",
|
||||
"requires": {
|
||||
"adler-32": "~1.2.0",
|
||||
"cfb": "^1.1.2",
|
||||
"codepage": "~1.14.0",
|
||||
"commander": "~2.17.1",
|
||||
"crc-32": "~1.2.0",
|
||||
"exit-on-epipe": "~1.0.1",
|
||||
"ssf": "~0.10.2"
|
||||
}
|
||||
},
|
||||
"yallist": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
|
||||
|
||||
+36
-22
@@ -1,24 +1,38 @@
|
||||
{
|
||||
"name": "censo2020back",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"bcrypt": "^5.0.0",
|
||||
"cors": "^2.8.5",
|
||||
"dotenv": "^8.2.0",
|
||||
"express": "^4.17.1",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"moment": "^2.27.0",
|
||||
"mysql2": "^2.1.0",
|
||||
"sequelize": "^6.3.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"nodemon": "^2.0.4"
|
||||
}
|
||||
"name": "censo2020back",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"test:db": "node server/config/test",
|
||||
"install:db": "node server/models/install",
|
||||
"sendemail": "node helpers/sendEmail",
|
||||
"fillDB": "node helpers/fillDB"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"bcrypt": "^5.0.0",
|
||||
"colors": "^1.4.0",
|
||||
"cors": "^2.8.5",
|
||||
"dotenv": "^8.2.0",
|
||||
"express": "^4.17.1",
|
||||
"express-fileupload": "^1.2.0",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"log-symbols": "^4.0.0",
|
||||
"mariadb": "^2.4.2",
|
||||
"moment": "^2.27.0",
|
||||
"mysql2": "^2.1.0",
|
||||
"node-localstorage": "^2.1.6",
|
||||
"node-xlsx": "^0.15.0",
|
||||
"sequelize": "^6.3.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"cli-progress": "^3.8.2",
|
||||
"faker": "^5.1.0",
|
||||
"generate-password": "^1.5.1",
|
||||
"gmail-send": "^1.8.10",
|
||||
"nodemon": "^2.0.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkQWRtaW4iOjIsIm5hbWUiOiJiaWxsaWUiLCJ1c2VyTmFtZSI6IkJpbGxpZSIsInBhc3N3b3JkIjoiJDJiJDEwJGhGdXF0OW82NXNHREpxNkl3OTVicU9JQmUuZjZ1Z2d0SGVWQ0ZTNFFOc1ovWUtQT0R1d1pxIiwiaXNBZG1pbiI6ZmFsc2UsImNyZWF0ZWRBdCI6IjIwMjAtMDktMTFUMjE6MjY6MzUuMDAwWiIsInVwZGF0ZWRBdCI6IjIwMjAtMDktMTFUMjE6MjY6MzUuMDAwWiJ9LCJpYXQiOjE2MDAxMjIwODMsImV4cCI6MTYwMDIwODQ4M30.XO3aUWGUxtV7R7ESEy4VNeukPEeQ1UFR9SVAp89KWWo
|
||||
+4
-4
@@ -6,17 +6,17 @@ let app = express();
|
||||
let config = require("./config/config.js");
|
||||
|
||||
app.use(cors());
|
||||
app.get("/", function (req, res) {
|
||||
res.send("Servicio activo");
|
||||
app.get("/", function(req, res) {
|
||||
res.send("Servicio activo");
|
||||
});
|
||||
|
||||
app.use(bodyParser.urlencoded({ extended: false }));
|
||||
app.use(
|
||||
bodyParser.json()
|
||||
bodyParser.json()
|
||||
);
|
||||
|
||||
app.use(require('./routes/index'))
|
||||
|
||||
app.listen(process.env.PORT, function () {
|
||||
app.listen(process.env.PORT, function() {
|
||||
console.log(`Censo 2020 corriendo en puerto ${process.env.PORT}`)
|
||||
});
|
||||
@@ -12,7 +12,7 @@ try {
|
||||
}
|
||||
|
||||
process.env.TYPE_DB = process.env.TYPE_DB || 'mariadb'
|
||||
process.env.DB = process.env.DB || 'ejem'
|
||||
process.env.DB = process.env.DB || 'ejemplo'
|
||||
process.env.USER_DB = process.env.USER_DB || 'root'
|
||||
process.env.PASSWORD_DB = process.env.PASSWORD_DB || ''
|
||||
process.env.HOST_DB = process.env.HOST_DB || 'localhost'
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
const Sequelize = require("sequelize");
|
||||
|
||||
require("./config");
|
||||
|
||||
const sequelize = new Sequelize(
|
||||
process.env.DB,
|
||||
process.env.USERDB,
|
||||
process.env.PASSDB, {
|
||||
host: process.env.HOSTDB,
|
||||
dialect: process.env.TYPEDB,
|
||||
logging: false,
|
||||
dialectOptions: {
|
||||
useUTC: false, //for reading from database
|
||||
timezone: "Etc/GMT+5" //for writing to database
|
||||
},
|
||||
// timezone: "-05:00" //for writing to database
|
||||
timezone: "Etc/GMT+5" //for writing to database
|
||||
}
|
||||
);
|
||||
|
||||
module.exports = sequelize;
|
||||
@@ -0,0 +1,15 @@
|
||||
const Sequelize = require("sequelize");
|
||||
const sequelize = require("./sequelize.conf");
|
||||
|
||||
const colors = require("colors");
|
||||
|
||||
sequelize
|
||||
.authenticate()
|
||||
.then(() => {
|
||||
console.log("Conexion establecida con exito.".green);
|
||||
process.exit();
|
||||
})
|
||||
.catch(err => {
|
||||
console.error("No se ha podido establacer conexion con la base de datos:".red, err);
|
||||
process.exit();
|
||||
});
|
||||
@@ -0,0 +1,9 @@
|
||||
const get = require('./get');
|
||||
const post = require('./post');
|
||||
const put = require('./put');
|
||||
|
||||
module.exports = {
|
||||
get,
|
||||
post,
|
||||
put
|
||||
};
|
||||
@@ -0,0 +1,55 @@
|
||||
const ActivoFijo = require('../../models/tablas/ActivoFijo');
|
||||
const Marca = require('../../models/tablas/Marca');
|
||||
const OS = require('../../models/tablas/OS');
|
||||
const Ubicacion = require('../../models/tablas/Ubicacion')
|
||||
const UResponsable = require('../../models/tablas/UResponsable');
|
||||
const Uso = require('../../models/tablas/Uso');
|
||||
|
||||
const get = async(req, res) => {
|
||||
let activosFijos = await ActivoFijo.findAll({
|
||||
attributes: ['idActivoFijo', 'activoFijo'],
|
||||
order: ['idActivoFijo']
|
||||
})
|
||||
.catch((e) => { throw new Error(e) });
|
||||
|
||||
let marcas = await Marca.findAll({
|
||||
attributes: ['idMarca', 'marca'],
|
||||
order: ['idMarca']
|
||||
})
|
||||
.catch((e) => { throw new Error(e) });
|
||||
|
||||
let distros = await OS.findAll({
|
||||
attributes: ['idOS', 'osname'],
|
||||
order: ['idOS']
|
||||
})
|
||||
.catch((e) => { throw new Error(e) });
|
||||
|
||||
let ubicaciones = await Ubicacion.findAll({
|
||||
attributes: ['idUbicacion', 'ubicacion'],
|
||||
order: ['idUbicacion']
|
||||
})
|
||||
.catch((e) => { throw new Error(e) });
|
||||
|
||||
let unidades = await UResponsable.findAll({
|
||||
attributes: ['idUnidadResponsable', 'uResponsable'],
|
||||
order: ['idUnidadResponsable']
|
||||
})
|
||||
.catch((e) => { throw new Error(e) });
|
||||
|
||||
let usos = await Uso.findAll({
|
||||
attributes: ['idUso', 'uso'],
|
||||
order: ['idUso']
|
||||
})
|
||||
.catch((e) => { throw new Error(e) });
|
||||
|
||||
return res.json({
|
||||
activosFijos,
|
||||
marcas,
|
||||
distros,
|
||||
ubicaciones,
|
||||
unidades,
|
||||
usos
|
||||
})
|
||||
};
|
||||
|
||||
module.exports = get;
|
||||
@@ -0,0 +1,69 @@
|
||||
const Equipo = require('../../models/tablas/Equipo');
|
||||
const Inventario = require('../../models/tablas/Inventario');
|
||||
|
||||
const post = async(req, res) => {
|
||||
const modelo = req.body.modelo;
|
||||
const idMarca = req.body.idMarca;
|
||||
const noSerie = req.body.noSerie;
|
||||
const idOS = req.body.idOS;
|
||||
const procesador = req.body.procesador;
|
||||
const vProcesador = req.body.vProcesador;
|
||||
const memoria = req.body.memoria;
|
||||
const memoriasz = req.body.memoriasz;
|
||||
const vMemoria = req.body.vMemoria;
|
||||
const graficos = req.body.graficos;
|
||||
const hdd = req.body.hdd;
|
||||
const noInventario = req.body.noInventario;
|
||||
const idActivoFijo = req.body.idActivoFijo;
|
||||
const noResguardo = req.body.noResguardo;
|
||||
const idUnidadResponsable = req.body.idUnidadResponsable;
|
||||
const idUbicacion = req.body.idUbicacion;
|
||||
const idUso = req.body.idUso;
|
||||
|
||||
let err = '';
|
||||
|
||||
await Inventario.create({
|
||||
noInventario,
|
||||
idActivoFijo,
|
||||
noResguardo,
|
||||
idUnidadResponsable,
|
||||
idUbicacion,
|
||||
idUso
|
||||
})
|
||||
.then()
|
||||
.catch((e) => err = e);
|
||||
|
||||
await Equipo.create({
|
||||
modelo,
|
||||
noSerie,
|
||||
procesador,
|
||||
vProcesador,
|
||||
memoria,
|
||||
memoriasz,
|
||||
vMemoria,
|
||||
graficos,
|
||||
hdd,
|
||||
noInventario,
|
||||
idMarca,
|
||||
idOS,
|
||||
idActivoFijo
|
||||
})
|
||||
.then(() => res.json({
|
||||
ok: true,
|
||||
message: 'Equipo agregado en inventario con éxito.'
|
||||
}))
|
||||
.catch(async(e) => {
|
||||
await Inventario.destroy({
|
||||
where: {
|
||||
noInventario
|
||||
}
|
||||
});
|
||||
res.status(500).json({
|
||||
ok: false,
|
||||
error: [e, err],
|
||||
message: 'Equipo'
|
||||
})
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = post;
|
||||
@@ -0,0 +1,7 @@
|
||||
const get = require('./get');
|
||||
const post = require('./post');
|
||||
|
||||
module.exports = {
|
||||
get,
|
||||
post
|
||||
};
|
||||
@@ -0,0 +1,47 @@
|
||||
const Tipo = require('../../models/tablas/Tipo');
|
||||
const Marca = require('../../models/tablas/Marca');
|
||||
const Ubicacion = require('../../models/tablas/Ubicacion');
|
||||
const Uso = require('../../models/tablas/Uso');
|
||||
const UResponsable = require('../../models/tablas/UResponsable');
|
||||
|
||||
const get = async(req, res) => {
|
||||
const marcas = await Marca.findAll({
|
||||
attributes: ['idMarca', 'marca'],
|
||||
order: ['idMarca']
|
||||
})
|
||||
.catch((e) => { throw new Error(e) });
|
||||
|
||||
const unidades = await UResponsable.findAll({
|
||||
attributes: ['idUnidadResponsable', 'uResponsable'],
|
||||
order: ['idUnidadResponsable']
|
||||
})
|
||||
.catch((e) => { throw new Error(e) });
|
||||
|
||||
const ubicaciones = await Ubicacion.findAll({
|
||||
attributes: ['idUbicacion', 'ubicacion'],
|
||||
order: ['idUbicacion']
|
||||
})
|
||||
.catch((e) => { throw new Error(e) });
|
||||
|
||||
const usos = await Uso.findAll({
|
||||
attributes: ['idUso', 'uso'],
|
||||
order: ['idUso']
|
||||
})
|
||||
.catch((e) => { throw new Error(e) });
|
||||
|
||||
const tipos = await Tipo.findAll({
|
||||
attributes: ['idTipo', 'tipo'],
|
||||
order: ['idTipo']
|
||||
})
|
||||
.catch((e) => { throw new Error(e) });
|
||||
|
||||
return res.json({
|
||||
unidades,
|
||||
ubicaciones,
|
||||
marcas,
|
||||
usos,
|
||||
tipos
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = get;
|
||||
@@ -0,0 +1,49 @@
|
||||
const Printers = require('../../models/tablas/Printers');
|
||||
const Inventario = require('../../models/tablas/Inventario');
|
||||
|
||||
const post = async(req, res) => {
|
||||
const idActivoFijo = 6;
|
||||
const noSerie = req.body.noSerie;
|
||||
const noInventario = req.body.noInventario;
|
||||
const modelo = req.body.modelo;
|
||||
const idMarca = req.body.idMarca;
|
||||
const idTipo = req.body.idTipo;
|
||||
const descripcion = req.body.descripcion;
|
||||
const noResguardo = req.body.noResguardo;
|
||||
const idUnidadResponsable = req.body.idUnidadResponsable;
|
||||
const idUbicacion = req.body.idUbicacion;
|
||||
const idUso = req.body.idUso;
|
||||
|
||||
await Inventario.create({
|
||||
noInventario,
|
||||
noResguardo,
|
||||
idActivoFijo,
|
||||
idUnidadResponsable,
|
||||
idUbicacion,
|
||||
idUso
|
||||
})
|
||||
.catch((e) => res.json({
|
||||
ok: false,
|
||||
error: e
|
||||
}));
|
||||
|
||||
await Printers.create({
|
||||
noSerie,
|
||||
noInventario,
|
||||
modelo,
|
||||
idActivoFijo,
|
||||
idMarca,
|
||||
idTipo,
|
||||
descripcion
|
||||
})
|
||||
.then(() => res.json({
|
||||
ok: true,
|
||||
message: 'Impresora agregada en inventario con éxito.'
|
||||
}))
|
||||
.catch((e) => res.json({
|
||||
ok: false,
|
||||
error: e
|
||||
}));
|
||||
};
|
||||
|
||||
module.exports = post;
|
||||
@@ -0,0 +1,25 @@
|
||||
const sequelize = require('../../config/sequelize.conf');
|
||||
|
||||
const { QueryTypes } = require('sequelize');
|
||||
|
||||
|
||||
const tipo = async(req, res) => {
|
||||
// res.json({
|
||||
// message: "Listo"
|
||||
// });
|
||||
|
||||
await sequelize.query(`
|
||||
SELECT idActivoFijo, activoFijo
|
||||
FROM activoFijo WHERE activoFijo <> "Impresora"`, { type: QueryTypes.SELECT })
|
||||
.then(tipo => {
|
||||
return res.json({
|
||||
tipo
|
||||
})
|
||||
})
|
||||
.catch(error => res.status(500).json({
|
||||
error
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
module.exports = tipo;
|
||||
@@ -0,0 +1,25 @@
|
||||
const sequelize = require('../../config/sequelize.conf');
|
||||
|
||||
const { QueryTypes } = require('sequelize');
|
||||
|
||||
|
||||
const tipoPrinters = async(req, res) => {
|
||||
// res.json({
|
||||
// message: "Listo"
|
||||
// });
|
||||
|
||||
await sequelize.query(`
|
||||
SELECT idTipo, tipo
|
||||
FROM tipo`, { type: QueryTypes.SELECT })
|
||||
.then(tipoPrinters => {
|
||||
return res.json({
|
||||
tipoPrinters
|
||||
})
|
||||
})
|
||||
.catch(error => res.status(500).json({
|
||||
error
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
module.exports = tipoPrinters;
|
||||
@@ -1,8 +1,55 @@
|
||||
const post = async () => {
|
||||
|
||||
return {
|
||||
message: 'Mensaje del post'
|
||||
}
|
||||
const Admin = require("../../models/tablas/Admin");
|
||||
const bcrypt = require("bcrypt");
|
||||
|
||||
const jwt = require("jsonwebtoken");
|
||||
|
||||
|
||||
const post = async(req, res) => {
|
||||
|
||||
const body = req.body;
|
||||
|
||||
await Admin.findOne({
|
||||
where: {
|
||||
name: body.name,
|
||||
},
|
||||
})
|
||||
.then((user) => {
|
||||
if (!bcrypt.compareSync(body.password, user.password)) {
|
||||
return res.status(500).json({
|
||||
err: {
|
||||
message: 'Invalid user or password'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
let token = jwt.sign({
|
||||
user
|
||||
}, process.env.TOKEN_SEED, { expiresIn: process.env.TOKEN_EXP });
|
||||
|
||||
res.json({
|
||||
user,
|
||||
token
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
console.log("Invalid user or password");
|
||||
return res.status(500).json({
|
||||
err: {
|
||||
message: "Invalid user or password"
|
||||
}
|
||||
});
|
||||
|
||||
});;
|
||||
|
||||
// if (typeof localStorage === "undefined" || localStorage === null) {
|
||||
// var LocalStorage = require('node-localstorage').LocalStorage;
|
||||
// localStorage = new LocalStorage('./scratch');
|
||||
// }
|
||||
// localStorage.setItem('token', token);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
module.exports = post;
|
||||
@@ -0,0 +1,32 @@
|
||||
const Inventario = require('../../models/tablas/Inventario');
|
||||
const Equipo = require('../../models/tablas/Equipo');
|
||||
|
||||
const remove = async(req, res) => {
|
||||
const noInventario = req.body.noInventario;
|
||||
|
||||
await Inventario.destroy({
|
||||
where: {
|
||||
noInventario
|
||||
}
|
||||
})
|
||||
.catch(e => res.status(500).json({
|
||||
ok: false,
|
||||
err
|
||||
}));
|
||||
|
||||
await Equipo.destroy({
|
||||
where: {
|
||||
noInventario
|
||||
}
|
||||
})
|
||||
.then(() => res.json({
|
||||
ok: true,
|
||||
message: 'Eliminado con éxito'
|
||||
}))
|
||||
.catch(err => res.status(500).json({
|
||||
ok: false,
|
||||
err
|
||||
}));
|
||||
}
|
||||
|
||||
module.exports = remove;
|
||||
@@ -0,0 +1,27 @@
|
||||
const sequelize = require('../../config/sequelize.conf');
|
||||
|
||||
const { QueryTypes } = require('sequelize');
|
||||
|
||||
const get = async(req, res) => {
|
||||
const noInventario = req.query.noInventario;
|
||||
|
||||
await sequelize.query(`
|
||||
SELECT I.noInventario, E.idActivoFijo, E.modelo, E.idMarca, E.noSerie, E.procesador, E.vProcesador, E.hdd, E.memoriasz, E.memoria, E.vMemoria, E.graficos, E.idOS, I.idUnidadResponsable, I.idUbicacion, I.idUso, I.noResguardo
|
||||
FROM inventario I, equipo E
|
||||
WHERE I.noInventario = E.noInventario
|
||||
AND I.noInventario = :noInventario
|
||||
`, {
|
||||
replacements: { noInventario },
|
||||
type: QueryTypes.SELECT
|
||||
})
|
||||
.then(equipo => {
|
||||
return res.json({
|
||||
equipo
|
||||
})
|
||||
})
|
||||
.catch(error => res.status(500).json({
|
||||
error
|
||||
}));
|
||||
};
|
||||
|
||||
module.exports = get;
|
||||
@@ -0,0 +1,70 @@
|
||||
const Inventario = require('../../models/tablas/Inventario');
|
||||
const Equipo = require('../../models/tablas/Equipo');
|
||||
|
||||
const put = async(req, res) => {
|
||||
const noInventario = req.body.noInventario;
|
||||
const noInventarioAdd = req.body.noInventarioAdd;
|
||||
const modelo = req.body.modelo;
|
||||
const idMarca = req.body.idMarca;
|
||||
const noSerie = req.body.noSerie;
|
||||
const idOS = req.body.idOS;
|
||||
const procesador = req.body.procesador;
|
||||
const vProcesador = req.body.vProcesador;
|
||||
const memoria = req.body.memoria;
|
||||
const memoriasz = req.body.memoriasz;
|
||||
const vMemoria = req.body.vMemoria;
|
||||
const graficos = req.body.graficos;
|
||||
const hdd = req.body.hdd;
|
||||
const idActivoFijo = req.body.idActivoFijo;
|
||||
const noResguardo = req.body.noResguardo;
|
||||
const idUnidadResponsable = req.body.idUnidadResponsable;
|
||||
const idUbicacion = req.body.idUbicacion;
|
||||
const idUso = req.body.idUso;
|
||||
|
||||
await Inventario.update({
|
||||
noInventario: noInventarioAdd,
|
||||
idActivoFijo,
|
||||
noResguardo,
|
||||
idUnidadResponsable,
|
||||
idUbicacion,
|
||||
idUso
|
||||
}, {
|
||||
where: {
|
||||
noInventario
|
||||
}
|
||||
})
|
||||
.catch((err) => res.status(500).json({
|
||||
ok: false,
|
||||
err
|
||||
}));
|
||||
|
||||
await Equipo.update({
|
||||
modelo,
|
||||
noSerie,
|
||||
procesador,
|
||||
vProcesador,
|
||||
memoria,
|
||||
memoriasz,
|
||||
vMemoria,
|
||||
graficos,
|
||||
hdd,
|
||||
noInventario: noInventarioAdd,
|
||||
idMarca,
|
||||
idOS,
|
||||
idActivoFijo
|
||||
}, {
|
||||
where: {
|
||||
noInventario
|
||||
}
|
||||
})
|
||||
.then(() => res.json({
|
||||
ok: true,
|
||||
message: 'Equipo actualizado.'
|
||||
}))
|
||||
.catch(err => {
|
||||
ok: false,
|
||||
err
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = put;
|
||||
@@ -0,0 +1,9 @@
|
||||
const get = require('./get');
|
||||
const put = require('./put');
|
||||
const remove = require('./delete');
|
||||
|
||||
module.exports = {
|
||||
get,
|
||||
put,
|
||||
remove
|
||||
};
|
||||
@@ -0,0 +1,32 @@
|
||||
const Inventario = require('../../models/tablas/Inventario');
|
||||
const Printers = require('../../models/tablas/Printers');
|
||||
|
||||
const remove = async(req, res) => {
|
||||
const noInventario = req.body.noInventario;
|
||||
|
||||
await Inventario.destroy({
|
||||
where: {
|
||||
noInventario
|
||||
}
|
||||
})
|
||||
.catch(err => res.status(500).json({
|
||||
ok: false,
|
||||
err
|
||||
}));
|
||||
|
||||
await Printers.destroy({
|
||||
where: {
|
||||
noInventario
|
||||
}
|
||||
})
|
||||
.then(() => res.json({
|
||||
ok: true,
|
||||
message: 'Impresora eliminada.'
|
||||
}))
|
||||
.catch(err => res.status(500).json({
|
||||
ok: false,
|
||||
err
|
||||
}));
|
||||
};
|
||||
|
||||
module.exports = remove;
|
||||
@@ -0,0 +1,26 @@
|
||||
const sequelize = require('../../config/sequelize.conf');
|
||||
|
||||
const { QueryTypes } = require('sequelize');
|
||||
|
||||
const get = async(req, res) => {
|
||||
const noInventario = req.query.noInventario;
|
||||
|
||||
await sequelize.query(`
|
||||
SELECT I.noInventario, I.noResguardo, I.idUnidadResponsable, I.idUbicacion, I.idUso, P.idTipo, P.modelo, P.idMarca, P.noSerie, P.descripcion
|
||||
FROM inventario I, printers P
|
||||
WHERE I.noInventario = P.noInventario
|
||||
AND I.noInventario = :noInventario`, {
|
||||
replacements: { noInventario },
|
||||
type: QueryTypes.SELECT
|
||||
})
|
||||
.then((printer) => {
|
||||
return res.json({
|
||||
printer
|
||||
})
|
||||
}).catch((err) => res.status(500).json({
|
||||
ok: false,
|
||||
err
|
||||
}));
|
||||
};
|
||||
|
||||
module.exports = get;
|
||||
@@ -0,0 +1,58 @@
|
||||
const Inventario = require('../../models/tablas/Inventario');
|
||||
const Printers = require('../../models/tablas/Printers');
|
||||
|
||||
const put = async(req, res) => {
|
||||
const noInventario = req.body.noInventario;
|
||||
const noInventarioAdd = req.body.noInventarioAdd;
|
||||
const idActivoFijo = 6;
|
||||
const noSerie = req.body.noSerie;
|
||||
const modelo = req.body.modelo;
|
||||
const idMarca = req.body.idMarca;
|
||||
const idTipo = req.body.idTipo;
|
||||
const descripcion = req.body.descripcion;
|
||||
const noResguardo = req.body.noResguardo;
|
||||
const idUnidadResponsable = req.body.idUnidadResponsable;
|
||||
const idUbicacion = req.body.idUbicacion;
|
||||
const idUso = req.body.idUso;
|
||||
|
||||
await Inventario.update({
|
||||
noInventario: noInventarioAdd,
|
||||
idActivoFijo,
|
||||
noResguardo,
|
||||
idUnidadResponsable,
|
||||
idUbicacion,
|
||||
idUso
|
||||
}, {
|
||||
where: {
|
||||
noInventario
|
||||
}
|
||||
})
|
||||
.catch((err) => res.status(500).json({
|
||||
ok: 'Inventario',
|
||||
err
|
||||
}));
|
||||
|
||||
await Printers.update({
|
||||
noSerie,
|
||||
noInventario: noInventarioAdd,
|
||||
modelo,
|
||||
idActivoFijo,
|
||||
idMarca,
|
||||
idTipo,
|
||||
descripcion
|
||||
}, {
|
||||
where: {
|
||||
noInventario
|
||||
}
|
||||
})
|
||||
.then(() => res.json({
|
||||
ok: true,
|
||||
message: 'Impresora actualizada.'
|
||||
}))
|
||||
.catch((err) => res.status(500).json({
|
||||
ok: 'Printer',
|
||||
err
|
||||
}));
|
||||
}
|
||||
|
||||
module.exports = put;
|
||||
@@ -0,0 +1,9 @@
|
||||
const get = require('./get');
|
||||
const put = require('./put');
|
||||
const remove = require('./delete');
|
||||
|
||||
module.exports = {
|
||||
get,
|
||||
put,
|
||||
remove
|
||||
};
|
||||
@@ -0,0 +1,158 @@
|
||||
const xlsx = require('node-xlsx');
|
||||
|
||||
const UResponsable = require('../../models/tablas/UResponsable');
|
||||
const Ubicacion = require('../../models/tablas/Ubicacion');
|
||||
const Uso = require('../../models/tablas/Uso');
|
||||
const ActivoFijo = require('../../models/tablas/ActivoFijo');
|
||||
const OS = require('../../models/tablas/OS');
|
||||
const Marca = require('../../models/tablas/Marca');
|
||||
const Inventario = require('../../models/tablas/Inventario');
|
||||
const Equipo = require('../../models/tablas/Equipo');
|
||||
|
||||
|
||||
const post = async(req, res) => {
|
||||
const file = req.files.equipos;
|
||||
|
||||
let equipos = [];
|
||||
|
||||
let data = await xlsx.parse(file.tempFilePath);
|
||||
data = Object.entries(data[0]);
|
||||
data.shift();
|
||||
data = data[0][1]
|
||||
data.shift();
|
||||
for (row of data) {
|
||||
if (row[1]) {
|
||||
var activoFijo = await ActivoFijo.findOne({
|
||||
where: {
|
||||
activoFijo: row[1] || 'No declarado'
|
||||
}
|
||||
})
|
||||
.catch((e) => { throw new Error(e); });
|
||||
}
|
||||
|
||||
if (row[3]) {
|
||||
var marca = await Marca.findOrCreate({
|
||||
where: {
|
||||
marca: row[3] || 'No declarado'
|
||||
}
|
||||
})
|
||||
.catch((e) => { throw new Error(e); });
|
||||
}
|
||||
|
||||
if (row[12]) {
|
||||
var os = await OS.findOrCreate({
|
||||
where: {
|
||||
osname: row[12] || 'No declarado'
|
||||
}
|
||||
})
|
||||
.catch((e) => { throw new Error(e); });
|
||||
}
|
||||
|
||||
if (row[14]) {
|
||||
var uResponsable = await UResponsable.findOne({
|
||||
where: {
|
||||
uResponsable: row[14] || 'No declarado'
|
||||
}
|
||||
})
|
||||
.catch((e) => { throw new Error(e); });
|
||||
}
|
||||
|
||||
if (row[16]) {
|
||||
var ubicacion = await Ubicacion.findOrCreate({
|
||||
where: {
|
||||
ubicacion: row[16] || 'No declarado'
|
||||
}
|
||||
})
|
||||
.catch((e) => { throw new Error(e); });
|
||||
}
|
||||
|
||||
if (row[17]) {
|
||||
var uso = await Uso.findOrCreate({
|
||||
where: {
|
||||
uso: row[17] || 'No declarado'
|
||||
}
|
||||
})
|
||||
.catch((e) => { throw new Error(e); });
|
||||
}
|
||||
|
||||
let equipo = {
|
||||
noInventario: row[0],
|
||||
idActivoFijo: activoFijo.dataValues.idActivoFijo,
|
||||
modelo: row[2],
|
||||
marca: marca[0]['idMarca'],
|
||||
noSerie: row[4],
|
||||
procesador: row[5],
|
||||
vProcesador: row[6],
|
||||
hdd: row[7],
|
||||
memoriasz: row[8],
|
||||
memoria: row[9],
|
||||
vMemoria: row[10],
|
||||
graficos: row[11],
|
||||
osname: os[0]['idOS'],
|
||||
noResguardo: row[13],
|
||||
uResponsable: uResponsable.dataValues.idUnidadResponsable,
|
||||
ubicacion: ubicacion[0]['idUbicacion'],
|
||||
uso: uso[0]['idUso']
|
||||
}
|
||||
equipos.push(equipo);
|
||||
}
|
||||
|
||||
|
||||
var count = 0;
|
||||
for (equipo of equipos) {
|
||||
count++;
|
||||
await Inventario.create({
|
||||
noInventario: equipo.noInventario,
|
||||
noResguardo: equipo.noResguardo,
|
||||
idActivoFijo: equipo.idActivoFijo,
|
||||
idUnidadResponsable: equipo.uResponsable,
|
||||
idUbicacion: equipo.ubicacion,
|
||||
idUso: equipo.uso
|
||||
})
|
||||
.then(async() => {
|
||||
await Equipo.create({
|
||||
noInventario: equipo.noInventario,
|
||||
idActivoFijo: equipo.idActivoFijo,
|
||||
idMarca: equipo.marca,
|
||||
idOS: equipo.osname,
|
||||
modelo: equipo.modelo,
|
||||
noSerie: equipo.noSerie,
|
||||
procesador: equipo.procesador,
|
||||
vProcesador: equipo.vProcesador,
|
||||
memoria: equipo.memoria,
|
||||
vMemoria: equipo.vMemoria,
|
||||
memoriasz: equipo.memoriasz,
|
||||
graficos: equipo.graficos,
|
||||
hdd: equipo.hdd
|
||||
})
|
||||
.catch(async(err) => {
|
||||
await Inventario.destroy({
|
||||
where: {
|
||||
noInventario: equipo.noInventario
|
||||
}
|
||||
});
|
||||
res.status(500).json({
|
||||
ok: false,
|
||||
err
|
||||
});
|
||||
throw new Error(e);
|
||||
})
|
||||
})
|
||||
.catch((e) => {
|
||||
res.status(500).json({
|
||||
ok: false,
|
||||
e
|
||||
});
|
||||
throw new Error(e);
|
||||
})
|
||||
}
|
||||
|
||||
res.json({
|
||||
ok: true,
|
||||
message: `${ count } records created successfully.`
|
||||
// equipos
|
||||
// activoF
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = post
|
||||
@@ -0,0 +1,128 @@
|
||||
const xlsx = require('node-xlsx');
|
||||
|
||||
const UResponsable = require('../../models/tablas/UResponsable');
|
||||
const Ubicacion = require('../../models/tablas/Ubicacion');
|
||||
const Uso = require('../../models/tablas/Uso');
|
||||
const Marca = require('../../models/tablas/Marca');
|
||||
const Tipo = require('../../models/tablas/Tipo');
|
||||
const Inventario = require('../../models/tablas/Inventario');
|
||||
const Printers = require('../../models/tablas/Printers');
|
||||
|
||||
const post = async(req, res) => {
|
||||
const file = req.files.printers;
|
||||
|
||||
let printers = [];
|
||||
|
||||
let data = await xlsx.parse(file.tempFilePath);
|
||||
data = Object.entries(data[0]);
|
||||
data.shift();
|
||||
data = data[0][1]
|
||||
data.shift();
|
||||
for (row of data) {
|
||||
if (row[1]) {
|
||||
var tipo = await Tipo.findOrCreate({
|
||||
where: {
|
||||
tipo: row[1] || 'No declarado'
|
||||
}
|
||||
})
|
||||
.catch((e) => { throw new Error(e); });
|
||||
}
|
||||
|
||||
if (row[3]) {
|
||||
var marca = await Marca.findOrCreate({
|
||||
where: {
|
||||
marca: row[3] || 'No declarado'
|
||||
}
|
||||
})
|
||||
.catch((e) => { throw new Error(e); });
|
||||
}
|
||||
|
||||
if (row[7]) {
|
||||
var uResponsable = await UResponsable.findOne({
|
||||
where: {
|
||||
uResponsable: row[7] || 'No declarado'
|
||||
}
|
||||
})
|
||||
.catch((e) => { throw new Error(e); });
|
||||
}
|
||||
|
||||
if (row[9]) {
|
||||
var ubicacion = await Ubicacion.findOrCreate({
|
||||
where: {
|
||||
ubicacion: row[9] || 'No declarado'
|
||||
}
|
||||
})
|
||||
.catch((e) => { throw new Error(e); });
|
||||
}
|
||||
|
||||
if (row[10]) {
|
||||
var uso = await Uso.findOrCreate({
|
||||
where: {
|
||||
uso: row[10] || 'No declarado'
|
||||
}
|
||||
})
|
||||
.catch((e) => { throw new Error(e); });
|
||||
}
|
||||
|
||||
let printer = {
|
||||
noInventario: row[0],
|
||||
idTipo: tipo[0]['idTipo'],
|
||||
modelo: row[2],
|
||||
idMarca: marca[0]['idMarca'],
|
||||
noSerie: row[4],
|
||||
descripcion: row[5],
|
||||
idActivoFijo: 6,
|
||||
noResguardo: row[6],
|
||||
idUnidadResponsable: uResponsable.dataValues.idUnidadResponsable,
|
||||
idUbicacion: ubicacion[0]['idUbicacion'],
|
||||
idUso: uso[0]['idUso']
|
||||
}
|
||||
printers.push(printer);
|
||||
};
|
||||
let count = 0;
|
||||
for (printer of printers) {
|
||||
count++;
|
||||
await Inventario.create({
|
||||
noInventario: printer.noInventario,
|
||||
noResguardo: printer.noResguardo,
|
||||
idActivoFijo: printer.idActivoFijo,
|
||||
idUnidadResponsable: printer.idUnidadResponsable,
|
||||
idUbicacion: printer.idUbicacion,
|
||||
idUso: printer.idUso
|
||||
})
|
||||
.then(async() => {
|
||||
await Printers.create({
|
||||
noInventario: printer.noInventario,
|
||||
idMarca: printer.idMarca,
|
||||
modelo: printer.modelo,
|
||||
noSerie: printer.noSerie,
|
||||
idTipo: printer.idTipo,
|
||||
descripcion: printer.descripcion,
|
||||
idActivoFijo: printer.idActivoFijo
|
||||
})
|
||||
.catch(async(err) => {
|
||||
await Inventario.destroy({
|
||||
where: {
|
||||
noInventario: printer.noInventario
|
||||
}
|
||||
});
|
||||
return res.status(500).json({
|
||||
ok: false,
|
||||
err
|
||||
})
|
||||
})
|
||||
})
|
||||
.catch((e) => res.status(500).json({
|
||||
ok: false,
|
||||
e
|
||||
}))
|
||||
|
||||
}
|
||||
|
||||
res.json({
|
||||
ok: true,
|
||||
message: `${ count } records created successfully.`
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = post
|
||||
@@ -0,0 +1,30 @@
|
||||
const sequelize = require('../../../config/sequelize.conf');
|
||||
|
||||
const { QueryTypes } = require('sequelize');
|
||||
|
||||
|
||||
const get = async(req, res) => {
|
||||
// res.json({
|
||||
// message: "Listo"
|
||||
// });
|
||||
//console.log(req["tipo"].value);
|
||||
await sequelize.query(`
|
||||
SELECT I.noInventario, AF.activoFijo, E.modelo, M.marca, E.noSerie, E.procesador, E.vProcesador, E.hdd, E.memoriasz, E.memoria, E.vMemoria, E.graficos, OS.osname, I.noResguardo, UR.uResponsable, UR.nombreResponsable, Ub.ubicacion, U.uso
|
||||
FROM inventario I
|
||||
INNER JOIN activoFijo AF ON AF.idActivoFijo = I.idActivoFijo
|
||||
INNER JOIN equipo E ON E.noInventario = I.noInventario
|
||||
INNER JOIN marca M ON M.idMarca = E.idMarca
|
||||
INNER JOIN OS ON OS.idOS = E.idOS
|
||||
INNER JOIN uResponsable UR ON UR.idUnidadResponsable = I.idUnidadResponsable
|
||||
INNER JOIN ubicacion Ub ON Ub.idUbicacion = I.idUbicacion
|
||||
INNER JOIN uso U ON U.idUso = I.idUso
|
||||
ORDER BY E.noInventario ASC`, { type: QueryTypes.SELECT })
|
||||
.then(equipo => res.json({
|
||||
equipo
|
||||
}))
|
||||
.catch(error => res.status(500).json({
|
||||
error
|
||||
}));
|
||||
}
|
||||
|
||||
module.exports = get;
|
||||
@@ -0,0 +1,29 @@
|
||||
const sequelize = require('../../../config/sequelize.conf');
|
||||
|
||||
const { QueryTypes } = require('sequelize');
|
||||
|
||||
const get = async(req, res) => {
|
||||
|
||||
await sequelize.query(`
|
||||
SELECT I.noInventario, T.tipo, P.modelo, M.marca, P.noSerie, P. descripcion, I.noResguardo, UR.uResponsable, UR.nombreResponsable, Ub.ubicacion, U.uso
|
||||
FROM inventario I
|
||||
INNER JOIN printers P ON P.noInventario = I.noInventario
|
||||
INNER JOIN marca M ON M.idMarca = P.idMarca
|
||||
INNER JOIN tipo T ON T.idTipo = P.idTipo
|
||||
INNER JOIN uResponsable UR ON UR.idUnidadResponsable = I.idUnidadResponsable
|
||||
INNER JOIN ubicacion Ub ON Ub.idUbicacion = I.idUbicacion
|
||||
INNER JOIN uso U ON U.idUso = I.idUso
|
||||
ORDER BY P.noInventario ASC
|
||||
`, { type: QueryTypes.SELECT })
|
||||
.then(printers => {
|
||||
return res.json({
|
||||
printers
|
||||
});
|
||||
})
|
||||
.catch(error => res.status(500).json({
|
||||
error
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
module.exports = get;
|
||||
@@ -0,0 +1,40 @@
|
||||
const jwt = require('jsonwebtoken');
|
||||
|
||||
const verifyToken = (req, res, next) => {
|
||||
let localToken = req.header('token');
|
||||
|
||||
jwt.verify(localToken, process.env.TOKEN_SEED, (err, decoded) => {
|
||||
if (err) {
|
||||
return res.status(409).json({
|
||||
err: {
|
||||
message: 'Invalid token.',
|
||||
token: localToken
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
req.user = decoded.user;
|
||||
|
||||
next();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
const verifyAdmin = (req, res, next) => {
|
||||
let isAdmin = !!req.user.isAdmin;
|
||||
|
||||
if (!isAdmin) {
|
||||
return res.status(401).json({
|
||||
err: {
|
||||
message: 'Is not admin.'
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
next();
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
verifyToken,
|
||||
verifyAdmin
|
||||
};
|
||||
@@ -0,0 +1,22 @@
|
||||
const Sequelize = require("sequelize");
|
||||
const sequelize = require("../../config/sequelize.conf");
|
||||
|
||||
class Ubicacion extends Sequelize.Model {}
|
||||
Ubicacion.init({
|
||||
idUbicacion: {
|
||||
type: Sequelize.INTEGER,
|
||||
primaryKey: true,
|
||||
autoIncrement: true,
|
||||
allowNull: false,
|
||||
},
|
||||
ubicacion: {
|
||||
type: Sequelize.CHAR,
|
||||
allowNull: false,
|
||||
// unique: true
|
||||
},
|
||||
}, {
|
||||
sequelize,
|
||||
tableName: "ubicacion",
|
||||
});
|
||||
|
||||
module.exports = Ubicacion;
|
||||
@@ -0,0 +1,114 @@
|
||||
const logSymbols = require("log-symbols");
|
||||
const colors = require("colors");
|
||||
const bcrypt = require("bcrypt");
|
||||
|
||||
const admin = require("./tablas/Admin");
|
||||
const os = require("./tablas/OS");
|
||||
const activofijo = require("./tablas/ActivoFijo");
|
||||
const marca = require("./tablas/Marca");
|
||||
const uso = require("./tablas/Uso");
|
||||
const ubicacion = require("./tablas/Ubicacion");
|
||||
const tipo = require("./tablas/Tipo");
|
||||
const unidadresponsable = require("./tablas/UResponsable");
|
||||
const inventario = require("./tablas/Inventario");
|
||||
const printers = require("./tablas/Printers");
|
||||
const equipo = require("./tablas/Equipo");
|
||||
|
||||
require("../config/config");
|
||||
|
||||
async function remove() {
|
||||
console.log(logSymbols.info, "Paso 1 : Borrando base de datos \n".blue.bold);
|
||||
|
||||
await admin.drop();
|
||||
console.log(logSymbols.success, "admin");
|
||||
await equipo.drop();
|
||||
console.log(logSymbols.success, "equipo");
|
||||
await printers.drop();
|
||||
console.log(logSymbols.success, "impresoras");
|
||||
await inventario.drop();
|
||||
console.log(logSymbols.success, "inventario");
|
||||
await os.drop();
|
||||
console.log(logSymbols.success, "os");
|
||||
await activofijo.drop();
|
||||
console.log(logSymbols.success, "activo fijo");
|
||||
await marca.drop();
|
||||
console.log(logSymbols.success, "marca");
|
||||
await uso.drop();
|
||||
console.log(logSymbols.success, "uso");
|
||||
await ubicacion.drop();
|
||||
console.log(logSymbols.success, "ubicacion");
|
||||
await tipo.drop();
|
||||
console.log(logSymbols.success, "tipo");
|
||||
await unidadresponsable.drop();
|
||||
console.log(logSymbols.success, "Unidad Responsable");
|
||||
|
||||
}
|
||||
|
||||
async function install() {
|
||||
console.log(
|
||||
logSymbols.info,
|
||||
"Paso 2 : Instalando base de datos \n".blue.bold
|
||||
);
|
||||
|
||||
await admin.sync();
|
||||
console.log(logSymbols.success, "admin");
|
||||
await os.sync();
|
||||
console.log(logSymbols.success, "os");
|
||||
await activofijo.sync();
|
||||
console.log(logSymbols.success, "activo fijo");
|
||||
await marca.sync();
|
||||
console.log(logSymbols.success, "marca");
|
||||
await uso.sync();
|
||||
console.log(logSymbols.success, "uso");
|
||||
await ubicacion.sync();
|
||||
console.log(logSymbols.success, "ubicacion");
|
||||
await tipo.sync();
|
||||
console.log(logSymbols.success, "tipo");
|
||||
await unidadresponsable.sync();
|
||||
console.log(logSymbols.success, "Unidad Responsable");
|
||||
await inventario.sync();
|
||||
console.log(logSymbols.success, "inventario");
|
||||
await printers.sync();
|
||||
console.log(logSymbols.success, "impresoras");
|
||||
await equipo.sync();
|
||||
console.log(logSymbols.success, "equipo");
|
||||
|
||||
|
||||
//crear clave foranea de una tabla a otra, ejemplo
|
||||
// responsable.hasMany(programa, {
|
||||
// foreignKey: "idResponsable",
|
||||
// });
|
||||
|
||||
};
|
||||
|
||||
async function createFirstUsers() {
|
||||
console.log(
|
||||
logSymbols.info,
|
||||
"Paso 3 : Creating first users in database...\n".blue.bold
|
||||
);
|
||||
|
||||
await admin.create({
|
||||
name: 'alima',
|
||||
userName: 'Alfredo Lima',
|
||||
password: bcrypt.hashSync('contraseña', 10),
|
||||
isAdmin: true
|
||||
});
|
||||
|
||||
await admin.create({
|
||||
name: 'billie',
|
||||
userName: 'Billie',
|
||||
password: bcrypt.hashSync('contraseña', 10)
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
async function exec() {
|
||||
await remove();
|
||||
await install();
|
||||
await createFirstUsers();
|
||||
|
||||
console.log(logSymbols.success, "Éxito al instalar \n".underline.bold.green);
|
||||
process.exit();
|
||||
}
|
||||
|
||||
exec();
|
||||
@@ -0,0 +1,22 @@
|
||||
const Sequelize = require("sequelize");
|
||||
const sequelize = require("../../config/sequelize.conf");
|
||||
|
||||
class ActivoFijo extends Sequelize.Model {}
|
||||
ActivoFijo.init({
|
||||
idActivoFijo: {
|
||||
type: Sequelize.INTEGER,
|
||||
primaryKey: true,
|
||||
autoIncrement: true,
|
||||
allowNull: false,
|
||||
},
|
||||
activoFijo: {
|
||||
type: Sequelize.CHAR,
|
||||
allowNull: false,
|
||||
unique: true
|
||||
},
|
||||
}, {
|
||||
sequelize,
|
||||
tableName: "activoFijo",
|
||||
});
|
||||
|
||||
module.exports = ActivoFijo;
|
||||
@@ -0,0 +1,34 @@
|
||||
const Sequelize = require("sequelize");
|
||||
const sequelize = require("../../config/sequelize.conf");
|
||||
|
||||
class Admin extends Sequelize.Model {}
|
||||
Admin.init({
|
||||
idAdmin: {
|
||||
type: Sequelize.INTEGER,
|
||||
primaryKey: true,
|
||||
autoIncrement: true,
|
||||
allowNull: false,
|
||||
},
|
||||
name: {
|
||||
type: Sequelize.STRING(50),
|
||||
allowNull: false,
|
||||
},
|
||||
userName: {
|
||||
type: Sequelize.STRING(50),
|
||||
allowNull: false
|
||||
},
|
||||
password: {
|
||||
type: Sequelize.STRING(100),
|
||||
allowNull: false,
|
||||
},
|
||||
isAdmin: {
|
||||
type: Sequelize.BOOLEAN,
|
||||
allowNull: false,
|
||||
defaultValue: false
|
||||
}
|
||||
}, {
|
||||
sequelize,
|
||||
tableName: "users",
|
||||
});
|
||||
|
||||
module.exports = Admin;
|
||||
@@ -0,0 +1,62 @@
|
||||
const ActivoFIjo = require("./ActivoFijo");
|
||||
const Sequelize = require("sequelize");
|
||||
const sequelize = require("../../config/sequelize.conf");
|
||||
const Inventario = require("./Inventario");
|
||||
const Marca = require("./Marca");
|
||||
const OS = require("./OS");
|
||||
|
||||
class Equipo extends Sequelize.Model {}
|
||||
Equipo.init({
|
||||
idEquipo: {
|
||||
type: Sequelize.INTEGER,
|
||||
primaryKey: true,
|
||||
autoIncrement: true,
|
||||
allowNull: false,
|
||||
},
|
||||
modelo: {
|
||||
type: Sequelize.CHAR,
|
||||
allowNull: false,
|
||||
},
|
||||
noSerie: {
|
||||
type: Sequelize.CHAR,
|
||||
allowNull: false,
|
||||
},
|
||||
procesador: {
|
||||
type: Sequelize.CHAR,
|
||||
allowNull: false,
|
||||
},
|
||||
vProcesador: {
|
||||
type: Sequelize.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
memoria: {
|
||||
type: Sequelize.CHAR,
|
||||
allowNull: false,
|
||||
},
|
||||
memoriasz: {
|
||||
type: Sequelize.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
vMemoria: {
|
||||
type: Sequelize.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
graficos: {
|
||||
type: Sequelize.CHAR,
|
||||
allowNull: false,
|
||||
},
|
||||
hdd: {
|
||||
type: Sequelize.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
}, {
|
||||
sequelize,
|
||||
tableName: "equipo",
|
||||
});
|
||||
|
||||
Inventario.hasOne(Equipo, { foreignKey: 'noInventario' });
|
||||
Marca.hasOne(Equipo, { foreignKey: 'idMarca' });
|
||||
OS.hasOne(Equipo, { foreignKey: 'idOS' });
|
||||
ActivoFIjo.hasOne(Equipo, { foreignKey: 'idActivoFijo' });
|
||||
|
||||
module.exports = Equipo;
|
||||
@@ -0,0 +1,32 @@
|
||||
const Sequelize = require("sequelize");
|
||||
const sequelize = require("../../config/sequelize.conf");
|
||||
const Marca = require("./Marca");
|
||||
const Tipo = require("./Tipo");
|
||||
const ActivoFijo = require("./ActivoFijo");
|
||||
const UResponsable = require("./UResponsable");
|
||||
const Ubicacion = require("./Ubicacion");
|
||||
const Uso = require("./Uso");
|
||||
|
||||
class Inventario extends Sequelize.Model {}
|
||||
Inventario.init({
|
||||
noInventario: {
|
||||
type: Sequelize.CHAR,
|
||||
primaryKey: true,
|
||||
allowNull: false,
|
||||
unique: true
|
||||
},
|
||||
noResguardo: {
|
||||
type: Sequelize.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
}, {
|
||||
sequelize,
|
||||
tableName: "inventario",
|
||||
});
|
||||
|
||||
ActivoFijo.hasOne(Inventario, { foreignKey: 'idActivoFijo' });
|
||||
UResponsable.hasOne(Inventario, { foreignKey: 'idUnidadResponsable' });
|
||||
Ubicacion.hasOne(Inventario, { foreignKey: 'idUbicacion' });
|
||||
Uso.hasOne(Inventario, { foreignKey: 'idUso' });
|
||||
|
||||
module.exports = Inventario;
|
||||
@@ -0,0 +1,22 @@
|
||||
const Sequelize = require("sequelize");
|
||||
const sequelize = require("../../config/sequelize.conf");
|
||||
|
||||
class Marca extends Sequelize.Model {}
|
||||
Marca.init({
|
||||
idMarca: {
|
||||
type: Sequelize.INTEGER,
|
||||
primaryKey: true,
|
||||
autoIncrement: true,
|
||||
allowNull: false,
|
||||
},
|
||||
marca: {
|
||||
type: Sequelize.CHAR,
|
||||
allowNull: false,
|
||||
unique: true
|
||||
},
|
||||
}, {
|
||||
sequelize,
|
||||
tableName: "marca",
|
||||
});
|
||||
|
||||
module.exports = Marca;
|
||||
@@ -0,0 +1,22 @@
|
||||
const Sequelize = require("sequelize");
|
||||
const sequelize = require("../../config/sequelize.conf");
|
||||
|
||||
class OS extends Sequelize.Model {}
|
||||
OS.init({
|
||||
idOS: {
|
||||
type: Sequelize.INTEGER,
|
||||
primaryKey: true,
|
||||
autoIncrement: true,
|
||||
allowNull: false,
|
||||
},
|
||||
osname: {
|
||||
type: Sequelize.CHAR,
|
||||
allowNull: false,
|
||||
unique: true
|
||||
},
|
||||
}, {
|
||||
sequelize,
|
||||
tableName: "OS",
|
||||
});
|
||||
|
||||
module.exports = OS;
|
||||
@@ -0,0 +1,38 @@
|
||||
const Sequelize = require("sequelize");
|
||||
const sequelize = require("../../config/sequelize.conf");
|
||||
const Marca = require("./Marca");
|
||||
const Tipo = require("./Tipo");
|
||||
const Inventario = require("./Inventario");
|
||||
const ActivoFijo = require('./ActivoFijo');
|
||||
|
||||
class Printers extends Sequelize.Model {}
|
||||
Printers.init({
|
||||
idImpresora: {
|
||||
type: Sequelize.INTEGER,
|
||||
primaryKey: true,
|
||||
autoIncrement: true,
|
||||
allowNull: false,
|
||||
},
|
||||
noSerie: {
|
||||
type: Sequelize.CHAR,
|
||||
allowNull: false,
|
||||
},
|
||||
modelo: {
|
||||
type: Sequelize.CHAR,
|
||||
allowNull: false
|
||||
},
|
||||
descripcion: {
|
||||
type: Sequelize.CHAR,
|
||||
allowNull: false
|
||||
},
|
||||
}, {
|
||||
sequelize,
|
||||
tableName: "printers",
|
||||
});
|
||||
|
||||
Inventario.hasOne(Printers, { foreignKey: 'noInventario' });
|
||||
Marca.hasOne(Printers, { foreignKey: 'idMarca' });
|
||||
Tipo.hasOne(Printers, { foreignKey: 'idTipo' });
|
||||
ActivoFijo.hasOne(Printers, { foreignKey: 'idActivoFijo' });
|
||||
|
||||
module.exports = Printers;
|
||||
@@ -0,0 +1,22 @@
|
||||
const Sequelize = require("sequelize");
|
||||
const sequelize = require("../../config/sequelize.conf");
|
||||
|
||||
class Tipo extends Sequelize.Model {}
|
||||
Tipo.init({
|
||||
idTipo: {
|
||||
type: Sequelize.INTEGER,
|
||||
primaryKey: true,
|
||||
autoIncrement: true,
|
||||
allowNull: false,
|
||||
},
|
||||
tipo: {
|
||||
type: Sequelize.CHAR,
|
||||
allowNull: false,
|
||||
unique: true
|
||||
},
|
||||
}, {
|
||||
sequelize,
|
||||
tableName: "tipo",
|
||||
});
|
||||
|
||||
module.exports = Tipo;
|
||||
@@ -0,0 +1,26 @@
|
||||
const Sequelize = require("sequelize");
|
||||
const sequelize = require("../../config/sequelize.conf");
|
||||
|
||||
class UResponsable extends Sequelize.Model {}
|
||||
UResponsable.init({
|
||||
idUnidadResponsable: {
|
||||
type: Sequelize.INTEGER,
|
||||
primaryKey: true,
|
||||
autoIncrement: true,
|
||||
allowNull: false,
|
||||
},
|
||||
uResponsable: {
|
||||
type: Sequelize.CHAR,
|
||||
allowNull: false,
|
||||
unique: true
|
||||
},
|
||||
nombreResponsable: {
|
||||
type: Sequelize.CHAR,
|
||||
allowNull: false,
|
||||
},
|
||||
}, {
|
||||
sequelize,
|
||||
tableName: "uResponsable",
|
||||
});
|
||||
|
||||
module.exports = UResponsable;
|
||||
@@ -0,0 +1,22 @@
|
||||
const Sequelize = require("sequelize");
|
||||
const sequelize = require("../../config/sequelize.conf");
|
||||
|
||||
class Ubicacion extends Sequelize.Model {}
|
||||
Ubicacion.init({
|
||||
idUbicacion: {
|
||||
type: Sequelize.INTEGER,
|
||||
primaryKey: true,
|
||||
autoIncrement: true,
|
||||
allowNull: false,
|
||||
},
|
||||
ubicacion: {
|
||||
type: Sequelize.CHAR,
|
||||
allowNull: false,
|
||||
// unique: true
|
||||
},
|
||||
}, {
|
||||
sequelize,
|
||||
tableName: "ubicacion",
|
||||
});
|
||||
|
||||
module.exports = Ubicacion;
|
||||
@@ -0,0 +1,22 @@
|
||||
const Sequelize = require("sequelize");
|
||||
const sequelize = require("../../config/sequelize.conf");
|
||||
|
||||
class Uso extends Sequelize.Model {}
|
||||
Uso.init({
|
||||
idUso: {
|
||||
type: Sequelize.INTEGER,
|
||||
primaryKey: true,
|
||||
autoIncrement: true,
|
||||
allowNull: false,
|
||||
},
|
||||
uso: {
|
||||
type: Sequelize.CHAR,
|
||||
allowNull: false,
|
||||
unique: true
|
||||
},
|
||||
}, {
|
||||
sequelize,
|
||||
tableName: "uso",
|
||||
});
|
||||
|
||||
module.exports = Uso;
|
||||
@@ -0,0 +1,21 @@
|
||||
let express = require('express');
|
||||
let app = express();
|
||||
|
||||
const addEquip = require('../controller/addEquip/addEquip');
|
||||
const { verifyToken, verifyAdmin } = require('../middlewares/authentication');
|
||||
|
||||
const route = '/api/addEquip';
|
||||
|
||||
app.get(route, [verifyToken, verifyAdmin], (req, res) => {
|
||||
return addEquip.get(req, res);
|
||||
});
|
||||
|
||||
app.post(route, [verifyToken, verifyAdmin], (req, res) => {
|
||||
return addEquip.post(req, res);
|
||||
});
|
||||
|
||||
app.put(route, [verifyToken, verifyAdmin], (req, res) => {
|
||||
return addEquip.put(req, res);
|
||||
});
|
||||
|
||||
module.exports = app;
|
||||
@@ -0,0 +1,17 @@
|
||||
const express = require('express');
|
||||
const app = express();
|
||||
|
||||
const addPrinter = require('../controller/addPrinter/addPrinter');
|
||||
const { verifyToken, verifyAdmin } = require('../middlewares/authentication');
|
||||
|
||||
const route = '/api/addPrinter';
|
||||
|
||||
app.get(route, [verifyToken, verifyAdmin], (req, res) => {
|
||||
return addPrinter.get(req, res);
|
||||
});
|
||||
|
||||
app.post(route, [verifyToken, verifyAdmin], (req, res) => {
|
||||
return addPrinter.post(req, res);
|
||||
});
|
||||
|
||||
module.exports = app;
|
||||
@@ -1,6 +1,12 @@
|
||||
let express = require("express");
|
||||
let app = express();
|
||||
|
||||
app.use(require('./login'))
|
||||
app.use(require('./login'));
|
||||
app.use(require('./user'));
|
||||
app.use(require('./addEquip'));
|
||||
app.use(require('./addPrinter'));
|
||||
app.use(require('./updateEquip'));
|
||||
app.use(require('./updatePrinter'));
|
||||
app.use(require('./upload'));
|
||||
|
||||
module.exports = app
|
||||
module.exports = app;
|
||||
+6
-27
@@ -1,38 +1,17 @@
|
||||
let express = require("express");
|
||||
let app = express();
|
||||
let verifyToken = require('../middlewares/authentication');
|
||||
|
||||
const route = '/login'
|
||||
|
||||
//logica del login, ejemplo
|
||||
let post = require('../controller/login/post')
|
||||
let post = require('../controller/login/post');
|
||||
//let get = require('../controller/login/get')
|
||||
|
||||
app.post(route, (req, res) => {
|
||||
console.log(req.query)
|
||||
console.log(req.body)
|
||||
return post()
|
||||
.then(data => {
|
||||
res.status(200).json(data)
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err)
|
||||
res.status(400).json({
|
||||
err: err.message
|
||||
})
|
||||
})
|
||||
})
|
||||
app.post(route, async(req, res) => {
|
||||
|
||||
return post(req, res);
|
||||
|
||||
// app.get(route, (req, res) => {
|
||||
// return get()
|
||||
// .then(data => {
|
||||
// res.status(200).json(data)
|
||||
// })
|
||||
// .catch(err => {
|
||||
// res.status(400).json({
|
||||
// err: err.message
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
});
|
||||
|
||||
module.exports = app
|
||||
module.exports = app;
|
||||
@@ -0,0 +1,21 @@
|
||||
const express = require('express');
|
||||
const app = express();
|
||||
|
||||
const updateEquip = require('../controller/updateEquip/updateEquip');
|
||||
const { verifyToken, verifyAdmin } = require('../middlewares/authentication');
|
||||
|
||||
const route = '/api/updateEquip';
|
||||
|
||||
app.get(route, [verifyToken, verifyAdmin], (req, res) => {
|
||||
return updateEquip.get(req, res);
|
||||
});
|
||||
|
||||
app.put(route, [verifyToken, verifyAdmin], (req, res) => {
|
||||
return updateEquip.put(req, res);
|
||||
})
|
||||
|
||||
app.delete(route, [verifyToken, verifyAdmin], (req, res) => {
|
||||
return updateEquip.remove(req, res);
|
||||
})
|
||||
|
||||
module.exports = app;
|
||||
@@ -0,0 +1,21 @@
|
||||
const express = require('express');
|
||||
const app = express();
|
||||
|
||||
const updatePrinter = require('../controller/updatePrinter/updatePrinter');
|
||||
const { verifyToken, verifyAdmin } = require('../middlewares/authentication');
|
||||
|
||||
const route = '/api/updatePrinter';
|
||||
|
||||
app.get(route, (req, res) => {
|
||||
return updatePrinter.get(req, res);
|
||||
});
|
||||
|
||||
app.put(route, (req, res) => {
|
||||
return updatePrinter.put(req, res);
|
||||
});
|
||||
|
||||
app.delete(route, (req, res) => {
|
||||
return updatePrinter.remove(req, res);
|
||||
})
|
||||
|
||||
module.exports = app;
|
||||
@@ -0,0 +1,23 @@
|
||||
const express = require("express");
|
||||
const fileUpload = require("express-fileupload");
|
||||
|
||||
const postE = require("../controller/upload/postE");
|
||||
const postP = require("../controller/upload/postP");
|
||||
const app = express();
|
||||
|
||||
const { verifyToken, verifyAdmin } = require('../middlewares/authentication');
|
||||
|
||||
const route = "/upload";
|
||||
|
||||
// app.use(fileUpload({ createParentPath: true }));
|
||||
app.use(fileUpload({ useTempFiles: true }));
|
||||
|
||||
app.post(`${ route }/equips`, (req, res) => {
|
||||
return postE(req, res);
|
||||
});
|
||||
|
||||
app.post(`${ route }/printers`, (req, res) => {
|
||||
return postP(req, res);
|
||||
});
|
||||
|
||||
module.exports = app;
|
||||
@@ -0,0 +1,48 @@
|
||||
let express = require('express');
|
||||
let app = express();
|
||||
|
||||
// const computers_get = require('../controller/user/computers/get');
|
||||
// const printers = require('../controller/user/printers/get');
|
||||
const computers = require('../controller/user/computers/get');
|
||||
const printers = require('../controller/user/printers/get');
|
||||
|
||||
// const computers = require('../controller/api/computers');
|
||||
// const printers = require('../controller/api/printers');
|
||||
|
||||
const tipo = require('../controller/api/tipo');
|
||||
|
||||
const tipoPrinters = require('../controller/api/tipoPrinters');
|
||||
const { verifyToken, verifyAdmin } = require('../middlewares/authentication');
|
||||
|
||||
const computersRoute = '/api/computers';
|
||||
const printersRoute = '/api/printers';
|
||||
|
||||
/*=============================================
|
||||
computer
|
||||
=============================================*/
|
||||
app.get('/api/computers', verifyToken, (req, res) => {
|
||||
return computers(req, res);
|
||||
});
|
||||
|
||||
/*=============================================
|
||||
printers
|
||||
=============================================*/
|
||||
app.get(printersRoute, verifyToken, (req, res) => {
|
||||
|
||||
return printers(req, res);
|
||||
|
||||
});
|
||||
|
||||
app.get('/api/tipo', verifyToken, (req, res) => {
|
||||
|
||||
return tipo(req, res);
|
||||
|
||||
});
|
||||
|
||||
app.get('/api/tipoPrinters', verifyToken, (req, res) => {
|
||||
|
||||
return tipoPrinters(req, res);
|
||||
|
||||
});
|
||||
|
||||
module.exports = app;
|
||||
Reference in New Issue
Block a user