@findatruck/shared-schemas 2.20.0 → 2.23.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/browser.cjs +36 -18
- package/dist/browser.d.cts +31 -5
- package/dist/browser.d.ts +31 -5
- package/dist/browser.js +5 -1
- package/dist/{chunk-P4S46OZI.js → chunk-EQIUGAWW.js} +34 -18
- package/dist/index.cjs +322 -194
- package/dist/index.d.cts +400 -2
- package/dist/index.d.ts +400 -2
- package/dist/index.js +210 -105
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -32,6 +32,11 @@ var index_exports = {};
|
|
|
32
32
|
__export(index_exports, {
|
|
33
33
|
AnonymousDriverErrorResponseSchema: () => AnonymousDriverErrorResponseSchema,
|
|
34
34
|
AnonymousDriverResponseSchema: () => AnonymousDriverResponseSchema,
|
|
35
|
+
BGGeoActivitySchema: () => BGGeoActivitySchema,
|
|
36
|
+
BGGeoBatchRequestSchema: () => BGGeoBatchRequestSchema,
|
|
37
|
+
BGGeoBatterySchema: () => BGGeoBatterySchema,
|
|
38
|
+
BGGeoCoordsSchema: () => BGGeoCoordsSchema,
|
|
39
|
+
BGGeoLocationSchema: () => BGGeoLocationSchema,
|
|
35
40
|
BatchConvexUpdate: () => BatchConvexUpdate,
|
|
36
41
|
BatchConvexUpdateSchema: () => BatchConvexUpdateSchema,
|
|
37
42
|
BrowserAuthFailureSchema: () => BrowserAuthFailureSchema,
|
|
@@ -42,7 +47,9 @@ __export(index_exports, {
|
|
|
42
47
|
BrowserCrawlResponseSchema: () => BrowserCrawlResponseSchema,
|
|
43
48
|
BrowserCrawlSuccessSchema: () => BrowserCrawlSuccessSchema,
|
|
44
49
|
CapturedTrafficEntrySchema: () => CapturedTrafficEntrySchema,
|
|
50
|
+
ConvexBreadcrumbEventSchema: () => ConvexBreadcrumbEventSchema,
|
|
45
51
|
ConvexDriverSchema: () => ConvexDriverSchema,
|
|
52
|
+
ConvexDriverTripRequestSchema: () => ConvexDriverTripRequestSchema,
|
|
46
53
|
ConvexUpdate: () => ConvexUpdate,
|
|
47
54
|
ConvexUpdateSchema: () => ConvexUpdateSchema,
|
|
48
55
|
CrawlPageSchema: () => CrawlPageSchema,
|
|
@@ -69,6 +76,8 @@ __export(index_exports, {
|
|
|
69
76
|
EnrichedTripSummaryResponseSchema: () => EnrichedTripSummaryResponseSchema,
|
|
70
77
|
EnrichedTripSummarySchema: () => EnrichedTripSummarySchema,
|
|
71
78
|
GomotiveAuthDataSchema: () => GomotiveAuthDataSchema,
|
|
79
|
+
ListDriversRequestSchema: () => ListDriversRequestSchema,
|
|
80
|
+
ListDriversResponseSchema: () => ListDriversResponseSchema,
|
|
72
81
|
ManualBatchEntrySchema: () => ManualBatchEntrySchema,
|
|
73
82
|
ManualBatchRequestSchema: () => ManualBatchRequestSchema,
|
|
74
83
|
ManualBatchResponseSchema: () => ManualBatchResponseSchema,
|
|
@@ -88,6 +97,8 @@ __export(index_exports, {
|
|
|
88
97
|
PatchDriverDriverResponseSchema: () => PatchDriverDriverResponseSchema,
|
|
89
98
|
PatchDriverRequestSchema: () => PatchDriverRequestSchema,
|
|
90
99
|
PatchDriverResponseSchema: () => PatchDriverResponseSchema,
|
|
100
|
+
PostDriverTripTelemetryRecordSchema: () => PostDriverTripTelemetryRecordSchema,
|
|
101
|
+
PostDriverTripTelemetryRequestSchema: () => PostDriverTripTelemetryRequestSchema,
|
|
91
102
|
ProviderAuthDataSchema: () => ProviderAuthDataSchema,
|
|
92
103
|
ScrapeStatus: () => ScrapeStatus,
|
|
93
104
|
SharedDriverResponseSchema: () => SharedDriverResponseSchema,
|
|
@@ -230,7 +241,7 @@ var SharedDriverResponseSchema = import_zod4.default.object({
|
|
|
230
241
|
// because providers emit non-UUID identifiers there.
|
|
231
242
|
id: import_zod4.default.uuid(),
|
|
232
243
|
name: import_zod4.default.string(),
|
|
233
|
-
eld_external_id: import_zod4.default.string(),
|
|
244
|
+
eld_external_id: import_zod4.default.string().nullable(),
|
|
234
245
|
license_number: import_zod4.default.string().nullable(),
|
|
235
246
|
license_state: import_zod4.default.string().nullable(),
|
|
236
247
|
license_expiration_date: import_zod4.default.string().nullable(),
|
|
@@ -239,6 +250,7 @@ var SharedDriverResponseSchema = import_zod4.default.object({
|
|
|
239
250
|
created_at: import_zod4.default.union([import_zod4.default.string(), import_zod4.default.date()]),
|
|
240
251
|
updated_at: import_zod4.default.union([import_zod4.default.string(), import_zod4.default.date()]),
|
|
241
252
|
truck_type: import_zod4.default.string().nullable(),
|
|
253
|
+
honk_user_id: import_zod4.default.string().nullable(),
|
|
242
254
|
last_location_latitude: import_zod4.default.number().nullable(),
|
|
243
255
|
last_location_longitude: import_zod4.default.number().nullable()
|
|
244
256
|
});
|
|
@@ -279,10 +291,14 @@ var DriverNameSchema = import_zod5.default.string().trim().min(1).max(PATCH_DRIV
|
|
|
279
291
|
);
|
|
280
292
|
var TruckTypeSchema = import_zod5.default.string().trim().min(1).max(PATCH_DRIVER_TRUCK_TYPE_MAX_LENGTH);
|
|
281
293
|
var PatchDriverRequestSchema = import_zod5.default.object({
|
|
282
|
-
driver_id: import_zod5.default.uuid(),
|
|
294
|
+
driver_id: import_zod5.default.uuid().optional(),
|
|
295
|
+
honk_user_id: import_zod5.default.string().min(1).max(255).optional(),
|
|
283
296
|
name: DriverNameSchema.optional(),
|
|
284
297
|
truck_type: TruckTypeSchema.nullable().optional()
|
|
285
298
|
}).refine(
|
|
299
|
+
(d) => d.driver_id !== void 0 !== (d.honk_user_id !== void 0),
|
|
300
|
+
{ message: "Exactly one of driver_id or honk_user_id must be provided" }
|
|
301
|
+
).refine(
|
|
286
302
|
(d) => d.name !== void 0 || d.truck_type !== void 0,
|
|
287
303
|
{ message: "At least one of name or truck_type must be provided" }
|
|
288
304
|
);
|
|
@@ -300,8 +316,17 @@ var PatchDriverResponseSchema = import_zod5.default.object({
|
|
|
300
316
|
driver: PatchDriverDriverResponseSchema
|
|
301
317
|
});
|
|
302
318
|
|
|
303
|
-
// src/schemas/
|
|
319
|
+
// src/schemas/drivers/list-drivers.ts
|
|
304
320
|
var import_zod6 = __toESM(require("zod"), 1);
|
|
321
|
+
var ListDriversRequestSchema = import_zod6.default.object({
|
|
322
|
+
name: import_zod6.default.string().optional()
|
|
323
|
+
});
|
|
324
|
+
var ListDriversResponseSchema = import_zod6.default.object({
|
|
325
|
+
drivers: import_zod6.default.array(SharedDriverResponseSchema)
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
// src/schemas/providerAccounts/update-status.ts
|
|
329
|
+
var import_zod7 = __toESM(require("zod"), 1);
|
|
305
330
|
var ScrapeStatus = /* @__PURE__ */ ((ScrapeStatus2) => {
|
|
306
331
|
ScrapeStatus2["NEW_LOGIN_RECEIVED"] = "NEW_LOGIN_RECEIVED";
|
|
307
332
|
ScrapeStatus2["LOGIN_IN_PROGRESS"] = "LOGIN_IN_PROGRESS";
|
|
@@ -314,213 +339,305 @@ var ScrapeStatus = /* @__PURE__ */ ((ScrapeStatus2) => {
|
|
|
314
339
|
ScrapeStatus2["DATA_FETCH_FAILED"] = "DATA_FETCH_FAILED";
|
|
315
340
|
return ScrapeStatus2;
|
|
316
341
|
})(ScrapeStatus || {});
|
|
317
|
-
var UpdateScrapeStatusMessage =
|
|
318
|
-
status:
|
|
319
|
-
correctPassword:
|
|
320
|
-
externalProviderAccountId:
|
|
321
|
-
username:
|
|
322
|
-
provider_url:
|
|
323
|
-
driverCount:
|
|
324
|
-
providerSlug:
|
|
342
|
+
var UpdateScrapeStatusMessage = import_zod7.default.object({
|
|
343
|
+
status: import_zod7.default.nativeEnum(ScrapeStatus).describe("The current status of the scrape process"),
|
|
344
|
+
correctPassword: import_zod7.default.boolean().optional().describe("Indicates if the provided password was correct, if applicable"),
|
|
345
|
+
externalProviderAccountId: import_zod7.default.string().describe("The external identifier for the provider account (convex ID or similar)"),
|
|
346
|
+
username: import_zod7.default.string().describe("The username of the provider account whose status is being updated"),
|
|
347
|
+
provider_url: import_zod7.default.string().describe("The URL of the ELD provider"),
|
|
348
|
+
driverCount: import_zod7.default.number().optional().describe("The number of drivers associated with the account, if applicable"),
|
|
349
|
+
providerSlug: import_zod7.default.string().optional().describe("The slug identifier for the provider")
|
|
325
350
|
}).describe("Schema for update status messages");
|
|
326
351
|
|
|
327
352
|
// src/schemas/providerAccounts/validate-password.ts
|
|
328
|
-
var
|
|
329
|
-
var ValidatePasswordRequestSchema =
|
|
330
|
-
providerAccountId:
|
|
331
|
-
encryptedPassword:
|
|
353
|
+
var import_zod8 = require("zod");
|
|
354
|
+
var ValidatePasswordRequestSchema = import_zod8.z.object({
|
|
355
|
+
providerAccountId: import_zod8.z.string().min(1).describe("The unique identifier of the provider account in postgres to validate the password for"),
|
|
356
|
+
encryptedPassword: import_zod8.z.string().min(1).describe("The encrypted password to validate against the stored password")
|
|
332
357
|
}).describe("Request schema for validating a provider account password");
|
|
333
|
-
var ValidatePasswordResponseSchema =
|
|
334
|
-
isValid:
|
|
335
|
-
driverIds:
|
|
358
|
+
var ValidatePasswordResponseSchema = import_zod8.z.object({
|
|
359
|
+
isValid: import_zod8.z.boolean().describe("Indicates if the provided password is valid"),
|
|
360
|
+
driverIds: import_zod8.z.array(import_zod8.z.string()).describe("List of driver IDs associated with the provider account")
|
|
336
361
|
}).describe("Response schema for password validation");
|
|
337
362
|
|
|
338
363
|
// src/schemas/providerAccounts/delete-provider-account.ts
|
|
339
|
-
var
|
|
340
|
-
var DeleteProviderAccountRequestSchema =
|
|
341
|
-
providerAccountId:
|
|
364
|
+
var import_zod9 = require("zod");
|
|
365
|
+
var DeleteProviderAccountRequestSchema = import_zod9.z.object({
|
|
366
|
+
providerAccountId: import_zod9.z.string().min(1).describe("The external provider account ID to delete")
|
|
342
367
|
}).describe("Request schema for deleting a provider account");
|
|
343
|
-
var DeleteProviderAccountResponseSchema =
|
|
344
|
-
success:
|
|
368
|
+
var DeleteProviderAccountResponseSchema = import_zod9.z.object({
|
|
369
|
+
success: import_zod9.z.boolean().describe("Indicates if the provider account was successfully deleted")
|
|
345
370
|
}).describe("Response schema for provider account deletion");
|
|
346
371
|
|
|
347
372
|
// src/schemas/telemetry/driver-rankings.ts
|
|
348
|
-
var
|
|
349
|
-
var DriverRankingsRequestSchema =
|
|
350
|
-
start_date:
|
|
351
|
-
end_date:
|
|
352
|
-
state:
|
|
353
|
-
source:
|
|
373
|
+
var import_zod10 = require("zod");
|
|
374
|
+
var DriverRankingsRequestSchema = import_zod10.z.object({
|
|
375
|
+
start_date: import_zod10.z.string().describe("Start date for the ranking period (ISO 8601 format)"),
|
|
376
|
+
end_date: import_zod10.z.string().describe("End date for the ranking period (ISO 8601 format)"),
|
|
377
|
+
state: import_zod10.z.string().length(2).optional().describe("Optional 2-letter state abbreviation to filter telemetry by location"),
|
|
378
|
+
source: import_zod10.z.enum(["eld", "manual"]).default("manual").describe("Telemetry source to rank by: 'manual' uses GPS odometer, 'eld' uses calculated distance")
|
|
354
379
|
}).describe("Request schema for driver rankings by miles driven");
|
|
355
|
-
var DriverRankingSchema =
|
|
356
|
-
rank:
|
|
357
|
-
driver_id:
|
|
358
|
-
driver_name:
|
|
359
|
-
total_miles:
|
|
380
|
+
var DriverRankingSchema = import_zod10.z.object({
|
|
381
|
+
rank: import_zod10.z.number().int().positive().describe("Rank position based on miles driven"),
|
|
382
|
+
driver_id: import_zod10.z.string().uuid().describe("Unique identifier of the driver"),
|
|
383
|
+
driver_name: import_zod10.z.string().describe("Name of the driver"),
|
|
384
|
+
total_miles: import_zod10.z.number().min(0).describe("Total miles driven in the specified period")
|
|
360
385
|
}).describe("Single driver ranking entry");
|
|
361
|
-
var DriverRankingsResponseSchema =
|
|
386
|
+
var DriverRankingsResponseSchema = import_zod10.z.array(DriverRankingSchema).describe("Array of driver rankings sorted by miles driven in descending order");
|
|
362
387
|
|
|
363
388
|
// src/schemas/telemetry/state-heatmap.ts
|
|
364
|
-
var
|
|
365
|
-
var StateHeatmapRequestSchema =
|
|
366
|
-
driver_id:
|
|
367
|
-
start_date:
|
|
368
|
-
end_date:
|
|
389
|
+
var import_zod11 = require("zod");
|
|
390
|
+
var StateHeatmapRequestSchema = import_zod11.z.object({
|
|
391
|
+
driver_id: import_zod11.z.string().uuid().describe("Unique identifier of the driver"),
|
|
392
|
+
start_date: import_zod11.z.string().describe("Start date for the heatmap period (ISO 8601 format)"),
|
|
393
|
+
end_date: import_zod11.z.string().describe("End date for the heatmap period (ISO 8601 format)")
|
|
369
394
|
}).describe("Request schema for driver state heatmap");
|
|
370
|
-
var StateHeatmapEntrySchema =
|
|
371
|
-
count:
|
|
372
|
-
percentage:
|
|
395
|
+
var StateHeatmapEntrySchema = import_zod11.z.object({
|
|
396
|
+
count: import_zod11.z.number().int().min(0).describe("Number of telemetry points in this state"),
|
|
397
|
+
percentage: import_zod11.z.number().min(0).max(100).describe("Percentage of total telemetry points in this state")
|
|
373
398
|
}).describe("Single state entry in the heatmap");
|
|
374
|
-
var StateHeatmapResponseSchema =
|
|
375
|
-
|
|
399
|
+
var StateHeatmapResponseSchema = import_zod11.z.record(
|
|
400
|
+
import_zod11.z.string().length(2),
|
|
376
401
|
StateHeatmapEntrySchema
|
|
377
402
|
).describe("Record of 2-letter state codes to heatmap entries");
|
|
378
403
|
|
|
379
404
|
// src/schemas/telemetry/manual-batch.ts
|
|
380
|
-
var
|
|
381
|
-
var ManualBatchEntrySchema =
|
|
382
|
-
driver_id:
|
|
383
|
-
timestamp:
|
|
384
|
-
location_latitude:
|
|
385
|
-
location_longitude:
|
|
386
|
-
location_address:
|
|
387
|
-
vehicle_odometer_miles:
|
|
388
|
-
heading:
|
|
389
|
-
speed_mph:
|
|
390
|
-
altitude_feet:
|
|
391
|
-
raw:
|
|
392
|
-
driving_status:
|
|
405
|
+
var import_zod12 = require("zod");
|
|
406
|
+
var ManualBatchEntrySchema = import_zod12.z.object({
|
|
407
|
+
driver_id: import_zod12.z.string().uuid().describe("Internal UUID of the driver"),
|
|
408
|
+
timestamp: import_zod12.z.string().datetime().describe("Timestamp of the GPS reading (ISO 8601 format)"),
|
|
409
|
+
location_latitude: import_zod12.z.number().min(-90).max(90).describe("GPS latitude coordinate"),
|
|
410
|
+
location_longitude: import_zod12.z.number().min(-180).max(180).describe("GPS longitude coordinate"),
|
|
411
|
+
location_address: import_zod12.z.string().optional().describe("Optional human-readable address"),
|
|
412
|
+
vehicle_odometer_miles: import_zod12.z.number().min(0).optional().describe("Optional vehicle odometer reading in miles"),
|
|
413
|
+
heading: import_zod12.z.number().min(0).max(360).optional().describe("Optional GPS heading in degrees (0-360)"),
|
|
414
|
+
speed_mph: import_zod12.z.number().min(0).optional().describe("Optional GPS speed in miles per hour"),
|
|
415
|
+
altitude_feet: import_zod12.z.number().optional().describe("Optional GPS altitude in feet"),
|
|
416
|
+
raw: import_zod12.z.record(import_zod12.z.string(), import_zod12.z.unknown()).optional().describe("Optional raw upstream JSON payload to archive alongside this entry"),
|
|
417
|
+
driving_status: import_zod12.z.enum(["parked", "driving"]).optional().describe("Optional parked/driving status reported by the upstream system"),
|
|
418
|
+
activity_type: import_zod12.z.string().optional().describe("Optional activity recognition type (e.g. 'in_vehicle', 'on_foot')"),
|
|
419
|
+
activity_confidence: import_zod12.z.number().int().min(0).max(100).optional().describe("Optional activity recognition confidence (0-100)")
|
|
393
420
|
}).describe("Single manual telemetry entry");
|
|
394
|
-
var ManualBatchRequestSchema =
|
|
395
|
-
entries:
|
|
421
|
+
var ManualBatchRequestSchema = import_zod12.z.object({
|
|
422
|
+
entries: import_zod12.z.array(ManualBatchEntrySchema).min(1).max(1e3).describe("Array of manual telemetry entries (1-1000)")
|
|
396
423
|
}).describe("Request schema for manual batch telemetry insertion");
|
|
397
|
-
var ManualBatchTelemetrySchema =
|
|
398
|
-
id:
|
|
399
|
-
driver_id:
|
|
400
|
-
timestamp:
|
|
401
|
-
remaining_drive_time_in_seconds:
|
|
402
|
-
remaining_shift_time_in_seconds:
|
|
403
|
-
remaining_cycle_time_in_seconds:
|
|
404
|
-
remaining_break_time_in_seconds:
|
|
405
|
-
location_latitude:
|
|
406
|
-
location_longitude:
|
|
407
|
-
previous_location_latitude:
|
|
408
|
-
previous_location_longitude:
|
|
409
|
-
location_address:
|
|
410
|
-
location_state:
|
|
411
|
-
echoed_odometer_miles:
|
|
412
|
-
osrm_calculated_miles:
|
|
413
|
-
heading:
|
|
414
|
-
speed_mph:
|
|
415
|
-
altitude_feet:
|
|
416
|
-
source:
|
|
417
|
-
driving_status:
|
|
424
|
+
var ManualBatchTelemetrySchema = import_zod12.z.object({
|
|
425
|
+
id: import_zod12.z.number().int().describe("Telemetry record ID"),
|
|
426
|
+
driver_id: import_zod12.z.string().uuid().describe("Internal UUID of the driver"),
|
|
427
|
+
timestamp: import_zod12.z.union([import_zod12.z.string(), import_zod12.z.date()]).describe("Timestamp of the telemetry reading"),
|
|
428
|
+
remaining_drive_time_in_seconds: import_zod12.z.number().min(0),
|
|
429
|
+
remaining_shift_time_in_seconds: import_zod12.z.number().min(0),
|
|
430
|
+
remaining_cycle_time_in_seconds: import_zod12.z.number().min(0),
|
|
431
|
+
remaining_break_time_in_seconds: import_zod12.z.number().min(0),
|
|
432
|
+
location_latitude: import_zod12.z.number().min(-90).max(90),
|
|
433
|
+
location_longitude: import_zod12.z.number().min(-180).max(180),
|
|
434
|
+
previous_location_latitude: import_zod12.z.number().min(-90).max(90).nullable(),
|
|
435
|
+
previous_location_longitude: import_zod12.z.number().min(-180).max(180).nullable(),
|
|
436
|
+
location_address: import_zod12.z.string().nullable(),
|
|
437
|
+
location_state: import_zod12.z.string().length(2).nullable(),
|
|
438
|
+
echoed_odometer_miles: import_zod12.z.number().min(0).nullable().describe("Vehicle odometer reading echoed back from the request (miles)"),
|
|
439
|
+
osrm_calculated_miles: import_zod12.z.number().min(0).nullable().describe("Road distance calculated by OSRM between this point and the previous point (miles)"),
|
|
440
|
+
heading: import_zod12.z.number().nullish(),
|
|
441
|
+
speed_mph: import_zod12.z.number().nullish(),
|
|
442
|
+
altitude_feet: import_zod12.z.number().nullish(),
|
|
443
|
+
source: import_zod12.z.enum(["eld", "manual"]),
|
|
444
|
+
driving_status: import_zod12.z.enum(["parked", "driving"]).nullable(),
|
|
445
|
+
activity_type: import_zod12.z.string().nullable(),
|
|
446
|
+
activity_confidence: import_zod12.z.number().int().nullable()
|
|
418
447
|
}).describe("Telemetry record returned from manual batch insertion");
|
|
419
|
-
var ManualBatchResponseSchema =
|
|
420
|
-
message:
|
|
421
|
-
inserted_count:
|
|
422
|
-
telemetry:
|
|
448
|
+
var ManualBatchResponseSchema = import_zod12.z.object({
|
|
449
|
+
message: import_zod12.z.string().describe("Success message"),
|
|
450
|
+
inserted_count: import_zod12.z.number().int().min(0).describe("Number of telemetry entries inserted"),
|
|
451
|
+
telemetry: import_zod12.z.array(ManualBatchTelemetrySchema).describe("Array of inserted telemetry records")
|
|
423
452
|
}).describe("Response schema for manual batch telemetry insertion");
|
|
424
453
|
|
|
454
|
+
// src/schemas/telemetry/bggeo-batch.ts
|
|
455
|
+
var import_zod13 = require("zod");
|
|
456
|
+
var BGGeoCoordsSchema = import_zod13.z.object({
|
|
457
|
+
latitude: import_zod13.z.number().min(-90).max(90),
|
|
458
|
+
longitude: import_zod13.z.number().min(-180).max(180),
|
|
459
|
+
accuracy: import_zod13.z.number().optional(),
|
|
460
|
+
speed: import_zod13.z.number().describe("Speed in m/s; -1 when unavailable"),
|
|
461
|
+
heading: import_zod13.z.number().describe("Heading in degrees; -1 when unavailable"),
|
|
462
|
+
altitude: import_zod13.z.number().describe("Altitude in meters"),
|
|
463
|
+
altitude_accuracy: import_zod13.z.number().optional(),
|
|
464
|
+
speed_accuracy: import_zod13.z.number().optional(),
|
|
465
|
+
heading_accuracy: import_zod13.z.number().optional(),
|
|
466
|
+
ellipsoidal_altitude: import_zod13.z.number().optional(),
|
|
467
|
+
floor: import_zod13.z.number().nullable().optional()
|
|
468
|
+
}).describe("BGGeo coords object");
|
|
469
|
+
var BGGeoActivitySchema = import_zod13.z.object({
|
|
470
|
+
type: import_zod13.z.string(),
|
|
471
|
+
confidence: import_zod13.z.number()
|
|
472
|
+
}).describe("BGGeo activity recognition");
|
|
473
|
+
var BGGeoBatterySchema = import_zod13.z.object({
|
|
474
|
+
is_charging: import_zod13.z.boolean(),
|
|
475
|
+
level: import_zod13.z.number()
|
|
476
|
+
}).describe("BGGeo battery status");
|
|
477
|
+
var BGGeoLocationSchema = import_zod13.z.object({
|
|
478
|
+
coords: BGGeoCoordsSchema,
|
|
479
|
+
extras: import_zod13.z.object({}).passthrough().optional(),
|
|
480
|
+
activity: BGGeoActivitySchema.optional(),
|
|
481
|
+
battery: BGGeoBatterySchema.optional(),
|
|
482
|
+
timestamp: import_zod13.z.string().datetime().describe("ISO 8601 timestamp"),
|
|
483
|
+
is_moving: import_zod13.z.boolean(),
|
|
484
|
+
odometer: import_zod13.z.number().min(0).describe("Odometer in meters"),
|
|
485
|
+
uuid: import_zod13.z.string().optional(),
|
|
486
|
+
event: import_zod13.z.string().optional(),
|
|
487
|
+
age: import_zod13.z.number().optional(),
|
|
488
|
+
geofence: import_zod13.z.record(import_zod13.z.string(), import_zod13.z.unknown()).optional(),
|
|
489
|
+
mock: import_zod13.z.boolean().optional(),
|
|
490
|
+
recorded_at: import_zod13.z.string().datetime().optional().describe("ISO 8601 device recording timestamp")
|
|
491
|
+
}).passthrough().describe("Single BGGeo location object");
|
|
492
|
+
var locationArray = import_zod13.z.array(BGGeoLocationSchema).min(1).max(1e3).describe("Array of BGGeo location objects (1-1000)");
|
|
493
|
+
var locationOrArray = import_zod13.z.union([
|
|
494
|
+
BGGeoLocationSchema.transform((loc) => [loc]),
|
|
495
|
+
locationArray
|
|
496
|
+
]);
|
|
497
|
+
var BGGeoBatchRequestSchema = import_zod13.z.object({
|
|
498
|
+
location: locationOrArray.optional(),
|
|
499
|
+
locations: locationOrArray.optional()
|
|
500
|
+
}).refine((data) => data.location ?? data.locations, {
|
|
501
|
+
message: "Either 'location' or 'locations' must be provided"
|
|
502
|
+
}).describe("Request schema for BGGeo batch telemetry ingestion");
|
|
503
|
+
|
|
425
504
|
// src/schemas/trips/driver-trips.ts
|
|
426
|
-
var
|
|
427
|
-
var DriverTripsRequestSchema =
|
|
428
|
-
driver_id:
|
|
429
|
-
start_date:
|
|
505
|
+
var import_zod14 = require("zod");
|
|
506
|
+
var DriverTripsRequestSchema = import_zod14.z.object({
|
|
507
|
+
driver_id: import_zod14.z.string().uuid(),
|
|
508
|
+
start_date: import_zod14.z.string(),
|
|
430
509
|
// YYYY-MM-DD
|
|
431
|
-
end_date:
|
|
510
|
+
end_date: import_zod14.z.string()
|
|
432
511
|
// YYYY-MM-DD
|
|
433
512
|
});
|
|
434
|
-
var DriverTripSchema =
|
|
435
|
-
id:
|
|
436
|
-
start_time:
|
|
437
|
-
end_time:
|
|
438
|
-
point_count:
|
|
439
|
-
polyline:
|
|
440
|
-
highways:
|
|
441
|
-
total_miles:
|
|
442
|
-
avg_speed_mph:
|
|
443
|
-
miles_by_weather:
|
|
444
|
-
miles_by_light:
|
|
445
|
-
});
|
|
446
|
-
var DriverTripsResponseSchema =
|
|
447
|
-
var DriverDailySummarySchema =
|
|
448
|
-
summary_date:
|
|
449
|
-
total_miles:
|
|
450
|
-
trip_count:
|
|
451
|
-
point_count:
|
|
452
|
-
polyline:
|
|
453
|
-
highways:
|
|
454
|
-
avg_speed_mph:
|
|
455
|
-
miles_by_weather:
|
|
456
|
-
miles_by_light:
|
|
457
|
-
});
|
|
458
|
-
var DriverDailySummariesResponseSchema =
|
|
513
|
+
var DriverTripSchema = import_zod14.z.object({
|
|
514
|
+
id: import_zod14.z.number(),
|
|
515
|
+
start_time: import_zod14.z.string(),
|
|
516
|
+
end_time: import_zod14.z.string(),
|
|
517
|
+
point_count: import_zod14.z.number(),
|
|
518
|
+
polyline: import_zod14.z.string().nullable(),
|
|
519
|
+
highways: import_zod14.z.array(import_zod14.z.string()).nullable(),
|
|
520
|
+
total_miles: import_zod14.z.number().nullable(),
|
|
521
|
+
avg_speed_mph: import_zod14.z.number().nullable(),
|
|
522
|
+
miles_by_weather: import_zod14.z.record(import_zod14.z.string(), import_zod14.z.number()).nullable(),
|
|
523
|
+
miles_by_light: import_zod14.z.record(import_zod14.z.string(), import_zod14.z.number()).nullable()
|
|
524
|
+
});
|
|
525
|
+
var DriverTripsResponseSchema = import_zod14.z.array(DriverTripSchema);
|
|
526
|
+
var DriverDailySummarySchema = import_zod14.z.object({
|
|
527
|
+
summary_date: import_zod14.z.string(),
|
|
528
|
+
total_miles: import_zod14.z.number(),
|
|
529
|
+
trip_count: import_zod14.z.number(),
|
|
530
|
+
point_count: import_zod14.z.number(),
|
|
531
|
+
polyline: import_zod14.z.string().nullable(),
|
|
532
|
+
highways: import_zod14.z.array(import_zod14.z.string()).nullable(),
|
|
533
|
+
avg_speed_mph: import_zod14.z.number().nullable(),
|
|
534
|
+
miles_by_weather: import_zod14.z.record(import_zod14.z.string(), import_zod14.z.number()).nullable(),
|
|
535
|
+
miles_by_light: import_zod14.z.record(import_zod14.z.string(), import_zod14.z.number()).nullable()
|
|
536
|
+
});
|
|
537
|
+
var DriverDailySummariesResponseSchema = import_zod14.z.array(DriverDailySummarySchema);
|
|
459
538
|
|
|
460
539
|
// src/schemas/trips/enriched-trip-summary.ts
|
|
461
|
-
var
|
|
462
|
-
var EnrichedTripSummaryRequestSchema =
|
|
463
|
-
trip_id:
|
|
464
|
-
});
|
|
465
|
-
var DriverEnrichedSummariesRequestSchema =
|
|
466
|
-
driver_id:
|
|
467
|
-
start_date:
|
|
468
|
-
end_date:
|
|
469
|
-
});
|
|
470
|
-
var EnrichedStopSchema =
|
|
471
|
-
duration_seconds:
|
|
472
|
-
});
|
|
473
|
-
var EnrichedPointSchema =
|
|
474
|
-
lat:
|
|
475
|
-
lon:
|
|
476
|
-
timestamp:
|
|
477
|
-
speed_mph:
|
|
478
|
-
heading:
|
|
479
|
-
altitude_feet:
|
|
480
|
-
weather_condition:
|
|
481
|
-
temperature_f:
|
|
482
|
-
visibility_miles:
|
|
483
|
-
light_condition:
|
|
540
|
+
var import_zod15 = require("zod");
|
|
541
|
+
var EnrichedTripSummaryRequestSchema = import_zod15.z.object({
|
|
542
|
+
trip_id: import_zod15.z.number()
|
|
543
|
+
});
|
|
544
|
+
var DriverEnrichedSummariesRequestSchema = import_zod15.z.object({
|
|
545
|
+
driver_id: import_zod15.z.string().uuid(),
|
|
546
|
+
start_date: import_zod15.z.string(),
|
|
547
|
+
end_date: import_zod15.z.string()
|
|
548
|
+
});
|
|
549
|
+
var EnrichedStopSchema = import_zod15.z.object({
|
|
550
|
+
duration_seconds: import_zod15.z.number()
|
|
551
|
+
});
|
|
552
|
+
var EnrichedPointSchema = import_zod15.z.object({
|
|
553
|
+
lat: import_zod15.z.number(),
|
|
554
|
+
lon: import_zod15.z.number(),
|
|
555
|
+
timestamp: import_zod15.z.string(),
|
|
556
|
+
speed_mph: import_zod15.z.number().nullable(),
|
|
557
|
+
heading: import_zod15.z.number().nullable(),
|
|
558
|
+
altitude_feet: import_zod15.z.number().nullable(),
|
|
559
|
+
weather_condition: import_zod15.z.string().nullable(),
|
|
560
|
+
temperature_f: import_zod15.z.number().nullable(),
|
|
561
|
+
visibility_miles: import_zod15.z.number().nullable(),
|
|
562
|
+
light_condition: import_zod15.z.string().nullable(),
|
|
484
563
|
stop: EnrichedStopSchema.nullable()
|
|
485
564
|
});
|
|
486
|
-
var EnrichedTripSummarySchema =
|
|
487
|
-
trip_id:
|
|
488
|
-
driver_id:
|
|
489
|
-
start_time:
|
|
490
|
-
end_time:
|
|
491
|
-
points:
|
|
565
|
+
var EnrichedTripSummarySchema = import_zod15.z.object({
|
|
566
|
+
trip_id: import_zod15.z.number(),
|
|
567
|
+
driver_id: import_zod15.z.string(),
|
|
568
|
+
start_time: import_zod15.z.string(),
|
|
569
|
+
end_time: import_zod15.z.string(),
|
|
570
|
+
points: import_zod15.z.array(EnrichedPointSchema)
|
|
492
571
|
});
|
|
493
572
|
var EnrichedTripSummaryResponseSchema = EnrichedTripSummarySchema;
|
|
494
|
-
var DriverEnrichedSummariesResponseSchema =
|
|
573
|
+
var DriverEnrichedSummariesResponseSchema = import_zod15.z.array(EnrichedTripSummarySchema);
|
|
574
|
+
|
|
575
|
+
// src/schemas/trips/convex-driver-trip.ts
|
|
576
|
+
var import_zod16 = require("zod");
|
|
577
|
+
var ConvexBreadcrumbEventSchema = import_zod16.z.object({
|
|
578
|
+
ts: import_zod16.z.number(),
|
|
579
|
+
// epoch ms
|
|
580
|
+
status: import_zod16.z.string(),
|
|
581
|
+
lat: import_zod16.z.number(),
|
|
582
|
+
lon: import_zod16.z.number(),
|
|
583
|
+
heading: import_zod16.z.number().optional(),
|
|
584
|
+
locationText: import_zod16.z.string().optional(),
|
|
585
|
+
speedKph: import_zod16.z.number().optional(),
|
|
586
|
+
altitudeFeet: import_zod16.z.number().optional()
|
|
587
|
+
});
|
|
588
|
+
var ConvexDriverTripRequestSchema = import_zod16.z.object({
|
|
589
|
+
userId: import_zod16.z.string(),
|
|
590
|
+
breadcrumbs: import_zod16.z.array(ConvexBreadcrumbEventSchema).min(1)
|
|
591
|
+
});
|
|
592
|
+
|
|
593
|
+
// src/schemas/trips/post-driver-trip-telemetry.ts
|
|
594
|
+
var import_zod17 = require("zod");
|
|
595
|
+
var PostDriverTripTelemetryRecordSchema = import_zod17.z.object({
|
|
596
|
+
location_latitude: import_zod17.z.number(),
|
|
597
|
+
location_longitude: import_zod17.z.number(),
|
|
598
|
+
location_address: import_zod17.z.string().optional(),
|
|
599
|
+
heading: import_zod17.z.number(),
|
|
600
|
+
drivingState: import_zod17.z.string(),
|
|
601
|
+
speedKph: import_zod17.z.number(),
|
|
602
|
+
altitudeFeet: import_zod17.z.number(),
|
|
603
|
+
gps_timestamp: import_zod17.z.string().optional(),
|
|
604
|
+
odometer: import_zod17.z.number().optional(),
|
|
605
|
+
activity_type: import_zod17.z.string().optional(),
|
|
606
|
+
activity_confidence: import_zod17.z.number().int().optional()
|
|
607
|
+
});
|
|
608
|
+
var PostDriverTripTelemetryRequestSchema = import_zod17.z.object({
|
|
609
|
+
honkUserId: import_zod17.z.string(),
|
|
610
|
+
telemetry: import_zod17.z.array(PostDriverTripTelemetryRecordSchema).min(1)
|
|
611
|
+
});
|
|
495
612
|
|
|
496
613
|
// src/auth-data.ts
|
|
497
|
-
var
|
|
498
|
-
var GomotiveAuthDataSchema =
|
|
499
|
-
kind:
|
|
500
|
-
token:
|
|
501
|
-
ownerOperator:
|
|
614
|
+
var import_zod18 = require("zod");
|
|
615
|
+
var GomotiveAuthDataSchema = import_zod18.z.object({
|
|
616
|
+
kind: import_zod18.z.literal("gomotive"),
|
|
617
|
+
token: import_zod18.z.string(),
|
|
618
|
+
ownerOperator: import_zod18.z.boolean()
|
|
502
619
|
});
|
|
503
|
-
var VistaAuthDataSchema =
|
|
504
|
-
kind:
|
|
505
|
-
driverId:
|
|
506
|
-
cookie:
|
|
620
|
+
var VistaAuthDataSchema = import_zod18.z.object({
|
|
621
|
+
kind: import_zod18.z.literal("vista"),
|
|
622
|
+
driverId: import_zod18.z.string(),
|
|
623
|
+
cookie: import_zod18.z.string()
|
|
507
624
|
});
|
|
508
|
-
var MockAuthDataSchema =
|
|
509
|
-
kind:
|
|
510
|
-
cookie:
|
|
625
|
+
var MockAuthDataSchema = import_zod18.z.object({
|
|
626
|
+
kind: import_zod18.z.literal("mock"),
|
|
627
|
+
cookie: import_zod18.z.string()
|
|
511
628
|
});
|
|
512
|
-
var NoneAuthDataSchema =
|
|
513
|
-
kind:
|
|
629
|
+
var NoneAuthDataSchema = import_zod18.z.object({
|
|
630
|
+
kind: import_zod18.z.literal("none")
|
|
514
631
|
});
|
|
515
|
-
var ProviderAuthDataSchema =
|
|
632
|
+
var ProviderAuthDataSchema = import_zod18.z.discriminatedUnion("kind", [
|
|
516
633
|
GomotiveAuthDataSchema,
|
|
517
634
|
VistaAuthDataSchema,
|
|
518
635
|
MockAuthDataSchema,
|
|
519
636
|
NoneAuthDataSchema
|
|
520
637
|
]);
|
|
521
|
-
var LegacyVistaAuthSchema =
|
|
522
|
-
driverId:
|
|
523
|
-
cookie:
|
|
638
|
+
var LegacyVistaAuthSchema = import_zod18.z.object({
|
|
639
|
+
driverId: import_zod18.z.string(),
|
|
640
|
+
cookie: import_zod18.z.string()
|
|
524
641
|
});
|
|
525
642
|
function serializeAuthData(data) {
|
|
526
643
|
if (data.kind === "none") {
|
|
@@ -556,46 +673,46 @@ function deserializeAuthData(authToken) {
|
|
|
556
673
|
}
|
|
557
674
|
|
|
558
675
|
// src/browser-auth.ts
|
|
559
|
-
var
|
|
560
|
-
var CapturedTrafficEntrySchema =
|
|
561
|
-
method:
|
|
562
|
-
url:
|
|
563
|
-
status:
|
|
564
|
-
responseBody:
|
|
565
|
-
});
|
|
566
|
-
var BrowserAuthRequestSchema =
|
|
567
|
-
providerStub:
|
|
568
|
-
providerUrl:
|
|
569
|
-
username:
|
|
570
|
-
encryptedPassword:
|
|
571
|
-
captureTraffic:
|
|
572
|
-
});
|
|
573
|
-
var BrowserAuthSuccessSchema =
|
|
574
|
-
success:
|
|
676
|
+
var import_zod19 = require("zod");
|
|
677
|
+
var CapturedTrafficEntrySchema = import_zod19.z.object({
|
|
678
|
+
method: import_zod19.z.string(),
|
|
679
|
+
url: import_zod19.z.string(),
|
|
680
|
+
status: import_zod19.z.number(),
|
|
681
|
+
responseBody: import_zod19.z.string().optional()
|
|
682
|
+
});
|
|
683
|
+
var BrowserAuthRequestSchema = import_zod19.z.object({
|
|
684
|
+
providerStub: import_zod19.z.string(),
|
|
685
|
+
providerUrl: import_zod19.z.string(),
|
|
686
|
+
username: import_zod19.z.string(),
|
|
687
|
+
encryptedPassword: import_zod19.z.string(),
|
|
688
|
+
captureTraffic: import_zod19.z.boolean().optional()
|
|
689
|
+
});
|
|
690
|
+
var BrowserAuthSuccessSchema = import_zod19.z.object({
|
|
691
|
+
success: import_zod19.z.literal(true),
|
|
575
692
|
authData: ProviderAuthDataSchema,
|
|
576
|
-
capturedTraffic:
|
|
693
|
+
capturedTraffic: import_zod19.z.array(CapturedTrafficEntrySchema).optional()
|
|
577
694
|
});
|
|
578
|
-
var BrowserAuthFailureSchema =
|
|
579
|
-
success:
|
|
580
|
-
error:
|
|
695
|
+
var BrowserAuthFailureSchema = import_zod19.z.object({
|
|
696
|
+
success: import_zod19.z.literal(false),
|
|
697
|
+
error: import_zod19.z.string()
|
|
581
698
|
});
|
|
582
|
-
var BrowserAuthResponseSchema =
|
|
699
|
+
var BrowserAuthResponseSchema = import_zod19.z.discriminatedUnion("success", [
|
|
583
700
|
BrowserAuthSuccessSchema,
|
|
584
701
|
BrowserAuthFailureSchema
|
|
585
702
|
]);
|
|
586
|
-
var CrawlPageSchema =
|
|
587
|
-
url:
|
|
588
|
-
html:
|
|
703
|
+
var CrawlPageSchema = import_zod19.z.object({
|
|
704
|
+
url: import_zod19.z.string(),
|
|
705
|
+
html: import_zod19.z.string()
|
|
589
706
|
});
|
|
590
|
-
var BrowserCrawlSuccessSchema =
|
|
591
|
-
success:
|
|
592
|
-
pages:
|
|
707
|
+
var BrowserCrawlSuccessSchema = import_zod19.z.object({
|
|
708
|
+
success: import_zod19.z.literal(true),
|
|
709
|
+
pages: import_zod19.z.array(CrawlPageSchema)
|
|
593
710
|
});
|
|
594
|
-
var BrowserCrawlFailureSchema =
|
|
595
|
-
success:
|
|
596
|
-
error:
|
|
711
|
+
var BrowserCrawlFailureSchema = import_zod19.z.object({
|
|
712
|
+
success: import_zod19.z.literal(false),
|
|
713
|
+
error: import_zod19.z.string()
|
|
597
714
|
});
|
|
598
|
-
var BrowserCrawlResponseSchema =
|
|
715
|
+
var BrowserCrawlResponseSchema = import_zod19.z.discriminatedUnion("success", [
|
|
599
716
|
BrowserCrawlSuccessSchema,
|
|
600
717
|
BrowserCrawlFailureSchema
|
|
601
718
|
]);
|
|
@@ -603,6 +720,11 @@ var BrowserCrawlResponseSchema = import_zod15.z.discriminatedUnion("success", [
|
|
|
603
720
|
0 && (module.exports = {
|
|
604
721
|
AnonymousDriverErrorResponseSchema,
|
|
605
722
|
AnonymousDriverResponseSchema,
|
|
723
|
+
BGGeoActivitySchema,
|
|
724
|
+
BGGeoBatchRequestSchema,
|
|
725
|
+
BGGeoBatterySchema,
|
|
726
|
+
BGGeoCoordsSchema,
|
|
727
|
+
BGGeoLocationSchema,
|
|
606
728
|
BatchConvexUpdate,
|
|
607
729
|
BatchConvexUpdateSchema,
|
|
608
730
|
BrowserAuthFailureSchema,
|
|
@@ -613,7 +735,9 @@ var BrowserCrawlResponseSchema = import_zod15.z.discriminatedUnion("success", [
|
|
|
613
735
|
BrowserCrawlResponseSchema,
|
|
614
736
|
BrowserCrawlSuccessSchema,
|
|
615
737
|
CapturedTrafficEntrySchema,
|
|
738
|
+
ConvexBreadcrumbEventSchema,
|
|
616
739
|
ConvexDriverSchema,
|
|
740
|
+
ConvexDriverTripRequestSchema,
|
|
617
741
|
ConvexUpdate,
|
|
618
742
|
ConvexUpdateSchema,
|
|
619
743
|
CrawlPageSchema,
|
|
@@ -640,6 +764,8 @@ var BrowserCrawlResponseSchema = import_zod15.z.discriminatedUnion("success", [
|
|
|
640
764
|
EnrichedTripSummaryResponseSchema,
|
|
641
765
|
EnrichedTripSummarySchema,
|
|
642
766
|
GomotiveAuthDataSchema,
|
|
767
|
+
ListDriversRequestSchema,
|
|
768
|
+
ListDriversResponseSchema,
|
|
643
769
|
ManualBatchEntrySchema,
|
|
644
770
|
ManualBatchRequestSchema,
|
|
645
771
|
ManualBatchResponseSchema,
|
|
@@ -659,6 +785,8 @@ var BrowserCrawlResponseSchema = import_zod15.z.discriminatedUnion("success", [
|
|
|
659
785
|
PatchDriverDriverResponseSchema,
|
|
660
786
|
PatchDriverRequestSchema,
|
|
661
787
|
PatchDriverResponseSchema,
|
|
788
|
+
PostDriverTripTelemetryRecordSchema,
|
|
789
|
+
PostDriverTripTelemetryRequestSchema,
|
|
662
790
|
ProviderAuthDataSchema,
|
|
663
791
|
ScrapeStatus,
|
|
664
792
|
SharedDriverResponseSchema,
|