mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-13 08:13:49 +10:00
ci: attempt to fix ci scripts by not importing prisma as type
This commit is contained in:
@ -12,7 +12,6 @@
|
||||
"@swc/helpers": "~0.5.2",
|
||||
"nestjs-zod": "^3.0.0",
|
||||
"@reactive-resume/utils": "*",
|
||||
"@reactive-resume/schema": "*",
|
||||
"@prisma/client": "^5.4.2"
|
||||
"@reactive-resume/schema": "*"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
export * from "./auth";
|
||||
export * from "./contributors";
|
||||
export * from "./resume";
|
||||
export * from "./secrets";
|
||||
export * from "./statistics";
|
||||
export * from "./user";
|
||||
|
||||
1
libs/dto/src/secrets/index.ts
Normal file
1
libs/dto/src/secrets/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from "./secrets";
|
||||
17
libs/dto/src/secrets/secrets.ts
Normal file
17
libs/dto/src/secrets/secrets.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import { idSchema } from "@reactive-resume/schema";
|
||||
import { createZodDto } from "nestjs-zod/dto";
|
||||
import { z } from "nestjs-zod/z";
|
||||
|
||||
export const secretsSchema = z.object({
|
||||
id: idSchema,
|
||||
password: z.string().nullable(),
|
||||
lastSignedIn: z.date().nullable(),
|
||||
verificationToken: z.string().nullable(),
|
||||
twoFactorSecret: z.string().nullable(),
|
||||
twoFactorBackupCodes: z.array(z.string()).default([]),
|
||||
refreshToken: z.string().nullable(),
|
||||
resetToken: z.string().nullable(),
|
||||
userId: idSchema,
|
||||
});
|
||||
|
||||
export class SecretsDto extends createZodDto(secretsSchema) {}
|
||||
@ -1,8 +1,9 @@
|
||||
import type { Prisma } from "@prisma/client";
|
||||
import { idSchema } from "@reactive-resume/schema";
|
||||
import { createZodDto } from "nestjs-zod/dto";
|
||||
import { z } from "nestjs-zod/z";
|
||||
|
||||
import { secretsSchema } from "../secrets";
|
||||
|
||||
export const usernameSchema = z
|
||||
.string()
|
||||
.min(3)
|
||||
@ -28,4 +29,6 @@ export const userSchema = z.object({
|
||||
|
||||
export class UserDto extends createZodDto(userSchema) {}
|
||||
|
||||
export type UserWithSecrets = Prisma.UserGetPayload<{ include: { secrets: true } }>;
|
||||
export const userWithSecretsSchema = userSchema.merge(z.object({ secrets: secretsSchema }));
|
||||
|
||||
export class UserWithSecrets extends createZodDto(userWithSecretsSchema) {}
|
||||
|
||||
Reference in New Issue
Block a user