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