@findatruck/shared-schemas 2.17.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,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,8 +83,13 @@ __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
+ PatchDriverDriverResponseSchema: () => PatchDriverDriverResponseSchema,
88
+ PatchDriverRequestSchema: () => PatchDriverRequestSchema,
89
+ PatchDriverResponseSchema: () => PatchDriverResponseSchema,
84
90
  ProviderAuthDataSchema: () => ProviderAuthDataSchema,
85
91
  ScrapeStatus: () => ScrapeStatus,
92
+ SharedDriverResponseSchema: () => SharedDriverResponseSchema,
86
93
  StateHeatmapEntrySchema: () => StateHeatmapEntrySchema,
87
94
  StateHeatmapRequestSchema: () => StateHeatmapRequestSchema,
88
95
  StateHeatmapResponseSchema: () => StateHeatmapResponseSchema,
@@ -210,8 +217,85 @@ var DeleteAnonymousDriverResponseSchema = import_zod3.default.object({
210
217
  user_id: import_zod3.default.string()
211
218
  });
212
219
 
213
- // src/schemas/providerAccounts/update-status.ts
220
+ // src/schemas/drivers/driver.ts
214
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);
215
299
  var ScrapeStatus = /* @__PURE__ */ ((ScrapeStatus2) => {
216
300
  ScrapeStatus2["NEW_LOGIN_RECEIVED"] = "NEW_LOGIN_RECEIVED";
217
301
  ScrapeStatus2["LOGIN_IN_PROGRESS"] = "LOGIN_IN_PROGRESS";
@@ -224,211 +308,213 @@ var ScrapeStatus = /* @__PURE__ */ ((ScrapeStatus2) => {
224
308
  ScrapeStatus2["DATA_FETCH_FAILED"] = "DATA_FETCH_FAILED";
225
309
  return ScrapeStatus2;
226
310
  })(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")
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")
235
319
  }).describe("Schema for update status messages");
236
320
 
237
321
  // 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")
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")
242
326
  }).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")
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")
246
330
  }).describe("Response schema for password validation");
247
331
 
248
332
  // 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")
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")
252
336
  }).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")
337
+ var DeleteProviderAccountResponseSchema = import_zod8.z.object({
338
+ success: import_zod8.z.boolean().describe("Indicates if the provider account was successfully deleted")
255
339
  }).describe("Response schema for provider account deletion");
256
340
 
257
341
  // 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")
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")
264
348
  }).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")
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")
270
354
  }).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");
355
+ var DriverRankingsResponseSchema = import_zod9.z.array(DriverRankingSchema).describe("Array of driver rankings sorted by miles driven in descending order");
272
356
 
273
357
  // 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)")
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)")
279
363
  }).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")
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")
283
367
  }).describe("Single state entry in the heatmap");
284
- var StateHeatmapResponseSchema = import_zod8.z.record(
285
- import_zod8.z.string().length(2),
368
+ var StateHeatmapResponseSchema = import_zod10.z.record(
369
+ import_zod10.z.string().length(2),
286
370
  StateHeatmapEntrySchema
287
371
  ).describe("Record of 2-letter state codes to heatmap entries");
288
372
 
289
373
  // 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")
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")
302
387
  }).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)")
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)")
305
390
  }).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"])
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()
326
412
  }).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")
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")
331
417
  }).describe("Response schema for manual batch telemetry insertion");
332
418
 
333
419
  // 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(),
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(),
338
424
  // YYYY-MM-DD
339
- end_date: import_zod10.z.string()
425
+ end_date: import_zod12.z.string()
340
426
  // YYYY-MM-DD
341
427
  });
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);
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);
367
453
 
368
454
  // 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(),
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(),
392
478
  stop: EnrichedStopSchema.nullable()
393
479
  });
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)
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)
400
486
  });
401
487
  var EnrichedTripSummaryResponseSchema = EnrichedTripSummarySchema;
402
- var DriverEnrichedSummariesResponseSchema = import_zod11.z.array(EnrichedTripSummarySchema);
488
+ var DriverEnrichedSummariesResponseSchema = import_zod13.z.array(EnrichedTripSummarySchema);
403
489
 
404
490
  // 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()
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()
410
496
  });
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()
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()
415
501
  });
