@tmlmobilidade/types 20250325.1729.12
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/README.md +13 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +21 -0
- package/dist/src/agency.d.ts +155 -0
- package/dist/src/agency.js +20 -0
- package/dist/src/alert.d.ts +289 -0
- package/dist/src/alert.js +81 -0
- package/dist/src/apex-t11.d.ts +152 -0
- package/dist/src/apex-t11.js +98 -0
- package/dist/src/apex-t19.d.ts +67 -0
- package/dist/src/apex-t19.js +17 -0
- package/dist/src/auth.d.ts +525 -0
- package/dist/src/auth.js +97 -0
- package/dist/src/common.d.ts +77 -0
- package/dist/src/common.js +50 -0
- package/dist/src/file.d.ts +121 -0
- package/dist/src/file.js +16 -0
- package/dist/src/hashed-shape.d.ts +186 -0
- package/dist/src/hashed-shape.js +19 -0
- package/dist/src/hashed-trip.d.ts +445 -0
- package/dist/src/hashed-trip.js +37 -0
- package/dist/src/locality.d.ts +145 -0
- package/dist/src/locality.js +20 -0
- package/dist/src/municipality.d.ts +145 -0
- package/dist/src/municipality.js +20 -0
- package/dist/src/organization.d.ts +52 -0
- package/dist/src/organization.js +8 -0
- package/dist/src/plan.d.ts +127 -0
- package/dist/src/plan.js +16 -0
- package/dist/src/ride.d.ts +498 -0
- package/dist/src/ride.js +44 -0
- package/dist/src/stop.d.ts +474 -0
- package/dist/src/stop.js +139 -0
- package/dist/src/vehicle-event.d.ts +76 -0
- package/dist/src/vehicle-event.js +20 -0
- package/dist/src/zone.d.ts +120 -0
- package/dist/src/zone.js +16 -0
- package/package.json +51 -0
|
@@ -0,0 +1,498 @@
|
|
|
1
|
+
import { type OperationalDate, type UnixTimestamp } from './common.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export declare const RideAnalysisSchema: z.ZodObject<{
|
|
4
|
+
_id: z.ZodString;
|
|
5
|
+
grade: z.ZodEnum<["pass", "fail", "error"]>;
|
|
6
|
+
message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
7
|
+
reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
8
|
+
unit: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
9
|
+
value: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
10
|
+
}, "strict", z.ZodTypeAny, {
|
|
11
|
+
_id: string;
|
|
12
|
+
grade: "error" | "pass" | "fail";
|
|
13
|
+
value?: number | null | undefined;
|
|
14
|
+
message?: string | null | undefined;
|
|
15
|
+
reason?: string | null | undefined;
|
|
16
|
+
unit?: string | null | undefined;
|
|
17
|
+
}, {
|
|
18
|
+
_id: string;
|
|
19
|
+
grade: "error" | "pass" | "fail";
|
|
20
|
+
value?: number | null | undefined;
|
|
21
|
+
message?: string | null | undefined;
|
|
22
|
+
reason?: string | null | undefined;
|
|
23
|
+
unit?: string | null | undefined;
|
|
24
|
+
}>;
|
|
25
|
+
export declare const CreateRideAnalysisSchema: z.ZodObject<{
|
|
26
|
+
_id: z.ZodString;
|
|
27
|
+
grade: z.ZodEnum<["pass", "fail", "error"]>;
|
|
28
|
+
message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
29
|
+
reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
30
|
+
unit: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
31
|
+
value: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
32
|
+
}, "strict", z.ZodTypeAny, {
|
|
33
|
+
_id: string;
|
|
34
|
+
grade: "error" | "pass" | "fail";
|
|
35
|
+
value?: number | null | undefined;
|
|
36
|
+
message?: string | null | undefined;
|
|
37
|
+
reason?: string | null | undefined;
|
|
38
|
+
unit?: string | null | undefined;
|
|
39
|
+
}, {
|
|
40
|
+
_id: string;
|
|
41
|
+
grade: "error" | "pass" | "fail";
|
|
42
|
+
value?: number | null | undefined;
|
|
43
|
+
message?: string | null | undefined;
|
|
44
|
+
reason?: string | null | undefined;
|
|
45
|
+
unit?: string | null | undefined;
|
|
46
|
+
}>;
|
|
47
|
+
export declare const UpdateRideAnalysisSchema: z.ZodObject<{
|
|
48
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
49
|
+
grade: z.ZodOptional<z.ZodEnum<["pass", "fail", "error"]>>;
|
|
50
|
+
message: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
51
|
+
reason: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
52
|
+
unit: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
53
|
+
value: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
54
|
+
}, "strict", z.ZodTypeAny, {
|
|
55
|
+
_id?: string | undefined;
|
|
56
|
+
value?: number | null | undefined;
|
|
57
|
+
message?: string | null | undefined;
|
|
58
|
+
grade?: "error" | "pass" | "fail" | undefined;
|
|
59
|
+
reason?: string | null | undefined;
|
|
60
|
+
unit?: string | null | undefined;
|
|
61
|
+
}, {
|
|
62
|
+
_id?: string | undefined;
|
|
63
|
+
value?: number | null | undefined;
|
|
64
|
+
message?: string | null | undefined;
|
|
65
|
+
grade?: "error" | "pass" | "fail" | undefined;
|
|
66
|
+
reason?: string | null | undefined;
|
|
67
|
+
unit?: string | null | undefined;
|
|
68
|
+
}>;
|
|
69
|
+
export type RideAnalysis = z.infer<typeof RideAnalysisSchema>;
|
|
70
|
+
export type CreateRideAnalysisDto = z.infer<typeof CreateRideAnalysisSchema>;
|
|
71
|
+
export type UpdateRideAnalysisDto = Partial<CreateRideAnalysisDto>;
|
|
72
|
+
export declare const RideSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
73
|
+
_id: z.ZodString;
|
|
74
|
+
created_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>>;
|
|
75
|
+
updated_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>>;
|
|
76
|
+
}, {
|
|
77
|
+
agency_id: z.ZodString;
|
|
78
|
+
analysis: z.ZodArray<z.ZodObject<{
|
|
79
|
+
_id: z.ZodString;
|
|
80
|
+
grade: z.ZodEnum<["pass", "fail", "error"]>;
|
|
81
|
+
message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
82
|
+
reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
83
|
+
unit: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
84
|
+
value: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
85
|
+
}, "strict", z.ZodTypeAny, {
|
|
86
|
+
_id: string;
|
|
87
|
+
grade: "error" | "pass" | "fail";
|
|
88
|
+
value?: number | null | undefined;
|
|
89
|
+
message?: string | null | undefined;
|
|
90
|
+
reason?: string | null | undefined;
|
|
91
|
+
unit?: string | null | undefined;
|
|
92
|
+
}, {
|
|
93
|
+
_id: string;
|
|
94
|
+
grade: "error" | "pass" | "fail";
|
|
95
|
+
value?: number | null | undefined;
|
|
96
|
+
message?: string | null | undefined;
|
|
97
|
+
reason?: string | null | undefined;
|
|
98
|
+
unit?: string | null | undefined;
|
|
99
|
+
}>, "many">;
|
|
100
|
+
driver_ids: z.ZodArray<z.ZodString, "many">;
|
|
101
|
+
end_time_observed: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>>;
|
|
102
|
+
end_time_scheduled: z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">;
|
|
103
|
+
execution_status: z.ZodOptional<z.ZodNullable<z.ZodEnum<["success", "failure", "warning"]>>>;
|
|
104
|
+
extension_observed: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
105
|
+
extension_scheduled: z.ZodNumber;
|
|
106
|
+
hashed_shape_id: z.ZodString;
|
|
107
|
+
hashed_trip_id: z.ZodString;
|
|
108
|
+
headsign: z.ZodString;
|
|
109
|
+
line_id: z.ZodString;
|
|
110
|
+
operational_date: z.ZodBranded<z.ZodEffects<z.ZodString, OperationalDate, string>, "OperationalDate">;
|
|
111
|
+
passengers_estimated: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
112
|
+
pattern_id: z.ZodString;
|
|
113
|
+
plan_id: z.ZodString;
|
|
114
|
+
route_id: z.ZodString;
|
|
115
|
+
seen_first_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>>;
|
|
116
|
+
seen_last_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>>;
|
|
117
|
+
start_time_observed: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>>;
|
|
118
|
+
start_time_scheduled: z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">;
|
|
119
|
+
system_status: z.ZodEnum<["pending", "processing", "complete", "error"]>;
|
|
120
|
+
trip_id: z.ZodString;
|
|
121
|
+
validations_count: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
122
|
+
vehicle_ids: z.ZodArray<z.ZodString, "many">;
|
|
123
|
+
}>, "strict", z.ZodTypeAny, {
|
|
124
|
+
_id: string;
|
|
125
|
+
agency_id: string;
|
|
126
|
+
line_id: string;
|
|
127
|
+
pattern_id: string;
|
|
128
|
+
trip_id: string;
|
|
129
|
+
route_id: string;
|
|
130
|
+
analysis: {
|
|
131
|
+
_id: string;
|
|
132
|
+
grade: "error" | "pass" | "fail";
|
|
133
|
+
value?: number | null | undefined;
|
|
134
|
+
message?: string | null | undefined;
|
|
135
|
+
reason?: string | null | undefined;
|
|
136
|
+
unit?: string | null | undefined;
|
|
137
|
+
}[];
|
|
138
|
+
driver_ids: string[];
|
|
139
|
+
end_time_scheduled: number & {
|
|
140
|
+
__brand: "UnixTimestamp";
|
|
141
|
+
} & z.BRAND<"UnixTimestamp">;
|
|
142
|
+
extension_scheduled: number;
|
|
143
|
+
hashed_shape_id: string;
|
|
144
|
+
hashed_trip_id: string;
|
|
145
|
+
headsign: string;
|
|
146
|
+
operational_date: string & {
|
|
147
|
+
__brand: "OperationalDate";
|
|
148
|
+
} & z.BRAND<"OperationalDate">;
|
|
149
|
+
plan_id: string;
|
|
150
|
+
start_time_scheduled: number & {
|
|
151
|
+
__brand: "UnixTimestamp";
|
|
152
|
+
} & z.BRAND<"UnixTimestamp">;
|
|
153
|
+
system_status: "processing" | "error" | "pending" | "complete";
|
|
154
|
+
vehicle_ids: string[];
|
|
155
|
+
created_at?: (number & {
|
|
156
|
+
__brand: "UnixTimestamp";
|
|
157
|
+
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
158
|
+
updated_at?: (number & {
|
|
159
|
+
__brand: "UnixTimestamp";
|
|
160
|
+
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
161
|
+
end_time_observed?: (number & {
|
|
162
|
+
__brand: "UnixTimestamp";
|
|
163
|
+
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
164
|
+
execution_status?: "success" | "failure" | "warning" | null | undefined;
|
|
165
|
+
extension_observed?: number | null | undefined;
|
|
166
|
+
passengers_estimated?: number | null | undefined;
|
|
167
|
+
seen_first_at?: (number & {
|
|
168
|
+
__brand: "UnixTimestamp";
|
|
169
|
+
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
170
|
+
seen_last_at?: (number & {
|
|
171
|
+
__brand: "UnixTimestamp";
|
|
172
|
+
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
173
|
+
start_time_observed?: (number & {
|
|
174
|
+
__brand: "UnixTimestamp";
|
|
175
|
+
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
176
|
+
validations_count?: number | null | undefined;
|
|
177
|
+
}, {
|
|
178
|
+
_id: string;
|
|
179
|
+
agency_id: string;
|
|
180
|
+
line_id: string;
|
|
181
|
+
pattern_id: string;
|
|
182
|
+
trip_id: string;
|
|
183
|
+
route_id: string;
|
|
184
|
+
analysis: {
|
|
185
|
+
_id: string;
|
|
186
|
+
grade: "error" | "pass" | "fail";
|
|
187
|
+
value?: number | null | undefined;
|
|
188
|
+
message?: string | null | undefined;
|
|
189
|
+
reason?: string | null | undefined;
|
|
190
|
+
unit?: string | null | undefined;
|
|
191
|
+
}[];
|
|
192
|
+
driver_ids: string[];
|
|
193
|
+
end_time_scheduled: number;
|
|
194
|
+
extension_scheduled: number;
|
|
195
|
+
hashed_shape_id: string;
|
|
196
|
+
hashed_trip_id: string;
|
|
197
|
+
headsign: string;
|
|
198
|
+
operational_date: string;
|
|
199
|
+
plan_id: string;
|
|
200
|
+
start_time_scheduled: number;
|
|
201
|
+
system_status: "processing" | "error" | "pending" | "complete";
|
|
202
|
+
vehicle_ids: string[];
|
|
203
|
+
created_at?: number | null | undefined;
|
|
204
|
+
updated_at?: number | null | undefined;
|
|
205
|
+
end_time_observed?: number | null | undefined;
|
|
206
|
+
execution_status?: "success" | "failure" | "warning" | null | undefined;
|
|
207
|
+
extension_observed?: number | null | undefined;
|
|
208
|
+
passengers_estimated?: number | null | undefined;
|
|
209
|
+
seen_first_at?: number | null | undefined;
|
|
210
|
+
seen_last_at?: number | null | undefined;
|
|
211
|
+
start_time_observed?: number | null | undefined;
|
|
212
|
+
validations_count?: number | null | undefined;
|
|
213
|
+
}>;
|
|
214
|
+
export declare const CreateRideSchema: z.ZodObject<Omit<{
|
|
215
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
216
|
+
created_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>>;
|
|
217
|
+
updated_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>>;
|
|
218
|
+
agency_id: z.ZodString;
|
|
219
|
+
line_id: z.ZodString;
|
|
220
|
+
pattern_id: z.ZodString;
|
|
221
|
+
trip_id: z.ZodString;
|
|
222
|
+
route_id: z.ZodString;
|
|
223
|
+
analysis: z.ZodArray<z.ZodObject<{
|
|
224
|
+
_id: z.ZodString;
|
|
225
|
+
grade: z.ZodEnum<["pass", "fail", "error"]>;
|
|
226
|
+
message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
227
|
+
reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
228
|
+
unit: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
229
|
+
value: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
230
|
+
}, "strict", z.ZodTypeAny, {
|
|
231
|
+
_id: string;
|
|
232
|
+
grade: "error" | "pass" | "fail";
|
|
233
|
+
value?: number | null | undefined;
|
|
234
|
+
message?: string | null | undefined;
|
|
235
|
+
reason?: string | null | undefined;
|
|
236
|
+
unit?: string | null | undefined;
|
|
237
|
+
}, {
|
|
238
|
+
_id: string;
|
|
239
|
+
grade: "error" | "pass" | "fail";
|
|
240
|
+
value?: number | null | undefined;
|
|
241
|
+
message?: string | null | undefined;
|
|
242
|
+
reason?: string | null | undefined;
|
|
243
|
+
unit?: string | null | undefined;
|
|
244
|
+
}>, "many">;
|
|
245
|
+
driver_ids: z.ZodArray<z.ZodString, "many">;
|
|
246
|
+
end_time_observed: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>>;
|
|
247
|
+
end_time_scheduled: z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">;
|
|
248
|
+
execution_status: z.ZodOptional<z.ZodNullable<z.ZodEnum<["success", "failure", "warning"]>>>;
|
|
249
|
+
extension_observed: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
250
|
+
extension_scheduled: z.ZodNumber;
|
|
251
|
+
hashed_shape_id: z.ZodString;
|
|
252
|
+
hashed_trip_id: z.ZodString;
|
|
253
|
+
headsign: z.ZodString;
|
|
254
|
+
operational_date: z.ZodBranded<z.ZodEffects<z.ZodString, OperationalDate, string>, "OperationalDate">;
|
|
255
|
+
passengers_estimated: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
256
|
+
plan_id: z.ZodString;
|
|
257
|
+
seen_first_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>>;
|
|
258
|
+
seen_last_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>>;
|
|
259
|
+
start_time_observed: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>>;
|
|
260
|
+
start_time_scheduled: z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">;
|
|
261
|
+
system_status: z.ZodEnum<["pending", "processing", "complete", "error"]>;
|
|
262
|
+
validations_count: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
263
|
+
vehicle_ids: z.ZodArray<z.ZodString, "many">;
|
|
264
|
+
}, "created_at" | "updated_at">, "strict", z.ZodTypeAny, {
|
|
265
|
+
agency_id: string;
|
|
266
|
+
line_id: string;
|
|
267
|
+
pattern_id: string;
|
|
268
|
+
trip_id: string;
|
|
269
|
+
route_id: string;
|
|
270
|
+
analysis: {
|
|
271
|
+
_id: string;
|
|
272
|
+
grade: "error" | "pass" | "fail";
|
|
273
|
+
value?: number | null | undefined;
|
|
274
|
+
message?: string | null | undefined;
|
|
275
|
+
reason?: string | null | undefined;
|
|
276
|
+
unit?: string | null | undefined;
|
|
277
|
+
}[];
|
|
278
|
+
driver_ids: string[];
|
|
279
|
+
end_time_scheduled: number & {
|
|
280
|
+
__brand: "UnixTimestamp";
|
|
281
|
+
} & z.BRAND<"UnixTimestamp">;
|
|
282
|
+
extension_scheduled: number;
|
|
283
|
+
hashed_shape_id: string;
|
|
284
|
+
hashed_trip_id: string;
|
|
285
|
+
headsign: string;
|
|
286
|
+
operational_date: string & {
|
|
287
|
+
__brand: "OperationalDate";
|
|
288
|
+
} & z.BRAND<"OperationalDate">;
|
|
289
|
+
plan_id: string;
|
|
290
|
+
start_time_scheduled: number & {
|
|
291
|
+
__brand: "UnixTimestamp";
|
|
292
|
+
} & z.BRAND<"UnixTimestamp">;
|
|
293
|
+
system_status: "processing" | "error" | "pending" | "complete";
|
|
294
|
+
vehicle_ids: string[];
|
|
295
|
+
_id?: string | undefined;
|
|
296
|
+
end_time_observed?: (number & {
|
|
297
|
+
__brand: "UnixTimestamp";
|
|
298
|
+
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
299
|
+
execution_status?: "success" | "failure" | "warning" | null | undefined;
|
|
300
|
+
extension_observed?: number | null | undefined;
|
|
301
|
+
passengers_estimated?: number | null | undefined;
|
|
302
|
+
seen_first_at?: (number & {
|
|
303
|
+
__brand: "UnixTimestamp";
|
|
304
|
+
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
305
|
+
seen_last_at?: (number & {
|
|
306
|
+
__brand: "UnixTimestamp";
|
|
307
|
+
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
308
|
+
start_time_observed?: (number & {
|
|
309
|
+
__brand: "UnixTimestamp";
|
|
310
|
+
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
311
|
+
validations_count?: number | null | undefined;
|
|
312
|
+
}, {
|
|
313
|
+
agency_id: string;
|
|
314
|
+
line_id: string;
|
|
315
|
+
pattern_id: string;
|
|
316
|
+
trip_id: string;
|
|
317
|
+
route_id: string;
|
|
318
|
+
analysis: {
|
|
319
|
+
_id: string;
|
|
320
|
+
grade: "error" | "pass" | "fail";
|
|
321
|
+
value?: number | null | undefined;
|
|
322
|
+
message?: string | null | undefined;
|
|
323
|
+
reason?: string | null | undefined;
|
|
324
|
+
unit?: string | null | undefined;
|
|
325
|
+
}[];
|
|
326
|
+
driver_ids: string[];
|
|
327
|
+
end_time_scheduled: number;
|
|
328
|
+
extension_scheduled: number;
|
|
329
|
+
hashed_shape_id: string;
|
|
330
|
+
hashed_trip_id: string;
|
|
331
|
+
headsign: string;
|
|
332
|
+
operational_date: string;
|
|
333
|
+
plan_id: string;
|
|
334
|
+
start_time_scheduled: number;
|
|
335
|
+
system_status: "processing" | "error" | "pending" | "complete";
|
|
336
|
+
vehicle_ids: string[];
|
|
337
|
+
_id?: string | undefined;
|
|
338
|
+
end_time_observed?: number | null | undefined;
|
|
339
|
+
execution_status?: "success" | "failure" | "warning" | null | undefined;
|
|
340
|
+
extension_observed?: number | null | undefined;
|
|
341
|
+
passengers_estimated?: number | null | undefined;
|
|
342
|
+
seen_first_at?: number | null | undefined;
|
|
343
|
+
seen_last_at?: number | null | undefined;
|
|
344
|
+
start_time_observed?: number | null | undefined;
|
|
345
|
+
validations_count?: number | null | undefined;
|
|
346
|
+
}>;
|
|
347
|
+
export declare const UpdateRideSchema: z.ZodObject<{
|
|
348
|
+
_id: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
349
|
+
agency_id: z.ZodOptional<z.ZodString>;
|
|
350
|
+
line_id: z.ZodOptional<z.ZodString>;
|
|
351
|
+
pattern_id: z.ZodOptional<z.ZodString>;
|
|
352
|
+
trip_id: z.ZodOptional<z.ZodString>;
|
|
353
|
+
route_id: z.ZodOptional<z.ZodString>;
|
|
354
|
+
analysis: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
355
|
+
_id: z.ZodString;
|
|
356
|
+
grade: z.ZodEnum<["pass", "fail", "error"]>;
|
|
357
|
+
message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
358
|
+
reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
359
|
+
unit: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
360
|
+
value: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
361
|
+
}, "strict", z.ZodTypeAny, {
|
|
362
|
+
_id: string;
|
|
363
|
+
grade: "error" | "pass" | "fail";
|
|
364
|
+
value?: number | null | undefined;
|
|
365
|
+
message?: string | null | undefined;
|
|
366
|
+
reason?: string | null | undefined;
|
|
367
|
+
unit?: string | null | undefined;
|
|
368
|
+
}, {
|
|
369
|
+
_id: string;
|
|
370
|
+
grade: "error" | "pass" | "fail";
|
|
371
|
+
value?: number | null | undefined;
|
|
372
|
+
message?: string | null | undefined;
|
|
373
|
+
reason?: string | null | undefined;
|
|
374
|
+
unit?: string | null | undefined;
|
|
375
|
+
}>, "many">>;
|
|
376
|
+
driver_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
377
|
+
end_time_observed: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>>>;
|
|
378
|
+
end_time_scheduled: z.ZodOptional<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>;
|
|
379
|
+
execution_status: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodEnum<["success", "failure", "warning"]>>>>;
|
|
380
|
+
extension_observed: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
381
|
+
extension_scheduled: z.ZodOptional<z.ZodNumber>;
|
|
382
|
+
hashed_shape_id: z.ZodOptional<z.ZodString>;
|
|
383
|
+
hashed_trip_id: z.ZodOptional<z.ZodString>;
|
|
384
|
+
headsign: z.ZodOptional<z.ZodString>;
|
|
385
|
+
operational_date: z.ZodOptional<z.ZodBranded<z.ZodEffects<z.ZodString, OperationalDate, string>, "OperationalDate">>;
|
|
386
|
+
passengers_estimated: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
387
|
+
plan_id: z.ZodOptional<z.ZodString>;
|
|
388
|
+
seen_first_at: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>>>;
|
|
389
|
+
seen_last_at: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>>>;
|
|
390
|
+
start_time_observed: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>>>;
|
|
391
|
+
start_time_scheduled: z.ZodOptional<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>;
|
|
392
|
+
system_status: z.ZodOptional<z.ZodEnum<["pending", "processing", "complete", "error"]>>;
|
|
393
|
+
validations_count: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
394
|
+
vehicle_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
395
|
+
}, "strict", z.ZodTypeAny, {
|
|
396
|
+
_id?: string | undefined;
|
|
397
|
+
agency_id?: string | undefined;
|
|
398
|
+
line_id?: string | undefined;
|
|
399
|
+
pattern_id?: string | undefined;
|
|
400
|
+
trip_id?: string | undefined;
|
|
401
|
+
route_id?: string | undefined;
|
|
402
|
+
analysis?: {
|
|
403
|
+
_id: string;
|
|
404
|
+
grade: "error" | "pass" | "fail";
|
|
405
|
+
value?: number | null | undefined;
|
|
406
|
+
message?: string | null | undefined;
|
|
407
|
+
reason?: string | null | undefined;
|
|
408
|
+
unit?: string | null | undefined;
|
|
409
|
+
}[] | undefined;
|
|
410
|
+
driver_ids?: string[] | undefined;
|
|
411
|
+
end_time_observed?: (number & {
|
|
412
|
+
__brand: "UnixTimestamp";
|
|
413
|
+
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
414
|
+
end_time_scheduled?: (number & {
|
|
415
|
+
__brand: "UnixTimestamp";
|
|
416
|
+
} & z.BRAND<"UnixTimestamp">) | undefined;
|
|
417
|
+
execution_status?: "success" | "failure" | "warning" | null | undefined;
|
|
418
|
+
extension_observed?: number | null | undefined;
|
|
419
|
+
extension_scheduled?: number | undefined;
|
|
420
|
+
hashed_shape_id?: string | undefined;
|
|
421
|
+
hashed_trip_id?: string | undefined;
|
|
422
|
+
headsign?: string | undefined;
|
|
423
|
+
operational_date?: (string & {
|
|
424
|
+
__brand: "OperationalDate";
|
|
425
|
+
} & z.BRAND<"OperationalDate">) | undefined;
|
|
426
|
+
passengers_estimated?: number | null | undefined;
|
|
427
|
+
plan_id?: string | undefined;
|
|
428
|
+
seen_first_at?: (number & {
|
|
429
|
+
__brand: "UnixTimestamp";
|
|
430
|
+
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
431
|
+
seen_last_at?: (number & {
|
|
432
|
+
__brand: "UnixTimestamp";
|
|
433
|
+
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
434
|
+
start_time_observed?: (number & {
|
|
435
|
+
__brand: "UnixTimestamp";
|
|
436
|
+
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
437
|
+
start_time_scheduled?: (number & {
|
|
438
|
+
__brand: "UnixTimestamp";
|
|
439
|
+
} & z.BRAND<"UnixTimestamp">) | undefined;
|
|
440
|
+
system_status?: "processing" | "error" | "pending" | "complete" | undefined;
|
|
441
|
+
validations_count?: number | null | undefined;
|
|
442
|
+
vehicle_ids?: string[] | undefined;
|
|
443
|
+
}, {
|
|
444
|
+
_id?: string | undefined;
|
|
445
|
+
agency_id?: string | undefined;
|
|
446
|
+
line_id?: string | undefined;
|
|
447
|
+
pattern_id?: string | undefined;
|
|
448
|
+
trip_id?: string | undefined;
|
|
449
|
+
route_id?: string | undefined;
|
|
450
|
+
analysis?: {
|
|
451
|
+
_id: string;
|
|
452
|
+
grade: "error" | "pass" | "fail";
|
|
453
|
+
value?: number | null | undefined;
|
|
454
|
+
message?: string | null | undefined;
|
|
455
|
+
reason?: string | null | undefined;
|
|
456
|
+
unit?: string | null | undefined;
|
|
457
|
+
}[] | undefined;
|
|
458
|
+
driver_ids?: string[] | undefined;
|
|
459
|
+
end_time_observed?: number | null | undefined;
|
|
460
|
+
end_time_scheduled?: number | undefined;
|
|
461
|
+
execution_status?: "success" | "failure" | "warning" | null | undefined;
|
|
462
|
+
extension_observed?: number | null | undefined;
|
|
463
|
+
extension_scheduled?: number | undefined;
|
|
464
|
+
hashed_shape_id?: string | undefined;
|
|
465
|
+
hashed_trip_id?: string | undefined;
|
|
466
|
+
headsign?: string | undefined;
|
|
467
|
+
operational_date?: string | undefined;
|
|
468
|
+
passengers_estimated?: number | null | undefined;
|
|
469
|
+
plan_id?: string | undefined;
|
|
470
|
+
seen_first_at?: number | null | undefined;
|
|
471
|
+
seen_last_at?: number | null | undefined;
|
|
472
|
+
start_time_observed?: number | null | undefined;
|
|
473
|
+
start_time_scheduled?: number | undefined;
|
|
474
|
+
system_status?: "processing" | "error" | "pending" | "complete" | undefined;
|
|
475
|
+
validations_count?: number | null | undefined;
|
|
476
|
+
vehicle_ids?: string[] | undefined;
|
|
477
|
+
}>;
|
|
478
|
+
export interface Ride extends Omit<z.infer<typeof RideSchema>, 'created_at' | 'end_time_observed' | 'end_time_scheduled' | 'operational_date' | 'seen_first_at' | 'seen_last_at' | 'start_time_observed' | 'start_time_scheduled' | 'updated_at'> {
|
|
479
|
+
created_at: UnixTimestamp;
|
|
480
|
+
end_time_observed: null | UnixTimestamp;
|
|
481
|
+
end_time_scheduled: null | UnixTimestamp;
|
|
482
|
+
operational_date: OperationalDate;
|
|
483
|
+
seen_first_at: null | UnixTimestamp;
|
|
484
|
+
seen_last_at: null | UnixTimestamp;
|
|
485
|
+
start_time_observed: null | UnixTimestamp;
|
|
486
|
+
start_time_scheduled: null | UnixTimestamp;
|
|
487
|
+
updated_at: UnixTimestamp;
|
|
488
|
+
}
|
|
489
|
+
export interface CreateRideDto extends Omit<z.infer<typeof CreateRideSchema>, 'end_time_observed' | 'end_time_scheduled' | 'operational_date' | 'seen_first_at' | 'seen_last_at' | 'start_time_observed' | 'start_time_scheduled'> {
|
|
490
|
+
end_time_observed: null | UnixTimestamp;
|
|
491
|
+
end_time_scheduled: null | UnixTimestamp;
|
|
492
|
+
operational_date: OperationalDate;
|
|
493
|
+
seen_first_at: null | UnixTimestamp;
|
|
494
|
+
seen_last_at: null | UnixTimestamp;
|
|
495
|
+
start_time_observed: null | UnixTimestamp;
|
|
496
|
+
start_time_scheduled: null | UnixTimestamp;
|
|
497
|
+
}
|
|
498
|
+
export type UpdateRideDto = Partial<CreateRideDto>;
|
package/dist/src/ride.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { DocumentSchema, validateOperationalDate, validateUnixTimestamp } from './common.js';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
/* * */
|
|
5
|
+
export const RideAnalysisSchema = z.object({
|
|
6
|
+
_id: z.string(),
|
|
7
|
+
grade: z.enum(['pass', 'fail', 'error']),
|
|
8
|
+
message: z.string().nullish(),
|
|
9
|
+
reason: z.string().nullish(),
|
|
10
|
+
unit: z.string().nullish(),
|
|
11
|
+
value: z.number().nullish(),
|
|
12
|
+
}).strict();
|
|
13
|
+
export const CreateRideAnalysisSchema = RideAnalysisSchema;
|
|
14
|
+
export const UpdateRideAnalysisSchema = RideAnalysisSchema.partial();
|
|
15
|
+
/* * */
|
|
16
|
+
export const RideSchema = DocumentSchema.extend({
|
|
17
|
+
agency_id: z.string(),
|
|
18
|
+
analysis: z.array(RideAnalysisSchema),
|
|
19
|
+
driver_ids: z.array(z.string()),
|
|
20
|
+
end_time_observed: z.number().transform(validateUnixTimestamp).brand('UnixTimestamp').nullish(),
|
|
21
|
+
end_time_scheduled: z.number().transform(validateUnixTimestamp).brand('UnixTimestamp'),
|
|
22
|
+
execution_status: z.enum(['success', 'failure', 'warning']).nullish(),
|
|
23
|
+
extension_observed: z.number().nullish(),
|
|
24
|
+
extension_scheduled: z.number(),
|
|
25
|
+
hashed_shape_id: z.string(),
|
|
26
|
+
hashed_trip_id: z.string(),
|
|
27
|
+
headsign: z.string(),
|
|
28
|
+
line_id: z.string(),
|
|
29
|
+
operational_date: z.string().transform(validateOperationalDate).brand('OperationalDate'),
|
|
30
|
+
passengers_estimated: z.number().nullish(),
|
|
31
|
+
pattern_id: z.string(),
|
|
32
|
+
plan_id: z.string(),
|
|
33
|
+
route_id: z.string(),
|
|
34
|
+
seen_first_at: z.number().transform(validateUnixTimestamp).brand('UnixTimestamp').nullish(),
|
|
35
|
+
seen_last_at: z.number().transform(validateUnixTimestamp).brand('UnixTimestamp').nullish(),
|
|
36
|
+
start_time_observed: z.number().transform(validateUnixTimestamp).brand('UnixTimestamp').nullish(),
|
|
37
|
+
start_time_scheduled: z.number().transform(validateUnixTimestamp).brand('UnixTimestamp'),
|
|
38
|
+
system_status: z.enum(['pending', 'processing', 'complete', 'error']),
|
|
39
|
+
trip_id: z.string(),
|
|
40
|
+
validations_count: z.number().nullish(),
|
|
41
|
+
vehicle_ids: z.array(z.string()),
|
|
42
|
+
}).strict();
|
|
43
|
+
export const CreateRideSchema = RideSchema.partial({ _id: true }).omit({ created_at: true, updated_at: true });
|
|
44
|
+
export const UpdateRideSchema = CreateRideSchema.partial();
|