@findatruck/shared-schemas 2.20.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
@@ -6,6 +6,8 @@ import {
6
6
  ConvexUpdateSchema,
7
7
  DRIVER_NAME_FORBIDDEN_CHAR_PATTERN,
8
8
  DriverNameSchema,
9
+ ListDriversRequestSchema,
10
+ ListDriversResponseSchema,
9
11
  NewLoginRequest,
10
12
  NewLoginRequestSchema,
11
13
  NewLoginResponse,
@@ -25,7 +27,7 @@ import {
25
27
  UpdateScrapeStatusMessage,
26
28
  ValidatePasswordRequestSchema,
27
29
  ValidatePasswordResponseSchema
28
- } from "./chunk-P4S46OZI.js";
30
+ } from "./chunk-EQIUGAWW.js";
29
31
 
30
32
  // src/schemas/drivers/anonymous-driver.ts
31
33
  import z from "zod";
@@ -47,192 +49,330 @@ var DeleteAnonymousDriverResponseSchema = z.object({
47
49
  user_id: z.string()
48
50
  });
49
51
 
50
- // src/schemas/providerAccounts/delete-provider-account.ts
52
+ // src/schemas/providerAccounts/validate-login.ts
51
53
  import { z as z2 } from "zod";
52
- var DeleteProviderAccountRequestSchema = z2.object({
53
- 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")
54
78
  }).describe("Request schema for deleting a provider account");
55
- var DeleteProviderAccountResponseSchema = z2.object({
56
- 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")
57
81
  }).describe("Response schema for provider account deletion");
58
82
 
59
83
  // src/schemas/telemetry/driver-rankings.ts
60
- import { z as z3 } from "zod";
61
- var DriverRankingsRequestSchema = z3.object({
62
- start_date: z3.string().describe("Start date for the ranking period (ISO 8601 format)"),
63
- end_date: z3.string().describe("End date for the ranking period (ISO 8601 format)"),
64
- state: z3.string().length(2).optional().describe("Optional 2-letter state abbreviation to filter telemetry by location"),
65
- 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")
66
90
  }).describe("Request schema for driver rankings by miles driven");
67
- var DriverRankingSchema = z3.object({
68
- rank: z3.number().int().positive().describe("Rank position based on miles driven"),
69
- driver_id: z3.string().uuid().describe("Unique identifier of the driver"),
70
- driver_name: z3.string().describe("Name of the driver"),
71
- 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")
72
96
  }).describe("Single driver ranking entry");
73
- 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");
74
98
 
75
99
  // src/schemas/telemetry/state-heatmap.ts
76
- import { z as z4 } from "zod";
77
- var StateHeatmapRequestSchema = z4.object({
78
- driver_id: z4.string().uuid().describe("Unique identifier of the driver"),
79
- start_date: z4.string().describe("Start date for the heatmap period (ISO 8601 format)"),
80
- 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)")
81
105
  }).describe("Request schema for driver state heatmap");
82
- var StateHeatmapEntrySchema = z4.object({
83
- count: z4.number().int().min(0).describe("Number of telemetry points in this state"),
84
- 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")
85
109
  }).describe("Single state entry in the heatmap");
86
- var StateHeatmapResponseSchema = z4.record(
87
- z4.string().length(2),
110
+ var StateHeatmapResponseSchema = z5.record(
111
+ z5.string().length(2),
88
112
  StateHeatmapEntrySchema
89
113
  ).describe("Record of 2-letter state codes to heatmap entries");
90
114
 
91
115
  // src/schemas/telemetry/manual-batch.ts
92
- import { z as z5 } from "zod";
93
- var ManualBatchEntrySchema = z5.object({
94
- driver_id: z5.string().uuid().describe("Internal UUID of the driver"),
95
- timestamp: z5.string().datetime().describe("Timestamp of the GPS reading (ISO 8601 format)"),
96
- location_latitude: z5.number().min(-90).max(90).describe("GPS latitude coordinate"),
97
- location_longitude: z5.number().min(-180).max(180).describe("GPS longitude coordinate"),
98
- location_address: z5.string().optional().describe("Optional human-readable address"),
99
- vehicle_odometer_miles: z5.number().min(0).optional().describe("Optional vehicle odometer reading in miles"),
100
- heading: z5.number().min(0).max(360).optional().describe("Optional GPS heading in degrees (0-360)"),
101
- speed_mph: z5.number().min(0).optional().describe("Optional GPS speed in miles per hour"),
102
- altitude_feet: z5.number().optional().describe("Optional GPS altitude in feet"),
103
- raw: z5.record(z5.string(), z5.unknown()).optional().describe("Optional raw upstream JSON payload to archive alongside this entry"),
104
- driving_status: z5.enum(["parked", "driving"]).optional().describe("Optional parked/driving status reported by the upstream system")
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)")
105
131
  }).describe("Single manual telemetry entry");
