@battle-racing/br-common-lib 3.4.0 → 3.8.0

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 (120) hide show
  1. package/REFACTOR_README.md +185 -0
  2. package/br-common-lib.code-workspace +19 -0
  3. package/dist/constants/hardware/damage.d.ts +1 -0
  4. package/dist/constants/hardware/damage.js +1 -0
  5. package/dist/constants/index.d.ts +2 -0
  6. package/dist/constants/index.js +2 -0
  7. package/dist/constants/payment-provider.d.ts +5 -0
  8. package/dist/constants/payment-provider.js +8 -0
  9. package/dist/constants/payment-status.d.ts +7 -0
  10. package/dist/constants/payment-status.js +10 -0
  11. package/dist/constants/user-role.d.ts +1 -0
  12. package/dist/constants/user-role.js +1 -0
  13. package/dist/data/all-damages.d.ts +2 -0
  14. package/dist/data/all-damages.js +54 -0
  15. package/dist/data/all-power-ups.d.ts +3 -0
  16. package/dist/data/all-power-ups.js +521 -0
  17. package/dist/data/index.d.ts +3 -1
  18. package/dist/data/index.js +3 -1
  19. package/dist/schemas/team.schema.d.ts +7 -0
  20. package/dist/schemas/team.schema.js +9 -0
  21. package/dist/types/damage/Damage.d.ts +1 -3
  22. package/dist/types/gameTrack/GameTrackKartConfig.d.ts +9 -0
  23. package/dist/types/gameTrack/index.d.ts +1 -0
  24. package/dist/types/gameTrack/index.js +1 -0
  25. package/dist/types/index.d.ts +3 -0
  26. package/dist/types/index.js +3 -0
  27. package/dist/types/pagination/Pagination.d.ts +3 -0
  28. package/dist/types/pagination/index.d.ts +2 -0
  29. package/dist/types/pagination/index.js +18 -0
  30. package/dist/types/pagination/pagination.schema.d.ts +14 -0
  31. package/dist/types/pagination/pagination.schema.js +16 -0
  32. package/dist/types/powerUp/PowerUp.d.ts +1 -1
  33. package/dist/types/powerUp/PowerUpName.d.ts +1 -1
  34. package/dist/types/racingTeam/RacingTeam.d.ts +6 -0
  35. package/dist/types/racingTeam/RacingTeam.schema.d.ts +44 -0
  36. package/dist/types/racingTeam/RacingTeam.schema.js +27 -0
  37. package/dist/types/racingTeam/RacingTeamMembership.d.ts +6 -0
  38. package/dist/types/racingTeam/RacingTeamMembership.schema.d.ts +31 -0
  39. package/dist/types/racingTeam/RacingTeamMembership.schema.js +27 -0
  40. package/dist/types/racingTeam/index.d.ts +4 -0
  41. package/dist/types/racingTeam/index.js +20 -0
  42. package/dist/types/socket/serverToClient/SocketKartServerToClientEventsParams.d.ts +3 -5
  43. package/dist/types/ticketing/GameTicket.d.ts +3 -0
  44. package/dist/types/ticketing/GameTicket.js +2 -0
  45. package/dist/types/ticketing/GameTurn.d.ts +4 -0
  46. package/dist/types/ticketing/GameTurn.js +2 -0
  47. package/dist/types/ticketing/GameTurn.schema.d.ts +92 -0
  48. package/dist/types/ticketing/GameTurn.schema.js +46 -0
  49. package/dist/types/ticketing/GameTurnTask.d.ts +3 -0
  50. package/dist/types/ticketing/GameTurnTask.js +2 -0
  51. package/dist/types/ticketing/GameTurnTask.schema.d.ts +34 -0
  52. package/dist/types/ticketing/GameTurnTask.schema.js +30 -0
  53. package/dist/types/ticketing/PaymentProvider.d.ts +34 -0
  54. package/dist/types/ticketing/PaymentProvider.js +2 -0
  55. package/dist/types/ticketing/PlayerTurn.d.ts +3 -0
  56. package/dist/types/ticketing/PlayerTurn.js +2 -0
  57. package/dist/types/ticketing/Purchase.d.ts +3 -0
  58. package/dist/types/ticketing/Purchase.js +2 -0
  59. package/dist/types/ticketing/index.d.ts +9 -0
  60. package/dist/types/ticketing/index.js +25 -0
  61. package/dist/types/ticketing/ticketing.schemas.d.ts +58 -0
  62. package/dist/types/ticketing/ticketing.schemas.js +41 -0
  63. package/dist/types/user/User.d.ts +4 -9
  64. package/dist/types/user/index.d.ts +3 -1
  65. package/dist/types/user/index.js +5 -1
  66. package/dist/types/user/user-type.schema.d.ts +9 -0
  67. package/dist/types/user/user-type.schema.js +12 -0
  68. package/dist/types/user/user.schema.d.ts +39 -0
  69. package/dist/types/user/user.schema.js +19 -0
  70. package/package.json +6 -2
  71. package/src/constants/hardware/damage.ts +1 -0
  72. package/src/constants/index.ts +2 -1
  73. package/src/constants/payment-provider.ts +5 -0
  74. package/src/constants/payment-status.ts +7 -0
  75. package/src/constants/user-role.ts +1 -0
  76. package/src/data/all-damages.ts +53 -0
  77. package/src/data/all-power-ups.ts +526 -0
  78. package/src/data/index.ts +4 -1
  79. package/src/schemas/team.schema.ts +9 -0
  80. package/src/types/damage/Damage.ts +2 -4
  81. package/src/types/gameTrack/GameTrackKartConfig.ts +10 -0
  82. package/src/types/gameTrack/index.ts +1 -0
  83. package/src/types/index.ts +3 -1
  84. package/src/types/pagination/Pagination.ts +4 -0
  85. package/src/types/pagination/index.ts +2 -0
  86. package/src/types/pagination/pagination.schema.ts +14 -0
  87. package/src/types/powerUp/PowerUp.ts +1 -1
  88. package/src/types/powerUp/PowerUpName.ts +2 -1
  89. package/src/types/racingTeam/RacingTeam.schema.ts +29 -0
  90. package/src/types/racingTeam/RacingTeam.ts +12 -0
  91. package/src/types/racingTeam/RacingTeamMembership.schema.ts +29 -0
  92. package/src/types/racingTeam/RacingTeamMembership.ts +12 -0
  93. package/src/types/racingTeam/index.ts +4 -0
  94. package/src/types/socket/serverToClient/SocketKartServerToClientEventsParams.ts +3 -4
  95. package/src/types/ticketing/GameTicket.ts +4 -0
  96. package/src/types/ticketing/GameTurn.schema.ts +49 -0
  97. package/src/types/ticketing/GameTurn.ts +6 -0
  98. package/src/types/ticketing/GameTurnTask.schema.ts +32 -0
  99. package/src/types/ticketing/GameTurnTask.ts +4 -0
  100. package/src/types/ticketing/PaymentProvider.ts +40 -0
  101. package/src/types/ticketing/Purchase.ts +4 -0
  102. package/src/types/ticketing/index.ts +9 -0
  103. package/src/types/ticketing/ticketing.schemas.ts +43 -0
  104. package/src/types/user/User.ts +4 -9
  105. package/src/types/user/index.ts +4 -1
  106. package/src/types/user/user-type.schema.ts +8 -0
  107. package/src/types/user/user.schema.ts +19 -0
  108. package/README.md +0 -3
  109. package/dist/types/hardware/screen/ScreenKartPosition.d.ts +0 -4
  110. package/dist/types/hardware/screen/ScreenRaceLaps.d.ts +0 -4
  111. package/dist/types/response/SuccesResponse.d.ts +0 -5
  112. package/dist/types/user/UserOrigin.d.ts +0 -1
  113. package/src/types/user/UserOrigin.ts +0 -1
  114. /package/dist/data/{RoleDefinitions.d.ts → role-definitions.d.ts} +0 -0
  115. /package/dist/data/{RoleDefinitions.js → role-definitions.js} +0 -0
  116. /package/dist/types/{hardware/screen/ScreenKartPosition.js → gameTrack/GameTrackKartConfig.js} +0 -0
  117. /package/dist/types/{hardware/screen/ScreenRaceLaps.js → pagination/Pagination.js} +0 -0
  118. /package/dist/types/{response/SuccesResponse.js → racingTeam/RacingTeam.js} +0 -0
  119. /package/dist/types/{user/UserOrigin.js → racingTeam/RacingTeamMembership.js} +0 -0
  120. /package/src/data/{RoleDefinitions.ts → role-definitions.ts} +0 -0
