@battle-racing/br-common-lib 4.4.0 → 4.6.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/domains/command/Command.schema.d.ts +76 -10
- package/dist/domains/command/Command.schema.js +17 -3
- package/dist/domains/command/Command.types.d.ts +3 -1
- package/dist/domains/damage/Damage.schema.d.ts +2 -2
- package/dist/domains/flow/Flow.schema.d.ts +39 -6
- package/dist/domains/hardware/KartHardwareState.schema.js +8 -8
- package/dist/domains/hardware/KartHardwareState.types.d.ts +3 -0
- package/dist/domains/hardware/KartHardwareState.types.js +2 -0
- package/dist/domains/hardware/ModuleStatus.schema.d.ts +28 -0
- package/dist/domains/hardware/ModuleStatus.schema.js +4 -0
- package/dist/domains/hardware/ballSensor/BallSensor.const.d.ts +5 -0
- package/dist/domains/hardware/ballSensor/BallSensor.const.js +6 -1
- package/dist/domains/hardware/ballSensor/BallSensor.schema.d.ts +5 -0
- package/dist/domains/hardware/ballSensor/BallSensor.schema.js +2 -1
- package/dist/domains/hardware/ballSensor/BallSensor.types.d.ts +2 -1
- package/dist/domains/hardware/flag/Flag.const.d.ts +7 -0
- package/dist/domains/hardware/flag/Flag.const.js +8 -1
- package/dist/domains/hardware/flag/Flag.schema.d.ts +11 -4
- package/dist/domains/hardware/flag/Flag.schema.js +5 -2
- package/dist/domains/hardware/flag/Flag.types.d.ts +2 -1
- package/dist/domains/hardware/index.d.ts +1 -0
- package/dist/domains/hardware/index.js +2 -1
- package/dist/domains/hardware/lights/Lights.const.d.ts +4 -0
- package/dist/domains/hardware/lights/Lights.const.js +5 -1
- package/dist/domains/hardware/lights/Lights.schema.d.ts +16 -0
- package/dist/domains/hardware/lights/Lights.schema.js +5 -1
- package/dist/domains/hardware/lights/Lights.types.d.ts +3 -1
- package/dist/domains/hardware/rgb/RGB.const.d.ts +4 -0
- package/dist/domains/hardware/rgb/RGB.const.js +5 -1
- package/dist/domains/hardware/rgb/RGB.schema.d.ts +4 -0
- package/dist/domains/hardware/rgb/RGB.schema.js +2 -1
- package/dist/domains/hardware/rgb/RGB.types.d.ts +2 -1
- package/dist/domains/hardware/sound/Sound.const.d.ts +3 -0
- package/dist/domains/hardware/sound/Sound.const.js +4 -1
- package/dist/domains/hardware/sound/Sound.schema.d.ts +3 -0
- package/dist/domains/hardware/sound/Sound.schema.js +2 -1
- package/dist/domains/hardware/sound/Sound.types.d.ts +2 -1
- package/dist/domains/hardware/steering-wheel/SteeringWheel.const.d.ts +4 -0
- package/dist/domains/hardware/steering-wheel/SteeringWheel.const.js +7 -0
- package/dist/domains/hardware/steering-wheel/SteeringWheel.schema.d.ts +4 -0
- package/dist/domains/hardware/steering-wheel/SteeringWheel.schema.js +3 -1
- package/dist/domains/hardware/steering-wheel/SteeringWheel.types.d.ts +2 -1
- package/dist/domains/player/Player.schema.d.ts +2 -4
- package/dist/domains/player/Player.schema.js +3 -6
- package/dist/domains/powerUp/PowerUp.schema.d.ts +117 -18
- package/dist/domains/racingTeam/RacingTeam.schema.d.ts +77 -3
- package/dist/domains/racingTeam/RacingTeam.schema.js +18 -4
- package/dist/domains/racingTeam/RacingTeam.types.d.ts +4 -1
- package/dist/domains/session/Session.schema.d.ts +5 -0
- package/dist/domains/session/Session.schema.js +4 -1
- package/dist/domains/socket/index.d.ts +1 -0
- package/dist/domains/socket/index.js +1 -0
- package/dist/domains/socket/screen/SocketScreenServerToClientEventsParams.d.ts +14 -0
- package/dist/domains/socket/screen/SocketScreenServerToClientEventsParams.js +2 -0
- package/dist/domains/socket/screen/index.d.ts +1 -0
- package/dist/domains/socket/screen/index.js +17 -0
- package/dist/domains/ticketing/Ticketing.schema.d.ts +4 -0
- package/dist/domains/ticketing/Ticketing.schema.js +2 -0
- package/dist/domains/user/User.schema.d.ts +65 -6
- package/dist/domains/user/User.schema.js +52 -11
- package/dist/domains/user/User.types.d.ts +7 -1
- package/docs/TICKETING_AND_PURCHASE_FLOW.md +110 -0
- package/package.json +1 -1
- package/src/domains/command/Command.schema.ts +30 -12
- package/src/domains/command/Command.types.ts +4 -0
- package/src/domains/hardware/KartHardwareState.schema.ts +4 -4
- package/src/domains/hardware/KartHardwareState.types.ts +4 -0
- package/src/domains/hardware/ModuleStatus.schema.ts +4 -0
- package/src/domains/hardware/ballSensor/BallSensor.const.ts +6 -0
- package/src/domains/hardware/ballSensor/BallSensor.schema.ts +3 -1
- package/src/domains/hardware/ballSensor/BallSensor.types.ts +2 -0
- package/src/domains/hardware/flag/Flag.const.ts +8 -0
- package/src/domains/hardware/flag/Flag.schema.ts +6 -2
- package/src/domains/hardware/flag/Flag.types.ts +2 -0
- package/src/domains/hardware/index.ts +2 -1
- package/src/domains/hardware/lights/Lights.const.ts +5 -0
- package/src/domains/hardware/lights/Lights.schema.ts +7 -1
- package/src/domains/hardware/lights/Lights.types.ts +9 -1
- package/src/domains/hardware/rgb/RGB.const.ts +5 -0
- package/src/domains/hardware/rgb/RGB.schema.ts +3 -1
- package/src/domains/hardware/rgb/RGB.types.ts +2 -0
- package/src/domains/hardware/sound/Sound.const.ts +4 -0
- package/src/domains/hardware/sound/Sound.schema.ts +3 -1
- package/src/domains/hardware/sound/Sound.types.ts +3 -1
- package/src/domains/hardware/steering-wheel/SteeringWheel.const.ts +4 -0
- package/src/domains/hardware/steering-wheel/SteeringWheel.schema.ts +3 -0
- package/src/domains/hardware/steering-wheel/SteeringWheel.types.ts +3 -1
- package/src/domains/player/Player.schema.ts +2 -6
- package/src/domains/racingTeam/RacingTeam.schema.ts +20 -3
- package/src/domains/racingTeam/RacingTeam.types.ts +7 -0
- package/src/domains/session/Session.schema.ts +4 -0
- package/src/domains/socket/index.ts +1 -0
- package/src/domains/socket/screen/SocketScreenServerToClientEventsParams.ts +19 -0
- package/src/domains/socket/screen/index.ts +1 -0
- package/src/domains/ticketing/Ticketing.schema.ts +2 -0
- package/src/domains/user/User.schema.ts +60 -13
- package/src/domains/user/User.types.ts +17 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.showLightsEffectParamsSchema = exports.showLightsColorParamsSchema = exports.lightsEffectSchema = void 0;
|
|
3
|
+
exports.lightsModuleStatusSchema = exports.showLightsEffectParamsSchema = exports.showLightsColorParamsSchema = exports.lightsEffectSchema = exports.lightsActionCommandSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const Lights_const_1 = require("./Lights.const");
|
|
6
|
+
exports.lightsActionCommandSchema = zod_1.z.enum(Lights_const_1.LIGHTS_ACTION_COMMAND);
|
|
6
7
|
exports.lightsEffectSchema = zod_1.z.enum(Lights_const_1.LIGHTS_EFFECT);
|
|
7
8
|
exports.showLightsColorParamsSchema = zod_1.z.object({
|
|
8
9
|
address: zod_1.z.union([zod_1.z.array(zod_1.z.number()), zod_1.z.literal('all')]),
|
|
@@ -14,3 +15,6 @@ exports.showLightsEffectParamsSchema = zod_1.z.object({
|
|
|
14
15
|
effect: exports.lightsEffectSchema,
|
|
15
16
|
timeDuration: zod_1.z.number().min(1).max(25),
|
|
16
17
|
});
|
|
18
|
+
exports.lightsModuleStatusSchema = zod_1.z.object({
|
|
19
|
+
currentEffect: exports.lightsEffectSchema.nullable(),
|
|
20
|
+
});
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { lightsEffectSchema, showLightsColorParamsSchema, showLightsEffectParamsSchema } from './Lights.schema';
|
|
2
|
+
import { lightsActionCommandSchema, lightsEffectSchema, lightsModuleStatusSchema, showLightsColorParamsSchema, showLightsEffectParamsSchema } from './Lights.schema';
|
|
3
|
+
export type LightsActionCommand = z.infer<typeof lightsActionCommandSchema>;
|
|
3
4
|
export type LightsEffect = z.infer<typeof lightsEffectSchema>;
|
|
5
|
+
export type LightsModuleStatus = z.infer<typeof lightsModuleStatusSchema>;
|
|
4
6
|
export type ShowLightsColorParams = z.infer<typeof showLightsColorParamsSchema>;
|
|
5
7
|
export type ShowLightsEffectParams = z.infer<typeof showLightsEffectParamsSchema>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RGB_STATUS = void 0;
|
|
3
|
+
exports.RGB_ACTION_COMMANDS = exports.RGB_STATUS = void 0;
|
|
4
4
|
exports.RGB_STATUS = {
|
|
5
5
|
SHOWING_COLOR: 'Showing Color',
|
|
6
6
|
NOT_CONFIGURED: 'Not Configured',
|
|
@@ -9,3 +9,7 @@ exports.RGB_STATUS = {
|
|
|
9
9
|
UNKNOWN: 'Unknown',
|
|
10
10
|
ERROR: 'Error',
|
|
11
11
|
};
|
|
12
|
+
exports.RGB_ACTION_COMMANDS = {
|
|
13
|
+
EXEC: 'Exec',
|
|
14
|
+
CONFIGURE: 'Configure',
|
|
15
|
+
};
|
|
@@ -7,6 +7,10 @@ export declare const rgbStatusSchema: z.ZodEnum<{
|
|
|
7
7
|
readonly UNKNOWN: "Unknown";
|
|
8
8
|
readonly ERROR: "Error";
|
|
9
9
|
}>;
|
|
10
|
+
export declare const rgbActionCommandSchema: z.ZodEnum<{
|
|
11
|
+
readonly EXEC: "Exec";
|
|
12
|
+
readonly CONFIGURE: "Configure";
|
|
13
|
+
}>;
|
|
10
14
|
export declare const rgbModuleStatusSchema: z.ZodObject<{
|
|
11
15
|
rgbStatus: z.ZodEnum<{
|
|
12
16
|
readonly SHOWING_COLOR: "Showing Color";
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.rgbShowEffectOptionsSchema = exports.rgbConfigurationOptionsSchema = exports.rgbModuleStatusSchema = exports.rgbStatusSchema = void 0;
|
|
3
|
+
exports.rgbShowEffectOptionsSchema = exports.rgbConfigurationOptionsSchema = exports.rgbModuleStatusSchema = exports.rgbActionCommandSchema = exports.rgbStatusSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const color_1 = require("../../color");
|
|
6
6
|
const kart_effect_1 = require("../../hardware/kart-effect");
|
|
7
7
|
const RGB_const_1 = require("./RGB.const");
|
|
8
8
|
exports.rgbStatusSchema = zod_1.z.enum(RGB_const_1.RGB_STATUS);
|
|
9
|
+
exports.rgbActionCommandSchema = zod_1.z.enum(RGB_const_1.RGB_ACTION_COMMANDS);
|
|
9
10
|
exports.rgbModuleStatusSchema = zod_1.z.object({
|
|
10
11
|
rgbStatus: exports.rgbStatusSchema,
|
|
11
12
|
kartColor: color_1.colorNameSchema,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { rgbConfigurationOptionsSchema, rgbModuleStatusSchema, rgbShowEffectOptionsSchema, rgbStatusSchema } from './RGB.schema';
|
|
2
|
+
import { rgbActionCommandSchema, rgbConfigurationOptionsSchema, rgbModuleStatusSchema, rgbShowEffectOptionsSchema, rgbStatusSchema } from './RGB.schema';
|
|
3
3
|
export type RGBStatus = z.infer<typeof rgbStatusSchema>;
|
|
4
4
|
export type RGBModuleStatus = z.infer<typeof rgbModuleStatusSchema>;
|
|
5
5
|
export type RGBConfigurationOptions = z.infer<typeof rgbConfigurationOptionsSchema>;
|
|
6
6
|
export type RGBShowEffectOptions = z.infer<typeof rgbShowEffectOptionsSchema>;
|
|
7
|
+
export type RGBActionCommand = z.infer<typeof rgbActionCommandSchema>;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PLAY_SOUND_DURATION = void 0;
|
|
3
|
+
exports.SOUND_ACTION_COMMAND = exports.PLAY_SOUND_DURATION = void 0;
|
|
4
4
|
exports.PLAY_SOUND_DURATION = {
|
|
5
5
|
INFINITE: 'infinite',
|
|
6
6
|
};
|
|
7
|
+
exports.SOUND_ACTION_COMMAND = {
|
|
8
|
+
PLAY: 'Play',
|
|
9
|
+
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.playSoundOptionsSchema = void 0;
|
|
3
|
+
exports.playSoundOptionsSchema = exports.soundActionCommandSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const sounds_1 = require("../../sounds"); // Import from domains/sounds
|
|
6
6
|
const Sound_const_1 = require("./Sound.const");
|
|
7
|
+
exports.soundActionCommandSchema = zod_1.z.enum(Sound_const_1.SOUND_ACTION_COMMAND);
|
|
7
8
|
exports.playSoundOptionsSchema = zod_1.z.object({
|
|
8
9
|
soundName: sounds_1.soundNameSchema,
|
|
9
10
|
durationMs: zod_1.z.union([zod_1.z.number(), zod_1.z.literal(Sound_const_1.PLAY_SOUND_DURATION.INFINITE)]).optional(),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { playSoundOptionsSchema } from './Sound.schema';
|
|
2
|
+
import { soundActionCommandSchema, playSoundOptionsSchema } from './Sound.schema';
|
|
3
|
+
export type SoundActionCommand = z.infer<typeof soundActionCommandSchema>;
|
|
3
4
|
export type PlaySoundOptions = z.infer<typeof playSoundOptionsSchema>;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
export declare const steeringWheelActionCommandSchema: z.ZodEnum<{
|
|
3
|
+
readonly TURN_LED_ON: "TurnLedOn";
|
|
4
|
+
readonly TURN_LED_OFF: "TurnLedOff";
|
|
5
|
+
}>;
|
|
2
6
|
export declare const steeringWheelModuleStatusSchema: z.ZodObject<{
|
|
3
7
|
isLeftButtonPressed: z.ZodBoolean;
|
|
4
8
|
isRightButtonPressed: z.ZodBoolean;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.steeringWheelModuleStatusSchema = void 0;
|
|
3
|
+
exports.steeringWheelModuleStatusSchema = exports.steeringWheelActionCommandSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const SteeringWheel_const_1 = require("./SteeringWheel.const");
|
|
6
|
+
exports.steeringWheelActionCommandSchema = zod_1.z.enum(SteeringWheel_const_1.STEERING_WHEEL_ACTION_COMMAND);
|
|
5
7
|
exports.steeringWheelModuleStatusSchema = zod_1.z.object({
|
|
6
8
|
isLeftButtonPressed: zod_1.z.boolean(),
|
|
7
9
|
isRightButtonPressed: zod_1.z.boolean(),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { steeringWheelModuleStatusSchema } from './SteeringWheel.schema';
|
|
2
|
+
import { steeringWheelActionCommandSchema, steeringWheelModuleStatusSchema } from './SteeringWheel.schema';
|
|
3
|
+
export type SteeringWheelActionCommand = z.infer<typeof steeringWheelActionCommandSchema>;
|
|
3
4
|
export type SteeringWheelModuleStatus = z.infer<typeof steeringWheelModuleStatusSchema>;
|
|
@@ -41,13 +41,11 @@ export declare const playerSchema: z.ZodObject<{
|
|
|
41
41
|
}, z.core.$strip>;
|
|
42
42
|
export declare const createPlayerSchema: z.ZodObject<{
|
|
43
43
|
nickname: z.ZodString;
|
|
44
|
+
ownerUserId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
45
|
+
isGuest: z.ZodDefault<z.ZodBoolean>;
|
|
44
46
|
birthDate: z.ZodCoercedDate<unknown>;
|
|
45
47
|
}, z.core.$strip>;
|
|
46
48
|
export declare const signWaiverSchema: z.ZodObject<{
|
|
47
49
|
signature: z.ZodOptional<z.ZodString>;
|
|
48
50
|
accepted: z.ZodLiteral<true>;
|
|
49
51
|
}, z.core.$strip>;
|
|
50
|
-
export declare const createMinorPlayerSchema: z.ZodObject<{
|
|
51
|
-
nickname: z.ZodString;
|
|
52
|
-
birthDate: z.ZodCoercedDate<unknown>;
|
|
53
|
-
}, z.core.$strip>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.signWaiverSchema = exports.createPlayerSchema = exports.playerSchema = exports.playerStatsSchema = exports.playerWaiverStatusSchema = exports.playerTypeSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const Player_const_1 = require("./Player.const");
|
|
6
6
|
exports.playerTypeSchema = zod_1.z.enum(Player_const_1.PLAYER_TYPE);
|
|
@@ -32,6 +32,8 @@ exports.playerSchema = zod_1.z.object({
|
|
|
32
32
|
exports.createPlayerSchema = exports.playerSchema
|
|
33
33
|
.pick({
|
|
34
34
|
nickname: true,
|
|
35
|
+
ownerUserId: true,
|
|
36
|
+
isGuest: true,
|
|
35
37
|
})
|
|
36
38
|
.extend({
|
|
37
39
|
birthDate: zod_1.z.coerce.date(),
|
|
@@ -40,8 +42,3 @@ exports.signWaiverSchema = zod_1.z.object({
|
|
|
40
42
|
signature: zod_1.z.string().optional(), // Base64 or simply a boolean acceptance. Let's make it flexible.
|
|
41
43
|
accepted: zod_1.z.literal(true), // They must explicitly pass accepted: true
|
|
42
44
|
});
|
|
43
|
-
exports.createMinorPlayerSchema = zod_1.z.object({
|
|
44
|
-
nickname: zod_1.z.string().min(2).max(20),
|
|
45
|
-
birthDate: zod_1.z.coerce.date(),
|
|
46
|
-
// For a minor, the signature is implicitly granted by the tutor calling this endpoint
|
|
47
|
-
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const powerUpCommandSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
2
|
+
export declare const powerUpCommandSchema: z.ZodIntersection<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
3
3
|
module: z.ZodLiteral<"ballSensorDiskThrower">;
|
|
4
4
|
action: z.ZodLiteral<"activateSensor">;
|
|
5
5
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -82,7 +82,7 @@ export declare const powerUpCommandSchema: z.ZodUnion<readonly [z.ZodUnion<reado
|
|
|
82
82
|
front: z.ZodBoolean;
|
|
83
83
|
back: z.ZodBoolean;
|
|
84
84
|
}, z.core.$strip>;
|
|
85
|
-
mediaSourceName: z.ZodEnum<{
|
|
85
|
+
mediaSourceName: z.ZodUnion<readonly [z.ZodNumber, z.ZodEnum<{
|
|
86
86
|
readonly HEART_00: "heart_00";
|
|
87
87
|
readonly HEART_01: "heart_01";
|
|
88
88
|
readonly HEART_02: "heart_02";
|
|
@@ -144,7 +144,7 @@ export declare const powerUpCommandSchema: z.ZodUnion<readonly [z.ZodUnion<reado
|
|
|
144
144
|
readonly STATIC_FIREBALL: "static_fireball";
|
|
145
145
|
readonly STATIC_BEATING_HEART: "static_beating_heart";
|
|
146
146
|
readonly STATIC_SPEED_PAD: "static_speed_pad";
|
|
147
|
-
}>;
|
|
147
|
+
}>]>;
|
|
148
148
|
}, z.core.$strip>;
|
|
149
149
|
}, z.core.$strip>, z.ZodObject<{
|
|
150
150
|
module: z.ZodLiteral<"flag">;
|
|
@@ -156,7 +156,7 @@ export declare const powerUpCommandSchema: z.ZodUnion<readonly [z.ZodUnion<reado
|
|
|
156
156
|
front: z.ZodBoolean;
|
|
157
157
|
back: z.ZodBoolean;
|
|
158
158
|
}, z.core.$strip>;
|
|
159
|
-
mediaSourceName: z.ZodEnum<{
|
|
159
|
+
mediaSourceName: z.ZodUnion<readonly [z.ZodNumber, z.ZodEnum<{
|
|
160
160
|
readonly HEART_00: "heart_00";
|
|
161
161
|
readonly HEART_01: "heart_01";
|
|
162
162
|
readonly HEART_02: "heart_02";
|
|
@@ -218,7 +218,7 @@ export declare const powerUpCommandSchema: z.ZodUnion<readonly [z.ZodUnion<reado
|
|
|
218
218
|
readonly STATIC_FIREBALL: "static_fireball";
|
|
219
219
|
readonly STATIC_BEATING_HEART: "static_beating_heart";
|
|
220
220
|
readonly STATIC_SPEED_PAD: "static_speed_pad";
|
|
221
|
-
}>;
|
|
221
|
+
}>]>;
|
|
222
222
|
}, z.core.$strip>;
|
|
223
223
|
}, z.core.$strip>]>, z.ZodUnion<readonly [z.ZodObject<{
|
|
224
224
|
module: z.ZodLiteral<"rgb">;
|
|
@@ -578,7 +578,40 @@ export declare const powerUpCommandSchema: z.ZodUnion<readonly [z.ZodUnion<reado
|
|
|
578
578
|
}>;
|
|
579
579
|
durationMs: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodString]>]>>;
|
|
580
580
|
}, z.core.$strip>;
|
|
581
|
-
}, z.core.$strip
|
|
581
|
+
}, z.core.$strip>, z.ZodUnion<readonly [z.ZodObject<{
|
|
582
|
+
module: z.ZodLiteral<"emergency">;
|
|
583
|
+
action: z.ZodLiteral<"activate">;
|
|
584
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
585
|
+
module: z.ZodLiteral<"emergency">;
|
|
586
|
+
action: z.ZodLiteral<"deactivate">;
|
|
587
|
+
}, z.core.$strip>]>, z.ZodUnion<readonly [z.ZodObject<{
|
|
588
|
+
module: z.ZodLiteral<"lights">;
|
|
589
|
+
action: z.ZodLiteral<"showColor">;
|
|
590
|
+
params: z.ZodObject<{
|
|
591
|
+
address: z.ZodUnion<readonly [z.ZodArray<z.ZodNumber>, z.ZodLiteral<"all">]>;
|
|
592
|
+
timeDuration: z.ZodNumber;
|
|
593
|
+
color: z.ZodString;
|
|
594
|
+
}, z.core.$strip>;
|
|
595
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
596
|
+
module: z.ZodLiteral<"lights">;
|
|
597
|
+
action: z.ZodLiteral<"showEffect">;
|
|
598
|
+
params: z.ZodObject<{
|
|
599
|
+
addresses: z.ZodUnion<readonly [z.ZodArray<z.ZodNumber>, z.ZodLiteral<"all">]>;
|
|
600
|
+
effect: z.ZodEnum<{
|
|
601
|
+
readonly SHOW_UV_COLOR: "SHOW_UV_COLOR";
|
|
602
|
+
readonly POWER_OFF: "POWER_OFF";
|
|
603
|
+
readonly START_GAME: "START_GAME";
|
|
604
|
+
readonly GAME_OVER: "GAME_OVER";
|
|
605
|
+
readonly FINAL_LAP: "FINAL_LAP";
|
|
606
|
+
readonly YELLOW_FLAG: "YELLOW_FLAG";
|
|
607
|
+
readonly RED_FLAG: "RED_FLAG";
|
|
608
|
+
readonly PULSE: "PULSE";
|
|
609
|
+
}>;
|
|
610
|
+
timeDuration: z.ZodNumber;
|
|
611
|
+
}, z.core.$strip>;
|
|
612
|
+
}, z.core.$strip>]>]>, z.ZodObject<{
|
|
613
|
+
params: z.ZodOptional<z.ZodUnknown>;
|
|
614
|
+
}, z.core.$strip>>;
|
|
582
615
|
export declare const powerUpShieldSchema: z.ZodObject<{
|
|
583
616
|
duration: z.ZodNumber;
|
|
584
617
|
}, z.core.$strip>;
|
|
@@ -599,7 +632,7 @@ export declare const powerUpSchema: z.ZodObject<{
|
|
|
599
632
|
imageName: z.ZodString;
|
|
600
633
|
description: z.ZodString;
|
|
601
634
|
level: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>;
|
|
602
|
-
assignationCommands: z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
635
|
+
assignationCommands: z.ZodArray<z.ZodIntersection<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
603
636
|
module: z.ZodLiteral<"ballSensorDiskThrower">;
|
|
604
637
|
action: z.ZodLiteral<"activateSensor">;
|
|
605
638
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -682,7 +715,7 @@ export declare const powerUpSchema: z.ZodObject<{
|
|
|
682
715
|
front: z.ZodBoolean;
|
|
683
716
|
back: z.ZodBoolean;
|
|
684
717
|
}, z.core.$strip>;
|
|
685
|
-
mediaSourceName: z.ZodEnum<{
|
|
718
|
+
mediaSourceName: z.ZodUnion<readonly [z.ZodNumber, z.ZodEnum<{
|
|
686
719
|
readonly HEART_00: "heart_00";
|
|
687
720
|
readonly HEART_01: "heart_01";
|
|
688
721
|
readonly HEART_02: "heart_02";
|
|
@@ -744,7 +777,7 @@ export declare const powerUpSchema: z.ZodObject<{
|
|
|
744
777
|
readonly STATIC_FIREBALL: "static_fireball";
|
|
745
778
|
readonly STATIC_BEATING_HEART: "static_beating_heart";
|
|
746
779
|
readonly STATIC_SPEED_PAD: "static_speed_pad";
|
|
747
|
-
}>;
|
|
780
|
+
}>]>;
|
|
748
781
|
}, z.core.$strip>;
|
|
749
782
|
}, z.core.$strip>, z.ZodObject<{
|
|
750
783
|
module: z.ZodLiteral<"flag">;
|
|
@@ -756,7 +789,7 @@ export declare const powerUpSchema: z.ZodObject<{
|
|
|
756
789
|
front: z.ZodBoolean;
|
|
757
790
|
back: z.ZodBoolean;
|
|
758
791
|
}, z.core.$strip>;
|
|
759
|
-
mediaSourceName: z.ZodEnum<{
|
|
792
|
+
mediaSourceName: z.ZodUnion<readonly [z.ZodNumber, z.ZodEnum<{
|
|
760
793
|
readonly HEART_00: "heart_00";
|
|
761
794
|
readonly HEART_01: "heart_01";
|
|
762
795
|
readonly HEART_02: "heart_02";
|
|
@@ -818,7 +851,7 @@ export declare const powerUpSchema: z.ZodObject<{
|
|
|
818
851
|
readonly STATIC_FIREBALL: "static_fireball";
|
|
819
852
|
readonly STATIC_BEATING_HEART: "static_beating_heart";
|
|
820
853
|
readonly STATIC_SPEED_PAD: "static_speed_pad";
|
|
821
|
-
}>;
|
|
854
|
+
}>]>;
|
|
822
855
|
}, z.core.$strip>;
|
|
823
856
|
}, z.core.$strip>]>, z.ZodUnion<readonly [z.ZodObject<{
|
|
824
857
|
module: z.ZodLiteral<"rgb">;
|
|
@@ -1178,8 +1211,41 @@ export declare const powerUpSchema: z.ZodObject<{
|
|
|
1178
1211
|
}>;
|
|
1179
1212
|
durationMs: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodString]>]>>;
|
|
1180
1213
|
}, z.core.$strip>;
|
|
1181
|
-
}, z.core.$strip
|
|
1182
|
-
|
|
1214
|
+
}, z.core.$strip>, z.ZodUnion<readonly [z.ZodObject<{
|
|
1215
|
+
module: z.ZodLiteral<"emergency">;
|
|
1216
|
+
action: z.ZodLiteral<"activate">;
|
|
1217
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1218
|
+
module: z.ZodLiteral<"emergency">;
|
|
1219
|
+
action: z.ZodLiteral<"deactivate">;
|
|
1220
|
+
}, z.core.$strip>]>, z.ZodUnion<readonly [z.ZodObject<{
|
|
1221
|
+
module: z.ZodLiteral<"lights">;
|
|
1222
|
+
action: z.ZodLiteral<"showColor">;
|
|
1223
|
+
params: z.ZodObject<{
|
|
1224
|
+
address: z.ZodUnion<readonly [z.ZodArray<z.ZodNumber>, z.ZodLiteral<"all">]>;
|
|
1225
|
+
timeDuration: z.ZodNumber;
|
|
1226
|
+
color: z.ZodString;
|
|
1227
|
+
}, z.core.$strip>;
|
|
1228
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1229
|
+
module: z.ZodLiteral<"lights">;
|
|
1230
|
+
action: z.ZodLiteral<"showEffect">;
|
|
1231
|
+
params: z.ZodObject<{
|
|
1232
|
+
addresses: z.ZodUnion<readonly [z.ZodArray<z.ZodNumber>, z.ZodLiteral<"all">]>;
|
|
1233
|
+
effect: z.ZodEnum<{
|
|
1234
|
+
readonly SHOW_UV_COLOR: "SHOW_UV_COLOR";
|
|
1235
|
+
readonly POWER_OFF: "POWER_OFF";
|
|
1236
|
+
readonly START_GAME: "START_GAME";
|
|
1237
|
+
readonly GAME_OVER: "GAME_OVER";
|
|
1238
|
+
readonly FINAL_LAP: "FINAL_LAP";
|
|
1239
|
+
readonly YELLOW_FLAG: "YELLOW_FLAG";
|
|
1240
|
+
readonly RED_FLAG: "RED_FLAG";
|
|
1241
|
+
readonly PULSE: "PULSE";
|
|
1242
|
+
}>;
|
|
1243
|
+
timeDuration: z.ZodNumber;
|
|
1244
|
+
}, z.core.$strip>;
|
|
1245
|
+
}, z.core.$strip>]>]>, z.ZodObject<{
|
|
1246
|
+
params: z.ZodOptional<z.ZodUnknown>;
|
|
1247
|
+
}, z.core.$strip>>>;
|
|
1248
|
+
activationCommands: z.ZodArray<z.ZodIntersection<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
1183
1249
|
module: z.ZodLiteral<"ballSensorDiskThrower">;
|
|
1184
1250
|
action: z.ZodLiteral<"activateSensor">;
|
|
1185
1251
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -1262,7 +1328,7 @@ export declare const powerUpSchema: z.ZodObject<{
|
|
|
1262
1328
|
front: z.ZodBoolean;
|
|
1263
1329
|
back: z.ZodBoolean;
|
|
1264
1330
|
}, z.core.$strip>;
|
|
1265
|
-
mediaSourceName: z.ZodEnum<{
|
|
1331
|
+
mediaSourceName: z.ZodUnion<readonly [z.ZodNumber, z.ZodEnum<{
|
|
1266
1332
|
readonly HEART_00: "heart_00";
|
|
1267
1333
|
readonly HEART_01: "heart_01";
|
|
1268
1334
|
readonly HEART_02: "heart_02";
|
|
@@ -1324,7 +1390,7 @@ export declare const powerUpSchema: z.ZodObject<{
|
|
|
1324
1390
|
readonly STATIC_FIREBALL: "static_fireball";
|
|
1325
1391
|
readonly STATIC_BEATING_HEART: "static_beating_heart";
|
|
1326
1392
|
readonly STATIC_SPEED_PAD: "static_speed_pad";
|
|
1327
|
-
}>;
|
|
1393
|
+
}>]>;
|
|
1328
1394
|
}, z.core.$strip>;
|
|
1329
1395
|
}, z.core.$strip>, z.ZodObject<{
|
|
1330
1396
|
module: z.ZodLiteral<"flag">;
|
|
@@ -1336,7 +1402,7 @@ export declare const powerUpSchema: z.ZodObject<{
|
|
|
1336
1402
|
front: z.ZodBoolean;
|
|
1337
1403
|
back: z.ZodBoolean;
|
|
1338
1404
|
}, z.core.$strip>;
|
|
1339
|
-
mediaSourceName: z.ZodEnum<{
|
|
1405
|
+
mediaSourceName: z.ZodUnion<readonly [z.ZodNumber, z.ZodEnum<{
|
|
1340
1406
|
readonly HEART_00: "heart_00";
|
|
1341
1407
|
readonly HEART_01: "heart_01";
|
|
1342
1408
|
readonly HEART_02: "heart_02";
|
|
@@ -1398,7 +1464,7 @@ export declare const powerUpSchema: z.ZodObject<{
|
|
|
1398
1464
|
readonly STATIC_FIREBALL: "static_fireball";
|
|
1399
1465
|
readonly STATIC_BEATING_HEART: "static_beating_heart";
|
|
1400
1466
|
readonly STATIC_SPEED_PAD: "static_speed_pad";
|
|
1401
|
-
}>;
|
|
1467
|
+
}>]>;
|
|
1402
1468
|
}, z.core.$strip>;
|
|
1403
1469
|
}, z.core.$strip>]>, z.ZodUnion<readonly [z.ZodObject<{
|
|
1404
1470
|
module: z.ZodLiteral<"rgb">;
|
|
@@ -1758,7 +1824,40 @@ export declare const powerUpSchema: z.ZodObject<{
|
|
|
1758
1824
|
}>;
|
|
1759
1825
|
durationMs: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodString]>]>>;
|
|
1760
1826
|
}, z.core.$strip>;
|
|
1761
|
-
}, z.core.$strip
|
|
1827
|
+
}, z.core.$strip>, z.ZodUnion<readonly [z.ZodObject<{
|
|
1828
|
+
module: z.ZodLiteral<"emergency">;
|
|
1829
|
+
action: z.ZodLiteral<"activate">;
|
|
1830
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1831
|
+
module: z.ZodLiteral<"emergency">;
|
|
1832
|
+
action: z.ZodLiteral<"deactivate">;
|
|
1833
|
+
}, z.core.$strip>]>, z.ZodUnion<readonly [z.ZodObject<{
|
|
1834
|
+
module: z.ZodLiteral<"lights">;
|
|
1835
|
+
action: z.ZodLiteral<"showColor">;
|
|
1836
|
+
params: z.ZodObject<{
|
|
1837
|
+
address: z.ZodUnion<readonly [z.ZodArray<z.ZodNumber>, z.ZodLiteral<"all">]>;
|
|
1838
|
+
timeDuration: z.ZodNumber;
|
|
1839
|
+
color: z.ZodString;
|
|
1840
|
+
}, z.core.$strip>;
|
|
1841
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1842
|
+
module: z.ZodLiteral<"lights">;
|
|
1843
|
+
action: z.ZodLiteral<"showEffect">;
|
|
1844
|
+
params: z.ZodObject<{
|
|
1845
|
+
addresses: z.ZodUnion<readonly [z.ZodArray<z.ZodNumber>, z.ZodLiteral<"all">]>;
|
|
1846
|
+
effect: z.ZodEnum<{
|
|
1847
|
+
readonly SHOW_UV_COLOR: "SHOW_UV_COLOR";
|
|
1848
|
+
readonly POWER_OFF: "POWER_OFF";
|
|
1849
|
+
readonly START_GAME: "START_GAME";
|
|
1850
|
+
readonly GAME_OVER: "GAME_OVER";
|
|
1851
|
+
readonly FINAL_LAP: "FINAL_LAP";
|
|
1852
|
+
readonly YELLOW_FLAG: "YELLOW_FLAG";
|
|
1853
|
+
readonly RED_FLAG: "RED_FLAG";
|
|
1854
|
+
readonly PULSE: "PULSE";
|
|
1855
|
+
}>;
|
|
1856
|
+
timeDuration: z.ZodNumber;
|
|
1857
|
+
}, z.core.$strip>;
|
|
1858
|
+
}, z.core.$strip>]>]>, z.ZodObject<{
|
|
1859
|
+
params: z.ZodOptional<z.ZodUnknown>;
|
|
1860
|
+
}, z.core.$strip>>>;
|
|
1762
1861
|
shield: z.ZodOptional<z.ZodObject<{
|
|
1763
1862
|
duration: z.ZodNumber;
|
|
1764
1863
|
}, z.core.$strip>>;
|
|
@@ -61,7 +61,7 @@ export declare const paginatedRacingTeamSummarySchema: z.ZodObject<{
|
|
|
61
61
|
export declare const joinRequestSchema: z.ZodObject<{
|
|
62
62
|
id: z.ZodString;
|
|
63
63
|
racingTeamId: z.ZodString;
|
|
64
|
-
|
|
64
|
+
playerId: z.ZodString;
|
|
65
65
|
status: z.ZodEnum<{
|
|
66
66
|
readonly PENDING: "PENDING";
|
|
67
67
|
readonly ACCEPTED: "ACCEPTED";
|
|
@@ -71,19 +71,93 @@ export declare const joinRequestSchema: z.ZodObject<{
|
|
|
71
71
|
updatedAt: z.ZodDate;
|
|
72
72
|
}, z.core.$strip>;
|
|
73
73
|
export declare const teamMemberSchema: z.ZodObject<{
|
|
74
|
+
id: z.ZodString;
|
|
74
75
|
racingTeamId: z.ZodString;
|
|
75
|
-
|
|
76
|
+
playerId: z.ZodString;
|
|
76
77
|
role: z.ZodEnum<{
|
|
77
78
|
readonly PILOT: "PILOT";
|
|
78
79
|
readonly TECHNICIAN: "TECHNICIAN";
|
|
79
80
|
}>;
|
|
80
81
|
joinedAt: z.ZodDate;
|
|
81
82
|
}, z.core.$strip>;
|
|
83
|
+
export declare const teamMemberWithPlayerSchema: z.ZodObject<{
|
|
84
|
+
id: z.ZodUUID;
|
|
85
|
+
nickname: z.ZodString;
|
|
86
|
+
avatarUrl: z.ZodOptional<z.ZodURL>;
|
|
87
|
+
birthDate: z.ZodDate;
|
|
88
|
+
type: z.ZodDefault<z.ZodEnum<{
|
|
89
|
+
readonly ADULT: "ADULT";
|
|
90
|
+
readonly MINOR: "MINOR";
|
|
91
|
+
}>>;
|
|
92
|
+
ownerUserId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
93
|
+
isGuest: z.ZodDefault<z.ZodBoolean>;
|
|
94
|
+
waiver: z.ZodObject<{
|
|
95
|
+
isSigned: z.ZodDefault<z.ZodBoolean>;
|
|
96
|
+
waiverId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
97
|
+
templateVersion: z.ZodOptional<z.ZodString>;
|
|
98
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
99
|
+
}, z.core.$strip>;
|
|
100
|
+
stats: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
101
|
+
totalRaces: z.ZodDefault<z.ZodNumber>;
|
|
102
|
+
bestTimeMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
103
|
+
xp: z.ZodDefault<z.ZodNumber>;
|
|
104
|
+
}, z.core.$strip>>>;
|
|
105
|
+
createdAt: z.ZodDate;
|
|
106
|
+
updatedAt: z.ZodDate;
|
|
107
|
+
role: z.ZodEnum<{
|
|
108
|
+
readonly PILOT: "PILOT";
|
|
109
|
+
readonly TECHNICIAN: "TECHNICIAN";
|
|
110
|
+
}>;
|
|
111
|
+
joinedAt: z.ZodDate;
|
|
112
|
+
}, z.core.$strip>;
|
|
113
|
+
export declare const racingTeamWithMembersSchema: z.ZodObject<{
|
|
114
|
+
id: z.ZodString;
|
|
115
|
+
name: z.ZodString;
|
|
116
|
+
imageUrl: z.ZodOptional<z.ZodURL>;
|
|
117
|
+
adminUserId: z.ZodString;
|
|
118
|
+
createdAt: z.ZodDate;
|
|
119
|
+
updatedAt: z.ZodDate;
|
|
120
|
+
members: z.ZodArray<z.ZodObject<{
|
|
121
|
+
id: z.ZodUUID;
|
|
122
|
+
nickname: z.ZodString;
|
|
123
|
+
avatarUrl: z.ZodOptional<z.ZodURL>;
|
|
124
|
+
birthDate: z.ZodDate;
|
|
125
|
+
type: z.ZodDefault<z.ZodEnum<{
|
|
126
|
+
readonly ADULT: "ADULT";
|
|
127
|
+
readonly MINOR: "MINOR";
|
|
128
|
+
}>>;
|
|
129
|
+
ownerUserId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
130
|
+
isGuest: z.ZodDefault<z.ZodBoolean>;
|
|
131
|
+
waiver: z.ZodObject<{
|
|
132
|
+
isSigned: z.ZodDefault<z.ZodBoolean>;
|
|
133
|
+
waiverId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
134
|
+
templateVersion: z.ZodOptional<z.ZodString>;
|
|
135
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
136
|
+
}, z.core.$strip>;
|
|
137
|
+
stats: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
138
|
+
totalRaces: z.ZodDefault<z.ZodNumber>;
|
|
139
|
+
bestTimeMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
140
|
+
xp: z.ZodDefault<z.ZodNumber>;
|
|
141
|
+
}, z.core.$strip>>>;
|
|
142
|
+
createdAt: z.ZodDate;
|
|
143
|
+
updatedAt: z.ZodDate;
|
|
144
|
+
role: z.ZodEnum<{
|
|
145
|
+
readonly PILOT: "PILOT";
|
|
146
|
+
readonly TECHNICIAN: "TECHNICIAN";
|
|
147
|
+
}>;
|
|
148
|
+
joinedAt: z.ZodDate;
|
|
149
|
+
}, z.core.$strip>>;
|
|
150
|
+
}, z.core.$strip>;
|
|
82
151
|
export declare const createJoinRequestSchema: z.ZodObject<{
|
|
83
152
|
racingTeamId: z.ZodString;
|
|
153
|
+
playerId: z.ZodString;
|
|
84
154
|
}, z.core.$strip>;
|
|
85
155
|
export declare const answerJoinRequestSchema: z.ZodObject<{
|
|
86
156
|
racingTeamId: z.ZodString;
|
|
87
|
-
|
|
157
|
+
targetPlayerId: z.ZodString;
|
|
88
158
|
accepted: z.ZodBoolean;
|
|
89
159
|
}, z.core.$strip>;
|
|
160
|
+
export declare const addTeamMemberSchema: z.ZodObject<{
|
|
161
|
+
nickname: z.ZodString;
|
|
162
|
+
birthDate: z.ZodCoercedDate<unknown>;
|
|
163
|
+
}, z.core.$strip>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.answerJoinRequestSchema = exports.createJoinRequestSchema = exports.teamMemberSchema = exports.joinRequestSchema = exports.paginatedRacingTeamSummarySchema = exports.paginatedRacingTeamSchema = exports.racingTeamSummarySchema = exports.filterRacingTeamSchema = exports.updateRacingTeamSchema = exports.createRacingTeamSchema = exports.racingTeamSchema = void 0;
|
|
3
|
+
exports.addTeamMemberSchema = exports.answerJoinRequestSchema = exports.createJoinRequestSchema = exports.racingTeamWithMembersSchema = exports.teamMemberWithPlayerSchema = exports.teamMemberSchema = exports.joinRequestSchema = exports.paginatedRacingTeamSummarySchema = exports.paginatedRacingTeamSchema = exports.racingTeamSummarySchema = exports.filterRacingTeamSchema = exports.updateRacingTeamSchema = exports.createRacingTeamSchema = exports.racingTeamSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const pagination_1 = require("../pagination");
|
|
6
6
|
const RacingTeam_const_1 = require("./RacingTeam.const");
|
|
7
|
+
const Player_schema_1 = require("../player/Player.schema");
|
|
7
8
|
// --- Team Schemas ---
|
|
8
9
|
exports.racingTeamSchema = zod_1.z.object({
|
|
9
10
|
id: zod_1.z.string(),
|
|
@@ -38,22 +39,35 @@ exports.paginatedRacingTeamSummarySchema = (0, pagination_1.paginatedResponseSch
|
|
|
38
39
|
exports.joinRequestSchema = zod_1.z.object({
|
|
39
40
|
id: zod_1.z.string(),
|
|
40
41
|
racingTeamId: zod_1.z.string(),
|
|
41
|
-
|
|
42
|
+
playerId: zod_1.z.string(),
|
|
42
43
|
status: zod_1.z.enum(RacingTeam_const_1.JOIN_REQUEST_STATUS),
|
|
43
44
|
createdAt: zod_1.z.date(),
|
|
44
45
|
updatedAt: zod_1.z.date(),
|
|
45
46
|
});
|
|
46
47
|
exports.teamMemberSchema = zod_1.z.object({
|
|
48
|
+
id: zod_1.z.string(),
|
|
47
49
|
racingTeamId: zod_1.z.string(),
|
|
48
|
-
|
|
50
|
+
playerId: zod_1.z.string(),
|
|
51
|
+
role: zod_1.z.enum(RacingTeam_const_1.RACING_TEAM_ROLE),
|
|
52
|
+
joinedAt: zod_1.z.date(),
|
|
53
|
+
});
|
|
54
|
+
exports.teamMemberWithPlayerSchema = Player_schema_1.playerSchema.extend({
|
|
49
55
|
role: zod_1.z.enum(RacingTeam_const_1.RACING_TEAM_ROLE),
|
|
50
56
|
joinedAt: zod_1.z.date(),
|
|
51
57
|
});
|
|
58
|
+
exports.racingTeamWithMembersSchema = exports.racingTeamSchema.extend({
|
|
59
|
+
members: zod_1.z.array(exports.teamMemberWithPlayerSchema),
|
|
60
|
+
});
|
|
52
61
|
exports.createJoinRequestSchema = zod_1.z.object({
|
|
53
62
|
racingTeamId: zod_1.z.string(),
|
|
63
|
+
playerId: zod_1.z.string(),
|
|
54
64
|
});
|
|
55
65
|
exports.answerJoinRequestSchema = zod_1.z.object({
|
|
56
66
|
racingTeamId: zod_1.z.string(),
|
|
57
|
-
|
|
67
|
+
targetPlayerId: zod_1.z.string(),
|
|
58
68
|
accepted: zod_1.z.boolean(),
|
|
59
69
|
});
|
|
70
|
+
exports.addTeamMemberSchema = zod_1.z.object({
|
|
71
|
+
nickname: zod_1.z.string().min(2).max(20),
|
|
72
|
+
birthDate: zod_1.z.coerce.date(),
|
|
73
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { answerJoinRequestSchema, createJoinRequestSchema, createRacingTeamSchema, joinRequestSchema, paginatedRacingTeamSchema, paginatedRacingTeamSummarySchema, racingTeamSchema, racingTeamSummarySchema, teamMemberSchema, updateRacingTeamSchema } from './RacingTeam.schema';
|
|
2
|
+
import { answerJoinRequestSchema, createJoinRequestSchema, createRacingTeamSchema, joinRequestSchema, paginatedRacingTeamSchema, paginatedRacingTeamSummarySchema, racingTeamWithMembersSchema, racingTeamSchema, racingTeamSummarySchema, teamMemberWithPlayerSchema, teamMemberSchema, updateRacingTeamSchema, addTeamMemberSchema } from './RacingTeam.schema';
|
|
3
3
|
export type RacingTeam = z.infer<typeof racingTeamSchema>;
|
|
4
4
|
export type CreateRacingTeamInput = z.infer<typeof createRacingTeamSchema>;
|
|
5
5
|
export type UpdateRacingTeamInput = z.infer<typeof updateRacingTeamSchema>;
|
|
@@ -10,3 +10,6 @@ export type JoinRequest = z.infer<typeof joinRequestSchema>;
|
|
|
10
10
|
export type TeamMember = z.infer<typeof teamMemberSchema>;
|
|
11
11
|
export type CreateJoinRequest = z.infer<typeof createJoinRequestSchema>;
|
|
12
12
|
export type AnswerJoinRequest = z.infer<typeof answerJoinRequestSchema>;
|
|
13
|
+
export type TeamMemberWithPlayer = z.infer<typeof teamMemberWithPlayerSchema>;
|
|
14
|
+
export type RacingTeamWithMembers = z.infer<typeof racingTeamWithMembersSchema>;
|
|
15
|
+
export type AddTeamMember = z.infer<typeof addTeamMemberSchema>;
|