@findatruck/shared-schemas 0.4.0 → 0.5.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 +76 -0
- package/dist/index.d.cts +192 -2
- package/dist/index.d.ts +192 -2
- package/dist/index.js +60 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,11 +17,25 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
|
|
20
30
|
// src/index.ts
|
|
21
31
|
var index_exports = {};
|
|
22
32
|
__export(index_exports, {
|
|
33
|
+
ConvexUpdate: () => ConvexUpdate,
|
|
34
|
+
ConvexUpdateNested: () => ConvexUpdateNested,
|
|
35
|
+
DriverLocation: () => DriverLocation,
|
|
36
|
+
DriverLogin: () => DriverLogin,
|
|
37
|
+
DriverStatus: () => DriverStatus,
|
|
38
|
+
HoursOfService: () => HoursOfService,
|
|
23
39
|
NewLoginRequest: () => NewLoginRequest,
|
|
24
40
|
NewLoginResponse: () => NewLoginResponse,
|
|
25
41
|
NewLoginResponseFailure: () => NewLoginResponseFailure,
|
|
@@ -66,8 +82,68 @@ var NewLoginResponseFailure = import_zod.z.object({
|
|
|
66
82
|
error: import_zod.z.string()
|
|
67
83
|
});
|
|
68
84
|
var NewLoginResponse = import_zod.z.union([NewLoginResponseSuccess, NewLoginResponseFailure]);
|
|
85
|
+
|
|
86
|
+
// src/schemas/convex-update.ts
|
|
87
|
+
var import_zod2 = __toESM(require("zod"), 1);
|
|
88
|
+
var UrlSchema2 = import_zod2.default.string().refine(
|
|
89
|
+
(val) => {
|
|
90
|
+
try {
|
|
91
|
+
new URL(val);
|
|
92
|
+
return true;
|
|
93
|
+
} catch {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
{ message: "Invalid URL" }
|
|
98
|
+
);
|
|
99
|
+
var ConvexUpdate = import_zod2.default.object({
|
|
100
|
+
providerUrl: UrlSchema2.describe("The URL of the ELD provider"),
|
|
101
|
+
username: import_zod2.default.string().describe("The driver's login username"),
|
|
102
|
+
password: import_zod2.default.string().describe("The driver's login password"),
|
|
103
|
+
driver_id: import_zod2.default.string().optional().describe("The ELD's internal driver ID"),
|
|
104
|
+
driver_status: import_zod2.default.string().describe("The driver's duty status (direct from ELD)"),
|
|
105
|
+
time_remaining_in_shift: import_zod2.default.number().describe("Seconds remaining in current shift"),
|
|
106
|
+
time_remaining_till_break: import_zod2.default.number().describe("Seconds remaining until next required break"),
|
|
107
|
+
time_remaining_in_week: import_zod2.default.number().describe("Seconds remaining in current cycle/week"),
|
|
108
|
+
time_remaining_in_drive: import_zod2.default.number().describe("Seconds remaining in current drive period"),
|
|
109
|
+
driver_current_location_latitude: import_zod2.default.number().describe("Driver's current latitude"),
|
|
110
|
+
driver_current_location_longitude: import_zod2.default.number().describe("Driver's current longitude"),
|
|
111
|
+
driver_current_location_address: import_zod2.default.string().describe("Driver's current address")
|
|
112
|
+
}).describe("Schema for updating driver ELD status information");
|
|
113
|
+
var HoursOfService = import_zod2.default.object({
|
|
114
|
+
timeRemainingInShift: import_zod2.default.number().describe("Seconds remaining in current shift"),
|
|
115
|
+
timeRemainingTillBreak: import_zod2.default.number().describe("Seconds remaining until next required break"),
|
|
116
|
+
timeRemainingInWeek: import_zod2.default.number().describe("Seconds remaining in current cycle/week"),
|
|
117
|
+
timeRemainingInDrive: import_zod2.default.number().describe("Seconds remaining in current drive period")
|
|
118
|
+
}).describe("Schema for driver's hours of service information");
|
|
119
|
+
var DriverLocation = import_zod2.default.object({
|
|
120
|
+
latitude: import_zod2.default.number().describe("Driver's current latitude"),
|
|
121
|
+
longitude: import_zod2.default.number().describe("Driver's current longitude"),
|
|
122
|
+
address: import_zod2.default.string().describe("Driver's current address")
|
|
123
|
+
}).describe("Schema for driver's current location information");
|
|
124
|
+
var DriverStatus = import_zod2.default.object({
|
|
125
|
+
status: import_zod2.default.string().describe("The driver's duty status (direct from ELD)")
|
|
126
|
+
}).describe("Schema for driver's current duty status information");
|
|
127
|
+
var DriverLogin = import_zod2.default.object({
|
|
128
|
+
providerUrl: UrlSchema2.describe("The URL of the ELD provider"),
|
|
129
|
+
username: import_zod2.default.string().describe("The driver's login username"),
|
|
130
|
+
password: import_zod2.default.string().describe("The driver's login password")
|
|
131
|
+
}).describe("Schema for driver login information");
|
|
132
|
+
var ConvexUpdateNested = import_zod2.default.object({
|
|
133
|
+
driverId: import_zod2.default.string().describe("The ELD's internal driver ID"),
|
|
134
|
+
hoursOfService: HoursOfService,
|
|
135
|
+
driverLocation: DriverLocation,
|
|
136
|
+
driverStatus: DriverStatus,
|
|
137
|
+
driverLogin: DriverLogin
|
|
138
|
+
}).describe("Nested schema for updating driver ELD status information");
|
|
69
139
|
// Annotate the CommonJS export names for ESM import in node:
|
|
70
140
|
0 && (module.exports = {
|
|
141
|
+
ConvexUpdate,
|
|
142
|
+
ConvexUpdateNested,
|
|
143
|
+
DriverLocation,
|
|
144
|
+
DriverLogin,
|
|
145
|
+
DriverStatus,
|
|
146
|
+
HoursOfService,
|
|
71
147
|
NewLoginRequest,
|
|
72
148
|
NewLoginResponse,
|
|
73
149
|
NewLoginResponseFailure,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
1
|
+
import z$1, { z } from 'zod';
|
|
2
2
|
|
|
3
3
|
declare const NewLoginRequest: z.ZodObject<{
|
|
4
4
|
providerUrl: z.ZodEffects<z.ZodString, string, string>;
|
|
@@ -145,4 +145,194 @@ declare const NewLoginResponse: z.ZodUnion<[z.ZodObject<{
|
|
|
145
145
|
error: string;
|
|
146
146
|
}>]>;
|
|
147
147
|
|
|
148
|
-
|
|
148
|
+
declare const ConvexUpdate: z$1.ZodObject<{
|
|
149
|
+
providerUrl: z$1.ZodEffects<z$1.ZodString, string, string>;
|
|
150
|
+
username: z$1.ZodString;
|
|
151
|
+
password: z$1.ZodString;
|
|
152
|
+
driver_id: z$1.ZodOptional<z$1.ZodString>;
|
|
153
|
+
driver_status: z$1.ZodString;
|
|
154
|
+
time_remaining_in_shift: z$1.ZodNumber;
|
|
155
|
+
time_remaining_till_break: z$1.ZodNumber;
|
|
156
|
+
time_remaining_in_week: z$1.ZodNumber;
|
|
157
|
+
time_remaining_in_drive: z$1.ZodNumber;
|
|
158
|
+
driver_current_location_latitude: z$1.ZodNumber;
|
|
159
|
+
driver_current_location_longitude: z$1.ZodNumber;
|
|
160
|
+
driver_current_location_address: z$1.ZodString;
|
|
161
|
+
}, "strip", z$1.ZodTypeAny, {
|
|
162
|
+
providerUrl: string;
|
|
163
|
+
username: string;
|
|
164
|
+
password: string;
|
|
165
|
+
driver_status: string;
|
|
166
|
+
time_remaining_in_shift: number;
|
|
167
|
+
time_remaining_till_break: number;
|
|
168
|
+
time_remaining_in_week: number;
|
|
169
|
+
time_remaining_in_drive: number;
|
|
170
|
+
driver_current_location_latitude: number;
|
|
171
|
+
driver_current_location_longitude: number;
|
|
172
|
+
driver_current_location_address: string;
|
|
173
|
+
driver_id?: string | undefined;
|
|
174
|
+
}, {
|
|
175
|
+
providerUrl: string;
|
|
176
|
+
username: string;
|
|
177
|
+
password: string;
|
|
178
|
+
driver_status: string;
|
|
179
|
+
time_remaining_in_shift: number;
|
|
180
|
+
time_remaining_till_break: number;
|
|
181
|
+
time_remaining_in_week: number;
|
|
182
|
+
time_remaining_in_drive: number;
|
|
183
|
+
driver_current_location_latitude: number;
|
|
184
|
+
driver_current_location_longitude: number;
|
|
185
|
+
driver_current_location_address: string;
|
|
186
|
+
driver_id?: string | undefined;
|
|
187
|
+
}>;
|
|
188
|
+
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
|
+
providerUrl: string;
|
|
234
|
+
username: string;
|
|
235
|
+
password: string;
|
|
236
|
+
}, {
|
|
237
|
+
providerUrl: string;
|
|
238
|
+
username: string;
|
|
239
|
+
password: string;
|
|
240
|
+
}>;
|
|
241
|
+
type DriverLogin = z$1.infer<typeof DriverLogin>;
|
|
242
|
+
declare const ConvexUpdateNested: z$1.ZodObject<{
|
|
243
|
+
driverId: z$1.ZodString;
|
|
244
|
+
hoursOfService: z$1.ZodObject<{
|
|
245
|
+
timeRemainingInShift: z$1.ZodNumber;
|
|
246
|
+
timeRemainingTillBreak: z$1.ZodNumber;
|
|
247
|
+
timeRemainingInWeek: z$1.ZodNumber;
|
|
248
|
+
timeRemainingInDrive: z$1.ZodNumber;
|
|
249
|
+
}, "strip", z$1.ZodTypeAny, {
|
|
250
|
+
timeRemainingInShift: number;
|
|
251
|
+
timeRemainingTillBreak: number;
|
|
252
|
+
timeRemainingInWeek: number;
|
|
253
|
+
timeRemainingInDrive: number;
|
|
254
|
+
}, {
|
|
255
|
+
timeRemainingInShift: number;
|
|
256
|
+
timeRemainingTillBreak: number;
|
|
257
|
+
timeRemainingInWeek: number;
|
|
258
|
+
timeRemainingInDrive: number;
|
|
259
|
+
}>;
|
|
260
|
+
driverLocation: z$1.ZodObject<{
|
|
261
|
+
latitude: z$1.ZodNumber;
|
|
262
|
+
longitude: z$1.ZodNumber;
|
|
263
|
+
address: z$1.ZodString;
|
|
264
|
+
}, "strip", z$1.ZodTypeAny, {
|
|
265
|
+
latitude: number;
|
|
266
|
+
longitude: number;
|
|
267
|
+
address: string;
|
|
268
|
+
}, {
|
|
269
|
+
latitude: number;
|
|
270
|
+
longitude: number;
|
|
271
|
+
address: string;
|
|
272
|
+
}>;
|
|
273
|
+
driverStatus: z$1.ZodObject<{
|
|
274
|
+
status: z$1.ZodString;
|
|
275
|
+
}, "strip", z$1.ZodTypeAny, {
|
|
276
|
+
status: string;
|
|
277
|
+
}, {
|
|
278
|
+
status: string;
|
|
279
|
+
}>;
|
|
280
|
+
driverLogin: z$1.ZodObject<{
|
|
281
|
+
providerUrl: z$1.ZodEffects<z$1.ZodString, string, string>;
|
|
282
|
+
username: z$1.ZodString;
|
|
283
|
+
password: z$1.ZodString;
|
|
284
|
+
}, "strip", z$1.ZodTypeAny, {
|
|
285
|
+
providerUrl: string;
|
|
286
|
+
username: string;
|
|
287
|
+
password: string;
|
|
288
|
+
}, {
|
|
289
|
+
providerUrl: string;
|
|
290
|
+
username: string;
|
|
291
|
+
password: string;
|
|
292
|
+
}>;
|
|
293
|
+
}, "strip", z$1.ZodTypeAny, {
|
|
294
|
+
driverId: string;
|
|
295
|
+
hoursOfService: {
|
|
296
|
+
timeRemainingInShift: number;
|
|
297
|
+
timeRemainingTillBreak: number;
|
|
298
|
+
timeRemainingInWeek: number;
|
|
299
|
+
timeRemainingInDrive: number;
|
|
300
|
+
};
|
|
301
|
+
driverLocation: {
|
|
302
|
+
latitude: number;
|
|
303
|
+
longitude: number;
|
|
304
|
+
address: string;
|
|
305
|
+
};
|
|
306
|
+
driverStatus: {
|
|
307
|
+
status: string;
|
|
308
|
+
};
|
|
309
|
+
driverLogin: {
|
|
310
|
+
providerUrl: string;
|
|
311
|
+
username: string;
|
|
312
|
+
password: string;
|
|
313
|
+
};
|
|
314
|
+
}, {
|
|
315
|
+
driverId: string;
|
|
316
|
+
hoursOfService: {
|
|
317
|
+
timeRemainingInShift: number;
|
|
318
|
+
timeRemainingTillBreak: number;
|
|
319
|
+
timeRemainingInWeek: number;
|
|
320
|
+
timeRemainingInDrive: number;
|
|
321
|
+
};
|
|
322
|
+
driverLocation: {
|
|
323
|
+
latitude: number;
|
|
324
|
+
longitude: number;
|
|
325
|
+
address: string;
|
|
326
|
+
};
|
|
327
|
+
driverStatus: {
|
|
328
|
+
status: string;
|
|
329
|
+
};
|
|
330
|
+
driverLogin: {
|
|
331
|
+
providerUrl: string;
|
|
332
|
+
username: string;
|
|
333
|
+
password: string;
|
|
334
|
+
};
|
|
335
|
+
}>;
|
|
336
|
+
type ConvexUpdateNested = z$1.infer<typeof ConvexUpdateNested>;
|
|
337
|
+
|
|
338
|
+
export { ConvexUpdate, ConvexUpdateNested, DriverLocation, DriverLogin, DriverStatus, HoursOfService, NewLoginRequest, NewLoginResponse, NewLoginResponseFailure, NewLoginResponseSuccess };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
1
|
+
import z$1, { z } from 'zod';
|
|
2
2
|
|
|
3
3
|
declare const NewLoginRequest: z.ZodObject<{
|
|
4
4
|
providerUrl: z.ZodEffects<z.ZodString, string, string>;
|
|
@@ -145,4 +145,194 @@ declare const NewLoginResponse: z.ZodUnion<[z.ZodObject<{
|
|
|
145
145
|
error: string;
|
|
146
146
|
}>]>;
|
|
147
147
|
|
|
148
|
-
|
|
148
|
+
declare const ConvexUpdate: z$1.ZodObject<{
|
|
149
|
+
providerUrl: z$1.ZodEffects<z$1.ZodString, string, string>;
|
|
150
|
+
username: z$1.ZodString;
|
|
151
|
+
password: z$1.ZodString;
|
|
152
|
+
driver_id: z$1.ZodOptional<z$1.ZodString>;
|
|
153
|
+
driver_status: z$1.ZodString;
|
|
154
|
+
time_remaining_in_shift: z$1.ZodNumber;
|
|
155
|
+
time_remaining_till_break: z$1.ZodNumber;
|
|
156
|
+
time_remaining_in_week: z$1.ZodNumber;
|
|
157
|
+
time_remaining_in_drive: z$1.ZodNumber;
|
|
158
|
+
driver_current_location_latitude: z$1.ZodNumber;
|
|
159
|
+
driver_current_location_longitude: z$1.ZodNumber;
|
|
160
|
+
driver_current_location_address: z$1.ZodString;
|
|
161
|
+
}, "strip", z$1.ZodTypeAny, {
|
|
162
|
+
providerUrl: string;
|
|
163
|
+
username: string;
|
|
164
|
+
password: string;
|
|
165
|
+
driver_status: string;
|
|
166
|
+
time_remaining_in_shift: number;
|
|
167
|
+
time_remaining_till_break: number;
|
|
168
|
+
time_remaining_in_week: number;
|
|
169
|
+
time_remaining_in_drive: number;
|
|
170
|
+
driver_current_location_latitude: number;
|
|
171
|
+
driver_current_location_longitude: number;
|
|
172
|
+
driver_current_location_address: string;
|
|
173
|
+
driver_id?: string | undefined;
|
|
174
|
+
}, {
|
|
175
|
+
providerUrl: string;
|
|
176
|
+
username: string;
|
|
177
|
+
password: string;
|
|
178
|
+
driver_status: string;
|
|
179
|
+
time_remaining_in_shift: number;
|
|
180
|
+
time_remaining_till_break: number;
|
|
181
|
+
time_remaining_in_week: number;
|
|
182
|
+
time_remaining_in_drive: number;
|
|
183
|
+
driver_current_location_latitude: number;
|
|
184
|
+
driver_current_location_longitude: number;
|
|
185
|
+
driver_current_location_address: string;
|
|
186
|
+
driver_id?: string | undefined;
|
|
187
|
+
}>;
|
|
188
|
+
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
|
+
providerUrl: string;
|
|
234
|
+
username: string;
|
|
235
|
+
password: string;
|
|
236
|
+
}, {
|
|
237
|
+
providerUrl: string;
|
|
238
|
+
username: string;
|
|
239
|
+
password: string;
|
|
240
|
+
}>;
|
|
241
|
+
type DriverLogin = z$1.infer<typeof DriverLogin>;
|
|
242
|
+
declare const ConvexUpdateNested: z$1.ZodObject<{
|
|
243
|
+
driverId: z$1.ZodString;
|
|
244
|
+
hoursOfService: z$1.ZodObject<{
|
|
245
|
+
timeRemainingInShift: z$1.ZodNumber;
|
|
246
|
+
timeRemainingTillBreak: z$1.ZodNumber;
|
|
247
|
+
timeRemainingInWeek: z$1.ZodNumber;
|
|
248
|
+
timeRemainingInDrive: z$1.ZodNumber;
|
|
249
|
+
}, "strip", z$1.ZodTypeAny, {
|
|
250
|
+
timeRemainingInShift: number;
|
|
251
|
+
timeRemainingTillBreak: number;
|
|
252
|
+
timeRemainingInWeek: number;
|
|
253
|
+
timeRemainingInDrive: number;
|
|
254
|
+
}, {
|
|
255
|
+
timeRemainingInShift: number;
|
|
256
|
+
timeRemainingTillBreak: number;
|
|
257
|
+
timeRemainingInWeek: number;
|
|
258
|
+
timeRemainingInDrive: number;
|
|
259
|
+
}>;
|
|
260
|
+
driverLocation: z$1.ZodObject<{
|
|
261
|
+
latitude: z$1.ZodNumber;
|
|
262
|
+
longitude: z$1.ZodNumber;
|
|
263
|
+
address: z$1.ZodString;
|
|
264
|
+
}, "strip", z$1.ZodTypeAny, {
|
|
265
|
+
latitude: number;
|
|
266
|
+
longitude: number;
|
|
267
|
+
address: string;
|
|
268
|
+
}, {
|
|
269
|
+
latitude: number;
|
|
270
|
+
longitude: number;
|
|
271
|
+
address: string;
|
|
272
|
+
}>;
|
|
273
|
+
driverStatus: z$1.ZodObject<{
|
|
274
|
+
status: z$1.ZodString;
|
|
275
|
+
}, "strip", z$1.ZodTypeAny, {
|
|
276
|
+
status: string;
|
|
277
|
+
}, {
|
|
278
|
+
status: string;
|
|
279
|
+
}>;
|
|
280
|
+
driverLogin: z$1.ZodObject<{
|
|
281
|
+
providerUrl: z$1.ZodEffects<z$1.ZodString, string, string>;
|
|
282
|
+
username: z$1.ZodString;
|
|
283
|
+
password: z$1.ZodString;
|
|
284
|
+
}, "strip", z$1.ZodTypeAny, {
|
|
285
|
+
providerUrl: string;
|
|
286
|
+
username: string;
|
|
287
|
+
password: string;
|
|
288
|
+
}, {
|
|
289
|
+
providerUrl: string;
|
|
290
|
+
username: string;
|
|
291
|
+
password: string;
|
|
292
|
+
}>;
|
|
293
|
+
}, "strip", z$1.ZodTypeAny, {
|
|
294
|
+
driverId: string;
|
|
295
|
+
hoursOfService: {
|
|
296
|
+
timeRemainingInShift: number;
|
|
297
|
+
timeRemainingTillBreak: number;
|
|
298
|
+
timeRemainingInWeek: number;
|
|
299
|
+
timeRemainingInDrive: number;
|
|
300
|
+
};
|
|
301
|
+
driverLocation: {
|
|
302
|
+
latitude: number;
|
|
303
|
+
longitude: number;
|
|
304
|
+
address: string;
|
|
305
|
+
};
|
|
306
|
+
driverStatus: {
|
|
307
|
+
status: string;
|
|
308
|
+
};
|
|
309
|
+
driverLogin: {
|
|
310
|
+
providerUrl: string;
|
|
311
|
+
username: string;
|
|
312
|
+
password: string;
|
|
313
|
+
};
|
|
314
|
+
}, {
|
|
315
|
+
driverId: string;
|
|
316
|
+
hoursOfService: {
|
|
317
|
+
timeRemainingInShift: number;
|
|
318
|
+
timeRemainingTillBreak: number;
|
|
319
|
+
timeRemainingInWeek: number;
|
|
320
|
+
timeRemainingInDrive: number;
|
|
321
|
+
};
|
|
322
|
+
driverLocation: {
|
|
323
|
+
latitude: number;
|
|
324
|
+
longitude: number;
|
|
325
|
+
address: string;
|
|
326
|
+
};
|
|
327
|
+
driverStatus: {
|
|
328
|
+
status: string;
|
|
329
|
+
};
|
|
330
|
+
driverLogin: {
|
|
331
|
+
providerUrl: string;
|
|
332
|
+
username: string;
|
|
333
|
+
password: string;
|
|
334
|
+
};
|
|
335
|
+
}>;
|
|
336
|
+
type ConvexUpdateNested = z$1.infer<typeof ConvexUpdateNested>;
|
|
337
|
+
|
|
338
|
+
export { ConvexUpdate, ConvexUpdateNested, DriverLocation, DriverLogin, DriverStatus, HoursOfService, NewLoginRequest, NewLoginResponse, NewLoginResponseFailure, NewLoginResponseSuccess };
|
package/dist/index.js
CHANGED
|
@@ -37,7 +37,67 @@ var NewLoginResponseFailure = z.object({
|
|
|
37
37
|
error: z.string()
|
|
38
38
|
});
|
|
39
39
|
var NewLoginResponse = z.union([NewLoginResponseSuccess, NewLoginResponseFailure]);
|
|
40
|
+
|
|
41
|
+
// src/schemas/convex-update.ts
|
|
42
|
+
import z2 from "zod";
|
|
43
|
+
var UrlSchema2 = z2.string().refine(
|
|
44
|
+
(val) => {
|
|
45
|
+
try {
|
|
46
|
+
new URL(val);
|
|
47
|
+
return true;
|
|
48
|
+
} catch {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
{ message: "Invalid URL" }
|
|
53
|
+
);
|
|
54
|
+
var ConvexUpdate = z2.object({
|
|
55
|
+
providerUrl: UrlSchema2.describe("The URL of the ELD provider"),
|
|
56
|
+
username: z2.string().describe("The driver's login username"),
|
|
57
|
+
password: z2.string().describe("The driver's login password"),
|
|
58
|
+
driver_id: z2.string().optional().describe("The ELD's internal driver ID"),
|
|
59
|
+
driver_status: z2.string().describe("The driver's duty status (direct from ELD)"),
|
|
60
|
+
time_remaining_in_shift: z2.number().describe("Seconds remaining in current shift"),
|
|
61
|
+
time_remaining_till_break: z2.number().describe("Seconds remaining until next required break"),
|
|
62
|
+
time_remaining_in_week: z2.number().describe("Seconds remaining in current cycle/week"),
|
|
63
|
+
time_remaining_in_drive: z2.number().describe("Seconds remaining in current drive period"),
|
|
64
|
+
driver_current_location_latitude: z2.number().describe("Driver's current latitude"),
|
|
65
|
+
driver_current_location_longitude: z2.number().describe("Driver's current longitude"),
|
|
66
|
+
driver_current_location_address: z2.string().describe("Driver's current address")
|
|
67
|
+
}).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 ConvexUpdateNested = z2.object({
|
|
88
|
+
driverId: z2.string().describe("The ELD's internal driver ID"),
|
|
89
|
+
hoursOfService: HoursOfService,
|
|
90
|
+
driverLocation: DriverLocation,
|
|
91
|
+
driverStatus: DriverStatus,
|
|
92
|
+
driverLogin: DriverLogin
|
|
93
|
+
}).describe("Nested schema for updating driver ELD status information");
|
|
40
94
|
export {
|
|
95
|
+
ConvexUpdate,
|
|
96
|
+
ConvexUpdateNested,
|
|
97
|
+
DriverLocation,
|
|
98
|
+
DriverLogin,
|
|
99
|
+
DriverStatus,
|
|
100
|
+
HoursOfService,
|
|
41
101
|
NewLoginRequest,
|
|
42
102
|
NewLoginResponse,
|
|
43
103
|
NewLoginResponseFailure,
|