@findatruck/shared-schemas 2.8.0 → 2.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/browser.js CHANGED
@@ -1,22 +1,36 @@
1
1
  import {
2
2
  BatchConvexUpdate,
3
+ BatchConvexUpdateSchema,
4
+ ConvexDriverSchema,
3
5
  ConvexUpdate,
6
+ ConvexUpdateSchema,
4
7
  NewLoginRequest,
8
+ NewLoginRequestSchema,
5
9
  NewLoginResponse,
6
10
  NewLoginResponseFailure,
11
+ NewLoginResponseFailureSchema,
12
+ NewLoginResponseSchema,
7
13
  NewLoginResponseSuccess,
14
+ NewLoginResponseSuccessSchema,
8
15
  ScrapeStatus,
9
16
  UpdateScrapeStatusMessage,
10
17
  ValidatePasswordRequestSchema,
11
18
  ValidatePasswordResponseSchema
12
- } from "./chunk-3CDH5DV5.js";
19
+ } from "./chunk-CUV2KQXS.js";
13
20
  export {
14
21
  BatchConvexUpdate,
22
+ BatchConvexUpdateSchema,
23
+ ConvexDriverSchema,
15
24
  ConvexUpdate,
25
+ ConvexUpdateSchema,
16
26
  NewLoginRequest,
27
+ NewLoginRequestSchema,
17
28
  NewLoginResponse,
18
29
  NewLoginResponseFailure,
30
+ NewLoginResponseFailureSchema,
31
+ NewLoginResponseSchema,
19
32
  NewLoginResponseSuccess,
33
+ NewLoginResponseSuccessSchema,
20
34
  ScrapeStatus,
21
35
  UpdateScrapeStatusMessage,
22
36
  ValidatePasswordRequestSchema,
@@ -11,7 +11,7 @@ var UrlSchema = z.string().refine(
11
11
  },
12
12
  { message: "Invalid URL" }
13
13
  );
