@battle-racing/br-common-lib 4.5.0 → 4.6.1

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.
Files changed (86) hide show
  1. package/dist/domains/command/Command.schema.d.ts +76 -10
  2. package/dist/domains/command/Command.schema.js +17 -3
  3. package/dist/domains/command/Command.types.d.ts +3 -1
  4. package/dist/domains/damage/Damage.schema.d.ts +2 -2
  5. package/dist/domains/flow/Flow.schema.d.ts +39 -6
  6. package/dist/domains/hardware/KartHardwareState.schema.js +8 -8
  7. package/dist/domains/hardware/KartHardwareState.types.d.ts +3 -0
  8. package/dist/domains/hardware/KartHardwareState.types.js +2 -0
  9. package/dist/domains/hardware/ModuleStatus.schema.d.ts +28 -0
  10. package/dist/domains/hardware/ModuleStatus.schema.js +4 -0
  11. package/dist/domains/hardware/ballSensor/BallSensor.const.d.ts +5 -0
  12. package/dist/domains/hardware/ballSensor/BallSensor.const.js +6 -1
  13. package/dist/domains/hardware/ballSensor/BallSensor.schema.d.ts +5 -0
  14. package/dist/domains/hardware/ballSensor/BallSensor.schema.js +2 -1
  15. package/dist/domains/hardware/ballSensor/BallSensor.types.d.ts +2 -1
  16. package/dist/domains/hardware/flag/Flag.const.d.ts +7 -0
  17. package/dist/domains/hardware/flag/Flag.const.js +8 -1
  18. package/dist/domains/hardware/flag/Flag.schema.d.ts +11 -4
  19. package/dist/domains/hardware/flag/Flag.schema.js +5 -2
  20. package/dist/domains/hardware/flag/Flag.types.d.ts +2 -1
  21. package/dist/domains/hardware/index.d.ts +1 -0
  22. package/dist/domains/hardware/index.js +2 -1
  23. package/dist/domains/hardware/lights/Lights.const.d.ts +4 -0
  24. package/dist/domains/hardware/lights/Lights.const.js +5 -1
  25. package/dist/domains/hardware/lights/Lights.schema.d.ts +16 -0
  26. package/dist/domains/hardware/lights/Lights.schema.js +5 -1
  27. package/dist/domains/hardware/lights/Lights.types.d.ts +3 -1
  28. package/dist/domains/hardware/rgb/RGB.const.d.ts +4 -0
  29. package/dist/domains/hardware/rgb/RGB.const.js +5 -1
  30. package/dist/domains/hardware/rgb/RGB.schema.d.ts +4 -0
  31. package/dist/domains/hardware/rgb/RGB.schema.js +2 -1
  32. package/dist/domains/hardware/rgb/RGB.types.d.ts +2 -1
  33. package/dist/domains/hardware/sound/Sound.const.d.ts +3 -0
  34. package/dist/domains/hardware/sound/Sound.const.js +4 -1
  35. package/dist/domains/hardware/sound/Sound.schema.d.ts +3 -0
  36. package/dist/domains/hardware/sound/Sound.schema.js +2 -1
  37. package/dist/domains/hardware/sound/Sound.types.d.ts +2 -1
  38. package/dist/domains/hardware/steering-wheel/SteeringWheel.const.d.ts +4 -0
  39. package/dist/domains/hardware/steering-wheel/SteeringWheel.const.js +7 -0
  40. package/dist/domains/hardware/steering-wheel/SteeringWheel.schema.d.ts +4 -0
  41. package/dist/domains/hardware/steering-wheel/SteeringWheel.schema.js +3 -1
  42. package/dist/domains/hardware/steering-wheel/SteeringWheel.types.d.ts +2 -1
  43. package/dist/domains/powerUp/PowerUp.schema.d.ts +117 -18
  44. package/dist/domains/session/Session.schema.d.ts +2 -0
  45. package/dist/domains/socket/index.d.ts +1 -0
  46. package/dist/domains/socket/index.js +1 -0
  47. package/dist/domains/socket/screen/SocketScreenServerToClientEventsParams.d.ts +14 -0
  48. package/dist/domains/socket/screen/SocketScreenServerToClientEventsParams.js +2 -0
  49. package/dist/domains/socket/screen/index.d.ts +1 -0
  50. package/dist/domains/socket/screen/index.js +17 -0
  51. package/dist/domains/ticketing/Ticketing.schema.d.ts +4 -0
  52. package/dist/domains/ticketing/Ticketing.schema.js +2 -0
  53. package/dist/domains/user/User.schema.d.ts +24 -9
  54. package/dist/domains/user/User.schema.js +15 -3
  55. package/dist/domains/user/User.types.d.ts +2 -1
  56. package/package.json +1 -1
  57. package/src/domains/command/Command.schema.ts +30 -12
  58. package/src/domains/command/Command.types.ts +4 -0
  59. package/src/domains/hardware/KartHardwareState.schema.ts +4 -4
  60. package/src/domains/hardware/KartHardwareState.types.ts +4 -0
  61. package/src/domains/hardware/ModuleStatus.schema.ts +4 -0
  62. package/src/domains/hardware/ballSensor/BallSensor.const.ts +6 -0
  63. package/src/domains/hardware/ballSensor/BallSensor.schema.ts +3 -1
  64. package/src/domains/hardware/ballSensor/BallSensor.types.ts +2 -0
  65. package/src/domains/hardware/flag/Flag.const.ts +8 -0
  66. package/src/domains/hardware/flag/Flag.schema.ts +6 -2
  67. package/src/domains/hardware/flag/Flag.types.ts +2 -0
  68. package/src/domains/hardware/index.ts +2 -1
  69. package/src/domains/hardware/lights/Lights.const.ts +5 -0
  70. package/src/domains/hardware/lights/Lights.schema.ts +7 -1
  71. package/src/domains/hardware/lights/Lights.types.ts +9 -1
  72. package/src/domains/hardware/rgb/RGB.const.ts +5 -0
  73. package/src/domains/hardware/rgb/RGB.schema.ts +3 -1
  74. package/src/domains/hardware/rgb/RGB.types.ts +2 -0
  75. package/src/domains/hardware/sound/Sound.const.ts +4 -0
  76. package/src/domains/hardware/sound/Sound.schema.ts +3 -1
  77. package/src/domains/hardware/sound/Sound.types.ts +3 -1
  78. package/src/domains/hardware/steering-wheel/SteeringWheel.const.ts +4 -0
  79. package/src/domains/hardware/steering-wheel/SteeringWheel.schema.ts +3 -0
  80. package/src/domains/hardware/steering-wheel/SteeringWheel.types.ts +3 -1
  81. package/src/domains/socket/index.ts +1 -0
  82. package/src/domains/socket/screen/SocketScreenServerToClientEventsParams.ts +19 -0
  83. package/src/domains/socket/screen/index.ts +1 -0
  84. package/src/domains/ticketing/Ticketing.schema.ts +2 -0
  85. package/src/domains/user/User.schema.ts +15 -2
  86. package/src/domains/user/User.types.ts +7 -5
