dify/web/gen/orpc.gen.ts
2026-01-24 23:11:27 +08:00

138 lines
5.2 KiB
TypeScript

// 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'
export const base = oc.$route({ inputStructure: 'detailed' })
/**
* Add a new pet to the store
*/
export const addPetContract = base.route({ path: '/pet', method: 'POST' }).input(zAddPetData).output(zAddPetResponse)
/**
* 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 type Contracts = typeof contracts