@tmlmobilidade/types
Version:
266 lines (265 loc) • 17.1 kB
TypeScript
import { z } from 'zod';
export declare const AlertTypeSchema: z.ZodEnum<["PLANNED", "REALTIME"]>;
export declare const ReferenceTypeSchema: z.ZodEnum<["LINE", "STOP", "AGENCY", "TRIP"]>;
export type AlertType = z.infer<typeof AlertTypeSchema>;
export type ReferenceType = z.infer<typeof ReferenceTypeSchema>;
export declare const AlertSchema: z.ZodObject<{
_id: z.ZodString;
created_at: z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>;
is_locked: z.ZodDefault<z.ZodBoolean>;
updated_at: z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>;
updated_by: z.ZodOptional<z.ZodString>;
} & {
active_period_end_date: z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>>>;
active_period_start_date: z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>;
cause: z.ZodEnum<["ACCIDENT", "CONSTRUCTION", "DEMONSTRATION", "HOLIDAY", "MAINTENANCE", "MEDICAL_EMERGENCY", "OTHER_CAUSE", "POLICE_ACTIVITY", "STRIKE", "TECHNICAL_PROBLEM", "UNKNOWN_CAUSE", "WEATHER", "DRIVER_ABSENCE", "DRIVER_ISSUE", "HIGH_PASSENGER_LOAD", "ROAD_INCIDENT", "SYSTEM_FAILURE", "TRAFFIC_JAM", "VEHICLE_ISSUE"]>;
coordinates: z.ZodDefault<z.ZodNullable<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>;
created_by: z.ZodNullable<z.ZodString>;
description: z.ZodString;
effect: z.ZodEnum<["ACCESSIBILITY_ISSUE", "ADDITIONAL_SERVICE", "DETOUR", "MODIFIED_SERVICE", "NO_EFFECT", "NO_SERVICE", "OTHER_EFFECT", "REDUCED_SERVICE", "SIGNIFICANT_DELAYS", "STOP_MOVED", "UNKNOWN_EFFECT"]>;
external_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
file_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
info_url: z.ZodDefault<z.ZodNullable<z.ZodString>>;
municipality_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
publish_end_date: z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>>>;
publish_start_date: z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>>>;
publish_status: z.ZodDefault<z.ZodEnum<["PUBLISHED", "ARCHIVED", "DRAFT"]>>;
reference_type: z.ZodDefault<z.ZodNullable<z.ZodEnum<["LINE", "STOP", "AGENCY", "TRIP"]>>>;
references: z.ZodDefault<z.ZodArray<z.ZodObject<{
child_ids: z.ZodArray<z.ZodString, "many">;
parent_id: z.ZodString;
}, "strip", z.ZodTypeAny, {
child_ids: string[];
parent_id: string;
}, {
child_ids: string[];
parent_id: string;
}>, "many">>;
title: z.ZodString;
type: z.ZodDefault<z.ZodNullable<z.ZodEnum<["PLANNED", "REALTIME"]>>>;
}, "strip", z.ZodTypeAny, {
_id: string;
created_at: number & {
__brand: "UnixTimestamp";
};
created_by: string | null;
is_locked: boolean;
updated_at: number & {
__brand: "UnixTimestamp";
};
type: "PLANNED" | "REALTIME" | null;
active_period_end_date: import("./_common/unix-timestamp.js").UnixTimestamp | null;
active_period_start_date: number & {
__brand: "UnixTimestamp";
};
cause: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "HOLIDAY" | "MAINTENANCE" | "MEDICAL_EMERGENCY" | "OTHER_CAUSE" | "POLICE_ACTIVITY" | "STRIKE" | "TECHNICAL_PROBLEM" | "UNKNOWN_CAUSE" | "WEATHER" | "DRIVER_ABSENCE" | "DRIVER_ISSUE" | "HIGH_PASSENGER_LOAD" | "ROAD_INCIDENT" | "SYSTEM_FAILURE" | "TRAFFIC_JAM" | "VEHICLE_ISSUE";
coordinates: [number, number] | null;
description: string;
effect: "ACCESSIBILITY_ISSUE" | "ADDITIONAL_SERVICE" | "DETOUR" | "MODIFIED_SERVICE" | "NO_EFFECT" | "NO_SERVICE" | "OTHER_EFFECT" | "REDUCED_SERVICE" | "SIGNIFICANT_DELAYS" | "STOP_MOVED" | "UNKNOWN_EFFECT";
external_id: string | null;
file_id: string | null;
info_url: string | null;
municipality_ids: string[];
publish_end_date: import("./_common/unix-timestamp.js").UnixTimestamp | null;
publish_start_date: import("./_common/unix-timestamp.js").UnixTimestamp | null;
publish_status: "PUBLISHED" | "ARCHIVED" | "DRAFT";
reference_type: "LINE" | "STOP" | "AGENCY" | "TRIP" | null;
references: {
child_ids: string[];
parent_id: string;
}[];
title: string;
updated_by?: string | undefined;
}, {
_id: string;
created_at: number;
created_by: string | null;
updated_at: number;
active_period_start_date: number;
cause: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "HOLIDAY" | "MAINTENANCE" | "MEDICAL_EMERGENCY" | "OTHER_CAUSE" | "POLICE_ACTIVITY" | "STRIKE" | "TECHNICAL_PROBLEM" | "UNKNOWN_CAUSE" | "WEATHER" | "DRIVER_ABSENCE" | "DRIVER_ISSUE" | "HIGH_PASSENGER_LOAD" | "ROAD_INCIDENT" | "SYSTEM_FAILURE" | "TRAFFIC_JAM" | "VEHICLE_ISSUE";
description: string;
effect: "ACCESSIBILITY_ISSUE" | "ADDITIONAL_SERVICE" | "DETOUR" | "MODIFIED_SERVICE" | "NO_EFFECT" | "NO_SERVICE" | "OTHER_EFFECT" | "REDUCED_SERVICE" | "SIGNIFICANT_DELAYS" | "STOP_MOVED" | "UNKNOWN_EFFECT";
title: string;
is_locked?: boolean | undefined;
updated_by?: string | undefined;
type?: "PLANNED" | "REALTIME" | null | undefined;
active_period_end_date?: number | null | undefined;
coordinates?: [number, number] | null | undefined;
external_id?: string | null | undefined;
file_id?: string | null | undefined;
info_url?: string | null | undefined;
municipality_ids?: string[] | undefined;
publish_end_date?: number | null | undefined;
publish_start_date?: number | null | undefined;
publish_status?: "PUBLISHED" | "ARCHIVED" | "DRAFT" | undefined;
reference_type?: "LINE" | "STOP" | "AGENCY" | "TRIP" | null | undefined;
references?: {
child_ids: string[];
parent_id: string;
}[] | undefined;
}>;
export declare const CreateAlertSchema: z.ZodObject<Omit<{
_id: z.ZodString;
created_at: z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>;
is_locked: z.ZodDefault<z.ZodBoolean>;
updated_at: z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>;
updated_by: z.ZodOptional<z.ZodString>;
} & {
active_period_end_date: z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>>>;
active_period_start_date: z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>;
cause: z.ZodEnum<["ACCIDENT", "CONSTRUCTION", "DEMONSTRATION", "HOLIDAY", "MAINTENANCE", "MEDICAL_EMERGENCY", "OTHER_CAUSE", "POLICE_ACTIVITY", "STRIKE", "TECHNICAL_PROBLEM", "UNKNOWN_CAUSE", "WEATHER", "DRIVER_ABSENCE", "DRIVER_ISSUE", "HIGH_PASSENGER_LOAD", "ROAD_INCIDENT", "SYSTEM_FAILURE", "TRAFFIC_JAM", "VEHICLE_ISSUE"]>;
coordinates: z.ZodDefault<z.ZodNullable<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>;
created_by: z.ZodNullable<z.ZodString>;
description: z.ZodString;
effect: z.ZodEnum<["ACCESSIBILITY_ISSUE", "ADDITIONAL_SERVICE", "DETOUR", "MODIFIED_SERVICE", "NO_EFFECT", "NO_SERVICE", "OTHER_EFFECT", "REDUCED_SERVICE", "SIGNIFICANT_DELAYS", "STOP_MOVED", "UNKNOWN_EFFECT"]>;
external_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
file_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
info_url: z.ZodDefault<z.ZodNullable<z.ZodString>>;
municipality_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
publish_end_date: z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>>>;
publish_start_date: z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>>>;
publish_status: z.ZodDefault<z.ZodEnum<["PUBLISHED", "ARCHIVED", "DRAFT"]>>;
reference_type: z.ZodDefault<z.ZodNullable<z.ZodEnum<["LINE", "STOP", "AGENCY", "TRIP"]>>>;
references: z.ZodDefault<z.ZodArray<z.ZodObject<{
child_ids: z.ZodArray<z.ZodString, "many">;
parent_id: z.ZodString;
}, "strip", z.ZodTypeAny, {
child_ids: string[];
parent_id: string;
}, {
child_ids: string[];
parent_id: string;
}>, "many">>;
title: z.ZodString;
type: z.ZodDefault<z.ZodNullable<z.ZodEnum<["PLANNED", "REALTIME"]>>>;
}, "_id" | "created_at" | "created_by" | "updated_at" | "updated_by">, "strip", z.ZodTypeAny, {
is_locked: boolean;
type: "PLANNED" | "REALTIME" | null;
active_period_end_date: import("./_common/unix-timestamp.js").UnixTimestamp | null;
active_period_start_date: number & {
__brand: "UnixTimestamp";
};
cause: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "HOLIDAY" | "MAINTENANCE" | "MEDICAL_EMERGENCY" | "OTHER_CAUSE" | "POLICE_ACTIVITY" | "STRIKE" | "TECHNICAL_PROBLEM" | "UNKNOWN_CAUSE" | "WEATHER" | "DRIVER_ABSENCE" | "DRIVER_ISSUE" | "HIGH_PASSENGER_LOAD" | "ROAD_INCIDENT" | "SYSTEM_FAILURE" | "TRAFFIC_JAM" | "VEHICLE_ISSUE";
coordinates: [number, number] | null;
description: string;
effect: "ACCESSIBILITY_ISSUE" | "ADDITIONAL_SERVICE" | "DETOUR" | "MODIFIED_SERVICE" | "NO_EFFECT" | "NO_SERVICE" | "OTHER_EFFECT" | "REDUCED_SERVICE" | "SIGNIFICANT_DELAYS" | "STOP_MOVED" | "UNKNOWN_EFFECT";
external_id: string | null;
file_id: string | null;
info_url: string | null;
municipality_ids: string[];
publish_end_date: import("./_common/unix-timestamp.js").UnixTimestamp | null;
publish_start_date: import("./_common/unix-timestamp.js").UnixTimestamp | null;
publish_status: "PUBLISHED" | "ARCHIVED" | "DRAFT";
reference_type: "LINE" | "STOP" | "AGENCY" | "TRIP" | null;
references: {
child_ids: string[];
parent_id: string;
}[];
title: string;
}, {
active_period_start_date: number;
cause: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "HOLIDAY" | "MAINTENANCE" | "MEDICAL_EMERGENCY" | "OTHER_CAUSE" | "POLICE_ACTIVITY" | "STRIKE" | "TECHNICAL_PROBLEM" | "UNKNOWN_CAUSE" | "WEATHER" | "DRIVER_ABSENCE" | "DRIVER_ISSUE" | "HIGH_PASSENGER_LOAD" | "ROAD_INCIDENT" | "SYSTEM_FAILURE" | "TRAFFIC_JAM" | "VEHICLE_ISSUE";
description: string;
effect: "ACCESSIBILITY_ISSUE" | "ADDITIONAL_SERVICE" | "DETOUR" | "MODIFIED_SERVICE" | "NO_EFFECT" | "NO_SERVICE" | "OTHER_EFFECT" | "REDUCED_SERVICE" | "SIGNIFICANT_DELAYS" | "STOP_MOVED" | "UNKNOWN_EFFECT";
title: string;
is_locked?: boolean | undefined;
type?: "PLANNED" | "REALTIME" | null | undefined;
active_period_end_date?: number | null | undefined;
coordinates?: [number, number] | null | undefined;
external_id?: string | null | undefined;
file_id?: string | null | undefined;
info_url?: string | null | undefined;
municipality_ids?: string[] | undefined;
publish_end_date?: number | null | undefined;
publish_start_date?: number | null | undefined;
publish_status?: "PUBLISHED" | "ARCHIVED" | "DRAFT" | undefined;
reference_type?: "LINE" | "STOP" | "AGENCY" | "TRIP" | null | undefined;
references?: {
child_ids: string[];
parent_id: string;
}[] | undefined;
}>;
export declare const UpdateAlertSchema: z.ZodObject<{
is_locked: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
type: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodEnum<["PLANNED", "REALTIME"]>>>>;
active_period_end_date: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>>>>;
active_period_start_date: z.ZodOptional<z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>>;
cause: z.ZodOptional<z.ZodEnum<["ACCIDENT", "CONSTRUCTION", "DEMONSTRATION", "HOLIDAY", "MAINTENANCE", "MEDICAL_EMERGENCY", "OTHER_CAUSE", "POLICE_ACTIVITY", "STRIKE", "TECHNICAL_PROBLEM", "UNKNOWN_CAUSE", "WEATHER", "DRIVER_ABSENCE", "DRIVER_ISSUE", "HIGH_PASSENGER_LOAD", "ROAD_INCIDENT", "SYSTEM_FAILURE", "TRAFFIC_JAM", "VEHICLE_ISSUE"]>>;
coordinates: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>>;
description: z.ZodOptional<z.ZodString>;
effect: z.ZodOptional<z.ZodEnum<["ACCESSIBILITY_ISSUE", "ADDITIONAL_SERVICE", "DETOUR", "MODIFIED_SERVICE", "NO_EFFECT", "NO_SERVICE", "OTHER_EFFECT", "REDUCED_SERVICE", "SIGNIFICANT_DELAYS", "STOP_MOVED", "UNKNOWN_EFFECT"]>>;
external_id: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
file_id: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
info_url: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
municipality_ids: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
publish_end_date: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>>>>;
publish_start_date: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>>>>;
publish_status: z.ZodOptional<z.ZodDefault<z.ZodEnum<["PUBLISHED", "ARCHIVED", "DRAFT"]>>>;
reference_type: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodEnum<["LINE", "STOP", "AGENCY", "TRIP"]>>>>;
references: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
child_ids: z.ZodArray<z.ZodString, "many">;
parent_id: z.ZodString;
}, "strip", z.ZodTypeAny, {
child_ids: string[];
parent_id: string;
}, {
child_ids: string[];
parent_id: string;
}>, "many">>>;
title: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
is_locked?: boolean | undefined;
type?: "PLANNED" | "REALTIME" | null | undefined;
active_period_end_date?: import("./_common/unix-timestamp.js").UnixTimestamp | null | undefined;
active_period_start_date?: import("./_common/unix-timestamp.js").UnixTimestamp | undefined;
cause?: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "HOLIDAY" | "MAINTENANCE" | "MEDICAL_EMERGENCY" | "OTHER_CAUSE" | "POLICE_ACTIVITY" | "STRIKE" | "TECHNICAL_PROBLEM" | "UNKNOWN_CAUSE" | "WEATHER" | "DRIVER_ABSENCE" | "DRIVER_ISSUE" | "HIGH_PASSENGER_LOAD" | "ROAD_INCIDENT" | "SYSTEM_FAILURE" | "TRAFFIC_JAM" | "VEHICLE_ISSUE" | undefined;
coordinates?: [number, number] | null | undefined;
description?: string | undefined;
effect?: "ACCESSIBILITY_ISSUE" | "ADDITIONAL_SERVICE" | "DETOUR" | "MODIFIED_SERVICE" | "NO_EFFECT" | "NO_SERVICE" | "OTHER_EFFECT" | "REDUCED_SERVICE" | "SIGNIFICANT_DELAYS" | "STOP_MOVED" | "UNKNOWN_EFFECT" | undefined;
external_id?: string | null | undefined;
file_id?: string | null | undefined;
info_url?: string | null | undefined;
municipality_ids?: string[] | undefined;
publish_end_date?: import("./_common/unix-timestamp.js").UnixTimestamp | null | undefined;
publish_start_date?: import("./_common/unix-timestamp.js").UnixTimestamp | null | undefined;
publish_status?: "PUBLISHED" | "ARCHIVED" | "DRAFT" | undefined;
reference_type?: "LINE" | "STOP" | "AGENCY" | "TRIP" | null | undefined;
references?: {
child_ids: string[];
parent_id: string;
}[] | undefined;
title?: string | undefined;
}, {
is_locked?: boolean | undefined;
type?: "PLANNED" | "REALTIME" | null | undefined;
active_period_end_date?: number | null | undefined;
active_period_start_date?: number | undefined;
cause?: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "HOLIDAY" | "MAINTENANCE" | "MEDICAL_EMERGENCY" | "OTHER_CAUSE" | "POLICE_ACTIVITY" | "STRIKE" | "TECHNICAL_PROBLEM" | "UNKNOWN_CAUSE" | "WEATHER" | "DRIVER_ABSENCE" | "DRIVER_ISSUE" | "HIGH_PASSENGER_LOAD" | "ROAD_INCIDENT" | "SYSTEM_FAILURE" | "TRAFFIC_JAM" | "VEHICLE_ISSUE" | undefined;
coordinates?: [number, number] | null | undefined;
description?: string | undefined;
effect?: "ACCESSIBILITY_ISSUE" | "ADDITIONAL_SERVICE" | "DETOUR" | "MODIFIED_SERVICE" | "NO_EFFECT" | "NO_SERVICE" | "OTHER_EFFECT" | "REDUCED_SERVICE" | "SIGNIFICANT_DELAYS" | "STOP_MOVED" | "UNKNOWN_EFFECT" | undefined;
external_id?: string | null | undefined;
file_id?: string | null | undefined;
info_url?: string | null | undefined;
municipality_ids?: string[] | undefined;
publish_end_date?: number | null | undefined;
publish_start_date?: number | null | undefined;
publish_status?: "PUBLISHED" | "ARCHIVED" | "DRAFT" | undefined;
reference_type?: "LINE" | "STOP" | "AGENCY" | "TRIP" | null | undefined;
references?: {
child_ids: string[];
parent_id: string;
}[] | undefined;
title?: string | undefined;
}>;
export type Alert = z.infer<typeof AlertSchema>;
export type CreateAlertDto = z.infer<typeof CreateAlertSchema>;
export type UpdateAlertDto = z.infer<typeof UpdateAlertSchema>;
export declare const GetAllAlertsQuerySchema: z.ZodObject<{
realtime: z.ZodEffects<z.ZodBoolean, boolean, unknown>;
}, "strip", z.ZodTypeAny, {
realtime: boolean;
}, {
realtime?: unknown;
}>;
export type GetAllAlertsQuery = z.infer<typeof GetAllAlertsQuerySchema>;