@battle-racing/br-common-lib 4.8.2 → 4.9.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 (38) hide show
  1. package/dist/domains/catalog/Catalog.const.d.ts +4 -0
  2. package/dist/domains/catalog/Catalog.const.js +7 -0
  3. package/dist/domains/catalog/Catalog.schema.d.ts +54 -0
  4. package/dist/domains/catalog/Catalog.schema.js +24 -0
  5. package/dist/domains/catalog/Catalog.types.d.ts +6 -0
  6. package/dist/domains/catalog/Catalog.types.js +2 -0
  7. package/dist/domains/catalog/index.d.ts +3 -0
  8. package/dist/domains/catalog/index.js +19 -0
  9. package/dist/domains/hardware/KartHardwareState.schema.d.ts +17 -0
  10. package/dist/domains/hardware/KartHardwareState.schema.js +4 -2
  11. package/dist/domains/hardware/ModuleStatus.schema.d.ts +15 -2
  12. package/dist/domains/hardware/screen/ScreenDebug.schema.d.ts +17 -0
  13. package/dist/domains/hardware/steering-wheel/SteeringWheel.const.d.ts +16 -0
  14. package/dist/domains/hardware/steering-wheel/SteeringWheel.const.js +17 -1
  15. package/dist/domains/hardware/steering-wheel/SteeringWheel.schema.d.ts +34 -2
  16. package/dist/domains/hardware/steering-wheel/SteeringWheel.schema.js +16 -3
  17. package/dist/domains/hardware/steering-wheel/SteeringWheel.types.d.ts +4 -1
  18. package/dist/domains/index.d.ts +1 -0
  19. package/dist/domains/index.js +1 -0
  20. package/dist/domains/kart/Kart.schema.d.ts +17 -0
  21. package/dist/domains/socket/SocketHardwareModulesEventsParams.d.ts +3 -1
  22. package/dist/domains/ticketing/Ticketing.schema.d.ts +6 -0
  23. package/dist/domains/ticketing/Ticketing.schema.js +6 -0
  24. package/dist/domains/user/User.schema.d.ts +2 -3
  25. package/dist/domains/user/User.schema.js +2 -2
  26. package/package.json +3 -3
  27. package/src/domains/catalog/Catalog.const.ts +4 -0
  28. package/src/domains/catalog/Catalog.schema.ts +27 -0
  29. package/src/domains/catalog/Catalog.types.ts +12 -0
  30. package/src/domains/catalog/index.ts +3 -0
  31. package/src/domains/hardware/KartHardwareState.schema.ts +4 -2
  32. package/src/domains/hardware/steering-wheel/SteeringWheel.const.ts +18 -0
  33. package/src/domains/hardware/steering-wheel/SteeringWheel.schema.ts +22 -3
  34. package/src/domains/hardware/steering-wheel/SteeringWheel.types.ts +10 -2
  35. package/src/domains/index.ts +1 -0
  36. package/src/domains/socket/SocketHardwareModulesEventsParams.ts +5 -0
  37. package/src/domains/ticketing/Ticketing.schema.ts +8 -0
  38. package/src/domains/user/User.schema.ts +3 -5
