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.

122 lines (121 loc) • 4.64 kB
import { z } from 'zod'; export declare const FileSchema: z.ZodObject<{ _id: z.ZodString; created_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>, "UnixTimestamp">>>; updated_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>, "UnixTimestamp">>>; } & { created_by: z.ZodString; description: z.ZodOptional<z.ZodNullable<z.ZodString>>; metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>; name: z.ZodString; resource_id: z.ZodString; scope: z.ZodString; size: z.ZodNumber; type: z.ZodString; updated_by: z.ZodString; url: z.ZodOptional<z.ZodNullable<z.ZodString>>; }, "strict", z.ZodTypeAny, { _id: string; type: string; scope: string; created_by: string; name: string; resource_id: string; size: number; updated_by: string; created_at?: (number & { __brand: "UnixTimestamp"; } & z.BRAND<"UnixTimestamp">) | null | undefined; updated_at?: (number & { __brand: "UnixTimestamp"; } & z.BRAND<"UnixTimestamp">) | null | undefined; description?: string | null | undefined; metadata?: Record<string, unknown> | null | undefined; url?: string | null | undefined; }, { _id: string; type: string; scope: string; created_by: string; name: string; resource_id: string; size: number; updated_by: string; created_at?: number | null | undefined; updated_at?: number | null | undefined; description?: string | null | undefined; metadata?: Record<string, unknown> | null | undefined; url?: string | null | undefined; }>; export declare const CreateFileSchema: z.ZodObject<Omit<{ _id: z.ZodString; created_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>, "UnixTimestamp">>>; updated_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>, "UnixTimestamp">>>; } & { created_by: z.ZodString; description: z.ZodOptional<z.ZodNullable<z.ZodString>>; metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>; name: z.ZodString; resource_id: z.ZodString; scope: z.ZodString; size: z.ZodNumber; type: z.ZodString; updated_by: z.ZodString; url: z.ZodOptional<z.ZodNullable<z.ZodString>>; }, "_id" | "created_at" | "updated_at">, "strict", z.ZodTypeAny, { type: string; scope: string; created_by: string; name: string; resource_id: string; size: number; updated_by: string; description?: string | null | undefined; metadata?: Record<string, unknown> | null | undefined; url?: string | null | undefined; }, { type: string; scope: string; created_by: string; name: string; resource_id: string; size: number; updated_by: string; description?: string | null | undefined; metadata?: Record<string, unknown> | null | undefined; url?: string | null | undefined; }>; export declare const UpdateFileSchema: z.ZodObject<{ type: z.ZodOptional<z.ZodString>; scope: z.ZodOptional<z.ZodString>; name: z.ZodOptional<z.ZodString>; description: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>; metadata: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>; resource_id: z.ZodOptional<z.ZodString>; size: z.ZodOptional<z.ZodNumber>; updated_by: z.ZodOptional<z.ZodString>; url: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>; }, "strict", z.ZodTypeAny, { type?: string | undefined; scope?: string | undefined; name?: string | undefined; description?: string | null | undefined; metadata?: Record<string, unknown> | null | undefined; resource_id?: string | undefined; size?: number | undefined; updated_by?: string | undefined; url?: string | null | undefined; }, { type?: string | undefined; scope?: string | undefined; name?: string | undefined; description?: string | null | undefined; metadata?: Record<string, unknown> | null | undefined; resource_id?: string | undefined; size?: number | undefined; updated_by?: string | undefined; url?: string | null | undefined; }>; export type File = z.infer<typeof FileSchema>; export type CreateFileDto = z.infer<typeof CreateFileSchema>; export type UpdateFileDto = z.infer<typeof UpdateFileSchema>;