@findatruck/shared-schemas 2.13.0 → 2.14.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.js CHANGED
@@ -18,110 +18,122 @@ import {
18
18
  ValidatePasswordResponseSchema
19
19
  } from "./chunk-S53TIE72.js";
20
20
 
21
+ // src/schemas/drivers/anonymous-driver.ts
22
+ import z from "zod";
23
+ var CreateAnonymousDriverBodySchema = z.object({
24
+ convex_user_id: z.string().min(1)
25
+ });
26
+ var AnonymousDriverResponseSchema = z.object({
27
+ driver_id: z.string()
28
+ });
29
+ var AnonymousDriverErrorResponseSchema = z.object({
30
+ error: z.string()
31
+ });
32
+
21
33
  // src/schemas/providerAccounts/delete-provider-account.ts
22
- import { z } from "zod";
23
- var DeleteProviderAccountRequestSchema = z.object({
24
- providerAccountId: z.string().min(1).describe("The external provider account ID to delete")
34
+ import { z as z2 } from "zod";
35
+ var DeleteProviderAccountRequestSchema = z2.object({
36
+ providerAccountId: z2.string().min(1).describe("The external provider account ID to delete")
25
37
  }).describe("Request schema for deleting a provider account");
26
- var DeleteProviderAccountResponseSchema = z.object({
27
- success: z.boolean().describe("Indicates if the provider account was successfully deleted")
38
+ var DeleteProviderAccountResponseSchema = z2.object({
39
+ success: z2.boolean().describe("Indicates if the provider account was successfully deleted")
28
40
  }).describe("Response schema for provider account deletion");
29
41
 
30
42
  // src/schemas/telemetry/driver-rankings.ts
31
- import { z as z2 } from "zod";
32
- var DriverRankingsRequestSchema = z2.object({
33
- start_date: z2.string().describe("Start date for the ranking period (ISO 8601 format)"),
34
- end_date: z2.string().describe("End date for the ranking period (ISO 8601 format)"),
35
- state: z2.string().length(2).optional().describe("Optional 2-letter state abbreviation to filter telemetry by location")
43
+ import { z as z3 } from "zod";
44
+ var DriverRankingsRequestSchema = z3.object({
45
+ start_date: z3.string().describe("Start date for the ranking period (ISO 8601 format)"),
46
+ end_date: z3.string().describe("End date for the ranking period (ISO 8601 format)"),
47
+ state: z3.string().length(2).optional().describe("Optional 2-letter state abbreviation to filter telemetry by location")
36
48
  }).describe("Request schema for driver rankings by miles driven");
37
- var DriverRankingSchema = z2.object({
38
- rank: z2.number().int().positive().describe("Rank position based on miles driven"),
39
- driver_id: z2.string().uuid().describe("Unique identifier of the driver"),
40
- driver_name: z2.string().describe("Name of the driver"),
41
- total_miles: z2.number().min(0).describe("Total miles driven in the specified period")
49
+ var DriverRankingSchema = z3.object({
50
+ rank: z3.number().int().positive().describe("Rank position based on miles driven"),
51
+ driver_id: z3.string().uuid().describe("Unique identifier of the driver"),
52
+ driver_name: z3.string().describe("Name of the driver"),
53
+ total_miles: z3.number().min(0).describe("Total miles driven in the specified period")
42
54
  }).describe("Single driver ranking entry");
43
- var DriverRankingsResponseSchema = z2.array(DriverRankingSchema).describe("Array of driver rankings sorted by miles driven in descending order");
55
+ var DriverRankingsResponseSchema = z3.array(DriverRankingSchema).describe("Array of driver rankings sorted by miles driven in descending order");
44
56
 
45
57
  // src/schemas/telemetry/state-heatmap.ts
46
- import { z as z3 } from "zod";
47
- var StateHeatmapRequestSchema = z3.object({
48
- driver_id: z3.string().uuid().describe("Unique identifier of the driver"),
49
- start_date: z3.string().describe("Start date for the heatmap period (ISO 8601 format)"),
50
- end_date: z3.string().describe("End date for the heatmap period (ISO 8601 format)")
58
+ import { z as z4 } from "zod";
59
+ var StateHeatmapRequestSchema = z4.object({
60
+ driver_id: z4.string().uuid().describe("Unique identifier of the driver"),
61
+ start_date: z4.string().describe("Start date for the heatmap period (ISO 8601 format)"),
62
+ end_date: z4.string().describe("End date for the heatmap period (ISO 8601 format)")
51
63
  }).describe("Request schema for driver state heatmap");
52
- var StateHeatmapEntrySchema = z3.object({
53
- count: z3.number().int().min(0).describe("Number of telemetry points in this state"),
54
- percentage: z3.number().min(0).max(100).describe("Percentage of total telemetry points in this state")
64
+ var StateHeatmapEntrySchema = z4.object({
65
+ count: z4.number().int().min(0).describe("Number of telemetry points in this state"),
66
+ percentage: z4.number().min(0).max(100).describe("Percentage of total telemetry points in this state")
55
67
  }).describe("Single state entry in the heatmap");
56
- var StateHeatmapResponseSchema = z3.record(
57
- z3.string().length(2),
68
+ var StateHeatmapResponseSchema = z4.record(
69
+ z4.string().length(2),
58
70
  StateHeatmapEntrySchema
59
71
  ).describe("Record of 2-letter state codes to heatmap entries");
60
72
 
61
73
  // src/schemas/telemetry/manual-batch.ts
62
- import { z as z4 } from "zod";
63
- var ManualBatchEntrySchema = z4.object({
64
- driver_id: z4.string().uuid().describe("Internal UUID of the driver"),
65
- timestamp: z4.string().datetime().describe("Timestamp of the GPS reading (ISO 8601 format)"),
66
- location_latitude: z4.number().min(-90).max(90).describe("GPS latitude coordinate"),
67
- location_longitude: z4.number().min(-180).max(180).describe("GPS longitude coordinate"),
68
- location_address: z4.string().optional().describe("Optional human-readable address"),
69
- vehicle_odometer_miles: z4.number().min(0).optional().describe("Optional vehicle odometer reading in miles")
74
+ import { z as z5 } from "zod";
75
+ var ManualBatchEntrySchema = z5.object({
76
+ driver_id: z5.string().uuid().describe("Internal UUID of the driver"),
77
+ timestamp: z5.string().datetime().describe("Timestamp of the GPS reading (ISO 8601 format)"),
78
+ location_latitude: z5.number().min(-90).max(90).describe("GPS latitude coordinate"),
79
+ location_longitude: z5.number().min(-180).max(180).describe("GPS longitude coordinate"),
80
+ location_address: z5.string().optional().describe("Optional human-readable address"),
81
+ vehicle_odometer_miles: z5.number().min(0).optional().describe("Optional vehicle odometer reading in miles")
70
82
  }).describe("Single manual telemetry entry");
71
- var ManualBatchRequestSchema = z4.object({
72
- entries: z4.array(ManualBatchEntrySchema).min(1).max(1e3).describe("Array of manual telemetry entries (1-1000)")
83
+ var ManualBatchRequestSchema = z5.object({
84
+ entries: z5.array(ManualBatchEntrySchema).min(1).max(1e3).describe("Array of manual telemetry entries (1-1000)")
73
85
  }).describe("Request schema for manual batch telemetry insertion");
74
- var ManualBatchTelemetrySchema = z4.object({
75
- id: z4.number().int().describe("Telemetry record ID"),
76
- driver_id: z4.string().uuid().describe("Internal UUID of the driver"),
77
- timestamp: z4.union([z4.string(), z4.date()]).describe("Timestamp of the telemetry reading"),
78
- remaining_drive_time_in_seconds: z4.number().min(0),
79
- remaining_shift_time_in_seconds: z4.number().min(0),
80
- remaining_cycle_time_in_seconds: z4.number().min(0),
81
- remaining_break_time_in_seconds: z4.number().min(0),
82
- location_latitude: z4.number().min(-90).max(90),
83
- location_longitude: z4.number().min(-180).max(180),
84
- previous_location_latitude: z4.number().min(-90).max(90).nullable(),
85
- previous_location_longitude: z4.number().min(-180).max(180).nullable(),
86
- location_address: z4.string().nullable(),
87
- location_state: z4.string().length(2).nullable(),
88
- vehicle_odometer_miles: z4.number().min(0).nullable(),
89
- source: z4.enum(["eld", "manual"])
86
+ var ManualBatchTelemetrySchema = z5.object({
87
+ id: z5.number().int().describe("Telemetry record ID"),
88
+ driver_id: z5.string().uuid().describe("Internal UUID of the driver"),
89
+ timestamp: z5.union([z5.string(), z5.date()]).describe("Timestamp of the telemetry reading"),
90
+ remaining_drive_time_in_seconds: z5.number().min(0),
91
+ remaining_shift_time_in_seconds: z5.number().min(0),
92
+ remaining_cycle_time_in_seconds: z5.number().min(0),
93
+ remaining_break_time_in_seconds: z5.number().min(0),
94
+ location_latitude: z5.number().min(-90).max(90),
95
+ location_longitude: z5.number().min(-180).max(180),
96
+ previous_location_latitude: z5.number().min(-90).max(90).nullable(),
97
+ previous_location_longitude: z5.number().min(-180).max(180).nullable(),
98
+ location_address: z5.string().nullable(),
99
+ location_state: z5.string().length(2).nullable(),
100
+ vehicle_odometer_miles: z5.number().min(0).nullable(),
101
+ source: z5.enum(["eld", "manual"])
90
102
  }).describe("Telemetry record returned from manual batch insertion");
91
- var ManualBatchResponseSchema = z4.object({
92
- message: z4.string().describe("Success message"),
93
- inserted_count: z4.number().int().min(0).describe("Number of telemetry entries inserted"),
94
- telemetry: z4.array(ManualBatchTelemetrySchema).describe("Array of inserted telemetry records")
103
+ var ManualBatchResponseSchema = z5.object({
104
+ message: z5.string().describe("Success message"),
105
+ inserted_count: z5.number().int().min(0).describe("Number of telemetry entries inserted"),
106
+ telemetry: z5.array(ManualBatchTelemetrySchema).describe("Array of inserted telemetry records")
95
107
  }).describe("Response schema for manual batch telemetry insertion");
96
108
 
97
109
  // src/auth-data.ts
98
- import { z as z5 } from "zod";
99
- var GomotiveAuthDataSchema = z5.object({
100
- kind: z5.literal("gomotive"),
101
- token: z5.string(),
102
- ownerOperator: z5.boolean()
110
+ import { z as z6 } from "zod";
111
+ var GomotiveAuthDataSchema = z6.object({
112
+ kind: z6.literal("gomotive"),
113
+ token: z6.string(),
114
+ ownerOperator: z6.boolean()
103
115
  });
104
- var VistaAuthDataSchema = z5.object({
105
- kind: z5.literal("vista"),
106
- driverId: z5.string(),
107
- cookie: z5.string()
116
+ var VistaAuthDataSchema = z6.object({
117
+ kind: z6.literal("vista"),
118
+ driverId: z6.string(),
119
+ cookie: z6.string()
108
120
  });
109
- var MockAuthDataSchema = z5.object({
110
- kind: z5.literal("mock"),
111
- cookie: z5.string()
121
+ var MockAuthDataSchema = z6.object({
122
+ kind: z6.literal("mock"),
123
+ cookie: z6.string()
112
124
  });
113
- var NoneAuthDataSchema = z5.object({
114
- kind: z5.literal("none")
125
+ var NoneAuthDataSchema = z6.object({
126
+ kind: z6.literal("none")
115
127
  });
116
- var ProviderAuthDataSchema = z5.discriminatedUnion("kind", [
128
+ var ProviderAuthDataSchema = z6.discriminatedUnion("kind", [
117
129
  GomotiveAuthDataSchema,
118
130
  VistaAuthDataSchema,
119
131
  MockAuthDataSchema,
120
132
  NoneAuthDataSchema
121
133
  ]);
122
- var LegacyVistaAuthSchema = z5.object({
123
- driverId: z5.string(),
124
- cookie: z5.string()
134
+ var LegacyVistaAuthSchema = z6.object({
135
+ driverId: z6.string(),
136
+ cookie: z6.string()
125
137
  });
126
138
  function serializeAuthData(data) {
127
139
  if (data.kind === "none") {
@@ -157,42 +169,52 @@ function deserializeAuthData(authToken) {
157
169
  }
158
170
 
159
171
  // src/browser-auth.ts
160
- import { z as z6 } from "zod";
161
- var BrowserAuthRequestSchema = z6.object({
162
- providerStub: z6.string(),
163
- providerUrl: z6.string(),
164
- username: z6.string(),
165
- encryptedPassword: z6.string()
172
+ import { z as z7 } from "zod";
173
+ var CapturedTrafficEntrySchema = z7.object({
174
+ method: z7.string(),
175
+ url: z7.string(),
176
+ status: z7.number(),
177
+ responseBody: z7.string().optional()
178
+ });
179
+ var BrowserAuthRequestSchema = z7.object({
180
+ providerStub: z7.string(),
181
+ providerUrl: z7.string(),
182
+ username: z7.string(),
183
+ encryptedPassword: z7.string(),
184
+ captureTraffic: z7.boolean().optional()
166
185
  });
167
- var BrowserAuthSuccessSchema = z6.object({
168
- success: z6.literal(true),
169
- authData: ProviderAuthDataSchema
186
+ var BrowserAuthSuccessSchema = z7.object({
187
+ success: z7.literal(true),
188
+ authData: ProviderAuthDataSchema,
189
+ capturedTraffic: z7.array(CapturedTrafficEntrySchema).optional()
170
190
  });
171
- var BrowserAuthFailureSchema = z6.object({
172
- success: z6.literal(false),
173
- error: z6.string()
191
+ var BrowserAuthFailureSchema = z7.object({
192
+ success: z7.literal(false),
193
+ error: z7.string()
174
194
  });
175
- var BrowserAuthResponseSchema = z6.discriminatedUnion("success", [
195
+ var BrowserAuthResponseSchema = z7.discriminatedUnion("success", [
176
196
  BrowserAuthSuccessSchema,
177
197
  BrowserAuthFailureSchema
178
198
  ]);
179
- var CrawlPageSchema = z6.object({
180
- url: z6.string(),
181
- html: z6.string()
199
+ var CrawlPageSchema = z7.object({
200
+ url: z7.string(),
201
+ html: z7.string()
182
202
  });
183
- var BrowserCrawlSuccessSchema = z6.object({
184
- success: z6.literal(true),
185
- pages: z6.array(CrawlPageSchema)
203
+ var BrowserCrawlSuccessSchema = z7.object({
204
+ success: z7.literal(true),
205
+ pages: z7.array(CrawlPageSchema)
186
206
  });
187
- var BrowserCrawlFailureSchema = z6.object({
188
- success: z6.literal(false),
189
- error: z6.string()
207
+ var BrowserCrawlFailureSchema = z7.object({
208
+ success: z7.literal(false),
209
+ error: z7.string()
190
210
  });
191
- var BrowserCrawlResponseSchema = z6.discriminatedUnion("success", [
211
+ var BrowserCrawlResponseSchema = z7.discriminatedUnion("success", [
192
212
  BrowserCrawlSuccessSchema,
193
213
  BrowserCrawlFailureSchema
194
214
  ]);
195
215
  export {
216
+ AnonymousDriverErrorResponseSchema,
217
+ AnonymousDriverResponseSchema,
196
218
  BatchConvexUpdate,
197
219
  BatchConvexUpdateSchema,
198
220
  BrowserAuthFailureSchema,
@@ -202,10 +224,12 @@ export {
202
224
  BrowserCrawlFailureSchema,
203
225
  BrowserCrawlResponseSchema,
204
226
  BrowserCrawlSuccessSchema,
227
+ CapturedTrafficEntrySchema,
205
228
  ConvexDriverSchema,
206
229
  ConvexUpdate,
207
230
  ConvexUpdateSchema,
208
231
  CrawlPageSchema,
232
+ CreateAnonymousDriverBodySchema,
209
233
  DeleteProviderAccountRequestSchema,
210
234
  DeleteProviderAccountResponseSchema,
211
235
  DriverRankingSchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@findatruck/shared-schemas",
3
- "version": "2.13.0",
3
+ "version": "2.14.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",