@@ -0,0 +1,4 @@
1
+ export declare const BUNDLE_STATUS: {
2
+ readonly ACTIVE: "active";
3
+ readonly INACTIVE: "inactive";
4
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BUNDLE_STATUS = void 0;
4
+ exports.BUNDLE_STATUS = {
5
+ ACTIVE: 'active',
6
+ INACTIVE: 'inactive',
7
+ };
@@ -0,0 +1,54 @@
1
+ import { z } from 'zod';
2
+ export declare const bundleStatusSchema: z.ZodEnum<{
3
+ readonly ACTIVE: "active";
4
+ readonly INACTIVE: "inactive";
5
+ }>;
6
+ export declare const bundleDefinitionSchema: z.ZodObject<{
7
+ id: z.ZodUUID;
8
+ name: z.ZodString;
9
+ items: z.ZodArray<z.ZodObject<{
10
+ ticketType: z.ZodEnum<{
11
+ readonly Race: "Race";
12
+ readonly Battle: "Battle";
13
+ }>;
14
+ quantity: z.ZodNumber;
15
+ priceCents: z.ZodNumber;
16
+ }, z.core.$strip>>;
17
+ status: z.ZodDefault<z.ZodEnum<{
18
+ readonly ACTIVE: "active";
19
+ readonly INACTIVE: "inactive";
20
+ }>>;
21
+ externalProductId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
22
+ createdAt: z.ZodDate;
23
+ updatedAt: z.ZodDate;
24
+ }, z.core.$strip>;
25
+ export declare const createBundleDefinitionInputSchema: z.ZodObject<{
26
+ status: z.ZodDefault<z.ZodEnum<{
27
+ readonly ACTIVE: "active";
28
+ readonly INACTIVE: "inactive";
29
+ }>>;
30
+ items: z.ZodArray<z.ZodObject<{
31
+ ticketType: z.ZodEnum<{
32
+ readonly Race: "Race";
33
+ readonly Battle: "Battle";
34
+ }>;
35
+ quantity: z.ZodNumber;
36
+ priceCents: z.ZodNumber;
37
+ }, z.core.$strip>>;
38
+ name: z.ZodString;
39
+ }, z.core.$strip>;
40
+ export declare const updateBundleDefinitionInputSchema: z.ZodObject<{
41
+ status: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
42
+ readonly ACTIVE: "active";
43
+ readonly INACTIVE: "inactive";
44
+ }>>>;
45
+ items: z.ZodOptional<z.ZodArray<z.ZodObject<{
46
+ ticketType: z.ZodEnum<{
47
+ readonly Race: "Race";
48
+ readonly Battle: "Battle";
49
+ }>;
50
+ quantity: z.ZodNumber;
51
+ priceCents: z.ZodNumber;
52
+ }, z.core.$strip>>>;
53
+ name: z.ZodOptional<z.ZodString>;
54
+ }, z.core.$strip>;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateBundleDefinitionInputSchema = exports.createBundleDefinitionInputSchema = exports.bundleDefinitionSchema = exports.bundleStatusSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const Catalog_const_1 = require("./Catalog.const");
6
+ const Ticketing_schema_1 = require("../ticketing/Ticketing.schema");
7
+ exports.bundleStatusSchema = zod_1.z.enum(Catalog_const_1.BUNDLE_STATUS);
8
+ exports.bundleDefinitionSchema = zod_1.z.object({
9
+ id: zod_1.z.uuidv4(),
10
+ name: zod_1.z.string().min(1),
11
+ items: zod_1.z.array(Ticketing_schema_1.purchaseItemSchema).min(1),
12
+ status: exports.bundleStatusSchema.default(Catalog_const_1.BUNDLE_STATUS.ACTIVE),
13
+ // Set after syncing to an external storefront — null means not yet synced
14
+ externalProductId: zod_1.z.string().optional().nullable(),
15
+ createdAt: zod_1.z.date(),
16
+ updatedAt: zod_1.z.date(),
17
+ });
18
+ exports.createBundleDefinitionInputSchema = exports.bundleDefinitionSchema.omit({
19
+ id: true,
20
+ externalProductId: true,
21
+ createdAt: true,
22
+ updatedAt: true,
23
+ });
24
+ exports.updateBundleDefinitionInputSchema = exports.createBundleDefinitionInputSchema.partial();
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+ import { bundleDefinitionSchema, bundleStatusSchema, createBundleDefinitionInputSchema, updateBundleDefinitionInputSchema } from './Catalog.schema';
3
+ export type BundleStatus = z.infer<typeof bundleStatusSchema>;
4
+ export type BundleDefinition = z.infer<typeof bundleDefinitionSchema>;
5
+ export type CreateBundleDefinitionInput = z.infer<typeof createBundleDefinitionInputSchema>;
6
+ export type UpdateBundleDefinitionInput = z.infer<typeof updateBundleDefinitionInputSchema>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ export * from './Catalog.const';
2
+ export * from './Catalog.schema';
3
+ export * from './Catalog.types';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./Catalog.const"), exports);
18
+ __exportStar(require("./Catalog.schema"), exports);
19
+ __exportStar(require("./Catalog.types"), exports);
@@ -49,4 +49,21 @@ export declare const kartHardwareStateSchema: z.ZodObject<{
49
49
  }>>;
50
50
  isConnectedToServer: z.ZodBoolean;
51
51
  isSteeringWheelPressed: z.ZodBoolean;
52
+ steeringWheel: z.ZodNullable<z.ZodObject<{
53
+ ledStatus: z.ZodEnum<{
54
+ readonly OFF: "Off";
55
+ readonly IDLE: "Idle";
56
+ readonly POWER_UP: "Power-Up";
57
+ readonly EMERGENCY: "Emergency";
58
+ readonly CONFIG: "Config";
59
+ }>;
60
+ buttons: z.ZodObject<{
61
+ powerRightPressed: z.ZodBoolean;
62
+ powerLeftPressed: z.ZodBoolean;
63
+ actionRightPressed: z.ZodBoolean;
64
+ actionLeftPressed: z.ZodBoolean;
65
+ extraRightPressed: z.ZodBoolean;
66
+ extraLeftPressed: z.ZodBoolean;
67
+ }, z.core.$strip>;
68
+ }, z.core.$strip>>;
52
69
  }, z.core.$strip>;
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.kartHardwareStateSchema = void 0;
4
- const zod_1 = require("zod");
5
4
  const Checkpoint_schema_1 = require("../checkpoint/Checkpoint.schema");
6
5
  const flag_1 = require("./flag");
7
6
  const rgb_1 = require("./rgb");
7
+ const steering_wheel_1 = require("./steering-wheel");
8
8
  const screen_1 = require("./screen");
9
9
  const speed_1 = require("./speed");
