volleyballsimtypes 0.0.482 → 0.0.483
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/cjs/src/api/index.d.ts +3 -17
- package/dist/cjs/src/data/models/tactics.d.ts +7 -17
- package/dist/cjs/src/data/transformers/match-preset-override.test.js +10 -1
- package/dist/cjs/src/data/transformers/rally-event.d.ts +2 -1
- package/dist/cjs/src/data/transformers/rally-event.js +12 -0
- package/dist/cjs/src/data/transformers/rally.js +2 -0
- package/dist/cjs/src/data/transformers/rally.test.d.ts +1 -0
- package/dist/cjs/src/data/transformers/rally.test.js +62 -0
- package/dist/cjs/src/data/transformers/tactics.js +26 -54
- package/dist/cjs/src/data/transformers/tactics.test.js +16 -11
- package/dist/cjs/src/service/team/designated-sub.d.ts +2 -4
- package/dist/cjs/src/service/team/index.d.ts +1 -0
- package/dist/cjs/src/service/team/index.js +1 -0
- package/dist/cjs/src/service/team/libero-sub.d.ts +0 -4
- package/dist/cjs/src/service/team/pinch-condition.d.ts +11 -3
- package/dist/cjs/src/service/team/pinch-condition.js +9 -4
- package/dist/cjs/src/service/team/schemas/designated-sub.z.d.ts +30 -32
- package/dist/cjs/src/service/team/schemas/designated-sub.z.js +27 -23
- package/dist/cjs/src/service/team/schemas/designated-sub.z.test.js +4 -2
- package/dist/cjs/src/service/team/schemas/libero-sub.z.d.ts +15 -34
- package/dist/cjs/src/service/team/schemas/libero-sub.z.js +10 -26
- package/dist/cjs/src/service/team/schemas/libero-sub.z.test.js +74 -35
- package/dist/cjs/src/service/team/schemas/tactics.z.d.ts +28 -36
- package/dist/cjs/src/service/team/schemas/tactics.z.js +4 -3
- package/dist/cjs/src/service/team/schemas/team.z.d.ts +28 -36
- package/dist/cjs/src/service/team/sub-config-convert.d.ts +13 -0
- package/dist/cjs/src/service/team/sub-config-convert.js +91 -0
- package/dist/cjs/src/service/team/sub-config-convert.test.d.ts +1 -0
- package/dist/cjs/src/service/team/sub-config-convert.test.js +84 -0
- package/dist/esm/src/api/index.d.ts +3 -17
- package/dist/esm/src/data/models/tactics.d.ts +7 -17
- package/dist/esm/src/data/transformers/match-preset-override.test.js +10 -1
- package/dist/esm/src/data/transformers/rally-event.d.ts +2 -1
- package/dist/esm/src/data/transformers/rally-event.js +12 -1
- package/dist/esm/src/data/transformers/rally.js +4 -2
- package/dist/esm/src/data/transformers/rally.test.d.ts +1 -0
- package/dist/esm/src/data/transformers/rally.test.js +60 -0
- package/dist/esm/src/data/transformers/tactics.js +27 -55
- package/dist/esm/src/data/transformers/tactics.test.js +16 -11
- package/dist/esm/src/service/team/designated-sub.d.ts +2 -4
- package/dist/esm/src/service/team/index.d.ts +1 -0
- package/dist/esm/src/service/team/index.js +1 -0
- package/dist/esm/src/service/team/libero-sub.d.ts +0 -4
- package/dist/esm/src/service/team/pinch-condition.d.ts +11 -3
- package/dist/esm/src/service/team/pinch-condition.js +9 -4
- package/dist/esm/src/service/team/schemas/designated-sub.z.d.ts +30 -32
- package/dist/esm/src/service/team/schemas/designated-sub.z.js +26 -22
- package/dist/esm/src/service/team/schemas/designated-sub.z.test.js +4 -2
- package/dist/esm/src/service/team/schemas/libero-sub.z.d.ts +15 -34
- package/dist/esm/src/service/team/schemas/libero-sub.z.js +9 -25
- package/dist/esm/src/service/team/schemas/libero-sub.z.test.js +75 -36
- package/dist/esm/src/service/team/schemas/tactics.z.d.ts +28 -36
- package/dist/esm/src/service/team/schemas/tactics.z.js +4 -3
- package/dist/esm/src/service/team/schemas/team.z.d.ts +28 -36
- package/dist/esm/src/service/team/sub-config-convert.d.ts +13 -0
- package/dist/esm/src/service/team/sub-config-convert.js +85 -0
- package/dist/esm/src/service/team/sub-config-convert.test.d.ts +1 -0
- package/dist/esm/src/service/team/sub-config-convert.test.js +82 -0
- package/package.json +1 -1
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
export declare const LiberoSubModeSchema: z.ZodEnum<{
|
|
4
|
-
NEVER: "NEVER";
|
|
5
|
-
FATIGUE: "FATIGUE";
|
|
6
|
-
CONDITIONS: "CONDITIONS";
|
|
7
|
-
ALWAYS: "ALWAYS";
|
|
8
|
-
}>;
|
|
9
|
-
export declare const LiberoSetSubConfigSchema: z.ZodObject<{
|
|
10
|
-
mode: z.ZodEnum<{
|
|
11
|
-
NEVER: "NEVER";
|
|
12
|
-
FATIGUE: "FATIGUE";
|
|
13
|
-
CONDITIONS: "CONDITIONS";
|
|
14
|
-
ALWAYS: "ALWAYS";
|
|
15
|
-
}>;
|
|
16
|
-
fatigueBand: z.ZodOptional<z.ZodEnum<typeof EnergyBand>>;
|
|
2
|
+
export declare const LiberoSetSubConfigSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodObject<{
|
|
17
3
|
conditions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
18
4
|
type: z.ZodLiteral<import("..").PinchConditionType.ASAP>;
|
|
19
5
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -45,18 +31,14 @@ export declare const LiberoSetSubConfigSchema: z.ZodObject<{
|
|
|
45
31
|
}, z.core.$strip>, z.ZodObject<{
|
|
46
32
|
type: z.ZodLiteral<import("..").PinchConditionType.PHASE>;
|
|
47
33
|
phase: z.ZodEnum<typeof import("..").MatchPhase>;
|
|
34
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
35
|
+
type: z.ZodLiteral<import("..").PinchConditionType.FATIGUE>;
|
|
36
|
+
band: z.ZodOptional<z.ZodEnum<typeof import("..").EnergyBand>>;
|
|
48
37
|
}, z.core.$strip>], "type">>>;
|
|
49
38
|
conditionLogic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"ALL">, z.ZodLiteral<"ANY">]>>;
|
|
50
|
-
}, z.core.$strip
|
|
51
|
-
export declare const LiberoSubConfigSchema: z.ZodObject<{
|
|
52
|
-
sets: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
53
|
-
mode: z.ZodEnum<{
|
|
54
|
-
NEVER: "NEVER";
|
|
55
|
-
FATIGUE: "FATIGUE";
|
|
56
|
-
CONDITIONS: "CONDITIONS";
|
|
57
|
-
ALWAYS: "ALWAYS";
|
|
58
|
-
}>;
|
|
59
|
-
fatigueBand: z.ZodOptional<z.ZodEnum<typeof EnergyBand>>;
|
|
39
|
+
}, z.core.$strip>>;
|
|
40
|
+
export declare const LiberoSubConfigSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodObject<{
|
|
41
|
+
sets: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodObject<{
|
|
60
42
|
conditions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
61
43
|
type: z.ZodLiteral<import("..").PinchConditionType.ASAP>;
|
|
62
44
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -88,16 +70,12 @@ export declare const LiberoSubConfigSchema: z.ZodObject<{
|
|
|
88
70
|
}, z.core.$strip>, z.ZodObject<{
|
|
89
71
|
type: z.ZodLiteral<import("..").PinchConditionType.PHASE>;
|
|
90
72
|
phase: z.ZodEnum<typeof import("..").MatchPhase>;
|
|
73
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
74
|
+
type: z.ZodLiteral<import("..").PinchConditionType.FATIGUE>;
|
|
75
|
+
band: z.ZodOptional<z.ZodEnum<typeof import("..").EnergyBand>>;
|
|
91
76
|
}, z.core.$strip>], "type">>>;
|
|
92
77
|
conditionLogic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"ALL">, z.ZodLiteral<"ANY">]>>;
|
|
93
|
-
}, z.core.$strip
|
|
94
|
-
mode: z.ZodEnum<{
|
|
95
|
-
NEVER: "NEVER";
|
|
96
|
-
FATIGUE: "FATIGUE";
|
|
97
|
-
CONDITIONS: "CONDITIONS";
|
|
98
|
-
ALWAYS: "ALWAYS";
|
|
99
|
-
}>;
|
|
100
|
-
fatigueBand: z.ZodOptional<z.ZodEnum<typeof EnergyBand>>;
|
|
78
|
+
}, z.core.$strip>>>>;
|
|
101
79
|
conditions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
102
80
|
type: z.ZodLiteral<import("..").PinchConditionType.ASAP>;
|
|
103
81
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -129,6 +107,9 @@ export declare const LiberoSubConfigSchema: z.ZodObject<{
|
|
|
129
107
|
}, z.core.$strip>, z.ZodObject<{
|
|
130
108
|
type: z.ZodLiteral<import("..").PinchConditionType.PHASE>;
|
|
131
109
|
phase: z.ZodEnum<typeof import("..").MatchPhase>;
|
|
110
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
111
|
+
type: z.ZodLiteral<import("..").PinchConditionType.FATIGUE>;
|
|
112
|
+
band: z.ZodOptional<z.ZodEnum<typeof import("..").EnergyBand>>;
|
|
132
113
|
}, z.core.$strip>], "type">>>;
|
|
133
114
|
conditionLogic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"ALL">, z.ZodLiteral<"ANY">]>>;
|
|
134
|
-
}, z.core.$strip
|
|
115
|
+
}, z.core.$strip>>;
|
|
@@ -1,34 +1,18 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { convertLegacyLiberoSetSubConfig, convertLegacyLiberoSubConfig } from '../sub-config-convert';
|
|
3
3
|
import { ConditionLogicSchema, PinchConditionSchema } from './designated-sub.z';
|
|
4
|
-
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
4
|
+
// Pure condition engine (owner 2026-07-11): the second libero is active while `conditions` hold (combined
|
|
5
|
+
// per `conditionLogic`, default ALL; the STARTING libero is the FATIGUE-condition subject). No conditions =
|
|
6
|
+
// the starting libero always plays; [{ASAP}] = always the second libero (the old ALWAYS). The swapped-in
|
|
7
|
+
// player is always the dedicated `secondLibero`, so there is no bench to validate. Legacy mode-shaped
|
|
8
|
+
// configs (NEVER/FATIGUE/ALWAYS/CONDITIONS) are auto-converted by the preprocess.
|
|
8
9
|
const liberoSetSubConfigShape = {
|
|
9
|
-
mode: LiberoSubModeSchema,
|
|
10
|
-
// fatigue mode only (absent => the team default `substitutionBand`):
|
|
11
|
-
fatigueBand: z.nativeEnum(EnergyBand).optional(),
|
|
12
|
-
// conditions mode only:
|
|
13
10
|
conditions: z.array(PinchConditionSchema).optional(),
|
|
14
11
|
conditionLogic: ConditionLogicSchema.optional()
|
|
15
12
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (data.mode !== 'CONDITIONS')
|
|
19
|
-
return;
|
|
20
|
-
if (data.conditions == null || data.conditions.length === 0) {
|
|
21
|
-
ctx.addIssue({ code: 'custom', message: 'LIBERO_CONDITIONS_REQUIRE_A_CONDITION', path: ['conditions'] });
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
export const LiberoSetSubConfigSchema = z.object(liberoSetSubConfigShape).superRefine(refineConditions);
|
|
25
|
-
export const LiberoSubConfigSchema = z.object({
|
|
13
|
+
export const LiberoSetSubConfigSchema = z.preprocess(convertLegacyLiberoSetSubConfig, z.object(liberoSetSubConfigShape));
|
|
14
|
+
export const LiberoSubConfigSchema = z.preprocess(convertLegacyLiberoSubConfig, z.object({
|
|
26
15
|
...liberoSetSubConfigShape,
|
|
27
16
|
// Optional per-set overrides (index 0 = set 1 ... index 4 = set 5); absent => the flat config for all sets.
|
|
28
17
|
sets: z.array(LiberoSetSubConfigSchema).max(5).optional()
|
|
29
|
-
})
|
|
30
|
-
// The flat config is the fallback for any set a partial `sets` array doesn't cover, so validate it whenever
|
|
31
|
-
// `sets` is absent or covers fewer than 5 sets (each present per-set config is validated by its own schema).
|
|
32
|
-
if (data.sets == null || data.sets.length < 5)
|
|
33
|
-
refineConditions(data, ctx);
|
|
34
|
-
});
|
|
18
|
+
}));
|
|
@@ -1,86 +1,125 @@
|
|
|
1
1
|
import { describe, it, expect } from '@jest/globals';
|
|
2
|
-
import { LiberoSetSubConfigSchema, LiberoSubConfigSchema
|
|
2
|
+
import { LiberoSetSubConfigSchema, LiberoSubConfigSchema } from './libero-sub.z';
|
|
3
3
|
import { EnergyBand } from '../energy-band';
|
|
4
4
|
import { MatchPhase, PinchConditionType } from '../pinch-condition';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
// Unified condition engine (owner 2026-07-11): the libero rule is a pure condition list; legacy mode-shaped
|
|
6
|
+
// configs (NEVER/FATIGUE/ALWAYS/CONDITIONS) auto-convert in the schema preprocess.
|
|
7
|
+
describe('LiberoSetSubConfigSchema (unified)', () => {
|
|
8
|
+
it('accepts an empty config (no conditions = the starting libero always plays)', () => {
|
|
9
|
+
const res = LiberoSetSubConfigSchema.safeParse({});
|
|
10
|
+
expect(res.success).toBe(true);
|
|
11
|
+
if (res.success)
|
|
12
|
+
expect(res.data.conditions ?? []).toHaveLength(0);
|
|
13
13
|
});
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
it('accepts a FATIGUE condition with a band', () => {
|
|
15
|
+
const res = LiberoSetSubConfigSchema.safeParse({
|
|
16
|
+
conditions: [{ type: PinchConditionType.FATIGUE, band: EnergyBand.TIRED }]
|
|
17
|
+
});
|
|
18
|
+
expect(res.success).toBe(true);
|
|
18
19
|
});
|
|
19
|
-
it('accepts a
|
|
20
|
-
expect(LiberoSetSubConfigSchema.safeParse({
|
|
20
|
+
it('accepts a FATIGUE condition without a band (team default)', () => {
|
|
21
|
+
expect(LiberoSetSubConfigSchema.safeParse({ conditions: [{ type: PinchConditionType.FATIGUE }] }).success).toBe(true);
|
|
21
22
|
});
|
|
22
|
-
it('rejects an unknown band', () => {
|
|
23
|
-
expect(LiberoSetSubConfigSchema.safeParse({
|
|
23
|
+
it('rejects a FATIGUE condition with an unknown band', () => {
|
|
24
|
+
expect(LiberoSetSubConfigSchema.safeParse({ conditions: [{ type: PinchConditionType.FATIGUE, band: 'SLEEPY' }] }).success).toBe(false);
|
|
24
25
|
});
|
|
25
|
-
it('accepts
|
|
26
|
+
it('accepts a PHASE condition (serve/receive split)', () => {
|
|
26
27
|
const res = LiberoSetSubConfigSchema.safeParse({
|
|
27
|
-
mode: 'CONDITIONS',
|
|
28
28
|
conditionLogic: 'ALL',
|
|
29
29
|
conditions: [{ type: PinchConditionType.PHASE, phase: MatchPhase.RECEIVING }]
|
|
30
30
|
});
|
|
31
31
|
expect(res.success).toBe(true);
|
|
32
32
|
});
|
|
33
|
-
it('accepts
|
|
33
|
+
it('accepts mixed conditions (score + phase + fatigue) under ANY logic', () => {
|
|
34
34
|
const res = LiberoSetSubConfigSchema.safeParse({
|
|
35
|
-
mode: 'CONDITIONS',
|
|
36
35
|
conditionLogic: 'ANY',
|
|
37
36
|
conditions: [
|
|
38
37
|
{ type: PinchConditionType.MIN_OWN_SCORE, score: 20 },
|
|
39
|
-
{ type: PinchConditionType.PHASE, phase: MatchPhase.SERVING }
|
|
38
|
+
{ type: PinchConditionType.PHASE, phase: MatchPhase.SERVING },
|
|
39
|
+
{ type: PinchConditionType.FATIGUE, band: EnergyBand.EXHAUSTED }
|
|
40
40
|
]
|
|
41
41
|
});
|
|
42
42
|
expect(res.success).toBe(true);
|
|
43
43
|
});
|
|
44
|
-
it('rejects CONDITIONS mode with no conditions', () => {
|
|
45
|
-
expect(LiberoSetSubConfigSchema.safeParse({ mode: 'CONDITIONS' }).success).toBe(false);
|
|
46
|
-
expect(LiberoSetSubConfigSchema.safeParse({ mode: 'CONDITIONS', conditions: [] }).success).toBe(false);
|
|
47
|
-
});
|
|
48
44
|
it('rejects an invalid PHASE value', () => {
|
|
49
45
|
const res = LiberoSetSubConfigSchema.safeParse({
|
|
50
|
-
mode: 'CONDITIONS',
|
|
51
46
|
conditions: [{ type: PinchConditionType.PHASE, phase: 'ATTACKING' }]
|
|
52
47
|
});
|
|
53
48
|
expect(res.success).toBe(false);
|
|
54
49
|
});
|
|
55
50
|
});
|
|
51
|
+
describe('LiberoSetSubConfigSchema (legacy conversion)', () => {
|
|
52
|
+
it('converts legacy NEVER to an empty condition list', () => {
|
|
53
|
+
const res = LiberoSetSubConfigSchema.safeParse({ mode: 'NEVER' });
|
|
54
|
+
expect(res.success).toBe(true);
|
|
55
|
+
if (res.success)
|
|
56
|
+
expect(res.data.conditions).toEqual([]);
|
|
57
|
+
});
|
|
58
|
+
it('converts legacy ALWAYS to a single ASAP condition', () => {
|
|
59
|
+
const res = LiberoSetSubConfigSchema.safeParse({ mode: 'ALWAYS' });
|
|
60
|
+
expect(res.success).toBe(true);
|
|
61
|
+
if (res.success)
|
|
62
|
+
expect(res.data.conditions).toEqual([{ type: PinchConditionType.ASAP }]);
|
|
63
|
+
});
|
|
64
|
+
it('converts legacy FATIGUE + band to a FATIGUE condition carrying the band', () => {
|
|
65
|
+
const res = LiberoSetSubConfigSchema.safeParse({ mode: 'FATIGUE', fatigueBand: EnergyBand.WORN });
|
|
66
|
+
expect(res.success).toBe(true);
|
|
67
|
+
if (res.success)
|
|
68
|
+
expect(res.data.conditions).toEqual([{ type: PinchConditionType.FATIGUE, band: EnergyBand.WORN }]);
|
|
69
|
+
});
|
|
70
|
+
it('converts legacy FATIGUE without a band to a bandless FATIGUE condition (team default)', () => {
|
|
71
|
+
const res = LiberoSetSubConfigSchema.safeParse({ mode: 'FATIGUE' });
|
|
72
|
+
expect(res.success).toBe(true);
|
|
73
|
+
if (res.success)
|
|
74
|
+
expect(res.data.conditions).toEqual([{ type: PinchConditionType.FATIGUE }]);
|
|
75
|
+
});
|
|
76
|
+
it('converts legacy CONDITIONS by stripping the mode and keeping the conditions', () => {
|
|
77
|
+
const conditions = [{ type: PinchConditionType.PHASE, phase: MatchPhase.RECEIVING }];
|
|
78
|
+
const res = LiberoSetSubConfigSchema.safeParse({ mode: 'CONDITIONS', conditionLogic: 'ALL', conditions });
|
|
79
|
+
expect(res.success).toBe(true);
|
|
80
|
+
if (res.success) {
|
|
81
|
+
expect(res.data.conditions).toEqual(conditions);
|
|
82
|
+
expect(res.data.mode).toBeUndefined();
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
it('heals a legacy CONDITIONS config with no conditions to never (empty list) instead of rejecting', () => {
|
|
86
|
+
const res = LiberoSetSubConfigSchema.safeParse({ mode: 'CONDITIONS' });
|
|
87
|
+
expect(res.success).toBe(true);
|
|
88
|
+
if (res.success)
|
|
89
|
+
expect(res.data.conditions ?? []).toHaveLength(0);
|
|
90
|
+
});
|
|
91
|
+
});
|
|
56
92
|
describe('LiberoSubConfigSchema', () => {
|
|
57
|
-
it('accepts a flat config with no per-set overrides', () => {
|
|
93
|
+
it('accepts a flat config with no per-set overrides (legacy shape converts)', () => {
|
|
58
94
|
expect(LiberoSubConfigSchema.safeParse({ mode: 'FATIGUE', fatigueBand: EnergyBand.WORN }).success).toBe(true);
|
|
59
95
|
});
|
|
60
|
-
it('accepts up to five per-set configs', () => {
|
|
96
|
+
it('accepts up to five per-set configs (legacy per-set entries convert)', () => {
|
|
61
97
|
const res = LiberoSubConfigSchema.safeParse({
|
|
62
98
|
mode: 'NEVER',
|
|
63
99
|
sets: [
|
|
64
100
|
{ mode: 'NEVER' },
|
|
65
101
|
{ mode: 'ALWAYS' },
|
|
66
102
|
{ mode: 'FATIGUE', fatigueBand: EnergyBand.TIRED },
|
|
67
|
-
{
|
|
68
|
-
{
|
|
103
|
+
{ conditions: [{ type: PinchConditionType.FATIGUE }] },
|
|
104
|
+
{}
|
|
69
105
|
]
|
|
70
106
|
});
|
|
71
107
|
expect(res.success).toBe(true);
|
|
108
|
+
if (res.success) {
|
|
109
|
+
expect(res.data.sets?.[0].conditions).toEqual([]);
|
|
110
|
+
expect(res.data.sets?.[1].conditions).toEqual([{ type: PinchConditionType.ASAP }]);
|
|
111
|
+
expect(res.data.sets?.[2].conditions).toEqual([{ type: PinchConditionType.FATIGUE, band: EnergyBand.TIRED }]);
|
|
112
|
+
}
|
|
72
113
|
});
|
|
73
114
|
it('rejects more than five per-set configs', () => {
|
|
74
115
|
const res = LiberoSubConfigSchema.safeParse({
|
|
75
|
-
|
|
76
|
-
sets: Array.from({ length: 6 }, () => ({ mode: 'NEVER' }))
|
|
116
|
+
sets: Array.from({ length: 6 }, () => ({}))
|
|
77
117
|
});
|
|
78
118
|
expect(res.success).toBe(false);
|
|
79
119
|
});
|
|
80
|
-
it('rejects an unknown
|
|
120
|
+
it('rejects an unknown condition type in a per-set config', () => {
|
|
81
121
|
const res = LiberoSubConfigSchema.safeParse({
|
|
82
|
-
|
|
83
|
-
sets: [{ mode: 'WHENEVER' }]
|
|
122
|
+
sets: [{ conditions: [{ type: 'WHENEVER' }] }]
|
|
84
123
|
});
|
|
85
124
|
expect(res.success).toBe(false);
|
|
86
125
|
});
|
|
@@ -15,16 +15,9 @@ export declare const TacticsInputSchema: z.ZodObject<{
|
|
|
15
15
|
}, z.core.$strip>;
|
|
16
16
|
liberoReplacements: z.ZodArray<z.ZodCustom<Player, Player>>;
|
|
17
17
|
receiveRotationOffset: z.ZodDefault<z.ZodBoolean>;
|
|
18
|
-
designatedSubs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
19
|
-
sets: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
20
|
-
mode: z.ZodEnum<{
|
|
21
|
-
NEVER: "NEVER";
|
|
22
|
-
FATIGUE: "FATIGUE";
|
|
23
|
-
PINCH: "PINCH";
|
|
24
|
-
}>;
|
|
18
|
+
designatedSubs: z.ZodDefault<z.ZodArray<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodObject<{
|
|
19
|
+
sets: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodObject<{
|
|
25
20
|
bench: z.ZodOptional<z.ZodCustom<Player, Player>>;
|
|
26
|
-
fatigueBand: z.ZodOptional<z.ZodEnum<typeof EnergyBand>>;
|
|
27
|
-
benchFatigueBand: z.ZodOptional<z.ZodEnum<typeof EnergyBand>>;
|
|
28
21
|
conditions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
29
22
|
type: z.ZodLiteral<import("..").PinchConditionType.ASAP>;
|
|
30
23
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -56,9 +49,13 @@ export declare const TacticsInputSchema: z.ZodObject<{
|
|
|
56
49
|
}, z.core.$strip>, z.ZodObject<{
|
|
57
50
|
type: z.ZodLiteral<import("..").PinchConditionType.PHASE>;
|
|
58
51
|
phase: z.ZodEnum<typeof import("..").MatchPhase>;
|
|
52
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
53
|
+
type: z.ZodLiteral<import("..").PinchConditionType.FATIGUE>;
|
|
54
|
+
band: z.ZodOptional<z.ZodEnum<typeof EnergyBand>>;
|
|
59
55
|
}, z.core.$strip>], "type">>>;
|
|
60
56
|
conditionLogic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"ALL">, z.ZodLiteral<"ANY">]>>;
|
|
61
57
|
pinchServer: z.ZodOptional<z.ZodBoolean>;
|
|
58
|
+
benchFatigueBand: z.ZodOptional<z.ZodEnum<typeof EnergyBand>>;
|
|
62
59
|
subBackMode: z.ZodOptional<z.ZodEnum<{
|
|
63
60
|
FATIGUE: "FATIGUE";
|
|
64
61
|
CONDITIONS: "CONDITIONS";
|
|
@@ -94,17 +91,13 @@ export declare const TacticsInputSchema: z.ZodObject<{
|
|
|
94
91
|
}, z.core.$strip>, z.ZodObject<{
|
|
95
92
|
type: z.ZodLiteral<import("..").PinchConditionType.PHASE>;
|
|
96
93
|
phase: z.ZodEnum<typeof import("..").MatchPhase>;
|
|
94
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
95
|
+
type: z.ZodLiteral<import("..").PinchConditionType.FATIGUE>;
|
|
96
|
+
band: z.ZodOptional<z.ZodEnum<typeof EnergyBand>>;
|
|
97
97
|
}, z.core.$strip>], "type">>>;
|
|
98
98
|
subBackConditionLogic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"ALL">, z.ZodLiteral<"ANY">]>>;
|
|
99
|
-
}, z.core.$strip
|
|
100
|
-
mode: z.ZodEnum<{
|
|
101
|
-
NEVER: "NEVER";
|
|
102
|
-
FATIGUE: "FATIGUE";
|
|
103
|
-
PINCH: "PINCH";
|
|
104
|
-
}>;
|
|
99
|
+
}, z.core.$strip>>>>;
|
|
105
100
|
bench: z.ZodOptional<z.ZodCustom<Player, Player>>;
|
|
106
|
-
fatigueBand: z.ZodOptional<z.ZodEnum<typeof EnergyBand>>;
|
|
107
|
-
benchFatigueBand: z.ZodOptional<z.ZodEnum<typeof EnergyBand>>;
|
|
108
101
|
conditions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
109
102
|
type: z.ZodLiteral<import("..").PinchConditionType.ASAP>;
|
|
110
103
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -136,9 +129,13 @@ export declare const TacticsInputSchema: z.ZodObject<{
|
|
|
136
129
|
}, z.core.$strip>, z.ZodObject<{
|
|
137
130
|
type: z.ZodLiteral<import("..").PinchConditionType.PHASE>;
|
|
138
131
|
phase: z.ZodEnum<typeof import("..").MatchPhase>;
|
|
132
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
133
|
+
type: z.ZodLiteral<import("..").PinchConditionType.FATIGUE>;
|
|
134
|
+
band: z.ZodOptional<z.ZodEnum<typeof EnergyBand>>;
|
|
139
135
|
}, z.core.$strip>], "type">>>;
|
|
140
136
|
conditionLogic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"ALL">, z.ZodLiteral<"ANY">]>>;
|
|
141
137
|
pinchServer: z.ZodOptional<z.ZodBoolean>;
|
|
138
|
+
benchFatigueBand: z.ZodOptional<z.ZodEnum<typeof EnergyBand>>;
|
|
142
139
|
subBackMode: z.ZodOptional<z.ZodEnum<{
|
|
143
140
|
FATIGUE: "FATIGUE";
|
|
144
141
|
CONDITIONS: "CONDITIONS";
|
|
@@ -174,21 +171,17 @@ export declare const TacticsInputSchema: z.ZodObject<{
|
|
|
174
171
|
}, z.core.$strip>, z.ZodObject<{
|
|
175
172
|
type: z.ZodLiteral<import("..").PinchConditionType.PHASE>;
|
|
176
173
|
phase: z.ZodEnum<typeof import("..").MatchPhase>;
|
|
174
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
175
|
+
type: z.ZodLiteral<import("..").PinchConditionType.FATIGUE>;
|
|
176
|
+
band: z.ZodOptional<z.ZodEnum<typeof EnergyBand>>;
|
|
177
177
|
}, z.core.$strip>], "type">>>;
|
|
178
178
|
subBackConditionLogic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"ALL">, z.ZodLiteral<"ANY">]>>;
|
|
179
179
|
starter: z.ZodCustom<Player, Player>;
|
|
180
|
-
}, z.core.$strip
|
|
180
|
+
}, z.core.$strip>>>>;
|
|
181
181
|
substitutionBand: z.ZodDefault<z.ZodUnion<readonly [z.ZodEnum<typeof EnergyBand>, z.ZodLiteral<"NEVER">]>>;
|
|
182
182
|
secondLibero: z.ZodOptional<z.ZodCustom<Player, Player>>;
|
|
183
|
-
liberoSub: z.ZodOptional<z.ZodObject<{
|
|
184
|
-
sets: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
185
|
-
mode: z.ZodEnum<{
|
|
186
|
-
NEVER: "NEVER";
|
|
187
|
-
FATIGUE: "FATIGUE";
|
|
188
|
-
CONDITIONS: "CONDITIONS";
|
|
189
|
-
ALWAYS: "ALWAYS";
|
|
190
|
-
}>;
|
|
191
|
-
fatigueBand: z.ZodOptional<z.ZodEnum<typeof EnergyBand>>;
|
|
183
|
+
liberoSub: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodObject<{
|
|
184
|
+
sets: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodObject<{
|
|
192
185
|
conditions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
193
186
|
type: z.ZodLiteral<import("..").PinchConditionType.ASAP>;
|
|
194
187
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -220,16 +213,12 @@ export declare const TacticsInputSchema: z.ZodObject<{
|
|
|
220
213
|
}, z.core.$strip>, z.ZodObject<{
|
|
221
214
|
type: z.ZodLiteral<import("..").PinchConditionType.PHASE>;
|
|
222
215
|
phase: z.ZodEnum<typeof import("..").MatchPhase>;
|
|
216
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
217
|
+
type: z.ZodLiteral<import("..").PinchConditionType.FATIGUE>;
|
|
218
|
+
band: z.ZodOptional<z.ZodEnum<typeof EnergyBand>>;
|
|
223
219
|
}, z.core.$strip>], "type">>>;
|
|
224
220
|
conditionLogic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"ALL">, z.ZodLiteral<"ANY">]>>;
|
|
225
|
-
}, z.core.$strip
|
|
226
|
-
mode: z.ZodEnum<{
|
|
227
|
-
NEVER: "NEVER";
|
|
228
|
-
FATIGUE: "FATIGUE";
|
|
229
|
-
CONDITIONS: "CONDITIONS";
|
|
230
|
-
ALWAYS: "ALWAYS";
|
|
231
|
-
}>;
|
|
232
|
-
fatigueBand: z.ZodOptional<z.ZodEnum<typeof EnergyBand>>;
|
|
221
|
+
}, z.core.$strip>>>>;
|
|
233
222
|
conditions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
234
223
|
type: z.ZodLiteral<import("..").PinchConditionType.ASAP>;
|
|
235
224
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -261,9 +250,12 @@ export declare const TacticsInputSchema: z.ZodObject<{
|
|
|
261
250
|
}, z.core.$strip>, z.ZodObject<{
|
|
262
251
|
type: z.ZodLiteral<import("..").PinchConditionType.PHASE>;
|
|
263
252
|
phase: z.ZodEnum<typeof import("..").MatchPhase>;
|
|
253
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
254
|
+
type: z.ZodLiteral<import("..").PinchConditionType.FATIGUE>;
|
|
255
|
+
band: z.ZodOptional<z.ZodEnum<typeof EnergyBand>>;
|
|
264
256
|
}, z.core.$strip>], "type">>>;
|
|
265
257
|
conditionLogic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"ALL">, z.ZodLiteral<"ANY">]>>;
|
|
266
|
-
}, z.core.$strip
|
|
258
|
+
}, z.core.$strip>>>;
|
|
267
259
|
liberoReplacementSets: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodCustom<Player, Player>>>>;
|
|
268
260
|
rotationSystem: z.ZodDefault<z.ZodEnum<typeof RotationSystemEnum>>;
|
|
269
261
|
designatedSetters: z.ZodDefault<z.ZodArray<z.ZodCustom<Player, Player>>>;
|
|
@@ -218,10 +218,11 @@ export const TacticsInputSchema = z.object({
|
|
|
218
218
|
...(libero != null ? [libero.id] : []),
|
|
219
219
|
...data.lineup.bench.map(p => p.id)
|
|
220
220
|
]);
|
|
221
|
-
|
|
222
|
-
|
|
221
|
+
// Unified condition engine: the rule wants a swap when ANY config (flat or per-set) has conditions.
|
|
222
|
+
const liberoConditionSets = data.liberoSub != null
|
|
223
|
+
? [data.liberoSub.conditions ?? [], ...(data.liberoSub.sets ?? []).map(s => s.conditions ?? [])]
|
|
223
224
|
: [];
|
|
224
|
-
const wantsLiberoSwap =
|
|
225
|
+
const wantsLiberoSwap = liberoConditionSets.some(conditions => conditions.length > 0);
|
|
225
226
|
if (wantsLiberoSwap && data.secondLibero == null) {
|
|
226
227
|
ctx.addIssue({ code: 'custom', message: 'LIBERO_SWAP_REQUIRES_SECOND_LIBERO', path: ['secondLibero'] });
|
|
227
228
|
}
|
|
@@ -23,16 +23,9 @@ export declare const TeamInputSchema: z.ZodObject<{
|
|
|
23
23
|
}, z.core.$strip>;
|
|
24
24
|
liberoReplacements: z.ZodArray<z.ZodCustom<Player, Player>>;
|
|
25
25
|
receiveRotationOffset: z.ZodDefault<z.ZodBoolean>;
|
|
26
|
-
designatedSubs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
27
|
-
sets: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
28
|
-
mode: z.ZodEnum<{
|
|
29
|
-
NEVER: "NEVER";
|
|
30
|
-
FATIGUE: "FATIGUE";
|
|
31
|
-
PINCH: "PINCH";
|
|
32
|
-
}>;
|
|
26
|
+
designatedSubs: z.ZodDefault<z.ZodArray<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodObject<{
|
|
27
|
+
sets: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodObject<{
|
|
33
28
|
bench: z.ZodOptional<z.ZodCustom<Player, Player>>;
|
|
34
|
-
fatigueBand: z.ZodOptional<z.ZodEnum<typeof import("..").EnergyBand>>;
|
|
35
|
-
benchFatigueBand: z.ZodOptional<z.ZodEnum<typeof import("..").EnergyBand>>;
|
|
36
29
|
conditions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
37
30
|
type: z.ZodLiteral<import("..").PinchConditionType.ASAP>;
|
|
38
31
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -64,9 +57,13 @@ export declare const TeamInputSchema: z.ZodObject<{
|
|
|
64
57
|
}, z.core.$strip>, z.ZodObject<{
|
|
65
58
|
type: z.ZodLiteral<import("..").PinchConditionType.PHASE>;
|
|
66
59
|
phase: z.ZodEnum<typeof import("..").MatchPhase>;
|
|
60
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
61
|
+
type: z.ZodLiteral<import("..").PinchConditionType.FATIGUE>;
|
|
62
|
+
band: z.ZodOptional<z.ZodEnum<typeof import("..").EnergyBand>>;
|
|
67
63
|
}, z.core.$strip>], "type">>>;
|
|
68
64
|
conditionLogic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"ALL">, z.ZodLiteral<"ANY">]>>;
|
|
69
65
|
pinchServer: z.ZodOptional<z.ZodBoolean>;
|
|
66
|
+
benchFatigueBand: z.ZodOptional<z.ZodEnum<typeof import("..").EnergyBand>>;
|
|
70
67
|
subBackMode: z.ZodOptional<z.ZodEnum<{
|
|
71
68
|
FATIGUE: "FATIGUE";
|
|
72
69
|
CONDITIONS: "CONDITIONS";
|
|
@@ -102,17 +99,13 @@ export declare const TeamInputSchema: z.ZodObject<{
|
|
|
102
99
|
}, z.core.$strip>, z.ZodObject<{
|
|
103
100
|
type: z.ZodLiteral<import("..").PinchConditionType.PHASE>;
|
|
104
101
|
phase: z.ZodEnum<typeof import("..").MatchPhase>;
|
|
102
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
103
|
+
type: z.ZodLiteral<import("..").PinchConditionType.FATIGUE>;
|
|
104
|
+
band: z.ZodOptional<z.ZodEnum<typeof import("..").EnergyBand>>;
|
|
105
105
|
}, z.core.$strip>], "type">>>;
|
|
106
106
|
subBackConditionLogic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"ALL">, z.ZodLiteral<"ANY">]>>;
|
|
107
|
-
}, z.core.$strip
|
|
108
|
-
mode: z.ZodEnum<{
|
|
109
|
-
NEVER: "NEVER";
|
|
110
|
-
FATIGUE: "FATIGUE";
|
|
111
|
-
PINCH: "PINCH";
|
|
112
|
-
}>;
|
|
107
|
+
}, z.core.$strip>>>>;
|
|
113
108
|
bench: z.ZodOptional<z.ZodCustom<Player, Player>>;
|
|
114
|
-
fatigueBand: z.ZodOptional<z.ZodEnum<typeof import("..").EnergyBand>>;
|
|
115
|
-
benchFatigueBand: z.ZodOptional<z.ZodEnum<typeof import("..").EnergyBand>>;
|
|
116
109
|
conditions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
117
110
|
type: z.ZodLiteral<import("..").PinchConditionType.ASAP>;
|
|
118
111
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -144,9 +137,13 @@ export declare const TeamInputSchema: z.ZodObject<{
|
|
|
144
137
|
}, z.core.$strip>, z.ZodObject<{
|
|
145
138
|
type: z.ZodLiteral<import("..").PinchConditionType.PHASE>;
|
|
146
139
|
phase: z.ZodEnum<typeof import("..").MatchPhase>;
|
|
140
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
141
|
+
type: z.ZodLiteral<import("..").PinchConditionType.FATIGUE>;
|
|
142
|
+
band: z.ZodOptional<z.ZodEnum<typeof import("..").EnergyBand>>;
|
|
147
143
|
}, z.core.$strip>], "type">>>;
|
|
148
144
|
conditionLogic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"ALL">, z.ZodLiteral<"ANY">]>>;
|
|
149
145
|
pinchServer: z.ZodOptional<z.ZodBoolean>;
|
|
146
|
+
benchFatigueBand: z.ZodOptional<z.ZodEnum<typeof import("..").EnergyBand>>;
|
|
150
147
|
subBackMode: z.ZodOptional<z.ZodEnum<{
|
|
151
148
|
FATIGUE: "FATIGUE";
|
|
152
149
|
CONDITIONS: "CONDITIONS";
|
|
@@ -182,21 +179,17 @@ export declare const TeamInputSchema: z.ZodObject<{
|
|
|
182
179
|
}, z.core.$strip>, z.ZodObject<{
|
|
183
180
|
type: z.ZodLiteral<import("..").PinchConditionType.PHASE>;
|
|
184
181
|
phase: z.ZodEnum<typeof import("..").MatchPhase>;
|
|
182
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
183
|
+
type: z.ZodLiteral<import("..").PinchConditionType.FATIGUE>;
|
|
184
|
+
band: z.ZodOptional<z.ZodEnum<typeof import("..").EnergyBand>>;
|
|
185
185
|
}, z.core.$strip>], "type">>>;
|
|
186
186
|
subBackConditionLogic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"ALL">, z.ZodLiteral<"ANY">]>>;
|
|
187
187
|
starter: z.ZodCustom<Player, Player>;
|
|
188
|
-
}, z.core.$strip
|
|
188
|
+
}, z.core.$strip>>>>;
|
|
189
189
|
substitutionBand: z.ZodDefault<z.ZodUnion<readonly [z.ZodEnum<typeof import("..").EnergyBand>, z.ZodLiteral<"NEVER">]>>;
|
|
190
190
|
secondLibero: z.ZodOptional<z.ZodCustom<Player, Player>>;
|
|
191
|
-
liberoSub: z.ZodOptional<z.ZodObject<{
|
|
192
|
-
sets: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
193
|
-
mode: z.ZodEnum<{
|
|
194
|
-
NEVER: "NEVER";
|
|
195
|
-
FATIGUE: "FATIGUE";
|
|
196
|
-
CONDITIONS: "CONDITIONS";
|
|
197
|
-
ALWAYS: "ALWAYS";
|
|
198
|
-
}>;
|
|
199
|
-
fatigueBand: z.ZodOptional<z.ZodEnum<typeof import("..").EnergyBand>>;
|
|
191
|
+
liberoSub: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodObject<{
|
|
192
|
+
sets: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodObject<{
|
|
200
193
|
conditions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
201
194
|
type: z.ZodLiteral<import("..").PinchConditionType.ASAP>;
|
|
202
195
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -228,16 +221,12 @@ export declare const TeamInputSchema: z.ZodObject<{
|
|
|
228
221
|
}, z.core.$strip>, z.ZodObject<{
|
|
229
222
|
type: z.ZodLiteral<import("..").PinchConditionType.PHASE>;
|
|
230
223
|
phase: z.ZodEnum<typeof import("..").MatchPhase>;
|
|
224
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
225
|
+
type: z.ZodLiteral<import("..").PinchConditionType.FATIGUE>;
|
|
226
|
+
band: z.ZodOptional<z.ZodEnum<typeof import("..").EnergyBand>>;
|
|
231
227
|
}, z.core.$strip>], "type">>>;
|
|
232
228
|
conditionLogic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"ALL">, z.ZodLiteral<"ANY">]>>;
|
|
233
|
-
}, z.core.$strip
|
|
234
|
-
mode: z.ZodEnum<{
|
|
235
|
-
NEVER: "NEVER";
|
|
236
|
-
FATIGUE: "FATIGUE";
|
|
237
|
-
CONDITIONS: "CONDITIONS";
|
|
238
|
-
ALWAYS: "ALWAYS";
|
|
239
|
-
}>;
|
|
240
|
-
fatigueBand: z.ZodOptional<z.ZodEnum<typeof import("..").EnergyBand>>;
|
|
229
|
+
}, z.core.$strip>>>>;
|
|
241
230
|
conditions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
242
231
|
type: z.ZodLiteral<import("..").PinchConditionType.ASAP>;
|
|
243
232
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -269,9 +258,12 @@ export declare const TeamInputSchema: z.ZodObject<{
|
|
|
269
258
|
}, z.core.$strip>, z.ZodObject<{
|
|
270
259
|
type: z.ZodLiteral<import("..").PinchConditionType.PHASE>;
|
|
271
260
|
phase: z.ZodEnum<typeof import("..").MatchPhase>;
|
|
261
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
262
|
+
type: z.ZodLiteral<import("..").PinchConditionType.FATIGUE>;
|
|
263
|
+
band: z.ZodOptional<z.ZodEnum<typeof import("..").EnergyBand>>;
|
|
272
264
|
}, z.core.$strip>], "type">>>;
|
|
273
265
|
conditionLogic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"ALL">, z.ZodLiteral<"ANY">]>>;
|
|
274
|
-
}, z.core.$strip
|
|
266
|
+
}, z.core.$strip>>>;
|
|
275
267
|
liberoReplacementSets: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodCustom<Player, Player>>>>;
|
|
276
268
|
rotationSystem: z.ZodDefault<z.ZodEnum<typeof import("..").RotationSystemEnum>>;
|
|
277
269
|
designatedSetters: z.ZodDefault<z.ZodArray<z.ZodCustom<Player, Player>>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert ONE legacy set-sub config (flat or per-set entry). Handles BOTH legacy generations:
|
|
3
|
+
* mode-era rows ({mode: NEVER|FATIGUE|PINCH}) and the oldest isPinchServer-era rows (no mode;
|
|
4
|
+
* isPinchServer flag + a 'NEVER' fatigueBand for the old never-sub state). Non-records and
|
|
5
|
+
* already-unified shapes (neither mode nor isPinchServer nor fatigueBand keys) pass through.
|
|
6
|
+
*/
|
|
7
|
+
export declare function convertLegacySetSubConfig(raw: unknown): unknown;
|
|
8
|
+
/** Convert a legacy DesignatedSub (flat fields + per-set entries); unified shapes pass through. */
|
|
9
|
+
export declare function convertLegacyDesignatedSub(raw: unknown): unknown;
|
|
10
|
+
/** Convert ONE legacy libero set-sub config; unified shapes pass through. */
|
|
11
|
+
export declare function convertLegacyLiberoSetSubConfig(raw: unknown): unknown;
|
|
12
|
+
/** Convert a legacy LiberoSubConfig (flat fields + per-set entries); unified shapes pass through. */
|
|
13
|
+
export declare function convertLegacyLiberoSubConfig(raw: unknown): unknown;
|