@battle-racing/br-common-lib 6.2.0-rc.0 → 6.2.0-rc.2
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/__deprecated__/constants/hardware/screen-view.d.ts +1 -0
- package/dist/__deprecated__/constants/hardware/screen-view.js +1 -0
- package/dist/data/all-tutorial-steps.d.ts +2 -0
- package/dist/data/all-tutorial-steps.js +379 -0
- package/dist/data/index.d.ts +1 -0
- package/dist/data/index.js +1 -0
- package/dist/domains/hardware/ModuleStatus.schema.d.ts +1 -0
- package/dist/domains/hardware/screen/Screen.const.d.ts +1 -0
- package/dist/domains/hardware/screen/Screen.const.js +1 -0
- package/dist/domains/hardware/screen/Screen.schema.d.ts +2 -0
- package/dist/domains/socket/clientToServer/SocketKartClientToServerEventsParams.d.ts +3 -0
- package/dist/domains/socket/serverToClient/SocketKartServerToClientEventsParams.d.ts +3 -0
- package/dist/domains/tutorial/Tutorial.const.d.ts +30 -0
- package/dist/domains/tutorial/Tutorial.const.js +31 -1
- package/dist/domains/tutorial/Tutorial.schema.d.ts +139 -0
- package/dist/domains/tutorial/Tutorial.schema.js +56 -1
- package/dist/domains/tutorial/Tutorial.types.d.ts +10 -1
- package/dist/domains/tutorial/TutorialConfig.schema.d.ts +2781 -0
- package/dist/domains/tutorial/TutorialConfig.schema.js +43 -0
- package/dist/domains/tutorial/TutorialConfig.types.d.ts +9 -0
- package/dist/domains/tutorial/TutorialConfig.types.js +2 -0
- package/dist/domains/tutorial/index.d.ts +2 -0
- package/dist/domains/tutorial/index.js +2 -0
- package/package.json +1 -1
- package/src/__deprecated__/constants/hardware/screen-view.ts +1 -0
- package/src/data/all-tutorial-steps.ts +388 -0
- package/src/data/index.ts +1 -1
- package/src/domains/hardware/screen/Screen.const.ts +1 -0
- package/src/domains/socket/clientToServer/SocketKartClientToServerEventsParams.ts +3 -0
- package/src/domains/socket/serverToClient/SocketKartServerToClientEventsParams.ts +3 -0
- package/src/domains/tutorial/Tutorial.const.ts +36 -0
- package/src/domains/tutorial/Tutorial.schema.ts +74 -1
- package/src/domains/tutorial/Tutorial.types.ts +21 -1
- package/src/domains/tutorial/TutorialConfig.schema.ts +52 -0
- package/src/domains/tutorial/TutorialConfig.types.ts +18 -0
- package/src/domains/tutorial/index.ts +2 -0
|
@@ -18,3 +18,142 @@ export declare const tutorialScreenStepSchema: z.ZodEnum<{
|
|
|
18
18
|
PowerUpReturnToHud: "PowerUpReturnToHud";
|
|
19
19
|
TutorialCompleted: "TutorialCompleted";
|
|
20
20
|
}>;
|
|
21
|
+
export declare const tutorialStatusSchema: z.ZodEnum<{
|
|
22
|
+
COMPLETED: "COMPLETED";
|
|
23
|
+
PENDING: "PENDING";
|
|
24
|
+
IN_PROGRESS: "IN_PROGRESS";
|
|
25
|
+
SKIPPED: "SKIPPED";
|
|
26
|
+
}>;
|
|
27
|
+
export declare const tutorialPhaseIdSchema: z.ZodEnum<{
|
|
28
|
+
starting_point: "starting_point";
|
|
29
|
+
checkpoint_1: "checkpoint_1";
|
|
30
|
+
checkpoint_2: "checkpoint_2";
|
|
31
|
+
lap_completion: "lap_completion";
|
|
32
|
+
}>;
|
|
33
|
+
export declare const tutorialListenEventOnSchema: z.ZodEnum<{
|
|
34
|
+
timeout: "timeout";
|
|
35
|
+
wheelButton: "wheelButton";
|
|
36
|
+
checkpoint: "checkpoint";
|
|
37
|
+
}>;
|
|
38
|
+
export declare const tutorialSteeringWheelButtonSchema: z.ZodEnum<{
|
|
39
|
+
any: "any";
|
|
40
|
+
left: "left";
|
|
41
|
+
right: "right";
|
|
42
|
+
}>;
|
|
43
|
+
export declare const tutorialLogicalCheckpointSchema: z.ZodEnum<{
|
|
44
|
+
checkpoint_1: "checkpoint_1";
|
|
45
|
+
checkpoint_2: "checkpoint_2";
|
|
46
|
+
checkpoint_3_finish: "checkpoint_3_finish";
|
|
47
|
+
}>;
|
|
48
|
+
export declare const tutorialKartSnapshotSchema: z.ZodObject<{
|
|
49
|
+
tutorialSessionId: z.ZodString;
|
|
50
|
+
deviceId: z.ZodString;
|
|
51
|
+
playerId: z.ZodOptional<z.ZodString>;
|
|
52
|
+
status: z.ZodEnum<{
|
|
53
|
+
COMPLETED: "COMPLETED";
|
|
54
|
+
PENDING: "PENDING";
|
|
55
|
+
IN_PROGRESS: "IN_PROGRESS";
|
|
56
|
+
SKIPPED: "SKIPPED";
|
|
57
|
+
}>;
|
|
58
|
+
currentPhaseId: z.ZodEnum<{
|
|
59
|
+
starting_point: "starting_point";
|
|
60
|
+
checkpoint_1: "checkpoint_1";
|
|
61
|
+
checkpoint_2: "checkpoint_2";
|
|
62
|
+
lap_completion: "lap_completion";
|
|
63
|
+
}>;
|
|
64
|
+
currentStep: z.ZodEnum<{
|
|
65
|
+
Welcome: "Welcome";
|
|
66
|
+
PersonalItems: "PersonalItems";
|
|
67
|
+
SeatBelt: "SeatBelt";
|
|
68
|
+
Pedal: "Pedal";
|
|
69
|
+
WheelControls0Of2: "WheelControls0Of2";
|
|
70
|
+
WheelControls1Of2: "WheelControls1Of2";
|
|
71
|
+
WheelControlsCompleted: "WheelControlsCompleted";
|
|
72
|
+
HudOverview: "HudOverview";
|
|
73
|
+
HudPosition: "HudPosition";
|
|
74
|
+
HudLaps: "HudLaps";
|
|
75
|
+
HudTimeLeft: "HudTimeLeft";
|
|
76
|
+
HudCoins: "HudCoins";
|
|
77
|
+
PowerUpWaiting: "PowerUpWaiting";
|
|
78
|
+
PowerUpRoulette: "PowerUpRoulette";
|
|
79
|
+
PowerUpNitroReady: "PowerUpNitroReady";
|
|
80
|
+
PowerUpReturnToHud: "PowerUpReturnToHud";
|
|
81
|
+
TutorialCompleted: "TutorialCompleted";
|
|
82
|
+
}>;
|
|
83
|
+
revision: z.ZodNumber;
|
|
84
|
+
presentationRevision: z.ZodNumber;
|
|
85
|
+
hud: z.ZodOptional<z.ZodObject<{
|
|
86
|
+
coins: z.ZodNonOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
87
|
+
position: z.ZodNonOptional<z.ZodOptional<z.ZodObject<{
|
|
88
|
+
current: z.ZodNullable<z.ZodNumber>;
|
|
89
|
+
total: z.ZodNullable<z.ZodNumber>;
|
|
90
|
+
}, z.core.$strip>>>;
|
|
91
|
+
laps: z.ZodNonOptional<z.ZodOptional<z.ZodObject<{
|
|
92
|
+
current: z.ZodNullable<z.ZodNumber>;
|
|
93
|
+
total: z.ZodNullable<z.ZodNumber>;
|
|
94
|
+
}, z.core.$strip>>>;
|
|
95
|
+
gameTimeLeft: z.ZodNonOptional<z.ZodOptional<z.ZodObject<{
|
|
96
|
+
minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
97
|
+
seconds: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
98
|
+
}, z.core.$strip>>>;
|
|
99
|
+
powerUp: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodEnum<{
|
|
100
|
+
readonly BATTLE_GOD: "Battle God";
|
|
101
|
+
readonly BATTLE_STAR: "Battle Star";
|
|
102
|
+
readonly BATTLE_SHOT: "Battle Shot";
|
|
103
|
+
readonly BATTLE_NITRO: "Battle Nitro";
|
|
104
|
+
readonly BATTLE_PULSE: "Battle Pulse";
|
|
105
|
+
readonly BATTLE_TRAP: "Battle Trap";
|
|
106
|
+
readonly BATTLE_SHIELD: "Battle Shield";
|
|
107
|
+
readonly BATTLE_TURBO: "Battle Turbo";
|
|
108
|
+
readonly BATTLE_BLUE_SHOT: "Battle Blue Shot";
|
|
109
|
+
}>, z.ZodLiteral<"Clear PowerUp">]>>>;
|
|
110
|
+
powerUpAnimationTimeSeconds: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
111
|
+
}, z.core.$strip>>;
|
|
112
|
+
awaitingCheckpoint: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
113
|
+
checkpoint_1: "checkpoint_1";
|
|
114
|
+
checkpoint_2: "checkpoint_2";
|
|
115
|
+
checkpoint_3_finish: "checkpoint_3_finish";
|
|
116
|
+
}>>>;
|
|
117
|
+
completedCheckpoints: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
118
|
+
checkpoint_1: "checkpoint_1";
|
|
119
|
+
checkpoint_2: "checkpoint_2";
|
|
120
|
+
checkpoint_3_finish: "checkpoint_3_finish";
|
|
121
|
+
}>>>;
|
|
122
|
+
updatedAtISO: z.ZodString;
|
|
123
|
+
}, z.core.$strip>;
|
|
124
|
+
export declare const tutorialInputSignalTypeSchema: z.ZodEnum<{
|
|
125
|
+
SteeringWheelButtonPressed: "SteeringWheelButtonPressed";
|
|
126
|
+
}>;
|
|
127
|
+
export declare const tutorialKartEventBaseSchema: z.ZodObject<{
|
|
128
|
+
tutorialSessionId: z.ZodString;
|
|
129
|
+
deviceId: z.ZodString;
|
|
130
|
+
revision: z.ZodNumber;
|
|
131
|
+
sequence: z.ZodNumber;
|
|
132
|
+
originTimestampISO: z.ZodString;
|
|
133
|
+
}, z.core.$strip>;
|
|
134
|
+
export declare const tutorialSteeringWheelButtonPressedSchema: z.ZodObject<{
|
|
135
|
+
tutorialSessionId: z.ZodString;
|
|
136
|
+
deviceId: z.ZodString;
|
|
137
|
+
revision: z.ZodNumber;
|
|
138
|
+
sequence: z.ZodNumber;
|
|
139
|
+
originTimestampISO: z.ZodString;
|
|
140
|
+
type: z.ZodLiteral<"SteeringWheelButtonPressed">;
|
|
141
|
+
button: z.ZodEnum<{
|
|
142
|
+
any: "any";
|
|
143
|
+
left: "left";
|
|
144
|
+
right: "right";
|
|
145
|
+
}>;
|
|
146
|
+
}, z.core.$strip>;
|
|
147
|
+
export declare const tutorialInputSignalSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
148
|
+
tutorialSessionId: z.ZodString;
|
|
149
|
+
deviceId: z.ZodString;
|
|
150
|
+
revision: z.ZodNumber;
|
|
151
|
+
sequence: z.ZodNumber;
|
|
152
|
+
originTimestampISO: z.ZodString;
|
|
153
|
+
type: z.ZodLiteral<"SteeringWheelButtonPressed">;
|
|
154
|
+
button: z.ZodEnum<{
|
|
155
|
+
any: "any";
|
|
156
|
+
left: "left";
|
|
157
|
+
right: "right";
|
|
158
|
+
}>;
|
|
159
|
+
}, z.core.$strip>], "type">;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.tutorialScreenStepSchema = void 0;
|
|
3
|
+
exports.tutorialInputSignalSchema = exports.tutorialSteeringWheelButtonPressedSchema = exports.tutorialKartEventBaseSchema = exports.tutorialInputSignalTypeSchema = exports.tutorialKartSnapshotSchema = exports.tutorialLogicalCheckpointSchema = exports.tutorialSteeringWheelButtonSchema = exports.tutorialListenEventOnSchema = exports.tutorialPhaseIdSchema = exports.tutorialStatusSchema = exports.tutorialScreenStepSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const ScreenTutorial_schema_1 = require("../hardware/screen/ScreenTutorial.schema");
|
|
5
6
|
const Tutorial_const_1 = require("./Tutorial.const");
|
|
6
7
|
exports.tutorialScreenStepSchema = zod_1.z.enum([
|
|
7
8
|
Tutorial_const_1.TUTORIAL_SCREEN_STEP.WELCOME,
|
|
@@ -22,3 +23,57 @@ exports.tutorialScreenStepSchema = zod_1.z.enum([
|
|
|
22
23
|
Tutorial_const_1.TUTORIAL_SCREEN_STEP.POWER_UP_RETURN_TO_HUD,
|
|
23
24
|
Tutorial_const_1.TUTORIAL_SCREEN_STEP.TUTORIAL_COMPLETED,
|
|
24
25
|
]);
|
|
26
|
+
exports.tutorialStatusSchema = zod_1.z.enum([
|
|
27
|
+
Tutorial_const_1.TUTORIAL_STATUS.PENDING,
|
|
28
|
+
Tutorial_const_1.TUTORIAL_STATUS.IN_PROGRESS,
|
|
29
|
+
Tutorial_const_1.TUTORIAL_STATUS.COMPLETED,
|
|
30
|
+
Tutorial_const_1.TUTORIAL_STATUS.SKIPPED,
|
|
31
|
+
]);
|
|
32
|
+
exports.tutorialPhaseIdSchema = zod_1.z.enum([
|
|
33
|
+
Tutorial_const_1.TUTORIAL_PHASE_ID.STARTING_POINT,
|
|
34
|
+
Tutorial_const_1.TUTORIAL_PHASE_ID.CHECKPOINT_1,
|
|
35
|
+
Tutorial_const_1.TUTORIAL_PHASE_ID.CHECKPOINT_2,
|
|
36
|
+
Tutorial_const_1.TUTORIAL_PHASE_ID.LAP_COMPLETION,
|
|
37
|
+
]);
|
|
38
|
+
exports.tutorialListenEventOnSchema = zod_1.z.enum([
|
|
39
|
+
Tutorial_const_1.TUTORIAL_LISTEN_EVENT_ON.TIMEOUT,
|
|
40
|
+
Tutorial_const_1.TUTORIAL_LISTEN_EVENT_ON.WHEEL_BUTTON,
|
|
41
|
+
Tutorial_const_1.TUTORIAL_LISTEN_EVENT_ON.CHECKPOINT,
|
|
42
|
+
]);
|
|
43
|
+
exports.tutorialSteeringWheelButtonSchema = zod_1.z.enum([
|
|
44
|
+
Tutorial_const_1.TUTORIAL_STEERING_WHEEL_BUTTON.RIGHT,
|
|
45
|
+
Tutorial_const_1.TUTORIAL_STEERING_WHEEL_BUTTON.LEFT,
|
|
46
|
+
Tutorial_const_1.TUTORIAL_STEERING_WHEEL_BUTTON.ANY,
|
|
47
|
+
]);
|
|
48
|
+
exports.tutorialLogicalCheckpointSchema = zod_1.z.enum([
|
|
49
|
+
Tutorial_const_1.TUTORIAL_LOGICAL_CHECKPOINT.CHECKPOINT_1,
|
|
50
|
+
Tutorial_const_1.TUTORIAL_LOGICAL_CHECKPOINT.CHECKPOINT_2,
|
|
51
|
+
Tutorial_const_1.TUTORIAL_LOGICAL_CHECKPOINT.CHECKPOINT_3_FINISH,
|
|
52
|
+
]);
|
|
53
|
+
exports.tutorialKartSnapshotSchema = zod_1.z.object({
|
|
54
|
+
tutorialSessionId: zod_1.z.string().min(1),
|
|
55
|
+
deviceId: zod_1.z.string().min(1),
|
|
56
|
+
playerId: zod_1.z.string().min(1).optional(),
|
|
57
|
+
status: exports.tutorialStatusSchema,
|
|
58
|
+
currentPhaseId: exports.tutorialPhaseIdSchema,
|
|
59
|
+
currentStep: exports.tutorialScreenStepSchema,
|
|
60
|
+
revision: zod_1.z.number().int().nonnegative(),
|
|
61
|
+
presentationRevision: zod_1.z.number().int().nonnegative(),
|
|
62
|
+
hud: ScreenTutorial_schema_1.screenTutorialHudSchema.optional(),
|
|
63
|
+
awaitingCheckpoint: exports.tutorialLogicalCheckpointSchema.nullable().optional(),
|
|
64
|
+
completedCheckpoints: zod_1.z.array(exports.tutorialLogicalCheckpointSchema).optional(),
|
|
65
|
+
updatedAtISO: zod_1.z.string().datetime(),
|
|
66
|
+
});
|
|
67
|
+
exports.tutorialInputSignalTypeSchema = zod_1.z.enum([Tutorial_const_1.TUTORIAL_INPUT_SIGNAL_TYPE.STEERING_WHEEL_BUTTON_PRESSED]);
|
|
68
|
+
exports.tutorialKartEventBaseSchema = zod_1.z.object({
|
|
69
|
+
tutorialSessionId: zod_1.z.string().min(1),
|
|
70
|
+
deviceId: zod_1.z.string().min(1),
|
|
71
|
+
revision: zod_1.z.number().int().nonnegative(),
|
|
72
|
+
sequence: zod_1.z.number().int().nonnegative(),
|
|
73
|
+
originTimestampISO: zod_1.z.string().datetime(),
|
|
74
|
+
});
|
|
75
|
+
exports.tutorialSteeringWheelButtonPressedSchema = exports.tutorialKartEventBaseSchema.extend({
|
|
76
|
+
type: zod_1.z.literal(Tutorial_const_1.TUTORIAL_INPUT_SIGNAL_TYPE.STEERING_WHEEL_BUTTON_PRESSED),
|
|
77
|
+
button: exports.tutorialSteeringWheelButtonSchema,
|
|
78
|
+
});
|
|
79
|
+
exports.tutorialInputSignalSchema = zod_1.z.discriminatedUnion('type', [exports.tutorialSteeringWheelButtonPressedSchema]);
|
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { tutorialScreenStepSchema } from './Tutorial.schema';
|
|
2
|
+
import { tutorialInputSignalSchema, tutorialInputSignalTypeSchema, tutorialKartSnapshotSchema, tutorialListenEventOnSchema, tutorialLogicalCheckpointSchema, tutorialPhaseIdSchema, tutorialScreenStepSchema, tutorialStatusSchema, tutorialSteeringWheelButtonPressedSchema, tutorialSteeringWheelButtonSchema } from './Tutorial.schema';
|
|
3
3
|
export type TutorialScreenStep = z.infer<typeof tutorialScreenStepSchema>;
|
|
4
|
+
export type TutorialStatus = z.infer<typeof tutorialStatusSchema>;
|
|
5
|
+
export type TutorialPhaseId = z.infer<typeof tutorialPhaseIdSchema>;
|
|
6
|
+
export type TutorialListenEventOn = z.infer<typeof tutorialListenEventOnSchema>;
|
|
7
|
+
export type TutorialSteeringWheelButton = z.infer<typeof tutorialSteeringWheelButtonSchema>;
|
|
8
|
+
export type TutorialLogicalCheckpoint = z.infer<typeof tutorialLogicalCheckpointSchema>;
|
|
9
|
+
export type TutorialKartSnapshot = z.infer<typeof tutorialKartSnapshotSchema>;
|
|
10
|
+
export type TutorialInputSignalType = z.infer<typeof tutorialInputSignalTypeSchema>;
|
|
11
|
+
export type TutorialSteeringWheelButtonPressed = z.infer<typeof tutorialSteeringWheelButtonPressedSchema>;
|
|
12
|
+
export type TutorialInputSignal = z.infer<typeof tutorialInputSignalSchema>;
|