@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.
446 lines (445 loc) • 14.1 kB
TypeScript
import { type UnixTimestamp } from '../_common/unix-timestamp.js';
import { z } from 'zod';
export declare const HashedTripWaypointSchema: z.ZodObject<{
arrival_time: z.ZodString;
departure_time: z.ZodString;
drop_off_type: z.ZodString;
pickup_type: z.ZodString;
shape_dist_traveled: z.ZodNumber;
stop_id: z.ZodString;
stop_lat: z.ZodNumber;
stop_lon: z.ZodNumber;
stop_name: z.ZodString;
stop_sequence: z.ZodNumber;
timepoint: z.ZodString;
}, "strict", z.ZodTypeAny, {
shape_dist_traveled: number;
arrival_time: string;
departure_time: string;
drop_off_type: string;
pickup_type: string;
stop_id: string;
stop_lat: number;
stop_lon: number;
stop_name: string;
stop_sequence: number;
timepoint: string;
}, {
shape_dist_traveled: number;
arrival_time: string;
departure_time: string;
drop_off_type: string;
pickup_type: string;
stop_id: string;
stop_lat: number;
stop_lon: number;
stop_name: string;
stop_sequence: number;
timepoint: string;
}>;
export declare const CreateHashedTripWaypointSchema: z.ZodObject<{
arrival_time: z.ZodString;
departure_time: z.ZodString;
drop_off_type: z.ZodString;
pickup_type: z.ZodString;
shape_dist_traveled: z.ZodNumber;
stop_id: z.ZodString;
stop_lat: z.ZodNumber;
stop_lon: z.ZodNumber;
stop_name: z.ZodString;
stop_sequence: z.ZodNumber;
timepoint: z.ZodString;
}, "strict", z.ZodTypeAny, {
shape_dist_traveled: number;
arrival_time: string;
departure_time: string;
drop_off_type: string;
pickup_type: string;
stop_id: string;
stop_lat: number;
stop_lon: number;
stop_name: string;
stop_sequence: number;
timepoint: string;
}, {
shape_dist_traveled: number;
arrival_time: string;
departure_time: string;
drop_off_type: string;
pickup_type: string;
stop_id: string;
stop_lat: number;
stop_lon: number;
stop_name: string;
stop_sequence: number;
timepoint: string;
}>;
export declare const UpdateHashedTripWaypointSchema: z.ZodObject<{
arrival_time: z.ZodOptional<z.ZodString>;
departure_time: z.ZodOptional<z.ZodString>;
drop_off_type: z.ZodOptional<z.ZodString>;
pickup_type: z.ZodOptional<z.ZodString>;
shape_dist_traveled: z.ZodOptional<z.ZodNumber>;
stop_id: z.ZodOptional<z.ZodString>;
stop_lat: z.ZodOptional<z.ZodNumber>;
stop_lon: z.ZodOptional<z.ZodNumber>;
stop_name: z.ZodOptional<z.ZodString>;
stop_sequence: z.ZodOptional<z.ZodNumber>;
timepoint: z.ZodOptional<z.ZodString>;
}, "strict", z.ZodTypeAny, {
shape_dist_traveled?: number | undefined;
arrival_time?: string | undefined;
departure_time?: string | undefined;
drop_off_type?: string | undefined;
pickup_type?: string | undefined;
stop_id?: string | undefined;
stop_lat?: number | undefined;
stop_lon?: number | undefined;
stop_name?: string | undefined;
stop_sequence?: number | undefined;
timepoint?: string | undefined;
}, {
shape_dist_traveled?: number | undefined;
arrival_time?: string | undefined;
departure_time?: string | undefined;
drop_off_type?: string | undefined;
pickup_type?: string | undefined;
stop_id?: string | undefined;
stop_lat?: number | undefined;
stop_lon?: number | undefined;
stop_name?: string | undefined;
stop_sequence?: number | undefined;
timepoint?: string | undefined;
}>;
export type HashedTripWaypoint = z.infer<typeof HashedTripWaypointSchema>;
export type CreateHashedTripWaypointDto = z.infer<typeof CreateHashedTripWaypointSchema>;
export type UpdateHashedTripWaypointDto = Partial<CreateHashedTripWaypointDto>;
export declare const HashedTripSchema: 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;
line_id: z.ZodString;
line_long_name: z.ZodString;
line_short_name: z.ZodString;
path: z.ZodArray<z.ZodObject<{
arrival_time: z.ZodString;
departure_time: z.ZodString;
drop_off_type: z.ZodString;
pickup_type: z.ZodString;
shape_dist_traveled: z.ZodNumber;
stop_id: z.ZodString;
stop_lat: z.ZodNumber;
stop_lon: z.ZodNumber;
stop_name: z.ZodString;
stop_sequence: z.ZodNumber;
timepoint: z.ZodString;
}, "strict", z.ZodTypeAny, {
shape_dist_traveled: number;
arrival_time: string;
departure_time: string;
drop_off_type: string;
pickup_type: string;
stop_id: string;
stop_lat: number;
stop_lon: number;
stop_name: string;
stop_sequence: number;
timepoint: string;
}, {
shape_dist_traveled: number;
arrival_time: string;
departure_time: string;
drop_off_type: string;
pickup_type: string;
stop_id: string;
stop_lat: number;
stop_lon: number;
stop_name: string;
stop_sequence: number;
timepoint: string;
}>, "many">;
pattern_id: z.ZodString;
route_color: z.ZodString;
route_id: z.ZodString;
route_long_name: z.ZodString;
route_short_name: z.ZodString;
route_text_color: z.ZodString;
trip_headsign: z.ZodString;
}, "strict", z.ZodTypeAny, {
_id: string;
path: {
shape_dist_traveled: number;
arrival_time: string;
departure_time: string;
drop_off_type: string;
pickup_type: string;
stop_id: string;
stop_lat: number;
stop_lon: number;
stop_name: string;
stop_sequence: number;
timepoint: string;
}[];
agency_id: string;
line_id: string;
line_long_name: string;
line_short_name: string;
pattern_id: string;
route_color: string;
route_id: string;
route_long_name: string;
route_short_name: string;
route_text_color: string;
trip_headsign: string;
created_at?: (number & {
__brand: "UnixTimestamp";
} & z.BRAND<"UnixTimestamp">) | null | undefined;
updated_at?: (number & {
__brand: "UnixTimestamp";
} & z.BRAND<"UnixTimestamp">) | null | undefined;
}, {
_id: string;
path: {
shape_dist_traveled: number;
arrival_time: string;
departure_time: string;
drop_off_type: string;
pickup_type: string;
stop_id: string;
stop_lat: number;
stop_lon: number;
stop_name: string;
stop_sequence: number;
timepoint: string;
}[];
agency_id: string;
line_id: string;
line_long_name: string;
line_short_name: string;
pattern_id: string;
route_color: string;
route_id: string;
route_long_name: string;
route_short_name: string;
route_text_color: string;
trip_headsign: string;
created_at?: number | null | undefined;
updated_at?: number | null | undefined;
}>;
export declare const CreateHashedTripSchema: z.ZodObject<Omit<{
_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;
line_id: z.ZodString;
line_long_name: z.ZodString;
line_short_name: z.ZodString;
path: z.ZodArray<z.ZodObject<{
arrival_time: z.ZodString;
departure_time: z.ZodString;
drop_off_type: z.ZodString;
pickup_type: z.ZodString;
shape_dist_traveled: z.ZodNumber;
stop_id: z.ZodString;
stop_lat: z.ZodNumber;
stop_lon: z.ZodNumber;
stop_name: z.ZodString;
stop_sequence: z.ZodNumber;
timepoint: z.ZodString;
}, "strict", z.ZodTypeAny, {
shape_dist_traveled: number;
arrival_time: string;
departure_time: string;
drop_off_type: string;
pickup_type: string;
stop_id: string;
stop_lat: number;
stop_lon: number;
stop_name: string;
stop_sequence: number;
timepoint: string;
}, {
shape_dist_traveled: number;
arrival_time: string;
departure_time: string;
drop_off_type: string;
pickup_type: string;
stop_id: string;
stop_lat: number;
stop_lon: number;
stop_name: string;
stop_sequence: number;
timepoint: string;
}>, "many">;
pattern_id: z.ZodString;
route_color: z.ZodString;
route_id: z.ZodString;
route_long_name: z.ZodString;
route_short_name: z.ZodString;
route_text_color: z.ZodString;
trip_headsign: z.ZodString;
}, "created_at" | "updated_at">, "strict", z.ZodTypeAny, {
_id: string;
path: {
shape_dist_traveled: number;
arrival_time: string;
departure_time: string;
drop_off_type: string;
pickup_type: string;
stop_id: string;
stop_lat: number;
stop_lon: number;
stop_name: string;
stop_sequence: number;
timepoint: string;
}[];
agency_id: string;
line_id: string;
line_long_name: string;
line_short_name: string;
pattern_id: string;
route_color: string;
route_id: string;
route_long_name: string;
route_short_name: string;
route_text_color: string;
trip_headsign: string;
}, {
_id: string;
path: {
shape_dist_traveled: number;
arrival_time: string;
departure_time: string;
drop_off_type: string;
pickup_type: string;
stop_id: string;
stop_lat: number;
stop_lon: number;
stop_name: string;
stop_sequence: number;
timepoint: string;
}[];
agency_id: string;
line_id: string;
line_long_name: string;
line_short_name: string;
pattern_id: string;
route_color: string;
route_id: string;
route_long_name: string;
route_short_name: string;
route_text_color: string;
trip_headsign: string;
}>;
export declare const UpdateHashedTripSchema: z.ZodObject<{
_id: z.ZodOptional<z.ZodString>;
path: z.ZodOptional<z.ZodArray<z.ZodObject<{
arrival_time: z.ZodString;
departure_time: z.ZodString;
drop_off_type: z.ZodString;
pickup_type: z.ZodString;
shape_dist_traveled: z.ZodNumber;
stop_id: z.ZodString;
stop_lat: z.ZodNumber;
stop_lon: z.ZodNumber;
stop_name: z.ZodString;
stop_sequence: z.ZodNumber;
timepoint: z.ZodString;
}, "strict", z.ZodTypeAny, {
shape_dist_traveled: number;
arrival_time: string;
departure_time: string;
drop_off_type: string;
pickup_type: string;
stop_id: string;
stop_lat: number;
stop_lon: number;
stop_name: string;
stop_sequence: number;
timepoint: string;
}, {
shape_dist_traveled: number;
arrival_time: string;
departure_time: string;
drop_off_type: string;
pickup_type: string;
stop_id: string;
stop_lat: number;
stop_lon: number;
stop_name: string;
stop_sequence: number;
timepoint: string;
}>, "many">>;
agency_id: z.ZodOptional<z.ZodString>;
line_id: z.ZodOptional<z.ZodString>;
line_long_name: z.ZodOptional<z.ZodString>;
line_short_name: z.ZodOptional<z.ZodString>;
pattern_id: z.ZodOptional<z.ZodString>;
route_color: z.ZodOptional<z.ZodString>;
route_id: z.ZodOptional<z.ZodString>;
route_long_name: z.ZodOptional<z.ZodString>;
route_short_name: z.ZodOptional<z.ZodString>;
route_text_color: z.ZodOptional<z.ZodString>;
trip_headsign: z.ZodOptional<z.ZodString>;
}, "strict", z.ZodTypeAny, {
_id?: string | undefined;
path?: {
shape_dist_traveled: number;
arrival_time: string;
departure_time: string;
drop_off_type: string;
pickup_type: string;
stop_id: string;
stop_lat: number;
stop_lon: number;
stop_name: string;
stop_sequence: number;
timepoint: string;
}[] | undefined;
agency_id?: string | undefined;
line_id?: string | undefined;
line_long_name?: string | undefined;
line_short_name?: string | undefined;
pattern_id?: string | undefined;
route_color?: string | undefined;
route_id?: string | undefined;
route_long_name?: string | undefined;
route_short_name?: string | undefined;
route_text_color?: string | undefined;
trip_headsign?: string | undefined;
}, {
_id?: string | undefined;
path?: {
shape_dist_traveled: number;
arrival_time: string;
departure_time: string;
drop_off_type: string;
pickup_type: string;
stop_id: string;
stop_lat: number;
stop_lon: number;
stop_name: string;
stop_sequence: number;
timepoint: string;
}[] | undefined;
agency_id?: string | undefined;
line_id?: string | undefined;
line_long_name?: string | undefined;
line_short_name?: string | undefined;
pattern_id?: string | undefined;
route_color?: string | undefined;
route_id?: string | undefined;
route_long_name?: string | undefined;
route_short_name?: string | undefined;
route_text_color?: string | undefined;
trip_headsign?: string | undefined;
}>;
export interface HashedTrip extends Omit<z.infer<typeof HashedTripSchema>, 'created_at' | 'updated_at'> {
created_at: UnixTimestamp;
updated_at: UnixTimestamp;
}
export type CreateHashedTripDto = z.infer<typeof CreateHashedTripSchema>;
export type UpdateHashedTripDto = Partial<CreateHashedTripDto>;