mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-16 15:08:46 +00:00
사소한 리팩토링
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
export type Ciphertext = {
|
||||
export interface Ciphertext {
|
||||
ciphertext: string; // Base64
|
||||
iv: string; // Base64
|
||||
};
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ export const passwordChangeRequest = z.object({
|
||||
export type PasswordChangeRequest = z.infer<typeof passwordChangeRequest>;
|
||||
|
||||
export const loginRequest = z.object({
|
||||
email: z.string().email().nonempty(),
|
||||
email: z.string().email(),
|
||||
password: z.string().trim().nonempty(),
|
||||
});
|
||||
export type LoginRequest = z.infer<typeof loginRequest>;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const categoryIdSchema = z.union([z.enum(["root"]), z.number().int().positive()]);
|
||||
export const categoryIdSchema = z.union([z.literal("root"), z.number().int().positive()]);
|
||||
|
||||
export const categoryInfoResponse = z.object({
|
||||
metadata: z
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const directoryIdSchema = z.union([z.enum(["root"]), z.number().int().positive()]);
|
||||
export const directoryIdSchema = z.union([z.literal("root"), z.number().int().positive()]);
|
||||
|
||||
export const directoryInfoResponse = z.object({
|
||||
metadata: z
|
||||
|
||||
@@ -9,6 +9,7 @@ export const fileInfoResponse = z.object({
|
||||
dekVersion: z.string().datetime(),
|
||||
contentType: z
|
||||
.string()
|
||||
.trim()
|
||||
.nonempty()
|
||||
.refine((value) => mime.getExtension(value) !== null), // MIME type
|
||||
contentIv: z.string().base64().nonempty(),
|
||||
@@ -49,6 +50,7 @@ export const fileUploadRequest = z.object({
|
||||
contentHmac: z.string().base64().nonempty(),
|
||||
contentType: z
|
||||
.string()
|
||||
.trim()
|
||||
.nonempty()
|
||||
.refine((value) => mime.getExtension(value) !== null), // MIME type
|
||||
contentIv: z.string().base64().nonempty(),
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const userInfoResponse = z.object({
|
||||
email: z.string().email().nonempty(),
|
||||
email: z.string().email(),
|
||||
nickname: z.string().nonempty(),
|
||||
});
|
||||
export type UserInfoResponse = z.infer<typeof userInfoResponse>;
|
||||
|
||||
export const nicknameChangeRequest = z.object({
|
||||
newNickname: z.string().min(2).max(8),
|
||||
newNickname: z.string().trim().min(2).max(8),
|
||||
});
|
||||
export type NicknameChangeRequest = z.infer<typeof nicknameChangeRequest>;
|
||||
|
||||
Reference in New Issue
Block a user