@@ -0,0 +1,521 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.defaultPowerUps = exports.allPowerUps = void 0;
4
+ const constants_1 = require("../constants");
5
+ exports.allPowerUps = [
6
+ {
7
+ id: 'battle-god',
8
+ name: 'Battle God',
9
+ imageName: 'power-up-battle-god.png',
10
+ description: 'Increase speed, slow down enemies near, enable shortcuts',
11
+ level: 5,
12
+ shield: {
13
+ duration: 5,
14
+ },
15
+ assignationCommands: [
16
+ {
17
+ module: 'flag',
18
+ action: 'showMediaTemporarily',
19
+ params: {
20
+ mediaSourceName: constants_1.FLAG_MEDIA_NAME.STATIC_HELMET,
21
+ screens: {
22
+ left: true,
23
+ right: true,
24
+ back: true,
25
+ front: true,
26
+ },
27
+ },
28
+ },
29
+ {
30
+ module: 'sound',
31
+ action: 'play',
32
+ params: {
33
+ soundName: 'power_up_selection.mp3',
34
+ },
35
+ },
36
+ {
37
+ module: 'rgb',
38
+ action: 'showEffect',
39
+ params: {
40
+ effect: 'Roulette Effect',
41
+ },
42
+ },
43
+ ],
44
+ activationCommands: [
45
+ {
46
+ module: 'speed',
47
+ action: 'change',
48
+ params: {
49
+ speed: '$kart.configuredSpeed * 2',
50
+ },
51
+ },
52
+ {
53
+ module: 'rgb',
54
+ action: 'showEffect',
55
+ params: {
56
+ effect: 'Star Effect',
57
+ },
58
+ },
59
+ {
60
+ module: 'sound',
61
+ action: 'play',
62
+ params: {
63
+ soundName: 'battle_god_activation.mp3',
64
+ durationMs: '$kart.powerUpTime * 1000',
65
+ },
66
+ },
67
+ {
68
+ module: 'leftStarBackLaser',
69
+ action: 'action',
70
+ params: {
71
+ laserAction: 'Init Attack',
72
+ starAction: 'Init Attack',
73
+ },
74
+ },
75
+ {
76
+ module: 'rightStarFrontLaser',
77
+ action: 'action',
78
+ params: {
79
+ laserAction: 'Init Attack',
80
+ starAction: 'Init Attack',
81
+ },
82
+ },
83
+ {
84
+ module: 'flag',
85
+ action: 'showMediaTemporarily',
86
+ params: {
87
+ mediaSourceName: constants_1.FLAG_MEDIA_NAME.BR_CHANGE_COLOR,
88
+ screens: {
89
+ left: true,
90
+ right: true,
91
+ front: true,
92
+ back: true,
93
+ },
94
+ },
95
+ },
96
+ ],
97
+ },
98
+ {
99
+ id: 'battle-nitro',
100
+ name: 'Battle Nitro',
101
+ imageName: 'power-up-battle-nitro.png',
102
+ description: 'Double the speed of the user for 2 seconds.',
103
+ level: 1,
104
+ assignationCommands: [
105
+ {
106
+ module: 'flag',
107
+ action: 'showMediaTemporarily',
108
+ params: {
109
+ mediaSourceName: constants_1.FLAG_MEDIA_NAME.STATIC_EXHAUST,
110
+ screens: {
111
+ left: true,
112
+ right: true,
113
+ back: true,
114
+ front: true,
115
+ },
116
+ },
117
+ },
118
+ {
119
+ module: 'sound',
120
+ action: 'play',
121
+ params: {
122
+ soundName: 'power_up_selection.mp3',
123
+ },
124
+ },
125
+ {
126
+ module: 'rgb',
127
+ action: 'showEffect',
128
+ params: {
129
+ effect: 'Roulette Effect',
130
+ },
131
+ },
132
+ ],
133
+ activationCommands: [
134
+ {
135
+ module: 'speed',
136
+ action: 'change',
137
+ params: {
138
+ speed: '$kart.configuredSpeed * 2',
139
+ },
140
+ },
141
+ {
142
+ module: 'rgb',
143
+ action: 'showEffect',
144
+ params: {
145
+ effect: 'Speed Boost Effect',
146
+ },
147
+ },
148
+ {
149
+ module: 'sound',
150
+ action: 'play',
151
+ params: {
152
+ soundName: 'battle_turbo_activation.mp3',
153
+ durationMs: '$kart.powerUpTime * 1000',
154
+ },
155
+ },
156
+ {
157
+ module: 'flag',
158
+ action: 'showMediaTemporarily',
159
+ params: {
160
+ mediaSourceName: constants_1.FLAG_MEDIA_NAME.NITRO_BOTTLE,
161
+ screens: {
162
+ left: true,
163
+ right: true,
164
+ front: true,
165
+ back: true,
166
+ },
167
+ },
168
+ },
169
+ ],
170
+ },
171
+ {
172
+ id: 'battle-pulse',
173
+ name: 'Battle Pulse',
174
+ imageName: 'power-up-battle-pulse.png',
175
+ description: 'Slow down all the enemies for 2 seconds.',
176
+ level: 5,
177
+ networkDamage: {
178
+ name: 'Pulse Hit',
179
+ target: 'All',
180
+ },
181
+ assignationCommands: [
182
+ {
183
+ module: 'flag',
184
+ action: 'showMediaTemporarily',
185
+ params: {
186
+ mediaSourceName: constants_1.FLAG_MEDIA_NAME.STATIC_LIGHTNING,
187
+ screens: {
188
+ left: true,
189
+ right: true,
190
+ back: true,
191
+ front: true,
192
+ },
193
+ },
194
+ },
195
+ {
196
+ module: 'sound',
197
+ action: 'play',
198
+ params: {
199
+ soundName: 'power_up_selection.mp3',
200
+ },
201
+ },
202
+ {
203
+ module: 'rgb',
204
+ action: 'showEffect',
205
+ params: {
206
+ effect: 'Roulette Effect',
207
+ },
208
+ },
209
+ ],
210
+ activationCommands: [
211
+ {
212
+ module: 'rgb',
213
+ action: 'showEffect',
214
+ params: {
215
+ effect: 'Ray Effect',
216
+ },
217
+ },
218
+ {
219
+ module: 'sound',
220
+ action: 'play',
221
+ params: {
222
+ soundName: 'battle_pulse_activation.mp3',
223
+ durationMs: '$kart.powerUpTime * 1000',
224
+ },
225
+ },
226
+ {
227
+ module: 'flag',
228
+ action: 'showMediaTemporarily',
229
+ params: {
230
+ mediaSourceName: constants_1.FLAG_MEDIA_NAME.THUNDER_EXPLOSION,
231
+ screens: {
232
+ left: true,
233
+ right: true,
234
+ front: true,
235
+ back: true,
236
+ },
237
+ },
238
+ },
239
+ ],
240
+ },
241
+ {
242
+ id: 'battle-shield',
243
+ name: 'Battle Shield',
244
+ imageName: 'power-up-battle-shield.png',
245
+ description: 'A shield that blocks all the damage.',
246
+ level: 4,
247
+ shield: {
248
+ duration: 5,
249
+ },
250
+ assignationCommands: [
251
+ {
252
+ module: 'flag',
253
+ action: 'showMediaTemporarily',
254
+ params: {
255
+ mediaSourceName: constants_1.FLAG_MEDIA_NAME.STATIC_SHIELD,
256
+ screens: {
257
+ left: true,
258
+ right: true,
259
+ back: true,
260
+ front: true,
261
+ },
262
+ },
263
+ },
264
+ {
265
+ module: 'sound',
266
+ action: 'play',
267
+ params: {
268
+ soundName: 'power_up_selection.mp3',
269
+ },
270
+ },
271
+ {
272
+ module: 'rgb',
273
+ action: 'showEffect',
274
+ params: {
275
+ effect: 'Roulette Effect',
276
+ },
277
+ },
278
+ ],
279
+ activationCommands: [
280
+ {
281
+ module: 'rgb',
282
+ action: 'showEffect',
283
+ params: {
284
+ effect: 'Shield Effect',
285
+ },
286
+ },
287
+ {
288
+ module: 'sound',
289
+ action: 'play',
290
+ params: {
291
+ soundName: 'battle_shield_activation.mp3',
292
+ durationMs: '$kart.powerUpTime * 1000',
293
+ },
294
+ },
295
+ {
296
+ module: 'flag',
297
+ action: 'showMediaTemporarily',
298
+ params: {
299
+ mediaSourceName: constants_1.FLAG_MEDIA_NAME.SHIELD_BLUE_TO_PINK,
300
+ screens: {
301
+ left: true,
302
+ right: true,
303
+ front: true,
304
+ back: true,
305
+ },
306
+ },
307
+ },
308
+ ],
309
+ },
310
+ {
311
+ id: 'battle-shot',
312
+ name: 'Battle Shot',
313
+ imageName: 'power-up-battle-shot.png',
314
+ description: 'Slow Down Specifc Enemy for 2 seconds.',
315
+ level: 3,
316
+ assignationCommands: [
317
+ {
318
+ module: 'flag',
319
+ action: 'showMediaTemporarily',
320
+ params: {
321
+ mediaSourceName: constants_1.FLAG_MEDIA_NAME.STATIC_FIREBALL,
322
+ screens: {
323
+ left: true,
324
+ right: true,
325
+ back: true,
326
+ front: true,
327
+ },
328
+ },
329
+ },
330
+ {
331
+ module: 'sound',
332
+ action: 'play',
333
+ params: {
334
+ soundName: 'power_up_selection.mp3',
335
+ },
336
+ },
337
+ {
338
+ module: 'rgb',
339
+ action: 'showEffect',
340
+ params: {
341
+ effect: 'Roulette Effect',
342
+ },
343
+ },
344
+ {
345
+ module: 'diskSensorBallShooter',
346
+ action: 'prepareShooter',
347
+ },
348
+ ],
349
+ activationCommands: [
350
+ {
351
+ module: 'rgb',
352
+ action: 'showEffect',
353
+ params: {
354
+ effect: 'Ball Shot Effect',
355
+ },
356
+ },
357
+ {
358
+ module: 'diskSensorBallShooter',
359
+ action: 'shootBall',
360
+ },
361
+ {
362
+ module: 'sound',
363
+ action: 'play',
364
+ params: {
365
+ soundName: 'battle_shot_activation.mp3',
366
+ durationMs: '$kart.powerUpTime * 1000',
367
+ },
368
+ },
369
+ {
370
+ module: 'flag',
371
+ action: 'showMediaTemporarily',
372
+ params: {
373
+ mediaSourceName: constants_1.FLAG_MEDIA_NAME.FIREBALL,
374
+ screens: {
375
+ left: true,
376
+ right: true,
377
+ front: true,
378
+ back: true,
379
+ },
380
+ },
381
+ },
382
+ ],
383
+ },
384
+ {
385
+ id: 'battle-trap',
386
+ name: 'Battle Trap',
387
+ imageName: 'power-up-battle-trap.png',
388
+ description: 'Slow Down Specifc Enemy for 3 seconds.',
389
+ level: 2,
390
+ assignationCommands: [
391
+ {
392
+ module: 'flag',
393
+ action: 'showMediaTemporarily',
394
+ params: {
395
+ mediaSourceName: constants_1.FLAG_MEDIA_NAME.STATIC_OIL_DROP,
396
+ screens: {
397
+ left: true,
398
+ right: true,
399
+ back: true,
400
+ front: true,
401
+ },
402
+ },
403
+ },
404
+ {
405
+ module: 'sound',
406
+ action: 'play',
407
+ params: {
408
+ soundName: 'power_up_selection.mp3',
409
+ },
410
+ },
411
+ {
412
+ module: 'rgb',
413
+ action: 'showEffect',
414
+ params: {
415
+ effect: 'Roulette Effect',
416
+ },
417
+ },
418
+ ],
419
+ activationCommands: [
420
+ {
421
+ module: 'ballSensorDiskThrower',
422
+ action: 'throwDisk',
423
+ },
424
+ {
425
+ module: 'sound',
426
+ action: 'play',
427
+ params: {
428
+ soundName: 'battle_trap_activation.mp3',
429
+ durationMs: '$kart.powerUpTime * 1000',
430
+ },
431
+ },
432
+ {
433
+ module: 'flag',
434
+ action: 'showMediaTemporarily',
435
+ params: {
436
+ mediaSourceName: constants_1.FLAG_MEDIA_NAME.OIL_DROP_COLORS,
437
+ screens: {
438
+ left: true,
439
+ right: true,
440
+ front: true,
441
+ back: true,
442
+ },
443
+ },
444
+ },
445
+ ],
446
+ },
447
+ // TODO: Change The media names
448
+ {
449
+ id: 'battle-blue-shot',
450
+ name: 'Battle Blue Shot',
451
+ imageName: 'power-up-battle-blue-shot.png',
452
+ description: 'Deal shot hit damage to the first player in the race.',
453
+ level: 4,
454
+ networkDamage: {
455
+ name: 'Blue Shot Hit',
456
+ target: 'First',
457
+ },
458
+ assignationCommands: [
459
+ {
460
+ module: 'flag',
461
+ action: 'showMediaTemporarily',
462
+ params: {
463
+ mediaSourceName: constants_1.FLAG_MEDIA_NAME.STATIC_FIREBALL,
464
+ screens: {
465
+ left: true,
466
+ right: true,
467
+ back: true,
468
+ front: true,
469
+ },
470
+ },
471
+ },
472
+ {
473
+ module: 'sound',
474
+ action: 'play',
475
+ params: {
476
+ soundName: 'power_up_selection.mp3',
477
+ },
478
+ },
479
+ {
480
+ module: 'rgb',
481
+ action: 'showEffect',
482
+ params: {
483
+ effect: 'Roulette Effect',
484
+ },
485
+ },
486
+ ],
487
+ activationCommands: [
488
+ {
489
+ module: 'rgb',
490
+ action: 'showEffect',
491
+ params: {
492
+ effect: 'Ray Effect',
493
+ },
494
+ },
495
+ {
496
+ module: 'sound',
497
+ action: 'play',
498
+ params: {
499
+ // TODO: Change to blue shot activation
500
+ soundName: 'battle_shot_activation.mp3',
501
+ durationMs: '$kart.powerUpTime * 1000',
502
+ },
503
+ },
504
+ {
505
+ module: 'flag',
506
+ action: 'showMediaTemporarily',
507
+ params: {
508
+ // TODO: Change to blue shot
509
+ mediaSourceName: constants_1.FLAG_MEDIA_NAME.STATIC_FIREBALL,
510
+ screens: {
511
+ left: true,
512
+ right: true,
513
+ front: true,
514
+ back: true,
515
+ },
516
+ },
517
+ },
518
+ ],
519
+ },
520
+ ];
521
+ exports.defaultPowerUps = exports.allPowerUps.filter((powerUp) => ['battle-god', 'battle-pulse', 'battle-shield', 'battle-nitro', 'battle-blue-shot'].includes(powerUp.id));
@@ -1 +1,3 @@
1
- export * from './RoleDefinitions';
1
+ export * from './all-damages';
2
+ export * from './all-power-ups';
3
+ export * from './role-definitions';
@@ -14,4 +14,6 @@ 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("./RoleDefinitions"), exports);
17
+ __exportStar(require("./all-damages"), exports);
18
+ __exportStar(require("./all-power-ups"), exports);
19
+ __exportStar(require("./role-definitions"), exports);
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ export declare const TeamSchema: z.ZodObject<{
3
+ name: z.ZodString;
4
+ imageUrl: z.ZodOptional<z.ZodURL>;
5
+ fanatismo: z.ZodOptional<z.ZodNumber>;
6
+ }, z.core.$strip>;
7
+ export type Team = z.infer<typeof TeamSchema>;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TeamSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.TeamSchema = zod_1.z.object({
6
+ name: zod_1.z.string().min(3).max(50),
7
+ imageUrl: zod_1.z.url().optional(),
8
+ fanatismo: zod_1.z.number().int().min(0).max(100).optional(),
9
+ });
@@ -5,11 +5,9 @@ import type { DamageTarget } from './DamageTarget';
5
5
  export interface Damage {
6
6
  name: DamageEffectName;
7
7
  target: DamageTarget;
8
- /** Time in seconds */
9
- duration: number;
10
8
  sound: SoundName;
11
9
  rgbEffect: KartEffect;
12
- /** Quantity of damage will affect the Kart */
10
+ /** Mainly used for coins reduction */
13
11
  amount: number;
14
12
  flagMediaName: FlagMediaName;
15
13
  }
