From c825280707a8f9425fec542bb054ac84fc02a56b Mon Sep 17 00:00:00 2001 From: shuaiplus <2327005759@qq.com> Date: Wed, 11 Feb 2026 21:38:54 +0800 Subject: [PATCH] fix: allow nullable name fields in user and cipher interfaces for better flexibility --- src/handlers/ciphers.ts | 2 +- src/types/index.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/handlers/ciphers.ts b/src/handlers/ciphers.ts index 65613eb..2f04b00 100644 --- a/src/handlers/ciphers.ts +++ b/src/handlers/ciphers.ts @@ -116,7 +116,7 @@ export async function handleCreateCipher(request: Request, env: Env, userId: str userId: userId, type: Number(cipherData.type) || 1, folderId: cipherData.folderId || null, - name: cipherData.name, + name: cipherData.name || null, notes: cipherData.notes || null, favorite: cipherData.favorite || false, login: cipherData.login || null, diff --git a/src/types/index.ts b/src/types/index.ts index 46c10b9..688241d 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -23,7 +23,7 @@ export interface Attachment { export interface User { id: string; email: string; - name: string; + name: string | null; masterPasswordHash: string; key: string; privateKey: string | null; @@ -119,7 +119,7 @@ export interface Cipher { userId: string; type: CipherType; folderId: string | null; - name: string; + name: string | null; notes: string | null; favorite: boolean; login: CipherLogin | null; @@ -200,7 +200,7 @@ export interface TokenResponse { export interface ProfileResponse { id: string; - name: string; + name: string | null; email: string; emailVerified: boolean; premium: boolean; @@ -227,7 +227,7 @@ export interface CipherResponse { organizationId: string | null; folderId: string | null; type: number; - name: string; + name: string | null; notes: string | null; favorite: boolean; login: CipherLogin | null;