mirror of
https://github.com/langgenius/dify.git
synced 2026-06-07 16:32:01 +08:00
729 lines
16 KiB
TypeScript
729 lines
16 KiB
TypeScript
// This file is auto-generated by @hey-api/openapi-ts
|
|
|
|
import * as z from 'zod'
|
|
|
|
/**
|
|
* AccessModeResponse
|
|
*/
|
|
export const zAccessModeResponse = z.object({
|
|
accessMode: z.string(),
|
|
})
|
|
|
|
/**
|
|
* AccessTokenData
|
|
*/
|
|
export const zAccessTokenData = z.object({
|
|
access_token: z.string(),
|
|
})
|
|
|
|
/**
|
|
* AccessTokenResultResponse
|
|
*/
|
|
export const zAccessTokenResultResponse = z.object({
|
|
data: zAccessTokenData,
|
|
result: z.string(),
|
|
})
|
|
|
|
/**
|
|
* AppAccessModeQuery
|
|
*/
|
|
export const zAppAccessModeQuery = z.object({
|
|
appCode: z.string().nullish(),
|
|
appId: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* BooleanResultResponse
|
|
*/
|
|
export const zBooleanResultResponse = z.object({
|
|
result: z.boolean(),
|
|
})
|
|
|
|
/**
|
|
* BrandingModel
|
|
*/
|
|
export const zBrandingModel = z.object({
|
|
application_title: z.string().default(''),
|
|
enabled: z.boolean().default(false),
|
|
favicon: z.string().default(''),
|
|
login_page_logo: z.string().default(''),
|
|
workspace_logo: z.string().default(''),
|
|
})
|
|
|
|
/**
|
|
* ChatMessagePayload
|
|
*/
|
|
export const zChatMessagePayload = z.object({
|
|
conversation_id: z.string().nullish(),
|
|
files: z.array(z.record(z.string(), z.unknown())).nullish(),
|
|
inputs: z.record(z.string(), z.unknown()),
|
|
parent_message_id: z.string().nullish(),
|
|
query: z.string(),
|
|
response_mode: z.enum(['blocking', 'streaming']).nullish(),
|
|
retriever_from: z.string().optional().default('web_app'),
|
|
})
|
|
|
|
/**
|
|
* CompletionMessagePayload
|
|
*/
|
|
export const zCompletionMessagePayload = z.object({
|
|
files: z.array(z.record(z.string(), z.unknown())).nullish(),
|
|
inputs: z.record(z.string(), z.unknown()),
|
|
query: z.string().optional().default(''),
|
|
response_mode: z.enum(['blocking', 'streaming']).nullish(),
|
|
retriever_from: z.string().optional().default('web_app'),
|
|
})
|
|
|
|
/**
|
|
* ConversationListQuery
|
|
*/
|
|
export const zConversationListQuery = z.object({
|
|
last_id: z.string().nullish(),
|
|
limit: z.int().gte(1).lte(100).optional().default(20),
|
|
pinned: z.boolean().nullish(),
|
|
sort_by: z
|
|
.enum(['-created_at', '-updated_at', 'created_at', 'updated_at'])
|
|
.optional()
|
|
.default('-updated_at'),
|
|
})
|
|
|
|
/**
|
|
* ConversationRenamePayload
|
|
*/
|
|
export const zConversationRenamePayload = z.object({
|
|
auto_generate: z.boolean().optional().default(false),
|
|
name: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* EmailCodeLoginSendPayload
|
|
*/
|
|
export const zEmailCodeLoginSendPayload = z.object({
|
|
email: z.string(),
|
|
language: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* EmailCodeLoginVerifyPayload
|
|
*/
|
|
export const zEmailCodeLoginVerifyPayload = z.object({
|
|
code: z.string(),
|
|
email: z.string(),
|
|
token: z.string().min(1),
|
|
})
|
|
|
|
/**
|
|
* FileResponse
|
|
*/
|
|
export const zFileResponse = z.object({
|
|
conversation_id: z.string().nullish(),
|
|
created_at: z.int().nullish(),
|
|
created_by: z.string().nullish(),
|
|
extension: z.string().nullish(),
|
|
file_key: z.string().nullish(),
|
|
id: z.string(),
|
|
mime_type: z.string().nullish(),
|
|
name: z.string(),
|
|
original_url: z.string().nullish(),
|
|
preview_url: z.string().nullish(),
|
|
size: z.int(),
|
|
source_url: z.string().nullish(),
|
|
tenant_id: z.string().nullish(),
|
|
user_id: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* FileWithSignedUrl
|
|
*/
|
|
export const zFileWithSignedUrl = z.object({
|
|
created_at: z.int().nullable(),
|
|
created_by: z.string().nullable(),
|
|
extension: z.string().nullable(),
|
|
id: z.string(),
|
|
mime_type: z.string().nullable(),
|
|
name: z.string(),
|
|
size: z.int(),
|
|
url: z.string().nullable(),
|
|
})
|
|
|
|
/**
|
|
* ForgotPasswordCheckPayload
|
|
*/
|
|
export const zForgotPasswordCheckPayload = z.object({
|
|
code: z.string(),
|
|
email: z.string(),
|
|
token: z.string().min(1),
|
|
})
|
|
|
|
/**
|
|
* ForgotPasswordResetPayload
|
|
*/
|
|
export const zForgotPasswordResetPayload = z.object({
|
|
new_password: z.string(),
|
|
password_confirm: z.string(),
|
|
token: z.string().min(1),
|
|
})
|
|
|
|
/**
|
|
* ForgotPasswordSendPayload
|
|
*/
|
|
export const zForgotPasswordSendPayload = z.object({
|
|
email: z.string(),
|
|
language: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* LicenseLimitationModel
|
|
*
|
|
* - enabled: whether this limit is enforced
|
|
* - size: current usage count
|
|
* - limit: maximum allowed count; 0 means unlimited
|
|
*/
|
|
export const zLicenseLimitationModel = z.object({
|
|
enabled: z.boolean().default(false),
|
|
limit: z.int().default(0),
|
|
size: z.int().default(0),
|
|
})
|
|
|
|
/**
|
|
* LicenseStatus
|
|
*/
|
|
export const zLicenseStatus = z.enum(['active', 'expired', 'expiring', 'inactive', 'lost', 'none'])
|
|
|
|
/**
|
|
* LicenseModel
|
|
*/
|
|
export const zLicenseModel = z.object({
|
|
expired_at: z.string().default(''),
|
|
status: zLicenseStatus,
|
|
workspaces: zLicenseLimitationModel,
|
|
})
|
|
|
|
/**
|
|
* LoginPayload
|
|
*/
|
|
export const zLoginPayload = z.object({
|
|
email: z.string(),
|
|
password: z.string(),
|
|
})
|
|
|
|
/**
|
|
* LoginStatusResponse
|
|
*/
|
|
export const zLoginStatusResponse = z.object({
|
|
app_logged_in: z.boolean(),
|
|
logged_in: z.boolean(),
|
|
})
|
|
|
|
/**
|
|
* MessageFeedbackPayload
|
|
*/
|
|
export const zMessageFeedbackPayload = z.object({
|
|
content: z.string().nullish(),
|
|
rating: z.enum(['dislike', 'like']).nullish(),
|
|
})
|
|
|
|
/**
|
|
* MessageListQuery
|
|
*/
|
|
export const zMessageListQuery = z.object({
|
|
conversation_id: z.string(),
|
|
first_id: z.string().nullish(),
|
|
limit: z.int().gte(1).lte(100).optional().default(20),
|
|
})
|
|
|
|
/**
|
|
* MessageMoreLikeThisQuery
|
|
*/
|
|
export const zMessageMoreLikeThisQuery = z.object({
|
|
response_mode: z.enum(['blocking', 'streaming']),
|
|
})
|
|
|
|
/**
|
|
* PluginInstallationScope
|
|
*/
|
|
export const zPluginInstallationScope = z.enum([
|
|
'all',
|
|
'none',
|
|
'official_and_specific_partners',
|
|
'official_only',
|
|
])
|
|
|
|
/**
|
|
* PluginInstallationPermissionModel
|
|
*/
|
|
export const zPluginInstallationPermissionModel = z.object({
|
|
plugin_installation_scope: zPluginInstallationScope,
|
|
restrict_to_marketplace_only: z.boolean().default(false),
|
|
})
|
|
|
|
/**
|
|
* PluginManagerModel
|
|
*/
|
|
export const zPluginManagerModel = z.object({
|
|
enabled: z.boolean().default(false),
|
|
})
|
|
|
|
/**
|
|
* RemoteFileInfo
|
|
*/
|
|
export const zRemoteFileInfo = z.object({
|
|
file_length: z.int(),
|
|
file_type: z.string(),
|
|
})
|
|
|
|
/**
|
|
* RemoteFileUploadPayload
|
|
*/
|
|
export const zRemoteFileUploadPayload = z.object({
|
|
url: z.url().min(1).max(2083),
|
|
})
|
|
|
|
/**
|
|
* ResultResponse
|
|
*/
|
|
export const zResultResponse = z.object({
|
|
result: z.string(),
|
|
})
|
|
|
|
/**
|
|
* SavedMessageCreatePayload
|
|
*/
|
|
export const zSavedMessageCreatePayload = z.object({
|
|
message_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* SavedMessageListQuery
|
|
*/
|
|
export const zSavedMessageListQuery = z.object({
|
|
last_id: z.string().nullish(),
|
|
limit: z.int().gte(1).lte(100).optional().default(20),
|
|
})
|
|
|
|
/**
|
|
* SimpleResultDataResponse
|
|
*/
|
|
export const zSimpleResultDataResponse = z.object({
|
|
data: z.string(),
|
|
result: z.string(),
|
|
})
|
|
|
|
/**
|
|
* SimpleResultResponse
|
|
*/
|
|
export const zSimpleResultResponse = z.object({
|
|
result: z.string(),
|
|
})
|
|
|
|
/**
|
|
* SuggestedQuestionsResponse
|
|
*/
|
|
export const zSuggestedQuestionsResponse = z.object({
|
|
data: z.array(z.string()),
|
|
})
|
|
|
|
/**
|
|
* TextToAudioPayload
|
|
*/
|
|
export const zTextToAudioPayload = z.object({
|
|
message_id: z.string().nullish(),
|
|
streaming: z.boolean().nullish(),
|
|
text: z.string().nullish(),
|
|
voice: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* VerificationTokenResponse
|
|
*/
|
|
export const zVerificationTokenResponse = z.object({
|
|
email: z.string(),
|
|
is_valid: z.boolean(),
|
|
token: z.string(),
|
|
})
|
|
|
|
/**
|
|
* WebAppAuthSSOModel
|
|
*/
|
|
export const zWebAppAuthSsoModel = z.object({
|
|
protocol: z.string().default(''),
|
|
})
|
|
|
|
/**
|
|
* WebAppAuthModel
|
|
*/
|
|
export const zWebAppAuthModel = z.object({
|
|
allow_email_code_login: z.boolean().default(false),
|
|
allow_email_password_login: z.boolean().default(false),
|
|
allow_sso: z.boolean().default(false),
|
|
enabled: z.boolean().default(false),
|
|
sso_config: zWebAppAuthSsoModel,
|
|
})
|
|
|
|
/**
|
|
* SystemFeatureModel
|
|
*/
|
|
export const zSystemFeatureModel = z.object({
|
|
branding: zBrandingModel,
|
|
enable_change_email: z.boolean().default(true),
|
|
enable_collaboration_mode: z.boolean().default(true),
|
|
enable_creators_platform: z.boolean().default(false),
|
|
enable_email_code_login: z.boolean().default(false),
|
|
enable_email_password_login: z.boolean().default(true),
|
|
enable_explore_banner: z.boolean().default(false),
|
|
enable_marketplace: z.boolean().default(false),
|
|
enable_social_oauth_login: z.boolean().default(false),
|
|
enable_trial_app: z.boolean().default(false),
|
|
is_allow_create_workspace: z.boolean().default(false),
|
|
is_allow_register: z.boolean().default(false),
|
|
is_email_setup: z.boolean().default(false),
|
|
license: zLicenseModel,
|
|
max_plugin_package_size: z.int().default(15728640),
|
|
plugin_installation_permission: zPluginInstallationPermissionModel,
|
|
plugin_manager: zPluginManagerModel,
|
|
sso_enforced_for_signin: z.boolean().default(false),
|
|
sso_enforced_for_signin_protocol: z.string().default(''),
|
|
webapp_auth: zWebAppAuthModel,
|
|
})
|
|
|
|
/**
|
|
* WorkflowRunPayload
|
|
*/
|
|
export const zWorkflowRunPayload = z.object({
|
|
files: z.array(z.record(z.string(), z.unknown())).nullish(),
|
|
inputs: z.record(z.string(), z.unknown()),
|
|
})
|
|
|
|
/**
|
|
* Success
|
|
*/
|
|
export const zPostAudioToTextResponse = z.record(z.string(), z.unknown())
|
|
|
|
export const zPostChatMessagesBody = zChatMessagePayload
|
|
|
|
/**
|
|
* Success
|
|
*/
|
|
export const zPostChatMessagesResponse = z.record(z.string(), z.unknown())
|
|
|
|
export const zPostChatMessagesByTaskIdStopPath = z.object({
|
|
task_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Success
|
|
*/
|
|
export const zPostChatMessagesByTaskIdStopResponse = zSimpleResultResponse
|
|
|
|
export const zPostCompletionMessagesBody = zCompletionMessagePayload
|
|
|
|
/**
|
|
* Success
|
|
*/
|
|
export const zPostCompletionMessagesResponse = z.record(z.string(), z.unknown())
|
|
|
|
export const zPostCompletionMessagesByTaskIdStopPath = z.object({
|
|
task_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Success
|
|
*/
|
|
export const zPostCompletionMessagesByTaskIdStopResponse = zSimpleResultResponse
|
|
|
|
export const zGetConversationsQuery = z.object({
|
|
last_id: z.string().optional(),
|
|
limit: z.int().optional().default(20),
|
|
pinned: z.enum(['false', 'true']).optional(),
|
|
sort_by: z
|
|
.enum(['-created_at', '-updated_at', 'created_at', 'updated_at'])
|
|
.optional()
|
|
.default('-updated_at'),
|
|
})
|
|
|
|
/**
|
|
* Success
|
|
*/
|
|
export const zGetConversationsResponse = z.record(z.string(), z.unknown())
|
|
|
|
export const zDeleteConversationsByCIdPath = z.object({
|
|
c_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Conversation deleted successfully
|
|
*/
|
|
export const zDeleteConversationsByCIdResponse = z.record(z.string(), z.never())
|
|
|
|
export const zPostConversationsByCIdNamePath = z.object({
|
|
c_id: z.string(),
|
|
})
|
|
|
|
export const zPostConversationsByCIdNameQuery = z.object({
|
|
auto_generate: z.boolean().optional().default(false),
|
|
name: z.string().optional(),
|
|
})
|
|
|
|
/**
|
|
* Conversation renamed successfully
|
|
*/
|
|
export const zPostConversationsByCIdNameResponse = z.record(z.string(), z.unknown())
|
|
|
|
export const zPatchConversationsByCIdPinPath = z.object({
|
|
c_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Conversation pinned successfully
|
|
*/
|
|
export const zPatchConversationsByCIdPinResponse = zResultResponse
|
|
|
|
export const zPatchConversationsByCIdUnpinPath = z.object({
|
|
c_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Conversation unpinned successfully
|
|
*/
|
|
export const zPatchConversationsByCIdUnpinResponse = zResultResponse
|
|
|
|
export const zPostEmailCodeLoginBody = zEmailCodeLoginSendPayload
|
|
|
|
/**
|
|
* Email code sent successfully
|
|
*/
|
|
export const zPostEmailCodeLoginResponse = zSimpleResultDataResponse
|
|
|
|
export const zPostEmailCodeLoginValidityBody = zEmailCodeLoginVerifyPayload
|
|
|
|
/**
|
|
* Email code verified and login successful
|
|
*/
|
|
export const zPostEmailCodeLoginValidityResponse = zAccessTokenResultResponse
|
|
|
|
/**
|
|
* File uploaded successfully
|
|
*/
|
|
export const zPostFilesUploadResponse = zFileResponse
|
|
|
|
export const zPostForgotPasswordBody = zForgotPasswordSendPayload
|
|
|
|
/**
|
|
* Password reset email sent successfully
|
|
*/
|
|
export const zPostForgotPasswordResponse = zSimpleResultDataResponse
|
|
|
|
export const zPostForgotPasswordResetsBody = zForgotPasswordResetPayload
|
|
|
|
/**
|
|
* Password reset successfully
|
|
*/
|
|
export const zPostForgotPasswordResetsResponse = zSimpleResultResponse
|
|
|
|
export const zPostForgotPasswordValidityBody = zForgotPasswordCheckPayload
|
|
|
|
/**
|
|
* Token is valid
|
|
*/
|
|
export const zPostForgotPasswordValidityResponse = zVerificationTokenResponse
|
|
|
|
export const zGetFormHumanInputByFormTokenPath = z.object({
|
|
form_token: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Success
|
|
*/
|
|
export const zGetFormHumanInputByFormTokenResponse = z.record(z.string(), z.unknown())
|
|
|
|
export const zPostFormHumanInputByFormTokenPath = z.object({
|
|
form_token: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Success
|
|
*/
|
|
export const zPostFormHumanInputByFormTokenResponse = z.record(z.string(), z.unknown())
|
|
|
|
export const zPostLoginBody = zLoginPayload
|
|
|
|
/**
|
|
* Authentication successful
|
|
*/
|
|
export const zPostLoginResponse = zAccessTokenResultResponse
|
|
|
|
/**
|
|
* Login status
|
|
*/
|
|
export const zGetLoginStatusResponse = zLoginStatusResponse
|
|
|
|
/**
|
|
* Logout successful
|
|
*/
|
|
export const zPostLogoutResponse = zSimpleResultResponse
|
|
|
|
export const zGetMessagesQuery = z.object({
|
|
conversation_id: z.string(),
|
|
first_id: z.string().optional(),
|
|
limit: z.int().optional().default(20),
|
|
})
|
|
|
|
/**
|
|
* Success
|
|
*/
|
|
export const zGetMessagesResponse = z.record(z.string(), z.unknown())
|
|
|
|
export const zPostMessagesByMessageIdFeedbacksPath = z.object({
|
|
message_id: z.string(),
|
|
})
|
|
|
|
export const zPostMessagesByMessageIdFeedbacksQuery = z.object({
|
|
content: z.string().optional(),
|
|
rating: z.enum(['dislike', 'like']).optional(),
|
|
})
|
|
|
|
/**
|
|
* Feedback submitted successfully
|
|
*/
|
|
export const zPostMessagesByMessageIdFeedbacksResponse = zResultResponse
|
|
|
|
export const zGetMessagesByMessageIdMoreLikeThisPath = z.object({
|
|
message_id: z.string(),
|
|
})
|
|
|
|
export const zGetMessagesByMessageIdMoreLikeThisQuery = z.object({
|
|
response_mode: z.enum(['blocking', 'streaming']),
|
|
})
|
|
|
|
/**
|
|
* Success
|
|
*/
|
|
export const zGetMessagesByMessageIdMoreLikeThisResponse = z.record(z.string(), z.unknown())
|
|
|
|
export const zGetMessagesByMessageIdSuggestedQuestionsPath = z.object({
|
|
message_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Success
|
|
*/
|
|
export const zGetMessagesByMessageIdSuggestedQuestionsResponse = zSuggestedQuestionsResponse
|
|
|
|
/**
|
|
* Success
|
|
*/
|
|
export const zGetMetaResponse = z.record(z.string(), z.unknown())
|
|
|
|
/**
|
|
* Success
|
|
*/
|
|
export const zGetParametersResponse = z.record(z.string(), z.unknown())
|
|
|
|
/**
|
|
* Passport retrieved successfully
|
|
*/
|
|
export const zGetPassportResponse = z.record(z.string(), z.unknown())
|
|
|
|
/**
|
|
* Remote file uploaded successfully
|
|
*/
|
|
export const zPostRemoteFilesUploadResponse = zFileWithSignedUrl
|
|
|
|
export const zGetRemoteFilesByUrlPath = z.object({
|
|
url: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Remote file information retrieved successfully
|
|
*/
|
|
export const zGetRemoteFilesByUrlResponse = zRemoteFileInfo
|
|
|
|
export const zGetSavedMessagesQuery = z.object({
|
|
last_id: z.string().optional(),
|
|
limit: z.int().optional().default(20),
|
|
})
|
|
|
|
/**
|
|
* Success
|
|
*/
|
|
export const zGetSavedMessagesResponse = z.record(z.string(), z.unknown())
|
|
|
|
export const zPostSavedMessagesQuery = z.object({
|
|
message_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Message saved successfully
|
|
*/
|
|
export const zPostSavedMessagesResponse = zResultResponse
|
|
|
|
export const zDeleteSavedMessagesByMessageIdPath = z.object({
|
|
message_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Message removed successfully
|
|
*/
|
|
export const zDeleteSavedMessagesByMessageIdResponse = z.record(z.string(), z.never())
|
|
|
|
/**
|
|
* Success
|
|
*/
|
|
export const zGetSiteResponse = z.record(z.string(), z.unknown())
|
|
|
|
/**
|
|
* System features retrieved successfully
|
|
*/
|
|
export const zGetSystemFeaturesResponse = zSystemFeatureModel
|
|
|
|
export const zPostTextToAudioBody = zTextToAudioPayload
|
|
|
|
/**
|
|
* Success
|
|
*/
|
|
export const zPostTextToAudioResponse = z.record(z.string(), z.unknown())
|
|
|
|
export const zGetWebappAccessModeQuery = z.object({
|
|
appCode: z.string().optional(),
|
|
appId: z.string().optional(),
|
|
})
|
|
|
|
/**
|
|
* Success
|
|
*/
|
|
export const zGetWebappAccessModeResponse = zAccessModeResponse
|
|
|
|
export const zGetWebappPermissionQuery = z.object({
|
|
appId: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Success
|
|
*/
|
|
export const zGetWebappPermissionResponse = zBooleanResultResponse
|
|
|
|
export const zGetWorkflowByTaskIdEventsPath = z.object({
|
|
task_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Success
|
|
*/
|
|
export const zGetWorkflowByTaskIdEventsResponse = z.record(z.string(), z.unknown())
|
|
|
|
export const zPostWorkflowsRunBody = zWorkflowRunPayload
|
|
|
|
/**
|
|
* Success
|
|
*/
|
|
export const zPostWorkflowsRunResponse = z.record(z.string(), z.unknown())
|
|
|
|
export const zPostWorkflowsTasksByTaskIdStopPath = z.object({
|
|
task_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Success
|
|
*/
|
|
export const zPostWorkflowsTasksByTaskIdStopResponse = zSimpleResultResponse
|