106
- var ManualBatchRequestSchema = z5.object({
107
- entries: z5.array(ManualBatchEntrySchema).min(1).max(1e3).describe("Array of manual telemetry entries (1-1000)")
108
- }).describe("Request schema for manual batch telemetry insertion");
109
- var ManualBatchTelemetrySchema = z5.object({
110
- id: z5.number().int().describe("Telemetry record ID"),
111
- driver_id: z5.string().uuid().describe("Internal UUID of the driver"),
112
- timestamp: z5.union([z5.string(), z5.date()]).describe("Timestamp of the telemetry reading"),
113
- remaining_drive_time_in_seconds: z5.number().min(0),
114
- remaining_shift_time_in_seconds: z5.number().min(0),
115
- remaining_cycle_time_in_seconds: z5.number().min(0),
116
- remaining_break_time_in_seconds: z5.number().min(0),
117
- location_latitude: z5.number().min(-90).max(90),
118
- location_longitude: z5.number().min(-180).max(180),
119
- previous_location_latitude: z5.number().min(-90).max(90).nullable(),
120
- previous_location_longitude: z5.number().min(-180).max(180).nullable(),
121
- location_address: z5.string().nullable(),
122
- location_state: z5.string().length(2).nullable(),
123
- echoed_odometer_miles: z5.number().min(0).nullable().describe("Vehicle odometer reading echoed back from the request (miles)"),
124
- osrm_calculated_miles: z5.number().min(0).nullable().describe("Road distance calculated by OSRM between this point and the previous point (miles)"),
125
- heading: z5.number().nullish(),
126
- speed_mph: z5.number().nullish(),
127
- altitude_feet: z5.number().nullish(),
128
- source: z5.enum(["eld", "manual"]),
129
- driving_status: z5.enum(["parked", "driving"]).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()
130
155
  }).describe("Telemetry record returned from manual batch insertion");
131
- var ManualBatchResponseSchema = z5.object({
132
- message: z5.string().describe("Success message"),
133
- inserted_count: z5.number().int().min(0).describe("Number of telemetry entries inserted"),
134
- 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")
135
160
  }).describe("Response schema for manual batch telemetry insertion");
136
161
 
162
+ // src/schemas/telemetry/bggeo-batch.ts
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()
176
+ }).describe("BGGeo coords object");
177
+ var BGGeoActivitySchema = z7.object({
178
+ type: z7.string(),
179
+ confidence: z7.number()
180
+ }).describe("BGGeo activity recognition");
181
+ var BGGeoBatterySchema = z7.object({
182
+ is_charging: z7.boolean(),
183
+ level: z7.number()
184
+ }).describe("BGGeo battery status");
185
+ var BGGeoLocationSchema = z7.object({
186
+ coords: BGGeoCoordsSchema,
187
+ extras: z7.object({}).passthrough().optional(),
188
+ activity: BGGeoActivitySchema.optional(),
189
+ battery: BGGeoBatterySchema.optional(),
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")
199
+ }).passthrough().describe("Single BGGeo location object");
200
+ var locationArray = z7.array(BGGeoLocationSchema).min(1).max(1e3).describe("Array of BGGeo location objects (1-1000)");
201
+ var locationOrArray = z7.union([
202
+ BGGeoLocationSchema.transform((loc) => [loc]),
203
+ locationArray
204
+ ]);
205
+ var BGGeoBatchRequestSchema = z7.object({
206
+ location: locationOrArray.optional(),
207
+ locations: locationOrArray.optional()
208
+ }).refine((data) => data.location ?? data.locations, {
209
+ message: "Either 'location' or 'locations' must be provided"
210
+ }).describe("Request schema for BGGeo batch telemetry ingestion");
211
+
137
212
  // src/schemas/trips/driver-trips.ts
