spilt all

This commit is contained in:
Stephen Zhou
2026-01-25 15:55:10 +08:00
parent bdd183811e
commit 044e35fde4
25 changed files with 32 additions and 45 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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' })

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 = {
/**

View File

@ -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

View File

@ -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

View File

@ -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 = {
/**

View File

@ -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

View File

@ -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(),

View File

@ -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(),

View File

@ -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,

View File

@ -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(),

View File

@ -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,

View File

@ -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({

View File

@ -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,

View File

@ -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