@battle-racing/br-common-lib 4.1.0 → 4.4.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.
Files changed (168) hide show
  1. package/.agents/rules/01-naming-and-typing.md +14 -0
  2. package/.agents/rules/02-architecture-and-routing.md +15 -0
  3. package/.agents/rules/03-state-and-data.md +10 -0
  4. package/.agents/rules/04-ui-and-styling.md +10 -0
  5. package/.agents/rules/05-code-quality-and-practices.md +10 -0
  6. package/dist/__deprecated__/constants/checkpoint-type.d.ts +6 -0
  7. package/dist/__deprecated__/constants/checkpoint-type.js +9 -0
  8. package/dist/__deprecated__/constants/hardware/base-hardware-status.d.ts +6 -0
  9. package/dist/__deprecated__/constants/hardware/base-hardware-status.js +9 -0
  10. package/dist/__deprecated__/constants/hardware/damage.d.ts +10 -0
  11. package/dist/__deprecated__/constants/hardware/damage.js +13 -0
  12. package/dist/__deprecated__/constants/hardware/flag-media-name.d.ts +63 -0
  13. package/dist/__deprecated__/constants/hardware/flag-media-name.js +71 -0
  14. package/dist/__deprecated__/constants/hardware/flag-status.d.ts +10 -0
  15. package/dist/__deprecated__/constants/hardware/flag-status.js +11 -0
  16. package/dist/__deprecated__/constants/hardware/index.js +25 -0
  17. package/dist/__deprecated__/constants/hardware/lights-effect.d.ts +10 -0
  18. package/dist/__deprecated__/constants/hardware/lights-effect.js +14 -0
  19. package/dist/__deprecated__/constants/hardware/rgb-status.d.ts +8 -0
  20. package/dist/__deprecated__/constants/hardware/rgb-status.js +11 -0
  21. package/dist/__deprecated__/constants/hardware/screen-status.d.ts +7 -0
  22. package/dist/__deprecated__/constants/hardware/screen-status.js +8 -0
  23. package/dist/__deprecated__/constants/hardware/screen-view.d.ts +9 -0
  24. package/dist/__deprecated__/constants/hardware/screen-view.js +12 -0
  25. package/dist/__deprecated__/constants/hardware/speed-status.d.ts +9 -0
  26. package/dist/__deprecated__/constants/hardware/speed-status.js +10 -0
  27. package/dist/__deprecated__/constants/index.js +25 -0
  28. package/dist/__deprecated__/constants/kart-status.d.ts +12 -0
  29. package/dist/__deprecated__/constants/kart-status.js +15 -0
  30. package/dist/__deprecated__/constants/module-name.d.ts +12 -0
  31. package/dist/__deprecated__/constants/module-name.js +15 -0
  32. package/dist/__deprecated__/constants/payment-provider.d.ts +5 -0
  33. package/dist/__deprecated__/constants/payment-provider.js +8 -0
  34. package/dist/__deprecated__/constants/payment-status.d.ts +7 -0
  35. package/dist/__deprecated__/constants/payment-status.js +10 -0
  36. package/dist/__deprecated__/constants/permission.d.ts +12 -0
  37. package/dist/__deprecated__/constants/permission.js +15 -0
  38. package/dist/__deprecated__/constants/racing-team-role.d.ts +5 -0
  39. package/dist/__deprecated__/constants/racing-team-role.js +8 -0
  40. package/dist/__deprecated__/constants/user-role.d.ts +5 -0
  41. package/dist/__deprecated__/constants/user-role.js +8 -0
  42. package/dist/__deprecated__/types/checkpoint/CheckpointType.d.ts +1 -1
  43. package/dist/__deprecated__/types/damage/DamageName.d.ts +1 -1
  44. package/dist/__deprecated__/types/hardware/ModuleName.d.ts +1 -1
  45. package/dist/__deprecated__/types/hardware/flag/FlagMediaName.d.ts +1 -1
  46. package/dist/__deprecated__/types/hardware/flag/FlagStatus.d.ts +1 -1
  47. package/dist/__deprecated__/types/hardware/lights/LightsEffect.d.ts +1 -1
  48. package/dist/__deprecated__/types/hardware/rgb/RGBStatus.d.ts +1 -1
  49. package/dist/__deprecated__/types/hardware/screen/ScreenFinishViewInput.d.ts +1 -1
  50. package/dist/__deprecated__/types/hardware/screen/ScreenStatus.d.ts +1 -1
  51. package/dist/__deprecated__/types/hardware/screen/ScreenView.d.ts +1 -1
  52. package/dist/__deprecated__/types/hardware/speed/SpeedStatus.d.ts +1 -1
  53. package/dist/__deprecated__/types/kart/KartStatus.d.ts +1 -1
  54. package/dist/__deprecated__/types/racingTeam/RacingTeamMembership.schema.js +1 -1
  55. package/dist/__deprecated__/types/role/Permission.d.ts +1 -1
  56. package/dist/__deprecated__/types/role/UserRole.d.ts +1 -1
  57. package/dist/__deprecated__/types/ticketing/GameTurn.schema.d.ts +9 -9
  58. package/dist/__deprecated__/types/ticketing/GameTurn.schema.js +2 -2
  59. package/dist/__deprecated__/types/ticketing/GameTurnTask.schema.d.ts +2 -2
  60. package/dist/__deprecated__/types/ticketing/PaymentProvider.d.ts +1 -1
  61. package/dist/__deprecated__/types/ticketing/ticketing.schemas.d.ts +1 -2
  62. package/dist/__deprecated__/types/ticketing/ticketing.schemas.js +0 -1
  63. package/dist/__deprecated__/types/user/user.schema.js +1 -1
  64. package/dist/domains/damage/Damage.schema.js +4 -3
  65. package/dist/domains/game/race/Race.schema.d.ts +2 -2
  66. package/dist/domains/hardware/KartHardwareState.schema.js +10 -10
  67. package/dist/domains/hardware/screen/Screen.schema.d.ts +0 -52
  68. package/dist/domains/hardware/screen/Screen.schema.js +5 -9
  69. package/dist/domains/hardware/screen/Screen.types.d.ts +2 -1
  70. package/dist/domains/hardware/screen/ScreenDebug.schema.d.ts +53 -0
  71. package/dist/domains/hardware/screen/ScreenDebug.schema.js +8 -0
  72. package/dist/domains/hardware/screen/index.d.ts +1 -0
  73. package/dist/domains/hardware/screen/index.js +1 -0
  74. package/dist/domains/index.d.ts +2 -0
  75. package/dist/domains/index.js +2 -0
  76. package/dist/domains/kart/Kart.schema.js +2 -2
  77. package/dist/domains/player/Player.const.d.ts +4 -0
  78. package/dist/domains/player/Player.const.js +7 -0
  79. package/dist/domains/player/Player.schema.d.ts +53 -0
  80. package/dist/domains/player/Player.schema.js +47 -0
  81. package/dist/domains/player/Player.types.d.ts +6 -0
  82. package/dist/domains/player/Player.types.js +2 -0
  83. package/dist/domains/player/index.d.ts +3 -0
  84. package/dist/domains/player/index.js +19 -0
  85. package/dist/domains/role/Role.const.d.ts +1 -0
  86. package/dist/domains/role/Role.const.js +1 -0
  87. package/dist/domains/role/Role.schema.d.ts +1 -0
  88. package/dist/domains/session/Session.const.d.ts +8 -0
  89. package/dist/domains/session/Session.const.js +11 -0
  90. package/dist/domains/session/Session.schema.d.ts +198 -0
  91. package/dist/domains/session/Session.schema.js +60 -0
  92. package/dist/domains/session/Session.types.d.ts +10 -0
  93. package/dist/domains/session/Session.types.js +2 -0
  94. package/dist/domains/session/index.d.ts +3 -0
  95. package/dist/domains/session/index.js +19 -0
  96. package/dist/domains/ticketing/Ticketing.const.d.ts +5 -0
  97. package/dist/domains/ticketing/Ticketing.const.js +6 -1
  98. package/dist/domains/ticketing/Ticketing.schema.d.ts +55 -34
  99. package/dist/domains/ticketing/Ticketing.schema.js +31 -26
  100. package/dist/domains/ticketing/Ticketing.types.d.ts +2 -3
  101. package/dist/domains/user/User.schema.d.ts +38 -9
  102. package/dist/domains/user/User.schema.js +49 -8
  103. package/docs/USER_VS_PLAYER.md +87 -0
  104. package/package.json +1 -1
  105. package/src/__deprecated__/constants/hardware/index.ts +9 -0
  106. package/src/__deprecated__/constants/index.ts +9 -0
  107. package/src/__deprecated__/types/checkpoint/CheckpointType.ts +1 -1
  108. package/src/__deprecated__/types/damage/DamageName.ts +1 -1
  109. package/src/__deprecated__/types/hardware/ModuleName.ts +1 -1
  110. package/src/__deprecated__/types/hardware/flag/FlagMediaName.ts +1 -1
  111. package/src/__deprecated__/types/hardware/flag/FlagStatus.ts +1 -1
  112. package/src/__deprecated__/types/hardware/lights/LightsEffect.ts +1 -1
  113. package/src/__deprecated__/types/hardware/rgb/RGBStatus.ts +1 -1
  114. package/src/__deprecated__/types/hardware/screen/ScreenFinishViewInput.ts +1 -1
  115. package/src/__deprecated__/types/hardware/screen/ScreenStatus.ts +1 -1
  116. package/src/__deprecated__/types/hardware/screen/ScreenView.ts +1 -1
  117. package/src/__deprecated__/types/hardware/speed/SpeedStatus.ts +1 -1
  118. package/src/__deprecated__/types/kart/KartStatus.ts +1 -1
  119. package/src/__deprecated__/types/racingTeam/RacingTeamMembership.schema.ts +1 -1
  120. package/src/__deprecated__/types/role/Permission.ts +1 -1
  121. package/src/__deprecated__/types/role/UserRole.ts +1 -1
  122. package/src/__deprecated__/types/ticketing/GameTurn.schema.ts +2 -2
  123. package/src/__deprecated__/types/ticketing/PaymentProvider.ts +1 -1
  124. package/src/__deprecated__/types/ticketing/ticketing.schemas.ts +0 -1
  125. package/src/__deprecated__/types/user/user.schema.ts +1 -1
  126. package/src/domains/damage/Damage.schema.ts +2 -1
  127. package/src/domains/hardware/KartHardwareState.schema.ts +5 -5
  128. package/src/domains/hardware/screen/Screen.schema.ts +2 -7
  129. package/src/domains/hardware/screen/Screen.types.ts +2 -1
  130. package/src/domains/hardware/screen/ScreenDebug.schema.ts +6 -0
  131. package/src/domains/hardware/screen/index.ts +1 -0
  132. package/src/domains/index.ts +2 -0
  133. package/src/domains/kart/Kart.schema.ts +1 -1
  134. package/src/domains/player/Player.const.ts +4 -0
  135. package/src/domains/player/Player.schema.ts +54 -0
  136. package/src/domains/player/Player.types.ts +8 -0
  137. package/src/domains/player/index.ts +3 -0
  138. package/src/domains/role/Role.const.ts +1 -0
  139. package/src/domains/session/Session.const.ts +8 -0
  140. package/src/domains/session/Session.schema.ts +74 -0
  141. package/src/domains/session/Session.types.ts +20 -0
  142. package/src/domains/session/index.ts +3 -0
  143. package/src/domains/ticketing/Ticketing.const.ts +6 -0
  144. package/src/domains/ticketing/Ticketing.schema.ts +38 -27
  145. package/src/domains/ticketing/Ticketing.types.ts +2 -4
  146. package/src/domains/user/User.schema.ts +64 -7
  147. package/br-common-lib.code-workspace +0 -19
  148. /package/{src/constants/hardware/index.ts → dist/__deprecated__/constants/hardware/index.d.ts} +0 -0
  149. /package/{src/constants/index.ts → dist/__deprecated__/constants/index.d.ts} +0 -0
  150. /package/{MIGRATION_GUIDE.md → docs/MIGRATION_GUIDE.md} +0 -0
  151. /package/{REFACTOR_README.md → docs/REFACTOR_README.md} +0 -0
  152. /package/src/{constants → __deprecated__/constants}/checkpoint-type.ts +0 -0
  153. /package/src/{constants → __deprecated__/constants}/hardware/base-hardware-status.ts +0 -0
  154. /package/src/{constants → __deprecated__/constants}/hardware/damage.ts +0 -0
  155. /package/src/{constants → __deprecated__/constants}/hardware/flag-media-name.ts +0 -0
  156. /package/src/{constants → __deprecated__/constants}/hardware/flag-status.ts +0 -0
  157. /package/src/{constants → __deprecated__/constants}/hardware/lights-effect.ts +0 -0
  158. /package/src/{constants → __deprecated__/constants}/hardware/rgb-status.ts +0 -0
  159. /package/src/{constants → __deprecated__/constants}/hardware/screen-status.ts +0 -0
  160. /package/src/{constants → __deprecated__/constants}/hardware/screen-view.ts +0 -0
  161. /package/src/{constants → __deprecated__/constants}/hardware/speed-status.ts +0 -0
  162. /package/src/{constants → __deprecated__/constants}/kart-status.ts +0 -0
  163. /package/src/{constants → __deprecated__/constants}/module-name.ts +0 -0
  164. /package/src/{constants → __deprecated__/constants}/payment-provider.ts +0 -0
  165. /package/src/{constants → __deprecated__/constants}/payment-status.ts +0 -0
  166. /package/src/{constants → __deprecated__/constants}/permission.ts +0 -0
  167. /package/src/{constants → __deprecated__/constants}/racing-team-role.ts +0 -0
  168. /package/src/{constants → __deprecated__/constants}/user-role.ts +0 -0
