@findatruck/shared-schemas 2.19.0 → 2.23.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 CHANGED
@@ -37,6 +37,8 @@ __export(browser_exports, {
37
37
  ConvexUpdateSchema: () => ConvexUpdateSchema,
38
38
  DRIVER_NAME_FORBIDDEN_CHAR_PATTERN: () => DRIVER_NAME_FORBIDDEN_CHAR_PATTERN,
39
39
  DriverNameSchema: () => DriverNameSchema,
40
+ ListDriversRequestSchema: () => ListDriversRequestSchema,
41
+ ListDriversResponseSchema: () => ListDriversResponseSchema,
40
42
  NewLoginRequest: () => NewLoginRequest,
41
43
  NewLoginRequestSchema: () => NewLoginRequestSchema,
42
44
  NewLoginResponse: () => NewLoginResponse,
@@ -165,7 +167,7 @@ var SharedDriverResponseSchema = import_zod3.default.object({
165
167
  // because providers emit non-UUID identifiers there.
166
168
  id: import_zod3.default.uuid(),
167
169
  name: import_zod3.default.string(),
168
- eld_external_id: import_zod3.default.string(),
170
+ eld_external_id: import_zod3.default.string().nullable(),
169
171
  license_number: import_zod3.default.string().nullable(),
170
172
  license_state: import_zod3.default.string().nullable(),
171
173
  license_expiration_date: import_zod3.default.string().nullable(),
@@ -174,6 +176,7 @@ var SharedDriverResponseSchema = import_zod3.default.object({
174
176
  created_at: import_zod3.default.union([import_zod3.default.string(), import_zod3.default.date()]),
175
177
  updated_at: import_zod3.default.union([import_zod3.default.string(), import_zod3.default.date()]),
176
178
  truck_type: import_zod3.default.string().nullable(),
179
+ honk_user_id: import_zod3.default.string().nullable(),
177
180
  last_location_latitude: import_zod3.default.number().nullable(),
178
181
  last_location_longitude: import_zod3.default.number().nullable()
179
182
  });
@@ -214,10 +217,14 @@ var DriverNameSchema = import_zod4.default.string().trim().min(1).max(PATCH_DRIV
214
217
  );
215
218
  var TruckTypeSchema = import_zod4.default.string().trim().min(1).max(PATCH_DRIVER_TRUCK_TYPE_MAX_LENGTH);
216
219
  var PatchDriverRequestSchema = import_zod4.default.object({
217
- driver_id: import_zod4.default.uuid(),
220
+ driver_id: import_zod4.default.uuid().optional(),
221
+ honk_user_id: import_zod4.default.string().min(1).max(255).optional(),
218
222
  name: DriverNameSchema.optional(),
219
223
  truck_type: TruckTypeSchema.nullable().optional()
220
224
  }).refine(
225
+ (d) => d.driver_id !== void 0 !== (d.honk_user_id !== void 0),
226
+ { message: "Exactly one of driver_id or honk_user_id must be provided" }
227
+ ).refine(
221
228
  (d) => d.name !== void 0 || d.truck_type !== void 0,
222
229
  { message: "At least one of name or truck_type must be provided" }
223
230
  );
@@ -235,8 +242,17 @@ var PatchDriverResponseSchema = import_zod4.default.object({
235
242
  driver: PatchDriverDriverResponseSchema
236
243
  });
237
244
 
238
- // src/schemas/providerAccounts/update-status.ts
245
+ // src/schemas/drivers/list-drivers.ts
239
246
  var import_zod5 = __toESM(require("zod"), 1);
247
+ var ListDriversRequestSchema = import_zod5.default.object({
248
+ name: import_zod5.default.string().optional()
249
+ });
250
+ var ListDriversResponseSchema = import_zod5.default.object({
251
+ drivers: import_zod5.default.array(SharedDriverResponseSchema)
252
+ });
253
+
254
+ // src/schemas/providerAccounts/update-status.ts
255
+ var import_zod6 = __toESM(require("zod"), 1);
240
256
  var ScrapeStatus = /* @__PURE__ */ ((ScrapeStatus2) => {
241
257
  ScrapeStatus2["NEW_LOGIN_RECEIVED"] = "NEW_LOGIN_RECEIVED";
242
258
  ScrapeStatus2["LOGIN_IN_PROGRESS"] = "LOGIN_IN_PROGRESS";
@@ -249,25 +265,25 @@ var ScrapeStatus = /* @__PURE__ */ ((ScrapeStatus2) => {
249
265
  ScrapeStatus2["DATA_FETCH_FAILED"] = "DATA_FETCH_FAILED";
250
266
  return ScrapeStatus2;
251
267
  })(ScrapeStatus || {});
252
- var UpdateScrapeStatusMessage = import_zod5.default.object({
253
- status: import_zod5.default.nativeEnum(ScrapeStatus).describe("The current status of the scrape process"),
254
- correctPassword: import_zod5.default.boolean().optional().describe("Indicates if the provided password was correct, if applicable"),
255
- externalProviderAccountId: import_zod5.default.string().describe("The external identifier for the provider account (convex ID or similar)"),
256
- username: import_zod5.default.string().describe("The username of the provider account whose status is being updated"),
257
- provider_url: import_zod5.default.string().describe("The URL of the ELD provider"),
258
- driverCount: import_zod5.default.number().optional().describe("The number of drivers associated with the account, if applicable"),
259
- providerSlug: import_zod5.default.string().optional().describe("The slug identifier for the provider")
268
+ var UpdateScrapeStatusMessage = import_zod6.default.object({
269
+ status: import_zod6.default.nativeEnum(ScrapeStatus).describe("The current status of the scrape process"),
270
+ correctPassword: import_zod6.default.boolean().optional().describe("Indicates if the provided password was correct, if applicable"),
271
+ externalProviderAccountId: import_zod6.default.string().describe("The external identifier for the provider account (convex ID or similar)"),
272
+ username: import_zod6.default.string().describe("The username of the provider account whose status is being updated"),
273
+ provider_url: import_zod6.default.string().describe("The URL of the ELD provider"),
274
+ driverCount: import_zod6.default.number().optional().describe("The number of drivers associated with the account, if applicable"),
275
+ providerSlug: import_zod6.default.string().optional().describe("The slug identifier for the provider")
260
276
  }).describe("Schema for update status messages");
261
277
 
262
278
  // src/schemas/providerAccounts/validate-password.ts
263
- var import_zod6 = require("zod");
264
- var ValidatePasswordRequestSchema = import_zod6.z.object({
265
- providerAccountId: import_zod6.z.string().min(1).describe("The unique identifier of the provider account in postgres to validate the password for"),
266
- encryptedPassword: import_zod6.z.string().min(1).describe("The encrypted password to validate against the stored password")
279
+ var import_zod7 = require("zod");
280
+ var ValidatePasswordRequestSchema = import_zod7.z.object({
281
+ providerAccountId: import_zod7.z.string().min(1).describe("The unique identifier of the provider account in postgres to validate the password for"),
282
+ encryptedPassword: import_zod7.z.string().min(1).describe("The encrypted password to validate against the stored password")
267
283
  }).describe("Request schema for validating a provider account password");
268
- var ValidatePasswordResponseSchema = import_zod6.z.object({
269
- isValid: import_zod6.z.boolean().describe("Indicates if the provided password is valid"),
270
- driverIds: import_zod6.z.array(import_zod6.z.string()).describe("List of driver IDs associated with the provider account")
284
+ var ValidatePasswordResponseSchema = import_zod7.z.object({
285
+ isValid: import_zod7.z.boolean().describe("Indicates if the provided password is valid"),
286
+ driverIds: import_zod7.z.array(import_zod7.z.string()).describe("List of driver IDs associated with the provider account")
271
287
  }).describe("Response schema for password validation");
272
288
  // Annotate the CommonJS export names for ESM import in node:
273
289
  0 && (module.exports = {
@@ -278,6 +294,8 @@ var ValidatePasswordResponseSchema = import_zod6.z.object({
278
294
  ConvexUpdateSchema,
279
295
  DRIVER_NAME_FORBIDDEN_CHAR_PATTERN,
280
296
  DriverNameSchema,
297
+ ListDriversRequestSchema,
298
+ ListDriversResponseSchema,
281
299
  NewLoginRequest,
282
300
  NewLoginRequestSchema,
283
301
  NewLoginResponse,
@@ -306,7 +306,7 @@ type BatchConvexUpdate = BatchConvexUpdateData;
306
306
  declare const SharedDriverResponseSchema: z$1.ZodObject<{
307
307
  id: z$1.ZodUUID;
308
308
  name: z$1.ZodString;
309
- eld_external_id: z$1.ZodString;
309
+ eld_external_id: z$1.ZodNullable<z$1.ZodString>;
310
310
  license_number: z$1.ZodNullable<z$1.ZodString>;
311
311
  license_state: z$1.ZodNullable<z$1.ZodString>;
312
312
  license_expiration_date: z$1.ZodNullable<z$1.ZodString>;
@@ -315,6 +315,7 @@ declare const SharedDriverResponseSchema: z$1.ZodObject<{
315
315
  created_at: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodDate]>;
316
316
  updated_at: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodDate]>;
317
317
  truck_type: z$1.ZodNullable<z$1.ZodString>;
318
+ honk_user_id: z$1.ZodNullable<z$1.ZodString>;
318
319
  last_location_latitude: z$1.ZodNullable<z$1.ZodNumber>;
319
320
  last_location_longitude: z$1.ZodNullable<z$1.ZodNumber>;
320
321
  }, z$1.core.$strip>;
@@ -326,7 +327,8 @@ declare const DRIVER_NAME_FORBIDDEN_CHAR_PATTERN: RegExp;
326
327
  declare const DriverNameSchema: z$1.ZodString;
327
328
  declare const TruckTypeSchema: z$1.ZodString;
328
329
  declare const PatchDriverRequestSchema: z$1.ZodObject<{
329
- driver_id: z$1.ZodUUID;
330
+ driver_id: z$1.ZodOptional<z$1.ZodUUID>;
331
+ honk_user_id: z$1.ZodOptional<z$1.ZodString>;
330
332
  name: z$1.ZodOptional<z$1.ZodString>;
331
333
  truck_type: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
332
334
  }, z$1.core.$strip>;
@@ -357,7 +359,7 @@ declare const PatchDriverDriverResponseSchema: z$1.ZodObject<{
357
359
  created_at: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodDate]>;
358
360
  updated_at: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodDate]>;
359
361
  name: z$1.ZodString;
360
- eld_external_id: z$1.ZodString;
362
+ eld_external_id: z$1.ZodNullable<z$1.ZodString>;
361
363
  is_placeholder: z$1.ZodBoolean;
362
364
  truck_type: z$1.ZodNullable<z$1.ZodString>;
363
365
  }, z$1.core.$strict>;
@@ -368,7 +370,7 @@ declare const PatchDriverResponseSchema: z$1.ZodObject<{
368
370
  created_at: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodDate]>;
369
371
  updated_at: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodDate]>;
370
372
  name: z$1.ZodString;
371
- eld_external_id: z$1.ZodString;
373
+ eld_external_id: z$1.ZodNullable<z$1.ZodString>;
372
374
  is_placeholder: z$1.ZodBoolean;
373
375
  truck_type: z$1.ZodNullable<z$1.ZodString>;
374
376
  }, z$1.core.$strict>;
@@ -377,6 +379,30 @@ type PatchDriverRequest = z$1.infer<typeof PatchDriverRequestSchema>;
377
379
  type PatchDriverResponse = z$1.infer<typeof PatchDriverResponseSchema>;
378
380
  type PatchDriverDriverResponse = z$1.infer<typeof PatchDriverDriverResponseSchema>;
379
381
 
382
+ declare const ListDriversRequestSchema: z$1.ZodObject<{
383
+ name: z$1.ZodOptional<z$1.ZodString>;
384
+ }, z$1.core.$strip>;
385
+ declare const ListDriversResponseSchema: z$1.ZodObject<{
386
+ drivers: z$1.ZodArray<z$1.ZodObject<{
387
+ id: z$1.ZodUUID;
388
+ name: z$1.ZodString;
389
+ eld_external_id: z$1.ZodNullable<z$1.ZodString>;
390
+ license_number: z$1.ZodNullable<z$1.ZodString>;
391
+ license_state: z$1.ZodNullable<z$1.ZodString>;
392
+ license_expiration_date: z$1.ZodNullable<z$1.ZodString>;
393
+ license_class: z$1.ZodNullable<z$1.ZodString>;
394
+ is_placeholder: z$1.ZodBoolean;
395
+ created_at: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodDate]>;
396
+ updated_at: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodDate]>;
397
+ truck_type: z$1.ZodNullable<z$1.ZodString>;
398
+ honk_user_id: z$1.ZodNullable<z$1.ZodString>;
399
+ last_location_latitude: z$1.ZodNullable<z$1.ZodNumber>;
400
+ last_location_longitude: z$1.ZodNullable<z$1.ZodNumber>;
401
+ }, z$1.core.$strip>>;
402
+ }, z$1.core.$strip>;
403
+ type ListDriversRequest = z$1.infer<typeof ListDriversRequestSchema>;
404
+ type ListDriversResponse = z$1.infer<typeof ListDriversResponseSchema>;
405
+
380
406
  declare enum ScrapeStatus {
381
407
  NEW_LOGIN_RECEIVED = "NEW_LOGIN_RECEIVED",
382
408
  LOGIN_IN_PROGRESS = "LOGIN_IN_PROGRESS",
@@ -418,4 +444,4 @@ declare const ValidatePasswordResponseSchema: z.ZodObject<{
418
444
  type ValidatePasswordRequest = ValidatePasswordRequestData;
419
445
  type ValidatePasswordResponse = ValidatePasswordResponseData;
420
446
 
421
- export { BatchConvexUpdate, type BatchConvexUpdateData, BatchConvexUpdateSchema, type ConvexDriverData, ConvexDriverSchema, ConvexUpdate, type ConvexUpdateData, ConvexUpdateSchema, DRIVER_NAME_FORBIDDEN_CHAR_PATTERN, DriverNameSchema, NewLoginRequest, type NewLoginRequestData, NewLoginRequestSchema, NewLoginResponse, type NewLoginResponseData, NewLoginResponseFailure, type NewLoginResponseFailureData, NewLoginResponseFailureSchema, NewLoginResponseSchema, NewLoginResponseSuccess, type NewLoginResponseSuccessData, NewLoginResponseSuccessSchema, PATCH_DRIVER_NAME_MAX_LENGTH, PATCH_DRIVER_TRUCK_TYPE_MAX_LENGTH, type PatchDriverDriverResponse, PatchDriverDriverResponseSchema, type PatchDriverRequest, PatchDriverRequestSchema, type PatchDriverResponse, PatchDriverResponseSchema, type PublicProviderData, type PublicUserData, ScrapeStatus, type SharedDriverResponse, SharedDriverResponseSchema, TruckTypeSchema, UpdateScrapeStatusMessage, type ValidatePasswordRequest, type ValidatePasswordRequestData, ValidatePasswordRequestSchema, type ValidatePasswordResponse, type ValidatePasswordResponseData, ValidatePasswordResponseSchema };
447
+ export { BatchConvexUpdate, type BatchConvexUpdateData, BatchConvexUpdateSchema, type ConvexDriverData, ConvexDriverSchema, ConvexUpdate, type ConvexUpdateData, ConvexUpdateSchema, DRIVER_NAME_FORBIDDEN_CHAR_PATTERN, DriverNameSchema, type ListDriversRequest, ListDriversRequestSchema, type ListDriversResponse, ListDriversResponseSchema, NewLoginRequest, type NewLoginRequestData, NewLoginRequestSchema, NewLoginResponse, type NewLoginResponseData, NewLoginResponseFailure, type NewLoginResponseFailureData, NewLoginResponseFailureSchema, NewLoginResponseSchema, NewLoginResponseSuccess, type NewLoginResponseSuccessData, NewLoginResponseSuccessSchema, PATCH_DRIVER_NAME_MAX_LENGTH, PATCH_DRIVER_TRUCK_TYPE_MAX_LENGTH, type PatchDriverDriverResponse, PatchDriverDriverResponseSchema, type PatchDriverRequest, PatchDriverRequestSchema, type PatchDriverResponse, PatchDriverResponseSchema, type PublicProviderData, type PublicUserData, ScrapeStatus, type SharedDriverResponse, SharedDriverResponseSchema, TruckTypeSchema, UpdateScrapeStatusMessage, type ValidatePasswordRequest, type ValidatePasswordRequestData, ValidatePasswordRequestSchema, type ValidatePasswordResponse, type ValidatePasswordResponseData, ValidatePasswordResponseSchema };
package/dist/browser.d.ts CHANGED
@@ -306,7 +306,7 @@ type BatchConvexUpdate = BatchConvexUpdateData;
306
306
  declare const SharedDriverResponseSchema: z$1.ZodObject<{
307
307
  id: z$1.ZodUUID;
308
308
  name: z$1.ZodString;
309
- eld_external_id: z$1.ZodString;
309
+ eld_external_id: z$1.ZodNullable<z$1.ZodString>;
310
310
  license_number: z$1.ZodNullable<z$1.ZodString>;
311
311
  license_state: z$1.ZodNullable<z$1.ZodString>;
312
312
  license_expiration_date: z$1.ZodNullable<z$1.ZodString>;
@@ -315,6 +315,7 @@ declare const SharedDriverResponseSchema: z$1.ZodObject<{
315
315
  created_at: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodDate]>;
316
316
  updated_at: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodDate]>;
317
317
  truck_type: z$1.ZodNullable<z$1.ZodString>;
318
+ honk_user_id: z$1.ZodNullable<z$1.ZodString>;
318
319
  last_location_latitude: z$1.ZodNullable<z$1.ZodNumber>;
319
320
  last_location_longitude: z$1.ZodNullable<z$1.ZodNumber>;
320
321
  }, z$1.core.$strip>;
@@ -326,7 +327,8 @@ declare const DRIVER_NAME_FORBIDDEN_CHAR_PATTERN: RegExp;
326
327
  declare const DriverNameSchema: z$1.ZodString;
327
328
  declare const TruckTypeSchema: z$1.ZodString;
328
329
  declare const PatchDriverRequestSchema: z$1.ZodObject<{
329
- driver_id: z$1.ZodUUID;
330
+ driver_id: z$1.ZodOptional<z$1.ZodUUID>;
331
+ honk_user_id: z$1.ZodOptional<z$1.ZodString>;
330
332
  name: z$1.ZodOptional<z$1.ZodString>;
331
333
  truck_type: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
332
334
  }, z$1.core.$strip>;
@@ -357,7 +359,7 @@ declare const PatchDriverDriverResponseSchema: z$1.ZodObject<{
357
359
  created_at: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodDate]>;
358
360
  updated_at: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodDate]>;
359
361
  name: z$1.ZodString;
360
- eld_external_id: z$1.ZodString;
362
+ eld_external_id: z$1.ZodNullable<z$1.ZodString>;
361
363
  is_placeholder: z$1.ZodBoolean;
362
364
  truck_type: z$1.ZodNullable<z$1.ZodString>;
363
365
  }, z$1.core.$strict>;
@@ -368,7 +370,7 @@ declare const PatchDriverResponseSchema: z$1.ZodObject<{
368
370
  created_at: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodDate]>;
369
371
  updated_at: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodDate]>;
370
372
  name: z$1.ZodString;
371
- eld_external_id: z$1.ZodString;
373
+ eld_external_id: z$1.ZodNullable<z$1.ZodString>;
372
374
  is_placeholder: z$1.ZodBoolean;
373
375
  truck_type: z$1.ZodNullable<z$1.ZodString>;
374
376
  }, z$1.core.$strict>;
@@ -377,6 +379,30 @@ type PatchDriverRequest = z$1.infer<typeof PatchDriverRequestSchema>;
377
379
  type PatchDriverResponse = z$1.infer<typeof PatchDriverResponseSchema>;
378
380
  type PatchDriverDriverResponse = z$1.infer<typeof PatchDriverDriverResponseSchema>;
379
381
 
382
+ declare const ListDriversRequestSchema: z$1.ZodObject<{
383
+ name: z$1.ZodOptional<z$1.ZodString>;
384
+ }, z$1.core.$strip>;
385
+ declare const ListDriversResponseSchema: z$1.ZodObject<{
386
+ drivers: z$1.ZodArray<z$1.ZodObject<{
387
+ id: z$1.ZodUUID;
388
+ name: z$1.ZodString;
389
+ eld_external_id: z$1.ZodNullable<z$1.ZodString>;
390
+ license_number: z$1.ZodNullable<z$1.ZodString>;
391
+ license_state: z$1.ZodNullable<z$1.ZodString>;
392
+ license_expiration_date: z$1.ZodNullable<z$1.ZodString>;
393
+ license_class: z$1.ZodNullable<z$1.ZodString>;
394
+ is_placeholder: z$1.ZodBoolean;
395
+ created_at: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodDate]>;
396
+ updated_at: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodDate]>;
397
+ truck_type: z$1.ZodNullable<z$1.ZodString>;
398
+ honk_user_id: z$1.ZodNullable<z$1.ZodString>;
399
+ last_location_latitude: z$1.ZodNullable<z$1.ZodNumber>;
400
+ last_location_longitude: z$1.ZodNullable<z$1.ZodNumber>;
401
+ }, z$1.core.$strip>>;
402
+ }, z$1.core.$strip>;
403
+ type ListDriversRequest = z$1.infer<typeof ListDriversRequestSchema>;
404
+ type ListDriversResponse = z$1.infer<typeof ListDriversResponseSchema>;
405
+
380
406
  declare enum ScrapeStatus {
381
407
  NEW_LOGIN_RECEIVED = "NEW_LOGIN_RECEIVED",
382
408
  LOGIN_IN_PROGRESS = "LOGIN_IN_PROGRESS",
@@ -418,4 +444,4 @@ declare const ValidatePasswordResponseSchema: z.ZodObject<{
418
444
  type ValidatePasswordRequest = ValidatePasswordRequestData;
419
445
  type ValidatePasswordResponse = ValidatePasswordResponseData;
420
446
 
421
- export { BatchConvexUpdate, type BatchConvexUpdateData, BatchConvexUpdateSchema, type ConvexDriverData, ConvexDriverSchema, ConvexUpdate, type ConvexUpdateData, ConvexUpdateSchema, DRIVER_NAME_FORBIDDEN_CHAR_PATTERN, DriverNameSchema, NewLoginRequest, type NewLoginRequestData, NewLoginRequestSchema, NewLoginResponse, type NewLoginResponseData, NewLoginResponseFailure, type NewLoginResponseFailureData, NewLoginResponseFailureSchema, NewLoginResponseSchema, NewLoginResponseSuccess, type NewLoginResponseSuccessData, NewLoginResponseSuccessSchema, PATCH_DRIVER_NAME_MAX_LENGTH, PATCH_DRIVER_TRUCK_TYPE_MAX_LENGTH, type PatchDriverDriverResponse, PatchDriverDriverResponseSchema, type PatchDriverRequest, PatchDriverRequestSchema, type PatchDriverResponse, PatchDriverResponseSchema, type PublicProviderData, type PublicUserData, ScrapeStatus, type SharedDriverResponse, SharedDriverResponseSchema, TruckTypeSchema, UpdateScrapeStatusMessage, type ValidatePasswordRequest, type ValidatePasswordRequestData, ValidatePasswordRequestSchema, type ValidatePasswordResponse, type ValidatePasswordResponseData, ValidatePasswordResponseSchema };
447
+ export { BatchConvexUpdate, type BatchConvexUpdateData, BatchConvexUpdateSchema, type ConvexDriverData, ConvexDriverSchema, ConvexUpdate, type ConvexUpdateData, ConvexUpdateSchema, DRIVER_NAME_FORBIDDEN_CHAR_PATTERN, DriverNameSchema, type ListDriversRequest, ListDriversRequestSchema, type ListDriversResponse, ListDriversResponseSchema, NewLoginRequest, type NewLoginRequestData, NewLoginRequestSchema, NewLoginResponse, type NewLoginResponseData, NewLoginResponseFailure, type NewLoginResponseFailureData, NewLoginResponseFailureSchema, NewLoginResponseSchema, NewLoginResponseSuccess, type NewLoginResponseSuccessData, NewLoginResponseSuccessSchema, PATCH_DRIVER_NAME_MAX_LENGTH, PATCH_DRIVER_TRUCK_TYPE_MAX_LENGTH, type PatchDriverDriverResponse, PatchDriverDriverResponseSchema, type PatchDriverRequest, PatchDriverRequestSchema, type PatchDriverResponse, PatchDriverResponseSchema, type PublicProviderData, type PublicUserData, ScrapeStatus, type SharedDriverResponse, SharedDriverResponseSchema, TruckTypeSchema, UpdateScrapeStatusMessage, type ValidatePasswordRequest, type ValidatePasswordRequestData, ValidatePasswordRequestSchema, type ValidatePasswordResponse, type ValidatePasswordResponseData, ValidatePasswordResponseSchema };
package/dist/browser.js CHANGED
@@ -6,6 +6,8 @@ import {
6
6
  ConvexUpdateSchema,
7
7
  DRIVER_NAME_FORBIDDEN_CHAR_PATTERN,
8
8
  DriverNameSchema,
9
+ ListDriversRequestSchema,
10
+ ListDriversResponseSchema,
9
11
  NewLoginRequest,
10
12
  NewLoginRequestSchema,
11
13
  NewLoginResponse,
@@ -25,7 +27,7 @@ import {
25
27
  UpdateScrapeStatusMessage,
26
28
  ValidatePasswordRequestSchema,
27
29
  ValidatePasswordResponseSchema
28
- } from "./chunk-P4S46OZI.js";
30
+ } from "./chunk-EQIUGAWW.js";
29
31
  export {
30
32
  BatchConvexUpdate,
31
33
  BatchConvexUpdateSchema,
@@ -34,6 +36,8 @@ export {
34
36
  ConvexUpdateSchema,
35
37
  DRIVER_NAME_FORBIDDEN_CHAR_PATTERN,
36
38
  DriverNameSchema,
39
+ ListDriversRequestSchema,
40
+ ListDriversResponseSchema,
37
41
  NewLoginRequest,
38
42
  NewLoginRequestSchema,
39
43
  NewLoginResponse,
@@ -104,7 +104,7 @@ var SharedDriverResponseSchema = z3.object({
104
104
  // because providers emit non-UUID identifiers there.
105
105
  id: z3.uuid(),
106
106
  name: z3.string(),
107
- eld_external_id: z3.string(),
107
+ eld_external_id: z3.string().nullable(),
108
108
  license_number: z3.string().nullable(),
109
109
  license_state: z3.string().nullable(),
110
110
  license_expiration_date: z3.string().nullable(),
@@ -113,6 +113,7 @@ var SharedDriverResponseSchema = z3.object({
113
113
  created_at: z3.union([z3.string(), z3.date()]),
114
114
  updated_at: z3.union([z3.string(), z3.date()]),
115
115
  truck_type: z3.string().nullable(),
116
+ honk_user_id: z3.string().nullable(),
116
117
  last_location_latitude: z3.number().nullable(),
117
118
  last_location_longitude: z3.number().nullable()
118
119
  });
@@ -153,10 +154,14 @@ var DriverNameSchema = z4.string().trim().min(1).max(PATCH_DRIVER_NAME_MAX_LENGT
153
154
  );
154
155
  var TruckTypeSchema = z4.string().trim().min(1).max(PATCH_DRIVER_TRUCK_TYPE_MAX_LENGTH);
155
156
  var PatchDriverRequestSchema = z4.object({
156
- driver_id: z4.uuid(),
157
+ driver_id: z4.uuid().optional(),
158
+ honk_user_id: z4.string().min(1).max(255).optional(),
157
159
  name: DriverNameSchema.optional(),
158
160
  truck_type: TruckTypeSchema.nullable().optional()
159
161
  }).refine(
162
+ (d) => d.driver_id !== void 0 !== (d.honk_user_id !== void 0),
163
+ { message: "Exactly one of driver_id or honk_user_id must be provided" }
164
+ ).refine(
160
165
  (d) => d.name !== void 0 || d.truck_type !== void 0,
161
166
  { message: "At least one of name or truck_type must be provided" }
162
167
  );
@@ -174,8 +179,17 @@ var PatchDriverResponseSchema = z4.object({
174
179
  driver: PatchDriverDriverResponseSchema
175
180
  });
176
181
 
177
- // src/schemas/providerAccounts/update-status.ts
182
+ // src/schemas/drivers/list-drivers.ts
178
183
  import z5 from "zod";
184
+ var ListDriversRequestSchema = z5.object({
185
+ name: z5.string().optional()
186
+ });
187
+ var ListDriversResponseSchema = z5.object({
188
+ drivers: z5.array(SharedDriverResponseSchema)
189
+ });
190
+
191
+ // src/schemas/providerAccounts/update-status.ts
192
+ import z6 from "zod";
179
193
  var ScrapeStatus = /* @__PURE__ */ ((ScrapeStatus2) => {
180
194
  ScrapeStatus2["NEW_LOGIN_RECEIVED"] = "NEW_LOGIN_RECEIVED";
181
195
  ScrapeStatus2["LOGIN_IN_PROGRESS"] = "LOGIN_IN_PROGRESS";
@@ -188,25 +202,25 @@ var ScrapeStatus = /* @__PURE__ */ ((ScrapeStatus2) => {
188
202
  ScrapeStatus2["DATA_FETCH_FAILED"] = "DATA_FETCH_FAILED";
189
203
  return ScrapeStatus2;
190
204
  })(ScrapeStatus || {});
191
- var UpdateScrapeStatusMessage = z5.object({
192
- status: z5.nativeEnum(ScrapeStatus).describe("The current status of the scrape process"),
193
- correctPassword: z5.boolean().optional().describe("Indicates if the provided password was correct, if applicable"),
194
- externalProviderAccountId: z5.string().describe("The external identifier for the provider account (convex ID or similar)"),
195
- username: z5.string().describe("The username of the provider account whose status is being updated"),
196
- provider_url: z5.string().describe("The URL of the ELD provider"),
197
- driverCount: z5.number().optional().describe("The number of drivers associated with the account, if applicable"),
198
- providerSlug: z5.string().optional().describe("The slug identifier for the provider")
205
+ var UpdateScrapeStatusMessage = z6.object({
206
+ status: z6.nativeEnum(ScrapeStatus).describe("The current status of the scrape process"),
207
+ correctPassword: z6.boolean().optional().describe("Indicates if the provided password was correct, if applicable"),
208
+ externalProviderAccountId: z6.string().describe("The external identifier for the provider account (convex ID or similar)"),
209
+ username: z6.string().describe("The username of the provider account whose status is being updated"),
210
+ provider_url: z6.string().describe("The URL of the ELD provider"),
211
+ driverCount: z6.number().optional().describe("The number of drivers associated with the account, if applicable"),
212
+ providerSlug: z6.string().optional().describe("The slug identifier for the provider")
199
213
  }).describe("Schema for update status messages");
200
214
 
201
215
  // src/schemas/providerAccounts/validate-password.ts
202
- import { z as z6 } from "zod";
203
- var ValidatePasswordRequestSchema = z6.object({
204
- providerAccountId: z6.string().min(1).describe("The unique identifier of the provider account in postgres to validate the password for"),
205
- encryptedPassword: z6.string().min(1).describe("The encrypted password to validate against the stored password")
216
+ import { z as z7 } from "zod";
217
+ var ValidatePasswordRequestSchema = z7.object({
218
+ providerAccountId: z7.string().min(1).describe("The unique identifier of the provider account in postgres to validate the password for"),
219
+ encryptedPassword: z7.string().min(1).describe("The encrypted password to validate against the stored password")
206
220
  }).describe("Request schema for validating a provider account password");
207
- var ValidatePasswordResponseSchema = z6.object({
208
- isValid: z6.boolean().describe("Indicates if the provided password is valid"),
209
- driverIds: z6.array(z6.string()).describe("List of driver IDs associated with the provider account")
221
+ var ValidatePasswordResponseSchema = z7.object({
222
+ isValid: z7.boolean().describe("Indicates if the provided password is valid"),
223
+ driverIds: z7.array(z7.string()).describe("List of driver IDs associated with the provider account")
210
224
  }).describe("Response schema for password validation");
211
225
 
212
226
  export {
@@ -232,6 +246,8 @@ export {
232
246
  PatchDriverRequestSchema,
233
247
  PatchDriverDriverResponseSchema,
234
248
  PatchDriverResponseSchema,
249
+ ListDriversRequestSchema,
250
+ ListDriversResponseSchema,
235
251
  ScrapeStatus,
236
252
  UpdateScrapeStatusMessage,
237
253
  ValidatePasswordRequestSchema,