138
- import { z as z6 } from "zod";
139
- var DriverTripsRequestSchema = z6.object({
140
- driver_id: z6.string().uuid(),
141
- start_date: z6.string(),
213
+ import { z as z8 } from "zod";
214
+ var DriverTripsRequestSchema = z8.object({
215
+ driver_id: z8.string().uuid(),
216
+ start_date: z8.string(),
142
217
  // YYYY-MM-DD
143
- end_date: z6.string()
218
+ end_date: z8.string()
144
219
  // YYYY-MM-DD
145
220
  });
146
- var DriverTripSchema = z6.object({
147
- id: z6.number(),
148
- start_time: z6.string(),
149
- end_time: z6.string(),
150
- point_count: z6.number(),
151
- polyline: z6.string().nullable(),
152
- highways: z6.array(z6.string()).nullable(),
153
- total_miles: z6.number().nullable(),
154
- avg_speed_mph: z6.number().nullable(),
155
- miles_by_weather: z6.record(z6.string(), z6.number()).nullable(),
156
- miles_by_light: z6.record(z6.string(), z6.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()
157
232
  });
158
- var DriverTripsResponseSchema = z6.array(DriverTripSchema);
159
- var DriverDailySummarySchema = z6.object({
160
- summary_date: z6.string(),
161
- total_miles: z6.number(),
162
- trip_count: z6.number(),
163
- point_count: z6.number(),
164
- polyline: z6.string().nullable(),
165
- highways: z6.array(z6.string()).nullable(),
166
- avg_speed_mph: z6.number().nullable(),
167
- miles_by_weather: z6.record(z6.string(), z6.number()).nullable(),
168
- miles_by_light: z6.record(z6.string(), z6.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()
169
244
  });
170
- var DriverDailySummariesResponseSchema = z6.array(DriverDailySummarySchema);
245
+ var DriverDailySummariesResponseSchema = z8.array(DriverDailySummarySchema);
171
246
 
172
247
  // src/schemas/trips/enriched-trip-summary.ts
173
- import { z as z7 } from "zod";
174
- var EnrichedTripSummaryRequestSchema = z7.object({
175
- trip_id: z7.number()
248
+ import { z as z9 } from "zod";
249
+ var EnrichedTripSummaryRequestSchema = z9.object({
250
+ trip_id: z9.number()
176
251
  });
177
- var DriverEnrichedSummariesRequestSchema = z7.object({
178
- driver_id: z7.string().uuid(),
179
- start_date: z7.string(),
180
- end_date: z7.string()
252
+ var DriverEnrichedSummariesRequestSchema = z9.object({
253
+ driver_id: z9.string().uuid(),
254
+ start_date: z9.string(),
255
+ end_date: z9.string()
181
256
  });
182
- var EnrichedStopSchema = z7.object({
183
- duration_seconds: z7.number()
257
+ var EnrichedStopSchema = z9.object({
258
+ duration_seconds: z9.number()
184
259
  });
185
- var EnrichedPointSchema = z7.object({
186
- lat: z7.number(),
187
- lon: z7.number(),
188
- timestamp: z7.string(),
189
- speed_mph: z7.number().nullable(),
190
- heading: z7.number().nullable(),
191
- altitude_feet: z7.number().nullable(),
192
- weather_condition: z7.string().nullable(),
193
- temperature_f: z7.number().nullable(),
194
- visibility_miles: z7.number().nullable(),
195
- light_condition: z7.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(),
196
271
  stop: EnrichedStopSchema.nullable()
197
272
  });
198
- var EnrichedTripSummarySchema = z7.object({
199
- trip_id: z7.number(),
200
- driver_id: z7.string(),
201
- start_time: z7.string(),
202
- end_time: z7.string(),
203
- points: z7.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)
204
279
  });
205
280
  var EnrichedTripSummaryResponseSchema = EnrichedTripSummarySchema;
206
- var DriverEnrichedSummariesResponseSchema = z7.array(EnrichedTripSummarySchema);
281
+ var DriverEnrichedSummariesResponseSchema = z9.array(EnrichedTripSummarySchema);
282
+
283
+ // src/schemas/trips/convex-driver-trip.ts
284
+ import { z as z10 } from "zod";
285
+ var ConvexBreadcrumbEventSchema = z10.object({
286
+ ts: z10.number(),
287
+ // epoch ms
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()
295
+ });
296
+ var ConvexDriverTripRequestSchema = z10.object({
297
+ userId: z10.string(),
298
+ breadcrumbs: z10.array(ConvexBreadcrumbEventSchema).min(1)
299
+ });
300
+
301
+ // src/schemas/trips/post-driver-trip-telemetry.ts
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)
319
+ });
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)
346
+ });
207
347
 
208
348
  // src/auth-data.ts
209
- import { z as z8 } from "zod";
210
- var GomotiveAuthDataSchema = z8.object({
211
- kind: z8.literal("gomotive"),
212
- token: z8.string(),
213
- ownerOperator: z8.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()
214
354
  });
215
- var VistaAuthDataSchema = z8.object({
216
- kind: z8.literal("vista"),
217
- driverId: z8.string(),
218
- cookie: z8.string()
355
+ var VistaAuthDataSchema = z13.object({
356
+ kind: z13.literal("vista"),
357
+ driverId: z13.string(),
358
+ cookie: z13.string()
219
359
  });
220
- var MockAuthDataSchema = z8.object({
221
- kind: z8.literal("mock"),
222
- cookie: z8.string()
360
+ var MockAuthDataSchema = z13.object({
361
+ kind: z13.literal("mock"),
362
+ cookie: z13.string()
223
363
  });
224
- var NoneAuthDataSchema = z8.object({
225
- kind: z8.literal("none")
364
+ var NoneAuthDataSchema = z13.object({
365
+ kind: z13.literal("none")
226
366
  });
227
- var ProviderAuthDataSchema = z8.discriminatedUnion("kind", [
367
+ var ProviderAuthDataSchema = z13.discriminatedUnion("kind", [
228
368
  GomotiveAuthDataSchema,
229
369
  VistaAuthDataSchema,
230
370
  MockAuthDataSchema,
231
371
  NoneAuthDataSchema
232
372
  ]);
233
- var LegacyVistaAuthSchema = z8.object({
234
- driverId: z8.string(),
235
- cookie: z8.string()
373
+ var LegacyVistaAuthSchema = z13.object({
374
+ driverId: z13.string(),
375
+ cookie: z13.string()
236
376
  });
237
377
  function serializeAuthData(data) {
238
378
  if (data.kind === "none") {
@@ -268,52 +408,57 @@ function deserializeAuthData(authToken) {
268
408
  }
269
409
 
270
410
  // src/browser-auth.ts
271
- import { z as z9 } from "zod";
272
- var CapturedTrafficEntrySchema = z9.object({
273
- method: z9.string(),
274
- url: z9.string(),
275
- status: z9.number(),
276
- responseBody: z9.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()
277
417
  });
278
- var BrowserAuthRequestSchema = z9.object({
279
- providerStub: z9.string(),
280
- providerUrl: z9.string(),
281
- username: z9.string(),
282
- encryptedPassword: z9.string(),
283
- captureTraffic: z9.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()
284
424
  });
285
- var BrowserAuthSuccessSchema = z9.object({
286
- success: z9.literal(true),
425
+ var BrowserAuthSuccessSchema = z14.object({
426
+ success: z14.literal(true),
287
427
  authData: ProviderAuthDataSchema,
288
- capturedTraffic: z9.array(CapturedTrafficEntrySchema).optional()
428
+ capturedTraffic: z14.array(CapturedTrafficEntrySchema).optional()
289
429
  });
290
- var BrowserAuthFailureSchema = z9.object({
291
- success: z9.literal(false),
292
- error: z9.string()
430
+ var BrowserAuthFailureSchema = z14.object({
431
+ success: z14.literal(false),
432
+ error: z14.string()
293
433
  });
294
- var BrowserAuthResponseSchema = z9.discriminatedUnion("success", [
434
+ var BrowserAuthResponseSchema = z14.discriminatedUnion("success", [
295
435
  BrowserAuthSuccessSchema,
296
436
  BrowserAuthFailureSchema
297
437
  ]);
298
- var CrawlPageSchema = z9.object({
299
- url: z9.string(),
300
- html: z9.string()
438
+ var CrawlPageSchema = z14.object({
439
+ url: z14.string(),
440
+ html: z14.string()
301
441
  });
302
- var BrowserCrawlSuccessSchema = z9.object({
303
- success: z9.literal(true),
304
- pages: z9.array(CrawlPageSchema)
442
+ var BrowserCrawlSuccessSchema = z14.object({
443
+ success: z14.literal(true),
444
+ pages: z14.array(CrawlPageSchema)
305
445
  });
306
- var BrowserCrawlFailureSchema = z9.object({
307
- success: z9.literal(false),
308
- error: z9.string()
446
+ var BrowserCrawlFailureSchema = z14.object({
447
+ success: z14.literal(false),
448
+ error: z14.string()
309
449
  });
310
- var BrowserCrawlResponseSchema = z9.discriminatedUnion("success", [
450
+ var BrowserCrawlResponseSchema = z14.discriminatedUnion("success", [
311
451
  BrowserCrawlSuccessSchema,
312
452
  BrowserCrawlFailureSchema
313
453
  ]);
314
454
  export {
315
455
  AnonymousDriverErrorResponseSchema,
316
456
  AnonymousDriverResponseSchema,
457
+ BGGeoActivitySchema,
458
+ BGGeoBatchRequestSchema,
459
+ BGGeoBatterySchema,
460
+ BGGeoCoordsSchema,
461
+ BGGeoLocationSchema,
317
462
  BatchConvexUpdate,
318
463
  BatchConvexUpdateSchema,
319
464
  BrowserAuthFailureSchema,
@@ -324,7 +469,9 @@ export {
324
469
  BrowserCrawlResponseSchema,
325
470
  BrowserCrawlSuccessSchema,
326
471
  CapturedTrafficEntrySchema,
472
+ ConvexBreadcrumbEventSchema,
327
473
  ConvexDriverSchema,
474
+ ConvexDriverTripRequestSchema,
328
475
  ConvexUpdate,
329
476
  ConvexUpdateSchema,
330
477
  CrawlPageSchema,
@@ -351,8 +498,9 @@ export {
351
498
  EnrichedTripSummaryResponseSchema,
352
499
  EnrichedTripSummarySchema,
353
500
  GomotiveAuthDataSchema,
501
+ ListDriversRequestSchema,
502
+ ListDriversResponseSchema,
354
503
  ManualBatchEntrySchema,
355
- ManualBatchRequestSchema,
356
504
  ManualBatchResponseSchema,
357
505
  ManualBatchTelemetrySchema,
358
506
  MockAuthDataSchema,
@@ -370,6 +518,10 @@ export {
370
518
  PatchDriverDriverResponseSchema,
371
519
  PatchDriverRequestSchema,
372
520
  PatchDriverResponseSchema,
521
+ PostDailySummaryRecordSchema,
522
+ PostDailySummaryRequestSchema,
523
+ PostDriverTripTelemetryRecordSchema,
524
+ PostDriverTripTelemetryRequestSchema,
373
525
  ProviderAuthDataSchema,
374
526
  ScrapeStatus,
375
527
  SharedDriverResponseSchema,
@@ -378,6 +530,8 @@ export {
378
530
  StateHeatmapResponseSchema,
379
531
  TruckTypeSchema,
380
532
  UpdateScrapeStatusMessage,
533
+ ValidateLoginRequestSchema,
534
+ ValidateLoginResponseSchema,
381
535
  ValidatePasswordRequestSchema,
382
536
  ValidatePasswordResponseSchema,
383
537
  VistaAuthDataSchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@findatruck/shared-schemas",
3
- "version": "2.20.0",
3
+ "version": "2.23.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",