14
- var NewLoginRequest = z.object({
14
+ var NewLoginRequestSchema = z.object({
15
15
  providerUrl: UrlSchema,
16
16
  username: z.string().min(1),
17
17
  encryptedPassword: z.string().min(1),
@@ -19,28 +19,34 @@ var NewLoginRequest = z.object({
19
19
  externalProviderAccountId: z.string(),
20
20
  convexUpdateUrl: z.string().url().describe("The Convex function URL to send updates to")
21
21
  });
22
- var PublicUser = z.object({
22
+ var PublicUserSchema = z.object({
23
23
  id: z.string(),
24
24
  username: z.string(),
25
25
  created_at: z.coerce.date(),
26
26
  updated_at: z.coerce.date()
27
27
  });
28
- var PublicProvider = z.object({
28
+ var PublicProviderSchema = z.object({
29
29
  name: z.string(),
30
30
  url: UrlSchema
31
31
  });
32
- var NewLoginResponseSuccess = z.object({
32
+ var NewLoginResponseSuccessSchema = z.object({
33
+ success: z.boolean().optional(),
33
34
  message: z.string(),
34
- user: PublicUser,
35
- provider: PublicProvider,
35
+ user: PublicUserSchema,
36
+ provider: PublicProviderSchema,
36
37
  driverIds: z.array(z.string()).describe("An array of driver IDs associated with the login"),
37
38
  organizationId: z.string().optional(),
38
39
  honkUserId: z.string().optional()
39
40
  });
40
- var NewLoginResponseFailure = z.object({
41
+ var NewLoginResponseFailureSchema = z.object({
42
+ success: z.boolean().optional(),
41
43
  error: z.string()
42
44
  });
43
- var NewLoginResponse = z.union([NewLoginResponseSuccess, NewLoginResponseFailure]);
45
+ var NewLoginResponseSchema = z.union([NewLoginResponseSuccessSchema, NewLoginResponseFailureSchema]);
46
+ var NewLoginRequest = NewLoginRequestSchema;
47
+ var NewLoginResponseSuccess = NewLoginResponseSuccessSchema;
48
+ var NewLoginResponseFailure = NewLoginResponseFailureSchema;
49
+ var NewLoginResponse = NewLoginResponseSchema;
44
50
 
45
51
  // src/schemas/drivers/convex-update.ts
46
52
  import z2 from "zod";
@@ -55,34 +61,37 @@ var UrlSchema2 = z2.string().refine(
55
61
  },
56
62
  { message: "Invalid URL" }
57
63
  );
58
- var ConvexUpdate = z2.object({
64
+ var ConvexDriverSchema = z2.object({
65
+ driver_name: z2.string().optional().describe("The driver's full name"),
66
+ vehicle_id: z2.string().optional().describe("The vehicle ID"),
67
+ driver_status: z2.string().describe("The driver's duty status (direct from ELD)"),
68
+ time_remaining_in_shift: z2.number().describe("Seconds remaining in current shift"),
69
+ time_remaining_till_break: z2.number().describe("Seconds remaining until next required break"),
70
+ time_remaining_in_week: z2.number().describe("Seconds remaining in current cycle/week"),
71
+ time_remaining_in_drive: z2.number().describe("Seconds remaining in current drive period"),
72
+ driver_current_location_latitude: z2.number().describe("Driver's current latitude"),
73
+ driver_current_location_longitude: z2.number().describe("Driver's current longitude"),
74
+ driver_current_location_address: z2.string().describe("Driver's current address"),
75
+ license_number: z2.string().optional().describe("The driver's license number"),
76
+ license_state: z2.string().optional().describe("The state that issued the driver's license"),
77
+ speed: z2.number().optional().describe("The vehicle's current speed in mph"),
78
+ odometer: z2.number().optional().describe("The vehicle's current odometer reading in miles"),
79
+ convex_provider_account_id: z2.string().describe("The Convex ELD provider account ID"),
80
+ external_provider_account_id: z2.string().describe("The provider account ID on backend"),
81
+ external_driver_id: z2.string().describe("The driver ID on backend"),
82
+ mileage_since_last_update: z2.number().optional().describe("Mileage since last update in miles")
83
+ }).describe("An object containing driver ELD status information");
84
+ var ConvexUpdateSchema = z2.object({
59
85
  provider_url: UrlSchema2.describe("The URL of the ELD provider"),
60
86
  username: z2.string().describe("The ELD account's login username"),
61
- drivers: z2.array(z2.object({
62
- driver_name: z2.string().optional().describe("The driver's full name"),
63
- vehicle_id: z2.string().optional().describe("The vehicle ID"),
64
- driver_status: z2.string().describe("The driver's duty status (direct from ELD)"),
65
- time_remaining_in_shift: z2.number().describe("Seconds remaining in current shift"),
66
- time_remaining_till_break: z2.number().describe("Seconds remaining until next required break"),
67
- time_remaining_in_week: z2.number().describe("Seconds remaining in current cycle/week"),
68
- time_remaining_in_drive: z2.number().describe("Seconds remaining in current drive period"),
69
- driver_current_location_latitude: z2.number().describe("Driver's current latitude"),
70
- driver_current_location_longitude: z2.number().describe("Driver's current longitude"),
71
- driver_current_location_address: z2.string().describe("Driver's current address"),
72
- license_number: z2.string().optional().describe("The driver's license number"),
73
- license_state: z2.string().optional().describe("The state that issued the driver's license"),
74
- speed: z2.number().optional().describe("The vehicle's current speed in mph"),
75
- odometer: z2.number().optional().describe("The vehicle's current odometer reading in miles"),
76
- convex_provider_account_id: z2.string().describe("The Convex ELD provider account ID"),
77
- external_provider_account_id: z2.string().describe("The provider account ID on backend"),
78
- external_driver_id: z2.string().describe("The driver ID on backend"),
79
- mileage_since_last_update: z2.number().optional().describe("Mileage since last update in miles")
80
- }).describe("An object containing driver ELD status information")).describe("An array of driver ELD status updates"),
87
+ drivers: z2.array(ConvexDriverSchema).describe("An array of driver ELD status updates"),
81
88
  version: z2.string().default("2.7.0").describe("The version of the Convex ELD API being used")
82
89
  }).describe("Schema for updating driver ELD status information");
83
- var BatchConvexUpdate = z2.object({
84
- updates: z2.array(ConvexUpdate).describe("An array of Convex ELD driver updates")
90
+ var BatchConvexUpdateSchema = z2.object({
91
+ updates: z2.array(ConvexUpdateSchema).describe("An array of Convex ELD driver updates")
85
92
  }).describe("Schema for batch updating driver ELD status information");
93
+ var ConvexUpdate = ConvexUpdateSchema;
94
+ var BatchConvexUpdate = BatchConvexUpdateSchema;
86
95
 
87
96
  // src/schemas/providerAccounts/update-status.ts
88
97
  import z3 from "zod";
@@ -118,10 +127,17 @@ var ValidatePasswordResponseSchema = z4.object({
118
127
  }).describe("Response schema for password validation");
119
128
 
120
129
  export {
130
+ NewLoginRequestSchema,
131
+ NewLoginResponseSuccessSchema,
132
+ NewLoginResponseFailureSchema,
133
+ NewLoginResponseSchema,
121
134
  NewLoginRequest,
122
135
  NewLoginResponseSuccess,
123
136
  NewLoginResponseFailure,
124
137
  NewLoginResponse,
138
+ ConvexDriverSchema,
139
+ ConvexUpdateSchema,
140
+ BatchConvexUpdateSchema,
125
141
  ConvexUpdate,
126
142
  BatchConvexUpdate,
127
143
  ScrapeStatus,
package/dist/index.cjs CHANGED
@@ -31,12 +31,25 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
31
  var index_exports = {};
32
32
  __export(index_exports, {
33
33
  BatchConvexUpdate: () => BatchConvexUpdate,
34
+ BatchConvexUpdateSchema: () => BatchConvexUpdateSchema,
35
+ ConvexDriverSchema: () => ConvexDriverSchema,
34
36
  ConvexUpdate: () => ConvexUpdate,
37
+ ConvexUpdateSchema: () => ConvexUpdateSchema,
38
+ DriverRankingSchema: () => DriverRankingSchema,
39
+ DriverRankingsRequestSchema: () => DriverRankingsRequestSchema,
40
+ DriverRankingsResponseSchema: () => DriverRankingsResponseSchema,
35
41
  NewLoginRequest: () => NewLoginRequest,
42
+ NewLoginRequestSchema: () => NewLoginRequestSchema,
36
43
  NewLoginResponse: () => NewLoginResponse,
37
44
  NewLoginResponseFailure: () => NewLoginResponseFailure,
45
+ NewLoginResponseFailureSchema: () => NewLoginResponseFailureSchema,
46
+ NewLoginResponseSchema: () => NewLoginResponseSchema,
38
47
  NewLoginResponseSuccess: () => NewLoginResponseSuccess,
48
+ NewLoginResponseSuccessSchema: () => NewLoginResponseSuccessSchema,
39
49
  ScrapeStatus: () => ScrapeStatus,
50
+ StateHeatmapEntrySchema: () => StateHeatmapEntrySchema,
51
+ StateHeatmapRequestSchema: () => StateHeatmapRequestSchema,
52
+ StateHeatmapResponseSchema: () => StateHeatmapResponseSchema,
40
53
  UpdateScrapeStatusMessage: () => UpdateScrapeStatusMessage,
41
54
  ValidatePasswordRequestSchema: () => ValidatePasswordRequestSchema,
42
55
  ValidatePasswordResponseSchema: () => ValidatePasswordResponseSchema,
@@ -58,7 +71,7 @@ var UrlSchema = import_zod.z.string().refine(
58
71
  },
59
72
  { message: "Invalid URL" }
60
73
  );
61
- var NewLoginRequest = import_zod.z.object({
74
+ var NewLoginRequestSchema = import_zod.z.object({
62
75
  providerUrl: UrlSchema,
63
76
  username: import_zod.z.string().min(1),
64
77
  encryptedPassword: import_zod.z.string().min(1),
@@ -66,28 +79,34 @@ var NewLoginRequest = import_zod.z.object({
66
79
  externalProviderAccountId: import_zod.z.string(),
67
80
  convexUpdateUrl: import_zod.z.string().url().describe("The Convex function URL to send updates to")
68
81
  });
69
- var PublicUser = import_zod.z.object({
82
+ var PublicUserSchema = import_zod.z.object({
70
83
  id: import_zod.z.string(),
71
84
  username: import_zod.z.string(),
72
85
  created_at: import_zod.z.coerce.date(),
73
86
  updated_at: import_zod.z.coerce.date()
74
87
  });
75
- var PublicProvider = import_zod.z.object({
88
+ var PublicProviderSchema = import_zod.z.object({
76
89
  name: import_zod.z.string(),
77
90
  url: UrlSchema
78
91
  });
79
- var NewLoginResponseSuccess = import_zod.z.object({
92
+ var NewLoginResponseSuccessSchema = import_zod.z.object({
93
+ success: import_zod.z.boolean().optional(),
80
94
  message: import_zod.z.string(),
81
- user: PublicUser,
82
- provider: PublicProvider,
95
+ user: PublicUserSchema,
96
+ provider: PublicProviderSchema,
83
97
  driverIds: import_zod.z.array(import_zod.z.string()).describe("An array of driver IDs associated with the login"),
84
98
  organizationId: import_zod.z.string().optional(),
85
99
  honkUserId: import_zod.z.string().optional()
86
100
  });
87
- var NewLoginResponseFailure = import_zod.z.object({
101
+ var NewLoginResponseFailureSchema = import_zod.z.object({
102
+ success: import_zod.z.boolean().optional(),
88
103
  error: import_zod.z.string()
89
104
  });
90
- var NewLoginResponse = import_zod.z.union([NewLoginResponseSuccess, NewLoginResponseFailure]);
105
+ var NewLoginResponseSchema = import_zod.z.union([NewLoginResponseSuccessSchema, NewLoginResponseFailureSchema]);
106
+ var NewLoginRequest = NewLoginRequestSchema;
107
+ var NewLoginResponseSuccess = NewLoginResponseSuccessSchema;
108
+ var NewLoginResponseFailure = NewLoginResponseFailureSchema;
109
+ var NewLoginResponse = NewLoginResponseSchema;
91
110
 
92
111
  // src/schemas/drivers/convex-update.ts
93
112
  var import_zod2 = __toESM(require("zod"), 1);
@@ -102,34 +121,37 @@ var UrlSchema2 = import_zod2.default.string().refine(
102
121
  },
103
122
  { message: "Invalid URL" }
104
123
  );
105
- var ConvexUpdate = import_zod2.default.object({
124
+ var ConvexDriverSchema = import_zod2.default.object({
125
+ driver_name: import_zod2.default.string().optional().describe("The driver's full name"),
126
+ vehicle_id: import_zod2.default.string().optional().describe("The vehicle ID"),
127
+ driver_status: import_zod2.default.string().describe("The driver's duty status (direct from ELD)"),
128
+ time_remaining_in_shift: import_zod2.default.number().describe("Seconds remaining in current shift"),
129
+ time_remaining_till_break: import_zod2.default.number().describe("Seconds remaining until next required break"),
130
+ time_remaining_in_week: import_zod2.default.number().describe("Seconds remaining in current cycle/week"),
131
+ time_remaining_in_drive: import_zod2.default.number().describe("Seconds remaining in current drive period"),
132
+ driver_current_location_latitude: import_zod2.default.number().describe("Driver's current latitude"),
133
+ driver_current_location_longitude: import_zod2.default.number().describe("Driver's current longitude"),
134
+ driver_current_location_address: import_zod2.default.string().describe("Driver's current address"),
135
+ license_number: import_zod2.default.string().optional().describe("The driver's license number"),
136
+ license_state: import_zod2.default.string().optional().describe("The state that issued the driver's license"),
137
+ speed: import_zod2.default.number().optional().describe("The vehicle's current speed in mph"),
138
+ odometer: import_zod2.default.number().optional().describe("The vehicle's current odometer reading in miles"),
139
+ convex_provider_account_id: import_zod2.default.string().describe("The Convex ELD provider account ID"),
140
+ external_provider_account_id: import_zod2.default.string().describe("The provider account ID on backend"),
141
+ external_driver_id: import_zod2.default.string().describe("The driver ID on backend"),
142
+ mileage_since_last_update: import_zod2.default.number().optional().describe("Mileage since last update in miles")
143
+ }).describe("An object containing driver ELD status information");
144
+ var ConvexUpdateSchema = import_zod2.default.object({
106
145
  provider_url: UrlSchema2.describe("The URL of the ELD provider"),
107
146
  username: import_zod2.default.string().describe("The ELD account's login username"),
108
- drivers: import_zod2.default.array(import_zod2.default.object({
109
- driver_name: import_zod2.default.string().optional().describe("The driver's full name"),
110
- vehicle_id: import_zod2.default.string().optional().describe("The vehicle ID"),
111
- driver_status: import_zod2.default.string().describe("The driver's duty status (direct from ELD)"),
112
- time_remaining_in_shift: import_zod2.default.number().describe("Seconds remaining in current shift"),
113
- time_remaining_till_break: import_zod2.default.number().describe("Seconds remaining until next required break"),
114
- time_remaining_in_week: import_zod2.default.number().describe("Seconds remaining in current cycle/week"),
115
- time_remaining_in_drive: import_zod2.default.number().describe("Seconds remaining in current drive period"),
116
- driver_current_location_latitude: import_zod2.default.number().describe("Driver's current latitude"),
117
- driver_current_location_longitude: import_zod2.default.number().describe("Driver's current longitude"),
118
- driver_current_location_address: import_zod2.default.string().describe("Driver's current address"),
119
- license_number: import_zod2.default.string().optional().describe("The driver's license number"),
120
- license_state: import_zod2.default.string().optional().describe("The state that issued the driver's license"),
121
- speed: import_zod2.default.number().optional().describe("The vehicle's current speed in mph"),
122
- odometer: import_zod2.default.number().optional().describe("The vehicle's current odometer reading in miles"),
123
- convex_provider_account_id: import_zod2.default.string().describe("The Convex ELD provider account ID"),
124
- external_provider_account_id: import_zod2.default.string().describe("The provider account ID on backend"),
125
- external_driver_id: import_zod2.default.string().describe("The driver ID on backend"),
126
- mileage_since_last_update: import_zod2.default.number().optional().describe("Mileage since last update in miles")
127
- }).describe("An object containing driver ELD status information")).describe("An array of driver ELD status updates"),
147
+ drivers: import_zod2.default.array(ConvexDriverSchema).describe("An array of driver ELD status updates"),
128
148
  version: import_zod2.default.string().default("2.7.0").describe("The version of the Convex ELD API being used")
129
149
  }).describe("Schema for updating driver ELD status information");
130
- var BatchConvexUpdate = import_zod2.default.object({
131
- updates: import_zod2.default.array(ConvexUpdate).describe("An array of Convex ELD driver updates")
150
+ var BatchConvexUpdateSchema = import_zod2.default.object({
151
+ updates: import_zod2.default.array(ConvexUpdateSchema).describe("An array of Convex ELD driver updates")
132
152
  }).describe("Schema for batch updating driver ELD status information");
153
+ var ConvexUpdate = ConvexUpdateSchema;
154
+ var BatchConvexUpdate = BatchConvexUpdateSchema;
133
155
 
134
156
  // src/security/transit-crypto.ts
135
157
  var import_node_crypto = require("crypto");
@@ -189,15 +211,59 @@ var ValidatePasswordResponseSchema = import_zod4.z.object({
189
211
  isValid: import_zod4.z.boolean().describe("Indicates if the provided password is valid"),
190
212
  driverIds: import_zod4.z.array(import_zod4.z.string()).describe("List of driver IDs associated with the provider account")
191
213
  }).describe("Response schema for password validation");
214
+
215
+ // src/schemas/telemetry/driver-rankings.ts
216
+ var import_zod5 = require("zod");
217
+ var DriverRankingsRequestSchema = import_zod5.z.object({
218
+ start_date: import_zod5.z.string().describe("Start date for the ranking period (ISO 8601 format)"),
219
+ end_date: import_zod5.z.string().describe("End date for the ranking period (ISO 8601 format)"),
220
+ state: import_zod5.z.string().length(2).optional().describe("Optional 2-letter state abbreviation to filter telemetry by location")
221
+ }).describe("Request schema for driver rankings by miles driven");
222
+ var DriverRankingSchema = import_zod5.z.object({
223
+ rank: import_zod5.z.number().int().positive().describe("Rank position based on miles driven"),
224
+ driver_id: import_zod5.z.string().uuid().describe("Unique identifier of the driver"),
225
+ driver_name: import_zod5.z.string().describe("Name of the driver"),
226
+ total_miles: import_zod5.z.number().min(0).describe("Total miles driven in the specified period")
227
+ }).describe("Single driver ranking entry");
228
+ var DriverRankingsResponseSchema = import_zod5.z.array(DriverRankingSchema).describe("Array of driver rankings sorted by miles driven in descending order");
229
+
230
+ // src/schemas/telemetry/state-heatmap.ts
231
+ var import_zod6 = require("zod");
232
+ var StateHeatmapRequestSchema = import_zod6.z.object({
233
+ driver_id: import_zod6.z.string().uuid().describe("Unique identifier of the driver"),
234
+ start_date: import_zod6.z.string().describe("Start date for the heatmap period (ISO 8601 format)"),
235
+ end_date: import_zod6.z.string().describe("End date for the heatmap period (ISO 8601 format)")
236
+ }).describe("Request schema for driver state heatmap");
237
+ var StateHeatmapEntrySchema = import_zod6.z.object({
238
+ count: import_zod6.z.number().int().min(0).describe("Number of telemetry points in this state"),
239
+ percentage: import_zod6.z.number().min(0).max(100).describe("Percentage of total telemetry points in this state")
240
+ }).describe("Single state entry in the heatmap");
241
+ var StateHeatmapResponseSchema = import_zod6.z.record(
242
+ import_zod6.z.string().length(2),
243
+ StateHeatmapEntrySchema
244
+ ).describe("Record of 2-letter state codes to heatmap entries");
192
245
  // Annotate the CommonJS export names for ESM import in node:
193
246
  0 && (module.exports = {
194
247
  BatchConvexUpdate,
248
+ BatchConvexUpdateSchema,
249
+ ConvexDriverSchema,
195
250
  ConvexUpdate,
251
+ ConvexUpdateSchema,
252
+ DriverRankingSchema,
253
+ DriverRankingsRequestSchema,
254
+ DriverRankingsResponseSchema,
196
255
  NewLoginRequest,
256
+ NewLoginRequestSchema,
197
257
  NewLoginResponse,
198
258
  NewLoginResponseFailure,
259
+ NewLoginResponseFailureSchema,
260
+ NewLoginResponseSchema,
199
261
  NewLoginResponseSuccess,
262
+ NewLoginResponseSuccessSchema,
200
263
  ScrapeStatus,
264
+ StateHeatmapEntrySchema,
265
+ StateHeatmapRequestSchema,
266
+ StateHeatmapResponseSchema,
201
267
  UpdateScrapeStatusMessage,
202
268
  ValidatePasswordRequestSchema,
203
269
  ValidatePasswordResponseSchema,
package/dist/index.d.cts CHANGED
@@ -1,7 +1,67 @@
1
- export { BatchConvexUpdate, ConvexUpdate, NewLoginRequest, NewLoginResponse, NewLoginResponseFailure, NewLoginResponseSuccess, ScrapeStatus, UpdateScrapeStatusMessage, ValidatePasswordRequest, ValidatePasswordRequestSchema, ValidatePasswordResponse, ValidatePasswordResponseSchema } from './browser.cjs';
2
- import 'zod';
1
+ export { BatchConvexUpdate, BatchConvexUpdateData, BatchConvexUpdateSchema, ConvexDriverData, ConvexDriverSchema, ConvexUpdate, ConvexUpdateData, ConvexUpdateSchema, NewLoginRequest, NewLoginRequestData, NewLoginRequestSchema, NewLoginResponse, NewLoginResponseData, NewLoginResponseFailure, NewLoginResponseFailureData, NewLoginResponseFailureSchema, NewLoginResponseSchema, NewLoginResponseSuccess, NewLoginResponseSuccessData, NewLoginResponseSuccessSchema, PublicProviderData, PublicUserData, ScrapeStatus, UpdateScrapeStatusMessage, ValidatePasswordRequest, ValidatePasswordRequestData, ValidatePasswordRequestSchema, ValidatePasswordResponse, ValidatePasswordResponseData, ValidatePasswordResponseSchema } from './browser.cjs';
2
+ import { z } from 'zod';
3
3
 
4
4
  declare function encryptRsaOaepSha256ToB64(plaintext: string, publicKeyPem: string): string;
5
5
  declare function decryptRsaOaepSha256B64(ciphertextB64: string, privateKeyPem: string, passphrase?: string): string;
6
6
 
7
- export { decryptRsaOaepSha256B64, encryptRsaOaepSha256ToB64 };
7
+ interface DriverRankingsRequestData {
8
+ start_date: string;
9
+ end_date: string;
10
+ state?: string;
11
+ }
12
+ interface DriverRankingData {
13
+ rank: number;
14
+ driver_id: string;
15
+ driver_name: string;
16
+ total_miles: number;
17
+ }
18
+ type DriverRankingsResponseData = DriverRankingData[];
19
+ declare const DriverRankingsRequestSchema: z.ZodObject<{
20
+ start_date: z.ZodString;
21
+ end_date: z.ZodString;
22
+ state: z.ZodOptional<z.ZodString>;
23
+ }, z.core.$strip>;
24
+ declare const DriverRankingSchema: z.ZodObject<{
25
+ rank: z.ZodNumber;
26
+ driver_id: z.ZodString;
27
+ driver_name: z.ZodString;
28
+ total_miles: z.ZodNumber;
29
+ }, z.core.$strip>;
30
+ declare const DriverRankingsResponseSchema: z.ZodArray<z.ZodObject<{
31
+ rank: z.ZodNumber;
32
+ driver_id: z.ZodString;
33
+ driver_name: z.ZodString;
34
+ total_miles: z.ZodNumber;
35
+ }, z.core.$strip>>;
36
+ type DriverRankingsRequest = DriverRankingsRequestData;
37
+ type DriverRanking = DriverRankingData;
38
+ type DriverRankingsResponse = DriverRankingsResponseData;
39
+
40
+ interface StateHeatmapRequestData {
41
+ driver_id: string;
42
+ start_date: string;
43
+ end_date: string;
44
+ }
45
+ interface StateHeatmapEntryData {
46
+ count: number;
47
+ percentage: number;
48
+ }
49
+ type StateHeatmapResponseData = Record<string, StateHeatmapEntryData>;
50
+ declare const StateHeatmapRequestSchema: z.ZodObject<{
51
+ driver_id: z.ZodString;
52
+ start_date: z.ZodString;
53
+ end_date: z.ZodString;
54
+ }, z.core.$strip>;
55
+ declare const StateHeatmapEntrySchema: z.ZodObject<{
56
+ count: z.ZodNumber;
57
+ percentage: z.ZodNumber;
58
+ }, z.core.$strip>;
59
+ declare const StateHeatmapResponseSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
60
+ count: z.ZodNumber;
61
+ percentage: z.ZodNumber;
62
+ }, z.core.$strip>>;
63
+ type StateHeatmapRequest = StateHeatmapRequestData;
64
+ type StateHeatmapEntry = StateHeatmapEntryData;
65
+ type StateHeatmapResponse = StateHeatmapResponseData;
66
+
67
+ export { type DriverRanking, type DriverRankingData, DriverRankingSchema, type DriverRankingsRequest, type DriverRankingsRequestData, DriverRankingsRequestSchema, type DriverRankingsResponse, type DriverRankingsResponseData, DriverRankingsResponseSchema, type StateHeatmapEntry, type StateHeatmapEntryData, StateHeatmapEntrySchema, type StateHeatmapRequest, type StateHeatmapRequestData, StateHeatmapRequestSchema, type StateHeatmapResponse, type StateHeatmapResponseData, StateHeatmapResponseSchema, decryptRsaOaepSha256B64, encryptRsaOaepSha256ToB64 };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,67 @@
1
- export { BatchConvexUpdate, ConvexUpdate, NewLoginRequest, NewLoginResponse, NewLoginResponseFailure, NewLoginResponseSuccess, ScrapeStatus, UpdateScrapeStatusMessage, ValidatePasswordRequest, ValidatePasswordRequestSchema, ValidatePasswordResponse, ValidatePasswordResponseSchema } from './browser.js';
2
- import 'zod';
1
+ export { BatchConvexUpdate, BatchConvexUpdateData, BatchConvexUpdateSchema, ConvexDriverData, ConvexDriverSchema, ConvexUpdate, ConvexUpdateData, ConvexUpdateSchema, NewLoginRequest, NewLoginRequestData, NewLoginRequestSchema, NewLoginResponse, NewLoginResponseData, NewLoginResponseFailure, NewLoginResponseFailureData, NewLoginResponseFailureSchema, NewLoginResponseSchema, NewLoginResponseSuccess, NewLoginResponseSuccessData, NewLoginResponseSuccessSchema, PublicProviderData, PublicUserData, ScrapeStatus, UpdateScrapeStatusMessage, ValidatePasswordRequest, ValidatePasswordRequestData, ValidatePasswordRequestSchema, ValidatePasswordResponse, ValidatePasswordResponseData, ValidatePasswordResponseSchema } from './browser.js';
2
+ import { z } from 'zod';
3
3
 
4
4
  declare function encryptRsaOaepSha256ToB64(plaintext: string, publicKeyPem: string): string;
5
5
  declare function decryptRsaOaepSha256B64(ciphertextB64: string, privateKeyPem: string, passphrase?: string): string;
6
6
 
7
- export { decryptRsaOaepSha256B64, encryptRsaOaepSha256ToB64 };
7
+ interface DriverRankingsRequestData {
8
+ start_date: string;
9
+ end_date: string;
10
+ state?: string;
11
+ }
12
+ interface DriverRankingData {
13
+ rank: number;
14
+ driver_id: string;
15
+ driver_name: string;
16
+ total_miles: number;
17
+ }
18
+ type DriverRankingsResponseData = DriverRankingData[];
19
+ declare const DriverRankingsRequestSchema: z.ZodObject<{
20
+ start_date: z.ZodString;
21
+ end_date: z.ZodString;
22
+ state: z.ZodOptional<z.ZodString>;
23
+ }, z.core.$strip>;
24
+ declare const DriverRankingSchema: z.ZodObject<{
25
+ rank: z.ZodNumber;
26
+ driver_id: z.ZodString;
27
+ driver_name: z.ZodString;
28
+ total_miles: z.ZodNumber;
29
+ }, z.core.$strip>;
30
+ declare const DriverRankingsResponseSchema: z.ZodArray<z.ZodObject<{
31
+ rank: z.ZodNumber;
32
+ driver_id: z.ZodString;
33
+ driver_name: z.ZodString;
34
+ total_miles: z.ZodNumber;
35
+ }, z.core.$strip>>;
36
+ type DriverRankingsRequest = DriverRankingsRequestData;
37
+ type DriverRanking = DriverRankingData;
38
+ type DriverRankingsResponse = DriverRankingsResponseData;
39
+
40
+ interface StateHeatmapRequestData {
41
+ driver_id: string;
42
+ start_date: string;
43
+ end_date: string;
44
+ }
45
+ interface StateHeatmapEntryData {
46
+ count: number;
47
+ percentage: number;
48
+ }
49
+ type StateHeatmapResponseData = Record<string, StateHeatmapEntryData>;
50
+ declare const StateHeatmapRequestSchema: z.ZodObject<{
51
+ driver_id: z.ZodString;
52
+ start_date: z.ZodString;
53
+ end_date: z.ZodString;
54
+ }, z.core.$strip>;
55
+ declare const StateHeatmapEntrySchema: z.ZodObject<{
56
+ count: z.ZodNumber;
57
+ percentage: z.ZodNumber;
58
+ }, z.core.$strip>;
59
+ declare const StateHeatmapResponseSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
60
+ count: z.ZodNumber;
61
+ percentage: z.ZodNumber;
62
+ }, z.core.$strip>>;
63
+ type StateHeatmapRequest = StateHeatmapRequestData;
64
+ type StateHeatmapEntry = StateHeatmapEntryData;
65
+ type StateHeatmapResponse = StateHeatmapResponseData;
66
+
67
+ export { type DriverRanking, type DriverRankingData, DriverRankingSchema, type DriverRankingsRequest, type DriverRankingsRequestData, DriverRankingsRequestSchema, type DriverRankingsResponse, type DriverRankingsResponseData, DriverRankingsResponseSchema, type StateHeatmapEntry, type StateHeatmapEntryData, StateHeatmapEntrySchema, type StateHeatmapRequest, type StateHeatmapRequestData, StateHeatmapRequestSchema, type StateHeatmapResponse, type StateHeatmapResponseData, StateHeatmapResponseSchema, decryptRsaOaepSha256B64, encryptRsaOaepSha256ToB64 };
package/dist/index.js CHANGED
@@ -1,15 +1,22 @@
1
1
  import {
2
2
  BatchConvexUpdate,
3
+ BatchConvexUpdateSchema,
4
+ ConvexDriverSchema,
3
5
  ConvexUpdate,
6
+ ConvexUpdateSchema,
4
7
  NewLoginRequest,
8
+ NewLoginRequestSchema,
5
9
  NewLoginResponse,
6
10
  NewLoginResponseFailure,
11
+ NewLoginResponseFailureSchema,
12
+ NewLoginResponseSchema,
7
13
  NewLoginResponseSuccess,
14
+ NewLoginResponseSuccessSchema,
8
15
  ScrapeStatus,
9
16
  UpdateScrapeStatusMessage,
10
17
  ValidatePasswordRequestSchema,
11
18
  ValidatePasswordResponseSchema
12
- } from "./chunk-3CDH5DV5.js";
19
+ } from "./chunk-CUV2KQXS.js";
13
20
 
14
21
  // src/security/transit-crypto.ts
15
22
  import { publicEncrypt, privateDecrypt, constants } from "crypto";
@@ -36,14 +43,58 @@ function decryptRsaOaepSha256B64(ciphertextB64, privateKeyPem, passphrase) {
36
43
  );
37
44
  return plaintext.toString("utf8");
38
45
  }
46
+
47
+ // src/schemas/telemetry/driver-rankings.ts
48
+ import { z } from "zod";
49
+ var DriverRankingsRequestSchema = z.object({
50
+ start_date: z.string().describe("Start date for the ranking period (ISO 8601 format)"),
51
+ end_date: z.string().describe("End date for the ranking period (ISO 8601 format)"),
52
+ state: z.string().length(2).optional().describe("Optional 2-letter state abbreviation to filter telemetry by location")
53
+ }).describe("Request schema for driver rankings by miles driven");
54
+ var DriverRankingSchema = z.object({
55
+ rank: z.number().int().positive().describe("Rank position based on miles driven"),
56
+ driver_id: z.string().uuid().describe("Unique identifier of the driver"),
57
+ driver_name: z.string().describe("Name of the driver"),
58
+ total_miles: z.number().min(0).describe("Total miles driven in the specified period")
59
+ }).describe("Single driver ranking entry");
60
+ var DriverRankingsResponseSchema = z.array(DriverRankingSchema).describe("Array of driver rankings sorted by miles driven in descending order");
61
+
62
+ // src/schemas/telemetry/state-heatmap.ts
63
+ import { z as z2 } from "zod";
64
+ var StateHeatmapRequestSchema = z2.object({
65
+ driver_id: z2.string().uuid().describe("Unique identifier of the driver"),
66
+ start_date: z2.string().describe("Start date for the heatmap period (ISO 8601 format)"),
67
+ end_date: z2.string().describe("End date for the heatmap period (ISO 8601 format)")
68
+ }).describe("Request schema for driver state heatmap");
69
+ var StateHeatmapEntrySchema = z2.object({
70
+ count: z2.number().int().min(0).describe("Number of telemetry points in this state"),
71
+ percentage: z2.number().min(0).max(100).describe("Percentage of total telemetry points in this state")
72
+ }).describe("Single state entry in the heatmap");
73
+ var StateHeatmapResponseSchema = z2.record(
74
+ z2.string().length(2),
75
+ StateHeatmapEntrySchema
76
+ ).describe("Record of 2-letter state codes to heatmap entries");
39
77
  export {
40
78
  BatchConvexUpdate,
79
+ BatchConvexUpdateSchema,
80
+ ConvexDriverSchema,
41
81
  ConvexUpdate,
82
+ ConvexUpdateSchema,
83
+ DriverRankingSchema,
84
+ DriverRankingsRequestSchema,
85
+ DriverRankingsResponseSchema,
42
86
  NewLoginRequest,
87
+ NewLoginRequestSchema,
43
88
  NewLoginResponse,
44
89
  NewLoginResponseFailure,
90
+ NewLoginResponseFailureSchema,
91
+ NewLoginResponseSchema,
45
92
  NewLoginResponseSuccess,
93
+ NewLoginResponseSuccessSchema,
46
94
  ScrapeStatus,
95
+ StateHeatmapEntrySchema,
96
+ StateHeatmapRequestSchema,
97
+ StateHeatmapResponseSchema,
47
98
  UpdateScrapeStatusMessage,
48
99
  ValidatePasswordRequestSchema,
49
100
  ValidatePasswordResponseSchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@findatruck/shared-schemas",
3
- "version": "2.8.0",
3
+ "version": "2.9.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -24,7 +24,6 @@
24
24
  "scripts": {
25
25
  "build": "tsup src/index.ts src/browser.ts --dts --format esm,cjs --out-dir dist --clean",
26
26
  "prepublishOnly": "npm run build",
27
- "prepare": "npm run build",
28
27
  "test": "vitest run",
29
28
  "test:watch": "vitest",
30
29
  "coverage": "vitest run --coverage"
@@ -33,7 +32,6 @@
33
32
  "zod": "^4.1.11"
34
33
  },
35
34
  "devDependencies": {
36
- "@changesets/cli": "^2.29.7",
37
35
  "@types/node": "^24.7.0",
38
36
  "tsup": "^8.0.0",
39
37
  "typescript": "^5.9.3",