@@ -0,0 +1,9 @@
1
+ import type { Kart } from '../kart';
2
+ import type { GameTrack } from './GameTrack';
3
+ export interface GameTrackKartConfig {
4
+ gameTrackId: GameTrack['id'];
5
+ kartId: number;
6
+ color: Kart['color'];
7
+ kartNumber: Kart['number'];
8
+ mac: string;
9
+ }
@@ -1,3 +1,4 @@
1
1
  export * from './GameTrack';
2
2
  export * from './GameTrackGameDefaultValues';
3
+ export * from './GameTrackKartConfig';
3
4
  export * from './GameTrackKartsConfig';
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./GameTrack"), exports);
18
18
  __exportStar(require("./GameTrackGameDefaultValues"), exports);
19
+ __exportStar(require("./GameTrackKartConfig"), exports);
19
20
  __exportStar(require("./GameTrackKartsConfig"), exports);
@@ -12,10 +12,13 @@ export * from './gameTrack';
12
12
  export * from './hardware';
13
13
  export * from './kart';
14
14
  export * from './kartTracking';
15
+ export * from './pagination';
15
16
  export * from './powerUp';
17
+ export * from './racingTeam';
16
18
  export * from './response';
17
19
  export * from './role';
18
20
  export * from './socket';
19
21
  export * from './sounds';
