@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.
187 lines (186 loc) • 6.4 kB
TypeScript
import { type UnixTimestamp } from '../_common/unix-timestamp.js';
import { z } from 'zod';
export declare const HashedShapePointSchema: z.ZodObject<{
shape_dist_traveled: z.ZodNumber;
shape_pt_lat: z.ZodNumber;
shape_pt_lon: z.ZodNumber;
shape_pt_sequence: z.ZodNumber;
}, "strict", z.ZodTypeAny, {
shape_dist_traveled: number;
shape_pt_lat: number;
shape_pt_lon: number;
shape_pt_sequence: number;
}, {
shape_dist_traveled: number;
shape_pt_lat: number;
shape_pt_lon: number;
shape_pt_sequence: number;
}>;
export declare const CreateHashedShapePointSchema: z.ZodObject<{
shape_dist_traveled: z.ZodNumber;
shape_pt_lat: z.ZodNumber;
shape_pt_lon: z.ZodNumber;
shape_pt_sequence: z.ZodNumber;
}, "strict", z.ZodTypeAny, {
shape_dist_traveled: number;
shape_pt_lat: number;
shape_pt_lon: number;
shape_pt_sequence: number;
}, {
shape_dist_traveled: number;
shape_pt_lat: number;
shape_pt_lon: number;
shape_pt_sequence: number;
}>;
export declare const UpdateHashedShapePointSchema: z.ZodObject<{
shape_dist_traveled: z.ZodOptional<z.ZodNumber>;
shape_pt_lat: z.ZodOptional<z.ZodNumber>;
shape_pt_lon: z.ZodOptional<z.ZodNumber>;
shape_pt_sequence: z.ZodOptional<z.ZodNumber>;
}, "strict", z.ZodTypeAny, {
shape_dist_traveled?: number | undefined;
shape_pt_lat?: number | undefined;
shape_pt_lon?: number | undefined;
shape_pt_sequence?: number | undefined;
}, {
shape_dist_traveled?: number | undefined;
shape_pt_lat?: number | undefined;
shape_pt_lon?: number | undefined;
shape_pt_sequence?: number | undefined;
}>;
export type HashedShapePoint = z.infer<typeof HashedShapePointSchema>;
export type CreateHashedShapePointDto = z.infer<typeof CreateHashedShapePointSchema>;
export type UpdateHashedShapePointDto = Partial<CreateHashedShapePointDto>;
export declare const HashedShapeSchema: 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;
points: z.ZodArray<z.ZodObject<{
shape_dist_traveled: z.ZodNumber;
shape_pt_lat: z.ZodNumber;
shape_pt_lon: z.ZodNumber;
shape_pt_sequence: z.ZodNumber;
}, "strict", z.ZodTypeAny, {
shape_dist_traveled: number;
shape_pt_lat: number;
shape_pt_lon: number;
shape_pt_sequence: number;
}, {
shape_dist_traveled: number;
shape_pt_lat: number;
shape_pt_lon: number;
shape_pt_sequence: number;
}>, "many">;
}, "strict", z.ZodTypeAny, {
_id: string;
agency_id: string;
points: {
shape_dist_traveled: number;
shape_pt_lat: number;
shape_pt_lon: number;
shape_pt_sequence: number;
}[];
created_at?: (number & {
__brand: "UnixTimestamp";
} & z.BRAND<"UnixTimestamp">) | null | undefined;
updated_at?: (number & {
__brand: "UnixTimestamp";
} & z.BRAND<"UnixTimestamp">) | null | undefined;
}, {
_id: string;
agency_id: string;
points: {
shape_dist_traveled: number;
shape_pt_lat: number;
shape_pt_lon: number;
shape_pt_sequence: number;
}[];
created_at?: number | null | undefined;
updated_at?: number | null | undefined;
}>;
export declare const CreateHashedShapeSchema: z.ZodObject<Omit<{
_id: z.ZodOptional<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;
points: z.ZodArray<z.ZodObject<{
shape_dist_traveled: z.ZodNumber;
shape_pt_lat: z.ZodNumber;
shape_pt_lon: z.ZodNumber;
shape_pt_sequence: z.ZodNumber;
}, "strict", z.ZodTypeAny, {
shape_dist_traveled: number;
shape_pt_lat: number;
shape_pt_lon: number;
shape_pt_sequence: number;
}, {
shape_dist_traveled: number;
shape_pt_lat: number;
shape_pt_lon: number;
shape_pt_sequence: number;
}>, "many">;
}, "created_at" | "updated_at">, "strict", z.ZodTypeAny, {
agency_id: string;
points: {
shape_dist_traveled: number;
shape_pt_lat: number;
shape_pt_lon: number;
shape_pt_sequence: number;
}[];
_id?: string | undefined;
}, {
agency_id: string;
points: {
shape_dist_traveled: number;
shape_pt_lat: number;
shape_pt_lon: number;
shape_pt_sequence: number;
}[];
_id?: string | undefined;
}>;
export declare const UpdateHashedShapeSchema: z.ZodObject<{
_id: z.ZodOptional<z.ZodOptional<z.ZodString>>;
agency_id: z.ZodOptional<z.ZodString>;
points: z.ZodOptional<z.ZodArray<z.ZodObject<{
shape_dist_traveled: z.ZodNumber;
shape_pt_lat: z.ZodNumber;
shape_pt_lon: z.ZodNumber;
shape_pt_sequence: z.ZodNumber;
}, "strict", z.ZodTypeAny, {
shape_dist_traveled: number;
shape_pt_lat: number;
shape_pt_lon: number;
shape_pt_sequence: number;
}, {
shape_dist_traveled: number;
shape_pt_lat: number;
shape_pt_lon: number;
shape_pt_sequence: number;
}>, "many">>;
}, "strict", z.ZodTypeAny, {
_id?: string | undefined;
agency_id?: string | undefined;
points?: {
shape_dist_traveled: number;
shape_pt_lat: number;
shape_pt_lon: number;
shape_pt_sequence: number;
}[] | undefined;
}, {
_id?: string | undefined;
agency_id?: string | undefined;
points?: {
shape_dist_traveled: number;
shape_pt_lat: number;
shape_pt_lon: number;
shape_pt_sequence: number;
}[] | undefined;
}>;
export interface HashedShape extends Omit<z.infer<typeof HashedShapeSchema>, 'created_at' | 'updated_at'> {
created_at: UnixTimestamp;
updated_at: UnixTimestamp;
}
export type CreateHashedShapeDto = z.infer<typeof CreateHashedShapeSchema>;
export type UpdateHashedShapeDto = Partial<CreateHashedShapeDto>;