@tmlmobilidade/types
Version:
This package provides shared Zod validation schemas and their corresponding TypeScript types for use across projects. All types are automatically inferred from the schemas to ensure full type safety and reduce maintenance overhead.
77 lines (76 loc) • 2.72 kB
TypeScript
import { type UnixTimestamp } from './_common/unix-timestamp.js';
import { z } from 'zod';
export declare const VehicleEventSchema: z.ZodObject<{
_id: z.ZodString;
created_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>>;
updated_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>>;
} & {
agency_id: z.ZodString;
driver_id: z.ZodString;
event_id: z.ZodString;
extra_trip_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
latitude: z.ZodNumber;
longitude: z.ZodNumber;
odometer: z.ZodNumber;
pattern_id: z.ZodString;
received_at: z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">;
stop_id: z.ZodString;
trigger_activity: z.ZodString;
trigger_door: z.ZodString;
trip_id: z.ZodString;
vehicle_id: z.ZodString;
}, "strict", z.ZodTypeAny, {
_id: string;
agency_id: string;
stop_id: string;
pattern_id: string;
trip_id: string;
received_at: number & {
__brand: "UnixTimestamp";
} & z.BRAND<"UnixTimestamp">;
vehicle_id: string;
latitude: number;
longitude: number;
driver_id: string;
event_id: string;
odometer: number;
trigger_activity: string;
trigger_door: string;
created_at?: (number & {
__brand: "UnixTimestamp";
} & z.BRAND<"UnixTimestamp">) | null | undefined;
updated_at?: (number & {
__brand: "UnixTimestamp";
} & z.BRAND<"UnixTimestamp">) | null | undefined;
extra_trip_id?: string | null | undefined;
}, {
_id: string;
agency_id: string;
stop_id: string;
pattern_id: string;
trip_id: string;
received_at: number;
vehicle_id: string;
latitude: number;
longitude: number;
driver_id: string;
event_id: string;
odometer: number;
trigger_activity: string;
trigger_door: string;
created_at?: number | null | undefined;
updated_at?: number | null | undefined;
extra_trip_id?: string | null | undefined;
}>;
/**
* Vehicle Events are produced by the vehicle's on-board computer on a regular schedule
* or whenever a significant event occurs. These events are used to track the vehicle's
* location, speed, and status, as well as the current service being provided by the vehicle.
* These events are based on the GTFS-RT specification but extended with additional fields
* specific to TML's needs.
*/
export interface VehicleEvent extends Omit<z.infer<typeof VehicleEventSchema>, 'created_at' | 'received_at' | 'updated_at'> {
created_at: UnixTimestamp;
received_at: UnixTimestamp;
updated_at: UnixTimestamp;
}