pokemon-io-core 0.0.1

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.
Files changed (81) hide show
  1. package/dist/api/battle.d.ts +14 -0
  2. package/dist/api/battle.js +2 -0
  3. package/dist/api/room.d.ts +21 -0
  4. package/dist/api/room.js +2 -0
  5. package/dist/core/actions.d.ts +21 -0
  6. package/dist/core/actions.js +1 -0
  7. package/dist/core/amulets.d.ts +18 -0
  8. package/dist/core/amulets.js +1 -0
  9. package/dist/core/battleState.d.ts +37 -0
  10. package/dist/core/battleState.js +1 -0
  11. package/dist/core/engine.d.ts +45 -0
  12. package/dist/core/engine.js +481 -0
  13. package/dist/core/events.d.ts +67 -0
  14. package/dist/core/events.js +1 -0
  15. package/dist/core/fighters.d.ts +11 -0
  16. package/dist/core/fighters.js +1 -0
  17. package/dist/core/ids.d.ts +6 -0
  18. package/dist/core/ids.js +1 -0
  19. package/dist/core/index.d.ts +10 -0
  20. package/dist/core/index.js +10 -0
  21. package/dist/core/items.d.ts +10 -0
  22. package/dist/core/items.js +1 -0
  23. package/dist/core/moves.d.ts +58 -0
  24. package/dist/core/moves.js +1 -0
  25. package/dist/core/status.d.ts +11 -0
  26. package/dist/core/status.js +1 -0
  27. package/dist/core/types.d.ts +14 -0
  28. package/dist/core/types.js +1 -0
  29. package/dist/engine/pokemonBattleService.d.ts +6 -0
  30. package/dist/engine/pokemonBattleService.js +32 -0
  31. package/dist/modules/auth/auth.schemas.d.ts +24 -0
  32. package/dist/modules/auth/auth.schemas.js +26 -0
  33. package/dist/modules/auth/index.d.ts +1 -0
  34. package/dist/modules/auth/index.js +1 -0
  35. package/dist/modules/enfrentamiento/enfrentamiento.enum.d.ts +13 -0
  36. package/dist/modules/enfrentamiento/enfrentamiento.enum.js +15 -0
  37. package/dist/modules/enfrentamiento/enfrentamiento.schemas.d.ts +22 -0
  38. package/dist/modules/enfrentamiento/enfrentamiento.schemas.js +17 -0
  39. package/dist/modules/enfrentamiento/enfrentamiento.types.d.ts +19 -0
  40. package/dist/modules/enfrentamiento/enfrentamiento.types.js +1 -0
  41. package/dist/modules/enfrentamiento/index.d.ts +3 -0
  42. package/dist/modules/enfrentamiento/index.js +3 -0
  43. package/dist/modules/equipos/equipos.enum.d.ts +5 -0
  44. package/dist/modules/equipos/equipos.enum.js +6 -0
  45. package/dist/modules/equipos/equipos.schemas.d.ts +20 -0
  46. package/dist/modules/equipos/equipos.schemas.js +20 -0
  47. package/dist/modules/equipos/equipos.types.d.ts +14 -0
  48. package/dist/modules/equipos/equipos.types.js +1 -0
  49. package/dist/modules/equipos/index.d.ts +3 -0
  50. package/dist/modules/equipos/index.js +3 -0
  51. package/dist/modules/liga/index.d.ts +3 -0
  52. package/dist/modules/liga/index.js +3 -0
  53. package/dist/modules/liga/liga.enum.d.ts +14 -0
  54. package/dist/modules/liga/liga.enum.js +17 -0
  55. package/dist/modules/liga/liga.schemas.d.ts +59 -0
  56. package/dist/modules/liga/liga.schemas.js +41 -0
  57. package/dist/modules/liga/liga.types.d.ts +25 -0
  58. package/dist/modules/liga/liga.types.js +1 -0
  59. package/dist/modules/user/index.d.ts +2 -0
  60. package/dist/modules/user/index.js +2 -0
  61. package/dist/modules/user/user.schemas.d.ts +15 -0
  62. package/dist/modules/user/user.schemas.js +15 -0
  63. package/dist/modules/user/user.types.d.ts +16 -0
  64. package/dist/modules/user/user.types.js +1 -0
  65. package/dist/shared/enums.d.ts +0 -0
  66. package/dist/shared/enums.js +1 -0
  67. package/dist/skins/CombatSkin.d.ts +17 -0
  68. package/dist/skins/CombatSkin.js +1 -0
  69. package/dist/skins/pokemon/fighters.d.ts +2 -0
  70. package/dist/skins/pokemon/fighters.js +37 -0
  71. package/dist/skins/pokemon/index.d.ts +3 -0
  72. package/dist/skins/pokemon/index.js +3 -0
  73. package/dist/skins/pokemon/moves.d.ts +2 -0
  74. package/dist/skins/pokemon/moves.js +83 -0
  75. package/dist/skins/pokemon/pokemonSkin.d.ts +13 -0
  76. package/dist/skins/pokemon/pokemonSkin.js +56 -0
  77. package/dist/skins/pokemon/types.d.ts +12 -0
  78. package/dist/skins/pokemon/types.js +78 -0
  79. package/dist/utils/logger.d.ts +9 -0
  80. package/dist/utils/logger.js +15 -0
  81. package/package.json +55 -0
