dify/web/gen/zod/api/conversations.ts
Stephen Zhou 4061c83b26
no sufix
2026-01-25 16:19:07 +08:00

90 lines
3.6 KiB
TypeScript

// This file is auto-generated by @hey-api/openapi-ts
import { z } from 'zod'
import { zConversationListItem, zConversationRenameRequest, zConversationVariablesResponse } from '../models/conversation'
import { zConversationsListResponse } from '../models/conversations'
export const zGetConversationsListData = z.object({
body: z.never().optional(),
path: z.never().optional(),
query: z.object({
user: z.string().describe('User identifier. **Note**: The Service API does not share conversations created by the WebApp. Conversations created through the API are isolated from those created in the WebApp interface.'),
last_id: z.string().describe('(Optional) The ID of the last record on the current page (for pagination).').optional(),
limit: z.number().int().gte(1).lte(100).describe('(Optional) How many records to return. Default 20, Min 1, Max 100.').optional().default(20),
sort_by: z.enum([
'created_at',
'-created_at',
'updated_at',
'-updated_at',
]).describe('Sorting Field. Default: -updated_at. \'-\' prefix for descending.').optional(),
}),
})
export type GetConversationsListDataZodType = z.infer<typeof zGetConversationsListData>
/**
* Successfully retrieved conversations list.
*/
export const zGetConversationsListResponse = zConversationsListResponse
export type GetConversationsListResponseZodType = z.infer<typeof zGetConversationsListResponse>
export const zDeleteConversationData = z.object({
body: z.object({
user: z.string().describe('The user identifier. **Note**: The Service API does not share conversations created by the WebApp. Conversations created through the API are isolated from those created in the WebApp interface.'),
}),
path: z.object({
conversation_id: z.string().describe('Conversation ID.'),
}),
query: z.never().optional(),
})
export type DeleteConversationDataZodType = z.infer<typeof zDeleteConversationData>
/**
* Conversation deleted successfully. No Content.
*/
export const zDeleteConversationResponse = z.void().describe('Conversation deleted successfully. No Content.')
export type DeleteConversationResponseZodType = z.infer<typeof zDeleteConversationResponse>
export const zRenameConversationData = z.object({
body: zConversationRenameRequest,
path: z.object({
conversation_id: z.string().describe('Conversation ID.'),
}),
query: z.never().optional(),
})
export type RenameConversationDataZodType = z.infer<typeof zRenameConversationData>
/**
* Conversation renamed successfully.
*/
export const zRenameConversationResponse = zConversationListItem
export type RenameConversationResponseZodType = z.infer<typeof zRenameConversationResponse>
export const zGetConversationVariablesData = z.object({
body: z.never().optional(),
path: z.object({
conversation_id: z.string().describe('The ID of the conversation to retrieve variables from.'),
}),
query: z.object({
user: z.string().describe('The user identifier.'),
last_id: z.string().describe('(Optional) The ID of the last record on the current page (for pagination).').optional(),
limit: z.number().int().gte(1).lte(100).describe('(Optional) How many records to return. Default 20, Min 1, Max 100.').optional().default(20),
variable_name: z.string().describe('(Optional) Filter variables by a specific name.').optional(),
}),
})
export type GetConversationVariablesDataZodType = z.infer<typeof zGetConversationVariablesData>
/**
* Successfully retrieved conversation variables.
*/
export const zGetConversationVariablesResponse = zConversationVariablesResponse
export type GetConversationVariablesResponseZodType = z.infer<typeof zGetConversationVariablesResponse>