416
- var MockAuthDataSchema = import_zod12.z.object({
417
- kind: import_zod12.z.literal("mock"),
418
- cookie: import_zod12.z.string()
502
+ var MockAuthDataSchema = import_zod14.z.object({
503
+ kind: import_zod14.z.literal("mock"),
504
+ cookie: import_zod14.z.string()
419
505
  });
420
- var NoneAuthDataSchema = import_zod12.z.object({
421
- kind: import_zod12.z.literal("none")
506
+ var NoneAuthDataSchema = import_zod14.z.object({
507
+ kind: import_zod14.z.literal("none")
422
508
  });
423
- var ProviderAuthDataSchema = import_zod12.z.discriminatedUnion("kind", [
509
+ var ProviderAuthDataSchema = import_zod14.z.discriminatedUnion("kind", [
424
510
  GomotiveAuthDataSchema,
425
511
  VistaAuthDataSchema,
426
512
  MockAuthDataSchema,
427
513
  NoneAuthDataSchema
428
514
  ]);
429
- var LegacyVistaAuthSchema = import_zod12.z.object({
430
- driverId: import_zod12.z.string(),
431
- cookie: import_zod12.z.string()
515
+ var LegacyVistaAuthSchema = import_zod14.z.object({
516
+ driverId: import_zod14.z.string(),
517
+ cookie: import_zod14.z.string()
432
518
  });
433
519
  function serializeAuthData(data) {
434
520
  if (data.kind === "none") {
@@ -464,46 +550,46 @@ function deserializeAuthData(authToken) {
464
550
  }
465
551
 
466
552
  // 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),
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),
483
569
  authData: ProviderAuthDataSchema,
484
- capturedTraffic: import_zod13.z.array(CapturedTrafficEntrySchema).optional()
570
+ capturedTraffic: import_zod15.z.array(CapturedTrafficEntrySchema).optional()
485
571
  });
486
- var BrowserAuthFailureSchema = import_zod13.z.object({
487
- success: import_zod13.z.literal(false),
488
- error: import_zod13.z.string()
572
+ var BrowserAuthFailureSchema = import_zod15.z.object({
573
+ success: import_zod15.z.literal(false),
574
+ error: import_zod15.z.string()
489
575
  });
490
- var BrowserAuthResponseSchema = import_zod13.z.discriminatedUnion("success", [
576
+ var BrowserAuthResponseSchema = import_zod15.z.discriminatedUnion("success", [
491
577
  BrowserAuthSuccessSchema,
492
578
  BrowserAuthFailureSchema
493
579
  ]);
494
- var CrawlPageSchema = import_zod13.z.object({
495
- url: import_zod13.z.string(),
496
- html: import_zod13.z.string()
580
+ var CrawlPageSchema = import_zod15.z.object({
581
+ url: import_zod15.z.string(),
582
+ html: import_zod15.z.string()
497
583
  });
498
- var BrowserCrawlSuccessSchema = import_zod13.z.object({
499
- success: import_zod13.z.literal(true),
500
- pages: import_zod13.z.array(CrawlPageSchema)
584
+ var BrowserCrawlSuccessSchema = import_zod15.z.object({
585
+ success: import_zod15.z.literal(true),
586
+ pages: import_zod15.z.array(CrawlPageSchema)
501
587
  });
502
- var BrowserCrawlFailureSchema = import_zod13.z.object({
503
- success: import_zod13.z.literal(false),
504
- error: import_zod13.z.string()
588
+ var BrowserCrawlFailureSchema = import_zod15.z.object({
589
+ success: import_zod15.z.literal(false),
590
+ error: import_zod15.z.string()
505
591
  });
506
- var BrowserCrawlResponseSchema = import_zod13.z.discriminatedUnion("success", [
592
+ var BrowserCrawlResponseSchema = import_zod15.z.discriminatedUnion("success", [
507
593
  BrowserCrawlSuccessSchema,
508
594
  BrowserCrawlFailureSchema
509
595
  ]);
@@ -526,6 +612,7 @@ var BrowserCrawlResponseSchema = import_zod13.z.discriminatedUnion("success", [
526
612
  ConvexUpdateSchema,
527
613
  CrawlPageSchema,
528
614
  CreateAnonymousDriverBodySchema,
615
+ DRIVER_NAME_FORBIDDEN_CHAR_PATTERN,
529
616
  DeleteAnonymousDriverParamsSchema,
530
617
  DeleteAnonymousDriverResponseSchema,
531
618
  DeleteProviderAccountRequestSchema,
@@ -534,6 +621,7 @@ var BrowserCrawlResponseSchema = import_zod13.z.discriminatedUnion("success", [
534
621
  DriverDailySummarySchema,
535
622
  DriverEnrichedSummariesRequestSchema,
536
623
  DriverEnrichedSummariesResponseSchema,
624
+ DriverNameSchema,
537
625
  DriverRankingSchema,
538
626
  DriverRankingsRequestSchema,
539
627
  DriverRankingsResponseSchema,
@@ -560,8 +648,13 @@ var BrowserCrawlResponseSchema = import_zod13.z.discriminatedUnion("success", [
560
648
  NewLoginResponseSuccess,
561
649
  NewLoginResponseSuccessSchema,
562
650
  NoneAuthDataSchema,
651
+ PATCH_DRIVER_NAME_MAX_LENGTH,
652
+ PatchDriverDriverResponseSchema,
653
+ PatchDriverRequestSchema,
654
+ PatchDriverResponseSchema,
563
655
  ProviderAuthDataSchema,
564
656
  ScrapeStatus,
657
+ SharedDriverResponseSchema,
565
658
  StateHeatmapEntrySchema,
566
659
  StateHeatmapRequestSchema,
567
660
  StateHeatmapResponseSchema,