@@ -1,3 +1,3 @@
1
- import { FLAG_MEDIA_NAME } from '../../../../constants/hardware/flag-media-name';
1
+ import { FLAG_MEDIA_NAME } from '../../../constants/hardware/flag-media-name';
2
2
  import type { ObjectValues } from '../../utils';
3
3
  export type FlagMediaName = ObjectValues<typeof FLAG_MEDIA_NAME> | number;
@@ -1,3 +1,3 @@
1
- import { FLAG_STATUS } from '../../../../constants';
1
+ import { FLAG_STATUS } from '../../../constants';
2
2
  import type { ObjectValues } from '../../utils';
3
3
  export type FlagStatus = ObjectValues<typeof FLAG_STATUS>;
@@ -1,3 +1,3 @@
1
- import { LIGHTS_EFFECT } from '../../../../constants';
1
+ import { LIGHTS_EFFECT } from '../../../constants';
2
2
  import type { ObjectValues } from '../../utils';
3
3
  export type LightsEffect = ObjectValues<typeof LIGHTS_EFFECT>;
@@ -1,3 +1,3 @@
1
- import { RGB_STATUS } from '../../../../constants/hardware/rgb-status';
1
+ import { RGB_STATUS } from '../../../constants/hardware/rgb-status';
2
2
  import type { ObjectValues } from '../../utils';
