mirror of
https://github.com/langgenius/dify.git
synced 2026-03-06 16:16:38 +08:00
spilt all
This commit is contained in:
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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' })
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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 = {
|
||||
/**
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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 = {
|
||||
/**
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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(),
|
||||
|
||||
@ -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(),
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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(),
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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({
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user