mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-11-04 08:10:28 +09:00
14 lines
440 B
TypeScript
14 lines
440 B
TypeScript
import { z } from "zod";
|
|
|
|
export const IdSchema = z.int().positive();
|
|
export const DirectoryIdSchema = z.union([z.literal("root"), IdSchema]);
|
|
export const CategoryIdSchema = z.union([z.literal("root"), IdSchema]);
|
|
export const Base64Schema = z.base64().nonempty();
|
|
|
|
export const EncryptedNameSchema = {
|
|
name: Base64Schema,
|
|
nameIv: Base64Schema,
|
|
};
|
|
|
|
export const toCiphertext = (ciphertext: string, iv: string) => ({ ciphertext, iv });
|