@findatruck/shared-schemas 2.16.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 +318 -130
- package/dist/index.d.cts +172 -2
- package/dist/index.d.ts +172 -2
- package/dist/index.js +149 -50
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4,6 +4,8 @@ import {
|
|
|
4
4
|
ConvexDriverSchema,
|
|
5
5
|
ConvexUpdate,
|
|
6
6
|
ConvexUpdateSchema,
|
|
7
|
+
DRIVER_NAME_FORBIDDEN_CHAR_PATTERN,
|
|
8
|
+
DriverNameSchema,
|
|
7
9
|
NewLoginRequest,
|
|
8
10
|
NewLoginRequestSchema,
|
|
9
11
|
NewLoginResponse,
|
|
@@ -12,11 +14,16 @@ import {
|
|
|
12
14
|
NewLoginResponseSchema,
|
|
13
15
|
NewLoginResponseSuccess,
|
|
14
16
|
NewLoginResponseSuccessSchema,
|
|
17
|
+
PATCH_DRIVER_NAME_MAX_LENGTH,
|
|
18
|
+
PatchDriverDriverResponseSchema,
|
|
19
|
+
PatchDriverRequestSchema,
|
|
20
|
+
PatchDriverResponseSchema,
|
|
15
21
|
ScrapeStatus,
|
|
22
|
+
SharedDriverResponseSchema,
|
|
16
23
|
UpdateScrapeStatusMessage,
|
|
17
24
|
ValidatePasswordRequestSchema,
|
|
18
25
|
ValidatePasswordResponseSchema
|
|
19
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-BXCWZMK7.js";
|
|
20
27
|
|
|
21
28
|
// src/schemas/drivers/anonymous-driver.ts
|
|
22
29
|
import z from "zod";
|
|
@@ -91,7 +98,8 @@ var ManualBatchEntrySchema = z5.object({
|
|
|
91
98
|
heading: z5.number().min(0).max(360).optional().describe("Optional GPS heading in degrees (0-360)"),
|
|
92
99
|
speed_mph: z5.number().min(0).optional().describe("Optional GPS speed in miles per hour"),
|
|
93
100
|
altitude_feet: z5.number().optional().describe("Optional GPS altitude in feet"),
|
|
94
|
-
raw: z5.record(z5.string(), z5.unknown()).optional().describe("Optional raw upstream JSON payload to archive alongside this entry")
|
|
101
|
+
raw: z5.record(z5.string(), z5.unknown()).optional().describe("Optional raw upstream JSON payload to archive alongside this entry"),
|
|
102
|
+
driving_status: z5.enum(["parked", "driving"]).optional().describe("Optional parked/driving status reported by the upstream system")
|
|
95
103
|
}).describe("Single manual telemetry entry");
|
|
96
104
|
var ManualBatchRequestSchema = z5.object({
|
|
97
105
|
entries: z5.array(ManualBatchEntrySchema).min(1).max(1e3).describe("Array of manual telemetry entries (1-1000)")
|
|
@@ -115,7 +123,8 @@ var ManualBatchTelemetrySchema = z5.object({
|
|
|
115
123
|
heading: z5.number().nullish(),
|
|
116
124
|
speed_mph: z5.number().nullish(),
|
|
117
125
|
altitude_feet: z5.number().nullish(),
|
|
118
|
-
source: z5.enum(["eld", "manual"])
|
|
126
|
+
source: z5.enum(["eld", "manual"]),
|
|
127
|
+
driving_status: z5.enum(["parked", "driving"]).nullable()
|
|
119
128
|
}).describe("Telemetry record returned from manual batch insertion");
|
|
120
129
|
var ManualBatchResponseSchema = z5.object({
|
|
121
130
|
message: z5.string().describe("Success message"),
|
|
@@ -123,34 +132,105 @@ var ManualBatchResponseSchema = z5.object({
|
|
|
123
132
|
telemetry: z5.array(ManualBatchTelemetrySchema).describe("Array of inserted telemetry records")
|
|
124
133
|
}).describe("Response schema for manual batch telemetry insertion");
|
|
125
134
|
|
|
126
|
-
// src/
|
|
135
|
+
// src/schemas/trips/driver-trips.ts
|
|
127
136
|
import { z as z6 } from "zod";
|
|
128
|
-
var
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
137
|
+
var DriverTripsRequestSchema = z6.object({
|
|
138
|
+
driver_id: z6.string().uuid(),
|
|
139
|
+
start_date: z6.string(),
|
|
140
|
+
// YYYY-MM-DD
|
|
141
|
+
end_date: z6.string()
|
|
142
|
+
// YYYY-MM-DD
|
|
143
|
+
});
|
|
144
|
+
var DriverTripSchema = z6.object({
|
|
145
|
+
id: z6.number(),
|
|
146
|
+
start_time: z6.string(),
|
|
147
|
+
end_time: z6.string(),
|
|
148
|
+
point_count: z6.number(),
|
|
149
|
+
polyline: z6.string().nullable(),
|
|
150
|
+
highways: z6.array(z6.string()).nullable(),
|
|
151
|
+
total_miles: z6.number().nullable(),
|
|
152
|
+
avg_speed_mph: z6.number().nullable(),
|
|
153
|
+
miles_by_weather: z6.record(z6.string(), z6.number()).nullable(),
|
|
154
|
+
miles_by_light: z6.record(z6.string(), z6.number()).nullable()
|
|
155
|
+
});
|
|
156
|
+
var DriverTripsResponseSchema = z6.array(DriverTripSchema);
|
|
157
|
+
var DriverDailySummarySchema = z6.object({
|
|
158
|
+
summary_date: z6.string(),
|
|
159
|
+
total_miles: z6.number(),
|
|
160
|
+
trip_count: z6.number(),
|
|
161
|
+
point_count: z6.number(),
|
|
162
|
+
polyline: z6.string().nullable(),
|
|
163
|
+
highways: z6.array(z6.string()).nullable(),
|
|
164
|
+
avg_speed_mph: z6.number().nullable(),
|
|
165
|
+
miles_by_weather: z6.record(z6.string(), z6.number()).nullable(),
|
|
166
|
+
miles_by_light: z6.record(z6.string(), z6.number()).nullable()
|
|
167
|
+
});
|
|
168
|
+
var DriverDailySummariesResponseSchema = z6.array(DriverDailySummarySchema);
|
|
169
|
+
|
|
170
|
+
// src/schemas/trips/enriched-trip-summary.ts
|
|
171
|
+
import { z as z7 } from "zod";
|
|
172
|
+
var EnrichedTripSummaryRequestSchema = z7.object({
|
|
173
|
+
trip_id: z7.number()
|
|
174
|
+
});
|
|
175
|
+
var DriverEnrichedSummariesRequestSchema = z7.object({
|
|
176
|
+
driver_id: z7.string().uuid(),
|
|
177
|
+
start_date: z7.string(),
|
|
178
|
+
end_date: z7.string()
|
|
132
179
|
});
|
|
133
|
-
var
|
|
134
|
-
|
|
135
|
-
driverId: z6.string(),
|
|
136
|
-
cookie: z6.string()
|
|
180
|
+
var EnrichedStopSchema = z7.object({
|
|
181
|
+
duration_seconds: z7.number()
|
|
137
182
|
});
|
|
138
|
-
var
|
|
139
|
-
|
|
140
|
-
|
|
183
|
+
var EnrichedPointSchema = z7.object({
|
|
184
|
+
lat: z7.number(),
|
|
185
|
+
lon: z7.number(),
|
|
186
|
+
timestamp: z7.string(),
|
|
187
|
+
speed_mph: z7.number().nullable(),
|
|
188
|
+
heading: z7.number().nullable(),
|
|
189
|
+
altitude_feet: z7.number().nullable(),
|
|
190
|
+
weather_condition: z7.string().nullable(),
|
|
191
|
+
temperature_f: z7.number().nullable(),
|
|
192
|
+
visibility_miles: z7.number().nullable(),
|
|
193
|
+
light_condition: z7.string().nullable(),
|
|
194
|
+
stop: EnrichedStopSchema.nullable()
|
|
141
195
|
});
|
|
142
|
-
var
|
|
143
|
-
|
|
196
|
+
var EnrichedTripSummarySchema = z7.object({
|
|
197
|
+
trip_id: z7.number(),
|
|
198
|
+
driver_id: z7.string(),
|
|
199
|
+
start_time: z7.string(),
|
|
200
|
+
end_time: z7.string(),
|
|
201
|
+
points: z7.array(EnrichedPointSchema)
|
|
144
202
|
});
|
|
145
|
-
var
|
|
203
|
+
var EnrichedTripSummaryResponseSchema = EnrichedTripSummarySchema;
|
|
204
|
+
var DriverEnrichedSummariesResponseSchema = z7.array(EnrichedTripSummarySchema);
|
|
205
|
+
|
|
206
|
+
// src/auth-data.ts
|
|
207
|
+
import { z as z8 } from "zod";
|
|
208
|
+
var GomotiveAuthDataSchema = z8.object({
|
|
209
|
+
kind: z8.literal("gomotive"),
|
|
210
|
+
token: z8.string(),
|
|
211
|
+
ownerOperator: z8.boolean()
|
|
212
|
+
});
|
|
213
|
+
var VistaAuthDataSchema = z8.object({
|
|
214
|
+
kind: z8.literal("vista"),
|
|
215
|
+
driverId: z8.string(),
|
|
216
|
+
cookie: z8.string()
|
|
217
|
+
});
|
|
218
|
+
var MockAuthDataSchema = z8.object({
|
|
219
|
+
kind: z8.literal("mock"),
|
|
220
|
+
cookie: z8.string()
|
|
221
|
+
});
|
|
222
|
+
var NoneAuthDataSchema = z8.object({
|
|
223
|
+
kind: z8.literal("none")
|
|
224
|
+
});
|
|
225
|
+
var ProviderAuthDataSchema = z8.discriminatedUnion("kind", [
|
|
146
226
|
GomotiveAuthDataSchema,
|
|
147
227
|
VistaAuthDataSchema,
|
|
148
228
|
MockAuthDataSchema,
|
|
149
229
|
NoneAuthDataSchema
|
|
150
230
|
]);
|
|
151
|
-
var LegacyVistaAuthSchema =
|
|
152
|
-
driverId:
|
|
153
|
-
cookie:
|
|
231
|
+
var LegacyVistaAuthSchema = z8.object({
|
|
232
|
+
driverId: z8.string(),
|
|
233
|
+
cookie: z8.string()
|
|
154
234
|
});
|
|
155
235
|
function serializeAuthData(data) {
|
|
156
236
|
if (data.kind === "none") {
|
|
@@ -186,46 +266,46 @@ function deserializeAuthData(authToken) {
|
|
|
186
266
|
}
|
|
187
267
|
|
|
188
268
|
// src/browser-auth.ts
|
|
189
|
-
import { z as
|
|
190
|
-
var CapturedTrafficEntrySchema =
|
|
191
|
-
method:
|
|
192
|
-
url:
|
|
193
|
-
status:
|
|
194
|
-
responseBody:
|
|
269
|
+
import { z as z9 } from "zod";
|
|
270
|
+
var CapturedTrafficEntrySchema = z9.object({
|
|
271
|
+
method: z9.string(),
|
|
272
|
+
url: z9.string(),
|
|
273
|
+
status: z9.number(),
|
|
274
|
+
responseBody: z9.string().optional()
|
|
195
275
|
});
|
|
196
|
-
var BrowserAuthRequestSchema =
|
|
197
|
-
providerStub:
|
|
198
|
-
providerUrl:
|
|
199
|
-
username:
|
|
200
|
-
encryptedPassword:
|
|
201
|
-
captureTraffic:
|
|
276
|
+
var BrowserAuthRequestSchema = z9.object({
|
|
277
|
+
providerStub: z9.string(),
|
|
278
|
+
providerUrl: z9.string(),
|
|
279
|
+
username: z9.string(),
|
|
280
|
+
encryptedPassword: z9.string(),
|
|
281
|
+
captureTraffic: z9.boolean().optional()
|
|
202
282
|
});
|
|
203
|
-
var BrowserAuthSuccessSchema =
|
|
204
|
-
success:
|
|
283
|
+
var BrowserAuthSuccessSchema = z9.object({
|
|
284
|
+
success: z9.literal(true),
|
|
205
285
|
authData: ProviderAuthDataSchema,
|
|
206
|
-
capturedTraffic:
|
|
286
|
+
capturedTraffic: z9.array(CapturedTrafficEntrySchema).optional()
|
|
207
287
|
});
|
|
208
|
-
var BrowserAuthFailureSchema =
|
|
209
|
-
success:
|
|
210
|
-
error:
|
|
288
|
+
var BrowserAuthFailureSchema = z9.object({
|
|
289
|
+
success: z9.literal(false),
|
|
290
|
+
error: z9.string()
|
|
211
291
|
});
|
|
212
|
-
var BrowserAuthResponseSchema =
|
|
292
|
+
var BrowserAuthResponseSchema = z9.discriminatedUnion("success", [
|
|
213
293
|
BrowserAuthSuccessSchema,
|
|
214
294
|
BrowserAuthFailureSchema
|
|
215
295
|
]);
|
|
216
|
-
var CrawlPageSchema =
|
|
217
|
-
url:
|
|
218
|
-
html:
|
|
296
|
+
var CrawlPageSchema = z9.object({
|
|
297
|
+
url: z9.string(),
|
|
298
|
+
html: z9.string()
|
|
219
299
|
});
|
|
220
|
-
var BrowserCrawlSuccessSchema =
|
|
221
|
-
success:
|
|
222
|
-
pages:
|
|
300
|
+
var BrowserCrawlSuccessSchema = z9.object({
|
|
301
|
+
success: z9.literal(true),
|
|
302
|
+
pages: z9.array(CrawlPageSchema)
|
|
223
303
|
});
|
|
224
|
-
var BrowserCrawlFailureSchema =
|
|
225
|
-
success:
|
|
226
|
-
error:
|
|
304
|
+
var BrowserCrawlFailureSchema = z9.object({
|
|
305
|
+
success: z9.literal(false),
|
|
306
|
+
error: z9.string()
|
|
227
307
|
});
|
|
228
|
-
var BrowserCrawlResponseSchema =
|
|
308
|
+
var BrowserCrawlResponseSchema = z9.discriminatedUnion("success", [
|
|
229
309
|
BrowserCrawlSuccessSchema,
|
|
230
310
|
BrowserCrawlFailureSchema
|
|
231
311
|
]);
|
|
@@ -247,13 +327,27 @@ export {
|
|
|
247
327
|
ConvexUpdateSchema,
|
|
248
328
|
CrawlPageSchema,
|
|
249
329
|
CreateAnonymousDriverBodySchema,
|
|
330
|
+
DRIVER_NAME_FORBIDDEN_CHAR_PATTERN,
|
|
250
331
|
DeleteAnonymousDriverParamsSchema,
|
|
251
332
|
DeleteAnonymousDriverResponseSchema,
|
|
252
333
|
DeleteProviderAccountRequestSchema,
|
|
253
334
|
DeleteProviderAccountResponseSchema,
|
|
335
|
+
DriverDailySummariesResponseSchema,
|
|
336
|
+
DriverDailySummarySchema,
|
|
337
|
+
DriverEnrichedSummariesRequestSchema,
|
|
338
|
+
DriverEnrichedSummariesResponseSchema,
|
|
339
|
+
DriverNameSchema,
|
|
254
340
|
DriverRankingSchema,
|
|
255
341
|
DriverRankingsRequestSchema,
|
|
256
342
|
DriverRankingsResponseSchema,
|
|
343
|
+
DriverTripSchema,
|
|
344
|
+
DriverTripsRequestSchema,
|
|
345
|
+
DriverTripsResponseSchema,
|
|
346
|
+
EnrichedPointSchema,
|
|
347
|
+
EnrichedStopSchema,
|
|
348
|
+
EnrichedTripSummaryRequestSchema,
|
|
349
|
+
EnrichedTripSummaryResponseSchema,
|
|
350
|
+
EnrichedTripSummarySchema,
|
|
257
351
|
GomotiveAuthDataSchema,
|
|
258
352
|
ManualBatchEntrySchema,
|
|
259
353
|
ManualBatchRequestSchema,
|
|
@@ -269,8 +363,13 @@ export {
|
|
|
269
363
|
NewLoginResponseSuccess,
|
|
270
364
|
NewLoginResponseSuccessSchema,
|
|
271
365
|
NoneAuthDataSchema,
|
|
366
|
+
PATCH_DRIVER_NAME_MAX_LENGTH,
|
|
367
|
+
PatchDriverDriverResponseSchema,
|
|
368
|
+
PatchDriverRequestSchema,
|
|
369
|
+
PatchDriverResponseSchema,
|
|
272
370
|
ProviderAuthDataSchema,
|
|
273
371
|
ScrapeStatus,
|
|
372
|
+
SharedDriverResponseSchema,
|
|
274
373
|
StateHeatmapEntrySchema,
|
|
275
374
|
StateHeatmapRequestSchema,
|
|
276
375
|
StateHeatmapResponseSchema,
|