@battle-racing/br-common-lib 4.1.0 → 4.3.0
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/__deprecated__/constants/checkpoint-type.d.ts +6 -0
- package/dist/__deprecated__/constants/checkpoint-type.js +9 -0
- package/dist/__deprecated__/constants/hardware/base-hardware-status.d.ts +6 -0
- package/dist/__deprecated__/constants/hardware/base-hardware-status.js +9 -0
- package/dist/__deprecated__/constants/hardware/damage.d.ts +10 -0
- package/dist/__deprecated__/constants/hardware/damage.js +13 -0
- package/dist/__deprecated__/constants/hardware/flag-media-name.d.ts +63 -0
- package/dist/__deprecated__/constants/hardware/flag-media-name.js +71 -0
- package/dist/__deprecated__/constants/hardware/flag-status.d.ts +10 -0
- package/dist/__deprecated__/constants/hardware/flag-status.js +11 -0
- package/dist/__deprecated__/constants/hardware/index.js +25 -0
- package/dist/__deprecated__/constants/hardware/lights-effect.d.ts +10 -0
- package/dist/__deprecated__/constants/hardware/lights-effect.js +14 -0
- package/dist/__deprecated__/constants/hardware/rgb-status.d.ts +8 -0
- package/dist/__deprecated__/constants/hardware/rgb-status.js +11 -0
- package/dist/__deprecated__/constants/hardware/screen-status.d.ts +7 -0
- package/dist/__deprecated__/constants/hardware/screen-status.js +8 -0
- package/dist/__deprecated__/constants/hardware/screen-view.d.ts +9 -0
- package/dist/__deprecated__/constants/hardware/screen-view.js +12 -0
- package/dist/__deprecated__/constants/hardware/speed-status.d.ts +9 -0
- package/dist/__deprecated__/constants/hardware/speed-status.js +10 -0
- package/dist/__deprecated__/constants/index.js +25 -0
- package/dist/__deprecated__/constants/kart-status.d.ts +12 -0
- package/dist/__deprecated__/constants/kart-status.js +15 -0
- package/dist/__deprecated__/constants/module-name.d.ts +12 -0
- package/dist/__deprecated__/constants/module-name.js +15 -0
- package/dist/__deprecated__/constants/payment-provider.d.ts +5 -0
- package/dist/__deprecated__/constants/payment-provider.js +8 -0
- package/dist/__deprecated__/constants/payment-status.d.ts +7 -0
- package/dist/__deprecated__/constants/payment-status.js +10 -0
- package/dist/__deprecated__/constants/permission.d.ts +12 -0
- package/dist/__deprecated__/constants/permission.js +15 -0
- package/dist/__deprecated__/constants/racing-team-role.d.ts +5 -0
- package/dist/__deprecated__/constants/racing-team-role.js +8 -0
- package/dist/__deprecated__/constants/user-role.d.ts +5 -0
- package/dist/__deprecated__/constants/user-role.js +8 -0
- package/dist/__deprecated__/types/checkpoint/CheckpointType.d.ts +1 -1
- package/dist/__deprecated__/types/damage/DamageName.d.ts +1 -1
- package/dist/__deprecated__/types/hardware/ModuleName.d.ts +1 -1
- package/dist/__deprecated__/types/hardware/flag/FlagMediaName.d.ts +1 -1
- package/dist/__deprecated__/types/hardware/flag/FlagStatus.d.ts +1 -1
- package/dist/__deprecated__/types/hardware/lights/LightsEffect.d.ts +1 -1
- package/dist/__deprecated__/types/hardware/rgb/RGBStatus.d.ts +1 -1
- package/dist/__deprecated__/types/hardware/screen/ScreenFinishViewInput.d.ts +1 -1
- package/dist/__deprecated__/types/hardware/screen/ScreenStatus.d.ts +1 -1
- package/dist/__deprecated__/types/hardware/screen/ScreenView.d.ts +1 -1
- package/dist/__deprecated__/types/hardware/speed/SpeedStatus.d.ts +1 -1
- package/dist/__deprecated__/types/kart/KartStatus.d.ts +1 -1
- package/dist/__deprecated__/types/racingTeam/RacingTeamMembership.schema.js +1 -1
- package/dist/__deprecated__/types/role/Permission.d.ts +1 -1
- package/dist/__deprecated__/types/role/UserRole.d.ts +1 -1
- package/dist/__deprecated__/types/ticketing/GameTurn.schema.d.ts +4 -4
- package/dist/__deprecated__/types/ticketing/GameTurn.schema.js +2 -2
- package/dist/__deprecated__/types/ticketing/PaymentProvider.d.ts +1 -1
- package/dist/__deprecated__/types/ticketing/ticketing.schemas.d.ts +1 -2
- package/dist/__deprecated__/types/ticketing/ticketing.schemas.js +0 -1
- package/dist/__deprecated__/types/user/user.schema.js +1 -1
- package/dist/domains/damage/Damage.schema.js +4 -3
- package/dist/domains/game/race/Race.schema.d.ts +2 -2
- package/dist/domains/hardware/KartHardwareState.schema.js +10 -10
- package/dist/domains/hardware/screen/Screen.schema.d.ts +0 -52
- package/dist/domains/hardware/screen/Screen.schema.js +5 -9
- package/dist/domains/hardware/screen/Screen.types.d.ts +2 -1
- package/dist/domains/hardware/screen/ScreenDebug.schema.d.ts +53 -0
- package/dist/domains/hardware/screen/ScreenDebug.schema.js +8 -0
- package/dist/domains/hardware/screen/index.d.ts +1 -0
- package/dist/domains/hardware/screen/index.js +1 -0
- package/dist/domains/index.d.ts +2 -0
- package/dist/domains/index.js +2 -0
- package/dist/domains/kart/Kart.schema.js +2 -2
- package/dist/domains/player/Player.const.d.ts +4 -0
- package/dist/domains/player/Player.const.js +7 -0
- package/dist/domains/player/Player.schema.d.ts +57 -0
- package/dist/domains/player/Player.schema.js +48 -0
- package/dist/domains/player/Player.types.d.ts +6 -0
- package/dist/domains/player/Player.types.js +2 -0
- package/dist/domains/player/index.d.ts +3 -0
- package/dist/domains/player/index.js +19 -0
- package/dist/domains/role/Role.const.d.ts +1 -0
- package/dist/domains/role/Role.const.js +1 -0
- package/dist/domains/role/Role.schema.d.ts +1 -0
- package/dist/domains/session/Session.const.d.ts +7 -0
- package/dist/domains/session/Session.const.js +10 -0
- package/dist/domains/session/Session.schema.d.ts +65 -0
- package/dist/domains/session/Session.schema.js +47 -0
- package/dist/domains/session/Session.types.d.ts +7 -0
- package/dist/domains/session/Session.types.js +2 -0
- package/dist/domains/session/index.d.ts +3 -0
- package/dist/domains/session/index.js +19 -0
- package/dist/domains/ticketing/Ticketing.const.d.ts +5 -0
- package/dist/domains/ticketing/Ticketing.const.js +6 -1
- package/dist/domains/ticketing/Ticketing.schema.d.ts +49 -34
- package/dist/domains/ticketing/Ticketing.schema.js +26 -26
- package/dist/domains/ticketing/Ticketing.types.d.ts +2 -3
- package/dist/domains/user/User.schema.d.ts +35 -11
- package/dist/domains/user/User.schema.js +47 -9
- package/docs/USER_VS_PLAYER.md +87 -0
- package/package.json +1 -1
- package/src/__deprecated__/constants/hardware/index.ts +9 -0
- package/src/__deprecated__/constants/index.ts +9 -0
- package/src/__deprecated__/types/checkpoint/CheckpointType.ts +1 -1
- package/src/__deprecated__/types/damage/DamageName.ts +1 -1
- package/src/__deprecated__/types/hardware/ModuleName.ts +1 -1
- package/src/__deprecated__/types/hardware/flag/FlagMediaName.ts +1 -1
- package/src/__deprecated__/types/hardware/flag/FlagStatus.ts +1 -1
- package/src/__deprecated__/types/hardware/lights/LightsEffect.ts +1 -1
- package/src/__deprecated__/types/hardware/rgb/RGBStatus.ts +1 -1
- package/src/__deprecated__/types/hardware/screen/ScreenFinishViewInput.ts +1 -1
- package/src/__deprecated__/types/hardware/screen/ScreenStatus.ts +1 -1
- package/src/__deprecated__/types/hardware/screen/ScreenView.ts +1 -1
- package/src/__deprecated__/types/hardware/speed/SpeedStatus.ts +1 -1
- package/src/__deprecated__/types/kart/KartStatus.ts +1 -1
- package/src/__deprecated__/types/racingTeam/RacingTeamMembership.schema.ts +1 -1
- package/src/__deprecated__/types/role/Permission.ts +1 -1
- package/src/__deprecated__/types/role/UserRole.ts +1 -1
- package/src/__deprecated__/types/ticketing/GameTurn.schema.ts +2 -2
- package/src/__deprecated__/types/ticketing/PaymentProvider.ts +1 -1
- package/src/__deprecated__/types/ticketing/ticketing.schemas.ts +0 -1
- package/src/__deprecated__/types/user/user.schema.ts +1 -1
- package/src/domains/damage/Damage.schema.ts +2 -1
- package/src/domains/hardware/KartHardwareState.schema.ts +5 -5
- package/src/domains/hardware/screen/Screen.schema.ts +2 -7
- package/src/domains/hardware/screen/Screen.types.ts +2 -1
- package/src/domains/hardware/screen/ScreenDebug.schema.ts +6 -0
- package/src/domains/hardware/screen/index.ts +1 -0
- package/src/domains/index.ts +2 -0
- package/src/domains/kart/Kart.schema.ts +1 -1
- package/src/domains/player/Player.const.ts +4 -0
- package/src/domains/player/Player.schema.ts +55 -0
- package/src/domains/player/Player.types.ts +8 -0
- package/src/domains/player/index.ts +3 -0
- package/src/domains/role/Role.const.ts +1 -0
- package/src/domains/session/Session.const.ts +7 -0
- package/src/domains/session/Session.schema.ts +58 -0
- package/src/domains/session/Session.types.ts +14 -0
- package/src/domains/session/index.ts +3 -0
- package/src/domains/ticketing/Ticketing.const.ts +6 -0
- package/src/domains/ticketing/Ticketing.schema.ts +33 -27
- package/src/domains/ticketing/Ticketing.types.ts +2 -4
- package/src/domains/user/User.schema.ts +61 -8
- package/br-common-lib.code-workspace +0 -19
- /package/{src/constants/hardware/index.ts → dist/__deprecated__/constants/hardware/index.d.ts} +0 -0
- /package/{src/constants/index.ts → dist/__deprecated__/constants/index.d.ts} +0 -0
- /package/{MIGRATION_GUIDE.md → docs/MIGRATION_GUIDE.md} +0 -0
- /package/{REFACTOR_README.md → docs/REFACTOR_README.md} +0 -0
- /package/src/{constants → __deprecated__/constants}/checkpoint-type.ts +0 -0
- /package/src/{constants → __deprecated__/constants}/hardware/base-hardware-status.ts +0 -0
- /package/src/{constants → __deprecated__/constants}/hardware/damage.ts +0 -0
- /package/src/{constants → __deprecated__/constants}/hardware/flag-media-name.ts +0 -0
- /package/src/{constants → __deprecated__/constants}/hardware/flag-status.ts +0 -0
- /package/src/{constants → __deprecated__/constants}/hardware/lights-effect.ts +0 -0
- /package/src/{constants → __deprecated__/constants}/hardware/rgb-status.ts +0 -0
- /package/src/{constants → __deprecated__/constants}/hardware/screen-status.ts +0 -0
- /package/src/{constants → __deprecated__/constants}/hardware/screen-view.ts +0 -0
- /package/src/{constants → __deprecated__/constants}/hardware/speed-status.ts +0 -0
- /package/src/{constants → __deprecated__/constants}/kart-status.ts +0 -0
- /package/src/{constants → __deprecated__/constants}/module-name.ts +0 -0
- /package/src/{constants → __deprecated__/constants}/payment-provider.ts +0 -0
- /package/src/{constants → __deprecated__/constants}/payment-status.ts +0 -0
- /package/src/{constants → __deprecated__/constants}/permission.ts +0 -0
- /package/src/{constants → __deprecated__/constants}/racing-team-role.ts +0 -0
- /package/src/{constants → __deprecated__/constants}/user-role.ts +0 -0
|
@@ -26,9 +26,9 @@ export declare const GameTurnCheckSchema: z.ZodEnum<{
|
|
|
26
26
|
export declare const GameTurnSchema: z.ZodObject<{
|
|
27
27
|
id: z.ZodString;
|
|
28
28
|
purchaseId: z.ZodString;
|
|
29
|
-
|
|
29
|
+
leaderPlayerId: z.ZodString;
|
|
30
30
|
gameTickets: z.ZodArray<z.ZodString>;
|
|
31
|
-
|
|
31
|
+
playerIds: z.ZodArray<z.ZodString>;
|
|
32
32
|
status: z.ZodEnum<{
|
|
33
33
|
completed: "completed";
|
|
34
34
|
created: "created";
|
|
@@ -59,9 +59,9 @@ export declare const GameTurnSchema: z.ZodObject<{
|
|
|
59
59
|
export declare const GameTurnQueueItemSchema: z.ZodObject<{
|
|
60
60
|
id: z.ZodString;
|
|
61
61
|
purchaseId: z.ZodString;
|
|
62
|
-
|
|
62
|
+
leaderPlayerId: z.ZodString;
|
|
63
63
|
gameTickets: z.ZodArray<z.ZodString>;
|
|
64
|
-
|
|
64
|
+
playerIds: z.ZodArray<z.ZodString>;
|
|
65
65
|
status: z.ZodEnum<{
|
|
66
66
|
completed: "completed";
|
|
67
67
|
created: "created";
|
|
@@ -30,9 +30,9 @@ exports.GameTurnCheckSchema = zod_1.z.enum([
|
|
|
30
30
|
exports.GameTurnSchema = zod_1.z.object({
|
|
31
31
|
id: zod_1.z.string(),
|
|
32
32
|
purchaseId: zod_1.z.string(),
|
|
33
|
-
|
|
33
|
+
leaderPlayerId: zod_1.z.string(),
|
|
34
34
|
gameTickets: zod_1.z.array(zod_1.z.string()),
|
|
35
|
-
|
|
35
|
+
playerIds: zod_1.z.array(zod_1.z.string()),
|
|
36
36
|
status: exports.GameTurnStatusSchema,
|
|
37
37
|
tasks: zod_1.z.array(GameTurnTask_schema_1.GameTurnTaskSchema),
|
|
38
38
|
createdAt: zod_1.z.date(),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PAYMENT_PROVIDERS, PAYMENT_STATUSES } from '
|
|
1
|
+
import { PAYMENT_PROVIDERS, PAYMENT_STATUSES } from '../../constants';
|
|
2
2
|
export type PaymentProviderName = (typeof PAYMENT_PROVIDERS)[keyof typeof PAYMENT_PROVIDERS];
|
|
3
3
|
export type PaymentStatus = (typeof PAYMENT_STATUSES)[keyof typeof PAYMENT_STATUSES];
|
|
4
4
|
/**
|
|
@@ -42,7 +42,6 @@ export declare const GameTicketSchema: z.ZodObject<{
|
|
|
42
42
|
id: z.ZodString;
|
|
43
43
|
purchaseId: z.ZodString;
|
|
44
44
|
gameTurnId: z.ZodString;
|
|
45
|
-
ownerUsername: z.ZodString;
|
|
46
45
|
userType: z.ZodEnum<{
|
|
47
46
|
readonly LEADER: "leader";
|
|
48
47
|
readonly SUB_USER: "sub-user";
|
|
@@ -94,11 +93,11 @@ export declare const CreatePurchasePublicSchema: z.ZodObject<{
|
|
|
94
93
|
* The public input doesn't receive a userId, as it's resolved on the backend
|
|
95
94
|
*/
|
|
96
95
|
export declare const CreatePurchaseInternalSchema: z.ZodObject<{
|
|
97
|
-
buyerUserId: z.ZodString;
|
|
98
96
|
ticketType: z.ZodDefault<z.ZodEnum<{
|
|
99
97
|
readonly RACE: "race";
|
|
100
98
|
readonly BATTLE: "battle";
|
|
101
99
|
readonly SOCCER: "soccer";
|
|
102
100
|
}>>;
|
|
101
|
+
buyerUserId: z.ZodString;
|
|
103
102
|
ticketCount: z.ZodNumber;
|
|
104
103
|
}, z.core.$strip>;
|
|
@@ -27,7 +27,6 @@ exports.GameTicketSchema = zod_1.z.object({
|
|
|
27
27
|
id: zod_1.z.string(),
|
|
28
28
|
purchaseId: zod_1.z.string(),
|
|
29
29
|
gameTurnId: zod_1.z.string(),
|
|
30
|
-
ownerUsername: zod_1.z.string(),
|
|
31
30
|
userType: exports.TicketUserTypeSchema,
|
|
32
31
|
status: exports.GameTicketStatusSchema,
|
|
33
32
|
type: exports.TicketTypeSchema.default(exports.TICKET_TYPE.RACE),
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UserWithPasswordSchema = exports.UserSchema = exports.UserRoleSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const user_role_1 = require("
|
|
5
|
+
const user_role_1 = require("../../constants/user-role");
|
|
6
6
|
const user_type_schema_1 = require("./user-type.schema");
|
|
7
7
|
exports.UserRoleSchema = zod_1.z.enum([user_role_1.USER_ROLE.SUPER_ADMIN, user_role_1.USER_ROLE.PLAYER, user_role_1.USER_ROLE.OPERATOR]);
|
|
8
8
|
exports.UserSchema = zod_1.z.object({
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.damageSchema = exports.damageTargetSchema = exports.damageEffectNameSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
5
|
+
const Flag_schema_1 = require("../hardware/flag/Flag.schema");
|
|
6
|
+
const KartEffect_schema_1 = require("../hardware/kart-effect/KartEffect.schema");
|
|
6
7
|
const sounds_1 = require("../sounds");
|
|
7
8
|
const Damage_const_1 = require("./Damage.const");
|
|
8
9
|
exports.damageEffectNameSchema = zod_1.z.enum(Damage_const_1.DAMAGE_EFFECT);
|
|
@@ -11,7 +12,7 @@ exports.damageSchema = zod_1.z.object({
|
|
|
11
12
|
name: exports.damageEffectNameSchema,
|
|
12
13
|
target: exports.damageTargetSchema,
|
|
13
14
|
sound: sounds_1.soundNameSchema,
|
|
14
|
-
rgbEffect:
|
|
15
|
+
rgbEffect: KartEffect_schema_1.kartEffectSchema,
|
|
15
16
|
amount: zod_1.z.number(),
|
|
16
|
-
flagMediaName:
|
|
17
|
+
flagMediaName: Flag_schema_1.flagMediaNameSchema,
|
|
17
18
|
});
|
|
@@ -101,7 +101,7 @@ export declare const raceWithDetailedRankingSchema: z.ZodObject<{
|
|
|
101
101
|
type: z.ZodLiteral<"Race">;
|
|
102
102
|
id: z.ZodNumber;
|
|
103
103
|
coins: z.ZodNumber;
|
|
104
|
-
|
|
104
|
+
laps: z.ZodNumber;
|
|
105
105
|
status: z.ZodEnum<{
|
|
106
106
|
readonly NON_STARTED: "non-started";
|
|
107
107
|
readonly ACTIVE: "active";
|
|
@@ -110,6 +110,7 @@ export declare const raceWithDetailedRankingSchema: z.ZodObject<{
|
|
|
110
110
|
readonly FINISHED: "finished";
|
|
111
111
|
readonly KART_ELIMINATED: "kart-eliminated";
|
|
112
112
|
}>;
|
|
113
|
+
time: z.ZodNumber;
|
|
113
114
|
kartsGuids: z.ZodArray<z.ZodString>;
|
|
114
115
|
powerUpsIds: z.ZodArray<z.ZodString>;
|
|
115
116
|
gameTrackId: z.ZodString;
|
|
@@ -127,7 +128,6 @@ export declare const raceWithDetailedRankingSchema: z.ZodObject<{
|
|
|
127
128
|
coins: z.ZodNumber;
|
|
128
129
|
currentLap: z.ZodNumber;
|
|
129
130
|
}, z.core.$strip>>;
|
|
130
|
-
laps: z.ZodNumber;
|
|
131
131
|
gameRanking: z.ZodArray<z.ZodObject<{
|
|
132
132
|
kartGuid: z.ZodString;
|
|
133
133
|
position: z.ZodNumber;
|
|
@@ -2,28 +2,28 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.kartHardwareStateSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
5
|
+
const Checkpoint_schema_1 = require("../checkpoint/Checkpoint.schema");
|
|
6
|
+
const Flag_schema_1 = require("./flag/Flag.schema");
|
|
7
|
+
const RGB_schema_1 = require("./rgb/RGB.schema");
|
|
8
|
+
const Screen_schema_1 = require("./screen/Screen.schema");
|
|
9
|
+
const Speed_schema_1 = require("./speed/Speed.schema");
|
|
10
10
|
exports.kartHardwareStateSchema = zod_1.z.object({
|
|
11
11
|
speed: zod_1.z
|
|
12
12
|
.object({
|
|
13
|
-
status:
|
|
13
|
+
status: Speed_schema_1.speedStatusSchema,
|
|
14
14
|
current: zod_1.z.number(),
|
|
15
15
|
configured: zod_1.z.number(),
|
|
16
16
|
})
|
|
17
17
|
.nullable(),
|
|
18
|
-
rgb:
|
|
18
|
+
rgb: RGB_schema_1.rgbStatusSchema.nullable(),
|
|
19
19
|
flag: zod_1.z
|
|
20
20
|
.object({
|
|
21
|
-
status:
|
|
22
|
-
checkpointType:
|
|
21
|
+
status: Flag_schema_1.flagStatusSchema,
|
|
22
|
+
checkpointType: Checkpoint_schema_1.checkpointTypeSchema.nullable(),
|
|
23
23
|
checkpointAddress: zod_1.z.number().nullable(),
|
|
24
24
|
})
|
|
25
25
|
.nullable(),
|
|
26
|
-
screen:
|
|
26
|
+
screen: Screen_schema_1.screenStatusSchema.nullable(),
|
|
27
27
|
isConnectedToServer: zod_1.z.boolean(),
|
|
28
28
|
isSteeringWheelPressed: zod_1.z.boolean(),
|
|
29
29
|
});
|
|
@@ -493,58 +493,6 @@ export declare const screenFinishViewInputSchema: z.ZodObject<{
|
|
|
493
493
|
readonly DEFEAT: "Defeat";
|
|
494
494
|
}>>;
|
|
495
495
|
}, z.core.$strip>;
|
|
496
|
-
export declare const screenDebugViewInputSchema: z.ZodObject<{
|
|
497
|
-
speed: z.ZodNullable<z.ZodObject<{
|
|
498
|
-
status: z.ZodEnum<{
|
|
499
|
-
readonly ACTIVATED: "Activated";
|
|
500
|
-
readonly DEACTIVATED: "Deactivated";
|
|
501
|
-
readonly UNKNOWN: "Unknown";
|
|
502
|
-
readonly ERROR: "Error";
|
|
503
|
-
readonly STANDBY: "Standby";
|
|
504
|
-
readonly CHANGING_SPEED: "Changing Speed";
|
|
505
|
-
readonly IN_EMERGENCY: "In Emergency";
|
|
506
|
-
}>;
|
|
507
|
-
current: z.ZodNumber;
|
|
508
|
-
configured: z.ZodNumber;
|
|
509
|
-
}, z.core.$strip>>;
|
|
510
|
-
rgb: z.ZodNullable<z.ZodEnum<{
|
|
511
|
-
readonly SHOWING_COLOR: "Showing Color";
|
|
512
|
-
readonly NOT_CONFIGURED: "Not Configured";
|
|
513
|
-
readonly CONFIGURING_RGB: "Configuring RGB";
|
|
514
|
-
readonly SHOWING_EFFECT: "Showing Effect";
|
|
515
|
-
readonly UNKNOWN: "Unknown";
|
|
516
|
-
readonly ERROR: "Error";
|
|
517
|
-
}>>;
|
|
518
|
-
flag: z.ZodNullable<z.ZodObject<{
|
|
519
|
-
status: z.ZodEnum<{
|
|
520
|
-
readonly ACTIVATED: "Activated";
|
|
521
|
-
readonly DEACTIVATED: "Deactivated";
|
|
522
|
-
readonly UNKNOWN: "Unknown";
|
|
523
|
-
readonly ERROR: "Error";
|
|
524
|
-
readonly STANDBY: "Standby";
|
|
525
|
-
readonly HIT: "Hit";
|
|
526
|
-
readonly SHOWING_IMAGE: "Showing Image";
|
|
527
|
-
readonly SHOWING_ANIMATION: "Showing Animation";
|
|
528
|
-
}>;
|
|
529
|
-
checkpointType: z.ZodNullable<z.ZodEnum<{
|
|
530
|
-
readonly TRACK: "Track";
|
|
531
|
-
readonly POWER_UP: "PowerUp";
|
|
532
|
-
readonly SHORTCUT: "Shortcut";
|
|
533
|
-
readonly UNKNOWN: "Unknown";
|
|
534
|
-
}>>;
|
|
535
|
-
checkpointAddress: z.ZodNullable<z.ZodNumber>;
|
|
536
|
-
}, z.core.$strip>>;
|
|
537
|
-
screen: z.ZodNullable<z.ZodEnum<{
|
|
538
|
-
readonly ACTIVATED: "Activated";
|
|
539
|
-
readonly DEACTIVATED: "Deactivated";
|
|
540
|
-
readonly UNKNOWN: "Unknown";
|
|
541
|
-
readonly ERROR: "Error";
|
|
542
|
-
readonly DEBUG: "Debug";
|
|
543
|
-
}>>;
|
|
544
|
-
isConnectedToServer: z.ZodBoolean;
|
|
545
|
-
isSteeringWheelPressed: z.ZodBoolean;
|
|
546
|
-
kartNumber: z.ZodNumber;
|
|
547
|
-
}, z.core.$strip>;
|
|
548
496
|
export declare const screenHomeViewInputSchema: z.ZodObject<{
|
|
549
497
|
kartNumber: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
550
498
|
}, z.core.$strip>;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.screenHomeViewInputSchema = exports.
|
|
3
|
+
exports.screenHomeViewInputSchema = exports.screenFinishViewInputSchema = exports.screenUpdateGameViewInputSchema = exports.updateBattleViewInputSchema = exports.updateRaceViewInputSchema = exports.screenCountdownParamsSchema = exports.countDownNextViewBattleSchema = exports.countDownNextViewRaceSchema = exports.screenBattleViewConfigSchema = exports.screenRaceViewConfigSchema = exports.screenViewBaseConfigSchema = exports.screenGameTimeLeftSchema = exports.screenCurrentTotalSchema = exports.screenModuleStatusSchema = exports.kartFinalStateSchema = exports.screenViewSchema = exports.screenStatusSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
6
|
-
const hardware_1 = require("../../hardware");
|
|
5
|
+
const Damage_schema_1 = require("../../damage/Damage.schema");
|
|
7
6
|
const PowerUpAttributes_schema_1 = require("../../powerUp/PowerUpAttributes.schema");
|
|
8
7
|
const Screen_const_1 = require("./Screen.const");
|
|
9
|
-
const
|
|
8
|
+
const Kart_const_1 = require("../../kart/Kart.const");
|
|
10
9
|
exports.screenStatusSchema = zod_1.z.enum(Screen_const_1.SCREEN_STATUS);
|
|
11
10
|
exports.screenViewSchema = zod_1.z.enum(Screen_const_1.SCREEN_VIEW);
|
|
12
11
|
// KART_FINAL_STATE is { FINISHED: 'finished', ... } as const. z.nativeEnum works with it.
|
|
13
|
-
exports.kartFinalStateSchema = zod_1.z.enum(
|
|
12
|
+
exports.kartFinalStateSchema = zod_1.z.enum(Kart_const_1.KART_FINAL_STATE);
|
|
14
13
|
exports.screenModuleStatusSchema = zod_1.z.object({
|
|
15
14
|
latestView: exports.screenViewSchema,
|
|
16
15
|
screenStatus: exports.screenStatusSchema,
|
|
@@ -33,7 +32,7 @@ exports.screenViewBaseConfigSchema = zod_1.z.object({
|
|
|
33
32
|
.optional(),
|
|
34
33
|
powerUpAnimationTimeSeconds: zod_1.z.number().nullable().optional(),
|
|
35
34
|
damageEffect: zod_1.z
|
|
36
|
-
.union([
|
|
35
|
+
.union([Damage_schema_1.damageEffectNameSchema, zod_1.z.literal('Yellow Flag'), zod_1.z.literal('Red Flag')])
|
|
37
36
|
.nullable()
|
|
38
37
|
.optional(),
|
|
39
38
|
damageAnimationTimeSeconds: zod_1.z
|
|
@@ -68,9 +67,6 @@ exports.screenFinishViewInputSchema = zod_1.z.object({
|
|
|
68
67
|
coins: zod_1.z.number(),
|
|
69
68
|
finalState: exports.kartFinalStateSchema.optional(),
|
|
70
69
|
});
|
|
71
|
-
exports.screenDebugViewInputSchema = hardware_1.kartHardwareStateSchema.extend({
|
|
72
|
-
kartNumber: zod_1.z.number(),
|
|
73
|
-
});
|
|
74
70
|
exports.screenHomeViewInputSchema = zod_1.z.object({
|
|
75
71
|
kartNumber: zod_1.z.number().nullable().optional(),
|
|
76
72
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { countDownNextViewBattleSchema, countDownNextViewRaceSchema, screenBattleViewConfigSchema, screenCountdownParamsSchema,
|
|
2
|
+
import { countDownNextViewBattleSchema, countDownNextViewRaceSchema, screenBattleViewConfigSchema, screenCountdownParamsSchema, screenFinishViewInputSchema, screenGameTimeLeftSchema, screenHomeViewInputSchema, screenModuleStatusSchema, screenRaceViewConfigSchema, screenStatusSchema, screenUpdateGameViewInputSchema, screenViewBaseConfigSchema, screenViewSchema, updateBattleViewInputSchema, updateRaceViewInputSchema } from './Screen.schema';
|
|
3
|
+
import { screenDebugViewInputSchema } from './ScreenDebug.schema';
|
|
3
4
|
export type ScreenStatus = z.infer<typeof screenStatusSchema>;
|
|
4
5
|
export type ScreenView = z.infer<typeof screenViewSchema>;
|
|
5
6
|
export type ScreenModuleStatus = z.infer<typeof screenModuleStatusSchema>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const screenDebugViewInputSchema: z.ZodObject<{
|
|
3
|
+
speed: z.ZodNullable<z.ZodObject<{
|
|
4
|
+
status: z.ZodEnum<{
|
|
5
|
+
readonly ACTIVATED: "Activated";
|
|
6
|
+
readonly DEACTIVATED: "Deactivated";
|
|
7
|
+
readonly UNKNOWN: "Unknown";
|
|
8
|
+
readonly ERROR: "Error";
|
|
9
|
+
readonly STANDBY: "Standby";
|
|
10
|
+
readonly CHANGING_SPEED: "Changing Speed";
|
|
11
|
+
readonly IN_EMERGENCY: "In Emergency";
|
|
12
|
+
}>;
|
|
13
|
+
current: z.ZodNumber;
|
|
14
|
+
configured: z.ZodNumber;
|
|
15
|
+
}, z.core.$strip>>;
|
|
16
|
+
rgb: z.ZodNullable<z.ZodEnum<{
|
|
17
|
+
readonly SHOWING_COLOR: "Showing Color";
|
|
18
|
+
readonly NOT_CONFIGURED: "Not Configured";
|
|
19
|
+
readonly CONFIGURING_RGB: "Configuring RGB";
|
|
20
|
+
readonly SHOWING_EFFECT: "Showing Effect";
|
|
21
|
+
readonly UNKNOWN: "Unknown";
|
|
22
|
+
readonly ERROR: "Error";
|
|
23
|
+
}>>;
|
|
24
|
+
flag: z.ZodNullable<z.ZodObject<{
|
|
25
|
+
status: z.ZodEnum<{
|
|
26
|
+
readonly ACTIVATED: "Activated";
|
|
27
|
+
readonly DEACTIVATED: "Deactivated";
|
|
28
|
+
readonly UNKNOWN: "Unknown";
|
|
29
|
+
readonly ERROR: "Error";
|
|
30
|
+
readonly STANDBY: "Standby";
|
|
31
|
+
readonly HIT: "Hit";
|
|
32
|
+
readonly SHOWING_IMAGE: "Showing Image";
|
|
33
|
+
readonly SHOWING_ANIMATION: "Showing Animation";
|
|
34
|
+
}>;
|
|
35
|
+
checkpointType: z.ZodNullable<z.ZodEnum<{
|
|
36
|
+
readonly TRACK: "Track";
|
|
37
|
+
readonly POWER_UP: "PowerUp";
|
|
38
|
+
readonly SHORTCUT: "Shortcut";
|
|
39
|
+
readonly UNKNOWN: "Unknown";
|
|
40
|
+
}>>;
|
|
41
|
+
checkpointAddress: z.ZodNullable<z.ZodNumber>;
|
|
42
|
+
}, z.core.$strip>>;
|
|
43
|
+
screen: z.ZodNullable<z.ZodEnum<{
|
|
44
|
+
readonly ACTIVATED: "Activated";
|
|
45
|
+
readonly DEACTIVATED: "Deactivated";
|
|
46
|
+
readonly UNKNOWN: "Unknown";
|
|
47
|
+
readonly ERROR: "Error";
|
|
48
|
+
readonly DEBUG: "Debug";
|
|
49
|
+
}>>;
|
|
50
|
+
isConnectedToServer: z.ZodBoolean;
|
|
51
|
+
isSteeringWheelPressed: z.ZodBoolean;
|
|
52
|
+
kartNumber: z.ZodNumber;
|
|
53
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.screenDebugViewInputSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const KartHardwareState_schema_1 = require("../KartHardwareState.schema");
|
|
6
|
+
exports.screenDebugViewInputSchema = KartHardwareState_schema_1.kartHardwareStateSchema.extend({
|
|
7
|
+
kartNumber: zod_1.z.number(),
|
|
8
|
+
});
|
|
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./Screen.const"), exports);
|
|
18
18
|
__exportStar(require("./Screen.schema"), exports);
|
|
19
|
+
__exportStar(require("./ScreenDebug.schema"), exports);
|
|
19
20
|
__exportStar(require("./Screen.types"), exports);
|
package/dist/domains/index.d.ts
CHANGED
|
@@ -9,7 +9,9 @@ export * from './hardware';
|
|
|
9
9
|
export * from './kart';
|
|
10
10
|
export * from './kartTracking';
|
|
11
11
|
export * from './powerUp';
|
|
12
|
+
export * from './player';
|
|
12
13
|
export * from './racingTeam';
|
|
14
|
+
export * from './session';
|
|
13
15
|
export * from './socket';
|
|
14
16
|
export * from './ticketing';
|
|
15
17
|
export * from './user';
|
package/dist/domains/index.js
CHANGED
|
@@ -25,7 +25,9 @@ __exportStar(require("./hardware"), exports);
|
|
|
25
25
|
__exportStar(require("./kart"), exports);
|
|
26
26
|
__exportStar(require("./kartTracking"), exports);
|
|
27
27
|
__exportStar(require("./powerUp"), exports);
|
|
28
|
+
__exportStar(require("./player"), exports);
|
|
28
29
|
__exportStar(require("./racingTeam"), exports);
|
|
30
|
+
__exportStar(require("./session"), exports);
|
|
29
31
|
__exportStar(require("./socket"), exports);
|
|
30
32
|
__exportStar(require("./ticketing"), exports);
|
|
31
33
|
__exportStar(require("./user"), exports);
|
|
@@ -5,7 +5,7 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const color_1 = require("../color");
|
|
6
6
|
const damage_1 = require("../damage");
|
|
7
7
|
const game_1 = require("../game");
|
|
8
|
-
const
|
|
8
|
+
const KartHardwareState_schema_1 = require("../hardware/KartHardwareState.schema");
|
|
9
9
|
const PowerUpAttributes_schema_1 = require("../powerUp/PowerUpAttributes.schema");
|
|
10
10
|
const Kart_const_1 = require("./Kart.const");
|
|
11
11
|
exports.kartStatusSchema = zod_1.z.enum(Kart_const_1.KART_STATUS);
|
|
@@ -31,7 +31,7 @@ exports.kartSchema = zod_1.z.object({
|
|
|
31
31
|
currentGame: exports.kartGameSchema.nullable().optional(),
|
|
32
32
|
description: zod_1.z.string().nullable().optional(),
|
|
33
33
|
isSubscribedToHardwareStatus: zod_1.z.boolean(),
|
|
34
|
-
hardwareState:
|
|
34
|
+
hardwareState: KartHardwareState_schema_1.kartHardwareStateSchema.nullable().optional(),
|
|
35
35
|
currentPowerUp: PowerUpAttributes_schema_1.powerUpNameSchema.nullable().optional(),
|
|
36
36
|
currentDamage: damage_1.damageEffectNameSchema.nullable().optional(),
|
|
37
37
|
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const playerTypeSchema: z.ZodEnum<{
|
|
3
|
+
readonly ADULT: "ADULT";
|
|
4
|
+
readonly MINOR: "MINOR";
|
|
5
|
+
}>;
|
|
6
|
+
export declare const playerWaiverStatusSchema: z.ZodObject<{
|
|
7
|
+
isSigned: z.ZodDefault<z.ZodBoolean>;
|
|
8
|
+
waiverId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
9
|
+
templateVersion: z.ZodOptional<z.ZodString>;
|
|
10
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
export declare const playerStatsSchema: z.ZodObject<{
|
|
13
|
+
totalRaces: z.ZodDefault<z.ZodNumber>;
|
|
14
|
+
bestTimeMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
15
|
+
xp: z.ZodDefault<z.ZodNumber>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export declare const playerSchema: z.ZodObject<{
|
|
18
|
+
id: z.ZodUUID;
|
|
19
|
+
nickname: z.ZodString;
|
|
20
|
+
avatarUrl: z.ZodOptional<z.ZodURL>;
|
|
21
|
+
birthDate: z.ZodDate;
|
|
22
|
+
type: z.ZodDefault<z.ZodEnum<{
|
|
23
|
+
readonly ADULT: "ADULT";
|
|
24
|
+
readonly MINOR: "MINOR";
|
|
25
|
+
}>>;
|
|
26
|
+
ownerUserId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
27
|
+
isGuest: z.ZodDefault<z.ZodBoolean>;
|
|
28
|
+
waiver: z.ZodObject<{
|
|
29
|
+
isSigned: z.ZodDefault<z.ZodBoolean>;
|
|
30
|
+
waiverId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
31
|
+
templateVersion: z.ZodOptional<z.ZodString>;
|
|
32
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
stats: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
35
|
+
totalRaces: z.ZodDefault<z.ZodNumber>;
|
|
36
|
+
bestTimeMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
37
|
+
xp: z.ZodDefault<z.ZodNumber>;
|
|
38
|
+
}, z.core.$strip>>>;
|
|
39
|
+
createdAt: z.ZodDate;
|
|
40
|
+
updatedAt: z.ZodDate;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
export declare const createPlayerSchema: z.ZodObject<{
|
|
43
|
+
type: z.ZodDefault<z.ZodEnum<{
|
|
44
|
+
readonly ADULT: "ADULT";
|
|
45
|
+
readonly MINOR: "MINOR";
|
|
46
|
+
}>>;
|
|
47
|
+
nickname: z.ZodString;
|
|
48
|
+
birthDate: z.ZodCoercedDate<unknown>;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
export declare const signWaiverSchema: z.ZodObject<{
|
|
51
|
+
signature: z.ZodOptional<z.ZodString>;
|
|
52
|
+
accepted: z.ZodLiteral<true>;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
export declare const createMinorPlayerSchema: z.ZodObject<{
|
|
55
|
+
nickname: z.ZodString;
|
|
56
|
+
birthDate: z.ZodCoercedDate<unknown>;
|
|
57
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createMinorPlayerSchema = exports.signWaiverSchema = exports.createPlayerSchema = exports.playerSchema = exports.playerStatsSchema = exports.playerWaiverStatusSchema = exports.playerTypeSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const Player_const_1 = require("./Player.const");
|
|
6
|
+
exports.playerTypeSchema = zod_1.z.enum(Player_const_1.PLAYER_TYPE);
|
|
7
|
+
exports.playerWaiverStatusSchema = zod_1.z.object({
|
|
8
|
+
isSigned: zod_1.z.boolean().default(false),
|
|
9
|
+
waiverId: zod_1.z.uuidv4().nullable().optional(),
|
|
10
|
+
templateVersion: zod_1.z.string().optional(),
|
|
11
|
+
expiresAt: zod_1.z.date().nullable().optional(),
|
|
12
|
+
});
|
|
13
|
+
exports.playerStatsSchema = zod_1.z.object({
|
|
14
|
+
totalRaces: zod_1.z.number().int().default(0),
|
|
15
|
+
bestTimeMs: zod_1.z.number().int().nullable().optional(),
|
|
16
|
+
xp: zod_1.z.number().int().default(0),
|
|
17
|
+
});
|
|
18
|
+
exports.playerSchema = zod_1.z.object({
|
|
19
|
+
id: zod_1.z.uuidv4(),
|
|
20
|
+
nickname: zod_1.z.string().min(2).max(20),
|
|
21
|
+
avatarUrl: zod_1.z.url().optional(),
|
|
22
|
+
birthDate: zod_1.z.date(),
|
|
23
|
+
type: exports.playerTypeSchema.default(Player_const_1.PLAYER_TYPE.ADULT),
|
|
24
|
+
ownerUserId: zod_1.z.uuidv4().nullable().optional(),
|
|
25
|
+
isGuest: zod_1.z.boolean().default(true),
|
|
26
|
+
waiver: exports.playerWaiverStatusSchema,
|
|
27
|
+
// TODO: Add the stats here, to aovid extra queries
|
|
28
|
+
stats: exports.playerStatsSchema.optional().nullable(),
|
|
29
|
+
createdAt: zod_1.z.date(),
|
|
30
|
+
updatedAt: zod_1.z.date(),
|
|
31
|
+
});
|
|
32
|
+
exports.createPlayerSchema = exports.playerSchema
|
|
33
|
+
.pick({
|
|
34
|
+
nickname: true,
|
|
35
|
+
type: true,
|
|
36
|
+
})
|
|
37
|
+
.extend({
|
|
38
|
+
birthDate: zod_1.z.coerce.date(),
|
|
39
|
+
});
|
|
40
|
+
exports.signWaiverSchema = zod_1.z.object({
|
|
41
|
+
signature: zod_1.z.string().optional(), // Base64 or simply a boolean acceptance. Let's make it flexible.
|
|
42
|
+
accepted: zod_1.z.literal(true), // They must explicitly pass accepted: true
|
|
43
|
+
});
|
|
44
|
+
exports.createMinorPlayerSchema = zod_1.z.object({
|
|
45
|
+
nickname: zod_1.z.string().min(2).max(20),
|
|
46
|
+
birthDate: zod_1.z.coerce.date(),
|
|
47
|
+
// For a minor, the signature is implicitly granted by the tutor calling this endpoint
|
|
48
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { playerSchema, playerStatsSchema, playerTypeSchema, playerWaiverStatusSchema } from './Player.schema';
|
|
3
|
+
export type PlayerType = z.infer<typeof playerTypeSchema>;
|
|
4
|
+
export type PlayerStats = z.infer<typeof playerStatsSchema>;
|
|
5
|
+
export type PlayerWaiverStatus = z.infer<typeof playerWaiverStatusSchema>;
|
|
6
|
+
export type Player = z.infer<typeof playerSchema>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Player.const"), exports);
|
|
18
|
+
__exportStar(require("./Player.schema"), exports);
|
|
19
|
+
__exportStar(require("./Player.types"), exports);
|