@findatruck/shared-schemas 2.11.0 → 2.13.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 +1 -0
- package/dist/browser.d.cts +1 -0
- package/dist/browser.d.ts +1 -0
- package/dist/browser.js +1 -1
- package/dist/{chunk-UWBIQBUR.js → chunk-S53TIE72.js} +1 -0
- package/dist/index.cjs +176 -2
- package/dist/index.d.cts +193 -1
- package/dist/index.d.ts +193 -1
- package/dist/index.js +156 -2
- package/package.json +1 -1
package/dist/browser.cjs
CHANGED
|
@@ -153,6 +153,7 @@ var ScrapeStatus = /* @__PURE__ */ ((ScrapeStatus2) => {
|
|
|
153
153
|
ScrapeStatus2["LOGIN_SUCCESS"] = "LOGIN_SUCCESS";
|
|
154
154
|
ScrapeStatus2["LOGIN_FAILED"] = "LOGIN_FAILED";
|
|
155
155
|
ScrapeStatus2["LOGIN_SUCCESS_FETCH_FAILED"] = "LOGIN_SUCCESS_FETCH_FAILED";
|
|
156
|
+
ScrapeStatus2["LOGIN_SUCCESS_UNSUPPORTED_PROVIDER"] = "LOGIN_SUCCESS_UNSUPPORTED_PROVIDER";
|
|
156
157
|
ScrapeStatus2["DATA_FETCH_IN_PROGRESS"] = "DATA_FETCH_IN_PROGRESS";
|
|
157
158
|
ScrapeStatus2["DATA_FETCH_SUCCESS"] = "DATA_FETCH_SUCCESS";
|
|
158
159
|
ScrapeStatus2["DATA_FETCH_FAILED"] = "DATA_FETCH_FAILED";
|
package/dist/browser.d.cts
CHANGED
|
@@ -297,6 +297,7 @@ declare enum ScrapeStatus {
|
|
|
297
297
|
LOGIN_SUCCESS = "LOGIN_SUCCESS",
|
|
298
298
|
LOGIN_FAILED = "LOGIN_FAILED",
|
|
299
299
|
LOGIN_SUCCESS_FETCH_FAILED = "LOGIN_SUCCESS_FETCH_FAILED",
|
|
300
|
+
LOGIN_SUCCESS_UNSUPPORTED_PROVIDER = "LOGIN_SUCCESS_UNSUPPORTED_PROVIDER",
|
|
300
301
|
DATA_FETCH_IN_PROGRESS = "DATA_FETCH_IN_PROGRESS",
|
|
301
302
|
DATA_FETCH_SUCCESS = "DATA_FETCH_SUCCESS",
|
|
302
303
|
DATA_FETCH_FAILED = "DATA_FETCH_FAILED"
|
package/dist/browser.d.ts
CHANGED
|
@@ -297,6 +297,7 @@ declare enum ScrapeStatus {
|
|
|
297
297
|
LOGIN_SUCCESS = "LOGIN_SUCCESS",
|
|
298
298
|
LOGIN_FAILED = "LOGIN_FAILED",
|
|
299
299
|
LOGIN_SUCCESS_FETCH_FAILED = "LOGIN_SUCCESS_FETCH_FAILED",
|
|
300
|
+
LOGIN_SUCCESS_UNSUPPORTED_PROVIDER = "LOGIN_SUCCESS_UNSUPPORTED_PROVIDER",
|
|
300
301
|
DATA_FETCH_IN_PROGRESS = "DATA_FETCH_IN_PROGRESS",
|
|
301
302
|
DATA_FETCH_SUCCESS = "DATA_FETCH_SUCCESS",
|
|
302
303
|
DATA_FETCH_FAILED = "DATA_FETCH_FAILED"
|
package/dist/browser.js
CHANGED
|
@@ -101,6 +101,7 @@ var ScrapeStatus = /* @__PURE__ */ ((ScrapeStatus2) => {
|
|
|
101
101
|
ScrapeStatus2["LOGIN_SUCCESS"] = "LOGIN_SUCCESS";
|
|
102
102
|
ScrapeStatus2["LOGIN_FAILED"] = "LOGIN_FAILED";
|
|
103
103
|
ScrapeStatus2["LOGIN_SUCCESS_FETCH_FAILED"] = "LOGIN_SUCCESS_FETCH_FAILED";
|
|
104
|
+
ScrapeStatus2["LOGIN_SUCCESS_UNSUPPORTED_PROVIDER"] = "LOGIN_SUCCESS_UNSUPPORTED_PROVIDER";
|
|
104
105
|
ScrapeStatus2["DATA_FETCH_IN_PROGRESS"] = "DATA_FETCH_IN_PROGRESS";
|
|
105
106
|
ScrapeStatus2["DATA_FETCH_SUCCESS"] = "DATA_FETCH_SUCCESS";
|
|
106
107
|
ScrapeStatus2["DATA_FETCH_FAILED"] = "DATA_FETCH_FAILED";
|
package/dist/index.cjs
CHANGED
|
@@ -32,14 +32,28 @@ var index_exports = {};
|
|
|
32
32
|
__export(index_exports, {
|
|
33
33
|
BatchConvexUpdate: () => BatchConvexUpdate,
|
|
34
34
|
BatchConvexUpdateSchema: () => BatchConvexUpdateSchema,
|
|
35
|
+
BrowserAuthFailureSchema: () => BrowserAuthFailureSchema,
|
|
36
|
+
BrowserAuthRequestSchema: () => BrowserAuthRequestSchema,
|
|
37
|
+
BrowserAuthResponseSchema: () => BrowserAuthResponseSchema,
|
|
38
|
+
BrowserAuthSuccessSchema: () => BrowserAuthSuccessSchema,
|
|
39
|
+
BrowserCrawlFailureSchema: () => BrowserCrawlFailureSchema,
|
|
40
|
+
BrowserCrawlResponseSchema: () => BrowserCrawlResponseSchema,
|
|
41
|
+
BrowserCrawlSuccessSchema: () => BrowserCrawlSuccessSchema,
|
|
35
42
|
ConvexDriverSchema: () => ConvexDriverSchema,
|
|
36
43
|
ConvexUpdate: () => ConvexUpdate,
|
|
37
44
|
ConvexUpdateSchema: () => ConvexUpdateSchema,
|
|
45
|
+
CrawlPageSchema: () => CrawlPageSchema,
|
|
38
46
|
DeleteProviderAccountRequestSchema: () => DeleteProviderAccountRequestSchema,
|
|
39
47
|
DeleteProviderAccountResponseSchema: () => DeleteProviderAccountResponseSchema,
|
|
40
48
|
DriverRankingSchema: () => DriverRankingSchema,
|
|
41
49
|
DriverRankingsRequestSchema: () => DriverRankingsRequestSchema,
|
|
42
50
|
DriverRankingsResponseSchema: () => DriverRankingsResponseSchema,
|
|
51
|
+
GomotiveAuthDataSchema: () => GomotiveAuthDataSchema,
|
|
52
|
+
ManualBatchEntrySchema: () => ManualBatchEntrySchema,
|
|
53
|
+
ManualBatchRequestSchema: () => ManualBatchRequestSchema,
|
|
54
|
+
ManualBatchResponseSchema: () => ManualBatchResponseSchema,
|
|
55
|
+
ManualBatchTelemetrySchema: () => ManualBatchTelemetrySchema,
|
|
56
|
+
MockAuthDataSchema: () => MockAuthDataSchema,
|
|
43
57
|
NewLoginRequest: () => NewLoginRequest,
|
|
44
58
|
NewLoginRequestSchema: () => NewLoginRequestSchema,
|
|
45
59
|
NewLoginResponse: () => NewLoginResponse,
|
|
@@ -48,13 +62,18 @@ __export(index_exports, {
|
|
|
48
62
|
NewLoginResponseSchema: () => NewLoginResponseSchema,
|
|
49
63
|
NewLoginResponseSuccess: () => NewLoginResponseSuccess,
|
|
50
64
|
NewLoginResponseSuccessSchema: () => NewLoginResponseSuccessSchema,
|
|
65
|
+
NoneAuthDataSchema: () => NoneAuthDataSchema,
|
|
66
|
+
ProviderAuthDataSchema: () => ProviderAuthDataSchema,
|
|
51
67
|
ScrapeStatus: () => ScrapeStatus,
|
|
52
68
|
StateHeatmapEntrySchema: () => StateHeatmapEntrySchema,
|
|
53
69
|
StateHeatmapRequestSchema: () => StateHeatmapRequestSchema,
|
|
54
70
|
StateHeatmapResponseSchema: () => StateHeatmapResponseSchema,
|
|
55
71
|
UpdateScrapeStatusMessage: () => UpdateScrapeStatusMessage,
|
|
56
72
|
ValidatePasswordRequestSchema: () => ValidatePasswordRequestSchema,
|
|
57
|
-
ValidatePasswordResponseSchema: () => ValidatePasswordResponseSchema
|
|
73
|
+
ValidatePasswordResponseSchema: () => ValidatePasswordResponseSchema,
|
|
74
|
+
VistaAuthDataSchema: () => VistaAuthDataSchema,
|
|
75
|
+
deserializeAuthData: () => deserializeAuthData,
|
|
76
|
+
serializeAuthData: () => serializeAuthData
|
|
58
77
|
});
|
|
59
78
|
module.exports = __toCommonJS(index_exports);
|
|
60
79
|
|
|
@@ -161,6 +180,7 @@ var ScrapeStatus = /* @__PURE__ */ ((ScrapeStatus2) => {
|
|
|
161
180
|
ScrapeStatus2["LOGIN_SUCCESS"] = "LOGIN_SUCCESS";
|
|
162
181
|
ScrapeStatus2["LOGIN_FAILED"] = "LOGIN_FAILED";
|
|
163
182
|
ScrapeStatus2["LOGIN_SUCCESS_FETCH_FAILED"] = "LOGIN_SUCCESS_FETCH_FAILED";
|
|
183
|
+
ScrapeStatus2["LOGIN_SUCCESS_UNSUPPORTED_PROVIDER"] = "LOGIN_SUCCESS_UNSUPPORTED_PROVIDER";
|
|
164
184
|
ScrapeStatus2["DATA_FETCH_IN_PROGRESS"] = "DATA_FETCH_IN_PROGRESS";
|
|
165
185
|
ScrapeStatus2["DATA_FETCH_SUCCESS"] = "DATA_FETCH_SUCCESS";
|
|
166
186
|
ScrapeStatus2["DATA_FETCH_FAILED"] = "DATA_FETCH_FAILED";
|
|
@@ -226,18 +246,167 @@ var StateHeatmapResponseSchema = import_zod7.z.record(
|
|
|
226
246
|
import_zod7.z.string().length(2),
|
|
227
247
|
StateHeatmapEntrySchema
|
|
228
248
|
).describe("Record of 2-letter state codes to heatmap entries");
|
|
249
|
+
|
|
250
|
+
// src/schemas/telemetry/manual-batch.ts
|
|
251
|
+
var import_zod8 = require("zod");
|
|
252
|
+
var ManualBatchEntrySchema = import_zod8.z.object({
|
|
253
|
+
driver_id: import_zod8.z.string().uuid().describe("Internal UUID of the driver"),
|
|
254
|
+
timestamp: import_zod8.z.string().datetime().describe("Timestamp of the GPS reading (ISO 8601 format)"),
|
|
255
|
+
location_latitude: import_zod8.z.number().min(-90).max(90).describe("GPS latitude coordinate"),
|
|
256
|
+
location_longitude: import_zod8.z.number().min(-180).max(180).describe("GPS longitude coordinate"),
|
|
257
|
+
location_address: import_zod8.z.string().optional().describe("Optional human-readable address"),
|
|
258
|
+
vehicle_odometer_miles: import_zod8.z.number().min(0).optional().describe("Optional vehicle odometer reading in miles")
|
|
259
|
+
}).describe("Single manual telemetry entry");
|
|
260
|
+
var ManualBatchRequestSchema = import_zod8.z.object({
|
|
261
|
+
entries: import_zod8.z.array(ManualBatchEntrySchema).min(1).max(1e3).describe("Array of manual telemetry entries (1-1000)")
|
|
262
|
+
}).describe("Request schema for manual batch telemetry insertion");
|
|
263
|
+
var ManualBatchTelemetrySchema = import_zod8.z.object({
|
|
264
|
+
id: import_zod8.z.number().int().describe("Telemetry record ID"),
|
|
265
|
+
driver_id: import_zod8.z.string().uuid().describe("Internal UUID of the driver"),
|
|
266
|
+
timestamp: import_zod8.z.union([import_zod8.z.string(), import_zod8.z.date()]).describe("Timestamp of the telemetry reading"),
|
|
267
|
+
remaining_drive_time_in_seconds: import_zod8.z.number().min(0),
|
|
268
|
+
remaining_shift_time_in_seconds: import_zod8.z.number().min(0),
|
|
269
|
+
remaining_cycle_time_in_seconds: import_zod8.z.number().min(0),
|
|
270
|
+
remaining_break_time_in_seconds: import_zod8.z.number().min(0),
|
|
271
|
+
location_latitude: import_zod8.z.number().min(-90).max(90),
|
|
272
|
+
location_longitude: import_zod8.z.number().min(-180).max(180),
|
|
273
|
+
previous_location_latitude: import_zod8.z.number().min(-90).max(90).nullable(),
|
|
274
|
+
previous_location_longitude: import_zod8.z.number().min(-180).max(180).nullable(),
|
|
275
|
+
location_address: import_zod8.z.string().nullable(),
|
|
276
|
+
location_state: import_zod8.z.string().length(2).nullable(),
|
|
277
|
+
vehicle_odometer_miles: import_zod8.z.number().min(0).nullable(),
|
|
278
|
+
source: import_zod8.z.enum(["eld", "manual"])
|
|
279
|
+
}).describe("Telemetry record returned from manual batch insertion");
|
|
280
|
+
var ManualBatchResponseSchema = import_zod8.z.object({
|
|
281
|
+
message: import_zod8.z.string().describe("Success message"),
|
|
282
|
+
inserted_count: import_zod8.z.number().int().min(0).describe("Number of telemetry entries inserted"),
|
|
283
|
+
telemetry: import_zod8.z.array(ManualBatchTelemetrySchema).describe("Array of inserted telemetry records")
|
|
284
|
+
}).describe("Response schema for manual batch telemetry insertion");
|
|
285
|
+
|
|
286
|
+
// src/auth-data.ts
|
|
287
|
+
var import_zod9 = require("zod");
|
|
288
|
+
var GomotiveAuthDataSchema = import_zod9.z.object({
|
|
289
|
+
kind: import_zod9.z.literal("gomotive"),
|
|
290
|
+
token: import_zod9.z.string(),
|
|
291
|
+
ownerOperator: import_zod9.z.boolean()
|
|
292
|
+
});
|
|
293
|
+
var VistaAuthDataSchema = import_zod9.z.object({
|
|
294
|
+
kind: import_zod9.z.literal("vista"),
|
|
295
|
+
driverId: import_zod9.z.string(),
|
|
296
|
+
cookie: import_zod9.z.string()
|
|
297
|
+
});
|
|
298
|
+
var MockAuthDataSchema = import_zod9.z.object({
|
|
299
|
+
kind: import_zod9.z.literal("mock"),
|
|
300
|
+
cookie: import_zod9.z.string()
|
|
301
|
+
});
|
|
302
|
+
var NoneAuthDataSchema = import_zod9.z.object({
|
|
303
|
+
kind: import_zod9.z.literal("none")
|
|
304
|
+
});
|
|
305
|
+
var ProviderAuthDataSchema = import_zod9.z.discriminatedUnion("kind", [
|
|
306
|
+
GomotiveAuthDataSchema,
|
|
307
|
+
VistaAuthDataSchema,
|
|
308
|
+
MockAuthDataSchema,
|
|
309
|
+
NoneAuthDataSchema
|
|
310
|
+
]);
|
|
311
|
+
var LegacyVistaAuthSchema = import_zod9.z.object({
|
|
312
|
+
driverId: import_zod9.z.string(),
|
|
313
|
+
cookie: import_zod9.z.string()
|
|
314
|
+
});
|
|
315
|
+
function serializeAuthData(data) {
|
|
316
|
+
if (data.kind === "none") {
|
|
317
|
+
return null;
|
|
318
|
+
}
|
|
319
|
+
return JSON.stringify(data);
|
|
320
|
+
}
|
|
321
|
+
function deserializeAuthData(authToken) {
|
|
322
|
+
if (!authToken) {
|
|
323
|
+
return { kind: "none" };
|
|
324
|
+
}
|
|
325
|
+
try {
|
|
326
|
+
const parsed = JSON.parse(authToken);
|
|
327
|
+
const newFormatResult = ProviderAuthDataSchema.safeParse(parsed);
|
|
328
|
+
if (newFormatResult.success) {
|
|
329
|
+
return newFormatResult.data;
|
|
330
|
+
}
|
|
331
|
+
const legacyVistaResult = LegacyVistaAuthSchema.safeParse(parsed);
|
|
332
|
+
if (legacyVistaResult.success) {
|
|
333
|
+
return {
|
|
334
|
+
kind: "vista",
|
|
335
|
+
driverId: legacyVistaResult.data.driverId,
|
|
336
|
+
cookie: legacyVistaResult.data.cookie
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
} catch {
|
|
340
|
+
}
|
|
341
|
+
return {
|
|
342
|
+
kind: "gomotive",
|
|
343
|
+
token: authToken,
|
|
344
|
+
ownerOperator: false
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
// src/browser-auth.ts
|
|
349
|
+
var import_zod10 = require("zod");
|
|
350
|
+
var BrowserAuthRequestSchema = import_zod10.z.object({
|
|
351
|
+
providerStub: import_zod10.z.string(),
|
|
352
|
+
providerUrl: import_zod10.z.string(),
|
|
353
|
+
username: import_zod10.z.string(),
|
|
354
|
+
encryptedPassword: import_zod10.z.string()
|
|
355
|
+
});
|
|
356
|
+
var BrowserAuthSuccessSchema = import_zod10.z.object({
|
|
357
|
+
success: import_zod10.z.literal(true),
|
|
358
|
+
authData: ProviderAuthDataSchema
|
|
359
|
+
});
|
|
360
|
+
var BrowserAuthFailureSchema = import_zod10.z.object({
|
|
361
|
+
success: import_zod10.z.literal(false),
|
|
362
|
+
error: import_zod10.z.string()
|
|
363
|
+
});
|
|
364
|
+
var BrowserAuthResponseSchema = import_zod10.z.discriminatedUnion("success", [
|
|
365
|
+
BrowserAuthSuccessSchema,
|
|
366
|
+
BrowserAuthFailureSchema
|
|
367
|
+
]);
|
|
368
|
+
var CrawlPageSchema = import_zod10.z.object({
|
|
369
|
+
url: import_zod10.z.string(),
|
|
370
|
+
html: import_zod10.z.string()
|
|
371
|
+
});
|
|
372
|
+
var BrowserCrawlSuccessSchema = import_zod10.z.object({
|
|
373
|
+
success: import_zod10.z.literal(true),
|
|
374
|
+
pages: import_zod10.z.array(CrawlPageSchema)
|
|
375
|
+
});
|
|
376
|
+
var BrowserCrawlFailureSchema = import_zod10.z.object({
|
|
377
|
+
success: import_zod10.z.literal(false),
|
|
378
|
+
error: import_zod10.z.string()
|
|
379
|
+
});
|
|
380
|
+
var BrowserCrawlResponseSchema = import_zod10.z.discriminatedUnion("success", [
|
|
381
|
+
BrowserCrawlSuccessSchema,
|
|
382
|
+
BrowserCrawlFailureSchema
|
|
383
|
+
]);
|
|
229
384
|
// Annotate the CommonJS export names for ESM import in node:
|
|
230
385
|
0 && (module.exports = {
|
|
231
386
|
BatchConvexUpdate,
|
|
232
387
|
BatchConvexUpdateSchema,
|
|
388
|
+
BrowserAuthFailureSchema,
|
|
389
|
+
BrowserAuthRequestSchema,
|
|
390
|
+
BrowserAuthResponseSchema,
|
|
391
|
+
BrowserAuthSuccessSchema,
|
|
392
|
+
BrowserCrawlFailureSchema,
|
|
393
|
+
BrowserCrawlResponseSchema,
|
|
394
|
+
BrowserCrawlSuccessSchema,
|
|
233
395
|
ConvexDriverSchema,
|
|
234
396
|
ConvexUpdate,
|
|
235
397
|
ConvexUpdateSchema,
|
|
398
|
+
CrawlPageSchema,
|
|
236
399
|
DeleteProviderAccountRequestSchema,
|
|
237
400
|
DeleteProviderAccountResponseSchema,
|
|
238
401
|
DriverRankingSchema,
|
|
239
402
|
DriverRankingsRequestSchema,
|
|
240
403
|
DriverRankingsResponseSchema,
|
|
404
|
+
GomotiveAuthDataSchema,
|
|
405
|
+
ManualBatchEntrySchema,
|
|
406
|
+
ManualBatchRequestSchema,
|
|
407
|
+
ManualBatchResponseSchema,
|
|
408
|
+
ManualBatchTelemetrySchema,
|
|
409
|
+
MockAuthDataSchema,
|
|
241
410
|
NewLoginRequest,
|
|
242
411
|
NewLoginRequestSchema,
|
|
243
412
|
NewLoginResponse,
|
|
@@ -246,11 +415,16 @@ var StateHeatmapResponseSchema = import_zod7.z.record(
|
|
|
246
415
|
NewLoginResponseSchema,
|
|
247
416
|
NewLoginResponseSuccess,
|
|
248
417
|
NewLoginResponseSuccessSchema,
|
|
418
|
+
NoneAuthDataSchema,
|
|
419
|
+
ProviderAuthDataSchema,
|
|
249
420
|
ScrapeStatus,
|
|
250
421
|
StateHeatmapEntrySchema,
|
|
251
422
|
StateHeatmapRequestSchema,
|
|
252
423
|
StateHeatmapResponseSchema,
|
|
253
424
|
UpdateScrapeStatusMessage,
|
|
254
425
|
ValidatePasswordRequestSchema,
|
|
255
|
-
ValidatePasswordResponseSchema
|
|
426
|
+
ValidatePasswordResponseSchema,
|
|
427
|
+
VistaAuthDataSchema,
|
|
428
|
+
deserializeAuthData,
|
|
429
|
+
serializeAuthData
|
|
256
430
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -76,4 +76,196 @@ type StateHeatmapRequest = StateHeatmapRequestData;
|
|
|
76
76
|
type StateHeatmapEntry = StateHeatmapEntryData;
|
|
77
77
|
type StateHeatmapResponse = StateHeatmapResponseData;
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
declare const ManualBatchEntrySchema: z.ZodObject<{
|
|
80
|
+
driver_id: z.ZodString;
|
|
81
|
+
timestamp: z.ZodString;
|
|
82
|
+
location_latitude: z.ZodNumber;
|
|
83
|
+
location_longitude: z.ZodNumber;
|
|
84
|
+
location_address: z.ZodOptional<z.ZodString>;
|
|
85
|
+
vehicle_odometer_miles: z.ZodOptional<z.ZodNumber>;
|
|
86
|
+
}, z.core.$strip>;
|
|
87
|
+
declare const ManualBatchRequestSchema: z.ZodObject<{
|
|
88
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
89
|
+
driver_id: z.ZodString;
|
|
90
|
+
timestamp: z.ZodString;
|
|
91
|
+
location_latitude: z.ZodNumber;
|
|
92
|
+
location_longitude: z.ZodNumber;
|
|
93
|
+
location_address: z.ZodOptional<z.ZodString>;
|
|
94
|
+
vehicle_odometer_miles: z.ZodOptional<z.ZodNumber>;
|
|
95
|
+
}, z.core.$strip>>;
|
|
96
|
+
}, z.core.$strip>;
|
|
97
|
+
declare const ManualBatchTelemetrySchema: z.ZodObject<{
|
|
98
|
+
id: z.ZodNumber;
|
|
99
|
+
driver_id: z.ZodString;
|
|
100
|
+
timestamp: z.ZodUnion<readonly [z.ZodString, z.ZodDate]>;
|
|
101
|
+
remaining_drive_time_in_seconds: z.ZodNumber;
|
|
102
|
+
remaining_shift_time_in_seconds: z.ZodNumber;
|
|
103
|
+
remaining_cycle_time_in_seconds: z.ZodNumber;
|
|
104
|
+
remaining_break_time_in_seconds: z.ZodNumber;
|
|
105
|
+
location_latitude: z.ZodNumber;
|
|
106
|
+
location_longitude: z.ZodNumber;
|
|
107
|
+
previous_location_latitude: z.ZodNullable<z.ZodNumber>;
|
|
108
|
+
previous_location_longitude: z.ZodNullable<z.ZodNumber>;
|
|
109
|
+
location_address: z.ZodNullable<z.ZodString>;
|
|
110
|
+
location_state: z.ZodNullable<z.ZodString>;
|
|
111
|
+
vehicle_odometer_miles: z.ZodNullable<z.ZodNumber>;
|
|
112
|
+
source: z.ZodEnum<{
|
|
113
|
+
eld: "eld";
|
|
114
|
+
manual: "manual";
|
|
115
|
+
}>;
|
|
116
|
+
}, z.core.$strip>;
|
|
117
|
+
declare const ManualBatchResponseSchema: z.ZodObject<{
|
|
118
|
+
message: z.ZodString;
|
|
119
|
+
inserted_count: z.ZodNumber;
|
|
120
|
+
telemetry: z.ZodArray<z.ZodObject<{
|
|
121
|
+
id: z.ZodNumber;
|
|
122
|
+
driver_id: z.ZodString;
|
|
123
|
+
timestamp: z.ZodUnion<readonly [z.ZodString, z.ZodDate]>;
|
|
124
|
+
remaining_drive_time_in_seconds: z.ZodNumber;
|
|
125
|
+
remaining_shift_time_in_seconds: z.ZodNumber;
|
|
126
|
+
remaining_cycle_time_in_seconds: z.ZodNumber;
|
|
127
|
+
remaining_break_time_in_seconds: z.ZodNumber;
|
|
128
|
+
location_latitude: z.ZodNumber;
|
|
129
|
+
location_longitude: z.ZodNumber;
|
|
130
|
+
previous_location_latitude: z.ZodNullable<z.ZodNumber>;
|
|
131
|
+
previous_location_longitude: z.ZodNullable<z.ZodNumber>;
|
|
132
|
+
location_address: z.ZodNullable<z.ZodString>;
|
|
133
|
+
location_state: z.ZodNullable<z.ZodString>;
|
|
134
|
+
vehicle_odometer_miles: z.ZodNullable<z.ZodNumber>;
|
|
135
|
+
source: z.ZodEnum<{
|
|
136
|
+
eld: "eld";
|
|
137
|
+
manual: "manual";
|
|
138
|
+
}>;
|
|
139
|
+
}, z.core.$strip>>;
|
|
140
|
+
}, z.core.$strip>;
|
|
141
|
+
type ManualBatchEntry = z.infer<typeof ManualBatchEntrySchema>;
|
|
142
|
+
type ManualBatchRequest = z.infer<typeof ManualBatchRequestSchema>;
|
|
143
|
+
type ManualBatchTelemetry = z.infer<typeof ManualBatchTelemetrySchema>;
|
|
144
|
+
type ManualBatchResponse = z.infer<typeof ManualBatchResponseSchema>;
|
|
145
|
+
|
|
146
|
+
declare const GomotiveAuthDataSchema: z.ZodObject<{
|
|
147
|
+
kind: z.ZodLiteral<"gomotive">;
|
|
148
|
+
token: z.ZodString;
|
|
149
|
+
ownerOperator: z.ZodBoolean;
|
|
150
|
+
}, z.core.$strip>;
|
|
151
|
+
type GomotiveAuthData = z.infer<typeof GomotiveAuthDataSchema>;
|
|
152
|
+
declare const VistaAuthDataSchema: z.ZodObject<{
|
|
153
|
+
kind: z.ZodLiteral<"vista">;
|
|
154
|
+
driverId: z.ZodString;
|
|
155
|
+
cookie: z.ZodString;
|
|
156
|
+
}, z.core.$strip>;
|
|
157
|
+
type VistaAuthData = z.infer<typeof VistaAuthDataSchema>;
|
|
158
|
+
declare const MockAuthDataSchema: z.ZodObject<{
|
|
159
|
+
kind: z.ZodLiteral<"mock">;
|
|
160
|
+
cookie: z.ZodString;
|
|
161
|
+
}, z.core.$strip>;
|
|
162
|
+
type MockAuthData = z.infer<typeof MockAuthDataSchema>;
|
|
163
|
+
declare const NoneAuthDataSchema: z.ZodObject<{
|
|
164
|
+
kind: z.ZodLiteral<"none">;
|
|
165
|
+
}, z.core.$strip>;
|
|
166
|
+
type NoneAuthData = z.infer<typeof NoneAuthDataSchema>;
|
|
167
|
+
declare const ProviderAuthDataSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
168
|
+
kind: z.ZodLiteral<"gomotive">;
|
|
169
|
+
token: z.ZodString;
|
|
170
|
+
ownerOperator: z.ZodBoolean;
|
|
171
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
172
|
+
kind: z.ZodLiteral<"vista">;
|
|
173
|
+
driverId: z.ZodString;
|
|
174
|
+
cookie: z.ZodString;
|
|
175
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
176
|
+
kind: z.ZodLiteral<"mock">;
|
|
177
|
+
cookie: z.ZodString;
|
|
178
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
179
|
+
kind: z.ZodLiteral<"none">;
|
|
180
|
+
}, z.core.$strip>], "kind">;
|
|
181
|
+
type ProviderAuthData = z.infer<typeof ProviderAuthDataSchema>;
|
|
182
|
+
/**
|
|
183
|
+
* Serializes ProviderAuthData to a string for storage.
|
|
184
|
+
* Returns null for 'none' kind since there's nothing to cache.
|
|
185
|
+
*/
|
|
186
|
+
declare function serializeAuthData(data: ProviderAuthData): string | null;
|
|
187
|
+
/**
|
|
188
|
+
* Deserializes an auth token string to ProviderAuthData.
|
|
189
|
+
* Handles legacy formats for backward compatibility:
|
|
190
|
+
* - Raw string -> { kind: 'gomotive', token, ownerOperator: false }
|
|
191
|
+
* - JSON with {driverId, cookie} but no kind -> { kind: 'vista', ... }
|
|
192
|
+
*/
|
|
193
|
+
declare function deserializeAuthData(authToken: string | null): ProviderAuthData;
|
|
194
|
+
|
|
195
|
+
declare const BrowserAuthRequestSchema: z.ZodObject<{
|
|
196
|
+
providerStub: z.ZodString;
|
|
197
|
+
providerUrl: z.ZodString;
|
|
198
|
+
username: z.ZodString;
|
|
199
|
+
encryptedPassword: z.ZodString;
|
|
200
|
+
}, z.core.$strip>;
|
|
201
|
+
type BrowserAuthRequest = z.infer<typeof BrowserAuthRequestSchema>;
|
|
202
|
+
declare const BrowserAuthSuccessSchema: z.ZodObject<{
|
|
203
|
+
success: z.ZodLiteral<true>;
|
|
204
|
+
authData: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
205
|
+
kind: z.ZodLiteral<"gomotive">;
|
|
206
|
+
token: z.ZodString;
|
|
207
|
+
ownerOperator: z.ZodBoolean;
|
|
208
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
209
|
+
kind: z.ZodLiteral<"vista">;
|
|
210
|
+
driverId: z.ZodString;
|
|
211
|
+
cookie: z.ZodString;
|
|
212
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
213
|
+
kind: z.ZodLiteral<"mock">;
|
|
214
|
+
cookie: z.ZodString;
|
|
215
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
216
|
+
kind: z.ZodLiteral<"none">;
|
|
217
|
+
}, z.core.$strip>], "kind">;
|
|
218
|
+
}, z.core.$strip>;
|
|
219
|
+
declare const BrowserAuthFailureSchema: z.ZodObject<{
|
|
220
|
+
success: z.ZodLiteral<false>;
|
|
221
|
+
error: z.ZodString;
|
|
222
|
+
}, z.core.$strip>;
|
|
223
|
+
declare const BrowserAuthResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
224
|
+
success: z.ZodLiteral<true>;
|
|
225
|
+
authData: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
226
|
+
kind: z.ZodLiteral<"gomotive">;
|
|
227
|
+
token: z.ZodString;
|
|
228
|
+
ownerOperator: z.ZodBoolean;
|
|
229
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
230
|
+
kind: z.ZodLiteral<"vista">;
|
|
231
|
+
driverId: z.ZodString;
|
|
232
|
+
cookie: z.ZodString;
|
|
233
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
234
|
+
kind: z.ZodLiteral<"mock">;
|
|
235
|
+
cookie: z.ZodString;
|
|
236
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
237
|
+
kind: z.ZodLiteral<"none">;
|
|
238
|
+
}, z.core.$strip>], "kind">;
|
|
239
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
240
|
+
success: z.ZodLiteral<false>;
|
|
241
|
+
error: z.ZodString;
|
|
242
|
+
}, z.core.$strip>], "success">;
|
|
243
|
+
type BrowserAuthResponse = z.infer<typeof BrowserAuthResponseSchema>;
|
|
244
|
+
declare const CrawlPageSchema: z.ZodObject<{
|
|
245
|
+
url: z.ZodString;
|
|
246
|
+
html: z.ZodString;
|
|
247
|
+
}, z.core.$strip>;
|
|
248
|
+
declare const BrowserCrawlSuccessSchema: z.ZodObject<{
|
|
249
|
+
success: z.ZodLiteral<true>;
|
|
250
|
+
pages: z.ZodArray<z.ZodObject<{
|
|
251
|
+
url: z.ZodString;
|
|
252
|
+
html: z.ZodString;
|
|
253
|
+
}, z.core.$strip>>;
|
|
254
|
+
}, z.core.$strip>;
|
|
255
|
+
declare const BrowserCrawlFailureSchema: z.ZodObject<{
|
|
256
|
+
success: z.ZodLiteral<false>;
|
|
257
|
+
error: z.ZodString;
|
|
258
|
+
}, z.core.$strip>;
|
|
259
|
+
declare const BrowserCrawlResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
260
|
+
success: z.ZodLiteral<true>;
|
|
261
|
+
pages: z.ZodArray<z.ZodObject<{
|
|
262
|
+
url: z.ZodString;
|
|
263
|
+
html: z.ZodString;
|
|
264
|
+
}, z.core.$strip>>;
|
|
265
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
266
|
+
success: z.ZodLiteral<false>;
|
|
267
|
+
error: z.ZodString;
|
|
268
|
+
}, z.core.$strip>], "success">;
|
|
269
|
+
type BrowserCrawlResponse = z.infer<typeof BrowserCrawlResponseSchema>;
|
|
270
|
+
|
|
271
|
+
export { BrowserAuthFailureSchema, type BrowserAuthRequest, BrowserAuthRequestSchema, type BrowserAuthResponse, BrowserAuthResponseSchema, BrowserAuthSuccessSchema, BrowserCrawlFailureSchema, type BrowserCrawlResponse, BrowserCrawlResponseSchema, BrowserCrawlSuccessSchema, CrawlPageSchema, type DeleteProviderAccountRequest, type DeleteProviderAccountRequestData, DeleteProviderAccountRequestSchema, type DeleteProviderAccountResponse, type DeleteProviderAccountResponseData, DeleteProviderAccountResponseSchema, type DriverRanking, type DriverRankingData, DriverRankingSchema, type DriverRankingsRequest, type DriverRankingsRequestData, DriverRankingsRequestSchema, type DriverRankingsResponse, type DriverRankingsResponseData, DriverRankingsResponseSchema, type GomotiveAuthData, GomotiveAuthDataSchema, type ManualBatchEntry, ManualBatchEntrySchema, type ManualBatchRequest, ManualBatchRequestSchema, type ManualBatchResponse, ManualBatchResponseSchema, type ManualBatchTelemetry, ManualBatchTelemetrySchema, type MockAuthData, MockAuthDataSchema, type NoneAuthData, NoneAuthDataSchema, type ProviderAuthData, ProviderAuthDataSchema, type StateHeatmapEntry, type StateHeatmapEntryData, StateHeatmapEntrySchema, type StateHeatmapRequest, type StateHeatmapRequestData, StateHeatmapRequestSchema, type StateHeatmapResponse, type StateHeatmapResponseData, StateHeatmapResponseSchema, type VistaAuthData, VistaAuthDataSchema, deserializeAuthData, serializeAuthData };
|
package/dist/index.d.ts
CHANGED
|
@@ -76,4 +76,196 @@ type StateHeatmapRequest = StateHeatmapRequestData;
|
|
|
76
76
|
type StateHeatmapEntry = StateHeatmapEntryData;
|
|
77
77
|
type StateHeatmapResponse = StateHeatmapResponseData;
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
declare const ManualBatchEntrySchema: z.ZodObject<{
|
|
80
|
+
driver_id: z.ZodString;
|
|
81
|
+
timestamp: z.ZodString;
|
|
82
|
+
location_latitude: z.ZodNumber;
|
|
83
|
+
location_longitude: z.ZodNumber;
|
|
84
|
+
location_address: z.ZodOptional<z.ZodString>;
|
|
85
|
+
vehicle_odometer_miles: z.ZodOptional<z.ZodNumber>;
|
|
86
|
+
}, z.core.$strip>;
|
|
87
|
+
declare const ManualBatchRequestSchema: z.ZodObject<{
|
|
88
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
89
|
+
driver_id: z.ZodString;
|
|
90
|
+
timestamp: z.ZodString;
|
|
91
|
+
location_latitude: z.ZodNumber;
|
|
92
|
+
location_longitude: z.ZodNumber;
|
|
93
|
+
location_address: z.ZodOptional<z.ZodString>;
|
|
94
|
+
vehicle_odometer_miles: z.ZodOptional<z.ZodNumber>;
|
|
95
|
+
}, z.core.$strip>>;
|
|
96
|
+
}, z.core.$strip>;
|
|
97
|
+
declare const ManualBatchTelemetrySchema: z.ZodObject<{
|
|
98
|
+
id: z.ZodNumber;
|
|
99
|
+
driver_id: z.ZodString;
|
|
100
|
+
timestamp: z.ZodUnion<readonly [z.ZodString, z.ZodDate]>;
|
|
101
|
+
remaining_drive_time_in_seconds: z.ZodNumber;
|
|
102
|
+
remaining_shift_time_in_seconds: z.ZodNumber;
|
|
103
|
+
remaining_cycle_time_in_seconds: z.ZodNumber;
|
|
104
|
+
remaining_break_time_in_seconds: z.ZodNumber;
|
|
105
|
+
location_latitude: z.ZodNumber;
|
|
106
|
+
location_longitude: z.ZodNumber;
|
|
107
|
+
previous_location_latitude: z.ZodNullable<z.ZodNumber>;
|
|
108
|
+
previous_location_longitude: z.ZodNullable<z.ZodNumber>;
|
|
109
|
+
location_address: z.ZodNullable<z.ZodString>;
|
|
110
|
+
location_state: z.ZodNullable<z.ZodString>;
|
|
111
|
+
vehicle_odometer_miles: z.ZodNullable<z.ZodNumber>;
|
|
112
|
+
source: z.ZodEnum<{
|
|
113
|
+
eld: "eld";
|
|
114
|
+
manual: "manual";
|
|
115
|
+
}>;
|
|
116
|
+
}, z.core.$strip>;
|
|
117
|
+
declare const ManualBatchResponseSchema: z.ZodObject<{
|
|
118
|
+
message: z.ZodString;
|
|
119
|
+
inserted_count: z.ZodNumber;
|
|
120
|
+
telemetry: z.ZodArray<z.ZodObject<{
|
|
121
|
+
id: z.ZodNumber;
|
|
122
|
+
driver_id: z.ZodString;
|
|
123
|
+
timestamp: z.ZodUnion<readonly [z.ZodString, z.ZodDate]>;
|
|
124
|
+
remaining_drive_time_in_seconds: z.ZodNumber;
|
|
125
|
+
remaining_shift_time_in_seconds: z.ZodNumber;
|
|
126
|
+
remaining_cycle_time_in_seconds: z.ZodNumber;
|
|
127
|
+
remaining_break_time_in_seconds: z.ZodNumber;
|
|
128
|
+
location_latitude: z.ZodNumber;
|
|
129
|
+
location_longitude: z.ZodNumber;
|
|
130
|
+
previous_location_latitude: z.ZodNullable<z.ZodNumber>;
|
|
131
|
+
previous_location_longitude: z.ZodNullable<z.ZodNumber>;
|
|
132
|
+
location_address: z.ZodNullable<z.ZodString>;
|
|
133
|
+
location_state: z.ZodNullable<z.ZodString>;
|
|
134
|
+
vehicle_odometer_miles: z.ZodNullable<z.ZodNumber>;
|
|
135
|
+
source: z.ZodEnum<{
|
|
136
|
+
eld: "eld";
|
|
137
|
+
manual: "manual";
|
|
138
|
+
}>;
|
|
139
|
+
}, z.core.$strip>>;
|
|
140
|
+
}, z.core.$strip>;
|
|
141
|
+
type ManualBatchEntry = z.infer<typeof ManualBatchEntrySchema>;
|
|
142
|
+
type ManualBatchRequest = z.infer<typeof ManualBatchRequestSchema>;
|
|
143
|
+
type ManualBatchTelemetry = z.infer<typeof ManualBatchTelemetrySchema>;
|
|
144
|
+
type ManualBatchResponse = z.infer<typeof ManualBatchResponseSchema>;
|
|
145
|
+
|
|
146
|
+
declare const GomotiveAuthDataSchema: z.ZodObject<{
|
|
147
|
+
kind: z.ZodLiteral<"gomotive">;
|
|
148
|
+
token: z.ZodString;
|
|
149
|
+
ownerOperator: z.ZodBoolean;
|
|
150
|
+
}, z.core.$strip>;
|
|
151
|
+
type GomotiveAuthData = z.infer<typeof GomotiveAuthDataSchema>;
|
|
152
|
+
declare const VistaAuthDataSchema: z.ZodObject<{
|
|
153
|
+
kind: z.ZodLiteral<"vista">;
|
|
154
|
+
driverId: z.ZodString;
|
|
155
|
+
cookie: z.ZodString;
|
|
156
|
+
}, z.core.$strip>;
|
|
157
|
+
type VistaAuthData = z.infer<typeof VistaAuthDataSchema>;
|
|
158
|
+
declare const MockAuthDataSchema: z.ZodObject<{
|
|
159
|
+
kind: z.ZodLiteral<"mock">;
|
|
160
|
+
cookie: z.ZodString;
|
|
161
|
+
}, z.core.$strip>;
|
|
162
|
+
type MockAuthData = z.infer<typeof MockAuthDataSchema>;
|
|
163
|
+
declare const NoneAuthDataSchema: z.ZodObject<{
|
|
164
|
+
kind: z.ZodLiteral<"none">;
|
|
165
|
+
}, z.core.$strip>;
|
|
166
|
+
type NoneAuthData = z.infer<typeof NoneAuthDataSchema>;
|
|
167
|
+
declare const ProviderAuthDataSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
168
|
+
kind: z.ZodLiteral<"gomotive">;
|
|
169
|
+
token: z.ZodString;
|
|
170
|
+
ownerOperator: z.ZodBoolean;
|
|
171
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
172
|
+
kind: z.ZodLiteral<"vista">;
|
|
173
|
+
driverId: z.ZodString;
|
|
174
|
+
cookie: z.ZodString;
|
|
175
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
176
|
+
kind: z.ZodLiteral<"mock">;
|
|
177
|
+
cookie: z.ZodString;
|
|
178
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
179
|
+
kind: z.ZodLiteral<"none">;
|
|
180
|
+
}, z.core.$strip>], "kind">;
|
|
181
|
+
type ProviderAuthData = z.infer<typeof ProviderAuthDataSchema>;
|
|
182
|
+
/**
|
|
183
|
+
* Serializes ProviderAuthData to a string for storage.
|
|
184
|
+
* Returns null for 'none' kind since there's nothing to cache.
|
|
185
|
+
*/
|
|
186
|
+
declare function serializeAuthData(data: ProviderAuthData): string | null;
|
|
187
|
+
/**
|
|
188
|
+
* Deserializes an auth token string to ProviderAuthData.
|
|
189
|
+
* Handles legacy formats for backward compatibility:
|
|
190
|
+
* - Raw string -> { kind: 'gomotive', token, ownerOperator: false }
|
|
191
|
+
* - JSON with {driverId, cookie} but no kind -> { kind: 'vista', ... }
|
|
192
|
+
*/
|
|
193
|
+
declare function deserializeAuthData(authToken: string | null): ProviderAuthData;
|
|
194
|
+
|
|
195
|
+
declare const BrowserAuthRequestSchema: z.ZodObject<{
|
|
196
|
+
providerStub: z.ZodString;
|
|
197
|
+
providerUrl: z.ZodString;
|
|
198
|
+
username: z.ZodString;
|
|
199
|
+
encryptedPassword: z.ZodString;
|
|
200
|
+
}, z.core.$strip>;
|
|
201
|
+
type BrowserAuthRequest = z.infer<typeof BrowserAuthRequestSchema>;
|
|
202
|
+
declare const BrowserAuthSuccessSchema: z.ZodObject<{
|
|
203
|
+
success: z.ZodLiteral<true>;
|
|
204
|
+
authData: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
205
|
+
kind: z.ZodLiteral<"gomotive">;
|
|
206
|
+
token: z.ZodString;
|
|
207
|
+
ownerOperator: z.ZodBoolean;
|
|
208
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
209
|
+
kind: z.ZodLiteral<"vista">;
|
|
210
|
+
driverId: z.ZodString;
|
|
211
|
+
cookie: z.ZodString;
|
|
212
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
213
|
+
kind: z.ZodLiteral<"mock">;
|
|
214
|
+
cookie: z.ZodString;
|
|
215
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
216
|
+
kind: z.ZodLiteral<"none">;
|
|
217
|
+
}, z.core.$strip>], "kind">;
|
|
218
|
+
}, z.core.$strip>;
|
|
219
|
+
declare const BrowserAuthFailureSchema: z.ZodObject<{
|
|
220
|
+
success: z.ZodLiteral<false>;
|
|
221
|
+
error: z.ZodString;
|
|
222
|
+
}, z.core.$strip>;
|
|
223
|
+
declare const BrowserAuthResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
224
|
+
success: z.ZodLiteral<true>;
|
|
225
|
+
authData: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
226
|
+
kind: z.ZodLiteral<"gomotive">;
|
|
227
|
+
token: z.ZodString;
|
|
228
|
+
ownerOperator: z.ZodBoolean;
|
|
229
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
230
|
+
kind: z.ZodLiteral<"vista">;
|
|
231
|
+
driverId: z.ZodString;
|
|
232
|
+
cookie: z.ZodString;
|
|
233
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
234
|
+
kind: z.ZodLiteral<"mock">;
|
|
235
|
+
cookie: z.ZodString;
|
|
236
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
237
|
+
kind: z.ZodLiteral<"none">;
|
|
238
|
+
}, z.core.$strip>], "kind">;
|
|
239
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
240
|
+
success: z.ZodLiteral<false>;
|
|
241
|
+
error: z.ZodString;
|
|
242
|
+
}, z.core.$strip>], "success">;
|
|
243
|
+
type BrowserAuthResponse = z.infer<typeof BrowserAuthResponseSchema>;
|
|
244
|
+
declare const CrawlPageSchema: z.ZodObject<{
|
|
245
|
+
url: z.ZodString;
|
|
246
|
+
html: z.ZodString;
|
|
247
|
+
}, z.core.$strip>;
|
|
248
|
+
declare const BrowserCrawlSuccessSchema: z.ZodObject<{
|
|
249
|
+
success: z.ZodLiteral<true>;
|
|
250
|
+
pages: z.ZodArray<z.ZodObject<{
|
|
251
|
+
url: z.ZodString;
|
|
252
|
+
html: z.ZodString;
|
|
253
|
+
}, z.core.$strip>>;
|
|
254
|
+
}, z.core.$strip>;
|
|
255
|
+
declare const BrowserCrawlFailureSchema: z.ZodObject<{
|
|
256
|
+
success: z.ZodLiteral<false>;
|
|
257
|
+
error: z.ZodString;
|
|
258
|
+
}, z.core.$strip>;
|
|
259
|
+
declare const BrowserCrawlResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
260
|
+
success: z.ZodLiteral<true>;
|
|
261
|
+
pages: z.ZodArray<z.ZodObject<{
|
|
262
|
+
url: z.ZodString;
|
|
263
|
+
html: z.ZodString;
|
|
264
|
+
}, z.core.$strip>>;
|
|
265
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
266
|
+
success: z.ZodLiteral<false>;
|
|
267
|
+
error: z.ZodString;
|
|
268
|
+
}, z.core.$strip>], "success">;
|
|
269
|
+
type BrowserCrawlResponse = z.infer<typeof BrowserCrawlResponseSchema>;
|
|
270
|
+
|
|
271
|
+
export { BrowserAuthFailureSchema, type BrowserAuthRequest, BrowserAuthRequestSchema, type BrowserAuthResponse, BrowserAuthResponseSchema, BrowserAuthSuccessSchema, BrowserCrawlFailureSchema, type BrowserCrawlResponse, BrowserCrawlResponseSchema, BrowserCrawlSuccessSchema, CrawlPageSchema, type DeleteProviderAccountRequest, type DeleteProviderAccountRequestData, DeleteProviderAccountRequestSchema, type DeleteProviderAccountResponse, type DeleteProviderAccountResponseData, DeleteProviderAccountResponseSchema, type DriverRanking, type DriverRankingData, DriverRankingSchema, type DriverRankingsRequest, type DriverRankingsRequestData, DriverRankingsRequestSchema, type DriverRankingsResponse, type DriverRankingsResponseData, DriverRankingsResponseSchema, type GomotiveAuthData, GomotiveAuthDataSchema, type ManualBatchEntry, ManualBatchEntrySchema, type ManualBatchRequest, ManualBatchRequestSchema, type ManualBatchResponse, ManualBatchResponseSchema, type ManualBatchTelemetry, ManualBatchTelemetrySchema, type MockAuthData, MockAuthDataSchema, type NoneAuthData, NoneAuthDataSchema, type ProviderAuthData, ProviderAuthDataSchema, type StateHeatmapEntry, type StateHeatmapEntryData, StateHeatmapEntrySchema, type StateHeatmapRequest, type StateHeatmapRequestData, StateHeatmapRequestSchema, type StateHeatmapResponse, type StateHeatmapResponseData, StateHeatmapResponseSchema, type VistaAuthData, VistaAuthDataSchema, deserializeAuthData, serializeAuthData };
|
package/dist/index.js
CHANGED
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
UpdateScrapeStatusMessage,
|
|
17
17
|
ValidatePasswordRequestSchema,
|
|
18
18
|
ValidatePasswordResponseSchema
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-S53TIE72.js";
|
|
20
20
|
|
|
21
21
|
// src/schemas/providerAccounts/delete-provider-account.ts
|
|
22
22
|
import { z } from "zod";
|
|
@@ -57,17 +57,166 @@ var StateHeatmapResponseSchema = z3.record(
|
|
|
57
57
|
z3.string().length(2),
|
|
58
58
|
StateHeatmapEntrySchema
|
|
59
59
|
).describe("Record of 2-letter state codes to heatmap entries");
|
|
60
|
+
|
|
61
|
+
// src/schemas/telemetry/manual-batch.ts
|
|
62
|
+
import { z as z4 } from "zod";
|
|
63
|
+
var ManualBatchEntrySchema = z4.object({
|
|
64
|
+
driver_id: z4.string().uuid().describe("Internal UUID of the driver"),
|
|
65
|
+
timestamp: z4.string().datetime().describe("Timestamp of the GPS reading (ISO 8601 format)"),
|
|
66
|
+
location_latitude: z4.number().min(-90).max(90).describe("GPS latitude coordinate"),
|
|
67
|
+
location_longitude: z4.number().min(-180).max(180).describe("GPS longitude coordinate"),
|
|
68
|
+
location_address: z4.string().optional().describe("Optional human-readable address"),
|
|
69
|
+
vehicle_odometer_miles: z4.number().min(0).optional().describe("Optional vehicle odometer reading in miles")
|
|
70
|
+
}).describe("Single manual telemetry entry");
|
|
71
|
+
var ManualBatchRequestSchema = z4.object({
|
|
72
|
+
entries: z4.array(ManualBatchEntrySchema).min(1).max(1e3).describe("Array of manual telemetry entries (1-1000)")
|
|
73
|
+
}).describe("Request schema for manual batch telemetry insertion");
|
|
74
|
+
var ManualBatchTelemetrySchema = z4.object({
|
|
75
|
+
id: z4.number().int().describe("Telemetry record ID"),
|
|
76
|
+
driver_id: z4.string().uuid().describe("Internal UUID of the driver"),
|
|
77
|
+
timestamp: z4.union([z4.string(), z4.date()]).describe("Timestamp of the telemetry reading"),
|
|
78
|
+
remaining_drive_time_in_seconds: z4.number().min(0),
|
|
79
|
+
remaining_shift_time_in_seconds: z4.number().min(0),
|
|
80
|
+
remaining_cycle_time_in_seconds: z4.number().min(0),
|
|
81
|
+
remaining_break_time_in_seconds: z4.number().min(0),
|
|
82
|
+
location_latitude: z4.number().min(-90).max(90),
|
|
83
|
+
location_longitude: z4.number().min(-180).max(180),
|
|
84
|
+
previous_location_latitude: z4.number().min(-90).max(90).nullable(),
|
|
85
|
+
previous_location_longitude: z4.number().min(-180).max(180).nullable(),
|
|
86
|
+
location_address: z4.string().nullable(),
|
|
87
|
+
location_state: z4.string().length(2).nullable(),
|
|
88
|
+
vehicle_odometer_miles: z4.number().min(0).nullable(),
|
|
89
|
+
source: z4.enum(["eld", "manual"])
|
|
90
|
+
}).describe("Telemetry record returned from manual batch insertion");
|
|
91
|
+
var ManualBatchResponseSchema = z4.object({
|
|
92
|
+
message: z4.string().describe("Success message"),
|
|
93
|
+
inserted_count: z4.number().int().min(0).describe("Number of telemetry entries inserted"),
|
|
94
|
+
telemetry: z4.array(ManualBatchTelemetrySchema).describe("Array of inserted telemetry records")
|
|
95
|
+
}).describe("Response schema for manual batch telemetry insertion");
|
|
96
|
+
|
|
97
|
+
// src/auth-data.ts
|
|
98
|
+
import { z as z5 } from "zod";
|
|
99
|
+
var GomotiveAuthDataSchema = z5.object({
|
|
100
|
+
kind: z5.literal("gomotive"),
|
|
101
|
+
token: z5.string(),
|
|
102
|
+
ownerOperator: z5.boolean()
|
|
103
|
+
});
|
|
104
|
+
var VistaAuthDataSchema = z5.object({
|
|
105
|
+
kind: z5.literal("vista"),
|
|
106
|
+
driverId: z5.string(),
|
|
107
|
+
cookie: z5.string()
|
|
108
|
+
});
|
|
109
|
+
var MockAuthDataSchema = z5.object({
|
|
110
|
+
kind: z5.literal("mock"),
|
|
111
|
+
cookie: z5.string()
|
|
112
|
+
});
|
|
113
|
+
var NoneAuthDataSchema = z5.object({
|
|
114
|
+
kind: z5.literal("none")
|
|
115
|
+
});
|
|
116
|
+
var ProviderAuthDataSchema = z5.discriminatedUnion("kind", [
|
|
117
|
+
GomotiveAuthDataSchema,
|
|
118
|
+
VistaAuthDataSchema,
|
|
119
|
+
MockAuthDataSchema,
|
|
120
|
+
NoneAuthDataSchema
|
|
121
|
+
]);
|
|
122
|
+
var LegacyVistaAuthSchema = z5.object({
|
|
123
|
+
driverId: z5.string(),
|
|
124
|
+
cookie: z5.string()
|
|
125
|
+
});
|
|
126
|
+
function serializeAuthData(data) {
|
|
127
|
+
if (data.kind === "none") {
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
return JSON.stringify(data);
|
|
131
|
+
}
|
|
132
|
+
function deserializeAuthData(authToken) {
|
|
133
|
+
if (!authToken) {
|
|
134
|
+
return { kind: "none" };
|
|
135
|
+
}
|
|
136
|
+
try {
|
|
137
|
+
const parsed = JSON.parse(authToken);
|
|
138
|
+
const newFormatResult = ProviderAuthDataSchema.safeParse(parsed);
|
|
139
|
+
if (newFormatResult.success) {
|
|
140
|
+
return newFormatResult.data;
|
|
141
|
+
}
|
|
142
|
+
const legacyVistaResult = LegacyVistaAuthSchema.safeParse(parsed);
|
|
143
|
+
if (legacyVistaResult.success) {
|
|
144
|
+
return {
|
|
145
|
+
kind: "vista",
|
|
146
|
+
driverId: legacyVistaResult.data.driverId,
|
|
147
|
+
cookie: legacyVistaResult.data.cookie
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
} catch {
|
|
151
|
+
}
|
|
152
|
+
return {
|
|
153
|
+
kind: "gomotive",
|
|
154
|
+
token: authToken,
|
|
155
|
+
ownerOperator: false
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// src/browser-auth.ts
|
|
160
|
+
import { z as z6 } from "zod";
|
|
161
|
+
var BrowserAuthRequestSchema = z6.object({
|
|
162
|
+
providerStub: z6.string(),
|
|
163
|
+
providerUrl: z6.string(),
|
|
164
|
+
username: z6.string(),
|
|
165
|
+
encryptedPassword: z6.string()
|
|
166
|
+
});
|
|
167
|
+
var BrowserAuthSuccessSchema = z6.object({
|
|
168
|
+
success: z6.literal(true),
|
|
169
|
+
authData: ProviderAuthDataSchema
|
|
170
|
+
});
|
|
171
|
+
var BrowserAuthFailureSchema = z6.object({
|
|
172
|
+
success: z6.literal(false),
|
|
173
|
+
error: z6.string()
|
|
174
|
+
});
|
|
175
|
+
var BrowserAuthResponseSchema = z6.discriminatedUnion("success", [
|
|
176
|
+
BrowserAuthSuccessSchema,
|
|
177
|
+
BrowserAuthFailureSchema
|
|
178
|
+
]);
|
|
179
|
+
var CrawlPageSchema = z6.object({
|
|
180
|
+
url: z6.string(),
|
|
181
|
+
html: z6.string()
|
|
182
|
+
});
|
|
183
|
+
var BrowserCrawlSuccessSchema = z6.object({
|
|
184
|
+
success: z6.literal(true),
|
|
185
|
+
pages: z6.array(CrawlPageSchema)
|
|
186
|
+
});
|
|
187
|
+
var BrowserCrawlFailureSchema = z6.object({
|
|
188
|
+
success: z6.literal(false),
|
|
189
|
+
error: z6.string()
|
|
190
|
+
});
|
|
191
|
+
var BrowserCrawlResponseSchema = z6.discriminatedUnion("success", [
|
|
192
|
+
BrowserCrawlSuccessSchema,
|
|
193
|
+
BrowserCrawlFailureSchema
|
|
194
|
+
]);
|
|
60
195
|
export {
|
|
61
196
|
BatchConvexUpdate,
|
|
62
197
|
BatchConvexUpdateSchema,
|
|
198
|
+
BrowserAuthFailureSchema,
|
|
199
|
+
BrowserAuthRequestSchema,
|
|
200
|
+
BrowserAuthResponseSchema,
|
|
201
|
+
BrowserAuthSuccessSchema,
|
|
202
|
+
BrowserCrawlFailureSchema,
|
|
203
|
+
BrowserCrawlResponseSchema,
|
|
204
|
+
BrowserCrawlSuccessSchema,
|
|
63
205
|
ConvexDriverSchema,
|
|
64
206
|
ConvexUpdate,
|
|
65
207
|
ConvexUpdateSchema,
|
|
208
|
+
CrawlPageSchema,
|
|
66
209
|
DeleteProviderAccountRequestSchema,
|
|
67
210
|
DeleteProviderAccountResponseSchema,
|
|
68
211
|
DriverRankingSchema,
|
|
69
212
|
DriverRankingsRequestSchema,
|
|
70
213
|
DriverRankingsResponseSchema,
|
|
214
|
+
GomotiveAuthDataSchema,
|
|
215
|
+
ManualBatchEntrySchema,
|
|
216
|
+
ManualBatchRequestSchema,
|
|
217
|
+
ManualBatchResponseSchema,
|
|
218
|
+
ManualBatchTelemetrySchema,
|
|
219
|
+
MockAuthDataSchema,
|
|
71
220
|
NewLoginRequest,
|
|
72
221
|
NewLoginRequestSchema,
|
|
73
222
|
NewLoginResponse,
|
|
@@ -76,11 +225,16 @@ export {
|
|
|
76
225
|
NewLoginResponseSchema,
|
|
77
226
|
NewLoginResponseSuccess,
|
|
78
227
|
NewLoginResponseSuccessSchema,
|
|
228
|
+
NoneAuthDataSchema,
|
|
229
|
+
ProviderAuthDataSchema,
|
|
79
230
|
ScrapeStatus,
|
|
80
231
|
StateHeatmapEntrySchema,
|
|
81
232
|
StateHeatmapRequestSchema,
|
|
82
233
|
StateHeatmapResponseSchema,
|
|
83
234
|
UpdateScrapeStatusMessage,
|
|
84
235
|
ValidatePasswordRequestSchema,
|
|
85
|
-
ValidatePasswordResponseSchema
|
|
236
|
+
ValidatePasswordResponseSchema,
|
|
237
|
+
VistaAuthDataSchema,
|
|
238
|
+
deserializeAuthData,
|
|
239
|
+
serializeAuthData
|
|
86
240
|
};
|