@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.
75 lines (74 loc) • 2.98 kB
TypeScript
import { type UnixTimestamp } from '../_common/unix-timestamp.js';
import { z } from 'zod';
export declare const VerificationTokenSchema: 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">>>;
} & {
expires_at: z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">;
token: z.ZodString;
user_id: z.ZodString;
}, "strict", z.ZodTypeAny, {
_id: string;
user_id: string;
expires_at: number & {
__brand: "UnixTimestamp";
} & z.BRAND<"UnixTimestamp">;
token: string;
created_at?: (number & {
__brand: "UnixTimestamp";
} & z.BRAND<"UnixTimestamp">) | null | undefined;
updated_at?: (number & {
__brand: "UnixTimestamp";
} & z.BRAND<"UnixTimestamp">) | null | undefined;
}, {
_id: string;
user_id: string;
expires_at: number;
token: string;
created_at?: number | null | undefined;
updated_at?: number | null | undefined;
}>;
export declare const CreateVerificationTokenSchema: 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">>>;
} & {
expires_at: z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">;
token: z.ZodString;
user_id: z.ZodString;
}, "_id" | "created_at" | "updated_at">, "strict", z.ZodTypeAny, {
user_id: string;
expires_at: number & {
__brand: "UnixTimestamp";
} & z.BRAND<"UnixTimestamp">;
token: string;
}, {
user_id: string;
expires_at: number;
token: string;
}>;
export declare const UpdateVerificationTokenSchema: z.ZodObject<{
user_id: z.ZodOptional<z.ZodString>;
expires_at: z.ZodOptional<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>;
token: z.ZodOptional<z.ZodString>;
}, "strict", z.ZodTypeAny, {
user_id?: string | undefined;
expires_at?: (number & {
__brand: "UnixTimestamp";
} & z.BRAND<"UnixTimestamp">) | undefined;
token?: string | undefined;
}, {
user_id?: string | undefined;
expires_at?: number | undefined;
token?: string | undefined;
}>;
export interface VerificationToken extends Omit<z.infer<typeof VerificationTokenSchema>, 'created_at' | 'expires_at' | 'updated_at'> {
created_at: UnixTimestamp;
expires_at: UnixTimestamp;
updated_at: UnixTimestamp;
}
export type CreateVerificationTokenDto = Omit<z.infer<typeof CreateVerificationTokenSchema>, 'expires_at'> & {
expires_at: UnixTimestamp;
};
export type UpdateVerificationTokenDto = Partial<CreateVerificationTokenDto>;