@findatruck/shared-schemas 2.16.0 → 2.18.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
@@ -47,13 +47,27 @@ __export(index_exports, {
47
47
  ConvexUpdateSchema: () => ConvexUpdateSchema,
48
48
  CrawlPageSchema: () => CrawlPageSchema,
49
49
  CreateAnonymousDriverBodySchema: () => CreateAnonymousDriverBodySchema,
50
+ DRIVER_NAME_FORBIDDEN_CHAR_PATTERN: () => DRIVER_NAME_FORBIDDEN_CHAR_PATTERN,
50
51
  DeleteAnonymousDriverParamsSchema: () => DeleteAnonymousDriverParamsSchema,
51
52
  DeleteAnonymousDriverResponseSchema: () => DeleteAnonymousDriverResponseSchema,
52
53
  DeleteProviderAccountRequestSchema: () => DeleteProviderAccountRequestSchema,
53
54
  DeleteProviderAccountResponseSchema: () => DeleteProviderAccountResponseSchema,
55
+ DriverDailySummariesResponseSchema: () => DriverDailySummariesResponseSchema,
56
+ DriverDailySummarySchema: () => DriverDailySummarySchema,
57
+ DriverEnrichedSummariesRequestSchema: () => DriverEnrichedSummariesRequestSchema,
58
+ DriverEnrichedSummariesResponseSchema: () => DriverEnrichedSummariesResponseSchema,
59
+ DriverNameSchema: () => DriverNameSchema,
54
60
  DriverRankingSchema: () => DriverRankingSchema,
55
61
  DriverRankingsRequestSchema: () => DriverRankingsRequestSchema,
56
62
  DriverRankingsResponseSchema: () => DriverRankingsResponseSchema,
63
+ DriverTripSchema: () => DriverTripSchema,
64
+ DriverTripsRequestSchema: () => DriverTripsRequestSchema,
65
+ DriverTripsResponseSchema: () => DriverTripsResponseSchema,
66
+ EnrichedPointSchema: () => EnrichedPointSchema,
67
+ EnrichedStopSchema: () => EnrichedStopSchema,
68
+ EnrichedTripSummaryRequestSchema: () => EnrichedTripSummaryRequestSchema,
69
+ EnrichedTripSummaryResponseSchema: () => EnrichedTripSummaryResponseSchema,
70
+ EnrichedTripSummarySchema: () => EnrichedTripSummarySchema,
57
71
  GomotiveAuthDataSchema: () => GomotiveAuthDataSchema,
58
72
  ManualBatchEntrySchema: () => ManualBatchEntrySchema,
59
73
  ManualBatchRequestSchema: () => ManualBatchRequestSchema,
@@ -69,8 +83,13 @@ __export(index_exports, {
69
83
  NewLoginResponseSuccess: () => NewLoginResponseSuccess,
70
84
  NewLoginResponseSuccessSchema: () => NewLoginResponseSuccessSchema,
71
85
  NoneAuthDataSchema: () => NoneAuthDataSchema,
86
+ PATCH_DRIVER_NAME_MAX_LENGTH: () => PATCH_DRIVER_NAME_MAX_LENGTH,
87
+ PatchDriverDriverResponseSchema: () => PatchDriverDriverResponseSchema,
88
+ PatchDriverRequestSchema: () => PatchDriverRequestSchema,
89
+ PatchDriverResponseSchema: () => PatchDriverResponseSchema,
72
90
  ProviderAuthDataSchema: () => ProviderAuthDataSchema,
73
91
  ScrapeStatus: () => ScrapeStatus,
92
+ SharedDriverResponseSchema: () => SharedDriverResponseSchema,
74
93
  StateHeatmapEntrySchema: () => StateHeatmapEntrySchema,
75
94
  StateHeatmapRequestSchema: () => StateHeatmapRequestSchema,
76
95
  StateHeatmapResponseSchema: () => StateHeatmapResponseSchema,
@@ -198,8 +217,85 @@ var DeleteAnonymousDriverResponseSchema = import_zod3.default.object({
198
217
  user_id: import_zod3.default.string()
199
218
  });
200
219
 
201
- // src/schemas/providerAccounts/update-status.ts
220
+ // src/schemas/drivers/driver.ts
202
221
  var import_zod4 = __toESM(require("zod"), 1);
222
+ var SharedDriverResponseSchema = import_zod4.default.object({
223
+ // The `drivers.id` column is a Postgres UUID (migration 0001), and every
224
+ // input-side schema (`IdParamsSchema`, `PatchDriverRequestSchema.driver_id`)
225
+ // is already `z.uuid()`. Tightening the response side keeps the contract
226
+ // symmetric — a client that statically relies on `id` being UUID-shaped on
227
+ // input can rely on the same on output. `eld_external_id` stays loose
228
+ // because providers emit non-UUID identifiers there.
229
+ id: import_zod4.default.uuid(),
230
+ name: import_zod4.default.string(),
231
+ eld_external_id: import_zod4.default.string(),
232
+ license_number: import_zod4.default.string().nullable(),
233
+ license_state: import_zod4.default.string().nullable(),
234
+ license_expiration_date: import_zod4.default.string().nullable(),
235
+ license_class: import_zod4.default.string().nullable(),
236
+ is_placeholder: import_zod4.default.boolean(),
237
+ created_at: import_zod4.default.union([import_zod4.default.string(), import_zod4.default.date()]),
238
+ updated_at: import_zod4.default.union([import_zod4.default.string(), import_zod4.default.date()]),
239
+ last_location_latitude: import_zod4.default.number().nullable(),
240
+ last_location_longitude: import_zod4.default.number().nullable()
241
+ });
242
+
243
+ // src/schemas/drivers/patch-driver.ts
244
+ var import_zod5 = __toESM(require("zod"), 1);
245
+ var PATCH_DRIVER_NAME_MAX_LENGTH = 255;
246
+ var DRIVER_NAME_FORBIDDEN_RANGES = [
247
+ [0, 31],
248
+ // C0 controls (includes NUL, CR, LF, TAB)
249
+ [127, 159],
250
+ // DEL + C1 controls
251
+ [8203, 8205],
252
+ // ZWSP, ZWNJ, ZWJ
253
+ [65279, 65279],
254
+ // BOM / ZWNBSP
255
+ [8234, 8238],
256
+ // bidi overrides
257
+ [8294, 8297]
258
+ // bidi isolates
259
+ ];
260
+ var buildForbiddenCharPattern = () => {
261
+ const cls = DRIVER_NAME_FORBIDDEN_RANGES.map(([lo, hi]) => {
262
+ const loEsc = "\\u" + lo.toString(16).padStart(4, "0");
263
+ if (lo === hi) return loEsc;
264
+ const hiEsc = "\\u" + hi.toString(16).padStart(4, "0");
265
+ return `${loEsc}-${hiEsc}`;
266
+ }).join("");
267
+ return new RegExp(`[${cls}]`);
268
+ };
269
+ var DRIVER_NAME_FORBIDDEN_CHAR_PATTERN = buildForbiddenCharPattern();
270
+ var DriverNameSchema = import_zod5.default.string().trim().min(1).max(PATCH_DRIVER_NAME_MAX_LENGTH).refine(
271
+ (s) => !DRIVER_NAME_FORBIDDEN_CHAR_PATTERN.test(s),
272
+ {
273
+ message: "name contains disallowed control, zero-width, or bidirectional-override characters"
274
+ }
275
+ );
276
+ var PatchDriverRequestSchema = import_zod5.default.object({
277
+ driver_id: import_zod5.default.uuid(),
278
+ // Tenant scoping: the caller MUST identify which provider account owns the
279
+ // driver. The aggregator verifies (provider_account_id, driver_id) exists in
280
+ // `provider_account_to_driver` before mutating, preventing cross-tenant IDOR.
281
+ provider_account_id: import_zod5.default.uuid(),
282
+ name: DriverNameSchema
283
+ });
284
+ var PatchDriverDriverResponseSchema = SharedDriverResponseSchema.pick({
285
+ id: true,
286
+ name: true,
287
+ eld_external_id: true,
288
+ is_placeholder: true,
289
+ created_at: true,
290
+ updated_at: true
291
+ }).strict();
292
+ var PatchDriverResponseSchema = import_zod5.default.object({
293
+ message: import_zod5.default.string(),
294
+ driver: PatchDriverDriverResponseSchema
295
+ });
296
+
297
+ // src/schemas/providerAccounts/update-status.ts
298
+ var import_zod6 = __toESM(require("zod"), 1);
203
299
  var ScrapeStatus = /* @__PURE__ */ ((ScrapeStatus2) => {
204
300
  ScrapeStatus2["NEW_LOGIN_RECEIVED"] = "NEW_LOGIN_RECEIVED";
205
301
  ScrapeStatus2["LOGIN_IN_PROGRESS"] = "LOGIN_IN_PROGRESS";
@@ -212,140 +308,213 @@ var ScrapeStatus = /* @__PURE__ */ ((ScrapeStatus2) => {
212
308
  ScrapeStatus2["DATA_FETCH_FAILED"] = "DATA_FETCH_FAILED";
213
309
  return ScrapeStatus2;
214
310
  })(ScrapeStatus || {});
215
- var UpdateScrapeStatusMessage = import_zod4.default.object({
216
- status: import_zod4.default.nativeEnum(ScrapeStatus).describe("The current status of the scrape process"),
217
- correctPassword: import_zod4.default.boolean().optional().describe("Indicates if the provided password was correct, if applicable"),
218
- externalProviderAccountId: import_zod4.default.string().describe("The external identifier for the provider account (convex ID or similar)"),
219
- username: import_zod4.default.string().describe("The username of the provider account whose status is being updated"),
220
- provider_url: import_zod4.default.string().describe("The URL of the ELD provider"),
221
- driverCount: import_zod4.default.number().optional().describe("The number of drivers associated with the account, if applicable"),
222
- providerSlug: import_zod4.default.string().optional().describe("The slug identifier for the provider")
311
+ var UpdateScrapeStatusMessage = import_zod6.default.object({
312
+ status: import_zod6.default.nativeEnum(ScrapeStatus).describe("The current status of the scrape process"),
313
+ correctPassword: import_zod6.default.boolean().optional().describe("Indicates if the provided password was correct, if applicable"),
314
+ externalProviderAccountId: import_zod6.default.string().describe("The external identifier for the provider account (convex ID or similar)"),
315
+ username: import_zod6.default.string().describe("The username of the provider account whose status is being updated"),
316
+ provider_url: import_zod6.default.string().describe("The URL of the ELD provider"),
317
+ driverCount: import_zod6.default.number().optional().describe("The number of drivers associated with the account, if applicable"),
318
+ providerSlug: import_zod6.default.string().optional().describe("The slug identifier for the provider")
223
319
  }).describe("Schema for update status messages");
224
320
 
225
321
  // src/schemas/providerAccounts/validate-password.ts
226
- var import_zod5 = require("zod");
227
- var ValidatePasswordRequestSchema = import_zod5.z.object({
228
- providerAccountId: import_zod5.z.string().min(1).describe("The unique identifier of the provider account in postgres to validate the password for"),
229
- encryptedPassword: import_zod5.z.string().min(1).describe("The encrypted password to validate against the stored password")
322
+ var import_zod7 = require("zod");
323
+ var ValidatePasswordRequestSchema = import_zod7.z.object({
324
+ providerAccountId: import_zod7.z.string().min(1).describe("The unique identifier of the provider account in postgres to validate the password for"),
325
+ encryptedPassword: import_zod7.z.string().min(1).describe("The encrypted password to validate against the stored password")
230
326
  }).describe("Request schema for validating a provider account password");
231
- var ValidatePasswordResponseSchema = import_zod5.z.object({
232
- isValid: import_zod5.z.boolean().describe("Indicates if the provided password is valid"),
233
- driverIds: import_zod5.z.array(import_zod5.z.string()).describe("List of driver IDs associated with the provider account")
327
+ var ValidatePasswordResponseSchema = import_zod7.z.object({
328
+ isValid: import_zod7.z.boolean().describe("Indicates if the provided password is valid"),
329
+ driverIds: import_zod7.z.array(import_zod7.z.string()).describe("List of driver IDs associated with the provider account")
234
330
  }).describe("Response schema for password validation");
235
331
 
236
332
  // src/schemas/providerAccounts/delete-provider-account.ts
237
- var import_zod6 = require("zod");
238
- var DeleteProviderAccountRequestSchema = import_zod6.z.object({
239
- providerAccountId: import_zod6.z.string().min(1).describe("The external provider account ID to delete")
333
+ var import_zod8 = require("zod");
334
+ var DeleteProviderAccountRequestSchema = import_zod8.z.object({
335
+ providerAccountId: import_zod8.z.string().min(1).describe("The external provider account ID to delete")
240
336
  }).describe("Request schema for deleting a provider account");
241
- var DeleteProviderAccountResponseSchema = import_zod6.z.object({
242
- success: import_zod6.z.boolean().describe("Indicates if the provider account was successfully deleted")
337
+ var DeleteProviderAccountResponseSchema = import_zod8.z.object({
338
+ success: import_zod8.z.boolean().describe("Indicates if the provider account was successfully deleted")
243
339
  }).describe("Response schema for provider account deletion");
244
340
 
245
341
  // src/schemas/telemetry/driver-rankings.ts
246
- var import_zod7 = require("zod");
247
- var DriverRankingsRequestSchema = import_zod7.z.object({
248
- start_date: import_zod7.z.string().describe("Start date for the ranking period (ISO 8601 format)"),
249
- end_date: import_zod7.z.string().describe("End date for the ranking period (ISO 8601 format)"),
250
- state: import_zod7.z.string().length(2).optional().describe("Optional 2-letter state abbreviation to filter telemetry by location"),
251
- source: import_zod7.z.enum(["eld", "manual"]).default("manual").describe("Telemetry source to rank by: 'manual' uses GPS odometer, 'eld' uses calculated distance")
342
+ var import_zod9 = require("zod");
343
+ var DriverRankingsRequestSchema = import_zod9.z.object({
344
+ start_date: import_zod9.z.string().describe("Start date for the ranking period (ISO 8601 format)"),
345
+ end_date: import_zod9.z.string().describe("End date for the ranking period (ISO 8601 format)"),
346
+ state: import_zod9.z.string().length(2).optional().describe("Optional 2-letter state abbreviation to filter telemetry by location"),
347
+ source: import_zod9.z.enum(["eld", "manual"]).default("manual").describe("Telemetry source to rank by: 'manual' uses GPS odometer, 'eld' uses calculated distance")
252
348
  }).describe("Request schema for driver rankings by miles driven");
253
- var DriverRankingSchema = import_zod7.z.object({
254
- rank: import_zod7.z.number().int().positive().describe("Rank position based on miles driven"),
255
- driver_id: import_zod7.z.string().uuid().describe("Unique identifier of the driver"),
256
- driver_name: import_zod7.z.string().describe("Name of the driver"),
257
- total_miles: import_zod7.z.number().min(0).describe("Total miles driven in the specified period")
349
+ var DriverRankingSchema = import_zod9.z.object({
350
+ rank: import_zod9.z.number().int().positive().describe("Rank position based on miles driven"),
351
+ driver_id: import_zod9.z.string().uuid().describe("Unique identifier of the driver"),
352
+ driver_name: import_zod9.z.string().describe("Name of the driver"),
353
+ total_miles: import_zod9.z.number().min(0).describe("Total miles driven in the specified period")
258
354
  }).describe("Single driver ranking entry");
259
- var DriverRankingsResponseSchema = import_zod7.z.array(DriverRankingSchema).describe("Array of driver rankings sorted by miles driven in descending order");
355
+ var DriverRankingsResponseSchema = import_zod9.z.array(DriverRankingSchema).describe("Array of driver rankings sorted by miles driven in descending order");
260
356
 
261
357
  // src/schemas/telemetry/state-heatmap.ts
262
- var import_zod8 = require("zod");
263
- var StateHeatmapRequestSchema = import_zod8.z.object({
264
- driver_id: import_zod8.z.string().uuid().describe("Unique identifier of the driver"),
265
- start_date: import_zod8.z.string().describe("Start date for the heatmap period (ISO 8601 format)"),
266
- end_date: import_zod8.z.string().describe("End date for the heatmap period (ISO 8601 format)")
358
+ var import_zod10 = require("zod");
359
+ var StateHeatmapRequestSchema = import_zod10.z.object({
360
+ driver_id: import_zod10.z.string().uuid().describe("Unique identifier of the driver"),
361
+ start_date: import_zod10.z.string().describe("Start date for the heatmap period (ISO 8601 format)"),
362
+ end_date: import_zod10.z.string().describe("End date for the heatmap period (ISO 8601 format)")
267
363
  }).describe("Request schema for driver state heatmap");
268
- var StateHeatmapEntrySchema = import_zod8.z.object({
269
- count: import_zod8.z.number().int().min(0).describe("Number of telemetry points in this state"),
270
- percentage: import_zod8.z.number().min(0).max(100).describe("Percentage of total telemetry points in this state")
364
+ var StateHeatmapEntrySchema = import_zod10.z.object({
365
+ count: import_zod10.z.number().int().min(0).describe("Number of telemetry points in this state"),
366
+ percentage: import_zod10.z.number().min(0).max(100).describe("Percentage of total telemetry points in this state")
271
367
  }).describe("Single state entry in the heatmap");
272
- var StateHeatmapResponseSchema = import_zod8.z.record(
273
- import_zod8.z.string().length(2),
368
+ var StateHeatmapResponseSchema = import_zod10.z.record(
369
+ import_zod10.z.string().length(2),
274
370
  StateHeatmapEntrySchema
275
371
  ).describe("Record of 2-letter state codes to heatmap entries");
276
372
 
277
373
  // src/schemas/telemetry/manual-batch.ts
278
- var import_zod9 = require("zod");
279
- var ManualBatchEntrySchema = import_zod9.z.object({
280
- driver_id: import_zod9.z.string().uuid().describe("Internal UUID of the driver"),
281
- timestamp: import_zod9.z.string().datetime().describe("Timestamp of the GPS reading (ISO 8601 format)"),
282
- location_latitude: import_zod9.z.number().min(-90).max(90).describe("GPS latitude coordinate"),
283
- location_longitude: import_zod9.z.number().min(-180).max(180).describe("GPS longitude coordinate"),
284
- location_address: import_zod9.z.string().optional().describe("Optional human-readable address"),
285
- vehicle_odometer_miles: import_zod9.z.number().min(0).optional().describe("Optional vehicle odometer reading in miles"),
286
- heading: import_zod9.z.number().min(0).max(360).optional().describe("Optional GPS heading in degrees (0-360)"),
287
- speed_mph: import_zod9.z.number().min(0).optional().describe("Optional GPS speed in miles per hour"),
288
- altitude_feet: import_zod9.z.number().optional().describe("Optional GPS altitude in feet"),
289
- raw: import_zod9.z.record(import_zod9.z.string(), import_zod9.z.unknown()).optional().describe("Optional raw upstream JSON payload to archive alongside this entry")
374
+ var import_zod11 = require("zod");
375
+ var ManualBatchEntrySchema = import_zod11.z.object({
376
+ driver_id: import_zod11.z.string().uuid().describe("Internal UUID of the driver"),
377
+ timestamp: import_zod11.z.string().datetime().describe("Timestamp of the GPS reading (ISO 8601 format)"),
378
+ location_latitude: import_zod11.z.number().min(-90).max(90).describe("GPS latitude coordinate"),
379
+ location_longitude: import_zod11.z.number().min(-180).max(180).describe("GPS longitude coordinate"),
380
+ location_address: import_zod11.z.string().optional().describe("Optional human-readable address"),
381
+ vehicle_odometer_miles: import_zod11.z.number().min(0).optional().describe("Optional vehicle odometer reading in miles"),
382
+ heading: import_zod11.z.number().min(0).max(360).optional().describe("Optional GPS heading in degrees (0-360)"),
383
+ speed_mph: import_zod11.z.number().min(0).optional().describe("Optional GPS speed in miles per hour"),
384
+ altitude_feet: import_zod11.z.number().optional().describe("Optional GPS altitude in feet"),
385
+ 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"),
386
+ driving_status: import_zod11.z.enum(["parked", "driving"]).optional().describe("Optional parked/driving status reported by the upstream system")
290
387
  }).describe("Single manual telemetry entry");
291
- var ManualBatchRequestSchema = import_zod9.z.object({
292
- entries: import_zod9.z.array(ManualBatchEntrySchema).min(1).max(1e3).describe("Array of manual telemetry entries (1-1000)")
388
+ var ManualBatchRequestSchema = import_zod11.z.object({
389
+ entries: import_zod11.z.array(ManualBatchEntrySchema).min(1).max(1e3).describe("Array of manual telemetry entries (1-1000)")
293
390
  }).describe("Request schema for manual batch telemetry insertion");
294
- var ManualBatchTelemetrySchema = import_zod9.z.object({
295
- id: import_zod9.z.number().int().describe("Telemetry record ID"),
296
- driver_id: import_zod9.z.string().uuid().describe("Internal UUID of the driver"),
297
- timestamp: import_zod9.z.union([import_zod9.z.string(), import_zod9.z.date()]).describe("Timestamp of the telemetry reading"),
298
- remaining_drive_time_in_seconds: import_zod9.z.number().min(0),
299
- remaining_shift_time_in_seconds: import_zod9.z.number().min(0),
300
- remaining_cycle_time_in_seconds: import_zod9.z.number().min(0),
301
- remaining_break_time_in_seconds: import_zod9.z.number().min(0),
302
- location_latitude: import_zod9.z.number().min(-90).max(90),
303
- location_longitude: import_zod9.z.number().min(-180).max(180),
304
- previous_location_latitude: import_zod9.z.number().min(-90).max(90).nullable(),
305
- previous_location_longitude: import_zod9.z.number().min(-180).max(180).nullable(),
306
- location_address: import_zod9.z.string().nullable(),
307
- location_state: import_zod9.z.string().length(2).nullable(),
308
- echoed_odometer_miles: import_zod9.z.number().min(0).nullable().describe("Vehicle odometer reading echoed back from the request (miles)"),
309
- osrm_calculated_miles: import_zod9.z.number().min(0).nullable().describe("Road distance calculated by OSRM between this point and the previous point (miles)"),
310
- heading: import_zod9.z.number().nullish(),
311
- speed_mph: import_zod9.z.number().nullish(),
312
- altitude_feet: import_zod9.z.number().nullish(),
313
- source: import_zod9.z.enum(["eld", "manual"])
391
+ var ManualBatchTelemetrySchema = import_zod11.z.object({
392
+ id: import_zod11.z.number().int().describe("Telemetry record ID"),
393
+ driver_id: import_zod11.z.string().uuid().describe("Internal UUID of the driver"),
394
+ timestamp: import_zod11.z.union([import_zod11.z.string(), import_zod11.z.date()]).describe("Timestamp of the telemetry reading"),
395
+ remaining_drive_time_in_seconds: import_zod11.z.number().min(0),
396
+ remaining_shift_time_in_seconds: import_zod11.z.number().min(0),
397
+ remaining_cycle_time_in_seconds: import_zod11.z.number().min(0),
398
+ remaining_break_time_in_seconds: import_zod11.z.number().min(0),
399
+ location_latitude: import_zod11.z.number().min(-90).max(90),
400
+ location_longitude: import_zod11.z.number().min(-180).max(180),
401
+ previous_location_latitude: import_zod11.z.number().min(-90).max(90).nullable(),
402
+ previous_location_longitude: import_zod11.z.number().min(-180).max(180).nullable(),
403
+ location_address: import_zod11.z.string().nullable(),
404
+ location_state: import_zod11.z.string().length(2).nullable(),
405
+ echoed_odometer_miles: import_zod11.z.number().min(0).nullable().describe("Vehicle odometer reading echoed back from the request (miles)"),
406
+ osrm_calculated_miles: import_zod11.z.number().min(0).nullable().describe("Road distance calculated by OSRM between this point and the previous point (miles)"),
407
+ heading: import_zod11.z.number().nullish(),
408
+ speed_mph: import_zod11.z.number().nullish(),
409
+ altitude_feet: import_zod11.z.number().nullish(),
410
+ source: import_zod11.z.enum(["eld", "manual"]),
411
+ driving_status: import_zod11.z.enum(["parked", "driving"]).nullable()
314
412
  }).describe("Telemetry record returned from manual batch insertion");
315
- var ManualBatchResponseSchema = import_zod9.z.object({
316
- message: import_zod9.z.string().describe("Success message"),
317
- inserted_count: import_zod9.z.number().int().min(0).describe("Number of telemetry entries inserted"),
318
- telemetry: import_zod9.z.array(ManualBatchTelemetrySchema).describe("Array of inserted telemetry records")
413
+ var ManualBatchResponseSchema = import_zod11.z.object({
414
+ message: import_zod11.z.string().describe("Success message"),
415
+ inserted_count: import_zod11.z.number().int().min(0).describe("Number of telemetry entries inserted"),
416
+ telemetry: import_zod11.z.array(ManualBatchTelemetrySchema).describe("Array of inserted telemetry records")
319
417
  }).describe("Response schema for manual batch telemetry insertion");
320
418
 
419
+ // src/schemas/trips/driver-trips.ts
420
+ var import_zod12 = require("zod");
421
+ var DriverTripsRequestSchema = import_zod12.z.object({
422
+ driver_id: import_zod12.z.string().uuid(),
423
+ start_date: import_zod12.z.string(),
424
+ // YYYY-MM-DD
425
+ end_date: import_zod12.z.string()
426
+ // YYYY-MM-DD
427
+ });
428
+ var DriverTripSchema = import_zod12.z.object({
429
+ id: import_zod12.z.number(),
430
+ start_time: import_zod12.z.string(),
431
+ end_time: import_zod12.z.string(),
432
+ point_count: import_zod12.z.number(),
433
+ polyline: import_zod12.z.string().nullable(),
434
+ highways: import_zod12.z.array(import_zod12.z.string()).nullable(),
435
+ total_miles: import_zod12.z.number().nullable(),
436
+ avg_speed_mph: import_zod12.z.number().nullable(),
437
+ miles_by_weather: import_zod12.z.record(import_zod12.z.string(), import_zod12.z.number()).nullable(),
438
+ miles_by_light: import_zod12.z.record(import_zod12.z.string(), import_zod12.z.number()).nullable()
439
+ });
440
+ var DriverTripsResponseSchema = import_zod12.z.array(DriverTripSchema);
441
+ var DriverDailySummarySchema = import_zod12.z.object({
442
+ summary_date: import_zod12.z.string(),
443
+ total_miles: import_zod12.z.number(),
444
+ trip_count: import_zod12.z.number(),
445
+ point_count: import_zod12.z.number(),
446
+ polyline: import_zod12.z.string().nullable(),
447
+ highways: import_zod12.z.array(import_zod12.z.string()).nullable(),
448
+ avg_speed_mph: import_zod12.z.number().nullable(),
449
+ miles_by_weather: import_zod12.z.record(import_zod12.z.string(), import_zod12.z.number()).nullable(),
450
+ miles_by_light: import_zod12.z.record(import_zod12.z.string(), import_zod12.z.number()).nullable()
451
+ });
452
+ var DriverDailySummariesResponseSchema = import_zod12.z.array(DriverDailySummarySchema);
453
+
454
+ // src/schemas/trips/enriched-trip-summary.ts
455
+ var import_zod13 = require("zod");
456
+ var EnrichedTripSummaryRequestSchema = import_zod13.z.object({
457
+ trip_id: import_zod13.z.number()
458
+ });
459
+ var DriverEnrichedSummariesRequestSchema = import_zod13.z.object({
460
+ driver_id: import_zod13.z.string().uuid(),
461
+ start_date: import_zod13.z.string(),
462
+ end_date: import_zod13.z.string()
463
+ });
464
+ var EnrichedStopSchema = import_zod13.z.object({
465
+ duration_seconds: import_zod13.z.number()
466
+ });
467
+ var EnrichedPointSchema = import_zod13.z.object({
468
+ lat: import_zod13.z.number(),
469
+ lon: import_zod13.z.number(),
470
+ timestamp: import_zod13.z.string(),
471
+ speed_mph: import_zod13.z.number().nullable(),
472
+ heading: import_zod13.z.number().nullable(),
473
+ altitude_feet: import_zod13.z.number().nullable(),
474
+ weather_condition: import_zod13.z.string().nullable(),
475
+ temperature_f: import_zod13.z.number().nullable(),
476
+ visibility_miles: import_zod13.z.number().nullable(),
477
+ light_condition: import_zod13.z.string().nullable(),
478
+ stop: EnrichedStopSchema.nullable()
479
+ });
480
+ var EnrichedTripSummarySchema = import_zod13.z.object({
481
+ trip_id: import_zod13.z.number(),
482
+ driver_id: import_zod13.z.string(),
483
+ start_time: import_zod13.z.string(),
484
+ end_time: import_zod13.z.string(),
485
+ points: import_zod13.z.array(EnrichedPointSchema)
486
+ });
487
+ var EnrichedTripSummaryResponseSchema = EnrichedTripSummarySchema;
488
+ var DriverEnrichedSummariesResponseSchema = import_zod13.z.array(EnrichedTripSummarySchema);
489
+
321
490
  // src/auth-data.ts
322
- var import_zod10 = require("zod");
323
- var GomotiveAuthDataSchema = import_zod10.z.object({
324
- kind: import_zod10.z.literal("gomotive"),
325
- token: import_zod10.z.string(),
326
- ownerOperator: import_zod10.z.boolean()
491
+ var import_zod14 = require("zod");
492
+ var GomotiveAuthDataSchema = import_zod14.z.object({
493
+ kind: import_zod14.z.literal("gomotive"),
494
+ token: import_zod14.z.string(),
495
+ ownerOperator: import_zod14.z.boolean()
327
496
  });
328
- var VistaAuthDataSchema = import_zod10.z.object({
329
- kind: import_zod10.z.literal("vista"),
330
- driverId: import_zod10.z.string(),
331
- cookie: import_zod10.z.string()
497
+ var VistaAuthDataSchema = import_zod14.z.object({
498
+ kind: import_zod14.z.literal("vista"),
499
+ driverId: import_zod14.z.string(),
500
+ cookie: import_zod14.z.string()
332
501
  });
333
- var MockAuthDataSchema = import_zod10.z.object({
334
- kind: import_zod10.z.literal("mock"),
335
- cookie: import_zod10.z.string()
502
+ var MockAuthDataSchema = import_zod14.z.object({
503
+ kind: import_zod14.z.literal("mock"),
504
+ cookie: import_zod14.z.string()
336
505
  });
337
- var NoneAuthDataSchema = import_zod10.z.object({
338
- kind: import_zod10.z.literal("none")
506
+ var NoneAuthDataSchema = import_zod14.z.object({
507
+ kind: import_zod14.z.literal("none")
339
508
  });
340
- var ProviderAuthDataSchema = import_zod10.z.discriminatedUnion("kind", [
509
+ var ProviderAuthDataSchema = import_zod14.z.discriminatedUnion("kind", [
341
510
  GomotiveAuthDataSchema,
342
511
  VistaAuthDataSchema,
343
512
  MockAuthDataSchema,
344
513
  NoneAuthDataSchema
345
514
  ]);
346
- var LegacyVistaAuthSchema = import_zod10.z.object({
347
- driverId: import_zod10.z.string(),
348
- cookie: import_zod10.z.string()
515
+ var LegacyVistaAuthSchema = import_zod14.z.object({
516
+ driverId: import_zod14.z.string(),
517
+ cookie: import_zod14.z.string()
349
518
  });
350
519
  function serializeAuthData(data) {
351
520
  if (data.kind === "none") {
@@ -381,46 +550,46 @@ function deserializeAuthData(authToken) {
381
550
  }
382
551
 
383
552
  // src/browser-auth.ts
384
- var import_zod11 = require("zod");
385
- var CapturedTrafficEntrySchema = import_zod11.z.object({
386
- method: import_zod11.z.string(),
387
- url: import_zod11.z.string(),
388
- status: import_zod11.z.number(),
389
- responseBody: import_zod11.z.string().optional()
390
- });
391
- var BrowserAuthRequestSchema = import_zod11.z.object({
392
- providerStub: import_zod11.z.string(),
393
- providerUrl: import_zod11.z.string(),
394
- username: import_zod11.z.string(),
395
- encryptedPassword: import_zod11.z.string(),
396
- captureTraffic: import_zod11.z.boolean().optional()
397
- });
398
- var BrowserAuthSuccessSchema = import_zod11.z.object({
399
- success: import_zod11.z.literal(true),
553
+ var import_zod15 = require("zod");
554
+ var CapturedTrafficEntrySchema = import_zod15.z.object({
555
+ method: import_zod15.z.string(),
556
+ url: import_zod15.z.string(),
557
+ status: import_zod15.z.number(),
558
+ responseBody: import_zod15.z.string().optional()
559
+ });
560
+ var BrowserAuthRequestSchema = import_zod15.z.object({
561
+ providerStub: import_zod15.z.string(),
562
+ providerUrl: import_zod15.z.string(),
563
+ username: import_zod15.z.string(),
564
+ encryptedPassword: import_zod15.z.string(),
565
+ captureTraffic: import_zod15.z.boolean().optional()
566
+ });
567
+ var BrowserAuthSuccessSchema = import_zod15.z.object({
568
+ success: import_zod15.z.literal(true),
400
569
  authData: ProviderAuthDataSchema,
401
- capturedTraffic: import_zod11.z.array(CapturedTrafficEntrySchema).optional()
570
+ capturedTraffic: import_zod15.z.array(CapturedTrafficEntrySchema).optional()
402
571
  });
403
- var BrowserAuthFailureSchema = import_zod11.z.object({
404
- success: import_zod11.z.literal(false),
405
- error: import_zod11.z.string()
572
+ var BrowserAuthFailureSchema = import_zod15.z.object({
573
+ success: import_zod15.z.literal(false),
574
+ error: import_zod15.z.string()
406
575
  });
407
- var BrowserAuthResponseSchema = import_zod11.z.discriminatedUnion("success", [
576
+ var BrowserAuthResponseSchema = import_zod15.z.discriminatedUnion("success", [
408
577
  BrowserAuthSuccessSchema,
409
578
  BrowserAuthFailureSchema
410
579
  ]);
411
- var CrawlPageSchema = import_zod11.z.object({
412
- url: import_zod11.z.string(),
413
- html: import_zod11.z.string()
580
+ var CrawlPageSchema = import_zod15.z.object({
581
+ url: import_zod15.z.string(),
582
+ html: import_zod15.z.string()
414
583
  });
415
- var BrowserCrawlSuccessSchema = import_zod11.z.object({
416
- success: import_zod11.z.literal(true),
417
- pages: import_zod11.z.array(CrawlPageSchema)
584
+ var BrowserCrawlSuccessSchema = import_zod15.z.object({
585
+ success: import_zod15.z.literal(true),
586
+ pages: import_zod15.z.array(CrawlPageSchema)
418
587
  });
419
- var BrowserCrawlFailureSchema = import_zod11.z.object({
420
- success: import_zod11.z.literal(false),
421
- error: import_zod11.z.string()
588
+ var BrowserCrawlFailureSchema = import_zod15.z.object({
589
+ success: import_zod15.z.literal(false),
590
+ error: import_zod15.z.string()
422
591
  });
423
- var BrowserCrawlResponseSchema = import_zod11.z.discriminatedUnion("success", [
592
+ var BrowserCrawlResponseSchema = import_zod15.z.discriminatedUnion("success", [
424
593
  BrowserCrawlSuccessSchema,
425
594
  BrowserCrawlFailureSchema
426
595
  ]);
@@ -443,13 +612,27 @@ var BrowserCrawlResponseSchema = import_zod11.z.discriminatedUnion("success", [
443
612
  ConvexUpdateSchema,
444
613
  CrawlPageSchema,
445
614
  CreateAnonymousDriverBodySchema,
615
+ DRIVER_NAME_FORBIDDEN_CHAR_PATTERN,
446
616
  DeleteAnonymousDriverParamsSchema,
447
617
  DeleteAnonymousDriverResponseSchema,
448
618
  DeleteProviderAccountRequestSchema,
449
619
  DeleteProviderAccountResponseSchema,
620
+ DriverDailySummariesResponseSchema,
621
+ DriverDailySummarySchema,
622
+ DriverEnrichedSummariesRequestSchema,
623
+ DriverEnrichedSummariesResponseSchema,
624
+ DriverNameSchema,
450
625
  DriverRankingSchema,
451
626
  DriverRankingsRequestSchema,
452
627
  DriverRankingsResponseSchema,
628
+ DriverTripSchema,
629
+ DriverTripsRequestSchema,
630
+ DriverTripsResponseSchema,
631
+ EnrichedPointSchema,
632
+ EnrichedStopSchema,
633
+ EnrichedTripSummaryRequestSchema,
634
+ EnrichedTripSummaryResponseSchema,
635
+ EnrichedTripSummarySchema,
453
636
  GomotiveAuthDataSchema,
454
637
  ManualBatchEntrySchema,
455
638
  ManualBatchRequestSchema,
@@ -465,8 +648,13 @@ var BrowserCrawlResponseSchema = import_zod11.z.discriminatedUnion("success", [
465
648
  NewLoginResponseSuccess,
466
649
  NewLoginResponseSuccessSchema,
467
650
  NoneAuthDataSchema,
651
+ PATCH_DRIVER_NAME_MAX_LENGTH,
652
+ PatchDriverDriverResponseSchema,
653
+ PatchDriverRequestSchema,
654
+ PatchDriverResponseSchema,
468
655
  ProviderAuthDataSchema,
469
656
  ScrapeStatus,
657
+ SharedDriverResponseSchema,
470
658
  StateHeatmapEntrySchema,
471
659
  StateHeatmapRequestSchema,
472
660
  StateHeatmapResponseSchema,