@battle-racing/br-common-lib 1.2.2 → 1.2.4

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 (43) hide show
  1. package/dist/constants/hardware/index.d.ts +1 -0
  2. package/dist/constants/hardware/index.js +17 -0
  3. package/dist/constants/hardware/lights-effect.d.ts +10 -0
  4. package/dist/constants/hardware/lights-effect.js +14 -0
  5. package/dist/constants/index.d.ts +5 -4
  6. package/dist/constants/index.js +5 -4
  7. package/dist/constants/{moduleNames.d.ts → module-name.d.ts} +1 -1
  8. package/dist/constants/{moduleNames.js → module-name.js} +2 -2
  9. package/dist/constants/{permissions.d.ts → permission.d.ts} +1 -1
  10. package/dist/constants/{permissions.js → permission.js} +2 -2
  11. package/dist/data/RoleDefinitions.js +11 -11
  12. package/dist/types/hardware/ModuleName.d.ts +2 -2
  13. package/dist/types/hardware/index.d.ts +1 -0
  14. package/dist/types/hardware/index.js +1 -0
  15. package/dist/types/hardware/lights/LightsEffect.d.ts +3 -0
  16. package/dist/types/hardware/lights/LightsEffect.js +2 -0
  17. package/dist/types/hardware/lights/ShowLightsColorParams.d.ts +7 -0
  18. package/dist/types/hardware/lights/ShowLightsColorParams.js +2 -0
  19. package/dist/types/hardware/lights/ShowLightsEffectParams.d.ts +8 -0
  20. package/dist/types/hardware/lights/ShowLightsEffectParams.js +2 -0
  21. package/dist/types/hardware/lights/index.d.ts +3 -0
  22. package/dist/types/hardware/lights/index.js +19 -0
  23. package/dist/types/role/Permission.d.ts +2 -2
  24. package/package.json +1 -1
  25. package/src/constants/hardware/index.ts +1 -0
  26. package/src/constants/hardware/lights-effect.ts +11 -0
  27. package/src/constants/index.ts +6 -4
  28. package/src/constants/{moduleNames.ts → module-name.ts} +1 -1
  29. package/src/constants/{permissions.ts → permission.ts} +1 -1
  30. package/src/data/RoleDefinitions.ts +12 -12
  31. package/src/types/hardware/ModuleName.ts +2 -2
  32. package/src/types/hardware/index.ts +1 -0
  33. package/src/types/hardware/lights/LightsEffect.ts +4 -0
  34. package/src/types/hardware/lights/ShowLightsColorParams.ts +7 -0
  35. package/src/types/hardware/lights/ShowLightsEffectParams.ts +9 -0
  36. package/src/types/hardware/lights/index.ts +3 -0
  37. package/src/types/role/Permission.ts +2 -2
  38. /package/dist/constants/{kartStatus.d.ts → kart-status.d.ts} +0 -0
  39. /package/dist/constants/{kartStatus.js → kart-status.js} +0 -0
  40. /package/dist/constants/{userRole.d.ts → user-role.d.ts} +0 -0
  41. /package/dist/constants/{userRole.js → user-role.js} +0 -0
  42. /package/src/constants/{kartStatus.ts → kart-status.ts} +0 -0
  43. /package/src/constants/{userRole.ts → user-role.ts} +0 -0