10
+ const zod_1 = require("zod");
10
11
  exports.kartHardwareStateSchema = zod_1.z.object({
11
12
  speed: zod_1.z
12
13
  .object({
@@ -25,5 +26,6 @@ exports.kartHardwareStateSchema = zod_1.z.object({
25
26
  .nullable(),
26
27
  screen: screen_1.screenStatusSchema.nullable(),
27
28
  isConnectedToServer: zod_1.z.boolean(),
28
- isSteeringWheelPressed: zod_1.z.boolean(),
29
+ isSteeringWheelPressed: zod_1.z.boolean().meta({ deprecated: true, reason: 'use the steering wheel status' }),
30
+ steeringWheel: steering_wheel_1.steeringWheelModuleStatusSchema.nullable(),
29
31
  });
@@ -107,8 +107,21 @@ export declare const moduleStatusSchema: z.ZodUnion<readonly [z.ZodObject<{
107
107
  starHitByKartId: z.ZodNullable<z.ZodNumber>;
108
108
  laserHitByKartId: z.ZodNullable<z.ZodNumber>;
109
109
  }, z.core.$strip>, z.ZodObject<{
110
- isLeftButtonPressed: z.ZodBoolean;
111
- isRightButtonPressed: z.ZodBoolean;
110
+ ledStatus: z.ZodEnum<{
111
+ readonly OFF: "Off";
112
+ readonly IDLE: "Idle";
113
+ readonly POWER_UP: "Power-Up";
114
+ readonly EMERGENCY: "Emergency";
115
+ readonly CONFIG: "Config";
116
+ }>;
117
+ buttons: z.ZodObject<{
118
+ powerRightPressed: z.ZodBoolean;
119
+ powerLeftPressed: z.ZodBoolean;
120
+ actionRightPressed: z.ZodBoolean;
121
+ actionLeftPressed: z.ZodBoolean;
122
+ extraRightPressed: z.ZodBoolean;
123
+ extraLeftPressed: z.ZodBoolean;
124
+ }, z.core.$strip>;
112
125
  }, z.core.$strip>, z.ZodObject<{
113
126
  emergencyStatus: z.ZodEnum<{
114
127
  readonly STANDBY: "Standby";
@@ -49,5 +49,22 @@ export declare const screenDebugViewInputSchema: z.ZodObject<{
49
49
  }>>;
50
50
  isConnectedToServer: z.ZodBoolean;
51
51
  isSteeringWheelPressed: z.ZodBoolean;
52
+ steeringWheel: z.ZodNullable<z.ZodObject<{
53
+ ledStatus: z.ZodEnum<{
54
+ readonly OFF: "Off";
55
+ readonly IDLE: "Idle";
56
+ readonly POWER_UP: "Power-Up";
57
+ readonly EMERGENCY: "Emergency";
58
+ readonly CONFIG: "Config";
59
+ }>;
60
+ buttons: z.ZodObject<{
61
+ powerRightPressed: z.ZodBoolean;
62
+ powerLeftPressed: z.ZodBoolean;
63
+ actionRightPressed: z.ZodBoolean;
64
+ actionLeftPressed: z.ZodBoolean;
65
+ extraRightPressed: z.ZodBoolean;
66
+ extraLeftPressed: z.ZodBoolean;
67
+ }, z.core.$strip>;
68
+ }, z.core.$strip>>;
52
69
  kartNumber: z.ZodNumber;
53
70
  }, z.core.$strip>;
@@ -1,4 +1,20 @@
1
1
  export declare const STEERING_WHEEL_ACTION_COMMAND: {
2
+ /** @deprecated */
2
3
  readonly TURN_LED_ON: "TurnLedOn";
3
4
  readonly TURN_LED_OFF: "TurnLedOff";
5
+ readonly SHOW_LED_EFFECT: "ShowLedEffect";
6
+ readonly CONFIGURE_LEDS: "ConfigureLeds";
7
+ };
8
+ export declare const STEERING_WHEEL_SHOW_LED_EFFECT_OPTIONS: {
9
+ readonly SHOW_LED_IDLE_EFFECT: "ShowLedIdleEffect";
10
+ readonly SHOW_LED_POWERUP_EFFECT: "ShowLedPowerupEffect";
11
+ readonly SHOW_LED_EMERGENCY_EFFECT: "ShowLedEmergencyEffect";
12
+ readonly SHOW_LED_CONFIG_EFFECT: "ShowLedConfigEffect";
13
+ };
14
+ export declare const STEERING_WHEEL_LED_STATUS: {
15
+ readonly OFF: "Off";
16
+ readonly IDLE: "Idle";
17
+ readonly POWER_UP: "Power-Up";
18
+ readonly EMERGENCY: "Emergency";
19
+ readonly CONFIG: "Config";
4
20
  };
@@ -1,7 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.STEERING_WHEEL_ACTION_COMMAND = void 0;
3
+ exports.STEERING_WHEEL_LED_STATUS = exports.STEERING_WHEEL_SHOW_LED_EFFECT_OPTIONS = exports.STEERING_WHEEL_ACTION_COMMAND = void 0;
4
4
  exports.STEERING_WHEEL_ACTION_COMMAND = {
5
+ /** @deprecated */
5
6
  TURN_LED_ON: 'TurnLedOn',
6
7
  TURN_LED_OFF: 'TurnLedOff',
8
+ SHOW_LED_EFFECT: 'ShowLedEffect',
9
+ CONFIGURE_LEDS: 'ConfigureLeds',
10
+ };
11
+ exports.STEERING_WHEEL_SHOW_LED_EFFECT_OPTIONS = {
12
+ SHOW_LED_IDLE_EFFECT: 'ShowLedIdleEffect',
13
+ SHOW_LED_POWERUP_EFFECT: 'ShowLedPowerupEffect',
14
+ SHOW_LED_EMERGENCY_EFFECT: 'ShowLedEmergencyEffect',
15
+ SHOW_LED_CONFIG_EFFECT: 'ShowLedConfigEffect',
16
+ };
17
+ exports.STEERING_WHEEL_LED_STATUS = {
18
+ OFF: 'Off',
19
+ IDLE: 'Idle',
20
+ POWER_UP: 'Power-Up',
21
+ EMERGENCY: 'Emergency',
22
+ CONFIG: 'Config',
7
23
  };
@@ -2,8 +2,40 @@ import { z } from 'zod';
2
2
  export declare const steeringWheelActionCommandSchema: z.ZodEnum<{
3
3
  readonly TURN_LED_ON: "TurnLedOn";
4
4
  readonly TURN_LED_OFF: "TurnLedOff";
5
+ readonly SHOW_LED_EFFECT: "ShowLedEffect";
6
+ readonly CONFIGURE_LEDS: "ConfigureLeds";
7
+ }>;
8
+ export declare const steeringWheelLedStatusSchema: z.ZodEnum<{
9
+ readonly OFF: "Off";
10
+ readonly IDLE: "Idle";
11
+ readonly POWER_UP: "Power-Up";
12
+ readonly EMERGENCY: "Emergency";
13
+ readonly CONFIG: "Config";
5
14
  }>;
6
15
  export declare const steeringWheelModuleStatusSchema: z.ZodObject<{
7
- isLeftButtonPressed: z.ZodBoolean;
8
- isRightButtonPressed: z.ZodBoolean;
16
+ ledStatus: z.ZodEnum<{
17
+ readonly OFF: "Off";
18
+ readonly IDLE: "Idle";
19
+ readonly POWER_UP: "Power-Up";
20
+ readonly EMERGENCY: "Emergency";
21
+ readonly CONFIG: "Config";
22
+ }>;
23
+ buttons: z.ZodObject<{
24
+ powerRightPressed: z.ZodBoolean;
25
+ powerLeftPressed: z.ZodBoolean;
26
+ actionRightPressed: z.ZodBoolean;
27
+ actionLeftPressed: z.ZodBoolean;
28
+ extraRightPressed: z.ZodBoolean;
29
+ extraLeftPressed: z.ZodBoolean;
30
+ }, z.core.$strip>;
31
+ }, z.core.$strip>;
32
+ export declare const steeringWheelShowLedsEffectOptionsSchema: z.ZodEnum<{
33
+ readonly SHOW_LED_IDLE_EFFECT: "ShowLedIdleEffect";
34
+ readonly SHOW_LED_POWERUP_EFFECT: "ShowLedPowerupEffect";
35
+ readonly SHOW_LED_EMERGENCY_EFFECT: "ShowLedEmergencyEffect";
36
+ readonly SHOW_LED_CONFIG_EFFECT: "ShowLedConfigEffect";
37
+ }>;
38
+ export declare const steeringWheelConfigureLedsOptionsSchema: z.ZodObject<{
39
+ brightness: z.ZodNumber;
40
+ durationSeconds: z.ZodNumber;
9
41
  }, z.core.$strip>;
@@ -1,10 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.steeringWheelModuleStatusSchema = exports.steeringWheelActionCommandSchema = void 0;
3
+ exports.steeringWheelConfigureLedsOptionsSchema = exports.steeringWheelShowLedsEffectOptionsSchema = exports.steeringWheelModuleStatusSchema = exports.steeringWheelLedStatusSchema = exports.steeringWheelActionCommandSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const SteeringWheel_const_1 = require("./SteeringWheel.const");
6
6
  exports.steeringWheelActionCommandSchema = zod_1.z.enum(SteeringWheel_const_1.STEERING_WHEEL_ACTION_COMMAND);
7
+ exports.steeringWheelLedStatusSchema = zod_1.z.enum(SteeringWheel_const_1.STEERING_WHEEL_LED_STATUS);
7
8
  exports.steeringWheelModuleStatusSchema = zod_1.z.object({
8
- isLeftButtonPressed: zod_1.z.boolean(),
9
- isRightButtonPressed: zod_1.z.boolean(),
9
+ ledStatus: exports.steeringWheelLedStatusSchema,
10
+ buttons: zod_1.z.object({
11
+ powerRightPressed: zod_1.z.boolean(),
12
+ powerLeftPressed: zod_1.z.boolean(),
13
+ actionRightPressed: zod_1.z.boolean(),
14
+ actionLeftPressed: zod_1.z.boolean(),
15
+ extraRightPressed: zod_1.z.boolean(),
16
+ extraLeftPressed: zod_1.z.boolean(),
17
+ }),
18
+ });
19
+ exports.steeringWheelShowLedsEffectOptionsSchema = zod_1.z.enum(SteeringWheel_const_1.STEERING_WHEEL_SHOW_LED_EFFECT_OPTIONS);
20
+ exports.steeringWheelConfigureLedsOptionsSchema = zod_1.z.object({
21
+ brightness: zod_1.z.number().min(0).max(100),
22
+ durationSeconds: zod_1.z.number().min(1).max(25),
10
23
  });
@@ -1,4 +1,7 @@
1
1
  import { z } from 'zod';
2
- import { steeringWheelActionCommandSchema, steeringWheelModuleStatusSchema } from './SteeringWheel.schema';
2
+ import { steeringWheelActionCommandSchema, steeringWheelConfigureLedsOptionsSchema, steeringWheelLedStatusSchema, steeringWheelModuleStatusSchema, steeringWheelShowLedsEffectOptionsSchema } from './SteeringWheel.schema';
3
3
  export type SteeringWheelActionCommand = z.infer<typeof steeringWheelActionCommandSchema>;
4
+ export type SteeringWheelLedStatus = z.infer<typeof steeringWheelLedStatusSchema>;
4
5
  export type SteeringWheelModuleStatus = z.infer<typeof steeringWheelModuleStatusSchema>;
6
+ export type SteeringWheelShowLedsEffectOptions = z.infer<typeof steeringWheelShowLedsEffectOptionsSchema>;
7
+ export type SteeringWheelConfigureLedsOptions = z.infer<typeof steeringWheelConfigureLedsOptionsSchema>;
@@ -1,3 +1,4 @@
1
+ export * from './catalog';
1
2
  export * from './checkpoint';
2
3
  export * from './color';
3
4
  export * from './damage';
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./catalog"), exports);
17
18
  __exportStar(require("./checkpoint"), exports);
18
19
  __exportStar(require("./color"), exports);
19
20
  __exportStar(require("./damage"), exports);
@@ -113,6 +113,23 @@ export declare const kartSchema: z.ZodObject<{
113
113
  }>>;
114
114
  isConnectedToServer: z.ZodBoolean;
115
115
  isSteeringWheelPressed: z.ZodBoolean;
116
+ steeringWheel: z.ZodNullable<z.ZodObject<{
117
+ ledStatus: z.ZodEnum<{
118
+ readonly OFF: "Off";
119
+ readonly IDLE: "Idle";
120
+ readonly POWER_UP: "Power-Up";
121
+ readonly EMERGENCY: "Emergency";
122
+ readonly CONFIG: "Config";
123
+ }>;
124
+ buttons: z.ZodObject<{
125
+ powerRightPressed: z.ZodBoolean;
126
+ powerLeftPressed: z.ZodBoolean;
127
+ actionRightPressed: z.ZodBoolean;
128
+ actionLeftPressed: z.ZodBoolean;
129
+ extraRightPressed: z.ZodBoolean;
130
+ extraLeftPressed: z.ZodBoolean;
131
+ }, z.core.$strip>;
132
+ }, z.core.$strip>>;
116
133
  }, z.core.$strip>>>;
117
134
  currentPowerUp: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
118
135
  readonly BATTLE_GOD: "Battle God";
@@ -1,4 +1,4 @@
1
- import type { ConfigDiskSensorBallShooterModuleOptions, ConfigureBallSensorDiskThrowerModuleOptions, FlagConfigurationOptions, FlagShowMediaOptions, PlaySoundOptions, RGBConfigurationOptions, RGBShowEffectOptions, ScreenCountdownParams, ScreenFinishViewInput, ScreenHomeViewInput, ScreenUpdateGameViewInput, SpeedChangeOptions, SpeedConfiguration, StarLaserConfigureModuleOptions, StarLaserSendActionsOptions } from '../hardware';
1
+ import type { ConfigDiskSensorBallShooterModuleOptions, ConfigureBallSensorDiskThrowerModuleOptions, FlagConfigurationOptions, FlagShowMediaOptions, PlaySoundOptions, RGBConfigurationOptions, RGBShowEffectOptions, ScreenCountdownParams, ScreenFinishViewInput, ScreenHomeViewInput, ScreenUpdateGameViewInput, SpeedChangeOptions, SpeedConfiguration, StarLaserConfigureModuleOptions, StarLaserSendActionsOptions, SteeringWheelConfigureLedsOptions, SteeringWheelShowLedsEffectOptions } from '../hardware';
2
2
  export type SocketHardwareDataSubscriptionEventsParams = {
3
3
  'hardware:data:subscribe': undefined;
4
4
  'hardware:data:unsubscribe': undefined;
@@ -54,6 +54,8 @@ export type SocketHardwareScreenModuleEventsParams = {
54
54
  export type SocketHardwareSteeringWheelModuleEventsParams = {
55
55
  'hardware:steering-wheel:turnLedOn': undefined;
56
56
  'hardware:steering-wheel:turnLedOff': undefined;
57
+ 'hardware:steering-wheel:showLedsEffect': SteeringWheelShowLedsEffectOptions;
58
+ 'hardware:steering-wheel:configureLeds': SteeringWheelConfigureLedsOptions;
57
59
  };
58
60
  export type SocketHardwareSoundModuleEventsParams = {
59
61
  'hardware:sound:play': PlaySoundOptions;
@@ -61,6 +61,8 @@ export declare const purchaseSchema: z.ZodObject<{
61
61
  buyerUserId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
62
62
  guestName: z.ZodNullable<z.ZodOptional<z.ZodString>>;
63
63
  guestContact: z.ZodNullable<z.ZodOptional<z.ZodString>>;
64
+ bundleId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
65
+ externalOrderId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
64
66
  items: z.ZodArray<z.ZodObject<{
65
67
  ticketType: z.ZodEnum<{
66
68
  readonly Race: "Race";
@@ -106,6 +108,8 @@ export declare const paginatedPurchaseSchema: z.ZodObject<{
106
108
  buyerUserId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
107
109
  guestName: z.ZodNullable<z.ZodOptional<z.ZodString>>;
108
110
  guestContact: z.ZodNullable<z.ZodOptional<z.ZodString>>;
111
+ bundleId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
112
+ externalOrderId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
109
113
  items: z.ZodArray<z.ZodObject<{
110
114
  ticketType: z.ZodEnum<{
111
115
  readonly Race: "Race";
@@ -148,6 +152,8 @@ export declare const createPurchaseInputSchema: z.ZodObject<{
148
152
  quantity: z.ZodNumber;
149
153
  priceCents: z.ZodNumber;
150
154
  }, z.core.$strip>>;
155
+ bundleId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
156
+ externalOrderId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
151
157
  }, z.core.$strip>;
152
158
  export declare const gameTurnStatusSchema: z.ZodEnum<{
153
159
  readonly CREATED: "created";
@@ -35,6 +35,10 @@ exports.purchaseSchema = zod_1.z.object({
35
35
  buyerUserId: zod_1.z.string().optional().nullable(),
36
36
  guestName: zod_1.z.string().optional().nullable(),
37
37
  guestContact: zod_1.z.string().optional().nullable(),
38
+ // Bundle reference — null for legacy on-site purchases without bundle
39
+ bundleId: zod_1.z.string().optional().nullable(),
40
+ // External order reference (e.g. Wix) — null for on-site (POS) purchases
41
+ externalOrderId: zod_1.z.string().optional().nullable(),
38
42
  items: zod_1.z.array(exports.purchaseItemSchema),
39
43
  totalAmountCents: zod_1.z.number().min(0),
40
44
  status: exports.purchaseStatusSchema.default(Ticketing_const_1.PURCHASE_STATUS.PENDING),
@@ -61,6 +65,8 @@ exports.createPurchaseInputSchema = zod_1.z.object({
61
65
  guestName: zod_1.z.string().optional(),
62
66
  guestContact: zod_1.z.string().optional(),
63
67
  items: zod_1.z.array(exports.purchaseItemSchema).min(1),
68
+ bundleId: zod_1.z.string().optional().nullable(),
69
+ externalOrderId: zod_1.z.string().optional().nullable(),
64
70
  });
65
71
  exports.gameTurnStatusSchema = zod_1.z.enum(Ticketing_const_1.GAME_TURN_STATUS);
66
72
  exports.gameTurnCheckSchema = zod_1.z.enum(Ticketing_const_1.GAME_TURN_CHECK);
@@ -70,7 +70,7 @@ export declare const authUserSchema: z.ZodObject<{
70
70
  lastLoginAt: z.ZodOptional<z.ZodDate>;
71
71
  authToken: z.ZodString;
72
72
  }, z.core.$strip>;
73
- export declare const userWithPasswordSchema: z.ZodIntersection<z.ZodObject<{
73
+ export declare const userWithPasswordSchema: z.ZodObject<{
74
74
  id: z.ZodUUID;
75
75
  name: z.ZodOptional<z.ZodString>;
76
76
  lastName: z.ZodOptional<z.ZodString>;
@@ -92,9 +92,8 @@ export declare const userWithPasswordSchema: z.ZodIntersection<z.ZodObject<{
92
92
  defaultPlayerId: z.ZodOptional<z.ZodUUID>;
93
93
  createdAt: z.ZodDate;
94
94
  lastLoginAt: z.ZodOptional<z.ZodDate>;
95
- }, z.core.$strip>, z.ZodObject<{
96
95
  password: z.ZodString;
97
- }, z.core.$strip>>;
96
+ }, z.core.$strip>;
98
97
  export declare const userInitialRegistrationSchema: z.ZodObject<{
99
98
  emailOrPhone: z.ZodString;
100
99
  password: z.ZodString;
@@ -54,9 +54,9 @@ exports.initialUserSchema = baseUserObj.pick({
54
54
  exports.authUserSchema = baseUserObj.extend({
55
55
  authToken: zod_1.z.string(),
56
56
  });
57
- exports.userWithPasswordSchema = exports.userSchema.and(zod_1.z.object({
57
+ exports.userWithPasswordSchema = exports.userSchema.extend({
58
58
  password: zod_1.z.string().min(MIN_PASSWORD_LENGTH),
59
- }));
59
+ });
60
60
  exports.userInitialRegistrationSchema = zod_1.z.object({
61
61
  emailOrPhone: exports.emailOrPhoneSchema,
62
62
  password: zod_1.z.string().min(MIN_PASSWORD_LENGTH, `Password must be at least ${MIN_PASSWORD_LENGTH} characters`),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@battle-racing/br-common-lib",
3
- "version": "4.8.2",
3
+ "version": "4.9.1",
4
4
  "description": "Common library for all Battle Racing Repositorios",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -33,10 +33,10 @@
33
33
  "@modelcontextprotocol/sdk": "^1.29.0",
34
34
  "@types/node": "^25.6.0",
35
35
  "typescript": "^5.8.3",
36
- "zod": "^4.2.1"
36
+ "zod": "^4.4.3"
37
37
  },
38
38
  "peerDependencies": {
39
- "zod": "^4.2.1"
39
+ "zod": "^4.4.3"
40
40
  },
41
41
  "dependencies": {
42
42
  "@battle-racing/br-common-lib": "^4.6.1"
@@ -0,0 +1,4 @@
1
+ export const BUNDLE_STATUS = {
2
+ ACTIVE: 'active',
3
+ INACTIVE: 'inactive',
4
+ } as const;
@@ -0,0 +1,27 @@
1
+ import { z } from 'zod';
2
+ import { BUNDLE_STATUS } from './Catalog.const';
3
+ import { purchaseItemSchema } from '../ticketing/Ticketing.schema';
4
+
5
+ export const bundleStatusSchema = z.enum(BUNDLE_STATUS);
6
+
7
+ export const bundleDefinitionSchema = z.object({
8
+ id: z.uuidv4(),
9
+ name: z.string().min(1),
10
+ items: z.array(purchaseItemSchema).min(1),
11
+ status: bundleStatusSchema.default(BUNDLE_STATUS.ACTIVE),
12
+
13
+ // Set after syncing to an external storefront — null means not yet synced
14
+ externalProductId: z.string().optional().nullable(),
15
+
16
+ createdAt: z.date(),
17
+ updatedAt: z.date(),
18
+ });
19
+
20
+ export const createBundleDefinitionInputSchema = bundleDefinitionSchema.omit({
21
+ id: true,
22
+ externalProductId: true,
23
+ createdAt: true,
24
+ updatedAt: true,
25
+ });
26
+
27
+ export const updateBundleDefinitionInputSchema = createBundleDefinitionInputSchema.partial();
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+ import {
3
+ bundleDefinitionSchema,
4
+ bundleStatusSchema,
5
+ createBundleDefinitionInputSchema,
6
+ updateBundleDefinitionInputSchema,
7
+ } from './Catalog.schema';
8
+
9
+ export type BundleStatus = z.infer<typeof bundleStatusSchema>;
10
+ export type BundleDefinition = z.infer<typeof bundleDefinitionSchema>;
11
+ export type CreateBundleDefinitionInput = z.infer<typeof createBundleDefinitionInputSchema>;
12
+ export type UpdateBundleDefinitionInput = z.infer<typeof updateBundleDefinitionInputSchema>;
@@ -0,0 +1,3 @@
1
+ export * from './Catalog.const';
2
+ export * from './Catalog.schema';
3
+ export * from './Catalog.types';
@@ -1,9 +1,10 @@
1
- import { z } from 'zod';
2
1
  import { checkpointTypeSchema } from '../checkpoint/Checkpoint.schema';
3
2
  import { flagStatusSchema } from './flag';
4
3
  import { rgbStatusSchema } from './rgb';
4
+ import { steeringWheelModuleStatusSchema } from './steering-wheel';
5
5
  import { screenStatusSchema } from './screen';
6
6
  import { speedStatusSchema } from './speed';
7
+ import { z } from 'zod';
7
8
 
8
9
  export const kartHardwareStateSchema = z.object({
9
10
  speed: z
@@ -23,5 +24,6 @@ export const kartHardwareStateSchema = z.object({
23
24
  .nullable(),
24
25
  screen: screenStatusSchema.nullable(),
25
26
  isConnectedToServer: z.boolean(),
26
- isSteeringWheelPressed: z.boolean(),
27
+ isSteeringWheelPressed: z.boolean().meta({ deprecated: true, reason: 'use the steering wheel status' }),
28
+ steeringWheel: steeringWheelModuleStatusSchema.nullable(),
27
29
  });
@@ -1,4 +1,22 @@
1
1
  export const STEERING_WHEEL_ACTION_COMMAND = {
2
+ /** @deprecated */
2
3
  TURN_LED_ON: 'TurnLedOn',
3
4
  TURN_LED_OFF: 'TurnLedOff',
5
+ SHOW_LED_EFFECT: 'ShowLedEffect',
6
+ CONFIGURE_LEDS: 'ConfigureLeds',
7
+ } as const;
8
+
9
+ export const STEERING_WHEEL_SHOW_LED_EFFECT_OPTIONS = {
10
+ SHOW_LED_IDLE_EFFECT: 'ShowLedIdleEffect',
11
+ SHOW_LED_POWERUP_EFFECT: 'ShowLedPowerupEffect',
12
+ SHOW_LED_EMERGENCY_EFFECT: 'ShowLedEmergencyEffect',
13
+ SHOW_LED_CONFIG_EFFECT: 'ShowLedConfigEffect',
14
+ } as const;
15
+
16
+ export const STEERING_WHEEL_LED_STATUS = {
17
+ OFF: 'Off',
18
+ IDLE: 'Idle',
19
+ POWER_UP: 'Power-Up',
20
+ EMERGENCY: 'Emergency',
21
+ CONFIG: 'Config',
4
22
  } as const;
@@ -1,9 +1,28 @@
1
1
  import { z } from 'zod';
2
- import { STEERING_WHEEL_ACTION_COMMAND } from './SteeringWheel.const';
2
+ import {
3
+ STEERING_WHEEL_ACTION_COMMAND,
4
+ STEERING_WHEEL_LED_STATUS,
5
+ STEERING_WHEEL_SHOW_LED_EFFECT_OPTIONS,
6
+ } from './SteeringWheel.const';
3
7
 
4
8
  export const steeringWheelActionCommandSchema = z.enum(STEERING_WHEEL_ACTION_COMMAND);
9
+ export const steeringWheelLedStatusSchema = z.enum(STEERING_WHEEL_LED_STATUS);
5
10
 
6
11
  export const steeringWheelModuleStatusSchema = z.object({
7
- isLeftButtonPressed: z.boolean(),
8
- isRightButtonPressed: z.boolean(),
12
+ ledStatus: steeringWheelLedStatusSchema,
13
+ buttons: z.object({
14
+ powerRightPressed: z.boolean(),
15
+ powerLeftPressed: z.boolean(),
16
+ actionRightPressed: z.boolean(),
17
+ actionLeftPressed: z.boolean(),
18
+ extraRightPressed: z.boolean(),
19
+ extraLeftPressed: z.boolean(),
20
+ }),
21
+ });
22
+
23
+ export const steeringWheelShowLedsEffectOptionsSchema = z.enum(STEERING_WHEEL_SHOW_LED_EFFECT_OPTIONS);
24
+
25
+ export const steeringWheelConfigureLedsOptionsSchema = z.object({
26
+ brightness: z.number().min(0).max(100),
27
+ durationSeconds: z.number().min(1).max(25),
9
28
  });
@@ -1,6 +1,14 @@
1
1
  import { z } from 'zod';
2
- import { steeringWheelActionCommandSchema, steeringWheelModuleStatusSchema } from './SteeringWheel.schema';
2
+ import {
3
+ steeringWheelActionCommandSchema,
4
+ steeringWheelConfigureLedsOptionsSchema,
5
+ steeringWheelLedStatusSchema,
6
+ steeringWheelModuleStatusSchema,
7
+ steeringWheelShowLedsEffectOptionsSchema,
8
+ } from './SteeringWheel.schema';
3
9
 
4
10
  export type SteeringWheelActionCommand = z.infer<typeof steeringWheelActionCommandSchema>;
5
-
11
+ export type SteeringWheelLedStatus = z.infer<typeof steeringWheelLedStatusSchema>;
6
12
  export type SteeringWheelModuleStatus = z.infer<typeof steeringWheelModuleStatusSchema>;
13
+ export type SteeringWheelShowLedsEffectOptions = z.infer<typeof steeringWheelShowLedsEffectOptionsSchema>;
14
+ export type SteeringWheelConfigureLedsOptions = z.infer<typeof steeringWheelConfigureLedsOptionsSchema>;
@@ -1,3 +1,4 @@
1
+ export * from './catalog';
1
2
  export * from './checkpoint';
2
3
  export * from './color';
3
4
  export * from './damage';
@@ -14,6 +14,8 @@ import type {
14
14
  SpeedConfiguration,
15
15
  StarLaserConfigureModuleOptions,
16
16
  StarLaserSendActionsOptions,
17
+ SteeringWheelConfigureLedsOptions,
18
+ SteeringWheelShowLedsEffectOptions,
17
19
  } from '../hardware';
18
20
 
19
21
  export type SocketHardwareDataSubscriptionEventsParams = {
@@ -80,6 +82,9 @@ export type SocketHardwareScreenModuleEventsParams = {
80
82
  export type SocketHardwareSteeringWheelModuleEventsParams = {
81
83
  'hardware:steering-wheel:turnLedOn': undefined;
82
84
  'hardware:steering-wheel:turnLedOff': undefined;
85
+ // New Steering Wheel
86
+ 'hardware:steering-wheel:showLedsEffect': SteeringWheelShowLedsEffectOptions;
87
+ 'hardware:steering-wheel:configureLeds': SteeringWheelConfigureLedsOptions;
83
88
  };
84
89
 
85
90
  export type SocketHardwareSoundModuleEventsParams = {
@@ -48,6 +48,12 @@ export const purchaseSchema = z.object({
48
48
  guestName: z.string().optional().nullable(),
49
49
  guestContact: z.string().optional().nullable(),
50
50
 
51
+ // Bundle reference — null for legacy on-site purchases without bundle
52
+ bundleId: z.string().optional().nullable(),
53
+
54
+ // External order reference (e.g. Wix) — null for on-site (POS) purchases
55
+ externalOrderId: z.string().optional().nullable(),
56
+
51
57
  items: z.array(purchaseItemSchema),
52
58
  totalAmountCents: z.number().min(0),
53
59
  status: purchaseStatusSchema.default(PURCHASE_STATUS.PENDING),
@@ -79,6 +85,8 @@ export const createPurchaseInputSchema = z.object({
79
85
  guestName: z.string().optional(),
80
86
  guestContact: z.string().optional(),
81
87
  items: z.array(purchaseItemSchema).min(1),
88
+ bundleId: z.string().optional().nullable(),
89
+ externalOrderId: z.string().optional().nullable(),
82
90
  });
83
91
 
84
92
  export const gameTurnStatusSchema = z.enum(GAME_TURN_STATUS);
@@ -69,11 +69,9 @@ export const authUserSchema = baseUserObj.extend({
69
69
  authToken: z.string(),
70
70
  });
71
71
 
72
- export const userWithPasswordSchema = userSchema.and(
73
- z.object({
74
- password: z.string().min(MIN_PASSWORD_LENGTH),
75
- }),
76
- );
72
+ export const userWithPasswordSchema = userSchema.extend({
73
+ password: z.string().min(MIN_PASSWORD_LENGTH),
74
+ });
77
75
 
78
76
  export const userInitialRegistrationSchema = z.object({
79
77
  emailOrPhone: emailOrPhoneSchema,