volleyballsimtypes 0.0.407 → 0.0.409
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/data/country-locales.json +48 -0
- package/dist/cjs/src/service/competition/schemas/tournament-match.z.js +1 -1
- package/dist/cjs/src/service/competition/tournament-match.js +1 -1
- package/dist/cjs/src/service/event/schemas/block.z.js +5 -0
- package/dist/cjs/src/service/match/schemas/box-score.z.js +1 -1
- package/dist/cjs/src/service/player/player-generator.js +2 -2
- package/dist/cjs/src/service/utils/faker-generators.js +1 -1
- package/dist/esm/src/data/country-locales.json +48 -0
- package/dist/esm/src/service/competition/schemas/tournament-match.z.js +1 -1
- package/dist/esm/src/service/competition/tournament-match.js +1 -1
- package/dist/esm/src/service/event/schemas/block.z.js +5 -0
- package/dist/esm/src/service/match/schemas/box-score.z.js +1 -1
- package/dist/esm/src/service/player/player-generator.js +2 -2
- package/dist/esm/src/service/utils/faker-generators.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,52 @@
|
|
|
1
1
|
{
|
|
2
|
+
"XA": [
|
|
3
|
+
"ja_JP"
|
|
4
|
+
],
|
|
5
|
+
"XB": [
|
|
6
|
+
"it_IT"
|
|
7
|
+
],
|
|
8
|
+
"XC": [
|
|
9
|
+
"vi_VN"
|
|
10
|
+
],
|
|
11
|
+
"XD": [
|
|
12
|
+
"id_ID"
|
|
13
|
+
],
|
|
14
|
+
"XE": [
|
|
15
|
+
"en_GB"
|
|
16
|
+
],
|
|
17
|
+
"XF": [
|
|
18
|
+
"pt_BR"
|
|
19
|
+
],
|
|
20
|
+
"XG": [
|
|
21
|
+
"zh_CN"
|
|
22
|
+
],
|
|
23
|
+
"XH": [
|
|
24
|
+
"ko_KR"
|
|
25
|
+
],
|
|
26
|
+
"XI": [
|
|
27
|
+
"ru_RU"
|
|
28
|
+
],
|
|
29
|
+
"XJ": [
|
|
30
|
+
"tr_TR"
|
|
31
|
+
],
|
|
32
|
+
"XK": [
|
|
33
|
+
"de_DE"
|
|
34
|
+
],
|
|
35
|
+
"XL": [
|
|
36
|
+
"es_MX"
|
|
37
|
+
],
|
|
38
|
+
"XM": [
|
|
39
|
+
"en_US"
|
|
40
|
+
],
|
|
41
|
+
"XN": [
|
|
42
|
+
"fr_FR"
|
|
43
|
+
],
|
|
44
|
+
"XO": [
|
|
45
|
+
"sv_SE"
|
|
46
|
+
],
|
|
47
|
+
"XP": [
|
|
48
|
+
"nl_NL"
|
|
49
|
+
],
|
|
2
50
|
"PK": [
|
|
3
51
|
"bal_Arab_PK",
|
|
4
52
|
"bal_Latn_PK",
|
|
@@ -13,7 +13,7 @@ exports.TournamentMatchInputSchema = zod_1.z.object({
|
|
|
13
13
|
if (stage_1.Stage.LEAGUE === data.stage) {
|
|
14
14
|
ctx.addIssue({ code: 'custom', message: `INVALID_STAGE: ${data.stage}`, path: ['stage'] });
|
|
15
15
|
}
|
|
16
|
-
if (data.index
|
|
16
|
+
if (data.index >= data.stage) {
|
|
17
17
|
ctx.addIssue({ code: 'custom', message: 'INDEX_OUT_OF_BOUNDS', path: ['index'] });
|
|
18
18
|
}
|
|
19
19
|
});
|
|
@@ -17,7 +17,7 @@ class TournamentMatch {
|
|
|
17
17
|
return new TournamentMatch(result.data);
|
|
18
18
|
}
|
|
19
19
|
constructor({ stage, match, index }) {
|
|
20
|
-
if (index
|
|
20
|
+
if (index >= stage || index < 0)
|
|
21
21
|
throw new Error('INDEX_OUT_OF_BOUNDS');
|
|
22
22
|
if (stage_1.Stage.LEAGUE === stage)
|
|
23
23
|
throw new Error(`INVALID_STAGE: ${stage}`);
|
|
@@ -14,4 +14,9 @@ exports.BlockInputSchema = zod_1.z.object({
|
|
|
14
14
|
failure: zod_1.z.number().int().refine((v) => blockFailureValues.includes(v), { message: 'INVALID_BLOCK_FAILURE' }),
|
|
15
15
|
type: zod_1.z.number().int().refine((v) => blockTypeValues.includes(v), { message: 'INVALID_BLOCK_TYPE' }),
|
|
16
16
|
blockers: zod_1.z.array(zod_1.z.uuid())
|
|
17
|
+
}).superRefine((data, ctx) => {
|
|
18
|
+
// The block type IS the blocker count (NO_BLOCKER=0, SINGLE=1, DOUBLE=2, TRIPLE=3), so the two must agree.
|
|
19
|
+
if (data.blockers.length !== data.type) {
|
|
20
|
+
ctx.addIssue({ code: 'custom', message: 'BLOCKERS_LENGTH_MUST_EQUAL_TYPE', path: ['blockers'] });
|
|
21
|
+
}
|
|
17
22
|
});
|
|
@@ -15,7 +15,7 @@ exports.AttackStatsSchema = zod_1.z.object({
|
|
|
15
15
|
errors: nonNegInt
|
|
16
16
|
}).superRefine((v, ctx) => {
|
|
17
17
|
if (v.errors > v.attempts) {
|
|
18
|
-
ctx.addIssue({ code: 'custom', message: 'ATTACK_ERRORS_EXCEEDS_ATTEMPTS', path: ['
|
|
18
|
+
ctx.addIssue({ code: 'custom', message: 'ATTACK_ERRORS_EXCEEDS_ATTEMPTS', path: ['errors'] });
|
|
19
19
|
}
|
|
20
20
|
});
|
|
21
21
|
exports.ServeStatsSchema = zod_1.z.object({
|
|
@@ -159,7 +159,7 @@ class PlayerGenerator {
|
|
|
159
159
|
}
|
|
160
160
|
return performance_stats_1.PerformanceStats.create(Object.fromEntries(performance_stats_1.performanceStatKeys.map((key) => key === 'stamina'
|
|
161
161
|
? [key, rollStamina(rarity)]
|
|
162
|
-
: [key,
|
|
162
|
+
: [key, (0, node_crypto_1.randomInt)(rarity_1.RarityRanges.COMMON[0], rarity_1.RarityRanges.COMMON[1] + 1)])));
|
|
163
163
|
}
|
|
164
164
|
case rarity_1.RarityEnum.RARE: {
|
|
165
165
|
if (role != null) {
|
|
@@ -284,7 +284,7 @@ function rollStamina(rarity) {
|
|
|
284
284
|
function assignValues(stat, low, high, performance) {
|
|
285
285
|
performance_stats_1.performanceStatKeys.filter((key) => stat[key] != null && stat[key] > 0)
|
|
286
286
|
.forEach((key) => {
|
|
287
|
-
const value = (0, node_crypto_1.randomInt)(low, high);
|
|
287
|
+
const value = (0, node_crypto_1.randomInt)(low, high + 1);
|
|
288
288
|
performance[key] = performance[key] < value ? value : performance[key];
|
|
289
289
|
});
|
|
290
290
|
}
|
|
@@ -1,4 +1,52 @@
|
|
|
1
1
|
{
|
|
2
|
+
"XA": [
|
|
3
|
+
"ja_JP"
|
|
4
|
+
],
|
|
5
|
+
"XB": [
|
|
6
|
+
"it_IT"
|
|
7
|
+
],
|
|
8
|
+
"XC": [
|
|
9
|
+
"vi_VN"
|
|
10
|
+
],
|
|
11
|
+
"XD": [
|
|
12
|
+
"id_ID"
|
|
13
|
+
],
|
|
14
|
+
"XE": [
|
|
15
|
+
"en_GB"
|
|
16
|
+
],
|
|
17
|
+
"XF": [
|
|
18
|
+
"pt_BR"
|
|
19
|
+
],
|
|
20
|
+
"XG": [
|
|
21
|
+
"zh_CN"
|
|
22
|
+
],
|
|
23
|
+
"XH": [
|
|
24
|
+
"ko_KR"
|
|
25
|
+
],
|
|
26
|
+
"XI": [
|
|
27
|
+
"ru_RU"
|
|
28
|
+
],
|
|
29
|
+
"XJ": [
|
|
30
|
+
"tr_TR"
|
|
31
|
+
],
|
|
32
|
+
"XK": [
|
|
33
|
+
"de_DE"
|
|
34
|
+
],
|
|
35
|
+
"XL": [
|
|
36
|
+
"es_MX"
|
|
37
|
+
],
|
|
38
|
+
"XM": [
|
|
39
|
+
"en_US"
|
|
40
|
+
],
|
|
41
|
+
"XN": [
|
|
42
|
+
"fr_FR"
|
|
43
|
+
],
|
|
44
|
+
"XO": [
|
|
45
|
+
"sv_SE"
|
|
46
|
+
],
|
|
47
|
+
"XP": [
|
|
48
|
+
"nl_NL"
|
|
49
|
+
],
|
|
2
50
|
"PK": [
|
|
3
51
|
"bal_Arab_PK",
|
|
4
52
|
"bal_Latn_PK",
|
|
@@ -10,7 +10,7 @@ export const TournamentMatchInputSchema = z.object({
|
|
|
10
10
|
if (Stage.LEAGUE === data.stage) {
|
|
11
11
|
ctx.addIssue({ code: 'custom', message: `INVALID_STAGE: ${data.stage}`, path: ['stage'] });
|
|
12
12
|
}
|
|
13
|
-
if (data.index
|
|
13
|
+
if (data.index >= data.stage) {
|
|
14
14
|
ctx.addIssue({ code: 'custom', message: 'INDEX_OUT_OF_BOUNDS', path: ['index'] });
|
|
15
15
|
}
|
|
16
16
|
});
|
|
@@ -14,7 +14,7 @@ export class TournamentMatch {
|
|
|
14
14
|
return new TournamentMatch(result.data);
|
|
15
15
|
}
|
|
16
16
|
constructor({ stage, match, index }) {
|
|
17
|
-
if (index
|
|
17
|
+
if (index >= stage || index < 0)
|
|
18
18
|
throw new Error('INDEX_OUT_OF_BOUNDS');
|
|
19
19
|
if (Stage.LEAGUE === stage)
|
|
20
20
|
throw new Error(`INVALID_STAGE: ${stage}`);
|
|
@@ -11,4 +11,9 @@ export const BlockInputSchema = z.object({
|
|
|
11
11
|
failure: z.number().int().refine((v) => blockFailureValues.includes(v), { message: 'INVALID_BLOCK_FAILURE' }),
|
|
12
12
|
type: z.number().int().refine((v) => blockTypeValues.includes(v), { message: 'INVALID_BLOCK_TYPE' }),
|
|
13
13
|
blockers: z.array(z.uuid())
|
|
14
|
+
}).superRefine((data, ctx) => {
|
|
15
|
+
// The block type IS the blocker count (NO_BLOCKER=0, SINGLE=1, DOUBLE=2, TRIPLE=3), so the two must agree.
|
|
16
|
+
if (data.blockers.length !== data.type) {
|
|
17
|
+
ctx.addIssue({ code: 'custom', message: 'BLOCKERS_LENGTH_MUST_EQUAL_TYPE', path: ['blockers'] });
|
|
18
|
+
}
|
|
14
19
|
});
|
|
@@ -12,7 +12,7 @@ export const AttackStatsSchema = z.object({
|
|
|
12
12
|
errors: nonNegInt
|
|
13
13
|
}).superRefine((v, ctx) => {
|
|
14
14
|
if (v.errors > v.attempts) {
|
|
15
|
-
ctx.addIssue({ code: 'custom', message: 'ATTACK_ERRORS_EXCEEDS_ATTEMPTS', path: ['
|
|
15
|
+
ctx.addIssue({ code: 'custom', message: 'ATTACK_ERRORS_EXCEEDS_ATTEMPTS', path: ['errors'] });
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
export const ServeStatsSchema = z.object({
|
|
@@ -154,7 +154,7 @@ export class PlayerGenerator {
|
|
|
154
154
|
}
|
|
155
155
|
return PerformanceStats.create(Object.fromEntries(performanceStatKeys.map((key) => key === 'stamina'
|
|
156
156
|
? [key, rollStamina(rarity)]
|
|
157
|
-
: [key,
|
|
157
|
+
: [key, randomInt(RarityRanges.COMMON[0], RarityRanges.COMMON[1] + 1)])));
|
|
158
158
|
}
|
|
159
159
|
case RarityEnum.RARE: {
|
|
160
160
|
if (role != null) {
|
|
@@ -278,7 +278,7 @@ function rollStamina(rarity) {
|
|
|
278
278
|
function assignValues(stat, low, high, performance) {
|
|
279
279
|
performanceStatKeys.filter((key) => stat[key] != null && stat[key] > 0)
|
|
280
280
|
.forEach((key) => {
|
|
281
|
-
const value = randomInt(low, high);
|
|
281
|
+
const value = randomInt(low, high + 1);
|
|
282
282
|
performance[key] = performance[key] < value ? value : performance[key];
|
|
283
283
|
});
|
|
284
284
|
}
|