@tmlmobilidade/types
Version:
105 lines (104 loc) • 5.24 kB
TypeScript
import { z } from 'zod';
export declare const FileExportTypes: readonly ["gtfs", "ride", "sams_analysis", "stop", "vehicle"];
export declare const FileExportTypeSchema: z.ZodEnum<["gtfs", "ride", "sams_analysis", "stop", "vehicle"]>;
export type FileExportType = z.infer<typeof FileExportTypeSchema>;
export declare const FileExportBaseSchema: z.ZodObject<Omit<{
_id: z.ZodString;
created_at: z.ZodEffects<z.ZodNumber, import("@tmlmobilidade/go-types-shared").UnixTimestamp, number>;
created_by: z.ZodDefault<z.ZodNullable<z.ZodString>>;
is_locked: z.ZodDefault<z.ZodBoolean>;
updated_at: z.ZodEffects<z.ZodNumber, import("@tmlmobilidade/go-types-shared").UnixTimestamp, number>;
updated_by: z.ZodOptional<z.ZodString>;
}, "is_locked"> & {
file_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
file_name: z.ZodString;
processing_status: z.ZodEnum<["waiting", "processing", "complete", "error", "skipped"]>;
properties: z.ZodRecord<z.ZodString, z.ZodAny>;
type: z.ZodEnum<["gtfs", "ride", "sams_analysis", "stop", "vehicle"]>;
}, "strip", z.ZodTypeAny, {
_id: string;
created_at: number & {
__brand: "UnixTimestamp";
};
created_by: string | null;
updated_at: number & {
__brand: "UnixTimestamp";
};
type: "gtfs" | "ride" | "sams_analysis" | "stop" | "vehicle";
file_name: string;
processing_status: "error" | "waiting" | "processing" | "complete" | "skipped";
properties: Record<string, any>;
updated_by?: string | undefined;
file_id?: string | null | undefined;
}, {
_id: string;
created_at: number;
updated_at: number;
type: "gtfs" | "ride" | "sams_analysis" | "stop" | "vehicle";
file_name: string;
processing_status: "error" | "waiting" | "processing" | "complete" | "skipped";
properties: Record<string, any>;
created_by?: string | null | undefined;
updated_by?: string | undefined;
file_id?: string | null | undefined;
}>;
export declare const CreateFileExportSchema: z.ZodObject<{
created_by: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
updated_by: z.ZodOptional<z.ZodOptional<z.ZodString>>;
type: z.ZodOptional<z.ZodEnum<["gtfs", "ride", "sams_analysis", "stop", "vehicle"]>>;
file_id: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
file_name: z.ZodOptional<z.ZodString>;
processing_status: z.ZodOptional<z.ZodEnum<["waiting", "processing", "complete", "error", "skipped"]>>;
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
}, "strip", z.ZodTypeAny, {
created_by?: string | null | undefined;
updated_by?: string | undefined;
type?: "gtfs" | "ride" | "sams_analysis" | "stop" | "vehicle" | undefined;
file_id?: string | null | undefined;
file_name?: string | undefined;
processing_status?: "error" | "waiting" | "processing" | "complete" | "skipped" | undefined;
properties?: Record<string, any> | undefined;
}, {
created_by?: string | null | undefined;
updated_by?: string | undefined;
type?: "gtfs" | "ride" | "sams_analysis" | "stop" | "vehicle" | undefined;
file_id?: string | null | undefined;
file_name?: string | undefined;
processing_status?: "error" | "waiting" | "processing" | "complete" | "skipped" | undefined;
properties?: Record<string, any> | undefined;
}>;
export declare const UpdateFileExportSchema: z.ZodObject<{
created_by: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>>;
updated_by: z.ZodOptional<z.ZodOptional<z.ZodOptional<z.ZodString>>>;
type: z.ZodOptional<z.ZodOptional<z.ZodEnum<["gtfs", "ride", "sams_analysis", "stop", "vehicle"]>>>;
file_id: z.ZodOptional<z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>>;
file_name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
processing_status: z.ZodOptional<z.ZodOptional<z.ZodEnum<["waiting", "processing", "complete", "error", "skipped"]>>>;
properties: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
}, "strip", z.ZodTypeAny, {
created_by?: string | null | undefined;
updated_by?: string | undefined;
type?: "gtfs" | "ride" | "sams_analysis" | "stop" | "vehicle" | undefined;
file_id?: string | null | undefined;
file_name?: string | undefined;
processing_status?: "error" | "waiting" | "processing" | "complete" | "skipped" | undefined;
properties?: Record<string, any> | undefined;
}, {
created_by?: string | null | undefined;
updated_by?: string | undefined;
type?: "gtfs" | "ride" | "sams_analysis" | "stop" | "vehicle" | undefined;
file_id?: string | null | undefined;
file_name?: string | undefined;
processing_status?: "error" | "waiting" | "processing" | "complete" | "skipped" | undefined;
properties?: Record<string, any> | undefined;
}>;
export type UpdateFileExport = z.infer<typeof UpdateFileExportSchema>;
export type CreateFileExportDto<T extends {
properties: Record<string, unknown>;
type: string;
}> = Omit<z.infer<typeof FileExportBaseSchema>, '_id' | 'created_at' | 'file_id' | 'processing_status' | 'updated_at'> & {
file_id: null;
processing_status?: 'waiting';
properties: T['properties'];
type: T['type'];
};