@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.cjs CHANGED
@@ -32,6 +32,11 @@ var index_exports = {};
32
32
  __export(index_exports, {
33
33
  AnonymousDriverErrorResponseSchema: () => AnonymousDriverErrorResponseSchema,
34
34
  AnonymousDriverResponseSchema: () => AnonymousDriverResponseSchema,
35
+ BGGeoActivitySchema: () => BGGeoActivitySchema,
36
+ BGGeoBatchRequestSchema: () => BGGeoBatchRequestSchema,
37
+ BGGeoBatterySchema: () => BGGeoBatterySchema,
38
+ BGGeoCoordsSchema: () => BGGeoCoordsSchema,
39
+ BGGeoLocationSchema: () => BGGeoLocationSchema,
35
40
  BatchConvexUpdate: () => BatchConvexUpdate,
36
41
  BatchConvexUpdateSchema: () => BatchConvexUpdateSchema,
37
42
  BrowserAuthFailureSchema: () => BrowserAuthFailureSchema,
@@ -42,7 +47,9 @@ __export(index_exports, {
42
47
  BrowserCrawlResponseSchema: () => BrowserCrawlResponseSchema,
43
48
  BrowserCrawlSuccessSchema: () => BrowserCrawlSuccessSchema,
44
49
  CapturedTrafficEntrySchema: () => CapturedTrafficEntrySchema,
50
+ ConvexBreadcrumbEventSchema: () => ConvexBreadcrumbEventSchema,
45
51
  ConvexDriverSchema: () => ConvexDriverSchema,
52
+ ConvexDriverTripRequestSchema: () => ConvexDriverTripRequestSchema,
46
53
  ConvexUpdate: () => ConvexUpdate,
47
54
  ConvexUpdateSchema: () => ConvexUpdateSchema,
48
55
  CrawlPageSchema: () => CrawlPageSchema,
@@ -69,8 +76,9 @@ __export(index_exports, {
69
76
  EnrichedTripSummaryResponseSchema: () => EnrichedTripSummaryResponseSchema,
70
77
  EnrichedTripSummarySchema: () => EnrichedTripSummarySchema,
71
78
  GomotiveAuthDataSchema: () => GomotiveAuthDataSchema,
79
+ ListDriversRequestSchema: () => ListDriversRequestSchema,
80
+ ListDriversResponseSchema: () => ListDriversResponseSchema,
72
81
  ManualBatchEntrySchema: () => ManualBatchEntrySchema,
73
- ManualBatchRequestSchema: () => ManualBatchRequestSchema,
74
82
  ManualBatchResponseSchema: () => ManualBatchResponseSchema,
75
83
  ManualBatchTelemetrySchema: () => ManualBatchTelemetrySchema,
76
84
  MockAuthDataSchema: () => MockAuthDataSchema,
@@ -88,6 +96,10 @@ __export(index_exports, {
88
96
  PatchDriverDriverResponseSchema: () => PatchDriverDriverResponseSchema,
89
97
  PatchDriverRequestSchema: () => PatchDriverRequestSchema,
90
98
  PatchDriverResponseSchema: () => PatchDriverResponseSchema,
99
+ PostDailySummaryRecordSchema: () => PostDailySummaryRecordSchema,
100
+ PostDailySummaryRequestSchema: () => PostDailySummaryRequestSchema,
101
+ PostDriverTripTelemetryRecordSchema: () => PostDriverTripTelemetryRecordSchema,
102
+ PostDriverTripTelemetryRequestSchema: () => PostDriverTripTelemetryRequestSchema,
91
103
  ProviderAuthDataSchema: () => ProviderAuthDataSchema,
92
104
  ScrapeStatus: () => ScrapeStatus,
93
105
  SharedDriverResponseSchema: () => SharedDriverResponseSchema,
@@ -96,6 +108,8 @@ __export(index_exports, {
96
108
  StateHeatmapResponseSchema: () => StateHeatmapResponseSchema,
97
109
  TruckTypeSchema: () => TruckTypeSchema,
98
110
  UpdateScrapeStatusMessage: () => UpdateScrapeStatusMessage,
111
+ ValidateLoginRequestSchema: () => ValidateLoginRequestSchema,
112
+ ValidateLoginResponseSchema: () => ValidateLoginResponseSchema,
99
113
  ValidatePasswordRequestSchema: () => ValidatePasswordRequestSchema,
100
114
  ValidatePasswordResponseSchema: () => ValidatePasswordResponseSchema,
101
115
  VistaAuthDataSchema: () => VistaAuthDataSchema,
@@ -230,7 +244,7 @@ var SharedDriverResponseSchema = import_zod4.default.object({
230
244
  // because providers emit non-UUID identifiers there.
231
245
  id: import_zod4.default.uuid(),
232
246
  name: import_zod4.default.string(),
233
- eld_external_id: import_zod4.default.string(),
247
+ eld_external_id: import_zod4.default.string().nullable(),
234
248
  license_number: import_zod4.default.string().nullable(),
235
249
  license_state: import_zod4.default.string().nullable(),
236
250
  license_expiration_date: import_zod4.default.string().nullable(),
@@ -239,6 +253,7 @@ var SharedDriverResponseSchema = import_zod4.default.object({
239
253
  created_at: import_zod4.default.union([import_zod4.default.string(), import_zod4.default.date()]),
240
254
  updated_at: import_zod4.default.union([import_zod4.default.string(), import_zod4.default.date()]),
241
255
  truck_type: import_zod4.default.string().nullable(),
256
+ honk_user_id: import_zod4.default.string().nullable(),
242
257
  last_location_latitude: import_zod4.default.number().nullable(),
243
258
  last_location_longitude: import_zod4.default.number().nullable()
244
259
  });
@@ -279,10 +294,14 @@ var DriverNameSchema = import_zod5.default.string().trim().min(1).max(PATCH_DRIV
279
294
  );
280
295
  var TruckTypeSchema = import_zod5.default.string().trim().min(1).max(PATCH_DRIVER_TRUCK_TYPE_MAX_LENGTH);
281
296
  var PatchDriverRequestSchema = import_zod5.default.object({
282
- driver_id: import_zod5.default.uuid(),
297
+ driver_id: import_zod5.default.uuid().optional(),
298
+ honk_user_id: import_zod5.default.string().min(1).max(255).optional(),
283
299
  name: DriverNameSchema.optional(),
284
300
  truck_type: TruckTypeSchema.nullable().optional()
285
301
  }).refine(
302
+ (d) => d.driver_id !== void 0 !== (d.honk_user_id !== void 0),
303
+ { message: "Exactly one of driver_id or honk_user_id must be provided" }
304
+ ).refine(
286
305
  (d) => d.name !== void 0 || d.truck_type !== void 0,
287
306
  { message: "At least one of name or truck_type must be provided" }
288
307
  );
@@ -300,8 +319,17 @@ var PatchDriverResponseSchema = import_zod5.default.object({
300
319
  driver: PatchDriverDriverResponseSchema
301
320
  });
302
321
 
303
- // src/schemas/providerAccounts/update-status.ts
322
+ // src/schemas/drivers/list-drivers.ts
304
323
  var import_zod6 = __toESM(require("zod"), 1);
324
+ var ListDriversRequestSchema = import_zod6.default.object({
325
+ name: import_zod6.default.string().optional()
326
+ });
327
+ var ListDriversResponseSchema = import_zod6.default.object({
328
+ drivers: import_zod6.default.array(SharedDriverResponseSchema)
329
+ });
330
+
331
+ // src/schemas/providerAccounts/update-status.ts
332
+ var import_zod7 = __toESM(require("zod"), 1);
305
333
  var ScrapeStatus = /* @__PURE__ */ ((ScrapeStatus2) => {
306
334
  ScrapeStatus2["NEW_LOGIN_RECEIVED"] = "NEW_LOGIN_RECEIVED";
307
335
  ScrapeStatus2["LOGIN_IN_PROGRESS"] = "LOGIN_IN_PROGRESS";
@@ -314,213 +342,351 @@ var ScrapeStatus = /* @__PURE__ */ ((ScrapeStatus2) => {
314
342
  ScrapeStatus2["DATA_FETCH_FAILED"] = "DATA_FETCH_FAILED";
315
343
  return ScrapeStatus2;
316
344
  })(ScrapeStatus || {});
317
- var UpdateScrapeStatusMessage = import_zod6.default.object({
318
- status: import_zod6.default.nativeEnum(ScrapeStatus).describe("The current status of the scrape process"),
319
- correctPassword: import_zod6.default.boolean().optional().describe("Indicates if the provided password was correct, if applicable"),
320
- externalProviderAccountId: import_zod6.default.string().describe("The external identifier for the provider account (convex ID or similar)"),
321
- username: import_zod6.default.string().describe("The username of the provider account whose status is being updated"),
322
- provider_url: import_zod6.default.string().describe("The URL of the ELD provider"),
323
- driverCount: import_zod6.default.number().optional().describe("The number of drivers associated with the account, if applicable"),
324
- providerSlug: import_zod6.default.string().optional().describe("The slug identifier for the provider")
345
+ var UpdateScrapeStatusMessage = import_zod7.default.object({
346
+ status: import_zod7.default.nativeEnum(ScrapeStatus).describe("The current status of the scrape process"),
347
+ correctPassword: import_zod7.default.boolean().optional().describe("Indicates if the provided password was correct, if applicable"),
348
+ externalProviderAccountId: import_zod7.default.string().describe("The external identifier for the provider account (convex ID or similar)"),
349
+ username: import_zod7.default.string().describe("The username of the provider account whose status is being updated"),
350
+ provider_url: import_zod7.default.string().describe("The URL of the ELD provider"),
351
+ driverCount: import_zod7.default.number().optional().describe("The number of drivers associated with the account, if applicable"),
352
+ providerSlug: import_zod7.default.string().optional().describe("The slug identifier for the provider")
325
353
  }).describe("Schema for update status messages");
326
354
 
327
355
  // src/schemas/providerAccounts/validate-password.ts
328
- var import_zod7 = require("zod");
329
- var ValidatePasswordRequestSchema = import_zod7.z.object({
330
- providerAccountId: import_zod7.z.string().min(1).describe("The unique identifier of the provider account in postgres to validate the password for"),
331
- encryptedPassword: import_zod7.z.string().min(1).describe("The encrypted password to validate against the stored password")
356
+ var import_zod8 = require("zod");
357
+ var ValidatePasswordRequestSchema = import_zod8.z.object({
358
+ providerAccountId: import_zod8.z.string().min(1).describe("The unique identifier of the provider account in postgres to validate the password for"),
359
+ encryptedPassword: import_zod8.z.string().min(1).describe("The encrypted password to validate against the stored password")
332
360
  }).describe("Request schema for validating a provider account password");
333
- var ValidatePasswordResponseSchema = import_zod7.z.object({
334
- isValid: import_zod7.z.boolean().describe("Indicates if the provided password is valid"),
335
- driverIds: import_zod7.z.array(import_zod7.z.string()).describe("List of driver IDs associated with the provider account")
361
+ var ValidatePasswordResponseSchema = import_zod8.z.object({
362
+ isValid: import_zod8.z.boolean().describe("Indicates if the provided password is valid"),
363
+ driverIds: import_zod8.z.array(import_zod8.z.string()).describe("List of driver IDs associated with the provider account")
336
364
  }).describe("Response schema for password validation");
337
365
 
366
+ // src/schemas/providerAccounts/validate-login.ts
367
+ var import_zod9 = require("zod");
368
+ var UrlSchema3 = import_zod9.z.string().refine(
369
+ (val) => {
370
+ try {
371
+ new URL(val);
372
+ return true;
373
+ } catch {
374
+ return false;
375
+ }
376
+ },
377
+ { message: "Invalid URL" }
378
+ );
379
+ var ValidateLoginRequestSchema = import_zod9.z.object({
380
+ providerUrl: UrlSchema3.describe("The URL of the ELD provider to validate credentials against"),
381
+ username: import_zod9.z.string().min(1).describe("The username to validate"),
382
+ encryptedPassword: import_zod9.z.string().min(1).describe("The encrypted password to validate")
383
+ }).describe("Request schema for validating login credentials via browser auth");
384
+ var ValidateLoginResponseSchema = import_zod9.z.object({
385
+ success: import_zod9.z.boolean().describe("Indicates if the login credentials are valid")
386
+ }).describe("Response schema for login validation");
387
+
338
388
  // src/schemas/providerAccounts/delete-provider-account.ts
339
- var import_zod8 = require("zod");
340
- var DeleteProviderAccountRequestSchema = import_zod8.z.object({
341
- providerAccountId: import_zod8.z.string().min(1).describe("The external provider account ID to delete")
389
+ var import_zod10 = require("zod");
390
+ var DeleteProviderAccountRequestSchema = import_zod10.z.object({
391
+ providerAccountId: import_zod10.z.string().min(1).describe("The external provider account ID to delete")
342
392
  }).describe("Request schema for deleting a provider account");
343
- var DeleteProviderAccountResponseSchema = import_zod8.z.object({
344
- success: import_zod8.z.boolean().describe("Indicates if the provider account was successfully deleted")
393
+ var DeleteProviderAccountResponseSchema = import_zod10.z.object({
394
+ success: import_zod10.z.boolean().describe("Indicates if the provider account was successfully deleted")
345
395
  }).describe("Response schema for provider account deletion");
346
396
 
347
397
  // src/schemas/telemetry/driver-rankings.ts
348
- var import_zod9 = require("zod");
349
- var DriverRankingsRequestSchema = import_zod9.z.object({
350
- start_date: import_zod9.z.string().describe("Start date for the ranking period (ISO 8601 format)"),
351
- end_date: import_zod9.z.string().describe("End date for the ranking period (ISO 8601 format)"),
352
- state: import_zod9.z.string().length(2).optional().describe("Optional 2-letter state abbreviation to filter telemetry by location"),
353
- source: import_zod9.z.enum(["eld", "manual"]).default("manual").describe("Telemetry source to rank by: 'manual' uses GPS odometer, 'eld' uses calculated distance")
398
+ var import_zod11 = require("zod");
399
+ var DriverRankingsRequestSchema = import_zod11.z.object({
400
+ start_date: import_zod11.z.string().describe("Start date for the ranking period (ISO 8601 format)"),
401
+ end_date: import_zod11.z.string().describe("End date for the ranking period (ISO 8601 format)"),
402
+ state: import_zod11.z.string().length(2).optional().describe("Optional 2-letter state abbreviation to filter telemetry by location"),
403
+ source: import_zod11.z.enum(["eld", "manual"]).default("manual").describe("Telemetry source to rank by: 'manual' uses GPS odometer, 'eld' uses calculated distance")
354
404
  }).describe("Request schema for driver rankings by miles driven");
355
- var DriverRankingSchema = import_zod9.z.object({
356
- rank: import_zod9.z.number().int().positive().describe("Rank position based on miles driven"),
357
- driver_id: import_zod9.z.string().uuid().describe("Unique identifier of the driver"),
358
- driver_name: import_zod9.z.string().describe("Name of the driver"),
359
- total_miles: import_zod9.z.number().min(0).describe("Total miles driven in the specified period")
405
+ var DriverRankingSchema = import_zod11.z.object({
406
+ rank: import_zod11.z.number().int().positive().describe("Rank position based on miles driven"),
407
+ driver_id: import_zod11.z.string().uuid().describe("Unique identifier of the driver"),
408
+ driver_name: import_zod11.z.string().describe("Name of the driver"),
409
+ total_miles: import_zod11.z.number().min(0).describe("Total miles driven in the specified period")
360
410
  }).describe("Single driver ranking entry");
361
- var DriverRankingsResponseSchema = import_zod9.z.array(DriverRankingSchema).describe("Array of driver rankings sorted by miles driven in descending order");
411
+ var DriverRankingsResponseSchema = import_zod11.z.array(DriverRankingSchema).describe("Array of driver rankings sorted by miles driven in descending order");
362
412
 
363
413
  // src/schemas/telemetry/state-heatmap.ts
364
- var import_zod10 = require("zod");
365
- var StateHeatmapRequestSchema = import_zod10.z.object({
366
- driver_id: import_zod10.z.string().uuid().describe("Unique identifier of the driver"),
367
- start_date: import_zod10.z.string().describe("Start date for the heatmap period (ISO 8601 format)"),
368
- end_date: import_zod10.z.string().describe("End date for the heatmap period (ISO 8601 format)")
414
+ var import_zod12 = require("zod");
415
+ var StateHeatmapRequestSchema = import_zod12.z.object({
416
+ driver_id: import_zod12.z.string().uuid().describe("Unique identifier of the driver"),
417
+ start_date: import_zod12.z.string().describe("Start date for the heatmap period (ISO 8601 format)"),
418
+ end_date: import_zod12.z.string().describe("End date for the heatmap period (ISO 8601 format)")
369
419
  }).describe("Request schema for driver state heatmap");
370
- var StateHeatmapEntrySchema = import_zod10.z.object({
371
- count: import_zod10.z.number().int().min(0).describe("Number of telemetry points in this state"),
372
- percentage: import_zod10.z.number().min(0).max(100).describe("Percentage of total telemetry points in this state")
420
+ var StateHeatmapEntrySchema = import_zod12.z.object({
421
+ count: import_zod12.z.number().int().min(0).describe("Number of telemetry points in this state"),
422
+ percentage: import_zod12.z.number().min(0).max(100).describe("Percentage of total telemetry points in this state")
373
423
  }).describe("Single state entry in the heatmap");
374
- var StateHeatmapResponseSchema = import_zod10.z.record(
375
- import_zod10.z.string().length(2),
424
+ var StateHeatmapResponseSchema = import_zod12.z.record(
425
+ import_zod12.z.string().length(2),
376
426
  StateHeatmapEntrySchema
377
427
  ).describe("Record of 2-letter state codes to heatmap entries");
378
428
 
379
429
  // src/schemas/telemetry/manual-batch.ts
380
- var import_zod11 = require("zod");
381
- var ManualBatchEntrySchema = import_zod11.z.object({
382
- driver_id: import_zod11.z.string().uuid().describe("Internal UUID of the driver"),
383
- timestamp: import_zod11.z.string().datetime().describe("Timestamp of the GPS reading (ISO 8601 format)"),
384
- location_latitude: import_zod11.z.number().min(-90).max(90).describe("GPS latitude coordinate"),
385
- location_longitude: import_zod11.z.number().min(-180).max(180).describe("GPS longitude coordinate"),
386
- location_address: import_zod11.z.string().optional().describe("Optional human-readable address"),
387
- vehicle_odometer_miles: import_zod11.z.number().min(0).optional().describe("Optional vehicle odometer reading in miles"),
388
- heading: import_zod11.z.number().min(0).max(360).optional().describe("Optional GPS heading in degrees (0-360)"),
389
- speed_mph: import_zod11.z.number().min(0).optional().describe("Optional GPS speed in miles per hour"),
390
- altitude_feet: import_zod11.z.number().optional().describe("Optional GPS altitude in feet"),
391
- raw: import_zod11.z.record(import_zod11.z.string(), import_zod11.z.unknown()).optional().describe("Optional raw upstream JSON payload to archive alongside this entry"),
392
- driving_status: import_zod11.z.enum(["parked", "driving"]).optional().describe("Optional parked/driving status reported by the upstream system")
430
+ var import_zod13 = require("zod");
431
+ var ManualBatchEntrySchema = import_zod13.z.object({
432
+ driver_id: import_zod13.z.string().uuid().describe("Internal UUID of the driver"),
433
+ timestamp: import_zod13.z.string().datetime().describe("Timestamp of the GPS reading (ISO 8601 format)"),
434
+ location_latitude: import_zod13.z.number().min(-90).max(90).describe("GPS latitude coordinate"),
435
+ location_longitude: import_zod13.z.number().min(-180).max(180).describe("GPS longitude coordinate"),
436
+ location_address: import_zod13.z.string().optional().describe("Optional human-readable address"),
437
+ vehicle_odometer_miles: import_zod13.z.number().min(0).optional().describe("Optional vehicle odometer reading in miles"),
438
+ heading: import_zod13.z.number().min(0).max(360).optional().describe("Optional GPS heading in degrees (0-360)"),
439
+ speed_mph: import_zod13.z.number().min(0).optional().describe("Optional GPS speed in miles per hour"),
440
+ altitude_feet: import_zod13.z.number().optional().describe("Optional GPS altitude in feet"),
441
+ raw: import_zod13.z.record(import_zod13.z.string(), import_zod13.z.unknown()).optional().describe("Optional raw upstream JSON payload to archive alongside this entry"),
442
+ driving_status: import_zod13.z.enum(["parked", "driving"]).optional().describe("Optional parked/driving status reported by the upstream system"),
443
+ activity_type: import_zod13.z.string().optional().describe("Optional activity recognition type (e.g. 'in_vehicle', 'on_foot')"),
444
+ activity_confidence: import_zod13.z.number().int().min(0).max(100).optional().describe("Optional activity recognition confidence (0-100)")
393
445
  }).describe("Single manual telemetry entry");
394
- var ManualBatchRequestSchema = import_zod11.z.object({
395
- entries: import_zod11.z.array(ManualBatchEntrySchema).min(1).max(1e3).describe("Array of manual telemetry entries (1-1000)")
396
- }).describe("Request schema for manual batch telemetry insertion");
397
- var ManualBatchTelemetrySchema = import_zod11.z.object({
398
- id: import_zod11.z.number().int().describe("Telemetry record ID"),
399
- driver_id: import_zod11.z.string().uuid().describe("Internal UUID of the driver"),
400
- timestamp: import_zod11.z.union([import_zod11.z.string(), import_zod11.z.date()]).describe("Timestamp of the telemetry reading"),
401
- remaining_drive_time_in_seconds: import_zod11.z.number().min(0),
402
- remaining_shift_time_in_seconds: import_zod11.z.number().min(0),
403
- remaining_cycle_time_in_seconds: import_zod11.z.number().min(0),
404
- remaining_break_time_in_seconds: import_zod11.z.number().min(0),
405
- location_latitude: import_zod11.z.number().min(-90).max(90),
406
- location_longitude: import_zod11.z.number().min(-180).max(180),
407
- previous_location_latitude: import_zod11.z.number().min(-90).max(90).nullable(),
408
- previous_location_longitude: import_zod11.z.number().min(-180).max(180).nullable(),
409
- location_address: import_zod11.z.string().nullable(),
410
- location_state: import_zod11.z.string().length(2).nullable(),
411
- echoed_odometer_miles: import_zod11.z.number().min(0).nullable().describe("Vehicle odometer reading echoed back from the request (miles)"),
412
- osrm_calculated_miles: import_zod11.z.number().min(0).nullable().describe("Road distance calculated by OSRM between this point and the previous point (miles)"),
413
- heading: import_zod11.z.number().nullish(),
414
- speed_mph: import_zod11.z.number().nullish(),
415
- altitude_feet: import_zod11.z.number().nullish(),
416
- source: import_zod11.z.enum(["eld", "manual"]),
417
- driving_status: import_zod11.z.enum(["parked", "driving"]).nullable()
446
+ var ManualBatchTelemetrySchema = import_zod13.z.object({
447
+ id: import_zod13.z.number().int().describe("Telemetry record ID"),
448
+ driver_id: import_zod13.z.string().uuid().describe("Internal UUID of the driver"),
449
+ timestamp: import_zod13.z.union([import_zod13.z.string(), import_zod13.z.date()]).describe("Timestamp of the telemetry reading"),
450
+ remaining_drive_time_in_seconds: import_zod13.z.number().min(0),
451
+ remaining_shift_time_in_seconds: import_zod13.z.number().min(0),
452
+ remaining_cycle_time_in_seconds: import_zod13.z.number().min(0),
453
+ remaining_break_time_in_seconds: import_zod13.z.number().min(0),
454
+ location_latitude: import_zod13.z.number().min(-90).max(90),
455
+ location_longitude: import_zod13.z.number().min(-180).max(180),
456
+ previous_location_latitude: import_zod13.z.number().min(-90).max(90).nullable(),
457
+ previous_location_longitude: import_zod13.z.number().min(-180).max(180).nullable(),
458
+ location_address: import_zod13.z.string().nullable(),
459
+ location_state: import_zod13.z.string().length(2).nullable(),
460
+ echoed_odometer_miles: import_zod13.z.number().min(0).nullable().describe("Vehicle odometer reading echoed back from the request (miles)"),
461
+ osrm_calculated_miles: import_zod13.z.number().min(0).nullable().describe("Road distance calculated by OSRM between this point and the previous point (miles)"),
462
+ heading: import_zod13.z.number().nullish(),
463
+ speed_mph: import_zod13.z.number().nullish(),
464
+ altitude_feet: import_zod13.z.number().nullish(),
465
+ source: import_zod13.z.enum(["eld", "manual"]),
466
+ driving_status: import_zod13.z.enum(["parked", "driving"]).nullable(),
467
+ activity_type: import_zod13.z.string().nullable(),
468
+ activity_confidence: import_zod13.z.number().int().nullable()
418
469
  }).describe("Telemetry record returned from manual batch insertion");
419
- var ManualBatchResponseSchema = import_zod11.z.object({
420
- message: import_zod11.z.string().describe("Success message"),
421
- inserted_count: import_zod11.z.number().int().min(0).describe("Number of telemetry entries inserted"),
422
- telemetry: import_zod11.z.array(ManualBatchTelemetrySchema).describe("Array of inserted telemetry records")
470
+ var ManualBatchResponseSchema = import_zod13.z.object({
471
+ message: import_zod13.z.string().describe("Success message"),
472
+ inserted_count: import_zod13.z.number().int().min(0).describe("Number of telemetry entries inserted"),
473
+ telemetry: import_zod13.z.array(ManualBatchTelemetrySchema).describe("Array of inserted telemetry records")
423
474
  }).describe("Response schema for manual batch telemetry insertion");
424
475
 
476
+ // src/schemas/telemetry/bggeo-batch.ts
477
+ var import_zod14 = require("zod");
478
+ var BGGeoCoordsSchema = import_zod14.z.object({
479
+ latitude: import_zod14.z.number().min(-90).max(90),
480
+ longitude: import_zod14.z.number().min(-180).max(180),
481
+ accuracy: import_zod14.z.number().optional(),
482
+ speed: import_zod14.z.number().describe("Speed in m/s; -1 when unavailable"),
483
+ heading: import_zod14.z.number().describe("Heading in degrees; -1 when unavailable"),
484
+ altitude: import_zod14.z.number().describe("Altitude in meters"),
485
+ altitude_accuracy: import_zod14.z.number().optional(),
486
+ speed_accuracy: import_zod14.z.number().optional(),
487
+ heading_accuracy: import_zod14.z.number().optional(),
488
+ ellipsoidal_altitude: import_zod14.z.number().optional(),
489
+ floor: import_zod14.z.number().nullable().optional()
490
+ }).describe("BGGeo coords object");
491
+ var BGGeoActivitySchema = import_zod14.z.object({
492
+ type: import_zod14.z.string(),
493
+ confidence: import_zod14.z.number()
494
+ }).describe("BGGeo activity recognition");
495
+ var BGGeoBatterySchema = import_zod14.z.object({
496
+ is_charging: import_zod14.z.boolean(),
497
+ level: import_zod14.z.number()
498
+ }).describe("BGGeo battery status");
499
+ var BGGeoLocationSchema = import_zod14.z.object({
500
+ coords: BGGeoCoordsSchema,
501
+ extras: import_zod14.z.object({}).passthrough().optional(),
502
+ activity: BGGeoActivitySchema.optional(),
503
+ battery: BGGeoBatterySchema.optional(),
504
+ timestamp: import_zod14.z.string().datetime().describe("ISO 8601 timestamp"),
505
+ is_moving: import_zod14.z.boolean(),
506
+ odometer: import_zod14.z.number().min(0).describe("Odometer in meters"),
507
+ uuid: import_zod14.z.string().optional(),
508
+ event: import_zod14.z.string().optional(),
509
+ age: import_zod14.z.number().optional(),
510
+ geofence: import_zod14.z.record(import_zod14.z.string(), import_zod14.z.unknown()).optional(),
511
+ mock: import_zod14.z.boolean().optional(),
512
+ recorded_at: import_zod14.z.string().datetime().optional().describe("ISO 8601 device recording timestamp")
513
+ }).passthrough().describe("Single BGGeo location object");
514
+ var locationArray = import_zod14.z.array(BGGeoLocationSchema).min(1).max(1e3).describe("Array of BGGeo location objects (1-1000)");
515
+ var locationOrArray = import_zod14.z.union([
516
+ BGGeoLocationSchema.transform((loc) => [loc]),
517
+ locationArray
518
+ ]);
519
+ var BGGeoBatchRequestSchema = import_zod14.z.object({
520
+ location: locationOrArray.optional(),
521
+ locations: locationOrArray.optional()
522
+ }).refine((data) => data.location ?? data.locations, {
523
+ message: "Either 'location' or 'locations' must be provided"
524
+ }).describe("Request schema for BGGeo batch telemetry ingestion");
525
+
425
526
  // src/schemas/trips/driver-trips.ts
426
- var import_zod12 = require("zod");
427
- var DriverTripsRequestSchema = import_zod12.z.object({
428
- driver_id: import_zod12.z.string().uuid(),
429
- start_date: import_zod12.z.string(),
527
+ var import_zod15 = require("zod");
528
+ var DriverTripsRequestSchema = import_zod15.z.object({
529
+ driver_id: import_zod15.z.string().uuid(),
530
+ start_date: import_zod15.z.string(),
430
531
  // YYYY-MM-DD
431
- end_date: import_zod12.z.string()
532
+ end_date: import_zod15.z.string()
432
533
  // YYYY-MM-DD
433
534
  });
434
- var DriverTripSchema = import_zod12.z.object({
435
- id: import_zod12.z.number(),
436
- start_time: import_zod12.z.string(),
437
- end_time: import_zod12.z.string(),
438
- point_count: import_zod12.z.number(),
439
- polyline: import_zod12.z.string().nullable(),
440
- highways: import_zod12.z.array(import_zod12.z.string()).nullable(),
441
- total_miles: import_zod12.z.number().nullable(),
442
- avg_speed_mph: import_zod12.z.number().nullable(),
443
- miles_by_weather: import_zod12.z.record(import_zod12.z.string(), import_zod12.z.number()).nullable(),
444
- miles_by_light: import_zod12.z.record(import_zod12.z.string(), import_zod12.z.number()).nullable()
445
- });
446
- var DriverTripsResponseSchema = import_zod12.z.array(DriverTripSchema);
447
- var DriverDailySummarySchema = import_zod12.z.object({
448
- summary_date: import_zod12.z.string(),
449
- total_miles: import_zod12.z.number(),
450
- trip_count: import_zod12.z.number(),
451
- point_count: import_zod12.z.number(),
452
- polyline: import_zod12.z.string().nullable(),
453
- highways: import_zod12.z.array(import_zod12.z.string()).nullable(),
454
- avg_speed_mph: import_zod12.z.number().nullable(),
455
- miles_by_weather: import_zod12.z.record(import_zod12.z.string(), import_zod12.z.number()).nullable(),
456
- miles_by_light: import_zod12.z.record(import_zod12.z.string(), import_zod12.z.number()).nullable()
457
- });
458
- var DriverDailySummariesResponseSchema = import_zod12.z.array(DriverDailySummarySchema);
535
+ var DriverTripSchema = import_zod15.z.object({
536
+ id: import_zod15.z.number(),
537
+ start_time: import_zod15.z.string(),
538
+ end_time: import_zod15.z.string(),
539
+ point_count: import_zod15.z.number(),
540
+ polyline: import_zod15.z.string().nullable(),
541
+ highways: import_zod15.z.array(import_zod15.z.string()).nullable(),
542
+ total_miles: import_zod15.z.number().nullable(),
543
+ avg_speed_mph: import_zod15.z.number().nullable(),
544
+ miles_by_weather: import_zod15.z.record(import_zod15.z.string(), import_zod15.z.number()).nullable(),
545
+ miles_by_light: import_zod15.z.record(import_zod15.z.string(), import_zod15.z.number()).nullable()
546
+ });
547
+ var DriverTripsResponseSchema = import_zod15.z.array(DriverTripSchema);
548
+ var DriverDailySummarySchema = import_zod15.z.object({
549
+ summary_date: import_zod15.z.string(),
550
+ total_miles: import_zod15.z.number(),
551
+ trip_count: import_zod15.z.number(),
552
+ point_count: import_zod15.z.number(),
553
+ polyline: import_zod15.z.string().nullable(),
554
+ highways: import_zod15.z.array(import_zod15.z.string()).nullable(),
555
+ avg_speed_mph: import_zod15.z.number().nullable(),
556
+ miles_by_weather: import_zod15.z.record(import_zod15.z.string(), import_zod15.z.number()).nullable(),
557
+ miles_by_light: import_zod15.z.record(import_zod15.z.string(), import_zod15.z.number()).nullable()
558
+ });
559
+ var DriverDailySummariesResponseSchema = import_zod15.z.array(DriverDailySummarySchema);
459
560
 
460
561
  // src/schemas/trips/enriched-trip-summary.ts
461
- var import_zod13 = require("zod");
462
- var EnrichedTripSummaryRequestSchema = import_zod13.z.object({
463
- trip_id: import_zod13.z.number()
464
- });
465
- var DriverEnrichedSummariesRequestSchema = import_zod13.z.object({
466
- driver_id: import_zod13.z.string().uuid(),
467
- start_date: import_zod13.z.string(),
468
- end_date: import_zod13.z.string()
469
- });
470
- var EnrichedStopSchema = import_zod13.z.object({
471
- duration_seconds: import_zod13.z.number()
472
- });
473
- var EnrichedPointSchema = import_zod13.z.object({
474
- lat: import_zod13.z.number(),
475
- lon: import_zod13.z.number(),
476
- timestamp: import_zod13.z.string(),
477
- speed_mph: import_zod13.z.number().nullable(),
478
- heading: import_zod13.z.number().nullable(),
479
- altitude_feet: import_zod13.z.number().nullable(),
480
- weather_condition: import_zod13.z.string().nullable(),
481
- temperature_f: import_zod13.z.number().nullable(),
482
- visibility_miles: import_zod13.z.number().nullable(),
483
- light_condition: import_zod13.z.string().nullable(),
562
+ var import_zod16 = require("zod");
563
+ var EnrichedTripSummaryRequestSchema = import_zod16.z.object({
564
+ trip_id: import_zod16.z.number()
565
+ });
566
+ var DriverEnrichedSummariesRequestSchema = import_zod16.z.object({
567
+ driver_id: import_zod16.z.string().uuid(),
568
+ start_date: import_zod16.z.string(),
569
+ end_date: import_zod16.z.string()
570
+ });
571
+ var EnrichedStopSchema = import_zod16.z.object({
572
+ duration_seconds: import_zod16.z.number()
573
+ });
574
+ var EnrichedPointSchema = import_zod16.z.object({
575
+ lat: import_zod16.z.number(),
576
+ lon: import_zod16.z.number(),
577
+ timestamp: import_zod16.z.string(),
578
+ speed_mph: import_zod16.z.number().nullable(),
579
+ heading: import_zod16.z.number().nullable(),
580
+ altitude_feet: import_zod16.z.number().nullable(),
581
+ weather_condition: import_zod16.z.string().nullable(),
582
+ temperature_f: import_zod16.z.number().nullable(),
583
+ visibility_miles: import_zod16.z.number().nullable(),
584
+ light_condition: import_zod16.z.string().nullable(),
484
585
  stop: EnrichedStopSchema.nullable()
485
586
  });
486
- var EnrichedTripSummarySchema = import_zod13.z.object({
487
- trip_id: import_zod13.z.number(),
488
- driver_id: import_zod13.z.string(),
489
- start_time: import_zod13.z.string(),
490
- end_time: import_zod13.z.string(),
491
- points: import_zod13.z.array(EnrichedPointSchema)
587
+ var EnrichedTripSummarySchema = import_zod16.z.object({
588
+ trip_id: import_zod16.z.number(),
589
+ driver_id: import_zod16.z.string(),
590
+ start_time: import_zod16.z.string(),
591
+ end_time: import_zod16.z.string(),
592
+ points: import_zod16.z.array(EnrichedPointSchema)
492
593
  });
493
594
  var EnrichedTripSummaryResponseSchema = EnrichedTripSummarySchema;
494
- var DriverEnrichedSummariesResponseSchema = import_zod13.z.array(EnrichedTripSummarySchema);
595
+ var DriverEnrichedSummariesResponseSchema = import_zod16.z.array(EnrichedTripSummarySchema);
596
+
597
+ // src/schemas/trips/convex-driver-trip.ts
598
+ var import_zod17 = require("zod");
599
+ var ConvexBreadcrumbEventSchema = import_zod17.z.object({
600
+ ts: import_zod17.z.number(),
601
+ // epoch ms
602
+ status: import_zod17.z.string(),
603
+ lat: import_zod17.z.number(),
604
+ lon: import_zod17.z.number(),
605
+ heading: import_zod17.z.number().optional(),
606
+ locationText: import_zod17.z.string().optional(),
607
+ speedKph: import_zod17.z.number().optional(),
608
+ altitudeFeet: import_zod17.z.number().optional()
609
+ });
610
+ var ConvexDriverTripRequestSchema = import_zod17.z.object({
611
+ userId: import_zod17.z.string(),
612
+ breadcrumbs: import_zod17.z.array(ConvexBreadcrumbEventSchema).min(1)
613
+ });
614
+
615
+ // src/schemas/trips/post-driver-trip-telemetry.ts
616
+ var import_zod18 = require("zod");
617
+ var PostDriverTripTelemetryRecordSchema = import_zod18.z.object({
618
+ location_latitude: import_zod18.z.number(),
619
+ location_longitude: import_zod18.z.number(),
620
+ location_address: import_zod18.z.string().optional(),
621
+ heading: import_zod18.z.number(),
622
+ drivingState: import_zod18.z.string(),
623
+ speedKph: import_zod18.z.number(),
624
+ altitudeFeet: import_zod18.z.number(),
625
+ gps_timestamp: import_zod18.z.string().optional(),
626
+ odometer: import_zod18.z.number().optional(),
627
+ activity_type: import_zod18.z.string().optional(),
628
+ activity_confidence: import_zod18.z.number().int().optional()
629
+ });
630
+ var PostDriverTripTelemetryRequestSchema = import_zod18.z.object({
631
+ honkUserId: import_zod18.z.string(),
632
+ telemetry: import_zod18.z.array(PostDriverTripTelemetryRecordSchema).min(1)
633
+ });
634
+
635
+ // src/schemas/trips/post-daily-summary.ts
636
+ var import_zod19 = require("zod");
637
+ var PostDailySummaryRecordSchema = import_zod19.z.object({
638
+ externalDriverId: import_zod19.z.string(),
639
+ // drivers.id from Postgres
640
+ date: import_zod19.z.string(),
641
+ // "YYYY-MM-DD"
642
+ totalMiles: import_zod19.z.number(),
643
+ tripCount: import_zod19.z.number(),
644
+ pointCount: import_zod19.z.number(),
645
+ polyline: import_zod19.z.string().optional(),
646
+ highways: import_zod19.z.array(import_zod19.z.string()).optional(),
647
+ avgSpeedMph: import_zod19.z.number().optional(),
648
+ milesByWeather: import_zod19.z.record(import_zod19.z.string(), import_zod19.z.number()).optional(),
649
+ milesByLight: import_zod19.z.record(import_zod19.z.string(), import_zod19.z.number()).optional(),
650
+ states: import_zod19.z.array(import_zod19.z.string()).optional(),
651
+ origin: import_zod19.z.string().optional(),
652
+ destination: import_zod19.z.string().optional(),
653
+ altitudeGainedFeet: import_zod19.z.number().optional(),
654
+ altitudeLostFeet: import_zod19.z.number().optional(),
655
+ userId: import_zod19.z.string().optional()
656
+ // Convex user ID (honk_user_id) for fallback driver resolution
657
+ });
658
+ var PostDailySummaryRequestSchema = import_zod19.z.object({
659
+ summaries: import_zod19.z.array(PostDailySummaryRecordSchema).min(1)
660
+ });
495
661
 
496
662
  // src/auth-data.ts
497
- var import_zod14 = require("zod");
498
- var GomotiveAuthDataSchema = import_zod14.z.object({
499
- kind: import_zod14.z.literal("gomotive"),
500
- token: import_zod14.z.string(),
501
- ownerOperator: import_zod14.z.boolean()
663
+ var import_zod20 = require("zod");
664
+ var GomotiveAuthDataSchema = import_zod20.z.object({
665
+ kind: import_zod20.z.literal("gomotive"),
666
+ token: import_zod20.z.string(),
667
+ ownerOperator: import_zod20.z.boolean()
502
668
  });
503
- var VistaAuthDataSchema = import_zod14.z.object({
504
- kind: import_zod14.z.literal("vista"),
505
- driverId: import_zod14.z.string(),
506
- cookie: import_zod14.z.string()
669
+ var VistaAuthDataSchema = import_zod20.z.object({
670
+ kind: import_zod20.z.literal("vista"),
671
+ driverId: import_zod20.z.string(),
672
+ cookie: import_zod20.z.string()
507
673
  });
508
- var MockAuthDataSchema = import_zod14.z.object({
509
- kind: import_zod14.z.literal("mock"),
510
- cookie: import_zod14.z.string()
674
+ var MockAuthDataSchema = import_zod20.z.object({
675
+ kind: import_zod20.z.literal("mock"),
676
+ cookie: import_zod20.z.string()
511
677
  });
512
- var NoneAuthDataSchema = import_zod14.z.object({
513
- kind: import_zod14.z.literal("none")
678
+ var NoneAuthDataSchema = import_zod20.z.object({
679
+ kind: import_zod20.z.literal("none")
514
680
  });
515
- var ProviderAuthDataSchema = import_zod14.z.discriminatedUnion("kind", [
681
+ var ProviderAuthDataSchema = import_zod20.z.discriminatedUnion("kind", [
516
682
  GomotiveAuthDataSchema,
517
683
  VistaAuthDataSchema,
518
684
  MockAuthDataSchema,
519
685
  NoneAuthDataSchema
520
686
  ]);
521
- var LegacyVistaAuthSchema = import_zod14.z.object({
522
- driverId: import_zod14.z.string(),
523
- cookie: import_zod14.z.string()
687
+ var LegacyVistaAuthSchema = import_zod20.z.object({
688
+ driverId: import_zod20.z.string(),
689
+ cookie: import_zod20.z.string()
524
690
  });
525
691
  function serializeAuthData(data) {
526
692
  if (data.kind === "none") {
@@ -556,46 +722,46 @@ function deserializeAuthData(authToken) {
556
722
  }
557
723
 
558
724
  // src/browser-auth.ts
559
- var import_zod15 = require("zod");
560
- var CapturedTrafficEntrySchema = import_zod15.z.object({
561
- method: import_zod15.z.string(),
562
- url: import_zod15.z.string(),
563
- status: import_zod15.z.number(),
564
- responseBody: import_zod15.z.string().optional()
565
- });
566
- var BrowserAuthRequestSchema = import_zod15.z.object({
567
- providerStub: import_zod15.z.string(),
568
- providerUrl: import_zod15.z.string(),
569
- username: import_zod15.z.string(),
570
- encryptedPassword: import_zod15.z.string(),
571
- captureTraffic: import_zod15.z.boolean().optional()
572
- });
573
- var BrowserAuthSuccessSchema = import_zod15.z.object({
574
- success: import_zod15.z.literal(true),
725
+ var import_zod21 = require("zod");
726
+ var CapturedTrafficEntrySchema = import_zod21.z.object({
727
+ method: import_zod21.z.string(),
728
+ url: import_zod21.z.string(),
729
+ status: import_zod21.z.number(),
730
+ responseBody: import_zod21.z.string().optional()
731
+ });
732
+ var BrowserAuthRequestSchema = import_zod21.z.object({
733
+ providerStub: import_zod21.z.string(),
734
+ providerUrl: import_zod21.z.string(),
735
+ username: import_zod21.z.string(),
736
+ encryptedPassword: import_zod21.z.string(),
737
+ captureTraffic: import_zod21.z.boolean().optional()
738
+ });
739
+ var BrowserAuthSuccessSchema = import_zod21.z.object({
740
+ success: import_zod21.z.literal(true),
575
741
  authData: ProviderAuthDataSchema,
576
- capturedTraffic: import_zod15.z.array(CapturedTrafficEntrySchema).optional()
742
+ capturedTraffic: import_zod21.z.array(CapturedTrafficEntrySchema).optional()
577
743
  });
578
- var BrowserAuthFailureSchema = import_zod15.z.object({
579
- success: import_zod15.z.literal(false),
580
- error: import_zod15.z.string()
744
+ var BrowserAuthFailureSchema = import_zod21.z.object({
745
+ success: import_zod21.z.literal(false),
746
+ error: import_zod21.z.string()
581
747
  });
582
- var BrowserAuthResponseSchema = import_zod15.z.discriminatedUnion("success", [
748
+ var BrowserAuthResponseSchema = import_zod21.z.discriminatedUnion("success", [
583
749
  BrowserAuthSuccessSchema,
584
750
  BrowserAuthFailureSchema
585
751
  ]);
586
- var CrawlPageSchema = import_zod15.z.object({
587
- url: import_zod15.z.string(),
588
- html: import_zod15.z.string()
752
+ var CrawlPageSchema = import_zod21.z.object({
753
+ url: import_zod21.z.string(),
754
+ html: import_zod21.z.string()
589
755
  });
590
- var BrowserCrawlSuccessSchema = import_zod15.z.object({
591
- success: import_zod15.z.literal(true),
592
- pages: import_zod15.z.array(CrawlPageSchema)
756
+ var BrowserCrawlSuccessSchema = import_zod21.z.object({
757
+ success: import_zod21.z.literal(true),
758
+ pages: import_zod21.z.array(CrawlPageSchema)
593
759
  });
594
- var BrowserCrawlFailureSchema = import_zod15.z.object({
595
- success: import_zod15.z.literal(false),
596
- error: import_zod15.z.string()
760
+ var BrowserCrawlFailureSchema = import_zod21.z.object({
761
+ success: import_zod21.z.literal(false),
762
+ error: import_zod21.z.string()
597
763
  });
598
- var BrowserCrawlResponseSchema = import_zod15.z.discriminatedUnion("success", [
764
+ var BrowserCrawlResponseSchema = import_zod21.z.discriminatedUnion("success", [
599
765
  BrowserCrawlSuccessSchema,
600
766
  BrowserCrawlFailureSchema
601
767
  ]);
@@ -603,6 +769,11 @@ var BrowserCrawlResponseSchema = import_zod15.z.discriminatedUnion("success", [
603
769
  0 && (module.exports = {
604
770
  AnonymousDriverErrorResponseSchema,
605
771
  AnonymousDriverResponseSchema,
772
+ BGGeoActivitySchema,
773
+ BGGeoBatchRequestSchema,
774
+ BGGeoBatterySchema,
775
+ BGGeoCoordsSchema,
776
+ BGGeoLocationSchema,
606
777
  BatchConvexUpdate,
607
778
  BatchConvexUpdateSchema,
608
779
  BrowserAuthFailureSchema,
@@ -613,7 +784,9 @@ var BrowserCrawlResponseSchema = import_zod15.z.discriminatedUnion("success", [
613
784
  BrowserCrawlResponseSchema,
614
785
  BrowserCrawlSuccessSchema,
615
786
  CapturedTrafficEntrySchema,
787
+ ConvexBreadcrumbEventSchema,
616
788
  ConvexDriverSchema,
789
+ ConvexDriverTripRequestSchema,
617
790
  ConvexUpdate,
618
791
  ConvexUpdateSchema,
619
792
  CrawlPageSchema,
@@ -640,8 +813,9 @@ var BrowserCrawlResponseSchema = import_zod15.z.discriminatedUnion("success", [
640
813
  EnrichedTripSummaryResponseSchema,
641
814
  EnrichedTripSummarySchema,
642
815
  GomotiveAuthDataSchema,
816
+ ListDriversRequestSchema,
817
+ ListDriversResponseSchema,
643
818
  ManualBatchEntrySchema,
644
- ManualBatchRequestSchema,
645
819
  ManualBatchResponseSchema,
646
820
  ManualBatchTelemetrySchema,
647
821
  MockAuthDataSchema,
@@ -659,6 +833,10 @@ var BrowserCrawlResponseSchema = import_zod15.z.discriminatedUnion("success", [
659
833
  PatchDriverDriverResponseSchema,
660
834
  PatchDriverRequestSchema,
661
835
  PatchDriverResponseSchema,
836
+ PostDailySummaryRecordSchema,
837
+ PostDailySummaryRequestSchema,
838
+ PostDriverTripTelemetryRecordSchema,
839
+ PostDriverTripTelemetryRequestSchema,
662
840
  ProviderAuthDataSchema,
663
841
  ScrapeStatus,
664
842
  SharedDriverResponseSchema,
@@ -667,6 +845,8 @@ var BrowserCrawlResponseSchema = import_zod15.z.discriminatedUnion("success", [
667
845
  StateHeatmapResponseSchema,
668
846
  TruckTypeSchema,
669
847
  UpdateScrapeStatusMessage,
848
+ ValidateLoginRequestSchema,
849
+ ValidateLoginResponseSchema,
670
850
  ValidatePasswordRequestSchema,
671
851
  ValidatePasswordResponseSchema,
672
852
  VistaAuthDataSchema,