@battle-racing/br-common-lib 4.8.0 → 4.8.1

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.
@@ -80,3 +80,8 @@ export declare const resumeGameSchema: z.ZodObject<{
80
80
  readonly RED_FLAG: "red-flag";
81
81
  }>;
82
82
  }, z.core.$strip>;
83
+ /** Whenever I need to change a failing Kart in the middle of a Game */
84
+ export declare const swapKartSchema: z.ZodObject<{
85
+ oldKartGuid: z.ZodString;
86
+ newKartGuid: z.ZodString;
87
+ }, z.core.$strip>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resumeGameSchema = exports.assignKartSchema = exports.gameSchema = exports.kartRankingItemSchema = exports.gameKartStateSchema = exports.gameWarningEventSchema = exports.gameFinishedReasonSchema = exports.gameStatusSchema = exports.gameTypeSchema = void 0;
3
+ exports.swapKartSchema = exports.resumeGameSchema = exports.assignKartSchema = exports.gameSchema = exports.kartRankingItemSchema = exports.gameKartStateSchema = exports.gameWarningEventSchema = exports.gameFinishedReasonSchema = exports.gameStatusSchema = exports.gameTypeSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const Game_const_1 = require("./Game.const");
6
6
  exports.gameTypeSchema = zod_1.z.enum(Game_const_1.GAME_TYPE);
@@ -42,3 +42,8 @@ exports.assignKartSchema = zod_1.z.object({
42
42
  exports.resumeGameSchema = zod_1.z.object({
43
43
  fromEvent: exports.gameWarningEventSchema,
44
44
  });
45
+ /** Whenever I need to change a failing Kart in the middle of a Game */
46
+ exports.swapKartSchema = zod_1.z.object({
47
+ oldKartGuid: zod_1.z.string(),
48
+ newKartGuid: zod_1.z.string(),
49
+ });
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { assignKartSchema, gameFinishedReasonSchema, gameKartStateSchema, gameSchema, gameStatusSchema, gameTypeSchema, gameWarningEventSchema, kartRankingItemSchema, resumeGameSchema } from './Game.schema';
2
+ import { assignKartSchema, gameFinishedReasonSchema, gameKartStateSchema, gameSchema, gameStatusSchema, gameTypeSchema, gameWarningEventSchema, kartRankingItemSchema, resumeGameSchema, swapKartSchema } from './Game.schema';
3
3
  export type GameType = z.infer<typeof gameTypeSchema>;
4
4
  export type GameStatus = z.infer<typeof gameStatusSchema>;
5
5
  export type GameFinishedReason = z.infer<typeof gameFinishedReasonSchema>;
@@ -9,3 +9,4 @@ export type KartRankingItem = z.infer<typeof kartRankingItemSchema>;
9
9
  export type Game = z.infer<typeof gameSchema>;
10
10
  export type AssignKart = z.infer<typeof assignKartSchema>;
11
11
  export type ResumeGame = z.infer<typeof resumeGameSchema>;
12
+ export type SwapKart = z.infer<typeof swapKartSchema>;
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ export declare const swapKartSchema: z.ZodObject<{
3
+ playerId: z.ZodString;
4
+ oldKartGuid: z.ZodString;
5
+ newKartGuid: z.ZodString;
6
+ }, z.core.$strip>;
7
+ export type SwapKartDto = z.infer<typeof swapKartSchema>;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.swapKartSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.swapKartSchema = zod_1.z.object({
6
+ playerId: zod_1.z.string(),
7
+ oldKartGuid: zod_1.z.string(),
8
+ newKartGuid: zod_1.z.string(),
9
+ });
@@ -5,6 +5,7 @@ export declare const KART_STATUS: {
5
5
  readonly EMERGENCY: "emergency";
6
6
  readonly PITS: "pits";
7
7
  readonly ELIMINATED: "eliminated";
8
+ readonly OUT_OF_SERVICE: "out-of-service";
8
9
  };
9
10
  export declare const KART_FINAL_STATE: {
10
11
  readonly VICTORY: "Victory";
@@ -8,6 +8,7 @@ exports.KART_STATUS = {
8
8
  EMERGENCY: 'emergency',
9
9
  PITS: 'pits',
10
10
  ELIMINATED: 'eliminated',
11
+ OUT_OF_SERVICE: 'out-of-service',
11
12
  };
12
13
  exports.KART_FINAL_STATE = {
13
14
  VICTORY: 'Victory',
@@ -6,6 +6,7 @@ export declare const kartStatusSchema: z.ZodEnum<{
6
6
  readonly EMERGENCY: "emergency";
7
7
  readonly PITS: "pits";
8
8
  readonly ELIMINATED: "eliminated";
9
+ readonly OUT_OF_SERVICE: "out-of-service";
9
10
  }>;
10
11
  export declare const kartShieldSchema: z.ZodObject<{
11
12
  isActive: z.ZodBoolean;
@@ -31,6 +32,7 @@ export declare const kartSchema: z.ZodObject<{
31
32
  readonly EMERGENCY: "emergency";
32
33
  readonly PITS: "pits";
33
34
  readonly ELIMINATED: "eliminated";
35
+ readonly OUT_OF_SERVICE: "out-of-service";
34
36
  }>;
35
37
  shield: z.ZodObject<{
36
38
  isActive: z.ZodBoolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@battle-racing/br-common-lib",
3
- "version": "4.8.0",
3
+ "version": "4.8.1",
4
4
  "description": "Common library for all Battle Racing Repositorios",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -48,3 +48,9 @@ export const assignKartSchema = z.object({
48
48
  export const resumeGameSchema = z.object({
49
49
  fromEvent: gameWarningEventSchema,
50
50
  });
51
+
52
+ /** Whenever I need to change a failing Kart in the middle of a Game */
53
+ export const swapKartSchema = z.object({
54
+ oldKartGuid: z.string(),
55
+ newKartGuid: z.string(),
56
+ });
@@ -9,6 +9,7 @@ import {
9
9
  gameWarningEventSchema,
10
10
  kartRankingItemSchema,
11
11
  resumeGameSchema,
12
+ swapKartSchema,
12
13
  } from './Game.schema';
13
14
 
14
15
  export type GameType = z.infer<typeof gameTypeSchema>;
@@ -20,3 +21,4 @@ export type KartRankingItem = z.infer<typeof kartRankingItemSchema>;
20
21
  export type Game = z.infer<typeof gameSchema>;
21
22
  export type AssignKart = z.infer<typeof assignKartSchema>;
22
23
  export type ResumeGame = z.infer<typeof resumeGameSchema>;
24
+ export type SwapKart = z.infer<typeof swapKartSchema>;
@@ -5,6 +5,7 @@ export const KART_STATUS = {
5
5
  EMERGENCY: 'emergency',
6
6
  PITS: 'pits',
7
7
  ELIMINATED: 'eliminated',
8
+ OUT_OF_SERVICE: 'out-of-service',
8
9
  } as const;
9
10
 
10
11
  export const KART_FINAL_STATE = {