@findatruck/shared-schemas 0.13.0 → 2.0.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.cjs CHANGED
@@ -31,25 +31,20 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
31
  var index_exports = {};
32
32
  __export(index_exports, {
33
33
  ConvexUpdate: () => ConvexUpdate,
34
- ConvexUpdateNested: () => ConvexUpdateNested,
35
- DriverIdentity: () => DriverIdentity,
36
- DriverLocation: () => DriverLocation,
37
- DriverLogin: () => DriverLogin,
38
- DriverStatus: () => DriverStatus,
39
- HoursOfService: () => HoursOfService,
40
34
  NewLoginRequest: () => NewLoginRequest,
41
35
  NewLoginResponse: () => NewLoginResponse,
42
36
  NewLoginResponseFailure: () => NewLoginResponseFailure,
43
37
  NewLoginResponseSuccess: () => NewLoginResponseSuccess,
44
38
  ScrapeStatus: () => ScrapeStatus,
45
39
  UpdateScrapeStatusMessage: () => UpdateScrapeStatusMessage,
46
- VehicleIdentity: () => VehicleIdentity,
40
+ ValidatePasswordRequestSchema: () => ValidatePasswordRequestSchema,
41
+ ValidatePasswordResponseSchema: () => ValidatePasswordResponseSchema,
47
42
  decryptRsaOaepSha256B64: () => decryptRsaOaepSha256B64,
48
43
  encryptRsaOaepSha256ToB64: () => encryptRsaOaepSha256ToB64
49
44
  });
50
45
  module.exports = __toCommonJS(index_exports);
51
46
 
52
- // src/schemas/new-login.ts
47
+ // src/schemas/providerAccounts/new-login.ts
53
48
  var import_zod = require("zod");
