@@ -37,12 +37,19 @@ import type {
3737 DeletePetData ,
3838 DeleteUserData ,
3939 FindPetsByStatusData ,
40+ FindPetsByStatusResponse ,
4041 FindPetsByTagsData ,
42+ FindPetsByTagsResponse ,
4143 GetInventoryData ,
44+ GetInventoryResponse ,
4245 GetOrderByIdData ,
46+ GetOrderByIdResponse ,
4347 GetPetByIdData ,
48+ GetPetByIdResponse ,
4449 GetUserByNameData ,
50+ GetUserByNameResponse ,
4551 LoginUserData ,
52+ LoginUserResponse ,
4653 LogoutUserData ,
4754 PlaceOrderData ,
4855 PlaceOrderResponse ,
@@ -136,26 +143,32 @@ const createQueryKey = <TOptions extends Options>(
136143 *
137144 * Multiple status values can be provided with comma separated strings.
138145 */
139- export const findPetsByStatusQuery = defineQueryOptions (
140- ( options : Options < FindPetsByStatusData > ) => ( {
141- key : createQueryKey ( 'findPetsByStatus' , options ) ,
142- query : async ( context ) => {
143- const { data } = await findPetsByStatus ( {
144- ...options ,
145- ...context ,
146- throwOnError : true ,
147- } ) ;
148- return data ;
149- } ,
150- } ) ,
151- ) ;
146+ export const findPetsByStatusQuery = defineQueryOptions <
147+ Options < FindPetsByStatusData > ,
148+ FindPetsByStatusResponse ,
149+ Error
150+ > ( ( options : Options < FindPetsByStatusData > ) => ( {
151+ key : createQueryKey ( 'findPetsByStatus' , options ) ,
152+ query : async ( context ) => {
153+ const { data } = await findPetsByStatus ( {
154+ ...options ,
155+ ...context ,
156+ throwOnError : true ,
157+ } ) ;
158+ return data ;
159+ } ,
160+ } ) ) ;
152161
153162/**
154163 * Finds Pets by tags.
155164 *
156165 * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
157166 */
158- export const findPetsByTagsQuery = defineQueryOptions ( ( options : Options < FindPetsByTagsData > ) => ( {
167+ export const findPetsByTagsQuery = defineQueryOptions <
168+ Options < FindPetsByTagsData > ,
169+ FindPetsByTagsResponse ,
170+ Error
171+ > ( ( options : Options < FindPetsByTagsData > ) => ( {
159172 key : createQueryKey ( 'findPetsByTags' , options ) ,
160173 query : async ( context ) => {
161174 const { data } = await findPetsByTags ( {
@@ -190,7 +203,11 @@ export const deletePetMutation = (
190203 *
191204 * Returns a single pet.
192205 */
193- export const getPetByIdQuery = defineQueryOptions ( ( options : Options < GetPetByIdData > ) => ( {
206+ export const getPetByIdQuery = defineQueryOptions <
207+ Options < GetPetByIdData > ,
208+ GetPetByIdResponse ,
209+ Error
210+ > ( ( options : Options < GetPetByIdData > ) => ( {
194211 key : createQueryKey ( 'getPetById' , options ) ,
195212 query : async ( context ) => {
196213 const { data } = await getPetById ( {
@@ -243,7 +260,11 @@ export const uploadFileMutation = (
243260 *
244261 * Returns a map of status codes to quantities.
245262 */
246- export const getInventoryQuery = defineQueryOptions ( ( options ?: Options < GetInventoryData > ) => ( {
263+ export const getInventoryQuery = defineQueryOptions <
264+ Options < GetInventoryData > ,
265+ GetInventoryResponse ,
266+ Error
267+ > ( ( options ?: Options < GetInventoryData > ) => ( {
247268 key : createQueryKey ( 'getInventory' , options ) ,
248269 query : async ( context ) => {
249270 const { data } = await getInventory ( {
@@ -296,7 +317,11 @@ export const deleteOrderMutation = (
296317 *
297318 * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions.
298319 */
299- export const getOrderByIdQuery = defineQueryOptions ( ( options : Options < GetOrderByIdData > ) => ( {
320+ export const getOrderByIdQuery = defineQueryOptions <
321+ Options < GetOrderByIdData > ,
322+ GetOrderByIdResponse ,
323+ Error
324+ > ( ( options : Options < GetOrderByIdData > ) => ( {
300325 key : createQueryKey ( 'getOrderById' , options ) ,
301326 query : async ( context ) => {
302327 const { data } = await getOrderById ( {
@@ -353,34 +378,38 @@ export const createUsersWithListInputMutation = (
353378 *
354379 * Log into the system.
355380 */
356- export const loginUserQuery = defineQueryOptions ( ( options ?: Options < LoginUserData > ) => ( {
357- key : createQueryKey ( 'loginUser' , options ) ,
358- query : async ( context ) => {
359- const { data } = await loginUser ( {
360- ...options ,
361- ...context ,
362- throwOnError : true ,
363- } ) ;
364- return data ;
365- } ,
366- } ) ) ;
381+ export const loginUserQuery = defineQueryOptions < Options < LoginUserData > , LoginUserResponse , Error > (
382+ ( options ?: Options < LoginUserData > ) => ( {
383+ key : createQueryKey ( 'loginUser' , options ) ,
384+ query : async ( context ) => {
385+ const { data } = await loginUser ( {
386+ ...options ,
387+ ...context ,
388+ throwOnError : true ,
389+ } ) ;
390+ return data ;
391+ } ,
392+ } ) ,
393+ ) ;
367394
368395/**
369396 * Logs out current logged in user session.
370397 *
371398 * Log user out of the system.
372399 */
373- export const logoutUserQuery = defineQueryOptions ( ( options ?: Options < LogoutUserData > ) => ( {
374- key : createQueryKey ( 'logoutUser' , options ) ,
375- query : async ( context ) => {
376- const { data } = await logoutUser ( {
377- ...options ,
378- ...context ,
379- throwOnError : true ,
380- } ) ;
381- return data ;
382- } ,
383- } ) ) ;
400+ export const logoutUserQuery = defineQueryOptions < Options < LogoutUserData > , unknown , Error > (
401+ ( options ?: Options < LogoutUserData > ) => ( {
402+ key : createQueryKey ( 'logoutUser' , options ) ,
403+ query : async ( context ) => {
404+ const { data } = await logoutUser ( {
405+ ...options ,
406+ ...context ,
407+ throwOnError : true ,
408+ } ) ;
409+ return data ;
410+ } ,
411+ } ) ,
412+ ) ;
384413
385414/**
386415 * Delete user resource.
@@ -405,7 +434,11 @@ export const deleteUserMutation = (
405434 *
406435 * Get user detail based on username.
407436 */
408- export const getUserByNameQuery = defineQueryOptions ( ( options : Options < GetUserByNameData > ) => ( {
437+ export const getUserByNameQuery = defineQueryOptions <
438+ Options < GetUserByNameData > ,
439+ GetUserByNameResponse ,
440+ Error
441+ > ( ( options : Options < GetUserByNameData > ) => ( {
409442 key : createQueryKey ( 'getUserByName' , options ) ,
410443 query : async ( context ) => {
411444 const { data } = await getUserByName ( {
0 commit comments