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