54
49
  var UrlSchema = import_zod.z.string().refine(
55
50
  (val) => {
@@ -63,9 +58,11 @@ var UrlSchema = import_zod.z.string().refine(
63
58
  { message: "Invalid URL" }
64
59
  );
65
60
  var NewLoginRequest = import_zod.z.object({
66
- provider_url: UrlSchema,
61
+ providerUrl: UrlSchema,
67
62
  username: import_zod.z.string().min(1),
68
- password: import_zod.z.string().min(1)
63
+ encryptedPassword: import_zod.z.string().min(1),
64
+ ownerId: import_zod.z.string(),
65
+ externalProviderAccountId: import_zod.z.string()
69
66
  });
70
67
  var PublicUser = import_zod.z.object({
71
68
  id: import_zod.z.string(),
@@ -78,18 +75,19 @@ var PublicProvider = import_zod.z.object({
78
75
  url: UrlSchema
79
76
  });
80
77
  var NewLoginResponseSuccess = import_zod.z.object({
81
- success: import_zod.z.literal(true),
82
78
  message: import_zod.z.string(),
83
79
  user: PublicUser,
84
- provider: PublicProvider
80
+ provider: PublicProvider,
81
+ driverIds: import_zod.z.array(import_zod.z.string()).describe("An array of driver IDs associated with the login"),
82
+ organizationId: import_zod.z.string().optional(),
83
+ honkUserId: import_zod.z.string().optional()
85
84
  });
86
85
  var NewLoginResponseFailure = import_zod.z.object({
87
- success: import_zod.z.literal(false),
88
86
  error: import_zod.z.string()
89
87
  });
90
88
  var NewLoginResponse = import_zod.z.union([NewLoginResponseSuccess, NewLoginResponseFailure]);
91
89
 
92
- // src/schemas/convex-update.ts
90
+ // src/schemas/drivers/convex-update.ts
93
91
  var import_zod2 = __toESM(require("zod"), 1);
94
92
  var UrlSchema2 = import_zod2.default.string().refine(
95
93
  (val) => {
@@ -114,44 +112,14 @@ var ConvexUpdate = import_zod2.default.object({
114
112
  time_remaining_in_drive: import_zod2.default.number().describe("Seconds remaining in current drive period"),
115
113
  driver_current_location_latitude: import_zod2.default.number().describe("Driver's current latitude"),
116
114
  driver_current_location_longitude: import_zod2.default.number().describe("Driver's current longitude"),
117
- driver_current_location_address: import_zod2.default.string().describe("Driver's current address")
115
+ driver_current_location_address: import_zod2.default.string().describe("Driver's current address"),
116
+ license_number: import_zod2.default.string().optional().describe("The driver's license number"),
117
+ license_state: import_zod2.default.string().optional().describe("The state that issued the driver's license"),
118
+ speed: import_zod2.default.number().optional().describe("The vehicle's current speed in mph"),
119
+ odometer: import_zod2.default.number().optional().describe("The vehicle's current odometer reading in miles"),
120
+ convex_provider_account_id: import_zod2.default.string().describe("The Convex ELD provider account ID"),
121
+ external_provider_account_id: import_zod2.default.string().describe("The provider account ID on backend")
118
122
  }).describe("Schema for updating driver ELD status information");
119
- var HoursOfService = import_zod2.default.object({
120
- timeRemainingInShift: import_zod2.default.number().describe("Seconds remaining in current shift"),
121
- timeRemainingTillBreak: import_zod2.default.number().describe("Seconds remaining until next required break"),
122
- timeRemainingInWeek: import_zod2.default.number().describe("Seconds remaining in current cycle/week"),
123
- timeRemainingInDrive: import_zod2.default.number().describe("Seconds remaining in current drive period")
124
- }).describe("Schema for driver's hours of service information");
125
- var DriverLocation = import_zod2.default.object({
126
- latitude: import_zod2.default.number().describe("Driver's current latitude"),
127
- longitude: import_zod2.default.number().describe("Driver's current longitude"),
128
- address: import_zod2.default.string().describe("Driver's current address")
129
- }).describe("Schema for driver's current location information");
130
- var DriverStatus = import_zod2.default.object({
131
- status: import_zod2.default.string().describe("The driver's duty status (direct from ELD)")
132
- }).describe("Schema for driver's current duty status information");
133
- var DriverLogin = import_zod2.default.object({
134
- providerUrl: UrlSchema2.describe("The URL of the ELD provider"),
135
- username: import_zod2.default.string().describe("The driver's login username"),
136
- password: import_zod2.default.string().describe("The driver's login password")
137
- }).describe("Schema for driver login information");
138
- var DriverIdentity = import_zod2.default.object({
139
- driverId: import_zod2.default.string().describe("The ELD's internal driver ID"),
140
- driverFirstName: import_zod2.default.string().optional().describe("The driver's first name"),
141
- driverLastName: import_zod2.default.string().optional().describe("The driver's last name"),
142
- driverName: import_zod2.default.string().optional().describe("The driver's full name")
143
- }).describe("Schema for identifying the driver");
144
- var VehicleIdentity = import_zod2.default.object({
145
- vehicleId: import_zod2.default.string().optional().describe("The vehicle ID")
146
- }).describe("Schema for identifying the vehicle");
147
- var ConvexUpdateNested = import_zod2.default.object({
148
- driver: DriverIdentity,
149
- vehicle: VehicleIdentity,
150
- hoursOfService: HoursOfService,
151
- driverLocation: DriverLocation,
152
- driverStatus: DriverStatus,
153
- driverLogin: DriverLogin
154
- }).describe("Nested schema for updating driver ELD status information");
155
123
 
156
124
  // src/security/transit-crypto.ts
157
125
  var import_node_crypto = require("crypto");
@@ -179,7 +147,7 @@ function decryptRsaOaepSha256B64(ciphertextB64, privateKeyPem, passphrase) {
179
147
  return plaintext.toString("utf8");
180
148
  }
181
149
 
182
- // src/schemas/update-status.ts
150
+ // src/schemas/providerAccounts/update-status.ts
183
151
  var import_zod3 = __toESM(require("zod"), 1);
184
152
  var ScrapeStatus = /* @__PURE__ */ ((ScrapeStatus2) => {
185
153
  ScrapeStatus2["NEW_LOGIN_RECEIVED"] = "NEW_LOGIN_RECEIVED";
@@ -193,25 +161,32 @@ var ScrapeStatus = /* @__PURE__ */ ((ScrapeStatus2) => {
193
161
  })(ScrapeStatus || {});
194
162
  var UpdateScrapeStatusMessage = import_zod3.default.object({
195
163
  status: import_zod3.default.nativeEnum(ScrapeStatus).describe("The current status of the scrape process"),
196
- username: import_zod3.default.string().describe("The username of the driver whose status is being updated"),
164
+ externalProviderAccountId: import_zod3.default.string().describe("The external identifier for the provider account"),
165
+ username: import_zod3.default.string().describe("The username of the provider account whose status is being updated"),
197
166
  provider_url: import_zod3.default.string().describe("The URL of the ELD provider")
198
167
  }).describe("Schema for update status messages");
168
+
169
+ // src/schemas/providerAccounts/validate-password.ts
170
+ var import_zod4 = require("zod");
171
+ var ValidatePasswordRequestSchema = import_zod4.z.object({
172
+ providerAccountId: import_zod4.z.string().min(1).describe("The unique identifier of the provider account in postgres to validate the password for"),
173
+ encryptedPassword: import_zod4.z.string().min(1).describe("The encrypted password to validate against the stored password")
174
+ }).describe("Request schema for validating a provider account password");
175
+ var ValidatePasswordResponseSchema = import_zod4.z.object({
176
+ isValid: import_zod4.z.boolean().describe("Indicates if the provided password is valid"),
177
+ driverIds: import_zod4.z.array(import_zod4.z.string()).describe("List of driver IDs associated with the provider account")
178
+ }).describe("Response schema for password validation");
199
179
  // Annotate the CommonJS export names for ESM import in node:
200
180
  0 && (module.exports = {
201
181
  ConvexUpdate,
202
- ConvexUpdateNested,
203
- DriverIdentity,
204
- DriverLocation,
205
- DriverLogin,
206
- DriverStatus,
207
- HoursOfService,
208
182
  NewLoginRequest,
209
183
  NewLoginResponse,
210
184
  NewLoginResponseFailure,
211
185
  NewLoginResponseSuccess,
212
186
  ScrapeStatus,
213
187
  UpdateScrapeStatusMessage,
214
- VehicleIdentity,
188
+ ValidatePasswordRequestSchema,
189
+ ValidatePasswordResponseSchema,
215
190
  decryptRsaOaepSha256B64,
216
191
  encryptRsaOaepSha256ToB64
217
192
  });
package/dist/index.d.cts CHANGED
@@ -1,20 +1,25 @@
1
1
  import z$1, { z } from 'zod';
2
2
 
3
3
  declare const NewLoginRequest: z.ZodObject<{
4
- provider_url: z.ZodEffects<z.ZodString, string, string>;
4
+ providerUrl: z.ZodEffects<z.ZodString, string, string>;
5
5
  username: z.ZodString;
6
- password: z.ZodString;
6
+ encryptedPassword: z.ZodString;
7
+ ownerId: z.ZodString;
8
+ externalProviderAccountId: z.ZodString;
7
9
  }, "strip", z.ZodTypeAny, {
8
- provider_url: string;
10
+ providerUrl: string;
9
11
  username: string;
10
- password: string;
12
+ encryptedPassword: string;
13
+ ownerId: string;
14
+ externalProviderAccountId: string;
11
15
  }, {
12
- provider_url: string;
16
+ providerUrl: string;
13
17
  username: string;
14
- password: string;
18
+ encryptedPassword: string;
19
+ ownerId: string;
20
+ externalProviderAccountId: string;
15
21
  }>;
16
22
  declare const NewLoginResponseSuccess: z.ZodObject<{
17
- success: z.ZodLiteral<true>;
18
23
  message: z.ZodString;
19
24
  user: z.ZodObject<{
20
25
  id: z.ZodString;
@@ -42,9 +47,11 @@ declare const NewLoginResponseSuccess: z.ZodObject<{
42
47
  name: string;
43
48
  url: string;
44
49
  }>;
50
+ driverIds: z.ZodArray<z.ZodString, "many">;
51
+ organizationId: z.ZodOptional<z.ZodString>;
52
+ honkUserId: z.ZodOptional<z.ZodString>;
45
53
  }, "strip", z.ZodTypeAny, {
46
54
  message: string;
47
- success: true;
48
55
  user: {
49
56
  username: string;
50
57
  id: string;
@@ -55,9 +62,11 @@ declare const NewLoginResponseSuccess: z.ZodObject<{
55
62
  name: string;
56
63
  url: string;
57
64
  };
65
+ driverIds: string[];
66
+ organizationId?: string | undefined;
67
+ honkUserId?: string | undefined;
58
68
  }, {
59
69
  message: string;
60
- success: true;
61
70
  user: {
62
71
  username: string;
63
72
  id: string;
@@ -68,19 +77,18 @@ declare const NewLoginResponseSuccess: z.ZodObject<{
68
77
  name: string;
69
78
  url: string;
70
79
  };
80
+ driverIds: string[];
81
+ organizationId?: string | undefined;
82
+ honkUserId?: string | undefined;
71
83
  }>;
72
84
  declare const NewLoginResponseFailure: z.ZodObject<{
73
- success: z.ZodLiteral<false>;
74
85
  error: z.ZodString;
75
86
  }, "strip", z.ZodTypeAny, {
76
- success: false;
77
87
  error: string;
78
88
  }, {
79
- success: false;
80
89
  error: string;
81
90
  }>;
82
91
  declare const NewLoginResponse: z.ZodUnion<[z.ZodObject<{
83
- success: z.ZodLiteral<true>;
84
92
  message: z.ZodString;
85
93
  user: z.ZodObject<{
86
94
  id: z.ZodString;
@@ -108,9 +116,11 @@ declare const NewLoginResponse: z.ZodUnion<[z.ZodObject<{
108
116
  name: string;
109
117
  url: string;
110
118
  }>;
119
+ driverIds: z.ZodArray<z.ZodString, "many">;
120
+ organizationId: z.ZodOptional<z.ZodString>;
121
+ honkUserId: z.ZodOptional<z.ZodString>;
111
122
  }, "strip", z.ZodTypeAny, {
112
123
  message: string;
113
- success: true;
114
124
  user: {
115
125
  username: string;
116
126
  id: string;
@@ -121,9 +131,11 @@ declare const NewLoginResponse: z.ZodUnion<[z.ZodObject<{
121
131
  name: string;
122
132
  url: string;
123
133
  };
134
+ driverIds: string[];
135
+ organizationId?: string | undefined;
136
+ honkUserId?: string | undefined;
124
137
  }, {
125
138
  message: string;
126
- success: true;
127
139
  user: {
128
140
  username: string;
129
141
  id: string;
@@ -134,14 +146,14 @@ declare const NewLoginResponse: z.ZodUnion<[z.ZodObject<{
134
146
  name: string;
135
147
  url: string;
136
148
  };
149
+ driverIds: string[];
150
+ organizationId?: string | undefined;
151
+ honkUserId?: string | undefined;
137
152
  }>, z.ZodObject<{
138
- success: z.ZodLiteral<false>;
139
153
  error: z.ZodString;
140
154
  }, "strip", z.ZodTypeAny, {
141
- success: false;
142
155
  error: string;
143
156
  }, {
144
- success: false;
145
157
  error: string;
146
158
  }>]>;
147
159
 
@@ -158,9 +170,15 @@ declare const ConvexUpdate: z$1.ZodObject<{
158
170
  driver_current_location_latitude: z$1.ZodNumber;
159
171
  driver_current_location_longitude: z$1.ZodNumber;
160
172
  driver_current_location_address: z$1.ZodString;
173
+ license_number: z$1.ZodOptional<z$1.ZodString>;
174
+ license_state: z$1.ZodOptional<z$1.ZodString>;
175
+ speed: z$1.ZodOptional<z$1.ZodNumber>;
176
+ odometer: z$1.ZodOptional<z$1.ZodNumber>;
177
+ convex_provider_account_id: z$1.ZodString;
178
+ external_provider_account_id: z$1.ZodString;
161
179
  }, "strip", z$1.ZodTypeAny, {
162
- provider_url: string;
163
180
  username: string;
181
+ provider_url: string;
164
182
  driver_status: string;
165
183
  time_remaining_in_shift: number;
166
184
  time_remaining_till_break: number;
@@ -169,11 +187,17 @@ declare const ConvexUpdate: z$1.ZodObject<{
169
187
  driver_current_location_latitude: number;
170
188
  driver_current_location_longitude: number;
171
189
  driver_current_location_address: string;
190
+ convex_provider_account_id: string;
191
+ external_provider_account_id: string;
172
192
  driver_name?: string | undefined;
173
193
  vehicle_id?: string | undefined;
194
+ license_number?: string | undefined;
195
+ license_state?: string | undefined;
196
+ speed?: number | undefined;
197
+ odometer?: number | undefined;
174
198
  }, {
175
- provider_url: string;
176
199
  username: string;
200
+ provider_url: string;
177
201
  driver_status: string;
178
202
  time_remaining_in_shift: number;
179
203
  time_remaining_till_break: number;
@@ -182,221 +206,16 @@ declare const ConvexUpdate: z$1.ZodObject<{
182
206
  driver_current_location_latitude: number;
183
207
  driver_current_location_longitude: number;
184
208
  driver_current_location_address: string;
209
+ convex_provider_account_id: string;
210
+ external_provider_account_id: string;
185
211
  driver_name?: string | undefined;
186
212
  vehicle_id?: string | undefined;
213
+ license_number?: string | undefined;
214
+ license_state?: string | undefined;
215
+ speed?: number | undefined;
216
+ odometer?: number | undefined;
187
217
  }>;
188
218
  type ConvexUpdate = z$1.infer<typeof ConvexUpdate>;
189
- declare const HoursOfService: z$1.ZodObject<{
190
- timeRemainingInShift: z$1.ZodNumber;
191
- timeRemainingTillBreak: z$1.ZodNumber;
192
- timeRemainingInWeek: z$1.ZodNumber;
193
- timeRemainingInDrive: z$1.ZodNumber;
194
- }, "strip", z$1.ZodTypeAny, {
195
- timeRemainingInShift: number;
196
- timeRemainingTillBreak: number;
197
- timeRemainingInWeek: number;
198
- timeRemainingInDrive: number;
199
- }, {
200
- timeRemainingInShift: number;
201
- timeRemainingTillBreak: number;
202
- timeRemainingInWeek: number;
203
- timeRemainingInDrive: number;
204
- }>;
205
- type HoursOfService = z$1.infer<typeof HoursOfService>;
206
- declare const DriverLocation: z$1.ZodObject<{
207
- latitude: z$1.ZodNumber;
208
- longitude: z$1.ZodNumber;
209
- address: z$1.ZodString;
210
- }, "strip", z$1.ZodTypeAny, {
211
- latitude: number;
212
- longitude: number;
213
- address: string;
214
- }, {
215
- latitude: number;
216
- longitude: number;
217
- address: string;
218
- }>;
219
- type DriverLocation = z$1.infer<typeof DriverLocation>;
220
- declare const DriverStatus: z$1.ZodObject<{
221
- status: z$1.ZodString;
222
- }, "strip", z$1.ZodTypeAny, {
223
- status: string;
224
- }, {
225
- status: string;
226
- }>;
227
- type DriverStatus = z$1.infer<typeof DriverStatus>;
228
- declare const DriverLogin: z$1.ZodObject<{
229
- providerUrl: z$1.ZodEffects<z$1.ZodString, string, string>;
230
- username: z$1.ZodString;
231
- password: z$1.ZodString;
232
- }, "strip", z$1.ZodTypeAny, {
233
- username: string;
234
- password: string;
235
- providerUrl: string;
236
- }, {
237
- username: string;
238
- password: string;
239
- providerUrl: string;
240
- }>;
241
- type DriverLogin = z$1.infer<typeof DriverLogin>;
242
- declare const DriverIdentity: z$1.ZodObject<{
243
- driverId: z$1.ZodString;
244
- driverFirstName: z$1.ZodOptional<z$1.ZodString>;
245
- driverLastName: z$1.ZodOptional<z$1.ZodString>;
246
- driverName: z$1.ZodOptional<z$1.ZodString>;
247
- }, "strip", z$1.ZodTypeAny, {
248
- driverId: string;
249
- driverFirstName?: string | undefined;
250
- driverLastName?: string | undefined;
251
- driverName?: string | undefined;
252
- }, {
253
- driverId: string;
254
- driverFirstName?: string | undefined;
255
- driverLastName?: string | undefined;
256
- driverName?: string | undefined;
257
- }>;
258
- type DriverIdentity = z$1.infer<typeof DriverIdentity>;
259
- declare const VehicleIdentity: z$1.ZodObject<{
260
- vehicleId: z$1.ZodOptional<z$1.ZodString>;
261
- }, "strip", z$1.ZodTypeAny, {
262
- vehicleId?: string | undefined;
263
- }, {
264
- vehicleId?: string | undefined;
265
- }>;
266
- type VehicleIdentity = z$1.infer<typeof VehicleIdentity>;
267
- declare const ConvexUpdateNested: z$1.ZodObject<{
268
- driver: z$1.ZodObject<{
269
- driverId: z$1.ZodString;
270
- driverFirstName: z$1.ZodOptional<z$1.ZodString>;
271
- driverLastName: z$1.ZodOptional<z$1.ZodString>;
272
- driverName: z$1.ZodOptional<z$1.ZodString>;
273
- }, "strip", z$1.ZodTypeAny, {
274
- driverId: string;
275
- driverFirstName?: string | undefined;
276
- driverLastName?: string | undefined;
277
- driverName?: string | undefined;
278
- }, {
279
- driverId: string;
280
- driverFirstName?: string | undefined;
281
- driverLastName?: string | undefined;
282
- driverName?: string | undefined;
283
- }>;
284
- vehicle: z$1.ZodObject<{
285
- vehicleId: z$1.ZodOptional<z$1.ZodString>;
286
- }, "strip", z$1.ZodTypeAny, {
287
- vehicleId?: string | undefined;
288
- }, {
289
- vehicleId?: string | undefined;
290
- }>;
291
- hoursOfService: z$1.ZodObject<{
292
- timeRemainingInShift: z$1.ZodNumber;
293
- timeRemainingTillBreak: z$1.ZodNumber;
294
- timeRemainingInWeek: z$1.ZodNumber;
295
- timeRemainingInDrive: z$1.ZodNumber;
296
- }, "strip", z$1.ZodTypeAny, {
297
- timeRemainingInShift: number;
298
- timeRemainingTillBreak: number;
299
- timeRemainingInWeek: number;
300
- timeRemainingInDrive: number;
301
- }, {
302
- timeRemainingInShift: number;
303
- timeRemainingTillBreak: number;
304
- timeRemainingInWeek: number;
305
- timeRemainingInDrive: number;
306
- }>;
307
- driverLocation: z$1.ZodObject<{
308
- latitude: z$1.ZodNumber;
309
- longitude: z$1.ZodNumber;
310
- address: z$1.ZodString;
311
- }, "strip", z$1.ZodTypeAny, {
312
- latitude: number;
313
- longitude: number;
314
- address: string;
315
- }, {
316
- latitude: number;
317
- longitude: number;
318
- address: string;
319
- }>;
320
- driverStatus: z$1.ZodObject<{
321
- status: z$1.ZodString;
322
- }, "strip", z$1.ZodTypeAny, {
323
- status: string;
324
- }, {
325
- status: string;
326
- }>;
327
- driverLogin: z$1.ZodObject<{
328
- providerUrl: z$1.ZodEffects<z$1.ZodString, string, string>;
329
- username: z$1.ZodString;
330
- password: z$1.ZodString;
331
- }, "strip", z$1.ZodTypeAny, {
332
- username: string;
333
- password: string;
334
- providerUrl: string;
335
- }, {
336
- username: string;
337
- password: string;
338
- providerUrl: string;
339
- }>;
340
- }, "strip", z$1.ZodTypeAny, {
341
- driver: {
342
- driverId: string;
343
- driverFirstName?: string | undefined;
344
- driverLastName?: string | undefined;
345
- driverName?: string | undefined;
346
- };
347
- vehicle: {
348
- vehicleId?: string | undefined;
349
- };
350
- hoursOfService: {
351
- timeRemainingInShift: number;
352
- timeRemainingTillBreak: number;
353
- timeRemainingInWeek: number;
354
- timeRemainingInDrive: number;
355
- };
356
- driverLocation: {
357
- latitude: number;
358
- longitude: number;
359
- address: string;
360
- };
361
- driverStatus: {
362
- status: string;
363
- };
364
- driverLogin: {
365
- username: string;
366
- password: string;
367
- providerUrl: string;
368
- };
369
- }, {
370
- driver: {
371
- driverId: string;
372
- driverFirstName?: string | undefined;
373
- driverLastName?: string | undefined;
374
- driverName?: string | undefined;
375
- };
376
- vehicle: {
377
- vehicleId?: string | undefined;
378
- };
379
- hoursOfService: {
380
- timeRemainingInShift: number;
381
- timeRemainingTillBreak: number;
382
- timeRemainingInWeek: number;
383
- timeRemainingInDrive: number;
384
- };
385
- driverLocation: {
386
- latitude: number;
387
- longitude: number;
388
- address: string;
389
- };
390
- driverStatus: {
391
- status: string;
392
- };
393
- driverLogin: {
394
- username: string;
395
- password: string;
396
- providerUrl: string;
397
- };
398
- }>;
399
- type ConvexUpdateNested = z$1.infer<typeof ConvexUpdateNested>;
400
219
 
401
220
  declare function encryptRsaOaepSha256ToB64(plaintext: string, publicKeyPem: string): string;
402
221
  declare function decryptRsaOaepSha256B64(ciphertextB64: string, privateKeyPem: string, passphrase?: string): string;
@@ -412,17 +231,43 @@ declare enum ScrapeStatus {
412
231
  }
413
232
  declare const UpdateScrapeStatusMessage: z$1.ZodObject<{
414
233
  status: z$1.ZodNativeEnum<typeof ScrapeStatus>;
234
+ externalProviderAccountId: z$1.ZodString;
415
235
  username: z$1.ZodString;
416
236
  provider_url: z$1.ZodString;
417
237
  }, "strip", z$1.ZodTypeAny, {
418
- provider_url: string;
419
238
  username: string;
239
+ externalProviderAccountId: string;
420
240
  status: ScrapeStatus;
421
- }, {
422
241
  provider_url: string;
242
+ }, {
423
243
  username: string;
244
+ externalProviderAccountId: string;
424
245
  status: ScrapeStatus;
246
+ provider_url: string;
425
247
  }>;
426
248
  type UpdateScrapeStatusMessage = z$1.infer<typeof UpdateScrapeStatusMessage>;
427
249
 
428
- export { ConvexUpdate, ConvexUpdateNested, DriverIdentity, DriverLocation, DriverLogin, DriverStatus, HoursOfService, NewLoginRequest, NewLoginResponse, NewLoginResponseFailure, NewLoginResponseSuccess, ScrapeStatus, UpdateScrapeStatusMessage, VehicleIdentity, decryptRsaOaepSha256B64, encryptRsaOaepSha256ToB64 };
250
+ declare const ValidatePasswordRequestSchema: z.ZodObject<{
251
+ providerAccountId: z.ZodString;
252
+ encryptedPassword: z.ZodString;
253
+ }, "strip", z.ZodTypeAny, {
254
+ encryptedPassword: string;
255
+ providerAccountId: string;
256
+ }, {
257
+ encryptedPassword: string;
258
+ providerAccountId: string;
259
+ }>;
260
+ type ValidatePasswordRequest = z.infer<typeof ValidatePasswordRequestSchema>;
261
+ declare const ValidatePasswordResponseSchema: z.ZodObject<{
262
+ isValid: z.ZodBoolean;
263
+ driverIds: z.ZodArray<z.ZodString, "many">;
264
+ }, "strip", z.ZodTypeAny, {
265
+ driverIds: string[];
266
+ isValid: boolean;
267
+ }, {
268
+ driverIds: string[];
269
+ isValid: boolean;
270
+ }>;
271
+ type ValidatePasswordResponse = z.infer<typeof ValidatePasswordResponseSchema>;
272
+
273
+ export { ConvexUpdate, NewLoginRequest, NewLoginResponse, NewLoginResponseFailure, NewLoginResponseSuccess, ScrapeStatus, UpdateScrapeStatusMessage, type ValidatePasswordRequest, ValidatePasswordRequestSchema, type ValidatePasswordResponse, ValidatePasswordResponseSchema, decryptRsaOaepSha256B64, encryptRsaOaepSha256ToB64 };
package/dist/index.d.ts CHANGED
@@ -1,20 +1,25 @@
1
1
  import z$1, { z } from 'zod';
2
2
 
3
3
  declare const NewLoginRequest: z.ZodObject<{
4
- provider_url: z.ZodEffects<z.ZodString, string, string>;
4
+ providerUrl: z.ZodEffects<z.ZodString, string, string>;
5
5
  username: z.ZodString;
6
- password: z.ZodString;
6
+ encryptedPassword: z.ZodString;
7
+ ownerId: z.ZodString;
8
+ externalProviderAccountId: z.ZodString;
7
9
  }, "strip", z.ZodTypeAny, {
8
- provider_url: string;
10
+ providerUrl: string;
9
11
  username: string;
10
- password: string;
12
+ encryptedPassword: string;
13
+ ownerId: string;
14
+ externalProviderAccountId: string;
11
15
  }, {
12
- provider_url: string;
16
+ providerUrl: string;
13
17
  username: string;
14
- password: string;
18
+ encryptedPassword: string;
19
+ ownerId: string;
20
+ externalProviderAccountId: string;
15
21
  }>;
16
22
  declare const NewLoginResponseSuccess: z.ZodObject<{
17
- success: z.ZodLiteral<true>;
18
23
  message: z.ZodString;
19
24
  user: z.ZodObject<{
20
25
  id: z.ZodString;
@@ -42,9 +47,11 @@ declare const NewLoginResponseSuccess: z.ZodObject<{
42
47
  name: string;
43
48
  url: string;
44
49
  }>;
50
+ driverIds: z.ZodArray<z.ZodString, "many">;
51
+ organizationId: z.ZodOptional<z.ZodString>;
52
+ honkUserId: z.ZodOptional<z.ZodString>;
45
53
  }, "strip", z.ZodTypeAny, {
46
54
  message: string;
47
- success: true;
48
55
  user: {
49
56
  username: string;
50
57
  id: string;
@@ -55,9 +62,11 @@ declare const NewLoginResponseSuccess: z.ZodObject<{
55
62
  name: string;
56
63
  url: string;
57
64
  };
65
+ driverIds: string[];
66
+ organizationId?: string | undefined;
67
+ honkUserId?: string | undefined;
58
68
  }, {
59
69
  message: string;
60
- success: true;
61
70
  user: {
62
71
  username: string;
63
72
  id: string;
@@ -68,19 +77,18 @@ declare const NewLoginResponseSuccess: z.ZodObject<{
68
77
  name: string;
69
78
  url: string;
70
79
  };
80
+ driverIds: string[];
81
+ organizationId?: string | undefined;
82
+ honkUserId?: string | undefined;
71
83
  }>;
72
84
  declare const NewLoginResponseFailure: z.ZodObject<{
73
- success: z.ZodLiteral<false>;
74
85
  error: z.ZodString;
75
86
  }, "strip", z.ZodTypeAny, {
76
- success: false;
77
87
  error: string;
78
88
  }, {
79
- success: false;
80
89
  error: string;
81
90
  }>;
82
91
  declare const NewLoginResponse: z.ZodUnion<[z.ZodObject<{
83
- success: z.ZodLiteral<true>;
84
92
  message: z.ZodString;
85
93
  user: z.ZodObject<{
86
94
  id: z.ZodString;
@@ -108,9 +116,11 @@ declare const NewLoginResponse: z.ZodUnion<[z.ZodObject<{
108
116
  name: string;
109
117
  url: string;
110
118
  }>;
119
+ driverIds: z.ZodArray<z.ZodString, "many">;
120
+ organizationId: z.ZodOptional<z.ZodString>;
121
+ honkUserId: z.ZodOptional<z.ZodString>;
111
122
  }, "strip", z.ZodTypeAny, {
112
123
  message: string;
113
- success: true;
114
124
  user: {
115
125
  username: string;
116
126
  id: string;
@@ -121,9 +131,11 @@ declare const NewLoginResponse: z.ZodUnion<[z.ZodObject<{
121
131
  name: string;
122
132
  url: string;
123
133
  };
134
+ driverIds: string[];
135
+ organizationId?: string | undefined;
136
+ honkUserId?: string | undefined;
124
137
  }, {
125
138
  message: string;
126
- success: true;
127
139
  user: {
128
140
  username: string;
129
141
  id: string;
@@ -134,14 +146,14 @@ declare const NewLoginResponse: z.ZodUnion<[z.ZodObject<{
134
146
  name: string;
135
147
  url: string;
136
148
  };
149
+ driverIds: string[];
150
+ organizationId?: string | undefined;
151
+ honkUserId?: string | undefined;
137
152
  }>, z.ZodObject<{
138
- success: z.ZodLiteral<false>;
139
153
  error: z.ZodString;
140
154
  }, "strip", z.ZodTypeAny, {
141
- success: false;
142
155
  error: string;
143
156
  }, {
144
- success: false;
145
157
  error: string;
146
158
  }>]>;
147
159
 
@@ -158,9 +170,15 @@ declare const ConvexUpdate: z$1.ZodObject<{
158
170
  driver_current_location_latitude: z$1.ZodNumber;
159
171
  driver_current_location_longitude: z$1.ZodNumber;
160
172
  driver_current_location_address: z$1.ZodString;
173
+ license_number: z$1.ZodOptional<z$1.ZodString>;
174
+ license_state: z$1.ZodOptional<z$1.ZodString>;
175
+ speed: z$1.ZodOptional<z$1.ZodNumber>;
176
+ odometer: z$1.ZodOptional<z$1.ZodNumber>;
177
+ convex_provider_account_id: z$1.ZodString;
178
+ external_provider_account_id: z$1.ZodString;
161
179
  }, "strip", z$1.ZodTypeAny, {
162
- provider_url: string;
163
180
  username: string;
181
+ provider_url: string;
164
182
  driver_status: string;
165
183
  time_remaining_in_shift: number;
166
184
  time_remaining_till_break: number;
@@ -169,11 +187,17 @@ declare const ConvexUpdate: z$1.ZodObject<{
169
187
  driver_current_location_latitude: number;
170
188
  driver_current_location_longitude: number;
171
189
  driver_current_location_address: string;
190
+ convex_provider_account_id: string;
191
+ external_provider_account_id: string;
172
192
  driver_name?: string | undefined;
173
193
  vehicle_id?: string | undefined;
194
+ license_number?: string | undefined;
195
+ license_state?: string | undefined;
196
+ speed?: number | undefined;
197
+ odometer?: number | undefined;
174
198
  }, {
175
- provider_url: string;
176
199
  username: string;
200
+ provider_url: string;
177
201
  driver_status: string;
178
202
  time_remaining_in_shift: number;
179
203
  time_remaining_till_break: number;
@@ -182,221 +206,16 @@ declare const ConvexUpdate: z$1.ZodObject<{
182
206
  driver_current_location_latitude: number;
183
207
  driver_current_location_longitude: number;
184
208
  driver_current_location_address: string;
209
+ convex_provider_account_id: string;
210
+ external_provider_account_id: string;
185
211
  driver_name?: string | undefined;
186
212
  vehicle_id?: string | undefined;
213
+ license_number?: string | undefined;
214
+ license_state?: string | undefined;
215
+ speed?: number | undefined;
216
+ odometer?: number | undefined;
187
217
  }>;
188
218
  type ConvexUpdate = z$1.infer<typeof ConvexUpdate>;
189
- declare const HoursOfService: z$1.ZodObject<{
190
- timeRemainingInShift: z$1.ZodNumber;
191
- timeRemainingTillBreak: z$1.ZodNumber;
192
- timeRemainingInWeek: z$1.ZodNumber;
193
- timeRemainingInDrive: z$1.ZodNumber;
194
- }, "strip", z$1.ZodTypeAny, {
195
- timeRemainingInShift: number;
196
- timeRemainingTillBreak: number;
197
- timeRemainingInWeek: number;
198
- timeRemainingInDrive: number;
199
- }, {
200
- timeRemainingInShift: number;
201
- timeRemainingTillBreak: number;
202
- timeRemainingInWeek: number;
203
- timeRemainingInDrive: number;
204
- }>;
205
- type HoursOfService = z$1.infer<typeof HoursOfService>;
206
- declare const DriverLocation: z$1.ZodObject<{
207
- latitude: z$1.ZodNumber;
208
- longitude: z$1.ZodNumber;
209
- address: z$1.ZodString;
210
- }, "strip", z$1.ZodTypeAny, {
211
- latitude: number;
212
- longitude: number;
213
- address: string;
214
- }, {
215
- latitude: number;
216
- longitude: number;
217
- address: string;
218
- }>;
219
- type DriverLocation = z$1.infer<typeof DriverLocation>;
220
- declare const DriverStatus: z$1.ZodObject<{
221
- status: z$1.ZodString;
222
- }, "strip", z$1.ZodTypeAny, {
223
- status: string;
224
- }, {
225
- status: string;
226
- }>;
227
- type DriverStatus = z$1.infer<typeof DriverStatus>;
228
- declare const DriverLogin: z$1.ZodObject<{
229
- providerUrl: z$1.ZodEffects<z$1.ZodString, string, string>;
230
- username: z$1.ZodString;
231
- password: z$1.ZodString;
232
- }, "strip", z$1.ZodTypeAny, {
233
- username: string;
234
- password: string;
235
- providerUrl: string;
236
- }, {
237
- username: string;
238
- password: string;
239
- providerUrl: string;
240
- }>;
241
- type DriverLogin = z$1.infer<typeof DriverLogin>;
242
- declare const DriverIdentity: z$1.ZodObject<{
243
- driverId: z$1.ZodString;
244
- driverFirstName: z$1.ZodOptional<z$1.ZodString>;
245
- driverLastName: z$1.ZodOptional<z$1.ZodString>;
246
- driverName: z$1.ZodOptional<z$1.ZodString>;
247
- }, "strip", z$1.ZodTypeAny, {
248
- driverId: string;
249
- driverFirstName?: string | undefined;
250
- driverLastName?: string | undefined;
251
- driverName?: string | undefined;
252
- }, {
253
- driverId: string;
254
- driverFirstName?: string | undefined;
255
- driverLastName?: string | undefined;
256
- driverName?: string | undefined;
257
- }>;
258
- type DriverIdentity = z$1.infer<typeof DriverIdentity>;
259
- declare const VehicleIdentity: z$1.ZodObject<{
260
- vehicleId: z$1.ZodOptional<z$1.ZodString>;
261
- }, "strip", z$1.ZodTypeAny, {
262
- vehicleId?: string | undefined;
263
- }, {
264
- vehicleId?: string | undefined;
265
- }>;
266
- type VehicleIdentity = z$1.infer<typeof VehicleIdentity>;
267
- declare const ConvexUpdateNested: z$1.ZodObject<{
268
- driver: z$1.ZodObject<{
269
- driverId: z$1.ZodString;
270
- driverFirstName: z$1.ZodOptional<z$1.ZodString>;
271
- driverLastName: z$1.ZodOptional<z$1.ZodString>;
272
- driverName: z$1.ZodOptional<z$1.ZodString>;
273
- }, "strip", z$1.ZodTypeAny, {
274
- driverId: string;
275
- driverFirstName?: string | undefined;
276
- driverLastName?: string | undefined;
277
- driverName?: string | undefined;
278
- }, {
279
- driverId: string;
280
- driverFirstName?: string | undefined;
281
- driverLastName?: string | undefined;
282
- driverName?: string | undefined;
283
- }>;
284
- vehicle: z$1.ZodObject<{
285
- vehicleId: z$1.ZodOptional<z$1.ZodString>;
286
- }, "strip", z$1.ZodTypeAny, {
287
- vehicleId?: string | undefined;
288
- }, {
289
- vehicleId?: string | undefined;
290
- }>;
291
- hoursOfService: z$1.ZodObject<{
292
- timeRemainingInShift: z$1.ZodNumber;
293
- timeRemainingTillBreak: z$1.ZodNumber;
294
- timeRemainingInWeek: z$1.ZodNumber;
295
- timeRemainingInDrive: z$1.ZodNumber;
296
- }, "strip", z$1.ZodTypeAny, {
297
- timeRemainingInShift: number;
298
- timeRemainingTillBreak: number;
299
- timeRemainingInWeek: number;
300
- timeRemainingInDrive: number;
301
- }, {
302
- timeRemainingInShift: number;
303
- timeRemainingTillBreak: number;
304
- timeRemainingInWeek: number;
305
- timeRemainingInDrive: number;
306
- }>;
307
- driverLocation: z$1.ZodObject<{
308
- latitude: z$1.ZodNumber;
309
- longitude: z$1.ZodNumber;
310
- address: z$1.ZodString;
311
- }, "strip", z$1.ZodTypeAny, {
312
- latitude: number;
313
- longitude: number;
314
- address: string;
315
- }, {
316
- latitude: number;
317
- longitude: number;
318
- address: string;
319
- }>;
320
- driverStatus: z$1.ZodObject<{
321
- status: z$1.ZodString;
322
- }, "strip", z$1.ZodTypeAny, {
323
- status: string;
324
- }, {
325
- status: string;
326
- }>;
327
- driverLogin: z$1.ZodObject<{
328
- providerUrl: z$1.ZodEffects<z$1.ZodString, string, string>;
329
- username: z$1.ZodString;
330
- password: z$1.ZodString;
331
- }, "strip", z$1.ZodTypeAny, {
332
- username: string;
333
- password: string;
334
- providerUrl: string;
335
- }, {
336
- username: string;
337
- password: string;
338
- providerUrl: string;
339
- }>;
340
- }, "strip", z$1.ZodTypeAny, {
341
- driver: {
342
- driverId: string;
343
- driverFirstName?: string | undefined;
344
- driverLastName?: string | undefined;
345
- driverName?: string | undefined;
346
- };
347
- vehicle: {
348
- vehicleId?: string | undefined;
349
- };
350
- hoursOfService: {
351
- timeRemainingInShift: number;
352
- timeRemainingTillBreak: number;
353
- timeRemainingInWeek: number;
354
- timeRemainingInDrive: number;
355
- };
356
- driverLocation: {
357
- latitude: number;
358
- longitude: number;
359
- address: string;
360
- };
361
- driverStatus: {
362
- status: string;
363
- };
364
- driverLogin: {
365
- username: string;
366
- password: string;
367
- providerUrl: string;
368
- };
369
- }, {
370
- driver: {
371
- driverId: string;
372
- driverFirstName?: string | undefined;
373
- driverLastName?: string | undefined;
374
- driverName?: string | undefined;
375
- };
376
- vehicle: {
377
- vehicleId?: string | undefined;
378
- };
379
- hoursOfService: {
380
- timeRemainingInShift: number;
381
- timeRemainingTillBreak: number;
382
- timeRemainingInWeek: number;
383
- timeRemainingInDrive: number;
384
- };
385
- driverLocation: {
386
- latitude: number;
387
- longitude: number;
388
- address: string;
389
- };
390
- driverStatus: {
391
- status: string;
392
- };
393
- driverLogin: {
394
- username: string;
395
- password: string;
396
- providerUrl: string;
397
- };
398
- }>;
399
- type ConvexUpdateNested = z$1.infer<typeof ConvexUpdateNested>;
400
219
 
401
220
  declare function encryptRsaOaepSha256ToB64(plaintext: string, publicKeyPem: string): string;
402
221
  declare function decryptRsaOaepSha256B64(ciphertextB64: string, privateKeyPem: string, passphrase?: string): string;
@@ -412,17 +231,43 @@ declare enum ScrapeStatus {
412
231
  }
413
232
  declare const UpdateScrapeStatusMessage: z$1.ZodObject<{
414
233
  status: z$1.ZodNativeEnum<typeof ScrapeStatus>;
234
+ externalProviderAccountId: z$1.ZodString;
415
235
  username: z$1.ZodString;
416
236
  provider_url: z$1.ZodString;
417
237
  }, "strip", z$1.ZodTypeAny, {
418
- provider_url: string;
419
238
  username: string;
239
+ externalProviderAccountId: string;
420
240
  status: ScrapeStatus;
421
- }, {
422
241
  provider_url: string;
242
+ }, {
423
243
  username: string;
244
+ externalProviderAccountId: string;
424
245
  status: ScrapeStatus;
246
+ provider_url: string;
425
247
  }>;
426
248
  type UpdateScrapeStatusMessage = z$1.infer<typeof UpdateScrapeStatusMessage>;
427
249
 
428
- export { ConvexUpdate, ConvexUpdateNested, DriverIdentity, DriverLocation, DriverLogin, DriverStatus, HoursOfService, NewLoginRequest, NewLoginResponse, NewLoginResponseFailure, NewLoginResponseSuccess, ScrapeStatus, UpdateScrapeStatusMessage, VehicleIdentity, decryptRsaOaepSha256B64, encryptRsaOaepSha256ToB64 };
250
+ declare const ValidatePasswordRequestSchema: z.ZodObject<{
251
+ providerAccountId: z.ZodString;
252
+ encryptedPassword: z.ZodString;
253
+ }, "strip", z.ZodTypeAny, {
254
+ encryptedPassword: string;
255
+ providerAccountId: string;
256
+ }, {
257
+ encryptedPassword: string;
258
+ providerAccountId: string;
259
+ }>;
260
+ type ValidatePasswordRequest = z.infer<typeof ValidatePasswordRequestSchema>;
261
+ declare const ValidatePasswordResponseSchema: z.ZodObject<{
262
+ isValid: z.ZodBoolean;
263
+ driverIds: z.ZodArray<z.ZodString, "many">;
264
+ }, "strip", z.ZodTypeAny, {
265
+ driverIds: string[];
266
+ isValid: boolean;
267
+ }, {
268
+ driverIds: string[];
269
+ isValid: boolean;
270
+ }>;
271
+ type ValidatePasswordResponse = z.infer<typeof ValidatePasswordResponseSchema>;
272
+
273
+ export { ConvexUpdate, NewLoginRequest, NewLoginResponse, NewLoginResponseFailure, NewLoginResponseSuccess, ScrapeStatus, UpdateScrapeStatusMessage, type ValidatePasswordRequest, ValidatePasswordRequestSchema, type ValidatePasswordResponse, ValidatePasswordResponseSchema, decryptRsaOaepSha256B64, encryptRsaOaepSha256ToB64 };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- // src/schemas/new-login.ts
1
+ // src/schemas/providerAccounts/new-login.ts
2
2
  import { z } from "zod";
3
3
  var UrlSchema = z.string().refine(
4
4
  (val) => {
@@ -12,9 +12,11 @@ var UrlSchema = z.string().refine(
12
12
  { message: "Invalid URL" }
13
13
  );
14
14
  var NewLoginRequest = z.object({
15
- provider_url: UrlSchema,
15
+ providerUrl: UrlSchema,
16
16
  username: z.string().min(1),
17
- password: z.string().min(1)
17
+ encryptedPassword: z.string().min(1),
18
+ ownerId: z.string(),
19
+ externalProviderAccountId: z.string()
18
20
  });
19
21
  var PublicUser = z.object({
20
22
  id: z.string(),
@@ -27,18 +29,19 @@ var PublicProvider = z.object({
27
29
  url: UrlSchema
28
30
  });
29
31
  var NewLoginResponseSuccess = z.object({
30
- success: z.literal(true),
31
32
  message: z.string(),
32
33
  user: PublicUser,
33
- provider: PublicProvider
34
+ provider: PublicProvider,
35
+ driverIds: z.array(z.string()).describe("An array of driver IDs associated with the login"),
36
+ organizationId: z.string().optional(),
37
+ honkUserId: z.string().optional()
34
38
  });
35
39
  var NewLoginResponseFailure = z.object({
36
- success: z.literal(false),
37
40
  error: z.string()
38
41
  });
39
42
  var NewLoginResponse = z.union([NewLoginResponseSuccess, NewLoginResponseFailure]);
40
43
 
41
- // src/schemas/convex-update.ts
44
+ // src/schemas/drivers/convex-update.ts
42
45
  import z2 from "zod";
43
46
  var UrlSchema2 = z2.string().refine(
44
47
  (val) => {
@@ -63,44 +66,14 @@ var ConvexUpdate = z2.object({
63
66
  time_remaining_in_drive: z2.number().describe("Seconds remaining in current drive period"),
64
67
  driver_current_location_latitude: z2.number().describe("Driver's current latitude"),
65
68
  driver_current_location_longitude: z2.number().describe("Driver's current longitude"),
66
- driver_current_location_address: z2.string().describe("Driver's current address")
69
+ driver_current_location_address: z2.string().describe("Driver's current address"),
70
+ license_number: z2.string().optional().describe("The driver's license number"),
71
+ license_state: z2.string().optional().describe("The state that issued the driver's license"),
72
+ speed: z2.number().optional().describe("The vehicle's current speed in mph"),
73
+ odometer: z2.number().optional().describe("The vehicle's current odometer reading in miles"),
74
+ convex_provider_account_id: z2.string().describe("The Convex ELD provider account ID"),
75
+ external_provider_account_id: z2.string().describe("The provider account ID on backend")
67
76
  }).describe("Schema for updating driver ELD status information");
68
- var HoursOfService = z2.object({
69
- timeRemainingInShift: z2.number().describe("Seconds remaining in current shift"),
70
- timeRemainingTillBreak: z2.number().describe("Seconds remaining until next required break"),
71
- timeRemainingInWeek: z2.number().describe("Seconds remaining in current cycle/week"),
72
- timeRemainingInDrive: z2.number().describe("Seconds remaining in current drive period")
73
- }).describe("Schema for driver's hours of service information");
74
- var DriverLocation = z2.object({
75
- latitude: z2.number().describe("Driver's current latitude"),
76
- longitude: z2.number().describe("Driver's current longitude"),
77
- address: z2.string().describe("Driver's current address")
78
- }).describe("Schema for driver's current location information");
79
- var DriverStatus = z2.object({
80
- status: z2.string().describe("The driver's duty status (direct from ELD)")
81
- }).describe("Schema for driver's current duty status information");
82
- var DriverLogin = z2.object({
83
- providerUrl: UrlSchema2.describe("The URL of the ELD provider"),
84
- username: z2.string().describe("The driver's login username"),
85
- password: z2.string().describe("The driver's login password")
86
- }).describe("Schema for driver login information");
87
- var DriverIdentity = z2.object({
88
- driverId: z2.string().describe("The ELD's internal driver ID"),
89
- driverFirstName: z2.string().optional().describe("The driver's first name"),
90
- driverLastName: z2.string().optional().describe("The driver's last name"),
91
- driverName: z2.string().optional().describe("The driver's full name")
92
- }).describe("Schema for identifying the driver");
93
- var VehicleIdentity = z2.object({
94
- vehicleId: z2.string().optional().describe("The vehicle ID")
95
- }).describe("Schema for identifying the vehicle");
96
- var ConvexUpdateNested = z2.object({
97
- driver: DriverIdentity,
98
- vehicle: VehicleIdentity,
99
- hoursOfService: HoursOfService,
100
- driverLocation: DriverLocation,
101
- driverStatus: DriverStatus,
102
- driverLogin: DriverLogin
103
- }).describe("Nested schema for updating driver ELD status information");
104
77
 
105
78
  // src/security/transit-crypto.ts
106
79
  import { publicEncrypt, privateDecrypt, constants } from "crypto";
@@ -128,7 +101,7 @@ function decryptRsaOaepSha256B64(ciphertextB64, privateKeyPem, passphrase) {
128
101
  return plaintext.toString("utf8");
129
102
  }
130
103
 
131
- // src/schemas/update-status.ts
104
+ // src/schemas/providerAccounts/update-status.ts
132
105
  import z3 from "zod";
133
106
  var ScrapeStatus = /* @__PURE__ */ ((ScrapeStatus2) => {
134
107
  ScrapeStatus2["NEW_LOGIN_RECEIVED"] = "NEW_LOGIN_RECEIVED";
@@ -142,24 +115,31 @@ var ScrapeStatus = /* @__PURE__ */ ((ScrapeStatus2) => {
142
115
  })(ScrapeStatus || {});
143
116
  var UpdateScrapeStatusMessage = z3.object({
144
117
  status: z3.nativeEnum(ScrapeStatus).describe("The current status of the scrape process"),
145
- username: z3.string().describe("The username of the driver whose status is being updated"),
118
+ externalProviderAccountId: z3.string().describe("The external identifier for the provider account"),
119
+ username: z3.string().describe("The username of the provider account whose status is being updated"),
146
120
  provider_url: z3.string().describe("The URL of the ELD provider")
147
121
  }).describe("Schema for update status messages");
122
+
123
+ // src/schemas/providerAccounts/validate-password.ts
124
+ import { z as z4 } from "zod";
125
+ var ValidatePasswordRequestSchema = z4.object({
126
+ providerAccountId: z4.string().min(1).describe("The unique identifier of the provider account in postgres to validate the password for"),
127
+ encryptedPassword: z4.string().min(1).describe("The encrypted password to validate against the stored password")
128
+ }).describe("Request schema for validating a provider account password");
129
+ var ValidatePasswordResponseSchema = z4.object({
130
+ isValid: z4.boolean().describe("Indicates if the provided password is valid"),
131
+ driverIds: z4.array(z4.string()).describe("List of driver IDs associated with the provider account")
132
+ }).describe("Response schema for password validation");
148
133
  export {
149
134
  ConvexUpdate,
150
- ConvexUpdateNested,
151
- DriverIdentity,
152
- DriverLocation,
153
- DriverLogin,
154
- DriverStatus,
155
- HoursOfService,
156
135
  NewLoginRequest,
157
136
  NewLoginResponse,
158
137
  NewLoginResponseFailure,
159
138
  NewLoginResponseSuccess,
160
139
  ScrapeStatus,
161
140
  UpdateScrapeStatusMessage,
162
- VehicleIdentity,
141
+ ValidatePasswordRequestSchema,
142
+ ValidatePasswordResponseSchema,
163
143
  decryptRsaOaepSha256B64,
164
144
  encryptRsaOaepSha256ToB64
165
145
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@findatruck/shared-schemas",
3
- "version": "0.13.0",
3
+ "version": "2.0.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",