@findatruck/shared-schemas 2.23.0 → 2.23.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.
package/dist/index.js CHANGED
@@ -49,141 +49,160 @@ var DeleteAnonymousDriverResponseSchema = z.object({
49
49
  user_id: z.string()
50
50
  });
51
51
 
52
- // src/schemas/providerAccounts/delete-provider-account.ts
52
+ // src/schemas/providerAccounts/validate-login.ts
53
53
  import { z as z2 } from "zod";
54
- var DeleteProviderAccountRequestSchema = z2.object({
55
- providerAccountId: z2.string().min(1).describe("The external provider account ID to delete")
54
+ var UrlSchema = z2.string().refine(
55
+ (val) => {
56
+ try {
57
+ new URL(val);
58
+ return true;
59
+ } catch {
60
+ return false;
61
+ }
62
+ },
63
+ { message: "Invalid URL" }
64
+ );
65
+ var ValidateLoginRequestSchema = z2.object({
66
+ providerUrl: UrlSchema.describe("The URL of the ELD provider to validate credentials against"),
67
+ username: z2.string().min(1).describe("The username to validate"),
68
+ encryptedPassword: z2.string().min(1).describe("The encrypted password to validate")
69
+ }).describe("Request schema for validating login credentials via browser auth");
70
+ var ValidateLoginResponseSchema = z2.object({
71
+ success: z2.boolean().describe("Indicates if the login credentials are valid")
72
+ }).describe("Response schema for login validation");
73
+
74
+ // src/schemas/providerAccounts/delete-provider-account.ts
75
+ import { z as z3 } from "zod";
76
+ var DeleteProviderAccountRequestSchema = z3.object({
77
+ providerAccountId: z3.string().min(1).describe("The external provider account ID to delete")
56
78
  }).describe("Request schema for deleting a provider account");
57
- var DeleteProviderAccountResponseSchema = z2.object({
58
- success: z2.boolean().describe("Indicates if the provider account was successfully deleted")
79
+ var DeleteProviderAccountResponseSchema = z3.object({
80
+ success: z3.boolean().describe("Indicates if the provider account was successfully deleted")
59
81
  }).describe("Response schema for provider account deletion");
60
82
 
61
83
  // src/schemas/telemetry/driver-rankings.ts
62
- import { z as z3 } from "zod";
63
- var DriverRankingsRequestSchema = z3.object({
64
- start_date: z3.string().describe("Start date for the ranking period (ISO 8601 format)"),
65
- end_date: z3.string().describe("End date for the ranking period (ISO 8601 format)"),
66
- state: z3.string().length(2).optional().describe("Optional 2-letter state abbreviation to filter telemetry by location"),
67
- source: z3.enum(["eld", "manual"]).default("manual").describe("Telemetry source to rank by: 'manual' uses GPS odometer, 'eld' uses calculated distance")
84
+ import { z as z4 } from "zod";
85
+ var DriverRankingsRequestSchema = z4.object({
86
+ start_date: z4.string().describe("Start date for the ranking period (ISO 8601 format)"),
87
+ end_date: z4.string().describe("End date for the ranking period (ISO 8601 format)"),
88
+ state: z4.string().length(2).optional().describe("Optional 2-letter state abbreviation to filter telemetry by location"),
89
+ source: z4.enum(["eld", "manual"]).default("manual").describe("Telemetry source to rank by: 'manual' uses GPS odometer, 'eld' uses calculated distance")
68
90
  }).describe("Request schema for driver rankings by miles driven");
69
- var DriverRankingSchema = z3.object({
70
- rank: z3.number().int().positive().describe("Rank position based on miles driven"),
71
- driver_id: z3.string().uuid().describe("Unique identifier of the driver"),
72
- driver_name: z3.string().describe("Name of the driver"),
73
- total_miles: z3.number().min(0).describe("Total miles driven in the specified period")
91
+ var DriverRankingSchema = z4.object({
92
+ rank: z4.number().int().positive().describe("Rank position based on miles driven"),
93
+ driver_id: z4.string().uuid().describe("Unique identifier of the driver"),
94
+ driver_name: z4.string().describe("Name of the driver"),
95
+ total_miles: z4.number().min(0).describe("Total miles driven in the specified period")
74
96
  }).describe("Single driver ranking entry");
75
- var DriverRankingsResponseSchema = z3.array(DriverRankingSchema).describe("Array of driver rankings sorted by miles driven in descending order");
97
+ var DriverRankingsResponseSchema = z4.array(DriverRankingSchema).describe("Array of driver rankings sorted by miles driven in descending order");
76
98
 
77
99
  // src/schemas/telemetry/state-heatmap.ts
78
- import { z as z4 } from "zod";
79
- var StateHeatmapRequestSchema = z4.object({
80
- driver_id: z4.string().uuid().describe("Unique identifier of the driver"),
81
- start_date: z4.string().describe("Start date for the heatmap period (ISO 8601 format)"),
82
- end_date: z4.string().describe("End date for the heatmap period (ISO 8601 format)")
100
+ import { z as z5 } from "zod";
101
+ var StateHeatmapRequestSchema = z5.object({
102
+ driver_id: z5.string().uuid().describe("Unique identifier of the driver"),
103
+ start_date: z5.string().describe("Start date for the heatmap period (ISO 8601 format)"),
104
+ end_date: z5.string().describe("End date for the heatmap period (ISO 8601 format)")
83
105
  }).describe("Request schema for driver state heatmap");
84
- var StateHeatmapEntrySchema = z4.object({
85
- count: z4.number().int().min(0).describe("Number of telemetry points in this state"),
86
- percentage: z4.number().min(0).max(100).describe("Percentage of total telemetry points in this state")
106
+ var StateHeatmapEntrySchema = z5.object({
107
+ count: z5.number().int().min(0).describe("Number of telemetry points in this state"),
108
+ percentage: z5.number().min(0).max(100).describe("Percentage of total telemetry points in this state")
87
109
  }).describe("Single state entry in the heatmap");
88
- var StateHeatmapResponseSchema = z4.record(
89
- z4.string().length(2),
110
+ var StateHeatmapResponseSchema = z5.record(
111
+ z5.string().length(2),
90
112
  StateHeatmapEntrySchema
91
113
  ).describe("Record of 2-letter state codes to heatmap entries");
92
114
 
93
115
  // src/schemas/telemetry/manual-batch.ts
94
- import { z as z5 } from "zod";
95
- var ManualBatchEntrySchema = z5.object({
96
- driver_id: z5.string().uuid().describe("Internal UUID of the driver"),
97
- timestamp: z5.string().datetime().describe("Timestamp of the GPS reading (ISO 8601 format)"),
98
- location_latitude: z5.number().min(-90).max(90).describe("GPS latitude coordinate"),
99
- location_longitude: z5.number().min(-180).max(180).describe("GPS longitude coordinate"),
100
- location_address: z5.string().optional().describe("Optional human-readable address"),
101
- vehicle_odometer_miles: z5.number().min(0).optional().describe("Optional vehicle odometer reading in miles"),
102
- heading: z5.number().min(0).max(360).optional().describe("Optional GPS heading in degrees (0-360)"),
103
- speed_mph: z5.number().min(0).optional().describe("Optional GPS speed in miles per hour"),
104
- altitude_feet: z5.number().optional().describe("Optional GPS altitude in feet"),
105
- raw: z5.record(z5.string(), z5.unknown()).optional().describe("Optional raw upstream JSON payload to archive alongside this entry"),
106
- driving_status: z5.enum(["parked", "driving"]).optional().describe("Optional parked/driving status reported by the upstream system"),
107
- activity_type: z5.string().optional().describe("Optional activity recognition type (e.g. 'in_vehicle', 'on_foot')"),
108
- activity_confidence: z5.number().int().min(0).max(100).optional().describe("Optional activity recognition confidence (0-100)")
116
+ import { z as z6 } from "zod";
117
+ var ManualBatchEntrySchema = z6.object({
118
+ driver_id: z6.string().uuid().describe("Internal UUID of the driver"),
119
+ timestamp: z6.string().datetime().describe("Timestamp of the GPS reading (ISO 8601 format)"),
120
+ location_latitude: z6.number().min(-90).max(90).describe("GPS latitude coordinate"),
121
+ location_longitude: z6.number().min(-180).max(180).describe("GPS longitude coordinate"),
122
+ location_address: z6.string().optional().describe("Optional human-readable address"),
123
+ vehicle_odometer_miles: z6.number().min(0).optional().describe("Optional vehicle odometer reading in miles"),
124
+ heading: z6.number().min(0).max(360).optional().describe("Optional GPS heading in degrees (0-360)"),
125
+ speed_mph: z6.number().min(0).optional().describe("Optional GPS speed in miles per hour"),
126
+ altitude_feet: z6.number().optional().describe("Optional GPS altitude in feet"),
127
+ raw: z6.record(z6.string(), z6.unknown()).optional().describe("Optional raw upstream JSON payload to archive alongside this entry"),
128
+ driving_status: z6.enum(["parked", "driving"]).optional().describe("Optional parked/driving status reported by the upstream system"),
129
+ activity_type: z6.string().optional().describe("Optional activity recognition type (e.g. 'in_vehicle', 'on_foot')"),
130
+ activity_confidence: z6.number().int().min(0).max(100).optional().describe("Optional activity recognition confidence (0-100)")
109
131
  }).describe("Single manual telemetry entry");
110
- var ManualBatchRequestSchema = z5.object({
111
- entries: z5.array(ManualBatchEntrySchema).min(1).max(1e3).describe("Array of manual telemetry entries (1-1000)")
112
- }).describe("Request schema for manual batch telemetry insertion");
113
- var ManualBatchTelemetrySchema = z5.object({
114
- id: z5.number().int().describe("Telemetry record ID"),
115
- driver_id: z5.string().uuid().describe("Internal UUID of the driver"),
116
- timestamp: z5.union([z5.string(), z5.date()]).describe("Timestamp of the telemetry reading"),
117
- remaining_drive_time_in_seconds: z5.number().min(0),
118
- remaining_shift_time_in_seconds: z5.number().min(0),
119
- remaining_cycle_time_in_seconds: z5.number().min(0),
120
- remaining_break_time_in_seconds: z5.number().min(0),
121
- location_latitude: z5.number().min(-90).max(90),
122
- location_longitude: z5.number().min(-180).max(180),
123
- previous_location_latitude: z5.number().min(-90).max(90).nullable(),
124
- previous_location_longitude: z5.number().min(-180).max(180).nullable(),
125
- location_address: z5.string().nullable(),
126
- location_state: z5.string().length(2).nullable(),
127
- echoed_odometer_miles: z5.number().min(0).nullable().describe("Vehicle odometer reading echoed back from the request (miles)"),
128
- osrm_calculated_miles: z5.number().min(0).nullable().describe("Road distance calculated by OSRM between this point and the previous point (miles)"),
129
- heading: z5.number().nullish(),
130
- speed_mph: z5.number().nullish(),
131
- altitude_feet: z5.number().nullish(),
132
- source: z5.enum(["eld", "manual"]),
133
- driving_status: z5.enum(["parked", "driving"]).nullable(),
134
- activity_type: z5.string().nullable(),
135
- activity_confidence: z5.number().int().nullable()
132
+ var ManualBatchTelemetrySchema = z6.object({
133
+ id: z6.number().int().describe("Telemetry record ID"),
134
+ driver_id: z6.string().uuid().describe("Internal UUID of the driver"),
135
+ timestamp: z6.union([z6.string(), z6.date()]).describe("Timestamp of the telemetry reading"),
136
+ remaining_drive_time_in_seconds: z6.number().min(0),
137
+ remaining_shift_time_in_seconds: z6.number().min(0),
138
+ remaining_cycle_time_in_seconds: z6.number().min(0),
139
+ remaining_break_time_in_seconds: z6.number().min(0),
140
+ location_latitude: z6.number().min(-90).max(90),
141
+ location_longitude: z6.number().min(-180).max(180),
142
+ previous_location_latitude: z6.number().min(-90).max(90).nullable(),
143
+ previous_location_longitude: z6.number().min(-180).max(180).nullable(),
144
+ location_address: z6.string().nullable(),
145
+ location_state: z6.string().length(2).nullable(),
146
+ echoed_odometer_miles: z6.number().min(0).nullable().describe("Vehicle odometer reading echoed back from the request (miles)"),
147
+ osrm_calculated_miles: z6.number().min(0).nullable().describe("Road distance calculated by OSRM between this point and the previous point (miles)"),
148
+ heading: z6.number().nullish(),
149
+ speed_mph: z6.number().nullish(),
150
+ altitude_feet: z6.number().nullish(),
151
+ source: z6.enum(["eld", "manual"]),
152
+ driving_status: z6.enum(["parked", "driving"]).nullable(),
153
+ activity_type: z6.string().nullable(),
154
+ activity_confidence: z6.number().int().nullable()
136
155
  }).describe("Telemetry record returned from manual batch insertion");
137
- var ManualBatchResponseSchema = z5.object({
138
- message: z5.string().describe("Success message"),
139
- inserted_count: z5.number().int().min(0).describe("Number of telemetry entries inserted"),
140
- telemetry: z5.array(ManualBatchTelemetrySchema).describe("Array of inserted telemetry records")
156
+ var ManualBatchResponseSchema = z6.object({
157
+ message: z6.string().describe("Success message"),
158
+ inserted_count: z6.number().int().min(0).describe("Number of telemetry entries inserted"),
159
+ telemetry: z6.array(ManualBatchTelemetrySchema).describe("Array of inserted telemetry records")
141
160
  }).describe("Response schema for manual batch telemetry insertion");
142
161
 
143
162
  // src/schemas/telemetry/bggeo-batch.ts
144
- import { z as z6 } from "zod";
145
- var BGGeoCoordsSchema = z6.object({
146
- latitude: z6.number().min(-90).max(90),
147
- longitude: z6.number().min(-180).max(180),
148
- accuracy: z6.number().optional(),
149
- speed: z6.number().describe("Speed in m/s; -1 when unavailable"),
150
- heading: z6.number().describe("Heading in degrees; -1 when unavailable"),
151
- altitude: z6.number().describe("Altitude in meters"),
152
- altitude_accuracy: z6.number().optional(),
153
- speed_accuracy: z6.number().optional(),
154
- heading_accuracy: z6.number().optional(),
155
- ellipsoidal_altitude: z6.number().optional(),
156
- floor: z6.number().nullable().optional()
163
+ import { z as z7 } from "zod";
164
+ var BGGeoCoordsSchema = z7.object({
165
+ latitude: z7.number().min(-90).max(90),
166
+ longitude: z7.number().min(-180).max(180),
167
+ accuracy: z7.number().optional(),
168
+ speed: z7.number().describe("Speed in m/s; -1 when unavailable"),
169
+ heading: z7.number().describe("Heading in degrees; -1 when unavailable"),
170
+ altitude: z7.number().describe("Altitude in meters"),
171
+ altitude_accuracy: z7.number().optional(),
172
+ speed_accuracy: z7.number().optional(),
173
+ heading_accuracy: z7.number().optional(),
174
+ ellipsoidal_altitude: z7.number().optional(),
175
+ floor: z7.number().nullable().optional()
157
176
  }).describe("BGGeo coords object");
158
- var BGGeoActivitySchema = z6.object({
159
- type: z6.string(),
160
- confidence: z6.number()
177
+ var BGGeoActivitySchema = z7.object({
178
+ type: z7.string(),
179
+ confidence: z7.number()
161
180
  }).describe("BGGeo activity recognition");
162
- var BGGeoBatterySchema = z6.object({
163
- is_charging: z6.boolean(),
164
- level: z6.number()
181
+ var BGGeoBatterySchema = z7.object({
182
+ is_charging: z7.boolean(),
183
+ level: z7.number()
165
184
  }).describe("BGGeo battery status");
166
- var BGGeoLocationSchema = z6.object({
185
+ var BGGeoLocationSchema = z7.object({
167
186
  coords: BGGeoCoordsSchema,
168
- extras: z6.object({}).passthrough().optional(),
187
+ extras: z7.object({}).passthrough().optional(),
169
188
  activity: BGGeoActivitySchema.optional(),
170
189
  battery: BGGeoBatterySchema.optional(),
171
- timestamp: z6.string().datetime().describe("ISO 8601 timestamp"),
172
- is_moving: z6.boolean(),
173
- odometer: z6.number().min(0).describe("Odometer in meters"),
174
- uuid: z6.string().optional(),
175
- event: z6.string().optional(),
176
- age: z6.number().optional(),
177
- geofence: z6.record(z6.string(), z6.unknown()).optional(),
178
- mock: z6.boolean().optional(),
179
- recorded_at: z6.string().datetime().optional().describe("ISO 8601 device recording timestamp")
190
+ timestamp: z7.string().datetime().describe("ISO 8601 timestamp"),
191
+ is_moving: z7.boolean(),
192
+ odometer: z7.number().min(0).describe("Odometer in meters"),
193
+ uuid: z7.string().optional(),
194
+ event: z7.string().optional(),
195
+ age: z7.number().optional(),
196
+ geofence: z7.record(z7.string(), z7.unknown()).optional(),
197
+ mock: z7.boolean().optional(),
198
+ recorded_at: z7.string().datetime().optional().describe("ISO 8601 device recording timestamp")
180
199
  }).passthrough().describe("Single BGGeo location object");
181
- var locationArray = z6.array(BGGeoLocationSchema).min(1).max(1e3).describe("Array of BGGeo location objects (1-1000)");
182
- var locationOrArray = z6.union([
200
+ var locationArray = z7.array(BGGeoLocationSchema).min(1).max(1e3).describe("Array of BGGeo location objects (1-1000)");
201
+ var locationOrArray = z7.union([
183
202
  BGGeoLocationSchema.transform((loc) => [loc]),
184
203
  locationArray
185
204
  ]);
186
- var BGGeoBatchRequestSchema = z6.object({
205
+ var BGGeoBatchRequestSchema = z7.object({
187
206
  location: locationOrArray.optional(),
188
207
  locations: locationOrArray.optional()
189
208
  }).refine((data) => data.location ?? data.locations, {
@@ -191,142 +210,169 @@ var BGGeoBatchRequestSchema = z6.object({
191
210
  }).describe("Request schema for BGGeo batch telemetry ingestion");
192
211
 
193
212
  // src/schemas/trips/driver-trips.ts
194
- import { z as z7 } from "zod";
195
- var DriverTripsRequestSchema = z7.object({
196
- driver_id: z7.string().uuid(),
197
- start_date: z7.string(),
213
+ import { z as z8 } from "zod";
214
+ var DriverTripsRequestSchema = z8.object({
215
+ driver_id: z8.string().uuid(),
216
+ start_date: z8.string(),
198
217
  // YYYY-MM-DD
199
- end_date: z7.string()
218
+ end_date: z8.string()
200
219
  // YYYY-MM-DD
201
220
  });
202
- var DriverTripSchema = z7.object({
203
- id: z7.number(),
204
- start_time: z7.string(),
205
- end_time: z7.string(),
206
- point_count: z7.number(),
207
- polyline: z7.string().nullable(),
208
- highways: z7.array(z7.string()).nullable(),
209
- total_miles: z7.number().nullable(),
210
- avg_speed_mph: z7.number().nullable(),
211
- miles_by_weather: z7.record(z7.string(), z7.number()).nullable(),
212
- miles_by_light: z7.record(z7.string(), z7.number()).nullable()
221
+ var DriverTripSchema = z8.object({
222
+ id: z8.number(),
223
+ start_time: z8.string(),
224
+ end_time: z8.string(),
225
+ point_count: z8.number(),
226
+ polyline: z8.string().nullable(),
227
+ highways: z8.array(z8.string()).nullable(),
228
+ total_miles: z8.number().nullable(),
229
+ avg_speed_mph: z8.number().nullable(),
230
+ miles_by_weather: z8.record(z8.string(), z8.number()).nullable(),
231
+ miles_by_light: z8.record(z8.string(), z8.number()).nullable()
213
232
  });
214
- var DriverTripsResponseSchema = z7.array(DriverTripSchema);
215
- var DriverDailySummarySchema = z7.object({
216
- summary_date: z7.string(),
217
- total_miles: z7.number(),
218
- trip_count: z7.number(),
219
- point_count: z7.number(),
220
- polyline: z7.string().nullable(),
221
- highways: z7.array(z7.string()).nullable(),
222
- avg_speed_mph: z7.number().nullable(),
223
- miles_by_weather: z7.record(z7.string(), z7.number()).nullable(),
224
- miles_by_light: z7.record(z7.string(), z7.number()).nullable()
233
+ var DriverTripsResponseSchema = z8.array(DriverTripSchema);
234
+ var DriverDailySummarySchema = z8.object({
235
+ summary_date: z8.string(),
236
+ total_miles: z8.number(),
237
+ trip_count: z8.number(),
238
+ point_count: z8.number(),
239
+ polyline: z8.string().nullable(),
240
+ highways: z8.array(z8.string()).nullable(),
241
+ avg_speed_mph: z8.number().nullable(),
242
+ miles_by_weather: z8.record(z8.string(), z8.number()).nullable(),
243
+ miles_by_light: z8.record(z8.string(), z8.number()).nullable()
225
244
  });
226
- var DriverDailySummariesResponseSchema = z7.array(DriverDailySummarySchema);
245
+ var DriverDailySummariesResponseSchema = z8.array(DriverDailySummarySchema);
227
246
 
228
247
  // src/schemas/trips/enriched-trip-summary.ts
229
- import { z as z8 } from "zod";
230
- var EnrichedTripSummaryRequestSchema = z8.object({
231
- trip_id: z8.number()
248
+ import { z as z9 } from "zod";
249
+ var EnrichedTripSummaryRequestSchema = z9.object({
250
+ trip_id: z9.number()
232
251
  });
233
- var DriverEnrichedSummariesRequestSchema = z8.object({
234
- driver_id: z8.string().uuid(),
235
- start_date: z8.string(),
236
- end_date: z8.string()
252
+ var DriverEnrichedSummariesRequestSchema = z9.object({
253
+ driver_id: z9.string().uuid(),
254
+ start_date: z9.string(),
255
+ end_date: z9.string()
237
256
  });
238
- var EnrichedStopSchema = z8.object({
239
- duration_seconds: z8.number()
257
+ var EnrichedStopSchema = z9.object({
258
+ duration_seconds: z9.number()
240
259
  });
241
- var EnrichedPointSchema = z8.object({
242
- lat: z8.number(),
243
- lon: z8.number(),
244
- timestamp: z8.string(),
245
- speed_mph: z8.number().nullable(),
246
- heading: z8.number().nullable(),
247
- altitude_feet: z8.number().nullable(),
248
- weather_condition: z8.string().nullable(),
249
- temperature_f: z8.number().nullable(),
250
- visibility_miles: z8.number().nullable(),
251
- light_condition: z8.string().nullable(),
260
+ var EnrichedPointSchema = z9.object({
261
+ lat: z9.number(),
262
+ lon: z9.number(),
263
+ timestamp: z9.string(),
264
+ speed_mph: z9.number().nullable(),
265
+ heading: z9.number().nullable(),
266
+ altitude_feet: z9.number().nullable(),
267
+ weather_condition: z9.string().nullable(),
268
+ temperature_f: z9.number().nullable(),
269
+ visibility_miles: z9.number().nullable(),
270
+ light_condition: z9.string().nullable(),
252
271
  stop: EnrichedStopSchema.nullable()
253
272
  });
254
- var EnrichedTripSummarySchema = z8.object({
255
- trip_id: z8.number(),
256
- driver_id: z8.string(),
257
- start_time: z8.string(),
258
- end_time: z8.string(),
259
- points: z8.array(EnrichedPointSchema)
273
+ var EnrichedTripSummarySchema = z9.object({
274
+ trip_id: z9.number(),
275
+ driver_id: z9.string(),
276
+ start_time: z9.string(),
277
+ end_time: z9.string(),
278
+ points: z9.array(EnrichedPointSchema)
260
279
  });
261
280
  var EnrichedTripSummaryResponseSchema = EnrichedTripSummarySchema;
262
- var DriverEnrichedSummariesResponseSchema = z8.array(EnrichedTripSummarySchema);
281
+ var DriverEnrichedSummariesResponseSchema = z9.array(EnrichedTripSummarySchema);
263
282
 
264
283
  // src/schemas/trips/convex-driver-trip.ts
265
- import { z as z9 } from "zod";
266
- var ConvexBreadcrumbEventSchema = z9.object({
267
- ts: z9.number(),
284
+ import { z as z10 } from "zod";
285
+ var ConvexBreadcrumbEventSchema = z10.object({
286
+ ts: z10.number(),
268
287
  // epoch ms
269
- status: z9.string(),
270
- lat: z9.number(),
271
- lon: z9.number(),
272
- heading: z9.number().optional(),
273
- locationText: z9.string().optional(),
274
- speedKph: z9.number().optional(),
275
- altitudeFeet: z9.number().optional()
288
+ status: z10.string(),
289
+ lat: z10.number(),
290
+ lon: z10.number(),
291
+ heading: z10.number().optional(),
292
+ locationText: z10.string().optional(),
293
+ speedKph: z10.number().optional(),
294
+ altitudeFeet: z10.number().optional()
276
295
  });
277
- var ConvexDriverTripRequestSchema = z9.object({
278
- userId: z9.string(),
279
- breadcrumbs: z9.array(ConvexBreadcrumbEventSchema).min(1)
296
+ var ConvexDriverTripRequestSchema = z10.object({
297
+ userId: z10.string(),
298
+ breadcrumbs: z10.array(ConvexBreadcrumbEventSchema).min(1)
280
299
  });
281
300
 
282
301
  // src/schemas/trips/post-driver-trip-telemetry.ts
283
- import { z as z10 } from "zod";
284
- var PostDriverTripTelemetryRecordSchema = z10.object({
285
- location_latitude: z10.number(),
286
- location_longitude: z10.number(),
287
- location_address: z10.string().optional(),
288
- heading: z10.number(),
289
- drivingState: z10.string(),
290
- speedKph: z10.number(),
291
- altitudeFeet: z10.number(),
292
- gps_timestamp: z10.string().optional(),
293
- odometer: z10.number().optional(),
294
- activity_type: z10.string().optional(),
295
- activity_confidence: z10.number().int().optional()
302
+ import { z as z11 } from "zod";
303
+ var PostDriverTripTelemetryRecordSchema = z11.object({
304
+ location_latitude: z11.number(),
305
+ location_longitude: z11.number(),
306
+ location_address: z11.string().optional(),
307
+ heading: z11.number(),
308
+ drivingState: z11.string(),
309
+ speedKph: z11.number(),
310
+ altitudeFeet: z11.number(),
311
+ gps_timestamp: z11.string().optional(),
312
+ odometer: z11.number().optional(),
313
+ activity_type: z11.string().optional(),
314
+ activity_confidence: z11.number().int().optional()
315
+ });
316
+ var PostDriverTripTelemetryRequestSchema = z11.object({
317
+ honkUserId: z11.string(),
318
+ telemetry: z11.array(PostDriverTripTelemetryRecordSchema).min(1)
296
319
  });
297
- var PostDriverTripTelemetryRequestSchema = z10.object({
298
- honkUserId: z10.string(),
299
- telemetry: z10.array(PostDriverTripTelemetryRecordSchema).min(1)
320
+
321
+ // src/schemas/trips/post-daily-summary.ts
322
+ import { z as z12 } from "zod";
323
+ var PostDailySummaryRecordSchema = z12.object({
324
+ externalDriverId: z12.string(),
325
+ // drivers.id from Postgres
326
+ date: z12.string(),
327
+ // "YYYY-MM-DD"
328
+ totalMiles: z12.number(),
329
+ tripCount: z12.number(),
330
+ pointCount: z12.number(),
331
+ polyline: z12.string().optional(),
332
+ highways: z12.array(z12.string()).optional(),
333
+ avgSpeedMph: z12.number().optional(),
334
+ milesByWeather: z12.record(z12.string(), z12.number()).optional(),
335
+ milesByLight: z12.record(z12.string(), z12.number()).optional(),
336
+ states: z12.array(z12.string()).optional(),
337
+ origin: z12.string().optional(),
338
+ destination: z12.string().optional(),
339
+ altitudeGainedFeet: z12.number().optional(),
340
+ altitudeLostFeet: z12.number().optional(),
341
+ userId: z12.string().optional()
342
+ // Convex user ID (honk_user_id) for fallback driver resolution
343
+ });
344
+ var PostDailySummaryRequestSchema = z12.object({
345
+ summaries: z12.array(PostDailySummaryRecordSchema).min(1)
300
346
  });
301
347
 
302
348
  // src/auth-data.ts
303
- import { z as z11 } from "zod";
304
- var GomotiveAuthDataSchema = z11.object({
305
- kind: z11.literal("gomotive"),
306
- token: z11.string(),
307
- ownerOperator: z11.boolean()
349
+ import { z as z13 } from "zod";
350
+ var GomotiveAuthDataSchema = z13.object({
351
+ kind: z13.literal("gomotive"),
352
+ token: z13.string(),
353
+ ownerOperator: z13.boolean()
308
354
  });
309
- var VistaAuthDataSchema = z11.object({
310
- kind: z11.literal("vista"),
311
- driverId: z11.string(),
312
- cookie: z11.string()
355
+ var VistaAuthDataSchema = z13.object({
356
+ kind: z13.literal("vista"),
357
+ driverId: z13.string(),
358
+ cookie: z13.string()
313
359
  });
314
- var MockAuthDataSchema = z11.object({
315
- kind: z11.literal("mock"),
316
- cookie: z11.string()
360
+ var MockAuthDataSchema = z13.object({
361
+ kind: z13.literal("mock"),
362
+ cookie: z13.string()
317
363
  });
318
- var NoneAuthDataSchema = z11.object({
319
- kind: z11.literal("none")
364
+ var NoneAuthDataSchema = z13.object({
365
+ kind: z13.literal("none")
320
366
  });
321
- var ProviderAuthDataSchema = z11.discriminatedUnion("kind", [
367
+ var ProviderAuthDataSchema = z13.discriminatedUnion("kind", [
322
368
  GomotiveAuthDataSchema,
323
369
  VistaAuthDataSchema,
324
370
  MockAuthDataSchema,
325
371
  NoneAuthDataSchema
326
372
  ]);
327
- var LegacyVistaAuthSchema = z11.object({
328
- driverId: z11.string(),
329
- cookie: z11.string()
373
+ var LegacyVistaAuthSchema = z13.object({
374
+ driverId: z13.string(),
375
+ cookie: z13.string()
330
376
  });
331
377
  function serializeAuthData(data) {
332
378
  if (data.kind === "none") {
@@ -362,46 +408,46 @@ function deserializeAuthData(authToken) {
362
408
  }
363
409
 
364
410
  // src/browser-auth.ts
365
- import { z as z12 } from "zod";
366
- var CapturedTrafficEntrySchema = z12.object({
367
- method: z12.string(),
368
- url: z12.string(),
369
- status: z12.number(),
370
- responseBody: z12.string().optional()
411
+ import { z as z14 } from "zod";
412
+ var CapturedTrafficEntrySchema = z14.object({
413
+ method: z14.string(),
414
+ url: z14.string(),
415
+ status: z14.number(),
416
+ responseBody: z14.string().optional()
371
417
  });
372
- var BrowserAuthRequestSchema = z12.object({
373
- providerStub: z12.string(),
374
- providerUrl: z12.string(),
375
- username: z12.string(),
376
- encryptedPassword: z12.string(),
377
- captureTraffic: z12.boolean().optional()
418
+ var BrowserAuthRequestSchema = z14.object({
419
+ providerStub: z14.string(),
420
+ providerUrl: z14.string(),
421
+ username: z14.string(),
422
+ encryptedPassword: z14.string(),
423
+ captureTraffic: z14.boolean().optional()
378
424
  });
379
- var BrowserAuthSuccessSchema = z12.object({
380
- success: z12.literal(true),
425
+ var BrowserAuthSuccessSchema = z14.object({
426
+ success: z14.literal(true),
381
427
  authData: ProviderAuthDataSchema,
382
- capturedTraffic: z12.array(CapturedTrafficEntrySchema).optional()
428
+ capturedTraffic: z14.array(CapturedTrafficEntrySchema).optional()
383
429
  });
384
- var BrowserAuthFailureSchema = z12.object({
385
- success: z12.literal(false),
386
- error: z12.string()
430
+ var BrowserAuthFailureSchema = z14.object({
431
+ success: z14.literal(false),
432
+ error: z14.string()
387
433
  });
388
- var BrowserAuthResponseSchema = z12.discriminatedUnion("success", [
434
+ var BrowserAuthResponseSchema = z14.discriminatedUnion("success", [
389
435
  BrowserAuthSuccessSchema,
390
436
  BrowserAuthFailureSchema
391
437
  ]);
392
- var CrawlPageSchema = z12.object({
393
- url: z12.string(),
394
- html: z12.string()
438
+ var CrawlPageSchema = z14.object({
439
+ url: z14.string(),
440
+ html: z14.string()
395
441
  });
396
- var BrowserCrawlSuccessSchema = z12.object({
397
- success: z12.literal(true),
398
- pages: z12.array(CrawlPageSchema)
442
+ var BrowserCrawlSuccessSchema = z14.object({
443
+ success: z14.literal(true),
444
+ pages: z14.array(CrawlPageSchema)
399
445
  });
400
- var BrowserCrawlFailureSchema = z12.object({
401
- success: z12.literal(false),
402
- error: z12.string()
446
+ var BrowserCrawlFailureSchema = z14.object({
447
+ success: z14.literal(false),
448
+ error: z14.string()
403
449
  });
404
- var BrowserCrawlResponseSchema = z12.discriminatedUnion("success", [
450
+ var BrowserCrawlResponseSchema = z14.discriminatedUnion("success", [
405
451
  BrowserCrawlSuccessSchema,
406
452
  BrowserCrawlFailureSchema
407
453
  ]);
@@ -455,7 +501,6 @@ export {
455
501
  ListDriversRequestSchema,
456
502
  ListDriversResponseSchema,
457
503
  ManualBatchEntrySchema,
458
- ManualBatchRequestSchema,
459
504
  ManualBatchResponseSchema,
460
505
  ManualBatchTelemetrySchema,
461
506
  MockAuthDataSchema,
@@ -473,6 +518,8 @@ export {
473
518
  PatchDriverDriverResponseSchema,
474
519
  PatchDriverRequestSchema,
475
520
  PatchDriverResponseSchema,
521
+ PostDailySummaryRecordSchema,
522
+ PostDailySummaryRequestSchema,
476
523
  PostDriverTripTelemetryRecordSchema,
477
524
  PostDriverTripTelemetryRequestSchema,
478
525
  ProviderAuthDataSchema,
@@ -483,6 +530,8 @@ export {
483
530
  StateHeatmapResponseSchema,
484
531
  TruckTypeSchema,
485
532
  UpdateScrapeStatusMessage,
533
+ ValidateLoginRequestSchema,
534
+ ValidateLoginResponseSchema,
486
535
  ValidatePasswordRequestSchema,
487
536
  ValidatePasswordResponseSchema,
488
537
  VistaAuthDataSchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@findatruck/shared-schemas",
3
- "version": "2.23.0",
3
+ "version": "2.23.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",