@@ -0,0 +1,67 @@
1
+ import type { FighterId, MoveId, ItemId, StatusId } from "./ids";
2
+ export type BattleEventKind = "turn_start" | "action_declared" | "action_skipped_hard_cc" | "move_miss" | "move_hit" | "item_used" | "damage" | "heal" | "shield_applied" | "status_applied" | "status_refreshed" | "status_expired" | "fighter_fainted" | "turn_end" | "battle_end";
3
+ export interface BaseBattleEvent {
4
+ id: string;
5
+ turnNumber: number;
6
+ kind: BattleEventKind;
7
+ message: string;
8
+ timestamp: number;
9
+ }
10
+ export interface ActionDeclaredEvent extends BaseBattleEvent {
11
+ kind: "action_declared";
12
+ actorId: FighterId;
13
+ }
14
+ export interface MoveMissEvent extends BaseBattleEvent {
15
+ kind: "move_miss";
16
+ actorId: FighterId;
17
+ moveId: MoveId;
18
+ targetId: FighterId;
19
+ }
20
+ export interface MoveHitEvent extends BaseBattleEvent {
21
+ kind: "move_hit";
22
+ actorId: FighterId;
23
+ moveId: MoveId;
24
+ targetId: FighterId;
25
+ isCritical: boolean;
26
+ effectiveness: number;
27
+ }
28
+ export interface ItemUsedEvent extends BaseBattleEvent {
29
+ kind: "item_used";
30
+ actorId: FighterId;
31
+ itemId: ItemId;
32
+ targetId: FighterId;
33
+ }
34
+ export interface DamageEvent extends BaseBattleEvent {
35
+ kind: "damage";
36
+ actorId: FighterId;
37
+ targetId: FighterId;
38
+ amount: number;
39
+ isCritical: boolean;
40
+ }
41
+ export interface HealEvent extends BaseBattleEvent {
42
+ kind: "heal";
43
+ actorId: FighterId;
44
+ targetId: FighterId;
45
+ amount: number;
46
+ }
47
+ export interface StatusAppliedEvent extends BaseBattleEvent {
48
+ kind: "status_applied";
49
+ targetId: FighterId;
50
+ statusId: StatusId;
51
+ stacks: 1 | 2;
52
+ durationTurns: number;
53
+ }
54
+ export interface StatusExpiredEvent extends BaseBattleEvent {
55
+ kind: "status_expired";
56
+ targetId: FighterId;
57
+ statusId: StatusId;
58
+ }
59
+ export interface FighterFaintedEvent extends BaseBattleEvent {
60
+ kind: "fighter_fainted";
61
+ fighterId: FighterId;
62
+ }
63
+ export interface BattleEndEvent extends BaseBattleEvent {
64
+ kind: "battle_end";
65
+ winner: "player1" | "player2" | "draw";
66
+ }
67
+ export type BattleEvent = ActionDeclaredEvent | MoveMissEvent | MoveHitEvent | ItemUsedEvent | DamageEvent | HealEvent | StatusAppliedEvent | StatusExpiredEvent | FighterFaintedEvent | BattleEndEvent | BaseBattleEvent;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ import type { FighterId, TypeId, MoveId, ItemId, AmuletId } from "./ids";
2
+ import type { FighterStats } from "./types";
3
+ export interface FighterDefinition {
4
+ id: FighterId;
5
+ name: string;
6
+ classId: TypeId;
7
+ baseStats: FighterStats;
8
+ recommendedMoves?: MoveId[];
9
+ recommendedItems?: ItemId[];
10
+ recommendedAmuletId?: AmuletId;
11
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ export type TypeId = string;
2
+ export type FighterId = string;
3
+ export type MoveId = string;
4
+ export type ItemId = string;
5
+ export type AmuletId = string;
6
+ export type StatusId = string;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ export * from "./ids";
2
+ export * from "./types";
3
+ export * from "./fighters";
4
+ export * from "./moves";
5
+ export * from "./items";
6
+ export * from "./amulets";
7
+ export * from "./status";
8
+ export * from "./battleState";
9
+ export * from "./actions";
10
+ export * from "./events";
@@ -0,0 +1,10 @@
1
+ export * from "./ids";
2
+ export * from "./types";
3
+ export * from "./fighters";
4
+ export * from "./moves";
5
+ export * from "./items";
6
+ export * from "./amulets";
7
+ export * from "./status";
8
+ export * from "./battleState";
9
+ export * from "./actions";
10
+ export * from "./events";
@@ -0,0 +1,10 @@
1
+ import type { ItemId } from "./ids";
2
+ import type { EffectDefinition } from "./moves";
3
+ export type ItemCategory = "damage" | "heal_shield" | "status_buff";
4
+ export interface ItemDefinition {
5
+ id: ItemId;
6
+ name: string;
7
+ category: ItemCategory;
8
+ maxUses: number;
9
+ effects: EffectDefinition[];
10
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,58 @@
1
+ import type { MoveId, TypeId, StatusId } from "./ids";
2
+ export type MoveKind = "damage" | "heal" | "status" | "hybrid";
3
+ export type TargetKind = "self" | "enemy";
4
+ export type EffectKind = "damage" | "heal" | "shield" | "modify_stats" | "apply_status" | "modify_hit_chance" | "modify_crit_chance" | "modify_priority" | "modify_effective_speed";
5
+ export interface DamageEffect {
6
+ kind: "damage";
7
+ powerMultiplier?: number;
8
+ flatBonus?: number;
9
+ }
10
+ export interface HealEffect {
11
+ kind: "heal";
12
+ amount: number;
13
+ }
14
+ export interface ShieldEffect {
15
+ kind: "shield";
16
+ amount: number;
17
+ durationTurns: number;
18
+ }
19
+ export interface ModifyStatsEffect {
20
+ kind: "modify_stats";
21
+ offenseDelta?: number;
22
+ defenseDelta?: number;
23
+ speedDelta?: number;
24
+ critDelta?: number;
25
+ }
26
+ export interface ApplyStatusEffect {
27
+ kind: "apply_status";
28
+ statusId: StatusId;
29
+ }
30
+ export interface ModifyHitChanceEffect {
31
+ kind: "modify_hit_chance";
32
+ delta: number;
33
+ }
34
+ export interface ModifyCritChanceEffect {
35
+ kind: "modify_crit_chance";
36
+ delta: number;
37
+ }
38
+ export interface ModifyPriorityEffect {
39
+ kind: "modify_priority";
40
+ delta: number;
41
+ }
42
+ export interface ModifyEffectiveSpeedEffect {
43
+ kind: "modify_effective_speed";
44
+ multiplier: number;
45
+ }
46
+ export type EffectDefinition = DamageEffect | HealEffect | ShieldEffect | ModifyStatsEffect | ApplyStatusEffect | ModifyHitChanceEffect | ModifyCritChanceEffect | ModifyPriorityEffect | ModifyEffectiveSpeedEffect;
47
+ export interface MoveDefinition {
48
+ id: MoveId;
49
+ name: string;
50
+ typeId: TypeId;
51
+ kind: MoveKind;
52
+ basePower?: number;
53
+ accuracy?: number;
54
+ maxPP: number;
55
+ priority?: number;
56
+ target: TargetKind;
57
+ effects: EffectDefinition[];
58
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ import type { StatusId } from "./ids";
2
+ import type { EffectDefinition } from "./moves";
3
+ export type StatusKind = "hard_cc" | "soft";
4
+ export interface StatusDefinition {
5
+ id: StatusId;
6
+ name: string;
7
+ kind: StatusKind;
8
+ minDurationTurns: number;
9
+ maxDurationTurns: number;
10
+ effectsPerStack: EffectDefinition[];
11
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,14 @@
1
+ import type { TypeId } from "./ids";
2
+ export type Effectiveness = 0 | 0.5 | 1 | 2;
3
+ export interface TypeDefinition {
4
+ id: TypeId;
5
+ displayName: string;
6
+ color?: string;
7
+ }
8
+ export type TypeEffectivenessMatrix = Record<TypeId, Record<TypeId, Effectiveness>>;
9
+ export interface FighterStats {
10
+ offense: number;
11
+ defense: number;
12
+ speed: number;
13
+ crit: number;
14
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import { BattleActions, BattleState } from "../core";
2
+ export declare const createPokemonBattle: (fighter1Id: string, fighter2Id: string) => BattleState;
3
+ export declare const runPokemonTurn: (state: BattleState, actions: BattleActions) => {
4
+ newState: BattleState;
5
+ events: import("../core").BattleEvent[];
6
+ };
@@ -0,0 +1,32 @@
1
+ import { POKEMON_FIGHTERS, POKEMON_MOVES, POKEMON_TYPE_MATRIX, POKEMON_TYPES } from "../skins/pokemon";
2
+ import { createInitialBattleState, resolveTurn } from "../core/engine";
3
+ const findPokemon = (id) => POKEMON_FIGHTERS.find((p) => p.id === id);
4
+ const findMove = (id) => POKEMON_MOVES.find((m) => m.id === id);
5
+ export const createPokemonBattle = (fighter1Id, fighter2Id) => {
6
+ const f1 = findPokemon(fighter1Id);
7
+ const f2 = findPokemon(fighter2Id);
8
+ const config = {
9
+ types: POKEMON_TYPES,
10
+ typeEffectiveness: POKEMON_TYPE_MATRIX,
11
+ moves: POKEMON_MOVES,
12
+ items: [], // MVP: sin items
13
+ amulets: [],
14
+ statuses: [],
15
+ player1: {
16
+ fighter: f1,
17
+ maxHp: 100,
18
+ moves: POKEMON_MOVES.filter((m) => (f1.recommendedMoves ?? []).includes(m.id)),
19
+ items: [],
20
+ amulet: null
21
+ },
22
+ player2: {
23
+ fighter: f2,
24
+ maxHp: 100,
25
+ moves: POKEMON_MOVES.filter((m) => (f2.recommendedMoves ?? []).includes(m.id)),
26
+ items: [],
27
+ amulet: null
28
+ }
29
+ };
30
+ return createInitialBattleState(config);
31
+ };
32
+ export const runPokemonTurn = (state, actions) => resolveTurn(state, actions);
@@ -0,0 +1,24 @@
1
+ import { z } from "zod";
2
+ export declare const RegisterSchema: z.ZodObject<{
3
+ email: z.ZodEmail;
4
+ nombre: z.ZodOptional<z.ZodString>;
5
+ username: z.ZodString;
6
+ password: z.ZodString;
7
+ confirmPassword: z.ZodString;
8
+ movil: z.ZodString;
9
+ }, z.core.$strip>;
10
+ export type RegisterBody = z.infer<typeof RegisterSchema>;
11
+ export declare const VerifyEmailSchema: z.ZodObject<{
12
+ email: z.ZodEmail;
13
+ code: z.ZodString;
14
+ }, z.core.$strip>;
15
+ export type VerifyEmailBody = z.infer<typeof VerifyEmailSchema>;
16
+ export declare const ResendCodeSchema: z.ZodObject<{
17
+ email: z.ZodEmail;
18
+ }, z.core.$strip>;
19
+ export type ResendCodeBody = z.infer<typeof ResendCodeSchema>;
20
+ export declare const LoginSchema: z.ZodObject<{
21
+ email: z.ZodEmail;
22
+ password: z.ZodString;
23
+ }, z.core.$strip>;
24
+ export type LoginBody = z.infer<typeof LoginSchema>;
@@ -0,0 +1,26 @@
1
+ import { z } from "zod";
2
+ export const RegisterSchema = z.object({
3
+ email: z.email("Introduce un correo válido"),
4
+ nombre: z.string().optional(),
5
+ username: z
6
+ .string("Introduce un nombre de usuario")
7
+ .min(3, "El nombre de usuario debe tener al menos 3 caracteres"),
8
+ password: z
9
+ .string("Introduce una contraseña")
10
+ .min(6, "La contraseña debe tener al menos 6 caracteres"),
11
+ confirmPassword: z
12
+ .string()
13
+ .min(6, "La contraseña debe tener al menos 6 caracteres"),
14
+ movil: z.string().min(1, "Introduce un número de móvil"),
15
+ });
16
+ export const VerifyEmailSchema = z.object({
17
+ email: z.email(),
18
+ code: z.string().length(6, "El código debe tener 6 dígitos"),
19
+ });
20
+ export const ResendCodeSchema = z.object({
21
+ email: z.email(),
22
+ });
23
+ export const LoginSchema = z.object({
24
+ email: z.email('Introduce un correo válido'),
25
+ password: z.string().min(6, 'La contraseña debe tener al menos 6 caracteres'),
26
+ });
@@ -0,0 +1 @@
1
+ export * from './auth.schemas.js';
@@ -0,0 +1 @@
1
+ export * from './auth.schemas.js';
@@ -0,0 +1,13 @@
1
+ export declare enum EstadoEnfrentamiento {
2
+ SinJugar = "SIN_JUGAR",
3
+ CorroborarResultado = "CORROBORAR_RESULTADO",
4
+ ConfirmarResultado = "CONFIRMAR_RESULTADO",
5
+ Jugado = "JUGADO"
6
+ }
7
+ export declare enum EstadoEnfrentamientoConOpcionCualquiera {
8
+ SinJugar = "SIN_JUGAR",
9
+ CorroborarResultado = "CORROBORAR_RESULTADO",
10
+ ConfirmarResultado = "CONFIRMAR_RESULTADO",
11
+ Jugado = "JUGADO",
12
+ Cualquiera = "CUALQUIERA"
13
+ }
@@ -0,0 +1,15 @@
1
+ export var EstadoEnfrentamiento;
2
+ (function (EstadoEnfrentamiento) {
3
+ EstadoEnfrentamiento["SinJugar"] = "SIN_JUGAR";
4
+ EstadoEnfrentamiento["CorroborarResultado"] = "CORROBORAR_RESULTADO";
5
+ EstadoEnfrentamiento["ConfirmarResultado"] = "CONFIRMAR_RESULTADO";
6
+ EstadoEnfrentamiento["Jugado"] = "JUGADO";
7
+ })(EstadoEnfrentamiento || (EstadoEnfrentamiento = {}));
8
+ export var EstadoEnfrentamientoConOpcionCualquiera;
9
+ (function (EstadoEnfrentamientoConOpcionCualquiera) {
10
+ EstadoEnfrentamientoConOpcionCualquiera["SinJugar"] = "SIN_JUGAR";
11
+ EstadoEnfrentamientoConOpcionCualquiera["CorroborarResultado"] = "CORROBORAR_RESULTADO";
12
+ EstadoEnfrentamientoConOpcionCualquiera["ConfirmarResultado"] = "CONFIRMAR_RESULTADO";
13
+ EstadoEnfrentamientoConOpcionCualquiera["Jugado"] = "JUGADO";
14
+ EstadoEnfrentamientoConOpcionCualquiera["Cualquiera"] = "CUALQUIERA";
15
+ })(EstadoEnfrentamientoConOpcionCualquiera || (EstadoEnfrentamientoConOpcionCualquiera = {}));
@@ -0,0 +1,22 @@
1
+ import z from "zod";
2
+ export declare const EnfrentamientoIdParamSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ }, z.core.$strip>;
5
+ export type EnfrentamientoIDParam = z.infer<typeof EnfrentamientoIdParamSchema>;
6
+ export declare const ProponerResultadoSchema: z.ZodObject<{
7
+ equipoId: z.ZodString;
8
+ partidos: z.ZodArray<z.ZodObject<{
9
+ golesA: z.ZodNumber;
10
+ golesB: z.ZodNumber;
11
+ }, z.core.$strip>>;
12
+ }, z.core.$strip>;
13
+ export type ProponerResultadoBody = z.infer<typeof ProponerResultadoSchema>;
14
+ export declare const AceptarRechazarResultadoSchema: z.ZodObject<{
15
+ enfrentamientoId: z.ZodString;
16
+ equipoId: z.ZodString;
17
+ }, z.core.$strip>;
18
+ export type AceptarRechazarResultadoBody = z.infer<typeof AceptarRechazarResultadoSchema>;
19
+ export declare const GetEnfrentamientosLigaParamsSchema: z.ZodObject<{
20
+ ligaId: z.ZodString;
21
+ }, z.core.$strip>;
22
+ export type GetLigaParam = z.infer<typeof GetEnfrentamientosLigaParamsSchema>;
@@ -0,0 +1,17 @@
1
+ import z from "zod";
2
+ export const EnfrentamientoIdParamSchema = z.object({
3
+ id: z.string().min(1, "El ID del enfrentamiento es requerido"),
4
+ });
5
+ const PartidoSchema = z.object({
6
+ golesA: z.number().int().min(0),
7
+ golesB: z.number().int().min(0),
8
+ });
9
+ export const ProponerResultadoSchema = z.object({
10
+ equipoId: z.string().min(1, "El ID del equipo es requerido"),
11
+ partidos: z.array(PartidoSchema).min(1, "Debe haber al menos un partido"),
12
+ });
13
+ export const AceptarRechazarResultadoSchema = z.object({
14
+ enfrentamientoId: z.string(),
15
+ equipoId: z.string(),
16
+ });
17
+ export const GetEnfrentamientosLigaParamsSchema = z.object({ ligaId: z.string('no hay id maricon') });
@@ -0,0 +1,19 @@
1
+ import { EquipoDTO } from "../equipos";
2
+ import { EstadoEnfrentamiento } from "./enfrentamiento.enum.js";
3
+ export interface EnfrentamientoDTO {
4
+ id: string;
5
+ idLiga: string;
6
+ equipoA: EquipoDTO;
7
+ equipoB: EquipoDTO;
8
+ estado: EstadoEnfrentamiento;
9
+ fecha: Date | null;
10
+ ubicacion: string;
11
+ partidos: PartidoDTO[];
12
+ resultadoPropuestoPor: string | null;
13
+ resultadoAceptadoPor: string | null;
14
+ resultadoRechazadoPor: string | null;
15
+ }
16
+ export interface PartidoDTO {
17
+ golesA: number;
18
+ golesB: number;
19
+ }
@@ -0,0 +1,3 @@
1
+ export * from './enfrentamiento.types.js';
2
+ export * from './enfrentamiento.schemas.js';
3
+ export * from './enfrentamiento.enum.js';
@@ -0,0 +1,3 @@
1
+ export * from './enfrentamiento.types.js';
2
+ export * from './enfrentamiento.schemas.js';
3
+ export * from './enfrentamiento.enum.js';
@@ -0,0 +1,5 @@
1
+ export declare enum EstadoJugadorEnEquipo {
2
+ RECHAZADO = "RECHAZADO",
3
+ ACEPTADO = "ACEPTADO",
4
+ PENDIENTE = "PENDIENTE"
5
+ }
@@ -0,0 +1,6 @@
1
+ export var EstadoJugadorEnEquipo;
2
+ (function (EstadoJugadorEnEquipo) {
3
+ EstadoJugadorEnEquipo["RECHAZADO"] = "RECHAZADO";
4
+ EstadoJugadorEnEquipo["ACEPTADO"] = "ACEPTADO";
5
+ EstadoJugadorEnEquipo["PENDIENTE"] = "PENDIENTE";
6
+ })(EstadoJugadorEnEquipo || (EstadoJugadorEnEquipo = {}));
@@ -0,0 +1,20 @@
1
+ import { z } from "zod";
2
+ export declare const CrearEquipoSchema: z.ZodObject<{
3
+ nombre: z.ZodString;
4
+ color: z.ZodOptional<z.ZodString>;
5
+ jugadores: z.ZodArray<z.ZodObject<{
6
+ nombre: z.ZodString;
7
+ idUsuario: z.ZodNullable<z.ZodOptional<z.ZodString>>;
8
+ suplente: z.ZodOptional<z.ZodBoolean>;
9
+ }, z.core.$strip>>;
10
+ }, z.core.$strip>;
11
+ export type CrearEquipoBody = z.infer<typeof CrearEquipoSchema>;
12
+ export declare const InvitacionEquipoSchema: z.ZodObject<{
13
+ equipoId: z.ZodString;
14
+ aceptar: z.ZodBoolean;
15
+ }, z.core.$strip>;
16
+ export type InvitacionEquipoBody = z.infer<typeof InvitacionEquipoSchema>;
17
+ export declare const GetEquiposDeUsuarioParamsSchema: z.ZodObject<{
18
+ id: z.ZodString;
19
+ }, z.core.$strip>;
20
+ export type GetEquiposDeUsuarioParams = z.infer<typeof GetEquiposDeUsuarioParamsSchema>;
@@ -0,0 +1,20 @@
1
+ import { z } from "zod";
2
+ export const CrearEquipoSchema = z.object({
3
+ nombre: z.string().min(3),
4
+ color: z.string().optional(),
5
+ jugadores: z
6
+ .array(z.object({
7
+ nombre: z.string().min(2),
8
+ idUsuario: z.string().optional().nullable(),
9
+ suplente: z.boolean().optional(),
10
+ }))
11
+ .min(2)
12
+ .max(3),
13
+ });
14
+ export const InvitacionEquipoSchema = z.object({
15
+ equipoId: z.string(),
16
+ aceptar: z.boolean(),
17
+ });
18
+ export const GetEquiposDeUsuarioParamsSchema = z.object({
19
+ id: z.string(),
20
+ });
@@ -0,0 +1,14 @@
1
+ import { EstadoJugadorEnEquipo } from "./equipos.enum.js";
2
+ export interface EquipoDTO {
3
+ id: string;
4
+ nombre: string;
5
+ color: string;
6
+ jugadores: JugadorDTO[];
7
+ idCreador: string;
8
+ }
9
+ export interface JugadorDTO {
10
+ nombre: string;
11
+ idUsuario: string | null;
12
+ estado: EstadoJugadorEnEquipo;
13
+ suplente: boolean;
14
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export * from './equipos.types.js';
2
+ export * from './equipos.schemas.js';
3
+ export * from './equipos.enum.js';
@@ -0,0 +1,3 @@
1
+ export * from './equipos.types.js';
2
+ export * from './equipos.schemas.js';
3
+ export * from './equipos.enum.js';
@@ -0,0 +1,3 @@
1
+ export * from './liga.types.js';
2
+ export * from './liga.schemas.js';
3
+ export * from './liga.enum.js';
@@ -0,0 +1,3 @@
1
+ export * from './liga.types.js';
2
+ export * from './liga.schemas.js';
3
+ export * from './liga.enum.js';
@@ -0,0 +1,14 @@
1
+ export declare enum EstadoLiga {
2
+ EnCurso = "EN_CURSO",
3
+ SinEmpezar = "SIN_EMPEZAR",
4
+ Finalizada = "FINALIZADA"
5
+ }
6
+ export declare enum TipoFutbolin {
7
+ Infinity = "INFINITY",
8
+ Tsunami = "TSUNAMI"
9
+ }
10
+ export declare enum EstadoEquipoEnLiga {
11
+ Pendiente = "PENDIENTE",
12
+ Aprobado = "APROBADO",
13
+ Rechazado = "RECHAZADO"
14
+ }
@@ -0,0 +1,17 @@
1
+ export var EstadoLiga;
2
+ (function (EstadoLiga) {
3
+ EstadoLiga["EnCurso"] = "EN_CURSO";
4
+ EstadoLiga["SinEmpezar"] = "SIN_EMPEZAR";
5
+ EstadoLiga["Finalizada"] = "FINALIZADA";
6
+ })(EstadoLiga || (EstadoLiga = {}));
7
+ export var TipoFutbolin;
8
+ (function (TipoFutbolin) {
9
+ TipoFutbolin["Infinity"] = "INFINITY";
10
+ TipoFutbolin["Tsunami"] = "TSUNAMI";
11
+ })(TipoFutbolin || (TipoFutbolin = {}));
12
+ export var EstadoEquipoEnLiga;
13
+ (function (EstadoEquipoEnLiga) {
14
+ EstadoEquipoEnLiga["Pendiente"] = "PENDIENTE";
15
+ EstadoEquipoEnLiga["Aprobado"] = "APROBADO";
16
+ EstadoEquipoEnLiga["Rechazado"] = "RECHAZADO";
17
+ })(EstadoEquipoEnLiga || (EstadoEquipoEnLiga = {}));
@@ -0,0 +1,59 @@
1
+ import { z } from "zod";
2
+ import { EstadoLiga, TipoFutbolin } from "./liga.enum.js";
3
+ export declare const CrearLigaSchema: z.ZodObject<{
4
+ nombre: z.ZodString;
5
+ descripcion: z.ZodOptional<z.ZodString>;
6
+ tipoFutbolin: z.ZodEnum<typeof TipoFutbolin>;
7
+ estadoLiga: z.ZodDefault<z.ZodEnum<typeof EstadoLiga>>;
8
+ premio: z.ZodOptional<z.ZodString>;
9
+ normas: z.ZodOptional<z.ZodString>;
10
+ ubicaciones: z.ZodDefault<z.ZodArray<z.ZodString>>;
11
+ configuracion: z.ZodOptional<z.ZodObject<{
12
+ partidosPorEnfrentamiento: z.ZodDefault<z.ZodNumber>;
13
+ golesParaGanar: z.ZodDefault<z.ZodNumber>;
14
+ idaYVuelta: z.ZodDefault<z.ZodBoolean>;
15
+ }, z.core.$strip>>;
16
+ }, z.core.$strip>;
17
+ export type CrearLigaBody = z.infer<typeof CrearLigaSchema>;
18
+ export declare const InscribirEquipoSchema: z.ZodObject<{
19
+ equipoId: z.ZodString;
20
+ }, z.core.$strip>;
21
+ export type InscribirEquipoBody = z.infer<typeof InscribirEquipoSchema>;
22
+ export declare const InscribirEquipoParamsSchema: z.ZodObject<{
23
+ id: z.ZodString;
24
+ }, z.core.$strip>;
25
+ export type InscribirEquipoParams = z.infer<typeof InscribirEquipoParamsSchema>;
26
+ export declare const AprobarInscripcionSchema: z.ZodObject<{
27
+ aprobar: z.ZodBoolean;
28
+ }, z.core.$strip>;
29
+ export type AprobarInscripcionBody = z.infer<typeof AprobarInscripcionSchema>;
30
+ export declare const CambiarEstadoLigaSchema: z.ZodObject<{
31
+ nuevoEstado: z.ZodEnum<typeof EstadoLiga>;
32
+ }, z.core.$strip>;
33
+ export type CambiarEstadoLigaBody = z.infer<typeof CambiarEstadoLigaSchema>;
34
+ export declare const GetLigaParamsSchema: z.ZodObject<{
35
+ id: z.ZodString;
36
+ }, z.core.$strip>;
37
+ export type GetLigaParams = z.infer<typeof GetLigaParamsSchema>;
38
+ export declare const GetEquiposLigaParamsSchema: z.ZodObject<{
39
+ id: z.ZodString;
40
+ }, z.core.$strip>;
41
+ export type GetEquiposLigaParams = z.infer<typeof GetEquiposLigaParamsSchema>;
42
+ export declare const AprobarInscripcionParamsSchema: z.ZodObject<{
43
+ id: z.ZodString;
44
+ equipoId: z.ZodString;
45
+ }, z.core.$strip>;
46
+ export type AprobarInscripcionParams = z.infer<typeof AprobarInscripcionParamsSchema>;
47
+ export declare const CambiarEstadoLigaParamsSchema: z.ZodObject<{
48
+ id: z.ZodString;
49
+ }, z.core.$strip>;
50
+ export type CambiarEstadoLigaParams = z.infer<typeof CambiarEstadoLigaParamsSchema>;
51
+ export declare const MarcarPagadoParamsSchema: z.ZodObject<{
52
+ id: z.ZodString;
53
+ equipoId: z.ZodString;
54
+ }, z.core.$strip>;
55
+ export type MarcarPagadoParams = z.infer<typeof MarcarPagadoParamsSchema>;
56
+ export declare const GetClasificacionParamsSchema: z.ZodObject<{
57
+ id: z.ZodString;
58
+ }, z.core.$strip>;
59
+ export type GetClasificacionParams = z.infer<typeof GetClasificacionParamsSchema>;