@findatruck/shared-schemas 0.6.0 → 0.8.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 +42 -1
- package/dist/index.d.cts +106 -4
- package/dist/index.d.ts +106 -4
- package/dist/index.js +38 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -32,6 +32,7 @@ var index_exports = {};
|
|
|
32
32
|
__export(index_exports, {
|
|
33
33
|
ConvexUpdate: () => ConvexUpdate,
|
|
34
34
|
ConvexUpdateNested: () => ConvexUpdateNested,
|
|
35
|
+
DriverIdentity: () => DriverIdentity,
|
|
35
36
|
DriverLocation: () => DriverLocation,
|
|
36
37
|
DriverLogin: () => DriverLogin,
|
|
37
38
|
DriverStatus: () => DriverStatus,
|
|
@@ -40,6 +41,9 @@ __export(index_exports, {
|
|
|
40
41
|
NewLoginResponse: () => NewLoginResponse,
|
|
41
42
|
NewLoginResponseFailure: () => NewLoginResponseFailure,
|
|
42
43
|
NewLoginResponseSuccess: () => NewLoginResponseSuccess,
|
|
44
|
+
ScrapeStatus: () => ScrapeStatus,
|
|
45
|
+
UpdateScrapeStatusMessage: () => UpdateScrapeStatusMessage,
|
|
46
|
+
VehicleIdentity: () => VehicleIdentity,
|
|
43
47
|
decryptRsaOaepSha256B64: () => decryptRsaOaepSha256B64,
|
|
44
48
|
encryptRsaOaepSha256ToB64: () => encryptRsaOaepSha256ToB64
|
|
45
49
|
});
|
|
@@ -103,6 +107,10 @@ var ConvexUpdate = import_zod2.default.object({
|
|
|
103
107
|
username: import_zod2.default.string().describe("The driver's login username"),
|
|
104
108
|
password: import_zod2.default.string().describe("The driver's login password"),
|
|
105
109
|
driver_id: import_zod2.default.string().optional().describe("The ELD's internal driver ID"),
|
|
110
|
+
driver_first_name: import_zod2.default.string().optional().describe("The driver's first name"),
|
|
111
|
+
driver_last_name: import_zod2.default.string().optional().describe("The driver's last name"),
|
|
112
|
+
driver_name: import_zod2.default.string().optional().describe("The driver's full name"),
|
|
113
|
+
vehicle_id: import_zod2.default.string().optional().describe("The vehicle ID"),
|
|
106
114
|
driver_status: import_zod2.default.string().describe("The driver's duty status (direct from ELD)"),
|
|
107
115
|
time_remaining_in_shift: import_zod2.default.number().describe("Seconds remaining in current shift"),
|
|
108
116
|
time_remaining_till_break: import_zod2.default.number().describe("Seconds remaining until next required break"),
|
|
@@ -131,8 +139,18 @@ var DriverLogin = import_zod2.default.object({
|
|
|
131
139
|
username: import_zod2.default.string().describe("The driver's login username"),
|
|
132
140
|
password: import_zod2.default.string().describe("The driver's login password")
|
|
133
141
|
}).describe("Schema for driver login information");
|
|
134
|
-
var
|
|
142
|
+
var DriverIdentity = import_zod2.default.object({
|
|
135
143
|
driverId: import_zod2.default.string().describe("The ELD's internal driver ID"),
|
|
144
|
+
driverFirstName: import_zod2.default.string().optional().describe("The driver's first name"),
|
|
145
|
+
driverLastName: import_zod2.default.string().optional().describe("The driver's last name"),
|
|
146
|
+
driverName: import_zod2.default.string().optional().describe("The driver's full name")
|
|
147
|
+
}).describe("Schema for identifying the driver");
|
|
148
|
+
var VehicleIdentity = import_zod2.default.object({
|
|
149
|
+
vehicleId: import_zod2.default.string().optional().describe("The vehicle ID")
|
|
150
|
+
}).describe("Schema for identifying the vehicle");
|
|
151
|
+
var ConvexUpdateNested = import_zod2.default.object({
|
|
152
|
+
driver: DriverIdentity,
|
|
153
|
+
vehicle: VehicleIdentity,
|
|
136
154
|
hoursOfService: HoursOfService,
|
|
137
155
|
driverLocation: DriverLocation,
|
|
138
156
|
driverStatus: DriverStatus,
|
|
@@ -164,10 +182,30 @@ function decryptRsaOaepSha256B64(ciphertextB64, privateKeyPem, passphrase) {
|
|
|
164
182
|
);
|
|
165
183
|
return plaintext.toString("utf8");
|
|
166
184
|
}
|
|
185
|
+
|
|
186
|
+
// src/schemas/update-status.ts
|
|
187
|
+
var import_zod3 = __toESM(require("zod"), 1);
|
|
188
|
+
var ScrapeStatus = /* @__PURE__ */ ((ScrapeStatus2) => {
|
|
189
|
+
ScrapeStatus2["NEW_LOGIN_RECEIVED"] = "NEW_LOGIN_RECEIVED";
|
|
190
|
+
ScrapeStatus2["LOGIN_IN_PROGRESS"] = "LOGIN_IN_PROGRESS";
|
|
191
|
+
ScrapeStatus2["LOGIN_SUCCESS"] = "LOGIN_SUCCESS";
|
|
192
|
+
ScrapeStatus2["LOGIN_FAILED"] = "LOGIN_FAILED";
|
|
193
|
+
ScrapeStatus2["DATA_FETCH_IN_PROGRESS"] = "DATA_FETCH_IN_PROGRESS";
|
|
194
|
+
ScrapeStatus2["DATA_FETCH_SUCCESS"] = "DATA_FETCH_SUCCESS";
|
|
195
|
+
ScrapeStatus2["DATA_FETCH_FAILED"] = "DATA_FETCH_FAILED";
|
|
196
|
+
return ScrapeStatus2;
|
|
197
|
+
})(ScrapeStatus || {});
|
|
198
|
+
var UpdateScrapeStatusMessage = import_zod3.default.object({
|
|
199
|
+
status: import_zod3.default.nativeEnum(ScrapeStatus).describe("The current status of the scrape process"),
|
|
200
|
+
username: import_zod3.default.string().describe("The username of the driver whose status is being updated"),
|
|
201
|
+
providerUrl: import_zod3.default.string().describe("The URL of the ELD provider"),
|
|
202
|
+
password: import_zod3.default.string().describe("The encrypted password of the driver whose status is being updated")
|
|
203
|
+
}).describe("Schema for update status messages");
|
|
167
204
|
// Annotate the CommonJS export names for ESM import in node:
|
|
168
205
|
0 && (module.exports = {
|
|
169
206
|
ConvexUpdate,
|
|
170
207
|
ConvexUpdateNested,
|
|
208
|
+
DriverIdentity,
|
|
171
209
|
DriverLocation,
|
|
172
210
|
DriverLogin,
|
|
173
211
|
DriverStatus,
|
|
@@ -176,6 +214,9 @@ function decryptRsaOaepSha256B64(ciphertextB64, privateKeyPem, passphrase) {
|
|
|
176
214
|
NewLoginResponse,
|
|
177
215
|
NewLoginResponseFailure,
|
|
178
216
|
NewLoginResponseSuccess,
|
|
217
|
+
ScrapeStatus,
|
|
218
|
+
UpdateScrapeStatusMessage,
|
|
219
|
+
VehicleIdentity,
|
|
179
220
|
decryptRsaOaepSha256B64,
|
|
180
221
|
encryptRsaOaepSha256ToB64
|
|
181
222
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -150,6 +150,10 @@ declare const ConvexUpdate: z$1.ZodObject<{
|
|
|
150
150
|
username: z$1.ZodString;
|
|
151
151
|
password: z$1.ZodString;
|
|
152
152
|
driver_id: z$1.ZodOptional<z$1.ZodString>;
|
|
153
|
+
driver_first_name: z$1.ZodOptional<z$1.ZodString>;
|
|
154
|
+
driver_last_name: z$1.ZodOptional<z$1.ZodString>;
|
|
155
|
+
driver_name: z$1.ZodOptional<z$1.ZodString>;
|
|
156
|
+
vehicle_id: z$1.ZodOptional<z$1.ZodString>;
|
|
153
157
|
driver_status: z$1.ZodString;
|
|
154
158
|
time_remaining_in_shift: z$1.ZodNumber;
|
|
155
159
|
time_remaining_till_break: z$1.ZodNumber;
|
|
@@ -171,6 +175,10 @@ declare const ConvexUpdate: z$1.ZodObject<{
|
|
|
171
175
|
driver_current_location_longitude: number;
|
|
172
176
|
driver_current_location_address: string;
|
|
173
177
|
driver_id?: string | undefined;
|
|
178
|
+
driver_first_name?: string | undefined;
|
|
179
|
+
driver_last_name?: string | undefined;
|
|
180
|
+
driver_name?: string | undefined;
|
|
181
|
+
vehicle_id?: string | undefined;
|
|
174
182
|
}, {
|
|
175
183
|
providerUrl: string;
|
|
176
184
|
username: string;
|
|
@@ -184,6 +192,10 @@ declare const ConvexUpdate: z$1.ZodObject<{
|
|
|
184
192
|
driver_current_location_longitude: number;
|
|
185
193
|
driver_current_location_address: string;
|
|
186
194
|
driver_id?: string | undefined;
|
|
195
|
+
driver_first_name?: string | undefined;
|
|
196
|
+
driver_last_name?: string | undefined;
|
|
197
|
+
driver_name?: string | undefined;
|
|
198
|
+
vehicle_id?: string | undefined;
|
|
187
199
|
}>;
|
|
188
200
|
type ConvexUpdate = z$1.infer<typeof ConvexUpdate>;
|
|
189
201
|
declare const HoursOfService: z$1.ZodObject<{
|
|
@@ -239,8 +251,55 @@ declare const DriverLogin: z$1.ZodObject<{
|
|
|
239
251
|
password: string;
|
|
240
252
|
}>;
|
|
241
253
|
type DriverLogin = z$1.infer<typeof DriverLogin>;
|
|
242
|
-
declare const
|
|
254
|
+
declare const DriverIdentity: z$1.ZodObject<{
|
|
243
255
|
driverId: z$1.ZodString;
|
|
256
|
+
driverFirstName: z$1.ZodOptional<z$1.ZodString>;
|
|
257
|
+
driverLastName: z$1.ZodOptional<z$1.ZodString>;
|
|
258
|
+
driverName: z$1.ZodOptional<z$1.ZodString>;
|
|
259
|
+
}, "strip", z$1.ZodTypeAny, {
|
|
260
|
+
driverId: string;
|
|
261
|
+
driverFirstName?: string | undefined;
|
|
262
|
+
driverLastName?: string | undefined;
|
|
263
|
+
driverName?: string | undefined;
|
|
264
|
+
}, {
|
|
265
|
+
driverId: string;
|
|
266
|
+
driverFirstName?: string | undefined;
|
|
267
|
+
driverLastName?: string | undefined;
|
|
268
|
+
driverName?: string | undefined;
|
|
269
|
+
}>;
|
|
270
|
+
type DriverIdentity = z$1.infer<typeof DriverIdentity>;
|
|
271
|
+
declare const VehicleIdentity: z$1.ZodObject<{
|
|
272
|
+
vehicleId: z$1.ZodOptional<z$1.ZodString>;
|
|
273
|
+
}, "strip", z$1.ZodTypeAny, {
|
|
274
|
+
vehicleId?: string | undefined;
|
|
275
|
+
}, {
|
|
276
|
+
vehicleId?: string | undefined;
|
|
277
|
+
}>;
|
|
278
|
+
type VehicleIdentity = z$1.infer<typeof VehicleIdentity>;
|
|
279
|
+
declare const ConvexUpdateNested: z$1.ZodObject<{
|
|
280
|
+
driver: z$1.ZodObject<{
|
|
281
|
+
driverId: z$1.ZodString;
|
|
282
|
+
driverFirstName: z$1.ZodOptional<z$1.ZodString>;
|
|
283
|
+
driverLastName: z$1.ZodOptional<z$1.ZodString>;
|
|
284
|
+
driverName: z$1.ZodOptional<z$1.ZodString>;
|
|
285
|
+
}, "strip", z$1.ZodTypeAny, {
|
|
286
|
+
driverId: string;
|
|
287
|
+
driverFirstName?: string | undefined;
|
|
288
|
+
driverLastName?: string | undefined;
|
|
289
|
+
driverName?: string | undefined;
|
|
290
|
+
}, {
|
|
291
|
+
driverId: string;
|
|
292
|
+
driverFirstName?: string | undefined;
|
|
293
|
+
driverLastName?: string | undefined;
|
|
294
|
+
driverName?: string | undefined;
|
|
295
|
+
}>;
|
|
296
|
+
vehicle: z$1.ZodObject<{
|
|
297
|
+
vehicleId: z$1.ZodOptional<z$1.ZodString>;
|
|
298
|
+
}, "strip", z$1.ZodTypeAny, {
|
|
299
|
+
vehicleId?: string | undefined;
|
|
300
|
+
}, {
|
|
301
|
+
vehicleId?: string | undefined;
|
|
302
|
+
}>;
|
|
244
303
|
hoursOfService: z$1.ZodObject<{
|
|
245
304
|
timeRemainingInShift: z$1.ZodNumber;
|
|
246
305
|
timeRemainingTillBreak: z$1.ZodNumber;
|
|
@@ -291,7 +350,15 @@ declare const ConvexUpdateNested: z$1.ZodObject<{
|
|
|
291
350
|
password: string;
|
|
292
351
|
}>;
|
|
293
352
|
}, "strip", z$1.ZodTypeAny, {
|
|
294
|
-
|
|
353
|
+
driver: {
|
|
354
|
+
driverId: string;
|
|
355
|
+
driverFirstName?: string | undefined;
|
|
356
|
+
driverLastName?: string | undefined;
|
|
357
|
+
driverName?: string | undefined;
|
|
358
|
+
};
|
|
359
|
+
vehicle: {
|
|
360
|
+
vehicleId?: string | undefined;
|
|
361
|
+
};
|
|
295
362
|
hoursOfService: {
|
|
296
363
|
timeRemainingInShift: number;
|
|
297
364
|
timeRemainingTillBreak: number;
|
|
@@ -312,7 +379,15 @@ declare const ConvexUpdateNested: z$1.ZodObject<{
|
|
|
312
379
|
password: string;
|
|
313
380
|
};
|
|
314
381
|
}, {
|
|
315
|
-
|
|
382
|
+
driver: {
|
|
383
|
+
driverId: string;
|
|
384
|
+
driverFirstName?: string | undefined;
|
|
385
|
+
driverLastName?: string | undefined;
|
|
386
|
+
driverName?: string | undefined;
|
|
387
|
+
};
|
|
388
|
+
vehicle: {
|
|
389
|
+
vehicleId?: string | undefined;
|
|
390
|
+
};
|
|
316
391
|
hoursOfService: {
|
|
317
392
|
timeRemainingInShift: number;
|
|
318
393
|
timeRemainingTillBreak: number;
|
|
@@ -338,4 +413,31 @@ type ConvexUpdateNested = z$1.infer<typeof ConvexUpdateNested>;
|
|
|
338
413
|
declare function encryptRsaOaepSha256ToB64(plaintext: string, publicKeyPem: string): string;
|
|
339
414
|
declare function decryptRsaOaepSha256B64(ciphertextB64: string, privateKeyPem: string, passphrase?: string): string;
|
|
340
415
|
|
|
341
|
-
|
|
416
|
+
declare enum ScrapeStatus {
|
|
417
|
+
NEW_LOGIN_RECEIVED = "NEW_LOGIN_RECEIVED",
|
|
418
|
+
LOGIN_IN_PROGRESS = "LOGIN_IN_PROGRESS",
|
|
419
|
+
LOGIN_SUCCESS = "LOGIN_SUCCESS",
|
|
420
|
+
LOGIN_FAILED = "LOGIN_FAILED",
|
|
421
|
+
DATA_FETCH_IN_PROGRESS = "DATA_FETCH_IN_PROGRESS",
|
|
422
|
+
DATA_FETCH_SUCCESS = "DATA_FETCH_SUCCESS",
|
|
423
|
+
DATA_FETCH_FAILED = "DATA_FETCH_FAILED"
|
|
424
|
+
}
|
|
425
|
+
declare const UpdateScrapeStatusMessage: z$1.ZodObject<{
|
|
426
|
+
status: z$1.ZodNativeEnum<typeof ScrapeStatus>;
|
|
427
|
+
username: z$1.ZodString;
|
|
428
|
+
providerUrl: z$1.ZodString;
|
|
429
|
+
password: z$1.ZodString;
|
|
430
|
+
}, "strip", z$1.ZodTypeAny, {
|
|
431
|
+
providerUrl: string;
|
|
432
|
+
username: string;
|
|
433
|
+
password: string;
|
|
434
|
+
status: ScrapeStatus;
|
|
435
|
+
}, {
|
|
436
|
+
providerUrl: string;
|
|
437
|
+
username: string;
|
|
438
|
+
password: string;
|
|
439
|
+
status: ScrapeStatus;
|
|
440
|
+
}>;
|
|
441
|
+
type UpdateScrapeStatusMessage = z$1.infer<typeof UpdateScrapeStatusMessage>;
|
|
442
|
+
|
|
443
|
+
export { ConvexUpdate, ConvexUpdateNested, DriverIdentity, DriverLocation, DriverLogin, DriverStatus, HoursOfService, NewLoginRequest, NewLoginResponse, NewLoginResponseFailure, NewLoginResponseSuccess, ScrapeStatus, UpdateScrapeStatusMessage, VehicleIdentity, decryptRsaOaepSha256B64, encryptRsaOaepSha256ToB64 };
|
package/dist/index.d.ts
CHANGED
|
@@ -150,6 +150,10 @@ declare const ConvexUpdate: z$1.ZodObject<{
|
|
|
150
150
|
username: z$1.ZodString;
|
|
151
151
|
password: z$1.ZodString;
|
|
152
152
|
driver_id: z$1.ZodOptional<z$1.ZodString>;
|
|
153
|
+
driver_first_name: z$1.ZodOptional<z$1.ZodString>;
|
|
154
|
+
driver_last_name: z$1.ZodOptional<z$1.ZodString>;
|
|
155
|
+
driver_name: z$1.ZodOptional<z$1.ZodString>;
|
|
156
|
+
vehicle_id: z$1.ZodOptional<z$1.ZodString>;
|
|
153
157
|
driver_status: z$1.ZodString;
|
|
154
158
|
time_remaining_in_shift: z$1.ZodNumber;
|
|
155
159
|
time_remaining_till_break: z$1.ZodNumber;
|
|
@@ -171,6 +175,10 @@ declare const ConvexUpdate: z$1.ZodObject<{
|
|
|
171
175
|
driver_current_location_longitude: number;
|
|
172
176
|
driver_current_location_address: string;
|
|
173
177
|
driver_id?: string | undefined;
|
|
178
|
+
driver_first_name?: string | undefined;
|
|
179
|
+
driver_last_name?: string | undefined;
|
|
180
|
+
driver_name?: string | undefined;
|
|
181
|
+
vehicle_id?: string | undefined;
|
|
174
182
|
}, {
|
|
175
183
|
providerUrl: string;
|
|
176
184
|
username: string;
|
|
@@ -184,6 +192,10 @@ declare const ConvexUpdate: z$1.ZodObject<{
|
|
|
184
192
|
driver_current_location_longitude: number;
|
|
185
193
|
driver_current_location_address: string;
|
|
186
194
|
driver_id?: string | undefined;
|
|
195
|
+
driver_first_name?: string | undefined;
|
|
196
|
+
driver_last_name?: string | undefined;
|
|
197
|
+
driver_name?: string | undefined;
|
|
198
|
+
vehicle_id?: string | undefined;
|
|
187
199
|
}>;
|
|
188
200
|
type ConvexUpdate = z$1.infer<typeof ConvexUpdate>;
|
|
189
201
|
declare const HoursOfService: z$1.ZodObject<{
|
|
@@ -239,8 +251,55 @@ declare const DriverLogin: z$1.ZodObject<{
|
|
|
239
251
|
password: string;
|
|
240
252
|
}>;
|
|
241
253
|
type DriverLogin = z$1.infer<typeof DriverLogin>;
|
|
242
|
-
declare const
|
|
254
|
+
declare const DriverIdentity: z$1.ZodObject<{
|
|
243
255
|
driverId: z$1.ZodString;
|
|
256
|
+
driverFirstName: z$1.ZodOptional<z$1.ZodString>;
|
|
257
|
+
driverLastName: z$1.ZodOptional<z$1.ZodString>;
|
|
258
|
+
driverName: z$1.ZodOptional<z$1.ZodString>;
|
|
259
|
+
}, "strip", z$1.ZodTypeAny, {
|
|
260
|
+
driverId: string;
|
|
261
|
+
driverFirstName?: string | undefined;
|
|
262
|
+
driverLastName?: string | undefined;
|
|
263
|
+
driverName?: string | undefined;
|
|
264
|
+
}, {
|
|
265
|
+
driverId: string;
|
|
266
|
+
driverFirstName?: string | undefined;
|
|
267
|
+
driverLastName?: string | undefined;
|
|
268
|
+
driverName?: string | undefined;
|
|
269
|
+
}>;
|
|
270
|
+
type DriverIdentity = z$1.infer<typeof DriverIdentity>;
|
|
271
|
+
declare const VehicleIdentity: z$1.ZodObject<{
|
|
272
|
+
vehicleId: z$1.ZodOptional<z$1.ZodString>;
|
|
273
|
+
}, "strip", z$1.ZodTypeAny, {
|
|
274
|
+
vehicleId?: string | undefined;
|
|
275
|
+
}, {
|
|
276
|
+
vehicleId?: string | undefined;
|
|
277
|
+
}>;
|
|
278
|
+
type VehicleIdentity = z$1.infer<typeof VehicleIdentity>;
|
|
279
|
+
declare const ConvexUpdateNested: z$1.ZodObject<{
|
|
280
|
+
driver: z$1.ZodObject<{
|
|
281
|
+
driverId: z$1.ZodString;
|
|
282
|
+
driverFirstName: z$1.ZodOptional<z$1.ZodString>;
|
|
283
|
+
driverLastName: z$1.ZodOptional<z$1.ZodString>;
|
|
284
|
+
driverName: z$1.ZodOptional<z$1.ZodString>;
|
|
285
|
+
}, "strip", z$1.ZodTypeAny, {
|
|
286
|
+
driverId: string;
|
|
287
|
+
driverFirstName?: string | undefined;
|
|
288
|
+
driverLastName?: string | undefined;
|
|
289
|
+
driverName?: string | undefined;
|
|
290
|
+
}, {
|
|
291
|
+
driverId: string;
|
|
292
|
+
driverFirstName?: string | undefined;
|
|
293
|
+
driverLastName?: string | undefined;
|
|
294
|
+
driverName?: string | undefined;
|
|
295
|
+
}>;
|
|
296
|
+
vehicle: z$1.ZodObject<{
|
|
297
|
+
vehicleId: z$1.ZodOptional<z$1.ZodString>;
|
|
298
|
+
}, "strip", z$1.ZodTypeAny, {
|
|
299
|
+
vehicleId?: string | undefined;
|
|
300
|
+
}, {
|
|
301
|
+
vehicleId?: string | undefined;
|
|
302
|
+
}>;
|
|
244
303
|
hoursOfService: z$1.ZodObject<{
|
|
245
304
|
timeRemainingInShift: z$1.ZodNumber;
|
|
246
305
|
timeRemainingTillBreak: z$1.ZodNumber;
|
|
@@ -291,7 +350,15 @@ declare const ConvexUpdateNested: z$1.ZodObject<{
|
|
|
291
350
|
password: string;
|
|
292
351
|
}>;
|
|
293
352
|
}, "strip", z$1.ZodTypeAny, {
|
|
294
|
-
|
|
353
|
+
driver: {
|
|
354
|
+
driverId: string;
|
|
355
|
+
driverFirstName?: string | undefined;
|
|
356
|
+
driverLastName?: string | undefined;
|
|
357
|
+
driverName?: string | undefined;
|
|
358
|
+
};
|
|
359
|
+
vehicle: {
|
|
360
|
+
vehicleId?: string | undefined;
|
|
361
|
+
};
|
|
295
362
|
hoursOfService: {
|
|
296
363
|
timeRemainingInShift: number;
|
|
297
364
|
timeRemainingTillBreak: number;
|
|
@@ -312,7 +379,15 @@ declare const ConvexUpdateNested: z$1.ZodObject<{
|
|
|
312
379
|
password: string;
|
|
313
380
|
};
|
|
314
381
|
}, {
|
|
315
|
-
|
|
382
|
+
driver: {
|
|
383
|
+
driverId: string;
|
|
384
|
+
driverFirstName?: string | undefined;
|
|
385
|
+
driverLastName?: string | undefined;
|
|
386
|
+
driverName?: string | undefined;
|
|
387
|
+
};
|
|
388
|
+
vehicle: {
|
|
389
|
+
vehicleId?: string | undefined;
|
|
390
|
+
};
|
|
316
391
|
hoursOfService: {
|
|
317
392
|
timeRemainingInShift: number;
|
|
318
393
|
timeRemainingTillBreak: number;
|
|
@@ -338,4 +413,31 @@ type ConvexUpdateNested = z$1.infer<typeof ConvexUpdateNested>;
|
|
|
338
413
|
declare function encryptRsaOaepSha256ToB64(plaintext: string, publicKeyPem: string): string;
|
|
339
414
|
declare function decryptRsaOaepSha256B64(ciphertextB64: string, privateKeyPem: string, passphrase?: string): string;
|
|
340
415
|
|
|
341
|
-
|
|
416
|
+
declare enum ScrapeStatus {
|
|
417
|
+
NEW_LOGIN_RECEIVED = "NEW_LOGIN_RECEIVED",
|
|
418
|
+
LOGIN_IN_PROGRESS = "LOGIN_IN_PROGRESS",
|
|
419
|
+
LOGIN_SUCCESS = "LOGIN_SUCCESS",
|
|
420
|
+
LOGIN_FAILED = "LOGIN_FAILED",
|
|
421
|
+
DATA_FETCH_IN_PROGRESS = "DATA_FETCH_IN_PROGRESS",
|
|
422
|
+
DATA_FETCH_SUCCESS = "DATA_FETCH_SUCCESS",
|
|
423
|
+
DATA_FETCH_FAILED = "DATA_FETCH_FAILED"
|
|
424
|
+
}
|
|
425
|
+
declare const UpdateScrapeStatusMessage: z$1.ZodObject<{
|
|
426
|
+
status: z$1.ZodNativeEnum<typeof ScrapeStatus>;
|
|
427
|
+
username: z$1.ZodString;
|
|
428
|
+
providerUrl: z$1.ZodString;
|
|
429
|
+
password: z$1.ZodString;
|
|
430
|
+
}, "strip", z$1.ZodTypeAny, {
|
|
431
|
+
providerUrl: string;
|
|
432
|
+
username: string;
|
|
433
|
+
password: string;
|
|
434
|
+
status: ScrapeStatus;
|
|
435
|
+
}, {
|
|
436
|
+
providerUrl: string;
|
|
437
|
+
username: string;
|
|
438
|
+
password: string;
|
|
439
|
+
status: ScrapeStatus;
|
|
440
|
+
}>;
|
|
441
|
+
type UpdateScrapeStatusMessage = z$1.infer<typeof UpdateScrapeStatusMessage>;
|
|
442
|
+
|
|
443
|
+
export { ConvexUpdate, ConvexUpdateNested, DriverIdentity, DriverLocation, DriverLogin, DriverStatus, HoursOfService, NewLoginRequest, NewLoginResponse, NewLoginResponseFailure, NewLoginResponseSuccess, ScrapeStatus, UpdateScrapeStatusMessage, VehicleIdentity, decryptRsaOaepSha256B64, encryptRsaOaepSha256ToB64 };
|
package/dist/index.js
CHANGED
|
@@ -56,6 +56,10 @@ var ConvexUpdate = z2.object({
|
|
|
56
56
|
username: z2.string().describe("The driver's login username"),
|
|
57
57
|
password: z2.string().describe("The driver's login password"),
|
|
58
58
|
driver_id: z2.string().optional().describe("The ELD's internal driver ID"),
|
|
59
|
+
driver_first_name: z2.string().optional().describe("The driver's first name"),
|
|
60
|
+
driver_last_name: z2.string().optional().describe("The driver's last name"),
|
|
61
|
+
driver_name: z2.string().optional().describe("The driver's full name"),
|
|
62
|
+
vehicle_id: z2.string().optional().describe("The vehicle ID"),
|
|
59
63
|
driver_status: z2.string().describe("The driver's duty status (direct from ELD)"),
|
|
60
64
|
time_remaining_in_shift: z2.number().describe("Seconds remaining in current shift"),
|
|
61
65
|
time_remaining_till_break: z2.number().describe("Seconds remaining until next required break"),
|
|
@@ -84,8 +88,18 @@ var DriverLogin = z2.object({
|
|
|
84
88
|
username: z2.string().describe("The driver's login username"),
|
|
85
89
|
password: z2.string().describe("The driver's login password")
|
|
86
90
|
}).describe("Schema for driver login information");
|
|
87
|
-
var
|
|
91
|
+
var DriverIdentity = z2.object({
|
|
88
92
|
driverId: z2.string().describe("The ELD's internal driver ID"),
|
|
93
|
+
driverFirstName: z2.string().optional().describe("The driver's first name"),
|
|
94
|
+
driverLastName: z2.string().optional().describe("The driver's last name"),
|
|
95
|
+
driverName: z2.string().optional().describe("The driver's full name")
|
|
96
|
+
}).describe("Schema for identifying the driver");
|
|
97
|
+
var VehicleIdentity = z2.object({
|
|
98
|
+
vehicleId: z2.string().optional().describe("The vehicle ID")
|
|
99
|
+
}).describe("Schema for identifying the vehicle");
|
|
100
|
+
var ConvexUpdateNested = z2.object({
|
|
101
|
+
driver: DriverIdentity,
|
|
102
|
+
vehicle: VehicleIdentity,
|
|
89
103
|
hoursOfService: HoursOfService,
|
|
90
104
|
driverLocation: DriverLocation,
|
|
91
105
|
driverStatus: DriverStatus,
|
|
@@ -117,9 +131,29 @@ function decryptRsaOaepSha256B64(ciphertextB64, privateKeyPem, passphrase) {
|
|
|
117
131
|
);
|
|
118
132
|
return plaintext.toString("utf8");
|
|
119
133
|
}
|
|
134
|
+
|
|
135
|
+
// src/schemas/update-status.ts
|
|
136
|
+
import z3 from "zod";
|
|
137
|
+
var ScrapeStatus = /* @__PURE__ */ ((ScrapeStatus2) => {
|
|
138
|
+
ScrapeStatus2["NEW_LOGIN_RECEIVED"] = "NEW_LOGIN_RECEIVED";
|
|
139
|
+
ScrapeStatus2["LOGIN_IN_PROGRESS"] = "LOGIN_IN_PROGRESS";
|
|
140
|
+
ScrapeStatus2["LOGIN_SUCCESS"] = "LOGIN_SUCCESS";
|
|
141
|
+
ScrapeStatus2["LOGIN_FAILED"] = "LOGIN_FAILED";
|
|
142
|
+
ScrapeStatus2["DATA_FETCH_IN_PROGRESS"] = "DATA_FETCH_IN_PROGRESS";
|
|
143
|
+
ScrapeStatus2["DATA_FETCH_SUCCESS"] = "DATA_FETCH_SUCCESS";
|
|
144
|
+
ScrapeStatus2["DATA_FETCH_FAILED"] = "DATA_FETCH_FAILED";
|
|
145
|
+
return ScrapeStatus2;
|
|
146
|
+
})(ScrapeStatus || {});
|
|
147
|
+
var UpdateScrapeStatusMessage = z3.object({
|
|
148
|
+
status: z3.nativeEnum(ScrapeStatus).describe("The current status of the scrape process"),
|
|
149
|
+
username: z3.string().describe("The username of the driver whose status is being updated"),
|
|
150
|
+
providerUrl: z3.string().describe("The URL of the ELD provider"),
|
|
151
|
+
password: z3.string().describe("The encrypted password of the driver whose status is being updated")
|
|
152
|
+
}).describe("Schema for update status messages");
|
|
120
153
|
export {
|
|
121
154
|
ConvexUpdate,
|
|
122
155
|
ConvexUpdateNested,
|
|
156
|
+
DriverIdentity,
|
|
123
157
|
DriverLocation,
|
|
124
158
|
DriverLogin,
|
|
125
159
|
DriverStatus,
|
|
@@ -128,6 +162,9 @@ export {
|
|
|
128
162
|
NewLoginResponse,
|
|
129
163
|
NewLoginResponseFailure,
|
|
130
164
|
NewLoginResponseSuccess,
|
|
165
|
+
ScrapeStatus,
|
|
166
|
+
UpdateScrapeStatusMessage,
|
|
167
|
+
VehicleIdentity,
|
|
131
168
|
decryptRsaOaepSha256B64,
|
|
132
169
|
encryptRsaOaepSha256ToB64
|
|
133
170
|
};
|