3
3
  export type RGBStatus = ObjectValues<typeof RGB_STATUS>;
@@ -1,4 +1,4 @@
1
- import { KART_FINAL_STATE } from '../../../../constants';
1
+ import { KART_FINAL_STATE } from '../../../constants';
2
2
  import { ObjectValues } from '../../utils';
3
3
  import { ScreenCurrentTotal } from './ScreenViewBaseConfig';
4
4
  export type KartFinalState = ObjectValues<typeof KART_FINAL_STATE>;
@@ -1,3 +1,3 @@
1
- import { SCREEN_STATUS } from '../../../../constants';
1
+ import { SCREEN_STATUS } from '../../../constants';
2
2
  import { ObjectValues } from '../../utils';
3
3
  export type ScreenStatus = ObjectValues<typeof SCREEN_STATUS>;
@@ -1,3 +1,3 @@
1
- import { SCREEN_VIEW } from '../../../../constants';
1
+ import { SCREEN_VIEW } from '../../../constants';
2
2
  import { ObjectValues } from '../../utils';
3
3
  export type ScreenView = ObjectValues<typeof SCREEN_VIEW>;
@@ -1,3 +1,3 @@
1
- import { SPEED_STATUS } from '../../../../constants/hardware';
1
+ import { SPEED_STATUS } from '../../../constants/hardware';
2
2
  import { ObjectValues } from '../../utils';
