volleyballsimtypes 0.0.526 → 0.0.528
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 +4 -2
- package/dist/cjs/src/data/init-models.js +5 -0
- package/dist/cjs/src/data/models/index.d.ts +1 -0
- package/dist/cjs/src/data/models/index.js +1 -0
- package/dist/cjs/src/data/models/team-badge.d.ts +20 -0
- package/dist/cjs/src/data/models/team-badge.js +38 -0
- package/dist/cjs/src/data/models/team-jersey.d.ts +3 -1
- package/dist/cjs/src/data/models/team-jersey.js +4 -0
- package/dist/cjs/src/data/models/team.d.ts +3 -1
- package/dist/cjs/src/data/transformers/team.js +5 -1
- package/dist/cjs/src/service/team/badge.d.ts +301 -0
- package/dist/cjs/src/service/team/badge.js +93 -0
- package/dist/cjs/src/service/team/index.d.ts +2 -0
- package/dist/cjs/src/service/team/index.js +2 -0
- package/dist/cjs/src/service/team/jersey-defaults.d.ts +13 -0
- package/dist/cjs/src/service/team/jersey-defaults.js +81 -0
- package/dist/cjs/src/service/team/jersey.d.ts +31 -0
- package/dist/cjs/src/service/team/jersey.js +137 -1
- package/dist/cjs/src/service/team/schemas/team.z.d.ts +122 -0
- package/dist/cjs/src/service/team/schemas/team.z.js +4 -1
- package/dist/cjs/src/service/team/team.d.ts +4 -1
- package/dist/cjs/src/service/team/team.js +3 -1
- package/dist/esm/src/api/index.d.ts +4 -2
- package/dist/esm/src/data/init-models.js +6 -1
- package/dist/esm/src/data/models/index.d.ts +1 -0
- package/dist/esm/src/data/models/index.js +1 -0
- package/dist/esm/src/data/models/team-badge.d.ts +20 -0
- package/dist/esm/src/data/models/team-badge.js +34 -0
- package/dist/esm/src/data/models/team-jersey.d.ts +3 -1
- package/dist/esm/src/data/models/team-jersey.js +4 -0
- package/dist/esm/src/data/models/team.d.ts +3 -1
- package/dist/esm/src/data/transformers/team.js +5 -1
- package/dist/esm/src/service/team/badge.d.ts +301 -0
- package/dist/esm/src/service/team/badge.js +90 -0
- package/dist/esm/src/service/team/index.d.ts +2 -0
- package/dist/esm/src/service/team/index.js +2 -0
- package/dist/esm/src/service/team/jersey-defaults.d.ts +13 -0
- package/dist/esm/src/service/team/jersey-defaults.js +77 -0
- package/dist/esm/src/service/team/jersey.d.ts +31 -0
- package/dist/esm/src/service/team/jersey.js +132 -0
- package/dist/esm/src/service/team/schemas/team.z.d.ts +122 -0
- package/dist/esm/src/service/team/schemas/team.z.js +5 -2
- package/dist/esm/src/service/team/team.d.ts +4 -1
- package/dist/esm/src/service/team/team.js +3 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseConfig, BoxScore, DataProps, DeclineStatus, JerseyConfig, Division as _Division, League as _League, Match as _Match, MatchSet as _MatchSet, Player as _Player, PlayerPosition, Qualifier as _Qualifier, QualifierMatch as _QualifierMatch, Rally as _Rally, RallyEvent as _RallyEvent, PointBreakdown, RallyMetrics, Season as _Season, Standing as _Standing, Team as _Team, Tournament as _Tournament, TournamentMatch as _TournamentMatch, National as _National, NationalMatch as _NationalMatch, Country as _Country, DefenceFormation, LineupFunction, CourtPosition, ConditionLogic, EnergyBand, MatchForfeitType, PerformanceStats, PinchCondition, RotationSystemEnum, SubBackMode, SubBand } from '../service';
|
|
1
|
+
import { BadgeConfig, BaseConfig, BoxScore, DataProps, DeclineStatus, JerseyConfig, Division as _Division, League as _League, Match as _Match, MatchSet as _MatchSet, Player as _Player, PlayerPosition, Qualifier as _Qualifier, QualifierMatch as _QualifierMatch, Rally as _Rally, RallyEvent as _RallyEvent, PointBreakdown, RallyMetrics, Season as _Season, Standing as _Standing, Team as _Team, Tournament as _Tournament, TournamentMatch as _TournamentMatch, National as _National, NationalMatch as _NationalMatch, Country as _Country, DefenceFormation, LineupFunction, CourtPosition, ConditionLogic, EnergyBand, MatchForfeitType, PerformanceStats, PinchCondition, RotationSystemEnum, SubBackMode, SubBand } from '../service';
|
|
2
2
|
export * from './tactics-player-refs';
|
|
3
3
|
export type Rally = DataProps<_Rally> & {
|
|
4
4
|
homePlayerPosition: PlayerPosition[];
|
|
@@ -85,6 +85,7 @@ export type Player = Omit<DataProps<_Player>, 'stats' | 'birthAge' | 'birthItera
|
|
|
85
85
|
nickname?: string;
|
|
86
86
|
jerseyConfig?: JerseyConfig;
|
|
87
87
|
championBadge?: ChampionBadgeSpec;
|
|
88
|
+
teamBadge?: BadgeConfig;
|
|
88
89
|
nationalFlagAlpha2?: string;
|
|
89
90
|
};
|
|
90
91
|
export interface StartingLineup {
|
|
@@ -196,8 +197,9 @@ export type Team = Omit<DataProps<_Team>, 'roster' | '_rating' | 'rating' | 'tac
|
|
|
196
197
|
nationalManager?: {
|
|
197
198
|
displayName: string;
|
|
198
199
|
teamId: string;
|
|
199
|
-
|
|
200
|
+
teamName: string;
|
|
200
201
|
};
|
|
202
|
+
teamBadge?: BadgeConfig;
|
|
201
203
|
};
|
|
202
204
|
export type Standing = DataProps<_Standing> & {
|
|
203
205
|
position: number;
|
|
@@ -10,6 +10,7 @@ function initModels(sequelize) {
|
|
|
10
10
|
const CurrencyTransaction = models_1.CurrencyTransactionModel.initModel(sequelize);
|
|
11
11
|
const Tactics = models_1.TacticsModel.initModel(sequelize);
|
|
12
12
|
const TeamJersey = models_1.TeamJerseyModel.initModel(sequelize);
|
|
13
|
+
const TeamBadge = models_1.TeamBadgeModel.initModel(sequelize);
|
|
13
14
|
const LineupPreset = models_1.LineupPresetModel.initModel(sequelize);
|
|
14
15
|
const MatchPreset = models_1.MatchPresetModel.initModel(sequelize);
|
|
15
16
|
const Event = models_1.EventModel.initModel(sequelize);
|
|
@@ -255,6 +256,10 @@ function initModels(sequelize) {
|
|
|
255
256
|
// and the effective-jersey resolver include it, so the simulator's team loads are unchanged.
|
|
256
257
|
Team.hasOne(TeamJersey, { as: 'TeamJersey', foreignKey: 'team_id' });
|
|
257
258
|
TeamJersey.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
|
|
259
|
+
// Saved premium badge. Same rule as TeamJersey: NOT in Team.defaultScope, included explicitly only by the
|
|
260
|
+
// management API (badge editor load), so the simulator's team loads are unchanged.
|
|
261
|
+
Team.hasOne(TeamBadge, { as: 'TeamBadge', foreignKey: 'team_id' });
|
|
262
|
+
TeamBadge.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
|
|
258
263
|
// Lineup presets are loaded only by the management API; deliberately NOT in Team.defaultScope so the
|
|
259
264
|
// simulator's team loads are unchanged (it reads the active config from the mirrored Tactics row).
|
|
260
265
|
Team.hasMany(LineupPreset, { as: 'lineupPresets', foreignKey: 'team_id' });
|
|
@@ -45,6 +45,7 @@ export * from './team';
|
|
|
45
45
|
export * from './team-replacement';
|
|
46
46
|
export * from './tactics';
|
|
47
47
|
export * from './team-jersey';
|
|
48
|
+
export * from './team-badge';
|
|
48
49
|
export * from './lineup-preset';
|
|
49
50
|
export * from './base-position-preset';
|
|
50
51
|
export * from './premium-grant';
|
|
@@ -61,6 +61,7 @@ __exportStar(require("./team"), exports);
|
|
|
61
61
|
__exportStar(require("./team-replacement"), exports);
|
|
62
62
|
__exportStar(require("./tactics"), exports);
|
|
63
63
|
__exportStar(require("./team-jersey"), exports);
|
|
64
|
+
__exportStar(require("./team-badge"), exports);
|
|
64
65
|
__exportStar(require("./lineup-preset"), exports);
|
|
65
66
|
__exportStar(require("./base-position-preset"), exports);
|
|
66
67
|
__exportStar(require("./premium-grant"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { Model } from 'sequelize';
|
|
3
|
+
import { TeamId, TeamModel } from '.';
|
|
4
|
+
import { BadgeConfig } from '../../service';
|
|
5
|
+
export interface TeamBadgeAttributes {
|
|
6
|
+
team_id: string;
|
|
7
|
+
config: BadgeConfig;
|
|
8
|
+
}
|
|
9
|
+
export type TeamBadgePk = 'team_id';
|
|
10
|
+
export type TeamBadgeId = TeamBadgeModel[TeamBadgePk];
|
|
11
|
+
export type TeamBadgeCreationAttributes = TeamBadgeAttributes;
|
|
12
|
+
export declare class TeamBadgeModel extends Model<TeamBadgeAttributes, TeamBadgeCreationAttributes> implements TeamBadgeAttributes {
|
|
13
|
+
team_id: string;
|
|
14
|
+
config: BadgeConfig;
|
|
15
|
+
team: TeamModel;
|
|
16
|
+
getTeam: Sequelize.BelongsToGetAssociationMixin<TeamModel>;
|
|
17
|
+
setTeam: Sequelize.BelongsToSetAssociationMixin<TeamModel, TeamId>;
|
|
18
|
+
createTeam: Sequelize.BelongsToCreateAssociationMixin<TeamModel>;
|
|
19
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof TeamBadgeModel;
|
|
20
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TeamBadgeModel = void 0;
|
|
4
|
+
const sequelize_1 = require("sequelize");
|
|
5
|
+
class TeamBadgeModel extends sequelize_1.Model {
|
|
6
|
+
static initModel(sequelize) {
|
|
7
|
+
return TeamBadgeModel.init({
|
|
8
|
+
team_id: {
|
|
9
|
+
type: sequelize_1.DataTypes.UUID,
|
|
10
|
+
allowNull: false,
|
|
11
|
+
primaryKey: true,
|
|
12
|
+
references: {
|
|
13
|
+
model: 'Team',
|
|
14
|
+
key: 'team_id'
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
config: {
|
|
18
|
+
type: sequelize_1.DataTypes.JSONB,
|
|
19
|
+
allowNull: false
|
|
20
|
+
}
|
|
21
|
+
}, {
|
|
22
|
+
sequelize,
|
|
23
|
+
tableName: 'TeamBadge',
|
|
24
|
+
schema: 'public',
|
|
25
|
+
timestamps: false,
|
|
26
|
+
indexes: [
|
|
27
|
+
{
|
|
28
|
+
name: 'TeamBadge_pk',
|
|
29
|
+
unique: true,
|
|
30
|
+
fields: [
|
|
31
|
+
{ name: 'team_id' }
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.TeamBadgeModel = TeamBadgeModel;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as Sequelize from 'sequelize';
|
|
2
2
|
import { Model } from 'sequelize';
|
|
3
3
|
import { TeamId, TeamModel } from '.';
|
|
4
|
-
import { JerseyConfig } from '../../service';
|
|
4
|
+
import { JerseyConfig, AlternateJerseyConfig } from '../../service';
|
|
5
5
|
export interface TeamJerseyAttributes {
|
|
6
6
|
team_id: string;
|
|
7
7
|
config: JerseyConfig;
|
|
8
|
+
alternate_config?: AlternateJerseyConfig | null;
|
|
8
9
|
}
|
|
9
10
|
export type TeamJerseyPk = 'team_id';
|
|
10
11
|
export type TeamJerseyId = TeamJerseyModel[TeamJerseyPk];
|
|
@@ -12,6 +13,7 @@ export type TeamJerseyCreationAttributes = TeamJerseyAttributes;
|
|
|
12
13
|
export declare class TeamJerseyModel extends Model<TeamJerseyAttributes, TeamJerseyCreationAttributes> implements TeamJerseyAttributes {
|
|
13
14
|
team_id: string;
|
|
14
15
|
config: JerseyConfig;
|
|
16
|
+
alternate_config?: AlternateJerseyConfig | null;
|
|
15
17
|
team: TeamModel;
|
|
16
18
|
getTeam: Sequelize.BelongsToGetAssociationMixin<TeamModel>;
|
|
17
19
|
setTeam: Sequelize.BelongsToSetAssociationMixin<TeamModel, TeamId>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Sequelize from 'sequelize';
|
|
2
2
|
import { Model, Optional } from 'sequelize';
|
|
3
|
-
import { CompetitionChampionId, CompetitionChampionModel, CompetitionId, CompetitionModel, CompetitionTeamsId, CompetitionTeamsModel, CountryId, CountryModel, DivisionAttributes, DivisionId, DivisionModel, LegacyTeamFlagModel, MatchId, MatchModel, MatchRatingId, MatchRatingModel, PlayerAttributes, PlayerId, PlayerModel, PlayerTeamId, PlayerTeamModel, RallyId, RallyModel, TacticsAttributes, TacticsId, TacticsModel, TeamJerseyModel } from '.';
|
|
3
|
+
import { CompetitionChampionId, CompetitionChampionModel, CompetitionId, CompetitionModel, CompetitionTeamsId, CompetitionTeamsModel, CountryId, CountryModel, DivisionAttributes, DivisionId, DivisionModel, LegacyTeamFlagModel, MatchId, MatchModel, MatchRatingId, MatchRatingModel, PlayerAttributes, PlayerId, PlayerModel, PlayerTeamId, PlayerTeamModel, RallyId, RallyModel, TacticsAttributes, TacticsId, TacticsModel, TeamJerseyModel, TeamBadgeModel } from '.';
|
|
4
4
|
export interface TeamAttributes {
|
|
5
5
|
team_id: string;
|
|
6
6
|
name: string;
|
|
@@ -31,6 +31,8 @@ export declare class TeamModel extends Model<TeamAttributes, TeamCreationAttribu
|
|
|
31
31
|
createTactics: Sequelize.HasOneCreateAssociationMixin<TacticsModel>;
|
|
32
32
|
TeamJersey?: TeamJerseyModel;
|
|
33
33
|
getTeamJersey: Sequelize.HasOneGetAssociationMixin<TeamJerseyModel>;
|
|
34
|
+
TeamBadge?: TeamBadgeModel;
|
|
35
|
+
getTeamBadge: Sequelize.HasOneGetAssociationMixin<TeamBadgeModel>;
|
|
34
36
|
country: CountryModel;
|
|
35
37
|
getCountry: Sequelize.BelongsToGetAssociationMixin<CountryModel>;
|
|
36
38
|
setCountry: Sequelize.BelongsToSetAssociationMixin<CountryModel, CountryId>;
|
|
@@ -53,6 +53,10 @@ function transformToObject(model, currentIteration, tacticsOverride) {
|
|
|
53
53
|
divisionId: model.division_id,
|
|
54
54
|
// Present only when the caller explicitly included the TeamJersey association (editor / effective-jersey
|
|
55
55
|
// resolver); undefined on ordinary team loads, which heals to the id-derived default in the UI.
|
|
56
|
-
jerseyConfig: model.TeamJersey?.config
|
|
56
|
+
jerseyConfig: model.TeamJersey?.config,
|
|
57
|
+
alternateJerseyConfig: model.TeamJersey?.alternate_config ?? undefined,
|
|
58
|
+
// Present only when the caller explicitly included the TeamBadge association (the badge editor load);
|
|
59
|
+
// undefined on ordinary team loads.
|
|
60
|
+
badgeConfig: model.TeamBadge?.config
|
|
57
61
|
});
|
|
58
62
|
}
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const BADGE_CANVAS = 200;
|
|
3
|
+
export declare const BADGE_ICONS: readonly ["star", "crown", "bolt", "fire", "heart", "gem", "skull", "ghost", "anchor", "compass", "sun", "moon", "snowflake", "leaf", "seedling", "tree", "mountain", "water", "wind", "meteor", "rocket", "bell", "flag", "feather", "shield-halved", "chess-knight", "chess-rook", "hammer", "crosshairs", "medal", "trophy", "award", "volleyball", "dragon", "cat", "crow", "turtle", "unicorn", "horse", "dove", "fish", "paw", "spider", "otter", "frog", "dog"];
|
|
4
|
+
export type BadgeIconName = typeof BADGE_ICONS[number];
|
|
5
|
+
export declare const BADGE_TEXT_FONTS: readonly ["sans", "wide", "mono", "serif", "block", "permanentMarker", "kaushanScript", "russoOne", "teko", "saira", "michroma", "zillaSlab", "changaOne", "stardosStencil", "wallpoet", "orbitron", "tourney", "bebasNeue", "anton", "jersey25"];
|
|
6
|
+
export type BadgeTextFont = typeof BADGE_TEXT_FONTS[number];
|
|
7
|
+
export declare const BADGE_SHAPES: readonly ["star5-solid", "star5-slim-solid", "star6-solid", "cross-solid", "star5-outline", "star5-slim-outline", "star6-outline", "cross-outline", "pentagon-solid", "hexagon-solid", "octagon-solid", "pentagon-outline", "hexagon-outline", "octagon-outline", "square-solid", "triangle-solid", "diamond-solid", "square-outline", "triangle-outline", "diamond-outline", "rectangle-solid", "burst-solid", "trapezoid-solid", "rectangle-outline", "burst-outline", "trapezoid-outline", "circle-solid", "heptagon-solid", "nonagon-solid", "ellipse-solid", "parallelogram-solid", "heart-solid", "moon-solid", "semicircle-solid", "triangle-right-solid", "triangle-tall-solid", "trapezoid-tall-solid", "kite-solid"];
|
|
8
|
+
export type BadgeShapeName = typeof BADGE_SHAPES[number];
|
|
9
|
+
declare const shapeLayer: z.ZodObject<{
|
|
10
|
+
x: z.ZodNumber;
|
|
11
|
+
y: z.ZodNumber;
|
|
12
|
+
size: z.ZodNumber;
|
|
13
|
+
rotation: z.ZodNumber;
|
|
14
|
+
type: z.ZodLiteral<"shape">;
|
|
15
|
+
shape: z.ZodString;
|
|
16
|
+
colors: z.ZodArray<z.ZodString>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
declare const iconLayer: z.ZodObject<{
|
|
19
|
+
x: z.ZodNumber;
|
|
20
|
+
y: z.ZodNumber;
|
|
21
|
+
size: z.ZodNumber;
|
|
22
|
+
rotation: z.ZodNumber;
|
|
23
|
+
type: z.ZodLiteral<"icon">;
|
|
24
|
+
icon: z.ZodEnum<{
|
|
25
|
+
star: "star";
|
|
26
|
+
crown: "crown";
|
|
27
|
+
bolt: "bolt";
|
|
28
|
+
fire: "fire";
|
|
29
|
+
heart: "heart";
|
|
30
|
+
gem: "gem";
|
|
31
|
+
skull: "skull";
|
|
32
|
+
ghost: "ghost";
|
|
33
|
+
anchor: "anchor";
|
|
34
|
+
compass: "compass";
|
|
35
|
+
sun: "sun";
|
|
36
|
+
moon: "moon";
|
|
37
|
+
snowflake: "snowflake";
|
|
38
|
+
leaf: "leaf";
|
|
39
|
+
seedling: "seedling";
|
|
40
|
+
tree: "tree";
|
|
41
|
+
mountain: "mountain";
|
|
42
|
+
water: "water";
|
|
43
|
+
wind: "wind";
|
|
44
|
+
meteor: "meteor";
|
|
45
|
+
rocket: "rocket";
|
|
46
|
+
bell: "bell";
|
|
47
|
+
flag: "flag";
|
|
48
|
+
feather: "feather";
|
|
49
|
+
"shield-halved": "shield-halved";
|
|
50
|
+
"chess-knight": "chess-knight";
|
|
51
|
+
"chess-rook": "chess-rook";
|
|
52
|
+
hammer: "hammer";
|
|
53
|
+
crosshairs: "crosshairs";
|
|
54
|
+
medal: "medal";
|
|
55
|
+
trophy: "trophy";
|
|
56
|
+
award: "award";
|
|
57
|
+
volleyball: "volleyball";
|
|
58
|
+
dragon: "dragon";
|
|
59
|
+
cat: "cat";
|
|
60
|
+
crow: "crow";
|
|
61
|
+
turtle: "turtle";
|
|
62
|
+
unicorn: "unicorn";
|
|
63
|
+
horse: "horse";
|
|
64
|
+
dove: "dove";
|
|
65
|
+
fish: "fish";
|
|
66
|
+
paw: "paw";
|
|
67
|
+
spider: "spider";
|
|
68
|
+
otter: "otter";
|
|
69
|
+
frog: "frog";
|
|
70
|
+
dog: "dog";
|
|
71
|
+
}>;
|
|
72
|
+
color: z.ZodString;
|
|
73
|
+
}, z.core.$strip>;
|
|
74
|
+
declare const textLayer: z.ZodObject<{
|
|
75
|
+
x: z.ZodNumber;
|
|
76
|
+
y: z.ZodNumber;
|
|
77
|
+
size: z.ZodNumber;
|
|
78
|
+
rotation: z.ZodNumber;
|
|
79
|
+
type: z.ZodLiteral<"text">;
|
|
80
|
+
text: z.ZodString;
|
|
81
|
+
font: z.ZodEnum<{
|
|
82
|
+
block: "block";
|
|
83
|
+
sans: "sans";
|
|
84
|
+
wide: "wide";
|
|
85
|
+
mono: "mono";
|
|
86
|
+
serif: "serif";
|
|
87
|
+
permanentMarker: "permanentMarker";
|
|
88
|
+
kaushanScript: "kaushanScript";
|
|
89
|
+
russoOne: "russoOne";
|
|
90
|
+
teko: "teko";
|
|
91
|
+
saira: "saira";
|
|
92
|
+
michroma: "michroma";
|
|
93
|
+
zillaSlab: "zillaSlab";
|
|
94
|
+
changaOne: "changaOne";
|
|
95
|
+
stardosStencil: "stardosStencil";
|
|
96
|
+
wallpoet: "wallpoet";
|
|
97
|
+
orbitron: "orbitron";
|
|
98
|
+
tourney: "tourney";
|
|
99
|
+
bebasNeue: "bebasNeue";
|
|
100
|
+
anton: "anton";
|
|
101
|
+
jersey25: "jersey25";
|
|
102
|
+
}>;
|
|
103
|
+
color: z.ZodString;
|
|
104
|
+
}, z.core.$strip>;
|
|
105
|
+
export declare const BadgeLayerSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
106
|
+
x: z.ZodNumber;
|
|
107
|
+
y: z.ZodNumber;
|
|
108
|
+
size: z.ZodNumber;
|
|
109
|
+
rotation: z.ZodNumber;
|
|
110
|
+
type: z.ZodLiteral<"shape">;
|
|
111
|
+
shape: z.ZodString;
|
|
112
|
+
colors: z.ZodArray<z.ZodString>;
|
|
113
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
114
|
+
x: z.ZodNumber;
|
|
115
|
+
y: z.ZodNumber;
|
|
116
|
+
size: z.ZodNumber;
|
|
117
|
+
rotation: z.ZodNumber;
|
|
118
|
+
type: z.ZodLiteral<"icon">;
|
|
119
|
+
icon: z.ZodEnum<{
|
|
120
|
+
star: "star";
|
|
121
|
+
crown: "crown";
|
|
122
|
+
bolt: "bolt";
|
|
123
|
+
fire: "fire";
|
|
124
|
+
heart: "heart";
|
|
125
|
+
gem: "gem";
|
|
126
|
+
skull: "skull";
|
|
127
|
+
ghost: "ghost";
|
|
128
|
+
anchor: "anchor";
|
|
129
|
+
compass: "compass";
|
|
130
|
+
sun: "sun";
|
|
131
|
+
moon: "moon";
|
|
132
|
+
snowflake: "snowflake";
|
|
133
|
+
leaf: "leaf";
|
|
134
|
+
seedling: "seedling";
|
|
135
|
+
tree: "tree";
|
|
136
|
+
mountain: "mountain";
|
|
137
|
+
water: "water";
|
|
138
|
+
wind: "wind";
|
|
139
|
+
meteor: "meteor";
|
|
140
|
+
rocket: "rocket";
|
|
141
|
+
bell: "bell";
|
|
142
|
+
flag: "flag";
|
|
143
|
+
feather: "feather";
|
|
144
|
+
"shield-halved": "shield-halved";
|
|
145
|
+
"chess-knight": "chess-knight";
|
|
146
|
+
"chess-rook": "chess-rook";
|
|
147
|
+
hammer: "hammer";
|
|
148
|
+
crosshairs: "crosshairs";
|
|
149
|
+
medal: "medal";
|
|
150
|
+
trophy: "trophy";
|
|
151
|
+
award: "award";
|
|
152
|
+
volleyball: "volleyball";
|
|
153
|
+
dragon: "dragon";
|
|
154
|
+
cat: "cat";
|
|
155
|
+
crow: "crow";
|
|
156
|
+
turtle: "turtle";
|
|
157
|
+
unicorn: "unicorn";
|
|
158
|
+
horse: "horse";
|
|
159
|
+
dove: "dove";
|
|
160
|
+
fish: "fish";
|
|
161
|
+
paw: "paw";
|
|
162
|
+
spider: "spider";
|
|
163
|
+
otter: "otter";
|
|
164
|
+
frog: "frog";
|
|
165
|
+
dog: "dog";
|
|
166
|
+
}>;
|
|
167
|
+
color: z.ZodString;
|
|
168
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
169
|
+
x: z.ZodNumber;
|
|
170
|
+
y: z.ZodNumber;
|
|
171
|
+
size: z.ZodNumber;
|
|
172
|
+
rotation: z.ZodNumber;
|
|
173
|
+
type: z.ZodLiteral<"text">;
|
|
174
|
+
text: z.ZodString;
|
|
175
|
+
font: z.ZodEnum<{
|
|
176
|
+
block: "block";
|
|
177
|
+
sans: "sans";
|
|
178
|
+
wide: "wide";
|
|
179
|
+
mono: "mono";
|
|
180
|
+
serif: "serif";
|
|
181
|
+
permanentMarker: "permanentMarker";
|
|
182
|
+
kaushanScript: "kaushanScript";
|
|
183
|
+
russoOne: "russoOne";
|
|
184
|
+
teko: "teko";
|
|
185
|
+
saira: "saira";
|
|
186
|
+
michroma: "michroma";
|
|
187
|
+
zillaSlab: "zillaSlab";
|
|
188
|
+
changaOne: "changaOne";
|
|
189
|
+
stardosStencil: "stardosStencil";
|
|
190
|
+
wallpoet: "wallpoet";
|
|
191
|
+
orbitron: "orbitron";
|
|
192
|
+
tourney: "tourney";
|
|
193
|
+
bebasNeue: "bebasNeue";
|
|
194
|
+
anton: "anton";
|
|
195
|
+
jersey25: "jersey25";
|
|
196
|
+
}>;
|
|
197
|
+
color: z.ZodString;
|
|
198
|
+
}, z.core.$strip>], "type">;
|
|
199
|
+
export declare const BADGE_MAX_LAYERS = 25;
|
|
200
|
+
export declare const BadgeSchema: z.ZodObject<{
|
|
201
|
+
layers: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
202
|
+
x: z.ZodNumber;
|
|
203
|
+
y: z.ZodNumber;
|
|
204
|
+
size: z.ZodNumber;
|
|
205
|
+
rotation: z.ZodNumber;
|
|
206
|
+
type: z.ZodLiteral<"shape">;
|
|
207
|
+
shape: z.ZodString;
|
|
208
|
+
colors: z.ZodArray<z.ZodString>;
|
|
209
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
210
|
+
x: z.ZodNumber;
|
|
211
|
+
y: z.ZodNumber;
|
|
212
|
+
size: z.ZodNumber;
|
|
213
|
+
rotation: z.ZodNumber;
|
|
214
|
+
type: z.ZodLiteral<"icon">;
|
|
215
|
+
icon: z.ZodEnum<{
|
|
216
|
+
star: "star";
|
|
217
|
+
crown: "crown";
|
|
218
|
+
bolt: "bolt";
|
|
219
|
+
fire: "fire";
|
|
220
|
+
heart: "heart";
|
|
221
|
+
gem: "gem";
|
|
222
|
+
skull: "skull";
|
|
223
|
+
ghost: "ghost";
|
|
224
|
+
anchor: "anchor";
|
|
225
|
+
compass: "compass";
|
|
226
|
+
sun: "sun";
|
|
227
|
+
moon: "moon";
|
|
228
|
+
snowflake: "snowflake";
|
|
229
|
+
leaf: "leaf";
|
|
230
|
+
seedling: "seedling";
|
|
231
|
+
tree: "tree";
|
|
232
|
+
mountain: "mountain";
|
|
233
|
+
water: "water";
|
|
234
|
+
wind: "wind";
|
|
235
|
+
meteor: "meteor";
|
|
236
|
+
rocket: "rocket";
|
|
237
|
+
bell: "bell";
|
|
238
|
+
flag: "flag";
|
|
239
|
+
feather: "feather";
|
|
240
|
+
"shield-halved": "shield-halved";
|
|
241
|
+
"chess-knight": "chess-knight";
|
|
242
|
+
"chess-rook": "chess-rook";
|
|
243
|
+
hammer: "hammer";
|
|
244
|
+
crosshairs: "crosshairs";
|
|
245
|
+
medal: "medal";
|
|
246
|
+
trophy: "trophy";
|
|
247
|
+
award: "award";
|
|
248
|
+
volleyball: "volleyball";
|
|
249
|
+
dragon: "dragon";
|
|
250
|
+
cat: "cat";
|
|
251
|
+
crow: "crow";
|
|
252
|
+
turtle: "turtle";
|
|
253
|
+
unicorn: "unicorn";
|
|
254
|
+
horse: "horse";
|
|
255
|
+
dove: "dove";
|
|
256
|
+
fish: "fish";
|
|
257
|
+
paw: "paw";
|
|
258
|
+
spider: "spider";
|
|
259
|
+
otter: "otter";
|
|
260
|
+
frog: "frog";
|
|
261
|
+
dog: "dog";
|
|
262
|
+
}>;
|
|
263
|
+
color: z.ZodString;
|
|
264
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
265
|
+
x: z.ZodNumber;
|
|
266
|
+
y: z.ZodNumber;
|
|
267
|
+
size: z.ZodNumber;
|
|
268
|
+
rotation: z.ZodNumber;
|
|
269
|
+
type: z.ZodLiteral<"text">;
|
|
270
|
+
text: z.ZodString;
|
|
271
|
+
font: z.ZodEnum<{
|
|
272
|
+
block: "block";
|
|
273
|
+
sans: "sans";
|
|
274
|
+
wide: "wide";
|
|
275
|
+
mono: "mono";
|
|
276
|
+
serif: "serif";
|
|
277
|
+
permanentMarker: "permanentMarker";
|
|
278
|
+
kaushanScript: "kaushanScript";
|
|
279
|
+
russoOne: "russoOne";
|
|
280
|
+
teko: "teko";
|
|
281
|
+
saira: "saira";
|
|
282
|
+
michroma: "michroma";
|
|
283
|
+
zillaSlab: "zillaSlab";
|
|
284
|
+
changaOne: "changaOne";
|
|
285
|
+
stardosStencil: "stardosStencil";
|
|
286
|
+
wallpoet: "wallpoet";
|
|
287
|
+
orbitron: "orbitron";
|
|
288
|
+
tourney: "tourney";
|
|
289
|
+
bebasNeue: "bebasNeue";
|
|
290
|
+
anton: "anton";
|
|
291
|
+
jersey25: "jersey25";
|
|
292
|
+
}>;
|
|
293
|
+
color: z.ZodString;
|
|
294
|
+
}, z.core.$strip>], "type">>;
|
|
295
|
+
}, z.core.$strip>;
|
|
296
|
+
export type BadgeConfig = z.infer<typeof BadgeSchema>;
|
|
297
|
+
export type BadgeLayer = z.infer<typeof BadgeLayerSchema>;
|
|
298
|
+
export type BadgeShapeLayer = z.infer<typeof shapeLayer>;
|
|
299
|
+
export type BadgeIconLayer = z.infer<typeof iconLayer>;
|
|
300
|
+
export type BadgeTextLayer = z.infer<typeof textLayer>;
|
|
301
|
+
export {};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BadgeSchema = exports.BADGE_MAX_LAYERS = exports.BadgeLayerSchema = exports.BADGE_SHAPES = exports.BADGE_TEXT_FONTS = exports.BADGE_ICONS = exports.BADGE_CANVAS = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
// 6-digit hex (#rrggbb) or 8-digit hex with alpha (#rrggbbaa), the same convention as the jersey colours (the
|
|
6
|
+
// 8-digit form comes from the UI's opacity-enabled colour pickers; SVG fills render both).
|
|
7
|
+
const hexColor = zod_1.z.string().regex(/^#[0-9a-fA-F]{6}([0-9a-fA-F]{2})?$/, 'INVALID_HEX_COLOR');
|
|
8
|
+
// The badge canvas is a fixed square coordinate space. Layer x/y are the layer's centre in canvas units and
|
|
9
|
+
// `size` is the layer's height in the same units; positions may overhang the canvas a little (clipped at render).
|
|
10
|
+
exports.BADGE_CANVAS = 200;
|
|
11
|
+
// Curated FontAwesome icon names offered as badge layers (owner decision 2026-08-31: curated set, not a full
|
|
12
|
+
// catalog). The UI maps each name to its solid-icon path data (view/badge/badge-icons.ts, a Record keyed by this
|
|
13
|
+
// type so the two lists cannot drift); this list is what the API validates against.
|
|
14
|
+
exports.BADGE_ICONS = [
|
|
15
|
+
'star', 'crown', 'bolt', 'fire', 'heart', 'gem', 'skull', 'ghost', 'anchor', 'compass',
|
|
16
|
+
'sun', 'moon', 'snowflake', 'leaf', 'seedling', 'tree', 'mountain', 'water', 'wind', 'meteor',
|
|
17
|
+
'rocket', 'bell', 'flag', 'feather', 'shield-halved', 'chess-knight', 'chess-rook', 'hammer', 'crosshairs',
|
|
18
|
+
'medal', 'trophy', 'award', 'volleyball', 'dragon', 'cat', 'crow', 'turtle', 'unicorn', 'horse', 'dove',
|
|
19
|
+
'fish', 'paw', 'spider', 'otter', 'frog', 'dog'
|
|
20
|
+
];
|
|
21
|
+
// Text layers offer the same 20 faces as the jersey number editor (JERSEY_FONT_ALL): five generic stacks, then
|
|
22
|
+
// the fifteen display families. The jersey renders its number from GENERATED DIGIT GLYPHS because it lives in a
|
|
23
|
+
// data-uri <img> where @font-face does not load; the badge canvas is inline SVG in the document, so it uses the
|
|
24
|
+
// real webfonts instead, which also means badge text is not limited to the digits those glyph sets cover.
|
|
25
|
+
exports.BADGE_TEXT_FONTS = [
|
|
26
|
+
'sans', 'wide', 'mono', 'serif', 'block',
|
|
27
|
+
'permanentMarker', 'kaushanScript', 'russoOne', 'teko', 'saira', 'michroma', 'zillaSlab', 'changaOne',
|
|
28
|
+
'stardosStencil', 'wallpoet', 'orbitron', 'tourney', 'bebasNeue', 'anton', 'jersey25'
|
|
29
|
+
];
|
|
30
|
+
// Basic geometric shapes (VolleyballSimUI/public/shapes), extracted from the two source sets 2026-08-31. The
|
|
31
|
+
// crest sets are positional (shield-a01, ribbon-07), but these are named, so the vocabulary is spelled out
|
|
32
|
+
// rather than pattern-matched: this list IS the allow list, and every entry has a file of the same name.
|
|
33
|
+
// `-outline` is the hollow cut, whose interior is a real hole in the path (so layers underneath show through,
|
|
34
|
+
// no transparent fill slot needed). Order is the picker order, grouped by family.
|
|
35
|
+
// The rounded-corner cut of every shape, plus the split square and the pie, were dropped by the owner
|
|
36
|
+
// 2026-08-31; only the sharp cuts ship.
|
|
37
|
+
exports.BADGE_SHAPES = [
|
|
38
|
+
'star5-solid', 'star5-slim-solid', 'star6-solid', 'cross-solid',
|
|
39
|
+
'star5-outline', 'star5-slim-outline', 'star6-outline', 'cross-outline',
|
|
40
|
+
'pentagon-solid', 'hexagon-solid', 'octagon-solid',
|
|
41
|
+
'pentagon-outline', 'hexagon-outline', 'octagon-outline',
|
|
42
|
+
'square-solid', 'triangle-solid', 'diamond-solid',
|
|
43
|
+
'square-outline', 'triangle-outline', 'diamond-outline',
|
|
44
|
+
'rectangle-solid', 'burst-solid', 'trapezoid-solid',
|
|
45
|
+
'rectangle-outline', 'burst-outline', 'trapezoid-outline',
|
|
46
|
+
'circle-solid', 'heptagon-solid', 'nonagon-solid', 'ellipse-solid', 'parallelogram-solid',
|
|
47
|
+
'heart-solid', 'moon-solid', 'semicircle-solid', 'triangle-right-solid', 'triangle-tall-solid',
|
|
48
|
+
'trapezoid-tall-solid', 'kite-solid'
|
|
49
|
+
];
|
|
50
|
+
// The extracted vector sets in VolleyballSimUI/public/shields + public/ribbons + public/shapes:
|
|
51
|
+
// shield-a01..a17 / shield-b01..b16, each -solid|-bordered|-outline; ribbon-01..ribbon-49; and shape-<name>
|
|
52
|
+
// for every name in BADGE_SHAPES.
|
|
53
|
+
const CREST_ID = /^(shield-(a(0[1-9]|1[0-7])|b(0[1-9]|1[0-6]))-(solid|bordered|outline)|ribbon-(0[1-9]|[1-4][0-9]))$/;
|
|
54
|
+
const BASIC_ID = new RegExp(`^shape-(${exports.BADGE_SHAPES.join('|')})$`);
|
|
55
|
+
const shapeId = zod_1.z.string().refine(v => CREST_ID.test(v) || BASIC_ID.test(v), 'INVALID_BADGE_SHAPE');
|
|
56
|
+
const layerBase = {
|
|
57
|
+
x: zod_1.z.number().min(-100).max(300),
|
|
58
|
+
y: zod_1.z.number().min(-100).max(300),
|
|
59
|
+
size: zod_1.z.number().min(4).max(400),
|
|
60
|
+
rotation: zod_1.z.number().min(-180).max(180)
|
|
61
|
+
};
|
|
62
|
+
// One colour per DISTINCT fill in the source art (solid shields 1, bordered 3, ribbons up to 4, basic shapes 1),
|
|
63
|
+
// applied in the order the fills first appear in the file. Extra entries are ignored at render; missing ones
|
|
64
|
+
// fall back to the source colour.
|
|
65
|
+
const shapeLayer = zod_1.z.object({
|
|
66
|
+
type: zod_1.z.literal('shape'),
|
|
67
|
+
shape: shapeId,
|
|
68
|
+
colors: zod_1.z.array(hexColor).min(1).max(6),
|
|
69
|
+
...layerBase
|
|
70
|
+
});
|
|
71
|
+
const iconLayer = zod_1.z.object({
|
|
72
|
+
type: zod_1.z.literal('icon'),
|
|
73
|
+
icon: zod_1.z.enum(exports.BADGE_ICONS),
|
|
74
|
+
color: hexColor,
|
|
75
|
+
...layerBase
|
|
76
|
+
});
|
|
77
|
+
const textLayer = zod_1.z.object({
|
|
78
|
+
type: zod_1.z.literal('text'),
|
|
79
|
+
text: zod_1.z.string().min(1).max(24),
|
|
80
|
+
font: zod_1.z.enum(exports.BADGE_TEXT_FONTS),
|
|
81
|
+
color: hexColor,
|
|
82
|
+
...layerBase
|
|
83
|
+
});
|
|
84
|
+
exports.BadgeLayerSchema = zod_1.z.discriminatedUnion('type', [shapeLayer, iconLayer, textLayer]);
|
|
85
|
+
// The most layers one badge may stack. Not a technical ceiling (25 layers is under 3 KB of jsonb and a trivial
|
|
86
|
+
// number of SVG paths): past roughly a dozen you cannot tell the elements apart at the size a crest is shown,
|
|
87
|
+
// and the one-step-per-click reordering gets tedious. Exported so the editor gates on the SAME number the save
|
|
88
|
+
// validates against, rather than keeping its own copy that can drift.
|
|
89
|
+
exports.BADGE_MAX_LAYERS = 25;
|
|
90
|
+
// The full team badge: an ordered stack of layers (index 0 renders first, i.e. at the back).
|
|
91
|
+
exports.BadgeSchema = zod_1.z.object({
|
|
92
|
+
layers: zod_1.z.array(exports.BadgeLayerSchema).min(1).max(exports.BADGE_MAX_LAYERS)
|
|
93
|
+
});
|
|
@@ -16,6 +16,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./team"), exports);
|
|
18
18
|
__exportStar(require("./jersey"), exports);
|
|
19
|
+
__exportStar(require("./jersey-defaults"), exports);
|
|
20
|
+
__exportStar(require("./badge"), exports);
|
|
19
21
|
__exportStar(require("./team-generator"), exports);
|
|
20
22
|
__exportStar(require("./formation"), exports);
|
|
21
23
|
__exportStar(require("./tactics"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { JerseyConfig, JerseyClothing, JerseyPattern, JerseyFont } from './jersey';
|
|
2
|
+
export interface JerseyPalette {
|
|
3
|
+
color1: string;
|
|
4
|
+
color2: string;
|
|
5
|
+
color3: string;
|
|
6
|
+
number1: string;
|
|
7
|
+
number2: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const JERSEY_PALETTES: readonly JerseyPalette[];
|
|
10
|
+
export declare const JERSEY_PATTERN_ORDER: readonly JerseyPattern[];
|
|
11
|
+
export declare const JERSEY_CLOTHING_ORDER: readonly JerseyClothing[];
|
|
12
|
+
export declare const JERSEY_FONT_ORDER: readonly JerseyFont[];
|
|
13
|
+
export declare function jerseyFromTeamId(teamId: string): JerseyConfig;
|