@battle-racing/br-common-lib 4.8.1 → 4.9.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 (31) 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 +57 -0
  4. package/dist/domains/catalog/Catalog.schema.js +25 -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/ModuleName.const.d.ts +1 -0
  12. package/dist/domains/hardware/ModuleName.const.js +1 -0
  13. package/dist/domains/hardware/ModuleStatus.schema.d.ts +16 -2
  14. package/dist/domains/hardware/screen/ScreenDebug.schema.d.ts +17 -0
  15. package/dist/domains/hardware/steering-wheel/SteeringWheel.const.d.ts +16 -0
  16. package/dist/domains/hardware/steering-wheel/SteeringWheel.const.js +17 -1
  17. package/dist/domains/hardware/steering-wheel/SteeringWheel.schema.d.ts +34 -2
  18. package/dist/domains/hardware/steering-wheel/SteeringWheel.schema.js +16 -3
  19. package/dist/domains/hardware/steering-wheel/SteeringWheel.types.d.ts +4 -1
  20. package/dist/domains/hardware/steering-wheel/index.d.ts +1 -0
  21. package/dist/domains/hardware/steering-wheel/index.js +1 -0
  22. package/dist/domains/kart/Kart.schema.d.ts +17 -0
  23. package/dist/domains/socket/SocketHardwareModulesEventsParams.d.ts +3 -1
  24. package/package.json +1 -1
  25. package/src/domains/hardware/KartHardwareState.schema.ts +4 -2
  26. package/src/domains/hardware/ModuleName.const.ts +1 -0
  27. package/src/domains/hardware/steering-wheel/SteeringWheel.const.ts +18 -0
  28. package/src/domains/hardware/steering-wheel/SteeringWheel.schema.ts +22 -3
  29. package/src/domains/hardware/steering-wheel/SteeringWheel.types.ts +10 -2
  30. package/src/domains/hardware/steering-wheel/index.ts +1 -0
  31. package/src/domains/socket/SocketHardwareModulesEventsParams.ts +5 -0
@@ -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,57 @@
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
+ description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
10
+ items: z.ZodArray<z.ZodObject<{
11
+ ticketType: z.ZodEnum<{
12
+ readonly Race: "Race";
13
+ readonly Battle: "Battle";
14
+ }>;
15
+ quantity: z.ZodNumber;
16
+ priceCents: z.ZodNumber;
17
+ }, z.core.$strip>>;
18
+ status: z.ZodDefault<z.ZodEnum<{
19
+ readonly ACTIVE: "active";
20
+ readonly INACTIVE: "inactive";
21
+ }>>;
22
+ externalProductId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
23
+ createdAt: z.ZodDate;
24
+ updatedAt: z.ZodDate;
25
+ }, z.core.$strip>;
26
+ export declare const createBundleDefinitionInputSchema: z.ZodObject<{
27
+ status: z.ZodDefault<z.ZodEnum<{
28
+ readonly ACTIVE: "active";
29
+ readonly INACTIVE: "inactive";
30
+ }>>;
31
+ items: z.ZodArray<z.ZodObject<{
32
+ ticketType: z.ZodEnum<{
33
+ readonly Race: "Race";
34
+ readonly Battle: "Battle";
35
+ }>;
36
+ quantity: z.ZodNumber;
37
+ priceCents: z.ZodNumber;
38
+ }, z.core.$strip>>;
39
+ name: z.ZodString;
40
+ description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
41
+ }, z.core.$strip>;
42
+ export declare const updateBundleDefinitionInputSchema: z.ZodObject<{
43
+ status: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
44
+ readonly ACTIVE: "active";
45
+ readonly INACTIVE: "inactive";
46
+ }>>>;
47
+ items: z.ZodOptional<z.ZodArray<z.ZodObject<{
48
+ ticketType: z.ZodEnum<{
49
+ readonly Race: "Race";
50
+ readonly Battle: "Battle";
51
+ }>;
52
+ quantity: z.ZodNumber;
53
+ priceCents: z.ZodNumber;
54
+ }, z.core.$strip>>>;
55
+ name: z.ZodOptional<z.ZodString>;
56
+ description: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
57
+ }, z.core.$strip>;
@@ -0,0 +1,25 @@
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
+ description: zod_1.z.string().optional().nullable(),
12
+ items: zod_1.z.array(Ticketing_schema_1.purchaseItemSchema).min(1),
13
+ status: exports.bundleStatusSchema.default(Catalog_const_1.BUNDLE_STATUS.ACTIVE),
14
+ // Set after syncing to an external storefront — null means not yet synced
15
+ externalProductId: zod_1.z.string().optional().nullable(),
16
+ createdAt: zod_1.z.date(),
17
+ updatedAt: zod_1.z.date(),
18
+ });
19
+ exports.createBundleDefinitionInputSchema = exports.bundleDefinitionSchema.omit({
20
+ id: true,
21
+ externalProductId: true,
22
+ createdAt: true,
23
+ updatedAt: true,
24
+ });
25
+ 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
  });
