@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/browser.cjs +107 -16
- package/dist/browser.d.cts +82 -1
- package/dist/browser.d.ts +82 -1
- package/dist/browser.js +15 -1
- package/dist/{chunk-S53TIE72.js → chunk-BXCWZMK7.js} +100 -16
- package/dist/index.cjs +283 -190
- package/dist/index.d.cts +17 -1
- package/dist/index.d.ts +17 -1
- package/dist/index.js +19 -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,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/
|
|
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 =
|
|
228
|
-
status:
|
|
229
|
-
correctPassword:
|
|
230
|
-
externalProviderAccountId:
|
|
231
|
-
username:
|
|
232
|
-
provider_url:
|
|
233
|
-
driverCount:
|
|
234
|
-
providerSlug:
|
|
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
|
|
239
|
-
var ValidatePasswordRequestSchema =
|
|
240
|
-
providerAccountId:
|
|
241
|
-
encryptedPassword:
|
|
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 =
|
|
244
|
-
isValid:
|
|
245
|
-
driverIds:
|
|
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
|
|
250
|
-
var DeleteProviderAccountRequestSchema =
|
|
251
|
-
providerAccountId:
|
|
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 =
|
|
254
|
-
success:
|
|
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
|
|
259
|
-
var DriverRankingsRequestSchema =
|
|
260
|
-
start_date:
|
|
261
|
-
end_date:
|
|
262
|
-
state:
|
|
263
|
-
source:
|
|
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 =
|
|
266
|
-
rank:
|
|
267
|
-
driver_id:
|
|
268
|
-
driver_name:
|
|
269
|
-
total_miles:
|
|
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 =
|
|
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
|
|
275
|
-
var StateHeatmapRequestSchema =
|
|
276
|
-
driver_id:
|
|
277
|
-
start_date:
|
|
278
|
-
end_date:
|
|
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 =
|
|
281
|
-
count:
|
|
282
|
-
percentage:
|
|
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 =
|
|
285
|
-
|
|
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
|
|
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:
|
|
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 =
|
|
304
|
-
entries:
|
|
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 =
|
|
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:
|
|
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 =
|
|
328
|
-
message:
|
|
329
|
-
inserted_count:
|
|
330
|
-
telemetry:
|
|
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
|
|
335
|
-
var DriverTripsRequestSchema =
|
|
336
|
-
driver_id:
|
|
337
|
-
start_date:
|
|
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:
|
|
425
|
+
end_date: import_zod12.z.string()
|
|
340
426
|
// YYYY-MM-DD
|
|
341
427
|
});
|
|
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 =
|
|
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
|
|
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:
|
|
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 =
|
|
395
|
-
trip_id:
|
|
396
|
-
driver_id:
|
|
397
|
-
start_time:
|
|
398
|
-
end_time:
|
|
399
|
-
points:
|
|
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 =
|
|
488
|
+
var DriverEnrichedSummariesResponseSchema = import_zod13.z.array(EnrichedTripSummarySchema);
|
|
403
489
|
|
|
404
490
|
// src/auth-data.ts
|
|
405
|
-
var
|
|
406
|
-
var GomotiveAuthDataSchema =
|
|
407
|
-
kind:
|
|
408
|
-
token:
|
|
409
|
-
ownerOperator:
|
|
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 =
|
|
412
|
-
kind:
|
|
413
|
-
driverId:
|
|
414
|
-
cookie:
|
|
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 =
|
|
417
|
-
kind:
|
|
418
|
-
cookie:
|
|
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 =
|
|
421
|
-
kind:
|
|
506
|
+
var NoneAuthDataSchema = import_zod14.z.object({
|
|
507
|
+
kind: import_zod14.z.literal("none")
|
|
422
508
|
});
|
|
423
|
-
var ProviderAuthDataSchema =
|
|
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 =
|
|
430
|
-
driverId:
|
|
431
|
-
cookie:
|
|
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
|
|
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:
|
|
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:
|
|
570
|
+
capturedTraffic: import_zod15.z.array(CapturedTrafficEntrySchema).optional()
|
|
485
571
|
});
|
|
486
|
-
var BrowserAuthFailureSchema =
|
|
487
|
-
success:
|
|
488
|
-
error:
|
|
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 =
|
|
576
|
+
var BrowserAuthResponseSchema = import_zod15.z.discriminatedUnion("success", [
|
|
491
577
|
BrowserAuthSuccessSchema,
|
|
492
578
|
BrowserAuthFailureSchema
|
|
493
579
|
]);
|
|
494
|
-
var CrawlPageSchema =
|
|
495
|
-
url:
|
|
496
|
-
html:
|
|
580
|
+
var CrawlPageSchema = import_zod15.z.object({
|
|
581
|
+
url: import_zod15.z.string(),
|
|
582
|
+
html: import_zod15.z.string()
|
|
497
583
|
});
|
|
498
|
-
var BrowserCrawlSuccessSchema =
|
|
499
|
-
success:
|
|
500
|
-
pages:
|
|
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 =
|
|
503
|
-
success:
|
|
504
|
-
error:
|
|
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 =
|
|
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,
|