@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/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-S53TIE72.js";
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/auth-data.ts
135
+ // src/schemas/trips/driver-trips.ts
127
136
  import { z as z6 } from "zod";
128
- var GomotiveAuthDataSchema = z6.object({
129
- kind: z6.literal("gomotive"),
130
- token: z6.string(),
131
- ownerOperator: z6.boolean()
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 VistaAuthDataSchema = z6.object({
134
- kind: z6.literal("vista"),
135
- driverId: z6.string(),
136
- cookie: z6.string()
180
+ var EnrichedStopSchema = z7.object({
181
+ duration_seconds: z7.number()
137
182
  });
138
- var MockAuthDataSchema = z6.object({
139
- kind: z6.literal("mock"),
140
- cookie: z6.string()
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 NoneAuthDataSchema = z6.object({
143
- kind: z6.literal("none")
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 ProviderAuthDataSchema = z6.discriminatedUnion("kind", [
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 = z6.object({
152
- driverId: z6.string(),
153
- cookie: z6.string()
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 z7 } from "zod";
190
- var CapturedTrafficEntrySchema = z7.object({
191
- method: z7.string(),
192
- url: z7.string(),
193
- status: z7.number(),
194
- responseBody: z7.string().optional()
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 = z7.object({
197
- providerStub: z7.string(),
198
- providerUrl: z7.string(),
199
- username: z7.string(),
200
- encryptedPassword: z7.string(),
201
- captureTraffic: z7.boolean().optional()
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 = z7.object({
204
- success: z7.literal(true),
283
+ var BrowserAuthSuccessSchema = z9.object({
284
+ success: z9.literal(true),
205
285
  authData: ProviderAuthDataSchema,
206
- capturedTraffic: z7.array(CapturedTrafficEntrySchema).optional()
286
+ capturedTraffic: z9.array(CapturedTrafficEntrySchema).optional()
207
287
  });
208
- var BrowserAuthFailureSchema = z7.object({
209
- success: z7.literal(false),
210
- error: z7.string()
288
+ var BrowserAuthFailureSchema = z9.object({
289
+ success: z9.literal(false),
290
+ error: z9.string()
211
291
  });
212
- var BrowserAuthResponseSchema = z7.discriminatedUnion("success", [
292
+ var BrowserAuthResponseSchema = z9.discriminatedUnion("success", [
213
293
  BrowserAuthSuccessSchema,
214
294
  BrowserAuthFailureSchema
215
295
  ]);
216
- var CrawlPageSchema = z7.object({
217
- url: z7.string(),
218
- html: z7.string()
296
+ var CrawlPageSchema = z9.object({
297
+ url: z9.string(),
298
+ html: z9.string()
219
299
  });
220
- var BrowserCrawlSuccessSchema = z7.object({
221
- success: z7.literal(true),
222
- pages: z7.array(CrawlPageSchema)
300
+ var BrowserCrawlSuccessSchema = z9.object({
301
+ success: z9.literal(true),
302
+ pages: z9.array(CrawlPageSchema)
223
303
  });
224
- var BrowserCrawlFailureSchema = z7.object({
225
- success: z7.literal(false),
226
- error: z7.string()
304
+ var BrowserCrawlFailureSchema = z9.object({
305
+ success: z9.literal(false),
306
+ error: z9.string()
227
307
  });
228
- var BrowserCrawlResponseSchema = z7.discriminatedUnion("success", [
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@findatruck/shared-schemas",
3
- "version": "2.16.0",
3
+ "version": "2.18.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",