@battle-racing/br-common-lib 6.2.0-rc.1 → 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/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/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/data/all-tutorial-steps.ts +388 -0
- package/src/data/index.ts +1 -1
- 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
|
@@ -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>;
|