@findatruck/shared-schemas 2.23.0 → 2.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +297 -245
- package/dist/index.d.cts +61 -22
- package/dist/index.d.ts +61 -22
- package/dist/index.js +286 -237
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -79,7 +79,6 @@ __export(index_exports, {
|
|
|
79
79
|
ListDriversRequestSchema: () => ListDriversRequestSchema,
|
|
80
80
|
ListDriversResponseSchema: () => ListDriversResponseSchema,
|
|
81
81
|
ManualBatchEntrySchema: () => ManualBatchEntrySchema,
|
|
82
|
-
ManualBatchRequestSchema: () => ManualBatchRequestSchema,
|
|
83
82
|
ManualBatchResponseSchema: () => ManualBatchResponseSchema,
|
|
84
83
|
ManualBatchTelemetrySchema: () => ManualBatchTelemetrySchema,
|
|
85
84
|
MockAuthDataSchema: () => MockAuthDataSchema,
|
|
@@ -97,6 +96,8 @@ __export(index_exports, {
|
|
|
97
96
|
PatchDriverDriverResponseSchema: () => PatchDriverDriverResponseSchema,
|
|
98
97
|
PatchDriverRequestSchema: () => PatchDriverRequestSchema,
|
|
99
98
|
PatchDriverResponseSchema: () => PatchDriverResponseSchema,
|
|
99
|
+
PostDailySummaryRecordSchema: () => PostDailySummaryRecordSchema,
|
|
100
|
+
PostDailySummaryRequestSchema: () => PostDailySummaryRequestSchema,
|
|
100
101
|
PostDriverTripTelemetryRecordSchema: () => PostDriverTripTelemetryRecordSchema,
|
|
101
102
|
PostDriverTripTelemetryRequestSchema: () => PostDriverTripTelemetryRequestSchema,
|
|
102
103
|
ProviderAuthDataSchema: () => ProviderAuthDataSchema,
|
|
@@ -107,6 +108,8 @@ __export(index_exports, {
|
|
|
107
108
|
StateHeatmapResponseSchema: () => StateHeatmapResponseSchema,
|
|
108
109
|
TruckTypeSchema: () => TruckTypeSchema,
|
|
109
110
|
UpdateScrapeStatusMessage: () => UpdateScrapeStatusMessage,
|
|
111
|
+
ValidateLoginRequestSchema: () => ValidateLoginRequestSchema,
|
|
112
|
+
ValidateLoginResponseSchema: () => ValidateLoginResponseSchema,
|
|
110
113
|
ValidatePasswordRequestSchema: () => ValidatePasswordRequestSchema,
|
|
111
114
|
ValidatePasswordResponseSchema: () => ValidatePasswordResponseSchema,
|
|
112
115
|
VistaAuthDataSchema: () => VistaAuthDataSchema,
|
|
@@ -360,141 +363,160 @@ var ValidatePasswordResponseSchema = import_zod8.z.object({
|
|
|
360
363
|
driverIds: import_zod8.z.array(import_zod8.z.string()).describe("List of driver IDs associated with the provider account")
|
|
361
364
|
}).describe("Response schema for password validation");
|
|
362
365
|
|
|
363
|
-
// src/schemas/providerAccounts/
|
|
366
|
+
// src/schemas/providerAccounts/validate-login.ts
|
|
364
367
|
var import_zod9 = require("zod");
|
|
365
|
-
var
|
|
366
|
-
|
|
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
|
+
|
|
388
|
+
// src/schemas/providerAccounts/delete-provider-account.ts
|
|
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")
|
|
367
392
|
}).describe("Request schema for deleting a provider account");
|
|
368
|
-
var DeleteProviderAccountResponseSchema =
|
|
369
|
-
success:
|
|
393
|
+
var DeleteProviderAccountResponseSchema = import_zod10.z.object({
|
|
394
|
+
success: import_zod10.z.boolean().describe("Indicates if the provider account was successfully deleted")
|
|
370
395
|
}).describe("Response schema for provider account deletion");
|
|
371
396
|
|
|
372
397
|
// src/schemas/telemetry/driver-rankings.ts
|
|
373
|
-
var
|
|
374
|
-
var DriverRankingsRequestSchema =
|
|
375
|
-
start_date:
|
|
376
|
-
end_date:
|
|
377
|
-
state:
|
|
378
|
-
source:
|
|
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")
|
|
379
404
|
}).describe("Request schema for driver rankings by miles driven");
|
|
380
|
-
var DriverRankingSchema =
|
|
381
|
-
rank:
|
|
382
|
-
driver_id:
|
|
383
|
-
driver_name:
|
|
384
|
-
total_miles:
|
|
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")
|
|
385
410
|
}).describe("Single driver ranking entry");
|
|
386
|
-
var DriverRankingsResponseSchema =
|
|
411
|
+
var DriverRankingsResponseSchema = import_zod11.z.array(DriverRankingSchema).describe("Array of driver rankings sorted by miles driven in descending order");
|
|
387
412
|
|
|
388
413
|
// src/schemas/telemetry/state-heatmap.ts
|
|
389
|
-
var
|
|
390
|
-
var StateHeatmapRequestSchema =
|
|
391
|
-
driver_id:
|
|
392
|
-
start_date:
|
|
393
|
-
end_date:
|
|
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)")
|
|
394
419
|
}).describe("Request schema for driver state heatmap");
|
|
395
|
-
var StateHeatmapEntrySchema =
|
|
396
|
-
count:
|
|
397
|
-
percentage:
|
|
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")
|
|
398
423
|
}).describe("Single state entry in the heatmap");
|
|
399
|
-
var StateHeatmapResponseSchema =
|
|
400
|
-
|
|
424
|
+
var StateHeatmapResponseSchema = import_zod12.z.record(
|
|
425
|
+
import_zod12.z.string().length(2),
|
|
401
426
|
StateHeatmapEntrySchema
|
|
402
427
|
).describe("Record of 2-letter state codes to heatmap entries");
|
|
403
428
|
|
|
404
429
|
// src/schemas/telemetry/manual-batch.ts
|
|
405
|
-
var
|
|
406
|
-
var ManualBatchEntrySchema =
|
|
407
|
-
driver_id:
|
|
408
|
-
timestamp:
|
|
409
|
-
location_latitude:
|
|
410
|
-
location_longitude:
|
|
411
|
-
location_address:
|
|
412
|
-
vehicle_odometer_miles:
|
|
413
|
-
heading:
|
|
414
|
-
speed_mph:
|
|
415
|
-
altitude_feet:
|
|
416
|
-
raw:
|
|
417
|
-
driving_status:
|
|
418
|
-
activity_type:
|
|
419
|
-
activity_confidence:
|
|
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)")
|
|
420
445
|
}).describe("Single manual telemetry entry");
|
|
421
|
-
var
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
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()
|
|
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()
|
|
447
469
|
}).describe("Telemetry record returned from manual batch insertion");
|
|
448
|
-
var ManualBatchResponseSchema =
|
|
449
|
-
message:
|
|
450
|
-
inserted_count:
|
|
451
|
-
telemetry:
|
|
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")
|
|
452
474
|
}).describe("Response schema for manual batch telemetry insertion");
|
|
453
475
|
|
|
454
476
|
// src/schemas/telemetry/bggeo-batch.ts
|
|
455
|
-
var
|
|
456
|
-
var BGGeoCoordsSchema =
|
|
457
|
-
latitude:
|
|
458
|
-
longitude:
|
|
459
|
-
accuracy:
|
|
460
|
-
speed:
|
|
461
|
-
heading:
|
|
462
|
-
altitude:
|
|
463
|
-
altitude_accuracy:
|
|
464
|
-
speed_accuracy:
|
|
465
|
-
heading_accuracy:
|
|
466
|
-
ellipsoidal_altitude:
|
|
467
|
-
floor:
|
|
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()
|
|
468
490
|
}).describe("BGGeo coords object");
|
|
469
|
-
var BGGeoActivitySchema =
|
|
470
|
-
type:
|
|
471
|
-
confidence:
|
|
491
|
+
var BGGeoActivitySchema = import_zod14.z.object({
|
|
492
|
+
type: import_zod14.z.string(),
|
|
493
|
+
confidence: import_zod14.z.number()
|
|
472
494
|
}).describe("BGGeo activity recognition");
|
|
473
|
-
var BGGeoBatterySchema =
|
|
474
|
-
is_charging:
|
|
475
|
-
level:
|
|
495
|
+
var BGGeoBatterySchema = import_zod14.z.object({
|
|
496
|
+
is_charging: import_zod14.z.boolean(),
|
|
497
|
+
level: import_zod14.z.number()
|
|
476
498
|
}).describe("BGGeo battery status");
|
|
477
|
-
var BGGeoLocationSchema =
|
|
499
|
+
var BGGeoLocationSchema = import_zod14.z.object({
|
|
478
500
|
coords: BGGeoCoordsSchema,
|
|
479
|
-
extras:
|
|
501
|
+
extras: import_zod14.z.object({}).passthrough().optional(),
|
|
480
502
|
activity: BGGeoActivitySchema.optional(),
|
|
481
503
|
battery: BGGeoBatterySchema.optional(),
|
|
482
|
-
timestamp:
|
|
483
|
-
is_moving:
|
|
484
|
-
odometer:
|
|
485
|
-
uuid:
|
|
486
|
-
event:
|
|
487
|
-
age:
|
|
488
|
-
geofence:
|
|
489
|
-
mock:
|
|
490
|
-
recorded_at:
|
|
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")
|
|
491
513
|
}).passthrough().describe("Single BGGeo location object");
|
|
492
|
-
var locationArray =
|
|
493
|
-
var locationOrArray =
|
|
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([
|
|
494
516
|
BGGeoLocationSchema.transform((loc) => [loc]),
|
|
495
517
|
locationArray
|
|
496
518
|
]);
|
|
497
|
-
var BGGeoBatchRequestSchema =
|
|
519
|
+
var BGGeoBatchRequestSchema = import_zod14.z.object({
|
|
498
520
|
location: locationOrArray.optional(),
|
|
499
521
|
locations: locationOrArray.optional()
|
|
500
522
|
}).refine((data) => data.location ?? data.locations, {
|
|
@@ -502,142 +524,169 @@ var BGGeoBatchRequestSchema = import_zod13.z.object({
|
|
|
502
524
|
}).describe("Request schema for BGGeo batch telemetry ingestion");
|
|
503
525
|
|
|
504
526
|
// src/schemas/trips/driver-trips.ts
|
|
505
|
-
var
|
|
506
|
-
var DriverTripsRequestSchema =
|
|
507
|
-
driver_id:
|
|
508
|
-
start_date:
|
|
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(),
|
|
509
531
|
// YYYY-MM-DD
|
|
510
|
-
end_date:
|
|
532
|
+
end_date: import_zod15.z.string()
|
|
511
533
|
// YYYY-MM-DD
|
|
512
534
|
});
|
|
513
|
-
var DriverTripSchema =
|
|
514
|
-
id:
|
|
515
|
-
start_time:
|
|
516
|
-
end_time:
|
|
517
|
-
point_count:
|
|
518
|
-
polyline:
|
|
519
|
-
highways:
|
|
520
|
-
total_miles:
|
|
521
|
-
avg_speed_mph:
|
|
522
|
-
miles_by_weather:
|
|
523
|
-
miles_by_light:
|
|
524
|
-
});
|
|
525
|
-
var DriverTripsResponseSchema =
|
|
526
|
-
var DriverDailySummarySchema =
|
|
527
|
-
summary_date:
|
|
528
|
-
total_miles:
|
|
529
|
-
trip_count:
|
|
530
|
-
point_count:
|
|
531
|
-
polyline:
|
|
532
|
-
highways:
|
|
533
|
-
avg_speed_mph:
|
|
534
|
-
miles_by_weather:
|
|
535
|
-
miles_by_light:
|
|
536
|
-
});
|
|
537
|
-
var DriverDailySummariesResponseSchema =
|
|
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);
|
|
538
560
|
|
|
539
561
|
// src/schemas/trips/enriched-trip-summary.ts
|
|
540
|
-
var
|
|
541
|
-
var EnrichedTripSummaryRequestSchema =
|
|
542
|
-
trip_id:
|
|
562
|
+
var import_zod16 = require("zod");
|
|
563
|
+
var EnrichedTripSummaryRequestSchema = import_zod16.z.object({
|
|
564
|
+
trip_id: import_zod16.z.number()
|
|
543
565
|
});
|
|
544
|
-
var DriverEnrichedSummariesRequestSchema =
|
|
545
|
-
driver_id:
|
|
546
|
-
start_date:
|
|
547
|
-
end_date:
|
|
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()
|
|
548
573
|
});
|
|
549
|
-
var
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
temperature_f: import_zod15.z.number().nullable(),
|
|
561
|
-
visibility_miles: import_zod15.z.number().nullable(),
|
|
562
|
-
light_condition: import_zod15.z.string().nullable(),
|
|
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(),
|
|
563
585
|
stop: EnrichedStopSchema.nullable()
|
|
564
586
|
});
|
|
565
|
-
var EnrichedTripSummarySchema =
|
|
566
|
-
trip_id:
|
|
567
|
-
driver_id:
|
|
568
|
-
start_time:
|
|
569
|
-
end_time:
|
|
570
|
-
points:
|
|
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)
|
|
571
593
|
});
|
|
572
594
|
var EnrichedTripSummaryResponseSchema = EnrichedTripSummarySchema;
|
|
573
|
-
var DriverEnrichedSummariesResponseSchema =
|
|
595
|
+
var DriverEnrichedSummariesResponseSchema = import_zod16.z.array(EnrichedTripSummarySchema);
|
|
574
596
|
|
|
575
597
|
// src/schemas/trips/convex-driver-trip.ts
|
|
576
|
-
var
|
|
577
|
-
var ConvexBreadcrumbEventSchema =
|
|
578
|
-
ts:
|
|
598
|
+
var import_zod17 = require("zod");
|
|
599
|
+
var ConvexBreadcrumbEventSchema = import_zod17.z.object({
|
|
600
|
+
ts: import_zod17.z.number(),
|
|
579
601
|
// epoch ms
|
|
580
|
-
status:
|
|
581
|
-
lat:
|
|
582
|
-
lon:
|
|
583
|
-
heading:
|
|
584
|
-
locationText:
|
|
585
|
-
speedKph:
|
|
586
|
-
altitudeFeet:
|
|
587
|
-
});
|
|
588
|
-
var ConvexDriverTripRequestSchema =
|
|
589
|
-
userId:
|
|
590
|
-
breadcrumbs:
|
|
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)
|
|
591
613
|
});
|
|
592
614
|
|
|
593
615
|
// src/schemas/trips/post-driver-trip-telemetry.ts
|
|
594
|
-
var
|
|
595
|
-
var PostDriverTripTelemetryRecordSchema =
|
|
596
|
-
location_latitude:
|
|
597
|
-
location_longitude:
|
|
598
|
-
location_address:
|
|
599
|
-
heading:
|
|
600
|
-
drivingState:
|
|
601
|
-
speedKph:
|
|
602
|
-
altitudeFeet:
|
|
603
|
-
gps_timestamp:
|
|
604
|
-
odometer:
|
|
605
|
-
activity_type:
|
|
606
|
-
activity_confidence:
|
|
607
|
-
});
|
|
608
|
-
var PostDriverTripTelemetryRequestSchema =
|
|
609
|
-
honkUserId:
|
|
610
|
-
telemetry:
|
|
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)
|
|
611
660
|
});
|
|
612
661
|
|
|
613
662
|
// src/auth-data.ts
|
|
614
|
-
var
|
|
615
|
-
var GomotiveAuthDataSchema =
|
|
616
|
-
kind:
|
|
617
|
-
token:
|
|
618
|
-
ownerOperator:
|
|
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()
|
|
619
668
|
});
|
|
620
|
-
var VistaAuthDataSchema =
|
|
621
|
-
kind:
|
|
622
|
-
driverId:
|
|
623
|
-
cookie:
|
|
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()
|
|
624
673
|
});
|
|
625
|
-
var MockAuthDataSchema =
|
|
626
|
-
kind:
|
|
627
|
-
cookie:
|
|
674
|
+
var MockAuthDataSchema = import_zod20.z.object({
|
|
675
|
+
kind: import_zod20.z.literal("mock"),
|
|
676
|
+
cookie: import_zod20.z.string()
|
|
628
677
|
});
|
|
629
|
-
var NoneAuthDataSchema =
|
|
630
|
-
kind:
|
|
678
|
+
var NoneAuthDataSchema = import_zod20.z.object({
|
|
679
|
+
kind: import_zod20.z.literal("none")
|
|
631
680
|
});
|
|
632
|
-
var ProviderAuthDataSchema =
|
|
681
|
+
var ProviderAuthDataSchema = import_zod20.z.discriminatedUnion("kind", [
|
|
633
682
|
GomotiveAuthDataSchema,
|
|
634
683
|
VistaAuthDataSchema,
|
|
635
684
|
MockAuthDataSchema,
|
|
636
685
|
NoneAuthDataSchema
|
|
637
686
|
]);
|
|
638
|
-
var LegacyVistaAuthSchema =
|
|
639
|
-
driverId:
|
|
640
|
-
cookie:
|
|
687
|
+
var LegacyVistaAuthSchema = import_zod20.z.object({
|
|
688
|
+
driverId: import_zod20.z.string(),
|
|
689
|
+
cookie: import_zod20.z.string()
|
|
641
690
|
});
|
|
642
691
|
function serializeAuthData(data) {
|
|
643
692
|
if (data.kind === "none") {
|
|
@@ -673,46 +722,46 @@ function deserializeAuthData(authToken) {
|
|
|
673
722
|
}
|
|
674
723
|
|
|
675
724
|
// src/browser-auth.ts
|
|
676
|
-
var
|
|
677
|
-
var CapturedTrafficEntrySchema =
|
|
678
|
-
method:
|
|
679
|
-
url:
|
|
680
|
-
status:
|
|
681
|
-
responseBody:
|
|
682
|
-
});
|
|
683
|
-
var BrowserAuthRequestSchema =
|
|
684
|
-
providerStub:
|
|
685
|
-
providerUrl:
|
|
686
|
-
username:
|
|
687
|
-
encryptedPassword:
|
|
688
|
-
captureTraffic:
|
|
689
|
-
});
|
|
690
|
-
var BrowserAuthSuccessSchema =
|
|
691
|
-
success:
|
|
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),
|
|
692
741
|
authData: ProviderAuthDataSchema,
|
|
693
|
-
capturedTraffic:
|
|
742
|
+
capturedTraffic: import_zod21.z.array(CapturedTrafficEntrySchema).optional()
|
|
694
743
|
});
|
|
695
|
-
var BrowserAuthFailureSchema =
|
|
696
|
-
success:
|
|
697
|
-
error:
|
|
744
|
+
var BrowserAuthFailureSchema = import_zod21.z.object({
|
|
745
|
+
success: import_zod21.z.literal(false),
|
|
746
|
+
error: import_zod21.z.string()
|
|
698
747
|
});
|
|
699
|
-
var BrowserAuthResponseSchema =
|
|
748
|
+
var BrowserAuthResponseSchema = import_zod21.z.discriminatedUnion("success", [
|
|
700
749
|
BrowserAuthSuccessSchema,
|
|
701
750
|
BrowserAuthFailureSchema
|
|
702
751
|
]);
|
|
703
|
-
var CrawlPageSchema =
|
|
704
|
-
url:
|
|
705
|
-
html:
|
|
752
|
+
var CrawlPageSchema = import_zod21.z.object({
|
|
753
|
+
url: import_zod21.z.string(),
|
|
754
|
+
html: import_zod21.z.string()
|
|
706
755
|
});
|
|
707
|
-
var BrowserCrawlSuccessSchema =
|
|
708
|
-
success:
|
|
709
|
-
pages:
|
|
756
|
+
var BrowserCrawlSuccessSchema = import_zod21.z.object({
|
|
757
|
+
success: import_zod21.z.literal(true),
|
|
758
|
+
pages: import_zod21.z.array(CrawlPageSchema)
|
|
710
759
|
});
|
|
711
|
-
var BrowserCrawlFailureSchema =
|
|
712
|
-
success:
|
|
713
|
-
error:
|
|
760
|
+
var BrowserCrawlFailureSchema = import_zod21.z.object({
|
|
761
|
+
success: import_zod21.z.literal(false),
|
|
762
|
+
error: import_zod21.z.string()
|
|
714
763
|
});
|
|
715
|
-
var BrowserCrawlResponseSchema =
|
|
764
|
+
var BrowserCrawlResponseSchema = import_zod21.z.discriminatedUnion("success", [
|
|
716
765
|
BrowserCrawlSuccessSchema,
|
|
717
766
|
BrowserCrawlFailureSchema
|
|
718
767
|
]);
|
|
@@ -767,7 +816,6 @@ var BrowserCrawlResponseSchema = import_zod19.z.discriminatedUnion("success", [
|
|
|
767
816
|
ListDriversRequestSchema,
|
|
768
817
|
ListDriversResponseSchema,
|
|
769
818
|
ManualBatchEntrySchema,
|
|
770
|
-
ManualBatchRequestSchema,
|
|
771
819
|
ManualBatchResponseSchema,
|
|
772
820
|
ManualBatchTelemetrySchema,
|
|
773
821
|
MockAuthDataSchema,
|
|
@@ -785,6 +833,8 @@ var BrowserCrawlResponseSchema = import_zod19.z.discriminatedUnion("success", [
|
|
|
785
833
|
PatchDriverDriverResponseSchema,
|
|
786
834
|
PatchDriverRequestSchema,
|
|
787
835
|
PatchDriverResponseSchema,
|
|
836
|
+
PostDailySummaryRecordSchema,
|
|
837
|
+
PostDailySummaryRequestSchema,
|
|
788
838
|
PostDriverTripTelemetryRecordSchema,
|
|
789
839
|
PostDriverTripTelemetryRequestSchema,
|
|
790
840
|
ProviderAuthDataSchema,
|
|
@@ -795,6 +845,8 @@ var BrowserCrawlResponseSchema = import_zod19.z.discriminatedUnion("success", [
|
|
|
795
845
|
StateHeatmapResponseSchema,
|
|
796
846
|
TruckTypeSchema,
|
|
797
847
|
UpdateScrapeStatusMessage,
|
|
848
|
+
ValidateLoginRequestSchema,
|
|
849
|
+
ValidateLoginResponseSchema,
|
|
798
850
|
ValidatePasswordRequestSchema,
|
|
799
851
|
ValidatePasswordResponseSchema,
|
|
800
852
|
VistaAuthDataSchema,
|