pokemon-io-core 0.0.42 → 0.0.44
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/core/battleState.d.ts +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/{core → engine}/engine.d.ts +1 -1
- package/dist/{core → engine}/engine.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/skins/CombatSkin.d.ts +1 -1
- package/dist/skins/pokemon/moves.js +50 -50
- package/dist/skins/pokemon/pokemonSkin.js +4 -5
- package/dist/skins/pokemon/types.js +15 -15
- package/package.json +1 -1
- package/dist/api/battle.d.ts +0 -26
- package/dist/api/index.d.ts +0 -2
- package/dist/api/index.js +0 -2
- package/dist/api/room.d.ts +0 -21
- package/dist/api/room.js +0 -2
- package/dist/api/socketTypes.d.ts +0 -46
- package/dist/api/socketTypes.js +0 -1
- package/dist/core/actions.d.ts +0 -21
- package/dist/core/actions.js +0 -1
- package/dist/core/amulets.d.ts +0 -18
- package/dist/core/amulets.js +0 -1
- package/dist/core/events.d.ts +0 -67
- package/dist/core/events.js +0 -1
- package/dist/core/fighters.d.ts +0 -13
- package/dist/core/fighters.js +0 -1
- package/dist/core/ids.d.ts +0 -6
- package/dist/core/ids.js +0 -1
- package/dist/core/items.d.ts +0 -12
- package/dist/core/items.js +0 -1
- package/dist/core/moves.d.ts +0 -73
- package/dist/core/moves.js +0 -2
- package/dist/core/status.d.ts +0 -11
- package/dist/core/status.js +0 -1
- package/dist/core/types.d.ts +0 -14
- package/dist/core/types.js +0 -1
- package/dist/engine/index.d.ts +0 -1
- package/dist/engine/index.js +0 -1
- package/dist/engine/pokemonBattleService.d.ts +0 -6
- package/dist/engine/pokemonBattleService.js +0 -32
- package/dist/modules/auth/auth.schemas.d.ts +0 -24
- package/dist/modules/auth/auth.schemas.js +0 -26
- package/dist/modules/auth/index.d.ts +0 -1
- package/dist/modules/auth/index.js +0 -1
- package/dist/modules/enfrentamiento/enfrentamiento.enum.d.ts +0 -13
- package/dist/modules/enfrentamiento/enfrentamiento.enum.js +0 -15
- package/dist/modules/enfrentamiento/enfrentamiento.schemas.d.ts +0 -22
- package/dist/modules/enfrentamiento/enfrentamiento.schemas.js +0 -17
- package/dist/modules/enfrentamiento/enfrentamiento.types.d.ts +0 -19
- package/dist/modules/enfrentamiento/enfrentamiento.types.js +0 -1
- package/dist/modules/enfrentamiento/index.d.ts +0 -3
- package/dist/modules/enfrentamiento/index.js +0 -3
- package/dist/modules/equipos/equipos.enum.d.ts +0 -5
- package/dist/modules/equipos/equipos.enum.js +0 -6
- package/dist/modules/equipos/equipos.schemas.d.ts +0 -20
- package/dist/modules/equipos/equipos.schemas.js +0 -20
- package/dist/modules/equipos/equipos.types.d.ts +0 -14
- package/dist/modules/equipos/equipos.types.js +0 -1
- package/dist/modules/equipos/index.d.ts +0 -3
- package/dist/modules/equipos/index.js +0 -3
- package/dist/modules/liga/index.d.ts +0 -3
- package/dist/modules/liga/index.js +0 -3
- package/dist/modules/liga/liga.enum.d.ts +0 -14
- package/dist/modules/liga/liga.enum.js +0 -17
- package/dist/modules/liga/liga.schemas.d.ts +0 -59
- package/dist/modules/liga/liga.schemas.js +0 -41
- package/dist/modules/liga/liga.types.d.ts +0 -25
- package/dist/modules/liga/liga.types.js +0 -1
- package/dist/modules/user/index.d.ts +0 -2
- package/dist/modules/user/index.js +0 -2
- package/dist/modules/user/user.schemas.d.ts +0 -15
- package/dist/modules/user/user.schemas.js +0 -15
- package/dist/modules/user/user.types.d.ts +0 -16
- package/dist/modules/user/user.types.js +0 -1
- package/dist/shared/enums.d.ts +0 -0
- package/dist/shared/enums.js +0 -1
- package/dist/skins/index.d.ts +0 -2
- package/dist/skins/pokemon/fighters.d.ts +0 -2
- package/dist/skins/pokemon/img/items/index.d.ts +0 -12
- package/dist/skins/pokemon/img/items/index.js +0 -22
- package/dist/skins/pokemon/img/pokemons/index.d.ts +0 -11
- package/dist/skins/pokemon/img/pokemons/index.js +0 -20
- package/dist/skins/pokemon/index.d.ts +0 -6
- package/dist/skins/pokemon/index.js +0 -6
- package/dist/skins/pokemon/items.d.ts +0 -2
- package/dist/skins/pokemon/moves.d.ts +0 -2
- package/dist/skins/pokemon/pokemonSkin.d.ts +0 -13
- package/dist/skins/pokemon/statuses.d.ts +0 -2
- package/dist/skins/pokemon/types.d.ts +0 -13
- package/dist/utils/logger.d.ts +0 -9
- package/dist/utils/logger.js +0 -15
package/dist/core/amulets.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { AmuletId, TypeId, StatusId } from "./ids";
|
|
2
|
-
import type { EffectDefinition } from "./moves";
|
|
3
|
-
export type PassiveTriggerKind = "always" | "on_hit" | "on_damage_taken" | "on_below_hp_threshold";
|
|
4
|
-
export interface PassiveTriggerCondition {
|
|
5
|
-
kind: PassiveTriggerKind;
|
|
6
|
-
hpThresholdPercent?: number;
|
|
7
|
-
}
|
|
8
|
-
export interface PassiveEffectDefinition {
|
|
9
|
-
trigger: PassiveTriggerCondition;
|
|
10
|
-
effects: EffectDefinition[];
|
|
11
|
-
appliedStatusId?: StatusId;
|
|
12
|
-
}
|
|
13
|
-
export interface AmuletDefinition {
|
|
14
|
-
id: AmuletId;
|
|
15
|
-
name: string;
|
|
16
|
-
classId: TypeId | null;
|
|
17
|
-
passiveEffects: PassiveEffectDefinition[];
|
|
18
|
-
}
|
package/dist/core/amulets.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/core/events.d.ts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
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" | "status_cleared" | "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;
|
package/dist/core/events.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/core/fighters.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
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
|
-
description?: string;
|
|
7
|
-
img?: string;
|
|
8
|
-
classId: TypeId;
|
|
9
|
-
baseStats: FighterStats;
|
|
10
|
-
recommendedMoves?: MoveId[];
|
|
11
|
-
recommendedItems?: ItemId[];
|
|
12
|
-
recommendedAmuletId?: AmuletId;
|
|
13
|
-
}
|
package/dist/core/fighters.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/core/ids.d.ts
DELETED
package/dist/core/ids.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/core/items.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ItemId } from "./ids";
|
|
2
|
-
import type { EffectDefinition, TargetKind } 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
|
-
target: TargetKind;
|
|
9
|
-
maxUses: number;
|
|
10
|
-
image: string;
|
|
11
|
-
effects: EffectDefinition[];
|
|
12
|
-
}
|
package/dist/core/items.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/core/moves.d.ts
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import type { MoveId, StatusId, TypeId } from "./ids";
|
|
2
|
-
export type EffectTarget = "self" | "enemy";
|
|
3
|
-
export type EffectKind = "damage" | "heal" | "shield" | "modify_stats" | "apply_status" | "clear_status" | "modify_hit_chance" | "modify_crit_chance" | "modify_priority" | "modify_effective_speed";
|
|
4
|
-
export type TargetKind = EffectTarget;
|
|
5
|
-
interface BaseEffect {
|
|
6
|
-
target?: EffectTarget;
|
|
7
|
-
}
|
|
8
|
-
export interface DamageEffect extends BaseEffect {
|
|
9
|
-
kind: "damage";
|
|
10
|
-
/**
|
|
11
|
-
* Daño “de fórmula” (stats + tipo + crit…).
|
|
12
|
-
* Si no se define, NO se llama a computeDamage.
|
|
13
|
-
*/
|
|
14
|
-
basePower?: number;
|
|
15
|
-
/**
|
|
16
|
-
* Daño plano adicional.
|
|
17
|
-
* Se suma al daño de fórmula o se usa solo si no hay basePower.
|
|
18
|
-
*/
|
|
19
|
-
flatAmount?: number;
|
|
20
|
-
}
|
|
21
|
-
export interface HealEffect extends BaseEffect {
|
|
22
|
-
kind: "heal";
|
|
23
|
-
amount: number;
|
|
24
|
-
}
|
|
25
|
-
export interface ShieldEffect extends BaseEffect {
|
|
26
|
-
kind: "shield";
|
|
27
|
-
amount: number;
|
|
28
|
-
durationTurns: number;
|
|
29
|
-
}
|
|
30
|
-
export interface ModifyStatsEffect extends BaseEffect {
|
|
31
|
-
kind: "modify_stats";
|
|
32
|
-
offenseDelta?: number;
|
|
33
|
-
defenseDelta?: number;
|
|
34
|
-
speedDelta?: number;
|
|
35
|
-
critDelta?: number;
|
|
36
|
-
}
|
|
37
|
-
export interface ApplyStatusEffect extends BaseEffect {
|
|
38
|
-
kind: "apply_status";
|
|
39
|
-
statusId: StatusId;
|
|
40
|
-
}
|
|
41
|
-
export interface ClearStatusEffect extends BaseEffect {
|
|
42
|
-
kind: "clear_status";
|
|
43
|
-
statusIds?: StatusId[];
|
|
44
|
-
kinds?: ("hard_cc" | "soft")[];
|
|
45
|
-
clearAll?: boolean;
|
|
46
|
-
}
|
|
47
|
-
export interface ModifyHitChanceEffect extends BaseEffect {
|
|
48
|
-
kind: "modify_hit_chance";
|
|
49
|
-
delta: number;
|
|
50
|
-
}
|
|
51
|
-
export interface ModifyCritChanceEffect extends BaseEffect {
|
|
52
|
-
kind: "modify_crit_chance";
|
|
53
|
-
delta: number;
|
|
54
|
-
}
|
|
55
|
-
export interface ModifyPriorityEffect extends BaseEffect {
|
|
56
|
-
kind: "modify_priority";
|
|
57
|
-
delta: number;
|
|
58
|
-
}
|
|
59
|
-
export interface ModifyEffectiveSpeedEffect extends BaseEffect {
|
|
60
|
-
kind: "modify_effective_speed";
|
|
61
|
-
multiplier: number;
|
|
62
|
-
}
|
|
63
|
-
export type EffectDefinition = DamageEffect | HealEffect | ShieldEffect | ModifyStatsEffect | ApplyStatusEffect | ClearStatusEffect | ModifyHitChanceEffect | ModifyCritChanceEffect | ModifyPriorityEffect | ModifyEffectiveSpeedEffect;
|
|
64
|
-
export interface MoveDefinition {
|
|
65
|
-
id: MoveId;
|
|
66
|
-
name: string;
|
|
67
|
-
typeId: TypeId;
|
|
68
|
-
accuracy?: number;
|
|
69
|
-
maxPP: number;
|
|
70
|
-
priority?: number;
|
|
71
|
-
effects: EffectDefinition[];
|
|
72
|
-
}
|
|
73
|
-
export {};
|
package/dist/core/moves.js
DELETED
package/dist/core/status.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
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
|
-
}
|
package/dist/core/status.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/core/types.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
}
|
package/dist/core/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/engine/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./pokemonBattleService.js";
|
package/dist/engine/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./pokemonBattleService.js";
|
|
@@ -1,6 +0,0 @@
|
|
|
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("..").BattleEvent[];
|
|
6
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
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);
|
|
@@ -1,24 +0,0 @@
|
|
|
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>;
|
|
@@ -1,26 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './auth.schemas.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './auth.schemas.js';
|
|
@@ -1,13 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
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 = {}));
|
|
@@ -1,22 +0,0 @@
|
|
|
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>;
|
|
@@ -1,17 +0,0 @@
|
|
|
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') });
|
|
@@ -1,19 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export var EstadoJugadorEnEquipo;
|
|
2
|
-
(function (EstadoJugadorEnEquipo) {
|
|
3
|
-
EstadoJugadorEnEquipo["RECHAZADO"] = "RECHAZADO";
|
|
4
|
-
EstadoJugadorEnEquipo["ACEPTADO"] = "ACEPTADO";
|
|
5
|
-
EstadoJugadorEnEquipo["PENDIENTE"] = "PENDIENTE";
|
|
6
|
-
})(EstadoJugadorEnEquipo || (EstadoJugadorEnEquipo = {}));
|
|
@@ -1,20 +0,0 @@
|
|
|
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>;
|
|
@@ -1,20 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
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 = {}));
|