@@ -9,4 +9,5 @@ export declare const MODULE_NAME: {
9
9
  readonly SCREEN: "screen";
10
10
  readonly EMERGENCY: "emergency";
11
11
  readonly LIGHTS: "lights";
12
+ readonly STEERING_WHEEL: "steering-wheel";
12
13
  };
@@ -12,4 +12,5 @@ exports.MODULE_NAME = {
12
12
  SCREEN: 'screen',
13
13
  EMERGENCY: 'emergency',
14
14
  LIGHTS: 'lights',
15
+ STEERING_WHEEL: 'steering-wheel',
15
16
  };
@@ -10,6 +10,7 @@ export declare const moduleNameSchema: z.ZodEnum<{
10
10
  readonly SCREEN: "screen";
11
11
  readonly EMERGENCY: "emergency";
12
12
  readonly LIGHTS: "lights";
13
+ readonly STEERING_WHEEL: "steering-wheel";
13
14
  }>;
14
15
  export declare const moduleStatusSchema: z.ZodUnion<readonly [z.ZodObject<{
15
16
  speedStatus: z.ZodEnum<{
@@ -106,8 +107,21 @@ export declare const moduleStatusSchema: z.ZodUnion<readonly [z.ZodObject<{
106
107
  starHitByKartId: z.ZodNullable<z.ZodNumber>;
107
108
  laserHitByKartId: z.ZodNullable<z.ZodNumber>;
108
109
  }, z.core.$strip>, z.ZodObject<{
109
- isLeftButtonPressed: z.ZodBoolean;
110
- 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>;
111
125
  }, z.core.$strip>, z.ZodObject<{
112
126
  emergencyStatus: z.ZodEnum<{
113
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,2 +1,3 @@
1
1
  export * from './SteeringWheel.schema';
2
2
  export * from './SteeringWheel.types';
3
+ export * from './SteeringWheel.const';
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./SteeringWheel.schema"), exports);
18
18
  __exportStar(require("./SteeringWheel.types"), exports);
19
+ __exportStar(require("./SteeringWheel.const"), 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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@battle-racing/br-common-lib",
3
- "version": "4.8.1",
3
+ "version": "4.9.0",
4
4
  "description": "Common library for all Battle Racing Repositorios",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -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
  });
@@ -9,4 +9,5 @@ export const MODULE_NAME = {
9
9
  SCREEN: 'screen',
10
10
  EMERGENCY: 'emergency',
11
11
  LIGHTS: 'lights',
12
+ STEERING_WHEEL: 'steering-wheel',
12
13
  } as const;
@@ -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,2 +1,3 @@
1
1
  export * from './SteeringWheel.schema';
2
2
  export * from './SteeringWheel.types';
3
+ export * from './SteeringWheel.const';
@@ -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 = {