@battle-racing/br-common-lib 6.0.0 → 6.1.0-rc.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.
@@ -52,10 +52,11 @@ export declare const kartHardwareStateSchema: z.ZodObject<{
52
52
  steeringWheel: z.ZodNullable<z.ZodObject<{
53
53
  ledStatus: z.ZodEnum<{
54
54
  readonly OFF: "Off";
55
- readonly IDLE: "Idle";
56
- readonly POWER_UP: "Power-Up";
57
- readonly EMERGENCY: "Emergency";
55
+ readonly COLOR: "Color";
56
+ readonly EFFECT: "Effect";
58
57
  readonly CONFIG: "Config";
58
+ readonly ERROR: "Error";
59
+ readonly UNKNOWN: "Unknown";
59
60
  }>;
60
61
  buttons: z.ZodObject<{
61
62
  powerRightPressed: z.ZodBoolean;
@@ -109,10 +109,11 @@ export declare const moduleStatusSchema: z.ZodUnion<readonly [z.ZodObject<{
109
109
  }, z.core.$strip>, z.ZodObject<{
110
110
  ledStatus: z.ZodEnum<{
111
111
  readonly OFF: "Off";
112
- readonly IDLE: "Idle";
113
- readonly POWER_UP: "Power-Up";
114
- readonly EMERGENCY: "Emergency";
112
+ readonly COLOR: "Color";
113
+ readonly EFFECT: "Effect";
115
114
  readonly CONFIG: "Config";
115
+ readonly ERROR: "Error";
116
+ readonly UNKNOWN: "Unknown";
116
117
  }>;
117
118
  buttons: z.ZodObject<{
118
119
  powerRightPressed: z.ZodBoolean;
@@ -52,10 +52,11 @@ export declare const screenDebugViewInputSchema: z.ZodObject<{
52
52
  steeringWheel: z.ZodNullable<z.ZodObject<{
53
53
  ledStatus: z.ZodEnum<{
54
54
  readonly OFF: "Off";
55
- readonly IDLE: "Idle";
56
- readonly POWER_UP: "Power-Up";
57
- readonly EMERGENCY: "Emergency";
55
+ readonly COLOR: "Color";
56
+ readonly EFFECT: "Effect";
58
57
  readonly CONFIG: "Config";
58
+ readonly ERROR: "Error";
59
+ readonly UNKNOWN: "Unknown";
59
60
  }>;
60
61
  buttons: z.ZodObject<{
61
62
  powerRightPressed: z.ZodBoolean;
@@ -6,15 +6,26 @@ export declare const STEERING_WHEEL_ACTION_COMMAND: {
6
6
  readonly CONFIGURE_LEDS: "ConfigureLeds";
7
7
  };
8
8
  export declare const STEERING_WHEEL_SHOW_LED_EFFECT_OPTIONS: {
9
- readonly SHOW_LED_IDLE_EFFECT: "ShowLedIdleEffect";
10
- readonly SHOW_LED_POWERUP_EFFECT: "ShowLedPowerupEffect";
11
- readonly SHOW_LED_EMERGENCY_EFFECT: "ShowLedEmergencyEffect";
12
- readonly SHOW_LED_CONFIG_EFFECT: "ShowLedConfigEffect";
9
+ readonly SHOW_COLOR: "ShowColor";
10
+ readonly STAR: "Star";
11
+ readonly RAY: "Ray";
12
+ readonly RAY_HIT: "RayHit";
13
+ readonly SPEED_BOOST: "SpeedBoost";
14
+ readonly CHARGED_POWER: "ChargedPower";
15
+ readonly ROULETTE: "Roulette";
16
+ readonly SHIELD: "Shield";
17
+ readonly BROKEN_SHIELD: "BrokenShield";
18
+ readonly WAIT: "Wait";
19
+ readonly STANDARD: "Standard";
20
+ readonly POWER_UP: "PowerUp";
21
+ readonly EMERGENCY: "Emergency";
22
+ readonly TRAFFIC_LIGHT: "TrafficLight";
13
23
  };
14
24
  export declare const STEERING_WHEEL_LED_STATUS: {
15
25
  readonly OFF: "Off";
16
- readonly IDLE: "Idle";
17
- readonly POWER_UP: "Power-Up";
18
- readonly EMERGENCY: "Emergency";
26
+ readonly COLOR: "Color";
27
+ readonly EFFECT: "Effect";
19
28
  readonly CONFIG: "Config";
29
+ readonly ERROR: "Error";
30
+ readonly UNKNOWN: "Unknown";
20
31
  };
@@ -9,15 +9,26 @@ exports.STEERING_WHEEL_ACTION_COMMAND = {
9
9
  CONFIGURE_LEDS: 'ConfigureLeds',
10
10
  };
11
11
  exports.STEERING_WHEEL_SHOW_LED_EFFECT_OPTIONS = {
12
- SHOW_LED_IDLE_EFFECT: 'ShowLedIdleEffect',
13
- SHOW_LED_POWERUP_EFFECT: 'ShowLedPowerupEffect',
14
- SHOW_LED_EMERGENCY_EFFECT: 'ShowLedEmergencyEffect',
15
- SHOW_LED_CONFIG_EFFECT: 'ShowLedConfigEffect',
12
+ SHOW_COLOR: 'ShowColor',
13
+ STAR: 'Star',
14
+ RAY: 'Ray',
15
+ RAY_HIT: 'RayHit',
16
+ SPEED_BOOST: 'SpeedBoost',
17
+ CHARGED_POWER: 'ChargedPower',
18
+ ROULETTE: 'Roulette',
19
+ SHIELD: 'Shield',
20
+ BROKEN_SHIELD: 'BrokenShield',
21
+ WAIT: 'Wait',
22
+ STANDARD: 'Standard',
23
+ POWER_UP: 'PowerUp',
24
+ EMERGENCY: 'Emergency',
25
+ TRAFFIC_LIGHT: 'TrafficLight',
16
26
  };
17
27
  exports.STEERING_WHEEL_LED_STATUS = {
18
28
  OFF: 'Off',
19
- IDLE: 'Idle',
20
- POWER_UP: 'Power-Up',
21
- EMERGENCY: 'Emergency',
29
+ COLOR: 'Color',
30
+ EFFECT: 'Effect',
22
31
  CONFIG: 'Config',
32
+ ERROR: 'Error',
33
+ UNKNOWN: 'Unknown',
23
34
  };
@@ -7,18 +7,20 @@ export declare const steeringWheelActionCommandSchema: z.ZodEnum<{
7
7
  }>;
8
8
  export declare const steeringWheelLedStatusSchema: z.ZodEnum<{
9
9
  readonly OFF: "Off";
10
- readonly IDLE: "Idle";
11
- readonly POWER_UP: "Power-Up";
12
- readonly EMERGENCY: "Emergency";
10
+ readonly COLOR: "Color";
11
+ readonly EFFECT: "Effect";
13
12
  readonly CONFIG: "Config";
13
+ readonly ERROR: "Error";
14
+ readonly UNKNOWN: "Unknown";
14
15
  }>;
15
16
  export declare const steeringWheelModuleStatusSchema: z.ZodObject<{
16
17
  ledStatus: z.ZodEnum<{
17
18
  readonly OFF: "Off";
18
- readonly IDLE: "Idle";
19
- readonly POWER_UP: "Power-Up";
20
- readonly EMERGENCY: "Emergency";
19
+ readonly COLOR: "Color";
20
+ readonly EFFECT: "Effect";
21
21
  readonly CONFIG: "Config";
22
+ readonly ERROR: "Error";
23
+ readonly UNKNOWN: "Unknown";
22
24
  }>;
23
25
  buttons: z.ZodObject<{
24
26
  powerRightPressed: z.ZodBoolean;
@@ -30,12 +32,36 @@ export declare const steeringWheelModuleStatusSchema: z.ZodObject<{
30
32
  }, z.core.$strip>;
31
33
  }, z.core.$strip>;
32
34
  export declare const steeringWheelShowLedsEffectOptionsSchema: z.ZodEnum<{
33
- readonly SHOW_LED_IDLE_EFFECT: "ShowLedIdleEffect";
34
- readonly SHOW_LED_POWERUP_EFFECT: "ShowLedPowerupEffect";
35
- readonly SHOW_LED_EMERGENCY_EFFECT: "ShowLedEmergencyEffect";
36
- readonly SHOW_LED_CONFIG_EFFECT: "ShowLedConfigEffect";
35
+ readonly SHOW_COLOR: "ShowColor";
36
+ readonly STAR: "Star";
37
+ readonly RAY: "Ray";
38
+ readonly RAY_HIT: "RayHit";
39
+ readonly SPEED_BOOST: "SpeedBoost";
40
+ readonly CHARGED_POWER: "ChargedPower";
41
+ readonly ROULETTE: "Roulette";
42
+ readonly SHIELD: "Shield";
43
+ readonly BROKEN_SHIELD: "BrokenShield";
44
+ readonly WAIT: "Wait";
45
+ readonly STANDARD: "Standard";
46
+ readonly POWER_UP: "PowerUp";
47
+ readonly EMERGENCY: "Emergency";
48
+ readonly TRAFFIC_LIGHT: "TrafficLight";
37
49
  }>;
38
50
  export declare const steeringWheelConfigureLedsOptionsSchema: z.ZodObject<{
39
51
  brightness: z.ZodNumber;
40
52
  durationSeconds: z.ZodNumber;
53
+ colorBody: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
54
+ readonly Black: "Black";
55
+ readonly Red: "Red";
56
+ readonly Blue: "Blue";
57
+ readonly Green: "Green";
58
+ readonly Yellow: "Yellow";
59
+ readonly Violet: "Violet";
60
+ readonly Cyan: "Cyan";
61
+ readonly Magenta: "Magenta";
62
+ readonly Orange: "Orange";
63
+ readonly White: "White";
64
+ readonly GreenYellow: "GreenYellow";
65
+ readonly SaddleBrown: "SaddleBrown";
66
+ }>>>;
41
67
  }, z.core.$strip>;
@@ -2,6 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.steeringWheelConfigureLedsOptionsSchema = exports.steeringWheelShowLedsEffectOptionsSchema = exports.steeringWheelModuleStatusSchema = exports.steeringWheelLedStatusSchema = exports.steeringWheelActionCommandSchema = void 0;
4
4
  const zod_1 = require("zod");
5
+ const Color_schema_1 = require("../../color/Color.schema");
6
+ const Color_const_1 = require("../../color/Color.const");
5
7
  const SteeringWheel_const_1 = require("./SteeringWheel.const");
6
8
  exports.steeringWheelActionCommandSchema = zod_1.z.enum(SteeringWheel_const_1.STEERING_WHEEL_ACTION_COMMAND);
7
9
  exports.steeringWheelLedStatusSchema = zod_1.z.enum(SteeringWheel_const_1.STEERING_WHEEL_LED_STATUS);
@@ -20,4 +22,5 @@ exports.steeringWheelShowLedsEffectOptionsSchema = zod_1.z.enum(SteeringWheel_co
20
22
  exports.steeringWheelConfigureLedsOptionsSchema = zod_1.z.object({
21
23
  brightness: zod_1.z.number().min(0).max(100),
22
24
  durationSeconds: zod_1.z.number().min(1).max(25),
25
+ colorBody: Color_schema_1.colorNameSchema.optional().default(Color_const_1.COLOR_NAME.Red),
23
26
  });
@@ -116,10 +116,11 @@ export declare const kartSchema: z.ZodObject<{
116
116
  steeringWheel: z.ZodNullable<z.ZodObject<{
117
117
  ledStatus: z.ZodEnum<{
118
118
  readonly OFF: "Off";
119
- readonly IDLE: "Idle";
120
- readonly POWER_UP: "Power-Up";
121
- readonly EMERGENCY: "Emergency";
119
+ readonly COLOR: "Color";
120
+ readonly EFFECT: "Effect";
122
121
  readonly CONFIG: "Config";
122
+ readonly ERROR: "Error";
123
+ readonly UNKNOWN: "Unknown";
123
124
  }>;
124
125
  buttons: z.ZodObject<{
125
126
  powerRightPressed: z.ZodBoolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@battle-racing/br-common-lib",
3
- "version": "6.0.0",
3
+ "version": "6.1.0-rc.0",
4
4
  "description": "Common library for all Battle Racing Repositorios",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -7,16 +7,27 @@ export const STEERING_WHEEL_ACTION_COMMAND = {
7
7
  } as const;
8
8
 
9
9
  export const STEERING_WHEEL_SHOW_LED_EFFECT_OPTIONS = {
10
- SHOW_LED_IDLE_EFFECT: 'ShowLedIdleEffect',
11
- SHOW_LED_POWERUP_EFFECT: 'ShowLedPowerupEffect',
12
- SHOW_LED_EMERGENCY_EFFECT: 'ShowLedEmergencyEffect',
13
- SHOW_LED_CONFIG_EFFECT: 'ShowLedConfigEffect',
10
+ SHOW_COLOR: 'ShowColor',
11
+ STAR: 'Star',
12
+ RAY: 'Ray',
13
+ RAY_HIT: 'RayHit',
14
+ SPEED_BOOST: 'SpeedBoost',
15
+ CHARGED_POWER: 'ChargedPower',
16
+ ROULETTE: 'Roulette',
17
+ SHIELD: 'Shield',
18
+ BROKEN_SHIELD: 'BrokenShield',
19
+ WAIT: 'Wait',
20
+ STANDARD: 'Standard',
21
+ POWER_UP: 'PowerUp',
22
+ EMERGENCY: 'Emergency',
23
+ TRAFFIC_LIGHT: 'TrafficLight',
14
24
  } as const;
15
25
 
16
26
  export const STEERING_WHEEL_LED_STATUS = {
17
27
  OFF: 'Off',
18
- IDLE: 'Idle',
19
- POWER_UP: 'Power-Up',
20
- EMERGENCY: 'Emergency',
28
+ COLOR: 'Color',
29
+ EFFECT: 'Effect',
21
30
  CONFIG: 'Config',
31
+ ERROR: 'Error',
32
+ UNKNOWN: 'Unknown',
22
33
  } as const;
@@ -1,4 +1,6 @@
1
1
  import { z } from 'zod';
2
+ import { colorNameSchema } from '../../color/Color.schema';
3
+ import { COLOR_NAME } from '../../color/Color.const';
2
4
  import {
3
5
  STEERING_WHEEL_ACTION_COMMAND,
4
6
  STEERING_WHEEL_LED_STATUS,
@@ -25,4 +27,5 @@ export const steeringWheelShowLedsEffectOptionsSchema = z.enum(STEERING_WHEEL_SH
25
27
  export const steeringWheelConfigureLedsOptionsSchema = z.object({
26
28
  brightness: z.number().min(0).max(100),
27
29
  durationSeconds: z.number().min(1).max(25),
30
+ colorBody: colorNameSchema.optional().default(COLOR_NAME.Red),
28
31
  });
@@ -1,7 +0,0 @@
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>;
@@ -1,9 +0,0 @@
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
- });
@@ -1,4 +0,0 @@
1
- export type SocketInitRaspberryInput = {
2
- macAddress: string;
3
- hostname: string;
4
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,15 +0,0 @@
1
- export declare const WAIVER_SIGNER_ROLE: {
2
- readonly SELF: "SELF";
3
- readonly GUARDIAN: "GUARDIAN";
4
- };
5
- export declare const WAIVER_RELATIONSHIP: {
6
- readonly PARENT: "PARENT";
7
- readonly LEGAL_GUARDIAN: "LEGAL_GUARDIAN";
8
- readonly OTHER: "OTHER";
9
- };
10
- export declare const WAIVER_CONTEXT_TYPE: {
11
- readonly SESSION: "SESSION";
12
- readonly RACING_TEAM: "RACING_TEAM";
13
- };
14
- export declare const WAIVER_VALIDITY_DAYS = 365;
15
- export declare const WAIVER_DRAFT_TEMPLATE_VERSION = "draft-1";
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WAIVER_DRAFT_TEMPLATE_VERSION = exports.WAIVER_VALIDITY_DAYS = exports.WAIVER_CONTEXT_TYPE = exports.WAIVER_RELATIONSHIP = exports.WAIVER_SIGNER_ROLE = void 0;
4
- exports.WAIVER_SIGNER_ROLE = {
5
- SELF: 'SELF',
6
- GUARDIAN: 'GUARDIAN',
7
- };
8
- exports.WAIVER_RELATIONSHIP = {
9
- PARENT: 'PARENT',
10
- LEGAL_GUARDIAN: 'LEGAL_GUARDIAN',
11
- OTHER: 'OTHER',
12
- };
13
- exports.WAIVER_CONTEXT_TYPE = {
14
- SESSION: 'SESSION',
15
- RACING_TEAM: 'RACING_TEAM',
16
- };
17
- exports.WAIVER_VALIDITY_DAYS = 365;
18
- exports.WAIVER_DRAFT_TEMPLATE_VERSION = 'draft-1';
@@ -1,116 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const waiverSignerRoleSchema: z.ZodEnum<{
3
- readonly SELF: "SELF";
4
- readonly GUARDIAN: "GUARDIAN";
5
- }>;
6
- export declare const waiverRelationshipSchema: z.ZodEnum<{
7
- readonly PARENT: "PARENT";
8
- readonly LEGAL_GUARDIAN: "LEGAL_GUARDIAN";
9
- readonly OTHER: "OTHER";
10
- }>;
11
- export declare const waiverContextTypeSchema: z.ZodEnum<{
12
- readonly SESSION: "SESSION";
13
- readonly RACING_TEAM: "RACING_TEAM";
14
- }>;
15
- export declare const waiverTemplateSchema: z.ZodObject<{
16
- version: z.ZodString;
17
- title: z.ZodString;
18
- body: z.ZodString;
19
- hash: z.ZodString;
20
- isActive: z.ZodDefault<z.ZodBoolean>;
21
- createdAt: z.ZodDate;
22
- }, z.core.$strip>;
23
- export declare const waiverContextSchema: z.ZodObject<{
24
- type: z.ZodEnum<{
25
- readonly SESSION: "SESSION";
26
- readonly RACING_TEAM: "RACING_TEAM";
27
- }>;
28
- refId: z.ZodString;
29
- }, z.core.$strip>;
30
- export declare const waiverSignerSchema: z.ZodObject<{
31
- role: z.ZodEnum<{
32
- readonly SELF: "SELF";
33
- readonly GUARDIAN: "GUARDIAN";
34
- }>;
35
- legalName: z.ZodString;
36
- relationship: z.ZodOptional<z.ZodEnum<{
37
- readonly PARENT: "PARENT";
38
- readonly LEGAL_GUARDIAN: "LEGAL_GUARDIAN";
39
- readonly OTHER: "OTHER";
40
- }>>;
41
- playerId: z.ZodOptional<z.ZodUUID>;
42
- userId: z.ZodOptional<z.ZodUUID>;
43
- contact: z.ZodOptional<z.ZodString>;
44
- documentId: z.ZodOptional<z.ZodString>;
45
- }, z.core.$strip>;
46
- export declare const waiverRecordSchema: z.ZodObject<{
47
- id: z.ZodUUID;
48
- playerId: z.ZodUUID;
49
- signer: z.ZodObject<{
50
- role: z.ZodEnum<{
51
- readonly SELF: "SELF";
52
- readonly GUARDIAN: "GUARDIAN";
53
- }>;
54
- legalName: z.ZodString;
55
- relationship: z.ZodOptional<z.ZodEnum<{
56
- readonly PARENT: "PARENT";
57
- readonly LEGAL_GUARDIAN: "LEGAL_GUARDIAN";
58
- readonly OTHER: "OTHER";
59
- }>>;
60
- playerId: z.ZodOptional<z.ZodUUID>;
61
- userId: z.ZodOptional<z.ZodUUID>;
62
- contact: z.ZodOptional<z.ZodString>;
63
- documentId: z.ZodOptional<z.ZodString>;
64
- }, z.core.$strip>;
65
- context: z.ZodObject<{
66
- type: z.ZodEnum<{
67
- readonly SESSION: "SESSION";
68
- readonly RACING_TEAM: "RACING_TEAM";
69
- }>;
70
- refId: z.ZodString;
71
- }, z.core.$strip>;
72
- templateVersion: z.ZodString;
73
- templateHash: z.ZodString;
74
- documentSnapshot: z.ZodString;
75
- signature: z.ZodOptional<z.ZodString>;
76
- acceptedAt: z.ZodDate;
77
- expiresAt: z.ZodDate;
78
- supersedesWaiverId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
79
- ipAddress: z.ZodOptional<z.ZodString>;
80
- userAgent: z.ZodOptional<z.ZodString>;
81
- createdAt: z.ZodDate;
82
- }, z.core.$strip>;
83
- export declare const signWaiverSchema: z.ZodObject<{
84
- accepted: z.ZodLiteral<true>;
85
- signerRole: z.ZodDefault<z.ZodEnum<{
86
- readonly SELF: "SELF";
87
- readonly GUARDIAN: "GUARDIAN";
88
- }>>;
89
- legalName: z.ZodString;
90
- relationship: z.ZodOptional<z.ZodEnum<{
91
- readonly PARENT: "PARENT";
92
- readonly LEGAL_GUARDIAN: "LEGAL_GUARDIAN";
93
- readonly OTHER: "OTHER";
94
- }>>;
95
- signerPlayerId: z.ZodOptional<z.ZodUUID>;
96
- signerContact: z.ZodOptional<z.ZodString>;
97
- signerDocumentId: z.ZodOptional<z.ZodString>;
98
- context: z.ZodObject<{
99
- type: z.ZodEnum<{
100
- readonly SESSION: "SESSION";
101
- readonly RACING_TEAM: "RACING_TEAM";
102
- }>;
103
- refId: z.ZodString;
104
- }, z.core.$strip>;
105
- templateVersion: z.ZodString;
106
- signature: z.ZodOptional<z.ZodString>;
107
- }, z.core.$strip>;
108
- export declare const filterWaiverSchema: z.ZodObject<{
109
- playerId: z.ZodOptional<z.ZodUUID>;
110
- sessionId: z.ZodOptional<z.ZodString>;
111
- racingTeamId: z.ZodOptional<z.ZodString>;
112
- signerRole: z.ZodOptional<z.ZodEnum<{
113
- readonly SELF: "SELF";
114
- readonly GUARDIAN: "GUARDIAN";
115
- }>>;
116
- }, z.core.$strip>;
@@ -1,68 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.filterWaiverSchema = exports.signWaiverSchema = exports.waiverRecordSchema = exports.waiverSignerSchema = exports.waiverContextSchema = exports.waiverTemplateSchema = exports.waiverContextTypeSchema = exports.waiverRelationshipSchema = exports.waiverSignerRoleSchema = void 0;
4
- const zod_1 = require("zod");
5
- const Waiver_const_1 = require("./Waiver.const");
6
- exports.waiverSignerRoleSchema = zod_1.z.enum(Waiver_const_1.WAIVER_SIGNER_ROLE);
7
- exports.waiverRelationshipSchema = zod_1.z.enum(Waiver_const_1.WAIVER_RELATIONSHIP);
8
- exports.waiverContextTypeSchema = zod_1.z.enum(Waiver_const_1.WAIVER_CONTEXT_TYPE);
9
- exports.waiverTemplateSchema = zod_1.z.object({
10
- version: zod_1.z.string().min(1),
11
- title: zod_1.z.string().min(1),
12
- body: zod_1.z.string().min(1),
13
- hash: zod_1.z.string().length(64),
14
- isActive: zod_1.z.boolean().default(false),
15
- createdAt: zod_1.z.date(),
16
- });
17
- exports.waiverContextSchema = zod_1.z.object({
18
- type: exports.waiverContextTypeSchema,
19
- refId: zod_1.z.string().min(1),
20
- });
21
- exports.waiverSignerSchema = zod_1.z.object({
22
- role: exports.waiverSignerRoleSchema,
23
- legalName: zod_1.z.string().min(3).max(120),
24
- relationship: exports.waiverRelationshipSchema.optional(),
25
- playerId: zod_1.z.uuidv4().optional(),
26
- userId: zod_1.z.uuidv4().optional(),
27
- contact: zod_1.z.string().max(60).optional(),
28
- documentId: zod_1.z.string().max(60).optional(),
29
- });
30
- exports.waiverRecordSchema = zod_1.z.object({
31
- id: zod_1.z.uuidv4(),
32
- playerId: zod_1.z.uuidv4(),
33
- signer: exports.waiverSignerSchema,
34
- context: exports.waiverContextSchema,
35
- templateVersion: zod_1.z.string().min(1),
36
- templateHash: zod_1.z.string().length(64),
37
- documentSnapshot: zod_1.z.string().min(1),
38
- signature: zod_1.z.string().optional(),
39
- acceptedAt: zod_1.z.date(),
40
- expiresAt: zod_1.z.date(),
41
- supersedesWaiverId: zod_1.z.uuidv4().nullable().optional(),
42
- ipAddress: zod_1.z.string().max(45).optional(),
43
- userAgent: zod_1.z.string().max(255).optional(),
44
- createdAt: zod_1.z.date(),
45
- });
46
- exports.signWaiverSchema = zod_1.z
47
- .object({
48
- accepted: zod_1.z.literal(true),
49
- signerRole: exports.waiverSignerRoleSchema.default(Waiver_const_1.WAIVER_SIGNER_ROLE.SELF),
50
- legalName: zod_1.z.string().min(3).max(120),
51
- relationship: exports.waiverRelationshipSchema.optional(),
52
- signerPlayerId: zod_1.z.uuidv4().optional(),
53
- signerContact: zod_1.z.string().max(60).optional(),
54
- signerDocumentId: zod_1.z.string().max(60).optional(),
55
- context: exports.waiverContextSchema,
56
- templateVersion: zod_1.z.string().min(1),
57
- signature: zod_1.z.string().optional(),
58
- })
59
- .refine((input) => input.signerRole !== Waiver_const_1.WAIVER_SIGNER_ROLE.GUARDIAN || Boolean(input.relationship), {
60
- message: 'relationship is required when signing as GUARDIAN',
61
- path: ['relationship'],
62
- });
63
- exports.filterWaiverSchema = zod_1.z.object({
64
- playerId: zod_1.z.uuidv4().optional(),
65
- sessionId: zod_1.z.string().optional(),
66
- racingTeamId: zod_1.z.string().optional(),
67
- signerRole: exports.waiverSignerRoleSchema.optional(),
68
- });
@@ -1,11 +0,0 @@
1
- import { z } from 'zod';
2
- import { filterWaiverSchema, signWaiverSchema, waiverContextSchema, waiverContextTypeSchema, waiverRecordSchema, waiverRelationshipSchema, waiverSignerRoleSchema, waiverSignerSchema, waiverTemplateSchema } from './Waiver.schema';
3
- export type WaiverSignerRole = z.infer<typeof waiverSignerRoleSchema>;
4
- export type WaiverRelationship = z.infer<typeof waiverRelationshipSchema>;
5
- export type WaiverContextType = z.infer<typeof waiverContextTypeSchema>;
6
- export type WaiverTemplate = z.infer<typeof waiverTemplateSchema>;
7
- export type WaiverContext = z.infer<typeof waiverContextSchema>;
8
- export type WaiverSigner = z.infer<typeof waiverSignerSchema>;
9
- export type WaiverRecord = z.infer<typeof waiverRecordSchema>;
10
- export type SignWaiverInput = z.infer<typeof signWaiverSchema>;
11
- export type FilterWaiverInput = z.infer<typeof filterWaiverSchema>;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +0,0 @@
1
- export * from './Waiver.const';
2
- export * from './Waiver.schema';
3
- export * from './Waiver.types';
@@ -1,19 +0,0 @@
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("./Waiver.const"), exports);
18
- __exportStar(require("./Waiver.schema"), exports);
19
- __exportStar(require("./Waiver.types"), exports);