futbol-in-core 1.0.7 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants/Logros/LogrosDisponibles.d.ts +1 -1
- package/dist/helpers/encodeCiudad.d.ts +2 -0
- package/dist/helpers/encodeCiudad.js +10 -0
- package/dist/helpers/esGod.d.ts +2 -0
- package/dist/helpers/esGod.js +4 -0
- package/dist/helpers/esOperador.d.ts +3 -0
- package/dist/helpers/esOperador.js +7 -0
- package/dist/helpers/esUsuarioVerificado.d.ts +2 -0
- package/dist/helpers/esUsuarioVerificado.js +4 -0
- package/dist/helpers/index.d.ts +5 -0
- package/dist/helpers/index.js +5 -0
- package/dist/helpers/puedeCrearTorneos.d.ts +2 -0
- package/dist/helpers/puedeCrearTorneos.js +4 -0
- package/dist/types/Competicion/CompeticionBaseDTO.d.ts +20 -0
- package/dist/types/Competicion/CompeticionBaseDTO.js +1 -0
- package/dist/types/Competicion/ConfigEnfrentamiento.d.ts +12 -0
- package/dist/types/Competicion/ConfigEnfrentamiento.js +1 -0
- package/dist/types/Competicion/LigaDTO.d.ts +7 -0
- package/dist/types/Competicion/LigaDTO.js +1 -0
- package/dist/types/Competicion/TorneoDTO.d.ts +6 -0
- package/dist/types/Competicion/TorneoDTO.js +1 -0
- package/dist/types/Competicion/index.d.ts +4 -0
- package/dist/types/Competicion/index.js +4 -0
- package/dist/types/Equipo/EquipoCompeticionDTO.d.ts +5 -0
- package/dist/types/Equipo/EquipoCompeticionDTO.js +1 -0
- package/dist/types/Equipo/EquipoDTO.d.ts +15 -0
- package/dist/types/Equipo/EquipoDTO.js +1 -0
- package/dist/types/Equipo/IEquipoCompeticion.d.ts +6 -0
- package/dist/types/Equipo/IEquipoCompeticion.js +1 -0
- package/dist/types/Equipo/index.d.ts +3 -0
- package/dist/types/Equipo/index.js +3 -0
- package/dist/types/Error/Error.d.ts +22 -0
- package/dist/types/Error/Error.js +1 -0
- package/dist/types/Logros/Logro.d.ts +8 -0
- package/dist/types/Logros/Logro.js +1 -0
- package/dist/types/MapItem/IMapItem.d.ts +11 -0
- package/dist/types/MapItem/IMapItem.js +1 -0
- package/dist/types/Notificaciones/INotificaciones.d.ts +4 -0
- package/dist/types/Notificaciones/INotificaciones.js +1 -0
- package/dist/types/Notificaciones/intex.d.ts +1 -0
- package/dist/types/Notificaciones/intex.js +1 -0
- package/dist/types/Request/TypedRequest.d.ts +3 -0
- package/dist/types/Request/TypedRequest.js +1 -0
- package/dist/types/Spot/Coords.d.ts +4 -0
- package/dist/types/Spot/Coords.js +1 -0
- package/dist/types/User/UserDTO.d.ts +26 -0
- package/dist/types/User/UserDTO.js +1 -0
- package/dist/types/User/index.d.ts +1 -0
- package/dist/types/User/index.js +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.js +7 -0
- package/package.json +14 -6
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// recibe Salamanca, Salamanca devuelve Salamanca_Salamanca
|
|
2
|
+
export const encodeCiudad = (ciudad) => {
|
|
3
|
+
const municipio = ciudad.split(",")[0].trim();
|
|
4
|
+
const provincia = ciudad.split(",")[1].trim();
|
|
5
|
+
return encodeURIComponent(`${municipio}_${provincia}`);
|
|
6
|
+
};
|
|
7
|
+
// recibe Salamanca_Salamanca devuelve Salamanca, Salamanca
|
|
8
|
+
export const decodeCiudad = (ciudad) => {
|
|
9
|
+
return decodeURIComponent(ciudad).split('_').join(', ');
|
|
10
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { EstadoCompeticion, TipoCompeticion } from "futbol-in-core/enum";
|
|
2
|
+
import { ModalidadJuego } from "futbol-in-core/enum";
|
|
3
|
+
import { TipoInscripcion } from "futbol-in-core/enum";
|
|
4
|
+
import { TipoFutbolin } from "futbol-in-core/enum";
|
|
5
|
+
import { EquipoCompeticionDTO } from "../Equipo/EquipoCompeticionDTO";
|
|
6
|
+
export interface CompeticionBaseDTO {
|
|
7
|
+
id: string;
|
|
8
|
+
nombre: string;
|
|
9
|
+
descripcion: string;
|
|
10
|
+
ciudad: string;
|
|
11
|
+
googlePlaceId: string;
|
|
12
|
+
tipoCompeticion: TipoCompeticion;
|
|
13
|
+
tipoDeFutbolin: TipoFutbolin;
|
|
14
|
+
modalidadDeJuego: ModalidadJuego;
|
|
15
|
+
tipoInscripcion: TipoInscripcion;
|
|
16
|
+
estadoCompeticion: EstadoCompeticion;
|
|
17
|
+
equipos: Array<EquipoCompeticionDTO>;
|
|
18
|
+
cantidadParejas: number;
|
|
19
|
+
createdByUserId?: string;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface ConfigEnfrentamientoDTO {
|
|
2
|
+
cantidadPartidos: number;
|
|
3
|
+
golesParaGanar: number;
|
|
4
|
+
}
|
|
5
|
+
export interface IConfigEnfrentamiento {
|
|
6
|
+
cantidadPartidos: number;
|
|
7
|
+
golesParaGanar: number;
|
|
8
|
+
}
|
|
9
|
+
export interface IConfigEnfrentamientos extends IConfigEnfrentamiento {
|
|
10
|
+
excepcionSemiFinales: null | IConfigEnfrentamiento;
|
|
11
|
+
excepcionFinal: null | IConfigEnfrentamiento;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CompeticionBaseDTO } from "./CompeticionBaseDTO";
|
|
2
|
+
import { IConfigEnfrentamiento } from "./ConfigEnfrentamiento";
|
|
3
|
+
export interface LigaDTO extends CompeticionBaseDTO {
|
|
4
|
+
configEnfrentamiento: IConfigEnfrentamiento;
|
|
5
|
+
enfrentamientos: string[];
|
|
6
|
+
idaYVuelta: boolean;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { EstadoEquipoCompeticion, EstadoJugador } from "../../enum";
|
|
2
|
+
export interface EquipoDTO {
|
|
3
|
+
id: string;
|
|
4
|
+
nombreEquipo: string;
|
|
5
|
+
imagenEquipo: string;
|
|
6
|
+
jugadores: Array<{
|
|
7
|
+
usuario: string | null;
|
|
8
|
+
nombre: string;
|
|
9
|
+
estado: EstadoJugador;
|
|
10
|
+
}>;
|
|
11
|
+
createdByUserId: string;
|
|
12
|
+
}
|
|
13
|
+
export type EquipoConEstadoDTO = EquipoDTO & {
|
|
14
|
+
estado: EstadoEquipoCompeticion;
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cuando es un error de validación:
|
|
3
|
+
*/
|
|
4
|
+
export interface ValidationErrorData {
|
|
5
|
+
type: "VALIDATION_ERROR";
|
|
6
|
+
errors: {
|
|
7
|
+
path?: Array<string | number>;
|
|
8
|
+
message: string;
|
|
9
|
+
}[];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Cuando es un error genérico/servidor:
|
|
13
|
+
*/
|
|
14
|
+
export interface ServerErrorData {
|
|
15
|
+
type: "SERVER_ERROR";
|
|
16
|
+
error: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Unión que engloba todas las posibilidades de error
|
|
20
|
+
* que pueden llegar desde el servidor:
|
|
21
|
+
*/
|
|
22
|
+
export type ErrorData = ValidationErrorData | ServerErrorData;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TipoFutbolin, TipoLugar } from "futbol-in-core/enum";
|
|
2
|
+
export interface IMapItem {
|
|
3
|
+
nombre: string;
|
|
4
|
+
direccion: string;
|
|
5
|
+
lat: number;
|
|
6
|
+
lng: number;
|
|
7
|
+
googlePlaceId: string;
|
|
8
|
+
tipoLugar: TipoLugar;
|
|
9
|
+
tipoFutbolin: TipoFutbolin;
|
|
10
|
+
comentarios: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './INotificaciones';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './INotificaciones';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Posicion } from "../../enum/User/Posicion";
|
|
2
|
+
import { AuthProvider } from "../../enum/User/AuthProvider";
|
|
3
|
+
import { UserRole } from "../../enum/User/Role";
|
|
4
|
+
import { UserStatus } from "../../enum/User/Status";
|
|
5
|
+
export interface UserDTO {
|
|
6
|
+
id: string;
|
|
7
|
+
idOperador: string | null;
|
|
8
|
+
name: string;
|
|
9
|
+
email: string;
|
|
10
|
+
imagen: string;
|
|
11
|
+
status: UserStatus;
|
|
12
|
+
role: UserRole[];
|
|
13
|
+
provider: AuthProvider;
|
|
14
|
+
createdAt?: Date;
|
|
15
|
+
stats: {
|
|
16
|
+
lugaresAgregados: number;
|
|
17
|
+
lugaresRevisados: number;
|
|
18
|
+
lugaresVerificados: number;
|
|
19
|
+
};
|
|
20
|
+
equipos: string[];
|
|
21
|
+
nombre: string | undefined | null;
|
|
22
|
+
telefono: string | undefined | null;
|
|
23
|
+
posicion: Posicion | undefined | null;
|
|
24
|
+
ciudad: string | undefined | null;
|
|
25
|
+
ciudadActual: string | undefined | null;
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './UserDTO';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './UserDTO';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "futbol-in-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"import": "./dist/index.js",
|
|
18
18
|
"types": "./dist/index.d.ts"
|
|
19
19
|
},
|
|
20
|
-
"./
|
|
21
|
-
"import": "./dist/
|
|
22
|
-
"types": "./dist/
|
|
20
|
+
"./types": {
|
|
21
|
+
"import": "./dist/types/index.js",
|
|
22
|
+
"types": "./dist/types/index.d.ts"
|
|
23
23
|
},
|
|
24
24
|
"./enum": {
|
|
25
25
|
"import": "./dist/enum/index.js",
|
|
@@ -28,18 +28,25 @@
|
|
|
28
28
|
"./constants": {
|
|
29
29
|
"import": "./dist/constants/index.js",
|
|
30
30
|
"types": "./dist/constants/index.d.ts"
|
|
31
|
+
},
|
|
32
|
+
"./helpers": {
|
|
33
|
+
"import": "./dist/helpers/index.js",
|
|
34
|
+
"types": "./dist/helpers/index.d.ts"
|
|
31
35
|
}
|
|
32
36
|
},
|
|
33
37
|
"typesVersions": {
|
|
34
38
|
"*": {
|
|
35
|
-
"
|
|
36
|
-
"dist/
|
|
39
|
+
"types": [
|
|
40
|
+
"dist/types/*"
|
|
37
41
|
],
|
|
38
42
|
"enum": [
|
|
39
43
|
"dist/enum/*"
|
|
40
44
|
],
|
|
41
45
|
"constants": [
|
|
42
46
|
"dist/constants/*"
|
|
47
|
+
],
|
|
48
|
+
"helpers": [
|
|
49
|
+
"dist/helpers/*"
|
|
43
50
|
]
|
|
44
51
|
}
|
|
45
52
|
},
|
|
@@ -52,6 +59,7 @@
|
|
|
52
59
|
"author": "",
|
|
53
60
|
"license": "ISC",
|
|
54
61
|
"devDependencies": {
|
|
62
|
+
"mongoose": "^8.16.3",
|
|
55
63
|
"typescript": "^5.8.3"
|
|
56
64
|
}
|
|
57
65
|
}
|