@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.
- package/dist/constants/hardware/index.d.ts +1 -0
- package/dist/constants/hardware/index.js +17 -0
- package/dist/constants/hardware/lights-effect.d.ts +10 -0
- package/dist/constants/hardware/lights-effect.js +14 -0
- package/dist/constants/index.d.ts +5 -4
- package/dist/constants/index.js +5 -4
- package/dist/constants/{moduleNames.d.ts → module-name.d.ts} +1 -1
- package/dist/constants/{moduleNames.js → module-name.js} +2 -2
- package/dist/constants/{permissions.d.ts → permission.d.ts} +1 -1
- package/dist/constants/{permissions.js → permission.js} +2 -2
- package/dist/data/RoleDefinitions.js +11 -11
- package/dist/types/hardware/ModuleName.d.ts +2 -2
- package/dist/types/hardware/index.d.ts +1 -0
- package/dist/types/hardware/index.js +1 -0
- package/dist/types/hardware/lights/LightsEffect.d.ts +3 -0
- package/dist/types/hardware/lights/LightsEffect.js +2 -0
- package/dist/types/hardware/lights/ShowLightsColorParams.d.ts +7 -0
- package/dist/types/hardware/lights/ShowLightsColorParams.js +2 -0
- package/dist/types/hardware/lights/ShowLightsEffectParams.d.ts +8 -0
- package/dist/types/hardware/lights/ShowLightsEffectParams.js +2 -0
- package/dist/types/hardware/lights/index.d.ts +3 -0
- package/dist/types/hardware/lights/index.js +19 -0
- package/dist/types/role/Permission.d.ts +2 -2
- package/package.json +1 -1
- package/src/constants/hardware/index.ts +1 -0
- package/src/constants/hardware/lights-effect.ts +11 -0
- package/src/constants/index.ts +6 -4
- package/src/constants/{moduleNames.ts → module-name.ts} +1 -1
- package/src/constants/{permissions.ts → permission.ts} +1 -1
- package/src/data/RoleDefinitions.ts +12 -12
- package/src/types/hardware/ModuleName.ts +2 -2
- package/src/types/hardware/index.ts +1 -0
- package/src/types/hardware/lights/LightsEffect.ts +4 -0
- package/src/types/hardware/lights/ShowLightsColorParams.ts +7 -0
- package/src/types/hardware/lights/ShowLightsEffectParams.ts +9 -0
- package/src/types/hardware/lights/index.ts +3 -0
- package/src/types/role/Permission.ts +2 -2
- /package/dist/constants/{kartStatus.d.ts → kart-status.d.ts} +0 -0
- /package/dist/constants/{kartStatus.js → kart-status.js} +0 -0
- /package/dist/constants/{userRole.d.ts → user-role.d.ts} +0 -0
- /package/dist/constants/{userRole.js → user-role.js} +0 -0
- /package/src/constants/{kartStatus.ts → kart-status.ts} +0 -0
- /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 './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
1
|
+
export * from './hardware';
|
|
2
|
+
export * from './kart-status';
|
|
3
|
+
export * from './module-name';
|
|
4
|
+
export * from './permission';
|
|
5
|
+
export * from './user-role';
|
package/dist/constants/index.js
CHANGED
|
@@ -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("./
|
|
18
|
-
__exportStar(require("./
|
|
19
|
-
__exportStar(require("./
|
|
20
|
-
__exportStar(require("./
|
|
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,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
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.
|
|
11
|
-
constants_1.
|
|
12
|
-
constants_1.
|
|
13
|
-
constants_1.
|
|
14
|
-
constants_1.
|
|
15
|
-
constants_1.
|
|
16
|
-
constants_1.
|
|
17
|
-
constants_1.
|
|
18
|
-
constants_1.
|
|
19
|
-
constants_1.
|
|
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.
|
|
25
|
+
permissions: [constants_1.PERMISSION.GAME_TRACK_MANAGE_GAMES],
|
|
26
26
|
},
|
|
27
27
|
];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MODULE_NAME } from '../../constants';
|
|
2
2
|
import type { ObjectValues } from '../utils';
|
|
3
|
-
export type ModuleName = ObjectValues<typeof
|
|
3
|
+
export type ModuleName = ObjectValues<typeof MODULE_NAME>;
|
|
@@ -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,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,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 {
|
|
1
|
+
import { PERMISSION } from '../../constants';
|
|
2
2
|
import type { ObjectValues } from '../utils';
|
|
3
|
-
export type Permission = ObjectValues<typeof
|
|
3
|
+
export type Permission = ObjectValues<typeof PERMISSION>;
|
package/package.json
CHANGED
|
@@ -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;
|
package/src/constants/index.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
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
|
-
import {
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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: [
|
|
24
|
+
permissions: [PERMISSION.GAME_TRACK_MANAGE_GAMES],
|
|
25
25
|
},
|
|
26
26
|
];
|
|
@@ -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
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|