@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/browser.cjs +115 -16
- package/dist/browser.d.cts +87 -1
- package/dist/browser.d.ts +87 -1
- package/dist/browser.js +19 -1
- package/dist/{chunk-S53TIE72.js → chunk-P4S46OZI.js} +106 -16
- package/dist/index.cjs +291 -190
- package/dist/index.d.cts +17 -1
- package/dist/index.d.ts +17 -1
- package/dist/index.js +23 -3
- package/package.json +1 -1
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/
|
|
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 =
|
|
228
|
-
status:
|
|
229
|
-
correctPassword:
|
|
230
|
-
externalProviderAccountId:
|
|
231
|
-
username:
|
|
232
|
-
provider_url:
|
|
233
|
-
driverCount:
|
|
234
|
-
providerSlug:
|
|
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
|
|
239
|
-
var ValidatePasswordRequestSchema =
|
|
240
|
-
providerAccountId:
|
|
241
|
-
encryptedPassword:
|
|
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 =
|
|
244
|
-
isValid:
|
|
245
|
-
driverIds:
|
|
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
|
|
250
|
-
var DeleteProviderAccountRequestSchema =
|
|
251
|
-
providerAccountId:
|
|
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 =
|
|
254
|
-
success:
|
|
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
|
|
259
|
-
var DriverRankingsRequestSchema =
|
|
260
|
-
start_date:
|
|
261
|
-
end_date:
|
|
262
|
-
state:
|
|
263
|
-
source:
|
|
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 =
|
|
266
|
-
rank:
|
|
267
|
-
driver_id:
|
|
268
|
-
driver_name:
|
|
269
|
-
total_miles:
|
|
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 =
|
|
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
|
|
275
|
-
var StateHeatmapRequestSchema =
|
|
276
|
-
driver_id:
|
|
277
|
-
start_date:
|
|
278
|
-
end_date:
|
|
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 =
|
|
281
|
-
count:
|
|
282
|
-
percentage:
|
|
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 =
|
|
285
|
-
|
|
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
|
|
291
|
-
var ManualBatchEntrySchema =
|
|
292
|
-
driver_id:
|
|
293
|
-
timestamp:
|
|
294
|
-
location_latitude:
|
|
295
|
-
location_longitude:
|
|
296
|
-
location_address:
|
|
297
|
-
vehicle_odometer_miles:
|
|
298
|
-
heading:
|
|
299
|
-
speed_mph:
|
|
300
|
-
altitude_feet:
|
|
301
|
-
raw:
|
|
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 =
|
|
304
|
-
entries:
|
|
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 =
|
|
307
|
-
id:
|
|
308
|
-
driver_id:
|
|
309
|
-
timestamp:
|
|
310
|
-
remaining_drive_time_in_seconds:
|
|
311
|
-
remaining_shift_time_in_seconds:
|
|
312
|
-
remaining_cycle_time_in_seconds:
|
|
313
|
-
remaining_break_time_in_seconds:
|
|
314
|
-
location_latitude:
|
|
315
|
-
location_longitude:
|
|
316
|
-
previous_location_latitude:
|
|
317
|
-
previous_location_longitude:
|
|
318
|
-
location_address:
|
|
319
|
-
location_state:
|
|
320
|
-
echoed_odometer_miles:
|
|
321
|
-
osrm_calculated_miles:
|
|
322
|
-
heading:
|
|
323
|
-
speed_mph:
|
|
324
|
-
altitude_feet:
|
|
325
|
-
source:
|
|
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 =
|
|
328
|
-
message:
|
|
329
|
-
inserted_count:
|
|
330
|
-
telemetry:
|
|
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
|
|
335
|
-
var DriverTripsRequestSchema =
|
|
336
|
-
driver_id:
|
|
337
|
-
start_date:
|
|
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:
|
|
431
|
+
end_date: import_zod12.z.string()
|
|
340
432
|
// YYYY-MM-DD
|
|
341
433
|
});
|
|
342
|
-
var DriverTripSchema =
|
|
343
|
-
id:
|
|
344
|
-
start_time:
|
|
345
|
-
end_time:
|
|
346
|
-
point_count:
|
|
347
|
-
polyline:
|
|
348
|
-
highways:
|
|
349
|
-
total_miles:
|
|
350
|
-
avg_speed_mph:
|
|
351
|
-
miles_by_weather:
|
|
352
|
-
miles_by_light:
|
|
353
|
-
});
|
|
354
|
-
var DriverTripsResponseSchema =
|
|
355
|
-
var DriverDailySummarySchema =
|
|
356
|
-
summary_date:
|
|
357
|
-
total_miles:
|
|
358
|
-
trip_count:
|
|
359
|
-
point_count:
|
|
360
|
-
polyline:
|
|
361
|
-
highways:
|
|
362
|
-
avg_speed_mph:
|
|
363
|
-
miles_by_weather:
|
|
364
|
-
miles_by_light:
|
|
365
|
-
});
|
|
366
|
-
var DriverDailySummariesResponseSchema =
|
|
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
|
|
370
|
-
var EnrichedTripSummaryRequestSchema =
|
|
371
|
-
trip_id:
|
|
372
|
-
});
|
|
373
|
-
var DriverEnrichedSummariesRequestSchema =
|
|
374
|
-
driver_id:
|
|
375
|
-
start_date:
|
|
376
|
-
end_date:
|
|
377
|
-
});
|
|
378
|
-
var EnrichedStopSchema =
|
|
379
|
-
duration_seconds:
|
|
380
|
-
});
|
|
381
|
-
var EnrichedPointSchema =
|
|
382
|
-
lat:
|
|
383
|
-
lon:
|
|
384
|
-
timestamp:
|
|
385
|
-
speed_mph:
|
|
386
|
-
heading:
|
|
387
|
-
altitude_feet:
|
|
388
|
-
weather_condition:
|
|
389
|
-
temperature_f:
|
|
390
|
-
visibility_miles:
|
|
391
|
-
light_condition:
|
|
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 =
|
|
395
|
-
trip_id:
|
|
396
|
-
driver_id:
|
|
397
|
-
start_time:
|
|
398
|
-
end_time:
|
|
399
|
-
points:
|
|
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 =
|
|
494
|
+
var DriverEnrichedSummariesResponseSchema = import_zod13.z.array(EnrichedTripSummarySchema);
|
|
403
495
|
|
|
404
496
|
// src/auth-data.ts
|
|
405
|
-
var
|
|
406
|
-
var GomotiveAuthDataSchema =
|
|
407
|
-
kind:
|
|
408
|
-
token:
|
|
409
|
-
ownerOperator:
|
|
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 =
|
|
412
|
-
kind:
|
|
413
|
-
driverId:
|
|
414
|
-
cookie:
|
|
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 =
|
|
417
|
-
kind:
|
|
418
|
-
cookie:
|
|
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 =
|
|
421
|
-
kind:
|
|
512
|
+
var NoneAuthDataSchema = import_zod14.z.object({
|
|
513
|
+
kind: import_zod14.z.literal("none")
|
|
422
514
|
});
|
|
423
|
-
var ProviderAuthDataSchema =
|
|
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 =
|
|
430
|
-
driverId:
|
|
431
|
-
cookie:
|
|
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
|
|
468
|
-
var CapturedTrafficEntrySchema =
|
|
469
|
-
method:
|
|
470
|
-
url:
|
|
471
|
-
status:
|
|
472
|
-
responseBody:
|
|
473
|
-
});
|
|
474
|
-
var BrowserAuthRequestSchema =
|
|
475
|
-
providerStub:
|
|
476
|
-
providerUrl:
|
|
477
|
-
username:
|
|
478
|
-
encryptedPassword:
|
|
479
|
-
captureTraffic:
|
|
480
|
-
});
|
|
481
|
-
var BrowserAuthSuccessSchema =
|
|
482
|
-
success:
|
|
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:
|
|
576
|
+
capturedTraffic: import_zod15.z.array(CapturedTrafficEntrySchema).optional()
|
|
485
577
|
});
|
|
486
|
-
var BrowserAuthFailureSchema =
|
|
487
|
-
success:
|
|
488
|
-
error:
|
|
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 =
|
|
582
|
+
var BrowserAuthResponseSchema = import_zod15.z.discriminatedUnion("success", [
|
|
491
583
|
BrowserAuthSuccessSchema,
|
|
492
584
|
BrowserAuthFailureSchema
|
|
493
585
|
]);
|
|
494
|
-
var CrawlPageSchema =
|
|
495
|
-
url:
|
|
496
|
-
html:
|
|
586
|
+
var CrawlPageSchema = import_zod15.z.object({
|
|
587
|
+
url: import_zod15.z.string(),
|
|
588
|
+
html: import_zod15.z.string()
|
|
497
589
|
});
|
|
498
|
-
var BrowserCrawlSuccessSchema =
|
|
499
|
-
success:
|
|
500
|
-
pages:
|
|
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 =
|
|
503
|
-
success:
|
|
504
|
-
error:
|
|
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 =
|
|
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,
|