@findatruck/shared-schemas 2.19.0 → 2.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,6 +76,8 @@ __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
82
  ManualBatchRequestSchema: () => ManualBatchRequestSchema,
74
83
  ManualBatchResponseSchema: () => ManualBatchResponseSchema,
@@ -88,6 +97,8 @@ __export(index_exports, {
88
97
  PatchDriverDriverResponseSchema: () => PatchDriverDriverResponseSchema,
89
98
  PatchDriverRequestSchema: () => PatchDriverRequestSchema,
90
99
  PatchDriverResponseSchema: () => PatchDriverResponseSchema,
100
+ PostDriverTripTelemetryRecordSchema: () => PostDriverTripTelemetryRecordSchema,
101
+ PostDriverTripTelemetryRequestSchema: () => PostDriverTripTelemetryRequestSchema,
91
102
  ProviderAuthDataSchema: () => ProviderAuthDataSchema,
92
103
  ScrapeStatus: () => ScrapeStatus,
93
104
  SharedDriverResponseSchema: () => SharedDriverResponseSchema,
@@ -230,7 +241,7 @@ var SharedDriverResponseSchema = import_zod4.default.object({
230
241
  // because providers emit non-UUID identifiers there.
231
242
  id: import_zod4.default.uuid(),
232
243
  name: import_zod4.default.string(),
233
- eld_external_id: import_zod4.default.string(),
244
+ eld_external_id: import_zod4.default.string().nullable(),
234
245
  license_number: import_zod4.default.string().nullable(),
235
246
  license_state: import_zod4.default.string().nullable(),
236
247
  license_expiration_date: import_zod4.default.string().nullable(),
@@ -239,6 +250,7 @@ var SharedDriverResponseSchema = import_zod4.default.object({
239
250
  created_at: import_zod4.default.union([import_zod4.default.string(), import_zod4.default.date()]),
240
251
  updated_at: import_zod4.default.union([import_zod4.default.string(), import_zod4.default.date()]),
241
252
  truck_type: import_zod4.default.string().nullable(),
253
+ honk_user_id: import_zod4.default.string().nullable(),
242
254
  last_location_latitude: import_zod4.default.number().nullable(),
243
255
  last_location_longitude: import_zod4.default.number().nullable()
244
256
  });
@@ -279,10 +291,14 @@ var DriverNameSchema = import_zod5.default.string().trim().min(1).max(PATCH_DRIV
279
291
  );
280
292
  var TruckTypeSchema = import_zod5.default.string().trim().min(1).max(PATCH_DRIVER_TRUCK_TYPE_MAX_LENGTH);
281
293
  var PatchDriverRequestSchema = import_zod5.default.object({
282
- driver_id: import_zod5.default.uuid(),
294
+ driver_id: import_zod5.default.uuid().optional(),
295
+ honk_user_id: import_zod5.default.string().min(1).max(255).optional(),
283
296
  name: DriverNameSchema.optional(),
284
297
  truck_type: TruckTypeSchema.nullable().optional()
285
298
  }).refine(
299
+ (d) => d.driver_id !== void 0 !== (d.honk_user_id !== void 0),
300
+ { message: "Exactly one of driver_id or honk_user_id must be provided" }
301
+ ).refine(
286
302
  (d) => d.name !== void 0 || d.truck_type !== void 0,
287
303
  { message: "At least one of name or truck_type must be provided" }
288
304
  );
@@ -300,8 +316,17 @@ var PatchDriverResponseSchema = import_zod5.default.object({
300
316
  driver: PatchDriverDriverResponseSchema
301
317
  });
302
318
 
303
- // src/schemas/providerAccounts/update-status.ts
319
+ // src/schemas/drivers/list-drivers.ts
304
320
  var import_zod6 = __toESM(require("zod"), 1);
321
+ var ListDriversRequestSchema = import_zod6.default.object({
322
+ name: import_zod6.default.string().optional()
323
+ });
324
+ var ListDriversResponseSchema = import_zod6.default.object({
325
+ drivers: import_zod6.default.array(SharedDriverResponseSchema)
326
+ });
327
+
328
+ // src/schemas/providerAccounts/update-status.ts
329
+ var import_zod7 = __toESM(require("zod"), 1);
305
330
  var ScrapeStatus = /* @__PURE__ */ ((ScrapeStatus2) => {
306
331
  ScrapeStatus2["NEW_LOGIN_RECEIVED"] = "NEW_LOGIN_RECEIVED";
307
332
  ScrapeStatus2["LOGIN_IN_PROGRESS"] = "LOGIN_IN_PROGRESS";
@@ -314,213 +339,305 @@ var ScrapeStatus = /* @__PURE__ */ ((ScrapeStatus2) => {
314
339
  ScrapeStatus2["DATA_FETCH_FAILED"] = "DATA_FETCH_FAILED";
315
340
  return ScrapeStatus2;
316
341
  })(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")
342
+ var UpdateScrapeStatusMessage = import_zod7.default.object({
343
+ status: import_zod7.default.nativeEnum(ScrapeStatus).describe("The current status of the scrape process"),
344
+ correctPassword: import_zod7.default.boolean().optional().describe("Indicates if the provided password was correct, if applicable"),
345
+ externalProviderAccountId: import_zod7.default.string().describe("The external identifier for the provider account (convex ID or similar)"),
346
+ username: import_zod7.default.string().describe("The username of the provider account whose status is being updated"),
347
+ provider_url: import_zod7.default.string().describe("The URL of the ELD provider"),
348
+ driverCount: import_zod7.default.number().optional().describe("The number of drivers associated with the account, if applicable"),
349
+ providerSlug: import_zod7.default.string().optional().describe("The slug identifier for the provider")
325
350
  }).describe("Schema for update status messages");
326
351
 
327
352
  // 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")
353
+ var import_zod8 = require("zod");
354
+ var ValidatePasswordRequestSchema = import_zod8.z.object({
355
+ providerAccountId: import_zod8.z.string().min(1).describe("The unique identifier of the provider account in postgres to validate the password for"),
356
+ encryptedPassword: import_zod8.z.string().min(1).describe("The encrypted password to validate against the stored password")
332
357
  }).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")
358
+ var ValidatePasswordResponseSchema = import_zod8.z.object({
359
+ isValid: import_zod8.z.boolean().describe("Indicates if the provided password is valid"),
360
+ driverIds: import_zod8.z.array(import_zod8.z.string()).describe("List of driver IDs associated with the provider account")
336
361
  }).describe("Response schema for password validation");
337
362
 
338
363
  // 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")
364
+ var import_zod9 = require("zod");
365
+ var DeleteProviderAccountRequestSchema = import_zod9.z.object({
366
+ providerAccountId: import_zod9.z.string().min(1).describe("The external provider account ID to delete")
342
367
  }).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")
368
+ var DeleteProviderAccountResponseSchema = import_zod9.z.object({
369
+ success: import_zod9.z.boolean().describe("Indicates if the provider account was successfully deleted")
345
370
  }).describe("Response schema for provider account deletion");
346
371
 
347
372
  // 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")
373
+ var import_zod10 = require("zod");
374
+ var DriverRankingsRequestSchema = import_zod10.z.object({
375
+ start_date: import_zod10.z.string().describe("Start date for the ranking period (ISO 8601 format)"),
376
+ end_date: import_zod10.z.string().describe("End date for the ranking period (ISO 8601 format)"),
377
+ state: import_zod10.z.string().length(2).optional().describe("Optional 2-letter state abbreviation to filter telemetry by location"),
378
+ source: import_zod10.z.enum(["eld", "manual"]).default("manual").describe("Telemetry source to rank by: 'manual' uses GPS odometer, 'eld' uses calculated distance")
354
379
  }).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")
380
+ var DriverRankingSchema = import_zod10.z.object({
381
+ rank: import_zod10.z.number().int().positive().describe("Rank position based on miles driven"),
382
+ driver_id: import_zod10.z.string().uuid().describe("Unique identifier of the driver"),
383
+ driver_name: import_zod10.z.string().describe("Name of the driver"),
384
+ total_miles: import_zod10.z.number().min(0).describe("Total miles driven in the specified period")
360
385
  }).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");
386
+ var DriverRankingsResponseSchema = import_zod10.z.array(DriverRankingSchema).describe("Array of driver rankings sorted by miles driven in descending order");
362
387
 
363
388
  // 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)")
389
+ var import_zod11 = require("zod");
390
+ var StateHeatmapRequestSchema = import_zod11.z.object({
391
+ driver_id: import_zod11.z.string().uuid().describe("Unique identifier of the driver"),
392
+ start_date: import_zod11.z.string().describe("Start date for the heatmap period (ISO 8601 format)"),
393
+ end_date: import_zod11.z.string().describe("End date for the heatmap period (ISO 8601 format)")
369
394
  }).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")
395
+ var StateHeatmapEntrySchema = import_zod11.z.object({
396
+ count: import_zod11.z.number().int().min(0).describe("Number of telemetry points in this state"),
397
+ percentage: import_zod11.z.number().min(0).max(100).describe("Percentage of total telemetry points in this state")
373
398
  }).describe("Single state entry in the heatmap");
374
- var StateHeatmapResponseSchema = import_zod10.z.record(
375
- import_zod10.z.string().length(2),
399
+ var StateHeatmapResponseSchema = import_zod11.z.record(
400
+ import_zod11.z.string().length(2),
376
401
  StateHeatmapEntrySchema
377
402
  ).describe("Record of 2-letter state codes to heatmap entries");
378
403
 
379
404
  // 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")
405
+ var import_zod12 = require("zod");
406
+ var ManualBatchEntrySchema = import_zod12.z.object({
407
+ driver_id: import_zod12.z.string().uuid().describe("Internal UUID of the driver"),
408
+ timestamp: import_zod12.z.string().datetime().describe("Timestamp of the GPS reading (ISO 8601 format)"),
409
+ location_latitude: import_zod12.z.number().min(-90).max(90).describe("GPS latitude coordinate"),
410
+ location_longitude: import_zod12.z.number().min(-180).max(180).describe("GPS longitude coordinate"),
411
+ location_address: import_zod12.z.string().optional().describe("Optional human-readable address"),
412
+ vehicle_odometer_miles: import_zod12.z.number().min(0).optional().describe("Optional vehicle odometer reading in miles"),
413
+ heading: import_zod12.z.number().min(0).max(360).optional().describe("Optional GPS heading in degrees (0-360)"),
414
+ speed_mph: import_zod12.z.number().min(0).optional().describe("Optional GPS speed in miles per hour"),
415
+ altitude_feet: import_zod12.z.number().optional().describe("Optional GPS altitude in feet"),
416
+ raw: import_zod12.z.record(import_zod12.z.string(), import_zod12.z.unknown()).optional().describe("Optional raw upstream JSON payload to archive alongside this entry"),
417
+ driving_status: import_zod12.z.enum(["parked", "driving"]).optional().describe("Optional parked/driving status reported by the upstream system"),
418
+ activity_type: import_zod12.z.string().optional().describe("Optional activity recognition type (e.g. 'in_vehicle', 'on_foot')"),
419
+ activity_confidence: import_zod12.z.number().int().min(0).max(100).optional().describe("Optional activity recognition confidence (0-100)")
393
420
  }).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)")
421
+ var ManualBatchRequestSchema = import_zod12.z.object({
422
+ entries: import_zod12.z.array(ManualBatchEntrySchema).min(1).max(1e3).describe("Array of manual telemetry entries (1-1000)")
396
423
  }).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()
424
+ var ManualBatchTelemetrySchema = import_zod12.z.object({
425
+ id: import_zod12.z.number().int().describe("Telemetry record ID"),
426
+ driver_id: import_zod12.z.string().uuid().describe("Internal UUID of the driver"),
427
+ timestamp: import_zod12.z.union([import_zod12.z.string(), import_zod12.z.date()]).describe("Timestamp of the telemetry reading"),
428
+ remaining_drive_time_in_seconds: import_zod12.z.number().min(0),
429
+ remaining_shift_time_in_seconds: import_zod12.z.number().min(0),
430
+ remaining_cycle_time_in_seconds: import_zod12.z.number().min(0),
431
+ remaining_break_time_in_seconds: import_zod12.z.number().min(0),
432
+ location_latitude: import_zod12.z.number().min(-90).max(90),
433
+ location_longitude: import_zod12.z.number().min(-180).max(180),
434
+ previous_location_latitude: import_zod12.z.number().min(-90).max(90).nullable(),
435
+ previous_location_longitude: import_zod12.z.number().min(-180).max(180).nullable(),
436
+ location_address: import_zod12.z.string().nullable(),
437
+ location_state: import_zod12.z.string().length(2).nullable(),
438
+ echoed_odometer_miles: import_zod12.z.number().min(0).nullable().describe("Vehicle odometer reading echoed back from the request (miles)"),
439
+ osrm_calculated_miles: import_zod12.z.number().min(0).nullable().describe("Road distance calculated by OSRM between this point and the previous point (miles)"),
440
+ heading: import_zod12.z.number().nullish(),
441
+ speed_mph: import_zod12.z.number().nullish(),
442
+ altitude_feet: import_zod12.z.number().nullish(),
443
+ source: import_zod12.z.enum(["eld", "manual"]),
444
+ driving_status: import_zod12.z.enum(["parked", "driving"]).nullable(),
445
+ activity_type: import_zod12.z.string().nullable(),
446
+ activity_confidence: import_zod12.z.number().int().nullable()
418
447
  }).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")
448
+ var ManualBatchResponseSchema = import_zod12.z.object({
449
+ message: import_zod12.z.string().describe("Success message"),
450
+ inserted_count: import_zod12.z.number().int().min(0).describe("Number of telemetry entries inserted"),
451
+ telemetry: import_zod12.z.array(ManualBatchTelemetrySchema).describe("Array of inserted telemetry records")
423
452
  }).describe("Response schema for manual batch telemetry insertion");
424
453
 
454
+ // src/schemas/telemetry/bggeo-batch.ts
455
+ var import_zod13 = require("zod");
456
+ var BGGeoCoordsSchema = import_zod13.z.object({
457
+ latitude: import_zod13.z.number().min(-90).max(90),
458
+ longitude: import_zod13.z.number().min(-180).max(180),
459
+ accuracy: import_zod13.z.number().optional(),
460
+ speed: import_zod13.z.number().describe("Speed in m/s; -1 when unavailable"),
461
+ heading: import_zod13.z.number().describe("Heading in degrees; -1 when unavailable"),
462
+ altitude: import_zod13.z.number().describe("Altitude in meters"),
463
+ altitude_accuracy: import_zod13.z.number().optional(),
464
+ speed_accuracy: import_zod13.z.number().optional(),
465
+ heading_accuracy: import_zod13.z.number().optional(),
466
+ ellipsoidal_altitude: import_zod13.z.number().optional(),
467
+ floor: import_zod13.z.number().nullable().optional()
468
+ }).describe("BGGeo coords object");
469
+ var BGGeoActivitySchema = import_zod13.z.object({
470
+ type: import_zod13.z.string(),
471
+ confidence: import_zod13.z.number()
472
+ }).describe("BGGeo activity recognition");
473
+ var BGGeoBatterySchema = import_zod13.z.object({
474
+ is_charging: import_zod13.z.boolean(),
475
+ level: import_zod13.z.number()
476
+ }).describe("BGGeo battery status");
477
+ var BGGeoLocationSchema = import_zod13.z.object({
478
+ coords: BGGeoCoordsSchema,
479
+ extras: import_zod13.z.object({}).passthrough().optional(),
480
+ activity: BGGeoActivitySchema.optional(),
481
+ battery: BGGeoBatterySchema.optional(),
482
+ timestamp: import_zod13.z.string().datetime().describe("ISO 8601 timestamp"),
483
+ is_moving: import_zod13.z.boolean(),
484
+ odometer: import_zod13.z.number().min(0).describe("Odometer in meters"),
485
+ uuid: import_zod13.z.string().optional(),
486
+ event: import_zod13.z.string().optional(),
487
+ age: import_zod13.z.number().optional(),
488
+ geofence: import_zod13.z.record(import_zod13.z.string(), import_zod13.z.unknown()).optional(),
489
+ mock: import_zod13.z.boolean().optional(),
490
+ recorded_at: import_zod13.z.string().datetime().optional().describe("ISO 8601 device recording timestamp")
491
+ }).passthrough().describe("Single BGGeo location object");
492
+ var locationArray = import_zod13.z.array(BGGeoLocationSchema).min(1).max(1e3).describe("Array of BGGeo location objects (1-1000)");
493
+ var locationOrArray = import_zod13.z.union([
494
+ BGGeoLocationSchema.transform((loc) => [loc]),
495
+ locationArray
496
+ ]);
497
+ var BGGeoBatchRequestSchema = import_zod13.z.object({
498
+ location: locationOrArray.optional(),
499
+ locations: locationOrArray.optional()
500
+ }).refine((data) => data.location ?? data.locations, {
501
+ message: "Either 'location' or 'locations' must be provided"
502
+ }).describe("Request schema for BGGeo batch telemetry ingestion");
503
+
425
504
  // 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(),
505
+ var import_zod14 = require("zod");
506
+ var DriverTripsRequestSchema = import_zod14.z.object({
507
+ driver_id: import_zod14.z.string().uuid(),
508
+ start_date: import_zod14.z.string(),
430
509
  // YYYY-MM-DD
431
- end_date: import_zod12.z.string()
510
+ end_date: import_zod14.z.string()
432
511
  // YYYY-MM-DD
433
512
  });
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);
513
+ var DriverTripSchema = import_zod14.z.object({
514
+ id: import_zod14.z.number(),
515
+ start_time: import_zod14.z.string(),
516
+ end_time: import_zod14.z.string(),
517
+ point_count: import_zod14.z.number(),
518
+ polyline: import_zod14.z.string().nullable(),
519
+ highways: import_zod14.z.array(import_zod14.z.string()).nullable(),
520
+ total_miles: import_zod14.z.number().nullable(),
521
+ avg_speed_mph: import_zod14.z.number().nullable(),
522
+ miles_by_weather: import_zod14.z.record(import_zod14.z.string(), import_zod14.z.number()).nullable(),
523
+ miles_by_light: import_zod14.z.record(import_zod14.z.string(), import_zod14.z.number()).nullable()
524
+ });
525
+ var DriverTripsResponseSchema = import_zod14.z.array(DriverTripSchema);
526
+ var DriverDailySummarySchema = import_zod14.z.object({
527
+ summary_date: import_zod14.z.string(),
528
+ total_miles: import_zod14.z.number(),
529
+ trip_count: import_zod14.z.number(),
530
+ point_count: import_zod14.z.number(),
531
+ polyline: import_zod14.z.string().nullable(),
532
+ highways: import_zod14.z.array(import_zod14.z.string()).nullable(),
533
+ avg_speed_mph: import_zod14.z.number().nullable(),
534
+ miles_by_weather: import_zod14.z.record(import_zod14.z.string(), import_zod14.z.number()).nullable(),
535
+ miles_by_light: import_zod14.z.record(import_zod14.z.string(), import_zod14.z.number()).nullable()
536
+ });
537
+ var DriverDailySummariesResponseSchema = import_zod14.z.array(DriverDailySummarySchema);
459
538
 
460
539
  // 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(),
540
+ var import_zod15 = require("zod");
541
+ var EnrichedTripSummaryRequestSchema = import_zod15.z.object({
542
+ trip_id: import_zod15.z.number()
543
+ });
544
+ var DriverEnrichedSummariesRequestSchema = import_zod15.z.object({
545
+ driver_id: import_zod15.z.string().uuid(),
546
+ start_date: import_zod15.z.string(),
547
+ end_date: import_zod15.z.string()
548
+ });
549
+ var EnrichedStopSchema = import_zod15.z.object({
550
+ duration_seconds: import_zod15.z.number()
551
+ });
552
+ var EnrichedPointSchema = import_zod15.z.object({
553
+ lat: import_zod15.z.number(),
554
+ lon: import_zod15.z.number(),
555
+ timestamp: import_zod15.z.string(),
556
+ speed_mph: import_zod15.z.number().nullable(),
557
+ heading: import_zod15.z.number().nullable(),
558
+ altitude_feet: import_zod15.z.number().nullable(),
559
+ weather_condition: import_zod15.z.string().nullable(),
560
+ temperature_f: import_zod15.z.number().nullable(),
561
+ visibility_miles: import_zod15.z.number().nullable(),
562
+ light_condition: import_zod15.z.string().nullable(),
484
563
  stop: EnrichedStopSchema.nullable()
485
564
  });
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)
565
+ var EnrichedTripSummarySchema = import_zod15.z.object({
566
+ trip_id: import_zod15.z.number(),
567
+ driver_id: import_zod15.z.string(),
568
+ start_time: import_zod15.z.string(),
569
+ end_time: import_zod15.z.string(),
570
+ points: import_zod15.z.array(EnrichedPointSchema)
492
571
  });
493
572
  var EnrichedTripSummaryResponseSchema = EnrichedTripSummarySchema;
494
- var DriverEnrichedSummariesResponseSchema = import_zod13.z.array(EnrichedTripSummarySchema);
573
+ var DriverEnrichedSummariesResponseSchema = import_zod15.z.array(EnrichedTripSummarySchema);
574
+
575
+ // src/schemas/trips/convex-driver-trip.ts
576
+ var import_zod16 = require("zod");
577
+ var ConvexBreadcrumbEventSchema = import_zod16.z.object({
578
+ ts: import_zod16.z.number(),
579
+ // epoch ms
580
+ status: import_zod16.z.string(),
581
+ lat: import_zod16.z.number(),
582
+ lon: import_zod16.z.number(),
583
+ heading: import_zod16.z.number().optional(),
584
+ locationText: import_zod16.z.string().optional(),
585
+ speedKph: import_zod16.z.number().optional(),
586
+ altitudeFeet: import_zod16.z.number().optional()
587
+ });
588
+ var ConvexDriverTripRequestSchema = import_zod16.z.object({
589
+ userId: import_zod16.z.string(),
590
+ breadcrumbs: import_zod16.z.array(ConvexBreadcrumbEventSchema).min(1)
591
+ });
592
+
593
+ // src/schemas/trips/post-driver-trip-telemetry.ts
594
+ var import_zod17 = require("zod");
595
+ var PostDriverTripTelemetryRecordSchema = import_zod17.z.object({
596
+ location_latitude: import_zod17.z.number(),
597
+ location_longitude: import_zod17.z.number(),
598
+ location_address: import_zod17.z.string().optional(),
599
+ heading: import_zod17.z.number(),
600
+ drivingState: import_zod17.z.string(),
601
+ speedKph: import_zod17.z.number(),
602
+ altitudeFeet: import_zod17.z.number(),
603
+ gps_timestamp: import_zod17.z.string().optional(),
604
+ odometer: import_zod17.z.number().optional(),
605
+ activity_type: import_zod17.z.string().optional(),
606
+ activity_confidence: import_zod17.z.number().int().optional()
607
+ });
608
+ var PostDriverTripTelemetryRequestSchema = import_zod17.z.object({
609
+ honkUserId: import_zod17.z.string(),
610
+ telemetry: import_zod17.z.array(PostDriverTripTelemetryRecordSchema).min(1)
611
+ });
495
612
 
496
613
  // 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()
614
+ var import_zod18 = require("zod");
615
+ var GomotiveAuthDataSchema = import_zod18.z.object({
616
+ kind: import_zod18.z.literal("gomotive"),
617
+ token: import_zod18.z.string(),
618
+ ownerOperator: import_zod18.z.boolean()
502
619
  });
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()
620
+ var VistaAuthDataSchema = import_zod18.z.object({
621
+ kind: import_zod18.z.literal("vista"),
622
+ driverId: import_zod18.z.string(),
623
+ cookie: import_zod18.z.string()
507
624
  });
508
- var MockAuthDataSchema = import_zod14.z.object({
509
- kind: import_zod14.z.literal("mock"),
510
- cookie: import_zod14.z.string()
625
+ var MockAuthDataSchema = import_zod18.z.object({
626
+ kind: import_zod18.z.literal("mock"),
627
+ cookie: import_zod18.z.string()
511
628
  });
512
- var NoneAuthDataSchema = import_zod14.z.object({
513
- kind: import_zod14.z.literal("none")
629
+ var NoneAuthDataSchema = import_zod18.z.object({
630
+ kind: import_zod18.z.literal("none")
514
631
  });
515
- var ProviderAuthDataSchema = import_zod14.z.discriminatedUnion("kind", [
632
+ var ProviderAuthDataSchema = import_zod18.z.discriminatedUnion("kind", [
516
633
  GomotiveAuthDataSchema,
517
634
  VistaAuthDataSchema,
518
635
  MockAuthDataSchema,
519
636
  NoneAuthDataSchema
520
637
  ]);
521
- var LegacyVistaAuthSchema = import_zod14.z.object({
522
- driverId: import_zod14.z.string(),
523
- cookie: import_zod14.z.string()
638
+ var LegacyVistaAuthSchema = import_zod18.z.object({
639
+ driverId: import_zod18.z.string(),
640
+ cookie: import_zod18.z.string()
524
641
  });
525
642
  function serializeAuthData(data) {
526
643
  if (data.kind === "none") {
@@ -556,46 +673,46 @@ function deserializeAuthData(authToken) {
556
673
  }
557
674
 
558
675
  // 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),
676
+ var import_zod19 = require("zod");
677
+ var CapturedTrafficEntrySchema = import_zod19.z.object({
678
+ method: import_zod19.z.string(),
679
+ url: import_zod19.z.string(),
680
+ status: import_zod19.z.number(),
681
+ responseBody: import_zod19.z.string().optional()
682
+ });
683
+ var BrowserAuthRequestSchema = import_zod19.z.object({
684
+ providerStub: import_zod19.z.string(),
685
+ providerUrl: import_zod19.z.string(),
686
+ username: import_zod19.z.string(),
687
+ encryptedPassword: import_zod19.z.string(),
688
+ captureTraffic: import_zod19.z.boolean().optional()
689
+ });
690
+ var BrowserAuthSuccessSchema = import_zod19.z.object({
691
+ success: import_zod19.z.literal(true),
575
692
  authData: ProviderAuthDataSchema,
576
- capturedTraffic: import_zod15.z.array(CapturedTrafficEntrySchema).optional()
693
+ capturedTraffic: import_zod19.z.array(CapturedTrafficEntrySchema).optional()
577
694
  });
578
- var BrowserAuthFailureSchema = import_zod15.z.object({
579
- success: import_zod15.z.literal(false),
580
- error: import_zod15.z.string()
695
+ var BrowserAuthFailureSchema = import_zod19.z.object({
696
+ success: import_zod19.z.literal(false),
697
+ error: import_zod19.z.string()
581
698
  });
582
- var BrowserAuthResponseSchema = import_zod15.z.discriminatedUnion("success", [
699
+ var BrowserAuthResponseSchema = import_zod19.z.discriminatedUnion("success", [
583
700
  BrowserAuthSuccessSchema,
584
701
  BrowserAuthFailureSchema
585
702
  ]);
586
- var CrawlPageSchema = import_zod15.z.object({
587
- url: import_zod15.z.string(),
588
- html: import_zod15.z.string()
703
+ var CrawlPageSchema = import_zod19.z.object({
704
+ url: import_zod19.z.string(),
705
+ html: import_zod19.z.string()
589
706
  });
590
- var BrowserCrawlSuccessSchema = import_zod15.z.object({
591
- success: import_zod15.z.literal(true),
592
- pages: import_zod15.z.array(CrawlPageSchema)
707
+ var BrowserCrawlSuccessSchema = import_zod19.z.object({
708
+ success: import_zod19.z.literal(true),
709
+ pages: import_zod19.z.array(CrawlPageSchema)
593
710
  });
594
- var BrowserCrawlFailureSchema = import_zod15.z.object({
595
- success: import_zod15.z.literal(false),
596
- error: import_zod15.z.string()
711
+ var BrowserCrawlFailureSchema = import_zod19.z.object({
712
+ success: import_zod19.z.literal(false),
713
+ error: import_zod19.z.string()
597
714
  });
598
- var BrowserCrawlResponseSchema = import_zod15.z.discriminatedUnion("success", [
715
+ var BrowserCrawlResponseSchema = import_zod19.z.discriminatedUnion("success", [
599
716
  BrowserCrawlSuccessSchema,
600
717
  BrowserCrawlFailureSchema
601
718
  ]);
@@ -603,6 +720,11 @@ var BrowserCrawlResponseSchema = import_zod15.z.discriminatedUnion("success", [
603
720
  0 && (module.exports = {
604
721
  AnonymousDriverErrorResponseSchema,
605
722
  AnonymousDriverResponseSchema,
723
+ BGGeoActivitySchema,
724
+ BGGeoBatchRequestSchema,
725
+ BGGeoBatterySchema,
726
+ BGGeoCoordsSchema,
727
+ BGGeoLocationSchema,
606
728
  BatchConvexUpdate,
607
729
  BatchConvexUpdateSchema,
608
730
  BrowserAuthFailureSchema,
@@ -613,7 +735,9 @@ var BrowserCrawlResponseSchema = import_zod15.z.discriminatedUnion("success", [
613
735
  BrowserCrawlResponseSchema,
614
736
  BrowserCrawlSuccessSchema,
615
737
  CapturedTrafficEntrySchema,
738
+ ConvexBreadcrumbEventSchema,
616
739
  ConvexDriverSchema,
740
+ ConvexDriverTripRequestSchema,
617
741
  ConvexUpdate,
618
742
  ConvexUpdateSchema,
619
743
  CrawlPageSchema,
@@ -640,6 +764,8 @@ var BrowserCrawlResponseSchema = import_zod15.z.discriminatedUnion("success", [
640
764
  EnrichedTripSummaryResponseSchema,
641
765
  EnrichedTripSummarySchema,
642
766
  GomotiveAuthDataSchema,
767
+ ListDriversRequestSchema,
768
+ ListDriversResponseSchema,
643
769
  ManualBatchEntrySchema,
644
770
  ManualBatchRequestSchema,
645
771
  ManualBatchResponseSchema,
@@ -659,6 +785,8 @@ var BrowserCrawlResponseSchema = import_zod15.z.discriminatedUnion("success", [
659
785
  PatchDriverDriverResponseSchema,
660
786
  PatchDriverRequestSchema,
661
787
  PatchDriverResponseSchema,
788
+ PostDriverTripTelemetryRecordSchema,
789
+ PostDriverTripTelemetryRequestSchema,
662
790
  ProviderAuthDataSchema,
663
791
  ScrapeStatus,
664
792
  SharedDriverResponseSchema,