From 044e35fde4613671297aa5b2a98f48afbcf8da91 Mon Sep 17 00:00:00 2001 From: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Date: Sun, 25 Jan 2026 15:55:10 +0800 Subject: [PATCH] spilt all --- web/gen/orpc/annotations.gen.ts | 2 +- web/gen/orpc/application.gen.ts | 2 +- web/gen/orpc/chat.gen.ts | 2 +- web/gen/{orpc.gen.ts => orpc/common.gen.ts} | 14 ++++++------- web/gen/orpc/conversations.gen.ts | 2 +- web/gen/orpc/feedback.gen.ts | 2 +- web/gen/orpc/files.gen.ts | 2 +- web/gen/orpc/tts.gen.ts | 2 +- web/gen/types/annotations.gen.ts | 2 +- web/gen/types/application.gen.ts | 2 +- web/gen/types/chat.gen.ts | 2 +- web/gen/types/conversations.gen.ts | 2 +- web/gen/types/feedback.gen.ts | 2 +- web/gen/types/files.gen.ts | 2 +- .../{types.gen.ts => types/schemas.gen.ts} | 0 web/gen/types/tts.gen.ts | 2 +- web/gen/zod/annotations.gen.ts | 2 +- web/gen/zod/application.gen.ts | 2 +- web/gen/zod/chat.gen.ts | 2 +- web/gen/zod/conversations.gen.ts | 2 +- web/gen/zod/feedback.gen.ts | 2 +- web/gen/zod/files.gen.ts | 2 +- web/gen/{zod.gen.ts => zod/schemas.gen.ts} | 0 web/gen/zod/tts.gen.ts | 2 +- web/openapi-ts.config.ts | 21 ++++--------------- 25 files changed, 32 insertions(+), 45 deletions(-) rename web/gen/{orpc.gen.ts => orpc/common.gen.ts} (83%) rename web/gen/{types.gen.ts => types/schemas.gen.ts} (100%) rename web/gen/{zod.gen.ts => zod/schemas.gen.ts} (100%) diff --git a/web/gen/orpc/annotations.gen.ts b/web/gen/orpc/annotations.gen.ts index ddb709d74d..332b2513f6 100644 --- a/web/gen/orpc/annotations.gen.ts +++ b/web/gen/orpc/annotations.gen.ts @@ -2,8 +2,8 @@ import { z } from 'zod' -import { base } from '../orpc.gen' import { zCreateAnnotationData, zCreateAnnotationResponse, zDeleteAnnotationData, zGetAnnotationListData, zGetAnnotationListResponse, zGetInitialAnnotationReplySettingsStatusData, zGetInitialAnnotationReplySettingsStatusResponse, zInitialAnnotationReplySettingsData, zInitialAnnotationReplySettingsResponse, zUpdateAnnotationData, zUpdateAnnotationResponse } from '../zod/annotations.gen' +import { base } from './common.gen' /** * Get Annotation List diff --git a/web/gen/orpc/application.gen.ts b/web/gen/orpc/application.gen.ts index 4c767af3a9..01cec39142 100644 --- a/web/gen/orpc/application.gen.ts +++ b/web/gen/orpc/application.gen.ts @@ -2,8 +2,8 @@ import { z } from 'zod' -import { base } from '../orpc.gen' import { zGetChatAppInfoResponse, zGetChatAppMetaResponse, zGetChatAppParametersData, zGetChatAppParametersResponse, zGetChatWebAppSettingsResponse } from '../zod/application.gen' +import { base } from './common.gen' /** * Get Application Basic Information diff --git a/web/gen/orpc/chat.gen.ts b/web/gen/orpc/chat.gen.ts index 3357d4a9fb..a5ac0da669 100644 --- a/web/gen/orpc/chat.gen.ts +++ b/web/gen/orpc/chat.gen.ts @@ -2,8 +2,8 @@ import { z } from 'zod' -import { base } from '../orpc.gen' import { zGetSuggestedQuestionsData, zGetSuggestedQuestionsResponse, zSendChatMessageData, zSendChatMessageResponse, zStopChatMessageGenerationData, zStopChatMessageGenerationResponse } from '../zod/chat.gen' +import { base } from './common.gen' /** * Send Chat Message diff --git a/web/gen/orpc.gen.ts b/web/gen/orpc/common.gen.ts similarity index 83% rename from web/gen/orpc.gen.ts rename to web/gen/orpc/common.gen.ts index 44ab51addd..c54bbddad6 100644 --- a/web/gen/orpc.gen.ts +++ b/web/gen/orpc/common.gen.ts @@ -2,13 +2,13 @@ import { oc } from '@orpc/contract' -import { createAnnotationContract, deleteAnnotationContract, getAnnotationListContract, getInitialAnnotationReplySettingsStatusContract, initialAnnotationReplySettingsContract, updateAnnotationContract } from './orpc/annotations.gen' -import { getChatAppInfoContract, getChatAppMetaContract, getChatAppParametersContract, getChatWebAppSettingsContract } from './orpc/application.gen' -import { getSuggestedQuestionsContract, sendChatMessageContract, stopChatMessageGenerationContract } from './orpc/chat.gen' -import { deleteConversationContract, getConversationHistoryContract, getConversationsListContract, getConversationVariablesContract, renameConversationContract } from './orpc/conversations.gen' -import { getChatAppFeedbacksContract, postChatMessageFeedbackContract } from './orpc/feedback.gen' -import { previewChatFileContract, uploadChatFileContract } from './orpc/files.gen' -import { audioToTextContract, textToAudioChatContract } from './orpc/tts.gen' +import { createAnnotationContract, deleteAnnotationContract, getAnnotationListContract, getInitialAnnotationReplySettingsStatusContract, initialAnnotationReplySettingsContract, updateAnnotationContract } from './annotations.gen' +import { getChatAppInfoContract, getChatAppMetaContract, getChatAppParametersContract, getChatWebAppSettingsContract } from './application.gen' +import { getSuggestedQuestionsContract, sendChatMessageContract, stopChatMessageGenerationContract } from './chat.gen' +import { deleteConversationContract, getConversationHistoryContract, getConversationsListContract, getConversationVariablesContract, renameConversationContract } from './conversations.gen' +import { getChatAppFeedbacksContract, postChatMessageFeedbackContract } from './feedback.gen' +import { previewChatFileContract, uploadChatFileContract } from './files.gen' +import { audioToTextContract, textToAudioChatContract } from './tts.gen' export const base = oc.$route({ inputStructure: 'detailed', outputStructure: 'detailed' }) diff --git a/web/gen/orpc/conversations.gen.ts b/web/gen/orpc/conversations.gen.ts index 7772e6434d..61afad9fe2 100644 --- a/web/gen/orpc/conversations.gen.ts +++ b/web/gen/orpc/conversations.gen.ts @@ -2,8 +2,8 @@ import { z } from 'zod' -import { base } from '../orpc.gen' import { zDeleteConversationData, zGetConversationHistoryData, zGetConversationHistoryResponse, zGetConversationsListData, zGetConversationsListResponse, zGetConversationVariablesData, zGetConversationVariablesResponse, zRenameConversationData, zRenameConversationResponse } from '../zod/conversations.gen' +import { base } from './common.gen' /** * Get Conversation History Messages diff --git a/web/gen/orpc/feedback.gen.ts b/web/gen/orpc/feedback.gen.ts index 04c8be5e39..92299b7586 100644 --- a/web/gen/orpc/feedback.gen.ts +++ b/web/gen/orpc/feedback.gen.ts @@ -2,8 +2,8 @@ import { z } from 'zod' -import { base } from '../orpc.gen' import { zGetChatAppFeedbacksData, zGetChatAppFeedbacksResponse, zPostChatMessageFeedbackData, zPostChatMessageFeedbackResponse } from '../zod/feedback.gen' +import { base } from './common.gen' /** * Message Feedback diff --git a/web/gen/orpc/files.gen.ts b/web/gen/orpc/files.gen.ts index f06f4d28cd..f37118d3b9 100644 --- a/web/gen/orpc/files.gen.ts +++ b/web/gen/orpc/files.gen.ts @@ -2,8 +2,8 @@ import { z } from 'zod' -import { base } from '../orpc.gen' import { zPreviewChatFileData, zPreviewChatFileResponse, zUploadChatFileData, zUploadChatFileResponse } from '../zod/files.gen' +import { base } from './common.gen' /** * File Upload diff --git a/web/gen/orpc/tts.gen.ts b/web/gen/orpc/tts.gen.ts index 2803ed41a9..ebfa8b0c89 100644 --- a/web/gen/orpc/tts.gen.ts +++ b/web/gen/orpc/tts.gen.ts @@ -2,8 +2,8 @@ import { z } from 'zod' -import { base } from '../orpc.gen' import { zAudioToTextData, zAudioToTextResponse, zTextToAudioChatData, zTextToAudioChatResponse } from '../zod/tts.gen' +import { base } from './common.gen' /** * Speech to Text diff --git a/web/gen/types/annotations.gen.ts b/web/gen/types/annotations.gen.ts index 2e30b1c739..99c9a724ec 100644 --- a/web/gen/types/annotations.gen.ts +++ b/web/gen/types/annotations.gen.ts @@ -1,6 +1,6 @@ // This file is auto-generated by @hey-api/openapi-ts -import type { AnnotationItem, AnnotationListResponse, CreateAnnotationRequest, InitialAnnotationReplySettingsRequest, InitialAnnotationReplySettingsResponse as InitialAnnotationReplySettingsResponse2, InitialAnnotationReplySettingsStatusResponse, UpdateAnnotationRequest } from '../types.gen' +import type { AnnotationItem, AnnotationListResponse, CreateAnnotationRequest, InitialAnnotationReplySettingsRequest, InitialAnnotationReplySettingsResponse as InitialAnnotationReplySettingsResponse2, InitialAnnotationReplySettingsStatusResponse, UpdateAnnotationRequest } from './schemas.gen' export type GetAnnotationListData = { body?: never diff --git a/web/gen/types/application.gen.ts b/web/gen/types/application.gen.ts index 0a1ea2e2ad..00ffaf0feb 100644 --- a/web/gen/types/application.gen.ts +++ b/web/gen/types/application.gen.ts @@ -1,6 +1,6 @@ // This file is auto-generated by @hey-api/openapi-ts -import type { AppInfoResponse, AppMetaResponse, ChatAppParametersResponse, WebAppSettingsResponse } from '../types.gen' +import type { AppInfoResponse, AppMetaResponse, ChatAppParametersResponse, WebAppSettingsResponse } from './schemas.gen' export type GetChatAppInfoData = { body?: never diff --git a/web/gen/types/chat.gen.ts b/web/gen/types/chat.gen.ts index 7ebe33640e..f026323dca 100644 --- a/web/gen/types/chat.gen.ts +++ b/web/gen/types/chat.gen.ts @@ -1,6 +1,6 @@ // This file is auto-generated by @hey-api/openapi-ts -import type { ChatCompletionResponse, ChatRequest, ErrorResponse, SuggestedQuestionsResponse } from '../types.gen' +import type { ChatCompletionResponse, ChatRequest, ErrorResponse, SuggestedQuestionsResponse } from './schemas.gen' export type SendChatMessageData = { /** diff --git a/web/gen/types/conversations.gen.ts b/web/gen/types/conversations.gen.ts index 1772822ba3..bbc3133ef5 100644 --- a/web/gen/types/conversations.gen.ts +++ b/web/gen/types/conversations.gen.ts @@ -1,6 +1,6 @@ // This file is auto-generated by @hey-api/openapi-ts -import type { ConversationHistoryResponse, ConversationListItem, ConversationRenameRequest, ConversationsListResponse, ConversationVariablesResponse, ErrorResponse } from '../types.gen' +import type { ConversationHistoryResponse, ConversationListItem, ConversationRenameRequest, ConversationsListResponse, ConversationVariablesResponse, ErrorResponse } from './schemas.gen' export type GetConversationHistoryData = { body?: never diff --git a/web/gen/types/feedback.gen.ts b/web/gen/types/feedback.gen.ts index bd5877c914..48b90d3a21 100644 --- a/web/gen/types/feedback.gen.ts +++ b/web/gen/types/feedback.gen.ts @@ -1,6 +1,6 @@ // This file is auto-generated by @hey-api/openapi-ts -import type { AppFeedbacksResponse, MessageFeedbackRequest } from '../types.gen' +import type { AppFeedbacksResponse, MessageFeedbackRequest } from './schemas.gen' export type PostChatMessageFeedbackData = { body: MessageFeedbackRequest diff --git a/web/gen/types/files.gen.ts b/web/gen/types/files.gen.ts index 17581c0c08..61fc445a00 100644 --- a/web/gen/types/files.gen.ts +++ b/web/gen/types/files.gen.ts @@ -1,6 +1,6 @@ // This file is auto-generated by @hey-api/openapi-ts -import type { ErrorResponse, FileUploadResponse } from '../types.gen' +import type { ErrorResponse, FileUploadResponse } from './schemas.gen' export type UploadChatFileData = { /** diff --git a/web/gen/types.gen.ts b/web/gen/types/schemas.gen.ts similarity index 100% rename from web/gen/types.gen.ts rename to web/gen/types/schemas.gen.ts diff --git a/web/gen/types/tts.gen.ts b/web/gen/types/tts.gen.ts index d8d21a0442..2973ea1ccf 100644 --- a/web/gen/types/tts.gen.ts +++ b/web/gen/types/tts.gen.ts @@ -1,6 +1,6 @@ // This file is auto-generated by @hey-api/openapi-ts -import type { AudioToTextRequest, AudioToTextResponse as AudioToTextResponse2, TextToAudioFormRequest } from '../types.gen' +import type { AudioToTextRequest, AudioToTextResponse as AudioToTextResponse2, TextToAudioFormRequest } from './schemas.gen' export type AudioToTextData = { body: AudioToTextRequest diff --git a/web/gen/zod/annotations.gen.ts b/web/gen/zod/annotations.gen.ts index 3b88d200ee..2f65b34fbf 100644 --- a/web/gen/zod/annotations.gen.ts +++ b/web/gen/zod/annotations.gen.ts @@ -2,7 +2,7 @@ import { z } from 'zod' -import { zAnnotationItem, zAnnotationListResponse, zCreateAnnotationRequest, zInitialAnnotationReplySettingsRequest, zInitialAnnotationReplySettingsResponse as zInitialAnnotationReplySettingsResponse2, zInitialAnnotationReplySettingsStatusResponse, zUpdateAnnotationRequest } from '../zod.gen' +import { zAnnotationItem, zAnnotationListResponse, zCreateAnnotationRequest, zInitialAnnotationReplySettingsRequest, zInitialAnnotationReplySettingsResponse as zInitialAnnotationReplySettingsResponse2, zInitialAnnotationReplySettingsStatusResponse, zUpdateAnnotationRequest } from './schemas.gen' export const zGetAnnotationListData = z.object({ body: z.never().optional(), diff --git a/web/gen/zod/application.gen.ts b/web/gen/zod/application.gen.ts index 14b0b1aa59..2a666081a5 100644 --- a/web/gen/zod/application.gen.ts +++ b/web/gen/zod/application.gen.ts @@ -2,7 +2,7 @@ import { z } from 'zod' -import { zAppInfoResponse, zAppMetaResponse, zChatAppParametersResponse, zWebAppSettingsResponse } from '../zod.gen' +import { zAppInfoResponse, zAppMetaResponse, zChatAppParametersResponse, zWebAppSettingsResponse } from './schemas.gen' export const zGetChatAppInfoData = z.object({ body: z.never().optional(), diff --git a/web/gen/zod/chat.gen.ts b/web/gen/zod/chat.gen.ts index f0fc216e58..4c8bd1f1d7 100644 --- a/web/gen/zod/chat.gen.ts +++ b/web/gen/zod/chat.gen.ts @@ -2,7 +2,7 @@ import { z } from 'zod' -import { zChatCompletionResponse, zChatRequest, zSuggestedQuestionsResponse } from '../zod.gen' +import { zChatCompletionResponse, zChatRequest, zSuggestedQuestionsResponse } from './schemas.gen' export const zSendChatMessageData = z.object({ body: zChatRequest, diff --git a/web/gen/zod/conversations.gen.ts b/web/gen/zod/conversations.gen.ts index de50a28055..7af8c08c34 100644 --- a/web/gen/zod/conversations.gen.ts +++ b/web/gen/zod/conversations.gen.ts @@ -2,7 +2,7 @@ import { z } from 'zod' -import { zConversationHistoryResponse, zConversationListItem, zConversationRenameRequest, zConversationsListResponse, zConversationVariablesResponse } from '../zod.gen' +import { zConversationHistoryResponse, zConversationListItem, zConversationRenameRequest, zConversationsListResponse, zConversationVariablesResponse } from './schemas.gen' export const zGetConversationHistoryData = z.object({ body: z.never().optional(), diff --git a/web/gen/zod/feedback.gen.ts b/web/gen/zod/feedback.gen.ts index 2fb2556497..fe15d430e3 100644 --- a/web/gen/zod/feedback.gen.ts +++ b/web/gen/zod/feedback.gen.ts @@ -2,7 +2,7 @@ import { z } from 'zod' -import { zAppFeedbacksResponse, zMessageFeedbackRequest } from '../zod.gen' +import { zAppFeedbacksResponse, zMessageFeedbackRequest } from './schemas.gen' export const zPostChatMessageFeedbackData = z.object({ body: zMessageFeedbackRequest, diff --git a/web/gen/zod/files.gen.ts b/web/gen/zod/files.gen.ts index 40dd093999..1521085fff 100644 --- a/web/gen/zod/files.gen.ts +++ b/web/gen/zod/files.gen.ts @@ -2,7 +2,7 @@ import { z } from 'zod' -import { zFileUploadResponse } from '../zod.gen' +import { zFileUploadResponse } from './schemas.gen' export const zUploadChatFileData = z.object({ body: z.object({ diff --git a/web/gen/zod.gen.ts b/web/gen/zod/schemas.gen.ts similarity index 100% rename from web/gen/zod.gen.ts rename to web/gen/zod/schemas.gen.ts diff --git a/web/gen/zod/tts.gen.ts b/web/gen/zod/tts.gen.ts index 70ab6c32b1..6b467981a4 100644 --- a/web/gen/zod/tts.gen.ts +++ b/web/gen/zod/tts.gen.ts @@ -2,7 +2,7 @@ import { z } from 'zod' -import { zAudioToTextRequest, zAudioToTextResponse as zAudioToTextResponse2, zTextToAudioFormRequest } from '../zod.gen' +import { zAudioToTextRequest, zAudioToTextResponse as zAudioToTextResponse2, zTextToAudioFormRequest } from './schemas.gen' export const zAudioToTextData = z.object({ body: zAudioToTextRequest, diff --git a/web/openapi-ts.config.ts b/web/openapi-ts.config.ts index fe31348cc1..3deefe9c76 100644 --- a/web/openapi-ts.config.ts +++ b/web/openapi-ts.config.ts @@ -19,35 +19,22 @@ function getFilePathByTag(symbol: { meta?: SymbolMeta }): string | undefined { if (!meta) return undefined - // Get the first tag from symbol metadata + // Get the first tag from symbol metadata, fallback to 'schemas' for definitions const tag = meta.tags?.[0]?.toLowerCase() - if (!tag) - return undefined - // Handle typescript plugin symbols if (meta.tool === 'typescript') { - // Only split operation-related types (data/responses), not definitions - if (meta.resource === 'operation') { - return `types/${tag}` - } - // Keep definitions in the main types file - return undefined + return `types/${tag ?? 'schemas'}` } // Handle zod plugin symbols if (meta.tool === 'zod') { - // Only split operation-related schemas (requests/responses), not definitions - if (meta.resource === 'operation') { - return `zod/${tag}` - } - // Keep definitions in the main zod file - return undefined + return `zod/${tag ?? 'schemas'}` } // Handle orpc plugin symbols if (meta.pluginName === 'orpc') { - return `orpc/${tag}` + return `orpc/${tag ?? 'common'}` } return undefined