From 3b09092ede4453849a28e3840be71e9ff0d0ad16 Mon Sep 17 00:00:00 2001 From: heheer Date: Mon, 22 Dec 2025 17:38:22 +0800 Subject: [PATCH] type --- packages/service/core/app/record/type.ts | 56 ------------------------ 1 file changed, 56 deletions(-) diff --git a/packages/service/core/app/record/type.ts b/packages/service/core/app/record/type.ts index 85303b130..bab7ee087 100644 --- a/packages/service/core/app/record/type.ts +++ b/packages/service/core/app/record/type.ts @@ -9,61 +9,5 @@ export const AppRecordSchemaZod = z.object({ lastUsedTime: z.date() }); -// 创建应用记录时的 schema(不包含 _id) -export const CreateAppRecordSchemaZod = AppRecordSchemaZod.omit({ - _id: true -}); - -// 更新应用记录时的 schema(部分字段可选) -export const UpdateAppRecordSchemaZod = AppRecordSchemaZod.partial().omit({ - _id: true, - tmbId: true, - teamId: true, - appId: true -}); - -// 查询参数的 schema -export const AppRecordQuerySchemaZod = z.object({ - tmbId: z.string().optional(), - teamId: z.string().optional(), - appId: z.string().optional(), - lastUsedTime: z - .union([ - z.date(), - z.object({ - gte: z.date().optional(), - lte: z.date().optional(), - gt: z.date().optional(), - lt: z.date().optional() - }) - ]) - .optional() -}); - // TypeScript types inferred from Zod schemas export type AppRecordType = z.infer; -export type CreateAppRecordType = z.infer; -export type UpdateAppRecordType = z.infer; -export type AppRecordQueryType = z.infer; - -// 兼容旧版本的类型定义(保持向后兼容) -export type { - AppRecordType as AppRecordSchemaType, - CreateAppRecordType as AppRecordCreateType, - UpdateAppRecordType as AppRecordUpdateType -}; - -// 应用记录统计类型 -export const AppRecordStatsSchemaZod = z.object({ - totalRecords: z.number().min(0), - uniqueApps: z.number().min(0), - mostUsedApp: z - .object({ - appId: z.string(), - usageCount: z.number().min(0) - }) - .optional(), - lastUsedTime: z.date().optional() -}); - -export type AppRecordStatsType = z.infer;