@@ -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>;
@@ -6,3 +6,7 @@ export declare const RGB_STATUS: {
6
6
  readonly UNKNOWN: "Unknown";
7
7
  readonly ERROR: "Error";
8
8
  };
9
+ export declare const RGB_ACTION_COMMANDS: {
10
+ readonly EXEC: "Exec";
11
+ readonly CONFIGURE: "Configure";
12
+ };
@@ -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,3 +1,6 @@
1
1
  export declare const PLAY_SOUND_DURATION: {
2
2
  readonly INFINITE: "infinite";
3
3
  };
4
+ export declare const SOUND_ACTION_COMMAND: {
5
+ readonly PLAY: "Play";
6
+ };
@@ -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,4 +1,7 @@
1
1
  import { z } from 'zod';
2
+ export declare const soundActionCommandSchema: z.ZodEnum<{
3
+ readonly PLAY: "Play";
4
+ }>;
2
5
  export declare const playSoundOptionsSchema: z.ZodObject<{
3
6
  soundName: z.ZodEnum<{
4
7
  readonly BATTLE_GOD_ACTIVATION: "battle_god_activation.mp3";
@@ -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>;
@@ -0,0 +1,4 @@
1
+ export declare const STEERING_WHEEL_ACTION_COMMAND: {
2
+ readonly TURN_LED_ON: "TurnLedOn";
3
+ readonly TURN_LED_OFF: "TurnLedOff";
4
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.STEERING_WHEEL_ACTION_COMMAND = void 0;
4
+ exports.STEERING_WHEEL_ACTION_COMMAND = {
5
+ TURN_LED_ON: 'TurnLedOn',
6
+ TURN_LED_OFF: 'TurnLedOff',
7
+ };
@@ -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>;
@@ -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
- activationCommands: z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
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>>;
@@ -118,6 +118,8 @@ export declare const gameSessionWithPlayersSchema: z.ZodObject<{
118
118
  }, z.core.$strip>>;
119
119
  turns: z.ZodOptional<z.ZodArray<z.ZodObject<{
120
120
  id: z.ZodString;
121
+ turnNumber: z.ZodNumber;
122
+ groupName: z.ZodOptional<z.ZodString>;
121
123
  purchaseId: z.ZodString;
122
124
  sessionId: z.ZodOptional<z.ZodString>;
123
125
  leaderPlayerId: z.ZodString;
@@ -5,3 +5,4 @@ export * from './SocketHardwareModulesEventsParams';
5
5
  export * from './SocketHardwareOnDataEventsParams';
6
6
  export * from './SocketPowerUpEventsParams';
7
7
  export * from './utils';
8
+ export * from './screen';
@@ -21,3 +21,4 @@ __exportStar(require("./SocketHardwareModulesEventsParams"), exports);
21
21
  __exportStar(require("./SocketHardwareOnDataEventsParams"), exports);
22
22
  __exportStar(require("./SocketPowerUpEventsParams"), exports);
23
23
  __exportStar(require("./utils"), exports);
24
+ __exportStar(require("./screen"), exports);
@@ -0,0 +1,14 @@
1
+ import type { ScreenCountdownParams, ScreenDebugViewInput, ScreenFinishViewInput, ScreenHomeViewInput, ScreenUpdateGameViewInput } from '../../hardware';
2
+ /**
3
+ * Socket events from Raspberry Pi to Screen
4
+ */
5
+ export interface SocketScreenServerToClientEventsParams {
6
+ 'view:home': ScreenHomeViewInput;
7
+ 'view:countdown': ScreenCountdownParams;
8
+ 'game:sync_state': ScreenUpdateGameViewInput;
9
+ 'view:summary': ScreenFinishViewInput & {
10
+ state: 'Victory' | 'Defeat';
11
+ };
12
+ 'view:debug': ScreenDebugViewInput;
13
+ 'view:instruction_video': Record<string, never>;
14
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from './SocketScreenServerToClientEventsParams';
@@ -0,0 +1,17 @@
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("./SocketScreenServerToClientEventsParams"), exports);
@@ -136,6 +136,8 @@ export declare const gameTurnTaskSchema: z.ZodObject<{
136
136
  }, z.core.$strip>;
137
137
  export declare const gameTurnSchema: z.ZodObject<{
138
138
  id: z.ZodString;
139
+ turnNumber: z.ZodNumber;
140
+ groupName: z.ZodOptional<z.ZodString>;
139
141
  purchaseId: z.ZodString;
140
142
  sessionId: z.ZodOptional<z.ZodString>;
141
143
  leaderPlayerId: z.ZodString;
@@ -170,6 +172,8 @@ export declare const gameTurnSchema: z.ZodObject<{
170
172
  }, z.core.$strip>;
171
173
  export declare const gameTurnQueueItemSchema: z.ZodObject<{
172
174
  id: z.ZodString;
175
+ turnNumber: z.ZodNumber;
176
+ groupName: z.ZodOptional<z.ZodString>;
173
177
  purchaseId: z.ZodString;
174
178
  sessionId: z.ZodOptional<z.ZodString>;
175
179
  leaderPlayerId: z.ZodString;
@@ -63,6 +63,8 @@ exports.gameTurnTaskSchema = zod_1.z.object({
63
63
  });
64
64
  exports.gameTurnSchema = zod_1.z.object({
65
65
  id: zod_1.z.string(),
66
+ turnNumber: zod_1.z.number().int().positive(),
67
+ groupName: zod_1.z.string().optional(),
66
68
  purchaseId: zod_1.z.string(),
67
69
  sessionId: zod_1.z.string().optional(),
68
70
  leaderPlayerId: zod_1.z.string(),
@@ -7,8 +7,8 @@ export declare const PHONE_REGEX: RegExp;
7
7
  export declare const emailOrPhoneSchema: z.ZodString;
8
8
  export declare const userSchema: z.ZodObject<{
9
9
  id: z.ZodUUID;
10
- name: z.ZodString;
11
- lastName: z.ZodString;
10
+ name: z.ZodOptional<z.ZodString>;
11
+ lastName: z.ZodOptional<z.ZodString>;
12
12
  email: z.ZodNullable<z.ZodOptional<z.ZodEmail>>;
13
13
  phoneNumber: z.ZodNullable<z.ZodOptional<z.ZodString>>;
14
14
  role: z.ZodEnum<{
@@ -28,13 +28,28 @@ export declare const userSchema: z.ZodObject<{
28
28
  createdAt: z.ZodDate;
29
29
  lastLoginAt: z.ZodOptional<z.ZodDate>;
30
30
  }, z.core.$strip>;
31
+ /**
32
+ * When a user registers, we don't have all the information, so we use this schema
33
+ */
34
+ export declare const initialUserSchema: z.ZodObject<{
35
+ type: z.ZodEnum<{
36
+ readonly STAFF: "STAFF";
37
+ readonly PLAYER: "PLAYER";
38
+ }>;
39
+ id: z.ZodUUID;
40
+ createdAt: z.ZodDate;
41
+ email: z.ZodNullable<z.ZodOptional<z.ZodEmail>>;
42
+ phoneNumber: z.ZodNullable<z.ZodOptional<z.ZodString>>;
43
+ isEmailVerified: z.ZodDefault<z.ZodBoolean>;
44
+ isPhoneVerified: z.ZodDefault<z.ZodBoolean>;
45
+ }, z.core.$strip>;
31
46
  /**
32
47
  * The schema for the user returned on login
33
48
  */
34
49
  export declare const authUserSchema: z.ZodObject<{
35
50
  id: z.ZodUUID;
36
- name: z.ZodString;
37
- lastName: z.ZodString;
51
+ name: z.ZodOptional<z.ZodString>;
52
+ lastName: z.ZodOptional<z.ZodString>;
38
53
  email: z.ZodNullable<z.ZodOptional<z.ZodEmail>>;
39
54
  phoneNumber: z.ZodNullable<z.ZodOptional<z.ZodString>>;
40
55
  role: z.ZodEnum<{
@@ -57,8 +72,8 @@ export declare const authUserSchema: z.ZodObject<{
57
72
  }, z.core.$strip>;
58
73
  export declare const userWithPasswordSchema: z.ZodIntersection<z.ZodObject<{
59
74
  id: z.ZodUUID;
60
- name: z.ZodString;
61
- lastName: z.ZodString;
75
+ name: z.ZodOptional<z.ZodString>;
76
+ lastName: z.ZodOptional<z.ZodString>;
62
77
  email: z.ZodNullable<z.ZodOptional<z.ZodEmail>>;
63
78
  phoneNumber: z.ZodNullable<z.ZodOptional<z.ZodString>>;
64
79
  role: z.ZodEnum<{
@@ -89,7 +104,7 @@ export declare const userVerifySchema: z.ZodObject<{
89
104
  code: z.ZodString;
90
105
  }, z.core.$strip>;
91
106
  export declare const userCompleteProfileSchema: z.ZodObject<{
92
- name: z.ZodString;
107
+ name: z.ZodOptional<z.ZodString>;
93
108
  lastName: z.ZodOptional<z.ZodString>;
94
109
  nickname: z.ZodString;
95
110
  birthDate: z.ZodCoercedDate<unknown>;
@@ -97,9 +112,9 @@ export declare const userCompleteProfileSchema: z.ZodObject<{
97
112
  teamName: z.ZodOptional<z.ZodString>;
98
113
  }, z.core.$strip>;
99
114
  export declare const userRegistrationInputSchema: z.ZodObject<{
100
- name: z.ZodString;
115
+ name: z.ZodOptional<z.ZodString>;
101
116
  email: z.ZodNullable<z.ZodOptional<z.ZodEmail>>;
102
- lastName: z.ZodString;
117
+ lastName: z.ZodOptional<z.ZodString>;
103
118
  phoneNumber: z.ZodNullable<z.ZodOptional<z.ZodString>>;
104
119
  password: z.ZodString;
105
120
  nickname: z.ZodString;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.userLoginInputSchema = exports.userRegistrationInputSchema = exports.userCompleteProfileSchema = exports.userVerifySchema = exports.userInitialRegistrationSchema = exports.userWithPasswordSchema = exports.authUserSchema = exports.userSchema = exports.emailOrPhoneSchema = exports.PHONE_REGEX = exports.userTypeSchema = void 0;
3
+ exports.userLoginInputSchema = exports.userRegistrationInputSchema = exports.userCompleteProfileSchema = exports.userVerifySchema = exports.userInitialRegistrationSchema = exports.userWithPasswordSchema = exports.authUserSchema = exports.initialUserSchema = exports.userSchema = exports.emailOrPhoneSchema = exports.PHONE_REGEX = exports.userTypeSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const role_1 = require("../role");
6
6
  const User_const_1 = require("./User.const");
@@ -17,8 +17,8 @@ exports.emailOrPhoneSchema = zod_1.z
17
17
  }, { message: 'Must be a valid email or phone number' });
18
18
  const baseUserObj = zod_1.z.object({
19
19
  id: zod_1.z.uuidv4(),
20
- name: zod_1.z.string(),
21
- lastName: zod_1.z.string(),
20
+ name: zod_1.z.string().optional(),
21
+ lastName: zod_1.z.string().optional(),
22
22
  email: zod_1.z.email().toLowerCase().optional().nullable(),
23
23
  phoneNumber: zod_1.z.string().regex(exports.PHONE_REGEX, 'Invalid phone number format').optional().nullable(),
24
24
  // --- ACCESS CONTROL ---
@@ -36,6 +36,18 @@ exports.userSchema = baseUserObj.refine((data) => data.email || data.phoneNumber
36
36
  message: 'User must have either an email or a phone number',
37
37
  path: ['email', 'phoneNumber'],
38
38
  });
39
+ /**
40
+ * When a user registers, we don't have all the information, so we use this schema
41
+ */
42
+ exports.initialUserSchema = baseUserObj.pick({
43
+ id: true,
44
+ email: true,
45
+ phoneNumber: true,
46
+ isEmailVerified: true,
47
+ isPhoneVerified: true,
48
+ type: true,
49
+ createdAt: true,
50
+ });
39
51
  /**
40
52
  * The schema for the user returned on login
41
53
  */