.
This commit is contained in:
commit
df8d988b95
124
helpers/composes.helper.js
Normal file
124
helpers/composes.helper.js
Normal file
@ -0,0 +1,124 @@
|
||||
'use strict';
|
||||
const cdnHelper = require('./cdn.helper');
|
||||
|
||||
const valuesComposer = (values) => values.map(value => ({
|
||||
id: value.id,
|
||||
name: value.name,
|
||||
}));
|
||||
|
||||
const commentsComposer = (comments) => comments.map(comment => ({
|
||||
...comment,
|
||||
userId: undefined,
|
||||
user: {
|
||||
...comment.user,
|
||||
profile_picture: cdnHelper.getCDNMediaUrl(comment.user.profile_picture)
|
||||
|
||||
}
|
||||
}))
|
||||
|
||||
|
||||
const multimediaComposer = (multimedias) => multimedias.map(multimedia => ({
|
||||
...multimedia,
|
||||
...multimedia.MultimediaFile,
|
||||
type: multimedia.type,
|
||||
media_type: multimedia.MultimediaFile.type,
|
||||
MultimediaFile: undefined,
|
||||
createdAt: undefined,
|
||||
updatedAt: undefined,
|
||||
userId: undefined,
|
||||
url: (multimedia.MultimediaFile.provider === 'cdn') ? cdnHelper.getCDNMediaUrl(multimedia.MultimediaFile.url) : multimedia.MultimediaFile.url,
|
||||
}));
|
||||
|
||||
|
||||
const socialNetworksComposer = (speaker, context) => {
|
||||
return {
|
||||
rrss: {
|
||||
twitter: speaker.twitter ? speaker.twitter : null,
|
||||
facebook: speaker.facebook ? speaker.facebook : null,
|
||||
youtube: speaker.youtube ? speaker.youtube : null,
|
||||
linkedin: speaker.linkedin ? speaker.linkedin : null,
|
||||
instagram: speaker.instagram ? speaker.instagram : null,
|
||||
web: speaker.web ? speaker.web : null
|
||||
},
|
||||
twitter: undefined,
|
||||
facebook: undefined,
|
||||
youtube: undefined,
|
||||
linkedin: undefined,
|
||||
instagram: undefined,
|
||||
web: undefined
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
const speakerComposer = (speaker, context) => {
|
||||
let multimedias = [];
|
||||
if (context.scopes.includes('includeMultimedias')) {
|
||||
multimedias = multimediaComposer(speaker.multimedias);
|
||||
};
|
||||
|
||||
let comments = [];
|
||||
if (context.scopes.includes('includeComments')) {
|
||||
comments = commentsComposer(speaker.comments);
|
||||
};
|
||||
|
||||
speaker.typename = speaker.type.name;
|
||||
delete speaker.type;
|
||||
|
||||
speaker.values = valuesComposer(speaker.values);
|
||||
|
||||
const rrss = socialNetworksComposer(speaker, context);
|
||||
|
||||
return Object.assign({},
|
||||
speaker,
|
||||
rrss,
|
||||
{ multimedias: multimedias },
|
||||
{ comments: comments },
|
||||
)
|
||||
};
|
||||
|
||||
|
||||
const eventComposer = (event, context) => {
|
||||
|
||||
if (context.scopes.includes('includeVenue')) {
|
||||
delete event.venue.updatedAt;
|
||||
delete event.venue.createdAt;
|
||||
event.venue.image_url = cdnHelper.getCDNCityMediaUrl(event.venue.city);
|
||||
};
|
||||
|
||||
let multimedias = []
|
||||
if (context.scopes.includes('includeMultimedias')) {
|
||||
multimedias = multimediaComposer(event.multimedias)
|
||||
};
|
||||
|
||||
let speakers = []
|
||||
if (context.scopes.includes('includeSpeakers')) {
|
||||
speakers = event.details.map((detail) => ({
|
||||
order: detail.order,
|
||||
...speakerComposer(detail.speaker),
|
||||
}))
|
||||
};
|
||||
|
||||
return Object.assign({},
|
||||
event,
|
||||
{ multimedias: multimedias },
|
||||
{ details: undefined },
|
||||
{ speakers: speakers }
|
||||
)
|
||||
};
|
||||
|
||||
const entityComposer = (entity, context) => {
|
||||
|
||||
delete entity.contact_person;
|
||||
delete entity.contact_email;
|
||||
|
||||
return Object.assign({},
|
||||
entity,
|
||||
)
|
||||
};
|
||||
|
||||
|
||||
module.exports = {
|
||||
entityComposer,
|
||||
speakerComposer,
|
||||
eventComposer
|
||||
}
|
||||
@ -4,18 +4,9 @@
|
||||
const _ = require('lodash');
|
||||
const { generateService, parseParamsToFindOptions } = require('../../helpers/service.helper');
|
||||
const models = require('../../core/models');
|
||||
const { entityComposer } = require('../../helpers/composes.helper');
|
||||
|
||||
|
||||
const entityComposer = (entity, context) => {
|
||||
|
||||
delete entity.contact_person;
|
||||
delete entity.contact_email;
|
||||
|
||||
return Object.assign({},
|
||||
entity,
|
||||
)
|
||||
};
|
||||
|
||||
const extraMethods = {
|
||||
|
||||
afterFetchAll: (result, params, context) => {
|
||||
|
||||
@ -41,14 +41,64 @@ const extraControllers = {
|
||||
const userId = req.user.id;
|
||||
|
||||
try {
|
||||
const result = await eventInscriptionService._getInscription(eventId, userId);
|
||||
const result = await eventInscriptionService._getInscriptionByEventAndUser(eventId, userId);
|
||||
handleResultResponse(result, null, params, res, (result === null) ? httpStatus.NOT_FOUND : httpStatus.OK);
|
||||
} catch (error) {
|
||||
handleErrorResponse(MODULE_NAME, 'getInscription', error, res)
|
||||
}
|
||||
},
|
||||
|
||||
deleteInscription: async (req, res, next) => {
|
||||
const params = extractParamsFromRequest(req, res, {});
|
||||
const user = req.user;
|
||||
const inscriptionId = params.params.id;
|
||||
|
||||
try
|
||||
{
|
||||
const inscription = await eventInscriptionService._getInscriptionById(inscriptionId);
|
||||
console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>><Inscripcion a borrar:');
|
||||
console.log(inscription);
|
||||
if (!inscription)
|
||||
return handleResultResponse("Inscription no encontrada", null, params, res, httpStatus.NOT_FOUND);
|
||||
|
||||
//Borramos inscripcion y descontamos asistentes
|
||||
if (await eventInscriptionService._deleteInscription(inscription.id) > 0){
|
||||
console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>><Inscripcion borrada');
|
||||
const EventOrReservationChangeId = ((inscription.reservationId) ? inscription.reservationId : ((inscription.overflowEventId) ? inscription.overflowEventId : inscription.eventId));
|
||||
let NewConfirmed = 0;
|
||||
console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>', inscription.reservationId);
|
||||
if (inscription.reservationId)
|
||||
NewConfirmed = await eventInscriptionService._getCountInscriptionsWithReservation(EventOrReservationChangeId)
|
||||
else if (inscription.overflowEventId)
|
||||
NewConfirmed = await eventInscriptionService._getCountInscriptionsWithOverflowEventId(EventOrReservationChangeId)
|
||||
else
|
||||
NewConfirmed = await eventInscriptionService._getCountInscriptionsWithoutReservationAndOverflow(EventOrReservationChangeId);
|
||||
|
||||
//Actualizamos aforo del evento o de la reserva
|
||||
if (inscription.reservationId){
|
||||
if (!await eventReservationService._updateConfirmedReservation(EventOrReservationChangeId, NewConfirmed))
|
||||
return handleResultResponse("Error al eliminar inscripción, no puedo cambiar confirmados a la reserva asociada", null, params, res, httpStatus.NOT_FOUND);
|
||||
}
|
||||
else {
|
||||
if (!await eventService._updateConfirmedEvent(EventOrReservationChangeId, NewConfirmed))
|
||||
return handleResultResponse("Error al eliminar inscripción, no puedo cambiar confirmados a la inscripcion", null, params, res, httpStatus.NOT_FOUND);
|
||||
|
||||
}
|
||||
|
||||
//FALTA
|
||||
//_deleteMember();
|
||||
return handleResultResponse("Inscripción eliminada", null, params, res, httpStatus.DELETEOK);
|
||||
}
|
||||
else
|
||||
return handleResultResponse("No se pudo eliminar inscripción", null, params, res, httpStatus.NOT_FOUND);
|
||||
|
||||
} catch (error) {
|
||||
return handleResultResponse("Error al eliminar inscripción", null, params, res, httpStatus.NOT_FOUND);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
//Esta función se puede llamar desde APP y desde WEB
|
||||
createInscription: async(req, res, next) => {
|
||||
const params = extractParamsFromRequest(req, res, {});
|
||||
|
||||
@ -67,7 +117,7 @@ const extraControllers = {
|
||||
eventId: params.params.id,
|
||||
reservationCode: (req.user) ? req.body.code : Buffer.from(req.body.code, 'base64').toString('ascii'),
|
||||
type: (req.body.code) ? 'reservation' : 'regular',
|
||||
ticket: null, //nº total de inscritos (libres + con reserva) - Para ticket - entrada
|
||||
source: (req.user) ? 'app' : 'web', //En el caso de tener ya usuario viene por APP sino viene por web
|
||||
validated: null, //si no esta validado la inscripción es a la lista de espera
|
||||
inscriptionsWithoutReservationCount: null, //nº total de inscritos sin reserva asignada
|
||||
inscriptionsWithReservationCount: null, //nº total de inscritos a la reserva asignada
|
||||
@ -75,7 +125,7 @@ const extraControllers = {
|
||||
reservation: null,
|
||||
inscription: null,
|
||||
}
|
||||
|
||||
|
||||
console.log('DATAUSER_INICIAL>>>>>>>>>>>>>>>>>>>>');
|
||||
console.log(dataUser);
|
||||
console.log('DATAINSCRIPTION_INICIAL>>>>>>>>>>>>>>>>>>');
|
||||
@ -138,61 +188,75 @@ const extraControllers = {
|
||||
try {
|
||||
|
||||
//Comprobamos que el usuario no tenga ya inscripcion para ese evento
|
||||
dataInscription.inscription = await eventInscriptionService._getInscription(dataInscription.event.id, dataUser.userResult.user.id);
|
||||
dataInscription.inscription = await eventInscriptionService._getInscriptionByEventAndUser(dataInscription.event.id, dataUser.userResult.user.id);
|
||||
if (dataInscription.inscription) {
|
||||
//Si es la misma reserva con la que intenta inscribirse damos ok y le damos su incripcion
|
||||
if (dataInscription.inscription.reservationId != dataInscription.reservation.id) {
|
||||
console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>inscription existe, revisar si es con codigo vip y cambiarlo, su inscripcion se ha cambiado a vip');
|
||||
console.log(dataInscription.inscription);
|
||||
}
|
||||
else {
|
||||
return handleResultResponse(dataInscription.inscription, null, params, res, httpStatus.OK);
|
||||
}
|
||||
}
|
||||
console.log('esta es la inscripcion que ya tengo>>>>>>>>>>>>>>>>>>>>><');
|
||||
console.log(dataInscription.inscription);
|
||||
//Devuelvo la reserva que ya tiene hecha el usuario
|
||||
if ((!dataInscription.inscription.reservationId) || (dataInscription.inscription.reservationId == dataInscription.reservation.id))
|
||||
return handleResultResponse(dataInscription.inscription, null, params, res, httpStatus.OK);
|
||||
|
||||
//ACTUALIZAMOS LA RESERVA DE LA INSCRIPCION CON LA NUEVA Y CAMBIAMOS COMFIRMADOS DEVOLVIENDO LA INSCRIPCIÓN CON LA NUEVA RESERVA
|
||||
let CountConfirmedOldReservation = await eventInscriptionService._getCountInscriptionsWithReservation(dataInscription.inscription.reservationId);
|
||||
--CountConfirmedOldReservation;
|
||||
console.log('actualizo confirmados de la reserva anterior');
|
||||
await eventReservationService._updateConfirmedReservation(dataInscription.inscription.reservationId, CountConfirmedOldReservation);
|
||||
|
||||
let CountConfirmedNewReservation = await eventInscriptionService._getCountInscriptionsWithReservation(dataInscription.reservation.id);
|
||||
++CountConfirmedNewReservation;
|
||||
console.log('actualizo confirmados de la nueva reserva');
|
||||
await eventReservationService._updateConfirmedReservation(dataInscription.reservation.id, CountConfirmedNewReservation);
|
||||
await eventInscriptionService._updateReservationOfInscription(dataInscription.inscription.id, dataInscription.reservation.id);
|
||||
|
||||
dataInscription.inscription = await eventInscriptionService._getInscriptionById(dataInscription.inscription.id);
|
||||
return handleResultResponse(dataInscription.inscription, null, params, res, httpStatus.OK);
|
||||
}
|
||||
//TENEMOS QUE CREAR INSCRIPCIÓN
|
||||
else {
|
||||
const source = (dataUser.userResult.isCreated) ? 'web' : 'app';
|
||||
dataInscription.ticket = await eventInscriptionService._getCountInscriptionsEvent(dataInscription.event.id);
|
||||
++dataInscription.ticket;
|
||||
|
||||
//CON CODIGO DE RESERVA SE MODIFICA EL CONFIRMED DE LA RESERVA, YA QUE SE DESCONTARA DEL AFORO DE LA RESERVA
|
||||
if (dataInscription.reservation) {
|
||||
dataInscription.inscriptionsWithReservationCount = await eventInscriptionService._getCountInscriptionsWithReservation(dataInscription.reservation.id);
|
||||
++dataInscription.inscriptionsWithReservationCount;
|
||||
|
||||
console.log('me inscribo por reserva>>>>>>>>>>>>>>>>>>>>>>>>>>><< con asistentes: ', dataInscription.reservation.assistants);
|
||||
console.log(dataInscription.reservation.sold_out);
|
||||
console.log(dataInscription.inscriptionsWithReservationCount);
|
||||
|
||||
//COMPROBAMOS SI ES VALIDO O HAY QUE APUNTARLE A LA LISTA DE ESPERA DE LA RESERVA
|
||||
if (dataInscription.reservation.assistants >= dataInscription.inscriptionsWithReservationCount) {
|
||||
if ((dataInscription.reservation.sold_out == 0) && (dataInscription.reservation.assistants >= dataInscription.inscriptionsWithReservationCount)) {
|
||||
dataInscription.validated = true;
|
||||
|
||||
//Actualizamos aforo de la lista de espera de la reserva y creamos inscripcion en la lista de espera de la reserva
|
||||
if (await eventReservationService._updateReservationEvent(dataInscription.reservation.id, dataInscription.inscriptionsWithReservationCount))
|
||||
if (await eventReservationService._updateConfirmedReservation(dataInscription.reservation.id, dataInscription.inscriptionsWithReservationCount))
|
||||
dataInscription.inscription = await eventInscriptionService._createInscription(dataInscription.event.id,
|
||||
dataUser.userResult.user.id,
|
||||
dataInscription.ticket,
|
||||
dataInscription.type,
|
||||
dataInscription.validated,
|
||||
source, dataInscription.reservation.id,
|
||||
dataInscription.source,
|
||||
dataInscription.reservation.id,
|
||||
null)
|
||||
else
|
||||
return handleResultResponse("No se ha podido actualizar el aforo de la reserva", null, params, res, httpStatus.NOT_FOUND);
|
||||
}
|
||||
//LISTA DE ESPERA DE LA RESERVA
|
||||
|
||||
//Ponemos la reserva en SOLD_OUT y abrimos la lista de espera si se puede
|
||||
else {
|
||||
await eventReservationService._updateSoldOutReservation(dataInscription.reservation.id, true);
|
||||
if (dataInscription.reservation.allow_overflow === true) {
|
||||
dataInscription.validated = false;
|
||||
dataInscription.inscriptionsWithReservationCount = await eventInscriptionService._getCountInscriptionsWithReservation(dataInscription.reservation.overflow_event_reservationId);
|
||||
dataInscription.inscriptionsWithReservationCount = await eventInscriptionService._getCountInscriptionsWithReservation(dataInscription.reservation.overflow_reservationId);
|
||||
++dataInscription.inscriptionsWithReservationCount;
|
||||
|
||||
// if (dataInscription.reservation.assistants >= dataInscription.inscriptionsWithReservationCount) {
|
||||
//Actualizamos aforo de la reserva y creamos inscripcion
|
||||
if (await eventReservationService._updateReservationEvent(dataInscription.reservation.overflow_event_reservationId, dataInscription.inscriptionsWithReservationCount))
|
||||
if (await eventReservationService._updateConfirmedReservation(dataInscription.reservation.overflow_reservationId, dataInscription.inscriptionsWithReservationCount))
|
||||
dataInscription.inscription = await eventInscriptionService._createInscription(dataInscription.event.id,
|
||||
dataUser.userResult.user.id,
|
||||
dataInscription.ticket,
|
||||
dataInscription.type,
|
||||
dataInscription.validated,
|
||||
source,
|
||||
dataInscription.reservation.overflow_event_reservationId,
|
||||
dataInscription.source,
|
||||
dataInscription.reservation.overflow_reservationId,
|
||||
null)
|
||||
else
|
||||
return handleResultResponse("No se ha podido actualizar el aforo de la reserva", null, params, res, httpStatus.NOT_FOUND);
|
||||
@ -203,41 +267,40 @@ const extraControllers = {
|
||||
}
|
||||
//SIN CODIGO DE RESERVA SE MODIFICA EL CONFIRMED DEL EVENTO, YA QUE SE DESCONTARA DEL AFORO DEL EVENTO
|
||||
else {
|
||||
dataInscription.inscriptionsWithoutReservationCount = await eventInscriptionService._getCountInscriptionsWithoutReservation(dataInscription.event.id);
|
||||
dataInscription.inscriptionsWithoutReservationCount = await eventInscriptionService._getCountInscriptionsWithoutReservationAndOverflow(dataInscription.event.id);
|
||||
++dataInscription.inscriptionsWithoutReservationCount;
|
||||
|
||||
|
||||
//COMPROBAMOS SI ES VALIDO O HAY QUE APUNTARLE A LA LISTA DE ESPERA DEL EVENTO
|
||||
if (dataInscription.event.assistants >= dataInscription.inscriptionsWithoutReservationCount) {
|
||||
if ((dataInscription.event.sold_out == 0) && (dataInscription.event.assistants >= dataInscription.inscriptionsWithoutReservationCount)) {
|
||||
dataInscription.validated = true;
|
||||
//Actualizamos aforo del evento y creamos inscripcion
|
||||
if (await eventService._updateConfirmedEvent(dataInscription.event.id, dataInscription.inscriptionsWithoutReservationCount))
|
||||
dataInscription.inscription = await eventInscriptionService._createInscription(dataInscription.event.id,
|
||||
dataUser.userResult.user.id,
|
||||
dataInscription.ticket,
|
||||
dataInscription.type,
|
||||
dataInscription.validated,
|
||||
source,
|
||||
dataInscription.source,
|
||||
null,
|
||||
null)
|
||||
else
|
||||
return handleResultResponse("No se ha podido actualizar el aforo del evento", null, params, res, httpStatus.NOT_FOUND);
|
||||
}
|
||||
//LISTA DE ESPERA DE LA RESERVA
|
||||
//Ponemos el evento en SOLD_OUT y abrimos la lista de espera si se puede
|
||||
else {
|
||||
await eventService._updateSoldOutEvent(dataInscription.event.id, true);
|
||||
if (dataInscription.event.allow_overflow === true) {
|
||||
dataInscription.validated = false;
|
||||
|
||||
//Actualizamos aforo de la lista de espera del evento y creamos inscripcion
|
||||
if (await eventService._updateConfirmedEvent(dataInscription.event.overflow_eventId, dataInscription.inscriptionsWithoutReservationCount))
|
||||
dataInscription.inscription = await eventInscriptionService._createInscription(dataInscription.event.overflow_eventId,
|
||||
dataInscription.inscription = await eventInscriptionService._createInscription(dataInscription.event.id,
|
||||
dataUser.userResult.user.id,
|
||||
dataInscription.ticket,
|
||||
dataInscription.type,
|
||||
dataInscription.validated,
|
||||
source,
|
||||
dataInscription.source,
|
||||
null,
|
||||
dataInscription.overflow_eventId)
|
||||
dataInscription.event.overflow_eventId)
|
||||
else
|
||||
return handleResultResponse("No se ha podido actualizar el aforo del evento", null, params, res, httpStatus.NOT_FOUND);
|
||||
}
|
||||
@ -252,7 +315,6 @@ const extraControllers = {
|
||||
return handleErrorResponse(MODULE_NAME, 'createInscription', error, res);
|
||||
}
|
||||
|
||||
|
||||
return handleResultResponse(await dataInscription.inscription.toJSON(), null, params, res, httpStatus.CREATED)
|
||||
|
||||
/*
|
||||
|
||||
@ -3,14 +3,12 @@ const moment = require('moment');
|
||||
const Sequelize = require('sequelize');
|
||||
moment.locale('es');
|
||||
|
||||
const getStateText = (conference) => {
|
||||
|
||||
const getStateText = (event) => {
|
||||
var currentDate = moment().utc(),
|
||||
initDate = moment.utc(conference.ini_date),
|
||||
endDate = moment.utc(conference.end_date),
|
||||
init_availableDate = moment.utc(conference.init_available_date),
|
||||
end_availableDate = moment.utc(conference.end_available_date),
|
||||
isFull = (conference.confirmed > conference.assistans);
|
||||
initDate = moment.utc(event.ini_date),
|
||||
endDate = moment.utc(event.end_date),
|
||||
init_availableDate = moment.utc(event.init_available_date),
|
||||
end_availableDate = moment.utc(event.end_available_date);
|
||||
|
||||
if (moment(currentDate).isBetween(initDate, endDate)) {
|
||||
return 'Congreso en curso';
|
||||
@ -19,7 +17,7 @@ const getStateText = (conference) => {
|
||||
return 'Congreso finalizado';
|
||||
} else {
|
||||
if (moment(currentDate).isBetween(init_availableDate, end_availableDate)) {
|
||||
return isFull ? 'Inscripciones abiertas a lista de espera' : 'Inscripciones abiertas';
|
||||
return (event.sold_out == 1) ? 'Inscripciones abiertas a lista de espera' : 'Inscripciones abiertas';
|
||||
} else {
|
||||
return 'Inscripciones a partir del ' + moment(init_availableDate).format('D [de] MMMM');
|
||||
}
|
||||
@ -70,6 +68,10 @@ module.exports = function (sequelize, DataTypes) {
|
||||
confirmed: {
|
||||
type: DataTypes.INTEGER,
|
||||
},
|
||||
sold_out: { //Se han vendido todas y se ha abierto lista de espera si hay asignada
|
||||
type: DataTypes.BOOLEAN,
|
||||
defaultValue: false,
|
||||
},
|
||||
allow_multiple: {
|
||||
type: DataTypes.BOOLEAN,
|
||||
allowNull: false,
|
||||
@ -94,7 +96,7 @@ module.exports = function (sequelize, DataTypes) {
|
||||
defaultValue: 'draft'
|
||||
},
|
||||
stateText: {
|
||||
type: Sequelize.VIRTUAL(Sequelize.STRING, ['init_date', 'end_date', 'init_available_date', 'end_available_date', 'assistants', 'confirmed']),
|
||||
type: Sequelize.VIRTUAL(Sequelize.STRING, ['init_date', 'end_date', 'init_available_date', 'end_available_date', 'sold_out']),
|
||||
get: function () {
|
||||
return getStateText(this);
|
||||
},
|
||||
|
||||
@ -128,10 +128,11 @@ routes.post('/events/:id/inscriptions',
|
||||
eventController.createInscription
|
||||
);
|
||||
|
||||
routes.delete('/events/:id/inscriptions',
|
||||
// Borrar una inscripción (poner el id de la inscripción????)
|
||||
// Borrar una inscripción
|
||||
routes.delete('/inscriptions/:id',
|
||||
isLoggedUser,
|
||||
//eventController.findComments
|
||||
//SchemaValidator(eventValidation.InscriptionInputType, true),
|
||||
eventController.deleteInscription
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -6,62 +6,12 @@ const moment = require('moment');
|
||||
const { generateService, parseParamsToFindOptions } = require('../../helpers/service.helper');
|
||||
const Sequelize = require('sequelize');
|
||||
const models = require('../../core/models');
|
||||
const cdnHelper = require('../../helpers/cdn.helper');
|
||||
|
||||
|
||||
const multimediaComposer = (multimedias) => multimedias.map(multimedia => ({
|
||||
...multimedia,
|
||||
...multimedia.MultimediaFile,
|
||||
type: multimedia.type,
|
||||
media_type: multimedia.MultimediaFile.type,
|
||||
MultimediaFile: undefined,
|
||||
createdAt: undefined,
|
||||
updatedAt: undefined,
|
||||
userId: undefined,
|
||||
url: (multimedia.MultimediaFile.provider === 'cdn') ? cdnHelper.getCDNMediaUrl(multimedia.MultimediaFile.url) : multimedia.MultimediaFile.url,
|
||||
}));
|
||||
|
||||
const speakerComposer = (speaker, context) => {
|
||||
delete speaker.createdAt;
|
||||
delete speaker.updatedAt;
|
||||
return {...speaker,
|
||||
multimedias: multimediaComposer(speaker.multimedias),
|
||||
}
|
||||
}
|
||||
|
||||
const eventComposer = (event, context) => {
|
||||
|
||||
if (context.scopes.includes('includeVenue')) {
|
||||
delete event.venue.updatedAt;
|
||||
delete event.venue.createdAt;
|
||||
event.venue.image_url = cdnHelper.getCDNCityMediaUrl(event.venue.city);
|
||||
};
|
||||
|
||||
let multimedias = []
|
||||
if (context.scopes.includes('includeMultimedias')) {
|
||||
multimedias = multimediaComposer(event.multimedias)
|
||||
};
|
||||
|
||||
let speakers = []
|
||||
if (context.scopes.includes('includeSpeakers')) {
|
||||
speakers = event.details.map((detail) => ({
|
||||
order: detail.order,
|
||||
... speakerComposer(detail.speaker),
|
||||
}))
|
||||
};
|
||||
|
||||
return Object.assign({},
|
||||
event,
|
||||
{ multimedias: multimedias },
|
||||
{ details: undefined },
|
||||
{ speakers: speakers }
|
||||
)
|
||||
};
|
||||
|
||||
const { eventComposer } = require('../../helpers/composes.helper');
|
||||
|
||||
const extraMethods = {
|
||||
|
||||
afterFetchAll: (result, params, context) => {
|
||||
|
||||
|
||||
if (!result.count) {
|
||||
return result;
|
||||
}
|
||||
@ -95,7 +45,7 @@ const extraMethods = {
|
||||
return new Promise(function (resolve, reject) {
|
||||
models.Event.update(
|
||||
{
|
||||
confirmed : confirmed,
|
||||
confirmed: confirmed,
|
||||
},
|
||||
{
|
||||
where: { id: eventId }
|
||||
@ -112,6 +62,40 @@ const extraMethods = {
|
||||
});
|
||||
},
|
||||
|
||||
_updateSoldOutEvent: (eventId, sold_out) => {
|
||||
return new Promise(function (resolve, reject) {
|
||||
models.Event.update(
|
||||
{
|
||||
sold_out: sold_out,
|
||||
},
|
||||
{
|
||||
where: { id: eventId }
|
||||
})
|
||||
.then(function (result) {
|
||||
const aaa = result[0];
|
||||
console.log('aaaaaaaaaaaaaaaaaaaaaaaaaaa');
|
||||
console.log(aaa);
|
||||
resolve((result[0] === 1));
|
||||
})
|
||||
.catch(function (error) {
|
||||
reject(error)
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
_deleteMember: () => {
|
||||
return true;
|
||||
var marketingList = (inscription.type == 'regular') ? inscription.conference.marketingList : inscription.level.partner.marketingList;
|
||||
return new Promise(function (resolve, reject) {
|
||||
if (!marketingList) {
|
||||
resolve();
|
||||
} else {
|
||||
resolve(marketing.deleteMember(marketingList, inscription.marketingMemberId))
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
};
|
||||
|
||||
module.exports = generateService(models.Event, extraMethods);
|
||||
@ -25,7 +25,7 @@ module.exports = function (sequelize, DataTypes) {
|
||||
type: DataTypes.DATE,
|
||||
},
|
||||
code_ticket: {
|
||||
type: DataTypes.INTEGER,
|
||||
type: DataTypes.STRING(45),
|
||||
},
|
||||
type: {
|
||||
type: DataTypes.STRING,
|
||||
@ -60,6 +60,7 @@ module.exports = function (sequelize, DataTypes) {
|
||||
tableName: 'events_inscriptions',
|
||||
freezeTableName: true,
|
||||
timestamps: true,
|
||||
|
||||
});
|
||||
|
||||
EventInscription.associate = function (models) {
|
||||
|
||||
@ -8,7 +8,15 @@ const models = require('../../core/models');
|
||||
|
||||
const extraMethods = {
|
||||
|
||||
_getInscription: (eventId, userId) => {
|
||||
_getInscriptionById: (Id) => {
|
||||
return models.EventInscription.findOne({
|
||||
where: {
|
||||
id: Id,
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
_getInscriptionByEventAndUser: (eventId, userId) => {
|
||||
return models.EventInscription.findOne({
|
||||
where: {
|
||||
eventId: eventId,
|
||||
@ -17,21 +25,13 @@ const extraMethods = {
|
||||
})
|
||||
},
|
||||
|
||||
//Nos devuelve el número total de inscripciones realizadas para ese evento (para el codigo de ticket-entrada)
|
||||
_getCountInscriptionsEvent: (eventId) => {
|
||||
return models.EventInscription.count({
|
||||
where: {
|
||||
eventId: eventId,
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
//Nos devuelve el número de inscripciones realizadas para ese evento
|
||||
_getCountInscriptionsWithoutReservation: (eventId) => {
|
||||
//Nos devuelve el número de inscripciones confirmadas para ese evento sin tener en cuenta reservas
|
||||
_getCountInscriptionsWithoutReservationAndOverflow: (eventId) => {
|
||||
return models.EventInscription.count({
|
||||
where: {
|
||||
eventId: eventId,
|
||||
reservationId : null,
|
||||
reservationId: null,
|
||||
overflowEventId: null
|
||||
},
|
||||
})
|
||||
},
|
||||
@ -44,10 +44,28 @@ const extraMethods = {
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
//Nos devuelve el número de inscripciones realizadas con esa reserva
|
||||
_getCountInscriptionsWithOverflowEventId: (overflowEventId) => {
|
||||
return models.EventInscription.count({
|
||||
where: {
|
||||
overflowEventId: overflowEventId,
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
_createInscription: (eventId, userId, ticket, type, validated, source, reservationId, overflowEventId) => {
|
||||
_updateReservationOfInscription: (id, reservationId) => {
|
||||
return models.EventInscription.update ({
|
||||
reservationId: reservationId,
|
||||
},
|
||||
{
|
||||
where: { id: id }
|
||||
});
|
||||
},
|
||||
|
||||
_createInscription: (eventId, userId, type, validated, source, reservationId, overflowEventId) => {
|
||||
console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<valores de la inscripcion');
|
||||
console.log(eventId, userId, ticket, type, validated, source, reservationId, overflowEventId);
|
||||
console.log(eventId, userId, type, validated, source, reservationId, overflowEventId);
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
models.EventInscription.create({
|
||||
@ -55,7 +73,7 @@ console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<valores de la inscripcion');
|
||||
date: moment().utc(),
|
||||
userId: userId,
|
||||
type: type,
|
||||
code_ticket: ticket,
|
||||
code_ticket: ('ENT-' + (Date.now() + Math.random()).toString()),
|
||||
source: source,
|
||||
validated: validated,
|
||||
reservationId: reservationId,
|
||||
@ -70,6 +88,16 @@ console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<valores de la inscripcion');
|
||||
});
|
||||
},
|
||||
|
||||
_deleteInscription: (id) => {
|
||||
|
||||
//habria que poner el idusuario para asegurar que otro usuario no borra una inscripcion de otro
|
||||
|
||||
return models.EventInscription.destroy({
|
||||
where: {
|
||||
id: id,
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -1,4 +1,21 @@
|
||||
'use strict';
|
||||
const moment = require('moment');
|
||||
const Sequelize = require('sequelize');
|
||||
moment.locale('es');
|
||||
|
||||
const getStateText = (reservation) => {
|
||||
|
||||
var currentDate = moment().utc(),
|
||||
init_availableDate = moment.utc(reservation.init_available_date),
|
||||
end_availableDate = moment.utc(reservation.end_available_date);
|
||||
|
||||
if (moment(currentDate).isBetween(init_availableDate, end_availableDate)) {
|
||||
return (reservation.sold_out == 1) ? 'Inscripciones abiertas a lista de espera de la reserva' : 'Inscripciones abiertas a la reserva';
|
||||
} else {
|
||||
return 'Inscripciones a la reserva a partir del ' + moment(init_availableDate).format('D [de] MMMM');
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
module.exports = function (sequelize, DataTypes) {
|
||||
const EventReservation = sequelize.define('EventReservation', {
|
||||
@ -29,6 +46,10 @@ module.exports = function (sequelize, DataTypes) {
|
||||
confirmed: {
|
||||
type: DataTypes.INTEGER,
|
||||
},
|
||||
sold_out: { //Se han vendido todas y se ha abierto lista de espera si hay asignada
|
||||
type: DataTypes.BOOLEAN,
|
||||
defaultValue: false,
|
||||
},
|
||||
allow_multiple: {
|
||||
type: DataTypes.BOOLEAN,
|
||||
allowNull: false,
|
||||
@ -54,13 +75,20 @@ module.exports = function (sequelize, DataTypes) {
|
||||
allowNull: false,
|
||||
defaultValue: false,
|
||||
},
|
||||
overflow_event_reservationId: {
|
||||
overflow_reservationId: {
|
||||
type: DataTypes.UUID,
|
||||
foreignKey: true,
|
||||
},
|
||||
marketing_list: {
|
||||
type: DataTypes.STRING,
|
||||
},
|
||||
stateText: {
|
||||
type: Sequelize.VIRTUAL(Sequelize.STRING, ['init_available_date', 'end_available_date', 'sold_out']),
|
||||
get: function () {
|
||||
return getStateText(this);
|
||||
},
|
||||
},
|
||||
|
||||
}, {
|
||||
tableName: 'events_reservations',
|
||||
freezeTableName: true,
|
||||
@ -70,7 +98,7 @@ module.exports = function (sequelize, DataTypes) {
|
||||
EventReservation.associate = function (models) {
|
||||
EventReservation.OverflowEventReservation = EventReservation.belongsTo(models.EventReservation, {
|
||||
as: 'EventToEvent',
|
||||
foreignKey: 'overflow_event_reservationId' });
|
||||
foreignKey: 'overflow_reservationId' });
|
||||
EventReservation.Entity = EventReservation.belongsTo(models.Entity, { foreignKey: 'entityId' });
|
||||
EventReservation.Event = EventReservation.belongsTo(models.Event, { foreignKey: 'eventId' });
|
||||
EventReservation.UserCreate = EventReservation.belongsTo(models.User, { foreignKey: 'userId' });
|
||||
|
||||
@ -16,7 +16,7 @@ const extraMethods = {
|
||||
})
|
||||
},
|
||||
|
||||
_updateReservationEvent: (id, confirmed) => {
|
||||
_updateConfirmedReservation: (id, confirmed) => {
|
||||
return new Promise(function (resolve, reject) {
|
||||
models.EventReservation.update(
|
||||
{
|
||||
@ -34,6 +34,24 @@ const extraMethods = {
|
||||
});
|
||||
},
|
||||
|
||||
_updateSoldOutReservation: (id, sold_out) => {
|
||||
return new Promise(function (resolve, reject) {
|
||||
models.EventReservation.update(
|
||||
{
|
||||
sold_out: sold_out,
|
||||
},
|
||||
{
|
||||
where: { id: id }
|
||||
})
|
||||
.then(function (result) {
|
||||
resolve((result[0] === 1));
|
||||
})
|
||||
.catch(function (error) {
|
||||
reject(error)
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
module.exports = generateService(models.EventReservation, extraMethods);
|
||||
@ -5,81 +5,7 @@ const _ = require('lodash');
|
||||
const { generateService, parseParamsToFindOptions } = require('../../helpers/service.helper');
|
||||
const Sequelize = require('sequelize');
|
||||
const models = require('../../core/models');
|
||||
const cdnHelper = require('../../helpers/cdn.helper');
|
||||
|
||||
|
||||
const multimediaComposer = (multimedias) => multimedias.map(multimedia => ({
|
||||
...multimedia,
|
||||
...multimedia.multimediaFile,
|
||||
type: multimedia.type,
|
||||
media_type: multimedia.multimediaFile.type,
|
||||
multimediaFile: undefined,
|
||||
createdAt: undefined,
|
||||
updatedAt: undefined,
|
||||
userId: undefined,
|
||||
url: (multimedia.multimediaFile.provider === 'cdn') ? cdnHelper.getCDNMediaUrl(multimedia.multimediaFile.url) : multimedia.multimediaFile.url,
|
||||
}));
|
||||
|
||||
const valuesComposer = (values) => values.map(value => ({
|
||||
id: value.id,
|
||||
name: value.name,
|
||||
}));
|
||||
|
||||
const commentsComposer = (comments) => comments.map(comment => ({
|
||||
...comment,
|
||||
userId: undefined,
|
||||
user: {
|
||||
...comment.user,
|
||||
profile_picture: cdnHelper.getCDNMediaUrl(comment.user.profile_picture)
|
||||
|
||||
}
|
||||
}))
|
||||
|
||||
|
||||
const socialNetworksComposer = (speaker, context) => {
|
||||
return {
|
||||
rrss: {
|
||||
twitter: speaker.twitter ? speaker.twitter : null,
|
||||
facebook: speaker.facebook ? speaker.facebook : null,
|
||||
youtube: speaker.youtube ? speaker.youtube : null,
|
||||
linkedin: speaker.linkedin ? speaker.linkedin : null,
|
||||
instagram: speaker.instagram ? speaker.instagram : null,
|
||||
web: speaker.web ? speaker.web : null
|
||||
},
|
||||
twitter: undefined,
|
||||
facebook: undefined,
|
||||
youtube: undefined,
|
||||
linkedin: undefined,
|
||||
instagram: undefined,
|
||||
web: undefined
|
||||
};
|
||||
};
|
||||
|
||||
const speakerComposer = (speaker, context) => {
|
||||
let multimedias = [];
|
||||
if (context.scopes.includes('includeMultimedias')) {
|
||||
multimedias = multimediaComposer(speaker.multimedias);
|
||||
};
|
||||
|
||||
let comments = [];
|
||||
if (context.scopes.includes('includeComments')) {
|
||||
comments = commentsComposer(speaker.comments);
|
||||
};
|
||||
|
||||
speaker.typename = speaker.type.name;
|
||||
delete speaker.type;
|
||||
|
||||
speaker.values = valuesComposer(speaker.values);
|
||||
|
||||
const rrss = socialNetworksComposer(speaker, context);
|
||||
|
||||
return Object.assign({},
|
||||
speaker,
|
||||
rrss,
|
||||
{ multimedias: multimedias },
|
||||
{ comments: comments },
|
||||
)
|
||||
};
|
||||
const { speakerComposer } = require('../../helpers/composes.helper');
|
||||
|
||||
const extraMethods = {
|
||||
afterFetchAll: (result, params, context) => {
|
||||
|
||||
@ -105,7 +105,7 @@ CREATE TABLE `events_reservations` (
|
||||
`reservation_code` varchar(255) NOT NULL,
|
||||
`color` varchar(255) NOT NULL,
|
||||
`allow_overflow` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`overflow_event_reservationId` char(36) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
|
||||
`overflow_reservationId` char(36) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
|
||||
`marketing_list` varchar(255) DEFAULT NULL,
|
||||
`createdAt` datetime NOT NULL,
|
||||
`updatedAt` datetime NOT NULL,
|
||||
|
||||
@ -106,7 +106,7 @@ insert into lqdvi_v2.events_reservations
|
||||
(id, init_available_date, end_available_date, gmt, state,
|
||||
assistants, confirmed, allow_multiple, multiple_limit,
|
||||
description, reservation_code, color,
|
||||
allow_overflow, overflow_event_reservationID, marketing_list,
|
||||
allow_overflow, overflow_reservationID, marketing_list,
|
||||
createdAt, updatedAt, userID,
|
||||
entityId, eventid, entityname)
|
||||
|
||||
|
||||
@ -373,7 +373,7 @@ CREATE TABLE `events_reservations` (
|
||||
`reservation_code` varchar(255) NOT NULL,
|
||||
`color` varchar(255) NOT NULL,
|
||||
`allow_overflow` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`overflow_event_reservationId` char(36) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
|
||||
`overflow_reservationId` char(36) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
|
||||
`marketing_list` varchar(255) DEFAULT NULL,
|
||||
`createdAt` datetime NOT NULL,
|
||||
`updatedAt` datetime NOT NULL,
|
||||
|
||||
146
yarn.lock
146
yarn.lock
@ -350,6 +350,11 @@ anymatch@^2.0.0:
|
||||
micromatch "^3.1.4"
|
||||
normalize-path "^2.1.1"
|
||||
|
||||
apicache@^1.4.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/apicache/-/apicache-1.4.0.tgz#3835fbe18717caca3a44cb6272d49b52cac30d3a"
|
||||
integrity sha512-pX/Sf9q9HNzAC5F+hPgxt8v3eQVZkXL/+8HpAnrDJXFmma80F2aHAAeWTql3BsG87lc3T6A7CFPNWMTl97L/7Q==
|
||||
|
||||
aproba@^1.0.3:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a"
|
||||
@ -472,7 +477,7 @@ bcrypt@^3.0.6:
|
||||
nan "2.13.2"
|
||||
node-pre-gyp "0.12.0"
|
||||
|
||||
bignumber.js@^7.0.0:
|
||||
bignumber.js@7.2.1, bignumber.js@^7.0.0:
|
||||
version "7.2.1"
|
||||
resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-7.2.1.tgz#80c048759d826800807c4bfd521e50edbba57a5f"
|
||||
integrity sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ==
|
||||
@ -550,6 +555,11 @@ buffer-equal-constant-time@1.0.1:
|
||||
resolved "https://registry.yarnpkg.com/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz#f8e71132f7ffe6e01a5c9697a4c6f3e48d5cc819"
|
||||
integrity sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=
|
||||
|
||||
buffer-from@^0.1.1:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-0.1.2.tgz#15f4b9bcef012044df31142c14333caf6e0260d0"
|
||||
integrity sha512-RiWIenusJsmI2KcvqQABB83tLxCByE3upSP8QU3rJDMVFGPWLvPQJt/O1Su9moRWeH7d+Q2HYb68f6+v+tw2vg==
|
||||
|
||||
buffer-from@^1.0.0:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
|
||||
@ -1047,6 +1057,11 @@ delegates@^1.0.0:
|
||||
resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a"
|
||||
integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=
|
||||
|
||||
denque@^1.4.0:
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/denque/-/denque-1.4.1.tgz#6744ff7641c148c3f8a69c307e51235c1f4a37cf"
|
||||
integrity sha512-OfzPuSZKGcgr96rf1oODnfjqBFmr1DVoc/TrItj3Ohe0Ah1C5WX5Baquw/9U9KovnQ88EqmJbD66rKYUQYN1tQ==
|
||||
|
||||
depd@2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df"
|
||||
@ -1153,6 +1168,11 @@ dottie@^2.0.0:
|
||||
resolved "https://registry.yarnpkg.com/dottie/-/dottie-2.0.1.tgz#697ad9d72004db7574d21f892466a3c285893659"
|
||||
integrity sha512-ch5OQgvGDK2u8pSZeSYAQaV/lczImd7pMJ7BcEPXmnFVjy4yJIzP6CsODJUTH8mg1tyH1Z2abOiuJO3DjZ/GBw==
|
||||
|
||||
double-ended-queue@^2.1.0-0:
|
||||
version "2.1.0-0"
|
||||
resolved "https://registry.yarnpkg.com/double-ended-queue/-/double-ended-queue-2.1.0-0.tgz#103d3527fd31528f40188130c841efdd78264e5c"
|
||||
integrity sha1-ED01J/0xUo9AGIEwyEHv3XgmTlw=
|
||||
|
||||
duplexer3@^0.1.4:
|
||||
version "0.1.4"
|
||||
resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2"
|
||||
@ -1705,6 +1725,13 @@ gcs-resumable-upload@^1.0.0:
|
||||
pumpify "^1.5.1"
|
||||
stream-events "^1.0.4"
|
||||
|
||||
generate-function@^2.3.1:
|
||||
version "2.3.1"
|
||||
resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.3.1.tgz#f069617690c10c868e73b8465746764f97c3479f"
|
||||
integrity sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==
|
||||
dependencies:
|
||||
is-property "^1.0.2"
|
||||
|
||||
get-stream@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14"
|
||||
@ -2016,7 +2043,7 @@ iconv-lite@0.4.23:
|
||||
dependencies:
|
||||
safer-buffer ">= 2.1.2 < 3"
|
||||
|
||||
iconv-lite@^0.4.17, iconv-lite@^0.4.4:
|
||||
iconv-lite@^0.4.17, iconv-lite@^0.4.24, iconv-lite@^0.4.4:
|
||||
version "0.4.24"
|
||||
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
|
||||
integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==
|
||||
@ -2275,6 +2302,11 @@ is-promise@^2.1.0:
|
||||
resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa"
|
||||
integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=
|
||||
|
||||
is-property@^1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84"
|
||||
integrity sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=
|
||||
|
||||
is-redirect@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24"
|
||||
@ -2348,6 +2380,11 @@ joi@^14.3.1:
|
||||
isemail "3.x.x"
|
||||
topo "3.x.x"
|
||||
|
||||
js-base64@^2.4.9:
|
||||
version "2.5.1"
|
||||
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.5.1.tgz#1efa39ef2c5f7980bb1784ade4a8af2de3291121"
|
||||
integrity sha512-M7kLczedRMYX4L8Mdh4MzyAMM9O5osx+4FcOQuTvr3A9F2D9S5JXheN0ewNbrvK2UatkTRhL5ejGmGSjNMiZuw==
|
||||
|
||||
js-tokens@^3.0.2:
|
||||
version "3.0.2"
|
||||
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
|
||||
@ -2514,6 +2551,11 @@ lodash.once@^4.0.0:
|
||||
resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac"
|
||||
integrity sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=
|
||||
|
||||
lodash.throttle@^4.1.1:
|
||||
version "4.1.1"
|
||||
resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4"
|
||||
integrity sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ=
|
||||
|
||||
lodash@^4.15.0, lodash@^4.17.11, lodash@^4.17.4, lodash@^4.3.0, lodash@^4.9.0:
|
||||
version "4.17.11"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"
|
||||
@ -2540,7 +2582,7 @@ lowercase-keys@^1.0.0:
|
||||
resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f"
|
||||
integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==
|
||||
|
||||
lru-cache@^4.0.1:
|
||||
lru-cache@^4.0.1, lru-cache@^4.1.3:
|
||||
version "4.1.5"
|
||||
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd"
|
||||
integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==
|
||||
@ -2746,6 +2788,37 @@ mute-stream@0.0.7:
|
||||
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab"
|
||||
integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=
|
||||
|
||||
mysql2@^1.6.5:
|
||||
version "1.6.5"
|
||||
resolved "https://registry.yarnpkg.com/mysql2/-/mysql2-1.6.5.tgz#6695304fa2ce793dda5c98e8bbec65cbd2e6cb9d"
|
||||
integrity sha512-zedaOOyb3msuuZcJJnxIX/EGOpmljDG7B+UevRH5lqcv+yhy9eCwkArBz8/AO+/rlY3/oCsOdG8R5oD6k0hNfg==
|
||||
dependencies:
|
||||
denque "^1.4.0"
|
||||
generate-function "^2.3.1"
|
||||
iconv-lite "^0.4.24"
|
||||
long "^4.0.0"
|
||||
lru-cache "^4.1.3"
|
||||
named-placeholders "^1.1.2"
|
||||
seq-queue "^0.0.5"
|
||||
sqlstring "^2.3.1"
|
||||
|
||||
mysql@^2.17.1:
|
||||
version "2.17.1"
|
||||
resolved "https://registry.yarnpkg.com/mysql/-/mysql-2.17.1.tgz#62bba4a039a9b2f73638cd1652ce50fc6f682899"
|
||||
integrity sha512-7vMqHQ673SAk5C8fOzTG2LpPcf3bNt0oL3sFpxPEEFp1mdlDcrLK0On7z8ZYKaaHrHwNcQ/MTUz7/oobZ2OyyA==
|
||||
dependencies:
|
||||
bignumber.js "7.2.1"
|
||||
readable-stream "2.3.6"
|
||||
safe-buffer "5.1.2"
|
||||
sqlstring "2.3.1"
|
||||
|
||||
named-placeholders@^1.1.2:
|
||||
version "1.1.2"
|
||||
resolved "https://registry.yarnpkg.com/named-placeholders/-/named-placeholders-1.1.2.tgz#ceb1fbff50b6b33492b5cf214ccf5e39cef3d0e8"
|
||||
integrity sha512-wiFWqxoLL3PGVReSZpjLVxyJ1bRqe+KKJVbr4hGs1KWfTZTQyezHFBbuKj9hsizHyGV2ne7EMjHdxEGAybD5SA==
|
||||
dependencies:
|
||||
lru-cache "^4.1.3"
|
||||
|
||||
nan@2.13.2, nan@^2.9.2:
|
||||
version "2.13.2"
|
||||
resolved "https://registry.yarnpkg.com/nan/-/nan-2.13.2.tgz#f51dc7ae66ba7d5d55e1e6d4d8092e802c9aefe7"
|
||||
@ -3268,6 +3341,11 @@ qs@6.5.2:
|
||||
resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36"
|
||||
integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==
|
||||
|
||||
querystringify@^2.1.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.1.1.tgz#60e5a5fd64a7f8bfa4d2ab2ed6fdf4c85bad154e"
|
||||
integrity sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==
|
||||
|
||||
quick-format-unescaped@^1.1.2:
|
||||
version "1.1.2"
|
||||
resolved "https://registry.yarnpkg.com/quick-format-unescaped/-/quick-format-unescaped-1.1.2.tgz#0ca581de3174becef25ac3c2e8956342381db698"
|
||||
@ -3314,7 +3392,7 @@ rc@^1.0.1, rc@^1.1.6, rc@^1.2.7:
|
||||
string_decoder "^1.1.1"
|
||||
util-deprecate "^1.0.1"
|
||||
|
||||
readable-stream@^2.0.0, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.2.2, readable-stream@^2.3.6, readable-stream@~2.3.6:
|
||||
readable-stream@2.3.6, readable-stream@^2.0.0, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.2.2, readable-stream@^2.3.6, readable-stream@~2.3.6:
|
||||
version "2.3.6"
|
||||
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf"
|
||||
integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==
|
||||
@ -3355,6 +3433,25 @@ readdirp@^2.2.1:
|
||||
micromatch "^3.1.10"
|
||||
readable-stream "^2.0.2"
|
||||
|
||||
redis-commands@^1.2.0:
|
||||
version "1.5.0"
|
||||
resolved "https://registry.yarnpkg.com/redis-commands/-/redis-commands-1.5.0.tgz#80d2e20698fe688f227127ff9e5164a7dd17e785"
|
||||
integrity sha512-6KxamqpZ468MeQC3bkWmCB1fp56XL64D4Kf0zJSwDZbVLLm7KFkoIcHrgRvQ+sk8dnhySs7+yBg94yIkAK7aJg==
|
||||
|
||||
redis-parser@^2.6.0:
|
||||
version "2.6.0"
|
||||
resolved "https://registry.yarnpkg.com/redis-parser/-/redis-parser-2.6.0.tgz#52ed09dacac108f1a631c07e9b69941e7a19504b"
|
||||
integrity sha1-Uu0J2srBCPGmMcB+m2mUHnoZUEs=
|
||||
|
||||
redis@^2.8.0:
|
||||
version "2.8.0"
|
||||
resolved "https://registry.yarnpkg.com/redis/-/redis-2.8.0.tgz#202288e3f58c49f6079d97af7a10e1303ae14b02"
|
||||
integrity sha512-M1OkonEQwtRmZv4tEWF2VgpG0JWJ8Fv1PhlgT5+B+uNq2cA3Rt1Yt/ryoR+vQNOQcIEgdCdfH0jr3bDpihAw1A==
|
||||
dependencies:
|
||||
double-ended-queue "^2.1.0-0"
|
||||
redis-commands "^1.2.0"
|
||||
redis-parser "^2.6.0"
|
||||
|
||||
referrer-policy@1.1.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/referrer-policy/-/referrer-policy-1.1.0.tgz#35774eb735bf50fb6c078e83334b472350207d79"
|
||||
@ -3411,6 +3508,11 @@ require-uncached@^1.0.3:
|
||||
caller-path "^0.1.0"
|
||||
resolve-from "^1.0.0"
|
||||
|
||||
requires-port@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff"
|
||||
integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=
|
||||
|
||||
resolve-from@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226"
|
||||
@ -3546,6 +3648,11 @@ send@0.16.2:
|
||||
range-parser "~1.2.0"
|
||||
statuses "~1.4.0"
|
||||
|
||||
seq-queue@^0.0.5:
|
||||
version "0.0.5"
|
||||
resolved "https://registry.yarnpkg.com/seq-queue/-/seq-queue-0.0.5.tgz#d56812e1c017a6e4e7c3e3a37a1da6d78dd3c93e"
|
||||
integrity sha1-1WgS4cAXpuTnw+Ojeh2m143TyT4=
|
||||
|
||||
sequelize-pool@^1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/sequelize-pool/-/sequelize-pool-1.0.2.tgz#89c767882bbdb8a41dac66922ed9820939a5401e"
|
||||
@ -3732,6 +3839,11 @@ sprintf-js@~1.0.2:
|
||||
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
|
||||
integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=
|
||||
|
||||
sqlstring@2.3.1, sqlstring@^2.3.1:
|
||||
version "2.3.1"
|
||||
resolved "https://registry.yarnpkg.com/sqlstring/-/sqlstring-2.3.1.tgz#475393ff9e91479aea62dcaf0ca3d14983a7fb40"
|
||||
integrity sha1-R1OT/56RR5rqYtyvDKPRSYOn+0A=
|
||||
|
||||
stack-trace@0.0.x:
|
||||
version "0.0.10"
|
||||
resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0"
|
||||
@ -3986,6 +4098,17 @@ tslib@1.9.3:
|
||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286"
|
||||
integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==
|
||||
|
||||
tus-js-client@^1.5.1:
|
||||
version "1.7.1"
|
||||
resolved "https://registry.yarnpkg.com/tus-js-client/-/tus-js-client-1.7.1.tgz#1485176052f9a360a957f475edf8e5076e339881"
|
||||
integrity sha512-38NMOvjZm/HQTdmwLctXqctsUUsiuZsdUGBew6xn3/s1D7ofzjW/VBRAp+uAWrzN0ziAmo2WuiZ9FMP9UeU0UQ==
|
||||
dependencies:
|
||||
buffer-from "^0.1.1"
|
||||
extend "^3.0.0"
|
||||
js-base64 "^2.4.9"
|
||||
lodash.throttle "^4.1.1"
|
||||
url-parse "^1.4.3"
|
||||
|
||||
type-check@~0.3.2:
|
||||
version "0.3.2"
|
||||
resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72"
|
||||
@ -4086,6 +4209,14 @@ url-parse-lax@^1.0.0:
|
||||
dependencies:
|
||||
prepend-http "^1.0.1"
|
||||
|
||||
url-parse@^1.4.3:
|
||||
version "1.4.7"
|
||||
resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.4.7.tgz#a8a83535e8c00a316e403a5db4ac1b9b853ae278"
|
||||
integrity sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg==
|
||||
dependencies:
|
||||
querystringify "^2.1.1"
|
||||
requires-port "^1.0.0"
|
||||
|
||||
use@^3.1.0:
|
||||
version "3.1.1"
|
||||
resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f"
|
||||
@ -4123,6 +4254,13 @@ vary@^1, vary@~1.1.2:
|
||||
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"
|
||||
integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=
|
||||
|
||||
vimeo@^2.1.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/vimeo/-/vimeo-2.1.1.tgz#3cfcb75e7cbe5bcce578f832760aed55c7cc3903"
|
||||
integrity sha512-6aBlIOdnCgGSigkH54DHsb1n+mW0NIAgxmh+AVEC5hwjfy6zaUtkSIrlMJbYSOwwEfkjpIBR7L8gfWDRmLaEmw==
|
||||
dependencies:
|
||||
tus-js-client "^1.5.1"
|
||||
|
||||
vm@^0.1.0:
|
||||
version "0.1.0"
|
||||
resolved "https://registry.yarnpkg.com/vm/-/vm-0.1.0.tgz#0060d485e8b89858946c40b01a6ba07945db70a8"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user