diff --git a/web/gen/orpc.gen.ts b/web/gen/orpc.gen.ts index e1167ba4eb..1e9df17292 100644 --- a/web/gen/orpc.gen.ts +++ b/web/gen/orpc.gen.ts @@ -1,137 +1,15 @@ // This file is auto-generated by @hey-api/openapi-ts import { oc } from '@orpc/contract' -import { zAddPetData, zAddPetResponse, zCreateUserData, zCreateUsersWithListInputData, zCreateUsersWithListInputResponse, zDeleteOrderData, zDeletePetData, zDeletePetResponse, zDeleteUserData, zFindPetsByStatusData, zFindPetsByStatusResponse, zFindPetsByTagsData, zFindPetsByTagsResponse, zGetInventoryResponse, zGetOrderByIdData, zGetOrderByIdResponse, zGetPetByIdData, zGetPetByIdResponse, zGetUserByNameData, zGetUserByNameResponse, zLoginUserData, zLoginUserResponse, zPlaceOrderData, zPlaceOrderPatchData, zPlaceOrderPatchResponse, zPlaceOrderResponse, zUpdatePetData, zUpdatePetResponse, zUpdatePetWithFormData, zUpdateUserData, zUploadFileData, zUploadFileResponse } from './zod.gen' +import { zGetConsoleApiPingResponse } from './zod.gen' export const base = oc.$route({ inputStructure: 'detailed' }) /** - * Add a new pet to the store + * Health check endpoint for connection testing. */ -export const addPetContract = base.route({ path: '/pet', method: 'POST' }).input(zAddPetData).output(zAddPetResponse) +export const getConsoleApiPingContract = base.route({ path: '/console/api/ping', method: 'GET' }).output(zGetConsoleApiPingResponse) -/** - * Update an existing pet by Id - */ -export const updatePetContract = base.route({ path: '/pet', method: 'PUT' }).input(zUpdatePetData).output(zUpdatePetResponse) - -/** - * Multiple status values can be provided with comma separated strings - */ -export const findPetsByStatusContract = base.route({ path: '/pet/findByStatus', method: 'GET' }).input(zFindPetsByStatusData).output(zFindPetsByStatusResponse) - -/** - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - */ -export const findPetsByTagsContract = base.route({ path: '/pet/findByTags', method: 'GET' }).input(zFindPetsByTagsData).output(zFindPetsByTagsResponse) - -/** - * delete a pet - */ -export const deletePetContract = base.route({ path: '/pet/{petId}', method: 'DELETE' }).input(zDeletePetData).output(zDeletePetResponse) - -/** - * Returns a single pet - */ -export const getPetByIdContract = base.route({ path: '/pet/{petId}', method: 'GET' }).input(zGetPetByIdData).output(zGetPetByIdResponse) - -/** - * Updates a pet in the store with form data - */ -export const updatePetWithFormContract = base.route({ path: '/pet/{petId}', method: 'POST' }).input(zUpdatePetWithFormData) - -/** - * uploads an image - */ -export const uploadFileContract = base.route({ path: '/pet/{petId}/uploadImage', method: 'POST' }).input(zUploadFileData).output(zUploadFileResponse) - -/** - * Returns a map of status codes to quantities - */ -export const getInventoryContract = base.route({ path: '/store/inventory', method: 'GET' }).output(zGetInventoryResponse) - -/** - * Place a new order in the store with patch - */ -export const placeOrderPatchContract = base.route({ path: '/store/order', method: 'PATCH' }).input(zPlaceOrderPatchData).output(zPlaceOrderPatchResponse) - -/** - * Place a new order in the store - */ -export const placeOrderContract = base.route({ path: '/store/order', method: 'POST' }).input(zPlaceOrderData).output(zPlaceOrderResponse) - -/** - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - */ -export const deleteOrderContract = base.route({ path: '/store/order/{orderId}', method: 'DELETE' }).input(zDeleteOrderData) - -/** - * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. - */ -export const getOrderByIdContract = base.route({ path: '/store/order/{orderId}', method: 'GET' }).input(zGetOrderByIdData).output(zGetOrderByIdResponse) - -/** - * This can only be done by the logged in user. - */ -export const createUserContract = base.route({ path: '/user', method: 'POST' }).input(zCreateUserData) - -/** - * Creates list of users with given input array - */ -export const createUsersWithListInputContract = base.route({ path: '/user/createWithList', method: 'POST' }).input(zCreateUsersWithListInputData).output(zCreateUsersWithListInputResponse) - -/** - * Logs user into the system - */ -export const loginUserContract = base.route({ path: '/user/login', method: 'GET' }).input(zLoginUserData).output(zLoginUserResponse) - -/** - * Logs out current logged in user session - */ -export const logoutUserContract = base.route({ path: '/user/logout', method: 'GET' }) - -/** - * This can only be done by the logged in user. - */ -export const deleteUserContract = base.route({ path: '/user/{username}', method: 'DELETE' }).input(zDeleteUserData) - -/** - * Get user by user name - */ -export const getUserByNameContract = base.route({ path: '/user/{username}', method: 'GET' }).input(zGetUserByNameData).output(zGetUserByNameResponse) - -/** - * This can only be done by the logged in user. - */ -export const updateUserContract = base.route({ path: '/user/{username}', method: 'PUT' }).input(zUpdateUserData) - -export const contracts = { - pet: { - addPetContract, - updatePetContract, - findPetsByStatusContract, - findPetsByTagsContract, - deletePetContract, - getPetByIdContract, - updatePetWithFormContract, - uploadFileContract, - }, - store: { - getInventoryContract, - placeOrderPatchContract, - placeOrderContract, - deleteOrderContract, - getOrderByIdContract, - }, - user: { - createUserContract, - createUsersWithListInputContract, - loginUserContract, - logoutUserContract, - deleteUserContract, - getUserByNameContract, - updateUserContract, - }, -} +export const contracts = { console: { getConsoleApiPingContract } } export type Contracts = typeof contracts diff --git a/web/gen/types.gen.ts b/web/gen/types.gen.ts index 1af881a152..985abdcc32 100644 --- a/web/gen/types.gen.ts +++ b/web/gen/types.gen.ts @@ -1,696 +1,42 @@ // This file is auto-generated by @hey-api/openapi-ts export type ClientOptions = { - baseUrl: 'https://petstore3.swagger.io/api/v3' | (string & {}) + baseUrl: `${string}://${string}` | (string & {}) } -export type Order = { - id?: number - petId?: number - quantity?: number - shipDate?: string - /** - * Order Status - */ - status?: '' | string - /** - * HTTP Status - */ - http_status?: 200 | 400 | 500 - complete?: boolean -} - -export type Customer = { - id?: number - username?: string - address?: Array
-} - -export type HappyCustomer = Customer & { - isHappy?: true -} - -export type UnhappyCustomer = Customer & { - reasonToBeUnhappy?: string - isHappy?: false -} - -export type Address = { - streetName?: string - streetNumber?: string - city?: string - state?: string - zip?: string -} - -export type Category = { - id?: number - name?: string -} - -export type User = { - id?: number - username?: string - firstName?: string - lastName?: string - email?: string - password?: string - phone?: string - /** - * User Status - */ - userStatus?: number -} - -export type Tag = { - id?: number - name?: string -} - -export type Pet = (({ - type: 'dog' -} & Dog) | ({ - type: 'cat' -} & Cat)) & { - id?: number - type: 'dog' | 'cat' - name: string - category?: OpenapiCategory - photoUrls: Array - readonly tags?: Array - /** - * pet status in the store - */ - status?: 'available' | 'pending' | 'sold' -} - -export type Cat = { - readonly type?: string - name?: string -} - -export type Dog = { - readonly type?: string - bark?: string -} - -export type FullAddress = Address & { - streetName: string - streetNumber: string -} - -export type AddPetRequest = { - id?: number - name: string - category?: Category - photoUrls: Array - tags?: Array - /** - * pet status in the store - */ - status?: 'available' | 'pending' | 'sold' | 'in store' -} - -export type ApiResponse = { - code?: number - type?: string - message?: string -} - -export type OpenapiCategory = { - id?: number - name?: string -} - -export type PetWritable = (({ - type: 'DogWritable' -} & DogWritable) | ({ - type: 'CatWritable' -} & CatWritable)) & { - id?: number - name: string - category?: OpenapiCategory - photoUrls: Array - /** - * pet status in the store - */ - status?: 'available' | 'pending' | 'sold' -} - -export type CatWritable = { - name?: string -} - -export type DogWritable = { - bark?: string +export type ErrorSchema = { + error: { + type: string + message: string + status: number + details?: string + } } /** - * to request with required page number or pagination + * PingResponse */ -export type Page = string - -/** - * to request with required page size - */ -export type PageSize = string - -/** - * Pet object that needs to be added to the store - */ -export type Pet2 = PetWritable - -/** - * List of user object - */ -export type UserArray = Array - -export type AddPetData = { +export type PingResponse = { /** - * Create a new pet in the store + * Result + * + * Health check result */ - body: AddPetRequest - path?: never - query?: never - url: '/pet' + result: string } -export type AddPetErrors = { - /** - * Pet not found - */ - 405: { - code?: number - message?: string - } -} - -export type AddPetError = AddPetErrors[keyof AddPetErrors] - -export type AddPetResponses = { - /** - * Successful operation - */ - 200: Pet -} - -export type AddPetResponse = AddPetResponses[keyof AddPetResponses] - -export type UpdatePetData = { - /** - * Update an existent pet in the store - */ - body: PetWritable - path?: never - query?: never - url: '/pet' -} - -export type UpdatePetErrors = { - /** - * Invalid ID supplied - */ - 400: unknown - /** - * Pet not found - */ - 404: unknown - /** - * Validation exception - */ - 405: unknown -} - -export type UpdatePetResponses = { - /** - * Successful operation - */ - 200: Pet -} - -export type UpdatePetResponse = UpdatePetResponses[keyof UpdatePetResponses] - -export type FindPetsByStatusData = { - body?: never - path?: never - query?: { - /** - * Status values that need to be considered for filter - */ - status?: 'available' | 'pending' | 'sold' - } - url: '/pet/findByStatus' -} - -export type FindPetsByStatusErrors = { - /** - * Invalid status value - */ - 400: unknown -} - -export type FindPetsByStatusResponses = { - /** - * successful operation - */ - 200: Array -} - -export type FindPetsByStatusResponse = FindPetsByStatusResponses[keyof FindPetsByStatusResponses] - -export type FindPetsByTagsData = { - body?: never - path?: never - query?: { - /** - * Tags to filter by - */ - tags?: Array - /** - * to request with required page number or pagination - */ - page?: string - /** - * to request with required page size - */ - pageSize?: string - } - url: '/pet/findByTags' -} - -export type FindPetsByTagsErrors = { - /** - * Invalid tag value - */ - 400: unknown -} - -export type FindPetsByTagsResponses = { - /** - * successful operation - */ - 200: Array -} - -export type FindPetsByTagsResponse = FindPetsByTagsResponses[keyof FindPetsByTagsResponses] - -export type DeletePetData = { - body?: never - headers?: { - api_key?: string - } - path: { - /** - * Pet id to delete - */ - petId: number - } - query?: never - url: '/pet/{petId}' -} - -export type DeletePetErrors = { - /** - * Invalid pet value - */ - 400: unknown -} - -export type DeletePetResponses = { - /** - * items - */ - 200: Array<'TYPE1' | 'TYPE2' | 'TYPE3'> -} - -export type DeletePetResponse = DeletePetResponses[keyof DeletePetResponses] - -export type GetPetByIdData = { - body?: never - path: { - /** - * ID of pet to return - */ - petId: number - } - query?: never - url: '/pet/{petId}' -} - -export type GetPetByIdErrors = { - /** - * Invalid ID supplied - */ - 400: unknown - /** - * Pet not found - */ - 404: unknown -} - -export type GetPetByIdResponses = { - /** - * successful operation - */ - 200: Pet -} - -export type GetPetByIdResponse = GetPetByIdResponses[keyof GetPetByIdResponses] - -export type UpdatePetWithFormData = { - body?: never - path: { - /** - * ID of pet that needs to be updated - */ - petId: number - } - query?: { - /** - * Name of pet that needs to be updated - */ - name?: string - /** - * Status of pet that needs to be updated - */ - status?: string - } - url: '/pet/{petId}' -} - -export type UpdatePetWithFormErrors = { - /** - * Invalid input - */ - 405: unknown -} - -export type UploadFileData = { - body?: Blob | File - path: { - /** - * ID of pet to update - */ - petId: number - } - query?: { - /** - * Additional Metadata - */ - additionalMetadata?: string - } - url: '/pet/{petId}/uploadImage' -} - -export type UploadFileResponses = { - /** - * successful operation - */ - 200: ApiResponse -} - -export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses] - -export type GetInventoryData = { +export type GetConsoleApiPingData = { body?: never path?: never query?: never - url: '/store/inventory' + url: '/console/api/ping' } -export type GetInventoryResponses = { +export type GetConsoleApiPingResponses = { /** - * successful operation + * OK */ - 200: { - [key: string]: number - } + 200: PingResponse } -export type GetInventoryResponse = GetInventoryResponses[keyof GetInventoryResponses] - -export type PlaceOrderPatchData = { - body?: Order - path?: never - query?: never - url: '/store/order' -} - -export type PlaceOrderPatchErrors = { - /** - * Invalid input - */ - 405: unknown -} - -export type PlaceOrderPatchResponses = { - /** - * successful operation - */ - 200: Order -} - -export type PlaceOrderPatchResponse = PlaceOrderPatchResponses[keyof PlaceOrderPatchResponses] - -export type PlaceOrderData = { - /** - * Order description - */ - body?: Order - path?: never - query?: never - url: '/store/order' -} - -export type PlaceOrderErrors = { - /** - * Invalid input - */ - 405: unknown -} - -export type PlaceOrderResponses = { - /** - * successful operation - */ - 200: Order -} - -export type PlaceOrderResponse = PlaceOrderResponses[keyof PlaceOrderResponses] - -export type DeleteOrderData = { - body?: never - path: { - /** - * ID of the order that needs to be deleted - */ - orderId: number - } - query?: never - url: '/store/order/{orderId}' -} - -export type DeleteOrderErrors = { - /** - * Invalid ID supplied - */ - 400: unknown - /** - * Order not found - */ - 404: unknown -} - -export type GetOrderByIdData = { - body?: never - path: { - /** - * ID of order that needs to be fetched - */ - orderId: number - } - query?: never - url: '/store/order/{orderId}' -} - -export type GetOrderByIdErrors = { - /** - * Invalid ID supplied - */ - 400: unknown - /** - * Order not found - */ - 404: unknown -} - -export type GetOrderByIdResponses = { - /** - * successful operation - */ - 200: Order -} - -export type GetOrderByIdResponse = GetOrderByIdResponses[keyof GetOrderByIdResponses] - -export type CreateUserData = { - /** - * Created user object - */ - body?: User - path?: never - query?: never - url: '/user' -} - -export type CreateUserResponses = { - /** - * successful operation - */ - default: User -} - -export type CreateUserResponse = CreateUserResponses[keyof CreateUserResponses] - -export type CreateUsersWithListInputData = { - body?: Array - path?: never - query?: never - url: '/user/createWithList' -} - -export type CreateUsersWithListInputResponses = { - /** - * Successful operation - */ - 200: User - /** - * successful operation - */ - default: unknown -} - -export type CreateUsersWithListInputResponse = CreateUsersWithListInputResponses[keyof CreateUsersWithListInputResponses] - -export type LoginUserData = { - body?: never - path?: never - query?: { - /** - * The user name for login - */ - username?: string - /** - * The password for login in clear text - */ - password?: string - } - url: '/user/login' -} - -export type LoginUserErrors = { - /** - * Invalid username/password supplied - */ - 400: unknown -} - -export type LoginUserResponses = { - /** - * successful operation - */ - 200: string -} - -export type LoginUserResponse = LoginUserResponses[keyof LoginUserResponses] - -export type LogoutUserData = { - body?: never - path?: never - query?: never - url: '/user/logout' -} - -export type LogoutUserResponses = { - /** - * successful operation - */ - default: unknown -} - -export type DeleteUserData = { - body?: never - path: { - /** - * The name that needs to be deleted - */ - username: string - } - query?: never - url: '/user/{username}' -} - -export type DeleteUserErrors = { - /** - * Invalid username supplied - */ - 400: unknown - /** - * User not found - */ - 404: unknown -} - -export type GetUserByNameData = { - body?: never - path: { - /** - * The name that needs to be fetched. Use user1 for testing. - */ - username: string - } - query?: never - url: '/user/{username}' -} - -export type GetUserByNameErrors = { - /** - * Invalid username supplied - */ - 400: unknown - /** - * User not found - */ - 404: unknown -} - -export type GetUserByNameResponses = { - /** - * successful operation - */ - 200: User -} - -export type GetUserByNameResponse = GetUserByNameResponses[keyof GetUserByNameResponses] - -export type UpdateUserData = { - /** - * Update an existent user in the store - */ - body?: User - path: { - /** - * name that need to be deleted - */ - username: string - } - query?: never - url: '/user/{username}' -} - -export type UpdateUserResponses = { - /** - * successful operation - */ - default: unknown -} +export type GetConsoleApiPingResponse = GetConsoleApiPingResponses[keyof GetConsoleApiPingResponses] diff --git a/web/gen/zod.gen.ts b/web/gen/zod.gen.ts index 8198a96619..03c0ca2532 100644 --- a/web/gen/zod.gen.ts +++ b/web/gen/zod.gen.ts @@ -2,523 +2,37 @@ import { z } from 'zod' -export const zOrder = z.object({ - id: z.coerce.bigint().min(BigInt('-9223372036854775808'), { message: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { message: 'Invalid value: Expected int64 to be <= 9223372036854775807' }).optional(), - petId: z.coerce.bigint().min(BigInt('-9223372036854775808'), { message: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { message: 'Invalid value: Expected int64 to be <= 9223372036854775807' }).optional(), - quantity: z.number().int().min(-2147483648, { message: 'Invalid value: Expected int32 to be >= -2147483648' }).max(2147483647, { message: 'Invalid value: Expected int32 to be <= 2147483647' }).optional(), - shipDate: z.string().datetime().optional(), - status: z.union([ - z.literal(''), - z.string().email(), - ]).optional(), - http_status: z.union([ - z.literal(200), - z.literal(400), - z.literal(500), - ]).describe('HTTP Status').optional(), - complete: z.boolean().optional(), -}) - -export type OrderZodType = z.infer - -export const zAddress = z.object({ - streetName: z.string().optional(), - streetNumber: z.string().optional(), - city: z.string().optional(), - state: z.string().optional(), - zip: z.string().optional(), -}) - -export type AddressZodType = z.infer - -export const zCustomer = z.object({ - id: z.coerce.bigint().min(BigInt('-9223372036854775808'), { message: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { message: 'Invalid value: Expected int64 to be <= 9223372036854775807' }).optional(), - username: z.string().optional(), - address: z.array(zAddress).optional(), -}) - -export type CustomerZodType = z.infer - -export const zHappyCustomer = zCustomer.and(z.object({ - isHappy: z.literal(true).optional(), -})) - -export type HappyCustomerZodType = z.infer - -export const zUnhappyCustomer = zCustomer.and(z.object({ - reasonToBeUnhappy: z.string().optional(), - isHappy: z.literal(false).optional(), -})) - -export type UnhappyCustomerZodType = z.infer - -export const zCategory = z.object({ - id: z.coerce.bigint().min(BigInt('-9223372036854775808'), { message: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { message: 'Invalid value: Expected int64 to be <= 9223372036854775807' }).optional(), - name: z.string().optional(), -}) - -export type CategoryZodType = z.infer - -export const zUser = z.object({ - id: z.coerce.bigint().min(BigInt('-9223372036854775808'), { message: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { message: 'Invalid value: Expected int64 to be <= 9223372036854775807' }).optional(), - username: z.string().optional(), - firstName: z.string().optional(), - lastName: z.string().optional(), - email: z.string().optional(), - password: z.string().optional(), - phone: z.string().optional(), - userStatus: z.number().int().min(-2147483648, { message: 'Invalid value: Expected int32 to be >= -2147483648' }).max(2147483647, { message: 'Invalid value: Expected int32 to be <= 2147483647' }).describe('User Status').optional(), -}) - -export type UserZodType = z.infer - -export const zTag = z.object({ - id: z.coerce.bigint().min(BigInt('-9223372036854775808'), { message: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { message: 'Invalid value: Expected int64 to be <= 9223372036854775807' }).optional(), - name: z.string().optional(), -}) - -export type TagZodType = z.infer - -export const zCat = z.object({ - type: z.string().min(1).readonly().optional(), - name: z.string().optional(), -}) - -export type CatZodType = z.infer - -export const zDog = z.object({ - type: z.string().min(1).readonly().optional(), - bark: z.string().optional(), -}) - -export type DogZodType = z.infer - -export const zFullAddress = zAddress.and(z.object({ - streetName: z.string(), - streetNumber: z.string(), -})) - -export type FullAddressZodType = z.infer - -export const zAddPetRequest = z.object({ - id: z.coerce.bigint().min(BigInt('-9223372036854775808'), { message: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { message: 'Invalid value: Expected int64 to be <= 9223372036854775807' }).optional(), - name: z.string(), - category: zCategory.optional(), - photoUrls: z.array(z.string()), - tags: z.array(zTag).optional(), - status: z.enum([ - 'available', - 'pending', - 'sold', - 'in store', - ]).describe('pet status in the store').optional(), -}) - -export type AddPetRequestZodType = z.infer - -export const zApiResponse = z.object({ - code: z.number().int().min(-2147483648, { message: 'Invalid value: Expected int32 to be >= -2147483648' }).max(2147483647, { message: 'Invalid value: Expected int32 to be <= 2147483647' }).optional(), - type: z.string().optional(), - message: z.string().optional(), -}) - -export type ApiResponseZodType = z.infer - -export const zOpenapiCategory = z.object({ - id: z.coerce.bigint().min(BigInt('-9223372036854775808'), { message: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { message: 'Invalid value: Expected int64 to be <= 9223372036854775807' }).optional(), - name: z.string().optional(), -}) - -export type OpenapiCategoryZodType = z.infer - -export const zPet = z.intersection(z.union([ - z.object({ - type: z.literal('dog'), - }).and(zDog), - z.object({ - type: z.literal('cat'), - }).and(zCat), -]), z.object({ - id: z.coerce.bigint().min(BigInt('-9223372036854775808'), { message: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { message: 'Invalid value: Expected int64 to be <= 9223372036854775807' }).optional(), - type: z.enum(['dog', 'cat']), - name: z.string(), - category: zOpenapiCategory.optional(), - photoUrls: z.array(z.string()), - tags: z.array(zTag).readonly().optional(), - status: z.enum([ - 'available', - 'pending', - 'sold', - ]).describe('pet status in the store').optional(), -})) - -export type PetZodType = z.infer - -export const zCatWritable = z.object({ - name: z.string().optional(), -}) - -export type CatWritableZodType = z.infer - -export const zDogWritable = z.object({ - bark: z.string().optional(), -}) - -export type DogWritableZodType = z.infer - -export const zPetWritable = z.intersection(z.union([ - z.object({ - type: z.literal('DogWritable'), - }).and(zDogWritable), - z.object({ - type: z.literal('CatWritable'), - }).and(zCatWritable), -]), z.object({ - id: z.coerce.bigint().min(BigInt('-9223372036854775808'), { message: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { message: 'Invalid value: Expected int64 to be <= 9223372036854775807' }).optional(), - name: z.string(), - category: zOpenapiCategory.optional(), - photoUrls: z.array(z.string()), - status: z.enum([ - 'available', - 'pending', - 'sold', - ]).describe('pet status in the store').optional(), -})) - -export type PetWritableZodType = z.infer - -/** - * to request with required page number or pagination - */ -export const zPage = z.string().describe('to request with required page number or pagination') - -export type PageZodType = z.infer - -/** - * to request with required page size - */ -export const zPageSize = z.string().describe('to request with required page size') - -export type PageSizeZodType = z.infer - -/** - * Pet object that needs to be added to the store - */ -export const zPet2 = zPetWritable - -export type PetZodType2 = z.infer - -/** - * List of user object - */ -export const zUserArray = z.array(zUser).describe('List of user object') - -export type UserArrayZodType = z.infer - -export const zAddPetData = z.object({ - body: zAddPetRequest, - path: z.never().optional(), - query: z.never().optional(), -}) - -export type AddPetDataZodType = z.infer - -/** - * Successful operation - */ -export const zAddPetResponse = zPet - -export type AddPetResponseZodType = z.infer - -export const zUpdatePetData = z.object({ - body: zPetWritable, - path: z.never().optional(), - query: z.never().optional(), -}) - -export type UpdatePetDataZodType = z.infer - -/** - * Successful operation - */ -export const zUpdatePetResponse = zPet - -export type UpdatePetResponseZodType = z.infer - -export const zFindPetsByStatusData = z.object({ - body: z.never().optional(), - path: z.never().optional(), - query: z.object({ - status: z.enum([ - 'available', - 'pending', - 'sold', - ]).describe('Status values that need to be considered for filter').optional(), - }).optional(), -}) - -export type FindPetsByStatusDataZodType = z.infer - -/** - * successful operation - */ -export const zFindPetsByStatusResponse = z.array(zPet).describe('successful operation') - -export type FindPetsByStatusResponseZodType = z.infer - -export const zFindPetsByTagsData = z.object({ - body: z.never().optional(), - path: z.never().optional(), - query: z.object({ - tags: z.array(z.string()).describe('Tags to filter by').optional(), - page: z.string().describe('to request with required page number or pagination').optional(), - pageSize: z.string().describe('to request with required page size').optional(), - }).optional(), -}) - -export type FindPetsByTagsDataZodType = z.infer - -/** - * successful operation - */ -export const zFindPetsByTagsResponse = z.array(zPet).describe('successful operation') - -export type FindPetsByTagsResponseZodType = z.infer - -export const zDeletePetData = z.object({ - body: z.never().optional(), - path: z.object({ - petId: z.coerce.bigint().min(BigInt('-9223372036854775808'), { message: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { message: 'Invalid value: Expected int64 to be <= 9223372036854775807' }).describe('Pet id to delete'), +export const zErrorSchema = z.object({ + error: z.object({ + type: z.string(), + message: z.string(), + status: z.number().int(), + details: z.string().optional(), }), - query: z.never().optional(), - headers: z.object({ - api_key: z.string().optional(), - }).optional(), }) -export type DeletePetDataZodType = z.infer +export type ErrorSchemaZodType = z.infer /** - * items + * PingResponse */ -export const zDeletePetResponse = z.array(z.enum([ - 'TYPE1', - 'TYPE2', - 'TYPE3', -])).describe('items') - -export type DeletePetResponseZodType = z.infer - -export const zGetPetByIdData = z.object({ - body: z.never().optional(), - path: z.object({ - petId: z.coerce.bigint().min(BigInt('-9223372036854775808'), { message: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { message: 'Invalid value: Expected int64 to be <= 9223372036854775807' }).describe('ID of pet to return'), - }), - query: z.never().optional(), +export const zPingResponse = z.object({ + result: z.string().describe('Health check result'), }) -export type GetPetByIdDataZodType = z.infer +export type PingResponseZodType = z.infer -/** - * successful operation - */ -export const zGetPetByIdResponse = zPet - -export type GetPetByIdResponseZodType = z.infer - -export const zUpdatePetWithFormData = z.object({ - body: z.never().optional(), - path: z.object({ - petId: z.coerce.bigint().min(BigInt('-9223372036854775808'), { message: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { message: 'Invalid value: Expected int64 to be <= 9223372036854775807' }).describe('ID of pet that needs to be updated'), - }), - query: z.object({ - name: z.string().describe('Name of pet that needs to be updated').optional(), - status: z.string().describe('Status of pet that needs to be updated').optional(), - }).optional(), -}) - -export type UpdatePetWithFormDataZodType = z.infer - -export const zUploadFileData = z.object({ - body: z.string().optional(), - path: z.object({ - petId: z.coerce.bigint().min(BigInt('-9223372036854775808'), { message: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { message: 'Invalid value: Expected int64 to be <= 9223372036854775807' }).describe('ID of pet to update'), - }), - query: z.object({ - additionalMetadata: z.string().describe('Additional Metadata').optional(), - }).optional(), -}) - -export type UploadFileDataZodType = z.infer - -/** - * successful operation - */ -export const zUploadFileResponse = zApiResponse - -export type UploadFileResponseZodType = z.infer - -export const zGetInventoryData = z.object({ +export const zGetConsoleApiPingData = z.object({ body: z.never().optional(), path: z.never().optional(), query: z.never().optional(), }) -export type GetInventoryDataZodType = z.infer +export type GetConsoleApiPingDataZodType = z.infer /** - * successful operation + * OK */ -export const zGetInventoryResponse = z.record(z.number().int().min(-2147483648, { message: 'Invalid value: Expected int32 to be >= -2147483648' }).max(2147483647, { message: 'Invalid value: Expected int32 to be <= 2147483647' })).describe('successful operation') +export const zGetConsoleApiPingResponse = zPingResponse -export type GetInventoryResponseZodType = z.infer - -export const zPlaceOrderPatchData = z.object({ - body: zOrder.optional(), - path: z.never().optional(), - query: z.never().optional(), -}) - -export type PlaceOrderPatchDataZodType = z.infer - -/** - * successful operation - */ -export const zPlaceOrderPatchResponse = zOrder - -export type PlaceOrderPatchResponseZodType = z.infer - -export const zPlaceOrderData = z.object({ - body: zOrder.optional(), - path: z.never().optional(), - query: z.never().optional(), -}) - -export type PlaceOrderDataZodType = z.infer - -/** - * successful operation - */ -export const zPlaceOrderResponse = zOrder - -export type PlaceOrderResponseZodType = z.infer - -export const zDeleteOrderData = z.object({ - body: z.never().optional(), - path: z.object({ - orderId: z.coerce.bigint().min(BigInt('-9223372036854775808'), { message: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { message: 'Invalid value: Expected int64 to be <= 9223372036854775807' }).describe('ID of the order that needs to be deleted'), - }), - query: z.never().optional(), -}) - -export type DeleteOrderDataZodType = z.infer - -export const zGetOrderByIdData = z.object({ - body: z.never().optional(), - path: z.object({ - orderId: z.coerce.bigint().min(BigInt('-9223372036854775808'), { message: 'Invalid value: Expected int64 to be >= -9223372036854775808' }).max(BigInt('9223372036854775807'), { message: 'Invalid value: Expected int64 to be <= 9223372036854775807' }).describe('ID of order that needs to be fetched'), - }), - query: z.never().optional(), -}) - -export type GetOrderByIdDataZodType = z.infer - -/** - * successful operation - */ -export const zGetOrderByIdResponse = zOrder - -export type GetOrderByIdResponseZodType = z.infer - -export const zCreateUserData = z.object({ - body: zUser.optional(), - path: z.never().optional(), - query: z.never().optional(), -}) - -export type CreateUserDataZodType = z.infer - -/** - * successful operation - */ -export const zCreateUserResponse = zUser - -export type CreateUserResponseZodType = z.infer - -export const zCreateUsersWithListInputData = z.object({ - body: z.array(zUser).optional(), - path: z.never().optional(), - query: z.never().optional(), -}) - -export type CreateUsersWithListInputDataZodType = z.infer - -export const zCreateUsersWithListInputResponse = z.union([ - zUser, - z.unknown().describe('successful operation'), -]) - -export type CreateUsersWithListInputResponseZodType = z.infer - -export const zLoginUserData = z.object({ - body: z.never().optional(), - path: z.never().optional(), - query: z.object({ - username: z.string().describe('The user name for login').optional(), - password: z.string().describe('The password for login in clear text').optional(), - }).optional(), -}) - -export type LoginUserDataZodType = z.infer - -/** - * successful operation - */ -export const zLoginUserResponse = z.string().describe('successful operation') - -export type LoginUserResponseZodType = z.infer - -export const zLogoutUserData = z.object({ - body: z.never().optional(), - path: z.never().optional(), - query: z.never().optional(), -}) - -export type LogoutUserDataZodType = z.infer - -export const zDeleteUserData = z.object({ - body: z.never().optional(), - path: z.object({ - username: z.string().describe('The name that needs to be deleted'), - }), - query: z.never().optional(), -}) - -export type DeleteUserDataZodType = z.infer - -export const zGetUserByNameData = z.object({ - body: z.never().optional(), - path: z.object({ - username: z.string().describe('The name that needs to be fetched. Use user1 for testing. '), - }), - query: z.never().optional(), -}) - -export type GetUserByNameDataZodType = z.infer - -/** - * successful operation - */ -export const zGetUserByNameResponse = zUser - -export type GetUserByNameResponseZodType = z.infer - -export const zUpdateUserData = z.object({ - body: zUser.optional(), - path: z.object({ - username: z.string().describe('name that need to be deleted'), - }), - query: z.never().optional(), -}) - -export type UpdateUserDataZodType = z.infer +export type GetConsoleApiPingResponseZodType = z.infer diff --git a/web/open-api/api.json b/web/open-api/api.json deleted file mode 100644 index a7ea7af00e..0000000000 --- a/web/open-api/api.json +++ /dev/null @@ -1,4725 +0,0 @@ -{ - "openapi": "3.0.1", - "info": { - "title": "Service API", - "description": "API for application services", - "version": "1.0" - }, - "servers": [ - { - "url": "/v1" - } - ], - "security": [ - { - "Bearer": [] - } - ], - "tags": [ - { - "name": "service_api", - "description": "Service operations" - } - ], - "paths": { - "/": { - "get": { - "tags": [ - "service_api" - ], - "operationId": "get_index_api", - "responses": { - "200": { - "description": "Success", - "content": {} - } - } - } - }, - "/app/feedbacks": { - "get": { - "tags": [ - "service_api" - ], - "summary": "Get all feedbacks for the application", - "description": "Get all feedbacks for the application\nReturns paginated list of all feedback submitted for messages in this app.", - "operationId": "get_app_feedbacks", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/FeedbackListQuery" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Feedbacks retrieved successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - } - }, - "/apps/annotation-reply/{action}": { - "post": { - "tags": [ - "service_api" - ], - "summary": "Enable or disable annotation reply feature", - "description": "Enable or disable annotation reply feature", - "operationId": "annotation_reply_action", - "parameters": [ - { - "name": "action", - "in": "path", - "description": "Action to perform: 'enable' or 'disable'", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AnnotationReplyActionPayload" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Action completed successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - } - }, - "/apps/annotation-reply/{action}/status/{job_id}": { - "get": { - "tags": [ - "service_api" - ], - "summary": "Get the status of an annotation reply action job", - "description": "Get the status of an annotation reply action job", - "operationId": "get_annotation_reply_action_status", - "parameters": [ - { - "name": "action", - "in": "path", - "description": "Action type", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "job_id", - "in": "path", - "description": "Job ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Job status retrieved successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Job not found", - "content": {} - } - } - } - }, - "/apps/annotations": { - "get": { - "tags": [ - "service_api" - ], - "summary": "List annotations for the application", - "description": "List annotations for the application", - "operationId": "list_annotations", - "parameters": [ - { - "name": "X-Fields", - "in": "header", - "description": "An optional fields mask", - "required": false, - "style": "simple", - "explode": false, - "schema": { - "type": "string", - "format": "mask" - } - } - ], - "responses": { - "200": { - "description": "Annotations retrieved successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AnnotationList" - } - } - } - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - } - } - }, - "post": { - "tags": [ - "service_api" - ], - "summary": "Create a new annotation", - "description": "Create a new annotation", - "operationId": "create_annotation", - "parameters": [ - { - "name": "X-Fields", - "in": "header", - "description": "An optional fields mask", - "required": false, - "style": "simple", - "explode": false, - "schema": { - "type": "string", - "format": "mask" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AnnotationCreatePayload" - } - } - }, - "required": true - }, - "responses": { - "201": { - "description": "Annotation created successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Annotation" - } - } - } - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - } - }, - "/apps/annotations/{annotation_id}": { - "put": { - "tags": [ - "service_api" - ], - "summary": "Update an existing annotation", - "description": "Update an existing annotation", - "operationId": "update_annotation", - "parameters": [ - { - "name": "annotation_id", - "in": "path", - "description": "Annotation ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "X-Fields", - "in": "header", - "description": "An optional fields mask", - "required": false, - "style": "simple", - "explode": false, - "schema": { - "type": "string", - "format": "mask" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AnnotationCreatePayload" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Annotation updated successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Annotation" - } - } - } - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "403": { - "description": "Forbidden - insufficient permissions", - "content": {} - }, - "404": { - "description": "Annotation not found", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - }, - "delete": { - "tags": [ - "service_api" - ], - "summary": "Delete an annotation", - "description": "Delete an annotation", - "operationId": "delete_annotation", - "parameters": [ - { - "name": "annotation_id", - "in": "path", - "description": "Annotation ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "Annotation deleted successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "403": { - "description": "Forbidden - insufficient permissions", - "content": {} - }, - "404": { - "description": "Annotation not found", - "content": {} - } - } - } - }, - "/audio-to-text": { - "post": { - "tags": [ - "service_api" - ], - "summary": "Convert audio to text using speech-to-text", - "description": "Convert audio to text using speech-to-text\nAccepts an audio file upload and returns the transcribed text.", - "operationId": "audio_to_text", - "responses": { - "200": { - "description": "Audio successfully transcribed", - "content": {} - }, - "400": { - "description": "Bad request - no audio or invalid audio", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "413": { - "description": "Audio file too large", - "content": {} - }, - "415": { - "description": "Unsupported audio type", - "content": {} - }, - "500": { - "description": "Internal server error", - "content": {} - } - } - } - }, - "/chat-messages": { - "post": { - "tags": [ - "service_api" - ], - "summary": "Send a message in a chat conversation", - "description": "Send a message in a chat conversation\nThis endpoint handles chat messages for chat, agent chat, and advanced chat applications.\nSupports conversation management and both blocking and streaming response modes.", - "operationId": "create_chat_message", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ChatRequestPayload" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Message sent successfully", - "content": {} - }, - "400": { - "description": "Bad request - invalid parameters or workflow issues", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Conversation or workflow not found", - "content": {} - }, - "429": { - "description": "Rate limit exceeded", - "content": {} - }, - "500": { - "description": "Internal server error", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - } - }, - "/chat-messages/{task_id}/stop": { - "post": { - "tags": [ - "service_api" - ], - "summary": "Stop a running chat message generation", - "description": "Stop a running chat message generation", - "operationId": "stop_chat_message", - "parameters": [ - { - "name": "task_id", - "in": "path", - "description": "The ID of the task to stop", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Task stopped successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Task not found", - "content": {} - } - } - } - }, - "/completion-messages": { - "post": { - "tags": [ - "service_api" - ], - "summary": "Create a completion for the given prompt", - "description": "Create a completion for the given prompt\nThis endpoint generates a completion based on the provided inputs and query.\nSupports both blocking and streaming response modes.", - "operationId": "create_completion", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CompletionRequestPayload" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Completion created successfully", - "content": {} - }, - "400": { - "description": "Bad request - invalid parameters", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Conversation not found", - "content": {} - }, - "500": { - "description": "Internal server error", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - } - }, - "/completion-messages/{task_id}/stop": { - "post": { - "tags": [ - "service_api" - ], - "summary": "Stop a running completion task", - "description": "Stop a running completion task", - "operationId": "stop_completion", - "parameters": [ - { - "name": "task_id", - "in": "path", - "description": "The ID of the task to stop", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Task stopped successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Task not found", - "content": {} - } - } - } - }, - "/conversations": { - "get": { - "tags": [ - "service_api" - ], - "summary": "List all conversations for the current user", - "description": "List all conversations for the current user\nSupports pagination using last_id and limit parameters.", - "operationId": "list_conversations", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConversationListQuery" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Conversations retrieved successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Last conversation not found", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - } - }, - "/conversations/{c_id}": { - "delete": { - "tags": [ - "service_api" - ], - "summary": "Delete a specific conversation", - "description": "Delete a specific conversation", - "operationId": "delete_conversation", - "parameters": [ - { - "name": "c_id", - "in": "path", - "description": "Conversation ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "Conversation deleted successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Conversation not found", - "content": {} - } - } - } - }, - "/conversations/{c_id}/name": { - "post": { - "tags": [ - "service_api" - ], - "summary": "Rename a conversation or auto-generate a name", - "description": "Rename a conversation or auto-generate a name", - "operationId": "rename_conversation", - "parameters": [ - { - "name": "c_id", - "in": "path", - "description": "Conversation ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConversationRenamePayload" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Conversation renamed successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Conversation not found", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - } - }, - "/conversations/{c_id}/variables": { - "get": { - "tags": [ - "service_api" - ], - "summary": "List all variables for a conversation", - "description": "List all variables for a conversation\nConversational variables are only available for chat applications.", - "operationId": "list_conversation_variables", - "parameters": [ - { - "name": "c_id", - "in": "path", - "description": "Conversation ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "X-Fields", - "in": "header", - "description": "An optional fields mask", - "required": false, - "style": "simple", - "explode": false, - "schema": { - "type": "string", - "format": "mask" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConversationVariablesQuery" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Variables retrieved successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConversationVariableInfiniteScrollPagination" - } - } - } - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Conversation not found", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - } - }, - "/conversations/{c_id}/variables/{variable_id}": { - "put": { - "tags": [ - "service_api" - ], - "summary": "Update a conversation variable's value", - "description": "Update a conversation variable's value\nAllows updating the value of a specific conversation variable.\nThe value must match the variable's expected type.", - "operationId": "update_conversation_variable", - "parameters": [ - { - "name": "c_id", - "in": "path", - "description": "Conversation ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "variable_id", - "in": "path", - "description": "Variable ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "X-Fields", - "in": "header", - "description": "An optional fields mask", - "required": false, - "style": "simple", - "explode": false, - "schema": { - "type": "string", - "format": "mask" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConversationVariableUpdatePayload" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Variable updated successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConversationVariable" - } - } - } - }, - "400": { - "description": "Bad request - type mismatch", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Conversation or variable not found", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - } - }, - "/datasets": { - "get": { - "tags": [ - "service_api" - ], - "summary": "Resource for getting datasets", - "description": "List all datasets", - "operationId": "list_datasets", - "responses": { - "200": { - "description": "Datasets retrieved successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - } - } - }, - "post": { - "tags": [ - "service_api" - ], - "summary": "Resource for creating datasets", - "description": "Create a new dataset", - "operationId": "create_dataset", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DatasetCreatePayload" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Dataset created successfully", - "content": {} - }, - "400": { - "description": "Bad request - invalid parameters", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - } - }, - "/datasets/tags": { - "get": { - "tags": [ - "service_api" - ], - "summary": "Get all knowledge type tags", - "description": "Get all knowledge type tags", - "operationId": "list_dataset_tags", - "parameters": [ - { - "name": "X-Fields", - "in": "header", - "description": "An optional fields mask", - "required": false, - "style": "simple", - "explode": false, - "schema": { - "type": "string", - "format": "mask" - } - } - ], - "responses": { - "200": { - "description": "Tags retrieved successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DataSetTag" - } - } - } - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - } - } - }, - "post": { - "tags": [ - "service_api" - ], - "summary": "Add a knowledge type tag", - "description": "Add a knowledge type tag", - "operationId": "create_dataset_tag", - "parameters": [ - { - "name": "X-Fields", - "in": "header", - "description": "An optional fields mask", - "required": false, - "style": "simple", - "explode": false, - "schema": { - "type": "string", - "format": "mask" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TagCreatePayload" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Tag created successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DataSetTag" - } - } - } - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "403": { - "description": "Forbidden - insufficient permissions", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - }, - "delete": { - "tags": [ - "service_api" - ], - "summary": "Delete a knowledge type tag", - "description": "Delete a knowledge type tag", - "operationId": "delete_dataset_tag", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TagDeletePayload" - } - } - }, - "required": true - }, - "responses": { - "204": { - "description": "Tag deleted successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "403": { - "description": "Forbidden - insufficient permissions", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - }, - "patch": { - "tags": [ - "service_api" - ], - "description": "Update a knowledge type tag", - "operationId": "update_dataset_tag", - "parameters": [ - { - "name": "X-Fields", - "in": "header", - "description": "An optional fields mask", - "required": false, - "style": "simple", - "explode": false, - "schema": { - "type": "string", - "format": "mask" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TagUpdatePayload" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Tag updated successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DataSetTag" - } - } - } - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "403": { - "description": "Forbidden - insufficient permissions", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - } - }, - "/datasets/tags/binding": { - "post": { - "tags": [ - "service_api" - ], - "description": "Bind tags to a dataset", - "operationId": "bind_dataset_tags", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TagBindingPayload" - } - } - }, - "required": true - }, - "responses": { - "204": { - "description": "Tags bound successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "403": { - "description": "Forbidden - insufficient permissions", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - } - }, - "/datasets/tags/unbinding": { - "post": { - "tags": [ - "service_api" - ], - "description": "Unbind a tag from a dataset", - "operationId": "unbind_dataset_tag", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TagUnbindingPayload" - } - } - }, - "required": true - }, - "responses": { - "204": { - "description": "Tag unbound successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "403": { - "description": "Forbidden - insufficient permissions", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - } - }, - "/datasets/{dataset_id}": { - "get": { - "tags": [ - "service_api" - ], - "description": "Get a specific dataset by ID", - "operationId": "get_dataset", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "description": "Dataset ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Dataset retrieved successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "403": { - "description": "Forbidden - insufficient permissions", - "content": {} - }, - "404": { - "description": "Dataset not found", - "content": {} - } - } - }, - "delete": { - "tags": [ - "service_api" - ], - "summary": "Deletes a dataset given its ID", - "description": "Delete a dataset\nArgs:\n _: ignore\n dataset_id (UUID): The ID of the dataset to be deleted.\n\nReturns:\n dict: A dictionary with a key 'result' and a value 'success'\n if the dataset was successfully deleted. Omitted in HTTP response.\n int: HTTP status code 204 indicating that the operation was successful.\n\nRaises:\n NotFound: If the dataset with the given ID does not exist.", - "operationId": "delete_dataset", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "description": "Dataset ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "Dataset deleted successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Dataset not found", - "content": {} - }, - "409": { - "description": "Conflict - dataset is in use", - "content": {} - } - } - }, - "patch": { - "tags": [ - "service_api" - ], - "description": "Update an existing dataset", - "operationId": "update_dataset", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "description": "Dataset ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DatasetUpdatePayload" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Dataset updated successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "403": { - "description": "Forbidden - insufficient permissions", - "content": {} - }, - "404": { - "description": "Dataset not found", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - } - }, - "/datasets/{dataset_id}/document/create-by-file": { - "post": { - "tags": [ - "service_api" - ], - "description": "Create a new document by uploading a file", - "operationId": "create_document_by_file", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "description": "Dataset ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Document created successfully", - "content": {} - }, - "400": { - "description": "Bad request - invalid file or parameters", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - } - } - } - }, - "/datasets/{dataset_id}/document/create-by-text": { - "post": { - "tags": [ - "service_api" - ], - "description": "Create a new document by providing text content", - "operationId": "create_document_by_text", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "description": "Dataset ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DocumentTextCreatePayload" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Document created successfully", - "content": {} - }, - "400": { - "description": "Bad request - invalid parameters", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - } - }, - "/datasets/{dataset_id}/document/create_by_file": { - "post": { - "tags": [ - "service_api" - ], - "description": "Create a new document by uploading a file", - "operationId": "create_document_by_file", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "description": "Dataset ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Document created successfully", - "content": {} - }, - "400": { - "description": "Bad request - invalid file or parameters", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - } - } - } - }, - "/datasets/{dataset_id}/document/create_by_text": { - "post": { - "tags": [ - "service_api" - ], - "description": "Create a new document by providing text content", - "operationId": "create_document_by_text", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "description": "Dataset ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DocumentTextCreatePayload" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Document created successfully", - "content": {} - }, - "400": { - "description": "Bad request - invalid parameters", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - } - }, - "/datasets/{dataset_id}/documents": { - "get": { - "tags": [ - "service_api" - ], - "description": "List all documents in a dataset", - "operationId": "list_documents", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "description": "Dataset ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Documents retrieved successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Dataset not found", - "content": {} - } - } - } - }, - "/datasets/{dataset_id}/documents/metadata": { - "post": { - "tags": [ - "service_api" - ], - "summary": "Update metadata for multiple documents", - "description": "Update metadata for multiple documents", - "operationId": "update_documents_metadata", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "description": "Dataset ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MetadataOperationData" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Documents metadata updated successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Dataset not found", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - } - }, - "/datasets/{dataset_id}/documents/status/{action}": { - "patch": { - "tags": [ - "service_api" - ], - "summary": "Batch update document status", - "description": "Batch update document status\nArgs:\n tenant_id: tenant id\n dataset_id: dataset id\n action: action to perform (Literal[\"enable\", \"disable\", \"archive\", \"un_archive\"])\n\nReturns:\n dict: A dictionary with a key 'result' and a value 'success'\n int: HTTP status code 200 indicating that the operation was successful.\n\nRaises:\n NotFound: If the dataset with the given ID does not exist.\n Forbidden: If the user does not have permission.\n InvalidActionError: If the action is invalid or cannot be performed.", - "operationId": "update_document_status", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "description": "Dataset ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "action", - "in": "path", - "description": "Action to perform: 'enable', 'disable', 'archive', or 'un_archive'", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Document status updated successfully", - "content": {} - }, - "400": { - "description": "Bad request - invalid action", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "403": { - "description": "Forbidden - insufficient permissions", - "content": {} - }, - "404": { - "description": "Dataset not found", - "content": {} - } - } - } - }, - "/datasets/{dataset_id}/documents/{batch}/indexing-status": { - "get": { - "tags": [ - "service_api" - ], - "description": "Get indexing status for documents in a batch", - "operationId": "get_document_indexing_status", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "description": "Dataset ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "batch", - "in": "path", - "description": "Batch ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Indexing status retrieved successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Dataset or documents not found", - "content": {} - } - } - } - }, - "/datasets/{dataset_id}/documents/{document_id}": { - "get": { - "tags": [ - "service_api" - ], - "description": "Get a specific document by ID", - "operationId": "get_document", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "description": "Dataset ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "document_id", - "in": "path", - "description": "Document ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Document retrieved successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "403": { - "description": "Forbidden - insufficient permissions", - "content": {} - }, - "404": { - "description": "Document not found", - "content": {} - } - } - }, - "delete": { - "tags": [ - "service_api" - ], - "summary": "Delete document", - "description": "Delete a document", - "operationId": "delete_document", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "description": "Dataset ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "document_id", - "in": "path", - "description": "Document ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "Document deleted successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "403": { - "description": "Forbidden - document is archived", - "content": {} - }, - "404": { - "description": "Document not found", - "content": {} - } - } - } - }, - "/datasets/{dataset_id}/documents/{document_id}/segments": { - "get": { - "tags": [ - "service_api" - ], - "description": "List segments in a document", - "operationId": "list_segments", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "description": "Dataset ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "document_id", - "in": "path", - "description": "Document ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SegmentListQuery" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Segments retrieved successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Dataset or document not found", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - }, - "post": { - "tags": [ - "service_api" - ], - "description": "Create segments in a document", - "operationId": "create_segments", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "description": "Dataset ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "document_id", - "in": "path", - "description": "Document ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SegmentCreatePayload" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Segments created successfully", - "content": {} - }, - "400": { - "description": "Bad request - segments data is missing", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Dataset or document not found", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - } - }, - "/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}": { - "get": { - "tags": [ - "service_api" - ], - "description": "Get a specific segment by ID", - "operationId": "get_segment", - "parameters": [ - { - "name": "document_id", - "in": "path", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "segment_id", - "in": "path", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "dataset_id", - "in": "path", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Segment retrieved successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Dataset, document, or segment not found", - "content": {} - } - } - }, - "post": { - "tags": [ - "service_api" - ], - "description": "Update a specific segment", - "operationId": "update_segment", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "description": "Dataset ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "document_id", - "in": "path", - "description": "Document ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "segment_id", - "in": "path", - "description": "Segment ID to update", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SegmentUpdatePayload" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Segment updated successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Dataset, document, or segment not found", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - }, - "delete": { - "tags": [ - "service_api" - ], - "description": "Delete a specific segment", - "operationId": "delete_segment", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "description": "Dataset ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "document_id", - "in": "path", - "description": "Document ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "segment_id", - "in": "path", - "description": "Segment ID to delete", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "Segment deleted successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Dataset, document, or segment not found", - "content": {} - } - } - } - }, - "/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks": { - "get": { - "tags": [ - "service_api" - ], - "description": "List child chunks for a segment", - "operationId": "list_child_chunks", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "description": "Dataset ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "document_id", - "in": "path", - "description": "Document ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "segment_id", - "in": "path", - "description": "Parent segment ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ChildChunkListQuery" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Child chunks retrieved successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Dataset, document, or segment not found", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - }, - "post": { - "tags": [ - "service_api" - ], - "description": "Create a new child chunk for a segment", - "operationId": "create_child_chunk", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "description": "Dataset ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "document_id", - "in": "path", - "description": "Document ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "segment_id", - "in": "path", - "description": "Parent segment ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ChildChunkCreatePayload" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Child chunk created successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Dataset, document, or segment not found", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - } - }, - "/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks/{child_chunk_id}": { - "delete": { - "tags": [ - "service_api" - ], - "description": "Delete a specific child chunk", - "operationId": "delete_child_chunk", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "description": "Dataset ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "document_id", - "in": "path", - "description": "Document ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "segment_id", - "in": "path", - "description": "Parent segment ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "child_chunk_id", - "in": "path", - "description": "Child chunk ID to delete", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "Child chunk deleted successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Dataset, document, segment, or child chunk not found", - "content": {} - } - } - }, - "patch": { - "tags": [ - "service_api" - ], - "description": "Update a specific child chunk", - "operationId": "update_child_chunk", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "description": "Dataset ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "document_id", - "in": "path", - "description": "Document ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "segment_id", - "in": "path", - "description": "Parent segment ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "child_chunk_id", - "in": "path", - "description": "Child chunk ID to update", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ChildChunkUpdatePayload" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Child chunk updated successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Dataset, document, segment, or child chunk not found", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - } - }, - "/datasets/{dataset_id}/documents/{document_id}/update-by-file": { - "post": { - "tags": [ - "service_api" - ], - "description": "Update an existing document by uploading a file", - "operationId": "update_document_by_file", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "description": "Dataset ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "document_id", - "in": "path", - "description": "Document ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Document updated successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Document not found", - "content": {} - } - } - } - }, - "/datasets/{dataset_id}/documents/{document_id}/update-by-text": { - "post": { - "tags": [ - "service_api" - ], - "description": "Update an existing document by providing text content", - "operationId": "update_document_by_text", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "description": "Dataset ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "document_id", - "in": "path", - "description": "Document ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DocumentTextUpdate" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Document updated successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Document not found", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - } - }, - "/datasets/{dataset_id}/documents/{document_id}/update_by_file": { - "post": { - "tags": [ - "service_api" - ], - "description": "Update an existing document by uploading a file", - "operationId": "update_document_by_file", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "description": "Dataset ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "document_id", - "in": "path", - "description": "Document ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Document updated successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Document not found", - "content": {} - } - } - } - }, - "/datasets/{dataset_id}/documents/{document_id}/update_by_text": { - "post": { - "tags": [ - "service_api" - ], - "description": "Update an existing document by providing text content", - "operationId": "update_document_by_text", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "description": "Dataset ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "document_id", - "in": "path", - "description": "Document ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DocumentTextUpdate" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Document updated successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Document not found", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - } - }, - "/datasets/{dataset_id}/hit-testing": { - "post": { - "tags": [ - "service_api" - ], - "summary": "Perform hit testing on a dataset", - "description": "Perform hit testing on a dataset\nTests retrieval performance for the specified dataset.", - "operationId": "dataset_hit_testing", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "description": "Dataset ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Hit testing results", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Dataset not found", - "content": {} - } - } - } - }, - "/datasets/{dataset_id}/metadata": { - "get": { - "tags": [ - "service_api" - ], - "summary": "Get all metadata for a dataset", - "description": "Get all metadata for a dataset", - "operationId": "get_dataset_metadata", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "description": "Dataset ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Metadata retrieved successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Dataset not found", - "content": {} - } - } - }, - "post": { - "tags": [ - "service_api" - ], - "summary": "Create metadata for a dataset", - "description": "Create metadata for a dataset", - "operationId": "create_dataset_metadata", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "description": "Dataset ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MetadataArgs" - } - } - }, - "required": true - }, - "responses": { - "201": { - "description": "Metadata created successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Dataset not found", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - } - }, - "/datasets/{dataset_id}/metadata/built-in": { - "get": { - "tags": [ - "service_api" - ], - "summary": "Get all built-in metadata fields", - "description": "Get all built-in metadata fields", - "operationId": "get_built_in_fields", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Built-in fields retrieved successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - } - } - } - }, - "/datasets/{dataset_id}/metadata/built-in/{action}": { - "post": { - "tags": [ - "service_api" - ], - "summary": "Enable or disable built-in metadata field", - "description": "Enable or disable built-in metadata field", - "operationId": "toggle_built_in_field", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "description": "Dataset ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "action", - "in": "path", - "description": "Action to perform: 'enable' or 'disable'", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Action completed successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Dataset not found", - "content": {} - } - } - } - }, - "/datasets/{dataset_id}/metadata/{metadata_id}": { - "delete": { - "tags": [ - "service_api" - ], - "summary": "Delete metadata", - "description": "Delete metadata", - "operationId": "delete_dataset_metadata", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "description": "Dataset ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "metadata_id", - "in": "path", - "description": "Metadata ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "Metadata deleted successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Dataset or metadata not found", - "content": {} - } - } - }, - "patch": { - "tags": [ - "service_api" - ], - "summary": "Update metadata name", - "description": "Update metadata name", - "operationId": "update_dataset_metadata", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "description": "Dataset ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "metadata_id", - "in": "path", - "description": "Metadata ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MetadataUpdatePayload" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Metadata updated successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Dataset or metadata not found", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - } - }, - "/datasets/{dataset_id}/retrieve": { - "post": { - "tags": [ - "service_api" - ], - "summary": "Perform hit testing on a dataset", - "description": "Perform hit testing on a dataset\nTests retrieval performance for the specified dataset.", - "operationId": "dataset_hit_testing", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "description": "Dataset ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Hit testing results", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Dataset not found", - "content": {} - } - } - } - }, - "/datasets/{dataset_id}/tags": { - "get": { - "tags": [ - "service_api" - ], - "summary": "Get all knowledge type tags", - "description": "Get tags bound to a specific dataset", - "operationId": "get_dataset_tags_binding_status", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "description": "Dataset ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Tags retrieved successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - } - } - } - }, - "/files/upload": { - "post": { - "tags": [ - "service_api" - ], - "summary": "Upload a file for use in conversations", - "description": "Upload a file for use in conversations\nAccepts a single file upload via multipart/form-data.", - "operationId": "upload_file", - "responses": { - "201": { - "description": "File uploaded successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/FileResponse" - } - } - } - }, - "400": { - "description": "Bad request - no file or invalid file", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "413": { - "description": "File too large", - "content": {} - }, - "415": { - "description": "Unsupported file type", - "content": {} - } - } - } - }, - "/files/{file_id}/preview": { - "get": { - "tags": [ - "service_api" - ], - "summary": "Preview/Download a file that was uploaded via Service API", - "description": "Preview or download a file uploaded via Service API\nProvides secure file preview/download functionality.\nFiles can only be accessed if they belong to messages within the requesting app's context.", - "operationId": "preview_file", - "parameters": [ - { - "name": "file_id", - "in": "path", - "description": "UUID of the file to preview", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/FilePreviewQuery" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "File retrieved successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "403": { - "description": "Forbidden - file access denied", - "content": {} - }, - "404": { - "description": "File not found", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - } - }, - "/info": { - "get": { - "tags": [ - "service_api" - ], - "summary": "Get app information", - "description": "Get basic application information\nReturns basic information about the application including name, description, tags, and mode.", - "operationId": "get_app_info", - "responses": { - "200": { - "description": "Application info retrieved successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Application not found", - "content": {} - } - } - } - }, - "/messages": { - "get": { - "tags": [ - "service_api" - ], - "summary": "List messages in a conversation", - "description": "List messages in a conversation\nRetrieves messages with pagination support using first_id.", - "operationId": "list_messages", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MessageListQuery" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Messages retrieved successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Conversation or first message not found", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - } - }, - "/messages/{message_id}/feedbacks": { - "post": { - "tags": [ - "service_api" - ], - "summary": "Submit feedback for a message", - "description": "Submit feedback for a message\nAllows users to rate messages as like/dislike and provide optional feedback content.", - "operationId": "create_message_feedback", - "parameters": [ - { - "name": "message_id", - "in": "path", - "description": "Message ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MessageFeedbackPayload" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Feedback submitted successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Message not found", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - } - }, - "/messages/{message_id}/suggested": { - "get": { - "tags": [ - "service_api" - ], - "summary": "Get suggested follow-up questions for a message", - "description": "Get suggested follow-up questions for a message\nReturns AI-generated follow-up questions based on the message content.", - "operationId": "get_suggested_questions", - "parameters": [ - { - "name": "message_id", - "in": "path", - "description": "Message ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Suggested questions retrieved successfully", - "content": {} - }, - "400": { - "description": "Suggested questions feature is disabled", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Message not found", - "content": {} - }, - "500": { - "description": "Internal server error", - "content": {} - } - } - } - }, - "/meta": { - "get": { - "tags": [ - "service_api" - ], - "summary": "Get app metadata", - "description": "Get application metadata\nReturns metadata about the application including configuration and settings.", - "operationId": "get_app_meta", - "responses": { - "200": { - "description": "Metadata retrieved successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Application not found", - "content": {} - } - } - } - }, - "/parameters": { - "get": { - "tags": [ - "service_api" - ], - "summary": "Retrieve app parameters", - "description": "Retrieve application input parameters and configuration\nReturns the input form parameters and configuration for the application.", - "operationId": "get_app_parameters", - "responses": { - "200": { - "description": "Parameters retrieved successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Application not found", - "content": {} - } - } - } - }, - "/site": { - "get": { - "tags": [ - "service_api" - ], - "summary": "Retrieve app site info", - "description": "Get application site configuration\nReturns the site configuration for the application including theme, icons, and text.", - "operationId": "get_app_site", - "responses": { - "200": { - "description": "Site configuration retrieved successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "403": { - "description": "Forbidden - site not found or tenant archived", - "content": {} - } - } - } - }, - "/text-to-audio": { - "post": { - "tags": [ - "service_api" - ], - "summary": "Convert text to audio using text-to-speech", - "description": "Convert text to audio using text-to-speech\nConverts the provided text to audio using the specified voice.", - "operationId": "text_to_audio", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TextToAudioPayload" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Text successfully converted to audio", - "content": {} - }, - "400": { - "description": "Bad request - invalid parameters", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "500": { - "description": "Internal server error", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - } - }, - "/workflows/logs": { - "get": { - "tags": [ - "service_api" - ], - "summary": "Get workflow app logs", - "description": "Get workflow execution logs\nReturns paginated workflow execution logs with filtering options.", - "operationId": "get_workflow_logs", - "parameters": [ - { - "name": "X-Fields", - "in": "header", - "description": "An optional fields mask", - "required": false, - "style": "simple", - "explode": false, - "schema": { - "type": "string", - "format": "mask" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/WorkflowLogQuery" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Logs retrieved successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/WorkflowAppLogPagination" - } - } - } - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - } - }, - "/workflows/run": { - "post": { - "tags": [ - "service_api" - ], - "summary": "Execute a workflow", - "description": "Execute a workflow\nRuns a workflow with the provided inputs and returns the results.\nSupports both blocking and streaming response modes.", - "operationId": "run_workflow", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/WorkflowRunPayload" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Workflow executed successfully", - "content": {} - }, - "400": { - "description": "Bad request - invalid parameters or workflow issues", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Workflow not found", - "content": {} - }, - "429": { - "description": "Rate limit exceeded", - "content": {} - }, - "500": { - "description": "Internal server error", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - } - }, - "/workflows/run/{workflow_run_id}": { - "get": { - "tags": [ - "service_api" - ], - "summary": "Get a workflow task running detail", - "description": "Get workflow run details\nReturns detailed information about a specific workflow run.", - "operationId": "get_workflow_run_detail", - "parameters": [ - { - "name": "workflow_run_id", - "in": "path", - "description": "Workflow run ID", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - }, - { - "name": "X-Fields", - "in": "header", - "description": "An optional fields mask", - "required": false, - "style": "simple", - "explode": false, - "schema": { - "type": "string", - "format": "mask" - } - } - ], - "responses": { - "200": { - "description": "Workflow run details retrieved successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/WorkflowRun" - } - } - } - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Workflow run not found", - "content": {} - } - } - } - }, - "/workflows/tasks/{task_id}/stop": { - "post": { - "tags": [ - "service_api" - ], - "summary": "Stop a running workflow task", - "description": "Stop a running workflow task", - "operationId": "stop_workflow_task", - "parameters": [ - { - "name": "task_id", - "in": "path", - "description": "Task ID to stop", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Task stopped successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Task not found", - "content": {} - } - } - } - }, - "/workflows/{workflow_id}/run": { - "post": { - "tags": [ - "service_api" - ], - "summary": "Run specific workflow by ID", - "description": "Execute a specific workflow by ID\nExecutes a specific workflow version identified by its ID.", - "operationId": "run_workflow_by_id", - "parameters": [ - { - "name": "workflow_id", - "in": "path", - "description": "Workflow ID to execute", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/WorkflowRunPayload" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Workflow executed successfully", - "content": {} - }, - "400": { - "description": "Bad request - invalid parameters or workflow issues", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - }, - "404": { - "description": "Workflow not found", - "content": {} - }, - "429": { - "description": "Rate limit exceeded", - "content": {} - }, - "500": { - "description": "Internal server error", - "content": {} - } - }, - "x-codegen-request-body-name": "payload" - } - }, - "/workspaces/current/models/model-types/{model_type}": { - "get": { - "tags": [ - "service_api" - ], - "summary": "Get available models by model type", - "description": "Get available models by model type\nReturns a list of available models for the specified model type.", - "operationId": "get_available_models", - "parameters": [ - { - "name": "model_type", - "in": "path", - "description": "Type of model to retrieve", - "required": true, - "style": "simple", - "explode": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Models retrieved successfully", - "content": {} - }, - "401": { - "description": "Unauthorized - invalid API token", - "content": {} - } - } - } - } - }, - "components": { - "schemas": { - "AnnotationReplyActionPayload": { - "title": "AnnotationReplyActionPayload", - "required": [ - "embedding_model_name", - "embedding_provider_name", - "score_threshold" - ], - "type": "object", - "properties": { - "score_threshold": { - "title": "Score Threshold", - "type": "number", - "description": "Score threshold for annotation matching" - }, - "embedding_provider_name": { - "title": "Embedding Provider Name", - "type": "string", - "description": "Embedding provider name" - }, - "embedding_model_name": { - "title": "Embedding Model Name", - "type": "string", - "description": "Embedding model name" - } - } - }, - "AnnotationCreatePayload": { - "title": "AnnotationCreatePayload", - "required": [ - "answer", - "question" - ], - "type": "object", - "properties": { - "question": { - "title": "Question", - "type": "string", - "description": "Annotation question" - }, - "answer": { - "title": "Answer", - "type": "string", - "description": "Annotation answer" - } - } - }, - "Annotation": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "question": { - "type": "string" - }, - "answer": { - "type": "object", - "properties": {} - }, - "hit_count": { - "type": "integer" - }, - "created_at": { - "type": "object", - "properties": {} - } - } - }, - "AnnotationList": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Annotation" - } - }, - "has_more": { - "type": "boolean" - }, - "limit": { - "type": "integer" - }, - "total": { - "type": "integer" - }, - "page": { - "type": "integer" - } - } - }, - "TextToAudioPayload": { - "title": "TextToAudioPayload", - "type": "object", - "properties": { - "message_id": { - "title": "Message Id", - "type": "object", - "description": "Message ID" - }, - "voice": { - "title": "Voice", - "type": "object", - "description": "Voice to use for TTS" - }, - "text": { - "title": "Text", - "type": "object", - "description": "Text to convert to audio" - }, - "streaming": { - "title": "Streaming", - "type": "object", - "description": "Enable streaming response" - } - } - }, - "CompletionRequestPayload": { - "title": "CompletionRequestPayload", - "required": [ - "inputs" - ], - "type": "object", - "properties": { - "inputs": { - "title": "Inputs", - "type": "object", - "additionalProperties": true - }, - "query": { - "title": "Query", - "type": "string", - "default": "" - }, - "files": { - "title": "Files", - "type": "object" - }, - "response_mode": { - "title": "Response Mode", - "type": "object" - }, - "retriever_from": { - "title": "Retriever From", - "type": "string", - "default": "dev" - } - } - }, - "ChatRequestPayload": { - "title": "ChatRequestPayload", - "required": [ - "inputs", - "query" - ], - "type": "object", - "properties": { - "inputs": { - "title": "Inputs", - "type": "object", - "additionalProperties": true - }, - "query": { - "title": "Query", - "type": "string" - }, - "files": { - "title": "Files", - "type": "object" - }, - "response_mode": { - "title": "Response Mode", - "type": "object" - }, - "conversation_id": { - "title": "Conversation Id", - "type": "object", - "description": "Conversation UUID" - }, - "retriever_from": { - "title": "Retriever From", - "type": "string", - "default": "dev" - }, - "auto_generate_name": { - "title": "Auto Generate Name", - "type": "boolean", - "description": "Auto generate conversation name", - "default": true - }, - "workflow_id": { - "title": "Workflow Id", - "type": "object", - "description": "Workflow ID for advanced chat" - } - } - }, - "ConversationListQuery": { - "title": "ConversationListQuery", - "type": "object", - "properties": { - "last_id": { - "title": "Last Id", - "type": "object", - "description": "Last conversation ID for pagination" - }, - "limit": { - "title": "Limit", - "maximum": 100, - "minimum": 1, - "type": "integer", - "description": "Number of conversations to return" - }, - "sort_by": { - "title": "Sort By", - "type": "string", - "description": "Sort order for conversations", - "default": "-updated_at", - "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at" - ] - } - } - }, - "ConversationRenamePayload": { - "title": "ConversationRenamePayload", - "type": "object", - "properties": { - "name": { - "title": "Name", - "type": "object", - "description": "New conversation name (required if auto_generate is false)" - }, - "auto_generate": { - "title": "Auto Generate", - "type": "boolean", - "description": "Auto-generate conversation name", - "default": false - } - } - }, - "ConversationVariablesQuery": { - "title": "ConversationVariablesQuery", - "type": "object", - "properties": { - "last_id": { - "title": "Last Id", - "type": "object", - "description": "Last variable ID for pagination" - }, - "limit": { - "title": "Limit", - "maximum": 100, - "minimum": 1, - "type": "integer", - "description": "Number of variables to return" - }, - "variable_name": { - "title": "Variable Name", - "type": "object", - "description": "Filter variables by name" - } - } - }, - "ConversationVariableInfiniteScrollPagination": { - "type": "object", - "properties": { - "limit": { - "type": "integer" - }, - "has_more": { - "type": "boolean" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ConversationVariable" - } - } - } - }, - "ConversationVariable": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "value_type": { - "type": "string" - }, - "value": { - "type": "string" - }, - "description": { - "type": "string" - }, - "created_at": { - "type": "object", - "properties": {} - }, - "updated_at": { - "type": "object", - "properties": {} - } - } - }, - "ConversationVariableUpdatePayload": { - "title": "ConversationVariableUpdatePayload", - "required": [ - "value" - ], - "type": "object", - "properties": { - "value": { - "title": "Value", - "type": "object" - } - } - }, - "FileResponse": { - "title": "FileResponse", - "required": [ - "id", - "name", - "size" - ], - "type": "object", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "size": { - "title": "Size", - "type": "integer" - }, - "extension": { - "title": "Extension", - "type": "object" - }, - "mime_type": { - "title": "Mime Type", - "type": "object" - }, - "created_by": { - "title": "Created By", - "type": "object" - }, - "created_at": { - "title": "Created At", - "type": "object" - }, - "preview_url": { - "title": "Preview Url", - "type": "object" - }, - "source_url": { - "title": "Source Url", - "type": "object" - }, - "original_url": { - "title": "Original Url", - "type": "object" - }, - "user_id": { - "title": "User Id", - "type": "object" - }, - "tenant_id": { - "title": "Tenant Id", - "type": "object" - }, - "conversation_id": { - "title": "Conversation Id", - "type": "object" - }, - "file_key": { - "title": "File Key", - "type": "object" - } - } - }, - "FilePreviewQuery": { - "title": "FilePreviewQuery", - "type": "object", - "properties": { - "as_attachment": { - "title": "As Attachment", - "type": "boolean", - "description": "Download as attachment", - "default": false - } - } - }, - "MessageListQuery": { - "title": "MessageListQuery", - "required": [ - "conversation_id" - ], - "type": "object", - "properties": { - "conversation_id": { - "title": "Conversation Id", - "type": "string", - "format": "uuid" - }, - "first_id": { - "title": "First Id", - "type": "object" - }, - "limit": { - "title": "Limit", - "maximum": 100, - "minimum": 1, - "type": "integer", - "description": "Number of messages to return" - } - } - }, - "MessageFeedbackPayload": { - "title": "MessageFeedbackPayload", - "type": "object", - "properties": { - "rating": { - "title": "Rating", - "type": "object", - "description": "Feedback rating" - }, - "content": { - "title": "Content", - "type": "object", - "description": "Feedback content" - } - } - }, - "FeedbackListQuery": { - "title": "FeedbackListQuery", - "type": "object", - "properties": { - "page": { - "title": "Page", - "minimum": 1, - "type": "integer", - "description": "Page number" - }, - "limit": { - "title": "Limit", - "maximum": 101, - "minimum": 1, - "type": "integer", - "description": "Number of feedbacks per page" - } - } - }, - "WorkflowRun": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "workflow_id": { - "type": "string" - }, - "status": { - "type": "string" - }, - "inputs": { - "type": "object", - "properties": {} - }, - "outputs": { - "type": "object", - "properties": {} - }, - "error": { - "type": "string" - }, - "total_steps": { - "type": "integer" - }, - "total_tokens": { - "type": "integer" - }, - "created_at": { - "type": "object", - "properties": {} - }, - "finished_at": { - "type": "object", - "properties": {} - }, - "elapsed_time": { - "type": "number" - } - } - }, - "WorkflowRunPayload": { - "title": "WorkflowRunPayload", - "required": [ - "inputs" - ], - "type": "object", - "properties": { - "inputs": { - "title": "Inputs", - "type": "object", - "additionalProperties": true - }, - "files": { - "title": "Files", - "type": "object" - }, - "response_mode": { - "title": "Response Mode", - "type": "object" - } - } - }, - "WorkflowLogQuery": { - "title": "WorkflowLogQuery", - "type": "object", - "properties": { - "keyword": { - "title": "Keyword", - "type": "object" - }, - "status": { - "title": "Status", - "type": "object" - }, - "created_at__before": { - "title": "Created At Before", - "type": "object" - }, - "created_at__after": { - "title": "Created At After", - "type": "object" - }, - "created_by_end_user_session_id": { - "title": "Created By End User Session Id", - "type": "object" - }, - "created_by_account": { - "title": "Created By Account", - "type": "object" - }, - "page": { - "title": "Page", - "maximum": 99999, - "minimum": 1, - "type": "integer" - }, - "limit": { - "title": "Limit", - "maximum": 100, - "minimum": 1, - "type": "integer" - } - } - }, - "WorkflowAppLogPagination": { - "type": "object", - "properties": { - "page": { - "type": "integer" - }, - "limit": { - "type": "integer" - }, - "total": { - "type": "integer" - }, - "has_more": { - "type": "boolean" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/WorkflowAppLogPartial" - } - } - } - }, - "WorkflowAppLogPartial": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "workflow_run": { - "$ref": "#/components/schemas/WorkflowRunForLog" - }, - "details": { - "type": "object", - "properties": {} - }, - "created_from": { - "type": "string" - }, - "created_by_role": { - "type": "string" - }, - "created_by_account": { - "$ref": "#/components/schemas/SimpleAccount" - }, - "created_by_end_user": { - "$ref": "#/components/schemas/SimpleEndUser" - }, - "created_at": { - "type": "object", - "properties": {} - } - } - }, - "WorkflowRunForLog": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "version": { - "type": "string" - }, - "status": { - "type": "string" - }, - "triggered_from": { - "type": "string" - }, - "error": { - "type": "string" - }, - "elapsed_time": { - "type": "number" - }, - "total_tokens": { - "type": "integer" - }, - "total_steps": { - "type": "integer" - }, - "created_at": { - "type": "object", - "properties": {} - }, - "finished_at": { - "type": "object", - "properties": {} - }, - "exceptions_count": { - "type": "integer" - } - } - }, - "SimpleAccount": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "email": { - "type": "string" - } - } - }, - "SimpleEndUser": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "type": { - "type": "string" - }, - "is_anonymous": { - "type": "boolean" - }, - "session_id": { - "type": "string" - } - } - }, - "DatasetCreatePayload": { - "title": "DatasetCreatePayload", - "required": [ - "name" - ], - "type": "object", - "properties": { - "name": { - "title": "Name", - "maxLength": 40, - "minLength": 1, - "type": "string" - }, - "description": { - "title": "Description", - "maxLength": 400, - "type": "string", - "description": "Dataset description (max 400 chars)", - "default": "" - }, - "indexing_technique": { - "title": "Indexing Technique", - "type": "object" - }, - "permission": { - "type": "object" - }, - "external_knowledge_api_id": { - "title": "External Knowledge Api Id", - "type": "object" - }, - "provider": { - "title": "Provider", - "type": "string", - "default": "vendor" - }, - "external_knowledge_id": { - "title": "External Knowledge Id", - "type": "object" - }, - "retrieval_model": { - "type": "object" - }, - "embedding_model": { - "title": "Embedding Model", - "type": "object" - }, - "embedding_model_provider": { - "title": "Embedding Model Provider", - "type": "object" - } - } - }, - "DatasetUpdatePayload": { - "title": "DatasetUpdatePayload", - "type": "object", - "properties": { - "name": { - "title": "Name", - "type": "object" - }, - "description": { - "title": "Description", - "type": "object", - "description": "Dataset description (max 400 chars)" - }, - "indexing_technique": { - "title": "Indexing Technique", - "type": "object" - }, - "permission": { - "type": "object" - }, - "embedding_model": { - "title": "Embedding Model", - "type": "object" - }, - "embedding_model_provider": { - "title": "Embedding Model Provider", - "type": "object" - }, - "retrieval_model": { - "type": "object" - }, - "partial_member_list": { - "title": "Partial Member List", - "type": "object" - }, - "external_retrieval_model": { - "title": "External Retrieval Model", - "type": "object" - }, - "external_knowledge_id": { - "title": "External Knowledge Id", - "type": "object" - }, - "external_knowledge_api_id": { - "title": "External Knowledge Api Id", - "type": "object" - } - } - }, - "TagCreatePayload": { - "title": "TagCreatePayload", - "required": [ - "name" - ], - "type": "object", - "properties": { - "name": { - "title": "Name", - "maxLength": 50, - "minLength": 1, - "type": "string" - } - } - }, - "TagDeletePayload": { - "title": "TagDeletePayload", - "required": [ - "tag_id" - ], - "type": "object", - "properties": { - "tag_id": { - "title": "Tag Id", - "type": "string" - } - } - }, - "TagUpdatePayload": { - "title": "TagUpdatePayload", - "required": [ - "name", - "tag_id" - ], - "type": "object", - "properties": { - "name": { - "title": "Name", - "maxLength": 50, - "minLength": 1, - "type": "string" - }, - "tag_id": { - "title": "Tag Id", - "type": "string" - } - } - }, - "DataSetTag": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "type": { - "type": "string" - }, - "binding_count": { - "type": "string" - } - } - }, - "TagBindingPayload": { - "title": "TagBindingPayload", - "required": [ - "tag_ids", - "target_id" - ], - "type": "object", - "properties": { - "tag_ids": { - "title": "Tag Ids", - "type": "array", - "items": { - "type": "string" - } - }, - "target_id": { - "title": "Target Id", - "type": "string" - } - } - }, - "TagUnbindingPayload": { - "title": "TagUnbindingPayload", - "required": [ - "tag_id", - "target_id" - ], - "type": "object", - "properties": { - "tag_id": { - "title": "Tag Id", - "type": "string" - }, - "target_id": { - "title": "Target Id", - "type": "string" - } - } - }, - "DocumentTextCreatePayload": { - "title": "DocumentTextCreatePayload", - "required": [ - "name", - "text" - ], - "type": "object", - "properties": { - "name": { - "title": "Name", - "type": "string" - }, - "text": { - "title": "Text", - "type": "string" - }, - "process_rule": { - "type": "object" - }, - "original_document_id": { - "title": "Original Document Id", - "type": "object" - }, - "doc_form": { - "title": "Doc Form", - "type": "string", - "default": "text_model" - }, - "doc_language": { - "title": "Doc Language", - "type": "string", - "default": "English" - }, - "indexing_technique": { - "title": "Indexing Technique", - "type": "object" - }, - "retrieval_model": { - "type": "object" - }, - "embedding_model": { - "title": "Embedding Model", - "type": "object" - }, - "embedding_model_provider": { - "title": "Embedding Model Provider", - "type": "object" - } - } - }, - "DocumentTextUpdate": { - "title": "DocumentTextUpdate", - "type": "object", - "properties": { - "name": { - "title": "Name", - "type": "object" - }, - "text": { - "title": "Text", - "type": "object" - }, - "process_rule": { - "type": "object" - }, - "doc_form": { - "title": "Doc Form", - "type": "string", - "default": "text_model" - }, - "doc_language": { - "title": "Doc Language", - "type": "string", - "default": "English" - }, - "retrieval_model": { - "type": "object" - } - } - }, - "MetadataArgs": { - "title": "MetadataArgs", - "required": [ - "name", - "type" - ], - "type": "object", - "properties": { - "type": { - "title": "Type", - "type": "string", - "enum": [ - "string", - "number", - "time" - ] - }, - "name": { - "title": "Name", - "type": "string" - } - } - }, - "MetadataUpdatePayload": { - "title": "MetadataUpdatePayload", - "required": [ - "name" - ], - "type": "object", - "properties": { - "name": { - "title": "Name", - "type": "string" - } - } - }, - "MetadataOperationData": { - "title": "MetadataOperationData", - "required": [ - "operation_data" - ], - "type": "object", - "properties": { - "operation_data": { - "title": "Operation Data", - "type": "array", - "items": { - "$ref": "#/components/schemas/DocumentMetadataOperation" - } - } - }, - "description": "Metadata operation data" - }, - "SegmentCreatePayload": { - "title": "SegmentCreatePayload", - "type": "object", - "properties": { - "segments": { - "title": "Segments", - "type": "object" - } - } - }, - "SegmentListQuery": { - "title": "SegmentListQuery", - "type": "object", - "properties": { - "status": { - "title": "Status", - "type": "array", - "items": { - "type": "string" - } - }, - "keyword": { - "title": "Keyword", - "type": "object" - } - } - }, - "SegmentUpdatePayload": { - "title": "SegmentUpdatePayload", - "required": [ - "segment" - ], - "type": "object", - "properties": { - "segment": { - "$ref": "#/components/schemas/SegmentUpdateArgs" - } - } - }, - "ChildChunkCreatePayload": { - "title": "ChildChunkCreatePayload", - "required": [ - "content" - ], - "type": "object", - "properties": { - "content": { - "title": "Content", - "type": "string" - } - } - }, - "ChildChunkListQuery": { - "title": "ChildChunkListQuery", - "type": "object", - "properties": { - "limit": { - "title": "Limit", - "minimum": 1, - "type": "integer" - }, - "keyword": { - "title": "Keyword", - "type": "object" - }, - "page": { - "title": "Page", - "minimum": 1, - "type": "integer" - } - } - }, - "ChildChunkUpdatePayload": { - "title": "ChildChunkUpdatePayload", - "required": [ - "content" - ], - "type": "object", - "properties": { - "content": { - "title": "Content", - "type": "string" - } - } - }, - "ProcessRule": { - "title": "ProcessRule", - "required": [ - "mode" - ], - "type": "object", - "properties": { - "mode": { - "title": "Mode", - "type": "string", - "enum": [ - "automatic", - "custom", - "hierarchical" - ] - }, - "rules": { - "type": "object" - } - } - }, - "RetrievalModel": { - "title": "RetrievalModel", - "required": [ - "reranking_enable", - "score_threshold_enabled", - "search_method", - "top_k" - ], - "type": "object", - "properties": { - "search_method": { - "$ref": "#/components/schemas/RetrievalMethod" - }, - "reranking_enable": { - "title": "Reranking Enable", - "type": "boolean" - }, - "reranking_model": { - "type": "object" - }, - "reranking_mode": { - "title": "Reranking Mode", - "type": "object" - }, - "top_k": { - "title": "Top K", - "type": "integer" - }, - "score_threshold_enabled": { - "title": "Score Threshold Enabled", - "type": "boolean" - }, - "score_threshold": { - "title": "Score Threshold", - "type": "object" - }, - "weights": { - "type": "object" - } - } - } - }, - "responses": { - "ParseError": { - "description": "When a mask can't be parsed", - "content": {} - }, - "MaskError": { - "description": "When any error occurs on mask", - "content": {} - }, - "HTTPException": { - "content": {} - }, - "ValueError": { - "content": {} - }, - "AppInvokeQuotaExceededError": { - "content": {} - }, - "Exception": { - "content": {} - } - }, - "securitySchemes": { - "Bearer": { - "type": "apiKey", - "description": "Type: Bearer {your-api-key}", - "name": "Authorization", - "in": "header" - } - } - }, - "x-original-swagger-version": "2.0" -} diff --git a/web/open-api/petStore.yaml b/web/open-api/petStore.yaml deleted file mode 100644 index 6bf17fbf03..0000000000 --- a/web/open-api/petStore.yaml +++ /dev/null @@ -1,985 +0,0 @@ -openapi: 3.1.0 -info: - title: Swagger Petstore - OpenAPI 3.0 - description: |- - This is a sample Pet Store Server based on the OpenAPI 3.0 specification. You can find out more about - Swagger at [https://swagger.io](https://swagger.io). In the third iteration of the pet store, we've switched to the design first approach! - You can now help us improve the API whether it's by making changes to the definition itself or to the code. - That way, with time, we can improve the API in general, and expose some of the new features in OAS3. - - Some useful links: - - [The Pet Store repository](https://github.com/swagger-api/swagger-petstore) - - [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml) - - termsOfService: http://swagger.io/terms/ - contact: - email: apiteam@swagger.io - license: - name: Apache 2.0 - url: http://www.apache.org/licenses/LICENSE-2.0.html - version: 1.0.11 -externalDocs: - description: Find out more about Swagger - url: http://swagger.io -servers: - - url: https://petstore3.swagger.io/api/v3 -tags: - - name: pet - description: Everything about your Pets - externalDocs: - description: Find out more - url: http://swagger.io - - name: store - description: Access to Petstore orders - externalDocs: - description: Find out more about our store - url: http://swagger.io - - name: user - description: Operations about user -paths: - /pet: - put: - tags: - - pet - summary: Update an existing pet - description: Update an existing pet by Id - operationId: updatePet - requestBody: - description: Update an existent pet in the store - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/Pet' - required: true - responses: - '200': - description: Successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - '400': - description: Invalid ID supplied - '404': - description: Pet not found - '405': - description: Validation exception - security: - - petstore_auth: - - write:pets - - read:pets - post: - tags: - - pet - summary: Add a new pet to the store - description: Add a new pet to the store - operationId: addPet - requestBody: - description: Create a new pet in the store - content: - application/json: - schema: - $ref: '#/components/schemas/AddPetRequest' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/Pet' - required: true - responses: - '200': - description: Successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - '405': - description: Invalid input - $ref: '#/components/responses/PetNotFound' - security: - - petstore_auth: - - write:pets - - read:pets - /pet/findByStatus: - get: - tags: - - pet - summary: Finds Pets by status - description: Multiple status values can be provided with comma separated strings - operationId: findPetsByStatus - parameters: - - name: status - in: query - description: Status values that need to be considered for filter - required: false - explode: true - schema: - type: string - default: available - enum: - - available - - pending - - sold - responses: - '200': - description: successful operation - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - type: array - items: - $ref: '#/components/schemas/Pet' - '400': - description: Invalid status value - security: - - petstore_auth: - - write:pets - - read:pets - /pet/findByTags: - get: - tags: - - pet - summary: Finds Pets by tags - description: Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - operationId: findPetsByTags - parameters: - - name: tags - in: query - description: Tags to filter by - required: false - explode: true - schema: - type: array - items: - type: string - - $ref: '#/components/parameters/page' - - $ref: '#/components/parameters/pageSize' - responses: - '200': - description: successful operation - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - type: array - items: - $ref: '#/components/schemas/Pet' - '400': - description: Invalid tag value - security: - - petstore_auth: - - write:pets - - read:pets - /pet/{petId}: - get: - tags: - - pet - summary: Find pet by ID - description: Returns a single pet - operationId: getPetById - parameters: - - name: petId - in: path - description: ID of pet to return - required: true - schema: - type: integer - format: int64 - responses: - '200': - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - '400': - description: Invalid ID supplied - '404': - description: Pet not found - security: - - api_key: [] - - petstore_auth: - - write:pets - - read:pets - post: - tags: - - pet - summary: Updates a pet in the store with form data - description: '' - operationId: updatePetWithForm - parameters: - - name: petId - in: path - description: ID of pet that needs to be updated - required: true - schema: - type: integer - format: int64 - - name: name - in: query - description: Name of pet that needs to be updated - schema: - type: string - - name: status - in: query - description: Status of pet that needs to be updated - schema: - type: string - responses: - '405': - description: Invalid input - security: - - petstore_auth: - - write:pets - - read:pets - delete: - tags: - - pet - summary: Deletes a pet - description: delete a pet - operationId: deletePet - parameters: - - name: api_key - in: header - description: '' - required: false - schema: - type: string - - name: petId - in: path - description: Pet id to delete - required: true - schema: - type: integer - format: int64 - responses: - '200': - description: items - content: - application/json: - schema: - type: array - items: - type: string - enum: - - TYPE1 - - TYPE2 - - TYPE3 - '400': - description: Invalid pet value - security: - - petstore_auth: - - write:pets - - read:pets - /pet/{petId}/uploadImage: - post: - tags: - - pet - summary: uploads an image - description: '' - operationId: uploadFile - parameters: - - name: petId - in: path - description: ID of pet to update - required: true - schema: - type: integer - format: int64 - - name: additionalMetadata - in: query - description: Additional Metadata - required: false - schema: - type: string - requestBody: - content: - application/octet-stream: - schema: - type: string - format: binary - responses: - '200': - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - security: - - petstore_auth: - - write:pets - - read:pets - /store/inventory: - get: - tags: - - store - summary: Returns pet inventories by status - description: Returns a map of status codes to quantities - operationId: getInventory - responses: - '200': - description: successful operation - content: - application/json: - schema: - type: object - additionalProperties: - type: integer - format: int32 - security: - - api_key: [] - /store/order: - post: - tags: - - store - summary: Place an order for a pet - description: Place a new order in the store - operationId: placeOrder - requestBody: - content: - application/json: - schema: - description: Order description - pattern: '^[a-zA-Z0-9]{1,13}$' - $ref: '#/components/schemas/Order' - application/xml: - schema: - $ref: '#/components/schemas/Order' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/Order' - responses: - '200': - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/Order' - '405': - description: Invalid input - - patch: - tags: - - store - summary: Place an order for a pet with patch - description: Place a new order in the store with patch - operationId: placeOrderPatch - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Order' - application/xml: - schema: - $ref: '#/components/schemas/Order' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/Order' - responses: - '200': - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/Order' - '405': - description: Invalid input - /store/order/{orderId}: - get: - tags: - - store - summary: Find purchase order by ID - description: For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. - operationId: getOrderById - parameters: - - name: orderId - in: path - description: ID of order that needs to be fetched - required: true - schema: - type: integer - format: int64 - responses: - '200': - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/Order' - application/xml: - schema: - $ref: '#/components/schemas/Order' - '400': - description: Invalid ID supplied - '404': - description: Order not found - delete: - tags: - - store - summary: Delete purchase order by ID - description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - operationId: deleteOrder - parameters: - - name: orderId - in: path - description: ID of the order that needs to be deleted - required: true - schema: - type: integer - format: int64 - responses: - '400': - description: Invalid ID supplied - '404': - description: Order not found - /user: - post: - tags: - - user - summary: Create user - description: This can only be done by the logged in user. - operationId: createUser - requestBody: - description: Created user object - content: - application/json: - schema: - $ref: '#/components/schemas/User' - application/xml: - schema: - $ref: '#/components/schemas/User' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/User' - responses: - default: - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/User' - application/xml: - schema: - $ref: '#/components/schemas/User' - /user/createWithList: - post: - tags: - - user - summary: Creates list of users with given input array - description: Creates list of users with given input array - operationId: createUsersWithListInput - requestBody: - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/User' - responses: - '200': - description: Successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/User' - application/xml: - schema: - $ref: '#/components/schemas/User' - default: - description: successful operation - /user/login: - get: - tags: - - user - summary: Logs user into the system - description: '' - operationId: loginUser - parameters: - - name: username - in: query - description: The user name for login - required: false - schema: - type: string - - name: password - in: query - description: The password for login in clear text - required: false - schema: - type: string - responses: - '200': - description: successful operation - headers: - X-Rate-Limit: - description: calls per hour allowed by the user - schema: - type: integer - format: int32 - X-Expires-After: - description: date in UTC when token expires - schema: - type: string - format: date-time - content: - application/xml: - schema: - type: string - application/json: - schema: - type: string - '400': - description: Invalid username/password supplied - /user/logout: - get: - tags: - - user - summary: Logs out current logged in user session - description: '' - operationId: logoutUser - parameters: [] - responses: - default: - description: successful operation - /user/{username}: - get: - tags: - - user - summary: Get user by user name - description: '' - operationId: getUserByName - parameters: - - name: username - in: path - description: 'The name that needs to be fetched. Use user1 for testing. ' - required: true - schema: - type: string - responses: - '200': - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/User' - application/xml: - schema: - $ref: '#/components/schemas/User' - '400': - description: Invalid username supplied - '404': - description: User not found - put: - tags: - - user - summary: Update user - description: This can only be done by the logged in user. - operationId: updateUser - parameters: - - name: username - in: path - description: name that need to be deleted - required: true - schema: - type: string - requestBody: - description: Update an existent user in the store - content: - application/json: - schema: - $ref: '#/components/schemas/User' - application/xml: - schema: - $ref: '#/components/schemas/User' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/User' - responses: - default: - description: successful operation - delete: - tags: - - user - summary: Delete user - description: This can only be done by the logged in user. - operationId: deleteUser - parameters: - - name: username - in: path - description: The name that needs to be deleted - required: true - schema: - type: string - nullable: true - responses: - '400': - description: Invalid username supplied - '404': - description: User not found -components: - schemas: - Order: - type: object - properties: - id: - type: integer - format: int64 - example: 10 - petId: - type: integer - format: int64 - example: 198772 - quantity: - type: integer - format: int32 - example: 7 - shipDate: - type: string - format: date-time - status: - description: Order Status - anyOf: - - type: string - const: '' - - type: string - format: email - http_status: - type: number - description: HTTP Status - example: 200 - enum: - - 200 - - 400 - - 500 - complete: - type: boolean - xml: - name: order - Customer: - type: object - properties: - id: - type: integer - format: int64 - example: 100000 - username: - type: string - example: fehguy - address: - type: array - xml: - name: addresses - wrapped: true - items: - $ref: '#/components/schemas/Address' - xml: - name: customer - HappyCustomer: - allOf: - - $ref: '#/components/schemas/Customer' - - type: object - properties: - isHappy: - type: boolean - const: true - UnhappyCustomer: - allOf: - - $ref: '#/components/schemas/Customer' - - type: object - properties: - reasonToBeUnhappy: - type: string - isHappy: - type: boolean - const: false - Address: - type: object - properties: - streetName: - type: string - streetNumber: - type: string - city: - type: string - example: Palo Alto - state: - type: string - example: CA - zip: - type: string - example: '94301' - xml: - name: address - Category: - type: object - properties: - id: - type: integer - format: int64 - example: 1 - name: - type: string - example: Dogs - xml: - name: category - User: - type: object - properties: - id: - type: integer - format: int64 - example: 10 - username: - type: string - example: theUser - firstName: - type: string - example: John - lastName: - type: string - example: James - email: - type: string - example: john@email.com - password: - type: string - example: '12345' - phone: - type: string - example: '12345' - userStatus: - type: integer - description: User Status - format: int32 - example: 1 - xml: - name: user - Tag: - type: object - properties: - id: - type: integer - format: int64 - name: - type: string - xml: - name: tag - - Pet: - required: - - name - - photoUrls - - type - type: object - oneOf: - - $ref: '#/components/schemas/Dog' - - $ref: '#/components/schemas/Cat' - discriminator: - propertyName: type - mapping: - dog: '#/components/schemas/Dog' - cat: '#/components/schemas/Cat' - properties: - id: - type: integer - format: int64 - example: 10 - type: - minLength: 1 - enum: - - dog - - cat - type: string - readOnly: true - name: - type: string - example: doggie - category: - $ref: 'https://petstore3.swagger.io/api/v3/openapi.json#/components/schemas/Category' - photoUrls: - type: array - xml: - wrapped: true - items: - type: string - xml: - name: photoUrl - tags: - type: array - xml: - wrapped: true - readOnly: true - items: - $ref: '#/components/schemas/Tag' - status: - type: string - description: pet status in the store - enum: - - available - - pending - - sold - xml: - name: pet - Cat: - type: object - # all other properties specific to a `Cat` - properties: - type: - minLength: 1 - type: string - readOnly: true - name: - type: string - Dog: - type: object - # all other properties specific to a `Dog` - properties: - type: - minLength: 1 - type: string - readOnly: true - bark: - type: string - FullAddress: - properties: - streetName: - type: string - allOf: - - $ref: '#/components/schemas/Address' - required: - - streetName - - streetNumber - AddPetRequest: - required: - - name - - photoUrls - type: object - properties: - id: - type: integer - format: int64 - example: 10 - name: - type: string - example: doggie - category: - $ref: '#/components/schemas/Category' - photoUrls: - type: array - xml: - wrapped: true - items: - type: string - xml: - name: photoUrl - tags: - type: array - xml: - wrapped: true - items: - $ref: '#/components/schemas/Tag' - status: - type: string - description: pet status in the store - enum: - - available - - pending - - sold - - in store - xml: - name: pet - ApiResponse: - type: object - properties: - code: - type: integer - format: int32 - type: - type: string - message: - type: string - xml: - name: '##default' - requestBodies: - Pet: - description: Pet object that needs to be added to the store - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - UserArray: - description: List of user object - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/User' - securitySchemes: - petstore_auth: - type: oauth2 - flows: - implicit: - authorizationUrl: https://petstore3.swagger.io/oauth/authorize - scopes: - write:pets: modify pets in your account - read:pets: read your pets - api_key: - type: apiKey - name: api_key - in: header - parameters: - page: - description: to request with required page number or pagination - in: query - name: page - required: false - schema: - type: string - pageSize: - description: to request with required page size - in: query - name: pageSize - required: false - schema: - type: string - responses: - PetNotFound: - content: - application/json: - schema: - properties: - code: - format: int32 - type: integer - message: - type: string - description: Pet not found diff --git a/web/openapi-ts.config.ts b/web/openapi-ts.config.ts index 01e7dd45b3..d23105236f 100644 --- a/web/openapi-ts.config.ts +++ b/web/openapi-ts.config.ts @@ -3,7 +3,7 @@ import { defineConfig } from '@hey-api/openapi-ts' import { defineConfig as defineOrpcConfig } from './plugins/hey-api-orpc/config' export default defineConfig({ - input: './open-api/petStore.yaml', + input: '../open-api/fastopenapi.json', output: { indexFile: false, path: './gen',