UNPKG

@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.

209 lines (208 loc) • 7.43 kB
import { type OperationalDate } from './_common/operational-date.js'; import { type UnixTimestamp } from './_common/unix-timestamp.js'; import { z } from 'zod'; export declare const AgencySchema: 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">>>; } & { contact_emails_pta: z.ZodDefault<z.ZodArray<z.ZodString, "many">>; contact_emails_pto: z.ZodDefault<z.ZodArray<z.ZodString, "many">>; fare_url: z.ZodString; financials: z.ZodObject<{ price_per_km: z.ZodNumber; total_vkm_per_year: z.ZodNumber; }, "strip", z.ZodTypeAny, { price_per_km: number; total_vkm_per_year: number; }, { price_per_km: number; total_vkm_per_year: number; }>; name: z.ZodString; operation_start_date: z.ZodBranded<z.ZodEffects<z.ZodString, OperationalDate, string>, "OperationalDate">; phone: z.ZodString; public_email: z.ZodString; short_name: z.ZodString; timezone: z.ZodDefault<z.ZodString>; website_url: z.ZodString; }, "strip", z.ZodTypeAny, { _id: string; contact_emails_pta: string[]; contact_emails_pto: string[]; fare_url: string; financials: { price_per_km: number; total_vkm_per_year: number; }; name: string; operation_start_date: string & { __brand: "OperationalDate"; } & z.BRAND<"OperationalDate">; phone: string; public_email: string; short_name: string; timezone: string; website_url: string; created_at?: (number & { __brand: "UnixTimestamp"; } & z.BRAND<"UnixTimestamp">) | null | undefined; updated_at?: (number & { __brand: "UnixTimestamp"; } & z.BRAND<"UnixTimestamp">) | null | undefined; }, { _id: string; fare_url: string; financials: { price_per_km: number; total_vkm_per_year: number; }; name: string; operation_start_date: string; phone: string; public_email: string; short_name: string; website_url: string; created_at?: number | null | undefined; updated_at?: number | null | undefined; contact_emails_pta?: string[] | undefined; contact_emails_pto?: string[] | undefined; timezone?: string | undefined; }>; export declare const CreateAgencySchema: 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">>>; } & { contact_emails_pta: z.ZodDefault<z.ZodArray<z.ZodString, "many">>; contact_emails_pto: z.ZodDefault<z.ZodArray<z.ZodString, "many">>; fare_url: z.ZodString; financials: z.ZodObject<{ price_per_km: z.ZodNumber; total_vkm_per_year: z.ZodNumber; }, "strip", z.ZodTypeAny, { price_per_km: number; total_vkm_per_year: number; }, { price_per_km: number; total_vkm_per_year: number; }>; name: z.ZodString; operation_start_date: z.ZodBranded<z.ZodEffects<z.ZodString, OperationalDate, string>, "OperationalDate">; phone: z.ZodString; public_email: z.ZodString; short_name: z.ZodString; timezone: z.ZodDefault<z.ZodString>; website_url: z.ZodString; }, "created_at" | "updated_at">, "strip", z.ZodTypeAny, { _id: string; contact_emails_pta: string[]; contact_emails_pto: string[]; fare_url: string; financials: { price_per_km: number; total_vkm_per_year: number; }; name: string; operation_start_date: string & { __brand: "OperationalDate"; } & z.BRAND<"OperationalDate">; phone: string; public_email: string; short_name: string; timezone: string; website_url: string; }, { _id: string; fare_url: string; financials: { price_per_km: number; total_vkm_per_year: number; }; name: string; operation_start_date: string; phone: string; public_email: string; short_name: string; website_url: string; contact_emails_pta?: string[] | undefined; contact_emails_pto?: string[] | undefined; timezone?: string | undefined; }>; export declare const UpdateAgencySchema: z.ZodObject<{ _id: z.ZodOptional<z.ZodString>; contact_emails_pta: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>; contact_emails_pto: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>; fare_url: z.ZodOptional<z.ZodString>; financials: z.ZodOptional<z.ZodObject<{ price_per_km: z.ZodNumber; total_vkm_per_year: z.ZodNumber; }, "strip", z.ZodTypeAny, { price_per_km: number; total_vkm_per_year: number; }, { price_per_km: number; total_vkm_per_year: number; }>>; name: z.ZodOptional<z.ZodString>; operation_start_date: z.ZodOptional<z.ZodBranded<z.ZodEffects<z.ZodString, OperationalDate, string>, "OperationalDate">>; phone: z.ZodOptional<z.ZodString>; public_email: z.ZodOptional<z.ZodString>; short_name: z.ZodOptional<z.ZodString>; timezone: z.ZodOptional<z.ZodDefault<z.ZodString>>; website_url: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { _id?: string | undefined; contact_emails_pta?: string[] | undefined; contact_emails_pto?: string[] | undefined; fare_url?: string | undefined; financials?: { price_per_km: number; total_vkm_per_year: number; } | undefined; name?: string | undefined; operation_start_date?: (string & { __brand: "OperationalDate"; } & z.BRAND<"OperationalDate">) | undefined; phone?: string | undefined; public_email?: string | undefined; short_name?: string | undefined; timezone?: string | undefined; website_url?: string | undefined; }, { _id?: string | undefined; contact_emails_pta?: string[] | undefined; contact_emails_pto?: string[] | undefined; fare_url?: string | undefined; financials?: { price_per_km: number; total_vkm_per_year: number; } | undefined; name?: string | undefined; operation_start_date?: string | undefined; phone?: string | undefined; public_email?: string | undefined; short_name?: string | undefined; timezone?: string | undefined; website_url?: string | undefined; }>; export interface Agency extends Omit<z.infer<typeof AgencySchema>, 'created_at' | 'operation_start_date' | 'updated_at'> { created_at: UnixTimestamp; operation_start_date: OperationalDate; updated_at: UnixTimestamp; } export interface CreateAgencyDto extends Omit<z.infer<typeof CreateAgencySchema>, 'operation_start_date'> { operation_start_date: OperationalDate; } export type UpdateAgencyDto = Partial<CreateAgencyDto>; export declare const AgencyPermissionSchema: z.ZodObject<{ agency_ids: z.ZodArray<z.ZodString, "many">; municipality_ids: z.ZodArray<z.ZodString, "many">; }, "strip", z.ZodTypeAny, { agency_ids: string[]; municipality_ids: string[]; }, { agency_ids: string[]; municipality_ids: string[]; }>; export type AgencyPermission = z.infer<typeof AgencyPermissionSchema>;