3
3
  export type SpeedStatus = ObjectValues<typeof SPEED_STATUS>;
@@ -1,3 +1,3 @@
1
- import { KART_STATUS } from '../../../constants';
1
+ import { KART_STATUS } from '../../constants';
2
2
  import type { ObjectValues } from '../utils';
3
3
  export type KartStatus = ObjectValues<typeof KART_STATUS>;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.answerJoinRequestSchema = exports.createJoinRequestSchema = exports.teamMemberSchema = exports.joinRequestSchema = void 0;
5
5
  const zod_1 = require("zod");
6
- const constants_1 = require("../../../constants");
6
+ const constants_1 = require("../../constants");
7
7
  exports.joinRequestSchema = zod_1.z.object({
8
8
  id: zod_1.z.string(),
9
9
  racingTeamId: zod_1.z.string(),
@@ -1,3 +1,3 @@
1
- import { PERMISSION } from '../../../constants';
1
+ import { PERMISSION } from '../../constants';
2
2
  import type { ObjectValues } from '../utils';
3
3
  export type Permission = ObjectValues<typeof PERMISSION>;
@@ -1,3 +1,3 @@
1
- import { USER_ROLE } from '../../../constants';
1
+ import { USER_ROLE } from '../../constants';
2
2
  import type { ObjectValues } from '../utils';
3
3
  export type UserRole = ObjectValues<typeof USER_ROLE>;
@@ -12,8 +12,8 @@ export declare const GAME_TURN_CHECK: {
12
12
  readonly TERMS_ACCEPTANCE: "terms_acceptance";
13
13
  };
14
14
  export declare const GameTurnStatusSchema: z.ZodEnum<{
15
- completed: "completed";
16
15
  created: "created";
16
+ completed: "completed";
17
17
  in_queue: "in_queue";
18
18
  ready: "ready";
19
19
  playing: "playing";
@@ -26,12 +26,12 @@ 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
- leaderUsername: z.ZodString;
29
+ leaderPlayerId: z.ZodString;
30
30
  gameTickets: z.ZodArray<z.ZodString>;
31
- usernames: z.ZodArray<z.ZodString>;
31
+ playerIds: z.ZodArray<z.ZodString>;
32
32
  status: z.ZodEnum<{
33
- completed: "completed";
34
33
  created: "created";
34
+ completed: "completed";
35
35
  in_queue: "in_queue";
36
36
  ready: "ready";
37
37
  playing: "playing";
@@ -44,8 +44,8 @@ export declare const GameTurnSchema: z.ZodObject<{
44
44
  link_accept: "link_accept";
45
45
  }>;
46
46
  status: z.ZodEnum<{
47
- pending: "pending";
48
47
  completed: "completed";
48
+ pending: "pending";
49
49
  }>;
50
50
  label: z.ZodString;
51
51
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
@@ -59,12 +59,12 @@ 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
- leaderUsername: z.ZodString;
62
+ leaderPlayerId: z.ZodString;
63
63
  gameTickets: z.ZodArray<z.ZodString>;
64
- usernames: z.ZodArray<z.ZodString>;
64
+ playerIds: z.ZodArray<z.ZodString>;
65
65
  status: z.ZodEnum<{
66
- completed: "completed";
67
66
  created: "created";
67
+ completed: "completed";
68
68
  in_queue: "in_queue";
69
69
  ready: "ready";
70
70
  playing: "playing";
@@ -77,8 +77,8 @@ export declare const GameTurnQueueItemSchema: z.ZodObject<{
77
77
  link_accept: "link_accept";
78
78
  }>;
79
79
  status: z.ZodEnum<{
80
- pending: "pending";
81
80
  completed: "completed";
81
+ pending: "pending";
82
82
  }>;
83
83
  label: z.ZodString;
84
84
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
@@ -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
- leaderUsername: zod_1.z.string(),
33
+ leaderPlayerId: zod_1.z.string(),
34
34
  gameTickets: zod_1.z.array(zod_1.z.string()),
35
- usernames: zod_1.z.array(zod_1.z.string()),
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(),
@@ -14,8 +14,8 @@ export declare const GameTurnTaskTypeSchema: z.ZodEnum<{
14
14
  link_accept: "link_accept";
15
15
  }>;
16
16
  export declare const GameTurnTaskStatusSchema: z.ZodEnum<{
17
- pending: "pending";
18
17
  completed: "completed";
18
+ pending: "pending";
19
19
  }>;
20
20
  export declare const GameTurnTaskSchema: z.ZodObject<{
21
21
  id: z.ZodString;
@@ -25,8 +25,8 @@ export declare const GameTurnTaskSchema: z.ZodObject<{
25
25
  link_accept: "link_accept";
26
26
  }>;
27
27
  status: z.ZodEnum<{
28
- pending: "pending";
29
28
  completed: "completed";
29
+ pending: "pending";
30
30
  }>;
31
31
  label: z.ZodString;
32
32
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
@@ -1,4 +1,4 @@
1
- import { PAYMENT_PROVIDERS, PAYMENT_STATUSES } from '../../../constants';
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("../../../constants/user-role");
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 hardware_1 = require("../hardware");
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: hardware_1.kartEffectSchema,
15
+ rgbEffect: KartEffect_schema_1.kartEffectSchema,
15
16
  amount: zod_1.z.number(),
16
- flagMediaName: hardware_1.flagMediaNameSchema,
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
- time: z.ZodNumber;
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 checkpoint_1 = require("../checkpoint");
6
- const flag_1 = require("./flag");
7
- const rgb_1 = require("./rgb");
8
- const screen_1 = require("./screen");
9
- const speed_1 = require("./speed");
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: speed_1.speedStatusSchema,
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: rgb_1.rgbStatusSchema.nullable(),
18
+ rgb: RGB_schema_1.rgbStatusSchema.nullable(),
19
19
  flag: zod_1.z
20
20
  .object({
21
- status: flag_1.flagStatusSchema,
22
- checkpointType: checkpoint_1.checkpointTypeSchema.nullable(),
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: screen_1.screenStatusSchema.nullable(),
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.screenDebugViewInputSchema = 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;
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 damage_1 = require("../../damage");
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 kart_1 = require("../../kart");
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(kart_1.KART_FINAL_STATE);
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([damage_1.damageEffectNameSchema, zod_1.z.literal('Yellow Flag'), zod_1.z.literal('Red Flag')])
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, screenDebugViewInputSchema, screenFinishViewInputSchema, screenGameTimeLeftSchema, screenHomeViewInputSchema, screenModuleStatusSchema, screenRaceViewConfigSchema, screenStatusSchema, screenUpdateGameViewInputSchema, screenViewBaseConfigSchema, screenViewSchema, updateBattleViewInputSchema, updateRaceViewInputSchema } from './Screen.schema';
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
+ });
@@ -1,3 +1,4 @@
1
1
  export * from './Screen.const';
2
2
  export * from './Screen.schema';
3
+ export * from './ScreenDebug.schema';
3
4
  export * from './Screen.types';
@@ -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);
@@ -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';
@@ -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 hardware_1 = require("../hardware");
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: hardware_1.kartHardwareStateSchema.nullable().optional(),
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,4 @@
1
+ export declare const PLAYER_TYPE: {
2
+ readonly ADULT: "ADULT";
3
+ readonly MINOR: "MINOR";
4
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PLAYER_TYPE = void 0;
4
+ exports.PLAYER_TYPE = {
5
+ ADULT: 'ADULT',
6
+ MINOR: 'MINOR', // Managed by a Guardian
7
+ };
@@ -0,0 +1,53 @@
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
+ nickname: z.ZodString;
44
+ birthDate: z.ZodCoercedDate<unknown>;
45
+ }, z.core.$strip>;
46
+ export declare const signWaiverSchema: z.ZodObject<{
47
+ signature: z.ZodOptional<z.ZodString>;
48
+ accepted: z.ZodLiteral<true>;
49
+ }, z.core.$strip>;
50
+ export declare const createMinorPlayerSchema: z.ZodObject<{
51
+ nickname: z.ZodString;
52
+ birthDate: z.ZodCoercedDate<unknown>;
53
+ }, z.core.$strip>;