22
+ export * from './ticketing';
20
23
  export * from './user';
21
24
  export * from './utils';
@@ -28,10 +28,13 @@ __exportStar(require("./gameTrack"), exports);
28
28
  __exportStar(require("./hardware"), exports);
29
29
  __exportStar(require("./kart"), exports);
30
30
  __exportStar(require("./kartTracking"), exports);
31
+ __exportStar(require("./pagination"), exports);
31
32
  __exportStar(require("./powerUp"), exports);
33
+ __exportStar(require("./racingTeam"), exports);
32
34
  __exportStar(require("./response"), exports);
33
35
  __exportStar(require("./role"), exports);
34
36
  __exportStar(require("./socket"), exports);
35
37
  __exportStar(require("./sounds"), exports);
38
+ __exportStar(require("./ticketing"), exports);
36
39
  __exportStar(require("./user"), exports);
37
40
  __exportStar(require("./utils"), exports);
@@ -0,0 +1,3 @@
1
+ import z from 'zod';
2
+ import { paginationMetadataSchema } from './pagination.schema';
3
+ export type Pagination = z.infer<typeof paginationMetadataSchema>;
@@ -0,0 +1,2 @@
1
+ export * from './Pagination';
2
+ export * from './pagination.schema';
@@ -0,0 +1,18 @@
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("./Pagination"), exports);
18
+ __exportStar(require("./pagination.schema"), exports);
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ export declare const paginationMetadataSchema: z.ZodObject<{
3
+ nextCursor: z.ZodOptional<z.ZodString>;
4
+ hasMore: z.ZodOptional<z.ZodBoolean>;
5
+ limit: z.ZodNumber;
6
+ }, z.core.$strip>;
7
+ export declare const paginatedResponseSchema: <T extends z.ZodTypeAny>(itemSchema: T) => z.ZodObject<{
8
+ data: z.ZodArray<T>;
9
+ meta: z.ZodObject<{
10
+ nextCursor: z.ZodOptional<z.ZodString>;
11
+ hasMore: z.ZodOptional<z.ZodBoolean>;
12
+ limit: z.ZodNumber;
13
+ }, z.core.$strip>;
14
+ }, z.core.$strip>;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.paginatedResponseSchema = exports.paginationMetadataSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.paginationMetadataSchema = zod_1.z.object({
6
+ nextCursor: zod_1.z.string().optional(),
7
+ hasMore: zod_1.z.boolean().optional(),
8
+ limit: zod_1.z.number(),
9
+ });
10
+ const paginatedResponseSchema = (itemSchema) => {
11
+ return zod_1.z.object({
12
+ data: zod_1.z.array(itemSchema),
13
+ meta: exports.paginationMetadataSchema,
14
+ });
15
+ };
16
+ exports.paginatedResponseSchema = paginatedResponseSchema;
@@ -23,5 +23,5 @@ export interface PowerUp {
23
23
  * Represents damage that needs the backend to be propagated
24
24
  * to other(s) kart(s)
25
25
  */
26
- networkDamage?: Damage;
26
+ networkDamage?: Pick<Damage, 'name' | 'target'>;
27
27
  }