@@ -0,0 +1 @@
1
+ export * from './lights-effect';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./lights-effect"), exports);
@@ -0,0 +1,10 @@
1
+ export declare const LIGHTS_EFFECT: {
2
+ readonly SHOW_UV_COLOR: "SHOW_UV_COLOR";
3
+ readonly POWER_OFF: "POWER_OFF";
4
+ readonly START_GAME: "START_GAME";
5
+ readonly GAME_OVER: "GAME_OVER";
6
+ readonly FINAL_LAP: "FINAL_LAP";
7
+ readonly YELLOW_FLAG: "YELLOW_FLAG";
8
+ readonly RED_FLAG: "RED_FLAG";
9
+ readonly PULSE: "PULSE";
10
+ };
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LIGHTS_EFFECT = void 0;
4
+ exports.LIGHTS_EFFECT = {
5
+ SHOW_UV_COLOR: 'SHOW_UV_COLOR',
6
+ POWER_OFF: 'POWER_OFF',
7
+ // GAME EFFECTS
8
+ START_GAME: 'START_GAME',
9
+ GAME_OVER: 'GAME_OVER',
10
+ FINAL_LAP: 'FINAL_LAP',
11
+ YELLOW_FLAG: 'YELLOW_FLAG',
12
+ RED_FLAG: 'RED_FLAG',
13
+ PULSE: 'PULSE',
14
+ };
@@ -1,4 +1,5 @@
1
- export * from './kartStatus';
2
- export * from './moduleNames';
3
- export * from './permissions';
4
- export * from './userRole';
1
+ export * from './hardware';
2
+ export * from './kart-status';
3
+ export * from './module-name';
4
+ export * from './permission';
5
+ export * from './user-role';
@@ -14,7 +14,8 @@ 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("./kartStatus"), exports);
18
- __exportStar(require("./moduleNames"), exports);
19
- __exportStar(require("./permissions"), exports);
20
- __exportStar(require("./userRole"), exports);
17
+ __exportStar(require("./hardware"), exports);
18
+ __exportStar(require("./kart-status"), exports);
19
+ __exportStar(require("./module-name"), exports);
20
+ __exportStar(require("./permission"), exports);
21
+ __exportStar(require("./user-role"), exports);
@@ -1,4 +1,4 @@
1
- export declare const MODULE_NAMES: {
1
+ export declare const MODULE_NAME: {
2
2
  readonly SPEED: "speed";
3
3
  readonly FLAG: "flag";
4
4
  readonly RGB: "rgb";
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MODULE_NAMES = void 0;
4
- exports.MODULE_NAMES = {
3
+ exports.MODULE_NAME = void 0;
4
+ exports.MODULE_NAME = {
5
5
  SPEED: 'speed',
6
6
  FLAG: 'flag',
7
7
  RGB: 'rgb',
@@ -1,4 +1,4 @@
1
- export declare const PERMISSIONS: {
1
+ export declare const PERMISSION: {
2
2
  readonly FULL_ACCESS: "FULL_ACCESS";
3
3
  readonly KARTS_MANAGE_HARDWARE: "KARTS_MANAGE_HARDWARE";
4
4
  readonly KARTS_MANAGE_POWER_UPS: "KARTS_MANAGE_POWER_UPS";
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PERMISSIONS = void 0;
4
- exports.PERMISSIONS = {
3
+ exports.PERMISSION = void 0;
4
+ exports.PERMISSION = {
5
5
  FULL_ACCESS: 'FULL_ACCESS',
6
6
  KARTS_MANAGE_HARDWARE: 'KARTS_MANAGE_HARDWARE',
7
7
  KARTS_MANAGE_POWER_UPS: 'KARTS_MANAGE_POWER_UPS',
@@ -7,21 +7,21 @@ exports.ROLE_DEFINITIONS = [
7
7
  role: constants_1.USER_ROLE.SUPER_ADMIN,
8
8
  description: 'Complete access to all features and settings',
9
9
  permissions: [
10
- constants_1.PERMISSIONS.FULL_ACCESS,
11
- constants_1.PERMISSIONS.KARTS_MANAGE_HARDWARE,
12
- constants_1.PERMISSIONS.KARTS_MANAGE_POWER_UPS,
13
- constants_1.PERMISSIONS.GAME_TRACK_MANAGE_GAMES,
14
- constants_1.PERMISSIONS.GAME_TRACK_MANAGE_BASIC_INFO,
15
- constants_1.PERMISSIONS.GAME_TRACK_MANAGE_HARDWARE,
16
- constants_1.PERMISSIONS.GAME_TRACK_MANAGE_KARTS_CONFIG,
17
- constants_1.PERMISSIONS.GAME_TRACK_MANAGE_CHECKPOINTS,
18
- constants_1.PERMISSIONS.GAME_TRACK_MANAGE_KARTS,
19
- constants_1.PERMISSIONS.KARTS_TRACKING,
10
+ constants_1.PERMISSION.FULL_ACCESS,
11
+ constants_1.PERMISSION.KARTS_MANAGE_HARDWARE,
12
+ constants_1.PERMISSION.KARTS_MANAGE_POWER_UPS,
13
+ constants_1.PERMISSION.GAME_TRACK_MANAGE_GAMES,
14
+ constants_1.PERMISSION.GAME_TRACK_MANAGE_BASIC_INFO,
15
+ constants_1.PERMISSION.GAME_TRACK_MANAGE_HARDWARE,
16
+ constants_1.PERMISSION.GAME_TRACK_MANAGE_KARTS_CONFIG,
17
+ constants_1.PERMISSION.GAME_TRACK_MANAGE_CHECKPOINTS,
18
+ constants_1.PERMISSION.GAME_TRACK_MANAGE_KARTS,
19
+ constants_1.PERMISSION.KARTS_TRACKING,
20
20
  ],
21
21
  },
22
22
  {
23
23
  role: constants_1.USER_ROLE.OPERATOR,
24
24
  description: 'Game Track Operator',
25
- permissions: [constants_1.PERMISSIONS.GAME_TRACK_MANAGE_GAMES],
25
+ permissions: [constants_1.PERMISSION.GAME_TRACK_MANAGE_GAMES],
26
26
  },
27
27
  ];
@@ -1,3 +1,3 @@
1
- import { MODULE_NAMES } from '../../constants';
1
+ import { MODULE_NAME } from '../../constants';
2
2
  import type { ObjectValues } from '../utils';
3
- export type ModuleName = ObjectValues<typeof MODULE_NAMES>;
3
+ export type ModuleName = ObjectValues<typeof MODULE_NAME>;
@@ -5,6 +5,7 @@ export * from './diskThrower';
5
5
  export * from './emergency';
6
6
  export * from './flag';
7
7
  export * from './KartEffect';
8
+ export * from './lights';
8
9
  export * from './ModuleName';
9
10
  export * from './ModuleStatus';
10
11
  export * from './rgb';
@@ -21,6 +21,7 @@ __exportStar(require("./diskThrower"), exports);
21
21
  __exportStar(require("./emergency"), exports);
22
22
  __exportStar(require("./flag"), exports);
23
23
  __exportStar(require("./KartEffect"), exports);
24
+ __exportStar(require("./lights"), exports);
24
25
  __exportStar(require("./ModuleName"), exports);
25
26
  __exportStar(require("./ModuleStatus"), exports);
26
27
  __exportStar(require("./rgb"), exports);
@@ -0,0 +1,3 @@
1
+ import { LIGHTS_EFFECT } from '../../../constants';
2
+ import type { ObjectValues } from '../../utils';
3
+ export type LightsEffect = ObjectValues<typeof LIGHTS_EFFECT>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ export interface ShowLightsColorParams {
2
+ address: number[] | 'all';
3
+ /** Duration of the change of the speed in seconds 1 - 25s */
4
+ timeDuration: number;
5
+ /** Color to show HEX RGB */
6
+ color: string;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ import type { LightsEffect } from './LightsEffect';
2
+ export interface ShowLightsEffectParams {
3
+ /** Address of the light to exec the effect */
4
+ addresses: number[] | 'all';
5
+ effect: LightsEffect;
6
+ /** Duration of the change of the speed in seconds 1 - 25s */
7
+ timeDuration: number;
8
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ export * from './LightsEffect';
2
+ export * from './ShowLightsColorParams';
3
+ export * from './ShowLightsEffectParams';
@@ -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("./LightsEffect"), exports);
18
+ __exportStar(require("./ShowLightsColorParams"), exports);
19
+ __exportStar(require("./ShowLightsEffectParams"), exports);
@@ -1,3 +1,3 @@
1
- import { PERMISSIONS } from '../../constants';
1
+ import { PERMISSION } from '../../constants';
2
2
  import type { ObjectValues } from '../utils';
3
- export type Permission = ObjectValues<typeof PERMISSIONS>;
3
+ export type Permission = ObjectValues<typeof PERMISSION>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@battle-racing/br-common-lib",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "Common library for all Battle Racing Repositorios",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -0,0 +1 @@
1
+ export * from './lights-effect';
@@ -0,0 +1,11 @@
1
+ export const LIGHTS_EFFECT = {
2
+ SHOW_UV_COLOR: 'SHOW_UV_COLOR',
3
+ POWER_OFF: 'POWER_OFF',
4
+ // GAME EFFECTS
5
+ START_GAME: 'START_GAME',
6
+ GAME_OVER: 'GAME_OVER',
7
+ FINAL_LAP: 'FINAL_LAP',
8
+ YELLOW_FLAG: 'YELLOW_FLAG',
9
+ RED_FLAG: 'RED_FLAG',
10
+ PULSE: 'PULSE',
11
+ } as const;
@@ -1,4 +1,6 @@
1
- export * from './kartStatus';
2
- export * from './moduleNames';
3
- export * from './permissions';
4
- export * from './userRole';
1
+ export * from './hardware';
2
+ export * from './kart-status';
3
+ export * from './module-name';
4
+ export * from './permission';
5
+ export * from './user-role';
6
+
@@ -1,4 +1,4 @@
1
- export const MODULE_NAMES = {
1
+ export const MODULE_NAME = {
2
2
  SPEED: 'speed',
3
3
  FLAG: 'flag',
4
4
  RGB: 'rgb',
@@ -1,4 +1,4 @@
1
- export const PERMISSIONS = {
1
+ export const PERMISSION = {
2
2
  FULL_ACCESS: 'FULL_ACCESS',
3
3
 
4
4
  KARTS_MANAGE_HARDWARE: 'KARTS_MANAGE_HARDWARE',
@@ -1,4 +1,4 @@
1
- import { PERMISSIONS, USER_ROLE } from '../constants';
1
+ import { PERMISSION, USER_ROLE } from '../constants';
2
2
  import type { RoleDefinition } from '../types/role/RoleDefinition';
3
3
 
4
4
  export const ROLE_DEFINITIONS: RoleDefinition[] = [
@@ -6,21 +6,21 @@ export const ROLE_DEFINITIONS: RoleDefinition[] = [
6
6
  role: USER_ROLE.SUPER_ADMIN,
7
7
  description: 'Complete access to all features and settings',
8
8
  permissions: [
9
- PERMISSIONS.FULL_ACCESS,
10
- PERMISSIONS.KARTS_MANAGE_HARDWARE,
11
- PERMISSIONS.KARTS_MANAGE_POWER_UPS,
12
- PERMISSIONS.GAME_TRACK_MANAGE_GAMES,
13
- PERMISSIONS.GAME_TRACK_MANAGE_BASIC_INFO,
14
- PERMISSIONS.GAME_TRACK_MANAGE_HARDWARE,
15
- PERMISSIONS.GAME_TRACK_MANAGE_KARTS_CONFIG,
16
- PERMISSIONS.GAME_TRACK_MANAGE_CHECKPOINTS,
17
- PERMISSIONS.GAME_TRACK_MANAGE_KARTS,
18
- PERMISSIONS.KARTS_TRACKING,
9
+ PERMISSION.FULL_ACCESS,
10
+ PERMISSION.KARTS_MANAGE_HARDWARE,
11
+ PERMISSION.KARTS_MANAGE_POWER_UPS,
12
+ PERMISSION.GAME_TRACK_MANAGE_GAMES,
13
+ PERMISSION.GAME_TRACK_MANAGE_BASIC_INFO,
14
+ PERMISSION.GAME_TRACK_MANAGE_HARDWARE,
15
+ PERMISSION.GAME_TRACK_MANAGE_KARTS_CONFIG,
16
+ PERMISSION.GAME_TRACK_MANAGE_CHECKPOINTS,
17
+ PERMISSION.GAME_TRACK_MANAGE_KARTS,
18
+ PERMISSION.KARTS_TRACKING,
19
19
  ],
20
20
  },
21
21
  {
22
22
  role: USER_ROLE.OPERATOR,
23
23
  description: 'Game Track Operator',
24
- permissions: [PERMISSIONS.GAME_TRACK_MANAGE_GAMES],
24
+ permissions: [PERMISSION.GAME_TRACK_MANAGE_GAMES],
25
25
  },
26
26
  ];
@@ -1,4 +1,4 @@
1
- import { MODULE_NAMES } from '../../constants';
1
+ import { MODULE_NAME } from '../../constants';
2
2
  import type { ObjectValues } from '../utils';
3
3
 
4
- export type ModuleName = ObjectValues<typeof MODULE_NAMES>;
4
+ export type ModuleName = ObjectValues<typeof MODULE_NAME>;
@@ -5,6 +5,7 @@ export * from './diskThrower';
5
5
  export * from './emergency';
6
6
  export * from './flag';
7
7
  export * from './KartEffect';
8
+ export * from './lights';
8
9
  export * from './ModuleName';
9
10
  export * from './ModuleStatus';
10
11
  export * from './rgb';
@@ -0,0 +1,4 @@
1
+ import { LIGHTS_EFFECT } from '../../../constants';
2
+ import type { ObjectValues } from '../../utils';
3
+
4
+ export type LightsEffect = ObjectValues<typeof LIGHTS_EFFECT>;
@@ -0,0 +1,7 @@
1
+ export interface ShowLightsColorParams {
2
+ address: number[] | 'all';
3
+ /** Duration of the change of the speed in seconds 1 - 25s */
4
+ timeDuration: number;
5
+ /** Color to show HEX RGB */
6
+ color: string;
7
+ }
@@ -0,0 +1,9 @@
1
+ import type { LightsEffect } from './LightsEffect';
2
+
3
+ export interface ShowLightsEffectParams {
4
+ /** Address of the light to exec the effect */
5
+ addresses: number[] | 'all';
6
+ effect: LightsEffect;
7
+ /** Duration of the change of the speed in seconds 1 - 25s */
8
+ timeDuration: number;
9
+ }
@@ -0,0 +1,3 @@
1
+ export * from './LightsEffect';
2
+ export * from './ShowLightsColorParams';
3
+ export * from './ShowLightsEffectParams';
@@ -1,4 +1,4 @@
1
- import { PERMISSIONS } from '../../constants';
1
+ import { PERMISSION } from '../../constants';
2
2
  import type { ObjectValues } from '../utils';
3
3
 
4
- export type Permission = ObjectValues<typeof PERMISSIONS>;
4
+ export type Permission = ObjectValues<typeof PERMISSION>;
File without changes
File without changes
File without changes